All-in-One Event Calendar - Version 2.3.0

Version Description

Download this release

Release Info

Developer jbutkus
Plugin Icon 128x128 All-in-One Event Calendar
Version 2.3.0
Comparing to
See all releases

Code changes from version 2.2.1 to 2.3.0

Files changed (73) hide show
  1. all-in-one-event-calendar.php +2 -2
  2. app/config/constants.php +11 -12
  3. app/controller/extension-license.php +2 -72
  4. app/controller/front.php +20 -4
  5. app/controller/javascript-widget.php +9 -3
  6. app/controller/javascript.php +8 -5
  7. app/model/event-compatibility.php +26 -0
  8. app/model/event.php +15 -56
  9. app/model/event/instance.php +156 -66
  10. app/model/filter/instance_ids.php +18 -0
  11. app/model/search.php +73 -13
  12. app/model/settings.php +9 -4
  13. app/view/admin/add-new-event.php +0 -21
  14. app/view/admin/all-events.php +26 -13
  15. app/view/admin/get-repeat-box.php +133 -29
  16. app/view/admin/nav.php +7 -0
  17. app/view/calendar/page.php +16 -5
  18. app/view/calendar/view/abstract.php +12 -2
  19. app/view/calendar/view/agenda.php +28 -8
  20. app/view/calendar/view/month.php +14 -5
  21. app/view/calendar/view/oneday.php +18 -10
  22. app/view/calendar/view/week.php +13 -5
  23. app/view/event/content.php +7 -0
  24. app/view/event/single.php +1 -0
  25. app/view/event/taxonomy.php +23 -2
  26. language/all-in-one-event-calendar.mo +0 -0
  27. language/all-in-one-event-calendar.po +218 -221
  28. language/all-in-one-event-calendar.pot +215 -218
  29. lib/bootstrap/loader-map.php +51 -19
  30. lib/calendar-feed/ics.php +56 -27
  31. lib/calendar/updates.php +136 -0
  32. lib/command/abstract.php +3 -1
  33. lib/command/check-updates.php +41 -0
  34. lib/command/clone.php +14 -7
  35. lib/command/compile-themes.php +1 -2
  36. lib/command/render-event.php +1 -1
  37. lib/command/resolver.php +10 -0
  38. lib/content/filter.php +21 -1
  39. lib/dbi/dbi-utils.php +25 -0
  40. lib/environment/check.php +2 -2
  41. lib/factory/html.php +5 -0
  42. lib/html/element/href.php +1 -0
  43. lib/html/element/setting/abstract.php +8 -4
  44. lib/html/element/setting/input.php +5 -1
  45. lib/html/element/setting/select.php +8 -4
  46. lib/http/request/parser.php +1 -0
  47. lib/import-export/ics.php +33 -36
  48. lib/post/custom-type.php +7 -1
  49. lib/recurrence/rule.php +25 -7
  50. lib/template/link/helper.php +22 -1
  51. public/admin/box_event_contact.php +2 -2
  52. public/admin/box_event_cost.php +1 -1
  53. public/admin/box_repeat.php +13 -13
  54. public/admin/css/settings.css +19 -0
  55. public/admin/css/super-widget.css +11 -0
  56. public/admin/feed_row.php +122 -95
  57. public/admin/plugins/ics/display_feeds.php +16 -13
  58. public/admin/row_custom.php +1 -1
  59. public/admin/row_monthly.php +2 -2
  60. public/admin/twig/organize/tab.twig +1 -1
  61. public/admin/twig/setting/categories-image.twig +41 -41
  62. public/admin/twig/setting/tags-categories.twig +2 -2
  63. public/js/agenda.js +1 -1
  64. public/js/build.txt +44 -5
  65. public/js/external_libs/moment.js +6 -2
  66. public/js/external_libs/select2.js +1 -1
  67. public/js/external_libs/twig.js +19 -1
  68. public/js/libs/utils.js +1 -1
  69. public/js/month.js +1 -1
  70. public/js/oneday.js +1 -1
  71. public/js/pages/add_new_event.js +1 -1
  72. public/js/pages/admin_settings.js +1 -1
  73. public/js/pages/calendar.js +20 -3
all-in-one-event-calendar.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: A calendar system with month, week, day, agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
6
  * Author: Time.ly Network Inc.
7
  * Author URI: http://time.ly/
8
- * Version: 2.2.1
9
  * Text Domain: all-in-one-event-calendar
10
  * Domain Path: /language
11
  */
@@ -82,4 +82,4 @@ $ai1ec_loader = new Ai1ec_Loader( $ai1ec_base_dir );
82
  spl_autoload_register( array( $ai1ec_loader, 'load' ) );
83
 
84
  $ai1ec_front_controller = new Ai1ec_Front_Controller();
85
- $ai1ec_front_controller->initialize( $ai1ec_loader );
5
  * Description: A calendar system with month, week, day, agenda views, upcoming events widget, color-coded categories, recurrence, and import/export of .ics feeds.
6
  * Author: Time.ly Network Inc.
7
  * Author URI: http://time.ly/
8
+ * Version: 2.3.0
9
  * Text Domain: all-in-one-event-calendar
10
  * Domain Path: /language
11
  */
82
  spl_autoload_register( array( $ai1ec_loader, 'load' ) );
83
 
84
  $ai1ec_front_controller = new Ai1ec_Front_Controller();
85
+ $ai1ec_front_controller->initialize( $ai1ec_loader );
app/config/constants.php CHANGED
@@ -50,7 +50,7 @@ function ai1ec_initiate_constants( $ai1ec_base_dir, $ai1ec_base_url ) {
50
  // = Plugin Version =
51
  // ==================
52
  if ( ! defined( 'AI1EC_VERSION' ) ) {
53
- define( 'AI1EC_VERSION', '2.2.1' );
54
  }
55
 
56
  // ================
@@ -341,17 +341,6 @@ function ai1ec_initiate_constants( $ai1ec_base_dir, $ai1ec_base_url ) {
341
  define( 'AI1EC_ALTERNATIVE_ARCHIVE_URL', 'ai1ec_events_archive' );
342
  }
343
 
344
- // ===============================
345
- // = Time.ly redirection service =
346
- // ===============================
347
- if ( ! defined( 'AI1EC_REDIRECTION_SERVICE' ) ) {
348
- define(
349
- 'AI1EC_REDIRECTION_SERVICE',
350
- 'http://aggregator.time.ly/ticket_redirect/'
351
- );
352
- }
353
-
354
-
355
  // ===================
356
  // = AI1EC Theme URL =
357
  // ===================
@@ -475,4 +464,14 @@ function ai1ec_initiate_constants( $ai1ec_base_dir, $ai1ec_base_url ) {
475
  'agenda,oneday,week,month,posterboard,stream'
476
  );
477
  }
 
 
 
 
 
 
 
 
 
 
478
  }
50
  // = Plugin Version =
51
  // ==================
52
  if ( ! defined( 'AI1EC_VERSION' ) ) {
53
+ define( 'AI1EC_VERSION', '2.3.0' );
54
  }
55
 
56
  // ================
341
  define( 'AI1EC_ALTERNATIVE_ARCHIVE_URL', 'ai1ec_events_archive' );
342
  }
343
 
 
 
 
 
 
 
 
 
 
 
 
344
  // ===================
345
  // = AI1EC Theme URL =
346
  // ===================
464
  'agenda,oneday,week,month,posterboard,stream'
465
  );
466
  }
467
+
468
+ // ================================================
469
+ // = Force WordPress updates command link =
470
+ // ================================================
471
+ if ( ! defined( 'AI1EC_FORCE_UPDATES_URL' ) ) {
472
+ define(
473
+ 'AI1EC_FORCE_UPDATES_URL',
474
+ AI1EC_ADMIN_BASE_URL . '&ai1ec_force_updates=true'
475
+ );
476
+ }
477
  }
app/controller/extension-license.php CHANGED
@@ -39,7 +39,6 @@ abstract class Ai1ec_Base_License_Controller extends Ai1ec_Base_Extension_Contro
39
  public function initialize_licence_actions() {
40
  $this->_register_licence_actions();
41
  $this->_register_licence_fields();
42
- $this->_register_updating();
43
  }
44
 
45
  /**
@@ -52,53 +51,11 @@ abstract class Ai1ec_Base_License_Controller extends Ai1ec_Base_Extension_Contro
52
  if ( ! isset( $tabs['extensions'] ) ) {
53
  $tabs['extensions'] = array(
54
  'name' => Ai1ec_I18n::__( 'Add-ons' ),
55
- 'items' => array(
56
- 'licenses' => Ai1ec_I18n::__( 'Licenses' ),
57
- ),
58
  );
59
- } else if ( ! isset( $tabs['extensions']['items']['licenses'] ) ) {
60
- $tabs['extensions']['items']['licenses'] = Ai1ec_I18n::__( 'Licences' );
61
- }
62
- return $tabs;
63
- }
64
-
65
- /**
66
- * Check the licence if it has changed and adds the status
67
- *
68
- * @param array $old_options
69
- * @param array $new_options
70
- *
71
- */
72
- public function check_licence( array $old_options, array $new_options ) {
73
- $old_licence = $old_options[$this->_licence]['value'];
74
- $new_licence = $new_options[$this->_licence]['value'];
75
- $status = $old_options[$this->_licence_status]['value'];
76
- if ( $new_licence !== $old_licence ) {
77
- $license = trim( $new_licence );
78
- // data to send in our API request
79
- $api_params = array(
80
- 'edd_action' => 'activate_license',
81
- 'license' => $license,
82
- 'item_name' => urlencode( $this->get_name() ),// the name of our product in EDD,
83
- 'url' => home_url()
84
- );
85
-
86
- // Call the custom API.
87
- $response = wp_remote_get( add_query_arg( $api_params, $this->_store ) );
88
-
89
- // make sure the response came back okay
90
- if ( is_wp_error( $response ) ) {
91
- return false;
92
- }
93
-
94
- // decode the license data
95
- $license_data = json_decode( wp_remote_retrieve_body( $response ) );
96
- // $license_data->license will be either "active" or "inactive"
97
-
98
- $this->_registry->get( 'model.settings' )
99
- ->set( $this->_licence_status, $license_data->license );
100
  }
101
 
 
102
  }
103
 
104
  /**
@@ -113,33 +70,6 @@ abstract class Ai1ec_Base_License_Controller extends Ai1ec_Base_Extension_Contro
113
  'ai1ec_add_setting_tabs',
114
  array( 'controller.' . $controller, 'add_tabs' )
115
  );
116
- $dispatcher->register_action(
117
- 'ai1ec_settings_updated',
118
- array( 'controller.' . $controller, 'check_licence' ),
119
- 10,
120
- 2
121
- );
122
- }
123
-
124
- /**
125
- * Register EDD updater class
126
- */
127
- protected function _register_updating() {
128
- $license_key = $this->_registry->get( 'model.settings' )
129
- ->get( $this->_licence );
130
- // setup the updater
131
- $edd_updater = $this->_registry->get(
132
- 'edd.updater',
133
- $this->_store,
134
- $this->get_file(),
135
- array(
136
- 'version' => $this->get_version(), // current version number
137
- 'license' => $license_key, // license key (used get_option above to retrieve from DB)
138
- 'item_name' => $this->get_name(), // name of this plugin
139
- 'author' => 'Time.ly Network Inc.', // author of this plugin
140
- 'url' => home_url(),
141
- )
142
- );
143
  }
144
 
145
  /**
39
  public function initialize_licence_actions() {
40
  $this->_register_licence_actions();
41
  $this->_register_licence_fields();
 
42
  }
43
 
44
  /**
51
  if ( ! isset( $tabs['extensions'] ) ) {
52
  $tabs['extensions'] = array(
53
  'name' => Ai1ec_I18n::__( 'Add-ons' ),
54
+ 'items' => array(),
 
 
55
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
 
58
+ return $tabs;
59
  }
60
 
61
  /**
70
  'ai1ec_add_setting_tabs',
71
  array( 'controller.' . $controller, 'add_tabs' )
72
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
74
 
75
  /**
app/controller/front.php CHANGED
@@ -502,6 +502,12 @@ class Ai1ec_Front_Controller {
502
  'admin_action_editpost',
503
  array( 'model.event.parent', 'admin_init_post' )
504
  );
 
 
 
 
 
 
505
  }
506
  // post row action for parent/child
507
  $dispatcher->register_action(
@@ -634,6 +640,10 @@ class Ai1ec_Front_Controller {
634
  'wp_ajax_ai1ec_update_ics',
635
  array( 'calendar-feed.ics', 'update_ics_feed' )
636
  );
 
 
 
 
637
  $dispatcher->register_action(
638
  'network_admin_notices',
639
  array( 'notification.admin', 'send' )
@@ -656,10 +666,6 @@ class Ai1ec_Front_Controller {
656
  'add_meta_boxes',
657
  array( 'view.admin.add-new-event', 'event_meta_box_container' )
658
  );
659
- $dispatcher->register_action(
660
- 'add_meta_boxes',
661
- array( 'view.admin.add-new-event', 'event_banner_meta_box_container' )
662
- );
663
  $dispatcher->register_action(
664
  'edit_form_after_title',
665
  array( 'view.admin.add-new-event', 'event_inline_alert' )
@@ -732,6 +738,16 @@ class Ai1ec_Front_Controller {
732
  'admin_menu',
733
  array( 'view.admin.widget-creator', 'add_page' )
734
  );
 
 
 
 
 
 
 
 
 
 
735
 
736
  } else { // ! is_admin()
737
  $dispatcher->register_action(
502
  'admin_action_editpost',
503
  array( 'model.event.parent', 'admin_init_post' )
504
  );
505
+ $dispatcher->register_filter(
506
+ 'user_has_cap',
507
+ array( 'content.filter', 'display_trash_link' ),
508
+ 10,
509
+ 4
510
+ );
511
  }
512
  // post row action for parent/child
513
  $dispatcher->register_action(
640
  'wp_ajax_ai1ec_update_ics',
641
  array( 'calendar-feed.ics', 'update_ics_feed' )
642
  );
643
+ $dispatcher->register_action(
644
+ 'wp_ajax_ai1ec_feeds_page_post',
645
+ array( 'calendar-feed.ics', 'handle_feeds_page_post' )
646
+ );
647
  $dispatcher->register_action(
648
  'network_admin_notices',
649
  array( 'notification.admin', 'send' )
666
  'add_meta_boxes',
667
  array( 'view.admin.add-new-event', 'event_meta_box_container' )
668
  );
 
 
 
 
669
  $dispatcher->register_action(
670
  'edit_form_after_title',
671
  array( 'view.admin.add-new-event', 'event_inline_alert' )
738
  'admin_menu',
739
  array( 'view.admin.widget-creator', 'add_page' )
740
  );
741
+ $dispatcher->register_filter(
742
+ 'pre_set_site_transient_update_plugins',
743
+ array( 'calendar.updates', 'check_updates' )
744
+ );
745
+ $dispatcher->register_filter(
746
+ 'plugins_api',
747
+ array( 'calendar.updates', 'plugins_api_filter' ),
748
+ 10,
749
+ 3
750
+ );
751
 
752
  } else { // ! is_admin()
753
  $dispatcher->register_action(
app/controller/javascript-widget.php CHANGED
@@ -88,16 +88,22 @@ class Ai1ec_Controller_Javascript_Widget extends Ai1ec_Base {
88
  $require_main = AI1EC_ADMIN_THEME_JS_PATH . DIRECTORY_SEPARATOR . 'require.js';
89
  $widget_file = AI1EC_PATH . '/public/js/widget/common_widget.js';
90
  $translation = $jscontroller->get_frontend_translation_data();
 
 
 
91
  $permalink = get_permalink(
92
- $this->_registry->get( 'model.settings' )
93
- ->get( 'calendar_page_id' )
94
  );
 
 
 
95
  // load the css to hardcode, saving a call
96
  $css_rules = $css_controller->get_compiled_css();
97
  $css_rules = addslashes( $css_rules );
98
  $translation['permalinks_structure'] = $this->
99
  _registry->get( 'model.option' )->get( 'permalink_structure' );
100
- $translation['calendar_url'] = $permalink;
 
101
  // Let extensions add their scripts.
102
  // look at Extended Views or Super Widget for examples
103
  $extension_urls = array();
88
  $require_main = AI1EC_ADMIN_THEME_JS_PATH . DIRECTORY_SEPARATOR . 'require.js';
89
  $widget_file = AI1EC_PATH . '/public/js/widget/common_widget.js';
90
  $translation = $jscontroller->get_frontend_translation_data();
91
+ $page_id = $this->_registry->get(
92
+ 'model.settings'
93
+ )->get( 'calendar_page_id' );
94
  $permalink = get_permalink(
95
+ $page_id
 
96
  );
97
+ $full_permalink = $this->_registry->get(
98
+ 'template.link.helper'
99
+ )->get_full_permalink( $page_id );
100
  // load the css to hardcode, saving a call
101
  $css_rules = $css_controller->get_compiled_css();
102
  $css_rules = addslashes( $css_rules );
103
  $translation['permalinks_structure'] = $this->
104
  _registry->get( 'model.option' )->get( 'permalink_structure' );
105
+ $translation['calendar_url'] = $permalink;
106
+ $translation['full_calendar_url'] = $full_permalink;
107
  // Let extensions add their scripts.
108
  // look at Extended Views or Super Widget for examples
109
  $extension_urls = array();
app/controller/javascript.php CHANGED
@@ -215,10 +215,13 @@ class Ai1ec_Javascript_Controller {
215
  }
216
 
217
  // Load translation module.
218
- $translation = $this->get_frontend_translation_data();
219
- $permalink = $this->_template_link_helper
220
  ->get_permalink( $this->_settings->get( 'calendar_page_id' ) );
221
- $translation['calendar_url'] = $permalink;
 
 
 
222
  $translation_module = $this->create_require_js_module(
223
  self::FRONTEND_CONFIG_MODULE,
224
  $translation
@@ -413,7 +416,7 @@ class Ai1ec_Javascript_Controller {
413
  'When the "Input coordinates" checkbox is checked, "Longitude" is a required field.'
414
  ),
415
  'ai1ec_contact_url_not_valid' => Ai1ec_I18n::__(
416
- 'The URL you have entered in the <b>Organizer Contact Info</b> &gt; <b>External URL</b> seems to be invalid.'
417
  ),
418
  'ai1ec_ticket_url_not_valid' => Ai1ec_I18n::__(
419
  'The URL you have entered in the <b>Event Cost and Tickets</b> &gt; <b>Buy Tickets URL</b> seems to be invalid.'
@@ -616,7 +619,7 @@ JSC;
616
  self::JS_HANDLE,
617
  $url,
618
  array(),
619
- true
620
  );
621
  }
622
  }
215
  }
216
 
217
  // Load translation module.
218
+ $translation = $this->get_frontend_translation_data();
219
+ $permalink = $this->_template_link_helper
220
  ->get_permalink( $this->_settings->get( 'calendar_page_id' ) );
221
+ $full_permalink = $this->_template_link_helper
222
+ ->get_full_permalink( $this->_settings->get( 'calendar_page_id' ) );
223
+ $translation['calendar_url'] = $permalink;
224
+ $translation['full_calendar_url'] = $full_permalink;
225
  $translation_module = $this->create_require_js_module(
226
  self::FRONTEND_CONFIG_MODULE,
227
  $translation
416
  'When the "Input coordinates" checkbox is checked, "Longitude" is a required field.'
417
  ),
418
  'ai1ec_contact_url_not_valid' => Ai1ec_I18n::__(
419
+ 'The URL you have entered in the <b>Organizer Contact Info</b> &gt; <b>Website URL</b> seems to be invalid.'
420
  ),
421
  'ai1ec_ticket_url_not_valid' => Ai1ec_I18n::__(
422
  'The URL you have entered in the <b>Event Cost and Tickets</b> &gt; <b>Buy Tickets URL</b> seems to be invalid.'
619
  self::JS_HANDLE,
620
  $url,
621
  array(),
622
+ false
623
  );
624
  }
625
  }
app/model/event-compatibility.php CHANGED
@@ -96,4 +96,30 @@ class Ai1ec_Event_Compatibility extends Ai1ec_Event {
96
  public function getavatar_not_wrapped() {
97
  return $this->getavatar( false );
98
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
96
  public function getavatar_not_wrapped() {
97
  return $this->getavatar( false );
98
  }
99
+
100
+ /**
101
+ * Returns enddate specific info.
102
+ *
103
+ * @return array Date info structure.
104
+ */
105
+ public function getenddate_info() {
106
+ return array(
107
+ 'month' => $this->get( 'end' )->format( 'M' ),
108
+ 'day' => $this->get( 'end' )->format( 'j' ),
109
+ 'weekday' => $this->get( 'end' )->format( 'D' ),
110
+ 'year' => $this->get( 'end' )->format( 'Y' ),
111
+ );
112
+ }
113
+
114
+ /**
115
+ * Returns Event avatar URL.
116
+ *
117
+ * @return string Event avatar URL.
118
+ * @throws Ai1ec_Bootstrap_Exception
119
+ */
120
+ public function getavatar_url() {
121
+ return $this->_registry->get(
122
+ 'view.event.avatar'
123
+ )->get_event_avatar_url( $this );
124
+ }
125
  }
app/model/event.php CHANGED
@@ -24,9 +24,7 @@ class Ai1ec_Event extends Ai1ec_Base {
24
  * [-1] - only `get` (for storage) operations require care.
25
  */
26
  protected $_swizzable = array(
27
- 'contact_url' => -1, // strip on save/import
28
  'cost' => 0,
29
- 'ticket_url' => -1, // strip on save/import
30
  'start' => -1,
31
  'end' => -1,
32
  'timezone_name' => -1,
@@ -230,7 +228,11 @@ class Ai1ec_Event extends Ai1ec_Base {
230
  GROUP_CONCAT( ttt.term_id ) AS tags
231
  ';
232
 
233
- if ( false !== $instance && is_numeric( $instance ) ) {
 
 
 
 
234
  $select_sql .= ', IF( aei.start IS NOT NULL, aei.start, e.start ) as start,' .
235
  ' IF( aei.start IS NOT NULL, aei.end, e.end ) as end ';
236
 
@@ -240,6 +242,13 @@ class Ai1ec_Event extends Ai1ec_Base {
240
  ' aei ON aei.id = ' . $instance . ' AND e.post_id = aei.post_id ';
241
  } else {
242
  $select_sql .= ', e.start as start, e.end as end, e.allday ';
 
 
 
 
 
 
 
243
  }
244
 
245
  // =============================
@@ -284,14 +293,15 @@ class Ai1ec_Event extends Ai1ec_Base {
284
  * initialize fields with associative
285
  * array $data containing both post
286
  * and event fields.
287
- * @param bool $instance Optionally instance ID.
 
 
288
  *
289
  * @throws Ai1ec_Invalid_Argument_Exception When $data is not one
290
  * of int|array|null.
291
  * @throws Ai1ec_Event_Not_Found_Exception When $data relates to
292
  * non-existent ID.
293
  *
294
- * @return void
295
  */
296
  function __construct(
297
  Ai1ec_Registry_Object $registry,
@@ -324,35 +334,6 @@ class Ai1ec_Event extends Ai1ec_Base {
324
  }
325
  }
326
 
327
- /**
328
- * Restore original URL from loggable event URL
329
- *
330
- * @param string $value URL as seen by visitor
331
- *
332
- * @return string Original URL
333
- */
334
- public function get_nonloggable_url( $value ) {
335
- if (
336
- empty( $value ) ||
337
- false === strpos( $value, AI1EC_REDIRECTION_SERVICE )
338
- ) {
339
- return $value;
340
- }
341
- $decoded = json_decode(
342
- base64_decode(
343
- trim(
344
- substr( $value, strlen( AI1EC_REDIRECTION_SERVICE ) ),
345
- '/'
346
- )
347
- ),
348
- true
349
- );
350
- if ( ! isset( $decoded['l'] ) ) {
351
- return '';
352
- }
353
- return $decoded['l'];
354
- }
355
-
356
  /**
357
  * Twig method for retrieving avatar.
358
  *
@@ -779,17 +760,6 @@ class Ai1ec_Event extends Ai1ec_Base {
779
  return $timezone_name;
780
  }
781
 
782
- /**
783
- * Store `Ticket URL` in non-loggable form
784
- *
785
- * @param string $ticket_url URL for buying tickets.
786
- *
787
- * @return string Non loggable URL
788
- */
789
- protected function _handle_property_destruct_ticket_url( $ticket_url ) {
790
- return $this->get_nonloggable_url( $ticket_url );
791
- }
792
-
793
  /**
794
  * Format datetime to UNIX timestamp for storage.
795
  *
@@ -812,17 +782,6 @@ class Ai1ec_Event extends Ai1ec_Base {
812
  return $end->format_to_gmt();
813
  }
814
 
815
- /**
816
- * Store `Contact URL` in non-loggable form.
817
- *
818
- * @param string $contact_url URL for contact details.
819
- *
820
- * @return string Non loggable URL.
821
- */
822
- protected function _handle_property_destruct_contact_url( $contact_url ) {
823
- return $this->get_nonloggable_url( $contact_url );
824
- }
825
-
826
  /**
827
  * Handle `cost` writing to permanent storage.
828
  *
24
  * [-1] - only `get` (for storage) operations require care.
25
  */
26
  protected $_swizzable = array(
 
27
  'cost' => 0,
 
28
  'start' => -1,
29
  'end' => -1,
30
  'timezone_name' => -1,
228
  GROUP_CONCAT( ttt.term_id ) AS tags
229
  ';
230
 
231
+ if (
232
+ false !== $instance &&
233
+ is_numeric( $instance ) &&
234
+ $instance > 0
235
+ ) {
236
  $select_sql .= ', IF( aei.start IS NOT NULL, aei.start, e.start ) as start,' .
237
  ' IF( aei.start IS NOT NULL, aei.end, e.end ) as end ';
238
 
242
  ' aei ON aei.id = ' . $instance . ' AND e.post_id = aei.post_id ';
243
  } else {
244
  $select_sql .= ', e.start as start, e.end as end, e.allday ';
245
+ if ( -1 === (int)$instance ) {
246
+ $select_sql .= ', aei.id as instance_id ';
247
+ $left_join = 'LEFT JOIN ' .
248
+ $dbi->get_table_name( 'ai1ec_event_instances' ) .
249
+ ' aei ON e.post_id = aei.post_id ' .
250
+ 'AND e.start = aei.start AND e.end = aei.end ';
251
+ }
252
  }
253
 
254
  // =============================
293
  * initialize fields with associative
294
  * array $data containing both post
295
  * and event fields.
296
+ * @param int|bool $instance Optionally instance ID. When ID
297
+ * value is -1 then it is
298
+ * retrieved from db.
299
  *
300
  * @throws Ai1ec_Invalid_Argument_Exception When $data is not one
301
  * of int|array|null.
302
  * @throws Ai1ec_Event_Not_Found_Exception When $data relates to
303
  * non-existent ID.
304
  *
 
305
  */
306
  function __construct(
307
  Ai1ec_Registry_Object $registry,
334
  }
335
  }
336
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  /**
338
  * Twig method for retrieving avatar.
339
  *
760
  return $timezone_name;
761
  }
762
 
 
 
 
 
 
 
 
 
 
 
 
763
  /**
764
  * Format datetime to UNIX timestamp for storage.
765
  *
782
  return $end->format_to_gmt();
783
  }
784
 
 
 
 
 
 
 
 
 
 
 
 
785
  /**
786
  * Handle `cost` writing to permanent storage.
787
  *
app/model/event/instance.php CHANGED
@@ -16,16 +16,23 @@ class Ai1ec_Event_Instance extends Ai1ec_Base {
16
  */
17
  protected $_dbi = null;
18
 
 
 
 
 
 
 
 
19
  /**
20
  * Store locally instance of Ai1ec_Dbi.
21
  *
22
  * @param Ai1ec_Registry_Object $registry Injected object registry.
23
  *
24
- * @return void
25
  */
26
  public function __construct( Ai1ec_Registry_Object $registry ) {
27
  parent::__construct( $registry );
28
- $this->_dbi = $this->_registry->get( 'dbi.dbi' );
 
29
  }
30
 
31
  /**
@@ -54,8 +61,19 @@ class Ai1ec_Event_Instance extends Ai1ec_Base {
54
  * @return bool Success.
55
  */
56
  public function recreate( Ai1ec_Event $event ) {
57
- $this->clean( $event->get( 'post_id' ) );
58
- return ( false !== $this->create( $event ) );
 
 
 
 
 
 
 
 
 
 
 
59
  }
60
 
61
  /**
@@ -167,67 +185,8 @@ class Ai1ec_Event_Instance extends Ai1ec_Base {
167
  * @return bool Success.
168
  */
169
  public function create( Ai1ec_Event $event ) {
170
- $events = array();
171
- $event_item = array(
172
- 'post_id' => $event->get( 'post_id' ),
173
- 'start' => $event->get( 'start' )->format_to_gmt(),
174
- 'end' => $event->get( 'end' )->format_to_gmt(),
175
- );
176
- $duration = $event->get( 'end' )->diff_sec( $event->get( 'start' ) );
177
-
178
- $_start = $event->get( 'start' )->format_to_gmt();
179
- $_end = $event->get( 'end' )->format_to_gmt();
180
-
181
- // Always cache initial instance
182
- $events[$_start] = $event_item;
183
-
184
- if ( $event->get( 'recurrence_rules' ) || $event->get( 'recurrence_dates' ) ) {
185
- /**
186
- * NOTE: this timezone switch is intentional, because underlying
187
- * library doesn't allow us to pass it as an argument. Though no
188
- * lesser importance shall be given to the restore call bellow.
189
- */
190
- $start_datetime = $event->get( 'start' );
191
- $start_datetime->assert_utc_timezone();
192
- $start_timezone = $this->_registry->get( 'date.timezone' )
193
- ->get_name( $start_datetime->get_timezone() );
194
- $events += $this->create_instances_by_recurrence(
195
- $event,
196
- $event_item,
197
- $_start,
198
- $duration,
199
- $start_timezone
200
- );
201
- }
202
-
203
- $search_helper = $this->_registry->get( 'model.search' );
204
- foreach ( $events as $event_item ) {
205
- // Find out if this event instance is already accounted for by an
206
- // overriding 'RECURRENCE-ID' of the same iCalendar feed (by comparing the
207
- // UID, start date, recurrence). If so, then do not create duplicate
208
- // instance of event.
209
- $start = $event_item['start'];
210
- $matching_event_id = null;
211
- if ( $event->get( 'ical_uid' ) ) {
212
- $matching_event_id = $search_helper->get_matching_event_id(
213
- $event->get( 'ical_uid' ),
214
- $event->get( 'ical_feed_url' ),
215
- $event->get( 'start' ),
216
- false,
217
- $event->get( 'post_id' )
218
- );
219
- }
220
-
221
- // If no other instance was found
222
- if ( null === $matching_event_id ) {
223
- $this->_dbi->insert(
224
- 'ai1ec_event_instances',
225
- $event_item,
226
- array( '%d', '%d', '%d' )
227
- );
228
- }
229
- }
230
-
231
  return true;
232
  }
233
 
@@ -317,4 +276,135 @@ class Ai1ec_Event_Instance extends Ai1ec_Base {
317
  return $parsed;
318
  }
319
 
320
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  */
17
  protected $_dbi = null;
18
 
19
+ /**
20
+ * DBI utils.
21
+ *
22
+ * @var Ai1ec_Dbi_Utils
23
+ */
24
+ protected $_dbi_utils;
25
+
26
  /**
27
  * Store locally instance of Ai1ec_Dbi.
28
  *
29
  * @param Ai1ec_Registry_Object $registry Injected object registry.
30
  *
 
31
  */
32
  public function __construct( Ai1ec_Registry_Object $registry ) {
33
  parent::__construct( $registry );
34
+ $this->_dbi = $this->_registry->get( 'dbi.dbi' );
35
+ $this->_dbi_utils = $this->_registry->get( 'dbi.dbi-utils' );
36
  }
37
 
38
  /**
61
  * @return bool Success.
62
  */
63
  public function recreate( Ai1ec_Event $event ) {
64
+ $old_instances = $this->_load_instances( $event->get( 'post_id' ) );
65
+ $instances = $this->_create_instances_collection( $event );
66
+ $insert = array();
67
+ foreach ( $instances as $instance ) {
68
+ if ( ! isset( $old_instances[$instance['start'] . ':' . $instance['end']] ) ) {
69
+ $insert[] = $instance;
70
+ continue;
71
+ }
72
+ unset( $old_instances[$instance['start'] . ':' . $instance['end']] );
73
+ }
74
+ $this->_remove_instances_by_ids( array_values( $old_instances ) );
75
+ $this->_add_instances( $insert );
76
+ return true;
77
  }
78
 
79
  /**
185
  * @return bool Success.
186
  */
187
  public function create( Ai1ec_Event $event ) {
188
+ $instances = $this->_create_instances_collection( $event );
189
+ $this->_add_instances( $instances );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  return true;
191
  }
192
 
276
  return $parsed;
277
  }
278
 
279
+ /**
280
+ * Returns current instances map.
281
+ *
282
+ * @param int post_id Post ID.
283
+ *
284
+ * @return array Array of data.
285
+ */
286
+ protected function _load_instances( $post_id ) {
287
+ $query = $this->_dbi->prepare(
288
+ 'SELECT `id`, `start`, `end` FROM ' .
289
+ $this->_dbi->get_table_name( 'ai1ec_event_instances' ) .
290
+ ' WHERE post_id = %d',
291
+ $post_id
292
+ );
293
+ $results = $this->_dbi->get_results( $query );
294
+ $instances = array();
295
+ foreach ( $results as $result ) {
296
+ $instances[(int)$result->start . ':' . (int)$result->end] = (int)$result->id;
297
+ }
298
+ return $instances;
299
+ }
300
+
301
+ /**
302
+ * Generate and store instance entries in database for given event.
303
+ *
304
+ * @param Ai1ec_Event $event Instance of event to create entries for.
305
+ *
306
+ * @return bool Success.
307
+ */
308
+ protected function _create_instances_collection( Ai1ec_Event $event ) {
309
+ $events = array();
310
+ $event_item = array(
311
+ 'post_id' => $event->get( 'post_id' ),
312
+ 'start' => $event->get( 'start' )->format_to_gmt(),
313
+ 'end' => $event->get( 'end' )->format_to_gmt(),
314
+ );
315
+ $duration = $event->get( 'end' )->diff_sec( $event->get( 'start' ) );
316
+
317
+ $_start = $event->get( 'start' )->format_to_gmt();
318
+ $_end = $event->get( 'end' )->format_to_gmt();
319
+
320
+ // Always cache initial instance
321
+ $events[$_start] = $event_item;
322
+
323
+ if ( $event->get( 'recurrence_rules' ) || $event->get( 'recurrence_dates' ) ) {
324
+ /**
325
+ * NOTE: this timezone switch is intentional, because underlying
326
+ * library doesn't allow us to pass it as an argument. Though no
327
+ * lesser importance shall be given to the restore call bellow.
328
+ */
329
+ $start_datetime = $event->get( 'start' );
330
+ $start_datetime->assert_utc_timezone();
331
+ $start_timezone = $this->_registry->get( 'date.timezone' )
332
+ ->get_name( $start_datetime->get_timezone() );
333
+ $events += $this->create_instances_by_recurrence(
334
+ $event,
335
+ $event_item,
336
+ $_start,
337
+ $duration,
338
+ $start_timezone
339
+ );
340
+ }
341
+
342
+ $search_helper = $this->_registry->get( 'model.search' );
343
+ foreach ( $events as &$event_item ) {
344
+ // Find out if this event instance is already accounted for by an
345
+ // overriding 'RECURRENCE-ID' of the same iCalendar feed (by comparing the
346
+ // UID, start date, recurrence). If so, then do not create duplicate
347
+ // instance of event.
348
+ $start = $event_item['start'];
349
+ $matching_event_id = null;
350
+ if ( $event->get( 'ical_uid' ) ) {
351
+ $matching_event_id = $search_helper->get_matching_event_id(
352
+ $event->get( 'ical_uid' ),
353
+ $event->get( 'ical_feed_url' ),
354
+ $event->get( 'start' ),
355
+ false,
356
+ $event->get( 'post_id' )
357
+ );
358
+ }
359
+
360
+ // If no other instance was found
361
+ if ( null !== $matching_event_id ) {
362
+ $event_item = false;
363
+ }
364
+ }
365
+
366
+ return array_filter( $events );
367
+ }
368
+
369
+ /**
370
+ * Removes ai1ec_event_instances entries using their IDS.
371
+ *
372
+ * @param array $ids Collection of IDS.
373
+ *
374
+ * @return bool Result.
375
+ */
376
+ protected function _remove_instances_by_ids( array $ids ) {
377
+ if ( empty( $ids ) ) {
378
+ return false;
379
+ }
380
+ $query = 'DELETE FROM ' . $this->_dbi->get_table_name(
381
+ 'ai1ec_event_instances'
382
+ ) . ' WHERE id IN (';
383
+ $ids = array_filter( array_map( 'intval', $ids ) );
384
+ $query .= implode( ',', $ids ) . ')';
385
+ $this->_dbi->query( $query );
386
+ return true;
387
+ }
388
+
389
+ /**
390
+ * Adds new instances collection.
391
+ *
392
+ * @param array $instances Collection of instances.
393
+ *
394
+ * @return void
395
+ */
396
+ protected function _add_instances( array $instances ) {
397
+ $chunks = array_chunk( $instances, 50 );
398
+ foreach ( $chunks as $chunk ) {
399
+ $query = 'INSERT INTO ' . $this->_dbi->get_table_name(
400
+ 'ai1ec_event_instances'
401
+ ) . '(`post_id`, `start`, `end`) VALUES';
402
+ $chunk = array_map(
403
+ array( $this->_dbi_utils, 'array_value_to_sql_value' ),
404
+ $chunk
405
+ );
406
+ $query .= implode( ',', $chunk );
407
+ $this->_dbi->query( $query );
408
+ }
409
+ }
410
+ }
app/model/filter/instance_ids.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Posts (events) filtering implementation.
5
+ *
6
+ * @instantiator new
7
+ * @author Time.ly Network Inc.
8
+ * @since 2.0
9
+ * @package AI1EC
10
+ * @subpackage AI1EC.Filter
11
+ */
12
+ class Ai1ec_Filter_Posts_By_Instance extends Ai1ec_Filter_Int {
13
+
14
+ public function get_field() {
15
+ return 'i.id';
16
+ }
17
+
18
+ }
app/model/search.php CHANGED
@@ -16,6 +16,13 @@ class Ai1ec_Event_Search extends Ai1ec_Base {
16
  */
17
  private $_dbi = null;
18
 
 
 
 
 
 
 
 
19
  /**
20
  * Creates local DBI instance.
21
  */
@@ -24,6 +31,13 @@ class Ai1ec_Event_Search extends Ai1ec_Base {
24
  $this->_dbi = $this->_registry->get( 'dbi.dbi' );
25
  }
26
 
 
 
 
 
 
 
 
27
  /**
28
  * Fetches the event object with the given post ID.
29
  *
@@ -54,10 +68,12 @@ class Ai1ec_Event_Search extends Ai1ec_Base {
54
  * @param Ai1ec_Date_Time $start Limit to events starting after this.
55
  * @param Ai1ec_Date_Time $end Limit to events starting before this.
56
  * @param array $filter Array of filters for the events returned:
57
- * ['cat_ids'] => list of category IDs;
58
- * ['tag_ids'] => list of tag IDs;
59
- * ['post_ids'] => list of post IDs;
60
- * ['auth_ids'] => list of author IDs.
 
 
61
  * @param bool $spanning Also include events that span this period.
62
  * @param bool $single_day This parameter is added for oneday view.
63
  * Query should find events lasting in
@@ -170,12 +186,18 @@ class Ai1ec_Event_Search extends Ai1ec_Base {
170
  $events = $this->_dbi->get_results( $query, ARRAY_A );
171
 
172
  $id_list = array();
 
173
  foreach ( $events as $event ) {
174
  $id_list[] = $event['post_id'];
 
 
 
 
175
  }
176
 
177
  if ( ! empty( $id_list ) ) {
178
  update_meta_cache( 'post', $id_list );
 
179
  }
180
 
181
  foreach ( $events as &$event ) {
@@ -198,10 +220,11 @@ class Ai1ec_Event_Search extends Ai1ec_Base {
198
  * @param int $limit return a maximum of this number of items
199
  * @param int $page_offset offset the result set by $limit times this number
200
  * @param array $filter Array of filters for the events returned.
201
- * ['cat_ids'] => non-associatative array of category IDs
202
- * ['tag_ids'] => non-associatative array of tag IDs
203
- * ['post_ids'] => non-associatative array of post IDs
204
- * ['auth_ids'] => non-associatative array of author IDs
 
205
  * @param int $last_day Last day (time), that was displayed.
206
  * NOTE FROM NICOLA: be careful, if you want a query with events
207
  * that have a start date which is greater than today, pass 0 as
@@ -471,6 +494,42 @@ class Ai1ec_Event_Search extends Ai1ec_Base {
471
  return $dbi->get_col( $dbi->prepare( $query, array( $feed_url ) ) );
472
  }
473
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
474
  /**
475
  * Check if given event must be treated as all-day event.
476
  *
@@ -597,10 +656,11 @@ class Ai1ec_Event_Search extends Ai1ec_Base {
597
  * statements for running an SQL query limited to the specified options.
598
  *
599
  * @param array $filter Array of filters for the events returned:
600
- * ['cat_ids'] => list of category IDs
601
- * ['tag_ids'] => list of tag IDs
602
- * ['post_ids'] => list of event post IDs
603
- * ['auth_ids'] => list of event author IDs
 
604
  *
605
  * @return array The modified filter array to having:
606
  * ['filter_join'] the Join statements for the SQL
@@ -664,4 +724,4 @@ class Ai1ec_Event_Search extends Ai1ec_Base {
664
  return $where_operator;
665
  }
666
 
667
- }
16
  */
17
  private $_dbi = null;
18
 
19
+ /**
20
+ * Caches the ids of the last 'between' query
21
+ *
22
+ * @var array
23
+ */
24
+ protected $_ids_between_cache = array();
25
+
26
  /**
27
  * Creates local DBI instance.
28
  */
31
  $this->_dbi = $this->_registry->get( 'dbi.dbi' );
32
  }
33
 
34
+ /**
35
+ * @return array
36
+ */
37
+ public function get_cached_between_ids() {
38
+ return $this->_ids_between_cache;
39
+ }
40
+
41
  /**
42
  * Fetches the event object with the given post ID.
43
  *
68
  * @param Ai1ec_Date_Time $start Limit to events starting after this.
69
  * @param Ai1ec_Date_Time $end Limit to events starting before this.
70
  * @param array $filter Array of filters for the events returned:
71
+ * ['cat_ids'] => list of category IDs;
72
+ * ['tag_ids'] => list of tag IDs;
73
+ * ['post_ids'] => list of post IDs;
74
+ * ['auth_ids'] => list of author IDs;
75
+ * ['instance_ids'] => list of events
76
+ * instance ids;
77
  * @param bool $spanning Also include events that span this period.
78
  * @param bool $single_day This parameter is added for oneday view.
79
  * Query should find events lasting in
186
  $events = $this->_dbi->get_results( $query, ARRAY_A );
187
 
188
  $id_list = array();
189
+ $id_instance_list = array();
190
  foreach ( $events as $event ) {
191
  $id_list[] = $event['post_id'];
192
+ $id_instance_list[] = array(
193
+ 'id' => $event['post_id'],
194
+ 'instance_id' => $event['instance_id'],
195
+ );
196
  }
197
 
198
  if ( ! empty( $id_list ) ) {
199
  update_meta_cache( 'post', $id_list );
200
+ $this->_ids_between_cache = $id_instance_list;
201
  }
202
 
203
  foreach ( $events as &$event ) {
220
  * @param int $limit return a maximum of this number of items
221
  * @param int $page_offset offset the result set by $limit times this number
222
  * @param array $filter Array of filters for the events returned.
223
+ * ['cat_ids'] => non-associatative array of category IDs
224
+ * ['tag_ids'] => non-associatative array of tag IDs
225
+ * ['post_ids'] => non-associatative array of post IDs
226
+ * ['auth_ids'] => non-associatative array of author IDs
227
+ * ['instance_ids'] => non-associatative array of author IDs
228
  * @param int $last_day Last day (time), that was displayed.
229
  * NOTE FROM NICOLA: be careful, if you want a query with events
230
  * that have a start date which is greater than today, pass 0 as
494
  return $dbi->get_col( $dbi->prepare( $query, array( $feed_url ) ) );
495
  }
496
 
497
+ /**
498
+ * Returns events instances closest to today.
499
+ *
500
+ * @param array $events_ids Events ids filter.
501
+ *
502
+ * @return array Events collection.
503
+ * @throws Ai1ec_Bootstrap_Exception
504
+ */
505
+ public function get_instances_closest_to_today( array $events_ids = array() ) {
506
+ $where_events_ids = '';
507
+ if ( ! empty( $events_ids ) ) {
508
+ $where_events_ids = 'i.post_id IN ('
509
+ . implode( ',', $events_ids ) . ') AND ';
510
+ }
511
+ $query = 'SELECT i.id, i.post_id FROM ' .
512
+ $this->_dbi->get_table_name( 'ai1ec_event_instances' ) .
513
+ ' i WHERE ' .
514
+ $where_events_ids .
515
+ ' i.start > %d ' .
516
+ ' GROUP BY i.post_id';
517
+ /** @var $today Ai1ec_Date_Time */
518
+ $today = $this->_registry->get( 'date.time', 'now', 'sys.default' );
519
+ $today->set_time( 0, 0, 0 );
520
+ $query = $this->_dbi->prepare( $query, $today->format( 'U' ) );
521
+ $results = $this->_dbi->get_results( $query );
522
+ $events = array();
523
+ foreach ( $results as $result ) {
524
+ $events[] = $this->get_event(
525
+ $result->post_id,
526
+ $result->id
527
+ );
528
+ }
529
+
530
+ return $events;
531
+ }
532
+
533
  /**
534
  * Check if given event must be treated as all-day event.
535
  *
656
  * statements for running an SQL query limited to the specified options.
657
  *
658
  * @param array $filter Array of filters for the events returned:
659
+ * ['cat_ids'] => list of category IDs
660
+ * ['tag_ids'] => list of tag IDs
661
+ * ['post_ids'] => list of event post IDs
662
+ * ['auth_ids'] => list of event author IDs
663
+ * ['instance_ids'] => list of event instance IDs
664
  *
665
  * @return array The modified filter array to having:
666
  * ['filter_join'] the Join statements for the SQL
724
  return $where_operator;
725
  }
726
 
727
+ }
app/model/settings.php CHANGED
@@ -54,11 +54,16 @@ class Ai1ec_Settings extends Ai1ec_App {
54
  ! isset( $this->_options[$option] ) ||
55
  ! isset( $this->_options[$option]['version'] ) ||
56
  (string)$this->_options[$option]['version'] !== (string)$version ||
57
- ( isset( $renderer['label'] ) &&
58
- (string)$this->_options[$option]['renderer']['label'] !== (string)$renderer['label'] ) ||
59
- ( isset( $renderer['help'] ) &&
 
 
 
 
60
  ( ! isset( $this->_options[$option]['renderer']['help'] ) || // handle the case when you are adding help
61
- (string)$this->_options[$option]['renderer']['help'] !== (string)$renderer['help'] ) )
 
62
  ) {
63
  $this->_options[$option] = array(
64
  'value' => ( isset( $this->_options[$option] ) )
54
  ! isset( $this->_options[$option] ) ||
55
  ! isset( $this->_options[$option]['version'] ) ||
56
  (string)$this->_options[$option]['version'] !== (string)$version ||
57
+ (
58
+ isset( $renderer['label'] ) &&
59
+ isset( $this->_options[$option]['renderer'] ) &&
60
+ (string)$this->_options[$option]['renderer']['label'] !== (string)$renderer['label']
61
+ ) ||
62
+ (
63
+ isset( $renderer['help'] ) &&
64
  ( ! isset( $this->_options[$option]['renderer']['help'] ) || // handle the case when you are adding help
65
+ (string)$this->_options[$option]['renderer']['help'] !== (string)$renderer['help'] )
66
+ )
67
  ) {
68
  $this->_options[$option] = array(
69
  'value' => ( isset( $this->_options[$option] ) )
app/view/admin/add-new-event.php CHANGED
@@ -31,27 +31,6 @@ class Ai1ec_View_Add_New_Event extends Ai1ec_Base {
31
  );
32
  }
33
 
34
- /**
35
- * Create hook to display Banner image meta box.
36
- *
37
- * @wp_hook add_meta_boxes
38
- *
39
- * @return void
40
- */
41
- public function event_banner_meta_box_container() {
42
- if ( ! apply_filters( 'ai1ec_use_banner_image', false ) ) {
43
- return;
44
- }
45
- add_meta_box(
46
- AI1EC_POST_TYPE. '_banner',
47
- Ai1ec_I18n::__( 'Banner Image' ),
48
- array( $this, 'banner_meta_box_view' ),
49
- AI1EC_POST_TYPE,
50
- 'side',
51
- 'low'
52
- );
53
- }
54
-
55
  /**
56
  * Add Event Details meta box to the Add/Edit Event screen in the dashboard.
57
  *
31
  );
32
  }
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  /**
35
  * Add Event Details meta box to the Add/Edit Event screen in the dashboard.
36
  *
app/view/admin/all-events.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  class Ai1ec_View_Admin_All_Events extends Ai1ec_Base {
4
-
5
  /**
6
  * change_columns function
7
  *
@@ -30,10 +30,10 @@ class Ai1ec_View_Admin_All_Events extends Ai1ec_Base {
30
  * @return void
31
  **/
32
  public function orderby( $orderby, $wp_query ) {
33
-
34
  $db = $this->_registry->get( 'dbi.dbi' );
35
  $aco = $this->_registry->get( 'acl.aco' );
36
-
37
  if( true === $aco->is_all_events_page() ) {
38
  $wp_query->query = wp_parse_args( $wp_query->query );
39
  $table_name = $db->get_table_name( 'ai1ec_events' );
@@ -46,7 +46,7 @@ class Ai1ec_View_Admin_All_Events extends Ai1ec_Base {
46
  }
47
  return $orderby;
48
  }
49
-
50
  /**
51
  * custom_columns function
52
  *
@@ -66,7 +66,7 @@ class Ai1ec_View_Admin_All_Events extends Ai1ec_Base {
66
  }
67
  }
68
  }
69
-
70
  /**
71
  * sortable_columns function
72
  *
@@ -75,20 +75,24 @@ class Ai1ec_View_Admin_All_Events extends Ai1ec_Base {
75
  * @return void
76
  **/
77
  public function sortable_columns( $columns ) {
78
- $columns["ai1ec_event_date"] = 'ai1ec_event_date';
 
79
  return $columns;
80
  }
81
 
82
  /**
83
  * taxonomy_filter_restrict_manage_posts function
84
  *
85
- * Adds filter dropdowns for event categories and event tags
 
 
 
86
  *
87
  * @return void
88
  **/
89
  function taxonomy_filter_restrict_manage_posts() {
90
  global $typenow;
91
-
92
  // =============================================
93
  // = add the dropdowns only on the events page =
94
  // =============================================
@@ -104,12 +108,21 @@ class Ai1ec_View_Admin_All_Events extends Ai1ec_Base {
104
  'selected' => isset( $_GET[$tax_slug] ) ? $_GET[$tax_slug] : '',
105
  'hierarchical' => $tax_obj->hierarchical,
106
  'show_count' => true,
107
- 'hide_if_empty' => true
 
108
  ));
109
  }
 
 
 
 
 
 
 
 
110
  }
111
  }
112
-
113
  /**
114
  * taxonomy_filter_post_type_request function
115
  *
@@ -117,7 +130,7 @@ class Ai1ec_View_Admin_All_Events extends Ai1ec_Base {
117
  *
118
  * @return void
119
  **/
120
- function taxonomy_filter_post_type_request( $query ) {
121
  global $pagenow, $typenow;
122
  if( 'edit.php' === $pagenow ) {
123
  $filters = get_object_taxonomies( $typenow );
@@ -125,13 +138,13 @@ class Ai1ec_View_Admin_All_Events extends Ai1ec_Base {
125
  $var = &$query->query_vars[$tax_slug];
126
  if( isset( $var ) ) {
127
  $term = null;
128
-
129
  if( is_numeric( $var ) ) {
130
  $term = get_term_by( 'id', $var, $tax_slug );
131
  } else {
132
  $term = get_term_by( 'slug', $var, $tax_slug );
133
  }
134
-
135
  if( isset( $term->slug ) ) {
136
  $var = $term->slug;
137
  }
1
  <?php
2
 
3
  class Ai1ec_View_Admin_All_Events extends Ai1ec_Base {
4
+
5
  /**
6
  * change_columns function
7
  *
30
  * @return void
31
  **/
32
  public function orderby( $orderby, $wp_query ) {
33
+
34
  $db = $this->_registry->get( 'dbi.dbi' );
35
  $aco = $this->_registry->get( 'acl.aco' );
36
+
37
  if( true === $aco->is_all_events_page() ) {
38
  $wp_query->query = wp_parse_args( $wp_query->query );
39
  $table_name = $db->get_table_name( 'ai1ec_events' );
46
  }
47
  return $orderby;
48
  }
49
+
50
  /**
51
  * custom_columns function
52
  *
66
  }
67
  }
68
  }
69
+
70
  /**
71
  * sortable_columns function
72
  *
75
  * @return void
76
  **/
77
  public function sortable_columns( $columns ) {
78
+ $columns['ai1ec_event_date'] = 'ai1ec_event_date';
79
+ $columns['author'] = 'author';
80
  return $columns;
81
  }
82
 
83
  /**
84
  * taxonomy_filter_restrict_manage_posts function
85
  *
86
+ * Adds filter dropdowns for event categories and event tags.
87
+ * Adds filter dropdowns for event authors.
88
+ *
89
+ * @uses wp_dropdown_users To create a dropdown with current user selected.
90
  *
91
  * @return void
92
  **/
93
  function taxonomy_filter_restrict_manage_posts() {
94
  global $typenow;
95
+
96
  // =============================================
97
  // = add the dropdowns only on the events page =
98
  // =============================================
108
  'selected' => isset( $_GET[$tax_slug] ) ? $_GET[$tax_slug] : '',
109
  'hierarchical' => $tax_obj->hierarchical,
110
  'show_count' => true,
111
+ 'hide_if_empty' => true,
112
+ 'value_field' => 'slug',
113
  ));
114
  }
115
+ $args = array(
116
+ 'name' => 'author',
117
+ 'show_option_all' => __( 'Show All Authors', AI1EC_PLUGIN_NAME ),
118
+ );
119
+ if ( isset( $_GET['user'] ) ) {
120
+ $args['selected'] = (int)$_GET['user'];
121
+ }
122
+ wp_dropdown_users($args);
123
  }
124
  }
125
+
126
  /**
127
  * taxonomy_filter_post_type_request function
128
  *
130
  *
131
  * @return void
132
  **/
133
+ public function taxonomy_filter_post_type_request( $query ) {
134
  global $pagenow, $typenow;
135
  if( 'edit.php' === $pagenow ) {
136
  $filters = get_object_taxonomies( $typenow );
138
  $var = &$query->query_vars[$tax_slug];
139
  if( isset( $var ) ) {
140
  $term = null;
141
+
142
  if( is_numeric( $var ) ) {
143
  $term = get_term_by( 'id', $var, $tax_slug );
144
  } else {
145
  $term = get_term_by( 'slug', $var, $tax_slug );
146
  }
147
+
148
  if( isset( $term->slug ) ) {
149
  $var = $term->slug;
150
  }
app/view/admin/get-repeat-box.php CHANGED
@@ -22,7 +22,7 @@ class Ai1ec_View_Admin_Get_repeat_Box extends Ai1ec_Base {
22
  $repeat = $repeat == 1 ? 1 : 0;
23
  $post_id = (int) $_REQUEST["post_id"];
24
  $count = 100;
25
- $end = NULL;
26
  $until = $time_system->current_time( true );
27
 
28
  // try getting the event
@@ -31,15 +31,17 @@ class Ai1ec_View_Admin_Get_repeat_Box extends Ai1ec_Base {
31
  $rule = '';
32
 
33
  if ( $repeat ) {
34
- $rule = $event->get( 'recurrence_rules' ) ?
35
- '' :
36
- $event->get( 'recurrence_rules' );
37
  } else {
38
  $rule = $event->get( 'exception_rules' ) ?
39
- '' :
40
- $event->get( 'exception_rules' );
41
  }
42
 
 
 
43
  $rc = new SG_iCal_Recurrence(
44
  new SG_iCal_Line( 'RRULE:' . $rule )
45
  );
@@ -48,17 +50,44 @@ class Ai1ec_View_Admin_Get_repeat_Box extends Ai1ec_Base {
48
  $until = ( is_numeric( $until ) )
49
  ? $until
50
  : strtotime( $until );
 
51
  } elseif ( $count = $rc->getCount() ) {
52
  $count = ( is_numeric( $count ) ) ? $count : 100;
 
53
  }
54
- } catch( Ai1ec_Event_Not_Found_Exception $e ) { /* event wasn't found, keep defaults */ }
 
 
 
 
 
55
 
56
  $args = array(
57
- 'row_daily' => $this->row_daily(),
58
- 'row_weekly' => $this->row_weekly(),
59
- 'row_monthly' => $this->row_monthly(),
60
- 'row_yearly' => $this->row_yearly(),
61
- 'row_custom' => $this->row_custom(),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  'count' => $this->create_count_input(
63
  'ai1ec_count',
64
  $count
@@ -66,6 +95,10 @@ class Ai1ec_View_Admin_Get_repeat_Box extends Ai1ec_Base {
66
  'end' => $this->create_end_dropdown( $end ),
67
  'until' => $until,
68
  'repeat' => $repeat,
 
 
 
 
69
  );
70
  $output = array(
71
  'error' => false,
@@ -224,11 +257,12 @@ class Ai1ec_View_Admin_Get_repeat_Box extends Ai1ec_Base {
224
  *
225
  * @return void
226
  **/
227
- protected function row_custom( $visible = false, $selected = 1 ) {
228
  $loader = $this->_registry->get( 'theme.loader' );
229
 
230
  $args = array(
231
- 'visible' => $visible
 
232
  );
233
  return $loader->get_file( 'row_custom.php', $args, true )
234
  ->get_content();
@@ -342,13 +376,11 @@ class Ai1ec_View_Admin_Get_repeat_Box extends Ai1ec_Base {
342
  * @return void
343
  **/
344
  protected function row_monthly(
345
- $visible = false,
346
- $count = 1,
347
- $ai1ec_monthly_each = 0,
348
- $ai1ec_monthly_on_the = 0,
349
- $month = array(),
350
- $first = false,
351
- $second = false
352
  ) {
353
  global $wp_locale;
354
  $start_of_week = $this->_registry->get( 'model.option' )
@@ -380,6 +412,11 @@ class Ai1ec_View_Admin_Get_repeat_Box extends Ai1ec_Base {
380
  }
381
  $options_dn['-1'] = Ai1ec_I18n::__( 'last' );
382
 
 
 
 
 
 
383
  $args = array(
384
  'visible' => $visible,
385
  'count' => $this->create_count_input(
@@ -387,23 +424,23 @@ class Ai1ec_View_Admin_Get_repeat_Box extends Ai1ec_Base {
387
  $count,
388
  12
389
  ) . Ai1ec_I18n::__( 'month(s)' ),
390
- 'ai1ec_monthly_each' => $ai1ec_monthly_each,
391
- 'ai1ec_monthly_on_the' => $ai1ec_monthly_on_the,
392
  'month' => $this->create_monthly_date_select(
393
  $month
394
  ),
395
- 'on_the_select' => $this->create_on_the_select(
396
- $first,
397
- $second
398
- ),
399
  'day_nums' => $this->create_select_element(
400
  'ai1ec_monthly_byday_num',
401
- $options_dn
 
402
  ),
403
  'week_days' => $this->create_select_element(
404
  'ai1ec_monthly_byday_weekday',
405
- $options_wd
 
406
  ),
 
 
 
 
407
  );
408
  return $loader->get_file( 'row_monthly.php', $args, true )
409
  ->get_content();
@@ -563,4 +600,71 @@ class Ai1ec_View_Admin_Get_repeat_Box extends Ai1ec_Base {
563
  $selected
564
  );
565
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
566
  }
22
  $repeat = $repeat == 1 ? 1 : 0;
23
  $post_id = (int) $_REQUEST["post_id"];
24
  $count = 100;
25
+ $end = 0;
26
  $until = $time_system->current_time( true );
27
 
28
  // try getting the event
31
  $rule = '';
32
 
33
  if ( $repeat ) {
34
+ $rule = $event->get( 'recurrence_rules' )
35
+ ? $event->get( 'recurrence_rules' )
36
+ : '';
37
  } else {
38
  $rule = $event->get( 'exception_rules' ) ?
39
+ $event->get( 'exception_rules' )
40
+ : '';
41
  }
42
 
43
+ $rule = $this->_registry->get( 'recurrence.rule' )->filter_rule( $rule );
44
+
45
  $rc = new SG_iCal_Recurrence(
46
  new SG_iCal_Line( 'RRULE:' . $rule )
47
  );
50
  $until = ( is_numeric( $until ) )
51
  ? $until
52
  : strtotime( $until );
53
+ $end = 2;
54
  } elseif ( $count = $rc->getCount() ) {
55
  $count = ( is_numeric( $count ) ) ? $count : 100;
56
+ $end = 1;
57
  }
58
+ } catch( Ai1ec_Event_Not_Found_Exception $e ) {
59
+ $rule = '';
60
+ $rc = new SG_iCal_Recurrence(
61
+ new SG_iCal_Line( 'RRULE:' )
62
+ );
63
+ }
64
 
65
  $args = array(
66
+ 'row_daily' => $this->row_daily(
67
+ false,
68
+ $rc->getInterval() ? $rc->getInterval() : 1
69
+ ),
70
+ 'row_weekly' => $this->row_weekly(
71
+ false,
72
+ $rc->getInterval() ? $rc->getInterval() : 1,
73
+ is_array( $rc->getByDay() ) ? $rc->getByDay() : array()
74
+ ),
75
+ 'row_monthly' => $this->row_monthly(
76
+ false,
77
+ $rc->getInterval() ? $rc->getInterval() : 1,
78
+ ! $this->_is_monthday_empty( $rc ),
79
+ $rc->getByMonthDay() ? $rc->getByMonthDay() : array(),
80
+ $rc->getByDay() ? $rc->getByDay() : array()
81
+ ),
82
+ 'row_yearly' => $this->row_yearly(
83
+ false,
84
+ $rc->getInterval() ? $rc->getInterval() : 1,
85
+ is_array( $rc->getByMonth() ) ? $rc->getByMonth() : array()
86
+ ),
87
+ 'row_custom' => $this->row_custom(
88
+ false,
89
+ $this->get_date_array_from_rule( $rule )
90
+ ),
91
  'count' => $this->create_count_input(
92
  'ai1ec_count',
93
  $count
95
  'end' => $this->create_end_dropdown( $end ),
96
  'until' => $until,
97
  'repeat' => $repeat,
98
+ 'ending_type' => $end,
99
+ 'selected_tab' => $rc->getFreq()
100
+ ? strtolower( $rc->getFreq() )
101
+ : 'custom',
102
  );
103
  $output = array(
104
  'error' => false,
257
  *
258
  * @return void
259
  **/
260
+ protected function row_custom( $visible = false, $dates = array() ) {
261
  $loader = $this->_registry->get( 'theme.loader' );
262
 
263
  $args = array(
264
+ 'visible' => $visible,
265
+ 'selected_dates' => implode( ',', $dates )
266
  );
267
  return $loader->get_file( 'row_custom.php', $args, true )
268
  ->get_content();
376
  * @return void
377
  **/
378
  protected function row_monthly(
379
+ $visible = false,
380
+ $count = 1,
381
+ $bymonthday = true,
382
+ $month = array(),
383
+ $day = array()
 
 
384
  ) {
385
  global $wp_locale;
386
  $start_of_week = $this->_registry->get( 'model.option' )
412
  }
413
  $options_dn['-1'] = Ai1ec_I18n::__( 'last' );
414
 
415
+ $byday_checked = $bymonthday ? '' : 'checked';
416
+ $byday_expanded = $bymonthday ? 'ai1ec-collapse' : 'ai1ec-in';
417
+ $bymonthday_checked = $bymonthday ? 'checked' : '';
418
+ $bymonthday_expanded = $bymonthday ? 'ai1ec-in' : 'ai1ec-collapse';
419
+
420
  $args = array(
421
  'visible' => $visible,
422
  'count' => $this->create_count_input(
424
  $count,
425
  12
426
  ) . Ai1ec_I18n::__( 'month(s)' ),
 
 
427
  'month' => $this->create_monthly_date_select(
428
  $month
429
  ),
 
 
 
 
430
  'day_nums' => $this->create_select_element(
431
  'ai1ec_monthly_byday_num',
432
+ $options_dn,
433
+ $this->_get_day_number_from_byday( $day )
434
  ),
435
  'week_days' => $this->create_select_element(
436
  'ai1ec_monthly_byday_weekday',
437
+ $options_wd,
438
+ $this->_get_day_shortname_from_byday( $day )
439
  ),
440
+ 'bymonthday_checked' => $bymonthday_checked,
441
+ 'byday_checked' => $byday_checked,
442
+ 'bymonthday_expanded' => $bymonthday_expanded,
443
+ 'byday_expanded' => $byday_expanded,
444
  );
445
  return $loader->get_file( 'row_monthly.php', $args, true )
446
  ->get_content();
600
  $selected
601
  );
602
  }
603
+
604
+ /**
605
+ * Converts recurrence rule to array of string of dates.
606
+ *
607
+ * @param string $rule RUle.
608
+ *
609
+ * @return array Array of dates or empty array.
610
+ * @throws Ai1ec_Bootstrap_Exception
611
+ */
612
+ protected function get_date_array_from_rule( $rule ) {
613
+ if (
614
+ 'RDATE' !== substr( $rule, 0, 5 ) &&
615
+ 'EXDATE' !== substr( $rule, 0, 6 )
616
+ ) {
617
+ return array();
618
+ }
619
+ $line = new SG_iCal_Line( 'RRULE:' . $rule );
620
+ $dates = $line->getDataAsArray();
621
+ $dates_as_strings = array();
622
+ foreach ( $dates as $date ) {
623
+ $date = str_replace( array( 'RDATE=', 'EXDATE=' ), '', $date );
624
+ $date = $this->_registry->get( 'date.time', $date );
625
+ $dates_as_strings[] = $date->format('m/d/Y');
626
+ }
627
+ return $dates_as_strings;
628
+ }
629
+
630
+ /**
631
+ * Returns whether recurrence rule has non null ByMonthDay.
632
+ *
633
+ * @param SG_iCal_Recurrence $rc iCal class.
634
+ *
635
+ * @return bool True or false.
636
+ */
637
+ protected function _is_monthday_empty( SG_iCal_Recurrence $rc ) {
638
+ return false === $rc->getByMonthDay();
639
+ }
640
+
641
+ /**
642
+ * Returns day number from by day array.
643
+ *
644
+ * @param array $day
645
+ *
646
+ * @return bool|int Day of false if empty array.
647
+ */
648
+ protected function _get_day_number_from_byday( array $day ) {
649
+ return isset( $day[0] ) ? (int) $day[0] : false;
650
+ }
651
+
652
+ /**
653
+ * Returns string part from "ByDay" recurrence rule.
654
+ *
655
+ * @param array $day Element to parse.
656
+ *
657
+ * @return bool|string False if empty or not matched, otherwise short day
658
+ * name.
659
+ */
660
+ protected function _get_day_shortname_from_byday( $day ) {
661
+ if ( empty( $day ) ) {
662
+ return false;
663
+ }
664
+ $value = $day[0];
665
+ if ( preg_match('/[-]?\d([A-Z]+)/', $value, $matches ) ) {
666
+ return $matches[1];
667
+ }
668
+ return false;
669
+ }
670
  }
app/view/admin/nav.php CHANGED
@@ -23,6 +23,13 @@ class Ai1ec_View_Admin_Navigation extends Ai1ec_Base {
23
  ai1ec_admin_url( AI1EC_SETTINGS_BASE_URL )
24
  );
25
  array_unshift( $links, $settings_link );
 
 
 
 
 
 
 
26
  return $links;
27
  }
28
 
23
  ai1ec_admin_url( AI1EC_SETTINGS_BASE_URL )
24
  );
25
  array_unshift( $links, $settings_link );
26
+ if ( current_user_can( 'activate_plugins' ) ) {
27
+ $updates_link = sprintf(
28
+ Ai1ec_I18n::__( '<a href="%s">Check for updates</a>' ),
29
+ ai1ec_admin_url( AI1EC_FORCE_UPDATES_URL )
30
+ );
31
+ array_push( $links, $updates_link );
32
+ }
33
  return $links;
34
  }
35
 
app/view/calendar/page.php CHANGED
@@ -56,8 +56,7 @@ class Ai1ec_Calendar_Page extends Ai1ec_Base {
56
  ) .
57
  '</p></div></div>';
58
  }
59
- $type = $request->get( 'request_type' );
60
-
61
  $is_json = $this->_registry->get( 'http.request' )->is_json_required(
62
  $view_args['request_format'], $action
63
  );
@@ -125,9 +124,7 @@ class Ai1ec_Calendar_Page extends Ai1ec_Base {
125
  );
126
 
127
  if (
128
- ( $view_args['no_navigation'] || $type !== 'html' ) &&
129
- 'jsonp' !== $type &&
130
- $is_json
131
  ) {
132
 
133
  // send data both for json and jsonp as shortcodes are jsonp
@@ -163,6 +160,11 @@ class Ai1ec_Calendar_Page extends Ai1ec_Base {
163
  $type,
164
  $caller
165
  ),
 
 
 
 
 
166
  'show_dropdowns' => apply_filters(
167
  'ai1ec_show_dropdowns',
168
  true
@@ -210,6 +212,14 @@ class Ai1ec_Calendar_Page extends Ai1ec_Base {
210
  'ai1ec_inline_js_calendar',
211
  ''
212
  ),
 
 
 
 
 
 
 
 
213
  );
214
 
215
  $calendar = $loader->get_file( 'calendar.twig', $calendar_args, false );
@@ -471,6 +481,7 @@ class Ai1ec_Calendar_Page extends Ai1ec_Base {
471
  'cat_ids',
472
  'tag_ids',
473
  'events_limit',
 
474
  )
475
  )
476
  );
56
  ) .
57
  '</p></div></div>';
58
  }
59
+ $type = $request->get( 'request_type' );
 
60
  $is_json = $this->_registry->get( 'http.request' )->is_json_required(
61
  $view_args['request_format'], $action
62
  );
124
  );
125
 
126
  if (
127
+ ( $view_args['no_navigation'] || $type !== 'html' ) && $is_json
 
 
128
  ) {
129
 
130
  // send data both for json and jsonp as shortcodes are jsonp
160
  $type,
161
  $caller
162
  ),
163
+ 'additional_buttons' => apply_filters(
164
+ 'ai1ec_additional_buttons',
165
+ '',
166
+ $view_args
167
+ ),
168
  'show_dropdowns' => apply_filters(
169
  'ai1ec_show_dropdowns',
170
  true
212
  'ai1ec_inline_js_calendar',
213
  ''
214
  ),
215
+ 'after_view' => apply_filters(
216
+ 'ai1ec_after_view',
217
+ ''
218
+ ),
219
+ 'ai1ec_above_calendar' => apply_filters(
220
+ 'ai1ec_above_calendar',
221
+ ''
222
+ ),
223
  );
224
 
225
  $calendar = $loader->get_file( 'calendar.twig', $calendar_args, false );
481
  'cat_ids',
482
  'tag_ids',
483
  'events_limit',
484
+ 'instance_ids',
485
  )
486
  )
487
  );
app/view/calendar/view/abstract.php CHANGED
@@ -65,6 +65,10 @@ abstract class Ai1ec_Calendar_View_Abstract extends Ai1ec_Base {
65
  * @return array The template arguments with the extra parameters added.
66
  */
67
  public function get_extra_template_arguments( array $args ) {
 
 
 
 
68
  return $args;
69
  }
70
 
@@ -174,8 +178,14 @@ abstract class Ai1ec_Calendar_View_Abstract extends Ai1ec_Base {
174
  * @return string
175
  */
176
  protected function _get_navigation( array $nav_args ) {
177
- $loader = $this->_registry->get( 'theme.loader' );
178
- $navigation = '';
 
 
 
 
 
 
179
  if ( true !== $nav_args['no_navigation'] ) {
180
  $navigation = $loader->get_file(
181
  'navigation.twig',
65
  * @return array The template arguments with the extra parameters added.
66
  */
67
  public function get_extra_template_arguments( array $args ) {
68
+ $args['action_buttons'] = apply_filters(
69
+ 'ai1ec_action_buttons',
70
+ ''
71
+ );
72
  return $args;
73
  }
74
 
178
  * @return string
179
  */
180
  protected function _get_navigation( array $nav_args ) {
181
+ $navigation = '';
182
+ $loader = $this->_registry->get( 'theme.loader' );
183
+ $nav_args['contribution_buttons'] = apply_filters(
184
+ 'ai1ec_contribution_buttons',
185
+ '',
186
+ 'html',
187
+ 'render-command'
188
+ );
189
  if ( true !== $nav_args['no_navigation'] ) {
190
  $navigation = $loader->get_file(
191
  'navigation.twig',
app/view/calendar/view/agenda.php CHANGED
@@ -34,6 +34,10 @@ class Ai1ec_Calendar_View_Agenda extends Ai1ec_Calendar_View_Abstract {
34
  $events_limit = is_numeric( $view_args['events_limit'] )
35
  ? $view_args['events_limit']
36
  : $settings->get( $per_page_setting );
 
 
 
 
37
  $results = $search->get_events_relative_to(
38
  $timestamp,
39
  $events_limit,
@@ -41,14 +45,19 @@ class Ai1ec_Calendar_View_Agenda extends Ai1ec_Calendar_View_Abstract {
41
  apply_filters(
42
  'ai1ec_get_events_relative_to_filter',
43
  array(
44
- 'post_ids' => $view_args['post_ids'],
45
- 'auth_ids' => $view_args['auth_ids'],
46
- 'cat_ids' => $view_args['cat_ids'],
47
- 'tag_ids' => $view_args['tag_ids'],
 
48
  ),
49
  $view_args
50
  ),
51
- $view_args['time_limit']
 
 
 
 
52
  );
53
  $this->_update_meta( $results['events'] );
54
  $dates = $this->get_agenda_like_date_array(
@@ -79,8 +88,9 @@ class Ai1ec_Calendar_View_Agenda extends Ai1ec_Calendar_View_Abstract {
79
  }
80
 
81
  // Create navigation bar if requested.
82
- $navigation = '';
83
- $loader = $this->_registry->get( 'theme.loader' );
 
84
  if ( ! $view_args['no_navigation'] ) {
85
  $pagination_links = $this->_get_agenda_like_pagination_links(
86
  $view_args,
@@ -246,13 +256,23 @@ class Ai1ec_Calendar_View_Agenda extends Ai1ec_Calendar_View_Abstract {
246
  $event_props['post_excerpt'] = $event->get_runtime( 'post_excerpt' );
247
  $event_props['short_start_time'] = $event->get_runtime( 'short_start_time' );
248
  $event_props['is_allday'] = $event->is_allday();
 
 
 
 
 
 
 
249
  $event_props['timespan_short'] = $event->_registry->
250
  get( 'view.event.time' )->get_timespan_html( $event, 'short' );
251
  $event_props['avatar'] = $event->getavatar();
252
  $event_props['avatar_not_wrapped'] = $event->getavatar( false );
253
  $event_props['avatar_url'] = $this->_registry
254
  ->get( 'view.event.avatar' )->get_event_avatar_url( $event );
255
- $event_object = $event_props;
 
 
 
256
  if (
257
  $this->_compatibility->use_backward_compatibility()
258
  ) {
34
  $events_limit = is_numeric( $view_args['events_limit'] )
35
  ? $view_args['events_limit']
36
  : $settings->get( $per_page_setting );
37
+ $events_limit = apply_filters(
38
+ 'ai1ec_events_limit',
39
+ $events_limit
40
+ );
41
  $results = $search->get_events_relative_to(
42
  $timestamp,
43
  $events_limit,
45
  apply_filters(
46
  'ai1ec_get_events_relative_to_filter',
47
  array(
48
+ 'post_ids' => $view_args['post_ids'],
49
+ 'auth_ids' => $view_args['auth_ids'],
50
+ 'cat_ids' => $view_args['cat_ids'],
51
+ 'tag_ids' => $view_args['tag_ids'],
52
+ 'instance_ids' => $view_args['instance_ids'],
53
  ),
54
  $view_args
55
  ),
56
+ $view_args['time_limit'],
57
+ apply_filters(
58
+ 'ai1ec_show_unique_events',
59
+ false
60
+ )
61
  );
62
  $this->_update_meta( $results['events'] );
63
  $dates = $this->get_agenda_like_date_array(
88
  }
89
 
90
  // Create navigation bar if requested.
91
+ $navigation = '';
92
+ $loader = $this->_registry->get( 'theme.loader' );
93
+ $pagination_links = '';
94
  if ( ! $view_args['no_navigation'] ) {
95
  $pagination_links = $this->_get_agenda_like_pagination_links(
96
  $view_args,
256
  $event_props['post_excerpt'] = $event->get_runtime( 'post_excerpt' );
257
  $event_props['short_start_time'] = $event->get_runtime( 'short_start_time' );
258
  $event_props['is_allday'] = $event->is_allday();
259
+ $event_props['is_multiday'] = $event->is_multiday();
260
+ $event_props['enddate_info'] = array(
261
+ 'month' => $event->get( 'end' )->format( 'M' ),
262
+ 'day' => $event->get( 'end' )->format( 'j' ),
263
+ 'weekday' => $event->get( 'end' )->format( 'D' ),
264
+ 'year' => $event->get( 'end' )->format( 'Y' ),
265
+ );
266
  $event_props['timespan_short'] = $event->_registry->
267
  get( 'view.event.time' )->get_timespan_html( $event, 'short' );
268
  $event_props['avatar'] = $event->getavatar();
269
  $event_props['avatar_not_wrapped'] = $event->getavatar( false );
270
  $event_props['avatar_url'] = $this->_registry
271
  ->get( 'view.event.avatar' )->get_event_avatar_url( $event );
272
+ $event_props['category_divider_color'] = $event->get_runtime(
273
+ 'category_divider_color'
274
+ );
275
+ $event_object = $event_props;
276
  if (
277
  $this->_compatibility->use_backward_compatibility()
278
  ) {
app/view/calendar/view/month.php CHANGED
@@ -30,6 +30,7 @@ class Ai1ec_Calendar_View_Month extends Ai1ec_Calendar_View_Abstract {
30
  'auth_ids' => array(),
31
  'tag_ids' => array(),
32
  'post_ids' => array(),
 
33
  'exact_date' => $date_system->current_time(),
34
  );
35
  $args = wp_parse_args( $view_args, $defaults );
@@ -47,12 +48,17 @@ class Ai1ec_Calendar_View_Month extends Ai1ec_Calendar_View_Abstract {
47
  apply_filters(
48
  'ai1ec_get_events_relative_to_filter',
49
  array(
50
- 'cat_ids' => $args['cat_ids'],
51
- 'tag_ids' => $args['tag_ids'],
52
- 'post_ids' => $args['post_ids'],
53
- 'auth_ids' => $args['auth_ids'],
 
54
  ),
55
- $view_args
 
 
 
 
56
  )
57
  );
58
  $cell_array = $this->get_month_cell_array(
@@ -97,6 +103,8 @@ class Ai1ec_Calendar_View_Month extends Ai1ec_Calendar_View_Abstract {
97
  )
98
  );
99
 
 
 
100
  return
101
  $this->_registry->get( 'http.request' )->is_json_required(
102
  $args['request_format'], 'month'
@@ -173,6 +181,7 @@ class Ai1ec_Calendar_View_Month extends Ai1ec_Calendar_View_Abstract {
173
  // Align date to first of month, month offset applied.
174
 
175
  $orig_date
 
176
  ->set_date(
177
  $orig_date->format( 'Y' ),
178
  $orig_date->format( 'm' ) + $args['month_offset'],
30
  'auth_ids' => array(),
31
  'tag_ids' => array(),
32
  'post_ids' => array(),
33
+ 'instance_ids' => array(),
34
  'exact_date' => $date_system->current_time(),
35
  );
36
  $args = wp_parse_args( $view_args, $defaults );
48
  apply_filters(
49
  'ai1ec_get_events_relative_to_filter',
50
  array(
51
+ 'cat_ids' => $args['cat_ids'],
52
+ 'tag_ids' => $args['tag_ids'],
53
+ 'post_ids' => $args['post_ids'],
54
+ 'auth_ids' => $args['auth_ids'],
55
+ 'instance_ids' => $args['instance_ids'],
56
  ),
57
+ $view_args,
58
+ apply_filters(
59
+ 'ai1ec_show_unique_events',
60
+ false
61
+ )
62
  )
63
  );
64
  $cell_array = $this->get_month_cell_array(
103
  )
104
  );
105
 
106
+ $view_args = $this->get_extra_template_arguments( $view_args );
107
+
108
  return
109
  $this->_registry->get( 'http.request' )->is_json_required(
110
  $args['request_format'], 'month'
181
  // Align date to first of month, month offset applied.
182
 
183
  $orig_date
184
+ ->set_timezone('UTC')
185
  ->set_date(
186
  $orig_date->format( 'Y' ),
187
  $orig_date->format( 'm' ) + $args['month_offset'],
app/view/calendar/view/oneday.php CHANGED
@@ -30,10 +30,10 @@ class Ai1ec_Calendar_View_Oneday extends Ai1ec_Calendar_View_Abstract {
30
  'tag_ids' => array(),
31
  'auth_ids' => array(),
32
  'post_ids' => array(),
 
33
  'exact_date' => $date_system->current_time(),
34
  );
35
  $args = wp_parse_args( $view_args, $defaults );
36
-
37
  $local_date = $this->_registry
38
  ->get( 'date.time', $args['exact_date'], 'sys.default' )
39
  ->adjust_day( 0 + $args['oneday_offset'] )
@@ -44,12 +44,17 @@ class Ai1ec_Calendar_View_Oneday extends Ai1ec_Calendar_View_Abstract {
44
  apply_filters(
45
  'ai1ec_get_events_relative_to_filter',
46
  array(
47
- 'cat_ids' => $args['cat_ids'],
48
- 'tag_ids' => $args['tag_ids'],
49
- 'post_ids' => $args['post_ids'],
50
- 'auth_ids' => $args['auth_ids'],
 
51
  ),
52
- $view_args
 
 
 
 
53
  )
54
  );
55
  // Create pagination links.
@@ -104,6 +109,8 @@ class Ai1ec_Calendar_View_Oneday extends Ai1ec_Calendar_View_Abstract {
104
  'pagination_links' => $pagination_links,
105
  );
106
 
 
 
107
  // Add navigation if requested.
108
  $view_args['navigation'] = $this->_get_navigation(
109
  array(
@@ -207,10 +214,11 @@ class Ai1ec_Calendar_View_Oneday extends Ai1ec_Calendar_View_Abstract {
207
  *
208
  * @param int $timestamp the UNIX timestamp of the first day of the week
209
  * @param array $filter Array of filters for the events returned:
210
- * ['cat_ids'] => non-associatative array of category IDs
211
- * ['tag_ids'] => non-associatative array of tag IDs
212
- * ['post_ids'] => non-associatative array of post IDs
213
- * ['auth_ids'] => non-associatative array of author IDs
 
214
  *
215
  * @return array array of arrays as per function description
216
  */
30
  'tag_ids' => array(),
31
  'auth_ids' => array(),
32
  'post_ids' => array(),
33
+ 'instance_ids' => array(),
34
  'exact_date' => $date_system->current_time(),
35
  );
36
  $args = wp_parse_args( $view_args, $defaults );
 
37
  $local_date = $this->_registry
38
  ->get( 'date.time', $args['exact_date'], 'sys.default' )
39
  ->adjust_day( 0 + $args['oneday_offset'] )
44
  apply_filters(
45
  'ai1ec_get_events_relative_to_filter',
46
  array(
47
+ 'cat_ids' => $args['cat_ids'],
48
+ 'tag_ids' => $args['tag_ids'],
49
+ 'post_ids' => $args['post_ids'],
50
+ 'auth_ids' => $args['auth_ids'],
51
+ 'instance_ids' => $args['instance_ids'],
52
  ),
53
+ $view_args,
54
+ apply_filters(
55
+ 'ai1ec_show_unique_events',
56
+ false
57
+ )
58
  )
59
  );
60
  // Create pagination links.
109
  'pagination_links' => $pagination_links,
110
  );
111
 
112
+ $view_args = $this->get_extra_template_arguments( $view_args );
113
+
114
  // Add navigation if requested.
115
  $view_args['navigation'] = $this->_get_navigation(
116
  array(
214
  *
215
  * @param int $timestamp the UNIX timestamp of the first day of the week
216
  * @param array $filter Array of filters for the events returned:
217
+ * ['cat_ids'] => non-associatative array of category IDs
218
+ * ['tag_ids'] => non-associatative array of tag IDs
219
+ * ['post_ids'] => non-associatative array of post IDs
220
+ * ['auth_ids'] => non-associatative array of author IDs
221
+ * ['instance_ids'] => non-associatative array of event instance IDs
222
  *
223
  * @return array array of arrays as per function description
224
  */
app/view/calendar/view/week.php CHANGED
@@ -30,6 +30,7 @@ class Ai1ec_Calendar_View_Week extends Ai1ec_Calendar_View_Abstract {
30
  'tag_ids' => array(),
31
  'auth_ids' => array(),
32
  'post_ids' => array(),
 
33
  'exact_date' => $date_system->current_time(),
34
  );
35
  $args = wp_parse_args( $view_args, $defaults );
@@ -47,12 +48,17 @@ class Ai1ec_Calendar_View_Week extends Ai1ec_Calendar_View_Abstract {
47
  apply_filters(
48
  'ai1ec_get_events_relative_to_filter',
49
  array(
50
- 'cat_ids' => $args['cat_ids'],
51
- 'tag_ids' => $args['tag_ids'],
52
- 'post_ids' => $args['post_ids'],
53
- 'auth_ids' => $args['auth_ids'],
 
54
  ),
55
- $view_args
 
 
 
 
56
  )
57
  );
58
 
@@ -131,6 +137,8 @@ class Ai1ec_Calendar_View_Week extends Ai1ec_Calendar_View_Abstract {
131
  )
132
  );
133
 
 
 
134
  return
135
  $this->_registry->get( 'http.request' )->is_json_required(
136
  $args['request_format'], 'week'
30
  'tag_ids' => array(),
31
  'auth_ids' => array(),
32
  'post_ids' => array(),
33
+ 'instance_ids' => array(),
34
  'exact_date' => $date_system->current_time(),
35
  );
36
  $args = wp_parse_args( $view_args, $defaults );
48
  apply_filters(
49
  'ai1ec_get_events_relative_to_filter',
50
  array(
51
+ 'cat_ids' => $args['cat_ids'],
52
+ 'tag_ids' => $args['tag_ids'],
53
+ 'post_ids' => $args['post_ids'],
54
+ 'auth_ids' => $args['auth_ids'],
55
+ 'instance_ids' => $args['instance_ids'],
56
  ),
57
+ $view_args,
58
+ apply_filters(
59
+ 'ai1ec_show_unique_events',
60
+ false
61
+ )
62
  )
63
  );
64
 
137
  )
138
  );
139
 
140
+ $view_args = $this->get_extra_template_arguments( $view_args );
141
+
142
  return
143
  $this->_registry->get( 'http.request' )->is_json_required(
144
  $args['request_format'], 'week'
app/view/event/content.php CHANGED
@@ -157,6 +157,13 @@ HTML;
157
  return null;
158
  }
159
 
 
 
 
 
 
 
 
160
  $url = $matches[2];
161
  $size = array( 0, 0 );
162
 
157
  return null;
158
  }
159
 
160
+ // Mark found image.
161
+ $event->get( 'post' )->post_content = str_replace(
162
+ '<img' . $matches[1],
163
+ '<img' . $matches[1] . ' data-ai1ec-hidden ',
164
+ $event->get( 'post' )->post_content
165
+ );
166
+
167
  $url = $matches[2];
168
  $size = array( 0, 0 );
169
 
app/view/event/single.php CHANGED
@@ -129,6 +129,7 @@ class Ai1ec_View_Event_Single extends Ai1ec_Base {
129
  'start' => $event->get( 'start' ),
130
  'end' => $event->get( 'end' ),
131
  'cost' => $event->get( 'cost' ),
 
132
  );
133
 
134
  if (
129
  'start' => $event->get( 'start' ),
130
  'end' => $event->get( 'end' ),
131
  'cost' => $event->get( 'cost' ),
132
+ 'instance_id' => $event->get( 'instance_id' ),
133
  );
134
 
135
  if (
app/view/event/taxonomy.php CHANGED
@@ -154,12 +154,32 @@ class Ai1ec_View_Event_Taxonomy extends Ai1ec_Base {
154
  return $color;
155
  }
156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  /**
158
  * Style attribute for event text color.
159
  *
160
  * @param Ai1ec_Event $event Event object.
161
  *
162
- * @return string Color to assign to event text (foreground).
163
  */
164
  public function get_category_text_color( Ai1ec_Event $event ) {
165
  $color = $this->get_color_for_event( $event );
@@ -178,7 +198,8 @@ class Ai1ec_View_Event_Taxonomy extends Ai1ec_Base {
178
  * Caches color for event having the given post ID.
179
  *
180
  * @param int $post_id Event's post ID.
181
- * @return string Color associated with event.
 
182
  */
183
  public function get_color_for_event( $event ) {
184
  $post_id = $event->get( 'post_id' );
154
  return $color;
155
  }
156
 
157
+ /**
158
+ * Style attribute for event multi-date divider color.
159
+ *
160
+ * @param Ai1ec_Event $event Event object.
161
+ *
162
+ * @return string Color to assign to event background.
163
+ */
164
+ public function get_category_divider_color( Ai1ec_Event $event ) {
165
+ $color = $this->get_color_for_event( $event );
166
+
167
+ // Convert to HTML attribute.
168
+ if ( $color ) {
169
+ $color = 'style="border-color: ' . $color . ' transparent transparent transparent;"';
170
+ } else {
171
+ $color = '';
172
+ }
173
+
174
+ return $color;
175
+ }
176
+
177
  /**
178
  * Style attribute for event text color.
179
  *
180
  * @param Ai1ec_Event $event Event object.
181
  *
182
+ * @return string Color to assign to event text (foreground).
183
  */
184
  public function get_category_text_color( Ai1ec_Event $event ) {
185
  $color = $this->get_color_for_event( $event );
198
  * Caches color for event having the given post ID.
199
  *
200
  * @param int $post_id Event's post ID.
201
+ *
202
+ * @return string Color associated with event.
203
  */
204
  public function get_color_for_event( $event ) {
205
  $post_id = $event->get( 'post_id' );
language/all-in-one-event-calendar.mo CHANGED
Binary file
language/all-in-one-event-calendar.po CHANGED
@@ -2,29 +2,21 @@
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.2.1\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
- "POT-Creation-Date: 2015-03-25 15:07:54+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: 2015-03-25 16:07+0100\n"
12
  "Last-Translator: Timely <support@time.ly>\n"
13
  "Language-Team:\n"
14
 
15
- #: app/controller/extension-license.php:54 app/view/admin/add-ons.php:26
16
  #: app/view/admin/add-ons.php:27
17
  msgid "Add-ons"
18
  msgstr "Add-ons"
19
 
20
- #: app/controller/extension-license.php:56
21
- msgid "Licenses"
22
- msgstr "Licenses"
23
-
24
- #: app/controller/extension-license.php:60
25
- msgid "Licences"
26
- msgstr "Licences"
27
-
28
  #: app/controller/front.php:343
29
  msgid ""
30
  "Your active calendar theme could not be properly initialized. The default "
@@ -40,7 +32,7 @@ msgstr ""
40
  msgid "Calendar Themes"
41
  msgstr "Calendar Themes"
42
 
43
- #: app/controller/front.php:920
44
  msgid ""
45
  "Your database is found to be corrupt. Likely previous update has failed. "
46
  "Please restore All-in-One Event Calendar tables from a backup and retry."
@@ -54,33 +46,33 @@ msgstr ""
54
  msgid "You must choose the Calendar page before using the Super Widget"
55
  msgstr "You must choose the Calendar page before using the Super Widget"
56
 
57
- #: app/controller/javascript.php:386
58
  msgid "This feed is already being imported."
59
  msgstr "This feed is already being imported."
60
 
61
- #: app/controller/javascript.php:389
62
  msgid "Please enter a valid iCalendar URL."
63
  msgstr "Please enter a valid iCalendar URL."
64
 
65
- #: app/controller/javascript.php:392
66
  msgid "Please enter a valid email address."
67
  msgstr "Please enter a valid email address."
68
 
69
- #: app/controller/javascript.php:394
70
  msgid "Choose Image"
71
  msgstr "Choose Image"
72
 
73
- #: app/controller/javascript.php:397
74
  msgid "The value you have entered is not a valid CSS length."
75
  msgstr "The value you have entered is not a valid CSS length."
76
 
77
- #: app/controller/javascript.php:400
78
  msgid ""
79
  "Are you sure you want to reset your theme options to their default values?"
80
  msgstr ""
81
  "Are you sure you want to reset your theme options to their default values?"
82
 
83
- #: app/controller/javascript.php:403
84
  msgid ""
85
  "Please enter a valid latitude. A valid latitude is comprised between +90 and "
86
  "-90."
@@ -88,7 +80,7 @@ msgstr ""
88
  "Please enter a valid latitude. A valid latitude is comprised between +90 and "
89
  "-90."
90
 
91
- #: app/controller/javascript.php:406
92
  msgid ""
93
  "Please enter a valid longitude. A valid longitude is comprised between +180 "
94
  "and -180."
@@ -96,7 +88,7 @@ msgstr ""
96
  "Please enter a valid longitude. A valid longitude is comprised between +180 "
97
  "and -180."
98
 
99
- #: app/controller/javascript.php:409
100
  msgid ""
101
  "When the \"Input coordinates\" checkbox is checked, \"Latitude\" is a "
102
  "required field."
@@ -104,7 +96,7 @@ msgstr ""
104
  "When the \"Input coordinates\" checkbox is checked, \"Latitude\" is a "
105
  "required field."
106
 
107
- #: app/controller/javascript.php:412
108
  msgid ""
109
  "When the \"Input coordinates\" checkbox is checked, \"Longitude\" is a "
110
  "required field."
@@ -112,15 +104,15 @@ msgstr ""
112
  "When the \"Input coordinates\" checkbox is checked, \"Longitude\" is a "
113
  "required field."
114
 
115
- #: app/controller/javascript.php:415
116
  msgid ""
117
  "The URL you have entered in the <b>Organizer Contact Info</b> &gt; "
118
- "<b>External URL</b> seems to be invalid."
119
  msgstr ""
120
  "The URL you have entered in the <b>Organizer Contact Info</b> &gt; "
121
- "<b>External URL</b> seems to be invalid."
122
 
123
- #: app/controller/javascript.php:418
124
  msgid ""
125
  "The URL you have entered in the <b>Event Cost and Tickets</b> &gt; <b>Buy "
126
  "Tickets URL</b> seems to be invalid."
@@ -128,21 +120,21 @@ msgstr ""
128
  "The URL you have entered in the <b>Event Cost and Tickets</b> &gt; <b>Buy "
129
  "Tickets URL</b> seems to be invalid."
130
 
131
- #: app/controller/javascript.php:421
132
  msgid ""
133
  "Please remember that URLs must start with either \"http://\" or \"https://\"."
134
  msgstr ""
135
  "Please remember that URLs must start with either \"http://\" or \"https://\"."
136
 
137
- #: app/controller/javascript.php:424
138
  msgid "Loading&hellip;"
139
  msgstr "Loading&hellip;"
140
 
141
- #: app/controller/javascript.php:454 app/view/admin/widget-creator.php:139
142
  msgid "Preview:"
143
  msgstr "Preview:"
144
 
145
- #: app/controller/javascript.php:455
146
  msgid ""
147
  "Loading preview&nbsp;<i class=\"ai1ec-fa ai1ec-fa-spin ai1ec-fa-spinner\"></"
148
  "i>"
@@ -150,7 +142,7 @@ msgstr ""
150
  "Loading preview&nbsp;<i class=\"ai1ec-fa ai1ec-fa-spin ai1ec-fa-spinner\"></"
151
  "i>"
152
 
153
- #: app/controller/javascript.php:459
154
  msgid ""
155
  "Something went wrong while fetching events.<br>The request status is: %STATUS"
156
  "% <br>The error thrown was: %ERROR%"
@@ -158,11 +150,11 @@ msgstr ""
158
  "Something went wrong while fetching events.<br>The request status is: %STATUS"
159
  "% <br>The error thrown was: %ERROR%"
160
 
161
- #: app/controller/javascript.php:466
162
  msgid "The end date can't be earlier than the start date."
163
  msgstr "The end date can't be earlier than the start date."
164
 
165
- #: app/controller/javascript.php:467
166
  msgid "For week and day view, you must select an interval of at least 6 hours."
167
  msgstr ""
168
  "For week and day view, you must select an interval of at least 6 hours."
@@ -175,52 +167,52 @@ msgstr "Edit &#8220;%s&#8221;"
175
  msgid "Base Event"
176
  msgstr "Base Event"
177
 
178
- #: app/model/settings.php:380
179
  #: lib/html/element/setting/calendar-page-selector.php:50
180
  msgid "Calendar page"
181
  msgstr "Calendar page"
182
 
183
- #: app/model/settings.php:390
184
  msgid "Week starts on"
185
  msgstr "Week starts on"
186
 
187
- #: app/model/settings.php:403
188
  msgid "Available views"
189
  msgstr "Available views"
190
 
191
- #: app/model/settings.php:411
192
  msgid "Agenda"
193
  msgid_plural "Agenda"
194
  msgstr[0] "Agenda"
195
  msgstr[1] "Agenda"
196
 
197
- #: app/model/settings.php:422
198
  msgid "Day"
199
  msgid_plural "Day"
200
  msgstr[0] "Day"
201
  msgstr[1] "Day"
202
 
203
- #: app/model/settings.php:433
204
  msgid "Month"
205
  msgid_plural "Month"
206
  msgstr[0] "Month"
207
  msgstr[1] "Month"
208
 
209
- #: app/model/settings.php:444
210
  msgid "Week"
211
  msgid_plural "Week"
212
  msgstr[0] "Week"
213
  msgstr[1] "Week"
214
 
215
- #: app/model/settings.php:458
216
  msgid "Timezone"
217
  msgstr "Timezone"
218
 
219
- #: app/model/settings.php:471
220
  msgid "Preselected calendar filters"
221
  msgstr "Preselected calendar filters"
222
 
223
- #: app/model/settings.php:472 app/view/calendar/widget.php:128
224
  msgid ""
225
  "To clear, hold &#8984;/<abbr class=\"initialism\">CTRL</abbr> and click "
226
  "selection."
@@ -228,31 +220,31 @@ msgstr ""
228
  "To clear, hold &#8984;/<abbr class=\"initialism\">CTRL</abbr> and click "
229
  "selection."
230
 
231
- #: app/model/settings.php:487
232
  msgid "Default calendar start date (optional)"
233
  msgstr "Default calendar start date (optional)"
234
 
235
- #: app/model/settings.php:498
236
  msgid "Agenda pages show at most"
237
  msgstr "Agenda pages show at most"
238
 
239
- #: app/model/settings.php:511
240
  msgid "Week/Day view starts at"
241
  msgstr "Week/Day view starts at"
242
 
243
- #: app/model/settings.php:524
244
  msgid "Week/Day view ends at"
245
  msgstr "Week/Day view ends at"
246
 
247
- #: app/model/settings.php:537
248
  msgid "<strong>Word-wrap event stubs</strong> in Month view"
249
  msgstr "<strong>Word-wrap event stubs</strong> in Month view"
250
 
251
- #: app/model/settings.php:540
252
  msgid "Only applies to events that span a single day."
253
  msgstr "Only applies to events that span a single day."
254
 
255
- #: app/model/settings.php:552
256
  msgid ""
257
  "In <span class=\"ai1ec-tooltip-toggle\"\n"
258
  "\t\t\t\t\t\tdata-original-title=\"These include Agenda view,\n"
@@ -266,23 +258,23 @@ msgstr ""
266
  "\t\t\t\t\t\tAgenda-like views</span>, <strong>include all events\n"
267
  "\t\t\t\t\t\tfrom last day shown</strong>"
268
 
269
- #: app/model/settings.php:568
270
  msgid "Keep all events <strong>expanded</strong> in Agenda view"
271
  msgstr "Keep all events <strong>expanded</strong> in Agenda view"
272
 
273
- #: app/model/settings.php:580
274
  msgid "<strong>Show year</strong> in calendar date labels"
275
  msgstr "<strong>Show year</strong> in calendar date labels"
276
 
277
- #: app/model/settings.php:592
278
  msgid "<strong>Show location in event titles</strong> in calendar views"
279
  msgstr "<strong>Show location in event titles</strong> in calendar views"
280
 
281
- #: app/model/settings.php:604
282
  msgid "<strong>Exclude</strong> events from search results"
283
  msgstr "<strong>Exclude</strong> events from search results"
284
 
285
- #: app/model/settings.php:616
286
  msgid ""
287
  "Hide <strong>Subscribe</strong>/<strong>Add to Calendar</strong> buttons in "
288
  "calendar and single event views "
@@ -290,15 +282,15 @@ msgstr ""
290
  "Hide <strong>Subscribe</strong>/<strong>Add to Calendar</strong> buttons in "
291
  "calendar and single event views "
292
 
293
- #: app/model/settings.php:628
294
  msgid "Hide <strong>Get a Timely Calendar</strong> button"
295
  msgstr "Hide <strong>Get a Timely Calendar</strong> button"
296
 
297
- #: app/model/settings.php:640
298
  msgid " Hide <strong>Google Maps</strong> until clicked"
299
  msgstr " Hide <strong>Google Maps</strong> until clicked"
300
 
301
- #: app/model/settings.php:652
302
  msgid ""
303
  " <strong>Affix filter menu</strong> to top of window when it scrolls out of "
304
  "view"
@@ -306,69 +298,69 @@ msgstr ""
306
  " <strong>Affix filter menu</strong> to top of window when it scrolls out of "
307
  "view"
308
 
309
- #: app/model/settings.php:655
310
  msgid "Only applies to first visible calendar found on the page."
311
  msgstr "Only applies to first visible calendar found on the page."
312
 
313
- #: app/model/settings.php:667
314
  msgid "Offset affixed filter bar vertically by"
315
  msgstr "Offset affixed filter bar vertically by"
316
 
317
- #: app/model/settings.php:682
318
  msgid "Wide screens only (&#8805; 1200px)"
319
  msgstr "Wide screens only (&#8805; 1200px)"
320
 
321
- #: app/model/settings.php:697
322
  msgid "Tablets only (< 980px)"
323
  msgstr "Tablets only (< 980px)"
324
 
325
- #: app/model/settings.php:712
326
  msgid "Phones only (< 768px)"
327
  msgstr "Phones only (< 768px)"
328
 
329
- #: app/model/settings.php:725
330
  msgid "Strict compatibility content filtering"
331
  msgstr "Strict compatibility content filtering"
332
 
333
- #: app/model/settings.php:737
334
  msgid " <strong>Hide featured image</strong> from event details page"
335
  msgstr " <strong>Hide featured image</strong> from event details page"
336
 
337
- #: app/model/settings.php:740
338
  msgid ""
339
  "Select this option if your theme already displays each post's featured image."
340
  msgstr ""
341
  "Select this option if your theme already displays each post's featured image."
342
 
343
- #: app/model/settings.php:751
344
  msgid "Input dates in this format"
345
  msgstr "Input dates in this format"
346
 
347
- #: app/model/settings.php:756
348
  msgid "Default (d/m/yyyy)"
349
  msgstr "Default (d/m/yyyy)"
350
 
351
- #: app/model/settings.php:760
352
  msgid "US (m/d/yyyy)"
353
  msgstr "US (m/d/yyyy)"
354
 
355
- #: app/model/settings.php:764
356
  msgid "ISO 8601 (yyyy-m-d)"
357
  msgstr "ISO 8601 (yyyy-m-d)"
358
 
359
- #: app/model/settings.php:768
360
  msgid "Dotted (m.d.yyyy)"
361
  msgstr "Dotted (m.d.yyyy)"
362
 
363
- #: app/model/settings.php:780
364
  msgid " Use <strong>24h time</strong> in time pickers"
365
  msgstr " Use <strong>24h time</strong> in time pickers"
366
 
367
- #: app/model/settings.php:791
368
  msgid "<strong>Disable address autocomplete</strong> function"
369
  msgstr "<strong>Disable address autocomplete</strong> function"
370
 
371
- #: app/model/settings.php:802
372
  msgid ""
373
  "Use the configured <strong>region</strong> (WordPress locale) to bias the "
374
  "address autocomplete function "
@@ -376,7 +368,7 @@ msgstr ""
376
  "Use the configured <strong>region</strong> (WordPress locale) to bias the "
377
  "address autocomplete function "
378
 
379
- #: app/model/settings.php:818
380
  msgid ""
381
  " Show the old <strong>Post Your Event</strong> button above the calendar to "
382
  "privileged users"
@@ -384,7 +376,7 @@ msgstr ""
384
  " Show the old <strong>Post Your Event</strong> button above the calendar to "
385
  "privileged users"
386
 
387
- #: app/model/settings.php:821
388
  msgid ""
389
  "Install the <a target=\"_blank\" href=\"http://time.ly/\">Interactive "
390
  "Frontend Extension</a> for the <strong>frontend Post Your Event form</"
@@ -394,11 +386,11 @@ msgstr ""
394
  "Frontend Extension</a> for the <strong>frontend Post Your Event form</"
395
  "strong>."
396
 
397
- #: app/model/settings.php:842
398
  msgid "Move calendar into this DOM element"
399
  msgstr "Move calendar into this DOM element"
400
 
401
- #: app/model/settings.php:844
402
  msgid ""
403
  "Optional. Use this JavaScript-based shortcut to place the\n"
404
  "\t\t\t\t\t\tcalendar a DOM element other than the usual page content "
@@ -422,7 +414,7 @@ msgstr ""
422
  "\t\t\t\t\t\tAny existing markup found within the target will be replaced\n"
423
  "\t\t\t\t\t\tby the calendar."
424
 
425
- #: app/model/settings.php:863
426
  msgid ""
427
  "<strong>Skip <tt>in_the_loop()</tt> check </strong> that protects against "
428
  "multiple calendar output"
@@ -430,7 +422,7 @@ msgstr ""
430
  "<strong>Skip <tt>in_the_loop()</tt> check </strong> that protects against "
431
  "multiple calendar output"
432
 
433
- #: app/model/settings.php:866
434
  msgid ""
435
  "Try enabling this option if your calendar does not appear on the calendar "
436
  "page. It is needed for compatibility with a small number of themes that call "
@@ -440,11 +432,11 @@ msgstr ""
440
  "page. It is needed for compatibility with a small number of themes that call "
441
  "<tt>the_content()</tt> from outside of The Loop. Leave disabled otherwise."
442
 
443
- #: app/model/settings.php:878
444
  msgid "Disable <strong>gzip</strong> compression."
445
  msgstr "Disable <strong>gzip</strong> compression."
446
 
447
- #: app/model/settings.php:881
448
  msgid ""
449
  "Use this option if calendar is unresponsive. <a href=\"http://support.time."
450
  "ly/disable-gzip-compression/\">Read more</a> about the issue. (From version "
@@ -454,11 +446,11 @@ msgstr ""
454
  "ly/disable-gzip-compression/\">Read more</a> about the issue. (From version "
455
  "2.1 onwards, gzip is disabled by default for maximum compatibility.)"
456
 
457
- #: app/model/settings.php:893
458
  msgid "Use frontend rendering."
459
  msgstr "Use frontend rendering."
460
 
461
- #: app/model/settings.php:896
462
  msgid ""
463
  "Renders calendar views on the client rather than the server; can improve "
464
  "performance."
@@ -466,7 +458,7 @@ msgstr ""
466
  "Renders calendar views on the client rather than the server; can improve "
467
  "performance."
468
 
469
- #: app/model/settings.php:908
470
  msgid ""
471
  "<strong>Link CSS</strong> in <code>&lt;head&gt;</code> section when file "
472
  "cache is unavailable."
@@ -474,7 +466,7 @@ msgstr ""
474
  "<strong>Link CSS</strong> in <code>&lt;head&gt;</code> section when file "
475
  "cache is unavailable."
476
 
477
- #: app/model/settings.php:911
478
  msgid ""
479
  "Use this option if file cache is unavailable and you would prefer to serve "
480
  "CSS as a link rather than have it output inline."
@@ -482,11 +474,11 @@ msgstr ""
482
  "Use this option if file cache is unavailable and you would prefer to serve "
483
  "CSS as a link rather than have it output inline."
484
 
485
- #: app/model/settings.php:923
486
  msgid "Current <strong>robots.txt</strong> on this site"
487
  msgstr "Current <strong>robots.txt</strong> on this site"
488
 
489
- #: app/model/settings.php:927
490
  msgid ""
491
  "The Robot Exclusion Standard, also known as the Robots Exclusion Protocol "
492
  "or\n"
@@ -510,7 +502,7 @@ msgstr ""
510
  "\t\t\t\t\t\tYou can change it manually by editing <code>robots.txt</code> in "
511
  "your root WordPress directory."
512
 
513
- #: app/model/settings.php:944
514
  msgid ""
515
  "<strong>Publicize, promote, and share my events</strong> marked as public on "
516
  "the Timely network. (<a href=\"%s\" target=\"_blank\">Learn more &#187;</a>)"
@@ -518,15 +510,15 @@ msgstr ""
518
  "<strong>Publicize, promote, and share my events</strong> marked as public on "
519
  "the Timely network. (<a href=\"%s\" target=\"_blank\">Learn more &#187;</a>)"
520
 
521
- #: app/model/settings.php:967
522
  msgid "Templates cache improves site performance"
523
  msgstr "Templates cache improves site performance"
524
 
525
- #: app/model/settings.php:980
526
  msgid "Display events in <strong>calendar time zone</strong>"
527
  msgstr "Display events in <strong>calendar time zone</strong>"
528
 
529
- #: app/model/settings.php:983
530
  msgid ""
531
  "If this box is checked events will appear in the calendar time zone with "
532
  "time zone information displayed on the event details page."
@@ -538,15 +530,11 @@ msgstr ""
538
  msgid "Event Details"
539
  msgstr "Event Details"
540
 
541
- #: app/view/admin/add-new-event.php:47
542
- msgid "Banner Image"
543
- msgstr "Banner Image"
544
-
545
- #: app/view/admin/add-new-event.php:377
546
  msgid "Set banner image"
547
  msgstr "Set banner image"
548
 
549
- #: app/view/admin/add-new-event.php:378
550
  msgid "Remove banner image"
551
  msgstr "Remove banner image"
552
 
@@ -584,10 +572,14 @@ msgstr "Post Date"
584
  msgid "Event date/time"
585
  msgstr "Event date/time"
586
 
587
- #: app/view/admin/all-events.php:100
588
  msgid "Show All "
589
  msgstr "Show All "
590
 
 
 
 
 
591
  #: app/view/admin/calendar-feeds.php:27 app/view/admin/calendar-feeds.php:28
592
  msgid "Calendar Feeds"
593
  msgstr "Calendar Feeds"
@@ -637,104 +629,104 @@ msgstr ""
637
  "Assign an optional image to the category. Recommended size: square, minimum "
638
  "400&times;400 pixels."
639
 
640
- #: app/view/admin/get-repeat-box.php:65
641
  msgid "times"
642
  msgstr "times"
643
 
644
- #: app/view/admin/get-repeat-box.php:131
645
  msgid "Recurrence rule cannot be empty."
646
  msgstr "Recurrence rule cannot be empty."
647
 
648
- #: app/view/admin/get-repeat-box.php:149
649
  msgid "Recurrence rule was not provided."
650
  msgstr "Recurrence rule was not provided."
651
 
652
- #: app/view/admin/get-repeat-box.php:176
653
  msgid "Never"
654
  msgstr "Never"
655
 
656
- #: app/view/admin/get-repeat-box.php:177
657
  msgid "After"
658
  msgstr "After"
659
 
660
- #: app/view/admin/get-repeat-box.php:178 public/admin/box_repeat.php:93
661
  msgid "On date"
662
  msgstr "On date"
663
 
664
- #: app/view/admin/get-repeat-box.php:214
665
  msgid "day(s)"
666
  msgstr "day(s)"
667
 
668
- #: app/view/admin/get-repeat-box.php:296
669
  msgid "week(s)"
670
  msgstr "week(s)"
671
 
672
- #: app/view/admin/get-repeat-box.php:381 app/view/admin/get-repeat-box.php:448
673
- #: lib/recurrence/rule.php:279
674
  msgid "last"
675
  msgstr "last"
676
 
677
- #: app/view/admin/get-repeat-box.php:389
678
  msgid "month(s)"
679
  msgstr "month(s)"
680
 
681
- #: app/view/admin/get-repeat-box.php:443
682
  msgid "first"
683
  msgstr "first"
684
 
685
- #: app/view/admin/get-repeat-box.php:444
686
  msgid "second"
687
  msgstr "second"
688
 
689
- #: app/view/admin/get-repeat-box.php:445
690
  msgid "third"
691
  msgstr "third"
692
 
693
- #: app/view/admin/get-repeat-box.php:446
694
  msgid "fourth"
695
  msgstr "fourth"
696
 
697
- #: app/view/admin/get-repeat-box.php:458
698
  msgid "Sunday"
699
  msgstr "Sunday"
700
 
701
- #: app/view/admin/get-repeat-box.php:459
702
  msgid "Monday"
703
  msgstr "Monday"
704
 
705
- #: app/view/admin/get-repeat-box.php:460
706
  msgid "Tuesday"
707
  msgstr "Tuesday"
708
 
709
- #: app/view/admin/get-repeat-box.php:461
710
  msgid "Wednesday"
711
  msgstr "Wednesday"
712
 
713
- #: app/view/admin/get-repeat-box.php:462
714
  msgid "Thursday"
715
  msgstr "Thursday"
716
 
717
- #: app/view/admin/get-repeat-box.php:463
718
  msgid "Friday"
719
  msgstr "Friday"
720
 
721
- #: app/view/admin/get-repeat-box.php:464
722
  msgid "Saturday"
723
  msgstr "Saturday"
724
 
725
- #: app/view/admin/get-repeat-box.php:466
726
  msgid "day"
727
  msgstr "day"
728
 
729
- #: app/view/admin/get-repeat-box.php:467
730
  msgid "weekday"
731
  msgstr "weekday"
732
 
733
- #: app/view/admin/get-repeat-box.php:468
734
  msgid "weekend day"
735
  msgstr "weekend day"
736
 
737
- #: app/view/admin/get-repeat-box.php:534
738
  msgid "year(s)"
739
  msgstr "year(s)"
740
 
@@ -742,6 +734,10 @@ msgstr "year(s)"
742
  msgid "<a href=\"%s\">Settings</a>"
743
  msgstr "<a href=\"%s\">Settings</a>"
744
 
 
 
 
 
745
  #: app/view/admin/organize.php:100
746
  msgid "Organize Events"
747
  msgstr "Organize Events"
@@ -798,7 +794,6 @@ msgid "Cache Report"
798
  msgstr "Cache Report"
799
 
800
  #: app/view/admin/settings.php:170
801
- #: public/admin/plugins/ics/display_feeds.php:24
802
  msgid "Save Settings"
803
  msgstr "Save Settings"
804
 
@@ -921,7 +916,7 @@ msgstr ""
921
  "There was an error loading calendar. Please contact site administrator and "
922
  "inform him to configure calendar views."
923
 
924
- #: app/view/calendar/page.php:75
925
  msgid ""
926
  "Calendar was unable to initialize %s view and has reverted to Agenda view. "
927
  "Please check if you have installed the latest versions of calendar add-ons."
@@ -929,15 +924,15 @@ msgstr ""
929
  "Calendar was unable to initialize %s view and has reverted to Agenda view. "
930
  "Please check if you have installed the latest versions of calendar add-ons."
931
 
932
- #: app/view/calendar/page.php:258
933
  msgid "Subscribe to filtered calendar"
934
  msgstr "Subscribe to filtered calendar"
935
 
936
- #: app/view/calendar/page.php:259
937
  msgid "Subscribe"
938
  msgstr "Subscribe"
939
 
940
- #: app/view/calendar/page.php:260 app/view/event/single.php:115
941
  msgid "Get a Timely Calendar"
942
  msgstr "Get a Timely Calendar"
943
 
@@ -1003,58 +998,59 @@ msgstr "Clear tag filter"
1003
  msgid "Tags"
1004
  msgstr "Tags"
1005
 
1006
- #: app/view/calendar/view/agenda.php:119
1007
  msgid "Collapse All"
1008
  msgstr "Collapse All"
1009
 
1010
- #: app/view/calendar/view/agenda.php:120
1011
  msgid "Expand All"
1012
  msgstr "Expand All"
1013
 
1014
- #: app/view/calendar/view/agenda.php:143
1015
  msgid "There are no upcoming events to display at this time."
1016
  msgstr "There are no upcoming events to display at this time."
1017
 
1018
- #: app/view/calendar/view/agenda.php:144 app/view/calendar/widget.php:373
 
1019
  msgid "Edit"
1020
  msgstr "Edit"
1021
 
1022
- #: app/view/calendar/view/agenda.php:145
1023
  msgid "Read more"
1024
  msgstr "Read more"
1025
 
1026
- #: app/view/calendar/view/agenda.php:146
1027
  msgid "Categories:"
1028
  msgstr "Categories:"
1029
 
1030
- #: app/view/calendar/view/agenda.php:147 lib/theme/list.php:320
1031
  #: public/admin/themes.php:29
1032
  msgid "Tags:"
1033
  msgstr "Tags:"
1034
 
1035
- #: app/view/calendar/view/agenda.php:148 app/view/calendar/view/month.php:81
1036
- #: app/view/calendar/view/oneday.php:100 app/view/calendar/view/week.php:112
1037
  #: app/view/calendar/widget.php:374
1038
  msgid "@ %s"
1039
  msgstr "@ %s"
1040
 
1041
- #: app/view/calendar/view/oneday.php:74 app/view/calendar/view/week.php:67
1042
  msgid "g a"
1043
  msgstr "g a"
1044
 
1045
- #: app/view/calendar/view/oneday.php:97 app/view/calendar/view/week.php:109
1046
  msgid "Reveal full day"
1047
  msgstr "Reveal full day"
1048
 
1049
- #: app/view/calendar/view/oneday.php:98 app/view/calendar/view/week.php:110
1050
  msgid "All-day"
1051
  msgstr "All-day"
1052
 
1053
- #: app/view/calendar/view/oneday.php:99 app/view/calendar/view/week.php:111
1054
  msgid "Now:"
1055
  msgstr "Now:"
1056
 
1057
- #: app/view/calendar/view/week.php:61
1058
  msgid "Week of %s"
1059
  msgstr "Week of %s"
1060
 
@@ -1205,11 +1201,11 @@ msgstr "Contact:"
1205
  msgid "Free"
1206
  msgstr "Free"
1207
 
1208
- #: app/view/event/single.php:144
1209
  msgid "Edit this occurrence (%s)"
1210
  msgstr "Edit this occurrence (%s)"
1211
 
1212
- #: app/view/event/single.php:159
1213
  msgid ""
1214
  "This post was replicated from another site's <a href=\"%s\" title="
1215
  "\"iCalendar feed\"><i class=\"ai1ec-fa ai1ec-fa-calendar\"></i> calendar "
@@ -1219,7 +1215,7 @@ msgstr ""
1219
  "\"iCalendar feed\"><i class=\"ai1ec-fa ai1ec-fa-calendar\"></i> calendar "
1220
  "feed</a>."
1221
 
1222
- #: app/view/event/single.php:170
1223
  msgid "View original"
1224
  msgstr "View original"
1225
 
@@ -1273,7 +1269,7 @@ msgstr "ICS"
1273
  msgid "Another import process in progress. Please try again later."
1274
  msgstr "Another import process in progress. Please try again later."
1275
 
1276
- #: lib/calendar-feed/ics.php:173
1277
  msgid ""
1278
  "A system error has prevented calendar data from being fetched. Something is "
1279
  "preventing the plugin from functioning correctly. This message should "
@@ -1283,7 +1279,7 @@ msgstr ""
1283
  "preventing the plugin from functioning correctly. This message should "
1284
  "provide a clue: %s"
1285
 
1286
- #: lib/calendar-feed/ics.php:180
1287
  msgid ""
1288
  "Calendar data could not be fetched. If your URL is valid and contains an "
1289
  "iCalendar resource, this is likely the result of a temporary server error "
@@ -1293,51 +1289,47 @@ msgstr ""
1293
  "iCalendar resource, this is likely the result of a temporary server error "
1294
  "and time may resolve this issue"
1295
 
1296
- #: lib/calendar-feed/ics.php:190
1297
- msgid "No events were found"
1298
- msgstr "No events were found"
1299
-
1300
- #: lib/calendar-feed/ics.php:199
1301
  msgid "Imported %s event"
1302
  msgid_plural "Imported %s events"
1303
  msgstr[0] "Imported %s event"
1304
  msgstr[1] "Imported %s events"
1305
 
1306
- #: lib/calendar-feed/ics.php:205 lib/calendar-feed/ics.php:678
1307
  msgid "Invalid ICS feed ID"
1308
  msgstr "Invalid ICS feed ID"
1309
 
1310
- #: lib/calendar-feed/ics.php:351
1311
  msgid "Categories (optional)"
1312
  msgstr "Categories (optional)"
1313
 
1314
- #: lib/calendar-feed/ics.php:368
1315
  msgid ""
1316
  "Do you want to keep the events imported from the calendar or remove them?"
1317
  msgstr ""
1318
  "Do you want to keep the events imported from the calendar or remove them?"
1319
 
1320
- #: lib/calendar-feed/ics.php:374
1321
  msgid "Removing ICS Feed"
1322
  msgstr "Removing ICS Feed"
1323
 
1324
- #: lib/calendar-feed/ics.php:377
1325
  msgid "Keep Events"
1326
  msgstr "Keep Events"
1327
 
1328
- #: lib/calendar-feed/ics.php:380
1329
  msgid "Remove Events"
1330
  msgstr "Remove Events"
1331
 
1332
- #: lib/calendar-feed/ics.php:516
1333
  msgid "Oh, submission was not accepted."
1334
  msgstr "Oh, submission was not accepted."
1335
 
1336
- #: lib/calendar-feed/ics.php:670
1337
  msgid "Deleted %d events"
1338
  msgstr "Deleted %d events"
1339
 
1340
- #: lib/calendar-feed/ics.php:706
1341
  msgid "Feed deleted"
1342
  msgstr "Feed deleted"
1343
 
@@ -1575,11 +1567,11 @@ msgstr "Toggle error details"
1575
  msgid "Error Details:"
1576
  msgstr "Error Details:"
1577
 
1578
- #: lib/factory/html.php:128
1579
  msgid "Choose a date using calendar"
1580
  msgstr "Choose a date using calendar"
1581
 
1582
- #: lib/factory/html.php:273
1583
  msgid "Tags (optional)"
1584
  msgstr "Tags (optional)"
1585
 
@@ -1866,7 +1858,7 @@ msgctxt "Event feed taxonomy (singular)"
1866
  msgid "Event Feed"
1867
  msgstr "Event Feed"
1868
 
1869
- #: lib/post/custom-type.php:279
1870
  msgid ""
1871
  "All Events <span class=\"update-plugins count-%d\" title=\"%d Pending Events"
1872
  "\"><span class=\"update-count\">%d</span></span>"
@@ -1874,96 +1866,96 @@ msgstr ""
1874
  "All Events <span class=\"update-plugins count-%d\" title=\"%d Pending Events"
1875
  "\"><span class=\"update-count\">%d</span></span>"
1876
 
1877
- #: lib/post/custom-type.php:290
1878
  msgid "All Events"
1879
  msgstr "All Events"
1880
 
1881
- #: lib/recurrence/rule.php:225 lib/recurrence/rule.php:234
1882
- #: lib/recurrence/rule.php:242
1883
  msgctxt "Recurrence editor - weekly tab"
1884
  msgid "on"
1885
  msgstr "on"
1886
 
1887
- #: lib/recurrence/rule.php:230 lib/recurrence/rule.php:259
1888
- #: lib/recurrence/rule.php:307
1889
  msgid "and"
1890
  msgstr "and"
1891
 
1892
- #: lib/recurrence/rule.php:255 lib/recurrence/rule.php:262
1893
- #: lib/recurrence/rule.php:268 lib/recurrence/rule.php:289
1894
  msgctxt "Recurrence editor - monthly tab"
1895
  msgid "on"
1896
  msgstr "on"
1897
 
1898
- #: lib/recurrence/rule.php:255 lib/recurrence/rule.php:262
1899
- #: lib/recurrence/rule.php:268
1900
  msgid "of the month"
1901
  msgstr "of the month"
1902
 
1903
- #: lib/recurrence/rule.php:302 lib/recurrence/rule.php:310
1904
- #: lib/recurrence/rule.php:317
1905
  msgctxt "Recurrence editor - yearly tab"
1906
  msgid "on"
1907
  msgstr "on"
1908
 
1909
- #: lib/recurrence/rule.php:357 public/admin/box_repeat.php:16
1910
  #: public/admin/cron_freq.php:9
1911
  msgid "Daily"
1912
  msgstr "Daily"
1913
 
1914
- #: lib/recurrence/rule.php:360
1915
  msgid "Every other day"
1916
  msgstr "Every other day"
1917
 
1918
- #: lib/recurrence/rule.php:363
1919
  msgid "Every %d days"
1920
  msgstr "Every %d days"
1921
 
1922
- #: lib/recurrence/rule.php:372 public/admin/box_repeat.php:21
1923
  msgid "Weekly"
1924
  msgstr "Weekly"
1925
 
1926
- #: lib/recurrence/rule.php:375
1927
  msgid "Every other week"
1928
  msgstr "Every other week"
1929
 
1930
- #: lib/recurrence/rule.php:378
1931
  msgid "Every %d weeks"
1932
  msgstr "Every %d weeks"
1933
 
1934
- #: lib/recurrence/rule.php:387 public/admin/box_repeat.php:26
1935
  msgid "Monthly"
1936
  msgstr "Monthly"
1937
 
1938
- #: lib/recurrence/rule.php:390
1939
  msgid "Every other month"
1940
  msgstr "Every other month"
1941
 
1942
- #: lib/recurrence/rule.php:393
1943
  msgid "Every %d months"
1944
  msgstr "Every %d months"
1945
 
1946
- #: lib/recurrence/rule.php:402 public/admin/box_repeat.php:31
1947
  msgid "Yearly"
1948
  msgstr "Yearly"
1949
 
1950
- #: lib/recurrence/rule.php:405
1951
  msgid "Every other year"
1952
  msgstr "Every other year"
1953
 
1954
- #: lib/recurrence/rule.php:408
1955
  msgid "Every %d years"
1956
  msgstr "Every %d years"
1957
 
1958
- #: lib/recurrence/rule.php:446
1959
  msgid "until %s"
1960
  msgstr "until %s"
1961
 
1962
- #: lib/recurrence/rule.php:456
1963
  msgid "for %d occurrences"
1964
  msgstr "for %d occurrences"
1965
 
1966
- #: lib/recurrence/rule.php:460
1967
  msgid "forever"
1968
  msgstr "forever"
1969
 
@@ -2175,8 +2167,8 @@ msgid "E-mail:"
2175
  msgstr "E-mail:"
2176
 
2177
  #: public/admin/box_event_contact.php:56
2178
- msgid "External URL:"
2179
- msgstr "External URL:"
2180
 
2181
  #: public/admin/box_event_cost.php:6
2182
  msgid "Event cost and Tickets"
@@ -2234,15 +2226,15 @@ msgstr "Eventbrite Ticketing"
2234
  msgid "Register this event with Eventbrite.com?"
2235
  msgstr "Register this event with Eventbrite.com?"
2236
 
2237
- #: public/admin/box_eventbrite.php:12 public/admin/feed_row.php:29
2238
- #: public/admin/feed_row.php:39 public/admin/feed_row.php:50
2239
- #: public/admin/feed_row.php:61 public/admin/feed_row.php:73
2240
  msgid "Yes"
2241
  msgstr "Yes"
2242
 
2243
- #: public/admin/box_eventbrite.php:14 public/admin/feed_row.php:31
2244
- #: public/admin/feed_row.php:41 public/admin/feed_row.php:52
2245
- #: public/admin/feed_row.php:63 public/admin/feed_row.php:75
2246
  msgid "No"
2247
  msgstr "No"
2248
 
@@ -2347,7 +2339,7 @@ msgid "Ending after"
2347
  msgstr "Ending after"
2348
 
2349
  #: public/admin/box_repeat.php:109
2350
- #: public/admin/plugins/ics/display_feeds.php:92
2351
  msgid "Please wait&#8230;"
2352
  msgstr "Please wait&#8230;"
2353
 
@@ -2356,6 +2348,7 @@ msgid "Apply"
2356
  msgstr "Apply"
2357
 
2358
  #: public/admin/box_repeat.php:116
 
2359
  msgid "Cancel"
2360
  msgstr "Cancel"
2361
 
@@ -2503,31 +2496,31 @@ msgstr "Hourly"
2503
  msgid "Twice Daily"
2504
  msgstr "Twice Daily"
2505
 
2506
- #: public/admin/feed_row.php:3 public/admin/plugins/ics/display_feeds.php:34
2507
  msgid "iCalendar/.ics Feed URL:"
2508
  msgstr "iCalendar/.ics Feed URL:"
2509
 
2510
- #: public/admin/feed_row.php:12
2511
  msgid "Event categories:"
2512
  msgstr "Event categories:"
2513
 
2514
- #: public/admin/feed_row.php:18
2515
  msgid "Tag with"
2516
  msgstr "Tag with"
2517
 
2518
- #: public/admin/feed_row.php:26
2519
  msgid "Allow comments"
2520
  msgstr "Allow comments"
2521
 
2522
- #: public/admin/feed_row.php:36
2523
  msgid "Show map"
2524
  msgstr "Show map"
2525
 
2526
- #: public/admin/feed_row.php:47
2527
  msgid "Keep original events categories and tags"
2528
  msgstr "Keep original events categories and tags"
2529
 
2530
- #: public/admin/feed_row.php:58 public/admin/plugins/ics/display_feeds.php:74
2531
  msgid ""
2532
  "On refresh, preserve previously imported events that are missing from the "
2533
  "feed"
@@ -2535,7 +2528,7 @@ msgstr ""
2535
  "On refresh, preserve previously imported events that are missing from the "
2536
  "feed"
2537
 
2538
- #: public/admin/feed_row.php:68 public/admin/plugins/ics/display_feeds.php:81
2539
  msgid ""
2540
  "Guesses the time zone of events that have none specified; recommended for "
2541
  "Google Calendar feeds"
@@ -2543,23 +2536,23 @@ msgstr ""
2543
  "Guesses the time zone of events that have none specified; recommended for "
2544
  "Google Calendar feeds"
2545
 
2546
- #: public/admin/feed_row.php:69 public/admin/plugins/ics/display_feeds.php:82
2547
  msgid "Assign default time zone to events in UTC"
2548
  msgstr "Assign default time zone to events in UTC"
2549
 
2550
- #: public/admin/feed_row.php:86
2551
  msgid "Refreshing&#8230;"
2552
  msgstr "Refreshing&#8230;"
2553
 
2554
- #: public/admin/feed_row.php:88
2555
  msgid "Refresh"
2556
  msgstr "Refresh"
2557
 
2558
- #: public/admin/feed_row.php:95
2559
  msgid "Removing&#8230;"
2560
  msgstr "Removing&#8230;"
2561
 
2562
- #: public/admin/feed_row.php:97
2563
  msgid "Remove"
2564
  msgstr "Remove"
2565
 
@@ -2583,24 +2576,28 @@ msgstr ""
2583
  msgid "Check for new events"
2584
  msgstr "Check for new events"
2585
 
2586
- #: public/admin/plugins/ics/display_feeds.php:52
2587
  msgid "Allow comments on imported events"
2588
  msgstr "Allow comments on imported events"
2589
 
2590
- #: public/admin/plugins/ics/display_feeds.php:59
2591
  msgid "Show map on imported events"
2592
  msgstr "Show map on imported events"
2593
 
2594
- #: public/admin/plugins/ics/display_feeds.php:66
2595
  msgid ""
2596
  "Import any tags/categories provided by feed, in addition those selected above"
2597
  msgstr ""
2598
  "Import any tags/categories provided by feed, in addition those selected above"
2599
 
2600
- #: public/admin/plugins/ics/display_feeds.php:94
2601
  msgid "Add new subscription"
2602
  msgstr "Add new subscription"
2603
 
 
 
 
 
2604
  #: public/admin/row_custom.php:3
2605
  msgid "Custom dates:"
2606
  msgstr "Custom dates:"
@@ -2901,9 +2898,9 @@ msgstr "Today background"
2901
  msgid "All-in-One Event Calendar by Time.ly"
2902
  msgstr "All-in-One Event Calendar by Time.ly"
2903
 
2904
- #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.2.1) #-#-#-#-#
2905
  #. Plugin URI of the plugin/theme
2906
- #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.2.1) #-#-#-#-#
2907
  #. Author URI of the plugin/theme
2908
  msgid "http://time.ly/"
2909
  msgstr "http://time.ly/"
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.3.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
+ "POT-Creation-Date: 2015-08-18 17:34:54+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: 2015-08-19 01:34+0800\n"
12
  "Last-Translator: Timely <support@time.ly>\n"
13
  "Language-Team:\n"
14
 
15
+ #: app/controller/extension-license.php:53 app/view/admin/add-ons.php:26
16
  #: app/view/admin/add-ons.php:27
17
  msgid "Add-ons"
18
  msgstr "Add-ons"
19
 
 
 
 
 
 
 
 
 
20
  #: app/controller/front.php:343
21
  msgid ""
22
  "Your active calendar theme could not be properly initialized. The default "
32
  msgid "Calendar Themes"
33
  msgstr "Calendar Themes"
34
 
35
+ #: app/controller/front.php:936
36
  msgid ""
37
  "Your database is found to be corrupt. Likely previous update has failed. "
38
  "Please restore All-in-One Event Calendar tables from a backup and retry."
46
  msgid "You must choose the Calendar page before using the Super Widget"
47
  msgstr "You must choose the Calendar page before using the Super Widget"
48
 
49
+ #: app/controller/javascript.php:389
50
  msgid "This feed is already being imported."
51
  msgstr "This feed is already being imported."
52
 
53
+ #: app/controller/javascript.php:392
54
  msgid "Please enter a valid iCalendar URL."
55
  msgstr "Please enter a valid iCalendar URL."
56
 
57
+ #: app/controller/javascript.php:395
58
  msgid "Please enter a valid email address."
59
  msgstr "Please enter a valid email address."
60
 
61
+ #: app/controller/javascript.php:397
62
  msgid "Choose Image"
63
  msgstr "Choose Image"
64
 
65
+ #: app/controller/javascript.php:400
66
  msgid "The value you have entered is not a valid CSS length."
67
  msgstr "The value you have entered is not a valid CSS length."
68
 
69
+ #: app/controller/javascript.php:403
70
  msgid ""
71
  "Are you sure you want to reset your theme options to their default values?"
72
  msgstr ""
73
  "Are you sure you want to reset your theme options to their default values?"
74
 
75
+ #: app/controller/javascript.php:406
76
  msgid ""
77
  "Please enter a valid latitude. A valid latitude is comprised between +90 and "
78
  "-90."
80
  "Please enter a valid latitude. A valid latitude is comprised between +90 and "
81
  "-90."
82
 
83
+ #: app/controller/javascript.php:409
84
  msgid ""
85
  "Please enter a valid longitude. A valid longitude is comprised between +180 "
86
  "and -180."
88
  "Please enter a valid longitude. A valid longitude is comprised between +180 "
89
  "and -180."
90
 
91
+ #: app/controller/javascript.php:412
92
  msgid ""
93
  "When the \"Input coordinates\" checkbox is checked, \"Latitude\" is a "
94
  "required field."
96
  "When the \"Input coordinates\" checkbox is checked, \"Latitude\" is a "
97
  "required field."
98
 
99
+ #: app/controller/javascript.php:415
100
  msgid ""
101
  "When the \"Input coordinates\" checkbox is checked, \"Longitude\" is a "
102
  "required field."
104
  "When the \"Input coordinates\" checkbox is checked, \"Longitude\" is a "
105
  "required field."
106
 
107
+ #: app/controller/javascript.php:418
108
  msgid ""
109
  "The URL you have entered in the <b>Organizer Contact Info</b> &gt; "
110
+ "<b>Website URL</b> seems to be invalid."
111
  msgstr ""
112
  "The URL you have entered in the <b>Organizer Contact Info</b> &gt; "
113
+ "<b>Website URL</b> seems to be invalid."
114
 
115
+ #: app/controller/javascript.php:421
116
  msgid ""
117
  "The URL you have entered in the <b>Event Cost and Tickets</b> &gt; <b>Buy "
118
  "Tickets URL</b> seems to be invalid."
120
  "The URL you have entered in the <b>Event Cost and Tickets</b> &gt; <b>Buy "
121
  "Tickets URL</b> seems to be invalid."
122
 
123
+ #: app/controller/javascript.php:424
124
  msgid ""
125
  "Please remember that URLs must start with either \"http://\" or \"https://\"."
126
  msgstr ""
127
  "Please remember that URLs must start with either \"http://\" or \"https://\"."
128
 
129
+ #: app/controller/javascript.php:427
130
  msgid "Loading&hellip;"
131
  msgstr "Loading&hellip;"
132
 
133
+ #: app/controller/javascript.php:457 app/view/admin/widget-creator.php:139
134
  msgid "Preview:"
135
  msgstr "Preview:"
136
 
137
+ #: app/controller/javascript.php:458
138
  msgid ""
139
  "Loading preview&nbsp;<i class=\"ai1ec-fa ai1ec-fa-spin ai1ec-fa-spinner\"></"
140
  "i>"
142
  "Loading preview&nbsp;<i class=\"ai1ec-fa ai1ec-fa-spin ai1ec-fa-spinner\"></"
143
  "i>"
144
 
145
+ #: app/controller/javascript.php:462
146
  msgid ""
147
  "Something went wrong while fetching events.<br>The request status is: %STATUS"
148
  "% <br>The error thrown was: %ERROR%"
150
  "Something went wrong while fetching events.<br>The request status is: %STATUS"
151
  "% <br>The error thrown was: %ERROR%"
152
 
153
+ #: app/controller/javascript.php:469
154
  msgid "The end date can't be earlier than the start date."
155
  msgstr "The end date can't be earlier than the start date."
156
 
157
+ #: app/controller/javascript.php:470
158
  msgid "For week and day view, you must select an interval of at least 6 hours."
159
  msgstr ""
160
  "For week and day view, you must select an interval of at least 6 hours."
167
  msgid "Base Event"
168
  msgstr "Base Event"
169
 
170
+ #: app/model/settings.php:385
171
  #: lib/html/element/setting/calendar-page-selector.php:50
172
  msgid "Calendar page"
173
  msgstr "Calendar page"
174
 
175
+ #: app/model/settings.php:395
176
  msgid "Week starts on"
177
  msgstr "Week starts on"
178
 
179
+ #: app/model/settings.php:408
180
  msgid "Available views"
181
  msgstr "Available views"
182
 
183
+ #: app/model/settings.php:416
184
  msgid "Agenda"
185
  msgid_plural "Agenda"
186
  msgstr[0] "Agenda"
187
  msgstr[1] "Agenda"
188
 
189
+ #: app/model/settings.php:427
190
  msgid "Day"
191
  msgid_plural "Day"
192
  msgstr[0] "Day"
193
  msgstr[1] "Day"
194
 
195
+ #: app/model/settings.php:438
196
  msgid "Month"
197
  msgid_plural "Month"
198
  msgstr[0] "Month"
199
  msgstr[1] "Month"
200
 
201
+ #: app/model/settings.php:449
202
  msgid "Week"
203
  msgid_plural "Week"
204
  msgstr[0] "Week"
205
  msgstr[1] "Week"
206
 
207
+ #: app/model/settings.php:463
208
  msgid "Timezone"
209
  msgstr "Timezone"
210
 
211
+ #: app/model/settings.php:476
212
  msgid "Preselected calendar filters"
213
  msgstr "Preselected calendar filters"
214
 
215
+ #: app/model/settings.php:477 app/view/calendar/widget.php:128
216
  msgid ""
217
  "To clear, hold &#8984;/<abbr class=\"initialism\">CTRL</abbr> and click "
218
  "selection."
220
  "To clear, hold &#8984;/<abbr class=\"initialism\">CTRL</abbr> and click "
221
  "selection."
222
 
223
+ #: app/model/settings.php:492
224
  msgid "Default calendar start date (optional)"
225
  msgstr "Default calendar start date (optional)"
226
 
227
+ #: app/model/settings.php:503
228
  msgid "Agenda pages show at most"
229
  msgstr "Agenda pages show at most"
230
 
231
+ #: app/model/settings.php:516
232
  msgid "Week/Day view starts at"
233
  msgstr "Week/Day view starts at"
234
 
235
+ #: app/model/settings.php:529
236
  msgid "Week/Day view ends at"
237
  msgstr "Week/Day view ends at"
238
 
239
+ #: app/model/settings.php:542
240
  msgid "<strong>Word-wrap event stubs</strong> in Month view"
241
  msgstr "<strong>Word-wrap event stubs</strong> in Month view"
242
 
243
+ #: app/model/settings.php:545
244
  msgid "Only applies to events that span a single day."
245
  msgstr "Only applies to events that span a single day."
246
 
247
+ #: app/model/settings.php:557
248
  msgid ""
249
  "In <span class=\"ai1ec-tooltip-toggle\"\n"
250
  "\t\t\t\t\t\tdata-original-title=\"These include Agenda view,\n"
258
  "\t\t\t\t\t\tAgenda-like views</span>, <strong>include all events\n"
259
  "\t\t\t\t\t\tfrom last day shown</strong>"
260
 
261
+ #: app/model/settings.php:573
262
  msgid "Keep all events <strong>expanded</strong> in Agenda view"
263
  msgstr "Keep all events <strong>expanded</strong> in Agenda view"
264
 
265
+ #: app/model/settings.php:585
266
  msgid "<strong>Show year</strong> in calendar date labels"
267
  msgstr "<strong>Show year</strong> in calendar date labels"
268
 
269
+ #: app/model/settings.php:597
270
  msgid "<strong>Show location in event titles</strong> in calendar views"
271
  msgstr "<strong>Show location in event titles</strong> in calendar views"
272
 
273
+ #: app/model/settings.php:609
274
  msgid "<strong>Exclude</strong> events from search results"
275
  msgstr "<strong>Exclude</strong> events from search results"
276
 
277
+ #: app/model/settings.php:621
278
  msgid ""
279
  "Hide <strong>Subscribe</strong>/<strong>Add to Calendar</strong> buttons in "
280
  "calendar and single event views "
282
  "Hide <strong>Subscribe</strong>/<strong>Add to Calendar</strong> buttons in "
283
  "calendar and single event views "
284
 
285
+ #: app/model/settings.php:633
286
  msgid "Hide <strong>Get a Timely Calendar</strong> button"
287
  msgstr "Hide <strong>Get a Timely Calendar</strong> button"
288
 
289
+ #: app/model/settings.php:645
290
  msgid " Hide <strong>Google Maps</strong> until clicked"
291
  msgstr " Hide <strong>Google Maps</strong> until clicked"
292
 
293
+ #: app/model/settings.php:657
294
  msgid ""
295
  " <strong>Affix filter menu</strong> to top of window when it scrolls out of "
296
  "view"
298
  " <strong>Affix filter menu</strong> to top of window when it scrolls out of "
299
  "view"
300
 
301
+ #: app/model/settings.php:660
302
  msgid "Only applies to first visible calendar found on the page."
303
  msgstr "Only applies to first visible calendar found on the page."
304
 
305
+ #: app/model/settings.php:672
306
  msgid "Offset affixed filter bar vertically by"
307
  msgstr "Offset affixed filter bar vertically by"
308
 
309
+ #: app/model/settings.php:687
310
  msgid "Wide screens only (&#8805; 1200px)"
311
  msgstr "Wide screens only (&#8805; 1200px)"
312
 
313
+ #: app/model/settings.php:702
314
  msgid "Tablets only (< 980px)"
315
  msgstr "Tablets only (< 980px)"
316
 
317
+ #: app/model/settings.php:717
318
  msgid "Phones only (< 768px)"
319
  msgstr "Phones only (< 768px)"
320
 
321
+ #: app/model/settings.php:730
322
  msgid "Strict compatibility content filtering"
323
  msgstr "Strict compatibility content filtering"
324
 
325
+ #: app/model/settings.php:742
326
  msgid " <strong>Hide featured image</strong> from event details page"
327
  msgstr " <strong>Hide featured image</strong> from event details page"
328
 
329
+ #: app/model/settings.php:745
330
  msgid ""
331
  "Select this option if your theme already displays each post's featured image."
332
  msgstr ""
333
  "Select this option if your theme already displays each post's featured image."
334
 
335
+ #: app/model/settings.php:756
336
  msgid "Input dates in this format"
337
  msgstr "Input dates in this format"
338
 
339
+ #: app/model/settings.php:761
340
  msgid "Default (d/m/yyyy)"
341
  msgstr "Default (d/m/yyyy)"
342
 
343
+ #: app/model/settings.php:765
344
  msgid "US (m/d/yyyy)"
345
  msgstr "US (m/d/yyyy)"
346
 
347
+ #: app/model/settings.php:769
348
  msgid "ISO 8601 (yyyy-m-d)"
349
  msgstr "ISO 8601 (yyyy-m-d)"
350
 
351
+ #: app/model/settings.php:773
352
  msgid "Dotted (m.d.yyyy)"
353
  msgstr "Dotted (m.d.yyyy)"
354
 
355
+ #: app/model/settings.php:785
356
  msgid " Use <strong>24h time</strong> in time pickers"
357
  msgstr " Use <strong>24h time</strong> in time pickers"
358
 
359
+ #: app/model/settings.php:796
360
  msgid "<strong>Disable address autocomplete</strong> function"
361
  msgstr "<strong>Disable address autocomplete</strong> function"
362
 
363
+ #: app/model/settings.php:807
364
  msgid ""
365
  "Use the configured <strong>region</strong> (WordPress locale) to bias the "
366
  "address autocomplete function "
368
  "Use the configured <strong>region</strong> (WordPress locale) to bias the "
369
  "address autocomplete function "
370
 
371
+ #: app/model/settings.php:823
372
  msgid ""
373
  " Show the old <strong>Post Your Event</strong> button above the calendar to "
374
  "privileged users"
376
  " Show the old <strong>Post Your Event</strong> button above the calendar to "
377
  "privileged users"
378
 
379
+ #: app/model/settings.php:826
380
  msgid ""
381
  "Install the <a target=\"_blank\" href=\"http://time.ly/\">Interactive "
382
  "Frontend Extension</a> for the <strong>frontend Post Your Event form</"
386
  "Frontend Extension</a> for the <strong>frontend Post Your Event form</"
387
  "strong>."
388
 
389
+ #: app/model/settings.php:847
390
  msgid "Move calendar into this DOM element"
391
  msgstr "Move calendar into this DOM element"
392
 
393
+ #: app/model/settings.php:849
394
  msgid ""
395
  "Optional. Use this JavaScript-based shortcut to place the\n"
396
  "\t\t\t\t\t\tcalendar a DOM element other than the usual page content "
414
  "\t\t\t\t\t\tAny existing markup found within the target will be replaced\n"
415
  "\t\t\t\t\t\tby the calendar."
416
 
417
+ #: app/model/settings.php:868
418
  msgid ""
419
  "<strong>Skip <tt>in_the_loop()</tt> check </strong> that protects against "
420
  "multiple calendar output"
422
  "<strong>Skip <tt>in_the_loop()</tt> check </strong> that protects against "
423
  "multiple calendar output"
424
 
425
+ #: app/model/settings.php:871
426
  msgid ""
427
  "Try enabling this option if your calendar does not appear on the calendar "
428
  "page. It is needed for compatibility with a small number of themes that call "
432
  "page. It is needed for compatibility with a small number of themes that call "
433
  "<tt>the_content()</tt> from outside of The Loop. Leave disabled otherwise."
434
 
435
+ #: app/model/settings.php:883
436
  msgid "Disable <strong>gzip</strong> compression."
437
  msgstr "Disable <strong>gzip</strong> compression."
438
 
439
+ #: app/model/settings.php:886
440
  msgid ""
441
  "Use this option if calendar is unresponsive. <a href=\"http://support.time."
442
  "ly/disable-gzip-compression/\">Read more</a> about the issue. (From version "
446
  "ly/disable-gzip-compression/\">Read more</a> about the issue. (From version "
447
  "2.1 onwards, gzip is disabled by default for maximum compatibility.)"
448
 
449
+ #: app/model/settings.php:898
450
  msgid "Use frontend rendering."
451
  msgstr "Use frontend rendering."
452
 
453
+ #: app/model/settings.php:901
454
  msgid ""
455
  "Renders calendar views on the client rather than the server; can improve "
456
  "performance."
458
  "Renders calendar views on the client rather than the server; can improve "
459
  "performance."
460
 
461
+ #: app/model/settings.php:913
462
  msgid ""
463
  "<strong>Link CSS</strong> in <code>&lt;head&gt;</code> section when file "
464
  "cache is unavailable."
466
  "<strong>Link CSS</strong> in <code>&lt;head&gt;</code> section when file "
467
  "cache is unavailable."
468
 
469
+ #: app/model/settings.php:916
470
  msgid ""
471
  "Use this option if file cache is unavailable and you would prefer to serve "
472
  "CSS as a link rather than have it output inline."
474
  "Use this option if file cache is unavailable and you would prefer to serve "
475
  "CSS as a link rather than have it output inline."
476
 
477
+ #: app/model/settings.php:928
478
  msgid "Current <strong>robots.txt</strong> on this site"
479
  msgstr "Current <strong>robots.txt</strong> on this site"
480
 
481
+ #: app/model/settings.php:932
482
  msgid ""
483
  "The Robot Exclusion Standard, also known as the Robots Exclusion Protocol "
484
  "or\n"
502
  "\t\t\t\t\t\tYou can change it manually by editing <code>robots.txt</code> in "
503
  "your root WordPress directory."
504
 
505
+ #: app/model/settings.php:949
506
  msgid ""
507
  "<strong>Publicize, promote, and share my events</strong> marked as public on "
508
  "the Timely network. (<a href=\"%s\" target=\"_blank\">Learn more &#187;</a>)"
510
  "<strong>Publicize, promote, and share my events</strong> marked as public on "
511
  "the Timely network. (<a href=\"%s\" target=\"_blank\">Learn more &#187;</a>)"
512
 
513
+ #: app/model/settings.php:972
514
  msgid "Templates cache improves site performance"
515
  msgstr "Templates cache improves site performance"
516
 
517
+ #: app/model/settings.php:985
518
  msgid "Display events in <strong>calendar time zone</strong>"
519
  msgstr "Display events in <strong>calendar time zone</strong>"
520
 
521
+ #: app/model/settings.php:988
522
  msgid ""
523
  "If this box is checked events will appear in the calendar time zone with "
524
  "time zone information displayed on the event details page."
530
  msgid "Event Details"
531
  msgstr "Event Details"
532
 
533
+ #: app/view/admin/add-new-event.php:356
 
 
 
 
534
  msgid "Set banner image"
535
  msgstr "Set banner image"
536
 
537
+ #: app/view/admin/add-new-event.php:357
538
  msgid "Remove banner image"
539
  msgstr "Remove banner image"
540
 
572
  msgid "Event date/time"
573
  msgstr "Event date/time"
574
 
575
+ #: app/view/admin/all-events.php:104
576
  msgid "Show All "
577
  msgstr "Show All "
578
 
579
+ #: app/view/admin/all-events.php:117
580
+ msgid "Show All Authors"
581
+ msgstr "Show All Authors"
582
+
583
  #: app/view/admin/calendar-feeds.php:27 app/view/admin/calendar-feeds.php:28
584
  msgid "Calendar Feeds"
585
  msgstr "Calendar Feeds"
629
  "Assign an optional image to the category. Recommended size: square, minimum "
630
  "400&times;400 pixels."
631
 
632
+ #: app/view/admin/get-repeat-box.php:94
633
  msgid "times"
634
  msgstr "times"
635
 
636
+ #: app/view/admin/get-repeat-box.php:164
637
  msgid "Recurrence rule cannot be empty."
638
  msgstr "Recurrence rule cannot be empty."
639
 
640
+ #: app/view/admin/get-repeat-box.php:182
641
  msgid "Recurrence rule was not provided."
642
  msgstr "Recurrence rule was not provided."
643
 
644
+ #: app/view/admin/get-repeat-box.php:209
645
  msgid "Never"
646
  msgstr "Never"
647
 
648
+ #: app/view/admin/get-repeat-box.php:210
649
  msgid "After"
650
  msgstr "After"
651
 
652
+ #: app/view/admin/get-repeat-box.php:211 public/admin/box_repeat.php:93
653
  msgid "On date"
654
  msgstr "On date"
655
 
656
+ #: app/view/admin/get-repeat-box.php:247
657
  msgid "day(s)"
658
  msgstr "day(s)"
659
 
660
+ #: app/view/admin/get-repeat-box.php:330
661
  msgid "week(s)"
662
  msgstr "week(s)"
663
 
664
+ #: app/view/admin/get-repeat-box.php:413 app/view/admin/get-repeat-box.php:485
665
+ #: lib/recurrence/rule.php:297
666
  msgid "last"
667
  msgstr "last"
668
 
669
+ #: app/view/admin/get-repeat-box.php:426
670
  msgid "month(s)"
671
  msgstr "month(s)"
672
 
673
+ #: app/view/admin/get-repeat-box.php:480
674
  msgid "first"
675
  msgstr "first"
676
 
677
+ #: app/view/admin/get-repeat-box.php:481
678
  msgid "second"
679
  msgstr "second"
680
 
681
+ #: app/view/admin/get-repeat-box.php:482
682
  msgid "third"
683
  msgstr "third"
684
 
685
+ #: app/view/admin/get-repeat-box.php:483
686
  msgid "fourth"
687
  msgstr "fourth"
688
 
689
+ #: app/view/admin/get-repeat-box.php:495
690
  msgid "Sunday"
691
  msgstr "Sunday"
692
 
693
+ #: app/view/admin/get-repeat-box.php:496
694
  msgid "Monday"
695
  msgstr "Monday"
696
 
697
+ #: app/view/admin/get-repeat-box.php:497
698
  msgid "Tuesday"
699
  msgstr "Tuesday"
700
 
701
+ #: app/view/admin/get-repeat-box.php:498
702
  msgid "Wednesday"
703
  msgstr "Wednesday"
704
 
705
+ #: app/view/admin/get-repeat-box.php:499
706
  msgid "Thursday"
707
  msgstr "Thursday"
708
 
709
+ #: app/view/admin/get-repeat-box.php:500
710
  msgid "Friday"
711
  msgstr "Friday"
712
 
713
+ #: app/view/admin/get-repeat-box.php:501
714
  msgid "Saturday"
715
  msgstr "Saturday"
716
 
717
+ #: app/view/admin/get-repeat-box.php:503
718
  msgid "day"
719
  msgstr "day"
720
 
721
+ #: app/view/admin/get-repeat-box.php:504
722
  msgid "weekday"
723
  msgstr "weekday"
724
 
725
+ #: app/view/admin/get-repeat-box.php:505
726
  msgid "weekend day"
727
  msgstr "weekend day"
728
 
729
+ #: app/view/admin/get-repeat-box.php:571
730
  msgid "year(s)"
731
  msgstr "year(s)"
732
 
734
  msgid "<a href=\"%s\">Settings</a>"
735
  msgstr "<a href=\"%s\">Settings</a>"
736
 
737
+ #: app/view/admin/nav.php:28
738
+ msgid "<a href=\"%s\">Check for updates</a>"
739
+ msgstr "<a href=\"%s\">Check for updates</a>"
740
+
741
  #: app/view/admin/organize.php:100
742
  msgid "Organize Events"
743
  msgstr "Organize Events"
794
  msgstr "Cache Report"
795
 
796
  #: app/view/admin/settings.php:170
 
797
  msgid "Save Settings"
798
  msgstr "Save Settings"
799
 
916
  "There was an error loading calendar. Please contact site administrator and "
917
  "inform him to configure calendar views."
918
 
919
+ #: app/view/calendar/page.php:74
920
  msgid ""
921
  "Calendar was unable to initialize %s view and has reverted to Agenda view. "
922
  "Please check if you have installed the latest versions of calendar add-ons."
924
  "Calendar was unable to initialize %s view and has reverted to Agenda view. "
925
  "Please check if you have installed the latest versions of calendar add-ons."
926
 
927
+ #: app/view/calendar/page.php:268
928
  msgid "Subscribe to filtered calendar"
929
  msgstr "Subscribe to filtered calendar"
930
 
931
+ #: app/view/calendar/page.php:269
932
  msgid "Subscribe"
933
  msgstr "Subscribe"
934
 
935
+ #: app/view/calendar/page.php:270 app/view/event/single.php:115
936
  msgid "Get a Timely Calendar"
937
  msgstr "Get a Timely Calendar"
938
 
998
  msgid "Tags"
999
  msgstr "Tags"
1000
 
1001
+ #: app/view/calendar/view/agenda.php:129
1002
  msgid "Collapse All"
1003
  msgstr "Collapse All"
1004
 
1005
+ #: app/view/calendar/view/agenda.php:130
1006
  msgid "Expand All"
1007
  msgstr "Expand All"
1008
 
1009
+ #: app/view/calendar/view/agenda.php:153
1010
  msgid "There are no upcoming events to display at this time."
1011
  msgstr "There are no upcoming events to display at this time."
1012
 
1013
+ #: app/view/calendar/view/agenda.php:154 app/view/calendar/widget.php:373
1014
+ #: public/admin/feed_row.php:112
1015
  msgid "Edit"
1016
  msgstr "Edit"
1017
 
1018
+ #: app/view/calendar/view/agenda.php:155
1019
  msgid "Read more"
1020
  msgstr "Read more"
1021
 
1022
+ #: app/view/calendar/view/agenda.php:156
1023
  msgid "Categories:"
1024
  msgstr "Categories:"
1025
 
1026
+ #: app/view/calendar/view/agenda.php:157 lib/theme/list.php:320
1027
  #: public/admin/themes.php:29
1028
  msgid "Tags:"
1029
  msgstr "Tags:"
1030
 
1031
+ #: app/view/calendar/view/agenda.php:158 app/view/calendar/view/month.php:87
1032
+ #: app/view/calendar/view/oneday.php:105 app/view/calendar/view/week.php:118
1033
  #: app/view/calendar/widget.php:374
1034
  msgid "@ %s"
1035
  msgstr "@ %s"
1036
 
1037
+ #: app/view/calendar/view/oneday.php:79 app/view/calendar/view/week.php:73
1038
  msgid "g a"
1039
  msgstr "g a"
1040
 
1041
+ #: app/view/calendar/view/oneday.php:102 app/view/calendar/view/week.php:115
1042
  msgid "Reveal full day"
1043
  msgstr "Reveal full day"
1044
 
1045
+ #: app/view/calendar/view/oneday.php:103 app/view/calendar/view/week.php:116
1046
  msgid "All-day"
1047
  msgstr "All-day"
1048
 
1049
+ #: app/view/calendar/view/oneday.php:104 app/view/calendar/view/week.php:117
1050
  msgid "Now:"
1051
  msgstr "Now:"
1052
 
1053
+ #: app/view/calendar/view/week.php:67
1054
  msgid "Week of %s"
1055
  msgstr "Week of %s"
1056
 
1201
  msgid "Free"
1202
  msgstr "Free"
1203
 
1204
+ #: app/view/event/single.php:145
1205
  msgid "Edit this occurrence (%s)"
1206
  msgstr "Edit this occurrence (%s)"
1207
 
1208
+ #: app/view/event/single.php:160
1209
  msgid ""
1210
  "This post was replicated from another site's <a href=\"%s\" title="
1211
  "\"iCalendar feed\"><i class=\"ai1ec-fa ai1ec-fa-calendar\"></i> calendar "
1215
  "\"iCalendar feed\"><i class=\"ai1ec-fa ai1ec-fa-calendar\"></i> calendar "
1216
  "feed</a>."
1217
 
1218
+ #: app/view/event/single.php:171
1219
  msgid "View original"
1220
  msgstr "View original"
1221
 
1269
  msgid "Another import process in progress. Please try again later."
1270
  msgstr "Another import process in progress. Please try again later."
1271
 
1272
+ #: lib/calendar-feed/ics.php:174
1273
  msgid ""
1274
  "A system error has prevented calendar data from being fetched. Something is "
1275
  "preventing the plugin from functioning correctly. This message should "
1279
  "preventing the plugin from functioning correctly. This message should "
1280
  "provide a clue: %s"
1281
 
1282
+ #: lib/calendar-feed/ics.php:181
1283
  msgid ""
1284
  "Calendar data could not be fetched. If your URL is valid and contains an "
1285
  "iCalendar resource, this is likely the result of a temporary server error "
1289
  "iCalendar resource, this is likely the result of a temporary server error "
1290
  "and time may resolve this issue"
1291
 
1292
+ #: lib/calendar-feed/ics.php:195
 
 
 
 
1293
  msgid "Imported %s event"
1294
  msgid_plural "Imported %s events"
1295
  msgstr[0] "Imported %s event"
1296
  msgstr[1] "Imported %s events"
1297
 
1298
+ #: lib/calendar-feed/ics.php:202 lib/calendar-feed/ics.php:707
1299
  msgid "Invalid ICS feed ID"
1300
  msgstr "Invalid ICS feed ID"
1301
 
1302
+ #: lib/calendar-feed/ics.php:350
1303
  msgid "Categories (optional)"
1304
  msgstr "Categories (optional)"
1305
 
1306
+ #: lib/calendar-feed/ics.php:367
1307
  msgid ""
1308
  "Do you want to keep the events imported from the calendar or remove them?"
1309
  msgstr ""
1310
  "Do you want to keep the events imported from the calendar or remove them?"
1311
 
1312
+ #: lib/calendar-feed/ics.php:373
1313
  msgid "Removing ICS Feed"
1314
  msgstr "Removing ICS Feed"
1315
 
1316
+ #: lib/calendar-feed/ics.php:376
1317
  msgid "Keep Events"
1318
  msgstr "Keep Events"
1319
 
1320
+ #: lib/calendar-feed/ics.php:379
1321
  msgid "Remove Events"
1322
  msgstr "Remove Events"
1323
 
1324
+ #: lib/calendar-feed/ics.php:519
1325
  msgid "Oh, submission was not accepted."
1326
  msgstr "Oh, submission was not accepted."
1327
 
1328
+ #: lib/calendar-feed/ics.php:699
1329
  msgid "Deleted %d events"
1330
  msgstr "Deleted %d events"
1331
 
1332
+ #: lib/calendar-feed/ics.php:735
1333
  msgid "Feed deleted"
1334
  msgstr "Feed deleted"
1335
 
1567
  msgid "Error Details:"
1568
  msgstr "Error Details:"
1569
 
1570
+ #: lib/factory/html.php:133
1571
  msgid "Choose a date using calendar"
1572
  msgstr "Choose a date using calendar"
1573
 
1574
+ #: lib/factory/html.php:278
1575
  msgid "Tags (optional)"
1576
  msgstr "Tags (optional)"
1577
 
1858
  msgid "Event Feed"
1859
  msgstr "Event Feed"
1860
 
1861
+ #: lib/post/custom-type.php:285
1862
  msgid ""
1863
  "All Events <span class=\"update-plugins count-%d\" title=\"%d Pending Events"
1864
  "\"><span class=\"update-count\">%d</span></span>"
1866
  "All Events <span class=\"update-plugins count-%d\" title=\"%d Pending Events"
1867
  "\"><span class=\"update-count\">%d</span></span>"
1868
 
1869
+ #: lib/post/custom-type.php:296
1870
  msgid "All Events"
1871
  msgstr "All Events"
1872
 
1873
+ #: lib/recurrence/rule.php:243 lib/recurrence/rule.php:252
1874
+ #: lib/recurrence/rule.php:260
1875
  msgctxt "Recurrence editor - weekly tab"
1876
  msgid "on"
1877
  msgstr "on"
1878
 
1879
+ #: lib/recurrence/rule.php:248 lib/recurrence/rule.php:277
1880
+ #: lib/recurrence/rule.php:325
1881
  msgid "and"
1882
  msgstr "and"
1883
 
1884
+ #: lib/recurrence/rule.php:273 lib/recurrence/rule.php:280
1885
+ #: lib/recurrence/rule.php:286 lib/recurrence/rule.php:307
1886
  msgctxt "Recurrence editor - monthly tab"
1887
  msgid "on"
1888
  msgstr "on"
1889
 
1890
+ #: lib/recurrence/rule.php:273 lib/recurrence/rule.php:280
1891
+ #: lib/recurrence/rule.php:286
1892
  msgid "of the month"
1893
  msgstr "of the month"
1894
 
1895
+ #: lib/recurrence/rule.php:320 lib/recurrence/rule.php:328
1896
+ #: lib/recurrence/rule.php:335
1897
  msgctxt "Recurrence editor - yearly tab"
1898
  msgid "on"
1899
  msgstr "on"
1900
 
1901
+ #: lib/recurrence/rule.php:375 public/admin/box_repeat.php:16
1902
  #: public/admin/cron_freq.php:9
1903
  msgid "Daily"
1904
  msgstr "Daily"
1905
 
1906
+ #: lib/recurrence/rule.php:378
1907
  msgid "Every other day"
1908
  msgstr "Every other day"
1909
 
1910
+ #: lib/recurrence/rule.php:381
1911
  msgid "Every %d days"
1912
  msgstr "Every %d days"
1913
 
1914
+ #: lib/recurrence/rule.php:390 public/admin/box_repeat.php:21
1915
  msgid "Weekly"
1916
  msgstr "Weekly"
1917
 
1918
+ #: lib/recurrence/rule.php:393
1919
  msgid "Every other week"
1920
  msgstr "Every other week"
1921
 
1922
+ #: lib/recurrence/rule.php:396
1923
  msgid "Every %d weeks"
1924
  msgstr "Every %d weeks"
1925
 
1926
+ #: lib/recurrence/rule.php:405 public/admin/box_repeat.php:26
1927
  msgid "Monthly"
1928
  msgstr "Monthly"
1929
 
1930
+ #: lib/recurrence/rule.php:408
1931
  msgid "Every other month"
1932
  msgstr "Every other month"
1933
 
1934
+ #: lib/recurrence/rule.php:411
1935
  msgid "Every %d months"
1936
  msgstr "Every %d months"
1937
 
1938
+ #: lib/recurrence/rule.php:420 public/admin/box_repeat.php:31
1939
  msgid "Yearly"
1940
  msgstr "Yearly"
1941
 
1942
+ #: lib/recurrence/rule.php:423
1943
  msgid "Every other year"
1944
  msgstr "Every other year"
1945
 
1946
+ #: lib/recurrence/rule.php:426
1947
  msgid "Every %d years"
1948
  msgstr "Every %d years"
1949
 
1950
+ #: lib/recurrence/rule.php:464
1951
  msgid "until %s"
1952
  msgstr "until %s"
1953
 
1954
+ #: lib/recurrence/rule.php:474
1955
  msgid "for %d occurrences"
1956
  msgstr "for %d occurrences"
1957
 
1958
+ #: lib/recurrence/rule.php:478
1959
  msgid "forever"
1960
  msgstr "forever"
1961
 
2167
  msgstr "E-mail:"
2168
 
2169
  #: public/admin/box_event_contact.php:56
2170
+ msgid "Website URL:"
2171
+ msgstr "Website URL:"
2172
 
2173
  #: public/admin/box_event_cost.php:6
2174
  msgid "Event cost and Tickets"
2226
  msgid "Register this event with Eventbrite.com?"
2227
  msgstr "Register this event with Eventbrite.com?"
2228
 
2229
+ #: public/admin/box_eventbrite.php:12 public/admin/feed_row.php:43
2230
+ #: public/admin/feed_row.php:54 public/admin/feed_row.php:66
2231
+ #: public/admin/feed_row.php:78 public/admin/feed_row.php:91
2232
  msgid "Yes"
2233
  msgstr "Yes"
2234
 
2235
+ #: public/admin/box_eventbrite.php:14 public/admin/feed_row.php:45
2236
+ #: public/admin/feed_row.php:56 public/admin/feed_row.php:68
2237
+ #: public/admin/feed_row.php:80 public/admin/feed_row.php:93
2238
  msgid "No"
2239
  msgstr "No"
2240
 
2339
  msgstr "Ending after"
2340
 
2341
  #: public/admin/box_repeat.php:109
2342
+ #: public/admin/plugins/ics/display_feeds.php:90
2343
  msgid "Please wait&#8230;"
2344
  msgstr "Please wait&#8230;"
2345
 
2348
  msgstr "Apply"
2349
 
2350
  #: public/admin/box_repeat.php:116
2351
+ #: public/admin/plugins/ics/display_feeds.php:84
2352
  msgid "Cancel"
2353
  msgstr "Cancel"
2354
 
2496
  msgid "Twice Daily"
2497
  msgstr "Twice Daily"
2498
 
2499
+ #: public/admin/feed_row.php:14 public/admin/plugins/ics/display_feeds.php:27
2500
  msgid "iCalendar/.ics Feed URL:"
2501
  msgstr "iCalendar/.ics Feed URL:"
2502
 
2503
+ #: public/admin/feed_row.php:24
2504
  msgid "Event categories:"
2505
  msgstr "Event categories:"
2506
 
2507
+ #: public/admin/feed_row.php:31
2508
  msgid "Tag with"
2509
  msgstr "Tag with"
2510
 
2511
+ #: public/admin/feed_row.php:40
2512
  msgid "Allow comments"
2513
  msgstr "Allow comments"
2514
 
2515
+ #: public/admin/feed_row.php:51
2516
  msgid "Show map"
2517
  msgstr "Show map"
2518
 
2519
+ #: public/admin/feed_row.php:63
2520
  msgid "Keep original events categories and tags"
2521
  msgstr "Keep original events categories and tags"
2522
 
2523
+ #: public/admin/feed_row.php:75 public/admin/plugins/ics/display_feeds.php:67
2524
  msgid ""
2525
  "On refresh, preserve previously imported events that are missing from the "
2526
  "feed"
2528
  "On refresh, preserve previously imported events that are missing from the "
2529
  "feed"
2530
 
2531
+ #: public/admin/feed_row.php:86 public/admin/plugins/ics/display_feeds.php:74
2532
  msgid ""
2533
  "Guesses the time zone of events that have none specified; recommended for "
2534
  "Google Calendar feeds"
2536
  "Guesses the time zone of events that have none specified; recommended for "
2537
  "Google Calendar feeds"
2538
 
2539
+ #: public/admin/feed_row.php:87 public/admin/plugins/ics/display_feeds.php:75
2540
  msgid "Assign default time zone to events in UTC"
2541
  msgstr "Assign default time zone to events in UTC"
2542
 
2543
+ #: public/admin/feed_row.php:104
2544
  msgid "Refreshing&#8230;"
2545
  msgstr "Refreshing&#8230;"
2546
 
2547
+ #: public/admin/feed_row.php:106
2548
  msgid "Refresh"
2549
  msgstr "Refresh"
2550
 
2551
+ #: public/admin/feed_row.php:119
2552
  msgid "Removing&#8230;"
2553
  msgstr "Removing&#8230;"
2554
 
2555
+ #: public/admin/feed_row.php:121
2556
  msgid "Remove"
2557
  msgstr "Remove"
2558
 
2576
  msgid "Check for new events"
2577
  msgstr "Check for new events"
2578
 
2579
+ #: public/admin/plugins/ics/display_feeds.php:45
2580
  msgid "Allow comments on imported events"
2581
  msgstr "Allow comments on imported events"
2582
 
2583
+ #: public/admin/plugins/ics/display_feeds.php:52
2584
  msgid "Show map on imported events"
2585
  msgstr "Show map on imported events"
2586
 
2587
+ #: public/admin/plugins/ics/display_feeds.php:59
2588
  msgid ""
2589
  "Import any tags/categories provided by feed, in addition those selected above"
2590
  msgstr ""
2591
  "Import any tags/categories provided by feed, in addition those selected above"
2592
 
2593
+ #: public/admin/plugins/ics/display_feeds.php:93
2594
  msgid "Add new subscription"
2595
  msgstr "Add new subscription"
2596
 
2597
+ #: public/admin/plugins/ics/display_feeds.php:96
2598
+ msgid "Update subscription"
2599
+ msgstr "Update subscription"
2600
+
2601
  #: public/admin/row_custom.php:3
2602
  msgid "Custom dates:"
2603
  msgstr "Custom dates:"
2898
  msgid "All-in-One Event Calendar by Time.ly"
2899
  msgstr "All-in-One Event Calendar by Time.ly"
2900
 
2901
+ #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.3.0) #-#-#-#-#
2902
  #. Plugin URI of the plugin/theme
2903
+ #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.3.0) #-#-#-#-#
2904
  #. Author URI of the plugin/theme
2905
  msgid "http://time.ly/"
2906
  msgstr "http://time.ly/"
language/all-in-one-event-calendar.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.2.1\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
- "POT-Creation-Date: 2015-03-25 15:07:54+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -12,19 +12,11 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: app/controller/extension-license.php:54 app/view/admin/add-ons.php:26
16
  #: app/view/admin/add-ons.php:27
17
  msgid "Add-ons"
18
  msgstr ""
19
 
20
- #: app/controller/extension-license.php:56
21
- msgid "Licenses"
22
- msgstr ""
23
-
24
- #: app/controller/extension-license.php:60
25
- msgid "Licences"
26
- msgstr ""
27
-
28
  #: app/controller/front.php:343
29
  msgid ""
30
  "Your active calendar theme could not be properly initialized. The default "
@@ -37,7 +29,7 @@ msgstr ""
37
  msgid "Calendar Themes"
38
  msgstr ""
39
 
40
- #: app/controller/front.php:920
41
  msgid ""
42
  "Your database is found to be corrupt. Likely previous update has failed. "
43
  "Please restore All-in-One Event Calendar tables from a backup and retry."
@@ -48,97 +40,97 @@ msgstr ""
48
  msgid "You must choose the Calendar page before using the Super Widget"
49
  msgstr ""
50
 
51
- #: app/controller/javascript.php:386
52
  msgid "This feed is already being imported."
53
  msgstr ""
54
 
55
- #: app/controller/javascript.php:389
56
  msgid "Please enter a valid iCalendar URL."
57
  msgstr ""
58
 
59
- #: app/controller/javascript.php:392
60
  msgid "Please enter a valid email address."
61
  msgstr ""
62
 
63
- #: app/controller/javascript.php:394
64
  msgid "Choose Image"
65
  msgstr ""
66
 
67
- #: app/controller/javascript.php:397
68
  msgid "The value you have entered is not a valid CSS length."
69
  msgstr ""
70
 
71
- #: app/controller/javascript.php:400
72
  msgid ""
73
  "Are you sure you want to reset your theme options to their default values?"
74
  msgstr ""
75
 
76
- #: app/controller/javascript.php:403
77
  msgid ""
78
  "Please enter a valid latitude. A valid latitude is comprised between +90 and "
79
  "-90."
80
  msgstr ""
81
 
82
- #: app/controller/javascript.php:406
83
  msgid ""
84
  "Please enter a valid longitude. A valid longitude is comprised between +180 "
85
  "and -180."
86
  msgstr ""
87
 
88
- #: app/controller/javascript.php:409
89
  msgid ""
90
  "When the \"Input coordinates\" checkbox is checked, \"Latitude\" is a "
91
  "required field."
92
  msgstr ""
93
 
94
- #: app/controller/javascript.php:412
95
  msgid ""
96
  "When the \"Input coordinates\" checkbox is checked, \"Longitude\" is a "
97
  "required field."
98
  msgstr ""
99
 
100
- #: app/controller/javascript.php:415
101
  msgid ""
102
  "The URL you have entered in the <b>Organizer Contact Info</b> &gt; "
103
- "<b>External URL</b> seems to be invalid."
104
  msgstr ""
105
 
106
- #: app/controller/javascript.php:418
107
  msgid ""
108
  "The URL you have entered in the <b>Event Cost and Tickets</b> &gt; <b>Buy "
109
  "Tickets URL</b> seems to be invalid."
110
  msgstr ""
111
 
112
- #: app/controller/javascript.php:421
113
  msgid ""
114
  "Please remember that URLs must start with either \"http://\" or \"https://\"."
115
  msgstr ""
116
 
117
- #: app/controller/javascript.php:424
118
  msgid "Loading&hellip;"
119
  msgstr ""
120
 
121
- #: app/controller/javascript.php:454 app/view/admin/widget-creator.php:139
122
  msgid "Preview:"
123
  msgstr ""
124
 
125
- #: app/controller/javascript.php:455
126
  msgid ""
127
  "Loading preview&nbsp;<i class=\"ai1ec-fa ai1ec-fa-spin ai1ec-fa-spinner\"></"
128
  "i>"
129
  msgstr ""
130
 
131
- #: app/controller/javascript.php:459
132
  msgid ""
133
  "Something went wrong while fetching events.<br>The request status is: %STATUS"
134
  "% <br>The error thrown was: %ERROR%"
135
  msgstr ""
136
 
137
- #: app/controller/javascript.php:466
138
  msgid "The end date can't be earlier than the start date."
139
  msgstr ""
140
 
141
- #: app/controller/javascript.php:467
142
  msgid "For week and day view, you must select an interval of at least 6 hours."
143
  msgstr ""
144
 
@@ -150,82 +142,82 @@ msgstr ""
150
  msgid "Base Event"
151
  msgstr ""
152
 
153
- #: app/model/settings.php:380
154
  #: lib/html/element/setting/calendar-page-selector.php:50
155
  msgid "Calendar page"
156
  msgstr ""
157
 
158
- #: app/model/settings.php:390
159
  msgid "Week starts on"
160
  msgstr ""
161
 
162
- #: app/model/settings.php:403
163
  msgid "Available views"
164
  msgstr ""
165
 
166
- #: app/model/settings.php:411
167
  msgid "Agenda"
168
  msgid_plural "Agenda"
169
  msgstr[0] ""
170
  msgstr[1] ""
171
 
172
- #: app/model/settings.php:422
173
  msgid "Day"
174
  msgid_plural "Day"
175
  msgstr[0] ""
176
  msgstr[1] ""
177
 
178
- #: app/model/settings.php:433
179
  msgid "Month"
180
  msgid_plural "Month"
181
  msgstr[0] ""
182
  msgstr[1] ""
183
 
184
- #: app/model/settings.php:444
185
  msgid "Week"
186
  msgid_plural "Week"
187
  msgstr[0] ""
188
  msgstr[1] ""
189
 
190
- #: app/model/settings.php:458
191
  msgid "Timezone"
192
  msgstr ""
193
 
194
- #: app/model/settings.php:471
195
  msgid "Preselected calendar filters"
196
  msgstr ""
197
 
198
- #: app/model/settings.php:472 app/view/calendar/widget.php:128
199
  msgid ""
200
  "To clear, hold &#8984;/<abbr class=\"initialism\">CTRL</abbr> and click "
201
  "selection."
202
  msgstr ""
203
 
204
- #: app/model/settings.php:487
205
  msgid "Default calendar start date (optional)"
206
  msgstr ""
207
 
208
- #: app/model/settings.php:498
209
  msgid "Agenda pages show at most"
210
  msgstr ""
211
 
212
- #: app/model/settings.php:511
213
  msgid "Week/Day view starts at"
214
  msgstr ""
215
 
216
- #: app/model/settings.php:524
217
  msgid "Week/Day view ends at"
218
  msgstr ""
219
 
220
- #: app/model/settings.php:537
221
  msgid "<strong>Word-wrap event stubs</strong> in Month view"
222
  msgstr ""
223
 
224
- #: app/model/settings.php:540
225
  msgid "Only applies to events that span a single day."
226
  msgstr ""
227
 
228
- #: app/model/settings.php:552
229
  msgid ""
230
  "In <span class=\"ai1ec-tooltip-toggle\"\n"
231
  "\t\t\t\t\t\tdata-original-title=\"These include Agenda view,\n"
@@ -234,127 +226,127 @@ msgid ""
234
  "\t\t\t\t\t\tfrom last day shown</strong>"
235
  msgstr ""
236
 
237
- #: app/model/settings.php:568
238
  msgid "Keep all events <strong>expanded</strong> in Agenda view"
239
  msgstr ""
240
 
241
- #: app/model/settings.php:580
242
  msgid "<strong>Show year</strong> in calendar date labels"
243
  msgstr ""
244
 
245
- #: app/model/settings.php:592
246
  msgid "<strong>Show location in event titles</strong> in calendar views"
247
  msgstr ""
248
 
249
- #: app/model/settings.php:604
250
  msgid "<strong>Exclude</strong> events from search results"
251
  msgstr ""
252
 
253
- #: app/model/settings.php:616
254
  msgid ""
255
  "Hide <strong>Subscribe</strong>/<strong>Add to Calendar</strong> buttons in "
256
  "calendar and single event views "
257
  msgstr ""
258
 
259
- #: app/model/settings.php:628
260
  msgid "Hide <strong>Get a Timely Calendar</strong> button"
261
  msgstr ""
262
 
263
- #: app/model/settings.php:640
264
  msgid " Hide <strong>Google Maps</strong> until clicked"
265
  msgstr ""
266
 
267
- #: app/model/settings.php:652
268
  msgid ""
269
  " <strong>Affix filter menu</strong> to top of window when it scrolls out of "
270
  "view"
271
  msgstr ""
272
 
273
- #: app/model/settings.php:655
274
  msgid "Only applies to first visible calendar found on the page."
275
  msgstr ""
276
 
277
- #: app/model/settings.php:667
278
  msgid "Offset affixed filter bar vertically by"
279
  msgstr ""
280
 
281
- #: app/model/settings.php:682
282
  msgid "Wide screens only (&#8805; 1200px)"
283
  msgstr ""
284
 
285
- #: app/model/settings.php:697
286
  msgid "Tablets only (< 980px)"
287
  msgstr ""
288
 
289
- #: app/model/settings.php:712
290
  msgid "Phones only (< 768px)"
291
  msgstr ""
292
 
293
- #: app/model/settings.php:725
294
  msgid "Strict compatibility content filtering"
295
  msgstr ""
296
 
297
- #: app/model/settings.php:737
298
  msgid " <strong>Hide featured image</strong> from event details page"
299
  msgstr ""
300
 
301
- #: app/model/settings.php:740
302
  msgid ""
303
  "Select this option if your theme already displays each post's featured image."
304
  msgstr ""
305
 
306
- #: app/model/settings.php:751
307
  msgid "Input dates in this format"
308
  msgstr ""
309
 
310
- #: app/model/settings.php:756
311
  msgid "Default (d/m/yyyy)"
312
  msgstr ""
313
 
314
- #: app/model/settings.php:760
315
  msgid "US (m/d/yyyy)"
316
  msgstr ""
317
 
318
- #: app/model/settings.php:764
319
  msgid "ISO 8601 (yyyy-m-d)"
320
  msgstr ""
321
 
322
- #: app/model/settings.php:768
323
  msgid "Dotted (m.d.yyyy)"
324
  msgstr ""
325
 
326
- #: app/model/settings.php:780
327
  msgid " Use <strong>24h time</strong> in time pickers"
328
  msgstr ""
329
 
330
- #: app/model/settings.php:791
331
  msgid "<strong>Disable address autocomplete</strong> function"
332
  msgstr ""
333
 
334
- #: app/model/settings.php:802
335
  msgid ""
336
  "Use the configured <strong>region</strong> (WordPress locale) to bias the "
337
  "address autocomplete function "
338
  msgstr ""
339
 
340
- #: app/model/settings.php:818
341
  msgid ""
342
  " Show the old <strong>Post Your Event</strong> button above the calendar to "
343
  "privileged users"
344
  msgstr ""
345
 
346
- #: app/model/settings.php:821
347
  msgid ""
348
  "Install the <a target=\"_blank\" href=\"http://time.ly/\">Interactive "
349
  "Frontend Extension</a> for the <strong>frontend Post Your Event form</"
350
  "strong>."
351
  msgstr ""
352
 
353
- #: app/model/settings.php:842
354
  msgid "Move calendar into this DOM element"
355
  msgstr ""
356
 
357
- #: app/model/settings.php:844
358
  msgid ""
359
  "Optional. Use this JavaScript-based shortcut to place the\n"
360
  "\t\t\t\t\t\tcalendar a DOM element other than the usual page content "
@@ -368,57 +360,57 @@ msgid ""
368
  "\t\t\t\t\t\tby the calendar."
369
  msgstr ""
370
 
371
- #: app/model/settings.php:863
372
  msgid ""
373
  "<strong>Skip <tt>in_the_loop()</tt> check </strong> that protects against "
374
  "multiple calendar output"
375
  msgstr ""
376
 
377
- #: app/model/settings.php:866
378
  msgid ""
379
  "Try enabling this option if your calendar does not appear on the calendar "
380
  "page. It is needed for compatibility with a small number of themes that call "
381
  "<tt>the_content()</tt> from outside of The Loop. Leave disabled otherwise."
382
  msgstr ""
383
 
384
- #: app/model/settings.php:878
385
  msgid "Disable <strong>gzip</strong> compression."
386
  msgstr ""
387
 
388
- #: app/model/settings.php:881
389
  msgid ""
390
  "Use this option if calendar is unresponsive. <a href=\"http://support.time."
391
  "ly/disable-gzip-compression/\">Read more</a> about the issue. (From version "
392
  "2.1 onwards, gzip is disabled by default for maximum compatibility.)"
393
  msgstr ""
394
 
395
- #: app/model/settings.php:893
396
  msgid "Use frontend rendering."
397
  msgstr ""
398
 
399
- #: app/model/settings.php:896
400
  msgid ""
401
  "Renders calendar views on the client rather than the server; can improve "
402
  "performance."
403
  msgstr ""
404
 
405
- #: app/model/settings.php:908
406
  msgid ""
407
  "<strong>Link CSS</strong> in <code>&lt;head&gt;</code> section when file "
408
  "cache is unavailable."
409
  msgstr ""
410
 
411
- #: app/model/settings.php:911
412
  msgid ""
413
  "Use this option if file cache is unavailable and you would prefer to serve "
414
  "CSS as a link rather than have it output inline."
415
  msgstr ""
416
 
417
- #: app/model/settings.php:923
418
  msgid "Current <strong>robots.txt</strong> on this site"
419
  msgstr ""
420
 
421
- #: app/model/settings.php:927
422
  msgid ""
423
  "The Robot Exclusion Standard, also known as the Robots Exclusion Protocol "
424
  "or\n"
@@ -432,21 +424,21 @@ msgid ""
432
  "your root WordPress directory."
433
  msgstr ""
434
 
435
- #: app/model/settings.php:944
436
  msgid ""
437
  "<strong>Publicize, promote, and share my events</strong> marked as public on "
438
  "the Timely network. (<a href=\"%s\" target=\"_blank\">Learn more &#187;</a>)"
439
  msgstr ""
440
 
441
- #: app/model/settings.php:967
442
  msgid "Templates cache improves site performance"
443
  msgstr ""
444
 
445
- #: app/model/settings.php:980
446
  msgid "Display events in <strong>calendar time zone</strong>"
447
  msgstr ""
448
 
449
- #: app/model/settings.php:983
450
  msgid ""
451
  "If this box is checked events will appear in the calendar time zone with "
452
  "time zone information displayed on the event details page."
@@ -456,15 +448,11 @@ msgstr ""
456
  msgid "Event Details"
457
  msgstr ""
458
 
459
- #: app/view/admin/add-new-event.php:47
460
- msgid "Banner Image"
461
- msgstr ""
462
-
463
- #: app/view/admin/add-new-event.php:377
464
  msgid "Set banner image"
465
  msgstr ""
466
 
467
- #: app/view/admin/add-new-event.php:378
468
  msgid "Remove banner image"
469
  msgstr ""
470
 
@@ -499,10 +487,14 @@ msgstr ""
499
  msgid "Event date/time"
500
  msgstr ""
501
 
502
- #: app/view/admin/all-events.php:100
503
  msgid "Show All "
504
  msgstr ""
505
 
 
 
 
 
506
  #: app/view/admin/calendar-feeds.php:27 app/view/admin/calendar-feeds.php:28
507
  msgid "Calendar Feeds"
508
  msgstr ""
@@ -550,104 +542,104 @@ msgid ""
550
  "400&times;400 pixels."
551
  msgstr ""
552
 
553
- #: app/view/admin/get-repeat-box.php:65
554
  msgid "times"
555
  msgstr ""
556
 
557
- #: app/view/admin/get-repeat-box.php:131
558
  msgid "Recurrence rule cannot be empty."
559
  msgstr ""
560
 
561
- #: app/view/admin/get-repeat-box.php:149
562
  msgid "Recurrence rule was not provided."
563
  msgstr ""
564
 
565
- #: app/view/admin/get-repeat-box.php:176
566
  msgid "Never"
567
  msgstr ""
568
 
569
- #: app/view/admin/get-repeat-box.php:177
570
  msgid "After"
571
  msgstr ""
572
 
573
- #: app/view/admin/get-repeat-box.php:178 public/admin/box_repeat.php:93
574
  msgid "On date"
575
  msgstr ""
576
 
577
- #: app/view/admin/get-repeat-box.php:214
578
  msgid "day(s)"
579
  msgstr ""
580
 
581
- #: app/view/admin/get-repeat-box.php:296
582
  msgid "week(s)"
583
  msgstr ""
584
 
585
- #: app/view/admin/get-repeat-box.php:381 app/view/admin/get-repeat-box.php:448
586
- #: lib/recurrence/rule.php:279
587
  msgid "last"
588
  msgstr ""
589
 
590
- #: app/view/admin/get-repeat-box.php:389
591
  msgid "month(s)"
592
  msgstr ""
593
 
594
- #: app/view/admin/get-repeat-box.php:443
595
  msgid "first"
596
  msgstr ""
597
 
598
- #: app/view/admin/get-repeat-box.php:444
599
  msgid "second"
600
  msgstr ""
601
 
602
- #: app/view/admin/get-repeat-box.php:445
603
  msgid "third"
604
  msgstr ""
605
 
606
- #: app/view/admin/get-repeat-box.php:446
607
  msgid "fourth"
608
  msgstr ""
609
 
610
- #: app/view/admin/get-repeat-box.php:458
611
  msgid "Sunday"
612
  msgstr ""
613
 
614
- #: app/view/admin/get-repeat-box.php:459
615
  msgid "Monday"
616
  msgstr ""
617
 
618
- #: app/view/admin/get-repeat-box.php:460
619
  msgid "Tuesday"
620
  msgstr ""
621
 
622
- #: app/view/admin/get-repeat-box.php:461
623
  msgid "Wednesday"
624
  msgstr ""
625
 
626
- #: app/view/admin/get-repeat-box.php:462
627
  msgid "Thursday"
628
  msgstr ""
629
 
630
- #: app/view/admin/get-repeat-box.php:463
631
  msgid "Friday"
632
  msgstr ""
633
 
634
- #: app/view/admin/get-repeat-box.php:464
635
  msgid "Saturday"
636
  msgstr ""
637
 
638
- #: app/view/admin/get-repeat-box.php:466
639
  msgid "day"
640
  msgstr ""
641
 
642
- #: app/view/admin/get-repeat-box.php:467
643
  msgid "weekday"
644
  msgstr ""
645
 
646
- #: app/view/admin/get-repeat-box.php:468
647
  msgid "weekend day"
648
  msgstr ""
649
 
650
- #: app/view/admin/get-repeat-box.php:534
651
  msgid "year(s)"
652
  msgstr ""
653
 
@@ -655,6 +647,10 @@ msgstr ""
655
  msgid "<a href=\"%s\">Settings</a>"
656
  msgstr ""
657
 
 
 
 
 
658
  #: app/view/admin/organize.php:100
659
  msgid "Organize Events"
660
  msgstr ""
@@ -711,7 +707,6 @@ msgid "Cache Report"
711
  msgstr ""
712
 
713
  #: app/view/admin/settings.php:170
714
- #: public/admin/plugins/ics/display_feeds.php:24
715
  msgid "Save Settings"
716
  msgstr ""
717
 
@@ -820,21 +815,21 @@ msgid ""
820
  "inform him to configure calendar views."
821
  msgstr ""
822
 
823
- #: app/view/calendar/page.php:75
824
  msgid ""
825
  "Calendar was unable to initialize %s view and has reverted to Agenda view. "
826
  "Please check if you have installed the latest versions of calendar add-ons."
827
  msgstr ""
828
 
829
- #: app/view/calendar/page.php:258
830
  msgid "Subscribe to filtered calendar"
831
  msgstr ""
832
 
833
- #: app/view/calendar/page.php:259
834
  msgid "Subscribe"
835
  msgstr ""
836
 
837
- #: app/view/calendar/page.php:260 app/view/event/single.php:115
838
  msgid "Get a Timely Calendar"
839
  msgstr ""
840
 
@@ -898,58 +893,59 @@ msgstr ""
898
  msgid "Tags"
899
  msgstr ""
900
 
901
- #: app/view/calendar/view/agenda.php:119
902
  msgid "Collapse All"
903
  msgstr ""
904
 
905
- #: app/view/calendar/view/agenda.php:120
906
  msgid "Expand All"
907
  msgstr ""
908
 
909
- #: app/view/calendar/view/agenda.php:143
910
  msgid "There are no upcoming events to display at this time."
911
  msgstr ""
912
 
913
- #: app/view/calendar/view/agenda.php:144 app/view/calendar/widget.php:373
 
914
  msgid "Edit"
915
  msgstr ""
916
 
917
- #: app/view/calendar/view/agenda.php:145
918
  msgid "Read more"
919
  msgstr ""
920
 
921
- #: app/view/calendar/view/agenda.php:146
922
  msgid "Categories:"
923
  msgstr ""
924
 
925
- #: app/view/calendar/view/agenda.php:147 lib/theme/list.php:320
926
  #: public/admin/themes.php:29
927
  msgid "Tags:"
928
  msgstr ""
929
 
930
- #: app/view/calendar/view/agenda.php:148 app/view/calendar/view/month.php:81
931
- #: app/view/calendar/view/oneday.php:100 app/view/calendar/view/week.php:112
932
  #: app/view/calendar/widget.php:374
933
  msgid "@ %s"
934
  msgstr ""
935
 
936
- #: app/view/calendar/view/oneday.php:74 app/view/calendar/view/week.php:67
937
  msgid "g a"
938
  msgstr ""
939
 
940
- #: app/view/calendar/view/oneday.php:97 app/view/calendar/view/week.php:109
941
  msgid "Reveal full day"
942
  msgstr ""
943
 
944
- #: app/view/calendar/view/oneday.php:98 app/view/calendar/view/week.php:110
945
  msgid "All-day"
946
  msgstr ""
947
 
948
- #: app/view/calendar/view/oneday.php:99 app/view/calendar/view/week.php:111
949
  msgid "Now:"
950
  msgstr ""
951
 
952
- #: app/view/calendar/view/week.php:61
953
  msgid "Week of %s"
954
  msgstr ""
955
 
@@ -1097,18 +1093,18 @@ msgstr ""
1097
  msgid "Free"
1098
  msgstr ""
1099
 
1100
- #: app/view/event/single.php:144
1101
  msgid "Edit this occurrence (%s)"
1102
  msgstr ""
1103
 
1104
- #: app/view/event/single.php:159
1105
  msgid ""
1106
  "This post was replicated from another site's <a href=\"%s\" title="
1107
  "\"iCalendar feed\"><i class=\"ai1ec-fa ai1ec-fa-calendar\"></i> calendar "
1108
  "feed</a>."
1109
  msgstr ""
1110
 
1111
- #: app/view/event/single.php:170
1112
  msgid "View original"
1113
  msgstr ""
1114
 
@@ -1162,64 +1158,60 @@ msgstr ""
1162
  msgid "Another import process in progress. Please try again later."
1163
  msgstr ""
1164
 
1165
- #: lib/calendar-feed/ics.php:173
1166
  msgid ""
1167
  "A system error has prevented calendar data from being fetched. Something is "
1168
  "preventing the plugin from functioning correctly. This message should "
1169
  "provide a clue: %s"
1170
  msgstr ""
1171
 
1172
- #: lib/calendar-feed/ics.php:180
1173
  msgid ""
1174
  "Calendar data could not be fetched. If your URL is valid and contains an "
1175
  "iCalendar resource, this is likely the result of a temporary server error "
1176
  "and time may resolve this issue"
1177
  msgstr ""
1178
 
1179
- #: lib/calendar-feed/ics.php:190
1180
- msgid "No events were found"
1181
- msgstr ""
1182
-
1183
- #: lib/calendar-feed/ics.php:199
1184
  msgid "Imported %s event"
1185
  msgid_plural "Imported %s events"
1186
  msgstr[0] ""
1187
  msgstr[1] ""
1188
 
1189
- #: lib/calendar-feed/ics.php:205 lib/calendar-feed/ics.php:678
1190
  msgid "Invalid ICS feed ID"
1191
  msgstr ""
1192
 
1193
- #: lib/calendar-feed/ics.php:351
1194
  msgid "Categories (optional)"
1195
  msgstr ""
1196
 
1197
- #: lib/calendar-feed/ics.php:368
1198
  msgid ""
1199
  "Do you want to keep the events imported from the calendar or remove them?"
1200
  msgstr ""
1201
 
1202
- #: lib/calendar-feed/ics.php:374
1203
  msgid "Removing ICS Feed"
1204
  msgstr ""
1205
 
1206
- #: lib/calendar-feed/ics.php:377
1207
  msgid "Keep Events"
1208
  msgstr ""
1209
 
1210
- #: lib/calendar-feed/ics.php:380
1211
  msgid "Remove Events"
1212
  msgstr ""
1213
 
1214
- #: lib/calendar-feed/ics.php:516
1215
  msgid "Oh, submission was not accepted."
1216
  msgstr ""
1217
 
1218
- #: lib/calendar-feed/ics.php:670
1219
  msgid "Deleted %d events"
1220
  msgstr ""
1221
 
1222
- #: lib/calendar-feed/ics.php:706
1223
  msgid "Feed deleted"
1224
  msgstr ""
1225
 
@@ -1419,11 +1411,11 @@ msgstr ""
1419
  msgid "Error Details:"
1420
  msgstr ""
1421
 
1422
- #: lib/factory/html.php:128
1423
  msgid "Choose a date using calendar"
1424
  msgstr ""
1425
 
1426
- #: lib/factory/html.php:273
1427
  msgid "Tags (optional)"
1428
  msgstr ""
1429
 
@@ -1703,102 +1695,102 @@ msgctxt "Event feed taxonomy (singular)"
1703
  msgid "Event Feed"
1704
  msgstr ""
1705
 
1706
- #: lib/post/custom-type.php:279
1707
  msgid ""
1708
  "All Events <span class=\"update-plugins count-%d\" title=\"%d Pending Events"
1709
  "\"><span class=\"update-count\">%d</span></span>"
1710
  msgstr ""
1711
 
1712
- #: lib/post/custom-type.php:290
1713
  msgid "All Events"
1714
  msgstr ""
1715
 
1716
- #: lib/recurrence/rule.php:225 lib/recurrence/rule.php:234
1717
- #: lib/recurrence/rule.php:242
1718
  msgctxt "Recurrence editor - weekly tab"
1719
  msgid "on"
1720
  msgstr ""
1721
 
1722
- #: lib/recurrence/rule.php:230 lib/recurrence/rule.php:259
1723
- #: lib/recurrence/rule.php:307
1724
  msgid "and"
1725
  msgstr ""
1726
 
1727
- #: lib/recurrence/rule.php:255 lib/recurrence/rule.php:262
1728
- #: lib/recurrence/rule.php:268 lib/recurrence/rule.php:289
1729
  msgctxt "Recurrence editor - monthly tab"
1730
  msgid "on"
1731
  msgstr ""
1732
 
1733
- #: lib/recurrence/rule.php:255 lib/recurrence/rule.php:262
1734
- #: lib/recurrence/rule.php:268
1735
  msgid "of the month"
1736
  msgstr ""
1737
 
1738
- #: lib/recurrence/rule.php:302 lib/recurrence/rule.php:310
1739
- #: lib/recurrence/rule.php:317
1740
  msgctxt "Recurrence editor - yearly tab"
1741
  msgid "on"
1742
  msgstr ""
1743
 
1744
- #: lib/recurrence/rule.php:357 public/admin/box_repeat.php:16
1745
  #: public/admin/cron_freq.php:9
1746
  msgid "Daily"
1747
  msgstr ""
1748
 
1749
- #: lib/recurrence/rule.php:360
1750
  msgid "Every other day"
1751
  msgstr ""
1752
 
1753
- #: lib/recurrence/rule.php:363
1754
  msgid "Every %d days"
1755
  msgstr ""
1756
 
1757
- #: lib/recurrence/rule.php:372 public/admin/box_repeat.php:21
1758
  msgid "Weekly"
1759
  msgstr ""
1760
 
1761
- #: lib/recurrence/rule.php:375
1762
  msgid "Every other week"
1763
  msgstr ""
1764
 
1765
- #: lib/recurrence/rule.php:378
1766
  msgid "Every %d weeks"
1767
  msgstr ""
1768
 
1769
- #: lib/recurrence/rule.php:387 public/admin/box_repeat.php:26
1770
  msgid "Monthly"
1771
  msgstr ""
1772
 
1773
- #: lib/recurrence/rule.php:390
1774
  msgid "Every other month"
1775
  msgstr ""
1776
 
1777
- #: lib/recurrence/rule.php:393
1778
  msgid "Every %d months"
1779
  msgstr ""
1780
 
1781
- #: lib/recurrence/rule.php:402 public/admin/box_repeat.php:31
1782
  msgid "Yearly"
1783
  msgstr ""
1784
 
1785
- #: lib/recurrence/rule.php:405
1786
  msgid "Every other year"
1787
  msgstr ""
1788
 
1789
- #: lib/recurrence/rule.php:408
1790
  msgid "Every %d years"
1791
  msgstr ""
1792
 
1793
- #: lib/recurrence/rule.php:446
1794
  msgid "until %s"
1795
  msgstr ""
1796
 
1797
- #: lib/recurrence/rule.php:456
1798
  msgid "for %d occurrences"
1799
  msgstr ""
1800
 
1801
- #: lib/recurrence/rule.php:460
1802
  msgid "forever"
1803
  msgstr ""
1804
 
@@ -1980,7 +1972,7 @@ msgid "E-mail:"
1980
  msgstr ""
1981
 
1982
  #: public/admin/box_event_contact.php:56
1983
- msgid "External URL:"
1984
  msgstr ""
1985
 
1986
  #: public/admin/box_event_cost.php:6
@@ -2039,15 +2031,15 @@ msgstr ""
2039
  msgid "Register this event with Eventbrite.com?"
2040
  msgstr ""
2041
 
2042
- #: public/admin/box_eventbrite.php:12 public/admin/feed_row.php:29
2043
- #: public/admin/feed_row.php:39 public/admin/feed_row.php:50
2044
- #: public/admin/feed_row.php:61 public/admin/feed_row.php:73
2045
  msgid "Yes"
2046
  msgstr ""
2047
 
2048
- #: public/admin/box_eventbrite.php:14 public/admin/feed_row.php:31
2049
- #: public/admin/feed_row.php:41 public/admin/feed_row.php:52
2050
- #: public/admin/feed_row.php:63 public/admin/feed_row.php:75
2051
  msgid "No"
2052
  msgstr ""
2053
 
@@ -2148,7 +2140,7 @@ msgid "Ending after"
2148
  msgstr ""
2149
 
2150
  #: public/admin/box_repeat.php:109
2151
- #: public/admin/plugins/ics/display_feeds.php:92
2152
  msgid "Please wait&#8230;"
2153
  msgstr ""
2154
 
@@ -2157,6 +2149,7 @@ msgid "Apply"
2157
  msgstr ""
2158
 
2159
  #: public/admin/box_repeat.php:116
 
2160
  msgid "Cancel"
2161
  msgstr ""
2162
 
@@ -2300,59 +2293,59 @@ msgstr ""
2300
  msgid "Twice Daily"
2301
  msgstr ""
2302
 
2303
- #: public/admin/feed_row.php:3 public/admin/plugins/ics/display_feeds.php:34
2304
  msgid "iCalendar/.ics Feed URL:"
2305
  msgstr ""
2306
 
2307
- #: public/admin/feed_row.php:12
2308
  msgid "Event categories:"
2309
  msgstr ""
2310
 
2311
- #: public/admin/feed_row.php:18
2312
  msgid "Tag with"
2313
  msgstr ""
2314
 
2315
- #: public/admin/feed_row.php:26
2316
  msgid "Allow comments"
2317
  msgstr ""
2318
 
2319
- #: public/admin/feed_row.php:36
2320
  msgid "Show map"
2321
  msgstr ""
2322
 
2323
- #: public/admin/feed_row.php:47
2324
  msgid "Keep original events categories and tags"
2325
  msgstr ""
2326
 
2327
- #: public/admin/feed_row.php:58 public/admin/plugins/ics/display_feeds.php:74
2328
  msgid ""
2329
  "On refresh, preserve previously imported events that are missing from the "
2330
  "feed"
2331
  msgstr ""
2332
 
2333
- #: public/admin/feed_row.php:68 public/admin/plugins/ics/display_feeds.php:81
2334
  msgid ""
2335
  "Guesses the time zone of events that have none specified; recommended for "
2336
  "Google Calendar feeds"
2337
  msgstr ""
2338
 
2339
- #: public/admin/feed_row.php:69 public/admin/plugins/ics/display_feeds.php:82
2340
  msgid "Assign default time zone to events in UTC"
2341
  msgstr ""
2342
 
2343
- #: public/admin/feed_row.php:86
2344
  msgid "Refreshing&#8230;"
2345
  msgstr ""
2346
 
2347
- #: public/admin/feed_row.php:88
2348
  msgid "Refresh"
2349
  msgstr ""
2350
 
2351
- #: public/admin/feed_row.php:95
2352
  msgid "Removing&#8230;"
2353
  msgstr ""
2354
 
2355
- #: public/admin/feed_row.php:97
2356
  msgid "Remove"
2357
  msgstr ""
2358
 
@@ -2372,23 +2365,27 @@ msgstr ""
2372
  msgid "Check for new events"
2373
  msgstr ""
2374
 
2375
- #: public/admin/plugins/ics/display_feeds.php:52
2376
  msgid "Allow comments on imported events"
2377
  msgstr ""
2378
 
2379
- #: public/admin/plugins/ics/display_feeds.php:59
2380
  msgid "Show map on imported events"
2381
  msgstr ""
2382
 
2383
- #: public/admin/plugins/ics/display_feeds.php:66
2384
  msgid ""
2385
  "Import any tags/categories provided by feed, in addition those selected above"
2386
  msgstr ""
2387
 
2388
- #: public/admin/plugins/ics/display_feeds.php:94
2389
  msgid "Add new subscription"
2390
  msgstr ""
2391
 
 
 
 
 
2392
  #: public/admin/row_custom.php:3
2393
  msgid "Custom dates:"
2394
  msgstr ""
@@ -2687,9 +2684,9 @@ msgstr ""
2687
  msgid "All-in-One Event Calendar by Time.ly"
2688
  msgstr ""
2689
 
2690
- #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.2.1) #-#-#-#-#
2691
  #. Plugin URI of the plugin/theme
2692
- #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.2.1) #-#-#-#-#
2693
  #. Author URI of the plugin/theme
2694
  msgid "http://time.ly/"
2695
  msgstr ""
2
  # This file is distributed under the same license as the All-in-One Event Calendar by Time.ly package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: All-in-One Event Calendar by Time.ly 2.3.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-event-calendar\n"
7
+ "POT-Creation-Date: 2015-08-18 17:34:54+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: app/controller/extension-license.php:53 app/view/admin/add-ons.php:26
16
  #: app/view/admin/add-ons.php:27
17
  msgid "Add-ons"
18
  msgstr ""
19
 
 
 
 
 
 
 
 
 
20
  #: app/controller/front.php:343
21
  msgid ""
22
  "Your active calendar theme could not be properly initialized. The default "
29
  msgid "Calendar Themes"
30
  msgstr ""
31
 
32
+ #: app/controller/front.php:936
33
  msgid ""
34
  "Your database is found to be corrupt. Likely previous update has failed. "
35
  "Please restore All-in-One Event Calendar tables from a backup and retry."
40
  msgid "You must choose the Calendar page before using the Super Widget"
41
  msgstr ""
42
 
43
+ #: app/controller/javascript.php:389
44
  msgid "This feed is already being imported."
45
  msgstr ""
46
 
47
+ #: app/controller/javascript.php:392
48
  msgid "Please enter a valid iCalendar URL."
49
  msgstr ""
50
 
51
+ #: app/controller/javascript.php:395
52
  msgid "Please enter a valid email address."
53
  msgstr ""
54
 
55
+ #: app/controller/javascript.php:397
56
  msgid "Choose Image"
57
  msgstr ""
58
 
59
+ #: app/controller/javascript.php:400
60
  msgid "The value you have entered is not a valid CSS length."
61
  msgstr ""
62
 
63
+ #: app/controller/javascript.php:403
64
  msgid ""
65
  "Are you sure you want to reset your theme options to their default values?"
66
  msgstr ""
67
 
68
+ #: app/controller/javascript.php:406
69
  msgid ""
70
  "Please enter a valid latitude. A valid latitude is comprised between +90 and "
71
  "-90."
72
  msgstr ""
73
 
74
+ #: app/controller/javascript.php:409
75
  msgid ""
76
  "Please enter a valid longitude. A valid longitude is comprised between +180 "
77
  "and -180."
78
  msgstr ""
79
 
80
+ #: app/controller/javascript.php:412
81
  msgid ""
82
  "When the \"Input coordinates\" checkbox is checked, \"Latitude\" is a "
83
  "required field."
84
  msgstr ""
85
 
86
+ #: app/controller/javascript.php:415
87
  msgid ""
88
  "When the \"Input coordinates\" checkbox is checked, \"Longitude\" is a "
89
  "required field."
90
  msgstr ""
91
 
92
+ #: app/controller/javascript.php:418
93
  msgid ""
94
  "The URL you have entered in the <b>Organizer Contact Info</b> &gt; "
95
+ "<b>Website URL</b> seems to be invalid."
96
  msgstr ""
97
 
98
+ #: app/controller/javascript.php:421
99
  msgid ""
100
  "The URL you have entered in the <b>Event Cost and Tickets</b> &gt; <b>Buy "
101
  "Tickets URL</b> seems to be invalid."
102
  msgstr ""
103
 
104
+ #: app/controller/javascript.php:424
105
  msgid ""
106
  "Please remember that URLs must start with either \"http://\" or \"https://\"."
107
  msgstr ""
108
 
109
+ #: app/controller/javascript.php:427
110
  msgid "Loading&hellip;"
111
  msgstr ""
112
 
113
+ #: app/controller/javascript.php:457 app/view/admin/widget-creator.php:139
114
  msgid "Preview:"
115
  msgstr ""
116
 
117
+ #: app/controller/javascript.php:458
118
  msgid ""
119
  "Loading preview&nbsp;<i class=\"ai1ec-fa ai1ec-fa-spin ai1ec-fa-spinner\"></"
120
  "i>"
121
  msgstr ""
122
 
123
+ #: app/controller/javascript.php:462
124
  msgid ""
125
  "Something went wrong while fetching events.<br>The request status is: %STATUS"
126
  "% <br>The error thrown was: %ERROR%"
127
  msgstr ""
128
 
129
+ #: app/controller/javascript.php:469
130
  msgid "The end date can't be earlier than the start date."
131
  msgstr ""
132
 
133
+ #: app/controller/javascript.php:470
134
  msgid "For week and day view, you must select an interval of at least 6 hours."
135
  msgstr ""
136
 
142
  msgid "Base Event"
143
  msgstr ""
144
 
145
+ #: app/model/settings.php:385
146
  #: lib/html/element/setting/calendar-page-selector.php:50
147
  msgid "Calendar page"
148
  msgstr ""
149
 
150
+ #: app/model/settings.php:395
151
  msgid "Week starts on"
152
  msgstr ""
153
 
154
+ #: app/model/settings.php:408
155
  msgid "Available views"
156
  msgstr ""
157
 
158
+ #: app/model/settings.php:416
159
  msgid "Agenda"
160
  msgid_plural "Agenda"
161
  msgstr[0] ""
162
  msgstr[1] ""
163
 
164
+ #: app/model/settings.php:427
165
  msgid "Day"
166
  msgid_plural "Day"
167
  msgstr[0] ""
168
  msgstr[1] ""
169
 
170
+ #: app/model/settings.php:438
171
  msgid "Month"
172
  msgid_plural "Month"
173
  msgstr[0] ""
174
  msgstr[1] ""
175
 
176
+ #: app/model/settings.php:449
177
  msgid "Week"
178
  msgid_plural "Week"
179
  msgstr[0] ""
180
  msgstr[1] ""
181
 
182
+ #: app/model/settings.php:463
183
  msgid "Timezone"
184
  msgstr ""
185
 
186
+ #: app/model/settings.php:476
187
  msgid "Preselected calendar filters"
188
  msgstr ""
189
 
190
+ #: app/model/settings.php:477 app/view/calendar/widget.php:128
191
  msgid ""
192
  "To clear, hold &#8984;/<abbr class=\"initialism\">CTRL</abbr> and click "
193
  "selection."
194
  msgstr ""
195
 
196
+ #: app/model/settings.php:492
197
  msgid "Default calendar start date (optional)"
198
  msgstr ""
199
 
200
+ #: app/model/settings.php:503
201
  msgid "Agenda pages show at most"
202
  msgstr ""
203
 
204
+ #: app/model/settings.php:516
205
  msgid "Week/Day view starts at"
206
  msgstr ""
207
 
208
+ #: app/model/settings.php:529
209
  msgid "Week/Day view ends at"
210
  msgstr ""
211
 
212
+ #: app/model/settings.php:542
213
  msgid "<strong>Word-wrap event stubs</strong> in Month view"
214
  msgstr ""
215
 
216
+ #: app/model/settings.php:545
217
  msgid "Only applies to events that span a single day."
218
  msgstr ""
219
 
220
+ #: app/model/settings.php:557
221
  msgid ""
222
  "In <span class=\"ai1ec-tooltip-toggle\"\n"
223
  "\t\t\t\t\t\tdata-original-title=\"These include Agenda view,\n"
226
  "\t\t\t\t\t\tfrom last day shown</strong>"
227
  msgstr ""
228
 
229
+ #: app/model/settings.php:573
230
  msgid "Keep all events <strong>expanded</strong> in Agenda view"
231
  msgstr ""
232
 
233
+ #: app/model/settings.php:585
234
  msgid "<strong>Show year</strong> in calendar date labels"
235
  msgstr ""
236
 
237
+ #: app/model/settings.php:597
238
  msgid "<strong>Show location in event titles</strong> in calendar views"
239
  msgstr ""
240
 
241
+ #: app/model/settings.php:609
242
  msgid "<strong>Exclude</strong> events from search results"
243
  msgstr ""
244
 
245
+ #: app/model/settings.php:621
246
  msgid ""
247
  "Hide <strong>Subscribe</strong>/<strong>Add to Calendar</strong> buttons in "
248
  "calendar and single event views "
249
  msgstr ""
250
 
251
+ #: app/model/settings.php:633
252
  msgid "Hide <strong>Get a Timely Calendar</strong> button"
253
  msgstr ""
254
 
255
+ #: app/model/settings.php:645
256
  msgid " Hide <strong>Google Maps</strong> until clicked"
257
  msgstr ""
258
 
259
+ #: app/model/settings.php:657
260
  msgid ""
261
  " <strong>Affix filter menu</strong> to top of window when it scrolls out of "
262
  "view"
263
  msgstr ""
264
 
265
+ #: app/model/settings.php:660
266
  msgid "Only applies to first visible calendar found on the page."
267
  msgstr ""
268
 
269
+ #: app/model/settings.php:672
270
  msgid "Offset affixed filter bar vertically by"
271
  msgstr ""
272
 
273
+ #: app/model/settings.php:687
274
  msgid "Wide screens only (&#8805; 1200px)"
275
  msgstr ""
276
 
277
+ #: app/model/settings.php:702
278
  msgid "Tablets only (< 980px)"
279
  msgstr ""
280
 
281
+ #: app/model/settings.php:717
282
  msgid "Phones only (< 768px)"
283
  msgstr ""
284
 
285
+ #: app/model/settings.php:730
286
  msgid "Strict compatibility content filtering"
287
  msgstr ""
288
 
289
+ #: app/model/settings.php:742
290
  msgid " <strong>Hide featured image</strong> from event details page"
291
  msgstr ""
292
 
293
+ #: app/model/settings.php:745
294
  msgid ""
295
  "Select this option if your theme already displays each post's featured image."
296
  msgstr ""
297
 
298
+ #: app/model/settings.php:756
299
  msgid "Input dates in this format"
300
  msgstr ""
301
 
302
+ #: app/model/settings.php:761
303
  msgid "Default (d/m/yyyy)"
304
  msgstr ""
305
 
306
+ #: app/model/settings.php:765
307
  msgid "US (m/d/yyyy)"
308
  msgstr ""
309
 
310
+ #: app/model/settings.php:769
311
  msgid "ISO 8601 (yyyy-m-d)"
312
  msgstr ""
313
 
314
+ #: app/model/settings.php:773
315
  msgid "Dotted (m.d.yyyy)"
316
  msgstr ""
317
 
318
+ #: app/model/settings.php:785
319
  msgid " Use <strong>24h time</strong> in time pickers"
320
  msgstr ""
321
 
322
+ #: app/model/settings.php:796
323
  msgid "<strong>Disable address autocomplete</strong> function"
324
  msgstr ""
325
 
326
+ #: app/model/settings.php:807
327
  msgid ""
328
  "Use the configured <strong>region</strong> (WordPress locale) to bias the "
329
  "address autocomplete function "
330
  msgstr ""
331
 
332
+ #: app/model/settings.php:823
333
  msgid ""
334
  " Show the old <strong>Post Your Event</strong> button above the calendar to "
335
  "privileged users"
336
  msgstr ""
337
 
338
+ #: app/model/settings.php:826
339
  msgid ""
340
  "Install the <a target=\"_blank\" href=\"http://time.ly/\">Interactive "
341
  "Frontend Extension</a> for the <strong>frontend Post Your Event form</"
342
  "strong>."
343
  msgstr ""
344
 
345
+ #: app/model/settings.php:847
346
  msgid "Move calendar into this DOM element"
347
  msgstr ""
348
 
349
+ #: app/model/settings.php:849
350
  msgid ""
351
  "Optional. Use this JavaScript-based shortcut to place the\n"
352
  "\t\t\t\t\t\tcalendar a DOM element other than the usual page content "
360
  "\t\t\t\t\t\tby the calendar."
361
  msgstr ""
362
 
363
+ #: app/model/settings.php:868
364
  msgid ""
365
  "<strong>Skip <tt>in_the_loop()</tt> check </strong> that protects against "
366
  "multiple calendar output"
367
  msgstr ""
368
 
369
+ #: app/model/settings.php:871
370
  msgid ""
371
  "Try enabling this option if your calendar does not appear on the calendar "
372
  "page. It is needed for compatibility with a small number of themes that call "
373
  "<tt>the_content()</tt> from outside of The Loop. Leave disabled otherwise."
374
  msgstr ""
375
 
376
+ #: app/model/settings.php:883
377
  msgid "Disable <strong>gzip</strong> compression."
378
  msgstr ""
379
 
380
+ #: app/model/settings.php:886
381
  msgid ""
382
  "Use this option if calendar is unresponsive. <a href=\"http://support.time."
383
  "ly/disable-gzip-compression/\">Read more</a> about the issue. (From version "
384
  "2.1 onwards, gzip is disabled by default for maximum compatibility.)"
385
  msgstr ""
386
 
387
+ #: app/model/settings.php:898
388
  msgid "Use frontend rendering."
389
  msgstr ""
390
 
391
+ #: app/model/settings.php:901
392
  msgid ""
393
  "Renders calendar views on the client rather than the server; can improve "
394
  "performance."
395
  msgstr ""
396
 
397
+ #: app/model/settings.php:913
398
  msgid ""
399
  "<strong>Link CSS</strong> in <code>&lt;head&gt;</code> section when file "
400
  "cache is unavailable."
401
  msgstr ""
402
 
403
+ #: app/model/settings.php:916
404
  msgid ""
405
  "Use this option if file cache is unavailable and you would prefer to serve "
406
  "CSS as a link rather than have it output inline."
407
  msgstr ""
408
 
409
+ #: app/model/settings.php:928
410
  msgid "Current <strong>robots.txt</strong> on this site"
411
  msgstr ""
412
 
413
+ #: app/model/settings.php:932
414
  msgid ""
415
  "The Robot Exclusion Standard, also known as the Robots Exclusion Protocol "
416
  "or\n"
424
  "your root WordPress directory."
425
  msgstr ""
426
 
427
+ #: app/model/settings.php:949
428
  msgid ""
429
  "<strong>Publicize, promote, and share my events</strong> marked as public on "
430
  "the Timely network. (<a href=\"%s\" target=\"_blank\">Learn more &#187;</a>)"
431
  msgstr ""
432
 
433
+ #: app/model/settings.php:972
434
  msgid "Templates cache improves site performance"
435
  msgstr ""
436
 
437
+ #: app/model/settings.php:985
438
  msgid "Display events in <strong>calendar time zone</strong>"
439
  msgstr ""
440
 
441
+ #: app/model/settings.php:988
442
  msgid ""
443
  "If this box is checked events will appear in the calendar time zone with "
444
  "time zone information displayed on the event details page."
448
  msgid "Event Details"
449
  msgstr ""
450
 
451
+ #: app/view/admin/add-new-event.php:356
 
 
 
 
452
  msgid "Set banner image"
453
  msgstr ""
454
 
455
+ #: app/view/admin/add-new-event.php:357
456
  msgid "Remove banner image"
457
  msgstr ""
458
 
487
  msgid "Event date/time"
488
  msgstr ""
489
 
490
+ #: app/view/admin/all-events.php:104
491
  msgid "Show All "
492
  msgstr ""
493
 
494
+ #: app/view/admin/all-events.php:117
495
+ msgid "Show All Authors"
496
+ msgstr ""
497
+
498
  #: app/view/admin/calendar-feeds.php:27 app/view/admin/calendar-feeds.php:28
499
  msgid "Calendar Feeds"
500
  msgstr ""
542
  "400&times;400 pixels."
543
  msgstr ""
544
 
545
+ #: app/view/admin/get-repeat-box.php:94
546
  msgid "times"
547
  msgstr ""
548
 
549
+ #: app/view/admin/get-repeat-box.php:164
550
  msgid "Recurrence rule cannot be empty."
551
  msgstr ""
552
 
553
+ #: app/view/admin/get-repeat-box.php:182
554
  msgid "Recurrence rule was not provided."
555
  msgstr ""
556
 
557
+ #: app/view/admin/get-repeat-box.php:209
558
  msgid "Never"
559
  msgstr ""
560
 
561
+ #: app/view/admin/get-repeat-box.php:210
562
  msgid "After"
563
  msgstr ""
564
 
565
+ #: app/view/admin/get-repeat-box.php:211 public/admin/box_repeat.php:93
566
  msgid "On date"
567
  msgstr ""
568
 
569
+ #: app/view/admin/get-repeat-box.php:247
570
  msgid "day(s)"
571
  msgstr ""
572
 
573
+ #: app/view/admin/get-repeat-box.php:330
574
  msgid "week(s)"
575
  msgstr ""
576
 
577
+ #: app/view/admin/get-repeat-box.php:413 app/view/admin/get-repeat-box.php:485
578
+ #: lib/recurrence/rule.php:297
579
  msgid "last"
580
  msgstr ""
581
 
582
+ #: app/view/admin/get-repeat-box.php:426
583
  msgid "month(s)"
584
  msgstr ""
585
 
586
+ #: app/view/admin/get-repeat-box.php:480
587
  msgid "first"
588
  msgstr ""
589
 
590
+ #: app/view/admin/get-repeat-box.php:481
591
  msgid "second"
592
  msgstr ""
593
 
594
+ #: app/view/admin/get-repeat-box.php:482
595
  msgid "third"
596
  msgstr ""
597
 
598
+ #: app/view/admin/get-repeat-box.php:483
599
  msgid "fourth"
600
  msgstr ""
601
 
602
+ #: app/view/admin/get-repeat-box.php:495
603
  msgid "Sunday"
604
  msgstr ""
605
 
606
+ #: app/view/admin/get-repeat-box.php:496
607
  msgid "Monday"
608
  msgstr ""
609
 
610
+ #: app/view/admin/get-repeat-box.php:497
611
  msgid "Tuesday"
612
  msgstr ""
613
 
614
+ #: app/view/admin/get-repeat-box.php:498
615
  msgid "Wednesday"
616
  msgstr ""
617
 
618
+ #: app/view/admin/get-repeat-box.php:499
619
  msgid "Thursday"
620
  msgstr ""
621
 
622
+ #: app/view/admin/get-repeat-box.php:500
623
  msgid "Friday"
624
  msgstr ""
625
 
626
+ #: app/view/admin/get-repeat-box.php:501
627
  msgid "Saturday"
628
  msgstr ""
629
 
630
+ #: app/view/admin/get-repeat-box.php:503
631
  msgid "day"
632
  msgstr ""
633
 
634
+ #: app/view/admin/get-repeat-box.php:504
635
  msgid "weekday"
636
  msgstr ""
637
 
638
+ #: app/view/admin/get-repeat-box.php:505
639
  msgid "weekend day"
640
  msgstr ""
641
 
642
+ #: app/view/admin/get-repeat-box.php:571
643
  msgid "year(s)"
644
  msgstr ""
645
 
647
  msgid "<a href=\"%s\">Settings</a>"
648
  msgstr ""
649
 
650
+ #: app/view/admin/nav.php:28
651
+ msgid "<a href=\"%s\">Check for updates</a>"
652
+ msgstr ""
653
+
654
  #: app/view/admin/organize.php:100
655
  msgid "Organize Events"
656
  msgstr ""
707
  msgstr ""
708
 
709
  #: app/view/admin/settings.php:170
 
710
  msgid "Save Settings"
711
  msgstr ""
712
 
815
  "inform him to configure calendar views."
816
  msgstr ""
817
 
818
+ #: app/view/calendar/page.php:74
819
  msgid ""
820
  "Calendar was unable to initialize %s view and has reverted to Agenda view. "
821
  "Please check if you have installed the latest versions of calendar add-ons."
822
  msgstr ""
823
 
824
+ #: app/view/calendar/page.php:268
825
  msgid "Subscribe to filtered calendar"
826
  msgstr ""
827
 
828
+ #: app/view/calendar/page.php:269
829
  msgid "Subscribe"
830
  msgstr ""
831
 
832
+ #: app/view/calendar/page.php:270 app/view/event/single.php:115
833
  msgid "Get a Timely Calendar"
834
  msgstr ""
835
 
893
  msgid "Tags"
894
  msgstr ""
895
 
896
+ #: app/view/calendar/view/agenda.php:129
897
  msgid "Collapse All"
898
  msgstr ""
899
 
900
+ #: app/view/calendar/view/agenda.php:130
901
  msgid "Expand All"
902
  msgstr ""
903
 
904
+ #: app/view/calendar/view/agenda.php:153
905
  msgid "There are no upcoming events to display at this time."
906
  msgstr ""
907
 
908
+ #: app/view/calendar/view/agenda.php:154 app/view/calendar/widget.php:373
909
+ #: public/admin/feed_row.php:112
910
  msgid "Edit"
911
  msgstr ""
912
 
913
+ #: app/view/calendar/view/agenda.php:155
914
  msgid "Read more"
915
  msgstr ""
916
 
917
+ #: app/view/calendar/view/agenda.php:156
918
  msgid "Categories:"
919
  msgstr ""
920
 
921
+ #: app/view/calendar/view/agenda.php:157 lib/theme/list.php:320
922
  #: public/admin/themes.php:29
923
  msgid "Tags:"
924
  msgstr ""
925
 
926
+ #: app/view/calendar/view/agenda.php:158 app/view/calendar/view/month.php:87
927
+ #: app/view/calendar/view/oneday.php:105 app/view/calendar/view/week.php:118
928
  #: app/view/calendar/widget.php:374
929
  msgid "@ %s"
930
  msgstr ""
931
 
932
+ #: app/view/calendar/view/oneday.php:79 app/view/calendar/view/week.php:73
933
  msgid "g a"
934
  msgstr ""
935
 
936
+ #: app/view/calendar/view/oneday.php:102 app/view/calendar/view/week.php:115
937
  msgid "Reveal full day"
938
  msgstr ""
939
 
940
+ #: app/view/calendar/view/oneday.php:103 app/view/calendar/view/week.php:116
941
  msgid "All-day"
942
  msgstr ""
943
 
944
+ #: app/view/calendar/view/oneday.php:104 app/view/calendar/view/week.php:117
945
  msgid "Now:"
946
  msgstr ""
947
 
948
+ #: app/view/calendar/view/week.php:67
949
  msgid "Week of %s"
950
  msgstr ""
951
 
1093
  msgid "Free"
1094
  msgstr ""
1095
 
1096
+ #: app/view/event/single.php:145
1097
  msgid "Edit this occurrence (%s)"
1098
  msgstr ""
1099
 
1100
+ #: app/view/event/single.php:160
1101
  msgid ""
1102
  "This post was replicated from another site's <a href=\"%s\" title="
1103
  "\"iCalendar feed\"><i class=\"ai1ec-fa ai1ec-fa-calendar\"></i> calendar "
1104
  "feed</a>."
1105
  msgstr ""
1106
 
1107
+ #: app/view/event/single.php:171
1108
  msgid "View original"
1109
  msgstr ""
1110
 
1158
  msgid "Another import process in progress. Please try again later."
1159
  msgstr ""
1160
 
1161
+ #: lib/calendar-feed/ics.php:174
1162
  msgid ""
1163
  "A system error has prevented calendar data from being fetched. Something is "
1164
  "preventing the plugin from functioning correctly. This message should "
1165
  "provide a clue: %s"
1166
  msgstr ""
1167
 
1168
+ #: lib/calendar-feed/ics.php:181
1169
  msgid ""
1170
  "Calendar data could not be fetched. If your URL is valid and contains an "
1171
  "iCalendar resource, this is likely the result of a temporary server error "
1172
  "and time may resolve this issue"
1173
  msgstr ""
1174
 
1175
+ #: lib/calendar-feed/ics.php:195
 
 
 
 
1176
  msgid "Imported %s event"
1177
  msgid_plural "Imported %s events"
1178
  msgstr[0] ""
1179
  msgstr[1] ""
1180
 
1181
+ #: lib/calendar-feed/ics.php:202 lib/calendar-feed/ics.php:707
1182
  msgid "Invalid ICS feed ID"
1183
  msgstr ""
1184
 
1185
+ #: lib/calendar-feed/ics.php:350
1186
  msgid "Categories (optional)"
1187
  msgstr ""
1188
 
1189
+ #: lib/calendar-feed/ics.php:367
1190
  msgid ""
1191
  "Do you want to keep the events imported from the calendar or remove them?"
1192
  msgstr ""
1193
 
1194
+ #: lib/calendar-feed/ics.php:373
1195
  msgid "Removing ICS Feed"
1196
  msgstr ""
1197
 
1198
+ #: lib/calendar-feed/ics.php:376
1199
  msgid "Keep Events"
1200
  msgstr ""
1201
 
1202
+ #: lib/calendar-feed/ics.php:379
1203
  msgid "Remove Events"
1204
  msgstr ""
1205
 
1206
+ #: lib/calendar-feed/ics.php:519
1207
  msgid "Oh, submission was not accepted."
1208
  msgstr ""
1209
 
1210
+ #: lib/calendar-feed/ics.php:699
1211
  msgid "Deleted %d events"
1212
  msgstr ""
1213
 
1214
+ #: lib/calendar-feed/ics.php:735
1215
  msgid "Feed deleted"
1216
  msgstr ""
1217
 
1411
  msgid "Error Details:"
1412
  msgstr ""
1413
 
1414
+ #: lib/factory/html.php:133
1415
  msgid "Choose a date using calendar"
1416
  msgstr ""
1417
 
1418
+ #: lib/factory/html.php:278
1419
  msgid "Tags (optional)"
1420
  msgstr ""
1421
 
1695
  msgid "Event Feed"
1696
  msgstr ""
1697
 
1698
+ #: lib/post/custom-type.php:285
1699
  msgid ""
1700
  "All Events <span class=\"update-plugins count-%d\" title=\"%d Pending Events"
1701
  "\"><span class=\"update-count\">%d</span></span>"
1702
  msgstr ""
1703
 
1704
+ #: lib/post/custom-type.php:296
1705
  msgid "All Events"
1706
  msgstr ""
1707
 
1708
+ #: lib/recurrence/rule.php:243 lib/recurrence/rule.php:252
1709
+ #: lib/recurrence/rule.php:260
1710
  msgctxt "Recurrence editor - weekly tab"
1711
  msgid "on"
1712
  msgstr ""
1713
 
1714
+ #: lib/recurrence/rule.php:248 lib/recurrence/rule.php:277
1715
+ #: lib/recurrence/rule.php:325
1716
  msgid "and"
1717
  msgstr ""
1718
 
1719
+ #: lib/recurrence/rule.php:273 lib/recurrence/rule.php:280
1720
+ #: lib/recurrence/rule.php:286 lib/recurrence/rule.php:307
1721
  msgctxt "Recurrence editor - monthly tab"
1722
  msgid "on"
1723
  msgstr ""
1724
 
1725
+ #: lib/recurrence/rule.php:273 lib/recurrence/rule.php:280
1726
+ #: lib/recurrence/rule.php:286
1727
  msgid "of the month"
1728
  msgstr ""
1729
 
1730
+ #: lib/recurrence/rule.php:320 lib/recurrence/rule.php:328
1731
+ #: lib/recurrence/rule.php:335
1732
  msgctxt "Recurrence editor - yearly tab"
1733
  msgid "on"
1734
  msgstr ""
1735
 
1736
+ #: lib/recurrence/rule.php:375 public/admin/box_repeat.php:16
1737
  #: public/admin/cron_freq.php:9
1738
  msgid "Daily"
1739
  msgstr ""
1740
 
1741
+ #: lib/recurrence/rule.php:378
1742
  msgid "Every other day"
1743
  msgstr ""
1744
 
1745
+ #: lib/recurrence/rule.php:381
1746
  msgid "Every %d days"
1747
  msgstr ""
1748
 
1749
+ #: lib/recurrence/rule.php:390 public/admin/box_repeat.php:21
1750
  msgid "Weekly"
1751
  msgstr ""
1752
 
1753
+ #: lib/recurrence/rule.php:393
1754
  msgid "Every other week"
1755
  msgstr ""
1756
 
1757
+ #: lib/recurrence/rule.php:396
1758
  msgid "Every %d weeks"
1759
  msgstr ""
1760
 
1761
+ #: lib/recurrence/rule.php:405 public/admin/box_repeat.php:26
1762
  msgid "Monthly"
1763
  msgstr ""
1764
 
1765
+ #: lib/recurrence/rule.php:408
1766
  msgid "Every other month"
1767
  msgstr ""
1768
 
1769
+ #: lib/recurrence/rule.php:411
1770
  msgid "Every %d months"
1771
  msgstr ""
1772
 
1773
+ #: lib/recurrence/rule.php:420 public/admin/box_repeat.php:31
1774
  msgid "Yearly"
1775
  msgstr ""
1776
 
1777
+ #: lib/recurrence/rule.php:423
1778
  msgid "Every other year"
1779
  msgstr ""
1780
 
1781
+ #: lib/recurrence/rule.php:426
1782
  msgid "Every %d years"
1783
  msgstr ""
1784
 
1785
+ #: lib/recurrence/rule.php:464
1786
  msgid "until %s"
1787
  msgstr ""
1788
 
1789
+ #: lib/recurrence/rule.php:474
1790
  msgid "for %d occurrences"
1791
  msgstr ""
1792
 
1793
+ #: lib/recurrence/rule.php:478
1794
  msgid "forever"
1795
  msgstr ""
1796
 
1972
  msgstr ""
1973
 
1974
  #: public/admin/box_event_contact.php:56
1975
+ msgid "Website URL:"
1976
  msgstr ""
1977
 
1978
  #: public/admin/box_event_cost.php:6
2031
  msgid "Register this event with Eventbrite.com?"
2032
  msgstr ""
2033
 
2034
+ #: public/admin/box_eventbrite.php:12 public/admin/feed_row.php:43
2035
+ #: public/admin/feed_row.php:54 public/admin/feed_row.php:66
2036
+ #: public/admin/feed_row.php:78 public/admin/feed_row.php:91
2037
  msgid "Yes"
2038
  msgstr ""
2039
 
2040
+ #: public/admin/box_eventbrite.php:14 public/admin/feed_row.php:45
2041
+ #: public/admin/feed_row.php:56 public/admin/feed_row.php:68
2042
+ #: public/admin/feed_row.php:80 public/admin/feed_row.php:93
2043
  msgid "No"
2044
  msgstr ""
2045
 
2140
  msgstr ""
2141
 
2142
  #: public/admin/box_repeat.php:109
2143
+ #: public/admin/plugins/ics/display_feeds.php:90
2144
  msgid "Please wait&#8230;"
2145
  msgstr ""
2146
 
2149
  msgstr ""
2150
 
2151
  #: public/admin/box_repeat.php:116
2152
+ #: public/admin/plugins/ics/display_feeds.php:84
2153
  msgid "Cancel"
2154
  msgstr ""
2155
 
2293
  msgid "Twice Daily"
2294
  msgstr ""
2295
 
2296
+ #: public/admin/feed_row.php:14 public/admin/plugins/ics/display_feeds.php:27
2297
  msgid "iCalendar/.ics Feed URL:"
2298
  msgstr ""
2299
 
2300
+ #: public/admin/feed_row.php:24
2301
  msgid "Event categories:"
2302
  msgstr ""
2303
 
2304
+ #: public/admin/feed_row.php:31
2305
  msgid "Tag with"
2306
  msgstr ""
2307
 
2308
+ #: public/admin/feed_row.php:40
2309
  msgid "Allow comments"
2310
  msgstr ""
2311
 
2312
+ #: public/admin/feed_row.php:51
2313
  msgid "Show map"
2314
  msgstr ""
2315
 
2316
+ #: public/admin/feed_row.php:63
2317
  msgid "Keep original events categories and tags"
2318
  msgstr ""
2319
 
2320
+ #: public/admin/feed_row.php:75 public/admin/plugins/ics/display_feeds.php:67
2321
  msgid ""
2322
  "On refresh, preserve previously imported events that are missing from the "
2323
  "feed"
2324
  msgstr ""
2325
 
2326
+ #: public/admin/feed_row.php:86 public/admin/plugins/ics/display_feeds.php:74
2327
  msgid ""
2328
  "Guesses the time zone of events that have none specified; recommended for "
2329
  "Google Calendar feeds"
2330
  msgstr ""
2331
 
2332
+ #: public/admin/feed_row.php:87 public/admin/plugins/ics/display_feeds.php:75
2333
  msgid "Assign default time zone to events in UTC"
2334
  msgstr ""
2335
 
2336
+ #: public/admin/feed_row.php:104
2337
  msgid "Refreshing&#8230;"
2338
  msgstr ""
2339
 
2340
+ #: public/admin/feed_row.php:106
2341
  msgid "Refresh"
2342
  msgstr ""
2343
 
2344
+ #: public/admin/feed_row.php:119
2345
  msgid "Removing&#8230;"
2346
  msgstr ""
2347
 
2348
+ #: public/admin/feed_row.php:121
2349
  msgid "Remove"
2350
  msgstr ""
2351
 
2365
  msgid "Check for new events"
2366
  msgstr ""
2367
 
2368
+ #: public/admin/plugins/ics/display_feeds.php:45
2369
  msgid "Allow comments on imported events"
2370
  msgstr ""
2371
 
2372
+ #: public/admin/plugins/ics/display_feeds.php:52
2373
  msgid "Show map on imported events"
2374
  msgstr ""
2375
 
2376
+ #: public/admin/plugins/ics/display_feeds.php:59
2377
  msgid ""
2378
  "Import any tags/categories provided by feed, in addition those selected above"
2379
  msgstr ""
2380
 
2381
+ #: public/admin/plugins/ics/display_feeds.php:93
2382
  msgid "Add new subscription"
2383
  msgstr ""
2384
 
2385
+ #: public/admin/plugins/ics/display_feeds.php:96
2386
+ msgid "Update subscription"
2387
+ msgstr ""
2388
+
2389
  #: public/admin/row_custom.php:3
2390
  msgid "Custom dates:"
2391
  msgstr ""
2684
  msgid "All-in-One Event Calendar by Time.ly"
2685
  msgstr ""
2686
 
2687
+ #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.3.0) #-#-#-#-#
2688
  #. Plugin URI of the plugin/theme
2689
+ #. #-#-#-#-# all-in-one-event-calendar.pot (All-in-One Event Calendar by Time.ly 2.3.0) #-#-#-#-#
2690
  #. Author URI of the plugin/theme
2691
  msgid "http://time.ly/"
2692
  msgstr ""
lib/bootstrap/loader-map.php CHANGED
@@ -156,6 +156,13 @@
156
  'i' => 'g',
157
  'r' => 'y',
158
  ),
 
 
 
 
 
 
 
159
  'Ai1ec_Calendar_View_Abstract' =>
160
  array (
161
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'view' . DIRECTORY_SEPARATOR . 'calendar' . DIRECTORY_SEPARATOR . 'view' . DIRECTORY_SEPARATOR . 'abstract.php',
@@ -240,6 +247,13 @@
240
  'i' => 'g',
241
  'r' => 'y',
242
  ),
 
 
 
 
 
 
 
243
  'Ai1ec_Command_Clone' =>
244
  array (
245
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'clone.php',
@@ -504,11 +518,12 @@
504
  'i' => 'g',
505
  'r' => 'y',
506
  ),
507
- 'Ai1ec_EDD_SL_Plugin_Updater' =>
508
  array (
509
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'edd' . DIRECTORY_SEPARATOR . 'updater.php',
510
- 'c' => 'Ai1ec_EDD_SL_Plugin_Updater',
511
- 'i' => 'n',
 
512
  ),
513
  'Ai1ec_Email_Notification' =>
514
  array (
@@ -785,6 +800,13 @@
785
  'i' => 'n',
786
  'r' => 'y',
787
  ),
 
 
 
 
 
 
 
788
  'Ai1ec_Filter_Tags' =>
789
  array (
790
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'filter' . DIRECTORY_SEPARATOR . 'tag_ids.php',
@@ -1617,12 +1639,6 @@
1617
  'i' => 'g',
1618
  'r' => 'y',
1619
  ),
1620
- 'EDD_SL_Plugin_Updater' =>
1621
- array (
1622
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'edd' . DIRECTORY_SEPARATOR . 'EDD_SL_Plugin_Updater.php',
1623
- 'c' => 'EDD_SL_Plugin_Updater',
1624
- 'i' => 'g',
1625
- ),
1626
  'HTTP_ConditionalGet' =>
1627
  array (
1628
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'minify' . DIRECTORY_SEPARATOR . 'ConditionalGet.php',
@@ -2779,6 +2795,13 @@
2779
  'i' => 'g',
2780
  'r' => 'y',
2781
  ),
 
 
 
 
 
 
 
2782
  'calendarComponent' =>
2783
  array (
2784
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
@@ -2834,6 +2857,13 @@
2834
  'i' => 'g',
2835
  'r' => 'y',
2836
  ),
 
 
 
 
 
 
 
2837
  'command.clone' =>
2838
  array (
2839
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'clone.php',
@@ -3167,17 +3197,12 @@
3167
  'i' => 'g',
3168
  'r' => 'y',
3169
  ),
3170
- 'edd.EDD_SL_Plugin_Updater' =>
3171
  array (
3172
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'edd' . DIRECTORY_SEPARATOR . 'EDD_SL_Plugin_Updater.php',
3173
- 'c' => 'EDD_SL_Plugin_Updater',
3174
  'i' => 'g',
3175
- ),
3176
- 'edd.updater' =>
3177
- array (
3178
- 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'edd' . DIRECTORY_SEPARATOR . 'updater.php',
3179
- 'c' => 'Ai1ec_EDD_SL_Plugin_Updater',
3180
- 'i' => 'n',
3181
  ),
3182
  'environment.check' =>
3183
  array (
@@ -3808,6 +3833,13 @@
3808
  'i' => 'n',
3809
  'r' => 'y',
3810
  ),
 
 
 
 
 
 
 
3811
  'model.filter.int' =>
3812
  array (
3813
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'filter' . DIRECTORY_SEPARATOR . 'int.php',
156
  'i' => 'g',
157
  'r' => 'y',
158
  ),
159
+ 'Ai1ec_Calendar_Updates' =>
160
+ array (
161
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'calendar' . DIRECTORY_SEPARATOR . 'updates.php',
162
+ 'c' => 'Ai1ec_Calendar_Updates',
163
+ 'i' => 'g',
164
+ 'r' => 'y',
165
+ ),
166
  'Ai1ec_Calendar_View_Abstract' =>
167
  array (
168
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'view' . DIRECTORY_SEPARATOR . 'calendar' . DIRECTORY_SEPARATOR . 'view' . DIRECTORY_SEPARATOR . 'abstract.php',
247
  'i' => 'g',
248
  'r' => 'y',
249
  ),
250
+ 'Ai1ec_Command_Check_Updates' =>
251
+ array (
252
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'check-updates.php',
253
+ 'c' => 'Ai1ec_Command_Check_Updates',
254
+ 'i' => 'g',
255
+ 'r' => 'y',
256
+ ),
257
  'Ai1ec_Command_Clone' =>
258
  array (
259
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'clone.php',
518
  'i' => 'g',
519
  'r' => 'y',
520
  ),
521
+ 'Ai1ec_Dbi_Utils' =>
522
  array (
523
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'dbi' . DIRECTORY_SEPARATOR . 'dbi-utils.php',
524
+ 'c' => 'Ai1ec_Dbi_Utils',
525
+ 'i' => 'g',
526
+ 'r' => 'y',
527
  ),
528
  'Ai1ec_Email_Notification' =>
529
  array (
800
  'i' => 'n',
801
  'r' => 'y',
802
  ),
803
+ 'Ai1ec_Filter_Posts_By_Instance' =>
804
+ array (
805
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'filter' . DIRECTORY_SEPARATOR . 'instance_ids.php',
806
+ 'c' => 'Ai1ec_Filter_Posts_By_Instance',
807
+ 'i' => 'n',
808
+ 'r' => 'y',
809
+ ),
810
  'Ai1ec_Filter_Tags' =>
811
  array (
812
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'filter' . DIRECTORY_SEPARATOR . 'tag_ids.php',
1639
  'i' => 'g',
1640
  'r' => 'y',
1641
  ),
 
 
 
 
 
 
1642
  'HTTP_ConditionalGet' =>
1643
  array (
1644
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'minify' . DIRECTORY_SEPARATOR . 'ConditionalGet.php',
2795
  'i' => 'g',
2796
  'r' => 'y',
2797
  ),
2798
+ 'calendar.updates' =>
2799
+ array (
2800
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'calendar' . DIRECTORY_SEPARATOR . 'updates.php',
2801
+ 'c' => 'Ai1ec_Calendar_Updates',
2802
+ 'i' => 'g',
2803
+ 'r' => 'y',
2804
+ ),
2805
  'calendarComponent' =>
2806
  array (
2807
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'iCal' . DIRECTORY_SEPARATOR . 'iCalcreator-2.20' . DIRECTORY_SEPARATOR . 'iCalcreator.class.php',
2857
  'i' => 'g',
2858
  'r' => 'y',
2859
  ),
2860
+ 'command.check-updates' =>
2861
+ array (
2862
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'check-updates.php',
2863
+ 'c' => 'Ai1ec_Command_Check_Updates',
2864
+ 'i' => 'g',
2865
+ 'r' => 'y',
2866
+ ),
2867
  'command.clone' =>
2868
  array (
2869
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'command' . DIRECTORY_SEPARATOR . 'clone.php',
3197
  'i' => 'g',
3198
  'r' => 'y',
3199
  ),
3200
+ 'dbi.dbi-utils' =>
3201
  array (
3202
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'dbi' . DIRECTORY_SEPARATOR . 'dbi-utils.php',
3203
+ 'c' => 'Ai1ec_Dbi_Utils',
3204
  'i' => 'g',
3205
+ 'r' => 'y',
 
 
 
 
 
3206
  ),
3207
  'environment.check' =>
3208
  array (
3833
  'i' => 'n',
3834
  'r' => 'y',
3835
  ),
3836
+ 'model.filter.instance_ids' =>
3837
+ array (
3838
+ 'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'filter' . DIRECTORY_SEPARATOR . 'instance_ids.php',
3839
+ 'c' => 'Ai1ec_Filter_Posts_By_Instance',
3840
+ 'i' => 'n',
3841
+ 'r' => 'y',
3842
+ ),
3843
  'model.filter.int' =>
3844
  array (
3845
  'f' => AI1EC_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR . 'filter' . DIRECTORY_SEPARATOR . 'int.php',
lib/calendar-feed/ics.php CHANGED
@@ -18,7 +18,7 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
18
 
19
  const ICS_OPTION_DB_VERSION = 'ai1ec_ics_db_version';
20
 
21
- const ICS_DB_VERSION = 220;
22
 
23
  /**
24
  * @var array
@@ -154,6 +154,7 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
154
  $result = $import_export->import_events( 'ics', $args );
155
  do_action( 'ai1ec_ics_after_import' );
156
  $count = $result['count'];
 
157
  // we must flip again the array to iterate over it
158
  if ( 0 == $feed->keep_old_events ) {
159
  $events_to_delete = array_flip( $result['events_to_delete'] );
@@ -182,21 +183,17 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
182
  AI1EC_PLUGIN_NAME
183
  );
184
  }
185
-
186
-
187
- if ( $count == 0 ) {
188
- // If results are 0, it could be result of a bad URL or other error, send a specific message
189
- $return_message = false === $message ?
190
- __( 'No events were found', AI1EC_PLUGIN_NAME ) :
191
- $message;
192
  $output['data'] = array(
193
  'error' => true,
194
- 'message' => $return_message
195
  );
196
  } else {
197
  $output['data'] = array(
198
- 'error' => false,
199
- 'message' => sprintf( _n( 'Imported %s event', 'Imported %s events', $count, AI1EC_PLUGIN_NAME ), $count ),
 
200
  );
201
  }
202
  } else {
@@ -265,6 +262,7 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
265
  $sql = "CREATE TABLE $table_name (
266
  feed_id bigint(20) NOT NULL AUTO_INCREMENT,
267
  feed_url varchar(255) NOT NULL,
 
268
  feed_category varchar(255) NOT NULL,
269
  feed_tags varchar(255) NOT NULL,
270
  comments_enabled tinyint(1) NOT NULL DEFAULT '1',
@@ -324,10 +322,11 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
324
  */
325
  public function handle_feeds_page_post() {
326
  $settings = $this->_registry->get( 'model.settings' );
327
- if ( isset( $_POST['ai1ec_save_settings'] ) ) {
328
  $settings->set( 'ics_cron_freq', $_REQUEST['cron_freq'] );
329
  }
330
  }
 
331
  /**
332
  * (non-PHPdoc)
333
  *
@@ -418,6 +417,7 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
418
  array(
419
  'feed_id',
420
  'feed_url',
 
421
  'feed_category',
422
  'feed_tags',
423
  'comments_enabled',
@@ -448,10 +448,13 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
448
 
449
  $args = array(
450
  'feed_url' => $row->feed_url,
 
451
  'event_category' => implode( ', ', $categories ),
 
452
  'tags' => stripslashes(
453
  str_replace( ',', ', ', $row->feed_tags )
454
  ),
 
455
  'feed_id' => $row->feed_id,
456
  'comments_enabled' => (bool) intval(
457
  $row->comments_enabled
@@ -522,6 +525,7 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
522
  ',', $_REQUEST['feed_category'] );
523
  $entry = array(
524
  'feed_url' => $_REQUEST['feed_url'],
 
525
  'feed_category' => $feed_categories,
526
  'feed_tags' => $_REQUEST['feed_tags'],
527
  'comments_enabled' => Ai1ec_Primitive_Int::db_bool(
@@ -541,38 +545,67 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
541
  ),
542
  );
543
  $entry = apply_filters( 'ai1ec_ics_feed_entry', $entry );
 
 
 
544
  if ( is_wp_error( $entry ) ) {
545
  $output = array(
546
  'error' => true,
547
  'message' => $entry->get_error_message()
548
  );
549
- $json_strategy = $this->_registry->get(
550
- 'http.response.render.strategy.json'
551
- );
552
  return $json_strategy->render( array( 'data' => $output ) );
553
  }
554
 
555
- $format = array( '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d' );
556
- $res = $db->insert( $table_name, $entry, $format );
557
- $feed_id = $db->get_insert_id();
 
 
 
 
 
 
 
 
 
 
558
  $categories = array();
559
  do_action( 'ai1ec_ics_feed_added', $feed_id, $entry );
560
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
  if ( ! empty( $_REQUEST['feed_category'] ) ) {
562
  foreach ( $_REQUEST['feed_category'] as $cat_id ) {
563
  $feed_category = get_term( $cat_id, 'events_categories' );
564
  $categories[] = $feed_category->name;
565
  }
 
566
  }
567
 
568
  $args = array(
569
  'feed_url' => $_REQUEST['feed_url'],
 
570
  'event_category' => implode( ', ', $categories ),
 
571
  'tags' => str_replace(
572
  ',',
573
  ', ',
574
  $_REQUEST['feed_tags']
575
  ),
 
576
  'feed_id' => $feed_id,
577
  'comments_enabled' => (bool) intval(
578
  $_REQUEST['comments_enabled']
@@ -592,18 +625,14 @@ class Ai1ecIcsConnectorPlugin extends Ai1ec_Connector_Plugin {
592
  ),
593
  );
594
 
 
595
  $loader = $this->_registry->get( 'theme.loader' );
596
- // display added feed row
597
- $file = $loader->get_file( 'feed_row.php', $args, true );
598
-
599
  $output = $file->get_content();
600
-
601
  $output = array(
602
- 'error' => false,
603
- 'message' => stripslashes( $output )
604
- );
605
- $json_strategy = $this->_registry->get(
606
- 'http.response.render.strategy.json'
607
  );
608
  return $json_strategy->render( array( 'data' => $output ) );
609
  }
18
 
19
  const ICS_OPTION_DB_VERSION = 'ai1ec_ics_db_version';
20
 
21
+ const ICS_DB_VERSION = 221;
22
 
23
  /**
24
  * @var array
154
  $result = $import_export->import_events( 'ics', $args );
155
  do_action( 'ai1ec_ics_after_import' );
156
  $count = $result['count'];
157
+ $feed_name = ! empty( $result['name'][1] ) ? $result['name'][1] : $feed->feed_url;
158
  // we must flip again the array to iterate over it
159
  if ( 0 == $feed->keep_old_events ) {
160
  $events_to_delete = array_flip( $result['events_to_delete'] );
183
  AI1EC_PLUGIN_NAME
184
  );
185
  }
186
+ if ( $message ) {
187
+ // If we already got an error message, display it.
 
 
 
 
 
188
  $output['data'] = array(
189
  'error' => true,
190
+ 'message' => $message,
191
  );
192
  } else {
193
  $output['data'] = array(
194
+ 'error' => false,
195
+ 'message' => sprintf( _n( 'Imported %s event', 'Imported %s events', $count, AI1EC_PLUGIN_NAME ), $count ),
196
+ 'name' => $feed_name,
197
  );
198
  }
199
  } else {
262
  $sql = "CREATE TABLE $table_name (
263
  feed_id bigint(20) NOT NULL AUTO_INCREMENT,
264
  feed_url varchar(255) NOT NULL,
265
+ feed_name varchar(255) NOT NULL,
266
  feed_category varchar(255) NOT NULL,
267
  feed_tags varchar(255) NOT NULL,
268
  comments_enabled tinyint(1) NOT NULL DEFAULT '1',
322
  */
323
  public function handle_feeds_page_post() {
324
  $settings = $this->_registry->get( 'model.settings' );
325
+ if ( isset( $_POST['cron_freq'] ) ) {
326
  $settings->set( 'ics_cron_freq', $_REQUEST['cron_freq'] );
327
  }
328
  }
329
+
330
  /**
331
  * (non-PHPdoc)
332
  *
417
  array(
418
  'feed_id',
419
  'feed_url',
420
+ 'feed_name',
421
  'feed_category',
422
  'feed_tags',
423
  'comments_enabled',
448
 
449
  $args = array(
450
  'feed_url' => $row->feed_url,
451
+ 'feed_name' => $row->feed_name ?: $row->feed_url,
452
  'event_category' => implode( ', ', $categories ),
453
+ 'categories_ids' => $row->feed_category,
454
  'tags' => stripslashes(
455
  str_replace( ',', ', ', $row->feed_tags )
456
  ),
457
+ 'tags_ids' => $row->feed_tags,
458
  'feed_id' => $row->feed_id,
459
  'comments_enabled' => (bool) intval(
460
  $row->comments_enabled
525
  ',', $_REQUEST['feed_category'] );
526
  $entry = array(
527
  'feed_url' => $_REQUEST['feed_url'],
528
+ 'feed_name' => $_REQUEST['feed_url'],
529
  'feed_category' => $feed_categories,
530
  'feed_tags' => $_REQUEST['feed_tags'],
531
  'comments_enabled' => Ai1ec_Primitive_Int::db_bool(
545
  ),
546
  );
547
  $entry = apply_filters( 'ai1ec_ics_feed_entry', $entry );
548
+ $json_strategy = $this->_registry->get(
549
+ 'http.response.render.strategy.json'
550
+ );
551
  if ( is_wp_error( $entry ) ) {
552
  $output = array(
553
  'error' => true,
554
  'message' => $entry->get_error_message()
555
  );
 
 
 
556
  return $json_strategy->render( array( 'data' => $output ) );
557
  }
558
 
559
+ $format = array( '%s', '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d' );
560
+ if ( ! empty( $_REQUEST['feed_id'] ) ) {
561
+ $feed_id = $_REQUEST['feed_id'];
562
+ $db->update(
563
+ $table_name,
564
+ $entry,
565
+ array( 'feed_id' => $feed_id )
566
+ );
567
+ } else {
568
+ $res = $db->insert( $table_name, $entry, $format );
569
+ $feed_id = $db->get_insert_id();
570
+ }
571
+
572
  $categories = array();
573
  do_action( 'ai1ec_ics_feed_added', $feed_id, $entry );
574
 
575
+ $update = $this->update_ics_feed( $feed_id );
576
+ if ( $update['data']['error'] ) {
577
+ $this->delete_ics_feed( false, $feed_id );
578
+ return $json_strategy->render( $update );
579
+ }
580
+ $feed_name = $update['data']['name'];
581
+ $db->update(
582
+ $table_name,
583
+ array(
584
+ 'feed_name' => $feed_name
585
+ ),
586
+ array( 'feed_id' => $feed_id )
587
+ );
588
+
589
+ $cat_ids = '';
590
  if ( ! empty( $_REQUEST['feed_category'] ) ) {
591
  foreach ( $_REQUEST['feed_category'] as $cat_id ) {
592
  $feed_category = get_term( $cat_id, 'events_categories' );
593
  $categories[] = $feed_category->name;
594
  }
595
+ $cat_ids = implode( ',', $_REQUEST['feed_category'] );
596
  }
597
 
598
  $args = array(
599
  'feed_url' => $_REQUEST['feed_url'],
600
+ 'feed_name' => $feed_name,
601
  'event_category' => implode( ', ', $categories ),
602
+ 'categories_ids' => $cat_ids,
603
  'tags' => str_replace(
604
  ',',
605
  ', ',
606
  $_REQUEST['feed_tags']
607
  ),
608
+ 'tags_ids' => $_REQUEST['feed_tags'],
609
  'feed_id' => $feed_id,
610
  'comments_enabled' => (bool) intval(
611
  $_REQUEST['comments_enabled']
625
  ),
626
  );
627
 
628
+ // Display added feed row.
629
  $loader = $this->_registry->get( 'theme.loader' );
630
+ $file = $loader->get_file( 'feed_row.php', $args, true );
 
 
631
  $output = $file->get_content();
 
632
  $output = array(
633
+ 'error' => false,
634
+ 'message' => stripslashes( $output ),
635
+ 'update' => $update,
 
 
636
  );
637
  return $json_strategy->render( array( 'data' => $output ) );
638
  }
lib/calendar/updates.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Calendar state container.
5
+ *
6
+ * @author Time.ly Network Inc.
7
+ * @since 2.3
8
+ *
9
+ * @package AI1EC
10
+ * @subpackage AI1EC.Lib.Calendar
11
+ */
12
+ class Ai1ec_Calendar_Updates extends Ai1ec_Base {
13
+
14
+ /**
15
+ * Primary update endpoint.
16
+ *
17
+ * @const string
18
+ */
19
+ const PRIMARY_END_POINT = 'https://update.time.ly/update';
20
+
21
+ /**
22
+ * Alternative update endpoint.
23
+ *
24
+ * @const string
25
+ */
26
+ const SECONDARY_END_POINT = 'http://cdn.update.time.ly/updates/updates.json';
27
+
28
+ /**
29
+ * Check updates and return additional info.
30
+ *
31
+ * @param mixed $transient_data Current transient data.
32
+ *
33
+ * @return mixed Modified transient data.
34
+ */
35
+ public function check_updates( $transient_data ) {
36
+ if ( empty( $transient_data ) ) {
37
+ return $transient_data;
38
+ }
39
+ $updates = $this->_download_updates();
40
+ if ( empty( $updates ) ) {
41
+ return $transient_data;
42
+ }
43
+ $plugins = get_plugins();
44
+ foreach ( $updates as $plugin => $update_data ) {
45
+ /** @var $plugin_data array */
46
+ $plugin_data = isset( $plugins[$plugin] ) ? $plugins[$plugin] : null;
47
+ if (
48
+ empty( $plugin_data['Version'] ) ||
49
+ version_compare( $plugin_data['Version'], $update_data['new_version'], '>=' )
50
+ ) {
51
+ continue;
52
+ }
53
+ $transient_data->response[$plugin] = (object) $update_data;
54
+ }
55
+
56
+ return $transient_data;
57
+ }
58
+
59
+ /**
60
+ * Get plugin data from retrieved and cached data.
61
+ *
62
+ * @param array $data Current data.
63
+ * @param string $action Action name.
64
+ * @param array|null $args Query arguments.
65
+ *
66
+ * @return mixed Plugin data.
67
+ */
68
+ public function plugins_api_filter( $data, $action = '', $args = null ) {
69
+ if (
70
+ 'plugin_information' !== $action ||
71
+ empty( $args->slug ) ||
72
+ 'all-in-one-event-calendar' !== substr( $args->slug, 0, 25 )
73
+ ) {
74
+ return $data;
75
+ }
76
+ $update_data = get_site_transient( 'update_plugins' );
77
+ $plugin_identifier = $args->slug . '/' . $args->slug . '.php';
78
+ if ( empty( $update_data->response[$plugin_identifier] ) ) {
79
+ return $data;
80
+ }
81
+
82
+ return $update_data->response[$plugin_identifier];
83
+ }
84
+
85
+ /**
86
+ * Clear updates related transients.
87
+ *
88
+ * @return void Method does not return.
89
+ */
90
+ public function clear_transients() {
91
+ delete_site_transient( 'ai1ec_update_plugins' );
92
+ delete_site_transient( 'update_plugins' );
93
+ }
94
+
95
+ /**
96
+ * Download update info. Check local transient for cached data.
97
+ *
98
+ * @return array|mixed|null|object Update data.
99
+ */
100
+ protected function _download_updates() {
101
+ $cached_updates = get_site_transient( 'ai1ec_update_plugins' );
102
+ if ( $cached_updates ) {
103
+ return $cached_updates;
104
+ }
105
+ // try first endpoint
106
+ $response = $this->_get_data_from_endpoint( self::PRIMARY_END_POINT );
107
+ if ( is_wp_error( $response ) ) {
108
+ $response = $this->_get_data_from_endpoint( self::SECONDARY_END_POINT );
109
+ }
110
+ if ( is_wp_error( $response ) ) {
111
+ return null;
112
+ }
113
+
114
+ $data = json_decode( wp_remote_retrieve_body( $response ), true );
115
+ set_site_transient( 'ai1ec_update_plugins', $data, 30 * MINUTE_IN_SECONDS );
116
+
117
+ return $data;
118
+ }
119
+
120
+ /**
121
+ * Get update data from given endpoint.
122
+ *
123
+ * @param string $endpoint Endpoint URI.
124
+ *
125
+ * @return array|WP_Error Request result.
126
+ */
127
+ protected function _get_data_from_endpoint( $endpoint ) {
128
+ return wp_remote_get(
129
+ $endpoint,
130
+ array (
131
+ 'timeout' => 15,
132
+ 'sslverify' => false,
133
+ )
134
+ );
135
+ }
136
+ }
lib/command/abstract.php CHANGED
@@ -49,7 +49,9 @@ abstract class Ai1ec_Command {
49
  $plugin = Ai1ec_Request_Parser::get_param( 'plugin', $plugin );
50
  $controller = Ai1ec_Request_Parser::get_param( 'controller', $controller );
51
  $action = Ai1ec_Request_Parser::get_param( 'action', $action );
52
- if ( (string)AI1EC_PLUGIN_NAME === (string)$plugin &&
 
 
53
  null !== $controller &&
54
  null !== $action
55
  ) {
49
  $plugin = Ai1ec_Request_Parser::get_param( 'plugin', $plugin );
50
  $controller = Ai1ec_Request_Parser::get_param( 'controller', $controller );
51
  $action = Ai1ec_Request_Parser::get_param( 'action', $action );
52
+ if (
53
+ is_scalar( $plugin ) &&
54
+ (string)AI1EC_PLUGIN_NAME === (string)$plugin &&
55
  null !== $controller &&
56
  null !== $action
57
  ) {
lib/command/check-updates.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The concrete command that compiles CSS.
5
+ *
6
+ * @author Time.ly Network Inc.
7
+ * @since 2.3
8
+ *
9
+ * @package AI1EC
10
+ * @subpackage AI1EC.Command
11
+ */
12
+ class Ai1ec_Command_Check_Updates extends Ai1ec_Command {
13
+
14
+ /*
15
+ * (non-PHPdoc) @see Ai1ec_Command::is_this_to_execute()
16
+ */
17
+ public function is_this_to_execute() {
18
+ return isset( $_GET['ai1ec_force_updates'] );
19
+ }
20
+
21
+ /* (non-PHPdoc)
22
+ * @see Ai1ec_Command::set_render_strategy()
23
+ */
24
+ public function set_render_strategy( Ai1ec_Request_Parser $request ) {
25
+ $this->_render_strategy = $this->_registry->get(
26
+ 'http.response.render.strategy.redirect'
27
+ );
28
+ }
29
+
30
+ /* (non-PHPdoc)
31
+ * @see Ai1ec_Command::do_execute()
32
+ */
33
+ public function do_execute() {
34
+ $this->_registry->get( 'calendar.updates' )->clear_transients();
35
+
36
+ return array (
37
+ 'url' => ai1ec_admin_url( 'plugins.php' ),
38
+ 'query_args' => array ()
39
+ );
40
+ }
41
+ }
lib/command/clone.php CHANGED
@@ -229,17 +229,24 @@ class Ai1ec_Command_Clone extends Ai1ec_Command {
229
  */
230
  protected function _duplicate_post_copy_post_meta_info( $new_id, $post ) {
231
  $post_meta_keys = get_post_custom_keys( $post->ID );
232
- if ( empty( $post_meta_keys ) ) return;
233
- //$meta_blacklist = explode(",",get_option('duplicate_post_blacklist'));
234
- //if ( $meta_blacklist == "" )
235
- $meta_blacklist = array();
236
- $meta_keys = array_diff( $post_meta_keys, $meta_blacklist );
237
 
238
- foreach ( $meta_keys as $meta_key ) {
239
  $meta_values = get_post_custom_values( $meta_key, $post->ID );
240
  foreach ( $meta_values as $meta_value ) {
241
  $meta_value = maybe_unserialize( $meta_value );
242
- add_post_meta( $new_id, $meta_key, $meta_value );
 
 
 
 
 
 
 
 
 
243
  }
244
  }
245
  }
229
  */
230
  protected function _duplicate_post_copy_post_meta_info( $new_id, $post ) {
231
  $post_meta_keys = get_post_custom_keys( $post->ID );
232
+ if ( empty( $post_meta_keys ) ) {
233
+ return;
234
+ }
 
 
235
 
236
+ foreach ( $post_meta_keys as $meta_key ) {
237
  $meta_values = get_post_custom_values( $meta_key, $post->ID );
238
  foreach ( $meta_values as $meta_value ) {
239
  $meta_value = maybe_unserialize( $meta_value );
240
+ $meta_value = apply_filters(
241
+ 'ai1ec_duplicate_post_meta_value',
242
+ $meta_value,
243
+ $meta_key,
244
+ $post,
245
+ $new_id
246
+ );
247
+ if ( null !== $meta_value ) {
248
+ add_post_meta( $new_id, $meta_key, $meta_value );
249
+ }
250
  }
251
  }
252
  }
lib/command/compile-themes.php CHANGED
@@ -17,8 +17,7 @@ class Ai1ec_Command_Compile_Themes extends Ai1ec_Command {
17
  public function is_this_to_execute() {
18
  return (
19
  AI1EC_DEBUG &&
20
- isset( $_GET['ai1ec_recompile_templates'] ) &&
21
- $_SERVER['REMOTE_ADDR'] === $_SERVER['SERVER_ADDR']
22
  );
23
  }
24
 
17
  public function is_this_to_execute() {
18
  return (
19
  AI1EC_DEBUG &&
20
+ isset( $_GET['ai1ec_recompile_templates'] )
 
21
  );
22
  }
23
 
lib/command/render-event.php CHANGED
@@ -40,7 +40,7 @@ class Ai1ec_Command_Render_Event extends Ai1ec_Command_Render_Calendar {
40
  }
41
 
42
  // Else proceed with rendering valid event. Fetch all relevant details.
43
- $instance = false;
44
  if ( isset( $_REQUEST['instance_id'] ) ) {
45
  $instance = (int)$_REQUEST['instance_id'];
46
  }
40
  }
41
 
42
  // Else proceed with rendering valid event. Fetch all relevant details.
43
+ $instance = -1;
44
  if ( isset( $_REQUEST['instance_id'] ) ) {
45
  $instance = (int)$_REQUEST['instance_id'];
46
  }
lib/command/resolver.php CHANGED
@@ -99,6 +99,16 @@ class Ai1ec_Command_Resolver {
99
  'command.compile-core-css', $request
100
  )
101
  );
 
 
 
 
 
 
 
 
 
 
102
  $request->parse();
103
  $this->_registry = $registry;
104
  $this->_request = $request;
99
  'command.compile-core-css', $request
100
  )
101
  );
102
+ if (
103
+ is_admin() &&
104
+ current_user_can( 'activate_plugins' )
105
+ ) {
106
+ $this->add_command(
107
+ $registry->get(
108
+ 'command.check-updates', $request
109
+ )
110
+ );
111
+ }
112
  $request->parse();
113
  $this->_registry = $registry;
114
  $this->_request = $request;
lib/content/filter.php CHANGED
@@ -66,4 +66,24 @@ class Ai1ec_Content_Filters extends Ai1ec_Base {
66
  $wp_filter['the_content'] = $this->_filters_the_content;
67
  return $this;
68
  }
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  $wp_filter['the_content'] = $this->_filters_the_content;
67
  return $this;
68
  }
69
+
70
+ /**
71
+ * Check if event edit page should display "Move to Trash" button.
72
+ *
73
+ * @param array $allcaps An array of all the user's capabilities.
74
+ * @param array $caps Actual capabilities for meta capability.
75
+ * @param array $args Optional parameters passed to has_cap(), typically object ID.
76
+ * @param \WP_User $user The user object.
77
+ *
78
+ * @return array Capabilities or empty array.
79
+ */
80
+ public function display_trash_link( $allcaps, $caps, $args, WP_User $user ) {
81
+ if (
82
+ isset( $_GET['instance'] ) &&
83
+ in_array( 'delete_published_ai1ec_events', $caps )
84
+ ) {
85
+ return array();
86
+ }
87
+ return $allcaps;
88
+ }
89
+ }
lib/dbi/dbi-utils.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * DBI utils.
5
+ *
6
+ * @author Time.ly Network Inc.
7
+ * @since 2.2
8
+ *
9
+ * @package AI1EC
10
+ * @subpackage AI1EC.Dbi
11
+ */
12
+
13
+ class Ai1ec_Dbi_Utils extends Ai1ec_Base {
14
+
15
+ /**
16
+ * Returns SQL string for INSERT statement.
17
+ *
18
+ * @param array $value Array of values.
19
+ *
20
+ * @return string SQL statement.
21
+ */
22
+ public function array_value_to_sql_value( array $value ) {
23
+ return '(' . implode( ',', array_values( $value ) ) . ')';
24
+ }
25
+ }
lib/environment/check.php CHANGED
@@ -175,7 +175,7 @@ class Ai1ec_Environment_Checks extends Ai1ec_Base {
175
  * or not.
176
  *
177
  * @return void Method does not return.
178
- *
179
  * @throws Ai1ec_Bootstrap_Exception
180
  * @throws Ai1ec_Outdated_Addon_Exception
181
  */
@@ -202,7 +202,7 @@ class Ai1ec_Environment_Checks extends Ai1ec_Base {
202
  $ev_data['Name'],
203
  $min_version
204
  );
205
-
206
  throw new Ai1ec_Outdated_Addon_Exception( $message, $addon );
207
  }
208
  }
175
  * or not.
176
  *
177
  * @return void Method does not return.
178
+ *
179
  * @throws Ai1ec_Bootstrap_Exception
180
  * @throws Ai1ec_Outdated_Addon_Exception
181
  */
202
  $ev_data['Name'],
203
  $min_version
204
  );
205
+ $this->_registry->get( 'calendar.updates' )->clear_transients();
206
  throw new Ai1ec_Outdated_Addon_Exception( $message, $addon );
207
  }
208
  }
lib/factory/html.php CHANGED
@@ -108,6 +108,11 @@ class Ai1ec_Factory_Html extends Ai1ec_Base {
108
  'tag_ids' => $args['tag_ids'],
109
  'exact_date' => "__DATE__",
110
  );
 
 
 
 
 
111
  $data_href = $this->create_href_helper_instance( $href_args );
112
 
113
  $attributes = array(
108
  'tag_ids' => $args['tag_ids'],
109
  'exact_date' => "__DATE__",
110
  );
111
+ $href_args = apply_filters(
112
+ 'ai1ec_date_picker_href_args',
113
+ $href_args,
114
+ $args
115
+ );
116
  $data_href = $this->create_href_helper_instance( $href_args );
117
 
118
  $attributes = array(
lib/html/element/href.php CHANGED
@@ -26,6 +26,7 @@ class Ai1ec_Html_Element_Href {
26
  'auth_ids',
27
  'post_ids',
28
  'tag_ids',
 
29
  'events_limit',
30
  'request_format',
31
  );
26
  'auth_ids',
27
  'post_ids',
28
  'tag_ids',
29
+ 'instance_ids',
30
  'events_limit',
31
  'request_format',
32
  );
lib/html/element/setting/abstract.php CHANGED
@@ -75,10 +75,14 @@ abstract class Ai1ec_Html_Element_Settings extends Ai1ec_Base
75
  $render = $condition;
76
  } else {
77
  $callback = explode( ':', $this->_args['renderer']['condition'] );
78
- $render = $this->_registry->dispatch(
79
- $callback[0],
80
- $callback[1]
81
- );
 
 
 
 
82
  }
83
  if ( ! $render ) {
84
  return '';
75
  $render = $condition;
76
  } else {
77
  $callback = explode( ':', $this->_args['renderer']['condition'] );
78
+ try {
79
+ $render = $this->_registry->dispatch(
80
+ $callback[0],
81
+ $callback[1]
82
+ );
83
+ } catch (Ai1ec_Bootstrap_Exception $exception) {
84
+ $render = '';
85
+ }
86
  }
87
  if ( ! $render ) {
88
  return '';
lib/html/element/setting/input.php CHANGED
@@ -33,6 +33,10 @@ class Ai1ec_Html_Setting_Input extends Ai1ec_Html_Element_Settings {
33
  case 'email':
34
  $input_type = 'email';
35
  break;
 
 
 
 
36
  }
37
 
38
  $input_args = array(
@@ -75,4 +79,4 @@ class Ai1ec_Html_Setting_Input extends Ai1ec_Html_Element_Settings {
75
  return parent::render( $file->get_content() );
76
  }
77
 
78
- }
33
  case 'email':
34
  $input_type = 'email';
35
  break;
36
+
37
+ case 'url':
38
+ $input_type = 'url';
39
+ break;
40
  }
41
 
42
  $input_args = array(
79
  return parent::render( $file->get_content() );
80
  }
81
 
82
+ }
lib/html/element/setting/select.php CHANGED
@@ -25,10 +25,14 @@ class Ai1ec_Html_Setting_Select extends Ai1ec_Html_Element_Settings {
25
  if( false === is_array( $this->_args['value'] ) ){
26
  $value = array( $this->_args['value'] );
27
  }
28
- $options = $this->_registry->dispatch(
29
- $callback[0],
30
- $callback[1]
31
- );
 
 
 
 
32
  }
33
  }
34
  $options = apply_filters( 'ai1ec_settings_select_options' , $options, $this->_args['id'] );
25
  if( false === is_array( $this->_args['value'] ) ){
26
  $value = array( $this->_args['value'] );
27
  }
28
+ try {
29
+ $options = $this->_registry->dispatch(
30
+ $callback[0],
31
+ $callback[1]
32
+ );
33
+ } catch (Ai1ec_Bootstrap_Exception $exc) {
34
+ return '';
35
+ }
36
  }
37
  }
38
  $options = apply_filters( 'ai1ec_settings_select_options' , $options, $this->_args['id'] );
lib/http/request/parser.php CHANGED
@@ -95,6 +95,7 @@ class Ai1ec_Request_Parser extends Ai1ec_Abstract_Query {
95
  $this->add_rule( 'cat_ids', false, 'int', null, ',' );
96
  $this->add_rule( 'tag_ids', false, 'int', null, ',' );
97
  $this->add_rule( 'post_ids', false, 'int', null, ',' );
 
98
  $this->add_rule( 'auth_ids', false, 'int', null, ',' );
99
  $this->add_rule( 'term_ids', false, 'int', null, ',' );
100
  $this->add_rule( 'exact_date', false, 'string', null, false );
95
  $this->add_rule( 'cat_ids', false, 'int', null, ',' );
96
  $this->add_rule( 'tag_ids', false, 'int', null, ',' );
97
  $this->add_rule( 'post_ids', false, 'int', null, ',' );
98
+ $this->add_rule( 'instance_ids', false, 'int', null, ',' );
99
  $this->add_rule( 'auth_ids', false, 'int', null, ',' );
100
  $this->add_rule( 'term_ids', false, 'int', null, ',' );
101
  $this->add_rule( 'exact_date', false, 'string', null, false );
lib/import-export/ics.php CHANGED
@@ -18,6 +18,13 @@ class Ai1ec_Ics_Import_Export_Engine
18
  */
19
  protected $_taxonomy_model = null;
20
 
 
 
 
 
 
 
 
21
  /* (non-PHPdoc)
22
  * @see Ai1ec_Import_Export_Engine::import()
23
  */
@@ -141,10 +148,12 @@ class Ai1ec_Ics_Import_Export_Engine
141
 
142
  // Fetch default timezone in case individual properties don't define it
143
  $tz = $v->getComponent( 'vtimezone' );
 
144
  if ( ! empty( $tz ) ) {
145
  $timezone = $tz->getProperty( 'TZID' );
146
  }
147
 
 
148
  $x_wr_timezone = $v->getProperty( 'X-WR-TIMEZONE' );
149
  if (
150
  isset( $x_wr_timezone[1] ) &&
@@ -453,9 +462,7 @@ class Ai1ec_Ics_Import_Export_Engine
453
  }
454
  // Detect URL.
455
  elseif ( false !== strpos( $el, '://' ) ) {
456
- $data['contact_url'] = $this->_parse_legacy_loggable_url(
457
- $el
458
- );
459
  }
460
  // Detect phone number.
461
  elseif ( preg_match( '/\d/', $el ) ) {
@@ -479,9 +486,7 @@ class Ai1ec_Ics_Import_Export_Engine
479
  'venue' => $venue,
480
  'address' => $address,
481
  'cost' => $cost,
482
- 'ticket_url' => $this->_parse_legacy_loggable_url(
483
- $ticket_url
484
- ),
485
  'show_map' => $event_do_show_map,
486
  'ical_feed_url' => $feed->feed_url,
487
  'ical_source_url' => $e->getProperty( 'url' ),
@@ -593,36 +598,10 @@ class Ai1ec_Ics_Import_Export_Engine
593
  'count' => $count,
594
  'events_to_delete' => $events_in_db,
595
  'messages' => $messages,
 
596
  );
597
  }
598
 
599
- /**
600
- * Convert loggable URL exported from legacy Ai1EC installation.
601
- *
602
- * @param string $loggable_url Likely loggable URL.
603
- *
604
- * @return string Non-loggable URL.
605
- */
606
- protected function _parse_legacy_loggable_url( $loggable_url ) {
607
- if ( 0 !== strpos( $loggable_url, AI1EC_REDIRECTION_SERVICE ) ) {
608
- return $loggable_url; // it wasn't loggable URL
609
- }
610
- $value = base64_decode(
611
- substr( $loggable_url, strlen( AI1EC_REDIRECTION_SERVICE ) )
612
- );
613
- $clear_url = null; // return empty if nothing is parseable
614
- if ( // valid JSON structure remains
615
- null !== ( $decoded = json_decode( $value, true ) ) &&
616
- isset( $decoded['l'] )
617
- ) {
618
- $clear_url = $decoded['l'];
619
- } else if ( preg_match( '|"l"\s*:\s*"(.+?)","|', $value, $matches ) ) {
620
- // reverting to dirty parsing as JSON is broken
621
- $clear_url = stripslashes( $matches[1] );
622
- } // no more else - impossible to parse anything
623
- return $clear_url;
624
- }
625
-
626
  /**
627
  * Parse importable feed timezone to sensible value.
628
  *
@@ -946,7 +925,7 @@ class Ai1ec_Ics_Import_Export_Engine
946
  $e->setProperty(
947
  'X-TICKETS-URL',
948
  $this->_sanitize_value(
949
- $event->get_nonloggable_url( $event->get( 'ticket_url' ) )
950
  )
951
  );
952
  }
@@ -967,7 +946,7 @@ class Ai1ec_Ics_Import_Export_Engine
967
  $event->get( 'contact_name' ),
968
  $event->get( 'contact_phone' ),
969
  $event->get( 'contact_email' ),
970
- $event->get_nonloggable_url( $event->get( 'contact_url' ) ),
971
  );
972
  $contact = array_filter( $contact );
973
  $contact = implode( '; ', $contact );
@@ -978,9 +957,10 @@ class Ai1ec_Ics_Import_Export_Engine
978
  // ====================
979
  $rrule = array();
980
  $recurrence = $event->get( 'recurrence_rules' );
 
981
  if ( ! empty( $recurrence ) ) {
982
  $rules = array();
983
- foreach ( explode( ';', $event->get( 'recurrence_rules' ) ) as $v) {
984
  if ( strpos( $v, '=' ) === false ) {
985
  continue;
986
  }
@@ -1021,6 +1001,7 @@ class Ai1ec_Ics_Import_Export_Engine
1021
  // = Exception rules =
1022
  // ===================
1023
  $exceptions = $event->get( 'exception_rules' );
 
1024
  $exrule = array();
1025
  if ( ! empty( $exceptions ) ) {
1026
  $rules = array();
@@ -1078,6 +1059,7 @@ class Ai1ec_Ics_Import_Export_Engine
1078
  // For other other events which use DATETIME, we must use that as well
1079
  // We must also match the exact starting time
1080
  $recurrence_dates = $event->get( 'recurrence_dates' );
 
1081
  if ( ! empty( $recurrence_dates ) ) {
1082
  $params = array(
1083
  'VALUE' => 'DATE-TIME',
@@ -1100,6 +1082,7 @@ class Ai1ec_Ics_Import_Export_Engine
1100
  }
1101
  }
1102
  $exception_dates = $event->get( 'exception_dates' );
 
1103
  if ( ! empty( $exception_dates ) ) {
1104
  $params = array(
1105
  'VALUE' => 'DATE-TIME',
@@ -1252,4 +1235,18 @@ class Ai1ec_Ics_Import_Export_Engine
1252
  return $exclusions;
1253
  }
1254
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1255
  }
18
  */
19
  protected $_taxonomy_model = null;
20
 
21
+ /**
22
+ * Recurrence rule class. Contains filter method.
23
+ *
24
+ * @var Ai1ec_Recurrence_Rule
25
+ */
26
+ protected $_rule_filter = null;
27
+
28
  /* (non-PHPdoc)
29
  * @see Ai1ec_Import_Export_Engine::import()
30
  */
148
 
149
  // Fetch default timezone in case individual properties don't define it
150
  $tz = $v->getComponent( 'vtimezone' );
151
+ $timezone = 'sys.default';
152
  if ( ! empty( $tz ) ) {
153
  $timezone = $tz->getProperty( 'TZID' );
154
  }
155
 
156
+ $feed_name = $v->getProperty( 'X-WR-CALNAME' );
157
  $x_wr_timezone = $v->getProperty( 'X-WR-TIMEZONE' );
158
  if (
159
  isset( $x_wr_timezone[1] ) &&
462
  }
463
  // Detect URL.
464
  elseif ( false !== strpos( $el, '://' ) ) {
465
+ $data['contact_url'] = $el;
 
 
466
  }
467
  // Detect phone number.
468
  elseif ( preg_match( '/\d/', $el ) ) {
486
  'venue' => $venue,
487
  'address' => $address,
488
  'cost' => $cost,
489
+ 'ticket_url' => $ticket_url,
 
 
490
  'show_map' => $event_do_show_map,
491
  'ical_feed_url' => $feed->feed_url,
492
  'ical_source_url' => $e->getProperty( 'url' ),
598
  'count' => $count,
599
  'events_to_delete' => $events_in_db,
600
  'messages' => $messages,
601
+ 'name' => $feed_name,
602
  );
603
  }
604
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
605
  /**
606
  * Parse importable feed timezone to sensible value.
607
  *
925
  $e->setProperty(
926
  'X-TICKETS-URL',
927
  $this->_sanitize_value(
928
+ $event->get( 'ticket_url' )
929
  )
930
  );
931
  }
946
  $event->get( 'contact_name' ),
947
  $event->get( 'contact_phone' ),
948
  $event->get( 'contact_email' ),
949
+ $event->get( 'contact_url' ),
950
  );
951
  $contact = array_filter( $contact );
952
  $contact = implode( '; ', $contact );
957
  // ====================
958
  $rrule = array();
959
  $recurrence = $event->get( 'recurrence_rules' );
960
+ $recurrence = $this->_filter_rule( $recurrence );
961
  if ( ! empty( $recurrence ) ) {
962
  $rules = array();
963
+ foreach ( explode( ';', $recurrence ) as $v) {
964
  if ( strpos( $v, '=' ) === false ) {
965
  continue;
966
  }
1001
  // = Exception rules =
1002
  // ===================
1003
  $exceptions = $event->get( 'exception_rules' );
1004
+ $exceptions = $this->_filter_rule( $exceptions );
1005
  $exrule = array();
1006
  if ( ! empty( $exceptions ) ) {
1007
  $rules = array();
1059
  // For other other events which use DATETIME, we must use that as well
1060
  // We must also match the exact starting time
1061
  $recurrence_dates = $event->get( 'recurrence_dates' );
1062
+ $recurrence_dates = $this->_filter_rule( $recurrence_dates );
1063
  if ( ! empty( $recurrence_dates ) ) {
1064
  $params = array(
1065
  'VALUE' => 'DATE-TIME',
1082
  }
1083
  }
1084
  $exception_dates = $event->get( 'exception_dates' );
1085
+ $exception_dates = $this->_filter_rule( $exception_dates );
1086
  if ( ! empty( $exception_dates ) ) {
1087
  $params = array(
1088
  'VALUE' => 'DATE-TIME',
1235
  return $exclusions;
1236
  }
1237
 
1238
+ /**
1239
+ * Filter recurrence / exclusion rule or dates. Avoid throwing exception for old, malformed values.
1240
+ *
1241
+ * @param string $rule Rule or dates value.
1242
+ *
1243
+ * @return string Fixed rule or dates value.
1244
+ */
1245
+ protected function _filter_rule( $rule ) {
1246
+ if ( null === $this->_rule_filter ) {
1247
+ $this->_rule_filter = $this->_registry->get( 'recurrence.rule' );
1248
+ }
1249
+ return $this->_rule_filter->filter_rule( $rule );
1250
+ }
1251
+
1252
  }
lib/post/custom-type.php CHANGED
@@ -187,7 +187,11 @@ class Ai1ec_Post_Custom_Type extends Ai1ec_Base {
187
  // if it's present and has the wrong capability delete it.
188
  if (
189
  $contributor instanceOf WP_Role &&
190
- $contributor->has_cap( 'publish_ai1ec_events' )
 
 
 
 
191
  ) {
192
  remove_role( 'ai1ec_event_assistant' );
193
  $contributor = false;
@@ -205,6 +209,8 @@ class Ai1ec_Post_Custom_Type extends Ai1ec_Base {
205
  $role->add_cap( 'edit_ai1ec_events' );
206
  $role->add_cap( 'read_ai1ec_events' );
207
  $role->add_cap( 'delete_ai1ec_events' );
 
 
208
  $role->add_cap( 'read' );
209
  unset( $caps, $role );
210
  }
187
  // if it's present and has the wrong capability delete it.
188
  if (
189
  $contributor instanceOf WP_Role &&
190
+ (
191
+ $contributor->has_cap( 'publish_ai1ec_events' ) ||
192
+ ! $contributor->has_cap( 'edit_published_ai1ec_events' ) ||
193
+ ! $contributor->has_cap( 'delete_published_ai1ec_events' )
194
+ )
195
  ) {
196
  remove_role( 'ai1ec_event_assistant' );
197
  $contributor = false;
209
  $role->add_cap( 'edit_ai1ec_events' );
210
  $role->add_cap( 'read_ai1ec_events' );
211
  $role->add_cap( 'delete_ai1ec_events' );
212
+ $role->add_cap( 'edit_published_ai1ec_events' );
213
+ $role->add_cap( 'delete_published_ai1ec_events' );
214
  $role->add_cap( 'read' );
215
  unset( $caps, $role );
216
  }
lib/recurrence/rule.php CHANGED
@@ -182,6 +182,24 @@ class Ai1ec_Recurrence_Rule extends Ai1ec_Base {
182
  return implode( ', ', $dates_to_add );
183
  }
184
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  /**
186
  * when using BYday you need an array of arrays.
187
  * This function create valid arrays that keep into account the presence
@@ -207,7 +225,7 @@ class Ai1ec_Recurrence_Rule extends Ai1ec_Base {
207
  **/
208
  protected function _get_sentence_by( &$txt, $freq, $rc ) {
209
  global $wp_locale;
210
-
211
  switch( $freq ) {
212
  case 'weekly':
213
  if( $rc->getByDay() ) {
@@ -320,7 +338,7 @@ class Ai1ec_Recurrence_Rule extends Ai1ec_Base {
320
  break;
321
  }
322
  }
323
-
324
  /**
325
  * _ordinal function
326
  *
@@ -330,17 +348,17 @@ class Ai1ec_Recurrence_Rule extends Ai1ec_Base {
330
  **/
331
  protected function _ordinal( $cdnl ) {
332
  $locale = explode( '_', get_locale() );
333
-
334
  if( isset( $locale[0] ) && $locale[0] != 'en' )
335
  return $cdnl;
336
-
337
  $test_c = abs($cdnl) % 10;
338
  $ext = ( ( abs( $cdnl ) % 100 < 21 && abs( $cdnl ) % 100 > 4 ) ? 'th'
339
  : ( ( $test_c < 4 ) ? ( $test_c < 3 ) ? ( $test_c < 2 ) ? ( $test_c < 1 )
340
  ? 'th' : 'st' : 'nd' : 'rd' : 'th' ) );
341
  return $cdnl.$ext;
342
  }
343
-
344
  /**
345
  * Returns the textual representation of the given recurrence frequency and
346
  * interval, with result stored in $txt.
@@ -447,7 +465,7 @@ class Ai1ec_Recurrence_Rule extends Ai1ec_Base {
447
  $this->_registry->get(
448
  'date.time',
449
  $until
450
- )->format_i18n(
451
  $this->_registry->get( 'model.option')->get( 'date_format' )
452
  )
453
  );
@@ -460,6 +478,6 @@ class Ai1ec_Recurrence_Rule extends Ai1ec_Base {
460
  $txt .= ', ' . Ai1ec_I18n::__( 'forever' );
461
  }
462
  }
463
-
464
 
465
  }
182
  return implode( ', ', $dates_to_add );
183
  }
184
 
185
+ /**
186
+ * Filter recurrence / exclusion rule or dates. Avoid throwing exception for old, malformed values.
187
+ *
188
+ * @param string $rule Rule or dates value.
189
+ *
190
+ * @return string Fixed rule or dates value.
191
+ */
192
+ public function filter_rule( $rule ) {
193
+ $matches = null;
194
+ if (
195
+ empty( $rule ) ||
196
+ ! preg_match('/(T[0-9]+)(ZUNTIL=[0-9Z;T]+)/i', $rule, $matches)
197
+ ) {
198
+ return $rule;
199
+ }
200
+ return preg_replace('/(T[0-9]+)(ZUNTIL=[0-9Z;T]+)/i', '$1', $rule);
201
+ }
202
+
203
  /**
204
  * when using BYday you need an array of arrays.
205
  * This function create valid arrays that keep into account the presence
225
  **/
226
  protected function _get_sentence_by( &$txt, $freq, $rc ) {
227
  global $wp_locale;
228
+
229
  switch( $freq ) {
230
  case 'weekly':
231
  if( $rc->getByDay() ) {
338
  break;
339
  }
340
  }
341
+
342
  /**
343
  * _ordinal function
344
  *
348
  **/
349
  protected function _ordinal( $cdnl ) {
350
  $locale = explode( '_', get_locale() );
351
+
352
  if( isset( $locale[0] ) && $locale[0] != 'en' )
353
  return $cdnl;
354
+
355
  $test_c = abs($cdnl) % 10;
356
  $ext = ( ( abs( $cdnl ) % 100 < 21 && abs( $cdnl ) % 100 > 4 ) ? 'th'
357
  : ( ( $test_c < 4 ) ? ( $test_c < 3 ) ? ( $test_c < 2 ) ? ( $test_c < 1 )
358
  ? 'th' : 'st' : 'nd' : 'rd' : 'th' ) );
359
  return $cdnl.$ext;
360
  }
361
+
362
  /**
363
  * Returns the textual representation of the given recurrence frequency and
364
  * interval, with result stored in $txt.
465
  $this->_registry->get(
466
  'date.time',
467
  $until
468
+ )->format_i18n(
469
  $this->_registry->get( 'model.option')->get( 'date_format' )
470
  )
471
  );
478
  $txt .= ', ' . Ai1ec_I18n::__( 'forever' );
479
  }
480
  }
481
+
482
 
483
  }
lib/template/link/helper.php CHANGED
@@ -39,4 +39,25 @@ class Ai1ec_Template_Link_Helper {
39
  public function get_permalink( $id = 0, $leavename = false ) {
40
  return get_permalink( $id, $leavename );
41
  }
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  public function get_permalink( $id = 0, $leavename = false ) {
40
  return get_permalink( $id, $leavename );
41
  }
42
+
43
+ /**
44
+ * Retrieve full calendar permalink even if Calendar page is set to be
45
+ * homepage.
46
+ *
47
+ * @param int|object $post Optional. Post ID or object.
48
+ * @param bool $leavename Optional. Leave name.
49
+ * @param bool $sample Optional. Sample permalink.
50
+ *
51
+ * @return string
52
+ */
53
+ public function get_full_permalink(
54
+ $post = false,
55
+ $leavename = false,
56
+ $sample = false
57
+ ) {
58
+ if ( false === $post ) {
59
+ return '';
60
+ }
61
+ return _get_page_link( $post, $leavename, $sample );
62
+ }
63
+ }
public/admin/box_event_contact.php CHANGED
@@ -53,14 +53,14 @@
53
  <tr>
54
  <td>
55
  <label for="ai1ec_contact_url">
56
- <?php _e( 'External URL:', AI1EC_PLUGIN_NAME ); ?>
57
  </label>
58
  </td>
59
  <td>
60
  <input type="text" name="ai1ec_contact_url"
61
  id="ai1ec_contact_url"
62
  class="ai1ec-form-control"
63
- value="<?php echo esc_attr( $event->get_nonloggable_url( $contact_url ) ); ?>">
64
  </td>
65
  </tr>
66
  </tbody>
53
  <tr>
54
  <td>
55
  <label for="ai1ec_contact_url">
56
+ <?php _e( 'Website URL:', AI1EC_PLUGIN_NAME ); ?>
57
  </label>
58
  </td>
59
  <td>
60
  <input type="text" name="ai1ec_contact_url"
61
  id="ai1ec_contact_url"
62
  class="ai1ec-form-control"
63
+ value="<?php echo esc_attr( $contact_url ); ?>">
64
  </td>
65
  </tr>
66
  </tbody>
public/admin/box_event_cost.php CHANGED
@@ -47,7 +47,7 @@
47
  <td>
48
  <input type="text" name="ai1ec_ticket_url" id="ai1ec_ticket_url"
49
  class="ai1ec-form-control"
50
- value="<?php echo esc_attr( $event->get_nonloggable_url( $ticket_url ) ); ?>">
51
  </td>
52
  </tr>
53
  </tbody>
47
  <td>
48
  <input type="text" name="ai1ec_ticket_url" id="ai1ec_ticket_url"
49
  class="ai1ec-form-control"
50
+ value="<?php echo esc_attr( $ticket_url ); ?>">
51
  </td>
52
  </tr>
53
  </tbody>
public/admin/box_repeat.php CHANGED
@@ -11,27 +11,27 @@
11
 
12
  <big>
13
  <ul class="ai1ec-nav ai1ec-nav-pills ai1ec-row">
14
- <li class="ai1ec-active ai1ec-col-xs-4 ai1ec-col-sm-2 ai1ec-text-center">
15
  <a href="#ai1ec_daily_content" data-toggle="ai1ec-tab">
16
  <?php _e( 'Daily', AI1EC_PLUGIN_NAME ) ;?>
17
  </a>
18
  </li>
19
- <li class="ai1ec-col-xs-4 ai1ec-col-sm-2 ai1ec-text-center">
20
  <a href="#ai1ec_weekly_content" data-toggle="ai1ec-tab">
21
  <?php _e( 'Weekly', AI1EC_PLUGIN_NAME ) ;?>
22
  </a>
23
  </li>
24
- <li class="ai1ec-col-xs-4 ai1ec-col-sm-2 ai1ec-text-center">
25
  <a href="#ai1ec_monthly_content" data-toggle="ai1ec-tab">
26
  <?php _e( 'Monthly', AI1EC_PLUGIN_NAME ) ;?>
27
  </a>
28
  </li>
29
- <li class="ai1ec-col-xs-4 ai1ec-col-sm-2 ai1ec-text-center">
30
  <a href="#ai1ec_yearly_content" data-toggle="ai1ec-tab">
31
  <?php _e( 'Yearly', AI1EC_PLUGIN_NAME ) ;?>
32
  </a>
33
  </li>
34
- <li class="ai1ec-col-xs-4 ai1ec-col-sm-2 ai1ec-text-center">
35
  <a href="#ai1ec_custom_content" data-toggle="ai1ec-tab">
36
  <?php _e( 'Custom', AI1EC_PLUGIN_NAME ) ;?>
37
  </a>
@@ -41,37 +41,37 @@
41
  <p></p>
42
  </big>
43
 
44
- <div class="ai1ec-tab-content">
45
  <div id="ai1ec_daily_content" data-freq="daily"
46
- class="ai1ec-tab-pane ai1ec-active">
47
  <?php echo $row_daily; ?>
48
  </div>
49
  <div id="ai1ec_weekly_content" data-freq="weekly"
50
- class="ai1ec-tab-pane">
51
  <?php echo $row_weekly; ?>
52
  </div>
53
  <div id="ai1ec_monthly_content" data-freq="monthly"
54
- class="ai1ec-tab-pane">
55
  <?php echo $row_monthly; ?>
56
  </div>
57
  <div id="ai1ec_yearly_content" data-freq="yearly"
58
- class="ai1ec-tab-pane">
59
  <?php echo $row_yearly; ?>
60
  </div>
61
  <div id="ai1ec_custom_content" data-freq="custom"
62
- class="ai1ec-tab-pane">
63
  <?php echo $row_custom; ?>
64
  </div>
65
  </div>
66
  </div>
67
 
68
  <div class="ai1ec-modal-footer">
69
- <div class="ai1ec-form-horizontal ai1ec-text-left">
70
  <div class="ai1ec-form-group">
71
  <label for="ai1ec_end" class="ai1ec-control-label ai1ec-col-sm-3">
72
  <?php _e( 'End', AI1EC_PLUGIN_NAME ); ?>:
73
  </label>
74
- <div class="ai1ec-col-sm-9">
75
  <?php echo $end; ?>
76
  </div>
77
  </div>
11
 
12
  <big>
13
  <ul class="ai1ec-nav ai1ec-nav-pills ai1ec-row">
14
+ <li class="ai1ec-col-xs-4 ai1ec-col-sm-2 ai1ec-text-center ai1ec-freq-daily ai1ec-freq">
15
  <a href="#ai1ec_daily_content" data-toggle="ai1ec-tab">
16
  <?php _e( 'Daily', AI1EC_PLUGIN_NAME ) ;?>
17
  </a>
18
  </li>
19
+ <li class="ai1ec-col-xs-4 ai1ec-col-sm-2 ai1ec-text-center ai1ec-freq-weekly ai1ec-freq">
20
  <a href="#ai1ec_weekly_content" data-toggle="ai1ec-tab">
21
  <?php _e( 'Weekly', AI1EC_PLUGIN_NAME ) ;?>
22
  </a>
23
  </li>
24
+ <li class="ai1ec-col-xs-4 ai1ec-col-sm-2 ai1ec-text-center ai1ec-freq-monthly ai1ec-freq">
25
  <a href="#ai1ec_monthly_content" data-toggle="ai1ec-tab">
26
  <?php _e( 'Monthly', AI1EC_PLUGIN_NAME ) ;?>
27
  </a>
28
  </li>
29
+ <li class="ai1ec-col-xs-4 ai1ec-col-sm-2 ai1ec-text-center ai1ec-freq-yearly ai1ec-freq">
30
  <a href="#ai1ec_yearly_content" data-toggle="ai1ec-tab">
31
  <?php _e( 'Yearly', AI1EC_PLUGIN_NAME ) ;?>
32
  </a>
33
  </li>
34
+ <li class="ai1ec-col-xs-4 ai1ec-col-sm-2 ai1ec-text-center ai1ec-freq-custom ai1ec-freq">
35
  <a href="#ai1ec_custom_content" data-toggle="ai1ec-tab">
36
  <?php _e( 'Custom', AI1EC_PLUGIN_NAME ) ;?>
37
  </a>
41
  <p></p>
42
  </big>
43
 
44
+ <div class="ai1ec-tab-content" id="ai1ec-tab-content" data-active-freq="<?php echo $selected_tab; ?>">
45
  <div id="ai1ec_daily_content" data-freq="daily"
46
+ class="ai1ec-tab-pane ai1ec-freq ai1ec-freq-daily">
47
  <?php echo $row_daily; ?>
48
  </div>
49
  <div id="ai1ec_weekly_content" data-freq="weekly"
50
+ class="ai1ec-tab-pane ai1ec-freq ai1ec-freq-weekly">
51
  <?php echo $row_weekly; ?>
52
  </div>
53
  <div id="ai1ec_monthly_content" data-freq="monthly"
54
+ class="ai1ec-tab-pane ai1ec-freq ai1ec-freq-monthly">
55
  <?php echo $row_monthly; ?>
56
  </div>
57
  <div id="ai1ec_yearly_content" data-freq="yearly"
58
+ class="ai1ec-tab-pane ai1ec-freq ai1ec-freq-yearly">
59
  <?php echo $row_yearly; ?>
60
  </div>
61
  <div id="ai1ec_custom_content" data-freq="custom"
62
+ class="ai1ec-tab-pane ai1ec-freq ai1ec-freq-custom">
63
  <?php echo $row_custom; ?>
64
  </div>
65
  </div>
66
  </div>
67
 
68
  <div class="ai1ec-modal-footer">
69
+ <div class="ai1ec-form-horizontal ai1ec-text-left ai1ec-end-field">
70
  <div class="ai1ec-form-group">
71
  <label for="ai1ec_end" class="ai1ec-control-label ai1ec-col-sm-3">
72
  <?php _e( 'End', AI1EC_PLUGIN_NAME ); ?>:
73
  </label>
74
+ <div class="ai1ec-col-sm-9" id="end-input" data-ending-type="<?php echo $ending_type; ?>">
75
  <?php echo $end; ?>
76
  </div>
77
  </div>
public/admin/css/settings.css CHANGED
@@ -181,6 +181,25 @@
181
  margin: 0.45em;
182
  }
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  /* Calendar theme options */
185
 
186
  #ai1ec-less-variables-tabs .inside {
181
  margin: 0.45em;
182
  }
183
 
184
+ #ics .ai1ec-form-group {
185
+ width: 100%;
186
+ }
187
+ #ics .ai1ec-panel-heading a {
188
+ word-break: break-word;
189
+ }
190
+ #ics .ai1ec-feed-url {
191
+ margin-bottom: 15px;
192
+ }
193
+ #ics .ai1ec-feed-actions {
194
+ margin-top: 15px;
195
+ }
196
+ #ics #ai1ec_cancel_ics {
197
+ display: none;
198
+ }
199
+ #ics .ai1ec-form-group {
200
+ margin-bottom: 10px;
201
+ }
202
+
203
  /* Calendar theme options */
204
 
205
  #ai1ec-less-variables-tabs .inside {
public/admin/css/super-widget.css CHANGED
@@ -9,3 +9,14 @@
9
  #ai1ec-widget-creator .ai1ec-nav {
10
  margin-bottom: 8px;
11
  }
 
 
 
 
 
 
 
 
 
 
 
9
  #ai1ec-widget-creator .ai1ec-nav {
10
  margin-bottom: 8px;
11
  }
12
+
13
+ #ai1ec-widget-creator .ai1ec-default-filters .ai1ec-col-md-6 {
14
+ padding-right: 0;
15
+ }
16
+ #ai1ec-widget-creator .ai1ec-default-filters .ai1ec-col-sm-9 {
17
+ padding-right: 30px;
18
+ }
19
+ #ai1ec-widget-creator .ai1ec-default-filters .ai1ec-col-md-6 label {
20
+ font-size: smaller;
21
+ margin-bottom: 1px;
22
+ }
public/admin/feed_row.php CHANGED
@@ -1,100 +1,127 @@
1
- <div class="ai1ec-feed-container ai1ec-well ai1ec-well-sm ai1ec-clearfix">
2
- <div class="ai1ec-form-group">
3
- <label><?php _e( 'iCalendar/.ics Feed URL:', AI1EC_PLUGIN_NAME ); ?></label>
4
- <input type="text" class="ai1ec-feed-url ai1ec-form-control"
5
- readonly="readonly" value="<?php echo esc_attr( $feed_url ) ?>">
 
 
6
  </div>
7
- <input type="hidden" name="feed_id" class="ai1ec_feed_id"
8
- value="<?php echo $feed_id;?>">
9
- <div class="ai1ec-clearfix">
10
- <?php if ( $event_category ) : ?>
11
- <div class="ai1ec-feed-category ai1ec-pull-left">
12
- <?php _e( 'Event categories:', AI1EC_PLUGIN_NAME ); ?>
13
- <strong><?php echo $event_category; ?></strong>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  </div>
15
- <?php endif; ?>
16
- <?php if ( $tags ) : ?>
17
- <div class="ai1ec-feed-tags ai1ec-pull-left">
18
- <?php _e( 'Tag with', AI1EC_PLUGIN_NAME ); ?>:
19
- <strong><?php echo $tags; ?></strong>
20
- </div>
21
- <?php endif; ?>
22
- </div>
23
- <?php do_action( 'ai1ec_ics_row_after_categories_tags', $feed_id ); ?>
24
- <div class="ai1ec-clearfix">
25
- <div class="ai1ec-feed-comments-enabled ai1ec-pull-left">
26
- <?php _e( 'Allow comments', AI1EC_PLUGIN_NAME ); ?>:
27
- <strong><?php
28
- if ( $comments_enabled ) {
29
- _e( 'Yes', AI1EC_PLUGIN_NAME );
30
- } else {
31
- _e( 'No', AI1EC_PLUGIN_NAME );
32
- }
33
- ?></strong>
34
  </div>
35
- <div class="ai1ec-feed-map-display-enabled ai1ec-pull-left">
36
- <?php _e( 'Show map', AI1EC_PLUGIN_NAME ); ?>:
37
- <strong><?php
38
- if ( $map_display_enabled ) {
39
- _e( 'Yes', AI1EC_PLUGIN_NAME );
40
- } else {
41
- _e( 'No', AI1EC_PLUGIN_NAME );
42
- }
43
- ?></strong>
44
- </div>
45
- </div>
46
- <div class="ai1ec-feed-keep-tags-categories">
47
- <?php _e( 'Keep original events categories and tags', AI1EC_PLUGIN_NAME ); ?>:
48
- <strong><?php
49
- if ( $keep_tags_categories ) {
50
- _e( 'Yes', AI1EC_PLUGIN_NAME );
51
- } else {
52
- _e( 'No', AI1EC_PLUGIN_NAME );
53
- }
54
- ?></strong>
55
- </div>
56
- <?php do_action( 'ai1ec_ics_row_after_keep_categories_tags', $feed_id ); ?>
57
- <div class="ai1ec-feed-keep-old-events">
58
- <?php _e( 'On refresh, preserve previously imported events that are missing from the feed', AI1EC_PLUGIN_NAME ); ?>:
59
- <strong><?php
60
- if ( $keep_old_events ) {
61
- _e( 'Yes', AI1EC_PLUGIN_NAME );
62
- } else {
63
- _e( 'No', AI1EC_PLUGIN_NAME );
64
- }
65
- ?></strong>
66
- </div>
67
- <div class="ai1ec-feed-import-timezone">
68
- <span class="ai1ec-tooltip-toggle" title="<?php _e( 'Guesses the time zone of events that have none specified; recommended for Google Calendar feeds', AI1EC_PLUGIN_NAME ); ?>">
69
- <?php _e( 'Assign default time zone to events in UTC', AI1EC_PLUGIN_NAME );
70
- ?>:</span>
71
- <strong><?php
72
- if ( $feed_import_timezone ) {
73
- _e( 'Yes', AI1EC_PLUGIN_NAME );
74
- } else {
75
- _e( 'No', AI1EC_PLUGIN_NAME );
76
- } ?>
77
- </strong>
78
- </div>
79
- <?php do_action( 'ai1ec_ics_row_after_settings', $feed_id ); ?>
80
- <div class="ai1ec-btn-group ai1ec-pull-right">
81
- <button type="button"
82
- class="ai1ec-btn ai1ec-btn-sm ai1ec-btn-default ai1ec-text-primary
83
- ai1ec_update_ics"
84
- data-loading-text="<?php echo esc_attr(
85
- '<i class="ai1ec-fa ai1ec-fa-refresh ai1ec-fa-spin ai1ec-fa-fw"></i> ' .
86
- __( 'Refreshing&#8230;', AI1EC_PLUGIN_NAME ) ); ?>">
87
- <i class="ai1ec-fa ai1ec-fa-refresh ai1ec-fa-fw"></i>
88
- <?php _e( 'Refresh', AI1EC_PLUGIN_NAME ); ?>
89
- </button>
90
- <button type="button"
91
- class="ai1ec-btn ai1ec-btn-sm ai1ec-btn-default ai1ec-text-danger
92
- ai1ec_delete_ics"
93
- data-loading-text="<?php echo esc_attr(
94
- '<i class="ai1ec-fa ai1ec-fa-spinner ai1ec-fa-spin ai1ec-fa-fw"></i> ' .
95
- __( 'Removing&#8230;', AI1EC_PLUGIN_NAME ) ); ?>">
96
- <i class="ai1ec-fa ai1ec-fa-times ai1ec-fa-fw"></i>
97
- <?php _e( 'Remove', AI1EC_PLUGIN_NAME ); ?>
98
- </button>
99
  </div>
100
  </div>
1
+ <div class="ai1ec-panel ai1ec-panel-default ai1ec-feed-container">
2
+ <div class="ai1ec-panel-heading">
3
+ <a data-toggle="ai1ec-collapse"
4
+ data-parent="#ai1ec-feeds-accordion"
5
+ href="#ai1ec-feed-<?php echo $feed_id; ?>">
6
+ <?php echo $feed_name; ?>
7
+ </a>
8
  </div>
9
+ <div class="ai1ec-panel-collapse ai1ec-collapse"
10
+ id="ai1ec-feed-<?php echo $feed_id; ?>">
11
+ <div class="ai1ec-panel-body">
12
+ <div class="ai1ec-feed-content">
13
+ <div class="ai1ec-form-group">
14
+ <label><?php _e( 'iCalendar/.ics Feed URL:', AI1EC_PLUGIN_NAME ); ?></label>
15
+ <input type="text" class="ai1ec-feed-url ai1ec-form-control"
16
+ readonly="readonly" value="<?php echo esc_attr( $feed_url ) ?>">
17
+ </div>
18
+ <input type="hidden" name="feed_id" class="ai1ec_feed_id"
19
+ value="<?php echo $feed_id; ?>">
20
+ <div class="ai1ec-clearfix">
21
+ <?php if ( $event_category ) : ?>
22
+ <div class="ai1ec-feed-category"
23
+ data-ids="<?php echo esc_attr( $categories_ids ); ?>">
24
+ <?php _e( 'Event categories:', AI1EC_PLUGIN_NAME ); ?>
25
+ <strong><?php echo $event_category; ?></strong>
26
+ </div>
27
+ <?php endif; ?>
28
+ <?php if ( $tags ) : ?>
29
+ <div class="ai1ec-feed-tags ai1ec-pull-left"
30
+ data-ids="<?php echo esc_attr( $tags_ids ); ?>">
31
+ <?php _e( 'Tag with', AI1EC_PLUGIN_NAME ); ?>:
32
+ <strong><?php echo $tags; ?></strong>
33
+ </div>
34
+ <?php endif; ?>
35
+ </div>
36
+ <?php do_action( 'ai1ec_ics_row_after_categories_tags', $feed_id ); ?>
37
+ <div class="ai1ec-clearfix">
38
+ <div class="ai1ec-feed-comments-enabled"
39
+ data-state="<?php echo esc_attr( $comments_enabled ? 1 : 0 ); ?>">
40
+ <?php _e( 'Allow comments', AI1EC_PLUGIN_NAME ); ?>:
41
+ <strong><?php
42
+ if ( $comments_enabled ) {
43
+ _e( 'Yes', AI1EC_PLUGIN_NAME );
44
+ } else {
45
+ _e( 'No', AI1EC_PLUGIN_NAME );
46
+ }
47
+ ?></strong>
48
+ </div>
49
+ <div class="ai1ec-feed-map-display-enabled"
50
+ data-state="<?php echo esc_attr( $map_display_enabled ? 1 : 0 ); ?>">
51
+ <?php _e( 'Show map', AI1EC_PLUGIN_NAME ); ?>:
52
+ <strong><?php
53
+ if ( $map_display_enabled ) {
54
+ _e( 'Yes', AI1EC_PLUGIN_NAME );
55
+ } else {
56
+ _e( 'No', AI1EC_PLUGIN_NAME );
57
+ }
58
+ ?></strong>
59
+ </div>
60
+ </div>
61
+ <div class="ai1ec-feed-keep-tags-categories"
62
+ data-state="<?php echo esc_attr( $keep_tags_categories ? 1 : 0 ); ?>">
63
+ <?php _e( 'Keep original events categories and tags', AI1EC_PLUGIN_NAME ); ?>:
64
+ <strong><?php
65
+ if ( $keep_tags_categories ) {
66
+ _e( 'Yes', AI1EC_PLUGIN_NAME );
67
+ } else {
68
+ _e( 'No', AI1EC_PLUGIN_NAME );
69
+ }
70
+ ?></strong>
71
+ </div>
72
+ <?php do_action( 'ai1ec_ics_row_after_keep_categories_tags', $feed_id ); ?>
73
+ <div class="ai1ec-feed-keep-old-events"
74
+ data-state="<?php echo esc_attr( $keep_old_events ? 1 : 0 ); ?>">
75
+ <?php _e( 'On refresh, preserve previously imported events that are missing from the feed', AI1EC_PLUGIN_NAME ); ?>:
76
+ <strong><?php
77
+ if ( $keep_old_events ) {
78
+ _e( 'Yes', AI1EC_PLUGIN_NAME );
79
+ } else {
80
+ _e( 'No', AI1EC_PLUGIN_NAME );
81
+ }
82
+ ?></strong>
83
+ </div>
84
+ <div class="ai1ec-feed-import-timezone"
85
+ data-state="<?php echo esc_attr( $feed_import_timezone ? 1 : 0 ); ?>">
86
+ <span class="ai1ec-tooltip-toggle" title="<?php _e( 'Guesses the time zone of events that have none specified; recommended for Google Calendar feeds', AI1EC_PLUGIN_NAME ); ?>">
87
+ <?php _e( 'Assign default time zone to events in UTC', AI1EC_PLUGIN_NAME );
88
+ ?>:</span>
89
+ <strong><?php
90
+ if ( $feed_import_timezone ) {
91
+ _e( 'Yes', AI1EC_PLUGIN_NAME );
92
+ } else {
93
+ _e( 'No', AI1EC_PLUGIN_NAME );
94
+ } ?>
95
+ </strong>
96
+ </div>
97
+ <?php do_action( 'ai1ec_ics_row_after_settings', $feed_id ); ?>
98
+ <div class="ai1ec-btn-group ai1ec-pull-right ai1ec-feed-actions">
99
+ <button type="button"
100
+ class="ai1ec-btn ai1ec-btn-sm ai1ec-btn-default ai1ec-text-primary
101
+ ai1ec_update_ics"
102
+ data-loading-text="<?php echo esc_attr(
103
+ '<i class="ai1ec-fa ai1ec-fa-refresh ai1ec-fa-spin ai1ec-fa-fw"></i> ' .
104
+ __( 'Refreshing&#8230;', AI1EC_PLUGIN_NAME ) ); ?>">
105
+ <i class="ai1ec-fa ai1ec-fa-refresh ai1ec-fa-fw"></i>
106
+ <?php _e( 'Refresh', AI1EC_PLUGIN_NAME ); ?>
107
+ </button>
108
+ <button type="button"
109
+ class="ai1ec-btn ai1ec-btn-sm ai1ec-btn-default ai1ec-text-warning
110
+ ai1ec_edit_ics">
111
+ <i class="ai1ec-fa ai1ec-fa-edit ai1ec-fa-fw"></i>
112
+ <?php _e( 'Edit', AI1EC_PLUGIN_NAME ); ?>
113
+ </button>
114
+ <button type="button"
115
+ class="ai1ec-btn ai1ec-btn-sm ai1ec-btn-default ai1ec-text-danger
116
+ ai1ec_delete_ics"
117
+ data-loading-text="<?php echo esc_attr(
118
+ '<i class="ai1ec-fa ai1ec-fa-spinner ai1ec-fa-spin ai1ec-fa-fw"></i> ' .
119
+ __( 'Removing&#8230;', AI1EC_PLUGIN_NAME ) ); ?>">
120
+ <i class="ai1ec-fa ai1ec-fa-times ai1ec-fa-fw"></i>
121
+ <?php _e( 'Remove', AI1EC_PLUGIN_NAME ); ?>
122
+ </button>
123
+ </div>
124
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  </div>
127
  </div>
public/admin/plugins/ics/display_feeds.php CHANGED
@@ -9,7 +9,7 @@
9
  <div id="ics-alerts"></div>
10
  <div class="ai1ec-form-horizontal">
11
  <div class="ai1ec-form-group">
12
- <div class="ai1ec-col-md-8">
13
  <label class="ai1ec-control-label ai1ec-pull-left" for="cron_freq">
14
  <?php _e( 'Check for new events', AI1EC_PLUGIN_NAME ) ?>:
15
  </label>
@@ -17,13 +17,6 @@
17
  <?php echo $cron_freq ?>
18
  </div>
19
  </div>
20
- <div class="ai1ec-col-md-4">
21
- <button type="submit" name="ai1ec_save_settings" id="ai1ec_save_settings"
22
- class="ai1ec-btn ai1ec-btn-primary ai1ec-pull-right">
23
- <i class="ai1ec-fa ai1ec-fa-save ai1ec-fa-fw"></i>
24
- <?php _e( 'Save Settings', AI1EC_PLUGIN_NAME ); ?>
25
- </button>
26
- </div>
27
  </div>
28
  </div>
29
 
@@ -85,18 +78,28 @@
85
  </div>
86
  <?php do_action( 'ai1ec_ics_row_after_settings', null ); ?>
87
  <div class="ai1ec-pull-right">
 
 
 
 
 
88
  <button type="button" id="ai1ec_add_new_ics"
89
  class="ai1ec-btn ai1ec-btn-primary ai1ec-btn-sm"
90
  data-loading-text="<?php echo esc_attr(
91
  '<i class="ai1ec-fa ai1ec-fa-spinner ai1ec-fa-spin ai1ec-fa-fw"></i> ' .
92
  __( 'Please wait&#8230;', AI1EC_PLUGIN_NAME ) ); ?>">
93
  <i class="ai1ec-fa ai1ec-fa-plus"></i>
94
- <?php _e( 'Add new subscription', AI1EC_PLUGIN_NAME ) ?>
 
 
 
 
 
95
  </button>
96
  </div>
97
  </div>
98
 
99
- <?php
100
- echo $feed_rows;
101
- echo $modal->render();
102
- ?>
9
  <div id="ics-alerts"></div>
10
  <div class="ai1ec-form-horizontal">
11
  <div class="ai1ec-form-group">
12
+ <div class="ai1ec-col-md-12">
13
  <label class="ai1ec-control-label ai1ec-pull-left" for="cron_freq">
14
  <?php _e( 'Check for new events', AI1EC_PLUGIN_NAME ) ?>:
15
  </label>
17
  <?php echo $cron_freq ?>
18
  </div>
19
  </div>
 
 
 
 
 
 
 
20
  </div>
21
  </div>
22
 
78
  </div>
79
  <?php do_action( 'ai1ec_ics_row_after_settings', null ); ?>
80
  <div class="ai1ec-pull-right">
81
+ <button type="button" id="ai1ec_cancel_ics"
82
+ class="ai1ec-btn ai1ec-btn-primary ai1ec-btn-sm">
83
+ <i class="ai1ec-fa ai1ec-fa-cancel"></i>
84
+ <?php _e( 'Cancel', AI1EC_PLUGIN_NAME ); ?>
85
+ </button>
86
  <button type="button" id="ai1ec_add_new_ics"
87
  class="ai1ec-btn ai1ec-btn-primary ai1ec-btn-sm"
88
  data-loading-text="<?php echo esc_attr(
89
  '<i class="ai1ec-fa ai1ec-fa-spinner ai1ec-fa-spin ai1ec-fa-fw"></i> ' .
90
  __( 'Please wait&#8230;', AI1EC_PLUGIN_NAME ) ); ?>">
91
  <i class="ai1ec-fa ai1ec-fa-plus"></i>
92
+ <span id="ai1ec_ics_add_new">
93
+ <?php _e( 'Add new subscription', AI1EC_PLUGIN_NAME ); ?>
94
+ </span>
95
+ <span id="ai1ec_ics_update" class="ai1ec-hidden">
96
+ <?php _e( 'Update subscription', AI1EC_PLUGIN_NAME ); ?>
97
+ </span>
98
  </button>
99
  </div>
100
  </div>
101
 
102
+ <div class="timely ai1ec-form-inline ai1ec-panel-group" id="ai1ec-feeds-accordion">
103
+ <?php echo $feed_rows; ?>
104
+ </div>
105
+ <?php echo $modal->render(); ?>
public/admin/row_custom.php CHANGED
@@ -3,7 +3,7 @@
3
  <?php _e( 'Custom dates:', AI1EC_PLUGIN_NAME ) ;?>
4
  </label>
5
  <div class="ai1ec-col-sm-8">
6
- <div id="ai1ec_recurrence_calendar"></div>
7
  </div>
8
  </div>
9
  <div class="ai1ec-form-group">
3
  <?php _e( 'Custom dates:', AI1EC_PLUGIN_NAME ) ;?>
4
  </label>
5
  <div class="ai1ec-col-sm-8">
6
+ <div id="ai1ec_recurrence_calendar" data-date="<?php echo $selected_dates; ?>"></div>
7
  </div>
8
  </div>
9
  <div class="ai1ec-form-group">
public/admin/row_monthly.php CHANGED
@@ -12,14 +12,14 @@
12
  <div class="radio">
13
  <label for="ai1ec_monthly_type_bymonthday">
14
  <input type="radio" name="ai1ec_monthly_type"
15
- id="ai1ec_monthly_type_bymonthday" value="bymonthday" checked>
16
  <?php _e( 'On day of the month', AI1EC_PLUGIN_NAME ); ?>
17
  </label>
18
  </div>
19
  <div class="radio">
20
  <label for="ai1ec_monthly_type_byday">
21
  <input type="radio" name="ai1ec_monthly_type"
22
- id="ai1ec_monthly_type_byday" value="byday">
23
  <?php _e( 'On day of the week', AI1EC_PLUGIN_NAME ); ?>
24
  </label>
25
  </div>
12
  <div class="radio">
13
  <label for="ai1ec_monthly_type_bymonthday">
14
  <input type="radio" name="ai1ec_monthly_type"
15
+ id="ai1ec_monthly_type_bymonthday" value="bymonthday" <?php echo $bymonthday_checked; ?>>
16
  <?php _e( 'On day of the month', AI1EC_PLUGIN_NAME ); ?>
17
  </label>
18
  </div>
19
  <div class="radio">
20
  <label for="ai1ec_monthly_type_byday">
21
  <input type="radio" name="ai1ec_monthly_type"
22
+ id="ai1ec_monthly_type_byday" value="byday" <?php echo $byday_checked; ?>>
23
  <?php _e( 'On day of the week', AI1EC_PLUGIN_NAME ); ?>
24
  </label>
25
  </div>
public/admin/twig/organize/tab.twig CHANGED
@@ -7,7 +7,7 @@
7
  {% if taxonomy.icon is not empty %}
8
  <i class="{{ taxonomy.icon | e('html_attr') }} ai1ec-fa-fw"></i>
9
  {% endif %}
10
- {{ taxonomy.name }}
11
  </a>
12
 
13
  {% if taxonomy.active and taxonomy.edit_url is not empty %}
7
  {% if taxonomy.icon is not empty %}
8
  <i class="{{ taxonomy.icon | e('html_attr') }} ai1ec-fa-fw"></i>
9
  {% endif %}
10
+ {{ taxonomy.name | raw }}
11
  </a>
12
 
13
  {% if taxonomy.active and taxonomy.edit_url is not empty %}
public/admin/twig/setting/categories-image.twig CHANGED
@@ -1,47 +1,47 @@
1
  {% if edit %}
2
 
3
- <tr class="form-field">
4
- <th scope="row" valign="top">
5
- <label for="tag-color">
6
- {{ section_name }}
7
- </label>
8
- </th>
9
- <td>
10
-
11
- <img src='{{ image_src }}' {{ image_style }} alt='' id='ai1ec_category_imag_preview' />
12
- <input type="hidden" name="ai1ec_category_image_url" id="ai1ec_category_image_url" value="">
13
- <input class="button at-upload_image_button" type="button" id='ai1ec_category_image_uploader' value="{{ label }}">
14
-
15
- {% if image_src %}
16
- <p>
17
- <input type="checkbox" style="width:auto;" name="ai1ec_category_image_url_remove" id="ai1ec_category_image_url_remove" value="1" />
18
- <label for="ai1ec_category_image_url_remove">{{ remove_label }}</label>
19
- </p>
20
- {% endif %}
21
-
22
- <div class="desc-field">
23
- <p class="description">
24
- {{ description|raw }}
25
- </p>
26
- </div>
27
- </td>
28
- </tr>
29
 
30
  {% else %}
31
- <div class="form-field">
32
- <label for="ai1ec_image_field_id">
33
- {{ section_name }}
34
- </label>
35
-
36
- <img src='{{ image_src }}' {{ image_style }} alt='' id='ai1ec_category_imag_preview' />
37
- <input type="hidden" name="ai1ec_category_image_url" id="ai1ec_category_image_url" value="">
38
- <input class="button at-upload_image_button" type="button" id='ai1ec_category_image_uploader' value="{{ label }}">
39
-
40
- <div class="desc-field">
41
- <p class="description">
42
- {{ description|raw }}
43
- </p>
44
- </div>
45
- </div>
46
 
47
  {% endif %}
1
  {% if edit %}
2
 
3
+ <tr class="form-field">
4
+ <th scope="row" valign="top">
5
+ <label for="tag-color">
6
+ {{ section_name | raw }}
7
+ </label>
8
+ </th>
9
+ <td>
10
+
11
+ <img src='{{ image_src }}' {{ image_style }} alt='' id='ai1ec_category_imag_preview' />
12
+ <input type="hidden" name="ai1ec_category_image_url" id="ai1ec_category_image_url" value="">
13
+ <input class="button at-upload_image_button" type="button" id='ai1ec_category_image_uploader' value="{{ label }}">
14
+
15
+ {% if image_src %}
16
+ <p>
17
+ <input type="checkbox" style="width:auto;" name="ai1ec_category_image_url_remove" id="ai1ec_category_image_url_remove" value="1" />
18
+ <label for="ai1ec_category_image_url_remove">{{ remove_label }}</label>
19
+ </p>
20
+ {% endif %}
21
+
22
+ <div class="desc-field">
23
+ <p class="description">
24
+ {{ description | raw }}
25
+ </p>
26
+ </div>
27
+ </td>
28
+ </tr>
29
 
30
  {% else %}
31
+ <div class="form-field">
32
+ <label for="ai1ec_image_field_id">
33
+ {{ section_name | raw }}
34
+ </label>
35
+
36
+ <img src='{{ image_src }}' {{ image_style }} alt='' id='ai1ec_category_imag_preview' />
37
+ <input type="hidden" name="ai1ec_category_image_url" id="ai1ec_category_image_url" value="">
38
+ <input class="button at-upload_image_button" type="button" id='ai1ec_category_image_uploader' value="{{ label }}">
39
+
40
+ <div class="desc-field">
41
+ <p class="description">
42
+ {{ description | raw }}
43
+ </p>
44
+ </div>
45
+ </div>
46
 
47
  {% endif %}
public/admin/twig/setting/tags-categories.twig CHANGED
@@ -1,11 +1,11 @@
1
  <div class="ai1ec-default-filters ai1ec-form-group">
2
- <label class="ai1ec-control-label ai1ec-col-sm-5">
3
  {{ label }}
4
  <div class="ai1ec-help-block">
5
  {{ help | raw }}
6
  </div>
7
  </label>
8
- <div class="ai1ec-col-sm-7">
9
  <div class="ai1ec-row">
10
  {% if categories is defined %}
11
  <div class="ai1ec-col-md-6">
1
  <div class="ai1ec-default-filters ai1ec-form-group">
2
+ <label class="ai1ec-control-label ai1ec-col-sm-3">
3
  {{ label }}
4
  <div class="ai1ec-help-block">
5
  {{ help | raw }}
6
  </div>
7
  </label>
8
+ <div class="ai1ec-col-sm-9">
9
  <div class="ai1ec-row">
10
  {% if categories is defined %}
11
  <div class="ai1ec-col-md-6">
public/js/agenda.js CHANGED
@@ -1 +1 @@
1
- timely.define(["libs/twig","agenda"],function(e){var t,n;return t=e.twig,n=t({id:"../js_src/agenda.twig",data:[{type:"output",stack:[{type:"Twig.expression.type.variable",value:"navigation",match:["navigation"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n\n<div class="ai1ec-agenda-view">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"dates",match:["dates"]},{type:"Twig.expression.type.test",filter:"empty"}],output:[{type:"raw",value:' <p class="ai1ec-no-results">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_upcoming_events",match:["text_upcoming_events"]}]},{type:"raw",value:"\n </p>\n "}]}},{type:"logic",token:{type:"Twig.logic.type.else",match:["else"],output:[{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:"date",value_var:"date_info",expression:[{type:"Twig.expression.type.variable",value:"dates",match:["dates"]}],output:[{type:"raw",value:' <div class="ai1ec-date\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"today"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:"ai1ec-today"}]}},{type:"raw",value:'">\n <a class="ai1ec-date-title ai1ec-load-view"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"href"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"data_type",match:["data_type"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'>\n <div class="ai1ec-month">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"month"}]},{type:"raw",value:'</div>\n <div class="ai1ec-day">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"day"}]},{type:"raw",value:'</div>\n <div class="ai1ec-weekday">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"weekday"}]},{type:"raw",value:"</div>\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_year_in_agenda_dates",match:["show_year_in_agenda_dates"]}],output:[{type:"raw",value:' <div class="ai1ec-year">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"year"}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:' </a>\n <div class="ai1ec-date-events">\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"category",expression:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"events"}],output:[{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"event",expression:[{type:"Twig.expression.type.variable",value:"category",match:["category"]}],output:[{type:"raw",value:' <div class="ai1ec-event\n ai1ec-event-id-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_id"}]},{type:"raw",value:"\n ai1ec-event-instance-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_allday"}],output:[{type:"raw",value:"ai1ec-allday"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"expanded",match:["expanded"]}],output:[{type:"raw",value:"ai1ec-expanded"}]}},{type:"raw",value:'">\n\n <div class="ai1ec-event-header">\n <div class="ai1ec-event-toggle">\n <i class="ai1ec-fa ai1ec-fa-minus-circle ai1ec-fa-lg"></i>\n <i class="ai1ec-fa ai1ec-fa-plus-circle ai1ec-fa-lg"></i>\n </div>\n <span class="ai1ec-event-title">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:" </span>\n\n "},{type:"logic",token:{type:"Twig.logic.type.set",key:"edit_post_link",expression:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"edit_post_link",match:["edit_post_link"]},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:' <a class="post-edit-link" href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"edit_post_link",match:["edit_post_link"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'">\n <i class="ai1ec-fa ai1ec-fa-pencil"></i> '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_edit",match:["text_edit"]}]},{type:"raw",value:"\n </a>\n "}]}},{type:"raw",value:'\n <div class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"timespan_short"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </div>\n </div>\n\n "},{type:"raw",value:'\n <div class="ai1ec-event-summary '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"expanded",match:["expanded"]}],output:[{type:"raw",value:"ai1ec-expanded"}]}},{type:"raw",value:'">\n\n <div class="ai1ec-event-description">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"content_img_url"},{type:"Twig.expression.type.test",filter:"empty"},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"avatar_not_wrapped"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"avatar_not_wrapped"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </a>\n "}]}},{type:"raw",value:" "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_content"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n </div>\n\n <div class="ai1ec-event-summary-footer">\n <div class="ai1ec-btn-group ai1ec-actions">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"is_ticket_button_enabled",match:["is_ticket_button_enabled"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <a class="ai1ec-pull-right ai1ec-btn ai1ec-btn-primary\n ai1ec-btn-xs ai1ec-buy-tickets"\n target="_blank"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url_label"}]},{type:"raw",value:"</a>\n "}]}},{type:"raw",value:' <a class="ai1ec-read-more ai1ec-btn ai1ec-btn-default\n ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_read_more",match:["text_read_more"]}]},{type:"raw",value:' <i class="ai1ec-fa ai1ec-fa-arrow-right"></i>\n </a>\n </div>\n '},{type:"logic",token:{type:"Twig.logic.type.set",key:"categories",expression:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"categories_html"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"tags",expression:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"tags_html"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"categories",match:["categories"]},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:' <span class="ai1ec-categories">\n <span class="ai1ec-field-label">\n <i class="ai1ec-fa ai1ec-fa-folder-open"></i>\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_categories",match:["text_categories"]}]},{type:"raw",value:"\n </span>\n "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"categories",match:["categories"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </span>\n "}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"tags",match:["tags"]},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:' <span class="ai1ec-tags">\n <span class="ai1ec-field-label">\n <i class="ai1ec-fa ai1ec-fa-tags"></i>\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_tags",match:["text_tags"]}]},{type:"raw",value:"\n </span>\n "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"tags",match:["tags"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </span>\n "}]}},{type:"raw",value:" </div>\n </div>\n\n </div>\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n </div>\n </div>\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n "}]}},{type:"raw",value:" "},{type:"raw",value:'\n</div>\n\n<div class="ai1ec-pull-left">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"pagination_links",match:["pagination_links"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n"}],precompiled:!0}),n});
1
+ timely.define(["libs/twig","agenda"],function(e){var t,n;return t=e.twig,n=t({id:"../js_src/agenda.twig",data:[{type:"output",stack:[{type:"Twig.expression.type.variable",value:"navigation",match:["navigation"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n\n<div class="ai1ec-agenda-view">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"dates",match:["dates"]},{type:"Twig.expression.type.test",filter:"empty"}],output:[{type:"raw",value:' <p class="ai1ec-no-results">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_upcoming_events",match:["text_upcoming_events"]}]},{type:"raw",value:"\n </p>\n "}]}},{type:"logic",token:{type:"Twig.logic.type.else",match:["else"],output:[{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:"date",value_var:"date_info",expression:[{type:"Twig.expression.type.variable",value:"dates",match:["dates"]}],output:[{type:"raw",value:' <div class="ai1ec-date\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"today"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:"ai1ec-today"}]}},{type:"raw",value:'">\n <a class="ai1ec-date-title ai1ec-load-view"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"href"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"data_type",match:["data_type"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'>\n <div class="ai1ec-month">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"month"}]},{type:"raw",value:'</div>\n <div class="ai1ec-day">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"day"}]},{type:"raw",value:'</div>\n <div class="ai1ec-weekday">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"weekday"}]},{type:"raw",value:"</div>\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_year_in_agenda_dates",match:["show_year_in_agenda_dates"]}],output:[{type:"raw",value:' <div class="ai1ec-year">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"year"}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:' </a>\n <div class="ai1ec-date-events">\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"category",expression:[{type:"Twig.expression.type.variable",value:"date_info",match:["date_info"]},{type:"Twig.expression.type.key.period",key:"events"}],output:[{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"event",expression:[{type:"Twig.expression.type.variable",value:"category",match:["category"]}],output:[{type:"raw",value:' <div class="ai1ec-event\n ai1ec-event-id-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_id"}]},{type:"raw",value:"\n ai1ec-event-instance-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_allday"}],output:[{type:"raw",value:"ai1ec-allday"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"expanded",match:["expanded"]}],output:[{type:"raw",value:"ai1ec-expanded"}]}},{type:"raw",value:'"\n data-end="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"end"}]},{type:"raw",value:'">\n\n <div class="ai1ec-event-header">\n <div class="ai1ec-event-toggle">\n <i class="ai1ec-fa ai1ec-fa-minus-circle ai1ec-fa-lg"></i>\n <i class="ai1ec-fa ai1ec-fa-plus-circle ai1ec-fa-lg"></i>\n </div>\n <span class="ai1ec-event-title">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:" </span>\n "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"action_buttons",match:["action_buttons"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.set",key:"edit_post_link",expression:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"edit_post_link",match:["edit_post_link"]},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:' <a class="post-edit-link" href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"edit_post_link",match:["edit_post_link"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'">\n <i class="ai1ec-fa ai1ec-fa-pencil"></i> '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_edit",match:["text_edit"]}]},{type:"raw",value:"\n </a>\n "}]}},{type:"raw",value:'\n <div class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"timespan_short"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </div>\n </div>\n\n "},{type:"raw",value:'\n <div class="ai1ec-event-summary '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"expanded",match:["expanded"]}],output:[{type:"raw",value:"ai1ec-expanded"}]}},{type:"raw",value:'">\n\n <div class="ai1ec-event-description">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"content_img_url"},{type:"Twig.expression.type.test",filter:"empty"},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"avatar_not_wrapped"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"avatar_not_wrapped"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </a>\n "}]}},{type:"raw",value:" "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_content"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n </div>\n\n <div class="ai1ec-event-summary-footer">\n <div class="ai1ec-btn-group ai1ec-actions">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"is_ticket_button_enabled",match:["is_ticket_button_enabled"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <a class="ai1ec-pull-right ai1ec-btn ai1ec-btn-primary\n ai1ec-btn-xs ai1ec-buy-tickets"\n target="_blank"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url_label"}]},{type:"raw",value:"</a>\n "}]}},{type:"raw",value:' <a class="ai1ec-read-more ai1ec-btn ai1ec-btn-default\n ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_read_more",match:["text_read_more"]}]},{type:"raw",value:' <i class="ai1ec-fa ai1ec-fa-arrow-right"></i>\n </a>\n </div>\n '},{type:"logic",token:{type:"Twig.logic.type.set",key:"categories",expression:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"categories_html"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"tags",expression:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"tags_html"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"categories",match:["categories"]},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:' <span class="ai1ec-categories">\n <span class="ai1ec-field-label">\n <i class="ai1ec-fa ai1ec-fa-folder-open"></i>\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_categories",match:["text_categories"]}]},{type:"raw",value:"\n </span>\n "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"categories",match:["categories"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </span>\n "}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"tags",match:["tags"]},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:' <span class="ai1ec-tags">\n <span class="ai1ec-field-label">\n <i class="ai1ec-fa ai1ec-fa-tags"></i>\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_tags",match:["text_tags"]}]},{type:"raw",value:"\n </span>\n "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"tags",match:["tags"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </span>\n "}]}},{type:"raw",value:" </div>\n </div>\n\n </div>\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n </div>\n </div>\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n "}]}},{type:"raw",value:" "},{type:"raw",value:'\n</div>\n\n<div class="ai1ec-pull-left">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"pagination_links",match:["pagination_links"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n"}],precompiled:!0}),n});
public/js/build.txt CHANGED
@@ -1,6 +1,7 @@
1
 
2
  pages/calendar.js
3
  ----------------
 
4
  scripts/calendar/print.js
5
  scripts/calendar/agenda_view.js
6
  external_libs/modernizr.js
@@ -8,7 +9,6 @@ scripts/calendar/month_view.js
8
  libs/frontend_utils.js
9
  external_libs/bootstrap/tab.js
10
  libs/utils.js
11
- domReady.js
12
  external_libs/bootstrap/affix.js
13
  scripts/common_scripts/frontend/common_event_handlers.js
14
  external_libs/bootstrap/tooltip.js
@@ -19,6 +19,7 @@ scripts/common_scripts/frontend/common_frontend.js
19
  external_libs/select2.js
20
  libs/select2_multiselect_helper.js
21
  external_libs/twig.js
 
22
  agenda.js
23
  oneday.js
24
  month.js
@@ -81,7 +82,6 @@ external_libs/bootstrap/button.js
81
  external_libs/bootstrap/transition.js
82
  external_libs/bootstrap/collapse.js
83
  libs/collapse_helper.js
84
- external_libs/bootstrap/dropdown.js
85
  external_libs/locales/bootstrap-datepicker.bg.js
86
  external_libs/locales/bootstrap-datepicker.br.js
87
  external_libs/locales/bootstrap-datepicker.cs.js
@@ -126,14 +126,42 @@ external_libs/jquery.autocomplete_geomod.js
126
  external_libs/geo_autocomplete.js
127
  scripts/add_new_event/event_location/gmaps_helper.js
128
  scripts/add_new_event/event_location/input_coordinates_event_handlers.js
129
- scripts/add_new_event/event_date_time/date_time_utility_functions.js
130
  external_libs/jquery.calendrical_timespan.js
 
131
  external_libs/bootstrap/button.js
132
  scripts/add_new_event/event_date_time/date_time_event_handlers.js
133
  scripts/add_new_event/event_cost_helper.js
134
  external_libs/jquery.inputdate.js
135
  external_libs/jquery.tools.js
136
- external_libs/ai1ec_datepicker.js
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  external_libs/bootstrap/transition.js
138
  external_libs/bootstrap/collapse.js
139
  external_libs/bootstrap/modal.js
@@ -175,6 +203,7 @@ external_libs/Placeholders.js
175
  external_libs/bootstrap/tooltip.js
176
  external_libs/bootstrap/popover.js
177
  external_libs/bootstrap/modal.js
 
178
  scripts/common_scripts/backend/common_backend.js
179
  pages/common_backend.js
180
 
@@ -203,6 +232,7 @@ pages/common_frontend.js
203
 
204
  scripts/calendar.js
205
  ----------------
 
206
  scripts/calendar/print.js
207
  scripts/calendar/agenda_view.js
208
  external_libs/modernizr.js
@@ -210,7 +240,6 @@ scripts/calendar/month_view.js
210
  libs/frontend_utils.js
211
  external_libs/bootstrap/tab.js
212
  libs/utils.js
213
- domReady.js
214
  external_libs/bootstrap/affix.js
215
  scripts/common_scripts/frontend/common_event_handlers.js
216
  external_libs/bootstrap/tooltip.js
@@ -221,6 +250,7 @@ scripts/common_scripts/frontend/common_frontend.js
221
  external_libs/select2.js
222
  libs/select2_multiselect_helper.js
223
  external_libs/twig.js
 
224
  agenda.js
225
  oneday.js
226
  month.js
@@ -278,6 +308,8 @@ scripts/common_scripts/frontend/common_frontend.js
278
 
279
  scripts/calendar/event.js
280
  ----------------
 
 
281
  external_libs/jquery.scrollTo.js
282
  scripts/calendar/event.js
283
 
@@ -301,3 +333,10 @@ scripts/widget-creator.js
301
  external_libs/twig.js
302
  ----------------
303
  external_libs/twig.js
 
 
 
 
 
 
 
1
 
2
  pages/calendar.js
3
  ----------------
4
+ domReady.js
5
  scripts/calendar/print.js
6
  scripts/calendar/agenda_view.js
7
  external_libs/modernizr.js
9
  libs/frontend_utils.js
10
  external_libs/bootstrap/tab.js
11
  libs/utils.js
 
12
  external_libs/bootstrap/affix.js
13
  scripts/common_scripts/frontend/common_event_handlers.js
14
  external_libs/bootstrap/tooltip.js
19
  external_libs/select2.js
20
  libs/select2_multiselect_helper.js
21
  external_libs/twig.js
22
+ libs/twig.js
23
  agenda.js
24
  oneday.js
25
  month.js
82
  external_libs/bootstrap/transition.js
83
  external_libs/bootstrap/collapse.js
84
  libs/collapse_helper.js
 
85
  external_libs/locales/bootstrap-datepicker.bg.js
86
  external_libs/locales/bootstrap-datepicker.br.js
87
  external_libs/locales/bootstrap-datepicker.cs.js
126
  external_libs/geo_autocomplete.js
127
  scripts/add_new_event/event_location/gmaps_helper.js
128
  scripts/add_new_event/event_location/input_coordinates_event_handlers.js
 
129
  external_libs/jquery.calendrical_timespan.js
130
+ scripts/add_new_event/event_date_time/date_time_utility_functions.js
131
  external_libs/bootstrap/button.js
132
  scripts/add_new_event/event_date_time/date_time_event_handlers.js
133
  scripts/add_new_event/event_cost_helper.js
134
  external_libs/jquery.inputdate.js
135
  external_libs/jquery.tools.js
136
+ external_libs/locales/bootstrap-datepicker.bg.js
137
+ external_libs/locales/bootstrap-datepicker.br.js
138
+ external_libs/locales/bootstrap-datepicker.cs.js
139
+ external_libs/locales/bootstrap-datepicker.da.js
140
+ external_libs/locales/bootstrap-datepicker.de.js
141
+ external_libs/locales/bootstrap-datepicker.es.js
142
+ external_libs/locales/bootstrap-datepicker.fi.js
143
+ external_libs/locales/bootstrap-datepicker.fr.js
144
+ external_libs/locales/bootstrap-datepicker.id.js
145
+ external_libs/locales/bootstrap-datepicker.is.js
146
+ external_libs/locales/bootstrap-datepicker.it.js
147
+ external_libs/locales/bootstrap-datepicker.ja.js
148
+ external_libs/locales/bootstrap-datepicker.kr.js
149
+ external_libs/locales/bootstrap-datepicker.lt.js
150
+ external_libs/locales/bootstrap-datepicker.lv.js
151
+ external_libs/locales/bootstrap-datepicker.ms.js
152
+ external_libs/locales/bootstrap-datepicker.nb.js
153
+ external_libs/locales/bootstrap-datepicker.nl.js
154
+ external_libs/locales/bootstrap-datepicker.pl.js
155
+ external_libs/locales/bootstrap-datepicker.pt-BR.js
156
+ external_libs/locales/bootstrap-datepicker.pt.js
157
+ external_libs/locales/bootstrap-datepicker.ru.js
158
+ external_libs/locales/bootstrap-datepicker.sl.js
159
+ external_libs/locales/bootstrap-datepicker.sv.js
160
+ external_libs/locales/bootstrap-datepicker.th.js
161
+ external_libs/locales/bootstrap-datepicker.tr.js
162
+ external_libs/locales/bootstrap-datepicker.zh-CN.js
163
+ external_libs/locales/bootstrap-datepicker.zh-TW.js
164
+ external_libs/bootstrap_datepicker.js
165
  external_libs/bootstrap/transition.js
166
  external_libs/bootstrap/collapse.js
167
  external_libs/bootstrap/modal.js
203
  external_libs/bootstrap/tooltip.js
204
  external_libs/bootstrap/popover.js
205
  external_libs/bootstrap/modal.js
206
+ external_libs/bootstrap/dropdown.js
207
  scripts/common_scripts/backend/common_backend.js
208
  pages/common_backend.js
209
 
232
 
233
  scripts/calendar.js
234
  ----------------
235
+ domReady.js
236
  scripts/calendar/print.js
237
  scripts/calendar/agenda_view.js
238
  external_libs/modernizr.js
240
  libs/frontend_utils.js
241
  external_libs/bootstrap/tab.js
242
  libs/utils.js
 
243
  external_libs/bootstrap/affix.js
244
  scripts/common_scripts/frontend/common_event_handlers.js
245
  external_libs/bootstrap/tooltip.js
250
  external_libs/select2.js
251
  libs/select2_multiselect_helper.js
252
  external_libs/twig.js
253
+ libs/twig.js
254
  agenda.js
255
  oneday.js
256
  month.js
308
 
309
  scripts/calendar/event.js
310
  ----------------
311
+ external_libs/bootstrap/tab.js
312
+ libs/utils.js
313
  external_libs/jquery.scrollTo.js
314
  scripts/calendar/event.js
315
 
333
  external_libs/twig.js
334
  ----------------
335
  external_libs/twig.js
336
+
337
+ libs/captcha.js
338
+ ----------------
339
+ libs/captcha/recaptcha.js
340
+ libs/captcha/nocaptcha.js
341
+ libs/captcha/void.js
342
+ libs/captcha.js
public/js/external_libs/moment.js CHANGED
@@ -1,3 +1,7 @@
1
- // license : MIT
 
 
 
 
2
 
3
- timely.define([],function(){function A(e,t,n,r){var i=n.lang();return i[e].call?i[e](n,r):i[e][t]}function O(e,t){return function(n){return H(e.call(this,n),t)}}function M(e){return function(t){var n=e.call(this,t);return n+this.lang().ordinal(n)}}function _(e,t,n){this._d=e,this._isUTC=!!t,this._a=e._a||null,this._lang=n||!1}function D(e){var t=this._data={},n=e.years||e.y||0,r=e.months||e.M||0,i=e.weeks||e.w||0,s=e.days||e.d||0,o=e.hours||e.h||0,u=e.minutes||e.m||0,a=e.seconds||e.s||0,f=e.milliseconds||e.ms||0;this._milliseconds=f+a*1e3+u*6e4+o*36e5,this._days=s+i*7,this._months=r+n*12,t.milliseconds=f%1e3,a+=P(f/1e3),t.seconds=a%60,u+=P(a/60),t.minutes=u%60,o+=P(u/60),t.hours=o%24,s+=P(o/24),s+=i*7,t.days=s%30,r+=P(s/30),t.months=r%12,n+=P(r/12),t.years=n,this._lang=!1}function P(e){return e<0?Math.ceil(e):Math.floor(e)}function H(e,t){var n=e+"";while(n.length<t)n="0"+n;return n}function B(e,t,n){var r=t._milliseconds,i=t._days,s=t._months,o;r&&e._d.setTime(+e+r*n),i&&e.date(e.date()+i*n),s&&(o=e.date(),e.date(1).month(e.month()+s*n).date(Math.min(o,e.daysInMonth())))}function j(e){return Object.prototype.toString.call(e)==="[object Array]"}function F(e,t){var n=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),i=0,s;for(s=0;s<n;s++)~~e[s]!==~~t[s]&&i++;return i+r}function I(e,t,n,r){var i,s,o=[];for(i=0;i<7;i++)o[i]=e[i]=e[i]==null?i===2?1:0:e[i];return e[7]=o[7]=t,e[8]!=null&&(o[8]=e[8]),e[3]+=n||0,e[4]+=r||0,s=new Date(0),t?(s.setYear(e[0]),s.setUTCMonth(e[1]),s.setUTCDate(e[2]),s.setUTCHours(e[3],e[4],e[5],e[6])):(s.setYear(e[0]),s.setMonth(e[1]),s.setDate(e[2]),s.setHours(e[3],e[4],e[5],e[6])),s._a=o,s}function q(t,n){var r,s,a=[];!n&&o&&(n=require("./lang/"+t));for(r=0;r<u.length;r++)n[u[r]]=n[u[r]]||i.en[u[r]];for(r=0;r<12;r++)s=e([2e3,r]),a[r]=new RegExp("^"+(n.months[r]||n.months(s,""))+"|^"+(n.monthsShort[r]||n.monthsShort(s,"")).replace(".",""),"i");return n.monthsParse=n.monthsParse||a,i[t]=n,n}function R(t){var n=typeof t=="string"&&t||t&&t._lang||null;return n?i[n]||q(n):e}function U(e){return e.match(/\[.*\]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function z(e){var t=e.match(f),n,r;for(n=0,r=t.length;n<r;n++)L[t[n]]?t[n]=L[t[n]]:t[n]=U(t[n]);return function(i){var s="";for(n=0;n<r;n++)s+=typeof t[n].call=="function"?t[n].call(i,e):t[n];return s}}function W(e,t){function r(t){return e.lang().longDateFormat[t]||t}var n=5;while(n--&&l.test(t))t=t.replace(l,r);return N[t]||(N[t]=z(t)),N[t](e)}function X(e){switch(e){case"DDDD":return d;case"YYYY":return v;case"S":case"SS":case"SSS":case"DDD":return p;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":case"a":case"A":return m;case"Z":case"ZZ":return g;case"T":return y;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return h;default:return new RegExp(e.replace("\\",""))}}function V(e,t,n,r){var i,s;switch(e){case"M":case"MM":n[1]=t==null?0:~~t-1;break;case"MMM":case"MMMM":for(i=0;i<12;i++)if(R().monthsParse[i].test(t)){n[1]=i,s=!0;break}s||(n[8]=!1);break;case"D":case"DD":case"DDD":case"DDDD":t!=null&&(n[2]=~~t);break;case"YY":n[0]=~~t+(~~t>70?1900:2e3);break;case"YYYY":n[0]=~~Math.abs(t);break;case"a":case"A":r.isPm=(t+"").toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":n[3]=~~t;break;case"m":case"mm":n[4]=~~t;break;case"s":case"ss":n[5]=~~t;break;case"S":case"SS":case"SSS":n[6]=~~(("0."+t)*1e3);break;case"Z":case"ZZ":r.isUTC=!0,i=(t+"").match(S),i&&i[1]&&(r.tzh=~~i[1]),i&&i[2]&&(r.tzm=~~i[2]),i&&i[0]==="+"&&(r.tzh=-r.tzh,r.tzm=-r.tzm)}t==null&&(n[8]=!1)}function $(e,t){var n=[0,0,1,0,0,0,0],r={tzh:0,tzm:0},i=t.match(f),s,o;for(s=0;s<i.length;s++)o=(X(i[s]).exec(e)||[])[0],o&&(e=e.slice(e.indexOf(o)+o.length)),L[i[s]]&&V(i[s],o,n,r);return r.isPm&&n[3]<12&&(n[3]+=12),r.isPm===!1&&n[3]===12&&(n[3]=0),I(n,r.isUTC,r.tzh,r.tzm)}function J(e,t){var n,r=e.match(c)||[],i,s=99,o,u,a;for(o=0;o<t.length;o++)u=$(e,t[o]),i=W(new _(u),t[o]).match(c)||[],a=F(r,i),a<s&&(s=a,n=u);return n}function K(e){var t="YYYY-MM-DDT",n;if(b.exec(e)){for(n=0;n<4;n++)if(E[n][1].exec(e)){t+=E[n][0];break}return g.exec(e)?$(e,t+" Z"):$(e,t)}return new Date(e)}function Q(e,t,n,r,i){var s=i.relativeTime[e];return typeof s=="function"?s(t||1,!!n,e,r):s.replace(/%d/i,t||1)}function G(e,t,r){var i=n(Math.abs(e)/1e3),s=n(i/60),o=n(s/60),u=n(o/24),a=n(u/365),f=i<45&&["s",i]||s===1&&["m"]||s<45&&["mm",s]||o===1&&["h"]||o<22&&["hh",o]||u===1&&["d"]||u<=25&&["dd",u]||u<=45&&["M"]||u<345&&["MM",n(u/30)]||a===1&&["y"]||["yy",a];return f[2]=t,f[3]=e>0,f[4]=r,Q.apply({},f)}function Y(t,n){e.fn[t]=function(e){var t=this._isUTC?"UTC":"";return e!=null?(this._d["set"+t+n](e),this):this._d["get"+t+n]()}}function Z(t){e.duration.fn[t]=function(){return this._data[t]}}function et(t,n){e.duration.fn["as"+t]=function(){return+this/n}}var e,t="1.7.2",n=Math.round,r,i={},s="en",o=typeof module!="undefined"&&module.exports,u="months|monthsShort|weekdays|weekdaysShort|weekdaysMin|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),a=/^\/?Date\((\-?\d+)/i,f=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?|.)/g,l=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?)/g,c=/([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,h=/\d\d?/,p=/\d{1,3}/,d=/\d{3}/,v=/\d{1,4}/,m=/[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i,g=/Z|[\+\-]\d\d:?\d\d/i,y=/T/i,b=/^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,w="YYYY-MM-DDTHH:mm:ssZ",E=[["HH:mm:ss.S",/T\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/T\d\d:\d\d:\d\d/],["HH:mm",/T\d\d:\d\d/],["HH",/T\d\d/]],S=/([\+\-]|\d\d)/gi,x="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),T={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},N={},C="DDD w M D d".split(" "),k="M D H h m s w".split(" "),L={M:function(){return this.month()+1},MMM:function(e){return A("monthsShort",this.month(),this,e)},MMMM:function(e){return A("months",this.month(),this,e)},D:function(){return this.date()},DDD:function(){var e=new Date(this.year(),this.month(),this.date()),t=new Date(this.year(),0,1);return~~((e-t)/864e5+1.5)},d:function(){return this.day()},dd:function(e){return A("weekdaysMin",this.day(),this,e)},ddd:function(e){return A("weekdaysShort",this.day(),this,e)},dddd:function(e){return A("weekdays",this.day(),this,e)},w:function(){var e=new Date(this.year(),this.month(),this.date()-this.day()+5),t=new Date(e.getFullYear(),0,4);return~~((e-t)/864e5/7+1.5)},YY:function(){return H(this.year()%100,2)},YYYY:function(){return H(this.year(),4)},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return H(~~(this.milliseconds()/10),2)},SSS:function(){return H(this.milliseconds(),3)},Z:function(){var e=-this.zone(),t="+";return e<0&&(e=-e,t="-"),t+H(~~(e/60),2)+":"+H(~~e%60,2)},ZZ:function(){var e=-this.zone(),t="+";return e<0&&(e=-e,t="-"),t+H(~~(10*e/6),4)}};while(C.length)r=C.pop(),L[r+"o"]=M(L[r]);while(k.length)r=k.pop(),L[r+r]=O(L[r],2);L.DDDD=O(L.DDD,3),e=function(t,n){if(t===null||t==="")return null;var r,i;return e.isMoment(t)?new _(new Date(+t._d),t._isUTC,t._lang):(n?j(n)?r=J(t,n):r=$(t,n):(i=a.exec(t),r=t===undefined?new Date:i?new Date(+i[1]):t instanceof Date?t:j(t)?I(t):typeof t=="string"?K(t):new Date(t)),new _(r))},e.utc=function(t,n){return j(t)?new _(I(t,!0),!0):(typeof t=="string"&&!g.exec(t)&&(t+=" +0000",n&&(n+=" Z")),e(t,n).utc())},e.unix=function(t){return e(t*1e3)},e.duration=function(t,n){var r=e.isDuration(t),i=typeof t=="number",s=r?t._data:i?{}:t,o;return i&&(n?s[n]=t:s.milliseconds=t),o=new D(s),r&&(o._lang=t._lang),o},e.humanizeDuration=function(t,n,r){return e.duration(t,n===!0?null:n).humanize(n===!0?!0:r)},e.version=t,e.defaultFormat=w,e.lang=function(t,n){var r;if(!t)return s;(n||!i[t])&&q(t,n);if(i[t]){for(r=0;r<u.length;r++)e[u[r]]=i[t][u[r]];e.monthsParse=i[t].monthsParse,s=t}},e.langData=R,e.isMoment=function(e){return e instanceof _},e.isDuration=function(e){return e instanceof D},e.lang("en",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(e){var t=e%10;return~~(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th"}}),e.fn=_.prototype={clone:function(){return e(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this._d.toString()},toDate:function(){return this._d},toArray:function(){var e=this;return[e.year(),e.month(),e.date(),e.hours(),e.minutes(),e.seconds(),e.milliseconds(),!!this._isUTC]},isValid:function(){return this._a?this._a[8]!=null?!!this._a[8]:!F(this._a,(this._a[7]?e.utc(this._a):e(this._a)).toArray()):!isNaN(this._d.getTime())},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(t){return W(this,t?t:e.defaultFormat)},add:function(t,n){var r=n?e.duration(+n,t):e.duration(t);return B(this,r,1),this},subtract:function(t,n){var r=n?e.duration(+n,t):e.duration(t);return B(this,r,-1),this},diff:function(t,r,i){var s=this._isUTC?e(t).utc():e(t).local(),o=(this.zone()-s.zone())*6e4,u=this._d-s._d-o,a=this.year()-s.year(),f=this.month()-s.month(),l=this.date()-s.date(),c;return r==="months"?c=a*12+f+l/30:r==="years"?c=a+(f+l/30)/12:c=r==="seconds"?u/1e3:r==="minutes"?u/6e4:r==="hours"?u/36e5:r==="days"?u/864e5:r==="weeks"?u/6048e5:u,i?c:n(c)},from:function(t,n){return e.duration(this.diff(t)).lang(this._lang).humanize(!n)},fromNow:function(t){return this.from(e(),t)},calendar:function(){var t=this.diff(e().sod(),"days",!0),n=this.lang().calendar,r=n.sameElse,i=t<-6?r:t<-1?n.lastWeek:t<0?n.lastDay:t<1?n.sameDay:t<2?n.nextDay:t<7?n.nextWeek:r;return this.format(typeof i=="function"?i.apply(this):i)},isLeapYear:function(){var e=this.year();return e%4===0&&e%100!==0||e%400===0},isDST:function(){return this.zone()<e([this.year()]).zone()||this.zone()<e([this.year(),5]).zone()},day:function(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return e==null?t:this.add({d:e-t})},startOf:function(e){switch(e.replace(/s$/,"")){case"year":this.month(0);case"month":this.date(1);case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return this},endOf:function(e){return this.startOf(e).add(e.replace(/s?$/,"s"),1).subtract("ms",1)},sod:function(){return this.clone().startOf("day")},eod:function(){return this.clone().endOf("day")},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return e.utc([this.year(),this.month()+1,0]).date()},lang:function(e){return e===undefined?R(this):(this._lang=e,this)}};for(r=0;r<x.length;r++)Y(x[r].toLowerCase(),x[r]);Y("year","FullYear"),e.duration.fn=D.prototype={weeks:function(){return P(this.days()/7)},valueOf:function(){return this._milliseconds+this._days*864e5+this._months*2592e6},humanize:function(e){var t=+this,n=this.lang().relativeTime,r=G(t,!e,this.lang()),i=t<=0?n.past:n.future;return e&&(typeof i=="function"?r=i(r):r=i.replace(/%s/i,r)),r},lang:e.fn.lang};for(r in T)T.hasOwnProperty(r)&&(et(r,T[r]),Z(r.toLowerCase()));return et("Weeks",6048e5),e});
1
+ //! moment.js
2
+ //! version : 2.9.0
3
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4
+ //! license : MIT
5
+ //! momentjs.com
6
 
7
+ timely.define([],function(){function tt(e,t,n){switch(arguments.length){case 2:return e!=null?e:t;case 3:return e!=null?e:t!=null?t:n;default:throw new Error("Implement me")}}function nt(e,t){return s.call(e,t)}function rt(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function it(t){e.suppressDeprecationWarnings===!1&&typeof console!="undefined"&&console.warn&&console.warn("Deprecation warning: "+t)}function st(e,t){var n=!0;return dt(function(){return n&&(it(e),n=!1),t.apply(this,arguments)},t)}function ot(e,t){Y[e]||(it(t),Y[e]=!0)}function ut(e,t){return function(n){return gt(e.call(this,n),t)}}function at(e,t){return function(n){return this.localeData().ordinal(e.call(this,n),t)}}function ft(e,t){var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),i,s;return t-r<0?(i=e.clone().add(n-1,"months"),s=(t-r)/(r-i)):(i=e.clone().add(n+1,"months"),s=(t-r)/(i-r)),-(n+s)}function lt(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):e.isPM!=null?(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0),t):t}function ct(){}function ht(t,n){n!==!1&&Dt(t),vt(this,t),this._d=new Date(+t._d),et===!1&&(et=!0,e.updateOffset(this),et=!1)}function pt(t){var n=Ct(t),r=n.year||0,i=n.quarter||0,s=n.month||0,o=n.week||0,u=n.day||0,a=n.hour||0,f=n.minute||0,l=n.second||0,c=n.millisecond||0;this._milliseconds=+c+l*1e3+f*6e4+a*36e5,this._days=+u+o*7,this._months=+s+i*3+r*12,this._data={},this._locale=e.localeData(),this._bubble()}function dt(e,t){for(var n in t)nt(t,n)&&(e[n]=t[n]);return nt(t,"toString")&&(e.toString=t.toString),nt(t,"valueOf")&&(e.valueOf=t.valueOf),e}function vt(e,t){var n,r,i;typeof t._isAMomentObject!="undefined"&&(e._isAMomentObject=t._isAMomentObject),typeof t._i!="undefined"&&(e._i=t._i),typeof t._f!="undefined"&&(e._f=t._f),typeof t._l!="undefined"&&(e._l=t._l),typeof t._strict!="undefined"&&(e._strict=t._strict),typeof t._tzm!="undefined"&&(e._tzm=t._tzm),typeof t._isUTC!="undefined"&&(e._isUTC=t._isUTC),typeof t._offset!="undefined"&&(e._offset=t._offset),typeof t._pf!="undefined"&&(e._pf=t._pf),typeof t._locale!="undefined"&&(e._locale=t._locale);if(v.length>0)for(n in v)r=v[n],i=t[r],typeof i!="undefined"&&(e[r]=i);return e}function mt(e){return e<0?Math.ceil(e):Math.floor(e)}function gt(e,t,n){var r=""+Math.abs(e),i=e>=0;while(r.length<t)r="0"+r;return(i?n?"+":"":"-")+r}function yt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t- +e.clone().add(n.months,"M"),n}function bt(e,t){var n;return t=Ft(t,e),e.isBefore(t)?n=yt(e,t):(n=yt(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function wt(t,n){return function(r,i){var s,o;return i!==null&&!isNaN(+i)&&(ot(n,"moment()."+n+"(period, number) is deprecated. Please use moment()."+n+"(number, period)."),o=r,r=i,i=o),r=typeof r=="string"?+r:r,s=e.duration(r,i),Et(this,s,t),this}}function Et(t,n,r,i){var s=n._milliseconds,o=n._days,u=n._months;i=i==null?!0:i,s&&t._d.setTime(+t._d+s*r),o&&mn(t,"Date",vn(t,"Date")+o*r),u&&dn(t,vn(t,"Month")+u*r),i&&e.updateOffset(t,o||u)}function St(e){return Object.prototype.toString.call(e)==="[object Array]"}function xt(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}function Tt(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),s=0,o;for(o=0;o<r;o++)(n&&e[o]!==t[o]||!n&&Lt(e[o])!==Lt(t[o]))&&s++;return s+i}function Nt(e){if(e){var t=e.toLowerCase().replace(/(.)s$/,"$1");e=X[e]||V[t]||t}return e}function Ct(e){var t={},n,r;for(r in e)nt(e,r)&&(n=Nt(r),n&&(t[n]=e[r]));return t}function kt(t){var n,r;if(t.indexOf("week")===0)n=7,r="day";else{if(t.indexOf("month")!==0)return;n=12,r="month"}e[t]=function(i,s){var o,u,a=e._locale[t],f=[];typeof i=="number"&&(s=i,i=undefined),u=function(t){var n=e().utc().set(r,t);return a.call(e._locale,n,i||"")};if(s!=null)return u(s);for(o=0;o<n;o++)f.push(u(o));return f}}function Lt(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(t>=0?n=Math.floor(t):n=Math.ceil(t)),n}function At(e,t){return(new Date(Date.UTC(e,t+1,0))).getUTCDate()}function Ot(t,n,r){return ln(e([t,11,31+n-r]),n,r).week}function Mt(e){return _t(e)?366:365}function _t(e){return e%4===0&&e%100!==0||e%400===0}function Dt(e){var t;e._a&&e._pf.overflow===-2&&(t=e._a[a]<0||e._a[a]>11?a:e._a[f]<1||e._a[f]>At(e._a[u],e._a[a])?f:e._a[l]<0||e._a[l]>24||e._a[l]===24&&(e._a[c]!==0||e._a[h]!==0||e._a[p]!==0)?l:e._a[c]<0||e._a[c]>59?c:e._a[h]<0||e._a[h]>59?h:e._a[p]<0||e._a[p]>999?p:-1,e._pf._overflowDayOfYear&&(t<u||t>f)&&(t=f),e._pf.overflow=t)}function Pt(e){return e._isValid==null&&(e._isValid=!isNaN(e._d.getTime())&&e._pf.overflow<0&&!e._pf.empty&&!e._pf.invalidMonth&&!e._pf.nullInput&&!e._pf.invalidFormat&&!e._pf.userInvalidated,e._strict&&(e._isValid=e._isValid&&e._pf.charsLeftOver===0&&e._pf.unusedTokens.length===0&&e._pf.bigHour===undefined)),e._isValid}function Ht(e){return e?e.toLowerCase().replace("_","-"):e}function Bt(e){var t=0,n,r,i,s;while(t<e.length){s=Ht(e[t]).split("-"),n=s.length,r=Ht(e[t+1]),r=r?r.split("-"):null;while(n>0){i=jt(s.slice(0,n).join("-"));if(i)return i;if(r&&r.length>=n&&Tt(s,r,!0)>=n-1)break;n--}t++}return null}function jt(t){var n=null;if(!d[t]&&m)try{n=e.locale(),require("./locale/"+t),e.locale(n)}catch(r){}return d[t]}function Ft(t,n){var r,i;return n._isUTC?(r=n.clone(),i=(e.isMoment(t)||xt(t)?+t:+e(t))- +r,r._d.setTime(+r._d+i),e.updateOffset(r,!1),r):e(t).local()}function It(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function qt(e){var t=e.match(w),n,r;for(n=0,r=t.length;n<r;n++)G[t[n]]?t[n]=G[t[n]]:t[n]=It(t[n]);return function(i){var s="";for(n=0;n<r;n++)s+=t[n]instanceof Function?t[n].call(i,e):t[n];return s}}function Rt(e,t){return e.isValid()?(t=Ut(t,e.localeData()),$[t]||($[t]=qt(t)),$[t](e)):e.localeData().invalidDate()}function Ut(e,t){function r(e){return t.longDateFormat(e)||e}var n=5;E.lastIndex=0;while(n>=0&&E.test(e))e=e.replace(E,r),E.lastIndex=0,n-=1;return e}function zt(e,t){var n,r=t._strict;switch(e){case"Q":return _;case"DDDD":return P;case"YYYY":case"GGGG":case"gggg":return r?H:T;case"Y":case"G":case"g":return j;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return r?B:N;case"S":if(r)return _;case"SS":if(r)return D;case"SSS":if(r)return P;case"DDD":return x;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return k;case"a":case"A":return t._locale._meridiemParse;case"x":return O;case"X":return M;case"Z":case"ZZ":return L;case"T":return A;case"SSSS":return C;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return r?D:S;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return S;case"Do":return r?t._locale._ordinalParse:t._locale._ordinalParseLenient;default:return n=new RegExp(Yt(Gt(e.replace("\\","")),"i")),n}}function Wt(e){e=e||"";var t=e.match(L)||[],n=t[t.length-1]||[],r=(n+"").match(U)||["-",0,0],i=+(r[1]*60)+Lt(r[2]);return r[0]==="+"?i:-i}function Xt(t,n,r){var i,s=r._a;switch(t){case"Q":n!=null&&(s[a]=(Lt(n)-1)*3);break;case"M":case"MM":n!=null&&(s[a]=Lt(n)-1);break;case"MMM":case"MMMM":i=r._locale.monthsParse(n,t,r._strict),i!=null?s[a]=i:r._pf.invalidMonth=n;break;case"D":case"DD":n!=null&&(s[f]=Lt(n));break;case"Do":n!=null&&(s[f]=Lt(parseInt(n.match(/\d{1,2}/)[0],10)));break;case"DDD":case"DDDD":n!=null&&(r._dayOfYear=Lt(n));break;case"YY":s[u]=e.parseTwoDigitYear(n);break;case"YYYY":case"YYYYY":case"YYYYYY":s[u]=Lt(n);break;case"a":case"A":r._meridiem=n;break;case"h":case"hh":r._pf.bigHour=!0;case"H":case"HH":s[l]=Lt(n);break;case"m":case"mm":s[c]=Lt(n);break;case"s":case"ss":s[h]=Lt(n);break;case"S":case"SS":case"SSS":case"SSSS":s[p]=Lt(("0."+n)*1e3);break;case"x":r._d=new Date(Lt(n));break;case"X":r._d=new Date(parseFloat(n)*1e3);break;case"Z":case"ZZ":r._useUTC=!0,r._tzm=Wt(n);break;case"dd":case"ddd":case"dddd":i=r._locale.weekdaysParse(n),i!=null?(r._w=r._w||{},r._w.d=i):r._pf.invalidWeekday=n;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":t=t.substr(0,1);case"gggg":case"GGGG":case"GGGGG":t=t.substr(0,2),n&&(r._w=r._w||{},r._w[t]=Lt(n));break;case"gg":case"GG":r._w=r._w||{},r._w[t]=e.parseTwoDigitYear(n)}}function Vt(t){var n,r,i,s,o,a,f;n=t._w,n.GG!=null||n.W!=null||n.E!=null?(o=1,a=4,r=tt(n.GG,t._a[u],ln(e(),1,4).year),i=tt(n.W,1),s=tt(n.E,1)):(o=t._locale._week.dow,a=t._locale._week.doy,r=tt(n.gg,t._a[u],ln(e(),o,a).year),i=tt(n.w,1),n.d!=null?(s=n.d,s<o&&++i):n.e!=null?s=n.e+o:s=o),f=cn(r,i,s,a,o),t._a[u]=f.year,t._dayOfYear=f.dayOfYear}function $t(e){var t,n,r=[],i,s;if(e._d)return;i=Kt(e),e._w&&e._a[f]==null&&e._a[a]==null&&Vt(e),e._dayOfYear&&(s=tt(e._a[u],i[u]),e._dayOfYear>Mt(s)&&(e._pf._overflowDayOfYear=!0),n=on(s,0,e._dayOfYear),e._a[a]=n.getUTCMonth(),e._a[f]=n.getUTCDate());for(t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[l]===24&&e._a[c]===0&&e._a[h]===0&&e._a[p]===0&&(e._nextDay=!0,e._a[l]=0),e._d=(e._useUTC?on:sn).apply(null,r),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[l]=24)}function Jt(e){var t;if(e._d)return;t=Ct(e._i),e._a=[t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],$t(e)}function Kt(e){var t=new Date;return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Qt(t){if(t._f===e.ISO_8601){en(t);return}t._a=[],t._pf.empty=!0;var n=""+t._i,r,i,s,o,u,a=n.length,f=0;s=Ut(t._f,t._locale).match(w)||[];for(r=0;r<s.length;r++)o=s[r],i=(n.match(zt(o,t))||[])[0],i&&(u=n.substr(0,n.indexOf(i)),u.length>0&&t._pf.unusedInput.push(u),n=n.slice(n.indexOf(i)+i.length),f+=i.length),G[o]?(i?t._pf.empty=!1:t._pf.unusedTokens.push(o),Xt(o,i,t)):t._strict&&!i&&t._pf.unusedTokens.push(o);t._pf.charsLeftOver=a-f,n.length>0&&t._pf.unusedInput.push(n),t._pf.bigHour===!0&&t._a[l]<=12&&(t._pf.bigHour=undefined),t._a[l]=lt(t._locale,t._a[l],t._meridiem),$t(t),Dt(t)}function Gt(e){return e.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i})}function Yt(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Zt(e){var t,n,r,i,s;if(e._f.length===0){e._pf.invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<e._f.length;i++){s=0,t=vt({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._pf=rt(),t._f=e._f[i],Qt(t);if(!Pt(t))continue;s+=t._pf.charsLeftOver,s+=t._pf.unusedTokens.length*10,t._pf.score=s;if(r==null||s<r)r=s,n=t}dt(e,n||t)}function en(e){var t,n,r=e._i,i=F.exec(r);if(i){e._pf.iso=!0;for(t=0,n=q.length;t<n;t++)if(q[t][1].exec(r)){e._f=q[t][0]+(i[6]||" ");break}for(t=0,n=R.length;t<n;t++)if(R[t][1].exec(r)){e._f+=R[t][0];break}r.match(L)&&(e._f+="Z"),Qt(e)}else e._isValid=!1}function tn(t){en(t),t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))}function nn(e,t){var n=[],r;for(r=0;r<e.length;++r)n.push(t(e[r],r));return n}function rn(t){var n=t._i,r;n===undefined?t._d=new Date:xt(n)?t._d=new Date(+n):(r=g.exec(n))!==null?t._d=new Date(+r[1]):typeof n=="string"?tn(t):St(n)?(t._a=nn(n.slice(0),function(e){return parseInt(e,10)}),$t(t)):typeof n=="object"?Jt(t):typeof n=="number"?t._d=new Date(n):e.createFromInputFallback(t)}function sn(e,t,n,r,i,s,o){var u=new Date(e,t,n,r,i,s,o);return e<1970&&u.setFullYear(e),u}function on(e){var t=new Date(Date.UTC.apply(null,arguments));return e<1970&&t.setUTCFullYear(e),t}function un(e,t){if(typeof e=="string")if(!isNaN(e))e=parseInt(e,10);else{e=t.weekdaysParse(e);if(typeof e!="number")return null}return e}function an(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function fn(t,n,r){var s=e.duration(t).abs(),o=i(s.as("s")),u=i(s.as("m")),a=i(s.as("h")),f=i(s.as("d")),l=i(s.as("M")),c=i(s.as("y")),h=o<J.s&&["s",o]||u===1&&["m"]||u<J.m&&["mm",u]||a===1&&["h"]||a<J.h&&["hh",a]||f===1&&["d"]||f<J.d&&["dd",f]||l===1&&["M"]||l<J.M&&["MM",l]||c===1&&["y"]||["yy",c];return h[2]=n,h[3]=+t>0,h[4]=r,an.apply({},h)}function ln(t,n,r){var i=r-n,s=r-t.day(),o;return s>i&&(s-=7),s<i-7&&(s+=7),o=e(t).add(s,"d"),{week:Math.ceil(o.dayOfYear()/7),year:o.year()}}function cn(e,t,n,r,i){var s=on(e,0,1).getUTCDay(),o,u;return s=s===0?7:s,n=n!=null?n:i,o=i-s+(s>r?7:0)-(s<i?7:0),u=7*(t-1)+(n-i)+o+1,{year:u>0?e:e-1,dayOfYear:u>0?u:Mt(e-1)+u}}function hn(t){var n=t._i,r=t._f,i;return t._locale=t._locale||e.localeData(t._l),n===null||r===undefined&&n===""?e.invalid({nullInput:!0}):(typeof n=="string"&&(t._i=n=t._locale.preparse(n)),e.isMoment(n)?new ht(n,!0):(r?St(r)?Zt(t):Qt(t):rn(t),i=new ht(t),i._nextDay&&(i.add(1,"d"),i._nextDay=undefined),i))}function pn(t,n){var r,i;n.length===1&&St(n[0])&&(n=n[0]);if(!n.length)return e();r=n[0];for(i=1;i<n.length;++i)n[i][t](r)&&(r=n[i]);return r}function dn(e,t){var n;if(typeof t=="string"){t=e.localeData().monthsParse(t);if(typeof t!="number")return e}return n=Math.min(e.date(),At(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function vn(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function mn(e,t,n){return t==="Month"?dn(e,n):e._d["set"+(e._isUTC?"UTC":"")+t](n)}function gn(t,n){return function(r){return r!=null?(mn(this,t,r),e.updateOffset(this,n),this):vn(this,t)}}function yn(e){return e*400/146097}function bn(e){return e*146097/400}function wn(t){e.duration.fn[t]=function(){return this._data[t]}}var e,t="2.9.0",n=typeof global=="undefined"||typeof window!="undefined"&&window!==global.window?this:global,r,i=Math.round,s=Object.prototype.hasOwnProperty,o,u=0,a=1,f=2,l=3,c=4,h=5,p=6,d={},v=[],m=typeof module!="undefined"&&module&&module.exports,g=/^\/?Date\((\-?\d+)/i,y=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,b=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,w=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,E=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,S=/\d\d?/,x=/\d{1,3}/,T=/\d{1,4}/,N=/[+\-]?\d{1,6}/,C=/\d+/,k=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,L=/Z|[\+\-]\d\d:?\d\d/gi,A=/T/i,O=/[\+\-]?\d+/,M=/[\+\-]?\d+(\.\d{1,3})?/,_=/\d/,D=/\d\d/,P=/\d{3}/,H=/\d{4}/,B=/[+-]?\d{6}/,j=/[+-]?\d+/,F=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,I="YYYY-MM-DDTHH:mm:ssZ",q=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],R=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],U=/([\+\-]|\d\d)/gi,z="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),W={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},X={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},V={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},$={},J={s:45,m:45,h:22,d:26,M:11},K="DDD w W M D d".split(" "),Q="M D H h m s w W".split(" "),G={M:function(){return this.month()+1},MMM:function(e){return this.localeData().monthsShort(this,e)},MMMM:function(e){return this.localeData().months(this,e)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(e){return this.localeData().weekdaysMin(this,e)},ddd:function(e){return this.localeData().weekdaysShort(this,e)},dddd:function(e){return this.localeData().weekdays(this,e)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return gt(this.year()%100,2)},YYYY:function(){return gt(this.year(),4)},YYYYY:function(){return gt(this.year(),5)},YYYYYY:function(){var e=this.year(),t=e>=0?"+":"-";return t+gt(Math.abs(e),6)},gg:function(){return gt(this.weekYear()%100,2)},gggg:function(){return gt(this.weekYear(),4)},ggggg:function(){return gt(this.weekYear(),5)},GG:function(){return gt(this.isoWeekYear()%100,2)},GGGG:function(){return gt(this.isoWeekYear(),4)},GGGGG:function(){return gt(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return Lt(this.milliseconds()/100)},SS:function(){return gt(Lt(this.milliseconds()/10),2)},SSS:function(){return gt(this.milliseconds(),3)},SSSS:function(){return gt(this.milliseconds(),3)},Z:function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+gt(Lt(e/60),2)+":"+gt(Lt(e)%60,2)},ZZ:function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+gt(Lt(e/60),2)+gt(Lt(e)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},x:function(){return this.valueOf()},X:function(){return this.unix()},Q:function(){return this.quarter()}},Y={},Z=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"],et=!1;while(K.length)o=K.pop(),G[o+"o"]=at(G[o],o);while(Q.length)o=Q.pop(),G[o+o]=ut(G[o],2);G.DDDD=ut(G.DDD,3),dt(ct.prototype,{set:function(e){var t,n;for(n in e)t=e[n],typeof t=="function"?this[n]=t:this["_"+n]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(e){return this._months[e.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(e){return this._monthsShort[e.month()]},monthsParse:function(t,n,r){var i,s,o;this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]);for(i=0;i<12;i++){s=e.utc([2e3,i]),r&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),!r&&!this._monthsParse[i]&&(o="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[i]=new RegExp(o.replace(".",""),"i"));if(r&&n==="MMMM"&&this._longMonthsParse[i].test(t))return i;if(r&&n==="MMM"&&this._shortMonthsParse[i].test(t))return i;if(!r&&this._monthsParse[i].test(t))return i}},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(e){return this._weekdays[e.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(e){return this._weekdaysShort[e.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(e){return this._weekdaysMin[e.day()]},weekdaysParse:function(t){var n,r,i;this._weekdaysParse||(this._weekdaysParse=[]);for(n=0;n<7;n++){this._weekdaysParse[n]||(r=e([2e3,1]).day(n),i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[n]=new RegExp(i.replace(".",""),"i"));if(this._weekdaysParse[n].test(t))return n}},_longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(e){var t=this._longDateFormat[e];return!t&&this._longDateFormat[e.toUpperCase()]&&(t=this._longDateFormat[e.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e]=t),t},isPM:function(e){return(e+"").toLowerCase().charAt(0)==="p"},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(e,t,n){var r=this._calendar[e];return typeof r=="function"?r.apply(t,[n]):r},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(e,t,n,r){var i=this._relativeTime[n];return typeof i=="function"?i(e,t,n,r):i.replace(/%d/i,e)},pastFuture:function(e,t){var n=this._relativeTime[e>0?"future":"past"];return typeof n=="function"?n(t):n.replace(/%s/i,t)},ordinal:function(e){return this._ordinal.replace("%d",e)},_ordinal:"%d",_ordinalParse:/\d{1,2}/,preparse:function(e){return e},postformat:function(e){return e},week:function(e){return ln(e,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},firstDayOfWeek:function(){return this._week.dow},firstDayOfYear:function(){return this._week.doy},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),e=function(e,t,n,r){var i;return typeof n=="boolean"&&(r=n,n=undefined),i={},i._isAMomentObject=!0,i._i=e,i._f=t,i._l=n,i._strict=r,i._isUTC=!1,i._pf=rt(),hn(i)},e.suppressDeprecationWarnings=!1,e.createFromInputFallback=st("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),e.min=function(){var e=[].slice.call(arguments,0);return pn("isBefore",e)},e.max=function(){var e=[].slice.call(arguments,0);return pn("isAfter",e)},e.utc=function(e,t,n,r){var i;return typeof n=="boolean"&&(r=n,n=undefined),i={},i._isAMomentObject=!0,i._useUTC=!0,i._isUTC=!0,i._l=n,i._i=e,i._f=t,i._strict=r,i._pf=rt(),hn(i).utc()},e.unix=function(t){return e(t*1e3)},e.duration=function(t,n){var r=t,i=null,s,o,u,a;return e.isDuration(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:typeof t=="number"?(r={},n?r[n]=t:r.milliseconds=t):(i=y.exec(t))?(s=i[1]==="-"?-1:1,r={y:0,d:Lt(i[f])*s,h:Lt(i[l])*s,m:Lt(i[c])*s,s:Lt(i[h])*s,ms:Lt(i[p])*s}):(i=b.exec(t))?(s=i[1]==="-"?-1:1,u=function(e){var t=e&&parseFloat(e.replace(",","."));return(isNaN(t)?0:t)*s},r={y:u(i[2]),M:u(i[3]),d:u(i[4]),h:u(i[5]),m:u(i[6]),s:u(i[7]),w:u(i[8])}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(a=bt(e(r.from),e(r.to)),r={},r.ms=a.milliseconds,r.M=a.months),o=new pt(r),e.isDuration(t)&&nt(t,"_locale")&&(o._locale=t._locale),o},e.version=t,e.defaultFormat=I,e.ISO_8601=function(){},e.momentProperties=v,e.updateOffset=function(){},e.relativeTimeThreshold=function(e,t){return J[e]===undefined?!1:t===undefined?J[e]:(J[e]=t,!0)},e.lang=st("moment.lang is deprecated. Use moment.locale instead.",function(t,n){return e.locale(t,n)}),e.locale=function(t,n){var r;return t&&(typeof n!="undefined"?r=e.defineLocale(t,n):r=e.localeData(t),r&&(e.duration._locale=e._locale=r)),e._locale._abbr},e.defineLocale=function(t,n){return n!==null?(n.abbr=t,d[t]||(d[t]=new ct),d[t].set(n),e.locale(t),d[t]):(delete d[t],null)},e.langData=st("moment.langData is deprecated. Use moment.localeData instead.",function(t){return e.localeData(t)}),e.localeData=function(t){var n;t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr);if(!t)return e._locale;if(!St(t)){n=jt(t);if(n)return n;t=[t]}return Bt(t)},e.isMoment=function(e){return e instanceof ht||e!=null&&nt(e,"_isAMomentObject")},e.isDuration=function(e){return e instanceof pt};for(o=Z.length-1;o>=0;--o)kt(Z[o]);e.normalizeUnits=function(e){return Nt(e)},e.invalid=function(t){var n=e.utc(NaN);return t!=null?dt(n._pf,t):n._pf.userInvalidated=!0,n},e.parseZone=function(){return e.apply(null,arguments).parseZone()},e.parseTwoDigitYear=function(e){return Lt(e)+(Lt(e)>68?1900:2e3)},e.isDate=xt,dt(e.fn=ht.prototype,{clone:function(){return e(this)},valueOf:function(){return+this._d-(this._offset||0)*6e4},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var t=e(this).utc();return 0<t.year()&&t.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():Rt(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):Rt(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var e=this;return[e.year(),e.month(),e.date(),e.hours(),e.minutes(),e.seconds(),e.milliseconds()]},isValid:function(){return Pt(this)},isDSTShifted:function(){return this._a?this.isValid()&&Tt(this._a,(this._isUTC?e.utc(this._a):e(this._a)).toArray())>0:!1},parsingFlags:function(){return dt({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(e){return this.utcOffset(0,e)},local:function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(this._dateUtcOffset(),"m")),this},format:function(t){var n=Rt(this,t||e.defaultFormat);return this.localeData().postformat(n)},add:wt(1,"add"),subtract:wt(-1,"subtract"),diff:function(e,t,n){var r=Ft(e,this),i=(r.utcOffset()-this.utcOffset())*6e4,s,o,u,a;return t=Nt(t),t==="year"||t==="month"||t==="quarter"?(u=ft(this,r),t==="quarter"?u/=3:t==="year"&&(u/=12)):(o=this-r,u=t==="second"?o/1e3:t==="minute"?o/6e4:t==="hour"?o/36e5:t==="day"?(o-i)/864e5:t==="week"?(o-i)/6048e5:o),n?u:mt(u)},from:function(t,n){return e.duration({to:this,from:t}).locale(this.locale()).humanize(!n)},fromNow:function(t){return this.from(e(),t)},calendar:function(t){var n=t||e(),r=Ft(n,this).startOf("day"),i=this.diff(r,"days",!0),s=i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse";return this.format(this.localeData().calendar(s,this,e(n)))},isLeapYear:function(){return _t(this.year())},isDST:function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},day:function(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return e!=null?(e=un(e,this.localeData()),this.add(e-t,"d")):t},month:gn("Month",!0),startOf:function(e){e=Nt(e);switch(e){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return e==="week"?this.weekday(0):e==="isoWeek"&&this.isoWeekday(1),e==="quarter"&&this.month(Math.floor(this.month()/3)*3),this},endOf:function(e){return e=Nt(e),e===undefined||e==="millisecond"?this:this.startOf(e).add(1,e==="isoWeek"?"week":e).subtract(1,"ms")},isAfter:function(t,n){var r;return n=Nt(typeof n!="undefined"?n:"millisecond"),n==="millisecond"?(t=e.isMoment(t)?t:e(t),+this>+t):(r=e.isMoment(t)?+t:+e(t),r<+this.clone().startOf(n))},isBefore:function(t,n){var r;return n=Nt(typeof n!="undefined"?n:"millisecond"),n==="millisecond"?(t=e.isMoment(t)?t:e(t),+this<+t):(r=e.isMoment(t)?+t:+e(t),+this.clone().endOf(n)<r)},isBetween:function(e,t,n){return this.isAfter(e,n)&&this.isBefore(t,n)},isSame:function(t,n){var r;return n=Nt(n||"millisecond"),n==="millisecond"?(t=e.isMoment(t)?t:e(t),+this===+t):(r=+e(t),+this.clone().startOf(n)<=r&&r<=+this.clone().endOf(n))},min:st("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(t){return t=e.apply(null,arguments),t<this?this:t}),max:st("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(t){return t=e.apply(null,arguments),t>this?this:t}),zone:st("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",function(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),utcOffset:function(t,n){var r=this._offset||0,i;return t!=null?(typeof t=="string"&&(t=Wt(t)),Math.abs(t)<16&&(t*=60),!this._isUTC&&n&&(i=this._dateUtcOffset()),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!n||this._changeInProgress?Et(this,e.duration(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:this._dateUtcOffset()},isLocal:function(){return!this._isUTC},isUtcOffset:function(){return this._isUTC},isUtc:function(){return this._isUTC&&this._offset===0},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.utcOffset(this._tzm):typeof this._i=="string"&&this.utcOffset(Wt(this._i)),this},hasAlignedHourOffset:function(t){return t?t=e(t).utcOffset():t=0,(this.utcOffset()-t)%60===0},daysInMonth:function(){return At(this.year(),this.month())},dayOfYear:function(t){var n=i((e(this).startOf("day")-e(this).startOf("year"))/864e5)+1;return t==null?n:this.add(t-n,"d")},quarter:function(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)},weekYear:function(e){var t=ln(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return e==null?t:this.add(e-t,"y")},isoWeekYear:function(e){var t=ln(this,1,4).year;return e==null?t:this.add(e-t,"y")},week:function(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")},isoWeek:function(e){var t=ln(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")},weekday:function(e){var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")},isoWeekday:function(e){return e==null?this.day()||7:this.day(this.day()%7?e:e-7)},isoWeeksInYear:function(){return Ot(this.year(),1,4)},weeksInYear:function(){var e=this.localeData()._week;return Ot(this.year(),e.dow,e.doy)},get:function(e){return e=Nt(e),this[e]()},set:function(e,t){var n;if(typeof e=="object")for(n in e)this.set(n,e[n]);else e=Nt(e),typeof this[e]=="function"&&this[e](t);return this},locale:function(t){var n;return t===undefined?this._locale._abbr:(n=e.localeData(t),n!=null&&(this._locale=n),this)},lang:st("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===undefined?this.localeData():this.locale(e)}),localeData:function(){return this._locale},_dateUtcOffset:function(){return-Math.round(this._d.getTimezoneOffset()/15)*15}}),e.fn.millisecond=e.fn.milliseconds=gn("Milliseconds",!1),e.fn.second=e.fn.seconds=gn("Seconds",!1),e.fn.minute=e.fn.minutes=gn("Minutes",!1),e.fn.hour=e.fn.hours=gn("Hours",!0),e.fn.date=gn("Date",!0),e.fn.dates=st("dates accessor is deprecated. Use date instead.",gn("Date",!0)),e.fn.year=gn("FullYear",!0),e.fn.years=st("years accessor is deprecated. Use year instead.",gn("FullYear",!0)),e.fn.days=e.fn.day,e.fn.months=e.fn.month,e.fn.weeks=e.fn.week,e.fn.isoWeeks=e.fn.isoWeek,e.fn.quarters=e.fn.quarter,e.fn.toJSON=e.fn.toISOString,e.fn.isUTC=e.fn.isUtc,dt(e.duration.fn=pt.prototype,{_bubble:function(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,s,o,u=0;r.milliseconds=e%1e3,i=mt(e/1e3),r.seconds=i%60,s=mt(i/60),r.minutes=s%60,o=mt(s/60),r.hours=o%24,t+=mt(o/24),u=mt(yn(t)),t-=mt(bn(u)),n+=mt(t/30),t%=30,u+=mt(n/12),n%=12,r.days=t,r.months=n,r.years=u},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return mt(this.days()/7)},valueOf:function(){return this._milliseconds+this._days*864e5+this._months%12*2592e6+Lt(this._months/12)*31536e6},humanize:function(e){var t=fn(this,!e,this.localeData());return e&&(t=this.localeData().pastFuture(+this,t)),this.localeData().postformat(t)},add:function(t,n){var r=e.duration(t,n);return this._milliseconds+=r._milliseconds,this._days+=r._days,this._months+=r._months,this._bubble(),this},subtract:function(t,n){var r=e.duration(t,n);return this._milliseconds-=r._milliseconds,this._days-=r._days,this._months-=r._months,this._bubble(),this},get:function(e){return e=Nt(e),this[e.toLowerCase()+"s"]()},as:function(e){var t,n;e=Nt(e);if(e==="month"||e==="year")return t=this._days+this._milliseconds/864e5,n=this._months+yn(t)*12,e==="month"?n:n/12;t=this._days+Math.round(bn(this._months/12));switch(e){case"week":return t/7+this._milliseconds/6048e5;case"day":return t+this._milliseconds/864e5;case"hour":return t*24+this._milliseconds/36e5;case"minute":return t*24*60+this._milliseconds/6e4;case"second":return t*24*60*60+this._milliseconds/1e3;case"millisecond":return Math.floor(t*24*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+e)}},lang:e.fn.lang,locale:e.fn.locale,toIsoString:st("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var e=Math.abs(this.years()),t=Math.abs(this.months()),n=Math.abs(this.days()),r=Math.abs(this.hours()),i=Math.abs(this.minutes()),s=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(e?e+"Y":"")+(t?t+"M":"")+(n?n+"D":"")+(r||i||s?"T":"")+(r?r+"H":"")+(i?i+"M":"")+(s?s+"S":""):"P0D"},localeData:function(){return this._locale},toJSON:function(){return this.toISOString()}}),e.duration.fn.toString=e.duration.fn.toISOString;for(o in W)nt(W,o)&&wn(o.toLowerCase());return e.duration.fn.asMilliseconds=function(){return this.as("ms")},e.duration.fn.asSeconds=function(){return this.as("s")},e.duration.fn.asMinutes=function(){return this.as("m")},e.duration.fn.asHours=function(){return this.as("h")},e.duration.fn.asDays=function(){return this.as("d")},e.duration.fn.asWeeks=function(){return this.as("weeks")},e.duration.fn.asMonths=function(){return this.as("M")},e.duration.fn.asYears=function(){return this.as("y")},e.locale("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=Lt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),e});
public/js/external_libs/select2.js CHANGED
@@ -19,4 +19,4 @@ CONDITIONS OF ANY KIND, either express or implied. See the Apache License and th
19
  the specific language governing permissions and limitations under the Apache License and the GPL License.
20
  */
21
 
22
- timely.define(["jquery_timely"],function(e){(function(e){typeof e.fn.each2=="undefined"&&e.fn.extend({each2:function(t){var n=e([0]),r=-1,i=this.length;while(++r<i&&(n.context=n[0]=this[r])&&t.call(n[0],r,n)!==!1);return this}})})(e),function(e,t){function l(e,t){var n=0,r=t.length;for(;n<r;n+=1)if(c(e,t[n]))return n;return-1}function c(e,n){return e===n?!0:e===t||n===t?!1:e===null||n===null?!1:e.constructor===String?e===n+"":n.constructor===String?n===e+"":!1}function h(t,n){var r,i,s;if(t===null||t.length<1)return[];r=t.split(n);for(i=0,s=r.length;i<s;i+=1)r[i]=e.trim(r[i]);return r}function p(e){return e.outerWidth(!1)-e.width()}function d(n){var r="keyup-change-value";n.bind("keydown",function(){e.data(n,r)===t&&e.data(n,r,n.val())}),n.bind("keyup",function(){var i=e.data(n,r);i!==t&&n.val()!==i&&(e.removeData(n,r),n.trigger("keyup-change"))})}function v(n){n.bind("mousemove",function(n){var r=a;(r===t||r.x!==n.pageX||r.y!==n.pageY)&&e(n.target).trigger("mousemove-filtered",n)})}function m(e,n,r){r=r||t;var i;return function(){var t=arguments;window.clearTimeout(i),i=window.setTimeout(function(){n.apply(r,t)},e)}}function g(e){var t=!1,n;return function(){return t===!1&&(n=e(),t=!0),n}}function y(e,t){var n=m(e,function(e){t.trigger("scroll-debounced",e)});t.bind("scroll",function(e){l(e.target,t.get())>=0&&n(e)})}function b(e){if(e[0]===document.activeElement)return;window.setTimeout(function(){var t=e[0],n=e.val().length,r;e.focus(),t.setSelectionRange?t.setSelectionRange(n,n):t.createTextRange&&(r=t.createTextRange(),r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",n),r.select())},0)}function w(e){e.preventDefault(),e.stopPropagation()}function E(e){e.preventDefault(),e.stopImmediatePropagation()}function S(t){if(!u){var n=t[0].currentStyle||window.getComputedStyle(t[0],null);u=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"}),u.attr("class","select2-sizer"),e("body").append(u)}return u.text(t.val()),u.width()}function x(t,n,r){var i,s=[],o;i=t.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")===0&&s.push(this)}),i=n.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")!==0&&(o=r(this),typeof o=="string"&&o.length>0&&s.push(this))}),t.attr("class",s.join(" "))}function T(e,t,n,r){var i=e.toUpperCase().indexOf(t.toUpperCase()),s=t.length;if(i<0){n.push(r(e));return}n.push(r(e.substring(0,i))),n.push("<span class='select2-match'>"),n.push(r(e.substring(i,i+s))),n.push("</span>"),n.push(r(e.substring(i+s,e.length)))}function N(t){var n,r=0,i=null,s=t.quietMillis||100,o=t.url,u=this;return function(a){window.clearTimeout(n),n=window.setTimeout(function(){r+=1;var n=r,s=t.data,f=o,l=t.transport||e.ajax,c=t.type||"GET",h={};s=s?s.call(u,a.term,a.page,a.context):null,f=typeof f=="function"?f.call(u,a.term,a.page,a.context):f,null!==i&&i.abort(),t.params&&(e.isFunction(t.params)?e.extend(h,t.params.call(u)):e.extend(h,t.params)),e.extend(h,{url:f,dataType:t.dataType,data:s,type:c,cache:!1,success:function(e){if(n<r)return;var i=t.results(e,a.page);a.callback(i)}}),i=l.call(u,h)},s)}}function C(t){var n=t,r,i,s=function(e){return""+e.text};e.isArray(n)&&(i=n,n={results:i}),e.isFunction(n)===!1&&(i=n,n=function(){return i});var o=n();return o.text&&(s=o.text,e.isFunction(s)||(r=n.text,s=function(e){return e[r]})),function(t){var r=t.term,i={results:[]},o;if(r===""){t.callback(n());return}o=function(n,i){var u,a;n=n[0];if(n.children){u={};for(a in n)n.hasOwnProperty(a)&&(u[a]=n[a]);u.children=[],e(n.children).each2(function(e,t){o(t,u.children)}),(u.children.length||t.matcher(r,s(u),n))&&i.push(u)}else t.matcher(r,s(n),n)&&i.push(n)},e(n().results).each2(function(e,t){o(t,i.results)}),t.callback(i)}}function k(n){var r=e.isFunction(n);return function(i){var s=i.term,o={results:[]};e(r?n():n).each(function(){var e=this.text!==t,n=e?this.text:this;(s===""||i.matcher(s,n))&&o.results.push(e?this:{id:this,text:this})}),i.callback(o)}}function L(t,n){if(e.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value")}function A(t){return e.isFunction(t)?t():t}function O(t){var n=0;return e.each(t,function(e,t){t.children?n+=O(t.children):n++}),n}function M(e,n,r,i){var s=e,o=!1,u,a,f,l,h;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return t;for(;;){a=-1;for(f=0,l=i.tokenSeparators.length;f<l;f++){h=i.tokenSeparators[f],a=e.indexOf(h);if(a>=0)break}if(a<0)break;u=e.substring(0,a),e=e.substring(a+h.length);if(u.length>0){u=i.createSearchChoice(u,n);if(u!==t&&u!==null&&i.id(u)!==t&&i.id(u)!==null){o=!1;for(f=0,l=n.length;f<l;f++)if(c(i.id(u),i.id(n[f]))){o=!0;break}o||r(u)}}}if(s!==e)return e}function _(t,n){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=e.extend(r.prototype,n),r}var n,r,i,s,o,u,a,f;n={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){e=e.which?e.which:e;switch(e){case n.LEFT:case n.RIGHT:case n.UP:case n.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case n.SHIFT:case n.CTRL:case n.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&e<=123}},f=e(document),o=function(){var e=1;return function(){return e++}}(),f.bind("mousemove",function(e){a={x:e.pageX,y:e.pageY}}),r=_(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(n){var r,i,s=".select2-results",u;this.opts=n=this.prepareOpts(n),this.id=n.id,n.element.data("select2")!==t&&n.element.data("select2")!==null&&this.destroy(),this.enabled=!0,this.container=this.createContainer(),this.containerId="s2id_"+(n.element.attr("id")||"autogen"+o()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=g(function(){return n.element.closest("body")}),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(A(n.containerCss)),this.container.addClass(A(n.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabIndex"),this.opts.element.data("select2",this).addClass("select2-offscreen").bind("focus.select2",function(){e(this).select2("focus")}).attr("tabIndex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(A(n.dropdownCssClass)),this.dropdown.data("select2",this),this.results=r=this.container.find(s),this.search=i=this.container.find("input.select2-input"),i.attr("tabIndex",this.elementTabIndex),this.resultsPage=0,this.context=null,this.initContainer(),v(this.results),this.dropdown.delegate(s,"mousemove-filtered touchstart touchmove touchend",this.bind(this.highlightUnderEvent)),y(80,this.results),this.dropdown.delegate(s,"scroll-debounced",this.bind(this.loadMoreIfNeeded)),e.fn.mousewheel&&r.mousewheel(function(e,t,n,i){var s=r.scrollTop(),o;i>0&&s-i<=0?(r.scrollTop(0),w(e)):i<0&&r.get(0).scrollHeight-r.scrollTop()+i<=r.height()&&(r.scrollTop(r.get(0).scrollHeight-r.height()),w(e))}),d(i),i.bind("keyup-change input paste",this.bind(this.updateResults)),i.bind("focus",function(){i.addClass("select2-focused")}),i.bind("blur",function(){i.removeClass("select2-focused")}),this.dropdown.delegate(s,"mouseup",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.bind("click mouseup mousedown",function(e){e.stopPropagation()}),e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),(n.element.is(":disabled")||n.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var e=this.opts.element.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),e!==t&&(e.container.remove(),e.dropdown.remove(),e.opts.element.removeClass("select2-offscreen").removeData("select2").unbind(".select2").attr({tabIndex:this.elementTabIndex}).show())},prepareOpts:function(n){var r,i,s,o;r=n.element,r.get(0).tagName.toLowerCase()==="select"&&(this.select=i=n.element),i&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),n=e.extend({},{populateResults:function(r,i,s){var o,u,a,f,l=this.opts.id,c=this;o=function(r,i,u){var a,f,h,p,d,v,m,g,y,b;r=n.sortResults(r,i,s);for(a=0,f=r.length;a<f;a+=1)h=r[a],d=h.disabled===!0,p=!d&&l(h)!==t,v=h.children&&h.children.length>0,m=e("<li></li>"),m.addClass("select2-results-dept-"+u),m.addClass("select2-result"),m.addClass(p?"select2-result-selectable":"select2-result-unselectable"),d&&m.addClass("select2-disabled"),v&&m.addClass("select2-result-with-children"),m.addClass(c.opts.formatResultCssClass(h)),g=e(document.createElement("div")),g.addClass("select2-result-label"),b=n.formatResult(h,g,s,c.opts.escapeMarkup),b!==t&&g.html(b),m.append(g),v&&(y=e("<ul></ul>"),y.addClass("select2-result-sub"),o(h.children,y,u+1),m.append(y)),m.data("select2-data",h),i.append(m)},o(i,r,0)}},e.fn.select2.defaults,n),typeof n.id!="function"&&(s=n.id,n.id=function(e){return e[s]});if(e.isArray(n.element.data("select2Tags"))){if("tags"in n)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id");n.tags=n.element.attr("data-select2-tags")}i?(n.query=this.bind(function(n){var i={results:[],more:!1},s=n.term,o,u,a;a=function(e,t){var r;e.is("option")?n.matcher(s,e.text(),e)&&t.push({id:e.attr("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:c(e.attr("disabled"),"disabled")}):e.is("optgroup")&&(r={text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")},e.children().each2(function(e,t){a(t,r.children)}),r.children.length>0&&t.push(r))},o=r.children(),this.getPlaceholder()!==t&&o.length>0&&(u=o[0],e(u).text()===""&&(o=o.not(u))),o.each2(function(e,t){a(t,i.results)}),n.callback(i)}),n.id=function(e){return e.id},n.formatResultCssClass=function(e){return e.css}):"query"in n||("ajax"in n?(o=n.element.data("ajax-url"),o&&o.length>0&&(n.ajax.url=o),n.query=N.call(n.element,n.ajax)):"data"in n?n.query=C(n.data):"tags"in n&&(n.query=k(n.tags),n.createSearchChoice===t&&(n.createSearchChoice=function(e){return{id:e,text:e}}),n.initSelection===t&&(n.initSelection=function(t,r){var i=[];e(h(t.val(),n.separator)).each(function(){var t=this,r=this,s=n.tags;e.isFunction(s)&&(s=s()),e(s).each(function(){if(c(this.id,t))return r=this.text,!1}),i.push({id:t,text:r})}),r(i)})));if(typeof n.query!="function")throw"query function not defined for Select2 "+n.element.attr("id");return n},monitorSource:function(){var e=this.opts.element,t;e.bind("change.select2",this.bind(function(e){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),t=this.bind(function(){var e,t,n=this;e=this.opts.element.attr("disabled")!=="disabled",t=this.opts.element.attr("readonly")==="readonly",e=e&&!t,this.enabled!==e&&(e?this.enable():this.disable()),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(A(this.opts.containerCssClass)),x(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(A(this.opts.dropdownCssClass))}),e.bind("propertychange.select2 DOMAttrModified.select2",t),typeof WebKitMutationObserver!="undefined"&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(function(e){e.forEach(t)}),this.propertyObserver.observe(e.get(0),{attributes:!0,subtree:!1}))},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){if(this.enabled)return;this.enabled=!0,this.container.removeClass("select2-container-disabled"),this.opts.element.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"),this.opts.element.attr("disabled","disabled")},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t=this.container.offset(),n=this.container.outerHeight(!1),r=this.container.outerWidth(!1),i=this.dropdown.outerHeight(!1),s=e(window).scrollLeft()+e(window).width(),o=e(window).scrollTop()+e(window).height(),u=t.top+n,a=t.left,f=u+i<=o,l=t.top-i>=this.body().scrollTop(),c=this.dropdown.outerWidth(!1),h=a+c<=s,p=this.dropdown.hasClass("select2-drop-above"),d,v,m;this.body().css("position")!=="static"&&(d=this.body().offset(),u-=d.top,a-=d.left),p?(v=!0,!l&&f&&(v=!1)):(v=!1,!f&&l&&(v=!0)),h||(a=t.left+r-c),v?(u=t.top-i,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")),m=e.extend({top:u,left:a,width:r},A(this.opts.dropdownCss)),this.dropdown.css(m)},shouldOpen:function(){var t;return this.opened()?!1:(t=e.Event("opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(window.setTimeout(this.bind(this.opening),1),!0):!1},opening:function(){var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t,s;this.clearDropdownAlignmentPreference(),this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),this.updateResults(!0),s=e("#select2-drop-mask"),s.length==0&&(s=e(document.createElement("div")),s.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),s.hide(),s.appendTo(this.body()),s.bind("mousedown touchstart",function(t){var n=e("#select2-drop"),r;n.length>0&&(r=n.data("select2"),r.opts.selectOnBlur&&r.selectHighlighted({noFocus:!0}),r.close())})),this.dropdown.prev()[0]!==s[0]&&this.dropdown.before(s),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),s.css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),s.show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this.ensureHighlightVisible();var o=this;this.container.parents().add(window).each(function(){e(this).bind(r+" "+n+" "+i,function(t){e("#select2-drop-mask").css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),o.positionDropdown()})}),this.focusSearch()},close:function(){if(!this.opened())return;var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).unbind(n).unbind(r).unbind(i)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.opts.element.trigger(e.Event("close"))},clearSearch:function(){},getMaximumSelectionSize:function(){return A(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t=this.results,n,r,i,s,o,u,a;r=this.highlight();if(r<0)return;if(r==0){t.scrollTop(0);return}n=this.findHighlightableChoices(),i=e(n[r]),s=i.offset().top+i.outerHeight(!0),r===n.length-1&&(a=t.find("li.select2-more-results"),a.length>0&&(s=a.offset().top+a.outerHeight(!0))),o=t.offset().top+t.outerHeight(!0),s>o&&t.scrollTop(t.scrollTop()+(s-o)),u=i.offset().top-t.offset().top,u<0&&i.css("display")!="none"&&t.scrollTop(t.scrollTop()+u)},findHighlightableChoices:function(){var e=this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)");return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){var n=this.findHighlightableChoices(),r=this.highlight();while(r>-1&&r<n.length){r+=t;var i=e(n[r]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(r);break}}},highlight:function(t){var n=this.findHighlightableChoices(),r,i;if(arguments.length===0)return l(n.filter(".select2-highlighted")[0],n.get());t>=n.length&&(t=n.length-1),t<0&&(t=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),r=e(n[t]),r.addClass("select2-highlighted"),this.ensureHighlightVisible(),i=r.data("select2-data"),i&&this.opts.element.trigger({type:"highlight",val:this.id(i),choice:i})},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var n=e(t.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var r=this.findHighlightableChoices();this.highlight(r.index(n))}else n.length==0&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),n,r=-1,i=this.resultsPage+1,s=this,o=this.search.val(),u=this.context;if(t.length===0)return;n=t.offset().top-e.offset().top-e.height(),n<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:o,page:i,context:u,matcher:this.opts.matcher,callback:this.bind(function(n){if(!s.opened())return;s.opts.populateResults.call(this,e,n.results,{term:o,page:i,context:u}),n.more===!0?(t.detach().appendTo(e).text(s.opts.formatLoadMore(i+1)),window.setTimeout(function(){s.loadMoreIfNeeded()},10)):t.remove(),s.positionDropdown(),s.resultsPage=i,s.context=n.context})}))},tokenize:function(){},updateResults:function(n){function f(){i.scrollTop(0),r.removeClass("select2-active"),u.positionDropdown()}function l(e){i.html(e),f()}var r=this.search,i=this.results,s=this.opts,o,u=this,a;if(n!==!0&&(this.showSearchInput===!1||!this.opened()))return;r.addClass("select2-active");var h=this.getMaximumSelectionSize();if(h>=1){o=this.data();if(e.isArray(o)&&o.length>=h&&L(s.formatSelectionTooBig,"formatSelectionTooBig")){l("<li class='select2-selection-limit'>"+s.formatSelectionTooBig(h)+"</li>");return}}if(r.val().length<s.minimumInputLength){L(s.formatInputTooShort,"formatInputTooShort")?l("<li class='select2-no-results'>"+s.formatInputTooShort(r.val(),s.minimumInputLength)+"</li>"):l("");return}s.formatSearching()&&n===!0&&l("<li class='select2-searching'>"+s.formatSearching()+"</li>");if(s.maximumInputLength&&r.val().length>s.maximumInputLength){L(s.formatInputTooLong,"formatInputTooLong")?l("<li class='select2-no-results'>"+s.formatInputTooLong(r.val(),s.maximumInputLength)+"</li>"):l("");return}a=this.tokenize(),a!=t&&a!=null&&r.val(a),this.resultsPage=1,s.query({element:s.element,term:r.val(),page:this.resultsPage,context:null,matcher:s.matcher,callback:this.bind(function(o){var a;if(!this.opened())return;this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&r.val()!==""&&(a=this.opts.createSearchChoice.call(null,r.val(),o.results),a!==t&&a!==null&&u.id(a)!==t&&u.id(a)!==null&&e(o.results).filter(function(){return c(u.id(this),u.id(a))}).length===0&&o.results.unshift(a));if(o.results.length===0&&L(s.formatNoMatches,"formatNoMatches")){l("<li class='select2-no-results'>"+s.formatNoMatches(r.val())+"</li>");return}i.empty(),u.opts.populateResults.call(this,i,o.results,{term:r.val(),page:this.resultsPage,context:null}),o.more===!0&&L(s.formatLoadMore,"formatLoadMore")&&(i.append("<li class='select2-more-results'>"+u.opts.escapeMarkup(s.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){u.loadMoreIfNeeded()},10)),this.postprocessResults(o,n),f()})})},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){b(this.search)},selectHighlighted:function(e){var t=this.highlight(),n=this.results.find(".select2-highlighted"),r=n.closest(".select2-result").data("select2-data");r&&(this.highlight(t),this.onSelect(r,e))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){function n(){var n,r,i,s,o;if(this.opts.width==="off")return null;if(this.opts.width==="element")return this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px";if(this.opts.width==="copy"||this.opts.width==="resolve"){n=this.opts.element.attr("style");if(n!==t){r=n.split(";");for(s=0,o=r.length;s<o;s+=1){i=r[s].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);if(i!==null&&i.length>=1)return i[1]}}return this.opts.width==="resolve"?(n=this.opts.element.css("width"),n.indexOf("%")>0?n:this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var r=n.call(this);r!==null&&this.container.css("width",r)}}),i=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>"," <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>"," <div><b></b></div>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop' style='display:none'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.focusser.attr("disabled","disabled")},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.focusser.removeAttr("disabled")},opening:function(){this.parent.opening.apply(this,arguments),this.focusser.attr("disabled","disabled"),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),b(this.focusser)},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var e,t=this.container,r=this.dropdown,i=!1;this.showSearch(this.opts.minimumResultsForSearch>=0),this.selection=e=t.find(".select2-choice"),this.focusser=t.find(".select2-focusser"),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN){w(e);return}switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.TAB:case n.ENTER:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}})),this.focusser.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.ESC)return;if(this.opts.openOnEnter===!1&&e.which===n.ENTER){w(e);return}if(e.which==n.DOWN||e.which==n.UP||e.which==n.ENTER&&this.opts.openOnEnter){this.open(),w(e);return}if(e.which==n.DELETE||e.which==n.BACKSPACE){this.opts.allowClear&&this.clear(),w(e);return}})),d(this.focusser),this.focusser.bind("keyup-change input",this.bind(function(e){if(this.opened())return;this.open(),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.focusser.val(""),w(e)})),e.delegate("abbr","mousedown",this.bind(function(e){if(!this.enabled)return;this.clear(),E(e),this.close(),this.selection.focus()})),e.bind("mousedown",this.bind(function(e){i=!0,this.opened()?this.close():this.enabled&&this.open(),w(e),i=!1})),r.bind("mousedown",this.bind(function(){this.search.focus()})),e.bind("focus",this.bind(function(e){w(e)})),this.focusser.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})).bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active")})),this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.setPlaceholder()},clear:function(){var e=this.selection.data("select2-data");this.opts.element.val(""),this.selection.find("span").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),this.opts.element.trigger({type:"removed",val:this.id(e),choice:e}),this.triggerChange({removed:e})},initSelection:function(){var e;if(this.opts.element.val()===""&&this.opts.element.text()==="")this.close(),this.setPlaceholder();else{var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.setPlaceholder())})}},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(t,n){var r=t.find(":selected");e.isFunction(n)&&n({id:r.attr("value"),text:r.text(),element:r})}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=n.val();t.query({matcher:function(e,n,r){return c(i,t.id(r))},callback:e.isFunction(r)?function(e){r(e.results.length?e.results[0]:null)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.select.find("option").first().text()!==""?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.opts.element.val()===""&&e!==t){if(this.select&&this.select.find("option:first").text()!=="")return;this.selection.find("span").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide()}},postprocessResults:function(e,t){var n=0,r=this,i=!0;this.findHighlightableChoices().each2(function(e,t){if(c(r.id(t.data("select2-data")),r.opts.element.val()))return n=e,!1}),this.highlight(n);if(t===!0){var s=this.opts.minimumResultsForSearch;i=s<0?!1:O(e.results)>=s,this.showSearch(i)}},showSearch:function(t){this.showSearchInput=t,this.dropdown.find(".select2-search")[t?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[t?"addClass":"removeClass"]("select2-with-searchbox")},onSelect:function(e,t){var n=this.opts.element.val();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.close(),(!t||!t.noFocus)&&this.selection.focus(),c(n,this.id(e))||this.triggerChange()},updateSelection:function(e){var n=this.selection.find("span"),r;this.selection.data("select2-data",e),n.empty(),r=this.opts.formatSelection(e,n),r!==t&&n.append(this.opts.escapeMarkup(r)),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.selection.find("abbr").show()},val:function(){var e,n=!1,r=null,i=this;if(arguments.length===0)return this.opts.element.val();e=arguments[0],arguments.length>1&&(n=arguments[1]);if(this.select)this.select.val(e).find(":selected").each2(function(e,t){return r={id:t.attr("value"),text:t.text()},!1}),this.updateSelection(r),this.setPlaceholder(),n&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!e&&e!==0){this.clear(),n&&this.triggerChange();return}this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){i.opts.element.val(e?i.id(e):""),i.updateSelection(e),i.setPlaceholder(),n&&i.triggerChange()})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var n;if(arguments.length===0)return n=this.selection.data("select2-data"),n==t&&(n=null),n;!e||e===""?this.clear():(this.opts.element.val(e?this.id(e):""),this.updateSelection(e))}}),s=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html([" <ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi' style='display:none;'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(e,t){var n=[];e.find(":selected").each2(function(e,t){n.push({id:t.attr("value"),text:t.text(),element:t[0]})}),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=h(n.val(),t.separator);t.query({matcher:function(n,r,s){return e.grep(i,function(e){return c(e,t.id(s))}).length},callback:e.isFunction(r)?function(e){r(e.results)}:e.noop})}),t},initContainer:function(){var t=".select2-choices",r;this.searchContainer=this.container.find(".select2-search-field"),this.selection=r=this.container.find(t),this.search.bind("input paste",this.bind(function(){if(!this.enabled)return;this.opened()||this.open()})),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.BACKSPACE&&this.search.val()===""){this.close();var t,i=r.find(".select2-search-choice-focus");if(i.length>0){this.unselect(i.first()),this.search.width(10),w(e);return}t=r.find(".select2-search-choice:not(.select2-locked)"),t.length>0&&t.last().addClass("select2-search-choice-focus")}else r.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.ENTER:case n.TAB:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.BACKSPACE||e.which===n.ESC)return;if(e.which===n.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN)&&w(e)})),this.search.bind("keyup",this.bind(this.resizeSearch)),this.search.bind("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.opened()||this.clearSearch(),e.stopImmediatePropagation()})),this.container.delegate(t,"mousedown",this.bind(function(t){if(!this.enabled)return;if(e(t.target).closest(".select2-search-choice").length>0)return;this.clearPlaceholder(),this.open(),this.focusSearch(),t.preventDefault()})),this.container.delegate(t,"focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder()})),this.initContainerWidth(),this.clearSearch()},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.search.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0)},initSelection:function(){var e;this.opts.element.val()===""&&this.opts.element.text()===""&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||this.opts.element.val()!==""){var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder();e!==t&&this.getVal().length===0&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.resizeSearch()):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.parent.opening.apply(this,arguments),this.clearPlaceholder(),this.resizeSearch(),this.focusSearch(),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus(),this.opts.element.triggerHandler("focus")},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var n=[],r=[],i=this;e(t).each(function(){l(i.id(this),n)<0&&(n.push(i.id(this)),r.push(this))}),t=r,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){i.addSelectedChoice(this)}),i.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer(e,this.data(),this.bind(this.onSelect),this.opts),e!=null&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),(!t||!t.noFocus)&&this.focusSearch()},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(n){var r=!n.locked,i=e("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=e("<li class='select2-search-choice select2-locked'><div></div></li>"),o=r?i:s,u=this.id(n),a=this.getVal(),f;f=this.opts.formatSelection(n,o.find("div")),f!=t&&o.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"</div>"),r&&o.find(".select2-search-choice-close").bind("mousedown",w).bind("click dblclick",this.bind(function(t){if(!this.enabled)return;e(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),w(t)})).bind("focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active")})),o.data("select2-data",n),o.insertBefore(this.searchContainer),a.push(u),this.setVal(a)},unselect:function(e){var t=this.getVal(),n,r;e=e.closest(".select2-search-choice");if(e.length===0)throw"Invalid argument: "+e+". Must be .select2-search-choice";n=e.data("select2-data");if(!n)return;r=l(this.id(n),t),r>=0&&(t.splice(r,1),this.setVal(t),this.select&&this.postprocessResults()),e.remove(),this.opts.element.trigger({type:"removed",val:this.id(n),choice:n}),this.triggerChange({removed:n})},postprocessResults:function(){var e=this.getVal(),t=this.results.find(".select2-result"),n=this.results.find(".select2-result-with-children"),r=this;t.each2(function(t,n){var i=r.id(n.data("select2-data"));l(i,e)>=0&&(n.addClass("select2-selected"),n.find(".select2-result-selectable").addClass("select2-selected"))}),n.each2(function(e,t){!t.is(".select2-result-selectable")&&t.find(".select2-result-selectable:not(.select2-selected)").length===0&&t.addClass("select2-selected")}),this.highlight()==-1&&r.highlight(0)},resizeSearch:function(){var e,t,n,r,i,s=p(this.search);e=S(this.search)+10,t=this.search.offset().left,n=this.selection.width(),r=this.selection.offset().left,i=n-(t-r)-s,i<e&&(i=n-s),i<40&&(i=n-s),i<=0&&(i=e),this.search.width(i)},getVal:function(){var e;return this.select?(e=this.select.val(),e===null?[]:e):(e=this.opts.element.val(),h(e,this.opts.separator))},setVal:function(t){var n;this.select?this.select.val(t):(n=[],e(t).each(function(){l(this,n)<0&&n.push(this)}),this.opts.element.val(n.length===0?"":n.join(this.opts.separator)))},val:function(){var n,r=!1,i=[],s=this;if(arguments.length===0)return this.getVal();n=arguments[0],arguments.length>1&&(r=arguments[1]);if(!n&&n!==0){this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),r&&this.triggerChange();return}this.setVal(n);if(this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),r&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var n=e(t).map(s.id);s.setVal(n),s.updateSelection(t),s.clearSearch(),r&&s.triggerChange()})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],n=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(n.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t){var n=this,r;if(arguments.length===0)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();t||(t=[]),r=e.map(t,function(e){return n.opts.id(e)}),this.setVal(r),this.updateSelection(t),this.clearSearch()}}),e.fn.select2=function(){var n=Array.prototype.slice.call(arguments,0),r,o,u,a,f=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","disable","positionDropdown","data"];return this.each(function(){if(n.length===0||typeof n[0]=="object")r=n.length===0?{}:e.extend({},n[0]),r.element=e(this),r.element.get(0).tagName.toLowerCase()==="select"?a=r.element.attr("multiple"):(a=r.multiple||!1,"tags"in r&&(r.multiple=a=!0)),o=a?new s:new i,o.init(r);else{if(typeof n[0]!="string")throw"Invalid arguments to select2 plugin: "+n;if(l(n[0],f)<0)throw"Unknown method: "+n[0];u=t,o=e(this).data("select2");if(o===t)return;n[0]==="container"?u=o.container:u=o[n[0]].apply(o,n.slice(1));if(u!==t)return!1}}),u===t?this:u},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,n,r){var i=[];return T(e.text,n.term,i,r),i.join("")},formatSelection:function(e,n){return e?e.text:t},sortResults:function(e,t,n){return e},formatResultCssClass:function(e){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" more character"+(n==1?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please enter "+n+" less character"+(n==1?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(e==1?"":"s")},formatLoadMore:function(e){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e.id},matcher:function(e,t){return t.toUpperCase().indexOf(e.toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;","/":"&#47;"};return String(e).replace(/[&<>"'/\\]/g,function(e){return t[e[0]]})},blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null}}}(e)});
19
  the specific language governing permissions and limitations under the Apache License and the GPL License.
20
  */
21
 
22
+ timely.define(["jquery_timely"],function(e){(function(e){typeof e.fn.each2=="undefined"&&e.fn.extend({each2:function(t){var n=e([0]),r=-1,i=this.length;while(++r<i&&(n.context=n[0]=this[r])&&t.call(n[0],r,n)!==!1);return this}})})(e),function(e,t){function l(e,t){var n=0,r=t.length;for(;n<r;n+=1)if(c(e,t[n]))return n;return-1}function c(e,n){return e===n?!0:e===t||n===t?!1:e===null||n===null?!1:e.constructor===String?e===n+"":n.constructor===String?n===e+"":!1}function h(t,n){var r,i,s;if(t===null||t.length<1)return[];r=t.split(n);for(i=0,s=r.length;i<s;i+=1)r[i]=e.trim(r[i]);return r}function p(e){return e.outerWidth(!1)-e.width()}function d(n){var r="keyup-change-value";n.bind("keydown",function(){e.data(n,r)===t&&e.data(n,r,n.val())}),n.bind("keyup",function(){var i=e.data(n,r);i!==t&&n.val()!==i&&(e.removeData(n,r),n.trigger("keyup-change"))})}function v(n){n.bind("mousemove",function(n){var r=a;(r===t||r.x!==n.pageX||r.y!==n.pageY)&&e(n.target).trigger("mousemove-filtered",n)})}function m(e,n,r){r=r||t;var i;return function(){var t=arguments;window.clearTimeout(i),i=window.setTimeout(function(){n.apply(r,t)},e)}}function g(e){var t=!1,n;return function(){return t===!1&&(n=e(),t=!0),n}}function y(e,t){var n=m(e,function(e){t.trigger("scroll-debounced",e)});t.bind("scroll",function(e){l(e.target,t.get())>=0&&n(e)})}function b(e){if(e[0]===document.activeElement)return;window.setTimeout(function(){var t=e[0],n=e.val().length,r;e.focus(),t.setSelectionRange?t.setSelectionRange(n,n):t.createTextRange&&(r=t.createTextRange(),r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",n),r.select())},0)}function w(e){e.preventDefault(),e.stopPropagation()}function E(e){e.preventDefault(),e.stopImmediatePropagation()}function S(t){if(!u){var n=t[0].currentStyle||window.getComputedStyle(t[0],null);u=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"}),u.attr("class","select2-sizer"),e("body").append(u)}return u.text(t.val()),u.width()}function x(t,n,r){var i,s=[],o;i=t.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")===0&&s.push(this)}),i=n.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")!==0&&(o=r(this),typeof o=="string"&&o.length>0&&s.push(this))}),t.attr("class",s.join(" "))}function T(e,t,n,r){var i=e.toUpperCase().indexOf(t.toUpperCase()),s=t.length;if(i<0){n.push(r(e));return}n.push(r(e.substring(0,i))),n.push("<span class='select2-match'>"),n.push(r(e.substring(i,i+s))),n.push("</span>"),n.push(r(e.substring(i+s,e.length)))}function N(t){var n,r=0,i=null,s=t.quietMillis||100,o=t.url,u=this;return function(a){window.clearTimeout(n),n=window.setTimeout(function(){r+=1;var n=r,s=t.data,f=o,l=t.transport||e.ajax,c=t.type||"GET",h={};s=s?s.call(u,a.term,a.page,a.context):null,f=typeof f=="function"?f.call(u,a.term,a.page,a.context):f,null!==i&&i.abort(),t.params&&(e.isFunction(t.params)?e.extend(h,t.params.call(u)):e.extend(h,t.params)),e.extend(h,{url:f,dataType:t.dataType,data:s,type:c,cache:!1,success:function(e){if(n<r)return;var i=t.results(e,a.page);a.callback(i)}}),i=l.call(u,h)},s)}}function C(t){var n=t,r,i,s=function(e){return""+e.text};e.isArray(n)&&(i=n,n={results:i}),e.isFunction(n)===!1&&(i=n,n=function(){return i});var o=n();return o.text&&(s=o.text,e.isFunction(s)||(r=n.text,s=function(e){return e[r]})),function(t){var r=t.term,i={results:[]},o;if(r===""){t.callback(n());return}o=function(n,i){var u,a;n=n[0];if(n.children){u={};for(a in n)n.hasOwnProperty(a)&&(u[a]=n[a]);u.children=[],e(n.children).each2(function(e,t){o(t,u.children)}),(u.children.length||t.matcher(r,s(u),n))&&i.push(u)}else t.matcher(r,s(n),n)&&i.push(n)},e(n().results).each2(function(e,t){o(t,i.results)}),t.callback(i)}}function k(n){var r=e.isFunction(n);return function(i){var s=i.term,o={results:[]};e(r?n():n).each(function(){var e=this.text!==t,n=e?this.text:this;(s===""||i.matcher(s,n))&&o.results.push(e?this:{id:this,text:this})}),i.callback(o)}}function L(t,n){if(e.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value")}function A(t){return e.isFunction(t)?t():t}function O(t){var n=0;return e.each(t,function(e,t){t.children?n+=O(t.children):n++}),n}function M(e,n,r,i){var s=e,o=!1,u,a,f,l,h;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return t;for(;;){a=-1;for(f=0,l=i.tokenSeparators.length;f<l;f++){h=i.tokenSeparators[f],a=e.indexOf(h);if(a>=0)break}if(a<0)break;u=e.substring(0,a),e=e.substring(a+h.length);if(u.length>0){u=i.createSearchChoice(u,n);if(u!==t&&u!==null&&i.id(u)!==t&&i.id(u)!==null){o=!1;for(f=0,l=n.length;f<l;f++)if(c(i.id(u),i.id(n[f]))){o=!0;break}o||r(u)}}}if(s!==e)return e}function _(t,n){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=e.extend(r.prototype,n),r}var n,r,i,s,o,u,a,f;n={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){e=e.which?e.which:e;switch(e){case n.LEFT:case n.RIGHT:case n.UP:case n.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case n.SHIFT:case n.CTRL:case n.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&e<=123}},f=e(document),o=function(){var e=1;return function(){return e++}}(),f.bind("mousemove",function(e){a={x:e.pageX,y:e.pageY}}),r=_(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(n){var r,i,s=".select2-results",u;this.opts=n=this.prepareOpts(n),this.id=n.id,n.element.data("select2")!==t&&n.element.data("select2")!==null&&this.destroy(),this.enabled=!0,this.container=this.createContainer(),this.containerId="s2id_"+(n.element.attr("id")||"autogen"+o()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=g(function(){return n.element.closest("body")}),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(A(n.containerCss)),this.container.addClass(A(n.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabIndex"),this.opts.element.data("select2",this).addClass("select2-offscreen").bind("focus.select2",function(){e(this).select2("focus")}).attr("tabIndex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(A(n.dropdownCssClass)),this.dropdown.data("select2",this),this.results=r=this.container.find(s),this.search=i=this.container.find("input.select2-input"),i.attr("tabIndex",this.elementTabIndex),this.resultsPage=0,this.context=null,this.initContainer(),v(this.results),this.dropdown.delegate(s,"mousemove-filtered touchstart touchmove touchend",this.bind(this.highlightUnderEvent)),y(80,this.results),this.dropdown.delegate(s,"scroll-debounced",this.bind(this.loadMoreIfNeeded)),e.fn.mousewheel&&r.mousewheel(function(e,t,n,i){var s=r.scrollTop(),o;i>0&&s-i<=0?(r.scrollTop(0),w(e)):i<0&&r.get(0).scrollHeight-r.scrollTop()+i<=r.height()&&(r.scrollTop(r.get(0).scrollHeight-r.height()),w(e))}),d(i),i.bind("keyup-change input paste",this.bind(this.updateResults)),i.bind("focus",function(){i.addClass("select2-focused")}),i.bind("blur",function(){i.removeClass("select2-focused")}),this.dropdown.delegate(s,"mouseup",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.bind("click mouseup mousedown",function(e){e.stopPropagation()}),e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),(n.element.is(":disabled")||n.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var e=this.opts.element.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),e!==t&&(e.container.remove(),e.dropdown.remove(),e.opts.element.removeClass("select2-offscreen").removeData("select2").unbind(".select2").attr({tabIndex:this.elementTabIndex}).show())},prepareOpts:function(n){var r,i,s,o;r=n.element,r.get(0).tagName.toLowerCase()==="select"&&(this.select=i=n.element),i&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),n=e.extend({},{populateResults:function(r,i,s){var o,u,a,f,l=this.opts.id,c=this;o=function(r,i,u){var a,f,h,p,d,v,m,g,y,b;r=n.sortResults(r,i,s);for(a=0,f=r.length;a<f;a+=1)h=r[a],d=h.disabled===!0,p=!d&&l(h)!==t,v=h.children&&h.children.length>0,m=e("<li></li>"),m.addClass("select2-results-dept-"+u),m.addClass("select2-result"),m.addClass(p?"select2-result-selectable":"select2-result-unselectable"),d&&m.addClass("select2-disabled"),v&&m.addClass("select2-result-with-children"),m.addClass(c.opts.formatResultCssClass(h)),g=e(document.createElement("div")),g.addClass("select2-result-label"),b=n.formatResult(h,g,s,c.opts.escapeMarkup),b!==t&&g.html(b),m.append(g),v&&(y=e("<ul></ul>"),y.addClass("select2-result-sub"),o(h.children,y,u+1),m.append(y)),m.data("select2-data",h),i.append(m)},o(i,r,0)}},e.fn.select2.defaults,n),typeof n.id!="function"&&(s=n.id,n.id=function(e){return e[s]});if(e.isArray(n.element.data("select2Tags"))){if("tags"in n)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id");n.tags=n.element.attr("data-select2-tags")}i?(n.query=this.bind(function(n){var i={results:[],more:!1},s=n.term,o,u,a;a=function(e,t){var r;e.is("option")?n.matcher(s,e.text(),e)&&t.push({id:e.attr("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:c(e.attr("disabled"),"disabled")}):e.is("optgroup")&&(r={text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")},e.children().each2(function(e,t){a(t,r.children)}),r.children.length>0&&t.push(r))},o=r.children(),this.getPlaceholder()!==t&&o.length>0&&(u=o[0],e(u).text()===""&&(o=o.not(u))),o.each2(function(e,t){a(t,i.results)}),n.callback(i)}),n.id=function(e){return e.id},n.formatResultCssClass=function(e){return e.css}):"query"in n||("ajax"in n?(o=n.element.data("ajax-url"),o&&o.length>0&&(n.ajax.url=o),n.query=N.call(n.element,n.ajax)):"data"in n?n.query=C(n.data):"tags"in n&&(n.query=k(n.tags),n.createSearchChoice===t&&(n.createSearchChoice=function(e){return{id:e,text:e}}),n.initSelection===t&&(n.initSelection=function(t,r){var i=[];e(h(t.val(),n.separator)).each(function(){var t=this,r=this,s=n.tags;e.isFunction(s)&&(s=s()),e(s).each(function(){if(c(this.id,t))return r=this.text,!1}),i.push({id:t,text:r})}),r(i)})));if(typeof n.query!="function")throw"query function not defined for Select2 "+n.element.attr("id");return n},monitorSource:function(){var e=this.opts.element,t;e.bind("change.select2",this.bind(function(e){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),t=this.bind(function(){var e,t,n=this;e=this.opts.element.attr("disabled")!=="disabled",t=this.opts.element.attr("readonly")==="readonly",e=e&&!t,this.enabled!==e&&(e?this.enable():this.disable()),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(A(this.opts.containerCssClass)),x(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(A(this.opts.dropdownCssClass))}),e.bind("propertychange.select2 DOMAttrModified.select2",t),typeof WebKitMutationObserver!="undefined"&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(function(e){e.forEach(t)}),this.propertyObserver.observe(e.get(0),{attributes:!0,subtree:!1}))},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){if(this.enabled)return;this.enabled=!0,this.container.removeClass("select2-container-disabled"),this.opts.element.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"),this.opts.element.attr("disabled","disabled")},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t=this.container.offset(),n=this.container.outerHeight(!1),r=this.container.outerWidth(!1),i=this.dropdown.outerHeight(!1),s=e(window).scrollLeft()+e(window).width(),o=e(window).scrollTop()+e(window).height(),u=t.top+n,a=t.left,f=u+i<=o,l=t.top-i>=this.body().scrollTop(),c=this.dropdown.outerWidth(!1),h=a+c<=s,p=this.dropdown.hasClass("select2-drop-above"),d,v,m;this.body().css("position")!=="static"&&(d=this.body().offset(),u-=d.top,a-=d.left),p?(v=!0,!l&&f&&(v=!1)):(v=!1,!f&&l&&(v=!0)),h||(a=t.left+r-c),v?(u=t.top-i,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")),m=e.extend({top:u,left:a,width:r},A(this.opts.dropdownCss)),this.dropdown.css(m)},shouldOpen:function(){var t;return this.opened()?!1:(t=e.Event("opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(window.setTimeout(this.bind(this.opening),1),!0):!1},opening:function(){var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t,s;this.clearDropdownAlignmentPreference(),this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),this.updateResults(!0),s=e("#select2-drop-mask"),s.length==0&&(s=e(document.createElement("div")),s.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),s.hide(),s.appendTo(this.body()),s.bind("mousedown touchstart",function(t){var n=e("#select2-drop"),r;n.length>0&&(r=n.data("select2"),r.opts.selectOnBlur&&r.selectHighlighted({noFocus:!0}),r.close())})),this.dropdown.prev()[0]!==s[0]&&this.dropdown.before(s),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),s.css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),s.show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this.ensureHighlightVisible();var o=this;this.container.parents().add(window).each(function(){e(this).bind(r+" "+n+" "+i,function(t){e("#select2-drop-mask").css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),o.positionDropdown()})}),this.focusSearch()},close:function(){if(!this.opened())return;var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).unbind(n).unbind(r).unbind(i)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.opts.element.trigger(e.Event("close"))},clearSearch:function(){},getMaximumSelectionSize:function(){return A(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t=this.results,n,r,i,s,o,u,a;r=this.highlight();if(r<0)return;if(r==0){t.scrollTop(0);return}n=this.findHighlightableChoices(),i=e(n[r]),s=i.offset().top+i.outerHeight(!0),r===n.length-1&&(a=t.find("li.select2-more-results"),a.length>0&&(s=a.offset().top+a.outerHeight(!0))),o=t.offset().top+t.outerHeight(!0),s>o&&t.scrollTop(t.scrollTop()+(s-o)),u=i.offset().top-t.offset().top,u<0&&i.css("display")!="none"&&t.scrollTop(t.scrollTop()+u)},findHighlightableChoices:function(){var e=this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)");return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){var n=this.findHighlightableChoices(),r=this.highlight();while(r>-1&&r<n.length){r+=t;var i=e(n[r]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(r);break}}},highlight:function(t){var n=this.findHighlightableChoices(),r,i;if(arguments.length===0)return l(n.filter(".select2-highlighted")[0],n.get());t>=n.length&&(t=n.length-1),t<0&&(t=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),r=e(n[t]),r.addClass("select2-highlighted"),this.ensureHighlightVisible(),i=r.data("select2-data"),i&&this.opts.element.trigger({type:"highlight",val:this.id(i),choice:i})},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var n=e(t.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var r=this.findHighlightableChoices();this.highlight(r.index(n))}else n.length==0&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),n,r=-1,i=this.resultsPage+1,s=this,o=this.search.val(),u=this.context;if(t.length===0)return;n=t.offset().top-e.offset().top-e.height(),n<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:o,page:i,context:u,matcher:this.opts.matcher,callback:this.bind(function(n){if(!s.opened())return;s.opts.populateResults.call(this,e,n.results,{term:o,page:i,context:u}),n.more===!0?(t.detach().appendTo(e).text(s.opts.formatLoadMore(i+1)),window.setTimeout(function(){s.loadMoreIfNeeded()},10)):t.remove(),s.positionDropdown(),s.resultsPage=i,s.context=n.context})}))},tokenize:function(){},updateResults:function(n){function f(){i.scrollTop(0),r.removeClass("select2-active"),u.positionDropdown()}function l(e){i.html(e),f()}var r=this.search,i=this.results,s=this.opts,o,u=this,a;if(n!==!0&&(this.showSearchInput===!1||!this.opened()))return;r.addClass("select2-active");var h=this.getMaximumSelectionSize();if(h>=1){o=this.data();if(e.isArray(o)&&o.length>=h&&L(s.formatSelectionTooBig,"formatSelectionTooBig")){l("<li class='select2-selection-limit'>"+s.formatSelectionTooBig(h)+"</li>");return}}if(r.val().length<s.minimumInputLength){L(s.formatInputTooShort,"formatInputTooShort")?l("<li class='select2-no-results'>"+s.formatInputTooShort(r.val(),s.minimumInputLength)+"</li>"):l("");return}s.formatSearching()&&n===!0&&l("<li class='select2-searching'>"+s.formatSearching()+"</li>");if(s.maximumInputLength&&r.val().length>s.maximumInputLength){L(s.formatInputTooLong,"formatInputTooLong")?l("<li class='select2-no-results'>"+s.formatInputTooLong(r.val(),s.maximumInputLength)+"</li>"):l("");return}a=this.tokenize(),a!=t&&a!=null&&r.val(a),this.resultsPage=1,s.query({element:s.element,term:r.val(),page:this.resultsPage,context:null,matcher:s.matcher,callback:this.bind(function(o){var a;if(!this.opened())return;this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&r.val()!==""&&(a=this.opts.createSearchChoice.call(null,r.val(),o.results),a!==t&&a!==null&&u.id(a)!==t&&u.id(a)!==null&&e(o.results).filter(function(){return c(u.id(this),u.id(a))}).length===0&&o.results.unshift(a));if(o.results.length===0&&L(s.formatNoMatches,"formatNoMatches")){l("<li class='select2-no-results'>"+s.formatNoMatches(r.val())+"</li>");return}i.empty(),u.opts.populateResults.call(this,i,o.results,{term:r.val(),page:this.resultsPage,context:null}),o.more===!0&&L(s.formatLoadMore,"formatLoadMore")&&(i.append("<li class='select2-more-results'>"+u.opts.escapeMarkup(s.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){u.loadMoreIfNeeded()},10)),this.postprocessResults(o,n),f()})})},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){b(this.search)},selectHighlighted:function(e){var t=this.highlight(),n=this.results.find(".select2-highlighted"),r=n.closest(".select2-result").data("select2-data");r&&(this.highlight(t),this.onSelect(r,e))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){function n(){var n,r,i,s,o;if(this.opts.width==="off")return null;if(this.opts.width==="element")return this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px";if(this.opts.width==="copy"||this.opts.width==="resolve"){n=this.opts.element.attr("style");if(n!==t){r=n.split(";");for(s=0,o=r.length;s<o;s+=1){i=r[s].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);if(i!==null&&i.length>=1)return i[1]}}return this.opts.width==="resolve"?(n=this.opts.element.css("width"),n.indexOf("%")>0?n:this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var r=n.call(this);r!==null&&this.container.css("width",r)}}),i=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>"," <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>"," <div><b></b></div>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop' style='display:none'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.focusser.attr("disabled","disabled")},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.focusser.removeAttr("disabled")},opening:function(){this.parent.opening.apply(this,arguments),this.focusser.attr("disabled","disabled"),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),b(this.focusser)},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var e,t=this.container,r=this.dropdown,i=!1;this.showSearch(this.opts.minimumResultsForSearch>=0),this.selection=e=t.find(".select2-choice"),this.focusser=t.find(".select2-focusser"),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN){w(e);return}switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.TAB:case n.ENTER:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}})),this.focusser.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.ESC)return;if(this.opts.openOnEnter===!1&&e.which===n.ENTER){w(e);return}if(e.which==n.DOWN||e.which==n.UP||e.which==n.ENTER&&this.opts.openOnEnter){this.open(),w(e);return}if(e.which==n.DELETE||e.which==n.BACKSPACE){this.opts.allowClear&&this.clear(),w(e);return}})),d(this.focusser),this.focusser.bind("keyup-change input",this.bind(function(e){if(this.opened())return;this.open(),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.focusser.val(""),w(e)})),e.delegate("abbr","mousedown",this.bind(function(e){if(!this.enabled)return;this.clear(),E(e),this.close(),this.selection.focus()})),e.bind("mousedown",this.bind(function(e){i=!0,this.opened()?this.close():this.enabled&&this.open(),w(e),i=!1})),r.bind("mousedown",this.bind(function(){this.search.focus()})),e.bind("focus",this.bind(function(e){w(e)})),this.focusser.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})).bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active")})),this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.setPlaceholder()},clear:function(){var e=this.selection.data("select2-data");this.opts.element.val(""),this.selection.find("span").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),this.opts.element.trigger({type:"removed",val:this.id(e),choice:e}),this.triggerChange({removed:e})},initSelection:function(){var e;if(this.opts.element.val()===""&&this.opts.element.text()==="")this.close(),this.setPlaceholder();else{var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.setPlaceholder())})}},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(t,n){var r=t.find(":selected");e.isFunction(n)&&n({id:r.attr("value"),text:r.text(),element:r})}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=n.val();t.query({matcher:function(e,n,r){return c(i,t.id(r))},callback:e.isFunction(r)?function(e){r(e.results.length?e.results[0]:null)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.select.find("option").first().text()!==""?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.opts.element.val()===""&&e!==t){if(this.select&&this.select.find("option:first").text()!=="")return;this.selection.find("span").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide()}},postprocessResults:function(e,t){var n=0,r=this,i=!0;this.findHighlightableChoices().each2(function(e,t){if(c(r.id(t.data("select2-data")),r.opts.element.val()))return n=e,!1}),this.highlight(n);if(t===!0){var s=this.opts.minimumResultsForSearch;i=s<0?!1:O(e.results)>=s,this.showSearch(i)}},showSearch:function(t){this.showSearchInput=t,this.dropdown.find(".select2-search")[t?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[t?"addClass":"removeClass"]("select2-with-searchbox")},onSelect:function(e,t){var n=this.opts.element.val();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.close(),(!t||!t.noFocus)&&this.selection.focus(),c(n,this.id(e))||this.triggerChange()},updateSelection:function(e){var n=this.selection.find("span"),r;this.selection.data("select2-data",e),n.empty(),r=this.opts.formatSelection(e,n),r!==t&&n.append(this.opts.escapeMarkup(r)),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.selection.find("abbr").show()},val:function(){var e,n=!1,r=null,i=this;if(arguments.length===0)return this.opts.element.val();e=arguments[0],arguments.length>1&&(n=arguments[1]);if(this.select)this.select.val(e).find(":selected").each2(function(e,t){return r={id:t.attr("value"),text:t.text()},!1}),this.updateSelection(r),this.setPlaceholder(),n&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!e&&e!==0){this.clear(),n&&this.triggerChange();return}this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){i.opts.element.val(e?i.id(e):""),i.updateSelection(e),i.setPlaceholder(),n&&i.triggerChange()})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var n;if(arguments.length===0)return n=this.selection.data("select2-data"),n==t&&(n=null),n;!e||e===""?this.clear():(this.opts.element.val(e?this.id(e):""),this.updateSelection(e))}}),s=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html([" <ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi' style='display:none;'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(e,t){var n=[];e.find(":selected").each2(function(e,t){n.push({id:t.attr("value"),text:t.text(),element:t[0]})}),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=h(n.val(),t.separator);t.query({matcher:function(n,r,s){return e.grep(i,function(e){return c(e,t.id(s))}).length},callback:e.isFunction(r)?function(e){r(e.results)}:e.noop})}),t},initContainer:function(){var t=".select2-choices",r;this.searchContainer=this.container.find(".select2-search-field"),this.selection=r=this.container.find(t),this.search.bind("input paste",this.bind(function(){if(!this.enabled)return;this.opened()||this.open()})),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.BACKSPACE&&this.search.val()===""){this.close();var t,i=r.find(".select2-search-choice-focus");if(i.length>0){this.unselect(i.first()),this.search.width(10),w(e);return}t=r.find(".select2-search-choice:not(.select2-locked)"),t.length>0&&t.last().addClass("select2-search-choice-focus")}else r.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.ENTER:case n.TAB:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.BACKSPACE||e.which===n.ESC)return;if(e.which===n.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN)&&w(e)})),this.search.bind("keyup",this.bind(this.resizeSearch)),this.search.bind("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.opened()||this.clearSearch(),e.stopImmediatePropagation()})),this.container.delegate(t,"mousedown",this.bind(function(t){if(!this.enabled)return;if(e(t.target).closest(".select2-search-choice").length>0)return;this.clearPlaceholder(),this.open(),this.focusSearch(),t.preventDefault()})),this.container.delegate(t,"focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder()})),this.initContainerWidth(),this.clearSearch()},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.search.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0)},initSelection:function(){var e;this.opts.element.val()===""&&this.opts.element.text()===""&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||this.opts.element.val()!==""){var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder();e!==t&&this.getVal().length===0&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.resizeSearch()):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.parent.opening.apply(this,arguments),this.clearPlaceholder(),this.resizeSearch(),this.focusSearch(),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus(),this.opts.element.triggerHandler("focus")},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var n=[],r=[],i=this;e(t).each(function(){l(i.id(this),n)<0&&(n.push(i.id(this)),r.push(this))}),t=r,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){i.addSelectedChoice(this)}),i.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer(e,this.data(),this.bind(this.onSelect),this.opts),e!=null&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),(!t||!t.noFocus)&&this.focusSearch()},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(n){var r=!n.locked,i=e("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=e("<li class='select2-search-choice select2-locked'><div></div></li>"),o=r?i:s,u=this.id(n),a=this.getVal(),f;f=this.opts.formatSelection(n,o.find("div")),f!=t&&o.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"</div>"),r&&o.find(".select2-search-choice-close").bind("mousedown",w).bind("click dblclick",this.bind(function(t){if(!this.enabled)return;e(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),w(t)})).bind("focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active")})),o.data("select2-data",n),o.insertBefore(this.searchContainer),a.push(u),this.setVal(a)},unselect:function(e){var t=this.getVal(),n,r;e=e.closest(".select2-search-choice");if(e.length===0)throw"Invalid argument: "+e+". Must be .select2-search-choice";n=e.data("select2-data");if(!n)return;r=l(this.id(n).toString(),t),r>=0&&(t.splice(r,1),this.setVal(t),this.select&&this.postprocessResults()),e.remove(),this.opts.element.trigger({type:"removed",val:this.id(n),choice:n}),this.triggerChange({removed:n})},postprocessResults:function(){var e=this.getVal(),t=this.results.find(".select2-result"),n=this.results.find(".select2-result-with-children"),r=this;t.each2(function(t,n){var i=r.id(n.data("select2-data"));l(i,e)>=0&&(n.addClass("select2-selected"),n.find(".select2-result-selectable").addClass("select2-selected"))}),n.each2(function(e,t){!t.is(".select2-result-selectable")&&t.find(".select2-result-selectable:not(.select2-selected)").length===0&&t.addClass("select2-selected")}),this.highlight()==-1&&r.highlight(0)},resizeSearch:function(){var e,t,n,r,i,s=p(this.search);e=S(this.search)+10,t=this.search.offset().left,n=this.selection.width(),r=this.selection.offset().left,i=n-(t-r)-s,i<e&&(i=n-s),i<40&&(i=n-s),i<=0&&(i=e),this.search.width(i)},getVal:function(){var e;return this.select?(e=this.select.val(),e===null?[]:e):(e=this.opts.element.val(),h(e,this.opts.separator))},setVal:function(t){var n;this.select?this.select.val(t):(n=[],e(t).each(function(){l(this,n)<0&&n.push(this)}),this.opts.element.val(n.length===0?"":n.join(this.opts.separator)))},val:function(){var n,r=!1,i=[],s=this;if(arguments.length===0)return this.getVal();n=arguments[0],arguments.length>1&&(r=arguments[1]);if(!n&&n!==0){this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),r&&this.triggerChange();return}this.setVal(n);if(this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),r&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var n=e(t).map(s.id);s.setVal(n),s.updateSelection(t),s.clearSearch(),r&&s.triggerChange()})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],n=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(n.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t){var n=this,r;if(arguments.length===0)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();t||(t=[]),r=e.map(t,function(e){return n.opts.id(e)}),this.setVal(r),this.updateSelection(t),this.clearSearch()}}),e.fn.select2=function(){var n=Array.prototype.slice.call(arguments,0),r,o,u,a,f=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","disable","positionDropdown","data"];return this.each(function(){if(n.length===0||typeof n[0]=="object")r=n.length===0?{}:e.extend({},n[0]),r.element=e(this),r.element.get(0).tagName.toLowerCase()==="select"?a=r.element.attr("multiple"):(a=r.multiple||!1,"tags"in r&&(r.multiple=a=!0)),o=a?new s:new i,o.init(r);else{if(typeof n[0]!="string")throw"Invalid arguments to select2 plugin: "+n;if(l(n[0],f)<0)throw"Unknown method: "+n[0];u=t,o=e(this).data("select2");if(o===t)return;n[0]==="container"?u=o.container:u=o[n[0]].apply(o,n.slice(1));if(u!==t)return!1}}),u===t?this:u},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,n,r){var i=[];return T(e.text,n.term,i,r),i.join("")},formatSelection:function(e,n){return e?e.text:t},sortResults:function(e,t,n){return e},formatResultCssClass:function(e){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" more character"+(n==1?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please enter "+n+" less character"+(n==1?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(e==1?"":"s")},formatLoadMore:function(e){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e.id},matcher:function(e,t){return t.toUpperCase().indexOf(e.toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;","/":"&#47;"};return String(e).replace(/[&<>"'/\\]/g,function(e){return t[e[0]]})},blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null}}}(e)});
public/js/external_libs/twig.js CHANGED
@@ -6,13 +6,25 @@
6
  * @link https://github.com/justjohn/twig.js
7
  */
8
 
 
9
  // Copyright (c) 2011-2013 John Roepke
 
 
10
 
 
11
  // [MIT License](http://www.opensource.org/licenses/mit-license.php) or are
12
-
13
  // [Public Domain](https://developer.mozilla.org/Project:Copyrights).
 
 
 
14
 
 
 
 
 
15
  // Copies of the licenses for the code included here can be found in the
 
 
16
 
17
  /**
18
  * jPaq - A fully customizable JavaScript/JScript library
@@ -26,4 +38,10 @@
26
  * Revised: April 6, 2011
27
  */
28
 
 
 
 
 
 
 
29
  var Twig=function(e){return e.VERSION="0.7.2",e}(Twig||{}),Twig=function(e){function t(e,t){var n=Object.prototype.toString.call(t).slice(8,-1);return t!==undefined&&t!==null&&n===e}function n(t,n){var r,i,s="/",o=[],u;if(t.url)typeof t.base!="undefined"?r=t.base+(t.base.charAt(t.base.length-1)==="/"?"":"/"):r=t.url;else{if(!t.path)throw new e.Error("Cannot extend an inline template.");var a=require("path"),f=a.sep||s,l=new RegExp("^\\.{1,2}"+f.replace("\\","\\\\"));n=n.replace(/\//g,f),t.base!==undefined&&n.match(l)==null?(n=n.replace(t.base,""),r=t.base+f):r=t.path,r=r.replace(f+f,f),s=f}i=r.split(s),i.pop(),i=i.concat(n.split(s));while(i.length>0)u=i.shift(),u!="."&&(u==".."&&o.length>0&&o[o.length-1]!=".."?o.pop():o.push(u));return o.join(s)}return e.trace=!1,e.debug=!1,e.cache=!0,e.placeholders={parent:"{{|PARENT|}}"},e.indexOf=function(e,t){if(Array.prototype.hasOwnProperty("indexOf"))return e.indexOf(t);if(e===void 0||e===null)throw new TypeError;var n=Object(e),r=n.length>>>0;if(r===0)return-1;var i=0;arguments.length>0&&(i=Number(arguments[1]),i!==i?i=0:i!==0&&i!==Infinity&&i!==-Infinity&&(i=(i>0||-1)*Math.floor(Math.abs(i))));if(i>=r)return-1;var s=i>=0?i:Math.max(r-Math.abs(i),0);for(;s<r;s++)if(s in n&&n[s]===t)return s;return e==t?0:-1},e.forEach=function(e,t,n){if(Array.prototype.forEach)return e.forEach(t,n);var r,i;if(e==null)throw new TypeError(" this is null or not defined");var s=Object(e),o=s.length>>>0;if({}.toString.call(t)!="[object Function]")throw new TypeError(t+" is not a function");n&&(r=n),i=0;while(i<o){var u;i in s&&(u=s[i],t.call(r,u,i,s)),i++}},e.Error=function(e){this.message=e,this.name="TwigException",this.type="TwigException"},e.Error.prototype.toString=function(){var e=this.name+": "+this.message;return e},e.log={trace:function(){e.trace&&console&&console.log(Array.prototype.slice.call(arguments))},debug:function(){e.debug&&console&&console.log(Array.prototype.slice.call(arguments))}},typeof console!="undefined"&&typeof console.log!="undefined"?e.log.error=function(){console.log.apply(console,arguments)}:e.log.error=function(){},e.token={},e.token.type={output:"output",logic:"logic",comment:"comment",raw:"raw"},e.token.definitions=[{type:e.token.type.raw,open:"{% raw %}",close:"{% endraw %}"},{type:e.token.type.output,open:"{{",close:"}}"},{type:e.token.type.logic,open:"{%",close:"%}"},{type:e.token.type.comment,open:"{#",close:"#}"}],e.token.strings=['"',"'"],e.token.findStart=function(t){var n={position:null,def:null},r,i,s;for(r=0;r<e.token.definitions.length;r++)i=e.token.definitions[r],s=t.indexOf(i.open),e.log.trace("Twig.token.findStart: ","Searching for ",i.open," found at ",s),s>=0&&(n.position===null||s<n.position)&&(n.position=s,n.def=i);return n},e.token.findEnd=function(t,n,r){var i=null,s=!1,o=0,u=null,a=null,f=null,l=null,c=null,h=null,p,d;while(!s){u=null,a=null,f=t.indexOf(n.close,o);if(!(f>=0))throw new e.Error("Unable to find closing bracket '"+n.close+"'"+" opened near template position "+r);i=f,s=!0;if(n.type===e.token.type.comment)break;d=e.token.strings.length;for(p=0;p<d;p+=1)c=t.indexOf(e.token.strings[p],o),c>0&&c<f&&(u===null||c<u)&&(u=c,a=e.token.strings[p]);if(u!==null){l=u+1,i=null,s=!1;for(;;){h=t.indexOf(a,l);if(h<0)throw"Unclosed string in template";if(t.substr(h-1,1)!=="\\"){o=h+1;break}l=h+1}}}return i},e.tokenize=function(t){var n=[],r=0,i=null,s=null;while(t.length>0)i=e.token.findStart(t),e.log.trace("Twig.tokenize: ","Found token: ",i),i.position!==null?(i.position>0&&n.push({type:e.token.type.raw,value:t.substring(0,i.position)}),t=t.substr(i.position+i.def.open.length),r+=i.position+i.def.open.length,s=e.token.findEnd(t,i.def,r),e.log.trace("Twig.tokenize: ","Token ends at ",s),n.push({type:i.def.type,value:t.substring(0,s).trim()}),i.def.type==="logic"&&t.substr(s+i.def.close.length,1)==="\n"&&(s+=1),t=t.substr(s+i.def.close.length),r+=s+i.def.close.length):(n.push({type:e.token.type.raw,value:t}),t="");return n},e.compile=function(t){try{var n=[],r=[],i=[],s=null,o=null,u=null,a=null,f=null,l=null,c=null,h=null,p=null;while(t.length>0){s=t.shift(),e.log.trace("Compiling token ",s);switch(s.type){case e.token.type.raw:r.length>0?i.push(s):n.push(s);break;case e.token.type.logic:o=e.logic.compile.apply(this,[s]),c=o.type,h=e.logic.handler[c].open,p=e.logic.handler[c].next,e.log.trace("Twig.compile: ","Compiled logic token to ",o," next is: ",p," open is : ",h);if(h!==undefined&&!h){a=r.pop(),f=e.logic.handler[a.type];if(e.indexOf(f.next,c)<0)throw new Error(c+" not expected after a "+a.type);a.output=a.output||[],a.output=a.output.concat(i),i=[],l={type:e.token.type.logic,token:a},r.length>0?i.push(l):n.push(l)}p!==undefined&&p.length>0?(e.log.trace("Twig.compile: ","Pushing ",o," to logic stack."),r.length>0&&(a=r.pop(),a.output=a.output||[],a.output=a.output.concat(i),r.push(a),i=[]),r.push(o)):h!==undefined&&h&&(l={type:e.token.type.logic,token:o},r.length>0?i.push(l):n.push(l));break;case e.token.type.comment:break;case e.token.type.output:e.expression.compile.apply(this,[s]),r.length>0?i.push(s):n.push(s)}e.log.trace("Twig.compile: "," Output: ",n," Logic Stack: ",r," Pending Output: ",i)}if(r.length>0)throw u=r.pop(),new Error("Unable to find an end tag for "+u.type+", expecting one of "+u.next);return n}catch(d){e.log.error("Error compiling twig template "+this.id+": "),d.stack?e.log.error(d.stack):e.log.error(d.toString());if(this.options.rethrow)throw d}},e.parse=function(t,n){try{var r=[],i=!0,s=this;return n=n||{},e.forEach(t,function(o){e.log.debug("Twig.parse: ","Parsing token: ",o);switch(o.type){case e.token.type.raw:r.push(o.value);break;case e.token.type.logic:var u=o.token,a=e.logic.parse.apply(s,[u,n,i]);a.chain!==undefined&&(i=a.chain),a.context!==undefined&&(n=a.context),a.output!==undefined&&r.push(a.output);break;case e.token.type.comment:break;case e.token.type.output:e.log.debug("Twig.parse: ","Output token: ",o.stack),r.push(e.expression.parse.apply(s,[o.stack,n]))}}),r.join("")}catch(o){e.log.error("Error parsing twig template "+this.id+": "),o.stack?e.log.error(o.stack):e.log.error(o.toString());if(this.options.rethrow)throw o;if(e.debug)return o.toString()}},e.prepare=function(t){var n,r;return e.log.debug("Twig.prepare: ","Tokenizing ",t),r=e.tokenize.apply(this,[t]),e.log.debug("Twig.prepare: ","Compiling ",r),n=e.compile.apply(this,[r]),e.log.debug("Twig.prepare: ","Compiled ",n),n},e.Templates={registry:{}},e.validateId=function(t){if(t==="prototype")throw new e.Error(t+" is not a valid twig identifier");if(e.Templates.registry.hasOwnProperty(t))throw new e.Error("There is already a template with the ID "+t);return!0},e.Templates.save=function(t){if(t.id===undefined)throw new e.Error("Unable to save template with no id");e.Templates.registry[t.id]=t},e.Templates.load=function(t){return e.Templates.registry.hasOwnProperty(t)?e.Templates.registry[t]:null},e.Templates.loadRemote=function(t,n,r,i){var s=n.id,o=n.method,u=n.async,a=n.precompiled,f=null;u===undefined&&(u=!0),s===undefined&&(s=t),n.id=s;if(e.cache&&e.Templates.registry.hasOwnProperty(s))return r&&r(e.Templates.registry[s]),e.Templates.registry[s];if(o=="ajax"){if(typeof XMLHttpRequest=="undefined")throw new e.Error("Unsupported platform: Unable to do remote requests because there is no XMLHTTPRequest implementation");var l=new XMLHttpRequest;l.onreadystatechange=function(){var s=null;l.readyState==4&&(l.status==200?(e.log.debug("Got template ",l.responseText),a===!0?s=JSON.parse(l.responseText):s=l.responseText,n.url=t,n.data=s,f=new e.Template(n),r&&r(f)):i&&i(l))},l.open("GET",t,u),l.send()}else(function(){var s=require("fs"),o=require("path"),l=null,c=function(s,o){if(s){i&&i(s);return}a===!0&&(o=JSON.parse(o)),n.data=o,n.path=t,f=new e.Template(n),r&&r(f)};if(u===!0)s.stat(t,function(n,r){if(n||!r.isFile())throw new e.Error("Unable to find template file "+t);s.readFile(t,"utf8",c)});else{if(!s.statSync(t).isFile())throw new e.Error("Unable to find template file "+t);l=s.readFileSync(t,"utf8"),c(undefined,l)}})();return u===!1?f:!0},e.Template=function(n){var r=n.data,i=n.id,s=n.blocks,o=n.macros||{},u=n.base,a=n.path,f=n.url,l=n.options;this.id=i,this.base=u,this.path=a,this.url=f,this.macros=o,this.options=l,this.reset(s),t("String",r)?this.tokens=e.prepare.apply(this,[r]):this.tokens=r,i!==undefined&&e.Templates.save(this)},e.Template.prototype.reset=function(t){e.log.debug("Twig.Template.reset","Reseting template "+this.id),this.blocks={},this.child={blocks:t||{}},this.extend=null},e.Template.prototype.render=function(t,r){r=r||{};var i,s;this.context=t||{},this.reset(),r.blocks&&(this.blocks=r.blocks),r.macros&&(this.macros=r.macros),i=e.parse.apply(this,[this.tokens,this.context]);if(this.extend){var o;return this.options.allowInlineIncludes&&(o=e.Templates.load(this.extend),o&&(o.options=this.options)),o||(s=n(this,this.extend),o=e.Templates.loadRemote(s,{method:this.url?"ajax":"fs",base:this.base,async:!1,id:s,options:this.options})),this.parent=o,this.parent.render(this.context,{blocks:this.blocks})}return r.output=="blocks"?this.blocks:r.output=="macros"?this.macros:i},e.Template.prototype.importFile=function(t){var r,i;if(!this.url&&!this.path&&this.options.allowInlineIncludes){i=e.Templates.load(t),i.options=this.options;if(i)return i;throw new e.Error("Didn't find the inline template by id")}return r=n(this,t),i=e.Templates.loadRemote(r,{method:this.url?"ajax":"fs",base:this.base,async:!1,options:this.options,id:r}),i},e.Template.prototype.importBlocks=function(t,n){var r=this.importFile(t),i=this.context,s=this,o;n=n||!1,r.render(i),e.forEach(Object.keys(r.blocks),function(e){if(n||s.blocks[e]===undefined)s.blocks[e]=r.blocks[e]})},e.Template.prototype.importMacros=function(t){var r=n(this,t),i=e.Templates.loadRemote(r,{method:this.url?"ajax":"fs",async:!1,id:r});return i},e.Template.prototype.compile=function(t){return e.compiler.compile(this,t)},e}(Twig||{});(function(){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on non-object");var t=[],n;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t})})();var Twig=function(e){e.lib={};var t=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function n(e,t){for(var n=[];t>0;n[--t]=e);return n.join("")}var r=function(){return r.cache.hasOwnProperty(arguments[0])||(r.cache[arguments[0]]=r.parse(arguments[0])),r.format.call(null,r.cache[arguments[0]],arguments)};return r.format=function(r,i){var s=1,o=r.length,u="",a,f=[],l,c,h,p,d,v;for(l=0;l<o;l++){u=e(r[l]);if(u==="string")f.push(r[l]);else if(u==="array"){h=r[l];if(h[2]){a=i[s];for(c=0;c<h[2].length;c++){if(!a.hasOwnProperty(h[2][c]))throw t('[sprintf] property "%s" does not exist',h[2][c]);a=a[h[2][c]]}}else h[1]?a=i[h[1]]:a=i[s++];if(/[^s]/.test(h[8])&&e(a)!="number")throw t("[sprintf] expecting number but found %s",e(a));switch(h[8]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":a=parseInt(a,10);break;case"e":a=h[7]?a.toExponential(h[7]):a.toExponential();break;case"f":a=h[7]?parseFloat(a).toFixed(h[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&h[7]?a.substring(0,h[7]):a;break;case"u":a=Math.abs(a);break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}a=/[def]/.test(h[8])&&h[3]&&a>=0?"+"+a:a,d=h[4]?h[4]=="0"?"0":h[4].charAt(1):" ",v=h[6]-String(a).length,p=h[6]?n(d,v):"",f.push(h[5]?a+p:p+a)}}return f.join("")},r.cache={},r.parse=function(e){var t=e,n=[],r=[],i=0;while(t){if((n=/^[^\x25]+/.exec(t))!==null)r.push(n[0]);else if((n=/^\x25{2}/.exec(t))!==null)r.push("%");else{if((n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t))===null)throw"[sprintf] huh?";if(n[2]){i|=1;var s=[],o=n[2],u=[];if((u=/^([a-z_][a-z_\d]*)/i.exec(o))===null)throw"[sprintf] huh?";s.push(u[1]);while((o=o.substring(u[0].length))!=="")if((u=/^\.([a-z_][a-z_\d]*)/i.exec(o))!==null)s.push(u[1]);else{if((u=/^\[(\d+)\]/.exec(o))===null)throw"[sprintf] huh?";s.push(u[1])}n[2]=s}else i|=2;if(i===3)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";r.push(n)}t=t.substring(n[0].length)}return r},r}(),n=function(e,n){return n.unshift(e),t.apply(null,n)};return e.lib.sprintf=t,e.lib.vsprintf=n,function(){function s(e){return(e=Math.abs(e)%100)%10==1&&e!=11?"st":e%10==2&&e!=12?"nd":e%10==3&&e!=13?"rd":"th"}function o(e){var t=new Date(e.getFullYear()+1,0,4);return(t-e)/864e5<7&&(e.getDay()+6)%7<(t.getDay()+6)%7?t.getFullYear():e.getMonth()>0||e.getDate()>=4?e.getFullYear():e.getFullYear()-((e.getDay()+6)%7-e.getDate()>2?1:0)}function u(e){var t=new Date(o(e),0,4);return t.setDate(t.getDate()-(t.getDay()+6)%7),parseInt((e-t)/6048e5)+1}var t="Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),n="Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),r="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),i="January,February,March,April,May,June,July,August,September,October,November,December".split(",");e.lib.formatDate=function(e,a){if(typeof a!="string"||/^\s*$/.test(a))return e+"";var f=new Date(e.getFullYear(),0,1),l=e;return a.replace(/[dDjlNSwzWFmMntLoYyaABgGhHisuU]/g,function(e){switch(e){case"d":return("0"+l.getDate()).replace(/^.+(..)$/,"$1");case"D":return t[l.getDay()];case"j":return l.getDate();case"l":return n[l.getDay()];case"N":return(l.getDay()+6)%7+1;case"S":return s(l.getDate());case"w":return l.getDay();case"z":return Math.ceil((f-l)/864e5);case"W":return("0"+u(l)).replace(/^.(..)$/,"$1");case"F":return i[l.getMonth()];case"m":return("0"+(l.getMonth()+1)).replace(/^.+(..)$/,"$1");case"M":return r[l.getMonth()];case"n":return l.getMonth()+1;case"t":return(new Date(l.getFullYear(),l.getMonth()+1,-1)).getDate();case"L":return(new Date(l.getFullYear(),1,29)).getDate()==29?1:0;case"o":return o(l);case"Y":return l.getFullYear();case"y":return(l.getFullYear()+"").replace(/^.+(..)$/,"$1");case"a":return l.getHours()<12?"am":"pm";case"A":return l.getHours()<12?"AM":"PM";case"B":return Math.floor(((l.getUTCHours()+1)%24+l.getUTCMinutes()/60+l.getUTCSeconds()/3600)*1e3/24);case"g":return l.getHours()%12!=0?l.getHours()%12:12;case"G":return l.getHours();case"h":return("0"+(l.getHours()%12!=0?l.getHours()%12:12)).replace(/^.+(..)$/,"$1");case"H":return("0"+l.getHours()).replace(/^.+(..)$/,"$1");case"i":return("0"+l.getMinutes()).replace(/^.+(..)$/,"$1");case"s":return("0"+l.getSeconds()).replace(/^.+(..)$/,"$1");case"u":return l.getMilliseconds();case"U":return l.getTime()/1e3}})}}(),e.lib.strip_tags=function(e,t){t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var n=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,r=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;return e.replace(r,"").replace(n,function(e,n){return t.indexOf("<"+n.toLowerCase()+">")>-1?e:""})},e.lib.parseISO8601Date=function(e){var t=/(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(\.\d+)?(Z|([+-])(\d\d):(\d\d))/,n=[];n=e.match(t);if(!n)throw"Couldn't parse ISO 8601 date string '"+e+"'";var r=[1,2,3,4,5,6,10,11];for(var i in r)n[r[i]]=parseInt(n[r[i]],10);n[7]=parseFloat(n[7]);var s=Date.UTC(n[1],n[2]-1,n[3],n[4],n[5],n[6]);n[7]>0&&(s+=Math.round(n[7]*1e3));if(n[8]!="Z"&&n[10]){var o=n[10]*60*60*1e3;n[11]&&(o+=n[11]*60*1e3),n[9]=="-"?s-=o:s+=o}return new Date(s)},e.lib.strtotime=function(t,n){var r,i,s,o,u="";t=t.replace(/\s{2,}|^\s|\s$/g," "),t=t.replace(/[\t\r\n]/g,"");if(t==="now")return n===null||isNaN(n)?(new Date).getTime()/1e3|0:n|0;if(!isNaN(u=Date.parse(t)))return u/1e3|0;n?n=new Date(n*1e3):n=new Date;var a=t;t=t.toLowerCase();var f={day:{sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},mon:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"]},l=function(e){var t=e[2]&&e[2]==="ago",r=(r=e[0]==="last"?-1:1)*(t?-1:1);switch(e[0]){case"last":case"next":switch(e[1].substring(0,3)){case"yea":n.setFullYear(n.getFullYear()+r);break;case"wee":n.setDate(n.getDate()+r*7);break;case"day":n.setDate(n.getDate()+r);break;case"hou":n.setHours(n.getHours()+r);break;case"min":n.setMinutes(n.getMinutes()+r);break;case"sec":n.setSeconds(n.getSeconds()+r);break;case"mon":if(e[1]==="month"){n.setMonth(n.getMonth()+r);break};default:var i=f.day[e[1].substring(0,3)];if(typeof i!="undefined"){var s=i-n.getDay();s===0?s=7*r:s>0?e[0]==="last"&&(s-=7):e[0]==="next"&&(s+=7),n.setDate(n.getDate()+s),n.setHours(0,0,0,0)}}break;default:if(!/\d+/.test(e[0]))return!1;r*=parseInt(e[0],10);switch(e[1].substring(0,3)){case"yea":n.setFullYear(n.getFullYear()+r);break;case"mon":n.setMonth(n.getMonth()+r);break;case"wee":n.setDate(n.getDate()+r*7);break;case"day":n.setDate(n.getDate()+r);break;case"hou":n.setHours(n.getHours()+r);break;case"min":n.setMinutes(n.getMinutes()+r);break;case"sec":n.setSeconds(n.getSeconds()+r)}}return!0};s=t.match(/^(\d{2,4}-\d{2}-\d{2})(?:\s(\d{1,2}:\d{2}(:\d{2})?)?(?:\.(\d+))?)?$/);if(s!==null)return s[2]?s[3]||(s[2]+=":00"):s[2]="00:00:00",o=s[1].split(/-/g),o[1]=f.mon[o[1]-1]||o[1],o[0]=+o[0],o[0]=o[0]>=0&&o[0]<=69?"20"+(o[0]<10?"0"+o[0]:o[0]+""):o[0]>=70&&o[0]<=99?"19"+o[0]:o[0]+"",parseInt(this.strtotime(o[2]+" "+o[1]+" "+o[0]+" "+s[2])+(s[4]?s[4]/1e3:""),10);var c="([+-]?\\d+\\s(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday)|(last|next)\\s(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday))(\\sago)?";s=t.match(new RegExp(c,"gi"));if(s===null){try{num=e.lib.parseISO8601Date(a);if(num)return num/1e3|0}catch(h){return!1}return!1}for(r=0,i=s.length;r<i;r++)if(!l(s[r].split(" ")))return!1;return n.getTime()/1e3|0},e.lib.is=function(e,t){var n=Object.prototype.toString.call(t).slice(8,-1);return t!==undefined&&t!==null&&n===e},e.lib.copy=function(e){var t={},n;for(n in e)t[n]=e[n];return t},e.lib.replaceAll=function(e,t,n){return e.split(t).join(n)},e.lib.chunkArray=function(t,n){var r=[],i=0,s=t.length;if(n<1||!e.lib.is("Array",t))return[];while(i<s)r.push(t.slice(i,i+=n));return r},e.lib.round=function(t,n,r){var i,s,o,u;n|=0,i=Math.pow(10,n),t*=i,u=t>0|-(t<0),o=t%1===.5*u,s=Math.floor(t);if(o)switch(r){case"PHP_ROUND_HALF_DOWN":t=s+(u<0);break;case"PHP_ROUND_HALF_EVEN":t=s+s%2*u;break;case"PHP_ROUND_HALF_ODD":t=s+!(s%2);break;default:t=s+(u>0)}return(o?t:Math.round(t))/i},e}(Twig||{}),Twig=function(e){e.logic={},e.logic.type={if_:"Twig.logic.type.if",endif:"Twig.logic.type.endif",for_:"Twig.logic.type.for",endfor:"Twig.logic.type.endfor",else_:"Twig.logic.type.else",elseif:"Twig.logic.type.elseif",set:"Twig.logic.type.set",setcapture:"Twig.logic.type.setcapture",endset:"Twig.logic.type.endset",filter:"Twig.logic.type.filter",endfilter:"Twig.logic.type.endfilter",block:"Twig.logic.type.block",endblock:"Twig.logic.type.endblock",extends_:"Twig.logic.type.extends",use:"Twig.logic.type.use",include:"Twig.logic.type.include",spaceless:"Twig.logic.type.spaceless",endspaceless:"Twig.logic.type.endspaceless",macro:"Twig.logic.type.macro",endmacro:"Twig.logic.type.endmacro",import_:"Twig.logic.type.import",from:"Twig.logic.type.from"},e.logic.definitions=[{type:e.logic.type.if_,regex:/^if\s+([^\s].+)$/,next:[e.logic.type.else_,e.logic.type.elseif,e.logic.type.endif],open:!0,compile:function(t){var n=t.match[1];return t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,delete t.match,t},parse:function(t,n,r){var i="",s=e.expression.parse.apply(this,[t.stack,n]);return r=!0,s&&(r=!1,i=e.parse.apply(this,[t.output,n])),{chain:r,output:i}}},{type:e.logic.type.elseif,regex:/^elseif\s+([^\s].*)$/,next:[e.logic.type.else_,e.logic.type.elseif,e.logic.type.endif],open:!1,compile:function(t){var n=t.match[1];return t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,delete t.match,t},parse:function(t,n,r){var i="";return r&&e.expression.parse.apply(this,[t.stack,n])===!0&&(r=!1,i=e.parse.apply(this,[t.output,n])),{chain:r,output:i}}},{type:e.logic.type.else_,regex:/^else$/,next:[e.logic.type.endif,e.logic.type.endfor],open:!1,parse:function(t,n,r){var i="";return r&&(i=e.parse.apply(this,[t.output,n])),{chain:r,output:i}}},{type:e.logic.type.endif,regex:/^endif$/,next:[],open:!1},{type:e.logic.type.for_,regex:/^for\s+([a-zA-Z0-9_,\s]+)\s+in\s+([^\s].*?)(?:\s+if\s+([^\s].*))?$/,next:[e.logic.type.else_,e.logic.type.endfor],open:!0,compile:function(t){var n=t.match[1],r=t.match[2],i=t.match[3],s=null;t.key_var=null,t.value_var=null;if(n.indexOf(",")>=0){s=n.split(",");if(s.length!==2)throw new e.Error("Invalid expression in for loop: "+n);t.key_var=s[0].trim(),t.value_var=s[1].trim()}else t.value_var=n;return t.expression=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:r}]).stack,i&&(t.conditional=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:i}]).stack),delete t.match,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.expression,n]),s=[],o,u=0,a,f=this,l=t.conditional,c=function(e,t){var r=l!==undefined;return{index:e+1,index0:e,revindex:r?undefined:t-e,revindex0:r?undefined:t-e-1,first:e===0,last:r?undefined:e===t-1,length:r?undefined:t,parent:n}},h=function(r,i){var a=e.lib.copy(n);a[t.value_var]=i,t.key_var&&(a[t.key_var]=r),a.loop=c(u,o);if(l===undefined||e.expression.parse.apply(f,[l,a]))s.push(e.parse.apply(f,[t.output,a])),u+=1};return i instanceof Array?(o=i.length,e.forEach(i,function(e){var t=u;h(t,e)})):i instanceof Object&&(i._keys!==undefined?a=i._keys:a=Object.keys(i),o=a.length,e.forEach(a,function(e){if(e==="_keys")return;h(e,i[e])})),r=s.length===0,{chain:r,output:s.join("")}}},{type:e.logic.type.endfor,regex:/^endfor$/,next:[],open:!1},{type:e.logic.type.set,regex:/^set\s+([a-zA-Z0-9_,\s]+)\s*=\s*(.+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim(),r=t.match[2],i=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:r}]).stack;return t.key=n,t.expression=i,delete t.match,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.expression,n]),s=t.key;return this.context[s]=i,n[s]=i,{chain:r,context:n}}},{type:e.logic.type.setcapture,regex:/^set\s+([a-zA-Z0-9_,\s]+)$/,next:[e.logic.type.endset],open:!0,compile:function(e){var t=e.match[1].trim();return e.key=t,delete e.match,e},parse:function(t,n,r){var i=e.parse.apply(this,[t.output,n]),s=t.key;return this.context[s]=i,n[s]=i,{chain:r,context:n}}},{type:e.logic.type.endset,regex:/^endset$/,next:[],open:!1},{type:e.logic.type.filter,regex:/^filter\s+(.+)$/,next:[e.logic.type.endfilter],open:!0,compile:function(t){var n="|"+t.match[1].trim();return t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,delete t.match,t},parse:function(t,n,r){var i=e.parse.apply(this,[t.output,n]),s=[{type:e.expression.type.string,value:i}].concat(t.stack),o=e.expression.parse.apply(this,[s,n]);return{chain:r,output:o}}},{type:e.logic.type.endfilter,regex:/^endfilter$/,next:[],open:!1},{type:e.logic.type.block,regex:/^block\s+([a-zA-Z0-9_]+)$/,next:[e.logic.type.endblock],open:!0,compile:function(e){return e.block=e.match[1].trim(),delete e.match,e},parse:function(t,n,r){var i="",s="",o=this.blocks[t.block]&&this.blocks[t.block].indexOf(e.placeholders.parent)>-1;if(this.blocks[t.block]===undefined||o||n.loop)i=e.expression.parse.apply(this,[{type:e.expression.type.string,value:e.parse.apply(this,[t.output,n])},n]),o?this.blocks[t.block]=this.blocks[t.block].replace(e.placeholders.parent,i):this.blocks[t.block]=i;return this.child.blocks[t.block]?s=this.child.blocks[t.block]:s=this.blocks[t.block],{chain:r,output:s}}},{type:e.logic.type.endblock,regex:/^endblock(?:\s+([a-zA-Z0-9_]+))?$/,next:[],open:!1},{type:e.logic.type.extends_,regex:/^extends\s+(.+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim();return delete t.match,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.stack,n]);return this.extend=i,{chain:r,output:""}}},{type:e.logic.type.use,regex:/^use\s+(.+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim();return delete t.match,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.stack,n]);return this.importBlocks(i),{chain:r,output:""}}},{type:e.logic.type.include,regex:/^include\s+(ignore missing\s+)?(.+?)\s*(?:with\s+(.+?))?\s*(only)?$/,next:[],open:!0,compile:function(t){var n=t.match,r=n[1]!==undefined,i=n[2].trim(),s=n[3],o=n[4]!==undefined&&n[4].length;return delete t.match,t.only=o,t.includeMissing=r,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:i}]).stack,s!==undefined&&(t.withStack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:s.trim()}]).stack),t},parse:function(t,n,r){var i={},s,o,u;if(!t.only)for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);if(t.withStack!==undefined){s=e.expression.parse.apply(this,[t.withStack,n]);for(o in s)s.hasOwnProperty(o)&&(i[o]=s[o])}var a=e.expression.parse.apply(this,[t.stack,i]);return u=this.importFile(a),{chain:r,output:u.render(i)}}},{type:e.logic.type.spaceless,regex:/^spaceless$/,next:[e.logic.type.endspaceless],open:!0,parse:function(t,n,r){var i=e.parse.apply(this,[t.output,n]),s=/>\s+</g,o=i.replace(s,"><").trim();return{chain:r,output:o}}},{type:e.logic.type.endspaceless,regex:/^endspaceless$/,next:[],open:!1},{type:e.logic.type.macro,regex:/^macro\s+([a-zA-Z0-9_]+)\s?\((([a-zA-Z0-9_]+(,\s?)?)*)\)$/,next:[e.logic.type.endmacro],open:!0,compile:function(t){var n=t.match[1],r=t.match[2].split(/[ ,]+/);for(var i=0;i<r.length;i++)for(var s=0;s<r.length;s++)if(r[i]===r[s]&&i!==s)throw new e.Error("Duplicate arguments for parameter: "+r[i]);return t.macroName=n,t.parameters=r,delete t.match,t},parse:function(t,n,r){var i=this;return this.macros[t.macroName]=function(){var n={_self:i.macros};for(var r=0;r<t.parameters.length;r++){var s=t.parameters[r];typeof arguments[r]!="undefined"?n[s]=arguments[r]:n[s]=undefined}return e.parse.apply(i,[t.output,n])},{chain:r,output:""}}},{type:e.logic.type.endmacro,regex:/^endmacro$/,next:[],open:!1},{type:e.logic.type.import_,regex:/^import\s+(.+)\s+as\s+([a-zA-Z0-9_]+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim(),r=t.match[2].trim();return delete t.match,t.expression=n,t.contextName=r,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){if(t.expression!=="_self"){var i=e.expression.parse.apply(this,[t.stack,n]),s=this.importMacros(i||t.expression);n[t.contextName]=s.render({},{output:"macros"})}else n[t.contextName]=this.macros;return{chain:r,output:""}}},{type:e.logic.type.from,regex:/^from\s+(.+)\s+import\s+([a-zA-Z0-9_, ]+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim(),r=t.match[2].trim().split(/[ ,]+/),i={};for(var s=0;s<r.length;s++){var o=r[s],u=o.match(/^([a-zA-Z0-9_]+)\s+(.+)\s+as\s+([a-zA-Z0-9_]+)$/);u?i[u[1].trim()]=u[2].trim():o.match(/^([a-zA-Z0-9_]+)$/)&&(i[o]=o)}return delete t.match,t.expression=n,t.macroNames=i,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){var i;if(t.expression!=="_self"){var s=e.expression.parse.apply(this,[t.stack,n]),o=this.importMacros(s||t.expression);i=o.render({},{output:"macros"})}else i=this.macros;for(var u in t.macroNames)i.hasOwnProperty(u)&&(n[t.macroNames[u]]=i[u]);return{chain:r,output:""}}}],e.logic.handler={},e.logic.extendType=function(t,n){n=n||"Twig.logic.type"+t,e.logic.type[t]=n},e.logic.extend=function(t){if(!t.type)throw new e.Error("Unable to extend logic definition. No type provided for "+t);if(e.logic.type[t.type])throw new e.Error("Unable to extend logic definitions. Type "+t.type+" is already defined.");e.logic.extendType(t.type),e.logic.handler[t.type]=t};while(e.logic.definitions.length>0)e.logic.extend(e.logic.definitions.shift());return e.logic.compile=function(t){var n=t.value.trim(),r=e.logic.tokenize.apply(this,[n]),i=e.logic.handler[r.type];return i.compile&&(r=i.compile.apply(this,[r]),e.log.trace("Twig.logic.compile: ","Compiled logic token to ",r)),r},e.logic.tokenize=function(t){var n={},r=null,i=null,s=null,o=null,u=null,a=null;t=t.trim();for(r in e.logic.handler)if(e.logic.handler.hasOwnProperty(r)){i=e.logic.handler[r].type,s=e.logic.handler[r].regex,o=[],s instanceof Array?o=s:o.push(s);while(o.length>0){u=o.shift(),a=u.exec(t.trim());if(a!==null)return n.type=i,n.match=a,e.log.trace("Twig.logic.tokenize: ","Matched a ",i," regular expression of ",a),n}}throw new e.Error("Unable to parse '"+t.trim()+"'")},e.logic.parse=function(t,n,r){var i="",s;return n=n||{},e.log.debug("Twig.logic.parse: ","Parsing logic token ",t),s=e.logic.handler[t.type],s.parse&&(i=s.parse.apply(this,[t,n,r])),i},e}(Twig||{}),Twig=function(e){e.expression={},e.expression.reservedWords=["true","false","null","_context"],e.expression.type={comma:"Twig.expression.type.comma",operator:{unary:"Twig.expression.type.operator.unary",binary:"Twig.expression.type.operator.binary"},string:"Twig.expression.type.string",bool:"Twig.expression.type.bool",array:{start:"Twig.expression.type.array.start",end:"Twig.expression.type.array.end"},object:{start:"Twig.expression.type.object.start",end:"Twig.expression.type.object.end"},parameter:{start:"Twig.expression.type.parameter.start",end:"Twig.expression.type.parameter.end"},key:{period:"Twig.expression.type.key.period",brackets:"Twig.expression.type.key.brackets"},filter:"Twig.expression.type.filter",_function:"Twig.expression.type._function",variable:"Twig.expression.type.variable",number:"Twig.expression.type.number",_null:"Twig.expression.type.null",context:"Twig.expression.type.context",test:"Twig.expression.type.test"},e.expression.set={operations:[e.expression.type.filter,e.expression.type.operator.unary,e.expression.type.operator.binary,e.expression.type.array.end,e.expression.type.object.end,e.expression.type.parameter.end,e.expression.type.comma,e.expression.type.test],expressions:[e.expression.type._function,e.expression.type.bool,e.expression.type.string,e.expression.type.variable,e.expression.type.number,e.expression.type._null,e.expression.type.context,e.expression.type.parameter.start,e.expression.type.array.start,e.expression.type.object.start]},e.expression.set.operations_extended=e.expression.set.operations.concat([e.expression.type.key.period,e.expression.type.key.brackets]),e.expression.fn={compile:{push:function(e,t,n){n.push(e)},push_both:function(e,t,n){n.push(e),t.push(e)}},parse:{push:function(e,t,n){t.push(e)},push_value:function(e,t,n){t.push(e.value)}}},e.expression.definitions=[{type:e.expression.type.test,regex:/^is\s+(not)?\s*([a-zA-Z_][a-zA-Z0-9_]*)/,next:e.expression.set.operations.concat([e.expression.type.parameter.start]),compile:function(e,t,n){e.filter=e.match[2],e.modifier=e.match[1],delete e.match,delete e.value,n.push(e)},parse:function(t,n,r){var i=n.pop(),s=t.params&&e.expression.parse.apply(this,[t.params,r]),o=e.test(t.filter,i,s);t.modifier=="not"?n.push(!o):n.push(o)}},{type:e.expression.type.comma,regex:/^,/,next:e.expression.set.expressions.concat([e.expression.type.array.end,e.expression.type.object.end]),compile:function(t,n,r){var i=n.length-1,s;delete t.match,delete t.value;for(;i>=0;i--){s=n.pop();if(s.type===e.expression.type.object.start||s.type===e.expression.type.parameter.start||s.type===e.expression.type.array.start){n.push(s);break}r.push(s)}r.push(t)}},{type:e.expression.type.operator.binary,regex:/(^[\+\-~%\?\:]|^[!=]==?|^[!<>]=?|^\*\*?|^\/\/?|^and\s+|^or\s+|^in\s+|^not in\s+|^\.\.)/,next:e.expression.set.expressions.concat([e.expression.type.operator.unary]),compile:function(t,n,r){delete t.match,t.value=t.value.trim();var i=t.value,s=e.expression.operator.lookup(i,t);e.log.trace("Twig.expression.compile: ","Operator: ",s," from ",i);while(n.length>0&&(n[n.length-1].type==e.expression.type.operator.unary||n[n.length-1].type==e.expression.type.operator.binary)&&(s.associativity===e.expression.operator.leftToRight&&s.precidence>=n[n.length-1].precidence||s.associativity===e.expression.operator.rightToLeft&&s.precidence>n[n.length-1].precidence)){var o=n.pop();r.push(o)}if(i===":"){if(!n[n.length-1]||n[n.length-1].value!=="?"){var u=r.pop();if(u.type!==e.expression.type.string&&u.type!==e.expression.type.variable&&u.type!==e.expression.type.number)throw new e.Error("Unexpected value before ':' of "+u.type+" = "+u.value);t.key=u.value,r.push(t);return}}else n.push(s)},parse:function(t,n,r){t.key?n.push(t):e.expression.operator.parse(t.value,n)}},{type:e.expression.type.operator.unary,regex:/(^not\s+)/,next:e.expression.set.expressions,compile:function(t,n,r){delete t.match,t.value=t.value.trim();var i=t.value,s=e.expression.operator.lookup(i,t);e.log.trace("Twig.expression.compile: ","Operator: ",s," from ",i);while(n.length>0&&(n[n.length-1].type==e.expression.type.operator.unary||n[n.length-1].type==e.expression.type.operator.binary)&&(s.associativity===e.expression.operator.leftToRight&&s.precidence>=n[n.length-1].precidence||s.associativity===e.expression.operator.rightToLeft&&s.precidence>n[n.length-1].precidence)){var o=n.pop();r.push(o)}n.push(s)},parse:function(t,n,r){e.expression.operator.parse(t.value,n)}},{type:e.expression.type.string,regex:/^(["'])(?:(?=(\\?))\2.)*?\1/,next:e.expression.set.operations,compile:function(t,n,r){var i=t.value;delete t.match,i.substring(0,1)==='"'?i=i.replace('\\"','"'):i=i.replace("\\'","'"),t.value=i.substring(1,i.length-1).replace(/\\n/g,"\n").replace(/\\r/g,"\r"),e.log.trace("Twig.expression.compile: ","String value: ",t.value),r.push(t)},parse:e.expression.fn.parse.push_value},{type:e.expression.type.parameter.start,regex:/^\(/,next:e.expression.set.expressions.concat([e.expression.type.parameter.end]),compile:e.expression.fn.compile.push_both,parse:e.expression.fn.parse.push},{type:e.expression.type.parameter.end,regex:/^\)/,next:e.expression.set.operations_extended,compile:function(t,n,r){var i,s=t;i=n.pop();while(n.length>0&&i.type!=e.expression.type.parameter.start)r.push(i),i=n.pop();var o=[];while(t.type!==e.expression.type.parameter.start)o.unshift(t),t=r.pop();o.unshift(t);var u=!1;t=r[r.length-1],t===undefined||t.type!==e.expression.type._function&&t.type!==e.expression.type.filter&&t.type!==e.expression.type.test&&t.type!==e.expression.type.key.brackets&&t.type!==e.expression.type.key.period?(s.expression=!0,o.pop(),o.shift(),s.params=o,r.push(s)):(s.expression=!1,t.params=o)},parse:function(t,n,r){var i=[],s=!1,o=null;if(t.expression)o=e.expression.parse.apply(this,[t.params,r]),n.push(o);else{while(n.length>0){o=n.pop();if(o&&o.type&&o.type==e.expression.type.parameter.start){s=!0;break}i.unshift(o)}if(!s)throw new e.Error("Expected end of parameter set.");n.push(i)}}},{type:e.expression.type.array.start,regex:/^\[/,next:e.expression.set.expressions.concat([e.expression.type.array.end]),compile:e.expression.fn.compile.push_both,parse:e.expression.fn.parse.push},{type:e.expression.type.array.end,regex:/^\]/,next:e.expression.set.operations_extended,compile:function(t,n,r){var i=n.length-1,s;for(;i>=0;i--){s=n.pop();if(s.type===e.expression.type.array.start)break;r.push(s)}r.push(t)},parse:function(t,n,r){var i=[],s=!1,o=null;while(n.length>0){o=n.pop();if(o.type&&o.type==e.expression.type.array.start){s=!0;break}i.unshift(o)}if(!s)throw new e.Error("Expected end of array.");n.push(i)}},{type:e.expression.type.object.start,regex:/^\{/,next:e.expression.set.expressions.concat([e.expression.type.object.end]),compile:e.expression.fn.compile.push_both,parse:e.expression.fn.parse.push},{type:e.expression.type.object.end,regex:/^\}/,next:e.expression.set.operations_extended,compile:function(t,n,r){var i=n.length-1,s;for(;i>=0;i--){s=n.pop();if(s&&s.type===e.expression.type.object.start)break;r.push(s)}r.push(t)},parse:function(t,n,r){var i={},s=!1,o=null,u=null,a=!1,f=null;while(n.length>0){o=n.pop();if(o&&o.type&&o.type===e.expression.type.object.start){s=!0;break}if(o&&o.type&&(o.type===e.expression.type.operator.binary||o.type===e.expression.type.operator.unary)&&o.key){if(!a)throw new e.Error("Missing value for key '"+o.key+"' in object definition.");i[o.key]=f,i._keys===undefined&&(i._keys=[]),i._keys.unshift(o.key),f=null,a=!1}else a=!0,f=o}if(!s)throw new e.Error("Unexpected end of object.");n.push(i)}},{type:e.expression.type.filter,regex:/^\|\s?([a-zA-Z_][a-zA-Z0-9_\-]*)/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:function(e,t,n){e.value=e.match[1],n.push(e)},parse:function(t,n,r){var i=n.pop(),s=t.params&&e.expression.parse.apply(this,[t.params,r]);n.push(e.filter.apply(this,[t.value,i,s]))}},{type:e.expression.type._function,regex:/^([a-zA-Z_][a-zA-Z0-9_]*)\s*\(/,next:e.expression.type.parameter.start,transform:function(e,t){return"("},compile:function(e,t,n){var r=e.match[1];e.fn=r,delete e.match,delete e.value,n.push(e)},parse:function(t,n,r){var i=t.params&&e.expression.parse.apply(this,[t.params,r]),s=t.fn,o;if(e.functions[s])o=e.functions[s].apply(this,i);else{if(typeof r[s]!="function")throw new e.Error(s+" function does not exist and is not defined in the context");o=r[s].apply(r,i)}n.push(o)}},{type:e.expression.type.variable,regex:/^[a-zA-Z_][a-zA-Z0-9_]*/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,validate:function(t,n){return e.indexOf(e.expression.reservedWords,t[0])<0},parse:function(t,n,r){var i=e.expression.resolve(r[t.value],r);n.push(i)}},{type:e.expression.type.key.period,regex:/^\.([a-zA-Z0-9_]+)/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:function(e,t,n){e.key=e.match[1],delete e.match,delete e.value,n.push(e)},parse:function(t,n,r){var i=t.params&&e.expression.parse.apply(this,[t.params,r]),s=t.key,o=n.pop(),u;if(o===null||o===undefined){if(this.options.strict_variables)throw new e.Error("Can't access a key "+s+" on an null or undefined object.");return null}var a=function(e){return e.substr(0,1).toUpperCase()+e.substr(1)};typeof o=="object"&&s in o?u=o[s]:o["get"+a(s)]!==undefined?u=o["get"+a(s)]:o["is"+a(s)]!==undefined?u=o["is"+a(s)]:u=null,n.push(e.expression.resolve(u,o,i))}},{type:e.expression.type.key.brackets,regex:/^\[([^\]]*)\]/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:function(t,n,r){var i=t.match[1];delete t.value,delete t.match,t.stack=e.expression.compile({value:i}).stack,r.push(t)},parse:function(t,n,r){var i=t.params&&e.expression.parse.apply(this,[t.params,r]),s=e.expression.parse.apply(this,[t.stack,r]),o=n.pop(),u;if(o===null||o===undefined){if(this.options.strict_variables)throw new e.Error("Can't access a key "+s+" on an null or undefined object.");return null}typeof o=="object"&&s in o?u=o[s]:u=null,n.push(e.expression.resolve(u,o,i))}},{type:e.expression.type._null,regex:/^null/,next:e.expression.set.operations,compile:function(e,t,n){delete e.match,e.value=null,n.push(e)},parse:e.expression.fn.parse.push_value},{type:e.expression.type.context,regex:/^_context/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,parse:function(e,t,n){t.push(n)}},{type:e.expression.type.number,regex:/^\-?\d+(\.\d+)?/,next:e.expression.set.operations,compile:function(e,t,n){e.value=Number(e.value),n.push(e)},parse:e.expression.fn.parse.push_value},{type:e.expression.type.bool,regex:/^(true|false)/,next:e.expression.set.operations,compile:function(e,t,n){e.value=e.match[0]=="true",delete e.match,n.push(e)},parse:e.expression.fn.parse.push_value}],e.expression.resolve=function(e,t,n){return typeof e=="function"?e.apply(t,n||[]):e},e.expression.handler={},e.expression.extendType=function(t){e.expression.type[t]="Twig.expression.type."+t},e.expression.extend=function(t){if(!t.type)throw new e.Error("Unable to extend logic definition. No type provided for "+t);e.expression.handler[t.type]=t};while(e.expression.definitions.length>0)e.expression.extend(e.expression.definitions.shift());return e.expression.tokenize=function(t){var n=[],r=0,i=null,s,o,u,a,f,l=[],c;c=function(){var t=Array.prototype.slice.apply(arguments),o=t.pop(),u=t.pop();return e.log.trace("Twig.expression.tokenize","Matched a ",s," regular expression of ",t),i&&e.indexOf(i,s)<0?(l.push(s+" cannot follow a "+n[n.length-1].type+" at template:"+r+" near '"+t[0].substring(0,20)+"...'"),t[0]):e.expression.handler[s].validate&&!e.expression.handler[s].validate(t,n)?t[0]:(l=[],n.push({type:s,value:t[0],match:t}),f=!0,i=a,r+=t[0].length,e.expression.handler[s].transform?e.expression.handler[s].transform(t,n):"")},e.log.debug("Twig.expression.tokenize","Tokenizing expression ",t);while(t.length>0){t=t.trim();for(s in e.expression.handler)if(e.expression.handler.hasOwnProperty(s)){a=e.expression.handler[s].next,o=e.expression.handler[s].regex,o instanceof Array?u=o:u=[o],f=!1;while(u.length>0)o=u.pop(),t=t.replace(o,c);if(f)break}if(!f)throw l.length>0?new e.Error(l.join(" OR ")):new e.Error("Unable to parse '"+t+"' at template position"+r)}return e.log.trace("Twig.expression.tokenize","Tokenized to ",n),n},e.expression.compile=function(t){var n=t.value,r=e.expression.tokenize(n),i=null,s=[],o=[],u=null;e.log.trace("Twig.expression.compile: ","Compiling ",n);while(r.length>0)i=r.shift(),u=e.expression.handler[i.type],e.log.trace("Twig.expression.compile: ","Compiling ",i),u.compile&&u.compile(i,o,s),e.log.trace("Twig.expression.compile: ","Stack is",o),e.log.trace("Twig.expression.compile: ","Output is",s);while(o.length>0)s.push(o.pop());return e.log.trace("Twig.expression.compile: ","Final output is",s),t.stack=s,delete t.value,t},e.expression.parse=function(t,n){var r=this;t instanceof Array||(t=[t]);var i=[],s=null;return e.forEach(t,function(t){s=e.expression.handler[t.type],s.parse&&s.parse.apply(r,[t,i,n])}),i.pop()},e}(Twig||{}),Twig=function(e){e.expression.operator={leftToRight:"leftToRight",rightToLeft:"rightToLeft"};var t=function(e,t){if(t.indexOf!==undefined)return e===t||e!==""&&t.indexOf(e)>-1;var n;for(n in t)if(t.hasOwnProperty(n)&&t[n]===e)return!0;return!1};return e.expression.operator.lookup=function(t,n){switch(t){case"..":case"not in":case"in":n.precidence=20,n.associativity=e.expression.operator.leftToRight;break;case",":n.precidence=18,n.associativity=e.expression.operator.leftToRight;break;case"?":case":":n.precidence=16,n.associativity=e.expression.operator.rightToLeft;break;case"or":n.precidence=14,n.associativity=e.expression.operator.leftToRight;break;case"and":n.precidence=13,n.associativity=e.expression.operator.leftToRight;break;case"==":case"!=":n.precidence=9,n.associativity=e.expression.operator.leftToRight;break;case"<":case"<=":case">":case">=":n.precidence=8,n.associativity=e.expression.operator.leftToRight;break;case"~":case"+":case"-":n.precidence=6,n.associativity=e.expression.operator.leftToRight;break;case"//":case"**":case"*":case"/":case"%":n.precidence=5,n.associativity=e.expression.operator.leftToRight;break;case"not":n.precidence=3,n.associativity=e.expression.operator.rightToLeft;break;default:throw new e.Error(t+" is an unknown operator.")}return n.operator=t,n},e.expression.operator.parse=function(n,r){e.log.trace("Twig.expression.operator.parse: ","Handling ",n);var i,s,o;switch(n){case":":break;case"?":o=r.pop(),s=r.pop(),i=r.pop(),i?r.push(s):r.push(o);break;case"+":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(i+s);break;case"-":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(i-s);break;case"*":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(i*s);break;case"/":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(i/s);break;case"//":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(parseInt(i/s));break;case"%":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(i%s);break;case"~":s=r.pop(),i=r.pop(),r.push((i!==undefined?i.toString():"")+(s!==undefined?s.toString():""));break;case"not":case"!":r.push(!r.pop());break;case"<":s=r.pop(),i=r.pop(),r.push(i<s);break;case"<=":s=r.pop(),i=r.pop(),r.push(i<=s);break;case">":s=r.pop(),i=r.pop(),r.push(i>s);break;case">=":s=r.pop(),i=r.pop(),r.push(i>=s);break;case"===":s=r.pop(),i=r.pop(),r.push(i===s);break;case"==":s=r.pop(),i=r.pop(),r.push(i==s);break;case"!==":s=r.pop(),i=r.pop(),r.push(i!==s);break;case"!=":s=r.pop(),i=r.pop(),r.push(i!=s);break;case"or":s=r.pop(),i=r.pop(),r.push(i||s);break;case"and":s=r.pop(),i=r.pop(),r.push(i&&s);break;case"**":s=r.pop(),i=r.pop(),r.push(Math.pow(i,s));break;case"not in":s=r.pop(),i=r.pop(),r.push(!t(i,s));break;case"in":s=r.pop(),i=r.pop(),r.push(t(i,s));break;case"..":s=r.pop(),i=r.pop(),r.push(e.functions.range(i,s));break;default:throw new e.Error(n+" is an unknown operator.")}},e}(Twig||{}),Twig=function(e){function t(e,t){var n=Object.prototype.toString.call(t).slice(8,-1);return t!==undefined&&t!==null&&n===e}return e.filters={upper:function(e){return typeof e!="string"?e:e.toUpperCase()},lower:function(e){return typeof e!="string"?e:e.toLowerCase()},capitalize:function(e){return typeof e!="string"?e:e.substr(0,1).toUpperCase()+e.toLowerCase().substr(1)},title:function(e){return typeof e!="string"?e:e.toLowerCase().replace(/(^|\s)([a-z])/g,function(e,t,n){return t+n.toUpperCase()})},length:function(t){return e.lib.is("Array",t)||typeof t=="string"?t.length:e.lib.is("Object",t)?t._keys===undefined?Object.keys(t).length:t._keys.length:0},reverse:function(e){if(t("Array",e))return e.reverse();if(t("String",e))return e.split("").reverse().join("");if(e instanceof Object){var n=e._keys||Object.keys(e).reverse();return e._keys=n,e}},sort:function(e){if(t("Array",e))return e.sort();if(e instanceof Object){delete e._keys;var n=Object.keys(e),r=n.sort(function(t,n){return e[t]>e[n]});return e._keys=r,e}},keys:function(t){if(t===undefined||t===null)return;var n=t._keys||Object.keys(t),r=[];return e.forEach(n,function(e){if(e==="_keys")return;t.hasOwnProperty(e)&&r.push(e)}),r},url_encode:function(e){if(e===undefined||e===null)return;return encodeURIComponent(e)},join:function(t,n){if(t===undefined||t===null)return;var r="",i=[],s=null;return n&&n[0]&&(r=n[0]),t instanceof Array?i=t:(s=t._keys||Object.keys(t),e.forEach(s,function(e){if(e==="_keys")return;t.hasOwnProperty(e)&&i.push(t[e])})),i.join(r)},"default":function(t,n){if(n===undefined||n.length!==1)throw new e.Error("default filter expects one argument");return t===undefined||t===null||t===""?n[0]:t},json_encode:function(e){return e&&e.hasOwnProperty("_keys")&&delete e._keys,e===undefined||e===null?"null":JSON.stringify(e)},merge:function(t,n){var r=[],i=0,s=[];t instanceof Array?e.forEach(n,function(e){e instanceof Array||(r={})}):r={},r instanceof Array||(r._keys=[]),t instanceof Array?e.forEach(t,function(e){r._keys&&r._keys.push(i),r[i]=e,i++}):(s=t._keys||Object.keys(t),e.forEach(s,function(e){r[e]=t[e],r._keys.push(e);var n=parseInt(e,10);!isNaN(n)&&n>=i&&(i=n+1)})),e.forEach(n,function(t){t instanceof Array?e.forEach(t,function(e){r._keys&&r._keys.push(i),r[i]=e,i++}):(s=t._keys||Object.keys(t),e.forEach(s,function(e){r[e]||r._keys.push(e),r[e]=t[e];var n=parseInt(e,10);!isNaN(n)&&n>=i&&(i=n+1)}))});if(n.length===0)throw new e.Error("Filter merge expects at least one parameter");return r},date:function(t,n){if(t===undefined||t===null)return;var r=e.functions.date(t);return e.lib.formatDate(r,n[0])},date_modify:function(t,n){if(t===undefined||t===null)return;if(n===undefined||n.length!==1)throw new e.Error("date_modify filter expects 1 argument");var r=n[0],i;return e.lib.is("Date",t)&&(i=e.lib.strtotime(r,t.getTime()/1e3)),e.lib.is("String",t)&&(i=e.lib.strtotime(r,e.lib.strtotime(t))),e.lib.is("Number",t)&&(i=e.lib.strtotime(r,t)),new Date(i*1e3)},replace:function(t,n){if(t===undefined||t===null)return;var r=n[0],i;for(i in r)r.hasOwnProperty(i)&&i!=="_keys"&&(t=e.lib.replaceAll(t,i,r[i]));return t},format:function(t,n){if(t===undefined||t===null)return;return e.lib.vsprintf(t,n)},striptags:function(t){if(t===undefined||t===null)return;return e.lib.strip_tags(t)},escape:function(e){if(e===undefined||e===null)return;return e.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},e:function(t){return e.filters.escape(t)},nl2br:function(t){if(t===undefined||t===null)return;var n="BACKSLASH_n_replace",r="<br />"+n;return t=e.filters.escape(t).replace(/\r\n/g,r).replace(/\r/g,r).replace(/\n/g,r),e.lib.replaceAll(t,n,"\n")},number_format:function(e,t){var n=e,r=t&&t[0]?t[0]:undefined,i=t&&t[1]!==undefined?t[1]:".",s=t&&t[2]!==undefined?t[2]:",";n=(n+"").replace(/[^0-9+\-Ee.]/g,"");var o=isFinite(+n)?+n:0,u=isFinite(+r)?Math.abs(r):0,a="",f=function(e,t){var n=Math.pow(10,t);return""+Math.round(e*n)/n};return a=(u?f(o,u):""+Math.round(o)).split("."),a[0].length>3&&(a[0]=a[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,s)),(a[1]||"").length<u&&(a[1]=a[1]||"",a[1]+=(new Array(u-a[1].length+1)).join("0")),a.join(i)},trim:function(t,n){if(t===undefined||t===null)return;var r=e.filters.escape(""+t),i;n&&n[0]?i=""+n[0]:i=" \n\r \f            ​\u2028\u2029 ";for(var s=0;s<r.length;s++)if(i.indexOf(r.charAt(s))===-1){r=r.substring(s);break}for(s=r.length-1;s>=0;s--)if(i.indexOf(r.charAt(s))===-1){r=r.substring(0,s+1);break}return i.indexOf(r.charAt(0))===-1?r:""},slice:function(t,n){if(t===undefined||t===null)return;if(n===undefined||n.length<1)throw new e.Error("slice filter expects at least 1 argument");var r=n[0]||0,i=n.length>1?n[1]:t.length,s=r>=0?r:Math.max(t.length+r,0);if(e.lib.is("Array",t)){var o=[];for(var u=s;u<s+i&&u<t.length;u++)o.push(t[u]);return o}if(e.lib.is("String",t))return t.substr(s,i);throw new e.Error("slice filter expects value to be an array or string")},abs:function(e){if(e===undefined||e===null)return;return Math.abs(e)},first:function(e){if(e instanceof Array)return e[0];if(e instanceof Object){if("_keys"in e)return e[e._keys[0]]}else if(typeof e=="string")return e.substr(0,1);return},split:function(t,n){if(t===undefined||t===null)return;if(n===undefined||n.length<1||n.length>2)throw new e.Error("split filter expects 1 or 2 argument");if(e.lib.is("String",t)){var r=n[0],i=n[1],s=t.split(r);if(i===undefined)return s;if(i<0)return t.split(r,s.length+i);var o=[];if(r=="")while(s.length>0){var u="";for(var a=0;a<i&&s.length>0;a++)u+=s.shift();o.push(u)}else{for(var a=0;a<i-1&&s.length>0;a++)o.push(s.shift());s.length>0&&o.push(s.join(r))}return o}throw new e.Error("split filter expects value to be a string")},last:function(t){if(e.lib.is("Object",t)){var n;return t._keys===undefined?n=Object.keys(t):n=t._keys,t[n[n.length-1]]}return t[t.length-1]},raw:function(e){return e},batch:function(t,n){var r=n.shift(),i=n.shift(),s,o,u;if(!e.lib.is("Array",t))throw new e.Error("batch filter expects items to be an array");if(!e.lib.is("Number",r))throw new e.Error("batch filter expects size to be a number");r=Math.ceil(r),s=e.lib.chunkArray(t,r);if(i&&t.length%r!=0){o=s.pop(),u=r-o.length;while(u--)o.push(i);s.push(o)}return s},round:function(t,n){n=n||[];var r=n.length>0?n[0]:0,i=n.length>1?n[1]:"common";t=parseFloat(t);if(r&&!e.lib.is("Number",r))throw new e.Error("round filter expects precision to be a number");if(i==="common")return e.lib.round(t,r);if(!e.lib.is("Function",Math[i]))throw new e.Error("round filter expects method to be 'floor', 'ceil', or 'common'");return Math[i](t*Math.pow(10,r))/Math.pow(10,r)}},e.filter=function(t,n,r){if(!e.filters[t])throw"Unable to find filter "+t;return e.filters[t].apply(this,[n,r])},e.filter.extend=function(t,n){e.filters[t]=n},e}(Twig||{}),Twig=function(e){function t(e,t){var n=Object.prototype.toString.call(t).slice(8,-1);return t!==undefined&&t!==null&&n===e}return e.functions={range:function(e,t,n){var r=[],i,s,o,u=n||1,a=!1;!isNaN(e)&&!isNaN(t)?(i=parseInt(e,10),s=parseInt(t,10)):isNaN(e)&&isNaN(t)?(a=!0,i=e.charCodeAt(0),s=t.charCodeAt(0)):(i=isNaN(e)?0:e,s=isNaN(t)?0:t),o=i>s?!1:!0;if(o)while(i<=s)r.push(a?String.fromCharCode(i):i),i+=u;else while(i>=s)r.push(a?String.fromCharCode(i):i),i-=u;return r},cycle:function(e,t){var n=t%e.length;return e[n]},dump:function(){var t="\n",n=" ",r=0,i="",s=Array.prototype.slice.call(arguments),o=function(e){var t="";while(e>0)e--,t+=n;return t},u=function(e){i+=o(r),typeof e=="object"?a(e):typeof e=="function"?i+="function()"+t:typeof e=="string"?i+="string("+e.length+') "'+e+'"'+t:typeof e=="number"?i+="number("+e+")"+t:typeof e=="boolean"&&(i+="bool("+e+")"+t)},a=function(e){var n;if(e===null)i+="NULL"+t;else if(e===undefined)i+="undefined"+t;else if(typeof e=="object"){i+=o(r)+typeof e,r++,i+="("+function(e){var t=0,n;for(n in e)e.hasOwnProperty(n)&&t++;return t}(e)+") {"+t;for(n in e)i+=o(r)+"["+n+"]=> "+t,u(e[n]);r--,i+=o(r)+"}"+t}else u(e)};return s.length==0&&s.push(this.context),e.forEach(s,function(e){a(e)}),i},date:function(t,n){var r;if(t===undefined)r=new Date;else if(e.lib.is("Date",t))r=t;else if(e.lib.is("String",t))r=new Date(e.lib.strtotime(t)*1e3);else{if(!e.lib.is("Number",t))throw new e.Error("Unable to parse date "+t);r=new Date(t*1e3)}return r},block:function(e){return this.blocks[e]},parent:function(){return e.placeholders.parent},attribute:function(e,t,n){return e instanceof Object&&e.hasOwnProperty(t)?typeof e[t]=="function"?e[t].apply(undefined,n):e[t]:e[t]||undefined}},e._function=function(t,n,r){if(!e.functions[t])throw"Unable to find function "+t;return e.functions[t](n,r)},e._function.extend=function(t,n){e.functions[t]=n},e}(Twig||{}),Twig=function(e){return e.tests={empty:function(e){if(e===null||e===undefined)return!0;if(typeof e=="number")return!1;if(e.length&&e.length>0)return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},odd:function(e){return e%2===1},even:function(e){return e%2===0},divisibleby:function(e,t){return e%t[0]===0},defined:function(e){return e!==undefined},none:function(e){return e===null},"null":function(e){return this.none(e)},sameas:function(e,t){return e===t[0]}},e.test=function(t,n,r){if(!e.tests[t])throw"Test "+t+" is not defined.";return e.tests[t](n,r)},e.test.extend=function(t,n){e.tests[t]=n},e}(Twig||{}),Twig=function(e){return e.exports={VERSION:e.VERSION},e.exports.twig=function(n){var r=n.id,i={strict_variables:n.strict_variables||!1,allowInlineIncludes:n.allowInlineIncludes||!1,rethrow:n.rethrow||!1};r&&e.validateId(r),n.debug!==undefined&&(e.debug=n.debug),n.trace!==undefined&&(e.trace=n.trace);if(n.data!==undefined)return new e.Template({data:n.data,module:n.module,id:r,options:i});if(n.ref!==undefined){if(n.id!==undefined)throw new e.Error("Both ref and id cannot be set on a twig.js template.");return e.Templates.load(n.ref)}if(n.href!==undefined)return e.Templates.loadRemote(n.href,{id:r,method:"ajax",base:n.base,module:n.module,precompiled:n.precompiled,async:n.async,options:i},n.load,n.error);if(n.path!==undefined)return e.Templates.loadRemote(n.path,{id:r,method:"fs",base:n.base,module:n.module,precompiled:n.precompiled,async:n.async,options:i},n.load,n.error)},e.exports.extendFilter=function(t,n){e.filter.extend(t,n)},e.exports.extendFunction=function(t,n){e._function.extend(t,n)},e.exports.extendTest=function(t,n){e.test.extend(t,n)},e.exports.extendTag=function(t){e.logic.extend(t)},e.exports.extend=function(t){t(e)},e.exports.compile=function(t,n){var r=n.filename,i=n.filename,s;return s=new e.Template({data:t,path:i,id:r,options:n.settings["twig options"]}),function(e){return s.render(e)}},e.exports.renderFile=function(t,n,r){"function"==typeof n&&(r=n,n={}),n=n||{};var i={path:t,base:n.settings.views,load:function(e){r(null,e.render(n))}},s=n.settings["twig options"];if(s)for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o]);e.exports.twig(i)},e.exports.__express=e.exports.renderFile,e.exports.cache=function(t){e.cache=t},e}(Twig||{}),Twig=function(e){return e.compiler={module:{}},e.compiler.compile=function(t,n){var r=JSON.stringify(t.tokens),i=t.id,s;if(n.module){if(e.compiler.module[n.module]===undefined)throw new e.Error("Unable to find module type "+n.module);s=e.compiler.module[n.module](i,r,n.twig)}else s=e.compiler.wrap(i,r);return s},e.compiler.module={amd:function(t,n,r){return'define(["'+r+'"], function (Twig) {\n var twig, templates;\ntwig = Twig.twig;\ntemplates = '+e.compiler.wrap(t,n)+"\n return templates;\n});"},node:function(t,n){return'var twig = require("twig").twig;\nexports.template = '+e.compiler.wrap(t,n)},cjs2:function(t,n,r){return'module.declare([{ twig: "'+r+'" }], function (require, exports, module) {\n'+' var twig = require("twig").twig;\n'+" exports.template = "+e.compiler.wrap(t,n)+"\n});"}},e.compiler.wrap=function(e,t){return'twig({id:"'+e.replace('"','\\"')+'", data:'+t+", precompiled: true});\n"},e}(Twig||{});typeof module!="undefined"&&module.declare?module.declare([],function(e,t,n){for(key in Twig.exports)Twig.exports.hasOwnProperty(key)&&(t[key]=Twig.exports[key])}):typeof define=="function"&&define.amd||1?timely.define("external_libs/twig",[],function(){return Twig.exports}):typeof module!="undefined"&&module.exports?module.exports=Twig.exports:(window.twig=Twig.exports.twig,window.Twig=Twig.exports);
6
  * @link https://github.com/justjohn/twig.js
7
  */
8
 
9
+ // Twig.js
10
  // Copyright (c) 2011-2013 John Roepke
11
+ // Available under the BSD 2-Clause License
12
+ // https://github.com/justjohn/twig.js
13
 
14
+ // The following methods are from MDN and are available under a
15
  // [MIT License](http://www.opensource.org/licenses/mit-license.php) or are
 
16
  // [Public Domain](https://developer.mozilla.org/Project:Copyrights).
17
+ //
18
+ // See:
19
+ // * [Object.keys - MDN](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys)
20
 
21
+ // ## twig.lib.js
22
+ //
23
+ // This file contains 3rd party libraries used within twig.
24
+ //
25
  // Copies of the licenses for the code included here can be found in the
26
+ // LICENSES.md file.
27
+ //
28
 
29
  /**
30
  * jPaq - A fully customizable JavaScript/JScript library
38
  * Revised: April 6, 2011
39
  */
40
 
41
+ // Twig.js
42
+ // Copyright (c) 2011-2013 John Roepke
43
+ // 2012 Hadrien Lanneau
44
+ // Available under the BSD 2-Clause License
45
+ // https://github.com/justjohn/twig.js
46
+
47
  var Twig=function(e){return e.VERSION="0.7.2",e}(Twig||{}),Twig=function(e){function t(e,t){var n=Object.prototype.toString.call(t).slice(8,-1);return t!==undefined&&t!==null&&n===e}function n(t,n){var r,i,s="/",o=[],u;if(t.url)typeof t.base!="undefined"?r=t.base+(t.base.charAt(t.base.length-1)==="/"?"":"/"):r=t.url;else{if(!t.path)throw new e.Error("Cannot extend an inline template.");var a=require("path"),f=a.sep||s,l=new RegExp("^\\.{1,2}"+f.replace("\\","\\\\"));n=n.replace(/\//g,f),t.base!==undefined&&n.match(l)==null?(n=n.replace(t.base,""),r=t.base+f):r=t.path,r=r.replace(f+f,f),s=f}i=r.split(s),i.pop(),i=i.concat(n.split(s));while(i.length>0)u=i.shift(),u!="."&&(u==".."&&o.length>0&&o[o.length-1]!=".."?o.pop():o.push(u));return o.join(s)}return e.trace=!1,e.debug=!1,e.cache=!0,e.placeholders={parent:"{{|PARENT|}}"},e.indexOf=function(e,t){if(Array.prototype.hasOwnProperty("indexOf"))return e.indexOf(t);if(e===void 0||e===null)throw new TypeError;var n=Object(e),r=n.length>>>0;if(r===0)return-1;var i=0;arguments.length>0&&(i=Number(arguments[1]),i!==i?i=0:i!==0&&i!==Infinity&&i!==-Infinity&&(i=(i>0||-1)*Math.floor(Math.abs(i))));if(i>=r)return-1;var s=i>=0?i:Math.max(r-Math.abs(i),0);for(;s<r;s++)if(s in n&&n[s]===t)return s;return e==t?0:-1},e.forEach=function(e,t,n){if(Array.prototype.forEach)return e.forEach(t,n);var r,i;if(e==null)throw new TypeError(" this is null or not defined");var s=Object(e),o=s.length>>>0;if({}.toString.call(t)!="[object Function]")throw new TypeError(t+" is not a function");n&&(r=n),i=0;while(i<o){var u;i in s&&(u=s[i],t.call(r,u,i,s)),i++}},e.Error=function(e){this.message=e,this.name="TwigException",this.type="TwigException"},e.Error.prototype.toString=function(){var e=this.name+": "+this.message;return e},e.log={trace:function(){e.trace&&console&&console.log(Array.prototype.slice.call(arguments))},debug:function(){e.debug&&console&&console.log(Array.prototype.slice.call(arguments))}},typeof console!="undefined"&&typeof console.log!="undefined"?e.log.error=function(){console.log.apply(console,arguments)}:e.log.error=function(){},e.token={},e.token.type={output:"output",logic:"logic",comment:"comment",raw:"raw"},e.token.definitions=[{type:e.token.type.raw,open:"{% raw %}",close:"{% endraw %}"},{type:e.token.type.output,open:"{{",close:"}}"},{type:e.token.type.logic,open:"{%",close:"%}"},{type:e.token.type.comment,open:"{#",close:"#}"}],e.token.strings=['"',"'"],e.token.findStart=function(t){var n={position:null,def:null},r,i,s;for(r=0;r<e.token.definitions.length;r++)i=e.token.definitions[r],s=t.indexOf(i.open),e.log.trace("Twig.token.findStart: ","Searching for ",i.open," found at ",s),s>=0&&(n.position===null||s<n.position)&&(n.position=s,n.def=i);return n},e.token.findEnd=function(t,n,r){var i=null,s=!1,o=0,u=null,a=null,f=null,l=null,c=null,h=null,p,d;while(!s){u=null,a=null,f=t.indexOf(n.close,o);if(!(f>=0))throw new e.Error("Unable to find closing bracket '"+n.close+"'"+" opened near template position "+r);i=f,s=!0;if(n.type===e.token.type.comment)break;d=e.token.strings.length;for(p=0;p<d;p+=1)c=t.indexOf(e.token.strings[p],o),c>0&&c<f&&(u===null||c<u)&&(u=c,a=e.token.strings[p]);if(u!==null){l=u+1,i=null,s=!1;for(;;){h=t.indexOf(a,l);if(h<0)throw"Unclosed string in template";if(t.substr(h-1,1)!=="\\"){o=h+1;break}l=h+1}}}return i},e.tokenize=function(t){var n=[],r=0,i=null,s=null;while(t.length>0)i=e.token.findStart(t),e.log.trace("Twig.tokenize: ","Found token: ",i),i.position!==null?(i.position>0&&n.push({type:e.token.type.raw,value:t.substring(0,i.position)}),t=t.substr(i.position+i.def.open.length),r+=i.position+i.def.open.length,s=e.token.findEnd(t,i.def,r),e.log.trace("Twig.tokenize: ","Token ends at ",s),n.push({type:i.def.type,value:t.substring(0,s).trim()}),i.def.type==="logic"&&t.substr(s+i.def.close.length,1)==="\n"&&(s+=1),t=t.substr(s+i.def.close.length),r+=s+i.def.close.length):(n.push({type:e.token.type.raw,value:t}),t="");return n},e.compile=function(t){try{var n=[],r=[],i=[],s=null,o=null,u=null,a=null,f=null,l=null,c=null,h=null,p=null;while(t.length>0){s=t.shift(),e.log.trace("Compiling token ",s);switch(s.type){case e.token.type.raw:r.length>0?i.push(s):n.push(s);break;case e.token.type.logic:o=e.logic.compile.apply(this,[s]),c=o.type,h=e.logic.handler[c].open,p=e.logic.handler[c].next,e.log.trace("Twig.compile: ","Compiled logic token to ",o," next is: ",p," open is : ",h);if(h!==undefined&&!h){a=r.pop(),f=e.logic.handler[a.type];if(e.indexOf(f.next,c)<0)throw new Error(c+" not expected after a "+a.type);a.output=a.output||[],a.output=a.output.concat(i),i=[],l={type:e.token.type.logic,token:a},r.length>0?i.push(l):n.push(l)}p!==undefined&&p.length>0?(e.log.trace("Twig.compile: ","Pushing ",o," to logic stack."),r.length>0&&(a=r.pop(),a.output=a.output||[],a.output=a.output.concat(i),r.push(a),i=[]),r.push(o)):h!==undefined&&h&&(l={type:e.token.type.logic,token:o},r.length>0?i.push(l):n.push(l));break;case e.token.type.comment:break;case e.token.type.output:e.expression.compile.apply(this,[s]),r.length>0?i.push(s):n.push(s)}e.log.trace("Twig.compile: "," Output: ",n," Logic Stack: ",r," Pending Output: ",i)}if(r.length>0)throw u=r.pop(),new Error("Unable to find an end tag for "+u.type+", expecting one of "+u.next);return n}catch(d){e.log.error("Error compiling twig template "+this.id+": "),d.stack?e.log.error(d.stack):e.log.error(d.toString());if(this.options.rethrow)throw d}},e.parse=function(t,n){try{var r=[],i=!0,s=this;return n=n||{},e.forEach(t,function(o){e.log.debug("Twig.parse: ","Parsing token: ",o);switch(o.type){case e.token.type.raw:r.push(o.value);break;case e.token.type.logic:var u=o.token,a=e.logic.parse.apply(s,[u,n,i]);a.chain!==undefined&&(i=a.chain),a.context!==undefined&&(n=a.context),a.output!==undefined&&r.push(a.output);break;case e.token.type.comment:break;case e.token.type.output:e.log.debug("Twig.parse: ","Output token: ",o.stack),r.push(e.expression.parse.apply(s,[o.stack,n]))}}),r.join("")}catch(o){e.log.error("Error parsing twig template "+this.id+": "),o.stack?e.log.error(o.stack):e.log.error(o.toString());if(this.options.rethrow)throw o;if(e.debug)return o.toString()}},e.prepare=function(t){var n,r;return e.log.debug("Twig.prepare: ","Tokenizing ",t),r=e.tokenize.apply(this,[t]),e.log.debug("Twig.prepare: ","Compiling ",r),n=e.compile.apply(this,[r]),e.log.debug("Twig.prepare: ","Compiled ",n),n},e.Templates={registry:{}},e.validateId=function(t){if(t==="prototype")throw new e.Error(t+" is not a valid twig identifier");if(e.Templates.registry.hasOwnProperty(t))throw new e.Error("There is already a template with the ID "+t);return!0},e.Templates.save=function(t){if(t.id===undefined)throw new e.Error("Unable to save template with no id");e.Templates.registry[t.id]=t},e.Templates.load=function(t){return e.Templates.registry.hasOwnProperty(t)?e.Templates.registry[t]:null},e.Templates.loadRemote=function(t,n,r,i){var s=n.id,o=n.method,u=n.async,a=n.precompiled,f=null;u===undefined&&(u=!0),s===undefined&&(s=t),n.id=s;if(e.cache&&e.Templates.registry.hasOwnProperty(s))return r&&r(e.Templates.registry[s]),e.Templates.registry[s];if(o=="ajax"){if(typeof XMLHttpRequest=="undefined")throw new e.Error("Unsupported platform: Unable to do remote requests because there is no XMLHTTPRequest implementation");var l=new XMLHttpRequest;l.onreadystatechange=function(){var s=null;l.readyState==4&&(l.status==200?(e.log.debug("Got template ",l.responseText),a===!0?s=JSON.parse(l.responseText):s=l.responseText,n.url=t,n.data=s,f=new e.Template(n),r&&r(f)):i&&i(l))},l.open("GET",t,u),l.send()}else(function(){var s=require("fs"),o=require("path"),l=null,c=function(s,o){if(s){i&&i(s);return}a===!0&&(o=JSON.parse(o)),n.data=o,n.path=t,f=new e.Template(n),r&&r(f)};if(u===!0)s.stat(t,function(n,r){if(n||!r.isFile())throw new e.Error("Unable to find template file "+t);s.readFile(t,"utf8",c)});else{if(!s.statSync(t).isFile())throw new e.Error("Unable to find template file "+t);l=s.readFileSync(t,"utf8"),c(undefined,l)}})();return u===!1?f:!0},e.Template=function(n){var r=n.data,i=n.id,s=n.blocks,o=n.macros||{},u=n.base,a=n.path,f=n.url,l=n.options;this.id=i,this.base=u,this.path=a,this.url=f,this.macros=o,this.options=l,this.reset(s),t("String",r)?this.tokens=e.prepare.apply(this,[r]):this.tokens=r,i!==undefined&&e.Templates.save(this)},e.Template.prototype.reset=function(t){e.log.debug("Twig.Template.reset","Reseting template "+this.id),this.blocks={},this.child={blocks:t||{}},this.extend=null},e.Template.prototype.render=function(t,r){r=r||{};var i,s;this.context=t||{},this.reset(),r.blocks&&(this.blocks=r.blocks),r.macros&&(this.macros=r.macros),i=e.parse.apply(this,[this.tokens,this.context]);if(this.extend){var o;return this.options.allowInlineIncludes&&(o=e.Templates.load(this.extend),o&&(o.options=this.options)),o||(s=n(this,this.extend),o=e.Templates.loadRemote(s,{method:this.url?"ajax":"fs",base:this.base,async:!1,id:s,options:this.options})),this.parent=o,this.parent.render(this.context,{blocks:this.blocks})}return r.output=="blocks"?this.blocks:r.output=="macros"?this.macros:i},e.Template.prototype.importFile=function(t){var r,i;if(!this.url&&!this.path&&this.options.allowInlineIncludes){i=e.Templates.load(t),i.options=this.options;if(i)return i;throw new e.Error("Didn't find the inline template by id")}return r=n(this,t),i=e.Templates.loadRemote(r,{method:this.url?"ajax":"fs",base:this.base,async:!1,options:this.options,id:r}),i},e.Template.prototype.importBlocks=function(t,n){var r=this.importFile(t),i=this.context,s=this,o;n=n||!1,r.render(i),e.forEach(Object.keys(r.blocks),function(e){if(n||s.blocks[e]===undefined)s.blocks[e]=r.blocks[e]})},e.Template.prototype.importMacros=function(t){var r=n(this,t),i=e.Templates.loadRemote(r,{method:this.url?"ajax":"fs",async:!1,id:r});return i},e.Template.prototype.compile=function(t){return e.compiler.compile(this,t)},e}(Twig||{});(function(){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on non-object");var t=[],n;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t})})();var Twig=function(e){e.lib={};var t=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function n(e,t){for(var n=[];t>0;n[--t]=e);return n.join("")}var r=function(){return r.cache.hasOwnProperty(arguments[0])||(r.cache[arguments[0]]=r.parse(arguments[0])),r.format.call(null,r.cache[arguments[0]],arguments)};return r.format=function(r,i){var s=1,o=r.length,u="",a,f=[],l,c,h,p,d,v;for(l=0;l<o;l++){u=e(r[l]);if(u==="string")f.push(r[l]);else if(u==="array"){h=r[l];if(h[2]){a=i[s];for(c=0;c<h[2].length;c++){if(!a.hasOwnProperty(h[2][c]))throw t('[sprintf] property "%s" does not exist',h[2][c]);a=a[h[2][c]]}}else h[1]?a=i[h[1]]:a=i[s++];if(/[^s]/.test(h[8])&&e(a)!="number")throw t("[sprintf] expecting number but found %s",e(a));switch(h[8]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":a=parseInt(a,10);break;case"e":a=h[7]?a.toExponential(h[7]):a.toExponential();break;case"f":a=h[7]?parseFloat(a).toFixed(h[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&h[7]?a.substring(0,h[7]):a;break;case"u":a=Math.abs(a);break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}a=/[def]/.test(h[8])&&h[3]&&a>=0?"+"+a:a,d=h[4]?h[4]=="0"?"0":h[4].charAt(1):" ",v=h[6]-String(a).length,p=h[6]?n(d,v):"",f.push(h[5]?a+p:p+a)}}return f.join("")},r.cache={},r.parse=function(e){var t=e,n=[],r=[],i=0;while(t){if((n=/^[^\x25]+/.exec(t))!==null)r.push(n[0]);else if((n=/^\x25{2}/.exec(t))!==null)r.push("%");else{if((n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t))===null)throw"[sprintf] huh?";if(n[2]){i|=1;var s=[],o=n[2],u=[];if((u=/^([a-z_][a-z_\d]*)/i.exec(o))===null)throw"[sprintf] huh?";s.push(u[1]);while((o=o.substring(u[0].length))!=="")if((u=/^\.([a-z_][a-z_\d]*)/i.exec(o))!==null)s.push(u[1]);else{if((u=/^\[(\d+)\]/.exec(o))===null)throw"[sprintf] huh?";s.push(u[1])}n[2]=s}else i|=2;if(i===3)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";r.push(n)}t=t.substring(n[0].length)}return r},r}(),n=function(e,n){return n.unshift(e),t.apply(null,n)};return e.lib.sprintf=t,e.lib.vsprintf=n,function(){function s(e){return(e=Math.abs(e)%100)%10==1&&e!=11?"st":e%10==2&&e!=12?"nd":e%10==3&&e!=13?"rd":"th"}function o(e){var t=new Date(e.getFullYear()+1,0,4);return(t-e)/864e5<7&&(e.getDay()+6)%7<(t.getDay()+6)%7?t.getFullYear():e.getMonth()>0||e.getDate()>=4?e.getFullYear():e.getFullYear()-((e.getDay()+6)%7-e.getDate()>2?1:0)}function u(e){var t=new Date(o(e),0,4);return t.setDate(t.getDate()-(t.getDay()+6)%7),parseInt((e-t)/6048e5)+1}var t="Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),n="Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),r="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),i="January,February,March,April,May,June,July,August,September,October,November,December".split(",");e.lib.formatDate=function(e,a){if(typeof a!="string"||/^\s*$/.test(a))return e+"";var f=new Date(e.getFullYear(),0,1),l=e;return a.replace(/[dDjlNSwzWFmMntLoYyaABgGhHisuU]/g,function(e){switch(e){case"d":return("0"+l.getDate()).replace(/^.+(..)$/,"$1");case"D":return t[l.getDay()];case"j":return l.getDate();case"l":return n[l.getDay()];case"N":return(l.getDay()+6)%7+1;case"S":return s(l.getDate());case"w":return l.getDay();case"z":return Math.ceil((f-l)/864e5);case"W":return("0"+u(l)).replace(/^.(..)$/,"$1");case"F":return i[l.getMonth()];case"m":return("0"+(l.getMonth()+1)).replace(/^.+(..)$/,"$1");case"M":return r[l.getMonth()];case"n":return l.getMonth()+1;case"t":return(new Date(l.getFullYear(),l.getMonth()+1,-1)).getDate();case"L":return(new Date(l.getFullYear(),1,29)).getDate()==29?1:0;case"o":return o(l);case"Y":return l.getFullYear();case"y":return(l.getFullYear()+"").replace(/^.+(..)$/,"$1");case"a":return l.getHours()<12?"am":"pm";case"A":return l.getHours()<12?"AM":"PM";case"B":return Math.floor(((l.getUTCHours()+1)%24+l.getUTCMinutes()/60+l.getUTCSeconds()/3600)*1e3/24);case"g":return l.getHours()%12!=0?l.getHours()%12:12;case"G":return l.getHours();case"h":return("0"+(l.getHours()%12!=0?l.getHours()%12:12)).replace(/^.+(..)$/,"$1");case"H":return("0"+l.getHours()).replace(/^.+(..)$/,"$1");case"i":return("0"+l.getMinutes()).replace(/^.+(..)$/,"$1");case"s":return("0"+l.getSeconds()).replace(/^.+(..)$/,"$1");case"u":return l.getMilliseconds();case"U":return l.getTime()/1e3}})}}(),e.lib.strip_tags=function(e,t){t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var n=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,r=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;return e.replace(r,"").replace(n,function(e,n){return t.indexOf("<"+n.toLowerCase()+">")>-1?e:""})},e.lib.parseISO8601Date=function(e){var t=/(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(\.\d+)?(Z|([+-])(\d\d):(\d\d))/,n=[];n=e.match(t);if(!n)throw"Couldn't parse ISO 8601 date string '"+e+"'";var r=[1,2,3,4,5,6,10,11];for(var i in r)n[r[i]]=parseInt(n[r[i]],10);n[7]=parseFloat(n[7]);var s=Date.UTC(n[1],n[2]-1,n[3],n[4],n[5],n[6]);n[7]>0&&(s+=Math.round(n[7]*1e3));if(n[8]!="Z"&&n[10]){var o=n[10]*60*60*1e3;n[11]&&(o+=n[11]*60*1e3),n[9]=="-"?s-=o:s+=o}return new Date(s)},e.lib.strtotime=function(t,n){var r,i,s,o,u="";t=t.replace(/\s{2,}|^\s|\s$/g," "),t=t.replace(/[\t\r\n]/g,"");if(t==="now")return n===null||isNaN(n)?(new Date).getTime()/1e3|0:n|0;if(!isNaN(u=Date.parse(t)))return u/1e3|0;n?n=new Date(n*1e3):n=new Date;var a=t;t=t.toLowerCase();var f={day:{sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},mon:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"]},l=function(e){var t=e[2]&&e[2]==="ago",r=(r=e[0]==="last"?-1:1)*(t?-1:1);switch(e[0]){case"last":case"next":switch(e[1].substring(0,3)){case"yea":n.setFullYear(n.getFullYear()+r);break;case"wee":n.setDate(n.getDate()+r*7);break;case"day":n.setDate(n.getDate()+r);break;case"hou":n.setHours(n.getHours()+r);break;case"min":n.setMinutes(n.getMinutes()+r);break;case"sec":n.setSeconds(n.getSeconds()+r);break;case"mon":if(e[1]==="month"){n.setMonth(n.getMonth()+r);break};default:var i=f.day[e[1].substring(0,3)];if(typeof i!="undefined"){var s=i-n.getDay();s===0?s=7*r:s>0?e[0]==="last"&&(s-=7):e[0]==="next"&&(s+=7),n.setDate(n.getDate()+s),n.setHours(0,0,0,0)}}break;default:if(!/\d+/.test(e[0]))return!1;r*=parseInt(e[0],10);switch(e[1].substring(0,3)){case"yea":n.setFullYear(n.getFullYear()+r);break;case"mon":n.setMonth(n.getMonth()+r);break;case"wee":n.setDate(n.getDate()+r*7);break;case"day":n.setDate(n.getDate()+r);break;case"hou":n.setHours(n.getHours()+r);break;case"min":n.setMinutes(n.getMinutes()+r);break;case"sec":n.setSeconds(n.getSeconds()+r)}}return!0};s=t.match(/^(\d{2,4}-\d{2}-\d{2})(?:\s(\d{1,2}:\d{2}(:\d{2})?)?(?:\.(\d+))?)?$/);if(s!==null)return s[2]?s[3]||(s[2]+=":00"):s[2]="00:00:00",o=s[1].split(/-/g),o[1]=f.mon[o[1]-1]||o[1],o[0]=+o[0],o[0]=o[0]>=0&&o[0]<=69?"20"+(o[0]<10?"0"+o[0]:o[0]+""):o[0]>=70&&o[0]<=99?"19"+o[0]:o[0]+"",parseInt(this.strtotime(o[2]+" "+o[1]+" "+o[0]+" "+s[2])+(s[4]?s[4]/1e3:""),10);var c="([+-]?\\d+\\s(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday)|(last|next)\\s(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday))(\\sago)?";s=t.match(new RegExp(c,"gi"));if(s===null){try{num=e.lib.parseISO8601Date(a);if(num)return num/1e3|0}catch(h){return!1}return!1}for(r=0,i=s.length;r<i;r++)if(!l(s[r].split(" ")))return!1;return n.getTime()/1e3|0},e.lib.is=function(e,t){var n=Object.prototype.toString.call(t).slice(8,-1);return t!==undefined&&t!==null&&n===e},e.lib.copy=function(e){var t={},n;for(n in e)t[n]=e[n];return t},e.lib.replaceAll=function(e,t,n){return e.split(t).join(n)},e.lib.chunkArray=function(t,n){var r=[],i=0,s=t.length;if(n<1||!e.lib.is("Array",t))return[];while(i<s)r.push(t.slice(i,i+=n));return r},e.lib.round=function(t,n,r){var i,s,o,u;n|=0,i=Math.pow(10,n),t*=i,u=t>0|-(t<0),o=t%1===.5*u,s=Math.floor(t);if(o)switch(r){case"PHP_ROUND_HALF_DOWN":t=s+(u<0);break;case"PHP_ROUND_HALF_EVEN":t=s+s%2*u;break;case"PHP_ROUND_HALF_ODD":t=s+!(s%2);break;default:t=s+(u>0)}return(o?t:Math.round(t))/i},e}(Twig||{}),Twig=function(e){e.logic={},e.logic.type={if_:"Twig.logic.type.if",endif:"Twig.logic.type.endif",for_:"Twig.logic.type.for",endfor:"Twig.logic.type.endfor",else_:"Twig.logic.type.else",elseif:"Twig.logic.type.elseif",set:"Twig.logic.type.set",setcapture:"Twig.logic.type.setcapture",endset:"Twig.logic.type.endset",filter:"Twig.logic.type.filter",endfilter:"Twig.logic.type.endfilter",block:"Twig.logic.type.block",endblock:"Twig.logic.type.endblock",extends_:"Twig.logic.type.extends",use:"Twig.logic.type.use",include:"Twig.logic.type.include",spaceless:"Twig.logic.type.spaceless",endspaceless:"Twig.logic.type.endspaceless",macro:"Twig.logic.type.macro",endmacro:"Twig.logic.type.endmacro",import_:"Twig.logic.type.import",from:"Twig.logic.type.from"},e.logic.definitions=[{type:e.logic.type.if_,regex:/^if\s+([^\s].+)$/,next:[e.logic.type.else_,e.logic.type.elseif,e.logic.type.endif],open:!0,compile:function(t){var n=t.match[1];return t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,delete t.match,t},parse:function(t,n,r){var i="",s=e.expression.parse.apply(this,[t.stack,n]);return r=!0,s&&(r=!1,i=e.parse.apply(this,[t.output,n])),{chain:r,output:i}}},{type:e.logic.type.elseif,regex:/^elseif\s+([^\s].*)$/,next:[e.logic.type.else_,e.logic.type.elseif,e.logic.type.endif],open:!1,compile:function(t){var n=t.match[1];return t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,delete t.match,t},parse:function(t,n,r){var i="";return r&&e.expression.parse.apply(this,[t.stack,n])===!0&&(r=!1,i=e.parse.apply(this,[t.output,n])),{chain:r,output:i}}},{type:e.logic.type.else_,regex:/^else$/,next:[e.logic.type.endif,e.logic.type.endfor],open:!1,parse:function(t,n,r){var i="";return r&&(i=e.parse.apply(this,[t.output,n])),{chain:r,output:i}}},{type:e.logic.type.endif,regex:/^endif$/,next:[],open:!1},{type:e.logic.type.for_,regex:/^for\s+([a-zA-Z0-9_,\s]+)\s+in\s+([^\s].*?)(?:\s+if\s+([^\s].*))?$/,next:[e.logic.type.else_,e.logic.type.endfor],open:!0,compile:function(t){var n=t.match[1],r=t.match[2],i=t.match[3],s=null;t.key_var=null,t.value_var=null;if(n.indexOf(",")>=0){s=n.split(",");if(s.length!==2)throw new e.Error("Invalid expression in for loop: "+n);t.key_var=s[0].trim(),t.value_var=s[1].trim()}else t.value_var=n;return t.expression=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:r}]).stack,i&&(t.conditional=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:i}]).stack),delete t.match,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.expression,n]),s=[],o,u=0,a,f=this,l=t.conditional,c=function(e,t){var r=l!==undefined;return{index:e+1,index0:e,revindex:r?undefined:t-e,revindex0:r?undefined:t-e-1,first:e===0,last:r?undefined:e===t-1,length:r?undefined:t,parent:n}},h=function(r,i){var a=e.lib.copy(n);a[t.value_var]=i,t.key_var&&(a[t.key_var]=r),a.loop=c(u,o);if(l===undefined||e.expression.parse.apply(f,[l,a]))s.push(e.parse.apply(f,[t.output,a])),u+=1};return i instanceof Array?(o=i.length,e.forEach(i,function(e){var t=u;h(t,e)})):i instanceof Object&&(i._keys!==undefined?a=i._keys:a=Object.keys(i),o=a.length,e.forEach(a,function(e){if(e==="_keys")return;h(e,i[e])})),r=s.length===0,{chain:r,output:s.join("")}}},{type:e.logic.type.endfor,regex:/^endfor$/,next:[],open:!1},{type:e.logic.type.set,regex:/^set\s+([a-zA-Z0-9_,\s]+)\s*=\s*(.+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim(),r=t.match[2],i=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:r}]).stack;return t.key=n,t.expression=i,delete t.match,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.expression,n]),s=t.key;return this.context[s]=i,n[s]=i,{chain:r,context:n}}},{type:e.logic.type.setcapture,regex:/^set\s+([a-zA-Z0-9_,\s]+)$/,next:[e.logic.type.endset],open:!0,compile:function(e){var t=e.match[1].trim();return e.key=t,delete e.match,e},parse:function(t,n,r){var i=e.parse.apply(this,[t.output,n]),s=t.key;return this.context[s]=i,n[s]=i,{chain:r,context:n}}},{type:e.logic.type.endset,regex:/^endset$/,next:[],open:!1},{type:e.logic.type.filter,regex:/^filter\s+(.+)$/,next:[e.logic.type.endfilter],open:!0,compile:function(t){var n="|"+t.match[1].trim();return t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,delete t.match,t},parse:function(t,n,r){var i=e.parse.apply(this,[t.output,n]),s=[{type:e.expression.type.string,value:i}].concat(t.stack),o=e.expression.parse.apply(this,[s,n]);return{chain:r,output:o}}},{type:e.logic.type.endfilter,regex:/^endfilter$/,next:[],open:!1},{type:e.logic.type.block,regex:/^block\s+([a-zA-Z0-9_]+)$/,next:[e.logic.type.endblock],open:!0,compile:function(e){return e.block=e.match[1].trim(),delete e.match,e},parse:function(t,n,r){var i="",s="",o=this.blocks[t.block]&&this.blocks[t.block].indexOf(e.placeholders.parent)>-1;if(this.blocks[t.block]===undefined||o||n.loop)i=e.expression.parse.apply(this,[{type:e.expression.type.string,value:e.parse.apply(this,[t.output,n])},n]),o?this.blocks[t.block]=this.blocks[t.block].replace(e.placeholders.parent,i):this.blocks[t.block]=i;return this.child.blocks[t.block]?s=this.child.blocks[t.block]:s=this.blocks[t.block],{chain:r,output:s}}},{type:e.logic.type.endblock,regex:/^endblock(?:\s+([a-zA-Z0-9_]+))?$/,next:[],open:!1},{type:e.logic.type.extends_,regex:/^extends\s+(.+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim();return delete t.match,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.stack,n]);return this.extend=i,{chain:r,output:""}}},{type:e.logic.type.use,regex:/^use\s+(.+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim();return delete t.match,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.stack,n]);return this.importBlocks(i),{chain:r,output:""}}},{type:e.logic.type.include,regex:/^include\s+(ignore missing\s+)?(.+?)\s*(?:with\s+(.+?))?\s*(only)?$/,next:[],open:!0,compile:function(t){var n=t.match,r=n[1]!==undefined,i=n[2].trim(),s=n[3],o=n[4]!==undefined&&n[4].length;return delete t.match,t.only=o,t.includeMissing=r,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:i}]).stack,s!==undefined&&(t.withStack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:s.trim()}]).stack),t},parse:function(t,n,r){var i={},s,o,u;if(!t.only)for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);if(t.withStack!==undefined){s=e.expression.parse.apply(this,[t.withStack,n]);for(o in s)s.hasOwnProperty(o)&&(i[o]=s[o])}var a=e.expression.parse.apply(this,[t.stack,i]);return u=this.importFile(a),{chain:r,output:u.render(i)}}},{type:e.logic.type.spaceless,regex:/^spaceless$/,next:[e.logic.type.endspaceless],open:!0,parse:function(t,n,r){var i=e.parse.apply(this,[t.output,n]),s=/>\s+</g,o=i.replace(s,"><").trim();return{chain:r,output:o}}},{type:e.logic.type.endspaceless,regex:/^endspaceless$/,next:[],open:!1},{type:e.logic.type.macro,regex:/^macro\s+([a-zA-Z0-9_]+)\s?\((([a-zA-Z0-9_]+(,\s?)?)*)\)$/,next:[e.logic.type.endmacro],open:!0,compile:function(t){var n=t.match[1],r=t.match[2].split(/[ ,]+/);for(var i=0;i<r.length;i++)for(var s=0;s<r.length;s++)if(r[i]===r[s]&&i!==s)throw new e.Error("Duplicate arguments for parameter: "+r[i]);return t.macroName=n,t.parameters=r,delete t.match,t},parse:function(t,n,r){var i=this;return this.macros[t.macroName]=function(){var n={_self:i.macros};for(var r=0;r<t.parameters.length;r++){var s=t.parameters[r];typeof arguments[r]!="undefined"?n[s]=arguments[r]:n[s]=undefined}return e.parse.apply(i,[t.output,n])},{chain:r,output:""}}},{type:e.logic.type.endmacro,regex:/^endmacro$/,next:[],open:!1},{type:e.logic.type.import_,regex:/^import\s+(.+)\s+as\s+([a-zA-Z0-9_]+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim(),r=t.match[2].trim();return delete t.match,t.expression=n,t.contextName=r,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){if(t.expression!=="_self"){var i=e.expression.parse.apply(this,[t.stack,n]),s=this.importMacros(i||t.expression);n[t.contextName]=s.render({},{output:"macros"})}else n[t.contextName]=this.macros;return{chain:r,output:""}}},{type:e.logic.type.from,regex:/^from\s+(.+)\s+import\s+([a-zA-Z0-9_, ]+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim(),r=t.match[2].trim().split(/[ ,]+/),i={};for(var s=0;s<r.length;s++){var o=r[s],u=o.match(/^([a-zA-Z0-9_]+)\s+(.+)\s+as\s+([a-zA-Z0-9_]+)$/);u?i[u[1].trim()]=u[2].trim():o.match(/^([a-zA-Z0-9_]+)$/)&&(i[o]=o)}return delete t.match,t.expression=n,t.macroNames=i,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){var i;if(t.expression!=="_self"){var s=e.expression.parse.apply(this,[t.stack,n]),o=this.importMacros(s||t.expression);i=o.render({},{output:"macros"})}else i=this.macros;for(var u in t.macroNames)i.hasOwnProperty(u)&&(n[t.macroNames[u]]=i[u]);return{chain:r,output:""}}}],e.logic.handler={},e.logic.extendType=function(t,n){n=n||"Twig.logic.type"+t,e.logic.type[t]=n},e.logic.extend=function(t){if(!t.type)throw new e.Error("Unable to extend logic definition. No type provided for "+t);if(e.logic.type[t.type])throw new e.Error("Unable to extend logic definitions. Type "+t.type+" is already defined.");e.logic.extendType(t.type),e.logic.handler[t.type]=t};while(e.logic.definitions.length>0)e.logic.extend(e.logic.definitions.shift());return e.logic.compile=function(t){var n=t.value.trim(),r=e.logic.tokenize.apply(this,[n]),i=e.logic.handler[r.type];return i.compile&&(r=i.compile.apply(this,[r]),e.log.trace("Twig.logic.compile: ","Compiled logic token to ",r)),r},e.logic.tokenize=function(t){var n={},r=null,i=null,s=null,o=null,u=null,a=null;t=t.trim();for(r in e.logic.handler)if(e.logic.handler.hasOwnProperty(r)){i=e.logic.handler[r].type,s=e.logic.handler[r].regex,o=[],s instanceof Array?o=s:o.push(s);while(o.length>0){u=o.shift(),a=u.exec(t.trim());if(a!==null)return n.type=i,n.match=a,e.log.trace("Twig.logic.tokenize: ","Matched a ",i," regular expression of ",a),n}}throw new e.Error("Unable to parse '"+t.trim()+"'")},e.logic.parse=function(t,n,r){var i="",s;return n=n||{},e.log.debug("Twig.logic.parse: ","Parsing logic token ",t),s=e.logic.handler[t.type],s.parse&&(i=s.parse.apply(this,[t,n,r])),i},e}(Twig||{}),Twig=function(e){e.expression={},e.expression.reservedWords=["true","false","null","_context"],e.expression.type={comma:"Twig.expression.type.comma",operator:{unary:"Twig.expression.type.operator.unary",binary:"Twig.expression.type.operator.binary"},string:"Twig.expression.type.string",bool:"Twig.expression.type.bool",array:{start:"Twig.expression.type.array.start",end:"Twig.expression.type.array.end"},object:{start:"Twig.expression.type.object.start",end:"Twig.expression.type.object.end"},parameter:{start:"Twig.expression.type.parameter.start",end:"Twig.expression.type.parameter.end"},key:{period:"Twig.expression.type.key.period",brackets:"Twig.expression.type.key.brackets"},filter:"Twig.expression.type.filter",_function:"Twig.expression.type._function",variable:"Twig.expression.type.variable",number:"Twig.expression.type.number",_null:"Twig.expression.type.null",context:"Twig.expression.type.context",test:"Twig.expression.type.test"},e.expression.set={operations:[e.expression.type.filter,e.expression.type.operator.unary,e.expression.type.operator.binary,e.expression.type.array.end,e.expression.type.object.end,e.expression.type.parameter.end,e.expression.type.comma,e.expression.type.test],expressions:[e.expression.type._function,e.expression.type.bool,e.expression.type.string,e.expression.type.variable,e.expression.type.number,e.expression.type._null,e.expression.type.context,e.expression.type.parameter.start,e.expression.type.array.start,e.expression.type.object.start]},e.expression.set.operations_extended=e.expression.set.operations.concat([e.expression.type.key.period,e.expression.type.key.brackets]),e.expression.fn={compile:{push:function(e,t,n){n.push(e)},push_both:function(e,t,n){n.push(e),t.push(e)}},parse:{push:function(e,t,n){t.push(e)},push_value:function(e,t,n){t.push(e.value)}}},e.expression.definitions=[{type:e.expression.type.test,regex:/^is\s+(not)?\s*([a-zA-Z_][a-zA-Z0-9_]*)/,next:e.expression.set.operations.concat([e.expression.type.parameter.start]),compile:function(e,t,n){e.filter=e.match[2],e.modifier=e.match[1],delete e.match,delete e.value,n.push(e)},parse:function(t,n,r){var i=n.pop(),s=t.params&&e.expression.parse.apply(this,[t.params,r]),o=e.test(t.filter,i,s);t.modifier=="not"?n.push(!o):n.push(o)}},{type:e.expression.type.comma,regex:/^,/,next:e.expression.set.expressions.concat([e.expression.type.array.end,e.expression.type.object.end]),compile:function(t,n,r){var i=n.length-1,s;delete t.match,delete t.value;for(;i>=0;i--){s=n.pop();if(s.type===e.expression.type.object.start||s.type===e.expression.type.parameter.start||s.type===e.expression.type.array.start){n.push(s);break}r.push(s)}r.push(t)}},{type:e.expression.type.operator.binary,regex:/(^[\+\-~%\?\:]|^[!=]==?|^[!<>]=?|^\*\*?|^\/\/?|^and\s+|^or\s+|^in\s+|^not in\s+|^\.\.)/,next:e.expression.set.expressions.concat([e.expression.type.operator.unary]),compile:function(t,n,r){delete t.match,t.value=t.value.trim();var i=t.value,s=e.expression.operator.lookup(i,t);e.log.trace("Twig.expression.compile: ","Operator: ",s," from ",i);while(n.length>0&&(n[n.length-1].type==e.expression.type.operator.unary||n[n.length-1].type==e.expression.type.operator.binary)&&(s.associativity===e.expression.operator.leftToRight&&s.precidence>=n[n.length-1].precidence||s.associativity===e.expression.operator.rightToLeft&&s.precidence>n[n.length-1].precidence)){var o=n.pop();r.push(o)}if(i===":"){if(!n[n.length-1]||n[n.length-1].value!=="?"){var u=r.pop();if(u.type!==e.expression.type.string&&u.type!==e.expression.type.variable&&u.type!==e.expression.type.number)throw new e.Error("Unexpected value before ':' of "+u.type+" = "+u.value);t.key=u.value,r.push(t);return}}else n.push(s)},parse:function(t,n,r){t.key?n.push(t):e.expression.operator.parse(t.value,n)}},{type:e.expression.type.operator.unary,regex:/(^not\s+)/,next:e.expression.set.expressions,compile:function(t,n,r){delete t.match,t.value=t.value.trim();var i=t.value,s=e.expression.operator.lookup(i,t);e.log.trace("Twig.expression.compile: ","Operator: ",s," from ",i);while(n.length>0&&(n[n.length-1].type==e.expression.type.operator.unary||n[n.length-1].type==e.expression.type.operator.binary)&&(s.associativity===e.expression.operator.leftToRight&&s.precidence>=n[n.length-1].precidence||s.associativity===e.expression.operator.rightToLeft&&s.precidence>n[n.length-1].precidence)){var o=n.pop();r.push(o)}n.push(s)},parse:function(t,n,r){e.expression.operator.parse(t.value,n)}},{type:e.expression.type.string,regex:/^(["'])(?:(?=(\\?))\2.)*?\1/,next:e.expression.set.operations,compile:function(t,n,r){var i=t.value;delete t.match,i.substring(0,1)==='"'?i=i.replace('\\"','"'):i=i.replace("\\'","'"),t.value=i.substring(1,i.length-1).replace(/\\n/g,"\n").replace(/\\r/g,"\r"),e.log.trace("Twig.expression.compile: ","String value: ",t.value),r.push(t)},parse:e.expression.fn.parse.push_value},{type:e.expression.type.parameter.start,regex:/^\(/,next:e.expression.set.expressions.concat([e.expression.type.parameter.end]),compile:e.expression.fn.compile.push_both,parse:e.expression.fn.parse.push},{type:e.expression.type.parameter.end,regex:/^\)/,next:e.expression.set.operations_extended,compile:function(t,n,r){var i,s=t;i=n.pop();while(n.length>0&&i.type!=e.expression.type.parameter.start)r.push(i),i=n.pop();var o=[];while(t.type!==e.expression.type.parameter.start)o.unshift(t),t=r.pop();o.unshift(t);var u=!1;t=r[r.length-1],t===undefined||t.type!==e.expression.type._function&&t.type!==e.expression.type.filter&&t.type!==e.expression.type.test&&t.type!==e.expression.type.key.brackets&&t.type!==e.expression.type.key.period?(s.expression=!0,o.pop(),o.shift(),s.params=o,r.push(s)):(s.expression=!1,t.params=o)},parse:function(t,n,r){var i=[],s=!1,o=null;if(t.expression)o=e.expression.parse.apply(this,[t.params,r]),n.push(o);else{while(n.length>0){o=n.pop();if(o&&o.type&&o.type==e.expression.type.parameter.start){s=!0;break}i.unshift(o)}if(!s)throw new e.Error("Expected end of parameter set.");n.push(i)}}},{type:e.expression.type.array.start,regex:/^\[/,next:e.expression.set.expressions.concat([e.expression.type.array.end]),compile:e.expression.fn.compile.push_both,parse:e.expression.fn.parse.push},{type:e.expression.type.array.end,regex:/^\]/,next:e.expression.set.operations_extended,compile:function(t,n,r){var i=n.length-1,s;for(;i>=0;i--){s=n.pop();if(s.type===e.expression.type.array.start)break;r.push(s)}r.push(t)},parse:function(t,n,r){var i=[],s=!1,o=null;while(n.length>0){o=n.pop();if(o.type&&o.type==e.expression.type.array.start){s=!0;break}i.unshift(o)}if(!s)throw new e.Error("Expected end of array.");n.push(i)}},{type:e.expression.type.object.start,regex:/^\{/,next:e.expression.set.expressions.concat([e.expression.type.object.end]),compile:e.expression.fn.compile.push_both,parse:e.expression.fn.parse.push},{type:e.expression.type.object.end,regex:/^\}/,next:e.expression.set.operations_extended,compile:function(t,n,r){var i=n.length-1,s;for(;i>=0;i--){s=n.pop();if(s&&s.type===e.expression.type.object.start)break;r.push(s)}r.push(t)},parse:function(t,n,r){var i={},s=!1,o=null,u=null,a=!1,f=null;while(n.length>0){o=n.pop();if(o&&o.type&&o.type===e.expression.type.object.start){s=!0;break}if(o&&o.type&&(o.type===e.expression.type.operator.binary||o.type===e.expression.type.operator.unary)&&o.key){if(!a)throw new e.Error("Missing value for key '"+o.key+"' in object definition.");i[o.key]=f,i._keys===undefined&&(i._keys=[]),i._keys.unshift(o.key),f=null,a=!1}else a=!0,f=o}if(!s)throw new e.Error("Unexpected end of object.");n.push(i)}},{type:e.expression.type.filter,regex:/^\|\s?([a-zA-Z_][a-zA-Z0-9_\-]*)/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:function(e,t,n){e.value=e.match[1],n.push(e)},parse:function(t,n,r){var i=n.pop(),s=t.params&&e.expression.parse.apply(this,[t.params,r]);n.push(e.filter.apply(this,[t.value,i,s]))}},{type:e.expression.type._function,regex:/^([a-zA-Z_][a-zA-Z0-9_]*)\s*\(/,next:e.expression.type.parameter.start,transform:function(e,t){return"("},compile:function(e,t,n){var r=e.match[1];e.fn=r,delete e.match,delete e.value,n.push(e)},parse:function(t,n,r){var i=t.params&&e.expression.parse.apply(this,[t.params,r]),s=t.fn,o;if(e.functions[s])o=e.functions[s].apply(this,i);else{if(typeof r[s]!="function")throw new e.Error(s+" function does not exist and is not defined in the context");o=r[s].apply(r,i)}n.push(o)}},{type:e.expression.type.variable,regex:/^[a-zA-Z_][a-zA-Z0-9_]*/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,validate:function(t,n){return e.indexOf(e.expression.reservedWords,t[0])<0},parse:function(t,n,r){var i=e.expression.resolve(r[t.value],r);n.push(i)}},{type:e.expression.type.key.period,regex:/^\.([a-zA-Z0-9_]+)/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:function(e,t,n){e.key=e.match[1],delete e.match,delete e.value,n.push(e)},parse:function(t,n,r){var i=t.params&&e.expression.parse.apply(this,[t.params,r]),s=t.key,o=n.pop(),u;if(o===null||o===undefined){if(this.options.strict_variables)throw new e.Error("Can't access a key "+s+" on an null or undefined object.");return null}var a=function(e){return e.substr(0,1).toUpperCase()+e.substr(1)};typeof o=="object"&&s in o?u=o[s]:o["get"+a(s)]!==undefined?u=o["get"+a(s)]:o["is"+a(s)]!==undefined?u=o["is"+a(s)]:u=null,n.push(e.expression.resolve(u,o,i))}},{type:e.expression.type.key.brackets,regex:/^\[([^\]]*)\]/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:function(t,n,r){var i=t.match[1];delete t.value,delete t.match,t.stack=e.expression.compile({value:i}).stack,r.push(t)},parse:function(t,n,r){var i=t.params&&e.expression.parse.apply(this,[t.params,r]),s=e.expression.parse.apply(this,[t.stack,r]),o=n.pop(),u;if(o===null||o===undefined){if(this.options.strict_variables)throw new e.Error("Can't access a key "+s+" on an null or undefined object.");return null}typeof o=="object"&&s in o?u=o[s]:u=null,n.push(e.expression.resolve(u,o,i))}},{type:e.expression.type._null,regex:/^null/,next:e.expression.set.operations,compile:function(e,t,n){delete e.match,e.value=null,n.push(e)},parse:e.expression.fn.parse.push_value},{type:e.expression.type.context,regex:/^_context/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,parse:function(e,t,n){t.push(n)}},{type:e.expression.type.number,regex:/^\-?\d+(\.\d+)?/,next:e.expression.set.operations,compile:function(e,t,n){e.value=Number(e.value),n.push(e)},parse:e.expression.fn.parse.push_value},{type:e.expression.type.bool,regex:/^(true|false)/,next:e.expression.set.operations,compile:function(e,t,n){e.value=e.match[0]=="true",delete e.match,n.push(e)},parse:e.expression.fn.parse.push_value}],e.expression.resolve=function(e,t,n){return typeof e=="function"?e.apply(t,n||[]):e},e.expression.handler={},e.expression.extendType=function(t){e.expression.type[t]="Twig.expression.type."+t},e.expression.extend=function(t){if(!t.type)throw new e.Error("Unable to extend logic definition. No type provided for "+t);e.expression.handler[t.type]=t};while(e.expression.definitions.length>0)e.expression.extend(e.expression.definitions.shift());return e.expression.tokenize=function(t){var n=[],r=0,i=null,s,o,u,a,f,l=[],c;c=function(){var t=Array.prototype.slice.apply(arguments),o=t.pop(),u=t.pop();return e.log.trace("Twig.expression.tokenize","Matched a ",s," regular expression of ",t),i&&e.indexOf(i,s)<0?(l.push(s+" cannot follow a "+n[n.length-1].type+" at template:"+r+" near '"+t[0].substring(0,20)+"...'"),t[0]):e.expression.handler[s].validate&&!e.expression.handler[s].validate(t,n)?t[0]:(l=[],n.push({type:s,value:t[0],match:t}),f=!0,i=a,r+=t[0].length,e.expression.handler[s].transform?e.expression.handler[s].transform(t,n):"")},e.log.debug("Twig.expression.tokenize","Tokenizing expression ",t);while(t.length>0){t=t.trim();for(s in e.expression.handler)if(e.expression.handler.hasOwnProperty(s)){a=e.expression.handler[s].next,o=e.expression.handler[s].regex,o instanceof Array?u=o:u=[o],f=!1;while(u.length>0)o=u.pop(),t=t.replace(o,c);if(f)break}if(!f)throw l.length>0?new e.Error(l.join(" OR ")):new e.Error("Unable to parse '"+t+"' at template position"+r)}return e.log.trace("Twig.expression.tokenize","Tokenized to ",n),n},e.expression.compile=function(t){var n=t.value,r=e.expression.tokenize(n),i=null,s=[],o=[],u=null;e.log.trace("Twig.expression.compile: ","Compiling ",n);while(r.length>0)i=r.shift(),u=e.expression.handler[i.type],e.log.trace("Twig.expression.compile: ","Compiling ",i),u.compile&&u.compile(i,o,s),e.log.trace("Twig.expression.compile: ","Stack is",o),e.log.trace("Twig.expression.compile: ","Output is",s);while(o.length>0)s.push(o.pop());return e.log.trace("Twig.expression.compile: ","Final output is",s),t.stack=s,delete t.value,t},e.expression.parse=function(t,n){var r=this;t instanceof Array||(t=[t]);var i=[],s=null;return e.forEach(t,function(t){s=e.expression.handler[t.type],s.parse&&s.parse.apply(r,[t,i,n])}),i.pop()},e}(Twig||{}),Twig=function(e){e.expression.operator={leftToRight:"leftToRight",rightToLeft:"rightToLeft"};var t=function(e,t){if(t.indexOf!==undefined)return e===t||e!==""&&t.indexOf(e)>-1;var n;for(n in t)if(t.hasOwnProperty(n)&&t[n]===e)return!0;return!1};return e.expression.operator.lookup=function(t,n){switch(t){case"..":case"not in":case"in":n.precidence=20,n.associativity=e.expression.operator.leftToRight;break;case",":n.precidence=18,n.associativity=e.expression.operator.leftToRight;break;case"?":case":":n.precidence=16,n.associativity=e.expression.operator.rightToLeft;break;case"or":n.precidence=14,n.associativity=e.expression.operator.leftToRight;break;case"and":n.precidence=13,n.associativity=e.expression.operator.leftToRight;break;case"==":case"!=":n.precidence=9,n.associativity=e.expression.operator.leftToRight;break;case"<":case"<=":case">":case">=":n.precidence=8,n.associativity=e.expression.operator.leftToRight;break;case"~":case"+":case"-":n.precidence=6,n.associativity=e.expression.operator.leftToRight;break;case"//":case"**":case"*":case"/":case"%":n.precidence=5,n.associativity=e.expression.operator.leftToRight;break;case"not":n.precidence=3,n.associativity=e.expression.operator.rightToLeft;break;default:throw new e.Error(t+" is an unknown operator.")}return n.operator=t,n},e.expression.operator.parse=function(n,r){e.log.trace("Twig.expression.operator.parse: ","Handling ",n);var i,s,o;switch(n){case":":break;case"?":o=r.pop(),s=r.pop(),i=r.pop(),i?r.push(s):r.push(o);break;case"+":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(i+s);break;case"-":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(i-s);break;case"*":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(i*s);break;case"/":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(i/s);break;case"//":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(parseInt(i/s));break;case"%":s=parseFloat(r.pop()),i=parseFloat(r.pop()),r.push(i%s);break;case"~":s=r.pop(),i=r.pop(),r.push((i!==undefined?i.toString():"")+(s!==undefined?s.toString():""));break;case"not":case"!":r.push(!r.pop());break;case"<":s=r.pop(),i=r.pop(),r.push(i<s);break;case"<=":s=r.pop(),i=r.pop(),r.push(i<=s);break;case">":s=r.pop(),i=r.pop(),r.push(i>s);break;case">=":s=r.pop(),i=r.pop(),r.push(i>=s);break;case"===":s=r.pop(),i=r.pop(),r.push(i===s);break;case"==":s=r.pop(),i=r.pop(),r.push(i==s);break;case"!==":s=r.pop(),i=r.pop(),r.push(i!==s);break;case"!=":s=r.pop(),i=r.pop(),r.push(i!=s);break;case"or":s=r.pop(),i=r.pop(),r.push(i||s);break;case"and":s=r.pop(),i=r.pop(),r.push(i&&s);break;case"**":s=r.pop(),i=r.pop(),r.push(Math.pow(i,s));break;case"not in":s=r.pop(),i=r.pop(),r.push(!t(i,s));break;case"in":s=r.pop(),i=r.pop(),r.push(t(i,s));break;case"..":s=r.pop(),i=r.pop(),r.push(e.functions.range(i,s));break;default:throw new e.Error(n+" is an unknown operator.")}},e}(Twig||{}),Twig=function(e){function t(e,t){var n=Object.prototype.toString.call(t).slice(8,-1);return t!==undefined&&t!==null&&n===e}return e.filters={upper:function(e){return typeof e!="string"?e:e.toUpperCase()},lower:function(e){return typeof e!="string"?e:e.toLowerCase()},capitalize:function(e){return typeof e!="string"?e:e.substr(0,1).toUpperCase()+e.toLowerCase().substr(1)},title:function(e){return typeof e!="string"?e:e.toLowerCase().replace(/(^|\s)([a-z])/g,function(e,t,n){return t+n.toUpperCase()})},length:function(t){return e.lib.is("Array",t)||typeof t=="string"?t.length:e.lib.is("Object",t)?t._keys===undefined?Object.keys(t).length:t._keys.length:0},reverse:function(e){if(t("Array",e))return e.reverse();if(t("String",e))return e.split("").reverse().join("");if(e instanceof Object){var n=e._keys||Object.keys(e).reverse();return e._keys=n,e}},sort:function(e){if(t("Array",e))return e.sort();if(e instanceof Object){delete e._keys;var n=Object.keys(e),r=n.sort(function(t,n){return e[t]>e[n]});return e._keys=r,e}},keys:function(t){if(t===undefined||t===null)return;var n=t._keys||Object.keys(t),r=[];return e.forEach(n,function(e){if(e==="_keys")return;t.hasOwnProperty(e)&&r.push(e)}),r},url_encode:function(e){if(e===undefined||e===null)return;return encodeURIComponent(e)},join:function(t,n){if(t===undefined||t===null)return;var r="",i=[],s=null;return n&&n[0]&&(r=n[0]),t instanceof Array?i=t:(s=t._keys||Object.keys(t),e.forEach(s,function(e){if(e==="_keys")return;t.hasOwnProperty(e)&&i.push(t[e])})),i.join(r)},"default":function(t,n){if(n===undefined||n.length!==1)throw new e.Error("default filter expects one argument");return t===undefined||t===null||t===""?n[0]:t},json_encode:function(e){return e&&e.hasOwnProperty("_keys")&&delete e._keys,e===undefined||e===null?"null":JSON.stringify(e)},merge:function(t,n){var r=[],i=0,s=[];t instanceof Array?e.forEach(n,function(e){e instanceof Array||(r={})}):r={},r instanceof Array||(r._keys=[]),t instanceof Array?e.forEach(t,function(e){r._keys&&r._keys.push(i),r[i]=e,i++}):(s=t._keys||Object.keys(t),e.forEach(s,function(e){r[e]=t[e],r._keys.push(e);var n=parseInt(e,10);!isNaN(n)&&n>=i&&(i=n+1)})),e.forEach(n,function(t){t instanceof Array?e.forEach(t,function(e){r._keys&&r._keys.push(i),r[i]=e,i++}):(s=t._keys||Object.keys(t),e.forEach(s,function(e){r[e]||r._keys.push(e),r[e]=t[e];var n=parseInt(e,10);!isNaN(n)&&n>=i&&(i=n+1)}))});if(n.length===0)throw new e.Error("Filter merge expects at least one parameter");return r},date:function(t,n){if(t===undefined||t===null)return;var r=e.functions.date(t);return e.lib.formatDate(r,n[0])},date_modify:function(t,n){if(t===undefined||t===null)return;if(n===undefined||n.length!==1)throw new e.Error("date_modify filter expects 1 argument");var r=n[0],i;return e.lib.is("Date",t)&&(i=e.lib.strtotime(r,t.getTime()/1e3)),e.lib.is("String",t)&&(i=e.lib.strtotime(r,e.lib.strtotime(t))),e.lib.is("Number",t)&&(i=e.lib.strtotime(r,t)),new Date(i*1e3)},replace:function(t,n){if(t===undefined||t===null)return;var r=n[0],i;for(i in r)r.hasOwnProperty(i)&&i!=="_keys"&&(t=e.lib.replaceAll(t,i,r[i]));return t},format:function(t,n){if(t===undefined||t===null)return;return e.lib.vsprintf(t,n)},striptags:function(t){if(t===undefined||t===null)return;return e.lib.strip_tags(t)},escape:function(e){if(e===undefined||e===null)return;return e.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},e:function(t){return e.filters.escape(t)},nl2br:function(t){if(t===undefined||t===null)return;var n="BACKSLASH_n_replace",r="<br />"+n;return t=e.filters.escape(t).replace(/\r\n/g,r).replace(/\r/g,r).replace(/\n/g,r),e.lib.replaceAll(t,n,"\n")},number_format:function(e,t){var n=e,r=t&&t[0]?t[0]:undefined,i=t&&t[1]!==undefined?t[1]:".",s=t&&t[2]!==undefined?t[2]:",";n=(n+"").replace(/[^0-9+\-Ee.]/g,"");var o=isFinite(+n)?+n:0,u=isFinite(+r)?Math.abs(r):0,a="",f=function(e,t){var n=Math.pow(10,t);return""+Math.round(e*n)/n};return a=(u?f(o,u):""+Math.round(o)).split("."),a[0].length>3&&(a[0]=a[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,s)),(a[1]||"").length<u&&(a[1]=a[1]||"",a[1]+=(new Array(u-a[1].length+1)).join("0")),a.join(i)},trim:function(t,n){if(t===undefined||t===null)return;var r=e.filters.escape(""+t),i;n&&n[0]?i=""+n[0]:i=" \n\r \f            ​\u2028\u2029 ";for(var s=0;s<r.length;s++)if(i.indexOf(r.charAt(s))===-1){r=r.substring(s);break}for(s=r.length-1;s>=0;s--)if(i.indexOf(r.charAt(s))===-1){r=r.substring(0,s+1);break}return i.indexOf(r.charAt(0))===-1?r:""},slice:function(t,n){if(t===undefined||t===null)return;if(n===undefined||n.length<1)throw new e.Error("slice filter expects at least 1 argument");var r=n[0]||0,i=n.length>1?n[1]:t.length,s=r>=0?r:Math.max(t.length+r,0);if(e.lib.is("Array",t)){var o=[];for(var u=s;u<s+i&&u<t.length;u++)o.push(t[u]);return o}if(e.lib.is("String",t))return t.substr(s,i);throw new e.Error("slice filter expects value to be an array or string")},abs:function(e){if(e===undefined||e===null)return;return Math.abs(e)},first:function(e){if(e instanceof Array)return e[0];if(e instanceof Object){if("_keys"in e)return e[e._keys[0]]}else if(typeof e=="string")return e.substr(0,1);return},split:function(t,n){if(t===undefined||t===null)return;if(n===undefined||n.length<1||n.length>2)throw new e.Error("split filter expects 1 or 2 argument");if(e.lib.is("String",t)){var r=n[0],i=n[1],s=t.split(r);if(i===undefined)return s;if(i<0)return t.split(r,s.length+i);var o=[];if(r=="")while(s.length>0){var u="";for(var a=0;a<i&&s.length>0;a++)u+=s.shift();o.push(u)}else{for(var a=0;a<i-1&&s.length>0;a++)o.push(s.shift());s.length>0&&o.push(s.join(r))}return o}throw new e.Error("split filter expects value to be a string")},last:function(t){if(e.lib.is("Object",t)){var n;return t._keys===undefined?n=Object.keys(t):n=t._keys,t[n[n.length-1]]}return t[t.length-1]},raw:function(e){return e},batch:function(t,n){var r=n.shift(),i=n.shift(),s,o,u;if(!e.lib.is("Array",t))throw new e.Error("batch filter expects items to be an array");if(!e.lib.is("Number",r))throw new e.Error("batch filter expects size to be a number");r=Math.ceil(r),s=e.lib.chunkArray(t,r);if(i&&t.length%r!=0){o=s.pop(),u=r-o.length;while(u--)o.push(i);s.push(o)}return s},round:function(t,n){n=n||[];var r=n.length>0?n[0]:0,i=n.length>1?n[1]:"common";t=parseFloat(t);if(r&&!e.lib.is("Number",r))throw new e.Error("round filter expects precision to be a number");if(i==="common")return e.lib.round(t,r);if(!e.lib.is("Function",Math[i]))throw new e.Error("round filter expects method to be 'floor', 'ceil', or 'common'");return Math[i](t*Math.pow(10,r))/Math.pow(10,r)}},e.filter=function(t,n,r){if(!e.filters[t])throw"Unable to find filter "+t;return e.filters[t].apply(this,[n,r])},e.filter.extend=function(t,n){e.filters[t]=n},e}(Twig||{}),Twig=function(e){function t(e,t){var n=Object.prototype.toString.call(t).slice(8,-1);return t!==undefined&&t!==null&&n===e}return e.functions={range:function(e,t,n){var r=[],i,s,o,u=n||1,a=!1;!isNaN(e)&&!isNaN(t)?(i=parseInt(e,10),s=parseInt(t,10)):isNaN(e)&&isNaN(t)?(a=!0,i=e.charCodeAt(0),s=t.charCodeAt(0)):(i=isNaN(e)?0:e,s=isNaN(t)?0:t),o=i>s?!1:!0;if(o)while(i<=s)r.push(a?String.fromCharCode(i):i),i+=u;else while(i>=s)r.push(a?String.fromCharCode(i):i),i-=u;return r},cycle:function(e,t){var n=t%e.length;return e[n]},dump:function(){var t="\n",n=" ",r=0,i="",s=Array.prototype.slice.call(arguments),o=function(e){var t="";while(e>0)e--,t+=n;return t},u=function(e){i+=o(r),typeof e=="object"?a(e):typeof e=="function"?i+="function()"+t:typeof e=="string"?i+="string("+e.length+') "'+e+'"'+t:typeof e=="number"?i+="number("+e+")"+t:typeof e=="boolean"&&(i+="bool("+e+")"+t)},a=function(e){var n;if(e===null)i+="NULL"+t;else if(e===undefined)i+="undefined"+t;else if(typeof e=="object"){i+=o(r)+typeof e,r++,i+="("+function(e){var t=0,n;for(n in e)e.hasOwnProperty(n)&&t++;return t}(e)+") {"+t;for(n in e)i+=o(r)+"["+n+"]=> "+t,u(e[n]);r--,i+=o(r)+"}"+t}else u(e)};return s.length==0&&s.push(this.context),e.forEach(s,function(e){a(e)}),i},date:function(t,n){var r;if(t===undefined)r=new Date;else if(e.lib.is("Date",t))r=t;else if(e.lib.is("String",t))r=new Date(e.lib.strtotime(t)*1e3);else{if(!e.lib.is("Number",t))throw new e.Error("Unable to parse date "+t);r=new Date(t*1e3)}return r},block:function(e){return this.blocks[e]},parent:function(){return e.placeholders.parent},attribute:function(e,t,n){return e instanceof Object&&e.hasOwnProperty(t)?typeof e[t]=="function"?e[t].apply(undefined,n):e[t]:e[t]||undefined}},e._function=function(t,n,r){if(!e.functions[t])throw"Unable to find function "+t;return e.functions[t](n,r)},e._function.extend=function(t,n){e.functions[t]=n},e}(Twig||{}),Twig=function(e){return e.tests={empty:function(e){if(e===null||e===undefined)return!0;if(typeof e=="number")return!1;if(e.length&&e.length>0)return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},odd:function(e){return e%2===1},even:function(e){return e%2===0},divisibleby:function(e,t){return e%t[0]===0},defined:function(e){return e!==undefined},none:function(e){return e===null},"null":function(e){return this.none(e)},sameas:function(e,t){return e===t[0]}},e.test=function(t,n,r){if(!e.tests[t])throw"Test "+t+" is not defined.";return e.tests[t](n,r)},e.test.extend=function(t,n){e.tests[t]=n},e}(Twig||{}),Twig=function(e){return e.exports={VERSION:e.VERSION},e.exports.twig=function(n){var r=n.id,i={strict_variables:n.strict_variables||!1,allowInlineIncludes:n.allowInlineIncludes||!1,rethrow:n.rethrow||!1};r&&e.validateId(r),n.debug!==undefined&&(e.debug=n.debug),n.trace!==undefined&&(e.trace=n.trace);if(n.data!==undefined)return new e.Template({data:n.data,module:n.module,id:r,options:i});if(n.ref!==undefined){if(n.id!==undefined)throw new e.Error("Both ref and id cannot be set on a twig.js template.");return e.Templates.load(n.ref)}if(n.href!==undefined)return e.Templates.loadRemote(n.href,{id:r,method:"ajax",base:n.base,module:n.module,precompiled:n.precompiled,async:n.async,options:i},n.load,n.error);if(n.path!==undefined)return e.Templates.loadRemote(n.path,{id:r,method:"fs",base:n.base,module:n.module,precompiled:n.precompiled,async:n.async,options:i},n.load,n.error)},e.exports.extendFilter=function(t,n){e.filter.extend(t,n)},e.exports.extendFunction=function(t,n){e._function.extend(t,n)},e.exports.extendTest=function(t,n){e.test.extend(t,n)},e.exports.extendTag=function(t){e.logic.extend(t)},e.exports.extend=function(t){t(e)},e.exports.compile=function(t,n){var r=n.filename,i=n.filename,s;return s=new e.Template({data:t,path:i,id:r,options:n.settings["twig options"]}),function(e){return s.render(e)}},e.exports.renderFile=function(t,n,r){"function"==typeof n&&(r=n,n={}),n=n||{};var i={path:t,base:n.settings.views,load:function(e){r(null,e.render(n))}},s=n.settings["twig options"];if(s)for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o]);e.exports.twig(i)},e.exports.__express=e.exports.renderFile,e.exports.cache=function(t){e.cache=t},e}(Twig||{}),Twig=function(e){return e.compiler={module:{}},e.compiler.compile=function(t,n){var r=JSON.stringify(t.tokens),i=t.id,s;if(n.module){if(e.compiler.module[n.module]===undefined)throw new e.Error("Unable to find module type "+n.module);s=e.compiler.module[n.module](i,r,n.twig)}else s=e.compiler.wrap(i,r);return s},e.compiler.module={amd:function(t,n,r){return'define(["'+r+'"], function (Twig) {\n var twig, templates;\ntwig = Twig.twig;\ntemplates = '+e.compiler.wrap(t,n)+"\n return templates;\n});"},node:function(t,n){return'var twig = require("twig").twig;\nexports.template = '+e.compiler.wrap(t,n)},cjs2:function(t,n,r){return'module.declare([{ twig: "'+r+'" }], function (require, exports, module) {\n'+' var twig = require("twig").twig;\n'+" exports.template = "+e.compiler.wrap(t,n)+"\n});"}},e.compiler.wrap=function(e,t){return'twig({id:"'+e.replace('"','\\"')+'", data:'+t+", precompiled: true});\n"},e}(Twig||{});typeof module!="undefined"&&module.declare?module.declare([],function(e,t,n){for(key in Twig.exports)Twig.exports.hasOwnProperty(key)&&(t[key]=Twig.exports[key])}):typeof define=="function"&&define.amd||1?timely.define("external_libs/twig",[],function(){return Twig.exports}):typeof module!="undefined"&&module.exports?module.exports=Twig.exports:(window.twig=Twig.exports.twig,window.Twig=Twig.exports);
public/js/libs/utils.js CHANGED
@@ -1 +1 @@
1
- timely.define(["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert ai1ec-alert-info"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")},add_query_arg:function(e,t){if("string"!=typeof e)return!1;var n=e.indexOf("?")===-1?"?":"&";return-1!==e.indexOf(n+t[0]+"=")?e:e+n+t[0]+"="+t[1]},create_ai1ec_to_send:function(t){var n=e(t),r=[],i=["action","cat_ids","auth_ids","tag_ids","exact_date","display_filters","no_navigation","events_limit"],s=function(e){return e.replace(/\W+(.)/g,function(e,t){return t.toUpperCase()})};return e(i).each(function(e,t){var i=n.data(s(t));i&&r.push(t+"~"+i)}),r.join("|")},init_autoselect:function(){e(document).on("click",".ai1ec-autoselect",function(t){if(e(this).data("clicked")&&t.originalEvent.detail<2)return;e(this).data("clicked",!0);var n;document.body.createTextRange?(n=document.body.createTextRange(),n.moveToElementText(this),n.select()):window.getSelection&&(selection=window.getSelection(),n=document.createRange(),n.selectNodeContents(this),selection.removeAllRanges(),selection.addRange(n))})}}}();return t});
1
+ timely.define(["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert ai1ec-alert-info"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")},add_query_arg:function(e,t){if("string"!=typeof e)return!1;var n=e.indexOf("?")===-1?"?":"&";return-1!==e.indexOf(n+t[0]+"=")?e:e+n+t[0]+"="+t[1]},create_ai1ec_to_send:function(t){var n=e(t),r=[],i=["action","cat_ids","auth_ids","tag_ids","exact_date","display_filters","no_navigation","events_limit"];return n.each(function(){e.each(this.attributes,function(){this.specified&&this.value&&this.name.match(/^data-/)&&(-1<e.inArray(this.name.replace(/^data\-/,""),i)||this.name.match(/_ids$/))&&r.push(this.name.replace(/^data\-/,"")+"~"+this.value)})}),r.join("|")},init_autoselect:function(){e(document).on("click",".ai1ec-autoselect",function(t){if(e(this).data("clicked")&&t.originalEvent.detail<2)return;e(this).data("clicked",!0);var n;document.body.createTextRange?(n=document.body.createTextRange(),n.moveToElementText(this),n.select()):window.getSelection&&(selection=window.getSelection(),n=document.createRange(),n.selectNodeContents(this),selection.removeAllRanges(),selection.addRange(n))})}}}();return t});
public/js/month.js CHANGED
@@ -1 +1 @@
1
- timely.define(["libs/twig","month"],function(e){var t,n;return t=e.twig,n=t({id:"../js_src/month.twig",data:[{type:"output",stack:[{type:"Twig.expression.type.variable",value:"navigation",match:["navigation"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n\n<table class="ai1ec-month-view ai1ec-popover-boundary\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"month_word_wrap",match:["month_word_wrap"]}],output:[{type:"raw",value:"ai1ec-word-wrap"}]}},{type:"raw",value:'">\n <thead>\n <tr>\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"weekday",expression:[{type:"Twig.expression.type.variable",value:"weekdays",match:["weekdays"]}],output:[{type:"raw",value:' <th scope="col" class="ai1ec-weekday">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"weekday",match:["weekday"]}]},{type:"raw",value:"</th>\n "}]}},{type:"raw",value:" </tr>\n </thead>\n <tbody>\n "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"week",expression:[{type:"Twig.expression.type.variable",value:"cell_array",match:["cell_array"]}],output:[{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"added_stretcher",expression:[{type:"Twig.expression.type.bool",value:!1}]}},{type:"raw",value:' <tr class="ai1ec-week">\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"day",expression:[{type:"Twig.expression.type.variable",value:"week",match:["week"]}],output:[{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"date"}],output:[{type:"raw",value:" <td "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"today"}],output:[{type:"raw",value:'class="ai1ec-today"'}]}},{type:"raw",value:">\n "},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"added_stretcher",match:["added_stretcher"]},{type:"Twig.expression.type.operator.unary",value:"not",precidence:3,associativity:"rightToLeft",operator:"not"}],output:[{type:"raw",value:' <div class="ai1ec-day-stretcher"></div>\n '},{type:"logic",token:{type:"Twig.logic.type.set",key:"added_stretcher",expression:[{type:"Twig.expression.type.bool",value:!0}]}},{type:"raw",value:" "}]}},{type:"raw",value:'\n <div class="ai1ec-day">\n <div class="ai1ec-date">\n <a class="ai1ec-load-view"\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"data_type",match:["data_type"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"date_link"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"date"}]},{type:"raw",value:"</a>\n </div>\n\n "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"event",expression:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"events"}],output:[{type:"raw",value:' <a href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_multiday"}],output:[{type:"raw",value:' data-end-day="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"multiday_end_day"}]},{type:"raw",value:'"\n data-start-truncated="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"start_truncated"},{type:"Twig.expression.type.string",value:"true"},{type:"Twig.expression.type.string",value:"false"},{type:"Twig.expression.type.operator.binary",value:"?",precidence:16,associativity:"rightToLeft",operator:"?"}]},{type:"raw",value:'"\n data-end-truncated="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"end_truncated"},{type:"Twig.expression.type.string",value:"true"},{type:"Twig.expression.type.string",value:"false"},{type:"Twig.expression.type.operator.binary",value:"?",precidence:16,associativity:"rightToLeft",operator:"?"}]},{type:"raw",value:'"\n '}]}},{type:"raw",value:' data-instance-id="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:'"\n class="ai1ec-event-container ai1ec-load-event\n ai1ec-popup-trigger\n ai1ec-event-id-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_id"}]},{type:"raw",value:"\n ai1ec-event-instance-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_allday"}],output:[{type:"raw",value:"ai1ec-allday"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_multiday"}],output:[{type:"raw",value:"ai1ec-multiday"}]}},{type:"raw",value:'"\n >\n\n <div class="ai1ec-event"\n style="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"color_style"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n <span class="ai1ec-event-title">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </span>\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_allday"},{type:"Twig.expression.type.operator.unary",value:"not",precidence:3,associativity:"rightToLeft",operator:"not"}],output:[{type:"raw",value:' <span class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"short_start_time"}]},{type:"raw",value:"\n </span>\n "}]}},{type:"raw",value:' </div>\n </a>\n\n <div class="ai1ec-popover ai1ec-popup ai1ec-popup-in-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"type",match:["type"]}]},{type:"raw",value:'-view">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"}],output:[{type:"raw",value:' <div class="ai1ec-color-swatches">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:' <span class="ai1ec-popup-title">\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</a>\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"is_ticket_button_enabled",match:["is_ticket_button_enabled"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <a class="ai1ec-pull-right ai1ec-btn ai1ec-btn-primary ai1ec-btn-xs\n ai1ec-buy-tickets" target="_blank"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url_label"}]},{type:"raw",value:"</a>\n "}]}},{type:"raw",value:" </span>\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"}],output:[{type:"raw",value:' <a class="post-edit-link"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'">\n <i class="ai1ec-fa ai1ec-fa-pencil"></i> '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_edit",match:["text_edit"]}]},{type:"raw",value:"\n </a>\n "}]}},{type:"raw",value:'\n <div class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"popup_timespan"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n </div>\n\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"avatar_not_wrapped"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </a>\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"}],output:[{type:"raw",value:' <div class="ai1ec-popup-excerpt">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:" </div>\n "}]}},{type:"raw",value:" </div>\n </td>\n "}]}},{type:"logic",token:{type:"Twig.logic.type.else",match:["else"],output:[{type:"raw",value:" "},{type:"raw",value:'\n <td class="ai1ec-empty"></td>\n '}]}},{type:"raw",value:" "},{type:"raw",value:"\n\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n </tr>\n "}]}},{type:"raw",value:" "},{type:"raw",value:'\n </tbody>\n</table>\n\n<div class="ai1ec-pull-left">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"pagination_links",match:["pagination_links"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n"}],precompiled:!0}),n});
1
+ timely.define(["libs/twig","month"],function(e){var t,n;return t=e.twig,n=t({id:"../js_src/month.twig",data:[{type:"output",stack:[{type:"Twig.expression.type.variable",value:"navigation",match:["navigation"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n\n<table class="ai1ec-month-view ai1ec-popover-boundary\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"month_word_wrap",match:["month_word_wrap"]}],output:[{type:"raw",value:"ai1ec-word-wrap"}]}},{type:"raw",value:'">\n <thead>\n <tr>\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"weekday",expression:[{type:"Twig.expression.type.variable",value:"weekdays",match:["weekdays"]}],output:[{type:"raw",value:' <th scope="col" class="ai1ec-weekday">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"weekday",match:["weekday"]}]},{type:"raw",value:"</th>\n "}]}},{type:"raw",value:" </tr>\n </thead>\n <tbody>\n "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"week",expression:[{type:"Twig.expression.type.variable",value:"cell_array",match:["cell_array"]}],output:[{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"added_stretcher",expression:[{type:"Twig.expression.type.bool",value:!1}]}},{type:"raw",value:' <tr class="ai1ec-week">\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"day",expression:[{type:"Twig.expression.type.variable",value:"week",match:["week"]}],output:[{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"date"}],output:[{type:"raw",value:" <td "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"today"}],output:[{type:"raw",value:'class="ai1ec-today"'}]}},{type:"raw",value:">\n "},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"added_stretcher",match:["added_stretcher"]},{type:"Twig.expression.type.operator.unary",value:"not",precidence:3,associativity:"rightToLeft",operator:"not"}],output:[{type:"raw",value:' <div class="ai1ec-day-stretcher"></div>\n '},{type:"logic",token:{type:"Twig.logic.type.set",key:"added_stretcher",expression:[{type:"Twig.expression.type.bool",value:!0}]}},{type:"raw",value:" "}]}},{type:"raw",value:'\n <div class="ai1ec-day">\n <div class="ai1ec-date">\n <a class="ai1ec-load-view"\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"data_type",match:["data_type"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"date_link"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"date"}]},{type:"raw",value:"</a>\n </div>\n\n "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"event",expression:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"events"}],output:[{type:"raw",value:' <a href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_multiday"}],output:[{type:"raw",value:' data-start-day="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"start_day"}]},{type:"raw",value:'"\n data-end-day="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"multiday_end_day"}]},{type:"raw",value:'"\n data-start-truncated="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"start_truncated"},{type:"Twig.expression.type.string",value:"true"},{type:"Twig.expression.type.string",value:"false"},{type:"Twig.expression.type.operator.binary",value:"?",precidence:16,associativity:"rightToLeft",operator:"?"}]},{type:"raw",value:'"\n data-end-truncated="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"end_truncated"},{type:"Twig.expression.type.string",value:"true"},{type:"Twig.expression.type.string",value:"false"},{type:"Twig.expression.type.operator.binary",value:"?",precidence:16,associativity:"rightToLeft",operator:"?"}]},{type:"raw",value:'"\n '}]}},{type:"raw",value:' data-instance-id="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:'"\n class="ai1ec-event-container ai1ec-load-event\n ai1ec-popup-trigger\n ai1ec-event-id-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_id"}]},{type:"raw",value:"\n ai1ec-event-instance-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_allday"}],output:[{type:"raw",value:"ai1ec-allday"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_multiday"}],output:[{type:"raw",value:"ai1ec-multiday"}]}},{type:"raw",value:'"\n >\n\n <div class="ai1ec-event"\n style="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"color_style"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n <span class="ai1ec-event-title">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </span>\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_allday"},{type:"Twig.expression.type.operator.unary",value:"not",precidence:3,associativity:"rightToLeft",operator:"not"}],output:[{type:"raw",value:' <span class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"short_start_time"}]},{type:"raw",value:"\n </span>\n "}]}},{type:"raw",value:' </div>\n </a>\n\n <div class="ai1ec-popover ai1ec-popup ai1ec-popup-in-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"type",match:["type"]}]},{type:"raw",value:"-view\n ai1ec-event-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_id"}]},{type:"raw",value:"\n ai1ec-event-instance-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:'">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"}],output:[{type:"raw",value:' <div class="ai1ec-color-swatches">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:' <span class="ai1ec-popup-title">\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</a>\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"is_ticket_button_enabled",match:["is_ticket_button_enabled"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <a class="ai1ec-pull-right ai1ec-btn ai1ec-btn-primary ai1ec-btn-xs\n ai1ec-buy-tickets" target="_blank"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url_label"}]},{type:"raw",value:"</a>\n "}]}},{type:"raw",value:" </span>\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"}],output:[{type:"raw",value:' <a class="post-edit-link"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'">\n <i class="ai1ec-fa ai1ec-fa-pencil"></i> '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_edit",match:["text_edit"]}]},{type:"raw",value:"\n </a>\n "}]}},{type:"raw",value:'\n <div class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"popup_timespan"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n </div>\n\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"avatar_not_wrapped"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </a>\n "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"action_buttons",match:["action_buttons"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"}],output:[{type:"raw",value:' <div class="ai1ec-popup-excerpt">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:" </div>\n "}]}},{type:"raw",value:" </div>\n </td>\n "}]}},{type:"logic",token:{type:"Twig.logic.type.else",match:["else"],output:[{type:"raw",value:" "},{type:"raw",value:'\n <td class="ai1ec-empty"></td>\n '}]}},{type:"raw",value:" "},{type:"raw",value:"\n\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n </tr>\n "}]}},{type:"raw",value:" "},{type:"raw",value:'\n </tbody>\n</table>\n\n<div class="ai1ec-pull-left">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"pagination_links",match:["pagination_links"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n"}],precompiled:!0}),n});
public/js/oneday.js CHANGED
@@ -1 +1 @@
1
- timely.define(["libs/twig","oneday"],function(e){var t,n;return t=e.twig,n=t({id:"../js_src/oneday.twig",data:[{type:"output",stack:[{type:"Twig.expression.type.variable",value:"navigation",match:["navigation"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n\n<table class="ai1ec-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"type",match:["type"]}]},{type:"raw",value:'-view-original">\n <thead>\n <tr>\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:"date",value_var:"day",expression:[{type:"Twig.expression.type.variable",value:"cell_array",match:["cell_array"]}],output:[{type:"raw",value:' <th class="ai1ec-weekday\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"today"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:"ai1ec-today"}]}},{type:"raw",value:'">\n '},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_reveal_button",match:["show_reveal_button"]},{type:"Twig.expression.type.variable",value:"loop",match:["loop"]},{type:"Twig.expression.type.key.period",key:"last"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <div class="ai1ec-reveal-full-day">\n <button class="ai1ec-btn ai1ec-btn-info ai1ec-btn-xs\n ai1ec-tooltip-trigger"\n data-placement="left"\n title="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_full_day",match:["text_full_day"]},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n <i class="ai1ec-fa ai1ec-fa-expand"></i>\n </button>\n </div>\n '}]}},{type:"raw",value:' <a class="ai1ec-load-view" href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"href"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"data_type",match:["data_type"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'>\n <span class="ai1ec-weekday-date">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"day"}]},{type:"raw",value:'</span>\n <span class="ai1ec-weekday-day">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"weekday"}]},{type:"raw",value:"</span>\n </a>\n </th>\n "}]}},{type:"raw",value:" </tr>\n <tr>\n "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"day",expression:[{type:"Twig.expression.type.variable",value:"cell_array",match:["cell_array"]}],output:[{type:"raw",value:' <td class="ai1ec-allday-events\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"today"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:"ai1ec-today"}]}},{type:"raw",value:'">\n\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"loop",match:["loop"]},{type:"Twig.expression.type.key.period",key:"first"}],output:[{type:"raw",value:' <div class="ai1ec-allday-label">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_all_day",match:["text_all_day"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"event",expression:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"allday"}],output:[{type:"raw",value:' <a href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n data-instance-id="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:'"\n class="ai1ec-event-container ai1ec-load-event ai1ec-popup-trigger\n ai1ec-event-id-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_id"}]},{type:"raw",value:"\n ai1ec-event-instance-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:"\n ai1ec-allday\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_multiday"}],output:[{type:"raw",value:"ai1ec-multiday"}]}},{type:"raw",value:'"\n >\n <div class="ai1ec-event"\n style="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"color_style"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n <span class="ai1ec-event-title">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:' </span>\n </div>\n </a>\n\n <div class="ai1ec-popover ai1ec-popup ai1ec-popup-in-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"type",match:["type"]}]},{type:"raw",value:'-view">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"}],output:[{type:"raw",value:' <div class="ai1ec-color-swatches">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:' <span class="ai1ec-popup-title">\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</a>\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"is_ticket_button_enabled",match:["is_ticket_button_enabled"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <a class="ai1ec-pull-right ai1ec-btn ai1ec-btn-primary ai1ec-btn-xs\n ai1ec-buy-tickets" target="_blank"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url_label"}]},{type:"raw",value:"</a>\n "}]}},{type:"raw",value:" </span>\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"}],output:[{type:"raw",value:' <a class="post-edit-link"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'">\n <i class="ai1ec-fa ai1ec-fa-pencil"></i> '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_edit",match:["text_edit"]}]},{type:"raw",value:"\n </a>\n "}]}},{type:"raw",value:'\n <div class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"popup_timespan"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n </div>\n\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"avatar_not_wrapped"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </a>\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"}],output:[{type:"raw",value:' <div class="ai1ec-popup-excerpt">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:" </div>\n\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n\n </td>\n "}]}},{type:"raw",value:" "},{type:"raw",value:'\n </tr>\n\n </thead>\n <tbody>\n <tr class="ai1ec-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"type",match:["type"]}]},{type:"raw",value:'">\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"day",expression:[{type:"Twig.expression.type.variable",value:"cell_array",match:["cell_array"]}],output:[{type:"raw",value:" <td "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"today"}],output:[{type:"raw",value:'class="ai1ec-today"'}]}},{type:"raw",value:">\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"loop",match:["loop"]},{type:"Twig.expression.type.key.period",key:"first"}],output:[{type:"raw",value:' <div class="ai1ec-grid-container">\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:"h",value_var:"hour",expression:[{type:"Twig.expression.type.variable",value:"hours",match:["hours"]}],output:[{type:"raw",value:' <div class="ai1ec-hour-marker\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"h",match:["h"]},{type:"Twig.expression.type.number",value:8,match:["8",null]},{type:"Twig.expression.type.operator.binary",value:">=",precidence:8,associativity:"leftToRight",operator:">="},{type:"Twig.expression.type.variable",value:"h",match:["h"]},{type:"Twig.expression.type.number",value:18,match:["18",null]},{type:"Twig.expression.type.operator.binary",value:"<",precidence:8,associativity:"leftToRight",operator:"<"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:"ai1ec-business-hour"}]}},{type:"raw",value:'"\n style="top: '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"h",match:["h"]},{type:"Twig.expression.type.number",value:60,match:["60",null]},{type:"Twig.expression.type.operator.binary",value:"*",precidence:5,associativity:"leftToRight",operator:"*"}]},{type:"raw",value:'px;">\n <div>\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"hour",match:["hour"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </div>\n </div>\n "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"quarter",expression:[{type:"Twig.expression.type.number",value:1,match:["1",null]},{type:"Twig.expression.type.number",value:3,match:["3",null]},{type:"Twig.expression.type.operator.binary",value:"..",precidence:20,associativity:"leftToRight",operator:".."}],output:[{type:"raw",value:' <div class="ai1ec-quarter-marker"\n style="top: '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"h",match:["h"]},{type:"Twig.expression.type.number",value:60,match:["60",null]},{type:"Twig.expression.type.operator.binary",value:"*",precidence:5,associativity:"leftToRight",operator:"*"},{type:"Twig.expression.type.variable",value:"quarter",match:["quarter"]},{type:"Twig.expression.type.number",value:15,match:["15",null]},{type:"Twig.expression.type.operator.binary",value:"*",precidence:5,associativity:"leftToRight",operator:"*"},{type:"Twig.expression.type.operator.binary",value:"+",precidence:6,associativity:"leftToRight",operator:"+"}]},{type:"raw",value:'px;"></div>\n '}]}},{type:"raw",value:" "}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"today"},{type:"Twig.expression.type.variable",value:"show_now",match:["show_now"]},{type:"Twig.expression.type.operator.binary",value:"or",precidence:14,associativity:"leftToRight",operator:"or"}],output:[{type:"raw",value:' <div class="ai1ec-now-marker" style="top: '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"now_top",match:["now_top"]}]},{type:"raw",value:'px;">\n <div>\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_now_label",match:["text_now_label"]}]},{type:"raw",value:" "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"now_text",match:["now_text"]}]},{type:"raw",value:"\n </div>\n </div>\n "}]}},{type:"raw",value:" </div>\n "}]}},{type:"raw",value:'\n <div class="ai1ec-day">\n\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"day_array",expression:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"notallday"}],output:[{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"event",expression:[{type:"Twig.expression.type.variable",value:"day_array",match:["day_array"]},{type:"Twig.expression.type.key.period",key:"event"}]}},{type:"raw",value:' <a href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n data-instance-id="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:'"\n class="ai1ec-event-container ai1ec-load-event ai1ec-popup-trigger\n ai1ec-event-id-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_id"}]},{type:"raw",value:"\n ai1ec-event-instance-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"start_truncated"}],output:[{type:"raw",value:"ai1ec-start-truncated"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"end_truncated"}],output:[{type:"raw",value:"ai1ec-end-truncated"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_multiday"}],output:[{type:"raw",value:"ai1ec-multiday"}]}},{type:"raw",value:'"\n style="top: '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day_array",match:["day_array"]},{type:"Twig.expression.type.key.period",key:"top"}]},{type:"raw",value:"px;\n height: "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day_array",match:["day_array"]},{type:"Twig.expression.type.key.period",key:"height"}]},{type:"raw",value:"px;\n left: "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day_array",match:["day_array"]},{type:"Twig.expression.type.key.period",key:"indent"},{type:"Twig.expression.type.variable",value:"indent_multiplier",match:["indent_multiplier"]},{type:"Twig.expression.type.operator.binary",value:"*",precidence:5,associativity:"leftToRight",operator:"*"},{type:"Twig.expression.type.variable",value:"indent_offset",match:["indent_offset"]},{type:"Twig.expression.type.operator.binary",value:"+",precidence:6,associativity:"leftToRight",operator:"+"}]},{type:"raw",value:"px;\n "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"color_style"}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.set",key:"faded_color",expression:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"faded_color"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"rgba_color",expression:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"rgba_color"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"faded_color",match:["faded_color"]}],output:[{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"rgba1",expression:[{type:"Twig.expression.type.variable",value:"rgba_color",match:["rgba_color"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"0.05"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"rgba3",expression:[{type:"Twig.expression.type.variable",value:"rgba_color",match:["rgba_color"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"0.3"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]}},{type:"raw",value:" border: 1px solid "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"faded_color",match:["faded_color"]}]},{type:"raw",value:";\n border-color: "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba_color",match:["rgba_color"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"0.5"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:";\n background-image: -webkit-linear-gradient( top, "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba1",match:["rgba1"]}]},{type:"raw",value:", "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba3",match:["rgba3"]}]},{type:"raw",value:" 50px );\n background-image: -moz-linear-gradient( top, "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba1",match:["rgba1"]}]},{type:"raw",value:", "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba3",match:["rgba3"]}]},{type:"raw",value:" 50px );\n background-image: -ms-linear-gradient( top, "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba1",match:["rgba1"]}]},{type:"raw",value:", "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba3",match:["rgba3"]}]},{type:"raw",value:" 50px );\n background-image: -o-linear-gradient( top, "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba1",match:["rgba1"]}]},{type:"raw",value:", "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba3",match:["rgba3"]}]},{type:"raw",value:" 50px );\n background-image: linear-gradient( top, "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba1",match:["rgba1"]}]},{type:"raw",value:", "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba3",match:["rgba3"]}]},{type:"raw",value:" 50px );\n "}]}},{type:"raw",value:' ">\n\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"start_truncated"}],output:[{type:"raw",value:' <div class="ai1ec-start-truncator">◤</div>\n '}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"end_truncated"}],output:[{type:"raw",value:' <div class="ai1ec-end-truncator">◢</div>\n '}]}},{type:"raw",value:'\n <div class="ai1ec-event">\n <span class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"short_start_time"}]},{type:"raw",value:'\n </span>\n <span class="ai1ec-event-title">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:' </span>\n </div>\n\n </a>\n\n <div class="ai1ec-popover ai1ec-popup ai1ec-popup-in-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"type",match:["type"]}]},{type:"raw",value:'-view">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"}],output:[{type:"raw",value:' <div class="ai1ec-color-swatches">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:' <span class="ai1ec-popup-title">\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</a>\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"is_ticket_button_enabled",match:["is_ticket_button_enabled"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <a class="ai1ec-pull-right ai1ec-btn ai1ec-btn-primary ai1ec-btn-xs\n ai1ec-buy-tickets" target="_blank"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url_label"}]},{type:"raw",value:"</a>\n "}]}},{type:"raw",value:" </span>\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"}],output:[{type:"raw",value:' <a class="post-edit-link"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'">\n <i class="ai1ec-fa ai1ec-fa-pencil"></i> '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_edit",match:["text_edit"]}]},{type:"raw",value:"\n </a>\n "}]}},{type:"raw",value:'\n <div class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"popup_timespan"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n </div>\n\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"avatar_not_wrapped"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </a>\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"}],output:[{type:"raw",value:' <div class="ai1ec-popup-excerpt">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:" </div>\n\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n </div>\n\n </td>\n "}]}},{type:"raw",value:" "},{type:"raw",value:'\n </tr>\n </tbody>\n\n</table>\n\n<div class="ai1ec-pull-left">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"pagination_links",match:["pagination_links"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n"}],precompiled:!0}),n});
1
+ timely.define(["libs/twig","oneday"],function(e){var t,n;return t=e.twig,n=t({id:"../js_src/oneday.twig",data:[{type:"output",stack:[{type:"Twig.expression.type.variable",value:"navigation",match:["navigation"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n\n<table class="ai1ec-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"type",match:["type"]}]},{type:"raw",value:'-view-original">\n <thead>\n <tr>\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:"date",value_var:"day",expression:[{type:"Twig.expression.type.variable",value:"cell_array",match:["cell_array"]}],output:[{type:"raw",value:' <th class="ai1ec-weekday\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"today"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:"ai1ec-today"}]}},{type:"raw",value:'">\n '},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_reveal_button",match:["show_reveal_button"]},{type:"Twig.expression.type.variable",value:"loop",match:["loop"]},{type:"Twig.expression.type.key.period",key:"last"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <div class="ai1ec-reveal-full-day">\n <button class="ai1ec-btn ai1ec-btn-info ai1ec-btn-xs\n ai1ec-tooltip-trigger"\n data-placement="left"\n title="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_full_day",match:["text_full_day"]},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n <i class="ai1ec-fa ai1ec-fa-expand"></i>\n </button>\n </div>\n '}]}},{type:"raw",value:' <a class="ai1ec-load-view" href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"href"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"data_type",match:["data_type"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'>\n <span class="ai1ec-weekday-date">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"day"}]},{type:"raw",value:'</span>\n <span class="ai1ec-weekday-day">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"weekday"}]},{type:"raw",value:"</span>\n </a>\n </th>\n "}]}},{type:"raw",value:" </tr>\n <tr>\n "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"day",expression:[{type:"Twig.expression.type.variable",value:"cell_array",match:["cell_array"]}],output:[{type:"raw",value:' <td class="ai1ec-allday-events\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"today"},{type:"Twig.expression.type.test",filter:"empty",modifier:"not"}],output:[{type:"raw",value:"ai1ec-today"}]}},{type:"raw",value:'">\n\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"loop",match:["loop"]},{type:"Twig.expression.type.key.period",key:"first"}],output:[{type:"raw",value:' <div class="ai1ec-allday-label">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_all_day",match:["text_all_day"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"event",expression:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"allday"}],output:[{type:"raw",value:' <a href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n data-instance-id="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:'"\n class="ai1ec-event-container ai1ec-load-event ai1ec-popup-trigger\n ai1ec-event-id-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_id"}]},{type:"raw",value:"\n ai1ec-event-instance-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:"\n ai1ec-allday\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_multiday"}],output:[{type:"raw",value:"ai1ec-multiday"}]}},{type:"raw",value:'"\n >\n <div class="ai1ec-event"\n style="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"color_style"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n <span class="ai1ec-event-title">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:' </span>\n </div>\n </a>\n\n <div class="ai1ec-popover ai1ec-popup ai1ec-popup-in-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"type",match:["type"]}]},{type:"raw",value:"-view\n ai1ec-event-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_id"}]},{type:"raw",value:"\n ai1ec-event-instance-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:'">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"}],output:[{type:"raw",value:' <div class="ai1ec-color-swatches">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:' <span class="ai1ec-popup-title">\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</a>\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"is_ticket_button_enabled",match:["is_ticket_button_enabled"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <a class="ai1ec-pull-right ai1ec-btn ai1ec-btn-primary ai1ec-btn-xs\n ai1ec-buy-tickets" target="_blank"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url_label"}]},{type:"raw",value:"</a>\n "}]}},{type:"raw",value:" </span>\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"}],output:[{type:"raw",value:' <a class="post-edit-link"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'">\n <i class="ai1ec-fa ai1ec-fa-pencil"></i> '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_edit",match:["text_edit"]}]},{type:"raw",value:"\n </a>\n "}]}},{type:"raw",value:'\n <div class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"popup_timespan"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n </div>\n\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"avatar_not_wrapped"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </a>\n "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"action_buttons",match:["action_buttons"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"}],output:[{type:"raw",value:' <div class="ai1ec-popup-excerpt">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:" </div>\n\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n\n </td>\n "}]}},{type:"raw",value:" "},{type:"raw",value:'\n </tr>\n\n </thead>\n <tbody>\n <tr class="ai1ec-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"type",match:["type"]}]},{type:"raw",value:'">\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"day",expression:[{type:"Twig.expression.type.variable",value:"cell_array",match:["cell_array"]}],output:[{type:"raw",value:" <td "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"today"}],output:[{type:"raw",value:'class="ai1ec-today"'}]}},{type:"raw",value:">\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"loop",match:["loop"]},{type:"Twig.expression.type.key.period",key:"first"}],output:[{type:"raw",value:' <div class="ai1ec-grid-container">\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:"h",value_var:"hour",expression:[{type:"Twig.expression.type.variable",value:"hours",match:["hours"]}],output:[{type:"raw",value:' <div class="ai1ec-hour-marker\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"h",match:["h"]},{type:"Twig.expression.type.number",value:8,match:["8",null]},{type:"Twig.expression.type.operator.binary",value:">=",precidence:8,associativity:"leftToRight",operator:">="},{type:"Twig.expression.type.variable",value:"h",match:["h"]},{type:"Twig.expression.type.number",value:18,match:["18",null]},{type:"Twig.expression.type.operator.binary",value:"<",precidence:8,associativity:"leftToRight",operator:"<"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:"ai1ec-business-hour"}]}},{type:"raw",value:'"\n style="top: '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"h",match:["h"]},{type:"Twig.expression.type.number",value:60,match:["60",null]},{type:"Twig.expression.type.operator.binary",value:"*",precidence:5,associativity:"leftToRight",operator:"*"}]},{type:"raw",value:'px;">\n <div>\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"hour",match:["hour"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </div>\n </div>\n "},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"quarter",expression:[{type:"Twig.expression.type.number",value:1,match:["1",null]},{type:"Twig.expression.type.number",value:3,match:["3",null]},{type:"Twig.expression.type.operator.binary",value:"..",precidence:20,associativity:"leftToRight",operator:".."}],output:[{type:"raw",value:' <div class="ai1ec-quarter-marker"\n style="top: '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"h",match:["h"]},{type:"Twig.expression.type.number",value:60,match:["60",null]},{type:"Twig.expression.type.operator.binary",value:"*",precidence:5,associativity:"leftToRight",operator:"*"},{type:"Twig.expression.type.variable",value:"quarter",match:["quarter"]},{type:"Twig.expression.type.number",value:15,match:["15",null]},{type:"Twig.expression.type.operator.binary",value:"*",precidence:5,associativity:"leftToRight",operator:"*"},{type:"Twig.expression.type.operator.binary",value:"+",precidence:6,associativity:"leftToRight",operator:"+"}]},{type:"raw",value:'px;"></div>\n '}]}},{type:"raw",value:" "}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"today"},{type:"Twig.expression.type.variable",value:"show_now",match:["show_now"]},{type:"Twig.expression.type.operator.binary",value:"or",precidence:14,associativity:"leftToRight",operator:"or"}],output:[{type:"raw",value:' <div class="ai1ec-now-marker" style="top: '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"now_top",match:["now_top"]}]},{type:"raw",value:'px;">\n <div>\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_now_label",match:["text_now_label"]}]},{type:"raw",value:" "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"now_text",match:["now_text"]}]},{type:"raw",value:"\n </div>\n </div>\n "}]}},{type:"raw",value:" </div>\n "}]}},{type:"raw",value:'\n <div class="ai1ec-day">\n\n '},{type:"logic",token:{type:"Twig.logic.type.for",key_var:null,value_var:"day_array",expression:[{type:"Twig.expression.type.variable",value:"day",match:["day"]},{type:"Twig.expression.type.key.period",key:"notallday"}],output:[{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"event",expression:[{type:"Twig.expression.type.variable",value:"day_array",match:["day_array"]},{type:"Twig.expression.type.key.period",key:"event"}]}},{type:"raw",value:' <a href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n data-instance-id="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:'"\n class="ai1ec-event-container ai1ec-load-event ai1ec-popup-trigger\n ai1ec-event-id-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_id"}]},{type:"raw",value:"\n ai1ec-event-instance-id-"},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"instance_id"}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"start_truncated"}],output:[{type:"raw",value:"ai1ec-start-truncated"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"end_truncated"}],output:[{type:"raw",value:"ai1ec-end-truncated"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"is_multiday"}],output:[{type:"raw",value:"ai1ec-multiday"}]}},{type:"raw",value:'"\n style="top: '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day_array",match:["day_array"]},{type:"Twig.expression.type.key.period",key:"top"}]},{type:"raw",value:"px;\n height: "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day_array",match:["day_array"]},{type:"Twig.expression.type.key.period",key:"height"}]},{type:"raw",value:"px;\n left: "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"day_array",match:["day_array"]},{type:"Twig.expression.type.key.period",key:"indent"},{type:"Twig.expression.type.variable",value:"indent_multiplier",match:["indent_multiplier"]},{type:"Twig.expression.type.operator.binary",value:"*",precidence:5,associativity:"leftToRight",operator:"*"},{type:"Twig.expression.type.variable",value:"indent_offset",match:["indent_offset"]},{type:"Twig.expression.type.operator.binary",value:"+",precidence:6,associativity:"leftToRight",operator:"+"}]},{type:"raw",value:"px;\n "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"color_style"}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.set",key:"faded_color",expression:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"faded_color"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"rgba_color",expression:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"rgba_color"}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"faded_color",match:["faded_color"]}],output:[{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"rgba1",expression:[{type:"Twig.expression.type.variable",value:"rgba_color",match:["rgba_color"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"0.05"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.set",key:"rgba3",expression:[{type:"Twig.expression.type.variable",value:"rgba_color",match:["rgba_color"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"0.3"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]}},{type:"raw",value:" border: 1px solid "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"faded_color",match:["faded_color"]}]},{type:"raw",value:";\n border-color: "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba_color",match:["rgba_color"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"0.5"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:";\n background-image: -webkit-linear-gradient( top, "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba1",match:["rgba1"]}]},{type:"raw",value:", "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba3",match:["rgba3"]}]},{type:"raw",value:" 50px );\n background-image: -moz-linear-gradient( top, "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba1",match:["rgba1"]}]},{type:"raw",value:", "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba3",match:["rgba3"]}]},{type:"raw",value:" 50px );\n background-image: -ms-linear-gradient( top, "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba1",match:["rgba1"]}]},{type:"raw",value:", "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba3",match:["rgba3"]}]},{type:"raw",value:" 50px );\n background-image: -o-linear-gradient( top, "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba1",match:["rgba1"]}]},{type:"raw",value:", "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba3",match:["rgba3"]}]},{type:"raw",value:" 50px );\n background-image: linear-gradient( top, "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba1",match:["rgba1"]}]},{type:"raw",value:", "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"rgba3",match:["rgba3"]}]},{type:"raw",value:" 50px );\n "}]}},{type:"raw",value:' ">\n\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"start_truncated"}],output:[{type:"raw",value:' <div class="ai1ec-start-truncator">◤</div>\n '}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"end_truncated"}],output:[{type:"raw",value:' <div class="ai1ec-end-truncator">◢</div>\n '}]}},{type:"raw",value:'\n <div class="ai1ec-event">\n <span class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"short_start_time"}]},{type:"raw",value:'\n </span>\n <span class="ai1ec-event-title">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:' </span>\n </div>\n\n </a>\n\n <div class="ai1ec-popover ai1ec-popup ai1ec-popup-in-'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"type",match:["type"]}]},{type:"raw",value:'-view">\n '},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"}],output:[{type:"raw",value:' <div class="ai1ec-color-swatches">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"category_colors"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:' <span class="ai1ec-popup-title">\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"filtered_title"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</a>\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"show_location_in_title",match:["show_location_in_title"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <span class="ai1ec-event-location"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_venue_separator",match:["text_venue_separator"]},{type:"Twig.expression.type.filter",value:"format",match:["| format","format"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"venue"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:"</span>\n "}]}},{type:"raw",value:" "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"is_ticket_button_enabled",match:["is_ticket_button_enabled"]},{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.operator.binary",value:"and",precidence:13,associativity:"leftToRight",operator:"and"}],output:[{type:"raw",value:' <a class="ai1ec-pull-right ai1ec-btn ai1ec-btn-primary ai1ec-btn-xs\n ai1ec-buy-tickets" target="_blank"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'"\n >'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"ticket_url_label"}]},{type:"raw",value:"</a>\n "}]}},{type:"raw",value:" </span>\n\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"}],output:[{type:"raw",value:' <a class="post-edit-link"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"edit_post_link"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'">\n <i class="ai1ec-fa ai1ec-fa-pencil"></i> '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"text_edit",match:["text_edit"]}]},{type:"raw",value:"\n </a>\n "}]}},{type:"raw",value:'\n <div class="ai1ec-event-time">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"popup_timespan"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:'\n </div>\n\n <a class="ai1ec-load-event"\n href="'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"permalink"},{type:"Twig.expression.type.filter",value:"e",match:["| e","e"],params:[{type:"Twig.expression.type.parameter.start",value:"(",match:["("]},{type:"Twig.expression.type.string",value:"html_attr"},{type:"Twig.expression.type.parameter.end",value:")",match:[")"],expression:!1}]}]},{type:"raw",value:'">\n '},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"avatar_not_wrapped"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n </a>\n "},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"action_buttons",match:["action_buttons"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"\n "},{type:"logic",token:{type:"Twig.logic.type.if",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"}],output:[{type:"raw",value:' <div class="ai1ec-popup-excerpt">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"event",match:["event"]},{type:"Twig.expression.type.key.period",key:"post_excerpt"},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n "}]}},{type:"raw",value:" </div>\n\n "}]}},{type:"raw",value:" "},{type:"raw",value:"\n </div>\n\n </td>\n "}]}},{type:"raw",value:" "},{type:"raw",value:'\n </tr>\n </tbody>\n\n</table>\n\n<div class="ai1ec-pull-left">'},{type:"output",stack:[{type:"Twig.expression.type.variable",value:"pagination_links",match:["pagination_links"]},{type:"Twig.expression.type.filter",value:"raw",match:["| raw","raw"]}]},{type:"raw",value:"</div>\n"}],precompiled:!0}),n});
public/js/pages/add_new_event.js CHANGED
@@ -161,4 +161,4 @@ CONDITIONS OF ANY KIND, either express or implied. See the Apache License and th
161
  the specific language governing permissions and limitations under the Apache License and the GPL License.
162
  */
163
 
164
- timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("external_libs/bootstrap/tab",["jquery_timely"],function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.ai1ec-dropdown-menu)"),r=t.data("target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("ai1ec-active"))return;var i=n.find(".ai1ec-active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("ai1ec-active").find("> .ai1ec-dropdown-menu > .ai1ec-active").removeClass("ai1ec-active"),t.addClass("ai1ec-active"),s?(t[0].offsetWidth,t.addClass("ai1ec-in")):t.removeClass("ai1ec-fade"),t.parent(".ai1ec-dropdown-menu")&&t.closest("li.ai1ec-dropdown").addClass("ai1ec-active"),r&&r()}var i=n.find("> .ai1ec-active"),s=r&&e.support.transition&&i.hasClass("ai1ec-fade");s?i.one(e.support.transition.end,o).emulateTransitionEnd(150):o(),i.removeClass("ai1ec-in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="ai1ec-tab"], [data-toggle="ai1ec-pill"]',function(t){t.preventDefault(),e(this).tab("show")})}),timely.define("libs/utils",["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert ai1ec-alert-info"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")},add_query_arg:function(e,t){if("string"!=typeof e)return!1;var n=e.indexOf("?")===-1?"?":"&";return-1!==e.indexOf(n+t[0]+"=")?e:e+n+t[0]+"="+t[1]},create_ai1ec_to_send:function(t){var n=e(t),r=[],i=["action","cat_ids","auth_ids","tag_ids","exact_date","display_filters","no_navigation","events_limit"],s=function(e){return e.replace(/\W+(.)/g,function(e,t){return t.toUpperCase()})};return e(i).each(function(e,t){var i=n.data(s(t));i&&r.push(t+"~"+i)}),r.join("|")},init_autoselect:function(){e(document).on("click",".ai1ec-autoselect",function(t){if(e(this).data("clicked")&&t.originalEvent.detail<2)return;e(this).data("clicked",!0);var n;document.body.createTextRange?(n=document.body.createTextRange(),n.moveToElementText(this),n.select()):window.getSelection&&(selection=window.getSelection(),n=document.createRange(),n.selectNodeContents(this),selection.removeAllRanges(),selection.addRange(n))})}}}();return t}),timely.define("scripts/add_new_event/event_location/input_coordinates_utility_functions",["jquery_timely","ai1ec_config","libs/utils"],function(e,t,n){var r=function(){e("#ai1ec_input_coordinates:checked").length>0&&e("#ai1ec_table_coordinates input.ai1ec-coordinates").each(function(){this.value=n.convert_comma_to_dot(this.value)})},i=function(t,n){var r=e("<div />",{text:n,"class":"ai1ec-error"});e(t).after(r)},s=function(t,n){t.target.id==="post"&&(t.stopImmediatePropagation(),t.preventDefault(),e("#publish").removeClass("button-primary-disabled"),e("#publish").siblings(".spinner").css("visibility","hidden")),e(n).focus()},o=function(){var t=n.field_has_value("ai1ec_address"),r=!0;return e("input.ai1ec-coordinates").each(function(){var e=n.field_has_value(this.id);e||(r=!1)}),t||r},u=function(n){var r=!0,o=!1;return e("#ai1ec_input_coordinates:checked").length>0&&(e("div.ai1ec-error").remove(),e("#ai1ec_table_coordinates input.ai1ec-coordinates").each(function(){var n=e(this).hasClass("latitude"),s=n?t.error_message_not_entered_lat:t.error_message_not_entered_long;this.value===""&&(r=!1,o===!1&&(o=this),i(this,s))})),r===!1&&s(n,o),r},a=function(r){if(e("#ai1ec_input_coordinates:checked").length===1){e("div.ai1ec-error").remove();var o=!0,u=!1,a=!1;return e("#ai1ec_table_coordinates input.ai1ec-coordinates").each(function(){if(this.value===""){a=!0;return}var r=e(this).hasClass("latitude"),s=r?t.error_message_not_valid_lat:t.error_message_not_valid_long;n.is_valid_coordinate(this.value,r)||(o=!1,u===!1&&(u=this),i(this,s))}),o===!1&&s(r,u),a===!0&&(o=!1),o}};return{ai1ec_convert_commas_to_dots_for_coordinates:r,ai1ec_show_error_message_after_element:i,check_if_address_or_coordinates_are_set:o,ai1ec_check_lat_long_fields_filled_when_publishing_event:u,ai1ec_check_lat_long_ok_for_search:a}}),timely.define("external_libs/jquery.autocomplete_geomod",["jquery_timely"],function(e){e.fn.extend({autocomplete:function(t,n){var r=typeof t=="string";return n=e.extend({},e.Autocompleter.defaults,{url:r?t:null,data:r?null:t,delay:r?e.Autocompleter.defaults.delay:10,max:n&&!n.scroll?10:150},n),n.highlight=n.highlight||function(e){return e},n.formatMatch=n.formatMatch||n.formatItem,this.each(function(){new e.Autocompleter(this,n)})},result:function(e){return this.bind("result",e)},search:function(e){return this.trigger("search",[e])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(e){return this.trigger("setOptions",[e])},unautocomplete:function(){return this.trigger("unautocomplete")}}),e.Autocompleter=function(t,n){function d(){var r=h.selected();if(!r)return!1;var s=r.result;o=s;if(n.multiple){var u=m(i.val());if(u.length>1){var a=n.multipleSeparator.length,f=e(t).selection().start,l,c=0;e.each(u,function(e,t){c+=t.length;if(f<=c)return l=e,!1;c+=a}),u[l]=s,s=u.join(n.multipleSeparator)}s+=n.multipleSeparator}return i.val(s),w(),i.trigger("result",[r.data,r.value]),!0}function v(e,t){if(f==r.DEL){h.hide();return}var s=i.val();if(!t&&s==o)return;o=s,s=g(s),s.length>=n.minChars?(i.addClass(n.loadingClass),n.matchCase||(s=s.toLowerCase()),S(s,E,w)):(T(),h.hide())}function m(t){return t?n.multiple?e.map(t.split(n.multipleSeparator),function(n){return e.trim(t).length?e.trim(n):null}):[e.trim(t)]:[""]}function g(r){if(!n.multiple)return r;var i=m(r);if(i.length==1)return i[0];var s=e(t).selection().start;return s==r.length?i=m(r):i=m(r.replace(r.substring(s),"")),i[i.length-1]}function y(s,u){n.autoFill&&g(i.val()).toLowerCase()==s.toLowerCase()&&f!=r.BACKSPACE&&(i.val(i.val()+u.substring(g(o).length)),e(t).selection(o.length,o.length+u.length))}function b(){clearTimeout(s),s=setTimeout(w,200)}function w(){var e=h.visible();h.hide(),clearTimeout(s),T(),n.mustMatch&&i.search(function(e){if(!e)if(n.multiple){var t=m(i.val()).slice(0,-1);i.val(t.join(n.multipleSeparator)+(t.length?n.multipleSeparator:""))}else i.val(""),i.trigger("result",null)})}function E(e,t){t&&t.length&&a?(T(),h.display(t,e),y(e,t[0].value),h.show()):w()}function S(r,i,s){n.matchCase||(r=r.toLowerCase());var o=u.load(r);if(o&&o.length)i(r,o);else if(n.geocoder){var a=g(r),f={address:a};n.region&&(f.region=n.region),n.geocoder.geocode(f,function(e,t){var s=n.parse(e,t,a);u.add(r,s),i(r,s)})}else if(typeof n.url=="string"&&n.url.length>0){var l={timestamp:+(new Date)};e.each(n.extraParams,function(e,t){l[e]=typeof t=="function"?t():t}),e.ajax({mode:"abort",port:"autocomplete"+t.name,dataType:n.dataType,url:n.url,data:e.extend({q:g(r),limit:n.max},l),success:function(e){var t=n.parse&&n.parse(e)||x(e);u.add(r,t),i(r,t)}})}else h.emptyList(),s(r)}function x(t){var r=[],i=t.split("\n");for(var s=0;s<i.length;s++){var o=e.trim(i[s]);o&&(o=o.split("|"),r[r.length]={data:o,value:o[0],result:n.formatResult&&n.formatResult(o,o[0])||o[0]})}return r}function T(){i.removeClass(n.loadingClass)}var r={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8},i=e(t).attr("autocomplete","off").addClass(n.inputClass),s,o="",u=e.Autocompleter.Cache(n),a=0,f,l=navigator.userAgent.match(/opera/i),c={mouseDownOnSelect:!1},h=e.Autocompleter.Select(n,t,d,c),p;l&&e(t.form).bind("submit.autocomplete",function(){if(p)return p=!1,!1}),i.bind((l?"keypress":"keydown")+".autocomplete",function(t){a=1,f=t.keyCode;switch(t.keyCode){case r.UP:t.preventDefault(),h.visible()?h.prev():v(0,!0);break;case r.DOWN:t.preventDefault(),h.visible()?h.next():v(0,!0);break;case r.PAGEUP:t.preventDefault(),h.visible()?h.pageUp():v(0,!0);break;case r.PAGEDOWN:t.preventDefault(),h.visible()?h.pageDown():v(0,!0);break;case n.multiple&&e.trim(n.multipleSeparator)==","&&r.COMMA:case r.TAB:case r.RETURN:if(d())return t.preventDefault(),p=!0,!1;break;case r.ESC:h.hide();break;default:clearTimeout(s),s=setTimeout(v,n.delay)}}).focus(function(){a++}).blur(function(){a=0,c.mouseDownOnSelect||b()}).click(function(){a++>1&&!h.visible()&&v(0,!0)}).bind("search",function(){function n(e,n){var r;if(n&&n.length)for(var s=0;s<n.length;s++)if(n[s].result.toLowerCase()==e.toLowerCase()){r=n[s];break}typeof t=="function"?t(r):i.trigger("result",r&&[r.data,r.value])}var t=arguments.length>1?arguments[1]:null;e.each(m(i.val()),function(e,t){S(t,n,n)})}).bind("flushCache",function(){u.flush()}).bind("setOptions",function(){e.extend(n,arguments[1]),"data"in arguments[1]&&u.populate()}).bind("unautocomplete",function(){h.unbind(),i.unbind(),e(t.form).unbind(".autocomplete")})},e.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:!1,matchSubset:!0,matchContains:!1,cacheLength:10,max:100,mustMatch:!1,extraParams:{},selectFirst:!0,formatItem:function(e){return e[0]},formatMatch:null,autoFill:!1,width:0,multiple:!1,multipleSeparator:", ",highlight:function(e,t){return e.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+t.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:!0,scrollHeight:180},e.Autocompleter.Cache=function(t){function i(e,n){t.matchCase||(e=e.toLowerCase());var r=e.indexOf(n);return t.matchContains=="word"&&(r=e.toLowerCase().search("\\b"+n.toLowerCase())),r==-1?!1:r==0||t.matchContains}function s(e,i){r>t.cacheLength&&u(),n[e]||r++,n[e]=i}function o(){if(!t.data)return!1;var n={},r=0;t.url||(t.cacheLength=1),n[""]=[];for(var i=0,o=t.data.length;i<o;i++){var u=t.data[i];u=typeof u=="string"?[u]:u;var a=t.formatMatch(u,i+1,t.data.length);if(a===!1)continue;var f=a.charAt(0).toLowerCase();n[f]||(n[f]=[]);var l={value:a,data:u,result:t.formatResult&&t.formatResult(u)||a};n[f].push(l),r++<t.max&&n[""].push(l)}e.each(n,function(e,n){t.cacheLength++,s(e,n)})}function u(){n={},r=0}var n={},r=0;return setTimeout(o,25),{flush:u,add:s,populate:o,load:function(s){if(!t.cacheLength||!r)return null;if(!t.url&&t.matchContains){var o=[];for(var u in n)if(u.length>0){var a=n[u];e.each(a,function(e,t){i(t.value,s)&&o.push(t)})}return o}if(n[s])return n[s];if(t.matchSubset)for(var f=s.length-1;f>=t.minChars;f--){var a=n[s.substr(0,f)];if(a){var o=[];return e.each(a,function(e,t){i(t.value,s)&&(o[o.length]=t)}),o}}return null}}},e.Autocompleter.Select=function(t,n,r,i){function p(){if(!l)return;c=e("<div/>").hide().addClass(t.resultsClass).css("position","absolute").appendTo(document.body),h=e("<ul/>").appendTo(c).mouseover(function(t){d(t).nodeName&&d(t).nodeName.toUpperCase()=="LI"&&(u=e("li",h).removeClass(s.ACTIVE).index(d(t)),e(d(t)).addClass(s.ACTIVE))}).click(function(t){return e(d(t)).addClass(s.ACTIVE),r(),n.focus(),!1}).mousedown(function(){i.mouseDownOnSelect=!0}).mouseup(function(){i.mouseDownOnSelect=!1}),t.width>0&&c.css("width",t.width),l=!1}function d(e){var t=e.target;while(t&&t.tagName!="LI")t=t.parentNode;return t?t:[]}function v(e){o.slice(u,u+1).removeClass(s.ACTIVE),m(e);var n=o.slice(u,u+1).addClass(s.ACTIVE);if(t.scroll){var r=0;o.slice(0,u).each(function(){r+=this.offsetHeight}),r+n[0].offsetHeight-h.scrollTop()>h[0].clientHeight?h.scrollTop(r+n[0].offsetHeight-h.innerHeight()):r<h.scrollTop()&&h.scrollTop(r)}}function m(e){u+=e,u<0?u=o.size()-1:u>=o.size()&&(u=0)}function g(e){return t.max&&t.max<e?t.max:e}function y(){h.empty();var n=g(a.length);for(var r=0;r<n;r++){if(!a[r])continue;var i=t.formatItem(a[r].data,r+1,n,a[r].value,f);if(i===!1)continue;var l=e("<li/>").html(t.highlight(i,f)).addClass(r%2==0?"ac_even":"ac_odd").appendTo(h)[0];e.data(l,"ac_data",a[r])}o=h.find("li"),t.selectFirst&&(o.slice(0,1).addClass(s.ACTIVE),u=0),e.fn.bgiframe&&h.bgiframe()}var s={ACTIVE:"ac_over"},o,u=-1,a,f="",l=!0,c,h;return{display:function(e,t){p(),a=e,f=t,y()},next:function(){v(1)},prev:function(){v(-1)},pageUp:function(){u!=0&&u-8<0?v(-u):v(-8)},pageDown:function(){u!=o.size()-1&&u+8>o.size()?v(o.size()-1-u):v(8)},hide:function(){c&&c.hide(),o&&o.removeClass(s.ACTIVE),u=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(o.filter("."+s.ACTIVE)[0]||t.selectFirst&&o[0])},show:function(){var r=e(n).offset();c.css({width:typeof t.width=="string"||t.width>0?t.width:e(n).width(),top:r.top+n.offsetHeight,left:r.left}).show();if(t.scroll){h.scrollTop(0),h.css({maxHeight:t.scrollHeight,overflow:"auto"});if(navigator.userAgent.match(/msie/i)&&typeof document.body.style.maxHeight=="undefined"){var i=0;o.each(function(){i+=this.offsetHeight});var s=i>t.scrollHeight;h.css("height",s?t.scrollHeight:i),s||o.width(h.width()-parseInt(o.css("padding-left"))-parseInt(o.css("padding-right")))}}},selected:function(){var t=o&&o.filter("."+s.ACTIVE).removeClass(s.ACTIVE);return t&&t.length&&e.data(t[0],"ac_data")},emptyList:function(){h&&h.empty()},unbind:function(){c&&c.remove()}}},e.fn.selection=function(e,t){if(e!==undefined)return this.each(function(){if(this.createTextRange){var n=this.createTextRange();t===undefined||e==t?(n.move("character",e),n.select()):(n.collapse(!0),n.moveStart("character",e),n.moveEnd("character",t),n.select())}else this.setSelectionRange?this.setSelectionRange(e,t):this.selectionStart&&(this.selectionStart=e,this.selectionEnd=t)});var n=this[0];if(n.createTextRange){var r=document.selection.createRange(),i=n.value,s="<->",o=r.text.length;r.text=s;var u=n.value.indexOf(s);return n.value=i,this.selection(u,u+o),{start:u,end:u+o}}if(n.selectionStart!==undefined)return{start:n.selectionStart,end:n.selectionEnd}}}),timely.define("external_libs/geo_autocomplete",["jquery_timely","external_libs/jquery.autocomplete_geomod"],function(e){e.fn.extend({geo_autocomplete:function(t,n){return options=e.extend({},e.Autocompleter.defaults,{geocoder:t,mapwidth:100,mapheight:100,maptype:"terrain",mapkey:"ABQIAAAAbnvDoAoYOSW2iqoXiGTpYBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQNumU68AwGqjbSNF9YO8NokKst8w",mapsensor:!1,parse:function(t,n,r){var i=[];return t&&n&&n=="OK"&&e.each(t,function(t,n){if(n.geometry&&n.geometry.viewport){var s=n.formatted_address.split(","),o=s[0];e.each(s,function(t,n){if(n.toLowerCase().indexOf(r.toLowerCase())!=-1)return o=e.trim(n),!1}),i.push({data:n,value:o,result:o})}}),i},formatItem:function(e,t,n,r){var i="https://maps.google.com/maps/api/staticmap?visible="+e.geometry.viewport.getSouthWest().toUrlValue()+"|"+e.geometry.viewport.getNorthEast().toUrlValue()+"&size="+options.mapwidth+"x"+options.mapheight+"&maptype="+options.maptype+"&key="+options.mapkey+"&sensor="+(options.mapsensor?"true":"false"),s=e.formatted_address.replace(/,/gi,",<br/>");return'<img src="'+i+'" width="'+options.mapwidth+'" height="'+options.mapheight+'" /> '+s+'<br clear="both"/>'}},n),options.highlight=options.highlight||function(e){return e},options.formatMatch=options.formatMatch||options.formatItem,options.resultsClass="ai1ec-geo-ac-results-not-ready",this.each(function(){e(this).one("focus",function(){var t=setInterval(function(){var n=e(".ai1ec-geo-ac-results-not-ready");n.length&&(n.removeClass("ai1ec-geo-ac-results-not-ready").addClass("ai1ec-geo-ac-results").children("ul").addClass("ai1ec-dropdown-menu"),clearInterval(t))},500)}),new e.Autocompleter(this,options)})}})}),timely.define("scripts/add_new_event/event_location/gmaps_helper",["jquery_timely","domReady","ai1ec_config","scripts/add_new_event/event_location/input_coordinates_utility_functions","external_libs/jquery.autocomplete_geomod","external_libs/geo_autocomplete"],function(e,t,n,r){var i,s,o,u,a,f,l=function(t){e("#ai1ec_latitude").val(t.latLng.lat()),e("#ai1ec_longitude").val(t.latLng.lng()),e("#ai1ec_input_coordinates:checked").length===0&&e("#ai1ec_input_coordinates").trigger("click")},c=function(){n.disable_autocompletion||e("#ai1ec_address").geo_autocomplete(new google.maps.Geocoder,{selectFirst:!1,minChars:3,cacheLength:50,width:300,scroll:!0,scrollHeight:330,region:n.region}).result(function(e,t){t&&p(t)}).change(function(){if(e(this).val().length>0){var t=e(this).val();i.geocode({address:t,region:n.region},function(e,t){t===google.maps.GeocoderStatus.OK&&p(e[0])})}})},h=function(){i=new google.maps.Geocoder,s=new google.maps.LatLng(9.965,-83.327),o={zoom:0,mapTypeId:google.maps.MapTypeId.ROADMAP,center:s},t(function(){e("#ai1ec_map_canvas").length>0&&(u=new google.maps.Map(e("#ai1ec_map_canvas").get(0),o),a=new google.maps.Marker({map:u,draggable:!0}),google.maps.event.addListener(a,"dragend",l),a.setPosition(s),c(),v(),e('a[href="#ai1ec-event-location-box"]').on("click",function(){window.setTimeout(function(){google.maps.event.trigger(u,"resize"),u.setCenter(a.getPosition())},150)}))})},p=function(t){u.setCenter(t.geometry.location),u.setZoom(15),a.setPosition(t.geometry.location),e("#ai1ec_address").val(t.formatted_address),e("#ai1ec_latitude").val(t.geometry.location.lat()),e("#ai1ec_longitude").val(t.geometry.location.lng()),e("#ai1ec_input_coordinates").is(":checked")||e("#ai1ec_input_coordinates").click();var n="",r="",i="",s=0,o=0,f="",l;for(var c=0;c<t.address_components.length;c++)switch(t.address_components[c].types[0]){case"street_number":n=t.address_components[c].long_name;break;case"route":r=t.address_components[c].long_name;break;case"locality":i=t.address_components[c].long_name;break;case"administrative_area_level_1":f=t.address_components[c].long_name;break;case"postal_code":s=t.address_components[c].long_name;break;case"country":l=t.address_components[c].short_name,o=t.address_components[c].long_name}var h=n.length>0?n+" ":"";h+=r.length>0?r:"",s=s!==0?s:"",e("#ai1ec_city").val(i),e("#ai1ec_province").val(f),e("#ai1ec_postal_code").val(s),e("#ai1ec_country").val(o),e("#ai1ec_country_short").val(l)},d=function(){var t=parseFloat(e("#ai1ec_latitude").val()),n=parseFloat(e("#ai1ec_longitude").val()),r=new google.maps.LatLng(t,n);u.setCenter(r),u.setZoom(15),a.setPosition(r)},v=function(){e("#ai1ec_input_coordinates:checked").length===0?(e("#ai1ec_table_coordinates").hide(),e("#ai1ec_address").change()):d()},m=function(){return a},g=function(){return f};return{init_gmaps:h,ai1ec_update_map_from_coordinates:d,get_marker:m,get_position:g}}),timely.define("scripts/add_new_event/event_location/input_coordinates_event_handlers",["jquery_timely","scripts/add_new_event/event_location/input_coordinates_utility_functions","scripts/add_new_event/event_location/gmaps_helper","ai1ec_config"],function(e,t,n,r){var i=function(t){this.checked?e(".ai1ec-map-preview").addClass("ai1ec-map-visible"):e(".ai1ec-map-preview").removeClass("ai1ec-map-visible")},s=function(t){this.checked?e("#ai1ec_table_coordinates").fadeIn("fast"):e("#ai1ec_table_coordinates").fadeOut("fast")},o=function(e){t.ai1ec_convert_commas_to_dots_for_coordinates();var r=t.ai1ec_check_lat_long_ok_for_search(e);r===!0&&n.ai1ec_update_map_from_coordinates()};return{toggle_visibility_of_google_map_on_click:i,toggle_visibility_of_coordinate_fields_on_click:s,update_map_from_coordinates_on_blur:o}}),timely.define("external_libs/jquery.calendrical_timespan",["jquery_timely"],function(e){function l(){var e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function c(e,t){return typeof e=="string"&&(e=new Date(e)),typeof t=="string"&&(t=new Date(t)),e.getUTCDate()===t.getUTCDate()&&e.getUTCMonth()===t.getUTCMonth()&&e.getUTCFullYear()===t.getUTCFullYear()?!0:!1}function h(e,t){if(e instanceof Date)return h(e.getUTCFullYear(),e.getUTCMonth());if(t==1){var n=e%4==0&&(e%100!=0||e%400==0);return n?29:28}return t==3||t==5||t==8||t==10?30:31}function p(e){return new Date(e.getTime()+864e5)}function d(e){return new Date(e.getTime()-864e5)}function v(e,t){return t==11?new Date(e+1,0,1):new Date(e,t+1,1)}function m(t,n,r,i){var s=i.monthNames.split(","),o=e("<thead />"),u=e("<tr />").appendTo(o);e("<th />").addClass("monthCell").append(e('<a href="javascript:;">&laquo;</a>').addClass("prevMonth").mousedown(function(e){g(t,r==0?n-1:n,r==0?11:r-1,i),e.preventDefault()})).appendTo(u),e("<th />").addClass("monthCell").attr("colSpan",5).append(e('<a href="javascript:;">'+s[r]+" "+n+"</a>").addClass("monthName")).appendTo(u),e("<th />").addClass("monthCell").append(e('<a href="javascript:;">&raquo;</a>').addClass("nextMonth").mousedown(function(){g(t,r==11?n+1:n,r==11?0:r+1,i)})).appendTo(u);var a=i.dayNames.split(","),f=parseInt(i.weekStartDay),l=[];for(var c=0,h=a.length;c<h;c++)l[c]=a[(c+f)%h];var p=e("<tr />").appendTo(o);return e.each(l,function(t,n){e("<td />").addClass("dayName").append(n).appendTo(p)}),o}function g(t,n,r,i){i=i||{};var s=parseInt(i.weekStartDay),o=i.today?i.today:l();o.setHours(0),o.setMinutes(0);var u=new Date(n,r,1),a=v(n,r),f=Math.abs(o.getTimezoneOffset());f!=0&&(o.setHours(o.getHours()+f/60),o.setMinutes(o.getMinutes()+f%60),u.setHours(u.getHours()+f/60),u.setMinutes(u.getMinutes()+f%60),a.setHours(a.getHours()+f/60),a.setMinutes(a.getMinutes()+f%60));var h=a.getUTCDay()-s;h<0?h=Math.abs(h)-1:h=6-h;for(var g=0;g<h;g++)a=p(a);var y=e("<table />");m(t,n,r,i).appendTo(y);var b=e("<tbody />").appendTo(y),w=e("<tr />"),E=u.getUTCDay()-s;E<0&&(E=7+E);for(var g=0;g<E;g++)u=d(u);while(u<=a){var S=e("<td />").addClass("day").append(e('<a href="javascript:;">'+u.getUTCDate()+"</a>").click(function(){var e=u;return function(){i&&i.selectDate&&i.selectDate(e)}}())).appendTo(w),x=c(u,o),T=i.selected&&c(i.selected,u);x&&S.addClass("today"),T&&S.addClass("selected"),x&&T&&S.addClass("today_selected"),u.getUTCMonth()!=r&&S.addClass("nonMonth");var N=u.getUTCDay();(N+1)%7==s&&(b.append(w),w=e("<tr />")),u=p(u)}w.children().length?b.append(w):w.remove(),t.empty().append(y)}function y(t,n){var r=n.selection&&f(n.selection);r&&(r.minute=Math.floor(r.minute/15)*15);var i=n.startTime&&n.startTime.hour*60+n.startTime.minute,s,o=e("<ul />");for(var a=0;a<24;a++)for(var l=0;l<60;l+=15){if(i&&i>a*60+l)continue;(function(){var t=u(a,l,n.isoTime),f=t;if(i!=null){var c=a*60+l-i;c<60?f+=" ("+c+" min)":c==60?f+=" (1 hr)":f+=" ("+Math.floor(c/60)+" hr "+c%60+" min)"}var h=e("<li />").append(e('<a href="javascript:;">'+f+"</a>").click(function(){n&&n.selectTime&&n.selectTime(t)}).mousemove(function(){e("li.selected",o).removeClass("selected")})).appendTo(o);!s&&a==n.defaultHour&&(s=h),r&&r.hour==a&&r.minute==l&&(h.addClass("selected"),s=h)})()}s&&setTimeout(function(){t[0].scrollTop=s[0].offsetTop-s.height()*2},0),t.empty().append(o)}function b(e){e.addClass("error").fadeOut("normal",function(){e.val(e.data("timespan.stored")).removeClass("error").fadeIn("fast")})}function w(){e(this).data("timespan.stored",this.value)}function E(t,n,r,i,a,f,l,c,h,p){r.val(r.data("timespan.initial_value")),f.val(f.data("timespan.initial_value")),l.get(0).checked=l.data("timespan.initial_value");var d=s(r,p,0,15);n.val(u(d.getUTCHours(),d.getUTCMinutes(),c)),t.val(o(d,h));var v=s(f,d.getTime(),1,15);a.val(u(v.getUTCHours(),v.getUTCMinutes(),c)),l.get(0).checked&&v.setUTCDate(v.getUTCDate()-1),i.val(o(v,h)),t.each(w),n.each(w),i.each(w),a.each(w),l.trigger("change.timespan"),e("#ai1ec_instant_event").trigger("change.timespan")}var t={us:{pattern:/([\d]{1,2})\/([\d]{1,2})\/([\d]{4}|[\d]{2})/,format:"m/d/y",order:"middleEndian",zeroPad:!1},iso:{pattern:/([\d]{4}|[\d]{2})-([\d]{1,2})-([\d]{1,2})/,format:"y-m-d",order:"bigEndian",zeroPad:!0},dot:{pattern:/([\d]{1,2}).([\d]{1,2}).([\d]{4}|[\d]{2})/,format:"d.m.y",order:"littleEndian",zeroPad:!1},def:{pattern:/([\d]{1,2})\/([\d]{1,2})\/([\d]{4}|[\d]{2})/,format:"d/m/y",order:"littleEndian",zeroPad:!1}},n=function(e){return e<10?"0"+e:e},r=function(e,t){typeof t=="undefined"&&(t=!1);var r=e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1)+"-"+n(e.getUTCDate());return t&&(r+="T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":00"),r},i=function(e,t){var n=e.val(),r=null;if(n.length<4)r=new Date(t);else{r=new Date(n);var i=n.split("T"),s=i[0].split("-"),o=i[1].split(":");r.setUTCFullYear(s[0],s[1]-1,s[2]),r.setUTCHours(o[0],o[1],o[2],0)}return r},s=function(e,t,n,r){return t+=n*36e5,t-=t%(r*6e4),i(e,t)},o=function(e,n,r){var i,s,o;typeof t[n]=="undefined"&&(n="def"),typeof r=="undefined"&&(r=!1),!0===r?(i=e.getFullYear().toString(),s=(e.getMonth()+1).toString(),o=e.getDate().toString()):(i=e.getUTCFullYear().toString(),s=(e.getUTCMonth()+1).toString(),o=e.getUTCDate().toString()),t[n].zeroPad&&(s.length==1&&(s="0"+s),o.length==1&&(o="0"+o));var u=t[n].format;return u=u.replace("d",o),u=u.replace("m",s),u=u.replace("y",i),u},u=function(e,t,n){var r=t;t<10&&(r="0"+t);if(n){var i=e;return i<10&&(i="0"+e),i+":"+r}var i=e%12;i==0&&(i=12);var s=e<12?"am":"pm";return i+":"+r+s},a=function(e,n){typeof t[n]=="undefined"&&(n="def");var r=e.match(t[n].pattern);if(!r||r.length!=4)return Date("invalid");switch(t[n].order){case"bigEndian":var i=r[3],s=r[2],o=r[1];break;case"littleEndian":var i=r[1],s=r[2],o=r[3];break;case"middleEndian":var i=r[2],s=r[1],o=r[3];break;default:var i=r[1],s=r[2],o=r[3]}return o.length==2&&(o=(new Date).getUTCFullYear().toString().substr(0,2)+o),new Date(s+"/"+i+"/"+o+" GMT")},f=function(e){var t=t=/(\d+)\s*[:\-\.,]\s*(\d+)\s*(am|pm)?/i.exec(e);if(t&&t.length>=3){var n=Number(t[1]),r=Number(t[2]);return n==12&&t[3]&&(n-=12),t[3]&&t[3].toLowerCase()=="pm"&&(n+=12),{hour:n,minute:r}}return null};e.fn.calendricalDate=function(t){return t=t||{},t.padding=t.padding||4,t.monthNames=t.monthNames||"January,February,March,April,May,June,July,August,September,October,November,December",t.dayNames=t.dayNames||"S,M,T,W,T,F,S",t.weekStartDay=t.weekStartDay||0,this.each(function(){var n=e(this),r,i=!1;n.bind("focus",function(){if(r)return;var s=n.position(),u=n.css("padding-left");r=e("<div />").addClass("calendricalDatePopup").mouseenter(function(){i=!0}).mouseleave(function(){i=!1}).mousedown(function(e){e.preventDefault()}).css({position:"absolute",left:s.left,top:s.top+n.height()+t.padding*2}),n.after(r);var f=a(n.val(),t.dateFormat);f.getUTCFullYear()||(f=t.today?t.today:l()),g(r,f.getUTCFullYear(),f.getUTCMonth(),{today:t.today,selected:f,monthNames:t.monthNames,dayNames:t.dayNames,weekStartDay:t.weekStartDay,selectDate:function(e){i=!1,n.val(o(e,t.dateFormat)),r.remove(),r=null;if(t.endDate){var s=a(t.endDate.val(),t.dateFormat);s>=f&&t.endDate.val(o(new Date(e.getTime()+s.getTime()-f.getTime()),t.dateFormat))}}})}).blur(function(){if(i){r&&n.focus();return}if(!r)return;r.remove(),r=null})})},e.fn.calendricalDateRange=function(t){return this.length>=2&&(e(this[0]).calendricalDate(e.extend({endDate:e(this[1])},t)),e(this[1]).calendricalDate(t)),this},e.fn.calendricalDateRangeSingle=function(t){return this.length==1&&e(this).calendricalDate(t),this},e.fn.calendricalTime=function(t){return t=t||{},t.padding=t.padding||4,this.each(function(){var n=e(this),r,i=!1;n.bind("focus click",function(){if(r)return;var s=t.startTime;s&&t.startDate&&t.endDate&&!c(a(t.startDate.val()),a(t.endDate.val()))&&(s=!1);var o=n.position();r=e("<div />").addClass("calendricalTimePopup").mouseenter(function(){i=!0}).mouseleave(function(){i=!1}).mousedown(function(e){e.preventDefault()}).css({position:"absolute",left:o.left,top:o.top+n.height()+t.padding*2}),s&&r.addClass("calendricalEndTimePopup"),n.after(r);var u={selection:n.val(),selectTime:function(e){i=!1,n.val(e),r.remove(),r=null},isoTime:t.isoTime||!1,defaultHour:t.defaultHour!=null?t.defaultHour:8};s&&(u.startTime=f(t.startTime.val())),y(r,u)}).blur(function(){if(i){r&&n.focus();return}if(!r)return;r.remove(),r=null})})},e.fn.calendricalTimeRange=function(t){return this.length>=2&&(e(this[0]).calendricalTime(t),e(this[1]).calendricalTime(e.extend({startTime:e(this[0])},t))),this},e.fn.calendricalDateTimeRange=function(t){return this.length>=4&&(e(this[0]).calendricalDate(e.extend({endDate:e(this[2])},t)),e(this[1]).calendricalTime(t),e(this[2]).calendricalDate(t),e(this[3]).calendricalTime(e.extend({startTime:e(this[1]),startDate:e(this[0]),endDate:e(this[2])},t))),this};var S={allday:"#allday",start_date_input:"#start-date-input",start_time_input:"#start-time-input",start_time:"#start-time",end_date_input:"#end-date-input",end_time_input:"#end-time-input",end_time:"#end-time",twentyfour_hour:!1,date_format:"def",now:new Date},x={init:function(t){function C(){var e=a(s.val(),n.date_format).getTime()/1e3,t=f(l.val());e+=t.hour*3600+t.minute*60;var r=a(h.val(),n.date_format).getTime()/1e3,i=f(p.val());return r+=i.hour*3600+i.minute*60,r-e}function k(){var e=a(s.data("timespan.stored"),n.date_format),t=f(l.data("timespan.stored")),r=e.getTime()/1e3+t.hour*3600+t.minute*60+s.data("time_diff");return r=new Date(r*1e3),h.val(o(r,n.date_format)),p.val(u(r.getUTCHours(),r.getUTCMinutes(),n.twentyfour_hour)),!0}var n=e.extend({},S,t),i=e(n.allday),s=e(n.start_date_input),l=e(n.start_time_input),c=e(n.start_time),h=e(n.end_date_input),p=e(n.end_time_input),d=e(n.end_time),v=e("#ai1ec_instant_event"),m=h.add(p),g=s.add(n.end_date_input),y=l.add(n.end_time_input),x=s.add(n.start_time_input).add(n.end_date_input).add(n.end_time_input);x.bind("focus.timespan",w),v.bind("change.timespan",function(){this.checked?(m.closest("tr").fadeOut(),i.attr("disabled",!0)):(i.removeAttr("disabled"),m.closest("tr").fadeIn())});var T=new Date(n.now.getFullYear(),n.now.getMonth(),n.now.getDate()),N=!1;return i.bind("change.timespan",function(){this.checked?(y.fadeOut(),v.attr("disabled",!0)):(v.removeAttr("disabled"),y.fadeIn()),N||(N=!0,x.calendricalDateTimeRange({today:T,dateFormat:n.date_format,isoTime:n.twentyfour_hour,monthNames:n.month_names,dayNames:n.day_names,weekStartDay:n.week_start_day}))}).get().checked=!1,g.bind("blur.timespan",function(){var t=a(this.value,n.date_format);isNaN(t)?b(e(this)):(e(this).data("timespan.stored",this.value),e(this).val(o(t,n.date_format)))}),y.bind("blur.timespan",function(){var t=f(this.value);t?(e(this).data("timespan.stored",this.value),e(this).val(u(t.hour,t.minute,n.twentyfour_hour))):b(e(this))}),s.add(n.start_time_input).bind("focus.timespan",function(){s.data("time_diff",C())}).bind("blur.timespan",function(){s.data("time_diff")<0&&s.data("time_diff",900);var e=k()}),h.add(n.start_time_input).bind("blur.timespan",function(){if(C()<0){s.data("time_diff",900);var e=k()}}),s.closest("form").bind("submit.timespan",function(){var e=a(s.val(),n.date_format).getTime()/1e3;if(!isNaN(e)){if(!i.get(0).checked){var t=f(l.val());t?e+=t.hour*3600+t.minute*60:e=""}}else e="";e>0&&c.val(r(new Date(e*1e3),!0));var o=a(h.val(),n.date_format).getTime()/1e3;if(!isNaN(o))if(i.get(0).checked)o+=86400;else{var t=f(p.val());t?o+=t.hour*3600+t.minute*60:o=""}else o="";o>0&&d.val(r(new Date(o*1e3),!0))}),c.data("timespan.initial_value",c.val()),d.data("timespan.initial_value",d.val()),i.data("timespan.initial_value",i.get(0).checked),E(s,l,c,h,p,d,i,n.twentyfour_hour,n.date_format,n.now),this},reset:function(t){var n=e.extend({},S,t);return E(e(n.start_date_input),e(n.start_time_input),e(n.start_time),e(n.end_date_input),e(n.end_time_input),e(n.end_time),e(n.allday),n.twentyfour_hour,n.date_format,n.now),this},destroy:function(t){return t=e.extend({},S,t),e.each(t,function(t,n){e(n).unbind(".timespan")}),e(t.start_date_input).closest("form").unbind(".timespan"),this}};return e.timespan=function(t){if(x[t])return x[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return x.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.timespan")},{formatDate:o,parseDate:a}}),timely.define("scripts/add_new_event/event_date_time/date_time_utility_functions",["jquery_timely","ai1ec_config","libs/utils","external_libs/jquery.calendrical_timespan"],function(e,t,n,r){var i=n.get_ajax_url(),s=function(t,n,r,i,s,o){e(t).val(i),e("#ai1ec_repeat_box").modal("hide");var u=e.trim(e(n).text());u.lastIndexOf(":")===-1&&(u=u.substring(0,u.length-3),e(n).text(u+":")),e(s).attr("disabled",!1),e(r).fadeOut("fast",function(){e(this).text(o.message),e(this).fadeIn("fast")})},o=function(t,n,r,i){e("#ai1ec_repeat_box .ai1ec-alert-danger").text(r.message).removeClass("ai1ec-hide"),e(i).attr("disabled",!1),e(t).val("");var s=e.trim(e(n).text());s.lastIndexOf("...")===-1&&(s=s.substring(0,s.length-1),e(n).text(s+"...")),e(this).closest("tr").find(".ai1ec_rule_text").text()===""&&e(t).siblings("input:checkbox").removeAttr("checked")},u=function(t,n,r,i,s){e(document).on("click",t,function(){if(!e(n).is(":checked")){e(n).attr("checked",!0);var t=e.trim(e(r).text());t=t.substring(0,t.length-3),e(r).text(t+":")}return c(i,s),!1})},a=function(t,n,r,i,s){e(t).click(function(){if(e(this).is(":checked"))this.id==="ai1ec_repeat"&&e("#ai1ec_exclude").removeAttr("disabled"),c(i,s);else{this.id==="ai1ec_repeat"&&(e("#ai1ec_exclude").removeAttr("checked").attr("disabled",!0),e("#ai1ec_exclude_text > a").text("")),e(n).text("");var t=e.trim(e(r).text());t=t.substring(0,t.length-1),e(r).text(t+"...")}})},f=function(t,n,r){if(e.trim(e(t).text())===""){e(n).removeAttr("checked"),e("#ai1ec_repeat").is(":checked")||e("#ai1ec_exclude").attr("disabled",!0);var i=e.trim(e(r).text());i.lastIndexOf("...")===-1&&(i=i.substring(0,i.length-1),e(r).text(i+"..."))}},l=function(){e("#ai1ec_count, #ai1ec_daily_count, #ai1ec_weekly_count, #ai1ec_monthly_count, #ai1ec_yearly_count").rangeinput({css:{input:"ai1ec-range",slider:"ai1ec-slider",progress:"ai1ec-progress",handle:"ai1ec-handle"}});var n=e("#ai1ec_recurrence_calendar");n.datepicker({multidate:!0,weekStart:t.week_start_day}),n.on("changeDate",function(n){var i=[],s=[];for(var o=0;o<n.dates.length;o++){var u=new Date(n.dates[o]),a=""+u.getFullYear()+("0"+(u.getMonth()+1)).slice(-2)+("0"+u.getDate()).slice(-2)+"T000000Z",f='<span class="ai1ec-label ai1ec-label-default">'+r.formatDate(u,t.date_format,!0)+"</span>";i.push(a),s.push(f)}e("#ai1ec_rec_dates_list").html(s.join(" ")),e("#ai1ec_rec_custom_dates").val(i.join(","))});var i={start_date_input:"#ai1ec_until-date-input",start_time:"#ai1ec_until-time",date_format:t.date_format,month_names:t.month_names,day_names:t.day_names,week_start_day:t.week_start_day,twentyfour_hour:t.twentyfour_hour,now:new Date(t.now*1e3)};e.inputdate(i)},c=function(t,n){var r=e("#ai1ec_repeat_box"),s=e(".ai1ec-loading",r);r.modal({backdrop:"static"}),e.post(i,t,function(e){e.error?(window.alert(e.message),r.modal("hide")):(s.addClass("ai1ec-hide").after(e.message),typeof n=="function"&&n())},"json")};return{show_repeat_tabs:c,init_modal_widgets:l,click_on_modal_cancel:f,click_on_checkbox:a,click_on_ics_rule_text:u,repeat_form_error:o,repeat_form_success:s}}),timely.define("external_libs/bootstrap/button",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r)};t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.is("input")?"val":"html",i=n.data();e+="Text",i.resetText||n.data("resetText",n[r]()),n[r](i[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass("ai1ec-"+t).attr(t,t):n.removeClass("ai1ec-"+t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="ai1ec-buttons"]'),t=!0;if(e.length){var n=this.$element.find("input");n.prop("type")==="radio"&&(n.prop("checked")&&this.$element.hasClass("ai1ec-active")?t=!1:e.find(".ai1ec-active").removeClass("ai1ec-active")),t&&n.prop("checked",!this.$element.hasClass("ai1ec-active")).trigger("change")}t&&this.$element.toggleClass("ai1ec-active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("bs.button"),s=typeof n=="object"&&n;i||r.data("bs.button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api","[data-toggle^=ai1ec-button]",function(t){var n=e(t.target);n.hasClass("ai1ec-btn")||(n=n.closest(".ai1ec-btn")),n.button("toggle"),t.preventDefault()})}),timely.define("scripts/add_new_event/event_date_time/date_time_event_handlers",["jquery_timely","ai1ec_config","scripts/add_new_event/event_date_time/date_time_utility_functions","external_libs/jquery.calendrical_timespan","libs/utils","external_libs/bootstrap/button"],function(e,t,n,r,i){var s=i.get_ajax_url(),o=function(){var t=e("#ai1ec_end option:selected").val();switch(t){case"0":e("#ai1ec_until_holder, #ai1ec_count_holder").collapse("hide");break;case"1":e("#ai1ec_until_holder").collapse("hide"),e("#ai1ec_count_holder").collapse("show");break;case"2":e("#ai1ec_count_holder").collapse("hide"),e("#ai1ec_until_holder").collapse("show")}},u=function(){e("#publish").trigger("click")},a=function(){var i=e(this),o="",u=e("#ai1ec_repeat_box .ai1ec-tab-pane.ai1ec-active"),a=u.data("freq");switch(a){case"daily":o+="FREQ=DAILY;";var f=e("#ai1ec_daily_count").val();f>1&&(o+="INTERVAL="+f+";");break;case"weekly":o+="FREQ=WEEKLY;";var l=e("#ai1ec_weekly_count").val();l>1&&(o+="INTERVAL="+l+";");var c=e('input[name="ai1ec_weekly_date_select"]:first').val(),h=e('#ai1ec_weekly_date_select > div:first > input[type="hidden"]:first').val();c.length>0&&(o+="WKST="+h+";BYday="+c+";");break;case"monthly":o+="FREQ=MONTHLY;";var p=e("#ai1ec_monthly_count").val(),d=e('input[name="ai1ec_monthly_type"]:checked').val();p>1&&(o+="INTERVAL="+p+";");var v=e('input[name="ai1ec_montly_date_select"]:first').val();if(v.length>0&&d==="bymonthday")o+="BYMONTHDAY="+v+";";else if(d==="byday"){var m=e("#ai1ec_monthly_byday_num").val(),g=e("#ai1ec_monthly_byday_weekday").val();o+="BYday="+m+g+";"}break;case"yearly":o+="FREQ=YEARLY;";var y=e("#ai1ec_yearly_count").val();y>1&&(o+="INTERVAL="+y+";");var b=e('input[name="ai1ec_yearly_date_select"]:first').val();b.length>0&&(o+="BYMONTH="+b+";");break;case"custom":"1"===e("#ai1ec_is_box_repeat").val()?o+="RDATE=":o+="EXDATE=",o+=e("#ai1ec_rec_custom_dates").val()}var w=e("#ai1ec_end").val();if(w==="1")o+="COUNT="+e("#ai1ec_count").val()+";";else if(w==="2"){var E=e("#ai1ec_until-date-input").val();E=r.parseDate(E,t.date_format);var S=e("#ai1ec_start-time").val();S=r.parseDate(S,t.date_format),S=new Date(S);var x=E.getUTCDate(),T=E.getUTCMonth()+1,N=S.getUTCHours(),C=S.getUTCMinutes();T=T<10?"0"+T:T,x=x<10?"0"+x:x,N=N<10?"0"+N:N,C=C<10?"0"+C:C,E=E.getUTCFullYear()+""+T+x+"T235959Z",o+="UNTIL="+E+";"}var k={action:"ai1ec_rrule_to_text",rrule:o};i.button("loading").next().addClass("ai1ec-disabled"),e.post(s,k,function(t){t.error?(i.button("reset").next().removeClass("ai1ec-disabled"),"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_error("#ai1ec_rrule","#ai1ec_repeat_label",t,i):n.repeat_form_error("#ai1ec_exrule","#ai1ec_exclude_label",t,i)):"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_success("#ai1ec_rrule","#ai1ec_repeat_label","#ai1ec_repeat_text > a",o,i,t):n.repeat_form_success("#ai1ec_exrule","#ai1ec_exclude_label","#ai1ec_exclude_text > a",o,i,t)},"json")},f=function(){return e("#ai1ec_is_box_repeat").val()==="1"?n.click_on_modal_cancel("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label"):n.click_on_modal_cancel("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label"),e("#ai1ec_repeat_box").modal("hide"),!1},l=function(){e(this).is("#ai1ec_monthly_type_bymonthday")?(e("#ai1ec_repeat_monthly_byday").collapse("hide"),e("#ai1ec_repeat_monthly_bymonthday").collapse("show")):(e("#ai1ec_repeat_monthly_bymonthday").collapse("hide"),e("#ai1ec_repeat_monthly_byday").collapse("show"))},c=function(){var t=e(this),n=[],r=t.closest(".ai1ec-btn-group-grid"),i;t.toggleClass("ai1ec-active"),e("a",r).each(function(){var t=e(this);t.is(".ai1ec-active")&&(i=t.next().val(),n.push(i))}),r.next().val(n.join())},h=function(){n.click_on_ics_rule_text("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_ics_rule_text("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_repeat","#ai1ec_repeat_text > a","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_exclude","#ai1ec_exclude_text > a","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets)},p=function(t){return e("#ai1ec_widget_calendar").toggle(),!1},d=function(){e(".ai1ec-modal-content",this).not(".ai1ec-loading ").remove().end().removeClass("ai1ec-hide")};return{show_end_fields:o,trigger_publish:u,handle_click_on_apply_button:a,handle_click_on_cancel_modal:f,handle_checkbox_monthly_tab_modal:l,execute_pseudo_handlers:h,handle_animation_of_calendar_widget:p,handle_click_on_toggle_buttons:c,handle_modal_hide:d}}),timely.define("scripts/add_new_event/event_cost_helper",["jquery_timely","ai1ec_config"],function(e,t){var n=function(){return e("#ai1ec_is_free").is(":checked")},r=function(){return e("#ai1ec_cost").val()!==""},i=function(r){var i=e(this).parents("table:eq(0)"),s=e("#ai1ec_cost",i),o=t.label_a_buy_tickets_url;n()?(s.attr("value","").addClass("ai1ec-hidden"),o=t.label_a_rsvp_url):s.removeClass("ai1ec-hidden"),e("label[for=ai1ec_ticket_url]",i).text(o)};return{handle_change_is_free:i,check_is_free:n,check_is_price_entered:r}}),timely.define("external_libs/jquery.inputdate",["jquery_timely","external_libs/jquery.calendrical_timespan"],function(e,t){function n(e){e.addClass("error").fadeOut("normal",function(){e.val(e.data("timespan.stored")).removeClass("error").fadeIn("fast")})}function r(){e(this).data("timespan.stored",this.value)}function i(e,n,i,s,o){n.val(n.data("timespan.initial_value"));var u=parseInt(n.val());isNaN(parseInt(u))?u=new Date(o):u=new Date(parseInt(u)*1e3),e.val(t.formatDate(u,s)),e.each(r)}var s={start_date_input:"date-input",start_time:"time",twentyfour_hour:!1,date_format:"def",now:new Date},o={init:function(o){var u=e.extend({},s,o),a=e(u.start_date_input),f=e(u.start_time),l=a,c=a;return c.bind("focus.timespan",r),l.calendricalDate({today:new Date(u.now.getFullYear(),u.now.getMonth(),u.now.getDate()),dateFormat:u.date_format,monthNames:u.month_names,dayNames:u.day_names,weekStartDay:u.week_start_day}),l.bind("blur.timespan",function(){var r=t.parseDate(this.value,u.date_format);isNaN(r)?n(e(this)):(e(this).data("timespan.stored",this.value),e(this).val(t.formatDate(r,u.date_format)))}),a.bind("focus.timespan",function(){var e=t.parseDate(a.val(),u.date_format).getTime()/1e3}).bind("blur.timespan",function(){var e=t.parseDate(a.data("timespan.stored"),u.date_format)}),a.closest("form").bind("submit.timespan",function(){var e=t.parseDate(a.val(),u.date_format).getTime()/1e3;isNaN(e)&&(e=""),f.val(e)}),f.data("timespan.initial_value",f.val()),i(a,f,u.twentyfour_hour,u.date_format,u.now),this},reset:function(t){var n=e.extend({},s,t);return i(e(n.start_date_input),e(n.start_time),n.twentyfour_hour,n.date_format,n.now),this},destroy:function(t){return t=e.extend({},s,t),e.each(t,function(t,n){e(n).unbind(".timespan")}),e(t.start_date_input).closest("form").unbind(".timespan"),this}};e.inputdate=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.timespan")}}),timely.define("external_libs/jquery.tools",["jquery_timely"],function(e){function i(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}function s(e,t){var n=parseInt(e.css(t),10);if(n)return n;var r=e[0].currentStyle;return r&&r.width&&parseInt(r.width,10)}function o(e){var t=e.data("events");return t&&t.onSlide}function u(t,n){function x(e,s,o,u){o===undefined?o=s/h*m:u&&(o-=n.min),g&&(o=Math.round(o/g)*g);if(s===undefined||g)s=o*h/m;if(isNaN(o))return r;s=Math.max(0,Math.min(s,h)),o=s/h*m;if(u||!f)o+=n.min;f&&(u?s=h-s:o=n.max-o),o=i(o,y);var a=e.type=="click";if(S&&l!==undefined&&!a){e.type="onSlide",E.trigger(e,[o,s]);if(e.isDefaultPrevented())return r}var c=a?n.speed:0,b=a?function(){e.type="change",E.trigger(e,[o])}:null;return f?(d.animate({top:s},c,b),n.progress&&v.animate({height:h-s+d.height()/2},c)):(d.animate({left:s},c,b),n.progress&&v.animate({width:s+d.width()/2},c)),l=o,p=s,t.val(o),r}function T(){f=n.vertical||s(a,"height")>s(a,"width"),f?(h=s(a,"height")-s(d,"height"),c=a.offset().top+h):(h=s(a,"width")-s(d,"width"),c=a.offset().left)}function N(){T(),r.setValue(n.value!==undefined?n.value:n.min)}var r=this,u=n.css,a=e("<div><div/><a href='#'/></div>").data("rangeinput",r),f,l,c,h,p;t.before(a);var d=a.addClass(u.slider).find("a").addClass(u.handle),v=a.find("div").addClass(u.progress);e.each("min,max,step,value".split(","),function(e,r){var i=t.attr(r);parseFloat(i)&&(n[r]=parseFloat(i,10))});var m=n.max-n.min,g=n.step=="any"?0:n.step,y=n.precision;y===undefined&&(y=g.toString().split("."),y=y.length===2?y[1].length:0);if(t.attr("type")=="range"){var b=t.clone().wrap("<div/>").parent().html(),w=e(b.replace(/type/i,"type=text data-orig-type"));w.val(n.value),t.replaceWith(w),t=w}t.addClass(u.input);var E=e(r).add(t),S=!0;e.extend(r,{getValue:function(){return l},setValue:function(t,n){return T(),x(n||e.Event("api"),undefined,t,!0)},getConf:function(){return n},getProgress:function(){return v},getHandle:function(){return d},getInput:function(){return t},step:function(t,i){i=i||e.Event();var s=n.step=="any"?1:n.step;r.setValue(l+s*(t||1),i)},stepUp:function(e){return r.step(e||1)},stepDown:function(e){return r.step(-e||-1)}}),e.each("onSlide,change".split(","),function(t,i){e.isFunction(n[i])&&e(r).on(i,n[i]),r[i]=function(t){return t&&e(r).on(i,t),r}}),d.drag({drag:!1}).on("dragStart",function(){T(),S=o(e(r))||o(t)}).on("drag",function(e,n,r){if(t.is(":disabled"))return!1;x(e,f?n:r)}).on("dragEnd",function(e){e.isDefaultPrevented()||(e.type="change",E.trigger(e,[l]))}).click(function(e){return e.preventDefault()}),a.click(function(e){if(t.is(":disabled")||e.target==d[0])return e.preventDefault();T();var n=f?d.height()/2:d.width()/2;x(e,f?h-c-n+e.pageY:e.pageX-c-n)}),n.keyboard&&t.keydown(function(n){if(t.attr("readonly"))return;var i=n.keyCode,s=e([75,76,38,33,39]).index(i)!=-1,o=e([74,72,40,34,37]).index(i)!=-1;if((s||o)&&!(n.shiftKey||n.altKey||n.ctrlKey))return s?r.step(i==33?10:1,n):o&&r.step(i==34?-10:-1,n),n.preventDefault()}),t.blur(function(t){var n=e(this).val();n!==l&&r.setValue(n,t)}),e.extend(t[0],{stepUp:r.stepUp,stepDown:r.stepDown}),N(),h||e(window).load(N)}e.tools=e.tools||{version:"1.2.7"};var t;t=e.tools.rangeinput={conf:{min:0,max:100,step:"any",steps:0,value:0,precision:undefined,vertical:0,keyboard:!0,progress:!1,speed:100,css:{input:"range",slider:"slider",progress:"progress",handle:"handle"}}};var n,r;e.fn.drag=function(t){return document.ondragstart=function(){return!1},t=e.extend({x:!0,y:!0,drag:!0},t),n=n||e(document).on("mousedown mouseup",function(i){var s=e(i.target);if(i.type=="mousedown"&&s.data("drag")){var o=s.position(),u=i.pageX-o.left,a=i.pageY-o.top,f=!0;n.on("mousemove.drag",function(e){var n=e.pageX-u,i=e.pageY-a,o={};t.x&&(o.left=n),t.y&&(o.top=i),f&&(s.trigger("dragStart"),f=!1),t.drag&&s.css(o),s.trigger("drag",[i,n]),r=s}),i.preventDefault()}else try{r&&r.trigger("dragEnd")}finally{n.off("mousemove.drag"),r=null}}),this.data("drag",!0)},e.expr[":"].range=function(t){var n=t.getAttribute("type");return n&&n=="range"||!!e(t).filter("input").data("rangeinput")},e.fn.rangeinput=function(n){if(this.data("rangeinput"))return this;n=e.extend(!0,{},t.conf,n);var r;return this.each(function(){var t=new u(e(this),e.extend(!0,{},n)),i=t.getInput().data("rangeinput",t);r=r?r.add(i):i}),r?r:this}}),timely.define("external_libs/locales/bootstrap-datepicker.bg",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.bg={days:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота","Неделя"],daysShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб","Нед"],daysMin:["Н","П","В","С","Ч","П","С","Н"],months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Ян","Фев","Мар","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Ное","Дек"],today:"днес"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.br",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.br={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.cs",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.cs={days:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota","Neděle"],daysShort:["Ned","Pon","Úte","Stř","Čtv","Pát","Sob","Ned"],daysMin:["Ne","Po","Út","St","Čt","Pá","So","Ne"],months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],monthsShort:["Led","Úno","Bře","Dub","Kvě","Čer","Čnc","Srp","Zář","Říj","Lis","Pro"],today:"Dnes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.da",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.da={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",clear:"Nulstil"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.de",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam","Son"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa","So"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.es",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa","Do"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fi",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai","sunnuntai"],daysShort:["sun","maa","tii","kes","tor","per","lau","sun"],daysMin:["su","ma","ti","ke","to","pe","la","su"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mar","jou"],today:"tänään",weekStart:1,format:"d.m.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fr={days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],daysMin:["D","L","Ma","Me","J","V","S","D"],months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aou","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.id",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","Minggu"],daysShort:["Mgu","Sen","Sel","Rab","Kam","Jum","Sab","Mgu"],daysMin:["Mg","Sn","Sl","Ra","Ka","Ju","Sa","Mg"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],today:"Hari Ini",clear:"Kosongkan"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.is",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.is={days:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur","Sunnudagur"],daysShort:["Sun","Mán","Þri","Mið","Fim","Fös","Lau","Sun"],daysMin:["Su","Má","Þr","Mi","Fi","Fö","La","Su"],months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],today:"Í Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.it",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa","Do"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ja",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ja={days:["日曜","月曜","火曜","水曜","木曜","金曜","土曜","日曜"],daysShort:["日","月","火","水","木","金","土","日"],daysMin:["日","月","火","水","木","金","土","日"],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",format:"yyyy/mm/dd"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.kr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.kr={days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일","일요일"],daysShort:["일","월","화","수","목","금","토","일"],daysMin:["일","월","화","수","목","금","토","일"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis","Sekmadienis"],daysShort:["S","Pr","A","T","K","Pn","Š","S"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","Št","Sk"],months:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"Šiandien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lv={days:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena","Svētdiena"],daysShort:["Sv","P","O","T","C","Pk","S","Sv"],daysMin:["Sv","Pr","Ot","Tr","Ce","Pk","Se","Sv"],months:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],today:"Šodien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ms",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ms={days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu","Ahad"],daysShort:["Aha","Isn","Sel","Rab","Kha","Jum","Sab","Aha"],daysMin:["Ah","Is","Se","Ra","Kh","Ju","Sa","Ah"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],today:"Hari Ini"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nb",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nb={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nl={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pl={days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"],daysShort:["Nie","Pn","Wt","Śr","Czw","Pt","So","Nie"],daysMin:["N","Pn","Wt","Śr","Cz","Pt","So","N"],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],today:"Dzisiaj",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt-BR",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pt={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ru",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ru={days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Воскресенье"],daysShort:["Вск","Пнд","Втр","Срд","Чтв","Птн","Суб","Вск"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб","Вс"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sl={days:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota","Nedelja"],daysShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob","Ned"],daysMin:["Ne","Po","To","Sr","Če","Pe","So","Ne"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sv={days:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],daysShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör","Sön"],daysMin:["Sö","Må","Ti","On","To","Fr","Lö","Sö"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",format:"yyyy-mm-dd",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.th",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.th={days:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"],daysShort:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],daysMin:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],today:"วันนี้"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.tr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.tr={days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi","Pazar"],daysShort:["Pz","Pzt","Sal","Çrş","Prş","Cu","Cts","Pz"],daysMin:["Pz","Pzt","Sa","Çr","Pr","Cu","Ct","Pz"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],today:"Bugün",format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-CN",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-TW",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-TW"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["週日","週一","週二","週三","週四","週五","週六","週日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/bootstrap_datepicker",["jquery_timely","ai1ec_config","external_libs/locales/bootstrap-datepicker.bg","external_libs/locales/bootstrap-datepicker.br","external_libs/locales/bootstrap-datepicker.cs","external_libs/locales/bootstrap-datepicker.da","external_libs/locales/bootstrap-datepicker.de","external_libs/locales/bootstrap-datepicker.es","external_libs/locales/bootstrap-datepicker.fi","external_libs/locales/bootstrap-datepicker.fr","external_libs/locales/bootstrap-datepicker.id","external_libs/locales/bootstrap-datepicker.is","external_libs/locales/bootstrap-datepicker.it","external_libs/locales/bootstrap-datepicker.ja","external_libs/locales/bootstrap-datepicker.kr","external_libs/locales/bootstrap-datepicker.lt","external_libs/locales/bootstrap-datepicker.lv","external_libs/locales/bootstrap-datepicker.ms","external_libs/locales/bootstrap-datepicker.nb","external_libs/locales/bootstrap-datepicker.nl","external_libs/locales/bootstrap-datepicker.pl","external_libs/locales/bootstrap-datepicker.pt-BR","external_libs/locales/bootstrap-datepicker.pt","external_libs/locales/bootstrap-datepicker.ru","external_libs/locales/bootstrap-datepicker.sl","external_libs/locales/bootstrap-datepicker.sv","external_libs/locales/bootstrap-datepicker.th","external_libs/locales/bootstrap-datepicker.tr","external_libs/locales/bootstrap-datepicker.zh-CN","external_libs/locales/bootstrap-datepicker.zh-TW"],function(e,t){function r(){return new Date(Date.UTC.apply(Date,arguments))}function i(){var e=new Date;return r(e.getFullYear(),e.getMonth(),e.getDate())}function s(e){return function(){return this[e].apply(this,arguments)}}function f(t,n){var r=e(t).data(),i={},s,o=new RegExp("^"+n.toLowerCase()+"([A-Z])"),n=new RegExp("^"+n.toLowerCase());for(var u in r)n.test(u)&&(s=u.replace(o,function(e,t){return t.toLowerCase()}),i[s]=r[u]);return i}function l(t){var n={};if(!d[t]){t=t.split("-")[0];if(!d[t])return}var r=d[t];return e.each(p,function(e,t){t in r&&(n[t]=r[t])}),n}var n=e(window),o=function(){var t={get:function(e){return this.slice(e)[0]},contains:function(e){var t=e&&e.valueOf();for(var n=0,r=this.length;n<r;n++)if(this[n].valueOf()===t)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(t){if(!t)return;e.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t)},clear:function(){this.splice(0)},copy:function(){var e=new o;return e.replace(this),e}};return function(){var n=[];return n.push.apply(n,arguments),e.extend(n,t),n}}(),u=function(t,n){this.dates=new o,this.viewDate=i(),this.focusDate=null,this._process_options(n),this.element=e(t),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".ai1ec-date")?this.element.find(".ai1ec-input-group, .ai1ec-input-group-addon, .ai1ec-btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&this.component.length===0&&(this.component=!1),this.picker=e(v.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("ai1ec-datepicker-inline").appendTo(this.element):this.picker.addClass("ai1ec-datepicker-dropdown ai1ec-dropdown-menu"),this.o.rtl&&this.picker.addClass("ai1ec-datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.ai1ec-today").attr("colspan",function(e,t){return parseInt(t)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};u.prototype={constructor:u,_process_options:function(n){this._o=e.extend({},this._o,n);var r=this.o=e.extend({},this._o),i=r.language;d[i]||(i=i.split("-")[0],d[i]||(i=t.language,d[i]||(i=h.language))),r.language=i;switch(r.startView){case 2:case"decade":r.startView=2;break;case 1:case"year":r.startView=1;break;default:r.startView=0}switch(r.minViewMode){case 1:case"months":r.minViewMode=1;break;case 2:case"years":r.minViewMode=2;break;default:r.minViewMode=0}r.startView=Math.max(r.startView,r.minViewMode),r.multidate!==!0&&(r.multidate=Number(r.multidate)||!1,r.multidate!==!1?r.multidate=Math.max(0,r.multidate):r.multidate=1),r.multidateSeparator=String(r.multidateSeparator),r.weekStart%=7,r.weekEnd=(r.weekStart+6)%7;var s=v.parseFormat(r.format);r.startDate!==-Infinity&&(r.startDate?r.startDate instanceof Date?r.startDate=this._local_to_utc(this._zero_time(r.startDate)):r.startDate=v.parseDate(r.startDate,s,r.language):r.startDate=-Infinity),r.endDate!==Infinity&&(r.endDate?r.endDate instanceof Date?r.endDate=this._local_to_utc(this._zero_time(r.endDate)):r.endDate=v.parseDate(r.endDate,s,r.language):r.endDate=Infinity),r.daysOfWeekDisabled=r.daysOfWeekDisabled||[],e.isArray(r.daysOfWeekDisabled)||(r.daysOfWeekDisabled=r.daysOfWeekDisabled.split(/[,\s]*/)),r.daysOfWeekDisabled=e.map(r.daysOfWeekDisabled,function(e){return parseInt(e,10)});var o=String(r.orientation).toLowerCase().split(/\s+/g),u=r.orientation.toLowerCase();o=e.grep(o,function(e){return/^auto|left|right|top|bottom$/.test(e)}),r.orientation={x:"auto",y:"auto"};if(!!u&&u!=="auto")if(o.length===1)switch(o[0]){case"top":case"bottom":r.orientation.y=o[0];break;case"left":case"right":r.orientation.x=o[0]}else u=e.grep(o,function(e){return/^left|right$/.test(e)}),r.orientation.x=u[0]||"auto",u=e.grep(o,function(e){return/^top|bottom$/.test(e)}),r.orientation.y=u[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(r=undefined,i=e[t][1]):e[t].length==3&&(r=e[t][1],i=e[t][2]),n.on(i,r)},_unapplyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(i=undefined,r=e[t][1]):e[t].length==3&&(i=e[t][1],r=e[t][2]),n.off(r,i)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,n){var r=n||this.dates.get(-1),i=this._utc_to_local(r);this.element.trigger({type:t,date:i,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){arguments.length===0?(e=this.dates.length-1,t=this.o.format):typeof e=="string"&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return v.formatDate(n,t,this.o.language)},this)})},show:function(e){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){if(this.isInline)return;if(!this.picker.is(":visible"))return;this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide")},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(e){return e&&new Date(e.getTime()+e.getTimezoneOffset()*6e4)},_local_to_utc:function(e){return e&&new Date(e.getTime()-e.getTimezoneOffset()*6e4)},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){this.update.apply(this,arguments),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){this.update.apply(this,e.map(arguments,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:s("setDates"),setUTCDate:s("setUTCDates"),setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e).change():this.component&&this.element.find("input").val(e).change()},getFormattedDate:function(t){t===undefined&&(t=this.o.format);var n=this.o.language;return e.map(this.dates,function(e){return v.formatDate(e,t,n)}).join(this.o.multidateSeparator)},setStartDate:function(e){this._process_options({startDate:e}),this.update(),this.updateNavArrows()},setEndDate:function(e){this._process_options({endDate:e}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this._process_options({daysOfWeekDisabled:e}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return;var t=this.picker.outerWidth(),r=this.picker.outerHeight(),i=10,s=n.width(),o=n.height(),u=n.scrollTop(),a=parseInt(this.element.parents().filter(function(){return e(this).css("z-index")!="auto"}).first().css("z-index"))+10,f=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),c=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),h=f.left,p=f.top;this.picker.removeClass("ai1ec-datepicker-orient-top ai1ec-datepicker-orient-bottom ai1ec-datepicker-orient-right ai1ec-datepicker-orient-left"),this.o.orientation.x!=="auto"?(this.picker.addClass("ai1ec-datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(h-=t-c)):(this.picker.addClass("ai1ec-datepicker-orient-left"),f.left<0?h-=f.left-i:f.left+t>s&&(h=s-t-i));var d=this.o.orientation.y,v,m;d==="auto"&&(v=-u+f.top-r,m=u+o-(f.top+l+r),Math.max(v,m)===m?d="top":d="bottom"),this.picker.addClass("ai1ec-datepicker-orient-"+d),d==="top"?p+=l:p-=r+parseInt(this.picker.css("padding-top")),this.picker.css({top:p,left:h,zIndex:a})},_allow_update:!0,update:function(){if(!this._allow_update)return;var t=this.dates.copy(),n=[],r=!1;arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),r=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),n&&this.o.multidate?n=n.split(this.o.multidateSeparator):n=[n],delete this.element.data().date),n=e.map(n,e.proxy(function(e){return v.parseDate(e,this.o.format,this.o.language)},this)),n=e.grep(n,e.proxy(function(e){return e<this.o.startDate||e>this.o.endDate||!e},this),!0),this.dates.replace(n),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),r?this.setValue():n.length&&String(t)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&t.length&&this._trigger("clearDate"),this.fill()},fillDow:function(){var e=this.o.weekStart,t="<tr>";if(this.o.calendarWeeks){var n='<th class="ai1ec-cw">&nbsp;</th>';t+=n,this.picker.find(".ai1ec-datepicker-days thead tr:first-child").prepend(n)}while(e<this.o.weekStart+7)t+='<th class="ai1ec-dow">'+d[this.o.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".ai1ec-datepicker-days thead").append(t)},fillMonths:function(){var e="",t=0;while(t<12)e+='<span class="ai1ec-month">'+d[this.o.language].monthsShort[t++]+"</span>";this.picker.find(".ai1ec-datepicker-months td").html(e)},setRange:function(t){!t||!t.length?delete this.range:this.range=e.map(t,function(e){return e.valueOf()}),this.fill()},getClassNames:function(t){var n=[],r=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),s=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()==r&&t.getUTCMonth()<i?n.push("ai1ec-old"):(t.getUTCFullYear()>r||t.getUTCFullYear()==r&&t.getUTCMonth()>i)&&n.push("ai1ec-new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&n.push("ai1ec-focused"),this.o.todayHighlight&&t.getUTCFullYear()==s.getFullYear()&&t.getUTCMonth()==s.getMonth()&&t.getUTCDate()==s.getDate()&&n.push("ai1ec-today"),this.dates.contains(t)!==-1&&n.push("ai1ec-active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&n.push("ai1ec-disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&n.push("ai1ec-range"),e.inArray(t.valueOf(),this.range)!=-1&&n.push("ai1ec-selected")),n},fill:function(){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth(),s=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,o=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,u=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,a=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,f,l;this.picker.find(".ai1ec-datepicker-days thead th.ai1ec-datepicker-switch").text(d[this.o.language].months[i]+" "+n),this.picker.find("tfoot th.ai1ec-today").text(d[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.ai1ec-clear").text(d[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var c=r(n,i-1,28),h=v.getDaysInMonth(c.getUTCFullYear(),c.getUTCMonth());c.setUTCDate(h),c.setUTCDate(h-(c.getUTCDay()-this.o.weekStart+7)%7);var p=new Date(c);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();var m=[],g;while(c.valueOf()<p){if(c.getUTCDay()==this.o.weekStart){m.push("<tr>");if(this.o.calendarWeeks){var y=new Date(+c+(this.o.weekStart-c.getUTCDay()-7)%7*864e5),b=new Date(+y+(11-y.getUTCDay())%7*864e5),w=new Date(+(w=r(b.getUTCFullYear(),0,1))+(11-w.getUTCDay())%7*864e5),E=(b-w)/864e5/7+1;m.push('<td class="ai1ec-cw">'+E+"</td>")}}g=this.getClassNames(c),g.push("ai1ec-day");if(this.o.beforeShowDay!==e.noop){var S=this.o.beforeShowDay(this._utc_to_local(c));S===undefined?S={}:typeof S=="boolean"?S={enabled:S}:typeof S=="string"&&(S={classes:S}),S.enabled===!1&&g.push("ai1ec-disabled"),S.classes&&(g=g.concat(S.classes.split(/\s+/))),S.tooltip&&(f=S.tooltip)}g=e.unique(g),m.push('<td class="'+g.join(" ")+'"'+(f?' title="'+f+'"':"")+">"+c.getUTCDate()+"</td>"),c.getUTCDay()==this.o.weekEnd&&m.push("</tr>"),c.setUTCDate(c.getUTCDate()+1)}this.picker.find(".ai1ec-datepicker-days tbody").empty().append(m.join(""));var x=this.picker.find(".ai1ec-datepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("ai1ec-active");e.each(this.dates,function(e,t){t.getUTCFullYear()==n&&x.eq(t.getUTCMonth()).addClass("ai1ec-active")}),(n<s||n>u)&&x.addClass("ai1ec-disabled"),n==s&&x.slice(0,o).addClass("ai1ec-disabled"),n==u&&x.slice(a+1).addClass("ai1ec-disabled"),m="",n=parseInt(n/10,10)*10;var T=this.picker.find(".ai1ec-datepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;var N=e.map(this.dates,function(e){return e.getUTCFullYear()}),C;for(var k=-1;k<11;k++)C=["ai1ec-year"],k===-1?C.push("ai1ec-old"):k===10&&C.push("ai1ec-new"),e.inArray(n,N)!==-1&&C.push("ai1ec-active"),(n<s||n>u)&&C.push("ai1ec-disabled"),m+='<span class="'+C.join(" ")+'">'+n+"</span>",n+=1;T.html(m)},updateNavArrows:function(){if(!this._allow_update)return;var e=new Date(this.viewDate),t=e.getUTCFullYear(),n=e.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()&&n<=this.o.startDate.getUTCMonth()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()&&n>=this.o.endDate.getUTCMonth()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"})}},click:function(t){t.preventDefault();var n=e(t.target).closest("span, td, th"),i,s,o;if(n.length==1)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"ai1ec-datepicker-switch":this.showMode(1);break;case"ai1ec-prev":case"ai1ec-next":var u=v.modes[this.viewMode].navStep*(n[0].className=="ai1ec-prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,u),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,u),this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"ai1ec-today":var a=new Date;a=r(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0),this.showMode(-2);var f=this.o.todayBtn=="linked"?null:"view";this._setDate(a,f);break;case"ai1ec-clear":var l;this.isInput?l=this.element:this.component&&(l=this.element.find("input")),l&&l.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":n.is(".ai1ec-disabled")||(this.viewDate.setUTCDate(1),n.is(".ai1ec-month")?(o=1,s=n.parent().find("span").index(n),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(s),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(r(i,s,o))):(o=1,s=0,i=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(i),this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(r(i,s,o))),this.showMode(-1),this.fill());break;case"td":n.is(".ai1ec-day")&&!n.is(".ai1ec-disabled")&&(o=parseInt(n.text(),10)||1,i=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n.is(".ai1ec-old")?s===0?(s=11,i-=1):s-=1:n.is(".ai1ec-new")&&(s==11?(s=0,i+=1):s+=1),this._setDate(r(i,s,o)))}this.picker.is(":visible")&&this._focused_from&&e(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(e){var t=this.dates.contains(e);e?t!==-1?this.dates.remove(t):this.dates.push(e):this.dates.clear();if(typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(e,t){(!t||t=="date")&&this._toggle_multidate(e&&new Date(e));if(!t||t=="view")this.viewDate=e&&new Date(e);this.fill(),this.setValue(),this._trigger("changeDate");var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),this.o.autoclose&&(!t||t=="date")&&this.hide()},moveMonth:function(e,t){if(!e)return undefined;if(!t)return e;var n=new Date(e.valueOf()),r=n.getUTCDate(),i=n.getUTCMonth(),s=Math.abs(t),o,u;t=t>0?1:-1;if(s==1){u=t==-1?function(){return n.getUTCMonth()==i}:function(){return n.getUTCMonth()!=o},o=i+t,n.setUTCMonth(o);if(o<0||o>11)o=(o+12)%12}else{for(var a=0;a<s;a++)n=this.moveMonth(n,t);o=n.getUTCMonth(),n.setUTCDate(r),u=function(){return o!=n.getUTCMonth()}}while(u())n.setUTCDate(--r),n.setUTCMonth(o);return n},moveYear:function(e,t){return this.moveMonth(e,t*12)},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":not(:visible)")){e.keyCode==27&&this.show();return}var t=!1,n,r,s,o=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;n=e.keyCode==37?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n),s=new Date(o),s.setUTCDate(o.getUTCDate()+n)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;n=e.keyCode==38?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n*7),s=new Date(o),s.setUTCDate(o.getUTCDate()+n*7)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 32:break;case 13:o=this.focusDate||this.dates.get(-1)||this.viewDate,this._toggle_multidate(o),t=!0,this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(t){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var u;this.isInput?u=this.element:this.component&&(u=this.element.find("input")),u&&u.change()}},showMode:function(e){e&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+e))),this.picker.find(">div").hide().filter(".ai1ec-datepicker-"+v.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var a=function(t,n){this.element=e(t),this.inputs=e.map(n.inputs,function(e){return e.jquery?e[0]:e}),delete n.inputs,e(this.inputs).datepicker(n).bind("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e(t).data("datepicker")}),this.updateDates()};a.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,n){n.setRange(t)})},dateUpdated:function(t){if(this.updating)return;this.updating=!0;var n=e(t.target).data("datepicker"),r=n.getUTCDate(),i=e.inArray(t.target,this.inputs),s=this.inputs.length;if(i==-1)return;e.each(this.pickers,function(e,t){t.getUTCDate()||t.setUTCDate(r)});if(r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<s&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates(),delete this.updating},remove:function(){e.map(this.pickers,function(e){e.remove()}),delete this.element.data().datepicker}};var c=e.fn.datepicker;e.fn.datepicker=function(t){var n=Array.apply(null,arguments);n.shift();var r;return this.each(function(){var i=e(this),s=i.data("datepicker"),o=typeof t=="object"&&t;if(!s){var c=f(this,"date"),p=e.extend({},h,c,o),d=l(p.language),v=e.extend({},h,d,c,o);if(i.is(".ai1ec-input-daterange")||v.inputs){var m={inputs:v.inputs||i.find("input").toArray()};i.data("datepicker",s=new a(this,e.extend(v,m)))}else i.data("datepicker",s=new u(this,v))}if(typeof t=="string"&&typeof s[t]=="function"){r=s[t].apply(s,n);if(r!==undefined)return!1}}),r!==undefined?r:this};var h=e.fn.datepicker.defaults={autoclose:!1,beforeShowDay:e.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},p=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=u;var d=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},v={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},getDaysInMonth:function(e,t){return[31,v.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(e){var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||n.length===0)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(t,n,i){if(!t)return undefined;if(t instanceof Date)return t;typeof n=="string"&&(n=v.parseFormat(n));if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(t)){var s=/([\-+]\d+)([dmwy])/,o=t.match(/([\-+]\d+)([dmwy])/g),a,f;t=new Date;for(var l=0;l<o.length;l++){a=s.exec(o[l]),f=parseInt(a[1]);switch(a[2]){case"d":t.setUTCDate(t.getUTCDate()+f);break;case"m":t=u.prototype.moveMonth.call(u.prototype,t,f);break;case"w":t.setUTCDate(t.getUTCDate()+f*7);break;case"y":t=u.prototype.moveYear.call(u.prototype,t,f)}}return r(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),0,0,0)}var o=t&&t.match(this.nonpunctuation)||[],t=new Date,c={},h=["yyyy","yy","M","MM","m","mm","d","dd"],p={yyyy:function(e,t){return e.setUTCFullYear(t)},yy:function(e,t){return e.setUTCFullYear(2e3+t)},m:function(e,t){if(isNaN(e))return e;t-=1;while(t<0)t+=12;t%=12,e.setUTCMonth(t);while(e.getUTCMonth()!=t)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}},m,g,a;p.M=p.MM=p.mm=p.m,p.dd=p.d,t=r(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);var y=n.parts.slice();o.length!=y.length&&(y=e(y).filter(function(t,n){return e.inArray(n,h)!==-1}).toArray());if(o.length==y.length){for(var l=0,b=y.length;l<b;l++){m=parseInt(o[l],10),a=y[l];if(isNaN(m))switch(a){case"MM":g=e(d[i].months).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].months)+1;break;case"M":g=e(d[i].monthsShort).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].monthsShort)+1}c[a]=m}for(var l=0,w,E;l<h.length;l++)E=h[l],E in c&&!isNaN(c[E])&&(w=new Date(t),p[E](w,c[E]),isNaN(w)||(t=w))}return t},formatDate:function(t,n,r){if(!t)return"";typeof n=="string"&&(n=v.parseFormat(n));var i={d:t.getUTCDate(),D:d[r].daysShort[t.getUTCDay()],DD:d[r].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:d[r].monthsShort[t.getUTCMonth()],MM:d[r].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m;var t=[],s=e.extend([],n.separators);for(var o=0,u=n.parts.length;o<=u;o++)s.length&&t.push(s.shift()),t.push(i[n.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="ai1ec-prev"><i class="ai1ec-fa ai1ec-fa-arrow-left"></i></th><th colspan="5" class="ai1ec-datepicker-switch"></th><th class="ai1ec-next"><i class="ai1ec-fa ai1ec-fa-arrow-right"></i></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="ai1ec-today"></th></tr><tr><th colspan="7" class="ai1ec-clear"></th></tr></tfoot>'};v.template='<div class="timely ai1ec-datepicker"><div class="ai1ec-datepicker-days"><table class=" ai1ec-table-condensed">'+v.headTemplate+"<tbody></tbody>"+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-months">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-years">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+"</div>",e.fn.datepicker.DPGlobal=v,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=c,this},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var n=e(this);if(n.data("datepicker"))return;t.preventDefault(),n.datepicker("show")}),e(function(){e('[data-provide="datepicker-inline"]').datepicker()});for(var m=2,g=arguments.length;m<g;m++)arguments[m].localize()}),timely.define("external_libs/bootstrap/transition",["jquery_timely"],function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(e.style[n]!==undefined)return{end:t[n]}}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one(e.support.transition.end,function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t()})}),timely.define("external_libs/bootstrap/collapse",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.transitioning=null,this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e=this.$element.hasClass("ai1ec-width");return e?"width":"height"},t.prototype.show=function(){if(this.transitioning||this.$element.hasClass("ai1ec-in"))return;var t=e.Event("show.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.$parent&&this.$parent.find("> .ai1ec-panel > .ai1ec-in");if(n&&n.length){var r=n.data("bs.collapse");if(r&&r.transitioning)return;n.collapse("hide"),r||n.data("bs.collapse",null)}var i=this.dimension();this.$element.removeClass("ai1ec-collapse").addClass("ai1ec-collapsing")[i](0),this.transitioning=1;var s=function(){this.$element.removeClass("ai1ec-collapsing").addClass("ai1ec-in")[i]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return s.call(this);var o=e.camelCase(["scroll",i].join("-"));this.$element.one(e.support.transition.end,e.proxy(s,this)).emulateTransitionEnd(350)[i](this.$element[0][o])},t.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("ai1ec-in"))return;var t=e.Event("hide.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("ai1ec-collapsing").removeClass("ai1ec-collapse").removeClass("ai1ec-in"),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("ai1ec-collapsing").addClass("ai1ec-collapse")};if(!e.support.transition)return r.call(this);this.$element[n](0).one(e.support.transition.end,e.proxy(r,this)).emulateTransitionEnd(350)},t.prototype.toggle=function(){this[this.$element.hasClass("ai1ec-in")?"hide":"show"]()};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("bs.collapse"),s=e.extend({},t.DEFAULTS,r.data(),typeof n=="object"&&n);i||r.data("bs.collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.bs.collapse.data-api","[data-toggle=ai1ec-collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i),o=s.data("bs.collapse"),u=o?"toggle":n.data(),a=n.attr("data-parent"),f=a&&e(a);if(!o||!o.transitioning)f&&f.find('[data-toggle=ai1ec-collapse][data-parent="'+a+'"]').not(n).addClass("ai1ec-collapsed"),n[s.hasClass("ai1ec-in")?"addClass":"removeClass"]("ai1ec-collapsed");s.collapse(u)})}),timely.define("external_libs/bootstrap/modal",["jquery_timely"],function(e){var t=function(t,n){this.options=n,this.$element=e(t),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this[this.isShown?"hide":"show"](e)},t.prototype.show=function(t){var n=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);if(this.isShown||r.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="ai1ec-modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var r=e.support.transition&&n.$element.hasClass("ai1ec-fade");n.$element.parent().length||n.$element.appendTo(document.body),n.$element.show(),r&&n.$element[0].offsetWidth,n.$element.addClass("ai1ec-in").attr("aria-hidden",!1),n.enforceFocus();var i=e.Event("shown.bs.modal",{relatedTarget:t});r?n.$element.find(".ai1ec-modal-dialog").one(e.support.transition.end,function(){n.$element.focus().trigger(i)}).emulateTransitionEnd(300):n.$element.focus().trigger(i)})},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("ai1ec-in").attr("aria-hidden",!0).off("click.dismiss.modal"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$element.one(e.support.transition.end,e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]!==e.target&&!this.$element.has(e.target).length&&this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){e.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var n=this,r=this.$element.hasClass("ai1ec-fade")?"ai1ec-fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="ai1ec-modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",e.proxy(function(e){if(e.target!==e.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("ai1ec-in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("ai1ec-in"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},t.DEFAULTS,i.data(),typeof n=="object"&&n);s||i.data("bs.modal",s=new t(this,o)),typeof n=="string"?s[n](r):o.show&&s.show(r)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="ai1ec-modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s,this).one("hide",function(){n.is(":visible")&&n.focus()})}),e(document).on("show.bs.modal",".ai1ec-modal",function(){e(document.body).addClass("ai1ec-modal-open")}).on("hidden.bs.modal",".ai1ec-modal",function(){e(document.body).removeClass("ai1ec-modal-open")})}),timely.define("external_libs/bootstrap/alert",["jquery_timely"],function(e){var t='[data-dismiss="ai1ec-alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed.bs.alert").remove()}var n=e(this),r=n.attr("data-target");r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));var i=e(r);t&&t.preventDefault(),i.length||(i=n.hasClass("ai1ec-alert")?n:n.parent()),i.trigger(t=e.Event("close.bs.alert"));if(t.isDefaultPrevented())return;i.removeClass("ai1ec-in"),e.support.transition&&i.hasClass("ai1ec-fade")?i.one(e.support.transition.end,s).emulateTransitionEnd(150):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}),timely.define("external_libs/select2",["jquery_timely"],function(e){(function(e){typeof e.fn.each2=="undefined"&&e.fn.extend({each2:function(t){var n=e([0]),r=-1,i=this.length;while(++r<i&&(n.context=n[0]=this[r])&&t.call(n[0],r,n)!==!1);return this}})})(e),function(e,t){function l(e,t){var n=0,r=t.length;for(;n<r;n+=1)if(c(e,t[n]))return n;return-1}function c(e,n){return e===n?!0:e===t||n===t?!1:e===null||n===null?!1:e.constructor===String?e===n+"":n.constructor===String?n===e+"":!1}function h(t,n){var r,i,s;if(t===null||t.length<1)return[];r=t.split(n);for(i=0,s=r.length;i<s;i+=1)r[i]=e.trim(r[i]);return r}function p(e){return e.outerWidth(!1)-e.width()}function d(n){var r="keyup-change-value";n.bind("keydown",function(){e.data(n,r)===t&&e.data(n,r,n.val())}),n.bind("keyup",function(){var i=e.data(n,r);i!==t&&n.val()!==i&&(e.removeData(n,r),n.trigger("keyup-change"))})}function v(n){n.bind("mousemove",function(n){var r=a;(r===t||r.x!==n.pageX||r.y!==n.pageY)&&e(n.target).trigger("mousemove-filtered",n)})}function m(e,n,r){r=r||t;var i;return function(){var t=arguments;window.clearTimeout(i),i=window.setTimeout(function(){n.apply(r,t)},e)}}function g(e){var t=!1,n;return function(){return t===!1&&(n=e(),t=!0),n}}function y(e,t){var n=m(e,function(e){t.trigger("scroll-debounced",e)});t.bind("scroll",function(e){l(e.target,t.get())>=0&&n(e)})}function b(e){if(e[0]===document.activeElement)return;window.setTimeout(function(){var t=e[0],n=e.val().length,r;e.focus(),t.setSelectionRange?t.setSelectionRange(n,n):t.createTextRange&&(r=t.createTextRange(),r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",n),r.select())},0)}function w(e){e.preventDefault(),e.stopPropagation()}function E(e){e.preventDefault(),e.stopImmediatePropagation()}function S(t){if(!u){var n=t[0].currentStyle||window.getComputedStyle(t[0],null);u=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"}),u.attr("class","select2-sizer"),e("body").append(u)}return u.text(t.val()),u.width()}function x(t,n,r){var i,s=[],o;i=t.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")===0&&s.push(this)}),i=n.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")!==0&&(o=r(this),typeof o=="string"&&o.length>0&&s.push(this))}),t.attr("class",s.join(" "))}function T(e,t,n,r){var i=e.toUpperCase().indexOf(t.toUpperCase()),s=t.length;if(i<0){n.push(r(e));return}n.push(r(e.substring(0,i))),n.push("<span class='select2-match'>"),n.push(r(e.substring(i,i+s))),n.push("</span>"),n.push(r(e.substring(i+s,e.length)))}function N(t){var n,r=0,i=null,s=t.quietMillis||100,o=t.url,u=this;return function(a){window.clearTimeout(n),n=window.setTimeout(function(){r+=1;var n=r,s=t.data,f=o,l=t.transport||e.ajax,c=t.type||"GET",h={};s=s?s.call(u,a.term,a.page,a.context):null,f=typeof f=="function"?f.call(u,a.term,a.page,a.context):f,null!==i&&i.abort(),t.params&&(e.isFunction(t.params)?e.extend(h,t.params.call(u)):e.extend(h,t.params)),e.extend(h,{url:f,dataType:t.dataType,data:s,type:c,cache:!1,success:function(e){if(n<r)return;var i=t.results(e,a.page);a.callback(i)}}),i=l.call(u,h)},s)}}function C(t){var n=t,r,i,s=function(e){return""+e.text};e.isArray(n)&&(i=n,n={results:i}),e.isFunction(n)===!1&&(i=n,n=function(){return i});var o=n();return o.text&&(s=o.text,e.isFunction(s)||(r=n.text,s=function(e){return e[r]})),function(t){var r=t.term,i={results:[]},o;if(r===""){t.callback(n());return}o=function(n,i){var u,a;n=n[0];if(n.children){u={};for(a in n)n.hasOwnProperty(a)&&(u[a]=n[a]);u.children=[],e(n.children).each2(function(e,t){o(t,u.children)}),(u.children.length||t.matcher(r,s(u),n))&&i.push(u)}else t.matcher(r,s(n),n)&&i.push(n)},e(n().results).each2(function(e,t){o(t,i.results)}),t.callback(i)}}function k(n){var r=e.isFunction(n);return function(i){var s=i.term,o={results:[]};e(r?n():n).each(function(){var e=this.text!==t,n=e?this.text:this;(s===""||i.matcher(s,n))&&o.results.push(e?this:{id:this,text:this})}),i.callback(o)}}function L(t,n){if(e.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value")}function A(t){return e.isFunction(t)?t():t}function O(t){var n=0;return e.each(t,function(e,t){t.children?n+=O(t.children):n++}),n}function M(e,n,r,i){var s=e,o=!1,u,a,f,l,h;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return t;for(;;){a=-1;for(f=0,l=i.tokenSeparators.length;f<l;f++){h=i.tokenSeparators[f],a=e.indexOf(h);if(a>=0)break}if(a<0)break;u=e.substring(0,a),e=e.substring(a+h.length);if(u.length>0){u=i.createSearchChoice(u,n);if(u!==t&&u!==null&&i.id(u)!==t&&i.id(u)!==null){o=!1;for(f=0,l=n.length;f<l;f++)if(c(i.id(u),i.id(n[f]))){o=!0;break}o||r(u)}}}if(s!==e)return e}function _(t,n){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=e.extend(r.prototype,n),r}var n,r,i,s,o,u,a,f;n={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){e=e.which?e.which:e;switch(e){case n.LEFT:case n.RIGHT:case n.UP:case n.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case n.SHIFT:case n.CTRL:case n.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&e<=123}},f=e(document),o=function(){var e=1;return function(){return e++}}(),f.bind("mousemove",function(e){a={x:e.pageX,y:e.pageY}}),r=_(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(n){var r,i,s=".select2-results",u;this.opts=n=this.prepareOpts(n),this.id=n.id,n.element.data("select2")!==t&&n.element.data("select2")!==null&&this.destroy(),this.enabled=!0,this.container=this.createContainer(),this.containerId="s2id_"+(n.element.attr("id")||"autogen"+o()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=g(function(){return n.element.closest("body")}),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(A(n.containerCss)),this.container.addClass(A(n.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabIndex"),this.opts.element.data("select2",this).addClass("select2-offscreen").bind("focus.select2",function(){e(this).select2("focus")}).attr("tabIndex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(A(n.dropdownCssClass)),this.dropdown.data("select2",this),this.results=r=this.container.find(s),this.search=i=this.container.find("input.select2-input"),i.attr("tabIndex",this.elementTabIndex),this.resultsPage=0,this.context=null,this.initContainer(),v(this.results),this.dropdown.delegate(s,"mousemove-filtered touchstart touchmove touchend",this.bind(this.highlightUnderEvent)),y(80,this.results),this.dropdown.delegate(s,"scroll-debounced",this.bind(this.loadMoreIfNeeded)),e.fn.mousewheel&&r.mousewheel(function(e,t,n,i){var s=r.scrollTop(),o;i>0&&s-i<=0?(r.scrollTop(0),w(e)):i<0&&r.get(0).scrollHeight-r.scrollTop()+i<=r.height()&&(r.scrollTop(r.get(0).scrollHeight-r.height()),w(e))}),d(i),i.bind("keyup-change input paste",this.bind(this.updateResults)),i.bind("focus",function(){i.addClass("select2-focused")}),i.bind("blur",function(){i.removeClass("select2-focused")}),this.dropdown.delegate(s,"mouseup",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.bind("click mouseup mousedown",function(e){e.stopPropagation()}),e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),(n.element.is(":disabled")||n.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var e=this.opts.element.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),e!==t&&(e.container.remove(),e.dropdown.remove(),e.opts.element.removeClass("select2-offscreen").removeData("select2").unbind(".select2").attr({tabIndex:this.elementTabIndex}).show())},prepareOpts:function(n){var r,i,s,o;r=n.element,r.get(0).tagName.toLowerCase()==="select"&&(this.select=i=n.element),i&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),n=e.extend({},{populateResults:function(r,i,s){var o,u,a,f,l=this.opts.id,c=this;o=function(r,i,u){var a,f,h,p,d,v,m,g,y,b;r=n.sortResults(r,i,s);for(a=0,f=r.length;a<f;a+=1)h=r[a],d=h.disabled===!0,p=!d&&l(h)!==t,v=h.children&&h.children.length>0,m=e("<li></li>"),m.addClass("select2-results-dept-"+u),m.addClass("select2-result"),m.addClass(p?"select2-result-selectable":"select2-result-unselectable"),d&&m.addClass("select2-disabled"),v&&m.addClass("select2-result-with-children"),m.addClass(c.opts.formatResultCssClass(h)),g=e(document.createElement("div")),g.addClass("select2-result-label"),b=n.formatResult(h,g,s,c.opts.escapeMarkup),b!==t&&g.html(b),m.append(g),v&&(y=e("<ul></ul>"),y.addClass("select2-result-sub"),o(h.children,y,u+1),m.append(y)),m.data("select2-data",h),i.append(m)},o(i,r,0)}},e.fn.select2.defaults,n),typeof n.id!="function"&&(s=n.id,n.id=function(e){return e[s]});if(e.isArray(n.element.data("select2Tags"))){if("tags"in n)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id");n.tags=n.element.attr("data-select2-tags")}i?(n.query=this.bind(function(n){var i={results:[],more:!1},s=n.term,o,u,a;a=function(e,t){var r;e.is("option")?n.matcher(s,e.text(),e)&&t.push({id:e.attr("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:c(e.attr("disabled"),"disabled")}):e.is("optgroup")&&(r={text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")},e.children().each2(function(e,t){a(t,r.children)}),r.children.length>0&&t.push(r))},o=r.children(),this.getPlaceholder()!==t&&o.length>0&&(u=o[0],e(u).text()===""&&(o=o.not(u))),o.each2(function(e,t){a(t,i.results)}),n.callback(i)}),n.id=function(e){return e.id},n.formatResultCssClass=function(e){return e.css}):"query"in n||("ajax"in n?(o=n.element.data("ajax-url"),o&&o.length>0&&(n.ajax.url=o),n.query=N.call(n.element,n.ajax)):"data"in n?n.query=C(n.data):"tags"in n&&(n.query=k(n.tags),n.createSearchChoice===t&&(n.createSearchChoice=function(e){return{id:e,text:e}}),n.initSelection===t&&(n.initSelection=function(t,r){var i=[];e(h(t.val(),n.separator)).each(function(){var t=this,r=this,s=n.tags;e.isFunction(s)&&(s=s()),e(s).each(function(){if(c(this.id,t))return r=this.text,!1}),i.push({id:t,text:r})}),r(i)})));if(typeof n.query!="function")throw"query function not defined for Select2 "+n.element.attr("id");return n},monitorSource:function(){var e=this.opts.element,t;e.bind("change.select2",this.bind(function(e){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),t=this.bind(function(){var e,t,n=this;e=this.opts.element.attr("disabled")!=="disabled",t=this.opts.element.attr("readonly")==="readonly",e=e&&!t,this.enabled!==e&&(e?this.enable():this.disable()),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(A(this.opts.containerCssClass)),x(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(A(this.opts.dropdownCssClass))}),e.bind("propertychange.select2 DOMAttrModified.select2",t),typeof WebKitMutationObserver!="undefined"&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(function(e){e.forEach(t)}),this.propertyObserver.observe(e.get(0),{attributes:!0,subtree:!1}))},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){if(this.enabled)return;this.enabled=!0,this.container.removeClass("select2-container-disabled"),this.opts.element.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"),this.opts.element.attr("disabled","disabled")},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t=this.container.offset(),n=this.container.outerHeight(!1),r=this.container.outerWidth(!1),i=this.dropdown.outerHeight(!1),s=e(window).scrollLeft()+e(window).width(),o=e(window).scrollTop()+e(window).height(),u=t.top+n,a=t.left,f=u+i<=o,l=t.top-i>=this.body().scrollTop(),c=this.dropdown.outerWidth(!1),h=a+c<=s,p=this.dropdown.hasClass("select2-drop-above"),d,v,m;this.body().css("position")!=="static"&&(d=this.body().offset(),u-=d.top,a-=d.left),p?(v=!0,!l&&f&&(v=!1)):(v=!1,!f&&l&&(v=!0)),h||(a=t.left+r-c),v?(u=t.top-i,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")),m=e.extend({top:u,left:a,width:r},A(this.opts.dropdownCss)),this.dropdown.css(m)},shouldOpen:function(){var t;return this.opened()?!1:(t=e.Event("opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(window.setTimeout(this.bind(this.opening),1),!0):!1},opening:function(){var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t,s;this.clearDropdownAlignmentPreference(),this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),this.updateResults(!0),s=e("#select2-drop-mask"),s.length==0&&(s=e(document.createElement("div")),s.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),s.hide(),s.appendTo(this.body()),s.bind("mousedown touchstart",function(t){var n=e("#select2-drop"),r;n.length>0&&(r=n.data("select2"),r.opts.selectOnBlur&&r.selectHighlighted({noFocus:!0}),r.close())})),this.dropdown.prev()[0]!==s[0]&&this.dropdown.before(s),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),s.css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),s.show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this.ensureHighlightVisible();var o=this;this.container.parents().add(window).each(function(){e(this).bind(r+" "+n+" "+i,function(t){e("#select2-drop-mask").css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),o.positionDropdown()})}),this.focusSearch()},close:function(){if(!this.opened())return;var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).unbind(n).unbind(r).unbind(i)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.opts.element.trigger(e.Event("close"))},clearSearch:function(){},getMaximumSelectionSize:function(){return A(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t=this.results,n,r,i,s,o,u,a;r=this.highlight();if(r<0)return;if(r==0){t.scrollTop(0);return}n=this.findHighlightableChoices(),i=e(n[r]),s=i.offset().top+i.outerHeight(!0),r===n.length-1&&(a=t.find("li.select2-more-results"),a.length>0&&(s=a.offset().top+a.outerHeight(!0))),o=t.offset().top+t.outerHeight(!0),s>o&&t.scrollTop(t.scrollTop()+(s-o)),u=i.offset().top-t.offset().top,u<0&&i.css("display")!="none"&&t.scrollTop(t.scrollTop()+u)},findHighlightableChoices:function(){var e=this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)");return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){var n=this.findHighlightableChoices(),r=this.highlight();while(r>-1&&r<n.length){r+=t;var i=e(n[r]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(r);break}}},highlight:function(t){var n=this.findHighlightableChoices(),r,i;if(arguments.length===0)return l(n.filter(".select2-highlighted")[0],n.get());t>=n.length&&(t=n.length-1),t<0&&(t=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),r=e(n[t]),r.addClass("select2-highlighted"),this.ensureHighlightVisible(),i=r.data("select2-data"),i&&this.opts.element.trigger({type:"highlight",val:this.id(i),choice:i})},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var n=e(t.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var r=this.findHighlightableChoices();this.highlight(r.index(n))}else n.length==0&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),n,r=-1,i=this.resultsPage+1,s=this,o=this.search.val(),u=this.context;if(t.length===0)return;n=t.offset().top-e.offset().top-e.height(),n<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:o,page:i,context:u,matcher:this.opts.matcher,callback:this.bind(function(n){if(!s.opened())return;s.opts.populateResults.call(this,e,n.results,{term:o,page:i,context:u}),n.more===!0?(t.detach().appendTo(e).text(s.opts.formatLoadMore(i+1)),window.setTimeout(function(){s.loadMoreIfNeeded()},10)):t.remove(),s.positionDropdown(),s.resultsPage=i,s.context=n.context})}))},tokenize:function(){},updateResults:function(n){function f(){i.scrollTop(0),r.removeClass("select2-active"),u.positionDropdown()}function l(e){i.html(e),f()}var r=this.search,i=this.results,s=this.opts,o,u=this,a;if(n!==!0&&(this.showSearchInput===!1||!this.opened()))return;r.addClass("select2-active");var h=this.getMaximumSelectionSize();if(h>=1){o=this.data();if(e.isArray(o)&&o.length>=h&&L(s.formatSelectionTooBig,"formatSelectionTooBig")){l("<li class='select2-selection-limit'>"+s.formatSelectionTooBig(h)+"</li>");return}}if(r.val().length<s.minimumInputLength){L(s.formatInputTooShort,"formatInputTooShort")?l("<li class='select2-no-results'>"+s.formatInputTooShort(r.val(),s.minimumInputLength)+"</li>"):l("");return}s.formatSearching()&&n===!0&&l("<li class='select2-searching'>"+s.formatSearching()+"</li>");if(s.maximumInputLength&&r.val().length>s.maximumInputLength){L(s.formatInputTooLong,"formatInputTooLong")?l("<li class='select2-no-results'>"+s.formatInputTooLong(r.val(),s.maximumInputLength)+"</li>"):l("");return}a=this.tokenize(),a!=t&&a!=null&&r.val(a),this.resultsPage=1,s.query({element:s.element,term:r.val(),page:this.resultsPage,context:null,matcher:s.matcher,callback:this.bind(function(o){var a;if(!this.opened())return;this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&r.val()!==""&&(a=this.opts.createSearchChoice.call(null,r.val(),o.results),a!==t&&a!==null&&u.id(a)!==t&&u.id(a)!==null&&e(o.results).filter(function(){return c(u.id(this),u.id(a))}).length===0&&o.results.unshift(a));if(o.results.length===0&&L(s.formatNoMatches,"formatNoMatches")){l("<li class='select2-no-results'>"+s.formatNoMatches(r.val())+"</li>");return}i.empty(),u.opts.populateResults.call(this,i,o.results,{term:r.val(),page:this.resultsPage,context:null}),o.more===!0&&L(s.formatLoadMore,"formatLoadMore")&&(i.append("<li class='select2-more-results'>"+u.opts.escapeMarkup(s.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){u.loadMoreIfNeeded()},10)),this.postprocessResults(o,n),f()})})},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){b(this.search)},selectHighlighted:function(e){var t=this.highlight(),n=this.results.find(".select2-highlighted"),r=n.closest(".select2-result").data("select2-data");r&&(this.highlight(t),this.onSelect(r,e))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){function n(){var n,r,i,s,o;if(this.opts.width==="off")return null;if(this.opts.width==="element")return this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px";if(this.opts.width==="copy"||this.opts.width==="resolve"){n=this.opts.element.attr("style");if(n!==t){r=n.split(";");for(s=0,o=r.length;s<o;s+=1){i=r[s].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);if(i!==null&&i.length>=1)return i[1]}}return this.opts.width==="resolve"?(n=this.opts.element.css("width"),n.indexOf("%")>0?n:this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var r=n.call(this);r!==null&&this.container.css("width",r)}}),i=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>"," <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>"," <div><b></b></div>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop' style='display:none'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.focusser.attr("disabled","disabled")},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.focusser.removeAttr("disabled")},opening:function(){this.parent.opening.apply(this,arguments),this.focusser.attr("disabled","disabled"),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),b(this.focusser)},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var e,t=this.container,r=this.dropdown,i=!1;this.showSearch(this.opts.minimumResultsForSearch>=0),this.selection=e=t.find(".select2-choice"),this.focusser=t.find(".select2-focusser"),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN){w(e);return}switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.TAB:case n.ENTER:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}})),this.focusser.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.ESC)return;if(this.opts.openOnEnter===!1&&e.which===n.ENTER){w(e);return}if(e.which==n.DOWN||e.which==n.UP||e.which==n.ENTER&&this.opts.openOnEnter){this.open(),w(e);return}if(e.which==n.DELETE||e.which==n.BACKSPACE){this.opts.allowClear&&this.clear(),w(e);return}})),d(this.focusser),this.focusser.bind("keyup-change input",this.bind(function(e){if(this.opened())return;this.open(),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.focusser.val(""),w(e)})),e.delegate("abbr","mousedown",this.bind(function(e){if(!this.enabled)return;this.clear(),E(e),this.close(),this.selection.focus()})),e.bind("mousedown",this.bind(function(e){i=!0,this.opened()?this.close():this.enabled&&this.open(),w(e),i=!1})),r.bind("mousedown",this.bind(function(){this.search.focus()})),e.bind("focus",this.bind(function(e){w(e)})),this.focusser.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})).bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active")})),this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.setPlaceholder()},clear:function(){var e=this.selection.data("select2-data");this.opts.element.val(""),this.selection.find("span").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),this.opts.element.trigger({type:"removed",val:this.id(e),choice:e}),this.triggerChange({removed:e})},initSelection:function(){var e;if(this.opts.element.val()===""&&this.opts.element.text()==="")this.close(),this.setPlaceholder();else{var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.setPlaceholder())})}},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(t,n){var r=t.find(":selected");e.isFunction(n)&&n({id:r.attr("value"),text:r.text(),element:r})}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=n.val();t.query({matcher:function(e,n,r){return c(i,t.id(r))},callback:e.isFunction(r)?function(e){r(e.results.length?e.results[0]:null)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.select.find("option").first().text()!==""?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.opts.element.val()===""&&e!==t){if(this.select&&this.select.find("option:first").text()!=="")return;this.selection.find("span").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide()}},postprocessResults:function(e,t){var n=0,r=this,i=!0;this.findHighlightableChoices().each2(function(e,t){if(c(r.id(t.data("select2-data")),r.opts.element.val()))return n=e,!1}),this.highlight(n);if(t===!0){var s=this.opts.minimumResultsForSearch;i=s<0?!1:O(e.results)>=s,this.showSearch(i)}},showSearch:function(t){this.showSearchInput=t,this.dropdown.find(".select2-search")[t?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[t?"addClass":"removeClass"]("select2-with-searchbox")},onSelect:function(e,t){var n=this.opts.element.val();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.close(),(!t||!t.noFocus)&&this.selection.focus(),c(n,this.id(e))||this.triggerChange()},updateSelection:function(e){var n=this.selection.find("span"),r;this.selection.data("select2-data",e),n.empty(),r=this.opts.formatSelection(e,n),r!==t&&n.append(this.opts.escapeMarkup(r)),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.selection.find("abbr").show()},val:function(){var e,n=!1,r=null,i=this;if(arguments.length===0)return this.opts.element.val();e=arguments[0],arguments.length>1&&(n=arguments[1]);if(this.select)this.select.val(e).find(":selected").each2(function(e,t){return r={id:t.attr("value"),text:t.text()},!1}),this.updateSelection(r),this.setPlaceholder(),n&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!e&&e!==0){this.clear(),n&&this.triggerChange();return}this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){i.opts.element.val(e?i.id(e):""),i.updateSelection(e),i.setPlaceholder(),n&&i.triggerChange()})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var n;if(arguments.length===0)return n=this.selection.data("select2-data"),n==t&&(n=null),n;!e||e===""?this.clear():(this.opts.element.val(e?this.id(e):""),this.updateSelection(e))}}),s=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html([" <ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi' style='display:none;'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(e,t){var n=[];e.find(":selected").each2(function(e,t){n.push({id:t.attr("value"),text:t.text(),element:t[0]})}),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=h(n.val(),t.separator);t.query({matcher:function(n,r,s){return e.grep(i,function(e){return c(e,t.id(s))}).length},callback:e.isFunction(r)?function(e){r(e.results)}:e.noop})}),t},initContainer:function(){var t=".select2-choices",r;this.searchContainer=this.container.find(".select2-search-field"),this.selection=r=this.container.find(t),this.search.bind("input paste",this.bind(function(){if(!this.enabled)return;this.opened()||this.open()})),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.BACKSPACE&&this.search.val()===""){this.close();var t,i=r.find(".select2-search-choice-focus");if(i.length>0){this.unselect(i.first()),this.search.width(10),w(e);return}t=r.find(".select2-search-choice:not(.select2-locked)"),t.length>0&&t.last().addClass("select2-search-choice-focus")}else r.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.ENTER:case n.TAB:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.BACKSPACE||e.which===n.ESC)return;if(e.which===n.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN)&&w(e)})),this.search.bind("keyup",this.bind(this.resizeSearch)),this.search.bind("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.opened()||this.clearSearch(),e.stopImmediatePropagation()})),this.container.delegate(t,"mousedown",this.bind(function(t){if(!this.enabled)return;if(e(t.target).closest(".select2-search-choice").length>0)return;this.clearPlaceholder(),this.open(),this.focusSearch(),t.preventDefault()})),this.container.delegate(t,"focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder()})),this.initContainerWidth(),this.clearSearch()},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.search.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0)},initSelection:function(){var e;this.opts.element.val()===""&&this.opts.element.text()===""&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||this.opts.element.val()!==""){var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder();e!==t&&this.getVal().length===0&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.resizeSearch()):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.parent.opening.apply(this,arguments),this.clearPlaceholder(),this.resizeSearch(),this.focusSearch(),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus(),this.opts.element.triggerHandler("focus")},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var n=[],r=[],i=this;e(t).each(function(){l(i.id(this),n)<0&&(n.push(i.id(this)),r.push(this))}),t=r,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){i.addSelectedChoice(this)}),i.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer(e,this.data(),this.bind(this.onSelect),this.opts),e!=null&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),(!t||!t.noFocus)&&this.focusSearch()},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(n){var r=!n.locked,i=e("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=e("<li class='select2-search-choice select2-locked'><div></div></li>"),o=r?i:s,u=this.id(n),a=this.getVal(),f;f=this.opts.formatSelection(n,o.find("div")),f!=t&&o.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"</div>"),r&&o.find(".select2-search-choice-close").bind("mousedown",w).bind("click dblclick",this.bind(function(t){if(!this.enabled)return;e(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),w(t)})).bind("focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active")})),o.data("select2-data",n),o.insertBefore(this.searchContainer),a.push(u),this.setVal(a)},unselect:function(e){var t=this.getVal(),n,r;e=e.closest(".select2-search-choice");if(e.length===0)throw"Invalid argument: "+e+". Must be .select2-search-choice";n=e.data("select2-data");if(!n)return;r=l(this.id(n),t),r>=0&&(t.splice(r,1),this.setVal(t),this.select&&this.postprocessResults()),e.remove(),this.opts.element.trigger({type:"removed",val:this.id(n),choice:n}),this.triggerChange({removed:n})},postprocessResults:function(){var e=this.getVal(),t=this.results.find(".select2-result"),n=this.results.find(".select2-result-with-children"),r=this;t.each2(function(t,n){var i=r.id(n.data("select2-data"));l(i,e)>=0&&(n.addClass("select2-selected"),n.find(".select2-result-selectable").addClass("select2-selected"))}),n.each2(function(e,t){!t.is(".select2-result-selectable")&&t.find(".select2-result-selectable:not(.select2-selected)").length===0&&t.addClass("select2-selected")}),this.highlight()==-1&&r.highlight(0)},resizeSearch:function(){var e,t,n,r,i,s=p(this.search);e=S(this.search)+10,t=this.search.offset().left,n=this.selection.width(),r=this.selection.offset().left,i=n-(t-r)-s,i<e&&(i=n-s),i<40&&(i=n-s),i<=0&&(i=e),this.search.width(i)},getVal:function(){var e;return this.select?(e=this.select.val(),e===null?[]:e):(e=this.opts.element.val(),h(e,this.opts.separator))},setVal:function(t){var n;this.select?this.select.val(t):(n=[],e(t).each(function(){l(this,n)<0&&n.push(this)}),this.opts.element.val(n.length===0?"":n.join(this.opts.separator)))},val:function(){var n,r=!1,i=[],s=this;if(arguments.length===0)return this.getVal();n=arguments[0],arguments.length>1&&(r=arguments[1]);if(!n&&n!==0){this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),r&&this.triggerChange();return}this.setVal(n);if(this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),r&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var n=e(t).map(s.id);s.setVal(n),s.updateSelection(t),s.clearSearch(),r&&s.triggerChange()})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],n=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(n.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t){var n=this,r;if(arguments.length===0)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();t||(t=[]),r=e.map(t,function(e){return n.opts.id(e)}),this.setVal(r),this.updateSelection(t),this.clearSearch()}}),e.fn.select2=function(){var n=Array.prototype.slice.call(arguments,0),r,o,u,a,f=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","disable","positionDropdown","data"];return this.each(function(){if(n.length===0||typeof n[0]=="object")r=n.length===0?{}:e.extend({},n[0]),r.element=e(this),r.element.get(0).tagName.toLowerCase()==="select"?a=r.element.attr("multiple"):(a=r.multiple||!1,"tags"in r&&(r.multiple=a=!0)),o=a?new s:new i,o.init(r);else{if(typeof n[0]!="string")throw"Invalid arguments to select2 plugin: "+n;if(l(n[0],f)<0)throw"Unknown method: "+n[0];u=t,o=e(this).data("select2");if(o===t)return;n[0]==="container"?u=o.container:u=o[n[0]].apply(o,n.slice(1));if(u!==t)return!1}}),u===t?this:u},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,n,r){var i=[];return T(e.text,n.term,i,r),i.join("")},formatSelection:function(e,n){return e?e.text:t},sortResults:function(e,t,n){return e},formatResultCssClass:function(e){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" more character"+(n==1?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please enter "+n+" less character"+(n==1?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(e==1?"":"s")},formatLoadMore:function(e){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e.id},matcher:function(e,t){return t.toUpperCase().indexOf(e.toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;","/":"&#47;"};return String(e).replace(/[&<>"'/\\]/g,function(e){return t[e[0]]})},blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null}}}(e)}),timely.define("scripts/add_new_event",["jquery_timely","domReady","ai1ec_config","scripts/add_new_event/event_location/gmaps_helper","scripts/add_new_event/event_location/input_coordinates_event_handlers","scripts/add_new_event/event_location/input_coordinates_utility_functions","scripts/add_new_event/event_date_time/date_time_event_handlers","scripts/add_new_event/event_cost_helper","external_libs/jquery.calendrical_timespan","external_libs/jquery.inputdate","external_libs/jquery.tools","external_libs/bootstrap_datepicker","external_libs/bootstrap/transition","external_libs/bootstrap/collapse","external_libs/bootstrap/modal","external_libs/bootstrap/alert","external_libs/bootstrap/tab","external_libs/select2"],function(e,t,n,r,i,s,o,u,a){var f=function(){var t=new Date(n.now*1e3),r={allday:"#ai1ec_all_day_event",start_date_input:"#ai1ec_start-date-input",start_time_input:"#ai1ec_start-time-input",start_time:"#ai1ec_start-time",end_date_input:"#ai1ec_end-date-input",end_time_input:"#ai1ec_end-time-input",end_time:"#ai1ec_end-time",date_format:n.date_format,month_names:n.month_names,day_names:n.day_names,week_start_day:n.week_start_day,twentyfour_hour:n.twentyfour_hour,now:t};e.timespan(r)},l=function(){e(".ai1ec-panel-collapse").on("hide",function(){e(this).parent().removeClass("ai1ec-overflow-visible")}),e(".ai1ec-panel-collapse").on("shown",function(){var t=e(this);window.setTimeout(function(){t.parent().addClass("ai1ec-overflow-visible")},350)})},c=function(){f(),timely.require(["libs/gmaps"],function(e){e(r.init_gmaps)})},h=function(t,n){var r=null;"[object Array]"===Object.prototype.toString.call(n)?r=n.join("<br>"):r=n,e("#ai1ec_event_inline_alert").html(r),e("#ai1ec_event_inline_alert").removeClass("ai1ec-hidden"),t.preventDefault(),e("#publish, #ai1ec_bottom_publish").removeClass("button-primary-disabled"),e("#publish, #ai1ec_bottom_publish").removeClass("disabled"),e("#publish, #ai1ec_bottom_publish").siblings("#ajax-loading, .spinner").css("visibility","hidden")},p=function(t){s.ai1ec_check_lat_long_fields_filled_when_publishing_event(t)===!0&&(s.ai1ec_convert_commas_to_dots_for_coordinates(),s.ai1ec_check_lat_long_ok_for_search(t));var r=!1,i=[];e("#ai1ec_ticket_url, #ai1ec_contact_url").each(function(){var t=this.value;e(this).removeClass("ai1ec-input-warn"),e(this).closest(".ai1ec-panel-collapse").parent().find(".ai1ec-panel-heading .ai1ec-fa-warning").addClass("ai1ec-hidden").parent().css("color","");if(""!==t){var s=/(http|https):\/\//;if(!s.test(t)){e(this).closest(".ai1ec-panel-collapse").parent().find(".ai1ec-panel-heading .ai1ec-fa-warning").removeClass("ai1ec-hidden").parent().css("color","rgb(255, 79, 79)"),r||e(this).closest(".ai1ec-panel-collapse").collapse("show"),r=!0;var o=e(this).attr("id")+"_not_valid";i.push(n[o]),e(this).addClass("ai1ec-input-warn")}}}),r&&(i.push(n.general_url_not_valid),h(t,i))},d=function(){e("#ai1ec_google_map").click(i.toggle_visibility_of_google_map_on_click),e("#ai1ec_input_coordinates").change(i.toggle_visibility_of_coordinate_fields_on_click),e("#post").submit(p),e("input.ai1ec-coordinates").blur(i.update_map_from_coordinates_on_blur),e("#ai1ec_bottom_publish").on("click",o.trigger_publish),e(document).on("change","#ai1ec_end",o.show_end_fields).on("click","#ai1ec_repeat_apply",o.handle_click_on_apply_button).on("click","#ai1ec_repeat_cancel",o.handle_click_on_cancel_modal).on("click","#ai1ec_monthly_type_bymonthday, #ai1ec_monthly_type_byday",o.handle_checkbox_monthly_tab_modal).on("click",".ai1ec-btn-group-grid a",o.handle_click_on_toggle_buttons),e("#ai1ec_repeat_box").on("hidden.bs.modal",o.handle_modal_hide),o.execute_pseudo_handlers(),e("#widgetField > a").on("click",o.handle_animation_of_calendar_widget),e("#ai1ec_is_free").on("change",u.handle_change_is_free),e(document).on("click",".ai1ec-set-banner-image",v),e(document).on("click",".ai1ec-remove-banner",m)},v=function(){var t={};return t._frame=wp.media({state:"featured-image",states:[new wp.media.controller.FeaturedImage,new wp.media.controller.EditImage]}),t._frame.open(),e(".media-frame:last ").addClass("ai1ec-banner-image-frame"),e(".media-frame-title:last h1").text(e(".ai1ec-set-banner-block .ai1ec-set-banner-image").text()),e(".media-frame-toolbar:last").append(e(".ai1ec-media-toolbar").clone().removeClass("ai1ec-media-toolbar ai1ec-hidden")),e(".ai1ec-save-banner-image").off().on("click",function(){var n=e(".attachments:visible li.selected img").attr("src"),r=e(".attachment-details:visible input[type=text]").val();return n&&r&&e("#ai1ec_event_banner .inside").find(".ai1ec-banner-image-block").removeClass("ai1ec-hidden").find("img").attr("src",n).end().find("input").val(r).end().end().find(".ai1ec-set-banner-block").addClass("ai1ec-hidden").end().find(".ai1ec-remove-banner-block").removeClass("ai1ec-hidden"),t._frame.close(),!1}),!1},m=function(){return e("#ai1ec_event_banner .inside").find(".ai1ec-remove-banner-block").addClass("ai1ec-hidden").end().find(".ai1ec-banner-image-block").addClass("ai1ec-hidden").find("input").val("").end().find("img").attr("src","").end().end().find(".ai1ec-set-banner-block").removeClass("ai1ec-hidden"),!1},g=function(){e("#ai1ec_event").insertAfter("#ai1ec_event_inline_alert"),e("#post").addClass("ai1ec-visible")},y=function(){e("#timezone-select").select2()},b=function(){c(),t(function(){l(),g(),d(),y()})};return{start:b}}),timely.require(["scripts/add_new_event"],function(e){e.start()}),timely.define("pages/add_new_event",function(){});
161
  the specific language governing permissions and limitations under the Apache License and the GPL License.
162
  */
163
 
164
+ timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("external_libs/bootstrap/tab",["jquery_timely"],function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.ai1ec-dropdown-menu)"),r=t.data("target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("ai1ec-active"))return;var i=n.find(".ai1ec-active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("ai1ec-active").find("> .ai1ec-dropdown-menu > .ai1ec-active").removeClass("ai1ec-active"),t.addClass("ai1ec-active"),s?(t[0].offsetWidth,t.addClass("ai1ec-in")):t.removeClass("ai1ec-fade"),t.parent(".ai1ec-dropdown-menu")&&t.closest("li.ai1ec-dropdown").addClass("ai1ec-active"),r&&r()}var i=n.find("> .ai1ec-active"),s=r&&e.support.transition&&i.hasClass("ai1ec-fade");s?i.one(e.support.transition.end,o).emulateTransitionEnd(150):o(),i.removeClass("ai1ec-in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="ai1ec-tab"], [data-toggle="ai1ec-pill"]',function(t){t.preventDefault(),e(this).tab("show")})}),timely.define("libs/utils",["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert ai1ec-alert-info"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")},add_query_arg:function(e,t){if("string"!=typeof e)return!1;var n=e.indexOf("?")===-1?"?":"&";return-1!==e.indexOf(n+t[0]+"=")?e:e+n+t[0]+"="+t[1]},create_ai1ec_to_send:function(t){var n=e(t),r=[],i=["action","cat_ids","auth_ids","tag_ids","exact_date","display_filters","no_navigation","events_limit"];return n.each(function(){e.each(this.attributes,function(){this.specified&&this.value&&this.name.match(/^data-/)&&(-1<e.inArray(this.name.replace(/^data\-/,""),i)||this.name.match(/_ids$/))&&r.push(this.name.replace(/^data\-/,"")+"~"+this.value)})}),r.join("|")},init_autoselect:function(){e(document).on("click",".ai1ec-autoselect",function(t){if(e(this).data("clicked")&&t.originalEvent.detail<2)return;e(this).data("clicked",!0);var n;document.body.createTextRange?(n=document.body.createTextRange(),n.moveToElementText(this),n.select()):window.getSelection&&(selection=window.getSelection(),n=document.createRange(),n.selectNodeContents(this),selection.removeAllRanges(),selection.addRange(n))})}}}();return t}),timely.define("scripts/add_new_event/event_location/input_coordinates_utility_functions",["jquery_timely","ai1ec_config","libs/utils"],function(e,t,n){var r=function(){e("#ai1ec_input_coordinates:checked").length>0&&e("#ai1ec_table_coordinates input.ai1ec-coordinates").each(function(){this.value=n.convert_comma_to_dot(this.value)})},i=function(t,n){var r=e("<div />",{text:n,"class":"ai1ec-error"});e(t).after(r)},s=function(t,n){t.target.id==="post"&&(t.stopImmediatePropagation(),t.preventDefault(),e("#publish").removeClass("button-primary-disabled"),e("#publish").siblings(".spinner").css("visibility","hidden")),e(n).focus()},o=function(){var t=n.field_has_value("ai1ec_address"),r=!0;return e("input.ai1ec-coordinates").each(function(){var e=n.field_has_value(this.id);e||(r=!1)}),t||r},u=function(n){var r=!0,o=!1;return e("#ai1ec_input_coordinates:checked").length>0&&(e("div.ai1ec-error").remove(),e("#ai1ec_table_coordinates input.ai1ec-coordinates").each(function(){var n=e(this).hasClass("latitude"),s=n?t.error_message_not_entered_lat:t.error_message_not_entered_long;this.value===""&&(r=!1,o===!1&&(o=this),i(this,s))})),r===!1&&s(n,o),r},a=function(r){if(e("#ai1ec_input_coordinates:checked").length===1){e("div.ai1ec-error").remove();var o=!0,u=!1,a=!1;return e("#ai1ec_table_coordinates input.ai1ec-coordinates").each(function(){if(this.value===""){a=!0;return}var r=e(this).hasClass("latitude"),s=r?t.error_message_not_valid_lat:t.error_message_not_valid_long;n.is_valid_coordinate(this.value,r)||(o=!1,u===!1&&(u=this),i(this,s))}),o===!1&&s(r,u),a===!0&&(o=!1),o}};return{ai1ec_convert_commas_to_dots_for_coordinates:r,ai1ec_show_error_message_after_element:i,check_if_address_or_coordinates_are_set:o,ai1ec_check_lat_long_fields_filled_when_publishing_event:u,ai1ec_check_lat_long_ok_for_search:a}}),timely.define("external_libs/jquery.autocomplete_geomod",["jquery_timely"],function(e){e.fn.extend({autocomplete:function(t,n){var r=typeof t=="string";return n=e.extend({},e.Autocompleter.defaults,{url:r?t:null,data:r?null:t,delay:r?e.Autocompleter.defaults.delay:10,max:n&&!n.scroll?10:150},n),n.highlight=n.highlight||function(e){return e},n.formatMatch=n.formatMatch||n.formatItem,this.each(function(){new e.Autocompleter(this,n)})},result:function(e){return this.bind("result",e)},search:function(e){return this.trigger("search",[e])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(e){return this.trigger("setOptions",[e])},unautocomplete:function(){return this.trigger("unautocomplete")}}),e.Autocompleter=function(t,n){function d(){var r=h.selected();if(!r)return!1;var s=r.result;o=s;if(n.multiple){var u=m(i.val());if(u.length>1){var a=n.multipleSeparator.length,f=e(t).selection().start,l,c=0;e.each(u,function(e,t){c+=t.length;if(f<=c)return l=e,!1;c+=a}),u[l]=s,s=u.join(n.multipleSeparator)}s+=n.multipleSeparator}return i.val(s),w(),i.trigger("result",[r.data,r.value]),!0}function v(e,t){if(f==r.DEL){h.hide();return}var s=i.val();if(!t&&s==o)return;o=s,s=g(s),s.length>=n.minChars?(i.addClass(n.loadingClass),n.matchCase||(s=s.toLowerCase()),S(s,E,w)):(T(),h.hide())}function m(t){return t?n.multiple?e.map(t.split(n.multipleSeparator),function(n){return e.trim(t).length?e.trim(n):null}):[e.trim(t)]:[""]}function g(r){if(!n.multiple)return r;var i=m(r);if(i.length==1)return i[0];var s=e(t).selection().start;return s==r.length?i=m(r):i=m(r.replace(r.substring(s),"")),i[i.length-1]}function y(s,u){n.autoFill&&g(i.val()).toLowerCase()==s.toLowerCase()&&f!=r.BACKSPACE&&(i.val(i.val()+u.substring(g(o).length)),e(t).selection(o.length,o.length+u.length))}function b(){clearTimeout(s),s=setTimeout(w,200)}function w(){var e=h.visible();h.hide(),clearTimeout(s),T(),n.mustMatch&&i.search(function(e){if(!e)if(n.multiple){var t=m(i.val()).slice(0,-1);i.val(t.join(n.multipleSeparator)+(t.length?n.multipleSeparator:""))}else i.val(""),i.trigger("result",null)})}function E(e,t){t&&t.length&&a?(T(),h.display(t,e),y(e,t[0].value),h.show()):w()}function S(r,i,s){n.matchCase||(r=r.toLowerCase());var o=u.load(r);if(o&&o.length)i(r,o);else if(n.geocoder){var a=g(r),f={address:a};n.region&&(f.region=n.region),n.geocoder.geocode(f,function(e,t){var s=n.parse(e,t,a);u.add(r,s),i(r,s)})}else if(typeof n.url=="string"&&n.url.length>0){var l={timestamp:+(new Date)};e.each(n.extraParams,function(e,t){l[e]=typeof t=="function"?t():t}),e.ajax({mode:"abort",port:"autocomplete"+t.name,dataType:n.dataType,url:n.url,data:e.extend({q:g(r),limit:n.max},l),success:function(e){var t=n.parse&&n.parse(e)||x(e);u.add(r,t),i(r,t)}})}else h.emptyList(),s(r)}function x(t){var r=[],i=t.split("\n");for(var s=0;s<i.length;s++){var o=e.trim(i[s]);o&&(o=o.split("|"),r[r.length]={data:o,value:o[0],result:n.formatResult&&n.formatResult(o,o[0])||o[0]})}return r}function T(){i.removeClass(n.loadingClass)}var r={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8},i=e(t).attr("autocomplete","off").addClass(n.inputClass),s,o="",u=e.Autocompleter.Cache(n),a=0,f,l=navigator.userAgent.match(/opera/i),c={mouseDownOnSelect:!1},h=e.Autocompleter.Select(n,t,d,c),p;l&&e(t.form).bind("submit.autocomplete",function(){if(p)return p=!1,!1}),i.bind((l?"keypress":"keydown")+".autocomplete",function(t){a=1,f=t.keyCode;switch(t.keyCode){case r.UP:t.preventDefault(),h.visible()?h.prev():v(0,!0);break;case r.DOWN:t.preventDefault(),h.visible()?h.next():v(0,!0);break;case r.PAGEUP:t.preventDefault(),h.visible()?h.pageUp():v(0,!0);break;case r.PAGEDOWN:t.preventDefault(),h.visible()?h.pageDown():v(0,!0);break;case n.multiple&&e.trim(n.multipleSeparator)==","&&r.COMMA:case r.TAB:case r.RETURN:if(d())return t.preventDefault(),p=!0,!1;break;case r.ESC:h.hide();break;default:clearTimeout(s),s=setTimeout(v,n.delay)}}).focus(function(){a++}).blur(function(){a=0,c.mouseDownOnSelect||b()}).click(function(){a++>1&&!h.visible()&&v(0,!0)}).bind("search",function(){function n(e,n){var r;if(n&&n.length)for(var s=0;s<n.length;s++)if(n[s].result.toLowerCase()==e.toLowerCase()){r=n[s];break}typeof t=="function"?t(r):i.trigger("result",r&&[r.data,r.value])}var t=arguments.length>1?arguments[1]:null;e.each(m(i.val()),function(e,t){S(t,n,n)})}).bind("flushCache",function(){u.flush()}).bind("setOptions",function(){e.extend(n,arguments[1]),"data"in arguments[1]&&u.populate()}).bind("unautocomplete",function(){h.unbind(),i.unbind(),e(t.form).unbind(".autocomplete")})},e.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:!1,matchSubset:!0,matchContains:!1,cacheLength:10,max:100,mustMatch:!1,extraParams:{},selectFirst:!0,formatItem:function(e){return e[0]},formatMatch:null,autoFill:!1,width:0,multiple:!1,multipleSeparator:", ",highlight:function(e,t){return e.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+t.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:!0,scrollHeight:180},e.Autocompleter.Cache=function(t){function i(e,n){t.matchCase||(e=e.toLowerCase());var r=e.indexOf(n);return t.matchContains=="word"&&(r=e.toLowerCase().search("\\b"+n.toLowerCase())),r==-1?!1:r==0||t.matchContains}function s(e,i){r>t.cacheLength&&u(),n[e]||r++,n[e]=i}function o(){if(!t.data)return!1;var n={},r=0;t.url||(t.cacheLength=1),n[""]=[];for(var i=0,o=t.data.length;i<o;i++){var u=t.data[i];u=typeof u=="string"?[u]:u;var a=t.formatMatch(u,i+1,t.data.length);if(a===!1)continue;var f=a.charAt(0).toLowerCase();n[f]||(n[f]=[]);var l={value:a,data:u,result:t.formatResult&&t.formatResult(u)||a};n[f].push(l),r++<t.max&&n[""].push(l)}e.each(n,function(e,n){t.cacheLength++,s(e,n)})}function u(){n={},r=0}var n={},r=0;return setTimeout(o,25),{flush:u,add:s,populate:o,load:function(s){if(!t.cacheLength||!r)return null;if(!t.url&&t.matchContains){var o=[];for(var u in n)if(u.length>0){var a=n[u];e.each(a,function(e,t){i(t.value,s)&&o.push(t)})}return o}if(n[s])return n[s];if(t.matchSubset)for(var f=s.length-1;f>=t.minChars;f--){var a=n[s.substr(0,f)];if(a){var o=[];return e.each(a,function(e,t){i(t.value,s)&&(o[o.length]=t)}),o}}return null}}},e.Autocompleter.Select=function(t,n,r,i){function p(){if(!l)return;c=e("<div/>").hide().addClass(t.resultsClass).css("position","absolute").appendTo(document.body),h=e("<ul/>").appendTo(c).mouseover(function(t){d(t).nodeName&&d(t).nodeName.toUpperCase()=="LI"&&(u=e("li",h).removeClass(s.ACTIVE).index(d(t)),e(d(t)).addClass(s.ACTIVE))}).click(function(t){return e(d(t)).addClass(s.ACTIVE),r(),n.focus(),!1}).mousedown(function(){i.mouseDownOnSelect=!0}).mouseup(function(){i.mouseDownOnSelect=!1}),t.width>0&&c.css("width",t.width),l=!1}function d(e){var t=e.target;while(t&&t.tagName!="LI")t=t.parentNode;return t?t:[]}function v(e){o.slice(u,u+1).removeClass(s.ACTIVE),m(e);var n=o.slice(u,u+1).addClass(s.ACTIVE);if(t.scroll){var r=0;o.slice(0,u).each(function(){r+=this.offsetHeight}),r+n[0].offsetHeight-h.scrollTop()>h[0].clientHeight?h.scrollTop(r+n[0].offsetHeight-h.innerHeight()):r<h.scrollTop()&&h.scrollTop(r)}}function m(e){u+=e,u<0?u=o.size()-1:u>=o.size()&&(u=0)}function g(e){return t.max&&t.max<e?t.max:e}function y(){h.empty();var n=g(a.length);for(var r=0;r<n;r++){if(!a[r])continue;var i=t.formatItem(a[r].data,r+1,n,a[r].value,f);if(i===!1)continue;var l=e("<li/>").html(t.highlight(i,f)).addClass(r%2==0?"ac_even":"ac_odd").appendTo(h)[0];e.data(l,"ac_data",a[r])}o=h.find("li"),t.selectFirst&&(o.slice(0,1).addClass(s.ACTIVE),u=0),e.fn.bgiframe&&h.bgiframe()}var s={ACTIVE:"ac_over"},o,u=-1,a,f="",l=!0,c,h;return{display:function(e,t){p(),a=e,f=t,y()},next:function(){v(1)},prev:function(){v(-1)},pageUp:function(){u!=0&&u-8<0?v(-u):v(-8)},pageDown:function(){u!=o.size()-1&&u+8>o.size()?v(o.size()-1-u):v(8)},hide:function(){c&&c.hide(),o&&o.removeClass(s.ACTIVE),u=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(o.filter("."+s.ACTIVE)[0]||t.selectFirst&&o[0])},show:function(){var r=e(n).offset();c.css({width:typeof t.width=="string"||t.width>0?t.width:e(n).width(),top:r.top+n.offsetHeight,left:r.left}).show();if(t.scroll){h.scrollTop(0),h.css({maxHeight:t.scrollHeight,overflow:"auto"});if(navigator.userAgent.match(/msie/i)&&typeof document.body.style.maxHeight=="undefined"){var i=0;o.each(function(){i+=this.offsetHeight});var s=i>t.scrollHeight;h.css("height",s?t.scrollHeight:i),s||o.width(h.width()-parseInt(o.css("padding-left"))-parseInt(o.css("padding-right")))}}},selected:function(){var t=o&&o.filter("."+s.ACTIVE).removeClass(s.ACTIVE);return t&&t.length&&e.data(t[0],"ac_data")},emptyList:function(){h&&h.empty()},unbind:function(){c&&c.remove()}}},e.fn.selection=function(e,t){if(e!==undefined)return this.each(function(){if(this.createTextRange){var n=this.createTextRange();t===undefined||e==t?(n.move("character",e),n.select()):(n.collapse(!0),n.moveStart("character",e),n.moveEnd("character",t),n.select())}else this.setSelectionRange?this.setSelectionRange(e,t):this.selectionStart&&(this.selectionStart=e,this.selectionEnd=t)});var n=this[0];if(n.createTextRange){var r=document.selection.createRange(),i=n.value,s="<->",o=r.text.length;r.text=s;var u=n.value.indexOf(s);return n.value=i,this.selection(u,u+o),{start:u,end:u+o}}if(n.selectionStart!==undefined)return{start:n.selectionStart,end:n.selectionEnd}}}),timely.define("external_libs/geo_autocomplete",["jquery_timely","external_libs/jquery.autocomplete_geomod"],function(e){e.fn.extend({geo_autocomplete:function(t,n){return options=e.extend({},e.Autocompleter.defaults,{geocoder:t,mapwidth:100,mapheight:100,maptype:"terrain",mapkey:"ABQIAAAAbnvDoAoYOSW2iqoXiGTpYBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQNumU68AwGqjbSNF9YO8NokKst8w",mapsensor:!1,parse:function(t,n,r){var i=[];return t&&n&&n=="OK"&&e.each(t,function(t,n){if(n.geometry&&n.geometry.viewport){var s=n.formatted_address.split(","),o=s[0];e.each(s,function(t,n){if(n.toLowerCase().indexOf(r.toLowerCase())!=-1)return o=e.trim(n),!1}),i.push({data:n,value:o,result:o})}}),i},formatItem:function(e,t,n,r){var i="https://maps.google.com/maps/api/staticmap?visible="+e.geometry.viewport.getSouthWest().toUrlValue()+"|"+e.geometry.viewport.getNorthEast().toUrlValue()+"&size="+options.mapwidth+"x"+options.mapheight+"&maptype="+options.maptype+"&key="+options.mapkey+"&sensor="+(options.mapsensor?"true":"false"),s=e.formatted_address.replace(/,/gi,",<br/>");return'<img src="'+i+'" width="'+options.mapwidth+'" height="'+options.mapheight+'" /> '+s+'<br clear="both"/>'}},n),options.highlight=options.highlight||function(e){return e},options.formatMatch=options.formatMatch||options.formatItem,options.resultsClass="ai1ec-geo-ac-results-not-ready",this.each(function(){e(this).one("focus",function(){var t=setInterval(function(){var n=e(".ai1ec-geo-ac-results-not-ready");n.length&&(n.removeClass("ai1ec-geo-ac-results-not-ready").addClass("ai1ec-geo-ac-results").children("ul").addClass("ai1ec-dropdown-menu"),clearInterval(t))},500)}),new e.Autocompleter(this,options)})}})}),timely.define("scripts/add_new_event/event_location/gmaps_helper",["jquery_timely","domReady","ai1ec_config","scripts/add_new_event/event_location/input_coordinates_utility_functions","external_libs/jquery.autocomplete_geomod","external_libs/geo_autocomplete"],function(e,t,n,r){var i,s,o,u,a,f,l=function(t){e("#ai1ec_latitude").val(t.latLng.lat()),e("#ai1ec_longitude").val(t.latLng.lng()),e("#ai1ec_input_coordinates:checked").length===0&&e("#ai1ec_input_coordinates").trigger("click")},c=function(){n.disable_autocompletion||e("#ai1ec_address").geo_autocomplete(new google.maps.Geocoder,{selectFirst:!1,minChars:3,cacheLength:50,width:300,scroll:!0,scrollHeight:330,region:n.region}).result(function(e,t){t&&p(t)}).change(function(){if(e(this).val().length>0){var t=e(this).val();i.geocode({address:t,region:n.region},function(e,t){t===google.maps.GeocoderStatus.OK&&p(e[0])})}})},h=function(){i=new google.maps.Geocoder,s=new google.maps.LatLng(9.965,-83.327),o={zoom:0,mapTypeId:google.maps.MapTypeId.ROADMAP,center:s},t(function(){e("#ai1ec_map_canvas").length>0&&(u=new google.maps.Map(e("#ai1ec_map_canvas").get(0),o),a=new google.maps.Marker({map:u,draggable:!0}),google.maps.event.addListener(a,"dragend",l),a.setPosition(s),c(),v(),e('a[href="#ai1ec-event-location-box"]').on("click",function(){window.setTimeout(function(){google.maps.event.trigger(u,"resize"),u.setCenter(a.getPosition())},150)}))})},p=function(t){u.setCenter(t.geometry.location),u.setZoom(15),a.setPosition(t.geometry.location),e("#ai1ec_address").val(t.formatted_address),e("#ai1ec_latitude").val(t.geometry.location.lat()),e("#ai1ec_longitude").val(t.geometry.location.lng()),e("#ai1ec_input_coordinates").is(":checked")||e("#ai1ec_input_coordinates").click();var n="",r="",i="",s=0,o=0,f="",l;for(var c=0;c<t.address_components.length;c++)switch(t.address_components[c].types[0]){case"street_number":n=t.address_components[c].long_name;break;case"route":r=t.address_components[c].long_name;break;case"locality":i=t.address_components[c].long_name;break;case"administrative_area_level_1":f=t.address_components[c].long_name;break;case"postal_code":s=t.address_components[c].long_name;break;case"country":l=t.address_components[c].short_name,o=t.address_components[c].long_name}var h=n.length>0?n+" ":"";h+=r.length>0?r:"",s=s!==0?s:"",e("#ai1ec_city").val(i),e("#ai1ec_province").val(f),e("#ai1ec_postal_code").val(s),e("#ai1ec_country").val(o),e("#ai1ec_country_short").val(l)},d=function(){var t=parseFloat(e("#ai1ec_latitude").val()),n=parseFloat(e("#ai1ec_longitude").val()),r=new google.maps.LatLng(t,n);u.setCenter(r),u.setZoom(15),a.setPosition(r)},v=function(){e("#ai1ec_input_coordinates:checked").length===0?(e("#ai1ec_table_coordinates").hide(),e("#ai1ec_address").change()):d()},m=function(){return a},g=function(){return f};return{init_gmaps:h,ai1ec_update_map_from_coordinates:d,get_marker:m,get_position:g}}),timely.define("scripts/add_new_event/event_location/input_coordinates_event_handlers",["jquery_timely","scripts/add_new_event/event_location/input_coordinates_utility_functions","scripts/add_new_event/event_location/gmaps_helper","ai1ec_config"],function(e,t,n,r){var i=function(t){this.checked?e(".ai1ec-map-preview").addClass("ai1ec-map-visible"):e(".ai1ec-map-preview").removeClass("ai1ec-map-visible")},s=function(t){this.checked?e("#ai1ec_table_coordinates").fadeIn("fast"):e("#ai1ec_table_coordinates").fadeOut("fast")},o=function(e){t.ai1ec_convert_commas_to_dots_for_coordinates();var r=t.ai1ec_check_lat_long_ok_for_search(e);r===!0&&n.ai1ec_update_map_from_coordinates()};return{toggle_visibility_of_google_map_on_click:i,toggle_visibility_of_coordinate_fields_on_click:s,update_map_from_coordinates_on_blur:o}}),timely.define("external_libs/jquery.calendrical_timespan",["jquery_timely"],function(e){function l(){var e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function c(e,t){return typeof e=="string"&&(e=new Date(e)),typeof t=="string"&&(t=new Date(t)),e.getUTCDate()===t.getUTCDate()&&e.getUTCMonth()===t.getUTCMonth()&&e.getUTCFullYear()===t.getUTCFullYear()?!0:!1}function h(e,t){if(e instanceof Date)return h(e.getUTCFullYear(),e.getUTCMonth());if(t==1){var n=e%4==0&&(e%100!=0||e%400==0);return n?29:28}return t==3||t==5||t==8||t==10?30:31}function p(e){return new Date(e.getTime()+864e5)}function d(e){return new Date(e.getTime()-864e5)}function v(e,t){return t==11?new Date(e+1,0,1):new Date(e,t+1,1)}function m(t,n,r,i){var s=i.monthNames.split(","),o=e("<thead />"),u=e("<tr />").appendTo(o);e("<th />").addClass("monthCell").append(e('<a href="javascript:;">&laquo;</a>').addClass("prevMonth").mousedown(function(e){g(t,r==0?n-1:n,r==0?11:r-1,i),e.preventDefault()})).appendTo(u),e("<th />").addClass("monthCell").attr("colSpan",5).append(e('<a href="javascript:;">'+s[r]+" "+n+"</a>").addClass("monthName")).appendTo(u),e("<th />").addClass("monthCell").append(e('<a href="javascript:;">&raquo;</a>').addClass("nextMonth").mousedown(function(){g(t,r==11?n+1:n,r==11?0:r+1,i)})).appendTo(u);var a=i.dayNames.split(","),f=parseInt(i.weekStartDay),l=[];for(var c=0,h=a.length;c<h;c++)l[c]=a[(c+f)%h];var p=e("<tr />").appendTo(o);return e.each(l,function(t,n){e("<td />").addClass("dayName").append(n).appendTo(p)}),o}function g(t,n,r,i){i=i||{};var s=parseInt(i.weekStartDay),o=i.today?i.today:l();o.setHours(0),o.setMinutes(0);var u=new Date(n,r,1),a=v(n,r),f=Math.abs(o.getTimezoneOffset());f!=0&&(o.setHours(o.getHours()+f/60),o.setMinutes(o.getMinutes()+f%60),u.setHours(u.getHours()+f/60),u.setMinutes(u.getMinutes()+f%60),a.setHours(a.getHours()+f/60),a.setMinutes(a.getMinutes()+f%60));var h=a.getUTCDay()-s;h<0?h=Math.abs(h)-1:h=6-h;for(var g=0;g<h;g++)a=p(a);var y=e("<table />");m(t,n,r,i).appendTo(y);var b=e("<tbody />").appendTo(y),w=e("<tr />"),E=u.getUTCDay()-s;E<0&&(E=7+E);for(var g=0;g<E;g++)u=d(u);while(u<=a){var S=e("<td />").addClass("day").append(e('<a href="javascript:;">'+u.getUTCDate()+"</a>").click(function(){var e=u;return function(){i&&i.selectDate&&i.selectDate(e)}}())).appendTo(w),x=c(u,o),T=i.selected&&c(i.selected,u);x&&S.addClass("today"),T&&S.addClass("selected"),x&&T&&S.addClass("today_selected"),u.getUTCMonth()!=r&&S.addClass("nonMonth");var N=u.getUTCDay();(N+1)%7==s&&(b.append(w),w=e("<tr />")),u=p(u)}w.children().length?b.append(w):w.remove(),t.empty().append(y)}function y(t,n){var r=n.selection&&f(n.selection);r&&(r.minute=Math.floor(r.minute/15)*15);var i=n.startTime&&n.startTime.hour*60+n.startTime.minute,s,o=e("<ul />");for(var a=0;a<24;a++)for(var l=0;l<60;l+=15){if(i&&i>a*60+l)continue;(function(){var t=u(a,l,n.isoTime),f=t;if(i!=null){var c=a*60+l-i;c<60?f+=" ("+c+" min)":c==60?f+=" (1 hr)":f+=" ("+Math.floor(c/60)+" hr "+c%60+" min)"}var h=e("<li />").append(e('<a href="javascript:;">'+f+"</a>").click(function(){n&&n.selectTime&&n.selectTime(t)}).mousemove(function(){e("li.selected",o).removeClass("selected")})).appendTo(o);!s&&a==n.defaultHour&&(s=h),r&&r.hour==a&&r.minute==l&&(h.addClass("selected"),s=h)})()}s&&setTimeout(function(){t[0].scrollTop=s[0].offsetTop-s.height()*2},0),t.empty().append(o)}function b(e){e.addClass("error").fadeOut("normal",function(){e.val(e.data("timespan.stored")).removeClass("error").fadeIn("fast")})}function w(){e(this).data("timespan.stored",this.value)}function E(t,n,r,i,a,f,l,c,h,p){r.val(r.data("timespan.initial_value")),f.val(f.data("timespan.initial_value")),l.get(0).checked=l.data("timespan.initial_value");var d=s(r,p,0,15);n.val(u(d.getUTCHours(),d.getUTCMinutes(),c)),t.val(o(d,h));var v=s(f,d.getTime(),1,15);a.val(u(v.getUTCHours(),v.getUTCMinutes(),c)),l.get(0).checked&&v.setUTCDate(v.getUTCDate()-1),i.val(o(v,h)),t.each(w),n.each(w),i.each(w),a.each(w),l.trigger("change.timespan"),e("#ai1ec_instant_event").trigger("change.timespan")}var t={us:{pattern:/([\d]{1,2})\/([\d]{1,2})\/([\d]{4}|[\d]{2})/,format:"m/d/y",order:"middleEndian",zeroPad:!1},iso:{pattern:/([\d]{4}|[\d]{2})-([\d]{1,2})-([\d]{1,2})/,format:"y-m-d",order:"bigEndian",zeroPad:!0},dot:{pattern:/([\d]{1,2}).([\d]{1,2}).([\d]{4}|[\d]{2})/,format:"d.m.y",order:"littleEndian",zeroPad:!1},def:{pattern:/([\d]{1,2})\/([\d]{1,2})\/([\d]{4}|[\d]{2})/,format:"d/m/y",order:"littleEndian",zeroPad:!1}},n=function(e){return e<10?"0"+e:e},r=function(e,t){typeof t=="undefined"&&(t=!1);var r=e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1)+"-"+n(e.getUTCDate());return t&&(r+="T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":00"),r},i=function(e,t){var n=e.val(),r=null;if(n.length<4)r=new Date(t);else{r=new Date(n);var i=n.split("T"),s=i[0].split("-"),o=i[1].split(":");r.setUTCFullYear(s[0],s[1]-1,s[2]),r.setUTCHours(o[0],o[1],o[2],0)}return r},s=function(e,t,n,r){return t+=n*36e5,t-=t%(r*6e4),i(e,t)},o=function(e,n,r){var i,s,o;typeof t[n]=="undefined"&&(n="def"),typeof r=="undefined"&&(r=!1),!0===r?(i=e.getFullYear().toString(),s=(e.getMonth()+1).toString(),o=e.getDate().toString()):(i=e.getUTCFullYear().toString(),s=(e.getUTCMonth()+1).toString(),o=e.getUTCDate().toString()),t[n].zeroPad&&(s.length==1&&(s="0"+s),o.length==1&&(o="0"+o));var u=t[n].format;return u=u.replace("d",o),u=u.replace("m",s),u=u.replace("y",i),u},u=function(e,t,n){var r=t;t<10&&(r="0"+t);if(n){var i=e;return i<10&&(i="0"+e),i+":"+r}var i=e%12;i==0&&(i=12);var s=e<12?"am":"pm";return i+":"+r+s},a=function(e,n){typeof t[n]=="undefined"&&(n="def");var r=e.match(t[n].pattern);if(!r||r.length!=4)return Date("invalid");switch(t[n].order){case"bigEndian":var i=r[3],s=r[2],o=r[1];break;case"littleEndian":var i=r[1],s=r[2],o=r[3];break;case"middleEndian":var i=r[2],s=r[1],o=r[3];break;default:var i=r[1],s=r[2],o=r[3]}return o.length==2&&(o=(new Date).getUTCFullYear().toString().substr(0,2)+o),new Date(s+"/"+i+"/"+o+" GMT")},f=function(e){var t=t=/(\d+)\s*[:\-\.,]\s*(\d+)\s*(am|pm)?/i.exec(e);if(t&&t.length>=3){var n=Number(t[1]),r=Number(t[2]);return n==12&&t[3]&&(n-=12),t[3]&&t[3].toLowerCase()=="pm"&&(n+=12),{hour:n,minute:r}}return null};e.fn.calendricalDate=function(t){return t=t||{},t.padding=t.padding||4,t.monthNames=t.monthNames||"January,February,March,April,May,June,July,August,September,October,November,December",t.dayNames=t.dayNames||"S,M,T,W,T,F,S",t.weekStartDay=t.weekStartDay||0,this.each(function(){var n=e(this),r,i=!1;n.bind("focus",function(){if(r)return;var s=n.position(),u=n.css("padding-left");r=e("<div />").addClass("calendricalDatePopup").mouseenter(function(){i=!0}).mouseleave(function(){i=!1}).mousedown(function(e){e.preventDefault()}).css({position:"absolute",left:s.left,top:s.top+n.height()+t.padding*2}),n.after(r);var f=a(n.val(),t.dateFormat);f.getUTCFullYear()||(f=t.today?t.today:l()),g(r,f.getUTCFullYear(),f.getUTCMonth(),{today:t.today,selected:f,monthNames:t.monthNames,dayNames:t.dayNames,weekStartDay:t.weekStartDay,selectDate:function(e){i=!1,n.val(o(e,t.dateFormat)),r.remove(),r=null;if(t.endDate){var s=a(t.endDate.val(),t.dateFormat);s>=f&&t.endDate.val(o(new Date(e.getTime()+s.getTime()-f.getTime()),t.dateFormat))}}})}).blur(function(){if(i){r&&n.focus();return}if(!r)return;r.remove(),r=null})})},e.fn.calendricalDateRange=function(t){return this.length>=2&&(e(this[0]).calendricalDate(e.extend({endDate:e(this[1])},t)),e(this[1]).calendricalDate(t)),this},e.fn.calendricalDateRangeSingle=function(t){return this.length==1&&e(this).calendricalDate(t),this},e.fn.calendricalTime=function(t){return t=t||{},t.padding=t.padding||4,this.each(function(){var n=e(this),r,i=!1;n.bind("focus click",function(){if(r)return;var s=t.startTime;s&&t.startDate&&t.endDate&&!c(a(t.startDate.val()),a(t.endDate.val()))&&(s=!1);var o=n.position();r=e("<div />").addClass("calendricalTimePopup").mouseenter(function(){i=!0}).mouseleave(function(){i=!1}).mousedown(function(e){e.preventDefault()}).css({position:"absolute",left:o.left,top:o.top+n.height()+t.padding*2}),s&&r.addClass("calendricalEndTimePopup"),n.after(r);var u={selection:n.val(),selectTime:function(e){i=!1,n.val(e),r.remove(),r=null},isoTime:t.isoTime||!1,defaultHour:t.defaultHour!=null?t.defaultHour:8};s&&(u.startTime=f(t.startTime.val())),y(r,u)}).blur(function(){if(i){r&&n.focus();return}if(!r)return;r.remove(),r=null})})},e.fn.calendricalTimeRange=function(t){return this.length>=2&&(e(this[0]).calendricalTime(t),e(this[1]).calendricalTime(e.extend({startTime:e(this[0])},t))),this},e.fn.calendricalDateTimeRange=function(t){return this.length>=4&&(e(this[0]).calendricalDate(e.extend({endDate:e(this[2])},t)),e(this[1]).calendricalTime(t),e(this[2]).calendricalDate(t),e(this[3]).calendricalTime(e.extend({startTime:e(this[1]),startDate:e(this[0]),endDate:e(this[2])},t))),this};var S={allday:"#allday",start_date_input:"#start-date-input",start_time_input:"#start-time-input",start_time:"#start-time",end_date_input:"#end-date-input",end_time_input:"#end-time-input",end_time:"#end-time",twentyfour_hour:!1,date_format:"def",now:new Date},x={init:function(t){function C(){var e=a(s.val(),n.date_format).getTime()/1e3,t=f(l.val());e+=t.hour*3600+t.minute*60;var r=a(h.val(),n.date_format).getTime()/1e3,i=f(p.val());return r+=i.hour*3600+i.minute*60,r-e}function k(){var e=a(s.data("timespan.stored"),n.date_format),t=f(l.data("timespan.stored")),r=e.getTime()/1e3+t.hour*3600+t.minute*60+s.data("time_diff");return r=new Date(r*1e3),h.val(o(r,n.date_format)),p.val(u(r.getUTCHours(),r.getUTCMinutes(),n.twentyfour_hour)),!0}var n=e.extend({},S,t),i=e(n.allday),s=e(n.start_date_input),l=e(n.start_time_input),c=e(n.start_time),h=e(n.end_date_input),p=e(n.end_time_input),d=e(n.end_time),v=e("#ai1ec_instant_event"),m=h.add(p),g=s.add(n.end_date_input),y=l.add(n.end_time_input),x=s.add(n.start_time_input).add(n.end_date_input).add(n.end_time_input);x.bind("focus.timespan",w),v.bind("change.timespan",function(){this.checked?(m.closest("tr").fadeOut(),i.attr("disabled",!0)):(i.removeAttr("disabled"),m.closest("tr").fadeIn())});var T=new Date(n.now.getFullYear(),n.now.getMonth(),n.now.getDate()),N=!1;return i.bind("change.timespan",function(){this.checked?(y.fadeOut(),v.attr("disabled",!0)):(v.removeAttr("disabled"),y.fadeIn()),N||(N=!0,x.calendricalDateTimeRange({today:T,dateFormat:n.date_format,isoTime:n.twentyfour_hour,monthNames:n.month_names,dayNames:n.day_names,weekStartDay:n.week_start_day}))}).get().checked=!1,g.bind("blur.timespan",function(){var t=a(this.value,n.date_format);isNaN(t)?b(e(this)):(e(this).data("timespan.stored",this.value),e(this).val(o(t,n.date_format)))}),y.bind("blur.timespan",function(){var t=f(this.value);t?(e(this).data("timespan.stored",this.value),e(this).val(u(t.hour,t.minute,n.twentyfour_hour))):b(e(this))}),s.add(n.start_time_input).bind("focus.timespan",function(){s.data("time_diff",C())}).bind("blur.timespan",function(){s.data("time_diff")<0&&s.data("time_diff",900);var e=k()}),h.add(n.start_time_input).bind("blur.timespan",function(){if(C()<0){s.data("time_diff",900);var e=k()}}),s.closest("form").bind("submit.timespan",function(){var e=a(s.val(),n.date_format).getTime()/1e3;if(!isNaN(e)){if(!i.get(0).checked){var t=f(l.val());t?e+=t.hour*3600+t.minute*60:e=""}}else e="";e>0&&c.val(r(new Date(e*1e3),!0));var o=a(h.val(),n.date_format).getTime()/1e3;if(!isNaN(o))if(i.get(0).checked)o+=86400;else{var t=f(p.val());t?o+=t.hour*3600+t.minute*60:o=""}else o="";o>0&&d.val(r(new Date(o*1e3),!0))}),c.data("timespan.initial_value",c.val()),d.data("timespan.initial_value",d.val()),i.data("timespan.initial_value",i.get(0).checked),E(s,l,c,h,p,d,i,n.twentyfour_hour,n.date_format,n.now),this},reset:function(t){var n=e.extend({},S,t);return E(e(n.start_date_input),e(n.start_time_input),e(n.start_time),e(n.end_date_input),e(n.end_time_input),e(n.end_time),e(n.allday),n.twentyfour_hour,n.date_format,n.now),this},destroy:function(t){return t=e.extend({},S,t),e.each(t,function(t,n){e(n).unbind(".timespan")}),e(t.start_date_input).closest("form").unbind(".timespan"),this}};return e.timespan=function(t){if(x[t])return x[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return x.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.timespan")},{formatDate:o,parseDate:a}}),timely.define("scripts/add_new_event/event_date_time/date_time_utility_functions",["jquery_timely","ai1ec_config","libs/utils","external_libs/jquery.calendrical_timespan"],function(e,t,n,r){var i=n.get_ajax_url(),s=function(t,n,r,i,s,o){e(t).val(i),e("#ai1ec_repeat_box").modal("hide");var u=e.trim(e(n).text());u.lastIndexOf(":")===-1&&(u=u.substring(0,u.length-3),e(n).text(u+":")),e(s).attr("disabled",!1),e(r).fadeOut("fast",function(){e(this).text(o.message),e(this).fadeIn("fast")})},o=function(t,n,r,i){e("#ai1ec_repeat_box .ai1ec-alert-danger").text(r.message).removeClass("ai1ec-hide"),e(i).attr("disabled",!1),e(t).val("");var s=e.trim(e(n).text());s.lastIndexOf("...")===-1&&(s=s.substring(0,s.length-1),e(n).text(s+"...")),e(this).closest("tr").find(".ai1ec_rule_text").text()===""&&e(t).siblings("input:checkbox").removeAttr("checked")},u=function(t,n,r,i,s){e(document).on("click",t,function(){if(!e(n).is(":checked")){e(n).attr("checked",!0);var t=e.trim(e(r).text());t=t.substring(0,t.length-3),e(r).text(t+":")}return c(i,s),!1})},a=function(t,n,r,i,s){e(t).click(function(){if(e(this).is(":checked"))this.id==="ai1ec_repeat"&&e("#ai1ec_exclude").removeAttr("disabled"),c(i,s);else{this.id==="ai1ec_repeat"&&(e("#ai1ec_exclude").removeAttr("checked").attr("disabled",!0),e("#ai1ec_exclude_text > a").text("")),e(n).text("");var t=e.trim(e(r).text());t=t.substring(0,t.length-1),e(r).text(t+"...")}})},f=function(t,n,r){if(e.trim(e(t).text())===""){e(n).removeAttr("checked"),e("#ai1ec_repeat").is(":checked")||e("#ai1ec_exclude").attr("disabled",!0);var i=e.trim(e(r).text());i.lastIndexOf("...")===-1&&(i=i.substring(0,i.length-1),e(r).text(i+"..."))}},l=function(){e("#ai1ec_count, #ai1ec_daily_count, #ai1ec_weekly_count, #ai1ec_monthly_count, #ai1ec_yearly_count").rangeinput({css:{input:"ai1ec-range",slider:"ai1ec-slider",progress:"ai1ec-progress",handle:"ai1ec-handle"}});var n=e("#ai1ec_recurrence_calendar");n.datepicker({multidate:!0,weekStart:t.week_start_day}),n.on("changeDate",function(n){var i=[],s=[];for(var o=0;o<n.dates.length;o++){var u=new Date(n.dates[o]),a=""+u.getFullYear()+("0"+(u.getMonth()+1)).slice(-2)+("0"+u.getDate()).slice(-2)+"T000000Z",f='<span class="ai1ec-label ai1ec-label-default">'+r.formatDate(u,t.date_format,!0)+"</span>";i.push(a),s.push(f)}e("#ai1ec_rec_dates_list").html(s.join(" ")),e("#ai1ec_rec_custom_dates").val(i.join(","))});var i={start_date_input:"#ai1ec_until-date-input",start_time:"#ai1ec_until-time",date_format:t.date_format,month_names:t.month_names,day_names:t.day_names,week_start_day:t.week_start_day,twentyfour_hour:t.twentyfour_hour,now:new Date(t.now*1e3)};e.inputdate(i),e(document).trigger("ai1ec.recurrence-modal.inited")},c=function(t,n){var r=e("#ai1ec_repeat_box"),s=e(".ai1ec-loading",r);r.modal({backdrop:"static"}),e.post(i,t,function(e){e.error?(window.alert(e.message),r.modal("hide")):(s.addClass("ai1ec-hide").after(e.message),typeof n=="function"&&n())},"json")};return{show_repeat_tabs:c,init_modal_widgets:l,click_on_modal_cancel:f,click_on_checkbox:a,click_on_ics_rule_text:u,repeat_form_error:o,repeat_form_success:s}}),timely.define("external_libs/bootstrap/button",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r)};t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.is("input")?"val":"html",i=n.data();e+="Text",i.resetText||n.data("resetText",n[r]()),n[r](i[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass("ai1ec-"+t).attr(t,t):n.removeClass("ai1ec-"+t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="ai1ec-buttons"]'),t=!0;if(e.length){var n=this.$element.find("input");n.prop("type")==="radio"&&(n.prop("checked")&&this.$element.hasClass("ai1ec-active")?t=!1:e.find(".ai1ec-active").removeClass("ai1ec-active")),t&&n.prop("checked",!this.$element.hasClass("ai1ec-active")).trigger("change")}t&&this.$element.toggleClass("ai1ec-active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("bs.button"),s=typeof n=="object"&&n;i||r.data("bs.button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api","[data-toggle^=ai1ec-button]",function(t){var n=e(t.target);n.hasClass("ai1ec-btn")||(n=n.closest(".ai1ec-btn")),n.button("toggle"),t.preventDefault()})}),timely.define("scripts/add_new_event/event_date_time/date_time_event_handlers",["jquery_timely","ai1ec_config","scripts/add_new_event/event_date_time/date_time_utility_functions","external_libs/jquery.calendrical_timespan","libs/utils","external_libs/bootstrap/button"],function(e,t,n,r,i){var s=i.get_ajax_url(),o=function(){var t=e("#ai1ec_end option:selected").val();switch(t){case"0":e("#ai1ec_until_holder, #ai1ec_count_holder").collapse("hide");break;case"1":e("#ai1ec_until_holder").collapse("hide"),e("#ai1ec_count_holder").collapse("show");break;case"2":e("#ai1ec_count_holder").collapse("hide"),e("#ai1ec_until_holder").collapse("show")}},u=function(){e("#publish").trigger("click")},a=function(){var i=e(this),o="",u=e("#ai1ec_repeat_box .ai1ec-tab-pane.ai1ec-active"),a=u.data("freq"),f=!0;switch(a){case"daily":o+="FREQ=DAILY;";var l=e("#ai1ec_daily_count").val();l>1&&(o+="INTERVAL="+l+";");break;case"weekly":o+="FREQ=WEEKLY;";var c=e("#ai1ec_weekly_count").val();c>1&&(o+="INTERVAL="+c+";");var h=e('input[name="ai1ec_weekly_date_select"]:first').val(),p=e('#ai1ec_weekly_date_select > div:first > input[type="hidden"]:first').val();h.length>0&&(o+="WKST="+p+";BYday="+h+";");break;case"monthly":o+="FREQ=MONTHLY;";var d=e("#ai1ec_monthly_count").val(),v=e('input[name="ai1ec_monthly_type"]:checked').val();d>1&&(o+="INTERVAL="+d+";");var m=e('input[name="ai1ec_montly_date_select"]:first').val();if(m.length>0&&v==="bymonthday")o+="BYMONTHDAY="+m+";";else if(v==="byday"){var g=e("#ai1ec_monthly_byday_num").val(),y=e("#ai1ec_monthly_byday_weekday").val();o+="BYday="+g+y+";"}break;case"yearly":o+="FREQ=YEARLY;";var b=e("#ai1ec_yearly_count").val();b>1&&(o+="INTERVAL="+b+";");var w=e('input[name="ai1ec_yearly_date_select"]:first').val();w.length>0&&(o+="BYMONTH="+w+";");break;case"custom":"1"===e("#ai1ec_is_box_repeat").val()?o+="RDATE=":o+="EXDATE=",o+=e("#ai1ec_rec_custom_dates").val(),f=!1}var E=e("#ai1ec_end").val();if("1"===E&&f)o+="COUNT="+e("#ai1ec_count").val()+";";else if("2"===E&&f){var S=e("#ai1ec_until-date-input").val();S=r.parseDate(S,t.date_format);var x=e("#ai1ec_start-time").val();x=r.parseDate(x,t.date_format),x=new Date(x);var T=S.getUTCDate(),N=S.getUTCMonth()+1,C=x.getUTCHours(),k=x.getUTCMinutes();N=N<10?"0"+N:N,T=T<10?"0"+T:T,C=C<10?"0"+C:C,k=k<10?"0"+k:k,S=S.getUTCFullYear()+""+N+T+"T235959Z",o+="UNTIL="+S+";"}var L={action:"ai1ec_rrule_to_text",rrule:o};i.button("loading").next().addClass("ai1ec-disabled"),e.post(s,L,function(t){t.error?(i.button("reset").next().removeClass("ai1ec-disabled"),"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_error("#ai1ec_rrule","#ai1ec_repeat_label",t,i):n.repeat_form_error("#ai1ec_exrule","#ai1ec_exclude_label",t,i)):"1"===e("#ai1ec_is_box_repeat").val()?n.repeat_form_success("#ai1ec_rrule","#ai1ec_repeat_label","#ai1ec_repeat_text > a",o,i,t):n.repeat_form_success("#ai1ec_exrule","#ai1ec_exclude_label","#ai1ec_exclude_text > a",o,i,t)},"json")},f=function(){return e("#ai1ec_is_box_repeat").val()==="1"?n.click_on_modal_cancel("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label"):n.click_on_modal_cancel("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label"),e("#ai1ec_repeat_box").modal("hide"),!1},l=function(){e(this).is("#ai1ec_monthly_type_bymonthday")?(e("#ai1ec_repeat_monthly_byday").collapse("hide"),e("#ai1ec_repeat_monthly_bymonthday").collapse("show")):(e("#ai1ec_repeat_monthly_bymonthday").collapse("hide"),e("#ai1ec_repeat_monthly_byday").collapse("show"))},c=function(){var t=e(this),n=[],r=t.closest(".ai1ec-btn-group-grid"),i;t.toggleClass("ai1ec-active"),e("a",r).each(function(){var t=e(this);t.is(".ai1ec-active")&&(i=t.next().val(),n.push(i))}),r.next().val(n.join())},h=function(){n.click_on_ics_rule_text("#ai1ec_repeat_text > a","#ai1ec_repeat","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_ics_rule_text("#ai1ec_exclude_text > a","#ai1ec_exclude","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_repeat","#ai1ec_repeat_text > a","#ai1ec_repeat_label",{action:"ai1ec_get_repeat_box",repeat:1,post_id:e("#post_ID").val()},n.init_modal_widgets),n.click_on_checkbox("#ai1ec_exclude","#ai1ec_exclude_text > a","#ai1ec_exclude_label",{action:"ai1ec_get_repeat_box",repeat:0,post_id:e("#post_ID").val()},n.init_modal_widgets)},p=function(t){return e("#ai1ec_widget_calendar").toggle(),!1},d=function(){e(".ai1ec-modal-content",this).not(".ai1ec-loading ").remove().end().removeClass("ai1ec-hide")},v=function(){var t=e("#ai1ec_repeat_box").find("ul.ai1ec-nav").find("li.ai1ec-active"),n=e("#ai1ec_repeat_box").find(".ai1ec-end-field");t.hasClass("ai1ec-freq-custom")?n.addClass("ai1ec-hidden"):n.removeClass("ai1ec-hidden"),t.hasClass("ai1ec-freq-monthly")&&l()},m=function(){var t=e("#ai1ec-tab-content").data("activeFreq"),n=e("#ai1ec_recurrence_calendar");e(".ai1ec-freq").removeClass("ai1ec-active"),e(".ai1ec-freq-"+t).addClass("ai1ec-active"),e(document).on("shown.bs.tab",v),o(),v()};return e(document).on("ai1ec.recurrence-modal.inited",m),{show_end_fields:o,trigger_publish:u,handle_click_on_apply_button:a,handle_click_on_cancel_modal:f,handle_checkbox_monthly_tab_modal:l,execute_pseudo_handlers:h,handle_animation_of_calendar_widget:p,handle_click_on_toggle_buttons:c,handle_modal_hide:d}}),timely.define("scripts/add_new_event/event_cost_helper",["jquery_timely","ai1ec_config"],function(e,t){var n=function(){return e("#ai1ec_is_free").is(":checked")},r=function(){return e("#ai1ec_cost").val()!==""},i=function(r){var i=e(this).parents("table:eq(0)"),s=e("#ai1ec_cost",i),o=t.label_a_buy_tickets_url;n()?(s.attr("value","").addClass("ai1ec-hidden"),o=t.label_a_rsvp_url):s.removeClass("ai1ec-hidden"),e("label[for=ai1ec_ticket_url]",i).text(o)};return{handle_change_is_free:i,check_is_free:n,check_is_price_entered:r}}),timely.define("external_libs/jquery.inputdate",["jquery_timely","external_libs/jquery.calendrical_timespan"],function(e,t){function n(e){e.addClass("error").fadeOut("normal",function(){e.val(e.data("timespan.stored")).removeClass("error").fadeIn("fast")})}function r(){e(this).data("timespan.stored",this.value)}function i(e,n,i,s,o){n.val(n.data("timespan.initial_value"));var u=parseInt(n.val());isNaN(parseInt(u))?u=new Date(o):u=new Date(parseInt(u)*1e3),e.val(t.formatDate(u,s)),e.each(r)}var s={start_date_input:"date-input",start_time:"time",twentyfour_hour:!1,date_format:"def",now:new Date},o={init:function(o){var u=e.extend({},s,o),a=e(u.start_date_input),f=e(u.start_time),l=a,c=a;return c.bind("focus.timespan",r),l.calendricalDate({today:new Date(u.now.getFullYear(),u.now.getMonth(),u.now.getDate()),dateFormat:u.date_format,monthNames:u.month_names,dayNames:u.day_names,weekStartDay:u.week_start_day}),l.bind("blur.timespan",function(){var r=t.parseDate(this.value,u.date_format);isNaN(r)?n(e(this)):(e(this).data("timespan.stored",this.value),e(this).val(t.formatDate(r,u.date_format)))}),a.bind("focus.timespan",function(){var e=t.parseDate(a.val(),u.date_format).getTime()/1e3}).bind("blur.timespan",function(){var e=t.parseDate(a.data("timespan.stored"),u.date_format)}),a.closest("form").bind("submit.timespan",function(){var e=t.parseDate(a.val(),u.date_format).getTime()/1e3;isNaN(e)&&(e=""),f.val(e)}),f.data("timespan.initial_value",f.val()),i(a,f,u.twentyfour_hour,u.date_format,u.now),this},reset:function(t){var n=e.extend({},s,t);return i(e(n.start_date_input),e(n.start_time),n.twentyfour_hour,n.date_format,n.now),this},destroy:function(t){return t=e.extend({},s,t),e.each(t,function(t,n){e(n).unbind(".timespan")}),e(t.start_date_input).closest("form").unbind(".timespan"),this}};e.inputdate=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.timespan")}}),timely.define("external_libs/jquery.tools",["jquery_timely"],function(e){function i(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}function s(e,t){var n=parseInt(e.css(t),10);if(n)return n;var r=e[0].currentStyle;return r&&r.width&&parseInt(r.width,10)}function o(e){var t=e.data("events");return t&&t.onSlide}function u(t,n){function x(e,s,o,u){o===undefined?o=s/h*m:u&&(o-=n.min),g&&(o=Math.round(o/g)*g);if(s===undefined||g)s=o*h/m;if(isNaN(o))return r;s=Math.max(0,Math.min(s,h)),o=s/h*m;if(u||!f)o+=n.min;f&&(u?s=h-s:o=n.max-o),o=i(o,y);var a=e.type=="click";if(S&&l!==undefined&&!a){e.type="onSlide",E.trigger(e,[o,s]);if(e.isDefaultPrevented())return r}var c=a?n.speed:0,b=a?function(){e.type="change",E.trigger(e,[o])}:null;return f?(d.animate({top:s},c,b),n.progress&&v.animate({height:h-s+d.height()/2},c)):(d.animate({left:s},c,b),n.progress&&v.animate({width:s+d.width()/2},c)),l=o,p=s,t.val(o),r}function T(){f=n.vertical||s(a,"height")>s(a,"width"),f?(h=s(a,"height")-s(d,"height"),c=a.offset().top+h):(h=s(a,"width")-s(d,"width"),c=a.offset().left)}function N(){T(),r.setValue(n.value!==undefined?n.value:n.min)}var r=this,u=n.css,a=e("<div><div/><a href='#'/></div>").data("rangeinput",r),f,l,c,h,p;t.before(a);var d=a.addClass(u.slider).find("a").addClass(u.handle),v=a.find("div").addClass(u.progress);e.each("min,max,step,value".split(","),function(e,r){var i=t.attr(r);parseFloat(i)&&(n[r]=parseFloat(i,10))});var m=n.max-n.min,g=n.step=="any"?0:n.step,y=n.precision;y===undefined&&(y=g.toString().split("."),y=y.length===2?y[1].length:0);if(t.attr("type")=="range"){var b=t.clone().wrap("<div/>").parent().html(),w=e(b.replace(/type/i,"type=text data-orig-type"));w.val(n.value),t.replaceWith(w),t=w}t.addClass(u.input);var E=e(r).add(t),S=!0;e.extend(r,{getValue:function(){return l},setValue:function(t,n){return T(),x(n||e.Event("api"),undefined,t,!0)},getConf:function(){return n},getProgress:function(){return v},getHandle:function(){return d},getInput:function(){return t},step:function(t,i){i=i||e.Event();var s=n.step=="any"?1:n.step;r.setValue(l+s*(t||1),i)},stepUp:function(e){return r.step(e||1)},stepDown:function(e){return r.step(-e||-1)}}),e.each("onSlide,change".split(","),function(t,i){e.isFunction(n[i])&&e(r).on(i,n[i]),r[i]=function(t){return t&&e(r).on(i,t),r}}),d.drag({drag:!1}).on("dragStart",function(){T(),S=o(e(r))||o(t)}).on("drag",function(e,n,r){if(t.is(":disabled"))return!1;x(e,f?n:r)}).on("dragEnd",function(e){e.isDefaultPrevented()||(e.type="change",E.trigger(e,[l]))}).click(function(e){return e.preventDefault()}),a.click(function(e){if(t.is(":disabled")||e.target==d[0])return e.preventDefault();T();var n=f?d.height()/2:d.width()/2;x(e,f?h-c-n+e.pageY:e.pageX-c-n)}),n.keyboard&&t.keydown(function(n){if(t.attr("readonly"))return;var i=n.keyCode,s=e([75,76,38,33,39]).index(i)!=-1,o=e([74,72,40,34,37]).index(i)!=-1;if((s||o)&&!(n.shiftKey||n.altKey||n.ctrlKey))return s?r.step(i==33?10:1,n):o&&r.step(i==34?-10:-1,n),n.preventDefault()}),t.blur(function(t){var n=e(this).val();n!==l&&r.setValue(n,t)}),e.extend(t[0],{stepUp:r.stepUp,stepDown:r.stepDown}),N(),h||e(window).load(N)}e.tools=e.tools||{version:"1.2.7"};var t;t=e.tools.rangeinput={conf:{min:0,max:100,step:"any",steps:0,value:0,precision:undefined,vertical:0,keyboard:!0,progress:!1,speed:100,css:{input:"range",slider:"slider",progress:"progress",handle:"handle"}}};var n,r;e.fn.drag=function(t){return document.ondragstart=function(){return!1},t=e.extend({x:!0,y:!0,drag:!0},t),n=n||e(document).on("mousedown mouseup",function(i){var s=e(i.target);if(i.type=="mousedown"&&s.data("drag")){var o=s.position(),u=i.pageX-o.left,a=i.pageY-o.top,f=!0;n.on("mousemove.drag",function(e){var n=e.pageX-u,i=e.pageY-a,o={};t.x&&(o.left=n),t.y&&(o.top=i),f&&(s.trigger("dragStart"),f=!1),t.drag&&s.css(o),s.trigger("drag",[i,n]),r=s}),i.preventDefault()}else try{r&&r.trigger("dragEnd")}finally{n.off("mousemove.drag"),r=null}}),this.data("drag",!0)},e.expr[":"].range=function(t){var n=t.getAttribute("type");return n&&n=="range"||!!e(t).filter("input").data("rangeinput")},e.fn.rangeinput=function(n){if(this.data("rangeinput"))return this;n=e.extend(!0,{},t.conf,n);var r;return this.each(function(){var t=new u(e(this),e.extend(!0,{},n)),i=t.getInput().data("rangeinput",t);r=r?r.add(i):i}),r?r:this}}),timely.define("external_libs/locales/bootstrap-datepicker.bg",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.bg={days:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота","Неделя"],daysShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб","Нед"],daysMin:["Н","П","В","С","Ч","П","С","Н"],months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Ян","Фев","Мар","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Ное","Дек"],today:"днес"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.br",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.br={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.cs",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.cs={days:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota","Neděle"],daysShort:["Ned","Pon","Úte","Stř","Čtv","Pát","Sob","Ned"],daysMin:["Ne","Po","Út","St","Čt","Pá","So","Ne"],months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],monthsShort:["Led","Úno","Bře","Dub","Kvě","Čer","Čnc","Srp","Zář","Říj","Lis","Pro"],today:"Dnes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.da",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.da={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",clear:"Nulstil"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.de",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam","Son"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa","So"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.es",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa","Do"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fi",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai","sunnuntai"],daysShort:["sun","maa","tii","kes","tor","per","lau","sun"],daysMin:["su","ma","ti","ke","to","pe","la","su"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mar","jou"],today:"tänään",weekStart:1,format:"d.m.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fr={days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],daysMin:["D","L","Ma","Me","J","V","S","D"],months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aou","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.id",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","Minggu"],daysShort:["Mgu","Sen","Sel","Rab","Kam","Jum","Sab","Mgu"],daysMin:["Mg","Sn","Sl","Ra","Ka","Ju","Sa","Mg"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],today:"Hari Ini",clear:"Kosongkan"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.is",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.is={days:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur","Sunnudagur"],daysShort:["Sun","Mán","Þri","Mið","Fim","Fös","Lau","Sun"],daysMin:["Su","Má","Þr","Mi","Fi","Fö","La","Su"],months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],today:"Í Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.it",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa","Do"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ja",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ja={days:["日曜","月曜","火曜","水曜","木曜","金曜","土曜","日曜"],daysShort:["日","月","火","水","木","金","土","日"],daysMin:["日","月","火","水","木","金","土","日"],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",format:"yyyy/mm/dd"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.kr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.kr={days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일","일요일"],daysShort:["일","월","화","수","목","금","토","일"],daysMin:["일","월","화","수","목","금","토","일"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis","Sekmadienis"],daysShort:["S","Pr","A","T","K","Pn","Š","S"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","Št","Sk"],months:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"Šiandien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lv={days:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena","Svētdiena"],daysShort:["Sv","P","O","T","C","Pk","S","Sv"],daysMin:["Sv","Pr","Ot","Tr","Ce","Pk","Se","Sv"],months:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],today:"Šodien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ms",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ms={days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu","Ahad"],daysShort:["Aha","Isn","Sel","Rab","Kha","Jum","Sab","Aha"],daysMin:["Ah","Is","Se","Ra","Kh","Ju","Sa","Ah"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],today:"Hari Ini"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nb",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nb={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nl={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pl={days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"],daysShort:["Nie","Pn","Wt","Śr","Czw","Pt","So","Nie"],daysMin:["N","Pn","Wt","Śr","Cz","Pt","So","N"],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],today:"Dzisiaj",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt-BR",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pt={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ru",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ru={days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Воскресенье"],daysShort:["Вск","Пнд","Втр","Срд","Чтв","Птн","Суб","Вск"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб","Вс"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sl={days:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota","Nedelja"],daysShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob","Ned"],daysMin:["Ne","Po","To","Sr","Če","Pe","So","Ne"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sv={days:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],daysShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör","Sön"],daysMin:["Sö","Må","Ti","On","To","Fr","Lö","Sö"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",format:"yyyy-mm-dd",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.th",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.th={days:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"],daysShort:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],daysMin:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],today:"วันนี้"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.tr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.tr={days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi","Pazar"],daysShort:["Pz","Pzt","Sal","Çrş","Prş","Cu","Cts","Pz"],daysMin:["Pz","Pzt","Sa","Çr","Pr","Cu","Ct","Pz"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],today:"Bugün",format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-CN",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-TW",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-TW"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["週日","週一","週二","週三","週四","週五","週六","週日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/bootstrap_datepicker",["jquery_timely","ai1ec_config","external_libs/locales/bootstrap-datepicker.bg","external_libs/locales/bootstrap-datepicker.br","external_libs/locales/bootstrap-datepicker.cs","external_libs/locales/bootstrap-datepicker.da","external_libs/locales/bootstrap-datepicker.de","external_libs/locales/bootstrap-datepicker.es","external_libs/locales/bootstrap-datepicker.fi","external_libs/locales/bootstrap-datepicker.fr","external_libs/locales/bootstrap-datepicker.id","external_libs/locales/bootstrap-datepicker.is","external_libs/locales/bootstrap-datepicker.it","external_libs/locales/bootstrap-datepicker.ja","external_libs/locales/bootstrap-datepicker.kr","external_libs/locales/bootstrap-datepicker.lt","external_libs/locales/bootstrap-datepicker.lv","external_libs/locales/bootstrap-datepicker.ms","external_libs/locales/bootstrap-datepicker.nb","external_libs/locales/bootstrap-datepicker.nl","external_libs/locales/bootstrap-datepicker.pl","external_libs/locales/bootstrap-datepicker.pt-BR","external_libs/locales/bootstrap-datepicker.pt","external_libs/locales/bootstrap-datepicker.ru","external_libs/locales/bootstrap-datepicker.sl","external_libs/locales/bootstrap-datepicker.sv","external_libs/locales/bootstrap-datepicker.th","external_libs/locales/bootstrap-datepicker.tr","external_libs/locales/bootstrap-datepicker.zh-CN","external_libs/locales/bootstrap-datepicker.zh-TW"],function(e,t){function r(){return new Date(Date.UTC.apply(Date,arguments))}function i(){var e=new Date;return r(e.getFullYear(),e.getMonth(),e.getDate())}function s(e){return function(){return this[e].apply(this,arguments)}}function f(t,n){var r=e(t).data(),i={},s,o=new RegExp("^"+n.toLowerCase()+"([A-Z])"),n=new RegExp("^"+n.toLowerCase());for(var u in r)n.test(u)&&(s=u.replace(o,function(e,t){return t.toLowerCase()}),i[s]=r[u]);return i}function l(t){var n={};if(!d[t]){t=t.split("-")[0];if(!d[t])return}var r=d[t];return e.each(p,function(e,t){t in r&&(n[t]=r[t])}),n}var n=e(window),o=function(){var t={get:function(e){return this.slice(e)[0]},contains:function(e){var t=e&&e.valueOf();for(var n=0,r=this.length;n<r;n++)if(this[n].valueOf()===t)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(t){if(!t)return;e.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t)},clear:function(){this.splice(0)},copy:function(){var e=new o;return e.replace(this),e}};return function(){var n=[];return n.push.apply(n,arguments),e.extend(n,t),n}}(),u=function(t,n){this.dates=new o,this.viewDate=i(),this.focusDate=null,this._process_options(n),this.element=e(t),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".ai1ec-date")?this.element.find(".ai1ec-input-group, .ai1ec-input-group-addon, .ai1ec-btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&this.component.length===0&&(this.component=!1),this.picker=e(v.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("ai1ec-datepicker-inline").appendTo(this.element):this.picker.addClass("ai1ec-datepicker-dropdown ai1ec-dropdown-menu"),this.o.rtl&&this.picker.addClass("ai1ec-datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.ai1ec-today").attr("colspan",function(e,t){return parseInt(t)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};u.prototype={constructor:u,_process_options:function(n){this._o=e.extend({},this._o,n);var r=this.o=e.extend({},this._o),i=r.language;d[i]||(i=i.split("-")[0],d[i]||(i=t.language,d[i]||(i=h.language))),r.language=i;switch(r.startView){case 2:case"decade":r.startView=2;break;case 1:case"year":r.startView=1;break;default:r.startView=0}switch(r.minViewMode){case 1:case"months":r.minViewMode=1;break;case 2:case"years":r.minViewMode=2;break;default:r.minViewMode=0}r.startView=Math.max(r.startView,r.minViewMode),r.multidate!==!0&&(r.multidate=Number(r.multidate)||!1,r.multidate!==!1?r.multidate=Math.max(0,r.multidate):r.multidate=1),r.multidateSeparator=String(r.multidateSeparator),r.weekStart%=7,r.weekEnd=(r.weekStart+6)%7;var s=v.parseFormat(r.format);r.startDate!==-Infinity&&(r.startDate?r.startDate instanceof Date?r.startDate=this._local_to_utc(this._zero_time(r.startDate)):r.startDate=v.parseDate(r.startDate,s,r.language):r.startDate=-Infinity),r.endDate!==Infinity&&(r.endDate?r.endDate instanceof Date?r.endDate=this._local_to_utc(this._zero_time(r.endDate)):r.endDate=v.parseDate(r.endDate,s,r.language):r.endDate=Infinity),r.daysOfWeekDisabled=r.daysOfWeekDisabled||[],e.isArray(r.daysOfWeekDisabled)||(r.daysOfWeekDisabled=r.daysOfWeekDisabled.split(/[,\s]*/)),r.daysOfWeekDisabled=e.map(r.daysOfWeekDisabled,function(e){return parseInt(e,10)});var o=String(r.orientation).toLowerCase().split(/\s+/g),u=r.orientation.toLowerCase();o=e.grep(o,function(e){return/^auto|left|right|top|bottom$/.test(e)}),r.orientation={x:"auto",y:"auto"};if(!!u&&u!=="auto")if(o.length===1)switch(o[0]){case"top":case"bottom":r.orientation.y=o[0];break;case"left":case"right":r.orientation.x=o[0]}else u=e.grep(o,function(e){return/^left|right$/.test(e)}),r.orientation.x=u[0]||"auto",u=e.grep(o,function(e){return/^top|bottom$/.test(e)}),r.orientation.y=u[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(r=undefined,i=e[t][1]):e[t].length==3&&(r=e[t][1],i=e[t][2]),n.on(i,r)},_unapplyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(i=undefined,r=e[t][1]):e[t].length==3&&(i=e[t][1],r=e[t][2]),n.off(r,i)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,n){var r=n||this.dates.get(-1),i=this._utc_to_local(r);this.element.trigger({type:t,date:i,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){arguments.length===0?(e=this.dates.length-1,t=this.o.format):typeof e=="string"&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return v.formatDate(n,t,this.o.language)},this)})},show:function(e){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){if(this.isInline)return;if(!this.picker.is(":visible"))return;this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide")},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(e){return e&&new Date(e.getTime()+e.getTimezoneOffset()*6e4)},_local_to_utc:function(e){return e&&new Date(e.getTime()-e.getTimezoneOffset()*6e4)},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){this.update.apply(this,arguments),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){this.update.apply(this,e.map(arguments,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:s("setDates"),setUTCDate:s("setUTCDates"),setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e).change():this.component&&this.element.find("input").val(e).change()},getFormattedDate:function(t){t===undefined&&(t=this.o.format);var n=this.o.language;return e.map(this.dates,function(e){return v.formatDate(e,t,n)}).join(this.o.multidateSeparator)},setStartDate:function(e){this._process_options({startDate:e}),this.update(),this.updateNavArrows()},setEndDate:function(e){this._process_options({endDate:e}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this._process_options({daysOfWeekDisabled:e}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return;var t=this.picker.outerWidth(),r=this.picker.outerHeight(),i=10,s=n.width(),o=n.height(),u=n.scrollTop(),a=parseInt(this.element.parents().filter(function(){return e(this).css("z-index")!="auto"}).first().css("z-index"))+10,f=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),c=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),h=f.left,p=f.top;this.picker.removeClass("ai1ec-datepicker-orient-top ai1ec-datepicker-orient-bottom ai1ec-datepicker-orient-right ai1ec-datepicker-orient-left"),this.o.orientation.x!=="auto"?(this.picker.addClass("ai1ec-datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(h-=t-c)):(this.picker.addClass("ai1ec-datepicker-orient-left"),f.left<0?h-=f.left-i:f.left+t>s&&(h=s-t-i));var d=this.o.orientation.y,v,m;d==="auto"&&(v=-u+f.top-r,m=u+o-(f.top+l+r),Math.max(v,m)===m?d="top":d="bottom"),this.picker.addClass("ai1ec-datepicker-orient-"+d),d==="top"?p+=l:p-=r+parseInt(this.picker.css("padding-top")),this.picker.css({top:p,left:h,zIndex:a})},_allow_update:!0,update:function(){if(!this._allow_update)return;var t=this.dates.copy(),n=[],r=!1;arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),r=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),n&&this.o.multidate?n=n.split(this.o.multidateSeparator):n=[n],delete this.element.data().date),n=e.map(n,e.proxy(function(e){return v.parseDate(e,this.o.format,this.o.language)},this)),n=e.grep(n,e.proxy(function(e){return e<this.o.startDate||e>this.o.endDate||!e},this),!0),this.dates.replace(n),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),r?this.setValue():n.length&&String(t)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&t.length&&this._trigger("clearDate"),this.fill()},fillDow:function(){var e=this.o.weekStart,t="<tr>";if(this.o.calendarWeeks){var n='<th class="ai1ec-cw">&nbsp;</th>';t+=n,this.picker.find(".ai1ec-datepicker-days thead tr:first-child").prepend(n)}while(e<this.o.weekStart+7)t+='<th class="ai1ec-dow">'+d[this.o.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".ai1ec-datepicker-days thead").append(t)},fillMonths:function(){var e="",t=0;while(t<12)e+='<span class="ai1ec-month">'+d[this.o.language].monthsShort[t++]+"</span>";this.picker.find(".ai1ec-datepicker-months td").html(e)},setRange:function(t){!t||!t.length?delete this.range:this.range=e.map(t,function(e){return e.valueOf()}),this.fill()},getClassNames:function(t){var n=[],r=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),s=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()==r&&t.getUTCMonth()<i?n.push("ai1ec-old"):(t.getUTCFullYear()>r||t.getUTCFullYear()==r&&t.getUTCMonth()>i)&&n.push("ai1ec-new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&n.push("ai1ec-focused"),this.o.todayHighlight&&t.getUTCFullYear()==s.getFullYear()&&t.getUTCMonth()==s.getMonth()&&t.getUTCDate()==s.getDate()&&n.push("ai1ec-today"),this.dates.contains(t)!==-1&&n.push("ai1ec-active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&n.push("ai1ec-disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&n.push("ai1ec-range"),e.inArray(t.valueOf(),this.range)!=-1&&n.push("ai1ec-selected")),n},fill:function(){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth(),s=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,o=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,u=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,a=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,f,l;this.picker.find(".ai1ec-datepicker-days thead th.ai1ec-datepicker-switch").text(d[this.o.language].months[i]+" "+n),this.picker.find("tfoot th.ai1ec-today").text(d[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.ai1ec-clear").text(d[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var c=r(n,i-1,28),h=v.getDaysInMonth(c.getUTCFullYear(),c.getUTCMonth());c.setUTCDate(h),c.setUTCDate(h-(c.getUTCDay()-this.o.weekStart+7)%7);var p=new Date(c);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();var m=[],g;while(c.valueOf()<p){if(c.getUTCDay()==this.o.weekStart){m.push("<tr>");if(this.o.calendarWeeks){var y=new Date(+c+(this.o.weekStart-c.getUTCDay()-7)%7*864e5),b=new Date(+y+(11-y.getUTCDay())%7*864e5),w=new Date(+(w=r(b.getUTCFullYear(),0,1))+(11-w.getUTCDay())%7*864e5),E=(b-w)/864e5/7+1;m.push('<td class="ai1ec-cw">'+E+"</td>")}}g=this.getClassNames(c),g.push("ai1ec-day");if(this.o.beforeShowDay!==e.noop){var S=this.o.beforeShowDay(this._utc_to_local(c));S===undefined?S={}:typeof S=="boolean"?S={enabled:S}:typeof S=="string"&&(S={classes:S}),S.enabled===!1&&g.push("ai1ec-disabled"),S.classes&&(g=g.concat(S.classes.split(/\s+/))),S.tooltip&&(f=S.tooltip)}g=e.unique(g),m.push('<td class="'+g.join(" ")+'"'+(f?' title="'+f+'"':"")+">"+c.getUTCDate()+"</td>"),c.getUTCDay()==this.o.weekEnd&&m.push("</tr>"),c.setUTCDate(c.getUTCDate()+1)}this.picker.find(".ai1ec-datepicker-days tbody").empty().append(m.join(""));var x=this.picker.find(".ai1ec-datepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("ai1ec-active");e.each(this.dates,function(e,t){t.getUTCFullYear()==n&&x.eq(t.getUTCMonth()).addClass("ai1ec-active")}),(n<s||n>u)&&x.addClass("ai1ec-disabled"),n==s&&x.slice(0,o).addClass("ai1ec-disabled"),n==u&&x.slice(a+1).addClass("ai1ec-disabled"),m="",n=parseInt(n/10,10)*10;var T=this.picker.find(".ai1ec-datepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;var N=e.map(this.dates,function(e){return e.getUTCFullYear()}),C;for(var k=-1;k<11;k++)C=["ai1ec-year"],k===-1?C.push("ai1ec-old"):k===10&&C.push("ai1ec-new"),e.inArray(n,N)!==-1&&C.push("ai1ec-active"),(n<s||n>u)&&C.push("ai1ec-disabled"),m+='<span class="'+C.join(" ")+'">'+n+"</span>",n+=1;T.html(m)},updateNavArrows:function(){if(!this._allow_update)return;var e=new Date(this.viewDate),t=e.getUTCFullYear(),n=e.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()&&n<=this.o.startDate.getUTCMonth()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()&&n>=this.o.endDate.getUTCMonth()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"})}},click:function(t){t.preventDefault();var n=e(t.target).closest("span, td, th"),i,s,o;if(n.length==1)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"ai1ec-datepicker-switch":this.showMode(1);break;case"ai1ec-prev":case"ai1ec-next":var u=v.modes[this.viewMode].navStep*(n[0].className=="ai1ec-prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,u),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,u),this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"ai1ec-today":var a=new Date;a=r(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0),this.showMode(-2);var f=this.o.todayBtn=="linked"?null:"view";this._setDate(a,f);break;case"ai1ec-clear":var l;this.isInput?l=this.element:this.component&&(l=this.element.find("input")),l&&l.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":n.is(".ai1ec-disabled")||(this.viewDate.setUTCDate(1),n.is(".ai1ec-month")?(o=1,s=n.parent().find("span").index(n),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(s),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(r(i,s,o))):(o=1,s=0,i=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(i),this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(r(i,s,o))),this.showMode(-1),this.fill());break;case"td":n.is(".ai1ec-day")&&!n.is(".ai1ec-disabled")&&(o=parseInt(n.text(),10)||1,i=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n.is(".ai1ec-old")?s===0?(s=11,i-=1):s-=1:n.is(".ai1ec-new")&&(s==11?(s=0,i+=1):s+=1),this._setDate(r(i,s,o)))}this.picker.is(":visible")&&this._focused_from&&e(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(e){var t=this.dates.contains(e);e?t!==-1?this.dates.remove(t):this.dates.push(e):this.dates.clear();if(typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(e,t){(!t||t=="date")&&this._toggle_multidate(e&&new Date(e));if(!t||t=="view")this.viewDate=e&&new Date(e);this.fill(),this.setValue(),this._trigger("changeDate");var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),this.o.autoclose&&(!t||t=="date")&&this.hide()},moveMonth:function(e,t){if(!e)return undefined;if(!t)return e;var n=new Date(e.valueOf()),r=n.getUTCDate(),i=n.getUTCMonth(),s=Math.abs(t),o,u;t=t>0?1:-1;if(s==1){u=t==-1?function(){return n.getUTCMonth()==i}:function(){return n.getUTCMonth()!=o},o=i+t,n.setUTCMonth(o);if(o<0||o>11)o=(o+12)%12}else{for(var a=0;a<s;a++)n=this.moveMonth(n,t);o=n.getUTCMonth(),n.setUTCDate(r),u=function(){return o!=n.getUTCMonth()}}while(u())n.setUTCDate(--r),n.setUTCMonth(o);return n},moveYear:function(e,t){return this.moveMonth(e,t*12)},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":not(:visible)")){e.keyCode==27&&this.show();return}var t=!1,n,r,s,o=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;n=e.keyCode==37?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n),s=new Date(o),s.setUTCDate(o.getUTCDate()+n)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;n=e.keyCode==38?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n*7),s=new Date(o),s.setUTCDate(o.getUTCDate()+n*7)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 32:break;case 13:o=this.focusDate||this.dates.get(-1)||this.viewDate,this._toggle_multidate(o),t=!0,this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(t){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var u;this.isInput?u=this.element:this.component&&(u=this.element.find("input")),u&&u.change()}},showMode:function(e){e&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+e))),this.picker.find(">div").hide().filter(".ai1ec-datepicker-"+v.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var a=function(t,n){this.element=e(t),this.inputs=e.map(n.inputs,function(e){return e.jquery?e[0]:e}),delete n.inputs,e(this.inputs).datepicker(n).bind("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e(t).data("datepicker")}),this.updateDates()};a.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,n){n.setRange(t)})},dateUpdated:function(t){if(this.updating)return;this.updating=!0;var n=e(t.target).data("datepicker"),r=n.getUTCDate(),i=e.inArray(t.target,this.inputs),s=this.inputs.length;if(i==-1)return;e.each(this.pickers,function(e,t){t.getUTCDate()||t.setUTCDate(r)});if(r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<s&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates(),delete this.updating},remove:function(){e.map(this.pickers,function(e){e.remove()}),delete this.element.data().datepicker}};var c=e.fn.datepicker;e.fn.datepicker=function(t){var n=Array.apply(null,arguments);n.shift();var r;return this.each(function(){var i=e(this),s=i.data("datepicker"),o=typeof t=="object"&&t;if(!s){var c=f(this,"date"),p=e.extend({},h,c,o),d=l(p.language),v=e.extend({},h,d,c,o);if(i.is(".ai1ec-input-daterange")||v.inputs){var m={inputs:v.inputs||i.find("input").toArray()};i.data("datepicker",s=new a(this,e.extend(v,m)))}else i.data("datepicker",s=new u(this,v))}if(typeof t=="string"&&typeof s[t]=="function"){r=s[t].apply(s,n);if(r!==undefined)return!1}}),r!==undefined?r:this};var h=e.fn.datepicker.defaults={autoclose:!1,beforeShowDay:e.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},p=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=u;var d=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},v={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},getDaysInMonth:function(e,t){return[31,v.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(e){var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||n.length===0)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(t,n,i){if(!t)return undefined;if(t instanceof Date)return t;typeof n=="string"&&(n=v.parseFormat(n));if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(t)){var s=/([\-+]\d+)([dmwy])/,o=t.match(/([\-+]\d+)([dmwy])/g),a,f;t=new Date;for(var l=0;l<o.length;l++){a=s.exec(o[l]),f=parseInt(a[1]);switch(a[2]){case"d":t.setUTCDate(t.getUTCDate()+f);break;case"m":t=u.prototype.moveMonth.call(u.prototype,t,f);break;case"w":t.setUTCDate(t.getUTCDate()+f*7);break;case"y":t=u.prototype.moveYear.call(u.prototype,t,f)}}return r(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),0,0,0)}var o=t&&t.match(this.nonpunctuation)||[],t=new Date,c={},h=["yyyy","yy","M","MM","m","mm","d","dd"],p={yyyy:function(e,t){return e.setUTCFullYear(t)},yy:function(e,t){return e.setUTCFullYear(2e3+t)},m:function(e,t){if(isNaN(e))return e;t-=1;while(t<0)t+=12;t%=12,e.setUTCMonth(t);while(e.getUTCMonth()!=t)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}},m,g,a;p.M=p.MM=p.mm=p.m,p.dd=p.d,t=r(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);var y=n.parts.slice();o.length!=y.length&&(y=e(y).filter(function(t,n){return e.inArray(n,h)!==-1}).toArray());if(o.length==y.length){for(var l=0,b=y.length;l<b;l++){m=parseInt(o[l],10),a=y[l];if(isNaN(m))switch(a){case"MM":g=e(d[i].months).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].months)+1;break;case"M":g=e(d[i].monthsShort).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].monthsShort)+1}c[a]=m}for(var l=0,w,E;l<h.length;l++)E=h[l],E in c&&!isNaN(c[E])&&(w=new Date(t),p[E](w,c[E]),isNaN(w)||(t=w))}return t},formatDate:function(t,n,r){if(!t)return"";typeof n=="string"&&(n=v.parseFormat(n));var i={d:t.getUTCDate(),D:d[r].daysShort[t.getUTCDay()],DD:d[r].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:d[r].monthsShort[t.getUTCMonth()],MM:d[r].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m;var t=[],s=e.extend([],n.separators);for(var o=0,u=n.parts.length;o<=u;o++)s.length&&t.push(s.shift()),t.push(i[n.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="ai1ec-prev"><i class="ai1ec-fa ai1ec-fa-arrow-left"></i></th><th colspan="5" class="ai1ec-datepicker-switch"></th><th class="ai1ec-next"><i class="ai1ec-fa ai1ec-fa-arrow-right"></i></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="ai1ec-today"></th></tr><tr><th colspan="7" class="ai1ec-clear"></th></tr></tfoot>'};v.template='<div class="timely ai1ec-datepicker"><div class="ai1ec-datepicker-days"><table class=" ai1ec-table-condensed">'+v.headTemplate+"<tbody></tbody>"+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-months">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-years">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+"</div>",e.fn.datepicker.DPGlobal=v,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=c,this},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var n=e(this);if(n.data("datepicker"))return;t.preventDefault(),n.datepicker("show")}),e(function(){e('[data-provide="datepicker-inline"]').datepicker()});for(var m=2,g=arguments.length;m<g;m++)arguments[m].localize()}),timely.define("external_libs/bootstrap/transition",["jquery_timely"],function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(e.style[n]!==undefined)return{end:t[n]}}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one(e.support.transition.end,function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t()})}),timely.define("external_libs/bootstrap/collapse",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.transitioning=null,this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e=this.$element.hasClass("ai1ec-width");return e?"width":"height"},t.prototype.show=function(){if(this.transitioning||this.$element.hasClass("ai1ec-in"))return;var t=e.Event("show.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.$parent&&this.$parent.find("> .ai1ec-panel > .ai1ec-in");if(n&&n.length){var r=n.data("bs.collapse");if(r&&r.transitioning)return;n.collapse("hide"),r||n.data("bs.collapse",null)}var i=this.dimension();this.$element.removeClass("ai1ec-collapse").addClass("ai1ec-collapsing")[i](0),this.transitioning=1;var s=function(){this.$element.removeClass("ai1ec-collapsing").addClass("ai1ec-in")[i]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return s.call(this);var o=e.camelCase(["scroll",i].join("-"));this.$element.one(e.support.transition.end,e.proxy(s,this)).emulateTransitionEnd(350)[i](this.$element[0][o])},t.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("ai1ec-in"))return;var t=e.Event("hide.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("ai1ec-collapsing").removeClass("ai1ec-collapse").removeClass("ai1ec-in"),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("ai1ec-collapsing").addClass("ai1ec-collapse")};if(!e.support.transition)return r.call(this);this.$element[n](0).one(e.support.transition.end,e.proxy(r,this)).emulateTransitionEnd(350)},t.prototype.toggle=function(){this[this.$element.hasClass("ai1ec-in")?"hide":"show"]()};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("bs.collapse"),s=e.extend({},t.DEFAULTS,r.data(),typeof n=="object"&&n);i||r.data("bs.collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.bs.collapse.data-api","[data-toggle=ai1ec-collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i),o=s.data("bs.collapse"),u=o?"toggle":n.data(),a=n.attr("data-parent"),f=a&&e(a);if(!o||!o.transitioning)f&&f.find('[data-toggle=ai1ec-collapse][data-parent="'+a+'"]').not(n).addClass("ai1ec-collapsed"),n[s.hasClass("ai1ec-in")?"addClass":"removeClass"]("ai1ec-collapsed");s.collapse(u)})}),timely.define("external_libs/bootstrap/modal",["jquery_timely"],function(e){var t=function(t,n){this.options=n,this.$element=e(t),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this[this.isShown?"hide":"show"](e)},t.prototype.show=function(t){var n=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);if(this.isShown||r.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="ai1ec-modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var r=e.support.transition&&n.$element.hasClass("ai1ec-fade");n.$element.parent().length||n.$element.appendTo(document.body),n.$element.show(),r&&n.$element[0].offsetWidth,n.$element.addClass("ai1ec-in").attr("aria-hidden",!1),n.enforceFocus();var i=e.Event("shown.bs.modal",{relatedTarget:t});r?n.$element.find(".ai1ec-modal-dialog").one(e.support.transition.end,function(){n.$element.focus().trigger(i)}).emulateTransitionEnd(300):n.$element.focus().trigger(i)})},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("ai1ec-in").attr("aria-hidden",!0).off("click.dismiss.modal"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$element.one(e.support.transition.end,e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]!==e.target&&!this.$element.has(e.target).length&&this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){e.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var n=this,r=this.$element.hasClass("ai1ec-fade")?"ai1ec-fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="ai1ec-modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",e.proxy(function(e){if(e.target!==e.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("ai1ec-in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("ai1ec-in"),e.support.transition&&this.$element.hasClass("ai1ec-fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},t.DEFAULTS,i.data(),typeof n=="object"&&n);s||i.data("bs.modal",s=new t(this,o)),typeof n=="string"?s[n](r):o.show&&s.show(r)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="ai1ec-modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s,this).one("hide",function(){n.is(":visible")&&n.focus()})}),e(document).on("show.bs.modal",".ai1ec-modal",function(){e(document.body).addClass("ai1ec-modal-open")}).on("hidden.bs.modal",".ai1ec-modal",function(){e(document.body).removeClass("ai1ec-modal-open")})}),timely.define("external_libs/bootstrap/alert",["jquery_timely"],function(e){var t='[data-dismiss="ai1ec-alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed.bs.alert").remove()}var n=e(this),r=n.attr("data-target");r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));var i=e(r);t&&t.preventDefault(),i.length||(i=n.hasClass("ai1ec-alert")?n:n.parent()),i.trigger(t=e.Event("close.bs.alert"));if(t.isDefaultPrevented())return;i.removeClass("ai1ec-in"),e.support.transition&&i.hasClass("ai1ec-fade")?i.one(e.support.transition.end,s).emulateTransitionEnd(150):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}),timely.define("external_libs/select2",["jquery_timely"],function(e){(function(e){typeof e.fn.each2=="undefined"&&e.fn.extend({each2:function(t){var n=e([0]),r=-1,i=this.length;while(++r<i&&(n.context=n[0]=this[r])&&t.call(n[0],r,n)!==!1);return this}})})(e),function(e,t){function l(e,t){var n=0,r=t.length;for(;n<r;n+=1)if(c(e,t[n]))return n;return-1}function c(e,n){return e===n?!0:e===t||n===t?!1:e===null||n===null?!1:e.constructor===String?e===n+"":n.constructor===String?n===e+"":!1}function h(t,n){var r,i,s;if(t===null||t.length<1)return[];r=t.split(n);for(i=0,s=r.length;i<s;i+=1)r[i]=e.trim(r[i]);return r}function p(e){return e.outerWidth(!1)-e.width()}function d(n){var r="keyup-change-value";n.bind("keydown",function(){e.data(n,r)===t&&e.data(n,r,n.val())}),n.bind("keyup",function(){var i=e.data(n,r);i!==t&&n.val()!==i&&(e.removeData(n,r),n.trigger("keyup-change"))})}function v(n){n.bind("mousemove",function(n){var r=a;(r===t||r.x!==n.pageX||r.y!==n.pageY)&&e(n.target).trigger("mousemove-filtered",n)})}function m(e,n,r){r=r||t;var i;return function(){var t=arguments;window.clearTimeout(i),i=window.setTimeout(function(){n.apply(r,t)},e)}}function g(e){var t=!1,n;return function(){return t===!1&&(n=e(),t=!0),n}}function y(e,t){var n=m(e,function(e){t.trigger("scroll-debounced",e)});t.bind("scroll",function(e){l(e.target,t.get())>=0&&n(e)})}function b(e){if(e[0]===document.activeElement)return;window.setTimeout(function(){var t=e[0],n=e.val().length,r;e.focus(),t.setSelectionRange?t.setSelectionRange(n,n):t.createTextRange&&(r=t.createTextRange(),r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",n),r.select())},0)}function w(e){e.preventDefault(),e.stopPropagation()}function E(e){e.preventDefault(),e.stopImmediatePropagation()}function S(t){if(!u){var n=t[0].currentStyle||window.getComputedStyle(t[0],null);u=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"}),u.attr("class","select2-sizer"),e("body").append(u)}return u.text(t.val()),u.width()}function x(t,n,r){var i,s=[],o;i=t.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")===0&&s.push(this)}),i=n.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")!==0&&(o=r(this),typeof o=="string"&&o.length>0&&s.push(this))}),t.attr("class",s.join(" "))}function T(e,t,n,r){var i=e.toUpperCase().indexOf(t.toUpperCase()),s=t.length;if(i<0){n.push(r(e));return}n.push(r(e.substring(0,i))),n.push("<span class='select2-match'>"),n.push(r(e.substring(i,i+s))),n.push("</span>"),n.push(r(e.substring(i+s,e.length)))}function N(t){var n,r=0,i=null,s=t.quietMillis||100,o=t.url,u=this;return function(a){window.clearTimeout(n),n=window.setTimeout(function(){r+=1;var n=r,s=t.data,f=o,l=t.transport||e.ajax,c=t.type||"GET",h={};s=s?s.call(u,a.term,a.page,a.context):null,f=typeof f=="function"?f.call(u,a.term,a.page,a.context):f,null!==i&&i.abort(),t.params&&(e.isFunction(t.params)?e.extend(h,t.params.call(u)):e.extend(h,t.params)),e.extend(h,{url:f,dataType:t.dataType,data:s,type:c,cache:!1,success:function(e){if(n<r)return;var i=t.results(e,a.page);a.callback(i)}}),i=l.call(u,h)},s)}}function C(t){var n=t,r,i,s=function(e){return""+e.text};e.isArray(n)&&(i=n,n={results:i}),e.isFunction(n)===!1&&(i=n,n=function(){return i});var o=n();return o.text&&(s=o.text,e.isFunction(s)||(r=n.text,s=function(e){return e[r]})),function(t){var r=t.term,i={results:[]},o;if(r===""){t.callback(n());return}o=function(n,i){var u,a;n=n[0];if(n.children){u={};for(a in n)n.hasOwnProperty(a)&&(u[a]=n[a]);u.children=[],e(n.children).each2(function(e,t){o(t,u.children)}),(u.children.length||t.matcher(r,s(u),n))&&i.push(u)}else t.matcher(r,s(n),n)&&i.push(n)},e(n().results).each2(function(e,t){o(t,i.results)}),t.callback(i)}}function k(n){var r=e.isFunction(n);return function(i){var s=i.term,o={results:[]};e(r?n():n).each(function(){var e=this.text!==t,n=e?this.text:this;(s===""||i.matcher(s,n))&&o.results.push(e?this:{id:this,text:this})}),i.callback(o)}}function L(t,n){if(e.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value")}function A(t){return e.isFunction(t)?t():t}function O(t){var n=0;return e.each(t,function(e,t){t.children?n+=O(t.children):n++}),n}function M(e,n,r,i){var s=e,o=!1,u,a,f,l,h;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return t;for(;;){a=-1;for(f=0,l=i.tokenSeparators.length;f<l;f++){h=i.tokenSeparators[f],a=e.indexOf(h);if(a>=0)break}if(a<0)break;u=e.substring(0,a),e=e.substring(a+h.length);if(u.length>0){u=i.createSearchChoice(u,n);if(u!==t&&u!==null&&i.id(u)!==t&&i.id(u)!==null){o=!1;for(f=0,l=n.length;f<l;f++)if(c(i.id(u),i.id(n[f]))){o=!0;break}o||r(u)}}}if(s!==e)return e}function _(t,n){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=e.extend(r.prototype,n),r}var n,r,i,s,o,u,a,f;n={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){e=e.which?e.which:e;switch(e){case n.LEFT:case n.RIGHT:case n.UP:case n.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case n.SHIFT:case n.CTRL:case n.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&e<=123}},f=e(document),o=function(){var e=1;return function(){return e++}}(),f.bind("mousemove",function(e){a={x:e.pageX,y:e.pageY}}),r=_(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(n){var r,i,s=".select2-results",u;this.opts=n=this.prepareOpts(n),this.id=n.id,n.element.data("select2")!==t&&n.element.data("select2")!==null&&this.destroy(),this.enabled=!0,this.container=this.createContainer(),this.containerId="s2id_"+(n.element.attr("id")||"autogen"+o()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=g(function(){return n.element.closest("body")}),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(A(n.containerCss)),this.container.addClass(A(n.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabIndex"),this.opts.element.data("select2",this).addClass("select2-offscreen").bind("focus.select2",function(){e(this).select2("focus")}).attr("tabIndex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(A(n.dropdownCssClass)),this.dropdown.data("select2",this),this.results=r=this.container.find(s),this.search=i=this.container.find("input.select2-input"),i.attr("tabIndex",this.elementTabIndex),this.resultsPage=0,this.context=null,this.initContainer(),v(this.results),this.dropdown.delegate(s,"mousemove-filtered touchstart touchmove touchend",this.bind(this.highlightUnderEvent)),y(80,this.results),this.dropdown.delegate(s,"scroll-debounced",this.bind(this.loadMoreIfNeeded)),e.fn.mousewheel&&r.mousewheel(function(e,t,n,i){var s=r.scrollTop(),o;i>0&&s-i<=0?(r.scrollTop(0),w(e)):i<0&&r.get(0).scrollHeight-r.scrollTop()+i<=r.height()&&(r.scrollTop(r.get(0).scrollHeight-r.height()),w(e))}),d(i),i.bind("keyup-change input paste",this.bind(this.updateResults)),i.bind("focus",function(){i.addClass("select2-focused")}),i.bind("blur",function(){i.removeClass("select2-focused")}),this.dropdown.delegate(s,"mouseup",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.bind("click mouseup mousedown",function(e){e.stopPropagation()}),e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),(n.element.is(":disabled")||n.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var e=this.opts.element.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),e!==t&&(e.container.remove(),e.dropdown.remove(),e.opts.element.removeClass("select2-offscreen").removeData("select2").unbind(".select2").attr({tabIndex:this.elementTabIndex}).show())},prepareOpts:function(n){var r,i,s,o;r=n.element,r.get(0).tagName.toLowerCase()==="select"&&(this.select=i=n.element),i&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),n=e.extend({},{populateResults:function(r,i,s){var o,u,a,f,l=this.opts.id,c=this;o=function(r,i,u){var a,f,h,p,d,v,m,g,y,b;r=n.sortResults(r,i,s);for(a=0,f=r.length;a<f;a+=1)h=r[a],d=h.disabled===!0,p=!d&&l(h)!==t,v=h.children&&h.children.length>0,m=e("<li></li>"),m.addClass("select2-results-dept-"+u),m.addClass("select2-result"),m.addClass(p?"select2-result-selectable":"select2-result-unselectable"),d&&m.addClass("select2-disabled"),v&&m.addClass("select2-result-with-children"),m.addClass(c.opts.formatResultCssClass(h)),g=e(document.createElement("div")),g.addClass("select2-result-label"),b=n.formatResult(h,g,s,c.opts.escapeMarkup),b!==t&&g.html(b),m.append(g),v&&(y=e("<ul></ul>"),y.addClass("select2-result-sub"),o(h.children,y,u+1),m.append(y)),m.data("select2-data",h),i.append(m)},o(i,r,0)}},e.fn.select2.defaults,n),typeof n.id!="function"&&(s=n.id,n.id=function(e){return e[s]});if(e.isArray(n.element.data("select2Tags"))){if("tags"in n)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id");n.tags=n.element.attr("data-select2-tags")}i?(n.query=this.bind(function(n){var i={results:[],more:!1},s=n.term,o,u,a;a=function(e,t){var r;e.is("option")?n.matcher(s,e.text(),e)&&t.push({id:e.attr("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:c(e.attr("disabled"),"disabled")}):e.is("optgroup")&&(r={text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")},e.children().each2(function(e,t){a(t,r.children)}),r.children.length>0&&t.push(r))},o=r.children(),this.getPlaceholder()!==t&&o.length>0&&(u=o[0],e(u).text()===""&&(o=o.not(u))),o.each2(function(e,t){a(t,i.results)}),n.callback(i)}),n.id=function(e){return e.id},n.formatResultCssClass=function(e){return e.css}):"query"in n||("ajax"in n?(o=n.element.data("ajax-url"),o&&o.length>0&&(n.ajax.url=o),n.query=N.call(n.element,n.ajax)):"data"in n?n.query=C(n.data):"tags"in n&&(n.query=k(n.tags),n.createSearchChoice===t&&(n.createSearchChoice=function(e){return{id:e,text:e}}),n.initSelection===t&&(n.initSelection=function(t,r){var i=[];e(h(t.val(),n.separator)).each(function(){var t=this,r=this,s=n.tags;e.isFunction(s)&&(s=s()),e(s).each(function(){if(c(this.id,t))return r=this.text,!1}),i.push({id:t,text:r})}),r(i)})));if(typeof n.query!="function")throw"query function not defined for Select2 "+n.element.attr("id");return n},monitorSource:function(){var e=this.opts.element,t;e.bind("change.select2",this.bind(function(e){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),t=this.bind(function(){var e,t,n=this;e=this.opts.element.attr("disabled")!=="disabled",t=this.opts.element.attr("readonly")==="readonly",e=e&&!t,this.enabled!==e&&(e?this.enable():this.disable()),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(A(this.opts.containerCssClass)),x(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(A(this.opts.dropdownCssClass))}),e.bind("propertychange.select2 DOMAttrModified.select2",t),typeof WebKitMutationObserver!="undefined"&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(function(e){e.forEach(t)}),this.propertyObserver.observe(e.get(0),{attributes:!0,subtree:!1}))},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){if(this.enabled)return;this.enabled=!0,this.container.removeClass("select2-container-disabled"),this.opts.element.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"),this.opts.element.attr("disabled","disabled")},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t=this.container.offset(),n=this.container.outerHeight(!1),r=this.container.outerWidth(!1),i=this.dropdown.outerHeight(!1),s=e(window).scrollLeft()+e(window).width(),o=e(window).scrollTop()+e(window).height(),u=t.top+n,a=t.left,f=u+i<=o,l=t.top-i>=this.body().scrollTop(),c=this.dropdown.outerWidth(!1),h=a+c<=s,p=this.dropdown.hasClass("select2-drop-above"),d,v,m;this.body().css("position")!=="static"&&(d=this.body().offset(),u-=d.top,a-=d.left),p?(v=!0,!l&&f&&(v=!1)):(v=!1,!f&&l&&(v=!0)),h||(a=t.left+r-c),v?(u=t.top-i,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")),m=e.extend({top:u,left:a,width:r},A(this.opts.dropdownCss)),this.dropdown.css(m)},shouldOpen:function(){var t;return this.opened()?!1:(t=e.Event("opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(window.setTimeout(this.bind(this.opening),1),!0):!1},opening:function(){var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t,s;this.clearDropdownAlignmentPreference(),this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),this.updateResults(!0),s=e("#select2-drop-mask"),s.length==0&&(s=e(document.createElement("div")),s.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),s.hide(),s.appendTo(this.body()),s.bind("mousedown touchstart",function(t){var n=e("#select2-drop"),r;n.length>0&&(r=n.data("select2"),r.opts.selectOnBlur&&r.selectHighlighted({noFocus:!0}),r.close())})),this.dropdown.prev()[0]!==s[0]&&this.dropdown.before(s),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),s.css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),s.show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this.ensureHighlightVisible();var o=this;this.container.parents().add(window).each(function(){e(this).bind(r+" "+n+" "+i,function(t){e("#select2-drop-mask").css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),o.positionDropdown()})}),this.focusSearch()},close:function(){if(!this.opened())return;var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).unbind(n).unbind(r).unbind(i)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.opts.element.trigger(e.Event("close"))},clearSearch:function(){},getMaximumSelectionSize:function(){return A(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t=this.results,n,r,i,s,o,u,a;r=this.highlight();if(r<0)return;if(r==0){t.scrollTop(0);return}n=this.findHighlightableChoices(),i=e(n[r]),s=i.offset().top+i.outerHeight(!0),r===n.length-1&&(a=t.find("li.select2-more-results"),a.length>0&&(s=a.offset().top+a.outerHeight(!0))),o=t.offset().top+t.outerHeight(!0),s>o&&t.scrollTop(t.scrollTop()+(s-o)),u=i.offset().top-t.offset().top,u<0&&i.css("display")!="none"&&t.scrollTop(t.scrollTop()+u)},findHighlightableChoices:function(){var e=this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)");return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){var n=this.findHighlightableChoices(),r=this.highlight();while(r>-1&&r<n.length){r+=t;var i=e(n[r]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(r);break}}},highlight:function(t){var n=this.findHighlightableChoices(),r,i;if(arguments.length===0)return l(n.filter(".select2-highlighted")[0],n.get());t>=n.length&&(t=n.length-1),t<0&&(t=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),r=e(n[t]),r.addClass("select2-highlighted"),this.ensureHighlightVisible(),i=r.data("select2-data"),i&&this.opts.element.trigger({type:"highlight",val:this.id(i),choice:i})},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var n=e(t.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var r=this.findHighlightableChoices();this.highlight(r.index(n))}else n.length==0&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),n,r=-1,i=this.resultsPage+1,s=this,o=this.search.val(),u=this.context;if(t.length===0)return;n=t.offset().top-e.offset().top-e.height(),n<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:o,page:i,context:u,matcher:this.opts.matcher,callback:this.bind(function(n){if(!s.opened())return;s.opts.populateResults.call(this,e,n.results,{term:o,page:i,context:u}),n.more===!0?(t.detach().appendTo(e).text(s.opts.formatLoadMore(i+1)),window.setTimeout(function(){s.loadMoreIfNeeded()},10)):t.remove(),s.positionDropdown(),s.resultsPage=i,s.context=n.context})}))},tokenize:function(){},updateResults:function(n){function f(){i.scrollTop(0),r.removeClass("select2-active"),u.positionDropdown()}function l(e){i.html(e),f()}var r=this.search,i=this.results,s=this.opts,o,u=this,a;if(n!==!0&&(this.showSearchInput===!1||!this.opened()))return;r.addClass("select2-active");var h=this.getMaximumSelectionSize();if(h>=1){o=this.data();if(e.isArray(o)&&o.length>=h&&L(s.formatSelectionTooBig,"formatSelectionTooBig")){l("<li class='select2-selection-limit'>"+s.formatSelectionTooBig(h)+"</li>");return}}if(r.val().length<s.minimumInputLength){L(s.formatInputTooShort,"formatInputTooShort")?l("<li class='select2-no-results'>"+s.formatInputTooShort(r.val(),s.minimumInputLength)+"</li>"):l("");return}s.formatSearching()&&n===!0&&l("<li class='select2-searching'>"+s.formatSearching()+"</li>");if(s.maximumInputLength&&r.val().length>s.maximumInputLength){L(s.formatInputTooLong,"formatInputTooLong")?l("<li class='select2-no-results'>"+s.formatInputTooLong(r.val(),s.maximumInputLength)+"</li>"):l("");return}a=this.tokenize(),a!=t&&a!=null&&r.val(a),this.resultsPage=1,s.query({element:s.element,term:r.val(),page:this.resultsPage,context:null,matcher:s.matcher,callback:this.bind(function(o){var a;if(!this.opened())return;this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&r.val()!==""&&(a=this.opts.createSearchChoice.call(null,r.val(),o.results),a!==t&&a!==null&&u.id(a)!==t&&u.id(a)!==null&&e(o.results).filter(function(){return c(u.id(this),u.id(a))}).length===0&&o.results.unshift(a));if(o.results.length===0&&L(s.formatNoMatches,"formatNoMatches")){l("<li class='select2-no-results'>"+s.formatNoMatches(r.val())+"</li>");return}i.empty(),u.opts.populateResults.call(this,i,o.results,{term:r.val(),page:this.resultsPage,context:null}),o.more===!0&&L(s.formatLoadMore,"formatLoadMore")&&(i.append("<li class='select2-more-results'>"+u.opts.escapeMarkup(s.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){u.loadMoreIfNeeded()},10)),this.postprocessResults(o,n),f()})})},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){b(this.search)},selectHighlighted:function(e){var t=this.highlight(),n=this.results.find(".select2-highlighted"),r=n.closest(".select2-result").data("select2-data");r&&(this.highlight(t),this.onSelect(r,e))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){function n(){var n,r,i,s,o;if(this.opts.width==="off")return null;if(this.opts.width==="element")return this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px";if(this.opts.width==="copy"||this.opts.width==="resolve"){n=this.opts.element.attr("style");if(n!==t){r=n.split(";");for(s=0,o=r.length;s<o;s+=1){i=r[s].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);if(i!==null&&i.length>=1)return i[1]}}return this.opts.width==="resolve"?(n=this.opts.element.css("width"),n.indexOf("%")>0?n:this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var r=n.call(this);r!==null&&this.container.css("width",r)}}),i=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>"," <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>"," <div><b></b></div>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop' style='display:none'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.focusser.attr("disabled","disabled")},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.focusser.removeAttr("disabled")},opening:function(){this.parent.opening.apply(this,arguments),this.focusser.attr("disabled","disabled"),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),b(this.focusser)},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var e,t=this.container,r=this.dropdown,i=!1;this.showSearch(this.opts.minimumResultsForSearch>=0),this.selection=e=t.find(".select2-choice"),this.focusser=t.find(".select2-focusser"),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN){w(e);return}switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.TAB:case n.ENTER:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}})),this.focusser.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.ESC)return;if(this.opts.openOnEnter===!1&&e.which===n.ENTER){w(e);return}if(e.which==n.DOWN||e.which==n.UP||e.which==n.ENTER&&this.opts.openOnEnter){this.open(),w(e);return}if(e.which==n.DELETE||e.which==n.BACKSPACE){this.opts.allowClear&&this.clear(),w(e);return}})),d(this.focusser),this.focusser.bind("keyup-change input",this.bind(function(e){if(this.opened())return;this.open(),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.focusser.val(""),w(e)})),e.delegate("abbr","mousedown",this.bind(function(e){if(!this.enabled)return;this.clear(),E(e),this.close(),this.selection.focus()})),e.bind("mousedown",this.bind(function(e){i=!0,this.opened()?this.close():this.enabled&&this.open(),w(e),i=!1})),r.bind("mousedown",this.bind(function(){this.search.focus()})),e.bind("focus",this.bind(function(e){w(e)})),this.focusser.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})).bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active")})),this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.setPlaceholder()},clear:function(){var e=this.selection.data("select2-data");this.opts.element.val(""),this.selection.find("span").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),this.opts.element.trigger({type:"removed",val:this.id(e),choice:e}),this.triggerChange({removed:e})},initSelection:function(){var e;if(this.opts.element.val()===""&&this.opts.element.text()==="")this.close(),this.setPlaceholder();else{var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.setPlaceholder())})}},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(t,n){var r=t.find(":selected");e.isFunction(n)&&n({id:r.attr("value"),text:r.text(),element:r})}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=n.val();t.query({matcher:function(e,n,r){return c(i,t.id(r))},callback:e.isFunction(r)?function(e){r(e.results.length?e.results[0]:null)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.select.find("option").first().text()!==""?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.opts.element.val()===""&&e!==t){if(this.select&&this.select.find("option:first").text()!=="")return;this.selection.find("span").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide()}},postprocessResults:function(e,t){var n=0,r=this,i=!0;this.findHighlightableChoices().each2(function(e,t){if(c(r.id(t.data("select2-data")),r.opts.element.val()))return n=e,!1}),this.highlight(n);if(t===!0){var s=this.opts.minimumResultsForSearch;i=s<0?!1:O(e.results)>=s,this.showSearch(i)}},showSearch:function(t){this.showSearchInput=t,this.dropdown.find(".select2-search")[t?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[t?"addClass":"removeClass"]("select2-with-searchbox")},onSelect:function(e,t){var n=this.opts.element.val();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.close(),(!t||!t.noFocus)&&this.selection.focus(),c(n,this.id(e))||this.triggerChange()},updateSelection:function(e){var n=this.selection.find("span"),r;this.selection.data("select2-data",e),n.empty(),r=this.opts.formatSelection(e,n),r!==t&&n.append(this.opts.escapeMarkup(r)),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.selection.find("abbr").show()},val:function(){var e,n=!1,r=null,i=this;if(arguments.length===0)return this.opts.element.val();e=arguments[0],arguments.length>1&&(n=arguments[1]);if(this.select)this.select.val(e).find(":selected").each2(function(e,t){return r={id:t.attr("value"),text:t.text()},!1}),this.updateSelection(r),this.setPlaceholder(),n&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!e&&e!==0){this.clear(),n&&this.triggerChange();return}this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){i.opts.element.val(e?i.id(e):""),i.updateSelection(e),i.setPlaceholder(),n&&i.triggerChange()})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var n;if(arguments.length===0)return n=this.selection.data("select2-data"),n==t&&(n=null),n;!e||e===""?this.clear():(this.opts.element.val(e?this.id(e):""),this.updateSelection(e))}}),s=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html([" <ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi' style='display:none;'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(e,t){var n=[];e.find(":selected").each2(function(e,t){n.push({id:t.attr("value"),text:t.text(),element:t[0]})}),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=h(n.val(),t.separator);t.query({matcher:function(n,r,s){return e.grep(i,function(e){return c(e,t.id(s))}).length},callback:e.isFunction(r)?function(e){r(e.results)}:e.noop})}),t},initContainer:function(){var t=".select2-choices",r;this.searchContainer=this.container.find(".select2-search-field"),this.selection=r=this.container.find(t),this.search.bind("input paste",this.bind(function(){if(!this.enabled)return;this.opened()||this.open()})),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.BACKSPACE&&this.search.val()===""){this.close();var t,i=r.find(".select2-search-choice-focus");if(i.length>0){this.unselect(i.first()),this.search.width(10),w(e);return}t=r.find(".select2-search-choice:not(.select2-locked)"),t.length>0&&t.last().addClass("select2-search-choice-focus")}else r.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.ENTER:case n.TAB:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.BACKSPACE||e.which===n.ESC)return;if(e.which===n.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN)&&w(e)})),this.search.bind("keyup",this.bind(this.resizeSearch)),this.search.bind("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.opened()||this.clearSearch(),e.stopImmediatePropagation()})),this.container.delegate(t,"mousedown",this.bind(function(t){if(!this.enabled)return;if(e(t.target).closest(".select2-search-choice").length>0)return;this.clearPlaceholder(),this.open(),this.focusSearch(),t.preventDefault()})),this.container.delegate(t,"focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder()})),this.initContainerWidth(),this.clearSearch()},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.search.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0)},initSelection:function(){var e;this.opts.element.val()===""&&this.opts.element.text()===""&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||this.opts.element.val()!==""){var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder();e!==t&&this.getVal().length===0&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.resizeSearch()):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.parent.opening.apply(this,arguments),this.clearPlaceholder(),this.resizeSearch(),this.focusSearch(),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus(),this.opts.element.triggerHandler("focus")},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var n=[],r=[],i=this;e(t).each(function(){l(i.id(this),n)<0&&(n.push(i.id(this)),r.push(this))}),t=r,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){i.addSelectedChoice(this)}),i.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer(e,this.data(),this.bind(this.onSelect),this.opts),e!=null&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),(!t||!t.noFocus)&&this.focusSearch()},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(n){var r=!n.locked,i=e("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=e("<li class='select2-search-choice select2-locked'><div></div></li>"),o=r?i:s,u=this.id(n),a=this.getVal(),f;f=this.opts.formatSelection(n,o.find("div")),f!=t&&o.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"</div>"),r&&o.find(".select2-search-choice-close").bind("mousedown",w).bind("click dblclick",this.bind(function(t){if(!this.enabled)return;e(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),w(t)})).bind("focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active")})),o.data("select2-data",n),o.insertBefore(this.searchContainer),a.push(u),this.setVal(a)},unselect:function(e){var t=this.getVal(),n,r;e=e.closest(".select2-search-choice");if(e.length===0)throw"Invalid argument: "+e+". Must be .select2-search-choice";n=e.data("select2-data");if(!n)return;r=l(this.id(n).toString(),t),r>=0&&(t.splice(r,1),this.setVal(t),this.select&&this.postprocessResults()),e.remove(),this.opts.element.trigger({type:"removed",val:this.id(n),choice:n}),this.triggerChange({removed:n})},postprocessResults:function(){var e=this.getVal(),t=this.results.find(".select2-result"),n=this.results.find(".select2-result-with-children"),r=this;t.each2(function(t,n){var i=r.id(n.data("select2-data"));l(i,e)>=0&&(n.addClass("select2-selected"),n.find(".select2-result-selectable").addClass("select2-selected"))}),n.each2(function(e,t){!t.is(".select2-result-selectable")&&t.find(".select2-result-selectable:not(.select2-selected)").length===0&&t.addClass("select2-selected")}),this.highlight()==-1&&r.highlight(0)},resizeSearch:function(){var e,t,n,r,i,s=p(this.search);e=S(this.search)+10,t=this.search.offset().left,n=this.selection.width(),r=this.selection.offset().left,i=n-(t-r)-s,i<e&&(i=n-s),i<40&&(i=n-s),i<=0&&(i=e),this.search.width(i)},getVal:function(){var e;return this.select?(e=this.select.val(),e===null?[]:e):(e=this.opts.element.val(),h(e,this.opts.separator))},setVal:function(t){var n;this.select?this.select.val(t):(n=[],e(t).each(function(){l(this,n)<0&&n.push(this)}),this.opts.element.val(n.length===0?"":n.join(this.opts.separator)))},val:function(){var n,r=!1,i=[],s=this;if(arguments.length===0)return this.getVal();n=arguments[0],arguments.length>1&&(r=arguments[1]);if(!n&&n!==0){this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),r&&this.triggerChange();return}this.setVal(n);if(this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),r&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var n=e(t).map(s.id);s.setVal(n),s.updateSelection(t),s.clearSearch(),r&&s.triggerChange()})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],n=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(n.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t){var n=this,r;if(arguments.length===0)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();t||(t=[]),r=e.map(t,function(e){return n.opts.id(e)}),this.setVal(r),this.updateSelection(t),this.clearSearch()}}),e.fn.select2=function(){var n=Array.prototype.slice.call(arguments,0),r,o,u,a,f=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","disable","positionDropdown","data"];return this.each(function(){if(n.length===0||typeof n[0]=="object")r=n.length===0?{}:e.extend({},n[0]),r.element=e(this),r.element.get(0).tagName.toLowerCase()==="select"?a=r.element.attr("multiple"):(a=r.multiple||!1,"tags"in r&&(r.multiple=a=!0)),o=a?new s:new i,o.init(r);else{if(typeof n[0]!="string")throw"Invalid arguments to select2 plugin: "+n;if(l(n[0],f)<0)throw"Unknown method: "+n[0];u=t,o=e(this).data("select2");if(o===t)return;n[0]==="container"?u=o.container:u=o[n[0]].apply(o,n.slice(1));if(u!==t)return!1}}),u===t?this:u},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,n,r){var i=[];return T(e.text,n.term,i,r),i.join("")},formatSelection:function(e,n){return e?e.text:t},sortResults:function(e,t,n){return e},formatResultCssClass:function(e){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" more character"+(n==1?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please enter "+n+" less character"+(n==1?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(e==1?"":"s")},formatLoadMore:function(e){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e.id},matcher:function(e,t){return t.toUpperCase().indexOf(e.toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;","/":"&#47;"};return String(e).replace(/[&<>"'/\\]/g,function(e){return t[e[0]]})},blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null}}}(e)}),timely.define("scripts/add_new_event",["jquery_timely","domReady","ai1ec_config","scripts/add_new_event/event_location/gmaps_helper","scripts/add_new_event/event_location/input_coordinates_event_handlers","scripts/add_new_event/event_location/input_coordinates_utility_functions","scripts/add_new_event/event_date_time/date_time_event_handlers","scripts/add_new_event/event_cost_helper","external_libs/jquery.calendrical_timespan","external_libs/jquery.inputdate","external_libs/jquery.tools","external_libs/bootstrap_datepicker","external_libs/bootstrap/transition","external_libs/bootstrap/collapse","external_libs/bootstrap/modal","external_libs/bootstrap/alert","external_libs/bootstrap/tab","external_libs/select2"],function(e,t,n,r,i,s,o,u,a){var f=function(){var t=new Date(n.now*1e3),r={allday:"#ai1ec_all_day_event",start_date_input:"#ai1ec_start-date-input",start_time_input:"#ai1ec_start-time-input",start_time:"#ai1ec_start-time",end_date_input:"#ai1ec_end-date-input",end_time_input:"#ai1ec_end-time-input",end_time:"#ai1ec_end-time",date_format:n.date_format,month_names:n.month_names,day_names:n.day_names,week_start_day:n.week_start_day,twentyfour_hour:n.twentyfour_hour,now:t};e.timespan(r)},l=function(){e(".ai1ec-panel-collapse").on("hide",function(){e(this).parent().removeClass("ai1ec-overflow-visible")}),e(".ai1ec-panel-collapse").on("shown",function(){var t=e(this);window.setTimeout(function(){t.parent().addClass("ai1ec-overflow-visible")},350)})},c=function(){f(),timely.require(["libs/gmaps"],function(e){e(r.init_gmaps)})},h=function(t,n){var r=null;"[object Array]"===Object.prototype.toString.call(n)?r=n.join("<br>"):r=n,e("#ai1ec_event_inline_alert").html(r),e("#ai1ec_event_inline_alert").removeClass("ai1ec-hidden"),t.preventDefault(),e("#publish, #ai1ec_bottom_publish").removeClass("button-primary-disabled"),e("#publish, #ai1ec_bottom_publish").removeClass("disabled"),e("#publish, #ai1ec_bottom_publish").siblings("#ajax-loading, .spinner").css("visibility","hidden")},p=function(t){s.ai1ec_check_lat_long_fields_filled_when_publishing_event(t)===!0&&(s.ai1ec_convert_commas_to_dots_for_coordinates(),s.ai1ec_check_lat_long_ok_for_search(t));var r=!1,i=[];e("#ai1ec_ticket_url, #ai1ec_contact_url").each(function(){var t=this.value;e(this).removeClass("ai1ec-input-warn"),e(this).closest(".ai1ec-panel-collapse").parent().find(".ai1ec-panel-heading .ai1ec-fa-warning").addClass("ai1ec-hidden").parent().css("color","");if(""!==t){var s=/(http|https):\/\//;if(!s.test(t)){e(this).closest(".ai1ec-panel-collapse").parent().find(".ai1ec-panel-heading .ai1ec-fa-warning").removeClass("ai1ec-hidden").parent().css("color","rgb(255, 79, 79)"),r||e(this).closest(".ai1ec-panel-collapse").collapse("show"),r=!0;var o=e(this).attr("id")+"_not_valid";i.push(n[o]),e(this).addClass("ai1ec-input-warn")}}}),r&&(i.push(n.general_url_not_valid),h(t,i))},d=function(){e("#ai1ec_google_map").click(i.toggle_visibility_of_google_map_on_click),e("#ai1ec_input_coordinates").change(i.toggle_visibility_of_coordinate_fields_on_click),e("#post").submit(p),e("input.ai1ec-coordinates").blur(i.update_map_from_coordinates_on_blur),e("#ai1ec_bottom_publish").on("click",o.trigger_publish),e(document).on("change","#ai1ec_end",o.show_end_fields).on("click","#ai1ec_repeat_apply",o.handle_click_on_apply_button).on("click","#ai1ec_repeat_cancel",o.handle_click_on_cancel_modal).on("click","#ai1ec_monthly_type_bymonthday, #ai1ec_monthly_type_byday",o.handle_checkbox_monthly_tab_modal).on("click",".ai1ec-btn-group-grid a",o.handle_click_on_toggle_buttons),e("#ai1ec_repeat_box").on("hidden.bs.modal",o.handle_modal_hide),o.execute_pseudo_handlers(),e("#widgetField > a").on("click",o.handle_animation_of_calendar_widget),e("#ai1ec_is_free").on("change",u.handle_change_is_free),e(document).on("click",".ai1ec-set-banner-image",v),e(document).on("click",".ai1ec-remove-banner",m)},v=function(){var t={};return t._frame=wp.media({state:"featured-image",states:[new wp.media.controller.FeaturedImage,new wp.media.controller.EditImage]}),t._frame.open(),e(".media-frame:last ").addClass("ai1ec-banner-image-frame"),e(".media-frame-title:last h1").text(e(".ai1ec-set-banner-block .ai1ec-set-banner-image").text()),e(".media-frame-toolbar:last").append(e(".ai1ec-media-toolbar").clone().removeClass("ai1ec-media-toolbar ai1ec-hidden")),e(".ai1ec-save-banner-image").off().on("click",function(){var n=e(".attachments:visible li.selected img").attr("src"),r=e(".attachment-details:visible input[type=text]").val();return n&&r&&e("#ai1ec_event_banner .inside").find(".ai1ec-banner-image-block").removeClass("ai1ec-hidden").find("img").attr("src",n).end().find("input").val(r).end().end().find(".ai1ec-set-banner-block").addClass("ai1ec-hidden").end().find(".ai1ec-remove-banner-block").removeClass("ai1ec-hidden"),t._frame.close(),!1}),!1},m=function(){return e("#ai1ec_event_banner .inside").find(".ai1ec-remove-banner-block").addClass("ai1ec-hidden").end().find(".ai1ec-banner-image-block").addClass("ai1ec-hidden").find("input").val("").end().find("img").attr("src","").end().end().find(".ai1ec-set-banner-block").removeClass("ai1ec-hidden"),!1},g=function(){e("#ai1ec_event").insertAfter("#ai1ec_event_inline_alert"),e("#post").addClass("ai1ec-visible")},y=function(){e("#timezone-select").select2()},b=function(){c(),t(function(){l(),g(),d(),y()})};return{start:b}}),timely.require(["scripts/add_new_event"],function(e){e.start()}),timely.define("pages/add_new_event",function(){});
public/js/pages/admin_settings.js CHANGED
@@ -122,4 +122,4 @@
122
  * limitations under the License.
123
  * ======================================================================== */
124
 
125
- timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("external_libs/bootstrap/tab",["jquery_timely"],function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.ai1ec-dropdown-menu)"),r=t.data("target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("ai1ec-active"))return;var i=n.find(".ai1ec-active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("ai1ec-active").find("> .ai1ec-dropdown-menu > .ai1ec-active").removeClass("ai1ec-active"),t.addClass("ai1ec-active"),s?(t[0].offsetWidth,t.addClass("ai1ec-in")):t.removeClass("ai1ec-fade"),t.parent(".ai1ec-dropdown-menu")&&t.closest("li.ai1ec-dropdown").addClass("ai1ec-active"),r&&r()}var i=n.find("> .ai1ec-active"),s=r&&e.support.transition&&i.hasClass("ai1ec-fade");s?i.one(e.support.transition.end,o).emulateTransitionEnd(150):o(),i.removeClass("ai1ec-in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="ai1ec-tab"], [data-toggle="ai1ec-pill"]',function(t){t.preventDefault(),e(this).tab("show")})}),timely.define("libs/utils",["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert ai1ec-alert-info"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")},add_query_arg:function(e,t){if("string"!=typeof e)return!1;var n=e.indexOf("?")===-1?"?":"&";return-1!==e.indexOf(n+t[0]+"=")?e:e+n+t[0]+"="+t[1]},create_ai1ec_to_send:function(t){var n=e(t),r=[],i=["action","cat_ids","auth_ids","tag_ids","exact_date","display_filters","no_navigation","events_limit"],s=function(e){return e.replace(/\W+(.)/g,function(e,t){return t.toUpperCase()})};return e(i).each(function(e,t){var i=n.data(s(t));i&&r.push(t+"~"+i)}),r.join("|")},init_autoselect:function(){e(document).on("click",".ai1ec-autoselect",function(t){if(e(this).data("clicked")&&t.originalEvent.detail<2)return;e(this).data("clicked",!0);var n;document.body.createTextRange?(n=document.body.createTextRange(),n.moveToElementText(this),n.select()):window.getSelection&&(selection=window.getSelection(),n=document.createRange(),n.selectNodeContents(this),selection.removeAllRanges(),selection.addRange(n))})}}}();return t}),timely.define("scripts/setting/cache/cache_ajax_handlers",["jquery_timely","libs/utils"],function(e,t){var n=function(n){var r=e("#ai1ec-button-refresh"),i=e("#ai1ec-cache-scan-success"),s=e("#ai1ec-cache-scan-danger"),o;r.button("reset"),n.error?o=t.make_alert(n.message,"error"):"0"===n.state?(i.toggleClass("ai1ec-hide",!0),s.toggleClass("ai1ec-hide",!1)):(i.toggleClass("ai1ec-hide",!1),s.toggleClass("ai1ec-hide",!0))};return{handle_rescan_cache:n}}),timely.define("scripts/setting/cache/cache_event_handlers",["jquery_timely","scripts/setting/cache/cache_ajax_handlers","libs/utils"],function(e,t,n){var r=n.get_ajax_url(),i=function(){var n=e(this);n.button("loading");var i={action:"ai1ec_rescan_cache"};return e.post(r,i,t.handle_rescan_cache,"json"),!1};return{perform_rescan:i}}),timely.define("external_libs/bootstrap/button",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r)};t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.is("input")?"val":"html",i=n.data();e+="Text",i.resetText||n.data("resetText",n[r]()),n[r](i[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass("ai1ec-"+t).attr(t,t):n.removeClass("ai1ec-"+t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="ai1ec-buttons"]'),t=!0;if(e.length){var n=this.$element.find("input");n.prop("type")==="radio"&&(n.prop("checked")&&this.$element.hasClass("ai1ec-active")?t=!1:e.find(".ai1ec-active").removeClass("ai1ec-active")),t&&n.prop("checked",!this.$element.hasClass("ai1ec-active")).trigger("change")}t&&this.$element.toggleClass("ai1ec-active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("bs.button"),s=typeof n=="object"&&n;i||r.data("bs.button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api","[data-toggle^=ai1ec-button]",function(t){var n=e(t.target);n.hasClass("ai1ec-btn")||(n=n.closest(".ai1ec-btn")),n.button("toggle"),t.preventDefault()})}),timely.define("external_libs/bootstrap/transition",["jquery_timely"],function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(e.style[n]!==undefined)return{end:t[n]}}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one(e.support.transition.end,function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t()})}),timely.define("external_libs/bootstrap/collapse",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.transitioning=null,this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e=this.$element.hasClass("ai1ec-width");return e?"width":"height"},t.prototype.show=function(){if(this.transitioning||this.$element.hasClass("ai1ec-in"))return;var t=e.Event("show.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.$parent&&this.$parent.find("> .ai1ec-panel > .ai1ec-in");if(n&&n.length){var r=n.data("bs.collapse");if(r&&r.transitioning)return;n.collapse("hide"),r||n.data("bs.collapse",null)}var i=this.dimension();this.$element.removeClass("ai1ec-collapse").addClass("ai1ec-collapsing")[i](0),this.transitioning=1;var s=function(){this.$element.removeClass("ai1ec-collapsing").addClass("ai1ec-in")[i]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return s.call(this);var o=e.camelCase(["scroll",i].join("-"));this.$element.one(e.support.transition.end,e.proxy(s,this)).emulateTransitionEnd(350)[i](this.$element[0][o])},t.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("ai1ec-in"))return;var t=e.Event("hide.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("ai1ec-collapsing").removeClass("ai1ec-collapse").removeClass("ai1ec-in"),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("ai1ec-collapsing").addClass("ai1ec-collapse")};if(!e.support.transition)return r.call(this);this.$element[n](0).one(e.support.transition.end,e.proxy(r,this)).emulateTransitionEnd(350)},t.prototype.toggle=function(){this[this.$element.hasClass("ai1ec-in")?"hide":"show"]()};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("bs.collapse"),s=e.extend({},t.DEFAULTS,r.data(),typeof n=="object"&&n);i||r.data("bs.collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.bs.collapse.data-api","[data-toggle=ai1ec-collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i),o=s.data("bs.collapse"),u=o?"toggle":n.data(),a=n.attr("data-parent"),f=a&&e(a);if(!o||!o.transitioning)f&&f.find('[data-toggle=ai1ec-collapse][data-parent="'+a+'"]').not(n).addClass("ai1ec-collapsed"),n[s.hasClass("ai1ec-in")?"addClass":"removeClass"]("ai1ec-collapsed");s.collapse(u)})}),timely.define("libs/collapse_helper",["jquery_timely","domReady","external_libs/bootstrap/transition","external_libs/bootstrap/collapse"],function(e,t){t(function(){e(document).on("click",'[data-toggle="ai1ec-collapse"]',function(){e(this).toggleClass("ai1ec-active"),e(".ai1ec-fa-caret-down, .ai1ec-fa-caret-up, .ai1ec-fa-chevron-down, .ai1ec-fa-chevron-up, .ai1ec-fa-arrow-down, .ai1ec-fa-arrow-up",this).toggleClass("ai1ec-hide")})})}),timely.define("external_libs/locales/bootstrap-datepicker.bg",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.bg={days:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота","Неделя"],daysShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб","Нед"],daysMin:["Н","П","В","С","Ч","П","С","Н"],months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Ян","Фев","Мар","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Ное","Дек"],today:"днес"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.br",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.br={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.cs",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.cs={days:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota","Neděle"],daysShort:["Ned","Pon","Úte","Stř","Čtv","Pát","Sob","Ned"],daysMin:["Ne","Po","Út","St","Čt","Pá","So","Ne"],months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],monthsShort:["Led","Úno","Bře","Dub","Kvě","Čer","Čnc","Srp","Zář","Říj","Lis","Pro"],today:"Dnes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.da",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.da={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",clear:"Nulstil"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.de",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam","Son"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa","So"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.es",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa","Do"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fi",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai","sunnuntai"],daysShort:["sun","maa","tii","kes","tor","per","lau","sun"],daysMin:["su","ma","ti","ke","to","pe","la","su"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mar","jou"],today:"tänään",weekStart:1,format:"d.m.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fr={days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],daysMin:["D","L","Ma","Me","J","V","S","D"],months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aou","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.id",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","Minggu"],daysShort:["Mgu","Sen","Sel","Rab","Kam","Jum","Sab","Mgu"],daysMin:["Mg","Sn","Sl","Ra","Ka","Ju","Sa","Mg"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],today:"Hari Ini",clear:"Kosongkan"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.is",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.is={days:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur","Sunnudagur"],daysShort:["Sun","Mán","Þri","Mið","Fim","Fös","Lau","Sun"],daysMin:["Su","Má","Þr","Mi","Fi","Fö","La","Su"],months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],today:"Í Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.it",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa","Do"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ja",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ja={days:["日曜","月曜","火曜","水曜","木曜","金曜","土曜","日曜"],daysShort:["日","月","火","水","木","金","土","日"],daysMin:["日","月","火","水","木","金","土","日"],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",format:"yyyy/mm/dd"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.kr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.kr={days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일","일요일"],daysShort:["일","월","화","수","목","금","토","일"],daysMin:["일","월","화","수","목","금","토","일"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis","Sekmadienis"],daysShort:["S","Pr","A","T","K","Pn","Š","S"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","Št","Sk"],months:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"Šiandien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lv={days:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena","Svētdiena"],daysShort:["Sv","P","O","T","C","Pk","S","Sv"],daysMin:["Sv","Pr","Ot","Tr","Ce","Pk","Se","Sv"],months:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],today:"Šodien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ms",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ms={days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu","Ahad"],daysShort:["Aha","Isn","Sel","Rab","Kha","Jum","Sab","Aha"],daysMin:["Ah","Is","Se","Ra","Kh","Ju","Sa","Ah"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],today:"Hari Ini"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nb",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nb={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nl={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pl={days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"],daysShort:["Nie","Pn","Wt","Śr","Czw","Pt","So","Nie"],daysMin:["N","Pn","Wt","Śr","Cz","Pt","So","N"],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],today:"Dzisiaj",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt-BR",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pt={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ru",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ru={days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Воскресенье"],daysShort:["Вск","Пнд","Втр","Срд","Чтв","Птн","Суб","Вск"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб","Вс"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sl={days:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota","Nedelja"],daysShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob","Ned"],daysMin:["Ne","Po","To","Sr","Če","Pe","So","Ne"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sv={days:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],daysShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör","Sön"],daysMin:["Sö","Må","Ti","On","To","Fr","Lö","Sö"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",format:"yyyy-mm-dd",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.th",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.th={days:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"],daysShort:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],daysMin:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],today:"วันนี้"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.tr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.tr={days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi","Pazar"],daysShort:["Pz","Pzt","Sal","Çrş","Prş","Cu","Cts","Pz"],daysMin:["Pz","Pzt","Sa","Çr","Pr","Cu","Ct","Pz"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],today:"Bugün",format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-CN",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-TW",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-TW"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["週日","週一","週二","週三","週四","週五","週六","週日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/bootstrap_datepicker",["jquery_timely","ai1ec_config","external_libs/locales/bootstrap-datepicker.bg","external_libs/locales/bootstrap-datepicker.br","external_libs/locales/bootstrap-datepicker.cs","external_libs/locales/bootstrap-datepicker.da","external_libs/locales/bootstrap-datepicker.de","external_libs/locales/bootstrap-datepicker.es","external_libs/locales/bootstrap-datepicker.fi","external_libs/locales/bootstrap-datepicker.fr","external_libs/locales/bootstrap-datepicker.id","external_libs/locales/bootstrap-datepicker.is","external_libs/locales/bootstrap-datepicker.it","external_libs/locales/bootstrap-datepicker.ja","external_libs/locales/bootstrap-datepicker.kr","external_libs/locales/bootstrap-datepicker.lt","external_libs/locales/bootstrap-datepicker.lv","external_libs/locales/bootstrap-datepicker.ms","external_libs/locales/bootstrap-datepicker.nb","external_libs/locales/bootstrap-datepicker.nl","external_libs/locales/bootstrap-datepicker.pl","external_libs/locales/bootstrap-datepicker.pt-BR","external_libs/locales/bootstrap-datepicker.pt","external_libs/locales/bootstrap-datepicker.ru","external_libs/locales/bootstrap-datepicker.sl","external_libs/locales/bootstrap-datepicker.sv","external_libs/locales/bootstrap-datepicker.th","external_libs/locales/bootstrap-datepicker.tr","external_libs/locales/bootstrap-datepicker.zh-CN","external_libs/locales/bootstrap-datepicker.zh-TW"],function(e,t){function r(){return new Date(Date.UTC.apply(Date,arguments))}function i(){var e=new Date;return r(e.getFullYear(),e.getMonth(),e.getDate())}function s(e){return function(){return this[e].apply(this,arguments)}}function f(t,n){var r=e(t).data(),i={},s,o=new RegExp("^"+n.toLowerCase()+"([A-Z])"),n=new RegExp("^"+n.toLowerCase());for(var u in r)n.test(u)&&(s=u.replace(o,function(e,t){return t.toLowerCase()}),i[s]=r[u]);return i}function l(t){var n={};if(!d[t]){t=t.split("-")[0];if(!d[t])return}var r=d[t];return e.each(p,function(e,t){t in r&&(n[t]=r[t])}),n}var n=e(window),o=function(){var t={get:function(e){return this.slice(e)[0]},contains:function(e){var t=e&&e.valueOf();for(var n=0,r=this.length;n<r;n++)if(this[n].valueOf()===t)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(t){if(!t)return;e.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t)},clear:function(){this.splice(0)},copy:function(){var e=new o;return e.replace(this),e}};return function(){var n=[];return n.push.apply(n,arguments),e.extend(n,t),n}}(),u=function(t,n){this.dates=new o,this.viewDate=i(),this.focusDate=null,this._process_options(n),this.element=e(t),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".ai1ec-date")?this.element.find(".ai1ec-input-group, .ai1ec-input-group-addon, .ai1ec-btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&this.component.length===0&&(this.component=!1),this.picker=e(v.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("ai1ec-datepicker-inline").appendTo(this.element):this.picker.addClass("ai1ec-datepicker-dropdown ai1ec-dropdown-menu"),this.o.rtl&&this.picker.addClass("ai1ec-datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.ai1ec-today").attr("colspan",function(e,t){return parseInt(t)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};u.prototype={constructor:u,_process_options:function(n){this._o=e.extend({},this._o,n);var r=this.o=e.extend({},this._o),i=r.language;d[i]||(i=i.split("-")[0],d[i]||(i=t.language,d[i]||(i=h.language))),r.language=i;switch(r.startView){case 2:case"decade":r.startView=2;break;case 1:case"year":r.startView=1;break;default:r.startView=0}switch(r.minViewMode){case 1:case"months":r.minViewMode=1;break;case 2:case"years":r.minViewMode=2;break;default:r.minViewMode=0}r.startView=Math.max(r.startView,r.minViewMode),r.multidate!==!0&&(r.multidate=Number(r.multidate)||!1,r.multidate!==!1?r.multidate=Math.max(0,r.multidate):r.multidate=1),r.multidateSeparator=String(r.multidateSeparator),r.weekStart%=7,r.weekEnd=(r.weekStart+6)%7;var s=v.parseFormat(r.format);r.startDate!==-Infinity&&(r.startDate?r.startDate instanceof Date?r.startDate=this._local_to_utc(this._zero_time(r.startDate)):r.startDate=v.parseDate(r.startDate,s,r.language):r.startDate=-Infinity),r.endDate!==Infinity&&(r.endDate?r.endDate instanceof Date?r.endDate=this._local_to_utc(this._zero_time(r.endDate)):r.endDate=v.parseDate(r.endDate,s,r.language):r.endDate=Infinity),r.daysOfWeekDisabled=r.daysOfWeekDisabled||[],e.isArray(r.daysOfWeekDisabled)||(r.daysOfWeekDisabled=r.daysOfWeekDisabled.split(/[,\s]*/)),r.daysOfWeekDisabled=e.map(r.daysOfWeekDisabled,function(e){return parseInt(e,10)});var o=String(r.orientation).toLowerCase().split(/\s+/g),u=r.orientation.toLowerCase();o=e.grep(o,function(e){return/^auto|left|right|top|bottom$/.test(e)}),r.orientation={x:"auto",y:"auto"};if(!!u&&u!=="auto")if(o.length===1)switch(o[0]){case"top":case"bottom":r.orientation.y=o[0];break;case"left":case"right":r.orientation.x=o[0]}else u=e.grep(o,function(e){return/^left|right$/.test(e)}),r.orientation.x=u[0]||"auto",u=e.grep(o,function(e){return/^top|bottom$/.test(e)}),r.orientation.y=u[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(r=undefined,i=e[t][1]):e[t].length==3&&(r=e[t][1],i=e[t][2]),n.on(i,r)},_unapplyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(i=undefined,r=e[t][1]):e[t].length==3&&(i=e[t][1],r=e[t][2]),n.off(r,i)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,n){var r=n||this.dates.get(-1),i=this._utc_to_local(r);this.element.trigger({type:t,date:i,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){arguments.length===0?(e=this.dates.length-1,t=this.o.format):typeof e=="string"&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return v.formatDate(n,t,this.o.language)},this)})},show:function(e){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){if(this.isInline)return;if(!this.picker.is(":visible"))return;this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide")},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(e){return e&&new Date(e.getTime()+e.getTimezoneOffset()*6e4)},_local_to_utc:function(e){return e&&new Date(e.getTime()-e.getTimezoneOffset()*6e4)},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){this.update.apply(this,arguments),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){this.update.apply(this,e.map(arguments,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:s("setDates"),setUTCDate:s("setUTCDates"),setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e).change():this.component&&this.element.find("input").val(e).change()},getFormattedDate:function(t){t===undefined&&(t=this.o.format);var n=this.o.language;return e.map(this.dates,function(e){return v.formatDate(e,t,n)}).join(this.o.multidateSeparator)},setStartDate:function(e){this._process_options({startDate:e}),this.update(),this.updateNavArrows()},setEndDate:function(e){this._process_options({endDate:e}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this._process_options({daysOfWeekDisabled:e}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return;var t=this.picker.outerWidth(),r=this.picker.outerHeight(),i=10,s=n.width(),o=n.height(),u=n.scrollTop(),a=parseInt(this.element.parents().filter(function(){return e(this).css("z-index")!="auto"}).first().css("z-index"))+10,f=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),c=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),h=f.left,p=f.top;this.picker.removeClass("ai1ec-datepicker-orient-top ai1ec-datepicker-orient-bottom ai1ec-datepicker-orient-right ai1ec-datepicker-orient-left"),this.o.orientation.x!=="auto"?(this.picker.addClass("ai1ec-datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(h-=t-c)):(this.picker.addClass("ai1ec-datepicker-orient-left"),f.left<0?h-=f.left-i:f.left+t>s&&(h=s-t-i));var d=this.o.orientation.y,v,m;d==="auto"&&(v=-u+f.top-r,m=u+o-(f.top+l+r),Math.max(v,m)===m?d="top":d="bottom"),this.picker.addClass("ai1ec-datepicker-orient-"+d),d==="top"?p+=l:p-=r+parseInt(this.picker.css("padding-top")),this.picker.css({top:p,left:h,zIndex:a})},_allow_update:!0,update:function(){if(!this._allow_update)return;var t=this.dates.copy(),n=[],r=!1;arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),r=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),n&&this.o.multidate?n=n.split(this.o.multidateSeparator):n=[n],delete this.element.data().date),n=e.map(n,e.proxy(function(e){return v.parseDate(e,this.o.format,this.o.language)},this)),n=e.grep(n,e.proxy(function(e){return e<this.o.startDate||e>this.o.endDate||!e},this),!0),this.dates.replace(n),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),r?this.setValue():n.length&&String(t)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&t.length&&this._trigger("clearDate"),this.fill()},fillDow:function(){var e=this.o.weekStart,t="<tr>";if(this.o.calendarWeeks){var n='<th class="ai1ec-cw">&nbsp;</th>';t+=n,this.picker.find(".ai1ec-datepicker-days thead tr:first-child").prepend(n)}while(e<this.o.weekStart+7)t+='<th class="ai1ec-dow">'+d[this.o.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".ai1ec-datepicker-days thead").append(t)},fillMonths:function(){var e="",t=0;while(t<12)e+='<span class="ai1ec-month">'+d[this.o.language].monthsShort[t++]+"</span>";this.picker.find(".ai1ec-datepicker-months td").html(e)},setRange:function(t){!t||!t.length?delete this.range:this.range=e.map(t,function(e){return e.valueOf()}),this.fill()},getClassNames:function(t){var n=[],r=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),s=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()==r&&t.getUTCMonth()<i?n.push("ai1ec-old"):(t.getUTCFullYear()>r||t.getUTCFullYear()==r&&t.getUTCMonth()>i)&&n.push("ai1ec-new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&n.push("ai1ec-focused"),this.o.todayHighlight&&t.getUTCFullYear()==s.getFullYear()&&t.getUTCMonth()==s.getMonth()&&t.getUTCDate()==s.getDate()&&n.push("ai1ec-today"),this.dates.contains(t)!==-1&&n.push("ai1ec-active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&n.push("ai1ec-disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&n.push("ai1ec-range"),e.inArray(t.valueOf(),this.range)!=-1&&n.push("ai1ec-selected")),n},fill:function(){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth(),s=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,o=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,u=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,a=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,f,l;this.picker.find(".ai1ec-datepicker-days thead th.ai1ec-datepicker-switch").text(d[this.o.language].months[i]+" "+n),this.picker.find("tfoot th.ai1ec-today").text(d[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.ai1ec-clear").text(d[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var c=r(n,i-1,28),h=v.getDaysInMonth(c.getUTCFullYear(),c.getUTCMonth());c.setUTCDate(h),c.setUTCDate(h-(c.getUTCDay()-this.o.weekStart+7)%7);var p=new Date(c);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();var m=[],g;while(c.valueOf()<p){if(c.getUTCDay()==this.o.weekStart){m.push("<tr>");if(this.o.calendarWeeks){var y=new Date(+c+(this.o.weekStart-c.getUTCDay()-7)%7*864e5),b=new Date(+y+(11-y.getUTCDay())%7*864e5),w=new Date(+(w=r(b.getUTCFullYear(),0,1))+(11-w.getUTCDay())%7*864e5),E=(b-w)/864e5/7+1;m.push('<td class="ai1ec-cw">'+E+"</td>")}}g=this.getClassNames(c),g.push("ai1ec-day");if(this.o.beforeShowDay!==e.noop){var S=this.o.beforeShowDay(this._utc_to_local(c));S===undefined?S={}:typeof S=="boolean"?S={enabled:S}:typeof S=="string"&&(S={classes:S}),S.enabled===!1&&g.push("ai1ec-disabled"),S.classes&&(g=g.concat(S.classes.split(/\s+/))),S.tooltip&&(f=S.tooltip)}g=e.unique(g),m.push('<td class="'+g.join(" ")+'"'+(f?' title="'+f+'"':"")+">"+c.getUTCDate()+"</td>"),c.getUTCDay()==this.o.weekEnd&&m.push("</tr>"),c.setUTCDate(c.getUTCDate()+1)}this.picker.find(".ai1ec-datepicker-days tbody").empty().append(m.join(""));var x=this.picker.find(".ai1ec-datepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("ai1ec-active");e.each(this.dates,function(e,t){t.getUTCFullYear()==n&&x.eq(t.getUTCMonth()).addClass("ai1ec-active")}),(n<s||n>u)&&x.addClass("ai1ec-disabled"),n==s&&x.slice(0,o).addClass("ai1ec-disabled"),n==u&&x.slice(a+1).addClass("ai1ec-disabled"),m="",n=parseInt(n/10,10)*10;var T=this.picker.find(".ai1ec-datepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;var N=e.map(this.dates,function(e){return e.getUTCFullYear()}),C;for(var k=-1;k<11;k++)C=["ai1ec-year"],k===-1?C.push("ai1ec-old"):k===10&&C.push("ai1ec-new"),e.inArray(n,N)!==-1&&C.push("ai1ec-active"),(n<s||n>u)&&C.push("ai1ec-disabled"),m+='<span class="'+C.join(" ")+'">'+n+"</span>",n+=1;T.html(m)},updateNavArrows:function(){if(!this._allow_update)return;var e=new Date(this.viewDate),t=e.getUTCFullYear(),n=e.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()&&n<=this.o.startDate.getUTCMonth()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()&&n>=this.o.endDate.getUTCMonth()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"})}},click:function(t){t.preventDefault();var n=e(t.target).closest("span, td, th"),i,s,o;if(n.length==1)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"ai1ec-datepicker-switch":this.showMode(1);break;case"ai1ec-prev":case"ai1ec-next":var u=v.modes[this.viewMode].navStep*(n[0].className=="ai1ec-prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,u),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,u),this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"ai1ec-today":var a=new Date;a=r(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0),this.showMode(-2);var f=this.o.todayBtn=="linked"?null:"view";this._setDate(a,f);break;case"ai1ec-clear":var l;this.isInput?l=this.element:this.component&&(l=this.element.find("input")),l&&l.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":n.is(".ai1ec-disabled")||(this.viewDate.setUTCDate(1),n.is(".ai1ec-month")?(o=1,s=n.parent().find("span").index(n),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(s),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(r(i,s,o))):(o=1,s=0,i=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(i),this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(r(i,s,o))),this.showMode(-1),this.fill());break;case"td":n.is(".ai1ec-day")&&!n.is(".ai1ec-disabled")&&(o=parseInt(n.text(),10)||1,i=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n.is(".ai1ec-old")?s===0?(s=11,i-=1):s-=1:n.is(".ai1ec-new")&&(s==11?(s=0,i+=1):s+=1),this._setDate(r(i,s,o)))}this.picker.is(":visible")&&this._focused_from&&e(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(e){var t=this.dates.contains(e);e?t!==-1?this.dates.remove(t):this.dates.push(e):this.dates.clear();if(typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(e,t){(!t||t=="date")&&this._toggle_multidate(e&&new Date(e));if(!t||t=="view")this.viewDate=e&&new Date(e);this.fill(),this.setValue(),this._trigger("changeDate");var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),this.o.autoclose&&(!t||t=="date")&&this.hide()},moveMonth:function(e,t){if(!e)return undefined;if(!t)return e;var n=new Date(e.valueOf()),r=n.getUTCDate(),i=n.getUTCMonth(),s=Math.abs(t),o,u;t=t>0?1:-1;if(s==1){u=t==-1?function(){return n.getUTCMonth()==i}:function(){return n.getUTCMonth()!=o},o=i+t,n.setUTCMonth(o);if(o<0||o>11)o=(o+12)%12}else{for(var a=0;a<s;a++)n=this.moveMonth(n,t);o=n.getUTCMonth(),n.setUTCDate(r),u=function(){return o!=n.getUTCMonth()}}while(u())n.setUTCDate(--r),n.setUTCMonth(o);return n},moveYear:function(e,t){return this.moveMonth(e,t*12)},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":not(:visible)")){e.keyCode==27&&this.show();return}var t=!1,n,r,s,o=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;n=e.keyCode==37?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n),s=new Date(o),s.setUTCDate(o.getUTCDate()+n)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;n=e.keyCode==38?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n*7),s=new Date(o),s.setUTCDate(o.getUTCDate()+n*7)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 32:break;case 13:o=this.focusDate||this.dates.get(-1)||this.viewDate,this._toggle_multidate(o),t=!0,this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(t){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var u;this.isInput?u=this.element:this.component&&(u=this.element.find("input")),u&&u.change()}},showMode:function(e){e&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+e))),this.picker.find(">div").hide().filter(".ai1ec-datepicker-"+v.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var a=function(t,n){this.element=e(t),this.inputs=e.map(n.inputs,function(e){return e.jquery?e[0]:e}),delete n.inputs,e(this.inputs).datepicker(n).bind("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e(t).data("datepicker")}),this.updateDates()};a.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,n){n.setRange(t)})},dateUpdated:function(t){if(this.updating)return;this.updating=!0;var n=e(t.target).data("datepicker"),r=n.getUTCDate(),i=e.inArray(t.target,this.inputs),s=this.inputs.length;if(i==-1)return;e.each(this.pickers,function(e,t){t.getUTCDate()||t.setUTCDate(r)});if(r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<s&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates(),delete this.updating},remove:function(){e.map(this.pickers,function(e){e.remove()}),delete this.element.data().datepicker}};var c=e.fn.datepicker;e.fn.datepicker=function(t){var n=Array.apply(null,arguments);n.shift();var r;return this.each(function(){var i=e(this),s=i.data("datepicker"),o=typeof t=="object"&&t;if(!s){var c=f(this,"date"),p=e.extend({},h,c,o),d=l(p.language),v=e.extend({},h,d,c,o);if(i.is(".ai1ec-input-daterange")||v.inputs){var m={inputs:v.inputs||i.find("input").toArray()};i.data("datepicker",s=new a(this,e.extend(v,m)))}else i.data("datepicker",s=new u(this,v))}if(typeof t=="string"&&typeof s[t]=="function"){r=s[t].apply(s,n);if(r!==undefined)return!1}}),r!==undefined?r:this};var h=e.fn.datepicker.defaults={autoclose:!1,beforeShowDay:e.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},p=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=u;var d=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},v={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},getDaysInMonth:function(e,t){return[31,v.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(e){var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||n.length===0)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(t,n,i){if(!t)return undefined;if(t instanceof Date)return t;typeof n=="string"&&(n=v.parseFormat(n));if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(t)){var s=/([\-+]\d+)([dmwy])/,o=t.match(/([\-+]\d+)([dmwy])/g),a,f;t=new Date;for(var l=0;l<o.length;l++){a=s.exec(o[l]),f=parseInt(a[1]);switch(a[2]){case"d":t.setUTCDate(t.getUTCDate()+f);break;case"m":t=u.prototype.moveMonth.call(u.prototype,t,f);break;case"w":t.setUTCDate(t.getUTCDate()+f*7);break;case"y":t=u.prototype.moveYear.call(u.prototype,t,f)}}return r(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),0,0,0)}var o=t&&t.match(this.nonpunctuation)||[],t=new Date,c={},h=["yyyy","yy","M","MM","m","mm","d","dd"],p={yyyy:function(e,t){return e.setUTCFullYear(t)},yy:function(e,t){return e.setUTCFullYear(2e3+t)},m:function(e,t){if(isNaN(e))return e;t-=1;while(t<0)t+=12;t%=12,e.setUTCMonth(t);while(e.getUTCMonth()!=t)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}},m,g,a;p.M=p.MM=p.mm=p.m,p.dd=p.d,t=r(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);var y=n.parts.slice();o.length!=y.length&&(y=e(y).filter(function(t,n){return e.inArray(n,h)!==-1}).toArray());if(o.length==y.length){for(var l=0,b=y.length;l<b;l++){m=parseInt(o[l],10),a=y[l];if(isNaN(m))switch(a){case"MM":g=e(d[i].months).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].months)+1;break;case"M":g=e(d[i].monthsShort).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].monthsShort)+1}c[a]=m}for(var l=0,w,E;l<h.length;l++)E=h[l],E in c&&!isNaN(c[E])&&(w=new Date(t),p[E](w,c[E]),isNaN(w)||(t=w))}return t},formatDate:function(t,n,r){if(!t)return"";typeof n=="string"&&(n=v.parseFormat(n));var i={d:t.getUTCDate(),D:d[r].daysShort[t.getUTCDay()],DD:d[r].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:d[r].monthsShort[t.getUTCMonth()],MM:d[r].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m;var t=[],s=e.extend([],n.separators);for(var o=0,u=n.parts.length;o<=u;o++)s.length&&t.push(s.shift()),t.push(i[n.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="ai1ec-prev"><i class="ai1ec-fa ai1ec-fa-arrow-left"></i></th><th colspan="5" class="ai1ec-datepicker-switch"></th><th class="ai1ec-next"><i class="ai1ec-fa ai1ec-fa-arrow-right"></i></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="ai1ec-today"></th></tr><tr><th colspan="7" class="ai1ec-clear"></th></tr></tfoot>'};v.template='<div class="timely ai1ec-datepicker"><div class="ai1ec-datepicker-days"><table class=" ai1ec-table-condensed">'+v.headTemplate+"<tbody></tbody>"+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-months">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-years">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+"</div>",e.fn.datepicker.DPGlobal=v,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=c,this},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var n=e(this);if(n.data("datepicker"))return;t.preventDefault(),n.datepicker("show")}),e(function(){e('[data-provide="datepicker-inline"]').datepicker()});for(var m=2,g=arguments.length;m<g;m++)arguments[m].localize()}),timely.define("external_libs/bootstrap/tooltip",["jquery_timely"],function(e){var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,r){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r);var i=this.options.trigger.split(" ");for(var s=i.length;s--;){var o=i[s];if(o=="click")this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if(o!="manual"){var u=o=="hover"?"mouseenter":"focus",a=o=="hover"?"mouseleave":"blur";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},t.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="in";if(!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="out";if(!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.tip();this.setContent(),this.options.animation&&n.addClass("ai1ec-fade");var r=typeof this.options.placement=="function"?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,s=i.test(r);s&&(r=r.replace(i,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass("ai1ec-"+r),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var o=this.getPosition(),u=n[0].offsetWidth,a=n[0].offsetHeight;if(s){var f=this.$element.parent(),l=r,c=document.documentElement.scrollTop||document.body.scrollTop,h=this.options.container=="body"?window.innerWidth:f.outerWidth(),p=this.options.container=="body"?window.innerHeight:f.outerHeight(),d=this.options.container=="body"?0:f.offset().left;r=r=="bottom"&&o.top+o.height+a-c>p?"top":r=="top"&&o.top-c-a<0?"bottom":r=="right"&&o.right+u>h?"left":r=="left"&&o.left-u<d?"right":r,n.removeClass("ai1ec-"+l).addClass("ai1ec-"+r)}var v=this.getCalculatedOffset(r,o,u,a);this.applyPlacement(v,r),this.$element.trigger("shown.bs."+this.type)}},t.prototype.applyPlacement=function(e,t){var n,r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),e.top=e.top+o,e.left=e.left+u,r.offset(e).addClass("ai1ec-in");var a=r[0].offsetWidth,f=r[0].offsetHeight;t=="top"&&f!=s&&(n=!0,e.top=e.top+s-f);if(/bottom|top/.test(t)){var l=0;e.left<0&&(l=e.left*-2,e.left=0,r.offset(e),a=r[0].offsetWidth,f=r[0].offsetHeight),this.replaceArrow(l-i+a,a,"left")}else this.replaceArrow(f-s,f,"top");n&&r.offset(e)},t.prototype.replaceArrow=function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".ai1ec-tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("ai1ec-fade ai1ec-in ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right")},t.prototype.hide=function(){function i(){t.hoverState!="in"&&n.detach()}var t=this,n=this.tip(),r=e.Event("hide.bs."+this.type);this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("ai1ec-in"),e.support.transition&&this.$tip.hasClass("ai1ec-fade")?n.one(e.support.transition.end,i).emulateTransitionEnd(150):i(),this.$element.trigger("hidden.bs."+this.type),this},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getCalculatedOffset=function(e,t,n,r){return e=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-n/2}:e=="top"?{top:t.top-r,left:t.left+t.width/2-n/2}:e=="left"?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},t.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var n=t?e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;n.tip().hasClass("ai1ec-in")?n.leave(n):n.enter(n)},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s=typeof n=="object"&&n;i||r.data("bs.tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}),timely.define("external_libs/jquery_cookie",["jquery_timely"],function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function r(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function s(e){e.indexOf('"')===0&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(t," ")),u.json?JSON.parse(e):e}catch(n){}}function o(t,n){var r=u.raw?t:s(t);return e.isFunction(n)?n(r):r}var t=/\+/g,u=e.cookie=function(t,s,a){if(s!==undefined&&!e.isFunction(s)){a=e.extend({},u.defaults,a);if(typeof a.expires=="number"){var f=a.expires,l=a.expires=new Date;l.setTime(+l+f*864e5)}return document.cookie=[n(t),"=",i(s),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=t?undefined:{},h=document.cookie?document.cookie.split("; "):[];for(var p=0,d=h.length;p<d;p++){var v=h[p].split("="),m=r(v.shift()),g=v.join("=");if(t&&t===m){c=o(g,s);break}!t&&(g=o(g))!==undefined&&(c[m]=g)}return c};u.defaults={},e.removeCookie=function(t,n){return e.cookie(t)===undefined?!1:(e.cookie(t,"",e.extend({},n,{expires:-1})),!e.cookie(t))}}),timely.define("scripts/admin_settings",["jquery_timely","domReady","ai1ec_config","libs/utils","scripts/setting/cache/cache_event_handlers","external_libs/bootstrap/button","libs/collapse_helper","external_libs/bootstrap/tab","external_libs/bootstrap_datepicker","external_libs/bootstrap/tooltip","external_libs/jquery_cookie"],function(e,t,n,r,i){var s=function(){var t=!0;e("#ai1ec-plugins-settings input:text").each(function(){this.value!==""&&(t=!1)}),t===!0&&e("#ai1ec-plugins-settings").remove()},o=function(t){var n=e(this).attr("href");e.cookie("ai1ec_general_settings_active_tab",n)},u=function(){var t=e("#week_view_starts_at"),r=e("#week_view_ends_at"),i=parseInt(t.val(),10),s=parseInt(r.val(),10);if(s<i)return window.alert(n.end_must_be_after_start),r.focus(),!1;var o=s-i;if(o<6)return window.alert(n.show_at_least_six_hours),r.focus(),!1},a=function(){e(".ai1ec-gzip-causes-js-failure").remove()},f=function(){e("#ai1ec_save_settings").on("click",function(t){var r=e("#require_disclaimer").is(":checked"),i=e("#disclaimer").val();!0===r&&""===i&&(alert(n.require_desclaimer),e('#ai1ec-general-settings ul.ai1ec-nav a[href="#ai1ec-advanced"]').tab("show"),e("#disclaimer").focus(),t.preventDefault())})},l=function(){e("fieldset.ai1ec-captcha_provider").addClass("ai1ec-hidden"),e(".ai1ec-"+e(this).val()).removeClass("ai1ec-hidden")},c=function(){t(function(){f(),a(),r.activate_saved_tab_on_page_load(e.cookie("ai1ec_general_settings_active_tab")),e(document).on("click",'#ai1ec-general-settings .ai1ec-nav a[data-toggle="ai1ec-tab"]',o),e(document).on("click","#disable_standard_filter_menu_toggler",function(e){e.preventDefault()}),e(document).on("click","#ai1ec-button-refresh",i.perform_rescan);var t=e("#exact_date");t.datepicker({autoclose:!0}),s(),e(document).on("click",".ai1ec-admin-view-settings .ai1ec-toggle-view",function(){var t=e(this),n=t.parent().index()+1;if(0===t.closest("tr").siblings().find("td:nth-child("+n+") .ai1ec-toggle-view:checked").length)return!1;if(t.parent().next("td").find(".ai1ec-toggle-default-view").is(":checked"))return!1});var n=function(){var t=e(this).closest(".ai1ec-form-group").nextAll(".ai1ec-form-group").slice(0,4);e(this).prop("checked")?t.show():t.hide()};n.apply(e("#affix_filter_menu").on("click",n)[0]),e(document).on("click",".ai1ec-admin-view-settings .ai1ec-toggle-default-view",function(){e(this).parent().prev("td").children(".ai1ec-toggle-view").prop("checked",!0)}),e(document).on("change","#captcha_provider",l),r.init_autoselect(),e("#ai1ec_save_settings").on("click",u),e("#show_create_event_button").trigger("ready")})};return{start:c}}),timely.require(["scripts/admin_settings"],function(e){e.start()}),timely.define("pages/admin_settings",function(){});
122
  * limitations under the License.
123
  * ======================================================================== */
124
 
125
+ timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("external_libs/bootstrap/tab",["jquery_timely"],function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.ai1ec-dropdown-menu)"),r=t.data("target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("ai1ec-active"))return;var i=n.find(".ai1ec-active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("ai1ec-active").find("> .ai1ec-dropdown-menu > .ai1ec-active").removeClass("ai1ec-active"),t.addClass("ai1ec-active"),s?(t[0].offsetWidth,t.addClass("ai1ec-in")):t.removeClass("ai1ec-fade"),t.parent(".ai1ec-dropdown-menu")&&t.closest("li.ai1ec-dropdown").addClass("ai1ec-active"),r&&r()}var i=n.find("> .ai1ec-active"),s=r&&e.support.transition&&i.hasClass("ai1ec-fade");s?i.one(e.support.transition.end,o).emulateTransitionEnd(150):o(),i.removeClass("ai1ec-in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="ai1ec-tab"], [data-toggle="ai1ec-pill"]',function(t){t.preventDefault(),e(this).tab("show")})}),timely.define("libs/utils",["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert ai1ec-alert-info"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")},add_query_arg:function(e,t){if("string"!=typeof e)return!1;var n=e.indexOf("?")===-1?"?":"&";return-1!==e.indexOf(n+t[0]+"=")?e:e+n+t[0]+"="+t[1]},create_ai1ec_to_send:function(t){var n=e(t),r=[],i=["action","cat_ids","auth_ids","tag_ids","exact_date","display_filters","no_navigation","events_limit"];return n.each(function(){e.each(this.attributes,function(){this.specified&&this.value&&this.name.match(/^data-/)&&(-1<e.inArray(this.name.replace(/^data\-/,""),i)||this.name.match(/_ids$/))&&r.push(this.name.replace(/^data\-/,"")+"~"+this.value)})}),r.join("|")},init_autoselect:function(){e(document).on("click",".ai1ec-autoselect",function(t){if(e(this).data("clicked")&&t.originalEvent.detail<2)return;e(this).data("clicked",!0);var n;document.body.createTextRange?(n=document.body.createTextRange(),n.moveToElementText(this),n.select()):window.getSelection&&(selection=window.getSelection(),n=document.createRange(),n.selectNodeContents(this),selection.removeAllRanges(),selection.addRange(n))})}}}();return t}),timely.define("scripts/setting/cache/cache_ajax_handlers",["jquery_timely","libs/utils"],function(e,t){var n=function(n){var r=e("#ai1ec-button-refresh"),i=e("#ai1ec-cache-scan-success"),s=e("#ai1ec-cache-scan-danger"),o;r.button("reset"),n.error?o=t.make_alert(n.message,"error"):"0"===n.state?(i.toggleClass("ai1ec-hide",!0),s.toggleClass("ai1ec-hide",!1)):(i.toggleClass("ai1ec-hide",!1),s.toggleClass("ai1ec-hide",!0))};return{handle_rescan_cache:n}}),timely.define("scripts/setting/cache/cache_event_handlers",["jquery_timely","scripts/setting/cache/cache_ajax_handlers","libs/utils"],function(e,t,n){var r=n.get_ajax_url(),i=function(){var n=e(this);n.button("loading");var i={action:"ai1ec_rescan_cache"};return e.post(r,i,t.handle_rescan_cache,"json"),!1};return{perform_rescan:i}}),timely.define("external_libs/bootstrap/button",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r)};t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.is("input")?"val":"html",i=n.data();e+="Text",i.resetText||n.data("resetText",n[r]()),n[r](i[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass("ai1ec-"+t).attr(t,t):n.removeClass("ai1ec-"+t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="ai1ec-buttons"]'),t=!0;if(e.length){var n=this.$element.find("input");n.prop("type")==="radio"&&(n.prop("checked")&&this.$element.hasClass("ai1ec-active")?t=!1:e.find(".ai1ec-active").removeClass("ai1ec-active")),t&&n.prop("checked",!this.$element.hasClass("ai1ec-active")).trigger("change")}t&&this.$element.toggleClass("ai1ec-active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("bs.button"),s=typeof n=="object"&&n;i||r.data("bs.button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api","[data-toggle^=ai1ec-button]",function(t){var n=e(t.target);n.hasClass("ai1ec-btn")||(n=n.closest(".ai1ec-btn")),n.button("toggle"),t.preventDefault()})}),timely.define("external_libs/bootstrap/transition",["jquery_timely"],function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(e.style[n]!==undefined)return{end:t[n]}}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one(e.support.transition.end,function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t()})}),timely.define("external_libs/bootstrap/collapse",["jquery_timely"],function(e){var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.transitioning=null,this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e=this.$element.hasClass("ai1ec-width");return e?"width":"height"},t.prototype.show=function(){if(this.transitioning||this.$element.hasClass("ai1ec-in"))return;var t=e.Event("show.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.$parent&&this.$parent.find("> .ai1ec-panel > .ai1ec-in");if(n&&n.length){var r=n.data("bs.collapse");if(r&&r.transitioning)return;n.collapse("hide"),r||n.data("bs.collapse",null)}var i=this.dimension();this.$element.removeClass("ai1ec-collapse").addClass("ai1ec-collapsing")[i](0),this.transitioning=1;var s=function(){this.$element.removeClass("ai1ec-collapsing").addClass("ai1ec-in")[i]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return s.call(this);var o=e.camelCase(["scroll",i].join("-"));this.$element.one(e.support.transition.end,e.proxy(s,this)).emulateTransitionEnd(350)[i](this.$element[0][o])},t.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("ai1ec-in"))return;var t=e.Event("hide.bs.collapse");this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("ai1ec-collapsing").removeClass("ai1ec-collapse").removeClass("ai1ec-in"),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("ai1ec-collapsing").addClass("ai1ec-collapse")};if(!e.support.transition)return r.call(this);this.$element[n](0).one(e.support.transition.end,e.proxy(r,this)).emulateTransitionEnd(350)},t.prototype.toggle=function(){this[this.$element.hasClass("ai1ec-in")?"hide":"show"]()};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("bs.collapse"),s=e.extend({},t.DEFAULTS,r.data(),typeof n=="object"&&n);i||r.data("bs.collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.bs.collapse.data-api","[data-toggle=ai1ec-collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i),o=s.data("bs.collapse"),u=o?"toggle":n.data(),a=n.attr("data-parent"),f=a&&e(a);if(!o||!o.transitioning)f&&f.find('[data-toggle=ai1ec-collapse][data-parent="'+a+'"]').not(n).addClass("ai1ec-collapsed"),n[s.hasClass("ai1ec-in")?"addClass":"removeClass"]("ai1ec-collapsed");s.collapse(u)})}),timely.define("libs/collapse_helper",["jquery_timely","domReady","external_libs/bootstrap/transition","external_libs/bootstrap/collapse"],function(e,t){t(function(){e(document).on("click",'[data-toggle="ai1ec-collapse"]',function(){e(this).toggleClass("ai1ec-active"),e(".ai1ec-fa-caret-down, .ai1ec-fa-caret-up, .ai1ec-fa-chevron-down, .ai1ec-fa-chevron-up, .ai1ec-fa-arrow-down, .ai1ec-fa-arrow-up",this).toggleClass("ai1ec-hide")})})}),timely.define("external_libs/locales/bootstrap-datepicker.bg",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.bg={days:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота","Неделя"],daysShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб","Нед"],daysMin:["Н","П","В","С","Ч","П","С","Н"],months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Ян","Фев","Мар","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Ное","Дек"],today:"днес"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.br",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.br={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.cs",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.cs={days:["Neděle","Pondělí","Úterý","Středa","Čtvrtek","Pátek","Sobota","Neděle"],daysShort:["Ned","Pon","Úte","Stř","Čtv","Pát","Sob","Ned"],daysMin:["Ne","Po","Út","St","Čt","Pá","So","Ne"],months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],monthsShort:["Led","Úno","Bře","Dub","Kvě","Čer","Čnc","Srp","Zář","Říj","Lis","Pro"],today:"Dnes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.da",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.da={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",clear:"Nulstil"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.de",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam","Son"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa","So"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.es",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"],daysShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb","Dom"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa","Do"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fi",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai","sunnuntai"],daysShort:["sun","maa","tii","kes","tor","per","lau","sun"],daysMin:["su","ma","ti","ke","to","pe","la","su"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mar","jou"],today:"tänään",weekStart:1,format:"d.m.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.fr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.fr={days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],daysMin:["D","L","Ma","Me","J","V","S","D"],months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Jui","Jul","Aou","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.id",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu","Minggu"],daysShort:["Mgu","Sen","Sel","Rab","Kam","Jum","Sab","Mgu"],daysMin:["Mg","Sn","Sl","Ra","Ka","Ju","Sa","Mg"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],today:"Hari Ini",clear:"Kosongkan"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.is",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.is={days:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur","Sunnudagur"],daysShort:["Sun","Mán","Þri","Mið","Fim","Fös","Lau","Sun"],daysMin:["Su","Má","Þr","Mi","Fi","Fö","La","Su"],months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],today:"Í Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.it",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa","Do"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ja",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ja={days:["日曜","月曜","火曜","水曜","木曜","金曜","土曜","日曜"],daysShort:["日","月","火","水","木","金","土","日"],daysMin:["日","月","火","水","木","金","土","日"],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",format:"yyyy/mm/dd"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.kr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.kr={days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일","일요일"],daysShort:["일","월","화","수","목","금","토","일"],daysMin:["일","월","화","수","목","금","토","일"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis","Sekmadienis"],daysShort:["S","Pr","A","T","K","Pn","Š","S"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","Št","Sk"],months:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"Šiandien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.lv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.lv={days:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena","Svētdiena"],daysShort:["Sv","P","O","T","C","Pk","S","Sv"],daysMin:["Sv","Pr","Ot","Tr","Ce","Pk","Se","Sv"],months:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],today:"Šodien",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ms",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ms={days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu","Ahad"],daysShort:["Aha","Isn","Sel","Rab","Kha","Jum","Sab","Aha"],daysMin:["Ah","Is","Se","Ra","Kh","Ju","Sa","Ah"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],today:"Hari Ini"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nb",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nb={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"I Dag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.nl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.nl={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pl={days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"],daysShort:["Nie","Pn","Wt","Śr","Czw","Pt","So","Nie"],daysMin:["N","Pn","Wt","Śr","Cz","Pt","So","N"],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],today:"Dzisiaj",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt-BR",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.pt",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.pt={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado","Domingo"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb","Dom"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa","Do"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",clear:"Limpar"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.ru",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.ru={days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота","Воскресенье"],daysShort:["Вск","Пнд","Втр","Срд","Чтв","Птн","Суб","Вск"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб","Вс"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sl",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sl={days:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota","Nedelja"],daysShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob","Ned"],daysMin:["Ne","Po","To","Sr","Če","Pe","So","Ne"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danes"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.sv",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.sv={days:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag","Söndag"],daysShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör","Sön"],daysMin:["Sö","Må","Ti","On","To","Fr","Lö","Sö"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",format:"yyyy-mm-dd",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.th",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.th={days:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"],daysShort:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],daysMin:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],today:"วันนี้"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.tr",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates.tr={days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi","Pazar"],daysShort:["Pz","Pzt","Sal","Çrş","Prş","Cu","Cts","Pz"],daysMin:["Pz","Pzt","Sa","Çr","Pr","Cu","Ct","Pz"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],today:"Bugün",format:"dd.mm.yyyy"}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-CN",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/locales/bootstrap-datepicker.zh-TW",["jquery_timely"],function(e){return{localize:function(){e.fn.datepicker.dates["zh-TW"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["週日","週一","週二","週三","週四","週五","週六","週日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",format:"yyyy年mm月dd日",weekStart:1}}}}),timely.define("external_libs/bootstrap_datepicker",["jquery_timely","ai1ec_config","external_libs/locales/bootstrap-datepicker.bg","external_libs/locales/bootstrap-datepicker.br","external_libs/locales/bootstrap-datepicker.cs","external_libs/locales/bootstrap-datepicker.da","external_libs/locales/bootstrap-datepicker.de","external_libs/locales/bootstrap-datepicker.es","external_libs/locales/bootstrap-datepicker.fi","external_libs/locales/bootstrap-datepicker.fr","external_libs/locales/bootstrap-datepicker.id","external_libs/locales/bootstrap-datepicker.is","external_libs/locales/bootstrap-datepicker.it","external_libs/locales/bootstrap-datepicker.ja","external_libs/locales/bootstrap-datepicker.kr","external_libs/locales/bootstrap-datepicker.lt","external_libs/locales/bootstrap-datepicker.lv","external_libs/locales/bootstrap-datepicker.ms","external_libs/locales/bootstrap-datepicker.nb","external_libs/locales/bootstrap-datepicker.nl","external_libs/locales/bootstrap-datepicker.pl","external_libs/locales/bootstrap-datepicker.pt-BR","external_libs/locales/bootstrap-datepicker.pt","external_libs/locales/bootstrap-datepicker.ru","external_libs/locales/bootstrap-datepicker.sl","external_libs/locales/bootstrap-datepicker.sv","external_libs/locales/bootstrap-datepicker.th","external_libs/locales/bootstrap-datepicker.tr","external_libs/locales/bootstrap-datepicker.zh-CN","external_libs/locales/bootstrap-datepicker.zh-TW"],function(e,t){function r(){return new Date(Date.UTC.apply(Date,arguments))}function i(){var e=new Date;return r(e.getFullYear(),e.getMonth(),e.getDate())}function s(e){return function(){return this[e].apply(this,arguments)}}function f(t,n){var r=e(t).data(),i={},s,o=new RegExp("^"+n.toLowerCase()+"([A-Z])"),n=new RegExp("^"+n.toLowerCase());for(var u in r)n.test(u)&&(s=u.replace(o,function(e,t){return t.toLowerCase()}),i[s]=r[u]);return i}function l(t){var n={};if(!d[t]){t=t.split("-")[0];if(!d[t])return}var r=d[t];return e.each(p,function(e,t){t in r&&(n[t]=r[t])}),n}var n=e(window),o=function(){var t={get:function(e){return this.slice(e)[0]},contains:function(e){var t=e&&e.valueOf();for(var n=0,r=this.length;n<r;n++)if(this[n].valueOf()===t)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(t){if(!t)return;e.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t)},clear:function(){this.splice(0)},copy:function(){var e=new o;return e.replace(this),e}};return function(){var n=[];return n.push.apply(n,arguments),e.extend(n,t),n}}(),u=function(t,n){this.dates=new o,this.viewDate=i(),this.focusDate=null,this._process_options(n),this.element=e(t),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".ai1ec-date")?this.element.find(".ai1ec-input-group, .ai1ec-input-group-addon, .ai1ec-btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&this.component.length===0&&(this.component=!1),this.picker=e(v.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("ai1ec-datepicker-inline").appendTo(this.element):this.picker.addClass("ai1ec-datepicker-dropdown ai1ec-dropdown-menu"),this.o.rtl&&this.picker.addClass("ai1ec-datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.ai1ec-today").attr("colspan",function(e,t){return parseInt(t)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};u.prototype={constructor:u,_process_options:function(n){this._o=e.extend({},this._o,n);var r=this.o=e.extend({},this._o),i=r.language;d[i]||(i=i.split("-")[0],d[i]||(i=t.language,d[i]||(i=h.language))),r.language=i;switch(r.startView){case 2:case"decade":r.startView=2;break;case 1:case"year":r.startView=1;break;default:r.startView=0}switch(r.minViewMode){case 1:case"months":r.minViewMode=1;break;case 2:case"years":r.minViewMode=2;break;default:r.minViewMode=0}r.startView=Math.max(r.startView,r.minViewMode),r.multidate!==!0&&(r.multidate=Number(r.multidate)||!1,r.multidate!==!1?r.multidate=Math.max(0,r.multidate):r.multidate=1),r.multidateSeparator=String(r.multidateSeparator),r.weekStart%=7,r.weekEnd=(r.weekStart+6)%7;var s=v.parseFormat(r.format);r.startDate!==-Infinity&&(r.startDate?r.startDate instanceof Date?r.startDate=this._local_to_utc(this._zero_time(r.startDate)):r.startDate=v.parseDate(r.startDate,s,r.language):r.startDate=-Infinity),r.endDate!==Infinity&&(r.endDate?r.endDate instanceof Date?r.endDate=this._local_to_utc(this._zero_time(r.endDate)):r.endDate=v.parseDate(r.endDate,s,r.language):r.endDate=Infinity),r.daysOfWeekDisabled=r.daysOfWeekDisabled||[],e.isArray(r.daysOfWeekDisabled)||(r.daysOfWeekDisabled=r.daysOfWeekDisabled.split(/[,\s]*/)),r.daysOfWeekDisabled=e.map(r.daysOfWeekDisabled,function(e){return parseInt(e,10)});var o=String(r.orientation).toLowerCase().split(/\s+/g),u=r.orientation.toLowerCase();o=e.grep(o,function(e){return/^auto|left|right|top|bottom$/.test(e)}),r.orientation={x:"auto",y:"auto"};if(!!u&&u!=="auto")if(o.length===1)switch(o[0]){case"top":case"bottom":r.orientation.y=o[0];break;case"left":case"right":r.orientation.x=o[0]}else u=e.grep(o,function(e){return/^left|right$/.test(e)}),r.orientation.x=u[0]||"auto",u=e.grep(o,function(e){return/^top|bottom$/.test(e)}),r.orientation.y=u[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(r=undefined,i=e[t][1]):e[t].length==3&&(r=e[t][1],i=e[t][2]),n.on(i,r)},_unapplyEvents:function(e){for(var t=0,n,r,i;t<e.length;t++)n=e[t][0],e[t].length==2?(i=undefined,r=e[t][1]):e[t].length==3&&(i=e[t][1],r=e[t][2]),n.off(r,i)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(function(t){e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,n){var r=n||this.dates.get(-1),i=this._utc_to_local(r);this.element.trigger({type:t,date:i,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){arguments.length===0?(e=this.dates.length-1,t=this.o.format):typeof e=="string"&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return v.formatDate(n,t,this.o.language)},this)})},show:function(e){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){if(this.isInline)return;if(!this.picker.is(":visible"))return;this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide")},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(e){return e&&new Date(e.getTime()+e.getTimezoneOffset()*6e4)},_local_to_utc:function(e){return e&&new Date(e.getTime()-e.getTimezoneOffset()*6e4)},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){this.update.apply(this,arguments),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){this.update.apply(this,e.map(arguments,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:s("setDates"),setUTCDate:s("setUTCDates"),setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e).change():this.component&&this.element.find("input").val(e).change()},getFormattedDate:function(t){t===undefined&&(t=this.o.format);var n=this.o.language;return e.map(this.dates,function(e){return v.formatDate(e,t,n)}).join(this.o.multidateSeparator)},setStartDate:function(e){this._process_options({startDate:e}),this.update(),this.updateNavArrows()},setEndDate:function(e){this._process_options({endDate:e}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this._process_options({daysOfWeekDisabled:e}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return;var t=this.picker.outerWidth(),r=this.picker.outerHeight(),i=10,s=n.width(),o=n.height(),u=n.scrollTop(),a=parseInt(this.element.parents().filter(function(){return e(this).css("z-index")!="auto"}).first().css("z-index"))+10,f=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),c=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),h=f.left,p=f.top;this.picker.removeClass("ai1ec-datepicker-orient-top ai1ec-datepicker-orient-bottom ai1ec-datepicker-orient-right ai1ec-datepicker-orient-left"),this.o.orientation.x!=="auto"?(this.picker.addClass("ai1ec-datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(h-=t-c)):(this.picker.addClass("ai1ec-datepicker-orient-left"),f.left<0?h-=f.left-i:f.left+t>s&&(h=s-t-i));var d=this.o.orientation.y,v,m;d==="auto"&&(v=-u+f.top-r,m=u+o-(f.top+l+r),Math.max(v,m)===m?d="top":d="bottom"),this.picker.addClass("ai1ec-datepicker-orient-"+d),d==="top"?p+=l:p-=r+parseInt(this.picker.css("padding-top")),this.picker.css({top:p,left:h,zIndex:a})},_allow_update:!0,update:function(){if(!this._allow_update)return;var t=this.dates.copy(),n=[],r=!1;arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),r=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),n&&this.o.multidate?n=n.split(this.o.multidateSeparator):n=[n],delete this.element.data().date),n=e.map(n,e.proxy(function(e){return v.parseDate(e,this.o.format,this.o.language)},this)),n=e.grep(n,e.proxy(function(e){return e<this.o.startDate||e>this.o.endDate||!e},this),!0),this.dates.replace(n),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),r?this.setValue():n.length&&String(t)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&t.length&&this._trigger("clearDate"),this.fill()},fillDow:function(){var e=this.o.weekStart,t="<tr>";if(this.o.calendarWeeks){var n='<th class="ai1ec-cw">&nbsp;</th>';t+=n,this.picker.find(".ai1ec-datepicker-days thead tr:first-child").prepend(n)}while(e<this.o.weekStart+7)t+='<th class="ai1ec-dow">'+d[this.o.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".ai1ec-datepicker-days thead").append(t)},fillMonths:function(){var e="",t=0;while(t<12)e+='<span class="ai1ec-month">'+d[this.o.language].monthsShort[t++]+"</span>";this.picker.find(".ai1ec-datepicker-months td").html(e)},setRange:function(t){!t||!t.length?delete this.range:this.range=e.map(t,function(e){return e.valueOf()}),this.fill()},getClassNames:function(t){var n=[],r=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),s=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()==r&&t.getUTCMonth()<i?n.push("ai1ec-old"):(t.getUTCFullYear()>r||t.getUTCFullYear()==r&&t.getUTCMonth()>i)&&n.push("ai1ec-new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&n.push("ai1ec-focused"),this.o.todayHighlight&&t.getUTCFullYear()==s.getFullYear()&&t.getUTCMonth()==s.getMonth()&&t.getUTCDate()==s.getDate()&&n.push("ai1ec-today"),this.dates.contains(t)!==-1&&n.push("ai1ec-active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&n.push("ai1ec-disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&n.push("ai1ec-range"),e.inArray(t.valueOf(),this.range)!=-1&&n.push("ai1ec-selected")),n},fill:function(){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth(),s=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,o=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,u=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,a=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,f,l;this.picker.find(".ai1ec-datepicker-days thead th.ai1ec-datepicker-switch").text(d[this.o.language].months[i]+" "+n),this.picker.find("tfoot th.ai1ec-today").text(d[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.ai1ec-clear").text(d[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var c=r(n,i-1,28),h=v.getDaysInMonth(c.getUTCFullYear(),c.getUTCMonth());c.setUTCDate(h),c.setUTCDate(h-(c.getUTCDay()-this.o.weekStart+7)%7);var p=new Date(c);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();var m=[],g;while(c.valueOf()<p){if(c.getUTCDay()==this.o.weekStart){m.push("<tr>");if(this.o.calendarWeeks){var y=new Date(+c+(this.o.weekStart-c.getUTCDay()-7)%7*864e5),b=new Date(+y+(11-y.getUTCDay())%7*864e5),w=new Date(+(w=r(b.getUTCFullYear(),0,1))+(11-w.getUTCDay())%7*864e5),E=(b-w)/864e5/7+1;m.push('<td class="ai1ec-cw">'+E+"</td>")}}g=this.getClassNames(c),g.push("ai1ec-day");if(this.o.beforeShowDay!==e.noop){var S=this.o.beforeShowDay(this._utc_to_local(c));S===undefined?S={}:typeof S=="boolean"?S={enabled:S}:typeof S=="string"&&(S={classes:S}),S.enabled===!1&&g.push("ai1ec-disabled"),S.classes&&(g=g.concat(S.classes.split(/\s+/))),S.tooltip&&(f=S.tooltip)}g=e.unique(g),m.push('<td class="'+g.join(" ")+'"'+(f?' title="'+f+'"':"")+">"+c.getUTCDate()+"</td>"),c.getUTCDay()==this.o.weekEnd&&m.push("</tr>"),c.setUTCDate(c.getUTCDate()+1)}this.picker.find(".ai1ec-datepicker-days tbody").empty().append(m.join(""));var x=this.picker.find(".ai1ec-datepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("ai1ec-active");e.each(this.dates,function(e,t){t.getUTCFullYear()==n&&x.eq(t.getUTCMonth()).addClass("ai1ec-active")}),(n<s||n>u)&&x.addClass("ai1ec-disabled"),n==s&&x.slice(0,o).addClass("ai1ec-disabled"),n==u&&x.slice(a+1).addClass("ai1ec-disabled"),m="",n=parseInt(n/10,10)*10;var T=this.picker.find(".ai1ec-datepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;var N=e.map(this.dates,function(e){return e.getUTCFullYear()}),C;for(var k=-1;k<11;k++)C=["ai1ec-year"],k===-1?C.push("ai1ec-old"):k===10&&C.push("ai1ec-new"),e.inArray(n,N)!==-1&&C.push("ai1ec-active"),(n<s||n>u)&&C.push("ai1ec-disabled"),m+='<span class="'+C.join(" ")+'">'+n+"</span>",n+=1;T.html(m)},updateNavArrows:function(){if(!this._allow_update)return;var e=new Date(this.viewDate),t=e.getUTCFullYear(),n=e.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()&&n<=this.o.startDate.getUTCMonth()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()&&n>=this.o.endDate.getUTCMonth()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&t<=this.o.startDate.getUTCFullYear()?this.picker.find(".ai1ec-prev").css({visibility:"hidden"}):this.picker.find(".ai1ec-prev").css({visibility:"visible"}),this.o.endDate!==Infinity&&t>=this.o.endDate.getUTCFullYear()?this.picker.find(".ai1ec-next").css({visibility:"hidden"}):this.picker.find(".ai1ec-next").css({visibility:"visible"})}},click:function(t){t.preventDefault();var n=e(t.target).closest("span, td, th"),i,s,o;if(n.length==1)switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"ai1ec-datepicker-switch":this.showMode(1);break;case"ai1ec-prev":case"ai1ec-next":var u=v.modes[this.viewMode].navStep*(n[0].className=="ai1ec-prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,u),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,u),this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"ai1ec-today":var a=new Date;a=r(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0),this.showMode(-2);var f=this.o.todayBtn=="linked"?null:"view";this._setDate(a,f);break;case"ai1ec-clear":var l;this.isInput?l=this.element:this.component&&(l=this.element.find("input")),l&&l.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":n.is(".ai1ec-disabled")||(this.viewDate.setUTCDate(1),n.is(".ai1ec-month")?(o=1,s=n.parent().find("span").index(n),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(s),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(r(i,s,o))):(o=1,s=0,i=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(i),this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(r(i,s,o))),this.showMode(-1),this.fill());break;case"td":n.is(".ai1ec-day")&&!n.is(".ai1ec-disabled")&&(o=parseInt(n.text(),10)||1,i=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n.is(".ai1ec-old")?s===0?(s=11,i-=1):s-=1:n.is(".ai1ec-new")&&(s==11?(s=0,i+=1):s+=1),this._setDate(r(i,s,o)))}this.picker.is(":visible")&&this._focused_from&&e(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(e){var t=this.dates.contains(e);e?t!==-1?this.dates.remove(t):this.dates.push(e):this.dates.clear();if(typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(e,t){(!t||t=="date")&&this._toggle_multidate(e&&new Date(e));if(!t||t=="view")this.viewDate=e&&new Date(e);this.fill(),this.setValue(),this._trigger("changeDate");var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change(),this.o.autoclose&&(!t||t=="date")&&this.hide()},moveMonth:function(e,t){if(!e)return undefined;if(!t)return e;var n=new Date(e.valueOf()),r=n.getUTCDate(),i=n.getUTCMonth(),s=Math.abs(t),o,u;t=t>0?1:-1;if(s==1){u=t==-1?function(){return n.getUTCMonth()==i}:function(){return n.getUTCMonth()!=o},o=i+t,n.setUTCMonth(o);if(o<0||o>11)o=(o+12)%12}else{for(var a=0;a<s;a++)n=this.moveMonth(n,t);o=n.getUTCMonth(),n.setUTCDate(r),u=function(){return o!=n.getUTCMonth()}}while(u())n.setUTCDate(--r),n.setUTCMonth(o);return n},moveYear:function(e,t){return this.moveMonth(e,t*12)},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":not(:visible)")){e.keyCode==27&&this.show();return}var t=!1,n,r,s,o=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;n=e.keyCode==37?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n),s=new Date(o),s.setUTCDate(o.getUTCDate()+n)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;n=e.keyCode==38?-1:1,e.ctrlKey?(r=this.moveYear(this.dates.get(-1)||i(),n),s=this.moveYear(o,n),this._trigger("changeYear",this.viewDate)):e.shiftKey?(r=this.moveMonth(this.dates.get(-1)||i(),n),s=this.moveMonth(o,n),this._trigger("changeMonth",this.viewDate)):(r=new Date(this.dates.get(-1)||i()),r.setUTCDate(r.getUTCDate()+n*7),s=new Date(o),s.setUTCDate(o.getUTCDate()+n*7)),this.dateWithinRange(r)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),e.preventDefault());break;case 32:break;case 13:o=this.focusDate||this.dates.get(-1)||this.viewDate,this._toggle_multidate(o),t=!0,this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(t){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var u;this.isInput?u=this.element:this.component&&(u=this.element.find("input")),u&&u.change()}},showMode:function(e){e&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+e))),this.picker.find(">div").hide().filter(".ai1ec-datepicker-"+v.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var a=function(t,n){this.element=e(t),this.inputs=e.map(n.inputs,function(e){return e.jquery?e[0]:e}),delete n.inputs,e(this.inputs).datepicker(n).bind("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e(t).data("datepicker")}),this.updateDates()};a.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,n){n.setRange(t)})},dateUpdated:function(t){if(this.updating)return;this.updating=!0;var n=e(t.target).data("datepicker"),r=n.getUTCDate(),i=e.inArray(t.target,this.inputs),s=this.inputs.length;if(i==-1)return;e.each(this.pickers,function(e,t){t.getUTCDate()||t.setUTCDate(r)});if(r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<s&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates(),delete this.updating},remove:function(){e.map(this.pickers,function(e){e.remove()}),delete this.element.data().datepicker}};var c=e.fn.datepicker;e.fn.datepicker=function(t){var n=Array.apply(null,arguments);n.shift();var r;return this.each(function(){var i=e(this),s=i.data("datepicker"),o=typeof t=="object"&&t;if(!s){var c=f(this,"date"),p=e.extend({},h,c,o),d=l(p.language),v=e.extend({},h,d,c,o);if(i.is(".ai1ec-input-daterange")||v.inputs){var m={inputs:v.inputs||i.find("input").toArray()};i.data("datepicker",s=new a(this,e.extend(v,m)))}else i.data("datepicker",s=new u(this,v))}if(typeof t=="string"&&typeof s[t]=="function"){r=s[t].apply(s,n);if(r!==undefined)return!1}}),r!==undefined?r:this};var h=e.fn.datepicker.defaults={autoclose:!1,beforeShowDay:e.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},p=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=u;var d=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},v={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},getDaysInMonth:function(e,t){return[31,v.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(e){var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||n.length===0)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(t,n,i){if(!t)return undefined;if(t instanceof Date)return t;typeof n=="string"&&(n=v.parseFormat(n));if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(t)){var s=/([\-+]\d+)([dmwy])/,o=t.match(/([\-+]\d+)([dmwy])/g),a,f;t=new Date;for(var l=0;l<o.length;l++){a=s.exec(o[l]),f=parseInt(a[1]);switch(a[2]){case"d":t.setUTCDate(t.getUTCDate()+f);break;case"m":t=u.prototype.moveMonth.call(u.prototype,t,f);break;case"w":t.setUTCDate(t.getUTCDate()+f*7);break;case"y":t=u.prototype.moveYear.call(u.prototype,t,f)}}return r(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),0,0,0)}var o=t&&t.match(this.nonpunctuation)||[],t=new Date,c={},h=["yyyy","yy","M","MM","m","mm","d","dd"],p={yyyy:function(e,t){return e.setUTCFullYear(t)},yy:function(e,t){return e.setUTCFullYear(2e3+t)},m:function(e,t){if(isNaN(e))return e;t-=1;while(t<0)t+=12;t%=12,e.setUTCMonth(t);while(e.getUTCMonth()!=t)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}},m,g,a;p.M=p.MM=p.mm=p.m,p.dd=p.d,t=r(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);var y=n.parts.slice();o.length!=y.length&&(y=e(y).filter(function(t,n){return e.inArray(n,h)!==-1}).toArray());if(o.length==y.length){for(var l=0,b=y.length;l<b;l++){m=parseInt(o[l],10),a=y[l];if(isNaN(m))switch(a){case"MM":g=e(d[i].months).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].months)+1;break;case"M":g=e(d[i].monthsShort).filter(function(){var e=this.slice(0,o[l].length),t=o[l].slice(0,e.length);return e==t}),m=e.inArray(g[0],d[i].monthsShort)+1}c[a]=m}for(var l=0,w,E;l<h.length;l++)E=h[l],E in c&&!isNaN(c[E])&&(w=new Date(t),p[E](w,c[E]),isNaN(w)||(t=w))}return t},formatDate:function(t,n,r){if(!t)return"";typeof n=="string"&&(n=v.parseFormat(n));var i={d:t.getUTCDate(),D:d[r].daysShort[t.getUTCDay()],DD:d[r].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:d[r].monthsShort[t.getUTCMonth()],MM:d[r].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m;var t=[],s=e.extend([],n.separators);for(var o=0,u=n.parts.length;o<=u;o++)s.length&&t.push(s.shift()),t.push(i[n.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="ai1ec-prev"><i class="ai1ec-fa ai1ec-fa-arrow-left"></i></th><th colspan="5" class="ai1ec-datepicker-switch"></th><th class="ai1ec-next"><i class="ai1ec-fa ai1ec-fa-arrow-right"></i></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="ai1ec-today"></th></tr><tr><th colspan="7" class="ai1ec-clear"></th></tr></tfoot>'};v.template='<div class="timely ai1ec-datepicker"><div class="ai1ec-datepicker-days"><table class=" ai1ec-table-condensed">'+v.headTemplate+"<tbody></tbody>"+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-months">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+'<div class="ai1ec-datepicker-years">'+'<table class="ai1ec-table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table>"+"</div>"+"</div>",e.fn.datepicker.DPGlobal=v,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=c,this},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var n=e(this);if(n.data("datepicker"))return;t.preventDefault(),n.datepicker("show")}),e(function(){e('[data-provide="datepicker-inline"]').datepicker()});for(var m=2,g=arguments.length;m<g;m++)arguments[m].localize()}),timely.define("external_libs/bootstrap/tooltip",["jquery_timely"],function(e){var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,r){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r);var i=this.options.trigger.split(" ");for(var s=i.length;s--;){var o=i[s];if(o=="click")this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if(o!="manual"){var u=o=="hover"?"mouseenter":"focus",a=o=="hover"?"mouseleave":"blur";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},t.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="in";if(!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="out";if(!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.tip();this.setContent(),this.options.animation&&n.addClass("ai1ec-fade");var r=typeof this.options.placement=="function"?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,s=i.test(r);s&&(r=r.replace(i,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass("ai1ec-"+r),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var o=this.getPosition(),u=n[0].offsetWidth,a=n[0].offsetHeight;if(s){var f=this.$element.parent(),l=r,c=document.documentElement.scrollTop||document.body.scrollTop,h=this.options.container=="body"?window.innerWidth:f.outerWidth(),p=this.options.container=="body"?window.innerHeight:f.outerHeight(),d=this.options.container=="body"?0:f.offset().left;r=r=="bottom"&&o.top+o.height+a-c>p?"top":r=="top"&&o.top-c-a<0?"bottom":r=="right"&&o.right+u>h?"left":r=="left"&&o.left-u<d?"right":r,n.removeClass("ai1ec-"+l).addClass("ai1ec-"+r)}var v=this.getCalculatedOffset(r,o,u,a);this.applyPlacement(v,r),this.$element.trigger("shown.bs."+this.type)}},t.prototype.applyPlacement=function(e,t){var n,r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),e.top=e.top+o,e.left=e.left+u,r.offset(e).addClass("ai1ec-in");var a=r[0].offsetWidth,f=r[0].offsetHeight;t=="top"&&f!=s&&(n=!0,e.top=e.top+s-f);if(/bottom|top/.test(t)){var l=0;e.left<0&&(l=e.left*-2,e.left=0,r.offset(e),a=r[0].offsetWidth,f=r[0].offsetHeight),this.replaceArrow(l-i+a,a,"left")}else this.replaceArrow(f-s,f,"top");n&&r.offset(e)},t.prototype.replaceArrow=function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".ai1ec-tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("ai1ec-fade ai1ec-in ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right")},t.prototype.hide=function(){function i(){t.hoverState!="in"&&n.detach()}var t=this,n=this.tip(),r=e.Event("hide.bs."+this.type);this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("ai1ec-in"),e.support.transition&&this.$tip.hasClass("ai1ec-fade")?n.one(e.support.transition.end,i).emulateTransitionEnd(150):i(),this.$element.trigger("hidden.bs."+this.type),this},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getCalculatedOffset=function(e,t,n,r){return e=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-n/2}:e=="top"?{top:t.top-r,left:t.left+t.width/2-n/2}:e=="left"?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},t.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var n=t?e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;n.tip().hasClass("ai1ec-in")?n.leave(n):n.enter(n)},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s=typeof n=="object"&&n;i||r.data("bs.tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}),timely.define("external_libs/jquery_cookie",["jquery_timely"],function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function r(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function s(e){e.indexOf('"')===0&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(t," ")),u.json?JSON.parse(e):e}catch(n){}}function o(t,n){var r=u.raw?t:s(t);return e.isFunction(n)?n(r):r}var t=/\+/g,u=e.cookie=function(t,s,a){if(s!==undefined&&!e.isFunction(s)){a=e.extend({},u.defaults,a);if(typeof a.expires=="number"){var f=a.expires,l=a.expires=new Date;l.setTime(+l+f*864e5)}return document.cookie=[n(t),"=",i(s),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=t?undefined:{},h=document.cookie?document.cookie.split("; "):[];for(var p=0,d=h.length;p<d;p++){var v=h[p].split("="),m=r(v.shift()),g=v.join("=");if(t&&t===m){c=o(g,s);break}!t&&(g=o(g))!==undefined&&(c[m]=g)}return c};u.defaults={},e.removeCookie=function(t,n){return e.cookie(t)===undefined?!1:(e.cookie(t,"",e.extend({},n,{expires:-1})),!e.cookie(t))}}),timely.define("scripts/admin_settings",["jquery_timely","domReady","ai1ec_config","libs/utils","scripts/setting/cache/cache_event_handlers","external_libs/bootstrap/button","libs/collapse_helper","external_libs/bootstrap/tab","external_libs/bootstrap_datepicker","external_libs/bootstrap/tooltip","external_libs/jquery_cookie"],function(e,t,n,r,i){var s=function(){var t=!0;e("#ai1ec-plugins-settings input:text").each(function(){this.value!==""&&(t=!1)}),t===!0&&e("#ai1ec-plugins-settings").remove()},o=function(t){var n=e(this).attr("href");e.cookie("ai1ec_general_settings_active_tab",n)},u=function(){var t=e("#week_view_starts_at"),r=e("#week_view_ends_at"),i=parseInt(t.val(),10),s=parseInt(r.val(),10);if(s<i)return window.alert(n.end_must_be_after_start),r.focus(),!1;var o=s-i;if(o<6)return window.alert(n.show_at_least_six_hours),r.focus(),!1},a=function(){e(".ai1ec-gzip-causes-js-failure").remove()},f=function(){e("#ai1ec_save_settings").on("click",function(t){var r=e("#require_disclaimer").is(":checked"),i=e("#disclaimer").val();!0===r&&""===i&&(alert(n.require_desclaimer),e('#ai1ec-general-settings ul.ai1ec-nav a[href="#ai1ec-advanced"]').tab("show"),e("#disclaimer").focus(),t.preventDefault())})},l=function(){e("fieldset.ai1ec-captcha_provider").addClass("ai1ec-hidden"),e(".ai1ec-"+e(this).val()).removeClass("ai1ec-hidden")},c=function(){t(function(){f(),a(),r.activate_saved_tab_on_page_load(e.cookie("ai1ec_general_settings_active_tab")),e(document).on("click",'#ai1ec-general-settings .ai1ec-nav a[data-toggle="ai1ec-tab"]',o),e(document).on("click","#disable_standard_filter_menu_toggler",function(e){e.preventDefault()}),e(document).on("click","#ai1ec-button-refresh",i.perform_rescan);var t=e("#exact_date");t.datepicker({autoclose:!0}),s(),e(document).on("click",".ai1ec-admin-view-settings .ai1ec-toggle-view",function(){var t=e(this),n=t.parent().index()+1;if(0===t.closest("tr").siblings().find("td:nth-child("+n+") .ai1ec-toggle-view:checked").length)return!1;if(t.parent().next("td").find(".ai1ec-toggle-default-view").is(":checked"))return!1});var n=function(){var t=e(this).closest(".ai1ec-form-group").nextAll(".ai1ec-form-group").slice(0,4);e(this).prop("checked")?t.show():t.hide()};n.apply(e("#affix_filter_menu").on("click",n)[0]),e(document).on("click",".ai1ec-admin-view-settings .ai1ec-toggle-default-view",function(){e(this).parent().prev("td").children(".ai1ec-toggle-view").prop("checked",!0)}),e(document).on("change","#captcha_provider",l),r.init_autoselect(),e("#ai1ec_save_settings").on("click",u),e("#show_create_event_button").trigger("ready")})};return{start:c}}),timely.require(["scripts/admin_settings"],function(e){e.start()}),timely.define("pages/admin_settings",function(){});
public/js/pages/calendar.js CHANGED
@@ -118,13 +118,25 @@ the specific language governing permissions and limitations under the Apache Lic
118
  * @link https://github.com/justjohn/twig.js
119
  */
120
 
 
121
  // Copyright (c) 2011-2013 John Roepke
 
 
122
 
 
123
  // [MIT License](http://www.opensource.org/licenses/mit-license.php) or are
124
-
125
  // [Public Domain](https://developer.mozilla.org/Project:Copyrights).
126
-
 
 
 
 
 
 
 
127
  // Copies of the licenses for the code included here can be found in the
 
 
128
 
129
  /**
130
  * jPaq - A fully customizable JavaScript/JScript library
@@ -138,6 +150,12 @@ the specific language governing permissions and limitations under the Apache Lic
138
  * Revised: April 6, 2011
139
  */
140
 
 
 
 
 
 
 
141
  /**
142
  * History.js jQuery Adapter
143
  * @author Benjamin Arthur Lupton <contact@balupton.com>
@@ -340,4 +358,4 @@ OTHER DEALINGS IN THE SOFTWARE.
340
  * limitations under the License.
341
  * ======================================================================== */
342
 
343
- timely.define("domReady",[],function(){function u(e){var t;for(t=0;t<e.length;t++)e[t](n)}function a(){var e=r;t&&e.length&&(r=[],u(e))}function f(){t||(t=!0,o&&clearInterval(o),a())}function c(e){return t?e(n):r.push(e),c}var e=typeof window!="undefined"&&window.document,t=!e,n=e?document:null,r=[],i,s,o;if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",f,!1),window.addEventListener("load",f,!1);else if(window.attachEvent){window.attachEvent("onload",f),s=document.createElement("div");try{i=window.frameElement===null}catch(l){}s.doScroll&&i&&window.external&&(o=setInterval(function(){try{s.doScroll(),f()}catch(e){}},30))}(document.readyState==="complete"||document.readyState==="interactive")&&f()}return c.version="2.0.0",c.load=function(e,t,n,r){r.isBuild?n(null):c(n)},c}),timely.define("scripts/calendar/print",["jquery_timely"],function(e){var t=function(t){t.preventDefault();var n=e("body"),r=e("html"),i=e(this).closest(".ai1ec-calendar").html(),s=n.html();s=s.replace(/<script.*?>([\s\S]*?)<\/script>/gmi,""),n.empty(),n.addClass("timely"),r.addClass("ai1ec-print"),n.html(i),e("span").click(function(){return!1}),e(".ai1ec-agenda-view a").each(function(){e(this).data("href",e(this).attr("href")),e(this).attr("href","#")}),window.print(),e(".ai1ec-agenda-view a").each(function(){e(this).attr("href",e(this).data("href")),e(this).data("href","")}),n.removeClass("timely"),r.removeClass("ai1ec-print"),n.html(s)};return{handle_click_on_print_button:t}}),timely.define("scripts/calendar/agenda_view",["jquery_timely"],function(e){var t=function(){e(this).closest(".ai1ec-event").toggleClass("ai1ec-expanded").find(".ai1ec-event-summary").slideToggle(300)},n=function(){var t=e(this).closest(".ai1ec-calendar");t.find(".ai1ec-expanded .ai1ec-event-toggle").click()},r=function(){var t=e(this).closest(".ai1ec-calendar");t.find(".ai1ec-event:not(.ai1ec-expanded) .ai1ec-event-toggle").click()};return{toggle_event:t,collapse_all:n,expand_all:r}}),timely.define("external_libs/modernizr",[],function(){var e=function(e,t,n){function S(e){f.cssText=e}function x(e,t){return S(h.join(e+";")+(t||""))}function T(e,t){return typeof e===t}function N(e,t){return!!~(""+e).indexOf(t)}function C(e,t,r){for(var i in e){var s=t[e[i]];if(s!==n)return r===!1?e[i]:T(s,"function")?s.bind(r||t):s}return!1}var r="2.5.3",i={},s=!0,o=t.documentElement,u="modernizr",a=t.createElement(u),f=a.style,l,c={}.toString,h=" -webkit- -moz- -o- -ms- ".split(" "),p={},d={},v={},m=[],g=m.slice,y,b=function(e,n,r,i){var s,a,f,l=t.createElement("div"),c=t.body,h=c?c:t.createElement("body");if(parseInt(r,10))while(r--)f=t.createElement("div"),f.id=i?i[r]:u+(r+1),l.appendChild(f);return s=["&#173;","<style>",e,"</style>"].join(""),l.id=u,(c?l:h).innerHTML+=s,h.appendChild(l),c||(h.style.background="",o.appendChild(h)),a=n(l,e),c?l.parentNode.removeChild(l):h.parentNode.removeChild(h),!!a},w={}.hasOwnProperty,E;!T(w,"undefined")&&!T(w.call,"undefined")?E=function(e,t){return w.call(e,t)}:E=function(e,t){return t in e&&T(e.constructor.prototype[t],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError;var r=g.call(arguments,1),i=function(){if(this instanceof i){var e=function(){};e.prototype=n.prototype;var s=new e,o=n.apply(s,r.concat(g.call(arguments)));return Object(o)===o?o:s}return n.apply(t,r.concat(g.call(arguments)))};return i});var k=function(n,r){var s=n.join(""),o=r.length;b(s,function(n,r){var s=t.styleSheets[t.styleSheets.length-1],u=s?s.cssRules&&s.cssRules[0]?s.cssRules[0].cssText:s.cssText||"":"",a=n.childNodes,f={};while(o--)f[a[o].id]=a[o];i.touch="ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch||(f.touch&&f.touch.offsetTop)===9},o,r)}([,["@media (",h.join("touch-enabled),("),u,")","{#touch{top:9px;position:absolute}}"].join("")],[,"touch"]);p.touch=function(){return i.touch};for(var L in p)E(p,L)&&(y=L.toLowerCase(),i[y]=p[L](),m.push((i[y]?"":"no-")+y));return S(""),a=l=null,i._version=r,i._prefixes=h,i.testStyles=b,o.className=o.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(s?" js "+m.join(" "):""),i}(window,window.document);return e}),timely.define("scripts/calendar/month_view",["jquery_timely","external_libs/modernizr"],function(e,t){var n=navigator.userAgent.match(/opera/i),r=navigator.userAgent.match(/webkit/i),i=function(t){var n=t.find(".ai1ec-day"),r=t.find(".ai1ec-week:first .ai1ec-day").length;t.find(".ai1ec-month-view .ai1ec-multiday").each(function(){var t=this.parentNode,r=e(this).outerHeight(!0),i=e(".ai1ec-date",t),u=parseInt(i.text(),10),a=e(this).data("endTruncated"),f=parseInt(a?e(n[n.length-1]).text():e(this).data("endDay"),10),l=e(this),c=e(".ai1ec-event",l)[0].style.backgroundColor,h=0,p=f-u+1,d=p,v,m=0;n.each(function(t){var n=e(".ai1ec-date",this),r=e(this.parentNode),i=r.index(),a=parseInt(n.text(),10);if(a>=u&&a<=f){a===u&&(v=parseInt(n.css("marginBottom"),10)+16),h===0&&m++;if(i===0&&a>u&&d!==0){var p=l.next(".ai1ec-popup").andSelf().clone(!1);n.parent().append(p);var g=p.first();g.addClass("ai1ec-multiday-bar ai1ec-multiday-clone"),g.css({position:"absolute",left:"1px",top:parseInt(n.css("marginBottom"),10)+13,backgroundColor:c});var y=d>7?7:d;g.css("width",s(y)),d>7&&g.append(o(1,c)),g.append(o(2,c))}h===0?n.css({marginBottom:v+"px"}):n.css({marginBottom:"+=16px"}),d--,d>0&&i===6&&h++}});if(a){var g=l.find("."+l[0].className.replace(/\s+/igm,".")).last();g.append(o(1,c))}e(this).css({position:"absolute",top:i.outerHeight(!0)-r-1+"px",left:"1px",width:s(m)}),h>0&&e(this).append(o(1,c)),e(this).data("startTruncated")&&e(this).append(o(2,c)).addClass("ai1ec-multiday-bar")}),n.each(function(){var t=e(".ai1ec-date",this),n=parseInt(t.text(),10),r=t.closest(".ai1ec-week"),i=e(this).find("a.ai1ec-event-container:not(.ai1ec-multiday)").length,s=null,o;if(0===i)return;o=r.find("a.ai1ec-multiday[data-end-day]").filter(function(){return e(this).data("startDay")<=n&&e(this).data("endDay")>=n}),o.each(function(){var t=e(this).prop("offsetTop");if(null===s||t>s)s=t}),null!==s&&(s+=3,t.css("marginBottom",s))})},s=function(e){var t;switch(e){case 1:t=97.5;break;case 2:t=198.7;break;case 3:t=300;break;case 4:t=401;break;case 5:r||n?t=507:t=503.4;break;case 6:r||n?t=608:t=603.5;break;case 7:r||n?t=709:t=705}return t+"%"},o=function(t,n){var r=e('<div class="ai1ec-multiday-arrow'+t+'"></div>');return t===1?r.css({borderLeftColor:n}):r.css({borderTopColor:n,borderRightColor:n,borderBottomColor:n}),r};return{extend_multiday_events:i}}),timely.define("libs/frontend_utils",[],function(){var e=function(e){var t,n;t=function(e){if(/&[^;]+;/.test(e)){var t=document.createElement("div");return t.innerHTML=e,t.firstChild?t.firstChild.nodeValue:e}return e};if(typeof e=="string")return t(e);if(typeof e=="object")for(n in e)typeof e[n]=="string"&&(e[n]=t(e[n]));return e},t=function(e,t,n){var r,i,s,o,u;if("#"===e.charAt(0)||"?"===e.charAt(0))e=e.substring(1);r={},e=e.split(t);for(i=0;i<e.length;i++)o=e[i].trim(),-1!==(u=o.indexOf(n))?(s=o.substring(0,u).trim(),o=o.substring(u+1).trim()):(s=o,o=!0),r[s]=o;return r},n=function(e){var n,r,i,s,o;e=t(e,"&","="),i=Object.keys(e),n={ai1ec:{},action:"month"};for(r=0;r<i.length;r++)if("ai1ec"===i[r]){var u=t(e[i[r]],"|",":");for(s in u)if(""!==u[s]){if("action"===s||"view"===s)n.action=u[s];n.ai1ec[s]=u[s]}}else"ai1ec_"===i[r].substring(0,6)?n.ai1ec[i[r].substring(6)]=e[i[r]]:n[i[r]]=e[i[r]];"ai1ec_"!==n.action.substring(0,6)&&(n.action="ai1ec_"+n.action),o="action="+n.action+"&ai1ec=";for(s in n.ai1ec)n.ai1ec.hasOwnProperty(s)&&(o+=escape(s)+":"+escape(n.ai1ec[s])+"|");o=o.substring(0,o.length-1);for(s in n)"ai1ec"!==s&&"action"!==s&&(o+="&"+s+"="+escape(n[s]));return o};return{ai1ec_convert_entities:e,ai1ec_map_internal_query:n,ai1ec_tokenize_uri:t}}),timely.define("external_libs/bootstrap/tab",["jquery_timely"],function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.ai1ec-dropdown-menu)"),r=t.data("target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("ai1ec-active"))return;var i=n.find(".ai1ec-active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("ai1ec-active").find("> .ai1ec-dropdown-menu > .ai1ec-active").removeClass("ai1ec-active"),t.addClass("ai1ec-active"),s?(t[0].offsetWidth,t.addClass("ai1ec-in")):t.removeClass("ai1ec-fade"),t.parent(".ai1ec-dropdown-menu")&&t.closest("li.ai1ec-dropdown").addClass("ai1ec-active"),r&&r()}var i=n.find("> .ai1ec-active"),s=r&&e.support.transition&&i.hasClass("ai1ec-fade");s?i.one(e.support.transition.end,o).emulateTransitionEnd(150):o(),i.removeClass("ai1ec-in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="ai1ec-tab"], [data-toggle="ai1ec-pill"]',function(t){t.preventDefault(),e(this).tab("show")})}),timely.define("libs/utils",["jquery_timely","external_libs/bootstrap/tab"],function(e){var t=function(){return{is_float:function(e){return!isNaN(parseFloat(e))},is_valid_coordinate:function(e,t){var n=t?90:180;return this.is_float(e)&&Math.abs(e)<n},convert_comma_to_dot:function(e){return e.replace(",",".")},field_has_value:function(t){var n="#"+t,r=e(n),i=!1;return r.length===1&&(i=e.trim(r.val())!==""),i},make_alert:function(t,n,r){var i="";switch(n){case"error":i="ai1ec-alert ai1ec-alert-danger";break;case"success":i="ai1ec-alert ai1ec-alert-success";break;default:i="ai1ec-alert ai1ec-alert-info"}var s=e("<div />",{"class":i,html:t});if(!r){var o=e("<button>",{type:"button","class":"ai1ec-close","data-dismiss":"ai1ec-alert",text:"×"});s.prepend(o)}return s},get_ajax_url:function(){return typeof window.ajaxurl=="undefined"?"http://localhost/wordpress/wp-admin/admin-ajax.php":window.ajaxurl},isUrl:function(e){var t=/(http|https|webcal):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)},isValidEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},activate_saved_tab_on_page_load:function(t){null===t||undefined===t?e("ul.ai1ec-nav a:first").tab("show"):e("ul.ai1ec-nav a[href="+t+"]").tab("show")},add_query_arg:function(e,t){if("string"!=typeof e)return!1;var n=e.indexOf("?")===-1?"?":"&";return-1!==e.indexOf(n+t[0]+"=")?e:e+n+t[0]+"="+t[1]},create_ai1ec_to_send:function(t){var n=e(t),r=[],i=["action","cat_ids","auth_ids","tag_ids","exact_date","display_filters","no_navigation","events_limit"],s=function(e){return e.replace(/\W+(.)/g,function(e,t){return t.toUpperCase()})};return e(i).each(function(e,t){var i=n.data(s(t));i&&r.push(t+"~"+i)}),r.join("|")},init_autoselect:function(){e(document).on("click",".ai1ec-autoselect",function(t){if(e(this).data("clicked")&&t.originalEvent.detail<2)return;e(this).data("clicked",!0);var n;document.body.createTextRange?(n=document.body.createTextRange(),n.moveToElementText(this),n.select()):window.getSelection&&(selection=window.getSelection(),n=document.createRange(),n.selectNodeContents(this),selection.removeAllRanges(),selection.addRange(n))})}}}();return t}),timely.define("external_libs/bootstrap/affix",["jquery_timely"],function(e){var t=function(n,r){this.options=e.extend({},t.DEFAULTS,r),this.$window=e(window).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(n),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};t.RESET="ai1ec-affix ai1ec-affix-top ai1ec-affix-bottom",t.DEFAULTS={offset:0},t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("ai1ec-affix");var e=this.$window.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-e},t.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var n=e(document).height(),r=this.$window.scrollTop(),i=this.$element.offset(),s=this.options.offset,o=s.top,u=s.bottom;this.affixed=="top"&&(i.top+=r),typeof s!="object"&&(u=o=s),typeof o=="function"&&(o=s.top(this.$element)),typeof u=="function"&&(u=s.bottom(this.$element));var a=this.unpin!=null&&r+this.unpin<=i.top?!1:u!=null&&i.top+this.$element.height()>=n-u?"bottom":o!=null&&r<=o?"top":!1;if(this.affixed===a)return;this.unpin&&this.$element.css("top","");var f="ai1ec-affix"+(a?"-"+a:""),l=e.Event(f+".bs.affix");this.$element.trigger(l);if(l.isDefaultPrevented())return;this.affixed=a,this.unpin=a=="bottom"?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(f).trigger(e.Event(f.replace("affix","affixed"))),a=="bottom"&&this.$element.offset({top:n-u-this.$element.height()})};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("bs.affix"),s=typeof n=="object"&&n;i||r.data("bs.affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="ai1ec-affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}),timely.define("scripts/common_scripts/frontend/common_event_handlers",["jquery_timely","external_libs/bootstrap/affix"],function(e){var t=function(t){var n=e(this),r=n.next(".ai1ec-popup"),i,s,o;if(r.length===0)return;i=r.html(),s=r.attr("class");var u=n.closest("#ai1ec-calendar-view");u.length===0&&(u=e("body")),n.offset().left-u.offset().left>182?o="left":o="right",n.constrained_popover({content:i,title:"",placement:o,trigger:"manual",html:!0,template:'<div class="timely ai1ec-popover '+s+'">'+'<div class="ai1ec-arrow"></div>'+'<div class="ai1ec-popover-inner">'+'<div class="ai1ec-popover-content"><div></div></div>'+"</div>"+"</div>",container:"body"}).constrained_popover("show")},n=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-popup").length===0&&e(this).constrained_popover("hide")},r=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip").length===0&&(e(this).remove(),e("body > .ai1ec-tooltip").remove())},i=function(t){if("ontouchstart"in document.documentElement){t.preventDefault();return}var n=e(this),r={template:'<div class="timely ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"manual",container:"body"};if(n.is(".ai1ec-category .ai1ec-color-swatch")||n.is(".ai1ec-custom-filter .ai1ec-color-swatch"))return;n.is(".ai1ec-tooltip-auto")&&(r.placement=u(250)),n.tooltip(r),n.tooltip("show")},s=function(t){e(this).tooltip("hide")},o=function(t){var n=e(t.toElement||t.relatedTarget);n.closest(".ai1ec-tooltip-trigger").length===0&&e(this).remove(),n.closest(".ai1ec-popup").length===0&&e("body > .ai1ec-popup").remove()},u=function(t){return function(n,r){var i,s,o=e(r),u=o.attr("data-placement"),a=e.extend({},o.offset(),{width:r.offsetWidth,height:r.offsetHeight}),f=function(){return!1===i?!1:(i=a.left-t>=0,i?"left":!1)},l=function(){return!1===s?!1:(s=a.left+t<=e(window).width(),s?"right":!1)};switch(u){case"top":return"top";case"bottom":return"bottom";case"left":if(f())return"left";case"right":if(l())return"right";default:if(f())return"left";if(l())return"right";return u}}};return{handle_popover_over:t,handle_popover_out:n,handle_popover_self_out:r,handle_tooltip_over:i,handle_tooltip_out:s,handle_tooltip_self_out:o}}),timely.define("external_libs/bootstrap/tooltip",["jquery_timely"],function(e){var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="ai1ec-tooltip"><div class="ai1ec-tooltip-arrow"></div><div class="ai1ec-tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,r){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r);var i=this.options.trigger.split(" ");for(var s=i.length;s--;){var o=i[s];if(o=="click")this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if(o!="manual"){var u=o=="hover"?"mouseenter":"focus",a=o=="hover"?"mouseleave":"blur";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},t.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="in";if(!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);clearTimeout(n.timeout),n.hoverState="out";if(!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.tip();this.setContent(),this.options.animation&&n.addClass("ai1ec-fade");var r=typeof this.options.placement=="function"?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,s=i.test(r);s&&(r=r.replace(i,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass("ai1ec-"+r),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var o=this.getPosition(),u=n[0].offsetWidth,a=n[0].offsetHeight;if(s){var f=this.$element.parent(),l=r,c=document.documentElement.scrollTop||document.body.scrollTop,h=this.options.container=="body"?window.innerWidth:f.outerWidth(),p=this.options.container=="body"?window.innerHeight:f.outerHeight(),d=this.options.container=="body"?0:f.offset().left;r=r=="bottom"&&o.top+o.height+a-c>p?"top":r=="top"&&o.top-c-a<0?"bottom":r=="right"&&o.right+u>h?"left":r=="left"&&o.left-u<d?"right":r,n.removeClass("ai1ec-"+l).addClass("ai1ec-"+r)}var v=this.getCalculatedOffset(r,o,u,a);this.applyPlacement(v,r),this.$element.trigger("shown.bs."+this.type)}},t.prototype.applyPlacement=function(e,t){var n,r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),e.top=e.top+o,e.left=e.left+u,r.offset(e).addClass("ai1ec-in");var a=r[0].offsetWidth,f=r[0].offsetHeight;t=="top"&&f!=s&&(n=!0,e.top=e.top+s-f);if(/bottom|top/.test(t)){var l=0;e.left<0&&(l=e.left*-2,e.left=0,r.offset(e),a=r[0].offsetWidth,f=r[0].offsetHeight),this.replaceArrow(l-i+a,a,"left")}else this.replaceArrow(f-s,f,"top");n&&r.offset(e)},t.prototype.replaceArrow=function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".ai1ec-tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("ai1ec-fade ai1ec-in ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right")},t.prototype.hide=function(){function i(){t.hoverState!="in"&&n.detach()}var t=this,n=this.tip(),r=e.Event("hide.bs."+this.type);this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("ai1ec-in"),e.support.transition&&this.$tip.hasClass("ai1ec-fade")?n.one(e.support.transition.end,i).emulateTransitionEnd(150):i(),this.$element.trigger("hidden.bs."+this.type),this},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getCalculatedOffset=function(e,t,n,r){return e=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-n/2}:e=="top"?{top:t.top-r,left:t.left+t.width/2-n/2}:e=="left"?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},t.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var n=t?e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;n.tip().hasClass("ai1ec-in")?n.leave(n):n.enter(n)},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s=typeof n=="object"&&n;i||r.data("bs.tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}),timely.define("external_libs/bootstrap/popover",["jquery_timely","external_libs/bootstrap/tooltip"],function(e){var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="ai1ec-popover"><div class="ai1ec-arrow"></div><h3 class="ai1ec-popover-title"></h3><div class="ai1ec-popover-content"></div></div>'}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".ai1ec-popover-title")[this.options.html?"html":"text"](t),e.find(".ai1ec-popover-content")[this.options.html?"html":"text"](n),e.removeClass("ai1ec-fade ai1ec-top ai1ec-bottom ai1ec-left ai1ec-right ai1ec-in"),e.find(".ai1ec-popover-title").html()||e.find(".ai1ec-popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||(typeof t.content=="function"?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".ai1ec-arrow")},t.prototype.tip=function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip};var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("bs.popover"),s=typeof n=="object"&&n;i||r.data("bs.popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}),timely.define("external_libs/constrained_popover",["jquery_timely","external_libs/bootstrap/popover"],function(e){var t=function(e,t){this.init("constrained_popover",e,t)};t.DEFAULTS=e.extend({},e.fn.popover.Constructor.DEFAULTS,{container:"",content:this.options}),t.prototype=e.extend({},e.fn.popover.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.applyPlacement=function(t,n){e.fn.popover.Constructor.prototype.applyPlacement.call(this,t,n);var r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=this.getPosition(),u={};switch(n){case"left":newPos=this.defineBounds(o),typeof newPos.top=="undefined"?u.top=o.top+o.height/2-s/2:u.top=newPos.top-s/2,typeof newPos.left=="undefined"?u.left=o.left-i:u.left=newPos.left-i,r.offset(u);break;case"right":newPos=this.defineBounds(o),typeof newPos.top=="undefined"?u.top=o.top+o.height/2-s/2:u.top=newPos.top-s/2,typeof newPos.left=="undefined"?u.left=o.left+o.width:u.left=newPos.left+o.width,r.offset(u)}},t.prototype.defineBounds=function(t){var n,r,i,s,o,u={},a=e("body"===this.options.container?document:this.options.container);return a.length?(n=a.offset()||{top:0,left:0},r=n.top,i=n.left,s=r+a.height(),o=i+a.width(),t.top+t.height/2<r&&(u.top=r),t.top+t.height/2>s&&(u.top=s),t.left-t.width/2<i&&(u.left=i),t.left-t.width/2>o&&(u.left=o),u):!1};var n=e.fn.popover;e.fn.constrained_popover=function(n){return this.each(function(){var r=e(this),i=r.data("ai1ec.constrained_popover"),s=typeof n=="object"&&n;i||r.data("ai1ec.constrained_popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.constrained_popover.Constructor=t,e.fn.constrained_popover.noConflict=function(){return e.fn.constrained_popover=n,this}}),timely.define("external_libs/bootstrap/dropdown",["jquery_timely"],function(e){function i(){e(t).remove(),e(n).each(function(t){var n=s(e(this));if(!n.hasClass("ai1ec-open"))return;n.trigger(t=e.Event("hide.bs.dropdown"));if(t.isDefaultPrevented())return;n.removeClass("ai1ec-open").trigger("hidden.bs.dropdown")})}function s(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&e(n);return r&&r.length?r:t.parent()}var t=".ai1ec-dropdown-backdrop",n="[data-toggle=ai1ec-dropdown]",r=function(t){e(t).on("click.bs.dropdown",this.toggle)};r.prototype.toggle=function(t){var n=e(this);if(n.is(".ai1ec-disabled, :disabled"))return;var r=s(n),o=r.hasClass("ai1ec-open");i();if(!o){"ontouchstart"in document.documentElement&&!r.closest(".ai1ec-navbar-nav").length&&e('<div class="ai1ec-dropdown-backdrop"/>').insertAfter(e(this)).on("click",i),r.trigger(t=e.Event("show.bs.dropdown"));if(t.isDefaultPrevented())return;r.toggleClass("ai1ec-open").trigger("shown.bs.dropdown"),n.focus()}return!1},r.prototype.keydown=function(t){if(!/(38|40|27)/.test(t.keyCode))return;var r=e(this);t.preventDefault(),t.stopPropagation();if(r.is(".ai1ec-disabled, :disabled"))return;var i=s(r),o=i.hasClass("ai1ec-open");if(!o||o&&t.keyCode==27)return t.which==27&&i.find(n).focus(),r.click();var u=e("[role=menu] li:not(.ai1ec-divider):visible a",i);if(!u.length)return;var a=u.index(u.filter(":focus"));t.keyCode==38&&a>0&&a--,t.keyCode==40&&a<u.length-1&&a++,~a||(a=0),u.eq(a).focus()};var o=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var n=e(this),i=n.data("bs.dropdown");i||n.data("bs.dropdown",i=new r(this)),typeof t=="string"&&i[t].call(n)})},e.fn.dropdown.Constructor=r,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=o,this},e(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".ai1ec-dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",n,r.prototype.toggle).on("keydown.bs.dropdown.data-api",n+", [role=menu]",r.prototype.keydown)}),timely.define("scripts/common_scripts/frontend/common_frontend",["jquery_timely","domReady","scripts/common_scripts/frontend/common_event_handlers","ai1ec_calendar","external_libs/modernizr","external_libs/bootstrap/tooltip","external_libs/constrained_popover","external_libs/bootstrap/dropdown"],function(e,t,n,r,i){var s=!1,o=function(){s=!0,e(document).on("mouseenter",".ai1ec-popup-trigger",n.handle_popover_over),e(document).on("mouseleave",".ai1ec-popup-trigger",n.handle_popover_out),e(document).on("mouseleave",".ai1ec-popup",n.handle_popover_self_out),e(document).on("mouseenter",".ai1ec-tooltip-trigger",n.handle_tooltip_over),e(document).on("mouseleave",".ai1ec-tooltip-trigger",n.handle_tooltip_out),e(document).on("mouseleave",".ai1ec-tooltip",n.handle_tooltip_self_out)},u=function(){t(function(){o()})},a=function(){return s};return{start:u,are_event_listeners_attached:a}}),timely.define("external_libs/select2",["jquery_timely"],function(e){(function(e){typeof e.fn.each2=="undefined"&&e.fn.extend({each2:function(t){var n=e([0]),r=-1,i=this.length;while(++r<i&&(n.context=n[0]=this[r])&&t.call(n[0],r,n)!==!1);return this}})})(e),function(e,t){function l(e,t){var n=0,r=t.length;for(;n<r;n+=1)if(c(e,t[n]))return n;return-1}function c(e,n){return e===n?!0:e===t||n===t?!1:e===null||n===null?!1:e.constructor===String?e===n+"":n.constructor===String?n===e+"":!1}function h(t,n){var r,i,s;if(t===null||t.length<1)return[];r=t.split(n);for(i=0,s=r.length;i<s;i+=1)r[i]=e.trim(r[i]);return r}function p(e){return e.outerWidth(!1)-e.width()}function d(n){var r="keyup-change-value";n.bind("keydown",function(){e.data(n,r)===t&&e.data(n,r,n.val())}),n.bind("keyup",function(){var i=e.data(n,r);i!==t&&n.val()!==i&&(e.removeData(n,r),n.trigger("keyup-change"))})}function v(n){n.bind("mousemove",function(n){var r=a;(r===t||r.x!==n.pageX||r.y!==n.pageY)&&e(n.target).trigger("mousemove-filtered",n)})}function m(e,n,r){r=r||t;var i;return function(){var t=arguments;window.clearTimeout(i),i=window.setTimeout(function(){n.apply(r,t)},e)}}function g(e){var t=!1,n;return function(){return t===!1&&(n=e(),t=!0),n}}function y(e,t){var n=m(e,function(e){t.trigger("scroll-debounced",e)});t.bind("scroll",function(e){l(e.target,t.get())>=0&&n(e)})}function b(e){if(e[0]===document.activeElement)return;window.setTimeout(function(){var t=e[0],n=e.val().length,r;e.focus(),t.setSelectionRange?t.setSelectionRange(n,n):t.createTextRange&&(r=t.createTextRange(),r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",n),r.select())},0)}function w(e){e.preventDefault(),e.stopPropagation()}function E(e){e.preventDefault(),e.stopImmediatePropagation()}function S(t){if(!u){var n=t[0].currentStyle||window.getComputedStyle(t[0],null);u=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"}),u.attr("class","select2-sizer"),e("body").append(u)}return u.text(t.val()),u.width()}function x(t,n,r){var i,s=[],o;i=t.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")===0&&s.push(this)}),i=n.attr("class"),typeof i=="string"&&e(i.split(" ")).each2(function(){this.indexOf("select2-")!==0&&(o=r(this),typeof o=="string"&&o.length>0&&s.push(this))}),t.attr("class",s.join(" "))}function T(e,t,n,r){var i=e.toUpperCase().indexOf(t.toUpperCase()),s=t.length;if(i<0){n.push(r(e));return}n.push(r(e.substring(0,i))),n.push("<span class='select2-match'>"),n.push(r(e.substring(i,i+s))),n.push("</span>"),n.push(r(e.substring(i+s,e.length)))}function N(t){var n,r=0,i=null,s=t.quietMillis||100,o=t.url,u=this;return function(a){window.clearTimeout(n),n=window.setTimeout(function(){r+=1;var n=r,s=t.data,f=o,l=t.transport||e.ajax,c=t.type||"GET",h={};s=s?s.call(u,a.term,a.page,a.context):null,f=typeof f=="function"?f.call(u,a.term,a.page,a.context):f,null!==i&&i.abort(),t.params&&(e.isFunction(t.params)?e.extend(h,t.params.call(u)):e.extend(h,t.params)),e.extend(h,{url:f,dataType:t.dataType,data:s,type:c,cache:!1,success:function(e){if(n<r)return;var i=t.results(e,a.page);a.callback(i)}}),i=l.call(u,h)},s)}}function C(t){var n=t,r,i,s=function(e){return""+e.text};e.isArray(n)&&(i=n,n={results:i}),e.isFunction(n)===!1&&(i=n,n=function(){return i});var o=n();return o.text&&(s=o.text,e.isFunction(s)||(r=n.text,s=function(e){return e[r]})),function(t){var r=t.term,i={results:[]},o;if(r===""){t.callback(n());return}o=function(n,i){var u,a;n=n[0];if(n.children){u={};for(a in n)n.hasOwnProperty(a)&&(u[a]=n[a]);u.children=[],e(n.children).each2(function(e,t){o(t,u.children)}),(u.children.length||t.matcher(r,s(u),n))&&i.push(u)}else t.matcher(r,s(n),n)&&i.push(n)},e(n().results).each2(function(e,t){o(t,i.results)}),t.callback(i)}}function k(n){var r=e.isFunction(n);return function(i){var s=i.term,o={results:[]};e(r?n():n).each(function(){var e=this.text!==t,n=e?this.text:this;(s===""||i.matcher(s,n))&&o.results.push(e?this:{id:this,text:this})}),i.callback(o)}}function L(t,n){if(e.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value")}function A(t){return e.isFunction(t)?t():t}function O(t){var n=0;return e.each(t,function(e,t){t.children?n+=O(t.children):n++}),n}function M(e,n,r,i){var s=e,o=!1,u,a,f,l,h;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return t;for(;;){a=-1;for(f=0,l=i.tokenSeparators.length;f<l;f++){h=i.tokenSeparators[f],a=e.indexOf(h);if(a>=0)break}if(a<0)break;u=e.substring(0,a),e=e.substring(a+h.length);if(u.length>0){u=i.createSearchChoice(u,n);if(u!==t&&u!==null&&i.id(u)!==t&&i.id(u)!==null){o=!1;for(f=0,l=n.length;f<l;f++)if(c(i.id(u),i.id(n[f]))){o=!0;break}o||r(u)}}}if(s!==e)return e}function _(t,n){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=e.extend(r.prototype,n),r}var n,r,i,s,o,u,a,f;n={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){e=e.which?e.which:e;switch(e){case n.LEFT:case n.RIGHT:case n.UP:case n.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case n.SHIFT:case n.CTRL:case n.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&e<=123}},f=e(document),o=function(){var e=1;return function(){return e++}}(),f.bind("mousemove",function(e){a={x:e.pageX,y:e.pageY}}),r=_(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(n){var r,i,s=".select2-results",u;this.opts=n=this.prepareOpts(n),this.id=n.id,n.element.data("select2")!==t&&n.element.data("select2")!==null&&this.destroy(),this.enabled=!0,this.container=this.createContainer(),this.containerId="s2id_"+(n.element.attr("id")||"autogen"+o()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=g(function(){return n.element.closest("body")}),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(A(n.containerCss)),this.container.addClass(A(n.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabIndex"),this.opts.element.data("select2",this).addClass("select2-offscreen").bind("focus.select2",function(){e(this).select2("focus")}).attr("tabIndex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(A(n.dropdownCssClass)),this.dropdown.data("select2",this),this.results=r=this.container.find(s),this.search=i=this.container.find("input.select2-input"),i.attr("tabIndex",this.elementTabIndex),this.resultsPage=0,this.context=null,this.initContainer(),v(this.results),this.dropdown.delegate(s,"mousemove-filtered touchstart touchmove touchend",this.bind(this.highlightUnderEvent)),y(80,this.results),this.dropdown.delegate(s,"scroll-debounced",this.bind(this.loadMoreIfNeeded)),e.fn.mousewheel&&r.mousewheel(function(e,t,n,i){var s=r.scrollTop(),o;i>0&&s-i<=0?(r.scrollTop(0),w(e)):i<0&&r.get(0).scrollHeight-r.scrollTop()+i<=r.height()&&(r.scrollTop(r.get(0).scrollHeight-r.height()),w(e))}),d(i),i.bind("keyup-change input paste",this.bind(this.updateResults)),i.bind("focus",function(){i.addClass("select2-focused")}),i.bind("blur",function(){i.removeClass("select2-focused")}),this.dropdown.delegate(s,"mouseup",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.bind("click mouseup mousedown",function(e){e.stopPropagation()}),e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),(n.element.is(":disabled")||n.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var e=this.opts.element.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),e!==t&&(e.container.remove(),e.dropdown.remove(),e.opts.element.removeClass("select2-offscreen").removeData("select2").unbind(".select2").attr({tabIndex:this.elementTabIndex}).show())},prepareOpts:function(n){var r,i,s,o;r=n.element,r.get(0).tagName.toLowerCase()==="select"&&(this.select=i=n.element),i&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),n=e.extend({},{populateResults:function(r,i,s){var o,u,a,f,l=this.opts.id,c=this;o=function(r,i,u){var a,f,h,p,d,v,m,g,y,b;r=n.sortResults(r,i,s);for(a=0,f=r.length;a<f;a+=1)h=r[a],d=h.disabled===!0,p=!d&&l(h)!==t,v=h.children&&h.children.length>0,m=e("<li></li>"),m.addClass("select2-results-dept-"+u),m.addClass("select2-result"),m.addClass(p?"select2-result-selectable":"select2-result-unselectable"),d&&m.addClass("select2-disabled"),v&&m.addClass("select2-result-with-children"),m.addClass(c.opts.formatResultCssClass(h)),g=e(document.createElement("div")),g.addClass("select2-result-label"),b=n.formatResult(h,g,s,c.opts.escapeMarkup),b!==t&&g.html(b),m.append(g),v&&(y=e("<ul></ul>"),y.addClass("select2-result-sub"),o(h.children,y,u+1),m.append(y)),m.data("select2-data",h),i.append(m)},o(i,r,0)}},e.fn.select2.defaults,n),typeof n.id!="function"&&(s=n.id,n.id=function(e){return e[s]});if(e.isArray(n.element.data("select2Tags"))){if("tags"in n)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id");n.tags=n.element.attr("data-select2-tags")}i?(n.query=this.bind(function(n){var i={results:[],more:!1},s=n.term,o,u,a;a=function(e,t){var r;e.is("option")?n.matcher(s,e.text(),e)&&t.push({id:e.attr("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:c(e.attr("disabled"),"disabled")}):e.is("optgroup")&&(r={text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")},e.children().each2(function(e,t){a(t,r.children)}),r.children.length>0&&t.push(r))},o=r.children(),this.getPlaceholder()!==t&&o.length>0&&(u=o[0],e(u).text()===""&&(o=o.not(u))),o.each2(function(e,t){a(t,i.results)}),n.callback(i)}),n.id=function(e){return e.id},n.formatResultCssClass=function(e){return e.css}):"query"in n||("ajax"in n?(o=n.element.data("ajax-url"),o&&o.length>0&&(n.ajax.url=o),n.query=N.call(n.element,n.ajax)):"data"in n?n.query=C(n.data):"tags"in n&&(n.query=k(n.tags),n.createSearchChoice===t&&(n.createSearchChoice=function(e){return{id:e,text:e}}),n.initSelection===t&&(n.initSelection=function(t,r){var i=[];e(h(t.val(),n.separator)).each(function(){var t=this,r=this,s=n.tags;e.isFunction(s)&&(s=s()),e(s).each(function(){if(c(this.id,t))return r=this.text,!1}),i.push({id:t,text:r})}),r(i)})));if(typeof n.query!="function")throw"query function not defined for Select2 "+n.element.attr("id");return n},monitorSource:function(){var e=this.opts.element,t;e.bind("change.select2",this.bind(function(e){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),t=this.bind(function(){var e,t,n=this;e=this.opts.element.attr("disabled")!=="disabled",t=this.opts.element.attr("readonly")==="readonly",e=e&&!t,this.enabled!==e&&(e?this.enable():this.disable()),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(A(this.opts.containerCssClass)),x(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(A(this.opts.dropdownCssClass))}),e.bind("propertychange.select2 DOMAttrModified.select2",t),typeof WebKitMutationObserver!="undefined"&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(function(e){e.forEach(t)}),this.propertyObserver.observe(e.get(0),{attributes:!0,subtree:!1}))},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){if(this.enabled)return;this.enabled=!0,this.container.removeClass("select2-container-disabled"),this.opts.element.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"),this.opts.element.attr("disabled","disabled")},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t=this.container.offset(),n=this.container.outerHeight(!1),r=this.container.outerWidth(!1),i=this.dropdown.outerHeight(!1),s=e(window).scrollLeft()+e(window).width(),o=e(window).scrollTop()+e(window).height(),u=t.top+n,a=t.left,f=u+i<=o,l=t.top-i>=this.body().scrollTop(),c=this.dropdown.outerWidth(!1),h=a+c<=s,p=this.dropdown.hasClass("select2-drop-above"),d,v,m;this.body().css("position")!=="static"&&(d=this.body().offset(),u-=d.top,a-=d.left),p?(v=!0,!l&&f&&(v=!1)):(v=!1,!f&&l&&(v=!0)),h||(a=t.left+r-c),v?(u=t.top-i,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")),m=e.extend({top:u,left:a,width:r},A(this.opts.dropdownCss)),this.dropdown.css(m)},shouldOpen:function(){var t;return this.opened()?!1:(t=e.Event("opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(window.setTimeout(this.bind(this.opening),1),!0):!1},opening:function(){var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t,s;this.clearDropdownAlignmentPreference(),this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),this.updateResults(!0),s=e("#select2-drop-mask"),s.length==0&&(s=e(document.createElement("div")),s.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),s.hide(),s.appendTo(this.body()),s.bind("mousedown touchstart",function(t){var n=e("#select2-drop"),r;n.length>0&&(r=n.data("select2"),r.opts.selectOnBlur&&r.selectHighlighted({noFocus:!0}),r.close())})),this.dropdown.prev()[0]!==s[0]&&this.dropdown.before(s),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),s.css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),s.show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this.ensureHighlightVisible();var o=this;this.container.parents().add(window).each(function(){e(this).bind(r+" "+n+" "+i,function(t){e("#select2-drop-mask").css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),o.positionDropdown()})}),this.focusSearch()},close:function(){if(!this.opened())return;var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).unbind(n).unbind(r).unbind(i)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.opts.element.trigger(e.Event("close"))},clearSearch:function(){},getMaximumSelectionSize:function(){return A(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t=this.results,n,r,i,s,o,u,a;r=this.highlight();if(r<0)return;if(r==0){t.scrollTop(0);return}n=this.findHighlightableChoices(),i=e(n[r]),s=i.offset().top+i.outerHeight(!0),r===n.length-1&&(a=t.find("li.select2-more-results"),a.length>0&&(s=a.offset().top+a.outerHeight(!0))),o=t.offset().top+t.outerHeight(!0),s>o&&t.scrollTop(t.scrollTop()+(s-o)),u=i.offset().top-t.offset().top,u<0&&i.css("display")!="none"&&t.scrollTop(t.scrollTop()+u)},findHighlightableChoices:function(){var e=this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)");return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){var n=this.findHighlightableChoices(),r=this.highlight();while(r>-1&&r<n.length){r+=t;var i=e(n[r]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(r);break}}},highlight:function(t){var n=this.findHighlightableChoices(),r,i;if(arguments.length===0)return l(n.filter(".select2-highlighted")[0],n.get());t>=n.length&&(t=n.length-1),t<0&&(t=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),r=e(n[t]),r.addClass("select2-highlighted"),this.ensureHighlightVisible(),i=r.data("select2-data"),i&&this.opts.element.trigger({type:"highlight",val:this.id(i),choice:i})},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var n=e(t.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var r=this.findHighlightableChoices();this.highlight(r.index(n))}else n.length==0&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),n,r=-1,i=this.resultsPage+1,s=this,o=this.search.val(),u=this.context;if(t.length===0)return;n=t.offset().top-e.offset().top-e.height(),n<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:o,page:i,context:u,matcher:this.opts.matcher,callback:this.bind(function(n){if(!s.opened())return;s.opts.populateResults.call(this,e,n.results,{term:o,page:i,context:u}),n.more===!0?(t.detach().appendTo(e).text(s.opts.formatLoadMore(i+1)),window.setTimeout(function(){s.loadMoreIfNeeded()},10)):t.remove(),s.positionDropdown(),s.resultsPage=i,s.context=n.context})}))},tokenize:function(){},updateResults:function(n){function f(){i.scrollTop(0),r.removeClass("select2-active"),u.positionDropdown()}function l(e){i.html(e),f()}var r=this.search,i=this.results,s=this.opts,o,u=this,a;if(n!==!0&&(this.showSearchInput===!1||!this.opened()))return;r.addClass("select2-active");var h=this.getMaximumSelectionSize();if(h>=1){o=this.data();if(e.isArray(o)&&o.length>=h&&L(s.formatSelectionTooBig,"formatSelectionTooBig")){l("<li class='select2-selection-limit'>"+s.formatSelectionTooBig(h)+"</li>");return}}if(r.val().length<s.minimumInputLength){L(s.formatInputTooShort,"formatInputTooShort")?l("<li class='select2-no-results'>"+s.formatInputTooShort(r.val(),s.minimumInputLength)+"</li>"):l("");return}s.formatSearching()&&n===!0&&l("<li class='select2-searching'>"+s.formatSearching()+"</li>");if(s.maximumInputLength&&r.val().length>s.maximumInputLength){L(s.formatInputTooLong,"formatInputTooLong")?l("<li class='select2-no-results'>"+s.formatInputTooLong(r.val(),s.maximumInputLength)+"</li>"):l("");return}a=this.tokenize(),a!=t&&a!=null&&r.val(a),this.resultsPage=1,s.query({element:s.element,term:r.val(),page:this.resultsPage,context:null,matcher:s.matcher,callback:this.bind(function(o){var a;if(!this.opened())return;this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&r.val()!==""&&(a=this.opts.createSearchChoice.call(null,r.val(),o.results),a!==t&&a!==null&&u.id(a)!==t&&u.id(a)!==null&&e(o.results).filter(function(){return c(u.id(this),u.id(a))}).length===0&&o.results.unshift(a));if(o.results.length===0&&L(s.formatNoMatches,"formatNoMatches")){l("<li class='select2-no-results'>"+s.formatNoMatches(r.val())+"</li>");return}i.empty(),u.opts.populateResults.call(this,i,o.results,{term:r.val(),page:this.resultsPage,context:null}),o.more===!0&&L(s.formatLoadMore,"formatLoadMore")&&(i.append("<li class='select2-more-results'>"+u.opts.escapeMarkup(s.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){u.loadMoreIfNeeded()},10)),this.postprocessResults(o,n),f()})})},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){b(this.search)},selectHighlighted:function(e){var t=this.highlight(),n=this.results.find(".select2-highlighted"),r=n.closest(".select2-result").data("select2-data");r&&(this.highlight(t),this.onSelect(r,e))},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){function n(){var n,r,i,s,o;if(this.opts.width==="off")return null;if(this.opts.width==="element")return this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px";if(this.opts.width==="copy"||this.opts.width==="resolve"){n=this.opts.element.attr("style");if(n!==t){r=n.split(";");for(s=0,o=r.length;s<o;s+=1){i=r[s].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);if(i!==null&&i.length>=1)return i[1]}}return this.opts.width==="resolve"?(n=this.opts.element.css("width"),n.indexOf("%")>0?n:this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var r=n.call(this);r!==null&&this.container.css("width",r)}}),i=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>"," <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>"," <div><b></b></div>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop' style='display:none'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.focusser.attr("disabled","disabled")},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.focusser.removeAttr("disabled")},opening:function(){this.parent.opening.apply(this,arguments),this.focusser.attr("disabled","disabled"),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),b(this.focusser)},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var e,t=this.container,r=this.dropdown,i=!1;this.showSearch(this.opts.minimumResultsForSearch>=0),this.selection=e=t.find(".select2-choice"),this.focusser=t.find(".select2-focusser"),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN){w(e);return}switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.TAB:case n.ENTER:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}})),this.focusser.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.ESC)return;if(this.opts.openOnEnter===!1&&e.which===n.ENTER){w(e);return}if(e.which==n.DOWN||e.which==n.UP||e.which==n.ENTER&&this.opts.openOnEnter){this.open(),w(e);return}if(e.which==n.DELETE||e.which==n.BACKSPACE){this.opts.allowClear&&this.clear(),w(e);return}})),d(this.focusser),this.focusser.bind("keyup-change input",this.bind(function(e){if(this.opened())return;this.open(),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.focusser.val(""),w(e)})),e.delegate("abbr","mousedown",this.bind(function(e){if(!this.enabled)return;this.clear(),E(e),this.close(),this.selection.focus()})),e.bind("mousedown",this.bind(function(e){i=!0,this.opened()?this.close():this.enabled&&this.open(),w(e),i=!1})),r.bind("mousedown",this.bind(function(){this.search.focus()})),e.bind("focus",this.bind(function(e){w(e)})),this.focusser.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})).bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active")})),this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.setPlaceholder()},clear:function(){var e=this.selection.data("select2-data");this.opts.element.val(""),this.selection.find("span").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),this.opts.element.trigger({type:"removed",val:this.id(e),choice:e}),this.triggerChange({removed:e})},initSelection:function(){var e;if(this.opts.element.val()===""&&this.opts.element.text()==="")this.close(),this.setPlaceholder();else{var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.setPlaceholder())})}},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(t,n){var r=t.find(":selected");e.isFunction(n)&&n({id:r.attr("value"),text:r.text(),element:r})}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=n.val();t.query({matcher:function(e,n,r){return c(i,t.id(r))},callback:e.isFunction(r)?function(e){r(e.results.length?e.results[0]:null)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.select.find("option").first().text()!==""?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.opts.element.val()===""&&e!==t){if(this.select&&this.select.find("option:first").text()!=="")return;this.selection.find("span").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide()}},postprocessResults:function(e,t){var n=0,r=this,i=!0;this.findHighlightableChoices().each2(function(e,t){if(c(r.id(t.data("select2-data")),r.opts.element.val()))return n=e,!1}),this.highlight(n);if(t===!0){var s=this.opts.minimumResultsForSearch;i=s<0?!1:O(e.results)>=s,this.showSearch(i)}},showSearch:function(t){this.showSearchInput=t,this.dropdown.find(".select2-search")[t?"removeClass":"addClass"]("select2-search-hidden"),e(this.dropdown,this.container)[t?"addClass":"removeClass"]("select2-with-searchbox")},onSelect:function(e,t){var n=this.opts.element.val();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.close(),(!t||!t.noFocus)&&this.selection.focus(),c(n,this.id(e))||this.triggerChange()},updateSelection:function(e){var n=this.selection.find("span"),r;this.selection.data("select2-data",e),n.empty(),r=this.opts.formatSelection(e,n),r!==t&&n.append(this.opts.escapeMarkup(r)),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.selection.find("abbr").show()},val:function(){var e,n=!1,r=null,i=this;if(arguments.length===0)return this.opts.element.val();e=arguments[0],arguments.length>1&&(n=arguments[1]);if(this.select)this.select.val(e).find(":selected").each2(function(e,t){return r={id:t.attr("value"),text:t.text()},!1}),this.updateSelection(r),this.setPlaceholder(),n&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!e&&e!==0){this.clear(),n&&this.triggerChange();return}this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){i.opts.element.val(e?i.id(e):""),i.updateSelection(e),i.setPlaceholder(),n&&i.triggerChange()})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var n;if(arguments.length===0)return n=this.selection.data("select2-data"),n==t&&(n=null),n;!e||e===""?this.clear():(this.opts.element.val(e?this.id(e):""),this.updateSelection(e))}}),s=_(r,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html([" <ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi' style='display:none;'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(e,t){var n=[];e.find(":selected").each2(function(e,t){n.push({id:t.attr("value"),text:t.text(),element:t[0]})}),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=h(n.val(),t.separator);t.query({matcher:function(n,r,s){return e.grep(i,function(e){return c(e,t.id(s))}).length},callback:e.isFunction(r)?function(e){r(e.results)}:e.noop})}),t},initContainer:function(){var t=".select2-choices",r;this.searchContainer=this.container.find(".select2-search-field"),this.selection=r=this.container.find(t),this.search.bind("input paste",this.bind(function(){if(!this.enabled)return;this.opened()||this.open()})),this.search.bind("keydown",this.bind(function(e){if(!this.enabled)return;if(e.which===n.BACKSPACE&&this.search.val()===""){this.close();var t,i=r.find(".select2-search-choice-focus");if(i.length>0){this.unselect(i.first()),this.search.width(10),w(e);return}t=r.find(".select2-search-choice:not(.select2-locked)"),t.length>0&&t.last().addClass("select2-search-choice-focus")}else r.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(e.which){case n.UP:case n.DOWN:this.moveHighlight(e.which===n.UP?-1:1),w(e);return;case n.ENTER:case n.TAB:this.selectHighlighted(),w(e);return;case n.ESC:this.cancel(e),w(e);return}if(e.which===n.TAB||n.isControl(e)||n.isFunctionKey(e)||e.which===n.BACKSPACE||e.which===n.ESC)return;if(e.which===n.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===n.PAGE_UP||e.which===n.PAGE_DOWN)&&w(e)})),this.search.bind("keyup",this.bind(this.resizeSearch)),this.search.bind("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.opened()||this.clearSearch(),e.stopImmediatePropagation()})),this.container.delegate(t,"mousedown",this.bind(function(t){if(!this.enabled)return;if(e(t.target).closest(".select2-search-choice").length>0)return;this.clearPlaceholder(),this.open(),this.focusSearch(),t.preventDefault()})),this.container.delegate(t,"focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder()})),this.initContainerWidth(),this.clearSearch()},enable:function(){if(this.enabled)return;this.parent.enable.apply(this,arguments),this.search.removeAttr("disabled")},disable:function(){if(!this.enabled)return;this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0)},initSelection:function(){var e;this.opts.element.val()===""&&this.opts.element.text()===""&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||this.opts.element.val()!==""){var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder();e!==t&&this.getVal().length===0&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.resizeSearch()):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.parent.opening.apply(this,arguments),this.clearPlaceholder(),this.resizeSearch(),this.focusSearch(),this.opts.element.trigger(e.Event("open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus(),this.opts.element.triggerHandler("focus")},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var n=[],r=[],i=this;e(t).each(function(){l(i.id(this),n)<0&&(n.push(i.id(this)),r.push(this))}),t=r,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){i.addSelectedChoice(this)}),i.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer(e,this.data(),this.bind(this.onSelect),this.opts),e!=null&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),(!t||!t.noFocus)&&this.focusSearch()},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(n){var r=!n.locked,i=e("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=e("<li class='select2-search-choice select2-locked'><div></div></li>"),o=r?i:s,u=this.id(n),a=this.getVal(),f;f=this.opts.formatSelection(n,o.find("div")),f!=t&&o.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"</div>"),r&&o.find(".select2-search-choice-close").bind("mousedown",w).bind("click dblclick",this.bind(function(t){if(!this.enabled)return;e(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),w(t)})).bind("focus",this.bind(function(){if(!this.enabled)return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active")})),o.data("select2-data",n),o.insertBefore(this.searchContainer),a.push(u),this.setVal(a)},unselect:function(e){var t=this.getVal(),n,r;e=e.closest(".select2-search-choice");if(e.length===0)throw"Invalid argument: "+e+". Must be .select2-search-choice";n=e.data("select2-data");if(!n)return;r=l(this.id(n),t),r>=0&&(t.splice(r,1),this.setVal(t),this.select&&this.postprocessResults()),e.remove(),this.opts.element.trigger({type:"removed",val:this.id(n),choice:n}),this.triggerChange({removed:n})},postprocessResults:function(){var e=this.getVal(),t=this.results.find(".select2-result"),n=this.results.find(".select2-result-with-children"),r=this;t.each2(function(t,n){var i=r.id(n.data("select2-data"));l(i,e)>=0&&(n.addClass("select2-selected"),n.find(".select2-result-selectable").addClass("select2-selected"))}),n.each2(function(e,t){!t.is(".select2-result-selectable")&&t.find(".select2-result-selectable:not(.select2-selected)").length===0&&t.addClass("select2-selected")}),this.highlight()==-1&&r.highlight(0)},resizeSearch:function(){var e,t,n,r,i,s=p(this.search);e=S(this.search)+10,t=this.search.offset().left,n=this.selection.width(),r=this.selection.offset().left,i=n-(t-r)-s,i<e&&(i=n-s),i<40&&(i=n-s),i<=0&&(i=e),this.search.width(i)},getVal:function(){var e;return this.select?(e=this.select.val(),e===null?[]:e):(e=this.opts.element.val(),h(e,this.opts.separator))},setVal:function(t){var n;this.select?this.select.val(t):(n=[],e(t).each(function(){l(this,n)<0&&n.push(this)}),this.opts.element.val(n.length===0?"":n.join(this.opts.separator)))},val:function(){var n,r=!1,i=[],s=this;if(arguments.length===0)return this.getVal();n=arguments[0],arguments.length>1&&(r=arguments[1]);if(!n&&n!==0){this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),r&&this.triggerChange();return}this.setVal(n);if(this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),r&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var n=e(t).map(s.id);s.setVal(n),s.updateSelection(t),s.clearSearch(),r&&s.triggerChange()})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],n=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(n.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t){var n=this,r;if(arguments.length===0)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();t||(t=[]),r=e.map(t,function(e){return n.opts.id(e)}),this.setVal(r),this.updateSelection(t),this.clearSearch()}}),e.fn.select2=function(){var n=Array.prototype.slice.call(arguments,0),r,o,u,a,f=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","disable","positionDropdown","data"];return this.each(function(){if(n.length===0||typeof n[0]=="object")r=n.length===0?{}:e.extend({},n[0]),r.element=e(this),r.element.get(0).tagName.toLowerCase()==="select"?a=r.element.attr("multiple"):(a=r.multiple||!1,"tags"in r&&(r.multiple=a=!0)),o=a?new s:new i,o.init(r);else{if(typeof n[0]!="string")throw"Invalid arguments to select2 plugin: "+n;if(l(n[0],f)<0)throw"Unknown method: "+n[0];u=t,o=e(this).data("select2");if(o===t)return;n[0]==="container"?u=o.container:u=o[n[0]].apply(o,n.slice(1));if(u!==t)return!1}}),u===t?this:u},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,n,r){var i=[];return T(e.text,n.term,i,r),i.join("")},formatSelection:function(e,n){return e?e.text:t},sortResults:function(e,t,n){return e},formatResultCssClass:function(e){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" more character"+(n==1?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please enter "+n+" less character"+(n==1?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(e==1?"":"s")},formatLoadMore:function(e){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e.id},matcher:function(e,t){return t.toUpperCase().indexOf(e.toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;","/":"&#47;"};return String(e).replace(/[&<>"'/\\]/g,function(e){return t[e[0]]})},blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null}}}(e)}),timely.define("libs/select2_multiselect_helper",["jquery_timely","external_libs/select2"],function(e){var t=function(t){var n=e(t.element),r=n.data("color"),i=n.data("description"),s="";return typeof r!="undefined"&&r!==""&&(s+='<span class="ai1ec-color-swatch" style="background: '+n.data("color")+'"></span> '),s+=t.text,s='<span title="'+i+'">'+s+"</span>",s},n=function(t){var n=e(t.element),r=n.data("color"),i=n.data("description"),s="";return typeof r!="undefined"&&r!==""?s+='<span class="ai1ec-color-swatch" style="background: '+n.data("color")+'"></span> ':s+='<span class="ai1ec-color-swatch-empty"></span> ',s+=t.text,s='<span title="'+i+'">'+s+"</span>",s},r=function(r){typeof r=="undefined"&&(r=e(document)),e(".ai1ec-select2-multiselect-selector",r).select2({allowClear:!0,formatResult:n,formatSelection:t,escapeMarkup:function(e){return e}})},i=function(t){e(".ai1ec-select2-multiselect-selector.select2-container",t).each(function(){e(this).data("select2").resizeSearch()})};return{init:r,refresh:i}});var Twig=function(e){return e.VERSION="0.7.2",e}(Twig||{}),Twig=function(e){function t(e,t){var n=Object.prototype.toString.call(t).slice(8,-1);return t!==undefined&&t!==null&&n===e}function n(t,n){var r,i,s="/",o=[],u;if(t.url)typeof t.base!="undefined"?r=t.base+(t.base.charAt(t.base.length-1)==="/"?"":"/"):r=t.url;else{if(!t.path)throw new e.Error("Cannot extend an inline template.");var a=require("path"),f=a.sep||s,l=new RegExp("^\\.{1,2}"+f.replace("\\","\\\\"));n=n.replace(/\//g,f),t.base!==undefined&&n.match(l)==null?(n=n.replace(t.base,""),r=t.base+f):r=t.path,r=r.replace(f+f,f),s=f}i=r.split(s),i.pop(),i=i.concat(n.split(s));while(i.length>0)u=i.shift(),u!="."&&(u==".."&&o.length>0&&o[o.length-1]!=".."?o.pop():o.push(u));return o.join(s)}return e.trace=!1,e.debug=!1,e.cache=!0,e.placeholders={parent:"{{|PARENT|}}"},e.indexOf=function(e,t){if(Array.prototype.hasOwnProperty("indexOf"))return e.indexOf(t);if(e===void 0||e===null)throw new TypeError;var n=Object(e),r=n.length>>>0;if(r===0)return-1;var i=0;arguments.length>0&&(i=Number(arguments[1]),i!==i?i=0:i!==0&&i!==Infinity&&i!==-Infinity&&(i=(i>0||-1)*Math.floor(Math.abs(i))));if(i>=r)return-1;var s=i>=0?i:Math.max(r-Math.abs(i),0);for(;s<r;s++)if(s in n&&n[s]===t)return s;return e==t?0:-1},e.forEach=function(e,t,n){if(Array.prototype.forEach)return e.forEach(t,n);var r,i;if(e==null)throw new TypeError(" this is null or not defined");var s=Object(e),o=s.length>>>0;if({}.toString.call(t)!="[object Function]")throw new TypeError(t+" is not a function");n&&(r=n),i=0;while(i<o){var u;i in s&&(u=s[i],t.call(r,u,i,s)),i++}},e.Error=function(e){this.message=e,this.name="TwigException",this.type="TwigException"},e.Error.prototype.toString=function(){var e=this.name+": "+this.message;return e},e.log={trace:function(){e.trace&&console&&console.log(Array.prototype.slice.call(arguments))},debug:function(){e.debug&&console&&console.log(Array.prototype.slice.call(arguments))}},typeof console!="undefined"&&typeof console.log!="undefined"?e.log.error=function(){console.log.apply(console,arguments)}:e.log.error=function(){},e.token={},e.token.type={output:"output",logic:"logic",comment:"comment",raw:"raw"},e.token.definitions=[{type:e.token.type.raw,open:"{% raw %}",close:"{% endraw %}"},{type:e.token.type.output,open:"{{",close:"}}"},{type:e.token.type.logic,open:"{%",close:"%}"},{type:e.token.type.comment,open:"{#",close:"#}"}],e.token.strings=['"',"'"],e.token.findStart=function(t){var n={position:null,def:null},r,i,s;for(r=0;r<e.token.definitions.length;r++)i=e.token.definitions[r],s=t.indexOf(i.open),e.log.trace("Twig.token.findStart: ","Searching for ",i.open," found at ",s),s>=0&&(n.position===null||s<n.position)&&(n.position=s,n.def=i);return n},e.token.findEnd=function(t,n,r){var i=null,s=!1,o=0,u=null,a=null,f=null,l=null,c=null,h=null,p,d;while(!s){u=null,a=null,f=t.indexOf(n.close,o);if(!(f>=0))throw new e.Error("Unable to find closing bracket '"+n.close+"'"+" opened near template position "+r);i=f,s=!0;if(n.type===e.token.type.comment)break;d=e.token.strings.length;for(p=0;p<d;p+=1)c=t.indexOf(e.token.strings[p],o),c>0&&c<f&&(u===null||c<u)&&(u=c,a=e.token.strings[p]);if(u!==null){l=u+1,i=null,s=!1;for(;;){h=t.indexOf(a,l);if(h<0)throw"Unclosed string in template";if(t.substr(h-1,1)!=="\\"){o=h+1;break}l=h+1}}}return i},e.tokenize=function(t){var n=[],r=0,i=null,s=null;while(t.length>0)i=e.token.findStart(t),e.log.trace("Twig.tokenize: ","Found token: ",i),i.position!==null?(i.position>0&&n.push({type:e.token.type.raw,value:t.substring(0,i.position)}),t=t.substr(i.position+i.def.open.length),r+=i.position+i.def.open.length,s=e.token.findEnd(t,i.def,r),e.log.trace("Twig.tokenize: ","Token ends at ",s),n.push({type:i.def.type,value:t.substring(0,s).trim()}),i.def.type==="logic"&&t.substr(s+i.def.close.length,1)==="\n"&&(s+=1),t=t.substr(s+i.def.close.length),r+=s+i.def.close.length):(n.push({type:e.token.type.raw,value:t}),t="");return n},e.compile=function(t){try{var n=[],r=[],i=[],s=null,o=null,u=null,a=null,f=null,l=null,c=null,h=null,p=null;while(t.length>0){s=t.shift(),e.log.trace("Compiling token ",s);switch(s.type){case e.token.type.raw:r.length>0?i.push(s):n.push(s);break;case e.token.type.logic:o=e.logic.compile.apply(this,[s]),c=o.type,h=e.logic.handler[c].open,p=e.logic.handler[c].next,e.log.trace("Twig.compile: ","Compiled logic token to ",o," next is: ",p," open is : ",h);if(h!==undefined&&!h){a=r.pop(),f=e.logic.handler[a.type];if(e.indexOf(f.next,c)<0)throw new Error(c+" not expected after a "+a.type);a.output=a.output||[],a.output=a.output.concat(i),i=[],l={type:e.token.type.logic,token:a},r.length>0?i.push(l):n.push(l)}p!==undefined&&p.length>0?(e.log.trace("Twig.compile: ","Pushing ",o," to logic stack."),r.length>0&&(a=r.pop(),a.output=a.output||[],a.output=a.output.concat(i),r.push(a),i=[]),r.push(o)):h!==undefined&&h&&(l={type:e.token.type.logic,token:o},r.length>0?i.push(l):n.push(l));break;case e.token.type.comment:break;case e.token.type.output:e.expression.compile.apply(this,[s]),r.length>0?i.push(s):n.push(s)}e.log.trace("Twig.compile: "," Output: ",n," Logic Stack: ",r," Pending Output: ",i)}if(r.length>0)throw u=r.pop(),new Error("Unable to find an end tag for "+u.type+", expecting one of "+u.next);return n}catch(d){e.log.error("Error compiling twig template "+this.id+": "),d.stack?e.log.error(d.stack):e.log.error(d.toString());if(this.options.rethrow)throw d}},e.parse=function(t,n){try{var r=[],i=!0,s=this;return n=n||{},e.forEach(t,function(o){e.log.debug("Twig.parse: ","Parsing token: ",o);switch(o.type){case e.token.type.raw:r.push(o.value);break;case e.token.type.logic:var u=o.token,a=e.logic.parse.apply(s,[u,n,i]);a.chain!==undefined&&(i=a.chain),a.context!==undefined&&(n=a.context),a.output!==undefined&&r.push(a.output);break;case e.token.type.comment:break;case e.token.type.output:e.log.debug("Twig.parse: ","Output token: ",o.stack),r.push(e.expression.parse.apply(s,[o.stack,n]))}}),r.join("")}catch(o){e.log.error("Error parsing twig template "+this.id+": "),o.stack?e.log.error(o.stack):e.log.error(o.toString());if(this.options.rethrow)throw o;if(e.debug)return o.toString()}},e.prepare=function(t){var n,r;return e.log.debug("Twig.prepare: ","Tokenizing ",t),r=e.tokenize.apply(this,[t]),e.log.debug("Twig.prepare: ","Compiling ",r),n=e.compile.apply(this,[r]),e.log.debug("Twig.prepare: ","Compiled ",n),n},e.Templates={registry:{}},e.validateId=function(t){if(t==="prototype")throw new e.Error(t+" is not a valid twig identifier");if(e.Templates.registry.hasOwnProperty(t))throw new e.Error("There is already a template with the ID "+t);return!0},e.Templates.save=function(t){if(t.id===undefined)throw new e.Error("Unable to save template with no id");e.Templates.registry[t.id]=t},e.Templates.load=function(t){return e.Templates.registry.hasOwnProperty(t)?e.Templates.registry[t]:null},e.Templates.loadRemote=function(t,n,r,i){var s=n.id,o=n.method,u=n.async,a=n.precompiled,f=null;u===undefined&&(u=!0),s===undefined&&(s=t),n.id=s;if(e.cache&&e.Templates.registry.hasOwnProperty(s))return r&&r(e.Templates.registry[s]),e.Templates.registry[s];if(o=="ajax"){if(typeof XMLHttpRequest=="undefined")throw new e.Error("Unsupported platform: Unable to do remote requests because there is no XMLHTTPRequest implementation");var l=new XMLHttpRequest;l.onreadystatechange=function(){var s=null;l.readyState==4&&(l.status==200?(e.log.debug("Got template ",l.responseText),a===!0?s=JSON.parse(l.responseText):s=l.responseText,n.url=t,n.data=s,f=new e.Template(n),r&&r(f)):i&&i(l))},l.open("GET",t,u),l.send()}else(function(){var s=require("fs"),o=require("path"),l=null,c=function(s,o){if(s){i&&i(s);return}a===!0&&(o=JSON.parse(o)),n.data=o,n.path=t,f=new e.Template(n),r&&r(f)};if(u===!0)s.stat(t,function(n,r){if(n||!r.isFile())throw new e.Error("Unable to find template file "+t);s.readFile(t,"utf8",c)});else{if(!s.statSync(t).isFile())throw new e.Error("Unable to find template file "+t);l=s.readFileSync(t,"utf8"),c(undefined,l)}})();return u===!1?f:!0},e.Template=function(n){var r=n.data,i=n.id,s=n.blocks,o=n.macros||{},u=n.base,a=n.path,f=n.url,l=n.options;this.id=i,this.base=u,this.path=a,this.url=f,this.macros=o,this.options=l,this.reset(s),t("String",r)?this.tokens=e.prepare.apply(this,[r]):this.tokens=r,i!==undefined&&e.Templates.save(this)},e.Template.prototype.reset=function(t){e.log.debug("Twig.Template.reset","Reseting template "+this.id),this.blocks={},this.child={blocks:t||{}},this.extend=null},e.Template.prototype.render=function(t,r){r=r||{};var i,s;this.context=t||{},this.reset(),r.blocks&&(this.blocks=r.blocks),r.macros&&(this.macros=r.macros),i=e.parse.apply(this,[this.tokens,this.context]);if(this.extend){var o;return this.options.allowInlineIncludes&&(o=e.Templates.load(this.extend),o&&(o.options=this.options)),o||(s=n(this,this.extend),o=e.Templates.loadRemote(s,{method:this.url?"ajax":"fs",base:this.base,async:!1,id:s,options:this.options})),this.parent=o,this.parent.render(this.context,{blocks:this.blocks})}return r.output=="blocks"?this.blocks:r.output=="macros"?this.macros:i},e.Template.prototype.importFile=function(t){var r,i;if(!this.url&&!this.path&&this.options.allowInlineIncludes){i=e.Templates.load(t),i.options=this.options;if(i)return i;throw new e.Error("Didn't find the inline template by id")}return r=n(this,t),i=e.Templates.loadRemote(r,{method:this.url?"ajax":"fs",base:this.base,async:!1,options:this.options,id:r}),i},e.Template.prototype.importBlocks=function(t,n){var r=this.importFile(t),i=this.context,s=this,o;n=n||!1,r.render(i),e.forEach(Object.keys(r.blocks),function(e){if(n||s.blocks[e]===undefined)s.blocks[e]=r.blocks[e]})},e.Template.prototype.importMacros=function(t){var r=n(this,t),i=e.Templates.loadRemote(r,{method:this.url?"ajax":"fs",async:!1,id:r});return i},e.Template.prototype.compile=function(t){return e.compiler.compile(this,t)},e}(Twig||{});(function(){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on non-object");var t=[],n;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t})})();var Twig=function(e){e.lib={};var t=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function n(e,t){for(var n=[];t>0;n[--t]=e);return n.join("")}var r=function(){return r.cache.hasOwnProperty(arguments[0])||(r.cache[arguments[0]]=r.parse(arguments[0])),r.format.call(null,r.cache[arguments[0]],arguments)};return r.format=function(r,i){var s=1,o=r.length,u="",a,f=[],l,c,h,p,d,v;for(l=0;l<o;l++){u=e(r[l]);if(u==="string")f.push(r[l]);else if(u==="array"){h=r[l];if(h[2]){a=i[s];for(c=0;c<h[2].length;c++){if(!a.hasOwnProperty(h[2][c]))throw t('[sprintf] property "%s" does not exist',h[2][c]);a=a[h[2][c]]}}else h[1]?a=i[h[1]]:a=i[s++];if(/[^s]/.test(h[8])&&e(a)!="number")throw t("[sprintf] expecting number but found %s",e(a));switch(h[8]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":a=parseInt(a,10);break;case"e":a=h[7]?a.toExponential(h[7]):a.toExponential();break;case"f":a=h[7]?parseFloat(a).toFixed(h[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&h[7]?a.substring(0,h[7]):a;break;case"u":a=Math.abs(a);break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}a=/[def]/.test(h[8])&&h[3]&&a>=0?"+"+a:a,d=h[4]?h[4]=="0"?"0":h[4].charAt(1):" ",v=h[6]-String(a).length,p=h[6]?n(d,v):"",f.push(h[5]?a+p:p+a)}}return f.join("")},r.cache={},r.parse=function(e){var t=e,n=[],r=[],i=0;while(t){if((n=/^[^\x25]+/.exec(t))!==null)r.push(n[0]);else if((n=/^\x25{2}/.exec(t))!==null)r.push("%");else{if((n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t))===null)throw"[sprintf] huh?";if(n[2]){i|=1;var s=[],o=n[2],u=[];if((u=/^([a-z_][a-z_\d]*)/i.exec(o))===null)throw"[sprintf] huh?";s.push(u[1]);while((o=o.substring(u[0].length))!=="")if((u=/^\.([a-z_][a-z_\d]*)/i.exec(o))!==null)s.push(u[1]);else{if((u=/^\[(\d+)\]/.exec(o))===null)throw"[sprintf] huh?";s.push(u[1])}n[2]=s}else i|=2;if(i===3)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";r.push(n)}t=t.substring(n[0].length)}return r},r}(),n=function(e,n){return n.unshift(e),t.apply(null,n)};return e.lib.sprintf=t,e.lib.vsprintf=n,function(){function s(e){return(e=Math.abs(e)%100)%10==1&&e!=11?"st":e%10==2&&e!=12?"nd":e%10==3&&e!=13?"rd":"th"}function o(e){var t=new Date(e.getFullYear()+1,0,4);return(t-e)/864e5<7&&(e.getDay()+6)%7<(t.getDay()+6)%7?t.getFullYear():e.getMonth()>0||e.getDate()>=4?e.getFullYear():e.getFullYear()-((e.getDay()+6)%7-e.getDate()>2?1:0)}function u(e){var t=new Date(o(e),0,4);return t.setDate(t.getDate()-(t.getDay()+6)%7),parseInt((e-t)/6048e5)+1}var t="Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),n="Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),r="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),i="January,February,March,April,May,June,July,August,September,October,November,December".split(",");e.lib.formatDate=function(e,a){if(typeof a!="string"||/^\s*$/.test(a))return e+"";var f=new Date(e.getFullYear(),0,1),l=e;return a.replace(/[dDjlNSwzWFmMntLoYyaABgGhHisuU]/g,function(e){switch(e){case"d":return("0"+l.getDate()).replace(/^.+(..)$/,"$1");case"D":return t[l.getDay()];case"j":return l.getDate();case"l":return n[l.getDay()];case"N":return(l.getDay()+6)%7+1;case"S":return s(l.getDate());case"w":return l.getDay();case"z":return Math.ceil((f-l)/864e5);case"W":return("0"+u(l)).replace(/^.(..)$/,"$1");case"F":return i[l.getMonth()];case"m":return("0"+(l.getMonth()+1)).replace(/^.+(..)$/,"$1");case"M":return r[l.getMonth()];case"n":return l.getMonth()+1;case"t":return(new Date(l.getFullYear(),l.getMonth()+1,-1)).getDate();case"L":return(new Date(l.getFullYear(),1,29)).getDate()==29?1:0;case"o":return o(l);case"Y":return l.getFullYear();case"y":return(l.getFullYear()+"").replace(/^.+(..)$/,"$1");case"a":return l.getHours()<12?"am":"pm";case"A":return l.getHours()<12?"AM":"PM";case"B":return Math.floor(((l.getUTCHours()+1)%24+l.getUTCMinutes()/60+l.getUTCSeconds()/3600)*1e3/24);case"g":return l.getHours()%12!=0?l.getHours()%12:12;case"G":return l.getHours();case"h":return("0"+(l.getHours()%12!=0?l.getHours()%12:12)).replace(/^.+(..)$/,"$1");case"H":return("0"+l.getHours()).replace(/^.+(..)$/,"$1");case"i":return("0"+l.getMinutes()).replace(/^.+(..)$/,"$1");case"s":return("0"+l.getSeconds()).replace(/^.+(..)$/,"$1");case"u":return l.getMilliseconds();case"U":return l.getTime()/1e3}})}}(),e.lib.strip_tags=function(e,t){t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var n=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,r=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;return e.replace(r,"").replace(n,function(e,n){return t.indexOf("<"+n.toLowerCase()+">")>-1?e:""})},e.lib.parseISO8601Date=function(e){var t=/(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(\.\d+)?(Z|([+-])(\d\d):(\d\d))/,n=[];n=e.match(t);if(!n)throw"Couldn't parse ISO 8601 date string '"+e+"'";var r=[1,2,3,4,5,6,10,11];for(var i in r)n[r[i]]=parseInt(n[r[i]],10);n[7]=parseFloat(n[7]);var s=Date.UTC(n[1],n[2]-1,n[3],n[4],n[5],n[6]);n[7]>0&&(s+=Math.round(n[7]*1e3));if(n[8]!="Z"&&n[10]){var o=n[10]*60*60*1e3;n[11]&&(o+=n[11]*60*1e3),n[9]=="-"?s-=o:s+=o}return new Date(s)},e.lib.strtotime=function(t,n){var r,i,s,o,u="";t=t.replace(/\s{2,}|^\s|\s$/g," "),t=t.replace(/[\t\r\n]/g,"");if(t==="now")return n===null||isNaN(n)?(new Date).getTime()/1e3|0:n|0;if(!isNaN(u=Date.parse(t)))return u/1e3|0;n?n=new Date(n*1e3):n=new Date;var a=t;t=t.toLowerCase();var f={day:{sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},mon:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"]},l=function(e){var t=e[2]&&e[2]==="ago",r=(r=e[0]==="last"?-1:1)*(t?-1:1);switch(e[0]){case"last":case"next":switch(e[1].substring(0,3)){case"yea":n.setFullYear(n.getFullYear()+r);break;case"wee":n.setDate(n.getDate()+r*7);break;case"day":n.setDate(n.getDate()+r);break;case"hou":n.setHours(n.getHours()+r);break;case"min":n.setMinutes(n.getMinutes()+r);break;case"sec":n.setSeconds(n.getSeconds()+r);break;case"mon":if(e[1]==="month"){n.setMonth(n.getMonth()+r);break};default:var i=f.day[e[1].substring(0,3)];if(typeof i!="undefined"){var s=i-n.getDay();s===0?s=7*r:s>0?e[0]==="last"&&(s-=7):e[0]==="next"&&(s+=7),n.setDate(n.getDate()+s),n.setHours(0,0,0,0)}}break;default:if(!/\d+/.test(e[0]))return!1;r*=parseInt(e[0],10);switch(e[1].substring(0,3)){case"yea":n.setFullYear(n.getFullYear()+r);break;case"mon":n.setMonth(n.getMonth()+r);break;case"wee":n.setDate(n.getDate()+r*7);break;case"day":n.setDate(n.getDate()+r);break;case"hou":n.setHours(n.getHours()+r);break;case"min":n.setMinutes(n.getMinutes()+r);break;case"sec":n.setSeconds(n.getSeconds()+r)}}return!0};s=t.match(/^(\d{2,4}-\d{2}-\d{2})(?:\s(\d{1,2}:\d{2}(:\d{2})?)?(?:\.(\d+))?)?$/);if(s!==null)return s[2]?s[3]||(s[2]+=":00"):s[2]="00:00:00",o=s[1].split(/-/g),o[1]=f.mon[o[1]-1]||o[1],o[0]=+o[0],o[0]=o[0]>=0&&o[0]<=69?"20"+(o[0]<10?"0"+o[0]:o[0]+""):o[0]>=70&&o[0]<=99?"19"+o[0]:o[0]+"",parseInt(this.strtotime(o[2]+" "+o[1]+" "+o[0]+" "+s[2])+(s[4]?s[4]/1e3:""),10);var c="([+-]?\\d+\\s(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday)|(last|next)\\s(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday))(\\sago)?";s=t.match(new RegExp(c,"gi"));if(s===null){try{num=e.lib.parseISO8601Date(a);if(num)return num/1e3|0}catch(h){return!1}return!1}for(r=0,i=s.length;r<i;r++)if(!l(s[r].split(" ")))return!1;return n.getTime()/1e3|0},e.lib.is=function(e,t){var n=Object.prototype.toString.call(t).slice(8,-1);return t!==undefined&&t!==null&&n===e},e.lib.copy=function(e){var t={},n;for(n in e)t[n]=e[n];return t},e.lib.replaceAll=function(e,t,n){return e.split(t).join(n)},e.lib.chunkArray=function(t,n){var r=[],i=0,s=t.length;if(n<1||!e.lib.is("Array",t))return[];while(i<s)r.push(t.slice(i,i+=n));return r},e.lib.round=function(t,n,r){var i,s,o,u;n|=0,i=Math.pow(10,n),t*=i,u=t>0|-(t<0),o=t%1===.5*u,s=Math.floor(t);if(o)switch(r){case"PHP_ROUND_HALF_DOWN":t=s+(u<0);break;case"PHP_ROUND_HALF_EVEN":t=s+s%2*u;break;case"PHP_ROUND_HALF_ODD":t=s+!(s%2);break;default:t=s+(u>0)}return(o?t:Math.round(t))/i},e}(Twig||{}),Twig=function(e){e.logic={},e.logic.type={if_:"Twig.logic.type.if",endif:"Twig.logic.type.endif",for_:"Twig.logic.type.for",endfor:"Twig.logic.type.endfor",else_:"Twig.logic.type.else",elseif:"Twig.logic.type.elseif",set:"Twig.logic.type.set",setcapture:"Twig.logic.type.setcapture",endset:"Twig.logic.type.endset",filter:"Twig.logic.type.filter",endfilter:"Twig.logic.type.endfilter",block:"Twig.logic.type.block",endblock:"Twig.logic.type.endblock",extends_:"Twig.logic.type.extends",use:"Twig.logic.type.use",include:"Twig.logic.type.include",spaceless:"Twig.logic.type.spaceless",endspaceless:"Twig.logic.type.endspaceless",macro:"Twig.logic.type.macro",endmacro:"Twig.logic.type.endmacro",import_:"Twig.logic.type.import",from:"Twig.logic.type.from"},e.logic.definitions=[{type:e.logic.type.if_,regex:/^if\s+([^\s].+)$/,next:[e.logic.type.else_,e.logic.type.elseif,e.logic.type.endif],open:!0,compile:function(t){var n=t.match[1];return t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,delete t.match,t},parse:function(t,n,r){var i="",s=e.expression.parse.apply(this,[t.stack,n]);return r=!0,s&&(r=!1,i=e.parse.apply(this,[t.output,n])),{chain:r,output:i}}},{type:e.logic.type.elseif,regex:/^elseif\s+([^\s].*)$/,next:[e.logic.type.else_,e.logic.type.elseif,e.logic.type.endif],open:!1,compile:function(t){var n=t.match[1];return t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,delete t.match,t},parse:function(t,n,r){var i="";return r&&e.expression.parse.apply(this,[t.stack,n])===!0&&(r=!1,i=e.parse.apply(this,[t.output,n])),{chain:r,output:i}}},{type:e.logic.type.else_,regex:/^else$/,next:[e.logic.type.endif,e.logic.type.endfor],open:!1,parse:function(t,n,r){var i="";return r&&(i=e.parse.apply(this,[t.output,n])),{chain:r,output:i}}},{type:e.logic.type.endif,regex:/^endif$/,next:[],open:!1},{type:e.logic.type.for_,regex:/^for\s+([a-zA-Z0-9_,\s]+)\s+in\s+([^\s].*?)(?:\s+if\s+([^\s].*))?$/,next:[e.logic.type.else_,e.logic.type.endfor],open:!0,compile:function(t){var n=t.match[1],r=t.match[2],i=t.match[3],s=null;t.key_var=null,t.value_var=null;if(n.indexOf(",")>=0){s=n.split(",");if(s.length!==2)throw new e.Error("Invalid expression in for loop: "+n);t.key_var=s[0].trim(),t.value_var=s[1].trim()}else t.value_var=n;return t.expression=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:r}]).stack,i&&(t.conditional=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:i}]).stack),delete t.match,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.expression,n]),s=[],o,u=0,a,f=this,l=t.conditional,c=function(e,t){var r=l!==undefined;return{index:e+1,index0:e,revindex:r?undefined:t-e,revindex0:r?undefined:t-e-1,first:e===0,last:r?undefined:e===t-1,length:r?undefined:t,parent:n}},h=function(r,i){var a=e.lib.copy(n);a[t.value_var]=i,t.key_var&&(a[t.key_var]=r),a.loop=c(u,o);if(l===undefined||e.expression.parse.apply(f,[l,a]))s.push(e.parse.apply(f,[t.output,a])),u+=1};return i instanceof Array?(o=i.length,e.forEach(i,function(e){var t=u;h(t,e)})):i instanceof Object&&(i._keys!==undefined?a=i._keys:a=Object.keys(i),o=a.length,e.forEach(a,function(e){if(e==="_keys")return;h(e,i[e])})),r=s.length===0,{chain:r,output:s.join("")}}},{type:e.logic.type.endfor,regex:/^endfor$/,next:[],open:!1},{type:e.logic.type.set,regex:/^set\s+([a-zA-Z0-9_,\s]+)\s*=\s*(.+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim(),r=t.match[2],i=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:r}]).stack;return t.key=n,t.expression=i,delete t.match,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.expression,n]),s=t.key;return this.context[s]=i,n[s]=i,{chain:r,context:n}}},{type:e.logic.type.setcapture,regex:/^set\s+([a-zA-Z0-9_,\s]+)$/,next:[e.logic.type.endset],open:!0,compile:function(e){var t=e.match[1].trim();return e.key=t,delete e.match,e},parse:function(t,n,r){var i=e.parse.apply(this,[t.output,n]),s=t.key;return this.context[s]=i,n[s]=i,{chain:r,context:n}}},{type:e.logic.type.endset,regex:/^endset$/,next:[],open:!1},{type:e.logic.type.filter,regex:/^filter\s+(.+)$/,next:[e.logic.type.endfilter],open:!0,compile:function(t){var n="|"+t.match[1].trim();return t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,delete t.match,t},parse:function(t,n,r){var i=e.parse.apply(this,[t.output,n]),s=[{type:e.expression.type.string,value:i}].concat(t.stack),o=e.expression.parse.apply(this,[s,n]);return{chain:r,output:o}}},{type:e.logic.type.endfilter,regex:/^endfilter$/,next:[],open:!1},{type:e.logic.type.block,regex:/^block\s+([a-zA-Z0-9_]+)$/,next:[e.logic.type.endblock],open:!0,compile:function(e){return e.block=e.match[1].trim(),delete e.match,e},parse:function(t,n,r){var i="",s="",o=this.blocks[t.block]&&this.blocks[t.block].indexOf(e.placeholders.parent)>-1;if(this.blocks[t.block]===undefined||o||n.loop)i=e.expression.parse.apply(this,[{type:e.expression.type.string,value:e.parse.apply(this,[t.output,n])},n]),o?this.blocks[t.block]=this.blocks[t.block].replace(e.placeholders.parent,i):this.blocks[t.block]=i;return this.child.blocks[t.block]?s=this.child.blocks[t.block]:s=this.blocks[t.block],{chain:r,output:s}}},{type:e.logic.type.endblock,regex:/^endblock(?:\s+([a-zA-Z0-9_]+))?$/,next:[],open:!1},{type:e.logic.type.extends_,regex:/^extends\s+(.+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim();return delete t.match,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.stack,n]);return this.extend=i,{chain:r,output:""}}},{type:e.logic.type.use,regex:/^use\s+(.+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim();return delete t.match,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){var i=e.expression.parse.apply(this,[t.stack,n]);return this.importBlocks(i),{chain:r,output:""}}},{type:e.logic.type.include,regex:/^include\s+(ignore missing\s+)?(.+?)\s*(?:with\s+(.+?))?\s*(only)?$/,next:[],open:!0,compile:function(t){var n=t.match,r=n[1]!==undefined,i=n[2].trim(),s=n[3],o=n[4]!==undefined&&n[4].length;return delete t.match,t.only=o,t.includeMissing=r,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:i}]).stack,s!==undefined&&(t.withStack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:s.trim()}]).stack),t},parse:function(t,n,r){var i={},s,o,u;if(!t.only)for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);if(t.withStack!==undefined){s=e.expression.parse.apply(this,[t.withStack,n]);for(o in s)s.hasOwnProperty(o)&&(i[o]=s[o])}var a=e.expression.parse.apply(this,[t.stack,i]);return u=this.importFile(a),{chain:r,output:u.render(i)}}},{type:e.logic.type.spaceless,regex:/^spaceless$/,next:[e.logic.type.endspaceless],open:!0,parse:function(t,n,r){var i=e.parse.apply(this,[t.output,n]),s=/>\s+</g,o=i.replace(s,"><").trim();return{chain:r,output:o}}},{type:e.logic.type.endspaceless,regex:/^endspaceless$/,next:[],open:!1},{type:e.logic.type.macro,regex:/^macro\s+([a-zA-Z0-9_]+)\s?\((([a-zA-Z0-9_]+(,\s?)?)*)\)$/,next:[e.logic.type.endmacro],open:!0,compile:function(t){var n=t.match[1],r=t.match[2].split(/[ ,]+/);for(var i=0;i<r.length;i++)for(var s=0;s<r.length;s++)if(r[i]===r[s]&&i!==s)throw new e.Error("Duplicate arguments for parameter: "+r[i]);return t.macroName=n,t.parameters=r,delete t.match,t},parse:function(t,n,r){var i=this;return this.macros[t.macroName]=function(){var n={_self:i.macros};for(var r=0;r<t.parameters.length;r++){var s=t.parameters[r];typeof arguments[r]!="undefined"?n[s]=arguments[r]:n[s]=undefined}return e.parse.apply(i,[t.output,n])},{chain:r,output:""}}},{type:e.logic.type.endmacro,regex:/^endmacro$/,next:[],open:!1},{type:e.logic.type.import_,regex:/^import\s+(.+)\s+as\s+([a-zA-Z0-9_]+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim(),r=t.match[2].trim();return delete t.match,t.expression=n,t.contextName=r,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){if(t.expression!=="_self"){var i=e.expression.parse.apply(this,[t.stack,n]),s=this.importMacros(i||t.expression);n[t.contextName]=s.render({},{output:"macros"})}else n[t.contextName]=this.macros;return{chain:r,output:""}}},{type:e.logic.type.from,regex:/^from\s+(.+)\s+import\s+([a-zA-Z0-9_, ]+)$/,next:[],open:!0,compile:function(t){var n=t.match[1].trim(),r=t.match[2].trim().split(/[ ,]+/),i={};for(var s=0;s<r.length;s++){var o=r[s],u=o.match(/^([a-zA-Z0-9_]+)\s+(.+)\s+as\s+([a-zA-Z0-9_]+)$/);u?i[u[1].trim()]=u[2].trim():o.match(/^([a-zA-Z0-9_]+)$/)&&(i[o]=o)}return delete t.match,t.expression=n,t.macroNames=i,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,t},parse:function(t,n,r){var i;if(t.expression!=="_self"){var s=e.expression.parse.apply(this,[t.stack,n]),o=this.importMacros(s||t.expression);i=o.render({},{output:"macros"})}else i=this.macros;for(var u in t.macroNames)i.hasOwnProperty(u)&&(n[t.macroNames[u]]=i[u]);return{chain:r,output:""}}}],e.logic.handler={},e.logic.extendType=function(t,n){n=n||"Twig.logic.type"+t,e.logic.type[t]=n},e.logic.extend=function(t){if(!t.type)throw new e.Error("Unable to extend logic definition. No type provided for "+t);if(e.logic.type[t.type])throw new e.Error("Unable to extend logic definitions. Type "+t.type+" is already defined.");e.logic.extendType(t.type),e.logic.handler[t.type]=t};while(e.logic.definitions.length>0)e.logic.extend(e.logic.definitions.shift());return e.logic.compile=function(t){var n=t.value.trim(),r=e.logic.tokenize.apply(this,[n]),i=e.logic.handler[r.type];return i.compile&&(r=i.compile.apply(this,[r]),e.log.trace("Twig.logic.compile: ","Compiled logic token to ",r)),r},e.logic.tokenize=function(t){var n={},r=null,i=null,s=null,o=null,u=null,a=null;t=t.trim();for(r in e.logic.handler)if(e.logic.handler.hasOwnProperty(r)){i=e.logic.handler[r].type,s=e.logic.handler[r].regex,o=[],s instanceof Array?o=s:o.push(s);while(o.length>0){u=o.shift(),a=u.exec(t.trim());if(a!==null)return n.type=i,n.match=a,e.log.trace("Twig.logic.tokenize: ","Matched a ",i," regular expression of ",a),n}}throw new e.Error("Unable to parse '"+t.trim()+"'")},e.logic.parse=function(t,n,r){var i="",s;return n=n||{},e.log.debug("Twig.logic.parse: ","Parsing logic token ",t),s=e.logic.handler[t.type],s.parse&&(i=s.parse.apply(this,[t,n,r])),i},e}(Twig||{}),Twig=function(e){e.expression={},e.expression.reservedWords=["true","false","null","_context"],e.expression.type={comma:"Twig.expression.type.comma",operator:{unary:"Twig.expression.type.operator.unary",binary:"Twig.expression.type.operator.binary"},string:"Twig.expression.type.string",bool:"Twig.expression.type.bool",array:{start:"Twig.expression.type.array.start",end:"Twig.expression.type.array.end"},object:{start:"Twig.expression.type.object.start",end:"Twig.expression.type.object.end"},parameter:{start:"Twig.expression.type.parameter.start",end:"Twig.expression.type.parameter.end"},key:{period:"Twig.expression.type.key.period",brackets:"Twig.expression.type.key.brackets"},filter:"Twig.expression.type.filter",_function:"Twig.expression.type._function",variable:"Twig.expression.type.variable",number:"Twig.expression.type.number",_null:"Twig.expression.type.null",context:"Twig.expression.type.context",test:"Twig.expression.type.test"},e.expression.set={operations:[e.expression.type.filter,e.expression.type.operator.unary,e.expression.type.operator.binary,e.expression.type.array.end,e.expression.type.object.end,e.expression.type.parameter.end,e.expression.type.comma,e.expression.type.test],expressions:[e.expression.type._function,e.expression.type.bool,e.expression.type.string,e.expression.type.variable,e.expression.type.number,e.expression.type._null,e.expression.type.context,e.expression.type.parameter.start,e.expression.type.array.start,e.expression.type.object.start]},e.expression.set.operations_extended=e.expression.set.operations.concat([e.expression.type.key.period,e.expression.type.key.brackets]),e.expression.fn={compile:{push:function(e,t,n){n.push(e)},push_both:function(e,t,n){n.push(e),t.push(e)}},parse:{push:function(e,t,n){t.push(e)},push_value:function(e,t,n){t.push(e.value)}}},e.expression.definitions=[{type:e.expression.type.test,regex:/^is\s+(not)?\s*([a-zA-Z_][a-zA-Z0-9_]*)/,next:e.expression.set.operations.concat([e.expression.type.parameter.start]),compile:function(e,t,n){e.filter=e.match[2],e.modifier=e.match[1],delete e.match,delete e.value,n.push(e)},parse:function(t,n,r){var i=n.pop(),s=t.params&&e.expression.parse.apply(this,[t.params,r]),o=e.test(t.filter,i,s);t.modifier=="not"?n.push(!o):n.push(o)}},{type:e.expression.type.comma,regex:/^,/,next:e.expression.set.expressions.concat([e.expression.type.array.end,e.expression.type.object.end]),compile:function(t,n,r){var i=n.length-1,s;delete t.match,delete t.value;for(;i>=0;i--){s=n.pop();if(s.type===e.expression.type.object.start||s.type===e.expression.type.parameter.start||s.type===e.expression.type.array.start){n.push(s);break}r.push(s)}r.push(t)}},{type:e.expression.type.operator.binary,regex:/(^[\+\-~%\?\:]|^[!=]==?|^[!<>]=?|^\*\*?|^\/\/?|^and\s+|^or\s+|^in\s+|^not in\s+|^\.\.)/,next:e.expression.set.expressions.concat([e.expression.type.operator.unary]),compile:function(t,n,r){delete t.match,t.value=t.value.trim();var i=t.value,s=e.expression.operator.lookup(i,t);e.log.trace("Twig.expression.compile: ","Operator: ",s," from ",i);while(n.length>0&&(n[n.length-1].type==e.expression.type.operator.unary||n[n.length-1].type==e.expression.type.operator.binary)&&(s.associativity===e.expression.operator.leftToRight&&s.precidence>=n[n.length-1].precidence||s.associativity===e.expression.operator.rightToLeft&&s.precidence>n[n.length-1].precidence)){var o=n.pop();r.push(o)}if(i===":"){if(!n[n.length-1]||n[n.length-1].value!=="?"){var u=r.pop();if(u.type!==e.expression.type.string&&u.type!==e.expression.type.variable&&u.type!==e.expression.type.number)throw new e.Error("Unexpected value before ':' of "+u.type+" = "+u.value);t.key=u.value,r.push(t);return}}else n.push(s)},parse:function(t,n,r){t.key?n.push(t):e.expression.operator.parse(t.value,n)}},{type:e.expression.type.operator.unary,regex:/(^not\s+)/,next:e.expression.set.expressions,compile:function(t,n,r){delete t.match,t.value=t.value.trim();var i=t.value,s=e.expression.operator.lookup(i,t);e.log.trace("Twig.expression.compile: ","Operator: ",s," from ",i);while(n.length>0&&(n[n.length-1].type==e.expression.type.operator.unary||n[n.length-1].type==e.expression.type.operator.binary)&&(s.associativity===e.expression.operator.leftToRight&&s.precidence>=n[n.length-1].precidence||s.associativity===e.expression.operator.rightToLeft&&s.precidence>n[n.length-1].precidence)){var o=n.pop();r.push(o)}n.push(s)},parse:function(t,n,r){e.expression.operator.parse(t.value,n)}},{type:e.expression.type.string,regex:/^(["'])(?:(?=(\\?))\2.)*?\1/,next:e.expression.set.operations,compile:function(t,n,r){var i=t.value;delete t.match,i.substring(0,1)==='"'?i=i.replace('\\"','"'):i=i.replace("\\'","'"),t.value=i.substring(1,i.length-1).replace(/\\n/g,"\n").replace(/\\r/g,"\r"),e.log.trace("Twig.expression.compile: ","String value: ",t.value),r.push(t)},parse:e.expression.fn.parse.push_value},{type:e.expression.type.parameter.start,regex:/^\(/,next:e.expression.set.expressions.concat([e.expression.type.parameter.end]),compile:e.expression.fn.compile.push_both,parse:e.expression.fn.parse.push},{type:e.expression.type.parameter.end,regex:/^\)/,next:e.expression.set.operations_extended,compile:function(t,n,r){var i,s=t;i=n.pop();while(n.length>0&&i.type!=e.expression.type.parameter.start)r.push(i),i=n.pop();var o=[];while(t.type!==e.expression.type.parameter.start)o.unshift(t),t=r.pop();o.unshift(t);var u=!1;t=r[r.length-1],t===undefined||t.type!==e.expression.type._function&&t.type!==e.expression.type.filter&&t.type!==e.expression.type.test&&t.type!==e.expression.type.key.brackets&&t.type!==e.expression.type.key.period?(s.expression=!0,o.pop(),o.shift(),s.params=o,r.push(s)):(s.expression=!1,t.params=o)},parse:function(t,n,r){var i=[],s=!1,o=null;if(t.expression)o=e.expression.parse.apply(this,[t.params,r]),n.push(o);else{while(n.length>0){o=n.pop();if(o&&o.type&&o.type==e.expression.type.parameter.start){s=!0;break}i.unshift(o)}if(!s)throw new e.Error("Expected end of parameter set.");n.push(i)}}},{type:e.expression.type.array.start,regex:/^\[/,next:e.expression.set.expressions.concat([e.expression.type.array.end]),compile:e.expression.fn.compile.push_both,parse:e.expression.fn.parse.push},{type:e.expression.type.array.end,regex:/^\]/,next:e.expression.set.operations_extended,compile:function(t,n,r){var i=n.length-1,s;for(;i>=0;i--){s=n.pop();if(s.type===e.expression.type.array.start)break;r.push(s)}r.push(t)},parse:function(t,n,r){var i=[],s=!1,o=null;while(n.length>0){o=n.pop();if(o.type&&o.type==e.expression.type.array.start){s=!0;break}i.unshift(o)}if(!s)throw new e.Error("Expected end of array.");n.push(i)}},{type:e.expression.type.object.start,regex:/^\{/,next:e.expression.set.expressions.concat([e.expression.type.object.end]),compile:e.expression.fn.compile.push_both,parse:e.expression.fn.parse.push},{type:e.expression.type.object.end,regex:/^\}/,next:e.expression.set.operations_extended,compile:function(t,n,r){var i=n.length-1,s;for(;i>=0;i--){s=n.pop();if(s&&s.type===e.expression.type.object.start)break;r.push(s)}r.push(t)},parse:function(t,n,r){var i={},s=!1,o=null,u=null,a=!1,f=null;while(n.length>0){o=n.pop();if(o&&o.type&&o.type===e.expression.type.object.start){s=!0;break}if(o&&o.type&&(o.type===e.expression.type.operator.binary||o.type===e.expression.type.operator.unary)&&o.key){if(!a)throw new e.Error("Missing value for key '"+o.key+"' in object definition.");i[o.key]=f,i._keys===undefined&&(i._keys=[]),i._keys.unshift(o.key),f=null,a=!1}else a=!0,f=o}if(!s)throw new e.Error("Unexpected end of object.");n.push(i)}},{type:e.expression.type.filter,regex:/^\|\s?([a-zA-Z_][a-zA-Z0-9_\-]*)/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:function(e,t,n){e.value=e.match[1],n.push(e)},parse:function(t,n,r){var i=n.pop(),s=t.params&&e.expression.parse.apply(this,[t.params,r]);n.push(e.filter.apply(this,[t.value,i,s]))}},{type:e.expression.type._function,regex:/^([a-zA-Z_][a-zA-Z0-9_]*)\s*\(/,next:e.expression.type.parameter.start,transform:function(e,t){return"("},compile:function(e,t,n){var r=e.match[1];e.fn=r,delete e.match,delete e.value,n.push(e)},parse:function(t,n,r){var i=t.params&&e.expression.parse.apply(this,[t.params,r]),s=t.fn,o;if(e.functions[s])o=e.functions[s].apply(this,i);else{if(typeof r[s]!="function")throw new e.Error(s+" function does not exist and is not defined in the context");o=r[s].apply(r,i)}n.push(o)}},{type:e.expression.type.variable,regex:/^[a-zA-Z_][a-zA-Z0-9_]*/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,validate:function(t,n){return e.indexOf(e.expression.reservedWords,t[0])<0},parse:function(t,n,r){var i=e.expression.resolve(r[t.value],r);n.push(i)}},{type:e.expression.type.key.period,regex:/^\.([a-zA-Z0-9_]+)/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:function(e,t,n){e.key=e.match[1],delete e.match,delete e.value,n.push(e)},parse:function(t,n,r){var i=t.params&&e.expression.parse.apply(this,[t.params,r]),s=t.key,o=n.pop(),u;if(o===null||o===undefined){if(this.options.strict_variables)throw new e.Error("Can't access a key "+s+" on an null or undefined object.");return null}var a=function(e){return e.substr(0,1).toUpperCase()+e.substr(1)};typeof o=="object"&&s in o?u=o[s]:o["get"+a(s)]!==undefined?u=o["get"+a(s)]:o["is"+a(s)]!==undefined?u=o["is"+a(s)]:u=null,n.push(e.expression.resolve(u,o,i))}},{type:e.expression.type.key.brackets,regex:/^\[([^\]]*)\]/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:function(t,n,r){var i=t.match[1];delete t.value,delete t.match,t.stack=e.expression.compile({value:i}).stack,r.push(t)},parse:function(t,n,r){var i=t.params&&e.expression.parse.apply(this,[t.params,r]),s=e.expression.parse.apply(this,[t.stack,r]),o=n.pop(),u;if(o===null||o===undefined){if(this.options.strict_variables)throw new e.Error("Can't access a key "+s+" on an null or undefined object.");return null}typeof o=="object"&&s in o?u=o[s]:u=null,n.push(e.expression.resolve(u,o,i))}},{type:e.expression.type._null,regex:/^null/,next:e.expression.set.operations,compile:function(e,t,n){delete e.match,e.value=null,n.push(e)},parse:e.expression.fn.parse.push_value},{type:e.expression.type.context,regex:/^_context/,next:e.expression.set.operations_extended.concat([e.expression.type.parameter.start]),compile:e.expression.fn.compile.push,parse:function(e,t,n){t.push(n)}},{type:e.expression.type.number,regex:/^\-?\d+(\.\d+)?/,next:e.expression.set.operations,compile:function(e,t,n){e.value=Number(e.value),n.push(e)},parse:e.expression.fn.parse.push_value},{type:e.expression.type.bool,regex:/^(true|false)/,next:e.expression.set.operations,compile:function(e,t,n){e.value=e.match[0]=="true",delete e.match,n.push(e)},parse:e.expression.fn.parse.push_value}],e.expression.resolve=function(e,t,n){return typeof e=="function"?e.apply(t,n||[]):e},e.expression.handler={},e.expression.extendType=function(t){e.expression.type[t]="Twig.expression.type."+t},e.expression.extend=function(t){if(!t.type)throw new e.Error("Unable to extend logic definition. No type provided for "+t);e.exp
118
  * @link https://github.com/justjohn/twig.js
119
  */
120
 
121
+ // Twig.js
122
  // Copyright (c) 2011-2013 John Roepke
123
+ // Available under the BSD 2-Clause License
124
+ // https://github.com/justjohn/twig.js
125
 
126
+ // The following methods are from MDN and are available under a
127
  // [MIT License](http://www.opensource.org/licenses/mit-license.php) or are
 
128
  // [Public Domain](https://developer.mozilla.org/Project:Copyrights).
129
+ //
130
+ // See:
131
+ // * [Object.keys - MDN](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys)
132
+
133
+ // ## twig.lib.js
134
+ //
135
+ // This file contains 3rd party libraries used within twig.
136
+ //
137
  // Copies of the licenses for the code included here can be found in the
138
+ // LICENSES.md file.
139
+ //
140
 
141
  /**
142
  * jPaq - A fully customizable JavaScript/JScript library
150
  * Revised: April 6, 2011
151
  */
152
 
153
+ // Twig.js
154
+ // Copyright (c) 2011-2013 John Roepke
155
+ // 2012 Hadrien Lanneau
156
+ // Available under the BSD 2-Clause License
157
+ // https://github.com/justjohn/twig.js
158
+
159
  /**
160
  * History.js jQuery Adapter
161
  * @author Benjamin Arthur Lupton <contact@balupton.com>
358
  * limitations under the License.
359
  * ======================================================================== */
360