Event Tickets - Version 4.11.1

Version Description

Download this release

Release Info

Developer ModernTribe
Plugin Icon 128x128 Event Tickets
Version 4.11.1
Comparing to
See all releases

Code changes from version 4.11.0.1 to 4.11.1

Files changed (95) hide show
  1. common/lang/tribe-common.pot +5 -3
  2. common/src/Tribe/Cache.php +80 -1
  3. common/src/Tribe/Context.php +46 -4
  4. common/src/Tribe/Date_Utils.php +134 -18
  5. common/src/Tribe/Debug_Bar/Panels/Context.php +2 -2
  6. common/src/Tribe/Editor.php +5 -4
  7. common/src/Tribe/Feature_Detection.php +106 -0
  8. common/src/Tribe/Main.php +1 -1
  9. common/src/Tribe/Models/Post_Types/Base.php +17 -12
  10. common/src/Tribe/Repository.php +87 -2
  11. common/src/Tribe/Repository/Core_Read_Interface.php +402 -0
  12. common/src/Tribe/Repository/Filter_Validation.php +61 -0
  13. common/src/Tribe/Repository/Interface.php +0 -7
  14. common/src/Tribe/Repository/Read_Interface.php +4 -378
  15. common/src/Tribe/Repository/Usage_Error.php +41 -0
  16. common/src/Tribe/Rewrite.php +1 -1
  17. common/src/Tribe/Template.php +36 -0
  18. common/src/Tribe/Timezones.php +11 -2
  19. common/src/Tribe/Tooltip/View.php +1 -1
  20. common/src/Tribe/Utils/Collection_Trait.php +23 -0
  21. common/src/Tribe/Utils/Lazy_Events.php +5 -1
  22. common/src/resources/css/common-full.css +2 -1
  23. common/src/resources/css/common-full.min.css +1 -1
  24. common/src/resources/css/common-skeleton.css +35 -0
  25. common/src/resources/css/common-skeleton.min.css +1 -1
  26. common/src/resources/postcss/base/full/typography/_anchors.pcss +1 -0
  27. common/src/resources/postcss/base/skeleton/grid/_rows.pcss +38 -0
  28. common/vendor/autoload.php +1 -1
  29. common/vendor/autoload_52.php +1 -1
  30. common/vendor/composer/autoload_classmap.php +2 -0
  31. common/vendor/composer/autoload_real.php +4 -4
  32. common/vendor/composer/autoload_real_52.php +3 -3
  33. common/vendor/composer/autoload_static.php +7 -5
  34. event-tickets.php +1 -1
  35. lang/event-tickets-ro_RO.mo +0 -0
  36. readme.txt +21 -1
  37. src/Tribe/Abstract_Attendance_Totals.php +11 -2
  38. src/Tribe/Assets.php +17 -7
  39. src/Tribe/Attendee_Repository.php +35 -15
  40. src/Tribe/Commerce/PayPal/Main.php +16 -6
  41. src/Tribe/Commerce/PayPal/Orders/Report.php +7 -4
  42. src/Tribe/Commerce/PayPal/Orders/Sales.php +13 -8
  43. src/Tribe/Commerce/PayPal/Orders/Table.php +3 -1
  44. src/Tribe/Commerce/PayPal/Stati.php +11 -3
  45. src/Tribe/Commerce/PayPal/Tickets_View.php +4 -2
  46. src/Tribe/Data_API.php +4 -1
  47. src/Tribe/Editor/Blocks/Attendees.php +1 -1
  48. src/Tribe/Editor/Blocks/Rsvp.php +3 -3
  49. src/Tribe/Editor/Blocks/Tickets.php +19 -4
  50. src/Tribe/Editor/Meta.php +16 -0
  51. src/Tribe/Main.php +15 -9
  52. src/Tribe/Plugin_Register.php +1 -1
  53. src/Tribe/REST/V1/Attendee_Repository.php +1 -0
  54. src/Tribe/RSVP.php +11 -3
  55. src/Tribe/Status/Abstract_Commerce.php +31 -10
  56. src/Tribe/Ticket_Object.php +6 -1
  57. src/Tribe/Tickets.php +8 -2
  58. src/Tribe/Tickets_Handler.php +9 -3
  59. src/Tribe/Tickets_View.php +17 -6
  60. src/Tribe/Views/V2/Models/Tickets.php +4 -1
  61. src/modules/blocks/rsvp/header-image/container.js +10 -11
  62. src/resources/css/app/rsvp/frontend.css +1 -1
  63. src/resources/css/app/rsvp/frontend.min.css +1 -1
  64. src/resources/css/rsvp.css +10 -4
  65. src/resources/css/rsvp.min.css +1 -1
  66. src/resources/js/app/blocks.js +4 -3
  67. src/resources/js/app/blocks.min.js +1 -1
  68. src/resources/js/frontend-ticket-form.js +5 -6
  69. src/resources/js/frontend-ticket-form.min.js +1 -1
  70. src/resources/js/rsvp-block.js +12 -6
  71. src/resources/js/rsvp-block.min.js +1 -1
  72. src/resources/js/tickets-block.js +26 -7
  73. src/resources/js/tickets-block.min.js +1 -1
  74. src/resources/js/tickets.js +1 -1
  75. src/resources/js/tickets.min.js +1 -1
  76. src/resources/postcss/rsvp.pcss +8 -2
  77. src/styles/rsvp/frontend.pcss +8 -2
  78. src/styles/tickets/frontend.pcss +1 -0
  79. src/template-tags/tickets.php +86 -24
  80. src/views/blocks/rsvp.php +15 -1
  81. src/views/blocks/rsvp/details/availability.php +37 -6
  82. src/views/blocks/rsvp/form/quantity-input.php +16 -6
  83. src/views/blocks/rsvp/loader.php +15 -3
  84. src/views/blocks/tickets.php +1 -1
  85. src/views/blocks/tickets/extra-available-quantity.php +14 -8
  86. src/views/blocks/tickets/extra-available.php +50 -7
  87. src/views/blocks/tickets/extra.php +7 -2
  88. src/views/blocks/tickets/item.php +38 -19
  89. src/views/blocks/tickets/quantity.php +16 -7
  90. src/views/blocks/tickets/registration/attendee/submit.php +1 -1
  91. src/views/tickets/rsvp.php +45 -15
  92. src/views/tickets/tpp.php +30 -2
  93. vendor/autoload.php +1 -1
  94. vendor/composer/autoload_real.php +4 -4
  95. vendor/composer/autoload_static.php +4 -4
common/lang/tribe-common.pot CHANGED
@@ -2,13 +2,15 @@
2
  # This file is distributed under the same license as the Tribe Common package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Tribe Common 4.10.1\n"
 
6
  "Report-Msgid-Bugs-To: http://m.tri.be/191x\n"
7
- "POT-Creation-Date: 2019-12-09 16:41:53+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2019-12-09 16:41\n"
 
12
  "Last-Translator: \n"
13
  "Language-Team: \n"
14
 
2
  # This file is distributed under the same license as the Tribe Common package.
3
  msgid ""
4
  msgstr ""
5
+
6
+ "Project-Id-Version: Tribe Common 4.10.2\n"
7
  "Report-Msgid-Bugs-To: http://m.tri.be/191x\n"
8
+ "POT-Creation-Date: 2019-12-10 00:34:42+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2019-12-10 00:34\n"
13
+
14
  "Last-Translator: \n"
15
  "Language-Team: \n"
16
 
common/src/Tribe/Cache.php CHANGED
@@ -272,5 +272,84 @@ class Tribe__Cache implements ArrayAccess {
272
  public function offsetUnset( $offset ) {
273
  $this->delete( $offset );
274
  }
275
- }
276
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  public function offsetUnset( $offset ) {
273
  $this->delete( $offset );
274
  }
 
275
 
276
+ /**
277
+ * Warms up the caches for a collection of posts.
278
+ *
279
+ * @since 4.10.2
280
+ *
281
+ * @param array|int $post_ids A post ID, or a collection of post IDs.
282
+ * @param bool $update_post_meta_cache Whether to warm-up the post meta cache for the posts or not.
283
+ */
284
+ public function warmup_post_caches( $post_ids, $update_post_meta_cache = false ) {
285
+ if ( empty( $post_ids ) ) {
286
+ return;
287
+ }
288
+
289
+ $post_ids = (array) $post_ids;
290
+
291
+ global $wpdb;
292
+
293
+ $already_cached_ids = [];
294
+ foreach ( $post_ids as $post_id ) {
295
+ if ( wp_cache_get( $post_id, 'posts' ) instanceof \WP_Post ) {
296
+ $already_cached_ids[] = $post_id;
297
+ }
298
+ }
299
+
300
+ $required = array_diff( $post_ids, $already_cached_ids );
301
+
302
+ if ( empty( $required ) ) {
303
+ return;
304
+ }
305
+
306
+ /** @var Tribe__Feature_Detection $feature_detection */
307
+ $feature_detection = tribe('feature-detection');
308
+ $limit = $feature_detection->mysql_limit_for_example( 'post_result' );
309
+
310
+ /**
311
+ * Filters the LIMIT that should be used to warm-up post caches and postmeta caches (if the
312
+ * `$update_post_meta_cache` parameter is `true`).
313
+ *
314
+ * Lower this value on less powerful hosts. Return `0` to disable the warm-up completely, and `-1` to remove the
315
+ * limit (not recommended).
316
+ *
317
+ * @since 4.10.2
318
+ *
319
+ * @param int $limit The number of posts whose caches will be warmed up, per query.
320
+ */
321
+ $limit = (int) apply_filters( 'tribe_cache_warmup_post_cache_limit', min( $limit, count( $post_ids ) ) );
322
+
323
+ if ( 0 === $limit ) {
324
+ // Warmup disabled.
325
+ return;
326
+ }
327
+
328
+ $buffer = $post_ids;
329
+ $page = 0;
330
+
331
+ do {
332
+ $limit_clause = $limit < 0 ? sprintf( 'LIMIT %d,%d', $limit * $page, $limit ) : '';
333
+ $page ++;
334
+ $these_ids = array_splice( $buffer, 0, $limit );
335
+ $interval = implode( ',', array_map( 'absint', $these_ids ) );
336
+ $posts_query = "SELECT * FROM {$wpdb->posts} WHERE ID IN ({$interval}) {$limit_clause}";
337
+ $post_objects = $wpdb->get_results( $posts_query );
338
+ if ( is_array( $post_objects ) && ! empty( $post_objects ) ) {
339
+ foreach ( $post_objects as $post_object ) {
340
+ $post = new \WP_Post( $post_object );
341
+ wp_cache_set( $post_object->ID, $post, 'posts' );
342
+ }
343
+
344
+ if ( $update_post_meta_cache ) {
345
+ update_meta_cache( 'post', $these_ids );
346
+ }
347
+ }
348
+ } while (
349
+ ! empty( $post_objects )
350
+ && is_array( $post_objects )
351
+ && count( $post_objects ) < count( $post_ids )
352
+ );
353
+
354
+ }
355
+ }
common/src/Tribe/Context.php CHANGED
@@ -401,6 +401,10 @@ class Tribe__Context {
401
  */
402
  $value = apply_filters( "tribe_context_{$key}", $value );
403
 
 
 
 
 
404
  return $value;
405
  }
406
 
@@ -454,9 +458,22 @@ class Tribe__Context {
454
  public function get_locations() {
455
  $this->populate_locations();
456
 
457
- return $this->use_default_locations
458
  ? array_merge( self::$locations, $this->override_locations )
459
  : $this->override_locations;
 
 
 
 
 
 
 
 
 
 
 
 
 
460
  }
461
 
462
  /**
@@ -1563,12 +1580,37 @@ class Tribe__Context {
1563
  */
1564
  public function get_read_key_for( $location, $type = null ) {
1565
  $type = $type ?: static::REQUEST_VAR;
1566
- if ( isset( static::$locations[ $location ]['read'][ $type ] ) ) {
1567
- $keys = (array) static::$locations[ $location ]['read'][ $type ];
1568
-
1569
  return reset( $keys );
1570
  }
1571
 
1572
  return $location;
1573
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1574
  }
401
  */
402
  $value = apply_filters( "tribe_context_{$key}", $value );
403
 
404
+ if ( $value !== static::NOT_FOUND ) {
405
+ $this->request_cache[ $key ] = $value;
406
+ }
407
+
408
  return $value;
409
  }
410
 
458
  public function get_locations() {
459
  $this->populate_locations();
460
 
461
+ $locations = $this->use_default_locations
462
  ? array_merge( self::$locations, $this->override_locations )
463
  : $this->override_locations;
464
+
465
+ if ( $this->use_default_locations ) {
466
+ /**
467
+ * Filters the locations registered in the Context.
468
+ *
469
+ * @since 4.10.2
470
+ *
471
+ * @param array $locations An array of locations registered on the Context object.
472
+ */
473
+ $locations = apply_filters( 'tribe_context_locations', $locations, $this );
474
+ }
475
+
476
+ return $locations;
477
  }
478
 
479
  /**
1580
  */
1581
  public function get_read_key_for( $location, $type = null ) {
1582
  $type = $type ?: static::REQUEST_VAR;
1583
+ $locations = $this->get_locations();
1584
+ if ( isset( $locations[ $location ]['read'][ $type ] ) ) {
1585
+ $keys = (array) $locations[ $location ]['read'][ $type ];
1586
  return reset( $keys );
1587
  }
1588
 
1589
  return $location;
1590
  }
1591
+
1592
+ /**
1593
+ * Safely set the value of a group of locations.
1594
+ *
1595
+ * This method can only augment the context, without altering it; it can only add new values.
1596
+ *
1597
+ * @since 4.10.2
1598
+ *
1599
+ * @param array|string $values The values to set, if not already set or the key of the value to set, requires
1600
+ * the `$value` to be passed.
1601
+ * @param mixed|null $value The value to set for the key, this parameter will be ignored if the `$values_or_key`
1602
+ * parameter is not a string.
1603
+ */
1604
+ public function safe_set( $values_or_key, $value = null ) {
1605
+ $values = func_num_args() === 2
1606
+ ? [ $values_or_key => $value ]
1607
+ : $values_or_key;
1608
+
1609
+ foreach ( $values as $key => $val ) {
1610
+ if ( static::NOT_FOUND !== $this->get( $key, static::NOT_FOUND ) ) {
1611
+ continue;
1612
+ }
1613
+ $this->request_cache[ $key ] = $val;
1614
+ }
1615
+ }
1616
  }
common/src/Tribe/Date_Utils.php CHANGED
@@ -232,6 +232,22 @@ if ( ! class_exists( 'Tribe__Date_Utils' ) ) {
232
  return date( $format, $date );
233
  }
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  /**
236
  * Returns the time only.
237
  *
@@ -1209,17 +1225,20 @@ if ( ! class_exists( 'Tribe__Date_Utils' ) ) {
1209
  }
1210
 
1211
  $timezone_object = null;
 
1212
 
1213
  try {
1214
  // PHP 5.2 will not throw an exception but will generate an error.
1215
  $utc = new DateTimeZone( 'UTC' );
 
1216
 
1217
  if ( self::is_timestamp( $datetime ) ) {
1218
  // Timestamps timezone is always UTC.
1219
- return new DateTime( '@' . $datetime, $utc );
1220
- }
1221
 
1222
- $timezone_object = Tribe__Timezones::build_timezone_object( $timezone );
 
 
1223
 
1224
  set_error_handler( 'tribe_catch_and_throw' );
1225
  $date = new DateTime( $datetime, $timezone_object );
@@ -1268,28 +1287,30 @@ if ( ! class_exists( 'Tribe__Date_Utils' ) ) {
1268
  public static function get_week_start_end( $date, $start_of_week = null ) {
1269
  $week_start = static::build_date_object( $date );
1270
  $week_start->setTime( 0, 0, 0 );
 
 
 
 
1271
 
1272
- // `0` (for Sunday) through `6` (for Saturday); we correct Sunday to stick w/ ISO notation.
1273
- $week_start_day = null !== $start_of_week ? (int) $start_of_week : (int) get_option( 'start_of_week', 0 );
1274
- if ( 0 === $week_start_day ) {
1275
- $week_start_day = 7;
 
 
 
1276
  }
1277
- // `1` (for Monday) through `7` (for Sunday).
1278
- $date_day = (int) $week_start->format( 'N' );
 
 
 
 
1279
 
1280
  /*
1281
  * From the PHP docs, the `W` format stands for:
1282
  * - ISO-8601 week number of year, weeks starting on Monday
1283
- * We compensate for weeks starting on Sunday here.
1284
  */
1285
- $week_offset = array_sum(
1286
- [
1287
- // If the week starts on Sunday move to the next week.
1288
- 0 === $week_start_day ? 1 : 0,
1289
- // If the current date is before the start of the week, move back a week.
1290
- $date_day < $week_start_day ? - 1 : 0,
1291
- ]
1292
- );
1293
  $week_start->setISODate(
1294
  (int) $week_start->format( 'o' ),
1295
  (int) $week_start->format( 'W' ) + $week_offset,
@@ -1301,7 +1322,102 @@ if ( ! class_exists( 'Tribe__Date_Utils' ) ) {
1301
  $week_end->add( new DateInterval( 'P6D' ) );
1302
  $week_end->setTime( 23, 59, 59 );
1303
 
 
 
 
 
 
1304
  return [ $week_start, $week_end ];
1305
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1306
  }
1307
  }
232
  return date( $format, $date );
233
  }
234
 
235
+ /**
236
+ * Returns as string the nearest half a hour for a given valid string datetime.
237
+ *
238
+ * @since 4.10.2
239
+ *
240
+ * @param string $date Valid DateTime string.
241
+ *
242
+ * @return string Rounded datetime string
243
+ */
244
+ public static function round_nearest_half_hour( $date ) {
245
+ $date_object = static::build_date_object( $date );
246
+ $rounded_minutes = floor( $date_object->format( 'i' ) / 30 ) * 30;
247
+
248
+ return $date_object->format( 'Y-m-d H:' ) . $rounded_minutes . ':00';
249
+ }
250
+
251
  /**
252
  * Returns the time only.
253
  *
1225
  }
1226
 
1227
  $timezone_object = null;
1228
+ $datetime = empty($datetime) ? 'now' : $datetime;
1229
 
1230
  try {
1231
  // PHP 5.2 will not throw an exception but will generate an error.
1232
  $utc = new DateTimeZone( 'UTC' );
1233
+ $timezone_object = Tribe__Timezones::build_timezone_object( $timezone );
1234
 
1235
  if ( self::is_timestamp( $datetime ) ) {
1236
  // Timestamps timezone is always UTC.
1237
+ $date = new DateTime( '@' . $datetime, $utc );
 
1238
 
1239
+ // If we have a timezone, then set it.
1240
+ return $timezone ? $date->setTimezone( $timezone_object ) : $date;
1241
+ }
1242
 
1243
  set_error_handler( 'tribe_catch_and_throw' );
1244
  $date = new DateTime( $datetime, $timezone_object );
1287
  public static function get_week_start_end( $date, $start_of_week = null ) {
1288
  $week_start = static::build_date_object( $date );
1289
  $week_start->setTime( 0, 0, 0 );
1290
+ // `0` (for Sunday) through `6` (for Saturday), the way WP handles the `start_of_week` option.
1291
+ $week_start_day = null !== $start_of_week
1292
+ ? (int) $start_of_week
1293
+ : (int) get_option( 'start_of_week', 0 );
1294
 
1295
+ $cache_key = md5(
1296
+ __METHOD__ . serialize( [ $week_start->format( static::DBDATEFORMAT ), $week_start_day ] )
1297
+ );
1298
+ $cache = tribe( 'cache' );
1299
+
1300
+ if ( false !== $cached = $cache[ $cache_key ] ) {
1301
+ return $cached;
1302
  }
1303
+
1304
+ // `0` (for Sunday) through `6` (for Saturday), the way WP handles the `start_of_week` option.
1305
+ $date_day = (int) $week_start->format( 'w' );
1306
+
1307
+ // If the current date is before the start of the week, move back a week.
1308
+ $week_offset = $date_day < $week_start_day ? - 1 : 0;
1309
 
1310
  /*
1311
  * From the PHP docs, the `W` format stands for:
1312
  * - ISO-8601 week number of year, weeks starting on Monday
 
1313
  */
 
 
 
 
 
 
 
 
1314
  $week_start->setISODate(
1315
  (int) $week_start->format( 'o' ),
1316
  (int) $week_start->format( 'W' ) + $week_offset,
1322
  $week_end->add( new DateInterval( 'P6D' ) );
1323
  $week_end->setTime( 23, 59, 59 );
1324
 
1325
+ $week_start = static::immutable( $week_start );
1326
+ $week_end = static::immutable( $week_end );
1327
+
1328
+ $cache[ $cache_key ] = [ $week_start, $week_end ];
1329
+
1330
  return [ $week_start, $week_end ];
1331
  }
1332
+
1333
+ /**
1334
+ * Builds and returns a `DateInterval` object from the interval specification.
1335
+ *
1336
+ * For performance purposes the use of `DateInterval` specifications is preferred, so `P1D` is better than
1337
+ * `1 day`.
1338
+ *
1339
+ * @since 4.10.2
1340
+ *
1341
+ * @return DateInterval The built date interval object.
1342
+ */
1343
+ public static function interval( $interval_spec ) {
1344
+ try {
1345
+ $interval = new \DateInterval( $interval_spec );
1346
+ } catch ( \Exception $e ) {
1347
+ $interval = DateInterval::createFromDateString( $interval_spec );
1348
+ }
1349
+
1350
+ return $interval;
1351
+ }
1352
+
1353
+ /**
1354
+ * Builds the immutable version of a date from a string, integer (timestamp) or \DateTime object.
1355
+ *
1356
+ * It's the immutable version of the `Tribe__Date_Utils::build_date_object` method.
1357
+ *
1358
+ * @since 4.10.2
1359
+ *
1360
+ * @param string|DateTime|int $datetime A `strtotime` parse-able string, a DateTime object or
1361
+ * a timestamp; defaults to `now`.
1362
+ * @param string|DateTimeZone|null $timezone A timezone string, UTC offset or DateTimeZone object;
1363
+ * defaults to the site timezone; this parameter is ignored
1364
+ * if the `$datetime` parameter is a DatTime object.
1365
+ * @param bool $with_fallback Whether to return a DateTime object even when the date data is
1366
+ * invalid or not; defaults to `true`.
1367
+ *
1368
+ * @return DateTimeImmutable|false A DateTime object built using the specified date, time and timezone; if
1369
+ * `$with_fallback` is set to `false` then `false` will be returned if a
1370
+ * DateTime object could not be built.
1371
+ */
1372
+ static function immutable( $datetime = 'now', $timezone = null, $with_fallback = true ) {
1373
+ if ( $datetime instanceof DateTimeImmutable ) {
1374
+ return $datetime;
1375
+ }
1376
+
1377
+ if ( $datetime instanceof DateTime ) {
1378
+ return DateTimeImmutable::createFromMutable( $datetime );
1379
+ }
1380
+
1381
+ $mutable = static::build_date_object( $datetime, $timezone, $with_fallback );
1382
+
1383
+ if ( false === $mutable ) {
1384
+ return false;
1385
+ }
1386
+
1387
+ $cache_key = md5( ( __METHOD__ . $mutable->getTimestamp() ) );
1388
+ $cache = tribe( 'cache' );
1389
+
1390
+ if ( false !== $cached = $cache[ $cache_key ] ) {
1391
+ return $cached;
1392
+ }
1393
+
1394
+ $immutable = DateTimeImmutable::createFromMutable( $mutable );
1395
+
1396
+ $cache[ $cache_key ] = $immutable;
1397
+
1398
+ return $immutable;
1399
+ }
1400
+
1401
+ /**
1402
+ * Builds a date object from a given datetime and timezone.
1403
+ *
1404
+ * An alias of the `Tribe__Date_Utils::build_date_object` function.
1405
+ *
1406
+ * @since 4.10.2
1407
+ *
1408
+ * @param string|DateTime|int $datetime A `strtotime` parse-able string, a DateTime object or
1409
+ * a timestamp; defaults to `now`.
1410
+ * @param string|DateTimeZone|null $timezone A timezone string, UTC offset or DateTimeZone object;
1411
+ * defaults to the site timezone; this parameter is ignored
1412
+ * if the `$datetime` parameter is a DatTime object.
1413
+ * @param bool $with_fallback Whether to return a DateTime object even when the date data is
1414
+ * invalid or not; defaults to `true`.
1415
+ *
1416
+ * @return DateTime|false A DateTime object built using the specified date, time and timezone; if `$with_fallback`
1417
+ * is set to `false` then `false` will be returned if a DateTime object could not be built.
1418
+ */
1419
+ public static function mutable( $datetime = 'now', $timezone = null, $with_fallback = true ) {
1420
+ return static::build_date_object( $datetime, $timezone, $with_fallback );
1421
+ }
1422
  }
1423
  }
common/src/Tribe/Debug_Bar/Panels/Context.php CHANGED
@@ -76,8 +76,8 @@ class Tribe__Debug_Bar__Panels__Context extends Debug_Bar_Panel {
76
 
77
  $html .= '<tr>';
78
  $html .= '<td><code>' . $key . '</code></td>';
79
- $html .= '<td><code>' . ( isset( $context[ $key ] ) ? $context[ $key ] : 'undefined' ) . '</code></td>';
80
- $html .= '<td>' . ( false !== $orm_arg_key ? '<code>' . $orm_arg_key . ' => ' . $orm_arg_value . '</code>' : '' ) . '</td>';
81
  $html .= '<td><code>' . ( isset( $locations[ $key ]['read'] ) ? 'yes' : 'no' ) . '</code></td>';
82
  $html .= '<td><code>' . ( isset( $locations[ $key ]['write'] ) ? 'yes' : 'no' ) . '</code></td>';
83
  $html .= '</tr>';
76
 
77
  $html .= '<tr>';
78
  $html .= '<td><code>' . $key . '</code></td>';
79
+ $html .= '<td><code>' . ( isset( $context[ $key ] ) ? print_r( $context[ $key ], true ) : 'undefined' ) . '</code></td>';
80
+ $html .= '<td>' . ( false !== $orm_arg_key ? '<code>' . print_r( $orm_arg_key, true ) . ' => ' . print_r( $orm_arg_value, true ) . '</code>' : '' ) . '</td>';
81
  $html .= '<td><code>' . ( isset( $locations[ $key ]['read'] ) ? 'yes' : 'no' ) . '</code></td>';
82
  $html .= '<td><code>' . ( isset( $locations[ $key ]['write'] ) ? 'yes' : 'no' ) . '</code></td>';
83
  $html .= '</tr>';
common/src/Tribe/Editor.php CHANGED
@@ -27,10 +27,11 @@ class Tribe__Editor {
27
  * @return bool
28
  */
29
  public function should_load_blocks() {
30
- return (
31
- $this->is_gutenberg_active() || $this->is_wp_version()
32
- )
33
- && $this->is_blocks_editor_active();
 
34
  }
35
 
36
  /**
27
  * @return bool
28
  */
29
  public function should_load_blocks() {
30
+ $gutenberg = $this->is_gutenberg_active() || $this->is_wp_version();
31
+ $blocks = $this->is_blocks_editor_active();
32
+ $classic = $this->is_classic_plugin_active() || $this->is_classic_option_active();
33
+
34
+ return $gutenberg && $blocks && ! $classic;
35
  }
36
 
37
  /**
common/src/Tribe/Feature_Detection.php CHANGED
@@ -6,6 +6,8 @@
6
  * @since 4.7.23
7
  */
8
 
 
 
9
  /**
10
  * Class Tribe__Feature_Detection
11
  *
@@ -20,6 +22,17 @@ class Tribe__Feature_Detection {
20
  */
21
  public static $transient = 'tribe_feature_detection';
22
 
 
 
 
 
 
 
 
 
 
 
 
23
  /**
24
  * The name of the option that will be used to indicate a feature detection is running.
25
  *
@@ -149,4 +162,97 @@ class Tribe__Feature_Detection {
149
 
150
  return ! empty( $lock_option );
151
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  }
6
  * @since 4.7.23
7
  */
8
 
9
+ use Tribe__Utils__Array as Arr;
10
+
11
  /**
12
  * Class Tribe__Feature_Detection
13
  *
22
  */
23
  public static $transient = 'tribe_feature_detection';
24
 
25
+ /**
26
+ * A set of example byte sizes of result sets.
27
+ *
28
+ * @since 4.10.2
29
+ *
30
+ * @var array
31
+ */
32
+ public static $example_size = [
33
+ 'post_result' => 6000,
34
+ ];
35
+
36
  /**
37
  * The name of the option that will be used to indicate a feature detection is running.
38
  *
162
 
163
  return ! empty( $lock_option );
164
  }
165
+
166
+ /**
167
+ * Returns the value of the `max_allowed_packet` MYSQL variable, if set, or a default value.
168
+ *
169
+ * @since 4.10.2
170
+ *
171
+ * @return int The byte size of the `max_allowed_packet` MYSQL variable.
172
+ */
173
+ public function get_mysql_max_packet_size() {
174
+ /**
175
+ * Filters the value of the `max_allowed_packet` variable before it's read from the database.
176
+ *
177
+ * If the value returned from this filter is not `null`, then it will be assumed to be the value.
178
+ *
179
+ * @since 4.10.2
180
+ *
181
+ * @param int $mysql_max_packet_size The value of the `max_allowed_packet` variable, initially `null`.
182
+ */
183
+ $mysql_max_packet_size = apply_filters( 'tribe_max_allowed_packet_size', null );
184
+
185
+ if ( null !== $mysql_max_packet_size ) {
186
+ return absint( $mysql_max_packet_size );
187
+ }
188
+
189
+ /** @var Tribe__Cache $cache */
190
+ $cache = tribe( 'cache' );
191
+
192
+ $cached = $cache->get( 'max_allowed_packet' );
193
+
194
+ if ( false !== $cached ) {
195
+ return $cached;
196
+ }
197
+
198
+ global $wpdb;
199
+ $mysql_max_packet_size = $wpdb->get_var( "SHOW VARIABLES LIKE 'max_allowed_packet'", 1 );
200
+ // At min set it to 2 MBs.
201
+ $mysql_max_packet_size = absint( max( absint( $mysql_max_packet_size ), 2097152 ) );
202
+
203
+ $cache->set( 'max_allowed_packet', $mysql_max_packet_size, WEEK_IN_SECONDS );
204
+
205
+ return $mysql_max_packet_size;
206
+ }
207
+
208
+ /**
209
+ * Returns the suggested SQL LIMIT value, based on the `max_allowed_packet` size and example string length.
210
+ *
211
+ * This is useful to size "reasonable" LIMITs when dealing with either very long queries or potentially long
212
+ * result sets.
213
+ *
214
+ * @since 4.10.2
215
+ *
216
+ * @param string $example_string The example string.
217
+ *
218
+ * @return int The suggested LIMIT value.
219
+ */
220
+ public function mysql_limit_for_string( $example_string ) {
221
+ $byte_size = function_exists( 'mb_strlen' )
222
+ ? mb_strlen( $example_string )
223
+ : strlen( $example_string );
224
+
225
+ return $this->mysql_limit_for_size( $byte_size );
226
+ }
227
+
228
+ /**
229
+ * Returns the SQL LIMIT for a byte size, in relation to the `max_allowed_packet` value.
230
+ *
231
+ * @since 4.10.2
232
+ *
233
+ * @param int $byte_size The byte size to check.
234
+ *
235
+ * @return int The SQL LIMIT value.
236
+ */
237
+ public function mysql_limit_for_size( $byte_size ) {
238
+ return absint( floor( $this->get_mysql_max_packet_size() / $byte_size ) * 0.8 );
239
+ }
240
+
241
+ /**
242
+ * Provides the SQL LIMIT value, in relation to the `max_allowed_packet` value, for a pre-existing example.
243
+ *
244
+ * Defaults to the complete post result example string if the example is not found.
245
+ *
246
+ * @since 4.10.2
247
+ *
248
+ * @param string $example The name of the example to return. See the `Tribe__Feature_Detection::$example_sizes`
249
+ * prop for the available examples. Defaults to the `post_result` one.
250
+ *
251
+ * @return int The SQL LIMIT value for the example.
252
+ */
253
+ public function mysql_limit_for_example( $example ) {
254
+ $example_size = Arr::get( static::$example_size, $example, static::$example_size['post_result'] );
255
+
256
+ return $this->mysql_limit_for_size( $example_size );
257
+ }
258
  }
common/src/Tribe/Main.php CHANGED
@@ -17,7 +17,7 @@ class Tribe__Main {
17
  const OPTIONNAME = 'tribe_events_calendar_options';
18
  const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options';
19
 
20
- const VERSION = '4.10.1';
21
 
22
  const FEED_URL = 'https://theeventscalendar.com/feed/';
23
 
17
  const OPTIONNAME = 'tribe_events_calendar_options';
18
  const OPTIONNAMENETWORK = 'tribe_events_calendar_network_options';
19
 
20
+ const VERSION = '4.10.3';
21
 
22
  const FEED_URL = 'https://theeventscalendar.com/feed/';
23
 
common/src/Tribe/Models/Post_Types/Base.php CHANGED
@@ -180,21 +180,26 @@ abstract class Base {
180
  return '__return_true';
181
  }
182
 
183
- // Cache by post ID and filter.
184
- $cache_key = $cache_slug . '_' . $this->post->ID . '_' . $filter;
185
- $cache = new Cache();
186
-
187
- // Define a function to cache this event when, and if, one of the lazy properties is loaded.
188
- $callback = function () use ( $cache, $cache_key, $filter )
189
- {
190
- $properties = $this->get_properties( $filter );
191
 
 
192
  /*
193
- * Cache without expiration, but only until a post of the types managed by The Events Calendar is
194
- * updated or created.
 
195
  */
196
- $cache->set( $cache_key, $properties, 0, Cache_Listener::TRIGGER_SAVE_POST );
197
- };
 
 
 
 
 
 
 
 
 
 
198
 
199
  return $callback;
200
  }
180
  return '__return_true';
181
  }
182
 
183
+ $callback = null;
 
 
 
 
 
 
 
184
 
185
+ if ( wp_using_ext_object_cache() ) {
186
  /*
187
+ * If any real caching is in place , then define a function to cache this event when, and if, one of the
188
+ * lazy properties is loaded.
189
+ * Cache by post ID and filter.
190
  */
191
+ $cache_key = $cache_slug . '_' . $this->post->ID . '_' . $filter;
192
+ $cache = new Cache();
193
+ $callback = function () use ( $cache, $cache_key, $filter ) {
194
+ $properties = $this->get_properties( $filter );
195
+
196
+ /*
197
+ * Cache without expiration, but only until a post of the types managed by The Events Calendar is
198
+ * updated or created.
199
+ */
200
+ $cache->set( $cache_key, $properties, 0, Cache_Listener::TRIGGER_SAVE_POST );
201
+ };
202
+ }
203
 
204
  return $callback;
205
  }
common/src/Tribe/Repository.php CHANGED
@@ -1562,7 +1562,7 @@ abstract class Tribe__Repository
1562
  * Filters the query to only return posts that are related, via a meta key, to posts
1563
  * that satisfy a condition.
1564
  *
1565
- * @param string|array $meta_keys One ore more `meta_keys` relating the queried post type(s)
1566
  * to another post type.
1567
  * @param string $compare The SQL comparison operator.
1568
  * @param string $field One (a column in the `posts` table) that should match
@@ -1581,9 +1581,10 @@ abstract class Tribe__Repository
1581
  if ( empty( $field ) || empty( $values ) ) {
1582
  throw Tribe__Repository__Usage_Error::because_this_comparison_operator_requires_fields_and_values( $meta_keys, $compare, $this );
1583
  }
1584
- $field = esc_sql( $field );
1585
  }
1586
 
 
 
1587
  /** @var wpdb $wpdb */
1588
  global $wpdb;
1589
  $p = $this->sql_slug( 'meta_related_post', $compare, $meta_keys );
@@ -1610,6 +1611,90 @@ abstract class Tribe__Repository
1610
  return $this;
1611
  }
1612
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1613
  /**
1614
  * Builds a fenced group of WHERE clauses that will be used with OR logic.
1615
  *
1562
  * Filters the query to only return posts that are related, via a meta key, to posts
1563
  * that satisfy a condition.
1564
  *
1565
+ * @param string|array $meta_keys One or more `meta_keys` relating the queried post type(s)
1566
  * to another post type.
1567
  * @param string $compare The SQL comparison operator.
1568
  * @param string $field One (a column in the `posts` table) that should match
1581
  if ( empty( $field ) || empty( $values ) ) {
1582
  throw Tribe__Repository__Usage_Error::because_this_comparison_operator_requires_fields_and_values( $meta_keys, $compare, $this );
1583
  }
 
1584
  }
1585
 
1586
+ $field = esc_sql( $field );
1587
+
1588
  /** @var wpdb $wpdb */
1589
  global $wpdb;
1590
  $p = $this->sql_slug( 'meta_related_post', $compare, $meta_keys );
1611
  return $this;
1612
  }
1613
 
1614
+ /**
1615
+ * Filters the query to only return posts that are related, via a meta key, to posts
1616
+ * that satisfy a condition.
1617
+ *
1618
+ * @since 4.10.3
1619
+ *
1620
+ * @throws Tribe__Repository__Usage_Error If the comparison operator requires and no value provided.
1621
+ *
1622
+ * @param string|array $meta_keys One or more `meta_keys` relating the queried post type(s)
1623
+ * to another post type.
1624
+ * @param string $compare The SQL comparison operator.
1625
+ * @param string $meta_field One (a column in the `postmeta` table) that should match
1626
+ * the comparison criteria; required if the comparison operator is not `EXISTS` or
1627
+ * `NOT EXISTS`.
1628
+ * @param string|array $meta_values One or more values the post field(s) should be compared to;
1629
+ * required if the comparison operator is not `EXISTS` or `NOT EXISTS`.
1630
+ * @param boolean $or_not_exists Whether or not to also include a clause to check if value IS NULL.
1631
+ * Example with this as true: `value = X OR value IS NULL`.
1632
+ *
1633
+ * @return $this
1634
+ */
1635
+ public function where_meta_related_by_meta( $meta_keys, $compare, $meta_field = null, $meta_values = null, $or_not_exists = false ) {
1636
+ $meta_keys = Tribe__Utils__Array::list_to_array( $meta_keys );
1637
+
1638
+ if ( ! in_array( $compare, array( 'EXISTS', 'NOT EXISTS' ), true ) ) {
1639
+ if ( empty( $meta_field ) || empty( $meta_values ) ) {
1640
+ throw Tribe__Repository__Usage_Error::because_this_comparison_operator_requires_fields_and_values( $meta_keys, $compare, $this );
1641
+ }
1642
+ }
1643
+
1644
+ $meta_field = esc_sql( $meta_field );
1645
+
1646
+ /** @var wpdb $wpdb */
1647
+ global $wpdb;
1648
+
1649
+ $pm = $this->sql_slug( 'post_meta_related_post_meta', $compare, $meta_keys );
1650
+ $pmm = $this->sql_slug( 'meta_post_meta_related_post_meta', $compare, $meta_keys );
1651
+
1652
+ $this->filter_query->join( "LEFT JOIN {$wpdb->postmeta} {$pm} ON {$pm}.post_id = {$wpdb->posts}.ID" );
1653
+ $this->filter_query->join( "
1654
+ LEFT JOIN {$wpdb->postmeta} {$pmm}
1655
+ ON {$pmm}.post_id = {$pm}.meta_value
1656
+ AND {$pmm}.meta_key = '{$meta_field}'
1657
+ " );
1658
+
1659
+ $keys_in = $this->prepare_interval( $meta_keys );
1660
+
1661
+ if ( 'EXISTS' === $compare ) {
1662
+ $this->filter_query->where( "
1663
+ {$pm}.meta_key IN {$keys_in}
1664
+ AND {$pmm}.meta_id IS NOT NULL
1665
+ " );
1666
+ } elseif ( 'NOT EXISTS' === $compare ) {
1667
+ $this->filter_query->where( "
1668
+ {$pm}.meta_key IN {$keys_in}
1669
+ AND {$pmm}.meta_id IS NULL
1670
+ " );
1671
+ } else {
1672
+ if ( in_array( $compare, static::$multi_value_keys, true ) ) {
1673
+ $meta_values = $this->prepare_interval( $meta_values );
1674
+ } else {
1675
+ $meta_values = $this->prepare_value( $meta_values );
1676
+ }
1677
+
1678
+ $clause = "{$pmm}.meta_value {$compare} {$meta_values}";
1679
+
1680
+ if ( $or_not_exists ) {
1681
+ $clause = "
1682
+ (
1683
+ {$clause}
1684
+ OR {$pmm}.meta_id IS NULL
1685
+ )
1686
+ ";
1687
+ }
1688
+
1689
+ $this->filter_query->where( "
1690
+ {$pm}.meta_key IN {$keys_in}
1691
+ AND {$clause}
1692
+ " );
1693
+ }
1694
+
1695
+ return $this;
1696
+ }
1697
+
1698
  /**
1699
  * Builds a fenced group of WHERE clauses that will be used with OR logic.
1700
  *
common/src/Tribe/Repository/Core_Read_Interface.php ADDED
@@ -0,0 +1,402 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The "core" read interface for repositories.
4
+ *
5
+ * This interface is the minimal one a repository should implement to be called such.
6
+ *
7
+ * @since 4.10.2
8
+ *
9
+ * @package Tribe\Repository
10
+ */
11
+
12
+ namespace Tribe\Repository;
13
+
14
+ use Tribe__Repository__Read_Interface;
15
+ use WP_Post;
16
+
17
+ /**
18
+ * Class Core_Read_Interface
19
+ *
20
+ * @since 4.10.2
21
+ *
22
+ * @package Tribe\Repository
23
+ */
24
+ interface Core_Read_Interface {
25
+ /**
26
+ * Batch filter application method.
27
+ *
28
+ * This is the same as calling `by` multiple times with different arguments.
29
+ *
30
+ * @since 4.7.19
31
+ *
32
+ * @param array $args An associative array of arguments to filter
33
+ * the posts by in the shape [ <key>, <value> ]. * * @return Tribe__Repository__Read_Interface
34
+ */
35
+ public function by_args( array $args );
36
+
37
+ /**
38
+ * Applies a filter to the query.
39
+ *
40
+ * While the signature only shows 2 arguments additional arguments will be passed
41
+ * to the schema filters.
42
+ *
43
+ * @since 4.7.19
44
+ *
45
+ * @param string $key
46
+ * @param mixed $value
47
+ * @param mixed ...$args Additional, optional, call arguments that will be passed to
48
+ * the schema.
49
+ *
50
+ * @return Tribe__Repository__Read_Interface
51
+ */
52
+ public function by( $key, $value = null );
53
+
54
+ /**
55
+ * Just an alias of the `by` method to allow for easier reading.
56
+ *
57
+ * @since 4.7.19
58
+ *
59
+ * @param string $key
60
+ * @param mixed $value
61
+ *
62
+ * @return Tribe__Repository__Read_Interface
63
+ */
64
+ public function where( $key, $value = null );
65
+
66
+ /**
67
+ * Sets the page of posts to fetch.
68
+ *
69
+ * Mind that this implementation does not support a `by( 'page', 2 )`
70
+ * filter to force more readable code.
71
+ *
72
+ * @since 4.7.19
73
+ *
74
+ * @param int $page
75
+ *
76
+ * @return Tribe__Repository__Read_Interface
77
+ */
78
+ public function page( $page );
79
+
80
+ /**
81
+ * Sets the number of posts to retrieve per page.
82
+ *
83
+ * Mind that this implementation does not support a `by( 'per_page', 5 )`
84
+ * filter to force more readable code; by default posts per page is set to
85
+ * the pagination defaults for the post type.
86
+ *
87
+ * @param int $per_page
88
+ *
89
+ * @return Tribe__Repository__Read_Interface
90
+ */
91
+ public function per_page( $per_page );
92
+
93
+ /**
94
+ * Returns the number of posts found matching the query.
95
+ *
96
+ * Mind that this value ignores the offset returning the
97
+ * number of results if limits where not applied.
98
+ *
99
+ * @since 4.7.19
100
+ *
101
+ * @return int
102
+ */
103
+ public function found();
104
+
105
+ /**
106
+ * Returns all posts matching the query.
107
+ *
108
+ * Mind that "all" means "all the posts matching all the filters" so pagination applies.
109
+ *
110
+ * @return array
111
+ */
112
+ public function all();
113
+
114
+ /**
115
+ * Sets the offset on the query.
116
+ *
117
+ * Mind that this implementation does not support a `by( 'offset', 2 )`
118
+ * filter to force more readable code.
119
+ *
120
+ * @since 4.7.19
121
+ *
122
+ * @param int $offset
123
+ * @param bool $increment Whether to increment the offset by the value
124
+ * or replace it.
125
+ *
126
+ * @return Tribe__Repository__Read_Interface
127
+ */
128
+ public function offset( $offset, $increment = false );
129
+
130
+ /**
131
+ * Sets the order on the query.
132
+ *
133
+ * Mind that this implementation does not support a `by( 'order', 2 )`
134
+ * filter to force more readable code.
135
+ *
136
+ * @since 4.7.19
137
+ *
138
+ * @param string $order
139
+ *
140
+ * @return Tribe__Repository__Read_Interface
141
+ */
142
+ public function order( $order = 'ASC' );
143
+
144
+ /**
145
+ * Sets the order criteria results should be fetched by.
146
+ *
147
+ * Mind that this implementation does not support a `by( 'order_by', 'title' )`
148
+ * filter to force more readable code.
149
+ *
150
+ * @since 4.7.19
151
+ *
152
+ * @param string $order_by The post field, custom field or alias key to order posts by.
153
+ * @param string $order The order direction; optional; shortcut for the `order` method; defaults
154
+ * to `DESC`.
155
+ *
156
+ * @return Tribe__Repository__Read_Interface
157
+ */
158
+ public function order_by( $order_by, $order = 'DESC' );
159
+
160
+ /**
161
+ * Sets the fields that should be returned by the query.
162
+ *
163
+ * Mind that this implementation does not support a `by( 'fields', 'ids' )`
164
+ * filter to force more readable code.
165
+ *
166
+ * @since 4.7.19
167
+ *
168
+ * @param string $fields
169
+ *
170
+ * @return Tribe__Repository__Read_Interface
171
+ */
172
+ public function fields( $fields );
173
+
174
+ /**
175
+ * Sugar method to set the `post__in` argument.
176
+ *
177
+ * Successive calls will stack, not replace each one.
178
+ *
179
+ * @since 4.7.19
180
+ *
181
+ * @param array|int $post_ids
182
+ *
183
+ * @return Tribe__Repository__Read_Interface
184
+ */
185
+ public function in( $post_ids );
186
+
187
+ /**
188
+ * Sugar method to set the `post__not_in` argument.
189
+ *
190
+ * Successive calls will stack, not replace each one.
191
+ *
192
+ * @since 4.7.19
193
+ *
194
+ * @param array|int $post_ids
195
+ *
196
+ * @return Tribe__Repository__Read_Interface
197
+ */
198
+ public function not_in( $post_ids );
199
+
200
+ /**
201
+ * Sugar method to set the `post_parent__in` argument.
202
+ *
203
+ * Successive calls will stack, not replace each one.
204
+ *
205
+ * @since 4.7.19
206
+ *
207
+ * @param array|int $post_id
208
+ *
209
+ * @return Tribe__Repository__Read_Interface
210
+ */
211
+ public function parent( $post_id );
212
+
213
+ /**
214
+ * Sugar method to set the `post_parent__in` argument.
215
+ *
216
+ * Successive calls will stack, not replace each one.
217
+ *
218
+ * @since 4.7.19
219
+ *
220
+ * @param array $post_ids
221
+ *
222
+ * @return Tribe__Repository__Read_Interface
223
+ */
224
+ public function parent_in( $post_ids );
225
+
226
+ /**
227
+ * Sugar method to set the `post_parent__not_in` argument.
228
+ *
229
+ * Successive calls will stack, not replace each one.
230
+ *
231
+ * @since 4.7.19
232
+ *
233
+ * @param array $post_ids
234
+ *
235
+ * @return Tribe__Repository__Read_Interface
236
+ */
237
+ public function parent_not_in( $post_ids );
238
+
239
+ /**
240
+ * Sugar method to set the `s` argument.
241
+ *
242
+ * Successive calls will replace the search string.
243
+ * This is the default WordPress searh, to search by title,
244
+ * content or excerpt only use the `title`, `content`, `excerpt` filters.
245
+ *
246
+ * @param $search
247
+ *
248
+ * @return Tribe__Repository__Read_Interface
249
+ */
250
+ public function search( $search );
251
+
252
+ /**
253
+ * Returns the number of posts found matching the query in the current page.
254
+ *
255
+ * While the `found` method will return the number of posts found
256
+ * across all pages this method will only return the number of
257
+ * posts found in the current page.
258
+ * Differently from the `found` method this method will apply the
259
+ * offset if set.
260
+ *
261
+ * @since 4.7.19
262
+ *
263
+ * @return int
264
+ */
265
+ public function count();
266
+
267
+ /**
268
+ * Returns the first post of the page matching the current query.
269
+ *
270
+ * If, by default or because set with the `per_page` method, all
271
+ * posts matching the query should be returned then this will be
272
+ * the first post of all those matching the query.
273
+ *
274
+ * @since 4.7.19
275
+ *
276
+ * @return WP_Post|mixed|null
277
+ *
278
+ * @see Tribe__Repository__Read_Interface::per_page()
279
+ */
280
+ public function first();
281
+
282
+ /**
283
+ * Returns the last post of the page matching the current query.
284
+ *
285
+ * If, by default or because set with the `per_page` method, all
286
+ * posts matching the query should be returned then this will be
287
+ * the last post of all those matching the query.
288
+ *
289
+ * @since 4.7.19
290
+ *
291
+ * @return WP_Post|mixed|null
292
+ *
293
+ * @see Tribe__Repository__Read_Interface::per_page()
294
+ */
295
+ public function last();
296
+
297
+ /**
298
+ * Returns the nth post (1-based) of the page matching the current query.
299
+ *
300
+ * Being 1-based the second post can be fetched using `nth( 2 )`.
301
+ * If, by default or because set with the `per_page` method, all
302
+ * posts matching the query should be returned then this will be
303
+ * the nth post of all those matching the query.
304
+ *
305
+ * @since 4.7.19
306
+ *
307
+ * @param int $n
308
+ *
309
+ * @return WP_Post|mixed|null
310
+ *
311
+ * @see Tribe__Repository__Read_Interface::per_page()
312
+ */
313
+ public function nth( $n );
314
+
315
+ /**
316
+ * Returns the first n posts of the page matching the current query.
317
+ *
318
+ * If, by default or because set with the `per_page` method, all
319
+ * posts matching the query should be returned then this method will
320
+ * return the first n posts of all those matching the query.
321
+ *
322
+ * @since 4.7.19
323
+ *
324
+ * @return array An array of posts matching the query.
325
+ *
326
+ * @see Tribe__Repository__Read_Interface::per_page()
327
+ */
328
+ public function take( $n );
329
+
330
+ /**
331
+ * Plucks a field from all results and returns it.
332
+ *
333
+ * This method will implicitly build and use a `WP_List_Util` instance on the return
334
+ * value of a call to the `all` method.
335
+ *
336
+ * @since 4.9.5
337
+ *
338
+ * @param string $field The field to pluck from each result.
339
+ *
340
+ * @return array An array of the plucked results.
341
+ *
342
+ * @see \wp_list_pluck()
343
+ */
344
+ public function pluck( $field );
345
+
346
+ /**
347
+ * Filters the results according to the specified criteria.
348
+ *
349
+ * This method will implicitly build and use a `WP_List_Util` instance on the return
350
+ * value of a call to the `all` method.
351
+ *
352
+ * @since 4.9.5
353
+ *
354
+ * @param array $args Optional. An array of key => value arguments to match
355
+ * against each object. Default empty array.
356
+ * @param string $operator Optional. The logical operation to perform. 'AND' means
357
+ * all elements from the array must match. 'OR' means only
358
+ * one element needs to match. 'NOT' means no elements may
359
+ * match. Default 'AND'.
360
+ *
361
+ * @return array An array of the filtered results.
362
+ *
363
+ * @see \wp_list_filter()
364
+ */
365
+ public function filter( $args = array(), $operator = 'AND' );
366
+
367
+ /**
368
+ * Sorts the results according to the specified criteria.
369
+ *
370
+ * This method will implicitly build and use a `WP_List_Util` instance on the return
371
+ * value of a call to the `all` method.
372
+ *
373
+ * @since 4.9.5
374
+ *
375
+ * @param string|array $orderby Optional. Either the field name to order by or an array
376
+ * of multiple orderby fields as $orderby => $order.
377
+ * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby
378
+ * is a string.
379
+ * @param bool $preserve_keys Optional. Whether to preserve keys. Default false.
380
+ *
381
+ * @return array An array of the sorted results.
382
+ *
383
+ * @see \wp_list_sort()
384
+ */
385
+ public function sort( $orderby = array(), $order = 'ASC', $preserve_keys = false );
386
+
387
+ /**
388
+ * Builds a collection on the result of the `all()` method call.
389
+ *
390
+ * @since 4.9.5
391
+ *
392
+ * @return \Tribe__Utils__Post_Collection
393
+ */
394
+ public function collect();
395
+
396
+ /**
397
+ * Gets the ids of the posts matching the query.
398
+ *
399
+ * @return array An array containing the post IDs to update.
400
+ */
401
+ public function get_ids();
402
+ }
common/src/Tribe/Repository/Filter_Validation.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Provides methods to validate repository filters.
4
+ *
5
+ * @since 4.10.2
6
+ *
7
+ * @package Tribe\Repository
8
+ */
9
+
10
+ namespace Tribe\Repository;
11
+
12
+ use Tribe__Repository__Usage_Error as Usage_Error;
13
+ use Tribe__Utils__Array as Arr;
14
+
15
+ trait Filter_Validation {
16
+ /**
17
+ * Checks the passed arguments to make sure they are the correct number and nature.
18
+ *
19
+ * This method requires the class using it to define a `static::$filter_args_map` property in the shape:
20
+ * ```
21
+ * [
22
+ * <filter> => [ <arg_name> => <arg_validation_callback> ]
23
+ * ]
24
+ * ```
25
+ *
26
+ * @since 4.10.2
27
+ *
28
+ * @param string $filter The name of the filter currently validating.
29
+ * @param array $call_args The current filter call args, usually `func_get_args()`.
30
+ *
31
+ * @throws Usage_Error If there is a definition for the filter and the argument count or nature is not correct.
32
+ */
33
+ protected function ensure_args_for_filter( $filter, array $call_args ) {
34
+ $map = isset( static::$filter_args_map ) ? static::$filter_args_map : false;
35
+
36
+ if ( empty( $map ) ) {
37
+ return;
38
+ }
39
+
40
+ $required_args = Arr::get( $filter, $map, false );
41
+
42
+ if ( false === $required_args ) {
43
+ return;
44
+ }
45
+
46
+ if ( count( $required_args ) !== count( $call_args ) ) {
47
+ throw Usage_Error::because_filter_requires_args( $filter, array_keys( $required_args ) );
48
+ }
49
+
50
+ $iterator = new \MultipleIterator();
51
+ $iterator->attachIterator( new \ArrayIterator( array_keys( $required_args ) ) );
52
+ $iterator->attachIterator( new \ArrayIterator( array_values( $required_args ) ) );
53
+ $iterator->attachIterator( new \ArrayIterator( $call_args ) );
54
+
55
+ foreach ( $required_args as list( $arg_name, $validator, $input ) ) {
56
+ if ( empty( $validator( $input ) ) ) {
57
+ throw Usage_Error::because_filter_arg_is_not_valid( $filter, $arg_name );
58
+ }
59
+ }
60
+ }
61
+ }
common/src/Tribe/Repository/Interface.php CHANGED
@@ -186,13 +186,6 @@ interface Tribe__Repository__Interface
186
  */
187
  public function by_related_to_between( $by_meta_keys, $min, $max, $keys = null, $values = null );
188
 
189
- /**
190
- * Gets the ids of the posts matching the query.
191
- *
192
- * @return array An array containing the post IDs to update.
193
- */
194
- public function get_ids();
195
-
196
  /**
197
  * Adds an entry to the repository filter schema.
198
  *
186
  */
187
  public function by_related_to_between( $by_meta_keys, $min, $max, $keys = null, $values = null );
188
 
 
 
 
 
 
 
 
189
  /**
190
  * Adds an entry to the repository filter schema.
191
  *
common/src/Tribe/Repository/Read_Interface.php CHANGED
@@ -1,166 +1,14 @@
1
  <?php
2
 
 
 
3
  /**
4
  * Interface Tribe__Repository__Read_Interface
5
  *
 
6
  * @since 4.7.19
7
  */
8
- interface Tribe__Repository__Read_Interface extends Tribe__Repository__Setter_Interface {
9
- /**
10
- * Batch filter application method.
11
- *
12
- * This is the same as calling `by` multiple times with different arguments.
13
- *
14
- * @since 4.7.19
15
- *
16
- * @param array $args An associative array of arguments to filter
17
- * the posts by in the shape [ <key>, <value> ]. * * @return Tribe__Repository__Read_Interface */
18
- public function by_args( array $args );
19
-
20
- /**
21
- * Batch filter application method.
22
- *
23
- * This is the same as calling `where` multiple times with different arguments.
24
- *
25
- * T
26
-
27
- /**
28
- * Applies a filter to the query.
29
- *
30
- * While the signature only shows 2 arguments additional arguments will be passed
31
- * to the schema filters.
32
- *
33
- * @since 4.7.19
34
- *
35
- * @param string $key
36
- * @param mixed $value
37
- * @param mixed ...$args Additional, optional, call arguments that will be passed to
38
- * the schema.
39
- *
40
- * @return Tribe__Repository__Read_Interface
41
- */
42
- public function by( $key, $value = null );
43
-
44
- /**
45
- * Just an alias of the `by` method to allow for easier reading.
46
- *
47
- * @since 4.7.19
48
- *
49
- * @param string $key
50
- * @param mixed $value
51
- *
52
- * @return Tribe__Repository__Read_Interface
53
- */
54
- public function where( $key, $value = null );
55
-
56
- /**
57
- * Sets the page of posts to fetch.
58
- *
59
- * Mind that this implementation does not support a `by( 'page', 2 )`
60
- * filter to force more readable code.
61
- *
62
- * @since 4.7.19
63
- *
64
- * @param int $page
65
- *
66
- * @return Tribe__Repository__Read_Interface
67
- */
68
- public function page( $page );
69
-
70
- /**
71
- * Sets the number of posts to retrieve per page.
72
- *
73
- * Mind that this implementation does not support a `by( 'per_page', 5 )`
74
- * filter to force more readable code; by default posts per page is set to
75
- * the pagination defaults for the post type.
76
- *
77
- * @param int $per_page
78
- *
79
- * @return Tribe__Repository__Read_Interface
80
- */
81
- public function per_page( $per_page );
82
-
83
- /**
84
- * Returns the number of posts found matching the query.
85
- *
86
- * Mind that this value ignores the offset returning the
87
- * number of results if limits where not applied.
88
- *
89
- * @since 4.7.19
90
- *
91
- * @return int
92
- */
93
- public function found();
94
-
95
- /**
96
- * Returns all posts matching the query.
97
- *
98
- * Mind that "all" means "all the posts matching all the filters" so pagination applies.
99
- *
100
- * @return array
101
- */
102
- public function all();
103
-
104
- /**
105
- * Sets the offset on the query.
106
- *
107
- * Mind that this implementation does not support a `by( 'offset', 2 )`
108
- * filter to force more readable code.
109
- *
110
- * @since 4.7.19
111
- *
112
- * @param int $offset
113
- * @param bool $increment Whether to increment the offset by the value
114
- * or replace it.
115
- *
116
- * @return Tribe__Repository__Read_Interface
117
- */
118
- public function offset( $offset, $increment = false );
119
-
120
- /**
121
- * Sets the order on the query.
122
- *
123
- * Mind that this implementation does not support a `by( 'order', 2 )`
124
- * filter to force more readable code.
125
- *
126
- * @since 4.7.19
127
- *
128
- * @param string $order
129
- *
130
- * @return Tribe__Repository__Read_Interface
131
- */
132
- public function order( $order = 'ASC' );
133
-
134
- /**
135
- * Sets the order criteria results should be fetched by.
136
- *
137
- * Mind that this implementation does not support a `by( 'order_by', 'title' )`
138
- * filter to force more readable code.
139
- *
140
- * @since 4.7.19
141
- *
142
- * @param string $order_by The post field, custom field or alias key to order posts by.
143
- * @param string $order The order direction; optional; shortcut for the `order` method; defaults
144
- * to `DESC`.
145
- *
146
- * @return Tribe__Repository__Read_Interface
147
- */
148
- public function order_by( $order_by, $order = 'DESC' );
149
-
150
- /**
151
- * Sets the fields that should be returned by the query.
152
- *
153
- * Mind that this implementation does not support a `by( 'fields', 'ids' )`
154
- * filter to force more readable code.
155
- *
156
- * @since 4.7.19
157
- *
158
- * @param string $fields
159
- *
160
- * @return Tribe__Repository__Read_Interface
161
- */
162
- public function fields( $fields );
163
-
164
  /**
165
  * Sets the permission that should be used to get the posts.
166
  *
@@ -173,162 +21,6 @@ interface Tribe__Repository__Read_Interface extends Tribe__Repository__Setter_In
173
  */
174
  public function permission( $permission );
175
 
176
- /**
177
- * Sugar method to set the `post__in` argument.
178
- *
179
- * Successive calls will stack, not replace each one.
180
- *
181
- * @since 4.7.19
182
- *
183
- * @param array|int $post_ids
184
- *
185
- * @return Tribe__Repository__Read_Interface
186
- */
187
- public function in( $post_ids );
188
-
189
- /**
190
- * Sugar method to set the `post__not_in` argument.
191
- *
192
- * Successive calls will stack, not replace each one.
193
- *
194
- * @since 4.7.19
195
- *
196
- * @param array|int $post_ids
197
- *
198
- * @return Tribe__Repository__Read_Interface
199
- */
200
- public function not_in( $post_ids );
201
-
202
- /**
203
- * Sugar method to set the `post_parent__in` argument.
204
- *
205
- * Successive calls will stack, not replace each one.
206
- *
207
- * @since 4.7.19
208
- *
209
- * @param array|int $post_id
210
- *
211
- * @return Tribe__Repository__Read_Interface
212
- */
213
- public function parent( $post_id );
214
-
215
- /**
216
- * Sugar method to set the `post_parent__in` argument.
217
- *
218
- * Successive calls will stack, not replace each one.
219
- *
220
- * @since 4.7.19
221
- *
222
- * @param array $post_ids
223
- *
224
- * @return Tribe__Repository__Read_Interface
225
- */
226
- public function parent_in( $post_ids );
227
-
228
- /**
229
- * Sugar method to set the `post_parent__not_in` argument.
230
- *
231
- * Successive calls will stack, not replace each one.
232
- *
233
- * @since 4.7.19
234
- *
235
- * @param array $post_ids
236
- *
237
- * @return Tribe__Repository__Read_Interface
238
- */
239
- public function parent_not_in( $post_ids );
240
-
241
- /**
242
- * Sugar method to set the `s` argument.
243
- *
244
- * Successive calls will replace the search string.
245
- * This is the default WordPress searh, to search by title,
246
- * content or excerpt only use the `title`, `content`, `excerpt` filters.
247
- *
248
- * @param $search
249
- *
250
- * @return Tribe__Repository__Read_Interface
251
- */
252
- public function search( $search );
253
-
254
- /**
255
- * Returns the number of posts found matching the query in the current page.
256
- *
257
- * While the `found` method will return the number of posts found
258
- * across all pages this method will only return the number of
259
- * posts found in the current page.
260
- * Differently from the `found` method this method will apply the
261
- * offset if set.
262
- *
263
- * @since 4.7.19
264
- *
265
- * @return int
266
- */
267
- public function count();
268
-
269
- /**
270
- * Returns the first post of the page matching the current query.
271
- *
272
- * If, by default or because set with the `per_page` method, all
273
- * posts matching the query should be returned then this will be
274
- * the first post of all those matching the query.
275
- *
276
- * @since 4.7.19
277
- *
278
- * @return WP_Post|mixed|null
279
- *
280
- * @see Tribe__Repository__Read_Interface::per_page()
281
- */
282
- public function first();
283
-
284
- /**
285
- * Returns the last post of the page matching the current query.
286
- *
287
- * If, by default or because set with the `per_page` method, all
288
- * posts matching the query should be returned then this will be
289
- * the last post of all those matching the query.
290
- *
291
- * @since 4.7.19
292
- *
293
- * @return WP_Post|mixed|null
294
- *
295
- * @see Tribe__Repository__Read_Interface::per_page()
296
- */
297
- public function last();
298
-
299
- /**
300
- * Returns the nth post (1-based) of the page matching the current query.
301
- *
302
- * Being 1-based the second post can be fetched using `nth( 2 )`.
303
- * If, by default or because set with the `per_page` method, all
304
- * posts matching the query should be returned then this will be
305
- * the nth post of all those matching the query.
306
- *
307
- * @since 4.7.19
308
- *
309
- * @param int $n
310
- *
311
- * @return WP_Post|mixed|null
312
- *
313
- * @see Tribe__Repository__Read_Interface::per_page()
314
- */
315
- public function nth( $n );
316
-
317
- /**
318
- * Returns the first n posts of the page matching the current query.
319
- *
320
- * If, by default or because set with the `per_page` method, all
321
- * posts matching the query should be returned then this method will
322
- * return the first n posts of all those matching the query.
323
- *
324
- * @since 4.7.19
325
- *
326
- * @return array An array of posts matching the query.
327
- *
328
- * @see Tribe__Repository__Read_Interface::per_page()
329
- */
330
- public function take( $n );
331
-
332
  /**
333
  * Fetches a single instance of the post type handled by the repository by
334
  * the primary key.
@@ -478,70 +170,4 @@ interface Tribe__Repository__Read_Interface extends Tribe__Repository__Setter_In
478
  * @return WP_Query A query object ready to return, and operate, on the posts.
479
  */
480
  public function get_query_for_posts( array $posts );
481
-
482
- /**
483
- * Plucks a field from all results and returns it.
484
- *
485
- * This method will implicitly build and use a `WP_List_Util` instance on the return
486
- * value of a call to the `all` method.
487
- *
488
- * @since 4.9.5
489
- *
490
- * @param string $field The field to pluck from each result.
491
- *
492
- * @return array An array of the plucked results.
493
- *
494
- * @see \wp_list_pluck()
495
- */
496
- public function pluck( $field );
497
-
498
- /**
499
- * Filters the results according to the specified criteria.
500
- *
501
- * This method will implicitly build and use a `WP_List_Util` instance on the return
502
- * value of a call to the `all` method.
503
- *
504
- * @since 4.9.5
505
- *
506
- * @param array $args Optional. An array of key => value arguments to match
507
- * against each object. Default empty array.
508
- * @param string $operator Optional. The logical operation to perform. 'AND' means
509
- * all elements from the array must match. 'OR' means only
510
- * one element needs to match. 'NOT' means no elements may
511
- * match. Default 'AND'.
512
- *
513
- * @return array An array of the filtered results.
514
- *
515
- * @see \wp_list_filter()
516
- */
517
- public function filter( $args = array(), $operator = 'AND' );
518
-
519
- /**
520
- * Sorts the results according to the specified criteria.
521
- *
522
- * This method will implicitly build and use a `WP_List_Util` instance on the return
523
- * value of a call to the `all` method.
524
- *
525
- * @since 4.9.5
526
- *
527
- * @param string|array $orderby Optional. Either the field name to order by or an array
528
- * of multiple orderby fields as $orderby => $order.
529
- * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby
530
- * is a string.
531
- * @param bool $preserve_keys Optional. Whether to preserve keys. Default false.
532
- *
533
- * @return array An array of the sorted results.
534
- *
535
- * @see \wp_list_sort()
536
- */
537
- public function sort( $orderby = array(), $order = 'ASC', $preserve_keys = false );
538
-
539
- /**
540
- * Builds a collection on the result of the `all()` method call.
541
- *
542
- * @since 4.9.5
543
- *
544
- * @return \Tribe__Utils__Post_Collection
545
- */
546
- public function collect();
547
  }
1
  <?php
2
 
3
+ use Tribe\Repository\Core_Read_Interface;
4
+
5
  /**
6
  * Interface Tribe__Repository__Read_Interface
7
  *
8
+ *
9
  * @since 4.7.19
10
  */
11
+ interface Tribe__Repository__Read_Interface extends Tribe__Repository__Setter_Interface, Core_Read_Interface {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  /**
13
  * Sets the permission that should be used to get the posts.
14
  *
21
  */
22
  public function permission( $permission );
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  /**
25
  * Fetches a single instance of the post type handled by the repository by
26
  * the primary key.
170
  * @return WP_Query A query object ready to return, and operate, on the posts.
171
  */
172
  public function get_query_for_posts( array $posts );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  }
common/src/Tribe/Repository/Usage_Error.php CHANGED
@@ -244,4 +244,45 @@ class Tribe__Repository__Usage_Error extends Exception {
244
  public static function because_query_cannot_be_set_after_it_ran() {
245
  return new self( "You are trying to set the repository query after it ran!" );
246
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  }
244
  public static function because_query_cannot_be_set_after_it_ran() {
245
  return new self( "You are trying to set the repository query after it ran!" );
246
  }
247
+
248
+ /**
249
+ * Indicates the client code is trying to call a filter without the correct number of req. parameters.
250
+ *
251
+ * @since 4.10.2
252
+ *
253
+ * @param string $filter The called filter.
254
+ * @param array $required_args The human-readable name of the required arguments.
255
+ *
256
+ * @return static A ready to throw instance of the class.
257
+ */
258
+ public static function because_filter_requires_args( $filter, array $required_args ) {
259
+ return new static(
260
+ sprintf(
261
+ 'The "%s" filter requires %d arguments: %s',
262
+ $filter,
263
+ count( $required_args ),
264
+ implode( ', ', $required_args )
265
+ )
266
+ );
267
+ }
268
+
269
+ /**
270
+ * Indicates the client code is trying to call a filter with an invalid parameter.
271
+ *
272
+ * @since 4.10.2
273
+ *
274
+ * @param string $filter The called filter.
275
+ * @param string $arg_name The human-readable name of the parameter.
276
+ *
277
+ * @return static A ready to throw instance of the class.
278
+ */
279
+ public static function because_filter_arg_is_not_valid( $filter, $arg_name ) {
280
+ return new static(
281
+ sprintf(
282
+ 'The "%s" filter "%s" argument is not valid.',
283
+ $filter,
284
+ $arg_name
285
+ )
286
+ );
287
+ }
288
  }
common/src/Tribe/Rewrite.php CHANGED
@@ -975,7 +975,7 @@ class Tribe__Rewrite {
975
  return home_url();
976
  }
977
 
978
- $clean = $this->get_canonical_url( add_query_arg( $parsed_vars, home_url() ) );
979
 
980
  $this->clean_url_cache[ $url ] = $clean;
981
 
975
  return home_url();
976
  }
977
 
978
+ $clean = $this->get_canonical_url( add_query_arg( $parsed_vars, home_url() ), $force );
979
 
980
  $this->clean_url_cache[ $url ] = $clean;
981
 
common/src/Tribe/Template.php CHANGED
@@ -37,6 +37,15 @@ class Tribe__Template {
37
  */
38
  protected $global = array();
39
 
 
 
 
 
 
 
 
 
 
40
  /**
41
  * Allow chaing if class will extract data from the local context
42
  *
@@ -331,6 +340,25 @@ class Tribe__Template {
331
  return apply_filters( 'tribe_template_public_namespace', $namespace, $this );
332
  }
333
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  /**
335
  * Fetches the path for locating files given a base folder normally theme related
336
  *
@@ -341,9 +369,17 @@ class Tribe__Template {
341
  * @return string
342
  */
343
  protected function get_template_public_path( $base ) {
 
344
  // Craft the plugin Path
345
  $path = array_merge( (array) $base, (array) $this->get_template_public_namespace() );
346
 
 
 
 
 
 
 
 
347
  // Implode to avoid Window Problems
348
  $path = implode( DIRECTORY_SEPARATOR, $path );
349
 
37
  */
38
  protected $global = array();
39
 
40
+ /**
41
+ * Used for finding templates for public templates on themes inside of a folder.
42
+ *
43
+ * @since 4.10.2
44
+ *
45
+ * @var string[]
46
+ */
47
+ protected $template_origin_base_folder = [ 'src', 'views' ];
48
+
49
  /**
50
  * Allow chaing if class will extract data from the local context
51
  *
340
  return apply_filters( 'tribe_template_public_namespace', $namespace, $this );
341
  }
342
 
343
+ /**
344
+ * Fetches which base folder we look for templates in the origin plugin.
345
+ *
346
+ * @since 4.10.2
347
+ *
348
+ * @return array The base folders we look for templates in the origin plugin.
349
+ */
350
+ public function get_template_origin_base_folder() {
351
+ /**
352
+ * Allows filtering of the base path for templates.
353
+ *
354
+ * @since 4.10.2
355
+ *
356
+ * @param array $namespace Which is the base folder we will look for files in the plugin.
357
+ * @param self $template Current instance of the Tribe__Template.
358
+ */
359
+ return apply_filters( 'tribe_template_origin_base_folder', $this->template_origin_base_folder, $this );
360
+ }
361
+
362
  /**
363
  * Fetches the path for locating files given a base folder normally theme related
364
  *
369
  * @return string
370
  */
371
  protected function get_template_public_path( $base ) {
372
+
373
  // Craft the plugin Path
374
  $path = array_merge( (array) $base, (array) $this->get_template_public_namespace() );
375
 
376
+ // Pick up if the folder needs to be aded to the public template path.
377
+ $folder = array_diff( $this->folder, $this->get_template_origin_base_folder() );
378
+
379
+ if ( ! empty( $folder ) ) {
380
+ $path = array_merge( $path, $folder );
381
+ }
382
+
383
  // Implode to avoid Window Problems
384
  $path = implode( DIRECTORY_SEPARATOR, $path );
385
 
common/src/Tribe/Timezones.php CHANGED
@@ -10,7 +10,6 @@ class Tribe__Timezones {
10
  const SITE_TIMEZONE = 'site';
11
  const EVENT_TIMEZONE = 'event';
12
 
13
-
14
  /**
15
  * Container for reusable DateTimeZone objects.
16
  *
@@ -18,7 +17,6 @@ class Tribe__Timezones {
18
  */
19
  protected static $timezones = array();
20
 
21
-
22
  public static function init() {
23
  self::invalidate_caches();
24
  }
@@ -581,6 +579,13 @@ class Tribe__Timezones {
581
  return $timezone;
582
  }
583
 
 
 
 
 
 
 
 
584
  $timezone = null === $timezone ? self::wp_timezone_string() : $timezone;
585
 
586
  try {
@@ -589,6 +594,10 @@ class Tribe__Timezones {
589
  return new DateTimeZone( 'UTC' );
590
  }
591
 
 
 
 
 
592
  return $object;
593
  }
594
 
10
  const SITE_TIMEZONE = 'site';
11
  const EVENT_TIMEZONE = 'event';
12
 
 
13
  /**
14
  * Container for reusable DateTimeZone objects.
15
  *
17
  */
18
  protected static $timezones = array();
19
 
 
20
  public static function init() {
21
  self::invalidate_caches();
22
  }
579
  return $timezone;
580
  }
581
 
582
+ /** @var Tribe__Cache $cache */
583
+ $cache = tribe('cache');
584
+
585
+ if ( is_string( $timezone ) && $cached = $cache[ __METHOD__ . $timezone ] ) {
586
+ return clone $cached;
587
+ }
588
+
589
  $timezone = null === $timezone ? self::wp_timezone_string() : $timezone;
590
 
591
  try {
594
  return new DateTimeZone( 'UTC' );
595
  }
596
 
597
+ if ( is_string( $timezone ) ) {
598
+ $cache[ __METHOD__ . $timezone ] = $object;
599
+ }
600
+
601
  return $object;
602
  }
603
 
common/src/Tribe/Tooltip/View.php CHANGED
@@ -12,7 +12,7 @@ class View extends \Tribe__Template {
12
  /**
13
  * Where in the themes we will look for templates
14
  *
15
- * @since 4.10.0
16
  *
17
  * @var string
18
  */
12
  /**
13
  * Where in the themes we will look for templates
14
  *
15
+ * @since 4.10.2
16
  *
17
  * @var string
18
  */
common/src/Tribe/Utils/Collection_Trait.php CHANGED
@@ -168,4 +168,27 @@ trait Collection_Trait {
168
  public function seek( $position ) {
169
  $this->items_index = $position;
170
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  }
168
  public function seek( $position ) {
169
  $this->items_index = $position;
170
  }
171
+
172
+ /**
173
+ * Applies a filter callback to each element of this collection changing the collection elements to only those
174
+ * passing the filter.
175
+ *
176
+ * @since 4.10.2
177
+ *
178
+ * @param callable $filter_callback The filter callback that will be applied to each element of the collection; the
179
+ * callback will receive the element as parameter.
180
+ *
181
+ * @return Collection_Trait A new collection instance, that contains only the elements that passed the filter.
182
+ */
183
+ public function filter( $filter_callback ) {
184
+ if ( $this->count() === 0 ) {
185
+ // If there is nothing to filter to begin with, just return this.
186
+ return $this;
187
+ }
188
+
189
+ $filtered = new static();
190
+ $filtered->items = array_filter( $this->all(), $filter_callback );
191
+
192
+ return $filtered;
193
+ }
194
  }
common/src/Tribe/Utils/Lazy_Events.php CHANGED
@@ -131,7 +131,11 @@ trait Lazy_Events {
131
  *
132
  * @see Lazy_Events::resolved()
133
  */
134
- public function on_resolve( callable $callback ) {
 
 
 
 
135
  $this->lazy_resolve_callback = $callback;
136
 
137
  return $this;
131
  *
132
  * @see Lazy_Events::resolved()
133
  */
134
+ public function on_resolve( callable $callback = null ) {
135
+ if ( null === $callback ) {
136
+ return $this;
137
+ }
138
+
139
  $this->lazy_resolve_callback = $callback;
140
 
141
  return $this;
common/src/resources/css/common-full.css CHANGED
@@ -1241,7 +1241,8 @@
1241
  * Theme Overrides - Twenty Nineteen
1242
  * ------------------------------------------------------------------------- */
1243
 
1244
- .tribe-theme-twentynineteen .entry .tribe-common a {
 
1245
  text-decoration: none;
1246
  }
1247
 
1241
  * Theme Overrides - Twenty Nineteen
1242
  * ------------------------------------------------------------------------- */
1243
 
1244
+ .tribe-theme-twentynineteen .tribe-common a,
1245
+ .tribe-theme-twentynineteen .entry .tribe-common a {
1246
  text-decoration: none;
1247
  }
1248
 
common/src/resources/css/common-full.min.css CHANGED
@@ -1 +1 @@
1
- .tribe-common figure{line-height:0}.tribe-common figcaption{line-height:normal}.tribe-common a{background-color:transparent;-webkit-text-decoration-skip:objects}.tribe-common abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.tribe-common code,.tribe-common kbd,.tribe-common pre,.tribe-common samp{font-family:monospace;font-size:1em}.tribe-common b,.tribe-common strong{font-weight:inherit;font-weight:bolder}.tribe-common dfn{font-style:italic}.tribe-common mark{background-color:#ff0;color:#000}.tribe-common small{font-size:80%}.tribe-common sub,.tribe-common sup{font-size:75%;line-height:0}.tribe-common hr{border:0;height:0}.tribe-common button,.tribe-common input[type=button],.tribe-common input[type=email],.tribe-common input[type=password],.tribe-common input[type=reset],.tribe-common input[type=search],.tribe-common input[type=submit],.tribe-common input[type=text],.tribe-common input[type=url],.tribe-common textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none}.tribe-common button,.tribe-common input,.tribe-common optgroup,.tribe-common select,.tribe-common textarea{color:inherit;font:inherit;line-height:normal;-webkit-font-smoothing:antialiased}.tribe-common button,.tribe-common input,.tribe-common select,.tribe-common textarea{outline:0;border-radius:0}.tribe-common select:-moz-focusring{color:transparent;text-shadow:0 0 0 #000}.tribe-common optgroup{font-weight:700}.tribe-common h1,.tribe-common h2,.tribe-common h3,.tribe-common h4,.tribe-common h5,.tribe-common h6,.tribe-common p{font-weight:400;text-rendering:optimizeLegibility}.tribe-theme-twentynineteen .tribe-common h1:before,.tribe-theme-twentynineteen .tribe-common h2:before{content:none}.tribe-theme-twentynineteen .tribe-common button,.tribe-theme-twentynineteen .tribe-common input[type=button],.tribe-theme-twentynineteen .tribe-common input[type=reset],.tribe-theme-twentynineteen .tribe-common input[type=submit]{outline:none}.tribe-theme-twentynineteen .tribe-common td,.tribe-theme-twentynineteen .tribe-common th{word-break:normal}.tribe-theme-twentyseventeen .tribe-common h5{letter-spacing:normal;text-transform:none}.tribe-theme-twentyseventeen .tribe-common input[type=text]{border-radius:0}.tribe-theme-twentytwenty .tribe-common{background-color:#fff;letter-spacing:normal}.tribe-theme-twentytwenty .tribe-common input,.tribe-theme-twentytwenty .tribe-common textarea{letter-spacing:normal}.tribe-theme-twentytwenty .tribe-common *{word-break:normal}.tribe-common .tribe-common-form-control-checkbox,.tribe-common .tribe-common-form-control-radio{line-height:0}.tribe-common .tribe-common-form-control-checkbox__label,.tribe-common .tribe-common-form-control-radio__label{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:14px;line-height:1.62;font-weight:400;color:#727272}.tribe-common .tribe-common-form-control-checkbox__input,.tribe-common .tribe-common-form-control-radio__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #141827;height:20px;position:relative;width:20px}.tribe-common .tribe-common-form-control-checkbox__input:active,.tribe-common .tribe-common-form-control-checkbox__input:focus,.tribe-common .tribe-common-form-control-checkbox__input:hover,.tribe-common .tribe-common-form-control-radio__input:active,.tribe-common .tribe-common-form-control-radio__input:focus,.tribe-common .tribe-common-form-control-radio__input:hover{border:1px solid #141827}.tribe-common .tribe-common-form-control-checkbox__input:checked,.tribe-common .tribe-common-form-control-radio__input:checked{background-color:#141827}.tribe-common .tribe-common-form-control-checkbox__input:checked:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='9' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.6.1L3.9 6.8 1.4 4.3c-.1-.1-.3-.1-.4 0l-.8.8c-.1.1-.1.3 0 .4l3.4 3.4c.2.1.4.1.5 0l7.7-7.7c.1-.1.1-.3 0-.4L11 .1c-.1-.1-.3-.1-.4 0z' fill='%23FFF'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:contain;content:"";display:block;height:9px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:12px}.tribe-common .tribe-common-form-control-radio__input{border-radius:50%}.tribe-common .tribe-common-form-control-radio__input:checked:before{background-color:#fff;border-radius:50%;content:"";display:block;height:8px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:8px}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-checkbox__label,#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-radio__label{font-weight:400;font-size:14px}.tribe-common .tribe-common-form-control-slider{line-height:0}.tribe-common .tribe-common-form-control-slider__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:0}.tribe-common .tribe-common-form-control-slider__input::-webkit-slider-runnable-track{border:none;border-radius:5px;height:10px;margin:5px 0;padding:0;position:relative;transition:background-color .2s ease;background-color:#334aff}.tribe-common .tribe-common-form-control-slider__input::-moz-range-track{border:none;border-radius:5px;height:10px;margin:5px 0;padding:0;position:relative;transition:background-color .2s ease;background-color:#334aff}.tribe-common .tribe-common-form-control-slider__input::-ms-track{background-color:transparent;border-color:transparent;border-width:5px 0;color:transparent;height:10px}.tribe-common .tribe-common-form-control-slider__input::-ms-fill-lower,.tribe-common .tribe-common-form-control-slider__input::-ms-fill-upper{background-color:#334aff;border-radius:10px}.tribe-common .tribe-common-form-control-slider__input::-webkit-slider-thumb{background-color:#fff;border:1px solid #d5d5d5;border-radius:50%;box-shadow:0 2px 5px 0 rgba(0,0,0,.14);height:20px;width:20px;margin-top:-5px;-webkit-appearance:none;appearance:none}.tribe-common .tribe-common-form-control-slider__input::-moz-range-thumb{background-color:#fff;border:1px solid #d5d5d5;border-radius:50%;box-shadow:0 2px 5px 0 rgba(0,0,0,.14);height:20px;width:20px;margin-top:-5px}.tribe-common .tribe-common-form-control-slider__input::-ms-thumb{background-color:#fff;border:1px solid #d5d5d5;border-radius:50%;box-shadow:0 2px 5px 0 rgba(0,0,0,.14);height:20px;width:20px;margin-top:-5px;box-shadow:none;margin-top:-1px}.tribe-common .tribe-common-form-control-slider__label{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:12px;line-height:1.38;font-weight:400;color:#727272}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-slider__label{font-weight:400;font-size:12px}.tribe-common .tribe-common-form-control-text__input{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:16px;line-height:1.62;font-weight:400;border:0;border-bottom:1px solid #d5d5d5}.tribe-common .tribe-common-form-control-text__input::-webkit-input-placeholder{color:#727272;font-style:normal}.tribe-common .tribe-common-form-control-text__input::-moz-placeholder{color:#727272;font-style:normal}.tribe-common .tribe-common-form-control-text__input:-ms-input-placeholder,.tribe-common .tribe-common-form-control-text__input::-ms-input-placeholder{color:#727272;font-style:normal}.tribe-common .tribe-common-form-control-text__input::placeholder{color:#727272;font-style:normal}.tribe-common .tribe-common-form-control-text__input:focus{border-bottom-color:#141827;outline:0}.tribe-theme-twentyseventeen .tribe-common .tribe-common-form-control-text__input{color:#141827}.tribe-theme-twentytwenty .tribe-common .tribe-common-form-control-text__input{line-height:inherit}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-text__input{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:16px;line-height:1.62;font-weight:400;border:0;border-bottom:1px solid #d5d5d5}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-text__input:focus{border-bottom-color:#141827;box-shadow:none}.tribe-common .tribe-common-form-control-toggle{line-height:0}.tribe-common .tribe-common-form-control-toggle__input{border:none;border-radius:5px;height:10px;margin:5px 0;padding:0;position:relative;transition:background-color .2s ease;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#d5d5d5;width:40px}.tribe-common .tribe-common-form-control-toggle__input:after{background-color:#fff;border:1px solid #d5d5d5;border-radius:50%;box-shadow:0 2px 5px 0 rgba(0,0,0,.14);height:20px;width:20px;content:"";left:0;position:absolute;top:-5px;transition:transform .2s ease}.tribe-common .tribe-common-form-control-toggle__input:checked{background-color:#334aff}.tribe-common .tribe-common-form-control-toggle__input:checked:after{transform:translateX(20px)}.tribe-common .tribe-common-form-control-toggle__label{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:12px;line-height:1.38;font-weight:400;color:#727272}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-toggle__label{font-weight:400;font-size:12px}.tribe-common a,.tribe-common a:active,.tribe-common a:focus,.tribe-common a:hover,.tribe-common a:visited{color:#141827;outline:0;text-decoration:none}.tribe-theme-twentyseventeen .tribe-common a{box-shadow:none}.tribe-theme-twentyseventeen .tribe-common a:focus,.tribe-theme-twentyseventeen .tribe-common a:hover{box-shadow:none;color:#141827}.tribe-theme-twentynineteen .entry .tribe-common a{text-decoration:none}.tribe-common .tribe-common-anchor{border-bottom:2px solid transparent;transition:border-color .2s ease}.tribe-common .tribe-common-anchor:active,.tribe-common .tribe-common-anchor:focus,.tribe-common .tribe-common-anchor:hover{border-bottom:2px solid #141827}.tribe-common .tribe-common-anchor-alt{border-bottom:2px solid #334aff;color:#141827;transition:color .2s ease}.tribe-common .tribe-common-anchor-alt:active,.tribe-common .tribe-common-anchor-alt:focus,.tribe-common .tribe-common-anchor-alt:hover{border-bottom:2px solid #334aff;color:#334aff}.tribe-common .tribe-common-anchor-thin{border-bottom:1px solid transparent;transition:border-color .2s ease}.tribe-common .tribe-common-anchor-thin:active,.tribe-common .tribe-common-anchor-thin:focus,.tribe-common .tribe-common-anchor-thin:hover{border-bottom:1px solid #141827}.tribe-theme-twentyseventeen .tribe-common .tribe-common-anchor-alt:focus,.tribe-theme-twentyseventeen .tribe-common .tribe-common-anchor-alt:hover{color:#334aff}.tribe-common .tribe-common-b1{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:14px;font-weight:400;line-height:1.62}.tribe-common .tribe-common-b1--bold{font-weight:700}.tribe-common .tribe-common-b2{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:12px;font-weight:400;line-height:1.38}.tribe-common .tribe-common-b2--bold{font-weight:700}.tribe-common .tribe-common-b3{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:11px;font-weight:400;line-height:1.5}.tribe-common .tribe-common-b3--bold{font-weight:700}.tribe-common .tribe-common-cta{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:12px;line-height:1.38;font-weight:400;font-weight:700;border-bottom:2px solid transparent;transition:border-color .2s ease}.tribe-common .tribe-common-cta:active,.tribe-common .tribe-common-cta:focus,.tribe-common .tribe-common-cta:hover{border-bottom:2px solid #141827}.tribe-common .tribe-common-cta--alt{border-bottom:2px solid #334aff;color:#141827;transition:color .2s ease}.tribe-common .tribe-common-cta--alt:active,.tribe-common .tribe-common-cta--alt:focus,.tribe-common .tribe-common-cta--alt:hover{border-bottom:2px solid #334aff;color:#334aff}.tribe-common .tribe-common-cta--thin-alt{border-bottom:1px solid #334aff;color:#141827;transition:color .2s ease}.tribe-common .tribe-common-cta--thin-alt:active,.tribe-common .tribe-common-cta--thin-alt:focus,.tribe-common .tribe-common-cta--thin-alt:hover{border-bottom:1px solid #334aff;color:#334aff}.tribe-theme-twentyseventeen .tribe-common .tribe-common-cta--alt:focus,.tribe-theme-twentyseventeen .tribe-common .tribe-common-cta--alt:hover,.tribe-theme-twentyseventeen .tribe-common .tribe-common-cta--thin-alt:focus,.tribe-theme-twentyseventeen .tribe-common .tribe-common-cta--thin-alt:hover{color:#334aff}.tribe-common .tribe-common-h1{font-size:28px}.tribe-common .tribe-common-h1,.tribe-common .tribe-common-h2{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700;line-height:1.42}.tribe-common .tribe-common-h2{font-size:24px}.tribe-common .tribe-common-h3{font-size:22px;line-height:1.5}.tribe-common .tribe-common-h3,.tribe-common .tribe-common-h4{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700}.tribe-common .tribe-common-h4{font-size:20px;line-height:1.42}.tribe-common .tribe-common-h5{font-size:18px}.tribe-common .tribe-common-h5,.tribe-common .tribe-common-h6{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700;line-height:1.5}.tribe-common .tribe-common-h6{font-size:16px}.tribe-common .tribe-common-h7{font-size:14px;line-height:1.62}.tribe-common .tribe-common-h7,.tribe-common .tribe-common-h8{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700}.tribe-common .tribe-common-h8{font-size:12px;line-height:1.38}.tribe-common .tribe-common-h--alt{font-weight:400}.tribe-theme-avada #main .tribe-common .tribe-common-h1{font-size:28px}.tribe-theme-avada #main .tribe-common .tribe-common-h1,.tribe-theme-avada #main .tribe-common .tribe-common-h2{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h2{font-size:24px}.tribe-theme-avada #main .tribe-common .tribe-common-h3{font-size:22px;line-height:1.5}.tribe-theme-avada #main .tribe-common .tribe-common-h3,.tribe-theme-avada #main .tribe-common .tribe-common-h4{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700}.tribe-theme-avada #main .tribe-common .tribe-common-h4{font-size:20px;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h5{font-size:18px}.tribe-theme-avada #main .tribe-common .tribe-common-h5,.tribe-theme-avada #main .tribe-common .tribe-common-h6{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700;line-height:1.5}.tribe-theme-avada #main .tribe-common .tribe-common-h6{font-size:16px}.tribe-theme-avada #main .tribe-common .tribe-common-h7{font-size:14px;line-height:1.62}.tribe-theme-avada #main .tribe-common .tribe-common-h7,.tribe-theme-avada #main .tribe-common .tribe-common-h8{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700}.tribe-theme-avada #main .tribe-common .tribe-common-h8{font-size:12px;line-height:1.38}.tribe-theme-avada #main .tribe-common .tribe-common-h--alt{font-weight:400}.tribe-common button{border:none}.tribe-common button,.tribe-common button:focus,.tribe-common button:hover,.tribe-theme-twentyseventeen .tribe-common button:focus,.tribe-theme-twentyseventeen .tribe-common button:hover{background-color:transparent}.tribe-theme-twentytwenty .tribe-common button{background-color:transparent;text-transform:inherit}.tribe-theme-twentytwenty .tribe-common button:focus,.tribe-theme-twentytwenty .tribe-common button:hover{text-decoration:none}.tribe-common .tribe-common-svgicon--featured{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h16v20l-7.902-5.122L0 20z' fill='%23334AFF'/%3E%3C/svg%3E")}.tribe-theme-enfold .tribe-common th{letter-spacing:0;text-transform:none}.tribe-common .tribe-common-c-btn-border,.tribe-common a.tribe-common-c-btn-border{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:12px;line-height:1.38;font-weight:400;border:0;cursor:pointer;display:inline-block;height:auto;padding:0;text-decoration:none;width:auto;background-color:#fff;border:1px solid #d5d5d5;border-radius:4px;text-align:center;transition:color .2s ease,border-color .2s ease;color:#727272;padding:14px 20px}.tribe-common .tribe-common-c-btn-border:focus,.tribe-common .tribe-common-c-btn-border:hover,.tribe-common a.tribe-common-c-btn-border:focus,.tribe-common a.tribe-common-c-btn-border:hover{background-color:#fff}.tribe-common .tribe-common-c-btn-border:active,.tribe-common a.tribe-common-c-btn-border:active{border-color:#141827}.tribe-common .tribe-common-c-btn-border:active,.tribe-common .tribe-common-c-btn-border:focus,.tribe-common .tribe-common-c-btn-border:hover,.tribe-common a.tribe-common-c-btn-border:active,.tribe-common a.tribe-common-c-btn-border:focus,.tribe-common a.tribe-common-c-btn-border:hover{color:#141827}.tribe-common .tribe-common-c-btn-border:disabled,.tribe-common a.tribe-common-c-btn-border:disabled{color:#d5d5d5}.tribe-theme-twentyseventeen .tribe-common .tribe-common-c-btn-border:hover{background-color:#fff}.tribe-common .tribe-common-c-btn-icon{border:0;cursor:pointer;display:inline-block;height:auto;padding:0;text-decoration:none;width:auto}.tribe-common .tribe-common-c-btn-icon--border{background-color:#fff;border:1px solid #d5d5d5;align-items:center;display:inline-flex;height:56px;justify-content:center;transition:none;width:56px}.tribe-common .tribe-common-c-btn-icon--border:focus,.tribe-common .tribe-common-c-btn-icon--border:hover{background-color:#fff}.tribe-common .tribe-common-c-btn-icon--border:active{border-color:#141827}.tribe-theme-twentyseventeen .tribe-common .tribe-common-c-btn-icon--border:hover{background-color:#fff}.tribe-common .tribe-common-c-btn,.tribe-common a.tribe-common-c-btn{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:14px;line-height:1.62;font-weight:400;font-weight:700;border:0;cursor:pointer;display:inline-block;height:auto;padding:0;text-decoration:none;width:auto;border-radius:4px;color:#fff;text-align:center;transition:background-color .2s ease;padding:11px 20px;background-color:#334aff}.tribe-common .tribe-common-c-btn:focus,.tribe-common .tribe-common-c-btn:hover,.tribe-common a.tribe-common-c-btn:focus,.tribe-common a.tribe-common-c-btn:hover{background-color:rgba(51,74,255,.8)}.tribe-common .tribe-common-c-btn:active,.tribe-common a.tribe-common-c-btn:active{background-color:rgba(51,74,255,.9)}.tribe-common .tribe-common-c-btn:disabled,.tribe-common a.tribe-common-c-btn:disabled{background-color:rgba(51,74,255,.07)}.tribe-theme-twentyseventeen .tribe-common .tribe-common-c-btn:focus,.tribe-theme-twentyseventeen .tribe-common .tribe-common-c-btn:hover{background-color:rgba(51,74,255,.8);color:#fff}.tribe-theme-twentytwenty .tribe-common .tribe-common-c-btn{background-color:#334aff}.tribe-theme-twentytwenty .tribe-common .tribe-common-c-btn:focus,.tribe-theme-twentytwenty .tribe-common .tribe-common-c-btn:hover{background-color:rgba(51,74,255,.8);color:#fff}.tribe-common .tribe-common-c-loader__dot{animation-name:a;animation-duration:2.24s;animation-iteration-count:infinite;animation-direction:normal}.tribe-common .tribe-common-c-loader__dot--first{animation-delay:.45s}.tribe-common .tribe-common-c-loader__dot--second{animation-delay:1.05s}.tribe-common .tribe-common-c-loader__dot--third{animation-delay:1.35s}@keyframes a{50%{background-color:#334aff}}@media (min-width:768px){#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-text__input,.tribe-common .tribe-common-form-control-text__input{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:14px;line-height:1.62;font-weight:400;border:0}.tribe-common .tribe-common-b1{font-size:16px;line-height:1.62}.tribe-common .tribe-common-b2{font-size:14px;line-height:1.62}.tribe-common .tribe-common-b3{font-size:12px;line-height:1.38}.tribe-common .tribe-common-b1--min-medium{font-size:16px;line-height:1.62}.tribe-common .tribe-common-b2--min-medium{font-size:14px;line-height:1.62}.tribe-common .tribe-common-b3--min-medium{font-size:12px;line-height:1.38}.tribe-common .tribe-common-h1{font-size:42px;line-height:1.38}.tribe-common .tribe-common-h2{font-size:32px;line-height:1.38}.tribe-common .tribe-common-h3{font-size:28px;line-height:1.42}.tribe-common .tribe-common-h4{font-size:24px;line-height:1.42}.tribe-common .tribe-common-h6{font-size:16px;line-height:1.62}.tribe-common .tribe-common-h3--min-medium{font-size:28px;line-height:1.42}.tribe-common .tribe-common-h4--min-medium{font-size:24px;line-height:1.42}.tribe-common .tribe-common-h5--min-medium{font-size:18px;line-height:1.5}.tribe-common .tribe-common-h6--min-medium{font-size:16px;line-height:1.62}.tribe-common .tribe-common-h7--min-medium{font-size:14px;line-height:1.62}.tribe-theme-avada #main .tribe-common .tribe-common-h1{font-size:42px;line-height:1.38}.tribe-theme-avada #main .tribe-common .tribe-common-h2{font-size:32px;line-height:1.38}.tribe-theme-avada #main .tribe-common .tribe-common-h3{font-size:28px;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h4{font-size:24px;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h6{font-size:16px;line-height:1.62}.tribe-theme-avada #main .tribe-common .tribe-common-h3--min-medium{font-size:28px;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h4--min-medium{font-size:24px;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h5--min-medium{font-size:18px;line-height:1.5}.tribe-theme-avada #main .tribe-common .tribe-common-h6--min-medium{font-size:16px;line-height:1.62}.tribe-theme-avada #main .tribe-common .tribe-common-h7--min-medium{font-size:14px;line-height:1.62}.tribe-common .tribe-common-c-btn-border,.tribe-common a.tribe-common-c-btn-border{padding:6px 15px}}
1
+ .tribe-common figure{line-height:0}.tribe-common figcaption{line-height:normal}.tribe-common a{background-color:transparent;-webkit-text-decoration-skip:objects}.tribe-common abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.tribe-common code,.tribe-common kbd,.tribe-common pre,.tribe-common samp{font-family:monospace;font-size:1em}.tribe-common b,.tribe-common strong{font-weight:inherit;font-weight:bolder}.tribe-common dfn{font-style:italic}.tribe-common mark{background-color:#ff0;color:#000}.tribe-common small{font-size:80%}.tribe-common sub,.tribe-common sup{font-size:75%;line-height:0}.tribe-common hr{border:0;height:0}.tribe-common button,.tribe-common input[type=button],.tribe-common input[type=email],.tribe-common input[type=password],.tribe-common input[type=reset],.tribe-common input[type=search],.tribe-common input[type=submit],.tribe-common input[type=text],.tribe-common input[type=url],.tribe-common textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none}.tribe-common button,.tribe-common input,.tribe-common optgroup,.tribe-common select,.tribe-common textarea{color:inherit;font:inherit;line-height:normal;-webkit-font-smoothing:antialiased}.tribe-common button,.tribe-common input,.tribe-common select,.tribe-common textarea{outline:0;border-radius:0}.tribe-common select:-moz-focusring{color:transparent;text-shadow:0 0 0 #000}.tribe-common optgroup{font-weight:700}.tribe-common h1,.tribe-common h2,.tribe-common h3,.tribe-common h4,.tribe-common h5,.tribe-common h6,.tribe-common p{font-weight:400;text-rendering:optimizeLegibility}.tribe-theme-twentynineteen .tribe-common h1:before,.tribe-theme-twentynineteen .tribe-common h2:before{content:none}.tribe-theme-twentynineteen .tribe-common button,.tribe-theme-twentynineteen .tribe-common input[type=button],.tribe-theme-twentynineteen .tribe-common input[type=reset],.tribe-theme-twentynineteen .tribe-common input[type=submit]{outline:none}.tribe-theme-twentynineteen .tribe-common td,.tribe-theme-twentynineteen .tribe-common th{word-break:normal}.tribe-theme-twentyseventeen .tribe-common h5{letter-spacing:normal;text-transform:none}.tribe-theme-twentyseventeen .tribe-common input[type=text]{border-radius:0}.tribe-theme-twentytwenty .tribe-common{background-color:#fff;letter-spacing:normal}.tribe-theme-twentytwenty .tribe-common input,.tribe-theme-twentytwenty .tribe-common textarea{letter-spacing:normal}.tribe-theme-twentytwenty .tribe-common *{word-break:normal}.tribe-common .tribe-common-form-control-checkbox,.tribe-common .tribe-common-form-control-radio{line-height:0}.tribe-common .tribe-common-form-control-checkbox__label,.tribe-common .tribe-common-form-control-radio__label{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:14px;line-height:1.62;font-weight:400;color:#727272}.tribe-common .tribe-common-form-control-checkbox__input,.tribe-common .tribe-common-form-control-radio__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #141827;height:20px;position:relative;width:20px}.tribe-common .tribe-common-form-control-checkbox__input:active,.tribe-common .tribe-common-form-control-checkbox__input:focus,.tribe-common .tribe-common-form-control-checkbox__input:hover,.tribe-common .tribe-common-form-control-radio__input:active,.tribe-common .tribe-common-form-control-radio__input:focus,.tribe-common .tribe-common-form-control-radio__input:hover{border:1px solid #141827}.tribe-common .tribe-common-form-control-checkbox__input:checked,.tribe-common .tribe-common-form-control-radio__input:checked{background-color:#141827}.tribe-common .tribe-common-form-control-checkbox__input:checked:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='9' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.6.1L3.9 6.8 1.4 4.3c-.1-.1-.3-.1-.4 0l-.8.8c-.1.1-.1.3 0 .4l3.4 3.4c.2.1.4.1.5 0l7.7-7.7c.1-.1.1-.3 0-.4L11 .1c-.1-.1-.3-.1-.4 0z' fill='%23FFF'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:contain;content:"";display:block;height:9px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:12px}.tribe-common .tribe-common-form-control-radio__input{border-radius:50%}.tribe-common .tribe-common-form-control-radio__input:checked:before{background-color:#fff;border-radius:50%;content:"";display:block;height:8px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:8px}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-checkbox__label,#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-radio__label{font-weight:400;font-size:14px}.tribe-common .tribe-common-form-control-slider{line-height:0}.tribe-common .tribe-common-form-control-slider__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:0}.tribe-common .tribe-common-form-control-slider__input::-webkit-slider-runnable-track{border:none;border-radius:5px;height:10px;margin:5px 0;padding:0;position:relative;transition:background-color .2s ease;background-color:#334aff}.tribe-common .tribe-common-form-control-slider__input::-moz-range-track{border:none;border-radius:5px;height:10px;margin:5px 0;padding:0;position:relative;transition:background-color .2s ease;background-color:#334aff}.tribe-common .tribe-common-form-control-slider__input::-ms-track{background-color:transparent;border-color:transparent;border-width:5px 0;color:transparent;height:10px}.tribe-common .tribe-common-form-control-slider__input::-ms-fill-lower,.tribe-common .tribe-common-form-control-slider__input::-ms-fill-upper{background-color:#334aff;border-radius:10px}.tribe-common .tribe-common-form-control-slider__input::-webkit-slider-thumb{background-color:#fff;border:1px solid #d5d5d5;border-radius:50%;box-shadow:0 2px 5px 0 rgba(0,0,0,.14);height:20px;width:20px;margin-top:-5px;-webkit-appearance:none;appearance:none}.tribe-common .tribe-common-form-control-slider__input::-moz-range-thumb{background-color:#fff;border:1px solid #d5d5d5;border-radius:50%;box-shadow:0 2px 5px 0 rgba(0,0,0,.14);height:20px;width:20px;margin-top:-5px}.tribe-common .tribe-common-form-control-slider__input::-ms-thumb{background-color:#fff;border:1px solid #d5d5d5;border-radius:50%;box-shadow:0 2px 5px 0 rgba(0,0,0,.14);height:20px;width:20px;margin-top:-5px;box-shadow:none;margin-top:-1px}.tribe-common .tribe-common-form-control-slider__label{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:12px;line-height:1.38;font-weight:400;color:#727272}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-slider__label{font-weight:400;font-size:12px}.tribe-common .tribe-common-form-control-text__input{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:16px;line-height:1.62;font-weight:400;border:0;border-bottom:1px solid #d5d5d5}.tribe-common .tribe-common-form-control-text__input::-webkit-input-placeholder{color:#727272;font-style:normal}.tribe-common .tribe-common-form-control-text__input::-moz-placeholder{color:#727272;font-style:normal}.tribe-common .tribe-common-form-control-text__input:-ms-input-placeholder,.tribe-common .tribe-common-form-control-text__input::-ms-input-placeholder{color:#727272;font-style:normal}.tribe-common .tribe-common-form-control-text__input::placeholder{color:#727272;font-style:normal}.tribe-common .tribe-common-form-control-text__input:focus{border-bottom-color:#141827;outline:0}.tribe-theme-twentyseventeen .tribe-common .tribe-common-form-control-text__input{color:#141827}.tribe-theme-twentytwenty .tribe-common .tribe-common-form-control-text__input{line-height:inherit}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-text__input{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:16px;line-height:1.62;font-weight:400;border:0;border-bottom:1px solid #d5d5d5}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-text__input:focus{border-bottom-color:#141827;box-shadow:none}.tribe-common .tribe-common-form-control-toggle{line-height:0}.tribe-common .tribe-common-form-control-toggle__input{border:none;border-radius:5px;height:10px;margin:5px 0;padding:0;position:relative;transition:background-color .2s ease;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#d5d5d5;width:40px}.tribe-common .tribe-common-form-control-toggle__input:after{background-color:#fff;border:1px solid #d5d5d5;border-radius:50%;box-shadow:0 2px 5px 0 rgba(0,0,0,.14);height:20px;width:20px;content:"";left:0;position:absolute;top:-5px;transition:transform .2s ease}.tribe-common .tribe-common-form-control-toggle__input:checked{background-color:#334aff}.tribe-common .tribe-common-form-control-toggle__input:checked:after{transform:translateX(20px)}.tribe-common .tribe-common-form-control-toggle__label{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:12px;line-height:1.38;font-weight:400;color:#727272}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-toggle__label{font-weight:400;font-size:12px}.tribe-common a,.tribe-common a:active,.tribe-common a:focus,.tribe-common a:hover,.tribe-common a:visited{color:#141827;outline:0;text-decoration:none}.tribe-theme-twentyseventeen .tribe-common a{box-shadow:none}.tribe-theme-twentyseventeen .tribe-common a:focus,.tribe-theme-twentyseventeen .tribe-common a:hover{box-shadow:none;color:#141827}.tribe-theme-twentynineteen .entry .tribe-common a,.tribe-theme-twentynineteen .tribe-common a{text-decoration:none}.tribe-common .tribe-common-anchor{border-bottom:2px solid transparent;transition:border-color .2s ease}.tribe-common .tribe-common-anchor:active,.tribe-common .tribe-common-anchor:focus,.tribe-common .tribe-common-anchor:hover{border-bottom:2px solid #141827}.tribe-common .tribe-common-anchor-alt{border-bottom:2px solid #334aff;color:#141827;transition:color .2s ease}.tribe-common .tribe-common-anchor-alt:active,.tribe-common .tribe-common-anchor-alt:focus,.tribe-common .tribe-common-anchor-alt:hover{border-bottom:2px solid #334aff;color:#334aff}.tribe-common .tribe-common-anchor-thin{border-bottom:1px solid transparent;transition:border-color .2s ease}.tribe-common .tribe-common-anchor-thin:active,.tribe-common .tribe-common-anchor-thin:focus,.tribe-common .tribe-common-anchor-thin:hover{border-bottom:1px solid #141827}.tribe-theme-twentyseventeen .tribe-common .tribe-common-anchor-alt:focus,.tribe-theme-twentyseventeen .tribe-common .tribe-common-anchor-alt:hover{color:#334aff}.tribe-common .tribe-common-b1{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:14px;font-weight:400;line-height:1.62}.tribe-common .tribe-common-b1--bold{font-weight:700}.tribe-common .tribe-common-b2{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:12px;font-weight:400;line-height:1.38}.tribe-common .tribe-common-b2--bold{font-weight:700}.tribe-common .tribe-common-b3{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:11px;font-weight:400;line-height:1.5}.tribe-common .tribe-common-b3--bold{font-weight:700}.tribe-common .tribe-common-cta{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:12px;line-height:1.38;font-weight:400;font-weight:700;border-bottom:2px solid transparent;transition:border-color .2s ease}.tribe-common .tribe-common-cta:active,.tribe-common .tribe-common-cta:focus,.tribe-common .tribe-common-cta:hover{border-bottom:2px solid #141827}.tribe-common .tribe-common-cta--alt{border-bottom:2px solid #334aff;color:#141827;transition:color .2s ease}.tribe-common .tribe-common-cta--alt:active,.tribe-common .tribe-common-cta--alt:focus,.tribe-common .tribe-common-cta--alt:hover{border-bottom:2px solid #334aff;color:#334aff}.tribe-common .tribe-common-cta--thin-alt{border-bottom:1px solid #334aff;color:#141827;transition:color .2s ease}.tribe-common .tribe-common-cta--thin-alt:active,.tribe-common .tribe-common-cta--thin-alt:focus,.tribe-common .tribe-common-cta--thin-alt:hover{border-bottom:1px solid #334aff;color:#334aff}.tribe-theme-twentyseventeen .tribe-common .tribe-common-cta--alt:focus,.tribe-theme-twentyseventeen .tribe-common .tribe-common-cta--alt:hover,.tribe-theme-twentyseventeen .tribe-common .tribe-common-cta--thin-alt:focus,.tribe-theme-twentyseventeen .tribe-common .tribe-common-cta--thin-alt:hover{color:#334aff}.tribe-common .tribe-common-h1{font-size:28px}.tribe-common .tribe-common-h1,.tribe-common .tribe-common-h2{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700;line-height:1.42}.tribe-common .tribe-common-h2{font-size:24px}.tribe-common .tribe-common-h3{font-size:22px;line-height:1.5}.tribe-common .tribe-common-h3,.tribe-common .tribe-common-h4{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700}.tribe-common .tribe-common-h4{font-size:20px;line-height:1.42}.tribe-common .tribe-common-h5{font-size:18px}.tribe-common .tribe-common-h5,.tribe-common .tribe-common-h6{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700;line-height:1.5}.tribe-common .tribe-common-h6{font-size:16px}.tribe-common .tribe-common-h7{font-size:14px;line-height:1.62}.tribe-common .tribe-common-h7,.tribe-common .tribe-common-h8{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700}.tribe-common .tribe-common-h8{font-size:12px;line-height:1.38}.tribe-common .tribe-common-h--alt{font-weight:400}.tribe-theme-avada #main .tribe-common .tribe-common-h1{font-size:28px}.tribe-theme-avada #main .tribe-common .tribe-common-h1,.tribe-theme-avada #main .tribe-common .tribe-common-h2{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h2{font-size:24px}.tribe-theme-avada #main .tribe-common .tribe-common-h3{font-size:22px;line-height:1.5}.tribe-theme-avada #main .tribe-common .tribe-common-h3,.tribe-theme-avada #main .tribe-common .tribe-common-h4{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700}.tribe-theme-avada #main .tribe-common .tribe-common-h4{font-size:20px;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h5{font-size:18px}.tribe-theme-avada #main .tribe-common .tribe-common-h5,.tribe-theme-avada #main .tribe-common .tribe-common-h6{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700;line-height:1.5}.tribe-theme-avada #main .tribe-common .tribe-common-h6{font-size:16px}.tribe-theme-avada #main .tribe-common .tribe-common-h7{font-size:14px;line-height:1.62}.tribe-theme-avada #main .tribe-common .tribe-common-h7,.tribe-theme-avada #main .tribe-common .tribe-common-h8{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-weight:700}.tribe-theme-avada #main .tribe-common .tribe-common-h8{font-size:12px;line-height:1.38}.tribe-theme-avada #main .tribe-common .tribe-common-h--alt{font-weight:400}.tribe-common button{border:none}.tribe-common button,.tribe-common button:focus,.tribe-common button:hover,.tribe-theme-twentyseventeen .tribe-common button:focus,.tribe-theme-twentyseventeen .tribe-common button:hover{background-color:transparent}.tribe-theme-twentytwenty .tribe-common button{background-color:transparent;text-transform:inherit}.tribe-theme-twentytwenty .tribe-common button:focus,.tribe-theme-twentytwenty .tribe-common button:hover{text-decoration:none}.tribe-common .tribe-common-svgicon--featured{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h16v20l-7.902-5.122L0 20z' fill='%23334AFF'/%3E%3C/svg%3E")}.tribe-theme-enfold .tribe-common th{letter-spacing:0;text-transform:none}.tribe-common .tribe-common-c-btn-border,.tribe-common a.tribe-common-c-btn-border{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:12px;line-height:1.38;font-weight:400;border:0;cursor:pointer;display:inline-block;height:auto;padding:0;text-decoration:none;width:auto;background-color:#fff;border:1px solid #d5d5d5;border-radius:4px;text-align:center;transition:color .2s ease,border-color .2s ease;color:#727272;padding:14px 20px}.tribe-common .tribe-common-c-btn-border:focus,.tribe-common .tribe-common-c-btn-border:hover,.tribe-common a.tribe-common-c-btn-border:focus,.tribe-common a.tribe-common-c-btn-border:hover{background-color:#fff}.tribe-common .tribe-common-c-btn-border:active,.tribe-common a.tribe-common-c-btn-border:active{border-color:#141827}.tribe-common .tribe-common-c-btn-border:active,.tribe-common .tribe-common-c-btn-border:focus,.tribe-common .tribe-common-c-btn-border:hover,.tribe-common a.tribe-common-c-btn-border:active,.tribe-common a.tribe-common-c-btn-border:focus,.tribe-common a.tribe-common-c-btn-border:hover{color:#141827}.tribe-common .tribe-common-c-btn-border:disabled,.tribe-common a.tribe-common-c-btn-border:disabled{color:#d5d5d5}.tribe-theme-twentyseventeen .tribe-common .tribe-common-c-btn-border:hover{background-color:#fff}.tribe-common .tribe-common-c-btn-icon{border:0;cursor:pointer;display:inline-block;height:auto;padding:0;text-decoration:none;width:auto}.tribe-common .tribe-common-c-btn-icon--border{background-color:#fff;border:1px solid #d5d5d5;align-items:center;display:inline-flex;height:56px;justify-content:center;transition:none;width:56px}.tribe-common .tribe-common-c-btn-icon--border:focus,.tribe-common .tribe-common-c-btn-icon--border:hover{background-color:#fff}.tribe-common .tribe-common-c-btn-icon--border:active{border-color:#141827}.tribe-theme-twentyseventeen .tribe-common .tribe-common-c-btn-icon--border:hover{background-color:#fff}.tribe-common .tribe-common-c-btn,.tribe-common a.tribe-common-c-btn{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:14px;line-height:1.62;font-weight:400;font-weight:700;border:0;cursor:pointer;display:inline-block;height:auto;padding:0;text-decoration:none;width:auto;border-radius:4px;color:#fff;text-align:center;transition:background-color .2s ease;padding:11px 20px;background-color:#334aff}.tribe-common .tribe-common-c-btn:focus,.tribe-common .tribe-common-c-btn:hover,.tribe-common a.tribe-common-c-btn:focus,.tribe-common a.tribe-common-c-btn:hover{background-color:rgba(51,74,255,.8)}.tribe-common .tribe-common-c-btn:active,.tribe-common a.tribe-common-c-btn:active{background-color:rgba(51,74,255,.9)}.tribe-common .tribe-common-c-btn:disabled,.tribe-common a.tribe-common-c-btn:disabled{background-color:rgba(51,74,255,.07)}.tribe-theme-twentyseventeen .tribe-common .tribe-common-c-btn:focus,.tribe-theme-twentyseventeen .tribe-common .tribe-common-c-btn:hover{background-color:rgba(51,74,255,.8);color:#fff}.tribe-theme-twentytwenty .tribe-common .tribe-common-c-btn{background-color:#334aff}.tribe-theme-twentytwenty .tribe-common .tribe-common-c-btn:focus,.tribe-theme-twentytwenty .tribe-common .tribe-common-c-btn:hover{background-color:rgba(51,74,255,.8);color:#fff}.tribe-common .tribe-common-c-loader__dot{animation-name:a;animation-duration:2.24s;animation-iteration-count:infinite;animation-direction:normal}.tribe-common .tribe-common-c-loader__dot--first{animation-delay:.45s}.tribe-common .tribe-common-c-loader__dot--second{animation-delay:1.05s}.tribe-common .tribe-common-c-loader__dot--third{animation-delay:1.35s}@keyframes a{50%{background-color:#334aff}}@media (min-width:768px){#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-text__input,.tribe-common .tribe-common-form-control-text__input{color:#141827;font-family:Helvetica Neue,Helvetica,-apple-system,BlinkMacSystemFont,Roboto,Arial,sans-serif;font-size:14px;line-height:1.62;font-weight:400;border:0}.tribe-common .tribe-common-b1{font-size:16px;line-height:1.62}.tribe-common .tribe-common-b2{font-size:14px;line-height:1.62}.tribe-common .tribe-common-b3{font-size:12px;line-height:1.38}.tribe-common .tribe-common-b1--min-medium{font-size:16px;line-height:1.62}.tribe-common .tribe-common-b2--min-medium{font-size:14px;line-height:1.62}.tribe-common .tribe-common-b3--min-medium{font-size:12px;line-height:1.38}.tribe-common .tribe-common-h1{font-size:42px;line-height:1.38}.tribe-common .tribe-common-h2{font-size:32px;line-height:1.38}.tribe-common .tribe-common-h3{font-size:28px;line-height:1.42}.tribe-common .tribe-common-h4{font-size:24px;line-height:1.42}.tribe-common .tribe-common-h6{font-size:16px;line-height:1.62}.tribe-common .tribe-common-h3--min-medium{font-size:28px;line-height:1.42}.tribe-common .tribe-common-h4--min-medium{font-size:24px;line-height:1.42}.tribe-common .tribe-common-h5--min-medium{font-size:18px;line-height:1.5}.tribe-common .tribe-common-h6--min-medium{font-size:16px;line-height:1.62}.tribe-common .tribe-common-h7--min-medium{font-size:14px;line-height:1.62}.tribe-theme-avada #main .tribe-common .tribe-common-h1{font-size:42px;line-height:1.38}.tribe-theme-avada #main .tribe-common .tribe-common-h2{font-size:32px;line-height:1.38}.tribe-theme-avada #main .tribe-common .tribe-common-h3{font-size:28px;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h4{font-size:24px;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h6{font-size:16px;line-height:1.62}.tribe-theme-avada #main .tribe-common .tribe-common-h3--min-medium{font-size:28px;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h4--min-medium{font-size:24px;line-height:1.42}.tribe-theme-avada #main .tribe-common .tribe-common-h5--min-medium{font-size:18px;line-height:1.5}.tribe-theme-avada #main .tribe-common .tribe-common-h6--min-medium{font-size:16px;line-height:1.62}.tribe-theme-avada #main .tribe-common .tribe-common-h7--min-medium{font-size:14px;line-height:1.62}.tribe-common .tribe-common-c-btn-border,.tribe-common a.tribe-common-c-btn-border{padding:6px 15px}}
common/src/resources/css/common-skeleton.css CHANGED
@@ -1033,6 +1033,15 @@
1033
  width: 100%;
1034
  }
1035
 
 
 
 
 
 
 
 
 
 
1036
  /* -----------------------------------------------------------------------------
1037
  *
1038
  * Grid: Rows
@@ -1062,6 +1071,22 @@
1062
  padding-right: 21px;
1063
  }
1064
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1065
  /* Typography */
1066
 
1067
  .tribe-common {
@@ -1683,6 +1708,16 @@
1683
  padding-right: 24px
1684
  }
1685
 
 
 
 
 
 
 
 
 
 
 
1686
  .tribe-common .tribe-common-l-container {
1687
  padding-left: 42px;
1688
  padding-right: 42px
1033
  width: 100%;
1034
  }
1035
 
1036
+ .tribe-common {
1037
+
1038
+ /* -------------------------------------------------------------------------
1039
+ *
1040
+ * Grid Rows: Theme Overrides
1041
+ *
1042
+ * ------------------------------------------------------------------------- */
1043
+ }
1044
+
1045
  /* -----------------------------------------------------------------------------
1046
  *
1047
  * Grid: Rows
1071
  padding-right: 21px;
1072
  }
1073
 
1074
+ /* -----------------------------------------------------------------------------
1075
+ * Theme Overrides - Twenty Nineteen
1076
+ * ----------------------------------------------------------------------------- */
1077
+
1078
+ .tribe-theme-twentynineteen .tribe-common .entry.tribe-common-g-row--gutters {
1079
+ margin-left: -21px;
1080
+ margin-right: -21px;
1081
+ padding: 0;
1082
+ }
1083
+
1084
+ .tribe-theme-twentynineteen .tribe-common .tribe-common-g-row--gutters > .entry.tribe-common-g-col {
1085
+ margin: 0;
1086
+ padding-left: 21px;
1087
+ padding-right: 21px;
1088
+ }
1089
+
1090
  /* Typography */
1091
 
1092
  .tribe-common {
1708
  padding-right: 24px
1709
  }
1710
 
1711
+ .tribe-theme-twentynineteen .tribe-common .entry.tribe-common-g-row--gutters {
1712
+ margin-left: -24px;
1713
+ margin-right: -24px
1714
+ }
1715
+
1716
+ .tribe-theme-twentynineteen .tribe-common .tribe-common-g-row--gutters > .entry.tribe-common-g-col {
1717
+ padding-left: 24px;
1718
+ padding-right: 24px
1719
+ }
1720
+
1721
  .tribe-common .tribe-common-l-container {
1722
  padding-left: 42px;
1723
  padding-right: 42px
common/src/resources/css/common-skeleton.min.css CHANGED
@@ -1 +1 @@
1
- .tribe-common{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:antialiased}.tribe-common *{box-sizing:border-box}.tribe-common article,.tribe-common aside,.tribe-common details,.tribe-common figcaption,.tribe-common figure,.tribe-common footer,.tribe-common header,.tribe-common main,.tribe-common menu,.tribe-common nav,.tribe-common section,.tribe-common summary{display:block}.tribe-common svg:not(:root){overflow:hidden}.tribe-common audio,.tribe-common canvas,.tribe-common progress,.tribe-common video{display:inline-block}.tribe-common audio:not([controls]){display:none;height:0}.tribe-common progress{vertical-align:baseline}.tribe-common [hidden],.tribe-common template{display:none}.tribe-common pre{overflow:auto}.tribe-common sub,.tribe-common sup{position:relative;vertical-align:baseline}.tribe-common sup{top:-.5em}.tribe-common sub{bottom:-.25em}.tribe-common button,.tribe-common input,.tribe-common select,.tribe-common textarea{box-sizing:border-box;margin:0}.tribe-common input[type=number]::-webkit-inner-spin-button,.tribe-common input[type=number]::-webkit-outer-spin-button{height:auto}.tribe-common legend{color:inherit;display:table;max-width:100%;white-space:normal}.tribe-common textarea{resize:none;overflow:auto}.tribe-common button,.tribe-common input[type=button],.tribe-common input[type=reset],.tribe-common input[type=submit]{cursor:pointer;overflow:visible}.tribe-common button[disabled],.tribe-common input[disabled]{cursor:default}.tribe-common button::-moz-focus-inner,.tribe-common input::-moz-focus-inner{border:0;padding:0}.tribe-common a,.tribe-common abbr,.tribe-common acronym,.tribe-common address,.tribe-common applet,.tribe-common article,.tribe-common aside,.tribe-common audio,.tribe-common b,.tribe-common big,.tribe-common blockquote,.tribe-common canvas,.tribe-common caption,.tribe-common center,.tribe-common cite,.tribe-common code,.tribe-common dd,.tribe-common del,.tribe-common details,.tribe-common dfn,.tribe-common div,.tribe-common dl,.tribe-common dt,.tribe-common em,.tribe-common embed,.tribe-common fieldset,.tribe-common figcaption,.tribe-common figure,.tribe-common footer,.tribe-common form,.tribe-common h1,.tribe-common h2,.tribe-common h3,.tribe-common h4,.tribe-common h5,.tribe-common h6,.tribe-common header,.tribe-common i,.tribe-common iframe,.tribe-common img,.tribe-common ins,.tribe-common kbd,.tribe-common label,.tribe-common legend,.tribe-common li,.tribe-common main,.tribe-common mark,.tribe-common menu,.tribe-common nav,.tribe-common object,.tribe-common ol,.tribe-common output,.tribe-common p,.tribe-common pre,.tribe-common q,.tribe-common ruby,.tribe-common s,.tribe-common samp,.tribe-common section,.tribe-common small,.tribe-common span,.tribe-common strike,.tribe-common strong,.tribe-common sub,.tribe-common summary,.tribe-common sup,.tribe-common table,.tribe-common tbody,.tribe-common td,.tribe-common tfoot,.tribe-common th,.tribe-common thead,.tribe-common time,.tribe-common tr,.tribe-common tt,.tribe-common u,.tribe-common ul,.tribe-common var,.tribe-common video{margin:0;padding:0;border:0}.tribe-common ol,.tribe-common ul{list-style:none}.tribe-common img{-ms-interpolation-mode:bicubic;height:auto;max-width:100%;border-style:none}.tribe-common embed,.tribe-common iframe,.tribe-common video{max-width:100%;max-height:100%}.tribe-theme-avada input[type=text]{margin:0}.tribe-theme-divi .entry-content .tribe-common table,.tribe-theme-divibody.et-pb-preview #main-content .container .tribe-common table{border:0;margin:0}.tribe-theme-divi .entry-content .tribe-common td,.tribe-theme-divibody.et-pb-preview #main-content .container .tribe-common td{border:0}.tribe-theme-divi #content-area .tribe-common td,.tribe-theme-divi #content-area .tribe-common th,.tribe-theme-divi #content-area .tribe-common tr{padding:0}#top.tribe-theme-enfold .tribe-common form,#top.tribe-theme-enfold .tribe-common input{margin:0}.tribe-common .tribe-common-form-control-checkbox__label,.tribe-common .tribe-common-form-control-radio__label{cursor:pointer;display:inline-block;margin-left:11px;vertical-align:middle}.tribe-common .tribe-common-form-control-checkbox__input,.tribe-common .tribe-common-form-control-radio__input{cursor:pointer;display:inline-block;margin:0;vertical-align:middle}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-checkbox__input{display:inline-block}.tribe-common .tribe-common-form-control-checkbox-radio-group>*{margin-bottom:15px}.tribe-common .tribe-common-form-control-checkbox-radio-group>:last-child{margin-bottom:0}.tribe-common .tribe-common-form-control-slider__input{cursor:pointer;display:inline-block;margin:0;padding:0;width:120px;vertical-align:middle}.tribe-common .tribe-common-form-control-slider__label{cursor:pointer;display:inline-block;margin-left:11px;vertical-align:middle}.tribe-common .tribe-common-form-control-slider--vertical .tribe-common-form-control-slider__label{display:block;margin:0 0 6px}.tribe-common .tribe-common-form-control-text__label{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.tribe-common .tribe-common-form-control-text__input{height:auto;padding:12px 28px 12px 0;width:100%}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-text__input{padding:12px 28px 12px 0;width:100%}.tribe-common .tribe-common-form-control-toggle__input,.tribe-common .tribe-common-form-control-toggle__label{cursor:pointer;display:inline-block;vertical-align:middle}.tribe-common .tribe-common-form-control-toggle__label{margin-left:11px}.tribe-common .tribe-common-form-control-toggle--vertical .tribe-common-form-control-toggle__label{display:block;margin:0 0 6px}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-toggle__input{display:inline-block;margin:5px 0}.tribe-common .tribe-common-g-col{min-width:0;width:100%}.tribe-common .tribe-common-g-row{display:flex;flex-wrap:wrap}.tribe-common .tribe-common-g-row--gutters{margin-left:-21px;margin-right:-21px}.tribe-common .tribe-common-g-row--gutters>.tribe-common-g-col{padding-left:21px;padding-right:21px}.tribe-common a{cursor:pointer}.tribe-theme-divi #left-area .tribe-common ul,.tribe-theme-divi .entry-content .tribe-common ul,body.et-pb-preview.tribe-theme-divi #main-content .container .tribe-common ul{list-style-type:none;padding:0}.tribe-common button{padding:0}.tribe-common .tribe-common-l-container{max-width:1260px;margin-left:auto;margin-right:auto;padding-left:19.5px;padding-right:19.5px;width:100%}.tribe-common .tribe-common-svgicon{background-repeat:no-repeat;background-size:contain}.tribe-common .tribe-common-svgicon--close-secondary{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M16 2L2 16m14 0L2 2' stroke='%23BABABA' fill='none' fill-rule='evenodd' stroke-linecap='square' stroke-width='2'/%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--day{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='21' height='21' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 .503v19.994c0 .278.19.503.424.503h20.152c.234 0 .424-.225.424-.503V.503C21 .225 20.81 0 20.576 0H.424C.19 0 0 .225 0 .503zm1.156.943h18.66v2.7H1.157v-2.7zm0 4.023h18.66V19.55H1.157V5.469zM14.18 14.53v1.747c0 .482.39.874.873.874H16.8a.873.873 0 0 0 .873-.874V14.53a.873.873 0 0 0-.873-.873h-1.747a.873.873 0 0 0-.873.873z' fill='%23141827'/%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--list{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='21' height='18' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23141827'%3E%3Cpath d='M19.883 3.272c.342 0 .622-.21.622-.467v-.464c0-.257-.28-.467-.622-.467H7.127c-.342 0-.622.21-.622.467v.464c0 .257.28.467.622.467h12.756zm-18.045.935a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5zM19.883 9.98c.342 0 .622-.21.622-.466v-.465c0-.257-.28-.467-.622-.467H7.127c-.342 0-.622.21-.622.467v.465c0 .256.28.466.622.466h12.756zm-18.045.936a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5zM19.883 16.689c.342 0 .622-.21.622-.467v-.465c0-.256-.28-.466-.622-.466H7.127c-.342 0-.622.21-.622.466v.465c0 .257.28.467.622.467h12.756zm-18.045.935a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5z'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--map{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='22' height='21' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd' stroke='%23141827'%3E%3Cpath stroke-linejoin='round' d='M13.921 11.632H17.5l3.588 8.421H1l3.488-8.421h4.016'/%3E%3Cpath d='M11.32 15.506c.2-.248 4.93-6.108 4.93-9.04 0-3.015-2.305-5.468-5.138-5.468-2.833 0-5.138 2.453-5.138 5.467 0 2.933 4.729 8.793 4.93 9.041a.268.268 0 0 0 .208.101c.08 0 .155-.037.207-.101zm-4.797-9.04c0-2.693 2.058-4.883 4.589-4.883 2.53 0 4.588 2.19 4.588 4.882 0 2.387-3.667 7.22-4.588 8.397-.922-1.177-4.589-6.009-4.589-8.397z' stroke-width='.4' fill='%23141827' fill-rule='nonzero'/%3E%3Cpath d='M12.85 6.477c0-1.007-.78-1.826-1.738-1.826-.96 0-1.74.819-1.74 1.826 0 1.007.78 1.826 1.74 1.826.959 0 1.739-.82 1.739-1.826zm-3.15 0c0-.817.633-1.482 1.412-1.482.778 0 1.41.665 1.41 1.482s-.632 1.482-1.41 1.482c-.779 0-1.412-.665-1.412-1.482z' stroke-width='.7' fill='%23000' fill-rule='nonzero'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--month{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='22' height='22' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.637 1.063v19.879c0 .276.189.5.422.5h20.037c.232 0 .421-.224.421-.5V1.062c0-.275-.189-.5-.421-.5H1.059c-.233 0-.422.225-.422.5zM1.787 2H20.34v2.685H1.787V2zm0 4H20.34v14H1.787V6zM8 8.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm-8 4v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm-12 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm0 4v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5z' fill='%23141827'/%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--no-map{background-image:svg-inline(no-map)}.tribe-common .tribe-common-svgicon--photo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='17' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23141827'%3E%3Cpath d='M19.348.11H.634a.509.509 0 0 0-.52.508v15.017c0 .284.23.508.52.508h18.714a.51.51 0 0 0 .52-.508V.618a.509.509 0 0 0-.52-.508zm-.54 1.035v10.837l-2.87-3.084c-.583-.61-1.664-.61-2.246 0l-1.393 1.481-4.034-4.525a1.625 1.625 0 0 0-1.227-.528 1.6 1.6 0 0 0-1.206.548l-4.657 5.175V1.145h17.632zM1.174 15.108v-2.496l5.448-6.089a.529.529 0 0 1 .415-.182c.146 0 .333.06.437.182l4.429 4.972c.104.102.25.183.395.183.166.02.291-.06.395-.162l1.788-1.908c.167-.183.5-.183.686 0l3.66 3.917v1.603H1.175v-.02z'/%3E%3Cpath d='M14.19 5.757c1.044 0 1.91-.872 1.91-1.968s-.846-1.969-1.91-1.969c-1.062 0-1.909.873-1.909 1.969s.866 1.968 1.91 1.968zm0-2.902c.493 0 .907.427.907.934 0 .507-.414.933-.906.933-.492 0-.906-.426-.906-.933 0-.507.414-.934.906-.934z'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--week{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='21' height='21' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 .503v19.994c0 .278.19.503.424.503h20.152c.234 0 .424-.225.424-.503V.503C21 .225 20.81 0 20.576 0H.424C.19 0 0 .225 0 .503zm1.156.943h18.66v2.7H1.157v-2.7zm0 4.023h18.66V19.55H1.157V5.469zm6.25 6.537v1.006c0 .278.224.503.502.503h1.006a.503.503 0 0 0 .503-.503v-1.006a.503.503 0 0 0-.503-.502H7.908a.503.503 0 0 0-.503.502zm4.022 0v1.006c0 .278.225.503.503.503h1.006a.503.503 0 0 0 .503-.503v-1.006a.503.503 0 0 0-.503-.502H11.93a.503.503 0 0 0-.503.502zm4.023 0v1.006c0 .278.225.503.503.503h1.006a.503.503 0 0 0 .503-.503v-1.006a.503.503 0 0 0-.503-.502h-1.006a.503.503 0 0 0-.503.502zm-12.069 0v1.006c0 .278.225.503.503.503h1.006a.503.503 0 0 0 .503-.503v-1.006a.503.503 0 0 0-.503-.502H3.885a.503.503 0 0 0-.503.502z' fill='%23141827'/%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--featured{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h16v20l-7.902-5.122L0 20z' fill='%23141827'/%3E%3C/svg%3E");height:10px;width:8px}.tribe-common .tribe-common-svgicon--recurring{background-image:svg-inline(recurring-active);height:10px;width:10px}.tribe-common .tribe-common-svgicon--search{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 18.711l-6.044-6.044a7.782 7.782 0 0 0 1.688-4.845c0-2.089-.822-4.044-2.288-5.533C11.866.822 9.91 0 7.822 0S3.778.822 2.29 2.289A7.801 7.801 0 0 0 0 7.822c0 2.09.822 4.045 2.289 5.534a7.801 7.801 0 0 0 5.533 2.288c1.778 0 3.467-.6 4.845-1.688L18.71 20 20 18.711zM3.578 12.067c-2.334-2.334-2.334-6.156 0-8.49a5.968 5.968 0 0 1 4.244-1.755c1.6 0 3.111.622 4.245 1.756 2.333 2.333 2.333 6.155 0 8.489a5.968 5.968 0 0 1-4.245 1.755c-1.6 0-3.11-.622-4.244-1.755z' fill='%23727272'/%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--filters{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17'%3E%3Cg fill='none' fill-rule='evenodd' stroke='%23727272' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' transform='translate(1 1)'%3E%3Cpath d='M3 3V0m0 15v-2'/%3E%3Ccircle cx='3' cy='9' r='3'/%3E%3Cpath d='M12 9v6'/%3E%3Ccircle cx='12' cy='3' r='3' transform='matrix(1 0 0 -1 0 6)'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--close{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M16 2L2 16m14 0L2 2' stroke='%23727272' fill='none' fill-rule='evenodd' stroke-linecap='square' stroke-width='2'/%3E%3C/svg%3E")}.tribe-common .tribe-common-a11y-hidden{display:none!important;visibility:hidden}.tribe-common .tribe-common-a11y-visual-hide,.tribe-common .tribe-common-a11y-visual-show{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.tribe-common .tribe-common-c-btn-border,.tribe-common a.tribe-common-c-btn-border{padding:14px 20px;width:100%}.tribe-common .tribe-common-c-btn-icon:before{background-repeat:no-repeat;background-size:contain;content:"";display:block}.tribe-common .tribe-common-c-btn-icon--caret-left:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.916 17.841L10 19.757l-9.9-9.9L10-.041l1.916 1.916-7.983 7.984z' fill='%23BABABA'/%3E%3C/svg%3E");height:20px;width:12px}.tribe-common .tribe-common-c-btn-icon--caret-left:active:before,.tribe-common .tribe-common-c-btn-icon--caret-left:focus:before,.tribe-common .tribe-common-c-btn-icon--caret-left:hover:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.916 17.841L10 19.757l-9.9-9.9L10-.041l1.916 1.916-7.983 7.984z' fill='%23727272'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--caret-left:disabled:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.916 17.841L10 19.757l-9.9-9.9L10-.041l1.916 1.916-7.983 7.984z' fill='%23D5D5D5'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--caret-right:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.084 2.159L2 .243l9.9 9.9L2 20.041.084 18.126l7.983-7.984z' fill='%23BABABA'/%3E%3C/svg%3E");height:20px;width:12px}.tribe-common .tribe-common-c-btn-icon--caret-right:active:before,.tribe-common .tribe-common-c-btn-icon--caret-right:focus:before,.tribe-common .tribe-common-c-btn-icon--caret-right:hover:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.084 2.159L2 .243l9.9 9.9L2 20.041.084 18.126l7.983-7.984z' fill='%23727272'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--caret-right:disabled:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.084 2.159L2 .243l9.9 9.9L2 20.041.084 18.126l7.983-7.984z' fill='%23D5D5D5'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--filters:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17'%3E%3Cg fill='none' fill-rule='evenodd' stroke='%23727272' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' transform='translate(1 1)'%3E%3Cpath d='M3 3V0m0 15v-2'/%3E%3Ccircle cx='3' cy='9' r='3'/%3E%3Cpath d='M12 9v6'/%3E%3Ccircle cx='12' cy='3' r='3' transform='matrix(1 0 0 -1 0 6)'/%3E%3C/g%3E%3C/svg%3E");height:20px;width:24px}.tribe-common .tribe-common-c-btn-icon--filters:active:before,.tribe-common .tribe-common-c-btn-icon--filters:focus:before,.tribe-common .tribe-common-c-btn-icon--filters:hover:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17'%3E%3Cg fill='none' fill-rule='evenodd' stroke='%23141827' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' transform='translate(1 1)'%3E%3Cpath d='M3 3V0m0 15v-2'/%3E%3Ccircle cx='3' cy='9' r='3'/%3E%3Cpath d='M12 9v6'/%3E%3Ccircle cx='12' cy='3' r='3' transform='matrix(1 0 0 -1 0 6)'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--filters:disabled:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17'%3E%3Cg fill='none' fill-rule='evenodd' stroke='%23D5D5D5' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' transform='translate(1 1)'%3E%3Cpath d='M3 3V0m0 15v-2'/%3E%3Ccircle cx='3' cy='9' r='3'/%3E%3Cpath d='M12 9v6'/%3E%3Ccircle cx='12' cy='3' r='3' transform='matrix(1 0 0 -1 0 6)'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--search:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 18.711l-6.044-6.044a7.782 7.782 0 0 0 1.688-4.845c0-2.089-.822-4.044-2.288-5.533C11.866.822 9.91 0 7.822 0S3.778.822 2.29 2.289A7.801 7.801 0 0 0 0 7.822c0 2.09.822 4.045 2.289 5.534a7.801 7.801 0 0 0 5.533 2.288c1.778 0 3.467-.6 4.845-1.688L18.71 20 20 18.711zM3.578 12.067c-2.334-2.334-2.334-6.156 0-8.49a5.968 5.968 0 0 1 4.244-1.755c1.6 0 3.111.622 4.245 1.756 2.333 2.333 2.333 6.155 0 8.489a5.968 5.968 0 0 1-4.245 1.755c-1.6 0-3.11-.622-4.244-1.755z' fill='%23727272'/%3E%3C/svg%3E");height:20px;width:20px}.tribe-common .tribe-common-c-btn-icon--search:active:before,.tribe-common .tribe-common-c-btn-icon--search:focus:before,.tribe-common .tribe-common-c-btn-icon--search:hover:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 18.711l-6.044-6.044a7.782 7.782 0 0 0 1.688-4.845c0-2.089-.822-4.044-2.288-5.533C11.866.822 9.91 0 7.822 0S3.778.822 2.29 2.289A7.801 7.801 0 0 0 0 7.822c0 2.09.822 4.045 2.289 5.534a7.801 7.801 0 0 0 5.533 2.288c1.778 0 3.467-.6 4.845-1.688L18.71 20 20 18.711zM3.578 12.067c-2.334-2.334-2.334-6.156 0-8.49a5.968 5.968 0 0 1 4.244-1.755c1.6 0 3.111.622 4.245 1.756 2.333 2.333 2.333 6.155 0 8.489a5.968 5.968 0 0 1-4.245 1.755c-1.6 0-3.11-.622-4.244-1.755z' fill='%23141827'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--search:disabled:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 18.711l-6.044-6.044a7.782 7.782 0 0 0 1.688-4.845c0-2.089-.822-4.044-2.288-5.533C11.866.822 9.91 0 7.822 0S3.778.822 2.29 2.289A7.801 7.801 0 0 0 0 7.822c0 2.09.822 4.045 2.289 5.534a7.801 7.801 0 0 0 5.533 2.288c1.778 0 3.467-.6 4.845-1.688L18.71 20 20 18.711zM3.578 12.067c-2.334-2.334-2.334-6.156 0-8.49a5.968 5.968 0 0 1 4.244-1.755c1.6 0 3.111.622 4.245 1.756 2.333 2.333 2.333 6.155 0 8.489a5.968 5.968 0 0 1-4.245 1.755c-1.6 0-3.11-.622-4.244-1.755z' fill='%23D5D5D5'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn,.tribe-common a.tribe-common-c-btn{padding:11px 20px;width:100%}.tribe-common .tribe-common-c-image{display:block;height:auto;margin-left:auto;margin-right:auto;width:100%}.tribe-common .tribe-common-c-image--bg{position:relative}.tribe-common .tribe-common-c-image__bg{background:50% no-repeat;background-size:cover;bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.tribe-common .tribe-common-c-loader{display:flex;padding-top:192px}.tribe-common .tribe-common-c-loader__dot{background-color:rgba(51,74,255,.07);height:15px;width:15px;border-radius:50%}.tribe-common .tribe-common-c-loader__dot:not(:first-of-type){margin-left:8px}@media (min-width:768px){#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-text__input,.tribe-common .tribe-common-form-control-text__input{padding:20px 20px 20px 40px}.tribe-common .tribe-common-g-row--gutters{margin-left:-24px;margin-right:-24px}.tribe-common .tribe-common-g-row--gutters>.tribe-common-g-col{padding-left:24px;padding-right:24px}.tribe-common .tribe-common-l-container{padding-left:42px;padding-right:42px}.tribe-common .tribe-common-c-btn-border,.tribe-common a.tribe-common-c-btn-border{padding:6px 15px;width:auto}.tribe-common .tribe-common-c-btn,.tribe-common a.tribe-common-c-btn{width:auto}.tribe-common .tribe-common-c-loader{padding-top:288px}}
1
+ .tribe-common{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:antialiased}.tribe-common *{box-sizing:border-box}.tribe-common article,.tribe-common aside,.tribe-common details,.tribe-common figcaption,.tribe-common figure,.tribe-common footer,.tribe-common header,.tribe-common main,.tribe-common menu,.tribe-common nav,.tribe-common section,.tribe-common summary{display:block}.tribe-common svg:not(:root){overflow:hidden}.tribe-common audio,.tribe-common canvas,.tribe-common progress,.tribe-common video{display:inline-block}.tribe-common audio:not([controls]){display:none;height:0}.tribe-common progress{vertical-align:baseline}.tribe-common [hidden],.tribe-common template{display:none}.tribe-common pre{overflow:auto}.tribe-common sub,.tribe-common sup{position:relative;vertical-align:baseline}.tribe-common sup{top:-.5em}.tribe-common sub{bottom:-.25em}.tribe-common button,.tribe-common input,.tribe-common select,.tribe-common textarea{box-sizing:border-box;margin:0}.tribe-common input[type=number]::-webkit-inner-spin-button,.tribe-common input[type=number]::-webkit-outer-spin-button{height:auto}.tribe-common legend{color:inherit;display:table;max-width:100%;white-space:normal}.tribe-common textarea{resize:none;overflow:auto}.tribe-common button,.tribe-common input[type=button],.tribe-common input[type=reset],.tribe-common input[type=submit]{cursor:pointer;overflow:visible}.tribe-common button[disabled],.tribe-common input[disabled]{cursor:default}.tribe-common button::-moz-focus-inner,.tribe-common input::-moz-focus-inner{border:0;padding:0}.tribe-common a,.tribe-common abbr,.tribe-common acronym,.tribe-common address,.tribe-common applet,.tribe-common article,.tribe-common aside,.tribe-common audio,.tribe-common b,.tribe-common big,.tribe-common blockquote,.tribe-common canvas,.tribe-common caption,.tribe-common center,.tribe-common cite,.tribe-common code,.tribe-common dd,.tribe-common del,.tribe-common details,.tribe-common dfn,.tribe-common div,.tribe-common dl,.tribe-common dt,.tribe-common em,.tribe-common embed,.tribe-common fieldset,.tribe-common figcaption,.tribe-common figure,.tribe-common footer,.tribe-common form,.tribe-common h1,.tribe-common h2,.tribe-common h3,.tribe-common h4,.tribe-common h5,.tribe-common h6,.tribe-common header,.tribe-common i,.tribe-common iframe,.tribe-common img,.tribe-common ins,.tribe-common kbd,.tribe-common label,.tribe-common legend,.tribe-common li,.tribe-common main,.tribe-common mark,.tribe-common menu,.tribe-common nav,.tribe-common object,.tribe-common ol,.tribe-common output,.tribe-common p,.tribe-common pre,.tribe-common q,.tribe-common ruby,.tribe-common s,.tribe-common samp,.tribe-common section,.tribe-common small,.tribe-common span,.tribe-common strike,.tribe-common strong,.tribe-common sub,.tribe-common summary,.tribe-common sup,.tribe-common table,.tribe-common tbody,.tribe-common td,.tribe-common tfoot,.tribe-common th,.tribe-common thead,.tribe-common time,.tribe-common tr,.tribe-common tt,.tribe-common u,.tribe-common ul,.tribe-common var,.tribe-common video{margin:0;padding:0;border:0}.tribe-common ol,.tribe-common ul{list-style:none}.tribe-common img{-ms-interpolation-mode:bicubic;height:auto;max-width:100%;border-style:none}.tribe-common embed,.tribe-common iframe,.tribe-common video{max-width:100%;max-height:100%}.tribe-theme-avada input[type=text]{margin:0}.tribe-theme-divi .entry-content .tribe-common table,.tribe-theme-divibody.et-pb-preview #main-content .container .tribe-common table{border:0;margin:0}.tribe-theme-divi .entry-content .tribe-common td,.tribe-theme-divibody.et-pb-preview #main-content .container .tribe-common td{border:0}.tribe-theme-divi #content-area .tribe-common td,.tribe-theme-divi #content-area .tribe-common th,.tribe-theme-divi #content-area .tribe-common tr{padding:0}#top.tribe-theme-enfold .tribe-common form,#top.tribe-theme-enfold .tribe-common input{margin:0}.tribe-common .tribe-common-form-control-checkbox__label,.tribe-common .tribe-common-form-control-radio__label{cursor:pointer;display:inline-block;margin-left:11px;vertical-align:middle}.tribe-common .tribe-common-form-control-checkbox__input,.tribe-common .tribe-common-form-control-radio__input{cursor:pointer;display:inline-block;margin:0;vertical-align:middle}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-checkbox__input{display:inline-block}.tribe-common .tribe-common-form-control-checkbox-radio-group>*{margin-bottom:15px}.tribe-common .tribe-common-form-control-checkbox-radio-group>:last-child{margin-bottom:0}.tribe-common .tribe-common-form-control-slider__input{cursor:pointer;display:inline-block;margin:0;padding:0;width:120px;vertical-align:middle}.tribe-common .tribe-common-form-control-slider__label{cursor:pointer;display:inline-block;margin-left:11px;vertical-align:middle}.tribe-common .tribe-common-form-control-slider--vertical .tribe-common-form-control-slider__label{display:block;margin:0 0 6px}.tribe-common .tribe-common-form-control-text__label{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.tribe-common .tribe-common-form-control-text__input{height:auto;padding:12px 28px 12px 0;width:100%}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-text__input{padding:12px 28px 12px 0;width:100%}.tribe-common .tribe-common-form-control-toggle__input,.tribe-common .tribe-common-form-control-toggle__label{cursor:pointer;display:inline-block;vertical-align:middle}.tribe-common .tribe-common-form-control-toggle__label{margin-left:11px}.tribe-common .tribe-common-form-control-toggle--vertical .tribe-common-form-control-toggle__label{display:block;margin:0 0 6px}#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-toggle__input{display:inline-block;margin:5px 0}.tribe-common .tribe-common-g-col{min-width:0;width:100%}.tribe-common .tribe-common-g-row{display:flex;flex-wrap:wrap}.tribe-common .tribe-common-g-row--gutters{margin-left:-21px;margin-right:-21px}.tribe-common .tribe-common-g-row--gutters>.tribe-common-g-col{padding-left:21px;padding-right:21px}.tribe-theme-twentynineteen .tribe-common .entry.tribe-common-g-row--gutters{margin-left:-21px;margin-right:-21px;padding:0}.tribe-theme-twentynineteen .tribe-common .tribe-common-g-row--gutters>.entry.tribe-common-g-col{margin:0;padding-left:21px;padding-right:21px}.tribe-common a{cursor:pointer}.tribe-theme-divi #left-area .tribe-common ul,.tribe-theme-divi .entry-content .tribe-common ul,body.et-pb-preview.tribe-theme-divi #main-content .container .tribe-common ul{list-style-type:none;padding:0}.tribe-common button{padding:0}.tribe-common .tribe-common-l-container{max-width:1260px;margin-left:auto;margin-right:auto;padding-left:19.5px;padding-right:19.5px;width:100%}.tribe-common .tribe-common-svgicon{background-repeat:no-repeat;background-size:contain}.tribe-common .tribe-common-svgicon--close-secondary{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M16 2L2 16m14 0L2 2' stroke='%23BABABA' fill='none' fill-rule='evenodd' stroke-linecap='square' stroke-width='2'/%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--day{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='21' height='21' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 .503v19.994c0 .278.19.503.424.503h20.152c.234 0 .424-.225.424-.503V.503C21 .225 20.81 0 20.576 0H.424C.19 0 0 .225 0 .503zm1.156.943h18.66v2.7H1.157v-2.7zm0 4.023h18.66V19.55H1.157V5.469zM14.18 14.53v1.747c0 .482.39.874.873.874H16.8a.873.873 0 0 0 .873-.874V14.53a.873.873 0 0 0-.873-.873h-1.747a.873.873 0 0 0-.873.873z' fill='%23141827'/%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--list{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='21' height='18' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23141827'%3E%3Cpath d='M19.883 3.272c.342 0 .622-.21.622-.467v-.464c0-.257-.28-.467-.622-.467H7.127c-.342 0-.622.21-.622.467v.464c0 .257.28.467.622.467h12.756zm-18.045.935a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5zM19.883 9.98c.342 0 .622-.21.622-.466v-.465c0-.257-.28-.467-.622-.467H7.127c-.342 0-.622.21-.622.467v.465c0 .256.28.466.622.466h12.756zm-18.045.936a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5zM19.883 16.689c.342 0 .622-.21.622-.467v-.465c0-.256-.28-.466-.622-.466H7.127c-.342 0-.622.21-.622.466v.465c0 .257.28.467.622.467h12.756zm-18.045.935a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5z'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--map{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='22' height='21' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd' stroke='%23141827'%3E%3Cpath stroke-linejoin='round' d='M13.921 11.632H17.5l3.588 8.421H1l3.488-8.421h4.016'/%3E%3Cpath d='M11.32 15.506c.2-.248 4.93-6.108 4.93-9.04 0-3.015-2.305-5.468-5.138-5.468-2.833 0-5.138 2.453-5.138 5.467 0 2.933 4.729 8.793 4.93 9.041a.268.268 0 0 0 .208.101c.08 0 .155-.037.207-.101zm-4.797-9.04c0-2.693 2.058-4.883 4.589-4.883 2.53 0 4.588 2.19 4.588 4.882 0 2.387-3.667 7.22-4.588 8.397-.922-1.177-4.589-6.009-4.589-8.397z' stroke-width='.4' fill='%23141827' fill-rule='nonzero'/%3E%3Cpath d='M12.85 6.477c0-1.007-.78-1.826-1.738-1.826-.96 0-1.74.819-1.74 1.826 0 1.007.78 1.826 1.74 1.826.959 0 1.739-.82 1.739-1.826zm-3.15 0c0-.817.633-1.482 1.412-1.482.778 0 1.41.665 1.41 1.482s-.632 1.482-1.41 1.482c-.779 0-1.412-.665-1.412-1.482z' stroke-width='.7' fill='%23000' fill-rule='nonzero'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--month{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='22' height='22' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.637 1.063v19.879c0 .276.189.5.422.5h20.037c.232 0 .421-.224.421-.5V1.062c0-.275-.189-.5-.421-.5H1.059c-.233 0-.422.225-.422.5zM1.787 2H20.34v2.685H1.787V2zm0 4H20.34v14H1.787V6zM8 8.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm-8 4v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm-12 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm0 4v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5zm4 0v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5z' fill='%23141827'/%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--no-map{background-image:svg-inline(no-map)}.tribe-common .tribe-common-svgicon--photo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='17' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23141827'%3E%3Cpath d='M19.348.11H.634a.509.509 0 0 0-.52.508v15.017c0 .284.23.508.52.508h18.714a.51.51 0 0 0 .52-.508V.618a.509.509 0 0 0-.52-.508zm-.54 1.035v10.837l-2.87-3.084c-.583-.61-1.664-.61-2.246 0l-1.393 1.481-4.034-4.525a1.625 1.625 0 0 0-1.227-.528 1.6 1.6 0 0 0-1.206.548l-4.657 5.175V1.145h17.632zM1.174 15.108v-2.496l5.448-6.089a.529.529 0 0 1 .415-.182c.146 0 .333.06.437.182l4.429 4.972c.104.102.25.183.395.183.166.02.291-.06.395-.162l1.788-1.908c.167-.183.5-.183.686 0l3.66 3.917v1.603H1.175v-.02z'/%3E%3Cpath d='M14.19 5.757c1.044 0 1.91-.872 1.91-1.968s-.846-1.969-1.91-1.969c-1.062 0-1.909.873-1.909 1.969s.866 1.968 1.91 1.968zm0-2.902c.493 0 .907.427.907.934 0 .507-.414.933-.906.933-.492 0-.906-.426-.906-.933 0-.507.414-.934.906-.934z'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--week{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='21' height='21' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 .503v19.994c0 .278.19.503.424.503h20.152c.234 0 .424-.225.424-.503V.503C21 .225 20.81 0 20.576 0H.424C.19 0 0 .225 0 .503zm1.156.943h18.66v2.7H1.157v-2.7zm0 4.023h18.66V19.55H1.157V5.469zm6.25 6.537v1.006c0 .278.224.503.502.503h1.006a.503.503 0 0 0 .503-.503v-1.006a.503.503 0 0 0-.503-.502H7.908a.503.503 0 0 0-.503.502zm4.022 0v1.006c0 .278.225.503.503.503h1.006a.503.503 0 0 0 .503-.503v-1.006a.503.503 0 0 0-.503-.502H11.93a.503.503 0 0 0-.503.502zm4.023 0v1.006c0 .278.225.503.503.503h1.006a.503.503 0 0 0 .503-.503v-1.006a.503.503 0 0 0-.503-.502h-1.006a.503.503 0 0 0-.503.502zm-12.069 0v1.006c0 .278.225.503.503.503h1.006a.503.503 0 0 0 .503-.503v-1.006a.503.503 0 0 0-.503-.502H3.885a.503.503 0 0 0-.503.502z' fill='%23141827'/%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--featured{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h16v20l-7.902-5.122L0 20z' fill='%23141827'/%3E%3C/svg%3E");height:10px;width:8px}.tribe-common .tribe-common-svgicon--recurring{background-image:svg-inline(recurring-active);height:10px;width:10px}.tribe-common .tribe-common-svgicon--search{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 18.711l-6.044-6.044a7.782 7.782 0 0 0 1.688-4.845c0-2.089-.822-4.044-2.288-5.533C11.866.822 9.91 0 7.822 0S3.778.822 2.29 2.289A7.801 7.801 0 0 0 0 7.822c0 2.09.822 4.045 2.289 5.534a7.801 7.801 0 0 0 5.533 2.288c1.778 0 3.467-.6 4.845-1.688L18.71 20 20 18.711zM3.578 12.067c-2.334-2.334-2.334-6.156 0-8.49a5.968 5.968 0 0 1 4.244-1.755c1.6 0 3.111.622 4.245 1.756 2.333 2.333 2.333 6.155 0 8.489a5.968 5.968 0 0 1-4.245 1.755c-1.6 0-3.11-.622-4.244-1.755z' fill='%23727272'/%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--filters{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17'%3E%3Cg fill='none' fill-rule='evenodd' stroke='%23727272' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' transform='translate(1 1)'%3E%3Cpath d='M3 3V0m0 15v-2'/%3E%3Ccircle cx='3' cy='9' r='3'/%3E%3Cpath d='M12 9v6'/%3E%3Ccircle cx='12' cy='3' r='3' transform='matrix(1 0 0 -1 0 6)'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-svgicon--close{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M16 2L2 16m14 0L2 2' stroke='%23727272' fill='none' fill-rule='evenodd' stroke-linecap='square' stroke-width='2'/%3E%3C/svg%3E")}.tribe-common .tribe-common-a11y-hidden{display:none!important;visibility:hidden}.tribe-common .tribe-common-a11y-visual-hide,.tribe-common .tribe-common-a11y-visual-show{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.tribe-common .tribe-common-c-btn-border,.tribe-common a.tribe-common-c-btn-border{padding:14px 20px;width:100%}.tribe-common .tribe-common-c-btn-icon:before{background-repeat:no-repeat;background-size:contain;content:"";display:block}.tribe-common .tribe-common-c-btn-icon--caret-left:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.916 17.841L10 19.757l-9.9-9.9L10-.041l1.916 1.916-7.983 7.984z' fill='%23BABABA'/%3E%3C/svg%3E");height:20px;width:12px}.tribe-common .tribe-common-c-btn-icon--caret-left:active:before,.tribe-common .tribe-common-c-btn-icon--caret-left:focus:before,.tribe-common .tribe-common-c-btn-icon--caret-left:hover:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.916 17.841L10 19.757l-9.9-9.9L10-.041l1.916 1.916-7.983 7.984z' fill='%23727272'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--caret-left:disabled:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.916 17.841L10 19.757l-9.9-9.9L10-.041l1.916 1.916-7.983 7.984z' fill='%23D5D5D5'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--caret-right:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.084 2.159L2 .243l9.9 9.9L2 20.041.084 18.126l7.983-7.984z' fill='%23BABABA'/%3E%3C/svg%3E");height:20px;width:12px}.tribe-common .tribe-common-c-btn-icon--caret-right:active:before,.tribe-common .tribe-common-c-btn-icon--caret-right:focus:before,.tribe-common .tribe-common-c-btn-icon--caret-right:hover:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.084 2.159L2 .243l9.9 9.9L2 20.041.084 18.126l7.983-7.984z' fill='%23727272'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--caret-right:disabled:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.084 2.159L2 .243l9.9 9.9L2 20.041.084 18.126l7.983-7.984z' fill='%23D5D5D5'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--filters:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17'%3E%3Cg fill='none' fill-rule='evenodd' stroke='%23727272' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' transform='translate(1 1)'%3E%3Cpath d='M3 3V0m0 15v-2'/%3E%3Ccircle cx='3' cy='9' r='3'/%3E%3Cpath d='M12 9v6'/%3E%3Ccircle cx='12' cy='3' r='3' transform='matrix(1 0 0 -1 0 6)'/%3E%3C/g%3E%3C/svg%3E");height:20px;width:24px}.tribe-common .tribe-common-c-btn-icon--filters:active:before,.tribe-common .tribe-common-c-btn-icon--filters:focus:before,.tribe-common .tribe-common-c-btn-icon--filters:hover:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17'%3E%3Cg fill='none' fill-rule='evenodd' stroke='%23141827' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' transform='translate(1 1)'%3E%3Cpath d='M3 3V0m0 15v-2'/%3E%3Ccircle cx='3' cy='9' r='3'/%3E%3Cpath d='M12 9v6'/%3E%3Ccircle cx='12' cy='3' r='3' transform='matrix(1 0 0 -1 0 6)'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--filters:disabled:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17'%3E%3Cg fill='none' fill-rule='evenodd' stroke='%23D5D5D5' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' transform='translate(1 1)'%3E%3Cpath d='M3 3V0m0 15v-2'/%3E%3Ccircle cx='3' cy='9' r='3'/%3E%3Cpath d='M12 9v6'/%3E%3Ccircle cx='12' cy='3' r='3' transform='matrix(1 0 0 -1 0 6)'/%3E%3C/g%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--search:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 18.711l-6.044-6.044a7.782 7.782 0 0 0 1.688-4.845c0-2.089-.822-4.044-2.288-5.533C11.866.822 9.91 0 7.822 0S3.778.822 2.29 2.289A7.801 7.801 0 0 0 0 7.822c0 2.09.822 4.045 2.289 5.534a7.801 7.801 0 0 0 5.533 2.288c1.778 0 3.467-.6 4.845-1.688L18.71 20 20 18.711zM3.578 12.067c-2.334-2.334-2.334-6.156 0-8.49a5.968 5.968 0 0 1 4.244-1.755c1.6 0 3.111.622 4.245 1.756 2.333 2.333 2.333 6.155 0 8.489a5.968 5.968 0 0 1-4.245 1.755c-1.6 0-3.11-.622-4.244-1.755z' fill='%23727272'/%3E%3C/svg%3E");height:20px;width:20px}.tribe-common .tribe-common-c-btn-icon--search:active:before,.tribe-common .tribe-common-c-btn-icon--search:focus:before,.tribe-common .tribe-common-c-btn-icon--search:hover:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 18.711l-6.044-6.044a7.782 7.782 0 0 0 1.688-4.845c0-2.089-.822-4.044-2.288-5.533C11.866.822 9.91 0 7.822 0S3.778.822 2.29 2.289A7.801 7.801 0 0 0 0 7.822c0 2.09.822 4.045 2.289 5.534a7.801 7.801 0 0 0 5.533 2.288c1.778 0 3.467-.6 4.845-1.688L18.71 20 20 18.711zM3.578 12.067c-2.334-2.334-2.334-6.156 0-8.49a5.968 5.968 0 0 1 4.244-1.755c1.6 0 3.111.622 4.245 1.756 2.333 2.333 2.333 6.155 0 8.489a5.968 5.968 0 0 1-4.245 1.755c-1.6 0-3.11-.622-4.244-1.755z' fill='%23141827'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn-icon--search:disabled:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 18.711l-6.044-6.044a7.782 7.782 0 0 0 1.688-4.845c0-2.089-.822-4.044-2.288-5.533C11.866.822 9.91 0 7.822 0S3.778.822 2.29 2.289A7.801 7.801 0 0 0 0 7.822c0 2.09.822 4.045 2.289 5.534a7.801 7.801 0 0 0 5.533 2.288c1.778 0 3.467-.6 4.845-1.688L18.71 20 20 18.711zM3.578 12.067c-2.334-2.334-2.334-6.156 0-8.49a5.968 5.968 0 0 1 4.244-1.755c1.6 0 3.111.622 4.245 1.756 2.333 2.333 2.333 6.155 0 8.489a5.968 5.968 0 0 1-4.245 1.755c-1.6 0-3.11-.622-4.244-1.755z' fill='%23D5D5D5'/%3E%3C/svg%3E")}.tribe-common .tribe-common-c-btn,.tribe-common a.tribe-common-c-btn{padding:11px 20px;width:100%}.tribe-common .tribe-common-c-image{display:block;height:auto;margin-left:auto;margin-right:auto;width:100%}.tribe-common .tribe-common-c-image--bg{position:relative}.tribe-common .tribe-common-c-image__bg{background:50% no-repeat;background-size:cover;bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.tribe-common .tribe-common-c-loader{display:flex;padding-top:192px}.tribe-common .tribe-common-c-loader__dot{background-color:rgba(51,74,255,.07);height:15px;width:15px;border-radius:50%}.tribe-common .tribe-common-c-loader__dot:not(:first-of-type){margin-left:8px}@media (min-width:768px){#top.tribe-theme-enfold .tribe-common .tribe-common-form-control-text__input,.tribe-common .tribe-common-form-control-text__input{padding:20px 20px 20px 40px}.tribe-common .tribe-common-g-row--gutters{margin-left:-24px;margin-right:-24px}.tribe-common .tribe-common-g-row--gutters>.tribe-common-g-col{padding-left:24px;padding-right:24px}.tribe-theme-twentynineteen .tribe-common .entry.tribe-common-g-row--gutters{margin-left:-24px;margin-right:-24px}.tribe-theme-twentynineteen .tribe-common .tribe-common-g-row--gutters>.entry.tribe-common-g-col{padding-left:24px;padding-right:24px}.tribe-common .tribe-common-l-container{padding-left:42px;padding-right:42px}.tribe-common .tribe-common-c-btn-border,.tribe-common a.tribe-common-c-btn-border{padding:6px 15px;width:auto}.tribe-common .tribe-common-c-btn,.tribe-common a.tribe-common-c-btn{width:auto}.tribe-common .tribe-common-c-loader{padding-top:288px}}
common/src/resources/postcss/base/full/typography/_anchors.pcss CHANGED
@@ -40,6 +40,7 @@
40
  * Theme Overrides - Twenty Nineteen
41
  * ------------------------------------------------------------------------- */
42
 
 
43
  .tribe-theme-twentynineteen .entry & {
44
  text-decoration: none;
45
  }
40
  * Theme Overrides - Twenty Nineteen
41
  * ------------------------------------------------------------------------- */
42
 
43
+ .tribe-theme-twentynineteen &,
44
  .tribe-theme-twentynineteen .entry & {
45
  text-decoration: none;
46
  }
common/src/resources/postcss/base/skeleton/grid/_rows.pcss CHANGED
@@ -36,4 +36,42 @@
36
  }
37
  }
38
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
36
  }
37
  }
38
  }
39
+
40
+ /* -------------------------------------------------------------------------
41
+ *
42
+ * Grid Rows: Theme Overrides
43
+ *
44
+ * ------------------------------------------------------------------------- */
45
+
46
+ /* -----------------------------------------------------------------------------
47
+ * Theme Overrides - Twenty Nineteen
48
+ * ----------------------------------------------------------------------------- */
49
+
50
+ .tribe-theme-twentynineteen & {
51
+
52
+ .entry.tribe-common-g-row--gutters {
53
+ margin-left: var(--grid-gutter-small-half-negative);
54
+ margin-right: var(--grid-gutter-small-half-negative);
55
+ padding: 0;
56
+
57
+ @media (--viewport-medium) {
58
+ margin-left: var(--grid-gutter-half-negative);
59
+ margin-right: var(--grid-gutter-half-negative);
60
+ }
61
+ }
62
+
63
+ .tribe-common-g-row--gutters {
64
+
65
+ & > .entry.tribe-common-g-col {
66
+ margin: 0;
67
+ padding-left: var(--grid-gutter-small-half);
68
+ padding-right: var(--grid-gutter-small-half);
69
+
70
+ @media (--viewport-medium) {
71
+ padding-left: var(--grid-gutter-half);
72
+ padding-right: var(--grid-gutter-half);
73
+ }
74
+ }
75
+ }
76
+ }
77
  }
common/vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitdf20a975dd48ab5f56b700979642bc18::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit343fad5aaa80f76d6e1366fb8b27850f::getLoader();
common/vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit30e733ff098f8b6f88c307abb1e15faa::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInitddd912485d2bbed0337241dfbc948998::getLoader();
common/vendor/composer/autoload_classmap.php CHANGED
@@ -122,6 +122,8 @@ return array(
122
  'Tribe\\Models\\Post_Types\\Base' => $baseDir . '/src/Tribe/Models/Post_Types/Base.php',
123
  'Tribe\\Models\\Post_Types\\Nothing' => $baseDir . '/src/Tribe/Models/Post_Types/Nothing.php',
124
  'Tribe\\PUE\\Update_Prevention' => $baseDir . '/src/Tribe/PUE/Update_Prevention.php',
 
 
125
  'Tribe\\Service_Providers\\Dialog' => $baseDir . '/src/Tribe/Service_Providers/Dialog.php',
126
  'Tribe\\Service_Providers\\PUE' => $baseDir . '/src/Tribe/Service_Providers/PUE.php',
127
  'Tribe\\Service_Providers\\Tooltip' => $baseDir . '/src/Tribe/Service_Providers/Tooltip.php',
122
  'Tribe\\Models\\Post_Types\\Base' => $baseDir . '/src/Tribe/Models/Post_Types/Base.php',
123
  'Tribe\\Models\\Post_Types\\Nothing' => $baseDir . '/src/Tribe/Models/Post_Types/Nothing.php',
124
  'Tribe\\PUE\\Update_Prevention' => $baseDir . '/src/Tribe/PUE/Update_Prevention.php',
125
+ 'Tribe\\Repository\\Core_Read_Interface' => $baseDir . '/src/Tribe/Repository/Core_Read_Interface.php',
126
+ 'Tribe\\Repository\\Filter_Validation' => $baseDir . '/src/Tribe/Repository/Filter_Validation.php',
127
  'Tribe\\Service_Providers\\Dialog' => $baseDir . '/src/Tribe/Service_Providers/Dialog.php',
128
  'Tribe\\Service_Providers\\PUE' => $baseDir . '/src/Tribe/Service_Providers/PUE.php',
129
  'Tribe\\Service_Providers\\Tooltip' => $baseDir . '/src/Tribe/Service_Providers/Tooltip.php',
common/vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitdf20a975dd48ab5f56b700979642bc18
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitdf20a975dd48ab5f56b700979642bc18
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitdf20a975dd48ab5f56b700979642bc18', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitdf20a975dd48ab5f56b700979642bc18', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInitdf20a975dd48ab5f56b700979642bc18::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit343fad5aaa80f76d6e1366fb8b27850f
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit343fad5aaa80f76d6e1366fb8b27850f', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit343fad5aaa80f76d6e1366fb8b27850f', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit343fad5aaa80f76d6e1366fb8b27850f::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
common/vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInit30e733ff098f8b6f88c307abb1e15faa {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit30e733ff098f8b6f88c307abb1e15faa {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit30e733ff098f8b6f88c307abb1e15faa', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit30e733ff098f8b6f88c307abb1e15faa', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInitddd912485d2bbed0337241dfbc948998 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitddd912485d2bbed0337241dfbc948998', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitddd912485d2bbed0337241dfbc948998', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
common/vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitdf20a975dd48ab5f56b700979642bc18
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
@@ -178,6 +178,8 @@ class ComposerStaticInitdf20a975dd48ab5f56b700979642bc18
178
  'Tribe\\Models\\Post_Types\\Base' => __DIR__ . '/../..' . '/src/Tribe/Models/Post_Types/Base.php',
179
  'Tribe\\Models\\Post_Types\\Nothing' => __DIR__ . '/../..' . '/src/Tribe/Models/Post_Types/Nothing.php',
180
  'Tribe\\PUE\\Update_Prevention' => __DIR__ . '/../..' . '/src/Tribe/PUE/Update_Prevention.php',
 
 
181
  'Tribe\\Service_Providers\\Dialog' => __DIR__ . '/../..' . '/src/Tribe/Service_Providers/Dialog.php',
182
  'Tribe\\Service_Providers\\PUE' => __DIR__ . '/../..' . '/src/Tribe/Service_Providers/PUE.php',
183
  'Tribe\\Service_Providers\\Tooltip' => __DIR__ . '/../..' . '/src/Tribe/Service_Providers/Tooltip.php',
@@ -203,10 +205,10 @@ class ComposerStaticInitdf20a975dd48ab5f56b700979642bc18
203
  public static function getInitializer(ClassLoader $loader)
204
  {
205
  return \Closure::bind(function () use ($loader) {
206
- $loader->prefixLengthsPsr4 = ComposerStaticInitdf20a975dd48ab5f56b700979642bc18::$prefixLengthsPsr4;
207
- $loader->prefixDirsPsr4 = ComposerStaticInitdf20a975dd48ab5f56b700979642bc18::$prefixDirsPsr4;
208
- $loader->prefixesPsr0 = ComposerStaticInitdf20a975dd48ab5f56b700979642bc18::$prefixesPsr0;
209
- $loader->classMap = ComposerStaticInitdf20a975dd48ab5f56b700979642bc18::$classMap;
210
 
211
  }, null, ClassLoader::class);
212
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit343fad5aaa80f76d6e1366fb8b27850f
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
178
  'Tribe\\Models\\Post_Types\\Base' => __DIR__ . '/../..' . '/src/Tribe/Models/Post_Types/Base.php',
179
  'Tribe\\Models\\Post_Types\\Nothing' => __DIR__ . '/../..' . '/src/Tribe/Models/Post_Types/Nothing.php',
180
  'Tribe\\PUE\\Update_Prevention' => __DIR__ . '/../..' . '/src/Tribe/PUE/Update_Prevention.php',
181
+ 'Tribe\\Repository\\Core_Read_Interface' => __DIR__ . '/../..' . '/src/Tribe/Repository/Core_Read_Interface.php',
182
+ 'Tribe\\Repository\\Filter_Validation' => __DIR__ . '/../..' . '/src/Tribe/Repository/Filter_Validation.php',
183
  'Tribe\\Service_Providers\\Dialog' => __DIR__ . '/../..' . '/src/Tribe/Service_Providers/Dialog.php',
184
  'Tribe\\Service_Providers\\PUE' => __DIR__ . '/../..' . '/src/Tribe/Service_Providers/PUE.php',
185
  'Tribe\\Service_Providers\\Tooltip' => __DIR__ . '/../..' . '/src/Tribe/Service_Providers/Tooltip.php',
205
  public static function getInitializer(ClassLoader $loader)
206
  {
207
  return \Closure::bind(function () use ($loader) {
208
+ $loader->prefixLengthsPsr4 = ComposerStaticInit343fad5aaa80f76d6e1366fb8b27850f::$prefixLengthsPsr4;
209
+ $loader->prefixDirsPsr4 = ComposerStaticInit343fad5aaa80f76d6e1366fb8b27850f::$prefixDirsPsr4;
210
+ $loader->prefixesPsr0 = ComposerStaticInit343fad5aaa80f76d6e1366fb8b27850f::$prefixesPsr0;
211
+ $loader->classMap = ComposerStaticInit343fad5aaa80f76d6e1366fb8b27850f::$classMap;
212
 
213
  }, null, ClassLoader::class);
214
  }
event-tickets.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Event Tickets
4
  Plugin URI: http://m.tri.be/1acb
5
  Description: Event Tickets allows you to sell basic tickets and collect RSVPs from any post, page, or event.
6
- Version: 4.11.0.1
7
  Author: Modern Tribe, Inc.
8
  Author URI: http://m.tri.be/28
9
  License: GPLv2 or later
3
  Plugin Name: Event Tickets
4
  Plugin URI: http://m.tri.be/1acb
5
  Description: Event Tickets allows you to sell basic tickets and collect RSVPs from any post, page, or event.
6
+ Version: 4.11.1
7
  Author: Modern Tribe, Inc.
8
  Author URI: http://m.tri.be/28
9
  License: GPLv2 or later
lang/event-tickets-ro_RO.mo CHANGED
Binary file
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: ModernTribe, brianjessee, camwynsp, paulkim, sc0ttkclark, aguseo,
4
  Tags: RSVP, events, tickets, event management, calendar, ticket sales, community, registration, api, dates, date, posts, workshop, conference, meeting, seminar, concert, summit, ticket integration, event ticketing
5
  Requires at least: 4.9
6
  Tested up to: 5.3
7
- Stable tag: 4.11.0.1
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -117,6 +117,26 @@ Currently, the following add-ons are available for Event Tickets:
117
 
118
  == Changelog ==
119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  = [4.11.0.1] 2019-12-11 =
121
 
122
  * Fix - Avoid running extra unnecessary queries when registering assets [138390]
4
  Tags: RSVP, events, tickets, event management, calendar, ticket sales, community, registration, api, dates, date, posts, workshop, conference, meeting, seminar, concert, summit, ticket integration, event ticketing
5
  Requires at least: 4.9
6
  Tested up to: 5.3
7
+ Stable tag: 4.11.1
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
117
 
118
  == Changelog ==
119
 
120
+ = [4.11.1] 2019-12-19 =
121
+
122
+ * Feature - Use the same loading icon for the RSVP block that we're using for the tickets block. [135660]
123
+ * Tweak - Added `tribe_tickets_is_enabled_post_context()` function [124403]
124
+ * Tweak - Avoid loading plugin assets on post types that are not tickets-enabled post types [124403]
125
+ * Tweak - Add filter for `ticket-display-tickets-left-threshold` to tickets and RSVP block. Added new filters to allow showing "Unlimited" on unlimited tickets [130660]
126
+ * Tweak - Added filters: `tribe_tickets_is_enabled_post_context`, `tribe_rsvp_block_loader_classes`, `tribe_display_rsvp_block_tickets_left_threshold`, `tribe_rsvp_block_show_unlimited_availability`, `tribe_rsvp_block_loader_classes`, `tribe_display_tickets_block_tickets_left_threshold`, `tribe_tickets_block_show_unlimited_availability`, `tribe_display_rsvp_block_tickets_left_threshold`, `tribe_rsvp_block_show_unlimited_availability`, `tribe_display_tickets_block_tickets_left_threshold`, `tribe_tickets_block_show_unlimited_availability`
127
+ * Tweak - Changed views: `blocks/rsvp`, `blocks/rsvp/details/availability`, `blocks/rsvp/form/quantity-input`, `blocks/rsvp/loader`, `blocks/tickets`, `blocks/tickets/extra-available-quantity`, `blocks/tickets/extra-available`, `blocks/tickets/extra`, `blocks/tickets/item`, `blocks/tickets/quantity`, `blocks/tickets/registration/attendee/submit`, `tickets/rsvp`, `tickets/tpp`
128
+ * Fix - Fix the header image attachment handling for RSVP blocks [137243]
129
+ * Fix - Ensure that tickets without an end date set in the Classic editor get set to end at the start of an event per the tooltip [125969]
130
+ * Fix - Make "Show attendees list on event page" checkbox apply to the REST API as well. [133333]
131
+ * Fix - Overriding the maximum purchase quantity (the `tribe_tickets_get_ticket_max_purchase` filter) now works in all contexts [133432]
132
+ * Fix - Prevent duplicate blocks on provider change. Add logic to test current provider against event default provider. [137925]
133
+ * Fix - If running WP 5.3+, add `show_in_rest` as an array configuration for capacity and the RSVP not going fields so that they save properly. [137875]
134
+ * Fix - Gracefully handle enter key in modal form to prevent missing data when submitting. [136595]
135
+ * Fix - Increase size of -/+ signs for decreasing/increasing quantity on tickets. [138558]
136
+ * Fix - Handle special characters for Event Ticket field labels like single quotes and colons so they don't break the saving. [136451]
137
+ * Fix - Don't try to load RSVPs with the Tickets block `render()`. [138646]
138
+ * Fix - Correct shared capacity handling when tickets left threshold is set. [138620]
139
+
140
  = [4.11.0.1] 2019-12-11 =
141
 
142
  * Fix - Avoid running extra unnecessary queries when registering assets [138390]
src/Tribe/Abstract_Attendance_Totals.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  abstract class Tribe__Tickets__Abstract_Attendance_Totals {
3
  protected $event_id = 0;
4
  protected $relative_priority = 10;
@@ -62,7 +65,10 @@ abstract class Tribe__Tickets__Abstract_Attendance_Totals {
62
  $message = _x( 'Includes all ticketed attendees regardless of order status.', 'total sold tooltip', 'event-tickets' );
63
  $args = [ 'classes' => 'required' ];
64
 
65
- return tribe( 'tooltip.view' )->render_tooltip( $message, $args );
 
 
 
66
  }
67
 
68
  /**
@@ -76,7 +82,10 @@ abstract class Tribe__Tickets__Abstract_Attendance_Totals {
76
  $message = _x( 'Includes ticketed attendees with orders marked Completed.', 'total complete tooltip', 'event-tickets' );
77
  $args = [ 'classes' => 'required' ];
78
 
79
- return tribe( 'tooltip.view' )->render_tooltip( $message, $args );
 
 
 
80
  }
81
 
82
  /**
1
  <?php
2
+
3
+ use Tribe\Tooltip\View as Tooltip_View;
4
+
5
  abstract class Tribe__Tickets__Abstract_Attendance_Totals {
6
  protected $event_id = 0;
7
  protected $relative_priority = 10;
65
  $message = _x( 'Includes all ticketed attendees regardless of order status.', 'total sold tooltip', 'event-tickets' );
66
  $args = [ 'classes' => 'required' ];
67
 
68
+ /** @var Tooltip_View $tooltip */
69
+ $tooltip = tribe( 'tooltip.view' );
70
+
71
+ return $tooltip->render_tooltip( $message, $args );
72
  }
73
 
74
  /**
82
  $message = _x( 'Includes ticketed attendees with orders marked Completed.', 'total complete tooltip', 'event-tickets' );
83
  $args = [ 'classes' => 'required' ];
84
 
85
+ /** @var Tooltip_View $tooltip */
86
+ $tooltip = tribe( 'tooltip.view' );
87
+
88
+ return $tooltip->render_tooltip( $message, $args );
89
  }
90
 
91
  /**
src/Tribe/Assets.php CHANGED
@@ -4,9 +4,13 @@ class Tribe__Tickets__Assets {
4
  * Enqueue scripts for front end
5
  *
6
  * @since 4.6
 
 
 
7
  */
8
  public function enqueue_scripts() {
9
- $tickets_main = Tribe__Tickets__Main::instance();
 
10
 
11
  tribe_assets(
12
  $tickets_main,
@@ -18,7 +22,10 @@ class Tribe__Tickets__Assets {
18
  [ 'event-tickets-attendees-list-js', 'attendees-list.js', [ 'jquery' ] ],
19
  [ 'event-tickets-details-js', 'ticket-details.js', [] ],
20
  ],
21
- 'wp_enqueue_scripts'
 
 
 
22
  );
23
 
24
  // Tickets registration page styles
@@ -155,7 +162,7 @@ class Tribe__Tickets__Assets {
155
  $modules = Tribe__Tickets__Tickets::modules();
156
 
157
  // For the metabox
158
- return ! empty( $post ) && ! empty( $modules ) && in_array( $post->post_type, tribe( 'tickets.main' )->post_types() );
159
  }
160
 
161
  /**
@@ -166,10 +173,13 @@ class Tribe__Tickets__Assets {
166
  * @return bool
167
  */
168
  protected function is_editing_ticketable_post() {
169
- $context = tribe( 'context' );
170
- $post_types = tribe( 'tickets.main' )->post_types();
 
 
 
171
 
172
- return $context->is_editing_post( $post_types );
173
  }
174
 
175
  /**
@@ -197,4 +207,4 @@ class Tribe__Tickets__Assets {
197
 
198
  return $data;
199
  }
200
- }
4
  * Enqueue scripts for front end
5
  *
6
  * @since 4.6
7
+ * @since 4.11.1 Only load if in a tickets-enabled post context.
8
+ *
9
+ * @see \tribe_tickets_is_enabled_post_context()
10
  */
11
  public function enqueue_scripts() {
12
+ /** @var Tribe__Tickets__Main $tickets_main */
13
+ $tickets_main = tribe( 'tickets.main' );
14
 
15
  tribe_assets(
16
  $tickets_main,
22
  [ 'event-tickets-attendees-list-js', 'attendees-list.js', [ 'jquery' ] ],
23
  [ 'event-tickets-details-js', 'ticket-details.js', [] ],
24
  ],
25
+ 'wp_enqueue_scripts',
26
+ [
27
+ 'conditionals' => 'tribe_tickets_is_enabled_post_context',
28
+ ]
29
  );
30
 
31
  // Tickets registration page styles
162
  $modules = Tribe__Tickets__Tickets::modules();
163
 
164
  // For the metabox
165
+ return ! empty( $post ) && ! empty( $modules ) && in_array( $post->post_type, tribe( 'tickets.main' )->post_types(), true );
166
  }
167
 
168
  /**
173
  * @return bool
174
  */
175
  protected function is_editing_ticketable_post() {
176
+ /** @var Tribe__Context $context */
177
+ $context = tribe( 'context' );
178
+
179
+ /** @var Tribe__Tickets__Main $main */
180
+ $main = tribe( 'tickets.main' );
181
 
182
+ return $context->is_editing_post( $main->post_types() );
183
  }
184
 
185
  /**
207
 
208
  return $data;
209
  }
210
+ }
src/Tribe/Attendee_Repository.php CHANGED
@@ -73,18 +73,19 @@ class Tribe__Tickets__Attendee_Repository extends Tribe__Repository {
73
  $this->add_simple_meta_schema_entry( 'price', '_paid_price' );
74
 
75
  $this->schema = array_merge( $this->schema, [
76
- 'optout' => [ $this, 'filter_by_optout' ],
77
- 'rsvp_status' => [ $this, 'filter_by_rsvp_status' ],
78
- 'rsvp_status__or_none' => [ $this, 'filter_by_rsvp_status_or_none' ],
79
- 'provider' => [ $this, 'filter_by_provider' ],
80
- 'provider__not_in' => [ $this, 'filter_by_provider_not_in' ],
81
- 'event_status' => [ $this, 'filter_by_event_status' ],
82
- 'order_status' => [ $this, 'filter_by_order_status' ],
83
- 'order_status__not_in' => [ $this, 'filter_by_order_status_not_in' ],
84
- 'price_min' => [ $this, 'filter_by_price_min' ],
85
- 'price_max' => [ $this, 'filter_by_price_max' ],
86
- 'has_attendee_meta' => [ $this, 'filter_by_attendee_meta_existence' ],
87
- 'checkedin' => [ $this, 'filter_by_checkedin' ],
 
88
  ] );
89
 
90
  $this->init_order_statuses();
@@ -395,6 +396,22 @@ class Tribe__Tickets__Attendee_Repository extends Tribe__Repository {
395
  );
396
  }
397
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
  /**
399
  * Filters attendee to only get those related to orders with a specific ID.
400
  *
@@ -578,26 +595,29 @@ class Tribe__Tickets__Attendee_Repository extends Tribe__Repository {
578
  * @return bool|string
579
  */
580
  protected function init_order_statuses() {
 
 
 
581
  if ( empty( self::$order_statuses ) ) {
582
  // For RSVP tickets the order status is the going status
583
  $statuses = [ 'yes', 'no' ];
584
 
585
  if ( Tribe__Tickets__Commerce__PayPal__Main::get_instance()->is_active() ) {
586
- $statuses = array_merge( $statuses, tribe( 'tickets.status' )->get_statuses_by_action( 'all', 'tpp' ) );
587
  }
588
 
589
  if (
590
  class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' )
591
  && function_exists( 'wc_get_order_statuses' )
592
  ) {
593
- $statuses = array_merge( $statuses, tribe( 'tickets.status' )->get_statuses_by_action( 'all', 'woo' ) );
594
  }
595
 
596
  if (
597
  class_exists( 'Tribe__Tickets_Plus__Commerce__EDD__Main' )
598
  && function_exists( 'edd_get_payment_statuses' )
599
  ) {
600
- $statuses = array_merge( $statuses, array_keys( tribe( 'tickets.status' )->get_statuses_by_action( 'all', 'edd' ) ) );
601
  }
602
 
603
  self::$order_statuses = $statuses;
73
  $this->add_simple_meta_schema_entry( 'price', '_paid_price' );
74
 
75
  $this->schema = array_merge( $this->schema, [
76
+ 'checkedin' => [ $this, 'filter_by_checkedin' ],
77
+ 'event__show_attendees' => [ $this, 'filter_by_show_attendees' ],
78
+ 'event_status' => [ $this, 'filter_by_event_status' ],
79
+ 'has_attendee_meta' => [ $this, 'filter_by_attendee_meta_existence' ],
80
+ 'optout' => [ $this, 'filter_by_optout' ],
81
+ 'order_status__not_in' => [ $this, 'filter_by_order_status_not_in' ],
82
+ 'order_status' => [ $this, 'filter_by_order_status' ],
83
+ 'price_max' => [ $this, 'filter_by_price_max' ],
84
+ 'price_min' => [ $this, 'filter_by_price_min' ],
85
+ 'provider__not_in' => [ $this, 'filter_by_provider_not_in' ],
86
+ 'provider' => [ $this, 'filter_by_provider' ],
87
+ 'rsvp_status__or_none' => [ $this, 'filter_by_rsvp_status_or_none' ],
88
+ 'rsvp_status' => [ $this, 'filter_by_rsvp_status' ],
89
  ] );
90
 
91
  $this->init_order_statuses();
396
  );
397
  }
398
 
399
+ /**
400
+ * Filters attendee to only get those related to posts with "Show attendees list on event page" set to true.
401
+ *
402
+ *
403
+ * @since 4.11.1
404
+ */
405
+ public function filter_by_show_attendees() {
406
+ $this->where_meta_related_by_meta(
407
+ $this->attendee_to_event_keys(),
408
+ '=',
409
+ '_tribe_hide_attendees_list',
410
+ 1,
411
+ true
412
+ );
413
+ }
414
+
415
  /**
416
  * Filters attendee to only get those related to orders with a specific ID.
417
  *
595
  * @return bool|string
596
  */
597
  protected function init_order_statuses() {
598
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
599
+ $status_mgr = tribe( 'tickets.status' );
600
+
601
  if ( empty( self::$order_statuses ) ) {
602
  // For RSVP tickets the order status is the going status
603
  $statuses = [ 'yes', 'no' ];
604
 
605
  if ( Tribe__Tickets__Commerce__PayPal__Main::get_instance()->is_active() ) {
606
+ $statuses = array_merge( $statuses, $status_mgr->get_statuses_by_action( 'all', 'tpp' ) );
607
  }
608
 
609
  if (
610
  class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' )
611
  && function_exists( 'wc_get_order_statuses' )
612
  ) {
613
+ $statuses = array_merge( $statuses, $status_mgr->get_statuses_by_action( 'all', 'woo' ) );
614
  }
615
 
616
  if (
617
  class_exists( 'Tribe__Tickets_Plus__Commerce__EDD__Main' )
618
  && function_exists( 'edd_get_payment_statuses' )
619
  ) {
620
+ $statuses = array_merge( $statuses, array_keys( $status_mgr->get_statuses_by_action( 'all', 'edd' ) ) );
621
  }
622
 
623
  self::$order_statuses = $statuses;
src/Tribe/Commerce/PayPal/Main.php CHANGED
@@ -2272,10 +2272,10 @@ class Tribe__Tickets__Commerce__PayPal__Main extends Tribe__Tickets__Tickets {
2272
  * @return array An associative array in the [ <slug> => <label> ] format.
2273
  */
2274
  public function get_order_statuses() {
2275
- /** @var Tribe__Tickets__Status__Manager $tickets_status */
2276
- $tickets_status = tribe( 'tickets.status' );
2277
 
2278
- $statuses = $tickets_status->get_all_provider_statuses( 'tpp' );
2279
  $order_statuses = [];
2280
  foreach ( $statuses as $status ) {
2281
  $order_statuses[ $status->provider_name ] = _x( $status->name, 'a PayPal ticket order status', 'event-tickets' );
@@ -2524,7 +2524,10 @@ class Tribe__Tickets__Commerce__PayPal__Main extends Tribe__Tickets__Tickets {
2524
  }
2525
 
2526
  // Get the number of available tickets.
2527
- $available = $ticket_object->available();
 
 
 
2528
 
2529
  // Bail if ticket does not have enough available capacity.
2530
  if ( ( -1 !== $available && $available < $ticket_quantity ) || ! $ticket_object->date_in_range() ) {
@@ -2618,13 +2621,20 @@ class Tribe__Tickets__Commerce__PayPal__Main extends Tribe__Tickets__Tickets {
2618
  * @since 4.7
2619
  */
2620
  public function get_tickets( $post_id ) {
 
 
 
 
 
 
 
2621
  $ticket_ids = $this->get_tickets_ids( $post_id );
2622
 
2623
  if ( ! $ticket_ids ) {
2624
- return array();
2625
  }
2626
 
2627
- $tickets = array();
2628
 
2629
  foreach ( $ticket_ids as $post ) {
2630
  $ticket = $this->get_ticket( $post_id, $post );
2272
  * @return array An associative array in the [ <slug> => <label> ] format.
2273
  */
2274
  public function get_order_statuses() {
2275
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
2276
+ $status_mgr = tribe( 'tickets.status' );
2277
 
2278
+ $statuses = $status_mgr->get_all_provider_statuses( 'tpp' );
2279
  $order_statuses = [];
2280
  foreach ( $statuses as $status ) {
2281
  $order_statuses[ $status->provider_name ] = _x( $status->name, 'a PayPal ticket order status', 'event-tickets' );
2524
  }
2525
 
2526
  // Get the number of available tickets.
2527
+ /** @var Tribe__Tickets__Tickets_Handler $tickets_handler */
2528
+ $tickets_handler = tribe( 'tickets.handler' );
2529
+
2530
+ $available = $tickets_handler->get_ticket_max_purchase( $ticket['ticket_id'] );
2531
 
2532
  // Bail if ticket does not have enough available capacity.
2533
  if ( ( -1 !== $available && $available < $ticket_quantity ) || ! $ticket_object->date_in_range() ) {
2621
  * @since 4.7
2622
  */
2623
  public function get_tickets( $post_id ) {
2624
+ $default_provider = Tribe__Tickets__Tickets::get_event_ticket_provider( $post_id );
2625
+
2626
+ // If the event provider is set to something else, let's save some time, shall we?
2627
+ if ( ! is_admin() && __CLASS__ !== $default_provider ) {
2628
+ return [];
2629
+ }
2630
+
2631
  $ticket_ids = $this->get_tickets_ids( $post_id );
2632
 
2633
  if ( ! $ticket_ids ) {
2634
+ return [];
2635
  }
2636
 
2637
+ $tickets = [];
2638
 
2639
  foreach ( $ticket_ids as $post ) {
2640
  $ticket = $this->get_ticket( $post_id, $post );
src/Tribe/Commerce/PayPal/Orders/Report.php CHANGED
@@ -255,11 +255,14 @@ class Tribe__Tickets__Commerce__PayPal__Orders__Report {
255
  $paypal_tickets = $filtered;
256
  }
257
 
 
 
 
258
  $total_sold = $sales->get_sales_for_tickets( $tickets );
259
- $order_overview = tribe( 'tickets.status' )->get_providers_status_classes( 'tpp' );
260
- $complete_statuses = (array) tribe( 'tickets.status' )->get_statuses_by_action( 'count_completed', 'tpp' );
261
- $incomplete_statuses = (array) tribe( 'tickets.status' )->get_statuses_by_action( 'count_incomplete', 'tpp' );
262
- $tickets_sold = array();
263
 
264
  //update ticket item counts by order status
265
  foreach ( $paypal_tickets as $ticket ) {
255
  $paypal_tickets = $filtered;
256
  }
257
 
258
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
259
+ $status_mgr = tribe( 'tickets.status' );
260
+
261
  $total_sold = $sales->get_sales_for_tickets( $tickets );
262
+ $order_overview = $status_mgr->get_providers_status_classes( 'tpp' );
263
+ $complete_statuses = (array) $status_mgr->get_statuses_by_action( 'count_completed', 'tpp' );
264
+ $incomplete_statuses = (array) $status_mgr->get_statuses_by_action( 'count_incomplete', 'tpp' );
265
+ $tickets_sold = [];
266
 
267
  //update ticket item counts by order status
268
  foreach ( $paypal_tickets as $ticket ) {
src/Tribe/Commerce/PayPal/Orders/Sales.php CHANGED
@@ -88,7 +88,10 @@ class Tribe__Tickets__Commerce__PayPal__Orders__Sales {
88
  * @return array
89
  */
90
  protected function get_revenue_generating_order_statuses() {
91
- $revenue_generating_order_statuses = tribe( 'tickets.status' )->get_statuses_by_action( 'count_completed', 'tpp' );
 
 
 
92
 
93
  /**
94
  * Filters the list of ticket statuses that should be taken into account when calculating revenue.
@@ -391,20 +394,22 @@ class Tribe__Tickets__Commerce__PayPal__Orders__Sales {
391
  * @return array an array of order objects
392
  */
393
  public function get_all_orders_by_product_id( $ID ) {
 
 
394
 
395
- $all_statuses = (array) tribe( 'tickets.status' )->get_statuses_by_action( 'all', 'tpp' );
396
- $args = array(
397
  'post_type' => 'tribe_tpp_orders',
398
  'posts_per_page' => -1,
399
  'post_status' => $all_statuses,
400
- 'meta_query' => array(
401
- array(
402
  'key' => '_tribe_paypal_ticket',
403
  'value' => $ID,
404
- ),
405
- ),
406
  'fields' => 'ids',
407
- );
408
 
409
  $all_order_ids_for_ticket = new WP_Query( $args );
410
  $order_ids = $all_order_ids_for_ticket->posts;
88
  * @return array
89
  */
90
  protected function get_revenue_generating_order_statuses() {
91
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
92
+ $status_mgr = tribe( 'tickets.status' );
93
+
94
+ $revenue_generating_order_statuses = $status_mgr->get_statuses_by_action( 'count_completed', 'tpp' );
95
 
96
  /**
97
  * Filters the list of ticket statuses that should be taken into account when calculating revenue.
394
  * @return array an array of order objects
395
  */
396
  public function get_all_orders_by_product_id( $ID ) {
397
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
398
+ $status_mgr = tribe( 'tickets.status' );
399
 
400
+ $all_statuses = (array) $status_mgr->get_statuses_by_action( 'all', 'tpp' );
401
+ $args = [
402
  'post_type' => 'tribe_tpp_orders',
403
  'posts_per_page' => -1,
404
  'post_status' => $all_statuses,
405
+ 'meta_query' => [
406
+ [
407
  'key' => '_tribe_paypal_ticket',
408
  'value' => $ID,
409
+ ],
410
+ ],
411
  'fields' => 'ids',
412
+ ];
413
 
414
  $all_order_ids_for_ticket = new WP_Query( $args );
415
  $order_ids = $all_order_ids_for_ticket->posts;
src/Tribe/Commerce/PayPal/Orders/Table.php CHANGED
@@ -369,10 +369,12 @@ class Tribe__Tickets__Commerce__PayPal__Orders__Table extends WP_List_Table {
369
  * @return array
370
  */
371
  public function filter_revenue_generating_order_statuses( array $statuses = array() ) {
 
 
372
 
373
  $statuses = array_merge(
374
  $statuses,
375
- tribe( 'tickets.status' )->get_statuses_by_action( array( 'stock_reduced', 'tpp' ) )
376
  );
377
 
378
  return $statuses;
369
  * @return array
370
  */
371
  public function filter_revenue_generating_order_statuses( array $statuses = array() ) {
372
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
373
+ $status_mgr = tribe( 'tickets.status' );
374
 
375
  $statuses = array_merge(
376
  $statuses,
377
+ $status_mgr->get_statuses_by_action( array( 'stock_reduced', 'tpp' ) )
378
  );
379
 
380
  return $statuses;
src/Tribe/Commerce/PayPal/Stati.php CHANGED
@@ -117,8 +117,10 @@ class Tribe__Tickets__Commerce__PayPal__Stati {
117
  * @return array
118
  */
119
  public static function all_statuses() {
 
 
120
 
121
- return tribe( 'tickets.status' )->get_statuses_by_action( 'all', 'tpp' );
122
  }
123
 
124
  /**
@@ -134,7 +136,10 @@ class Tribe__Tickets__Commerce__PayPal__Stati {
134
  * @return bool
135
  */
136
  public function is_complete_transaction_status( $payment_status ) {
137
- $statuses = tribe( 'tickets.status' )->get_statuses_by_action( array( 'count_completed', 'count_refunded' ), 'tpp', 'OR' );
 
 
 
138
 
139
  /**
140
  * Filters the statuses that will mark a PayPal transaction as completed.
@@ -159,7 +164,10 @@ class Tribe__Tickets__Commerce__PayPal__Stati {
159
  * @return bool
160
  */
161
  public function is_revenue_generating_status( $payment_status ) {
162
- $statuses = tribe( 'tickets.status' )->get_statuses_by_action( 'count_completed', 'tpp' );
 
 
 
163
 
164
  /**
165
  * Filters the statuses that will mark a PayPal transaction as generating
117
  * @return array
118
  */
119
  public static function all_statuses() {
120
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
121
+ $status_mgr = tribe( 'tickets.status' );
122
 
123
+ return $status_mgr->get_statuses_by_action( 'all', 'tpp' );
124
  }
125
 
126
  /**
136
  * @return bool
137
  */
138
  public function is_complete_transaction_status( $payment_status ) {
139
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
140
+ $status_mgr = tribe( 'tickets.status' );
141
+
142
+ $statuses = $status_mgr->get_statuses_by_action( array( 'count_completed', 'count_refunded' ), 'tpp', 'OR' );
143
 
144
  /**
145
  * Filters the statuses that will mark a PayPal transaction as completed.
164
  * @return bool
165
  */
166
  public function is_revenue_generating_status( $payment_status ) {
167
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
168
+ $status_mgr = tribe( 'tickets.status' );
169
+
170
+ $statuses = $status_mgr->get_statuses_by_action( 'count_completed', 'tpp' );
171
 
172
  /**
173
  * Filters the statuses that will mark a PayPal transaction as generating
src/Tribe/Commerce/PayPal/Tickets_View.php CHANGED
@@ -137,9 +137,11 @@ class Tribe__Tickets__Commerce__PayPal__Tickets_View extends Tribe__Tickets__Tic
137
  $ticket_status = __( 'unavailable', 'event-tickets' );
138
 
139
  if ( ! empty( $status ) ) {
 
 
140
 
141
- $statuses = tribe( 'tickets.status' )->get_all_provider_statuses( 'tpp' );
142
- $status_strings = array();
143
  foreach ( $statuses as $s ) {
144
  $status_strings[ $s->provider_name ] = _x( $s->name, 'a PayPal ticket order status', 'event-tickets' );
145
  }
137
  $ticket_status = __( 'unavailable', 'event-tickets' );
138
 
139
  if ( ! empty( $status ) ) {
140
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
141
+ $status_mgr = tribe( 'tickets.status' );
142
 
143
+ $statuses = $status_mgr->get_all_provider_statuses( 'tpp' );
144
+ $status_strings = [];
145
  foreach ( $statuses as $s ) {
146
  $status_strings[ $s->provider_name ] = _x( $s->name, 'a PayPal ticket order status', 'event-tickets' );
147
  }
src/Tribe/Data_API.php CHANGED
@@ -22,6 +22,9 @@ class Tribe__Tickets__Data_API {
22
  * Setup activate ticket classes and field for data api
23
  */
24
  protected function setup_data() {
 
 
 
25
  foreach ( Tribe__Tickets__Tickets::modules() as $module_class => $module_instance ) {
26
  $provider = call_user_func( array( $module_class, 'get_instance' ) );
27
 
@@ -50,7 +53,7 @@ class Tribe__Tickets__Data_API {
50
  $this->ticket_class[ $module_class ]['tribe_for_event'] = $provider->event_key;
51
  $this->ticket_class[ $module_class ]['event_id_key'] = constant( "$module_class::ATTENDEE_EVENT_KEY" );
52
  $this->ticket_class[ $module_class ]['order_id_key'] = constant( "$module_class::ATTENDEE_ORDER_KEY" );
53
- $this->ticket_class[ $module_class ]['slug'] = tribe( 'tickets.status' )->get_provider_slug( $module_class );
54
  }
55
 
56
  $this->ticket_types['events'][] = class_exists( 'Tribe__Events__Main' ) ? Tribe__Events__Main::POSTTYPE : '';
22
  * Setup activate ticket classes and field for data api
23
  */
24
  protected function setup_data() {
25
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
26
+ $status_mgr = tribe( 'tickets.status' );
27
+
28
  foreach ( Tribe__Tickets__Tickets::modules() as $module_class => $module_instance ) {
29
  $provider = call_user_func( array( $module_class, 'get_instance' ) );
30
 
53
  $this->ticket_class[ $module_class ]['tribe_for_event'] = $provider->event_key;
54
  $this->ticket_class[ $module_class ]['event_id_key'] = constant( "$module_class::ATTENDEE_EVENT_KEY" );
55
  $this->ticket_class[ $module_class ]['order_id_key'] = constant( "$module_class::ATTENDEE_ORDER_KEY" );
56
+ $this->ticket_class[ $module_class ]['slug'] = $status_mgr->get_provider_slug( $module_class );
57
  }
58
 
59
  $this->ticket_types['events'][] = class_exists( 'Tribe__Events__Main' ) ? Tribe__Events__Main::POSTTYPE : '';
src/Tribe/Editor/Blocks/Attendees.php CHANGED
@@ -46,7 +46,7 @@ class Tribe__Tickets__Editor__Blocks__Attendees
46
  $gutenberg,
47
  'tribe-tickets-gutenberg-block-attendees-style',
48
  'app/attendees/frontend.css',
49
- [ 'event-tickets-tickets-common' ],
50
  null
51
  );
52
  }
46
  $gutenberg,
47
  'tribe-tickets-gutenberg-block-attendees-style',
48
  'app/attendees/frontend.css',
49
+ [],
50
  null
51
  );
52
  }
src/Tribe/Editor/Blocks/Rsvp.php CHANGED
@@ -241,8 +241,8 @@ extends Tribe__Editor__Blocks__Abstract {
241
  wp_send_json_error( $response );
242
  }
243
 
244
- /** @var Tribe__Tickets__RSVP $rsvp */
245
- $rsvp = tribe( 'tickets.rsvp' );
246
  $has_tickets = false;
247
  $event = $rsvp->get_event_for_ticket( $ticket_id );
248
  $post_id = $event->ID;
@@ -271,7 +271,7 @@ extends Tribe__Editor__Blocks__Abstract {
271
  }
272
 
273
  $has_tickets |= $rsvp->generate_tickets_for( $product_id, $ticket_qty, $attendee_details );
274
- }
275
 
276
  $order_id = $attendee_details['order_id'];
277
  $attendee_order_status = $attendee_details['order_status'];
241
  wp_send_json_error( $response );
242
  }
243
 
244
+ /** @var Tribe__Tickets__RSVP $rsvp */
245
+ $rsvp = tribe( 'tickets.rsvp' );
246
  $has_tickets = false;
247
  $event = $rsvp->get_event_for_ticket( $ticket_id );
248
  $post_id = $event->ID;
271
  }
272
 
273
  $has_tickets |= $rsvp->generate_tickets_for( $product_id, $ticket_qty, $attendee_details );
274
+ }
275
 
276
  $order_id = $attendee_details['order_id'];
277
  $attendee_order_status = $attendee_details['order_status'];
src/Tribe/Editor/Blocks/Tickets.php CHANGED
@@ -47,6 +47,11 @@ extends Tribe__Editor__Blocks__Abstract {
47
  return;
48
  }
49
 
 
 
 
 
 
50
  // If Provider is not active return
51
  if ( ! array_key_exists( $provider, Tribe__Tickets__Tickets::modules() ) ) {
52
  return;
@@ -151,20 +156,30 @@ extends Tribe__Editor__Blocks__Abstract {
151
  wp_send_json_error( $response );
152
  }
153
 
 
 
 
 
 
 
154
  // Parse the tickets and create the array for the response
155
  foreach ( $tickets as $ticket_id ) {
156
- $ticket = Tribe__Tickets__Tickets::load_ticket_object( $ticket_id );
157
 
158
- if ( empty( $ticket ) ) {
 
 
 
159
  continue;
160
  }
161
 
162
- $available = $ticket->available();
 
163
  $response['tickets'][ $ticket_id ]['available'] = $available;
164
 
165
  // If there are no more available we will send the template part HTML to update the DOM
166
  if ( 0 === $available ) {
167
- $response['tickets'][ $ticket_id ]['unavailable_html'] = tribe( 'tickets.editor.template' )->template( 'blocks/tickets/quantity-unavailable', $ticket, false );
168
  }
169
  }
170
 
47
  return;
48
  }
49
 
50
+ // No need to handle RSVPs here
51
+ if ( 'Tribe__Tickets__RSVP' === $provider ) {
52
+ return;
53
+ }
54
+
55
  // If Provider is not active return
56
  if ( ! array_key_exists( $provider, Tribe__Tickets__Tickets::modules() ) ) {
57
  return;
156
  wp_send_json_error( $response );
157
  }
158
 
159
+ /** @var Tribe__Tickets__Tickets_Handler $tickets_handler */
160
+ $tickets_handler = tribe( 'tickets.handler' );
161
+
162
+ /** @var Tribe__Tickets__Editor__Template $tickets_editor */
163
+ $tickets_editor = tribe( 'tickets.editor.template' );
164
+
165
  // Parse the tickets and create the array for the response
166
  foreach ( $tickets as $ticket_id ) {
167
+ $ticket = Tribe__Tickets__Tickets::load_ticket_object( $ticket_id );
168
 
169
+ if (
170
+ ! $ticket instanceof Tribe__Tickets__Ticket_Object
171
+ || empty( $ticket->ID )
172
+ ) {
173
  continue;
174
  }
175
 
176
+ $available = $tickets_handler->get_ticket_max_purchase( $ticket->ID );
177
+
178
  $response['tickets'][ $ticket_id ]['available'] = $available;
179
 
180
  // If there are no more available we will send the template part HTML to update the DOM
181
  if ( 0 === $available ) {
182
+ $response['tickets'][ $ticket_id ]['unavailable_html'] = $tickets_editor->template( 'blocks/tickets/quantity-unavailable', $ticket, false );
183
  }
184
  }
185
 
src/Tribe/Editor/Meta.php CHANGED
@@ -150,6 +150,13 @@ class Tribe__Tickets__Editor__Meta extends Tribe__Editor__Meta {
150
  return $args;
151
  }
152
 
 
 
 
 
 
 
 
153
  $args['type'] = [
154
  $args['type'],
155
  'null',
@@ -172,6 +179,15 @@ class Tribe__Tickets__Editor__Meta extends Tribe__Editor__Meta {
172
  return $args;
173
  }
174
 
 
 
 
 
 
 
 
 
 
175
  $args['type'] = [
176
  $args['type'],
177
  'null',
150
  return $args;
151
  }
152
 
153
+ // REST API needs more help because it doesn't like 'type' being an array (yet).
154
+ $args['show_in_rest'] = [
155
+ 'schema' => [
156
+ 'type' => $args['type'],
157
+ ],
158
+ ];
159
+
160
  $args['type'] = [
161
  $args['type'],
162
  'null',
179
  return $args;
180
  }
181
 
182
+ // REST API needs more help because it doesn't like 'type' being an array (yet).
183
+ $args['show_in_rest'] = [
184
+ // Especially for boolean, if 'type' isn't reasserted on this next line it throws 500 errors.
185
+ 'type' => $args['type'],
186
+ 'schema' => [
187
+ 'type' => $args['type'],
188
+ ],
189
+ ];
190
+
191
  $args['type'] = [
192
  $args['type'],
193
  'null',
src/Tribe/Main.php CHANGED
@@ -4,7 +4,7 @@ class Tribe__Tickets__Main {
4
  /**
5
  * Current version of this plugin
6
  */
7
- const VERSION = '4.11.0.1';
8
 
9
  /**
10
  * Min required The Events Calendar version
@@ -317,13 +317,11 @@ class Tribe__Tickets__Main {
317
  * Load Text Domain on tribe_common_loaded as it requires common
318
  *
319
  * @since 4.10
320
- *
321
  */
322
  public function bootstrap() {
323
-
324
  Tribe__Main::instance( $this )->load_text_domain( 'event-tickets', $this->plugin_dir . 'lang/' );
325
 
326
- // Intialize the Service Provider for Tickets
327
  tribe_register_provider( 'Tribe__Tickets__Service_Provider' );
328
 
329
  $this->hooks();
@@ -339,13 +337,13 @@ class Tribe__Tickets__Main {
339
  Tribe__Tickets__JSON_LD__Order::hook();
340
  Tribe__Tickets__JSON_LD__Type::hook();
341
 
 
342
  tribe( 'tickets.privacy' );
343
 
344
  /**
345
  * Fires once Event Tickets has completed basic setup.
346
  */
347
  do_action( 'tribe_tickets_plugin_loaded' );
348
-
349
  }
350
 
351
  /**
@@ -546,7 +544,7 @@ class Tribe__Tickets__Main {
546
  // Setup Front End Display
547
  add_action( 'tribe_events_inside_cost', 'tribe_tickets_buy_button', 10, 0 );
548
 
549
- // Hook to oembeds
550
  add_action( 'tribe_events_embed_after_the_cost_value', [ $this, 'inject_buy_button_into_oembed' ] );
551
  add_action( 'embed_head', [ $this, 'embed_head' ] );
552
 
@@ -575,7 +573,15 @@ class Tribe__Tickets__Main {
575
  add_filter( 'tribe_event_import_rsvp_column_names', [ Tribe__Tickets__CSV_Importer__Column_Names::instance(), 'filter_rsvp_column_names' ] );
576
  }
577
 
578
- // Load our assets
 
 
 
 
 
 
 
 
579
  add_action( 'tribe_tickets_plugin_loaded', tribe_callback( 'tickets.assets', 'enqueue_scripts' ) );
580
  add_action( 'tribe_tickets_plugin_loaded', tribe_callback( 'tickets.assets', 'admin_enqueue_scripts' ) );
581
  add_action( 'admin_enqueue_scripts', tribe_callback( 'tickets.assets', 'enqueue_editor_scripts' ) );
@@ -916,7 +922,7 @@ class Tribe__Tickets__Main {
916
 
917
  $button_text = $has_non_rsvp ? __( 'Buy', 'event-tickets' ) : tribe_get_rsvp_label_singular( 'button_text' );
918
  /**
919
- * Filters the text that appears in the buy/rsvp button on event oembeds
920
  *
921
  * @var string The button text
922
  * @var int Event ID
@@ -930,7 +936,7 @@ class Tribe__Tickets__Main {
930
  $buy_button = ob_get_clean();
931
 
932
  /**
933
- * Filters the buy button that appears on event oembeds
934
  *
935
  * @var string The button markup
936
  * @var int Event ID
4
  /**
5
  * Current version of this plugin
6
  */
7
+ const VERSION = '4.11.1';
8
 
9
  /**
10
  * Min required The Events Calendar version
317
  * Load Text Domain on tribe_common_loaded as it requires common
318
  *
319
  * @since 4.10
 
320
  */
321
  public function bootstrap() {
 
322
  Tribe__Main::instance( $this )->load_text_domain( 'event-tickets', $this->plugin_dir . 'lang/' );
323
 
324
+ // Initialize the Service Provider for Tickets
325
  tribe_register_provider( 'Tribe__Tickets__Service_Provider' );
326
 
327
  $this->hooks();
337
  Tribe__Tickets__JSON_LD__Order::hook();
338
  Tribe__Tickets__JSON_LD__Type::hook();
339
 
340
+ /** @var Tribe__Tickets__Privacy */
341
  tribe( 'tickets.privacy' );
342
 
343
  /**
344
  * Fires once Event Tickets has completed basic setup.
345
  */
346
  do_action( 'tribe_tickets_plugin_loaded' );
 
347
  }
348
 
349
  /**
544
  // Setup Front End Display
545
  add_action( 'tribe_events_inside_cost', 'tribe_tickets_buy_button', 10, 0 );
546
 
547
+ // Hook to oEmbeds
548
  add_action( 'tribe_events_embed_after_the_cost_value', [ $this, 'inject_buy_button_into_oembed' ] );
549
  add_action( 'embed_head', [ $this, 'embed_head' ] );
550
 
573
  add_filter( 'tribe_event_import_rsvp_column_names', [ Tribe__Tickets__CSV_Importer__Column_Names::instance(), 'filter_rsvp_column_names' ] );
574
  }
575
 
576
+ /**
577
+ * Load our assets.
578
+ *
579
+ * @see \Tribe__Tickets__Assets::enqueue_scripts()
580
+ * @see \Tribe__Tickets__Assets::admin_enqueue_scripts()
581
+ * @see \Tribe__Tickets__Assets::enqueue_editor_scripts()
582
+ * @see \Tribe__Tickets__Assets::add_data_strings()
583
+ */
584
+
585
  add_action( 'tribe_tickets_plugin_loaded', tribe_callback( 'tickets.assets', 'enqueue_scripts' ) );
586
  add_action( 'tribe_tickets_plugin_loaded', tribe_callback( 'tickets.assets', 'admin_enqueue_scripts' ) );
587
  add_action( 'admin_enqueue_scripts', tribe_callback( 'tickets.assets', 'enqueue_editor_scripts' ) );
922
 
923
  $button_text = $has_non_rsvp ? __( 'Buy', 'event-tickets' ) : tribe_get_rsvp_label_singular( 'button_text' );
924
  /**
925
+ * Filters the text that appears in the buy/rsvp button on event oEmbeds
926
  *
927
  * @var string The button text
928
  * @var int Event ID
936
  $buy_button = ob_get_clean();
937
 
938
  /**
939
+ * Filters the buy button that appears on event oEmbeds
940
  *
941
  * @var string The button markup
942
  * @var int Event ID
src/Tribe/Plugin_Register.php CHANGED
@@ -8,7 +8,7 @@ class Tribe__Tickets__Plugin_Register extends Tribe__Abstract_Plugin_Register {
8
  protected $main_class = 'Tribe__Tickets__Main';
9
  protected $dependencies = array(
10
  'addon-dependencies' => array(
11
- 'Tribe__Tickets_Plus__Main' => '4.11-dev',
12
  'Tribe__Events__Community__Tickets__Main' => '4.7-dev',
13
  ),
14
  );
8
  protected $main_class = 'Tribe__Tickets__Main';
9
  protected $dependencies = array(
10
  'addon-dependencies' => array(
11
+ 'Tribe__Tickets_Plus__Main' => '4.11.0-dev',
12
  'Tribe__Events__Community__Tickets__Main' => '4.7-dev',
13
  ),
14
  );
src/Tribe/REST/V1/Attendee_Repository.php CHANGED
@@ -43,6 +43,7 @@ class Tribe__Tickets__REST__V1__Attendee_Repository
43
  $this->decorated->by( 'optout', 'no' );
44
  $this->decorated->by( 'post_status', 'publish' );
45
  $this->decorated->by( 'rsvp_status__or_none', 'yes' );
 
46
  }
47
 
48
  $this->decorated->set_query_builder( null );
43
  $this->decorated->by( 'optout', 'no' );
44
  $this->decorated->by( 'post_status', 'publish' );
45
  $this->decorated->by( 'rsvp_status__or_none', 'yes' );
46
+ $this->decorated->by( 'event__show_attendees' );
47
  }
48
 
49
  $this->decorated->set_query_builder( null );
src/Tribe/RSVP.php CHANGED
@@ -424,7 +424,10 @@ class Tribe__Tickets__RSVP extends Tribe__Tickets__Tickets {
424
  * @return array an array of statuses
425
  */
426
  public function get_statuses_by_action( $action ) {
427
- return tribe( 'tickets.status' )->get_statuses_by_action( $action, 'rsvp' );
 
 
 
428
  }
429
 
430
  /**
@@ -605,7 +608,10 @@ class Tribe__Tickets__RSVP extends Tribe__Tickets__Tickets {
605
  */
606
  do_action( 'event_tickets_rsvp_tickets_generated', $order_id, $post_id, $attendee_order_status );
607
 
608
- $send_mail_stati = tribe( 'tickets.status' )->get_statuses_by_action( 'attendee_dispatch', 'rsvp' );
 
 
 
609
 
610
  /**
611
  * Filters whether a confirmation email should be sent or not for RSVP tickets.
@@ -1877,8 +1883,10 @@ class Tribe__Tickets__RSVP extends Tribe__Tickets__Tickets {
1877
  * @return array The original array plus the 'yes' status.
1878
  */
1879
  public function filter_event_tickets_attendees_rsvp_checkin_stati( array $stati = array() ) {
 
 
1880
 
1881
- $merged_array = array_merge( $stati, ( tribe( 'tickets.status' )->get_statuses_by_action( 'count_completed', 'rsvp' ) ) );
1882
 
1883
  return array_unique( $merged_array );
1884
  }
424
  * @return array an array of statuses
425
  */
426
  public function get_statuses_by_action( $action ) {
427
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
428
+ $status_mgr = tribe( 'tickets.status' );
429
+
430
+ return $status_mgr->get_statuses_by_action( $action, 'rsvp' );
431
  }
432
 
433
  /**
608
  */
609
  do_action( 'event_tickets_rsvp_tickets_generated', $order_id, $post_id, $attendee_order_status );
610
 
611
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
612
+ $status_mgr = tribe( 'tickets.status' );
613
+
614
+ $send_mail_stati = $status_mgr->get_statuses_by_action( 'attendee_dispatch', 'rsvp' );
615
 
616
  /**
617
  * Filters whether a confirmation email should be sent or not for RSVP tickets.
1883
  * @return array The original array plus the 'yes' status.
1884
  */
1885
  public function filter_event_tickets_attendees_rsvp_checkin_stati( array $stati = array() ) {
1886
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
1887
+ $status_mgr = tribe( 'tickets.status' );
1888
 
1889
+ $merged_array = array_merge( $stati, ( $status_mgr->get_statuses_by_action( 'count_completed', 'rsvp' ) ) );
1890
 
1891
  return array_unique( $merged_array );
1892
  }
src/Tribe/Status/Abstract_Commerce.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
 
 
3
 
4
  /**
5
  * Class Tribe__Tickets__Status__Abstract_Commerce
@@ -17,12 +18,12 @@ class Tribe__Tickets__Status__Abstract_Commerce {
17
  /**
18
  * @var array an array of status names for a commerce
19
  */
20
- public $status_names = array();
21
 
22
  /**
23
  * @var array an array of status objects
24
  */
25
- public $statuses = array();
26
 
27
  /**
28
  * @var int the quantity of tickets sold for a post type
@@ -244,7 +245,10 @@ class Tribe__Tickets__Status__Abstract_Commerce {
244
 
245
  $message = esc_html__( 'Sold counts tickets from completed orders only.', 'event-tickets' );
246
 
247
- return tribe( 'tooltip.view' )->render_tooltip( $message );
 
 
 
248
  }
249
 
250
  /**
@@ -255,10 +259,12 @@ class Tribe__Tickets__Status__Abstract_Commerce {
255
  * @return string a string of html for the tooltip
256
  */
257
  public function get_total_sale_tooltip() {
 
 
258
 
259
  $message = esc_html__( 'Total Sales counts tickets from all completed orders.', 'event-tickets' );
260
 
261
- return tribe( 'tooltip.view' )->render_tooltip( $message );
262
  }
263
 
264
  /**
@@ -272,7 +278,10 @@ class Tribe__Tickets__Status__Abstract_Commerce {
272
 
273
  $message = esc_html__( 'Total Ordered counts tickets from orders of any status, including pending and refunded.', 'event-tickets' );
274
 
275
- return tribe( 'tooltip.view' )->render_tooltip( $message );
 
 
 
276
  }
277
 
278
  /**
@@ -285,13 +294,22 @@ class Tribe__Tickets__Status__Abstract_Commerce {
285
  * @return string a string of html for the tooltip
286
  */
287
  public function get_pending_by_ticket_tooltip( $ticket_sold ) {
 
 
288
 
289
  $args = [
290
- 'incomplete_statuses' => (array) tribe( 'tickets.status' )->get_statuses_by_action( 'count_incomplete', $ticket_sold['ticket']->provider_class, null, true ),
291
  ];
292
- $message = tribe( 'tickets.admin.views' )->template( 'order-pending-completion', $args, false );
293
 
294
- return tribe( 'tooltip.view' )->render_tooltip( $message );
 
 
 
 
 
 
 
 
295
  }
296
 
297
 
@@ -317,8 +335,11 @@ class Tribe__Tickets__Status__Abstract_Commerce {
317
 
318
  $args = [ 'wrap_classes' => 'large' ];
319
 
320
- return tribe( 'tooltip.view' )->render_tooltip( $message, $args );
 
 
 
321
 
322
  }
323
 
324
- }
1
  <?php
2
 
3
+ use Tribe\Tooltip\View as Tooltip_View;
4
 
5
  /**
6
  * Class Tribe__Tickets__Status__Abstract_Commerce
18
  /**
19
  * @var array an array of status names for a commerce
20
  */
21
+ public $status_names = [];
22
 
23
  /**
24
  * @var array an array of status objects
25
  */
26
+ public $statuses = [];
27
 
28
  /**
29
  * @var int the quantity of tickets sold for a post type
245
 
246
  $message = esc_html__( 'Sold counts tickets from completed orders only.', 'event-tickets' );
247
 
248
+ /** @var Tooltip_View $tooltip */
249
+ $tooltip = tribe( 'tooltip.view' );
250
+
251
+ return $tooltip->render_tooltip( $message );
252
  }
253
 
254
  /**
259
  * @return string a string of html for the tooltip
260
  */
261
  public function get_total_sale_tooltip() {
262
+ /** @var Tooltip_View $tooltip */
263
+ $tooltip = tribe( 'tooltip.view' );
264
 
265
  $message = esc_html__( 'Total Sales counts tickets from all completed orders.', 'event-tickets' );
266
 
267
+ return $tooltip->render_tooltip( $message );
268
  }
269
 
270
  /**
278
 
279
  $message = esc_html__( 'Total Ordered counts tickets from orders of any status, including pending and refunded.', 'event-tickets' );
280
 
281
+ /** @var Tooltip_View $tooltip */
282
+ $tooltip = tribe( 'tooltip.view' );
283
+
284
+ return $tooltip->render_tooltip( $message );
285
  }
286
 
287
  /**
294
  * @return string a string of html for the tooltip
295
  */
296
  public function get_pending_by_ticket_tooltip( $ticket_sold ) {
297
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
298
+ $status_mgr = tribe( 'tickets.status' );
299
 
300
  $args = [
301
+ 'incomplete_statuses' => (array) $status_mgr->get_statuses_by_action( 'count_incomplete', $ticket_sold['ticket']->provider_class, null, true ),
302
  ];
 
303
 
304
+ /** @var Tribe__Tickets__Admin__Views $admin_views */
305
+ $admin_views = tribe( 'tickets.admin.views' );
306
+
307
+ $message = $admin_views->template( 'order-pending-completion', $args, false );
308
+
309
+ /** @var Tooltip_View $tooltip */
310
+ $tooltip = tribe( 'tooltip.view' );
311
+
312
+ return $tooltip->render_tooltip( $message );
313
  }
314
 
315
 
335
 
336
  $args = [ 'wrap_classes' => 'large' ];
337
 
338
+ /** @var Tooltip_View $tooltip */
339
+ $tooltip = tribe( 'tooltip.view' );
340
+
341
+ return $tooltip->render_tooltip( $message, $args );
342
 
343
  }
344
 
345
+ }
src/Tribe/Ticket_Object.php CHANGED
@@ -557,10 +557,13 @@ if ( ! class_exists( 'Tribe__Tickets__Ticket_Object' ) ) {
557
  return -1;
558
  }
559
 
 
 
 
560
  // Fetch the Attendees
561
  $attendees = $this->provider->get_attendees_by_id( $this->ID );
562
  $attendees_count = 0;
563
- $not_going_arr = tribe( 'tickets.status' )->get_statuses_by_action( 'count_not_going', 'rsvp' );
564
 
565
  // Loop on All the attendees, allowing for some filtering of which will be removed or not
566
  foreach ( $attendees as $attendee ) {
@@ -635,6 +638,8 @@ if ( ! class_exists( 'Tribe__Tickets__Ticket_Object' ) ) {
635
  *
636
  * @todo Create a way to get the Available for an Event (currently impossible)
637
  *
 
 
638
  * @since 4.6
639
  *
640
  * @return int
557
  return -1;
558
  }
559
 
560
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
561
+ $status_mgr = tribe( 'tickets.status' );
562
+
563
  // Fetch the Attendees
564
  $attendees = $this->provider->get_attendees_by_id( $this->ID );
565
  $attendees_count = 0;
566
+ $not_going_arr = $status_mgr->get_statuses_by_action( 'count_not_going', 'rsvp' );
567
 
568
  // Loop on All the attendees, allowing for some filtering of which will be removed or not
569
  foreach ( $attendees as $attendee ) {
638
  *
639
  * @todo Create a way to get the Available for an Event (currently impossible)
640
  *
641
+ * @see \Tribe__Tickets__Tickets_Handler::get_ticket_max_purchase() Use instead to get the front-end quantity.
642
+ *
643
  * @since 4.6
644
  *
645
  * @return int
src/Tribe/Tickets.php CHANGED
@@ -2817,6 +2817,8 @@ if ( ! class_exists( 'Tribe__Tickets__Tickets' ) ) {
2817
  $tickets_handler->toggle_manual_update_flag( false );
2818
 
2819
  $post = get_post( $post_id );
 
 
2820
  if ( empty( $data['ticket_start_date'] ) ) {
2821
  $date = strtotime( $post->post_date );
2822
  $date = date( 'Y-m-d 00:00:00', $date );
@@ -2824,9 +2826,13 @@ if ( ! class_exists( 'Tribe__Tickets__Tickets' ) ) {
2824
  update_post_meta( $ticket->ID, $tickets_handler->key_start_date, $date );
2825
  }
2826
 
 
 
 
 
2827
  if ( empty( $data['ticket_end_date'] ) && 'tribe_events' === $post->post_type ) {
2828
- $event_end = get_post_meta( $post_id, '_EventEndDate', true );
2829
- update_post_meta( $ticket->ID, $tickets_handler->key_end_date, $event_end );
2830
  }
2831
 
2832
  tribe( 'tickets.version' )->update( $ticket->ID );
2817
  $tickets_handler->toggle_manual_update_flag( false );
2818
 
2819
  $post = get_post( $post_id );
2820
+
2821
+ // If ticket start date is not set, set it to the post date.
2822
  if ( empty( $data['ticket_start_date'] ) ) {
2823
  $date = strtotime( $post->post_date );
2824
  $date = date( 'Y-m-d 00:00:00', $date );
2826
  update_post_meta( $ticket->ID, $tickets_handler->key_start_date, $date );
2827
  }
2828
 
2829
+ /*
2830
+ * If the ticket end date has not been set and we have an event,
2831
+ * set the ticket end date to the event start date.
2832
+ */
2833
  if ( empty( $data['ticket_end_date'] ) && 'tribe_events' === $post->post_type ) {
2834
+ $event_start = get_post_meta( $post_id, '_EventStartDate', true );
2835
+ update_post_meta( $ticket->ID, $tickets_handler->key_end_date, $event_start );
2836
  }
2837
 
2838
  tribe( 'tickets.version' )->update( $ticket->ID );
src/Tribe/Tickets_Handler.php CHANGED
@@ -179,7 +179,7 @@ class Tribe__Tickets__Tickets_Handler {
179
  }
180
 
181
  /**
182
- * On update of the Event End date we update the ticket end date
183
  * if it wasn't manually updated
184
  *
185
  * @since 4.6
@@ -193,7 +193,7 @@ class Tribe__Tickets__Tickets_Handler {
193
  */
194
  public function update_meta_date( $meta_id, $object_id, $meta_key, $date ) {
195
  $meta_map = array(
196
- '_EventEndDate' => $this->key_end_date,
197
  );
198
 
199
  // Bail when it's not on the Map Meta
@@ -484,7 +484,7 @@ class Tribe__Tickets__Tickets_Handler {
484
  $event_types = Tribe__Tickets__Main::instance()->post_types();
485
 
486
  // Bail on non event like post type
487
- if ( ! in_array( get_post_type( $object_id ), $event_types ) ) {
488
  return false;
489
  }
490
 
@@ -586,6 +586,12 @@ class Tribe__Tickets__Tickets_Handler {
586
  // Do the migration
587
  $capacity = $this->migrate_object_capacity( $object_id );
588
 
 
 
 
 
 
 
589
  // Hook it back up
590
  add_filter( 'get_post_metadata', array( $this, 'filter_capacity_support' ), 15, 4 );
591
 
179
  }
180
 
181
  /**
182
+ * On update of the event start date we update the ticket end date
183
  * if it wasn't manually updated
184
  *
185
  * @since 4.6
193
  */
194
  public function update_meta_date( $meta_id, $object_id, $meta_key, $date ) {
195
  $meta_map = array(
196
+ '_EventStartDate' => $this->key_end_date,
197
  );
198
 
199
  // Bail when it's not on the Map Meta
484
  $event_types = Tribe__Tickets__Main::instance()->post_types();
485
 
486
  // Bail on non event like post type
487
+ if ( ! in_array( get_post_type( $object_id ), $event_types, true ) ) {
488
  return false;
489
  }
490
 
586
  // Do the migration
587
  $capacity = $this->migrate_object_capacity( $object_id );
588
 
589
+ if ( false === $capacity ) {
590
+ $capacity = '';
591
+ } elseif ( is_int( $capacity ) ) {
592
+ $capacity = (string) $capacity;
593
+ }
594
+
595
  // Hook it back up
596
  add_filter( 'get_post_metadata', array( $this, 'filter_capacity_support' ), 15, 4 );
597
 
src/Tribe/Tickets_View.php CHANGED
@@ -661,8 +661,10 @@ class Tribe__Tickets__Tickets_View {
661
  * option data or `false` if the selected option does not exist.
662
  */
663
  public function get_rsvp_options( $selected = null, $just_labels = true ) {
 
 
664
 
665
- $options = tribe( 'tickets.status' )->get_status_options( 'rsvp' );
666
 
667
  /**
668
  * Allow users to add more RSVP options.
@@ -947,20 +949,29 @@ class Tribe__Tickets__Tickets_View {
947
  */
948
  public function get_tickets_block( $post ) {
949
  if ( empty( $post ) ) {
950
- return;
951
  }
952
 
953
  if ( is_numeric( $post ) ) {
954
  $post = get_post( $post );
955
  }
956
 
957
- if ( empty( $post ) || ! ( $post instanceof WP_Post ) ) {
958
- return;
 
 
 
959
  }
960
 
961
  $post_id = $post->ID;
962
  $provider_id = Tribe__Tickets__Tickets::get_event_ticket_provider( $post_id );
963
- $provider = call_user_func( [ $provider_id, 'get_instance' ] );
 
 
 
 
 
 
964
 
965
  /** @var \Tribe__Tickets__Editor__Template $template */
966
  $template = tribe( 'tickets.editor.template' );
@@ -990,4 +1001,4 @@ class Tribe__Tickets__Tickets_View {
990
 
991
  return $template->template( 'blocks/tickets', $args );
992
  }
993
- }
661
  * option data or `false` if the selected option does not exist.
662
  */
663
  public function get_rsvp_options( $selected = null, $just_labels = true ) {
664
+ /** @var Tribe__Tickets__Status__Manager $status_mgr */
665
+ $status_mgr = tribe( 'tickets.status' );
666
 
667
+ $options = $status_mgr->get_status_options( 'rsvp' );
668
 
669
  /**
670
  * Allow users to add more RSVP options.
949
  */
950
  public function get_tickets_block( $post ) {
951
  if ( empty( $post ) ) {
952
+ return '';
953
  }
954
 
955
  if ( is_numeric( $post ) ) {
956
  $post = get_post( $post );
957
  }
958
 
959
+ if (
960
+ empty( $post )
961
+ || ! ( $post instanceof WP_Post )
962
+ ) {
963
+ return '';
964
  }
965
 
966
  $post_id = $post->ID;
967
  $provider_id = Tribe__Tickets__Tickets::get_event_ticket_provider( $post_id );
968
+
969
+ // Protect against ticket that exists but is of a type that is not enabled
970
+ if ( ! method_exists( $provider_id, 'get_instance' ) ) {
971
+ return '';
972
+ }
973
+
974
+ $provider = call_user_func( [ $provider_id, 'get_instance' ] );
975
 
976
  /** @var \Tribe__Tickets__Editor__Template $template */
977
  $template = tribe( 'tickets.editor.template' );
1001
 
1002
  return $template->template( 'blocks/tickets', $args );
1003
  }
1004
+ }
src/Tribe/Views/V2/Models/Tickets.php CHANGED
@@ -149,7 +149,10 @@ class Tickets implements \ArrayAccess, \Serializable{
149
  }
150
 
151
  if ( $stock ) {
152
- $threshold = \Tribe__Settings_Manager::get_option( 'ticket-display-tickets-left-threshold', 0 );
 
 
 
153
 
154
  /**
155
  * Overwrites the threshold to display "# tickets left".
149
  }
150
 
151
  if ( $stock ) {
152
+ /** @var Tribe__Settings_Manager $settings_manager */
153
+ $settings_manager = tribe( 'settings.manager' );
154
+
155
+ $threshold = $settings_manager::get_option( 'ticket-display-tickets-left-threshold', 0 );
156
 
157
  /**
158
  * Overwrites the threshold to display "# tickets left".
src/modules/blocks/rsvp/header-image/container.js CHANGED
@@ -8,7 +8,7 @@ import { compose } from 'redux';
8
  * Internal dependencies
9
  */
10
  import RSVPHeaderImage from './template';
11
- import { selectors, actions } from '@moderntribe/tickets/data/blocks/rsvp';
12
  import { withStore } from '@moderntribe/common/hoc';
13
 
14
  /**
@@ -24,16 +24,15 @@ const mapStateToProps = ( state ) => ( {
24
  isSettingsLoading: selectors.getRSVPIsSettingsLoading( state ),
25
  } );
26
 
27
- const mapDispatchToProps = ( dispatch ) => {
28
- return {
29
- onRemove: () => dispatch( actions.deleteRSVPHeaderImage() ),
30
- /**
31
- * Full payload from gutenberg media upload is not used,
32
- * only id, alt, and medium src are used for this specific case.
33
- */
34
- onSelect: ( image ) => dispatch( actions.updateRSVPHeaderImage( image ) ),
35
- };
36
- };
37
 
38
  export default compose(
39
  withStore(),
8
  * Internal dependencies
9
  */
10
  import RSVPHeaderImage from './template';
11
+ import { actions, selectors } from '@moderntribe/tickets/data/blocks/rsvp';
12
  import { withStore } from '@moderntribe/common/hoc';
13
 
14
  /**
24
  isSettingsLoading: selectors.getRSVPIsSettingsLoading( state ),
25
  } );
26
 
27
+ const mapDispatchToProps = ( dispatch ) => ( {
28
+ /**
29
+ * Full payload from gutenberg media upload is not used,
30
+ * only id, alt, and medium src are used for this specific case.
31
+ */
32
+ onSelect: ( image ) => dispatch( actions.updateRSVPHeaderImage( image ) ),
33
+ onRemove: () => dispatch( actions.deleteRSVPHeaderImage() ),
34
+
35
+ } );
 
36
 
37
  export default compose(
38
  withStore(),
src/resources/css/app/rsvp/frontend.css CHANGED
@@ -1 +1 @@
1
- .tribe-block__rsvp{font-family:Helvetica,sans-serif;margin-bottom:30px;margin-top:30px;max-width:580px}.tribe-block__rsvp__ticket{border:1px solid #e1e3e6;display:flex;flex-wrap:wrap;position:relative;width:100%}.tribe-block__rsvp__icon{align-items:center;background:#fff;border-bottom:1px dashed #b5bcc2;color:#434343;display:flex;flex:none;flex-direction:column;font-size:14px;font-weight:700;line-height:17px;padding:20px 17px;width:100%}.tribe-block__rsvp__icon svg{margin-bottom:7px}.tribe-block__rsvp__content{background-color:#f5f8f9;flex:auto}.tribe-block__rsvp__details{padding:25px 20px 20px}.tribe-block__rsvp__title{color:#000;font-size:21px;font-weight:700;line-height:28px;margin-bottom:12px}.tribe-block__rsvp__description{color:#545d66;font-size:14px;line-height:18px;margin-bottom:15px}.tribe-block__rsvp__availability{color:#545d66;display:flex;align-items:center;font-size:12px;line-height:18px}.tribe-block__rsvp__quantity{font-size:18px;font-weight:700;margin-right:6px}.tribe-block__rsvp__status{display:flex;flex-wrap:nowrap;padding:0 20px 25px;text-align:center}.tribe-block__rsvp__status>span{flex:none;margin-right:15px;width:calc((100% - 15px)/2)}.tribe-block__rsvp__status>span:last-child{margin-right:0}.tribe-block__rsvp__status-button{align-items:center;border:1px solid #545d66;border-radius:4px;background:#fff;color:#545d66;display:flex;font-family:Helvetica,sans-serif;font-size:14px;font-weight:700;height:44px;justify-content:center;line-height:1;padding:0;width:100%}.tribe-block__rsvp__status-button svg{margin-left:9px}.tribe-block__rsvp__status-button:focus,.tribe-block__rsvp__status-button:hover{background:#fff;border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-active{border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-inactive{border:1px solid #e1e3e6;color:#a2aab2}.tribe-block__rsvp__status-button.tribe-inactive:focus,.tribe-block__rsvp__status-button.tribe-inactive:hover{background:#fff;border:1px solid #545d66;color:#545d66}.tribe-block__rsvp__status-button[disabled=disabled]{cursor:default}.tribe-block__rsvp__going-icon,.tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-active .tribe-block__rsvp__going-icon,.tribe-active .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__not-going-icon{fill:#191e23}.tribe-inactive .tribe-block__rsvp__going-icon,.tribe-inactive .tribe-block__rsvp__not-going-icon{fill:#e1e3e6}.tribe-inactive:focus .tribe-block__rsvp__going-icon,.tribe-inactive:focus .tribe-block__rsvp__not-going-icon,.tribe-inactive:hover .tribe-block__rsvp__going-icon,.tribe-inactive:hover .tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-block__rsvp__form{padding:0 20px}.tribe-block__rsvp__form form{border-top:1px solid #e1e3e6;display:flex;padding:30px 0}.tribe-left{flex:none}.tribe-block__rsvp__number-input{padding-right:20px}.tribe-block__rsvp__number-input-inner{align-items:center;display:flex}.tribe-block__rsvp__number-input-inner input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:none;color:#000;font-family:Helvetica,sans-serif;font-size:30px;font-weight:700;height:40px;max-width:48px;padding:4px 0;text-align:center}.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-inner-spin-button,.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none}.tribe-block__rsvp__number-input-label{display:block;font-size:14px;font-weight:700;line-height:18px;margin-top:9px;text-align:center}.tribe-block__rsvp__number-input-button{background-color:transparent;height:30px;padding:0;position:relative;width:20px}.tribe-block__rsvp__number-input-button:after,.tribe-block__rsvp__number-input-button:before{background-color:#aeb4bb;content:"";height:2px;position:absolute;width:10px}.tribe-block__rsvp__number-input-button:focus,.tribe-block__rsvp__number-input-button:hover{background:none}.tribe-block__rsvp__number-input-button:focus:after,.tribe-block__rsvp__number-input-button:focus:before,.tribe-block__rsvp__number-input-button:hover:after,.tribe-block__rsvp__number-input-button:hover:before{background-color:#545d66}.tribe-block__rsvp__number-input-button--minus{margin-left:-10px}.tribe-block__rsvp__number-input-button--minus:after,.tribe-block__rsvp__number-input-button--minus:before{right:0}.tribe-block__rsvp__number-input-button--plus{margin-right:-10px}.tribe-block__rsvp__number-input-button--plus:after,.tribe-block__rsvp__number-input-button--plus:before{left:0}.tribe-block__rsvp__number-input-button--plus:after{transform:rotate(90deg)}.tribe-right{flex:auto}.tribe-right input[type=email],.tribe-right input[type=text]{border-color:#e1e3e6;color:#000;display:block;font-family:Helvetica,sans-serif;font-size:16px;height:40px;line-height:18px;margin-bottom:15px;padding:10px 15px;width:100%}.tribe-right input[type=email]::-webkit-input-placeholder,.tribe-right input[type=text]::-webkit-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::-moz-placeholder,.tribe-right input[type=text]::-moz-placeholder{color:#a2aab2}.tribe-right input[type=email]:-ms-input-placeholder,.tribe-right input[type=email]::-ms-input-placeholder,.tribe-right input[type=text]:-ms-input-placeholder,.tribe-right input[type=text]::-ms-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::placeholder,.tribe-right input[type=text]::placeholder{color:#a2aab2}.tribe-right label{cursor:pointer;font-size:var(--font-size-2);font-weight:400}.tribe-right label[for^=tribe-tickets-attendees-list-optout]{align-items:flex-start;display:flex;margin:0 0 15px;padding-top:7px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #e1e3e6;border-radius:0;cursor:pointer;flex:none;height:16px;margin:1px 10px 0 0;width:16px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:focus{box-shadow:0 0 0 1px #e1e3e6;outline:2px solid transparent;outline-offset:-2px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:checked:before{color:#009fd4;content:"\F147";display:inline-block;float:left;font:normal 21px/1 dashicons;margin:-3px 0 0 -4px;speak:none;vertical-align:middle;width:16px}.tribe-tickets-meta-option-label{color:#000;font-size:14px;line-height:18px}.tribe-block__rsvp__message__error,.tribe-block__rsvp__message__success{color:#000;font-size:14px;line-height:18px;padding:20px}.tribe-block__rsvp__message__error{background:#ffebe8;border:1px solid #c00;display:none;margin-bottom:20px}.tribe-block__rsvp__message__success{background:#ecfae5;border:1px solid #1bd800;margin-top:20px}.tribe-block__rsvp__submit-button{background:#009fd4;color:#fff;font-family:Helvetica,sans-serif;font-size:15px;font-weight:700;line-height:18px;margin:10px 0 0;padding:10px 23px}.tribe-block__rsvp__submit-button:focus,.tribe-block__rsvp__submit-button:hover{background:#007bb4}.tribe-block__rsvp__submit-button:disabled{cursor:not-allowed;background:#a2aab2}.tribe-block__rsvp__form__attendee-meta{margin:0}.tribe-block__rsvp__form__attendee-meta td,.tribe-block__rsvp__form__attendee-meta th{padding:0;border:none;word-break:normal}.tribe-block__rsvp__loading{background:hsla(0,0%,100%,.7);display:none;height:100%;position:absolute;text-align:center;width:100%;z-index:99}.tribe-block__rsvp__loading svg{max-width:70px;position:absolute;top:35%}.tribe-block__rsvp__loading svg circle{fill:#888}@media (min-width:600px){.tribe-block__rsvp__ticket{align-items:stretch;flex-wrap:nowrap}.tribe-block__rsvp__icon{border-bottom:none;border-right:1px dashed #b5bcc2;padding:28px 17px;width:84px}.tribe-block__rsvp__number-input-inner input[type=number]{font-size:36px;height:48px}.tribe-block__rsvp__message__success{padding:10px 30px;text-align:center}}
1
+ .tribe-block__rsvp{font-family:Helvetica,sans-serif;margin-bottom:30px;margin-top:30px;max-width:580px;position:relative}.tribe-block__rsvp__ticket{border:1px solid #e1e3e6;display:flex;flex-wrap:wrap;position:relative;width:100%}.tribe-block__rsvp__icon{align-items:center;background:#fff;border-bottom:1px dashed #b5bcc2;color:#434343;display:flex;flex:none;flex-direction:column;font-size:14px;font-weight:700;line-height:17px;padding:20px 17px;width:100%}.tribe-block__rsvp__icon svg{margin-bottom:7px}.tribe-block__rsvp__content{background-color:#f5f8f9;flex:auto}.tribe-block__rsvp__details{padding:25px 20px 20px}.tribe-block__rsvp__title{color:#000;font-size:21px;font-weight:700;line-height:28px;margin-bottom:12px}.tribe-block__rsvp__description{color:#545d66;font-size:14px;line-height:18px;margin-bottom:15px}.tribe-block__rsvp__availability{color:#545d66;display:flex;align-items:center;font-size:12px;line-height:18px}.tribe-block__rsvp__quantity{font-size:18px;font-weight:700;margin-right:6px}.tribe-block__rsvp__status{display:flex;flex-wrap:nowrap;padding:0 20px 25px;text-align:center}.tribe-block__rsvp__status>span{flex:none;margin-right:15px;width:calc((100% - 15px)/2)}.tribe-block__rsvp__status>span:last-child{margin-right:0}.tribe-block__rsvp__status-button{align-items:center;border:1px solid #545d66;border-radius:4px;background:#fff;color:#545d66;display:flex;font-family:Helvetica,sans-serif;font-size:14px;font-weight:700;height:44px;justify-content:center;line-height:1;padding:0;width:100%}.tribe-block__rsvp__status-button svg{margin-left:9px}.tribe-block__rsvp__status-button:focus,.tribe-block__rsvp__status-button:hover{background:#fff;border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-active{border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-inactive{border:1px solid #e1e3e6;color:#a2aab2}.tribe-block__rsvp__status-button.tribe-inactive:focus,.tribe-block__rsvp__status-button.tribe-inactive:hover{background:#fff;border:1px solid #545d66;color:#545d66}.tribe-block__rsvp__status-button[disabled=disabled]{cursor:default}.tribe-block__rsvp__going-icon,.tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-active .tribe-block__rsvp__going-icon,.tribe-active .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__not-going-icon{fill:#191e23}.tribe-inactive .tribe-block__rsvp__going-icon,.tribe-inactive .tribe-block__rsvp__not-going-icon{fill:#e1e3e6}.tribe-inactive:focus .tribe-block__rsvp__going-icon,.tribe-inactive:focus .tribe-block__rsvp__not-going-icon,.tribe-inactive:hover .tribe-block__rsvp__going-icon,.tribe-inactive:hover .tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-block__rsvp__form{padding:0 20px}.tribe-block__rsvp__form form{border-top:1px solid #e1e3e6;display:flex;padding:30px 0}.tribe-left{flex:none}.tribe-block__rsvp__number-input{padding-right:20px}.tribe-block__rsvp__number-input-inner{align-items:center;display:flex}.tribe-block__rsvp__number-input-inner input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:none;color:#000;font-family:Helvetica,sans-serif;font-size:30px;font-weight:700;height:40px;max-width:48px;padding:4px 0;text-align:center}.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-inner-spin-button,.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none}.tribe-block__rsvp__number-input-label{display:block;font-size:14px;font-weight:700;line-height:18px;margin-top:9px;text-align:center}.tribe-block__rsvp__number-input-button{background-color:transparent;height:30px;padding:0;position:relative;width:20px}.tribe-block__rsvp__number-input-button:after,.tribe-block__rsvp__number-input-button:before{background-color:#aeb4bb;content:"";height:2px;position:absolute;width:10px}.tribe-block__rsvp__number-input-button:focus,.tribe-block__rsvp__number-input-button:hover{background:none}.tribe-block__rsvp__number-input-button:focus:after,.tribe-block__rsvp__number-input-button:focus:before,.tribe-block__rsvp__number-input-button:hover:after,.tribe-block__rsvp__number-input-button:hover:before{background-color:#545d66}.tribe-block__rsvp__number-input-button--minus{margin-left:-10px}.tribe-block__rsvp__number-input-button--minus:after,.tribe-block__rsvp__number-input-button--minus:before{right:0}.tribe-block__rsvp__number-input-button--plus{margin-right:-10px}.tribe-block__rsvp__number-input-button--plus:after,.tribe-block__rsvp__number-input-button--plus:before{left:0}.tribe-block__rsvp__number-input-button--plus:after{transform:rotate(90deg)}.tribe-right{flex:auto}.tribe-right input[type=email],.tribe-right input[type=text]{border-color:#e1e3e6;color:#000;display:block;font-family:Helvetica,sans-serif;font-size:16px;height:40px;line-height:18px;margin-bottom:15px;padding:10px 15px;width:100%}.tribe-right input[type=email]::-webkit-input-placeholder,.tribe-right input[type=text]::-webkit-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::-moz-placeholder,.tribe-right input[type=text]::-moz-placeholder{color:#a2aab2}.tribe-right input[type=email]:-ms-input-placeholder,.tribe-right input[type=email]::-ms-input-placeholder,.tribe-right input[type=text]:-ms-input-placeholder,.tribe-right input[type=text]::-ms-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::placeholder,.tribe-right input[type=text]::placeholder{color:#a2aab2}.tribe-right label{cursor:pointer;font-size:var(--font-size-2);font-weight:400}.tribe-right label[for^=tribe-tickets-attendees-list-optout]{align-items:flex-start;display:flex;margin:0 0 15px;padding-top:7px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #e1e3e6;border-radius:0;cursor:pointer;flex:none;height:16px;margin:1px 10px 0 0;width:16px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:focus{box-shadow:0 0 0 1px #e1e3e6;outline:2px solid transparent;outline-offset:-2px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:checked:before{color:#009fd4;content:"\F147";display:inline-block;float:left;font:normal 21px/1 dashicons;margin:-3px 0 0 -4px;speak:none;vertical-align:middle;width:16px}.tribe-tickets-meta-option-label{color:#000;font-size:14px;line-height:18px}.tribe-block__rsvp__message__error,.tribe-block__rsvp__message__success{color:#000;font-size:14px;line-height:18px;padding:20px}.tribe-block__rsvp__message__error{background:#ffebe8;border:1px solid #c00;display:none;margin-bottom:20px}.tribe-block__rsvp__message__success{background:#ecfae5;border:1px solid #1bd800;margin-top:20px}.tribe-block__rsvp__submit-button{background:#009fd4;color:#fff;font-family:Helvetica,sans-serif;font-size:15px;font-weight:700;line-height:18px;margin:10px 0 0;padding:10px 23px}.tribe-block__rsvp__submit-button:focus,.tribe-block__rsvp__submit-button:hover{background:#007bb4}.tribe-block__rsvp__submit-button:disabled{cursor:not-allowed;background:#a2aab2}.tribe-block__rsvp__form__attendee-meta{margin:0}.tribe-block__rsvp__form__attendee-meta td,.tribe-block__rsvp__form__attendee-meta th{padding:0;border:none;word-break:normal}.tribe-common-c-loader.tribe-block__rsvp__loading{align-items:center;background:hsla(0,0%,100%,.7);height:100%;justify-content:center;left:0;margin:0;padding:0;position:absolute;text-align:center;top:0;width:100%;z-index:99}.tribe-common-c-loader.tribe-block__rsvp__loading svg{max-width:70px;position:absolute;top:35%}.tribe-common-c-loader.tribe-block__rsvp__loading svg circle{fill:#888}@media (min-width:600px){.tribe-block__rsvp__ticket{align-items:stretch;flex-wrap:nowrap}.tribe-block__rsvp__icon{border-bottom:none;border-right:1px dashed #b5bcc2;padding:28px 17px;width:84px}.tribe-block__rsvp__number-input-inner input[type=number]{font-size:36px;height:48px}.tribe-block__rsvp__message__success{padding:10px 30px;text-align:center}}
src/resources/css/app/rsvp/frontend.min.css CHANGED
@@ -1 +1 @@
1
- .tribe-block__rsvp{font-family:Helvetica,sans-serif;margin-bottom:30px;margin-top:30px;max-width:580px}.tribe-block__rsvp__ticket{border:1px solid #e1e3e6;display:flex;flex-wrap:wrap;position:relative;width:100%}.tribe-block__rsvp__icon{align-items:center;background:#fff;border-bottom:1px dashed #b5bcc2;color:#434343;display:flex;flex:none;flex-direction:column;font-size:14px;font-weight:700;line-height:17px;padding:20px 17px;width:100%}.tribe-block__rsvp__icon svg{margin-bottom:7px}.tribe-block__rsvp__content{background-color:#f5f8f9;flex:auto}.tribe-block__rsvp__details{padding:25px 20px 20px}.tribe-block__rsvp__title{color:#000;font-size:21px;font-weight:700;line-height:28px;margin-bottom:12px}.tribe-block__rsvp__description{color:#545d66;font-size:14px;line-height:18px;margin-bottom:15px}.tribe-block__rsvp__availability{color:#545d66;display:flex;align-items:center;font-size:12px;line-height:18px}.tribe-block__rsvp__quantity{font-size:18px;font-weight:700;margin-right:6px}.tribe-block__rsvp__status{display:flex;flex-wrap:nowrap;padding:0 20px 25px;text-align:center}.tribe-block__rsvp__status>span{flex:none;margin-right:15px;width:calc((100% - 15px)/2)}.tribe-block__rsvp__status>span:last-child{margin-right:0}.tribe-block__rsvp__status-button{align-items:center;border:1px solid #545d66;border-radius:4px;background:#fff;color:#545d66;display:flex;font-family:Helvetica,sans-serif;font-size:14px;font-weight:700;height:44px;justify-content:center;line-height:1;padding:0;width:100%}.tribe-block__rsvp__status-button svg{margin-left:9px}.tribe-block__rsvp__status-button:focus,.tribe-block__rsvp__status-button:hover{background:#fff;border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-active{border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-inactive{border:1px solid #e1e3e6;color:#a2aab2}.tribe-block__rsvp__status-button.tribe-inactive:focus,.tribe-block__rsvp__status-button.tribe-inactive:hover{background:#fff;border:1px solid #545d66;color:#545d66}.tribe-block__rsvp__status-button[disabled=disabled]{cursor:default}.tribe-block__rsvp__going-icon,.tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-active .tribe-block__rsvp__going-icon,.tribe-active .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__not-going-icon{fill:#191e23}.tribe-inactive .tribe-block__rsvp__going-icon,.tribe-inactive .tribe-block__rsvp__not-going-icon{fill:#e1e3e6}.tribe-inactive:focus .tribe-block__rsvp__going-icon,.tribe-inactive:focus .tribe-block__rsvp__not-going-icon,.tribe-inactive:hover .tribe-block__rsvp__going-icon,.tribe-inactive:hover .tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-block__rsvp__form{padding:0 20px}.tribe-block__rsvp__form form{border-top:1px solid #e1e3e6;display:flex;padding:30px 0}.tribe-left{flex:none}.tribe-block__rsvp__number-input{padding-right:20px}.tribe-block__rsvp__number-input-inner{align-items:center;display:flex}.tribe-block__rsvp__number-input-inner input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:none;color:#000;font-family:Helvetica,sans-serif;font-size:30px;font-weight:700;height:40px;max-width:48px;padding:4px 0;text-align:center}.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-inner-spin-button,.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none}.tribe-block__rsvp__number-input-label{display:block;font-size:14px;font-weight:700;line-height:18px;margin-top:9px;text-align:center}.tribe-block__rsvp__number-input-button{background-color:transparent;height:30px;padding:0;position:relative;width:20px}.tribe-block__rsvp__number-input-button:after,.tribe-block__rsvp__number-input-button:before{background-color:#aeb4bb;content:"";height:2px;position:absolute;width:10px}.tribe-block__rsvp__number-input-button:focus,.tribe-block__rsvp__number-input-button:hover{background:none}.tribe-block__rsvp__number-input-button:focus:after,.tribe-block__rsvp__number-input-button:focus:before,.tribe-block__rsvp__number-input-button:hover:after,.tribe-block__rsvp__number-input-button:hover:before{background-color:#545d66}.tribe-block__rsvp__number-input-button--minus{margin-left:-10px}.tribe-block__rsvp__number-input-button--minus:after,.tribe-block__rsvp__number-input-button--minus:before{right:0}.tribe-block__rsvp__number-input-button--plus{margin-right:-10px}.tribe-block__rsvp__number-input-button--plus:after,.tribe-block__rsvp__number-input-button--plus:before{left:0}.tribe-block__rsvp__number-input-button--plus:after{transform:rotate(90deg)}.tribe-right{flex:auto}.tribe-right input[type=email],.tribe-right input[type=text]{border-color:#e1e3e6;color:#000;display:block;font-family:Helvetica,sans-serif;font-size:16px;height:40px;line-height:18px;margin-bottom:15px;padding:10px 15px;width:100%}.tribe-right input[type=email]::-webkit-input-placeholder,.tribe-right input[type=text]::-webkit-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::-moz-placeholder,.tribe-right input[type=text]::-moz-placeholder{color:#a2aab2}.tribe-right input[type=email]:-ms-input-placeholder,.tribe-right input[type=email]::-ms-input-placeholder,.tribe-right input[type=text]:-ms-input-placeholder,.tribe-right input[type=text]::-ms-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::placeholder,.tribe-right input[type=text]::placeholder{color:#a2aab2}.tribe-right label{cursor:pointer;font-size:var(--font-size-2);font-weight:400}.tribe-right label[for^=tribe-tickets-attendees-list-optout]{align-items:flex-start;display:flex;margin:0 0 15px;padding-top:7px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #e1e3e6;border-radius:0;cursor:pointer;flex:none;height:16px;margin:1px 10px 0 0;width:16px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:focus{box-shadow:0 0 0 1px #e1e3e6;outline:2px solid transparent;outline-offset:-2px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:checked:before{color:#009fd4;content:"\F147";display:inline-block;float:left;font:normal 21px/1 dashicons;margin:-3px 0 0 -4px;speak:none;vertical-align:middle;width:16px}.tribe-tickets-meta-option-label{color:#000;font-size:14px;line-height:18px}.tribe-block__rsvp__message__error,.tribe-block__rsvp__message__success{color:#000;font-size:14px;line-height:18px;padding:20px}.tribe-block__rsvp__message__error{background:#ffebe8;border:1px solid #c00;display:none;margin-bottom:20px}.tribe-block__rsvp__message__success{background:#ecfae5;border:1px solid #1bd800;margin-top:20px}.tribe-block__rsvp__submit-button{background:#009fd4;color:#fff;font-family:Helvetica,sans-serif;font-size:15px;font-weight:700;line-height:18px;margin:10px 0 0;padding:10px 23px}.tribe-block__rsvp__submit-button:focus,.tribe-block__rsvp__submit-button:hover{background:#007bb4}.tribe-block__rsvp__submit-button:disabled{cursor:not-allowed;background:#a2aab2}.tribe-block__rsvp__form__attendee-meta{margin:0}.tribe-block__rsvp__form__attendee-meta td,.tribe-block__rsvp__form__attendee-meta th{padding:0;border:none;word-break:normal}.tribe-block__rsvp__loading{background:hsla(0,0%,100%,.7);display:none;height:100%;position:absolute;text-align:center;width:100%;z-index:99}.tribe-block__rsvp__loading svg{max-width:70px;position:absolute;top:35%}.tribe-block__rsvp__loading svg circle{fill:#888}@media (min-width:600px){.tribe-block__rsvp__ticket{align-items:stretch;flex-wrap:nowrap}.tribe-block__rsvp__icon{border-bottom:none;border-right:1px dashed #b5bcc2;padding:28px 17px;width:84px}.tribe-block__rsvp__number-input-inner input[type=number]{font-size:36px;height:48px}.tribe-block__rsvp__message__success{padding:10px 30px;text-align:center}}
1
+ .tribe-block__rsvp{font-family:Helvetica,sans-serif;margin-bottom:30px;margin-top:30px;max-width:580px;position:relative}.tribe-block__rsvp__ticket{border:1px solid #e1e3e6;display:flex;flex-wrap:wrap;position:relative;width:100%}.tribe-block__rsvp__icon{align-items:center;background:#fff;border-bottom:1px dashed #b5bcc2;color:#434343;display:flex;flex:none;flex-direction:column;font-size:14px;font-weight:700;line-height:17px;padding:20px 17px;width:100%}.tribe-block__rsvp__icon svg{margin-bottom:7px}.tribe-block__rsvp__content{background-color:#f5f8f9;flex:auto}.tribe-block__rsvp__details{padding:25px 20px 20px}.tribe-block__rsvp__title{color:#000;font-size:21px;font-weight:700;line-height:28px;margin-bottom:12px}.tribe-block__rsvp__description{color:#545d66;font-size:14px;line-height:18px;margin-bottom:15px}.tribe-block__rsvp__availability{color:#545d66;display:flex;align-items:center;font-size:12px;line-height:18px}.tribe-block__rsvp__quantity{font-size:18px;font-weight:700;margin-right:6px}.tribe-block__rsvp__status{display:flex;flex-wrap:nowrap;padding:0 20px 25px;text-align:center}.tribe-block__rsvp__status>span{flex:none;margin-right:15px;width:calc((100% - 15px)/2)}.tribe-block__rsvp__status>span:last-child{margin-right:0}.tribe-block__rsvp__status-button{align-items:center;border:1px solid #545d66;border-radius:4px;background:#fff;color:#545d66;display:flex;font-family:Helvetica,sans-serif;font-size:14px;font-weight:700;height:44px;justify-content:center;line-height:1;padding:0;width:100%}.tribe-block__rsvp__status-button svg{margin-left:9px}.tribe-block__rsvp__status-button:focus,.tribe-block__rsvp__status-button:hover{background:#fff;border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-active{border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-inactive{border:1px solid #e1e3e6;color:#a2aab2}.tribe-block__rsvp__status-button.tribe-inactive:focus,.tribe-block__rsvp__status-button.tribe-inactive:hover{background:#fff;border:1px solid #545d66;color:#545d66}.tribe-block__rsvp__status-button[disabled=disabled]{cursor:default}.tribe-block__rsvp__going-icon,.tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-active .tribe-block__rsvp__going-icon,.tribe-active .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__not-going-icon{fill:#191e23}.tribe-inactive .tribe-block__rsvp__going-icon,.tribe-inactive .tribe-block__rsvp__not-going-icon{fill:#e1e3e6}.tribe-inactive:focus .tribe-block__rsvp__going-icon,.tribe-inactive:focus .tribe-block__rsvp__not-going-icon,.tribe-inactive:hover .tribe-block__rsvp__going-icon,.tribe-inactive:hover .tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-block__rsvp__form{padding:0 20px}.tribe-block__rsvp__form form{border-top:1px solid #e1e3e6;display:flex;padding:30px 0}.tribe-left{flex:none}.tribe-block__rsvp__number-input{padding-right:20px}.tribe-block__rsvp__number-input-inner{align-items:center;display:flex}.tribe-block__rsvp__number-input-inner input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:none;color:#000;font-family:Helvetica,sans-serif;font-size:30px;font-weight:700;height:40px;max-width:48px;padding:4px 0;text-align:center}.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-inner-spin-button,.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none}.tribe-block__rsvp__number-input-label{display:block;font-size:14px;font-weight:700;line-height:18px;margin-top:9px;text-align:center}.tribe-block__rsvp__number-input-button{background-color:transparent;height:30px;padding:0;position:relative;width:20px}.tribe-block__rsvp__number-input-button:after,.tribe-block__rsvp__number-input-button:before{background-color:#aeb4bb;content:"";height:2px;position:absolute;width:10px}.tribe-block__rsvp__number-input-button:focus,.tribe-block__rsvp__number-input-button:hover{background:none}.tribe-block__rsvp__number-input-button:focus:after,.tribe-block__rsvp__number-input-button:focus:before,.tribe-block__rsvp__number-input-button:hover:after,.tribe-block__rsvp__number-input-button:hover:before{background-color:#545d66}.tribe-block__rsvp__number-input-button--minus{margin-left:-10px}.tribe-block__rsvp__number-input-button--minus:after,.tribe-block__rsvp__number-input-button--minus:before{right:0}.tribe-block__rsvp__number-input-button--plus{margin-right:-10px}.tribe-block__rsvp__number-input-button--plus:after,.tribe-block__rsvp__number-input-button--plus:before{left:0}.tribe-block__rsvp__number-input-button--plus:after{transform:rotate(90deg)}.tribe-right{flex:auto}.tribe-right input[type=email],.tribe-right input[type=text]{border-color:#e1e3e6;color:#000;display:block;font-family:Helvetica,sans-serif;font-size:16px;height:40px;line-height:18px;margin-bottom:15px;padding:10px 15px;width:100%}.tribe-right input[type=email]::-webkit-input-placeholder,.tribe-right input[type=text]::-webkit-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::-moz-placeholder,.tribe-right input[type=text]::-moz-placeholder{color:#a2aab2}.tribe-right input[type=email]:-ms-input-placeholder,.tribe-right input[type=email]::-ms-input-placeholder,.tribe-right input[type=text]:-ms-input-placeholder,.tribe-right input[type=text]::-ms-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::placeholder,.tribe-right input[type=text]::placeholder{color:#a2aab2}.tribe-right label{cursor:pointer;font-size:var(--font-size-2);font-weight:400}.tribe-right label[for^=tribe-tickets-attendees-list-optout]{align-items:flex-start;display:flex;margin:0 0 15px;padding-top:7px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #e1e3e6;border-radius:0;cursor:pointer;flex:none;height:16px;margin:1px 10px 0 0;width:16px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:focus{box-shadow:0 0 0 1px #e1e3e6;outline:2px solid transparent;outline-offset:-2px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:checked:before{color:#009fd4;content:"\F147";display:inline-block;float:left;font:normal 21px/1 dashicons;margin:-3px 0 0 -4px;speak:none;vertical-align:middle;width:16px}.tribe-tickets-meta-option-label{color:#000;font-size:14px;line-height:18px}.tribe-block__rsvp__message__error,.tribe-block__rsvp__message__success{color:#000;font-size:14px;line-height:18px;padding:20px}.tribe-block__rsvp__message__error{background:#ffebe8;border:1px solid #c00;display:none;margin-bottom:20px}.tribe-block__rsvp__message__success{background:#ecfae5;border:1px solid #1bd800;margin-top:20px}.tribe-block__rsvp__submit-button{background:#009fd4;color:#fff;font-family:Helvetica,sans-serif;font-size:15px;font-weight:700;line-height:18px;margin:10px 0 0;padding:10px 23px}.tribe-block__rsvp__submit-button:focus,.tribe-block__rsvp__submit-button:hover{background:#007bb4}.tribe-block__rsvp__submit-button:disabled{cursor:not-allowed;background:#a2aab2}.tribe-block__rsvp__form__attendee-meta{margin:0}.tribe-block__rsvp__form__attendee-meta td,.tribe-block__rsvp__form__attendee-meta th{padding:0;border:none;word-break:normal}.tribe-common-c-loader.tribe-block__rsvp__loading{align-items:center;background:hsla(0,0%,100%,.7);height:100%;justify-content:center;left:0;margin:0;padding:0;position:absolute;text-align:center;top:0;width:100%;z-index:99}.tribe-common-c-loader.tribe-block__rsvp__loading svg{max-width:70px;position:absolute;top:35%}.tribe-common-c-loader.tribe-block__rsvp__loading svg circle{fill:#888}@media (min-width:600px){.tribe-block__rsvp__ticket{align-items:stretch;flex-wrap:nowrap}.tribe-block__rsvp__icon{border-bottom:none;border-right:1px dashed #b5bcc2;padding:28px 17px;width:84px}.tribe-block__rsvp__number-input-inner input[type=number]{font-size:36px;height:48px}.tribe-block__rsvp__message__success{padding:10px 30px;text-align:center}}
src/resources/css/rsvp.css CHANGED
@@ -349,6 +349,7 @@
349
  margin-bottom: 30px;
350
  margin-top: 30px;
351
  max-width: 580px;
 
352
  }
353
 
354
  .tribe-block__rsvp__ticket {
@@ -757,23 +758,28 @@
757
  word-break: normal;
758
  }
759
 
760
- .tribe-block__rsvp__loading {
 
761
  background: rgba( 255, 255, 255, .7 );
762
- display: none;
763
  height: 100%;
 
 
 
 
764
  position: absolute;
765
  text-align: center;
 
766
  width: 100%;
767
  z-index: 99;
768
  }
769
 
770
- .tribe-block__rsvp__loading svg {
771
  max-width: 70px;
772
  position: absolute;
773
  top: 35%;
774
  }
775
 
776
- .tribe-block__rsvp__loading svg circle {
777
  fill: #888;
778
  }
779
 
349
  margin-bottom: 30px;
350
  margin-top: 30px;
351
  max-width: 580px;
352
+ position: relative;
353
  }
354
 
355
  .tribe-block__rsvp__ticket {
758
  word-break: normal;
759
  }
760
 
761
+ .tribe-common-c-loader.tribe-block__rsvp__loading {
762
+ align-items: center;
763
  background: rgba( 255, 255, 255, .7 );
 
764
  height: 100%;
765
+ justify-content: center;
766
+ left: 0;
767
+ margin: 0;
768
+ padding: 0;
769
  position: absolute;
770
  text-align: center;
771
+ top: 0;
772
  width: 100%;
773
  z-index: 99;
774
  }
775
 
776
+ .tribe-common-c-loader.tribe-block__rsvp__loading svg {
777
  max-width: 70px;
778
  position: absolute;
779
  top: 35%;
780
  }
781
 
782
+ .tribe-common-c-loader.tribe-block__rsvp__loading svg circle {
783
  fill: #888;
784
  }
785
 
src/resources/css/rsvp.min.css CHANGED
@@ -1 +1 @@
1
- .tribe-rsvp{padding:20px 0}.tribe-tickets-attendee{padding:10px}.tribe-events-style-full .tribe-events-tickets .tribe-tickets-attendee table,.tribe-events-style-full .tribe-events-tickets .tribe-tickets-attendee td,.tribe-events-style-full .tribe-events-tickets .tribe-tickets-attendee tr,.tribe-events-tickets .tribe-tickets-attendee table,.tribe-events-tickets .tribe-tickets-attendee td,.tribe-events-tickets .tribe-tickets-attendee tr{border:0}.tribe-rsvp-message-display .tribe-rsvp-messages{display:block}.tribe-rsvp-messages{display:none;padding:10px 10px 5px}.tribe-rsvp-message{border-radius:3px;border-style:solid;border-width:1px;font-size:12px;margin:0 0 5px;padding:0 .6em}.tribe-rsvp-message-success{background-color:#ffffe0;border-color:#e6db55}.tribe-rsvp-message-error{background-color:#ffebe8;border-color:#c00}.tribe-tickets-quantity{width:100%}.tickets-unavailable{font-style:italic}.tribe-rsvp-list{list-style:none;padding:0;margin:0}.tribe-rsvp-list>.tribe-item{min-height:105px;padding:20px;border:1px solid #ededed;border-bottom:0}.tribe-rsvp-list>.tribe-item:last-child{border-bottom:1px solid #ededed;margin-bottom:20px}.tribe-rsvp-list>.tribe-item.tribe-disabled{background-color:#efefef;border-color:#ddd;color:#717171}.tribe-rsvp-list>.tribe-item.tribe-disabled:last-child{border-bottom-color:#ddd}.tribe-rsvp-list>.tribe-item .tribe-answer{float:right;display:inline-block}.tribe-rsvp-list>.tribe-item table{border:0;margin:0}.tribe-rsvp-list>.tribe-item td{border:0}.list-attendee{color:#999;display:inline-block;letter-spacing:1px;text-transform:uppercase}.tribe-submit-tickets-form{margin-top:20px}.user-details{margin:0 0 1.5em}.user-details p{margin:0 0 .5em}.tribe-answer{line-height:2}.tribe-answer .type-label{margin-bottom:0;padding-right:.5em}.tribe-answer label{display:block}.tribe-answer select{background:#fff;border:1px solid #ddd;height:30px;line-height:1;margin-left:5px}.tribe-rsvp h2{margin-bottom:20px;line-height:1.2}.event-tickets-meta-label{font-weight:700;margin:0 1em 0 0}.tribe-theme-parent-twentysixteen .comment-content a,.tribe-theme-parent-twentysixteen .entry-content a,.tribe-theme-parent-twentysixteen .entry-footer a:hover,.tribe-theme-parent-twentysixteen .entry-summary a,.tribe-theme-parent-twentysixteen .logged-in-as a,.tribe-theme-parent-twentysixteen .pingback .comment-body>a,.tribe-theme-parent-twentysixteen .site-info a:hover,.tribe-theme-parent-twentysixteen .taxonomy-description a,.tribe-theme-parent-twentysixteen .textwidget a,.tribe-theme-twentysixteen .comment-content a,.tribe-theme-twentysixteen .entry-content a,.tribe-theme-twentysixteen .entry-footer a:hover,.tribe-theme-twentysixteen .entry-summary a,.tribe-theme-twentysixteen .logged-in-as a,.tribe-theme-twentysixteen .pingback .comment-body>a,.tribe-theme-twentysixteen .site-info a:hover,.tribe-theme-twentysixteen .taxonomy-description a,.tribe-theme-twentysixteen .textwidget a{box-shadow:none}.tribe-events-tickets-title.tribe--rsvp{margin:0}.tribe-events-style-full.tribe-events-style-theme h2.tribe-events-tickets-title{font-size:90%}.tribe-link-view-attendee{margin:15px 0}.tribe-events-tickets{background:#f8f8f8;border:0;border-radius:3px;max-width:100%;position:relative}.tribe-events-tickets table,.tribe-events-tickets td,.tribe-events-tickets th{border:0}.tribe-events-tickets tr{display:flex;flex-flow:row wrap}.tribe-events-tickets tr:not(:first-child){border-top:2px solid #dfdfdf}.tribe-events-tickets td{flex:none;padding:8px 10px;width:100%;word-break:normal}.tribe-events-tickets td.tickets_name{font-weight:700}.tribe-events-tickets td.quantity,.tribe-events-tickets td.woocommerce{order:2}.tribe-events-tickets td.quantity input[type=number],.tribe-events-tickets td.woocommerce input[type=number]{background-color:#fff;border-radius:3px;margin-bottom:5px;padding:5px 10px;text-align:left}.tribe-events-tickets td.tickets_submit{order:3}.tribe-events-tickets td.tickets_submit .tribe-button{margin:0 0 10px}.tribe-events-tickets .woocommerce.add-to-cart .tribe-button{margin:10px 0}.tribe-events-tickets .tribe-link-tickets-message{background:hsla(0,0%,78%,.8);bottom:0;left:0;position:absolute;right:0;text-align:center;top:0}.tribe-events-tickets .tribe-link-tickets-message .no-javascript-msg{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:90%}.tribe-events-tickets .tribe-tickets-remaining{color:#777;display:block;font-size:11px}.tribe-events-tickets .tribe-tickets-attendees-list-optout label{color:#777;font-size:13px}.tribe-events-tickets .tribe-tickets-attendees-list-optout input[type=checkbox]+label,.tribe-events-tickets .tribe-tickets-attendees-list-optout input[type=radio]+label{display:inline-block}.tribe-events-tickets .tickets_description,.tribe-events-tickets .tickets_name,.tribe-events-tickets .tickets_name p,.tribe-events-tickets .tickets_price{color:#464646;font-size:15px;padding:16px 10px}.tribe-events-tickets input[type=date],.tribe-events-tickets input[type=datetime-local],.tribe-events-tickets input[type=email],.tribe-events-tickets input[type=month],.tribe-events-tickets input[type=number],.tribe-events-tickets input[type=password],.tribe-events-tickets input[type=search],.tribe-events-tickets input[type=tel],.tribe-events-tickets input[type=text],.tribe-events-tickets input[type=time],.tribe-events-tickets input[type=url],.tribe-events-tickets input[type=week],.tribe-events-tickets select,.tribe-events-tickets textarea{background:#fff;width:100%}.tribe-events-tickets header{height:auto}.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta,.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row{display:none}.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta>td,.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row>td,.tribe-tickets-has-rsvp.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta,.tribe-tickets-has-rsvp.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row{display:block}.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta tr,.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row tr{border:0}.tribe-block__rsvp{font-family:Helvetica,sans-serif;margin-bottom:30px;margin-top:30px;max-width:580px}.tribe-block__rsvp__ticket{border:1px solid #e1e3e6;display:flex;flex-wrap:wrap;position:relative;width:100%}.tribe-block__rsvp__icon{align-items:center;background:#fff;border-bottom:1px dashed #b5bcc2;color:#434343;display:flex;flex:none;flex-direction:column;font-size:14px;font-weight:700;line-height:17px;padding:20px 17px;width:100%}.tribe-block__rsvp__icon svg{margin-bottom:7px}.tribe-block__rsvp__content{background-color:#f5f8f9;flex:auto}.tribe-block__rsvp__details{padding:25px 20px 20px}.tribe-block__rsvp__title{color:#000;font-size:21px;font-weight:700;line-height:28px;margin-bottom:12px}.tribe-block__rsvp__description{color:#545d66;font-size:14px;line-height:18px;margin-bottom:15px}.tribe-block__rsvp__availability{color:#545d66;display:flex;align-items:center;font-size:12px;line-height:18px}.tribe-block__rsvp__quantity{font-size:18px;font-weight:700;margin-right:6px}.tribe-block__rsvp__status{display:flex;flex-wrap:nowrap;padding:0 20px 25px;text-align:center}.tribe-block__rsvp__status>span{flex:none;margin-right:15px;width:calc((100% - 15px)/2)}.tribe-block__rsvp__status>span:last-child{margin-right:0}.tribe-block__rsvp__status-button{align-items:center;border:1px solid #545d66;border-radius:4px;background:#fff;color:#545d66;display:flex;font-family:Helvetica,sans-serif;font-size:14px;font-weight:700;height:44px;justify-content:center;line-height:1;padding:0;width:100%}.tribe-block__rsvp__status-button svg{margin-left:9px}.tribe-block__rsvp__status-button:focus,.tribe-block__rsvp__status-button:hover{background:#fff;border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-active{border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-inactive{border:1px solid #e1e3e6;color:#a2aab2}.tribe-block__rsvp__status-button.tribe-inactive:focus,.tribe-block__rsvp__status-button.tribe-inactive:hover{background:#fff;border:1px solid #545d66;color:#545d66}.tribe-block__rsvp__status-button[disabled=disabled]{cursor:default}.tribe-block__rsvp__going-icon,.tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-active .tribe-block__rsvp__going-icon,.tribe-active .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__not-going-icon{fill:#191e23}.tribe-inactive .tribe-block__rsvp__going-icon,.tribe-inactive .tribe-block__rsvp__not-going-icon{fill:#e1e3e6}.tribe-inactive:focus .tribe-block__rsvp__going-icon,.tribe-inactive:focus .tribe-block__rsvp__not-going-icon,.tribe-inactive:hover .tribe-block__rsvp__going-icon,.tribe-inactive:hover .tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-block__rsvp__form{padding:0 20px}.tribe-block__rsvp__form form{border-top:1px solid #e1e3e6;display:flex;padding:30px 0}.tribe-left{flex:none}.tribe-block__rsvp__number-input{padding-right:20px}.tribe-block__rsvp__number-input-inner{align-items:center;display:flex}.tribe-block__rsvp__number-input-inner input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:none;color:#000;font-family:Helvetica,sans-serif;font-size:30px;font-weight:700;height:40px;max-width:48px;padding:4px 0;text-align:center}.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-inner-spin-button,.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none}.tribe-block__rsvp__number-input-label{display:block;font-size:14px;font-weight:700;line-height:18px;margin-top:9px;text-align:center}.tribe-block__rsvp__number-input-button{background-color:transparent;height:30px;padding:0;position:relative;width:20px}.tribe-block__rsvp__number-input-button:after,.tribe-block__rsvp__number-input-button:before{background-color:#aeb4bb;content:"";height:2px;position:absolute;width:10px}.tribe-block__rsvp__number-input-button:focus,.tribe-block__rsvp__number-input-button:hover{background:none}.tribe-block__rsvp__number-input-button:focus:after,.tribe-block__rsvp__number-input-button:focus:before,.tribe-block__rsvp__number-input-button:hover:after,.tribe-block__rsvp__number-input-button:hover:before{background-color:#545d66}.tribe-block__rsvp__number-input-button--minus{margin-left:-10px}.tribe-block__rsvp__number-input-button--minus:after,.tribe-block__rsvp__number-input-button--minus:before{right:0}.tribe-block__rsvp__number-input-button--plus{margin-right:-10px}.tribe-block__rsvp__number-input-button--plus:after,.tribe-block__rsvp__number-input-button--plus:before{left:0}.tribe-block__rsvp__number-input-button--plus:after{transform:rotate(90deg)}.tribe-right{flex:auto}.tribe-right input[type=email],.tribe-right input[type=text]{border-color:#e1e3e6;color:#000;display:block;font-family:Helvetica,sans-serif;font-size:16px;height:40px;line-height:18px;margin-bottom:15px;padding:10px 15px;width:100%}.tribe-right input[type=email]::-webkit-input-placeholder,.tribe-right input[type=text]::-webkit-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::-moz-placeholder,.tribe-right input[type=text]::-moz-placeholder{color:#a2aab2}.tribe-right input[type=email]:-ms-input-placeholder,.tribe-right input[type=email]::-ms-input-placeholder,.tribe-right input[type=text]:-ms-input-placeholder,.tribe-right input[type=text]::-ms-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::placeholder,.tribe-right input[type=text]::placeholder{color:#a2aab2}.tribe-right label{cursor:pointer;font-size:14px;font-weight:400}.tribe-right label[for^=tribe-tickets-attendees-list-optout]{align-items:flex-start;display:flex;margin:0 0 15px;padding-top:7px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #e1e3e6;border-radius:0;cursor:pointer;flex:none;height:16px;margin:1px 10px 0 0;width:16px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:focus{box-shadow:0 0 0 1px #e1e3e6;outline:2px solid transparent;outline-offset:-2px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:checked:before{color:#009fd4;content:"\f147";display:inline-block;float:left;font:normal 21px/1 dashicons;margin:-3px 0 0 -4px;speak:none;vertical-align:middle;width:16px}.tribe-tickets-meta-option-label{color:#000;font-size:14px;line-height:18px;font-weight:400}.tribe-block__rsvp__message__error,.tribe-block__rsvp__message__success{color:#000;font-size:14px;line-height:18px;padding:20px}.tribe-block__rsvp__message__error{background:#ffebe8;border:1px solid #c00;display:none;margin-bottom:20px}.tribe-block__rsvp__message__success{background:#ecfae5;border:1px solid #1bd800;margin-top:20px}.tribe-block__rsvp__submit-button{background:#009fd4;color:#fff;font-family:Helvetica,sans-serif;font-size:15px;font-weight:700;line-height:18px;margin:10px 0 0;padding:10px 23px}.tribe-block__rsvp__submit-button:focus,.tribe-block__rsvp__submit-button:hover{background:#007bb4}.tribe-block__rsvp__submit-button:disabled{cursor:not-allowed;background:#a2aab2}.tribe-block__rsvp__form__attendee-meta{margin:0}.tribe-block__rsvp__form__attendee-meta td,.tribe-block__rsvp__form__attendee-meta th{padding:0;border:none;word-break:normal}.tribe-block__rsvp__loading{background:hsla(0,0%,100%,.7);display:none;height:100%;position:absolute;text-align:center;width:100%;z-index:99}.tribe-block__rsvp__loading svg{max-width:70px;position:absolute;top:35%}.tribe-block__rsvp__loading svg circle{fill:#888}@media only screen and (min-width:768px){.tribe-events-tickets tr{display:table-row}}@media (min-width:768px){.tribe-events-tickets td{width:auto}}@media (min-width:768px){.tribe-events-tickets td.quantity input[type=number],.tribe-events-tickets td.woocommerce input[type=number]{width:4.375em}.tribe-events-tickets .woocommerce.add-to-cart{padding:16px}.tribe-events-tickets .woocommerce.add-to-cart .tribe-button{margin:10px}.tribe-events-tickets input[type=date],.tribe-events-tickets input[type=datetime-local],.tribe-events-tickets input[type=email],.tribe-events-tickets input[type=month],.tribe-events-tickets input[type=number],.tribe-events-tickets input[type=password],.tribe-events-tickets input[type=search],.tribe-events-tickets input[type=tel],.tribe-events-tickets input[type=text],.tribe-events-tickets input[type=time],.tribe-events-tickets input[type=url],.tribe-events-tickets input[type=week],.tribe-events-tickets select,.tribe-events-tickets textarea{width:auto}.tribe-tickets-has-rsvp.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta,.tribe-tickets-has-rsvp.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row{display:table-row}.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta>td,.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row>td{display:table-cell}}@media (min-width:600px){.tribe-block__rsvp__ticket{align-items:stretch;flex-wrap:nowrap}.tribe-block__rsvp__icon{border-bottom:none;border-right:1px dashed #b5bcc2;padding:28px 17px;width:84px}.tribe-block__rsvp__number-input-inner input[type=number]{font-size:36px;height:48px}.tribe-block__rsvp__message__success{padding:10px 30px;text-align:center}}
1
+ .tribe-rsvp{padding:20px 0}.tribe-tickets-attendee{padding:10px}.tribe-events-style-full .tribe-events-tickets .tribe-tickets-attendee table,.tribe-events-style-full .tribe-events-tickets .tribe-tickets-attendee td,.tribe-events-style-full .tribe-events-tickets .tribe-tickets-attendee tr,.tribe-events-tickets .tribe-tickets-attendee table,.tribe-events-tickets .tribe-tickets-attendee td,.tribe-events-tickets .tribe-tickets-attendee tr{border:0}.tribe-rsvp-message-display .tribe-rsvp-messages{display:block}.tribe-rsvp-messages{display:none;padding:10px 10px 5px}.tribe-rsvp-message{border-radius:3px;border-style:solid;border-width:1px;font-size:12px;margin:0 0 5px;padding:0 .6em}.tribe-rsvp-message-success{background-color:#ffffe0;border-color:#e6db55}.tribe-rsvp-message-error{background-color:#ffebe8;border-color:#c00}.tribe-tickets-quantity{width:100%}.tickets-unavailable{font-style:italic}.tribe-rsvp-list{list-style:none;padding:0;margin:0}.tribe-rsvp-list>.tribe-item{min-height:105px;padding:20px;border:1px solid #ededed;border-bottom:0}.tribe-rsvp-list>.tribe-item:last-child{border-bottom:1px solid #ededed;margin-bottom:20px}.tribe-rsvp-list>.tribe-item.tribe-disabled{background-color:#efefef;border-color:#ddd;color:#717171}.tribe-rsvp-list>.tribe-item.tribe-disabled:last-child{border-bottom-color:#ddd}.tribe-rsvp-list>.tribe-item .tribe-answer{float:right;display:inline-block}.tribe-rsvp-list>.tribe-item table{border:0;margin:0}.tribe-rsvp-list>.tribe-item td{border:0}.list-attendee{color:#999;display:inline-block;letter-spacing:1px;text-transform:uppercase}.tribe-submit-tickets-form{margin-top:20px}.user-details{margin:0 0 1.5em}.user-details p{margin:0 0 .5em}.tribe-answer{line-height:2}.tribe-answer .type-label{margin-bottom:0;padding-right:.5em}.tribe-answer label{display:block}.tribe-answer select{background:#fff;border:1px solid #ddd;height:30px;line-height:1;margin-left:5px}.tribe-rsvp h2{margin-bottom:20px;line-height:1.2}.event-tickets-meta-label{font-weight:700;margin:0 1em 0 0}.tribe-theme-parent-twentysixteen .comment-content a,.tribe-theme-parent-twentysixteen .entry-content a,.tribe-theme-parent-twentysixteen .entry-footer a:hover,.tribe-theme-parent-twentysixteen .entry-summary a,.tribe-theme-parent-twentysixteen .logged-in-as a,.tribe-theme-parent-twentysixteen .pingback .comment-body>a,.tribe-theme-parent-twentysixteen .site-info a:hover,.tribe-theme-parent-twentysixteen .taxonomy-description a,.tribe-theme-parent-twentysixteen .textwidget a,.tribe-theme-twentysixteen .comment-content a,.tribe-theme-twentysixteen .entry-content a,.tribe-theme-twentysixteen .entry-footer a:hover,.tribe-theme-twentysixteen .entry-summary a,.tribe-theme-twentysixteen .logged-in-as a,.tribe-theme-twentysixteen .pingback .comment-body>a,.tribe-theme-twentysixteen .site-info a:hover,.tribe-theme-twentysixteen .taxonomy-description a,.tribe-theme-twentysixteen .textwidget a{box-shadow:none}.tribe-events-tickets-title.tribe--rsvp{margin:0}.tribe-events-style-full.tribe-events-style-theme h2.tribe-events-tickets-title{font-size:90%}.tribe-link-view-attendee{margin:15px 0}.tribe-events-tickets{background:#f8f8f8;border:0;border-radius:3px;max-width:100%;position:relative}.tribe-events-tickets table,.tribe-events-tickets td,.tribe-events-tickets th{border:0}.tribe-events-tickets tr{display:flex;flex-flow:row wrap}.tribe-events-tickets tr:not(:first-child){border-top:2px solid #dfdfdf}.tribe-events-tickets td{flex:none;padding:8px 10px;width:100%;word-break:normal}.tribe-events-tickets td.tickets_name{font-weight:700}.tribe-events-tickets td.quantity,.tribe-events-tickets td.woocommerce{order:2}.tribe-events-tickets td.quantity input[type=number],.tribe-events-tickets td.woocommerce input[type=number]{background-color:#fff;border-radius:3px;margin-bottom:5px;padding:5px 10px;text-align:left}.tribe-events-tickets td.tickets_submit{order:3}.tribe-events-tickets td.tickets_submit .tribe-button{margin:0 0 10px}.tribe-events-tickets .woocommerce.add-to-cart .tribe-button{margin:10px 0}.tribe-events-tickets .tribe-link-tickets-message{background:hsla(0,0%,78%,.8);bottom:0;left:0;position:absolute;right:0;text-align:center;top:0}.tribe-events-tickets .tribe-link-tickets-message .no-javascript-msg{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:90%}.tribe-events-tickets .tribe-tickets-remaining{color:#777;display:block;font-size:11px}.tribe-events-tickets .tribe-tickets-attendees-list-optout label{color:#777;font-size:13px}.tribe-events-tickets .tribe-tickets-attendees-list-optout input[type=checkbox]+label,.tribe-events-tickets .tribe-tickets-attendees-list-optout input[type=radio]+label{display:inline-block}.tribe-events-tickets .tickets_description,.tribe-events-tickets .tickets_name,.tribe-events-tickets .tickets_name p,.tribe-events-tickets .tickets_price{color:#464646;font-size:15px;padding:16px 10px}.tribe-events-tickets input[type=date],.tribe-events-tickets input[type=datetime-local],.tribe-events-tickets input[type=email],.tribe-events-tickets input[type=month],.tribe-events-tickets input[type=number],.tribe-events-tickets input[type=password],.tribe-events-tickets input[type=search],.tribe-events-tickets input[type=tel],.tribe-events-tickets input[type=text],.tribe-events-tickets input[type=time],.tribe-events-tickets input[type=url],.tribe-events-tickets input[type=week],.tribe-events-tickets select,.tribe-events-tickets textarea{background:#fff;width:100%}.tribe-events-tickets header{height:auto}.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta,.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row{display:none}.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta>td,.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row>td,.tribe-tickets-has-rsvp.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta,.tribe-tickets-has-rsvp.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row{display:block}.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta tr,.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row tr{border:0}.tribe-block__rsvp{font-family:Helvetica,sans-serif;margin-bottom:30px;margin-top:30px;max-width:580px;position:relative}.tribe-block__rsvp__ticket{border:1px solid #e1e3e6;display:flex;flex-wrap:wrap;position:relative;width:100%}.tribe-block__rsvp__icon{align-items:center;background:#fff;border-bottom:1px dashed #b5bcc2;color:#434343;display:flex;flex:none;flex-direction:column;font-size:14px;font-weight:700;line-height:17px;padding:20px 17px;width:100%}.tribe-block__rsvp__icon svg{margin-bottom:7px}.tribe-block__rsvp__content{background-color:#f5f8f9;flex:auto}.tribe-block__rsvp__details{padding:25px 20px 20px}.tribe-block__rsvp__title{color:#000;font-size:21px;font-weight:700;line-height:28px;margin-bottom:12px}.tribe-block__rsvp__description{color:#545d66;font-size:14px;line-height:18px;margin-bottom:15px}.tribe-block__rsvp__availability{color:#545d66;display:flex;align-items:center;font-size:12px;line-height:18px}.tribe-block__rsvp__quantity{font-size:18px;font-weight:700;margin-right:6px}.tribe-block__rsvp__status{display:flex;flex-wrap:nowrap;padding:0 20px 25px;text-align:center}.tribe-block__rsvp__status>span{flex:none;margin-right:15px;width:calc((100% - 15px)/2)}.tribe-block__rsvp__status>span:last-child{margin-right:0}.tribe-block__rsvp__status-button{align-items:center;border:1px solid #545d66;border-radius:4px;background:#fff;color:#545d66;display:flex;font-family:Helvetica,sans-serif;font-size:14px;font-weight:700;height:44px;justify-content:center;line-height:1;padding:0;width:100%}.tribe-block__rsvp__status-button svg{margin-left:9px}.tribe-block__rsvp__status-button:focus,.tribe-block__rsvp__status-button:hover{background:#fff;border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-active{border:1px solid #000;color:#000}.tribe-block__rsvp__status-button.tribe-inactive{border:1px solid #e1e3e6;color:#a2aab2}.tribe-block__rsvp__status-button.tribe-inactive:focus,.tribe-block__rsvp__status-button.tribe-inactive:hover{background:#fff;border:1px solid #545d66;color:#545d66}.tribe-block__rsvp__status-button[disabled=disabled]{cursor:default}.tribe-block__rsvp__going-icon,.tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-active .tribe-block__rsvp__going-icon,.tribe-active .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:focus .tribe-block__rsvp__not-going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__going-icon,.tribe-block__rsvp__status-button:hover .tribe-block__rsvp__not-going-icon{fill:#191e23}.tribe-inactive .tribe-block__rsvp__going-icon,.tribe-inactive .tribe-block__rsvp__not-going-icon{fill:#e1e3e6}.tribe-inactive:focus .tribe-block__rsvp__going-icon,.tribe-inactive:focus .tribe-block__rsvp__not-going-icon,.tribe-inactive:hover .tribe-block__rsvp__going-icon,.tribe-inactive:hover .tribe-block__rsvp__not-going-icon{fill:#a2aab2}.tribe-block__rsvp__form{padding:0 20px}.tribe-block__rsvp__form form{border-top:1px solid #e1e3e6;display:flex;padding:30px 0}.tribe-left{flex:none}.tribe-block__rsvp__number-input{padding-right:20px}.tribe-block__rsvp__number-input-inner{align-items:center;display:flex}.tribe-block__rsvp__number-input-inner input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:none;color:#000;font-family:Helvetica,sans-serif;font-size:30px;font-weight:700;height:40px;max-width:48px;padding:4px 0;text-align:center}.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-inner-spin-button,.tribe-block__rsvp__number-input-inner input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none}.tribe-block__rsvp__number-input-label{display:block;font-size:14px;font-weight:700;line-height:18px;margin-top:9px;text-align:center}.tribe-block__rsvp__number-input-button{background-color:transparent;height:30px;padding:0;position:relative;width:20px}.tribe-block__rsvp__number-input-button:after,.tribe-block__rsvp__number-input-button:before{background-color:#aeb4bb;content:"";height:2px;position:absolute;width:10px}.tribe-block__rsvp__number-input-button:focus,.tribe-block__rsvp__number-input-button:hover{background:none}.tribe-block__rsvp__number-input-button:focus:after,.tribe-block__rsvp__number-input-button:focus:before,.tribe-block__rsvp__number-input-button:hover:after,.tribe-block__rsvp__number-input-button:hover:before{background-color:#545d66}.tribe-block__rsvp__number-input-button--minus{margin-left:-10px}.tribe-block__rsvp__number-input-button--minus:after,.tribe-block__rsvp__number-input-button--minus:before{right:0}.tribe-block__rsvp__number-input-button--plus{margin-right:-10px}.tribe-block__rsvp__number-input-button--plus:after,.tribe-block__rsvp__number-input-button--plus:before{left:0}.tribe-block__rsvp__number-input-button--plus:after{transform:rotate(90deg)}.tribe-right{flex:auto}.tribe-right input[type=email],.tribe-right input[type=text]{border-color:#e1e3e6;color:#000;display:block;font-family:Helvetica,sans-serif;font-size:16px;height:40px;line-height:18px;margin-bottom:15px;padding:10px 15px;width:100%}.tribe-right input[type=email]::-webkit-input-placeholder,.tribe-right input[type=text]::-webkit-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::-moz-placeholder,.tribe-right input[type=text]::-moz-placeholder{color:#a2aab2}.tribe-right input[type=email]:-ms-input-placeholder,.tribe-right input[type=email]::-ms-input-placeholder,.tribe-right input[type=text]:-ms-input-placeholder,.tribe-right input[type=text]::-ms-input-placeholder{color:#a2aab2}.tribe-right input[type=email]::placeholder,.tribe-right input[type=text]::placeholder{color:#a2aab2}.tribe-right label{cursor:pointer;font-size:14px;font-weight:400}.tribe-right label[for^=tribe-tickets-attendees-list-optout]{align-items:flex-start;display:flex;margin:0 0 15px;padding-top:7px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #e1e3e6;border-radius:0;cursor:pointer;flex:none;height:16px;margin:1px 10px 0 0;width:16px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:focus{box-shadow:0 0 0 1px #e1e3e6;outline:2px solid transparent;outline-offset:-2px}.tribe-right label[for^=tribe-tickets-attendees-list-optout] input[type=checkbox]:checked:before{color:#009fd4;content:"\f147";display:inline-block;float:left;font:normal 21px/1 dashicons;margin:-3px 0 0 -4px;speak:none;vertical-align:middle;width:16px}.tribe-tickets-meta-option-label{color:#000;font-size:14px;line-height:18px;font-weight:400}.tribe-block__rsvp__message__error,.tribe-block__rsvp__message__success{color:#000;font-size:14px;line-height:18px;padding:20px}.tribe-block__rsvp__message__error{background:#ffebe8;border:1px solid #c00;display:none;margin-bottom:20px}.tribe-block__rsvp__message__success{background:#ecfae5;border:1px solid #1bd800;margin-top:20px}.tribe-block__rsvp__submit-button{background:#009fd4;color:#fff;font-family:Helvetica,sans-serif;font-size:15px;font-weight:700;line-height:18px;margin:10px 0 0;padding:10px 23px}.tribe-block__rsvp__submit-button:focus,.tribe-block__rsvp__submit-button:hover{background:#007bb4}.tribe-block__rsvp__submit-button:disabled{cursor:not-allowed;background:#a2aab2}.tribe-block__rsvp__form__attendee-meta{margin:0}.tribe-block__rsvp__form__attendee-meta td,.tribe-block__rsvp__form__attendee-meta th{padding:0;border:none;word-break:normal}.tribe-common-c-loader.tribe-block__rsvp__loading{align-items:center;background:hsla(0,0%,100%,.7);height:100%;justify-content:center;left:0;margin:0;padding:0;position:absolute;text-align:center;top:0;width:100%;z-index:99}.tribe-common-c-loader.tribe-block__rsvp__loading svg{max-width:70px;position:absolute;top:35%}.tribe-common-c-loader.tribe-block__rsvp__loading svg circle{fill:#888}@media only screen and (min-width:768px){.tribe-events-tickets tr{display:table-row}}@media (min-width:768px){.tribe-events-tickets td{width:auto}}@media (min-width:768px){.tribe-events-tickets td.quantity input[type=number],.tribe-events-tickets td.woocommerce input[type=number]{width:4.375em}.tribe-events-tickets .woocommerce.add-to-cart{padding:16px}.tribe-events-tickets .woocommerce.add-to-cart .tribe-button{margin:10px}.tribe-events-tickets input[type=date],.tribe-events-tickets input[type=datetime-local],.tribe-events-tickets input[type=email],.tribe-events-tickets input[type=month],.tribe-events-tickets input[type=number],.tribe-events-tickets input[type=password],.tribe-events-tickets input[type=search],.tribe-events-tickets input[type=tel],.tribe-events-tickets input[type=text],.tribe-events-tickets input[type=time],.tribe-events-tickets input[type=url],.tribe-events-tickets input[type=week],.tribe-events-tickets select,.tribe-events-tickets textarea{width:auto}.tribe-tickets-has-rsvp.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta,.tribe-tickets-has-rsvp.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row{display:table-row}.tribe-events-tickets-rsvp tr.tribe-event-tickets-plus-meta>td,.tribe-events-tickets-rsvp tr.tribe-tickets-meta-row>td{display:table-cell}}@media (min-width:600px){.tribe-block__rsvp__ticket{align-items:stretch;flex-wrap:nowrap}.tribe-block__rsvp__icon{border-bottom:none;border-right:1px dashed #b5bcc2;padding:28px 17px;width:84px}.tribe-block__rsvp__number-input-inner input[type=number]{font-size:36px;height:48px}.tribe-block__rsvp__message__success{padding:10px 30px;text-align:center}}
src/resources/js/app/blocks.js CHANGED
@@ -43033,16 +43033,17 @@ var header_image_container_mapStateToProps = function mapStateToProps(state) {
43033
 
43034
  var header_image_container_mapDispatchToProps = function mapDispatchToProps(dispatch) {
43035
  return {
43036
- onRemove: function onRemove() {
43037
- return dispatch(rsvp["a" /* actions */].deleteRSVPHeaderImage());
43038
- },
43039
  /**
43040
  * Full payload from gutenberg media upload is not used,
43041
  * only id, alt, and medium src are used for this specific case.
43042
  */
43043
  onSelect: function onSelect(image) {
43044
  return dispatch(rsvp["a" /* actions */].updateRSVPHeaderImage(image));
 
 
 
43045
  }
 
43046
  };
43047
  };
43048
 
43033
 
43034
  var header_image_container_mapDispatchToProps = function mapDispatchToProps(dispatch) {
43035
  return {
 
 
 
43036
  /**
43037
  * Full payload from gutenberg media upload is not used,
43038
  * only id, alt, and medium src are used for this specific case.
43039
  */
43040
  onSelect: function onSelect(image) {
43041
  return dispatch(rsvp["a" /* actions */].updateRSVPHeaderImage(image));
43042
+ },
43043
+ onRemove: function onRemove() {
43044
+ return dispatch(rsvp["a" /* actions */].deleteRSVPHeaderImage());
43045
  }
43046
+
43047
  };
43048
  };
43049
 
src/resources/js/app/blocks.min.js CHANGED
@@ -11,4 +11,4 @@ var tribe="object"==typeof tribe?tribe:{};tribe.tickets=tribe.tickets||{},tribe.
11
  *
12
  * This source code is licensed under the MIT license found in the
13
  * LICENSE file in the root directory of this source tree.
14
- */Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,d=r?Symbol.for("react.context"):60110,_=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,m=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,f=r?Symbol.for("react.memo"):60115,T=r?Symbol.for("react.lazy"):60116;function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case _:case l:case o:case c:case s:case p:return e;default:switch(e=e&&e.$$typeof){case d:case m:case u:return e;default:return t}}case T:case f:case i:return t}}}function y(e){return h(e)===l}t.typeOf=h,t.AsyncMode=_,t.ConcurrentMode=l,t.ContextConsumer=d,t.ContextProvider=u,t.Element=a,t.ForwardRef=m,t.Fragment=o,t.Lazy=T,t.Memo=f,t.Portal=i,t.Profiler=c,t.StrictMode=s,t.Suspense=p,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===l||e===c||e===s||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===T||e.$$typeof===f||e.$$typeof===u||e.$$typeof===d||e.$$typeof===m)},t.isAsyncMode=function(e){return y(e)||h(e)===_},t.isConcurrentMode=y,t.isContextConsumer=function(e){return h(e)===d},t.isContextProvider=function(e){return h(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return h(e)===m},t.isFragment=function(e){return h(e)===o},t.isLazy=function(e){return h(e)===T},t.isMemo=function(e){return h(e)===f},t.isPortal=function(e){return h(e)===i},t.isProfiler=function(e){return h(e)===c},t.isStrictMode=function(e){return h(e)===s},t.isSuspense=function(e){return h(e)===p}},function(e,t,n){},function(e,t,n){},function(e,t){var n,r,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var c,u=[],d=!1,_=-1;function l(){d&&c&&(d=!1,c.length?u=c.concat(u):_=-1,u.length&&m())}function m(){if(!d){var e=s(l);d=!0;for(var t=u.length;t;){for(c=u,u=[];++_<t;)c&&c[_].run();_=-1,t=u.length}c=null,d=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function f(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||d||s(m)},p.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=f,a.addListener=f,a.once=f,a.off=f,a.removeListener=f,a.removeAllListeners=f,a.emit=f,a.prependListener=f,a.prependOnceListener=f,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(111),a=n(324),i=n(15),o=n(30);function s(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var c=n(13),u=n.n(c),d=n(1),_=n.n(d),l=_.a.shape({trySubscribe:_.a.func.isRequired,tryUnsubscribe:_.a.func.isRequired,notifyNestedSubs:_.a.func.isRequired,isSubscribed:_.a.func.isRequired}),m=_.a.shape({subscribe:_.a.func.isRequired,dispatch:_.a.func.isRequired,getState:_.a.func.isRequired});u.a.forwardRef;!function(e){var t;void 0===e&&(e="store");var n=e+"Subscription",r=function(t){s(a,t);var r=a.prototype;function a(n,r){var a;return(a=t.call(this,n,r)||this)[e]=n.store,a}return r.getChildContext=function(){var t;return(t={})[e]=this[e],t[n]=null,t},r.render=function(){return c.Children.only(this.props.children)},a}(c.Component);r.propTypes={store:m.isRequired,children:_.a.element.isRequired},r.childContextTypes=((t={})[e]=m.isRequired,t[n]=l,t)}();function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}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}).apply(this,arguments)}function T(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var h=n(489),y=n.n(h),b=n(325),M=n.n(b),S=n(488),E=null,g={notify:function(){}};var v=function(){function e(e,t,n){this.store=e,this.parentSub=t,this.onStateChange=n,this.unsubscribe=null,this.listeners=g}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){var e,t;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=(e=[],t=[],{clear:function(){t=E,e=E},notify:function(){for(var n=e=t,r=0;r<n.length;r++)n[r]()},get:function(){return t},subscribe:function(n){var r=!0;return t===e&&(t=e.slice()),t.push(n),function(){r&&e!==E&&(r=!1,t===e&&(t=e.slice()),t.splice(t.indexOf(n),1))}}}))},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=g)},e}(),k=void 0!==u.a.forwardRef,D=0,L={};function O(){}function Y(e,t){var n,r;void 0===t&&(t={});var a=t,i=a.getDisplayName,o=void 0===i?function(e){return"ConnectAdvanced("+e+")"}:i,u=a.methodName,d=void 0===u?"connectAdvanced":u,_=a.renderCountProp,h=void 0===_?void 0:_,b=a.shouldHandleStateChanges,E=void 0===b||b,g=a.storeKey,Y=void 0===g?"store":g,w=a.withRef,j=void 0!==w&&w,I=T(a,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),P=Y+"Subscription",C=D++,x=((n={})[Y]=m,n[P]=l,n),R=((r={})[P]=l,r);return function(t){M()(Object(S.isValidElementType)(t),"You must pass a component to the function returned by "+d+". Instead received "+JSON.stringify(t));var n=t.displayName||t.name||"Component",r=o(n),a=f({},I,{getDisplayName:o,methodName:d,renderCountProp:h,shouldHandleStateChanges:E,storeKey:Y,withRef:j,displayName:r,wrappedComponentName:n,WrappedComponent:t}),i=function(n){function i(e,t){var a;return(a=n.call(this,e,t)||this).version=C,a.state={},a.renderCount=0,a.store=e[Y]||t[Y],a.propsMode=Boolean(e[Y]),a.setWrappedInstance=a.setWrappedInstance.bind(p(p(a))),M()(a.store,'Could not find "'+Y+'" in either the context or props of "'+r+'". Either wrap the root component in a <Provider>, or explicitly pass "'+Y+'" as a prop to "'+r+'".'),a.initSelector(),a.initSubscription(),a}s(i,n);var o=i.prototype;return o.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[P]=t||this.context[P],e},o.componentDidMount=function(){E&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},o.componentWillReceiveProps=function(e){this.selector.run(e)},o.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},o.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=O,this.store=null,this.selector.run=O,this.selector.shouldComponentUpdate=!1},o.getWrappedInstance=function(){return M()(j,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+d+"() call."),this.wrappedInstance},o.setWrappedInstance=function(e){this.wrappedInstance=e},o.initSelector=function(){var t=e(this.store.dispatch,a);this.selector=function(e,t){var n={run:function(r){try{var a=e(t.getState(),r);(a!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=a,n.error=null)}catch(e){n.shouldComponentUpdate=!0,n.error=e}}};return n}(t,this.store),this.selector.run(this.props)},o.initSubscription=function(){if(E){var e=(this.propsMode?this.props:this.context)[P];this.subscription=new v(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},o.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(L)):this.notifyNestedSubs()},o.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},o.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},o.addExtraProps=function(e){if(!(j||h||this.propsMode&&this.subscription))return e;var t=f({},e);return j&&(t.ref=this.setWrappedInstance),h&&(t[h]=this.renderCount++),this.propsMode&&this.subscription&&(t[P]=this.subscription),t},o.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(c.createElement)(t,this.addExtraProps(e.props))},i}(c.Component);return k&&(i.prototype.UNSAFE_componentWillReceiveProps=i.prototype.componentWillReceiveProps,delete i.prototype.componentWillReceiveProps),i.WrappedComponent=t,i.displayName=r,i.childContextTypes=R,i.contextTypes=x,i.propTypes=x,y()(i,t)}}var w=Object.prototype.hasOwnProperty;function j(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function I(e,t){if(j(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var a=0;a<n.length;a++)if(!w.call(t,n[a])||!j(e[n[a]],t[n[a]]))return!1;return!0}var P=n(16);function C(e){return function(t,n){var r=e(t,n);function a(){return r}return a.dependsOnOwnProps=!1,a}}function x(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function R(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=x(e);var a=r(t,n);return"function"==typeof a&&(r.mapToProps=a,r.dependsOnOwnProps=x(a),a=r(t,n)),a},r}}var A=[function(e){return"function"==typeof e?R(e):void 0},function(e){return e?void 0:C((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?C((function(t){return Object(P.a)(e,t)})):void 0}];var H=[function(e){return"function"==typeof e?R(e):void 0},function(e){return e?void 0:C((function(){return{}}))}];function N(e,t,n){return f({},n,e,t)}var V=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,a=n.pure,i=n.areMergedPropsEqual,o=!1;return function(t,n,s){var c=e(t,n,s);return o?a&&i(c,r)||(r=c):(o=!0,r=c),r}}}(e):void 0},function(e){return e?void 0:function(){return N}}];function F(e,t,n,r){return function(a,i){return n(e(a,i),t(r,i),i)}}function K(e,t,n,r,a){var i,o,s,c,u,d=a.areStatesEqual,_=a.areOwnPropsEqual,l=a.areStatePropsEqual,m=!1;function p(a,m){var p,f,T=!_(m,o),h=!d(a,i);return i=a,o=m,T&&h?(s=e(i,o),t.dependsOnOwnProps&&(c=t(r,o)),u=n(s,c,o)):T?(e.dependsOnOwnProps&&(s=e(i,o)),t.dependsOnOwnProps&&(c=t(r,o)),u=n(s,c,o)):h?(p=e(i,o),f=!l(p,s),s=p,f&&(u=n(s,c,o)),u):u}return function(a,d){return m?p(a,d):(s=e(i=a,o=d),c=t(r,o),u=n(s,c,o),m=!0,u)}}function W(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,a=t.initMergeProps,i=T(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),o=n(e,i),s=r(e,i),c=a(e,i);return(i.pure?K:F)(o,s,c,e,i)}function U(e,t,n){for(var r=t.length-1;r>=0;r--){var a=t[r](e);if(a)return a}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function z(e,t){return e===t}var G,B,q,J,$,Z,Q,X,ee,te,ne,re,ae=(q=(B=void 0===G?{}:G).connectHOC,J=void 0===q?Y:q,$=B.mapStateToPropsFactories,Z=void 0===$?H:$,Q=B.mapDispatchToPropsFactories,X=void 0===Q?A:Q,ee=B.mergePropsFactories,te=void 0===ee?V:ee,ne=B.selectorFactory,re=void 0===ne?W:ne,function(e,t,n,r){void 0===r&&(r={});var a=r,i=a.pure,o=void 0===i||i,s=a.areStatesEqual,c=void 0===s?z:s,u=a.areOwnPropsEqual,d=void 0===u?I:u,_=a.areStatePropsEqual,l=void 0===_?I:_,m=a.areMergedPropsEqual,p=void 0===m?I:m,h=T(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),y=U(e,Z,"mapStateToProps"),b=U(t,X,"mapDispatchToProps"),M=U(n,te,"mergeProps");return J(re,f({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:y,initMapDispatchToProps:b,initMergeProps:M,pure:o,areStatesEqual:c,areOwnPropsEqual:d,areStatePropsEqual:l,areMergedPropsEqual:p},h))}),ie=n(4),oe=n.n(ie),se=n(20),ce=n(35),ue=n.n(ce),de=n(36),_e=n.n(de),le=n(33),me=n.n(le),pe=n(37),fe=n.n(pe),Te=n(22),he=n.n(Te),ye=n(26),be=n(24),Me=n(109),Se=n(86),Ee=n.n(Se),ge=n(21),ve=(n(492),function(e){var t=e.goingCount,n=e.notGoingCount,r=e.showNotGoing;return wp.element.createElement("div",{className:"tribe-editor__rsvp-container-header__counters"},wp.element.createElement(ge.Counter,{className:"tribe-editor__rsvp-container-header__going-counter",count:t,label:Object(i.__)("Going","event-tickets")}),r&&wp.element.createElement(ge.Counter,{className:"tribe-editor__rsvp-container-header__not-going-counter",count:n,label:Object(i.__)("Not going","event-tickets")}))});ve.propTypes={goingCount:_.a.number,notGoingCount:_.a.number,showNotGoing:_.a.bool};var ke=ve,De=n(12),Le=n(18),Oe=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{goingCount:De.d.getRSVPGoingCount(e),notGoingCount:De.d.getRSVPNotGoingCount(e),showNotGoing:De.d.getRSVPNotGoingResponses(e)}})))(ke),Ye=n(62),we=(n(493),wp.element.createElement(ge.Tooltip,{labelClassName:"tribe-editor__ticket__container-header-clipboard-tooltip",label:wp.element.createElement(Ye.Clipboard,null),text:Object(i.__)("This ticket has Attendee Information Fields configured.","event-tickets")})),je=function(e){var t,n,r,a,o=e.description,s=e.hasAttendeeInfoFields,u=e.isCreated,d=e.isDisabled,_=e.isSelected,l=e.onTempDescriptionChange,m=e.onTempTitleChange,p=e.tempDescription,f=e.tempTitle,T=e.title,h=e.available;return wp.element.createElement(c.Fragment,null,wp.element.createElement("div",{className:"tribe-editor__rsvp-container-header__header-details"},function(e,t,n,r,a,o){return n?wp.element.createElement("div",{className:"tribe-editor__rsvp-container-header__title-input-wrapper"},wp.element.createElement(Ee.a,{className:"tribe-editor__rsvp-container-header__title-input",value:a,placeholder:Object(i.__)("RSVP Title","event-tickets"),onChange:r,disabled:t}),e&&we):wp.element.createElement("h2",{className:"tribe-editor__rsvp-container-header__title"},o)}(s,d,_,m,f,T),function(e,t,n,r,a){return t?wp.element.createElement(Ee.a,{className:"tribe-editor__rsvp-container-header__description-input",value:r,placeholder:Object(i.__)("description","event-tickets"),onChange:n,disabled:e}):a&&wp.element.createElement("span",{className:"tribe-editor__rsvp-container-header__description"},a)}(d,_,l,p,o),u&&(t=h,n=Object(i.__)("%d available","event-tickets"),r=n,a=wp.element.createElement("span",{className:"tribe-editor__rsvp-container-header__capacity-label-fallback"},Object(i.__)("Unlimited","event-tickets")),wp.element.createElement(be.NumericLabel,{className:"tribe-editor__rsvp-container-header__capacity-label",count:t,includeZero:!0,singular:n,plural:r,fallback:a}))),wp.element.createElement(Oe,null))};je.propTypes={available:_.a.number,description:_.a.string,hasAttendeeInfoFields:_.a.bool,isCreated:_.a.bool,isDisabled:_.a.bool.isRequired,isSelected:_.a.bool.isRequired,onTempDescriptionChange:_.a.func,onTempTitleChange:_.a.func,tempDescription:_.a.string,tempTitle:_.a.string,title:_.a.string};var Ie=je,Pe=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)},Ce=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{available:De.d.getRSVPAvailable(e),description:De.d.getRSVPDescription(e),hasAttendeeInfoFields:De.d.getRSVPHasAttendeeInfoFields(e),isCreated:De.d.getRSVPCreated(e),isDisabled:Pe(e),tempDescription:De.d.getRSVPTempDescription(e),tempTitle:De.d.getRSVPTempTitle(e),title:De.d.getRSVPTitle(e)}}),(function(e){return{onTempDescriptionChange:function(t){e(De.a.setRSVPTempDescription(t.target.value)),e(De.a.setRSVPHasChanges(!0))},onTempTitleChange:function(t){e(De.a.setRSVPTempTitle(t.target.value)),e(De.a.setRSVPHasChanges(!0))}}})))(Ie),xe=n(72),Re=n.n(xe),Ae=(n(495),wp.element.createElement(ye.Dashicon,{className:"tribe-editor__rsvp-duration__duration-tooltip-label",icon:"info-outline"})),He=function(e){var t=e.tooltipDisabled;return wp.element.createElement(be.LabelWithTooltip,{className:"tribe-editor__rsvp-duration__duration-label",label:Object(i.__)("Duration","event-tickets"),tooltipDisabled:t,tooltipLabel:Ae,tooltipText:Object(i.__)("By default, sales will begin as soon as you save the ticket and end when the event begins","event-tickets")})},Ne=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)},Ve=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isDisabled:Ne(e)}})))(He),Fe=n(9),Ke=n.n(Fe),We=n(38),Ue=n.n(We),ze=(n(496),function(e){return wp.element.createElement(be.DateTimeRangePicker,Ke()({className:"tribe-editor__rsvp-duration__duration-picker"},e))});ze.propTypes={fromDate:_.a.instanceOf(Date),fromDateInput:_.a.string,fromDateDisabled:_.a.bool,fromTime:_.a.string,fromTimeDisabled:_.a.bool,onFromDateChange:_.a.func,onFromTimePickerBlur:_.a.func,onFromTimePickerChange:_.a.func,onFromTimePickerClick:_.a.func,onToDateChange:_.a.func,onToTimePickerBlur:_.a.func,onToTimePickerChange:_.a.func,onToTimePickerClick:_.a.func,toDate:_.a.instanceOf(Date),toDateInput:_.a.string,toDateDisabled:_.a.bool,toTime:_.a.string,toTimeDisabled:_.a.bool};var Ge=ze,Be=n(3),qe=function(e){return function(t,n,r){var a={date:t,dayPickerInput:r};e(De.a.handleRSVPStartDate(a))}},Je=function(e){return function(t){return e(De.a.setRSVPTempStartTimeInput(t.target.value))}},$e=function(e){return function(t,n){e(De.a.handleRSVPStartTime(t)),n()}},Ze=function(e){return function(t,n,r){var a={date:t,dayPickerInput:r};e(De.a.handleRSVPEndDate(a))}},Qe=function(e){return function(t){return e(De.a.setRSVPTempEndTimeInput(t.target.value))}},Xe=function(e){return function(t,n){e(De.a.handleRSVPEndTime(t)),n()}},et=function(e,t){return function(n){var r=Be.moment.toMoment(n.target.value,Be.moment.TIME_FORMAT,!1);if(!r.isValid()){var a=De.d.getRSVPStartTimeInput(e);r=Be.moment.toMoment(a,Be.moment.TIME_FORMAT,!1)}var i=Be.moment.totalSeconds(r);t(De.a.handleRSVPStartTime(i))}},tt=function(e,t){return function(n){var r=Be.moment.toMoment(n.target.value,Be.moment.TIME_FORMAT,!1);if(!r.isValid()){var a=De.d.getRSVPEndTimeInput(e);r=Be.moment.toMoment(a,Be.moment.TIME_FORMAT,!1)}var i=Be.moment.totalSeconds(r);t(De.a.handleRSVPEndTime(i))}},nt=Object(P.c)(Object(Le.withStore)(),ae((function(e){var t=Be.globals.tecDateSettings().datepickerFormat?Be.moment.toFormat(Be.globals.tecDateSettings().datepickerFormat):"LL",n=De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e),r=De.d.getRSVPTempStartDateMoment(e),a=De.d.getRSVPTempEndDateMoment(e),i=r&&r.toDate(),o=a&&a.toDate();return{fromDate:i,fromDateInput:De.d.getRSVPTempStartDateInput(e),fromDateDisabled:n,fromDateFormat:t,fromTime:De.d.getRSVPTempStartTimeInput(e),fromTimeDisabled:n,toDate:o,toDateInput:De.d.getRSVPTempEndDateInput(e),toDateDisabled:n,toDateFormat:t,toTime:De.d.getRSVPTempEndTimeInput(e),toTimeDisabled:n,state:e}}),(function(e){return{onFromDateChange:qe(e),onFromTimePickerChange:Je(e),onFromTimePickerClick:$e(e),onToDateChange:Ze(e),onToTimePickerChange:Qe(e),onToTimePickerClick:Xe(e),dispatch:e}}),(function(e,t,n){var r=e.state,a=Ue()(e,["state"]),i=t.dispatch,o=Ue()(t,["dispatch"]);return Ke()({},n,a,o,{onFromTimePickerBlur:et(r,i),onToTimePickerBlur:tt(r,i)})})))(Ge),rt=(n(497),function(e){var t=e.hasDurationError;return wp.element.createElement("div",{className:"tribe-editor__rsvp-duration"},wp.element.createElement(Ve,null),wp.element.createElement(nt,null),t&&wp.element.createElement("span",{className:"tribe-editor__rsvp-duration__error"},Object(i.__)("There is an error with the selected sales duration. Please fix the issue before saving.","event-tickets")))}),at=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{hasDurationError:De.d.getRSVPHasDurationError(e)}})))(rt),it=(n(498),function(e){var t=e.moveRSVP,n=e.removeRSVP,r=e.isDisabled;return wp.element.createElement("div",{className:"tribe-editor__rsvp__content-row--move-delete"},wp.element.createElement(ge.Button,{type:"button",onClick:t,disabled:r},Object(i.__)("Move RSVP","event-tickets")),wp.element.createElement(ge.Button,{type:"button",onClick:n,disabled:r},Object(i.__)("Remove RSVP","event-tickets")))});it.propTypes={moveRSVP:_.a.func.isRequired,removeRSVP:_.a.func.isRequired,isDisabled:_.a.bool.isRequired};var ot=it,st=n(68),ct=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{created:De.d.getRSVPCreated(e),rsvpId:De.d.getRSVPId(e),isDisabled:De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)}}),(function(e,t){return{moveRSVP:function(n){return e(Object(st.c)(n,t.clientId))},dispatch:e}}),(function(e,t,n){var r=t.dispatch,a=Ue()(t,["dispatch"]);return Ke()({},n,e,a,{removeRSVP:function(){window.confirm(Object(i.__)("Are you sure you want to delete this RSVP? It cannot be undone.","event-tickets"))&&(r(De.a.deleteRSVP()),e.created&&e.rsvpId&&r(De.e.deleteRSVP(e.rsvpId)),Object(se.dispatch)("core/editor").removeBlocks([n.clientId]))},moveRSVP:function(){return t.moveRSVP(e.rsvpId)}})})))(ot),ut=(n(499),function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getContent=function(){return wp.element.createElement(c.Fragment,null,wp.element.createElement(at,null),n.props.hasBeenCreated&&wp.element.createElement(ct,{clientId:n.props.clientId}))},n.getHeader=function(){return wp.element.createElement(c.Fragment,null,wp.element.createElement(ye.Dashicon,{className:"tribe-editor__rsvp__advanced-options-header-icon",icon:"arrow-down"}),wp.element.createElement("span",{className:"tribe-editor__rsvp__advanced-options-header-text"},Object(i.__)("Advanced Options","event-tickets")))},n.getRows=function(){return[{accordionId:n.accordionId,content:n.getContent(),contentClassName:"tribe-editor__rsvp__advanced-options-content",header:n.getHeader(),headerAttrs:{disabled:n.props.isDisabled},headerClassName:"tribe-editor__rsvp__advanced-options-header"}]},n.accordionId=Re()(),n}return fe()(t,e),_e()(t,[{key:"render",value:function(){return wp.element.createElement(ge.Accordion,{className:"tribe-editor__rsvp__advanced-options",rows:this.getRows()})}}]),t}(c.PureComponent));ut.propTypes={isDisabled:_.a.bool.isRequired,hasBeenCreated:_.a.bool,clientId:_.a.string};var dt=ut,_t=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)},lt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isDisabled:_t(e),hasBeenCreated:De.d.getRSVPCreated(e)}})))(dt),mt=(n(500),Object(i.__)("+ Add","event-tickets")),pt=Object(i.__)("Edit","event-tickets"),ft=function(e){var t=e.attendeeRegistrationURL,n=e.hasAttendeeInfoFields,r=e.isCreated,a=e.isDisabled,o=e.isModalOpen,s=e.onClick,c=e.onClose,u=e.onIframeLoad,d=n?pt:mt;return wp.element.createElement(be.AttendeesRegistration,{helperText:Object(i.__)("Save your RSVP to enable attendee information fields","event-tickets"),iframeURL:t,isDisabled:a,isModalOpen:o,label:Object(i.__)("Attendee Information","event-tickets"),linkText:d,modalTitle:Object(i.__)("Attendee Information","event-tickets"),onClick:s,onClose:c,onIframeLoad:u,showHelperText:!r})};ft.propTypes={attendeeRegistrationURL:_.a.string.isRequired,hasAttendeeInfoFields:_.a.bool.isRequired,isCreated:_.a.bool.isRequired,isDisabled:_.a.bool.isRequired,isModalOpen:_.a.bool.isRequired,onClick:_.a.func.isRequired,onClose:_.a.func.isRequired,onIframeLoad:_.a.func.isRequired};var Tt=ft,ht=function(e){return Be.globals.adminUrl()+"edit.php?post_type="+Object(se.select)("core/editor").getCurrentPostType()+"&page=attendee-registration&ticket_id="+De.d.getRSVPId(e)+"&tribe_events_modal=1"},yt=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)||!De.d.getRSVPCreated(e)},bt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{attendeeRegistrationURL:ht(e),hasAttendeeInfoFields:De.d.getRSVPHasAttendeeInfoFields(e),isCreated:De.d.getRSVPCreated(e),isDisabled:yt(e),isModalOpen:De.d.getRSVPIsModalOpen(e)}}),(function(e,t){return{onClick:function(){e(De.a.setRSVPIsModalOpen(!0))},onClose:function(n){n.target.classList.contains("components-modal__content")||e(De.a.setRSVPIsModalOpen(t.clientId,!1))},onIframeLoad:function(t){var n=t.contentWindow,r=function(){t.nextSibling.classList.add("tribe-editor__attendee-registration__modal-overlay--show")},a=n.document.querySelector("#event-tickets-attendee-information");a.addEventListener("submit",r);var i=function(){n.removeEventListener("unload",o),a.removeEventListener("submit",r)},o=function(){i();var t=n.document.querySelector("#tribe-tickets-attendee-sortables"),r=Boolean(t.firstElementChild);e(De.a.setRSVPHasAttendeeInfoFields(r)),e(De.a.setRSVPIsModalOpen(!1))};n.addEventListener("unload",o);var s=n.document.querySelector(".tribe-intro > a");s&&s.setAttribute("target","_blank")}}})))(Tt),Mt=(n(501),function(){return wp.element.createElement("div",{className:"tribe-editor__rsvp-container-content__labels"},wp.element.createElement("span",{className:"tribe-editor__rsvp-container-content__capacity-label"},Object(i.__)("RSVP Capacity","event-tickets")),wp.element.createElement("span",{className:"tribe-editor__rsvp-container-content__capacity-label-help"},Object(i.__)("Leave blank if unlimited","event-tickets")))}),St=function(e){var t=e.capacityId,n=e.isDisabled,r=e.notGoingId,a=e.onTempCapacityChange,o=e.onTempNotGoingResponsesChange,s=e.tempCapacity,c=e.tempNotGoingResponses;return wp.element.createElement("div",{className:"tribe-editor__rsvp-container-content__options"},wp.element.createElement(ge.NumberInput,{className:"tribe-editor__rsvp-container-content__capacity-input",disabled:n,id:t,min:0,onChange:a,value:s}),wp.element.createElement(ge.Checkbox,{checked:c,className:"tribe-editor__rsvp-container-content__not-going-responses",disabled:n,id:r,label:Object(i.__)('Enable "Not Going" responses',"event-tickets"),onChange:o}))};St.propTypes={capacityId:_.a.string.isRequired,isDisabled:_.a.bool.isRequired,notGoingId:_.a.string.isRequired,onTempCapacityChange:_.a.func.isRequired,onTempNotGoingResponsesChange:_.a.func.isRequired,tempCapacity:_.a.string.isRequired,tempNotGoingResponses:_.a.bool.isRequired};var Et=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.capacityId=Re()(),n.notGoingId=Re()(),n}return fe()(t,e),_e()(t,[{key:"render",value:function(){var e=this.props,t=e.isDisabled,n=e.onTempCapacityChange,r=e.onTempNotGoingResponsesChange,a=e.tempCapacity,i=e.tempNotGoingResponses,o=e.clientId,s={capacityId:this.capacityId,isDisabled:t,notGoingId:this.notGoingId,onTempCapacityChange:n,onTempNotGoingResponsesChange:r,tempCapacity:a,tempNotGoingResponses:i};return wp.element.createElement(c.Fragment,null,wp.element.createElement(Mt,null),wp.element.createElement(St,s),wp.element.createElement(lt,{clientId:o}),this.props.hasTicketsPlus&&wp.element.createElement(bt,null))}}]),t}(c.PureComponent);Et.propTypes={clientId:_.a.string,hasTicketsPlus:_.a.bool,onTempCapacityChange:_.a.func,onTempNotGoingResponsesChange:_.a.func,tempCapacity:_.a.string,tempNotGoingResponses:_.a.bool};var gt=Et,vt=n(31),kt=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)},Dt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),isDisabled:kt(e),tempCapacity:De.d.getRSVPTempCapacity(e),tempNotGoingResponses:De.d.getRSVPTempNotGoingResponses(e)}}),(function(e){return{onTempCapacityChange:function(t){e(De.a.setRSVPTempCapacity(t.target.value)),e(De.a.setRSVPHasChanges(!0))},onTempNotGoingResponsesChange:function(t){e(De.a.setRSVPTempNotGoingResponses(t.target.checked)),e(De.a.setRSVPHasChanges(!0))}}})))(gt),Lt=(n(502),function(e){var t=e.isDisabled;return wp.element.createElement(c.Fragment,null,t?wp.element.createElement(o.RSVPInactive,null):wp.element.createElement(o.RSVPActive,null),wp.element.createElement("span",{className:"tribe-editor__rsvp-container__icon-label"},Object(i.__)("RSVP","event-tickets")))});Lt.propTypes={isDisabled:_.a.bool.isRequired};var Ot=function(e){var t=e.isDisabled,n=e.isSelected,r=e.clientId;return wp.element.createElement(be.ContainerPanel,{className:he()("tribe-editor__rsvp-container",{"tribe-editor__rsvp-container--disabled":t}),layout:Me.a.rsvp,icon:wp.element.createElement(Lt,{isDisabled:t}),header:wp.element.createElement(Ce,{isSelected:n}),content:wp.element.createElement(Dt,{clientId:r})})};Ot.propTypes={isDisabled:_.a.bool.isRequired,isSelected:_.a.bool.isRequired,clientId:_.a.string.isRequired};var Yt=Ot,wt=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)},jt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isDisabled:wt(e)}})))(Yt),It=function(e){var t=e.href,n=e.isDisabled;return wp.element.createElement(be.ActionButton,{asLink:!0,className:"tribe-editor__rsvp__action-button tribe-editor__rsvp__action-button--attendees",disabled:n,href:t,icon:wp.element.createElement(o.Attendees,null),target:"_blank"},Object(i.__)("Attendees","event-tickets"))};It.propTypes={href:_.a.string,isDisabled:_.a.bool};var Pt=It,Ct=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{href:Be.globals.adminUrl()+"edit.php?post_type="+Object(se.select)("core/editor").getCurrentPostType()+"&page=tickets-attendees&event_id="+Object(se.select)("core/editor").getCurrentPostId(),isDisabled:De.d.getRSVPIsLoading(e)}})))(Pt),xt=n(53),Rt=function(e){var t=e.isDisabled,n=e.onClick;return wp.element.createElement(be.ActionButton,{className:"tribe-editor__rsvp__action-button tribe-editor__rsvp__action-button--settings",disabled:t,icon:wp.element.createElement(Ye.Cog,null),onClick:n},Object(i.__)("Settings","event-tickets"))};Rt.defaultProps={onClick:n.n(xt).a},Rt.propTypes={isDisabled:_.a.bool,onClick:_.a.func};var At=Rt,Ht=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isDisabled:De.d.getRSVPIsLoading(e)}}),(function(e){return{onClick:function(){return e(De.a.setRSVPSettingsOpen(!0))}}})))(At),Nt=(n(503),function(e){return e?Object(i.__)("Update RSVP","event-tickets"):Object(i.__)("Create RSVP","event-tickets")}),Vt=Object(i.__)("Cancel","event-tickets"),Ft=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onWarningClick=function(){n.setState({isWarningOpen:!n.state.isWarningOpen})},n.getActions=function(){var e=n.props,t=e.created,r=(e.hasTicketsPlus,e.hasRecurrenceRules),a=e.isLoading,o=[wp.element.createElement(Ht,null)];if(t&&o.push(wp.element.createElement(Ct,null)),r){var s=n.state.isWarningOpen?"no":"info-outline",c=n.state.isWarningOpen?Object(i.__)("Hide Warning","event-tickets"):Object(i.__)("Warning","event-tickets");o.push(wp.element.createElement(be.WarningButton,{icon:s,onClick:n.onWarningClick,isDisabled:a},c))}return o},n.state={isWarningOpen:!1},n}return fe()(t,e),_e()(t,[{key:"render",value:function(){var e=this.props,t=e.created,n=e.isCancelDisabled,r=e.isConfirmDisabled,a=e.onCancelClick,o=e.onConfirmClick,s=e.showCancel;return wp.element.createElement(c.Fragment,null,wp.element.createElement(be.ActionDashboard,{className:"tribe-editor__rsvp__action-dashboard",actions:this.getActions(),cancelLabel:Vt,confirmLabel:Nt(t),isCancelDisabled:n,isConfirmDisabled:r,onCancelClick:a,onConfirmClick:o,showCancel:s}),this.state.isWarningOpen&&wp.element.createElement("div",{className:"tribe-editor__rsvp__warning"},Object(i.__)("This is a recurring event. If you add tickets they will only show up on the next upcoming event in the recurrence pattern. The same ticket form will appear across all events in the series. Please configure your events accordingly.","event-tickets")))}}]),t}(c.PureComponent);Ft.propTypes={created:_.a.bool.isRequired,hasTicketsPlus:_.a.bool.isRequired,hasRecurrenceRules:_.a.bool.isRequired,isCancelDisabled:_.a.bool.isRequired,isConfirmDisabled:_.a.bool.isRequired,isLoading:_.a.bool.isRequired,onCancelClick:_.a.func.isRequired,onConfirmClick:_.a.func.isRequired,showCancel:_.a.bool.isRequired};var Kt=Ft,Wt=function(e){var t=!1;try{t=window.tribe[vt.plugins.constants.EVENTS_PRO_PLUGIN].data.blocks.recurring.selectors.hasRules(e)}catch(e){}return t},Ut=function(e){return!De.d.getRSVPTempTitle(e)||!De.d.getRSVPHasChanges(e)||De.d.getRSVPIsLoading(e)||De.d.getRSVPHasDurationError(e)},zt=function(e,t){return function(){t(De.a.setRSVPTempDetails({tempTitle:De.d.getRSVPTitle(e),tempDescription:De.d.getRSVPDescription(e),tempCapacity:De.d.getRSVPCapacity(e),tempNotGoingResponses:De.d.getRSVPNotGoingResponses(e),tempStartDate:De.d.getRSVPStartDate(e),tempStartDateInput:De.d.getRSVPStartDateInput(e),tempStartDateMoment:De.d.getRSVPStartDateMoment(e),tempEndDate:De.d.getRSVPEndDate(e),tempEndDateInput:De.d.getRSVPEndDateInput(e),tempEndDateMoment:De.d.getRSVPEndDateMoment(e),tempStartTime:De.d.getRSVPStartTime(e),tempEndTime:De.d.getRSVPEndTime(e),tempStartTimeInput:De.d.getRSVPStartTimeInput(e),tempEndTimeInput:De.d.getRSVPEndTimeInput(e)})),t(De.a.setRSVPHasChanges(!1)),Object(se.dispatch)("core/editor").clearSelectedBlock()}},Gt=function(e,t){return function(){var n={title:De.d.getRSVPTempTitle(e),description:De.d.getRSVPTempDescription(e),capacity:De.d.getRSVPTempCapacity(e),notGoingResponses:De.d.getRSVPTempNotGoingResponses(e),startDate:De.d.getRSVPTempStartDate(e),startDateInput:De.d.getRSVPTempStartDateInput(e),startDateMoment:De.d.getRSVPTempStartDateMoment(e),endDate:De.d.getRSVPTempEndDate(e),endDateInput:De.d.getRSVPTempEndDateInput(e),endDateMoment:De.d.getRSVPTempEndDateMoment(e),startTime:De.d.getRSVPTempStartTime(e),endTime:De.d.getRSVPTempEndTime(e),startTimeInput:De.d.getRSVPTempStartTimeInput(e),endTimeInput:De.d.getRSVPTempEndTimeInput(e)};De.d.getRSVPCreated(e)?t(De.e.updateRSVP(Ke()({},n,{id:De.d.getRSVPId(e)}))):t(De.e.createRSVP(Ke()({},n,{postId:Object(se.select)("core/editor").getCurrentPostId()})))}},Bt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{created:De.d.getRSVPCreated(e),hasRecurrenceRules:Wt(e),hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),isCancelDisabled:De.d.getRSVPIsLoading(e),isConfirmDisabled:Ut(e),isLoading:De.d.getRSVPIsLoading(e),showCancel:De.d.getRSVPCreated(e),state:e}}),null,(function(e,t,n){var r=e.state,a=Ue()(e,["state"]),i=t.dispatch;return Ke()({},n,a,{onCancelClick:zt(r,i),onConfirmClick:Gt(r,i)})})))(Kt),qt=(n(504),function(e){var t=e.image,n=e.isSettingsLoading,r=e.onRemove,a=e.onSelect,o={title:Object(i.__)("Ticket Header Image","event-tickets"),description:Object(i.__)("Select an image from your Media Library to display on emailed tickets and RSVPs. For best results, use a .jpg, .png, or .gif at least 1160px wide.","event-tickets"),className:"tribe-editor__rsvp__image-upload",buttonDisabled:n,buttonLabel:Object(i.__)("Upload Image","event-tickets"),image:t,onRemove:r,onSelect:a,removeButtonDisabled:n};return wp.element.createElement(ge.ImageUpload,o)});qt.propTypes={image:_.a.shape({alt:_.a.string.isRequired,id:_.a.number.isRequired,src:_.a.string.isRequired}).isRequired,isSettingsLoading:_.a.bool.isRequired,onRemove:_.a.func.isRequired,onSelect:_.a.func.isRequired};var Jt=qt,$t=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{image:{id:De.d.getRSVPHeaderImageId(e),alt:De.d.getRSVPHeaderImageAlt(e),src:De.d.getRSVPHeaderImageSrc(e)},isSettingsLoading:De.d.getRSVPIsSettingsLoading(e)}}),(function(e){return{onRemove:function(){return e(De.a.deleteRSVPHeaderImage())},onSelect:function(t){return e(De.a.updateRSVPHeaderImage(t))}}})))(Jt),Zt=(n(505),function(e){var t=e.isSettingsLoading,n=e.onCloseClick;return wp.element.createElement(be.SettingsDashboard,{className:he()("tribe-editor__rsvp__settings-dashboard",{"tribe-editor__rsvp__settings-dashboard--loading":t}),closeButtonDisabled:t,content:wp.element.createElement(c.Fragment,null,wp.element.createElement($t,null),t&&wp.element.createElement(ye.Spinner,null)),onCloseClick:n})});Zt.propTypes={isSettingsLoading:_.a.bool.isRequired,onCloseClick:_.a.func.isRequired};var Qt=Zt,Xt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isSettingsLoading:De.d.getRSVPIsSettingsLoading(e)}}),(function(e){return{onCloseClick:function(){return e(De.a.setRSVPSettingsOpen(!1))}}})))(Qt),en=function(e){var t=e.isSelected,n=e.isSettingsOpen;return t?n?wp.element.createElement(Xt,null):wp.element.createElement(Bt,null):null};en.propTypes={isSelected:_.a.bool.isRequired,isSettingsOpen:_.a.bool.isRequired};var tn=en,nn=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isSettingsOpen:De.d.getRSVPSettingsOpen(e)}})))(tn),rn=n(95),an={className:"tribe-editor__rsvp__inactive-block",icon:wp.element.createElement(o.RSVPInactive,null),layout:rn.a.rsvp},on=function(e){var t=e.created;return an.title=t?Object(i.__)("RSVP is not currently active","event-tickets"):Object(i.__)("There is no RSVP configured","event-tickets"),an.description=t?Object(i.__)("Edit this block to change RSVP settings.","event-tickets"):Object(i.__)("Edit this block to create an RSVP form.","event-tickets"),wp.element.createElement(rn.b,an)};on.propTypes={created:_.a.bool.isRequired};var sn=on,cn=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{created:De.d.getRSVPCreated(e)}})))(sn),un=n(28),dn=n(19),_n=(n(506),function(e){function t(){var e,n,r,a;ue()(this,t);for(var o=arguments.length,s=Array(o),c=0;c<o;c++)s[c]=arguments[c];return n=r=me()(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.renderPostTypes=function(){return r.props.isFetchingPosts?wp.element.createElement(ye.Spinner,null):r.props.postOptions.length?wp.element.createElement(ye.MenuGroup,null,wp.element.createElement(ye.MenuItemsChoice,{choices:r.props.postOptions,value:r.props.postValue,onSelect:r.props.onPostSelect})):wp.element.createElement(ye.Notice,{isDismissible:!1,status:"warning"},Object(i.__)("No posts found","event-tickets"))},a=n,me()(r,a)}return fe()(t,e),_e()(t,[{key:"componentDidMount",value:function(){this.props.initialize()}},{key:"render",value:function(){return wp.element.createElement(ye.Modal,{title:this.props.title,onRequestClose:this.props.hideModal,className:"tribe-editor__tickets__move-modal"},wp.element.createElement("label",{htmlFor:"post_type"},Object(i.__)("You can optionally focus on a specific post type:","event-tickets")),wp.element.createElement(ge.Select,{id:"post_type",options:this.props.postTypeOptions,onChange:this.props.onPostTypeChange,value:this.props.postTypeOptionValue}),wp.element.createElement("label",{htmlFor:"search"},Object(i.__)("You can also enter keywords to help find the target event by title or description","event-tickets")),wp.element.createElement(ge.Input,{id:"search",type:"text",onChange:this.props.onSearchChange,value:this.props.search}),wp.element.createElement("label",null,Object(i.__)("Select the post you wish to move the ticket type to:","event-tickets")),this.renderPostTypes(),wp.element.createElement("footer",null,wp.element.createElement(ye.Button,{isLarge:!0,isPrimary:!0,isBusy:this.props.isModalSubmitting,disabled:!this.props.hasSelectedPost||this.props.isFetchingPosts,onClick:this.props.onSubmit},Object(i.__)("Finish!","event-tickets"))))}}]),t}(c.PureComponent));_n.propTypes={hasSelectedPost:_.a.bool.isRequired,hideModal:_.a.func.isRequired,initialize:_.a.func.isRequired,isFetchingPosts:_.a.bool.isRequired,isModalSubmitting:_.a.bool.isRequired,onPostSelect:_.a.func.isRequired,onPostTypeChange:_.a.func.isRequired,onSearchChange:_.a.func.isRequired,onSubmit:_.a.func.isRequired,postOptions:_.a.arrayOf(_.a.object),postTypeOptions:_.a.arrayOf(_.a.object),postTypeOptionValue:_.a.object,postValue:_.a.string.isRequired,search:_.a.string.isRequired,title:_.a.string.isRequired},_n.defaultProps={title:Object(i.__)("Move Ticket Types","event-tickets")};var ln=_n,mn=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{hasSelectedPost:un.i(e),isFetchingPosts:un.k(e),isFetchingPostTypes:un.j(e),isModalSubmitting:un.m(e),postOptions:un.f(e),postTypeOptions:un.h(e),postTypeOptionValue:un.g(e),postValue:un.d(e),search:un.c(e)}}),(function(e,t){return{initialize:function(){return e({type:dn.h})},hideModal:function(){return e(Object(st.a)())},onSearchChange:function(t){return e(Object(st.b)({search_terms:t.target.value}))},onPostTypeChange:function(t){return e(Object(st.b)({post_type:t.value}))},onPostSelect:function(t){return e(Object(st.b)({target_post_id:t}))},onSubmit:function(){return e({type:dn.o})}}})))(ln),pn=(n(507),function(e){function t(){return ue()(this,t),me()(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return fe()(t,e),_e()(t,[{key:"componentDidMount",value:function(){!this.props.rsvpId&&this.props.initializeRSVP()}},{key:"render",value:function(){var e=this.props,t=e.created,n=e.isInactive,r=e.isLoading,a=e.isSelected,i=e.clientId,o=e.isModalShowing;return wp.element.createElement(c.Fragment,null,!a&&(t&&n||!t)?wp.element.createElement(cn,null):wp.element.createElement("div",{className:he()("tribe-editor__rsvp",{"tribe-editor__rsvp--selected":a},{"tribe-editor__rsvp--loading":r})},wp.element.createElement(jt,{isSelected:a,clientId:i}),wp.element.createElement(nn,{isSelected:a}),r&&wp.element.createElement(ye.Spinner,null)),o&&wp.element.createElement(mn,null))}}]),t}(c.PureComponent));pn.propTypes={clientId:_.a.string.isRequired,created:_.a.bool.isRequired,initializeRSVP:_.a.func.isRequired,isInactive:_.a.bool.isRequired,isLoading:_.a.bool.isRequired,isModalShowing:_.a.bool.isRequired,isSelected:_.a.bool.isRequired,rsvpId:_.a.number.isRequired};var fn=pn,Tn=function(e){var t=De.d.getRSVPStartDateMoment(e),n=De.d.getRSVPStartTimeNoSeconds(e),r=De.d.getRSVPEndDateMoment(e),a=De.d.getRSVPEndTimeNoSeconds(e);if(!t||!r)return!1;var i=Be.moment.setTimeInSeconds(t.clone(),Be.time.toSeconds(n,Be.time.TIME_FORMAT_HH_MM)),o=Be.moment.setTimeInSeconds(r.clone(),Be.time.toSeconds(a,Be.time.TIME_FORMAT_HH_MM)),s=oe()();return!(s.isAfter(i)&&s.isBefore(o))},hn=function(e,t){return function(){var n=Object(se.select)("core/editor").getCurrentPostId();e(De.e.getRSVP(n));var r=t.attributes,a=void 0===r?{}:r;parseInt(a.headerImageId,10)&&e(De.a.fetchRSVPHeaderImage(a.headerImageId)),a.goingCount&&e(De.a.setRSVPGoingCount(parseInt(a.goingCount,10))),a.notGoingCount&&e(De.a.setRSVPNotGoingCount(parseInt(a.notGoingCount,10)))}},yn=Object(P.c)(Object(Le.withStore)(),ae((function(e){var t=De.d.getRSVPId(e);return{created:De.d.getRSVPCreated(e),isInactive:Tn(e),isLoading:De.d.getRSVPIsLoading(e),isModalShowing:Object(un.l)(e)&&Object(un.e)(e)===t,rsvpId:t}}),(function(e,t){return{initializeRSVP:function(){return e(De.a.initializeRSVP())},onBlockRemoved:function(){return e(De.a.deleteRSVP())},setInitialState:hn(e,t)}})),Object(Le.withSaveData)())(fn),bn=n(8),Mn={id:"rsvp",title:Object(i.__)("RSVP","event-tickets"),description:Object(i.__)("Find out who is planning to attend!","event-tickets"),icon:wp.element.createElement(o.RSVP,null),category:"tribe-tickets",keywords:["event","events-gutenberg","tribe"],supports:{html:!1,multiple:!1},attributes:{goingCount:{type:"integer",source:"meta",meta:bn.g},notGoingCount:{type:"integer",source:"meta",meta:bn.j},headerImageId:{type:"integer",source:"meta",meta:bn.i}},edit:yn,save:function(){return null}},Sn=n(96),En=function(e){var t=e.onClick;return wp.element.createElement(be.ActionButton,{icon:wp.element.createElement(Ye.Cog,null),onClick:t},Object(i.__)("Settings","event-tickets"))};En.propTypes={onClick:_.a.func};var gn=En,vn=n(6),kn=Object(P.c)(Object(Le.withStore)(),ae(null,(function(e){return{onClick:function(){return e(vn.a.openSettings())}}})))(gn),Dn=function(e){var t=e.href;return t?wp.element.createElement(be.ActionButton,{asLink:!0,href:t,icon:wp.element.createElement(o.Orders,null),target:"_blank"},Object(i.__)("Orders","event-tickets")):null};Dn.propTypes={href:_.a.string.isRequired};var Ln=Dn,On=Object(P.c)(Object(Le.withStore)(),ae((function(e){var t=Be.globals.adminUrl(),n=Object(se.select)("core/editor").getCurrentPostType(),r=Object(se.select)("core/editor").getCurrentPostId(),a=vn.f.getTicketsProvider(e),i=vn.b.TICKET_ORDERS_PAGE_SLUG[a];return{href:i?t+"edit.php?post_type="+n+"&page="+i+"&event_id="+r:""}})))(Ln),Yn=function(e){var t=e.href;return e.canCreateTickets&&wp.element.createElement(be.ActionButton,{asLink:!0,href:t,icon:wp.element.createElement(o.Attendees,null),target:"_blank"},Object(i.__)("Attendees","event-tickets"))};Yn.propTypes={href:_.a.string.isRequired,canCreateTickets:_.a.bool};var wn=Yn,jn=Object(P.c)(Object(Le.withStore)(),ae((function(){return{href:Be.globals.adminUrl()+"edit.php?post_type="+Object(se.select)("core/editor").getCurrentPostType()+"&page=tickets-attendees&event_id="+Object(se.select)("core/editor").getCurrentPostId(),canCreateTickets:vn.f.canCreateTickets()}})))(wn),In=(n(508),Object(i.__)("Add Tickets","event-tickets")),Pn=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onWarningClick=function(){n.setState({isWarningOpen:!n.state.isWarningOpen})},n.getActions=function(){var e=n.props,t=e.hasCreatedTickets,r=e.hasOrdersPage,a=e.hasRecurrenceRules,o=(e.hasTicketsPlus,[wp.element.createElement(kn,null)]);if(t&&(o.push(wp.element.createElement(jn,null)),r&&o.push(wp.element.createElement(On,null))),a){var s=n.state.isWarningOpen?"no":"info-outline",c=n.state.isWarningOpen?Object(i.__)("Hide Warning","event-tickets"):Object(i.__)("Warning","event-tickets");o.push(wp.element.createElement(be.WarningButton,{icon:s,onClick:n.onWarningClick},c))}return o},n.state={isWarningOpen:!1},n}return fe()(t,e),_e()(t,[{key:"render",value:function(){var e=this.props.onConfirmClick;return wp.element.createElement(c.Fragment,null,wp.element.createElement(be.ActionDashboard,{className:"tribe-editor__tickets__action-dashboard",actions:this.getActions(),confirmLabel:In,onConfirmClick:e,showCancel:!1}),this.state.isWarningOpen&&wp.element.createElement("div",{className:"tribe-editor__tickets__warning"},Object(i.__)("This is a recurring event. If you add tickets they will only show up on the next upcoming event in the recurrence pattern. The same ticket form will appear across all events in the series. Please configure your events accordingly.","event-tickets")))}}]),t}(c.PureComponent);Pn.propTypes={hasCreatedTickets:_.a.bool,hasOrdersPage:_.a.bool,hasRecurrenceRules:_.a.bool,hasTicketsPlus:_.a.bool,onConfirmClick:_.a.func};var Cn=Pn,xn=function(e){var t=!1;try{t=window.tribe[vt.plugins.constants.EVENTS_PRO_PLUGIN].data.blocks.recurring.selectors.hasRules(e)}catch(e){}return t},Rn=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){var n=vn.f.getTicketsProvider(e),a=vn.b.TICKET_ORDERS_PAGE_SLUG[n];return{hasCreatedTickets:vn.f.hasCreatedTickets(e),hasOrdersPage:Boolean(a),hasRecurrenceRules:xn(e),hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),onConfirmClick:function(){var e=t.clientId,n=Object(se.select)("core/editor").getBlockCount,a=Object(se.dispatch)("core/editor").insertBlock,i=n(e);a(Object(r.createBlock)("tribe/tickets-item",{}),i,e)}}})))(Cn),An=(n(509),function(e){var t=e.label,n=e.items,r=e.right;return wp.element.createElement("div",{className:"tribe-editor__tickets__capacity-row"},wp.element.createElement("span",{className:"tribe-editor__tickets__capacity-row-left"},t&&wp.element.createElement("span",{className:"tribe-editor__tickets__capacity-row-label"},t),n&&wp.element.createElement("span",{className:"tribe-editor__tickets__capacity-row-items"},n)),wp.element.createElement("span",{className:"tribe-editor__tickets__capacity-row-right"},r))});An.propTypes={label:_.a.string,items:_.a.string,right:_.a.node},An.defaultProps={label:"",items:"",right:""};var Hn=An,Nn=(n(510),function(e){var t=e.isSettingsLoading,n=e.independentCapacity,r=e.sharedCapacity,a=e.independentAndSharedCapacity,o=e.independentTicketItems,s=e.sharedTicketItems,c=e.onSharedCapacityChange,u=wp.element.createElement(ge.NumberInput,{onChange:c,value:r,disabled:t,min:0});return wp.element.createElement("div",{className:"tribe-editor__tickets__capacity-table"},wp.element.createElement("h3",{className:"tribe-editor__tickets__capacity-table-title"},Object(i.__)("Capacity","event-tickets")),wp.element.createElement(Hn,{label:Object(i.__)("Shared capacity","event-tickets"),items:s,right:u}),wp.element.createElement(Hn,{label:Object(i.__)("Independent capacity","event-tickets"),items:o,right:n}),wp.element.createElement(Hn,{label:Object(i.__)("Total Capacity","event-tickets"),right:a}))});Nn.propTypes={isSettingsLoading:_.a.bool,independentCapacity:_.a.number,sharedCapacity:_.a.string,independentAndSharedCapacity:_.a.number,independentTicketItems:_.a.string,sharedTicketItems:_.a.string,onSharedCapacityChange:_.a.func};var Vn=Nn,Fn=function(e){var t=e.filter((function(e){return e.details.title})).map((function(e){return e.details.title})).join(", ");return t?" ("+t+") ":""},Kn=function(e){var t=vn.f.getIndependentTickets(e);return Fn(t)},Wn=function(e){var t=vn.f.getSharedTickets(e);return Fn(t)},Un=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isSettingsLoading:vn.f.getTicketsIsSettingsLoading(e),independentCapacity:vn.f.getIndependentTicketsCapacity(e),sharedCapacity:vn.f.getTicketsSharedCapacity(e),independentAndSharedCapacity:vn.f.getIndependentAndSharedTicketsCapacity(e),independentTicketItems:Kn(e),sharedTicketItems:Wn(e)}}),(function(e){return{onSharedCapacityChange:function(t){e(vn.a.setTicketsSharedCapacity(t.target.value)),e(vn.a.setTicketsTempSharedCapacity(t.target.value))}}})))(Vn),zn=(n(511),function(e){var t=e.image,n=e.isSettingsLoading,r=e.onRemove,a=e.onSelect,o={title:Object(i.__)("Ticket Header Image","event-tickets"),description:Object(i.__)("Select an image from your Media Library to display on emailed tickets and RSVPs. For best results, use a .jpg, .png, or .gif at least 1160px wide.","event-tickets"),className:"tribe-editor__rsvp__image-upload",buttonDisabled:n,buttonLabel:Object(i.__)("Upload Image","event-tickets"),image:t,onRemove:r,onSelect:a,removeButtonDisabled:n};return wp.element.createElement(ge.ImageUpload,o)});zn.propTypes={image:_.a.shape({alt:_.a.string.isRequired,id:_.a.number.isRequired,src:_.a.string.isRequired}).isRequired,isSettingsLoading:_.a.bool.isRequired,onRemove:_.a.func.isRequired,onSelect:_.a.func.isRequired};var Gn=zn,Bn=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{image:{id:vn.f.getTicketsHeaderImageId(e),alt:vn.f.getTicketsHeaderImageAlt(e),src:vn.f.getTicketsHeaderImageSrc(e)},isSettingsLoading:vn.f.getTicketsIsSettingsLoading(e)}}),(function(e){return{onSelect:function(t){return e(vn.a.updateTicketsHeaderImage(t))},onRemove:function(){return e(vn.a.deleteTicketsHeaderImage())}}})))(Gn),qn=(n(512),function(e){var t=e.hasTicketsPlus,n=e.isSettingsLoading,r=e.onCloseClick;return wp.element.createElement(be.SettingsDashboard,{className:he()("tribe-editor__tickets__settings-dashboard",{"tribe-editor__tickets__settings-dashboard--loading":n}),closeButtonDisabled:n,content:wp.element.createElement(c.Fragment,null,t&&wp.element.createElement(Un,null),wp.element.createElement(Bn,null),n&&wp.element.createElement(ye.Spinner,null)),onCloseClick:r})});qn.propTypes={hasTicketsPlus:_.a.bool,isSettingsLoading:_.a.bool.isRequired,onCloseClick:_.a.func.isRequired};var Jn=qn,$n=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),isSettingsLoading:vn.f.getTicketsIsSettingsLoading(e)}}),(function(e){return{onCloseClick:function(){return e(vn.a.closeSettings())}}})))(Jn),Zn=function(e){var t=e.clientId,n=e.isSelected,r=e.isSettingsOpen;return n?r?wp.element.createElement($n,null):wp.element.createElement(Rn,{clientId:t}):null};Zn.propTypes={clientId:_.a.string,isSelected:_.a.bool,isSettingsOpen:_.a.bool};var Qn=Zn,Xn=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isSettingsOpen:vn.f.getTicketsIsSettingsOpen(e)}})))(Qn),er=(n(513),function(e){var t=e.available,n=e.total,r=wp.element.createElement(be.NumericLabel,{className:he()("tribe-editor__tickets__availability-label","tribe-editor__tickets__availability-label--available","tribe-tooltip"),count:t,singular:Object(i.__)("%d ticket available","event-tickets"),plural:Object(i.__)("%d tickets available","event-tickets")}),a=wp.element.createElement(be.NumericLabel,{className:he()("tribe-editor__tickets__availability-label","tribe-editor__tickets__availability-label--total"),count:n,singular:Object(i.__)("%d total ticket","event-tickets"),plural:Object(i.__)("%d total tickets","event-tickets")});return wp.element.createElement("div",{className:"tribe-editor__tickets__availability"},wp.element.createElement("span",{class:"tribe-tooltip",title:Object(i.__)("Ticket availability is based on the lowest number of inventory, stock, and capacity.","event-tickets")},r,wp.element.createElement("span",{className:"dashicons dashicons-info"})),a)});er.propTypes={available:_.a.number,total:_.a.number};var tr=er,nr=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{total:vn.f.getIndependentAndSharedTicketsCapacity(e),available:vn.f.getIndependentAndSharedTicketsAvailable(e)}})))(tr),rr=(n(514),function(){return wp.element.createElement("div",{className:"tribe-editor__tickets__overlay"})}),ar=function(e){var t=e.allTicketsPast,n=e.canCreateTickets,r=e.hasCreatedTickets,a=e.hasOverlay,s=e.showAvailability,c=e.showInactiveBlock,u={title:"",description:""};n?r?u.title=t?Object(i.__)("Tickets are no longer available","event-tickets"):Object(i.__)("Tickets are not yet available","event-tickets"):(u.title=Object(i.__)("There are no tickets yet","event-tickets"),u.description=Object(i.__)("Edit this block to create your first ticket.","event-tickets")):(u.title=Object(i.__)("There is no ecommerce available","event-tickets"),u.description=Object(i.__)("To create tickets, you'll need to enable an ecommerce solution.","event-tickets"));var d=he()({"tribe-editor__tickets__inner-blocks":!0,"tribe-editor__tickets__inner-blocks--show":!c});return wp.element.createElement("div",{className:"tribe-editor__tickets__container"},wp.element.createElement("div",{className:d},wp.element.createElement(Sn.InnerBlocks,{allowedBlocks:["tribe/tickets-item"]})),c&&wp.element.createElement(be.InactiveBlock,{layout:rn.a.ticket,title:u.title,description:u.description,icon:wp.element.createElement(o.TicketInactive,null)}),s&&wp.element.createElement(nr,null),a&&wp.element.createElement(rr,null))};ar.propTypes={allTicketsPast:_.a.bool,canCreateTickets:_.a.bool,hasCreatedTickets:_.a.bool,hasOverlay:_.a.bool,showAvailability:_.a.bool,showInactiveBlock:_.a.bool};var ir=ar,or=function(e,t){return vn.f.getTicketsIsSettingsOpen(e)||!vn.f.hasATicketSelected(e)&&!t.isSelected},sr=function(e,t){var n=t.isSelected&&!vn.f.hasTickets(e),r=!(t.isSelected||vn.f.hasATicketSelected(e)||vn.f.hasCreatedTickets(e)&&vn.f.hasTicketOnSale(e));return n||r},cr=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{allTicketsPast:vn.f.allTicketsPast(e),canCreateTickets:vn.f.canCreateTickets(),hasCreatedTickets:vn.f.hasCreatedTickets(e),hasOverlay:or(e,t),showAvailability:t.isSelected&&vn.f.hasCreatedTickets(e),showInactiveBlock:sr(e,t)}})))(ir),ur=(n(515),Object(i.__)("It looks like you have multiple ecommerce plugins active. We recommend running only one at a time. However, if you need to run multiple, please select which one to use to sell tickets for this event. ","event-tickets")),dr=Object(i.__)("Note: adjusting this setting will only impact new tickets. Existing tickets will not change. We highly recommend that all tickets for one event use the same ecommerce plugin","event-tickets"),_r=function(e){var t=e.provider,n=e.onProviderChange,r=Ue()(e,["provider","onProviderChange"]);return wp.element.createElement("div",{className:"tribe-editor__tickets-control-container"},wp.element.createElement("input",Ke()({className:"tribe-editor__tickets-control__input tribe-editor__tickets-control__input--radio",type:"radio",id:t.class,name:t.class,onChange:n},r)),wp.element.createElement("label",{className:"tribe-editor__tickets-control__label",htmlFor:t.class},t.name))},lr=function(e){var t=e.hasMultipleProviders,n=e.providers,r=e.selectedProvider,a=e.onProviderChange;return t&&wp.element.createElement(Sn.InspectorControls,{key:"inspector"},wp.element.createElement(ye.PanelBody,{title:Object(i.__)("Tickets Settings","event-tickets")},wp.element.createElement(ye.PanelRow,null,wp.element.createElement("fieldset",{className:"tribe-editor__tickets-controls-provider"},wp.element.createElement("legend",null,Object(i.__)("Sell tickets using","event-tickets")),wp.element.createElement("p",null,ur,wp.element.createElement("em",null,dr)),n.map((function(e,t){return wp.element.createElement(_r,{key:"provider-option-"+(t+1),provider:e,onProviderChange:a,checked:r===e.class})}))))))};lr.propTypes={hasMultipleProviders:_.a.bool,providers:_.a.arrayOf(_.a.shape({name:_.a.string,class:_.a.string})),selectedProvider:_.a.string,onProviderChange:_.a.func};var mr=lr,pr=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{hasMultipleProviders:vn.f.hasMultipleTicketProviders(),providers:vn.f.getTicketProviders(),selectedProvider:vn.f.getTicketsProvider(e)}}),(function(e){return{onProviderChange:function(t){return e(vn.a.setTicketsProvider(t.target.name))}}})),Object(Le.withSaveData)())(mr),fr=(n(516),function(e){function t(){return ue()(this,t),me()(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return fe()(t,e),_e()(t,[{key:"componentDidMount",value:function(){this.props.onBlockUpdate(this.props.isSelected)}},{key:"componentDidUpdate",value:function(e){e.isSelected!==this.props.isSelected&&this.props.onBlockUpdate(this.props.isSelected)}},{key:"render",value:function(){var e=this.props,t=e.isSelected,n=e.canCreateTickets,r=e.isSettingsOpen,a=e.clientId;return wp.element.createElement("div",{className:he()("tribe-editor__tickets",{"tribe-editor__tickets--selected":t},{"tribe-editor__tickets--settings-open":r})},wp.element.createElement(cr,{isSelected:t}),n&&wp.element.createElement(Xn,{isSelected:t,clientId:a}),wp.element.createElement(pr,null))}}]),t}(c.PureComponent));fr.propTypes={canCreateTickets:_.a.bool,clientId:_.a.string,hasProviders:_.a.bool,header:_.a.string,isSelected:_.a.bool,isSettingsOpen:_.a.bool,onBlockUpdate:_.a.func};var Tr=fr,hr=Object(P.c)(Object(Le.withStore)(),ae((function(e){var t=vn.f.getTicketsHeaderImageId(e);return{header:t?""+t:"",hasProviders:vn.f.hasTicketProviders(),isSettingsOpen:vn.f.getTicketsIsSettingsOpen(e),provider:vn.f.getTicketsProvider(e),sharedCapacity:vn.f.getTicketsSharedCapacity(e),canCreateTickets:vn.f.canCreateTickets()}}),(function(e){return{setInitialState:function(t){e(vn.a.setTicketsInitialState(t))},onBlockUpdate:function(t){e(vn.a.setTicketsIsSelected(t))},onBlockRemoved:function(){e(vn.a.resetTicketsBlock())}}})),Object(Le.withSaveData)())(Tr),yr={id:"tickets",title:Object(i.__)("Tickets","event-tickets"),description:Object(i.__)("Sell tickets and register attendees.","event-tickets"),icon:wp.element.createElement(o.Tickets,null),category:"tribe-tickets",keywords:["event","events-gutenberg","tribe"],supports:{html:!1,multiple:!1},attributes:{sharedCapacity:{type:"string",source:"meta",meta:bn.d},header:{type:"string",source:"meta",meta:bn.i},provider:{type:"string",source:"meta",meta:bn.e},tickets:{type:"array",source:"meta",meta:bn.c}},edit:hr,save:function(){return wp.element.createElement("div",null,wp.element.createElement(Sn.InnerBlocks.Content,null))}},br=(n(517),n(518),function(e){var t=e.hasAttendeeInfoFields,n=e.isDisabled,r=e.isSelected,a=e.onTempTitleChange,o=e.tempTitle,s=e.title,u=t&&wp.element.createElement(ge.Tooltip,{labelClassName:"tribe-editor__ticket__container-header-clipboard-tooltip",label:wp.element.createElement(Ye.Clipboard,null),text:Object(i.__)("This ticket has Attendee Information Fields configured.","event-tickets")});return wp.element.createElement("div",{className:"tribe-editor__ticket__container-header-title"},r?wp.element.createElement(c.Fragment,null,wp.element.createElement(Ee.a,{className:"tribe-editor__ticket__container-header-title-input",value:o,placeholder:Object(i.__)("Ticket Type *","event-tickets"),onChange:a,disabled:n,required:!0}),u):wp.element.createElement(c.Fragment,null,wp.element.createElement("h3",{className:"tribe-editor__ticket__container-header-title-label"},s),u,wp.element.createElement(Ye.Pencil,null)))});br.propTypes={hasAttendeeInfoFields:_.a.bool,isDisabled:_.a.bool,isSelected:_.a.bool,onTempTitleChange:_.a.func,tempTitle:_.a.string,title:_.a.string};var Mr=br,Sr=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{hasAttendeeInfoFields:vn.f.getTicketHasAttendeeInfoFields(e,t),isDisabled:vn.f.isTicketDisabled(e,t),tempTitle:vn.f.getTicketTempTitle(e,t),title:vn.f.getTicketTitle(e,t)}}),(function(e,t){return{onTempTitleChange:function(n){var r=t.clientId;e(vn.a.setTicketTempTitle(r,n.target.value)),e(vn.a.setTicketHasChanges(r,!0))}}})))(Mr),Er=(n(519),function(e){var t=e.isDisabled,n=e.isSelected,r=e.onTempDescriptionChange,a=e.tempDescription,o=e.description;return n?wp.element.createElement(Ee.a,{className:"tribe-editor__ticket__container-header-description-input",value:a,placeholder:Object(i.__)("Description","event-tickets"),onChange:r,disabled:t}):wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-description"},o)});Er.propTypes={isDisabled:_.a.bool,isSelected:_.a.bool,onTempDescriptionChange:_.a.func,tempDescription:_.a.string,description:_.a.string};var gr=Er,vr=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),tempDescription:vn.f.getTicketTempDescription(e,t),description:vn.f.getTicketDescription(e,t)}}),(function(e,t){return{onTempDescriptionChange:function(n){var r=t.clientId;e(vn.a.setTicketTempDescription(r,n.target.value)),e(vn.a.setTicketHasChanges(r,!0))}}})))(gr),kr=n(23),Dr=(n(520),function(e){var t=e.isDisabled,n=e.currencyPosition,r=e.currencySymbol,a=e.onTempPriceChange,o=e.tempPrice;return wp.element.createElement(c.Fragment,null,n===kr.PREFIX&&wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-price-currency"},r),wp.element.createElement(Ee.a,{className:"tribe-editor__ticket__container-header-price-input",value:o,placeholder:Object(i.__)("0","event-tickets"),onChange:a,disabled:t,type:"number",min:"0"}),n===kr.SUFFIX&&wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-price-currency"},r))});Dr.propTypes={isDisabled:_.a.bool,currencyPosition:_.a.oneOf(kr.PRICE_POSITIONS),currencySymbol:_.a.string,onTempPriceChange:_.a.func,tempPrice:_.a.string};var Lr=function(e){var t=e.currencyPosition,n=e.currencySymbol,r=e.price;return wp.element.createElement(c.Fragment,null,t===kr.PREFIX&&wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-price-currency"},n),wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-price-value"},r),t===kr.SUFFIX&&wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-price-currency"},n))};Lr.propTypes={currencyPosition:_.a.oneOf(kr.PRICE_POSITIONS),currencySymbol:_.a.string,price:_.a.string};var Or=function(e){var t=e.isDisabled,n=e.isSelected,r=e.currencyPosition,a=e.currencySymbol,i=e.onTempPriceChange,o=e.tempPrice,s=e.price;return wp.element.createElement("div",{className:"tribe-editor__ticket__container-header-price"},n?wp.element.createElement(Dr,{currencyPosition:r,currencySymbol:a,onTempPriceChange:i,tempPrice:o,isDisabled:t}):wp.element.createElement(Lr,{currencyPosition:r,currencySymbol:a,price:s}))};Or.propTypes={isDisabled:_.a.bool,isSelected:_.a.bool,currencyPosition:_.a.oneOf(kr.PRICE_POSITIONS),currencySymbol:_.a.string,onTempPriceChange:_.a.func,tempPrice:_.a.string,price:_.a.string};var Yr=Or,wr=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),currencyPosition:vn.f.getTicketCurrencyPosition(e,t),currencySymbol:vn.f.getTicketCurrencySymbol(e,t),tempPrice:vn.f.getTicketTempPrice(e,t),price:vn.f.getTicketPrice(e,t)||"0"}}),(function(e,t){return{onTempPriceChange:function(n){var r=t.clientId;e(vn.a.setTicketTempPrice(r,n.target.value)),e(vn.a.setTicketHasChanges(r,!0))}}})))(Yr),jr=(n(521),function(e){var t=e.children,n=e.className,r=e.value,a=e.total;if(0===r||0===a)return null;var i=void 0;try{i=Be.number.percentage(r,a)}catch(e){i=0}var o={width:Math.max(0,Math.min(100,i)).toFixed(2)+"%"};return wp.element.createElement("span",{className:he()("tribe-editor__quantity-bar__bar",n),style:o},t)});jr.propTypes={children:_.a.node,className:_.a.oneOfType([_.a.string,_.a.arrayOf(_.a.string),Be.TribePropTypes.nullType]),value:_.a.number,total:_.a.number},jr.defaultProps={className:null,value:0,total:0};var Ir=jr,Pr=function(e){var t=e.sharedSold,n=e.sold,r=e.capacity,a=e.total,o=e.isDisabled;return wp.element.createElement("div",{className:"tribe-editor__quantity-bar"},!o&&wp.element.createElement(c.Fragment,null,wp.element.createElement(Ir,{className:"tribe-editor__quantity-bar__bar--shared-sold",value:t,total:a}),wp.element.createElement(Ir,{className:"tribe-editor__quantity-bar__bar--sold",value:n,total:a}),!!r&&!(r===a)&&wp.element.createElement(Ir,{className:"tribe-editor__quantity-bar__bar--capacity",value:r,total:a},wp.element.createElement("span",{className:"tribe-editor__quantity-bar__bar-label"},Object(i.__)("cap","event-tickets")))))};Pr.propTypes={sharedSold:_.a.number,capacity:_.a.number,sold:_.a.number,total:_.a.number,isDisabled:_.a.bool},Pr.defaultProps={sharedSold:0,capacity:0,sold:0,total:0,isDisabled:!1};var Cr=Pr,xr=(n(522),function(e){var t=e.isDisabled,n=e.isSelected,r=e.isShared,a=e.isUnlimited,o=e.sold,s=e.capacity,c=e.sharedSold,u=e.sharedCapacity,d=r?u:s;return!n&&wp.element.createElement("div",{className:"tribe-editor__ticket__container-header-quantity tribe-tooltip",title:Object(i.__)("This pertains to Orders that have been marked Completed.","event-tickets")},wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-quantity-label"},a?Object(i.sprintf)(Object(i.__)("%d sold","event-tickets"),o):Object(i.sprintf)(Object(i.__)("%d of %d sold","event-tickets"),o,d),wp.element.createElement("span",{class:"dashicons dashicons-info"})),a?wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-quantity-unlimited"},Object(i.__)("unlimited","event-tickets")):wp.element.createElement(Cr,{sold:o,sharedSold:c,capacity:s,total:d,isDisabled:t}))});xr.propTypes={isDisabled:_.a.bool,isSelected:_.a.bool,isShared:_.a.bool,isUnlimited:_.a.bool,sold:_.a.number,capacity:_.a.number,sharedSold:_.a.number,sharedCapacity:_.a.number},xr.defaultProps={sold:0,sharedCapacity:0,capacity:0};var Rr=xr,Ar=function(e,t){return t?vn.f.getSharedTicketsSold(e):0},Hr=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){var n=vn.f.isSharedTicket(e,t);return{isDisabled:vn.f.isTicketDisabled(e,t),isShared:n,isUnlimited:vn.f.isUnlimitedTicket(e,t),sold:vn.f.getTicketSold(e,t),capacity:vn.f.getTicketCapacityInt(e,t),sharedSold:Ar(e,n),sharedCapacity:vn.f.getTicketsSharedCapacityInt(e)}})))(Rr),Nr=(n(523),function(e){var t=e.clientId,n=e.isSelected;return wp.element.createElement(c.Fragment,null,wp.element.createElement("div",{className:"tribe-editor__ticket__container-header-details"},wp.element.createElement(Sr,{clientId:t,isSelected:n}),wp.element.createElement(vr,{clientId:t,isSelected:n})),wp.element.createElement(wr,{clientId:t,isSelected:n}),wp.element.createElement(Hr,{clientId:t,isSelected:n}))});Nr.propTypes={clientId:_.a.string,isSelected:_.a.bool};var Vr=Nr,Fr=n(87),Kr=n.n(Fr),Wr=n(112),Ur=n.n(Wr),zr=n(490),Gr=(n(524),vn.b.INDEPENDENT),Br=vn.b.SHARED,qr=vn.b.TICKET_TYPES,Jr=vn.d.CAPACITY_TYPE_OPTIONS,$r=function(e){var t=e.className,n=e.id,r=e.label,a=Ue()(e,["className","id","label"]);return wp.element.createElement(ge.LabeledItem,{className:he()("tribe-editor__labeled-number-input",t),forId:n,label:r,isLabel:!0},wp.element.createElement(ge.NumberInput,a))};$r.propTypes={className:_.a.string,id:_.a.string,label:_.a.string};var Zr=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getInputs=function(){var e=n.props,t=e.isDisabled,r=e.sharedCapacity,a=e.tempCapacityType,o=e.tempCapacity,s=e.tempSharedCapacity,c=e.onTempCapacityChange,u=e.onTempSharedCapacityChange,d=[];if(a===qr[Br]&&""===r&&d.push(wp.element.createElement($r,{key:"shared-capacity",className:he()("tribe-editor__ticket__capacity-input-row","tribe-editor__ticket__capacity-input-row--shared-capacity"),id:n.ids.sharedCapacity,label:Object(i.__)("Set shared capacity:","event-tickets"),value:s,onChange:u,disabled:t,min:0,required:!0})),Ur()([qr[Br],qr[Gr]],a)){var _={},l=a===qr[Br]?Br:Gr;if(a===qr[Br]&&(r||s)){var m=r||s;_.max=parseInt(m,10)||0}a===qr[Gr]&&(_.required=!0),_.label=a===qr[Br]?Object(i.__)("(optional) Limit sales of this ticket to:","event-tickets"):Object(i.__)("Number of tickets available","event-tickets"),d.push(wp.element.createElement($r,Ke()({key:"capacity",className:he()("tribe-editor__ticket__capacity-input-row","tribe-editor__ticket__capacity-input-row--capacity","tribe-editor__ticket__capacity-input-row--capacity-"+l),id:n.ids.capacity,value:o,onChange:c,disabled:t,min:0},_)))}return d},n.getCapacityForm=function(){var e=n.props,t=e.isDisabled,r=e.tempCapacityTypeOption,a=e.onTempCapacityTypeChange;return wp.element.createElement(c.Fragment,null,wp.element.createElement(ge.Select,{id:n.ids.select,className:"tribe-editor__ticket__capacity-type-select",backspaceRemovesValue:!1,value:r,isSearchable:!1,isDisabled:t,options:Jr,onChange:a}),n.getInputs())},n.getNoPlusCapacityForm=function(){var e=n.props,t=e.isDisabled,r=e.tempCapacity,a=e.onTempCapacityNoPlusChange;return wp.element.createElement(c.Fragment,null,wp.element.createElement(ge.NumberInput,{className:"tribe-editor__ticket__capacity-input",id:n.ids.capacity,value:r,onChange:a,disabled:t,min:0}),wp.element.createElement("span",{className:"tribe-editor__ticket__capacity-input-helper-text"},Object(i.__)("Leave blank for unlimited","event-tickets")))},n.ids={select:Re()("capacity-type-"),capacity:Re()("capacity-"),sharedCapacity:Re()("shared-capacity-")},n}return fe()(t,e),_e()(t,[{key:"render",value:function(){var e=this.props.hasTicketsPlus;return wp.element.createElement("div",{className:he()("tribe-editor__ticket__capacity","tribe-editor__ticket__content-row","tribe-editor__ticket__content-row--capacity")},wp.element.createElement(be.LabelWithTooltip,{className:"tribe-editor__ticket__capacity-label-with-tooltip",forId:e?this.ids.select:this.ids.capacity,isLabel:!0,label:Object(i.__)("Ticket Capacity","event-tickets"),tooltipText:Object(i.__)("Ticket capacity will only be used by attendees buying this ticket type","event-tickets"),tooltipLabel:wp.element.createElement(ye.Dashicon,{className:"tribe-editor__ticket__tooltip-label",icon:"info-outline"})}),wp.element.createElement("div",{className:"tribe-editor__ticket__capacity-form"},e?this.getCapacityForm():this.getNoPlusCapacityForm()))}}]),t}(c.PureComponent);Zr.propTypes={hasTicketsPlus:_.a.bool,isDisabled:_.a.bool,sharedCapacity:_.a.string,tempCapacity:_.a.string,tempCapacityType:_.a.string,tempCapacityTypeOption:zr.ReactSelectOption,tempSharedCapacity:_.a.string,onTempCapacityChange:_.a.func,onTempCapacityNoPlusChange:_.a.func,onTempCapacityTypeChange:_.a.func,onTempSharedCapacityChange:_.a.func};var Qr=Zr,Xr=vn.b.UNLIMITED,ea=vn.b.INDEPENDENT,ta=vn.b.TICKET_TYPES,na=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),isDisabled:vn.f.isTicketDisabled(e,t),sharedCapacity:vn.f.getTicketsSharedCapacity(e),tempCapacity:vn.f.getTicketTempCapacity(e,t),tempCapacityType:vn.f.getTicketTempCapacityType(e,t),tempCapacityTypeOption:vn.f.getTicketTempCapacityTypeOption(e,t),tempSharedCapacity:vn.f.getTicketsTempSharedCapacity(e)}}),(function(e,t){var n=t.clientId;return{onTempCapacityChange:function(t){e(vn.a.setTicketTempCapacity(n,t.target.value)),e(vn.a.setTicketHasChanges(n,!0))},onTempCapacityNoPlusChange:function(t){var r=t.target.value,a=""===Kr()(r)?ta[Xr]:ta[ea];e(vn.a.setTicketTempCapacityType(n,a)),e(vn.a.setTicketTempCapacity(n,r)),e(vn.a.setTicketHasChanges(n,!0))},onTempCapacityTypeChange:function(t){e(vn.a.setTicketTempCapacityType(n,t.value)),e(vn.a.setTicketHasChanges(n,!0))},onTempSharedCapacityChange:function(t){e(vn.a.setTicketsTempSharedCapacity(t.target.value)),e(vn.a.setTicketHasChanges(n,!0))}}})))(Qr),ra=(n(525),n(526),function(e){var t=e.hasDurationError,n=Ue()(e,["hasDurationError"]);return wp.element.createElement("div",{className:he()("tribe-editor__ticket__duration","tribe-editor__ticket__content-row","tribe-editor__ticket__content-row--duration")},wp.element.createElement(be.LabelWithTooltip,{className:"tribe-editor__ticket__duration-label-with-tooltip",label:Object(i.__)("Sale Duration","event-tickets"),tooltipText:Object(i.__)("If you do not set a start sale date, tickets will be available immediately.","event-tickets"),tooltipLabel:wp.element.createElement(ye.Dashicon,{className:"tribe-editor__ticket__tooltip-label",icon:"info-outline"})}),wp.element.createElement(be.DateTimeRangePicker,Ke()({className:"tribe-editor__ticket__duration-picker"},n)),t&&wp.element.createElement("span",{className:"tribe-editor__ticket__duration-error"},Object(i.__)("There is an error with the selected sales duration. Please fix the issue before saving.","event-tickets")))});ra.propTypes={fromDate:_.a.instanceOf(Date),fromDateInput:_.a.string,fromDateDisabled:_.a.bool,fromTime:_.a.string,fromTimeDisabled:_.a.bool,hasDurationError:_.a.bool,onFromDateChange:_.a.func,onFromTimePickerBlur:_.a.func,onFromTimePickerChange:_.a.func,onFromTimePickerClick:_.a.func,onToDateChange:_.a.func,onToTimePickerBlur:_.a.func,onToTimePickerChange:_.a.func,onToTimePickerClick:_.a.func,toDate:_.a.instanceOf(Date),toDateInput:_.a.string,toDateDisabled:_.a.bool,toTime:_.a.string,toTimeDisabled:_.a.bool};var aa=ra,ia=function(e,t){return function(n,r,a){e(vn.a.handleTicketStartDate(t.clientId,n,a))}},oa=function(e,t){return function(n){e(vn.a.setTicketTempStartTimeInput(t.clientId,n.target.value))}},sa=function(e,t){return function(n,r){e(vn.a.handleTicketStartTime(t.clientId,n)),r()}},ca=function(e,t){return function(n,r,a){e(vn.a.handleTicketEndDate(t.clientId,n,a))}},ua=function(e,t){return function(n){e(vn.a.setTicketTempEndTimeInput(t.clientId,n.target.value))}},da=function(e,t){return function(n,r){e(vn.a.handleTicketEndTime(t.clientId,n)),r()}},_a=function(e,t,n){return function(r){var a=Be.moment.toMoment(r.target.value,Be.moment.TIME_FORMAT,!1);if(!a.isValid()){var i=vn.f.getTicketStartTimeInput(e,n);a=Be.moment.toMoment(i,Be.moment.TIME_FORMAT,!1)}var o=Be.moment.totalSeconds(a);t(vn.a.handleTicketStartTime(n.clientId,o))}},la=function(e,t,n){return function(r){var a=Be.moment.toMoment(r.target.value,Be.moment.TIME_FORMAT,!1);if(!a.isValid()){var i=vn.f.getTicketEndTimeInput(e,n);a=Be.moment.toMoment(i,Be.moment.TIME_FORMAT,!1)}var o=Be.moment.totalSeconds(a);t(vn.a.handleTicketEndTime(n.clientId,o))}},ma=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){var n=Be.globals.tecDateSettings().datepickerFormat?Be.moment.toFormat(Be.globals.tecDateSettings().datepickerFormat):"LL",r=vn.f.isTicketDisabled(e,t),a=vn.f.getTicketTempStartDateMoment(e,t),i=vn.f.getTicketTempEndDateMoment(e,t),o=a&&a.toDate(),s=i&&i.toDate();return{fromDate:o,fromDateInput:vn.f.getTicketTempStartDateInput(e,t),fromDateDisabled:r,fromDateFormat:n,fromTime:vn.f.getTicketTempStartTimeInput(e,t),fromTimeDisabled:r,hasDurationError:vn.f.getTicketHasDurationError(e,t),toDate:s,toDateInput:vn.f.getTicketTempEndDateInput(e,t),toDateDisabled:r,toDateFormat:n,toTime:vn.f.getTicketTempEndTimeInput(e,t),toTimeDisabled:r,state:e}}),(function(e,t){return{onFromDateChange:ia(e,t),onFromTimePickerChange:oa(e,t),onFromTimePickerClick:sa(e,t),onToDateChange:ca(e,t),onToTimePickerChange:ua(e,t),onToTimePickerClick:da(e,t),dispatch:e}}),(function(e,t,n){var r=e.state,a=Ue()(e,["state"]),i=t.dispatch,o=Ue()(t,["dispatch"]);return Ke()({},n,a,o,{onFromTimePickerBlur:_a(r,i,n),onToTimePickerBlur:la(r,i,n)})})))(aa),pa=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.id=Re()("ticket-sku"),n}return fe()(t,e),_e()(t,[{key:"render",value:function(){var e=this.props,t=e.sku,n=e.isDisabled,r=e.onChange;return wp.element.createElement("div",{className:he()("tribe-editor__ticket__sku","tribe-editor__ticket__content-row","tribe-editor__ticket__content-row--sku")},wp.element.createElement(be.LabelWithTooltip,{className:"tribe-editor__ticket__sku-label-with-tooltip",forId:this.id,isLabel:!0,label:Object(i.__)("Ticket SKU","event-tickets"),tooltipText:Object(i.__)("A unique identifying code for each ticket type you're selling","event-tickets"),tooltipLabel:wp.element.createElement(ye.Dashicon,{className:"tribe-editor__ticket__tooltip-label",icon:"info-outline"})}),wp.element.createElement(ge.Input,{className:"tribe-editor__ticket__sku-input",id:this.id,type:"text",value:t,onChange:r,disabled:n}))}}]),t}(c.PureComponent);pa.propTypes={isDisabled:_.a.bool,onChange:_.a.func.isRequired,sku:_.a.string};var fa=pa,Ta=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),sku:vn.f.getTicketTempSku(e,t)}}),(function(e,t){return{onChange:function(n){var r=t.clientId;e(vn.a.setTicketTempSku(r,n.target.value)),e(vn.a.setTicketHasChanges(r,!0))}}})))(fa),ha=n(262),ya=n.n(ha),ba=(n(527),vn.b.EDD),Ma=vn.b.WOO,Sa=vn.b.PROVIDER_TYPES,Ea=["edit-ticket","report"],ga=function(e){var t=e.editTicketLink,n=e.isDisabled,r=e.provider,a=e.reportLink,o=e.showEcommerceOptions,s=function(e){var o=he()("tribe-editor__ticket__ecommerce-options-link","tribe-editor__ticket__ecommerce-options-link--"+e),s="report"===e?a:t,c="report"===e?Object(i.__)("View Sales Report","event-tickets"):function(e){var t="";return e===ba?t=Object(i.__)("Edit Ticket in Easy Digital Downloads","event-tickets"):e===Ma&&(t=Object(i.__)("Edit Ticket in WooCommerce","event-tickets")),t}(r);return n?wp.element.createElement("span",{className:o},c):wp.element.createElement(ge.Link,{className:o,href:s,target:"_blank"},c)};return o&&wp.element.createElement(ge.LabeledItem,{className:he()("tribe-editor__ticket__ecommerce-options","tribe-editor__ticket__content-row","tribe-editor__ticket__content-row--ecommerce-options"),label:Object(i.__)("Ecommerce","event-tickets")},wp.element.createElement("div",{className:"tribe-editor__ticket__ecommerce-options-links"},Ea.map((function(e){return wp.element.createElement("span",{key:e,className:"tribe-editor__ticket__ecommerce-options-link-wrapper"},s(e))}))))};ga.propTypes={editTicketLink:_.a.string,isDisabled:_.a.bool,provider:_.a.oneOf([].concat(ya()(Sa),[""])),reportLink:_.a.string,showEcommerceOptions:_.a.bool};var va=ga,ka=vn.b.EDD,Da=vn.b.WOO,La=function(e){return Ur()([ka,Da],e)},Oa=function(e,t,n){var r="";La(n)&&(r=Be.globals.adminUrl()+"post.php?post="+vn.f.getTicketId(e,t)+"&action=edit");return r},Ya=function(e,t,n){var r="";if(La(n)){var a=Be.globals.adminUrl(),i=vn.f.getTicketId(e,t),o="";n===ka?o="edit.php?page=edd-reports&view=sales&post_type=download&tab=logs&download="+i:n===Da&&(o="admin.php?page=wc-reports&tab=orders&report=sales_by_product&product_ids="+i),r=""+a+o}return r},wa=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){var n=vn.f.getTicketProvider(e,t);return{isDisabled:vn.f.isTicketDisabled(e,t),provider:n,editTicketLink:Oa(e,t,n),reportLink:Ya(e,t,n),showEcommerceOptions:La(n)}})))(va),ja=(n(528),function(e){var t=e.moveTicket,n=e.removeTicket,r=e.isDisabled;return wp.element.createElement("div",{className:"tribe-editor__ticket__content-row--move-delete"},wp.element.createElement(ge.Button,{type:"button",onClick:t,disabled:r},Object(i.__)("Move Ticket","event-tickets")),wp.element.createElement(ge.Button,{type:"button",onClick:n,disabled:r},Object(i.__)("Remove Ticket","event-tickets")))});ja.propTypes={moveTicket:_.a.func.isRequired,removeTicket:_.a.func.isRequired,isDisabled:_.a.bool.isRequired};var Ia=ja,Pa=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),ticketId:vn.f.getTicketId(e,t)}}),(function(e,t){return{removeTicket:function(){e(vn.a.deleteTicket(t.clientId))},moveTicket:function(n){return e(Object(st.c)(n,t.clientId))}}}),(function(e,t,n){return Ke()({},e,t,n,{moveTicket:function(){return t.moveTicket(e.ticketId)}})})))(Ia),Ca=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getHeader=function(){return wp.element.createElement(c.Fragment,null,wp.element.createElement(ye.Dashicon,{className:"tribe-editor__ticket__advanced-options-header-icon",icon:"arrow-down"}),wp.element.createElement("span",{className:"tribe-editor__ticket__advanced-options-header-text"},Object(i.__)("Advanced Options","event-tickets")))},n.getContent=function(){return wp.element.createElement(c.Fragment,null,wp.element.createElement(ma,{clientId:n.props.clientId}),wp.element.createElement(Ta,{clientId:n.props.clientId}),wp.element.createElement(wa,{clientId:n.props.clientId}),n.props.hasBeenCreated&&wp.element.createElement(Pa,{clientId:n.props.clientId}))},n.getRows=function(){return[{accordionId:n.accordionId,content:n.getContent(),contentClassName:"tribe-editor__ticket__advanced-options-content",header:n.getHeader(),headerAttrs:{disabled:n.props.isDisabled},headerClassName:"tribe-editor__ticket__advanced-options-header"}]},n.accordionId=Re()(),n}return fe()(t,e),_e()(t,[{key:"render",value:function(){return wp.element.createElement(ge.Accordion,{className:"tribe-editor__ticket__advanced-options",rows:this.getRows()})}}]),t}(c.Component);Ca.propTypes={clientId:_.a.string.isRequired,isDisabled:_.a.bool,hasBeenCreated:_.a.bool};var xa=Ca,Ra=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),hasBeenCreated:vn.f.getTicketHasBeenCreated(e,t)}})))(xa),Aa=(n(529),Object(i.__)("+ Add","event-tickets")),Ha=Object(i.__)("Edit","event-tickets"),Na=function(e){var t=e.attendeeRegistrationURL,n=e.hasAttendeeInfoFields,r=e.isCreated,a=e.isDisabled,o=e.isModalOpen,s=e.onClick,c=e.onClose,u=e.onIframeLoad,d=n?Ha:Aa;return wp.element.createElement(be.AttendeesRegistration,{helperText:Object(i.__)("Save your ticket to enable attendee information fields","event-tickets"),iframeURL:t,isDisabled:a,isModalOpen:o,label:Object(i.__)("Attendee Information","event-tickets"),linkText:d,modalTitle:Object(i.__)("Attendee Information","event-tickets"),onClick:s,onClose:c,onIframeLoad:u,showHelperText:!r})};Na.propTypes={attendeeRegistrationURL:_.a.string.isRequired,hasAttendeeInfoFields:_.a.bool.isRequired,isCreated:_.a.bool.isRequired,isDisabled:_.a.bool.isRequired,isModalOpen:_.a.bool.isRequired,onClick:_.a.func.isRequired,onClose:_.a.func.isRequired,onIframeLoad:_.a.func.isRequired};var Va=Na,Fa=function(e,t){return Be.globals.adminUrl()+"edit.php?post_type="+Object(se.select)("core/editor").getCurrentPostType()+"&page=attendee-registration&ticket_id="+vn.f.getTicketId(e,t)+"&tribe_events_modal=1"},Ka=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){var n=vn.f.getTicketHasBeenCreated(e,t);return{attendeeRegistrationURL:Fa(e,t),hasAttendeeInfoFields:vn.f.getTicketHasAttendeeInfoFields(e,t),isCreated:n,isDisabled:vn.f.isTicketDisabled(e,t)||!n,isModalOpen:vn.f.getTicketIsModalOpen(e,t)}}),(function(e,t){return{onClick:function(){e(vn.a.setTicketIsModalOpen(t.clientId,!0))},onClose:function(n){n.target.classList.contains("components-modal__content")||e(vn.a.setTicketIsModalOpen(t.clientId,!1)),"click"===n.type&&n.target.classList.contains("components-modal__screen-overlay")&&e(vn.a.setTicketIsModalOpen(t.clientId,!1))},onIframeLoad:function(n){var r=n.contentWindow,a=function(){n.nextSibling.classList.add("tribe-editor__attendee-registration__modal-overlay--show")},i=r.document.querySelector("#event-tickets-attendee-information");i.addEventListener("submit",a);var o=function(){r.removeEventListener("unload",s),i.removeEventListener("submit",a)},s=function(){o();var n=r.document.querySelector("#tribe-tickets-attendee-sortables"),a=Boolean(n.firstElementChild);e(vn.a.setTicketHasAttendeeInfoFields(t.clientId,a)),e(vn.a.setTicketIsModalOpen(t.clientId,!1))};r.addEventListener("unload",s);var c=r.document.querySelector(".tribe-intro > a");c&&c.setAttribute("target","_blank")}}})))(Va),Wa=(n(530),function(e){var t=e.clientId,n=e.hasTicketsPlus;return wp.element.createElement(c.Fragment,null,wp.element.createElement(na,{clientId:t}),wp.element.createElement(Ra,{clientId:t}),n&&wp.element.createElement(Ka,{clientId:t}))});Wa.propTypes={clientId:_.a.string.isRequired,hasTicketsPlus:_.a.bool};var Ua=Wa,za=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS)}})))(Ua),Ga=function(e){return e.isDisabled?wp.element.createElement(o.ClockInactive,null):wp.element.createElement(o.ClockActive,null)},Ba=function(e){return e.isDisabled?wp.element.createElement(o.TicketInactive,null):wp.element.createElement(o.TicketActive,null)},qa=function(e){var t=e.isDisabled,n=e.isFuture,r=e.isPast;return n||r?wp.element.createElement(Ga,{isDisabled:t}):wp.element.createElement(Ba,{isDisabled:t})};qa.propTypes={isDisabled:_.a.bool.isRequired,isFuture:_.a.bool,isPast:_.a.bool};var Ja=function(e){var t=e.clientId,n=e.isDisabled,r=e.isFuture,a=e.isPast,i=e.isSelected;return wp.element.createElement(be.ContainerPanel,{className:"tribe-editor__ticket__container",layout:Me.a.ticket,icon:wp.element.createElement(qa,{isDisabled:n,isFuture:r,isPast:a}),header:wp.element.createElement(Vr,{clientId:t,isSelected:i}),content:wp.element.createElement(za,{clientId:t})})};Ja.propTypes={clientId:_.a.string.isRequired,isDisabled:_.a.bool,isFuture:_.a.bool,isPast:_.a.bool,isSelected:_.a.bool};var $a=Ja,Za=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),isFuture:vn.f.isTicketFuture(e,t),isPast:vn.f.isTicketPast(e,t)}})))($a),Qa=(n(531),function(e){return e?Object(i.__)("Update Ticket","event-tickets"):Object(i.__)("Create Ticket","event-tickets")}),Xa=Object(i.__)("Cancel","event-tickets"),ei=function(e){var t=e.hasBeenCreated,n=e.isCancelDisabled,r=e.isConfirmDisabled,a=e.onCancelClick,i=e.onConfirmClick;return wp.element.createElement(be.ActionDashboard,{className:"tribe-editor__ticket__dashboard",cancelLabel:Xa,confirmLabel:Qa(t),isCancelDisabled:n,isConfirmDisabled:r,onCancelClick:a,onConfirmClick:i})};ei.propTypes={hasBeenCreated:_.a.bool,isCancelDisabled:_.a.bool,isConfirmDisabled:_.a.bool,onCancelClick:_.a.func,onConfirmClick:_.a.func};var ti=ei,ni=function(e,t){return!vn.f.isTicketValid(e,t)||!vn.f.getTicketHasChanges(e,t)||vn.f.isTicketDisabled(e,t)||vn.f.getTicketHasDurationError(e,t)},ri=function(e,t,n){return function(){vn.f.getTicketHasBeenCreated(e,n)?(t(vn.a.setTicketTempDetails(n.clientId,{title:vn.f.getTicketTitle(e,n),description:vn.f.getTicketDescription(e,n),price:vn.f.getTicketPrice(e,n),sku:vn.f.getTicketSku(e,n),startDate:vn.f.getTicketStartDate(e,n),startDateInput:vn.f.getTicketStartDateInput(e,n),startDateMoment:vn.f.getTicketStartDateMoment(e,n),endDate:vn.f.getTicketEndDate(e,n),endDateInput:vn.f.getTicketEndDateInput(e,n),endDateMoment:vn.f.getTicketEndDateMoment(e,n),startTime:vn.f.getTicketStartTime(e,n),endTime:vn.f.getTicketEndTime(e,n),startTimeInput:vn.f.getTicketStartTimeInput(e,n),endTimeInput:vn.f.getTicketEndTimeInput(e,n),capacityType:vn.f.getTicketCapacityType(e,n),capacity:vn.f.getTicketCapacity(e,n)})),t(vn.a.setTicketsTempSharedCapacity(vn.f.getTicketsSharedCapacity(e))),t(vn.a.setTicketHasChanges(n.clientId,!1))):(t(vn.a.removeTicketBlock(n.clientId)),Object(se.dispatch)("core/editor").removeBlocks(n.clientId)),Object(se.dispatch)("core/editor").clearSelectedBlock()}},ai=function(e,t,n){return function(){return vn.f.getTicketHasBeenCreated(e,n)?t(vn.a.updateTicket(n.clientId)):t(vn.a.createNewTicket(n.clientId))}},ii=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{hasBeenCreated:vn.f.getTicketHasBeenCreated(e,t),isCancelDisabled:vn.f.isTicketDisabled(e,t),isConfirmDisabled:ni(e,t),state:e}}),null,(function(e,t,n){var r=e.state,a=Ue()(e,["state"]),i=t.dispatch;return Ke()({},n,a,{onCancelClick:ri(r,i,n),onConfirmClick:ai(r,i,n)})})))(ti),oi=function(e){function t(){return ue()(this,t),me()(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return fe()(t,e),_e()(t,[{key:"componentDidMount",value:function(){this.props.onBlockUpdate(this.props.isSelected)}},{key:"componentDidUpdate",value:function(e){e.isSelected!==this.props.isSelected&&this.props.onBlockUpdate(this.props.isSelected)}},{key:"render",value:function(){var e=this.props,t=e.clientId,n=e.hasTicketsPlus,r=e.isDisabled,a=e.isLoading,i=e.isSelected,o=e.isModalShowing;return e.showTicket?wp.element.createElement(c.Fragment,null,wp.element.createElement("article",{className:he()("tribe-editor__ticket",{"tribe-editor__ticket--disabled":r},{"tribe-editor__ticket--selected":i},{"tribe-editor__ticket--has-tickets-plus":n})},wp.element.createElement(Za,{clientId:t,isSelected:i}),wp.element.createElement(ii,{clientId:t,isSelected:i}),a&&wp.element.createElement(ye.Spinner,null)),o&&wp.element.createElement(mn,null)):null}}]),t}(c.PureComponent);oi.propTypes={clientId:_.a.string.isRequired,hasTicketsPlus:_.a.bool,isDisabled:_.a.bool,isLoading:_.a.bool,isModalShowing:_.a.bool,isSelected:_.a.bool,onBlockUpdate:_.a.func,removeTicketBlock:_.a.func,showTicket:_.a.bool};var si=oi,ci=function(e,t){return vn.f.getTicketsIsSelected(e)||vn.f.hasATicketSelected(e)||vn.f.isTicketOnSale(e,t)},ui=Object(P.c)(Object(Le.withStore)({isolated:!0}),ae((function(e,t){return{hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),hasBeenCreated:vn.f.getTicketHasBeenCreated(e,t),isDisabled:vn.f.isTicketDisabled(e,t),isLoading:vn.f.getTicketIsLoading(e,t),isModalShowing:Object(un.l)(e),modalTicketId:Object(un.e)(e),showTicket:ci(e,t),ticketId:vn.f.getTicketId(e,t)}}),(function(e,t){var n=t.clientId;return{onBlockUpdate:function(t){return e(vn.a.setTicketIsSelected(n,t))},setInitialState:function(t){e(vn.a.registerTicketBlock(n)),e(vn.a.setTicketInitialState(t))}}}),(function(e,t,n){return Ke()({},e,t,n,{isModalShowing:e.isModalShowing&&e.modalTicketId===e.ticketId})})),Object(Le.withSaveData)())(si),di={id:"tickets-item",title:Object(i.__)("Event Ticket","event-tickets"),description:Object(i.__)("A single configured ticket type.","event-tickets"),icon:wp.element.createElement(o.Tickets,null),category:"tribe-tickets",keywords:["event","event-tickets","tribe"],parent:["tribe/tickets"],supports:{html:!1},attributes:{hasBeenCreated:{type:"boolean",default:!1},ticketId:{type:"integer",default:0}},edit:ui,save:function(){return wp.element.createElement("div",null,wp.element.createElement(Sn.InnerBlocks.Content,null))}},_i=n(54),li=n(110),mi=(n(532),Object(i.__)("Who's Attending?","event-tickets")),pi=Object(i.__)("(X) people are attending this event","event-tickets"),fi=function(){return wp.element.createElement("div",{className:"tribe-editor__event-attendees__gravatars"},wp.element.createElement(o.AttendeesGravatar,null),wp.element.createElement(o.AttendeesGravatar,null),wp.element.createElement(o.AttendeesGravatar,null),wp.element.createElement(o.AttendeesGravatar,null),wp.element.createElement(o.AttendeesGravatar,null))},Ti=function(){return wp.element.createElement("div",{className:"tribe-editor__event-attendees__subtitle"},wp.element.createElement("p",null,pi))},hi=function(e){var t=e.isSelected,n=e.title,r=e.displayTitle,a=e.displaySubtitle,i=t||n?function(e){var t=e.isSelected,n=e.isEmpty,r=e.title,a=e.setTitle,i=he()({"tribe-editor__event-attendees__title":!0,"tribe-editor__event-attendees__title--selected":t}),o=he()({"tribe-editor__event-attendees__title-text":!0,"tribe-editor__event-attendees__title-text--empty":n&&t});return wp.element.createElement("div",{key:"tribe-events-attendees-label",className:i},wp.element.createElement(Ee.a,{id:"tribe-events-attendees-link",className:o,value:r,placeholder:mi,onChange:a}))}(e):wp.element.createElement("span",{className:he()(["tribe-editor__event-attendees__title","tribe-editor__event-attendees__title--placeholder"])},mi);return wp.element.createElement("div",{className:"tribe-editor__block tribe-editor__event-attendees"},r?i:"",a?wp.element.createElement(Ti,null):"",wp.element.createElement(fi,null))},yi=function(e){var t=e.isSelected,n=e.displayTitle,r=e.displaySubtitle,a=e.onSetDisplayTitleChange,o=e.onSetDisplaySubtitleChange;return t&&wp.element.createElement(Sn.InspectorControls,{key:"inspector"},wp.element.createElement(ye.PanelBody,{title:Object(i.__)("Attendees Settings","event-tickets")},wp.element.createElement(ye.ToggleControl,{label:Object(i.__)("Display Title","event-tickets"),checked:n,onChange:a}),wp.element.createElement(ye.ToggleControl,{label:Object(i.__)("Display Subtitle","event-tickets"),checked:r,onChange:o})))},bi=function(e){return wp.element.createElement(c.Fragment,null,wp.element.createElement(hi,e),wp.element.createElement(yi,e))};bi.propTypes={setTitle:_.a.func,title:_.a.string,isSelected:_.a.bool,isEmpty:_.a.bool,displayTitle:_.a.bool,displaySubtitle:_.a.bool,onSetDisplaySubtitleChange:_.a.func,onSetDisplayTitleChange:_.a.func};var Mi=bi,Si=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{title:li.c(e),displayTitle:li.b(e),displaySubtitle:li.a(e)}}),(function(e){return{setInitialState:function(t){return e(_i.c(t))},setTitle:function(t){return e(_i.d(t.target.value))},onSetDisplayTitleChange:function(t){return e(_i.b(t))},onSetDisplaySubtitleChange:function(t){return e(_i.a(t))}}})),Object(Le.withSaveData)())(Mi),Ei=[Mn,yr,di,{id:"attendees",title:Object(i.__)("Attendee List","event-tickets"),description:Object(i.__)("Show the gravatars of people coming to this event.","event-tickets"),icon:wp.element.createElement(o.Attendees,null),category:"tribe-tickets",keywords:["event","events-gutenberg","tribe"],supports:{html:!1},attributes:{title:{type:"html",default:Object(i.__)("Who's Attending?","event-tickets")},displayTitle:{type:"boolean",default:!0},displaySubtitle:{type:"boolean",default:!0}},edit:Si,save:function(){return null}}];Ei.forEach((function(e){return Object(r.registerBlockType)("tribe/"+e.id,e)})),Object(a.initStore)();t.default=Ei}]);
11
  *
12
  * This source code is licensed under the MIT license found in the
13
  * LICENSE file in the root directory of this source tree.
14
+ */Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,d=r?Symbol.for("react.context"):60110,_=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,m=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,f=r?Symbol.for("react.memo"):60115,T=r?Symbol.for("react.lazy"):60116;function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case _:case l:case o:case c:case s:case p:return e;default:switch(e=e&&e.$$typeof){case d:case m:case u:return e;default:return t}}case T:case f:case i:return t}}}function y(e){return h(e)===l}t.typeOf=h,t.AsyncMode=_,t.ConcurrentMode=l,t.ContextConsumer=d,t.ContextProvider=u,t.Element=a,t.ForwardRef=m,t.Fragment=o,t.Lazy=T,t.Memo=f,t.Portal=i,t.Profiler=c,t.StrictMode=s,t.Suspense=p,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===l||e===c||e===s||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===T||e.$$typeof===f||e.$$typeof===u||e.$$typeof===d||e.$$typeof===m)},t.isAsyncMode=function(e){return y(e)||h(e)===_},t.isConcurrentMode=y,t.isContextConsumer=function(e){return h(e)===d},t.isContextProvider=function(e){return h(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return h(e)===m},t.isFragment=function(e){return h(e)===o},t.isLazy=function(e){return h(e)===T},t.isMemo=function(e){return h(e)===f},t.isPortal=function(e){return h(e)===i},t.isProfiler=function(e){return h(e)===c},t.isStrictMode=function(e){return h(e)===s},t.isSuspense=function(e){return h(e)===p}},function(e,t,n){},function(e,t,n){},function(e,t){var n,r,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var c,u=[],d=!1,_=-1;function l(){d&&c&&(d=!1,c.length?u=c.concat(u):_=-1,u.length&&m())}function m(){if(!d){var e=s(l);d=!0;for(var t=u.length;t;){for(c=u,u=[];++_<t;)c&&c[_].run();_=-1,t=u.length}c=null,d=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function f(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||d||s(m)},p.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=f,a.addListener=f,a.once=f,a.off=f,a.removeListener=f,a.removeAllListeners=f,a.emit=f,a.prependListener=f,a.prependOnceListener=f,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(111),a=n(324),i=n(15),o=n(30);function s(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var c=n(13),u=n.n(c),d=n(1),_=n.n(d),l=_.a.shape({trySubscribe:_.a.func.isRequired,tryUnsubscribe:_.a.func.isRequired,notifyNestedSubs:_.a.func.isRequired,isSubscribed:_.a.func.isRequired}),m=_.a.shape({subscribe:_.a.func.isRequired,dispatch:_.a.func.isRequired,getState:_.a.func.isRequired});u.a.forwardRef;!function(e){var t;void 0===e&&(e="store");var n=e+"Subscription",r=function(t){s(a,t);var r=a.prototype;function a(n,r){var a;return(a=t.call(this,n,r)||this)[e]=n.store,a}return r.getChildContext=function(){var t;return(t={})[e]=this[e],t[n]=null,t},r.render=function(){return c.Children.only(this.props.children)},a}(c.Component);r.propTypes={store:m.isRequired,children:_.a.element.isRequired},r.childContextTypes=((t={})[e]=m.isRequired,t[n]=l,t)}();function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}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}).apply(this,arguments)}function T(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var h=n(489),y=n.n(h),b=n(325),M=n.n(b),S=n(488),E=null,g={notify:function(){}};var v=function(){function e(e,t,n){this.store=e,this.parentSub=t,this.onStateChange=n,this.unsubscribe=null,this.listeners=g}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){var e,t;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=(e=[],t=[],{clear:function(){t=E,e=E},notify:function(){for(var n=e=t,r=0;r<n.length;r++)n[r]()},get:function(){return t},subscribe:function(n){var r=!0;return t===e&&(t=e.slice()),t.push(n),function(){r&&e!==E&&(r=!1,t===e&&(t=e.slice()),t.splice(t.indexOf(n),1))}}}))},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=g)},e}(),k=void 0!==u.a.forwardRef,D=0,L={};function O(){}function Y(e,t){var n,r;void 0===t&&(t={});var a=t,i=a.getDisplayName,o=void 0===i?function(e){return"ConnectAdvanced("+e+")"}:i,u=a.methodName,d=void 0===u?"connectAdvanced":u,_=a.renderCountProp,h=void 0===_?void 0:_,b=a.shouldHandleStateChanges,E=void 0===b||b,g=a.storeKey,Y=void 0===g?"store":g,w=a.withRef,j=void 0!==w&&w,I=T(a,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),P=Y+"Subscription",C=D++,x=((n={})[Y]=m,n[P]=l,n),R=((r={})[P]=l,r);return function(t){M()(Object(S.isValidElementType)(t),"You must pass a component to the function returned by "+d+". Instead received "+JSON.stringify(t));var n=t.displayName||t.name||"Component",r=o(n),a=f({},I,{getDisplayName:o,methodName:d,renderCountProp:h,shouldHandleStateChanges:E,storeKey:Y,withRef:j,displayName:r,wrappedComponentName:n,WrappedComponent:t}),i=function(n){function i(e,t){var a;return(a=n.call(this,e,t)||this).version=C,a.state={},a.renderCount=0,a.store=e[Y]||t[Y],a.propsMode=Boolean(e[Y]),a.setWrappedInstance=a.setWrappedInstance.bind(p(p(a))),M()(a.store,'Could not find "'+Y+'" in either the context or props of "'+r+'". Either wrap the root component in a <Provider>, or explicitly pass "'+Y+'" as a prop to "'+r+'".'),a.initSelector(),a.initSubscription(),a}s(i,n);var o=i.prototype;return o.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[P]=t||this.context[P],e},o.componentDidMount=function(){E&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},o.componentWillReceiveProps=function(e){this.selector.run(e)},o.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},o.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=O,this.store=null,this.selector.run=O,this.selector.shouldComponentUpdate=!1},o.getWrappedInstance=function(){return M()(j,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+d+"() call."),this.wrappedInstance},o.setWrappedInstance=function(e){this.wrappedInstance=e},o.initSelector=function(){var t=e(this.store.dispatch,a);this.selector=function(e,t){var n={run:function(r){try{var a=e(t.getState(),r);(a!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=a,n.error=null)}catch(e){n.shouldComponentUpdate=!0,n.error=e}}};return n}(t,this.store),this.selector.run(this.props)},o.initSubscription=function(){if(E){var e=(this.propsMode?this.props:this.context)[P];this.subscription=new v(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},o.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(L)):this.notifyNestedSubs()},o.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},o.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},o.addExtraProps=function(e){if(!(j||h||this.propsMode&&this.subscription))return e;var t=f({},e);return j&&(t.ref=this.setWrappedInstance),h&&(t[h]=this.renderCount++),this.propsMode&&this.subscription&&(t[P]=this.subscription),t},o.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(c.createElement)(t,this.addExtraProps(e.props))},i}(c.Component);return k&&(i.prototype.UNSAFE_componentWillReceiveProps=i.prototype.componentWillReceiveProps,delete i.prototype.componentWillReceiveProps),i.WrappedComponent=t,i.displayName=r,i.childContextTypes=R,i.contextTypes=x,i.propTypes=x,y()(i,t)}}var w=Object.prototype.hasOwnProperty;function j(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function I(e,t){if(j(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var a=0;a<n.length;a++)if(!w.call(t,n[a])||!j(e[n[a]],t[n[a]]))return!1;return!0}var P=n(16);function C(e){return function(t,n){var r=e(t,n);function a(){return r}return a.dependsOnOwnProps=!1,a}}function x(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function R(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=x(e);var a=r(t,n);return"function"==typeof a&&(r.mapToProps=a,r.dependsOnOwnProps=x(a),a=r(t,n)),a},r}}var A=[function(e){return"function"==typeof e?R(e):void 0},function(e){return e?void 0:C((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?C((function(t){return Object(P.a)(e,t)})):void 0}];var H=[function(e){return"function"==typeof e?R(e):void 0},function(e){return e?void 0:C((function(){return{}}))}];function N(e,t,n){return f({},n,e,t)}var V=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,a=n.pure,i=n.areMergedPropsEqual,o=!1;return function(t,n,s){var c=e(t,n,s);return o?a&&i(c,r)||(r=c):(o=!0,r=c),r}}}(e):void 0},function(e){return e?void 0:function(){return N}}];function F(e,t,n,r){return function(a,i){return n(e(a,i),t(r,i),i)}}function K(e,t,n,r,a){var i,o,s,c,u,d=a.areStatesEqual,_=a.areOwnPropsEqual,l=a.areStatePropsEqual,m=!1;function p(a,m){var p,f,T=!_(m,o),h=!d(a,i);return i=a,o=m,T&&h?(s=e(i,o),t.dependsOnOwnProps&&(c=t(r,o)),u=n(s,c,o)):T?(e.dependsOnOwnProps&&(s=e(i,o)),t.dependsOnOwnProps&&(c=t(r,o)),u=n(s,c,o)):h?(p=e(i,o),f=!l(p,s),s=p,f&&(u=n(s,c,o)),u):u}return function(a,d){return m?p(a,d):(s=e(i=a,o=d),c=t(r,o),u=n(s,c,o),m=!0,u)}}function W(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,a=t.initMergeProps,i=T(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),o=n(e,i),s=r(e,i),c=a(e,i);return(i.pure?K:F)(o,s,c,e,i)}function U(e,t,n){for(var r=t.length-1;r>=0;r--){var a=t[r](e);if(a)return a}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function z(e,t){return e===t}var G,B,q,J,$,Z,Q,X,ee,te,ne,re,ae=(q=(B=void 0===G?{}:G).connectHOC,J=void 0===q?Y:q,$=B.mapStateToPropsFactories,Z=void 0===$?H:$,Q=B.mapDispatchToPropsFactories,X=void 0===Q?A:Q,ee=B.mergePropsFactories,te=void 0===ee?V:ee,ne=B.selectorFactory,re=void 0===ne?W:ne,function(e,t,n,r){void 0===r&&(r={});var a=r,i=a.pure,o=void 0===i||i,s=a.areStatesEqual,c=void 0===s?z:s,u=a.areOwnPropsEqual,d=void 0===u?I:u,_=a.areStatePropsEqual,l=void 0===_?I:_,m=a.areMergedPropsEqual,p=void 0===m?I:m,h=T(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),y=U(e,Z,"mapStateToProps"),b=U(t,X,"mapDispatchToProps"),M=U(n,te,"mergeProps");return J(re,f({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:y,initMapDispatchToProps:b,initMergeProps:M,pure:o,areStatesEqual:c,areOwnPropsEqual:d,areStatePropsEqual:l,areMergedPropsEqual:p},h))}),ie=n(4),oe=n.n(ie),se=n(20),ce=n(35),ue=n.n(ce),de=n(36),_e=n.n(de),le=n(33),me=n.n(le),pe=n(37),fe=n.n(pe),Te=n(22),he=n.n(Te),ye=n(26),be=n(24),Me=n(109),Se=n(86),Ee=n.n(Se),ge=n(21),ve=(n(492),function(e){var t=e.goingCount,n=e.notGoingCount,r=e.showNotGoing;return wp.element.createElement("div",{className:"tribe-editor__rsvp-container-header__counters"},wp.element.createElement(ge.Counter,{className:"tribe-editor__rsvp-container-header__going-counter",count:t,label:Object(i.__)("Going","event-tickets")}),r&&wp.element.createElement(ge.Counter,{className:"tribe-editor__rsvp-container-header__not-going-counter",count:n,label:Object(i.__)("Not going","event-tickets")}))});ve.propTypes={goingCount:_.a.number,notGoingCount:_.a.number,showNotGoing:_.a.bool};var ke=ve,De=n(12),Le=n(18),Oe=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{goingCount:De.d.getRSVPGoingCount(e),notGoingCount:De.d.getRSVPNotGoingCount(e),showNotGoing:De.d.getRSVPNotGoingResponses(e)}})))(ke),Ye=n(62),we=(n(493),wp.element.createElement(ge.Tooltip,{labelClassName:"tribe-editor__ticket__container-header-clipboard-tooltip",label:wp.element.createElement(Ye.Clipboard,null),text:Object(i.__)("This ticket has Attendee Information Fields configured.","event-tickets")})),je=function(e){var t,n,r,a,o=e.description,s=e.hasAttendeeInfoFields,u=e.isCreated,d=e.isDisabled,_=e.isSelected,l=e.onTempDescriptionChange,m=e.onTempTitleChange,p=e.tempDescription,f=e.tempTitle,T=e.title,h=e.available;return wp.element.createElement(c.Fragment,null,wp.element.createElement("div",{className:"tribe-editor__rsvp-container-header__header-details"},function(e,t,n,r,a,o){return n?wp.element.createElement("div",{className:"tribe-editor__rsvp-container-header__title-input-wrapper"},wp.element.createElement(Ee.a,{className:"tribe-editor__rsvp-container-header__title-input",value:a,placeholder:Object(i.__)("RSVP Title","event-tickets"),onChange:r,disabled:t}),e&&we):wp.element.createElement("h2",{className:"tribe-editor__rsvp-container-header__title"},o)}(s,d,_,m,f,T),function(e,t,n,r,a){return t?wp.element.createElement(Ee.a,{className:"tribe-editor__rsvp-container-header__description-input",value:r,placeholder:Object(i.__)("description","event-tickets"),onChange:n,disabled:e}):a&&wp.element.createElement("span",{className:"tribe-editor__rsvp-container-header__description"},a)}(d,_,l,p,o),u&&(t=h,n=Object(i.__)("%d available","event-tickets"),r=n,a=wp.element.createElement("span",{className:"tribe-editor__rsvp-container-header__capacity-label-fallback"},Object(i.__)("Unlimited","event-tickets")),wp.element.createElement(be.NumericLabel,{className:"tribe-editor__rsvp-container-header__capacity-label",count:t,includeZero:!0,singular:n,plural:r,fallback:a}))),wp.element.createElement(Oe,null))};je.propTypes={available:_.a.number,description:_.a.string,hasAttendeeInfoFields:_.a.bool,isCreated:_.a.bool,isDisabled:_.a.bool.isRequired,isSelected:_.a.bool.isRequired,onTempDescriptionChange:_.a.func,onTempTitleChange:_.a.func,tempDescription:_.a.string,tempTitle:_.a.string,title:_.a.string};var Ie=je,Pe=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)},Ce=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{available:De.d.getRSVPAvailable(e),description:De.d.getRSVPDescription(e),hasAttendeeInfoFields:De.d.getRSVPHasAttendeeInfoFields(e),isCreated:De.d.getRSVPCreated(e),isDisabled:Pe(e),tempDescription:De.d.getRSVPTempDescription(e),tempTitle:De.d.getRSVPTempTitle(e),title:De.d.getRSVPTitle(e)}}),(function(e){return{onTempDescriptionChange:function(t){e(De.a.setRSVPTempDescription(t.target.value)),e(De.a.setRSVPHasChanges(!0))},onTempTitleChange:function(t){e(De.a.setRSVPTempTitle(t.target.value)),e(De.a.setRSVPHasChanges(!0))}}})))(Ie),xe=n(72),Re=n.n(xe),Ae=(n(495),wp.element.createElement(ye.Dashicon,{className:"tribe-editor__rsvp-duration__duration-tooltip-label",icon:"info-outline"})),He=function(e){var t=e.tooltipDisabled;return wp.element.createElement(be.LabelWithTooltip,{className:"tribe-editor__rsvp-duration__duration-label",label:Object(i.__)("Duration","event-tickets"),tooltipDisabled:t,tooltipLabel:Ae,tooltipText:Object(i.__)("By default, sales will begin as soon as you save the ticket and end when the event begins","event-tickets")})},Ne=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)},Ve=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isDisabled:Ne(e)}})))(He),Fe=n(9),Ke=n.n(Fe),We=n(38),Ue=n.n(We),ze=(n(496),function(e){return wp.element.createElement(be.DateTimeRangePicker,Ke()({className:"tribe-editor__rsvp-duration__duration-picker"},e))});ze.propTypes={fromDate:_.a.instanceOf(Date),fromDateInput:_.a.string,fromDateDisabled:_.a.bool,fromTime:_.a.string,fromTimeDisabled:_.a.bool,onFromDateChange:_.a.func,onFromTimePickerBlur:_.a.func,onFromTimePickerChange:_.a.func,onFromTimePickerClick:_.a.func,onToDateChange:_.a.func,onToTimePickerBlur:_.a.func,onToTimePickerChange:_.a.func,onToTimePickerClick:_.a.func,toDate:_.a.instanceOf(Date),toDateInput:_.a.string,toDateDisabled:_.a.bool,toTime:_.a.string,toTimeDisabled:_.a.bool};var Ge=ze,Be=n(3),qe=function(e){return function(t,n,r){var a={date:t,dayPickerInput:r};e(De.a.handleRSVPStartDate(a))}},Je=function(e){return function(t){return e(De.a.setRSVPTempStartTimeInput(t.target.value))}},$e=function(e){return function(t,n){e(De.a.handleRSVPStartTime(t)),n()}},Ze=function(e){return function(t,n,r){var a={date:t,dayPickerInput:r};e(De.a.handleRSVPEndDate(a))}},Qe=function(e){return function(t){return e(De.a.setRSVPTempEndTimeInput(t.target.value))}},Xe=function(e){return function(t,n){e(De.a.handleRSVPEndTime(t)),n()}},et=function(e,t){return function(n){var r=Be.moment.toMoment(n.target.value,Be.moment.TIME_FORMAT,!1);if(!r.isValid()){var a=De.d.getRSVPStartTimeInput(e);r=Be.moment.toMoment(a,Be.moment.TIME_FORMAT,!1)}var i=Be.moment.totalSeconds(r);t(De.a.handleRSVPStartTime(i))}},tt=function(e,t){return function(n){var r=Be.moment.toMoment(n.target.value,Be.moment.TIME_FORMAT,!1);if(!r.isValid()){var a=De.d.getRSVPEndTimeInput(e);r=Be.moment.toMoment(a,Be.moment.TIME_FORMAT,!1)}var i=Be.moment.totalSeconds(r);t(De.a.handleRSVPEndTime(i))}},nt=Object(P.c)(Object(Le.withStore)(),ae((function(e){var t=Be.globals.tecDateSettings().datepickerFormat?Be.moment.toFormat(Be.globals.tecDateSettings().datepickerFormat):"LL",n=De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e),r=De.d.getRSVPTempStartDateMoment(e),a=De.d.getRSVPTempEndDateMoment(e),i=r&&r.toDate(),o=a&&a.toDate();return{fromDate:i,fromDateInput:De.d.getRSVPTempStartDateInput(e),fromDateDisabled:n,fromDateFormat:t,fromTime:De.d.getRSVPTempStartTimeInput(e),fromTimeDisabled:n,toDate:o,toDateInput:De.d.getRSVPTempEndDateInput(e),toDateDisabled:n,toDateFormat:t,toTime:De.d.getRSVPTempEndTimeInput(e),toTimeDisabled:n,state:e}}),(function(e){return{onFromDateChange:qe(e),onFromTimePickerChange:Je(e),onFromTimePickerClick:$e(e),onToDateChange:Ze(e),onToTimePickerChange:Qe(e),onToTimePickerClick:Xe(e),dispatch:e}}),(function(e,t,n){var r=e.state,a=Ue()(e,["state"]),i=t.dispatch,o=Ue()(t,["dispatch"]);return Ke()({},n,a,o,{onFromTimePickerBlur:et(r,i),onToTimePickerBlur:tt(r,i)})})))(Ge),rt=(n(497),function(e){var t=e.hasDurationError;return wp.element.createElement("div",{className:"tribe-editor__rsvp-duration"},wp.element.createElement(Ve,null),wp.element.createElement(nt,null),t&&wp.element.createElement("span",{className:"tribe-editor__rsvp-duration__error"},Object(i.__)("There is an error with the selected sales duration. Please fix the issue before saving.","event-tickets")))}),at=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{hasDurationError:De.d.getRSVPHasDurationError(e)}})))(rt),it=(n(498),function(e){var t=e.moveRSVP,n=e.removeRSVP,r=e.isDisabled;return wp.element.createElement("div",{className:"tribe-editor__rsvp__content-row--move-delete"},wp.element.createElement(ge.Button,{type:"button",onClick:t,disabled:r},Object(i.__)("Move RSVP","event-tickets")),wp.element.createElement(ge.Button,{type:"button",onClick:n,disabled:r},Object(i.__)("Remove RSVP","event-tickets")))});it.propTypes={moveRSVP:_.a.func.isRequired,removeRSVP:_.a.func.isRequired,isDisabled:_.a.bool.isRequired};var ot=it,st=n(68),ct=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{created:De.d.getRSVPCreated(e),rsvpId:De.d.getRSVPId(e),isDisabled:De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)}}),(function(e,t){return{moveRSVP:function(n){return e(Object(st.c)(n,t.clientId))},dispatch:e}}),(function(e,t,n){var r=t.dispatch,a=Ue()(t,["dispatch"]);return Ke()({},n,e,a,{removeRSVP:function(){window.confirm(Object(i.__)("Are you sure you want to delete this RSVP? It cannot be undone.","event-tickets"))&&(r(De.a.deleteRSVP()),e.created&&e.rsvpId&&r(De.e.deleteRSVP(e.rsvpId)),Object(se.dispatch)("core/editor").removeBlocks([n.clientId]))},moveRSVP:function(){return t.moveRSVP(e.rsvpId)}})})))(ot),ut=(n(499),function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getContent=function(){return wp.element.createElement(c.Fragment,null,wp.element.createElement(at,null),n.props.hasBeenCreated&&wp.element.createElement(ct,{clientId:n.props.clientId}))},n.getHeader=function(){return wp.element.createElement(c.Fragment,null,wp.element.createElement(ye.Dashicon,{className:"tribe-editor__rsvp__advanced-options-header-icon",icon:"arrow-down"}),wp.element.createElement("span",{className:"tribe-editor__rsvp__advanced-options-header-text"},Object(i.__)("Advanced Options","event-tickets")))},n.getRows=function(){return[{accordionId:n.accordionId,content:n.getContent(),contentClassName:"tribe-editor__rsvp__advanced-options-content",header:n.getHeader(),headerAttrs:{disabled:n.props.isDisabled},headerClassName:"tribe-editor__rsvp__advanced-options-header"}]},n.accordionId=Re()(),n}return fe()(t,e),_e()(t,[{key:"render",value:function(){return wp.element.createElement(ge.Accordion,{className:"tribe-editor__rsvp__advanced-options",rows:this.getRows()})}}]),t}(c.PureComponent));ut.propTypes={isDisabled:_.a.bool.isRequired,hasBeenCreated:_.a.bool,clientId:_.a.string};var dt=ut,_t=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)},lt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isDisabled:_t(e),hasBeenCreated:De.d.getRSVPCreated(e)}})))(dt),mt=(n(500),Object(i.__)("+ Add","event-tickets")),pt=Object(i.__)("Edit","event-tickets"),ft=function(e){var t=e.attendeeRegistrationURL,n=e.hasAttendeeInfoFields,r=e.isCreated,a=e.isDisabled,o=e.isModalOpen,s=e.onClick,c=e.onClose,u=e.onIframeLoad,d=n?pt:mt;return wp.element.createElement(be.AttendeesRegistration,{helperText:Object(i.__)("Save your RSVP to enable attendee information fields","event-tickets"),iframeURL:t,isDisabled:a,isModalOpen:o,label:Object(i.__)("Attendee Information","event-tickets"),linkText:d,modalTitle:Object(i.__)("Attendee Information","event-tickets"),onClick:s,onClose:c,onIframeLoad:u,showHelperText:!r})};ft.propTypes={attendeeRegistrationURL:_.a.string.isRequired,hasAttendeeInfoFields:_.a.bool.isRequired,isCreated:_.a.bool.isRequired,isDisabled:_.a.bool.isRequired,isModalOpen:_.a.bool.isRequired,onClick:_.a.func.isRequired,onClose:_.a.func.isRequired,onIframeLoad:_.a.func.isRequired};var Tt=ft,ht=function(e){return Be.globals.adminUrl()+"edit.php?post_type="+Object(se.select)("core/editor").getCurrentPostType()+"&page=attendee-registration&ticket_id="+De.d.getRSVPId(e)+"&tribe_events_modal=1"},yt=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)||!De.d.getRSVPCreated(e)},bt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{attendeeRegistrationURL:ht(e),hasAttendeeInfoFields:De.d.getRSVPHasAttendeeInfoFields(e),isCreated:De.d.getRSVPCreated(e),isDisabled:yt(e),isModalOpen:De.d.getRSVPIsModalOpen(e)}}),(function(e,t){return{onClick:function(){e(De.a.setRSVPIsModalOpen(!0))},onClose:function(n){n.target.classList.contains("components-modal__content")||e(De.a.setRSVPIsModalOpen(t.clientId,!1))},onIframeLoad:function(t){var n=t.contentWindow,r=function(){t.nextSibling.classList.add("tribe-editor__attendee-registration__modal-overlay--show")},a=n.document.querySelector("#event-tickets-attendee-information");a.addEventListener("submit",r);var i=function(){n.removeEventListener("unload",o),a.removeEventListener("submit",r)},o=function(){i();var t=n.document.querySelector("#tribe-tickets-attendee-sortables"),r=Boolean(t.firstElementChild);e(De.a.setRSVPHasAttendeeInfoFields(r)),e(De.a.setRSVPIsModalOpen(!1))};n.addEventListener("unload",o);var s=n.document.querySelector(".tribe-intro > a");s&&s.setAttribute("target","_blank")}}})))(Tt),Mt=(n(501),function(){return wp.element.createElement("div",{className:"tribe-editor__rsvp-container-content__labels"},wp.element.createElement("span",{className:"tribe-editor__rsvp-container-content__capacity-label"},Object(i.__)("RSVP Capacity","event-tickets")),wp.element.createElement("span",{className:"tribe-editor__rsvp-container-content__capacity-label-help"},Object(i.__)("Leave blank if unlimited","event-tickets")))}),St=function(e){var t=e.capacityId,n=e.isDisabled,r=e.notGoingId,a=e.onTempCapacityChange,o=e.onTempNotGoingResponsesChange,s=e.tempCapacity,c=e.tempNotGoingResponses;return wp.element.createElement("div",{className:"tribe-editor__rsvp-container-content__options"},wp.element.createElement(ge.NumberInput,{className:"tribe-editor__rsvp-container-content__capacity-input",disabled:n,id:t,min:0,onChange:a,value:s}),wp.element.createElement(ge.Checkbox,{checked:c,className:"tribe-editor__rsvp-container-content__not-going-responses",disabled:n,id:r,label:Object(i.__)('Enable "Not Going" responses',"event-tickets"),onChange:o}))};St.propTypes={capacityId:_.a.string.isRequired,isDisabled:_.a.bool.isRequired,notGoingId:_.a.string.isRequired,onTempCapacityChange:_.a.func.isRequired,onTempNotGoingResponsesChange:_.a.func.isRequired,tempCapacity:_.a.string.isRequired,tempNotGoingResponses:_.a.bool.isRequired};var Et=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.capacityId=Re()(),n.notGoingId=Re()(),n}return fe()(t,e),_e()(t,[{key:"render",value:function(){var e=this.props,t=e.isDisabled,n=e.onTempCapacityChange,r=e.onTempNotGoingResponsesChange,a=e.tempCapacity,i=e.tempNotGoingResponses,o=e.clientId,s={capacityId:this.capacityId,isDisabled:t,notGoingId:this.notGoingId,onTempCapacityChange:n,onTempNotGoingResponsesChange:r,tempCapacity:a,tempNotGoingResponses:i};return wp.element.createElement(c.Fragment,null,wp.element.createElement(Mt,null),wp.element.createElement(St,s),wp.element.createElement(lt,{clientId:o}),this.props.hasTicketsPlus&&wp.element.createElement(bt,null))}}]),t}(c.PureComponent);Et.propTypes={clientId:_.a.string,hasTicketsPlus:_.a.bool,onTempCapacityChange:_.a.func,onTempNotGoingResponsesChange:_.a.func,tempCapacity:_.a.string,tempNotGoingResponses:_.a.bool};var gt=Et,vt=n(31),kt=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)},Dt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),isDisabled:kt(e),tempCapacity:De.d.getRSVPTempCapacity(e),tempNotGoingResponses:De.d.getRSVPTempNotGoingResponses(e)}}),(function(e){return{onTempCapacityChange:function(t){e(De.a.setRSVPTempCapacity(t.target.value)),e(De.a.setRSVPHasChanges(!0))},onTempNotGoingResponsesChange:function(t){e(De.a.setRSVPTempNotGoingResponses(t.target.checked)),e(De.a.setRSVPHasChanges(!0))}}})))(gt),Lt=(n(502),function(e){var t=e.isDisabled;return wp.element.createElement(c.Fragment,null,t?wp.element.createElement(o.RSVPInactive,null):wp.element.createElement(o.RSVPActive,null),wp.element.createElement("span",{className:"tribe-editor__rsvp-container__icon-label"},Object(i.__)("RSVP","event-tickets")))});Lt.propTypes={isDisabled:_.a.bool.isRequired};var Ot=function(e){var t=e.isDisabled,n=e.isSelected,r=e.clientId;return wp.element.createElement(be.ContainerPanel,{className:he()("tribe-editor__rsvp-container",{"tribe-editor__rsvp-container--disabled":t}),layout:Me.a.rsvp,icon:wp.element.createElement(Lt,{isDisabled:t}),header:wp.element.createElement(Ce,{isSelected:n}),content:wp.element.createElement(Dt,{clientId:r})})};Ot.propTypes={isDisabled:_.a.bool.isRequired,isSelected:_.a.bool.isRequired,clientId:_.a.string.isRequired};var Yt=Ot,wt=function(e){return De.d.getRSVPIsLoading(e)||De.d.getRSVPSettingsOpen(e)},jt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isDisabled:wt(e)}})))(Yt),It=function(e){var t=e.href,n=e.isDisabled;return wp.element.createElement(be.ActionButton,{asLink:!0,className:"tribe-editor__rsvp__action-button tribe-editor__rsvp__action-button--attendees",disabled:n,href:t,icon:wp.element.createElement(o.Attendees,null),target:"_blank"},Object(i.__)("Attendees","event-tickets"))};It.propTypes={href:_.a.string,isDisabled:_.a.bool};var Pt=It,Ct=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{href:Be.globals.adminUrl()+"edit.php?post_type="+Object(se.select)("core/editor").getCurrentPostType()+"&page=tickets-attendees&event_id="+Object(se.select)("core/editor").getCurrentPostId(),isDisabled:De.d.getRSVPIsLoading(e)}})))(Pt),xt=n(53),Rt=function(e){var t=e.isDisabled,n=e.onClick;return wp.element.createElement(be.ActionButton,{className:"tribe-editor__rsvp__action-button tribe-editor__rsvp__action-button--settings",disabled:t,icon:wp.element.createElement(Ye.Cog,null),onClick:n},Object(i.__)("Settings","event-tickets"))};Rt.defaultProps={onClick:n.n(xt).a},Rt.propTypes={isDisabled:_.a.bool,onClick:_.a.func};var At=Rt,Ht=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isDisabled:De.d.getRSVPIsLoading(e)}}),(function(e){return{onClick:function(){return e(De.a.setRSVPSettingsOpen(!0))}}})))(At),Nt=(n(503),function(e){return e?Object(i.__)("Update RSVP","event-tickets"):Object(i.__)("Create RSVP","event-tickets")}),Vt=Object(i.__)("Cancel","event-tickets"),Ft=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onWarningClick=function(){n.setState({isWarningOpen:!n.state.isWarningOpen})},n.getActions=function(){var e=n.props,t=e.created,r=(e.hasTicketsPlus,e.hasRecurrenceRules),a=e.isLoading,o=[wp.element.createElement(Ht,null)];if(t&&o.push(wp.element.createElement(Ct,null)),r){var s=n.state.isWarningOpen?"no":"info-outline",c=n.state.isWarningOpen?Object(i.__)("Hide Warning","event-tickets"):Object(i.__)("Warning","event-tickets");o.push(wp.element.createElement(be.WarningButton,{icon:s,onClick:n.onWarningClick,isDisabled:a},c))}return o},n.state={isWarningOpen:!1},n}return fe()(t,e),_e()(t,[{key:"render",value:function(){var e=this.props,t=e.created,n=e.isCancelDisabled,r=e.isConfirmDisabled,a=e.onCancelClick,o=e.onConfirmClick,s=e.showCancel;return wp.element.createElement(c.Fragment,null,wp.element.createElement(be.ActionDashboard,{className:"tribe-editor__rsvp__action-dashboard",actions:this.getActions(),cancelLabel:Vt,confirmLabel:Nt(t),isCancelDisabled:n,isConfirmDisabled:r,onCancelClick:a,onConfirmClick:o,showCancel:s}),this.state.isWarningOpen&&wp.element.createElement("div",{className:"tribe-editor__rsvp__warning"},Object(i.__)("This is a recurring event. If you add tickets they will only show up on the next upcoming event in the recurrence pattern. The same ticket form will appear across all events in the series. Please configure your events accordingly.","event-tickets")))}}]),t}(c.PureComponent);Ft.propTypes={created:_.a.bool.isRequired,hasTicketsPlus:_.a.bool.isRequired,hasRecurrenceRules:_.a.bool.isRequired,isCancelDisabled:_.a.bool.isRequired,isConfirmDisabled:_.a.bool.isRequired,isLoading:_.a.bool.isRequired,onCancelClick:_.a.func.isRequired,onConfirmClick:_.a.func.isRequired,showCancel:_.a.bool.isRequired};var Kt=Ft,Wt=function(e){var t=!1;try{t=window.tribe[vt.plugins.constants.EVENTS_PRO_PLUGIN].data.blocks.recurring.selectors.hasRules(e)}catch(e){}return t},Ut=function(e){return!De.d.getRSVPTempTitle(e)||!De.d.getRSVPHasChanges(e)||De.d.getRSVPIsLoading(e)||De.d.getRSVPHasDurationError(e)},zt=function(e,t){return function(){t(De.a.setRSVPTempDetails({tempTitle:De.d.getRSVPTitle(e),tempDescription:De.d.getRSVPDescription(e),tempCapacity:De.d.getRSVPCapacity(e),tempNotGoingResponses:De.d.getRSVPNotGoingResponses(e),tempStartDate:De.d.getRSVPStartDate(e),tempStartDateInput:De.d.getRSVPStartDateInput(e),tempStartDateMoment:De.d.getRSVPStartDateMoment(e),tempEndDate:De.d.getRSVPEndDate(e),tempEndDateInput:De.d.getRSVPEndDateInput(e),tempEndDateMoment:De.d.getRSVPEndDateMoment(e),tempStartTime:De.d.getRSVPStartTime(e),tempEndTime:De.d.getRSVPEndTime(e),tempStartTimeInput:De.d.getRSVPStartTimeInput(e),tempEndTimeInput:De.d.getRSVPEndTimeInput(e)})),t(De.a.setRSVPHasChanges(!1)),Object(se.dispatch)("core/editor").clearSelectedBlock()}},Gt=function(e,t){return function(){var n={title:De.d.getRSVPTempTitle(e),description:De.d.getRSVPTempDescription(e),capacity:De.d.getRSVPTempCapacity(e),notGoingResponses:De.d.getRSVPTempNotGoingResponses(e),startDate:De.d.getRSVPTempStartDate(e),startDateInput:De.d.getRSVPTempStartDateInput(e),startDateMoment:De.d.getRSVPTempStartDateMoment(e),endDate:De.d.getRSVPTempEndDate(e),endDateInput:De.d.getRSVPTempEndDateInput(e),endDateMoment:De.d.getRSVPTempEndDateMoment(e),startTime:De.d.getRSVPTempStartTime(e),endTime:De.d.getRSVPTempEndTime(e),startTimeInput:De.d.getRSVPTempStartTimeInput(e),endTimeInput:De.d.getRSVPTempEndTimeInput(e)};De.d.getRSVPCreated(e)?t(De.e.updateRSVP(Ke()({},n,{id:De.d.getRSVPId(e)}))):t(De.e.createRSVP(Ke()({},n,{postId:Object(se.select)("core/editor").getCurrentPostId()})))}},Bt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{created:De.d.getRSVPCreated(e),hasRecurrenceRules:Wt(e),hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),isCancelDisabled:De.d.getRSVPIsLoading(e),isConfirmDisabled:Ut(e),isLoading:De.d.getRSVPIsLoading(e),showCancel:De.d.getRSVPCreated(e),state:e}}),null,(function(e,t,n){var r=e.state,a=Ue()(e,["state"]),i=t.dispatch;return Ke()({},n,a,{onCancelClick:zt(r,i),onConfirmClick:Gt(r,i)})})))(Kt),qt=(n(504),function(e){var t=e.image,n=e.isSettingsLoading,r=e.onRemove,a=e.onSelect,o={title:Object(i.__)("Ticket Header Image","event-tickets"),description:Object(i.__)("Select an image from your Media Library to display on emailed tickets and RSVPs. For best results, use a .jpg, .png, or .gif at least 1160px wide.","event-tickets"),className:"tribe-editor__rsvp__image-upload",buttonDisabled:n,buttonLabel:Object(i.__)("Upload Image","event-tickets"),image:t,onRemove:r,onSelect:a,removeButtonDisabled:n};return wp.element.createElement(ge.ImageUpload,o)});qt.propTypes={image:_.a.shape({alt:_.a.string.isRequired,id:_.a.number.isRequired,src:_.a.string.isRequired}).isRequired,isSettingsLoading:_.a.bool.isRequired,onRemove:_.a.func.isRequired,onSelect:_.a.func.isRequired};var Jt=qt,$t=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{image:{id:De.d.getRSVPHeaderImageId(e),alt:De.d.getRSVPHeaderImageAlt(e),src:De.d.getRSVPHeaderImageSrc(e)},isSettingsLoading:De.d.getRSVPIsSettingsLoading(e)}}),(function(e){return{onSelect:function(t){return e(De.a.updateRSVPHeaderImage(t))},onRemove:function(){return e(De.a.deleteRSVPHeaderImage())}}})))(Jt),Zt=(n(505),function(e){var t=e.isSettingsLoading,n=e.onCloseClick;return wp.element.createElement(be.SettingsDashboard,{className:he()("tribe-editor__rsvp__settings-dashboard",{"tribe-editor__rsvp__settings-dashboard--loading":t}),closeButtonDisabled:t,content:wp.element.createElement(c.Fragment,null,wp.element.createElement($t,null),t&&wp.element.createElement(ye.Spinner,null)),onCloseClick:n})});Zt.propTypes={isSettingsLoading:_.a.bool.isRequired,onCloseClick:_.a.func.isRequired};var Qt=Zt,Xt=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isSettingsLoading:De.d.getRSVPIsSettingsLoading(e)}}),(function(e){return{onCloseClick:function(){return e(De.a.setRSVPSettingsOpen(!1))}}})))(Qt),en=function(e){var t=e.isSelected,n=e.isSettingsOpen;return t?n?wp.element.createElement(Xt,null):wp.element.createElement(Bt,null):null};en.propTypes={isSelected:_.a.bool.isRequired,isSettingsOpen:_.a.bool.isRequired};var tn=en,nn=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isSettingsOpen:De.d.getRSVPSettingsOpen(e)}})))(tn),rn=n(95),an={className:"tribe-editor__rsvp__inactive-block",icon:wp.element.createElement(o.RSVPInactive,null),layout:rn.a.rsvp},on=function(e){var t=e.created;return an.title=t?Object(i.__)("RSVP is not currently active","event-tickets"):Object(i.__)("There is no RSVP configured","event-tickets"),an.description=t?Object(i.__)("Edit this block to change RSVP settings.","event-tickets"):Object(i.__)("Edit this block to create an RSVP form.","event-tickets"),wp.element.createElement(rn.b,an)};on.propTypes={created:_.a.bool.isRequired};var sn=on,cn=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{created:De.d.getRSVPCreated(e)}})))(sn),un=n(28),dn=n(19),_n=(n(506),function(e){function t(){var e,n,r,a;ue()(this,t);for(var o=arguments.length,s=Array(o),c=0;c<o;c++)s[c]=arguments[c];return n=r=me()(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.renderPostTypes=function(){return r.props.isFetchingPosts?wp.element.createElement(ye.Spinner,null):r.props.postOptions.length?wp.element.createElement(ye.MenuGroup,null,wp.element.createElement(ye.MenuItemsChoice,{choices:r.props.postOptions,value:r.props.postValue,onSelect:r.props.onPostSelect})):wp.element.createElement(ye.Notice,{isDismissible:!1,status:"warning"},Object(i.__)("No posts found","event-tickets"))},a=n,me()(r,a)}return fe()(t,e),_e()(t,[{key:"componentDidMount",value:function(){this.props.initialize()}},{key:"render",value:function(){return wp.element.createElement(ye.Modal,{title:this.props.title,onRequestClose:this.props.hideModal,className:"tribe-editor__tickets__move-modal"},wp.element.createElement("label",{htmlFor:"post_type"},Object(i.__)("You can optionally focus on a specific post type:","event-tickets")),wp.element.createElement(ge.Select,{id:"post_type",options:this.props.postTypeOptions,onChange:this.props.onPostTypeChange,value:this.props.postTypeOptionValue}),wp.element.createElement("label",{htmlFor:"search"},Object(i.__)("You can also enter keywords to help find the target event by title or description","event-tickets")),wp.element.createElement(ge.Input,{id:"search",type:"text",onChange:this.props.onSearchChange,value:this.props.search}),wp.element.createElement("label",null,Object(i.__)("Select the post you wish to move the ticket type to:","event-tickets")),this.renderPostTypes(),wp.element.createElement("footer",null,wp.element.createElement(ye.Button,{isLarge:!0,isPrimary:!0,isBusy:this.props.isModalSubmitting,disabled:!this.props.hasSelectedPost||this.props.isFetchingPosts,onClick:this.props.onSubmit},Object(i.__)("Finish!","event-tickets"))))}}]),t}(c.PureComponent));_n.propTypes={hasSelectedPost:_.a.bool.isRequired,hideModal:_.a.func.isRequired,initialize:_.a.func.isRequired,isFetchingPosts:_.a.bool.isRequired,isModalSubmitting:_.a.bool.isRequired,onPostSelect:_.a.func.isRequired,onPostTypeChange:_.a.func.isRequired,onSearchChange:_.a.func.isRequired,onSubmit:_.a.func.isRequired,postOptions:_.a.arrayOf(_.a.object),postTypeOptions:_.a.arrayOf(_.a.object),postTypeOptionValue:_.a.object,postValue:_.a.string.isRequired,search:_.a.string.isRequired,title:_.a.string.isRequired},_n.defaultProps={title:Object(i.__)("Move Ticket Types","event-tickets")};var ln=_n,mn=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{hasSelectedPost:un.i(e),isFetchingPosts:un.k(e),isFetchingPostTypes:un.j(e),isModalSubmitting:un.m(e),postOptions:un.f(e),postTypeOptions:un.h(e),postTypeOptionValue:un.g(e),postValue:un.d(e),search:un.c(e)}}),(function(e,t){return{initialize:function(){return e({type:dn.h})},hideModal:function(){return e(Object(st.a)())},onSearchChange:function(t){return e(Object(st.b)({search_terms:t.target.value}))},onPostTypeChange:function(t){return e(Object(st.b)({post_type:t.value}))},onPostSelect:function(t){return e(Object(st.b)({target_post_id:t}))},onSubmit:function(){return e({type:dn.o})}}})))(ln),pn=(n(507),function(e){function t(){return ue()(this,t),me()(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return fe()(t,e),_e()(t,[{key:"componentDidMount",value:function(){!this.props.rsvpId&&this.props.initializeRSVP()}},{key:"render",value:function(){var e=this.props,t=e.created,n=e.isInactive,r=e.isLoading,a=e.isSelected,i=e.clientId,o=e.isModalShowing;return wp.element.createElement(c.Fragment,null,!a&&(t&&n||!t)?wp.element.createElement(cn,null):wp.element.createElement("div",{className:he()("tribe-editor__rsvp",{"tribe-editor__rsvp--selected":a},{"tribe-editor__rsvp--loading":r})},wp.element.createElement(jt,{isSelected:a,clientId:i}),wp.element.createElement(nn,{isSelected:a}),r&&wp.element.createElement(ye.Spinner,null)),o&&wp.element.createElement(mn,null))}}]),t}(c.PureComponent));pn.propTypes={clientId:_.a.string.isRequired,created:_.a.bool.isRequired,initializeRSVP:_.a.func.isRequired,isInactive:_.a.bool.isRequired,isLoading:_.a.bool.isRequired,isModalShowing:_.a.bool.isRequired,isSelected:_.a.bool.isRequired,rsvpId:_.a.number.isRequired};var fn=pn,Tn=function(e){var t=De.d.getRSVPStartDateMoment(e),n=De.d.getRSVPStartTimeNoSeconds(e),r=De.d.getRSVPEndDateMoment(e),a=De.d.getRSVPEndTimeNoSeconds(e);if(!t||!r)return!1;var i=Be.moment.setTimeInSeconds(t.clone(),Be.time.toSeconds(n,Be.time.TIME_FORMAT_HH_MM)),o=Be.moment.setTimeInSeconds(r.clone(),Be.time.toSeconds(a,Be.time.TIME_FORMAT_HH_MM)),s=oe()();return!(s.isAfter(i)&&s.isBefore(o))},hn=function(e,t){return function(){var n=Object(se.select)("core/editor").getCurrentPostId();e(De.e.getRSVP(n));var r=t.attributes,a=void 0===r?{}:r;parseInt(a.headerImageId,10)&&e(De.a.fetchRSVPHeaderImage(a.headerImageId)),a.goingCount&&e(De.a.setRSVPGoingCount(parseInt(a.goingCount,10))),a.notGoingCount&&e(De.a.setRSVPNotGoingCount(parseInt(a.notGoingCount,10)))}},yn=Object(P.c)(Object(Le.withStore)(),ae((function(e){var t=De.d.getRSVPId(e);return{created:De.d.getRSVPCreated(e),isInactive:Tn(e),isLoading:De.d.getRSVPIsLoading(e),isModalShowing:Object(un.l)(e)&&Object(un.e)(e)===t,rsvpId:t}}),(function(e,t){return{initializeRSVP:function(){return e(De.a.initializeRSVP())},onBlockRemoved:function(){return e(De.a.deleteRSVP())},setInitialState:hn(e,t)}})),Object(Le.withSaveData)())(fn),bn=n(8),Mn={id:"rsvp",title:Object(i.__)("RSVP","event-tickets"),description:Object(i.__)("Find out who is planning to attend!","event-tickets"),icon:wp.element.createElement(o.RSVP,null),category:"tribe-tickets",keywords:["event","events-gutenberg","tribe"],supports:{html:!1,multiple:!1},attributes:{goingCount:{type:"integer",source:"meta",meta:bn.g},notGoingCount:{type:"integer",source:"meta",meta:bn.j},headerImageId:{type:"integer",source:"meta",meta:bn.i}},edit:yn,save:function(){return null}},Sn=n(96),En=function(e){var t=e.onClick;return wp.element.createElement(be.ActionButton,{icon:wp.element.createElement(Ye.Cog,null),onClick:t},Object(i.__)("Settings","event-tickets"))};En.propTypes={onClick:_.a.func};var gn=En,vn=n(6),kn=Object(P.c)(Object(Le.withStore)(),ae(null,(function(e){return{onClick:function(){return e(vn.a.openSettings())}}})))(gn),Dn=function(e){var t=e.href;return t?wp.element.createElement(be.ActionButton,{asLink:!0,href:t,icon:wp.element.createElement(o.Orders,null),target:"_blank"},Object(i.__)("Orders","event-tickets")):null};Dn.propTypes={href:_.a.string.isRequired};var Ln=Dn,On=Object(P.c)(Object(Le.withStore)(),ae((function(e){var t=Be.globals.adminUrl(),n=Object(se.select)("core/editor").getCurrentPostType(),r=Object(se.select)("core/editor").getCurrentPostId(),a=vn.f.getTicketsProvider(e),i=vn.b.TICKET_ORDERS_PAGE_SLUG[a];return{href:i?t+"edit.php?post_type="+n+"&page="+i+"&event_id="+r:""}})))(Ln),Yn=function(e){var t=e.href;return e.canCreateTickets&&wp.element.createElement(be.ActionButton,{asLink:!0,href:t,icon:wp.element.createElement(o.Attendees,null),target:"_blank"},Object(i.__)("Attendees","event-tickets"))};Yn.propTypes={href:_.a.string.isRequired,canCreateTickets:_.a.bool};var wn=Yn,jn=Object(P.c)(Object(Le.withStore)(),ae((function(){return{href:Be.globals.adminUrl()+"edit.php?post_type="+Object(se.select)("core/editor").getCurrentPostType()+"&page=tickets-attendees&event_id="+Object(se.select)("core/editor").getCurrentPostId(),canCreateTickets:vn.f.canCreateTickets()}})))(wn),In=(n(508),Object(i.__)("Add Tickets","event-tickets")),Pn=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onWarningClick=function(){n.setState({isWarningOpen:!n.state.isWarningOpen})},n.getActions=function(){var e=n.props,t=e.hasCreatedTickets,r=e.hasOrdersPage,a=e.hasRecurrenceRules,o=(e.hasTicketsPlus,[wp.element.createElement(kn,null)]);if(t&&(o.push(wp.element.createElement(jn,null)),r&&o.push(wp.element.createElement(On,null))),a){var s=n.state.isWarningOpen?"no":"info-outline",c=n.state.isWarningOpen?Object(i.__)("Hide Warning","event-tickets"):Object(i.__)("Warning","event-tickets");o.push(wp.element.createElement(be.WarningButton,{icon:s,onClick:n.onWarningClick},c))}return o},n.state={isWarningOpen:!1},n}return fe()(t,e),_e()(t,[{key:"render",value:function(){var e=this.props.onConfirmClick;return wp.element.createElement(c.Fragment,null,wp.element.createElement(be.ActionDashboard,{className:"tribe-editor__tickets__action-dashboard",actions:this.getActions(),confirmLabel:In,onConfirmClick:e,showCancel:!1}),this.state.isWarningOpen&&wp.element.createElement("div",{className:"tribe-editor__tickets__warning"},Object(i.__)("This is a recurring event. If you add tickets they will only show up on the next upcoming event in the recurrence pattern. The same ticket form will appear across all events in the series. Please configure your events accordingly.","event-tickets")))}}]),t}(c.PureComponent);Pn.propTypes={hasCreatedTickets:_.a.bool,hasOrdersPage:_.a.bool,hasRecurrenceRules:_.a.bool,hasTicketsPlus:_.a.bool,onConfirmClick:_.a.func};var Cn=Pn,xn=function(e){var t=!1;try{t=window.tribe[vt.plugins.constants.EVENTS_PRO_PLUGIN].data.blocks.recurring.selectors.hasRules(e)}catch(e){}return t},Rn=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){var n=vn.f.getTicketsProvider(e),a=vn.b.TICKET_ORDERS_PAGE_SLUG[n];return{hasCreatedTickets:vn.f.hasCreatedTickets(e),hasOrdersPage:Boolean(a),hasRecurrenceRules:xn(e),hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),onConfirmClick:function(){var e=t.clientId,n=Object(se.select)("core/editor").getBlockCount,a=Object(se.dispatch)("core/editor").insertBlock,i=n(e);a(Object(r.createBlock)("tribe/tickets-item",{}),i,e)}}})))(Cn),An=(n(509),function(e){var t=e.label,n=e.items,r=e.right;return wp.element.createElement("div",{className:"tribe-editor__tickets__capacity-row"},wp.element.createElement("span",{className:"tribe-editor__tickets__capacity-row-left"},t&&wp.element.createElement("span",{className:"tribe-editor__tickets__capacity-row-label"},t),n&&wp.element.createElement("span",{className:"tribe-editor__tickets__capacity-row-items"},n)),wp.element.createElement("span",{className:"tribe-editor__tickets__capacity-row-right"},r))});An.propTypes={label:_.a.string,items:_.a.string,right:_.a.node},An.defaultProps={label:"",items:"",right:""};var Hn=An,Nn=(n(510),function(e){var t=e.isSettingsLoading,n=e.independentCapacity,r=e.sharedCapacity,a=e.independentAndSharedCapacity,o=e.independentTicketItems,s=e.sharedTicketItems,c=e.onSharedCapacityChange,u=wp.element.createElement(ge.NumberInput,{onChange:c,value:r,disabled:t,min:0});return wp.element.createElement("div",{className:"tribe-editor__tickets__capacity-table"},wp.element.createElement("h3",{className:"tribe-editor__tickets__capacity-table-title"},Object(i.__)("Capacity","event-tickets")),wp.element.createElement(Hn,{label:Object(i.__)("Shared capacity","event-tickets"),items:s,right:u}),wp.element.createElement(Hn,{label:Object(i.__)("Independent capacity","event-tickets"),items:o,right:n}),wp.element.createElement(Hn,{label:Object(i.__)("Total Capacity","event-tickets"),right:a}))});Nn.propTypes={isSettingsLoading:_.a.bool,independentCapacity:_.a.number,sharedCapacity:_.a.string,independentAndSharedCapacity:_.a.number,independentTicketItems:_.a.string,sharedTicketItems:_.a.string,onSharedCapacityChange:_.a.func};var Vn=Nn,Fn=function(e){var t=e.filter((function(e){return e.details.title})).map((function(e){return e.details.title})).join(", ");return t?" ("+t+") ":""},Kn=function(e){var t=vn.f.getIndependentTickets(e);return Fn(t)},Wn=function(e){var t=vn.f.getSharedTickets(e);return Fn(t)},Un=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isSettingsLoading:vn.f.getTicketsIsSettingsLoading(e),independentCapacity:vn.f.getIndependentTicketsCapacity(e),sharedCapacity:vn.f.getTicketsSharedCapacity(e),independentAndSharedCapacity:vn.f.getIndependentAndSharedTicketsCapacity(e),independentTicketItems:Kn(e),sharedTicketItems:Wn(e)}}),(function(e){return{onSharedCapacityChange:function(t){e(vn.a.setTicketsSharedCapacity(t.target.value)),e(vn.a.setTicketsTempSharedCapacity(t.target.value))}}})))(Vn),zn=(n(511),function(e){var t=e.image,n=e.isSettingsLoading,r=e.onRemove,a=e.onSelect,o={title:Object(i.__)("Ticket Header Image","event-tickets"),description:Object(i.__)("Select an image from your Media Library to display on emailed tickets and RSVPs. For best results, use a .jpg, .png, or .gif at least 1160px wide.","event-tickets"),className:"tribe-editor__rsvp__image-upload",buttonDisabled:n,buttonLabel:Object(i.__)("Upload Image","event-tickets"),image:t,onRemove:r,onSelect:a,removeButtonDisabled:n};return wp.element.createElement(ge.ImageUpload,o)});zn.propTypes={image:_.a.shape({alt:_.a.string.isRequired,id:_.a.number.isRequired,src:_.a.string.isRequired}).isRequired,isSettingsLoading:_.a.bool.isRequired,onRemove:_.a.func.isRequired,onSelect:_.a.func.isRequired};var Gn=zn,Bn=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{image:{id:vn.f.getTicketsHeaderImageId(e),alt:vn.f.getTicketsHeaderImageAlt(e),src:vn.f.getTicketsHeaderImageSrc(e)},isSettingsLoading:vn.f.getTicketsIsSettingsLoading(e)}}),(function(e){return{onSelect:function(t){return e(vn.a.updateTicketsHeaderImage(t))},onRemove:function(){return e(vn.a.deleteTicketsHeaderImage())}}})))(Gn),qn=(n(512),function(e){var t=e.hasTicketsPlus,n=e.isSettingsLoading,r=e.onCloseClick;return wp.element.createElement(be.SettingsDashboard,{className:he()("tribe-editor__tickets__settings-dashboard",{"tribe-editor__tickets__settings-dashboard--loading":n}),closeButtonDisabled:n,content:wp.element.createElement(c.Fragment,null,t&&wp.element.createElement(Un,null),wp.element.createElement(Bn,null),n&&wp.element.createElement(ye.Spinner,null)),onCloseClick:r})});qn.propTypes={hasTicketsPlus:_.a.bool,isSettingsLoading:_.a.bool.isRequired,onCloseClick:_.a.func.isRequired};var Jn=qn,$n=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),isSettingsLoading:vn.f.getTicketsIsSettingsLoading(e)}}),(function(e){return{onCloseClick:function(){return e(vn.a.closeSettings())}}})))(Jn),Zn=function(e){var t=e.clientId,n=e.isSelected,r=e.isSettingsOpen;return n?r?wp.element.createElement($n,null):wp.element.createElement(Rn,{clientId:t}):null};Zn.propTypes={clientId:_.a.string,isSelected:_.a.bool,isSettingsOpen:_.a.bool};var Qn=Zn,Xn=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{isSettingsOpen:vn.f.getTicketsIsSettingsOpen(e)}})))(Qn),er=(n(513),function(e){var t=e.available,n=e.total,r=wp.element.createElement(be.NumericLabel,{className:he()("tribe-editor__tickets__availability-label","tribe-editor__tickets__availability-label--available","tribe-tooltip"),count:t,singular:Object(i.__)("%d ticket available","event-tickets"),plural:Object(i.__)("%d tickets available","event-tickets")}),a=wp.element.createElement(be.NumericLabel,{className:he()("tribe-editor__tickets__availability-label","tribe-editor__tickets__availability-label--total"),count:n,singular:Object(i.__)("%d total ticket","event-tickets"),plural:Object(i.__)("%d total tickets","event-tickets")});return wp.element.createElement("div",{className:"tribe-editor__tickets__availability"},wp.element.createElement("span",{class:"tribe-tooltip",title:Object(i.__)("Ticket availability is based on the lowest number of inventory, stock, and capacity.","event-tickets")},r,wp.element.createElement("span",{className:"dashicons dashicons-info"})),a)});er.propTypes={available:_.a.number,total:_.a.number};var tr=er,nr=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{total:vn.f.getIndependentAndSharedTicketsCapacity(e),available:vn.f.getIndependentAndSharedTicketsAvailable(e)}})))(tr),rr=(n(514),function(){return wp.element.createElement("div",{className:"tribe-editor__tickets__overlay"})}),ar=function(e){var t=e.allTicketsPast,n=e.canCreateTickets,r=e.hasCreatedTickets,a=e.hasOverlay,s=e.showAvailability,c=e.showInactiveBlock,u={title:"",description:""};n?r?u.title=t?Object(i.__)("Tickets are no longer available","event-tickets"):Object(i.__)("Tickets are not yet available","event-tickets"):(u.title=Object(i.__)("There are no tickets yet","event-tickets"),u.description=Object(i.__)("Edit this block to create your first ticket.","event-tickets")):(u.title=Object(i.__)("There is no ecommerce available","event-tickets"),u.description=Object(i.__)("To create tickets, you'll need to enable an ecommerce solution.","event-tickets"));var d=he()({"tribe-editor__tickets__inner-blocks":!0,"tribe-editor__tickets__inner-blocks--show":!c});return wp.element.createElement("div",{className:"tribe-editor__tickets__container"},wp.element.createElement("div",{className:d},wp.element.createElement(Sn.InnerBlocks,{allowedBlocks:["tribe/tickets-item"]})),c&&wp.element.createElement(be.InactiveBlock,{layout:rn.a.ticket,title:u.title,description:u.description,icon:wp.element.createElement(o.TicketInactive,null)}),s&&wp.element.createElement(nr,null),a&&wp.element.createElement(rr,null))};ar.propTypes={allTicketsPast:_.a.bool,canCreateTickets:_.a.bool,hasCreatedTickets:_.a.bool,hasOverlay:_.a.bool,showAvailability:_.a.bool,showInactiveBlock:_.a.bool};var ir=ar,or=function(e,t){return vn.f.getTicketsIsSettingsOpen(e)||!vn.f.hasATicketSelected(e)&&!t.isSelected},sr=function(e,t){var n=t.isSelected&&!vn.f.hasTickets(e),r=!(t.isSelected||vn.f.hasATicketSelected(e)||vn.f.hasCreatedTickets(e)&&vn.f.hasTicketOnSale(e));return n||r},cr=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{allTicketsPast:vn.f.allTicketsPast(e),canCreateTickets:vn.f.canCreateTickets(),hasCreatedTickets:vn.f.hasCreatedTickets(e),hasOverlay:or(e,t),showAvailability:t.isSelected&&vn.f.hasCreatedTickets(e),showInactiveBlock:sr(e,t)}})))(ir),ur=(n(515),Object(i.__)("It looks like you have multiple ecommerce plugins active. We recommend running only one at a time. However, if you need to run multiple, please select which one to use to sell tickets for this event. ","event-tickets")),dr=Object(i.__)("Note: adjusting this setting will only impact new tickets. Existing tickets will not change. We highly recommend that all tickets for one event use the same ecommerce plugin","event-tickets"),_r=function(e){var t=e.provider,n=e.onProviderChange,r=Ue()(e,["provider","onProviderChange"]);return wp.element.createElement("div",{className:"tribe-editor__tickets-control-container"},wp.element.createElement("input",Ke()({className:"tribe-editor__tickets-control__input tribe-editor__tickets-control__input--radio",type:"radio",id:t.class,name:t.class,onChange:n},r)),wp.element.createElement("label",{className:"tribe-editor__tickets-control__label",htmlFor:t.class},t.name))},lr=function(e){var t=e.hasMultipleProviders,n=e.providers,r=e.selectedProvider,a=e.onProviderChange;return t&&wp.element.createElement(Sn.InspectorControls,{key:"inspector"},wp.element.createElement(ye.PanelBody,{title:Object(i.__)("Tickets Settings","event-tickets")},wp.element.createElement(ye.PanelRow,null,wp.element.createElement("fieldset",{className:"tribe-editor__tickets-controls-provider"},wp.element.createElement("legend",null,Object(i.__)("Sell tickets using","event-tickets")),wp.element.createElement("p",null,ur,wp.element.createElement("em",null,dr)),n.map((function(e,t){return wp.element.createElement(_r,{key:"provider-option-"+(t+1),provider:e,onProviderChange:a,checked:r===e.class})}))))))};lr.propTypes={hasMultipleProviders:_.a.bool,providers:_.a.arrayOf(_.a.shape({name:_.a.string,class:_.a.string})),selectedProvider:_.a.string,onProviderChange:_.a.func};var mr=lr,pr=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{hasMultipleProviders:vn.f.hasMultipleTicketProviders(),providers:vn.f.getTicketProviders(),selectedProvider:vn.f.getTicketsProvider(e)}}),(function(e){return{onProviderChange:function(t){return e(vn.a.setTicketsProvider(t.target.name))}}})),Object(Le.withSaveData)())(mr),fr=(n(516),function(e){function t(){return ue()(this,t),me()(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return fe()(t,e),_e()(t,[{key:"componentDidMount",value:function(){this.props.onBlockUpdate(this.props.isSelected)}},{key:"componentDidUpdate",value:function(e){e.isSelected!==this.props.isSelected&&this.props.onBlockUpdate(this.props.isSelected)}},{key:"render",value:function(){var e=this.props,t=e.isSelected,n=e.canCreateTickets,r=e.isSettingsOpen,a=e.clientId;return wp.element.createElement("div",{className:he()("tribe-editor__tickets",{"tribe-editor__tickets--selected":t},{"tribe-editor__tickets--settings-open":r})},wp.element.createElement(cr,{isSelected:t}),n&&wp.element.createElement(Xn,{isSelected:t,clientId:a}),wp.element.createElement(pr,null))}}]),t}(c.PureComponent));fr.propTypes={canCreateTickets:_.a.bool,clientId:_.a.string,hasProviders:_.a.bool,header:_.a.string,isSelected:_.a.bool,isSettingsOpen:_.a.bool,onBlockUpdate:_.a.func};var Tr=fr,hr=Object(P.c)(Object(Le.withStore)(),ae((function(e){var t=vn.f.getTicketsHeaderImageId(e);return{header:t?""+t:"",hasProviders:vn.f.hasTicketProviders(),isSettingsOpen:vn.f.getTicketsIsSettingsOpen(e),provider:vn.f.getTicketsProvider(e),sharedCapacity:vn.f.getTicketsSharedCapacity(e),canCreateTickets:vn.f.canCreateTickets()}}),(function(e){return{setInitialState:function(t){e(vn.a.setTicketsInitialState(t))},onBlockUpdate:function(t){e(vn.a.setTicketsIsSelected(t))},onBlockRemoved:function(){e(vn.a.resetTicketsBlock())}}})),Object(Le.withSaveData)())(Tr),yr={id:"tickets",title:Object(i.__)("Tickets","event-tickets"),description:Object(i.__)("Sell tickets and register attendees.","event-tickets"),icon:wp.element.createElement(o.Tickets,null),category:"tribe-tickets",keywords:["event","events-gutenberg","tribe"],supports:{html:!1,multiple:!1},attributes:{sharedCapacity:{type:"string",source:"meta",meta:bn.d},header:{type:"string",source:"meta",meta:bn.i},provider:{type:"string",source:"meta",meta:bn.e},tickets:{type:"array",source:"meta",meta:bn.c}},edit:hr,save:function(){return wp.element.createElement("div",null,wp.element.createElement(Sn.InnerBlocks.Content,null))}},br=(n(517),n(518),function(e){var t=e.hasAttendeeInfoFields,n=e.isDisabled,r=e.isSelected,a=e.onTempTitleChange,o=e.tempTitle,s=e.title,u=t&&wp.element.createElement(ge.Tooltip,{labelClassName:"tribe-editor__ticket__container-header-clipboard-tooltip",label:wp.element.createElement(Ye.Clipboard,null),text:Object(i.__)("This ticket has Attendee Information Fields configured.","event-tickets")});return wp.element.createElement("div",{className:"tribe-editor__ticket__container-header-title"},r?wp.element.createElement(c.Fragment,null,wp.element.createElement(Ee.a,{className:"tribe-editor__ticket__container-header-title-input",value:o,placeholder:Object(i.__)("Ticket Type *","event-tickets"),onChange:a,disabled:n,required:!0}),u):wp.element.createElement(c.Fragment,null,wp.element.createElement("h3",{className:"tribe-editor__ticket__container-header-title-label"},s),u,wp.element.createElement(Ye.Pencil,null)))});br.propTypes={hasAttendeeInfoFields:_.a.bool,isDisabled:_.a.bool,isSelected:_.a.bool,onTempTitleChange:_.a.func,tempTitle:_.a.string,title:_.a.string};var Mr=br,Sr=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{hasAttendeeInfoFields:vn.f.getTicketHasAttendeeInfoFields(e,t),isDisabled:vn.f.isTicketDisabled(e,t),tempTitle:vn.f.getTicketTempTitle(e,t),title:vn.f.getTicketTitle(e,t)}}),(function(e,t){return{onTempTitleChange:function(n){var r=t.clientId;e(vn.a.setTicketTempTitle(r,n.target.value)),e(vn.a.setTicketHasChanges(r,!0))}}})))(Mr),Er=(n(519),function(e){var t=e.isDisabled,n=e.isSelected,r=e.onTempDescriptionChange,a=e.tempDescription,o=e.description;return n?wp.element.createElement(Ee.a,{className:"tribe-editor__ticket__container-header-description-input",value:a,placeholder:Object(i.__)("Description","event-tickets"),onChange:r,disabled:t}):wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-description"},o)});Er.propTypes={isDisabled:_.a.bool,isSelected:_.a.bool,onTempDescriptionChange:_.a.func,tempDescription:_.a.string,description:_.a.string};var gr=Er,vr=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),tempDescription:vn.f.getTicketTempDescription(e,t),description:vn.f.getTicketDescription(e,t)}}),(function(e,t){return{onTempDescriptionChange:function(n){var r=t.clientId;e(vn.a.setTicketTempDescription(r,n.target.value)),e(vn.a.setTicketHasChanges(r,!0))}}})))(gr),kr=n(23),Dr=(n(520),function(e){var t=e.isDisabled,n=e.currencyPosition,r=e.currencySymbol,a=e.onTempPriceChange,o=e.tempPrice;return wp.element.createElement(c.Fragment,null,n===kr.PREFIX&&wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-price-currency"},r),wp.element.createElement(Ee.a,{className:"tribe-editor__ticket__container-header-price-input",value:o,placeholder:Object(i.__)("0","event-tickets"),onChange:a,disabled:t,type:"number",min:"0"}),n===kr.SUFFIX&&wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-price-currency"},r))});Dr.propTypes={isDisabled:_.a.bool,currencyPosition:_.a.oneOf(kr.PRICE_POSITIONS),currencySymbol:_.a.string,onTempPriceChange:_.a.func,tempPrice:_.a.string};var Lr=function(e){var t=e.currencyPosition,n=e.currencySymbol,r=e.price;return wp.element.createElement(c.Fragment,null,t===kr.PREFIX&&wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-price-currency"},n),wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-price-value"},r),t===kr.SUFFIX&&wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-price-currency"},n))};Lr.propTypes={currencyPosition:_.a.oneOf(kr.PRICE_POSITIONS),currencySymbol:_.a.string,price:_.a.string};var Or=function(e){var t=e.isDisabled,n=e.isSelected,r=e.currencyPosition,a=e.currencySymbol,i=e.onTempPriceChange,o=e.tempPrice,s=e.price;return wp.element.createElement("div",{className:"tribe-editor__ticket__container-header-price"},n?wp.element.createElement(Dr,{currencyPosition:r,currencySymbol:a,onTempPriceChange:i,tempPrice:o,isDisabled:t}):wp.element.createElement(Lr,{currencyPosition:r,currencySymbol:a,price:s}))};Or.propTypes={isDisabled:_.a.bool,isSelected:_.a.bool,currencyPosition:_.a.oneOf(kr.PRICE_POSITIONS),currencySymbol:_.a.string,onTempPriceChange:_.a.func,tempPrice:_.a.string,price:_.a.string};var Yr=Or,wr=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),currencyPosition:vn.f.getTicketCurrencyPosition(e,t),currencySymbol:vn.f.getTicketCurrencySymbol(e,t),tempPrice:vn.f.getTicketTempPrice(e,t),price:vn.f.getTicketPrice(e,t)||"0"}}),(function(e,t){return{onTempPriceChange:function(n){var r=t.clientId;e(vn.a.setTicketTempPrice(r,n.target.value)),e(vn.a.setTicketHasChanges(r,!0))}}})))(Yr),jr=(n(521),function(e){var t=e.children,n=e.className,r=e.value,a=e.total;if(0===r||0===a)return null;var i=void 0;try{i=Be.number.percentage(r,a)}catch(e){i=0}var o={width:Math.max(0,Math.min(100,i)).toFixed(2)+"%"};return wp.element.createElement("span",{className:he()("tribe-editor__quantity-bar__bar",n),style:o},t)});jr.propTypes={children:_.a.node,className:_.a.oneOfType([_.a.string,_.a.arrayOf(_.a.string),Be.TribePropTypes.nullType]),value:_.a.number,total:_.a.number},jr.defaultProps={className:null,value:0,total:0};var Ir=jr,Pr=function(e){var t=e.sharedSold,n=e.sold,r=e.capacity,a=e.total,o=e.isDisabled;return wp.element.createElement("div",{className:"tribe-editor__quantity-bar"},!o&&wp.element.createElement(c.Fragment,null,wp.element.createElement(Ir,{className:"tribe-editor__quantity-bar__bar--shared-sold",value:t,total:a}),wp.element.createElement(Ir,{className:"tribe-editor__quantity-bar__bar--sold",value:n,total:a}),!!r&&!(r===a)&&wp.element.createElement(Ir,{className:"tribe-editor__quantity-bar__bar--capacity",value:r,total:a},wp.element.createElement("span",{className:"tribe-editor__quantity-bar__bar-label"},Object(i.__)("cap","event-tickets")))))};Pr.propTypes={sharedSold:_.a.number,capacity:_.a.number,sold:_.a.number,total:_.a.number,isDisabled:_.a.bool},Pr.defaultProps={sharedSold:0,capacity:0,sold:0,total:0,isDisabled:!1};var Cr=Pr,xr=(n(522),function(e){var t=e.isDisabled,n=e.isSelected,r=e.isShared,a=e.isUnlimited,o=e.sold,s=e.capacity,c=e.sharedSold,u=e.sharedCapacity,d=r?u:s;return!n&&wp.element.createElement("div",{className:"tribe-editor__ticket__container-header-quantity tribe-tooltip",title:Object(i.__)("This pertains to Orders that have been marked Completed.","event-tickets")},wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-quantity-label"},a?Object(i.sprintf)(Object(i.__)("%d sold","event-tickets"),o):Object(i.sprintf)(Object(i.__)("%d of %d sold","event-tickets"),o,d),wp.element.createElement("span",{class:"dashicons dashicons-info"})),a?wp.element.createElement("span",{className:"tribe-editor__ticket__container-header-quantity-unlimited"},Object(i.__)("unlimited","event-tickets")):wp.element.createElement(Cr,{sold:o,sharedSold:c,capacity:s,total:d,isDisabled:t}))});xr.propTypes={isDisabled:_.a.bool,isSelected:_.a.bool,isShared:_.a.bool,isUnlimited:_.a.bool,sold:_.a.number,capacity:_.a.number,sharedSold:_.a.number,sharedCapacity:_.a.number},xr.defaultProps={sold:0,sharedCapacity:0,capacity:0};var Rr=xr,Ar=function(e,t){return t?vn.f.getSharedTicketsSold(e):0},Hr=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){var n=vn.f.isSharedTicket(e,t);return{isDisabled:vn.f.isTicketDisabled(e,t),isShared:n,isUnlimited:vn.f.isUnlimitedTicket(e,t),sold:vn.f.getTicketSold(e,t),capacity:vn.f.getTicketCapacityInt(e,t),sharedSold:Ar(e,n),sharedCapacity:vn.f.getTicketsSharedCapacityInt(e)}})))(Rr),Nr=(n(523),function(e){var t=e.clientId,n=e.isSelected;return wp.element.createElement(c.Fragment,null,wp.element.createElement("div",{className:"tribe-editor__ticket__container-header-details"},wp.element.createElement(Sr,{clientId:t,isSelected:n}),wp.element.createElement(vr,{clientId:t,isSelected:n})),wp.element.createElement(wr,{clientId:t,isSelected:n}),wp.element.createElement(Hr,{clientId:t,isSelected:n}))});Nr.propTypes={clientId:_.a.string,isSelected:_.a.bool};var Vr=Nr,Fr=n(87),Kr=n.n(Fr),Wr=n(112),Ur=n.n(Wr),zr=n(490),Gr=(n(524),vn.b.INDEPENDENT),Br=vn.b.SHARED,qr=vn.b.TICKET_TYPES,Jr=vn.d.CAPACITY_TYPE_OPTIONS,$r=function(e){var t=e.className,n=e.id,r=e.label,a=Ue()(e,["className","id","label"]);return wp.element.createElement(ge.LabeledItem,{className:he()("tribe-editor__labeled-number-input",t),forId:n,label:r,isLabel:!0},wp.element.createElement(ge.NumberInput,a))};$r.propTypes={className:_.a.string,id:_.a.string,label:_.a.string};var Zr=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getInputs=function(){var e=n.props,t=e.isDisabled,r=e.sharedCapacity,a=e.tempCapacityType,o=e.tempCapacity,s=e.tempSharedCapacity,c=e.onTempCapacityChange,u=e.onTempSharedCapacityChange,d=[];if(a===qr[Br]&&""===r&&d.push(wp.element.createElement($r,{key:"shared-capacity",className:he()("tribe-editor__ticket__capacity-input-row","tribe-editor__ticket__capacity-input-row--shared-capacity"),id:n.ids.sharedCapacity,label:Object(i.__)("Set shared capacity:","event-tickets"),value:s,onChange:u,disabled:t,min:0,required:!0})),Ur()([qr[Br],qr[Gr]],a)){var _={},l=a===qr[Br]?Br:Gr;if(a===qr[Br]&&(r||s)){var m=r||s;_.max=parseInt(m,10)||0}a===qr[Gr]&&(_.required=!0),_.label=a===qr[Br]?Object(i.__)("(optional) Limit sales of this ticket to:","event-tickets"):Object(i.__)("Number of tickets available","event-tickets"),d.push(wp.element.createElement($r,Ke()({key:"capacity",className:he()("tribe-editor__ticket__capacity-input-row","tribe-editor__ticket__capacity-input-row--capacity","tribe-editor__ticket__capacity-input-row--capacity-"+l),id:n.ids.capacity,value:o,onChange:c,disabled:t,min:0},_)))}return d},n.getCapacityForm=function(){var e=n.props,t=e.isDisabled,r=e.tempCapacityTypeOption,a=e.onTempCapacityTypeChange;return wp.element.createElement(c.Fragment,null,wp.element.createElement(ge.Select,{id:n.ids.select,className:"tribe-editor__ticket__capacity-type-select",backspaceRemovesValue:!1,value:r,isSearchable:!1,isDisabled:t,options:Jr,onChange:a}),n.getInputs())},n.getNoPlusCapacityForm=function(){var e=n.props,t=e.isDisabled,r=e.tempCapacity,a=e.onTempCapacityNoPlusChange;return wp.element.createElement(c.Fragment,null,wp.element.createElement(ge.NumberInput,{className:"tribe-editor__ticket__capacity-input",id:n.ids.capacity,value:r,onChange:a,disabled:t,min:0}),wp.element.createElement("span",{className:"tribe-editor__ticket__capacity-input-helper-text"},Object(i.__)("Leave blank for unlimited","event-tickets")))},n.ids={select:Re()("capacity-type-"),capacity:Re()("capacity-"),sharedCapacity:Re()("shared-capacity-")},n}return fe()(t,e),_e()(t,[{key:"render",value:function(){var e=this.props.hasTicketsPlus;return wp.element.createElement("div",{className:he()("tribe-editor__ticket__capacity","tribe-editor__ticket__content-row","tribe-editor__ticket__content-row--capacity")},wp.element.createElement(be.LabelWithTooltip,{className:"tribe-editor__ticket__capacity-label-with-tooltip",forId:e?this.ids.select:this.ids.capacity,isLabel:!0,label:Object(i.__)("Ticket Capacity","event-tickets"),tooltipText:Object(i.__)("Ticket capacity will only be used by attendees buying this ticket type","event-tickets"),tooltipLabel:wp.element.createElement(ye.Dashicon,{className:"tribe-editor__ticket__tooltip-label",icon:"info-outline"})}),wp.element.createElement("div",{className:"tribe-editor__ticket__capacity-form"},e?this.getCapacityForm():this.getNoPlusCapacityForm()))}}]),t}(c.PureComponent);Zr.propTypes={hasTicketsPlus:_.a.bool,isDisabled:_.a.bool,sharedCapacity:_.a.string,tempCapacity:_.a.string,tempCapacityType:_.a.string,tempCapacityTypeOption:zr.ReactSelectOption,tempSharedCapacity:_.a.string,onTempCapacityChange:_.a.func,onTempCapacityNoPlusChange:_.a.func,onTempCapacityTypeChange:_.a.func,onTempSharedCapacityChange:_.a.func};var Qr=Zr,Xr=vn.b.UNLIMITED,ea=vn.b.INDEPENDENT,ta=vn.b.TICKET_TYPES,na=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),isDisabled:vn.f.isTicketDisabled(e,t),sharedCapacity:vn.f.getTicketsSharedCapacity(e),tempCapacity:vn.f.getTicketTempCapacity(e,t),tempCapacityType:vn.f.getTicketTempCapacityType(e,t),tempCapacityTypeOption:vn.f.getTicketTempCapacityTypeOption(e,t),tempSharedCapacity:vn.f.getTicketsTempSharedCapacity(e)}}),(function(e,t){var n=t.clientId;return{onTempCapacityChange:function(t){e(vn.a.setTicketTempCapacity(n,t.target.value)),e(vn.a.setTicketHasChanges(n,!0))},onTempCapacityNoPlusChange:function(t){var r=t.target.value,a=""===Kr()(r)?ta[Xr]:ta[ea];e(vn.a.setTicketTempCapacityType(n,a)),e(vn.a.setTicketTempCapacity(n,r)),e(vn.a.setTicketHasChanges(n,!0))},onTempCapacityTypeChange:function(t){e(vn.a.setTicketTempCapacityType(n,t.value)),e(vn.a.setTicketHasChanges(n,!0))},onTempSharedCapacityChange:function(t){e(vn.a.setTicketsTempSharedCapacity(t.target.value)),e(vn.a.setTicketHasChanges(n,!0))}}})))(Qr),ra=(n(525),n(526),function(e){var t=e.hasDurationError,n=Ue()(e,["hasDurationError"]);return wp.element.createElement("div",{className:he()("tribe-editor__ticket__duration","tribe-editor__ticket__content-row","tribe-editor__ticket__content-row--duration")},wp.element.createElement(be.LabelWithTooltip,{className:"tribe-editor__ticket__duration-label-with-tooltip",label:Object(i.__)("Sale Duration","event-tickets"),tooltipText:Object(i.__)("If you do not set a start sale date, tickets will be available immediately.","event-tickets"),tooltipLabel:wp.element.createElement(ye.Dashicon,{className:"tribe-editor__ticket__tooltip-label",icon:"info-outline"})}),wp.element.createElement(be.DateTimeRangePicker,Ke()({className:"tribe-editor__ticket__duration-picker"},n)),t&&wp.element.createElement("span",{className:"tribe-editor__ticket__duration-error"},Object(i.__)("There is an error with the selected sales duration. Please fix the issue before saving.","event-tickets")))});ra.propTypes={fromDate:_.a.instanceOf(Date),fromDateInput:_.a.string,fromDateDisabled:_.a.bool,fromTime:_.a.string,fromTimeDisabled:_.a.bool,hasDurationError:_.a.bool,onFromDateChange:_.a.func,onFromTimePickerBlur:_.a.func,onFromTimePickerChange:_.a.func,onFromTimePickerClick:_.a.func,onToDateChange:_.a.func,onToTimePickerBlur:_.a.func,onToTimePickerChange:_.a.func,onToTimePickerClick:_.a.func,toDate:_.a.instanceOf(Date),toDateInput:_.a.string,toDateDisabled:_.a.bool,toTime:_.a.string,toTimeDisabled:_.a.bool};var aa=ra,ia=function(e,t){return function(n,r,a){e(vn.a.handleTicketStartDate(t.clientId,n,a))}},oa=function(e,t){return function(n){e(vn.a.setTicketTempStartTimeInput(t.clientId,n.target.value))}},sa=function(e,t){return function(n,r){e(vn.a.handleTicketStartTime(t.clientId,n)),r()}},ca=function(e,t){return function(n,r,a){e(vn.a.handleTicketEndDate(t.clientId,n,a))}},ua=function(e,t){return function(n){e(vn.a.setTicketTempEndTimeInput(t.clientId,n.target.value))}},da=function(e,t){return function(n,r){e(vn.a.handleTicketEndTime(t.clientId,n)),r()}},_a=function(e,t,n){return function(r){var a=Be.moment.toMoment(r.target.value,Be.moment.TIME_FORMAT,!1);if(!a.isValid()){var i=vn.f.getTicketStartTimeInput(e,n);a=Be.moment.toMoment(i,Be.moment.TIME_FORMAT,!1)}var o=Be.moment.totalSeconds(a);t(vn.a.handleTicketStartTime(n.clientId,o))}},la=function(e,t,n){return function(r){var a=Be.moment.toMoment(r.target.value,Be.moment.TIME_FORMAT,!1);if(!a.isValid()){var i=vn.f.getTicketEndTimeInput(e,n);a=Be.moment.toMoment(i,Be.moment.TIME_FORMAT,!1)}var o=Be.moment.totalSeconds(a);t(vn.a.handleTicketEndTime(n.clientId,o))}},ma=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){var n=Be.globals.tecDateSettings().datepickerFormat?Be.moment.toFormat(Be.globals.tecDateSettings().datepickerFormat):"LL",r=vn.f.isTicketDisabled(e,t),a=vn.f.getTicketTempStartDateMoment(e,t),i=vn.f.getTicketTempEndDateMoment(e,t),o=a&&a.toDate(),s=i&&i.toDate();return{fromDate:o,fromDateInput:vn.f.getTicketTempStartDateInput(e,t),fromDateDisabled:r,fromDateFormat:n,fromTime:vn.f.getTicketTempStartTimeInput(e,t),fromTimeDisabled:r,hasDurationError:vn.f.getTicketHasDurationError(e,t),toDate:s,toDateInput:vn.f.getTicketTempEndDateInput(e,t),toDateDisabled:r,toDateFormat:n,toTime:vn.f.getTicketTempEndTimeInput(e,t),toTimeDisabled:r,state:e}}),(function(e,t){return{onFromDateChange:ia(e,t),onFromTimePickerChange:oa(e,t),onFromTimePickerClick:sa(e,t),onToDateChange:ca(e,t),onToTimePickerChange:ua(e,t),onToTimePickerClick:da(e,t),dispatch:e}}),(function(e,t,n){var r=e.state,a=Ue()(e,["state"]),i=t.dispatch,o=Ue()(t,["dispatch"]);return Ke()({},n,a,o,{onFromTimePickerBlur:_a(r,i,n),onToTimePickerBlur:la(r,i,n)})})))(aa),pa=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.id=Re()("ticket-sku"),n}return fe()(t,e),_e()(t,[{key:"render",value:function(){var e=this.props,t=e.sku,n=e.isDisabled,r=e.onChange;return wp.element.createElement("div",{className:he()("tribe-editor__ticket__sku","tribe-editor__ticket__content-row","tribe-editor__ticket__content-row--sku")},wp.element.createElement(be.LabelWithTooltip,{className:"tribe-editor__ticket__sku-label-with-tooltip",forId:this.id,isLabel:!0,label:Object(i.__)("Ticket SKU","event-tickets"),tooltipText:Object(i.__)("A unique identifying code for each ticket type you're selling","event-tickets"),tooltipLabel:wp.element.createElement(ye.Dashicon,{className:"tribe-editor__ticket__tooltip-label",icon:"info-outline"})}),wp.element.createElement(ge.Input,{className:"tribe-editor__ticket__sku-input",id:this.id,type:"text",value:t,onChange:r,disabled:n}))}}]),t}(c.PureComponent);pa.propTypes={isDisabled:_.a.bool,onChange:_.a.func.isRequired,sku:_.a.string};var fa=pa,Ta=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),sku:vn.f.getTicketTempSku(e,t)}}),(function(e,t){return{onChange:function(n){var r=t.clientId;e(vn.a.setTicketTempSku(r,n.target.value)),e(vn.a.setTicketHasChanges(r,!0))}}})))(fa),ha=n(262),ya=n.n(ha),ba=(n(527),vn.b.EDD),Ma=vn.b.WOO,Sa=vn.b.PROVIDER_TYPES,Ea=["edit-ticket","report"],ga=function(e){var t=e.editTicketLink,n=e.isDisabled,r=e.provider,a=e.reportLink,o=e.showEcommerceOptions,s=function(e){var o=he()("tribe-editor__ticket__ecommerce-options-link","tribe-editor__ticket__ecommerce-options-link--"+e),s="report"===e?a:t,c="report"===e?Object(i.__)("View Sales Report","event-tickets"):function(e){var t="";return e===ba?t=Object(i.__)("Edit Ticket in Easy Digital Downloads","event-tickets"):e===Ma&&(t=Object(i.__)("Edit Ticket in WooCommerce","event-tickets")),t}(r);return n?wp.element.createElement("span",{className:o},c):wp.element.createElement(ge.Link,{className:o,href:s,target:"_blank"},c)};return o&&wp.element.createElement(ge.LabeledItem,{className:he()("tribe-editor__ticket__ecommerce-options","tribe-editor__ticket__content-row","tribe-editor__ticket__content-row--ecommerce-options"),label:Object(i.__)("Ecommerce","event-tickets")},wp.element.createElement("div",{className:"tribe-editor__ticket__ecommerce-options-links"},Ea.map((function(e){return wp.element.createElement("span",{key:e,className:"tribe-editor__ticket__ecommerce-options-link-wrapper"},s(e))}))))};ga.propTypes={editTicketLink:_.a.string,isDisabled:_.a.bool,provider:_.a.oneOf([].concat(ya()(Sa),[""])),reportLink:_.a.string,showEcommerceOptions:_.a.bool};var va=ga,ka=vn.b.EDD,Da=vn.b.WOO,La=function(e){return Ur()([ka,Da],e)},Oa=function(e,t,n){var r="";La(n)&&(r=Be.globals.adminUrl()+"post.php?post="+vn.f.getTicketId(e,t)+"&action=edit");return r},Ya=function(e,t,n){var r="";if(La(n)){var a=Be.globals.adminUrl(),i=vn.f.getTicketId(e,t),o="";n===ka?o="edit.php?page=edd-reports&view=sales&post_type=download&tab=logs&download="+i:n===Da&&(o="admin.php?page=wc-reports&tab=orders&report=sales_by_product&product_ids="+i),r=""+a+o}return r},wa=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){var n=vn.f.getTicketProvider(e,t);return{isDisabled:vn.f.isTicketDisabled(e,t),provider:n,editTicketLink:Oa(e,t,n),reportLink:Ya(e,t,n),showEcommerceOptions:La(n)}})))(va),ja=(n(528),function(e){var t=e.moveTicket,n=e.removeTicket,r=e.isDisabled;return wp.element.createElement("div",{className:"tribe-editor__ticket__content-row--move-delete"},wp.element.createElement(ge.Button,{type:"button",onClick:t,disabled:r},Object(i.__)("Move Ticket","event-tickets")),wp.element.createElement(ge.Button,{type:"button",onClick:n,disabled:r},Object(i.__)("Remove Ticket","event-tickets")))});ja.propTypes={moveTicket:_.a.func.isRequired,removeTicket:_.a.func.isRequired,isDisabled:_.a.bool.isRequired};var Ia=ja,Pa=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),ticketId:vn.f.getTicketId(e,t)}}),(function(e,t){return{removeTicket:function(){e(vn.a.deleteTicket(t.clientId))},moveTicket:function(n){return e(Object(st.c)(n,t.clientId))}}}),(function(e,t,n){return Ke()({},e,t,n,{moveTicket:function(){return t.moveTicket(e.ticketId)}})})))(Ia),Ca=function(e){function t(e){ue()(this,t);var n=me()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getHeader=function(){return wp.element.createElement(c.Fragment,null,wp.element.createElement(ye.Dashicon,{className:"tribe-editor__ticket__advanced-options-header-icon",icon:"arrow-down"}),wp.element.createElement("span",{className:"tribe-editor__ticket__advanced-options-header-text"},Object(i.__)("Advanced Options","event-tickets")))},n.getContent=function(){return wp.element.createElement(c.Fragment,null,wp.element.createElement(ma,{clientId:n.props.clientId}),wp.element.createElement(Ta,{clientId:n.props.clientId}),wp.element.createElement(wa,{clientId:n.props.clientId}),n.props.hasBeenCreated&&wp.element.createElement(Pa,{clientId:n.props.clientId}))},n.getRows=function(){return[{accordionId:n.accordionId,content:n.getContent(),contentClassName:"tribe-editor__ticket__advanced-options-content",header:n.getHeader(),headerAttrs:{disabled:n.props.isDisabled},headerClassName:"tribe-editor__ticket__advanced-options-header"}]},n.accordionId=Re()(),n}return fe()(t,e),_e()(t,[{key:"render",value:function(){return wp.element.createElement(ge.Accordion,{className:"tribe-editor__ticket__advanced-options",rows:this.getRows()})}}]),t}(c.Component);Ca.propTypes={clientId:_.a.string.isRequired,isDisabled:_.a.bool,hasBeenCreated:_.a.bool};var xa=Ca,Ra=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),hasBeenCreated:vn.f.getTicketHasBeenCreated(e,t)}})))(xa),Aa=(n(529),Object(i.__)("+ Add","event-tickets")),Ha=Object(i.__)("Edit","event-tickets"),Na=function(e){var t=e.attendeeRegistrationURL,n=e.hasAttendeeInfoFields,r=e.isCreated,a=e.isDisabled,o=e.isModalOpen,s=e.onClick,c=e.onClose,u=e.onIframeLoad,d=n?Ha:Aa;return wp.element.createElement(be.AttendeesRegistration,{helperText:Object(i.__)("Save your ticket to enable attendee information fields","event-tickets"),iframeURL:t,isDisabled:a,isModalOpen:o,label:Object(i.__)("Attendee Information","event-tickets"),linkText:d,modalTitle:Object(i.__)("Attendee Information","event-tickets"),onClick:s,onClose:c,onIframeLoad:u,showHelperText:!r})};Na.propTypes={attendeeRegistrationURL:_.a.string.isRequired,hasAttendeeInfoFields:_.a.bool.isRequired,isCreated:_.a.bool.isRequired,isDisabled:_.a.bool.isRequired,isModalOpen:_.a.bool.isRequired,onClick:_.a.func.isRequired,onClose:_.a.func.isRequired,onIframeLoad:_.a.func.isRequired};var Va=Na,Fa=function(e,t){return Be.globals.adminUrl()+"edit.php?post_type="+Object(se.select)("core/editor").getCurrentPostType()+"&page=attendee-registration&ticket_id="+vn.f.getTicketId(e,t)+"&tribe_events_modal=1"},Ka=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){var n=vn.f.getTicketHasBeenCreated(e,t);return{attendeeRegistrationURL:Fa(e,t),hasAttendeeInfoFields:vn.f.getTicketHasAttendeeInfoFields(e,t),isCreated:n,isDisabled:vn.f.isTicketDisabled(e,t)||!n,isModalOpen:vn.f.getTicketIsModalOpen(e,t)}}),(function(e,t){return{onClick:function(){e(vn.a.setTicketIsModalOpen(t.clientId,!0))},onClose:function(n){n.target.classList.contains("components-modal__content")||e(vn.a.setTicketIsModalOpen(t.clientId,!1)),"click"===n.type&&n.target.classList.contains("components-modal__screen-overlay")&&e(vn.a.setTicketIsModalOpen(t.clientId,!1))},onIframeLoad:function(n){var r=n.contentWindow,a=function(){n.nextSibling.classList.add("tribe-editor__attendee-registration__modal-overlay--show")},i=r.document.querySelector("#event-tickets-attendee-information");i.addEventListener("submit",a);var o=function(){r.removeEventListener("unload",s),i.removeEventListener("submit",a)},s=function(){o();var n=r.document.querySelector("#tribe-tickets-attendee-sortables"),a=Boolean(n.firstElementChild);e(vn.a.setTicketHasAttendeeInfoFields(t.clientId,a)),e(vn.a.setTicketIsModalOpen(t.clientId,!1))};r.addEventListener("unload",s);var c=r.document.querySelector(".tribe-intro > a");c&&c.setAttribute("target","_blank")}}})))(Va),Wa=(n(530),function(e){var t=e.clientId,n=e.hasTicketsPlus;return wp.element.createElement(c.Fragment,null,wp.element.createElement(na,{clientId:t}),wp.element.createElement(Ra,{clientId:t}),n&&wp.element.createElement(Ka,{clientId:t}))});Wa.propTypes={clientId:_.a.string.isRequired,hasTicketsPlus:_.a.bool};var Ua=Wa,za=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS)}})))(Ua),Ga=function(e){return e.isDisabled?wp.element.createElement(o.ClockInactive,null):wp.element.createElement(o.ClockActive,null)},Ba=function(e){return e.isDisabled?wp.element.createElement(o.TicketInactive,null):wp.element.createElement(o.TicketActive,null)},qa=function(e){var t=e.isDisabled,n=e.isFuture,r=e.isPast;return n||r?wp.element.createElement(Ga,{isDisabled:t}):wp.element.createElement(Ba,{isDisabled:t})};qa.propTypes={isDisabled:_.a.bool.isRequired,isFuture:_.a.bool,isPast:_.a.bool};var Ja=function(e){var t=e.clientId,n=e.isDisabled,r=e.isFuture,a=e.isPast,i=e.isSelected;return wp.element.createElement(be.ContainerPanel,{className:"tribe-editor__ticket__container",layout:Me.a.ticket,icon:wp.element.createElement(qa,{isDisabled:n,isFuture:r,isPast:a}),header:wp.element.createElement(Vr,{clientId:t,isSelected:i}),content:wp.element.createElement(za,{clientId:t})})};Ja.propTypes={clientId:_.a.string.isRequired,isDisabled:_.a.bool,isFuture:_.a.bool,isPast:_.a.bool,isSelected:_.a.bool};var $a=Ja,Za=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{isDisabled:vn.f.isTicketDisabled(e,t),isFuture:vn.f.isTicketFuture(e,t),isPast:vn.f.isTicketPast(e,t)}})))($a),Qa=(n(531),function(e){return e?Object(i.__)("Update Ticket","event-tickets"):Object(i.__)("Create Ticket","event-tickets")}),Xa=Object(i.__)("Cancel","event-tickets"),ei=function(e){var t=e.hasBeenCreated,n=e.isCancelDisabled,r=e.isConfirmDisabled,a=e.onCancelClick,i=e.onConfirmClick;return wp.element.createElement(be.ActionDashboard,{className:"tribe-editor__ticket__dashboard",cancelLabel:Xa,confirmLabel:Qa(t),isCancelDisabled:n,isConfirmDisabled:r,onCancelClick:a,onConfirmClick:i})};ei.propTypes={hasBeenCreated:_.a.bool,isCancelDisabled:_.a.bool,isConfirmDisabled:_.a.bool,onCancelClick:_.a.func,onConfirmClick:_.a.func};var ti=ei,ni=function(e,t){return!vn.f.isTicketValid(e,t)||!vn.f.getTicketHasChanges(e,t)||vn.f.isTicketDisabled(e,t)||vn.f.getTicketHasDurationError(e,t)},ri=function(e,t,n){return function(){vn.f.getTicketHasBeenCreated(e,n)?(t(vn.a.setTicketTempDetails(n.clientId,{title:vn.f.getTicketTitle(e,n),description:vn.f.getTicketDescription(e,n),price:vn.f.getTicketPrice(e,n),sku:vn.f.getTicketSku(e,n),startDate:vn.f.getTicketStartDate(e,n),startDateInput:vn.f.getTicketStartDateInput(e,n),startDateMoment:vn.f.getTicketStartDateMoment(e,n),endDate:vn.f.getTicketEndDate(e,n),endDateInput:vn.f.getTicketEndDateInput(e,n),endDateMoment:vn.f.getTicketEndDateMoment(e,n),startTime:vn.f.getTicketStartTime(e,n),endTime:vn.f.getTicketEndTime(e,n),startTimeInput:vn.f.getTicketStartTimeInput(e,n),endTimeInput:vn.f.getTicketEndTimeInput(e,n),capacityType:vn.f.getTicketCapacityType(e,n),capacity:vn.f.getTicketCapacity(e,n)})),t(vn.a.setTicketsTempSharedCapacity(vn.f.getTicketsSharedCapacity(e))),t(vn.a.setTicketHasChanges(n.clientId,!1))):(t(vn.a.removeTicketBlock(n.clientId)),Object(se.dispatch)("core/editor").removeBlocks(n.clientId)),Object(se.dispatch)("core/editor").clearSelectedBlock()}},ai=function(e,t,n){return function(){return vn.f.getTicketHasBeenCreated(e,n)?t(vn.a.updateTicket(n.clientId)):t(vn.a.createNewTicket(n.clientId))}},ii=Object(P.c)(Object(Le.withStore)(),ae((function(e,t){return{hasBeenCreated:vn.f.getTicketHasBeenCreated(e,t),isCancelDisabled:vn.f.isTicketDisabled(e,t),isConfirmDisabled:ni(e,t),state:e}}),null,(function(e,t,n){var r=e.state,a=Ue()(e,["state"]),i=t.dispatch;return Ke()({},n,a,{onCancelClick:ri(r,i,n),onConfirmClick:ai(r,i,n)})})))(ti),oi=function(e){function t(){return ue()(this,t),me()(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return fe()(t,e),_e()(t,[{key:"componentDidMount",value:function(){this.props.onBlockUpdate(this.props.isSelected)}},{key:"componentDidUpdate",value:function(e){e.isSelected!==this.props.isSelected&&this.props.onBlockUpdate(this.props.isSelected)}},{key:"render",value:function(){var e=this.props,t=e.clientId,n=e.hasTicketsPlus,r=e.isDisabled,a=e.isLoading,i=e.isSelected,o=e.isModalShowing;return e.showTicket?wp.element.createElement(c.Fragment,null,wp.element.createElement("article",{className:he()("tribe-editor__ticket",{"tribe-editor__ticket--disabled":r},{"tribe-editor__ticket--selected":i},{"tribe-editor__ticket--has-tickets-plus":n})},wp.element.createElement(Za,{clientId:t,isSelected:i}),wp.element.createElement(ii,{clientId:t,isSelected:i}),a&&wp.element.createElement(ye.Spinner,null)),o&&wp.element.createElement(mn,null)):null}}]),t}(c.PureComponent);oi.propTypes={clientId:_.a.string.isRequired,hasTicketsPlus:_.a.bool,isDisabled:_.a.bool,isLoading:_.a.bool,isModalShowing:_.a.bool,isSelected:_.a.bool,onBlockUpdate:_.a.func,removeTicketBlock:_.a.func,showTicket:_.a.bool};var si=oi,ci=function(e,t){return vn.f.getTicketsIsSelected(e)||vn.f.hasATicketSelected(e)||vn.f.isTicketOnSale(e,t)},ui=Object(P.c)(Object(Le.withStore)({isolated:!0}),ae((function(e,t){return{hasTicketsPlus:vt.plugins.selectors.hasPlugin(e)(vt.plugins.constants.TICKETS_PLUS),hasBeenCreated:vn.f.getTicketHasBeenCreated(e,t),isDisabled:vn.f.isTicketDisabled(e,t),isLoading:vn.f.getTicketIsLoading(e,t),isModalShowing:Object(un.l)(e),modalTicketId:Object(un.e)(e),showTicket:ci(e,t),ticketId:vn.f.getTicketId(e,t)}}),(function(e,t){var n=t.clientId;return{onBlockUpdate:function(t){return e(vn.a.setTicketIsSelected(n,t))},setInitialState:function(t){e(vn.a.registerTicketBlock(n)),e(vn.a.setTicketInitialState(t))}}}),(function(e,t,n){return Ke()({},e,t,n,{isModalShowing:e.isModalShowing&&e.modalTicketId===e.ticketId})})),Object(Le.withSaveData)())(si),di={id:"tickets-item",title:Object(i.__)("Event Ticket","event-tickets"),description:Object(i.__)("A single configured ticket type.","event-tickets"),icon:wp.element.createElement(o.Tickets,null),category:"tribe-tickets",keywords:["event","event-tickets","tribe"],parent:["tribe/tickets"],supports:{html:!1},attributes:{hasBeenCreated:{type:"boolean",default:!1},ticketId:{type:"integer",default:0}},edit:ui,save:function(){return wp.element.createElement("div",null,wp.element.createElement(Sn.InnerBlocks.Content,null))}},_i=n(54),li=n(110),mi=(n(532),Object(i.__)("Who's Attending?","event-tickets")),pi=Object(i.__)("(X) people are attending this event","event-tickets"),fi=function(){return wp.element.createElement("div",{className:"tribe-editor__event-attendees__gravatars"},wp.element.createElement(o.AttendeesGravatar,null),wp.element.createElement(o.AttendeesGravatar,null),wp.element.createElement(o.AttendeesGravatar,null),wp.element.createElement(o.AttendeesGravatar,null),wp.element.createElement(o.AttendeesGravatar,null))},Ti=function(){return wp.element.createElement("div",{className:"tribe-editor__event-attendees__subtitle"},wp.element.createElement("p",null,pi))},hi=function(e){var t=e.isSelected,n=e.title,r=e.displayTitle,a=e.displaySubtitle,i=t||n?function(e){var t=e.isSelected,n=e.isEmpty,r=e.title,a=e.setTitle,i=he()({"tribe-editor__event-attendees__title":!0,"tribe-editor__event-attendees__title--selected":t}),o=he()({"tribe-editor__event-attendees__title-text":!0,"tribe-editor__event-attendees__title-text--empty":n&&t});return wp.element.createElement("div",{key:"tribe-events-attendees-label",className:i},wp.element.createElement(Ee.a,{id:"tribe-events-attendees-link",className:o,value:r,placeholder:mi,onChange:a}))}(e):wp.element.createElement("span",{className:he()(["tribe-editor__event-attendees__title","tribe-editor__event-attendees__title--placeholder"])},mi);return wp.element.createElement("div",{className:"tribe-editor__block tribe-editor__event-attendees"},r?i:"",a?wp.element.createElement(Ti,null):"",wp.element.createElement(fi,null))},yi=function(e){var t=e.isSelected,n=e.displayTitle,r=e.displaySubtitle,a=e.onSetDisplayTitleChange,o=e.onSetDisplaySubtitleChange;return t&&wp.element.createElement(Sn.InspectorControls,{key:"inspector"},wp.element.createElement(ye.PanelBody,{title:Object(i.__)("Attendees Settings","event-tickets")},wp.element.createElement(ye.ToggleControl,{label:Object(i.__)("Display Title","event-tickets"),checked:n,onChange:a}),wp.element.createElement(ye.ToggleControl,{label:Object(i.__)("Display Subtitle","event-tickets"),checked:r,onChange:o})))},bi=function(e){return wp.element.createElement(c.Fragment,null,wp.element.createElement(hi,e),wp.element.createElement(yi,e))};bi.propTypes={setTitle:_.a.func,title:_.a.string,isSelected:_.a.bool,isEmpty:_.a.bool,displayTitle:_.a.bool,displaySubtitle:_.a.bool,onSetDisplaySubtitleChange:_.a.func,onSetDisplayTitleChange:_.a.func};var Mi=bi,Si=Object(P.c)(Object(Le.withStore)(),ae((function(e){return{title:li.c(e),displayTitle:li.b(e),displaySubtitle:li.a(e)}}),(function(e){return{setInitialState:function(t){return e(_i.c(t))},setTitle:function(t){return e(_i.d(t.target.value))},onSetDisplayTitleChange:function(t){return e(_i.b(t))},onSetDisplaySubtitleChange:function(t){return e(_i.a(t))}}})),Object(Le.withSaveData)())(Mi),Ei=[Mn,yr,di,{id:"attendees",title:Object(i.__)("Attendee List","event-tickets"),description:Object(i.__)("Show the gravatars of people coming to this event.","event-tickets"),icon:wp.element.createElement(o.Attendees,null),category:"tribe-tickets",keywords:["event","events-gutenberg","tribe"],supports:{html:!1},attributes:{title:{type:"html",default:Object(i.__)("Who's Attending?","event-tickets")},displayTitle:{type:"boolean",default:!0},displaySubtitle:{type:"boolean",default:!0}},edit:Si,save:function(){return null}}];Ei.forEach((function(e){return Object(r.registerBlockType)("tribe/"+e.id,e)})),Object(a.initStore)();t.default=Ei}]);
src/resources/js/frontend-ticket-form.js CHANGED
@@ -477,7 +477,7 @@ tribe.tickets.block = {
477
  var new_value = ( -1 === max || max >= originalValue + step ) ? originalValue + step : max;
478
  var $parent = $input.closest( obj.selector.item );
479
 
480
- if ( 'true' === $parent.attr( 'data-shared-cap' ) ) {
481
  var $form = $parent.closest( 'form' );
482
  new_value = obj.checkSharedCapacity( $form, new_value );
483
  }
@@ -577,17 +577,16 @@ tribe.tickets.block = {
577
  obj.checkSharedCapacity = function ( $form, qty ) {
578
  var sharedCap = [];
579
  var currentLoad = [];
580
- var $sharedTickets = $form.find( obj.selector.item ).filter( '[data-shared-cap="true"]' );
581
- var $sharedCapFields = $sharedTickets.find( obj.selector.itemExtraAvailableQuantity );
582
  var $sharedCapTickets = $sharedTickets.find( obj.selector.itemQuantityInput );
583
 
584
  if ( ! $sharedTickets.length ) {
585
  return qty;
586
  }
587
 
588
- $sharedCapFields.each(
589
  function() {
590
- sharedCap.push( parseInt( $( this ).text(), 10 ) );
591
  }
592
  );
593
 
@@ -1583,7 +1582,7 @@ tribe.tickets.block = {
1583
  $this.val( max );
1584
  }
1585
 
1586
- if ( 'true' === $ticket.attr( 'data-shared-cap' ) ) {
1587
  var maxQty = obj.checkSharedCapacity( $form, new_quantity );
1588
  }
1589
 
477
  var new_value = ( -1 === max || max >= originalValue + step ) ? originalValue + step : max;
478
  var $parent = $input.closest( obj.selector.item );
479
 
480
+ if ( 'true' === $parent.attr( 'data-has-shared-cap' ) ) {
481
  var $form = $parent.closest( 'form' );
482
  new_value = obj.checkSharedCapacity( $form, new_value );
483
  }
577
  obj.checkSharedCapacity = function ( $form, qty ) {
578
  var sharedCap = [];
579
  var currentLoad = [];
580
+ var $sharedTickets = $form.find( obj.selector.item ).filter( '[data-has-shared-cap="true"]' );
 
581
  var $sharedCapTickets = $sharedTickets.find( obj.selector.itemQuantityInput );
582
 
583
  if ( ! $sharedTickets.length ) {
584
  return qty;
585
  }
586
 
587
+ $sharedTickets.each(
588
  function() {
589
+ sharedCap.push( parseInt( $( this ).attr( 'data-shared-cap' ), 10 ) );
590
  }
591
  );
592
 
1582
  $this.val( max );
1583
  }
1584
 
1585
+ if ( 'true' === $ticket.attr( 'data-has-shared-cap' ) ) {
1586
  var maxQty = obj.checkSharedCapacity( $form, new_quantity );
1587
  }
1588
 
src/resources/js/frontend-ticket-form.min.js CHANGED
@@ -1 +1 @@
1
- var tribe=tribe||{};tribe.tickets=tribe.tickets||{},tribe.dialogs=tribe.dialogs||{},tribe.dialogs.events=tribe.dialogs.events||{},tribe.tickets.block={num_attendees:0,event:{}},function(t,e,i){"use strict";e.selector={blockFooter:".tribe-tickets__footer",blockFooterAmount:".tribe-amount",blockFooterQuantity:".tribe-tickets__footer__quantity__number",blockSubmit:".tribe-tickets__submit",container:"#tribe-tickets",hidden:"tribe-common-a11y-hidden",item:".tribe-tickets__item",itemExtraAvailable:".tribe-tickets__item__extra__available",itemExtraAvailableQuantity:".tribe-tickets__item__extra__available__quantity",itemOptOut:".tribe-tickets-attendees-list-optout--wrapper",itemOptOutInput:"#tribe-tickets-attendees-list-optout-",itemPrice:".tribe-amount",itemQuantity:".tribe-tickets__item__quantity",itemQuantityInput:".tribe-tickets-quantity",loader:".tribe-common-c-loader",submit:".tribe-tickets__buy",ticketLoader:".tribe-tickets-loader__tickets-block",validationNotice:".tribe-tickets__notice--error",ticketInCartNotice:"#tribe-tickets__notice__tickets-in-cart"};var r=t(e.selector.container);0!==r.length&&(e.document=t(document),e.modalSelector={cartForm:".tribe-modal__wrapper--ar #tribe-modal__cart",container:".tribe-modal__wrapper--ar",form:"#tribe-tickets__modal-form",itemRemove:".tribe-tickets__item__remove",itemTotal:".tribe-tickets__item__total .tribe-amount",loader:".tribe-tickets-loader__modal",metaField:".ticket-meta",metaForm:".tribe-modal__wrapper--ar #tribe-modal__attendee_registration",metaItem:".tribe-ticket",submit:".tribe-block__tickets__item__attendee__fields__footer_submit"},e.commerceSelector={edd:"Tribe__Tickets_Plus__Commerce__EDD__Main",rsvp:"Tribe__Tickets__RSVP",tpp:"Tribe__Tickets__Commerce__PayPal__Main",Tribe__Tickets__Commerce__PayPal__Main:"tribe-commerce",Tribe__Tickets__RSVP:"rsvp",Tribe__Tickets_Plus__Commerce__EDD__Main:"edd",Tribe__Tickets_Plus__Commerce__WooCommerce__Main:"woo",tribe_eddticket:"Tribe__Tickets_Plus__Commerce__EDD__Main",tribe_tpp_attendees:"Tribe__Tickets__Commerce__PayPal__Main",tribe_wooticket:"Tribe__Tickets_Plus__Commerce__WooCommerce__Main",woo:"Tribe__Tickets_Plus__Commerce__WooCommerce__Main"},e.tribe_ticket_provider=r.data("provider"),e.postId=t(".status-publish").attr("id").replace("post-",""),e.init=function(){0<TribeTicketOptions.availability_check_interval&&e.checkAvailability(),TribeTicketOptions.ajax_preload_ticket_form&&(e.loaderShow(),e.initPrefill())},e.updateAvailability=function(i){Object.keys(i).forEach(function(r){var a=i[r].available,o=t(e.selector.item+"[data-ticket-id='"+r+"']");if(0===a){var c=i[r].unavailable_html;o.attr("available",!1),o.removeClass("instock"),o.removeClass("purchasable"),o.find(e.selector.itemQuantity).html(c),o.find(e.selector.itemExtraAvailable).html("")}1<a&&(o.find(e.selector.itemQuantityInput).attr({max:a}),o.find(e.selector.itemExtraAvailableQuantity).html(a))})},e.updateFooter=function(t){e.updateFooterCount(t),e.updateFooterAmount(t),t.find(".tribe-tickets__footer").addClass("tribe-tickets__footer--active")},e.updateFooterCount=function(i){var r=i.find(e.selector.blockFooter+" "+e.selector.blockFooterQuantity),a=0;if(i.find(e.selector.item+" "+e.selector.itemQuantityInput).each(function(){var e=parseInt(t(this).val(),10);e=isNaN(e)?0:e,a+=e}),i.hasClass("tribe-tickets")){var o=0>=a;t(e.selector.blockSubmit).prop("disabled",o)}0>a||r.text(a)},e.updateFooterAmount=function(i){var r=i.find(e.selector.blockFooter+" "+e.selector.blockFooterAmount),a=0;i.find(e.selector.item+" "+e.selector.itemQuantityInput).each(function(){var i=t(this).closest(e.selector.item).find(e.selector.itemPrice).first(),r=parseInt(t(this).val(),10);r=isNaN(r)?0:r;var o=i.text();o=e.cleanNumber(o),a+=o*r}),0>a||r.text(e.numberFormat(a))},e.updateFormTotals=function(i){i.find(e.selector.item).each(function(){var i=t(this),r=e.getQty(i),a=parseFloat(t(this).find(e.modalSelector.itemTotal).first().text().replace(",",""));"."===e.getCurrencyFormatting().thousands_sep&&(a=parseFloat(t(this).find(e.modalSelector.itemTotal).text().replace(/\./g,"").replace(",","."))),parseInt(r,10),a}),e.updateFooter(i),e.appendARFields(i)},e.updateItem=function(i,r,a){var o={};if(o.id=i,a){o.qty=e.getQty(a),o.price=e.getPrice(r),r.find(e.selector.itemQuantityInput).val(o.qty).trigger("change");var c=e.selector.itemOptOutInput+a.data("ticket-id");o.$optOut=t(c);var n=t(c+"-modal");o.$optOut.length&&o.$optOut.is(":checked")?n.val("1"):n.val("0")}else o.qty=e.getQty(r),o.price=e.getPrice(r);return e.updateTotal(o.qty,o.price,r),o},e.updateTotal=function(t,i,r){var a=(t*i).toFixed(e.getCurrencyFormatting().number_of_decimals);return r.find(e.modalSelector.itemTotal).text(e.numberFormat(a)),a},e.maybeShowNonMetaNotice=function(i){var r=0,a=0,o=i.find(e.selector.item).filter(function(i){return t(this).find(e.selector.itemQuantityInput).val()>0});if(o.length){o.each(function(){var i=t(this),o=i.closest(e.selector.item).data("ticket-id");t(e.modalSelector.metaForm).find('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+o+'"]').length?a+=e.getQty(i):r+=e.getQty(i)});var c=t(".tribe-tickets__notice--non-ar"),n=t(".tribe-tickets__item__attendee__fields__title");0<r&&0<a?(t("#tribe-tickets__non-ar-count").text(r),c.removeClass("tribe-common-a11y-hidden"),n.show()):(c.addClass("tribe-common-a11y-hidden"),n.hide())}},e.getRestEndpoint=function(){return TribeCartEndpoint.url},e.getTickets=function(){return t(e.selector.item).map(function(){return t(this).data("ticket-id")}).get()},e.maybeShowOptOut=function(t,i){if(t.has(e.selector.itemOptOut).length){var r=t.closest(e.selector.item).find(e.selector.itemOptOut);0<i?r.show():r.hide()}},e.appendARFields=function(i){i.find(e.selector.item).each(function(){var i=t(this);if(i.is(":visible")){var r=i.closest(e.selector.item).data("ticket-id"),a=t(e.modalSelector.metaForm).find('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+r+'"]');if(!a.length)return;var o=a.find(e.modalSelector.metaItem),c=e.getQty(i);if(0>=c)return a.removeClass("tribe-tickets--has-tickets"),void a.find(e.modalSelector.metaItem).remove();if(o.length>c){var n=o.length-c;a.find(".tribe-ticket:nth-last-child( -n+"+n+" )").remove()}else if(o.length<c){var s=window.wp.template("tribe-registration--"+r),l=0<o.length?o.length+1:1;a.addClass("tribe-tickets--has-tickets");for(var d=l;d<=c;d++){var m={attendee_id:d};a.append(s(m)),e.maybeHydrateAttendeeBlockFromLocal(o.length)}}}}),e.maybeShowNonMetaNotice(i),e.loaderHide(),e.document.trigger("tribe-ar-fields-appended")},e.stepUp=function(t,i){var r=t.attr("max")?Number(t.attr("max")):-1,a=t.attr("step")?Number(t.attr("step")):1,o=-1===r||r>=i+a?i+a:r,c=t.closest(e.selector.item);if("true"===c.attr("data-shared-cap")){var n=c.closest("form");o=e.checkSharedCapacity(n,o)}if(0!==o)if(0>o)t[0].value=i+o;else if("function"==typeof t[0].stepUp)try{t[0].stepUp()}catch(e){t.val(o)}else t.val(o)},e.stepDown=function(t,e){var i=t.attr("min")?Number(t.attr("min")):0,r=t.attr("step")?Number(t.attr("step")):1,a=i<=e-r&&0<e-r?e-r:i;if("function"==typeof t[0].stepDown)try{t[0].stepDown()}catch(e){t[0].value=a}else t[0].value=a},e.checkAvailability=function(){var i={action:"ticket_availability_check",tickets:e.getTickets()};t.post(TribeTicketOptions.ajaxurl,i,function(t){if(t.success){var i=t.data.tickets;e.updateAvailability(i)}}),0<TribeTicketOptions.availability_check_interval&&setTimeout(e.checkAvailability,TribeTicketOptions.availability_check_interval)},e.checkSharedCapacity=function(i,r){var a=[],o=[],c=i.find(e.selector.item).filter('[data-shared-cap="true"]'),n=c.find(e.selector.itemExtraAvailableQuantity),s=c.find(e.selector.itemQuantityInput);if(!c.length)return r;n.each(function(){a.push(parseInt(t(this).text(),10))}),s.each(function(){o.push(parseInt(t(this).val(),10))}),a=Math.max(...a),o=o.reduce(function(t,e){return t+e},0);var l=a-o;return Math.min(l,r)},e.getQty=function(t){var i=parseInt(t.find(e.selector.itemQuantityInput).val(),10);return isNaN(i)?0:i},e.getPrice=function(t){var i=parseFloat(t.find(e.selector.itemPrice).first().text());return isNaN(i)?0:i},e.getCurrencyFormatting=function(){return JSON.parse(TribeCurrency.formatting)[e.tribe_ticket_provider]},e.cleanNumber=function(t){var i=e.getCurrencyFormatting();if(i.thousands_sep===i.decimal_point){var r=t.length-(i.number_of_decimals+1);t=(t=(t=t.substr(0,r)+"_"+t.substr(r+1)).split(i.thousands_sep).join("")).split("_").join(".")}else t=(t=t.split(i.thousands_sep).join("")).split(i.decimal_point).join(".");return t},e.numberFormat=function(t){var i=e.getCurrencyFormatting();if(!i)return!1;var r=i.number_of_decimals,a=i.decimal_point,o=i.thousands_sep,c=isFinite(+t)?+t:0,n=isFinite(+r)?Math.abs(r):0,s=void 0===o?",":o,l=void 0===a?".":a,d=(n?function(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i}(c,n):Math.round(c)).toString().split(l);return d[0].length>3&&(d[0]=d[0].replace(/\B(?=(?:\d{3} )+(?!\d))/g,s)),(d[1]||"").length<n&&(d[1]=d[1]||"",d[1]+=new Array(n-d[1].length+1).join("0")),d.join(l)},e.focusTicketBlock=function(i){t(i).closest(e.modalSelector.metaItem).addClass("tribe-ticket-item__has-focus")},e.unfocusTicketBlock=function(i){t(i).closest(e.modalSelector.metaItem).removeClass("tribe-ticket-item__has-focus")},e.loaderShow=function(i){void 0===i&&(i=e.selector.ticketLoader),t(e.selector.loader).filter(i).removeClass(e.selector.hidden)},e.loaderHide=function(i){void 0===i&&(i=e.selector.ticketLoader),t(e.selector.loader).filter(i).addClass(e.selector.hidden)},e.initPrefill=function(){e.prefillTicketsBlock()},e.initModalFormPrefills=function(){e.loaderShow(e.modalSelector.loader),t.when(e.getData()).then(function(i){if(e.prefillModalCartForm(t(e.modalSelector.cartForm)),i.meta){t.each(i.meta,function(t){r.find(`[data-ticket-id="${t.ticket_id}"]`).length&&e.prefillModalMetaForm(i.meta)})}var a=e.getLocal();a.meta&&e.prefillModalMetaForm(a.meta);window.setTimeout(e.loaderHide,500,e.modalSelector.loader)})},e.prefillModalMetaForm=function(i,r){if(!(void 0===i||0>=i.length)){if(void 0===r)r=0;var a=t(e.modalSelector.metaForm).find(".tribe-tickets__item__attendee__fields__container");if(0<r)i.splice(0,r-1);t.each(i,function(i,r){var o=0,c=a.find(e.modalSelector.metaItem).filter(`[data-ticket-id="${r.ticket_id}"]`);c.length&&t.each(r.items,function(e,i){"object"==typeof i&&(t.each(i,function(e,i){var r=c.eq(o).find(`[name*="${e}"]`);r.is(":radio")||r.is(":checkbox")?r.each(function(e){var r=t(this);i===r.val()&&r.prop("checked",!0)}):r.val(i)}),o++)})}),e.loaderHide(e.modalSelector.loader)}},e.prefillModalCartForm=function(i){i.find(e.selector.item).hide();var a=r.find(e.selector.item);t.each(a,function(e,r){var a=t(r),o=i.find('[data-ticket-id="'+a.attr("data-ticket-id")+'"]');o&&(0<a.find(".tribe-tickets-quantity").val()&&o.fadeIn())}),e.appendARFields(i),e.loaderHide(e.modalSelector.loader)},e.prefillTicketsBlock=function(){t.when(e.getData(!0)).then(function(i){var r=i.tickets;if(r.length){var a=0;r.forEach(function(i){var r=t(`.tribe-tickets__item[data-ticket-id="${i.ticket_id}"]`);if("true"===r.attr("data-available")){var o=r.find(e.selector.itemQuantityInput),c=r.find(e.selector.itemOptOutInput+i.ticket_id);o.length&&(o.val(i.quantity),o.trigger("change"),a+=i.quantity,1==parseInt(i.optout,10)&&c.prop("checked","true"))}}),0<a&&t(e.selector.ticketInCartNotice).fadeIn()}e.loaderHide()},function(){var i=t(e.selector.ticketInCartNotice);i.removeClass("tribe-tickets__notice--barred tribe-tickets__notice--barred-left").addClass("tribe-tickets__notice--error"),i.find(".tribe-tickets-notice__title").text(TribeMessages.api_error_title),i.find(".tribe-tickets-notice__content").text(TribeMessages.connection_error),i.fadeIn(),e.loaderHide()})},e.storeLocal=function(t){var i=e.getMetaForSave();sessionStorage.setItem("tribe_tickets_attendees-"+e.postId,window.JSON.stringify(i));var r=e.getTicketsForCart();sessionStorage.setItem("tribe_tickets_cart-"+e.postId,window.JSON.stringify(r))},e.getLocal=function(t){if(!t)t=e.postId;return{meta:window.JSON.parse(sessionStorage.getItem("tribe_tickets_attendees-"+t)),tickets:window.JSON.parse(sessionStorage.getItem("tribe_tickets_cart-"+t))}},e.clearLocal=function(t){if(!t)t=e.postId;sessionStorage.removeItem("tribe_tickets_attendees-"+t),sessionStorage.removeItem("tribe_tickets_cart-"+t)},e.maybeHydrateAttendeeBlockFromLocal=function(i){t.when(e.getData()).then(function(r){if(r.meta){var a=r.meta.length;if(i<a)e.prefillModalMetaForm(r.meta,i);else{var o=t(e.modalSelector.metaForm).find(e.modalSelector.metaItem).slice(i-1);o&&o.find(e.modalSelector.metaField).each(function(){var e=t(this),i=e.attr("name"),a=r[i];a&&e.val(a)})}}})},e.getTicketsForCart=function(){var i=[],r=t(e.modalSelector.cartForm);return r.length||(r=t(e.selector.container)),r.find(e.selector.item).each(function(){var r=t(this),a=r.data("ticketId"),o=r.find(e.selector.itemQuantityInput).val(),c=r.find('[name="attendee[optout]"]'),n=c.val();c.is(":checkbox")&&(n=c.prop("checked")?1:0);var s={};s.ticket_id=a,s.quantity=o,s.optout=n,i.push(s)}),i},e.getMetaForSave=function(){var i=t(e.modalSelector.metaForm).find(e.modalSelector.metaItem),r=[],a=[];return i.each(function(){var i={},r=t(this),o=r.data("ticketId"),c=r.find(e.modalSelector.metaField);c.length&&(a[o]||(a[o]={},a[o].ticket_id=o,a[o].items=[]),c.each(function(){var e=t(this),r=e.val(),a=e.is(":radio"),o=e.attr("name");if(o=(o=o.split("[")).pop().replace("]",""),(a||e.is(":checkbox"))&&!e.prop("checked")){if(a&&""!==i[o])return;r=""}i[o]=r}),a[o].items.push(i))}),Object.keys(a).forEach(function(t){var e={ticket_id:t,items:a[t].items};r.push(e)}),r},e.getData=function(i){var a={meta:{},tickets:{}},o=t.Deferred(),c=window.JSON.parse(sessionStorage.getItem("tribe_tickets_attendees-"+e.postId));if(null!==c&&(a.meta=c),!i){var n=window.JSON.parse(sessionStorage.getItem("tribe_tickets_cart-"+e.postId));null!==n&&n.length&&(a.tickets=n),o.resolve(a)}return a.tickets&&a.meta||t.ajax({type:"GET",data:{provider:r.data("providerId"),post_id:e.postId},dataType:"json",url:e.getRestEndpoint(),success:function(t){null===c&&sessionStorage.setItem("tribe_tickets_attendees-"+e.postId,window.JSON.stringify(t.meta)),sessionStorage.setItem("tribe_tickets_cart-"+e.postId,window.JSON.stringify(t.tickets));var i={meta:t.meta,tickets:t.tickets};o.resolve(i)},error:function(){o.reject(!1)}}),o.promise()},e.validateForm=function(i){var r=i.find(e.modalSelector.metaItem),a=!0,o=0;return r.each(function(){var i=t(this);e.validateBlock(i)||(o++,a=!1)}),[a,o]},e.validateBlock=function(i){var r=i.find(e.modalSelector.metaField),a=!0;return r.each(function(){var i=t(this);e.validateField(i[0])||(a=!1)}),a?i.removeClass("tribe-ticket-item__has-error"):i.addClass("tribe-ticket-item__has-error"),a},e.validateCheckboxRadioGroup=function(i){var r=i.find(e.modalSelector.metaField),a=!1,o=!0;return r.each(function(){var e=t(this);e.is(":checked")&&(a=!0),e.prop("required")||(o=!1)}),!o||a},e.validateField=function(i){var r=!0,a=t(i);if(!(r=i.checkValidity()))if((a=t(i)).is(":checkbox")||a.is(":radio")){var o=a.closest(".tribe-common-form-control-checkbox-radio-group");o.length&&(r=e.validateCheckboxRadioGroup(o))}else r=!1;return r?a.removeClass("ticket-meta__has-error"):a.addClass("ticket-meta__has-error"),r},e.document.on("click touchend",".tribe-tickets__item__quantity__remove, .tribe-tickets__item__quantity__add",function(i){i.preventDefault();var r=t(this).parent().find('input[type="number"]');if(r.is(":disabled"))return!1;i.preventDefault();var a=Number(r[0].value),o=r.closest(e.modalSelector.cartForm);if(t(this).hasClass("tribe-tickets__item__quantity__add")?e.stepUp(r,a):e.stepDown(r,a),e.updateFooter(r.closest("form")),a!==r[0].value&&r.trigger("change"),o.length){var c=r.closest(e.selector.item);e.updateTotal(e.getQty(c),e.getPrice(c),c)}}),e.document.on("click",e.modalSelector.itemRemove,function(i){i.preventDefault();var r={},a=t(this).closest("form"),o=t(this).closest(e.selector.item);o.find(e.selector.itemQuantity).val(0),o.fadeOut(),r.id=o.data("ticketId"),r.qty=0,o.find(e.selector.itemQuantityInput).val(r.qty),r.price=e.getPrice(o),e.updateTotal(r.qty,r.price,o),e.updateFormTotals(a),t('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+r.id+'"]').removeClass("tribe-tickets--has-tickets").find(e.modalSelector.metaItem).remove();window.setTimeout(e.maybeShowNonMetaNotice,500,a),window.setTimeout(function(){if(0>=a.find(e.selector.item).filter(":visible").length){var i=t(e.selector.blockSubmit).attr("data-content"),r="dialog_obj_"+i.substring(i.lastIndexOf("-")+1);window[r].hide()}},500)}),e.document.on("focus",".tribe-ticket .ticket-meta",function(t){var i=t.target;e.focusTicketBlock(i)}),e.document.on("blur",".tribe-ticket .ticket-meta",function(t){var i=t.target;e.unfocusTicketBlock(i)}),e.document.on("change keyup",e.selector.itemQuantityInput,function(i){var r=t(this),a=r.closest(e.selector.item),o=(a.data("ticket-id"),r.closest("form")),c=r.attr("max"),n=parseInt(r.val(),10);if(c<(n=isNaN(n)?0:n)&&(n=c,r.val(c)),"true"===a.attr("data-shared-cap"))var s=e.checkSharedCapacity(o,n);0>s&&(n+=s,r.val(n)),i.preventDefault(),e.maybeShowOptOut(a,n),e.updateFooter(o),e.updateFormTotals(o)}),e.document.on("beforeunload",function(t){tribe.tickets.modal_redirect?e.clearLocal():e.storeLocal()}),e.document.on("click",e.modalSelector.submit,function(i){i.preventDefault();var r=t(this),a=t(e.modalSelector.form),o=t(e.modalSelector.metaForm),c=e.validateForm(o),n=t(e.selector.validationNotice),s=r.attr("name"),l=a.data("provider");if(e.loaderShow(e.modalSelector.loader),!c[0])return n.find(".tribe-tickets-notice__title").text(TribeMessages.validation_error_title),n.find("p").html(TribeMessages.validation_error),t(e.selector.validationNotice+"__count").text(c[1]),n.show(),e.loaderHide(e.modalSelector.loader),document.getElementById("tribe-tickets__notice__attendee-modal").scrollIntoView({behavior:"smooth",block:"start"}),!1;n.hide(),e.loaderShow(e.modalSelector.loader);var d=TribeTicketsURLs.checkout[l];-1!==s.indexOf("cart")&&(d=TribeTicketsURLs.cart[l]),t(e.modalSelector.form).attr("action",d),console.log(d);var m={tribe_tickets_provider:e.commerceSelector[e.tribe_ticket_provider],tribe_tickets_tickets:e.getTicketsForCart(),tribe_tickets_meta:e.getMetaForSave(),tribe_tickets_post_id:e.postId};t("#tribe_tickets_ar_data").val(JSON.stringify(m)),tribe.tickets.modal_redirect=!0,e.clearLocal(),a.submit()}),e.document.on("click",e.selector.submit,function(i){i.preventDefault();var r=t(this),a=t(e.selector.container);r.attr("name"),a.data("provider");e.loaderShow(e.selector.loader);var o={tribe_tickets_provider:e.commerceSelector[e.tribe_ticket_provider],tribe_tickets_tickets:e.getTicketsForCart(),tribe_tickets_meta:{},tribe_tickets_post_id:e.postId};t("#tribe_tickets_block_ar_data").val(JSON.stringify(o)),a.submit()}),t(i).on("tribe_dialog_show_ar_modal",function(i,a,o){e.loaderShow(),e.loaderShow(e.modalSelector.loader);var c=t(e.modalSelector.cartForm);r.find(e.selector.item).each(function(){var i=t(this),r=i.data("ticketId"),a=c.find('[data-ticket-id="'+r+'"]');a&&e.updateItem(r,a,i)}),e.initModalFormPrefills(),e.updateFormTotals(c),e.loaderHide(),e.loaderHide(e.modalSelector.loader)}),t(i).on("tribe_dialog_close_ar_modal",function(t,i,r){e.storeLocal()}),e.init(),window.addEventListener("pageshow",function(t){(t.persisted||void 0!==window.performance&&2===window.performance.navigation.type)&&e.init()}))}(jQuery,tribe.tickets.block,tribe.dialogs.events);
1
+ var tribe=tribe||{};tribe.tickets=tribe.tickets||{},tribe.dialogs=tribe.dialogs||{},tribe.dialogs.events=tribe.dialogs.events||{},tribe.tickets.block={num_attendees:0,event:{}},function(t,e,i){"use strict";e.selector={blockFooter:".tribe-tickets__footer",blockFooterAmount:".tribe-amount",blockFooterQuantity:".tribe-tickets__footer__quantity__number",blockSubmit:".tribe-tickets__submit",container:"#tribe-tickets",hidden:"tribe-common-a11y-hidden",item:".tribe-tickets__item",itemExtraAvailable:".tribe-tickets__item__extra__available",itemExtraAvailableQuantity:".tribe-tickets__item__extra__available__quantity",itemOptOut:".tribe-tickets-attendees-list-optout--wrapper",itemOptOutInput:"#tribe-tickets-attendees-list-optout-",itemPrice:".tribe-amount",itemQuantity:".tribe-tickets__item__quantity",itemQuantityInput:".tribe-tickets-quantity",loader:".tribe-common-c-loader",submit:".tribe-tickets__buy",ticketLoader:".tribe-tickets-loader__tickets-block",validationNotice:".tribe-tickets__notice--error",ticketInCartNotice:"#tribe-tickets__notice__tickets-in-cart"};var r=t(e.selector.container);0!==r.length&&(e.document=t(document),e.modalSelector={cartForm:".tribe-modal__wrapper--ar #tribe-modal__cart",container:".tribe-modal__wrapper--ar",form:"#tribe-tickets__modal-form",itemRemove:".tribe-tickets__item__remove",itemTotal:".tribe-tickets__item__total .tribe-amount",loader:".tribe-tickets-loader__modal",metaField:".ticket-meta",metaForm:".tribe-modal__wrapper--ar #tribe-modal__attendee_registration",metaItem:".tribe-ticket",submit:".tribe-block__tickets__item__attendee__fields__footer_submit"},e.commerceSelector={edd:"Tribe__Tickets_Plus__Commerce__EDD__Main",rsvp:"Tribe__Tickets__RSVP",tpp:"Tribe__Tickets__Commerce__PayPal__Main",Tribe__Tickets__Commerce__PayPal__Main:"tribe-commerce",Tribe__Tickets__RSVP:"rsvp",Tribe__Tickets_Plus__Commerce__EDD__Main:"edd",Tribe__Tickets_Plus__Commerce__WooCommerce__Main:"woo",tribe_eddticket:"Tribe__Tickets_Plus__Commerce__EDD__Main",tribe_tpp_attendees:"Tribe__Tickets__Commerce__PayPal__Main",tribe_wooticket:"Tribe__Tickets_Plus__Commerce__WooCommerce__Main",woo:"Tribe__Tickets_Plus__Commerce__WooCommerce__Main"},e.tribe_ticket_provider=r.data("provider"),e.postId=t(".status-publish").attr("id").replace("post-",""),e.init=function(){0<TribeTicketOptions.availability_check_interval&&e.checkAvailability(),TribeTicketOptions.ajax_preload_ticket_form&&(e.loaderShow(),e.initPrefill())},e.updateAvailability=function(i){Object.keys(i).forEach(function(r){var a=i[r].available,o=t(e.selector.item+"[data-ticket-id='"+r+"']");if(0===a){var c=i[r].unavailable_html;o.attr("available",!1),o.removeClass("instock"),o.removeClass("purchasable"),o.find(e.selector.itemQuantity).html(c),o.find(e.selector.itemExtraAvailable).html("")}1<a&&(o.find(e.selector.itemQuantityInput).attr({max:a}),o.find(e.selector.itemExtraAvailableQuantity).html(a))})},e.updateFooter=function(t){e.updateFooterCount(t),e.updateFooterAmount(t),t.find(".tribe-tickets__footer").addClass("tribe-tickets__footer--active")},e.updateFooterCount=function(i){var r=i.find(e.selector.blockFooter+" "+e.selector.blockFooterQuantity),a=0;if(i.find(e.selector.item+" "+e.selector.itemQuantityInput).each(function(){var e=parseInt(t(this).val(),10);e=isNaN(e)?0:e,a+=e}),i.hasClass("tribe-tickets")){var o=0>=a;t(e.selector.blockSubmit).prop("disabled",o)}0>a||r.text(a)},e.updateFooterAmount=function(i){var r=i.find(e.selector.blockFooter+" "+e.selector.blockFooterAmount),a=0;i.find(e.selector.item+" "+e.selector.itemQuantityInput).each(function(){var i=t(this).closest(e.selector.item).find(e.selector.itemPrice).first(),r=parseInt(t(this).val(),10);r=isNaN(r)?0:r;var o=i.text();o=e.cleanNumber(o),a+=o*r}),0>a||r.text(e.numberFormat(a))},e.updateFormTotals=function(i){i.find(e.selector.item).each(function(){var i=t(this),r=e.getQty(i),a=parseFloat(t(this).find(e.modalSelector.itemTotal).first().text().replace(",",""));"."===e.getCurrencyFormatting().thousands_sep&&(a=parseFloat(t(this).find(e.modalSelector.itemTotal).text().replace(/\./g,"").replace(",","."))),parseInt(r,10),a}),e.updateFooter(i),e.appendARFields(i)},e.updateItem=function(i,r,a){var o={};if(o.id=i,a){o.qty=e.getQty(a),o.price=e.getPrice(r),r.find(e.selector.itemQuantityInput).val(o.qty).trigger("change");var c=e.selector.itemOptOutInput+a.data("ticket-id");o.$optOut=t(c);var n=t(c+"-modal");o.$optOut.length&&o.$optOut.is(":checked")?n.val("1"):n.val("0")}else o.qty=e.getQty(r),o.price=e.getPrice(r);return e.updateTotal(o.qty,o.price,r),o},e.updateTotal=function(t,i,r){var a=(t*i).toFixed(e.getCurrencyFormatting().number_of_decimals);return r.find(e.modalSelector.itemTotal).text(e.numberFormat(a)),a},e.maybeShowNonMetaNotice=function(i){var r=0,a=0,o=i.find(e.selector.item).filter(function(i){return t(this).find(e.selector.itemQuantityInput).val()>0});if(o.length){o.each(function(){var i=t(this),o=i.closest(e.selector.item).data("ticket-id");t(e.modalSelector.metaForm).find('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+o+'"]').length?a+=e.getQty(i):r+=e.getQty(i)});var c=t(".tribe-tickets__notice--non-ar"),n=t(".tribe-tickets__item__attendee__fields__title");0<r&&0<a?(t("#tribe-tickets__non-ar-count").text(r),c.removeClass("tribe-common-a11y-hidden"),n.show()):(c.addClass("tribe-common-a11y-hidden"),n.hide())}},e.getRestEndpoint=function(){return TribeCartEndpoint.url},e.getTickets=function(){return t(e.selector.item).map(function(){return t(this).data("ticket-id")}).get()},e.maybeShowOptOut=function(t,i){if(t.has(e.selector.itemOptOut).length){var r=t.closest(e.selector.item).find(e.selector.itemOptOut);0<i?r.show():r.hide()}},e.appendARFields=function(i){i.find(e.selector.item).each(function(){var i=t(this);if(i.is(":visible")){var r=i.closest(e.selector.item).data("ticket-id"),a=t(e.modalSelector.metaForm).find('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+r+'"]');if(!a.length)return;var o=a.find(e.modalSelector.metaItem),c=e.getQty(i);if(0>=c)return a.removeClass("tribe-tickets--has-tickets"),void a.find(e.modalSelector.metaItem).remove();if(o.length>c){var n=o.length-c;a.find(".tribe-ticket:nth-last-child( -n+"+n+" )").remove()}else if(o.length<c){var s=window.wp.template("tribe-registration--"+r),l=0<o.length?o.length+1:1;a.addClass("tribe-tickets--has-tickets");for(var d=l;d<=c;d++){var m={attendee_id:d};a.append(s(m)),e.maybeHydrateAttendeeBlockFromLocal(o.length)}}}}),e.maybeShowNonMetaNotice(i),e.loaderHide(),e.document.trigger("tribe-ar-fields-appended")},e.stepUp=function(t,i){var r=t.attr("max")?Number(t.attr("max")):-1,a=t.attr("step")?Number(t.attr("step")):1,o=-1===r||r>=i+a?i+a:r,c=t.closest(e.selector.item);if("true"===c.attr("data-has-shared-cap")){var n=c.closest("form");o=e.checkSharedCapacity(n,o)}if(0!==o)if(0>o)t[0].value=i+o;else if("function"==typeof t[0].stepUp)try{t[0].stepUp()}catch(e){t.val(o)}else t.val(o)},e.stepDown=function(t,e){var i=t.attr("min")?Number(t.attr("min")):0,r=t.attr("step")?Number(t.attr("step")):1,a=i<=e-r&&0<e-r?e-r:i;if("function"==typeof t[0].stepDown)try{t[0].stepDown()}catch(e){t[0].value=a}else t[0].value=a},e.checkAvailability=function(){var i={action:"ticket_availability_check",tickets:e.getTickets()};t.post(TribeTicketOptions.ajaxurl,i,function(t){if(t.success){var i=t.data.tickets;e.updateAvailability(i)}}),0<TribeTicketOptions.availability_check_interval&&setTimeout(e.checkAvailability,TribeTicketOptions.availability_check_interval)},e.checkSharedCapacity=function(i,r){var a=[],o=[],c=i.find(e.selector.item).filter('[data-has-shared-cap="true"]'),n=c.find(e.selector.itemQuantityInput);if(!c.length)return r;c.each(function(){a.push(parseInt(t(this).attr("data-shared-cap"),10))}),n.each(function(){o.push(parseInt(t(this).val(),10))}),a=Math.max(...a),o=o.reduce(function(t,e){return t+e},0);var s=a-o;return Math.min(s,r)},e.getQty=function(t){var i=parseInt(t.find(e.selector.itemQuantityInput).val(),10);return isNaN(i)?0:i},e.getPrice=function(t){var i=parseFloat(t.find(e.selector.itemPrice).first().text());return isNaN(i)?0:i},e.getCurrencyFormatting=function(){return JSON.parse(TribeCurrency.formatting)[e.tribe_ticket_provider]},e.cleanNumber=function(t){var i=e.getCurrencyFormatting();if(i.thousands_sep===i.decimal_point){var r=t.length-(i.number_of_decimals+1);t=(t=(t=t.substr(0,r)+"_"+t.substr(r+1)).split(i.thousands_sep).join("")).split("_").join(".")}else t=(t=t.split(i.thousands_sep).join("")).split(i.decimal_point).join(".");return t},e.numberFormat=function(t){var i=e.getCurrencyFormatting();if(!i)return!1;var r=i.number_of_decimals,a=i.decimal_point,o=i.thousands_sep,c=isFinite(+t)?+t:0,n=isFinite(+r)?Math.abs(r):0,s=void 0===o?",":o,l=void 0===a?".":a,d=(n?function(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i}(c,n):Math.round(c)).toString().split(l);return d[0].length>3&&(d[0]=d[0].replace(/\B(?=(?:\d{3} )+(?!\d))/g,s)),(d[1]||"").length<n&&(d[1]=d[1]||"",d[1]+=new Array(n-d[1].length+1).join("0")),d.join(l)},e.focusTicketBlock=function(i){t(i).closest(e.modalSelector.metaItem).addClass("tribe-ticket-item__has-focus")},e.unfocusTicketBlock=function(i){t(i).closest(e.modalSelector.metaItem).removeClass("tribe-ticket-item__has-focus")},e.loaderShow=function(i){void 0===i&&(i=e.selector.ticketLoader),t(e.selector.loader).filter(i).removeClass(e.selector.hidden)},e.loaderHide=function(i){void 0===i&&(i=e.selector.ticketLoader),t(e.selector.loader).filter(i).addClass(e.selector.hidden)},e.initPrefill=function(){e.prefillTicketsBlock()},e.initModalFormPrefills=function(){e.loaderShow(e.modalSelector.loader),t.when(e.getData()).then(function(i){if(e.prefillModalCartForm(t(e.modalSelector.cartForm)),i.meta){t.each(i.meta,function(t){r.find(`[data-ticket-id="${t.ticket_id}"]`).length&&e.prefillModalMetaForm(i.meta)})}var a=e.getLocal();a.meta&&e.prefillModalMetaForm(a.meta);window.setTimeout(e.loaderHide,500,e.modalSelector.loader)})},e.prefillModalMetaForm=function(i,r){if(!(void 0===i||0>=i.length)){if(void 0===r)r=0;var a=t(e.modalSelector.metaForm).find(".tribe-tickets__item__attendee__fields__container");if(0<r)i.splice(0,r-1);t.each(i,function(i,r){var o=0,c=a.find(e.modalSelector.metaItem).filter(`[data-ticket-id="${r.ticket_id}"]`);c.length&&t.each(r.items,function(e,i){"object"==typeof i&&(t.each(i,function(e,i){var r=c.eq(o).find(`[name*="${e}"]`);r.is(":radio")||r.is(":checkbox")?r.each(function(e){var r=t(this);i===r.val()&&r.prop("checked",!0)}):r.val(i)}),o++)})}),e.loaderHide(e.modalSelector.loader)}},e.prefillModalCartForm=function(i){i.find(e.selector.item).hide();var a=r.find(e.selector.item);t.each(a,function(e,r){var a=t(r),o=i.find('[data-ticket-id="'+a.attr("data-ticket-id")+'"]');o&&(0<a.find(".tribe-tickets-quantity").val()&&o.fadeIn())}),e.appendARFields(i),e.loaderHide(e.modalSelector.loader)},e.prefillTicketsBlock=function(){t.when(e.getData(!0)).then(function(i){var r=i.tickets;if(r.length){var a=0;r.forEach(function(i){var r=t(`.tribe-tickets__item[data-ticket-id="${i.ticket_id}"]`);if("true"===r.attr("data-available")){var o=r.find(e.selector.itemQuantityInput),c=r.find(e.selector.itemOptOutInput+i.ticket_id);o.length&&(o.val(i.quantity),o.trigger("change"),a+=i.quantity,1==parseInt(i.optout,10)&&c.prop("checked","true"))}}),0<a&&t(e.selector.ticketInCartNotice).fadeIn()}e.loaderHide()},function(){var i=t(e.selector.ticketInCartNotice);i.removeClass("tribe-tickets__notice--barred tribe-tickets__notice--barred-left").addClass("tribe-tickets__notice--error"),i.find(".tribe-tickets-notice__title").text(TribeMessages.api_error_title),i.find(".tribe-tickets-notice__content").text(TribeMessages.connection_error),i.fadeIn(),e.loaderHide()})},e.storeLocal=function(t){var i=e.getMetaForSave();sessionStorage.setItem("tribe_tickets_attendees-"+e.postId,window.JSON.stringify(i));var r=e.getTicketsForCart();sessionStorage.setItem("tribe_tickets_cart-"+e.postId,window.JSON.stringify(r))},e.getLocal=function(t){if(!t)t=e.postId;return{meta:window.JSON.parse(sessionStorage.getItem("tribe_tickets_attendees-"+t)),tickets:window.JSON.parse(sessionStorage.getItem("tribe_tickets_cart-"+t))}},e.clearLocal=function(t){if(!t)t=e.postId;sessionStorage.removeItem("tribe_tickets_attendees-"+t),sessionStorage.removeItem("tribe_tickets_cart-"+t)},e.maybeHydrateAttendeeBlockFromLocal=function(i){t.when(e.getData()).then(function(r){if(r.meta){var a=r.meta.length;if(i<a)e.prefillModalMetaForm(r.meta,i);else{var o=t(e.modalSelector.metaForm).find(e.modalSelector.metaItem).slice(i-1);o&&o.find(e.modalSelector.metaField).each(function(){var e=t(this),i=e.attr("name"),a=r[i];a&&e.val(a)})}}})},e.getTicketsForCart=function(){var i=[],r=t(e.modalSelector.cartForm);return r.length||(r=t(e.selector.container)),r.find(e.selector.item).each(function(){var r=t(this),a=r.data("ticketId"),o=r.find(e.selector.itemQuantityInput).val(),c=r.find('[name="attendee[optout]"]'),n=c.val();c.is(":checkbox")&&(n=c.prop("checked")?1:0);var s={};s.ticket_id=a,s.quantity=o,s.optout=n,i.push(s)}),i},e.getMetaForSave=function(){var i=t(e.modalSelector.metaForm).find(e.modalSelector.metaItem),r=[],a=[];return i.each(function(){var i={},r=t(this),o=r.data("ticketId"),c=r.find(e.modalSelector.metaField);c.length&&(a[o]||(a[o]={},a[o].ticket_id=o,a[o].items=[]),c.each(function(){var e=t(this),r=e.val(),a=e.is(":radio"),o=e.attr("name");if(o=(o=o.split("[")).pop().replace("]",""),(a||e.is(":checkbox"))&&!e.prop("checked")){if(a&&""!==i[o])return;r=""}i[o]=r}),a[o].items.push(i))}),Object.keys(a).forEach(function(t){var e={ticket_id:t,items:a[t].items};r.push(e)}),r},e.getData=function(i){var a={meta:{},tickets:{}},o=t.Deferred(),c=window.JSON.parse(sessionStorage.getItem("tribe_tickets_attendees-"+e.postId));if(null!==c&&(a.meta=c),!i){var n=window.JSON.parse(sessionStorage.getItem("tribe_tickets_cart-"+e.postId));null!==n&&n.length&&(a.tickets=n),o.resolve(a)}return a.tickets&&a.meta||t.ajax({type:"GET",data:{provider:r.data("providerId"),post_id:e.postId},dataType:"json",url:e.getRestEndpoint(),success:function(t){null===c&&sessionStorage.setItem("tribe_tickets_attendees-"+e.postId,window.JSON.stringify(t.meta)),sessionStorage.setItem("tribe_tickets_cart-"+e.postId,window.JSON.stringify(t.tickets));var i={meta:t.meta,tickets:t.tickets};o.resolve(i)},error:function(){o.reject(!1)}}),o.promise()},e.validateForm=function(i){var r=i.find(e.modalSelector.metaItem),a=!0,o=0;return r.each(function(){var i=t(this);e.validateBlock(i)||(o++,a=!1)}),[a,o]},e.validateBlock=function(i){var r=i.find(e.modalSelector.metaField),a=!0;return r.each(function(){var i=t(this);e.validateField(i[0])||(a=!1)}),a?i.removeClass("tribe-ticket-item__has-error"):i.addClass("tribe-ticket-item__has-error"),a},e.validateCheckboxRadioGroup=function(i){var r=i.find(e.modalSelector.metaField),a=!1,o=!0;return r.each(function(){var e=t(this);e.is(":checked")&&(a=!0),e.prop("required")||(o=!1)}),!o||a},e.validateField=function(i){var r=!0,a=t(i);if(!(r=i.checkValidity()))if((a=t(i)).is(":checkbox")||a.is(":radio")){var o=a.closest(".tribe-common-form-control-checkbox-radio-group");o.length&&(r=e.validateCheckboxRadioGroup(o))}else r=!1;return r?a.removeClass("ticket-meta__has-error"):a.addClass("ticket-meta__has-error"),r},e.document.on("click touchend",".tribe-tickets__item__quantity__remove, .tribe-tickets__item__quantity__add",function(i){i.preventDefault();var r=t(this).parent().find('input[type="number"]');if(r.is(":disabled"))return!1;i.preventDefault();var a=Number(r[0].value),o=r.closest(e.modalSelector.cartForm);if(t(this).hasClass("tribe-tickets__item__quantity__add")?e.stepUp(r,a):e.stepDown(r,a),e.updateFooter(r.closest("form")),a!==r[0].value&&r.trigger("change"),o.length){var c=r.closest(e.selector.item);e.updateTotal(e.getQty(c),e.getPrice(c),c)}}),e.document.on("click",e.modalSelector.itemRemove,function(i){i.preventDefault();var r={},a=t(this).closest("form"),o=t(this).closest(e.selector.item);o.find(e.selector.itemQuantity).val(0),o.fadeOut(),r.id=o.data("ticketId"),r.qty=0,o.find(e.selector.itemQuantityInput).val(r.qty),r.price=e.getPrice(o),e.updateTotal(r.qty,r.price,o),e.updateFormTotals(a),t('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+r.id+'"]').removeClass("tribe-tickets--has-tickets").find(e.modalSelector.metaItem).remove();window.setTimeout(e.maybeShowNonMetaNotice,500,a),window.setTimeout(function(){if(0>=a.find(e.selector.item).filter(":visible").length){var i=t(e.selector.blockSubmit).attr("data-content"),r="dialog_obj_"+i.substring(i.lastIndexOf("-")+1);window[r].hide()}},500)}),e.document.on("focus",".tribe-ticket .ticket-meta",function(t){var i=t.target;e.focusTicketBlock(i)}),e.document.on("blur",".tribe-ticket .ticket-meta",function(t){var i=t.target;e.unfocusTicketBlock(i)}),e.document.on("change keyup",e.selector.itemQuantityInput,function(i){var r=t(this),a=r.closest(e.selector.item),o=(a.data("ticket-id"),r.closest("form")),c=r.attr("max"),n=parseInt(r.val(),10);if(c<(n=isNaN(n)?0:n)&&(n=c,r.val(c)),"true"===a.attr("data-has-shared-cap"))var s=e.checkSharedCapacity(o,n);0>s&&(n+=s,r.val(n)),i.preventDefault(),e.maybeShowOptOut(a,n),e.updateFooter(o),e.updateFormTotals(o)}),e.document.on("beforeunload",function(t){tribe.tickets.modal_redirect?e.clearLocal():e.storeLocal()}),e.document.on("click",e.modalSelector.submit,function(i){i.preventDefault();var r=t(this),a=t(e.modalSelector.form),o=t(e.modalSelector.metaForm),c=e.validateForm(o),n=t(e.selector.validationNotice),s=r.attr("name"),l=a.data("provider");if(e.loaderShow(e.modalSelector.loader),!c[0])return n.find(".tribe-tickets-notice__title").text(TribeMessages.validation_error_title),n.find("p").html(TribeMessages.validation_error),t(e.selector.validationNotice+"__count").text(c[1]),n.show(),e.loaderHide(e.modalSelector.loader),document.getElementById("tribe-tickets__notice__attendee-modal").scrollIntoView({behavior:"smooth",block:"start"}),!1;n.hide(),e.loaderShow(e.modalSelector.loader);var d=TribeTicketsURLs.checkout[l];-1!==s.indexOf("cart")&&(d=TribeTicketsURLs.cart[l]),t(e.modalSelector.form).attr("action",d),console.log(d);var m={tribe_tickets_provider:e.commerceSelector[e.tribe_ticket_provider],tribe_tickets_tickets:e.getTicketsForCart(),tribe_tickets_meta:e.getMetaForSave(),tribe_tickets_post_id:e.postId};t("#tribe_tickets_ar_data").val(JSON.stringify(m)),tribe.tickets.modal_redirect=!0,e.clearLocal(),a.submit()}),e.document.on("click",e.selector.submit,function(i){i.preventDefault();var r=t(this),a=t(e.selector.container);r.attr("name"),a.data("provider");e.loaderShow(e.selector.loader);var o={tribe_tickets_provider:e.commerceSelector[e.tribe_ticket_provider],tribe_tickets_tickets:e.getTicketsForCart(),tribe_tickets_meta:{},tribe_tickets_post_id:e.postId};t("#tribe_tickets_block_ar_data").val(JSON.stringify(o)),a.submit()}),t(i).on("tribe_dialog_show_ar_modal",function(i,a,o){e.loaderShow(),e.loaderShow(e.modalSelector.loader);var c=t(e.modalSelector.cartForm);r.find(e.selector.item).each(function(){var i=t(this),r=i.data("ticketId"),a=c.find('[data-ticket-id="'+r+'"]');a&&e.updateItem(r,a,i)}),e.initModalFormPrefills(),e.updateFormTotals(c),e.loaderHide(),e.loaderHide(e.modalSelector.loader)}),t(i).on("tribe_dialog_close_ar_modal",function(t,i,r){e.storeLocal()}),e.init(),window.addEventListener("pageshow",function(t){(t.persisted||void 0!==window.performance&&2===window.performance.navigation.type)&&e.init()}))}(jQuery,tribe.tickets.block,tribe.dialogs.events);
src/resources/js/rsvp-block.js CHANGED
@@ -63,7 +63,7 @@ var tribe_tickets_rsvp_block = {
63
  };
64
 
65
  // Show the loader for this RSVP
66
- my.tribe_rsvp_loader_start( $ticket );
67
 
68
  $.post(
69
  TribeRsvp.ajaxurl,
@@ -81,7 +81,7 @@ var tribe_tickets_rsvp_block = {
81
  $submit.attr( 'disabled', true );
82
  my.state.submitActive = false;
83
  }
84
- my.tribe_rsvp_loader_end( $ticket );
85
  }
86
  );
87
  };
@@ -157,7 +157,10 @@ var tribe_tickets_rsvp_block = {
157
  * @param {obj} $ticket ticket object
158
  */
159
  my.tribe_rsvp_loader_start = function( $ticket ) {
160
- $ticket.find( '.tribe-block__rsvp__loading' ).show();
 
 
 
161
  };
162
 
163
  /**
@@ -168,7 +171,10 @@ var tribe_tickets_rsvp_block = {
168
  * @param {obj} $ticket ticket object
169
  */
170
  my.tribe_rsvp_loader_end = function( $ticket ) {
171
- $ticket.find( '.tribe-block__rsvp__loading' ).hide();
 
 
 
172
  };
173
 
174
 
@@ -234,7 +240,7 @@ var tribe_tickets_rsvp_block = {
234
  params.push( { name: 'action', value: 'rsvp-process' } );
235
  params.push( { name: 'ticket_id', value: ticket_id } );
236
 
237
- my.tribe_rsvp_loader_start( $ticket );
238
 
239
  $.post(
240
  TribeRsvp.ajaxurl,
@@ -253,7 +259,7 @@ var tribe_tickets_rsvp_block = {
253
  $ticket.find( '.tribe-block__rsvp__status' ).replaceWith( response.data.status_html );
254
  }
255
 
256
- my.tribe_rsvp_loader_end( $ticket );
257
  }
258
  );
259
  }
63
  };
64
 
65
  // Show the loader for this RSVP
66
+ my.tribe_rsvp_loader_start();
67
 
68
  $.post(
69
  TribeRsvp.ajaxurl,
81
  $submit.attr( 'disabled', true );
82
  my.state.submitActive = false;
83
  }
84
+ my.tribe_rsvp_loader_end();
85
  }
86
  );
87
  };
157
  * @param {obj} $ticket ticket object
158
  */
159
  my.tribe_rsvp_loader_start = function( $ticket ) {
160
+ var loader_class = '.tribe-block__rsvp__loading';
161
+ var $loader = $( '.tribe-block__rsvp' ).find( loader_class );
162
+
163
+ $loader.removeClass( 'tribe-common-a11y-hidden' );
164
  };
165
 
166
  /**
171
  * @param {obj} $ticket ticket object
172
  */
173
  my.tribe_rsvp_loader_end = function( $ticket ) {
174
+ var loader_class = '.tribe-block__rsvp__loading';
175
+ var $loader = $( '.tribe-block__rsvp' ).find( loader_class );
176
+
177
+ $loader.addClass( 'tribe-common-a11y-hidden' );
178
  };
179
 
180
 
240
  params.push( { name: 'action', value: 'rsvp-process' } );
241
  params.push( { name: 'ticket_id', value: ticket_id } );
242
 
243
+ my.tribe_rsvp_loader_start();
244
 
245
  $.post(
246
  TribeRsvp.ajaxurl,
259
  $ticket.find( '.tribe-block__rsvp__status' ).replaceWith( response.data.status_html );
260
  }
261
 
262
+ my.tribe_rsvp_loader_end();
263
  }
264
  );
265
  }
src/resources/js/rsvp-block.min.js CHANGED
@@ -1 +1 @@
1
- var tribe_tickets_rsvp_block={events:{}};!function(t,e){"use strict";e.state={submitActive:!0},e.tribe_rsvp_toggle_actions=function(t){var e=t.hasClass("tribe-block__rsvp__status-button--going")?".tribe-block__rsvp__status-button--not-going":".tribe-block__rsvp__status-button--going",i=t.closest(".tribe-block__rsvp__status").find(e);t.addClass("tribe-active"),t.removeClass("tribe-inactive"),t.attr("disabled","disabled"),i.addClass("tribe-inactive"),i.removeClass("tribe-active"),i.removeAttr("disabled")},e.events.handle_rsvp_response=function(){var i=t(this),s=i.closest(".tribe-block__rsvp"),r=s.find(".tribe-block__rsvp__ticket"),_=r.data("rsvp-id"),n=i.hasClass("tribe-block__rsvp__status-button--going");e.tribe_rsvp_toggle_actions(i);var a={action:"rsvp-form",ticket_id:_,going:n?"yes":"no"};e.tribe_rsvp_loader_start(r),t.post(TribeRsvp.ajaxurl,a,function(t){s.find(".tribe-block__rsvp__message__success").remove();var i=r.find(".tribe-block__rsvp__form");if(i.html(t.data.html),window.tribe_event_tickets_plus){var _=i.find("input.tribe-tickets-quantity");window.tribe_event_tickets_plus.meta.block_set_quantity(_,n)}e.validate_submission(i)||(i.find(".tribe-block__rsvp__submit-button").attr("disabled",!0),e.state.submitActive=!1);e.tribe_rsvp_loader_end(r)})},e.events.handle_quantity_change=function(e){e.preventDefault();var i=t(this).parent().find('input[type="number"]'),s=t(this).hasClass("tribe-block__rsvp__number-input-button--plus"),r=i[0].step?Number(i[0].step):1,_=Number(i[0].value);if(s){var n=i[0].max?Number(i[0].max):-1;if("function"==typeof i[0].stepUp)try{i[0].stepUp()}catch(t){i[0].value=-1===n||n>=_+r?_+r:n}else i[0].value=-1===n||n>=_+r?_+r:n}else{var a=i[0].min?Number(i[0].min):0;if("function"==typeof i[0].stepDown)try{i[0].stepDown()}catch(t){i[0].value=a<=_-r?_-r:a}else i[0].value=a<=_-r?_-r:a}_!==i[0].value&&i.trigger("change")},e.events.handle_input_focus=function(i){e.state.submitActive||(t(i.target).siblings(".tribe-block__rsvp__submit-button").attr("disabled",!1),e.state.submitActive=!0)},e.tribe_rsvp_loader_start=function(t){t.find(".tribe-block__rsvp__loading").show()},e.tribe_rsvp_loader_end=function(t){t.find(".tribe-block__rsvp__loading").hide()},e.validate_submission=function(e){var i=e.find("input.tribe-tickets-quantity"),s=e.find("input.tribe-tickets-full-name"),r=e.find("input.tribe-tickets-email");return t.trim(s.val()).length&&t.trim(r.val()).length&&parseFloat(i.val())>0},e.events.handle_submission=function(i){i.preventDefault();var s=t(this).closest(".tribe-block__rsvp__ticket"),r=s.data("rsvp-id"),_=s.find("form"),n=e.validate_submission(_),a=!0,o=!!window.tribe_event_tickets_plus;if(o&&(a=window.tribe_event_tickets_plus.meta.validate_meta(_)),n&&a){var b=_.serializeArray();b.push({name:"action",value:"rsvp-process"}),b.push({name:"ticket_id",value:r}),e.tribe_rsvp_loader_start(s),t.post(TribeRsvp.ajaxurl,b,function(t){var i=t.data.remaining;s.find(".tribe-block__rsvp__details .tribe-block__rsvp__availability").replaceWith(t.data.remaining_html),s.find(".tribe-block__rsvp__form").empty(),s.closest(".tribe-block__rsvp").append(t.data.html),0===i&&s.find(".tribe-block__rsvp__status").replaceWith(t.data.status_html),e.tribe_rsvp_loader_end(s)})}else n?_.find(".tribe-block__rsvp__message__error").hide():_.find(".tribe-block__rsvp__message__error").show(),o&&a?_.find(".tribe-event-tickets-meta-required-message").hide():_.find(".tribe-event-tickets-meta-required-message").show(),t("html, body").animate({scrollTop:_.offset().top-100},300)},e.bind_events=function(){t(".tribe-block__rsvp__ticket").on("click",".tribe-block__rsvp__status-button--going, .tribe-block__rsvp__status-button--not-going",e.events.handle_rsvp_response).on("click",'button[type="submit"]',e.events.handle_submission).on("click",".tribe-block__rsvp__number-input-button--minus, .tribe-block__rsvp__number-input-button--plus",e.events.handle_quantity_change).on("focus",".tribe-tickets-full-name, .tribe-tickets-email",e.events.handle_input_focus)},e.init=function(){t(".tribe-block__rsvp").length&&e.bind_events()},e.init()}(jQuery,tribe_tickets_rsvp_block);
1
+ var tribe_tickets_rsvp_block={events:{}};!function(t,e){"use strict";e.state={submitActive:!0},e.tribe_rsvp_toggle_actions=function(t){var e=t.hasClass("tribe-block__rsvp__status-button--going")?".tribe-block__rsvp__status-button--not-going":".tribe-block__rsvp__status-button--going",i=t.closest(".tribe-block__rsvp__status").find(e);t.addClass("tribe-active"),t.removeClass("tribe-inactive"),t.attr("disabled","disabled"),i.addClass("tribe-inactive"),i.removeClass("tribe-active"),i.removeAttr("disabled")},e.events.handle_rsvp_response=function(){var i=t(this),s=i.closest(".tribe-block__rsvp"),r=s.find(".tribe-block__rsvp__ticket"),_=r.data("rsvp-id"),n=i.hasClass("tribe-block__rsvp__status-button--going");e.tribe_rsvp_toggle_actions(i);var a={action:"rsvp-form",ticket_id:_,going:n?"yes":"no"};e.tribe_rsvp_loader_start(),t.post(TribeRsvp.ajaxurl,a,function(t){s.find(".tribe-block__rsvp__message__success").remove();var i=r.find(".tribe-block__rsvp__form");if(i.html(t.data.html),window.tribe_event_tickets_plus){var _=i.find("input.tribe-tickets-quantity");window.tribe_event_tickets_plus.meta.block_set_quantity(_,n)}e.validate_submission(i)||(i.find(".tribe-block__rsvp__submit-button").attr("disabled",!0),e.state.submitActive=!1);e.tribe_rsvp_loader_end()})},e.events.handle_quantity_change=function(e){e.preventDefault();var i=t(this).parent().find('input[type="number"]'),s=t(this).hasClass("tribe-block__rsvp__number-input-button--plus"),r=i[0].step?Number(i[0].step):1,_=Number(i[0].value);if(s){var n=i[0].max?Number(i[0].max):-1;if("function"==typeof i[0].stepUp)try{i[0].stepUp()}catch(t){i[0].value=-1===n||n>=_+r?_+r:n}else i[0].value=-1===n||n>=_+r?_+r:n}else{var a=i[0].min?Number(i[0].min):0;if("function"==typeof i[0].stepDown)try{i[0].stepDown()}catch(t){i[0].value=a<=_-r?_-r:a}else i[0].value=a<=_-r?_-r:a}_!==i[0].value&&i.trigger("change")},e.events.handle_input_focus=function(i){e.state.submitActive||(t(i.target).siblings(".tribe-block__rsvp__submit-button").attr("disabled",!1),e.state.submitActive=!0)},e.tribe_rsvp_loader_start=function(e){t(".tribe-block__rsvp").find(".tribe-block__rsvp__loading").removeClass("tribe-common-a11y-hidden")},e.tribe_rsvp_loader_end=function(e){t(".tribe-block__rsvp").find(".tribe-block__rsvp__loading").addClass("tribe-common-a11y-hidden")},e.validate_submission=function(e){var i=e.find("input.tribe-tickets-quantity"),s=e.find("input.tribe-tickets-full-name"),r=e.find("input.tribe-tickets-email");return t.trim(s.val()).length&&t.trim(r.val()).length&&parseFloat(i.val())>0},e.events.handle_submission=function(i){i.preventDefault();var s=t(this).closest(".tribe-block__rsvp__ticket"),r=s.data("rsvp-id"),_=s.find("form"),n=e.validate_submission(_),a=!0,o=!!window.tribe_event_tickets_plus;if(o&&(a=window.tribe_event_tickets_plus.meta.validate_meta(_)),n&&a){var b=_.serializeArray();b.push({name:"action",value:"rsvp-process"}),b.push({name:"ticket_id",value:r}),e.tribe_rsvp_loader_start(),t.post(TribeRsvp.ajaxurl,b,function(t){var i=t.data.remaining;s.find(".tribe-block__rsvp__details .tribe-block__rsvp__availability").replaceWith(t.data.remaining_html),s.find(".tribe-block__rsvp__form").empty(),s.closest(".tribe-block__rsvp").append(t.data.html),0===i&&s.find(".tribe-block__rsvp__status").replaceWith(t.data.status_html),e.tribe_rsvp_loader_end()})}else n?_.find(".tribe-block__rsvp__message__error").hide():_.find(".tribe-block__rsvp__message__error").show(),o&&a?_.find(".tribe-event-tickets-meta-required-message").hide():_.find(".tribe-event-tickets-meta-required-message").show(),t("html, body").animate({scrollTop:_.offset().top-100},300)},e.bind_events=function(){t(".tribe-block__rsvp__ticket").on("click",".tribe-block__rsvp__status-button--going, .tribe-block__rsvp__status-button--not-going",e.events.handle_rsvp_response).on("click",'button[type="submit"]',e.events.handle_submission).on("click",".tribe-block__rsvp__number-input-button--minus, .tribe-block__rsvp__number-input-button--plus",e.events.handle_quantity_change).on("focus",".tribe-tickets-full-name, .tribe-tickets-email",e.events.handle_input_focus)},e.init=function(){t(".tribe-block__rsvp").length&&e.bind_events()},e.init()}(jQuery,tribe_tickets_rsvp_block);
src/resources/js/tickets-block.js CHANGED
@@ -480,7 +480,7 @@ tribe.tickets.block = {
480
  var new_value = ( -1 === max || max >= originalValue + step ) ? originalValue + step : max;
481
  var $parent = $input.closest( obj.selector.item );
482
 
483
- if ( 'true' === $parent.attr( 'data-shared-cap' ) ) {
484
  var $form = $parent.closest( 'form' );
485
  new_value = obj.checkSharedCapacity( $form, new_value );
486
  }
@@ -580,17 +580,16 @@ tribe.tickets.block = {
580
  obj.checkSharedCapacity = function ( $form, qty ) {
581
  var sharedCap = [];
582
  var currentLoad = [];
583
- var $sharedTickets = $form.find( obj.selector.item ).filter( '[data-shared-cap="true"]' );
584
- var $sharedCapFields = $sharedTickets.find( obj.selector.itemExtraAvailableQuantity );
585
  var $sharedCapTickets = $sharedTickets.find( obj.selector.itemQuantityInput );
586
 
587
  if ( ! $sharedTickets.length ) {
588
  return qty;
589
  }
590
 
591
- $sharedCapFields.each(
592
  function() {
593
- sharedCap.push( parseInt( $( this ).text(), 10 ) );
594
  }
595
  );
596
 
@@ -1572,7 +1571,7 @@ tribe.tickets.block = {
1572
  'change keyup',
1573
  obj.selector.itemQuantityInput,
1574
  function( e ) {
1575
- var $this = $( this );
1576
  var $ticket = $this.closest( obj.selector.item );
1577
  var $ticket_id = $ticket.data( 'ticket-id' );
1578
  var $form = $this.closest( 'form' );
@@ -1585,7 +1584,7 @@ tribe.tickets.block = {
1585
  $this.val( max );
1586
  }
1587
 
1588
- if ( 'true' === $ticket.attr( 'data-shared-cap' ) ) {
1589
  var maxQty = obj.checkSharedCapacity( $form, new_quantity );
1590
  }
1591
 
@@ -1620,6 +1619,26 @@ tribe.tickets.block = {
1620
  }
1621
  );
1622
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1623
  /**
1624
  * Handle Modal submission.
1625
  *
480
  var new_value = ( -1 === max || max >= originalValue + step ) ? originalValue + step : max;
481
  var $parent = $input.closest( obj.selector.item );
482
 
483
+ if ( 'true' === $parent.attr( 'data-has-shared-cap' ) ) {
484
  var $form = $parent.closest( 'form' );
485
  new_value = obj.checkSharedCapacity( $form, new_value );
486
  }
580
  obj.checkSharedCapacity = function ( $form, qty ) {
581
  var sharedCap = [];
582
  var currentLoad = [];
583
+ var $sharedTickets = $form.find( obj.selector.item ).filter( '[data-has-shared-cap="true"]' );
 
584
  var $sharedCapTickets = $sharedTickets.find( obj.selector.itemQuantityInput );
585
 
586
  if ( ! $sharedTickets.length ) {
587
  return qty;
588
  }
589
 
590
+ $sharedTickets.each(
591
  function() {
592
+ sharedCap.push( parseInt( $( this ).attr( 'data-shared-cap' ), 10 ) );
593
  }
594
  );
595
 
1571
  'change keyup',
1572
  obj.selector.itemQuantityInput,
1573
  function( e ) {
1574
+ var $this = $( e.target );
1575
  var $ticket = $this.closest( obj.selector.item );
1576
  var $ticket_id = $ticket.data( 'ticket-id' );
1577
  var $form = $this.closest( 'form' );
1584
  $this.val( max );
1585
  }
1586
 
1587
+ if ( 'true' === $ticket.attr( 'data-has-shared-cap' ) ) {
1588
  var maxQty = obj.checkSharedCapacity( $form, new_quantity );
1589
  }
1590
 
1619
  }
1620
  );
1621
 
1622
+ obj.document.on(
1623
+ 'keypress',
1624
+ obj.modalSelector.form,
1625
+ function( e ) {
1626
+
1627
+ if ( e.keyCode == 13 ) {
1628
+ var $form = $( e.target ).closest( obj.modalSelector.form );
1629
+ // Ensure we're on the modal form
1630
+ if ( 'undefined' === $form ) {
1631
+ return;
1632
+ }
1633
+
1634
+ e.preventDefault();
1635
+ e.stopPropagation();
1636
+ // Submit to cart. This will trigger validation as well.
1637
+ $form.find('[name="cart-button"]').click();
1638
+ }
1639
+ }
1640
+ );
1641
+
1642
  /**
1643
  * Handle Modal submission.
1644
  *
src/resources/js/tickets-block.min.js CHANGED
@@ -1 +1 @@
1
- var tribe=tribe||{};tribe.tickets=tribe.tickets||{},tribe.dialogs=tribe.dialogs||{},tribe.dialogs.events=tribe.dialogs.events||{},tribe.tickets.block={num_attendees:0,event:{}},function(t,e,i){"use strict";e.selector={blockFooter:".tribe-tickets__footer",blockFooterAmount:".tribe-amount",blockFooterQuantity:".tribe-tickets__footer__quantity__number",blockSubmit:".tribe-tickets__submit",container:"#tribe-tickets",hidden:"tribe-common-a11y-hidden",item:".tribe-tickets__item",itemExtraAvailable:".tribe-tickets__item__extra__available",itemExtraAvailableQuantity:".tribe-tickets__item__extra__available__quantity",itemOptOut:".tribe-tickets-attendees-list-optout--wrapper",itemOptOutInput:"#tribe-tickets-attendees-list-optout-",itemPrice:".tribe-amount",itemQuantity:".tribe-tickets__item__quantity",itemQuantityInput:".tribe-tickets-quantity",loader:".tribe-common-c-loader",submit:".tribe-tickets__buy",ticketLoader:".tribe-tickets-loader__tickets-block",validationNotice:".tribe-tickets__notice--error",ticketInCartNotice:"#tribe-tickets__notice__tickets-in-cart"};var r=t(e.selector.container);if(0!==r.length){e.document=t(document),e.modalSelector={cartForm:".tribe-modal__wrapper--ar #tribe-modal__cart",container:".tribe-modal__wrapper--ar",form:"#tribe-tickets__modal-form",itemRemove:".tribe-tickets__item__remove",itemTotal:".tribe-tickets__item__total .tribe-amount",loader:".tribe-tickets-loader__modal",metaField:".ticket-meta",metaForm:".tribe-modal__wrapper--ar #tribe-modal__attendee_registration",metaItem:".tribe-ticket",submit:".tribe-block__tickets__item__attendee__fields__footer_submit"},e.commerceSelector={edd:"Tribe__Tickets_Plus__Commerce__EDD__Main",rsvp:"Tribe__Tickets__RSVP",tpp:"Tribe__Tickets__Commerce__PayPal__Main",Tribe__Tickets__Commerce__PayPal__Main:"tribe-commerce",Tribe__Tickets__RSVP:"rsvp",Tribe__Tickets_Plus__Commerce__EDD__Main:"edd",Tribe__Tickets_Plus__Commerce__WooCommerce__Main:"woo",tribe_eddticket:"Tribe__Tickets_Plus__Commerce__EDD__Main",tribe_tpp_attendees:"Tribe__Tickets__Commerce__PayPal__Main",tribe_wooticket:"Tribe__Tickets_Plus__Commerce__WooCommerce__Main",woo:"Tribe__Tickets_Plus__Commerce__WooCommerce__Main"},e.tribe_ticket_provider=r.data("provider"),e.postId=t(".status-publish").attr("id").replace("post-","");var{__:a,_x:o,_n:c,_nx:n}=wp.i18n;e.init=function(){0<TribeTicketOptions.availability_check_interval&&e.checkAvailability(),TribeTicketOptions.ajax_preload_ticket_form&&(e.loaderShow(),e.initPrefill())},e.updateAvailability=function(i){Object.keys(i).forEach(function(r){var a=i[r].available,o=t(e.selector.item+"[data-ticket-id='"+r+"']");if(0===a){var c=i[r].unavailable_html;o.attr("available",!1),o.removeClass("instock"),o.removeClass("purchasable"),o.find(e.selector.itemQuantity).html(c),o.find(e.selector.itemExtraAvailable).html("")}1<a&&(o.find(e.selector.itemQuantityInput).attr({max:a}),o.find(e.selector.itemExtraAvailableQuantity).html(a))})},e.updateFooter=function(t){e.updateFooterCount(t),e.updateFooterAmount(t),t.find(".tribe-tickets__footer").addClass("tribe-tickets__footer--active")},e.updateFooterCount=function(i){var r=i.find(e.selector.blockFooter+" "+e.selector.blockFooterQuantity),a=0;if(i.find(e.selector.item+" "+e.selector.itemQuantityInput).each(function(){var e=parseInt(t(this).val(),10);e=isNaN(e)?0:e,a+=e}),i.hasClass("tribe-tickets")){var o=0>=a;t(e.selector.blockSubmit).prop("disabled",o)}0>a||r.text(a)},e.updateFooterAmount=function(i){var r=i.find(e.selector.blockFooter+" "+e.selector.blockFooterAmount),a=0;i.find(e.selector.item+" "+e.selector.itemQuantityInput).each(function(){var i=t(this).closest(e.selector.item).find(e.selector.itemPrice).first(),r=parseInt(t(this).val(),10);r=isNaN(r)?0:r;var o=i.text();o=e.cleanNumber(o),a+=o*r}),0>a||r.text(e.numberFormat(a))},e.updateFormTotals=function(i){i.find(e.selector.item).each(function(){var i=t(this),r=e.getQty(i),a=parseFloat(t(this).find(e.modalSelector.itemTotal).first().text().replace(",",""));"."===e.getCurrencyFormatting().thousands_sep&&(a=parseFloat(t(this).find(e.modalSelector.itemTotal).text().replace(/\./g,"").replace(",","."))),parseInt(r,10),a}),e.updateFooter(i),e.appendARFields(i)},e.updateItem=function(i,r,a){var o={};if(o.id=i,a){o.qty=e.getQty(a),o.price=e.getPrice(r),r.find(e.selector.itemQuantityInput).val(o.qty).trigger("change");var c=e.selector.itemOptOutInput+a.data("ticket-id");o.$optOut=t(c);var n=t(c+"-modal");o.$optOut.length&&o.$optOut.is(":checked")?n.val("1"):n.val("0")}else o.qty=e.getQty(r),o.price=e.getPrice(r);return e.updateTotal(o.qty,o.price,r),o},e.updateTotal=function(t,i,r){var a=(t*i).toFixed(e.getCurrencyFormatting().number_of_decimals);return r.find(e.modalSelector.itemTotal).text(e.numberFormat(a)),a},e.maybeShowNonMetaNotice=function(i){var r=0,a=0,o=i.find(e.selector.item).filter(function(i){return t(this).find(e.selector.itemQuantityInput).val()>0});if(o.length){o.each(function(){var i=t(this),o=i.closest(e.selector.item).data("ticket-id");t(e.modalSelector.metaForm).find('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+o+'"]').length?a+=e.getQty(i):r+=e.getQty(i)});var c=t(".tribe-tickets__notice--non-ar"),n=t(".tribe-tickets__item__attendee__fields__title");0<r&&0<a?(t("#tribe-tickets__non-ar-count").text(r),c.removeClass("tribe-common-a11y-hidden"),n.show()):(c.addClass("tribe-common-a11y-hidden"),n.hide())}},e.getRestEndpoint=function(){return TribeCartEndpoint.url},e.getTickets=function(){return t(e.selector.item).map(function(){return t(this).data("ticket-id")}).get()},e.maybeShowOptOut=function(t,i){if(t.has(e.selector.itemOptOut).length){var r=t.closest(e.selector.item).find(e.selector.itemOptOut);0<i?r.show():r.hide()}},e.appendARFields=function(i){i.find(e.selector.item).each(function(){var i=t(this);if(i.is(":visible")){var r=i.closest(e.selector.item).data("ticket-id"),a=t(e.modalSelector.metaForm).find('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+r+'"]');if(!a.length)return;var o=a.find(e.modalSelector.metaItem),c=e.getQty(i);if(0>=c)return a.removeClass("tribe-tickets--has-tickets"),void a.find(e.modalSelector.metaItem).remove();if(o.length>c){var n=o.length-c;a.find(".tribe-ticket:nth-last-child( -n+"+n+" )").remove()}else if(o.length<c){var s=window.wp.template("tribe-registration--"+r),l=0<o.length?o.length+1:1;a.addClass("tribe-tickets--has-tickets");for(var d=l;d<=c;d++){var m={attendee_id:d};a.append(s(m)),e.maybeHydrateAttendeeBlockFromLocal(o.length)}}}}),e.maybeShowNonMetaNotice(i),e.loaderHide(),e.document.trigger("tribe-ar-fields-appended")},e.stepUp=function(t,i){var r=t.attr("max")?Number(t.attr("max")):-1,a=t.attr("step")?Number(t.attr("step")):1,o=-1===r||r>=i+a?i+a:r,c=t.closest(e.selector.item);if("true"===c.attr("data-shared-cap")){var n=c.closest("form");o=e.checkSharedCapacity(n,o)}if(0!==o)if(0>o)t[0].value=i+o;else if("function"==typeof t[0].stepUp)try{t[0].stepUp()}catch(e){t.val(o)}else t.val(o)},e.stepDown=function(t,e){var i=t.attr("min")?Number(t.attr("min")):0,r=t.attr("step")?Number(t.attr("step")):1,a=i<=e-r&&0<e-r?e-r:i;if("function"==typeof t[0].stepDown)try{t[0].stepDown()}catch(e){t[0].value=a}else t[0].value=a},e.checkAvailability=function(){var i={action:"ticket_availability_check",tickets:e.getTickets()};t.post(TribeTicketOptions.ajaxurl,i,function(t){if(t.success){var i=t.data.tickets;e.updateAvailability(i)}}),0<TribeTicketOptions.availability_check_interval&&setTimeout(e.checkAvailability,TribeTicketOptions.availability_check_interval)},e.checkSharedCapacity=function(i,r){var a=[],o=[],c=i.find(e.selector.item).filter('[data-shared-cap="true"]'),n=c.find(e.selector.itemExtraAvailableQuantity),s=c.find(e.selector.itemQuantityInput);if(!c.length)return r;n.each(function(){a.push(parseInt(t(this).text(),10))}),s.each(function(){o.push(parseInt(t(this).val(),10))}),a=Math.max(...a),o=o.reduce(function(t,e){return t+e},0);var l=a-o;return Math.min(l,r)},e.getQty=function(t){var i=parseInt(t.find(e.selector.itemQuantityInput).val(),10);return isNaN(i)?0:i},e.getPrice=function(t){var i=e.cleanNumber(t.find(e.selector.itemPrice).first().text());return isNaN(i)?0:i},e.getCurrencyFormatting=function(){return JSON.parse(TribeCurrency.formatting)[e.tribe_ticket_provider]},e.cleanNumber=function(t){var i=e.getCurrencyFormatting();if(i.thousands_sep===i.decimal_point){var r=t.length-(i.number_of_decimals+1);t=(t=(t=t.substr(0,r)+"_"+t.substr(r+1)).split(i.thousands_sep).join("")).split("_").join(".")}else t=(t=t.split(i.thousands_sep).join("")).split(i.decimal_point).join(".");return t},e.numberFormat=function(t){var i=e.getCurrencyFormatting();if(!i)return!1;var r=i.number_of_decimals,a=i.decimal_point,o=i.thousands_sep,c=isFinite(+t)?+t:0,n=isFinite(+r)?Math.abs(r):0,s=void 0===o?",":o,l=void 0===a?".":a,d=(n?function(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i}(c,n):Math.round(c)).toString().split(l);return d[0].length>3&&(d[0]=d[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,s)),(d[1]||"").length<n&&(d[1]=d[1]||"",d[1]+=new Array(n-d[1].length+1).join("0")),d.join(l)},e.focusTicketBlock=function(i){t(i).closest(e.modalSelector.metaItem).addClass("tribe-ticket-item__has-focus")},e.unfocusTicketBlock=function(i){t(i).closest(e.modalSelector.metaItem).removeClass("tribe-ticket-item__has-focus")},e.loaderShow=function(i){void 0===i&&(i=e.selector.ticketLoader),t(e.selector.loader).filter(i).removeClass(e.selector.hidden)},e.loaderHide=function(i){void 0===i&&(i=e.selector.ticketLoader),t(e.selector.loader).filter(i).addClass(e.selector.hidden)},e.initPrefill=function(){e.prefillTicketsBlock()},e.initModalFormPrefills=function(){e.loaderShow(e.modalSelector.loader),t.when(e.getData()).then(function(i){if(e.prefillModalCartForm(t(e.modalSelector.cartForm)),i.meta){t.each(i.meta,function(t){r.find(`[data-ticket-id="${t.ticket_id}"]`).length&&e.prefillModalMetaForm(i.meta)})}var a=e.getLocal();a.meta&&e.prefillModalMetaForm(a.meta);window.setTimeout(e.loaderHide,500,e.modalSelector.loader)})},e.prefillModalMetaForm=function(i,r){if(!(void 0===i||0>=i.length)){if(void 0===r)r=0;var a=t(e.modalSelector.metaForm).find(".tribe-tickets__item__attendee__fields__container");if(0<r)i.splice(0,r-1);t.each(i,function(i,r){var o=0,c=a.find(e.modalSelector.metaItem).filter(`[data-ticket-id="${r.ticket_id}"]`);c.length&&t.each(r.items,function(e,i){"object"==typeof i&&(t.each(i,function(e,i){var r=c.eq(o).find(`[name*="${e}"]`);r.is(":radio")||r.is(":checkbox")?r.each(function(e){var r=t(this);i===r.val()&&r.prop("checked",!0)}):r.val(i)}),o++)})}),e.loaderHide(e.modalSelector.loader)}},e.prefillModalCartForm=function(i){i.find(e.selector.item).hide();var a=r.find(e.selector.item);t.each(a,function(e,r){var a=t(r),o=i.find('[data-ticket-id="'+a.attr("data-ticket-id")+'"]');o&&(0<a.find(".tribe-tickets-quantity").val()&&o.fadeIn())}),e.appendARFields(i),e.loaderHide(e.modalSelector.loader)},e.prefillTicketsBlock=function(){t.when(e.getData(!0)).then(function(i){var r=i.tickets;if(r.length){var a=0;r.forEach(function(i){var r=t(`.tribe-tickets__item[data-ticket-id="${i.ticket_id}"]`);if("true"===r.attr("data-available")){var o=r.find(e.selector.itemQuantityInput),c=r.find(e.selector.itemOptOutInput+i.ticket_id);o.length&&(o.val(i.quantity),o.trigger("change"),a+=i.quantity,1==parseInt(i.optout,10)&&c.prop("checked","true"))}}),0<a&&t(e.selector.ticketInCartNotice).fadeIn()}e.loaderHide()},function(){var i=t(e.selector.ticketInCartNotice);i.removeClass("tribe-tickets__notice--barred tribe-tickets__notice--barred-left").addClass("tribe-tickets__notice--error"),i.find(".tribe-tickets-notice__title").text(TribeMessages.api_error_title),i.find(".tribe-tickets-notice__content").text(TribeMessages.connection_error),i.fadeIn(),e.loaderHide()})},e.storeLocal=function(t){var i=e.getMetaForSave();sessionStorage.setItem("tribe_tickets_attendees-"+e.postId,window.JSON.stringify(i));var r=e.getTicketsForCart();sessionStorage.setItem("tribe_tickets_cart-"+e.postId,window.JSON.stringify(r))},e.getLocal=function(t){if(!t)t=e.postId;return{meta:window.JSON.parse(sessionStorage.getItem("tribe_tickets_attendees-"+t)),tickets:window.JSON.parse(sessionStorage.getItem("tribe_tickets_cart-"+t))}},e.clearLocal=function(t){if(!t)t=e.postId;sessionStorage.removeItem("tribe_tickets_attendees-"+t),sessionStorage.removeItem("tribe_tickets_cart-"+t)},e.maybeHydrateAttendeeBlockFromLocal=function(i){t.when(e.getData()).then(function(r){if(r.meta){var a=r.meta.length;if(i<a)e.prefillModalMetaForm(r.meta,i);else{var o=t(e.modalSelector.metaForm).find(e.modalSelector.metaItem).slice(i-1);o&&o.find(e.modalSelector.metaField).each(function(){var e=t(this),i=e.attr("name"),a=r[i];a&&e.val(a)})}}})},e.getTicketsForCart=function(){var i=[],r=t(e.modalSelector.cartForm);return r.length||(r=t(e.selector.container)),r.find(e.selector.item).each(function(){var r=t(this),a=r.data("ticketId"),o=r.find(e.selector.itemQuantityInput).val(),c=r.find('[name="attendee[optout]"]'),n=c.val();c.is(":checkbox")&&(n=c.prop("checked")?1:0);var s={};s.ticket_id=a,s.quantity=o,s.optout=n,i.push(s)}),i},e.getMetaForSave=function(){var i=t(e.modalSelector.metaForm).find(e.modalSelector.metaItem),r=[],a=[];return i.each(function(){var i={},r=t(this),o=r.data("ticketId"),c=r.find(e.modalSelector.metaField);c.length&&(a[o]||(a[o]={},a[o].ticket_id=o,a[o].items=[]),c.each(function(){var e=t(this),r=e.val(),a=e.is(":radio"),o=e.attr("name");if(o=(o=o.split("[")).pop().replace("]",""),(a||e.is(":checkbox"))&&!e.prop("checked")){if(a&&""!==i[o])return;r=""}i[o]=r}),a[o].items.push(i))}),Object.keys(a).forEach(function(t){var e={ticket_id:t,items:a[t].items};r.push(e)}),r},e.getData=function(i){var a={meta:{},tickets:{}},o=t.Deferred(),c=window.JSON.parse(sessionStorage.getItem("tribe_tickets_attendees-"+e.postId));if(null!==c&&(a.meta=c),!i){var n=window.JSON.parse(sessionStorage.getItem("tribe_tickets_cart-"+e.postId));null!==n&&n.length&&(a.tickets=n),o.resolve(a)}return a.tickets&&a.meta||t.ajax({type:"GET",data:{provider:r.data("providerId"),post_id:e.postId},dataType:"json",url:e.getRestEndpoint(),success:function(t){null===c&&sessionStorage.setItem("tribe_tickets_attendees-"+e.postId,window.JSON.stringify(t.meta)),sessionStorage.setItem("tribe_tickets_cart-"+e.postId,window.JSON.stringify(t.tickets));var i={meta:t.meta,tickets:t.tickets};o.resolve(i)},error:function(){o.reject(!1)}}),o.promise()},e.validateForm=function(i){var r=i.find(e.modalSelector.metaItem),a=!0,o=0;return r.each(function(){var i=t(this);e.validateBlock(i)||(o++,a=!1)}),[a,o]},e.validateBlock=function(i){var r=i.find(e.modalSelector.metaField),a=!0;return r.each(function(){var i=t(this);e.validateField(i[0])||(a=!1)}),a?i.removeClass("tribe-ticket-item__has-error"):i.addClass("tribe-ticket-item__has-error"),a},e.validateCheckboxRadioGroup=function(i){var r=i.find(e.modalSelector.metaField),a=!1,o=!0;return r.each(function(){var e=t(this);e.is(":checked")&&(a=!0),e.prop("required")||(o=!1)}),!o||a},e.validateField=function(i){var r=!0,a=t(i);if(!(r=i.checkValidity()))if((a=t(i)).is(":checkbox")||a.is(":radio")){var o=a.closest(".tribe-common-form-control-checkbox-radio-group");o.length&&(r=e.validateCheckboxRadioGroup(o))}else r=!1;return r?a.removeClass("ticket-meta__has-error"):a.addClass("ticket-meta__has-error"),r},e.document.on("click",".tribe-tickets__item__quantity__remove, .tribe-tickets__item__quantity__add",function(i){i.preventDefault();var r=t(this).parent().find('input[type="number"]');if(r.is(":disabled"))return!1;var a=Number(r[0].value),o=r.closest(e.modalSelector.cartForm);if(t(this).hasClass("tribe-tickets__item__quantity__add")?e.stepUp(r,a):e.stepDown(r,a),e.updateFooter(r.closest("form")),a!==r[0].value&&r.trigger("change"),o.length){var c=r.closest(e.selector.item);e.updateTotal(e.getQty(c),e.getPrice(c),c)}}),e.document.on("click",e.modalSelector.itemRemove,function(i){i.preventDefault();var r={},a=t(this).closest("form"),o=t(this).closest(e.selector.item);o.find(e.selector.itemQuantity).val(0),o.fadeOut(),r.id=o.data("ticketId"),r.qty=0,o.find(e.selector.itemQuantityInput).val(r.qty),r.price=e.getPrice(o),e.updateTotal(r.qty,r.price,o),e.updateFormTotals(a),t('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+r.id+'"]').removeClass("tribe-tickets--has-tickets").find(e.modalSelector.metaItem).remove();window.setTimeout(e.maybeShowNonMetaNotice,500,a),window.setTimeout(function(){if(0>=a.find(e.selector.item).filter(":visible").length){var i=t(e.selector.blockSubmit).attr("data-content"),r="dialog_obj_"+i.substring(i.lastIndexOf("-")+1);window[r].hide()}},500)}),e.document.on("focus",".tribe-ticket .ticket-meta",function(t){var i=t.target;e.focusTicketBlock(i)}),e.document.on("blur",".tribe-ticket .ticket-meta",function(t){var i=t.target;e.unfocusTicketBlock(i)}),e.document.on("change keyup",e.selector.itemQuantityInput,function(i){var r=t(this),a=r.closest(e.selector.item),o=(a.data("ticket-id"),r.closest("form")),c=r.attr("max"),n=parseInt(r.val(),10);if(c<(n=isNaN(n)?0:n)&&(n=c,r.val(c)),"true"===a.attr("data-shared-cap"))var s=e.checkSharedCapacity(o,n);0>s&&(n+=s,r.val(n)),i.preventDefault(),e.maybeShowOptOut(a,n),e.updateFooter(o),e.updateFormTotals(o)}),e.document.on("beforeunload",function(t){tribe.tickets.modal_redirect?e.clearLocal():e.storeLocal()}),e.document.on("click",e.modalSelector.submit,function(i){i.preventDefault();var r=t(this),a=t(e.modalSelector.form),o=t(e.modalSelector.metaForm),c=e.validateForm(o),n=t(e.selector.validationNotice),s=r.attr("name"),l=a.data("provider");if(e.loaderShow(e.modalSelector.loader),!c[0])return n.find(".tribe-tickets-notice__title").text(TribeMessages.validation_error_title),n.find("p").html(TribeMessages.validation_error),t(e.selector.validationNotice+"__count").text(c[1]),n.show(),e.loaderHide(e.modalSelector.loader),document.getElementById("tribe-tickets__notice__attendee-modal").scrollIntoView({behavior:"smooth",block:"start"}),!1;n.hide(),e.loaderShow(e.modalSelector.loader);var d=TribeTicketsURLs.checkout[l];-1!==s.indexOf("cart")&&(d=TribeTicketsURLs.cart[l]),t(e.modalSelector.form).attr("action",d);var m={tribe_tickets_provider:e.commerceSelector[e.tribe_ticket_provider],tribe_tickets_tickets:e.getTicketsForCart(),tribe_tickets_meta:e.getMetaForSave(),tribe_tickets_post_id:e.postId};t("#tribe_tickets_ar_data").val(JSON.stringify(m)),tribe.tickets.modal_redirect=!0,e.clearLocal(),a.submit()}),e.document.on("click",e.selector.submit,function(i){i.preventDefault();var r=t(this),a=t(e.selector.container);r.attr("name"),a.data("provider");e.loaderShow(e.selector.loader);var o={tribe_tickets_provider:e.commerceSelector[e.tribe_ticket_provider],tribe_tickets_tickets:e.getTicketsForCart(),tribe_tickets_meta:{},tribe_tickets_post_id:e.postId};t("#tribe_tickets_block_ar_data").val(JSON.stringify(o)),a.submit()}),t(i).on("tribe_dialog_show_ar_modal",function(i,a,o){e.loaderShow(),e.loaderShow(e.modalSelector.loader);var c=t(e.modalSelector.cartForm);r.find(e.selector.item).each(function(){var i=t(this),r=i.data("ticketId"),a=c.find('[data-ticket-id="'+r+'"]');a&&e.updateItem(r,a,i)}),e.initModalFormPrefills(),e.updateFormTotals(c),e.loaderHide(),e.loaderHide(e.modalSelector.loader)}),t(i).on("tribe_dialog_close_ar_modal",function(t,i,r){e.storeLocal()}),e.init(),window.addEventListener("pageshow",function(t){(t.persisted||void 0!==window.performance&&2===window.performance.navigation.type)&&e.init()})}}(jQuery,tribe.tickets.block,tribe.dialogs.events);
1
+ var tribe=tribe||{};tribe.tickets=tribe.tickets||{},tribe.dialogs=tribe.dialogs||{},tribe.dialogs.events=tribe.dialogs.events||{},tribe.tickets.block={num_attendees:0,event:{}},function(t,e,i){"use strict";e.selector={blockFooter:".tribe-tickets__footer",blockFooterAmount:".tribe-amount",blockFooterQuantity:".tribe-tickets__footer__quantity__number",blockSubmit:".tribe-tickets__submit",container:"#tribe-tickets",hidden:"tribe-common-a11y-hidden",item:".tribe-tickets__item",itemExtraAvailable:".tribe-tickets__item__extra__available",itemExtraAvailableQuantity:".tribe-tickets__item__extra__available__quantity",itemOptOut:".tribe-tickets-attendees-list-optout--wrapper",itemOptOutInput:"#tribe-tickets-attendees-list-optout-",itemPrice:".tribe-amount",itemQuantity:".tribe-tickets__item__quantity",itemQuantityInput:".tribe-tickets-quantity",loader:".tribe-common-c-loader",submit:".tribe-tickets__buy",ticketLoader:".tribe-tickets-loader__tickets-block",validationNotice:".tribe-tickets__notice--error",ticketInCartNotice:"#tribe-tickets__notice__tickets-in-cart"};var r=t(e.selector.container);if(0!==r.length){e.document=t(document),e.modalSelector={cartForm:".tribe-modal__wrapper--ar #tribe-modal__cart",container:".tribe-modal__wrapper--ar",form:"#tribe-tickets__modal-form",itemRemove:".tribe-tickets__item__remove",itemTotal:".tribe-tickets__item__total .tribe-amount",loader:".tribe-tickets-loader__modal",metaField:".ticket-meta",metaForm:".tribe-modal__wrapper--ar #tribe-modal__attendee_registration",metaItem:".tribe-ticket",submit:".tribe-block__tickets__item__attendee__fields__footer_submit"},e.commerceSelector={edd:"Tribe__Tickets_Plus__Commerce__EDD__Main",rsvp:"Tribe__Tickets__RSVP",tpp:"Tribe__Tickets__Commerce__PayPal__Main",Tribe__Tickets__Commerce__PayPal__Main:"tribe-commerce",Tribe__Tickets__RSVP:"rsvp",Tribe__Tickets_Plus__Commerce__EDD__Main:"edd",Tribe__Tickets_Plus__Commerce__WooCommerce__Main:"woo",tribe_eddticket:"Tribe__Tickets_Plus__Commerce__EDD__Main",tribe_tpp_attendees:"Tribe__Tickets__Commerce__PayPal__Main",tribe_wooticket:"Tribe__Tickets_Plus__Commerce__WooCommerce__Main",woo:"Tribe__Tickets_Plus__Commerce__WooCommerce__Main"},e.tribe_ticket_provider=r.data("provider"),e.postId=t(".status-publish").attr("id").replace("post-","");var{__:a,_x:o,_n:c,_nx:n}=wp.i18n;e.init=function(){0<TribeTicketOptions.availability_check_interval&&e.checkAvailability(),TribeTicketOptions.ajax_preload_ticket_form&&(e.loaderShow(),e.initPrefill())},e.updateAvailability=function(i){Object.keys(i).forEach(function(r){var a=i[r].available,o=t(e.selector.item+"[data-ticket-id='"+r+"']");if(0===a){var c=i[r].unavailable_html;o.attr("available",!1),o.removeClass("instock"),o.removeClass("purchasable"),o.find(e.selector.itemQuantity).html(c),o.find(e.selector.itemExtraAvailable).html("")}1<a&&(o.find(e.selector.itemQuantityInput).attr({max:a}),o.find(e.selector.itemExtraAvailableQuantity).html(a))})},e.updateFooter=function(t){e.updateFooterCount(t),e.updateFooterAmount(t),t.find(".tribe-tickets__footer").addClass("tribe-tickets__footer--active")},e.updateFooterCount=function(i){var r=i.find(e.selector.blockFooter+" "+e.selector.blockFooterQuantity),a=0;if(i.find(e.selector.item+" "+e.selector.itemQuantityInput).each(function(){var e=parseInt(t(this).val(),10);e=isNaN(e)?0:e,a+=e}),i.hasClass("tribe-tickets")){var o=0>=a;t(e.selector.blockSubmit).prop("disabled",o)}0>a||r.text(a)},e.updateFooterAmount=function(i){var r=i.find(e.selector.blockFooter+" "+e.selector.blockFooterAmount),a=0;i.find(e.selector.item+" "+e.selector.itemQuantityInput).each(function(){var i=t(this).closest(e.selector.item).find(e.selector.itemPrice).first(),r=parseInt(t(this).val(),10);r=isNaN(r)?0:r;var o=i.text();o=e.cleanNumber(o),a+=o*r}),0>a||r.text(e.numberFormat(a))},e.updateFormTotals=function(i){i.find(e.selector.item).each(function(){var i=t(this),r=e.getQty(i),a=parseFloat(t(this).find(e.modalSelector.itemTotal).first().text().replace(",",""));"."===e.getCurrencyFormatting().thousands_sep&&(a=parseFloat(t(this).find(e.modalSelector.itemTotal).text().replace(/\./g,"").replace(",","."))),parseInt(r,10),a}),e.updateFooter(i),e.appendARFields(i)},e.updateItem=function(i,r,a){var o={};if(o.id=i,a){o.qty=e.getQty(a),o.price=e.getPrice(r),r.find(e.selector.itemQuantityInput).val(o.qty).trigger("change");var c=e.selector.itemOptOutInput+a.data("ticket-id");o.$optOut=t(c);var n=t(c+"-modal");o.$optOut.length&&o.$optOut.is(":checked")?n.val("1"):n.val("0")}else o.qty=e.getQty(r),o.price=e.getPrice(r);return e.updateTotal(o.qty,o.price,r),o},e.updateTotal=function(t,i,r){var a=(t*i).toFixed(e.getCurrencyFormatting().number_of_decimals);return r.find(e.modalSelector.itemTotal).text(e.numberFormat(a)),a},e.maybeShowNonMetaNotice=function(i){var r=0,a=0,o=i.find(e.selector.item).filter(function(i){return t(this).find(e.selector.itemQuantityInput).val()>0});if(o.length){o.each(function(){var i=t(this),o=i.closest(e.selector.item).data("ticket-id");t(e.modalSelector.metaForm).find('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+o+'"]').length?a+=e.getQty(i):r+=e.getQty(i)});var c=t(".tribe-tickets__notice--non-ar"),n=t(".tribe-tickets__item__attendee__fields__title");0<r&&0<a?(t("#tribe-tickets__non-ar-count").text(r),c.removeClass("tribe-common-a11y-hidden"),n.show()):(c.addClass("tribe-common-a11y-hidden"),n.hide())}},e.getRestEndpoint=function(){return TribeCartEndpoint.url},e.getTickets=function(){return t(e.selector.item).map(function(){return t(this).data("ticket-id")}).get()},e.maybeShowOptOut=function(t,i){if(t.has(e.selector.itemOptOut).length){var r=t.closest(e.selector.item).find(e.selector.itemOptOut);0<i?r.show():r.hide()}},e.appendARFields=function(i){i.find(e.selector.item).each(function(){var i=t(this);if(i.is(":visible")){var r=i.closest(e.selector.item).data("ticket-id"),a=t(e.modalSelector.metaForm).find('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+r+'"]');if(!a.length)return;var o=a.find(e.modalSelector.metaItem),c=e.getQty(i);if(0>=c)return a.removeClass("tribe-tickets--has-tickets"),void a.find(e.modalSelector.metaItem).remove();if(o.length>c){var n=o.length-c;a.find(".tribe-ticket:nth-last-child( -n+"+n+" )").remove()}else if(o.length<c){var s=window.wp.template("tribe-registration--"+r),l=0<o.length?o.length+1:1;a.addClass("tribe-tickets--has-tickets");for(var d=l;d<=c;d++){var m={attendee_id:d};a.append(s(m)),e.maybeHydrateAttendeeBlockFromLocal(o.length)}}}}),e.maybeShowNonMetaNotice(i),e.loaderHide(),e.document.trigger("tribe-ar-fields-appended")},e.stepUp=function(t,i){var r=t.attr("max")?Number(t.attr("max")):-1,a=t.attr("step")?Number(t.attr("step")):1,o=-1===r||r>=i+a?i+a:r,c=t.closest(e.selector.item);if("true"===c.attr("data-has-shared-cap")){var n=c.closest("form");o=e.checkSharedCapacity(n,o)}if(0!==o)if(0>o)t[0].value=i+o;else if("function"==typeof t[0].stepUp)try{t[0].stepUp()}catch(e){t.val(o)}else t.val(o)},e.stepDown=function(t,e){var i=t.attr("min")?Number(t.attr("min")):0,r=t.attr("step")?Number(t.attr("step")):1,a=i<=e-r&&0<e-r?e-r:i;if("function"==typeof t[0].stepDown)try{t[0].stepDown()}catch(e){t[0].value=a}else t[0].value=a},e.checkAvailability=function(){var i={action:"ticket_availability_check",tickets:e.getTickets()};t.post(TribeTicketOptions.ajaxurl,i,function(t){if(t.success){var i=t.data.tickets;e.updateAvailability(i)}}),0<TribeTicketOptions.availability_check_interval&&setTimeout(e.checkAvailability,TribeTicketOptions.availability_check_interval)},e.checkSharedCapacity=function(i,r){var a=[],o=[],c=i.find(e.selector.item).filter('[data-has-shared-cap="true"]'),n=c.find(e.selector.itemQuantityInput);if(!c.length)return r;c.each(function(){a.push(parseInt(t(this).attr("data-shared-cap"),10))}),n.each(function(){o.push(parseInt(t(this).val(),10))}),a=Math.max(...a),o=o.reduce(function(t,e){return t+e},0);var s=a-o;return Math.min(s,r)},e.getQty=function(t){var i=parseInt(t.find(e.selector.itemQuantityInput).val(),10);return isNaN(i)?0:i},e.getPrice=function(t){var i=e.cleanNumber(t.find(e.selector.itemPrice).first().text());return isNaN(i)?0:i},e.getCurrencyFormatting=function(){return JSON.parse(TribeCurrency.formatting)[e.tribe_ticket_provider]},e.cleanNumber=function(t){var i=e.getCurrencyFormatting();if(i.thousands_sep===i.decimal_point){var r=t.length-(i.number_of_decimals+1);t=(t=(t=t.substr(0,r)+"_"+t.substr(r+1)).split(i.thousands_sep).join("")).split("_").join(".")}else t=(t=t.split(i.thousands_sep).join("")).split(i.decimal_point).join(".");return t},e.numberFormat=function(t){var i=e.getCurrencyFormatting();if(!i)return!1;var r=i.number_of_decimals,a=i.decimal_point,o=i.thousands_sep,c=isFinite(+t)?+t:0,n=isFinite(+r)?Math.abs(r):0,s=void 0===o?",":o,l=void 0===a?".":a,d=(n?function(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i}(c,n):Math.round(c)).toString().split(l);return d[0].length>3&&(d[0]=d[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,s)),(d[1]||"").length<n&&(d[1]=d[1]||"",d[1]+=new Array(n-d[1].length+1).join("0")),d.join(l)},e.focusTicketBlock=function(i){t(i).closest(e.modalSelector.metaItem).addClass("tribe-ticket-item__has-focus")},e.unfocusTicketBlock=function(i){t(i).closest(e.modalSelector.metaItem).removeClass("tribe-ticket-item__has-focus")},e.loaderShow=function(i){void 0===i&&(i=e.selector.ticketLoader),t(e.selector.loader).filter(i).removeClass(e.selector.hidden)},e.loaderHide=function(i){void 0===i&&(i=e.selector.ticketLoader),t(e.selector.loader).filter(i).addClass(e.selector.hidden)},e.initPrefill=function(){e.prefillTicketsBlock()},e.initModalFormPrefills=function(){e.loaderShow(e.modalSelector.loader),t.when(e.getData()).then(function(i){if(e.prefillModalCartForm(t(e.modalSelector.cartForm)),i.meta){t.each(i.meta,function(t){r.find(`[data-ticket-id="${t.ticket_id}"]`).length&&e.prefillModalMetaForm(i.meta)})}var a=e.getLocal();a.meta&&e.prefillModalMetaForm(a.meta);window.setTimeout(e.loaderHide,500,e.modalSelector.loader)})},e.prefillModalMetaForm=function(i,r){if(!(void 0===i||0>=i.length)){if(void 0===r)r=0;var a=t(e.modalSelector.metaForm).find(".tribe-tickets__item__attendee__fields__container");if(0<r)i.splice(0,r-1);t.each(i,function(i,r){var o=0,c=a.find(e.modalSelector.metaItem).filter(`[data-ticket-id="${r.ticket_id}"]`);c.length&&t.each(r.items,function(e,i){"object"==typeof i&&(t.each(i,function(e,i){var r=c.eq(o).find(`[name*="${e}"]`);r.is(":radio")||r.is(":checkbox")?r.each(function(e){var r=t(this);i===r.val()&&r.prop("checked",!0)}):r.val(i)}),o++)})}),e.loaderHide(e.modalSelector.loader)}},e.prefillModalCartForm=function(i){i.find(e.selector.item).hide();var a=r.find(e.selector.item);t.each(a,function(e,r){var a=t(r),o=i.find('[data-ticket-id="'+a.attr("data-ticket-id")+'"]');o&&(0<a.find(".tribe-tickets-quantity").val()&&o.fadeIn())}),e.appendARFields(i),e.loaderHide(e.modalSelector.loader)},e.prefillTicketsBlock=function(){t.when(e.getData(!0)).then(function(i){var r=i.tickets;if(r.length){var a=0;r.forEach(function(i){var r=t(`.tribe-tickets__item[data-ticket-id="${i.ticket_id}"]`);if("true"===r.attr("data-available")){var o=r.find(e.selector.itemQuantityInput),c=r.find(e.selector.itemOptOutInput+i.ticket_id);o.length&&(o.val(i.quantity),o.trigger("change"),a+=i.quantity,1==parseInt(i.optout,10)&&c.prop("checked","true"))}}),0<a&&t(e.selector.ticketInCartNotice).fadeIn()}e.loaderHide()},function(){var i=t(e.selector.ticketInCartNotice);i.removeClass("tribe-tickets__notice--barred tribe-tickets__notice--barred-left").addClass("tribe-tickets__notice--error"),i.find(".tribe-tickets-notice__title").text(TribeMessages.api_error_title),i.find(".tribe-tickets-notice__content").text(TribeMessages.connection_error),i.fadeIn(),e.loaderHide()})},e.storeLocal=function(t){var i=e.getMetaForSave();sessionStorage.setItem("tribe_tickets_attendees-"+e.postId,window.JSON.stringify(i));var r=e.getTicketsForCart();sessionStorage.setItem("tribe_tickets_cart-"+e.postId,window.JSON.stringify(r))},e.getLocal=function(t){if(!t)t=e.postId;return{meta:window.JSON.parse(sessionStorage.getItem("tribe_tickets_attendees-"+t)),tickets:window.JSON.parse(sessionStorage.getItem("tribe_tickets_cart-"+t))}},e.clearLocal=function(t){if(!t)t=e.postId;sessionStorage.removeItem("tribe_tickets_attendees-"+t),sessionStorage.removeItem("tribe_tickets_cart-"+t)},e.maybeHydrateAttendeeBlockFromLocal=function(i){t.when(e.getData()).then(function(r){if(r.meta){var a=r.meta.length;if(i<a)e.prefillModalMetaForm(r.meta,i);else{var o=t(e.modalSelector.metaForm).find(e.modalSelector.metaItem).slice(i-1);o&&o.find(e.modalSelector.metaField).each(function(){var e=t(this),i=e.attr("name"),a=r[i];a&&e.val(a)})}}})},e.getTicketsForCart=function(){var i=[],r=t(e.modalSelector.cartForm);return r.length||(r=t(e.selector.container)),r.find(e.selector.item).each(function(){var r=t(this),a=r.data("ticketId"),o=r.find(e.selector.itemQuantityInput).val(),c=r.find('[name="attendee[optout]"]'),n=c.val();c.is(":checkbox")&&(n=c.prop("checked")?1:0);var s={};s.ticket_id=a,s.quantity=o,s.optout=n,i.push(s)}),i},e.getMetaForSave=function(){var i=t(e.modalSelector.metaForm).find(e.modalSelector.metaItem),r=[],a=[];return i.each(function(){var i={},r=t(this),o=r.data("ticketId"),c=r.find(e.modalSelector.metaField);c.length&&(a[o]||(a[o]={},a[o].ticket_id=o,a[o].items=[]),c.each(function(){var e=t(this),r=e.val(),a=e.is(":radio"),o=e.attr("name");if(o=(o=o.split("[")).pop().replace("]",""),(a||e.is(":checkbox"))&&!e.prop("checked")){if(a&&""!==i[o])return;r=""}i[o]=r}),a[o].items.push(i))}),Object.keys(a).forEach(function(t){var e={ticket_id:t,items:a[t].items};r.push(e)}),r},e.getData=function(i){var a={meta:{},tickets:{}},o=t.Deferred(),c=window.JSON.parse(sessionStorage.getItem("tribe_tickets_attendees-"+e.postId));if(null!==c&&(a.meta=c),!i){var n=window.JSON.parse(sessionStorage.getItem("tribe_tickets_cart-"+e.postId));null!==n&&n.length&&(a.tickets=n),o.resolve(a)}return a.tickets&&a.meta||t.ajax({type:"GET",data:{provider:r.data("providerId"),post_id:e.postId},dataType:"json",url:e.getRestEndpoint(),success:function(t){null===c&&sessionStorage.setItem("tribe_tickets_attendees-"+e.postId,window.JSON.stringify(t.meta)),sessionStorage.setItem("tribe_tickets_cart-"+e.postId,window.JSON.stringify(t.tickets));var i={meta:t.meta,tickets:t.tickets};o.resolve(i)},error:function(){o.reject(!1)}}),o.promise()},e.validateForm=function(i){var r=i.find(e.modalSelector.metaItem),a=!0,o=0;return r.each(function(){var i=t(this);e.validateBlock(i)||(o++,a=!1)}),[a,o]},e.validateBlock=function(i){var r=i.find(e.modalSelector.metaField),a=!0;return r.each(function(){var i=t(this);e.validateField(i[0])||(a=!1)}),a?i.removeClass("tribe-ticket-item__has-error"):i.addClass("tribe-ticket-item__has-error"),a},e.validateCheckboxRadioGroup=function(i){var r=i.find(e.modalSelector.metaField),a=!1,o=!0;return r.each(function(){var e=t(this);e.is(":checked")&&(a=!0),e.prop("required")||(o=!1)}),!o||a},e.validateField=function(i){var r=!0,a=t(i);if(!(r=i.checkValidity()))if((a=t(i)).is(":checkbox")||a.is(":radio")){var o=a.closest(".tribe-common-form-control-checkbox-radio-group");o.length&&(r=e.validateCheckboxRadioGroup(o))}else r=!1;return r?a.removeClass("ticket-meta__has-error"):a.addClass("ticket-meta__has-error"),r},e.document.on("click",".tribe-tickets__item__quantity__remove, .tribe-tickets__item__quantity__add",function(i){i.preventDefault();var r=t(this).parent().find('input[type="number"]');if(r.is(":disabled"))return!1;var a=Number(r[0].value),o=r.closest(e.modalSelector.cartForm);if(t(this).hasClass("tribe-tickets__item__quantity__add")?e.stepUp(r,a):e.stepDown(r,a),e.updateFooter(r.closest("form")),a!==r[0].value&&r.trigger("change"),o.length){var c=r.closest(e.selector.item);e.updateTotal(e.getQty(c),e.getPrice(c),c)}}),e.document.on("click",e.modalSelector.itemRemove,function(i){i.preventDefault();var r={},a=t(this).closest("form"),o=t(this).closest(e.selector.item);o.find(e.selector.itemQuantity).val(0),o.fadeOut(),r.id=o.data("ticketId"),r.qty=0,o.find(e.selector.itemQuantityInput).val(r.qty),r.price=e.getPrice(o),e.updateTotal(r.qty,r.price,o),e.updateFormTotals(a),t('.tribe-tickets__item__attendee__fields__container[data-ticket-id="'+r.id+'"]').removeClass("tribe-tickets--has-tickets").find(e.modalSelector.metaItem).remove();window.setTimeout(e.maybeShowNonMetaNotice,500,a),window.setTimeout(function(){if(0>=a.find(e.selector.item).filter(":visible").length){var i=t(e.selector.blockSubmit).attr("data-content"),r="dialog_obj_"+i.substring(i.lastIndexOf("-")+1);window[r].hide()}},500)}),e.document.on("focus",".tribe-ticket .ticket-meta",function(t){var i=t.target;e.focusTicketBlock(i)}),e.document.on("blur",".tribe-ticket .ticket-meta",function(t){var i=t.target;e.unfocusTicketBlock(i)}),e.document.on("change keyup",e.selector.itemQuantityInput,function(i){var r=t(i.target),a=r.closest(e.selector.item),o=(a.data("ticket-id"),r.closest("form")),c=r.attr("max"),n=parseInt(r.val(),10);if(c<(n=isNaN(n)?0:n)&&(n=c,r.val(c)),"true"===a.attr("data-has-shared-cap"))var s=e.checkSharedCapacity(o,n);0>s&&(n+=s,r.val(n)),i.preventDefault(),e.maybeShowOptOut(a,n),e.updateFooter(o),e.updateFormTotals(o)}),e.document.on("beforeunload",function(t){tribe.tickets.modal_redirect?e.clearLocal():e.storeLocal()}),e.document.on("keypress",e.modalSelector.form,function(i){if(13==i.keyCode){var r=t(i.target).closest(e.modalSelector.form);if("undefined"===r)return;i.preventDefault(),i.stopPropagation(),r.find('[name="cart-button"]').click()}}),e.document.on("click",e.modalSelector.submit,function(i){i.preventDefault();var r=t(this),a=t(e.modalSelector.form),o=t(e.modalSelector.metaForm),c=e.validateForm(o),n=t(e.selector.validationNotice),s=r.attr("name"),l=a.data("provider");if(e.loaderShow(e.modalSelector.loader),!c[0])return n.find(".tribe-tickets-notice__title").text(TribeMessages.validation_error_title),n.find("p").html(TribeMessages.validation_error),t(e.selector.validationNotice+"__count").text(c[1]),n.show(),e.loaderHide(e.modalSelector.loader),document.getElementById("tribe-tickets__notice__attendee-modal").scrollIntoView({behavior:"smooth",block:"start"}),!1;n.hide(),e.loaderShow(e.modalSelector.loader);var d=TribeTicketsURLs.checkout[l];-1!==s.indexOf("cart")&&(d=TribeTicketsURLs.cart[l]),t(e.modalSelector.form).attr("action",d);var m={tribe_tickets_provider:e.commerceSelector[e.tribe_ticket_provider],tribe_tickets_tickets:e.getTicketsForCart(),tribe_tickets_meta:e.getMetaForSave(),tribe_tickets_post_id:e.postId};t("#tribe_tickets_ar_data").val(JSON.stringify(m)),tribe.tickets.modal_redirect=!0,e.clearLocal(),a.submit()}),e.document.on("click",e.selector.submit,function(i){i.preventDefault();var r=t(this),a=t(e.selector.container);r.attr("name"),a.data("provider");e.loaderShow(e.selector.loader);var o={tribe_tickets_provider:e.commerceSelector[e.tribe_ticket_provider],tribe_tickets_tickets:e.getTicketsForCart(),tribe_tickets_meta:{},tribe_tickets_post_id:e.postId};t("#tribe_tickets_block_ar_data").val(JSON.stringify(o)),a.submit()}),t(i).on("tribe_dialog_show_ar_modal",function(i,a,o){e.loaderShow(),e.loaderShow(e.modalSelector.loader);var c=t(e.modalSelector.cartForm);r.find(e.selector.item).each(function(){var i=t(this),r=i.data("ticketId"),a=c.find('[data-ticket-id="'+r+'"]');a&&e.updateItem(r,a,i)}),e.initModalFormPrefills(),e.updateFormTotals(c),e.loaderHide(),e.loaderHide(e.modalSelector.loader)}),t(i).on("tribe_dialog_close_ar_modal",function(t,i,r){e.storeLocal()}),e.init(),window.addEventListener("pageshow",function(t){(t.persisted||void 0!==window.performance&&2===window.performance.navigation.type)&&e.init()})}}(jQuery,tribe.tickets.block,tribe.dialogs.events);
src/resources/js/tickets.js CHANGED
@@ -612,7 +612,7 @@ var ticketHeaderImage = window.ticketHeaderImage || {};
612
  var $orders = $base_panel.find( '.tribe-ticket-field-order' );
613
  var params = {
614
  action: 'tribe-ticket-add',
615
- data: $edit_panel.find( 'input,textarea' ).serialize(),
616
  post_id: $post_id.val(),
617
  nonce: TribeTickets.add_ticket_nonce,
618
  menu_order: $orders.length,
612
  var $orders = $base_panel.find( '.tribe-ticket-field-order' );
613
  var params = {
614
  action: 'tribe-ticket-add',
615
+ data: $edit_panel.find( 'input,textarea' ).serialize().replace( /\'/g, '%27' ).replace( /\:/g, '%3A' ),
616
  post_id: $post_id.val(),
617
  nonce: TribeTickets.add_ticket_nonce,
618
  menu_order: $orders.length,
src/resources/js/tickets.min.js CHANGED
@@ -1 +1 @@
1
- void 0===tribe.tickets&&(tribe.tickets={}),"undefined"==typeof ajaxurl&&(ajaxurl=TribeTickets.ajaxurl),tribe.tickets.editor={};var ticketHeaderImage=window.ticketHeaderImage||{};!function(e,t,i,a){"use strict";t("html, body");var n=t(document),r=t(document.getElementById("tribetickets"));if(0!==r.length){var c=t(document.getElementById("event_tickets")),d=t(document.getElementById("post_ID")),o=t(document.getElementById("publish")),s=r.find(".tribe-tickets-editor-blocker"),l=r.find(".spinner"),_=t(document.getElementById("tribe_panel_base")),p=t(document.getElementById("tribe_panel_edit")),m=t(document.getElementById("tribe_panel_settings")),u=["yy-mm-dd","m/d/yy","mm/dd/yy","d/m/yy","dd/mm/yy","m-d-yy","mm-dd-yy","d-m-yy","dd-mm-yy","yy.mm.dd","mm.dd.yy","dd.mm.yy"],f=u[0];a.beforeUnload=function(e){var t=!1;return"true"===_.attr("aria-hidden")&&(t=tribe_global_stock_admin_ui.nav_away_msg),e.returnValue=t,t},ticketHeaderImage={uploader:function(){var e=wp.media({title:HeaderImageData.title,multiple:!1,library:{type:"image"},button:{text:HeaderImageData.button}});return e.on("close",function(){var t=e.state().get("selection").toJSON();t.length&&ticketHeaderImage.render(t[0])}),e.open(),!1},render:function(e){t(document.getElementById("tribe_ticket_header_preview")).html(ticketHeaderImage.imgHTML(e)),t(document.getElementById("tribe_ticket_header_image_id")).val(e.id),t(document.getElementById("tribe_ticket_header_remove")).show(),t(document.getElementById("tribe_tickets_image_preview_filename")).show().find(".filename").text(e.filename)},imgHTML:function(e){var t='<img src="'+e.url+'" ';return t+='width="'+e.width+'" ',t+='height="'+e.height+'" ',t+="/>"}},a.panels={list:"#tribe_panel_base",ticket:"#tribe_panel_edit",settings:"#tribe_panel_settings"},a.swapPanel=function(i){var c;c=i instanceof jQuery?i:void 0!==a.panels[i]?t(a.panels[i]):_;var d=t("#event_tickets");d.trigger("before_panel_swap.tickets",{panel:c}),r.find(".ticket_panel").each(function(){t(this).attr("aria-hidden",!0)}),c.attr("aria-hidden",!1),c.is(_)?(t(e).off("beforeunload.tribe"),n.trigger("tribe.dependencies-run")):t(e).on("beforeunload.tribe",a.beforeUnload),d.trigger("after_panel_swap.tickets",{panel:c})},a.fetchPanels=function(e,i){void 0===e&&(e=[]);var n={action:"tribe-ticket-panels",notice:!1,post_id:d.val(),nonce:TribeTickets.add_ticket_nonce,data:e,is_admin:t("body").hasClass("wp-admin")};t.post(ajaxurl,n,function(e){e.success&&a.refreshPanels(e.data,i)},"json")},a.startWatchingMoveLinkIn=function(){c.find(".tribe-ticket-move-link").one("click",function(){e.setTimeout(a.listentToThickboxEvents,250)})},a.listentToThickboxEvents=function(){var e=t("#TB_window");0!==e.length&&e.one("tb_unload",function(){a.fetchPanels(null,"list")})},a.refreshPanels=function(e,i){_=t(e.list),p=t(e.ticket),m=t(e.settings),r.find(a.panels.list).replaceWith(_),r.find(a.panels.ticket).replaceWith(p),r.find(a.panels.settings).replaceWith(m),a.setupPanels(),a.swapPanel(i)},a.setupPanels=function(){e.MTAccordion({target:".accordion"});var i=t(document.getElementById("tribe-event-datepickers")),a=t(document.getElementById("ticket_start_date")),n=t(document.getElementById("ticket_end_date"));t(document.getElementById("ticket_start_time")),t(document.getElementById("ticket_end_time"));if("undefined"==typeof tribe_datepicker_opts){var c=t("[data-datepicker_format]"),d=c.length?c.attr("data-datepicker_format"):"",o=parseInt(d,10);isNaN(o)||(e.tribe_datepicker_opts={dateFormat:u[o]})}var s=e.tribe_datepicker_opts||{};if(i.length&&i.data("startofweek"),"undefined"!=typeof tribe_ticket_datepicker_format){var l=t.isNumeric(tribe_ticket_datepicker_format.datepicker_format_index)?tribe_ticket_datepicker_format.datepicker_format_index:0;f=u[l]}else s&&s.dateFormat&&(f=s.dateFormat);var p={dateFormat:f,showAnim:"fadeIn",changeMonth:!0,changeYear:!0,numberOfMonths:3,showButtonPanel:!1,onChange:function(){},beforeShow:function(e,i){i.input.data("prevDate",i.input.datepicker("getDate"));var a=t(i.dpDiv);a.addClass("tribe-ui-datepicker"),a.attrchange({trackValues:!0,callback:function(e){(e.newValue.indexOf("display: none")>=0||e.newValue.indexOf("display:none")>=0)&&a.removeClass("tribe-ui-datepicker")}})},onSelect:function(e,i){var r=t.datepicker.parseDate(f,e);"ticket_start_date"===i.id?n.datepicker("option","minDate",r):a.datepicker("option","maxDate",r)}};t.extend(p,tribe_l10n_datatables.datepicker);var m=r.find(".tribe-timepicker:not(.ui-timepicker-input)");if(tribe_timepickers.setup_timepickers(m),a.datepicker(p).datepicker("option","defaultDate",t(document.getElementById("EventStartDate")).val()).keyup(function(e){8!==e.keyCode&&46!==e.keyCode||t.datepicker._clearDate(this)}),n.datepicker(p).datepicker("option","defaultDate",t(document.getElementById("EventEndDate")).val()).keyup(function(e){8!==e.keyCode&&46!==e.keyCode||t.datepicker._clearDate(this)}),t(document.getElementById("tribe_ticket_header_preview")).find("img").length){t(document.getElementById("tribe_ticket_header_remove")).show();var k=t(document.getElementById("tribe_ticket_header_preview")).find("img");k.removeAttr("width").removeAttr("height"),r.width()<k.width()&&k.css("width","95%")}"undefined"!=typeof tribe_event_tickets_plus&&t.isPlainObject(tribe_event_tickets_plus)&&t.isPlainObject(tribe_event_tickets_plus.meta)&&t.isPlainObject(tribe_event_tickets_plus.meta.admin)&&t.isFunction(tribe_event_tickets_plus.meta.admin.init_ticket_fields)&&tribe_event_tickets_plus.meta.admin.init_ticket_fields(),tribe.tickets.table&&0!==_.find(".tribe-tickets-editor-table-tickets-body tr").length&&tribe.tickets.table.toggle_sortable(),r.find(tribe.validation.selectors.item).validation(),r.find(".tribe-dependent").dependency(),r.find(".tribe-dependency").trigger("verify.dependency")},n.ajaxSend(function(e,i,a){"string"===t.type(a.data)&&-1!==a.data.indexOf("action=tribe-ticket")&&r.trigger("spin.tribe","start")}),n.ajaxComplete(function(e,i,a){"string"===t.type(a.data)&&-1!==a.data.indexOf("action=tribe-ticket")&&r.trigger("spin.tribe","stop")}),n.on({"spin.tribe":function(e,i){(void 0===i||t.inArray(i,["start","stop"]))&&(i="stop"),"stop"===i?(s.hide(),l.removeClass("is-active")):(s.show(),l.addClass("is-active"))}}),o.on("click",function(i){t(e).off("beforeunload.tribe")}),n.on("click","#settings_form_toggle",function(e){return e.preventDefault(),a.fetchPanels(null,"settings"),!1}),n.on("click","#tribe_settings_form_cancel, #ticket_form_cancel",function(e){return e.preventDefault(),a.fetchPanels(null,"list"),!1}),n.on("click","#tribe_settings_form_save",function(e){e.preventDefault();var t=m.find("input,textarea").serialize();return a.fetchPanels(t,"list"),!1}),n.on("click",".ticket_form_toggle",function(e){return e.preventDefault(),function(e){void 0===e&&(e=!0);var i,a=r.find(".tribe-ticket-editor-field-default_provider");a.is(":radio")&&(a=a.filter(":checked")),i=e?"Tribe__Tickets__RSVP_radio":"Tribe__Tickets_Plus__Commerce__WooCommerce__Main_radio",!e&&a.length>0&&(i=a.val()+"_radio"),t(document.getElementById(i)).prop("checked",!0).trigger("change")}("rsvp_form_toggle"===t(this).attr("id")),p.find(".tribe-dependency").trigger("verify.dependency"),a.swapPanel("ticket"),!1}),n.on("click",".ticket_edit_button",function(e){e.preventDefault();var i=t(this),n={action:"tribe-ticket-edit",post_id:d.val(),ticket_id:i.data("ticketId"),nonce:TribeTickets.edit_ticket_nonce,is_admin:t("body").hasClass("wp-admin")};return t.post(ajaxurl,n,function(e){e.success&&(a.refreshPanels(e.data,"ticket"),a.startWatchingMoveLinkIn("#event_tickets"))},"json"),!1}),n.on("click.tribe",'[name="ticket_form_save"]',function(e){var i=t(document.getElementById("ticket_form_table"));if(i.trigger("validation.tribe"),!tribe.validation.hasErrors(i)){r.trigger("pre-save-ticket.tribe",e);var n=_.find(".tribe-ticket-field-order"),c={action:"tribe-ticket-add",data:p.find("input,textarea").serialize(),post_id:d.val(),nonce:TribeTickets.add_ticket_nonce,menu_order:n.length,is_admin:t("body").hasClass("wp-admin")};t.post(ajaxurl,c,function(e){e.success&&a.refreshPanels(e.data)},"json")}}),n.on("click",".ticket_delete",function(e){if(!confirm(tribe_ticket_notices.confirm_alert))return!1;e.preventDefault(),r.trigger("delete-ticket.tribe",e);var i=t(this).attr("attr-ticket-id"),n={action:"tribe-ticket-delete",post_id:d.val(),ticket_id:i,nonce:TribeTickets.remove_ticket_nonce,is_admin:t("body").hasClass("wp-admin")};t.post(ajaxurl,n,function(e){e.success&&a.refreshPanels(e.data)},"json")}),n.on("change",".tribe-ticket-field-capacity",function(e){var i=t(this),a=i.parents(".input_block").eq(0).find(".tribe-ticket-field-mode");i.val()&&a.val("capped")}),n.on("keyup","#ticket_price",function(e){e.preventDefault();var i=price_format.decimal,a=new RegExp("[^-0-9%\\"+i+"]+","gi"),n=t(this).val(),r=n.replace(a,"");n!==r&&t(this).val(r)}),n.on("click","#tribe_ticket_header_image, #tribe_ticket_header_preview",function(e){e.preventDefault(),ticketHeaderImage.uploader("","")}),n.on("focus","#settings_global_capacity_edit",function(){var e=t(this),i=0;t(".tribe-tickets-editor-capacity-table").find("[data-capacity]").each(function(){var e=t(this);i+=parseInt(e.data("capacity"),10)}),e.data("nonSharedCapacity",i)}),n.on("blur change","#settings_global_capacity_edit",function(){var e=t(".tribe-tickets-editor-table-row-capacity-total");if(-1!==parseInt(e.data("totalCapacity"),10)){var a=t(this),n=e.find(".tribe-tickets-editor-total-capacity"),r=parseInt(a.val(),10),c=a.data("nonSharedCapacity");(""===r||0>r||i.isNaN(r))&&(r=0);var d=c+r;n.text(d)}}),n.on("click","#global_capacity_edit_button",function(e){e.preventDefault(),t(document.getElementById("settings_global_capacity_edit")).prop("disabled",!1).focus()}),n.on("blur",'[name="tribe-ticket[event_capacity]"]',function(e,i){void 0===i&&(i=t(this).val());if(void 0!==i){i||(i=0),i=parseInt(i,10);var a=t(".tribe-ticket-capacity-max").find(".tribe-ticket-capacity-value"),n=t('.tribe-ticket-field-capacity[name="tribe-ticket[capacity]"]');n.attr("placeholder",i),i?n.attr("max",i):i=0,a.text(i)}}),n.on("change",'[name="tribe-ticket[capacity]"]',function(e){var i=t(this),a=parseInt(i.attr("max"),10),n=parseInt(i.val(),10);a&&a<n&&i.val(a)}),n.on("click","#tribe_ticket_header_remove",function(e){e.preventDefault(),t(document.getElementById("tribe_ticket_header_preview")).html(""),t(document.getElementById("tribe_ticket_header_remove")).hide(),t(document.getElementById("tribe_tickets_image_preview_filename")).hide().find(".filename").text(""),t(document.getElementById("tribe_ticket_header_image_id")).val("")}),n.ready(function(){a.setupPanels()})}}(window,jQuery,_,tribe.tickets.editor);
1
+ void 0===tribe.tickets&&(tribe.tickets={}),"undefined"==typeof ajaxurl&&(ajaxurl=TribeTickets.ajaxurl),tribe.tickets.editor={};var ticketHeaderImage=window.ticketHeaderImage||{};!function(e,t,i,a){"use strict";t("html, body");var n=t(document),r=t(document.getElementById("tribetickets"));if(0!==r.length){var c=t(document.getElementById("event_tickets")),d=t(document.getElementById("post_ID")),o=t(document.getElementById("publish")),s=r.find(".tribe-tickets-editor-blocker"),l=r.find(".spinner"),_=t(document.getElementById("tribe_panel_base")),p=t(document.getElementById("tribe_panel_edit")),m=t(document.getElementById("tribe_panel_settings")),u=["yy-mm-dd","m/d/yy","mm/dd/yy","d/m/yy","dd/mm/yy","m-d-yy","mm-dd-yy","d-m-yy","dd-mm-yy","yy.mm.dd","mm.dd.yy","dd.mm.yy"],f=u[0];a.beforeUnload=function(e){var t=!1;return"true"===_.attr("aria-hidden")&&(t=tribe_global_stock_admin_ui.nav_away_msg),e.returnValue=t,t},ticketHeaderImage={uploader:function(){var e=wp.media({title:HeaderImageData.title,multiple:!1,library:{type:"image"},button:{text:HeaderImageData.button}});return e.on("close",function(){var t=e.state().get("selection").toJSON();t.length&&ticketHeaderImage.render(t[0])}),e.open(),!1},render:function(e){t(document.getElementById("tribe_ticket_header_preview")).html(ticketHeaderImage.imgHTML(e)),t(document.getElementById("tribe_ticket_header_image_id")).val(e.id),t(document.getElementById("tribe_ticket_header_remove")).show(),t(document.getElementById("tribe_tickets_image_preview_filename")).show().find(".filename").text(e.filename)},imgHTML:function(e){var t='<img src="'+e.url+'" ';return t+='width="'+e.width+'" ',t+='height="'+e.height+'" ',t+="/>"}},a.panels={list:"#tribe_panel_base",ticket:"#tribe_panel_edit",settings:"#tribe_panel_settings"},a.swapPanel=function(i){var c;c=i instanceof jQuery?i:void 0!==a.panels[i]?t(a.panels[i]):_;var d=t("#event_tickets");d.trigger("before_panel_swap.tickets",{panel:c}),r.find(".ticket_panel").each(function(){t(this).attr("aria-hidden",!0)}),c.attr("aria-hidden",!1),c.is(_)?(t(e).off("beforeunload.tribe"),n.trigger("tribe.dependencies-run")):t(e).on("beforeunload.tribe",a.beforeUnload),d.trigger("after_panel_swap.tickets",{panel:c})},a.fetchPanels=function(e,i){void 0===e&&(e=[]);var n={action:"tribe-ticket-panels",notice:!1,post_id:d.val(),nonce:TribeTickets.add_ticket_nonce,data:e,is_admin:t("body").hasClass("wp-admin")};t.post(ajaxurl,n,function(e){e.success&&a.refreshPanels(e.data,i)},"json")},a.startWatchingMoveLinkIn=function(){c.find(".tribe-ticket-move-link").one("click",function(){e.setTimeout(a.listentToThickboxEvents,250)})},a.listentToThickboxEvents=function(){var e=t("#TB_window");0!==e.length&&e.one("tb_unload",function(){a.fetchPanels(null,"list")})},a.refreshPanels=function(e,i){_=t(e.list),p=t(e.ticket),m=t(e.settings),r.find(a.panels.list).replaceWith(_),r.find(a.panels.ticket).replaceWith(p),r.find(a.panels.settings).replaceWith(m),a.setupPanels(),a.swapPanel(i)},a.setupPanels=function(){e.MTAccordion({target:".accordion"});var i=t(document.getElementById("tribe-event-datepickers")),a=t(document.getElementById("ticket_start_date")),n=t(document.getElementById("ticket_end_date"));t(document.getElementById("ticket_start_time")),t(document.getElementById("ticket_end_time"));if("undefined"==typeof tribe_datepicker_opts){var c=t("[data-datepicker_format]"),d=c.length?c.attr("data-datepicker_format"):"",o=parseInt(d,10);isNaN(o)||(e.tribe_datepicker_opts={dateFormat:u[o]})}var s=e.tribe_datepicker_opts||{};if(i.length&&i.data("startofweek"),"undefined"!=typeof tribe_ticket_datepicker_format){var l=t.isNumeric(tribe_ticket_datepicker_format.datepicker_format_index)?tribe_ticket_datepicker_format.datepicker_format_index:0;f=u[l]}else s&&s.dateFormat&&(f=s.dateFormat);var p={dateFormat:f,showAnim:"fadeIn",changeMonth:!0,changeYear:!0,numberOfMonths:3,showButtonPanel:!1,onChange:function(){},beforeShow:function(e,i){i.input.data("prevDate",i.input.datepicker("getDate"));var a=t(i.dpDiv);a.addClass("tribe-ui-datepicker"),a.attrchange({trackValues:!0,callback:function(e){(e.newValue.indexOf("display: none")>=0||e.newValue.indexOf("display:none")>=0)&&a.removeClass("tribe-ui-datepicker")}})},onSelect:function(e,i){var r=t.datepicker.parseDate(f,e);"ticket_start_date"===i.id?n.datepicker("option","minDate",r):a.datepicker("option","maxDate",r)}};t.extend(p,tribe_l10n_datatables.datepicker);var m=r.find(".tribe-timepicker:not(.ui-timepicker-input)");if(tribe_timepickers.setup_timepickers(m),a.datepicker(p).datepicker("option","defaultDate",t(document.getElementById("EventStartDate")).val()).keyup(function(e){8!==e.keyCode&&46!==e.keyCode||t.datepicker._clearDate(this)}),n.datepicker(p).datepicker("option","defaultDate",t(document.getElementById("EventEndDate")).val()).keyup(function(e){8!==e.keyCode&&46!==e.keyCode||t.datepicker._clearDate(this)}),t(document.getElementById("tribe_ticket_header_preview")).find("img").length){t(document.getElementById("tribe_ticket_header_remove")).show();var k=t(document.getElementById("tribe_ticket_header_preview")).find("img");k.removeAttr("width").removeAttr("height"),r.width()<k.width()&&k.css("width","95%")}"undefined"!=typeof tribe_event_tickets_plus&&t.isPlainObject(tribe_event_tickets_plus)&&t.isPlainObject(tribe_event_tickets_plus.meta)&&t.isPlainObject(tribe_event_tickets_plus.meta.admin)&&t.isFunction(tribe_event_tickets_plus.meta.admin.init_ticket_fields)&&tribe_event_tickets_plus.meta.admin.init_ticket_fields(),tribe.tickets.table&&0!==_.find(".tribe-tickets-editor-table-tickets-body tr").length&&tribe.tickets.table.toggle_sortable(),r.find(tribe.validation.selectors.item).validation(),r.find(".tribe-dependent").dependency(),r.find(".tribe-dependency").trigger("verify.dependency")},n.ajaxSend(function(e,i,a){"string"===t.type(a.data)&&-1!==a.data.indexOf("action=tribe-ticket")&&r.trigger("spin.tribe","start")}),n.ajaxComplete(function(e,i,a){"string"===t.type(a.data)&&-1!==a.data.indexOf("action=tribe-ticket")&&r.trigger("spin.tribe","stop")}),n.on({"spin.tribe":function(e,i){(void 0===i||t.inArray(i,["start","stop"]))&&(i="stop"),"stop"===i?(s.hide(),l.removeClass("is-active")):(s.show(),l.addClass("is-active"))}}),o.on("click",function(i){t(e).off("beforeunload.tribe")}),n.on("click","#settings_form_toggle",function(e){return e.preventDefault(),a.fetchPanels(null,"settings"),!1}),n.on("click","#tribe_settings_form_cancel, #ticket_form_cancel",function(e){return e.preventDefault(),a.fetchPanels(null,"list"),!1}),n.on("click","#tribe_settings_form_save",function(e){e.preventDefault();var t=m.find("input,textarea").serialize();return a.fetchPanels(t,"list"),!1}),n.on("click",".ticket_form_toggle",function(e){return e.preventDefault(),function(e){void 0===e&&(e=!0);var i,a=r.find(".tribe-ticket-editor-field-default_provider");a.is(":radio")&&(a=a.filter(":checked")),i=e?"Tribe__Tickets__RSVP_radio":"Tribe__Tickets_Plus__Commerce__WooCommerce__Main_radio",!e&&a.length>0&&(i=a.val()+"_radio"),t(document.getElementById(i)).prop("checked",!0).trigger("change")}("rsvp_form_toggle"===t(this).attr("id")),p.find(".tribe-dependency").trigger("verify.dependency"),a.swapPanel("ticket"),!1}),n.on("click",".ticket_edit_button",function(e){e.preventDefault();var i=t(this),n={action:"tribe-ticket-edit",post_id:d.val(),ticket_id:i.data("ticketId"),nonce:TribeTickets.edit_ticket_nonce,is_admin:t("body").hasClass("wp-admin")};return t.post(ajaxurl,n,function(e){e.success&&(a.refreshPanels(e.data,"ticket"),a.startWatchingMoveLinkIn("#event_tickets"))},"json"),!1}),n.on("click.tribe",'[name="ticket_form_save"]',function(e){var i=t(document.getElementById("ticket_form_table"));if(i.trigger("validation.tribe"),!tribe.validation.hasErrors(i)){r.trigger("pre-save-ticket.tribe",e);var n=_.find(".tribe-ticket-field-order"),c={action:"tribe-ticket-add",data:p.find("input,textarea").serialize().replace(/\'/g,"%27").replace(/\:/g,"%3A"),post_id:d.val(),nonce:TribeTickets.add_ticket_nonce,menu_order:n.length,is_admin:t("body").hasClass("wp-admin")};t.post(ajaxurl,c,function(e){e.success&&a.refreshPanels(e.data)},"json")}}),n.on("click",".ticket_delete",function(e){if(!confirm(tribe_ticket_notices.confirm_alert))return!1;e.preventDefault(),r.trigger("delete-ticket.tribe",e);var i=t(this).attr("attr-ticket-id"),n={action:"tribe-ticket-delete",post_id:d.val(),ticket_id:i,nonce:TribeTickets.remove_ticket_nonce,is_admin:t("body").hasClass("wp-admin")};t.post(ajaxurl,n,function(e){e.success&&a.refreshPanels(e.data)},"json")}),n.on("change",".tribe-ticket-field-capacity",function(e){var i=t(this),a=i.parents(".input_block").eq(0).find(".tribe-ticket-field-mode");i.val()&&a.val("capped")}),n.on("keyup","#ticket_price",function(e){e.preventDefault();var i=price_format.decimal,a=new RegExp("[^-0-9%\\"+i+"]+","gi"),n=t(this).val(),r=n.replace(a,"");n!==r&&t(this).val(r)}),n.on("click","#tribe_ticket_header_image, #tribe_ticket_header_preview",function(e){e.preventDefault(),ticketHeaderImage.uploader("","")}),n.on("focus","#settings_global_capacity_edit",function(){var e=t(this),i=0;t(".tribe-tickets-editor-capacity-table").find("[data-capacity]").each(function(){var e=t(this);i+=parseInt(e.data("capacity"),10)}),e.data("nonSharedCapacity",i)}),n.on("blur change","#settings_global_capacity_edit",function(){var e=t(".tribe-tickets-editor-table-row-capacity-total");if(-1!==parseInt(e.data("totalCapacity"),10)){var a=t(this),n=e.find(".tribe-tickets-editor-total-capacity"),r=parseInt(a.val(),10),c=a.data("nonSharedCapacity");(""===r||0>r||i.isNaN(r))&&(r=0);var d=c+r;n.text(d)}}),n.on("click","#global_capacity_edit_button",function(e){e.preventDefault(),t(document.getElementById("settings_global_capacity_edit")).prop("disabled",!1).focus()}),n.on("blur",'[name="tribe-ticket[event_capacity]"]',function(e,i){void 0===i&&(i=t(this).val());if(void 0!==i){i||(i=0),i=parseInt(i,10);var a=t(".tribe-ticket-capacity-max").find(".tribe-ticket-capacity-value"),n=t('.tribe-ticket-field-capacity[name="tribe-ticket[capacity]"]');n.attr("placeholder",i),i?n.attr("max",i):i=0,a.text(i)}}),n.on("change",'[name="tribe-ticket[capacity]"]',function(e){var i=t(this),a=parseInt(i.attr("max"),10),n=parseInt(i.val(),10);a&&a<n&&i.val(a)}),n.on("click","#tribe_ticket_header_remove",function(e){e.preventDefault(),t(document.getElementById("tribe_ticket_header_preview")).html(""),t(document.getElementById("tribe_ticket_header_remove")).hide(),t(document.getElementById("tribe_tickets_image_preview_filename")).hide().find(".filename").text(""),t(document.getElementById("tribe_ticket_header_image_id")).val("")}),n.ready(function(){a.setupPanels()})}}(window,jQuery,_,tribe.tickets.editor);
src/resources/postcss/rsvp.pcss CHANGED
@@ -389,6 +389,7 @@
389
  margin-bottom: 30px;
390
  margin-top: 30px;
391
  max-width: 580px;
 
392
  }
393
 
394
  .tribe-block__rsvp__ticket {
@@ -794,12 +795,17 @@
794
  }
795
  }
796
 
797
- .tribe-block__rsvp__loading {
 
798
  background: rgba( 255, 255, 255, .7 );
799
- display: none;
800
  height: 100%;
 
 
 
 
801
  position: absolute;
802
  text-align: center;
 
803
  width: 100%;
804
  z-index: 99;
805
 
389
  margin-bottom: 30px;
390
  margin-top: 30px;
391
  max-width: 580px;
392
+ position: relative;
393
  }
394
 
395
  .tribe-block__rsvp__ticket {
795
  }
796
  }
797
 
798
+ .tribe-common-c-loader.tribe-block__rsvp__loading {
799
+ align-items: center;
800
  background: rgba( 255, 255, 255, .7 );
 
801
  height: 100%;
802
+ justify-content: center;
803
+ left: 0;
804
+ margin: 0;
805
+ padding: 0;
806
  position: absolute;
807
  text-align: center;
808
+ top: 0;
809
  width: 100%;
810
  z-index: 99;
811
 
src/styles/rsvp/frontend.pcss CHANGED
@@ -9,6 +9,7 @@
9
  margin-bottom: 30px;
10
  margin-top: 30px;
11
  max-width: 580px;
 
12
  }
13
 
14
  .tribe-block__rsvp__ticket {
@@ -413,12 +414,17 @@
413
  }
414
  }
415
 
416
- .tribe-block__rsvp__loading {
 
417
  background: rgba( 255, 255, 255, .7 );
418
- display: none;
419
  height: 100%;
 
 
 
 
420
  position: absolute;
421
  text-align: center;
 
422
  width: 100%;
423
  z-index: 99;
424
 
9
  margin-bottom: 30px;
10
  margin-top: 30px;
11
  max-width: 580px;
12
+ position: relative;
13
  }
14
 
15
  .tribe-block__rsvp__ticket {
414
  }
415
  }
416
 
417
+ .tribe-common-c-loader.tribe-block__rsvp__loading {
418
+ align-items: center;
419
  background: rgba( 255, 255, 255, .7 );
 
420
  height: 100%;
421
+ justify-content: center;
422
+ left: 0;
423
+ margin: 0;
424
+ padding: 0;
425
  position: absolute;
426
  text-align: center;
427
+ top: 0;
428
  width: 100%;
429
  z-index: 99;
430
 
src/styles/tickets/frontend.pcss CHANGED
@@ -124,6 +124,7 @@
124
  background-color: transparent;
125
  color: var(--color-icon-secondary);
126
  display: inline-block;
 
127
 
128
  &:hover,
129
  &:focus {
124
  background-color: transparent;
125
  color: var(--color-icon-secondary);
126
  display: inline-block;
127
+ font-size: 24px;
128
 
129
  &:hover,
130
  &:focus {
src/template-tags/tickets.php CHANGED
@@ -205,8 +205,8 @@ if ( ! function_exists( 'tribe_tickets_buy_button' ) ) {
205
  return null;
206
  }
207
 
208
- $html = array();
209
- $parts = array();
210
 
211
  // If we have tickets or RSVP, but everything is Sold Out then display the Sold Out message
212
  foreach ( $types as $type => $data ) {
@@ -231,7 +231,10 @@ if ( ! function_exists( 'tribe_tickets_buy_button' ) ) {
231
  $stock_html = '';
232
 
233
  if ( $stock ) {
234
- $threshold = Tribe__Settings_Manager::get_option( 'ticket-display-tickets-left-threshold', 0 );
 
 
 
235
 
236
  /**
237
  * Overwrites the threshold to display "# tickets left".
@@ -464,7 +467,7 @@ if ( ! function_exists( 'tribe_tickets_get_ticket_stock_message' ) ) {
464
  $pending = (int) $ticket->qty_pending();
465
  $refunded = (int) $ticket->qty_refunded();
466
  $status = '';
467
- $status_counts = array();
468
 
469
  $is_global = Tribe__Tickets__Global_Stock::GLOBAL_STOCK_MODE === $ticket->global_stock_mode() && $global_stock->is_enabled();
470
  $is_capped = Tribe__Tickets__Global_Stock::CAPPED_STOCK_MODE === $ticket->global_stock_mode() && $global_stock->is_enabled();
@@ -584,7 +587,7 @@ if ( ! function_exists( 'tribe_tickets_get_template_part' ) ) {
584
  do_action( 'tribe_tickets_pre_get_template_part', $slug, $name, $data );
585
 
586
  // Setup possible parts
587
- $templates = array();
588
  if ( isset( $name ) ) {
589
  $templates[] = $slug . '-' . $name . '.php';
590
  }
@@ -593,7 +596,7 @@ if ( ! function_exists( 'tribe_tickets_get_template_part' ) ) {
593
  /**
594
  * Allow users to filter which templates can be included
595
  *
596
- * @param string $template The Template file, which is a relative path from the Folder we are dealing with
597
  * @param string $slug Slug for this template
598
  * @param string $name Template name
599
  * @param array $data The Data that will be used on this template
@@ -753,7 +756,7 @@ if ( ! function_exists( 'tribe_tickets_get_attendees' ) ) {
753
  * @param integer|string $id a rsvp order key, order id, attendee id, ticket id, or event id
754
  * @param null $context use 'rsvp_order' to get all rsvp tickets from an order based off the post id and not the order key
755
  *
756
- * @return array() an array of all attendee(s) data including custom attendee meta for a given id
757
  */
758
  function tribe_tickets_get_attendees( $id, $context = null ) {
759
  return tribe( 'tickets.data_api' )->get_attendees_by_id( $id, $context );
@@ -1304,24 +1307,83 @@ if ( ! function_exists( 'tribe_get_ticket_label_plural_lowercase' ) ) {
1304
  }
1305
  }
1306
 
1307
- /**
1308
- * Allows us to test a post ID to see if it is an event page.
1309
- *
1310
- * @since 4.11.0
1311
- *
1312
- * @param int|WP_Post|null $post The post (or its ID) we're testing. Default is global post.
1313
- * @return boolean
1314
- */
1315
- function tribe_tickets_is_event_page( $post = null ) {
1316
- // Tribe__Events__Main must exist.
1317
- if ( ! class_exists( 'Tribe__Events__Main' ) ) {
1318
- return false;
1319
- }
 
 
1320
 
1321
- // Must be the correct post type.
1322
- if ( Tribe__Events__Main::POSTTYPE !== get_post_type( $post ) ) {
1323
- return false;
 
 
 
1324
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1325
 
1326
- return true;
 
 
 
 
 
 
 
 
 
 
 
 
1327
  }
205
  return null;
206
  }
207
 
208
+ $html = [];
209
+ $parts = [];
210
 
211
  // If we have tickets or RSVP, but everything is Sold Out then display the Sold Out message
212
  foreach ( $types as $type => $data ) {
231
  $stock_html = '';
232
 
233
  if ( $stock ) {
234
+ /** @var Tribe__Settings_Manager $settings_manager */
235
+ $settings_manager = tribe( 'settings.manager' );
236
+
237
+ $threshold = $settings_manager::get_option( 'ticket-display-tickets-left-threshold', 0 );
238
 
239
  /**
240
  * Overwrites the threshold to display "# tickets left".
467
  $pending = (int) $ticket->qty_pending();
468
  $refunded = (int) $ticket->qty_refunded();
469
  $status = '';
470
+ $status_counts = [];
471
 
472
  $is_global = Tribe__Tickets__Global_Stock::GLOBAL_STOCK_MODE === $ticket->global_stock_mode() && $global_stock->is_enabled();
473
  $is_capped = Tribe__Tickets__Global_Stock::CAPPED_STOCK_MODE === $ticket->global_stock_mode() && $global_stock->is_enabled();
587
  do_action( 'tribe_tickets_pre_get_template_part', $slug, $name, $data );
588
 
589
  // Setup possible parts
590
+ $templates = [];
591
  if ( isset( $name ) ) {
592
  $templates[] = $slug . '-' . $name . '.php';
593
  }
596
  /**
597
  * Allow users to filter which templates can be included
598
  *
599
+ * @param string $template The Template file(s), which is a relative path from the Folder we are dealing with.
600
  * @param string $slug Slug for this template
601
  * @param string $name Template name
602
  * @param array $data The Data that will be used on this template
756
  * @param integer|string $id a rsvp order key, order id, attendee id, ticket id, or event id
757
  * @param null $context use 'rsvp_order' to get all rsvp tickets from an order based off the post id and not the order key
758
  *
759
+ * @return array List of all attendee(s) data including custom attendee meta for a given ID.
760
  */
761
  function tribe_tickets_get_attendees( $id, $context = null ) {
762
  return tribe( 'tickets.data_api' )->get_attendees_by_id( $id, $context );
1307
  }
1308
  }
1309
 
1310
+ if ( ! function_exists( 'tribe_tickets_is_event_page' ) ) {
1311
+ /**
1312
+ * Allows us to test a post ID to see if it is an event page.
1313
+ *
1314
+ * @since 4.11.0
1315
+ *
1316
+ * @param int|WP_Post|null $post The post (or its ID) we're testing. Default is global post.
1317
+ *
1318
+ * @return boolean
1319
+ */
1320
+ function tribe_tickets_is_event_page( $post = null ) {
1321
+ // Tribe__Events__Main must exist.
1322
+ if ( ! class_exists( 'Tribe__Events__Main' ) ) {
1323
+ return false;
1324
+ }
1325
 
1326
+ // Must be the correct post type.
1327
+ if ( Tribe__Events__Main::POSTTYPE !== get_post_type( $post ) ) {
1328
+ return false;
1329
+ }
1330
+
1331
+ return true;
1332
  }
1333
+ }
1334
+
1335
+ if ( ! function_exists( 'tribe_tickets_is_enabled_post_context' ) ) {
1336
+ /**
1337
+ * If we are in the front-end or back-end (e.g. currently editing or creating) context for a tickets-enabled post.
1338
+ *
1339
+ * @since 4.11.1
1340
+ *
1341
+ * @see \Tribe__Tickets__Main::post_types()
1342
+ *
1343
+ * @param null|int|WP_Post $post Post ID or object, `null` to get the ID of the global/current post object.
1344
+ *
1345
+ * @return bool True if creating/editing (back-end) or viewing single or archive (front-end) of enabled post type.
1346
+ */
1347
+ function tribe_tickets_is_enabled_post_context( $post = null ) {
1348
+ /** @var Tribe__Context $context */
1349
+ $context = tribe( 'context' );
1350
+
1351
+ /** @var Tribe__Tickets__Main $main */
1352
+ $main = tribe( 'tickets.main' );
1353
+
1354
+ $post_types = $main->post_types();
1355
+
1356
+ // Back-end
1357
+ if ( $context->is_editing_post( $post_types ) ) {
1358
+ return true;
1359
+ }
1360
+
1361
+ // Front-end singular
1362
+ $post = Tribe__Main::post_id_helper( $post );
1363
+
1364
+ if (
1365
+ ! empty( $post )
1366
+ && in_array( get_post_type( $post ), $post_types, true )
1367
+ ) {
1368
+ return true;
1369
+ }
1370
+
1371
+ // Front-end archive
1372
+ if ( is_post_type_archive( $post_types ) ) {
1373
+ return true;
1374
+ }
1375
 
1376
+ /**
1377
+ * Whether or not we are in tickets-enabled context, such as determining if we should load plugin assets.
1378
+ *
1379
+ * @since 4.11.1
1380
+ *
1381
+ * @param bool   $result
1382
+ * @param array $post_types The post types with tickets enabled.
1383
+ * @param Tribe__Context $context
1384
+ *
1385
+ * @return bool
1386
+ */
1387
+ return apply_filters( 'tribe_tickets_is_enabled_post_context', false, $post_types, $context );
1388
+ }
1389
  }
src/views/blocks/rsvp.php CHANGED
@@ -59,7 +59,6 @@ if ( ! $already_rendered ) {
59
  <div class="tribe-block__rsvp__ticket" data-rsvp-id="<?php echo absint( $rsvp->ID ); ?>">
60
  <?php $this->template( 'blocks/rsvp/icon' ); ?>
61
  <?php $this->template( 'blocks/rsvp/content', array( 'ticket' => $rsvp ) ); ?>
62
- <?php $this->template( 'blocks/rsvp/loader' ); ?>
63
  </div>
64
  <?php endforeach; ?>
65
  <?php else : ?>
@@ -68,4 +67,19 @@ if ( ! $already_rendered ) {
68
  <?php $this->template( 'blocks/rsvp/content-inactive', array( 'all_past' => $all_past ) ); ?>
69
  </div>
70
  <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  </div>
59
  <div class="tribe-block__rsvp__ticket" data-rsvp-id="<?php echo absint( $rsvp->ID ); ?>">
60
  <?php $this->template( 'blocks/rsvp/icon' ); ?>
61
  <?php $this->template( 'blocks/rsvp/content', array( 'ticket' => $rsvp ) ); ?>
 
62
  </div>
63
  <?php endforeach; ?>
64
  <?php else : ?>
67
  <?php $this->template( 'blocks/rsvp/content-inactive', array( 'all_past' => $all_past ) ); ?>
68
  </div>
69
  <?php endif; ?>
70
+ <?php
71
+ ob_start();
72
+ /**
73
+ * Allows filtering of extra classes used on the rsvp-block loader.
74
+ *
75
+ * @since 4.11.1
76
+ *
77
+ * @param array $classes The array of classes that will be filtered.
78
+ */
79
+ $loader_classes = apply_filters( 'tribe_rsvp_block_loader_classes', [ 'tribe-block__rsvp__loading' ] );
80
+ include Tribe__Tickets__Templates::get_template_hierarchy( 'components/loader.php' );
81
+ $html = ob_get_contents();
82
+ ob_end_clean();
83
+ echo $html;
84
+ ?>
85
  </div>
src/views/blocks/rsvp/details/availability.php CHANGED
@@ -8,23 +8,54 @@
8
  *
9
  * See more documentation about our Blocks Editor templating system.
10
  *
11
- * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
  * @since 4.9.3
14
- * @version 4.9.4
15
  *
 
16
  */
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  $remaining_tickets = $ticket->remaining();
19
  $is_unlimited = -1 === $remaining_tickets;
 
 
 
 
 
 
 
 
 
 
 
 
20
  ?>
21
  <div class="tribe-block__rsvp__availability">
22
  <?php if ( ! $ticket->is_in_stock() ) : ?>
23
  <span class="tribe-block__rsvp__no-stock"><?php esc_html_e( 'Out of stock!', 'event-tickets' ); ?></span>
24
- <?php elseif ( ! $is_unlimited ) : ?>
25
- <span class="tribe-block__rsvp__quantity"><?php echo $ticket->remaining(); ?> </span>
 
 
 
 
26
  <?php esc_html_e( 'remaining', 'event-tickets' ) ?>
27
- <?php else : ?>
28
- <span class="tribe-block__rsvp__unlimited"><?php esc_html_e( 'Unlimited', 'event-tickets' ); ?></span>
29
  <?php endif; ?>
30
  </div>
8
  *
9
  * See more documentation about our Blocks Editor templating system.
10
  *
11
+ * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
  * @since 4.9.3
14
+ * @since 4.11.1 Corrected amount of available/remaining tickets.
15
  *
16
+ * @version 4.11.1
17
  */
18
 
19
+ /** @var Tribe__Settings_Manager $settings_manager */
20
+ $settings_manager = tribe( 'settings.manager' );
21
+
22
+ $threshold = $settings_manager::get_option( 'ticket-display-tickets-left-threshold', 0 );
23
+
24
+ /**
25
+ * Overwrites the threshold to display "# tickets left".
26
+ *
27
+ * @param int $threshold Stock threshold to trigger display of "# tickets left"
28
+ * @param array $data Ticket data.
29
+ * @param int $event_id Event ID.
30
+ *
31
+ * @since 4.11.1
32
+ */
33
+ $threshold = absint( apply_filters( 'tribe_display_rsvp_block_tickets_left_threshold', $threshold, tribe_events_get_ticket_event( $ticket ) ) );
34
+
35
  $remaining_tickets = $ticket->remaining();
36
  $is_unlimited = -1 === $remaining_tickets;
37
+
38
+ /** @var Tribe__Tickets__Tickets_Handler $handler */
39
+ $handler = tribe( 'tickets.handler' );
40
+
41
+ /**
42
+ * Allows hiding of "unlimited" to be toggled on/off conditionally.
43
+ *
44
+ * @param int $show_unlimited allow showing of "unlimited".
45
+ *
46
+ * @since 4.11.1
47
+ */
48
+ $show_unlimited = apply_filters( 'tribe_rsvp_block_show_unlimited_availability', false, $is_unlimited );
49
  ?>
50
  <div class="tribe-block__rsvp__availability">
51
  <?php if ( ! $ticket->is_in_stock() ) : ?>
52
  <span class="tribe-block__rsvp__no-stock"><?php esc_html_e( 'Out of stock!', 'event-tickets' ); ?></span>
53
+ <?php elseif ( $is_unlimited ) : ?>
54
+ <?php if ( $show_unlimited) : ?>
55
+ <span class="tribe-block__rsvp__unlimited"><?php echo esc_html( $handler->unlimited_term ); ?></span>
56
+ <?php endif; ?>
57
+ <?php elseif ( 0 === $threshold || $remaining_tickets <= $threshold ) : ?>
58
+ <span class="tribe-block__rsvp__quantity"><?php echo esc_html( $remaining_tickets ); ?> </span>
59
  <?php esc_html_e( 'remaining', 'event-tickets' ) ?>
 
 
60
  <?php endif; ?>
61
  </div>
src/views/blocks/rsvp/form/quantity-input.php CHANGED
@@ -11,11 +11,21 @@
11
  * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
  * @since 4.9
14
- * @version 4.9.4
15
  *
 
16
  */
17
  $must_login = ! is_user_logged_in() && tribe( 'tickets.rsvp' )->login_required();
18
- $remaining = $ticket->remaining();
 
 
 
 
 
 
 
 
 
19
  ?>
20
  <input
21
  type="number"
@@ -25,9 +35,9 @@ $remaining = $ticket->remaining();
25
  min="1"
26
  value="1"
27
  required
28
- data-remaining="<?php echo esc_attr( $remaining ); ?>"
29
- <?php if ( -1 !== $remaining ) : ?>
30
- max="<?php echo esc_attr( $remaining ); ?>"
31
  <?php endif; ?>
32
  <?php disabled( $must_login ); ?>
33
- />
11
  * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
  * @since 4.9
14
+ * @since 4.11.1 Corrected amount of available/remaining tickets.
15
  *
16
+ * @version 4.11.1
17
  */
18
  $must_login = ! is_user_logged_in() && tribe( 'tickets.rsvp' )->login_required();
19
+
20
+ /** @var Tribe__Tickets__Ticket_Object $ticket */
21
+ if ( empty( $ticket->ID ) ) {
22
+ return;
23
+ }
24
+
25
+ /** @var Tribe__Tickets__Tickets_Handler $tickets_handler */
26
+ $tickets_handler = tribe( 'tickets.handler' );
27
+
28
+ $available = $tickets_handler->get_ticket_max_purchase( $ticket->ID );
29
  ?>
30
  <input
31
  type="number"
35
  min="1"
36
  value="1"
37
  required
38
+ data-remaining="<?php echo esc_attr( $available ); ?>"
39
+ <?php if ( -1 !== $available ) : ?>
40
+ max="<?php echo esc_attr( $available ); ?>"
41
  <?php endif; ?>
42
  <?php disabled( $must_login ); ?>
43
+ />
src/views/blocks/rsvp/loader.php CHANGED
@@ -16,6 +16,18 @@
16
  */
17
 
18
  ?>
19
- <div class="tribe-block__rsvp__loading">
20
- <?php $this->template( 'blocks/rsvp/loader-svg' ); ?>
21
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
16
  */
17
 
18
  ?>
19
+ <?php
20
+ ob_start();
21
+ /**
22
+ * Allows filtering of extra classes used on the rsvp-block loader.
23
+ *
24
+ * @since 4.11.1
25
+ *
26
+ * @param array $classes The array of classes that will be filtered.
27
+ */
28
+ $loader_classes = apply_filters( 'tribe_rsvp_block_loader_classes', [ 'tribe-block__rsvp__loading' ] );
29
+ include Tribe__Tickets__Templates::get_template_hierarchy( 'components/loader.php' );
30
+ $html = ob_get_contents();
31
+ ob_end_clean();
32
+ echo $html;
33
+ ?>
src/views/blocks/tickets.php CHANGED
@@ -104,7 +104,7 @@ if ( ! $already_rendered ) {
104
  $this->template( 'blocks/tickets/footer', [ 'tickets' => $tickets, 'currency_symbol' => $currency_symbol ] );
105
  ?>
106
  <?php else : ?>
107
- <?php echo $this->template( 'blocks/tickets/item-inactive', [ 'is_sale_past' => $is_sale_past ] ); ?>
108
  <?php endif; ?>
109
  <?php
110
  ob_start();
104
  $this->template( 'blocks/tickets/footer', [ 'tickets' => $tickets, 'currency_symbol' => $currency_symbol ] );
105
  ?>
106
  <?php else : ?>
107
+ <?php $this->template( 'blocks/tickets/item-inactive', [ 'is_sale_past' => $is_sale_past ] ); ?>
108
  <?php endif; ?>
109
  <?php
110
  ob_start();
src/views/blocks/tickets/extra-available-quantity.php CHANGED
@@ -8,18 +8,24 @@
8
  *
9
  * See more documentation about our Blocks Editor templating system.
10
  *
11
- * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
- * @since 4.9.3
14
- * @version 4.11.0
15
  *
 
 
 
 
 
16
  */
17
 
18
-
19
- $ticket = $this->get( 'ticket' );
20
- if ( empty( $ticket->available() ) ) {
 
21
  return;
22
  }
23
  ?>
24
- <span class="tribe-tickets__item__extra__available__quantity"><?php echo esc_html( $ticket->available() ); ?></span>
25
- <?php esc_html_e( 'available', 'event-tickets' );
8
  *
9
  * See more documentation about our Blocks Editor templating system.
10
  *
11
+ * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
+ * @since 4.9.3
14
+ * @since 4.11.1 Corrected amount of available/remaining tickets.
15
  *
16
+ * @version 4.11.1
17
+ *
18
+ * @var Tribe__Tickets__Editor__Template $this
19
+ * @var Tribe__Tickets__Ticket_Object $ticket // From the 'extra-available' template including this template
20
+ * @var int $available // From the 'extra-available' template including this template
21
  */
22
 
23
+ if (
24
+ empty( $ticket->ID )
25
+ || ! isset( $available )
26
+ ) {
27
  return;
28
  }
29
  ?>
30
+ <span class="tribe-tickets__item__extra__available__quantity"><?php echo esc_html( $available ); ?></span>
31
+ <?php esc_html_e( 'available', 'event-tickets' );
src/views/blocks/tickets/extra-available.php CHANGED
@@ -8,23 +8,66 @@
8
  *
9
  * See more documentation about our Blocks Editor templating system.
10
  *
11
- * @link {INSERT_ARTICLE_LINK_HERE}
 
12
  *
13
- * @since 4.9.3
14
- * @version 4.11.0
15
  *
 
 
 
16
  */
17
 
18
- $ticket = $this->get( 'ticket' );
19
- $available = $ticket->available();
 
 
 
 
 
 
 
 
 
 
20
  if ( -1 === $available ) {
21
  return;
22
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  ?>
24
  <div
25
  class="tribe-common-b3 tribe-tickets__item__extra__available"
26
  >
27
- <?php if ( -1 !== $ticket->available() ) : ?>
28
- <?php $this->template( 'blocks/tickets/extra-available-quantity', [ 'ticket' => $ticket ] ); ?>
 
 
29
  <?php endif; ?>
30
  </div>
8
  *
9
  * See more documentation about our Blocks Editor templating system.
10
  *
11
+ * @since 4.9.3
12
+ * @since 4.11.1 Corrected amount of available/remaining tickets.
13
  *
14
+ * @link {INSERT_ARTICLE_LINK_HERE}
 
15
  *
16
+ * @version 4.11.1
17
+ *
18
+ * @var Tribe__Tickets__Editor__Template $this
19
  */
20
 
21
+ /** @var Tribe__Tickets__Ticket_Object $ticket */
22
+ $ticket = $this->get( 'ticket' );
23
+
24
+ if ( empty( $ticket->ID ) ) {
25
+ return;
26
+ }
27
+
28
+ /** @var Tribe__Tickets__Tickets_Handler $tickets_handler */
29
+ $tickets_handler = tribe( 'tickets.handler' );
30
+
31
+ $available = $tickets_handler->get_ticket_max_purchase( $ticket->ID );
32
+
33
  if ( -1 === $available ) {
34
  return;
35
  }
36
+
37
+ $post_id = $this->get( 'post_id' );
38
+
39
+ /** @var Tribe__Settings_Manager $settings_manager */
40
+ $settings_manager = tribe( 'settings.manager' );
41
+
42
+ $threshold = $settings_manager::get_option( 'ticket-display-tickets-left-threshold', null );
43
+
44
+ /**
45
+ * Overwrites the threshold to display "# tickets left".
46
+ *
47
+ * @param int $threshold Stock threshold to trigger display of "# tickets left"
48
+ * @param array $data Ticket data.
49
+ * @param int $post_id WP_Post/Event ID.
50
+ *
51
+ * @since 4.11.1
52
+ */
53
+ $threshold = absint( apply_filters( 'tribe_display_tickets_block_tickets_left_threshold', $threshold, $post_id ) );
54
+ $available = $ticket->available();
55
+
56
+ /**
57
+ * Allows hiding of "unlimited" to be toggled on/off conditionally.
58
+ *
59
+ * @param int $show_unlimited allow showing of "unlimited".
60
+ *
61
+ * @since 4.11.1
62
+ */
63
+ $show_unlimited = apply_filters( 'tribe_tickets_block_show_unlimited_availability', false, $available );
64
  ?>
65
  <div
66
  class="tribe-common-b3 tribe-tickets__item__extra__available"
67
  >
68
+ <?php if ( $show_unlimited ) : ?>
69
+ <?php $this->template( 'blocks/tickets/extra-available-unlimited', array( 'ticket' => $ticket, 'key' => $key ) ); ?>
70
+ <?php elseif ( 0 === $threshold || $available <= $threshold ) : ?>
71
+ <?php $this->template( 'blocks/tickets/extra-available-quantity', [ 'ticket' => $ticket, 'available' => $available ] ); ?>
72
  <?php endif; ?>
73
  </div>
src/views/blocks/tickets/extra.php CHANGED
@@ -11,11 +11,16 @@
11
  * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
  * @since 4.9
14
- * @version 4.11.0
15
  *
 
 
 
16
  */
17
 
 
18
  $ticket = $this->get( 'ticket' );
 
19
  $is_mini = $this->get( 'is_mini' );
20
 
21
  $context = [
@@ -53,4 +58,4 @@ $id = 'tribe__details__content--' . $ticket->ID;
53
  </button>
54
  </div>
55
  <?php endif; ?>
56
- </div>
11
  * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
  * @since 4.9
14
+ * @since 4.11.1 Changed some HTML class names.
15
  *
16
+ * @version 4.11.1
17
+ *
18
+ * @var Tribe__Tickets__Editor__Template $this
19
  */
20
 
21
+ /** @var Tribe__Tickets__Ticket_Object $ticket */
22
  $ticket = $this->get( 'ticket' );
23
+
24
  $is_mini = $this->get( 'is_mini' );
25
 
26
  $context = [
58
  </button>
59
  </div>
60
  <?php endif; ?>
61
+ </div>
src/views/blocks/tickets/item.php CHANGED
@@ -8,29 +8,41 @@
8
  *
9
  * See more documentation about our Blocks Editor templating system.
10
  *
11
- * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
- * @since 4.9
14
- * @since 4.11.0 add modal only fields
15
- *
16
- * @version 4.11.0
17
  *
 
18
  */
19
  $classes = [ 'tribe-tickets__item' ];
 
 
20
  $provider = $this->get( 'provider' );
21
- $ticket = $this->get( 'ticket' );
22
- $modal = $this->get( 'is_modal' );
23
- $mini = $this->get( 'is_mini' );
24
- $post_id = $this->get( 'post_id' );
 
 
 
 
 
 
 
 
 
 
25
  $currency_symbol = $this->get( 'currency_symbol' );
26
- $context = [
27
- 'ticket' => $ticket,
28
- 'key' => $this->get( 'key' ),
29
- 'is_modal' => $modal,
30
- 'is_mini' => $mini,
31
  'currency_symbol' => $currency_symbol,
32
- 'post_id' => $post_id,
33
- 'provider' => $provider
34
  ];
35
 
36
  if (
@@ -44,13 +56,20 @@ $must_login = ! is_user_logged_in() && $ticket->get_provider()->login_required()
44
  if ( $must_login ) {
45
  $classes[] = 'tribe-tickets__item__disabled';
46
  }
 
 
 
47
  ?>
48
  <div
49
  id="tribe-<?php echo $modal ? 'modal' : 'block'; ?>-tickets-item-<?php echo esc_attr( $ticket->ID ); ?>"
50
  <?php tribe_classes( get_post_class( $classes, $ticket->ID ) ); ?>
51
  data-ticket-id="<?php echo esc_attr( $ticket->ID ); ?>"
52
- data-available="<?php echo ( 0 === $ticket->available() ) ? 'false' : 'true'; ?>"
53
- data-shared-cap="<?php echo ( tribe( 'tickets.handler' )->has_shared_capacity( $ticket ) ) ? 'true' : 'false'; ?>"
 
 
 
 
54
  >
55
  <?php if ( true === $modal ) : ?>
56
  <?php $this->template( 'modal/item-remove', $context ); ?>
@@ -70,7 +89,7 @@ if ( $must_login ) {
70
 
71
  <?php if ( ! $modal && ! $mini ) : ?>
72
  <?php $this->template( 'blocks/rsvp/form/opt-out', $context ); ?>
73
- <?php elseif( true === $modal ): ?>
74
  <?php $this->template( 'blocks/tickets/opt-out-hidden', $context ); ?>
75
  <?php endif; ?>
76
  </div>
8
  *
9
  * See more documentation about our Blocks Editor templating system.
10
  *
11
+ * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
+ * @since 4.9
14
+ * @since 4.11.0 Add modal only fields
15
+ * @since 4.11.1 Corrected amount of available/remaining tickets.
 
16
  *
17
+ * @version 4.11.1
18
  */
19
  $classes = [ 'tribe-tickets__item' ];
20
+
21
+ /** @var Tribe__Tickets__Tickets $provider */
22
  $provider = $this->get( 'provider' );
23
+
24
+ /** @var Tribe__Tickets__Ticket_Object $ticket */
25
+ $ticket = $this->get( 'ticket' );
26
+
27
+ if ( empty( $ticket->ID ) ) {
28
+ return;
29
+ }
30
+
31
+ /** @var Tribe__Tickets__Tickets_Handler $tickets_handler */
32
+ $tickets_handler = tribe( 'tickets.handler' );
33
+
34
+ $modal = $this->get( 'is_modal' );
35
+ $mini = $this->get( 'is_mini' );
36
+ $post_id = $this->get( 'post_id' );
37
  $currency_symbol = $this->get( 'currency_symbol' );
38
+ $context = [
39
+ 'ticket' => $ticket,
40
+ 'key' => $this->get( 'key' ),
41
+ 'is_modal' => $modal,
42
+ 'is_mini' => $mini,
43
  'currency_symbol' => $currency_symbol,
44
+ 'post_id' => $post_id,
45
+ 'provider' => $provider,
46
  ];
47
 
48
  if (
56
  if ( $must_login ) {
57
  $classes[] = 'tribe-tickets__item__disabled';
58
  }
59
+
60
+ $has_shared_cap = $tickets_handler->has_shared_capacity( $ticket );
61
+
62
  ?>
63
  <div
64
  id="tribe-<?php echo $modal ? 'modal' : 'block'; ?>-tickets-item-<?php echo esc_attr( $ticket->ID ); ?>"
65
  <?php tribe_classes( get_post_class( $classes, $ticket->ID ) ); ?>
66
  data-ticket-id="<?php echo esc_attr( $ticket->ID ); ?>"
67
+ data-available="<?php echo ( 0 === $tickets_handler->get_ticket_max_purchase( $ticket->ID ) ) ? 'false' : 'true'; ?>"
68
+ data-has-shared-cap="<?php echo $has_shared_cap ? 'true' : 'false'; ?>"
69
+ <?php if ( $has_shared_cap) : ?>
70
+ data-shared-cap="<?php echo esc_attr( $ticket->capacity() ); ?>"
71
+ <?php endif; ?>
72
+
73
  >
74
  <?php if ( true === $modal ) : ?>
75
  <?php $this->template( 'modal/item-remove', $context ); ?>
89
 
90
  <?php if ( ! $modal && ! $mini ) : ?>
91
  <?php $this->template( 'blocks/rsvp/form/opt-out', $context ); ?>
92
+ <?php elseif ( true === $modal ): ?>
93
  <?php $this->template( 'blocks/tickets/opt-out-hidden', $context ); ?>
94
  <?php endif; ?>
95
  </div>
src/views/blocks/tickets/quantity.php CHANGED
@@ -11,18 +11,27 @@
11
  * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
  * @since 4.9
14
- * @version 4.11.0
15
  *
 
16
  */
17
 
 
18
  $ticket = $this->get( 'ticket' );
19
- $available = $ticket->available();
20
- $is_available = 0 !== $available;
21
 
22
- $context = array(
 
 
 
 
 
 
 
 
 
23
  'ticket' => $ticket,
24
  'key' => $this->get( 'key' ),
25
- );
26
 
27
  $classes = [
28
  'tribe-common-h4',
@@ -32,11 +41,11 @@ $classes = [
32
  <div
33
  <?php tribe_classes( $classes ); ?>
34
  >
35
- <?php if ( $is_available ) : ?>
36
  <?php $this->template( 'blocks/tickets/quantity-remove', $context ); ?>
37
  <?php $this->template( 'blocks/tickets/quantity-number', $context ); ?>
38
  <?php $this->template( 'blocks/tickets/quantity-add', $context ); ?>
39
  <?php else : ?>
40
  <?php $this->template( 'blocks/tickets/quantity-unavailable', $context ); ?>
41
  <?php endif; ?>
42
- </div>
11
  * @link {INSERT_ARTICLE_LINK_HERE}
12
  *
13
  * @since 4.9
14
+ * @since 4.11.1 Corrected amount of available/remaining tickets.
15
  *
16
+ * @version 4.11.1
17
  */
18
 
19
+ /** @var Tribe__Tickets__Ticket_Object $ticket */
20
  $ticket = $this->get( 'ticket' );
 
 
21
 
22
+ if ( empty( $ticket->ID ) ) {
23
+ return;
24
+ }
25
+
26
+ /** @var Tribe__Tickets__Tickets_Handler $tickets_handler */
27
+ $tickets_handler = tribe( 'tickets.handler' );
28
+
29
+ $available = $tickets_handler->get_ticket_max_purchase( $ticket->ID );
30
+
31
+ $context = [
32
  'ticket' => $ticket,
33
  'key' => $this->get( 'key' ),
34
+ ];
35
 
36
  $classes = [
37
  'tribe-common-h4',
41
  <div
42
  <?php tribe_classes( $classes ); ?>
43
  >
44
+ <?php if ( 0 !== $available ) : ?>
45
  <?php $this->template( 'blocks/tickets/quantity-remove', $context ); ?>
46
  <?php $this->template( 'blocks/tickets/quantity-number', $context ); ?>
47
  <?php $this->template( 'blocks/tickets/quantity-add', $context ); ?>
48
  <?php else : ?>
49
  <?php $this->template( 'blocks/tickets/quantity-unavailable', $context ); ?>
50
  <?php endif; ?>
51
+ </div>
src/views/blocks/tickets/registration/attendee/submit.php CHANGED
@@ -21,5 +21,5 @@
21
  class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__item__registration__submit"
22
  type="submit"
23
  >
24
- <?php echo esc_html_x( 'Save & Check Out', 'Save attendee meta and proceed to checkout.', 'event-tickets' ); ?>
25
  </button>
21
  class="tribe-common-c-btn tribe-common-c-btn--small tribe-tickets__item__registration__submit"
22
  type="submit"
23
  >
24
+ <?php echo esc_html_x( 'Save & Checkout', 'Save attendee meta and proceed to checkout.', 'event-tickets' ); ?>
25
  </button>
src/views/tickets/rsvp.php CHANGED
@@ -10,8 +10,9 @@
10
  * @since 4.10.8 More similar display format to that of other ticket types, including better checking of max quantity available.
11
  * @since 4.10.9 Use customizable ticket name functions.
12
  * @since 4.11.0 Added RSVP/ticket view link to template.
 
13
  *
14
- * @version 4.11.0
15
  *
16
  * @var Tribe__Tickets__RSVP $this
17
  * @var bool $must_login
@@ -23,6 +24,22 @@ ob_start();
23
  $messages = Tribe__Tickets__RSVP::get_instance()->get_messages();
24
  $messages_class = $messages ? 'tribe-rsvp-message-display' : '';
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  /**
27
  * A flag we can set via filter, e.g. at the end of this method, to ensure this template only shows once.
28
  *
@@ -91,38 +108,51 @@ if ( ! $already_rendered ) {
91
  continue;
92
  }
93
 
 
 
94
  /** @var Tribe__Tickets__Tickets_Handler $handler */
95
  $handler = tribe( 'tickets.handler' );
96
 
97
- $available = $handler->get_ticket_max_purchase( $ticket->ID );
 
 
 
 
 
 
 
 
 
 
98
 
99
  $is_there_any_product_to_sell = 0 !== $available;
100
  ?>
101
  <tr>
102
- <td class="tribe-ticket quantity" data-product-id="<?php echo esc_attr( $ticket->ID ); ?>">
103
- <input type="hidden" name="product_id[]" value="<?php echo absint( $ticket->ID ); ?>">
104
  <?php if ( $is_there_any_product_to_sell ) : ?>
105
  <input
106
  type="number"
107
  class="tribe-tickets-quantity"
108
- step="1"
109
  min="0"
110
  <?php if ( -1 !== $available ) : ?>
111
  max="<?php echo esc_attr( $available ); ?>"
112
  <?php endif; ?>
113
- name="quantity_<?php echo absint( $ticket->ID ); ?>"
114
  value="0"
115
  <?php disabled( $must_login ); ?>
116
  >
117
- <?php if ( -1 !== $available ) : ?>
118
  <span class="tribe-tickets-remaining">
119
- <?php
120
- $readable_amount = tribe_tickets_get_readable_amount( $available, null, false );
121
- echo sprintf( esc_html__( '%1$s available', 'event-tickets' ), '<span class="available-stock" data-product-id="' . esc_attr( $ticket->ID ) . '">' . esc_html( $readable_amount ) . '</span>' );
122
- ?>
123
  </span>
 
 
124
  <?php endif; ?>
125
- <?php else: ?>
126
  <span class="tickets_nostock"><?php esc_html_e( 'Out of stock!', 'event-tickets' ); ?></span>
127
  <?php endif; ?>
128
  </td>
@@ -137,12 +167,12 @@ if ( ! $already_rendered ) {
137
  <?php
138
 
139
  /**
140
- * Allows injection of HTML after an RSVP ticket table row
141
  *
142
- * @var Event ID
143
  * @var Tribe__Tickets__Ticket_Object
144
  */
145
- do_action( 'event_tickets_rsvp_after_ticket_row', tribe_events_get_ticket_event( $ticket->id ), $ticket );
146
 
147
  }
148
  ?>
10
  * @since 4.10.8 More similar display format to that of other ticket types, including better checking of max quantity available.
11
  * @since 4.10.9 Use customizable ticket name functions.
12
  * @since 4.11.0 Added RSVP/ticket view link to template.
13
+ * @since 4.11.1 Corrected amount of available/remaining tickets when threshold is empty.
14
  *
15
+ * @version 4.11.1
16
  *
17
  * @var Tribe__Tickets__RSVP $this
18
  * @var bool $must_login
24
  $messages = Tribe__Tickets__RSVP::get_instance()->get_messages();
25
  $messages_class = $messages ? 'tribe-rsvp-message-display' : '';
26
 
27
+ /** @var Tribe__Settings_Manager $settings_manager */
28
+ $settings_manager = tribe( 'settings.manager' );
29
+
30
+ $threshold = $settings_manager::get_option( 'ticket-display-tickets-left-threshold', 0 );
31
+
32
+ /**
33
+ * Overwrites the threshold to display "# tickets left".
34
+ *
35
+ * @param int $threshold Stock threshold to trigger display of "# tickets left"
36
+ * @param array $data Ticket data.
37
+ * @param int $post_id WP_Post/Event ID.
38
+ *
39
+ * @since 4.11.1
40
+ */
41
+ $threshold = absint( apply_filters( 'tribe_display_rsvp_block_tickets_left_threshold', $threshold, tribe_events_get_ticket_event( $ticket ) ) );
42
+
43
  /**
44
  * A flag we can set via filter, e.g. at the end of this method, to ensure this template only shows once.
45
  *
108
  continue;
109
  }
110
 
111
+ $ticket_id = $ticket->ID;
112
+
113
  /** @var Tribe__Tickets__Tickets_Handler $handler */
114
  $handler = tribe( 'tickets.handler' );
115
 
116
+ $available = $handler->get_ticket_max_purchase( $ticket_id );
117
+ $readable_amount = tribe_tickets_get_readable_amount( $available, null, false );
118
+
119
+ /**
120
+ * Allows hiding of "unlimited" to be toggled on/off conditionally.
121
+ *
122
+ * @param int $show_unlimited allow showing of "unlimited".
123
+ *
124
+ * @since 4.11.1
125
+ */
126
+ $show_unlimited = apply_filters( 'tribe_rsvp_block_show_unlimited_availability', false, $available );
127
 
128
  $is_there_any_product_to_sell = 0 !== $available;
129
  ?>
130
  <tr>
131
+ <td class="tribe-ticket quantity" data-product-id="<?php echo esc_attr( $ticket_id ); ?>">
132
+ <input type="hidden" name="product_id[]" value="<?php echo absint( $ticket_id ); ?>">
133
  <?php if ( $is_there_any_product_to_sell ) : ?>
134
  <input
135
  type="number"
136
  class="tribe-tickets-quantity"
137
+ step="1"
138
  min="0"
139
  <?php if ( -1 !== $available ) : ?>
140
  max="<?php echo esc_attr( $available ); ?>"
141
  <?php endif; ?>
142
+ name="quantity_<?php echo absint( $ticket_id ); ?>"
143
  value="0"
144
  <?php disabled( $must_login ); ?>
145
  >
146
+ <?php if ( -1 !== $available && ( 0 === $threshold || $available <= $threshold ) ) : ?>
147
  <span class="tribe-tickets-remaining">
148
+ <span class="available-stock" data-product-id="<?php echo esc_attr( $ticket_id ); ?>">
149
+ <?php echo sprintf( esc_html__( '%1$s available', 'event-tickets' ), esc_html( $readable_amount ) ); ?>
150
+ </span>
 
151
  </span>
152
+ <?php elseif ( $show_unlimited ): ?>
153
+ <span class="available-stock" data-product-id="<?php echo esc_attr( $ticket_id ); ?>"><?php echo esc_html( $handler->unlimited_term ); ?></span>
154
  <?php endif; ?>
155
+ <?php elseif ( ! $ticket->is_in_stock() ) : ?>
156
  <span class="tickets_nostock"><?php esc_html_e( 'Out of stock!', 'event-tickets' ); ?></span>
157
  <?php endif; ?>
158
  </td>
167
  <?php
168
 
169
  /**
170
+ * Allows injection of HTML after an RSVP ticket table row.
171
  *
172
+ * @var bool|WP_Post Event ID
173
  * @var Tribe__Tickets__Ticket_Object
174
  */
175
+ do_action( 'event_tickets_rsvp_after_ticket_row', tribe_events_get_ticket_event( $ticket_id ), $ticket );
176
 
177
  }
178
  ?>
src/views/tickets/tpp.php CHANGED
@@ -13,8 +13,9 @@
13
  * @since 4.9.3 Display login link if visitor is logged out and logging in is required to purchase.
14
  * @since 4.10.8 Removed the date_in_range() check per ticket, since it now happens upstream. Better checking of max quantity available.
15
  * @since 4.10.10 Use customizable ticket name functions.
 
16
  *
17
- * @version 4.11.0
18
  * @deprecated 4.11.0
19
  *
20
  * @var bool $must_login
@@ -30,6 +31,22 @@ $messages = $commerce->get_messages();
30
  $messages_class = $messages ? 'tribe-tpp-message-display' : '';
31
  $now = time();
32
  $cart_url = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  ?>
34
  <form
35
  id="tpp-buy-tickets"
@@ -84,6 +101,15 @@ $cart_url = '';
84
 
85
  $available = $handler->get_ticket_max_purchase( $ticket->ID );
86
 
 
 
 
 
 
 
 
 
 
87
  $is_there_any_product_to_sell = 0 !== $available;
88
  ?>
89
  <tr>
@@ -101,13 +127,15 @@ $cart_url = '';
101
  value="0"
102
  <?php disabled( $must_login ); ?>
103
  >
104
- <?php if ( -1 !== $available ) : ?>
105
  <span class="tribe-tickets-remaining">
106
  <?php
107
  $readable_amount = tribe_tickets_get_readable_amount( $available, null, false );
108
  echo sprintf( esc_html__( '%1$s available', 'event-tickets' ), '<span class="available-stock" data-product-id="' . esc_attr( $ticket->ID ) . '">' . esc_html( $readable_amount ) . '</span>' );
109
  ?>
110
  </span>
 
 
111
  <?php endif; ?>
112
  <?php else: ?>
113
  <span class="tickets_nostock"><?php esc_html_e( 'Out of stock!', 'event-tickets' ); ?></span>
13
  * @since 4.9.3 Display login link if visitor is logged out and logging in is required to purchase.
14
  * @since 4.10.8 Removed the date_in_range() check per ticket, since it now happens upstream. Better checking of max quantity available.
15
  * @since 4.10.10 Use customizable ticket name functions.
16
+ * @since 4.11.1 Corrected amount of available/remaining tickets when threshold is empty.
17
  *
18
+ * @version 4.11.1
19
  * @deprecated 4.11.0
20
  *
21
  * @var bool $must_login
31
  $messages_class = $messages ? 'tribe-tpp-message-display' : '';
32
  $now = time();
33
  $cart_url = '';
34
+
35
+ /** @var Tribe__Settings_Manager $settings_manager */
36
+ $settings_manager = tribe( 'settings.manager' );
37
+
38
+ $threshold = $settings_manager::get_option( 'ticket-display-tickets-left-threshold', 0 );
39
+
40
+ /**
41
+ * Overwrites the threshold to display "# tickets left".
42
+ *
43
+ * @param int $threshold Stock threshold to trigger display of "# tickets left"
44
+ * @param array $data Ticket data.
45
+ * @param int $post_id WP_Post/Event ID.
46
+ *
47
+ * @since 4.11.1
48
+ */
49
+ $threshold = absint( apply_filters( 'tribe_display_tickets_block_tickets_left_threshold', $threshold, tribe_events_get_ticket_event( $ticket ) ) );
50
  ?>
51
  <form
52
  id="tpp-buy-tickets"
101
 
102
  $available = $handler->get_ticket_max_purchase( $ticket->ID );
103
 
104
+ /**
105
+ * Allows hiding of "unlimited" to be toggled on/off conditionally.
106
+ *
107
+ * @param int $show_unlimited allow showing of "unlimited".
108
+ *
109
+ * @since 4.11.1
110
+ */
111
+ $show_unlimited = apply_filters( 'tribe_tickets_block_show_unlimited_availability', false, $available );
112
+
113
  $is_there_any_product_to_sell = 0 !== $available;
114
  ?>
115
  <tr>
127
  value="0"
128
  <?php disabled( $must_login ); ?>
129
  >
130
+ <?php if ( -1 !== $available && ( 0 === $threshold || $available <= $threshold ) ) : ?>
131
  <span class="tribe-tickets-remaining">
132
  <?php
133
  $readable_amount = tribe_tickets_get_readable_amount( $available, null, false );
134
  echo sprintf( esc_html__( '%1$s available', 'event-tickets' ), '<span class="available-stock" data-product-id="' . esc_attr( $ticket->ID ) . '">' . esc_html( $readable_amount ) . '</span>' );
135
  ?>
136
  </span>
137
+ <?php elseif ( $show_unlimited ): ?>
138
+ <span class="available-stock" data-product-id="<?php echo esc_attr( $ticket->ID ); ?>"><?php echo esc_html( $readable_amount ); ?></span>
139
  <?php endif; ?>
140
  <?php else: ?>
141
  <span class="tickets_nostock"><?php esc_html_e( 'Out of stock!', 'event-tickets' ); ?></span>
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderIniteaf54a0f3fcb999007b792407a2958d8::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit68f260eaa980a9006d87586e15ce5ddb::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderIniteaf54a0f3fcb999007b792407a2958d8
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderIniteaf54a0f3fcb999007b792407a2958d8
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderIniteaf54a0f3fcb999007b792407a2958d8', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderIniteaf54a0f3fcb999007b792407a2958d8', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticIniteaf54a0f3fcb999007b792407a2958d8::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit68f260eaa980a9006d87586e15ce5ddb
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit68f260eaa980a9006d87586e15ce5ddb', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit68f260eaa980a9006d87586e15ce5ddb', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit68f260eaa980a9006d87586e15ce5ddb::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticIniteaf54a0f3fcb999007b792407a2958d8
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
@@ -45,9 +45,9 @@ class ComposerStaticIniteaf54a0f3fcb999007b792407a2958d8
45
  public static function getInitializer(ClassLoader $loader)
46
  {
47
  return \Closure::bind(function () use ($loader) {
48
- $loader->prefixLengthsPsr4 = ComposerStaticIniteaf54a0f3fcb999007b792407a2958d8::$prefixLengthsPsr4;
49
- $loader->prefixDirsPsr4 = ComposerStaticIniteaf54a0f3fcb999007b792407a2958d8::$prefixDirsPsr4;
50
- $loader->classMap = ComposerStaticIniteaf54a0f3fcb999007b792407a2958d8::$classMap;
51
 
52
  }, null, ClassLoader::class);
53
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit68f260eaa980a9006d87586e15ce5ddb
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
45
  public static function getInitializer(ClassLoader $loader)
46
  {
47
  return \Closure::bind(function () use ($loader) {
48
+ $loader->prefixLengthsPsr4 = ComposerStaticInit68f260eaa980a9006d87586e15ce5ddb::$prefixLengthsPsr4;
49
+ $loader->prefixDirsPsr4 = ComposerStaticInit68f260eaa980a9006d87586e15ce5ddb::$prefixDirsPsr4;
50
+ $loader->classMap = ComposerStaticInit68f260eaa980a9006d87586e15ce5ddb::$classMap;
51
 
52
  }, null, ClassLoader::class);
53
  }