WhatsApp me - Version 4.5.0

Version Description

Download this release

Release Info

Developer creapuntome
Plugin Icon 128x128 WhatsApp me
Version 4.5.0
Comparing to
See all releases

Code changes from version 4.4.3 to 4.5.0

Files changed (41) hide show
  1. README.txt +39 -13
  2. admin/class-joinchat-admin-page.php +838 -0
  3. admin/class-joinchat-admin.php +45 -882
  4. admin/class-joinchat-woo-admin.php +26 -24
  5. admin/css/joinchat.css +31 -5
  6. admin/css/joinchat.min.css +1 -1
  7. admin/img/qr.png +0 -0
  8. admin/js/joinchat.js +1 -9
  9. admin/js/joinchat.min.js +1 -1
  10. admin/partials/post_meta_box.php +1 -1
  11. admin/partials/term_meta_box.php +1 -1
  12. gutenberg/build/block_btn/block.json +94 -0
  13. gutenberg/build/index.asset.php +1 -0
  14. gutenberg/build/index.css +2 -0
  15. gutenberg/build/index.js +1 -0
  16. gutenberg/build/style-index.css +1 -0
  17. gutenberg/class-joinchat-gutenberg.php +266 -0
  18. includes/class-joinchat-common.php +115 -9
  19. includes/class-joinchat-elementor-finder.php +1 -1
  20. includes/class-joinchat-i18n.php +10 -8
  21. includes/class-joinchat-integrations.php +2 -3
  22. includes/class-joinchat-loader.php +7 -7
  23. includes/class-joinchat-util.php +27 -29
  24. includes/class-joinchat.php +40 -52
  25. joinchat.php +2 -2
  26. languages/creame-whatsapp-me.pot +499 -418
  27. public/class-joinchat-elementor-public.php +3 -2
  28. public/class-joinchat-public.php +197 -171
  29. public/class-joinchat-woo-public.php +24 -22
  30. public/css/joinchat-btn.css +4 -6
  31. public/css/joinchat-btn.min.css +1 -1
  32. public/css/joinchat-woo.css +4 -0
  33. public/css/joinchat-woo.min.css +1 -1
  34. public/css/joinchat.css +4 -0
  35. public/css/joinchat.min.css +1 -1
  36. public/js/joinchat-lite.js +137 -0
  37. public/js/joinchat-lite.min.js +1 -0
  38. public/js/joinchat.js +37 -25
  39. public/js/joinchat.min.js +1 -1
  40. public/partials/html.php +11 -11
  41. public/partials/script.php +0 -23
README.txt CHANGED
@@ -2,10 +2,10 @@
2
  Contributors: creapuntome, pacotole, davidlillo, monillo
3
  Donate link: https://join.chat/donate/
4
  Tags: Chat, Click to Chat, Facebook Messenger, WhatsApp, Telegram, Whatsapp Business, button, support chat, support, contact, directly message WhatsApp, floating WhatsApp, WhatsApp chat
5
- Requires at least: 3.5.0
6
- Tested up to: 5.9
7
  Requires PHP: 5.3
8
- Stable tag: 4.4.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -20,13 +20,15 @@ WhatsApp, Messenger, Telegram, Phone call… capture users through their favorit
20
 
21
  https://www.youtube.com/watch?v=Ad2ZpPnX_3Q
22
 
23
- [Documentation](https://join.chat/en/docs/?utm_source=wporg&utm_medium=web&utm_campaign=v4_4) | [Premium](https://join.chat/en/premium/?utm_source=wporg&utm_medium=web&utm_campaign=v4_4) | [Support](https://join.chat/en/support/?utm_source=wporg&utm_medium=web&utm_campaign=v4_4)
24
 
25
  ### ⌁ What you can do with Join.chat (formerly WAme) ✅
26
 
27
  #### 🛎 Insert a contact button for WhatsApp on your website.
28
  Set your ‘WhatsApp’ or ‘WhatsApp Business’ number and let your visitors contact you easily:
29
 
 
 
30
  📱 On mobile, launch WhatsApp mobile app
31
 
32
  💻 On desktop, launch WhatsApp desktop app or WhatsApp Web
@@ -71,6 +73,15 @@ Define CTAs and Custom Start Messages for shop page, product pages and for produ
71
 
72
  Add a **WhatsApp Contact Button** directly on your product page next to the "Add to cart" button.
73
 
 
 
 
 
 
 
 
 
 
74
  #### 🃏 Dynamic Variables.
75
  Use variables in your CTAs and Start Messages that change dynamically for each page:
76
 
@@ -108,6 +119,11 @@ Any element in your page can be a chat trigger, eg: it can launch WhatsApp from
108
  * class `"joinchat_show"` opens Joinchat CTA (first time)
109
  * class `"joinchat_force_show"` opens Joinchat CTA (always)
110
 
 
 
 
 
 
111
  #### 💱 Multi-Language & RTL Support.
112
  To be able to support all your users, wherever they are. Our plugin is **compatible with WPML and Polylang** and also **RTL languages** are supported.
113
 
@@ -137,7 +153,7 @@ This feature will allow you to add more chat apps to the basic plugin, in additi
137
  #### 🥁 [Convincing Calls to Action](https://join.chat/en/addons/cta-extras/?utm_source=wporg&utm_medium=web&utm_campaign=v4_4).
138
  Use our embed tool to beautifully design the content that appears in the chat window. Drive your leads from landings to sales and conversion pages. Add links, images, animated GIFs, buttons or even embedded content from other platforms, surveys, chatbots, forms...
139
 
140
- [👉 Upgrade Joinchat Now](https://join.chat/en/premium/?utm_source=wporg&utm_medium=web&utm_campaign=v4_4)
141
 
142
  ### 🧪 Try Join.chat
143
  Do you want to test the Join.chat configuration panel without installing it? You can try it in a [WordPress on the fly demo](https://demo.tastewp.com/creame-whatsapp-me)
@@ -201,7 +217,7 @@ Join.chat does not provide any shortcodes, but you can easily link to WhatsApp i
201
 
202
  This works with your phone settings and message with dynamic variables, **even on pages without Join.chat visible**.
203
 
204
- For custom WhatsApp links, you can create the url with our **[WhatsApp link generator](https://join.chat/en/whatsapp-link/?utm_source=wporg&utm_medium=web&utm_campaign=v4_4) free tool** and copy it to your links.
205
 
206
  = Disable enhanced telephone input =
207
 
@@ -237,16 +253,16 @@ If Google Analytics 4 (gtag.js) is detected, use the recommended `'generate_lead
237
 
238
  `gtag('event', 'generate_lead', {
239
  event_category: 'JoinChat',
240
- event_action: 'WhatsApp: 99999999999',
241
  event_label: destination_url,
242
- chat_channel: 'WhatsApp',
243
  chat_id: '99999999999',
244
  is_mobile: 'yes' | 'no',
245
  });`
246
 
247
  If Universal Analtics (analytics.js) is detected:
248
 
249
- `ga('send', 'event', 'JoinChat', 'WhatsApp: 99999999999', destination_url);`
250
 
251
  If your site don't have standard names for UA tracker ('ga') or data layer ('dataLayer') you can set your custom names with this filter:
252
 
@@ -264,9 +280,9 @@ Join.chat sends a `'JoinChat'` event if GTM is detected when user launch WhatsAp
264
 
265
  `dataLayer.push({
266
  event: 'JoinChat',
267
- event_action: 'WhatsApp: 99999999999',
268
  event_label: destination_url,
269
- chat_channel: 'WhatsApp',
270
  chat_id: '99999999999',
271
  is_mobile: 'yes' | 'no',
272
  page_location: current_url,
@@ -278,9 +294,9 @@ Join.chat sends a `'JoinChat'` event if GTM is detected when user launch WhatsAp
278
  Join.chat sends a `'JoinChat'` custom event if Facebook Pixel is detected when user launch WhatsApp:
279
 
280
  `fbq('trackCustom', 'JoinChat', {
281
- event_action: 'WhatsApp: 99999999999',
282
  event_label: destination_url,
283
- chat_channel: 'WhatsApp',
284
  chat_id: '99999999999',
285
  is_mobile: 'yes' | 'no',
286
  page_location: current_url,
@@ -331,6 +347,16 @@ Join.chat save two localStorage variables for proper operation:
331
 
332
  == Changelog ==
333
 
 
 
 
 
 
 
 
 
 
 
334
  = 4.4.3 =
335
  * Minor CSS fixes and optimizations.
336
 
2
  Contributors: creapuntome, pacotole, davidlillo, monillo
3
  Donate link: https://join.chat/donate/
4
  Tags: Chat, Click to Chat, Facebook Messenger, WhatsApp, Telegram, Whatsapp Business, button, support chat, support, contact, directly message WhatsApp, floating WhatsApp, WhatsApp chat
5
+ Requires at least: 4.4.0
6
+ Tested up to: 6.0
7
  Requires PHP: 5.3
8
+ Stable tag: 4.5.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
20
 
21
  https://www.youtube.com/watch?v=Ad2ZpPnX_3Q
22
 
23
+ [Documentation](https://join.chat/en/docs/?utm_source=wporg&utm_medium=web&utm_campaign=v4_4) | [**Premium**](https://join.chat/en/premium/?utm_source=wporg&utm_medium=web&utm_campaign=v4_4) | [Support](https://join.chat/en/support/?utm_source=wporg&utm_medium=web&utm_campaign=v4_4)
24
 
25
  ### ⌁ What you can do with Join.chat (formerly WAme) ✅
26
 
27
  #### 🛎 Insert a contact button for WhatsApp on your website.
28
  Set your ‘WhatsApp’ or ‘WhatsApp Business’ number and let your visitors contact you easily:
29
 
30
+ 🧩 **NEW!! WhatsApp Contact Button Block** with optional QR Code
31
+
32
  📱 On mobile, launch WhatsApp mobile app
33
 
34
  💻 On desktop, launch WhatsApp desktop app or WhatsApp Web
73
 
74
  Add a **WhatsApp Contact Button** directly on your product page next to the "Add to cart" button.
75
 
76
+ #### 🧩 WhatsApp Contact Button Block.
77
+ Add beautiful and customizable WhatsApp contact buttons in the Block Editor.
78
+
79
+ Ready to use patterns with different styles are also included.
80
+
81
+ Enable QR Code on desktop to allow your visitors to scan it and start messaging from their phone.
82
+
83
+ You can define phone and initial message of the button or use the post/general Joinchat settings (ideal for Reusable Blocks).
84
+
85
  #### 🃏 Dynamic Variables.
86
  Use variables in your CTAs and Start Messages that change dynamically for each page:
87
 
119
  * class `"joinchat_show"` opens Joinchat CTA (first time)
120
  * class `"joinchat_force_show"` opens Joinchat CTA (always)
121
 
122
+ Set **custom phone and initial message** for direct WhatsApp triggers:
123
+
124
+ * `data-phone="99999999"`
125
+ * `data-message="Only for this trigger message"`.
126
+
127
  #### 💱 Multi-Language & RTL Support.
128
  To be able to support all your users, wherever they are. Our plugin is **compatible with WPML and Polylang** and also **RTL languages** are supported.
129
 
153
  #### 🥁 [Convincing Calls to Action](https://join.chat/en/addons/cta-extras/?utm_source=wporg&utm_medium=web&utm_campaign=v4_4).
154
  Use our embed tool to beautifully design the content that appears in the chat window. Drive your leads from landings to sales and conversion pages. Add links, images, animated GIFs, buttons or even embedded content from other platforms, surveys, chatbots, forms...
155
 
156
+ [**👉 Upgrade Joinchat Now**](https://join.chat/en/premium/?utm_source=wporg&utm_medium=web&utm_campaign=v4_4)
157
 
158
  ### 🧪 Try Join.chat
159
  Do you want to test the Join.chat configuration panel without installing it? You can try it in a [WordPress on the fly demo](https://demo.tastewp.com/creame-whatsapp-me)
217
 
218
  This works with your phone settings and message with dynamic variables, **even on pages without Join.chat visible**.
219
 
220
+ For custom direct WhatsApp links you can add `data-phone` and `data-message` attributes.<br>e.g.: `<a href="#whatsapp" data-phone="99999999" data-message="I want to chat">Chat now!</a>`
221
 
222
  = Disable enhanced telephone input =
223
 
253
 
254
  `gtag('event', 'generate_lead', {
255
  event_category: 'JoinChat',
256
+ event_action: 'whatsapp: 99999999999',
257
  event_label: destination_url,
258
+ chat_channel: 'whatsapp',
259
  chat_id: '99999999999',
260
  is_mobile: 'yes' | 'no',
261
  });`
262
 
263
  If Universal Analtics (analytics.js) is detected:
264
 
265
+ `ga('send', 'event', 'JoinChat', 'whatsapp: 99999999999', destination_url);`
266
 
267
  If your site don't have standard names for UA tracker ('ga') or data layer ('dataLayer') you can set your custom names with this filter:
268
 
280
 
281
  `dataLayer.push({
282
  event: 'JoinChat',
283
+ event_action: 'whatsapp: 99999999999',
284
  event_label: destination_url,
285
+ chat_channel: 'whatsapp',
286
  chat_id: '99999999999',
287
  is_mobile: 'yes' | 'no',
288
  page_location: current_url,
294
  Join.chat sends a `'JoinChat'` custom event if Facebook Pixel is detected when user launch WhatsApp:
295
 
296
  `fbq('trackCustom', 'JoinChat', {
297
+ event_action: 'whatsapp: 99999999999',
298
  event_label: destination_url,
299
+ chat_channel: 'whatsapp',
300
  chat_id: '99999999999',
301
  is_mobile: 'yes' | 'no',
302
  page_location: current_url,
347
 
348
  == Changelog ==
349
 
350
+ = 4.5 =
351
+ * **NEW: Added Gutenberg native support.**
352
+ * **NEW:** WhastApp Contact Button Block.
353
+ * **NEW:** Native Joinchat sidebar on Block Editor.
354
+ * **NEW:** Direct WhatsApp triggers can use custom phone and initial message.
355
+ * **NEW:** Triggers also fire analytics events even without the Joinchat floating button.
356
+ * CHANGED Bump min WordPress version to 4.4 and tested up to 6.0.
357
+ * CHANGED Can change default "JoinChat" event name via javascript event.
358
+ * CHANGED Improved interface to enter phone with country code and Google Ads conversion ID.
359
+
360
  = 4.4.3 =
361
  * Minor CSS fixes and optimizations.
362
 
admin/class-joinchat-admin-page.php ADDED
@@ -0,0 +1,838 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The admin settings page of the plugin.
5
+ *
6
+ * @since 4.5.0
7
+ * @package JoinChat
8
+ * @subpackage JoinChat/admin
9
+ * @author Creame <hola@crea.me>
10
+ */
11
+ class JoinChatAdminPage {
12
+
13
+ /**
14
+ * The ID of this plugin.
15
+ *
16
+ * @since 4.5.0
17
+ * @access private
18
+ * @var string $plugin_name The ID of this plugin.
19
+ */
20
+ private $plugin_name;
21
+
22
+ /**
23
+ * The version of this plugin.
24
+ *
25
+ * @since 4.5.0
26
+ * @access private
27
+ * @var string $version The current version of this plugin.
28
+ */
29
+ private $version;
30
+
31
+ /**
32
+ * Common class for admin and front methods.
33
+ *
34
+ * @since 4.5.0
35
+ * @access private
36
+ * @var JoinChatCommon $common instance.
37
+ */
38
+ private $common;
39
+
40
+ /**
41
+ * Admin page tabs
42
+ *
43
+ * @since 4.5.0
44
+ * @access private
45
+ * @var array $tabs Admin page tabs.
46
+ */
47
+ private $tabs;
48
+
49
+ /**
50
+ * Initialize the class and set its properties.
51
+ *
52
+ * @since 4.5.0
53
+ * @param string $plugin_name The name of this plugin.
54
+ * @param string $version The version of this plugin.
55
+ */
56
+ public function __construct( $plugin_name, $version ) {
57
+
58
+ $this->plugin_name = $plugin_name;
59
+ $this->version = $version;
60
+ $this->common = JoinChatCommon::instance();
61
+ $this->tabs = array();
62
+
63
+ }
64
+
65
+ /**
66
+ * Add menu to the options page in the WordPress admin
67
+ *
68
+ * @since 4.5.0
69
+ * @access public
70
+ * @return void
71
+ */
72
+ public function add_menu() {
73
+
74
+ $title = 'Join.chat';
75
+
76
+ if ( JoinChatUtil::options_submenu() ) {
77
+ $icon = '<span class="dashicons dashicons-whatsapp" aria-hidden="true" style="height:18px;font-size:18px;margin:0 8px;"></span>';
78
+
79
+ add_options_page( $title, $title . $icon, JoinChatUtil::capability(), $this->plugin_name, array( $this, 'options_page' ) );
80
+ } else {
81
+ add_menu_page( $title, $title, JoinChatUtil::capability(), $this->plugin_name, array( $this, 'options_page' ), 'dashicons-whatsapp', 81 );
82
+ }
83
+
84
+ }
85
+
86
+ /**
87
+ * Initialize the settings for WordPress admin
88
+ *
89
+ * @since 4.5.0
90
+ * @access public
91
+ * @return void
92
+ */
93
+ public function settings_init() {
94
+
95
+ // Admin tabs.
96
+ $this->tabs = apply_filters(
97
+ 'joinchat_admin_tabs',
98
+ array(
99
+ 'general' => __( 'General', 'creame-whatsapp-me' ),
100
+ 'visibility' => __( 'Visibility', 'creame-whatsapp-me' ),
101
+ 'advanced' => __( 'Advanced', 'creame-whatsapp-me' ),
102
+ )
103
+ );
104
+
105
+ // Register WordPress 'joinchat' settings.
106
+ register_setting( $this->plugin_name, $this->plugin_name, array( $this, 'settings_validate' ) );
107
+
108
+ foreach ( $this->tabs as $tab => $tab_name ) {
109
+
110
+ add_settings_section( "joinchat_tab_{$tab}_open", null, array( $this, 'settings_tab_open' ), $this->plugin_name );
111
+
112
+ $sections = $this->get_tab_sections( $tab );
113
+
114
+ foreach ( $sections as $section => $fields ) {
115
+ $section_id = "joinchat_tab_{$tab}__{$section}";
116
+
117
+ add_settings_section( $section_id, null, array( $this, 'section_output' ), $this->plugin_name );
118
+
119
+ foreach ( $fields as $field => $field_args ) {
120
+ if ( is_array( $field_args ) ) {
121
+ $field_name = $field_args['label'];
122
+ $field_callback = $field_args['callback'];
123
+ } else {
124
+ $field_name = $field_args;
125
+ $field_callback = array( $this, 'field_output' );
126
+ }
127
+
128
+ add_settings_field( "joinchat_$field", $field_name, $field_callback, $this->plugin_name, $section_id, $field );
129
+ }
130
+ }
131
+
132
+ add_settings_section( "joinchat_tab_{$tab}_close", null, array( $this, 'settings_tab_close' ), $this->plugin_name );
133
+ }
134
+
135
+ }
136
+
137
+ /**
138
+ * Return an array of sections and fields for the admin tab
139
+ *
140
+ * @since 4.5.0
141
+ * @param string $tab The id of the admin tab.
142
+ * @return array
143
+ */
144
+ private function get_tab_sections( $tab ) {
145
+
146
+ if ( 'general' === $tab ) {
147
+
148
+ $sections = array(
149
+ 'button' => array(
150
+ 'telephone' => '<label for="joinchat_phone">' . __( 'Telephone', 'creame-whatsapp-me' ) . '</label>',
151
+ 'message_send' => '<label for="joinchat_message_send">' . __( 'Message', 'creame-whatsapp-me' ) . '</label>' . self::vars_help( 'message_send' ),
152
+ 'button_image' => __( 'Image', 'creame-whatsapp-me' ),
153
+ 'button_tip' => '<label for="joinchat_button_tip">' . __( 'Tooltip', 'creame-whatsapp-me' ) . '</label>',
154
+ 'position' => __( 'Position on Screen', 'creame-whatsapp-me' ),
155
+ 'button_delay' => '<label for="joinchat_button_delay">' . __( 'Button Delay', 'creame-whatsapp-me' ) . '</label>',
156
+ 'mobile_only' => __( 'Mobile Only', 'creame-whatsapp-me' ),
157
+ 'whatsapp_web' => __( 'WhatsApp Web', 'creame-whatsapp-me' ),
158
+ 'qr' => __( 'QR Code', 'creame-whatsapp-me' ),
159
+ ),
160
+ 'chat' => array(
161
+ 'message_text' => '<label for="joinchat_message_text">' . __( 'Call to Action', 'creame-whatsapp-me' ) . '</label>' . self::vars_help( 'message_text' ),
162
+ 'message_start' => '<label for="joinchat_message_start">' . __( 'Button Text', 'creame-whatsapp-me' ) . '</label>',
163
+ 'color' => __( 'Theme Color', 'creame-whatsapp-me' ),
164
+ 'dark_mode' => __( 'Dark Mode', 'creame-whatsapp-me' ),
165
+ 'header' => __( 'Header', 'creame-whatsapp-me' ),
166
+ ),
167
+ 'chat_open' => array(
168
+ 'message_delay' => '<label for="joinchat_message_delay">' . __( 'Chat Delay', 'creame-whatsapp-me' ) . '</label>',
169
+ 'message_views' => '<label for="joinchat_message_views">' . __( 'Page Views', 'creame-whatsapp-me' ) . '</label>',
170
+ 'message_badge' => __( 'Notification Balloon', 'creame-whatsapp-me' ),
171
+ ),
172
+ );
173
+
174
+ } elseif ( 'visibility' === $tab ) {
175
+
176
+ $sections = array(
177
+ 'global' => array(
178
+ 'view__all' => array(
179
+ 'label' => __( 'Global', 'creame-whatsapp-me' ),
180
+ 'callback' => array( $this, 'field_view_all' ),
181
+ ),
182
+ ),
183
+ 'wp' => array(
184
+ 'view__front_page' => __( 'Front Page', 'creame-whatsapp-me' ),
185
+ 'view__blog_page' => __( 'Blog Page', 'creame-whatsapp-me' ),
186
+ 'view__404_page' => __( '404 Page', 'creame-whatsapp-me' ),
187
+ 'view__search' => __( 'Search Results', 'creame-whatsapp-me' ),
188
+ 'view__archive' => __( 'Archives', 'creame-whatsapp-me' ),
189
+ 'view__date' => '— ' . __( 'Date Archives', 'creame-whatsapp-me' ),
190
+ 'view__author' => '— ' . __( 'Author Archives', 'creame-whatsapp-me' ),
191
+ 'view__singular' => __( 'Singular', 'creame-whatsapp-me' ),
192
+ 'view__page' => '— ' . __( 'Page', 'creame-whatsapp-me' ),
193
+ 'view__post' => '— ' . __( 'Post', 'creame-whatsapp-me' ),
194
+ ),
195
+ );
196
+
197
+ // If isn't set Blog Page or is the same than Front Page unset blog_page option.
198
+ if ( get_option( 'show_on_front' ) === 'posts' || get_option( 'page_for_posts' ) === 0 ) {
199
+ unset( $sections['wp']['view__blog_page'] );
200
+ }
201
+
202
+ // Custom Post Types.
203
+ $custom_post_types = apply_filters(
204
+ 'joinchat_custom_post_types',
205
+ array_keys( get_post_types( array( 'has_archive' => true ), 'names' ) )
206
+ );
207
+
208
+ if ( count( $custom_post_types ) ) {
209
+ $sections['cpt'] = array();
210
+
211
+ foreach ( $custom_post_types as $custom_post_type ) {
212
+ $post_type = get_post_type_object( $custom_post_type );
213
+ $post_type_name = function_exists( 'mb_convert_case' ) ?
214
+ mb_convert_case( $post_type->labels->name, MB_CASE_TITLE ) :
215
+ strtolower( $post_type->labels->name );
216
+
217
+ $sections['cpt'][ "view__cpt_$custom_post_type" ] = $post_type_name;
218
+ }
219
+ }
220
+ } elseif ( 'advanced' === $tab ) {
221
+
222
+ $sections = array(
223
+ 'optin' => array(
224
+ 'optin_text' => __( 'Opt-in Text', 'creame-whatsapp-me' ),
225
+ 'optin_check' => __( 'Opt-in Required', 'creame-whatsapp-me' ),
226
+ ),
227
+ 'conversion' => array(
228
+ 'gads' => '<label for="joinchat_gads">' . __( 'Google Ads Conversion', 'creame-whatsapp-me' ) . '</label>',
229
+ ),
230
+ );
231
+
232
+ } else {
233
+
234
+ $sections = array();
235
+
236
+ }
237
+
238
+ // Filter tab sections to add, remove or edit sections or fields.
239
+ return apply_filters( "joinchat_tab_{$tab}_sections", $sections );
240
+
241
+ }
242
+
243
+ /**
244
+ * Validate settings, clean and set defaults before save
245
+ *
246
+ * @since 4.5.0
247
+ * @param array $input contain keys 'id', 'title' and 'callback'.
248
+ * @return array
249
+ */
250
+ public function settings_validate( $input ) {
251
+
252
+ // Prevent bad behavior when validate twice on first save
253
+ // bug (view https://core.trac.wordpress.org/ticket/21989).
254
+ if ( count( get_settings_errors( $this->plugin_name ) ) ) {
255
+ return $input;
256
+ }
257
+
258
+ $util = new JoinChatUtil(); // Shortcut.
259
+
260
+ $util::maybe_encode_emoji();
261
+
262
+ $input['telephone'] = $util::clean_input( $input['telephone'] );
263
+ $input['mobile_only'] = isset( $input['mobile_only'] ) ? 'yes' : 'no';
264
+ $input['button_image'] = intval( $input['button_image'] );
265
+ $input['button_tip'] = $util::substr( $util::clean_input( $input['button_tip'] ), 0, 40 );
266
+ $input['button_delay'] = intval( $input['button_delay'] );
267
+ $input['whatsapp_web'] = isset( $input['whatsapp_web'] ) ? 'yes' : 'no';
268
+ $input['qr'] = isset( $input['qr'] ) ? 'yes' : 'no';
269
+ $input['message_text'] = $util::clean_input( $input['message_text'] );
270
+ $input['message_badge'] = isset( $input['message_badge'] ) ? 'yes' : 'no';
271
+ $input['message_send'] = $util::clean_input( $input['message_send'] );
272
+ $input['message_start'] = $util::substr( $util::clean_input( $input['message_start'] ), 0, 20 );
273
+ $input['message_delay'] = intval( $input['message_delay'] );
274
+ $input['message_views'] = intval( $input['message_views'] ) ? intval( $input['message_views'] ) : 1;
275
+ $input['position'] = 'left' !== $input['position'] ? 'right' : 'left';
276
+ $input['color'] = preg_match( '/^#[a-f0-9]{6}$/i', $input['color'] ) ? $input['color'] : '#25d366';
277
+ $input['dark_mode'] = in_array( $input['dark_mode'], array( 'no', 'yes', 'auto' ), true ) ? $input['dark_mode'] : 'no';
278
+ $input['header'] = in_array( $input['header'], array( '__jc__', '__wa__' ), true ) ? $input['header'] : $util::substr( $util::clean_input( $input['header_custom'] ), 0, 40 );
279
+ $input['optin_check'] = isset( $input['optin_check'] ) ? 'yes' : 'no';
280
+ $input['optin_text'] = wp_kses(
281
+ $input['optin_text'],
282
+ array(
283
+ 'em' => true,
284
+ 'strong' => true,
285
+ 'a' => array( 'href' => true ),
286
+ )
287
+ );
288
+ $input['gads'] = sprintf( 'AW-%s/%s', $util::substr( $util::clean_input( $input['gads'][0] ), 0, 9 ), $util::substr( $util::clean_input( $input['gads'][1] ), 0, 20 ) );
289
+ $input['gads'] = 'AW-/' !== $input['gads'] ? $input['gads'] : '';
290
+
291
+ if ( isset( $input['view'] ) ) {
292
+ $input['visibility'] = array_filter(
293
+ $input['view'],
294
+ function( $v ) {
295
+ return 'yes' === $v || 'no' === $v;
296
+ }
297
+ );
298
+ }
299
+
300
+ // Clean input items that are not in settings.
301
+ $input = array_intersect_key( $input, $this->common->settings );
302
+
303
+ // Filter for other validations or extra settings.
304
+ $input = apply_filters( 'joinchat_settings_validate', $input, $this->common->settings );
305
+
306
+ add_settings_error( $this->plugin_name, 'settings_updated', __( 'Settings saved', 'creame-whatsapp-me' ), 'updated' );
307
+
308
+ // Delete notice option.
309
+ if ( $input['telephone'] ) {
310
+ delete_option( 'joinchat_notice_dismiss' );
311
+ }
312
+
313
+ // Extra actions on save.
314
+ do_action( 'joinchat_settings_validation', $input, $this->common->settings );
315
+
316
+ return $input;
317
+
318
+ }
319
+
320
+ /**
321
+ * Tab open HTML output
322
+ *
323
+ * @since 4.5.0
324
+ * @param array $args Section info.
325
+ * @return void
326
+ */
327
+ public function settings_tab_open( $args ) {
328
+
329
+ $tab_id = str_replace( array( 'joinchat_tab_', '_open' ), '', $args['id'] );
330
+ $active_tab = isset( $_GET['tab'] ) && in_array( $_GET['tab'], array_keys( $this->tabs ), true ) ? wp_unslash( $_GET['tab'] ) : 'general'; // phpcs:ignore WordPress.Security.NonceVerification
331
+
332
+ printf(
333
+ '<div id="joinchat_tab_%1$s" class="joinchat-tab %2$s" role="tabpanel" aria-labelledby="navtab_%1$s">',
334
+ esc_attr( $tab_id ),
335
+ esc_attr( $active_tab === $tab_id ? 'joinchat-tab-active' : '' )
336
+ );
337
+
338
+ }
339
+
340
+ /**
341
+ * Tab close HTML output
342
+ *
343
+ * @since 4.5.0
344
+ * @param array $args Section info.
345
+ * @return void
346
+ */
347
+ public function settings_tab_close( $args ) {
348
+
349
+ echo '</div>';
350
+
351
+ }
352
+
353
+ /**
354
+ * Section HTML output
355
+ *
356
+ * @since 4.5.0
357
+ * @param array $args Section info.
358
+ * @return void
359
+ */
360
+ public function section_output( $args ) {
361
+ $section_id = $args['id'];
362
+
363
+ switch ( $section_id ) {
364
+ case 'joinchat_tab_general__button':
365
+ $output = '<h2 class="title">' . __( 'Button', 'creame-whatsapp-me' ) . '</h2>' .
366
+ '<p>' . __( 'Set the contact number and where you want the WhatsApp button to be displayed.', 'creame-whatsapp-me' ) . '</p>';
367
+ break;
368
+
369
+ case 'joinchat_tab_general__chat':
370
+ $output = '<hr><h2 class="title">' . __( 'Chat Window', 'creame-whatsapp-me' ) . '</h2>' .
371
+ '<p>' .
372
+ __( 'If you define a "Call to Action" a window will be displayed simulating a chat before launching WhatsApp.', 'creame-whatsapp-me' ) . ' ' .
373
+ __( 'You can introduce yourself, offer help or even make promotions to your users.', 'creame-whatsapp-me' ) .
374
+ '</p>';
375
+ break;
376
+
377
+ case 'joinchat_tab_general__chat_open':
378
+ $output = '<p>' .
379
+ __( 'If it\'s defined a "Call to Action", the Chat Window can be displayed automatically if conditions are met.', 'creame-whatsapp-me' ) .
380
+ ' <a class="joinchat-show-help" href="#tab-link-triggers" title="' . __( 'Show Help', 'creame-whatsapp-me' ) . '">?</a>' .
381
+ '</p>';
382
+ break;
383
+
384
+ case 'joinchat_tab_visibility__global':
385
+ $output = '<h2 class="title">' . __( 'Visibility Settings', 'creame-whatsapp-me' ) . '</h2>' .
386
+ '<p>' . __( 'From here you can configure on which pages the WhatsApp button will be visible.', 'creame-whatsapp-me' ) .
387
+ ' <a href="#" class="joinchat_view_reset">' . __( 'Restore default visibility', 'creame-whatsapp-me' ) . '</a></p>';
388
+ break;
389
+
390
+ case 'joinchat_tab_visibility__wp':
391
+ $output = '<hr>';
392
+ break;
393
+
394
+ case 'joinchat_tab_visibility__cpt':
395
+ $output = '<h2 class="title">' . __( 'Custom Post Types', 'creame-whatsapp-me' ) . '</h2>';
396
+ break;
397
+
398
+ case 'joinchat_tab_advanced__optin':
399
+ $output = '<h2 class="title">' . __( 'Opt-in', 'creame-whatsapp-me' ) . '</h2>' .
400
+ '<p>' . __( 'Opt-in is a users’ consent to receive messages from a business.', 'creame-whatsapp-me' ) . '</p>';
401
+ break;
402
+
403
+ case 'joinchat_tab_advanced__conversion':
404
+ $output = '<hr><h2 class="title">' . __( 'Conversions', 'creame-whatsapp-me' ) . '</h2>';
405
+ break;
406
+
407
+ default:
408
+ $output = '';
409
+ break;
410
+ }
411
+
412
+ // Filter section opening ouput.
413
+ echo apply_filters( 'joinchat_section_output', $output, $section_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
414
+
415
+ }
416
+
417
+ /**
418
+ * Field HTML output
419
+ *
420
+ * @since 4.5.0
421
+ * @param mixed $field_id The field string id.
422
+ * @return void
423
+ */
424
+ public function field_output( $field_id ) {
425
+
426
+ if ( strpos( $field_id, 'view__' ) === 0 ) {
427
+ $field = substr( $field_id, 6 );
428
+ $value = isset( $this->common->settings['visibility'][ $field ] ) ? $this->common->settings['visibility'][ $field ] : '';
429
+
430
+ $output = '<label><input type="radio" name="joinchat[view][' . $field . ']" value="yes"' . checked( 'yes', $value, false ) . '> ' .
431
+ '<span class="dashicons dashicons-visibility" title="' . __( 'Show', 'creame-whatsapp-me' ) . '"></span></label>' .
432
+ '<label><input type="radio" name="joinchat[view][' . $field . ']" value="no"' . checked( 'no', $value, false ) . '> ' .
433
+ '<span class="dashicons dashicons-hidden" title="' . __( 'Hide', 'creame-whatsapp-me' ) . '"></span></label>' .
434
+ '<label><input type="radio" name="joinchat[view][' . $field . ']" value=""' . checked( '', $value, false ) . '> ' .
435
+ __( 'Inherit', 'creame-whatsapp-me' ) . ' <span class="dashicons dashicons-visibility view_inheritance_' . $field . '"></span></label>';
436
+
437
+ } else {
438
+
439
+ $value = isset( $this->common->settings[ $field_id ] ) ? $this->common->settings[ $field_id ] : '';
440
+ $utm = '?utm_source=settings&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
441
+ $lang = false !== strpos( strtolower( get_locale() ), 'es' ) ? 'es' : 'en';
442
+
443
+ switch ( $field_id ) {
444
+ case 'telephone':
445
+ $output = '<input id="joinchat_phone" ' . ( $this->common->intltel ? 'data-' : '' ) . 'name="joinchat[telephone]" value="' . esc_attr( $value ) . '" type="text" style="width:15em">' .
446
+ '<p class="description">' . __( "Contact phone number <strong>(the button will not be shown if it's empty)</strong>", 'creame-whatsapp-me' ) . '</p>' .
447
+ '<p class="joinchat-addon">' . sprintf(
448
+ /* translators: 1: Random Phone link, 2: Support Agents link. */
449
+ __( 'Add unlimited numbers with %1$s or multiple contacts with %2$s', 'creame-whatsapp-me' ),
450
+ '<a href="https://join.chat/' . $lang . '/addons/random-phone/' . $utm . '" target="_blank">\'Random Phone\'</a>',
451
+ '<a href="https://join.chat/' . $lang . '/addons/support-agents/' . $utm . '" target="_blank">\'Support Agents\'</a>'
452
+ ) . '</p>';
453
+ break;
454
+
455
+ case 'mobile_only':
456
+ $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Mobile Only', 'creame-whatsapp-me' ) . '</span></legend>' .
457
+ '<label><input id="joinchat_mobile_only" name="joinchat[mobile_only]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
458
+ __( 'Only display the button on mobile devices', 'creame-whatsapp-me' ) . '</label></fieldset>';
459
+ break;
460
+
461
+ case 'position':
462
+ $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Position on Screen', 'creame-whatsapp-me' ) . '</span></legend>' .
463
+ '<label><input name="joinchat[position]" value="left" type="radio"' . checked( 'left', $value, false ) . '> ' .
464
+ __( 'Left', 'creame-whatsapp-me' ) . '</label><br>' .
465
+ '<label><input name="joinchat[position]" value="right" type="radio"' . checked( 'right', $value, false ) . '> ' .
466
+ __( 'Right', 'creame-whatsapp-me' ) . '</label></fieldset>';
467
+ break;
468
+
469
+ case 'button_image':
470
+ $thumb = JoinChatUtil::thumb( $value, 116, 116 );
471
+ $image = is_array( $thumb ) ? $thumb['url'] : false;
472
+
473
+ $output = '<div id="joinchat_button_image_wrapper">' .
474
+ '<div id="joinchat_button_image_holder" ' . ( $image ? "style=\"background-size:cover; background-image:url('$image');\"" : '' ) . '></div>' .
475
+ '<input id="joinchat_button_image" name="joinchat[button_image]" type="hidden" value="' . intval( $value ) . '">' .
476
+ '<input id="joinchat_button_image_add" type="button" value="' . esc_attr__( 'Select an image', 'creame-whatsapp-me' ) . '" class="button-primary" ' .
477
+ 'data-title="' . esc_attr__( 'Select button image', 'creame-whatsapp-me' ) . '" data-button="' . esc_attr__( 'Use image', 'creame-whatsapp-me' ) . '"> ' .
478
+ '<input id="joinchat_button_image_remove" type="button" value="' . esc_attr__( 'Remove', 'creame-whatsapp-me' ) . '" class="button-secondary' . ( $image ? '' : ' joinchat-hidden' ) . '">' .
479
+ '<p class="description">' . __( 'The image will alternate with button icon', 'creame-whatsapp-me' ) . '</p></div>' .
480
+ '<p class="joinchat-addon">' . sprintf(
481
+ /* translators: %s: OmniChannel link. */
482
+ __( 'Other icons and more channels (Telegram, Messenger…) with %s', 'creame-whatsapp-me' ),
483
+ '<a href="https://join.chat/' . $lang . '/addons/omnichannel/' . $utm . '" target="_blank">\'Omnichannel\'</a>'
484
+ ) . '</p>';
485
+ break;
486
+
487
+ case 'button_tip':
488
+ $output = '<input id="joinchat_button_tip" name="joinchat[button_tip]" value="' . esc_attr( $value ) . '" type="text" maxlength="40" class="regular-text autofill" placeholder="' . esc_attr__( '💬 Need help?', 'creame-whatsapp-me' ) . '"> ' .
489
+ '<p class="description">' . __( 'Short text shown next to button', 'creame-whatsapp-me' ) . '</p>';
490
+ break;
491
+
492
+ case 'button_delay':
493
+ $output = '<input id="joinchat_button_delay" name="joinchat[button_delay]" value="' . intval( $value ) . '" type="number" min="-1" max="120" style="width:5em"> ' .
494
+ __( 'seconds', 'creame-whatsapp-me' ) . ' (' . __( '-1 to display directly without animation', 'creame-whatsapp-me' ) . ')' .
495
+ '<p class="description">' . __( 'Time since the page is opened until the button is displayed', 'creame-whatsapp-me' ) . '</p>';
496
+ break;
497
+
498
+ case 'whatsapp_web':
499
+ $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'WhatsApp Web', 'creame-whatsapp-me' ) . '</span></legend>' .
500
+ '<label><input id="joinchat_whatsapp_web" name="joinchat[whatsapp_web]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
501
+ __( 'Open <em>WhatsApp Web</em> directly on desktop', 'creame-whatsapp-me' ) . '</label></fieldset>';
502
+ break;
503
+
504
+ case 'qr':
505
+ $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'QR Code', 'creame-whatsapp-me' ) . '</span></legend>' .
506
+ '<label><input id="joinchat_qr" name="joinchat[qr]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
507
+ __( 'Display QR code on desktop to scan with phone', 'creame-whatsapp-me' ) . '</label></fieldset>';
508
+ break;
509
+
510
+ case 'message_text':
511
+ $output = '<textarea id="joinchat_message_text" name="joinchat[message_text]" rows="4" class="regular-text autofill" placeholder="' . esc_attr__( "Hello 👋\nCan we help you?", 'creame-whatsapp-me' ) . '">' . esc_textarea( $value ) . '</textarea>' .
512
+ '<p class="description">' . __( 'Define a text to encourage users to contact by WhatsApp', 'creame-whatsapp-me' ) . '</p>' .
513
+ '<p class="joinchat-addon">' . sprintf(
514
+ /* translators: %s: CTA Extras link. */
515
+ __( 'Add links, images, videos and more with %s', 'creame-whatsapp-me' ),
516
+ '<a href="https://join.chat/' . $lang . '/addons/cta-extras/' . $utm . '" target="_blank">\'CTA Extras\'</a>'
517
+ ) . '</p>';
518
+ break;
519
+
520
+ case 'message_send':
521
+ $output = '<textarea id="joinchat_message_send" name="joinchat[message_send]" rows="3" class="regular-text autofill" placeholder="' . esc_attr__( 'Hi *{SITE}*! I need more info about {TITLE} {URL}', 'creame-whatsapp-me' ) . '">' . esc_textarea( $value ) . '</textarea>' .
522
+ '<p class="description">' . __( 'Predefined text for the first message the user will send you', 'creame-whatsapp-me' ) . '</p>';
523
+ break;
524
+
525
+ case 'message_start':
526
+ $output = '<input id="joinchat_message_start" name="joinchat[message_start]" value="' . esc_attr( $value ) . '" type="text" maxlength="20" class="regular-text autofill" placeholder="' . esc_attr__( 'Open chat', 'creame-whatsapp-me' ) . '"> ' .
527
+ '<p class="description">' . __( 'Text to open chat on Chat Window button', 'creame-whatsapp-me' ) . '</p>';
528
+ break;
529
+
530
+ case 'message_delay':
531
+ $output = '<input id="joinchat_message_delay" name="joinchat[message_delay]" value="' . intval( $value ) . '" type="number" min="0" max="120" style="width:5em"> ' .
532
+ __( 'seconds', 'creame-whatsapp-me' ) . ' (' . __( '0 to disable', 'creame-whatsapp-me' ) . ')' .
533
+ '<p class="description">' . __( 'Chat Window auto displays after delay', 'creame-whatsapp-me' ) . '</p>';
534
+ break;
535
+
536
+ case 'message_views':
537
+ $output = '<input id="joinchat_message_views" name="joinchat[message_views]" value="' . intval( $value ) . '" type="number" min="1" max="120" style="width:5em"> ' .
538
+ '<p class="description">' . __( 'Chat Window auto displays from this number of page views', 'creame-whatsapp-me' ) . '</p>';
539
+ break;
540
+
541
+ case 'message_badge':
542
+ $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Notification Balloon', 'creame-whatsapp-me' ) . '</span></legend>' .
543
+ '<label><input id="joinchat_message_badge" name="joinchat[message_badge]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
544
+ __( 'Display a notification balloon instead of opening the Chat Window for a "less intrusive" mode', 'creame-whatsapp-me' ) . '</label></fieldset>';
545
+ break;
546
+
547
+ case 'color':
548
+ $output = '<input id="joinchat_color" name="joinchat[color]" value="' . esc_attr( $value ) . '" type="text" data-default-color="#25d366"> ';
549
+ break;
550
+
551
+ case 'dark_mode':
552
+ $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Dark Mode', 'creame-whatsapp-me' ) . '</span></legend>' .
553
+ '<label><input name="joinchat[dark_mode]" value="no" type="radio"' . checked( 'no', $value, false ) . '> ' .
554
+ __( 'No', 'creame-whatsapp-me' ) . '</label><br>' .
555
+ '<label><input name="joinchat[dark_mode]" value="yes" type="radio"' . checked( 'yes', $value, false ) . '> ' .
556
+ __( 'Yes', 'creame-whatsapp-me' ) . '</label><br>' .
557
+ '<label><input name="joinchat[dark_mode]" value="auto" type="radio"' . checked( 'auto', $value, false ) . '> ' .
558
+ __( 'Auto (detects device dark mode)', 'creame-whatsapp-me' ) . '</label></fieldset>';
559
+ break;
560
+
561
+ case 'header':
562
+ $check = in_array( $value, array( '__jc__', '__wa__' ), true ) ? $value : '__custom__';
563
+ $value = '__custom__' === $check ? $value : '';
564
+
565
+ $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Header', 'creame-whatsapp-me' ) . '</span></legend>' .
566
+ '<label><input name="joinchat[header]" value="__jc__" type="radio"' . checked( '__jc__', $check, false ) . '> ' .
567
+ __( 'Powered by Join.chat', 'creame-whatsapp-me' ) . '</label><br>' .
568
+ '<label><input name="joinchat[header]" value="__wa__" type="radio"' . checked( '__wa__', $check, false ) . '> ' .
569
+ __( 'WhatsApp Logo', 'creame-whatsapp-me' ) . '</label><br>' .
570
+ '<label><input name="joinchat[header]" value="__custom__" type="radio"' . checked( '__custom__', $check, false ) . '> ' .
571
+ __( 'Custom:', 'creame-whatsapp-me' ) . '</label> ' .
572
+ '<input id="joinchat_header_custom" name="joinchat[header_custom]" value="' . esc_attr( $value ) . '" type="text" maxlength="40" class="regular-text">' .
573
+ '</fieldset>';
574
+ break;
575
+
576
+ case 'optin_text':
577
+ $editor_settings = array(
578
+ 'textarea_name' => 'joinchat[optin_text]',
579
+ 'textarea_rows' => 4,
580
+ 'teeny' => true,
581
+ 'media_buttons' => false,
582
+ 'tinymce' => array( 'statusbar' => false ),
583
+ 'quicktags' => false,
584
+ );
585
+
586
+ // phpcs:disable
587
+ add_filter( 'teeny_mce_plugins', function( $filters, $editor_id ) {
588
+ return 'joinchat_optin_text' === $editor_id ? array( 'wordpress', 'wplink' ) : $filters;
589
+ }, 10, 2 );
590
+
591
+ add_filter( 'teeny_mce_buttons', function( $mce_buttons, $editor_id ) {
592
+ return 'joinchat_optin_text' === $editor_id ? array( 'bold', 'italic', 'link' ) : $mce_buttons;
593
+ }, 10, 2 );
594
+ // phpcs:enable
595
+
596
+ $output = wp_editor( $value, 'joinchat_optin_text', $editor_settings ) .
597
+ '<p class="description">' . __( "Explain how you will use the user's contact and the conditions they accept.", 'creame-whatsapp-me' ) . '</p>';
598
+ break;
599
+
600
+ case 'optin_check':
601
+ $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Opt-in Required', 'creame-whatsapp-me' ) . '</span></legend>' .
602
+ '<label><input id="joinchat_optin_check" name="joinchat[optin_check]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
603
+ __( 'User approval is required to enable the contact button', 'creame-whatsapp-me' ) . '</label></fieldset>';
604
+ break;
605
+
606
+ case 'gads':
607
+ $parts = $value ? explode( '/', str_replace( 'AW-', '', $value ) ) : array( '', '' );
608
+
609
+ $output = '<label class="joinchat-gads">AW-' .
610
+ '<input id="joinchat_gads" name="joinchat[gads][]" value="' . esc_attr( $parts[0] ) . '" type="text" maxlength="9" style="width:6em;" placeholder="999999999" title="' . esc_attr__( 'Conversion ID', 'creame-whatsapp-me' ) . '">/ ' .
611
+ '<input name="joinchat[gads][]" value="' . esc_attr( $parts[1] ) . '" type="text" maxlength="20" style="width:13em;" placeholder="ABCDEFGHIJ0123456789" title="' . esc_attr__( 'Conversion label', 'creame-whatsapp-me' ) . '"> ' .
612
+ '</label> <span style="white-space:nowrap">AW-<em>CONVERSION_ID</em>/<em>CONVERSION_LABEL</em></span>' .
613
+ '<p class="description">' . __( 'Send the conversion automatically at the chat start', 'creame-whatsapp-me' ) . '</p>';
614
+ break;
615
+
616
+ default:
617
+ $output = '';
618
+ break;
619
+ }
620
+ }
621
+
622
+ // Filter field ouput.
623
+ echo apply_filters( 'joinchat_field_output', $output, $field_id, $this->common->settings ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
624
+
625
+ }
626
+
627
+ /**
628
+ * Field 'field_view_all' output
629
+ *
630
+ * @since 4.5.0
631
+ * @return void
632
+ */
633
+ public function field_view_all() {
634
+
635
+ $value = ( isset( $this->common->settings['visibility']['all'] ) && 'no' === $this->common->settings['visibility']['all'] ) ? 'no' : 'yes';
636
+
637
+ $inheritance = apply_filters(
638
+ 'joinchat_visibility_inheritance',
639
+ array(
640
+ 'all' => array( 'front_page', 'blog_page', '404_page', 'search', 'archive', 'singular', 'cpts' ),
641
+ 'archive' => array( 'date', 'author' ),
642
+ 'singular' => array( 'page', 'post' ),
643
+ )
644
+ );
645
+
646
+ echo '<div class="joinchat_view_all" data-inheritance="' . esc_attr( wp_json_encode( $inheritance ) ) . '">' .
647
+ '<label><input type="radio" name="joinchat[view][all]" value="yes"' . checked( 'yes', $value, false ) . '> ' .
648
+ '<span class="dashicons dashicons-visibility" title="' . esc_attr__( 'Show', 'creame-whatsapp-me' ) . '"></span></label>' .
649
+ '<label><input type="radio" name="joinchat[view][all]" value="no"' . checked( 'no', $value, false ) . '> ' .
650
+ '<span class="dashicons dashicons-hidden" title="' . esc_attr__( 'Hide', 'creame-whatsapp-me' ) . '"></span></label></div>';
651
+
652
+ }
653
+
654
+ /**
655
+ * Add a help tab to the options page in the WordPress admin
656
+ *
657
+ * @since 4.5.0
658
+ * @access public
659
+ * @return void
660
+ */
661
+ public function help_tab() {
662
+
663
+ $screen = get_current_screen();
664
+ $utm = '?utm_source=helptab&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
665
+ $lang = false !== strpos( strtolower( get_locale() ), 'es' ) ? 'es' : 'en';
666
+
667
+ $help_tabs = array(
668
+ array(
669
+ 'id' => 'styles-and-vars',
670
+ 'title' => __( 'Styles and Variables', 'creame-whatsapp-me' ),
671
+ 'content' =>
672
+ '<p>' . __( 'You can use formatting styles like in WhatsApp: _<em>italic</em>_ *<strong>bold</strong>* ~<del>strikethrough</del>~.', 'creame-whatsapp-me' ) . '</p>' .
673
+ '<p>' . __( 'You can use dynamic variables that will be replaced by the values of the page the user visits:', 'creame-whatsapp-me' ) .
674
+ '<p>' .
675
+ '<span><code>{SITE}</code> ➜ ' . get_bloginfo( 'name', 'display' ) . '</span><br> ' .
676
+ '<span><code>{TITLE}</code> ➜ ' . __( 'Page Title', 'creame-whatsapp-me' ) . '</span><br>' .
677
+ '<span><code>{URL}</code> ➜ ' . home_url( 'awesome/' ) . '</span><br> ' .
678
+ '<span><code>{HREF}</code> ➜ ' . home_url( 'awesome/' ) . '?utm_source=twitter&utm_medium=social&utm_campaign=XXX</span> ' .
679
+ '</p>',
680
+ ),
681
+ array(
682
+ 'id' => 'triggers',
683
+ 'title' => __( 'Triggers', 'creame-whatsapp-me' ),
684
+ 'content' =>
685
+ '<p>' . __( 'You can interact on your page with Join.chat in two ways:', 'creame-whatsapp-me' ) . '</p>' .
686
+ '<p>' . __( 'With anchor links:', 'creame-whatsapp-me' ) . '</p>' .
687
+ '<ul>' .
688
+ '<li><code>#joinchat</code> ' . __( 'to show Chat Window (or open WhatsApp if there is no CTA) on click.', 'creame-whatsapp-me' ) . '</li>' .
689
+ '<li><code>#whatsapp</code> ' . __( 'to open WhatsApp directly on click.', 'creame-whatsapp-me' ) . '</li>' .
690
+ '</ul>' .
691
+ '<p>' . __( 'Example:', 'creame-whatsapp-me' ) . '<code>&lt;a href="#whatsapp"&gt;' . __( 'Contact us', 'creame-whatsapp-me' ) . '&lt;/a&gt;</code></p>' .
692
+ '<p>' . __( 'Adding some CSS classes in your HTML:', 'creame-whatsapp-me' ) . '</p>' .
693
+ '<ul>' .
694
+ '<li><code>joinchat_open</code> ' . __( 'to show Chat Window (or open WhatsApp if there is no CTA) on click.', 'creame-whatsapp-me' ) . '</li>' .
695
+ '<li><code>joinchat_close</code> ' . __( 'to hide Chat Window on click.', 'creame-whatsapp-me' ) . '</li>' .
696
+ '<li><code>joinchat_app</code> ' . __( 'to open WhatsApp directly on click.', 'creame-whatsapp-me' ) . '</li>' .
697
+ '<li>' . __( 'To show Chat Window when an HTML element appears on screen when user scrolls:', 'creame-whatsapp-me' ) .
698
+ '<ul>' .
699
+ '<li><code>joinchat_show</code> ' . __( 'only show if it\'s an not seen CTA.', 'creame-whatsapp-me' ) . '</li>' .
700
+ '<li><code>joinchat_force_show</code> ' . __( 'to show always.', 'creame-whatsapp-me' ) . '</li>' .
701
+ '</ul></li>' .
702
+ '</ul>' .
703
+ '<p>' . __( 'Example:', 'creame-whatsapp-me' ) . '<code>&lt;img src="contact.jpg" class="joinchat_open" alt="' . __( 'Contact us', 'creame-whatsapp-me' ) . '"&gt;</code></p>',
704
+ ),
705
+ array(
706
+ 'id' => 'support',
707
+ 'title' => __( 'Support', 'creame-whatsapp-me' ),
708
+ 'content' =>
709
+ '<p>' . sprintf(
710
+ /* translators: 1: docs url, 2: wordpress.org plugin support url, 3: premium support url. */
711
+ __( 'If you need help, first review our <a href="%1$s" target="_blank">documentation</a> and if you don\'t find a solution check the <a href="%2$s" target="_blank">free plugin support forum</a> or buy our <a href="%3$s" target="_blank">premium support</a>.', 'creame-whatsapp-me' ),
712
+ esc_url( "https://join.chat/$lang/docs/$utm" ),
713
+ esc_url( 'https://wordpress.org/support/plugin/creame-whatsapp-me/' ),
714
+ esc_url( "https://my.join.chat/$utm" )
715
+ ) . '</p>' .
716
+ '<p>' . __( 'If you like Join.chat 😍', 'creame-whatsapp-me' ) . '</p>' .
717
+ '<ul>' .
718
+ '<li>' . sprintf(
719
+ /* translators: %s: Add review link. */
720
+ __( "Please leave us a %s rating. We'll thank you.", 'creame-whatsapp-me' ),
721
+ '<a href="https://wordpress.org/support/plugin/creame-whatsapp-me/reviews/#new-post" target="_blank">★★★★★</a>'
722
+ ) . '</li>' .
723
+ '<li>' . sprintf(
724
+ /* translators: %s: Join.chat page link. */
725
+ __( 'Subscribe to our newsletter and visit our blog at %s.', 'creame-whatsapp-me' ),
726
+ '<a href="https://join.chat/' . $utm . '" target="_blank">join.chat</a>'
727
+ ) . '</li>' .
728
+ '<li>' . sprintf(
729
+ /* translators: %s: Join.chat twitter link. */
730
+ __( 'Follow %s on twitter.', 'creame-whatsapp-me' ),
731
+ '<a href="https://twitter.com/joinchatnow" target="_blank">@joinchatnow</a>'
732
+ ) . '</li>' .
733
+ '</ul>',
734
+ ),
735
+ );
736
+
737
+ foreach ( $help_tabs as $tab_data ) {
738
+ $tab_id = str_replace( '-', '_', $tab_data['id'] );
739
+ $screen->add_help_tab( apply_filters( "joinchat_help_tab_{$tab_id}", $tab_data ) );
740
+ }
741
+
742
+ }
743
+
744
+ /**
745
+ * Generate the options page in the WordPress admin
746
+ *
747
+ * @since 4.5.0
748
+ * @access public
749
+ * @return void
750
+ */
751
+ public function options_page() {
752
+
753
+ // Enqueue WordPress media scripts.
754
+ wp_enqueue_media();
755
+ // Enqueue assets.
756
+ wp_enqueue_script( 'joinchat-admin' );
757
+ wp_enqueue_style( 'joinchat-admin' );
758
+
759
+ if ( $this->common->intltel ) {
760
+ wp_enqueue_style( 'intl-tel-input' );
761
+ }
762
+
763
+ $active_tab = isset( $_GET['tab'] ) && in_array( $_GET['tab'], array_keys( $this->tabs ), true ) ? wp_unslash( $_GET['tab'] ) : 'general'; // phpcs:ignore WordPress.Security.NonceVerification
764
+ ?>
765
+ <div class="wrap">
766
+ <h1><?php esc_html_e( 'Join.chat Settings', 'creame-whatsapp-me' ); ?></h1>
767
+
768
+ <?php
769
+ if ( ! JoinChatUtil::options_submenu() ) {
770
+ settings_errors();
771
+ }
772
+ ?>
773
+
774
+ <form method="post" id="joinchat_form" action="options.php" autocomplete="off">
775
+ <?php settings_fields( $this->plugin_name ); ?>
776
+ <h2 class="nav-tab-wrapper wp-clearfix" role="tablist">
777
+ <?php
778
+ foreach ( $this->tabs as $tab => $name ) {
779
+ $link = $active_tab === $tab
780
+ ? '<a id="navtab_%1$s" href="#joinchat_tab_%1$s" class="nav-tab nav-tab-active" role="tab" aria-controls="joinchat_tab_%1$s" aria-selected="true">%2$s</a>'
781
+ : '<a id="navtab_%1$s" href="#joinchat_tab_%1$s" class="nav-tab" role="tab" aria-controls="joinchat_tab_%1$s" aria-selected="false">%2$s</a>';
782
+
783
+ printf( $link, esc_attr( $tab ), esc_html( $name ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
784
+ }
785
+ ?>
786
+ </h2>
787
+ <div class="joinchat-tabs">
788
+ <?php do_settings_sections( $this->plugin_name ); ?>
789
+ </div><!-- end tabs -->
790
+ <?php submit_button(); ?>
791
+ </form>
792
+ </div>
793
+ <?php
794
+ }
795
+
796
+ /**
797
+ * Return html for dynamic variables help next to field label
798
+ *
799
+ * @since 4.5.0
800
+ * @access public
801
+ * @param string $field field name.
802
+ * @return string
803
+ */
804
+ public static function vars_help( $field ) {
805
+
806
+ $vars = apply_filters( 'joinchat_vars_help', array( 'SITE', 'TITLE', 'URL', 'HREF' ), $field );
807
+
808
+ return count( $vars ) ? '<div class="joinchat_vars_help">' . __( 'You can use vars', 'creame-whatsapp-me' ) . ' ' .
809
+ '<a class="joinchat-show-help" href="#" title="' . __( 'Show Help', 'creame-whatsapp-me' ) . '">?</a><br> ' .
810
+ '<code>{' . join( '}</code> <code>{', $vars ) . '}</code></div>' : '';
811
+
812
+ }
813
+
814
+ /**
815
+ * Modifies the "Thank you" text displayed in the admin footer.
816
+ *
817
+ * @since 4.5.0
818
+ * @access public
819
+ * @param string $footer_text The content that will be printed.
820
+ * @return string The content that will be printed.
821
+ */
822
+ public function admin_footer_text( $footer_text ) {
823
+
824
+ $current_screen = get_current_screen();
825
+
826
+ if ( $current_screen && false !== strpos( $current_screen->id, '_joinchat' ) ) {
827
+ $footer_text = sprintf(
828
+ /* translators: 1: Join.chat, 2: Add review link. */
829
+ __( 'Do you like %1$s? Please help us with a %2$s rating.', 'creame-whatsapp-me' ),
830
+ '<strong>Join.chat</strong>',
831
+ '<a href="https://wordpress.org/support/plugin/creame-whatsapp-me/reviews/#new-post" target="_blank">★★★★★</a>'
832
+ );
833
+ }
834
+
835
+ return $footer_text;
836
+
837
+ }
838
+ }
admin/class-joinchat-admin.php CHANGED
@@ -39,33 +39,6 @@ class JoinChatAdmin {
39
  */
40
  private $common;
41
 
42
- /**
43
- * The setings of this plugin.
44
- *
45
- * @since 1.0.0
46
- * @access private
47
- * @var array $settings The current settings of this plugin.
48
- */
49
- private $settings;
50
-
51
- /**
52
- * Use International Telephone Input library (https://intl-tel-input.com/)
53
- *
54
- * @since 1.2.0
55
- * @access private
56
- * @var boolean $enhanced_phone Use enhanced phone input.
57
- */
58
- private $enhanced_phone;
59
-
60
- /**
61
- * Admin page tabs
62
- *
63
- * @since 3.0.0
64
- * @access private
65
- * @var array $tabs Admin page tabs.
66
- */
67
- private $tabs;
68
-
69
  /**
70
  * Initialize the class and set its properties.
71
  *
@@ -78,44 +51,7 @@ class JoinChatAdmin {
78
 
79
  $this->plugin_name = $plugin_name;
80
  $this->version = $version;
81
- $this->common = new JoinChatCommon();
82
-
83
- // Updated in get_settings() at 'admin_init' hook
84
- $this->enhanced_phone = '17.0.15'; // intl-tel-input version
85
- $this->tabs = array();
86
- $this->settings = array();
87
-
88
- }
89
-
90
- /**
91
- * Get all settings or set defaults
92
- *
93
- * @since 1.0.0
94
- * @since 2.0.0 Added visibility setting
95
- * @since 2.1.0 Added message_badge
96
- * @since 2.3.0 Added button_delay and whatsapp_web settings, message_delay in seconds
97
- * @since 3.0.0 Is public and added plugin enhanced_phone and tabs
98
- * @since 3.1.0 Added tooltip and image
99
- * @since 4.0.0 Added message_views and color
100
- * @since 4.1.0 Added header
101
- */
102
- public function get_settings() {
103
-
104
- // Use International Telephone Input library version or false to disable
105
- $this->enhanced_phone = apply_filters( 'joinchat_enhanced_phone', $this->enhanced_phone );
106
-
107
- // Admin tabs
108
- $this->tabs = apply_filters(
109
- 'joinchat_admin_tabs',
110
- array(
111
- 'general' => __( 'General', 'creame-whatsapp-me' ),
112
- 'visibility' => __( 'Visibility', 'creame-whatsapp-me' ),
113
- 'advanced' => __( 'Advanced', 'creame-whatsapp-me' ),
114
- )
115
- );
116
-
117
- // Load settings
118
- $this->settings = $this->common->load_settings();
119
 
120
  }
121
 
@@ -133,8 +69,8 @@ class JoinChatAdmin {
133
 
134
  wp_register_style( 'joinchat-admin', plugins_url( "css/joinchat{$min}.css", __FILE__ ), array( 'wp-color-picker' ), $this->version, 'all' );
135
 
136
- if ( $this->enhanced_phone ) {
137
- wp_register_style( 'intl-tel-input', plugins_url( "css/intlTelInput{$min}.css", __FILE__ ), array(), $this->enhanced_phone, 'all' );
138
  }
139
 
140
  }
@@ -152,15 +88,15 @@ class JoinChatAdmin {
152
  $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
153
  $deps = array( 'jquery', 'wp-color-picker' );
154
 
155
- if ( $this->enhanced_phone ) {
156
  $deps[] = 'intl-tel-input';
157
  $localize = array(
158
  'placeholder' => __( 'e.g.', 'creame-whatsapp-me' ),
159
- 'version' => $this->enhanced_phone,
160
  'utils_js' => plugins_url( 'js/utils.js', __FILE__ ),
161
  );
162
 
163
- wp_register_script( 'intl-tel-input', plugins_url( "js/intlTelInput{$min}.js", __FILE__ ), array(), $this->enhanced_phone, true );
164
  wp_localize_script( 'intl-tel-input', 'intlTelConf', $localize );
165
  }
166
 
@@ -169,581 +105,6 @@ class JoinChatAdmin {
169
 
170
  }
171
 
172
- /**
173
- * Initialize the settings for WordPress admin
174
- * From v1.2.0 also set filter to disable enhanced phone input
175
- *
176
- * @since 1.0.0
177
- * @since 2.0.0 Added tabs for general and Visibility settings
178
- * @since 2.3.0 Split general settings in Button and Window Chat
179
- * @since 3.0.0 Admin organized by tabs and sections
180
- * @access public
181
- * @return void
182
- */
183
- public function settings_init() {
184
-
185
- // Register WordPress 'joinchat' settings
186
- register_setting( $this->plugin_name, $this->plugin_name, array( $this, 'settings_validate' ) );
187
-
188
- foreach ( $this->tabs as $tab => $tab_name ) {
189
-
190
- add_settings_section( "joinchat_tab_{$tab}_open", null, array( $this, 'settings_tab_open' ), $this->plugin_name );
191
-
192
- $sections = $this->get_tab_sections( $tab );
193
-
194
- foreach ( $sections as $section => $fields ) {
195
- $section_id = "joinchat_tab_{$tab}__{$section}";
196
-
197
- add_settings_section( $section_id, null, array( $this, 'section_output' ), $this->plugin_name );
198
-
199
- foreach ( $fields as $field => $field_args ) {
200
- if ( is_array( $field_args ) ) {
201
- $field_name = $field_args['label'];
202
- $field_callback = $field_args['callback'];
203
- } else {
204
- $field_name = $field_args;
205
- $field_callback = array( $this, 'field_output' );
206
- }
207
-
208
- add_settings_field( "joinchat_$field", $field_name, $field_callback, $this->plugin_name, $section_id, $field );
209
- }
210
- }
211
-
212
- add_settings_section( "joinchat_tab_{$tab}_close", null, array( $this, 'settings_tab_close' ), $this->plugin_name );
213
- }
214
-
215
- }
216
-
217
- /**
218
- * Return an array of sections and fields for the admin tab
219
- *
220
- * @since 3.0.0
221
- * @since 3.1.0 Added tooltip and image
222
- * @param string $tab The id of the admin tab.
223
- * @return array
224
- */
225
- private function get_tab_sections( $tab ) {
226
-
227
- if ( 'general' == $tab ) {
228
-
229
- $sections = array(
230
- 'button' => array(
231
- 'telephone' => '<label for="joinchat_phone">' . __( 'Telephone', 'creame-whatsapp-me' ) . '</label>',
232
- 'message_send' => '<label for="joinchat_message_send">' . __( 'Message', 'creame-whatsapp-me' ) . '</label>' . self::vars_help( 'message_send' ),
233
- 'button_image' => __( 'Image', 'creame-whatsapp-me' ),
234
- 'button_tip' => '<label for="joinchat_button_tip">' . __( 'Tooltip', 'creame-whatsapp-me' ) . '</label>',
235
- 'position' => __( 'Position on Screen', 'creame-whatsapp-me' ),
236
- 'button_delay' => '<label for="joinchat_button_delay">' . __( 'Button Delay', 'creame-whatsapp-me' ) . '</label>',
237
- 'mobile_only' => __( 'Mobile Only', 'creame-whatsapp-me' ),
238
- 'whatsapp_web' => __( 'WhatsApp Web', 'creame-whatsapp-me' ),
239
- 'qr' => __( 'QR Code', 'creame-whatsapp-me' ),
240
- ),
241
- 'chat' => array(
242
- 'message_text' => '<label for="joinchat_message_text">' . __( 'Call to Action', 'creame-whatsapp-me' ) . '</label>' . self::vars_help( 'message_text' ),
243
- 'message_start' => '<label for="joinchat_message_start">' . __( 'Button Text', 'creame-whatsapp-me' ) . '</label>',
244
- 'color' => __( 'Theme Color', 'creame-whatsapp-me' ),
245
- 'dark_mode' => __( 'Dark Mode', 'creame-whatsapp-me' ),
246
- 'header' => __( 'Header', 'creame-whatsapp-me' ),
247
- ),
248
- 'chat_open' => array(
249
- 'message_delay' => '<label for="joinchat_message_delay">' . __( 'Chat Delay', 'creame-whatsapp-me' ) . '</label>',
250
- 'message_views' => '<label for="joinchat_message_views">' . __( 'Page Views', 'creame-whatsapp-me' ) . '</label>',
251
- 'message_badge' => __( 'Notification Balloon', 'creame-whatsapp-me' ),
252
- ),
253
- );
254
-
255
- } elseif ( 'visibility' == $tab ) {
256
-
257
- $sections = array(
258
- 'global' => array(
259
- 'view__all' => array(
260
- 'label' => __( 'Global', 'creame-whatsapp-me' ),
261
- 'callback' => array( $this, 'field_view_all' ),
262
- ),
263
- ),
264
- 'wp' => array(
265
- 'view__front_page' => __( 'Front Page', 'creame-whatsapp-me' ),
266
- 'view__blog_page' => __( 'Blog Page', 'creame-whatsapp-me' ),
267
- 'view__404_page' => __( '404 Page', 'creame-whatsapp-me' ),
268
- 'view__search' => __( 'Search Results', 'creame-whatsapp-me' ),
269
- 'view__archive' => __( 'Archives', 'creame-whatsapp-me' ),
270
- 'view__date' => '— ' . __( 'Date Archives', 'creame-whatsapp-me' ),
271
- 'view__author' => '— ' . __( 'Author Archives', 'creame-whatsapp-me' ),
272
- 'view__singular' => __( 'Singular', 'creame-whatsapp-me' ),
273
- 'view__page' => '— ' . __( 'Page', 'creame-whatsapp-me' ),
274
- 'view__post' => '— ' . __( 'Post', 'creame-whatsapp-me' ),
275
- ),
276
- );
277
-
278
- // If isn't set Blog Page or is the same than Front Page unset blog_page option
279
- if ( get_option( 'show_on_front' ) == 'posts' || get_option( 'page_for_posts' ) == 0 ) {
280
- unset( $sections['wp']['view__blog_page'] );
281
- }
282
-
283
- // Custom Post Types
284
- $custom_post_types = apply_filters(
285
- 'joinchat_custom_post_types',
286
- array_keys( get_post_types( array( 'has_archive' => true ), 'names' ) )
287
- );
288
-
289
- if ( count( $custom_post_types ) ) {
290
- $sections['cpt'] = array();
291
-
292
- foreach ( $custom_post_types as $custom_post_type ) {
293
- $post_type = get_post_type_object( $custom_post_type );
294
- $post_type_name = function_exists( 'mb_convert_case' ) ?
295
- mb_convert_case( $post_type->labels->name, MB_CASE_TITLE ) :
296
- strtolower( $post_type->labels->name );
297
-
298
- $sections['cpt'][ "view__cpt_$custom_post_type" ] = $post_type_name;
299
- }
300
- }
301
- } elseif ( 'advanced' == $tab ) {
302
-
303
- $sections = array(
304
- 'optin' => array(
305
- 'optin_text' => __( 'Opt-in Text', 'creame-whatsapp-me' ),
306
- 'optin_check' => __( 'Opt-in Required', 'creame-whatsapp-me' ),
307
- ),
308
- 'conversion' => array(
309
- 'gads' => '<label for="joinchat_gads">' . __( 'Google Ads Conversion', 'creame-whatsapp-me' ) . '</label>',
310
- ),
311
- );
312
-
313
- } else {
314
-
315
- $sections = array();
316
-
317
- }
318
-
319
- // Filter tab sections to add, remove or edit sections or fields
320
- return apply_filters( "joinchat_tab_{$tab}_sections", $sections );
321
-
322
- }
323
-
324
- /**
325
- * Validate settings, clean and set defaults before save
326
- *
327
- * @since 1.0.0
328
- * @since 2.0.0 Added visibility setting
329
- * @since 2.1.0 Added message_badge
330
- * @since 2.3.0 Added button_delay and whatsapp_web settings, WPML integration
331
- * @since 3.0.0 Added filter for extra settings and action for extra tasks
332
- * @since 3.1.0 Added tooltip and image
333
- * @param array $input contain keys 'id', 'title' and 'callback'.
334
- * @return array
335
- */
336
- public function settings_validate( $input ) {
337
-
338
- // Prevent bad behavior when validate twice on first save
339
- // bug https://core.trac.wordpress.org/ticket/21989
340
- if ( count( get_settings_errors( $this->plugin_name ) ) ) {
341
- return $input;
342
- }
343
-
344
- $util = new JoinChatUtil(); // Shortcut
345
-
346
- $util::maybe_encode_emoji();
347
-
348
- $input['telephone'] = $util::clean_input( $input['telephone'] );
349
- $input['mobile_only'] = isset( $input['mobile_only'] ) ? 'yes' : 'no';
350
- $input['button_image'] = intval( $input['button_image'] );
351
- $input['button_tip'] = $util::substr( $util::clean_input( $input['button_tip'] ), 0, 40 );
352
- $input['button_delay'] = intval( $input['button_delay'] );
353
- $input['whatsapp_web'] = isset( $input['whatsapp_web'] ) ? 'yes' : 'no';
354
- $input['qr'] = isset( $input['qr'] ) ? 'yes' : 'no';
355
- $input['message_text'] = $util::clean_input( $input['message_text'] );
356
- $input['message_badge'] = isset( $input['message_badge'] ) ? 'yes' : 'no';
357
- $input['message_send'] = $util::clean_input( $input['message_send'] );
358
- $input['message_start'] = $util::substr( $util::clean_input( $input['message_start'] ), 0, 20 );
359
- $input['message_delay'] = intval( $input['message_delay'] );
360
- $input['message_views'] = intval( $input['message_views'] ) ?: 1;
361
- $input['position'] = $input['position'] != 'left' ? 'right' : 'left';
362
- $input['color'] = preg_match( '/^#[a-f0-9]{6}$/i', $input['color'] ) ? $input['color'] : '#25d366';
363
- $input['dark_mode'] = in_array( $input['dark_mode'], array( 'no', 'yes', 'auto' ) ) ? $input['dark_mode'] : 'no';
364
- $input['header'] = in_array( $input['header'], array( '__jc__', '__wa__' ) ) ? $input['header'] : $util::substr( $util::clean_input( $input['header_custom'] ), 0, 40 );
365
- $input['optin_check'] = isset( $input['optin_check'] ) ? 'yes' : 'no';
366
- $input['optin_text'] = wp_kses(
367
- $input['optin_text'],
368
- array(
369
- 'em' => true,
370
- 'strong' => true,
371
- 'a' => array( 'href' => true ),
372
- )
373
- );
374
- $input['gads'] = $util::substr( $util::clean_input( $input['gads'] ), 0, 40 );
375
-
376
- if ( isset( $input['view'] ) ) {
377
- $input['visibility'] = array_filter(
378
- $input['view'],
379
- function( $v ) {
380
- return 'yes' == $v || 'no' == $v;
381
- }
382
- );
383
- }
384
-
385
- // Clean input items that are not in settings
386
- $input = array_intersect_key( $input, $this->settings );
387
-
388
- // Filter for other validations or extra settings
389
- $input = apply_filters( 'joinchat_settings_validate', $input, $this->settings );
390
-
391
- add_settings_error( $this->plugin_name, 'settings_updated', __( 'Settings saved', 'creame-whatsapp-me' ), 'updated' );
392
-
393
- // Delete notice option
394
- if ( $input['telephone'] ) {
395
- delete_option( 'joinchat_notice_dismiss' );
396
- }
397
-
398
- // Extra actions on save
399
- do_action( 'joinchat_settings_validation', $input, $this->settings );
400
-
401
- return $input;
402
- }
403
-
404
- /**
405
- * Tab open HTML output
406
- *
407
- * @since 3.0.0
408
- * @param array $args Section info.
409
- * @return void
410
- */
411
- public function settings_tab_open( $args ) {
412
-
413
- $tab_id = str_replace( array( 'joinchat_tab_', '_open' ), '', $args['id'] );
414
- $active_tab = isset( $_GET['tab'] ) && in_array( $_GET['tab'], array_keys( $this->tabs ) ) ? $_GET['tab'] : 'general';
415
- $active = $active_tab == $tab_id ? 'joinchat-tab-active' : '';
416
-
417
- echo "<div id=\"joinchat_tab_$tab_id\" class=\"joinchat-tab $active\" role=\"tabpanel\" aria-labelledby=\"navtab_$tab_id\" >";
418
-
419
- }
420
-
421
- /**
422
- * Tab close HTML output
423
- *
424
- * @since 3.0.0
425
- * @param array $args Section info.
426
- * @return void
427
- */
428
- public function settings_tab_close( $args ) {
429
-
430
- echo '</div>';
431
-
432
- }
433
-
434
- /**
435
- * Section HTML output
436
- *
437
- * @since 3.0.0
438
- * @param array $args Section info.
439
- * @return void
440
- */
441
- public function section_output( $args ) {
442
- $section_id = $args['id'];
443
-
444
- switch ( $section_id ) {
445
- case 'joinchat_tab_general__button':
446
- $output = '<h2 class="title">' . __( 'Button', 'creame-whatsapp-me' ) . '</h2>' .
447
- '<p>' . __( 'Set the contact number and where you want the WhatsApp button to be displayed.', 'creame-whatsapp-me' ) . '</p>';
448
- break;
449
-
450
- case 'joinchat_tab_general__chat':
451
- $output = '<hr><h2 class="title">' . __( 'Chat Window', 'creame-whatsapp-me' ) . '</h2>' .
452
- '<p>' .
453
- __( 'If you define a "Call to Action" a window will be displayed simulating a chat before launching WhatsApp.', 'creame-whatsapp-me' ) . ' ' .
454
- __( 'You can introduce yourself, offer help or even make promotions to your users.', 'creame-whatsapp-me' ) .
455
- '</p>';
456
- break;
457
-
458
- case 'joinchat_tab_general__chat_open':
459
- $output = '<p>' .
460
- __( 'If it\'s defined a "Call to Action", the Chat Window can be displayed automatically if conditions are met.', 'creame-whatsapp-me' ) .
461
- ' <a class="joinchat-show-help" href="#tab-link-triggers" title="' . __( 'Show Help', 'creame-whatsapp-me' ) . '">?</a>' .
462
- '</p>';
463
- break;
464
-
465
- case 'joinchat_tab_visibility__global':
466
- $output = '<h2 class="title">' . __( 'Visibility Settings', 'creame-whatsapp-me' ) . '</h2>' .
467
- '<p>' . __( 'From here you can configure on which pages the WhatsApp button will be visible.', 'creame-whatsapp-me' ) .
468
- ' <a href="#" class="joinchat_view_reset">' . __( 'Restore default visibility', 'creame-whatsapp-me' ) . '</a></p>';
469
- break;
470
-
471
- case 'joinchat_tab_visibility__wp':
472
- $output = '<hr>';
473
- break;
474
-
475
- case 'joinchat_tab_visibility__cpt':
476
- $output = '<h2 class="title">' . __( 'Custom Post Types', 'creame-whatsapp-me' ) . '</h2>';
477
- break;
478
-
479
- case 'joinchat_tab_advanced__optin':
480
- $output = '<h2 class="title">' . __( 'Opt-in', 'creame-whatsapp-me' ) . '</h2>' .
481
- '<p>' . __( 'Opt-in is a users’ consent to receive messages from a business.', 'creame-whatsapp-me' ) . '</p>';
482
- break;
483
-
484
- case 'joinchat_tab_advanced__conversion':
485
- $output = '<hr><h2 class="title">' . __( 'Conversions', 'creame-whatsapp-me' ) . '</h2>';
486
- break;
487
-
488
- default:
489
- $output = '';
490
- break;
491
- }
492
-
493
- // Filter section opening ouput
494
- echo apply_filters( 'joinchat_section_output', $output, $section_id );
495
- }
496
-
497
- /**
498
- * Field HTML output
499
- *
500
- * @since 3.0.0
501
- * @since 3.1.0 Added tooltip and image
502
- * @return void
503
- */
504
- public function field_output( $field_id ) {
505
-
506
- if ( strpos( $field_id, 'view__' ) === 0 ) {
507
- $field = substr( $field_id, 6 );
508
- $value = isset( $this->settings['visibility'][ $field ] ) ? $this->settings['visibility'][ $field ] : '';
509
-
510
- $output = '<label><input type="radio" name="joinchat[view][' . $field . ']" value="yes"' . checked( 'yes', $value, false ) . '> ' .
511
- '<span class="dashicons dashicons-visibility" title="' . __( 'Show', 'creame-whatsapp-me' ) . '"></span></label>' .
512
- '<label><input type="radio" name="joinchat[view][' . $field . ']" value="no"' . checked( 'no', $value, false ) . '> ' .
513
- '<span class="dashicons dashicons-hidden" title="' . __( 'Hide', 'creame-whatsapp-me' ) . '"></span></label>' .
514
- '<label><input type="radio" name="joinchat[view][' . $field . ']" value=""' . checked( '', $value, false ) . '> ' .
515
- __( 'Inherit', 'creame-whatsapp-me' ) . ' <span class="dashicons dashicons-visibility view_inheritance_' . $field . '"></span></label>';
516
-
517
- } else {
518
-
519
- $value = isset( $this->settings[ $field_id ] ) ? $this->settings[ $field_id ] : '';
520
- $utm = '?utm_source=settings&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
521
- $lang = false !== strpos( strtolower( get_locale() ), 'es' ) ? 'es' : 'en';
522
-
523
- switch ( $field_id ) {
524
- case 'telephone':
525
- $output = '<input id="joinchat_phone" ' . ( $this->enhanced_phone ? 'data-' : '' ) . 'name="joinchat[telephone]" value="' . esc_attr( $value ) . '" type="text" style="width:15em">' .
526
- '<p class="description">' . __( "Contact phone number <strong>(the button will not be shown if it's empty)</strong>", 'creame-whatsapp-me' ) . '</p>' .
527
- '<p class="joinchat-addon">' . sprintf(
528
- __( 'Add unlimited numbers with %1$s or multiple contacts with %2$s', 'creame-whatsapp-me' ),
529
- '<a href="https://join.chat/' . $lang . '/addons/random-phone/' . $utm . '" target="_blank">\'Random Phone\'</a>',
530
- '<a href="https://join.chat/' . $lang . '/addons/support-agents/' . $utm . '" target="_blank">\'Support Agents\'</a>'
531
- ) . '</p>';
532
- break;
533
-
534
- case 'mobile_only':
535
- $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Mobile Only', 'creame-whatsapp-me' ) . '</span></legend>' .
536
- '<label><input id="joinchat_mobile_only" name="joinchat[mobile_only]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
537
- __( 'Only display the button on mobile devices', 'creame-whatsapp-me' ) . '</label></fieldset>';
538
- break;
539
-
540
- case 'position':
541
- $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Position on Screen', 'creame-whatsapp-me' ) . '</span></legend>' .
542
- '<label><input name="joinchat[position]" value="left" type="radio"' . checked( 'left', $value, false ) . '> ' .
543
- __( 'Left', 'creame-whatsapp-me' ) . '</label><br>' .
544
- '<label><input name="joinchat[position]" value="right" type="radio"' . checked( 'right', $value, false ) . '> ' .
545
- __( 'Right', 'creame-whatsapp-me' ) . '</label></fieldset>';
546
- break;
547
-
548
- case 'button_image':
549
- $thumb = JoinChatUtil::thumb( $value, 116, 116 );
550
- $image = is_array( $thumb ) ? $thumb['url'] : false;
551
-
552
- $output = '<div id="joinchat_button_image_wrapper">' .
553
- '<div id="joinchat_button_image_holder" ' . ( $image ? "style=\"background-size:cover; background-image:url('$image');\"" : '' ) . '></div>' .
554
- '<input id="joinchat_button_image" name="joinchat[button_image]" type="hidden" value="' . intval( $value ) . '">' .
555
- '<input id="joinchat_button_image_add" type="button" value="' . esc_attr__( 'Select an image', 'creame-whatsapp-me' ) . '" class="button-primary" ' .
556
- 'data-title="' . esc_attr__( 'Select button image', 'creame-whatsapp-me' ) . '" data-button="' . esc_attr__( 'Use image', 'creame-whatsapp-me' ) . '"> ' .
557
- '<input id="joinchat_button_image_remove" type="button" value="' . esc_attr__( 'Remove', 'creame-whatsapp-me' ) . '" class="button-secondary' . ( $image ? '' : ' joinchat-hidden' ) . '">' .
558
- '<p class="description">' . __( 'The image will alternate with button icon', 'creame-whatsapp-me' ) . '</p></div>' .
559
- '<p class="joinchat-addon">' . sprintf(
560
- __( 'Other icons and more channels (Telegram, Messenger…) with %s', 'creame-whatsapp-me' ),
561
- '<a href="https://join.chat/' . $lang . '/addons/omnichannel/' . $utm . '" target="_blank">\'Omnichannel\'</a>'
562
- ) . '</p>';
563
- break;
564
-
565
- case 'button_tip':
566
- $output = '<input id="joinchat_button_tip" name="joinchat[button_tip]" value="' . esc_attr( $value ) . '" type="text" maxlength="40" class="regular-text autofill" placeholder="' . esc_attr__( '💬 Need help?', 'creame-whatsapp-me' ) . '"> ' .
567
- '<p class="description">' . __( 'Short text shown next to button', 'creame-whatsapp-me' ) . '</p>';
568
- break;
569
-
570
- case 'button_delay':
571
- $output = '<input id="joinchat_button_delay" name="joinchat[button_delay]" value="' . intval( $value ) . '" type="number" min="-1" max="120" style="width:5em"> ' .
572
- __( 'seconds', 'creame-whatsapp-me' ) . ' (' . __( '-1 to display directly without animation', 'creame-whatsapp-me' ) . ')' .
573
- '<p class="description">' . __( 'Time since the page is opened until the button is displayed', 'creame-whatsapp-me' ) . '</p>';
574
- break;
575
-
576
- case 'whatsapp_web':
577
- $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'WhatsApp Web', 'creame-whatsapp-me' ) . '</span></legend>' .
578
- '<label><input id="joinchat_whatsapp_web" name="joinchat[whatsapp_web]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
579
- __( 'Open <em>WhatsApp Web</em> directly on desktop', 'creame-whatsapp-me' ) . '</label></fieldset>';
580
- break;
581
-
582
- case 'qr':
583
- $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'QR Code', 'creame-whatsapp-me' ) . '</span></legend>' .
584
- '<label><input id="joinchat_qr" name="joinchat[qr]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
585
- __( 'Display QR code on desktop to scan with phone', 'creame-whatsapp-me' ) . '</label></fieldset>';
586
- break;
587
-
588
- case 'message_text':
589
- $output = '<textarea id="joinchat_message_text" name="joinchat[message_text]" rows="4" class="regular-text autofill" placeholder="' . esc_attr__( "Hello 👋\nCan we help you?", 'creame-whatsapp-me' ) . '">' . esc_textarea( $value ) . '</textarea>' .
590
- '<p class="description">' . __( 'Define a text to encourage users to contact by WhatsApp', 'creame-whatsapp-me' ) . '</p>' .
591
- '<p class="joinchat-addon">' . sprintf(
592
- __( 'Add links, images, videos and more with %s', 'creame-whatsapp-me' ),
593
- '<a href="https://join.chat/' . $lang . '/addons/cta-extras/' . $utm . '" target="_blank">\'CTA Extras\'</a>'
594
- ) . '</p>';
595
- break;
596
-
597
- case 'message_send':
598
- $output = '<textarea id="joinchat_message_send" name="joinchat[message_send]" rows="3" class="regular-text autofill" placeholder="' . esc_attr__( 'Hi *{SITE}*! I need more info about {TITLE} {URL}', 'creame-whatsapp-me' ) . '">' . esc_textarea( $value ) . '</textarea>' .
599
- '<p class="description">' . __( 'Predefined text for the first message the user will send you', 'creame-whatsapp-me' ) . '</p>';
600
- break;
601
-
602
- case 'message_start':
603
- $output = '<input id="joinchat_message_start" name="joinchat[message_start]" value="' . esc_attr( $value ) . '" type="text" maxlength="20" class="regular-text autofill" placeholder="' . esc_attr__( 'Open chat', 'creame-whatsapp-me' ) . '"> ' .
604
- '<p class="description">' . __( 'Text to open chat on Chat Window button', 'creame-whatsapp-me' ) . '</p>';
605
- break;
606
-
607
- case 'message_delay':
608
- $output = '<input id="joinchat_message_delay" name="joinchat[message_delay]" value="' . intval( $value ) . '" type="number" min="0" max="120" style="width:5em"> ' .
609
- __( 'seconds', 'creame-whatsapp-me' ) . ' (' . __( '0 to disable', 'creame-whatsapp-me' ) . ')' .
610
- '<p class="description">' . __( 'Chat Window auto displays after delay', 'creame-whatsapp-me' ) . '</p>';
611
- break;
612
-
613
- case 'message_views':
614
- $output = '<input id="joinchat_message_views" name="joinchat[message_views]" value="' . intval( $value ) . '" type="number" min="1" max="120" style="width:5em"> ' .
615
- '<p class="description">' . __( 'Chat Window auto displays from this number of page views', 'creame-whatsapp-me' ) . '</p>';
616
- break;
617
-
618
- case 'message_badge':
619
- $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Notification Balloon', 'creame-whatsapp-me' ) . '</span></legend>' .
620
- '<label><input id="joinchat_message_badge" name="joinchat[message_badge]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
621
- __( 'Display a notification balloon instead of opening the Chat Window for a "less intrusive" mode', 'creame-whatsapp-me' ) . '</label></fieldset>';
622
- break;
623
-
624
- case 'color':
625
- $output = '<input id="joinchat_color" name="joinchat[color]" value="' . esc_attr( $value ) . '" type="text" data-default-color="#25d366"> ';
626
- break;
627
-
628
- case 'dark_mode':
629
- $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Dark Mode', 'creame-whatsapp-me' ) . '</span></legend>' .
630
- '<label><input name="joinchat[dark_mode]" value="no" type="radio"' . checked( 'no', $value, false ) . '> ' .
631
- __( 'No', 'creame-whatsapp-me' ) . '</label><br>' .
632
- '<label><input name="joinchat[dark_mode]" value="yes" type="radio"' . checked( 'yes', $value, false ) . '> ' .
633
- __( 'Yes', 'creame-whatsapp-me' ) . '</label><br>' .
634
- '<label><input name="joinchat[dark_mode]" value="auto" type="radio"' . checked( 'auto', $value, false ) . '> ' .
635
- __( 'Auto (detects device dark mode)', 'creame-whatsapp-me' ) . '</label></fieldset>';
636
- break;
637
-
638
- case 'header':
639
- $check = in_array( $value, array( '__jc__', '__wa__' ) ) ? $value : '__custom__';
640
- $value = '__custom__' == $check ? $value : '';
641
-
642
- $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Header', 'creame-whatsapp-me' ) . '</span></legend>' .
643
- '<label><input name="joinchat[header]" value="__jc__" type="radio"' . checked( '__jc__', $check, false ) . '> ' .
644
- __( 'Powered by Join.chat', 'creame-whatsapp-me' ) . '</label><br>' .
645
- '<label><input name="joinchat[header]" value="__wa__" type="radio"' . checked( '__wa__', $check, false ) . '> ' .
646
- __( 'WhatsApp Logo', 'creame-whatsapp-me' ) . '</label><br>' .
647
- '<label><input name="joinchat[header]" value="__custom__" type="radio"' . checked( '__custom__', $check, false ) . '> ' .
648
- __( 'Custom:', 'creame-whatsapp-me' ) . '</label> ' .
649
- '<input id="joinchat_header_custom" name="joinchat[header_custom]" value="' . esc_attr( $value ) . '" type="text" maxlength="40" class="regular-text">' .
650
- '</fieldset>';
651
- break;
652
-
653
- case 'optin_text':
654
- $editor_settings = array(
655
- 'textarea_name' => 'joinchat[optin_text]',
656
- 'textarea_rows' => 4,
657
- 'teeny' => true,
658
- 'media_buttons' => false,
659
- 'tinymce' => array( 'statusbar' => false ),
660
- 'quicktags' => false,
661
- );
662
-
663
- // phpcs:disable
664
- add_filter( 'teeny_mce_plugins', function( $filters, $editor_id ) {
665
- return 'joinchat_optin_text' === $editor_id ? array( 'wordpress', 'wplink' ) : $filters;
666
- }, 10, 2 );
667
-
668
- add_filter( 'teeny_mce_buttons', function( $mce_buttons, $editor_id ) {
669
- return 'joinchat_optin_text' === $editor_id ? array( 'bold', 'italic', 'link' ) : $mce_buttons;
670
- }, 10, 2 );
671
- // phpcs:enable
672
-
673
- $output = wp_editor( $value, 'joinchat_optin_text', $editor_settings ) .
674
- '<p class="description">' . __( "Explain how you will use the user's contact and the conditions they accept.", 'creame-whatsapp-me' ) . '</p>';
675
- break;
676
-
677
- case 'optin_check':
678
- $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Opt-in Required', 'creame-whatsapp-me' ) . '</span></legend>' .
679
- '<label><input id="joinchat_optin_check" name="joinchat[optin_check]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
680
- __( 'User approval is required to enable the contact button', 'creame-whatsapp-me' ) . '</label></fieldset>';
681
- break;
682
-
683
- case 'gads':
684
- $output = '<input id="joinchat_gads" name="joinchat[gads]" value="' . esc_attr( $value ) . '" type="text" maxlength="40" class="regular-text" ' .
685
- 'placeholder="' . esc_attr__( 'AW-CONVERSION_ID/CONVERSION_LABEL', 'creame-whatsapp-me' ) . '" title="' . esc_attr__( 'AW-CONVERSION_ID/CONVERSION_LABEL', 'creame-whatsapp-me' ) . '"> ' .
686
- '<p class="description">' . __( 'Send the conversion automatically at the chat start', 'creame-whatsapp-me' ) . '</p>';
687
- break;
688
-
689
- default:
690
- $output = '';
691
- break;
692
- }
693
- }
694
-
695
- // Filter field ouput
696
- echo apply_filters( 'joinchat_field_output', $output, $field_id, $this->settings );
697
- }
698
-
699
- /**
700
- * Field 'field_view_all' output
701
- *
702
- * @since 2.0.0
703
- * @since 3.0.0 Added $inheritance data
704
- * @return void
705
- */
706
- public function field_view_all() {
707
- $value = ( isset( $this->settings['visibility']['all'] ) && 'no' == $this->settings['visibility']['all'] ) ? 'no' : 'yes';
708
-
709
- $inheritance = apply_filters(
710
- 'joinchat_visibility_inheritance',
711
- array(
712
- 'all' => array( 'front_page', 'blog_page', '404_page', 'search', 'archive', 'singular', 'cpts' ),
713
- 'archive' => array( 'date', 'author' ),
714
- 'singular' => array( 'page', 'post' ),
715
- )
716
- );
717
-
718
- echo '<div class="joinchat_view_all" data-inheritance="' . esc_attr( json_encode( $inheritance ) ) . '">' .
719
- '<label><input type="radio" name="joinchat[view][all]" value="yes"' . checked( 'yes', $value, false ) . '> ' .
720
- '<span class="dashicons dashicons-visibility" title="' . __( 'Show', 'creame-whatsapp-me' ) . '"></span></label>' .
721
- '<label><input type="radio" name="joinchat[view][all]" value="no"' . checked( 'no', $value, false ) . '> ' .
722
- '<span class="dashicons dashicons-hidden" title="' . __( 'Hide', 'creame-whatsapp-me' ) . '"></span></label></div>';
723
- }
724
-
725
- /**
726
- * Add menu to the options page in the WordPress admin
727
- *
728
- * @since 1.0.0
729
- * @since 4.2.0 allowed direct menu page
730
- * @access public
731
- * @return void
732
- */
733
- public function add_menu() {
734
-
735
- $title = 'Join.chat';
736
-
737
- if ( JoinChatUtil::options_submenu() ) {
738
- $icon = '<span class="dashicons dashicons-whatsapp" aria-hidden="true" style="height:18px;font-size:18px;margin:0 8px;"></span>';
739
-
740
- add_options_page( $title, $title . $icon, JoinChatUtil::capability(), $this->plugin_name, array( $this, 'options_page' ) );
741
- } else {
742
- add_menu_page( $title, $title, JoinChatUtil::capability(), $this->plugin_name, array( $this, 'options_page' ), 'dashicons-whatsapp', 81 );
743
- }
744
-
745
- }
746
-
747
  /**
748
  * Show admin notices
749
  *
@@ -759,8 +120,8 @@ class JoinChatAdmin {
759
 
760
  $current_screen = get_current_screen();
761
 
762
- // If no phone number defined
763
- if ( empty( $this->settings['telephone'] )
764
  && current_user_can( JoinChatUtil::capability() )
765
  && ( $current_screen && false === strpos( $current_screen->id, '_joinchat' ) )
766
  && time() >= (int) get_option( 'joinchat_notice_dismiss' )
@@ -768,15 +129,15 @@ class JoinChatAdmin {
768
 
769
  printf(
770
  '<div class="notice notice-info is-dismissible" id="joinchat-empty-phone"><p><strong>Join.chat</strong>&nbsp;&nbsp;%s %s</p></div>',
771
- __( 'You only need to add your WhatsApp number to contact with your users.', 'creame-whatsapp-me' ),
772
- sprintf( '<a href="%s"><strong>%s</strong></a>', JoinChatUtil::admin_url(), __( 'Go to settings', 'creame-whatsapp-me' ) )
773
  );
774
 
775
  printf(
776
  '<script>jQuery("#joinchat-empty-phone").on("click", ".notice-dismiss", function () {' .
777
  'jQuery.post(ajaxurl, { action: "joinchat_notice_dismiss", nonce: "%s"}, null, "json");' .
778
  '});</script>',
779
- wp_create_nonce( 'joinchat_nonce' )
780
  );
781
  }
782
 
@@ -797,90 +158,6 @@ class JoinChatAdmin {
797
 
798
  }
799
 
800
- /**
801
- * Add a help tab to the options page in the WordPress admin
802
- *
803
- * @since 3.0.0
804
- * @access public
805
- * @return void
806
- */
807
- function help_tab() {
808
- $screen = get_current_screen();
809
- $utm = '?utm_source=helptab&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
810
- $lang = false !== strpos( strtolower( get_locale() ), 'es' ) ? 'es' : 'en';
811
-
812
- $help_tabs = array(
813
- array(
814
- 'id' => 'styles-and-vars',
815
- 'title' => __( 'Styles and Variables', 'creame-whatsapp-me' ),
816
- 'content' =>
817
- '<p>' . __( 'You can use formatting styles like in WhatsApp: _<em>italic</em>_ *<strong>bold</strong>* ~<del>strikethrough</del>~.', 'creame-whatsapp-me' ) . '</p>' .
818
- '<p>' . __( 'You can use dynamic variables that will be replaced by the values of the page the user visits:', 'creame-whatsapp-me' ) .
819
- '<p>' .
820
- '<span><code>{SITE}</code> ➜ ' . get_bloginfo( 'name', 'display' ) . '</span><br> ' .
821
- '<span><code>{TITLE}</code> ➜ ' . __( 'Page Title', 'creame-whatsapp-me' ) . '</span><br>' .
822
- '<span><code>{URL}</code> ➜ ' . home_url( 'awesome/' ) . '</span><br> ' .
823
- '<span><code>{HREF}</code> ➜ ' . home_url( 'awesome/' ) . '?utm_source=twitter&utm_medium=social&utm_campaign=XXX</span> ' .
824
- '</p>',
825
- ),
826
- array(
827
- 'id' => 'triggers',
828
- 'title' => __( 'Triggers', 'creame-whatsapp-me' ),
829
- 'content' =>
830
- '<p>' . __( 'You can interact on your page with Join.chat in two ways:', 'creame-whatsapp-me' ) . '</p>' .
831
- '<p>' . __( 'With anchor links:', 'creame-whatsapp-me' ) . '</p>' .
832
- '<ul>' .
833
- '<li><code>#joinchat</code> ' . __( 'to show Chat Window (or open WhatsApp if there is no CTA) on click.', 'creame-whatsapp-me' ) . '</li>' .
834
- '<li><code>#whatsapp</code> ' . __( 'to open WhatsApp directly on click.', 'creame-whatsapp-me' ) . '</li>' .
835
- '</ul>' .
836
- '<p>' . __( 'Example:', 'creame-whatsapp-me' ) . '<code>&lt;a href="#whatsapp"&gt;' . __( 'Contact us', 'creame-whatsapp-me' ) . '&lt;/a&gt;</code></p>' .
837
- '<p>' . __( 'Adding some CSS classes in your HTML:', 'creame-whatsapp-me' ) . '</p>' .
838
- '<ul>' .
839
- '<li><code>joinchat_open</code> ' . __( 'to show Chat Window (or open WhatsApp if there is no CTA) on click.', 'creame-whatsapp-me' ) . '</li>' .
840
- '<li><code>joinchat_close</code> ' . __( 'to hide Chat Window on click.', 'creame-whatsapp-me' ) . '</li>' .
841
- '<li><code>joinchat_app</code> ' . __( 'to open WhatsApp directly on click.', 'creame-whatsapp-me' ) . '</li>' .
842
- '<li>' . __( 'To show Chat Window when an HTML element appears on screen when user scrolls:', 'creame-whatsapp-me' ) .
843
- '<ul>' .
844
- '<li><code>joinchat_show</code> ' . __( 'only show if it\'s an not seen CTA.', 'creame-whatsapp-me' ) . '</li>' .
845
- '<li><code>joinchat_force_show</code> ' . __( 'to show always.', 'creame-whatsapp-me' ) . '</li>' .
846
- '</ul></li>' .
847
- '</ul>' .
848
- '<p>' . __( 'Example:', 'creame-whatsapp-me' ) . '<code>&lt;img src="contact.jpg" class="joinchat_open" alt="' . __( 'Contact us', 'creame-whatsapp-me' ) . '"&gt;</code></p>',
849
- ),
850
- array(
851
- 'id' => 'support',
852
- 'title' => __( 'Support', 'creame-whatsapp-me' ),
853
- 'content' =>
854
- '<p>' . sprintf(
855
- __( 'If you need help, first review our <a href="%1$s" target="_blank">documentation</a> and if you don\'t find a solution check the <a href="%2$s" target="_blank">free plugin support forum</a> or buy our <a href="%3$s" target="_blank">premium support</a>.', 'creame-whatsapp-me' ),
856
- esc_url( "https://join.chat/$lang/docs/$utm" ),
857
- esc_url( 'https://wordpress.org/support/plugin/creame-whatsapp-me/' ),
858
- esc_url( "https://my.join.chat/$utm" )
859
- ) . '</p>' .
860
- '<p>' . __( 'If you like Join.chat 😍', 'creame-whatsapp-me' ) . '</p>' .
861
- '<ul>' .
862
- '<li>' . sprintf(
863
- __( "Please leave us a %s rating. We'll thank you.", 'creame-whatsapp-me' ),
864
- '<a href="https://wordpress.org/support/plugin/creame-whatsapp-me/reviews/#new-post" target="_blank">★★★★★</a>'
865
- ) . '</li>' .
866
- '<li>' . sprintf(
867
- __( 'Subscribe to our newsletter and visit our blog at %s.', 'creame-whatsapp-me' ),
868
- '<a href="https://join.chat/' . $utm . '" target="_blank">join.chat</a>'
869
- ) . '</li>' .
870
- '<li>' . sprintf(
871
- __( 'Follow %s on twitter.', 'creame-whatsapp-me' ),
872
- '<a href="https://twitter.com/joinchatnow" target="_blank">@joinchatnow</a>'
873
- ) . '</li>' .
874
- '</ul>',
875
- ),
876
- );
877
-
878
- foreach ( $help_tabs as $tab_data ) {
879
- $screen->add_help_tab( apply_filters( 'joinchat_help_tab_' . str_replace( '-', '_', $tab_data['id'] ), $tab_data ) );
880
- }
881
-
882
- }
883
-
884
  /**
885
  * Add link to options page on plugins page
886
  *
@@ -919,7 +196,7 @@ class JoinChatAdmin {
919
  */
920
  public function plugin_links( $plugin_meta, $plugin_file ) {
921
 
922
- if ( 'creame-whatsapp-me/joinchat.php' == $plugin_file ) {
923
  $utm = '?utm_source=plugins&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
924
  $lang = false !== strpos( strtolower( get_locale() ), 'es' ) ? 'es' : 'en';
925
 
@@ -931,72 +208,18 @@ class JoinChatAdmin {
931
 
932
  }
933
 
934
- /**
935
- * Generate the options page in the WordPress admin
936
- *
937
- * @since 1.0.0
938
- * @since 2.2.0 Enqueue scripts/styles
939
- * @access public
940
- * @return void
941
- */
942
- function options_page() {
943
-
944
- // Enqueue WordPress media scripts
945
- wp_enqueue_media();
946
- // Enqueue assets
947
- wp_enqueue_script( 'joinchat-admin' );
948
- wp_enqueue_style( 'joinchat-admin' );
949
-
950
- if ( $this->enhanced_phone ) {
951
- wp_enqueue_style( 'intl-tel-input' );
952
- }
953
-
954
- $active_tab = isset( $_GET['tab'] ) && in_array( $_GET['tab'], array_keys( $this->tabs ) ) ? $_GET['tab'] : 'general';
955
- ?>
956
- <div class="wrap">
957
- <h1><?php _e( 'Join.chat Settings', 'creame-whatsapp-me' ); ?></h1>
958
-
959
- <?php
960
- if ( ! JoinChatUtil::options_submenu() ) {
961
- settings_errors();
962
- }
963
- ?>
964
-
965
- <form method="post" id="joinchat_form" action="options.php" autocomplete="off">
966
- <?php settings_fields( $this->plugin_name ); ?>
967
- <h2 class="nav-tab-wrapper wp-clearfix" role="tablist">
968
- <?php foreach ( $this->tabs as $tab => $name ) : ?>
969
- <?php if ( $active_tab === $tab ) : ?>
970
- <a id="navtab_<?php echo $tab; ?>" href="#joinchat_tab_<?php echo $tab; ?>" class="nav-tab nav-tab-active" role="tab" aria-controls="joinchat_tab_<?php echo $tab; ?>" aria-selected="true"><?php echo $name; ?></a>
971
- <?php else : ?>
972
- <a id="navtab_<?php echo $tab; ?>" href="#joinchat_tab_<?php echo $tab; ?>" class="nav-tab" role="tab" aria-controls="joinchat_tab_<?php echo $tab; ?>" aria-selected="false"><?php echo $name; ?></a>
973
- <?php endif; ?>
974
- <?php endforeach; ?>
975
- </h2>
976
- <div class="joinchat-tabs">
977
- <?php do_settings_sections( $this->plugin_name ); ?>
978
- </div><!-- end tabs -->
979
- <?php submit_button(); ?>
980
- </form>
981
- </div>
982
- <?php
983
- }
984
-
985
  /**
986
  * Add Meta Box for all the public post types
987
  *
988
  * @since 1.1.0
 
989
  * @access public
990
  * @return void
991
  */
992
  public function add_meta_boxes() {
993
- // Default post types
994
- $builtin_post_types = array( 'post', 'page' );
995
- // Custom post types with public url
996
- $custom_post_types = array_keys( get_post_types( array( 'has_archive' => true ), 'names' ) );
997
 
998
- // Add/remove posts types for "Join.chat" meta box
999
- $post_types = apply_filters( 'joinchat_post_types_meta_box', array_merge( $builtin_post_types, $custom_post_types ) );
1000
 
1001
  foreach ( $post_types as $post_type ) {
1002
  add_meta_box(
@@ -1005,7 +228,8 @@ class JoinChatAdmin {
1005
  array( $this, 'meta_box' ),
1006
  $post_type,
1007
  'side',
1008
- 'default'
 
1009
  );
1010
  }
1011
  }
@@ -1019,20 +243,20 @@ class JoinChatAdmin {
1019
  * @since 3.0.3 Capture and filter output
1020
  * @since 3.2.0 Added filter 'joinchat_metabox_placeholders'
1021
  * @access public
1022
- * @param WP_Post $post Current post object
1023
  * @return void
1024
  */
1025
  public function meta_box( $post ) {
1026
 
1027
- // Enqueue assets
1028
  wp_enqueue_script( 'joinchat-admin' );
1029
  wp_enqueue_style( 'joinchat-admin' );
1030
 
1031
- if ( $this->enhanced_phone ) {
1032
  wp_enqueue_style( 'intl-tel-input' );
1033
  }
1034
 
1035
- $metadata = get_post_meta( $post->ID, '_joinchat', true ) ?: array();
1036
  $metadata = array_merge(
1037
  array(
1038
  'telephone' => '',
@@ -1043,24 +267,14 @@ class JoinChatAdmin {
1043
  $metadata
1044
  );
1045
 
1046
- $placeholders = apply_filters(
1047
- 'joinchat_metabox_placeholders',
1048
- array(
1049
- 'telephone' => $this->settings['telephone'],
1050
- 'message_text' => $this->settings['message_text'],
1051
- 'message_send' => $this->settings['message_send'],
1052
- ),
1053
- $post,
1054
- $this->settings
1055
- );
1056
-
1057
- $metabox_vars = apply_filters( 'joinchat_metabox_vars', array( 'SITE', 'TITLE', 'URL', 'HREF' ), $post );
1058
 
1059
  ob_start();
1060
  include __DIR__ . '/partials/post_meta_box.php';
1061
  $metabox_output = ob_get_clean();
1062
 
1063
- echo apply_filters( 'joinchat_metabox_output', $metabox_output, $post, $metadata );
1064
  }
1065
 
1066
  /**
@@ -1068,8 +282,8 @@ class JoinChatAdmin {
1068
  *
1069
  * @since 4.3.0
1070
  * @access public
1071
- * @param int $id post|term ID
1072
- * @param WP_Post|int $arg current post or term taxonomi id
1073
  * @return void
1074
  */
1075
  public function save_meta( $id, $arg ) {
@@ -1086,7 +300,7 @@ class JoinChatAdmin {
1086
 
1087
  JoinChatUtil::maybe_encode_emoji();
1088
 
1089
- // Clean and delete empty/false fields
1090
  $metadata = array_filter(
1091
  JoinChatUtil::clean_input(
1092
  array(
@@ -1130,21 +344,21 @@ class JoinChatAdmin {
1130
  *
1131
  * @since 4.3.0
1132
  * @access public
1133
- * @param WP_Term $term Current taxonomy term object
1134
- * @param string $taxonomy Current taxonomy slug
1135
  * @return void
1136
  */
1137
  public function term_meta_box( $term, $taxonomy ) {
1138
 
1139
- // Enqueue assets
1140
  wp_enqueue_script( 'joinchat-admin' );
1141
  wp_enqueue_style( 'joinchat-admin' );
1142
 
1143
- if ( $this->enhanced_phone ) {
1144
  wp_enqueue_style( 'intl-tel-input' );
1145
  }
1146
 
1147
- $metadata = get_term_meta( $term->term_id, '_joinchat', true ) ?: array();
1148
  $metadata = array_merge(
1149
  array(
1150
  'telephone' => '',
@@ -1155,41 +369,14 @@ class JoinChatAdmin {
1155
  $metadata
1156
  );
1157
 
1158
- $placeholders = apply_filters(
1159
- 'joinchat_metabox_placeholders',
1160
- array(
1161
- 'telephone' => $this->settings['telephone'],
1162
- 'message_text' => $this->settings['message_text'],
1163
- 'message_send' => $this->settings['message_send'],
1164
- ),
1165
- $term,
1166
- $this->settings
1167
- );
1168
-
1169
- $metabox_vars = apply_filters( 'joinchat_metabox_vars', array( 'SITE', 'TITLE', 'URL', 'HREF' ), $term );
1170
 
1171
  ob_start();
1172
  include __DIR__ . '/partials/term_meta_box.php';
1173
  $metabox_output = ob_get_clean();
1174
 
1175
- echo apply_filters( 'joinchat_term_metabox_output', $metabox_output, $term, $metadata, $taxonomy );
1176
- }
1177
-
1178
- /**
1179
- * Return html for dynamic variables help next to field label
1180
- *
1181
- * @since 3.1.2
1182
- * @access public
1183
- * @param string $field field name.
1184
- * @return string
1185
- */
1186
- public static function vars_help( $field ) {
1187
-
1188
- $vars = apply_filters( 'joinchat_vars_help', array( 'SITE', 'TITLE', 'URL', 'HREF' ), $field );
1189
-
1190
- return count( $vars ) ? '<div class="joinchat_vars_help">' . __( 'You can use vars', 'creame-whatsapp-me' ) . ' ' .
1191
- '<a class="joinchat-show-help" href="#" title="' . __( 'Show Help', 'creame-whatsapp-me' ) . '">?</a><br> ' .
1192
- '<code>{' . join( '}</code> <code>{', $vars ) . '}</code></div>' : '';
1193
 
1194
  }
1195
 
@@ -1198,13 +385,11 @@ class JoinChatAdmin {
1198
  *
1199
  * @since 4.0.5
1200
  * @access public
1201
- * @param mixed $old_value joinchat previous settings.
1202
- * @param mixed $value joinchat new settings.
1203
  * @return void
1204
  */
1205
  public static function clear_cache() {
1206
 
1207
- // TODO: Prevent Autoptimize clear many times
1208
 
1209
  /**
1210
  * List of callable functions or actions by third party plugins.
@@ -1213,16 +398,16 @@ class JoinChatAdmin {
1213
  $cache_plugins = apply_filters(
1214
  'joinchat_cache_plugins',
1215
  array(
1216
- 'autoptimizeCache::clearall_actionless', // Autoptimize https://wordpress.org/plugins/autoptimize/
1217
- 'ce_clear_cache', // Cache Enabler https://wordpress.org/plugins/cache-enabler/
1218
- 'cachify_flush_cache', // Cachify https://wordpress.org/plugins/cachify/
1219
- 'LiteSpeed_Cache_API::purge_all', // LiteSpeed Cache https://wordpress.org/plugins/litespeed-cache/
1220
- 'sg_cachepress_purge_cache', // SG Optimizer https://es.wordpress.org/plugins/sg-cachepress/
1221
- array( 'wpfc_clear_all_cache', true ), // WP Fastest Cache https://es.wordpress.org/plugins/wp-fastest-cache/
1222
- 'rocket_clean_minify', // WP Rocket https://wp-rocket.me
1223
  'rocket_clean_domain',
1224
- 'wp_cache_clear_cache', // WP Super Cache https://wordpress.org/plugins/wp-super-cache/
1225
- 'w3tc_flush_all', // W3 Total Cache https://wordpress.org/plugins/w3-total-cache/
1226
  )
1227
  );
1228
 
@@ -1237,26 +422,4 @@ class JoinChatAdmin {
1237
  }
1238
 
1239
  }
1240
-
1241
- /**
1242
- * Modifies the "Thank you" text displayed in the admin footer.
1243
- *
1244
- * @since 4.0.10
1245
- * @access public
1246
- * @param string $footer_text The content that will be printed.
1247
- * @return string The content that will be printed.
1248
- */
1249
- public function admin_footer_text( $footer_text ) {
1250
- $current_screen = get_current_screen();
1251
-
1252
- if ( $current_screen && false !== strpos( $current_screen->id, '_joinchat' ) ) {
1253
- $footer_text = sprintf(
1254
- __( 'Do you like %1$s? Please help us with a %2$s rating.', 'creame-whatsapp-me' ),
1255
- '<strong>Join.chat</strong>',
1256
- '<a href="https://wordpress.org/support/plugin/creame-whatsapp-me/reviews/#new-post" target="_blank">★★★★★</a>'
1257
- );
1258
- }
1259
-
1260
- return $footer_text;
1261
- }
1262
  }
39
  */
40
  private $common;
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  /**
43
  * Initialize the class and set its properties.
44
  *
51
 
52
  $this->plugin_name = $plugin_name;
53
  $this->version = $version;
54
+ $this->common = JoinChatCommon::instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  }
57
 
69
 
70
  wp_register_style( 'joinchat-admin', plugins_url( "css/joinchat{$min}.css", __FILE__ ), array( 'wp-color-picker' ), $this->version, 'all' );
71
 
72
+ if ( $this->common->intltel ) {
73
+ wp_register_style( 'intl-tel-input', plugins_url( "css/intlTelInput{$min}.css", __FILE__ ), array(), $this->common->intltel, 'all' );
74
  }
75
 
76
  }
88
  $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
89
  $deps = array( 'jquery', 'wp-color-picker' );
90
 
91
+ if ( $this->common->intltel ) {
92
  $deps[] = 'intl-tel-input';
93
  $localize = array(
94
  'placeholder' => __( 'e.g.', 'creame-whatsapp-me' ),
95
+ 'version' => $this->common->intltel,
96
  'utils_js' => plugins_url( 'js/utils.js', __FILE__ ),
97
  );
98
 
99
+ wp_register_script( 'intl-tel-input', plugins_url( "js/intlTelInput{$min}.js", __FILE__ ), array(), $this->common->intltel, true );
100
  wp_localize_script( 'intl-tel-input', 'intlTelConf', $localize );
101
  }
102
 
105
 
106
  }
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  /**
109
  * Show admin notices
110
  *
120
 
121
  $current_screen = get_current_screen();
122
 
123
+ // If no phone number defined.
124
+ if ( empty( $this->common->settings['telephone'] )
125
  && current_user_can( JoinChatUtil::capability() )
126
  && ( $current_screen && false === strpos( $current_screen->id, '_joinchat' ) )
127
  && time() >= (int) get_option( 'joinchat_notice_dismiss' )
129
 
130
  printf(
131
  '<div class="notice notice-info is-dismissible" id="joinchat-empty-phone"><p><strong>Join.chat</strong>&nbsp;&nbsp;%s %s</p></div>',
132
+ esc_html__( 'You only need to add your WhatsApp number to contact with your users.', 'creame-whatsapp-me' ),
133
+ sprintf( '<a href="%s"><strong>%s</strong></a>', esc_url( JoinChatUtil::admin_url() ), esc_html__( 'Go to settings', 'creame-whatsapp-me' ) )
134
  );
135
 
136
  printf(
137
  '<script>jQuery("#joinchat-empty-phone").on("click", ".notice-dismiss", function () {' .
138
  'jQuery.post(ajaxurl, { action: "joinchat_notice_dismiss", nonce: "%s"}, null, "json");' .
139
  '});</script>',
140
+ esc_js( wp_create_nonce( 'joinchat_nonce' ) )
141
  );
142
  }
143
 
158
 
159
  }
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  /**
162
  * Add link to options page on plugins page
163
  *
196
  */
197
  public function plugin_links( $plugin_meta, $plugin_file ) {
198
 
199
+ if ( 'creame-whatsapp-me/joinchat.php' === $plugin_file ) {
200
  $utm = '?utm_source=plugins&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
201
  $lang = false !== strpos( strtolower( get_locale() ), 'es' ) ? 'es' : 'en';
202
 
208
 
209
  }
210
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
  /**
212
  * Add Meta Box for all the public post types
213
  *
214
  * @since 1.1.0
215
+ * @since 4.5.0 Added back_compat to disable in block editor
216
  * @access public
217
  * @return void
218
  */
219
  public function add_meta_boxes() {
 
 
 
 
220
 
221
+ $post_types = $this->common->get_public_post_types();
222
+ $back_compat = apply_filters( 'joinchat_gutenberg_sidebar', true );
223
 
224
  foreach ( $post_types as $post_type ) {
225
  add_meta_box(
228
  array( $this, 'meta_box' ),
229
  $post_type,
230
  'side',
231
+ 'default',
232
+ array( '__back_compat_meta_box' => $back_compat && post_type_supports( $post_type, 'custom-fields' ) ),
233
  );
234
  }
235
  }
243
  * @since 3.0.3 Capture and filter output
244
  * @since 3.2.0 Added filter 'joinchat_metabox_placeholders'
245
  * @access public
246
+ * @param WP_Post $post Current post object.
247
  * @return void
248
  */
249
  public function meta_box( $post ) {
250
 
251
+ // Enqueue assets.
252
  wp_enqueue_script( 'joinchat-admin' );
253
  wp_enqueue_style( 'joinchat-admin' );
254
 
255
+ if ( $this->common->intltel ) {
256
  wp_enqueue_style( 'intl-tel-input' );
257
  }
258
 
259
+ $metadata = get_post_meta( $post->ID, '_joinchat', true ) ?: array(); //phpcs:ignore WordPress.PHP.DisallowShortTernary
260
  $metadata = array_merge(
261
  array(
262
  'telephone' => '',
267
  $metadata
268
  );
269
 
270
+ $placeholders = $this->common->get_obj_placeholders( $post );
271
+ $metabox_vars = $this->common->get_obj_vars( $post );
 
 
 
 
 
 
 
 
 
 
272
 
273
  ob_start();
274
  include __DIR__ . '/partials/post_meta_box.php';
275
  $metabox_output = ob_get_clean();
276
 
277
+ echo apply_filters( 'joinchat_metabox_output', $metabox_output, $post, $metadata ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
278
  }
279
 
280
  /**
282
  *
283
  * @since 4.3.0
284
  * @access public
285
+ * @param int $id post|term ID.
286
+ * @param WP_Post|int $arg current post or term taxonomi id.
287
  * @return void
288
  */
289
  public function save_meta( $id, $arg ) {
300
 
301
  JoinChatUtil::maybe_encode_emoji();
302
 
303
+ // Clean and delete empty/false fields.
304
  $metadata = array_filter(
305
  JoinChatUtil::clean_input(
306
  array(
344
  *
345
  * @since 4.3.0
346
  * @access public
347
+ * @param WP_Term $term Current taxonomy term object.
348
+ * @param string $taxonomy Current taxonomy slug.
349
  * @return void
350
  */
351
  public function term_meta_box( $term, $taxonomy ) {
352
 
353
+ // Enqueue assets.
354
  wp_enqueue_script( 'joinchat-admin' );
355
  wp_enqueue_style( 'joinchat-admin' );
356
 
357
+ if ( $this->common->intltel ) {
358
  wp_enqueue_style( 'intl-tel-input' );
359
  }
360
 
361
+ $metadata = get_term_meta( $term->term_id, '_joinchat', true ) ?: array(); //phpcs:ignore WordPress.PHP.DisallowShortTernary
362
  $metadata = array_merge(
363
  array(
364
  'telephone' => '',
369
  $metadata
370
  );
371
 
372
+ $placeholders = $this->common->get_obj_placeholders( $term );
373
+ $metabox_vars = $this->common->get_obj_vars( $term );
 
 
 
 
 
 
 
 
 
 
374
 
375
  ob_start();
376
  include __DIR__ . '/partials/term_meta_box.php';
377
  $metabox_output = ob_get_clean();
378
 
379
+ echo apply_filters( 'joinchat_term_metabox_output', $metabox_output, $term, $metadata, $taxonomy ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
 
381
  }
382
 
385
  *
386
  * @since 4.0.5
387
  * @access public
 
 
388
  * @return void
389
  */
390
  public static function clear_cache() {
391
 
392
+ // TODO: Prevent Autoptimize clear many times.
393
 
394
  /**
395
  * List of callable functions or actions by third party plugins.
398
  $cache_plugins = apply_filters(
399
  'joinchat_cache_plugins',
400
  array(
401
+ 'autoptimizeCache::clearall_actionless', // Autoptimize https://wordpress.org/plugins/autoptimize/.
402
+ 'ce_clear_cache', // Cache Enabler https://wordpress.org/plugins/cache-enabler/.
403
+ 'cachify_flush_cache', // Cachify https://wordpress.org/plugins/cachify/.
404
+ 'LiteSpeed_Cache_API::purge_all', // LiteSpeed Cache https://wordpress.org/plugins/litespeed-cache/.
405
+ 'sg_cachepress_purge_cache', // SG Optimizer https://es.wordpress.org/plugins/sg-cachepress/.
406
+ array( 'wpfc_clear_all_cache', true ), // WP Fastest Cache https://es.wordpress.org/plugins/wp-fastest-cache/.
407
+ 'rocket_clean_minify', // WP Rocket https://wp-rocket.me.
408
  'rocket_clean_domain',
409
+ 'wp_cache_clear_cache', // WP Super Cache https://wordpress.org/plugins/wp-super-cache/.
410
+ 'w3tc_flush_all', // W3 Total Cache https://wordpress.org/plugins/w3-total-cache/.
411
  )
412
  );
413
 
422
  }
423
 
424
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
  }
admin/class-joinchat-woo-admin.php CHANGED
@@ -37,7 +37,7 @@ class JoinChatWooAdmin {
37
  $loader->add_filter( 'joinchat_metabox_vars', $this, 'metabox_vars', 10, 2 );
38
  $loader->add_filter( 'joinchat_metabox_placeholders', $this, 'metabox_placeholders', 10, 3 );
39
 
40
- if ( defined( 'PWB_PLUGIN_FILE' ) ) { // Perfect Brands for WooCommerce
41
  $loader->add_filter( 'joinchat_term_metabox_output', $this, 'term_metabox_fix', 10, 4 );
42
  }
43
 
@@ -75,7 +75,7 @@ class JoinChatWooAdmin {
75
  $input['message_text_product'] = JoinChatUtil::clean_input( $input['message_text_product'] );
76
  $input['message_text_on_sale'] = JoinChatUtil::clean_input( $input['message_text_on_sale'] );
77
  $input['message_send_product'] = JoinChatUtil::clean_input( $input['message_send_product'] );
78
- $input['btn_position'] = array_key_exists( $input['btn_position'], $this->btn_positions() ) ? $input['btn_position'] : 'none';
79
  $input['woo_btn_text'] = JoinChatUtil::clean_input( $input['woo_btn_text'] );
80
 
81
  return $input;
@@ -116,7 +116,7 @@ class JoinChatWooAdmin {
116
  * Remove WooCommerce product custom post type
117
  *
118
  * @since 3.0.0
119
- * @param array $custom_post_types list of post types
120
  * @return array
121
  */
122
  public function custom_post_types( $custom_post_types ) {
@@ -129,7 +129,7 @@ class JoinChatWooAdmin {
129
  * Add WooCommerce product taxonomies for metabox
130
  *
131
  * @since 4.3.0
132
- * @param array $taxonomies list of taxonomies
133
  * @return array
134
  */
135
  public function custom_taxonomies( $taxonomies ) {
@@ -203,7 +203,7 @@ class JoinChatWooAdmin {
203
  );
204
 
205
  foreach ( $woo_sections as $key => $label ) {
206
- $woo_sections[ $key ] = "<label for=\"joinchat_$key\">$label</label>" . JoinChatAdmin::vars_help( $key );
207
  }
208
 
209
  $sections['chat'] = $woo_sections;
@@ -219,8 +219,8 @@ class JoinChatWooAdmin {
219
  * Woocommerce variables for messages and CTAs
220
  *
221
  * @since 3.0.0
222
- * @param array $sections current tab sections and fields.
223
- * @param string $field field name.
224
  * @return array
225
  */
226
  public function vars_help( $vars, $field ) {
@@ -326,9 +326,9 @@ class JoinChatWooAdmin {
326
  */
327
  public function visibility_inheritance( $inheritance ) {
328
 
329
- // 'woocommerce' inherit from 'all' (Global)
330
  $inheritance['all'][] = 'woocommerce';
331
- // WooCommerce pages inherit from 'woocommerce'
332
  $inheritance['woocommerce'] = array( 'product', 'cart', 'checkout', 'thankyou', 'account_page' );
333
 
334
  return $inheritance;
@@ -348,12 +348,12 @@ class JoinChatWooAdmin {
348
  '<p>' .
349
  '<span><code>{PRODUCT}</code> ➜ ' . __( 'Product Name', 'creame-whatsapp-me' ) . '</span><br> ' .
350
  '<span><code>{SKU}</code> ➜ ABC98798</span><br> ' .
351
- '<span><code>{PRICE}</code> ➜ ' . strip_tags( wc_price( 7.95 ) ) . '</span> ' .
352
  '</p>' .
353
  '<p> ' . __( 'For the <strong>Call to Action for Products on Sale</strong>, you can also use:', 'creame-whatsapp-me' ) . '</p>' .
354
  '<p>' .
355
- '<span><code>{REGULAR}</code> ➜ ' . strip_tags( wc_price( 9.95 ) ) . '</span><br> ' .
356
- '<span><code>{PRICE}</code> ➜ ' . strip_tags( wc_price( 7.95 ) ) . '</span><br> ' .
357
  '<span><code>{DISCOUNT}</code> ➜ -20%</span>' .
358
  '</p>';
359
 
@@ -371,7 +371,7 @@ class JoinChatWooAdmin {
371
  */
372
  public function metabox_vars( $vars, $obj ) {
373
 
374
- if ( $obj instanceof WP_Post && 'product' == $obj->post_type ) {
375
  $product = wc_get_product( $obj->ID );
376
  $woo_vars = array( 'PRODUCT', 'SKU', 'PRICE' );
377
 
@@ -390,22 +390,24 @@ class JoinChatWooAdmin {
390
  * Add Product metabox placeholders info.
391
  *
392
  * @since 3.2.0
393
- * @param array $placeholders current placeholders.
394
- * @param WP_Post|WP_Term $obj current post|term.
395
- * @param array $settings current settings.
396
  * @return array
397
  */
398
  public function metabox_placeholders( $placeholders, $obj, $settings ) {
399
 
400
- if ( $obj instanceof WP_Post && 'product' == $obj->post_type ) {
401
  $product = wc_get_product( $obj->ID );
402
 
403
- $placeholders['message_send'] = $settings['message_send_product'] ?: $settings['message_send'];
 
 
404
 
405
  if ( $product->is_on_sale() && $settings['message_text_on_sale'] ) {
406
  $placeholders['message_text'] = $settings['message_text_on_sale'];
407
- } else {
408
- $placeholders['message_text'] = $settings['message_text_product'] ?: $settings['message_text'];
409
  }
410
  }
411
 
@@ -416,10 +418,10 @@ class JoinChatWooAdmin {
416
  * Fix term meteabox for Brands
417
  *
418
  * @since 4.4.2
419
- * @param string $metabox_output
420
- * @param WP_Term $term Current taxonomy term object
421
- * @param array $metadata
422
- * @param string $taxonomy Current taxonomy slug
423
  * @return string
424
  */
425
  public function term_metabox_fix( $metabox_output, $term, $metadata, $taxonomy ) {
37
  $loader->add_filter( 'joinchat_metabox_vars', $this, 'metabox_vars', 10, 2 );
38
  $loader->add_filter( 'joinchat_metabox_placeholders', $this, 'metabox_placeholders', 10, 3 );
39
 
40
+ if ( defined( 'PWB_PLUGIN_FILE' ) ) { // Perfect Brands for WooCommerce.
41
  $loader->add_filter( 'joinchat_term_metabox_output', $this, 'term_metabox_fix', 10, 4 );
42
  }
43
 
75
  $input['message_text_product'] = JoinChatUtil::clean_input( $input['message_text_product'] );
76
  $input['message_text_on_sale'] = JoinChatUtil::clean_input( $input['message_text_on_sale'] );
77
  $input['message_send_product'] = JoinChatUtil::clean_input( $input['message_send_product'] );
78
+ $input['woo_btn_position'] = array_key_exists( $input['woo_btn_position'], $this->btn_positions() ) ? $input['woo_btn_position'] : 'none';
79
  $input['woo_btn_text'] = JoinChatUtil::clean_input( $input['woo_btn_text'] );
80
 
81
  return $input;
116
  * Remove WooCommerce product custom post type
117
  *
118
  * @since 3.0.0
119
+ * @param array $custom_post_types list of post types.
120
  * @return array
121
  */
122
  public function custom_post_types( $custom_post_types ) {
129
  * Add WooCommerce product taxonomies for metabox
130
  *
131
  * @since 4.3.0
132
+ * @param array $taxonomies list of taxonomies.
133
  * @return array
134
  */
135
  public function custom_taxonomies( $taxonomies ) {
203
  );
204
 
205
  foreach ( $woo_sections as $key => $label ) {
206
+ $woo_sections[ $key ] = "<label for=\"joinchat_$key\">$label</label>" . JoinChatAdminPage::vars_help( $key );
207
  }
208
 
209
  $sections['chat'] = $woo_sections;
219
  * Woocommerce variables for messages and CTAs
220
  *
221
  * @since 3.0.0
222
+ * @param array $vars current dynamic variables.
223
+ * @param string $field field name.
224
  * @return array
225
  */
226
  public function vars_help( $vars, $field ) {
326
  */
327
  public function visibility_inheritance( $inheritance ) {
328
 
329
+ // 'woocommerce' inherit from 'all' (Global).
330
  $inheritance['all'][] = 'woocommerce';
331
+ // WooCommerce pages inherit from 'woocommerce'.
332
  $inheritance['woocommerce'] = array( 'product', 'cart', 'checkout', 'thankyou', 'account_page' );
333
 
334
  return $inheritance;
348
  '<p>' .
349
  '<span><code>{PRODUCT}</code> ➜ ' . __( 'Product Name', 'creame-whatsapp-me' ) . '</span><br> ' .
350
  '<span><code>{SKU}</code> ➜ ABC98798</span><br> ' .
351
+ '<span><code>{PRICE}</code> ➜ ' . wp_strip_all_tags( wc_price( 7.95 ) ) . '</span> ' .
352
  '</p>' .
353
  '<p> ' . __( 'For the <strong>Call to Action for Products on Sale</strong>, you can also use:', 'creame-whatsapp-me' ) . '</p>' .
354
  '<p>' .
355
+ '<span><code>{REGULAR}</code> ➜ ' . wp_strip_all_tags( wc_price( 9.95 ) ) . '</span><br> ' .
356
+ '<span><code>{PRICE}</code> ➜ ' . wp_strip_all_tags( wc_price( 7.95 ) ) . '</span><br> ' .
357
  '<span><code>{DISCOUNT}</code> ➜ -20%</span>' .
358
  '</p>';
359
 
371
  */
372
  public function metabox_vars( $vars, $obj ) {
373
 
374
+ if ( $obj instanceof WP_Post && 'product' === $obj->post_type ) {
375
  $product = wc_get_product( $obj->ID );
376
  $woo_vars = array( 'PRODUCT', 'SKU', 'PRICE' );
377
 
390
  * Add Product metabox placeholders info.
391
  *
392
  * @since 3.2.0
393
+ * @param array $placeholders current placeholders.
394
+ * @param WP_Post|WP_Term $obj current post|term.
395
+ * @param array $settings current settings.
396
  * @return array
397
  */
398
  public function metabox_placeholders( $placeholders, $obj, $settings ) {
399
 
400
+ if ( $obj instanceof WP_Post && 'product' === $obj->post_type ) {
401
  $product = wc_get_product( $obj->ID );
402
 
403
+ if ( $settings['message_send_product'] ) {
404
+ $placeholders['message_send'] = $settings['message_send_product'];
405
+ }
406
 
407
  if ( $product->is_on_sale() && $settings['message_text_on_sale'] ) {
408
  $placeholders['message_text'] = $settings['message_text_on_sale'];
409
+ } elseif ( $settings['message_text_product'] ) {
410
+ $placeholders['message_text'] = $settings['message_text_product'];
411
  }
412
  }
413
 
418
  * Fix term meteabox for Brands
419
  *
420
  * @since 4.4.2
421
+ * @param string $metabox_output metabox html.
422
+ * @param WP_Term $term Current taxonomy term object.
423
+ * @param array $metadata Jonchat term_meta.
424
+ * @param string $taxonomy Current taxonomy slug.
425
  * @return string
426
  */
427
  public function term_metabox_fix( $metabox_output, $term, $metadata, $taxonomy ) {
admin/css/joinchat.css CHANGED
@@ -79,10 +79,6 @@
79
  font-size: 13px;
80
  }
81
 
82
- .iti--allow-dropdown input {
83
- padding-left: 52px !important;
84
- }
85
-
86
  #joinchat_button_image_wrapper {
87
  position: relative;
88
  padding: 8px 0 0 80px;
@@ -149,6 +145,10 @@ tr.joinchat--focus .joinchat_vars_help {
149
  .joinchat_vars_help br {
150
  display: none;
151
  }
 
 
 
 
152
  }
153
 
154
  #joinchat_form .iris-picker {
@@ -159,6 +159,32 @@ tr.joinchat--focus .joinchat_vars_help {
159
  max-width: 800px;
160
  }
161
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  /* Help */
163
 
164
  .toplevel_page_joinchat .help-tab-content li ul,
@@ -184,7 +210,7 @@ tr.joinchat--focus .joinchat_vars_help {
184
  .joinchat-metabox .iti,
185
  .joinchat-metabox .iti input,
186
  .joinchat-metabox textarea {
187
- max-width: 100%;
188
  }
189
 
190
  .joinchat-metabox code {
79
  font-size: 13px;
80
  }
81
 
 
 
 
 
82
  #joinchat_button_image_wrapper {
83
  position: relative;
84
  padding: 8px 0 0 80px;
145
  .joinchat_vars_help br {
146
  display: none;
147
  }
148
+
149
+ .iti {
150
+ width: 18em;
151
+ }
152
  }
153
 
154
  #joinchat_form .iris-picker {
159
  max-width: 800px;
160
  }
161
 
162
+ .joinchat-gads {
163
+ display: inline-block;
164
+ padding: 0 0 0 8px;
165
+ margin: 0 1px;
166
+ border: 1px solid #8c8f94;
167
+ border-radius: 4px;
168
+ background-color: #fff;
169
+ color: #2c3338;
170
+ line-height: 2;
171
+ box-shadow: 0 0 0 transparent;
172
+ cursor: text;
173
+ }
174
+
175
+ .joinchat-gads:focus-within {
176
+ border-color: #2271b1;
177
+ box-shadow: 0 0 0 1px #2271b1;
178
+ outline: 2px solid transparent;
179
+ }
180
+
181
+ .joinchat-gads input {
182
+ display: inline-block !important;
183
+ padding: 0 6px;
184
+ border: none;
185
+ background: transparent;
186
+ }
187
+
188
  /* Help */
189
 
190
  .toplevel_page_joinchat .help-tab-content li ul,
210
  .joinchat-metabox .iti,
211
  .joinchat-metabox .iti input,
212
  .joinchat-metabox textarea {
213
+ max-width: 99%;
214
  }
215
 
216
  .joinchat-metabox code {
admin/css/joinchat.min.css CHANGED
@@ -1 +1 @@
1
- .joinchat-hidden{display:none !important}.js #joinchat_form textarea{overflow:hidden;min-height:100px}.joinchat-tab{display:none}.joinchat-tab-active{display:block !important}#joinchat_tab_visibility tr:hover{background:rgba(0,0,0,.05)}#joinchat_tab_visibility th,#joinchat_tab_visibility td{padding:7px 15px}#joinchat_tab_visibility label{margin-right:15px}#joinchat_tab_visibility .dashicons{opacity:.5}#joinchat_tab_visibility input[type=radio]+span{transition:all 200ms}#joinchat_tab_visibility input[type=radio]:checked+span{color:#79ba49;opacity:1}#joinchat_tab_visibility input[type=radio]:checked+.dashicons-hidden{color:#ca4a1f}.joinchat-show-help{display:inline-block;width:1.1em;height:1.1em;line-height:1.1em;border-radius:50%;background:#999;color:#fff;font-weight:bold;text-decoration:none;text-align:center}.joinchat-show-help:hover,.joinchat-show-help:active,.joinchat-show-help:focus{background:#444;color:#fff}#tab-panel-styles-and-vars span{white-space:nowrap}.form-table td p.joinchat-addon{display:inline-block;padding:0 6px;border-radius:3px;background:#fffbe5;font-size:13px}.iti--allow-dropdown input{padding-left:52px !important}#joinchat_button_image_wrapper{position:relative;padding:8px 0 0 80px}#joinchat_button_image_holder{position:absolute;top:0;left:0;box-sizing:border-box;width:60px;height:60px;border:1px solid #25d366;border-radius:50%;background:#25d366 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="36" height="36"><path fill="%23fff" d="M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 01-13.754 2.299l-5.814.735a.392.392 0 01-.438-.44l.748-5.788A12.002 12.002 0 013.517 3.517zm3.61 17.043l.3.158a9.846 9.846 0 0011.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 00-1.747 11.554l.16.303-.51 3.942a.196.196 0 00.219.22l3.961-.501zm6.534-7.003l-.933 1.164a9.843 9.843 0 01-3.497-3.495l1.166-.933a.792.792 0 00.23-.94L9.561 6.96a.793.793 0 00-.924-.445 1291.6 1291.6 0 00-2.023.524.797.797 0 00-.588.88 11.754 11.754 0 0010.005 10.005.797.797 0 00.88-.587l.525-2.023a.793.793 0 00-.445-.923L14.6 13.327a.792.792 0 00-.94.23z"/></svg>') no-repeat center;box-shadow:1px 6px 24px 0 rgba(7,94,84,.24);overflow:hidden}[dir=rtl] #joinchat_button_image_wrapper{padding:8px 80px 0 0}[dir=rtl] #joinchat_button_image_holder{right:0;left:auto}.joinchat_vars_help{margin-top:5px;font-size:11px;font-weight:normal;line-height:1.9;opacity:0;transition:opacity .2s ease-out .2s}tr:hover .joinchat_vars_help,tr.joinchat--focus .joinchat_vars_help{opacity:1;transition-delay:.5s}.joinchat_vars_help code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;padding:2px 1px;font-size:inherit;vertical-align:bottom}.joinchat_vars_help code:hover{background:rgba(0,0,0,0.2)}@media screen and (max-width:782px){.joinchat_vars_help{margin-top:2px;opacity:1}.joinchat_vars_help br{display:none}}#joinchat_form .iris-picker{visibility:visible}#wp-joinchat_optin_text-editor-container{max-width:800px}.toplevel_page_joinchat .help-tab-content li ul,.settings_page_joinchat .help-tab-content li ul{margin-top:6px}.toplevel_page_joinchat .help-tab-content li li,.settings_page_joinchat .help-tab-content li li{list-style-type:circle}.toplevel_page_joinchat .help-tab-content code,.settings_page_joinchat .help-tab-content code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all}.joinchat-metabox .iti,.joinchat-metabox .iti input,.joinchat-metabox textarea{max-width:100%}.joinchat-metabox code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;padding:2px 1px;font-size:smaller;vertical-align:baseline}.joinchat-metabox .dashicons{opacity:.5}.joinchat-metabox input::placeholder{color:#dedfe0}.joinchat-metabox input::-ms-input-placeholder{color:#dedfe0}.joinchat-metabox input[type=radio]{margin-right:1px}.joinchat-metabox input[type=radio]+span{margin-right:5px;transition:all 200ms}.joinchat-metabox input[type=radio]:checked+span{color:#79ba49;opacity:1}.joinchat-metabox input[type=radio]:checked+.dashicons-hidden{color:#ca4a1f}.js .joinchat-metabox textarea{overflow:hidden;min-height:3em}.form-field.joinchat-metabox input[type=radio]{margin-right:4px}.form-field.joinchat-metabox input[type=radio]+span{margin-right:15px}
1
+ .joinchat-hidden{display:none !important}.js #joinchat_form textarea{overflow:hidden;min-height:100px}.joinchat-tab{display:none}.joinchat-tab-active{display:block !important}#joinchat_tab_visibility tr:hover{background:rgba(0,0,0,.05)}#joinchat_tab_visibility th,#joinchat_tab_visibility td{padding:7px 15px}#joinchat_tab_visibility label{margin-right:15px}#joinchat_tab_visibility .dashicons{opacity:.5}#joinchat_tab_visibility input[type=radio]+span{transition:all 200ms}#joinchat_tab_visibility input[type=radio]:checked+span{color:#79ba49;opacity:1}#joinchat_tab_visibility input[type=radio]:checked+.dashicons-hidden{color:#ca4a1f}.joinchat-show-help{display:inline-block;width:1.1em;height:1.1em;line-height:1.1em;border-radius:50%;background:#999;color:#fff;font-weight:bold;text-decoration:none;text-align:center}.joinchat-show-help:hover,.joinchat-show-help:active,.joinchat-show-help:focus{background:#444;color:#fff}#tab-panel-styles-and-vars span{white-space:nowrap}.form-table td p.joinchat-addon{display:inline-block;padding:0 6px;border-radius:3px;background:#fffbe5;font-size:13px}#joinchat_button_image_wrapper{position:relative;padding:8px 0 0 80px}#joinchat_button_image_holder{position:absolute;top:0;left:0;box-sizing:border-box;width:60px;height:60px;border:1px solid #25d366;border-radius:50%;background:#25d366 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="36" height="36"><path fill="%23fff" d="M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 01-13.754 2.299l-5.814.735a.392.392 0 01-.438-.44l.748-5.788A12.002 12.002 0 013.517 3.517zm3.61 17.043l.3.158a9.846 9.846 0 0011.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 00-1.747 11.554l.16.303-.51 3.942a.196.196 0 00.219.22l3.961-.501zm6.534-7.003l-.933 1.164a9.843 9.843 0 01-3.497-3.495l1.166-.933a.792.792 0 00.23-.94L9.561 6.96a.793.793 0 00-.924-.445 1291.6 1291.6 0 00-2.023.524.797.797 0 00-.588.88 11.754 11.754 0 0010.005 10.005.797.797 0 00.88-.587l.525-2.023a.793.793 0 00-.445-.923L14.6 13.327a.792.792 0 00-.94.23z"/></svg>') no-repeat center;box-shadow:1px 6px 24px 0 rgba(7,94,84,.24);overflow:hidden}[dir=rtl] #joinchat_button_image_wrapper{padding:8px 80px 0 0}[dir=rtl] #joinchat_button_image_holder{right:0;left:auto}.joinchat_vars_help{margin-top:5px;font-size:11px;font-weight:normal;line-height:1.9;opacity:0;transition:opacity .2s ease-out .2s}tr:hover .joinchat_vars_help,tr.joinchat--focus .joinchat_vars_help{opacity:1;transition-delay:.5s}.joinchat_vars_help code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;padding:2px 1px;font-size:inherit;vertical-align:bottom}.joinchat_vars_help code:hover{background:rgba(0,0,0,0.2)}@media screen and (max-width:782px){.joinchat_vars_help{margin-top:2px;opacity:1}.joinchat_vars_help br{display:none}.iti{width:18em}}#joinchat_form .iris-picker{visibility:visible}#wp-joinchat_optin_text-editor-container{max-width:800px}.joinchat-gads{display:inline-block;padding:0 0 0 8px;margin:0 1px;border:1px solid #8c8f94;border-radius:4px;background-color:#fff;color:#2c3338;line-height:2;box-shadow:0 0 0 transparent;cursor:text}.joinchat-gads:focus-within{border-color:#2271b1;box-shadow:0 0 0 1px #2271b1;outline:2px solid transparent}.joinchat-gads input{display:inline-block !important;padding:0 6px;border:0;background:transparent}.toplevel_page_joinchat .help-tab-content li ul,.settings_page_joinchat .help-tab-content li ul{margin-top:6px}.toplevel_page_joinchat .help-tab-content li li,.settings_page_joinchat .help-tab-content li li{list-style-type:circle}.toplevel_page_joinchat .help-tab-content code,.settings_page_joinchat .help-tab-content code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all}.joinchat-metabox .iti,.joinchat-metabox .iti input,.joinchat-metabox textarea{max-width:99%}.joinchat-metabox code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;padding:2px 1px;font-size:smaller;vertical-align:baseline}.joinchat-metabox .dashicons{opacity:.5}.joinchat-metabox input::placeholder{color:#dedfe0}.joinchat-metabox input::-ms-input-placeholder{color:#dedfe0}.joinchat-metabox input[type=radio]{margin-right:1px}.joinchat-metabox input[type=radio]+span{margin-right:5px;transition:all 200ms}.joinchat-metabox input[type=radio]:checked+span{color:#79ba49;opacity:1}.joinchat-metabox input[type=radio]:checked+.dashicons-hidden{color:#ca4a1f}.js .joinchat-metabox textarea{overflow:hidden;min-height:3em}.form-field.joinchat-metabox input[type=radio]{margin-right:4px}.form-field.joinchat-metabox input[type=radio]+span{margin-right:15px}
admin/img/qr.png ADDED
Binary file
admin/js/joinchat.js CHANGED
@@ -22,6 +22,7 @@
22
 
23
  var iti = intlTelInput($phone.get(0), {
24
  hiddenInput: $phone.data('name') || 'joinchat[telephone]',
 
25
  initialCountry: 'auto',
26
  preferredCountries: [country_code || ''],
27
  geoIpLookup: function (callback) {
@@ -207,15 +208,6 @@
207
  $('#joinchat_woo_btn_position').on('change', function () {
208
  $('#joinchat_woo_btn_text').closest('tr').toggleClass('joinchat-hidden', $(this).val() == 'none');
209
  }).trigger('change');
210
-
211
- // Google Ads format validate
212
- $('#joinchat_gads').on('focus', function () {
213
- if ('' == $(this).val()) $(this).val('AW-_________/____________________');
214
- }).on('input focus', function () {
215
- $(this).css('color', !/^AW-\d{9}\/\w{19,22}$/.test($(this).val().trim()) ? '#ca4a1f' : '');
216
- }).on('blur', function () {
217
- if ('AW-_________/____________________' == $(this).val()) $(this).val('');
218
- });
219
  }
220
 
221
  if ($('.joinchat-metabox').length) {
22
 
23
  var iti = intlTelInput($phone.get(0), {
24
  hiddenInput: $phone.data('name') || 'joinchat[telephone]',
25
+ separateDialCode: true,
26
  initialCountry: 'auto',
27
  preferredCountries: [country_code || ''],
28
  geoIpLookup: function (callback) {
208
  $('#joinchat_woo_btn_position').on('change', function () {
209
  $('#joinchat_woo_btn_text').closest('tr').toggleClass('joinchat-hidden', $(this).val() == 'none');
210
  }).trigger('change');
 
 
 
 
 
 
 
 
 
211
  }
212
 
213
  if ($('.joinchat-metabox').length) {
admin/js/joinchat.min.js CHANGED
@@ -1 +1 @@
1
- !function(h){"use strict";function r(){h(this).height(0).height(this.scrollHeight)}window.intl_tel_input_version=window.intlTelConf&&intlTelConf.version,h(function(){var n,t,i,e,a,o,c,l;function s(t,e){var n;t=t||"all",e=e||h('input[name="joinchat[view]['+t+']"]:checked').val(),h(".view_inheritance_"+t).toggleClass("dashicons-visibility","yes"==e).toggleClass("dashicons-hidden","no"==e),"cpts"==t?h("[class*=view_inheritance_cpt_]").toggleClass("dashicons-visibility","yes"==e).toggleClass("dashicons-hidden","no"==e):t in l&&(n=""===(n=h('input[name="joinchat[view]['+t+']"]:checked').val())?e:n,h.each(l[t],function(){s(this,n)}))}"function"==typeof intlTelInput&&h("#joinchat_phone").length&&(t=JSON.parse(localStorage.joinchat_country_code||"{}"),i=!(!t.code||t.date!=(new Date).toDateString())&&t.code,e=h("#joinchat_phone"),a=""===e.val()?e.attr("placeholder"):null,e.removeAttr("placeholder"),(o=intlTelInput(e.get(0),{hiddenInput:e.data("name")||"joinchat[telephone]",initialCountry:"auto",preferredCountries:[i||""],geoIpLookup:function(e){i?e(i):h.getJSON("https://ipinfo.io").always(function(t){t=t&&t.country?t.country:"";localStorage.joinchat_country_code=JSON.stringify({code:t,date:(new Date).toDateString()}),e(t)})},customPlaceholder:function(t){return intlTelConf.placeholder+" "+t},utilsScript:intlTelConf.utils_js})).hiddenInput.value=e.val(),"string"==typeof a&&""!=a&&o.promise.then(function(){o.setNumber(a),e.attr("placeholder",o.getNumber(intlTelInputUtils.numberFormat.NATIONAL)).val("")}),e.on("input countrychange",function(){var t=h(this),e=intlTelInputGlobals.getInstance(this);t.css("color",t.val().trim()&&!e.isValidNumber()?"#ca4a1f":""),e.hiddenInput.value=e.getNumber()}).on("blur",function(){var t=intlTelInputGlobals.getInstance(this);t.setNumber(t.getNumber())})),1===h("#joinchat_form").length&&(h(".nav-tab").on("click",function(t){t.preventDefault();var e=h(this),n=e.attr("href"),i=h("input[name=_wp_http_referer]"),t=i.val();i.val(t.substr(0,t.indexOf("page=joinchat"))+"page=joinchat&tab="+n.substr(14)),h(".nav-tab").removeClass("nav-tab-active").attr("aria-selected","false"),e.addClass("nav-tab-active").attr("aria-selected","true").get(0).blur(),h(".joinchat-tab").removeClass("joinchat-tab-active"),h(n).addClass("joinchat-tab-active").find("textarea").each(r)}),h("#joinchat_mobile_only").on("change",function(){h("#joinchat_whatsapp_web, #joinchat_qr").closest("tr").toggleClass("joinchat-hidden",this.checked)}).trigger("change"),h("#joinchat_message_delay").on("change input",function(){h("#joinchat_message_badge, #joinchat_message_views").closest("tr").toggleClass("joinchat-hidden","0"==this.value)}).trigger("change"),h(".joinchat-show-help").on("click",function(t){t.preventDefault();t=h(this).attr("href");h("#contextual-help-wrap").is(":visible")?h("html, body").animate({scrollTop:0}):h("#contextual-help-link").trigger("click"),h("#"!=t?t:"#tab-link-styles-and-vars").find("a").trigger("click")}),h("textarea","#joinchat_form").on("focus",function(){h(this).closest("tr").addClass("joinchat--focus")}).on("blur",function(){h(this).closest("tr").removeClass("joinchat--focus")}).on("input",r).each(r),h("#joinchat_form").find(".autofill").on("change",function(){this.title=""==this.value?joinchat_admin.example:""}).on("dblclick",function(){""==this.value&&(this.value=this.placeholder,this.title="")}).trigger("change"),c=h("#joinchat_tab_visibility"),l=h(".joinchat_view_all").data("inheritance")||{all:["front_page","blog_page","404_page","search","archive","singular","cpts"],archive:["date","author"],singular:["page","post"]},h("input",c).on("change",function(){s()}),h(".joinchat_view_reset").on("click",function(t){t.preventDefault(),h('input[value=""]',c).prop("checked",!0),h(".joinchat_view_all input",c).first().prop("checked",!0),s()}),s(),h("#joinchat_button_image_add").on("click",function(t){t.preventDefault(),n||((n=wp.media({title:h(this).data("title")||"Select button image",button:{text:h(this).data("button")||"Use Image"},library:{type:"image"},multiple:!1})).on("select",function(){var t=n.state().get("selection").first().toJSON(),e=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url||t.url;h("#joinchat_button_image_holder").css({"background-size":"cover","background-image":"url("+e+")"}),h("#joinchat_button_image").val(t.id),h("#joinchat_button_image_remove").removeClass("joinchat-hidden")}),n.on("open",function(){var t=wp.media.attachment(h("#joinchat_button_image").val());n.state().get("selection").add(t?[t]:[])})),n.open()}),h("#joinchat_button_image_remove").on("click",function(t){t.preventDefault(),h("#joinchat_button_image_holder").removeAttr("style"),h("#joinchat_button_image").val(""),h(this).addClass("joinchat-hidden")}),h("#joinchat_color").wpColorPicker(),h("#joinchat_header_custom").on("click",function(){h(this).prev().find("input").prop("checked",!0)}),h("#joinchat_woo_btn_position").on("change",function(){h("#joinchat_woo_btn_text").closest("tr").toggleClass("joinchat-hidden","none"==h(this).val())}).trigger("change"),h("#joinchat_gads").on("focus",function(){""==h(this).val()&&h(this).val("AW-_________/____________________")}).on("input focus",function(){h(this).css("color",/^AW-\d{9}\/\w{19,22}$/.test(h(this).val().trim())?"":"#ca4a1f")}).on("blur",function(){"AW-_________/____________________"==h(this).val()&&h(this).val("")})),h(".joinchat-metabox").length&&h(".joinchat-metabox textarea").on("focus input",r).each(r)})}(jQuery);
1
+ !function(h){"use strict";function r(){h(this).height(0).height(this.scrollHeight)}window.intl_tel_input_version=window.intlTelConf&&intlTelConf.version,h(function(){var n,t,i,e,a,o,c,l;function s(t,e){var n;t=t||"all",e=e||h('input[name="joinchat[view]['+t+']"]:checked').val(),h(".view_inheritance_"+t).toggleClass("dashicons-visibility","yes"==e).toggleClass("dashicons-hidden","no"==e),"cpts"==t?h("[class*=view_inheritance_cpt_]").toggleClass("dashicons-visibility","yes"==e).toggleClass("dashicons-hidden","no"==e):t in l&&(n=""===(n=h('input[name="joinchat[view]['+t+']"]:checked').val())?e:n,h.each(l[t],function(){s(this,n)}))}"function"==typeof intlTelInput&&h("#joinchat_phone").length&&(t=JSON.parse(localStorage.joinchat_country_code||"{}"),i=!(!t.code||t.date!=(new Date).toDateString())&&t.code,e=h("#joinchat_phone"),a=""===e.val()?e.attr("placeholder"):null,e.removeAttr("placeholder"),(o=intlTelInput(e.get(0),{hiddenInput:e.data("name")||"joinchat[telephone]",separateDialCode:!0,initialCountry:"auto",preferredCountries:[i||""],geoIpLookup:function(e){i?e(i):h.getJSON("https://ipinfo.io").always(function(t){t=t&&t.country?t.country:"";localStorage.joinchat_country_code=JSON.stringify({code:t,date:(new Date).toDateString()}),e(t)})},customPlaceholder:function(t){return intlTelConf.placeholder+" "+t},utilsScript:intlTelConf.utils_js})).hiddenInput.value=e.val(),"string"==typeof a&&""!=a&&o.promise.then(function(){o.setNumber(a),e.attr("placeholder",o.getNumber(intlTelInputUtils.numberFormat.NATIONAL)).val("")}),e.on("input countrychange",function(){var t=h(this),e=intlTelInputGlobals.getInstance(this);t.css("color",t.val().trim()&&!e.isValidNumber()?"#ca4a1f":""),e.hiddenInput.value=e.getNumber()}).on("blur",function(){var t=intlTelInputGlobals.getInstance(this);t.setNumber(t.getNumber())})),1===h("#joinchat_form").length&&(h(".nav-tab").on("click",function(t){t.preventDefault();var e=h(this),n=e.attr("href"),i=h("input[name=_wp_http_referer]"),t=i.val();i.val(t.substr(0,t.indexOf("page=joinchat"))+"page=joinchat&tab="+n.substr(14)),h(".nav-tab").removeClass("nav-tab-active").attr("aria-selected","false"),e.addClass("nav-tab-active").attr("aria-selected","true").get(0).blur(),h(".joinchat-tab").removeClass("joinchat-tab-active"),h(n).addClass("joinchat-tab-active").find("textarea").each(r)}),h("#joinchat_mobile_only").on("change",function(){h("#joinchat_whatsapp_web, #joinchat_qr").closest("tr").toggleClass("joinchat-hidden",this.checked)}).trigger("change"),h("#joinchat_message_delay").on("change input",function(){h("#joinchat_message_badge, #joinchat_message_views").closest("tr").toggleClass("joinchat-hidden","0"==this.value)}).trigger("change"),h(".joinchat-show-help").on("click",function(t){t.preventDefault();t=h(this).attr("href");h("#contextual-help-wrap").is(":visible")?h("html, body").animate({scrollTop:0}):h("#contextual-help-link").trigger("click"),h("#"!=t?t:"#tab-link-styles-and-vars").find("a").trigger("click")}),h("textarea","#joinchat_form").on("focus",function(){h(this).closest("tr").addClass("joinchat--focus")}).on("blur",function(){h(this).closest("tr").removeClass("joinchat--focus")}).on("input",r).each(r),h("#joinchat_form").find(".autofill").on("change",function(){this.title=""==this.value?joinchat_admin.example:""}).on("dblclick",function(){""==this.value&&(this.value=this.placeholder,this.title="")}).trigger("change"),c=h("#joinchat_tab_visibility"),l=h(".joinchat_view_all").data("inheritance")||{all:["front_page","blog_page","404_page","search","archive","singular","cpts"],archive:["date","author"],singular:["page","post"]},h("input",c).on("change",function(){s()}),h(".joinchat_view_reset").on("click",function(t){t.preventDefault(),h('input[value=""]',c).prop("checked",!0),h(".joinchat_view_all input",c).first().prop("checked",!0),s()}),s(),h("#joinchat_button_image_add").on("click",function(t){t.preventDefault(),n||((n=wp.media({title:h(this).data("title")||"Select button image",button:{text:h(this).data("button")||"Use Image"},library:{type:"image"},multiple:!1})).on("select",function(){var t=n.state().get("selection").first().toJSON(),e=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url||t.url;h("#joinchat_button_image_holder").css({"background-size":"cover","background-image":"url("+e+")"}),h("#joinchat_button_image").val(t.id),h("#joinchat_button_image_remove").removeClass("joinchat-hidden")}),n.on("open",function(){var t=wp.media.attachment(h("#joinchat_button_image").val());n.state().get("selection").add(t?[t]:[])})),n.open()}),h("#joinchat_button_image_remove").on("click",function(t){t.preventDefault(),h("#joinchat_button_image_holder").removeAttr("style"),h("#joinchat_button_image").val(""),h(this).addClass("joinchat-hidden")}),h("#joinchat_color").wpColorPicker(),h("#joinchat_header_custom").on("click",function(){h(this).prev().find("input").prop("checked",!0)}),h("#joinchat_woo_btn_position").on("change",function(){h("#joinchat_woo_btn_text").closest("tr").toggleClass("joinchat-hidden","none"==h(this).val())}).trigger("change")),h(".joinchat-metabox").length&&h(".joinchat-metabox textarea").on("focus input",r).each(r)})}(jQuery);
admin/partials/post_meta_box.php CHANGED
@@ -16,7 +16,7 @@ defined( 'WPINC' ) || exit;
16
  <?php wp_nonce_field( 'joinchat_data', 'joinchat_nonce' ); ?>
17
  <p>
18
  <label for="joinchat_phone"><?php _e( 'Telephone', 'creame-whatsapp-me' ); ?></label><br>
19
- <input id="joinchat_phone" <?php echo $this->enhanced_phone ? 'data-' : ''; ?>name="joinchat_telephone" value="<?php echo esc_attr( $metadata['telephone'] ); ?>" type="text" placeholder="<?php echo $placeholders['telephone']; ?>">
20
  </p>
21
  <p>
22
  <label for="joinchat_message"><?php _e( 'Call to Action', 'creame-whatsapp-me' ); ?></label><br>
16
  <?php wp_nonce_field( 'joinchat_data', 'joinchat_nonce' ); ?>
17
  <p>
18
  <label for="joinchat_phone"><?php _e( 'Telephone', 'creame-whatsapp-me' ); ?></label><br>
19
+ <input id="joinchat_phone" <?php echo $this->common->intltel ? 'data-' : ''; ?>name="joinchat_telephone" value="<?php echo esc_attr( $metadata['telephone'] ); ?>" type="text" placeholder="<?php echo $placeholders['telephone']; ?>">
20
  </p>
21
  <p>
22
  <label for="joinchat_message"><?php _e( 'Call to Action', 'creame-whatsapp-me' ); ?></label><br>
admin/partials/term_meta_box.php CHANGED
@@ -18,7 +18,7 @@ defined( 'WPINC' ) || exit;
18
  </tr>
19
  <tr class="form-field joinchat-metabox">
20
  <th scope="row"><label for="joinchat_phone"><?php _e( 'Telephone', 'creame-whatsapp-me' ); ?></label></th>
21
- <td><input id="joinchat_phone" <?php echo $this->enhanced_phone ? 'data-' : ''; ?>name="joinchat_telephone" value="<?php echo esc_attr( $metadata['telephone'] ); ?>" type="text" placeholder="<?php echo $placeholders['telephone']; ?>"></td>
22
  </tr>
23
  <tr class="form-field joinchat-metabox">
24
  <th scope="row"><label for="joinchat_message"><?php _e( 'Call to Action', 'creame-whatsapp-me' ); ?></label></th>
18
  </tr>
19
  <tr class="form-field joinchat-metabox">
20
  <th scope="row"><label for="joinchat_phone"><?php _e( 'Telephone', 'creame-whatsapp-me' ); ?></label></th>
21
+ <td><input id="joinchat_phone" <?php echo $this->common->intltel ? 'data-' : ''; ?>name="joinchat_telephone" value="<?php echo esc_attr( $metadata['telephone'] ); ?>" type="text" placeholder="<?php echo $placeholders['telephone']; ?>"></td>
22
  </tr>
23
  <tr class="form-field joinchat-metabox">
24
  <th scope="row"><label for="joinchat_message"><?php _e( 'Call to Action', 'creame-whatsapp-me' ); ?></label></th>
gutenberg/build/block_btn/block.json ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
3
+ "apiVersion": 2,
4
+ "name": "joinchat/button",
5
+ "version": "0.1.0",
6
+ "title": "Joinchat Button",
7
+ "category": "widgets",
8
+ "icon": "smiley",
9
+ "description": "WhatsApp contact button",
10
+ "keywords": [
11
+ "WhatsApp",
12
+ "QR",
13
+ "contact",
14
+ "phone"
15
+ ],
16
+ "textdomain": "creame-whatsapp-me",
17
+ "editorStyle": "file:../index.css",
18
+ "style": "file:../style-index.css",
19
+ "example": {},
20
+ "attributes": {
21
+ "cta": {
22
+ "type": "string",
23
+ "source": "html",
24
+ "selector": ".joinchat-button__link>span",
25
+ "default": "<strong>Open Chat</strong>"
26
+ },
27
+ "backgroundColor": {
28
+ "type": "string"
29
+ },
30
+ "textColor": {
31
+ "type": "string",
32
+ "default": "#ffffff"
33
+ },
34
+ "phone": {
35
+ "type": "string"
36
+ },
37
+ "message": {
38
+ "type": "string"
39
+ },
40
+ "qr_code": {
41
+ "type": "string",
42
+ "enum": [
43
+ "both",
44
+ "only",
45
+ "no"
46
+ ],
47
+ "default": "both"
48
+ },
49
+ "style": {
50
+ "type": "object",
51
+ "default": {
52
+ "color": {
53
+ "background": "#25d366"
54
+ },
55
+ "border": {
56
+ "width": "6px",
57
+ "style": "solid",
58
+ "color": "#25d366",
59
+ "radius": "30px"
60
+ }
61
+ }
62
+ }
63
+ },
64
+ "supports": {
65
+ "anchor": true,
66
+ "align": true,
67
+ "alignWide": false,
68
+ "color": {
69
+ "__experimentalSkipSerialization": true,
70
+ "gradients": true,
71
+ "background": true,
72
+ "__experimentalDefaultControls": {
73
+ "background": true,
74
+ "text": true
75
+ }
76
+ },
77
+ "reusable": true,
78
+ "spacing": {
79
+ "margin": true,
80
+ "padding": true
81
+ },
82
+ "__experimentalBorder": {
83
+ "radius": true,
84
+ "color": true,
85
+ "width": true,
86
+ "style": true,
87
+ "__experimentalDefaultControls": {
88
+ "radius": true,
89
+ "color": true
90
+ }
91
+ },
92
+ "__experimentalSelector": ".joinchat-button__link"
93
+ }
94
+ }
gutenberg/build/index.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins'), 'version' => '7e5ab97cbc5cb0bcf6a5');
gutenberg/build/index.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ div.interface-pinned-items button.components-button.is-pressed[aria-label="Join.chat"]>svg .joinchat-svg-chatin{fill:#1e1e1e}.components-panel code{font-size:smaller;padding:2px 1px;-webkit-user-select:all;-moz-user-select:all;user-select:all;vertical-align:baseline}.joinchat-sidebar-visibility:not(.joinchat-sidebar-visibility--default) .dashicons-visibility{color:#79ba49}.joinchat-sidebar-visibility .dashicons-hidden{color:#ca4a1f}.components-panel .react-tel-input .form-control{border:1px solid #757575;border-radius:2px;font-size:13px;width:248px}.components-panel .react-tel-input .flag-dropdown{border:1px solid #757575;border-radius:2px 0 0 2px}.components-panel .react-tel-input .flag-dropdown.open{border-radius:2px 0 0}.components-panel .react-tel-input .flag-dropdown .arrow{left:55px!important}.components-panel .react-tel-input .flag-dropdown .country-list{border:1px solid #757575;border-top:0 solid #757575;box-shadow:0 -1px 0 #757575,1px 2px 10px rgba(0,0,0,.2);width:248px}.components-panel .react-tel-input .flag-dropdown .search-box{height:30px;margin:0;width:97%}.wp-block-joinchat-button{--joinchat-ico:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Cpath fill=%27%23fff%27 d=%27M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z%27/%3E%3C/svg%3E")}@media (orientation:landscape)and (min-height:481px),(orientation:portrait)and (min-width:481px){.wp-block-joinchat-button.joinchat-button--qr-only .joinchat-button__link{display:inline-flex!important;opacity:.5}}
2
+ .react-tel-input{font-family:Roboto,sans-serif;font-size:15px;position:relative;width:100%}.react-tel-input :disabled{cursor:not-allowed}.react-tel-input .flag{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAACmCAMAAAACnqETAAADAFBMVEUAAAD30gQCKn0GJJ4MP4kMlD43WGf9/f329vcBAQHhAADx8vHvAwL8AQL7UlL4RUUzqDP2MjLp6un2Jyj0Ghn2PTr9fHvi5OJYuln7Xl75+UPpNzXUAQH29jH6cXC+AAIAJwBNtE/23Ff5aGdDr0TJAQHsZV3qR0IAOQB3x3fdRD/Z2NvuWFLkcG7fVlH4kI4AAlXO0M8BATsdS6MCagIBfQEASgPoKSc4VKL442q4xeQAigD46eetAABYd9jvf3nZMiwAAoD30zz55X5ng9tPbKZnwGXz8x77+lY7OTjzzikABGsenh72pKNPldEAWgHgGBgAACH88/Gqt95JR0OWAwP3uLd/qdr53kMBBJJ3d3XMPTpWer8NnAwABKPH1O1VVFIuLSz13NtZnlf2kEh9keLn7vfZ4vNkZGHzvwJIXZRfZLuDwfv4y8tvk79LlUblzsxorGcCBusFKuYCCcdmfq5jqvlxt/tzktEABLb8/HL2tlTAw8SLlMFpj/ZlpNhBZ81BYbQcGxuToN9SYdjXY2Lz7lD0dCQ6S9Dm0EUCYPdDlvWWvd2AnviXqc11eMZTqPc3cPMCRev16ZrRUE0Hf/tNT7HIJyTptDVTffSsTkvhtgQ0T4jigoFUx/g+hsX9/QUHzQY1dbJ7sHV02Pduvd0leiK1XmaTrfpCQPgELrrdsrY1NamgyPrh03iPxosvX92ysbCgoZzk5kP1YD7t6AILnu+45LykNS40qvXDdHnR6tBennz6u3TSxU1Or9Swz6wqzCsPZKzglJbIqEY8hDhyAgFzbJxuOC+Li4d9sJLFsnhwbvH2d1A3kzAqPZQITsN76nq2dzaZdKJf4F6RJkb078YFiM+tnWZGh2F+dDibykYoMcsnekdI1UhCAwWb25qVkEq43km9yBrclQMGwfyZ3/zZ2QK9gJxsJWCBUk32QwqOSYKRxh6Xdm3B4oMW22EPZzawnR72kgZltCqPxrdH1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yfweDAMR/jSwrWT7ZuDLBMCBvgj/9tHU8CKDoq6q8CRczAU6MAAyBBQvwgi/879lRUfRvw39BgCuwqa9MWeh4jkkSkJycm1yLv0BAZmI59WZI6asvUKC8PFWLi6zGyCtAgDR3H3PObQ+keUfFzAqJql5XnZzMbnCt80Yg/LRzq6puSsPEEAgQGOjJFH8wEH4dExx8MS7/f0JA55KyOftlv8WGsj3JYi2L5GRj7eNvm0FAW2Ybxf+LlL46qUq+vX2B15xPFilw9Zl43uV1irm9IMAeMmuW3Sj5hRIUBFS99VZV2lg3AZkopJQMSJ/jm25KMPxHBPS0NO0vk+eHE5wWLK29UpPffhwjQC999W1uuIeU1cD1REwlnT8ZBMjhf+W5D4AAc8isAnM1H5L79ogA79KqHxdV/aQSgPjBQLgkgG8D+Ps/ImAJrv+c990LKU9bLU82udZci2puvfRtL9Sux19/namzERUFO/3FdGBklljiYqRKAHyWv8Is4k8//cQNGCDAG6iqajmGphVJQHgPCBhQRkAqf/v/s3vAEjV+QQDHT0DG7vFWvdTEkFduGDxiBiOoXWLxGqVgQV3i4qZzHzCVggBzzziNFJ43huMvrfqpCk07IICR2TMwHwNAfQoA/9VToM+15HzNQspz8fgHkiUNraeQvu48MGDqp6fgYnfFQrS6xMWFY667rdTbaK45wBBGF5fNGKN1uU0GAYz5bh1wCS484T/TAUdNk7ULKSuFvK0SJ0lfHS677MzyFZrV1NQlLi6Aj9dYb3+T55IXM9CxogAcV/3vSvC/Bj1utPD6n/EnnaQbrf6BCX0AAAAASUVORK5CYII=);height:11px;width:16px}.react-tel-input .ad{background-position:-16px 0}.react-tel-input .ae{background-position:-32px 0}.react-tel-input .af{background-position:-48px 0}.react-tel-input .ag{background-position:-64px 0}.react-tel-input .ai{background-position:-80px 0}.react-tel-input .al{background-position:-96px 0}.react-tel-input .am{background-position:-112px 0}.react-tel-input .ao{background-position:-128px 0}.react-tel-input .ar{background-position:-144px 0}.react-tel-input .as{background-position:-160px 0}.react-tel-input .at{background-position:-176px 0}.react-tel-input .au{background-position:-192px 0}.react-tel-input .aw{background-position:-208px 0}.react-tel-input .az{background-position:-224px 0}.react-tel-input .ba{background-position:-240px 0}.react-tel-input .bb{background-position:0 -11px}.react-tel-input .bd{background-position:-16px -11px}.react-tel-input .be{background-position:-32px -11px}.react-tel-input .bf{background-position:-48px -11px}.react-tel-input .bg{background-position:-64px -11px}.react-tel-input .bh{background-position:-80px -11px}.react-tel-input .bi{background-position:-96px -11px}.react-tel-input .bj{background-position:-112px -11px}.react-tel-input .bm{background-position:-128px -11px}.react-tel-input .bn{background-position:-144px -11px}.react-tel-input .bo{background-position:-160px -11px}.react-tel-input .br{background-position:-176px -11px}.react-tel-input .bs{background-position:-192px -11px}.react-tel-input .bt{background-position:-208px -11px}.react-tel-input .bw{background-position:-224px -11px}.react-tel-input .by{background-position:-240px -11px}.react-tel-input .bz{background-position:0 -22px}.react-tel-input .ca{background-position:-16px -22px}.react-tel-input .cd{background-position:-32px -22px}.react-tel-input .cf{background-position:-48px -22px}.react-tel-input .cg{background-position:-64px -22px}.react-tel-input .ch{background-position:-80px -22px}.react-tel-input .ci{background-position:-96px -22px}.react-tel-input .ck{background-position:-112px -22px}.react-tel-input .cl{background-position:-128px -22px}.react-tel-input .cm{background-position:-144px -22px}.react-tel-input .cn{background-position:-160px -22px}.react-tel-input .co{background-position:-176px -22px}.react-tel-input .cr{background-position:-192px -22px}.react-tel-input .cu{background-position:-208px -22px}.react-tel-input .cv{background-position:-224px -22px}.react-tel-input .cw{background-position:-240px -22px}.react-tel-input .cy{background-position:0 -33px}.react-tel-input .cz{background-position:-16px -33px}.react-tel-input .de{background-position:-32px -33px}.react-tel-input .dj{background-position:-48px -33px}.react-tel-input .dk{background-position:-64px -33px}.react-tel-input .dm{background-position:-80px -33px}.react-tel-input .do{background-position:-96px -33px}.react-tel-input .dz{background-position:-112px -33px}.react-tel-input .ec{background-position:-128px -33px}.react-tel-input .ee{background-position:-144px -33px}.react-tel-input .eg{background-position:-160px -33px}.react-tel-input .er{background-position:-176px -33px}.react-tel-input .es{background-position:-192px -33px}.react-tel-input .et{background-position:-208px -33px}.react-tel-input .fi{background-position:-224px -33px}.react-tel-input .fj{background-position:-240px -33px}.react-tel-input .fk{background-position:0 -44px}.react-tel-input .fm{background-position:-16px -44px}.react-tel-input .fo{background-position:-32px -44px}.react-tel-input .bl,.react-tel-input .fr,.react-tel-input .mf{background-position:-48px -44px}.react-tel-input .ga{background-position:-64px -44px}.react-tel-input .gb{background-position:-80px -44px}.react-tel-input .gd{background-position:-96px -44px}.react-tel-input .ge{background-position:-112px -44px}.react-tel-input .gf{background-position:-128px -44px}.react-tel-input .gh{background-position:-144px -44px}.react-tel-input .gi{background-position:-160px -44px}.react-tel-input .gl{background-position:-176px -44px}.react-tel-input .gm{background-position:-192px -44px}.react-tel-input .gn{background-position:-208px -44px}.react-tel-input .gp{background-position:-224px -44px}.react-tel-input .gq{background-position:-240px -44px}.react-tel-input .gr{background-position:0 -55px}.react-tel-input .gt{background-position:-16px -55px}.react-tel-input .gu{background-position:-32px -55px}.react-tel-input .gw{background-position:-48px -55px}.react-tel-input .gy{background-position:-64px -55px}.react-tel-input .hk{background-position:-80px -55px}.react-tel-input .hn{background-position:-96px -55px}.react-tel-input .hr{background-position:-112px -55px}.react-tel-input .ht{background-position:-128px -55px}.react-tel-input .hu{background-position:-144px -55px}.react-tel-input .id{background-position:-160px -55px}.react-tel-input .ie{background-position:-176px -55px}.react-tel-input .il{background-position:-192px -55px}.react-tel-input .in{background-position:-208px -55px}.react-tel-input .io{background-position:-224px -55px}.react-tel-input .iq{background-position:-240px -55px}.react-tel-input .ir{background-position:0 -66px}.react-tel-input .is{background-position:-16px -66px}.react-tel-input .it{background-position:-32px -66px}.react-tel-input .je{background-position:-144px -154px}.react-tel-input .jm{background-position:-48px -66px}.react-tel-input .jo{background-position:-64px -66px}.react-tel-input .jp{background-position:-80px -66px}.react-tel-input .ke{background-position:-96px -66px}.react-tel-input .kg{background-position:-112px -66px}.react-tel-input .kh{background-position:-128px -66px}.react-tel-input .ki{background-position:-144px -66px}.react-tel-input .xk{background-position:-128px -154px}.react-tel-input .km{background-position:-160px -66px}.react-tel-input .kn{background-position:-176px -66px}.react-tel-input .kp{background-position:-192px -66px}.react-tel-input .kr{background-position:-208px -66px}.react-tel-input .kw{background-position:-224px -66px}.react-tel-input .ky{background-position:-240px -66px}.react-tel-input .kz{background-position:0 -77px}.react-tel-input .la{background-position:-16px -77px}.react-tel-input .lb{background-position:-32px -77px}.react-tel-input .lc{background-position:-48px -77px}.react-tel-input .li{background-position:-64px -77px}.react-tel-input .lk{background-position:-80px -77px}.react-tel-input .lr{background-position:-96px -77px}.react-tel-input .ls{background-position:-112px -77px}.react-tel-input .lt{background-position:-128px -77px}.react-tel-input .lu{background-position:-144px -77px}.react-tel-input .lv{background-position:-160px -77px}.react-tel-input .ly{background-position:-176px -77px}.react-tel-input .ma{background-position:-192px -77px}.react-tel-input .mc{background-position:-208px -77px}.react-tel-input .md{background-position:-224px -77px}.react-tel-input .me{background-position:-112px -154px;height:12px}.react-tel-input .mg{background-position:0 -88px}.react-tel-input .mh{background-position:-16px -88px}.react-tel-input .mk{background-position:-32px -88px}.react-tel-input .ml{background-position:-48px -88px}.react-tel-input .mm{background-position:-64px -88px}.react-tel-input .mn{background-position:-80px -88px}.react-tel-input .mo{background-position:-96px -88px}.react-tel-input .mp{background-position:-112px -88px}.react-tel-input .mq{background-position:-128px -88px}.react-tel-input .mr{background-position:-144px -88px}.react-tel-input .ms{background-position:-160px -88px}.react-tel-input .mt{background-position:-176px -88px}.react-tel-input .mu{background-position:-192px -88px}.react-tel-input .mv{background-position:-208px -88px}.react-tel-input .mw{background-position:-224px -88px}.react-tel-input .mx{background-position:-240px -88px}.react-tel-input .my{background-position:0 -99px}.react-tel-input .mz{background-position:-16px -99px}.react-tel-input .na{background-position:-32px -99px}.react-tel-input .nc{background-position:-48px -99px}.react-tel-input .ne{background-position:-64px -99px}.react-tel-input .nf{background-position:-80px -99px}.react-tel-input .ng{background-position:-96px -99px}.react-tel-input .ni{background-position:-112px -99px}.react-tel-input .bq,.react-tel-input .nl{background-position:-128px -99px}.react-tel-input .no{background-position:-144px -99px}.react-tel-input .np{background-position:-160px -99px}.react-tel-input .nr{background-position:-176px -99px}.react-tel-input .nu{background-position:-192px -99px}.react-tel-input .nz{background-position:-208px -99px}.react-tel-input .om{background-position:-224px -99px}.react-tel-input .pa{background-position:-240px -99px}.react-tel-input .pe{background-position:0 -110px}.react-tel-input .pf{background-position:-16px -110px}.react-tel-input .pg{background-position:-32px -110px}.react-tel-input .ph{background-position:-48px -110px}.react-tel-input .pk{background-position:-64px -110px}.react-tel-input .pl{background-position:-80px -110px}.react-tel-input .pm{background-position:-96px -110px}.react-tel-input .pr{background-position:-112px -110px}.react-tel-input .ps{background-position:-128px -110px}.react-tel-input .pt{background-position:-144px -110px}.react-tel-input .pw{background-position:-160px -110px}.react-tel-input .py{background-position:-176px -110px}.react-tel-input .qa{background-position:-192px -110px}.react-tel-input .re{background-position:-208px -110px}.react-tel-input .ro{background-position:-224px -110px}.react-tel-input .rs{background-position:-240px -110px}.react-tel-input .ru{background-position:0 -121px}.react-tel-input .rw{background-position:-16px -121px}.react-tel-input .sa{background-position:-32px -121px}.react-tel-input .sb{background-position:-48px -121px}.react-tel-input .sc{background-position:-64px -121px}.react-tel-input .sd{background-position:-80px -121px}.react-tel-input .se{background-position:-96px -121px}.react-tel-input .sg{background-position:-112px -121px}.react-tel-input .sh{background-position:-128px -121px}.react-tel-input .si{background-position:-144px -121px}.react-tel-input .sk{background-position:-160px -121px}.react-tel-input .sl{background-position:-176px -121px}.react-tel-input .sm{background-position:-192px -121px}.react-tel-input .sn{background-position:-208px -121px}.react-tel-input .so{background-position:-224px -121px}.react-tel-input .sr{background-position:-240px -121px}.react-tel-input .ss{background-position:0 -132px}.react-tel-input .st{background-position:-16px -132px}.react-tel-input .sv{background-position:-32px -132px}.react-tel-input .sx{background-position:-48px -132px}.react-tel-input .sy{background-position:-64px -132px}.react-tel-input .sz{background-position:-80px -132px}.react-tel-input .tc{background-position:-96px -132px}.react-tel-input .td{background-position:-112px -132px}.react-tel-input .tg{background-position:-128px -132px}.react-tel-input .th{background-position:-144px -132px}.react-tel-input .tj{background-position:-160px -132px}.react-tel-input .tk{background-position:-176px -132px}.react-tel-input .tl{background-position:-192px -132px}.react-tel-input .tm{background-position:-208px -132px}.react-tel-input .tn{background-position:-224px -132px}.react-tel-input .to{background-position:-240px -132px}.react-tel-input .tr{background-position:0 -143px}.react-tel-input .tt{background-position:-16px -143px}.react-tel-input .tv{background-position:-32px -143px}.react-tel-input .tw{background-position:-48px -143px}.react-tel-input .tz{background-position:-64px -143px}.react-tel-input .ua{background-position:-80px -143px}.react-tel-input .ug{background-position:-96px -143px}.react-tel-input .us{background-position:-112px -143px}.react-tel-input .uy{background-position:-128px -143px}.react-tel-input .uz{background-position:-144px -143px}.react-tel-input .va{background-position:-160px -143px}.react-tel-input .vc{background-position:-176px -143px}.react-tel-input .ve{background-position:-192px -143px}.react-tel-input .vg{background-position:-208px -143px}.react-tel-input .vi{background-position:-224px -143px}.react-tel-input .vn{background-position:-240px -143px}.react-tel-input .vu{background-position:0 -154px}.react-tel-input .wf{background-position:-16px -154px}.react-tel-input .ws{background-position:-32px -154px}.react-tel-input .ye{background-position:-48px -154px}.react-tel-input .za{background-position:-64px -154px}.react-tel-input .zm{background-position:-80px -154px}.react-tel-input .zw{background-position:-96px -154px}.react-tel-input *{box-sizing:border-box}.react-tel-input .hide{display:none}.react-tel-input .v-hide{visibility:hidden}.react-tel-input .form-control{background:#fff;border:1px solid #cacaca;border-radius:5px;font-size:14px;height:35px;letter-spacing:.01rem;line-height:25px;margin-bottom:0!important;margin-left:0;margin-top:0!important;outline:none;padding-left:48px;position:relative;width:300px}.react-tel-input .form-control:hover{border-color:#a2a2a2}.react-tel-input .form-control.invalid-number,.react-tel-input .form-control.invalid-number:focus{background-color:#faf0f0;border:1px solid #d79f9f;border-left-color:#cacaca}.react-tel-input .form-control.open{border-color:#96c8da;border-bottom:none;border-radius:5px 5px 0 0;box-shadow:0 2px 3px 0 rgba(34,36,38,.15);box-shadow:none}.react-tel-input .flag-dropdown{background-color:#f5f5f5;border:1px solid #cacaca;border-radius:3px 0 0 3px;bottom:0;padding:0;position:absolute;top:0}.react-tel-input .flag-dropdown:focus,.react-tel-input .flag-dropdown:hover{cursor:pointer}.react-tel-input .flag-dropdown.open,.react-tel-input .flag-dropdown.open .selected-flag{background:#fff;border-radius:3px 0 0}.react-tel-input input[disabled]+.flag-dropdown:hover{cursor:default}.react-tel-input input[disabled]+.flag-dropdown:hover .selected-flag{background-color:transparent}.react-tel-input .selected-flag{border-radius:3px 0 0 3px;height:100%;outline:none;padding:0 0 0 8px;position:relative;width:38px}.react-tel-input .selected-flag:focus,.react-tel-input .selected-flag:hover{background-color:#fff}.react-tel-input .selected-flag .flag{margin-top:-5px;position:absolute;top:50%}.react-tel-input .selected-flag .arrow{border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid #555;height:0;left:20px;margin-top:-2px;position:relative;top:50%;width:0}.react-tel-input .selected-flag .arrow.up{border-bottom:4px solid #555;border-top:none}.react-tel-input .selected-flag.open{z-index:2}.react-tel-input .country-list{background-color:#fff;border:1px solid #96c8da;border-radius:0 0 5px 5px;border-top:none;box-shadow:1px 2px 10px rgba(0,0,0,.12);list-style:none;margin:0 0 10px -1px;max-height:200px;outline:none;overflow-y:scroll;padding:0;position:absolute;width:300px;z-index:1}.react-tel-input .country-list .flag{display:inline-block}.react-tel-input .country-list .divider{border-bottom:1px solid #ccc;margin-bottom:5px;padding-bottom:5px}.react-tel-input .country-list .country{padding:7px 9px}.react-tel-input .country-list .country .dial-code{color:#6b6b6b}.react-tel-input .country-list .country.highlight,.react-tel-input .country-list .country:hover{background-color:#f1f1f1}.react-tel-input .country-list .flag{margin-right:7px;margin-top:2px}.react-tel-input .country-list .country-name{margin-right:6px}.react-tel-input .country-list .search{background-color:#fff;padding:5px 0 6px 10px;position:-webkit-sticky;position:sticky;top:0}.react-tel-input .country-list .search-emoji{display:none;font-size:15px}.react-tel-input .country-list .search-box{border:1px solid #cacaca;border-radius:3px;font-size:15px;line-height:15px;outline:none;padding:3px 8px 5px}.react-tel-input .country-list .no-entries-message{opacity:.7;padding:7px 10px 11px}.react-tel-input .country-list::-webkit-scrollbar{width:12px}.react-tel-input .country-list::-webkit-scrollbar-track{background-color:#e6e6e6}.react-tel-input .country-list::-webkit-scrollbar-thumb{background-color:#c5c5c4;border-radius:5px}.react-tel-input .invalid-number-message{color:#de0000}.react-tel-input .invalid-number-message,.react-tel-input .special-label{background:#fff;font-size:13px;left:46px;padding:0 2px;position:absolute;top:-8px;z-index:1}.react-tel-input .special-label{display:none;white-space:nowrap}
gutenberg/build/index.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(){var e,t={150:function(e,t,n){"use strict";var r=window.wp.element,a=window.wp.i18n,o=window.wp.hooks,i=window.wp.plugins,c=window.wp.editPost;const l={};l.joinchat=(0,r.createElement)("svg",{className:"joinchat-cta-block-icon",viewBox:"0 0 24 24"},(0,r.createElement)("path",{d:"M12 0a12 12 0 0 1 9.2 19.7 3 3 0 0 0 2 2.8 6 6 0 0 1-4.4-.6A12 12 0 1 1 12 0Z"}),(0,r.createElement)("path",{fill:"#f9603a",d:"M3.3 6.7h.1v-.1h.2l.1-.1H4v-.1h.2l.1-.1h.3v-.1H5l.2-.1h2.1l.1.1h.2l.2.1H8v.1h.4v.1h.2l.1.1h.1v.1H9v.1h.2V7h.1l.1.1.2.1v.1h.1l.1.1.1.1h.1v.1h.1v.1h.1v.1h.1v.1h.1V8h.2v.1l.1.1.1.1v.1h.1v.1h.1v.2h.1v.1h.1V9h.1v.2h.1v.2h.1v.2h.1v.2h.1v.4h.1v.3l.1.1v.4h.1v2.4h2.3a2.2 2.2 0 0 1 2.3 2.2 2.2 2.2 0 0 1-2.2 2.3h-3.9a3 3 0 0 0-1.3 5.8 12 12 0 0 1-4-1.7 6 6 0 0 1-4.3.6 3 3 0 0 0 2-2.7 12 12 0 0 1-.3-.4h-.1v-.1l-.2-.2V19l-.1-.1-.1-.1v-.1H2v-.1l-.1-.1v-.1h-.1v-.2l-.2-.1v-.2h-.1v-.1l-.1-.2v-.1h-.1v-.1l-.3-.5v-.2l-.2-.3a12 12 0 0 1-.8-4.2V12c0-.6 0-1.1.2-1.6v-.1l.1-.3.1-.1v-.1l.1-.2v-.1h.1v-.1l.1-.2V9h.1l.2-.2v-.2h.1l.1-.2.1-.1.1-.1V8h.2v-.1h.1v-.1h.1v-.1H2v-.2h.1v-.1h.1l.1-.1h.1v-.1h.1l.1-.1.1-.1h.1l.1-.1H3v-.1h.1l.1-.1h.1Z"}),(0,r.createElement)("path",{fill:"#fff",d:"M15 8a1 1 0 0 0 1.5 0 .3.3 0 0 1 .5 0 .3.3 0 0 1 0 .4 1.7 1.7 0 0 1-2.5 0 .3.3 0 0 1 .1-.6.3.3 0 0 1 .4.1Zm.2-2c.2.3.2.6 0 .8a.5.5 0 0 1-.8 0 .9.9 0 0 0-1.2 0 .5.5 0 0 1-1-.3l.2-.4a2 2 0 0 1 2.8 0Zm4 0c.1.3.1.6 0 .8a.5.5 0 0 1-.8 0 .9.9 0 0 0-1.3 0 .5.5 0 0 1-.8-.3l.1-.4a2 2 0 0 1 2.7 0Zm-9.4 5.8a.8.8 0 0 1 0 1.1 2.2 2.2 0 0 1-3.1 0 .8.8 0 1 1 1-1 .6.6 0 0 0 1 0 .8.8 0 0 1 1.1 0Zm.7-1.4a.3.3 0 1 1-.5.5.7.7 0 0 0-1 0 .3.3 0 1 1-.4-.5c.5-.6 1.3-.6 1.9 0Zm-2.6 0a.3.3 0 1 1-.5.4.6.6 0 0 0-.9 0 .3.3 0 1 1-.5-.5 1.3 1.3 0 0 1 1.9 0Z"})),l.sidebar=(0,r.createElement)("svg",{className:"joinchat-sidebar-icon",viewBox:"0 0 26 26"},(0,r.createElement)("g",{fill:"none"},(0,r.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",d:"M13 .75A12.21 12.21 0 0 1 25.25 13a12.2 12.2 0 0 1-2.85 7.86c-.18 1.33.08 2.1.51 2.73l.13.18-.2-.01a5.71 5.71 0 0 1-1.91-.55l-.25-.12c-2.75 1.38-5.12 2.16-7.68 2.16A12.21 12.21 0 0 1 .75 13 12.21 12.21 0 0 1 13 .75Z"}),(0,r.createElement)("path",{fill:"currentColor",d:"M16.27 8.58c.46.46 1.2.46 1.65 0a.37.37 0 0 1 .53.52 1.9 1.9 0 0 1-2.7 0 .37.37 0 1 1 .52-.52Zm.15-1.98a.55.55 0 0 1-.77.8l-.01-.02a.99.99 0 0 0-1.38 0h-.02a.55.55 0 1 1-.78-.78 2.1 2.1 0 0 1 2.96 0Zm4.31 0a.55.55 0 0 1-.77.8v-.02a.99.99 0 0 0-1.39 0h-.01a.55.55 0 1 1-.79-.78 2.1 2.1 0 0 1 2.96 0ZM3.6 7.2l.04-.01.06-.03.03-.02.05-.02.04-.01.03-.02h.02l.03-.02.05-.02.05-.02.04-.02.03-.01.03-.01.03-.02.05-.01.04-.02.03-.01.04-.01.02-.01.03-.01.03-.01.04-.02.06-.02.08-.02.03-.01.03-.01.05-.02h.04l.05-.02.05-.02.05-.01.05-.01.06-.02c.03 0 .05 0 .08-.02h.03l.03-.01h.03l.04-.01.03-.01h.04l.06-.02h.03a6.45 6.45 0 0 1 .22-.04h.02l.07-.01h.04l.03-.01h.03l.03-.01h.07l.03-.01h.1l.1-.02h.87a6.54 6.54 0 0 1 .23.03h.1l.06.02h.1l.03.01.05.01h.02l.06.01.04.01a6.47 6.47 0 0 1 .1.02h.03l.03.01.05.01h.02l.02.01.06.01.02.01H8l.05.02h.02l.05.02h.02l.05.02h.03l.05.02h.02a6.44 6.44 0 0 1 .15.05l.05.01.02.01h.03l.05.03.04.01.03.01h.02l.05.03h.02l.03.01.04.02.05.02.05.02.04.02.05.02h.02l.05.03.04.02h.02l.05.03h.03l.02.02a6.46 6.46 0 0 1 .1.04l.03.02.03.01.02.02.04.02.03.01.02.01.04.03.05.02.02.01.02.01.05.03.04.02.04.03.04.02.05.03.02.01.04.03.02.01c.02 0 .03.02.04.03l.04.02.05.03.04.03.04.03a6.5 6.5 0 0 1 .08.05l.04.03.04.03.02.02.02.01.04.03.04.03.04.03.04.03.04.03.04.03.04.04.01.01.02.02c.02 0 .03.02.04.03l.04.03.04.03.02.02.01.02c.02 0 .03.02.04.03l.02.02.04.03.01.02c.02 0 .03.02.04.03l.04.03.03.04.04.03.03.04.04.04.03.03.04.04.01.01.04.04.01.02.04.04.03.03.03.04.04.04.03.03.03.04.03.04.03.04.03.04.02.02.03.04.02.02.03.04.03.04.03.04.02.03.04.05.01.02.03.04.01.02.03.04.03.04.01.02.02.02.02.04.03.04.01.02.02.03.02.04.02.02.02.04.01.02.03.05.02.04.03.04.03.05.02.04.01.02.01.03.03.04.02.04.01.03.01.02.02.04.03.05.02.04.02.05.02.04.02.05.02.04.01.03.02.04.01.03.02.05.02.04.01.03v.02l.03.04.01.05.02.05.02.04.02.06.01.04.02.05.01.05.02.05v.02l.02.03.01.04.01.05.01.03v.02a6.44 6.44 0 0 1 .04.1v.04a6.45 6.45 0 0 1 .03.11l.01.05.02.06v.04a6.46 6.46 0 0 1 .03.1v.06l.02.04v.06l.01.05.01.04v.03l.01.05v.05l.02.06v.02a6.5 6.5 0 0 1 .01.12v.04l.01.05v.05a6.54 6.54 0 0 1 .02.21v1.7h2.44a2.44 2.44 0 0 1 2.44 2.4v.03a2.44 2.44 0 0 1-2.4 2.44h-.04v.03h-4.15a3.25 3.25 0 0 0-1.4 6.32l-.02.02a12.92 12.92 0 0 1-4.17-1.87 6.46 6.46 0 0 1-4.7.6 3.25 3.25 0 0 0 2.11-2.92l-.31-.39h-.01a8.39 8.39 0 0 1-.05-.07l-.02-.03a7.55 7.55 0 0 1-.04-.05l-.05-.07-.1-.12-.02-.04a6.4 6.4 0 0 1-.03-.04l-.03-.05a7.01 7.01 0 0 1-.04-.04l-.05-.08-.05-.07-.02-.02-.04-.06-.02-.04-.02-.03-.03-.05-.03-.04-.03-.04-.03-.05-.04-.06-.02-.04-.04-.05-.02-.04-.03-.05-.03-.04-.03-.06-.07-.12-.04-.07-.03-.04-.03-.05-.02-.04-.03-.06-.03-.04-.03-.06-.06-.12-.04-.07-.03-.05-.02-.05-.03-.05-.02-.05-.03-.05-.02-.05-.2-.43-.04-.08-.02-.05-.02-.05-.02-.05-.03-.05a12.9 12.9 0 0 1-.09-.23l-.03-.09-.03-.05A12.95 12.95 0 0 1 0 13.24v-.32a6.44 6.44 0 0 1 .27-1.77l-.02.08a6.44 6.44 0 0 1 .05-.16v-.01l.08-.22v-.02l.03-.06v-.02l.03-.06v-.02l.03-.07.1-.22v-.01l.03-.06v-.01l.01-.02.03-.05v-.03a.05.05 0 0 0 .03-.05l.02-.03.1-.18v-.02l.03-.05.02-.03c0-.02.02-.03.03-.05l.01-.03.03-.05.02-.03.1-.16.02-.03.03-.04.02-.04.03-.04.02-.03.03-.04.02-.03.11-.15.03-.03c0-.02.02-.03.03-.04L1.39 9l.03-.03.03-.04.03-.03.03-.04.03-.03.03-.04.04-.04.03-.04.03-.03.03-.04.02-.01.03-.04.03-.03.03-.03.04-.04.02-.03.03-.03.04-.04.04-.03.03-.04.04-.03.02-.02.02-.02.02-.02.03-.02.02-.02.03-.03.04-.03.03-.03.05-.04.04-.03.02-.02.03-.02.04-.04.03-.02.04-.03.03-.03.03-.02.03-.03.05-.03.05-.04.04-.02.04-.03.04-.03.03-.02.04-.03.03-.02s.02 0 .03-.02l.02-.01.05-.04.04-.02.05-.03.04-.02.04-.03.04-.02.03-.02a5.92 5.92 0 0 1 .08-.04l.03-.02.03-.02.05-.02.04-.03.05-.02.07-.03Z"}),(0,r.createElement)("path",{className:"joinchat-svg-chatin",fill:"#fff",d:"m8.43 12.81.01.01c.27.26.68.27.95.02l.01-.02a.86.86 0 0 1 1.22 1.22 2.4 2.4 0 0 1-3.4 0 .86.86 0 0 1 1.21-1.23Zm2.94-1.57a.37.37 0 0 1-.52.54v-.01a.74.74 0 0 0-1.04-.02l-.01.02a.37.37 0 0 1-.52-.53 1.48 1.48 0 0 1 2.09 0Zm-2.85-.03a.37.37 0 0 1-.51.53H8a.68.68 0 0 0-.95-.02l-.01.02a.37.37 0 0 1-.52-.53 1.42 1.42 0 0 1 2 0Z"})));var u=l,s=window.wp.blocks;function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}var d=n(184),p=n.n(d),h=window.wp.components,m=window.wp.blockEditor,y=window.wp.data,v=n(555),b=n.n(v),g=JSON.parse('{"u2":"joinchat/button"}');(0,s.registerBlockType)(g.u2,{icon:{src:u.joinchat},edit:function(e){var t,n,o,i;const{attributes:c,setAttributes:l,className:u}=e,{style:s,cta:d,phone:v,message:g,qr_code:_}=c,{postType:C}=(0,y.useSelect)((e=>({postType:e("core/editor").getPostTypeLabel()}))),{postMeta:w}=(0,y.useSelect)((e=>({postMeta:e("core/editor").getEditedPostAttribute("meta")}))),S=(0,m.__experimentalUseBorderProps)(c),j=(0,m.__experimentalUseColorProps)(c),E=(0,m.__experimentalGetSpacingClassesAndStyles)(c),x=(0,r.useRef)(),N=(0,r.useRef)(),O=(0,m.useBlockProps)({ref:x}),k=joinchatData.defaults,T=JSON.parse(localStorage.getItem("joinchat_country_code")||"{}"),A=T.code&&T.date===(new Date).toDateString()?T.code.toLowerCase():"us",I=(null==w||null===(t=w._joinchat)||void 0===t?void 0:t.telephone)||k.telephone||(0,a.__)("set your phone","creame-whatsapp-me"),P=(null==w||null===(n=w._joinchat)||void 0===n?void 0:n.message_send)||(null==k?void 0:k.message_send)||"",D=(0,r.createElement)(r.Fragment,null,"no"!=_&&(0,r.createElement)("figure",null,(0,r.createElement)("figcaption",null,(0,a.__)("Scan the code","creame-whatsapp-me")),(0,r.createElement)("span",{className:p()("joinchat-button__qr",S.className,{"no-border-radius":0===(null==s||null===(o=s.border)||void 0===o?void 0:o.radius)}),style:{...S.style}},(0,r.createElement)("img",{src:joinchatData.image_qr,alt:(0,a.__)("QR Code","creame-whatsapp-me"),width:"200",height:"200"}))));return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",f({},O,{className:p()(O.className,{["joinchat-button--qr-".concat(_)]:"no"!=_})}),D,(0,r.createElement)("div",{className:p()(u,"wp-block-button__link","joinchat-button__link",j.className,S.className,{"no-border-radius":0===(null==s||null===(i=s.border)||void 0===i?void 0:i.radius)}),style:{...S.style,...j.style,...E.style}},(0,r.createElement)(m.RichText,{ref:N,"aria-label":(0,a.__)("Call to Action","creame-whatsapp-me"),placeholder:(0,a.__)("Add text…","creame-whatsapp-me"),value:d,onChange:e=>{var t;l({cta:null==(t=e)?void 0:t.replace(/<\/?a[^>]*>/g,"")})},withoutInteractiveFormatting:!0,multiline:"false",identifier:"text"}))),(0,r.createElement)(m.InspectorControls,null,(0,r.createElement)(h.PanelBody,{title:(0,a.__)("Contact","creame-whatsapp-me"),initialOpen:!0},(0,r.createElement)("p",null,(0,a.sprintf)((0,a.__)("Leave blank to use the %s or global Joinchat settings.","creame-whatsapp-me"),(null==C?void 0:C.toLowerCase())||"post")),(0,r.createElement)("fieldset",null,(0,r.createElement)("div",{className:"components-base-control"},(0,r.createElement)("div",{className:"components-base-control__field"},(0,r.createElement)("label",{className:"components-base-control__label",style:{display:"inline-block",marginBottom:"8px"}},(0,a.__)("Telephone","creame-whatsapp-me")),(0,r.createElement)(b(),{preferredCountries:[A],enableSearch:!0,disableSearchIcon:!0,searchPlaceholder:(0,a.__)("search","creame-whatsapp-me"),searchNotFound:(0,a.__)("nothing found","creame-whatsapp-me"),placeholder:I,value:v,onChange:e=>{l({phone:e})},isValid:e=>0===e.length||e.length>6})))),(0,r.createElement)("fieldset",null,(0,r.createElement)(h.TextareaControl,{value:g,multiline:!0,label:(0,a.__)("Message","creame-whatsapp-me"),help:(0,r.createElement)("span",{dangerouslySetInnerHTML:{__html:(0,a.__)("Can use vars","creame-whatsapp-me")+" <code>{"+joinchatData.message_vars.join("}</code> <code>{")+"}</code> "+(0,a.__)("to leave it blank use","creame-whatsapp-me")+" <code>{}</code>"}}),placeholder:P,onChange:e=>l({message:e})}))),(0,r.createElement)(h.PanelBody,{title:(0,a.__)("QR Code (on desktop)","creame-whatsapp-me"),initialOpen:!1},(0,r.createElement)("fieldset",null,(0,r.createElement)(h.RadioControl,{selected:_,options:[{value:"both",label:(0,a.__)("QR and Button","creame-whatsapp-me")},{value:"only",label:(0,a.__)("QR only","creame-whatsapp-me")},{value:"no",label:(0,a.__)("Button only","creame-whatsapp-me")}],onChange:e=>l({qr_code:e})})))))},save:function(e){var t,n;let{attributes:o,className:i}=e;const{style:c,cta:l,phone:u,message:s,qr_code:f}=o,d=(0,m.__experimentalGetBorderClassesAndStyles)(o),h=(0,m.__experimentalGetColorClassesAndStyles)(o),y=(0,m.__experimentalGetSpacingClassesAndStyles)(o),v=(0,r.createElement)(r.Fragment,null,"no"!=f&&(0,r.createElement)("figure",null,(0,r.createElement)("figcaption",null,(0,a.__)("Scan the code","creame-whatsapp-me")),(0,r.createElement)("a",{className:p()("joinchat-button__qr",d.className,{"no-border-radius":0===(null==c||null===(t=c.border)||void 0===t?void 0:t.radius)}),style:{...d.style},href:"#whatsapp","data-message":s,"data-phone":(null==u?void 0:u.length)>6?u:void 0})));return(0,r.createElement)("div",m.useBlockProps.save({className:p()(i,{["joinchat-button--qr-".concat(f)]:"no"!=f})}),v,(0,r.createElement)("a",{className:p()(i,"wp-block-button__link","joinchat-button__link",h.className,d.className,{"no-border-radius":0===(null==c||null===(n=c.border)||void 0===n?void 0:n.radius)}),style:{...d.style,...h.style,...y.style},href:"#whatsapp","data-message":s,"data-phone":(null==u?void 0:u.length)>6?u:void 0},(0,r.createElement)(m.RichText.Content,{tagName:"span",value:l})))}});const _=()=>{var e,t,n,o,i,c;const{postType:l}=(0,y.useSelect)((e=>({postType:e("core/editor").getPostTypeLabel()}))),{postMeta:u}=(0,y.useSelect)((e=>({postMeta:e("core/editor").getEditedPostAttribute("meta")}))),{editPost:s}=(0,y.useDispatch)("core/editor",[u._joinchat]),f=joinchatData.defaults,d=JSON.parse(localStorage.getItem("joinchat_country_code")||"{}"),m=d.code&&d.date===(new Date).toDateString()?d.code.toLowerCase():"us",v=!(null===(e=u._joinchat)||void 0===e||!e.telephone),g="no"===(null===(t=u._joinchat)||void 0===t?void 0:t.view)?"hidden":"visibility",_=null===(n=u._joinchat)||void 0===n||!n.view||""===u._joinchat.view,C=(0,h.withFilters)("JoinChat.PremiumSettings")((e=>(0,r.createElement)(r.Fragment,null)));return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(h.SlotFillProvider,null,(0,r.createElement)(C,null),(0,r.createElement)(h.Slot,{name:"beforeSidebarJoinchat"}),(0,r.createElement)(h.PanelBody,null,(0,r.createElement)("p",null,(0,a.sprintf)((0,a.__)("Custom Joinchat settings for this publication (%s).","creame-whatsapp-me"),(null==l?void 0:l.toLowerCase())||"post")),(0,r.createElement)(h.TextareaControl,{label:(0,a.__)("Call to Action","creame-whatsapp-me"),value:null===(o=u._joinchat)||void 0===o?void 0:o.message_text,placeholder:f.message_text,multiline:!0,onChange:e=>{s({meta:{_joinchat:{...u._joinchat,message_text:e}}})}}),(0,r.createElement)(h.TextareaControl,{label:(0,a.__)("Message","creame-whatsapp-me"),value:null===(i=u._joinchat)||void 0===i?void 0:i.message_send,placeholder:f.message_send,help:(0,r.createElement)("span",{dangerouslySetInnerHTML:{__html:(0,a.__)("Can use vars","creame-whatsapp-me")+" <code>{"+joinchatData.message_vars.join("}</code> <code>{")+"}</code> "+(0,a.__)("to leave it blank use","creame-whatsapp-me")+" <code>{}</code>"}}),multiline:!0,onChange:e=>{s({meta:{_joinchat:{...u._joinchat,message_send:e}}})}})),(0,r.createElement)(h.PanelBody,{title:(0,a.__)("Telephone","creame-whatsapp-me"),initialOpen:v},(0,r.createElement)(b(),{preferredCountries:[m],enableSearch:!0,disableSearchIcon:!0,searchPlaceholder:(0,a.__)("search","creame-whatsapp-me"),searchNotFound:(0,a.__)("nothing found","creame-whatsapp-me"),placeholder:f.telephone||(0,a.__)("set your phone","creame-whatsapp-me"),value:null===(c=u._joinchat)||void 0===c?void 0:c.telephone,onChange:e=>{s({meta:{_joinchat:{...u._joinchat,telephone:e.length>6?e:""}}})},isValid:e=>0===e.length||e.length>6})),(0,r.createElement)(h.PanelBody,{title:(0,a.__)("Visibility","creame-whatsapp-me"),icon:g,initialOpen:!1,className:p()("joinchat-sidebar-visibility",{"joinchat-sidebar-visibility--default":_})},(0,r.createElement)(h.RadioControl,{label:(0,a.__)("Visibility","creame-whatsapp-me"),hideLabelFromVision:!0,selected:u._joinchat.view||"",options:[{value:"yes",label:(0,a.__)("Show","creame-whatsapp-me")},{value:"no",label:(0,a.__)("Hide","creame-whatsapp-me")},{value:"",label:(0,a.__)("Default visibility","creame-whatsapp-me")}],onChange:e=>{s({meta:{_joinchat:{...u._joinchat,view:e}}})}})),(0,r.createElement)(h.Slot,{name:"afterSidebarJoinchat"})))},C=JSON.parse(localStorage.getItem("joinchat_country_code")||"{}");C.code&&C.date===(new Date).toDateString()||jQuery.getJSON("https://ipinfo.io").always((function(e){localStorage.setItem("joinchat_country_code",JSON.stringify({code:(null==e?void 0:e.country)||"US",date:(new Date).toDateString()}))})),(0,o.applyFilters)("joinchat_gutenberg_sidebar",!0)&&(0,i.registerPlugin)("joinchat",{icon:u.sidebar,render:()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(c.PluginSidebarMoreMenuItem,{target:"joinchat-sidebar"},(0,a.__)("Join.chat","creame-whatsapp-me")),(0,r.createElement)(c.PluginSidebar,{name:"joinchat-sidebar",title:(0,a.__)("Join.chat","creame-whatsapp-me")},(0,r.createElement)(_,null)))})},184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var i=a.apply(null,n);i&&e.push(i)}}else if("object"===o)if(n.toString===Object.prototype.toString)for(var c in n)r.call(n,c)&&n[c]&&e.push(c);else e.push(n.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},555:function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t){e.exports=n(196)},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var i=a.apply(null,r);i&&e.push(i)}else if("object"===o)for(var c in r)n.call(r,c)&&r[c]&&e.push(c)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(r=function(){return a}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,u=c||l||Function("return this")(),s=Object.prototype.toString,f=u.Symbol,d=f?f.prototype:void 0,p=d?d.toString:void 0;function h(e){if("string"==typeof e)return e;if(y(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}function v(e){return e?(e=function(e){if("number"==typeof e)return e;if(y(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var c=a.test(e);return c||o.test(e)?i(e.slice(2),c?2:8):r.test(e)?NaN:+e}(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}e.exports=function(e,t,n){var r,a,o;return e=null==(r=e)?"":h(r),a=function(e){var t=v(e),n=t%1;return t==t?n?t-n:t:0}(n),o=e.length,a==a&&(void 0!==o&&(a=a<=o?a:o),a=a>=0?a:0),n=a,t=h(t),e.slice(n,n+t.length)==t}}).call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(t){var n,r=/^\[object .+?Constructor\]$/,a="object"==typeof t&&t&&t.Object===Object&&t,o="object"==typeof self&&self&&self.Object===Object&&self,i=a||o||Function("return this")(),c=Array.prototype,l=Function.prototype,u=Object.prototype,s=i["__core-js_shared__"],f=(n=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",d=l.toString,p=u.hasOwnProperty,h=u.toString,m=RegExp("^"+d.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),y=c.splice,v=E(i,"Map"),b=E(Object,"create");function g(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function C(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function w(e,t){for(var n,r,a=e.length;a--;)if((n=e[a][0])===(r=t)||n!=n&&r!=r)return a;return-1}function S(e){return!(!N(e)||(t=e,f&&f in t))&&(function(e){var t=N(e)?h.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?m:r).test(function(e){if(null!=e){try{return d.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function j(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function E(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return S(n)?n:void 0}function x(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i),i};return n.cache=new(x.Cache||C),n}function N(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}g.prototype.clear=function(){this.__data__=b?b(null):{}},g.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},g.prototype.get=function(e){var t=this.__data__;if(b){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return p.call(t,e)?t[e]:void 0},g.prototype.has=function(e){var t=this.__data__;return b?void 0!==t[e]:p.call(t,e)},g.prototype.set=function(e,t){return this.__data__[e]=b&&void 0===t?"__lodash_hash_undefined__":t,this},_.prototype.clear=function(){this.__data__=[]},_.prototype.delete=function(e){var t=this.__data__,n=w(t,e);return!(n<0||(n==t.length-1?t.pop():y.call(t,n,1),0))},_.prototype.get=function(e){var t=this.__data__,n=w(t,e);return n<0?void 0:t[n][1]},_.prototype.has=function(e){return w(this.__data__,e)>-1},_.prototype.set=function(e,t){var n=this.__data__,r=w(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},C.prototype.clear=function(){this.__data__={hash:new g,map:new(v||_),string:new g}},C.prototype.delete=function(e){return j(this,e).delete(e)},C.prototype.get=function(e){return j(this,e).get(e)},C.prototype.has=function(e){return j(this,e).has(e)},C.prototype.set=function(e,t){return j(this,e).set(e,t),this},x.Cache=C,e.exports=x}).call(this,n(3))},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,u=c||l||Function("return this")(),s=Object.prototype.toString,f=Math.max,d=Math.min,p=function(){return u.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var c=a.test(e);return c||o.test(e)?i(e.slice(2),c?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,a,o,i,c,l,u=0,s=!1,y=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,o=a;return r=a=void 0,u=t,i=e.apply(o,n)}function g(e){return u=e,c=setTimeout(C,t),s?b(e):i}function _(e){var n=e-l;return void 0===l||n>=t||n<0||y&&e-u>=o}function C(){var e=p();if(_(e))return w(e);c=setTimeout(C,function(e){var n=t-(e-l);return y?d(n,o-(e-u)):n}(e))}function w(e){return c=void 0,v&&r?b(e):(r=a=void 0,i)}function S(){var e=p(),n=_(e);if(r=arguments,a=this,l=e,n){if(void 0===c)return g(l);if(y)return c=setTimeout(C,t),b(l)}return void 0===c&&(c=setTimeout(C,t)),i}return t=m(t)||0,h(n)&&(s=!!n.leading,o=(y="maxWait"in n)?f(m(n.maxWait)||0,t):o,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==c&&clearTimeout(c),u=0,r=l=a=c=void 0},S.flush=function(){return void 0===c?i:w(p())},S}}).call(this,n(3))},function(e,t,n){(function(e,n){var r="[object Arguments]",a="[object Map]",o="[object Object]",i="[object Set]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,h={};h["[object Float32Array]"]=h["[object Float64Array]"]=h["[object Int8Array]"]=h["[object Int16Array]"]=h["[object Int32Array]"]=h["[object Uint8Array]"]=h["[object Uint8ClampedArray]"]=h["[object Uint16Array]"]=h["[object Uint32Array]"]=!0,h[r]=h["[object Array]"]=h["[object ArrayBuffer]"]=h["[object Boolean]"]=h["[object DataView]"]=h["[object Date]"]=h["[object Error]"]=h["[object Function]"]=h[a]=h["[object Number]"]=h[o]=h["[object RegExp]"]=h[i]=h["[object String]"]=h["[object WeakMap]"]=!1;var m="object"==typeof e&&e&&e.Object===Object&&e,y="object"==typeof self&&self&&self.Object===Object&&self,v=m||y||Function("return this")(),b=t&&!t.nodeType&&t,g=b&&"object"==typeof n&&n&&!n.nodeType&&n,_=g&&g.exports===b&&m.process,C=function(){try{return _&&_.binding("util")}catch(e){}}(),w=C&&C.isTypedArray;function S(e,t,n,r){var a=-1,o=e?e.length:0;for(r&&o&&(n=e[++a]);++a<o;)n=t(n,e[a],a,e);return n}function j(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function E(e,t,n,r,a){return a(e,(function(e,a,o){n=r?(r=!1,e):t(n,e,a,o)})),n}function x(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function N(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function O(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var k,T,A,I=Array.prototype,P=Function.prototype,D=Object.prototype,F=v["__core-js_shared__"],M=(k=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",R=P.toString,L=D.hasOwnProperty,B=D.toString,z=RegExp("^"+R.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=v.Symbol,G=v.Uint8Array,$=D.propertyIsEnumerable,q=I.splice,H=(T=Object.keys,A=Object,function(e){return T(A(e))}),J=we(v,"DataView"),U=we(v,"Map"),Z=we(v,"Promise"),K=we(v,"Set"),W=we(v,"WeakMap"),Q=we(Object,"create"),Y=Te(J),X=Te(U),ee=Te(Z),te=Te(K),ne=Te(W),re=V?V.prototype:void 0,ae=re?re.valueOf:void 0,oe=re?re.toString:void 0;function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ce(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function le(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ue(e){var t=-1,n=e?e.length:0;for(this.__data__=new le;++t<n;)this.add(e[t])}function se(e){this.__data__=new ce(e)}function fe(e,t){for(var n=e.length;n--;)if(Ie(e[n][0],t))return n;return-1}ie.prototype.clear=function(){this.__data__=Q?Q(null):{}},ie.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ie.prototype.get=function(e){var t=this.__data__;if(Q){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return L.call(t,e)?t[e]:void 0},ie.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:L.call(t,e)},ie.prototype.set=function(e,t){return this.__data__[e]=Q&&void 0===t?"__lodash_hash_undefined__":t,this},ce.prototype.clear=function(){this.__data__=[]},ce.prototype.delete=function(e){var t=this.__data__,n=fe(t,e);return!(n<0||(n==t.length-1?t.pop():q.call(t,n,1),0))},ce.prototype.get=function(e){var t=this.__data__,n=fe(t,e);return n<0?void 0:t[n][1]},ce.prototype.has=function(e){return fe(this.__data__,e)>-1},ce.prototype.set=function(e,t){var n=this.__data__,r=fe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},le.prototype.clear=function(){this.__data__={hash:new ie,map:new(U||ce),string:new ie}},le.prototype.delete=function(e){return Ce(this,e).delete(e)},le.prototype.get=function(e){return Ce(this,e).get(e)},le.prototype.has=function(e){return Ce(this,e).has(e)},le.prototype.set=function(e,t){return Ce(this,e).set(e,t),this},ue.prototype.add=ue.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ue.prototype.has=function(e){return this.__data__.has(e)},se.prototype.clear=function(){this.__data__=new ce},se.prototype.delete=function(e){return this.__data__.delete(e)},se.prototype.get=function(e){return this.__data__.get(e)},se.prototype.has=function(e){return this.__data__.has(e)},se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ce){var r=n.__data__;if(!U||r.length<199)return r.push([e,t]),this;n=this.__data__=new le(r)}return n.set(e,t),this};var de,pe=(de=function(e,t){return e&&he(e,t,Ge)},function(e,t){if(null==e)return e;if(!Fe(e))return de(e,t);for(var n=e.length,r=-1,a=Object(e);++r<n&&!1!==t(a[r],r,a););return e}),he=function(e,t,n){for(var r=-1,a=Object(e),o=n(e),i=o.length;i--;){var c=o[++r];if(!1===t(a[c],c,a))break}return e};function me(e,t){for(var n=0,r=(t=Ee(t,e)?[t]:ge(t)).length;null!=e&&n<r;)e=e[ke(t[n++])];return n&&n==r?e:void 0}function ye(e,t){return null!=e&&t in Object(e)}function ve(e,t,n,c,l){return e===t||(null==e||null==t||!Le(e)&&!Be(t)?e!=e&&t!=t:function(e,t,n,c,l,u){var s=De(e),f=De(t),d="[object Array]",p="[object Array]";s||(d=(d=Se(e))==r?o:d),f||(p=(p=Se(t))==r?o:p);var h=d==o&&!x(e),m=p==o&&!x(t),y=d==p;if(y&&!h)return u||(u=new se),s||Ve(e)?_e(e,t,n,c,l,u):function(e,t,n,r,o,c,l){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new G(e),new G(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ie(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case a:var u=N;case i:var s=2&c;if(u||(u=O),e.size!=t.size&&!s)return!1;var f=l.get(e);if(f)return f==t;c|=1,l.set(e,t);var d=_e(u(e),u(t),r,o,c,l);return l.delete(e),d;case"[object Symbol]":if(ae)return ae.call(e)==ae.call(t)}return!1}(e,t,d,n,c,l,u);if(!(2&l)){var v=h&&L.call(e,"__wrapped__"),b=m&&L.call(t,"__wrapped__");if(v||b){var g=v?e.value():e,_=b?t.value():t;return u||(u=new se),n(g,_,c,l,u)}}return!!y&&(u||(u=new se),function(e,t,n,r,a,o){var i=2&a,c=Ge(e),l=c.length;if(l!=Ge(t).length&&!i)return!1;for(var u=l;u--;){var s=c[u];if(!(i?s in t:L.call(t,s)))return!1}var f=o.get(e);if(f&&o.get(t))return f==t;var d=!0;o.set(e,t),o.set(t,e);for(var p=i;++u<l;){var h=e[s=c[u]],m=t[s];if(r)var y=i?r(m,h,s,t,e,o):r(h,m,s,e,t,o);if(!(void 0===y?h===m||n(h,m,r,a,o):y)){d=!1;break}p||(p="constructor"==s)}if(d&&!p){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(d=!1)}return o.delete(e),o.delete(t),d}(e,t,n,c,l,u))}(e,t,ve,n,c,l))}function be(e){return"function"==typeof e?e:null==e?$e:"object"==typeof e?De(e)?function(e,t){return Ee(e)&&xe(t)?Ne(ke(e),t):function(n){var r=function(e,t,n){var r=null==e?void 0:me(e,t);return void 0===r?void 0:r}(n,e);return void 0===r&&r===t?function(e,t){return null!=e&&function(e,t,n){for(var r,a=-1,o=(t=Ee(t,e)?[t]:ge(t)).length;++a<o;){var i=ke(t[a]);if(!(r=null!=e&&n(e,i)))break;e=e[i]}return r||!!(o=e?e.length:0)&&Re(o)&&je(i,o)&&(De(e)||Pe(e))}(e,t,ye)}(n,e):ve(t,r,void 0,3)}}(e[0],e[1]):function(e){var t=function(e){for(var t=Ge(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,xe(a)]}return t}(e);return 1==t.length&&t[0][2]?Ne(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var a=n.length,o=a;if(null==e)return!o;for(e=Object(e);a--;){var i=n[a];if(i[2]?i[1]!==e[i[0]]:!(i[0]in e))return!1}for(;++a<o;){var c=(i=n[a])[0],l=e[c],u=i[1];if(i[2]){if(void 0===l&&!(c in e))return!1}else if(!ve(u,l,undefined,3,new se))return!1}return!0}(n,0,t)}}(e):Ee(t=e)?(n=ke(t),function(e){return null==e?void 0:e[n]}):function(e){return function(t){return me(t,e)}}(t);var t,n}function ge(e){return De(e)?e:Oe(e)}function _e(e,t,n,r,a,o){var i=2&a,c=e.length,l=t.length;if(c!=l&&!(i&&l>c))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var s=-1,f=!0,d=1&a?new ue:void 0;for(o.set(e,t),o.set(t,e);++s<c;){var p=e[s],h=t[s];if(r)var m=i?r(h,p,s,t,e,o):r(p,h,s,e,t,o);if(void 0!==m){if(m)continue;f=!1;break}if(d){if(!j(t,(function(e,t){if(!d.has(t)&&(p===e||n(p,e,r,a,o)))return d.add(t)}))){f=!1;break}}else if(p!==h&&!n(p,h,r,a,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function Ce(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function we(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Le(e)||function(e){return!!M&&M in e}(e))&&(Me(e)||x(e)?z:d).test(Te(e))}(n)?n:void 0}var Se=function(e){return B.call(e)};function je(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||p.test(e))&&e>-1&&e%1==0&&e<t}function Ee(e,t){if(De(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ze(e))||l.test(e)||!c.test(e)||null!=t&&e in Object(t)}function xe(e){return e==e&&!Le(e)}function Ne(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}(J&&"[object DataView]"!=Se(new J(new ArrayBuffer(1)))||U&&Se(new U)!=a||Z&&"[object Promise]"!=Se(Z.resolve())||K&&Se(new K)!=i||W&&"[object WeakMap]"!=Se(new W))&&(Se=function(e){var t=B.call(e),n=t==o?e.constructor:void 0,r=n?Te(n):void 0;if(r)switch(r){case Y:return"[object DataView]";case X:return a;case ee:return"[object Promise]";case te:return i;case ne:return"[object WeakMap]"}return t});var Oe=Ae((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ze(e))return oe?oe.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(s,(function(e,t,r,a){n.push(r?a.replace(f,"$1"):t||e)})),n}));function ke(e){if("string"==typeof e||ze(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Te(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ae(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i),i};return n.cache=new(Ae.Cache||le),n}function Ie(e,t){return e===t||e!=e&&t!=t}function Pe(e){return function(e){return Be(e)&&Fe(e)}(e)&&L.call(e,"callee")&&(!$.call(e,"callee")||B.call(e)==r)}Ae.Cache=le;var De=Array.isArray;function Fe(e){return null!=e&&Re(e.length)&&!Me(e)}function Me(e){var t=Le(e)?B.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function Re(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Le(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Be(e){return!!e&&"object"==typeof e}function ze(e){return"symbol"==typeof e||Be(e)&&"[object Symbol]"==B.call(e)}var Ve=w?function(e){return function(t){return e(t)}}(w):function(e){return Be(e)&&Re(e.length)&&!!h[B.call(e)]};function Ge(e){return Fe(e)?function(e,t){var n=De(e)||Pe(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,a=!!r;for(var o in e)!L.call(e,o)||a&&("length"==o||je(o,r))||n.push(o);return n}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||D))return H(e);var t,n,r=[];for(var a in Object(e))L.call(e,a)&&"constructor"!=a&&r.push(a);return r}(e)}function $e(e){return e}n.exports=function(e,t,n){var r=De(e)?S:E,a=arguments.length<3;return r(e,be(t),n,a,pe)}}).call(this,n(3),n(7)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return e>>=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),String(this)+t.slice(0,e))})},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e){if(Array.isArray(e))return e}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){return(s="function"==typeof Symbol&&"symbol"===u(Symbol.iterator)?function(e){return u(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":u(e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.r(t);var h=n(0),m=n.n(h),y=n(5),v=n.n(y),b=n(4),g=n.n(b),_=n(6),C=n.n(_),w=n(2),S=n.n(w),j=n(1),E=n.n(j);function x(e,t){return i(e)||function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}return n}(e,t)||c()}n(8);var N=[["Afghanistan",["asia"],"af","93"],["Albania",["europe"],"al","355"],["Algeria",["africa","north-africa"],"dz","213"],["Andorra",["europe"],"ad","376"],["Angola",["africa"],"ao","244"],["Antigua and Barbuda",["america","carribean"],"ag","1268"],["Argentina",["america","south-america"],"ar","54","(..) ........",0,["11","221","223","261","264","2652","280","2905","291","2920","2966","299","341","342","343","351","376","379","381","3833","385","387","388"]],["Armenia",["asia","ex-ussr"],"am","374",".. ......"],["Aruba",["america","carribean"],"aw","297"],["Australia",["oceania"],"au","61","(..) .... ....",0,["2","3","4","7","8","02","03","04","07","08"]],["Austria",["europe","eu-union"],"at","43"],["Azerbaijan",["asia","ex-ussr"],"az","994","(..) ... .. .."],["Bahamas",["america","carribean"],"bs","1242"],["Bahrain",["middle-east"],"bh","973"],["Bangladesh",["asia"],"bd","880"],["Barbados",["america","carribean"],"bb","1246"],["Belarus",["europe","ex-ussr"],"by","375","(..) ... .. .."],["Belgium",["europe","eu-union"],"be","32","... .. .. .."],["Belize",["america","central-america"],"bz","501"],["Benin",["africa"],"bj","229"],["Bhutan",["asia"],"bt","975"],["Bolivia",["america","south-america"],"bo","591"],["Bosnia and Herzegovina",["europe","ex-yugos"],"ba","387"],["Botswana",["africa"],"bw","267"],["Brazil",["america","south-america"],"br","55","(..) ........."],["British Indian Ocean Territory",["asia"],"io","246"],["Brunei",["asia"],"bn","673"],["Bulgaria",["europe","eu-union"],"bg","359"],["Burkina Faso",["africa"],"bf","226"],["Burundi",["africa"],"bi","257"],["Cambodia",["asia"],"kh","855"],["Cameroon",["africa"],"cm","237"],["Canada",["america","north-america"],"ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde",["africa"],"cv","238"],["Caribbean Netherlands",["america","carribean"],"bq","599","",1],["Central African Republic",["africa"],"cf","236"],["Chad",["africa"],"td","235"],["Chile",["america","south-america"],"cl","56"],["China",["asia"],"cn","86","..-........."],["Colombia",["america","south-america"],"co","57","... ... ...."],["Comoros",["africa"],"km","269"],["Congo",["africa"],"cd","243"],["Congo",["africa"],"cg","242"],["Costa Rica",["america","central-america"],"cr","506","....-...."],["Côte d’Ivoire",["africa"],"ci","225",".. .. .. .."],["Croatia",["europe","eu-union","ex-yugos"],"hr","385"],["Cuba",["america","carribean"],"cu","53"],["Curaçao",["america","carribean"],"cw","599","",0],["Cyprus",["europe","eu-union"],"cy","357",".. ......"],["Czech Republic",["europe","eu-union"],"cz","420","... ... ..."],["Denmark",["europe","eu-union","baltic"],"dk","45",".. .. .. .."],["Djibouti",["africa"],"dj","253"],["Dominica",["america","carribean"],"dm","1767"],["Dominican Republic",["america","carribean"],"do","1","",2,["809","829","849"]],["Ecuador",["america","south-america"],"ec","593"],["Egypt",["africa","north-africa"],"eg","20"],["El Salvador",["america","central-america"],"sv","503","....-...."],["Equatorial Guinea",["africa"],"gq","240"],["Eritrea",["africa"],"er","291"],["Estonia",["europe","eu-union","ex-ussr","baltic"],"ee","372",".... ......"],["Ethiopia",["africa"],"et","251"],["Fiji",["oceania"],"fj","679"],["Finland",["europe","eu-union","baltic"],"fi","358",".. ... .. .."],["France",["europe","eu-union"],"fr","33",". .. .. .. .."],["French Guiana",["america","south-america"],"gf","594"],["French Polynesia",["oceania"],"pf","689"],["Gabon",["africa"],"ga","241"],["Gambia",["africa"],"gm","220"],["Georgia",["asia","ex-ussr"],"ge","995"],["Germany",["europe","eu-union","baltic"],"de","49",".... ........"],["Ghana",["africa"],"gh","233"],["Greece",["europe","eu-union"],"gr","30"],["Grenada",["america","carribean"],"gd","1473"],["Guadeloupe",["america","carribean"],"gp","590","",0],["Guam",["oceania"],"gu","1671"],["Guatemala",["america","central-america"],"gt","502","....-...."],["Guinea",["africa"],"gn","224"],["Guinea-Bissau",["africa"],"gw","245"],["Guyana",["america","south-america"],"gy","592"],["Haiti",["america","carribean"],"ht","509","....-...."],["Honduras",["america","central-america"],"hn","504"],["Hong Kong",["asia"],"hk","852",".... ...."],["Hungary",["europe","eu-union"],"hu","36"],["Iceland",["europe"],"is","354","... ...."],["India",["asia"],"in","91",".....-....."],["Indonesia",["asia"],"id","62"],["Iran",["middle-east"],"ir","98","... ... ...."],["Iraq",["middle-east"],"iq","964"],["Ireland",["europe","eu-union"],"ie","353",".. ......."],["Israel",["middle-east"],"il","972","... ... ...."],["Italy",["europe","eu-union"],"it","39","... .......",0],["Jamaica",["america","carribean"],"jm","1876"],["Japan",["asia"],"jp","81",".. .... ...."],["Jordan",["middle-east"],"jo","962"],["Kazakhstan",["asia","ex-ussr"],"kz","7","... ...-..-..",1,["310","311","312","313","315","318","321","324","325","326","327","336","7172","73622"]],["Kenya",["africa"],"ke","254"],["Kiribati",["oceania"],"ki","686"],["Kosovo",["europe","ex-yugos"],"xk","383"],["Kuwait",["middle-east"],"kw","965"],["Kyrgyzstan",["asia","ex-ussr"],"kg","996","... ... ..."],["Laos",["asia"],"la","856"],["Latvia",["europe","eu-union","ex-ussr","baltic"],"lv","371",".. ... ..."],["Lebanon",["middle-east"],"lb","961"],["Lesotho",["africa"],"ls","266"],["Liberia",["africa"],"lr","231"],["Libya",["africa","north-africa"],"ly","218"],["Liechtenstein",["europe"],"li","423"],["Lithuania",["europe","eu-union","ex-ussr","baltic"],"lt","370"],["Luxembourg",["europe","eu-union"],"lu","352"],["Macau",["asia"],"mo","853"],["Macedonia",["europe","ex-yugos"],"mk","389"],["Madagascar",["africa"],"mg","261"],["Malawi",["africa"],"mw","265"],["Malaysia",["asia"],"my","60","..-....-...."],["Maldives",["asia"],"mv","960"],["Mali",["africa"],"ml","223"],["Malta",["europe","eu-union"],"mt","356"],["Marshall Islands",["oceania"],"mh","692"],["Martinique",["america","carribean"],"mq","596"],["Mauritania",["africa"],"mr","222"],["Mauritius",["africa"],"mu","230"],["Mexico",["america","central-america"],"mx","52","... ... ....",0,["55","81","33","656","664","998","774","229"]],["Micronesia",["oceania"],"fm","691"],["Moldova",["europe"],"md","373","(..) ..-..-.."],["Monaco",["europe"],"mc","377"],["Mongolia",["asia"],"mn","976"],["Montenegro",["europe","ex-yugos"],"me","382"],["Morocco",["africa","north-africa"],"ma","212"],["Mozambique",["africa"],"mz","258"],["Myanmar",["asia"],"mm","95"],["Namibia",["africa"],"na","264"],["Nauru",["africa"],"nr","674"],["Nepal",["asia"],"np","977"],["Netherlands",["europe","eu-union"],"nl","31",".. ........"],["New Caledonia",["oceania"],"nc","687"],["New Zealand",["oceania"],"nz","64","...-...-...."],["Nicaragua",["america","central-america"],"ni","505"],["Niger",["africa"],"ne","227"],["Nigeria",["africa"],"ng","234"],["North Korea",["asia"],"kp","850"],["Norway",["europe","baltic"],"no","47","... .. ..."],["Oman",["middle-east"],"om","968"],["Pakistan",["asia"],"pk","92","...-......."],["Palau",["oceania"],"pw","680"],["Palestine",["middle-east"],"ps","970"],["Panama",["america","central-america"],"pa","507"],["Papua New Guinea",["oceania"],"pg","675"],["Paraguay",["america","south-america"],"py","595"],["Peru",["america","south-america"],"pe","51"],["Philippines",["asia"],"ph","63",".... ......."],["Poland",["europe","eu-union","baltic"],"pl","48","...-...-..."],["Portugal",["europe","eu-union"],"pt","351"],["Puerto Rico",["america","carribean"],"pr","1","",3,["787","939"]],["Qatar",["middle-east"],"qa","974"],["Réunion",["africa"],"re","262"],["Romania",["europe","eu-union"],"ro","40"],["Russia",["europe","asia","ex-ussr","baltic"],"ru","7","(...) ...-..-..",0],["Rwanda",["africa"],"rw","250"],["Saint Kitts and Nevis",["america","carribean"],"kn","1869"],["Saint Lucia",["america","carribean"],"lc","1758"],["Saint Vincent and the Grenadines",["america","carribean"],"vc","1784"],["Samoa",["oceania"],"ws","685"],["San Marino",["europe"],"sm","378"],["São Tomé and Príncipe",["africa"],"st","239"],["Saudi Arabia",["middle-east"],"sa","966"],["Senegal",["africa"],"sn","221"],["Serbia",["europe","ex-yugos"],"rs","381"],["Seychelles",["africa"],"sc","248"],["Sierra Leone",["africa"],"sl","232"],["Singapore",["asia"],"sg","65","....-...."],["Slovakia",["europe","eu-union"],"sk","421"],["Slovenia",["europe","eu-union","ex-yugos"],"si","386"],["Solomon Islands",["oceania"],"sb","677"],["Somalia",["africa"],"so","252"],["South Africa",["africa"],"za","27"],["South Korea",["asia"],"kr","82","... .... ...."],["South Sudan",["africa","north-africa"],"ss","211"],["Spain",["europe","eu-union"],"es","34","... ... ..."],["Sri Lanka",["asia"],"lk","94"],["Sudan",["africa"],"sd","249"],["Suriname",["america","south-america"],"sr","597"],["Swaziland",["africa"],"sz","268"],["Sweden",["europe","eu-union","baltic"],"se","46","(...) ...-..."],["Switzerland",["europe"],"ch","41",".. ... .. .."],["Syria",["middle-east"],"sy","963"],["Taiwan",["asia"],"tw","886"],["Tajikistan",["asia","ex-ussr"],"tj","992"],["Tanzania",["africa"],"tz","255"],["Thailand",["asia"],"th","66"],["Timor-Leste",["asia"],"tl","670"],["Togo",["africa"],"tg","228"],["Tonga",["oceania"],"to","676"],["Trinidad and Tobago",["america","carribean"],"tt","1868"],["Tunisia",["africa","north-africa"],"tn","216"],["Turkey",["europe"],"tr","90","... ... .. .."],["Turkmenistan",["asia","ex-ussr"],"tm","993"],["Tuvalu",["asia"],"tv","688"],["Uganda",["africa"],"ug","256"],["Ukraine",["europe","ex-ussr"],"ua","380","(..) ... .. .."],["United Arab Emirates",["middle-east"],"ae","971"],["United Kingdom",["europe","eu-union"],"gb","44",".... ......"],["United States",["america","north-america"],"us","1","(...) ...-....",0,["907","205","251","256","334","479","501","870","480","520","602","623","928","209","213","310","323","408","415","510","530","559","562","619","626","650","661","707","714","760","805","818","831","858","909","916","925","949","951","303","719","970","203","860","202","302","239","305","321","352","386","407","561","727","772","813","850","863","904","941","954","229","404","478","706","770","912","808","319","515","563","641","712","208","217","309","312","618","630","708","773","815","847","219","260","317","574","765","812","316","620","785","913","270","502","606","859","225","318","337","504","985","413","508","617","781","978","301","410","207","231","248","269","313","517","586","616","734","810","906","989","218","320","507","612","651","763","952","314","417","573","636","660","816","228","601","662","406","252","336","704","828","910","919","701","308","402","603","201","609","732","856","908","973","505","575","702","775","212","315","516","518","585","607","631","716","718","845","914","216","330","419","440","513","614","740","937","405","580","918","503","541","215","412","570","610","717","724","814","401","803","843","864","605","423","615","731","865","901","931","210","214","254","281","325","361","409","432","512","713","806","817","830","903","915","936","940","956","972","979","435","801","276","434","540","703","757","804","802","206","253","360","425","509","262","414","608","715","920","304","307"]],["Uruguay",["america","south-america"],"uy","598"],["Uzbekistan",["asia","ex-ussr"],"uz","998",".. ... .. .."],["Vanuatu",["oceania"],"vu","678"],["Vatican City",["europe"],"va","39",".. .... ....",1],["Venezuela",["america","south-america"],"ve","58"],["Vietnam",["asia"],"vn","84"],["Yemen",["middle-east"],"ye","967"],["Zambia",["africa"],"zm","260"],["Zimbabwe",["africa"],"zw","263"]],O=[["American Samoa",["oceania"],"as","1684"],["Anguilla",["america","carribean"],"ai","1264"],["Bermuda",["america","north-america"],"bm","1441"],["British Virgin Islands",["america","carribean"],"vg","1284"],["Cayman Islands",["america","carribean"],"ky","1345"],["Cook Islands",["oceania"],"ck","682"],["Falkland Islands",["america","south-america"],"fk","500"],["Faroe Islands",["europe"],"fo","298"],["Gibraltar",["europe"],"gi","350"],["Greenland",["america"],"gl","299"],["Jersey",["europe","eu-union"],"je","44",".... ......"],["Montserrat",["america","carribean"],"ms","1664"],["Niue",["asia"],"nu","683"],["Norfolk Island",["oceania"],"nf","672"],["Northern Mariana Islands",["oceania"],"mp","1670"],["Saint Barthélemy",["america","carribean"],"bl","590","",1],["Saint Helena",["africa"],"sh","290"],["Saint Martin",["america","carribean"],"mf","590","",2],["Saint Pierre and Miquelon",["america","north-america"],"pm","508"],["Sint Maarten",["america","carribean"],"sx","1721"],["Tokelau",["oceania"],"tk","690"],["Turks and Caicos Islands",["america","carribean"],"tc","1649"],["U.S. Virgin Islands",["america","carribean"],"vi","1340"],["Wallis and Futuna",["oceania"],"wf","681"]];function k(e,t,n,r,a){return!n||a?e+"".padEnd(t.length,".")+" "+r:e+"".padEnd(t.length,".")+" "+n}function T(e,t,n,a,i){var c,l,u=[];return l=!0===t,[(c=[]).concat.apply(c,o(e.map((function(e){var o={name:e[0],regions:e[1],iso2:e[2],countryCode:e[3],dialCode:e[3],format:k(n,e[3],e[4],a,i),priority:e[5]||0},c=[];return e[6]&&e[6].map((function(t){var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.forEach((function(t){r(e,t,n[t])}))}return e}({},o);n.dialCode=e[3]+t,n.isAreaCode=!0,n.areaCodeLength=t.length,c.push(n)})),c.length>0?(o.mainCode=!0,l||"Array"===t.constructor.name&&t.includes(e[2])?(o.hasAreaCodes=!0,[o].concat(c)):(u=u.concat(c),[o])):[o]})))),u]}function A(e,t,n,r){if(null!==n){var a=Object.keys(n),o=Object.values(n);a.forEach((function(n,a){if(r)return e.push([n,o[a]]);var i=e.findIndex((function(e){return e[0]===n}));if(-1===i){var c=[n];c[t]=o[a],e.push(c)}else e[i][t]=o[a]}))}}function I(e,t){return 0===t.length?e:e.map((function(e){var n=t.findIndex((function(t){return t[0]===e[2]}));if(-1===n)return e;var r=t[n];return r[1]&&(e[4]=r[1]),r[3]&&(e[5]=r[3]),r[2]&&(e[6]=r[2]),e}))}var P=function e(t,n,r,a,i,c,u,s,f,d,p,h,m,y){l(this,e),this.filterRegions=function(e,t){if("string"==typeof e){var n=e;return t.filter((function(e){return e.regions.some((function(e){return e===n}))}))}return t.filter((function(t){return e.map((function(e){return t.regions.some((function(t){return t===e}))})).some((function(e){return e}))}))},this.sortTerritories=function(e,t){var n=[].concat(o(e),o(t));return n.sort((function(e,t){return e.name<t.name?-1:e.name>t.name?1:0})),n},this.getFilteredCountryList=function(e,t,n){return 0===e.length?t:n?e.map((function(e){var n=t.find((function(t){return t.iso2===e}));if(n)return n})).filter((function(e){return e})):t.filter((function(t){return e.some((function(e){return e===t.iso2}))}))},this.localizeCountries=function(e,t,n){for(var r=0;r<e.length;r++)void 0!==t[e[r].iso2]?e[r].localName=t[e[r].iso2]:void 0!==t[e[r].name]&&(e[r].localName=t[e[r].name]);return n||e.sort((function(e,t){return e.localName<t.localName?-1:e.localName>t.localName?1:0})),e},this.getCustomAreas=function(e,t){for(var n=[],r=0;r<t.length;r++){var a=JSON.parse(JSON.stringify(e));a.dialCode+=t[r],n.push(a)}return n},this.excludeCountries=function(e,t){return 0===t.length?e:e.filter((function(e){return!t.includes(e.iso2)}))};var v=function(e,t,n){var r=[];return A(r,1,e,!0),A(r,3,t),A(r,2,n),r}(s,f,d),b=I(JSON.parse(JSON.stringify(N)),v),g=I(JSON.parse(JSON.stringify(O)),v),_=x(T(b,t,h,m,y),2),C=_[0],w=_[1];if(n){var S=x(T(g,t,h,m,y),2),j=S[0];S[1],C=this.sortTerritories(j,C)}r&&(C=this.filterRegions(r,C)),this.onlyCountries=this.localizeCountries(this.excludeCountries(this.getFilteredCountryList(a,C,u.includes("onlyCountries")),c),p,u.includes("onlyCountries")),this.preferredCountries=0===i.length?[]:this.localizeCountries(this.getFilteredCountryList(i,C,u.includes("preferredCountries")),p,u.includes("preferredCountries")),this.hiddenAreaCodes=this.excludeCountries(this.getFilteredCountryList(a,w),c)},D=function(e){function t(e){var n;l(this,t),(n=function(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?f(e):t}(this,d(t).call(this,e))).getProbableCandidate=g()((function(e){return e&&0!==e.length?n.state.onlyCountries.filter((function(t){return S()(t.name.toLowerCase(),e.toLowerCase())}),f(f(n)))[0]:null})),n.guessSelectedCountry=g()((function(e,t,r,a){var o;if(!1===n.props.enableAreaCodes&&(a.some((function(t){if(S()(e,t.dialCode))return r.some((function(e){if(t.iso2===e.iso2&&e.mainCode)return o=e,!0})),!0})),o))return o;var i=r.find((function(e){return e.iso2==t}));if(""===e.trim())return i;var c=r.reduce((function(t,n){if(S()(e,n.dialCode)){if(n.dialCode.length>t.dialCode.length)return n;if(n.dialCode.length===t.dialCode.length&&n.priority<t.priority)return n}return t}),{dialCode:"",priority:10001},f(f(n)));return c.name?c:i})),n.updateCountry=function(e){var t,r=n.state.onlyCountries;(t=e.indexOf(0)>="0"&&e.indexOf(0)<="9"?r.find((function(t){return t.dialCode==+e})):r.find((function(t){return t.iso2==e})))&&t.dialCode&&n.setState({selectedCountry:t,formattedNumber:n.props.disableCountryCode?"":n.formatNumber(t.dialCode,t)})},n.scrollTo=function(e,t){if(e){var r=n.dropdownRef;if(r&&document.body){var a=r.offsetHeight,o=r.getBoundingClientRect().top+document.body.scrollTop,i=o+a,c=e,l=c.getBoundingClientRect(),u=c.offsetHeight,s=l.top+document.body.scrollTop,f=s+u,d=s-o+r.scrollTop,p=a/2-u/2;if(n.props.enableSearch?s<o+32:s<o)t&&(d-=p),r.scrollTop=d;else if(f>i){t&&(d+=p);var h=a-u;r.scrollTop=d-h}}}},n.scrollToTop=function(){var e=n.dropdownRef;e&&document.body&&(e.scrollTop=0)},n.formatNumber=function(e,t){if(!t)return e;var r,o=t.format,l=n.props,u=l.disableCountryCode,s=l.enableAreaCodeStretch,f=l.enableLongNumbers,d=l.autoFormat;if(u?((r=o.split(" ")).shift(),r=r.join(" ")):s&&t.isAreaCode?((r=o.split(" "))[1]=r[1].replace(/\.+/,"".padEnd(t.areaCodeLength,".")),r=r.join(" ")):r=o,!e||0===e.length)return u?"":n.props.prefix;if(e&&e.length<2||!r||!d)return u?e:n.props.prefix+e;var p,h=C()(r,(function(e,t){if(0===e.remainingText.length)return e;if("."!==t)return{formattedText:e.formattedText+t,remainingText:e.remainingText};var n,r=i(n=e.remainingText)||a(n)||c(),o=r[0],l=r.slice(1);return{formattedText:e.formattedText+o,remainingText:l}}),{formattedText:"",remainingText:e.split("")});return(p=f?h.formattedText+h.remainingText.join(""):h.formattedText).includes("(")&&!p.includes(")")&&(p+=")"),p},n.cursorToEnd=function(){var e=n.numberInputRef;if(document.activeElement===e){e.focus();var t=e.value.length;")"===e.value.charAt(t-1)&&(t-=1),e.setSelectionRange(t,t)}},n.getElement=function(e){return n["flag_no_".concat(e)]},n.getCountryData=function(){return n.state.selectedCountry?{name:n.state.selectedCountry.name||"",dialCode:n.state.selectedCountry.dialCode||"",countryCode:n.state.selectedCountry.iso2||"",format:n.state.selectedCountry.format||""}:{}},n.handleFlagDropdownClick=function(e){if(e.preventDefault(),n.state.showDropdown||!n.props.disabled){var t=n.state,r=t.preferredCountries,a=t.onlyCountries,o=t.selectedCountry,i=n.concatPreferredCountries(r,a).findIndex((function(e){return e.dialCode===o.dialCode&&e.iso2===o.iso2}));n.setState({showDropdown:!n.state.showDropdown,highlightCountryIndex:i},(function(){n.state.showDropdown&&n.scrollTo(n.getElement(n.state.highlightCountryIndex))}))}},n.handleInput=function(e){var t=e.target.value,r=n.props,a=r.prefix,o=r.onChange,i=n.props.disableCountryCode?"":a,c=n.state.selectedCountry,l=n.state.freezeSelection;if(!n.props.countryCodeEditable){var u=a+(c.hasAreaCodes?n.state.onlyCountries.find((function(e){return e.iso2===c.iso2&&e.mainCode})).dialCode:c.dialCode);if(t.slice(0,u.length)!==u)return}if(t===a)return o&&o("",n.getCountryData(),e,""),n.setState({formattedNumber:""});if(t.replace(/\D/g,"").length>15){if(!1===n.props.enableLongNumbers)return;if("number"==typeof n.props.enableLongNumbers&&t.replace(/\D/g,"").length>n.props.enableLongNumbers)return}if(t!==n.state.formattedNumber){e.preventDefault?e.preventDefault():e.returnValue=!1;var s=n.props.country,f=n.state,d=f.onlyCountries,p=f.selectedCountry,h=f.hiddenAreaCodes;if(o&&e.persist(),t.length>0){var m=t.replace(/\D/g,"");(!n.state.freezeSelection||p&&p.dialCode.length>m.length)&&(c=n.props.disableCountryGuess?p:n.guessSelectedCountry(m.substring(0,6),s,d,h)||p,l=!1),i=n.formatNumber(m,c),c=c.dialCode?c:p}var y=e.target.selectionStart,v=e.target.selectionStart,b=n.state.formattedNumber,g=i.length-b.length;n.setState({formattedNumber:i,freezeSelection:l,selectedCountry:c},(function(){g>0&&(v-=g),")"==i.charAt(i.length-1)?n.numberInputRef.setSelectionRange(i.length-1,i.length-1):v>0&&b.length>=i.length?n.numberInputRef.setSelectionRange(v,v):y<b.length&&n.numberInputRef.setSelectionRange(y,y),o&&o(i.replace(/[^0-9]+/g,""),n.getCountryData(),e,i)}))}},n.handleInputClick=function(e){n.setState({showDropdown:!1}),n.props.onClick&&n.props.onClick(e,n.getCountryData())},n.handleDoubleClick=function(e){var t=e.target.value.length;e.target.setSelectionRange(0,t)},n.handleFlagItemClick=function(e,t){var r=n.state.selectedCountry,a=n.state.onlyCountries.find((function(t){return t==e}));if(a){var o=n.state.formattedNumber.replace(" ","").replace("(","").replace(")","").replace("-",""),i=o.length>1?o.replace(r.dialCode,a.dialCode):a.dialCode,c=n.formatNumber(i.replace(/\D/g,""),a);n.setState({showDropdown:!1,selectedCountry:a,freezeSelection:!0,formattedNumber:c,searchValue:""},(function(){n.cursorToEnd(),n.props.onChange&&n.props.onChange(c.replace(/[^0-9]+/g,""),n.getCountryData(),t,c)}))}},n.handleInputFocus=function(e){n.numberInputRef&&n.numberInputRef.value===n.props.prefix&&n.state.selectedCountry&&!n.props.disableCountryCode&&n.setState({formattedNumber:n.props.prefix+n.state.selectedCountry.dialCode},(function(){n.props.jumpCursorToEnd&&setTimeout(n.cursorToEnd,0)})),n.setState({placeholder:""}),n.props.onFocus&&n.props.onFocus(e,n.getCountryData()),n.props.jumpCursorToEnd&&setTimeout(n.cursorToEnd,0)},n.handleInputBlur=function(e){e.target.value||n.setState({placeholder:n.props.placeholder}),n.props.onBlur&&n.props.onBlur(e,n.getCountryData())},n.handleInputCopy=function(e){if(n.props.copyNumbersOnly){var t=window.getSelection().toString().replace(/[^0-9]+/g,"");e.clipboardData.setData("text/plain",t),e.preventDefault()}},n.getHighlightCountryIndex=function(e){var t=n.state.highlightCountryIndex+e;return t<0||t>=n.state.onlyCountries.length+n.state.preferredCountries.length?t-e:n.props.enableSearch&&t>n.getSearchFilteredCountries().length?0:t},n.searchCountry=function(){var e=n.getProbableCandidate(n.state.queryString)||n.state.onlyCountries[0],t=n.state.onlyCountries.findIndex((function(t){return t==e}))+n.state.preferredCountries.length;n.scrollTo(n.getElement(t),!0),n.setState({queryString:"",highlightCountryIndex:t})},n.handleKeydown=function(e){var t=n.props.keys,r=e.target.className;if(r.includes("selected-flag")&&e.which===t.ENTER&&!n.state.showDropdown)return n.handleFlagDropdownClick(e);if(r.includes("form-control")&&(e.which===t.ENTER||e.which===t.ESC))return e.target.blur();if(n.state.showDropdown&&!n.props.disabled&&(!r.includes("search-box")||e.which===t.UP||e.which===t.DOWN||e.which===t.ENTER||e.which===t.ESC&&""===e.target.value)){e.preventDefault?e.preventDefault():e.returnValue=!1;var a=function(e){n.setState({highlightCountryIndex:n.getHighlightCountryIndex(e)},(function(){n.scrollTo(n.getElement(n.state.highlightCountryIndex),!0)}))};switch(e.which){case t.DOWN:a(1);break;case t.UP:a(-1);break;case t.ENTER:n.props.enableSearch?n.handleFlagItemClick(n.getSearchFilteredCountries()[n.state.highlightCountryIndex]||n.getSearchFilteredCountries()[0],e):n.handleFlagItemClick([].concat(o(n.state.preferredCountries),o(n.state.onlyCountries))[n.state.highlightCountryIndex],e);break;case t.ESC:case t.TAB:n.setState({showDropdown:!1},n.cursorToEnd);break;default:(e.which>=t.A&&e.which<=t.Z||e.which===t.SPACE)&&n.setState({queryString:n.state.queryString+String.fromCharCode(e.which)},n.state.debouncedQueryStingSearcher)}}},n.handleInputKeyDown=function(e){var t=n.props,r=t.keys,a=t.onEnterKeyPress,o=t.onKeyDown;e.which===r.ENTER&&a&&a(e),o&&o(e)},n.handleClickOutside=function(e){n.dropdownRef&&!n.dropdownContainerRef.contains(e.target)&&n.state.showDropdown&&n.setState({showDropdown:!1})},n.handleSearchChange=function(e){var t=e.currentTarget.value,r=n.state,a=r.preferredCountries,o=r.selectedCountry,i=0;if(""===t&&o){var c=n.state.onlyCountries;i=n.concatPreferredCountries(a,c).findIndex((function(e){return e==o})),setTimeout((function(){return n.scrollTo(n.getElement(i))}),100)}n.setState({searchValue:t,highlightCountryIndex:i})},n.concatPreferredCountries=function(e,t){return e.length>0?o(new Set(e.concat(t))):t},n.getDropdownCountryName=function(e){return e.localName||e.name},n.getSearchFilteredCountries=function(){var e=n.state,t=e.preferredCountries,r=e.onlyCountries,a=e.searchValue,i=n.props.enableSearch,c=n.concatPreferredCountries(t,r),l=a.trim().toLowerCase().replace("+","");if(i&&l){if(/^\d+$/.test(l))return c.filter((function(e){var t=e.dialCode;return["".concat(t)].some((function(e){return e.toLowerCase().includes(l)}))}));var u=c.filter((function(e){var t=e.iso2;return["".concat(t)].some((function(e){return e.toLowerCase().includes(l)}))})),s=c.filter((function(e){var t=e.name,n=e.localName;return e.iso2,["".concat(t),"".concat(n||"")].some((function(e){return e.toLowerCase().includes(l)}))}));return n.scrollToTop(),o(new Set([].concat(u,s)))}return c},n.getCountryDropdownList=function(){var e=n.state,t=e.preferredCountries,a=e.highlightCountryIndex,o=e.showDropdown,i=e.searchValue,c=n.props,l=c.disableDropdown,u=c.prefix,s=n.props,f=s.enableSearch,d=s.searchNotFound,p=s.disableSearchIcon,h=s.searchClass,y=s.searchStyle,v=s.searchPlaceholder,b=s.autocompleteSearch,g=n.getSearchFilteredCountries().map((function(e,t){var r=a===t,o=E()({country:!0,preferred:"us"===e.iso2||"gb"===e.iso2,active:"us"===e.iso2,highlight:r}),i="flag ".concat(e.iso2);return m.a.createElement("li",Object.assign({ref:function(e){return n["flag_no_".concat(t)]=e},key:"flag_no_".concat(t),"data-flag-key":"flag_no_".concat(t),className:o,"data-dial-code":"1",tabIndex:l?"-1":"0","data-country-code":e.iso2,onClick:function(t){return n.handleFlagItemClick(e,t)},role:"option"},r?{"aria-selected":!0}:{}),m.a.createElement("div",{className:i}),m.a.createElement("span",{className:"country-name"},n.getDropdownCountryName(e)),m.a.createElement("span",{className:"dial-code"},e.format?n.formatNumber(e.dialCode,e):u+e.dialCode))})),_=m.a.createElement("li",{key:"dashes",className:"divider"});t.length>0&&(!f||f&&!i.trim())&&g.splice(t.length,0,_);var C=E()(r({"country-list":!0,hide:!o},n.props.dropdownClass,!0));return m.a.createElement("ul",{ref:function(e){return!f&&e&&e.focus(),n.dropdownRef=e},className:C,style:n.props.dropdownStyle,role:"listbox",tabIndex:"0"},f&&m.a.createElement("li",{className:E()(r({search:!0},h,h))},!p&&m.a.createElement("span",{className:E()(r({"search-emoji":!0},"".concat(h,"-emoji"),h)),role:"img","aria-label":"Magnifying glass"},"🔎"),m.a.createElement("input",{className:E()(r({"search-box":!0},"".concat(h,"-box"),h)),style:y,type:"search",placeholder:v,autoFocus:!0,autoComplete:b?"on":"off",value:i,onChange:n.handleSearchChange})),g.length>0?g:m.a.createElement("li",{className:"no-entries-message"},m.a.createElement("span",null,d)))};var u,p=new P(e.enableAreaCodes,e.enableTerritories,e.regions,e.onlyCountries,e.preferredCountries,e.excludeCountries,e.preserveOrder,e.masks,e.priority,e.areaCodes,e.localization,e.prefix,e.defaultMask,e.alwaysDefaultMask),h=p.onlyCountries,y=p.preferredCountries,b=p.hiddenAreaCodes,_=e.value?e.value.replace(/\D/g,""):"";u=e.disableInitialCountryGuess?0:_.length>1?n.guessSelectedCountry(_.substring(0,6),e.country,h,b)||0:e.country&&h.find((function(t){return t.iso2==e.country}))||0;var w,j=_.length<2&&u&&!S()(_,u.dialCode)?u.dialCode:"";w=""===_&&0===u?"":n.formatNumber((e.disableCountryCode?"":j)+_,u.name?u:void 0);var x=h.findIndex((function(e){return e==u}));return n.state={showDropdown:e.showDropdown,formattedNumber:w,onlyCountries:h,preferredCountries:y,hiddenAreaCodes:b,selectedCountry:u,highlightCountryIndex:x,queryString:"",freezeSelection:!1,debouncedQueryStingSearcher:v()(n.searchCountry,250),searchValue:""},n}var n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,e),(n=[{key:"componentDidMount",value:function(){document.addEventListener&&this.props.enableClickOutside&&document.addEventListener("mousedown",this.handleClickOutside),this.props.onMount&&this.props.onMount(this.state.formattedNumber.replace(/[^0-9]+/g,""),this.getCountryData(),this.state.formattedNumber)}},{key:"componentWillUnmount",value:function(){document.removeEventListener&&this.props.enableClickOutside&&document.removeEventListener("mousedown",this.handleClickOutside)}},{key:"componentDidUpdate",value:function(e,t,n){e.country!==this.props.country?this.updateCountry(this.props.country):e.value!==this.props.value&&this.updateFormattedNumber(this.props.value)}},{key:"updateFormattedNumber",value:function(e){if(null===e)return this.setState({selectedCountry:0,formattedNumber:""});var t=this.state,n=t.onlyCountries,r=t.selectedCountry,a=t.hiddenAreaCodes,o=this.props,i=o.country,c=o.prefix;if(""===e)return this.setState({selectedCountry:r,formattedNumber:""});var l,u,s=e.replace(/\D/g,"");if(r&&S()(e,c+r.dialCode))u=this.formatNumber(s,r),this.setState({formattedNumber:u});else{var f=(l=this.props.disableCountryGuess?r:this.guessSelectedCountry(s.substring(0,6),i,n,a)||r)&&S()(s,c+l.dialCode)?l.dialCode:"";u=this.formatNumber((this.props.disableCountryCode?"":f)+s,l||void 0),this.setState({selectedCountry:l,formattedNumber:u})}}},{key:"render",value:function(){var e,t,n,a=this,o=this.state,i=o.onlyCountries,c=o.selectedCountry,l=o.showDropdown,u=o.formattedNumber,s=o.hiddenAreaCodes,f=this.props,d=f.disableDropdown,p=f.renderStringAsFlag,h=f.isValid,y=f.defaultErrorMessage,v=f.specialLabel;if("boolean"==typeof h)t=h;else{var b=h(u.replace(/\D/g,""),c,i,s);"boolean"==typeof b?!1===(t=b)&&(n=y):(t=!1,n=b)}var g=E()((r(e={},this.props.containerClass,!0),r(e,"react-tel-input",!0),e)),_=E()({arrow:!0,up:l}),C=E()(r({"form-control":!0,"invalid-number":!t,open:l},this.props.inputClass,!0)),w=E()({"selected-flag":!0,open:l}),S=E()(r({"flag-dropdown":!0,"invalid-number":!t,open:l},this.props.buttonClass,!0)),j="flag ".concat(c&&c.iso2);return m.a.createElement("div",{className:"".concat(g," ").concat(this.props.className),style:this.props.style||this.props.containerStyle,onKeyDown:this.handleKeydown},v&&m.a.createElement("div",{className:"special-label"},v),n&&m.a.createElement("div",{className:"invalid-number-message"},n),m.a.createElement("input",Object.assign({className:C,style:this.props.inputStyle,onChange:this.handleInput,onClick:this.handleInputClick,onDoubleClick:this.handleDoubleClick,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onCopy:this.handleInputCopy,value:u,onKeyDown:this.handleInputKeyDown,placeholder:this.props.placeholder,disabled:this.props.disabled,type:"tel"},this.props.inputProps,{ref:function(e){a.numberInputRef=e,"function"==typeof a.props.inputProps.ref?a.props.inputProps.ref(e):"object"==typeof a.props.inputProps.ref&&(a.props.inputProps.ref.current=e)}})),m.a.createElement("div",{className:S,style:this.props.buttonStyle,ref:function(e){return a.dropdownContainerRef=e}},p?m.a.createElement("div",{className:w},p):m.a.createElement("div",{onClick:d?void 0:this.handleFlagDropdownClick,className:w,title:c?"".concat(c.localName||c.name,": + ").concat(c.dialCode):"",tabIndex:d?"-1":"0",role:"button","aria-haspopup":"listbox","aria-expanded":!!l||void 0},m.a.createElement("div",{className:j},!d&&m.a.createElement("div",{className:_}))),l&&this.getCountryDropdownList()))}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,n),t}(m.a.Component);D.defaultProps={country:"",value:"",onlyCountries:[],preferredCountries:[],excludeCountries:[],placeholder:"1 (702) 123-4567",searchPlaceholder:"search",searchNotFound:"No entries to show",flagsImagePath:"./flags.png",disabled:!1,containerStyle:{},inputStyle:{},buttonStyle:{},dropdownStyle:{},searchStyle:{},containerClass:"",inputClass:"",buttonClass:"",dropdownClass:"",searchClass:"",className:"",autoFormat:!0,enableAreaCodes:!1,enableTerritories:!1,disableCountryCode:!1,disableDropdown:!1,enableLongNumbers:!1,countryCodeEditable:!0,enableSearch:!1,disableSearchIcon:!1,disableInitialCountryGuess:!1,disableCountryGuess:!1,regions:"",inputProps:{},localization:{},masks:null,priority:null,areaCodes:null,preserveOrder:[],defaultMask:"... ... ... ... ..",alwaysDefaultMask:!1,prefix:"+",copyNumbersOnly:!0,renderStringAsFlag:"",autocompleteSearch:!1,jumpCursorToEnd:!0,enableAreaCodeStretch:!1,enableClickOutside:!0,showDropdown:!1,isValid:!0,defaultErrorMessage:"",specialLabel:"Phone",onEnterKeyPress:null,keys:{UP:38,DOWN:40,RIGHT:39,LEFT:37,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9}},t.default=D}])},196:function(e){"use strict";e.exports=window.React}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.m=t,e=[],r.O=function(t,n,a,o){if(!n){var i=1/0;for(s=0;s<e.length;s++){n=e[s][0],a=e[s][1],o=e[s][2];for(var c=!0,l=0;l<n.length;l++)(!1&o||i>=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[l])}))?n.splice(l--,1):(c=!1,o<i&&(i=o));if(c){e.splice(s--,1);var u=a();void 0!==u&&(t=u)}}return t}o=o||0;for(var s=e.length;s>0&&e[s-1][2]>o;s--)e[s]=e[s-1];e[s]=[n,a,o]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={826:0,431:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,o,i=n[0],c=n[1],l=n[2],u=0;if(i.some((function(t){return 0!==e[t]}))){for(a in c)r.o(c,a)&&(r.m[a]=c[a]);if(l)var s=l(r)}for(t&&t(n);u<i.length;u++)o=i[u],r.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return r.O(s)},n=self.webpackChunkjoinchat=self.webpackChunkjoinchat||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var a=r.O(void 0,[431],(function(){return r(150)}));a=r.O(a)}();
gutenberg/build/style-index.css ADDED
@@ -0,0 +1 @@
 
1
+ .wp-block-joinchat-button{border:none!important;text-align:center}.wp-block-joinchat-button figure{display:table;margin:0 auto;padding:0}.wp-block-joinchat-button figcaption{font:normal normal 400 .6em/2em var(--wp--preset--font-family--system-font,sans-serif);margin:0;padding:0}.wp-block-joinchat-button .joinchat-button__qr{background-color:#fff;border:6px solid #25d366;border-radius:30px;box-sizing:content-box;display:block;height:200px;margin:auto;overflow:hidden;padding:10px;width:200px}.wp-block-joinchat-button .joinchat-button__qr canvas,.wp-block-joinchat-button .joinchat-button__qr img{display:block;margin:auto}.wp-block-joinchat-button .joinchat-button__link{align-items:center;background-color:#25d366;border:6px solid #25d366;border-radius:30px;display:inline-flex;flex-flow:row nowrap;justify-content:center;line-height:1.25em;margin:0 auto;text-decoration:none}.wp-block-joinchat-button .joinchat-button__link:before{background:transparent var(--joinchat-ico) no-repeat center;background-size:100%;content:"";display:block;height:1.5em;margin:-.75em .75em -.75em 0;width:1.5em}.wp-block-joinchat-button figure+.joinchat-button__link{margin-top:10px}@media (orientation:landscape)and (min-height:481px),(orientation:portrait)and (min-width:481px){.wp-block-joinchat-button.joinchat-button--qr-only figure+.joinchat-button__link{display:none}}@media (max-width:480px),(orientation:landscape)and (max-height:480px){.wp-block-joinchat-button figure{display:none}}
gutenberg/class-joinchat-gutenberg.php ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Register Gutenberg block editor plugin logic.
5
+ * Add native sidebar for postmeta and register blocks and patterns.
6
+ *
7
+ * @since 1.0.0
8
+ * @package JoinChatGutenberg
9
+ * @subpackage JoinChat/gutenberg
10
+ * @author Creame <hola@crea.me>
11
+ */
12
+ class JoinChatGutenberg {
13
+
14
+ /**
15
+ * The ID of this plugin.
16
+ *
17
+ * @since 4.5.0
18
+ * @access private
19
+ * @var string $plugin_name The ID of this plugin.
20
+ */
21
+ private $plugin_name;
22
+
23
+ /**
24
+ * The version of this plugin.
25
+ *
26
+ * @since 4.5.0
27
+ * @access private
28
+ * @var string $version The current version of this plugin.
29
+ */
30
+ private $version;
31
+
32
+ /**
33
+ * Common class for admin and front methods.
34
+ *
35
+ * @since 4.5.0
36
+ * @access private
37
+ * @var JoinChatCommon $common instance.
38
+ */
39
+ private $common;
40
+
41
+ /**
42
+ * Initialize the class and set its properties.
43
+ *
44
+ * @since 4.5.0
45
+ * @param string $plugin_name The name of the plugin.
46
+ * @param string $version The version of this plugin.
47
+ * @return void
48
+ */
49
+ public function __construct( $plugin_name, $version ) {
50
+
51
+ $this->plugin_name = $plugin_name;
52
+ $this->version = $version;
53
+ $this->common = JoinChatCommon::instance();
54
+
55
+ }
56
+
57
+ /**
58
+ * Register the stylesheets for the gutenberg editor
59
+ *
60
+ * @since 4.5.0
61
+ * @return void
62
+ */
63
+ public function enqueue_editor_assets() {
64
+
65
+ $asset_file = include JOINCHAT_DIR . '/gutenberg/build/index.asset.php';
66
+
67
+ $joinchat_data = array(
68
+ 'image_qr' => plugins_url( 'admin/img/qr.png', JOINCHAT_FILE ),
69
+ 'defaults' => $this->common->get_obj_placeholders( get_post() ),
70
+ 'message_vars' => $this->common->get_obj_vars( get_post() ),
71
+ );
72
+
73
+ wp_enqueue_script( 'joinchat-gutenberg', plugins_url( 'gutenberg/build/index.js', JOINCHAT_FILE ), $asset_file['dependencies'], $asset_file['version'], true );
74
+ wp_localize_script( 'joinchat-gutenberg', 'joinchatData', $joinchat_data );
75
+ wp_set_script_translations( 'joinchat-gutenberg', 'creame-whatsapp-me', JOINCHAT_DIR . 'languages' );
76
+
77
+ // Disable sidebar?
78
+ // Required CPT support 'custom-fields' for Gutenberg access to postmeta.
79
+ if ( ! $this->show_sidebar() || ! post_type_supports( get_post_type(), 'custom-fields' ) ) {
80
+ wp_add_inline_script( 'joinchat-gutenberg', 'wp.hooks.addFilter( "joinchat_gutenberg_sidebar", "joinchat", () => { return false; } );', 'before' );
81
+ }
82
+
83
+ }
84
+
85
+ /**
86
+ * Initiates blocks on PHP side.
87
+ *
88
+ * @since 4.5.0
89
+ * @return void
90
+ */
91
+ public function register_blocks() {
92
+
93
+ register_block_type(
94
+ JOINCHAT_DIR . '/gutenberg/build/block_btn/',
95
+ array(
96
+ 'render_callback' => array( $this, 'render_button' ),
97
+ )
98
+ );
99
+
100
+ }
101
+
102
+ /**
103
+ * Render the button.
104
+ *
105
+ * @since 4.5.0
106
+ * @param array $attributes The block attributes.
107
+ * @param string $content The block html.
108
+ * @return string The block html.
109
+ */
110
+ public function render_button( $attributes, $content ) {
111
+
112
+ // Don't do nothing for admin and API.
113
+ if ( is_admin() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {
114
+ return $content;
115
+ }
116
+
117
+ // Need render QR code.
118
+ if ( isset( $attributes['qr_code'] ) && 'no' !== $attributes['qr_code'] ) {
119
+ $this->common->qr = true;
120
+ }
121
+
122
+ // Replace dynamic vars.
123
+ if ( ! empty( $attributes['message'] ) ) {
124
+ $escaped = str_replace( array( '&', '"', '>' ), array( '&amp;', '&quot;', '&gt;' ), $attributes['message'] );
125
+ $content = str_replace( $escaped, esc_attr( JoinChatUtil::replace_variables( $attributes['message'] ) ), $content );
126
+ }
127
+
128
+ // Render an empty Button Block to ensure enqueue button styles.
129
+ $button = parse_blocks( '<!-- wp:button /-->' );
130
+ render_block( $button[0] );
131
+
132
+ return $content;
133
+
134
+ }
135
+
136
+ /**
137
+ * Fallback styles
138
+ *
139
+ * @return void
140
+ */
141
+ public function root_styles() {
142
+
143
+ if ( has_block( 'joinchat/button' ) && ! wp_script_is( 'joinchat', 'done' ) && ! wp_script_is( 'joinchat-woo', 'done' ) ) {
144
+
145
+ ob_start();
146
+ ?>
147
+ <style>
148
+ :root {
149
+ --joinchat-ico: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z'/%3E%3C/svg%3E");
150
+ --joinchat-font: -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen-sans, ubuntu, cantarell, "Helvetica Neue", sans-serif;
151
+ }
152
+ </style>
153
+ <?php
154
+ echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
155
+
156
+ }
157
+
158
+ }
159
+
160
+ /**
161
+ * Undocumented function
162
+ *
163
+ * @since 4.5.0
164
+ * @return void
165
+ */
166
+ public function register_patterns() {
167
+
168
+ if ( ! function_exists( 'register_block_pattern' ) ) {
169
+ return;
170
+ }
171
+
172
+ // Comming soon.
173
+
174
+ }
175
+
176
+ /**
177
+ * Allow Gutenberg sidebar
178
+ *
179
+ * @since 4.5.0
180
+ * @return bool
181
+ */
182
+ public function show_sidebar() {
183
+
184
+ return apply_filters( 'joinchat_gutenberg_sidebar', true );
185
+
186
+ }
187
+
188
+ /**
189
+ * Register post meta
190
+ *
191
+ * @since 4.5.0
192
+ * @return void
193
+ */
194
+ public function register_meta() {
195
+
196
+ if ( ! $this->show_sidebar() ) {
197
+ return;
198
+ }
199
+
200
+ $post_types = $this->common->get_public_post_types();
201
+
202
+ foreach ( $post_types as $post_type ) {
203
+ register_meta(
204
+ 'post',
205
+ '_joinchat',
206
+ array(
207
+ 'object_subtype' => $post_type,
208
+ 'type' => 'object',
209
+ 'show_in_rest' => array(
210
+ 'schema' => array(
211
+ 'type' => 'object',
212
+ 'properties' => array(
213
+ 'telephone' => array( 'type' => 'string' ),
214
+ 'message_text' => array( 'type' => 'string' ),
215
+ 'message_send' => array( 'type' => 'string' ),
216
+ 'view' => array( 'type' => 'string' ),
217
+ ),
218
+ ),
219
+ ),
220
+ 'auth_callback' => function () {
221
+ return current_user_can( 'edit_posts' );
222
+ },
223
+ 'single' => true,
224
+ )
225
+ );
226
+ }
227
+
228
+ // Sanitize meta on save.
229
+ add_filter( 'sanitize_post_meta__joinchat', array( $this, 'sanitize_meta' ) );
230
+ add_action( 'updated_postmeta', array( $this, 'delete_empty_meta' ), 10, 4 );
231
+
232
+ }
233
+
234
+ /**
235
+ * Sanitize post meta
236
+ *
237
+ * @since 4.5.0
238
+ * @param array $meta_value Current meta value.
239
+ * @return array
240
+ */
241
+ public function sanitize_meta( $meta_value ) {
242
+
243
+ JoinChatUtil::maybe_encode_emoji();
244
+
245
+ return array_filter( JoinChatUtil::clean_input( $meta_value ) );
246
+
247
+ }
248
+
249
+ /**
250
+ * Delete empty post meta
251
+ *
252
+ * @since 4.5.0
253
+ * @param int $meta_id Current meta ID.
254
+ * @param int $object_id Current object ID.
255
+ * @param string $meta_key Current meta key.
256
+ * @param mixed $meta_value Current meta value.
257
+ * @return void
258
+ */
259
+ public function delete_empty_meta( $meta_id, $object_id, $meta_key, $meta_value ) {
260
+
261
+ if ( '_joinchat' === $meta_key && empty( maybe_unserialize( $meta_value ) ) ) {
262
+ delete_metadata_by_mid( 'post', $meta_id );
263
+ }
264
+
265
+ }
266
+ }
includes/class-joinchat-common.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /**
4
- * Fornt and Back Common class.
5
  *
6
  * @since 4.2.0
7
  * @package JoinChat
@@ -10,12 +10,65 @@
10
  */
11
  class JoinChatCommon {
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  /**
14
  * Initialize the class.
15
  *
16
  * @since 4.2.0
17
  */
18
- public function __construct() {}
 
 
 
 
 
19
 
20
  /**
21
  * Return the default settings.
@@ -43,7 +96,7 @@ class JoinChatCommon {
43
  'visibility' => array( 'all' => 'yes' ),
44
  'color' => '#25d366',
45
  'dark_mode' => 'no',
46
- 'header' => '__jc__', // values: '__jc__', '__wa__' or other custom text
47
  'optin_text' => '',
48
  'optin_check' => 'no',
49
  'gads' => '',
@@ -63,19 +116,72 @@ class JoinChatCommon {
63
 
64
  $default_settings = $this->default_settings();
65
 
66
- // Can hook 'option_joinchat' and 'default_option_joinchat' filters
67
  $settings = array_merge( $default_settings, (array) get_option( 'joinchat', $default_settings ) );
68
 
69
- // Migrate addons 'remove_brand' setting to 'header' (v. < 4.1)
70
  if ( isset( $settings['remove_brand'] ) ) {
71
  $remove = $settings['remove_brand'];
72
- $settings['header'] = 'wa' == $remove ? '__wa__' : ( 'no' == $remove ? '__jc__' : '' );
73
  }
74
 
75
- // Clean unused saved settings
76
- $settings = array_intersect_key( $settings, $default_settings );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
- return $settings;
79
 
80
  }
81
 
1
  <?php
2
 
3
  /**
4
+ * Front and Back Common class.
5
  *
6
  * @since 4.2.0
7
  * @package JoinChat
10
  */
11
  class JoinChatCommon {
12
 
13
+ /**
14
+ * Singleton instance.
15
+ *
16
+ * @since 4.5.0
17
+ * @var self|null
18
+ */
19
+ private static $instance = null;
20
+
21
+ /**
22
+ * Settings
23
+ *
24
+ * @since 4.5.0
25
+ * @var null|array
26
+ */
27
+ public $settings = null;
28
+
29
+ /**
30
+ * Intl-tel-input version.
31
+ *
32
+ * @since 4.5.0
33
+ * @var string|false
34
+ */
35
+ public $intltel = '17.0.15';
36
+
37
+ /**
38
+ * Require QR Script on front.
39
+ *
40
+ * @since 4.5.0
41
+ * @var bool
42
+ */
43
+ public $qr = false;
44
+
45
+ /**
46
+ * Instantiates Manager.
47
+ *
48
+ * @since 4.5.0
49
+ * @return JoinChatCommon
50
+ */
51
+ public static function instance() {
52
+
53
+ if ( is_null( self::$instance ) ) {
54
+ self::$instance = new self();
55
+ }
56
+
57
+ return self::$instance;
58
+
59
+ }
60
+
61
  /**
62
  * Initialize the class.
63
  *
64
  * @since 4.2.0
65
  */
66
+ public function __construct() {
67
+
68
+ // Use International Telephone Input library version or false to disable.
69
+ $this->intltel = apply_filters( 'joinchat_enhanced_phone', $this->intltel );
70
+
71
+ }
72
 
73
  /**
74
  * Return the default settings.
96
  'visibility' => array( 'all' => 'yes' ),
97
  'color' => '#25d366',
98
  'dark_mode' => 'no',
99
+ 'header' => '__jc__', // values: '__jc__', '__wa__' or other custom text.
100
  'optin_text' => '',
101
  'optin_check' => 'no',
102
  'gads' => '',
116
 
117
  $default_settings = $this->default_settings();
118
 
119
+ // Can hook 'option_joinchat' and 'default_option_joinchat' filters.
120
  $settings = array_merge( $default_settings, (array) get_option( 'joinchat', $default_settings ) );
121
 
122
+ // Migrate addons 'remove_brand' setting to 'header' (v. < 4.1).
123
  if ( isset( $settings['remove_brand'] ) ) {
124
  $remove = $settings['remove_brand'];
125
+ $settings['header'] = 'wa' === $remove ? '__wa__' : ( 'no' === $remove ? '__jc__' : '' );
126
  }
127
 
128
+ // Clean unused saved settings.
129
+ $this->settings = array_intersect_key( $settings, $default_settings );
130
+
131
+ return $this->settings;
132
+
133
+ }
134
+
135
+ /**
136
+ * Get public post_types
137
+ *
138
+ * @since 4.5.0
139
+ * @return array
140
+ */
141
+ public function get_public_post_types() {
142
+
143
+ // Default post types.
144
+ $builtin_post_types = array( 'post', 'page' );
145
+ // Custom post types with public url.
146
+ $custom_post_types = array_keys( get_post_types( array( 'has_archive' => true ), 'names' ) );
147
+
148
+ // Add/remove posts types for "Join.chat" meta box.
149
+ return apply_filters( 'joinchat_post_types_meta_box', array_merge( $builtin_post_types, $custom_post_types ) );
150
+
151
+ }
152
+
153
+ /**
154
+ * Get post/term form placeholders
155
+ *
156
+ * @since 4.5.0
157
+ * @param WP_Post|WP_Term $obj Current post or term.
158
+ * @return array
159
+ */
160
+ public function get_obj_placeholders( $obj ) {
161
+
162
+ return apply_filters(
163
+ 'joinchat_metabox_placeholders',
164
+ array(
165
+ 'telephone' => $this->settings['telephone'],
166
+ 'message_text' => $this->settings['message_text'],
167
+ 'message_send' => $this->settings['message_send'],
168
+ ),
169
+ $obj,
170
+ $this->settings
171
+ );
172
+
173
+ }
174
+
175
+ /**
176
+ * Get post/term dynamic variables for form help text
177
+ *
178
+ * @since 4.5.0
179
+ * @param WP_Post|WP_Term $obj Current post or term.
180
+ * @return array
181
+ */
182
+ public function get_obj_vars( $obj ) {
183
 
184
+ return apply_filters( 'joinchat_metabox_vars', array( 'SITE', 'TITLE', 'URL', 'HREF' ), $obj );
185
 
186
  }
187
 
includes/class-joinchat-elementor-finder.php CHANGED
@@ -38,7 +38,7 @@ class JoinChatElementorFinder extends \Elementor\Core\Common\Modules\Finder\Base
38
  * Get category items.
39
  *
40
  * @since 4.1.12
41
- * @param array $options
42
  * @return array $items array of Finder items.
43
  */
44
  public function get_category_items( array $options = array() ) {
38
  * Get category items.
39
  *
40
  * @since 4.1.12
41
+ * @param array $options options.
42
  * @return array $items array of Finder items.
43
  */
44
  public function get_category_items( array $options = array() ) {
includes/class-joinchat-i18n.php CHANGED
@@ -17,11 +17,12 @@ class JoinChat_i18n {
17
  * Initialize the class.
18
  *
19
  * @since 4.2.0
 
 
20
  */
21
  public function __construct( $loader ) {
22
 
23
- // No delegate to $loader, use WordPress add_action
24
- add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
25
 
26
  if ( defined( 'WPML_PLUGIN_PATH' ) || defined( 'POLYLANG_VERSION' ) ) {
27
 
@@ -50,7 +51,7 @@ class JoinChat_i18n {
50
  *
51
  * @since 4.2 (before this was in JoinChatUtil)
52
  * @access private
53
- * @param null|array $settings
54
  * @return array setting keys and string names
55
  */
56
  private function settings_i18n( $settings = null ) {
@@ -79,8 +80,8 @@ class JoinChat_i18n {
79
  * view: https://wpml.org/wpml-hook/wpml_register_single_string/
80
  *
81
  * @since 4.2
82
- * @param array $settings
83
- * @param array $old_settings
84
  * @return void
85
  */
86
  public function settings_save( $settings, $old_settings ) {
@@ -98,7 +99,7 @@ class JoinChat_i18n {
98
  }
99
  }
100
 
101
- // Show notice with link to string translations
102
  if ( $translate_notice ) {
103
 
104
  if ( defined( 'WPML_PLUGIN_PATH' ) ) {
@@ -120,9 +121,10 @@ class JoinChat_i18n {
120
  );
121
  }
122
 
123
- // Note: message is wrapped with <strong>...</strong> tags
124
  $message = sprintf(
125
  '%s</strong>&nbsp;&nbsp;%s&nbsp;&nbsp;<strong><a href="%s">%s</a>',
 
126
  sprintf( __( 'Default site language (%s)', 'creame-whatsapp-me' ), strtoupper( $default_language ) ),
127
  __( 'There are changes in fields that can be translated.', 'creame-whatsapp-me' ),
128
  esc_url( $link ),
@@ -139,7 +141,7 @@ class JoinChat_i18n {
139
  * Get settings translations for current language
140
  *
141
  * @since 4.2
142
- * @param array $settings
143
  * @return array
144
  */
145
  public function settings_load( $settings ) {
17
  * Initialize the class.
18
  *
19
  * @since 4.2.0
20
+ * @param JoinChatLoader $loader loader instance.
21
+ * @return void
22
  */
23
  public function __construct( $loader ) {
24
 
25
+ $loader->add_action( 'init', $this, 'load_plugin_textdomain', 11 );
 
26
 
27
  if ( defined( 'WPML_PLUGIN_PATH' ) || defined( 'POLYLANG_VERSION' ) ) {
28
 
51
  *
52
  * @since 4.2 (before this was in JoinChatUtil)
53
  * @access private
54
+ * @param null|array $settings list of settings.
55
  * @return array setting keys and string names
56
  */
57
  private function settings_i18n( $settings = null ) {
80
  * view: https://wpml.org/wpml-hook/wpml_register_single_string/
81
  *
82
  * @since 4.2
83
+ * @param array $settings new values of settings.
84
+ * @param array $old_settings old values of settings.
85
  * @return void
86
  */
87
  public function settings_save( $settings, $old_settings ) {
99
  }
100
  }
101
 
102
+ // Show notice with link to string translations.
103
  if ( $translate_notice ) {
104
 
105
  if ( defined( 'WPML_PLUGIN_PATH' ) ) {
121
  );
122
  }
123
 
124
+ // Note: message is wrapped with <strong>...</strong> tags.
125
  $message = sprintf(
126
  '%s</strong>&nbsp;&nbsp;%s&nbsp;&nbsp;<strong><a href="%s">%s</a>',
127
+ /* translators: %s: site language. */
128
  sprintf( __( 'Default site language (%s)', 'creame-whatsapp-me' ), strtoupper( $default_language ) ),
129
  __( 'There are changes in fields that can be translated.', 'creame-whatsapp-me' ),
130
  esc_url( $link ),
141
  * Get settings translations for current language
142
  *
143
  * @since 4.2
144
+ * @param array $settings list of settings.
145
  * @return array
146
  */
147
  public function settings_load( $settings ) {
includes/class-joinchat-integrations.php CHANGED
@@ -79,7 +79,7 @@ class JoinChatIntegrations {
79
  * Add Join.chat category to Elementor Finder.
80
  *
81
  * @since 4.1.12
82
- * @param Categories_Manager $categories_manager
83
  * @return void
84
  */
85
  public function elementor_finder_integration( $categories_manager ) {
@@ -98,8 +98,7 @@ class JoinChatIntegrations {
98
  * Add WooCommerce item in Join.chat category for Elementor Finder.
99
  *
100
  * @since 4.1.12
101
- * @param array $items current Elementor Finder joina.chat items
102
- * @param string $settings_url Join.chat settings base url
103
  * @return array
104
  */
105
  public function elementor_finder_woocommerce_item( $items ) {
79
  * Add Join.chat category to Elementor Finder.
80
  *
81
  * @since 4.1.12
82
+ * @param Categories_Manager $categories_manager instance.
83
  * @return void
84
  */
85
  public function elementor_finder_integration( $categories_manager ) {
98
  * Add WooCommerce item in Join.chat category for Elementor Finder.
99
  *
100
  * @since 4.1.12
101
+ * @param array $items current Elementor Finder joina.chat items.
 
102
  * @return array
103
  */
104
  public function elementor_finder_woocommerce_item( $items ) {
includes/class-joinchat-loader.php CHANGED
@@ -66,7 +66,7 @@ class JoinChatLoader {
66
  * @param object $component A reference to the instance of the object on which the filter is defined.
67
  * @param string $callback The name of the function definition on the $component.
68
  * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
69
- * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
70
  */
71
  public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
72
  $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
@@ -84,7 +84,7 @@ class JoinChatLoader {
84
  * @param string $callback The name of the function definition on the $component.
85
  * @param int $priority The priority at which the function should be fired.
86
  * @param int $accepted_args The number of arguments that should be passed to the $callback.
87
- * @return array The collection of actions and filters registered with WordPress.
88
  */
89
  private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
90
 
@@ -139,16 +139,16 @@ class JoinChatLoader {
139
  * @param object $component A reference to the instance or name of the object on which the filter is defined.
140
  * @param string $callback The name of the function definition on the $component.
141
  * @param int $priority The priority at which the function should be fired.
142
- * @return array The collection of actions and filters registered with WordPress.
143
  */
144
  private function remove( $hooks, $hook, $component, $callback, $priority ) {
145
 
146
  foreach ( $hooks as $key => $value ) {
147
  if (
148
- ( is_null( $hook ) || $value['hook'] == $hook ) &&
149
- ( is_null( $component ) || $value['component'] == $component || $value['component'] instanceof $component ) &&
150
- ( is_null( $callback ) || $value['callback'] == $callback ) &&
151
- ( is_null( $priority ) || $value['priority'] == $priority )
152
  ) {
153
  unset( $hooks[ $key ] );
154
  }
66
  * @param object $component A reference to the instance of the object on which the filter is defined.
67
  * @param string $callback The name of the function definition on the $component.
68
  * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
69
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
70
  */
71
  public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
72
  $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
84
  * @param string $callback The name of the function definition on the $component.
85
  * @param int $priority The priority at which the function should be fired.
86
  * @param int $accepted_args The number of arguments that should be passed to the $callback.
87
+ * @return array The collection of actions and filters registered with WordPress.
88
  */
89
  private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
90
 
139
  * @param object $component A reference to the instance or name of the object on which the filter is defined.
140
  * @param string $callback The name of the function definition on the $component.
141
  * @param int $priority The priority at which the function should be fired.
142
+ * @return array The collection of actions and filters registered with WordPress.
143
  */
144
  private function remove( $hooks, $hook, $component, $callback, $priority ) {
145
 
146
  foreach ( $hooks as $key => $value ) {
147
  if (
148
+ ( is_null( $hook ) || $value['hook'] === $hook ) &&
149
+ ( is_null( $component ) || $value['component'] === $component || $value['component'] instanceof $component ) &&
150
+ ( is_null( $callback ) || $value['callback'] === $callback ) &&
151
+ ( is_null( $priority ) || $value['priority'] === $priority )
152
  ) {
153
  unset( $hooks[ $key ] );
154
  }
includes/class-joinchat-util.php CHANGED
@@ -35,14 +35,14 @@ class JoinChatUtil {
35
  *
36
  * @since 3.1.0
37
  * @access public
38
- * @param mixed $value to clean
39
  * @return mixed $value cleaned
40
  */
41
  public static function clean_input( $value ) {
42
  if ( is_array( $value ) ) {
43
  return array_map( 'self::clean_input', $value );
44
  } elseif ( is_string( $value ) ) {
45
- // Split lines, clean and re-join lines
46
  return implode( "\n", array_map( 'sanitize_text_field', explode( "\n", trim( $value ) ) ) );
47
  } else {
48
  return $value;
@@ -56,21 +56,21 @@ class JoinChatUtil {
56
  *
57
  * @since 4.3.0
58
  * @access public
59
- * @param string $number to clean
60
- * @return string $number cleaned
61
  */
62
  public static function clean_whatsapp( $number ) {
63
 
64
- // Remove any leading 0s or special calling codes
65
  $clean = preg_replace( '/^0+|\D/', '', $number );
66
 
67
  // Argentina (country code "54") should have a "9" between the country code and area code
68
  // and prefix "15" must be removed so the final number will have 13 digits total.
69
- // (intlTelInput saved numbers already has in international mode)
70
  $clean = preg_replace( '/^54(0|1|2|3|4|5|6|7|8)/', '549$1', $clean );
71
  $clean = preg_replace( '/^(54\d{5})15(\d{6})/', '$1$2', $clean );
72
 
73
- // Mexico (country code "52") need to have "1" after "+52"
74
  $clean = preg_replace( '/^52(0|2|3|4|5|6|7|8|9)/', '521$1', $clean );
75
 
76
  return apply_filters( 'joinchat_clean_whatsapp', $clean, $number );
@@ -81,9 +81,9 @@ class JoinChatUtil {
81
  *
82
  * @since 3.1.0
83
  * @access public
84
- * @param string $str The input string
85
- * @param int $start The first position used in str
86
- * @param int $length The maximum length of the returned string
87
  * @return string The portion of str specified by the start and length parameters
88
  */
89
  public static function substr( $str, $start, $length = null ) {
@@ -97,17 +97,17 @@ class JoinChatUtil {
97
  *
98
  * @since 3.1.0
99
  * @access public
100
- * @param mixed $img Image path or attachment ID
101
- * @param int $width The widht of thumbnail
102
- * @param int $height The height of thumbnail
103
- * @param bool $crop If crop to exact thumbnail size or not
104
  * @return array With thumbnail info (url, width, height)
105
  */
106
  public static function thumb( $img, $width, $height, $crop = true ) {
107
 
108
  $img_path = intval( $img ) > 0 ? get_attached_file( $img ) : $img;
109
 
110
- // Try fallback if file don't exists (filter to true to skip thumbnail generation)
111
  if ( apply_filters( 'joinchat_disable_thumbs', ! $img_path || ! file_exists( $img_path ) ) ) {
112
  $src = wp_get_attachment_image_src( $img, array( $width, $height ) );
113
 
@@ -139,7 +139,7 @@ class JoinChatUtil {
139
  'height' => $new_img['height'],
140
  );
141
  } else {
142
- // Fallback to original image
143
  @list($w, $h) = getimagesize( $img_path );
144
 
145
  $thumb = array(
@@ -167,7 +167,7 @@ class JoinChatUtil {
167
  *
168
  * @since 3.1.0
169
  * @access public
170
- * @param mixed $img Image path or attachment ID
171
  * @return bool true if is an animated gif, false otherwise
172
  */
173
  public static function is_animated_gif( $img ) {
@@ -182,7 +182,7 @@ class JoinChatUtil {
182
  *
183
  * @since 3.1.0
184
  * @since 3.1.2 Allowed callback replecements
185
- * @param string $string string to apply format replacements
186
  * @return string string formated
187
  */
188
  public static function formated_message( $string ) {
@@ -196,7 +196,7 @@ class JoinChatUtil {
196
  )
197
  );
198
 
199
- // Split text into lines and apply replacements line by line
200
  $lines = explode( "\n", $string );
201
  foreach ( $lines as $key => $line ) {
202
  $escaped_line = esc_html( $line );
@@ -220,7 +220,7 @@ class JoinChatUtil {
220
  * Format message send, replace vars.
221
  *
222
  * @since 3.1.0
223
- * @param string $string string to apply variable replacements
224
  * @return string string with replaced variables
225
  */
226
  public static function replace_variables( $string ) {
@@ -236,13 +236,13 @@ class JoinChatUtil {
236
  )
237
  );
238
 
239
- // Patterns as regex {VAR}
240
  $patterns = array();
241
  foreach ( $replacements as $var => $replacement ) {
242
  $patterns[] = "/\{$var\}/u";
243
  }
244
 
245
- // Prevent malformed json
246
  foreach ( $replacements as $var => $replacement ) {
247
  $replacements[ $var ] = str_replace( '&quot;', '"', $replacement );
248
  }
@@ -263,15 +263,13 @@ class JoinChatUtil {
263
  $title = single_post_title( '', false );
264
  } elseif ( is_category() || is_tag() || is_tax() ) {
265
  $title = single_term_title( '', false );
266
- } elseif ( function_exists( 'wp_get_document_title' ) ) {
267
  $title = wp_get_document_title();
268
 
269
- // Try to remove sitename from $title for cleaner title
270
  $sep = apply_filters( 'document_title_separator', '-' );
271
  $site = get_bloginfo( 'name', 'display' );
272
  $title = str_replace( esc_html( convert_chars( wptexturize( " $sep " . $site ) ) ), '', $title );
273
- } else {
274
- $title = get_bloginfo( 'name' );
275
  }
276
 
277
  return apply_filters( 'joinchat_get_title', $title );
@@ -282,7 +280,7 @@ class JoinChatUtil {
282
  * Encode JSON with filtered options
283
  *
284
  * @since 4.0.9
285
- * @param array $data data to encode
286
  * @return string data json encoded
287
  */
288
  public static function to_json( $data ) {
@@ -301,12 +299,12 @@ class JoinChatUtil {
301
  * Default capability 'manage_options'
302
  *
303
  * @since 4.2.0
304
- * @param string $capability
305
  * @return string
306
  */
307
  public static function capability( $capability = '' ) {
308
 
309
- return apply_filters( 'joinchat_capability', $capability ?: 'manage_options' );
310
 
311
  }
312
 
35
  *
36
  * @since 3.1.0
37
  * @access public
38
+ * @param mixed $value to clean.
39
  * @return mixed $value cleaned
40
  */
41
  public static function clean_input( $value ) {
42
  if ( is_array( $value ) ) {
43
  return array_map( 'self::clean_input', $value );
44
  } elseif ( is_string( $value ) ) {
45
+ // Split lines, clean and re-join lines.
46
  return implode( "\n", array_map( 'sanitize_text_field', explode( "\n", trim( $value ) ) ) );
47
  } else {
48
  return $value;
56
  *
57
  * @since 4.3.0
58
  * @access public
59
+ * @param string $number phone number to clean.
60
+ * @return string number cleaned
61
  */
62
  public static function clean_whatsapp( $number ) {
63
 
64
+ // Remove any leading 0s or special calling codes.
65
  $clean = preg_replace( '/^0+|\D/', '', $number );
66
 
67
  // Argentina (country code "54") should have a "9" between the country code and area code
68
  // and prefix "15" must be removed so the final number will have 13 digits total.
69
+ // (intlTelInput saved numbers already has in international mode).
70
  $clean = preg_replace( '/^54(0|1|2|3|4|5|6|7|8)/', '549$1', $clean );
71
  $clean = preg_replace( '/^(54\d{5})15(\d{6})/', '$1$2', $clean );
72
 
73
+ // Mexico (country code "52") need to have "1" after "+52".
74
  $clean = preg_replace( '/^52(0|2|3|4|5|6|7|8|9)/', '521$1', $clean );
75
 
76
  return apply_filters( 'joinchat_clean_whatsapp', $clean, $number );
81
  *
82
  * @since 3.1.0
83
  * @access public
84
+ * @param string $str The input string.
85
+ * @param int $start The first position used in str.
86
+ * @param int $length The maximum length of the returned string.
87
  * @return string The portion of str specified by the start and length parameters
88
  */
89
  public static function substr( $str, $start, $length = null ) {
97
  *
98
  * @since 3.1.0
99
  * @access public
100
+ * @param mixed $img Image path or attachment ID.
101
+ * @param int $width The widht of thumbnail.
102
+ * @param int $height The height of thumbnail.
103
+ * @param bool $crop If crop to exact thumbnail size or not.
104
  * @return array With thumbnail info (url, width, height)
105
  */
106
  public static function thumb( $img, $width, $height, $crop = true ) {
107
 
108
  $img_path = intval( $img ) > 0 ? get_attached_file( $img ) : $img;
109
 
110
+ // Try fallback if file don't exists (filter to true to skip thumbnail generation).
111
  if ( apply_filters( 'joinchat_disable_thumbs', ! $img_path || ! file_exists( $img_path ) ) ) {
112
  $src = wp_get_attachment_image_src( $img, array( $width, $height ) );
113
 
139
  'height' => $new_img['height'],
140
  );
141
  } else {
142
+ // Fallback to original image.
143
  @list($w, $h) = getimagesize( $img_path );
144
 
145
  $thumb = array(
167
  *
168
  * @since 3.1.0
169
  * @access public
170
+ * @param mixed $img Image path or attachment ID.
171
  * @return bool true if is an animated gif, false otherwise
172
  */
173
  public static function is_animated_gif( $img ) {
182
  *
183
  * @since 3.1.0
184
  * @since 3.1.2 Allowed callback replecements
185
+ * @param string $string string to apply format replacements.
186
  * @return string string formated
187
  */
188
  public static function formated_message( $string ) {
196
  )
197
  );
198
 
199
+ // Split text into lines and apply replacements line by line.
200
  $lines = explode( "\n", $string );
201
  foreach ( $lines as $key => $line ) {
202
  $escaped_line = esc_html( $line );
220
  * Format message send, replace vars.
221
  *
222
  * @since 3.1.0
223
+ * @param string $string string to apply variable replacements.
224
  * @return string string with replaced variables
225
  */
226
  public static function replace_variables( $string ) {
236
  )
237
  );
238
 
239
+ // Patterns as regex {VAR}.
240
  $patterns = array();
241
  foreach ( $replacements as $var => $replacement ) {
242
  $patterns[] = "/\{$var\}/u";
243
  }
244
 
245
+ // Prevent malformed json.
246
  foreach ( $replacements as $var => $replacement ) {
247
  $replacements[ $var ] = str_replace( '&quot;', '"', $replacement );
248
  }
263
  $title = single_post_title( '', false );
264
  } elseif ( is_category() || is_tag() || is_tax() ) {
265
  $title = single_term_title( '', false );
266
+ } else {
267
  $title = wp_get_document_title();
268
 
269
+ // Try to remove sitename from $title for cleaner title.
270
  $sep = apply_filters( 'document_title_separator', '-' );
271
  $site = get_bloginfo( 'name', 'display' );
272
  $title = str_replace( esc_html( convert_chars( wptexturize( " $sep " . $site ) ) ), '', $title );
 
 
273
  }
274
 
275
  return apply_filters( 'joinchat_get_title', $title );
280
  * Encode JSON with filtered options
281
  *
282
  * @since 4.0.9
283
+ * @param array $data data to encode.
284
  * @return string data json encoded
285
  */
286
  public static function to_json( $data ) {
299
  * Default capability 'manage_options'
300
  *
301
  * @since 4.2.0
302
+ * @param string $capability required capability.
303
  * @return string
304
  */
305
  public static function capability( $capability = '' ) {
306
 
307
+ return apply_filters( 'joinchat_capability', $capability ?: 'manage_options' ); //phpcs:ignore WordPress.PHP.DisallowShortTernary
308
 
309
  }
310
 
includes/class-joinchat.php CHANGED
@@ -70,6 +70,11 @@ class JoinChat {
70
  $this->define_public_hooks();
71
  }
72
 
 
 
 
 
 
73
  add_action( 'joinchat_run_pre', array( $this, 'disable_remove_brand' ), 11 );
74
 
75
  }
@@ -136,6 +141,30 @@ class JoinChat {
136
 
137
  }
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  /**
140
  * Register all of the hooks related to the admin area functionality
141
  * of the plugin.
@@ -147,28 +176,30 @@ class JoinChat {
147
  private function define_admin_hooks() {
148
 
149
  require_once JOINCHAT_DIR . 'admin/class-joinchat-admin.php';
 
150
 
151
  $plugin_admin = new JoinChatAdmin( $this->get_plugin_name(), $this->get_version() );
 
 
 
 
152
 
153
- $this->loader->add_action( 'admin_init', $plugin_admin, 'get_settings', 5 );
154
- $this->loader->add_action( 'admin_init', $plugin_admin, 'settings_init' );
155
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'register_styles' );
156
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'register_scripts' );
157
- $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_menu' );
158
  $this->loader->add_action( 'admin_notices', $plugin_admin, 'notices' );
159
  $this->loader->add_action( 'wp_ajax_joinchat_notice_dismiss', $plugin_admin, 'ajax_notice_dismiss' );
160
  $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_meta_boxes' );
161
  $this->loader->add_action( 'admin_init', $plugin_admin, 'add_term_meta_boxes' );
162
  $this->loader->add_action( 'save_post', $plugin_admin, 'save_meta', 10, 2 );
163
- $this->loader->add_action( 'load-settings_page_joinchat', $plugin_admin, 'help_tab' );
164
- $this->loader->add_action( 'load-toplevel_page_joinchat', $plugin_admin, 'help_tab' );
165
  $this->loader->add_action( 'update_option_joinchat', $plugin_admin, 'clear_cache', 100 );
166
-
167
  $this->loader->add_filter( 'plugin_action_links_' . JOINCHAT_BASENAME, $plugin_admin, 'settings_link' );
168
  $this->loader->add_filter( 'plugin_row_meta', $plugin_admin, 'plugin_links', 10, 2 );
169
- $this->loader->add_filter( 'admin_footer_text', $plugin_admin, 'admin_footer_text', PHP_INT_MAX );
170
 
171
- $this->loader->add_filter( 'option_page_capability_joinchat', 'JoinChatUtil', 'capability' );
 
 
 
 
172
 
173
  }
174
 
@@ -190,7 +221,7 @@ class JoinChat {
190
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
191
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
192
  $this->loader->add_action( 'wp_footer', $plugin_public, 'footer_html' );
193
- $this->loader->add_action( 'wp_print_footer_scripts', $plugin_public, 'links_script', 20 );
194
 
195
  }
196
 
@@ -207,49 +238,6 @@ class JoinChat {
207
 
208
  }
209
 
210
- /**
211
- * Migrate 'whatsappme' settings on versions < 4.0 to new 'joinchat'
212
- *
213
- * @since 4.0.0
214
- * @access public
215
- * @return void
216
- */
217
- public function update_wame( $option = false ) {
218
- global $wpdb;
219
-
220
- $wame_option = get_option( 'whatsappme' );
221
-
222
- if ( false !== $wame_option ) {
223
- // General option
224
- $option = $wame_option;
225
- update_option( 'joinchat', $option );
226
- delete_option( 'whatsappme' );
227
-
228
- // Post metas
229
- $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_joinchat' ), array( 'meta_key' => '_whatsappme' ) );
230
-
231
- // WPML strings
232
- $wpml_strings_table = $wpdb->prefix . 'icl_strings';
233
- if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpml_strings_table'" ) === $wpml_strings_table ) {
234
- $wpdb->update( $wpml_strings_table, array( 'context' => 'Join.chat' ), array( 'context' => 'WhatsApp me' ) );
235
- }
236
-
237
- // Polylang strings
238
- $polylang_strings = get_option( 'polylang_wpml_strings' );
239
- if ( false !== $polylang_strings ) {
240
- foreach ( $polylang_strings as $key => $data ) {
241
- if ( 'WhatsApp me' == $data['context'] ) {
242
- $polylang_strings[ $key ]['context'] = 'Join.chat';
243
- }
244
- }
245
- update_option( 'polylang_wpml_strings', $polylang_strings );
246
- }
247
- }
248
-
249
- return $option;
250
-
251
- }
252
-
253
  /**
254
  * Run the loader to execute all of the hooks with WordPress.
255
  *
70
  $this->define_public_hooks();
71
  }
72
 
73
+ // WordPress 5.0 or higher.
74
+ if ( function_exists( 'register_block_type' ) ) {
75
+ $this->define_gutenberg_hooks();
76
+ }
77
+
78
  add_action( 'joinchat_run_pre', array( $this, 'disable_remove_brand' ), 11 );
79
 
80
  }
141
 
142
  }
143
 
144
+ /**
145
+ * Register all of the hooks related to gutenberg functionality
146
+ * of the plugin.
147
+ *
148
+ * @since 4.5.0
149
+ * @access private
150
+ * @return void
151
+ */
152
+ private function define_gutenberg_hooks() {
153
+
154
+ require_once JOINCHAT_DIR . 'gutenberg/class-joinchat-gutenberg.php';
155
+
156
+ $plugin_gutenberg = new JoinChatGutenberg( $this->get_plugin_name(), $this->get_version() );
157
+
158
+ $this->loader->add_action( 'init', $plugin_gutenberg, 'register_meta', 11 );
159
+ $this->loader->add_action( 'init', $plugin_gutenberg, 'register_blocks', 11 );
160
+
161
+ $this->loader->add_action( 'admin_init', $plugin_gutenberg, 'register_patterns' );
162
+ $this->loader->add_action( 'enqueue_block_editor_assets', $plugin_gutenberg, 'enqueue_editor_assets' );
163
+
164
+ $this->loader->add_action( 'wp_footer', $plugin_gutenberg, 'root_styles', 100 );
165
+
166
+ }
167
+
168
  /**
169
  * Register all of the hooks related to the admin area functionality
170
  * of the plugin.
176
  private function define_admin_hooks() {
177
 
178
  require_once JOINCHAT_DIR . 'admin/class-joinchat-admin.php';
179
+ require_once JOINCHAT_DIR . 'admin/class-joinchat-admin-page.php';
180
 
181
  $plugin_admin = new JoinChatAdmin( $this->get_plugin_name(), $this->get_version() );
182
+ $plugin_page = new JoinChatAdminPage( $this->get_plugin_name(), $this->get_version() );
183
+
184
+ $this->loader->add_action( 'admin_init', JoinChatCommon::instance(), 'load_settings', 5 );
185
+ $this->loader->add_filter( 'option_page_capability_joinchat', 'JoinChatUtil', 'capability' );
186
 
 
 
187
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'register_styles' );
188
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'register_scripts' );
 
189
  $this->loader->add_action( 'admin_notices', $plugin_admin, 'notices' );
190
  $this->loader->add_action( 'wp_ajax_joinchat_notice_dismiss', $plugin_admin, 'ajax_notice_dismiss' );
191
  $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_meta_boxes' );
192
  $this->loader->add_action( 'admin_init', $plugin_admin, 'add_term_meta_boxes' );
193
  $this->loader->add_action( 'save_post', $plugin_admin, 'save_meta', 10, 2 );
 
 
194
  $this->loader->add_action( 'update_option_joinchat', $plugin_admin, 'clear_cache', 100 );
 
195
  $this->loader->add_filter( 'plugin_action_links_' . JOINCHAT_BASENAME, $plugin_admin, 'settings_link' );
196
  $this->loader->add_filter( 'plugin_row_meta', $plugin_admin, 'plugin_links', 10, 2 );
 
197
 
198
+ $this->loader->add_action( 'admin_init', $plugin_page, 'settings_init' );
199
+ $this->loader->add_action( 'admin_menu', $plugin_page, 'add_menu' );
200
+ $this->loader->add_action( 'load-settings_page_joinchat', $plugin_page, 'help_tab' );
201
+ $this->loader->add_action( 'load-toplevel_page_joinchat', $plugin_page, 'help_tab' );
202
+ $this->loader->add_filter( 'admin_footer_text', $plugin_page, 'admin_footer_text', PHP_INT_MAX );
203
 
204
  }
205
 
221
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
222
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
223
  $this->loader->add_action( 'wp_footer', $plugin_public, 'footer_html' );
224
+ $this->loader->add_action( 'wp_footer', $plugin_public, 'enqueue_qr_script', 5 );
225
 
226
  }
227
 
238
 
239
  }
240
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  /**
242
  * Run the loader to execute all of the hooks with WordPress.
243
  *
joinchat.php CHANGED
@@ -9,7 +9,7 @@
9
  * Plugin Name: Join.chat
10
  * Plugin URI: https://join.chat
11
  * Description: Connects a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
12
- * Version: 4.4.3
13
  * Author: Creame
14
  * Author URI: https://crea.me
15
  * License: GPL-2.0+
@@ -26,7 +26,7 @@ if ( ! defined( 'WPINC' ) ) {
26
  /**
27
  * Define constants.
28
  */
29
- define( 'JOINCHAT_VERSION', '4.4.3' );
30
  define( 'JOINCHAT_FILE', __FILE__ );
31
  define( 'JOINCHAT_DIR', plugin_dir_path( JOINCHAT_FILE ) );
32
  define( 'JOINCHAT_BASENAME', plugin_basename( JOINCHAT_FILE ) );
9
  * Plugin Name: Join.chat
10
  * Plugin URI: https://join.chat
11
  * Description: Connects a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
12
+ * Version: 4.5.0
13
  * Author: Creame
14
  * Author URI: https://crea.me
15
  * License: GPL-2.0+
26
  /**
27
  * Define constants.
28
  */
29
+ define( 'JOINCHAT_VERSION', '4.5.0' );
30
  define( 'JOINCHAT_FILE', __FILE__ );
31
  define( 'JOINCHAT_DIR', plugin_dir_path( JOINCHAT_FILE ) );
32
  define( 'JOINCHAT_BASENAME', plugin_basename( JOINCHAT_FILE ) );
languages/creame-whatsapp-me.pot CHANGED
@@ -1,667 +1,735 @@
1
- #, fuzzy
 
2
  msgid ""
3
  msgstr ""
4
- "Project-Id-Version: Join.chat\n"
5
- "POT-Creation-Date: 2022-03-25 08:45+0000\n"
6
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
7
- "Last-Translator: Your Name <you@example.com>\n"
8
  "Language-Team: Creame <hola@crea.me>\n"
9
- "Report-Msgid-Bugs-To: Translator Name <translations@example.com>\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
14
- "X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html_x:1,2c;esc_html__;"
17
- "esc_attr_e;esc_attr_x:1,2c;esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_x:"
18
- "1,2c;_n:1,2;_n_noop:1,2;__ngettext:1,2;__ngettext_noop:1,2;_c,_nc:4c,1,2\n"
19
- "X-Poedit-Basepath: ..\n"
20
- "X-Generator: Loco https://localise.biz/\n"
21
- "X-Poedit-SearchPath-0: .\n"
22
- "Language: "
23
-
24
- #: admin/class-joinchat-woo-admin.php:285
25
- msgid ""
26
- "*Hi {SITE}!*\n"
27
- "I have a question about *{PRODUCT} ({SKU})*"
28
  msgstr ""
29
 
30
- #: admin/class-joinchat-admin.php:572
31
- msgid "-1 to display directly without animation"
32
  msgstr ""
33
 
34
- #: admin/class-joinchat-admin.php:609
35
- msgid "0 to disable"
36
  msgstr ""
37
 
38
- #: admin/class-joinchat-admin.php:267
39
- msgid "404 Page"
40
  msgstr ""
41
 
42
- #: admin/class-joinchat-woo-admin.php:336
43
- msgid "<strong>WooCommerce</strong>, in product pages you can also use:"
44
  msgstr ""
45
 
46
- #: admin/class-joinchat-woo-admin.php:248
47
- msgid "Add a contact button on the product sheet."
48
  msgstr ""
49
 
50
- #: admin/class-joinchat-admin.php:592
51
- #, php-format
52
- msgid "Add links, images, videos and more with %s"
 
53
  msgstr ""
54
 
55
- #: admin/class-joinchat-admin.php:528
56
- #, php-format
57
- msgid "Add unlimited numbers with %1$s or multiple contacts with %2$s"
58
  msgstr ""
59
 
60
- #: admin/class-joinchat-admin.php:836
61
- msgid "Adding some CSS classes in your HTML:"
 
 
 
62
  msgstr ""
63
 
64
- #: admin/class-joinchat-admin.php:113
65
- msgid "Advanced"
 
 
 
66
  msgstr ""
67
 
68
- #: admin/class-joinchat-woo-admin.php:149
69
- msgid "After \"Add To Cart\" button"
70
  msgstr ""
71
 
72
- #: admin/class-joinchat-woo-admin.php:150
73
- msgid "After \"Add To Cart\" form"
74
  msgstr ""
75
 
76
- #: admin/class-joinchat-woo-admin.php:151
77
- msgid "After \"Additional information\""
 
78
  msgstr ""
79
 
80
- #: admin/class-joinchat-admin.php:269
81
- msgid "Archives"
82
  msgstr ""
83
 
84
- #: admin/class-joinchat-woo-admin.php:301
85
- msgid "Ask for More Info"
 
86
  msgstr ""
87
 
88
- #: admin/class-joinchat-admin.php:271
89
- msgid "Author Archives"
 
90
  msgstr ""
91
 
92
- #: admin/class-joinchat-admin.php:635
93
- msgid "Auto (detects device dark mode)"
 
 
 
 
 
 
 
 
 
94
  msgstr ""
95
 
96
- #: admin/class-joinchat-admin.php:684
97
- msgid "AW-CONVERSION_ID/CONVERSION_LABEL"
 
98
  msgstr ""
99
 
100
- #: admin/class-joinchat-woo-admin.php:148
101
- msgid "Before \"Add To Cart\" button"
102
  msgstr ""
103
 
104
- #: admin/class-joinchat-woo-admin.php:147
105
- msgid "Before \"Add To Cart\" form"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  msgstr ""
107
 
108
- #: admin/class-joinchat-admin.php:266
 
 
 
 
 
 
 
 
109
  msgid "Blog Page"
110
  msgstr ""
111
 
112
- #: admin/class-joinchat-admin.php:446
113
- msgid "Button"
114
  msgstr ""
115
 
116
- #: admin/class-joinchat-admin.php:236
117
- msgid "Button Delay"
118
  msgstr ""
119
 
120
- #: admin/class-joinchat-woo-admin.php:200
121
- msgid "Button Position"
122
  msgstr ""
123
 
124
- #: admin/class-joinchat-woo-admin.php:201 admin/class-joinchat-admin.php:243
125
- msgid "Button Text"
126
  msgstr ""
127
 
128
- #: admin/class-joinchat-admin.php:242 admin/partials/term_meta_box.php:24
129
- #: admin/partials/post_meta_box.php:22
130
- msgid "Call to Action"
131
  msgstr ""
132
 
133
- #: admin/class-joinchat-woo-admin.php:189
134
- msgid "Call to Action for Products"
135
  msgstr ""
136
 
137
- #: admin/class-joinchat-woo-admin.php:190
138
- msgid "Call to Action for Products on Sale"
139
  msgstr ""
140
 
141
- #: admin/partials/term_meta_box.php:33 admin/partials/post_meta_box.php:29
142
- msgid "Can use vars"
143
  msgstr ""
144
 
145
- #: admin/class-joinchat-woo-admin.php:170
146
- msgid "Cart"
147
  msgstr ""
148
 
149
- #: admin/class-joinchat-admin.php:249
150
- msgid "Chat Delay"
 
151
  msgstr ""
152
 
153
- #: admin/class-joinchat-admin.php:451
154
- msgid "Chat Window"
155
  msgstr ""
156
 
157
- #: admin/class-joinchat-admin.php:610
158
- msgid "Chat Window auto displays after delay"
159
  msgstr ""
160
 
161
- #: admin/class-joinchat-admin.php:615
162
- msgid "Chat Window auto displays from this number of page views"
163
  msgstr ""
164
 
165
- #: includes/class-joinchat-i18n.php:129
166
- msgid "Check translations"
167
  msgstr ""
168
 
169
- #: admin/class-joinchat-woo-admin.php:171
170
- msgid "Checkout"
171
  msgstr ""
172
 
173
- #: public/partials/html.php:52
174
- msgid "Close"
175
  msgstr ""
176
 
177
- #. Description of the plugin
178
- msgid ""
179
- "Connects a WordPress chat with WhatsApp. The best solution for marketing and "
180
- "support. Stop losing customers and increase your sales."
181
  msgstr ""
182
 
183
- #: admin/class-joinchat-admin.php:526
184
- msgid ""
185
- "Contact phone number <strong>(the button will not be shown if it's empty)"
186
- "</strong>"
187
  msgstr ""
188
 
189
- #: admin/class-joinchat-admin.php:835 admin/class-joinchat-admin.php:847
190
- msgid "Contact us"
 
191
  msgstr ""
192
 
193
- #: admin/class-joinchat-admin.php:485
194
- msgid "Conversions"
195
  msgstr ""
196
 
197
- #. Author of the plugin
198
- msgid "Creame"
199
  msgstr ""
200
 
201
- #: admin/class-joinchat-admin.php:476
202
- msgid "Custom Post Types"
203
  msgstr ""
204
 
205
- #: admin/class-joinchat-admin.php:648
206
- msgid "Custom:"
207
  msgstr ""
208
 
209
- #: admin/class-joinchat-admin.php:245 admin/class-joinchat-admin.php:629
210
- msgid "Dark Mode"
211
  msgstr ""
212
 
213
- #: admin/class-joinchat-admin.php:270
214
- msgid "Date Archives"
215
  msgstr ""
216
 
217
- #: includes/class-joinchat-i18n.php:126
218
- #, php-format
219
- msgid "Default site language (%s)"
220
  msgstr ""
221
 
222
- #: admin/partials/term_meta_box.php:47 admin/partials/post_meta_box.php:39
223
- msgid "Default visibility"
 
 
 
 
224
  msgstr ""
225
 
226
- #: admin/class-joinchat-woo-admin.php:280
227
- msgid ""
228
- "Define a text for your products on sale to encourage customers to contact"
 
 
 
229
  msgstr ""
230
 
231
- #: admin/class-joinchat-woo-admin.php:273
232
- msgid "Define a text for your products to encourage customers to contact"
233
  msgstr ""
234
 
235
- #: admin/class-joinchat-admin.php:590
236
- msgid "Define a text to encourage users to contact by WhatsApp"
237
  msgstr ""
238
 
239
- #: admin/class-joinchat-admin.php:621
240
- msgid ""
241
- "Display a notification balloon instead of opening the Chat Window for a "
242
- "\"less intrusive\" mode"
243
  msgstr ""
244
 
245
- #: admin/class-joinchat-admin.php:585
246
- msgid "Display QR code on desktop to scan with phone"
247
  msgstr ""
248
 
249
- #: admin/class-joinchat-admin.php:1253
250
- #, php-format
251
- msgid "Do you like %1$s? Please help us with a %2$s rating."
252
  msgstr ""
253
 
254
- #: admin/class-joinchat-admin.php:925
255
- msgid "Documentation"
256
  msgstr ""
257
 
258
- #: admin/class-joinchat-woo-admin.php:154
259
- msgid "Don't show"
260
  msgstr ""
261
 
262
- #: admin/class-joinchat-admin.php:158
263
- msgid "e.g."
264
  msgstr ""
265
 
266
- #: admin/class-joinchat-admin.php:835 admin/class-joinchat-admin.php:847
267
- msgid "Example:"
268
  msgstr ""
269
 
270
- #: admin/class-joinchat-admin.php:674
271
- msgid ""
272
- "Explain how you will use the user's contact and the conditions they accept."
273
  msgstr ""
274
 
275
- #: admin/class-joinchat-admin.php:870
276
- #, php-format
277
- msgid "Follow %s on twitter."
278
  msgstr ""
279
 
280
- #: admin/class-joinchat-woo-admin.php:342
281
- msgid ""
282
- "For the <strong>Call to Action for Products on Sale</strong>, you can also "
283
- "use:"
284
  msgstr ""
285
 
286
- #: admin/class-joinchat-admin.php:467
287
- msgid ""
288
- "From here you can configure on which pages the WhatsApp button will be "
289
- "visible."
290
  msgstr ""
291
 
292
- #: admin/class-joinchat-admin.php:265
293
- msgid "Front Page"
294
  msgstr ""
295
 
296
- #: admin/class-joinchat-admin.php:111
297
- msgid "General"
 
298
  msgstr ""
299
 
300
- #: admin/class-joinchat-admin.php:260
301
- msgid "Global"
302
  msgstr ""
303
 
304
- #: admin/class-joinchat-admin.php:771
305
- msgid "Go to settings"
306
  msgstr ""
307
 
308
- #: admin/class-joinchat-admin.php:309
309
- msgid "Google Ads Conversion"
310
  msgstr ""
311
 
312
- #: admin/class-joinchat-admin.php:246 admin/class-joinchat-admin.php:642
313
- msgid "Header"
314
  msgstr ""
315
 
316
- #: admin/class-joinchat-admin.php:589
317
  msgid ""
318
  "Hello 👋\n"
319
  "Can we help you?"
320
  msgstr ""
321
 
322
- #: admin/class-joinchat-admin.php:598
 
 
 
 
 
 
 
 
 
323
  msgid "Hi *{SITE}*! I need more info about {TITLE} {URL}"
324
  msgstr ""
325
 
326
- #: admin/class-joinchat-admin.php:513 admin/class-joinchat-admin.php:721
327
- #: admin/partials/term_meta_box.php:45 admin/partials/post_meta_box.php:37
328
- msgid "Hide"
329
  msgstr ""
330
 
331
- #. Author URI of the plugin
332
- msgid "https://crea.me"
 
333
  msgstr ""
334
 
335
- #. URI of the plugin
336
- msgid "https://join.chat"
337
  msgstr ""
338
 
339
- #: admin/class-joinchat-admin.php:460
340
- msgid ""
341
- "If it's defined a \"Call to Action\", the Chat Window can be displayed "
342
- "automatically if conditions are met."
343
  msgstr ""
344
 
345
- #: admin/class-joinchat-admin.php:453
346
- msgid ""
347
- "If you define a \"Call to Action\" a window will be displayed simulating a "
348
- "chat before launching WhatsApp."
349
  msgstr ""
350
 
351
- #: admin/class-joinchat-admin.php:859
352
- msgid "If you like Join.chat 😍"
353
  msgstr ""
354
 
355
- #: admin/class-joinchat-admin.php:854
356
- #, php-format
357
- msgid ""
358
- "If you need help, first review our <a href=\"%1$s\" target=\"_blank\">"
359
- "documentation</a> and if you don't find a solution check the <a "
360
- "href=\"%2$s\" target=\"_blank\">free plugin support forum</a> or buy our <a "
361
- "href=\"%3$s\" target=\"_blank\">premium support</a>."
362
  msgstr ""
363
 
364
- #: admin/class-joinchat-admin.php:233
365
- msgid "Image"
366
  msgstr ""
367
 
368
- #: admin/class-joinchat-admin.php:515
369
- msgid "Inherit"
370
  msgstr ""
371
 
372
- #: admin/class-joinchat-admin.php:168
373
- msgid "is an example, double click to use it"
374
  msgstr ""
375
 
376
- #. Name of the plugin
377
- #: admin/class-joinchat-admin.php:1003 admin/partials/term_meta_box.php:16
378
- msgid "Join.chat"
379
  msgstr ""
380
 
381
- #: admin/class-joinchat-admin.php:956
382
- msgid "Join.chat Settings"
383
  msgstr ""
384
 
385
- #: includes/class-joinchat-elementor-finder.php:52
386
- #: includes/class-joinchat-elementor-finder.php:59
387
- #: includes/class-joinchat-integrations.php:112
388
- msgid "Join.chat settings page"
389
  msgstr ""
390
 
391
- #: includes/class-joinchat-elementor-finder.php:51
392
- msgctxt "Keywords in Elementor Finder"
393
- msgid "settings,phone"
394
  msgstr ""
395
 
396
- #: includes/class-joinchat-elementor-finder.php:58
397
- msgctxt "Keywords in Elementor Finder"
398
- msgid "visibility,show,hide"
399
  msgstr ""
400
 
401
- #: includes/class-joinchat-integrations.php:111
402
- msgctxt "Keywords in Elementor Finder"
403
- msgid "woocommerce,shop,product"
404
  msgstr ""
405
 
406
- #: admin/class-joinchat-admin.php:543
407
- msgid "Left"
408
  msgstr ""
409
 
410
- #: admin/class-joinchat-admin.php:232 admin/partials/term_meta_box.php:28
411
- #: admin/partials/post_meta_box.php:26
412
- msgid "Message"
413
  msgstr ""
414
 
415
- #: admin/class-joinchat-woo-admin.php:191
416
- msgid "Message for Products"
417
  msgstr ""
418
 
419
- #: admin/class-joinchat-admin.php:237 admin/class-joinchat-admin.php:535
420
- msgid "Mobile Only"
421
  msgstr ""
422
 
423
- #: admin/class-joinchat-woo-admin.php:173
424
- msgid "My Account"
425
  msgstr ""
426
 
427
- #: admin/class-joinchat-admin.php:631
428
- msgid "No"
429
  msgstr ""
430
 
431
- #: admin/class-joinchat-admin.php:251 admin/class-joinchat-admin.php:619
432
- msgid "Notification Balloon"
433
  msgstr ""
434
 
435
- #: admin/class-joinchat-admin.php:537
436
- msgid "Only display the button on mobile devices"
437
  msgstr ""
438
 
439
- #: admin/class-joinchat-admin.php:843
440
- msgid "only show if it's an not seen CTA."
441
  msgstr ""
442
 
443
- #: admin/class-joinchat-admin.php:579
444
- msgid "Open <em>WhatsApp Web</em> directly on desktop"
 
445
  msgstr ""
446
 
447
- #: admin/class-joinchat-admin.php:603 includes/class-joinchat-common.php:41
448
- msgid "Open chat"
 
449
  msgstr ""
450
 
451
- #: admin/class-joinchat-admin.php:480
452
- msgid "Opt-in"
 
453
  msgstr ""
454
 
455
- #: admin/class-joinchat-admin.php:481
456
- msgid "Opt-in is a users’ consent to receive messages from a business."
 
457
  msgstr ""
458
 
459
- #: admin/class-joinchat-admin.php:306 admin/class-joinchat-admin.php:678
460
- msgid "Opt-in Required"
461
  msgstr ""
462
 
463
- #: admin/class-joinchat-admin.php:305
464
- msgid "Opt-in Text"
465
  msgstr ""
466
 
467
- #: public/partials/html.php:37
468
- msgid "or scan the code"
469
  msgstr ""
470
 
471
- #: admin/class-joinchat-admin.php:560
472
- #, php-format
473
- msgid "Other icons and more channels (Telegram, Messenger…) with %s"
474
  msgstr ""
475
 
476
- #: admin/class-joinchat-admin.php:273
477
- msgid "Page"
478
  msgstr ""
479
 
480
- #: admin/class-joinchat-admin.php:820
481
- msgid "Page Title"
 
482
  msgstr ""
483
 
484
- #: admin/class-joinchat-admin.php:250
485
- msgid "Page Views"
 
 
 
 
 
486
  msgstr ""
487
 
488
- #: admin/class-joinchat-admin.php:862
489
- #, php-format
490
  msgid "Please leave us a %s rating. We'll thank you."
491
  msgstr ""
492
 
493
- #: admin/class-joinchat-admin.php:235 admin/class-joinchat-admin.php:541
494
- msgid "Position on Screen"
 
495
  msgstr ""
496
 
497
- #: admin/class-joinchat-admin.php:274
498
- msgid "Post"
 
499
  msgstr ""
500
 
501
- #: public/partials/html.php:45
502
- msgid "Powered by"
503
  msgstr ""
504
 
505
- #: admin/class-joinchat-admin.php:644
506
- msgid "Powered by Join.chat"
507
  msgstr ""
508
 
509
- #: admin/class-joinchat-woo-admin.php:287
510
- msgid "Predefined text for the first message the client will send you"
 
511
  msgstr ""
512
 
513
- #: admin/class-joinchat-admin.php:599
514
- msgid "Predefined text for the first message the user will send you"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
515
  msgstr ""
516
 
517
- #: admin/class-joinchat-admin.php:903
518
  msgid "Premium"
519
  msgstr ""
520
 
521
- #: admin/class-joinchat-woo-admin.php:247
522
- msgid "Product Button"
523
  msgstr ""
524
 
525
- #: admin/class-joinchat-woo-admin.php:242
526
- msgid "Product Chat Window"
527
  msgstr ""
528
 
529
- #: admin/class-joinchat-woo-admin.php:338
530
- msgid "Product Name"
531
  msgstr ""
532
 
533
- #: admin/class-joinchat-woo-admin.php:169
534
- msgid "Product Page"
535
  msgstr ""
536
 
537
- #: admin/class-joinchat-admin.php:239 admin/class-joinchat-admin.php:583
538
- msgid "QR Code"
539
  msgstr ""
540
 
541
- #: admin/class-joinchat-admin.php:557
542
- msgid "Remove"
543
  msgstr ""
544
 
545
- #: admin/class-joinchat-admin.php:468
546
- msgid "Restore default visibility"
547
  msgstr ""
548
 
549
- #: admin/class-joinchat-admin.php:545
550
- msgid "Right"
551
  msgstr ""
552
 
553
- #: admin/class-joinchat-woo-admin.php:278
554
- msgid ""
555
- "Save {DISCOUNT}! This *{PRODUCT}* can be yours for only ~{REGULAR}~ *{PRICE}"
556
- "*.\n"
557
- "If you have any questions, ask us."
558
  msgstr ""
559
 
560
- #: admin/class-joinchat-admin.php:268
561
- msgid "Search Results"
562
  msgstr ""
563
 
564
- #: admin/class-joinchat-admin.php:572 admin/class-joinchat-admin.php:609
565
- msgid "seconds"
566
  msgstr ""
567
 
568
- #: admin/class-joinchat-admin.php:555
569
- msgid "Select an image"
570
  msgstr ""
571
 
572
- #: admin/class-joinchat-admin.php:556
573
- msgid "Select button image"
574
  msgstr ""
575
 
576
- #: admin/class-joinchat-woo-admin.php:297
577
- msgid "Select the position of the button on the product page"
578
  msgstr ""
579
 
580
- #: admin/class-joinchat-admin.php:685
581
- msgid "Send the conversion automatically at the chat start"
582
  msgstr ""
583
 
584
- #: admin/class-joinchat-admin.php:447
585
- msgid ""
586
- "Set the contact number and where you want the WhatsApp button to be "
587
- "displayed."
588
  msgstr ""
589
 
590
- #: admin/class-joinchat-admin.php:893
591
- msgid "Settings"
592
  msgstr ""
593
 
594
- #: admin/class-joinchat-admin.php:391
595
- msgid "Settings saved"
596
  msgstr ""
597
 
598
- #: admin/class-joinchat-woo-admin.php:168
599
- msgid "Shop"
600
  msgstr ""
601
 
602
- #: admin/class-joinchat-admin.php:567
603
- msgid "Short text shown next to button"
604
  msgstr ""
605
 
606
- #: admin/class-joinchat-admin.php:511 admin/class-joinchat-admin.php:719
607
- #: admin/partials/term_meta_box.php:43 admin/partials/post_meta_box.php:35
608
- msgid "Show"
609
  msgstr ""
610
 
611
- #: admin/class-joinchat-admin.php:461 admin/class-joinchat-admin.php:1190
612
- msgid "Show Help"
613
  msgstr ""
614
 
615
- #: admin/class-joinchat-admin.php:272
616
- msgid "Singular"
 
 
617
  msgstr ""
618
 
619
- #: admin/class-joinchat-admin.php:814
620
- msgid "Styles and Variables"
621
  msgstr ""
622
 
623
- #: admin/class-joinchat-admin.php:866
624
- #, php-format
625
- msgid "Subscribe to our newsletter and visit our blog at %s."
 
626
  msgstr ""
627
 
628
- #: admin/class-joinchat-admin.php:851 admin/class-joinchat-admin.php:926
629
- msgid "Support"
630
  msgstr ""
631
 
632
- #: admin/class-joinchat-admin.php:231 admin/partials/term_meta_box.php:20
633
- #: admin/partials/post_meta_box.php:18
634
- msgid "Telephone"
 
635
  msgstr ""
636
 
637
- #: admin/class-joinchat-admin.php:604
638
- msgid "Text to open chat on Chat Window button"
639
  msgstr ""
640
 
641
- #: admin/class-joinchat-woo-admin.php:172
642
- msgid "Thank You"
643
  msgstr ""
644
 
645
- #: admin/class-joinchat-admin.php:558
646
- msgid "The image will alternate with button icon"
647
  msgstr ""
648
 
649
- #: admin/class-joinchat-admin.php:244
650
- msgid "Theme Color"
651
  msgstr ""
652
 
653
- #: includes/class-joinchat-i18n.php:127
654
- msgid "There are changes in fields that can be translated."
655
  msgstr ""
656
 
657
- #: admin/class-joinchat-woo-admin.php:271
658
- msgid ""
659
- "This *{PRODUCT}* can be yours for only *{PRICE}*!\n"
660
- "If you have any questions, ask us."
661
  msgstr ""
662
 
663
- #: admin/class-joinchat-admin.php:573
664
- msgid "Time since the page is opened until the button is displayed"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
665
  msgstr ""
666
 
667
  #: includes/class-joinchat-elementor-finder.php:48
@@ -669,120 +737,133 @@ msgctxt "Title in Elementor Finder"
669
  msgid "General Settings"
670
  msgstr ""
671
 
 
 
 
 
 
 
 
 
 
 
 
672
  #: includes/class-joinchat-elementor-finder.php:55
673
  msgctxt "Title in Elementor Finder"
674
  msgid "Visibility Settings"
675
  msgstr ""
676
 
677
- #: includes/class-joinchat-integrations.php:108
678
- msgctxt "Title in Elementor Finder"
679
- msgid "WooCommerce Settings"
680
  msgstr ""
681
 
682
- #: admin/class-joinchat-admin.php:839
683
- msgid "to hide Chat Window on click."
 
684
  msgstr ""
685
 
686
- #: admin/partials/term_meta_box.php:35 admin/partials/post_meta_box.php:31
687
- msgid "to leave it blank use"
688
  msgstr ""
689
 
690
- #: admin/class-joinchat-admin.php:833 admin/class-joinchat-admin.php:840
691
- msgid "to open WhatsApp directly on click."
692
  msgstr ""
693
 
694
- #: admin/class-joinchat-admin.php:844
695
- msgid "to show always."
 
696
  msgstr ""
697
 
698
- #: admin/class-joinchat-admin.php:832 admin/class-joinchat-admin.php:838
699
- msgid "to show Chat Window (or open WhatsApp if there is no CTA) on click."
 
700
  msgstr ""
701
 
702
- #: admin/class-joinchat-admin.php:841
703
- msgid ""
704
- "To show Chat Window when an HTML element appears on screen when user scrolls:"
705
  msgstr ""
706
 
707
- #: admin/class-joinchat-admin.php:234
708
- msgid "Tooltip"
709
  msgstr ""
710
 
711
- #: admin/class-joinchat-admin.php:827
712
- msgid "Triggers"
713
  msgstr ""
714
 
715
- #: admin/class-joinchat-admin.php:556
716
- msgid "Use image"
717
  msgstr ""
718
 
719
- #: admin/class-joinchat-admin.php:680
720
- msgid "User approval is required to enable the contact button"
721
  msgstr ""
722
 
723
- #: admin/class-joinchat-admin.php:112 admin/partials/term_meta_box.php:40
724
- msgid "Visibility"
725
  msgstr ""
726
 
727
- #: admin/class-joinchat-admin.php:466
728
- msgid "Visibility Settings"
729
  msgstr ""
730
 
731
- #: admin/class-joinchat-admin.php:646
732
- msgid "WhatsApp Logo"
733
  msgstr ""
734
 
735
- #: admin/class-joinchat-admin.php:238 admin/class-joinchat-admin.php:577
736
- msgid "WhatsApp Web"
737
  msgstr ""
738
 
739
- #: admin/class-joinchat-admin.php:830
740
- msgid "With anchor links:"
741
  msgstr ""
742
 
743
- #: admin/class-joinchat-woo-admin.php:238
744
- msgid "WooCommerce"
745
  msgstr ""
746
 
747
- #: admin/class-joinchat-admin.php:633
748
- msgid "Yes"
749
  msgstr ""
750
 
751
- #: admin/class-joinchat-woo-admin.php:243
752
- msgid ""
753
- "You can define other different texts for the Chat Window on the product "
754
- "pages."
755
  msgstr ""
756
 
757
- #: admin/class-joinchat-admin.php:829
758
- msgid "You can interact on your page with Join.chat in two ways:"
759
  msgstr ""
760
 
761
- #: admin/class-joinchat-admin.php:454
762
- msgid ""
763
- "You can introduce yourself, offer help or even make promotions to your users."
764
  msgstr ""
765
 
766
- #: admin/class-joinchat-admin.php:817
767
- msgid ""
768
- "You can use dynamic variables that will be replaced by the values of the "
769
- "page the user visits:"
770
  msgstr ""
771
 
772
- #: admin/class-joinchat-admin.php:816
773
- msgid ""
774
- "You can use formatting styles like in WhatsApp: _<em>italic</em>_ *<strong>"
775
- "bold</strong>* ~<del>strikethrough</del>~."
776
  msgstr ""
777
 
778
- #: admin/class-joinchat-admin.php:1189
779
- msgid "You can use vars"
 
780
  msgstr ""
781
 
782
- #: admin/class-joinchat-admin.php:770
783
- msgid "You only need to add your WhatsApp number to contact with your users."
 
784
  msgstr ""
785
 
786
- #: admin/class-joinchat-admin.php:566
787
- msgid "💬 Need help?"
 
788
  msgstr ""
1
+ # Copyright (C) 2022 Creame
2
+ # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Join.chat 4.5.0\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/creame-whatsapp-me\n"
7
+ "Last-Translator: Pacotoleo <pacotole@crea.me>\n"
 
8
  "Language-Team: Creame <hola@crea.me>\n"
 
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-05-27T16:11:33+00:00\n"
13
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
+ "X-Generator: WP-CLI 2.6.0\n"
15
+ "X-Domain: creame-whatsapp-me\n"
16
+
17
+ #. Plugin Name of the plugin
18
+ #: admin/class-joinchat-admin.php:227
19
+ #: admin/partials/term_meta_box.php:16
20
+ #: gutenberg/build/index.js:1
21
+ msgid "Join.chat"
 
 
 
 
 
22
  msgstr ""
23
 
24
+ #. Plugin URI of the plugin
25
+ msgid "https://join.chat"
26
  msgstr ""
27
 
28
+ #. Description of the plugin
29
+ msgid "Connects a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales."
30
  msgstr ""
31
 
32
+ #. Author of the plugin
33
+ msgid "Creame"
34
  msgstr ""
35
 
36
+ #. Author URI of the plugin
37
+ msgid "https://crea.me"
38
  msgstr ""
39
 
40
+ #: admin/class-joinchat-admin-page.php:99
41
+ msgid "General"
42
  msgstr ""
43
 
44
+ #: admin/class-joinchat-admin-page.php:100
45
+ #: admin/partials/term_meta_box.php:40
46
+ #: gutenberg/build/index.js:1
47
+ msgid "Visibility"
48
  msgstr ""
49
 
50
+ #: admin/class-joinchat-admin-page.php:101
51
+ msgid "Advanced"
 
52
  msgstr ""
53
 
54
+ #: admin/class-joinchat-admin-page.php:150
55
+ #: admin/partials/post_meta_box.php:18
56
+ #: admin/partials/term_meta_box.php:20
57
+ #: gutenberg/build/index.js:1
58
+ msgid "Telephone"
59
  msgstr ""
60
 
61
+ #: admin/class-joinchat-admin-page.php:151
62
+ #: admin/partials/post_meta_box.php:26
63
+ #: admin/partials/term_meta_box.php:28
64
+ #: gutenberg/build/index.js:1
65
+ msgid "Message"
66
  msgstr ""
67
 
68
+ #: admin/class-joinchat-admin-page.php:152
69
+ msgid "Image"
70
  msgstr ""
71
 
72
+ #: admin/class-joinchat-admin-page.php:153
73
+ msgid "Tooltip"
74
  msgstr ""
75
 
76
+ #: admin/class-joinchat-admin-page.php:154
77
+ #: admin/class-joinchat-admin-page.php:462
78
+ msgid "Position on Screen"
79
  msgstr ""
80
 
81
+ #: admin/class-joinchat-admin-page.php:155
82
+ msgid "Button Delay"
83
  msgstr ""
84
 
85
+ #: admin/class-joinchat-admin-page.php:156
86
+ #: admin/class-joinchat-admin-page.php:456
87
+ msgid "Mobile Only"
88
  msgstr ""
89
 
90
+ #: admin/class-joinchat-admin-page.php:157
91
+ #: admin/class-joinchat-admin-page.php:499
92
+ msgid "WhatsApp Web"
93
  msgstr ""
94
 
95
+ #: admin/class-joinchat-admin-page.php:158
96
+ #: admin/class-joinchat-admin-page.php:505
97
+ #: gutenberg/build/index.js:1
98
+ msgid "QR Code"
99
+ msgstr ""
100
+
101
+ #: admin/class-joinchat-admin-page.php:161
102
+ #: admin/partials/post_meta_box.php:22
103
+ #: admin/partials/term_meta_box.php:24
104
+ #: gutenberg/build/index.js:1
105
+ msgid "Call to Action"
106
  msgstr ""
107
 
108
+ #: admin/class-joinchat-admin-page.php:162
109
+ #: admin/class-joinchat-woo-admin.php:212
110
+ msgid "Button Text"
111
  msgstr ""
112
 
113
+ #: admin/class-joinchat-admin-page.php:163
114
+ msgid "Theme Color"
115
  msgstr ""
116
 
117
+ #: admin/class-joinchat-admin-page.php:164
118
+ #: admin/class-joinchat-admin-page.php:552
119
+ msgid "Dark Mode"
120
+ msgstr ""
121
+
122
+ #: admin/class-joinchat-admin-page.php:165
123
+ #: admin/class-joinchat-admin-page.php:565
124
+ msgid "Header"
125
+ msgstr ""
126
+
127
+ #: admin/class-joinchat-admin-page.php:168
128
+ msgid "Chat Delay"
129
+ msgstr ""
130
+
131
+ #: admin/class-joinchat-admin-page.php:169
132
+ msgid "Page Views"
133
+ msgstr ""
134
+
135
+ #: admin/class-joinchat-admin-page.php:170
136
+ #: admin/class-joinchat-admin-page.php:542
137
+ msgid "Notification Balloon"
138
  msgstr ""
139
 
140
+ #: admin/class-joinchat-admin-page.php:179
141
+ msgid "Global"
142
+ msgstr ""
143
+
144
+ #: admin/class-joinchat-admin-page.php:184
145
+ msgid "Front Page"
146
+ msgstr ""
147
+
148
+ #: admin/class-joinchat-admin-page.php:185
149
  msgid "Blog Page"
150
  msgstr ""
151
 
152
+ #: admin/class-joinchat-admin-page.php:186
153
+ msgid "404 Page"
154
  msgstr ""
155
 
156
+ #: admin/class-joinchat-admin-page.php:187
157
+ msgid "Search Results"
158
  msgstr ""
159
 
160
+ #: admin/class-joinchat-admin-page.php:188
161
+ msgid "Archives"
162
  msgstr ""
163
 
164
+ #: admin/class-joinchat-admin-page.php:189
165
+ msgid "Date Archives"
166
  msgstr ""
167
 
168
+ #: admin/class-joinchat-admin-page.php:190
169
+ msgid "Author Archives"
 
170
  msgstr ""
171
 
172
+ #: admin/class-joinchat-admin-page.php:191
173
+ msgid "Singular"
174
  msgstr ""
175
 
176
+ #: admin/class-joinchat-admin-page.php:192
177
+ msgid "Page"
178
  msgstr ""
179
 
180
+ #: admin/class-joinchat-admin-page.php:193
181
+ msgid "Post"
182
  msgstr ""
183
 
184
+ #: admin/class-joinchat-admin-page.php:224
185
+ msgid "Opt-in Text"
186
  msgstr ""
187
 
188
+ #: admin/class-joinchat-admin-page.php:225
189
+ #: admin/class-joinchat-admin-page.php:601
190
+ msgid "Opt-in Required"
191
  msgstr ""
192
 
193
+ #: admin/class-joinchat-admin-page.php:228
194
+ msgid "Google Ads Conversion"
195
  msgstr ""
196
 
197
+ #: admin/class-joinchat-admin-page.php:306
198
+ msgid "Settings saved"
199
  msgstr ""
200
 
201
+ #: admin/class-joinchat-admin-page.php:365
202
+ msgid "Button"
203
  msgstr ""
204
 
205
+ #: admin/class-joinchat-admin-page.php:366
206
+ msgid "Set the contact number and where you want the WhatsApp button to be displayed."
207
  msgstr ""
208
 
209
+ #: admin/class-joinchat-admin-page.php:370
210
+ msgid "Chat Window"
211
  msgstr ""
212
 
213
+ #: admin/class-joinchat-admin-page.php:372
214
+ msgid "If you define a \"Call to Action\" a window will be displayed simulating a chat before launching WhatsApp."
215
  msgstr ""
216
 
217
+ #: admin/class-joinchat-admin-page.php:373
218
+ msgid "You can introduce yourself, offer help or even make promotions to your users."
 
 
219
  msgstr ""
220
 
221
+ #: admin/class-joinchat-admin-page.php:379
222
+ msgid "If it's defined a \"Call to Action\", the Chat Window can be displayed automatically if conditions are met."
 
 
223
  msgstr ""
224
 
225
+ #: admin/class-joinchat-admin-page.php:380
226
+ #: admin/class-joinchat-admin-page.php:809
227
+ msgid "Show Help"
228
  msgstr ""
229
 
230
+ #: admin/class-joinchat-admin-page.php:385
231
+ msgid "Visibility Settings"
232
  msgstr ""
233
 
234
+ #: admin/class-joinchat-admin-page.php:386
235
+ msgid "From here you can configure on which pages the WhatsApp button will be visible."
236
  msgstr ""
237
 
238
+ #: admin/class-joinchat-admin-page.php:387
239
+ msgid "Restore default visibility"
240
  msgstr ""
241
 
242
+ #: admin/class-joinchat-admin-page.php:395
243
+ msgid "Custom Post Types"
244
  msgstr ""
245
 
246
+ #: admin/class-joinchat-admin-page.php:399
247
+ msgid "Opt-in"
248
  msgstr ""
249
 
250
+ #: admin/class-joinchat-admin-page.php:400
251
+ msgid "Opt-in is a users’ consent to receive messages from a business."
252
  msgstr ""
253
 
254
+ #: admin/class-joinchat-admin-page.php:404
255
+ msgid "Conversions"
 
256
  msgstr ""
257
 
258
+ #: admin/class-joinchat-admin-page.php:431
259
+ #: admin/class-joinchat-admin-page.php:648
260
+ #: admin/partials/post_meta_box.php:35
261
+ #: admin/partials/term_meta_box.php:43
262
+ #: gutenberg/build/index.js:1
263
+ msgid "Show"
264
  msgstr ""
265
 
266
+ #: admin/class-joinchat-admin-page.php:433
267
+ #: admin/class-joinchat-admin-page.php:650
268
+ #: admin/partials/post_meta_box.php:37
269
+ #: admin/partials/term_meta_box.php:45
270
+ #: gutenberg/build/index.js:1
271
+ msgid "Hide"
272
  msgstr ""
273
 
274
+ #: admin/class-joinchat-admin-page.php:435
275
+ msgid "Inherit"
276
  msgstr ""
277
 
278
+ #: admin/class-joinchat-admin-page.php:446
279
+ msgid "Contact phone number <strong>(the button will not be shown if it's empty)</strong>"
280
  msgstr ""
281
 
282
+ #. translators: 1: Random Phone link, 2: Support Agents link.
283
+ #: admin/class-joinchat-admin-page.php:449
284
+ msgid "Add unlimited numbers with %1$s or multiple contacts with %2$s"
 
285
  msgstr ""
286
 
287
+ #: admin/class-joinchat-admin-page.php:458
288
+ msgid "Only display the button on mobile devices"
289
  msgstr ""
290
 
291
+ #: admin/class-joinchat-admin-page.php:464
292
+ msgid "Left"
 
293
  msgstr ""
294
 
295
+ #: admin/class-joinchat-admin-page.php:466
296
+ msgid "Right"
297
  msgstr ""
298
 
299
+ #: admin/class-joinchat-admin-page.php:476
300
+ msgid "Select an image"
301
  msgstr ""
302
 
303
+ #: admin/class-joinchat-admin-page.php:477
304
+ msgid "Select button image"
305
  msgstr ""
306
 
307
+ #: admin/class-joinchat-admin-page.php:477
308
+ msgid "Use image"
309
  msgstr ""
310
 
311
+ #: admin/class-joinchat-admin-page.php:478
312
+ msgid "Remove"
 
313
  msgstr ""
314
 
315
+ #: admin/class-joinchat-admin-page.php:479
316
+ msgid "The image will alternate with button icon"
 
317
  msgstr ""
318
 
319
+ #. translators: %s: OmniChannel link.
320
+ #: admin/class-joinchat-admin-page.php:482
321
+ msgid "Other icons and more channels (Telegram, Messenger…) with %s"
 
322
  msgstr ""
323
 
324
+ #: admin/class-joinchat-admin-page.php:488
325
+ msgid "💬 Need help?"
 
 
326
  msgstr ""
327
 
328
+ #: admin/class-joinchat-admin-page.php:489
329
+ msgid "Short text shown next to button"
330
  msgstr ""
331
 
332
+ #: admin/class-joinchat-admin-page.php:494
333
+ #: admin/class-joinchat-admin-page.php:532
334
+ msgid "seconds"
335
  msgstr ""
336
 
337
+ #: admin/class-joinchat-admin-page.php:494
338
+ msgid "-1 to display directly without animation"
339
  msgstr ""
340
 
341
+ #: admin/class-joinchat-admin-page.php:495
342
+ msgid "Time since the page is opened until the button is displayed"
343
  msgstr ""
344
 
345
+ #: admin/class-joinchat-admin-page.php:501
346
+ msgid "Open <em>WhatsApp Web</em> directly on desktop"
347
  msgstr ""
348
 
349
+ #: admin/class-joinchat-admin-page.php:507
350
+ msgid "Display QR code on desktop to scan with phone"
351
  msgstr ""
352
 
353
+ #: admin/class-joinchat-admin-page.php:511
354
  msgid ""
355
  "Hello 👋\n"
356
  "Can we help you?"
357
  msgstr ""
358
 
359
+ #: admin/class-joinchat-admin-page.php:512
360
+ msgid "Define a text to encourage users to contact by WhatsApp"
361
+ msgstr ""
362
+
363
+ #. translators: %s: CTA Extras link.
364
+ #: admin/class-joinchat-admin-page.php:515
365
+ msgid "Add links, images, videos and more with %s"
366
+ msgstr ""
367
+
368
+ #: admin/class-joinchat-admin-page.php:521
369
  msgid "Hi *{SITE}*! I need more info about {TITLE} {URL}"
370
  msgstr ""
371
 
372
+ #: admin/class-joinchat-admin-page.php:522
373
+ msgid "Predefined text for the first message the user will send you"
 
374
  msgstr ""
375
 
376
+ #: admin/class-joinchat-admin-page.php:526
377
+ #: includes/class-joinchat-common.php:94
378
+ msgid "Open chat"
379
  msgstr ""
380
 
381
+ #: admin/class-joinchat-admin-page.php:527
382
+ msgid "Text to open chat on Chat Window button"
383
  msgstr ""
384
 
385
+ #: admin/class-joinchat-admin-page.php:532
386
+ msgid "0 to disable"
 
 
387
  msgstr ""
388
 
389
+ #: admin/class-joinchat-admin-page.php:533
390
+ msgid "Chat Window auto displays after delay"
 
 
391
  msgstr ""
392
 
393
+ #: admin/class-joinchat-admin-page.php:538
394
+ msgid "Chat Window auto displays from this number of page views"
395
  msgstr ""
396
 
397
+ #: admin/class-joinchat-admin-page.php:544
398
+ msgid "Display a notification balloon instead of opening the Chat Window for a \"less intrusive\" mode"
 
 
 
 
 
399
  msgstr ""
400
 
401
+ #: admin/class-joinchat-admin-page.php:554
402
+ msgid "No"
403
  msgstr ""
404
 
405
+ #: admin/class-joinchat-admin-page.php:556
406
+ msgid "Yes"
407
  msgstr ""
408
 
409
+ #: admin/class-joinchat-admin-page.php:558
410
+ msgid "Auto (detects device dark mode)"
411
  msgstr ""
412
 
413
+ #: admin/class-joinchat-admin-page.php:567
414
+ msgid "Powered by Join.chat"
 
415
  msgstr ""
416
 
417
+ #: admin/class-joinchat-admin-page.php:569
418
+ msgid "WhatsApp Logo"
419
  msgstr ""
420
 
421
+ #: admin/class-joinchat-admin-page.php:571
422
+ msgid "Custom:"
 
 
423
  msgstr ""
424
 
425
+ #: admin/class-joinchat-admin-page.php:597
426
+ msgid "Explain how you will use the user's contact and the conditions they accept."
 
427
  msgstr ""
428
 
429
+ #: admin/class-joinchat-admin-page.php:603
430
+ msgid "User approval is required to enable the contact button"
 
431
  msgstr ""
432
 
433
+ #: admin/class-joinchat-admin-page.php:610
434
+ msgid "Conversion ID"
 
435
  msgstr ""
436
 
437
+ #: admin/class-joinchat-admin-page.php:611
438
+ msgid "Conversion label"
439
  msgstr ""
440
 
441
+ #: admin/class-joinchat-admin-page.php:613
442
+ msgid "Send the conversion automatically at the chat start"
 
443
  msgstr ""
444
 
445
+ #: admin/class-joinchat-admin-page.php:670
446
+ msgid "Styles and Variables"
447
  msgstr ""
448
 
449
+ #: admin/class-joinchat-admin-page.php:672
450
+ msgid "You can use formatting styles like in WhatsApp: _<em>italic</em>_ *<strong>bold</strong>* ~<del>strikethrough</del>~."
451
  msgstr ""
452
 
453
+ #: admin/class-joinchat-admin-page.php:673
454
+ msgid "You can use dynamic variables that will be replaced by the values of the page the user visits:"
455
  msgstr ""
456
 
457
+ #: admin/class-joinchat-admin-page.php:676
458
+ msgid "Page Title"
459
  msgstr ""
460
 
461
+ #: admin/class-joinchat-admin-page.php:683
462
+ msgid "Triggers"
463
  msgstr ""
464
 
465
+ #: admin/class-joinchat-admin-page.php:685
466
+ msgid "You can interact on your page with Join.chat in two ways:"
467
  msgstr ""
468
 
469
+ #: admin/class-joinchat-admin-page.php:686
470
+ msgid "With anchor links:"
471
  msgstr ""
472
 
473
+ #: admin/class-joinchat-admin-page.php:688
474
+ #: admin/class-joinchat-admin-page.php:694
475
+ msgid "to show Chat Window (or open WhatsApp if there is no CTA) on click."
476
  msgstr ""
477
 
478
+ #: admin/class-joinchat-admin-page.php:689
479
+ #: admin/class-joinchat-admin-page.php:696
480
+ msgid "to open WhatsApp directly on click."
481
  msgstr ""
482
 
483
+ #: admin/class-joinchat-admin-page.php:691
484
+ #: admin/class-joinchat-admin-page.php:703
485
+ msgid "Example:"
486
  msgstr ""
487
 
488
+ #: admin/class-joinchat-admin-page.php:691
489
+ #: admin/class-joinchat-admin-page.php:703
490
+ msgid "Contact us"
491
  msgstr ""
492
 
493
+ #: admin/class-joinchat-admin-page.php:692
494
+ msgid "Adding some CSS classes in your HTML:"
495
  msgstr ""
496
 
497
+ #: admin/class-joinchat-admin-page.php:695
498
+ msgid "to hide Chat Window on click."
499
  msgstr ""
500
 
501
+ #: admin/class-joinchat-admin-page.php:697
502
+ msgid "To show Chat Window when an HTML element appears on screen when user scrolls:"
503
  msgstr ""
504
 
505
+ #: admin/class-joinchat-admin-page.php:699
506
+ msgid "only show if it's an not seen CTA."
 
507
  msgstr ""
508
 
509
+ #: admin/class-joinchat-admin-page.php:700
510
+ msgid "to show always."
511
  msgstr ""
512
 
513
+ #: admin/class-joinchat-admin-page.php:707
514
+ #: admin/class-joinchat-admin.php:204
515
+ msgid "Support"
516
  msgstr ""
517
 
518
+ #. translators: 1: docs url, 2: wordpress.org plugin support url, 3: premium support url.
519
+ #: admin/class-joinchat-admin-page.php:711
520
+ msgid "If you need help, first review our <a href=\"%1$s\" target=\"_blank\">documentation</a> and if you don't find a solution check the <a href=\"%2$s\" target=\"_blank\">free plugin support forum</a> or buy our <a href=\"%3$s\" target=\"_blank\">premium support</a>."
521
+ msgstr ""
522
+
523
+ #: admin/class-joinchat-admin-page.php:716
524
+ msgid "If you like Join.chat 😍"
525
  msgstr ""
526
 
527
+ #. translators: %s: Add review link.
528
+ #: admin/class-joinchat-admin-page.php:720
529
  msgid "Please leave us a %s rating. We'll thank you."
530
  msgstr ""
531
 
532
+ #. translators: %s: Join.chat page link.
533
+ #: admin/class-joinchat-admin-page.php:725
534
+ msgid "Subscribe to our newsletter and visit our blog at %s."
535
  msgstr ""
536
 
537
+ #. translators: %s: Join.chat twitter link.
538
+ #: admin/class-joinchat-admin-page.php:730
539
+ msgid "Follow %s on twitter."
540
  msgstr ""
541
 
542
+ #: admin/class-joinchat-admin-page.php:766
543
+ msgid "Join.chat Settings"
544
  msgstr ""
545
 
546
+ #: admin/class-joinchat-admin-page.php:808
547
+ msgid "You can use vars"
548
  msgstr ""
549
 
550
+ #. translators: 1: Join.chat, 2: Add review link.
551
+ #: admin/class-joinchat-admin-page.php:829
552
+ msgid "Do you like %1$s? Please help us with a %2$s rating."
553
  msgstr ""
554
 
555
+ #: admin/class-joinchat-admin.php:94
556
+ msgid "e.g."
557
+ msgstr ""
558
+
559
+ #: admin/class-joinchat-admin.php:104
560
+ msgid "is an example, double click to use it"
561
+ msgstr ""
562
+
563
+ #: admin/class-joinchat-admin.php:132
564
+ msgid "You only need to add your WhatsApp number to contact with your users."
565
+ msgstr ""
566
+
567
+ #: admin/class-joinchat-admin.php:133
568
+ msgid "Go to settings"
569
+ msgstr ""
570
+
571
+ #: admin/class-joinchat-admin.php:171
572
+ msgid "Settings"
573
  msgstr ""
574
 
575
+ #: admin/class-joinchat-admin.php:181
576
  msgid "Premium"
577
  msgstr ""
578
 
579
+ #: admin/class-joinchat-admin.php:203
580
+ msgid "Documentation"
581
  msgstr ""
582
 
583
+ #: admin/class-joinchat-woo-admin.php:158
584
+ msgid "Before \"Add To Cart\" form"
585
  msgstr ""
586
 
587
+ #: admin/class-joinchat-woo-admin.php:159
588
+ msgid "Before \"Add To Cart\" button"
589
  msgstr ""
590
 
591
+ #: admin/class-joinchat-woo-admin.php:160
592
+ msgid "After \"Add To Cart\" button"
593
  msgstr ""
594
 
595
+ #: admin/class-joinchat-woo-admin.php:161
596
+ msgid "After \"Add To Cart\" form"
597
  msgstr ""
598
 
599
+ #: admin/class-joinchat-woo-admin.php:162
600
+ msgid "After \"Additional information\""
601
  msgstr ""
602
 
603
+ #: admin/class-joinchat-woo-admin.php:165
604
+ msgid "Don't show"
605
  msgstr ""
606
 
607
+ #: admin/class-joinchat-woo-admin.php:179
608
+ msgid "Shop"
609
  msgstr ""
610
 
611
+ #: admin/class-joinchat-woo-admin.php:180
612
+ msgid "Product Page"
 
 
 
613
  msgstr ""
614
 
615
+ #: admin/class-joinchat-woo-admin.php:181
616
+ msgid "Cart"
617
  msgstr ""
618
 
619
+ #: admin/class-joinchat-woo-admin.php:182
620
+ msgid "Checkout"
621
  msgstr ""
622
 
623
+ #: admin/class-joinchat-woo-admin.php:183
624
+ msgid "Thank You"
625
  msgstr ""
626
 
627
+ #: admin/class-joinchat-woo-admin.php:184
628
+ msgid "My Account"
629
  msgstr ""
630
 
631
+ #: admin/class-joinchat-woo-admin.php:200
632
+ msgid "Call to Action for Products"
633
  msgstr ""
634
 
635
+ #: admin/class-joinchat-woo-admin.php:201
636
+ msgid "Call to Action for Products on Sale"
637
  msgstr ""
638
 
639
+ #: admin/class-joinchat-woo-admin.php:202
640
+ msgid "Message for Products"
 
 
641
  msgstr ""
642
 
643
+ #: admin/class-joinchat-woo-admin.php:211
644
+ msgid "Button Position"
645
  msgstr ""
646
 
647
+ #: admin/class-joinchat-woo-admin.php:249
648
+ msgid "WooCommerce"
649
  msgstr ""
650
 
651
+ #: admin/class-joinchat-woo-admin.php:253
652
+ msgid "Product Chat Window"
653
  msgstr ""
654
 
655
+ #: admin/class-joinchat-woo-admin.php:254
656
+ msgid "You can define other different texts for the Chat Window on the product pages."
657
  msgstr ""
658
 
659
+ #: admin/class-joinchat-woo-admin.php:258
660
+ msgid "Product Button"
 
661
  msgstr ""
662
 
663
+ #: admin/class-joinchat-woo-admin.php:259
664
+ msgid "Add a contact button on the product sheet."
665
  msgstr ""
666
 
667
+ #: admin/class-joinchat-woo-admin.php:282
668
+ msgid ""
669
+ "This *{PRODUCT}* can be yours for only *{PRICE}*!\n"
670
+ "If you have any questions, ask us."
671
  msgstr ""
672
 
673
+ #: admin/class-joinchat-woo-admin.php:284
674
+ msgid "Define a text for your products to encourage customers to contact"
675
  msgstr ""
676
 
677
+ #: admin/class-joinchat-woo-admin.php:289
678
+ msgid ""
679
+ "Save {DISCOUNT}! This *{PRODUCT}* can be yours for only ~{REGULAR}~ *{PRICE}*.\n"
680
+ "If you have any questions, ask us."
681
  msgstr ""
682
 
683
+ #: admin/class-joinchat-woo-admin.php:291
684
+ msgid "Define a text for your products on sale to encourage customers to contact"
685
  msgstr ""
686
 
687
+ #: admin/class-joinchat-woo-admin.php:296
688
+ msgid ""
689
+ "*Hi {SITE}!*\n"
690
+ "I have a question about *{PRODUCT} ({SKU})*"
691
  msgstr ""
692
 
693
+ #: admin/class-joinchat-woo-admin.php:298
694
+ msgid "Predefined text for the first message the client will send you"
695
  msgstr ""
696
 
697
+ #: admin/class-joinchat-woo-admin.php:308
698
+ msgid "Select the position of the button on the product page"
699
  msgstr ""
700
 
701
+ #: admin/class-joinchat-woo-admin.php:312
702
+ msgid "Ask for More Info"
703
  msgstr ""
704
 
705
+ #: admin/class-joinchat-woo-admin.php:347
706
+ msgid "<strong>WooCommerce</strong>, in product pages you can also use:"
707
  msgstr ""
708
 
709
+ #: admin/class-joinchat-woo-admin.php:349
710
+ msgid "Product Name"
711
  msgstr ""
712
 
713
+ #: admin/class-joinchat-woo-admin.php:353
714
+ msgid "For the <strong>Call to Action for Products on Sale</strong>, you can also use:"
 
 
715
  msgstr ""
716
 
717
+ #: admin/partials/post_meta_box.php:29
718
+ #: admin/partials/term_meta_box.php:33
719
+ #: gutenberg/build/index.js:1
720
+ msgid "Can use vars"
721
+ msgstr ""
722
+
723
+ #: admin/partials/post_meta_box.php:31
724
+ #: admin/partials/term_meta_box.php:35
725
+ #: gutenberg/build/index.js:1
726
+ msgid "to leave it blank use"
727
+ msgstr ""
728
+
729
+ #: admin/partials/post_meta_box.php:39
730
+ #: admin/partials/term_meta_box.php:47
731
+ #: gutenberg/build/index.js:1
732
+ msgid "Default visibility"
733
  msgstr ""
734
 
735
  #: includes/class-joinchat-elementor-finder.php:48
737
  msgid "General Settings"
738
  msgstr ""
739
 
740
+ #: includes/class-joinchat-elementor-finder.php:51
741
+ msgctxt "Keywords in Elementor Finder"
742
+ msgid "settings,phone"
743
+ msgstr ""
744
+
745
+ #: includes/class-joinchat-elementor-finder.php:52
746
+ #: includes/class-joinchat-elementor-finder.php:59
747
+ #: includes/class-joinchat-integrations.php:111
748
+ msgid "Join.chat settings page"
749
+ msgstr ""
750
+
751
  #: includes/class-joinchat-elementor-finder.php:55
752
  msgctxt "Title in Elementor Finder"
753
  msgid "Visibility Settings"
754
  msgstr ""
755
 
756
+ #: includes/class-joinchat-elementor-finder.php:58
757
+ msgctxt "Keywords in Elementor Finder"
758
+ msgid "visibility,show,hide"
759
  msgstr ""
760
 
761
+ #. translators: %s: site language.
762
+ #: includes/class-joinchat-i18n.php:128
763
+ msgid "Default site language (%s)"
764
  msgstr ""
765
 
766
+ #: includes/class-joinchat-i18n.php:129
767
+ msgid "There are changes in fields that can be translated."
768
  msgstr ""
769
 
770
+ #: includes/class-joinchat-i18n.php:131
771
+ msgid "Check translations"
772
  msgstr ""
773
 
774
+ #: includes/class-joinchat-integrations.php:107
775
+ msgctxt "Title in Elementor Finder"
776
+ msgid "WooCommerce Settings"
777
  msgstr ""
778
 
779
+ #: includes/class-joinchat-integrations.php:110
780
+ msgctxt "Keywords in Elementor Finder"
781
+ msgid "woocommerce,shop,product"
782
  msgstr ""
783
 
784
+ #: public/partials/html.php:37
785
+ #: gutenberg/build/index.js:1
786
+ msgid "Scan the code"
787
  msgstr ""
788
 
789
+ #: public/partials/html.php:45
790
+ msgid "Powered by"
791
  msgstr ""
792
 
793
+ #: public/partials/html.php:52
794
+ msgid "Close"
795
  msgstr ""
796
 
797
+ #: gutenberg/build/index.js:1
798
+ msgid "set your phone"
799
  msgstr ""
800
 
801
+ #: gutenberg/build/index.js:1
802
+ msgid "Add text…"
803
  msgstr ""
804
 
805
+ #: gutenberg/build/index.js:1
806
+ msgid "Contact"
807
  msgstr ""
808
 
809
+ #: gutenberg/build/index.js:1
810
+ msgid "Leave blank to use the %s or global Joinchat settings."
811
  msgstr ""
812
 
813
+ #: gutenberg/build/index.js:1
814
+ msgid "search"
815
  msgstr ""
816
 
817
+ #: gutenberg/build/index.js:1
818
+ msgid "nothing found"
819
  msgstr ""
820
 
821
+ #: gutenberg/build/index.js:1
822
+ msgid "QR Code (on desktop)"
823
  msgstr ""
824
 
825
+ #: gutenberg/build/index.js:1
826
+ msgid "QR and Button"
827
  msgstr ""
828
 
829
+ #: gutenberg/build/index.js:1
830
+ msgid "QR only"
831
  msgstr ""
832
 
833
+ #: gutenberg/build/index.js:1
834
+ msgid "Button only"
 
 
835
  msgstr ""
836
 
837
+ #: gutenberg/build/index.js:1
838
+ msgid "Custom Joinchat settings for this publication (%s)."
839
  msgstr ""
840
 
841
+ #: gutenberg/build/block_btn/block.json
842
+ msgctxt "block title"
843
+ msgid "Joinchat Button"
844
  msgstr ""
845
 
846
+ #: gutenberg/build/block_btn/block.json
847
+ msgctxt "block description"
848
+ msgid "WhatsApp contact button"
 
849
  msgstr ""
850
 
851
+ #: gutenberg/build/block_btn/block.json
852
+ msgctxt "block keyword"
853
+ msgid "WhatsApp"
 
854
  msgstr ""
855
 
856
+ #: gutenberg/build/block_btn/block.json
857
+ msgctxt "block keyword"
858
+ msgid "QR"
859
  msgstr ""
860
 
861
+ #: gutenberg/build/block_btn/block.json
862
+ msgctxt "block keyword"
863
+ msgid "contact"
864
  msgstr ""
865
 
866
+ #: gutenberg/build/block_btn/block.json
867
+ msgctxt "block keyword"
868
+ msgid "phone"
869
  msgstr ""
public/class-joinchat-elementor-public.php CHANGED
@@ -31,11 +31,12 @@ class JoinChatElementorPublic {
31
  * Set 'show' false when is editing on Elementor
32
  *
33
  * @since 4.1.10
34
- * @param object /Elementor/Preview instance
 
35
  */
36
  public function elementor_preview_disable( $show ) {
37
 
38
- $is_preview = isset( $_GET['elementor-preview'] ) || ( isset( $_GET['render_mode'] ) && 'template-preview' === $_GET['render_mode'] );
39
  $preview_show = apply_filters( 'joinchat_elementor_preview_show', false );
40
 
41
  return $is_preview ? $show && $preview_show : $show;
31
  * Set 'show' false when is editing on Elementor
32
  *
33
  * @since 4.1.10
34
+ * @param bool $show current show button.
35
+ * @return bool
36
  */
37
  public function elementor_preview_disable( $show ) {
38
 
39
+ $is_preview = isset( $_GET['elementor-preview'] ) || ( isset( $_GET['render_mode'] ) && 'template-preview' === $_GET['render_mode'] ); // phpcs:ignore WordPress.Security.NonceVerification
40
  $preview_show = apply_filters( 'joinchat_elementor_preview_show', false );
41
 
42
  return $is_preview ? $show && $preview_show : $show;
public/class-joinchat-public.php CHANGED
@@ -36,20 +36,12 @@ class JoinChatPublic {
36
  * Common class for admin and front methods.
37
  *
38
  * @since 4.2.0
 
39
  * @access private
40
  * @var JoinChatCommon $common instance.
41
  */
42
  private $common;
43
 
44
- /**
45
- * The setings of this plugin.
46
- *
47
- * @since 1.0.0
48
- * @access private
49
- * @var array $settings The current settings of this plugin.
50
- */
51
- private $settings;
52
-
53
  /**
54
  * Show WhatsApp button in front.
55
  *
@@ -74,11 +66,9 @@ class JoinChatPublic {
74
 
75
  $this->plugin_name = $plugin_name;
76
  $this->version = $version;
77
- $this->common = new JoinChatCommon();
78
 
79
- // Updated in get_settings() at 'wp' hook
80
- $this->show = false;
81
- $this->settings = array();
82
 
83
  }
84
 
@@ -94,16 +84,16 @@ class JoinChatPublic {
94
  */
95
  public function get_settings() {
96
 
97
- // Load settings
98
  $settings = $this->common->load_settings();
99
 
100
- // If use "global $post;" take first post in loop on archive pages
101
  $obj = get_queried_object();
102
 
103
- // Filter for site settings (can be overriden by post/term settings)
104
  $settings = apply_filters( 'joinchat_get_settings_site', $settings, $obj );
105
 
106
- // Post/term custom settings override site settings
107
  $obj_settings = '';
108
  if ( $obj instanceof WP_Post ) {
109
  $obj_settings = get_post_meta( $obj->ID, '_joinchat', true );
@@ -115,38 +105,49 @@ class JoinChatPublic {
115
  $settings = array_merge( $settings, $obj_settings );
116
  }
117
 
118
- // Replace "{}" with empty string
119
  $settings['message_text'] = preg_replace( '/^\{\s*\}$/', '', $settings['message_text'] );
120
  $settings['message_send'] = preg_replace( '/^\{\s*\}$/', '', $settings['message_send'] );
121
 
122
- // Prepare settings
123
  $settings['telephone'] = JoinChatUtil::clean_whatsapp( $settings['telephone'] );
124
- $settings['mobile_only'] = 'yes' == $settings['mobile_only'];
125
- $settings['whatsapp_web'] = 'yes' == $settings['whatsapp_web'];
126
- $settings['message_badge'] = 'yes' == $settings['message_badge'] && '' != $settings['message_text'];
127
- $settings['qr'] = 'yes' == $settings['qr'];
128
  $settings['message_send'] = JoinChatUtil::replace_variables( $settings['message_send'] );
129
- $settings['whatsapp_web'] = 'yes' == $settings['whatsapp_web'];
130
- $settings['optin_check'] = 'yes' == $settings['optin_check'];
 
 
 
 
131
 
132
- // Only show if there is a phone number
133
  if ( empty( $settings['telephone'] ) ) {
134
  $show = false;
135
  } elseif ( isset( $settings['view'] ) ) {
136
- $show = 'yes' == $settings['view'];
137
  } else {
138
  $show = $this->check_visibility( $settings['visibility'] );
139
  }
140
- // Unset post 'view' setting
141
  unset( $settings['view'] );
142
 
143
- // Apply filters to final settings after site and post settings
144
- $this->settings = apply_filters( 'joinchat_get_settings', $settings, $obj );
145
- // Apply filters to alter 'show' value
146
- $this->show = apply_filters( 'joinchat_show', $show, $this->settings, $obj );
147
 
148
- // Set a simple CTA hash, empty '' if no CTA (for javascript store viewed CTAs)
149
- $this->settings['message_hash'] = ltrim( hash( 'crc32', $this->settings['message_text'] ), '0' );
 
 
 
 
 
 
 
150
 
151
  }
152
 
@@ -161,23 +162,23 @@ class JoinChatPublic {
161
  public function enqueue_styles() {
162
 
163
  if ( $this->show ) {
164
- $file = $this->plugin_name;
165
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
 
166
 
167
- // If not chatbox use lighter only button styles
168
- if ( empty( $this->settings['message_text'] ) && empty( $this->settings['optin_text'] ) && ! has_filter( 'joinchat_content' ) ) {
169
  $file .= '-btn';
170
  }
171
 
172
  wp_enqueue_style( $this->plugin_name, plugins_url( "css/{$file}{$min}.css", __FILE__ ), array(), $this->version, 'all' );
173
 
174
  if ( $file === $this->plugin_name ) {
175
- list($r, $g, $b) = sscanf( $this->settings['color'], '#%02x%02x%02x' );
176
 
177
- wp_add_inline_style( $this->plugin_name, apply_filters( 'joinchat_inline_style', ".joinchat{ --red:$r; --green:$g; --blue:$b; }", $this->settings ) );
178
  }
179
  }
180
-
181
  }
182
 
183
  /**
@@ -186,25 +187,63 @@ class JoinChatPublic {
186
  * @since 1.0.0
187
  * @since 2.2.2 minified
188
  * @since 4.4.0 added kjua script
 
189
  * @return void
190
  */
191
  public function enqueue_scripts() {
192
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  if ( $this->show ) {
194
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
195
- $deps = array( 'jquery' );
196
 
197
- wp_register_script( "{$this->plugin_name}-kjua", plugins_url( 'js/kjua.min.js', __FILE__ ), array(), '0.9.0', true );
 
198
 
199
- // Note: caution with cache plugins and wp_is_mobile()
200
- // If kjua script is missing it fails silently and don't shows QR Code :)
201
- if ( ! $this->settings['mobile_only'] && $this->settings['qr'] && ! wp_is_mobile() ) {
202
- $deps[] = "{$this->plugin_name}-kjua";
203
- }
204
 
205
- wp_enqueue_script( $this->plugin_name, plugins_url( "js/{$this->plugin_name}{$min}.js", __FILE__ ), $deps, $this->version, true );
 
 
 
 
206
  }
 
207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  }
209
 
210
  /**
@@ -215,125 +254,112 @@ class JoinChatPublic {
215
  * @return void
216
  */
217
  public function footer_html() {
218
- global $wp;
219
 
220
- if ( $this->show ) {
221
-
222
- // Clean unnecessary settings on front
223
- $excluded_fields = apply_filters(
224
- 'joinchat_excluded_fields',
225
- array(
226
- 'visibility',
227
- 'position',
228
- 'button_tip',
229
- 'button_image',
230
- 'message_start',
231
- 'message_text',
232
- 'color',
233
- 'dark_mode',
234
- 'header',
235
- 'optin_text',
236
- 'optin_check',
237
- )
238
- );
239
 
240
- $data = array_diff_key( $this->settings, array_flip( $excluded_fields ) );
241
 
242
- if ( '__jc__' === $this->settings['header'] ) {
243
- $powered_url = urlencode( home_url( $wp->request ) );
244
- $powered_site = urlencode( get_bloginfo( 'name' ) );
245
- $powered_lang = false !== strpos( strtolower( get_locale() ), 'es' ) ? 'es' : 'en';
246
- $powered_link = "https://join.chat/$powered_lang/powered/?site=$powered_site&url=$powered_url";
247
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
 
249
- // Set custom img tag and bypass default image logic
250
- $image = apply_filters( 'joinchat_image', null );
251
 
252
- if ( is_null( $image ) && $this->settings['button_image'] ) {
253
- $img_id = $this->settings['button_image'];
254
 
255
- if ( apply_filters( 'joinchat_image_original', JoinChatUtil::is_animated_gif( $img_id ), $img_id, 'button' ) ) {
256
- $image = '<img src="' . wp_get_attachment_url( $img_id ) . '" alt="" loading="lazy">';
257
- } elseif ( is_array( JoinChatUtil::thumb( $img_id, 58, 58 ) ) ) {
258
- $thumb = JoinChatUtil::thumb( $img_id, 58, 58 );
259
- $thumb2 = JoinChatUtil::thumb( $img_id, 116, 116 );
260
- $thumb3 = JoinChatUtil::thumb( $img_id, 174, 174 );
261
- $image = "<img src=\"{$thumb['url']}\" srcset=\"{$thumb2['url']} 2x, {$thumb3['url']} 3x\" alt=\"\" loading=\"lazy\">";
262
- }
263
  }
 
264
 
265
- $joinchat_classes = array();
266
- $box_content = '';
267
-
268
- // class position
269
- $joinchat_classes[] = 'joinchat--' . $this->settings['position'];
270
 
271
- // class dark mode
272
- if ( 'no' !== $this->settings['dark_mode'] ) {
273
- $joinchat_classes[] = 'auto' === $this->settings['dark_mode'] ? 'joinchat--dark-auto' : 'joinchat--dark';
274
- }
275
 
276
- // class direct display (w/o animation)
277
- if ( $this->settings['button_delay'] < 0 ) {
278
- $data['button_delay'] = 0;
279
- $joinchat_classes[] = 'joinchat--show';
280
- $joinchat_classes[] = 'joinchat--noanim';
281
 
282
- if ( $this->settings['mobile_only'] ) {
283
- $joinchat_classes[] = 'joinchat--mobile';
284
- }
285
- }
 
286
 
287
- if ( $this->settings['message_text'] ) {
288
- $box_content = '<div class="joinchat__message">' . JoinChatUtil::formated_message( $this->settings['message_text'] ) . '</div>';
289
  }
 
290
 
291
- if ( $this->settings['optin_text'] ) {
292
- $optin = nl2br( $this->settings['optin_text'] );
293
- $optin = str_replace( '<a ', '<a target="_blank" rel="nofollow noopener" ', $optin );
294
-
295
- if ( $this->settings['optin_check'] ) {
296
- $optin = '<input type="checkbox" id="joinchat_optin"><label for="joinchat_optin">' . $optin . '</label>';
297
- $joinchat_classes[] = 'joinchat--optout';
298
- }
299
-
300
- $box_content .= '<div class="joinchat__optin">' . $optin . '</div>';
301
- }
302
 
303
- $box_content = apply_filters( 'joinchat_content', $box_content, $this->settings );
 
 
304
 
305
- // class only button
306
- if ( empty( $box_content ) ) {
307
- $joinchat_classes[] = 'joinchat--btn';
308
  }
309
 
310
- $joinchat_classes = apply_filters( 'joinchat_classes', $joinchat_classes, $this->settings );
 
311
 
312
- ob_start();
313
- include __DIR__ . '/partials/html.php';
314
- $html_output = ob_get_clean();
315
 
316
- echo apply_filters( 'joinchat_html_output', $html_output, $this->settings );
 
 
317
  }
318
- }
319
 
320
- /**
321
- * Prints a fallback script to open WhatsApp for html triggers when Join.chat is not showed
322
- *
323
- * @since 4.1.5
324
- * @return void
325
- */
326
- public function links_script() {
327
 
328
- if ( ! $this->show && ! empty( $this->settings['telephone'] ) && wp_script_is( 'jquery', 'enqueued' ) ) {
329
- $args = array(
330
- 'tel' => $this->settings['telephone'],
331
- 'msg' => $this->settings['message_send'],
332
- 'web' => $this->settings['whatsapp_web'],
333
- );
334
 
335
- include __DIR__ . '/partials/script.php';
336
- }
337
 
338
  }
339
 
@@ -342,81 +368,81 @@ class JoinChatPublic {
342
  *
343
  * @since 2.0.0
344
  * @since 3.0.0 Added filter to 'joinchat_visibility'
345
- * @param array $options array of visibility settings
346
  * @return boolean is visible or not on current page
347
  */
348
  public function check_visibility( $options ) {
349
 
350
- // Custom visibility, bypass all checks if not null
351
  $visibility = apply_filters( 'joinchat_visibility', null, $options );
352
  if ( ! is_null( $visibility ) ) {
353
  return $visibility;
354
  }
355
 
356
- $global = isset( $options['all'] ) ? 'yes' == $options['all'] : true;
357
 
358
- // Check front page
359
  if ( is_front_page() ) {
360
- return isset( $options['front_page'] ) ? 'yes' == $options['front_page'] : $global;
361
  }
362
 
363
- // Check blog page
364
  if ( is_home() ) {
365
- return isset( $options['blog_page'] ) ? 'yes' == $options['blog_page'] : $global;
366
  }
367
 
368
- // Check 404 page
369
  if ( is_404() ) {
370
- return isset( $options['404_page'] ) ? 'yes' == $options['404_page'] : $global;
371
  }
372
 
373
- // Check Custom Post Types
374
  if ( is_array( $options ) ) {
375
  foreach ( $options as $cpt => $view ) {
376
- if ( substr( $cpt, 0, 4 ) == 'cpt_' ) {
377
  $cpt = substr( $cpt, 4 );
378
  if ( is_singular( $cpt ) || is_post_type_archive( $cpt ) ) {
379
- return 'yes' == $view;
380
  }
381
  }
382
  }
383
  }
384
 
385
- // Search results
386
  if ( is_search() ) {
387
- return isset( $options['search'] ) ? 'yes' == $options['search'] : $global;
388
  }
389
 
390
- // Check archives
391
  if ( is_archive() ) {
392
 
393
- // Date archive
394
  if ( isset( $options['date'] ) && is_date() ) {
395
- return 'yes' == $options['date'];
396
  }
397
 
398
- // Author archive
399
  if ( isset( $options['author'] ) && is_author() ) {
400
- return 'yes' == $options['author'];
401
  }
402
 
403
- return isset( $options['archive'] ) ? 'yes' == $options['archive'] : $global;
404
  }
405
 
406
- // Check singular
407
  if ( is_singular() ) {
408
 
409
- // Page
410
  if ( isset( $options['page'] ) && is_page() ) {
411
- return 'yes' == $options['page'];
412
  }
413
 
414
- // Post (or other custom posts)
415
  if ( isset( $options['post'] ) && is_single() ) {
416
- return 'yes' == $options['post'];
417
  }
418
 
419
- return isset( $options['singular'] ) ? 'yes' == $options['singular'] : $global;
420
  }
421
 
422
  return $global;
36
  * Common class for admin and front methods.
37
  *
38
  * @since 4.2.0
39
+ * @since 4.5.0 Store $settings globally
40
  * @access private
41
  * @var JoinChatCommon $common instance.
42
  */
43
  private $common;
44
 
 
 
 
 
 
 
 
 
 
45
  /**
46
  * Show WhatsApp button in front.
47
  *
66
 
67
  $this->plugin_name = $plugin_name;
68
  $this->version = $version;
69
+ $this->common = JoinChatCommon::instance();
70
 
71
+ $this->show = false;
 
 
72
 
73
  }
74
 
84
  */
85
  public function get_settings() {
86
 
87
+ // Load settings.
88
  $settings = $this->common->load_settings();
89
 
90
+ // If use "global $post;" take first post in loop on archive pages.
91
  $obj = get_queried_object();
92
 
93
+ // Filter for site settings (can be overriden by post/term settings).
94
  $settings = apply_filters( 'joinchat_get_settings_site', $settings, $obj );
95
 
96
+ // Post/term custom settings override site settings.
97
  $obj_settings = '';
98
  if ( $obj instanceof WP_Post ) {
99
  $obj_settings = get_post_meta( $obj->ID, '_joinchat', true );
105
  $settings = array_merge( $settings, $obj_settings );
106
  }
107
 
108
+ // Replace "{}" with empty string.
109
  $settings['message_text'] = preg_replace( '/^\{\s*\}$/', '', $settings['message_text'] );
110
  $settings['message_send'] = preg_replace( '/^\{\s*\}$/', '', $settings['message_send'] );
111
 
112
+ // Prepare settings.
113
  $settings['telephone'] = JoinChatUtil::clean_whatsapp( $settings['telephone'] );
114
+ $settings['mobile_only'] = 'yes' === $settings['mobile_only'];
115
+ $settings['whatsapp_web'] = 'yes' === $settings['whatsapp_web'];
116
+ $settings['message_badge'] = 'yes' === $settings['message_badge'] && '' !== $settings['message_text'];
117
+ $settings['qr'] = 'yes' === $settings['qr'];
118
  $settings['message_send'] = JoinChatUtil::replace_variables( $settings['message_send'] );
119
+ $settings['whatsapp_web'] = 'yes' === $settings['whatsapp_web'];
120
+ $settings['optin_check'] = 'yes' === $settings['optin_check'];
121
+
122
+ if ( empty( $settings['gads'] ) ) {
123
+ unset( $settings['gads'] );
124
+ }
125
 
126
+ // Only show if there is a phone number.
127
  if ( empty( $settings['telephone'] ) ) {
128
  $show = false;
129
  } elseif ( isset( $settings['view'] ) ) {
130
+ $show = 'yes' === $settings['view'];
131
  } else {
132
  $show = $this->check_visibility( $settings['visibility'] );
133
  }
134
+ // Unset post 'view' setting.
135
  unset( $settings['view'] );
136
 
137
+ // Apply filters to final settings after site and post settings.
138
+ $settings = apply_filters( 'joinchat_get_settings', $settings, $obj );
139
+ // Apply filters to alter 'show' value.
140
+ $this->show = apply_filters( 'joinchat_show', $show, $settings, $obj );
141
 
142
+ // Set a simple CTA hash, empty '' if no CTA (for javascript store viewed CTAs).
143
+ $settings['message_hash'] = ltrim( hash( 'crc32', $settings['message_text'] ), '0' );
144
+
145
+ // Need render QR codes.
146
+ if ( ! $settings['mobile_only'] && $settings['qr'] ) {
147
+ $this->common->qr = true;
148
+ }
149
+
150
+ $this->common->settings = $settings;
151
 
152
  }
153
 
162
  public function enqueue_styles() {
163
 
164
  if ( $this->show ) {
165
+ $settings = $this->common->settings;
166
+ $file = $this->plugin_name;
167
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
168
 
169
+ // If not chatbox use lighter only button styles.
170
+ if ( empty( $settings['message_text'] ) && empty( $settings['optin_text'] ) && ! has_filter( 'joinchat_content' ) ) {
171
  $file .= '-btn';
172
  }
173
 
174
  wp_enqueue_style( $this->plugin_name, plugins_url( "css/{$file}{$min}.css", __FILE__ ), array(), $this->version, 'all' );
175
 
176
  if ( $file === $this->plugin_name ) {
177
+ list($r, $g, $b) = sscanf( $settings['color'], '#%02x%02x%02x' );
178
 
179
+ wp_add_inline_style( $this->plugin_name, apply_filters( 'joinchat_inline_style', ".joinchat{ --red:$r; --green:$g; --blue:$b; }", $settings ) );
180
  }
181
  }
 
182
  }
183
 
184
  /**
187
  * @since 1.0.0
188
  * @since 2.2.2 minified
189
  * @since 4.4.0 added kjua script
190
+ * @since 4.5.0 added joinchat-lite script
191
  * @return void
192
  */
193
  public function enqueue_scripts() {
194
 
195
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
196
+ $deps = array( 'jquery' );
197
+
198
+ // Register QR script.
199
+ wp_register_script( 'joinchat-kjua', plugins_url( 'js/kjua.min.js', __FILE__ ), array(), '0.9.0', true );
200
+
201
+ // Note: caution with cache plugins and wp_is_mobile()
202
+ // If kjua script is missing it fails silently and don't shows QR Code :).
203
+ if ( $this->common->qr && ! wp_is_mobile() ) {
204
+ $deps[] = 'joinchat-kjua';
205
+ }
206
+
207
  if ( $this->show ) {
 
 
208
 
209
+ // Enqueue default full script.
210
+ wp_enqueue_script( 'joinchat', plugins_url( "js/joinchat{$min}.js", __FILE__ ), $deps, $this->version, true );
211
 
212
+ } elseif ( apply_filters( 'joinchat_script_lite', ! empty( $this->common->settings['telephone'] ) ) ) {
 
 
 
 
213
 
214
+ $data = array_intersect_key( $this->common->settings, array_flip( array( 'telephone', 'whatsapp_web', 'message_send', 'gads', 'ga_tracker', 'data_layer' ) ) );
215
+
216
+ // Enqueue lite script.
217
+ wp_enqueue_script( 'joinchat-lite', plugins_url( "js/joinchat-lite{$min}.js", __FILE__ ), $deps, $this->version, true );
218
+ wp_localize_script( 'joinchat-lite', 'joinchat_obj', array( 'settings' => $data ) );
219
  }
220
+ }
221
 
222
+ /**
223
+ * Ensure QR script dependency
224
+ *
225
+ * Based on post content, QR script could be required after main script is enqueued.
226
+ * This ensures adding the QR script as a dependency if needed.
227
+ *
228
+ * @since 4.5.0
229
+ * @return void
230
+ */
231
+ public function enqueue_qr_script() {
232
+
233
+ if ( ! $this->common->qr || wp_script_is( 'joinchat-kjua', 'enqueued' ) || wp_is_mobile() ) {
234
+ return;
235
+ }
236
+
237
+ if ( wp_script_is( 'joinchat', 'enqueued' ) ) {
238
+ $script = wp_scripts()->query( 'joinchat', 'registered' );
239
+ } elseif ( wp_script_is( 'joinchat-lite', 'enqueued' ) ) {
240
+ $script = wp_scripts()->query( 'joinchat-lite', 'registered' );
241
+ }
242
+
243
+ // Add dependency.
244
+ if ( $script ) {
245
+ $script->deps[] = 'joinchat-kjua';
246
+ }
247
  }
248
 
249
  /**
254
  * @return void
255
  */
256
  public function footer_html() {
 
257
 
258
+ if ( ! $this->show ) {
259
+ return;
260
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
 
262
+ global $wp;
263
 
264
+ $settings = $this->common->settings;
265
+
266
+ // Clean unnecessary settings on front.
267
+ $excluded_fields = apply_filters(
268
+ 'joinchat_excluded_fields',
269
+ array(
270
+ 'visibility',
271
+ 'position',
272
+ 'button_tip',
273
+ 'button_image',
274
+ 'message_start',
275
+ 'message_text',
276
+ 'color',
277
+ 'dark_mode',
278
+ 'header',
279
+ 'optin_text',
280
+ 'optin_check',
281
+ )
282
+ );
283
+
284
+ $data = array_diff_key( $settings, array_flip( $excluded_fields ) );
285
+
286
+ if ( '__jc__' === $settings['header'] ) {
287
+ $powered_args = array(
288
+ 'site' => rawurlencode( get_bloginfo( 'name' ) ),
289
+ 'url' => rawurlencode( home_url( $wp->request ) ),
290
+ );
291
+ $powered_lang = false !== strpos( strtolower( get_locale() ), 'es' ) ? 'es' : 'en';
292
+ $powered_link = add_query_arg( $powered_args, "https://join.chat/$powered_lang/powered/" );
293
+ }
294
 
295
+ // Set custom img tag and bypass default image logic.
296
+ $image = apply_filters( 'joinchat_image', null );
297
 
298
+ if ( is_null( $image ) && $settings['button_image'] ) {
299
+ $img_id = $settings['button_image'];
300
 
301
+ if ( apply_filters( 'joinchat_image_original', JoinChatUtil::is_animated_gif( $img_id ), $img_id, 'button' ) ) {
302
+ $image = '<img src="' . wp_get_attachment_url( $img_id ) . '" alt="" loading="lazy">';
303
+ } elseif ( is_array( JoinChatUtil::thumb( $img_id, 58, 58 ) ) ) {
304
+ $thumb = JoinChatUtil::thumb( $img_id, 58, 58 );
305
+ $thumb2 = JoinChatUtil::thumb( $img_id, 116, 116 );
306
+ $thumb3 = JoinChatUtil::thumb( $img_id, 174, 174 );
307
+ $image = "<img src=\"{$thumb['url']}\" srcset=\"{$thumb2['url']} 2x, {$thumb3['url']} 3x\" alt=\"\" loading=\"lazy\">";
 
308
  }
309
+ }
310
 
311
+ $joinchat_classes = array();
312
+ $box_content = '';
 
 
 
313
 
314
+ // class position.
315
+ $joinchat_classes[] = 'joinchat--' . $settings['position'];
 
 
316
 
317
+ // class dark mode.
318
+ if ( 'no' !== $settings['dark_mode'] ) {
319
+ $joinchat_classes[] = 'auto' === $settings['dark_mode'] ? 'joinchat--dark-auto' : 'joinchat--dark';
320
+ }
 
321
 
322
+ // class direct display (w/o animation).
323
+ if ( $settings['button_delay'] < 0 ) {
324
+ $data['button_delay'] = 0;
325
+ $joinchat_classes[] = 'joinchat--show';
326
+ $joinchat_classes[] = 'joinchat--noanim';
327
 
328
+ if ( $settings['mobile_only'] ) {
329
+ $joinchat_classes[] = 'joinchat--mobile';
330
  }
331
+ }
332
 
333
+ if ( $settings['message_text'] ) {
334
+ $box_content = '<div class="joinchat__message">' . JoinChatUtil::formated_message( $settings['message_text'] ) . '</div>';
335
+ }
 
 
 
 
 
 
 
 
336
 
337
+ if ( $settings['optin_text'] ) {
338
+ $optin = nl2br( $settings['optin_text'] );
339
+ $optin = str_replace( '<a ', '<a target="_blank" rel="nofollow noopener" ', $optin );
340
 
341
+ if ( $settings['optin_check'] ) {
342
+ $optin = '<input type="checkbox" id="joinchat_optin"><label for="joinchat_optin">' . $optin . '</label>';
343
+ $joinchat_classes[] = 'joinchat--optout';
344
  }
345
 
346
+ $box_content .= '<div class="joinchat__optin">' . $optin . '</div>';
347
+ }
348
 
349
+ $box_content = apply_filters( 'joinchat_content', $box_content, $settings );
 
 
350
 
351
+ // class only button.
352
+ if ( empty( $box_content ) ) {
353
+ $joinchat_classes[] = 'joinchat--btn';
354
  }
 
355
 
356
+ $joinchat_classes = apply_filters( 'joinchat_classes', $joinchat_classes, $settings );
 
 
 
 
 
 
357
 
358
+ ob_start();
359
+ include __DIR__ . '/partials/html.php';
360
+ $html_output = ob_get_clean();
 
 
 
361
 
362
+ echo apply_filters( 'joinchat_html_output', $html_output, $settings ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
 
363
 
364
  }
365
 
368
  *
369
  * @since 2.0.0
370
  * @since 3.0.0 Added filter to 'joinchat_visibility'
371
+ * @param array $options array of visibility settings.
372
  * @return boolean is visible or not on current page
373
  */
374
  public function check_visibility( $options ) {
375
 
376
+ // Custom visibility, bypass all checks if not null.
377
  $visibility = apply_filters( 'joinchat_visibility', null, $options );
378
  if ( ! is_null( $visibility ) ) {
379
  return $visibility;
380
  }
381
 
382
+ $global = isset( $options['all'] ) ? 'yes' === $options['all'] : true;
383
 
384
+ // Check front page.
385
  if ( is_front_page() ) {
386
+ return isset( $options['front_page'] ) ? 'yes' === $options['front_page'] : $global;
387
  }
388
 
389
+ // Check blog page.
390
  if ( is_home() ) {
391
+ return isset( $options['blog_page'] ) ? 'yes' === $options['blog_page'] : $global;
392
  }
393
 
394
+ // Check 404 page.
395
  if ( is_404() ) {
396
+ return isset( $options['404_page'] ) ? 'yes' === $options['404_page'] : $global;
397
  }
398
 
399
+ // Check Custom Post Types.
400
  if ( is_array( $options ) ) {
401
  foreach ( $options as $cpt => $view ) {
402
+ if ( substr( $cpt, 0, 4 ) === 'cpt_' ) {
403
  $cpt = substr( $cpt, 4 );
404
  if ( is_singular( $cpt ) || is_post_type_archive( $cpt ) ) {
405
+ return 'yes' === $view;
406
  }
407
  }
408
  }
409
  }
410
 
411
+ // Search results.
412
  if ( is_search() ) {
413
+ return isset( $options['search'] ) ? 'yes' === $options['search'] : $global;
414
  }
415
 
416
+ // Check archives.
417
  if ( is_archive() ) {
418
 
419
+ // Date archive.
420
  if ( isset( $options['date'] ) && is_date() ) {
421
+ return 'yes' === $options['date'];
422
  }
423
 
424
+ // Author archive.
425
  if ( isset( $options['author'] ) && is_author() ) {
426
+ return 'yes' === $options['author'];
427
  }
428
 
429
+ return isset( $options['archive'] ) ? 'yes' === $options['archive'] : $global;
430
  }
431
 
432
+ // Check singular.
433
  if ( is_singular() ) {
434
 
435
+ // Page.
436
  if ( isset( $options['page'] ) && is_page() ) {
437
+ return 'yes' === $options['page'];
438
  }
439
 
440
+ // Post (or other custom posts).
441
  if ( isset( $options['post'] ) && is_single() ) {
442
+ return 'yes' === $options['post'];
443
  }
444
 
445
+ return isset( $options['singular'] ) ? 'yes' === $options['singular'] : $global;
446
  }
447
 
448
  return $global;
public/class-joinchat-woo-public.php CHANGED
@@ -99,7 +99,7 @@ class JoinChatWooPublic {
99
  */
100
  public function shop_settings( $settings ) {
101
 
102
- // Applies to product pages
103
  if ( is_product() ) {
104
  $product = wc_get_product();
105
 
@@ -111,9 +111,9 @@ class JoinChatWooPublic {
111
  if ( $settings['message_send_product'] ) {
112
  $settings['message_send'] = $settings['message_send_product'];
113
  }
114
- }
115
- // Applies to shop catalog pages
116
- elseif ( is_woocommerce() ) {
117
  $shop_settings = get_post_meta( wc_get_page_id( 'shop' ), '_joinchat', true );
118
 
119
  if ( is_array( $shop_settings ) ) {
@@ -121,53 +121,54 @@ class JoinChatWooPublic {
121
  }
122
  }
123
 
124
- // Add Product Button
125
  if ( is_product() && 'none' !== $settings['woo_btn_position'] ) {
126
 
127
  $this->btn_text = $settings['woo_btn_text'];
128
 
129
  add_action( $settings['woo_btn_position'], array( $this, 'product_button' ), apply_filters( 'joinchat_woo_btn_priority', 10 ) );
130
-
131
  }
132
 
133
  return $settings;
 
134
  }
135
 
136
  /**
137
  * Return visibility for Woocommerce pages
138
  *
139
  * @since 3.0.0
140
- * @param null $visibility by default $visibility is null.
 
141
  * @return mixed true or false if WooCommerce page apply else return $visibility.
142
  */
143
  public function visibility( $visibility, $options ) {
144
 
145
- $global = isset( $options['all'] ) ? 'yes' == $options['all'] : true;
146
- $woo = isset( $options['woocommerce'] ) ? 'yes' == $options['woocommerce'] : $global;
147
 
148
- // Product page
149
  if ( is_product() ) {
150
- return isset( $options['product'] ) ? 'yes' == $options['product'] : $woo;
151
  }
152
 
153
- // Cart page
154
  if ( is_cart() ) {
155
- return isset( $options['cart'] ) ? 'yes' == $options['cart'] : $woo;
156
  }
157
 
158
- // Checkout page
159
  if ( is_checkout() && ! is_wc_endpoint_url() ) {
160
- return isset( $options['checkout'] ) ? 'yes' == $options['checkout'] : $woo;
161
  }
162
 
163
- // Thankyou page
164
  if ( is_wc_endpoint_url( 'order-received' ) ) {
165
- return isset( $options['thankyou'] ) ? 'yes' == $options['thankyou'] : $woo;
166
  }
167
 
168
- // Customer account pages
169
  if ( is_account_page() ) {
170
- return isset( $options['account_page'] ) ? 'yes' == $options['account_page'] : $woo;
171
  }
172
 
173
  if ( is_woocommerce() ) {
@@ -175,6 +176,7 @@ class JoinChatWooPublic {
175
  }
176
 
177
  return $visibility;
 
178
  }
179
 
180
  /**
@@ -186,7 +188,7 @@ class JoinChatWooPublic {
186
  */
187
  public function replacements( $replacements ) {
188
 
189
- // Only applies to product pages
190
  if ( is_product() ) {
191
  $product = wc_get_product();
192
 
@@ -235,9 +237,9 @@ class JoinChatWooPublic {
235
  */
236
  public function format_price( $product, $price ) {
237
 
238
- $string = strip_tags( wc_price( wc_get_price_to_display( $product, array( 'price' => $price ) ) ) );
239
 
240
- // Escape $ for regex replacement
241
  return str_replace( '$', '\$', $string );
242
 
243
  }
99
  */
100
  public function shop_settings( $settings ) {
101
 
102
+ // Applies to product pages.
103
  if ( is_product() ) {
104
  $product = wc_get_product();
105
 
111
  if ( $settings['message_send_product'] ) {
112
  $settings['message_send'] = $settings['message_send_product'];
113
  }
114
+
115
+ // Applies to shop catalog pages.
116
+ } elseif ( is_woocommerce() ) {
117
  $shop_settings = get_post_meta( wc_get_page_id( 'shop' ), '_joinchat', true );
118
 
119
  if ( is_array( $shop_settings ) ) {
121
  }
122
  }
123
 
124
+ // Add Product Button.
125
  if ( is_product() && 'none' !== $settings['woo_btn_position'] ) {
126
 
127
  $this->btn_text = $settings['woo_btn_text'];
128
 
129
  add_action( $settings['woo_btn_position'], array( $this, 'product_button' ), apply_filters( 'joinchat_woo_btn_priority', 10 ) );
 
130
  }
131
 
132
  return $settings;
133
+
134
  }
135
 
136
  /**
137
  * Return visibility for Woocommerce pages
138
  *
139
  * @since 3.0.0
140
+ * @param null|bool $visibility by default $visibility is null.
141
+ * @param array $options array of visibility settings.
142
  * @return mixed true or false if WooCommerce page apply else return $visibility.
143
  */
144
  public function visibility( $visibility, $options ) {
145
 
146
+ $global = isset( $options['all'] ) ? 'yes' === $options['all'] : true;
147
+ $woo = isset( $options['woocommerce'] ) ? 'yes' === $options['woocommerce'] : $global;
148
 
149
+ // Product page.
150
  if ( is_product() ) {
151
+ return isset( $options['product'] ) ? 'yes' === $options['product'] : $woo;
152
  }
153
 
154
+ // Cart page.
155
  if ( is_cart() ) {
156
+ return isset( $options['cart'] ) ? 'yes' === $options['cart'] : $woo;
157
  }
158
 
159
+ // Checkout page.
160
  if ( is_checkout() && ! is_wc_endpoint_url() ) {
161
+ return isset( $options['checkout'] ) ? 'yes' === $options['checkout'] : $woo;
162
  }
163
 
164
+ // Thankyou page.
165
  if ( is_wc_endpoint_url( 'order-received' ) ) {
166
+ return isset( $options['thankyou'] ) ? 'yes' === $options['thankyou'] : $woo;
167
  }
168
 
169
+ // Customer account pages.
170
  if ( is_account_page() ) {
171
+ return isset( $options['account_page'] ) ? 'yes' === $options['account_page'] : $woo;
172
  }
173
 
174
  if ( is_woocommerce() ) {
176
  }
177
 
178
  return $visibility;
179
+
180
  }
181
 
182
  /**
188
  */
189
  public function replacements( $replacements ) {
190
 
191
+ // Only applies to product pages.
192
  if ( is_product() ) {
193
  $product = wc_get_product();
194
 
237
  */
238
  public function format_price( $product, $price ) {
239
 
240
+ $string = wp_strip_all_tags( wc_price( wc_get_price_to_display( $product, array( 'price' => $price ) ) ) );
241
 
242
+ // Escape $ for regex replacement.
243
  return str_replace( '$', '\$', $string );
244
 
245
  }
public/css/joinchat-btn.css CHANGED
@@ -48,12 +48,6 @@
48
  animation: none;
49
  }
50
 
51
- .joinchat--chatbox:not(.joinchat--noanim) {
52
- transform-origin: 0 0;
53
- -webkit-animation-timing-function: ease-in-out;
54
- animation-timing-function: ease-in-out;
55
- }
56
-
57
  .joinchat__button {
58
  position: absolute;
59
  z-index: 2;
@@ -372,6 +366,10 @@
372
  transition: background-color 200ms;
373
  }
374
 
 
 
 
 
375
  .joinchat__woo-btn:hover {
376
  background-color: #128c7e;
377
  }
48
  animation: none;
49
  }
50
 
 
 
 
 
 
 
51
  .joinchat__button {
52
  position: absolute;
53
  z-index: 2;
366
  transition: background-color 200ms;
367
  }
368
 
369
+ .joinchat__woo-btn:empty {
370
+ padding-right: 0;
371
+ }
372
+
373
  .joinchat__woo-btn:hover {
374
  background-color: #128c7e;
375
  }
public/css/joinchat-btn.min.css CHANGED
@@ -1 +1 @@
1
- :root{--joinchat-ico:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z'/%3E%3C/svg%3E");--joinchat-font:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif}.joinchat{--bottom:20px;--sep:20px;--s:60px;display:none;position:fixed;z-index:9999;right:var(--sep);bottom:var(--bottom);font:normal normal normal 16px/1.625em var(--joinchat-font);letter-spacing:0;animation:joinchat_show .5s cubic-bezier(.18,.89,.32,1.28) 10ms both;transform:scale3d(0,0,0);transform-origin:calc(var(--s)/-2) calc(var(--s)/-4);-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgb(0 0 0/0)}.joinchat *,.joinchat :after,.joinchat :before{box-sizing:border-box}.joinchat--show{display:block;transform:scaleX(1)}.joinchat--left{right:auto;left:var(--sep)}.joinchat--noanim{animation:none}.joinchat--chatbox:not(.joinchat--noanim){transform-origin:0 0;animation-timing-function:ease-in-out}.joinchat__button{position:absolute;z-index:2;bottom:8px;right:8px;height:var(--s);min-width:var(--s);max-width:95vw;background:#25d366;color:inherit;border-radius:calc(var(--s)/2);box-shadow:1px 6px 24px 0 rgb(7 94 84/24%);cursor:pointer;transition:background-color .2s linear}.joinchat__button:hover{background:#128c7e}.joinchat__button:active{background:#128c7e;transition:none}.joinchat--left .joinchat__button{right:auto;left:8px}.joinchat__button__open{width:var(--s);height:var(--s);border-radius:50%;background:rgb(0 0 0/0) var(--joinchat-ico) 50% no-repeat;background-size:60%;overflow:hidden}.joinchat__button__image{position:absolute;top:1px;right:1px;width:calc(var(--s) - 2px);height:calc(var(--s) - 2px);border-radius:50%;overflow:hidden;opacity:0}.joinchat__button__image img{display:block;width:100%;height:100%;object-fit:cover}.joinchat--show .joinchat__button__image{animation:joinchat_image_loop 20s linear 5s infinite normal both}.joinchat--image .joinchat__button__image{opacity:1;animation:none}.joinchat__tooltip{position:absolute;top:calc(var(--s)/2 - 16px);right:calc(var(--s) + 16px);max-width:calc(100vw - 105px);height:32px;padding:0 14px;border:none;border-radius:16px;background:#fff;color:rgb(0 0 0/80%);line-height:31px;white-space:nowrap;opacity:0;transition:opacity .3s ease-out .4s;filter:drop-shadow(0 1px 4px rgb(0 0 0 / 40%));pointer-events:none}.joinchat__tooltip:after{content:"";display:block;position:absolute;top:10px;right:-6px;border:8px solid transparent;border-width:6px 0 6px 8px;border-left-color:#fff}.joinchat__tooltip div{overflow:hidden;text-overflow:ellipsis}.joinchat--tooltip .joinchat__tooltip{animation:joinchat_tootlip 20s linear 5s 1 normal both}.joinchat--left .joinchat__tooltip{right:auto;left:calc(var(--s) + 16px)}.joinchat--left .joinchat__tooltip:after{left:-6px;right:auto;border-color:transparent;border-width:6px 8px 6px 0;border-right-color:#fff}.joinchat__qr{position:absolute;bottom:calc(var(--s) + 16px);right:0;display:none;flex-direction:column-reverse;width:228px;min-height:200px;padding:14px 14px 10px;border:none;border-radius:16px;background:#fff;color:rgb(0 0 0/80%);text-align:center;white-space:nowrap;opacity:1;transition:opacity .3s ease-out .4s;filter:drop-shadow(0 1px 4px rgb(0 0 0 / 40%));animation:joinchat_badge_in .4s cubic-bezier(.11,.84,.83,1.01) 1s both;pointer-events:none}.joinchat__qr:after{content:"";display:block;position:absolute;bottom:-6px;right:calc(var(--s)/2 - 6px);border:8px solid transparent;border-width:8px 6px 0;border-top-color:#fff}.joinchat--left .joinchat__qr{left:0;right:auto}.joinchat--left .joinchat__qr:after{left:calc(var(--s)/2 - 6px);right:auto}.joinchat__qr div{font-size:14px;color:#4a4a4a;overflow:hidden;text-overflow:ellipsis}.joinchat__qr canvas{display:block;width:200px;height:200px;margin:0}@keyframes joinchat_show{0%{transform:scale3d(0,0,0)}to{transform:scaleX(1)}}@keyframes joinchat_badge_in{0%{opacity:0;transform:translate3d(0,50px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes joinchat_image_loop{0%{opacity:0}3%,20%{opacity:1}25%,to{opacity:0}}@keyframes joinchat_tootlip{0%{opacity:0;transform:scaleY(0)}1%,20%{opacity:1;transform:scaleX(1)}25%,to{opacity:0;transform:scaleX(1)}}.joinchat__woo-btn__wrapper{clear:both}.joinchat__woo-btn{--s:40px;display:inline-block;box-sizing:border-box;height:var(--s);max-width:100%;padding:0 calc(var(--s)/2) 0 var(--s);background:#25d366 var(--joinchat-ico) calc(var(--s)*0.2) 50% no-repeat;background-size:calc(var(--s)*0.6);color:#fff;border-radius:calc(var(--s)/2);font:700 normal calc(var(--s)*0.35)/var(--s) var(--joinchat-font);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;transition:background-color .2s}.joinchat__woo-btn:hover{background-color:#128c7e}@media (orientation:landscape) and (min-height:481px),(orientation:portrait) and (min-width:481px){.joinchat--mobile{display:none!important}}@media (max-width:767px){.joinchat--footer-bar{--bottom:76px!important}}@media (max-width:480px),(orientation:landscape) and (max-height:480px){.joinchat{--bottom:6px;--sep:6px}}@media (hover:hover){.joinchat__button:hover .joinchat__tooltip{opacity:1;animation:none;transition:opacity .2s}.joinchat--btn .joinchat__button:hover .joinchat__qr{display:flex}}@media (prefers-reduced-motion){.joinchat{animation:none}}
1
+ :root{--joinchat-ico:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z'/%3E%3C/svg%3E");--joinchat-font:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif}.joinchat{--bottom:20px;--sep:20px;--s:60px;display:none;position:fixed;z-index:9999;right:var(--sep);bottom:var(--bottom);font:normal normal normal 16px/1.625em var(--joinchat-font);letter-spacing:0;animation:joinchat_show .5s cubic-bezier(.18,.89,.32,1.28) 10ms both;transform:scale3d(0,0,0);transform-origin:calc(var(--s)/-2) calc(var(--s)/-4);-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgb(0 0 0/0)}.joinchat *,.joinchat :after,.joinchat :before{box-sizing:border-box}.joinchat--show{display:block;transform:scaleX(1)}.joinchat--left{right:auto;left:var(--sep)}.joinchat--noanim{animation:none}.joinchat__button{position:absolute;z-index:2;bottom:8px;right:8px;height:var(--s);min-width:var(--s);max-width:95vw;background:#25d366;color:inherit;border-radius:calc(var(--s)/2);box-shadow:1px 6px 24px 0 rgb(7 94 84/24%);cursor:pointer;transition:background-color .2s linear}.joinchat__button:hover{background:#128c7e}.joinchat__button:active{background:#128c7e;transition:none}.joinchat--left .joinchat__button{right:auto;left:8px}.joinchat__button__open{width:var(--s);height:var(--s);border-radius:50%;background:rgb(0 0 0/0) var(--joinchat-ico) 50% no-repeat;background-size:60%;overflow:hidden}.joinchat__button__image{position:absolute;top:1px;right:1px;width:calc(var(--s) - 2px);height:calc(var(--s) - 2px);border-radius:50%;overflow:hidden;opacity:0}.joinchat__button__image img{display:block;width:100%;height:100%;object-fit:cover}.joinchat--show .joinchat__button__image{animation:joinchat_image_loop 20s linear 5s infinite normal both}.joinchat--image .joinchat__button__image{opacity:1;animation:none}.joinchat__tooltip{position:absolute;top:calc(var(--s)/2 - 16px);right:calc(var(--s) + 16px);max-width:calc(100vw - 105px);height:32px;padding:0 14px;border:none;border-radius:16px;background:#fff;color:rgb(0 0 0/80%);line-height:31px;white-space:nowrap;opacity:0;transition:opacity .3s ease-out .4s;filter:drop-shadow(0 1px 4px rgb(0 0 0 / 40%));pointer-events:none}.joinchat__tooltip:after{content:"";display:block;position:absolute;top:10px;right:-6px;border:8px solid transparent;border-width:6px 0 6px 8px;border-left-color:#fff}.joinchat__tooltip div{overflow:hidden;text-overflow:ellipsis}.joinchat--tooltip .joinchat__tooltip{animation:joinchat_tootlip 20s linear 5s 1 normal both}.joinchat--left .joinchat__tooltip{right:auto;left:calc(var(--s) + 16px)}.joinchat--left .joinchat__tooltip:after{left:-6px;right:auto;border-color:transparent;border-width:6px 8px 6px 0;border-right-color:#fff}.joinchat__qr{position:absolute;bottom:calc(var(--s) + 16px);right:0;display:none;flex-direction:column-reverse;width:228px;min-height:200px;padding:14px 14px 10px;border:none;border-radius:16px;background:#fff;color:rgb(0 0 0/80%);text-align:center;white-space:nowrap;opacity:1;transition:opacity .3s ease-out .4s;filter:drop-shadow(0 1px 4px rgb(0 0 0 / 40%));animation:joinchat_badge_in .4s cubic-bezier(.11,.84,.83,1.01) 1s both;pointer-events:none}.joinchat__qr:after{content:"";display:block;position:absolute;bottom:-6px;right:calc(var(--s)/2 - 6px);border:8px solid transparent;border-width:8px 6px 0;border-top-color:#fff}.joinchat--left .joinchat__qr{left:0;right:auto}.joinchat--left .joinchat__qr:after{left:calc(var(--s)/2 - 6px);right:auto}.joinchat__qr div{font-size:14px;color:#4a4a4a;overflow:hidden;text-overflow:ellipsis}.joinchat__qr canvas{display:block;width:200px;height:200px;margin:0}@keyframes joinchat_show{0%{transform:scale3d(0,0,0)}to{transform:scaleX(1)}}@keyframes joinchat_badge_in{0%{opacity:0;transform:translate3d(0,50px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes joinchat_image_loop{0%{opacity:0}3%,20%{opacity:1}25%,to{opacity:0}}@keyframes joinchat_tootlip{0%{opacity:0;transform:scaleY(0)}1%,20%{opacity:1;transform:scaleX(1)}25%,to{opacity:0;transform:scaleX(1)}}.joinchat__woo-btn__wrapper{clear:both}.joinchat__woo-btn{--s:40px;display:inline-block;box-sizing:border-box;height:var(--s);max-width:100%;padding:0 calc(var(--s)/2) 0 var(--s);background:#25d366 var(--joinchat-ico) calc(var(--s)*0.2) 50% no-repeat;background-size:calc(var(--s)*0.6);color:#fff;border-radius:calc(var(--s)/2);font:700 normal calc(var(--s)*0.35)/var(--s) var(--joinchat-font);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;transition:background-color .2s}.joinchat__woo-btn:empty{padding-right:0}.joinchat__woo-btn:hover{background-color:#128c7e}@media (orientation:landscape) and (min-height:481px),(orientation:portrait) and (min-width:481px){.joinchat--mobile{display:none!important}}@media (max-width:767px){.joinchat--footer-bar{--bottom:76px!important}}@media (max-width:480px),(orientation:landscape) and (max-height:480px){.joinchat{--bottom:6px;--sep:6px}}@media (hover:hover){.joinchat__button:hover .joinchat__tooltip{opacity:1;animation:none;transition:opacity .2s}.joinchat--btn .joinchat__button:hover .joinchat__qr{display:flex}}@media (prefers-reduced-motion){.joinchat{animation:none}}
public/css/joinchat-woo.css CHANGED
@@ -27,6 +27,10 @@
27
  transition: background-color 200ms;
28
  }
29
 
 
 
 
 
30
  .joinchat__woo-btn:hover {
31
  background-color: #128c7e;
32
  }
27
  transition: background-color 200ms;
28
  }
29
 
30
+ .joinchat__woo-btn:empty {
31
+ padding-right: 0;
32
+ }
33
+
34
  .joinchat__woo-btn:hover {
35
  background-color: #128c7e;
36
  }
public/css/joinchat-woo.min.css CHANGED
@@ -1 +1 @@
1
- :root{--joinchat-ico:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z'/%3E%3C/svg%3E");--joinchat-font:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif}.joinchat__woo-btn__wrapper{clear:both}.joinchat__woo-btn{--s:40px;display:inline-block;box-sizing:border-box;height:var(--s);max-width:100%;padding:0 calc(var(--s)/2) 0 var(--s);background:#25d366 var(--joinchat-ico) calc(var(--s)*0.2) 50% no-repeat;background-size:calc(var(--s)*0.6);color:#fff;border-radius:calc(var(--s)/2);font:700 normal calc(var(--s)*0.35)/var(--s) var(--joinchat-font);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;transition:background-color .2s}.joinchat__woo-btn:hover{background-color:#128c7e}
1
+ :root{--joinchat-ico:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z'/%3E%3C/svg%3E");--joinchat-font:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif}.joinchat__woo-btn__wrapper{clear:both}.joinchat__woo-btn{--s:40px;display:inline-block;box-sizing:border-box;height:var(--s);max-width:100%;padding:0 calc(var(--s)/2) 0 var(--s);background:#25d366 var(--joinchat-ico) calc(var(--s)*0.2) 50% no-repeat;background-size:calc(var(--s)*0.6);color:#fff;border-radius:calc(var(--s)/2);font:700 normal calc(var(--s)*0.35)/var(--s) var(--joinchat-font);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;transition:background-color .2s}.joinchat__woo-btn:empty{padding-right:0}.joinchat__woo-btn:hover{background-color:#128c7e}
public/css/joinchat.css CHANGED
@@ -899,6 +899,10 @@
899
  transition: background-color 200ms;
900
  }
901
 
 
 
 
 
902
  .joinchat__woo-btn:hover {
903
  background-color: #128c7e;
904
  }
899
  transition: background-color 200ms;
900
  }
901
 
902
+ .joinchat__woo-btn:empty {
903
+ padding-right: 0;
904
+ }
905
+
906
  .joinchat__woo-btn:hover {
907
  background-color: #128c7e;
908
  }
public/css/joinchat.min.css CHANGED
@@ -1 +1 @@
1
- :root{--joinchat-ico:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z'/%3E%3C/svg%3E");--joinchat-font:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif}.joinchat{--bottom:20px;--sep:20px;--s:60px;--header:calc(var(--s)*1.16667);--vh:100vh;--red:37;--green:211;--blue:102;--rgb:var(--red) var(--green) var(--blue);--color:rgb(var(--rgb));--dark:rgb(calc(var(--red) - 75) calc(var(--green) - 75) calc(var(--blue) - 75));--hover:rgb(calc(var(--red) + 50) calc(var(--green) + 50) calc(var(--blue) + 50));--bg:rgb(var(--rgb)/4%);--tolerance:210;--bw:calc((var(--red)*0.2126 + var(--green)*0.7152 + var(--blue)*0.0722 - var(--tolerance))*-10000000);--text:hsl(0deg 0% calc(var(--bw)*1%)/clamp(70%,calc(var(--bw)*1%),100%));--msg:var(--color);color:var(--text);display:none;position:fixed;z-index:9999;right:var(--sep);bottom:var(--bottom);font:normal normal normal 16px/1.625em var(--joinchat-font);letter-spacing:0;animation:joinchat_show .5s cubic-bezier(.18,.89,.32,1.28) 10ms both;transform:scale3d(0,0,0);transform-origin:calc(var(--s)/-2) calc(var(--s)/-4);-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgb(0 0 0/0)}.joinchat *,.joinchat :after,.joinchat :before{box-sizing:border-box}.joinchat--show{display:block;transform:scaleX(1)}.joinchat--left{right:auto;left:var(--sep)}.joinchat--dark{--msg:var(--dark)}.joinchat--noanim{animation:none}.joinchat--chatbox:not(.joinchat--noanim){transform-origin:0 0;animation-timing-function:ease-in-out}.joinchat--hidden{display:none!important}@supports not (width:clamp(1px,1%,10px)){.joinchat{--text:hsl(0deg 0% calc(var(--bw)*1%)/90%)}}.joinchat__button{display:flex;flex-direction:row;position:absolute;z-index:2;bottom:8px;right:8px;height:var(--s);min-width:var(--s);max-width:95vw;background:#25d366;color:inherit;border-radius:calc(var(--s)/2);box-shadow:1px 6px 24px 0 rgb(7 94 84/24%);cursor:pointer;transition:background-color .2s linear}[dir=rtl] .joinchat__button{flex-direction:row-reverse}.joinchat__button:hover{background:#128c7e;transition-duration:1.5s}.joinchat__button:active{background:#128c7e;transition:none}.joinchat--left .joinchat__button{right:auto;left:8px;flex-direction:row-reverse}[dir=rtl] .joinchat--left .joinchat__button{flex-direction:row}.joinchat--chatbox .joinchat__button{background:var(--color);transition-duration:.2s;box-shadow:0 1px 2px 0 rgb(0 0 0/30%)}.joinchat--chatbox .joinchat__button:active,.joinchat--chatbox .joinchat__button:hover{background:var(--hover)}.joinchat--optout.joinchat--chatbox .joinchat__button{background-color:#999;opacity:.5;pointer-events:none}.joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__plain{stroke-dasharray:0;animation:none}.joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__chat{animation:none}.joinchat__button__open{width:var(--s);height:var(--s);border-radius:50%;background:rgb(0 0 0/0) var(--joinchat-ico) 50% no-repeat;background-size:60%;overflow:hidden}.joinchat--chatbox .joinchat__button__open{display:none}.joinchat__button__image{position:absolute;top:1px;right:1px;width:calc(var(--s) - 2px);height:calc(var(--s) - 2px);border-radius:50%;overflow:hidden;opacity:0}.joinchat__button__image img{display:block;width:100%;height:100%;object-fit:cover}.joinchat--show .joinchat__button__image{animation:joinchat_image_loop 20s linear 5s infinite normal both}.joinchat--image .joinchat__button__image{opacity:1;animation:none}.joinchat--chatbox .joinchat__button__image{display:none}.joinchat__button__send{display:none;flex-shrink:0;width:var(--s);height:var(--s);max-width:var(--s);padding:calc(var(--s)*0.18);margin:0;overflow:hidden}.joinchat--chatbox .joinchat__button__send{display:block}.joinchat__button__send path{fill:none!important;stroke:var(--text)!important}.joinchat__button__send .joinchat_svg__plain{stroke-dasharray:1097;stroke-dashoffset:1097;animation:joinchat_plain 6s .2s ease-in-out infinite}.joinchat__button__send .joinchat_svg__chat{stroke-dasharray:1020;stroke-dashoffset:1020;animation:joinchat_chat 6s 3.2s ease-in-out infinite}.joinchat__button__sendtext{padding:0;max-width:0;border-radius:var(--s);font-weight:600;line-height:var(--s);white-space:nowrap;opacity:0;overflow:hidden;transition:none}.joinchat--chatbox .joinchat__button__sendtext{padding:0 4px 0 24px;max-width:200px;opacity:1;transition:max-width .2s linear,opacity .4s ease-out .2s}.joinchat--chatbox.joinchat--left .joinchat__button__sendtext{padding:0 24px 0 4px}.joinchat__badge{position:absolute;top:-4px;right:-4px;width:20px;height:20px;border:none;border-radius:50%;background:#e82c0c;color:#fff;font-size:12px;font-weight:600;line-height:20px;text-align:center;box-shadow:none;opacity:0;pointer-events:none}.joinchat__badge.joinchat__badge--in{animation:joinchat_badge_in .5s cubic-bezier(.27,.9,.41,1.28) 1 both}.joinchat__badge.joinchat__badge--out{animation:joinchat_badge_out .4s cubic-bezier(.215,.61,.355,1) 1 both}.joinchat__tooltip{position:absolute;top:calc(var(--s)/2 - 16px);right:calc(var(--s) + 16px);max-width:calc(100vw - 105px);height:32px;padding:0 14px;border:none;border-radius:16px;background:#fff;color:rgb(0 0 0/80%);line-height:31px;white-space:nowrap;opacity:0;transition:opacity .3s ease-out .4s;filter:drop-shadow(0 1px 4px rgb(0 0 0 / 40%));pointer-events:none}.joinchat__tooltip:after{content:"";display:block;position:absolute;top:10px;right:-6px;border:8px solid transparent;border-width:6px 0 6px 8px;border-left-color:#fff}.joinchat__tooltip div{overflow:hidden;text-overflow:ellipsis}.joinchat--tooltip .joinchat__tooltip{animation:joinchat_tootlip 20s linear 5s 1 normal both}.joinchat--chatbox .joinchat__tooltip{display:none}.joinchat--left .joinchat__tooltip{right:auto;left:calc(var(--s) + 16px)}.joinchat--left .joinchat__tooltip:after{left:-6px;right:auto;border-color:transparent;border-width:6px 8px 6px 0;border-right-color:#fff}.joinchat__qr{position:absolute;bottom:calc(var(--s) + 16px);right:0;display:none;flex-direction:column-reverse;width:228px;min-height:200px;padding:14px 14px 10px;border:none;border-radius:16px;background:#fff;color:rgb(0 0 0/80%);text-align:center;white-space:nowrap;opacity:1;transition:opacity .3s ease-out .4s;filter:drop-shadow(0 1px 4px rgb(0 0 0 / 40%));animation:joinchat_badge_in .4s cubic-bezier(.11,.84,.83,1.01) 1s both;pointer-events:none}.joinchat__qr:after{content:"";display:block;position:absolute;bottom:-6px;right:calc(var(--s)/2 - 6px);border:8px solid transparent;border-width:8px 6px 0;border-top-color:#fff}.joinchat--left .joinchat__qr{left:0;right:auto}.joinchat--left .joinchat__qr:after{left:calc(var(--s)/2 - 6px);right:auto}.joinchat__qr div{font-size:14px;color:#4a4a4a;overflow:hidden;text-overflow:ellipsis}.joinchat__qr canvas{display:block;width:200px;height:200px;margin:0}.joinchat__box{display:flex;flex-direction:column;position:absolute;bottom:0;right:0;z-index:1;width:calc(100vw - var(--sep)*2);max-width:400px;min-height:170px;max-height:calc(var(--vh) - var(--bottom) - var(--sep));border-radius:calc(var(--s)/2 + 2px);background:transparent;box-shadow:0 2px 6px 0 rgb(0 0 0/50%);text-align:left;overflow:hidden;transform:scale3d(0,0,0);opacity:0;transition:max-height .2s ease-out,opacity .4s ease-out,transform 0s linear .3s}[dir=rtl] .joinchat__box{text-align:right}.joinchat--chatbox .joinchat__box{opacity:1;transform:scaleX(1);transition:max-height .2s ease-out,opacity .2s ease-out,transform 0s linear}.joinchat--left .joinchat__box{right:auto;left:0}.joinchat__header{display:flex;flex-flow:row;align-items:center;position:relative;flex-shrink:0;height:var(--header);min-height:50px;padding:0 70px 0 26px;margin:0;background:var(--color)}[dir=rtl] .joinchat__header{padding:0 26px 0 70px}.joinchat--dark .joinchat__header{background:var(--dark)}.joinchat__header__text{font-size:19px;font-weight:600;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.8}.joinchat__powered{font-size:11px;line-height:18px;color:inherit!important;text-decoration:none!important;fill:currentcolor;opacity:.8}.joinchat__powered svg{display:inline-block;width:auto;height:18px;vertical-align:-30%}.joinchat__powered:active,.joinchat__powered:hover{color:inherit!important;text-decoration:none!important;opacity:.9;filter:drop-shadow(0 1px 3px rgb(0 0 0 / 30%))}.joinchat__wa{height:28px;width:auto;fill:currentcolor;opacity:.8}.joinchat__close{--size:34px;position:absolute;top:calc(50% - var(--size)/2);right:24px;width:var(--size);height:var(--size);border-radius:50%;background:rgb(0 0 0/40%) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M24 2.4 21.6 0 12 9.6 2.4 0 0 2.4 9.6 12 0 21.6 2.4 24l9.6-9.6 9.6 9.6 2.4-2.4-9.6-9.6L24 2.4z'/%3E%3C/svg%3E") 50% no-repeat;background-size:12px;cursor:pointer;transition:background-color .3s ease-out}.joinchat__close:hover{background-color:rgb(0 0 0/60%)}.joinchat__close:active{background-color:rgb(0 0 0/70%)}[dir=rtl] .joinchat__close{right:auto;left:24px}.joinchat__box__scroll{padding:20px 0 70px;padding-bottom:calc(var(--s) + 10px);background:#fff linear-gradient(0deg,var(--bg),var(--bg));overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain}.joinchat__box__scroll::-webkit-scrollbar{width:5px;background:rgb(0 0 0/0)}.joinchat__box__scroll::-webkit-scrollbar-thumb{border-radius:3px;background:rgb(0 0 0/0)}.joinchat--blur .joinchat__box__scroll{background:rgba(var(--rgb)/2%);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.joinchat--dark .joinchat__box__scroll{background:#1a1a1a}.joinchat__box__scroll:hover::-webkit-scrollbar-thumb{background:rgb(0 0 0/20%)}@supports (-webkit-overflow-scrolling:touch){.joinchat__box__scroll{overflow-y:scroll;-webkit-overflow-scrolling:touch}}.joinchat__optin{padding:0 16px;margin-bottom:16px;color:#4a4a4a;font-size:13px;line-height:1.33}.joinchat__optin a{display:inline;padding:0;color:inherit!important;text-decoration:underline}.joinchat__optin a:hover{text-decoration-thickness:2px}.joinchat__optin input{position:absolute;visibility:hidden}.joinchat__optin label{position:relative;display:block;margin:0;padding:0 0 0 30px;color:inherit;font:inherit;cursor:pointer}.joinchat__optin label:before{content:"";display:block;position:absolute;top:calc(50% - 11px);left:0;width:22px;height:22px;border:3px solid var(--color);border-radius:4px;box-shadow:0 0 0 1px var(--text);transition:box-shadow .3s ease-in-out}.joinchat__optin label:after{content:"";display:none;position:absolute;top:calc(50% - 8px);left:8px;width:6px;height:14px;border:solid var(--text);border-width:0 3px 3px 0;transform:rotate(45deg)}[dir=rtl] .joinchat__optin label{padding:0 30px 0 0}[dir=rtl] .joinchat__optin label:before{left:auto;right:0}[dir=rtl] .joinchat__optin label:after{left:auto;right:8px}.joinchat__optin input:checked+label:before{box-shadow:0 0 0 1px var(--text),inset 0 0 0 10px var(--color)}.joinchat__optin input:checked+label:after{display:block}.joinchat--dark .joinchat__optin{color:#d8d8d8}.joinchat__message{position:relative;min-height:60px;padding:17px 20px;margin:0 26px 26px;border-radius:32px;background:#fff;color:#4a4a4a;word-break:break-word;filter:drop-shadow(0 1px 2px rgb(0 0 0 / 30%));transform:translateZ(0)}.joinchat__message:before{content:"";display:block;position:absolute;bottom:20px;left:-15px;width:17px;height:25px;background:inherit;-webkit-clip-path:var(--peak,url(#joinchat__message__peak));clip-path:var(--peak,url(#joinchat__message__peak))}.joinchat--dark .joinchat__message{background:#505050;color:#d8d8d8}@keyframes joinchat_show{0%{transform:scale3d(0,0,0)}to{transform:scaleX(1)}}@keyframes joinchat_badge_in{0%{opacity:0;transform:translate3d(0,50px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes joinchat_badge_out{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,-20px,0)}}@keyframes joinchat_plain{0%,50%,to{stroke-dashoffset:1097}5%,45%{stroke-dashoffset:0}}@keyframes joinchat_chat{0%,50%,to{stroke-dashoffset:1020}5%,45%{stroke-dashoffset:0}}@keyframes joinchat_image_loop{0%{opacity:0}3%,20%{opacity:1}25%,to{opacity:0}}@keyframes joinchat_tootlip{0%{opacity:0;transform:scaleY(0)}1%,20%{opacity:1;transform:scaleX(1)}25%,to{opacity:0;transform:scaleX(1)}}.joinchat__woo-btn__wrapper{clear:both}.joinchat__woo-btn{--s:40px;display:inline-block;box-sizing:border-box;height:var(--s);max-width:100%;padding:0 calc(var(--s)/2) 0 var(--s);background:#25d366 var(--joinchat-ico) calc(var(--s)*0.2) 50% no-repeat;background-size:calc(var(--s)*0.6);color:#fff;border-radius:calc(var(--s)/2);font:700 normal calc(var(--s)*0.35)/var(--s) var(--joinchat-font);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;transition:background-color .2s}.joinchat__woo-btn:hover{background-color:#128c7e}@media (orientation:landscape) and (min-height:481px),(orientation:portrait) and (min-width:481px){.joinchat--mobile{display:none!important}}@media (max-width:767px){.joinchat--footer-bar{--bottom:76px!important}}@media (max-width:480px),(orientation:landscape) and (max-height:480px){.joinchat{--bottom:6px;--sep:6px;--header:calc(var(--s)*0.91667)}.joinchat__header__text{font-size:17px}.joinchat__close{--size:28px}.joinchat__box__scroll{padding-top:15px}.joinchat__message{padding:18px 16px;line-height:24px;margin:0 20px 20px}}@media (hover:hover){.joinchat__button:hover .joinchat__tooltip{opacity:1;animation:none;transition:opacity .2s}.joinchat--btn .joinchat__button:hover .joinchat__qr,.joinchat--chatbox .joinchat__button:hover .joinchat__qr{display:flex}}@media (prefers-color-scheme:dark){.joinchat--dark-auto{--msg:var(--dark)}.joinchat--dark-auto .joinchat__box__scroll{background:#1a1a1a}.joinchat--dark-auto .joinchat__header{background:var(--dark)}.joinchat--dark-auto .joinchat__optin{color:#d8d8d8}.joinchat--dark-auto .joinchat__message{background:#505050;color:#d8d8d8}}@media (prefers-reduced-motion){.joinchat{animation:none}.joinchat__button__send .joinchat_svg__plain{stroke-dasharray:0;animation:none}.joinchat__button__send .joinchat_svg__chat{animation:none}.joinchat__button__sendtext{transition:none!important}}
1
+ :root{--joinchat-ico:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z'/%3E%3C/svg%3E");--joinchat-font:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif}.joinchat{--bottom:20px;--sep:20px;--s:60px;--header:calc(var(--s)*1.16667);--vh:100vh;--red:37;--green:211;--blue:102;--rgb:var(--red) var(--green) var(--blue);--color:rgb(var(--rgb));--dark:rgb(calc(var(--red) - 75) calc(var(--green) - 75) calc(var(--blue) - 75));--hover:rgb(calc(var(--red) + 50) calc(var(--green) + 50) calc(var(--blue) + 50));--bg:rgb(var(--rgb)/4%);--tolerance:210;--bw:calc((var(--red)*0.2126 + var(--green)*0.7152 + var(--blue)*0.0722 - var(--tolerance))*-10000000);--text:hsl(0deg 0% calc(var(--bw)*1%)/clamp(70%,calc(var(--bw)*1%),100%));--msg:var(--color);color:var(--text);display:none;position:fixed;z-index:9999;right:var(--sep);bottom:var(--bottom);font:normal normal normal 16px/1.625em var(--joinchat-font);letter-spacing:0;animation:joinchat_show .5s cubic-bezier(.18,.89,.32,1.28) 10ms both;transform:scale3d(0,0,0);transform-origin:calc(var(--s)/-2) calc(var(--s)/-4);-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgb(0 0 0/0)}.joinchat *,.joinchat :after,.joinchat :before{box-sizing:border-box}.joinchat--show{display:block;transform:scaleX(1)}.joinchat--left{right:auto;left:var(--sep)}.joinchat--dark{--msg:var(--dark)}.joinchat--noanim{animation:none}.joinchat--chatbox:not(.joinchat--noanim){transform-origin:0 0;animation-timing-function:ease-in-out}.joinchat--hidden{display:none!important}@supports not (width:clamp(1px,1%,10px)){.joinchat{--text:hsl(0deg 0% calc(var(--bw)*1%)/90%)}}.joinchat__button{display:flex;flex-direction:row;position:absolute;z-index:2;bottom:8px;right:8px;height:var(--s);min-width:var(--s);max-width:95vw;background:#25d366;color:inherit;border-radius:calc(var(--s)/2);box-shadow:1px 6px 24px 0 rgb(7 94 84/24%);cursor:pointer;transition:background-color .2s linear}[dir=rtl] .joinchat__button{flex-direction:row-reverse}.joinchat__button:hover{background:#128c7e;transition-duration:1.5s}.joinchat__button:active{background:#128c7e;transition:none}.joinchat--left .joinchat__button{right:auto;left:8px;flex-direction:row-reverse}[dir=rtl] .joinchat--left .joinchat__button{flex-direction:row}.joinchat--chatbox .joinchat__button{background:var(--color);transition-duration:.2s;box-shadow:0 1px 2px 0 rgb(0 0 0/30%)}.joinchat--chatbox .joinchat__button:active,.joinchat--chatbox .joinchat__button:hover{background:var(--hover)}.joinchat--optout.joinchat--chatbox .joinchat__button{background-color:#999;opacity:.5;pointer-events:none}.joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__plain{stroke-dasharray:0;animation:none}.joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__chat{animation:none}.joinchat__button__open{width:var(--s);height:var(--s);border-radius:50%;background:rgb(0 0 0/0) var(--joinchat-ico) 50% no-repeat;background-size:60%;overflow:hidden}.joinchat--chatbox .joinchat__button__open{display:none}.joinchat__button__image{position:absolute;top:1px;right:1px;width:calc(var(--s) - 2px);height:calc(var(--s) - 2px);border-radius:50%;overflow:hidden;opacity:0}.joinchat__button__image img{display:block;width:100%;height:100%;object-fit:cover}.joinchat--show .joinchat__button__image{animation:joinchat_image_loop 20s linear 5s infinite normal both}.joinchat--image .joinchat__button__image{opacity:1;animation:none}.joinchat--chatbox .joinchat__button__image{display:none}.joinchat__button__send{display:none;flex-shrink:0;width:var(--s);height:var(--s);max-width:var(--s);padding:calc(var(--s)*0.18);margin:0;overflow:hidden}.joinchat--chatbox .joinchat__button__send{display:block}.joinchat__button__send path{fill:none!important;stroke:var(--text)!important}.joinchat__button__send .joinchat_svg__plain{stroke-dasharray:1097;stroke-dashoffset:1097;animation:joinchat_plain 6s .2s ease-in-out infinite}.joinchat__button__send .joinchat_svg__chat{stroke-dasharray:1020;stroke-dashoffset:1020;animation:joinchat_chat 6s 3.2s ease-in-out infinite}.joinchat__button__sendtext{padding:0;max-width:0;border-radius:var(--s);font-weight:600;line-height:var(--s);white-space:nowrap;opacity:0;overflow:hidden;transition:none}.joinchat--chatbox .joinchat__button__sendtext{padding:0 4px 0 24px;max-width:200px;opacity:1;transition:max-width .2s linear,opacity .4s ease-out .2s}.joinchat--chatbox.joinchat--left .joinchat__button__sendtext{padding:0 24px 0 4px}.joinchat__badge{position:absolute;top:-4px;right:-4px;width:20px;height:20px;border:none;border-radius:50%;background:#e82c0c;color:#fff;font-size:12px;font-weight:600;line-height:20px;text-align:center;box-shadow:none;opacity:0;pointer-events:none}.joinchat__badge.joinchat__badge--in{animation:joinchat_badge_in .5s cubic-bezier(.27,.9,.41,1.28) 1 both}.joinchat__badge.joinchat__badge--out{animation:joinchat_badge_out .4s cubic-bezier(.215,.61,.355,1) 1 both}.joinchat__tooltip{position:absolute;top:calc(var(--s)/2 - 16px);right:calc(var(--s) + 16px);max-width:calc(100vw - 105px);height:32px;padding:0 14px;border:none;border-radius:16px;background:#fff;color:rgb(0 0 0/80%);line-height:31px;white-space:nowrap;opacity:0;transition:opacity .3s ease-out .4s;filter:drop-shadow(0 1px 4px rgb(0 0 0 / 40%));pointer-events:none}.joinchat__tooltip:after{content:"";display:block;position:absolute;top:10px;right:-6px;border:8px solid transparent;border-width:6px 0 6px 8px;border-left-color:#fff}.joinchat__tooltip div{overflow:hidden;text-overflow:ellipsis}.joinchat--tooltip .joinchat__tooltip{animation:joinchat_tootlip 20s linear 5s 1 normal both}.joinchat--chatbox .joinchat__tooltip{display:none}.joinchat--left .joinchat__tooltip{right:auto;left:calc(var(--s) + 16px)}.joinchat--left .joinchat__tooltip:after{left:-6px;right:auto;border-color:transparent;border-width:6px 8px 6px 0;border-right-color:#fff}.joinchat__qr{position:absolute;bottom:calc(var(--s) + 16px);right:0;display:none;flex-direction:column-reverse;width:228px;min-height:200px;padding:14px 14px 10px;border:none;border-radius:16px;background:#fff;color:rgb(0 0 0/80%);text-align:center;white-space:nowrap;opacity:1;transition:opacity .3s ease-out .4s;filter:drop-shadow(0 1px 4px rgb(0 0 0 / 40%));animation:joinchat_badge_in .4s cubic-bezier(.11,.84,.83,1.01) 1s both;pointer-events:none}.joinchat__qr:after{content:"";display:block;position:absolute;bottom:-6px;right:calc(var(--s)/2 - 6px);border:8px solid transparent;border-width:8px 6px 0;border-top-color:#fff}.joinchat--left .joinchat__qr{left:0;right:auto}.joinchat--left .joinchat__qr:after{left:calc(var(--s)/2 - 6px);right:auto}.joinchat__qr div{font-size:14px;color:#4a4a4a;overflow:hidden;text-overflow:ellipsis}.joinchat__qr canvas{display:block;width:200px;height:200px;margin:0}.joinchat__box{display:flex;flex-direction:column;position:absolute;bottom:0;right:0;z-index:1;width:calc(100vw - var(--sep)*2);max-width:400px;min-height:170px;max-height:calc(var(--vh) - var(--bottom) - var(--sep));border-radius:calc(var(--s)/2 + 2px);background:transparent;box-shadow:0 2px 6px 0 rgb(0 0 0/50%);text-align:left;overflow:hidden;transform:scale3d(0,0,0);opacity:0;transition:max-height .2s ease-out,opacity .4s ease-out,transform 0s linear .3s}[dir=rtl] .joinchat__box{text-align:right}.joinchat--chatbox .joinchat__box{opacity:1;transform:scaleX(1);transition:max-height .2s ease-out,opacity .2s ease-out,transform 0s linear}.joinchat--left .joinchat__box{right:auto;left:0}.joinchat__header{display:flex;flex-flow:row;align-items:center;position:relative;flex-shrink:0;height:var(--header);min-height:50px;padding:0 70px 0 26px;margin:0;background:var(--color)}[dir=rtl] .joinchat__header{padding:0 26px 0 70px}.joinchat--dark .joinchat__header{background:var(--dark)}.joinchat__header__text{font-size:19px;font-weight:600;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.8}.joinchat__powered{font-size:11px;line-height:18px;color:inherit!important;text-decoration:none!important;fill:currentcolor;opacity:.8}.joinchat__powered svg{display:inline-block;width:auto;height:18px;vertical-align:-30%}.joinchat__powered:active,.joinchat__powered:hover{color:inherit!important;text-decoration:none!important;opacity:.9;filter:drop-shadow(0 1px 3px rgb(0 0 0 / 30%))}.joinchat__wa{height:28px;width:auto;fill:currentcolor;opacity:.8}.joinchat__close{--size:34px;position:absolute;top:calc(50% - var(--size)/2);right:24px;width:var(--size);height:var(--size);border-radius:50%;background:rgb(0 0 0/40%) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M24 2.4 21.6 0 12 9.6 2.4 0 0 2.4 9.6 12 0 21.6 2.4 24l9.6-9.6 9.6 9.6 2.4-2.4-9.6-9.6L24 2.4z'/%3E%3C/svg%3E") 50% no-repeat;background-size:12px;cursor:pointer;transition:background-color .3s ease-out}.joinchat__close:hover{background-color:rgb(0 0 0/60%)}.joinchat__close:active{background-color:rgb(0 0 0/70%)}[dir=rtl] .joinchat__close{right:auto;left:24px}.joinchat__box__scroll{padding:20px 0 70px;padding-bottom:calc(var(--s) + 10px);background:#fff linear-gradient(0deg,var(--bg),var(--bg));overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain}.joinchat__box__scroll::-webkit-scrollbar{width:5px;background:rgb(0 0 0/0)}.joinchat__box__scroll::-webkit-scrollbar-thumb{border-radius:3px;background:rgb(0 0 0/0)}.joinchat--blur .joinchat__box__scroll{background:rgba(var(--rgb)/2%);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.joinchat--dark .joinchat__box__scroll{background:#1a1a1a}.joinchat__box__scroll:hover::-webkit-scrollbar-thumb{background:rgb(0 0 0/20%)}@supports (-webkit-overflow-scrolling:touch){.joinchat__box__scroll{overflow-y:scroll;-webkit-overflow-scrolling:touch}}.joinchat__optin{padding:0 16px;margin-bottom:16px;color:#4a4a4a;font-size:13px;line-height:1.33}.joinchat__optin a{display:inline;padding:0;color:inherit!important;text-decoration:underline}.joinchat__optin a:hover{text-decoration-thickness:2px}.joinchat__optin input{position:absolute;visibility:hidden}.joinchat__optin label{position:relative;display:block;margin:0;padding:0 0 0 30px;color:inherit;font:inherit;cursor:pointer}.joinchat__optin label:before{content:"";display:block;position:absolute;top:calc(50% - 11px);left:0;width:22px;height:22px;border:3px solid var(--color);border-radius:4px;box-shadow:0 0 0 1px var(--text);transition:box-shadow .3s ease-in-out}.joinchat__optin label:after{content:"";display:none;position:absolute;top:calc(50% - 8px);left:8px;width:6px;height:14px;border:solid var(--text);border-width:0 3px 3px 0;transform:rotate(45deg)}[dir=rtl] .joinchat__optin label{padding:0 30px 0 0}[dir=rtl] .joinchat__optin label:before{left:auto;right:0}[dir=rtl] .joinchat__optin label:after{left:auto;right:8px}.joinchat__optin input:checked+label:before{box-shadow:0 0 0 1px var(--text),inset 0 0 0 10px var(--color)}.joinchat__optin input:checked+label:after{display:block}.joinchat--dark .joinchat__optin{color:#d8d8d8}.joinchat__message{position:relative;min-height:60px;padding:17px 20px;margin:0 26px 26px;border-radius:32px;background:#fff;color:#4a4a4a;word-break:break-word;filter:drop-shadow(0 1px 2px rgb(0 0 0 / 30%));transform:translateZ(0)}.joinchat__message:before{content:"";display:block;position:absolute;bottom:20px;left:-15px;width:17px;height:25px;background:inherit;-webkit-clip-path:var(--peak,url(#joinchat__message__peak));clip-path:var(--peak,url(#joinchat__message__peak))}.joinchat--dark .joinchat__message{background:#505050;color:#d8d8d8}@keyframes joinchat_show{0%{transform:scale3d(0,0,0)}to{transform:scaleX(1)}}@keyframes joinchat_badge_in{0%{opacity:0;transform:translate3d(0,50px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes joinchat_badge_out{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,-20px,0)}}@keyframes joinchat_plain{0%,50%,to{stroke-dashoffset:1097}5%,45%{stroke-dashoffset:0}}@keyframes joinchat_chat{0%,50%,to{stroke-dashoffset:1020}5%,45%{stroke-dashoffset:0}}@keyframes joinchat_image_loop{0%{opacity:0}3%,20%{opacity:1}25%,to{opacity:0}}@keyframes joinchat_tootlip{0%{opacity:0;transform:scaleY(0)}1%,20%{opacity:1;transform:scaleX(1)}25%,to{opacity:0;transform:scaleX(1)}}.joinchat__woo-btn__wrapper{clear:both}.joinchat__woo-btn{--s:40px;display:inline-block;box-sizing:border-box;height:var(--s);max-width:100%;padding:0 calc(var(--s)/2) 0 var(--s);background:#25d366 var(--joinchat-ico) calc(var(--s)*0.2) 50% no-repeat;background-size:calc(var(--s)*0.6);color:#fff;border-radius:calc(var(--s)/2);font:700 normal calc(var(--s)*0.35)/var(--s) var(--joinchat-font);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;transition:background-color .2s}.joinchat__woo-btn:empty{padding-right:0}.joinchat__woo-btn:hover{background-color:#128c7e}@media (orientation:landscape) and (min-height:481px),(orientation:portrait) and (min-width:481px){.joinchat--mobile{display:none!important}}@media (max-width:767px){.joinchat--footer-bar{--bottom:76px!important}}@media (max-width:480px),(orientation:landscape) and (max-height:480px){.joinchat{--bottom:6px;--sep:6px;--header:calc(var(--s)*0.91667)}.joinchat__header__text{font-size:17px}.joinchat__close{--size:28px}.joinchat__box__scroll{padding-top:15px}.joinchat__message{padding:18px 16px;line-height:24px;margin:0 20px 20px}}@media (hover:hover){.joinchat__button:hover .joinchat__tooltip{opacity:1;animation:none;transition:opacity .2s}.joinchat--btn .joinchat__button:hover .joinchat__qr,.joinchat--chatbox .joinchat__button:hover .joinchat__qr{display:flex}}@media (prefers-color-scheme:dark){.joinchat--dark-auto{--msg:var(--dark)}.joinchat--dark-auto .joinchat__box__scroll{background:#1a1a1a}.joinchat--dark-auto .joinchat__header{background:var(--dark)}.joinchat--dark-auto .joinchat__optin{color:#d8d8d8}.joinchat--dark-auto .joinchat__message{background:#505050;color:#d8d8d8}}@media (prefers-reduced-motion){.joinchat{animation:none}.joinchat__button__send .joinchat_svg__plain{stroke-dasharray:0;animation:none}.joinchat__button__send .joinchat_svg__chat{animation:none}.joinchat__button__sendtext{transition:none!important}}
public/js/joinchat-lite.js ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($, win, doc) {
2
+ 'use strict';
3
+
4
+ win.joinchat_obj = $.extend({
5
+ settings: null,
6
+ is_mobile: !!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i),
7
+ }, win.joinchat_obj || {});
8
+
9
+ // Trigger Analytics events
10
+ joinchat_obj.send_event = function (params) {
11
+ params = $.extend({
12
+ event_category: 'JoinChat', // Name
13
+ event_label: '', // Destination url
14
+ event_action: '', // "chanel: id"
15
+ chat_channel: 'whatsapp', // Channel name
16
+ chat_id: '--', // Channel contact (phone, username...)
17
+ is_mobile: this.is_mobile ? 'yes' : 'no',
18
+ page_location: location.href,
19
+ page_title: document.title || 'no title',
20
+ }, params);
21
+ params.event_label = params.event_label || params.link || '';
22
+ params.event_action = params.event_action || params.chat_channel + ': ' + params.chat_id;
23
+ delete params.link;
24
+
25
+ // Trigger event (params can be edited by third party scripts or cancel if return false)
26
+ if (false === $(doc).triggerHandler('joinchat:event', [params])) return;
27
+
28
+ // Can pass setting 'ga_tracker' for custom UA tracker name
29
+ // Compatible with GADP for WordPress by MonsterInsights tracker name
30
+ var ga_tracker = win[this.settings.ga_tracker] || win['ga'] || win['__gaTracker'];
31
+ // Can pass setting 'data_layer' for custom data layer name
32
+ // Compatible with GTM4WP custom DataLayer name
33
+ var data_layer = win[this.settings.data_layer] || win[win.gtm4wp_datalayer_name] || win['dataLayer'];
34
+
35
+ // Send Google Analytics custom event (Universal Analytics - analytics.js)
36
+ if (typeof ga_tracker == 'function' && typeof ga_tracker.getAll == 'function') {
37
+ ga_tracker('set', 'transport', 'beacon');
38
+ var trackers = ga_tracker.getAll();
39
+ trackers.forEach(function (tracker) {
40
+ tracker.send('event', params.event_category, params.event_action, params.event_label);
41
+ });
42
+ }
43
+
44
+ // GA4 param max_length of 100 chars (https://support.google.com/analytics/answer/9267744)
45
+ $.each(params, function (k, v) { params[k] = typeof v == 'string' ? v.substring(0, 100) : v; });
46
+
47
+ // gtag.js
48
+ if (typeof gtag == 'function' && typeof data_layer == 'object') {
49
+ // Google Analytics 4 send recomended event "generate_lead"
50
+ var ga4_params = $.extend({ transport_type: 'beacon' }, params);
51
+ // Already defined in GA4
52
+ delete ga4_params.page_location;
53
+ delete ga4_params.page_title;
54
+
55
+ data_layer.forEach(function (item) {
56
+ if (item[0] == 'config' && item[1].substring(0, 2) == 'G-') {
57
+ ga4_params.send_to = item[1];
58
+ gtag('event', 'generate_lead', ga4_params);
59
+ }
60
+ });
61
+
62
+ // Send Google Ads conversion
63
+ if (this.settings.gads) {
64
+ gtag('event', 'conversion', { send_to: this.settings.gads });
65
+ }
66
+ }
67
+
68
+ // Store category in var and delete from params
69
+ var event_category = params.event_category;
70
+ delete params.event_category;
71
+
72
+ // Send Google Tag Manager custom event
73
+ if (typeof data_layer == 'object') {
74
+ data_layer.push($.extend({ event: event_category }, params));
75
+ }
76
+
77
+ // Send Facebook Pixel custom event
78
+ if (typeof fbq == 'function') {
79
+ fbq('trackCustom', event_category, params);
80
+ }
81
+ };
82
+
83
+ // Return WhatsApp link with optional message
84
+ joinchat_obj.whatsapp_link = function (phone, message, wa_web) {
85
+ message = typeof message != 'undefined' ? message : this.settings.message_send || '';
86
+ wa_web = typeof wa_web != 'undefined' ? wa_web : this.settings.whatsapp_web && !this.is_mobile;
87
+ var link = (wa_web ? 'https://web.whatsapp.com/send?phone=' : 'https://wa.me/') + encodeURIComponent(phone || this.settings.telephone);
88
+
89
+ return link + (message ? (wa_web ? '&text=' : '?text=') + encodeURIComponent(message) : '');
90
+ };
91
+
92
+ joinchat_obj.open_whatsapp = function (phone, message) {
93
+ phone = phone || this.settings.telephone;
94
+ message = typeof message != 'undefined' ? message : this.settings.message_send || '';
95
+
96
+ var params = {
97
+ link: this.whatsapp_link(phone, message),
98
+ chat_channel: 'whatsapp',
99
+ chat_id: phone,
100
+ chat_message: message,
101
+ };
102
+ var secure_link = new RegExp("^https?:\/\/(wa\.me|(api|web|chat)\.whatsapp\.com|" + location.hostname.replace('.', '\.') + ")\/.*", 'i');
103
+
104
+ // Trigger event (params can be edited by third party scripts or cancel if return false)
105
+ if (false === $(doc).triggerHandler('joinchat:open', [params])) return;
106
+
107
+ // Ensure the link is safe
108
+ if (secure_link.test(params.link)) {
109
+ // Send analytics events
110
+ this.send_event(params);
111
+ // Open WhatsApp link
112
+ win.open(params.link, 'joinchat', 'noopener');
113
+ } else {
114
+ console.error("Join.chat: the link doesn't seem safe, it must point to the current domain or whatsapp.com");
115
+ }
116
+ };
117
+
118
+ // Triggers: launch WhatsApp on click
119
+ $(doc).on('click', '.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]', function (e) {
120
+ e.preventDefault();
121
+ joinchat_obj.open_whatsapp($(this).data('phone'), $(this).data('message'));
122
+ });
123
+
124
+ // Gutenberg buttons add QR
125
+ if (typeof kjua == 'function' && !joinchat_obj.is_mobile) {
126
+ $('.joinchat-button__qr').each(function () {
127
+ $(this).kjua({
128
+ text: joinchat_obj.whatsapp_link($(this).data('phone'), $(this).data('message'), false),
129
+ render: 'canvas',
130
+ rounded: 80,
131
+ });
132
+ });
133
+ } else {
134
+ $('.wp-block-joinchat-button figure').remove();
135
+ }
136
+
137
+ }(jQuery, window, document));
public/js/joinchat-lite.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(o,i,s){"use strict";i.joinchat_obj=o.extend({settings:null,is_mobile:!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i)},i.joinchat_obj||{}),joinchat_obj.send_event=function(n){var t,e,a;(n=o.extend({event_category:"JoinChat",event_label:"",event_action:"",chat_channel:"whatsapp",chat_id:"--",is_mobile:this.is_mobile?"yes":"no",page_location:location.href,page_title:document.title||"no title"},n)).event_label=n.event_label||n.link||"",n.event_action=n.event_action||n.chat_channel+": "+n.chat_id,delete n.link,!1!==o(s).triggerHandler("joinchat:event",[n])&&(a=i[this.settings.ga_tracker]||i.ga||i.__gaTracker,t=i[this.settings.data_layer]||i[i.gtm4wp_datalayer_name]||i.dataLayer,"function"==typeof a&&"function"==typeof a.getAll&&(a("set","transport","beacon"),a.getAll().forEach(function(t){t.send("event",n.event_category,n.event_action,n.event_label)})),o.each(n,function(t,e){n[t]="string"==typeof e?e.substring(0,100):e}),"function"==typeof gtag&&"object"==typeof t&&(delete(e=o.extend({transport_type:"beacon"},n)).page_location,delete e.page_title,t.forEach(function(t){"config"==t[0]&&"G-"==t[1].substring(0,2)&&(e.send_to=t[1],gtag("event","generate_lead",e))}),this.settings.gads&&gtag("event","conversion",{send_to:this.settings.gads})),a=n.event_category,delete n.event_category,"object"==typeof t&&t.push(o.extend({event:a},n)),"function"==typeof fbq&&fbq("trackCustom",a,n))},joinchat_obj.whatsapp_link=function(t,e,n){return e=void 0!==e?e:this.settings.message_send||"",((n=void 0!==n?n:this.settings.whatsapp_web&&!this.is_mobile)?"https://web.whatsapp.com/send?phone=":"https://wa.me/")+encodeURIComponent(t||this.settings.telephone)+(e?(n?"&text=":"?text=")+encodeURIComponent(e):"")},joinchat_obj.open_whatsapp=function(t,e){t=t||this.settings.telephone,e=void 0!==e?e:this.settings.message_send||"";t={link:this.whatsapp_link(t,e),chat_channel:"whatsapp",chat_id:t,chat_message:e},e=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");!1!==o(s).triggerHandler("joinchat:open",[t])&&(e.test(t.link)?(this.send_event(t),i.open(t.link,"joinchat","noopener")):console.error("Join.chat: the link doesn't seem safe, it must point to the current domain or whatsapp.com"))},o(s).on("click",'.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]',function(t){t.preventDefault(),joinchat_obj.open_whatsapp(o(this).data("phone"),o(this).data("message"))}),"function"!=typeof kjua||joinchat_obj.is_mobile?o(".wp-block-joinchat-button figure").remove():o(".joinchat-button__qr").each(function(){o(this).kjua({text:joinchat_obj.whatsapp_link(o(this).data("phone"),o(this).data("message"),!1),render:"canvas",rounded:80})})}(jQuery,window,document);
public/js/joinchat.js CHANGED
@@ -1,16 +1,14 @@
1
  (function ($, win, doc) {
2
  'use strict';
3
 
4
- win.joinchat_obj = win.joinchat_obj || {};
5
-
6
- joinchat_obj = $.extend({
7
  $div: null,
8
  settings: null,
9
  store: null,
10
  chatbox: false,
11
  showed_at: 0,
12
- is_mobile: false,
13
- }, joinchat_obj);
14
 
15
  joinchat_obj.$ = function (sel) {
16
  return $(sel || this.$div, this.$div);
@@ -19,10 +17,11 @@
19
  // Trigger Analytics events
20
  joinchat_obj.send_event = function (params) {
21
  params = $.extend({
22
- event_label: '', // Destination url
23
- event_action: '', // "chanel: id"
24
- chat_channel: 'WhatsApp', // Channel name
25
- chat_id: '--', // Channel contact (phone, username...)
 
26
  is_mobile: this.is_mobile ? 'yes' : 'no',
27
  page_location: location.href,
28
  page_title: document.title || 'no title',
@@ -46,7 +45,7 @@
46
  ga_tracker('set', 'transport', 'beacon');
47
  var trackers = ga_tracker.getAll();
48
  trackers.forEach(function (tracker) {
49
- tracker.send('event', 'JoinChat', params.event_action, params.event_label);
50
  });
51
  }
52
 
@@ -56,10 +55,7 @@
56
  // gtag.js
57
  if (typeof gtag == 'function' && typeof data_layer == 'object') {
58
  // Google Analytics 4 send recomended event "generate_lead"
59
- var ga4_params = $.extend({
60
- event_category: 'JoinChat',
61
- transport_type: 'beacon',
62
- }, params);
63
  // Already defined in GA4
64
  delete ga4_params.page_location;
65
  delete ga4_params.page_title;
@@ -77,14 +73,18 @@
77
  }
78
  }
79
 
 
 
 
 
80
  // Send Google Tag Manager custom event
81
  if (typeof data_layer == 'object') {
82
- data_layer.push($.extend({ event: 'JoinChat' }, params));
83
  }
84
 
85
  // Send Facebook Pixel custom event
86
  if (typeof fbq == 'function') {
87
- fbq('trackCustom', 'JoinChat', params);
88
  }
89
  };
90
 
@@ -140,7 +140,7 @@
140
 
141
  var params = {
142
  link: this.whatsapp_link(phone, message),
143
- chat_channel: 'WhatsApp',
144
  chat_id: phone,
145
  chat_message: message,
146
  };
@@ -266,12 +266,11 @@
266
  }).trigger('resize');
267
  }
268
 
269
- // Open chatbox or launch WhatsApp when click on nodes with classes "joinchat_open" "joinchat_app"
270
- // or links with href "#joinchat" or "#whatsapp"
271
  $(doc).on('click', '.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]', function (e) {
272
  e.preventDefault();
273
- if (!has_chatbox || $(this).is('.joinchat_app, a[href="#whatsapp"]')) joinchat_obj.open_whatsapp(); // WhatsApp direct
274
- else clear_and_show(); // Open chatbox
275
  });
276
 
277
  // Close chatbox when click on nodes with class "joinchat_close"
@@ -280,7 +279,7 @@
280
  joinchat_obj.chatbox_hide();
281
  });
282
 
283
- // Open Join.chat when "joinchat_show" or "joinchat_force_show" on viewport
284
  if (has_chatbox && 'IntersectionObserver' in win) {
285
  var $show_on_scroll = $('.joinchat_show, .joinchat_force_show');
286
 
@@ -334,7 +333,6 @@
334
  if (!joinchat_obj.$div.length) return;
335
 
336
  joinchat_obj.settings = joinchat_obj.$div.data('settings');
337
- joinchat_obj.is_mobile = !!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i);
338
 
339
  // Fallback if localStorage not supported (iOS incognito)
340
  // Implements functional storage in memory and will not persist between page loads
@@ -367,12 +365,26 @@
367
  } else {
368
  // Ensure don't show
369
  joinchat_obj.$div.removeClass('joinchat--show');
370
- // Launch WhatsApp when click on nodes with classes "joinchat_open" "joinchat_app" or links with href
 
371
  $(doc).on('click', '.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]', function (e) {
372
  e.preventDefault();
373
- joinchat_obj.open_whatsapp();
374
  });
375
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  }
377
 
378
  joinchat_obj.store.setItem('joinchat_views', parseInt(joinchat_obj.store.getItem('joinchat_views') || 0) + 1);
1
  (function ($, win, doc) {
2
  'use strict';
3
 
4
+ win.joinchat_obj = $.extend({
 
 
5
  $div: null,
6
  settings: null,
7
  store: null,
8
  chatbox: false,
9
  showed_at: 0,
10
+ is_mobile: !!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i),
11
+ }, win.joinchat_obj || {});
12
 
13
  joinchat_obj.$ = function (sel) {
14
  return $(sel || this.$div, this.$div);
17
  // Trigger Analytics events
18
  joinchat_obj.send_event = function (params) {
19
  params = $.extend({
20
+ event_category: 'JoinChat', // Name
21
+ event_label: '', // Destination url
22
+ event_action: '', // "chanel: id"
23
+ chat_channel: 'whatsapp', // Channel name
24
+ chat_id: '--', // Channel contact (phone, username...)
25
  is_mobile: this.is_mobile ? 'yes' : 'no',
26
  page_location: location.href,
27
  page_title: document.title || 'no title',
45
  ga_tracker('set', 'transport', 'beacon');
46
  var trackers = ga_tracker.getAll();
47
  trackers.forEach(function (tracker) {
48
+ tracker.send('event', params.event_category, params.event_action, params.event_label);
49
  });
50
  }
51
 
55
  // gtag.js
56
  if (typeof gtag == 'function' && typeof data_layer == 'object') {
57
  // Google Analytics 4 send recomended event "generate_lead"
58
+ var ga4_params = $.extend({ transport_type: 'beacon' }, params);
 
 
 
59
  // Already defined in GA4
60
  delete ga4_params.page_location;
61
  delete ga4_params.page_title;
73
  }
74
  }
75
 
76
+ // Store category in var and delete from params
77
+ var event_category = params.event_category;
78
+ delete params.event_category;
79
+
80
  // Send Google Tag Manager custom event
81
  if (typeof data_layer == 'object') {
82
+ data_layer.push($.extend({ event: event_category }, params));
83
  }
84
 
85
  // Send Facebook Pixel custom event
86
  if (typeof fbq == 'function') {
87
+ fbq('trackCustom', event_category, params);
88
  }
89
  };
90
 
140
 
141
  var params = {
142
  link: this.whatsapp_link(phone, message),
143
+ chat_channel: 'whatsapp',
144
  chat_id: phone,
145
  chat_message: message,
146
  };
266
  }).trigger('resize');
267
  }
268
 
269
+ // Triggers: open chatbox or launch WhatsApp on click
 
270
  $(doc).on('click', '.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]', function (e) {
271
  e.preventDefault();
272
+ if (has_chatbox && $(this).is('.joinchat_open, a[href="#joinchat"]')) clear_and_show(); // Open chatbox
273
+ else joinchat_obj.open_whatsapp($(this).data('phone'), $(this).data('message')); // WhatsApp direct
274
  });
275
 
276
  // Close chatbox when click on nodes with class "joinchat_close"
279
  joinchat_obj.chatbox_hide();
280
  });
281
 
282
+ // Triggers: open chatbox on scroll (when node on viewport)
283
  if (has_chatbox && 'IntersectionObserver' in win) {
284
  var $show_on_scroll = $('.joinchat_show, .joinchat_force_show');
285
 
333
  if (!joinchat_obj.$div.length) return;
334
 
335
  joinchat_obj.settings = joinchat_obj.$div.data('settings');
 
336
 
337
  // Fallback if localStorage not supported (iOS incognito)
338
  // Implements functional storage in memory and will not persist between page loads
365
  } else {
366
  // Ensure don't show
367
  joinchat_obj.$div.removeClass('joinchat--show');
368
+
369
+ // Triggers: launch WhatsApp on click
370
  $(doc).on('click', '.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]', function (e) {
371
  e.preventDefault();
372
+ joinchat_obj.open_whatsapp($(this).data('phone'), $(this).data('message'));
373
  });
374
  }
375
+
376
+ // Gutenberg buttons add QR
377
+ if (typeof kjua == 'function' && !joinchat_obj.is_mobile) {
378
+ $('.joinchat-button__qr').each(function () {
379
+ $(this).kjua({
380
+ text: joinchat_obj.whatsapp_link($(this).data('phone'), $(this).data('message'), false),
381
+ render: 'canvas',
382
+ rounded: 80,
383
+ });
384
+ });
385
+ } else {
386
+ $('.wp-block-joinchat-button figure').remove();
387
+ }
388
  }
389
 
390
  joinchat_obj.store.setItem('joinchat_views', parseInt(joinchat_obj.store.getItem('joinchat_views') || 0) + 1);
public/js/joinchat.min.js CHANGED
@@ -1 +1 @@
1
- !function(d,p,u){"use strict";function t(){d(u).trigger("joinchat:starting");var t,o,e=1e3*joinchat_obj.settings.button_delay,n=1e3*joinchat_obj.settings.message_delay,i=!!joinchat_obj.settings.message_hash,a=!!joinchat_obj.$(".joinchat__box").length,s=parseInt(joinchat_obj.store.getItem("joinchat_views")||1)>=joinchat_obj.settings.message_views,h=-1!==(joinchat_obj.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean).indexOf(joinchat_obj.settings.message_hash||"none");function c(){clearTimeout(o),joinchat_obj.chatbox_show()}function _(){joinchat_obj.save_hash(),joinchat_obj.chatbox_hide()}var j,r,l,b="joinchat--show";function g(){var t=(u.activeElement.type||"").toLowerCase();0<=["date","datetime","email","month","number","password","search","tel","text","textarea","time","url","week"].indexOf(t)?joinchat_obj.chatbox?(joinchat_obj.chatbox_hide(),setTimeout(function(){joinchat_obj.$div.removeClass("joinchat--show")},400)):joinchat_obj.$div.removeClass("joinchat--show"):joinchat_obj.$div.addClass("joinchat--show")}h||i&&n&&!joinchat_obj.settings.message_badge&&s||(b+=" joinchat--tooltip"),setTimeout(function(){joinchat_obj.$div.addClass(b)},e),i&&!h&&n&&(joinchat_obj.settings.message_badge?o=setTimeout(function(){joinchat_obj.$(".joinchat__badge").addClass("joinchat__badge--in")},e+n):s&&(o=setTimeout(c,e+n))),a&&!joinchat_obj.is_mobile&&joinchat_obj.$(".joinchat__button").on("mouseenter",function(){t=setTimeout(c,1500)}).on("mouseleave",function(){clearTimeout(t)}),joinchat_obj.$(".joinchat__button").on("click",function(){a&&!joinchat_obj.chatbox?c():Date.now()>joinchat_obj.showed_at+600&&(_(),joinchat_obj.open_whatsapp())}),joinchat_obj.$(".joinchat__close").on("click",_),joinchat_obj.$("#joinchat_optin").on("change",function(){joinchat_obj.$div.toggleClass("joinchat--optout",!this.checked)}),joinchat_obj.$(".joinchat__box__scroll").on("mousewheel DOMMouseScroll",function(t){t.preventDefault();t=t.originalEvent.wheelDelta||-t.originalEvent.detail;this.scrollTop+=30*(t<0?1:-1)}),joinchat_obj.is_mobile&&(d(u).on("focus blur","input, textarea",function(t){d(t.target).closest(joinchat_obj.$div).length||(clearTimeout(j),j=setTimeout(g,200))}),d(p).on("resize",function(){clearTimeout(r),r=setTimeout(function(){joinchat_obj.$div[0].style.setProperty("--vh",window.innerHeight+"px")},200)}).trigger("resize")),d(u).on("click",'.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]',function(t){t.preventDefault(),!a||d(this).is('.joinchat_app, a[href="#whatsapp"]')?joinchat_obj.open_whatsapp():c()}),d(u).on("click",".joinchat_close",function(t){t.preventDefault(),joinchat_obj.chatbox_hide()}),a&&"IntersectionObserver"in p&&(0<(n=d(".joinchat_show, .joinchat_force_show")).length&&(l=new IntersectionObserver(function(t){d.each(t,function(){if(0<this.intersectionRatio&&(!h||d(this.target).hasClass("joinchat_force_show")))return c(),l.disconnect(),!1})}),n.each(function(){l.observe(this)}))),joinchat_obj.settings.qr&&!joinchat_obj.is_mobile&&"function"==typeof kjua?joinchat_obj.$(".joinchat__qr").kjua({text:joinchat_obj.whatsapp_link(void 0,void 0,!1),render:"canvas",rounded:80}):joinchat_obj.$(".joinchat__qr").remove(),a&&joinchat_obj.$div.css("--peak","url(#joinchat__message__peak)"),d(u).trigger("joinchat:start")}p.joinchat_obj=p.joinchat_obj||{},joinchat_obj=d.extend({$div:null,settings:null,store:null,chatbox:!1,showed_at:0,is_mobile:!1},joinchat_obj),joinchat_obj.$=function(t){return d(t||this.$div,this.$div)},joinchat_obj.send_event=function(e){var t,o,n;(e=d.extend({event_label:"",event_action:"",chat_channel:"WhatsApp",chat_id:"--",is_mobile:this.is_mobile?"yes":"no",page_location:location.href,page_title:document.title||"no title"},e)).event_label=e.event_label||e.link||"",e.event_action=e.event_action||e.chat_channel+": "+e.chat_id,delete e.link,!1!==d(u).triggerHandler("joinchat:event",[e])&&(t=p[this.settings.ga_tracker]||p.ga||p.__gaTracker,o=p[this.settings.data_layer]||p[p.gtm4wp_datalayer_name]||p.dataLayer,"function"==typeof t&&"function"==typeof t.getAll&&(t("set","transport","beacon"),t.getAll().forEach(function(t){t.send("event","JoinChat",e.event_action,e.event_label)})),d.each(e,function(t,o){e[t]="string"==typeof o?o.substring(0,100):o}),"function"==typeof gtag&&"object"==typeof o&&(delete(n=d.extend({event_category:"JoinChat",transport_type:"beacon"},e)).page_location,delete n.page_title,o.forEach(function(t){"config"==t[0]&&"G-"==t[1].substring(0,2)&&(n.send_to=t[1],gtag("event","generate_lead",n))}),this.settings.gads&&gtag("event","conversion",{send_to:this.settings.gads})),"object"==typeof o&&o.push(d.extend({event:"JoinChat"},e)),"function"==typeof fbq&&fbq("trackCustom","JoinChat",e))},joinchat_obj.whatsapp_link=function(t,o,e){return o=void 0!==o?o:this.settings.message_send||"",((e=void 0!==e?e:this.settings.whatsapp_web&&!this.is_mobile)?"https://web.whatsapp.com/send?phone=":"https://wa.me/")+encodeURIComponent(t||this.settings.telephone)+(o?(e?"&text=":"?text=")+encodeURIComponent(o):"")},joinchat_obj.chatbox_show=function(){this.chatbox||(this.chatbox=!0,this.showed_at=Date.now(),this.$div.addClass("joinchat--chatbox"),this.settings.message_badge&&this.$(".joinchat__badge").hasClass("joinchat__badge--in")&&this.$(".joinchat__badge").toggleClass("joinchat__badge--in joinchat__badge--out"),d(u).trigger("joinchat:show"))},joinchat_obj.chatbox_hide=function(){this.chatbox&&(this.chatbox=!1,this.$div.removeClass("joinchat--chatbox joinchat--tooltip"),this.settings.message_badge&&this.$(".joinchat__badge").removeClass("joinchat__badge--out"),d(u).trigger("joinchat:hide"))},joinchat_obj.save_hash=function(){var t=this.settings.message_hash||"none",o=(this.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean);-1===o.indexOf(t)&&(o.push(t),this.store.setItem("joinchat_hashes",o.join(",")))},joinchat_obj.open_whatsapp=function(t,o){t=t||this.settings.telephone,o=void 0!==o?o:this.settings.message_send||"";t={link:this.whatsapp_link(t,o),chat_channel:"WhatsApp",chat_id:t,chat_message:o},o=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");!1!==d(u).triggerHandler("joinchat:open",[t])&&(o.test(t.link)?(this.send_event(t),p.open(t.link,"joinchat","noopener")):console.error("Join.chat: the link doesn't seem safe, it must point to the current domain or whatsapp.com"))};var o,e=(o=function(){if(joinchat_obj.$div=d(".joinchat"),joinchat_obj.$div.length){joinchat_obj.settings=joinchat_obj.$div.data("settings"),joinchat_obj.is_mobile=!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i);try{localStorage.setItem("test",1),localStorage.removeItem("test"),joinchat_obj.store=localStorage}catch(t){joinchat_obj.store={_data:{},setItem:function(t,o){this._data[t]=String(o)},getItem:function(t){return this._data.hasOwnProperty(t)?this._data[t]:null}}}if("object"!=typeof joinchat_obj.settings)try{joinchat_obj.settings=JSON.parse(joinchat_obj.$div.attr("data-settings"))}catch(t){joinchat_obj.settings=void 0,console.error("Join.chat: can't get settings")}joinchat_obj.settings&&joinchat_obj.settings.telephone&&(joinchat_obj.is_mobile||!joinchat_obj.settings.mobile_only?t():(joinchat_obj.$div.removeClass("joinchat--show"),d(u).on("click",'.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]',function(t){t.preventDefault(),joinchat_obj.open_whatsapp()}))),joinchat_obj.store.setItem("joinchat_views",parseInt(joinchat_obj.store.getItem("joinchat_views")||0)+1)}},function(){o&&o.apply(this,arguments),o=null});d(e),d(p).on("load",e),u.addEventListener("DOMContentLoaded",e)}(jQuery,window,document);
1
+ !function(d,p,u){"use strict";function t(){d(u).trigger("joinchat:starting");var t,e,o=1e3*joinchat_obj.settings.button_delay,n=1e3*joinchat_obj.settings.message_delay,a=!!joinchat_obj.settings.message_hash,i=!!joinchat_obj.$(".joinchat__box").length,s=parseInt(joinchat_obj.store.getItem("joinchat_views")||1)>=joinchat_obj.settings.message_views,h=-1!==(joinchat_obj.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean).indexOf(joinchat_obj.settings.message_hash||"none");function c(){clearTimeout(e),joinchat_obj.chatbox_show()}function _(){joinchat_obj.save_hash(),joinchat_obj.chatbox_hide()}var j,r,l,b="joinchat--show";function g(){var t=(u.activeElement.type||"").toLowerCase();0<=["date","datetime","email","month","number","password","search","tel","text","textarea","time","url","week"].indexOf(t)?joinchat_obj.chatbox?(joinchat_obj.chatbox_hide(),setTimeout(function(){joinchat_obj.$div.removeClass("joinchat--show")},400)):joinchat_obj.$div.removeClass("joinchat--show"):joinchat_obj.$div.addClass("joinchat--show")}h||a&&n&&!joinchat_obj.settings.message_badge&&s||(b+=" joinchat--tooltip"),setTimeout(function(){joinchat_obj.$div.addClass(b)},o),a&&!h&&n&&(joinchat_obj.settings.message_badge?e=setTimeout(function(){joinchat_obj.$(".joinchat__badge").addClass("joinchat__badge--in")},o+n):s&&(e=setTimeout(c,o+n))),i&&!joinchat_obj.is_mobile&&joinchat_obj.$(".joinchat__button").on("mouseenter",function(){t=setTimeout(c,1500)}).on("mouseleave",function(){clearTimeout(t)}),joinchat_obj.$(".joinchat__button").on("click",function(){i&&!joinchat_obj.chatbox?c():Date.now()>joinchat_obj.showed_at+600&&(_(),joinchat_obj.open_whatsapp())}),joinchat_obj.$(".joinchat__close").on("click",_),joinchat_obj.$("#joinchat_optin").on("change",function(){joinchat_obj.$div.toggleClass("joinchat--optout",!this.checked)}),joinchat_obj.$(".joinchat__box__scroll").on("mousewheel DOMMouseScroll",function(t){t.preventDefault();t=t.originalEvent.wheelDelta||-t.originalEvent.detail;this.scrollTop+=30*(t<0?1:-1)}),joinchat_obj.is_mobile&&(d(u).on("focus blur","input, textarea",function(t){d(t.target).closest(joinchat_obj.$div).length||(clearTimeout(j),j=setTimeout(g,200))}),d(p).on("resize",function(){clearTimeout(r),r=setTimeout(function(){joinchat_obj.$div[0].style.setProperty("--vh",window.innerHeight+"px")},200)}).trigger("resize")),d(u).on("click",'.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]',function(t){t.preventDefault(),i&&d(this).is('.joinchat_open, a[href="#joinchat"]')?c():joinchat_obj.open_whatsapp(d(this).data("phone"),d(this).data("message"))}),d(u).on("click",".joinchat_close",function(t){t.preventDefault(),joinchat_obj.chatbox_hide()}),i&&"IntersectionObserver"in p&&(0<(n=d(".joinchat_show, .joinchat_force_show")).length&&(l=new IntersectionObserver(function(t){d.each(t,function(){if(0<this.intersectionRatio&&(!h||d(this.target).hasClass("joinchat_force_show")))return c(),l.disconnect(),!1})}),n.each(function(){l.observe(this)}))),joinchat_obj.settings.qr&&!joinchat_obj.is_mobile&&"function"==typeof kjua?joinchat_obj.$(".joinchat__qr").kjua({text:joinchat_obj.whatsapp_link(void 0,void 0,!1),render:"canvas",rounded:80}):joinchat_obj.$(".joinchat__qr").remove(),i&&joinchat_obj.$div.css("--peak","url(#joinchat__message__peak)"),d(u).trigger("joinchat:start")}p.joinchat_obj=d.extend({$div:null,settings:null,store:null,chatbox:!1,showed_at:0,is_mobile:!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i)},p.joinchat_obj||{}),joinchat_obj.$=function(t){return d(t||this.$div,this.$div)},joinchat_obj.send_event=function(o){var t,e,n;(o=d.extend({event_category:"JoinChat",event_label:"",event_action:"",chat_channel:"whatsapp",chat_id:"--",is_mobile:this.is_mobile?"yes":"no",page_location:location.href,page_title:document.title||"no title"},o)).event_label=o.event_label||o.link||"",o.event_action=o.event_action||o.chat_channel+": "+o.chat_id,delete o.link,!1!==d(u).triggerHandler("joinchat:event",[o])&&(n=p[this.settings.ga_tracker]||p.ga||p.__gaTracker,t=p[this.settings.data_layer]||p[p.gtm4wp_datalayer_name]||p.dataLayer,"function"==typeof n&&"function"==typeof n.getAll&&(n("set","transport","beacon"),n.getAll().forEach(function(t){t.send("event",o.event_category,o.event_action,o.event_label)})),d.each(o,function(t,e){o[t]="string"==typeof e?e.substring(0,100):e}),"function"==typeof gtag&&"object"==typeof t&&(delete(e=d.extend({transport_type:"beacon"},o)).page_location,delete e.page_title,t.forEach(function(t){"config"==t[0]&&"G-"==t[1].substring(0,2)&&(e.send_to=t[1],gtag("event","generate_lead",e))}),this.settings.gads&&gtag("event","conversion",{send_to:this.settings.gads})),n=o.event_category,delete o.event_category,"object"==typeof t&&t.push(d.extend({event:n},o)),"function"==typeof fbq&&fbq("trackCustom",n,o))},joinchat_obj.whatsapp_link=function(t,e,o){return e=void 0!==e?e:this.settings.message_send||"",((o=void 0!==o?o:this.settings.whatsapp_web&&!this.is_mobile)?"https://web.whatsapp.com/send?phone=":"https://wa.me/")+encodeURIComponent(t||this.settings.telephone)+(e?(o?"&text=":"?text=")+encodeURIComponent(e):"")},joinchat_obj.chatbox_show=function(){this.chatbox||(this.chatbox=!0,this.showed_at=Date.now(),this.$div.addClass("joinchat--chatbox"),this.settings.message_badge&&this.$(".joinchat__badge").hasClass("joinchat__badge--in")&&this.$(".joinchat__badge").toggleClass("joinchat__badge--in joinchat__badge--out"),d(u).trigger("joinchat:show"))},joinchat_obj.chatbox_hide=function(){this.chatbox&&(this.chatbox=!1,this.$div.removeClass("joinchat--chatbox joinchat--tooltip"),this.settings.message_badge&&this.$(".joinchat__badge").removeClass("joinchat__badge--out"),d(u).trigger("joinchat:hide"))},joinchat_obj.save_hash=function(){var t=this.settings.message_hash||"none",e=(this.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean);-1===e.indexOf(t)&&(e.push(t),this.store.setItem("joinchat_hashes",e.join(",")))},joinchat_obj.open_whatsapp=function(t,e){t=t||this.settings.telephone,e=void 0!==e?e:this.settings.message_send||"";t={link:this.whatsapp_link(t,e),chat_channel:"whatsapp",chat_id:t,chat_message:e},e=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");!1!==d(u).triggerHandler("joinchat:open",[t])&&(e.test(t.link)?(this.send_event(t),p.open(t.link,"joinchat","noopener")):console.error("Join.chat: the link doesn't seem safe, it must point to the current domain or whatsapp.com"))};var e,o=(e=function(){if(joinchat_obj.$div=d(".joinchat"),joinchat_obj.$div.length){joinchat_obj.settings=joinchat_obj.$div.data("settings");try{localStorage.setItem("test",1),localStorage.removeItem("test"),joinchat_obj.store=localStorage}catch(t){joinchat_obj.store={_data:{},setItem:function(t,e){this._data[t]=String(e)},getItem:function(t){return this._data.hasOwnProperty(t)?this._data[t]:null}}}if("object"!=typeof joinchat_obj.settings)try{joinchat_obj.settings=JSON.parse(joinchat_obj.$div.attr("data-settings"))}catch(t){joinchat_obj.settings=void 0,console.error("Join.chat: can't get settings")}joinchat_obj.settings&&joinchat_obj.settings.telephone&&(joinchat_obj.is_mobile||!joinchat_obj.settings.mobile_only?t():(joinchat_obj.$div.removeClass("joinchat--show"),d(u).on("click",'.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]',function(t){t.preventDefault(),joinchat_obj.open_whatsapp(d(this).data("phone"),d(this).data("message"))})),"function"!=typeof kjua||joinchat_obj.is_mobile?d(".wp-block-joinchat-button figure").remove():d(".joinchat-button__qr").each(function(){d(this).kjua({text:joinchat_obj.whatsapp_link(d(this).data("phone"),d(this).data("message"),!1),render:"canvas",rounded:80})})),joinchat_obj.store.setItem("joinchat_views",parseInt(joinchat_obj.store.getItem("joinchat_views")||0)+1)}},function(){e&&e.apply(this,arguments),e=null});d(o),d(p).on("load",o),u.addEventListener("DOMContentLoaded",o)}(jQuery,window,document);
public/partials/html.php CHANGED
@@ -19,35 +19,35 @@ defined( 'WPINC' ) || exit;
19
  <div class="joinchat__button__image"><?php echo $image; ?></div>
20
  <?php endif; ?>
21
  <?php if ( $box_content ) : ?>
22
- <?php if ( $this->settings['message_start'] ) : ?>
23
- <div class="joinchat__button__sendtext"><?php echo esc_html( $this->settings['message_start'] ); ?></div>
24
  <?php endif; ?>
25
  <svg class="joinchat__button__send" width="60" height="60" viewbox="0 0 400 400" stroke-linecap="round" stroke-width="33">
26
  <path class="joinchat_svg__plain" d="M168.83 200.504H79.218L33.04 44.284a1 1 0 0 1 1.386-1.188L365.083 199.04a1 1 0 0 1 .003 1.808L34.432 357.903a1 1 0 0 1-1.388-1.187l29.42-99.427"/>
27
  <path class="joinchat_svg__chat" d="M318.087 318.087c-52.982 52.982-132.708 62.922-195.725 29.82l-80.449 10.18 10.358-80.112C18.956 214.905 28.836 134.99 81.913 81.913c65.218-65.217 170.956-65.217 236.174 0 42.661 42.661 57.416 102.661 44.265 157.316"/>
28
  </svg>
29
- <?php if ( $this->settings['message_badge'] ) : ?>
30
  <div class="joinchat__badge">1</div>
31
  <?php endif; ?>
32
  <?php endif; ?>
33
- <?php if ( $this->settings['button_tip'] ) : ?>
34
- <div class="joinchat__tooltip"><div><?php echo esc_html( $this->settings['button_tip'] ); ?></div></div>
35
  <?php endif; ?>
36
- <?php if ( $this->settings['qr'] ) : ?>
37
- <div class="joinchat__qr"><div><?php _e( 'or scan the code', 'creame-whatsapp-me' ); ?></div></div>
38
  <?php endif; ?>
39
  </div>
40
  <?php if ( $box_content ) : ?>
41
  <div class="joinchat__box">
42
  <div class="joinchat__header">
43
- <?php if ( '__jc__' === $this->settings['header'] ) : ?>
44
  <a class="joinchat__powered" href="<?php echo esc_url( $powered_link ); ?>" rel="nofollow noopener" target="_blank">
45
  <?php _e( 'Powered by', 'creame-whatsapp-me' ); ?> <svg width="81" height="18" viewbox="0 0 1424 318"><title>Join.chat</title><path d="m171 7 6 2 3 3v5l-1 8a947 947 0 0 0-2 56v53l1 24v31c0 22-6 43-18 63-11 19-27 35-48 48s-44 18-69 18c-14 0-24-3-32-8-7-6-11-13-11-23a26 26 0 0 1 26-27c7 0 13 2 19 6l12 12 1 1a97 97 0 0 0 10 13c4 4 7 6 10 6 4 0 7-2 10-6l6-23v-1c2-12 3-28 3-48V76l-1-3-3-1h-1l-11-2c-2-1-3-3-3-7s1-6 3-7a434 434 0 0 0 90-49zm1205 43c4 0 6 1 6 3l3 36a1888 1888 0 0 0 34 0h1l3 2 1 8-1 8-3 1h-35v62c0 14 2 23 5 28 3 6 9 8 16 8l5-1 3-1c2 0 3 1 5 3s3 4 2 6c-4 10-11 19-22 27-10 8-22 12-36 12-16 0-28-5-37-15l-8-13v1h-1c-17 17-33 26-47 26-18 0-31-13-39-39-5 12-12 22-21 29s-19 10-31 10c-11 0-21-4-29-13-7-8-11-18-11-30 0-10 2-17 5-23s9-11 17-15c13-7 35-14 67-21h1v-11c0-11-2-19-5-26-4-6-8-9-14-9-3 0-5 1-5 4v1l-2 15c-2 11-6 19-11 24-6 6-14 8-23 8-5 0-9-1-13-4-3-3-5-8-5-13 0-11 9-22 26-33s38-17 60-17c41 0 62 15 62 46v58l1 11 2 8 2 3h4l5-3 1-1-1-13v-88l-3-2-12-1c-1 0-2-3-2-7s1-6 2-6c16-4 29-9 40-15 10-6 20-15 31-25 1-2 4-3 7-3zM290 88c28 0 50 7 67 22 17 14 25 34 25 58 0 26-9 46-27 61s-42 22-71 22c-28 0-50-7-67-22a73 73 0 0 1-25-58c0-26 9-46 27-61s42-22 71-22zm588 0c19 0 34 4 45 12 11 9 17 18 17 29 0 6-3 11-7 15s-10 6-17 6c-13 0-24-8-33-25-5-11-10-18-13-21s-6-5-9-5c-8 0-11 6-11 17a128 128 0 0 0 32 81c8 8 16 12 25 12 8 0 16-3 24-10 1-1 3 0 6 2 2 2 3 3 3 5-5 12-15 23-29 32s-30 13-48 13c-24 0-43-7-58-22a78 78 0 0 1-22-58c0-25 9-45 27-60s41-23 68-23zm-402-3 5 2 3 3-1 10a785 785 0 0 0-2 53v76c1 3 2 4 4 4l11 3 11-3c3 0 4-1 4-4v-82l-1-2-3-2-11-1-2-6c0-4 1-6 2-6a364 364 0 0 0 77-44l5 2 3 3v12a393 393 0 0 0-1 21c5-10 12-18 22-25 9-8 21-11 34-11 16 0 29 5 38 14 10 9 14 22 14 39v88c0 3 2 4 4 4l11 3c1 0 2 2 2 6 0 5-1 7-2 7h-1a932 932 0 0 1-49-2 462 462 0 0 0-48 2c-2 0-3-2-3-7 0-3 1-6 3-6l8-3 3-1 1-3v-62c0-14-2-24-6-29-4-6-12-9-22-9l-7 1v99l1 3 3 1 8 3h1l2 6c0 5-1 7-3 7a783 783 0 0 1-47-2 512 512 0 0 0-51 2h-1a895 895 0 0 1-49-2 500 500 0 0 0-50 2c-1 0-2-2-2-7 0-4 1-6 2-6l11-3c2 0 3-1 4-4v-82l-1-3-3-1-11-2c-1 0-2-2-2-6l2-6a380 380 0 0 0 80-44zm539-75 5 2 3 3-1 9a758 758 0 0 0-2 55v42h1c5-9 12-16 21-22 9-7 20-10 32-10 16 0 29 5 38 14 10 9 14 22 14 39v88c0 2 2 3 4 4l11 2c1 0 2 2 2 7 0 4-1 6-2 6h-1a937 937 0 0 1-49-2 466 466 0 0 0-48 2c-2 0-3-2-3-6s1-7 3-7l8-2 3-2 1-3v-61c0-14-2-24-6-29-4-6-12-9-22-9l-7 1v99l1 2 3 2 8 2h1c1 1 2 3 2 7s-1 6-3 6a788 788 0 0 1-47-2 517 517 0 0 0-51 2c-1 0-2-2-2-6 0-5 1-7 2-7l11-2c3-1 4-2 4-5V71l-1-3-3-1-11-2c-1 0-2-2-2-6l2-6a387 387 0 0 0 81-43zm-743 90c-8 0-12 7-12 20a266 266 0 0 0 33 116c3 3 6 4 9 4 8 0 12-6 12-20 0-17-4-38-11-65-8-27-15-44-22-50-3-4-6-5-9-5zm939 65c-6 0-9 4-9 13 0 8 2 16 7 22 5 7 10 10 15 10l6-2v-22c0-6-2-11-7-15-4-4-8-6-12-6zM451 0c10 0 18 3 25 10s10 16 10 26a35 35 0 0 1-35 36c-11 0-19-4-26-10-7-7-10-16-10-26s3-19 10-26 15-10 26-10zm297 249c9 0 16-3 22-8 6-6 9-12 9-20s-3-15-9-21-13-8-22-8-16 3-22 8-9 12-9 21 3 14 9 20 13 8 22 8z"/></svg>
46
  </a>
47
- <?php elseif ( '__wa__' === $this->settings['header'] ) : ?>
48
  <svg class="joinchat__wa" width="120" height="28" viewBox="0 0 120 28"><title>WhatsApp</title><path d="M117.2 17c0 .4-.2.7-.4 1-.1.3-.4.5-.7.7l-1 .2c-.5 0-.9 0-1.2-.2l-.7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4 1 .4 1.8v5.5h2.7v-6c0-.6 0-1.2-.2-1.6 0-.5-.3-1-.5-1.3zm-14 4.7l-2.3-9.2h-2.8l-2.3 9-2.2-9h-3l3.6 13.4h3l2.2-9.2 2.3 9.2h3l3.6-13.4h-3l-2.1 9.2zm-24.5.2L18 15.6c-.3-.1-.6-.2-.8.2A20 20 0 0 1 16 17c-.2.2-.4.3-.7.1-.4-.2-1.5-.5-2.8-1.7-1-1-1.7-2-2-2.4-.1-.4 0-.5.2-.7l.5-.6.4-.6v-.6L10.4 8c-.3-.6-.6-.5-.8-.6H9c-.2 0-.6.1-.9.5C7.8 8.2 7 9 7 10.7c0 1.7 1.3 3.4 1.4 3.6.2.3 2.5 3.7 6 5.2l1.9.8c.8.2 1.6.2 2.2.1.6-.1 2-.8 2.3-1.6.3-.9.3-1.5.2-1.7l-.7-.4zM14 25.3c-2 0-4-.5-5.8-1.6l-.4-.2-4.4 1.1 1.2-4.2-.3-.5A11.5 11.5 0 0 1 22.1 5.7 11.5 11.5 0 0 1 14 25.3zM14 0A13.8 13.8 0 0 0 2 20.7L0 28l7.3-2A13.8 13.8 0 1 0 14 0z"/></svg>
49
- <?php elseif ( '' !== $this->settings['header'] ) : ?>
50
- <span class="joinchat__header__text"><?php echo esc_html( $this->settings['header'] ); ?></span>
51
  <?php endif; ?>
52
  <div class="joinchat__close" aria-label="<?php _e( 'Close', 'creame-whatsapp-me' ); ?>"></div>
53
  </div>
19
  <div class="joinchat__button__image"><?php echo $image; ?></div>
20
  <?php endif; ?>
21
  <?php if ( $box_content ) : ?>
22
+ <?php if ( $settings['message_start'] ) : ?>
23
+ <div class="joinchat__button__sendtext"><?php echo esc_html( $settings['message_start'] ); ?></div>
24
  <?php endif; ?>
25
  <svg class="joinchat__button__send" width="60" height="60" viewbox="0 0 400 400" stroke-linecap="round" stroke-width="33">
26
  <path class="joinchat_svg__plain" d="M168.83 200.504H79.218L33.04 44.284a1 1 0 0 1 1.386-1.188L365.083 199.04a1 1 0 0 1 .003 1.808L34.432 357.903a1 1 0 0 1-1.388-1.187l29.42-99.427"/>
27
  <path class="joinchat_svg__chat" d="M318.087 318.087c-52.982 52.982-132.708 62.922-195.725 29.82l-80.449 10.18 10.358-80.112C18.956 214.905 28.836 134.99 81.913 81.913c65.218-65.217 170.956-65.217 236.174 0 42.661 42.661 57.416 102.661 44.265 157.316"/>
28
  </svg>
29
+ <?php if ( $settings['message_badge'] ) : ?>
30
  <div class="joinchat__badge">1</div>
31
  <?php endif; ?>
32
  <?php endif; ?>
33
+ <?php if ( $settings['button_tip'] ) : ?>
34
+ <div class="joinchat__tooltip"><div><?php echo esc_html( $settings['button_tip'] ); ?></div></div>
35
  <?php endif; ?>
36
+ <?php if ( $settings['qr'] ) : ?>
37
+ <div class="joinchat__qr"><div><?php _e( 'Scan the code', 'creame-whatsapp-me' ); ?></div></div>
38
  <?php endif; ?>
39
  </div>
40
  <?php if ( $box_content ) : ?>
41
  <div class="joinchat__box">
42
  <div class="joinchat__header">
43
+ <?php if ( '__jc__' === $settings['header'] ) : ?>
44
  <a class="joinchat__powered" href="<?php echo esc_url( $powered_link ); ?>" rel="nofollow noopener" target="_blank">
45
  <?php _e( 'Powered by', 'creame-whatsapp-me' ); ?> <svg width="81" height="18" viewbox="0 0 1424 318"><title>Join.chat</title><path d="m171 7 6 2 3 3v5l-1 8a947 947 0 0 0-2 56v53l1 24v31c0 22-6 43-18 63-11 19-27 35-48 48s-44 18-69 18c-14 0-24-3-32-8-7-6-11-13-11-23a26 26 0 0 1 26-27c7 0 13 2 19 6l12 12 1 1a97 97 0 0 0 10 13c4 4 7 6 10 6 4 0 7-2 10-6l6-23v-1c2-12 3-28 3-48V76l-1-3-3-1h-1l-11-2c-2-1-3-3-3-7s1-6 3-7a434 434 0 0 0 90-49zm1205 43c4 0 6 1 6 3l3 36a1888 1888 0 0 0 34 0h1l3 2 1 8-1 8-3 1h-35v62c0 14 2 23 5 28 3 6 9 8 16 8l5-1 3-1c2 0 3 1 5 3s3 4 2 6c-4 10-11 19-22 27-10 8-22 12-36 12-16 0-28-5-37-15l-8-13v1h-1c-17 17-33 26-47 26-18 0-31-13-39-39-5 12-12 22-21 29s-19 10-31 10c-11 0-21-4-29-13-7-8-11-18-11-30 0-10 2-17 5-23s9-11 17-15c13-7 35-14 67-21h1v-11c0-11-2-19-5-26-4-6-8-9-14-9-3 0-5 1-5 4v1l-2 15c-2 11-6 19-11 24-6 6-14 8-23 8-5 0-9-1-13-4-3-3-5-8-5-13 0-11 9-22 26-33s38-17 60-17c41 0 62 15 62 46v58l1 11 2 8 2 3h4l5-3 1-1-1-13v-88l-3-2-12-1c-1 0-2-3-2-7s1-6 2-6c16-4 29-9 40-15 10-6 20-15 31-25 1-2 4-3 7-3zM290 88c28 0 50 7 67 22 17 14 25 34 25 58 0 26-9 46-27 61s-42 22-71 22c-28 0-50-7-67-22a73 73 0 0 1-25-58c0-26 9-46 27-61s42-22 71-22zm588 0c19 0 34 4 45 12 11 9 17 18 17 29 0 6-3 11-7 15s-10 6-17 6c-13 0-24-8-33-25-5-11-10-18-13-21s-6-5-9-5c-8 0-11 6-11 17a128 128 0 0 0 32 81c8 8 16 12 25 12 8 0 16-3 24-10 1-1 3 0 6 2 2 2 3 3 3 5-5 12-15 23-29 32s-30 13-48 13c-24 0-43-7-58-22a78 78 0 0 1-22-58c0-25 9-45 27-60s41-23 68-23zm-402-3 5 2 3 3-1 10a785 785 0 0 0-2 53v76c1 3 2 4 4 4l11 3 11-3c3 0 4-1 4-4v-82l-1-2-3-2-11-1-2-6c0-4 1-6 2-6a364 364 0 0 0 77-44l5 2 3 3v12a393 393 0 0 0-1 21c5-10 12-18 22-25 9-8 21-11 34-11 16 0 29 5 38 14 10 9 14 22 14 39v88c0 3 2 4 4 4l11 3c1 0 2 2 2 6 0 5-1 7-2 7h-1a932 932 0 0 1-49-2 462 462 0 0 0-48 2c-2 0-3-2-3-7 0-3 1-6 3-6l8-3 3-1 1-3v-62c0-14-2-24-6-29-4-6-12-9-22-9l-7 1v99l1 3 3 1 8 3h1l2 6c0 5-1 7-3 7a783 783 0 0 1-47-2 512 512 0 0 0-51 2h-1a895 895 0 0 1-49-2 500 500 0 0 0-50 2c-1 0-2-2-2-7 0-4 1-6 2-6l11-3c2 0 3-1 4-4v-82l-1-3-3-1-11-2c-1 0-2-2-2-6l2-6a380 380 0 0 0 80-44zm539-75 5 2 3 3-1 9a758 758 0 0 0-2 55v42h1c5-9 12-16 21-22 9-7 20-10 32-10 16 0 29 5 38 14 10 9 14 22 14 39v88c0 2 2 3 4 4l11 2c1 0 2 2 2 7 0 4-1 6-2 6h-1a937 937 0 0 1-49-2 466 466 0 0 0-48 2c-2 0-3-2-3-6s1-7 3-7l8-2 3-2 1-3v-61c0-14-2-24-6-29-4-6-12-9-22-9l-7 1v99l1 2 3 2 8 2h1c1 1 2 3 2 7s-1 6-3 6a788 788 0 0 1-47-2 517 517 0 0 0-51 2c-1 0-2-2-2-6 0-5 1-7 2-7l11-2c3-1 4-2 4-5V71l-1-3-3-1-11-2c-1 0-2-2-2-6l2-6a387 387 0 0 0 81-43zm-743 90c-8 0-12 7-12 20a266 266 0 0 0 33 116c3 3 6 4 9 4 8 0 12-6 12-20 0-17-4-38-11-65-8-27-15-44-22-50-3-4-6-5-9-5zm939 65c-6 0-9 4-9 13 0 8 2 16 7 22 5 7 10 10 15 10l6-2v-22c0-6-2-11-7-15-4-4-8-6-12-6zM451 0c10 0 18 3 25 10s10 16 10 26a35 35 0 0 1-35 36c-11 0-19-4-26-10-7-7-10-16-10-26s3-19 10-26 15-10 26-10zm297 249c9 0 16-3 22-8 6-6 9-12 9-20s-3-15-9-21-13-8-22-8-16 3-22 8-9 12-9 21 3 14 9 20 13 8 22 8z"/></svg>
46
  </a>
47
+ <?php elseif ( '__wa__' === $settings['header'] ) : ?>
48
  <svg class="joinchat__wa" width="120" height="28" viewBox="0 0 120 28"><title>WhatsApp</title><path d="M117.2 17c0 .4-.2.7-.4 1-.1.3-.4.5-.7.7l-1 .2c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6.6 0 1 .2 1.3.6.3.4.4 1 .4 1.8v5.5h2.7v-6c0-.6 0-1.2-.2-1.6 0-.5-.3-1-.5-1.3zm-14 4.7l-2.3-9.2h-2.8l-2.3 9-2.2-9h-3l3.6 13.4h3l2.2-9.2 2.3 9.2h3l3.6-13.4h-3l-2.1 9.2zm-24.5.2L18 15.6c-.3-.1-.6-.2-.8.2A20 20 0 0 1 16 17c-.2.2-.4.3-.7.1-.4-.2-1.5-.5-2.8-1.7-1-1-1.7-2-2-2.4-.1-.4 0-.5.2-.7l.5-.6.4-.6v-.6L10.4 8c-.3-.6-.6-.5-.8-.6H9c-.2 0-.6.1-.9.5C7.8 8.2 7 9 7 10.7c0 1.7 1.3 3.4 1.4 3.6.2.3 2.5 3.7 6 5.2l1.9.8c.8.2 1.6.2 2.2.1.6-.1 2-.8 2.3-1.6.3-.9.3-1.5.2-1.7l-.7-.4zM14 25.3c-2 0-4-.5-5.8-1.6l-.4-.2-4.4 1.1 1.2-4.2-.3-.5A11.5 11.5 0 0 1 22.1 5.7 11.5 11.5 0 0 1 14 25.3zM14 0A13.8 13.8 0 0 0 2 20.7L0 28l7.3-2A13.8 13.8 0 1 0 14 0z"/></svg>
49
+ <?php elseif ( '' !== $settings['header'] ) : ?>
50
+ <span class="joinchat__header__text"><?php echo esc_html( $settings['header'] ); ?></span>
51
  <?php endif; ?>
52
  <div class="joinchat__close" aria-label="<?php _e( 'Close', 'creame-whatsapp-me' ); ?>"></div>
53
  </div>
public/partials/script.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Join.chat public fallback script template
5
- *
6
- * @since 4.1.5
7
- * @package JoinChat
8
- * @subpackage JoinChat/public
9
- * @author Creame <hola@crea.me>
10
- */
11
-
12
- defined( 'WPINC' ) || exit;
13
- ?>
14
-
15
- <script>
16
- jQuery(function($){
17
- var arg = <?php echo JoinChatUtil::to_json( $args ); ?>;
18
- var via = arg.web && !navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i) ? 'web' : 'api';
19
- $(document).on('click', '.joinchat_open,.joinchat_app,a[href="#whatsapp"],a[href="#joinchat"]', function(e){ e.preventDefault();
20
- window.open('https://' + via + '.whatsapp.com/send?phone=' + encodeURIComponent(arg.tel) + '&text=' + encodeURIComponent(arg.msg), null, 'noopener');
21
- });
22
- });
23
- </script>