WP-Optimize - Version 2.2.6

Version Description

  • 30/October/2018 =

  • TWEAK: Mark as supporting WordPress 5.0

  • TWEAK: Update seasonal notices

Download this release

Release Info

Developer DavidAnderson
Plugin Icon 128x128 WP-Optimize
Version 2.2.6
Comparing to
See all releases

Code changes from version 2.2.4 to 2.2.6

Files changed (46) hide show
  1. css/admin.css +18 -4
  2. css/admin.min.css +1 -1
  3. css/admin.min.css.map +1 -1
  4. css/tablesorter/theme.default.min.css +1 -1
  5. includes/class-commands.php +64 -0
  6. includes/class-updraft-file-logger.php +177 -0
  7. includes/class-updraft-nitrosmush-task.php +175 -0
  8. includes/class-updraft-resmushit-task.php +181 -0
  9. includes/class-updraft-smush-manager-commands.php +312 -0
  10. includes/class-updraft-smush-manager.php +928 -0
  11. includes/class-updraft-smush-task.php +325 -0
  12. includes/class-wp-optimization.php +81 -0
  13. includes/class-wp-optimize-options.php +17 -0
  14. includes/class-wp-optimizer.php +0 -1
  15. includes/wp-optimize-database-information.php +9 -0
  16. includes/wp-optimize-notices.php +14 -14
  17. js/handlebars/handlebars.js +10 -12
  18. js/handlebars/handlebars.min.js +4 -4
  19. js/handlebars/handlebars.runtime.js +2 -2
  20. js/handlebars/handlebars.runtime.min.js +2 -2
  21. js/tablesorter/jquery.tablesorter.js +43 -30
  22. js/tablesorter/jquery.tablesorter.min.js +1 -1
  23. js/tablesorter/jquery.tablesorter.widgets.js +3 -14
  24. js/tablesorter/jquery.tablesorter.widgets.min.js +4 -2
  25. js/wpadmin.js +68 -15
  26. js/wpadmin.min.js +1 -1
  27. languages/wp-optimize.pot +352 -148
  28. optimizations/autodraft.php +72 -0
  29. optimizations/commentmeta.php +92 -4
  30. optimizations/optimizetables.php +7 -2
  31. optimizations/orphandata.php +2 -1
  32. optimizations/pingbacks.php +69 -1
  33. optimizations/postmeta.php +56 -1
  34. optimizations/repairtables.php +21 -2
  35. optimizations/revisions.php +72 -1
  36. optimizations/spam.php +93 -2
  37. optimizations/trackbacks.php +66 -1
  38. optimizations/transient.php +324 -59
  39. optimizations/trash.php +80 -0
  40. optimizations/unapproved.php +70 -0
  41. readme.txt +28 -3
  42. templates/info-message.php +4 -0
  43. templates/optimizations-table.php +2 -2
  44. templates/status-box-contents.php +10 -0
  45. templates/take-a-backup.php +15 -3
  46. wp-optimize.php +116 -16
css/admin.css CHANGED
@@ -2,6 +2,16 @@
2
  display: none;
3
  }
4
 
 
 
 
 
 
 
 
 
 
 
5
  /* big button */
6
  .wpo_primary_big {
7
  padding: 4px 6px !important;
@@ -112,6 +122,10 @@
112
 
113
  }
114
 
 
 
 
 
115
  .wp-optimize-settings-clean-transient label, .wp-optimize-settings-clean-pingbacks label, .wp-optimize-settings-clean-trackbacks label, .wp-optimize-settings-clean-postmeta label, .wp-optimize-settings-clean-orphandata label, .wp-optimize-settings-clean-commentmeta label {
116
  color: #9B0000;
117
  }
@@ -179,7 +193,7 @@ img.addons {
179
  margin: 1%;
180
  }
181
 
182
- #save_done {
183
  color: #D94F00;
184
  font-size: 250%;
185
  }
@@ -242,7 +256,7 @@ img.addons {
242
  letter-spacing: 1px;
243
  }
244
 
245
- .wpo_unused_image {
246
  position: relative;
247
  float: left;
248
  margin: .5%;
@@ -253,7 +267,7 @@ img.addons {
253
  min-height: 200px;
254
  }
255
 
256
- .wpo_unused_image img {
257
  max-height: 80%;
258
  max-width: 90%;
259
  margin: 10px 5px;
@@ -512,7 +526,7 @@ img.addons {
512
  min-width: 150px;
513
  }
514
 
515
- #wpo_unused_images {
516
  max-height: 500px;
517
  overflow-y: auto;
518
  }
2
  display: none;
3
  }
4
 
5
+ .wpo_info {
6
+ background: #FFF;
7
+ color: #444;
8
+ font-family: -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;
9
+ margin: 2em auto;
10
+ padding: 1em 2em;
11
+ max-width: 700px;
12
+ box-shadow: 0 1px 3px rgba(0,0,0,0.13);
13
+ }
14
+
15
  /* big button */
16
  .wpo_primary_big {
17
  padding: 4px 6px !important;
122
 
123
  }
124
 
125
+ #select_all_optimizations {
126
+ margin-left: -5px;
127
+ }
128
+
129
  .wp-optimize-settings-clean-transient label, .wp-optimize-settings-clean-pingbacks label, .wp-optimize-settings-clean-trackbacks label, .wp-optimize-settings-clean-postmeta label, .wp-optimize-settings-clean-orphandata label, .wp-optimize-settings-clean-commentmeta label {
130
  color: #9B0000;
131
  }
193
  margin: 1%;
194
  }
195
 
196
+ #save_done, .save-done {
197
  color: #D94F00;
198
  font-size: 250%;
199
  }
256
  letter-spacing: 1px;
257
  }
258
 
259
+ .wpo_unused_image, .wpo_smush_image {
260
  position: relative;
261
  float: left;
262
  margin: .5%;
267
  min-height: 200px;
268
  }
269
 
270
+ .wpo_unused_image img, .wpo_smush_image img {
271
  max-height: 80%;
272
  max-width: 90%;
273
  margin: 10px 5px;
526
  min-width: 150px;
527
  }
528
 
529
+ #wpo_unused_images, #wpo_smush_images_grid {
530
  max-height: 500px;
531
  overflow-y: auto;
532
  }
css/admin.min.css CHANGED
@@ -1,2 +1,2 @@
1
- .wpo_hidden{display:none}.wpo_primary_big{padding:4px 6px !important;font-size:22px !important;min-height:34px;min-width:200px}.wpo_section{clear:both;padding:0;margin:0}.wp-optimize-settings{margin-bottom:16px}.wpo_col{display:block;float:left;margin:1% 0 1% 1%}.wpo_col:first-child{margin-left:0}.wpo_group:before,.wpo_group:after{content:"";display:table}.wpo_group:after{clear:both}.wpo_half_width{width:48%}.wpo_span_3_of_3{width:100%}.wpo_span_2_of_3{width:65.3%}.wpo_span_1_of_3{width:32.1%}.nav-tab-wrapper{margin:14px 0}@media screen and (min-width:549px){.show_on_default_sizes{display:block !important}.show_on_mobile_sizes{display:none !important}}@media screen and (max-width:548px){.show_on_default_sizes{display:none !important}.show_on_mobile_sizes{display:block !important}}@media screen and (max-width:768px){.wpo_col{margin:1% 0}.wpo_span_3_of_3{width:100%}.wpo_span_2_of_3{width:100%}.wpo_span_1_of_3{width:100%}.wpo_half_width{width:100%}}.wp-optimize-settings-clean-transient label,.wp-optimize-settings-clean-pingbacks label,.wp-optimize-settings-clean-trackbacks label,.wp-optimize-settings-clean-postmeta label,.wp-optimize-settings-clean-orphandata label,.wp-optimize-settings-clean-commentmeta label{color:#9b0000}td.wp-optimize-settings-optimization-checkbox{width:18px;padding-left:4px;padding-right:0}.wp-optimize-settings-optimization-checkbox input{margin:0;padding:0}#retention-period{width:60px}.wp-optimize-settings-optimization-info{font-size:80%;padding-left:32px;font-style:italic}.wp-optimize-settings input[type="checkbox"]{width:18px}img.addons{display:block;margin-left:auto;margin-right:auto;height:44px}.wpo_spinner{width:18px;height:18px;padding-left:10px;display:none;position:relative;top:4px}.optimization_spinner{width:20px;height:20px}#wp-optimize-auto-options{margin:20px 0 0 28px}.display-none{display:none}.visibility-hidden{visibility:hidden}.margin-one-percent{margin:1%}#save_done{color:#d94f00;font-size:250%}.wp-optimize-settings-optimization-info a{text-decoration:underline}.wp-optimize-settings-optimization-run-spinner{position:relative;top:2px}#wpoptimize_table_list .tablesorter-filter-row{display:none !important}#wp_optimize_table_list_refresh{float:right}#wp_optimize_table_list_refresh:hover{cursor:pointer}#wpoptimize_table_list .optimization_spinner{position:relative;top:5px;left:5px}#wpoptimize_table_list_filter{width:100%}#wpoptimize_table_list_tables_not_found{display:none}#optimize_form .select2-container,#wp-optimize-auto-options .select2-container{width:50% !important;top:-5px;height:40px;margin-left:10px}#wpoptimize_table_list .optimization_done_icon{color:#d94f00;font-size:200%;display:inline-block;position:relative;top:5px;left:-20px}#wpo_sitelist_show_moreoptions_cron{font-size:13px;line-height:1.5;letter-spacing:1px}.wpo_unused_image{position:relative;float:left;margin:.5%;width:32%;text-align:center;background:rgba(220,220,220,0.5);height:20vh;min-height:200px}.wpo_unused_image img{max-height:80%;max-width:90%;margin:10px 5px}.wpo_unused_image_checkbox_conatiner{text-align:center;position:absolute;width:100%;bottom:7px}#wp-optimize-nav-tab-contents-images .wpo_span_2_of_3 h3{display:inline-block}#wpo_remove_unused_images_btn{margin-top:10px;margin-right:10px;float:right}#wpo_remove_selected_sizes_btn{margin-top:20px}#wp-optimize-nav-tab-contents-tables a{vertical-align:middle}#wpo_sitelist_moreoptions,#wpo_sitelist_moreoptions_cron{margin:4px 16px 6px 0;border:1px dotted;padding:6px 10px;max-height:300px;overflow-y:scroll;overflow-x:hidden}#wpo_sitelist_moreoptions{max-height:150px;margin-right:0}#wpo_settings_sites_list li,#wpo_settings_sites_list li a{font-size:13px;line-height:1.5}#wpo_sitelist_moreoptions_cron li{padding-left:20px}#wpo_import_error_message{display:none;color:#9b0000}#wpo_import_success_message{display:none;color:#46b450}#wp-optimize-logging-options{margin-top:10px}.wpo_logging_header{font-weight:bold;border-top:1px solid #333;border-bottom:1px solid #333;padding:5px 0;margin:0}.wpo_logging_row{border-bottom:1px solid #a1a2a3;padding:5px 0}.wpo_logging_logger_title,.wpo_logging_options_title,.wpo_logging_status_title,.wpo_logging_actions_title,.wpo_logging_logger_row,.wpo_logging_options_row,.wpo_logging_status_row,.wpo_logging_actions_row{display:inline-block}.wpo_logging_logger_title,.wpo_logging_logger_row{width:38%}.wpo_logging_options_title,.wpo_logging_options_row{width:44%}.wpo_logging_status_title,.wpo_logging_status_row{width:8%}.wpo_logging_actions_title,.wpo_logging_actions_row{width:7%}.wpo_logging_actions_row{text-align:right}.wpo_logging_options_row{word-wrap:break-word}#wpo_add_logger_link{clear:both;display:block;cursor:pointer;font-weight:bold}.wpo_logging_actions_row .dashicons-no-alt,.wpo_add_logger_form .dashicons-no-alt{background-color:#f06666;color:#FFF;width:20px;height:20px;border-radius:20px;display:inline-block;cursor:pointer;margin-left:5px}.wpo_add_logger_form .dashicons-no-alt{margin-top:12px;margin-right:10px;float:right}.wpo_logger_type{width:90%;margin-top:10px}.wpo_logger_addition_option{width:100%;margin-top:5px}.wpo_alert_notice{background-color:#f06666;color:#FFF;padding:5px;display:block;margin-bottom:5px;border-radius:5px}.wpo_error_field{border-color:#f06666 !important}.save_settings_reminder{display:none;color:#333;padding:5px 10px;border:1px solid #F00;background-color:#f0a5a4;border-radius:5px;margin:15px 0}.wpo_feature_cont{width:54.5%}.wpo_plugin_family_cont{width:44.5%}.wpo_feat_table,.wpo_feat_th,.wpo_feat_table td{border:1px solid black;border-collapse:collapse;font-size:120%;background-color:white;text-align:center}.wpo_feat_table p{padding:0 10px;margin:5px 0;font-size:16px}.wpo_feat_table h4{margin:5px 0}.wpo_feat_table .dashicons{width:25px;height:25px;font-size:25px;line-height:1}.wpo_feat_table .dashicons-yes,.wpo_feat_table .updraft-yes{color:green}.wpo_feat_table .dashicons-no-alt,.wpo_feat_table .updraft-no{color:red}.wpo-premium-image{display:none}@media screen and (min-width:720px){#wpoptimize_table_list_filter{width:40%}.wpo-premium-image{display:block;float:left;padding:14px 8px;width:50px;height:50px}}.other-plugin-title{text-decoration:none}#wpo_remove_selected_sizes{margin-top:20px}.wpo_unused_images_buttons_wrap{display:none}.wpo_unused_images_container h3{min-width:150px}#wpo_unused_images{max-height:500px;overflow-y:auto}#wpo_unused_images a{outline:0}
2
  /*# sourceMappingURL=admin.min.css.map */
1
+ .wpo_hidden{display:none}.wpo_info{background:#FFF;color:#444;font-family:-apple-system,"BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;margin:2em auto;padding:1em 2em;max-width:700px;box-shadow:0 1px 3px rgba(0,0,0,0.13)}.wpo_primary_big{padding:4px 6px !important;font-size:22px !important;min-height:34px;min-width:200px}.wpo_section{clear:both;padding:0;margin:0}.wp-optimize-settings{margin-bottom:16px}.wpo_col{display:block;float:left;margin:1% 0 1% 1%}.wpo_col:first-child{margin-left:0}.wpo_group:before,.wpo_group:after{content:"";display:table}.wpo_group:after{clear:both}.wpo_half_width{width:48%}.wpo_span_3_of_3{width:100%}.wpo_span_2_of_3{width:65.3%}.wpo_span_1_of_3{width:32.1%}.nav-tab-wrapper{margin:14px 0}@media screen and (min-width:549px){.show_on_default_sizes{display:block !important}.show_on_mobile_sizes{display:none !important}}@media screen and (max-width:548px){.show_on_default_sizes{display:none !important}.show_on_mobile_sizes{display:block !important}}@media screen and (max-width:768px){.wpo_col{margin:1% 0}.wpo_span_3_of_3{width:100%}.wpo_span_2_of_3{width:100%}.wpo_span_1_of_3{width:100%}.wpo_half_width{width:100%}}#select_all_optimizations{margin-left:-5px}.wp-optimize-settings-clean-transient label,.wp-optimize-settings-clean-pingbacks label,.wp-optimize-settings-clean-trackbacks label,.wp-optimize-settings-clean-postmeta label,.wp-optimize-settings-clean-orphandata label,.wp-optimize-settings-clean-commentmeta label{color:#9b0000}td.wp-optimize-settings-optimization-checkbox{width:18px;padding-left:4px;padding-right:0}.wp-optimize-settings-optimization-checkbox input{margin:0;padding:0}#retention-period{width:60px}.wp-optimize-settings-optimization-info{font-size:80%;padding-left:32px;font-style:italic}.wp-optimize-settings input[type="checkbox"]{width:18px}img.addons{display:block;margin-left:auto;margin-right:auto;height:44px}.wpo_spinner{width:18px;height:18px;padding-left:10px;display:none;position:relative;top:4px}.optimization_spinner{width:20px;height:20px}#wp-optimize-auto-options{margin:20px 0 0 28px}.display-none{display:none}.visibility-hidden{visibility:hidden}.margin-one-percent{margin:1%}#save_done,.save-done{color:#d94f00;font-size:250%}.wp-optimize-settings-optimization-info a{text-decoration:underline}.wp-optimize-settings-optimization-run-spinner{position:relative;top:2px}#wpoptimize_table_list .tablesorter-filter-row{display:none !important}#wp_optimize_table_list_refresh{float:right}#wp_optimize_table_list_refresh:hover{cursor:pointer}#wpoptimize_table_list .optimization_spinner{position:relative;top:5px;left:5px}#wpoptimize_table_list_filter{width:100%}#wpoptimize_table_list_tables_not_found{display:none}#optimize_form .select2-container,#wp-optimize-auto-options .select2-container{width:50% !important;top:-5px;height:40px;margin-left:10px}#wpoptimize_table_list .optimization_done_icon{color:#d94f00;font-size:200%;display:inline-block;position:relative;top:5px;left:-20px}#wpo_sitelist_show_moreoptions_cron{font-size:13px;line-height:1.5;letter-spacing:1px}.wpo_unused_image,.wpo_smush_image{position:relative;float:left;margin:.5%;width:32%;text-align:center;background:rgba(220,220,220,0.5);height:20vh;min-height:200px}.wpo_unused_image img,.wpo_smush_image img{max-height:80%;max-width:90%;margin:10px 5px}.wpo_unused_image_checkbox_conatiner{text-align:center;position:absolute;width:100%;bottom:7px}#wp-optimize-nav-tab-contents-images .wpo_span_2_of_3 h3{display:inline-block}#wpo_remove_unused_images_btn{margin-top:10px;margin-right:10px;float:right}#wpo_remove_selected_sizes_btn{margin-top:20px}#wp-optimize-nav-tab-contents-tables a{vertical-align:middle}#wpo_sitelist_moreoptions,#wpo_sitelist_moreoptions_cron{margin:4px 16px 6px 0;border:1px dotted;padding:6px 10px;max-height:300px;overflow-y:scroll;overflow-x:hidden}#wpo_sitelist_moreoptions{max-height:150px;margin-right:0}#wpo_settings_sites_list li,#wpo_settings_sites_list li a{font-size:13px;line-height:1.5}#wpo_sitelist_moreoptions_cron li{padding-left:20px}#wpo_import_error_message{display:none;color:#9b0000}#wpo_import_success_message{display:none;color:#46b450}#wp-optimize-logging-options{margin-top:10px}.wpo_logging_header{font-weight:bold;border-top:1px solid #333;border-bottom:1px solid #333;padding:5px 0;margin:0}.wpo_logging_row{border-bottom:1px solid #a1a2a3;padding:5px 0}.wpo_logging_logger_title,.wpo_logging_options_title,.wpo_logging_status_title,.wpo_logging_actions_title,.wpo_logging_logger_row,.wpo_logging_options_row,.wpo_logging_status_row,.wpo_logging_actions_row{display:inline-block}.wpo_logging_logger_title,.wpo_logging_logger_row{width:38%}.wpo_logging_options_title,.wpo_logging_options_row{width:44%}.wpo_logging_status_title,.wpo_logging_status_row{width:8%}.wpo_logging_actions_title,.wpo_logging_actions_row{width:7%}.wpo_logging_actions_row{text-align:right}.wpo_logging_options_row{word-wrap:break-word}#wpo_add_logger_link{clear:both;display:block;cursor:pointer;font-weight:bold}.wpo_logging_actions_row .dashicons-no-alt,.wpo_add_logger_form .dashicons-no-alt{background-color:#f06666;color:#FFF;width:20px;height:20px;border-radius:20px;display:inline-block;cursor:pointer;margin-left:5px}.wpo_add_logger_form .dashicons-no-alt{margin-top:12px;margin-right:10px;float:right}.wpo_logger_type{width:90%;margin-top:10px}.wpo_logger_addition_option{width:100%;margin-top:5px}.wpo_alert_notice{background-color:#f06666;color:#FFF;padding:5px;display:block;margin-bottom:5px;border-radius:5px}.wpo_error_field{border-color:#f06666 !important}.save_settings_reminder{display:none;color:#333;padding:5px 10px;border:1px solid #F00;background-color:#f0a5a4;border-radius:5px;margin:15px 0}.wpo_feature_cont{width:54.5%}.wpo_plugin_family_cont{width:44.5%}.wpo_feat_table,.wpo_feat_th,.wpo_feat_table td{border:1px solid black;border-collapse:collapse;font-size:120%;background-color:white;text-align:center}.wpo_feat_table p{padding:0 10px;margin:5px 0;font-size:16px}.wpo_feat_table h4{margin:5px 0}.wpo_feat_table .dashicons{width:25px;height:25px;font-size:25px;line-height:1}.wpo_feat_table .dashicons-yes,.wpo_feat_table .updraft-yes{color:green}.wpo_feat_table .dashicons-no-alt,.wpo_feat_table .updraft-no{color:red}.wpo-premium-image{display:none}@media screen and (min-width:720px){#wpoptimize_table_list_filter{width:40%}.wpo-premium-image{display:block;float:left;padding:14px 8px;width:50px;height:50px}}.other-plugin-title{text-decoration:none}#wpo_remove_selected_sizes{margin-top:20px}.wpo_unused_images_buttons_wrap{display:none}.wpo_unused_images_container h3{min-width:150px}#wpo_unused_images,#wpo_smush_images_grid{max-height:500px;overflow-y:auto}#wpo_unused_images a{outline:0}
2
  /*# sourceMappingURL=admin.min.css.map */
css/admin.min.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["css/admin.css"],"names":[],"mappings":"AAAA;CACC,cAAc;CACd;;AAED,gBAAgB;AAChB;CACC,4BAA4B;CAC5B,2BAA2B;CAC3B,iBAAiB;CACjB,iBAAiB;CACjB;;AAED,gBAAgB;AAChB;CACC,YAAY;CACZ,WAAW;CACX,UAAU;CACV;;AAED;CACC,oBAAoB;CACpB;;AAED,oBAAoB;AACpB;CACC,eAAe;CACf,YAAY;CACZ,mBAAmB;CACnB;;AAED;CACC,eAAe;CACf;;AAED,gBAAgB;AAChB;;CAEC,YAAY;CACZ,eAAe;CACf;;AAED;CACC,YAAY;CACZ;;AAED;CACC,WAAW;CACX;;AAED,qBAAqB;AACrB;CACC,YAAY;CACZ;;AAED;CACC,aAAa;CACb;;AAED;CACC,aAAa;CACb;;AAED;CACC,iBAAiB;CACjB;;AAED;;CAEC;EACC,0BAA0B;EAC1B;;CAED;EACC,yBAAyB;EACzB;;CAED;;AAED;;CAEC;EACC,yBAAyB;EACzB;;CAED;EACC,0BAA0B;EAC1B;;CAED;;AAED;;CAEC;EACC,aAAa;EACb;;CAED;EACC,YAAY;EACZ;;CAED;EACC,YAAY;EACZ;;CAED;EACC,YAAY;EACZ;;CAED;EACC,YAAY;EACZ;;CAED;;AAED;CACC,eAAe;CACf;;AAED;CACC,YAAY;CACZ,kBAAkB;CAClB,mBAAmB;CACnB;;AAED;CACC,YAAY;CACZ,aAAa;CACb;;AAED;CACC,YAAY;CACZ;;AAED;CACC,eAAe;CACf,mBAAmB;CACnB,mBAAmB;CACnB;;AAED;CACC,YAAY;CACZ;;AAED,sCAAsC;AACtC;CACC,eAAe;CACf,kBAAkB;CAClB,mBAAmB;CACnB,aAAa;CACb;;AAED;CACC,YAAY;CACZ,aAAa;CACb,mBAAmB;CACnB,cAAc;CACd,mBAAmB;CACnB,SAAS;CACT;;AAED;CACC,YAAY;CACZ,aAAa;CACb;;AAED;CACC,sBAAsB;CACtB;;AAED;CACC,cAAc;CACd;;AAED;CACC,mBAAmB;CACnB;;AAED;CACC,WAAW;CACX;;AAED;CACC,eAAe;CACf,gBAAgB;CAChB;;AAED;CACC,2BAA2B;CAC3B;;AAED;CACC,mBAAmB;CACnB,SAAS;CACT;;AAED;CACC,yBAAyB;CACzB;;AAED;CACC,aAAa;CACb;;AAED;CACC,gBAAgB;CAChB;;AAED;CACC,mBAAmB;CACnB,SAAS;CACT,UAAU;CACV;;AAED;CACC,YAAY;CACZ;;AAED;CACC,cAAc;CACd;;AAED;;CAEC,sBAAsB;CACtB,UAAU;CACV,aAAa;CACb,kBAAkB;CAClB;;AAED;CACC,eAAe;CACf,gBAAgB;CAChB,sBAAsB;CACtB,mBAAmB;CACnB,SAAS;CACT,YAAY;CACZ;;AAED;CACC,gBAAgB;CAChB,iBAAiB;CACjB,oBAAoB;CACpB;;AAED;CACC,mBAAmB;CACnB,YAAY;CACZ,YAAY;CACZ,WAAW;CACX,mBAAmB;CACnB,qCAAqC;CACrC,aAAa;CACb,kBAAkB;CAClB;;AAED;CACC,gBAAgB;CAChB,eAAe;CACf,iBAAiB;CACjB;;AAED;CACC,mBAAmB;CACnB,mBAAmB;CACnB,YAAY;CACZ,YAAY;CACZ;;AAED;CACC,sBAAsB;CACtB;;AAED;CACC,iBAAiB;CACjB,mBAAmB;CACnB,aAAa;CACb;;AAED;CACC,iBAAiB;CACjB;;AAED;CACC,uBAAuB;CACvB;;AAED;;CAEC,uBAAuB;CACvB,mBAAmB;CACnB,kBAAkB;CAClB,kBAAkB;CAClB,mBAAmB;CACnB,mBAAmB;CACnB;;AAED;CACC,kBAAkB;CAClB,gBAAgB;CAChB;;AAED;;CAEC,gBAAgB;CAChB,iBAAiB;CACjB;;AAED;CACC,mBAAmB;CACnB;;AAED;CACC,cAAc;CACd,eAAe;CACf;;AAED;CACC,cAAc;CACd,eAAe;CACf;;AAED;CACC,iBAAiB;CACjB;;AAED,oBAAoB;AACpB;CACC,kBAAkB;CAClB,2BAA2B;CAC3B,8BAA8B;CAC9B,eAAe;CACf,UAAU;CACV;;AAED;CACC,iCAAiC;CACjC,eAAe;CACf;;AAED;;;;;;;;CAQC,sBAAsB;CACtB;;AAED;;CAEC,WAAW;CACX;;AAED;;CAEC,WAAW;CACX;;AAED;;CAEC,UAAU;CACV;;AAED;;CAEC,UAAU;CACV;;AAED;CACC,kBAAkB;CAClB;;AAED;CACC,sBAAsB;CACtB;;AAED;CACC,YAAY;CACZ,eAAe;CACf,gBAAgB;CAChB,kBAAkB;CAClB;;AAED;;CAEC,0BAA0B;CAC1B,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,oBAAoB;CACpB,sBAAsB;CACtB,gBAAgB;CAChB,iBAAiB;CACjB;;AAED;CACC,iBAAiB;CACjB,mBAAmB;CACnB,aAAa;CACb;;AAED;CACC,WAAW;CACX,iBAAiB;CACjB;;AAED;CACC,YAAY;CACZ,gBAAgB;CAChB;;AAED;CACC,0BAA0B;CAC1B,YAAY;CACZ,aAAa;CACb,eAAe;CACf,mBAAmB;CACnB,mBAAmB;CACnB;;AAED;CACC,iCAAiC;CACjC;;AAED;CACC,cAAc;CACd,YAAY;CACZ,kBAAkB;CAClB,uBAAuB;CACvB,0BAA0B;CAC1B,mBAAmB;CACnB,eAAe;CACf;;AAED,wCAAwC;AACxC;CACC,aAAa;CACb;;AAED;CACC,aAAa;CACb;;AAED;CACC,wBAAwB;CACxB,0BAA0B;CAC1B,gBAAgB;CAChB,wBAAwB;CACxB,mBAAmB;CACnB;;AAED;CACC,kBAAkB;CAClB,gBAAgB;CAChB,gBAAgB;CAChB;;AAED;CACC,gBAAgB;CAChB;;AAED;CACC,YAAY;CACZ,aAAa;CACb,gBAAgB;CAChB,eAAe;CACf;;AAED;CACC,aAAa;CACb;;AAED;CACC,WAAW;CACX;;AAED;CACC,cAAc;CACd;;AAED;;CAEC;EACC,WAAW;EACX;;CAED;EACC,eAAe;EACf,YAAY;EACZ,kBAAkB;EAClB,YAAY;EACZ,aAAa;EACb;;CAED;;AAED;CACC,sBAAsB;CACtB;;AAED;CACC,iBAAiB;CACjB;;AAED;CACC,cAAc;CACd;;AAED;CACC,iBAAiB;CACjB;;AAED;CACC,kBAAkB;CAClB,iBAAiB;CACjB;;AAED;CACC,cAAc;CACd","file":"admin.min.css","sourcesContent":[".wpo_hidden {\n\tdisplay: none;\n}\n\n/* big button */\n.wpo_primary_big {\n\tpadding: 4px 6px !important;\n\tfont-size: 22px !important;\n\tmin-height: 34px;\n\tmin-width: 200px;\n}\n\n/* SECTIONS */\n.wpo_section {\n\tclear: both;\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.wp-optimize-settings {\n\tmargin-bottom: 16px;\n}\n\n/* COLUMN SETUP */\n.wpo_col {\n\tdisplay: block;\n\tfloat: left;\n\tmargin: 1% 0 1% 1%;\n}\n\n.wpo_col:first-child {\n\tmargin-left: 0;\n}\n\n/* GROUPING */\n.wpo_group:before,\n.wpo_group:after {\n\tcontent: \"\";\n\tdisplay: table;\n}\n\n.wpo_group:after {\n\tclear: both;\n}\n\n.wpo_half_width {\n\twidth: 48%;\n}\n\n/* GRID OF THREE */\n.wpo_span_3_of_3 {\n\twidth: 100%;\n}\n\n.wpo_span_2_of_3 {\n\twidth: 65.3%;\n}\n\n.wpo_span_1_of_3 {\n\twidth: 32.1%;\n}\n\n.nav-tab-wrapper {\n\tmargin: 14px 0px;\n}\n\n@media screen and (min-width: 549px) {\n\n\t.show_on_default_sizes {\n\t\tdisplay: block !important;\n\t}\n\n\t.show_on_mobile_sizes {\n\t\tdisplay: none !important;\n\t}\n\n}\n\n@media screen and (max-width: 548px) {\n\n\t.show_on_default_sizes {\n\t\tdisplay: none !important;\n\t}\n\n\t.show_on_mobile_sizes {\n\t\tdisplay: block !important;\n\t}\n\n}\n\n@media screen and (max-width: 768px) {\n\n\t.wpo_col {\n\t\tmargin: 1% 0;\n\t}\n\n\t.wpo_span_3_of_3 {\n\t\twidth: 100%;\n\t}\n\n\t.wpo_span_2_of_3 {\n\t\twidth: 100%;\n\t}\n\n\t.wpo_span_1_of_3 {\n\t\twidth: 100%;\n\t}\n\n\t.wpo_half_width {\n\t\twidth: 100%;\n\t}\n\n}\n\n.wp-optimize-settings-clean-transient label, .wp-optimize-settings-clean-pingbacks label, .wp-optimize-settings-clean-trackbacks label, .wp-optimize-settings-clean-postmeta label, .wp-optimize-settings-clean-orphandata label, .wp-optimize-settings-clean-commentmeta label {\n\tcolor: #9B0000;\n}\n\ntd.wp-optimize-settings-optimization-checkbox {\n\twidth: 18px;\n\tpadding-left: 4px;\n\tpadding-right: 0px;\n}\n\n.wp-optimize-settings-optimization-checkbox input {\n\tmargin: 0px;\n\tpadding: 0px;\n}\n\n#retention-period {\n\twidth: 60px;\n}\n\n.wp-optimize-settings-optimization-info {\n\tfont-size: 80%;\n\tpadding-left: 32px;\n\tfont-style: italic;\n}\n\n.wp-optimize-settings input[type=\"checkbox\"] {\n\twidth: 18px;\n}\n\n/* Added for the Image on Addons tab*/\nimg.addons {\n\tdisplay: block;\n\tmargin-left: auto;\n\tmargin-right: auto;\n\theight: 44px;\n}\n\n.wpo_spinner {\n\twidth: 18px;\n\theight: 18px;\n\tpadding-left: 10px;\n\tdisplay: none;\n\tposition: relative;\n\ttop: 4px;\n}\n\n.optimization_spinner {\n\twidth: 20px;\n\theight: 20px;\n}\n\n#wp-optimize-auto-options {\n\tmargin: 20px 0 0 28px;\n}\n\n.display-none {\n\tdisplay: none;\n}\n\n.visibility-hidden {\n\tvisibility: hidden;\n}\n\n.margin-one-percent {\n\tmargin: 1%;\n}\n\n#save_done {\n\tcolor: #D94F00;\n\tfont-size: 250%;\n}\n\n.wp-optimize-settings-optimization-info a {\n\ttext-decoration: underline;\n}\n\n.wp-optimize-settings-optimization-run-spinner {\n\tposition: relative;\n\ttop: 2px;\n}\n\n#wpoptimize_table_list .tablesorter-filter-row {\n\tdisplay: none !important;\n}\n\n#wp_optimize_table_list_refresh {\n\tfloat: right;\n}\n\n#wp_optimize_table_list_refresh:hover {\n\tcursor: pointer;\n}\n\n#wpoptimize_table_list .optimization_spinner {\n\tposition: relative;\n\ttop: 5px;\n\tleft: 5px;\n}\n\n#wpoptimize_table_list_filter {\n\twidth: 100%;\n}\n\n#wpoptimize_table_list_tables_not_found {\n\tdisplay: none;\n}\n\n#optimize_form .select2-container,\n#wp-optimize-auto-options .select2-container {\n\twidth: 50% !important;\n\ttop: -5px;\n\theight: 40px;\n\tmargin-left: 10px;\n}\n\n#wpoptimize_table_list .optimization_done_icon {\n\tcolor: #D94F00;\n\tfont-size: 200%;\n\tdisplay: inline-block;\n\tposition: relative;\n\ttop: 5px;\n\tleft: -20px;\n}\n\n#wpo_sitelist_show_moreoptions_cron {\n\tfont-size: 13px;\n\tline-height: 1.5;\n\tletter-spacing: 1px;\n}\n\n.wpo_unused_image {\n\tposition: relative;\n\tfloat: left;\n\tmargin: .5%;\n\twidth: 32%;\n\ttext-align: center;\n\tbackground: rgba(220, 220, 220, 0.5);\n\theight: 20vh;\n\tmin-height: 200px;\n}\n\n.wpo_unused_image img {\n\tmax-height: 80%;\n\tmax-width: 90%;\n\tmargin: 10px 5px;\n}\n\n.wpo_unused_image_checkbox_conatiner {\n\ttext-align: center;\n\tposition: absolute;\n\twidth: 100%;\n\tbottom: 7px;\n}\n\n#wp-optimize-nav-tab-contents-images .wpo_span_2_of_3 h3 {\n\tdisplay: inline-block;\n}\n\n#wpo_remove_unused_images_btn {\n\tmargin-top: 10px;\n\tmargin-right: 10px;\n\tfloat: right;\n}\n\n#wpo_remove_selected_sizes_btn {\n\tmargin-top: 20px;\n}\n\n#wp-optimize-nav-tab-contents-tables a {\n\tvertical-align: middle;\n}\n\n#wpo_sitelist_moreoptions,\n#wpo_sitelist_moreoptions_cron {\n\tmargin: 4px 16px 6px 0;\n\tborder: 1px dotted;\n\tpadding: 6px 10px;\n\tmax-height: 300px;\n\toverflow-y: scroll;\n\toverflow-x: hidden;\n}\n\n#wpo_sitelist_moreoptions {\n\tmax-height: 150px;\n\tmargin-right: 0;\n}\n\n#wpo_settings_sites_list li,\n#wpo_settings_sites_list li a {\n\tfont-size: 13px;\n\tline-height: 1.5;\n}\n\n#wpo_sitelist_moreoptions_cron li {\n\tpadding-left: 20px;\n}\n\n#wpo_import_error_message {\n\tdisplay: none;\n\tcolor: #9B0000;\n}\n\n#wpo_import_success_message {\n\tdisplay: none;\n\tcolor: #46B450;\n}\n\n#wp-optimize-logging-options {\n\tmargin-top: 10px;\n}\n\n/* Logger settings*/\n.wpo_logging_header {\n\tfont-weight: bold;\n\tborder-top: 1px solid #333;\n\tborder-bottom: 1px solid #333;\n\tpadding: 5px 0;\n\tmargin: 0;\n}\n\n.wpo_logging_row {\n\tborder-bottom: 1px solid #A1A2A3;\n\tpadding: 5px 0;\n}\n\n.wpo_logging_logger_title,\n.wpo_logging_options_title,\n.wpo_logging_status_title,\n.wpo_logging_actions_title,\n.wpo_logging_logger_row,\n.wpo_logging_options_row,\n.wpo_logging_status_row,\n.wpo_logging_actions_row {\n\tdisplay: inline-block;\n}\n\n.wpo_logging_logger_title,\n.wpo_logging_logger_row {\n\twidth: 38%;\n}\n\n.wpo_logging_options_title,\n.wpo_logging_options_row {\n\twidth: 44%;\n}\n\n.wpo_logging_status_title,\n.wpo_logging_status_row {\n\twidth: 8%;\n}\n\n.wpo_logging_actions_title,\n.wpo_logging_actions_row {\n\twidth: 7%;\n}\n\n.wpo_logging_actions_row {\n\ttext-align: right;\n}\n\n.wpo_logging_options_row {\n\tword-wrap: break-word;\n}\n\n#wpo_add_logger_link {\n\tclear: both;\n\tdisplay: block;\n\tcursor: pointer;\n\tfont-weight: bold;\n}\n\n.wpo_logging_actions_row .dashicons-no-alt,\n.wpo_add_logger_form .dashicons-no-alt {\n\tbackground-color: #F06666;\n\tcolor: #FFF;\n\twidth: 20px;\n\theight: 20px;\n\tborder-radius: 20px;\n\tdisplay: inline-block;\n\tcursor: pointer;\n\tmargin-left: 5px;\n}\n\n.wpo_add_logger_form .dashicons-no-alt {\n\tmargin-top: 12px;\n\tmargin-right: 10px;\n\tfloat: right;\n}\n\n.wpo_logger_type {\n\twidth: 90%;\n\tmargin-top: 10px;\n}\n\n.wpo_logger_addition_option {\n\twidth: 100%;\n\tmargin-top: 5px;\n}\n\n.wpo_alert_notice {\n\tbackground-color: #F06666;\n\tcolor: #FFF;\n\tpadding: 5px;\n\tdisplay: block;\n\tmargin-bottom: 5px;\n\tborder-radius: 5px;\n}\n\n.wpo_error_field {\n\tborder-color: #F06666 !important;\n}\n\n.save_settings_reminder {\n\tdisplay: none;\n\tcolor: #333;\n\tpadding: 5px 10px;\n\tborder: 1px solid #F00;\n\tbackground-color: #F0A5A4;\n\tborder-radius: 5px;\n\tmargin: 15px 0;\n}\n\n/* Added for WPO Premium Features tab */\n.wpo_feature_cont {\n\twidth: 54.5%;\n}\n\n.wpo_plugin_family_cont {\n\twidth: 44.5%;\n}\n\n.wpo_feat_table, .wpo_feat_th, .wpo_feat_table td {\n\tborder: 1px solid black;\n\tborder-collapse: collapse;\n\tfont-size: 120%;\n\tbackground-color: white;\n\ttext-align: center;\n}\n\n.wpo_feat_table p {\n\tpadding: 0px 10px;\n\tmargin: 5px 0px;\n\tfont-size: 16px;\n}\n\n.wpo_feat_table h4 {\n\tmargin: 5px 0px;\n}\n\n.wpo_feat_table .dashicons {\n\twidth: 25px;\n\theight: 25px;\n\tfont-size: 25px;\n\tline-height: 1;\n}\n\n.wpo_feat_table .dashicons-yes, .wpo_feat_table .updraft-yes {\n\tcolor: green;\n}\n\n.wpo_feat_table .dashicons-no-alt, .wpo_feat_table .updraft-no {\n\tcolor: red;\n}\n\n.wpo-premium-image {\n\tdisplay: none;\n}\n\n@media screen and (min-width: 720px) {\n\n\t#wpoptimize_table_list_filter {\n\t\twidth: 40%;\n\t}\n\n\t.wpo-premium-image {\n\t\tdisplay: block;\n\t\tfloat: left;\n\t\tpadding: 14px 8px;\n\t\twidth: 50px;\n\t\theight: 50px;\n\t}\n\n}\n\n.other-plugin-title {\n\ttext-decoration: none;\n}\n\n#wpo_remove_selected_sizes {\n\tmargin-top: 20px;\n}\n\n.wpo_unused_images_buttons_wrap {\n\tdisplay: none;\n}\n\n.wpo_unused_images_container h3 {\n\tmin-width: 150px;\n}\n\n#wpo_unused_images {\n\tmax-height: 500px;\n\toverflow-y: auto;\n}\n\n#wpo_unused_images a {\n\toutline: none;\n}"]}
1
+ {"version":3,"sources":["css/admin.css"],"names":[],"mappings":"AAAA;CACC,cAAc;CACd;;AAED;CACC,iBAAiB;CACjB,YAAY;CACZ,2IAA2I;CAC3I,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CAEjB,uCAAuC;CACvC;;AAED,gBAAgB;AAChB;CACC,4BAA4B;CAC5B,2BAA2B;CAC3B,iBAAiB;CACjB,iBAAiB;CACjB;;AAED,gBAAgB;AAChB;CACC,YAAY;CACZ,WAAW;CACX,UAAU;CACV;;AAED;CACC,oBAAoB;CACpB;;AAED,oBAAoB;AACpB;CACC,eAAe;CACf,YAAY;CACZ,mBAAmB;CACnB;;AAED;CACC,eAAe;CACf;;AAED,gBAAgB;AAChB;;CAEC,YAAY;CACZ,eAAe;CACf;;AAED;CACC,YAAY;CACZ;;AAED;CACC,WAAW;CACX;;AAED,qBAAqB;AACrB;CACC,YAAY;CACZ;;AAED;CACC,aAAa;CACb;;AAED;CACC,aAAa;CACb;;AAED;CACC,iBAAiB;CACjB;;AAED;;CAEC;EACC,0BAA0B;EAC1B;;CAED;EACC,yBAAyB;EACzB;;CAED;;AAED;;CAEC;EACC,yBAAyB;EACzB;;CAED;EACC,0BAA0B;EAC1B;;CAED;;AAED;;CAEC;EACC,aAAa;EACb;;CAED;EACC,YAAY;EACZ;;CAED;EACC,YAAY;EACZ;;CAED;EACC,YAAY;EACZ;;CAED;EACC,YAAY;EACZ;;CAED;;AAED;CACC,kBAAkB;CAClB;;AAED;CACC,eAAe;CACf;;AAED;CACC,YAAY;CACZ,kBAAkB;CAClB,mBAAmB;CACnB;;AAED;CACC,YAAY;CACZ,aAAa;CACb;;AAED;CACC,YAAY;CACZ;;AAED;CACC,eAAe;CACf,mBAAmB;CACnB,mBAAmB;CACnB;;AAED;CACC,YAAY;CACZ;;AAED,sCAAsC;AACtC;CACC,eAAe;CACf,kBAAkB;CAClB,mBAAmB;CACnB,aAAa;CACb;;AAED;CACC,YAAY;CACZ,aAAa;CACb,mBAAmB;CACnB,cAAc;CACd,mBAAmB;CACnB,SAAS;CACT;;AAED;CACC,YAAY;CACZ,aAAa;CACb;;AAED;CACC,sBAAsB;CACtB;;AAED;CACC,cAAc;CACd;;AAED;CACC,mBAAmB;CACnB;;AAED;CACC,WAAW;CACX;;AAED;CACC,eAAe;CACf,gBAAgB;CAChB;;AAED;CACC,2BAA2B;CAC3B;;AAED;CACC,mBAAmB;CACnB,SAAS;CACT;;AAED;CACC,yBAAyB;CACzB;;AAED;CACC,aAAa;CACb;;AAED;CACC,gBAAgB;CAChB;;AAED;CACC,mBAAmB;CACnB,SAAS;CACT,UAAU;CACV;;AAED;CACC,YAAY;CACZ;;AAED;CACC,cAAc;CACd;;AAED;;CAEC,sBAAsB;CACtB,UAAU;CACV,aAAa;CACb,kBAAkB;CAClB;;AAED;CACC,eAAe;CACf,gBAAgB;CAChB,sBAAsB;CACtB,mBAAmB;CACnB,SAAS;CACT,YAAY;CACZ;;AAED;CACC,gBAAgB;CAChB,iBAAiB;CACjB,oBAAoB;CACpB;;AAED;CACC,mBAAmB;CACnB,YAAY;CACZ,YAAY;CACZ,WAAW;CACX,mBAAmB;CACnB,qCAAqC;CACrC,aAAa;CACb,kBAAkB;CAClB;;AAED;CACC,gBAAgB;CAChB,eAAe;CACf,iBAAiB;CACjB;;AAED;CACC,mBAAmB;CACnB,mBAAmB;CACnB,YAAY;CACZ,YAAY;CACZ;;AAED;CACC,sBAAsB;CACtB;;AAED;CACC,iBAAiB;CACjB,mBAAmB;CACnB,aAAa;CACb;;AAED;CACC,iBAAiB;CACjB;;AAED;CACC,uBAAuB;CACvB;;AAED;;CAEC,uBAAuB;CACvB,mBAAmB;CACnB,kBAAkB;CAClB,kBAAkB;CAClB,mBAAmB;CACnB,mBAAmB;CACnB;;AAED;CACC,kBAAkB;CAClB,gBAAgB;CAChB;;AAED;;CAEC,gBAAgB;CAChB,iBAAiB;CACjB;;AAED;CACC,mBAAmB;CACnB;;AAED;CACC,cAAc;CACd,eAAe;CACf;;AAED;CACC,cAAc;CACd,eAAe;CACf;;AAED;CACC,iBAAiB;CACjB;;AAED,oBAAoB;AACpB;CACC,kBAAkB;CAClB,2BAA2B;CAC3B,8BAA8B;CAC9B,eAAe;CACf,UAAU;CACV;;AAED;CACC,iCAAiC;CACjC,eAAe;CACf;;AAED;;;;;;;;CAQC,sBAAsB;CACtB;;AAED;;CAEC,WAAW;CACX;;AAED;;CAEC,WAAW;CACX;;AAED;;CAEC,UAAU;CACV;;AAED;;CAEC,UAAU;CACV;;AAED;CACC,kBAAkB;CAClB;;AAED;CACC,sBAAsB;CACtB;;AAED;CACC,YAAY;CACZ,eAAe;CACf,gBAAgB;CAChB,kBAAkB;CAClB;;AAED;;CAEC,0BAA0B;CAC1B,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,oBAAoB;CACpB,sBAAsB;CACtB,gBAAgB;CAChB,iBAAiB;CACjB;;AAED;CACC,iBAAiB;CACjB,mBAAmB;CACnB,aAAa;CACb;;AAED;CACC,WAAW;CACX,iBAAiB;CACjB;;AAED;CACC,YAAY;CACZ,gBAAgB;CAChB;;AAED;CACC,0BAA0B;CAC1B,YAAY;CACZ,aAAa;CACb,eAAe;CACf,mBAAmB;CACnB,mBAAmB;CACnB;;AAED;CACC,iCAAiC;CACjC;;AAED;CACC,cAAc;CACd,YAAY;CACZ,kBAAkB;CAClB,uBAAuB;CACvB,0BAA0B;CAC1B,mBAAmB;CACnB,eAAe;CACf;;AAED,wCAAwC;AACxC;CACC,aAAa;CACb;;AAED;CACC,aAAa;CACb;;AAED;CACC,wBAAwB;CACxB,0BAA0B;CAC1B,gBAAgB;CAChB,wBAAwB;CACxB,mBAAmB;CACnB;;AAED;CACC,kBAAkB;CAClB,gBAAgB;CAChB,gBAAgB;CAChB;;AAED;CACC,gBAAgB;CAChB;;AAED;CACC,YAAY;CACZ,aAAa;CACb,gBAAgB;CAChB,eAAe;CACf;;AAED;CACC,aAAa;CACb;;AAED;CACC,WAAW;CACX;;AAED;CACC,cAAc;CACd;;AAED;;CAEC;EACC,WAAW;EACX;;CAED;EACC,eAAe;EACf,YAAY;EACZ,kBAAkB;EAClB,YAAY;EACZ,aAAa;EACb;;CAED;;AAED;CACC,sBAAsB;CACtB;;AAED;CACC,iBAAiB;CACjB;;AAED;CACC,cAAc;CACd;;AAED;CACC,iBAAiB;CACjB;;AAED;CACC,kBAAkB;CAClB,iBAAiB;CACjB;;AAED;CACC,cAAc;CACd","file":"admin.min.css","sourcesContent":[".wpo_hidden {\n\tdisplay: none;\n}\n\n.wpo_info {\n\tbackground: #FFF;\n\tcolor: #444;\n\tfont-family: -apple-system, \"BlinkMacSystemFont\", \"Segoe UI\", \"Roboto\", \"Oxygen-Sans\", \"Ubuntu\", \"Cantarell\", \"Helvetica Neue\", sans-serif;\n\tmargin: 2em auto;\n\tpadding: 1em 2em;\n\tmax-width: 700px;\n\t-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.13);\n\tbox-shadow: 0 1px 3px rgba(0,0,0,0.13);\n}\n\n/* big button */\n.wpo_primary_big {\n\tpadding: 4px 6px !important;\n\tfont-size: 22px !important;\n\tmin-height: 34px;\n\tmin-width: 200px;\n}\n\n/* SECTIONS */\n.wpo_section {\n\tclear: both;\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.wp-optimize-settings {\n\tmargin-bottom: 16px;\n}\n\n/* COLUMN SETUP */\n.wpo_col {\n\tdisplay: block;\n\tfloat: left;\n\tmargin: 1% 0 1% 1%;\n}\n\n.wpo_col:first-child {\n\tmargin-left: 0;\n}\n\n/* GROUPING */\n.wpo_group:before,\n.wpo_group:after {\n\tcontent: \"\";\n\tdisplay: table;\n}\n\n.wpo_group:after {\n\tclear: both;\n}\n\n.wpo_half_width {\n\twidth: 48%;\n}\n\n/* GRID OF THREE */\n.wpo_span_3_of_3 {\n\twidth: 100%;\n}\n\n.wpo_span_2_of_3 {\n\twidth: 65.3%;\n}\n\n.wpo_span_1_of_3 {\n\twidth: 32.1%;\n}\n\n.nav-tab-wrapper {\n\tmargin: 14px 0px;\n}\n\n@media screen and (min-width: 549px) {\n\n\t.show_on_default_sizes {\n\t\tdisplay: block !important;\n\t}\n\n\t.show_on_mobile_sizes {\n\t\tdisplay: none !important;\n\t}\n\n}\n\n@media screen and (max-width: 548px) {\n\n\t.show_on_default_sizes {\n\t\tdisplay: none !important;\n\t}\n\n\t.show_on_mobile_sizes {\n\t\tdisplay: block !important;\n\t}\n\n}\n\n@media screen and (max-width: 768px) {\n\n\t.wpo_col {\n\t\tmargin: 1% 0;\n\t}\n\n\t.wpo_span_3_of_3 {\n\t\twidth: 100%;\n\t}\n\n\t.wpo_span_2_of_3 {\n\t\twidth: 100%;\n\t}\n\n\t.wpo_span_1_of_3 {\n\t\twidth: 100%;\n\t}\n\n\t.wpo_half_width {\n\t\twidth: 100%;\n\t}\n\n}\n\n#select_all_optimizations {\n\tmargin-left: -5px;\n}\n\n.wp-optimize-settings-clean-transient label, .wp-optimize-settings-clean-pingbacks label, .wp-optimize-settings-clean-trackbacks label, .wp-optimize-settings-clean-postmeta label, .wp-optimize-settings-clean-orphandata label, .wp-optimize-settings-clean-commentmeta label {\n\tcolor: #9B0000;\n}\n\ntd.wp-optimize-settings-optimization-checkbox {\n\twidth: 18px;\n\tpadding-left: 4px;\n\tpadding-right: 0px;\n}\n\n.wp-optimize-settings-optimization-checkbox input {\n\tmargin: 0px;\n\tpadding: 0px;\n}\n\n#retention-period {\n\twidth: 60px;\n}\n\n.wp-optimize-settings-optimization-info {\n\tfont-size: 80%;\n\tpadding-left: 32px;\n\tfont-style: italic;\n}\n\n.wp-optimize-settings input[type=\"checkbox\"] {\n\twidth: 18px;\n}\n\n/* Added for the Image on Addons tab*/\nimg.addons {\n\tdisplay: block;\n\tmargin-left: auto;\n\tmargin-right: auto;\n\theight: 44px;\n}\n\n.wpo_spinner {\n\twidth: 18px;\n\theight: 18px;\n\tpadding-left: 10px;\n\tdisplay: none;\n\tposition: relative;\n\ttop: 4px;\n}\n\n.optimization_spinner {\n\twidth: 20px;\n\theight: 20px;\n}\n\n#wp-optimize-auto-options {\n\tmargin: 20px 0 0 28px;\n}\n\n.display-none {\n\tdisplay: none;\n}\n\n.visibility-hidden {\n\tvisibility: hidden;\n}\n\n.margin-one-percent {\n\tmargin: 1%;\n}\n\n#save_done, .save-done {\n\tcolor: #D94F00;\n\tfont-size: 250%;\n}\n\n.wp-optimize-settings-optimization-info a {\n\ttext-decoration: underline;\n}\n\n.wp-optimize-settings-optimization-run-spinner {\n\tposition: relative;\n\ttop: 2px;\n}\n\n#wpoptimize_table_list .tablesorter-filter-row {\n\tdisplay: none !important;\n}\n\n#wp_optimize_table_list_refresh {\n\tfloat: right;\n}\n\n#wp_optimize_table_list_refresh:hover {\n\tcursor: pointer;\n}\n\n#wpoptimize_table_list .optimization_spinner {\n\tposition: relative;\n\ttop: 5px;\n\tleft: 5px;\n}\n\n#wpoptimize_table_list_filter {\n\twidth: 100%;\n}\n\n#wpoptimize_table_list_tables_not_found {\n\tdisplay: none;\n}\n\n#optimize_form .select2-container,\n#wp-optimize-auto-options .select2-container {\n\twidth: 50% !important;\n\ttop: -5px;\n\theight: 40px;\n\tmargin-left: 10px;\n}\n\n#wpoptimize_table_list .optimization_done_icon {\n\tcolor: #D94F00;\n\tfont-size: 200%;\n\tdisplay: inline-block;\n\tposition: relative;\n\ttop: 5px;\n\tleft: -20px;\n}\n\n#wpo_sitelist_show_moreoptions_cron {\n\tfont-size: 13px;\n\tline-height: 1.5;\n\tletter-spacing: 1px;\n}\n\n.wpo_unused_image, .wpo_smush_image {\n\tposition: relative;\n\tfloat: left;\n\tmargin: .5%;\n\twidth: 32%;\n\ttext-align: center;\n\tbackground: rgba(220, 220, 220, 0.5);\n\theight: 20vh;\n\tmin-height: 200px;\n}\n\n.wpo_unused_image img, .wpo_smush_image img {\n\tmax-height: 80%;\n\tmax-width: 90%;\n\tmargin: 10px 5px;\n}\n\n.wpo_unused_image_checkbox_conatiner {\n\ttext-align: center;\n\tposition: absolute;\n\twidth: 100%;\n\tbottom: 7px;\n}\n\n#wp-optimize-nav-tab-contents-images .wpo_span_2_of_3 h3 {\n\tdisplay: inline-block;\n}\n\n#wpo_remove_unused_images_btn {\n\tmargin-top: 10px;\n\tmargin-right: 10px;\n\tfloat: right;\n}\n\n#wpo_remove_selected_sizes_btn {\n\tmargin-top: 20px;\n}\n\n#wp-optimize-nav-tab-contents-tables a {\n\tvertical-align: middle;\n}\n\n#wpo_sitelist_moreoptions,\n#wpo_sitelist_moreoptions_cron {\n\tmargin: 4px 16px 6px 0;\n\tborder: 1px dotted;\n\tpadding: 6px 10px;\n\tmax-height: 300px;\n\toverflow-y: scroll;\n\toverflow-x: hidden;\n}\n\n#wpo_sitelist_moreoptions {\n\tmax-height: 150px;\n\tmargin-right: 0;\n}\n\n#wpo_settings_sites_list li,\n#wpo_settings_sites_list li a {\n\tfont-size: 13px;\n\tline-height: 1.5;\n}\n\n#wpo_sitelist_moreoptions_cron li {\n\tpadding-left: 20px;\n}\n\n#wpo_import_error_message {\n\tdisplay: none;\n\tcolor: #9B0000;\n}\n\n#wpo_import_success_message {\n\tdisplay: none;\n\tcolor: #46B450;\n}\n\n#wp-optimize-logging-options {\n\tmargin-top: 10px;\n}\n\n/* Logger settings*/\n.wpo_logging_header {\n\tfont-weight: bold;\n\tborder-top: 1px solid #333;\n\tborder-bottom: 1px solid #333;\n\tpadding: 5px 0;\n\tmargin: 0;\n}\n\n.wpo_logging_row {\n\tborder-bottom: 1px solid #A1A2A3;\n\tpadding: 5px 0;\n}\n\n.wpo_logging_logger_title,\n.wpo_logging_options_title,\n.wpo_logging_status_title,\n.wpo_logging_actions_title,\n.wpo_logging_logger_row,\n.wpo_logging_options_row,\n.wpo_logging_status_row,\n.wpo_logging_actions_row {\n\tdisplay: inline-block;\n}\n\n.wpo_logging_logger_title,\n.wpo_logging_logger_row {\n\twidth: 38%;\n}\n\n.wpo_logging_options_title,\n.wpo_logging_options_row {\n\twidth: 44%;\n}\n\n.wpo_logging_status_title,\n.wpo_logging_status_row {\n\twidth: 8%;\n}\n\n.wpo_logging_actions_title,\n.wpo_logging_actions_row {\n\twidth: 7%;\n}\n\n.wpo_logging_actions_row {\n\ttext-align: right;\n}\n\n.wpo_logging_options_row {\n\tword-wrap: break-word;\n}\n\n#wpo_add_logger_link {\n\tclear: both;\n\tdisplay: block;\n\tcursor: pointer;\n\tfont-weight: bold;\n}\n\n.wpo_logging_actions_row .dashicons-no-alt,\n.wpo_add_logger_form .dashicons-no-alt {\n\tbackground-color: #F06666;\n\tcolor: #FFF;\n\twidth: 20px;\n\theight: 20px;\n\tborder-radius: 20px;\n\tdisplay: inline-block;\n\tcursor: pointer;\n\tmargin-left: 5px;\n}\n\n.wpo_add_logger_form .dashicons-no-alt {\n\tmargin-top: 12px;\n\tmargin-right: 10px;\n\tfloat: right;\n}\n\n.wpo_logger_type {\n\twidth: 90%;\n\tmargin-top: 10px;\n}\n\n.wpo_logger_addition_option {\n\twidth: 100%;\n\tmargin-top: 5px;\n}\n\n.wpo_alert_notice {\n\tbackground-color: #F06666;\n\tcolor: #FFF;\n\tpadding: 5px;\n\tdisplay: block;\n\tmargin-bottom: 5px;\n\tborder-radius: 5px;\n}\n\n.wpo_error_field {\n\tborder-color: #F06666 !important;\n}\n\n.save_settings_reminder {\n\tdisplay: none;\n\tcolor: #333;\n\tpadding: 5px 10px;\n\tborder: 1px solid #F00;\n\tbackground-color: #F0A5A4;\n\tborder-radius: 5px;\n\tmargin: 15px 0;\n}\n\n/* Added for WPO Premium Features tab */\n.wpo_feature_cont {\n\twidth: 54.5%;\n}\n\n.wpo_plugin_family_cont {\n\twidth: 44.5%;\n}\n\n.wpo_feat_table, .wpo_feat_th, .wpo_feat_table td {\n\tborder: 1px solid black;\n\tborder-collapse: collapse;\n\tfont-size: 120%;\n\tbackground-color: white;\n\ttext-align: center;\n}\n\n.wpo_feat_table p {\n\tpadding: 0px 10px;\n\tmargin: 5px 0px;\n\tfont-size: 16px;\n}\n\n.wpo_feat_table h4 {\n\tmargin: 5px 0px;\n}\n\n.wpo_feat_table .dashicons {\n\twidth: 25px;\n\theight: 25px;\n\tfont-size: 25px;\n\tline-height: 1;\n}\n\n.wpo_feat_table .dashicons-yes, .wpo_feat_table .updraft-yes {\n\tcolor: green;\n}\n\n.wpo_feat_table .dashicons-no-alt, .wpo_feat_table .updraft-no {\n\tcolor: red;\n}\n\n.wpo-premium-image {\n\tdisplay: none;\n}\n\n@media screen and (min-width: 720px) {\n\n\t#wpoptimize_table_list_filter {\n\t\twidth: 40%;\n\t}\n\n\t.wpo-premium-image {\n\t\tdisplay: block;\n\t\tfloat: left;\n\t\tpadding: 14px 8px;\n\t\twidth: 50px;\n\t\theight: 50px;\n\t}\n\n}\n\n.other-plugin-title {\n\ttext-decoration: none;\n}\n\n#wpo_remove_selected_sizes {\n\tmargin-top: 20px;\n}\n\n.wpo_unused_images_buttons_wrap {\n\tdisplay: none;\n}\n\n.wpo_unused_images_container h3 {\n\tmin-width: 150px;\n}\n\n#wpo_unused_images, #wpo_smush_images_grid {\n\tmax-height: 500px;\n\toverflow-y: auto;\n}\n\n#wpo_unused_images a {\n\toutline: none;\n}"]}
css/tablesorter/theme.default.min.css CHANGED
@@ -1 +1 @@
1
- .tablesorter-default{width:100%;font:12px/18px Arial,Sans-serif;color:#333;background-color:#fff;border-spacing:0;margin:10px 0 15px;text-align:left}.tablesorter-default th,.tablesorter-default thead td{font-weight:700;color:#000;background-color:#fff;border-collapse:collapse;border-bottom:#ccc 2px solid;padding:0}.tablesorter-default tfoot td,.tablesorter-default tfoot th{border:0}.tablesorter-default .header,.tablesorter-default .tablesorter-header{background-image:url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);background-position:center right;background-repeat:no-repeat;cursor:pointer;white-space:normal;padding:4px 20px 4px 4px}.tablesorter-default thead .headerSortUp,.tablesorter-default thead .tablesorter-headerAsc,.tablesorter-default thead .tablesorter-headerSortUp{background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);border-bottom:#000 2px solid}.tablesorter-default thead .headerSortDown,.tablesorter-default thead .tablesorter-headerDesc,.tablesorter-default thead .tablesorter-headerSortDown{background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);border-bottom:#000 2px solid}.tablesorter-default thead .sorter-false{background-image:none;cursor:default;padding:4px}.tablesorter-default tfoot .tablesorter-headerAsc,.tablesorter-default tfoot .tablesorter-headerDesc,.tablesorter-default tfoot .tablesorter-headerSortDown,.tablesorter-default tfoot .tablesorter-headerSortUp{border-top:#000 2px solid}.tablesorter-default td{background-color:#fff;border-bottom:#ccc 1px solid;padding:4px;vertical-align:top}.tablesorter-default tbody>tr.even:hover>td,.tablesorter-default tbody>tr.hover>td,.tablesorter-default tbody>tr.odd:hover>td,.tablesorter-default tbody>tr:hover>td{background-color:#fff;color:#000}.tablesorter-default .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-default tr.odd>td{background-color:#dfdfdf}.tablesorter-default tr.even>td{background-color:#efefef}.tablesorter-default tr.odd td.primary{background-color:#bfbfbf}.tablesorter-default td.primary,.tablesorter-default tr.even td.primary{background-color:#d9d9d9}.tablesorter-default tr.odd td.secondary{background-color:#d9d9d9}.tablesorter-default td.secondary,.tablesorter-default tr.even td.secondary{background-color:#e6e6e6}.tablesorter-default tr.odd td.tertiary{background-color:#e6e6e6}.tablesorter-default td.tertiary,.tablesorter-default tr.even td.tertiary{background-color:#f2f2f2}caption{background-color:#fff}.tablesorter-default .tablesorter-filter-row{background-color:#eee}.tablesorter-default .tablesorter-filter-row td{background-color:#eee;border-bottom:#ccc 1px solid;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-default .tablesorter-filter-row .disabled{opacity:.5;cursor:not-allowed}.tablesorter-default .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-default .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;/* don't use visibility: hidden because it disables tabbing */opacity:0}.tablesorter-default input.tablesorter-filter,.tablesorter-default select.tablesorter-filter{width:95%;height:auto;margin:4px auto;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99}
1
+ .tablesorter-default{width:100%;font:12px/18px Arial,Sans-serif;color:#333;background-color:#fff;border-spacing:0;margin:10px 0 15px;text-align:left}.tablesorter-default th,.tablesorter-default thead td{font-weight:700;color:#000;background-color:#fff;border-collapse:collapse;border-bottom:#ccc 2px solid;padding:0}.tablesorter-default tfoot td,.tablesorter-default tfoot th{border:0}.tablesorter-default .header,.tablesorter-default .tablesorter-header{background-image:url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);background-position:center right;background-repeat:no-repeat;cursor:pointer;white-space:normal;padding:4px 20px 4px 4px}.tablesorter-default thead .headerSortUp,.tablesorter-default thead .tablesorter-headerAsc,.tablesorter-default thead .tablesorter-headerSortUp{background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);border-bottom:#000 2px solid}.tablesorter-default thead .headerSortDown,.tablesorter-default thead .tablesorter-headerDesc,.tablesorter-default thead .tablesorter-headerSortDown{background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);border-bottom:#000 2px solid}.tablesorter-default thead .sorter-false{background-image:none;cursor:default;padding:4px}.tablesorter-default tfoot .tablesorter-headerAsc,.tablesorter-default tfoot .tablesorter-headerDesc,.tablesorter-default tfoot .tablesorter-headerSortDown,.tablesorter-default tfoot .tablesorter-headerSortUp{border-top:#000 2px solid}.tablesorter-default td{background-color:#fff;border-bottom:#ccc 1px solid;padding:4px;vertical-align:top}.tablesorter-default tbody>tr.even:hover>td,.tablesorter-default tbody>tr.hover>td,.tablesorter-default tbody>tr.odd:hover>td,.tablesorter-default tbody>tr:hover>td{background-color:#fff;color:#000}.tablesorter-default .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-default tr.odd>td{background-color:#dfdfdf}.tablesorter-default tr.even>td{background-color:#efefef}.tablesorter-default tr.odd td.primary{background-color:#bfbfbf}.tablesorter-default td.primary,.tablesorter-default tr.even td.primary{background-color:#d9d9d9}.tablesorter-default tr.odd td.secondary{background-color:#d9d9d9}.tablesorter-default td.secondary,.tablesorter-default tr.even td.secondary{background-color:#e6e6e6}.tablesorter-default tr.odd td.tertiary{background-color:#e6e6e6}.tablesorter-default td.tertiary,.tablesorter-default tr.even td.tertiary{background-color:#f2f2f2}.tablesorter-default>caption{background-color:#fff}.tablesorter-default .tablesorter-filter-row{background-color:#eee}.tablesorter-default .tablesorter-filter-row td{background-color:#eee;border-bottom:#ccc 1px solid;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-default .tablesorter-filter-row .disabled{opacity:.5;cursor:not-allowed}.tablesorter-default .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-default .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0}.tablesorter-default input.tablesorter-filter,.tablesorter-default select.tablesorter-filter{width:95%;height:auto;margin:4px auto;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99}
includes/class-commands.php CHANGED
@@ -111,6 +111,12 @@ class WP_Optimize_Commands {
111
  return $translations;
112
  }
113
 
 
 
 
 
 
 
114
  public function save_settings($data) {
115
 
116
  parse_str(stripslashes($data), $posted_settings);
@@ -123,6 +129,20 @@ class WP_Optimize_Commands {
123
  );
124
  }
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  /**
127
  * This sends the selected tick value over to the save function
128
  * within class-wp-optimize-options.php
@@ -188,6 +208,49 @@ class WP_Optimize_Commands {
188
  return $results;
189
  }
190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  /**
192
  * Get information about requested optimization.
193
  *
@@ -239,6 +302,7 @@ class WP_Optimize_Commands {
239
  */
240
  public function optimizations_done() {
241
 
 
242
  // Run action after all optimizations completed.
243
  do_action('wp_optimize_after_optimizations');
244
 
111
  return $translations;
112
  }
113
 
114
+ /**
115
+ * Save settings command.
116
+ *
117
+ * @param string $data
118
+ * @return array
119
+ */
120
  public function save_settings($data) {
121
 
122
  parse_str(stripslashes($data), $posted_settings);
129
  );
130
  }
131
 
132
+ /**
133
+ * Save lazy load settings.
134
+ *
135
+ * @param string $data
136
+ * @return array
137
+ */
138
+ public function save_lazy_load_settings($data) {
139
+ parse_str(stripslashes($data), $posted_settings);
140
+
141
+ return array(
142
+ 'save_result' => $this->options->save_lazy_load_settings($posted_settings)
143
+ );
144
+ }
145
+
146
  /**
147
  * This sends the selected tick value over to the save function
148
  * within class-wp-optimize-options.php
208
  return $results;
209
  }
210
 
211
+ /**
212
+ * Preview command, used to show information about data should be optimized in popup tool.
213
+ *
214
+ * @param array $params Should have keys 'optimization_id', 'offset' and 'limit'.
215
+ *
216
+ * @return array
217
+ */
218
+ public function preview($params) {
219
+ if (!isset($params['optimization_id'])) {
220
+ $results = array(
221
+ 'result' => false,
222
+ 'messages' => array(),
223
+ 'errors' => array(
224
+ __('No optimization was indicated.', 'wp-optimize')
225
+ )
226
+ );
227
+ } else {
228
+ $optimization_id = $params['optimization_id'];
229
+ $data = isset($params['data']) ? $params['data'] : array();
230
+ $params['offset'] = isset($params['offset']) ? (int) $params['offset'] : 0;
231
+ $params['limit'] = isset($params['limit']) ? (int) $params['limit'] : 50;
232
+
233
+ $optimization = $this->optimizer->get_optimization($optimization_id, $data);
234
+
235
+ if (is_a($optimization, 'WP_Optimization')) {
236
+ if (isset($params['site_id'])) {
237
+ $optimization->switch_to_blog((int) $params['site_id']);
238
+ }
239
+ $result = $optimization->preview($params);
240
+ } else {
241
+ $result = null;
242
+ }
243
+
244
+ $results = array(
245
+ 'result' => $result,
246
+ 'messages' => array(),
247
+ 'errors' => array()
248
+ );
249
+ }
250
+
251
+ return $results;
252
+ }
253
+
254
  /**
255
  * Get information about requested optimization.
256
  *
302
  */
303
  public function optimizations_done() {
304
 
305
+ $this->options->update_option('total-cleaned', 0);
306
  // Run action after all optimizations completed.
307
  do_action('wp_optimize_after_optimizations');
308
 
includes/class-updraft-file-logger.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) die('No direct access allowed');
4
+
5
+ if (class_exists('Updraft_File_Logger')) return;
6
+
7
+ /**
8
+ * Class Updraft_PHP_Logger
9
+ */
10
+ class Updraft_File_Logger extends Updraft_Abstract_Logger {
11
+
12
+ /**
13
+ * Path to the log file
14
+ *
15
+ * @var String
16
+ */
17
+ private $logfile;
18
+
19
+ /**
20
+ * Updraft_PHP_Logger constructor
21
+ */
22
+ public function __construct($logfile) {
23
+ $this->logfile = $logfile;
24
+ }
25
+
26
+ /**
27
+ * Returns logger description
28
+ *
29
+ * @return string|void
30
+ */
31
+ public function get_description() {
32
+ return __('Log events into a log file', 'wp-optimize');
33
+ }
34
+
35
+ /**
36
+ * Emergency message
37
+ *
38
+ * @param string $message
39
+ * @param array $context
40
+ * @return null|void
41
+ */
42
+ public function emergency($message, array $context = array()) {
43
+ $this->log(Updraft_Log_Levels::EMERGENCY, $message, $context);
44
+ }
45
+
46
+ /**
47
+ * Alert message
48
+ *
49
+ * @param string $message
50
+ * @param array $context
51
+ * @return null|void
52
+ */
53
+ public function alert($message, array $context = array()) {
54
+ $this->log(Updraft_Log_Levels::ALERT, $message, $context);
55
+ }
56
+
57
+ /**
58
+ * Critical message
59
+ *
60
+ * @param string $message
61
+ * @param array $context
62
+ * @return null|void
63
+ */
64
+ public function critical($message, array $context = array()) {
65
+ $this->log(Updraft_Log_Levels::CRITICAL, $message, $context);
66
+ }
67
+
68
+ /**
69
+ * Error message
70
+ *
71
+ * @param string $message
72
+ * @param array $context
73
+ * @return null|void
74
+ */
75
+ public function error($message, array $context = array()) {
76
+ $this->log(Updraft_Log_Levels::ERROR, $message, $context);
77
+ }
78
+
79
+ /**
80
+ * Warning message
81
+ *
82
+ * @param string $message
83
+ * @param array $context
84
+ * @return null|void
85
+ */
86
+ public function warning($message, array $context = array()) {
87
+ $this->log(Updraft_Log_Levels::WARNING, $message, $context);
88
+ }
89
+
90
+ /**
91
+ * Notice message
92
+ *
93
+ * @param string $message
94
+ * @param array $context
95
+ * @return null|void
96
+ */
97
+ public function notice($message, array $context = array()) {
98
+ $this->log(Updraft_Log_Levels::NOTICE, $message, $context);
99
+ }
100
+
101
+ /**
102
+ * Info message
103
+ *
104
+ * @param string $message
105
+ * @param array $context
106
+ * @return null|void
107
+ */
108
+ public function info($message, array $context = array()) {
109
+ $this->log(Updraft_Log_Levels::INFO, $message, $context);
110
+ }
111
+
112
+ /**
113
+ * Debug message
114
+ *
115
+ * @param string $message
116
+ * @param array $context
117
+ * @return null|void
118
+ */
119
+ public function debug($message, array $context = array()) {
120
+ $this->log(Updraft_Log_Levels::DEBUG, $message, $context);
121
+ }
122
+
123
+ /**
124
+ * Log message with any level
125
+ *
126
+ * @param string $message
127
+ * @param mixed $level
128
+ * @param array $context
129
+ * @return null|void
130
+ */
131
+ public function log($message, $level = 'info', array $context = array()) {
132
+
133
+ if (!$this->is_enabled()) return false;
134
+
135
+ $message = sprintf("[%s : %s] - %s \n", date("Y-m-d H:i:s"), Updraft_Log_Levels::to_text($level), $this->interpolate($message, $context));
136
+
137
+ // @codingStandardsIgnoreLine
138
+ if (false == file_put_contents($this->logfile, $message, FILE_APPEND)) {
139
+ error_log($message);
140
+ }
141
+ }
142
+
143
+ /**
144
+ * Delete logs older than specified date
145
+ *
146
+ * @param string $how_old
147
+ * @return boolean Success or failure
148
+ */
149
+ public function prune_logs($how_old = "5 days ago") {
150
+
151
+ if (strtotime($how_old)) {
152
+ $how_old = "5 days ago";
153
+ }
154
+
155
+ // @codingStandardsIgnoreStart
156
+
157
+ // We ignore a few lines here to avoid warnings on file operations
158
+ // WP.VIP does not like us writing directly to the filesystem
159
+ $logfile_handle = fopen($this->logfile, "r");
160
+ $temp_file = fopen(preg_replace("/\.log$/", "-temp.log", $this->logfile), "a");
161
+
162
+ // Stream is the preferred way because of potentially large file sizes
163
+ while ($line = stream_get_line($logfile_handle, 1024 * 1024, "\n")) {
164
+ $entry_time = strtotime(strstr($line, " : ", true));
165
+
166
+ if ($entry_time > $how_old) {
167
+ fwrite($temp_file, $line."\n");
168
+ }
169
+ }
170
+
171
+ fclose($logfile_handle);
172
+ fclose($temp_file);
173
+
174
+ return rename(preg_replace("/\.log$/", "-temp.log", $this->logfile), $this->logfile);
175
+ // @codingStandardsIgnoreEnd
176
+ }
177
+ }
includes/class-updraft-nitrosmush-task.php ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * A sample implementation using the NitroSmush API and our tasks library
4
+ */
5
+
6
+ if (!defined('ABSPATH')) die('Access denied.');
7
+
8
+ if (!class_exists('Updraft_Smush_Task')) require_once('class-updraft-smush-task.php');
9
+
10
+ if (!class_exists('Nitro_Smush_Task')) :
11
+
12
+ class Nitro_Smush_Task extends Updraft_Smush_Task {
13
+
14
+ public $label = 'nitrosmush';
15
+
16
+ const MAX_FILESIZE = 104857600;
17
+
18
+ const API_URL = 'http://nitrosmush.com/api.php';
19
+
20
+ /**
21
+ * Checks if the server is online, must be called from the task manager only
22
+ *
23
+ * @return bool - true if yes, false otherwise
24
+ */
25
+ public static function is_server_online() {
26
+
27
+ global $task_manager;
28
+ $test_image = WPO_PLUGIN_MAIN_PATH . 'images/icon/wpo.png';
29
+ $boundary = wp_generate_password(12);
30
+ $headers = array( "content-type" => "multipart/form-data; boundary=$boundary" );
31
+ $payload = "";
32
+
33
+ $payload .= "--" . $boundary . "\n";
34
+ $payload .= "Content-Disposition: form-data; name=\"quality\"\n\n";
35
+ $payload .= "99"."\n";
36
+ $payload .= "--" . $boundary . "\n";
37
+ $payload .= "Content-Disposition: form-data; name=\"image\"; filename=\"" . basename($test_image) . "\"\n";
38
+ $payload .= "Content-Type: " . "image/png" . "\n";
39
+ $payload .= "Content-Transfer-Encoding: binary\n\n";
40
+ $payload .= file_get_contents($test_image)."\n";
41
+ $payload .= "--" . $boundary . "\n";
42
+
43
+
44
+ $request = array(
45
+ 'headers' => $headers,
46
+ 'timeout' => 30,
47
+ 'body' => $payload,
48
+ );
49
+
50
+ $response = wp_remote_post(self::API_URL, $request);
51
+
52
+ if (is_wp_error($response)) {
53
+ $task_manager->log($response->get_error_message());
54
+ return false;
55
+ }
56
+
57
+ $data = json_decode(wp_remote_retrieve_body($response));
58
+
59
+ if (empty($data)) {
60
+ $task_manager->log("Empty data returned by server");
61
+ return false;
62
+ }
63
+
64
+ if (isset($data->error)) {
65
+ $task_manager->log($data->error);
66
+ return false;
67
+ }
68
+
69
+ return true;
70
+ }
71
+
72
+ /**
73
+ * Prepares the image as part of the post data for the specific implementation
74
+ *
75
+ * @param String $local_file - The image to e optimised
76
+ */
77
+ public function prepare_post_request($local_file) {
78
+
79
+ $boundary = wp_generate_password(12);
80
+ $lossy = $this->get_option('lossy_compression');
81
+
82
+ if ($lossy) {
83
+ if ('best' == $this->get_option('image_quality')) {
84
+ $quality = 99;
85
+ } elseif ('very_good' == $this->get_option('image_quality')) {
86
+ $quality = 96;
87
+ } else {
88
+ $quality = 94;
89
+ }
90
+ } else {
91
+ $quality = 100;
92
+ }
93
+
94
+ $headers = array( "content-type" => "multipart/form-data; boundary=$boundary" );
95
+ $payload = "";
96
+
97
+ $payload .= "--" . $boundary . "\n";
98
+ $payload .= "Content-Disposition: form-data; name=\"quality\"\n\n";
99
+ $payload .= $quality."\n";
100
+ $payload .= "--" . $boundary . "\n";
101
+ $payload .= "Content-Disposition: form-data; name=\"image\"; filename=\"" . basename($local_file) . "\"\n";
102
+ $payload .= "Content-Type: " . "image/png" . "\n";
103
+ $payload .= "Content-Transfer-Encoding: binary\n\n";
104
+ $payload .= file_get_contents($local_file)."\n";
105
+ $payload .= "--" . $boundary . "\n";
106
+
107
+ return array(
108
+ 'headers' => $headers,
109
+ 'timeout' => $this->get_option('request_timeout'),
110
+ 'body' => $payload,
111
+ );
112
+ }
113
+
114
+ /**
115
+ * Processes the response recieved from the remote server
116
+ *
117
+ * @param String $response - The response object
118
+ */
119
+ public function process_server_response($response) {
120
+
121
+ $response = parent::process_server_response($response);
122
+ $data = json_decode(wp_remote_retrieve_body($response));
123
+
124
+ if (!$data) {
125
+ $this->log("Cannot establish connection with NitroSmush webservice. Please try later");
126
+ return false;
127
+ }
128
+
129
+ if (isset($data->error)) {
130
+ $this->fail($data->error_short, $data->error);
131
+ return false;
132
+ }
133
+
134
+ $compressed_image = file_get_contents($data->result_file);
135
+
136
+ if ($compressed_image) {
137
+ return $compressed_image;
138
+ } else {
139
+ $this->fail("invalid_repsonse", "The Smush process failed with an invalid response from the server");
140
+ return false;
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Retrieve features for this service
146
+ *
147
+ * @return Array - an array of options
148
+ */
149
+ public static function get_features() {
150
+ return array(
151
+ 'max_filesize' => self::MAX_FILESIZE,
152
+ 'lossy_compression' => true,
153
+ 'preserve_exif' => false,
154
+ );
155
+ }
156
+
157
+ /**
158
+ * Retrieve default options for this task type.
159
+ *
160
+ * @return Array - an array of options
161
+ */
162
+ public function get_default_options() {
163
+ return array(
164
+ 'allowed_file_types' => array('gif', 'png', 'jpg', 'tif', 'jpeg'),
165
+ 'request_timeout' => 30,
166
+ 'keep_original' => true,
167
+ 'preserve_exif' => false,
168
+ 'image_quality' => 100,
169
+ 'api_endpoint' => self::API_URL,
170
+ 'max_filesize' => self::MAX_FILESIZE,
171
+ 'backup_prefix' => '-updraft-pre-smush-original.'
172
+ );
173
+ }
174
+ }
175
+ endif;
includes/class-updraft-resmushit-task.php ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * A sample implementation using the Resmush.it API and our tasks library
4
+ */
5
+
6
+ if (!defined('ABSPATH')) die('Access denied.');
7
+
8
+ if (!class_exists('Updraft_Smush_Task')) require_once('class-updraft-smush-task.php');
9
+
10
+ if (!class_exists('Re_Smush_It_Task')) :
11
+
12
+ class Re_Smush_It_Task extends Updraft_Smush_Task {
13
+
14
+ public $label = 're-smush-it';
15
+
16
+ const MAX_FILESIZE = 5242880;
17
+
18
+ const API_URL = 'http://api.resmush.it/';
19
+
20
+ /**
21
+ * Checks if the server is online
22
+ *
23
+ * @return boolean - true if yes, false otherwise
24
+ */
25
+ public static function is_server_online() {
26
+
27
+ global $task_manager;
28
+ $test_image = WPO_PLUGIN_MAIN_PATH . 'images/icon/wpo.png';
29
+ $boundary = wp_generate_password(12);
30
+ $file_name = basename($test_image);
31
+
32
+ $body = "--$boundary";
33
+ $body .= "\r\n";
34
+ $body .= "Content-Disposition: form-data; name=\"files\"; filename=\"$file_name\"\r\n";
35
+ $body .= "\r\n";
36
+ $body .= file_get_contents($test_image);
37
+ $body .= "\r\n";
38
+ $body .= "--$boundary";
39
+
40
+ $request = array(
41
+ 'headers' => array( "content-type" => "multipart/form-data; boundary=$boundary" ),
42
+ 'user-agent' => "WordPress $wp_version/Resmush.it",
43
+ 'timeout' => 10,
44
+ 'body' => $body,
45
+ );
46
+
47
+ $response = wp_remote_post(self::API_URL, $request);
48
+
49
+ if (is_wp_error($response)) {
50
+ $task_manager->log($response->get_error_message());
51
+ return false;
52
+ }
53
+
54
+ $data = json_decode(wp_remote_retrieve_body($response));
55
+
56
+
57
+ if (empty($data)) {
58
+ $task_manager->log("Empty data returned by server");
59
+ return false;
60
+ }
61
+
62
+ if (isset($data->error)) {
63
+ $task_manager->log($data->error_long);
64
+ return false;
65
+ }
66
+
67
+ return true;
68
+ }
69
+
70
+ /**
71
+ * Prepares the image as part of the post data for the specific implementation
72
+ *
73
+ * @param String $local_file - The image to e optimised
74
+ */
75
+ public function prepare_post_request($local_file) {
76
+ global $wp_version;
77
+
78
+ $boundary = wp_generate_password(12);
79
+ $headers = array( "content-type" => "multipart/form-data; boundary=$boundary" );
80
+
81
+ if ('best' == $this->get_option('image_quality')) {
82
+ $quality = 98;
83
+ } elseif ('very_good' == $this->get_option('image_quality')) {
84
+ $quality = 95;
85
+ } else {
86
+ $quality = 92;
87
+ }
88
+
89
+ $post_fields = array(
90
+ 'qlty' => $quality,
91
+ 'exif' => $this->get_option('preserve_exif', false)
92
+ );
93
+ $payload = '';
94
+ $file_name = basename($local_file);
95
+
96
+ foreach ($post_fields as $name => $value) {
97
+ $payload .= "--$boundary";
98
+ $payload .= "\r\n";
99
+ $payload .= "Content-Disposition: form-data; name='$name' \r\n\r\n $value";
100
+ $payload .= "\r\n";
101
+ }
102
+
103
+ $payload .= "--$boundary";
104
+ $payload .= "\r\n";
105
+ $payload .= "Content-Disposition: form-data; name=\"files\"; filename=\"$file_name\"\r\n";
106
+ $payload .= "\r\n";
107
+ $payload .= file_get_contents($local_file);
108
+ $payload .= "\r\n";
109
+ $payload .= "--$boundary";
110
+
111
+ return array(
112
+ 'headers' => $headers,
113
+ 'timeout' => $this->get_option('request_timeout'),
114
+ 'user-agent' => "Wordpress $wp_version/Resmush.it ".$this->get_option('version'),
115
+ 'body' => $payload,
116
+ );
117
+ }
118
+
119
+ /**
120
+ * Processes the response recieved from the remote server
121
+ *
122
+ * @param String $response - The response object
123
+ */
124
+ public function process_server_response($response) {
125
+
126
+ $response = parent::process_server_response($response);
127
+ $data = json_decode(wp_remote_retrieve_body($response));
128
+
129
+ if (!$data) {
130
+ $this->log("Cannot establish connection with reSmush.it webservice. Please try later");
131
+ return false;
132
+ }
133
+
134
+ if (isset($data->error)) {
135
+ $this->fail($data->error, $data->error_long);
136
+ return false;
137
+ }
138
+
139
+ $compressed_image = file_get_contents($data->dest);
140
+
141
+ if ($compressed_image) {
142
+ return $compressed_image;
143
+ } else {
144
+ $this->fail("invalid_repsonse", "The Smush process failed with an invalid response from the server");
145
+ return false;
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Retrieve features for this service
151
+ *
152
+ * @return Array - an array of options
153
+ */
154
+ public static function get_features() {
155
+ return array(
156
+ 'max_filesize' => self::MAX_FILESIZE,
157
+ 'lossy_compression' => false,
158
+ 'preserve_exif' => true,
159
+ );
160
+ }
161
+
162
+ /**
163
+ * Retrieve default options for this task type.
164
+ *
165
+ * @return Array - an array of options
166
+ */
167
+ public function get_default_options() {
168
+ return array(
169
+ 'allowed_file_types' => array('gif', 'png', 'jpg', 'tif', 'jpeg'),
170
+ 'request_timeout' => 30,
171
+ 'keep_original' => true,
172
+ 'preserve_exif' => false,
173
+ 'image_quality' => 98,
174
+ 'api_endpoint' => self::API_URL,
175
+ 'max_filesize' => self::MAX_FILESIZE,
176
+ 'version' => '0.1.13',
177
+ 'backup_prefix' => '-updraft-pre-smush-original.'
178
+ );
179
+ }
180
+ }
181
+ endif;
includes/class-updraft-smush-manager-commands.php ADDED
@@ -0,0 +1,312 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * A Smush Task manager class
4
+ */
5
+
6
+ if (!defined('ABSPATH')) die('Access denied.');
7
+
8
+ if (!class_exists('Updraft_Task_Manager_Commands_1_0')) require_once(WPO_PLUGIN_MAIN_PATH . 'vendor/team-updraft/common-libs/src/updraft-tasks/class-updraft-task-manager-commands.php');
9
+
10
+ if (!class_exists('Updraft_Smush_Manager_Commands')) :
11
+
12
+ class Updraft_Smush_Manager_Commands extends Updraft_Task_Manager_Commands_1_0 {
13
+
14
+ /**
15
+ * The commands constructor
16
+ *
17
+ * @param mixed $task_manager - A task manager instance
18
+ */
19
+ public function __construct($task_manager) {
20
+ parent::__construct($task_manager);
21
+ }
22
+
23
+ /**
24
+ * Returns a list of commands available for smush related operations
25
+ */
26
+ public static function get_allowed_ajax_commands() {
27
+
28
+ $commands = apply_filters('updraft_task_manager_allowed_ajax_commands', array());
29
+
30
+ $smush_commands = array(
31
+ 'compress_single_image',
32
+ 'restore_single_image',
33
+ 'process_bulk_smush',
34
+ 'update_smush_options',
35
+ 'get_ui_update',
36
+ 'process_pending_images',
37
+ 'clear_pending_images',
38
+ 'clear_smush_stats',
39
+ 'check_server_status',
40
+ 'get_smush_logs',
41
+ );
42
+
43
+ return array_merge($commands, $smush_commands);
44
+ }
45
+
46
+ /**
47
+ * Process the compression of a single image
48
+ *
49
+ * @param mixed $data - sent in via AJAX
50
+ * @return WP_Error|array - information about the operation or WP_Error object on failure
51
+ */
52
+ public function compress_single_image($data) {
53
+
54
+ $options = isset($data['smush_options']) ? $data['smush_options'] : false;
55
+ $image = isset($data['selected_image']) ? $data['selected_image'] : false;
56
+ $server = filter_var($options['compression_server'], FILTER_SANITIZE_STRING);
57
+
58
+ $lossy = filter_var($options['lossy_compression'], FILTER_VALIDATE_BOOLEAN) ? true : false;
59
+ $backup = filter_var($options['back_up_original'], FILTER_VALIDATE_BOOLEAN) ? true : false;
60
+ $exif = filter_var($options['preserve_exif'], FILTER_VALIDATE_BOOLEAN) ? true : false;
61
+ $quality = filter_var($options['image_quality'], FILTER_SANITIZE_STRING);
62
+
63
+ $options = array(
64
+ 'attachment_id' => $image,
65
+ 'image_quality' => $quality,
66
+ 'keep_original' => $backup,
67
+ 'lossy_compression' => $lossy,
68
+ );
69
+
70
+ if (filesize(get_attached_file($image)) > 5242880) {
71
+ $options['request_timeout'] = 180;
72
+ }
73
+
74
+ $success = $this->task_manager->compress_single_image($image, $options, $server);
75
+
76
+ if (!$success) {
77
+ return new WP_Error('compress_failed', get_post_meta($image, 'smush-info', true));
78
+ }
79
+
80
+ $response['status'] = true;
81
+ $response['operation'] = 'compress';
82
+ $response['options'] = $options;
83
+ $response['server'] = $server;
84
+ $response['success'] = $success;
85
+ $response['restore_possible'] = $backup;
86
+ $response['summary'] = get_post_meta($image, 'smush-info', true);
87
+
88
+ return $response;
89
+ }
90
+
91
+ /**
92
+ * Restores a single image, if backup is available
93
+ *
94
+ * @param mixed $data - Sent in via AJAX
95
+ * @return WP_Error|array - information about the operation or a WP_Error object on failure
96
+ */
97
+ public function restore_single_image($data) {
98
+
99
+ $image = isset($data['selected_image']) ? $data['selected_image'] : false;
100
+
101
+ $success = $this->task_manager->restore_single_image($image);
102
+
103
+ if (is_wp_error($success)) {
104
+ return $success;
105
+ }
106
+
107
+ $response['status'] = true;
108
+ $response['operation'] = 'restore';
109
+ $response['image'] = $image;
110
+ $response['success'] = $success;
111
+ $response['summary'] = __('Image restored successfully', 'wp-optimize');
112
+
113
+ return $response;
114
+ }
115
+
116
+ /**
117
+ * Process the compression of multiple images
118
+ *
119
+ * @param mixed $data - Sent in via AJAX
120
+ */
121
+ public function process_bulk_smush($data = array()) {
122
+ $images = isset($data['selected_images']) ? $data['selected_images'] : array();
123
+ $this->get_ui_update();
124
+ $this->task_manager->process_bulk_smush($images);
125
+ }
126
+
127
+ /**
128
+ * Returns useful information for the UI and closes the connection
129
+ *
130
+ * @return mixed $data - Information for the UI
131
+ */
132
+ public function get_ui_update() {
133
+
134
+ $ui_update['status'] = true;
135
+ $ui_update['pending_tasks'] = count($this->task_manager->get_pending_tasks());
136
+ $ui_update['unsmushed_images'] = $this->task_manager->get_uncompressed_images();
137
+ $ui_update['completed_task_count'] = $this->task_manager->options->get_option('completed_task_count', 0);
138
+ $ui_update['bytes_saved'] = $this->format_filesize($this->task_manager->options->get_option('total_bytes_saved', 0));
139
+ $ui_update['percent_saved'] = number_format($this->task_manager->options->get_option('total_percent_saved', 1), 2).'%';
140
+ $ui_update['failed_task_count'] = $this->task_manager->get_failed_task_count();
141
+
142
+ $ui_update['summary'] = sprintf(__("A total of %d image(s) were compressed on this site, saving appoximately %s of space at an average of %02d percent per image.", 'wp-optimize'), $ui_update['completed_task_count'], $ui_update['bytes_saved'], number_format($ui_update['percent_saved'], 2));
143
+ $ui_update['failed'] = sprintf(__("%d image(s) could not be compressed. Please see the logs for more information or try again later.", 'wp-optimize'), $ui_update['failed_task_count']);
144
+ $ui_update['pending'] = sprintf(__("%d image(s) images were selected for compressing previously, but were not all processed. You can either complete them now or cancel and retry later.", 'wp-optimize'), $ui_update['pending_tasks']);
145
+ $ui_update['smush_complete'] = $this->task_manager->is_queue_processed();
146
+
147
+ $this->close_browser_connection(json_encode($ui_update));
148
+ }
149
+
150
+ /**
151
+ * Updates smush related options
152
+ *
153
+ * @param mixed $data - Sent in via AJAX
154
+ * @return WP_Error|array - information about the operation or WP_Error object on failure
155
+ */
156
+ public function update_smush_options($data) {
157
+
158
+ $options['compression_server'] = filter_var($data['compression_server'], FILTER_SANITIZE_STRING);
159
+ $options['lossy_compression'] = filter_var($data['lossy_compression'], FILTER_VALIDATE_BOOLEAN) ? true : false;
160
+ $options['back_up_original'] = filter_var($data['back_up_original'], FILTER_VALIDATE_BOOLEAN) ? true : false;
161
+ $options['preserve_exif'] = filter_var($data['preserve_exif'], FILTER_VALIDATE_BOOLEAN) ? true : false;
162
+ $options['autosmush'] = filter_var($data['autosmush'], FILTER_VALIDATE_BOOLEAN) ? true : false;
163
+ $options['image_quality'] = filter_var($data['image_quality'], FILTER_SANITIZE_STRING);
164
+
165
+ $success = $this->task_manager->update_smush_options($options);
166
+
167
+ if (!$success) {
168
+ return new WP_Error('update_failed', __('Options could not be updated', 'wp-optimize'));
169
+ }
170
+
171
+ $response['status'] = true;
172
+ $response['summary'] = __('Options updated successfully', 'wp-optimize');
173
+
174
+ return $response;
175
+ }
176
+
177
+ /**
178
+ * Clears any smush related stats
179
+ *
180
+ * @return WP_Error|array - information about the operation or WP_Error object on failure
181
+ */
182
+ public function clear_smush_stats() {
183
+
184
+ $success = $this->task_manager->clear_smush_stats();
185
+
186
+ if (!$success) {
187
+ return new WP_Error('update_failed', __('Stats could not be cleared', 'wp-optimize'));
188
+ }
189
+
190
+ $response['status'] = true;
191
+ $response['summary'] = __('Stats cleared successfully', 'wp-optimize');
192
+
193
+ return $response;
194
+ }
195
+
196
+ /**
197
+ * Checks if the selected server is online
198
+ *
199
+ * @param mixed $data - Sent in via AJAX
200
+ */
201
+ public function check_server_status($data) {
202
+ $server = filter_var($data['server'], FILTER_SANITIZE_STRING);
203
+ $response['status'] = true;
204
+ $response['online'] = $this->task_manager->check_server_online($server);
205
+ return $response;
206
+ }
207
+
208
+ /**
209
+ * Completes any pending tasks
210
+ */
211
+ public function process_pending_images() {
212
+ $this->process_bulk_smush();
213
+ }
214
+
215
+ /**
216
+ * Deletes and removes any pending tasks from queue
217
+ *
218
+ * @return WP_Error|array - information about the operation or WP_Error object on failure
219
+ */
220
+ public function clear_pending_images() {
221
+
222
+ $success = $this->task_manager->clear_pending_images();
223
+
224
+ if (!$success) {
225
+ return new WP_Error('error_deleting_tasks', __('Pending tasks could not be cleared', 'wp-optimize'));
226
+ }
227
+
228
+ $response['status'] = true;
229
+ $response['summary'] = __('Pending tasks cleared successfully', 'wp-optimize');
230
+
231
+ return $response;
232
+ }
233
+
234
+ /**
235
+ * Returns the log file
236
+ *
237
+ * @return WP_Error|file - logfile or WP_Error object on failure
238
+ */
239
+ public function get_smush_logs() {
240
+
241
+ $logfile = $this->task_manager->get_logfile_path();
242
+
243
+ if (file_exists($logfile)) {
244
+ header('Content-Description: File Transfer');
245
+ header('Content-Type: application/octet-stream');
246
+ header('Content-Disposition: attachment; filename="'.basename($logfile).'"');
247
+ header('Expires: 0');
248
+ header('Cache-Control: must-revalidate');
249
+ header('Pragma: public');
250
+ header('Content-Length: ' . filesize($logfile));
251
+ //@codingStandardsIgnoreLine
252
+ readfile($logfile);
253
+ exit;
254
+ } else {
255
+ return new WP_Error('log_file_error', __('Log file does not exist or cant be read', 'wp-optimize'));
256
+ }
257
+
258
+ return $response;
259
+ }
260
+
261
+ /**
262
+ * Helper function to format bytes to a human readable value
263
+ *
264
+ * @param int $bytes - the filesize in bytes
265
+ * @return string - the filesize
266
+ */
267
+ public function format_filesize($bytes) {
268
+
269
+ if (1073741824 <= $bytes) {
270
+ $bytes = number_format($bytes / 1073741824, 2) . ' GB';
271
+ } elseif (1048576 <= $bytes) {
272
+ $bytes = number_format($bytes / 1048576, 2) . ' MB';
273
+ } elseif (1024 <= $bytes) {
274
+ $bytes = number_format($bytes / 1024, 2) . ' KB';
275
+ } elseif (1 < $bytes) {
276
+ $bytes = $bytes . ' bytes';
277
+ } elseif (1 == $bytes) {
278
+ $bytes = $bytes . ' byte';
279
+ } else {
280
+ $bytes = '0 bytes';
281
+ }
282
+
283
+ return $bytes;
284
+ }
285
+
286
+ /**
287
+ * Close browser connection so that it can resume AJAX polling
288
+ *
289
+ * @param array $txt Response to browser
290
+ * @return void
291
+ */
292
+ public function close_browser_connection($txt = '') {
293
+ header('Content-Length: '.((!empty($txt)) ? 4+strlen($txt) : '0'));
294
+ header('Connection: close');
295
+ header('Content-Encoding: none');
296
+ if (session_id()) session_write_close();
297
+ echo "\r\n\r\n";
298
+ echo $txt;
299
+
300
+ $levels = ob_get_level();
301
+
302
+ for ($i = 0; $i < $levels; $i++) {
303
+ ob_end_flush();
304
+ }
305
+
306
+ flush();
307
+
308
+ if (function_exists('fastcgi_finish_request')) fastcgi_finish_request();
309
+ }
310
+ }
311
+
312
+ endif;
includes/class-updraft-smush-manager.php ADDED
@@ -0,0 +1,928 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Extends the generic task manager to manage smush related queues
4
+ */
5
+
6
+ if (!defined('ABSPATH')) die('Access denied.');
7
+
8
+ if (!class_exists('Updraft_Task_Manager_1_0')) require_once(WPO_PLUGIN_MAIN_PATH . 'vendor/team-updraft/common-libs/src/updraft-tasks/class-updraft-task-manager.php');
9
+
10
+ if (!class_exists('Updraft_Smush_Manager')) :
11
+
12
+ class Updraft_Smush_Manager extends Updraft_Task_Manager_1_0 {
13
+
14
+ /**
15
+ * Options used for smush jobs
16
+ *
17
+ * @var array
18
+ */
19
+ public $options;
20
+
21
+ /**
22
+ * The service provider to use
23
+ *
24
+ * @var string
25
+ */
26
+ public $webservice;
27
+
28
+ /**
29
+ * The logger for this instance
30
+ *
31
+ * @var mixed
32
+ */
33
+ public $logger;
34
+
35
+ /**
36
+ * The Task Manager constructor
37
+ */
38
+ public function __construct() {
39
+ parent::__construct();
40
+
41
+ if (!class_exists('Updraft_Smush_Manager_Commands')) include_once('class-updraft-smush-manager-commands.php');
42
+ if (!class_exists('Smush_Task')) include_once('class-updraft-smush-task.php');
43
+ if (!class_exists('Re_Smush_It_Task')) include_once('class-updraft-resmushit-task.php');
44
+ if (!class_exists('Nitro_Smush_Task')) include_once('class-updraft-nitrosmush-task.php');
45
+ if (!class_exists('Updraft_Logger_Interface')) include_once('class-updraft-logger-interface.php');
46
+ if (!class_exists('Updraft_Abstract_Logger')) include_once('class-updraft-abstract-logger.php');
47
+ if (!class_exists('Updraft_File_Logger')) include_once('class-updraft-file-logger.php');
48
+
49
+ $this->commands = new Updraft_Smush_Manager_Commands($this);
50
+ $this->options = WP_Optimize()->get_options();
51
+ $this->webservice = $this->options->get_option('compression_server', 'nitrosmush');
52
+
53
+ // Ensure the saved service is valid
54
+ if (!in_array($this->webservice, $this->get_allowed_services())) {
55
+ $this->webservice = $this->get_default_webservice();
56
+ }
57
+ $this->logger = new Updraft_File_Logger($this->get_logfile_path());
58
+ $this->add_logger($this->logger);
59
+
60
+ add_action('wp_ajax_updraft_smush_ajax', array($this, 'updraft_smush_ajax'));
61
+ add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
62
+ add_action('add_attachment', array($this, 'autosmush_create_task'));
63
+ add_action('ud_task_initialised', array($this, 'set_task_logger'));
64
+ add_action('ud_task_started', array($this, 'set_task_logger'));
65
+ add_action('ud_task_completed', array($this, 'record_stats'));
66
+ add_action('ud_task_failed', array($this, 'record_stats'));
67
+ add_action('prune_smush_logs', array($this, 'prune_smush_logs'));
68
+ add_action('autosmush_process_queue', array($this, 'autosmush_process_queue'));
69
+ add_action('add_meta_boxes_attachment', array($this, 'add_smush_metabox'), 10, 2);
70
+ }
71
+
72
+
73
+ /**
74
+ * The Task Manager AJAX handler
75
+ */
76
+ public function updraft_smush_ajax() {
77
+
78
+ $nonce = empty($_REQUEST['nonce']) ? '' : $_REQUEST['nonce'];
79
+
80
+ if (!wp_verify_nonce($nonce, 'updraft-task-manager-ajax-nonce') || empty($_REQUEST['subaction']))
81
+ die('Security check failed');
82
+
83
+ $subaction = $_REQUEST['subaction'];
84
+
85
+ $allowed_commands = Updraft_Smush_Manager_Commands::get_allowed_ajax_commands();
86
+
87
+ if (in_array($subaction, $allowed_commands)) {
88
+
89
+ if (isset($_REQUEST['data']))
90
+ $data = $_REQUEST['data'];
91
+
92
+ $results = call_user_func(array($this->commands, $subaction), $data);
93
+
94
+ if (is_wp_error($results)) {
95
+ $results = array(
96
+ 'status' => true,
97
+ 'result' => false,
98
+ 'error_code' => $results->get_error_code(),
99
+ 'error_message' => $results->get_error_message(),
100
+ 'error_data' => $results->get_error_data(),
101
+ );
102
+ }
103
+
104
+ echo json_encode($results);
105
+ } else {
106
+ echo json_encode(array('error' => 'No such command found'));
107
+ }
108
+ die;
109
+ }
110
+
111
+ /**
112
+ * Creates a task to auto compress an image on upload
113
+ *
114
+ * @param int $post_id - id of the post
115
+ */
116
+ public function autosmush_create_task($post_id) {
117
+
118
+ $post = get_post($post_id);
119
+
120
+ if (!$this->options->get_option('autosmush', false))
121
+ return;
122
+
123
+ if (!'image' == substr($post->post_mime_type, 0, 5))
124
+ return;
125
+
126
+ if ($this->task_exists($post_id))
127
+ return;
128
+
129
+ $options = array(
130
+ 'attachment_id' => $post_id,
131
+ 'image_quality' => $this->options->get_option('image_quality', 85),
132
+ 'keep_original' => $this->options->get_option('back_up_original', true),
133
+ 'preserve_exif' => $this->options->get_option('preserve_exif', true),
134
+ 'lossy_compression' => $this->options->get_option('lossy_compression', false)
135
+ );
136
+
137
+ if (filesize(get_attached_file($image)) > 5242880) {
138
+ $options['request_timeout'] = 180;
139
+ }
140
+
141
+ $server = $this->options->get_option('compression_server', $this->webservice);
142
+ $task_name = $this->get_associated_task($server);
143
+
144
+ $description = "$task_name with attachment ID : ".$post_id.", autocreated on : ".date("F d, Y h:i:s", time());
145
+ $task = call_user_func(array($task_name, 'create_task'), 'smush', $description, $options);
146
+
147
+ $task->add_logger($this->logger);
148
+ $this->log($description);
149
+
150
+ if (!wp_next_scheduled('autosmush_process_queue')) {
151
+ wp_schedule_single_event(time() + 300, 'autosmush_process_queue');
152
+ }
153
+ }
154
+
155
+ /**
156
+ * Process the autosmush queue and sets up a cron job if needed
157
+ * for future processing
158
+ */
159
+ public function autosmush_process_queue() {
160
+
161
+ if (!wp_next_scheduled('autosmush_process_queue') && !$this->is_queue_processed()) {
162
+ wp_schedule_single_event(time() + 600, 'autosmush_process_queue');
163
+ }
164
+
165
+ $this->write_log_header();
166
+ $this->clear_cached_data();
167
+ $this->process_queue('smush');
168
+
169
+ if ($this->is_queue_processed()) {
170
+ $this->clean_up_old_tasks('smush');
171
+ }
172
+
173
+ }
174
+
175
+
176
+ /**
177
+ * Process the compression of a single image
178
+ *
179
+ * @param int $image - ID of image
180
+ * @param array $options - options to use
181
+ * @param string $server - the server to process with
182
+ *
183
+ * @return boolean - Status of the task
184
+ */
185
+ public function compress_single_image($image, $options, $server) {
186
+ $task_name = $this->get_associated_task($server);
187
+ $description = "$task_name - attachment ID : ". $image. ", started on : ". date("F d, Y h:i:s", time());
188
+
189
+ $task = call_user_func(array($task_name, 'create_task'), 'smush', $description, $options);
190
+ $task->add_logger($this->logger);
191
+ $this->clear_cached_data();
192
+
193
+ if (!wp_next_scheduled('prune_smush_logs')) {
194
+ wp_schedule_single_event(time() + 7200, 'prune_smush_logs');
195
+ }
196
+
197
+ return $this->process_task($task);
198
+ }
199
+
200
+ /**
201
+ * Restores a single image if a backup is available
202
+ *
203
+ * @param int $image_id - The id of the image
204
+ * @return bool - success or failure
205
+ */
206
+ public function restore_single_image($image_id) {
207
+
208
+ $image_path = get_attached_file($image_id);
209
+ $backup_path = get_post_meta($image_id, 'original-file', true);
210
+
211
+ if (!file_exists($backup_path)) {
212
+ return new WP_Error('restore_failed', __('Backup not found, it may have been deleted or already restored', 'wp-optimize'));
213
+ }
214
+
215
+ if (!is_writable($image_path)) {
216
+ return new WP_Error('restore_failed', __('The destination could not be written to, please check your folder permissions', 'wp-optimize'));
217
+ }
218
+
219
+ $this->log("Restoring the original image - {$image_path} from backup {$backup_path}");
220
+
221
+ if (!copy($backup_path, $image_path)) {
222
+ return new WP_Error('restore_failed', __('Could not copy file, check your PHP error logs for details', 'wp-optimize'));
223
+ }
224
+
225
+ unlink($backup_path, false, 'd');
226
+ $this->delete_from_cache('uncompressed_images');
227
+
228
+ // Clear associated smush data
229
+ delete_post_meta($image_id, 'smush-complete');
230
+ delete_post_meta($image_id, 'smush-stats');
231
+ delete_post_meta($image_id, 'original-file');
232
+ delete_post_meta($image_id, 'smush-info');
233
+
234
+ if (!wp_next_scheduled('prune_smush_logs')) {
235
+ wp_schedule_single_event(time() + 7200, 'prune_smush_logs');
236
+ }
237
+
238
+ return $status;
239
+ }
240
+
241
+ /**
242
+ * Process bulk smushing operation
243
+ *
244
+ * @param array $images - the array of images to process
245
+ * @return bool - true if processing complete
246
+ */
247
+ public function process_bulk_smush($images = array()) {
248
+
249
+ // Get a list of pending tasks so we can exclude those
250
+ $pending_tasks = $this->get_pending_tasks();
251
+ $queued_images = array();
252
+
253
+ $this->write_log_header();
254
+
255
+ if (!empty($pending_tasks)) {
256
+ foreach ($pending_tasks as $task) {
257
+ $queued_images[] = $task->get_option('attachment_id');
258
+ }
259
+ }
260
+
261
+ foreach ($images as $image) {
262
+ // Skip if already in the queue
263
+ if (in_array($image, $queued_images)) continue;
264
+
265
+ $options = array(
266
+ 'attachment_id' => $image,
267
+ 'image_quality' => $this->options->get_option('image_quality', 85),
268
+ 'keep_original' => $this->options->get_option('back_up_original', true),
269
+ 'preserve_exif' => $this->options->get_option('preserve_exif', true),
270
+ 'lossy_compression' => $this->options->get_option('lossy_compression', false)
271
+ );
272
+
273
+ if (filesize(get_attached_file($image)) > 5242880) {
274
+ $options['request_timeout'] = 180;
275
+ }
276
+
277
+ $server = $this->options->get_option('compression_server', $this->webservice);
278
+ $task_name = $this->get_associated_task($server);
279
+
280
+ $description = "$task_name - Attachment ID : ". $image. ", Started on : ". date("F d, Y h:i:s", time());
281
+ $task = call_user_func(array($task_name, 'create_task'), 'smush', $description, $options);
282
+ $task->add_logger($this->logger);
283
+ }
284
+
285
+ $this->clear_cached_data();
286
+ $this->process_queue('smush');
287
+
288
+ if ($this->is_queue_processed()) {
289
+ $this->clean_up_old_tasks('smush');
290
+ }
291
+
292
+ if (!wp_next_scheduled('prune_smush_logs')) {
293
+ wp_schedule_single_event(time() + 7200, 'prune_smush_logs');
294
+ }
295
+
296
+ return true;
297
+ }
298
+
299
+
300
+ /**
301
+ * Check if a specified server online
302
+ *
303
+ * @param string $server - the server to test
304
+ * @return bool - true if yes, false otherwise
305
+ */
306
+ public function check_server_online($server = 'nitrosmush') {
307
+ $task = $this->get_associated_task($server);
308
+ $last_checked = get_option($task, strtotime('- 1 hour'));
309
+
310
+ if (strtotime('- 1 hour') >= $last_checked) {
311
+ $online = call_user_func(array($task, 'is_server_online'));
312
+
313
+ if ($online) {
314
+ update_option($task, strtotime('now'));
315
+ }
316
+ } else {
317
+ $online = true;
318
+ }
319
+
320
+ $this->log(sprintf('%s server : %s', $task, $online ? 'Online' : 'Offline'));
321
+ return $online;
322
+ }
323
+
324
+ /**
325
+ * Checks if the queue for smushing is compleete
326
+ *
327
+ * @return bool - true if processed, false otherwise
328
+ */
329
+ public function is_queue_processed() {
330
+ if (0 !== count($this->get_active_tasks('smush')))
331
+ return false;
332
+
333
+ if (false !== get_option('updraft_semaphore_smush'))
334
+ return false;
335
+
336
+ return true;
337
+ }
338
+
339
+ /**
340
+ * Logs useful data once a smush task completes or if it fails
341
+ *
342
+ * @param mixed $task - A task object
343
+ */
344
+ public function record_stats($task) {
345
+
346
+ $attachment_id = $task->get_option('attachment_id');
347
+ $completed_task_count = $this->options->get_option('completed_task_count', false);
348
+ $failed_task_count = $this->options->get_option('failed_task_count', 0);
349
+ $total_bytes_saved = $this->options->get_option('total_bytes_saved', false);
350
+ $total_percent_saved = $this->options->get_option('total_percent_saved', 0);
351
+
352
+ if ('ud_task_failed' == current_action()) {
353
+ $this->options->update_option('failed_task_count', ++$failed_task_count);
354
+ return;
355
+ }
356
+
357
+ if (false === $completed_task_count || false === $bytes_saved) {
358
+ $completed_task_count = $total_bytes_saved = 0;
359
+ }
360
+
361
+ $stats = get_post_meta($attachment_id, 'smush-stats');
362
+
363
+ $original_size = $stats['original-size'];
364
+ $compressed_size = $stats['smushed-size'];
365
+ $percent = $stats['savings-percent'];
366
+ $saved = $original_size - $compressed_size;
367
+ $completed_task_count++;
368
+
369
+ $total_bytes_saved += $saved;
370
+ $total_percent_saved = (($total_percent_saved * ($completed_task_count - 1)) + $percent) / $completed_task_count;
371
+
372
+ $this->options->update_option('completed_task_count', $completed_task_count);
373
+ $this->options->update_option('total_bytes_saved', $total_bytes_saved);
374
+ $this->options->update_option('total_percent_saved', $total_percent_saved);
375
+ }
376
+
377
+ /**
378
+ * Cleans out all complete + failed tasks from the DB.
379
+ *
380
+ * @param String $type type of the task
381
+ * @return bool - true if processing complete
382
+ */
383
+ public function clean_up_old_tasks($type) {
384
+ $completed_tasks = $this->get_tasks('all', $type);
385
+
386
+ if (!$completed_tasks) return false;
387
+
388
+ $this->log(sprintf('Cleaning up tasks of type (%s). A total of %d tasks will be deleted.', $type, count($completed_tasks)));
389
+
390
+ foreach ($completed_tasks as $task) {
391
+ $task->delete_meta();
392
+ $task->delete();
393
+ }
394
+
395
+ return true;
396
+ }
397
+
398
+ /**
399
+ * Updates global smush options
400
+ *
401
+ * @param array $options - sent in via AJAX
402
+ * @return bool - status of the update
403
+ */
404
+ public function update_smush_options($options) {
405
+
406
+ foreach ($options as $option => $value) {
407
+ $this->options->update_option($option, $value);
408
+ }
409
+
410
+ return true;
411
+ }
412
+
413
+ /**
414
+ * Clears smush related stats
415
+ *
416
+ * @return bool - status of the update
417
+ */
418
+ public function clear_smush_stats() {
419
+ $this->options->update_option('failed_task_count', 0);
420
+ $this->options->update_option('completed_task_count', false);
421
+ $this->options->update_option('total_bytes_saved', false);
422
+ $this->options->update_option('total_percent_saved', 0);
423
+
424
+ return true;
425
+ }
426
+
427
+ /**
428
+ * Returns array of translations used in javascript code.
429
+ *
430
+ * @return array - translations used in JS
431
+ */
432
+ public function smush_js_translations() {
433
+ return apply_filters('smush_js_translations', array(
434
+ 'all_images_compressed' => __('All valid images are compresed now', 'wp-optimize'),
435
+ 'error_unexpected_response' => __('An unexpected response was received from the server.', 'wp-optimize'),
436
+ 'compress_single_image_dialog' => __('Please wait. Compressing the selected image.', 'wp-optimize'),
437
+ 'error_try_again_later' => __('Please try again later.', 'wp-optimize'),
438
+ 'server_check' => __('Connecting to the Smush API server, please wait', 'wp-optimize'),
439
+ 'server_error' => __('There was an error connecting to the Smush API server, please try later', 'wp-optimize'),
440
+ ));
441
+ }
442
+
443
+ /**
444
+ * Adds a smush metabox on the post edit screen for images
445
+ *
446
+ * @param WP_Post $post - a post object
447
+ */
448
+ public function add_smush_metabox($post) {
449
+
450
+ if (!'image' == substr($post->post_mime_type, 0, 5)) {
451
+ return;
452
+ }
453
+
454
+ add_meta_box('smush-metabox', __('Compress Image'), array($this, 'render_smush_metabox'), 'attachment', 'side');
455
+ }
456
+
457
+ /**
458
+ * Renders a metabox on the post edit screen for images
459
+ *
460
+ * @param WP_Post $post - a post object
461
+ */
462
+ public function render_smush_metabox($post) {
463
+
464
+ $compressed = get_post_meta($post->ID, 'smush-complete', true) ? true : false;
465
+ $has_backup = get_post_meta($post->ID, 'original-file', true) ? true : false;
466
+
467
+ $extract = array(
468
+ 'post_id' => $post->ID,
469
+ 'smush_display' => $compressed ? "style='display:none;'" : "style='display:block;'",
470
+ 'restore_display' => $compressed ? "style='display:block;'" : "style='display:none;'",
471
+ 'restore_action' => $has_backup ? "style='display:block;'" : "style='display:none;'",
472
+ 'smush_info' => get_post_meta($post->ID, 'smush-info', true) ?: " ",
473
+ 'file_size' => filesize(get_attached_file($post->ID))
474
+ );
475
+
476
+ WP_Optimize()->include_template('admin-metabox-smush.php', false, $extract);
477
+ }
478
+
479
+ /**
480
+ * Returns a list of images for smush (from cache if available)
481
+ *
482
+ * @return array - uncompressed images
483
+ */
484
+ public function get_uncompressed_images() {
485
+
486
+ $uncompressed_images = $this->get_from_cache('uncompressed_images');
487
+
488
+ if ($uncompressed_images) {
489
+ return $uncompressed_images;
490
+ }
491
+
492
+ $uncompressed_images = array();
493
+
494
+ $args = array(
495
+ 'post_type' => 'attachment',
496
+ 'post_mime_type' => 'image',
497
+ 'post_status' => 'inherit',
498
+ 'posts_per_page' => '100',
499
+ 'meta_query' => array(
500
+ 'relation' => 'OR',
501
+ array(
502
+ 'key' => 'smush-complete',
503
+ 'compare' => 'NOT EXISTS',
504
+ 'value' => '',
505
+ )
506
+ )
507
+ );
508
+
509
+ if (is_multisite()) {
510
+
511
+ $sites = WP_Optimize()->get_sites();
512
+
513
+ foreach ($sites as $site) {
514
+
515
+ switch_to_blog($site->blod_id);
516
+
517
+ $images = new WP_Query($args);
518
+
519
+ foreach ($images->posts as $image) {
520
+ $uncompressed_images[$site->blod_id][] = array(
521
+ 'id' => $image->ID,
522
+ 'thumb_url' => utf8_encode(wp_get_attachment_thumb_url($image->ID)),
523
+ 'admin_url' => admin_url('upload.php?item='.$image->ID),
524
+ 'filesize' => filesize(get_attached_file($image->ID))
525
+ );
526
+ }
527
+ restore_current_blog();
528
+ }
529
+
530
+ } else {
531
+ $images = new WP_Query($args);
532
+ foreach ($images->posts as $image) {
533
+ $uncompressed_images[1][] = array(
534
+ 'id' => $image->ID,
535
+ 'thumb_url' => utf8_encode(wp_get_attachment_thumb_url($image->ID)),
536
+ 'admin_url' => admin_url('post.php?post='.$image->ID.'&action=edit'),
537
+ 'filesize' => filesize(get_attached_file($image->ID))
538
+ );
539
+ }
540
+ }
541
+
542
+ $this->save_to_cache('uncompressed_images', $uncompressed_images);
543
+ return $uncompressed_images;
544
+ }
545
+
546
+ /**
547
+ * Check if a task exists for a given image
548
+ *
549
+ * @param string $image - The attachment ID of the image
550
+ * @return bool - true if yes, false otherwise
551
+ */
552
+ public function task_exists($image) {
553
+
554
+ $pending_tasks = $this->get_active_tasks('smush');
555
+ $queued_images = array();
556
+
557
+ if (!empty($pending_tasks)) {
558
+ foreach ($pending_tasks as $task) {
559
+ $queued_images[] = $task->get_option('attachment_id');
560
+ }
561
+ }
562
+ return in_array($image, $queued_images);
563
+ }
564
+
565
+ /**
566
+ * Returns a list of images for smush (from cache if available)
567
+ *
568
+ * @return array - List of task objects with uncompressed images
569
+ */
570
+ public function get_pending_tasks() {
571
+ $pending_tasks = $this->get_from_cache('pending_tasks');
572
+
573
+ if (empty($pending_tasks)) {
574
+ $pending_tasks = $this->get_active_tasks('smush');
575
+ $this->save_to_cache('pending_tasks', $pending_tasks);
576
+ }
577
+
578
+ return $pending_tasks;
579
+ }
580
+
581
+ /**
582
+ * Deletes and removes any pending tasks from queue
583
+ */
584
+ public function clear_pending_images() {
585
+
586
+ $pending_tasks = $this->get_active_tasks('smush');
587
+
588
+ foreach ($pending_tasks as $task) {
589
+ $task->delete_meta();
590
+ $task->delete();
591
+ }
592
+
593
+ return true;
594
+ }
595
+
596
+
597
+ /**
598
+ * Returns a count of failed tasks
599
+ *
600
+ * @return int - failed tasks
601
+ */
602
+ public function get_failed_task_count() {
603
+ return $this->options->get_option('failed_task_count', 0);
604
+ }
605
+
606
+ /**
607
+ * Adds the required scripts and styles
608
+ */
609
+ public function admin_enqueue_scripts() {
610
+
611
+ $enqueue_version = (defined('WP_DEBUG') && WP_DEBUG) ? WPO_VERSION.'.'.time() : WPO_VERSION;
612
+ $min_or_not = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
613
+
614
+ $js_variables = $this->smush_js_translations();
615
+ $js_variables['ajaxurl'] = admin_url('admin-ajax.php');
616
+ $js_variables['features'] = $this->get_features();
617
+
618
+ $js_variables['smush_ajax_nonce'] = wp_create_nonce('updraft-task-manager-ajax-nonce');
619
+
620
+
621
+ wp_enqueue_script('block-ui-js', WPO_PLUGIN_URL.'js/jquery.blockUI'.$min_or_not.'.js', array('jquery'), $enqueue_version);
622
+ wp_enqueue_script('smush-js', WPO_PLUGIN_URL.'js/smush'.$min_or_not.'.js', array('jquery', 'block-ui-js'), $enqueue_version);
623
+ wp_enqueue_style('smush-css', WPO_PLUGIN_URL.'css/smush'.$min_or_not.'.css', array(), $enqueue_version);
624
+ wp_localize_script('smush-js', 'wposmush', $js_variables);
625
+ }
626
+
627
+ /**
628
+ * Gets default service provider for smush
629
+ *
630
+ * @return string - service name
631
+ */
632
+ public function get_default_webservice() {
633
+ return 'resmushit';
634
+ }
635
+
636
+ /**
637
+ * Gets default service provider for smush
638
+ *
639
+ * @param string $server - The name of the server
640
+ * @return string - associated task type, default if none found
641
+ */
642
+ public function get_associated_task($server) {
643
+ $allowed = $this->get_allowed_services();
644
+
645
+ if (key_exists($server, $allowed))
646
+ return $allowed[$server];
647
+
648
+ $default = $this->get_default_webservice();
649
+ return $allowed[$default];
650
+ }
651
+
652
+ /**
653
+ * Gets allowed service providers for smush
654
+ *
655
+ * @return array - key value pair of service name => task name
656
+ */
657
+ public function get_allowed_services() {
658
+ return array(
659
+ 'nitrosmush' => 'Nitro_Smush_Task',
660
+ 'resmushit' => 'Re_Smush_It_Task',
661
+ );
662
+ }
663
+
664
+ /**
665
+ * Gets allowed service provider features smush
666
+ *
667
+ * @return array - key value pair of service name => features exposed
668
+ */
669
+ public function get_features() {
670
+ $features = array();
671
+ foreach ($this->get_allowed_services() as $service => $class_name) {
672
+ $features[$service] = call_user_func(array($class_name, 'get_features'));
673
+ }
674
+ return $features;
675
+ }
676
+
677
+ /**
678
+ * Returns the path to the logfile
679
+ *
680
+ * @return string - file path
681
+ */
682
+ public function get_logfile_path() {
683
+ return WPO_PLUGIN_MAIN_PATH . '/smush.log';
684
+ }
685
+
686
+ /**
687
+ * Adds a logger to the task
688
+ *
689
+ * @param Mixed $task - a task object
690
+ */
691
+ public function set_task_logger($task) {
692
+ if (!$this->logger) {
693
+ $this->logger = new Updraft_File_Logger($this->get_logfile_path());
694
+ }
695
+
696
+ if (!$task->get_loggers()) {
697
+ $task->add_logger($this->logger);
698
+ }
699
+ }
700
+
701
+ /**
702
+ * Writes a standardised header to the log file
703
+ */
704
+ public function write_log_header() {
705
+
706
+ global $wpdb;
707
+
708
+ // @codingStandardsIgnoreStart
709
+ $wp_version = $this->get_wordpress_version();
710
+ $mysql_version = $wpdb->db_version();
711
+ $safe_mode = $this->detect_safe_mode();
712
+ $max_execution_time = (int) @ini_get("max_execution_time");
713
+
714
+ $memory_limit = ini_get('memory_limit');
715
+ $memory_usage = round(@memory_get_usage(false)/1048576, 1);
716
+ $total_memory_usage = round(@memory_get_usage(true)/1048576, 1);
717
+
718
+ // Attempt to raise limit
719
+ @set_time_limit(90);
720
+
721
+ // @codingStandardsIgnoreStart
722
+ $log_header[] = "\n";
723
+ $log_header[] = "Header for logs at time: ".date('r')." on ".network_site_url();
724
+ $log_header[] = "WP: ".$wp_version;
725
+ $log_header[] = "PHP: ".phpversion()." (".PHP_SAPI.", ".@php_uname().")";
726
+ $log_header[] = "MySQL: $mysql_version";
727
+ $log_header[] = "WPLANG: ".get_locale();
728
+ $log_header[] = "Server: ".$_SERVER["SERVER_SOFTWARE"];
729
+ $log_header[] = "Outbound connections: ".(defined('WP_HTTP_BLOCK_EXTERNAL') ? 'Y' : 'N');
730
+ $log_header[] = "safe_mode: $safe_mode";
731
+ $log_header[] = "max_execution_time: $max_execution_time";
732
+ $log_header[] = "memory_limit: $memory_limit (used: ${memory_usage}M | ${total_memory_usage}M)";
733
+ $log_header[] = "multisite: ".(is_multisite() ? 'Y' : 'N');
734
+ $log_header[] = "openssl: ".(defined('OPENSSL_VERSION_TEXT') ? OPENSSL_VERSION_TEXT : 'N');
735
+
736
+
737
+ foreach ($log_header as $log_entry) {
738
+ $this->log($log_entry);
739
+ }
740
+
741
+ $memlim = $this->memory_check_current();
742
+
743
+ if ($memlim<65 && $memlim>0) {
744
+ $this->log(sprintf('The amount of memory (RAM) allowed for PHP is very low (%s Mb) - you should increase it to avoid failures due to insufficient memory (consult your web hosting company for more help)', round($memlim, 1)), 'warning');
745
+ }
746
+
747
+ if ($max_execution_time>0 && $max_execution_time<20) {
748
+ $this->log(sprintf('The amount of time allowed for WordPress plugins to run is very low (%s seconds) - you should increase it to avoid failures due to time-outs (consult your web hosting company for more help - it is the max_execution_time PHP setting; the recommended value is %s seconds or more)', $max_execution_time, 90), 'warning');
749
+ }
750
+ }
751
+
752
+ /**
753
+ * Prunes the log file
754
+ */
755
+ public function prune_smush_logs() {
756
+ $this->log("Pruning the smush log file");
757
+ $this->logger->prune_logs();
758
+ }
759
+
760
+ /**
761
+ * Get the WordPress version
762
+ *
763
+ * @return String - the version
764
+ */
765
+ public function get_wordpress_version() {
766
+ static $got_wp_version = false;
767
+
768
+ if (!$got_wp_version) {
769
+ global $wp_version;
770
+ @include(ABSPATH.WPINC.'/version.php');
771
+ $got_wp_version = $wp_version;
772
+ }
773
+
774
+ return $got_wp_version;
775
+ }
776
+
777
+ /**
778
+ * Get the current memory limit
779
+ *
780
+ * @return String - memory limit in megabytes
781
+ */
782
+ public function memory_check_current($memory_limit = false) {
783
+ // Returns in megabytes
784
+ if (false == $memory_limit) $memory_limit = ini_get('memory_limit');
785
+ $memory_limit = rtrim($memory_limit);
786
+ $memory_unit = $memory_limit[strlen($memory_limit)-1];
787
+ if (0 == (int) $memory_unit && '0' !== $memory_unit) {
788
+ $memory_limit = substr($memory_limit, 0, strlen($memory_limit)-1);
789
+ } else {
790
+ $memory_unit = '';
791
+ }
792
+ switch ($memory_unit) {
793
+ case '':
794
+ $memory_limit = floor($memory_limit/1048576);
795
+ break;
796
+ // @codingStandardsIgnoreLine
797
+ case 'K':
798
+ case 'k':
799
+ $memory_limit = floor($memory_limit/1024);
800
+ break;
801
+ case 'G':
802
+ $memory_limit = $memory_limit*1024;
803
+ break;
804
+ // @codingStandardsIgnoreLine
805
+ case 'M':
806
+ // assumed size, no change needed
807
+ break;
808
+ }
809
+ return $memory_limit;
810
+ }
811
+
812
+ /**
813
+ * Detect if safe_mode is on
814
+ *
815
+ * @return Integer - 1 or 0
816
+ */
817
+ public function detect_safe_mode() {
818
+ // @codingStandardsIgnoreLine
819
+ return (@ini_get('safe_mode') && strtolower(@ini_get('safe_mode')) != "off") ? 1 : 0;
820
+ }
821
+
822
+ /**
823
+ * Saves a value to the cache.
824
+ *
825
+ * @param string $key
826
+ * @param mixed $value
827
+ * @param int $blog_id
828
+ */
829
+ public function save_to_cache($key, $value, $blog_id = 1) {
830
+ $transient_limit = 3600 * 48;
831
+ $key = 'wpo_smush_cache_' . $blog_id . '_'. $key;
832
+
833
+ return WP_Optimize_Transients_Cache::get_instance()->set($key, $value, $transient_limit);
834
+ }
835
+
836
+ /**
837
+ * Gets value from the cache.
838
+ *
839
+ * @param string $key
840
+ * @param int $blog_id
841
+ * @return mixed
842
+ */
843
+ public function get_from_cache($key, $blog_id = 1) {
844
+ $key = 'wpo_smush_cache_' . $blog_id . '_'. $key;
845
+
846
+ $value = WP_Optimize_Transients_Cache::get_instance()->get($key);
847
+
848
+ return $value;
849
+ }
850
+
851
+ /**
852
+ * Deletes a value from the cache.
853
+ *
854
+ * @param string $key
855
+ * @param int $blog_id
856
+ */
857
+ public function delete_from_cache($key, $blog_id = 1) {
858
+ $key = 'wpo_smush_cache_' . $blog_id . '_'. $key;
859
+
860
+ WP_Optimize_Transients_Cache::get_instance()->delete($key);
861
+
862
+ $this->delete_transient($key);
863
+ }
864
+
865
+ /**
866
+ * Wrapper for deleting a transient
867
+ *
868
+ * @param string $key
869
+ */
870
+ public function delete_transient($key) {
871
+ if ($this->is_multisite_mode()) {
872
+ delete_site_transient($key);
873
+ } else {
874
+ delete_transient($key);
875
+ }
876
+ }
877
+
878
+ /**
879
+ * Removes all cached data
880
+ */
881
+ public function clear_cached_data() {
882
+ global $wpdb;
883
+
884
+ // get list of cached data by optimization.
885
+ if ($this->is_multisite_mode()) {
886
+ $keys = $wpdb->get_col("SELECT meta_key FROM {$wpdb->sitemeta} WHERE meta_key LIKE '%wpo_smush_cache_%'");
887
+ } else {
888
+ $keys = $wpdb->get_col("SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE '%wpo_smush_cache_%'");
889
+ }
890
+
891
+ if (!empty($keys)) {
892
+ $transient_keys = array();
893
+ foreach ($keys as $key) {
894
+ preg_match('/wpo_smush_cache_.+/', $key, $option_name);
895
+ $option_name = $option_name[0];
896
+ $transient_keys[] = $option_name;
897
+ }
898
+
899
+ // get unique keys.
900
+ $transient_keys = array_unique($transient_keys);
901
+
902
+ // delete transients.
903
+ foreach ($transient_keys as $key) {
904
+ $this->delete_transient($key);
905
+ }
906
+ }
907
+ }
908
+
909
+ /**
910
+ * Returns true if multisite
911
+ *
912
+ * @return bool
913
+ */
914
+ public function is_multisite_mode() {
915
+ return WP_Optimize()->is_multisite_mode();
916
+ }
917
+ }
918
+
919
+ /**
920
+ * Returns a Updraft_Smush_Manager instance
921
+ */
922
+ function Updraft_Smush_Manager() {
923
+ return Updraft_Smush_Manager::instance();
924
+ }
925
+
926
+ $GLOBALS['task_manager'] = new Updraft_Smush_Manager();
927
+
928
+ endif;
includes/class-updraft-smush-task.php ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * A sample implementation using the Resmush.it API and our tasks library
4
+ */
5
+
6
+ if (!defined('ABSPATH')) die('Access denied.');
7
+
8
+ if (!class_exists('Updraft_Task_1_0')) require_once(WPO_PLUGIN_MAIN_PATH . 'vendor/team-updraft/common-libs/src/updraft-tasks/class-updraft-task.php');
9
+
10
+ if (!class_exists('Smush_Task')) :
11
+
12
+ abstract class Updraft_Smush_Task extends Updraft_Task_1_0 {
13
+
14
+ /**
15
+ * A flag indicating if the operation was succesful
16
+ *
17
+ * @var bool
18
+ */
19
+ protected $success = false;
20
+
21
+ /**
22
+ * A text descriptor describing the stage of the task
23
+ *
24
+ * @var string
25
+ */
26
+ protected $stage;
27
+
28
+ /**
29
+ * Initialise the task
30
+ *
31
+ * @param Array $options - options to use
32
+ */
33
+ public function initialise($options = array()) {
34
+ parent::initialise($options);
35
+ $this->set_current_stage('initialised');
36
+ do_action('ud_task_initialised', $this);
37
+ }
38
+
39
+ /**
40
+ * Runs the task
41
+ *
42
+ * @return bool - true if complete, false otherwise
43
+ */
44
+ public function run() {
45
+
46
+ do_action('ud_task_started', $this);
47
+
48
+ $attachment_id = $this->get_option('attachment_id');
49
+ $file_path = get_attached_file($attachment_id);
50
+
51
+ if (!$this->validate_file($file_path)) return false;
52
+
53
+ $this->update_option('original_filesize', filesize($file_path));
54
+ $this->log($this->get_description());
55
+
56
+
57
+ $post_data = $this->prepare_post_request($file_path);
58
+ $api_endpoint = $this->get_option('api_endpoint');
59
+
60
+ if (false === filter_var($api_endpoint, FILTER_VALIDATE_URL)) {
61
+ $this->fail("invalid_api_url", "The API endpoint supplied {$api_endpoint} is invalid");
62
+ }
63
+
64
+ $response = $this->post_to_remote_server($api_endpoint, $post_data);
65
+ $optimised_image = $this->process_server_response($response);
66
+
67
+ if ($optimised_image) {
68
+ $this->save_optimised_image($file_path, $optimised_image);
69
+ }
70
+
71
+ return $this->success;
72
+ }
73
+
74
+ /**
75
+ * Posts the supplied data to the API url and returns a response
76
+ *
77
+ * @param String $api_endpoint - the url to post the form to
78
+ * @param String $post_data - the post data as specified by the server
79
+ * @return mixed - the response
80
+ */
81
+ public function post_to_remote_server($api_endpoint, $post_data) {
82
+
83
+ $this->set_current_stage('connecting');
84
+ $response = wp_remote_post($api_endpoint, $post_data);
85
+
86
+ if (is_wp_error($response)) {
87
+ $this->fail($response->get_error_code(), $response->get_error_message());
88
+ return false;
89
+ }
90
+
91
+ return $response;
92
+ }
93
+
94
+ /**
95
+ * Processes the response recieved from the remote server
96
+ *
97
+ * @param mixed $response - the response object
98
+ * @return mixed - the response
99
+ */
100
+ public function process_server_response($response) {
101
+ $this->set_current_stage('processing_response');
102
+ return $response;
103
+ }
104
+
105
+ /**
106
+ * Checks if a file is valid and capable of being smushed
107
+ *
108
+ * @param String $file_path - the path of the original image
109
+ * @return bool - true on success, false otherwise
110
+ */
111
+ public function validate_file($file_path) {
112
+
113
+ $allowed_file_types = $this->get_option('allowed_file_types');
114
+
115
+ if (!file_exists($file_path)) {
116
+ $this->fail("invalid_file_path", "The linked attachment ID does not have a valid file path");
117
+ return false;
118
+ }
119
+
120
+ if (filesize($file_path) > $this->get_option('max_filesize')) {
121
+ $this->fail("exceeded_max_filesize", "$file_path - cannot be optimized, file size is above service provider limit");
122
+ return false;
123
+ }
124
+
125
+ if (!in_array(pathinfo($file_path, PATHINFO_EXTENSION), $allowed_file_types)) {
126
+ $this->fail("invalid_file_type", "$file_path - cannot be optimized, it has an invalid file type");
127
+ return false;
128
+ }
129
+
130
+ return true;
131
+ }
132
+
133
+ /**
134
+ * Creates a backup of the original image
135
+ *
136
+ * @param String $file_path - the path of the original image
137
+ * @return bool - true on success, false otherwise
138
+ */
139
+ public function backup_original_image($file_path) {
140
+
141
+ $this->set_current_stage('backup_original');
142
+
143
+ $file = pathinfo($file_path);
144
+ $back_up = $file['dirname'].'/'.basename($file['filename'].$this->get_option('backup_prefix').$file['extension']);
145
+
146
+ update_post_meta($this->get_option('attachment_id'), 'original-file', $back_up);
147
+ $this->log("Backing up the original image - {$back_up}");
148
+
149
+ return copy($file_path, $back_up);
150
+ }
151
+
152
+ /**
153
+ * Creates a backup of the original image
154
+ *
155
+ * @param String $file_path - the path of the original image
156
+ * @param Mixes $optimised_image - the contents of the image
157
+ * @return bool - true on success, false otherwise
158
+ */
159
+ public function save_optimised_image($file_path, $optimised_image) {
160
+
161
+ $this->set_current_stage('saving_image');
162
+
163
+ if ($this->get_option('keep_original'))
164
+ $this->backup_original_image($file_path);
165
+
166
+ if (false !== file_put_contents($file_path, $optimised_image)) {
167
+ $this->success = true;
168
+ } else {
169
+ $this->success = false;
170
+ }
171
+
172
+ return $this->success;
173
+ }
174
+
175
+ /**
176
+ * Fires if the task succeds, any clean up code and logging goes here
177
+ */
178
+ public function complete() {
179
+
180
+ $attachment_id = $this->get_option('attachment_id');
181
+ $file_path = get_attached_file($attachment_id);
182
+ $original_size = $this->get_option('original_filesize');
183
+ $this->set_current_stage('completed');
184
+
185
+ clearstatcache(true, $file_path);
186
+ $saved = round((($original_size - filesize($file_path)) / $original_size * 100), 2);
187
+ $info = sprintf(__("The file was compressed from %s to %s saving %s percent using WP-Optimize", 'wp-optimize'), $this->format_filesize($original_size), $this->format_filesize(filesize($file_path)), $saved);
188
+
189
+ $stats = array(
190
+ 'smushed-with' => $this->label,
191
+ 'original-size' => $original_size,
192
+ 'smushed-size' => filesize($file_path),
193
+ 'savings-percent' => $saved,
194
+ );
195
+
196
+ update_post_meta($attachment_id, 'smush-complete', true);
197
+ update_post_meta($attachment_id, 'smush-info', $info);
198
+ update_post_meta($attachment_id, 'smush-stats', $stats);
199
+
200
+ $this->log("Successfully optimized the image - {$file_path}." . $info);
201
+
202
+ return parent::complete();
203
+ }
204
+
205
+ /**
206
+ * Fires if the task fails, any clean up code and logging goes here
207
+ *
208
+ * @param String $error_code - A code for the failure
209
+ * @param String $error_message - A description for the failure
210
+ */
211
+ public function fail($error_code = "Unknown", $error_message = "Unknown") {
212
+
213
+ $attachment_id = $this->get_option('attachment_id');
214
+
215
+ $info = sprintf(__("Failed with error code %s - %s", 'wp-optimize'), $error_code, $error_message);
216
+
217
+ update_post_meta($attachment_id, 'smush-info', $info);
218
+ update_post_meta($attachment_id, 'smush-complete', false);
219
+
220
+ do_action('ud_smush_task_failed', $this, $error_code, $error_message);
221
+
222
+ return parent::fail($error_code, $error_message);
223
+ }
224
+
225
+ /**
226
+ * Get all the supported task stages.
227
+ *
228
+ * @return array - list of task stages.
229
+ */
230
+ public function get_allowed_stages() {
231
+
232
+ $stages = array(
233
+ 'initialised' => __('Initialised', 'wp-optimize'),
234
+ 'connecting' => __('Connecting to API server', 'wp-optimize'),
235
+ 'processing_response' => __('Processing response', 'wp-optimize'),
236
+ 'backup_original' => __('Backing up original image', 'wp-optimize'),
237
+ 'saving_image' => __('Saving optimised image', 'wp-optimize'),
238
+ 'completed' => __('Successful', 'wp-optimize'),
239
+ );
240
+
241
+ return apply_filters('allowed_task_stages', $stages);
242
+ }
243
+
244
+ /**
245
+ * Get features available with this service
246
+ *
247
+ * @return Array - an array of features
248
+ */
249
+ public static function get_features() {
250
+ return array(
251
+ 'max_filesize' => self::MAX_FILESIZE,
252
+ 'lossy_compression' => true,
253
+ 'preserve_exif' => true,
254
+ );
255
+ }
256
+
257
+ /**
258
+ * Retrieve default options for this task.
259
+ * This method should normally be over-ridden by the child.
260
+ *
261
+ * @return Array - an array of options
262
+ */
263
+ public function get_default_options() {
264
+
265
+ return array(
266
+ 'allowed_file_types' => array('gif', 'png', 'jpg', 'tif', 'jpeg'),
267
+ 'request_timeout' => 15,
268
+ 'image_quality' => 90,
269
+ 'backup_prefix' => '-updraft-pre-smush-original.'
270
+ );
271
+ }
272
+
273
+ /**
274
+ * Sets the task stage.
275
+ *
276
+ * @param String $stage - the current stage of the task
277
+ * @return bool - the result of the update
278
+ */
279
+ public function set_current_stage($stage) {
280
+
281
+ if (array_key_exists($stage, self::get_allowed_stages())) {
282
+ $this->stage = $stage;
283
+ return $this->update_option('current_stage', $this->stage);
284
+ }
285
+
286
+ return false;
287
+ }
288
+
289
+ /**
290
+ * Gets the task stage
291
+ *
292
+ * @return String $stage - the current stage of the task
293
+ */
294
+ public function get_current_stage() {
295
+ if (isset($this->stage))
296
+ return $this->stage;
297
+ else return $this->get_option('current_stage');
298
+ }
299
+
300
+
301
+ /**
302
+ * Helper function to format bytes to a human readable value
303
+ *
304
+ * @param int $bytes - the filesize in bytes
305
+ */
306
+ public function format_filesize($bytes) {
307
+
308
+ if (1073741824 <= $bytes) {
309
+ $bytes = number_format($bytes / 1073741824, 2) . ' GB';
310
+ } elseif (1048576 <= $bytes) {
311
+ $bytes = number_format($bytes / 1048576, 2) . ' MB';
312
+ } elseif (1024 <= $bytes) {
313
+ $bytes = number_format($bytes / 1024, 2) . ' KB';
314
+ } elseif (1 < $bytes) {
315
+ $bytes = $bytes . ' bytes';
316
+ } elseif (1 == $bytes) {
317
+ $bytes = $bytes . ' byte';
318
+ } else {
319
+ $bytes = '0 bytes';
320
+ }
321
+
322
+ return $bytes;
323
+ }
324
+ }
325
+ endif;
includes/class-wp-optimization.php CHANGED
@@ -28,6 +28,8 @@ abstract class WP_Optimization {
28
 
29
  public $run_multisite = true;
30
 
 
 
31
  protected $support_ajax_get_info = false; // set to true if optimization support getting info about optimization asynchronously.
32
 
33
  /**
@@ -112,6 +114,48 @@ abstract class WP_Optimization {
112
  return true;
113
  }
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  /**
116
  * Do actions before get_info() function.
117
  */
@@ -198,6 +242,11 @@ abstract class WP_Optimization {
198
  $all_sites = false;
199
  $selected_sites = array();
200
 
 
 
 
 
 
201
  $optimization_sites = (isset($this->data['site_id'])) ? $this->data['site_id'] : $this->options->get_wpo_sites_option();
202
 
203
  // check selected sites field.
@@ -385,4 +434,36 @@ abstract class WP_Optimization {
385
 
386
  return $settings_html;
387
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
  }
28
 
29
  public $run_multisite = true;
30
 
31
+ public $support_preview = true; // if true then optimization support preview action for optimization data.
32
+
33
  protected $support_ajax_get_info = false; // set to true if optimization support getting info about optimization asynchronously.
34
 
35
  /**
114
  return true;
115
  }
116
 
117
+ /**
118
+ * Returns data those should be optimized. Used to display this information in a popup tool
119
+ * for previewing and removing certain data for optimization.
120
+ *
121
+ * @param array $params
122
+ *
123
+ * @return array
124
+ */
125
+ public function preview($params) {
126
+ return array(
127
+ 'id_key' => 'id', // key used used to identify data.
128
+ 'offset' => $params['offset'],
129
+ 'limit' => $params['limit'],
130
+ 'total' => 0,
131
+ 'data' => array(), // returned data as associative array where keys are column names and values - database cell values.
132
+ );
133
+ }
134
+
135
+ /**
136
+ * Convert all applicable characters to HTML entities in array. Used to prepare data for output in browser for preview.
137
+ *
138
+ * @param array $array source array
139
+ * @param array $exclude_keys what items shoudn't be encoded.
140
+ *
141
+ * @return array
142
+ */
143
+ public function htmlentities_array($array, $exclude_keys = array()) {
144
+ if (!is_array($array) || empty($array)) return $array;
145
+
146
+ foreach ($array as $key => $value) {
147
+ if (in_array($key, $exclude_keys)) continue;
148
+
149
+ if (!is_array($value)) {
150
+ $array[$key] = htmlentities($value);
151
+ } else {
152
+ $array[$key] = $this->htmlentities_array($value);
153
+ }
154
+ }
155
+
156
+ return $array;
157
+ }
158
+
159
  /**
160
  * Do actions before get_info() function.
161
  */
242
  $all_sites = false;
243
  $selected_sites = array();
244
 
245
+ // support both arrays and single values in data site id parameter.
246
+ if (isset($this->data['site_id']) && !is_array($this->data['site_id'])) {
247
+ $this->data['site_id'] = array($this->data['site_id']);
248
+ }
249
+
250
  $optimization_sites = (isset($this->data['site_id'])) ? $this->data['site_id'] : $this->options->get_wpo_sites_option();
251
 
252
  // check selected sites field.
434
 
435
  return $settings_html;
436
  }
437
+
438
+ /**
439
+ * Wrap $text as a link for preview action. If preview is not supported then return just $text.
440
+ *
441
+ * @param string $text
442
+ * @param array $attributes
443
+ *
444
+ * @return string
445
+ */
446
+ public function get_preview_link($text, $attributes = array()) {
447
+ // if preview is not supported then return just $text.
448
+ if (false == $this->support_preview || false == WP_Optimize::is_premium()) return $text;
449
+
450
+ $attributes = array_merge(
451
+ array(
452
+ 'title' => __('Preview found items', 'wp-optimize'),
453
+ 'data-id' => $this->id,
454
+ 'data-title' => $this->settings_label(),
455
+ ),
456
+ $attributes
457
+ );
458
+
459
+ $str_attr = '';
460
+
461
+ foreach ($attributes as $key => $value) {
462
+ $str_attr .= ' '.$key.'="'.esc_attr($value).'"';
463
+ }
464
+
465
+ $link = '<a href="#" class="wpo-optimization-preview"'.$str_attr.'>'.$text.'</a>';
466
+
467
+ return $link;
468
+ }
469
  }
includes/class-wp-optimize-options.php CHANGED
@@ -282,6 +282,23 @@ class WP_Optimize_Options {
282
 
283
  }
284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  /**
286
  * The $use_dom_id parameter is legacy, for when saving options not with AJAX (in which case the dom ID comes via the $_POST array)
287
  *
282
 
283
  }
284
 
285
+ /**
286
+ * Save lazy load settings
287
+ *
288
+ * @param array $settings
289
+ * @return bool
290
+ */
291
+ public function save_lazy_load_settings($settings) {
292
+ /** Save Lazy Load settings */
293
+ if (isset($settings['lazyload'])) {
294
+ $this->update_option('lazyload', $settings['lazyload']);
295
+ } else {
296
+ $this->update_option('lazyload', array());
297
+ }
298
+
299
+ return true;
300
+ }
301
+
302
  /**
303
  * The $use_dom_id parameter is legacy, for when saving options not with AJAX (in which case the dom ID comes via the $_POST array)
304
  *
includes/class-wp-optimizer.php CHANGED
@@ -438,7 +438,6 @@ class WP_Optimizer {
438
  $total_now = strval($previously_saved + $converted_current);
439
 
440
  $options->update_option('total-cleaned', $total_now);
441
- $options->update_option('current-cleaned', $current);
442
 
443
  return $total_now;
444
  }
438
  $total_now = strval($previously_saved + $converted_current);
439
 
440
  $options->update_option('total-cleaned', $total_now);
 
441
 
442
  return $total_now;
443
  }
includes/wp-optimize-database-information.php CHANGED
@@ -122,6 +122,15 @@ class WP_Optimize_Database_Information {
122
  $tables_info = $wpdb->get_results('SHOW TABLE STATUS');
123
  }
124
 
 
 
 
 
 
 
 
 
 
125
  return $tables_info;
126
  }
127
 
122
  $tables_info = $wpdb->get_results('SHOW TABLE STATUS');
123
  }
124
 
125
+ // If option innodb_file_per_table is disabled then Data_free column will have summary overhead value for all table.
126
+ if (!empty($tables_info)) {
127
+ foreach ($tables_info as $i => $table) {
128
+ if (self::INNODB_ENGINE == $table->Engine && false == $this->is_option_enabled('innodb_file_per_table')) {
129
+ $tables_info[$i]->Data_free = 0;
130
+ }
131
+ }
132
+ }
133
+
134
  return $tables_info;
135
  }
136
 
includes/wp-optimize-notices.php CHANGED
@@ -153,9 +153,9 @@ class WP_Optimize_Notices extends Updraft_Notices_1_0 {
153
  'button_link' => 'https://getwpo.com',
154
  'button_meta' => 'wp-optimize',
155
  'dismiss_time' => 'dismiss_season',
156
- 'discount_code' => 'blackfridaysale2017',
157
- 'valid_from' => '2017-11-20 00:00:00',
158
- 'valid_to' => '2017-11-30 23:59:59',
159
  'supported_positions' => $this->dashboard_top_or_report,
160
  ),
161
  'christmas' => array(
@@ -166,22 +166,22 @@ class WP_Optimize_Notices extends Updraft_Notices_1_0 {
166
  'button_link' => 'https://getwpo.com',
167
  'button_meta' => 'wp-optimize',
168
  'dismiss_time' => 'dismiss_season',
169
- 'discount_code' => 'christmassale2017',
170
- 'valid_from' => '2017-12-01 00:00:00',
171
- 'valid_to' => '2017-12-25 23:59:59',
172
  'supported_positions' => $this->dashboard_top_or_report,
173
  ),
174
  'newyear' => array(
175
  'prefix' => '',
176
- 'title' => __('Happy New Year - 20% off WP-Optimize Premium until January 1st', 'wpo-premium'),
177
  'text' => __('To benefit, use this discount code:', 'wpo-premium').' ',
178
  'image' => 'notices/new_year.png',
179
  'button_link' => 'https://getwpo.com',
180
  'button_meta' => 'wp-optimize',
181
  'dismiss_time' => 'dismiss_season',
182
- 'discount_code' => 'newyearsale2018',
183
- 'valid_from' => '2017-12-26 00:00:00',
184
- 'valid_to' => '2018-01-14 23:59:59',
185
  'supported_positions' => $this->dashboard_top_or_report,
186
  ),
187
  'spring' => array(
@@ -193,8 +193,8 @@ class WP_Optimize_Notices extends Updraft_Notices_1_0 {
193
  'button_meta' => 'updraftplus',
194
  'dismiss_time' => 'dismiss_season',
195
  'discount_code' => 'springsale2018',
196
- 'valid_from' => '2018-04-01 00:00:00',
197
- 'valid_to' => '2018-04-30 23:59:59',
198
  'supported_positions' => $this->dashboard_top_or_report,
199
  ),
200
  'summer' => array(
@@ -206,8 +206,8 @@ class WP_Optimize_Notices extends Updraft_Notices_1_0 {
206
  'button_meta' => 'wp-optimize',
207
  'dismiss_time' => 'dismiss_season',
208
  'discount_code' => 'summersale2018',
209
- 'valid_from' => '2018-07-01 00:00:00',
210
- 'valid_to' => '2018-07-31 23:59:59',
211
  'supported_positions' => $this->dashboard_top_or_report,
212
  )
213
  );
153
  'button_link' => 'https://getwpo.com',
154
  'button_meta' => 'wp-optimize',
155
  'dismiss_time' => 'dismiss_season',
156
+ 'discount_code' => 'blackfridaysale2018',
157
+ 'valid_from' => '2018-11-20 00:00:00',
158
+ 'valid_to' => '2018-11-30 23:59:59',
159
  'supported_positions' => $this->dashboard_top_or_report,
160
  ),
161
  'christmas' => array(
166
  'button_link' => 'https://getwpo.com',
167
  'button_meta' => 'wp-optimize',
168
  'dismiss_time' => 'dismiss_season',
169
+ 'discount_code' => 'christmassale2018',
170
+ 'valid_from' => '2018-12-01 00:00:00',
171
+ 'valid_to' => '2018-12-25 23:59:59',
172
  'supported_positions' => $this->dashboard_top_or_report,
173
  ),
174
  'newyear' => array(
175
  'prefix' => '',
176
+ 'title' => __('Happy New Year - 20% off WP-Optimize Premium until January 14th', 'wpo-premium'),
177
  'text' => __('To benefit, use this discount code:', 'wpo-premium').' ',
178
  'image' => 'notices/new_year.png',
179
  'button_link' => 'https://getwpo.com',
180
  'button_meta' => 'wp-optimize',
181
  'dismiss_time' => 'dismiss_season',
182
+ 'discount_code' => 'newyearsale2019',
183
+ 'valid_from' => '2018-12-26 00:00:00',
184
+ 'valid_to' => '2019-01-14 23:59:59',
185
  'supported_positions' => $this->dashboard_top_or_report,
186
  ),
187
  'spring' => array(
193
  'button_meta' => 'updraftplus',
194
  'dismiss_time' => 'dismiss_season',
195
  'discount_code' => 'springsale2018',
196
+ 'valid_from' => '2019-04-01 00:00:00',
197
+ 'valid_to' => '2019-04-30 23:59:59',
198
  'supported_positions' => $this->dashboard_top_or_report,
199
  ),
200
  'summer' => array(
206
  'button_meta' => 'wp-optimize',
207
  'dismiss_time' => 'dismiss_season',
208
  'discount_code' => 'summersale2018',
209
+ 'valid_from' => '2019-07-01 00:00:00',
210
+ 'valid_to' => '2019-07-31 23:59:59',
211
  'supported_positions' => $this->dashboard_top_or_report,
212
  )
213
  );
js/handlebars/handlebars.js CHANGED
@@ -1,7 +1,7 @@
1
  /**!
2
 
3
  @license
4
- handlebars v4.0.11
5
 
6
  Copyright (C) 2011-2017 by Yehuda Katz
7
 
@@ -275,7 +275,7 @@ return /******/ (function(modules) { // webpackBootstrap
275
 
276
  var _logger2 = _interopRequireDefault(_logger);
277
 
278
- var VERSION = '4.0.11';
279
  exports.VERSION = VERSION;
280
  var COMPILER_REVISION = 7;
281
 
@@ -1630,7 +1630,7 @@ return /******/ (function(modules) { // webpackBootstrap
1630
  terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
1631
  productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 1], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
1632
  performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$
1633
- /**/) {
1634
 
1635
  var $0 = $$.length - 1;
1636
  switch (yystate) {
@@ -2168,7 +2168,7 @@ return /******/ (function(modules) { // webpackBootstrap
2168
  } };
2169
  lexer.options = {};
2170
  lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START
2171
- /**/) {
2172
 
2173
  function strip(start, end) {
2174
  return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end);
@@ -2786,7 +2786,7 @@ return /******/ (function(modules) { // webpackBootstrap
2786
  }
2787
 
2788
  function stripComment(comment) {
2789
- return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, '');
2790
  }
2791
 
2792
  function preparePath(data, parts, loc) {
@@ -2794,8 +2794,7 @@ return /******/ (function(modules) { // webpackBootstrap
2794
 
2795
  var original = data ? '@' : '',
2796
  dig = [],
2797
- depth = 0,
2798
- depthString = '';
2799
 
2800
  for (var i = 0, l = parts.length; i < l; i++) {
2801
  var part = parts[i].part,
@@ -2810,7 +2809,6 @@ return /******/ (function(modules) { // webpackBootstrap
2810
  throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
2811
  } else if (part === '..') {
2812
  depth++;
2813
- depthString += '../';
2814
  }
2815
  } else {
2816
  dig.push(part);
@@ -3045,11 +3043,11 @@ return /******/ (function(modules) { // webpackBootstrap
3045
  'lookup': true
3046
  };
3047
  if (knownHelpers) {
 
 
 
3048
  for (var _name in knownHelpers) {
3049
- /* istanbul ignore else */
3050
- if (_name in knownHelpers) {
3051
- this.options.knownHelpers[_name] = knownHelpers[_name];
3052
- }
3053
  }
3054
  }
3055
 
1
  /**!
2
 
3
  @license
4
+ handlebars v4.0.12
5
 
6
  Copyright (C) 2011-2017 by Yehuda Katz
7
 
275
 
276
  var _logger2 = _interopRequireDefault(_logger);
277
 
278
+ var VERSION = '4.0.12';
279
  exports.VERSION = VERSION;
280
  var COMPILER_REVISION = 7;
281
 
1630
  terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
1631
  productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 1], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
1632
  performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$
1633
+ /*``*/) {
1634
 
1635
  var $0 = $$.length - 1;
1636
  switch (yystate) {
2168
  } };
2169
  lexer.options = {};
2170
  lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START
2171
+ /*``*/) {
2172
 
2173
  function strip(start, end) {
2174
  return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end);
2786
  }
2787
 
2788
  function stripComment(comment) {
2789
+ return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, '');
2790
  }
2791
 
2792
  function preparePath(data, parts, loc) {
2794
 
2795
  var original = data ? '@' : '',
2796
  dig = [],
2797
+ depth = 0;
 
2798
 
2799
  for (var i = 0, l = parts.length; i < l; i++) {
2800
  var part = parts[i].part,
2809
  throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
2810
  } else if (part === '..') {
2811
  depth++;
 
2812
  }
2813
  } else {
2814
  dig.push(part);
3043
  'lookup': true
3044
  };
3045
  if (knownHelpers) {
3046
+ // the next line should use "Object.keys", but the code has been like this a long time and changing it, might
3047
+ // cause backwards-compatibility issues... It's an old library...
3048
+ // eslint-disable-next-line guard-for-in
3049
  for (var _name in knownHelpers) {
3050
+ this.options.knownHelpers[_name] = knownHelpers[_name];
 
 
 
3051
  }
3052
  }
3053
 
js/handlebars/handlebars.min.js CHANGED
@@ -1,7 +1,7 @@
1
  /**!
2
 
3
  @license
4
- handlebars v4.0.11
5
 
6
  Copyright (C) 2011-2017 by Yehuda Katz
7
 
@@ -24,6 +24,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
  THE SOFTWARE.
25
 
26
  */
27
- !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(){var a=r();return a.compile=function(b,c){return k.compile(b,c,a)},a.precompile=function(b,c){return k.precompile(b,c,a)},a.AST=i["default"],a.Compiler=k.Compiler,a.JavaScriptCompiler=m["default"],a.Parser=j.parser,a.parse=j.parse,a}var e=c(1)["default"];b.__esModule=!0;var f=c(2),g=e(f),h=c(35),i=e(h),j=c(36),k=c(41),l=c(42),m=e(l),n=c(39),o=e(n),p=c(34),q=e(p),r=g["default"].create,s=d();s.create=d,q["default"](s),s.Visitor=o["default"],s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0},function(a,b,c){"use strict";function d(){var a=new h.HandlebarsEnvironment;return n.extend(a,h),a.SafeString=j["default"],a.Exception=l["default"],a.Utils=n,a.escapeExpression=n.escapeExpression,a.VM=p,a.template=function(b){return p.template(b,a)},a}var e=c(3)["default"],f=c(1)["default"];b.__esModule=!0;var g=c(4),h=e(g),i=c(21),j=f(i),k=c(6),l=f(k),m=c(5),n=e(m),o=c(22),p=e(o),q=c(34),r=f(q),s=d();s.create=d,r["default"](s),s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},b.__esModule=!0},function(a,b,c){"use strict";function d(a,b,c){this.helpers=a||{},this.partials=b||{},this.decorators=c||{},i.registerDefaultHelpers(this),j.registerDefaultDecorators(this)}var e=c(1)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d;var f=c(5),g=c(6),h=e(g),i=c(10),j=c(18),k=c(20),l=e(k),m="4.0.11";b.VERSION=m;var n=7;b.COMPILER_REVISION=n;var o={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};b.REVISION_CHANGES=o;var p="[object Object]";d.prototype={constructor:d,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===p)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]}};var q=l["default"].log;b.log=q,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return k[a]}function d(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function e(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return m.test(a)?a.replace(l,c):a}function g(a){return!a&&0!==a||!(!p(a)||0!==a.length)}function h(a){var b=d({},a);return b._parent=a,b}function i(a,b){return a.path=b,a}function j(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.createFrame=h,b.blockParams=i,b.appendContextPath=j;var k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},l=/[&<>"'`=]/g,m=/[&<>"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function(a){return"function"==typeof a};o(/x/)&&(b.isFunction=o=function(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o;var p=Array.isArray||function(a){return!(!a||"object"!=typeof a)&&"[object Array]"===n.call(a)};b.isArray=p},function(a,b,c){"use strict";function d(a,b){var c=b&&b.loc,g=void 0,h=void 0;c&&(g=c.start.line,h=c.start.column,a+=" - "+g+":"+h);for(var i=Error.prototype.constructor.call(this,a),j=0;j<f.length;j++)this[f[j]]=i[f[j]];Error.captureStackTrace&&Error.captureStackTrace(this,d);try{c&&(this.lineNumber=g,e?Object.defineProperty(this,"column",{value:h,enumerable:!0}):this.column=h)}catch(k){}}var e=c(7)["default"];b.__esModule=!0;var f=["description","fileName","lineNumber","message","name","number","stack"];d.prototype=new Error,b["default"]=d,a.exports=b["default"]},function(a,b,c){a.exports={"default":c(8),__esModule:!0}},function(a,b,c){var d=c(9);a.exports=function(a,b,c){return d.setDesc(a,b,c)}},function(a,b){var c=Object;a.exports={create:c.create,getProto:c.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:c.getOwnPropertyDescriptor,setDesc:c.defineProperty,setDescs:c.defineProperties,getKeys:c.keys,getNames:c.getOwnPropertyNames,getSymbols:c.getOwnPropertySymbols,each:[].forEach}},function(a,b,c){"use strict";function d(a){g["default"](a),i["default"](a),k["default"](a),m["default"](a),o["default"](a),q["default"](a),s["default"](a)}var e=c(1)["default"];b.__esModule=!0,b.registerDefaultHelpers=d;var f=c(11),g=e(f),h=c(12),i=e(h),j=c(13),k=e(j),l=c(14),m=e(l),n=c(15),o=e(n),p=c(16),q=e(p),r=c(17),s=e(r)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("blockHelperMissing",function(b,c){var e=c.inverse,f=c.fn;if(b===!0)return f(this);if(b===!1||null==b)return e(this);if(d.isArray(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,f){j&&(j.key=b,j.index=c,j.first=0===c,j.last=!!f,k&&(j.contextPath=k+b)),i+=d(a[b],{data:j,blockParams:e.blockParams([a[b],b],[k+b,null])})}if(!b)throw new g["default"]("Must pass iterator to #each");var d=b.fn,f=b.inverse,h=0,i="",j=void 0,k=void 0;if(b.data&&b.ids&&(k=e.appendContextPath(b.data.contextPath,b.ids[0])+"."),e.isFunction(a)&&(a=a.call(this)),b.data&&(j=e.createFrame(b.data)),a&&"object"==typeof a)if(e.isArray(a))for(var l=a.length;h<l;h++)h in a&&c(h,h,h===a.length-1);else{var m=void 0;for(var n in a)a.hasOwnProperty(n)&&(void 0!==m&&c(m,h-1),m=n,h++);void 0!==m&&c(m,h-1,!0)}return 0===h&&(i=f(this)),i})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(6),f=d(e);b["default"]=function(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new f["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("if",function(a,b){return d.isFunction(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||d.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("log",function(){for(var b=[void 0],c=arguments[arguments.length-1],d=0;d<arguments.length-1;d++)b.push(arguments[d]);var e=1;null!=c.hash.level?e=c.hash.level:c.data&&null!=c.data.level&&(e=c.data.level),b[0]=e,a.log.apply(a,b)})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("lookup",function(a,b){return a&&a[b]})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("with",function(a,b){d.isFunction(a)&&(a=a.call(this));var c=b.fn;if(d.isEmpty(a))return b.inverse(this);var e=b.data;return b.data&&b.ids&&(e=d.createFrame(b.data),e.contextPath=d.appendContextPath(b.data.contextPath,b.ids[0])),c(a,{data:e,blockParams:d.blockParams([a],[e&&e.contextPath])})})},a.exports=b["default"]},function(a,b,c){"use strict";function d(a){g["default"](a)}var e=c(1)["default"];b.__esModule=!0,b.registerDefaultDecorators=d;var f=c(19),g=e(f)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerDecorator("inline",function(a,b,c,e){var f=a;return b.partials||(b.partials={},f=function(e,f){var g=c.partials;c.partials=d.extend({},g,b.partials);var h=a(e,f);return c.partials=g,h}),b.partials[e.args[0]]=e.fn,f})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5),e={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(a){if("string"==typeof a){var b=d.indexOf(e.methodMap,a.toLowerCase());a=b>=0?b:parseInt(a,10)}return a},log:function(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];console[b].apply(console,d)}}};b["default"]=e,a.exports=b["default"]},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=s.COMPILER_REVISION;if(b!==c){if(b<c){var d=s.REVISION_CHANGES[c],e=s.REVISION_CHANGES[b];throw new r["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new r["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=p.extend({},d,e.hash),e.ids&&(e.ids[0]=!0)),c=b.VM.resolvePartial.call(this,c,d,e);var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;h<i&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new r["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){function c(b){return""+a.main(e,b,e.helpers,e.partials,g,i,h)}var f=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],g=f.data;d._setup(f),!f.partial&&a.useData&&(g=j(b,g));var h=void 0,i=a.useBlockParams?[]:void 0;return a.useDepths&&(h=f.depths?b!=f.depths[0]?[b].concat(f.depths):f.depths:[b]),(c=k(a.main,c,e,f.depths||[],g,i))(b,f)}if(!b)throw new r["default"]("No environment passed to template");if(!a||!a.main)throw new r["default"]("Unknown template object: "+typeof a);a.main.decorator=a.main_d,b.VM.checkRevision(a.compiler);var e={strict:function(a,b){if(!(b in a))throw new r["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;d<c;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:p.escapeExpression,invokePartial:c,fn:function(b){var c=a[b];return c.decorator=a[b+"_d"],c},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=p.extend({},b,a)),c},nullContext:l({}),noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){c.partial?(e.helpers=c.helpers,e.partials=c.partials,e.decorators=c.decorators):(e.helpers=e.merge(c.helpers,b.helpers),a.usePartial&&(e.partials=e.merge(c.partials,b.partials)),(a.usePartial||a.useDecorators)&&(e.decorators=e.merge(c.decorators,b.decorators)))},d._child=function(b,c,d,g){if(a.useBlockParams&&!d)throw new r["default"]("must pass block params");if(a.useDepths&&!g)throw new r["default"]("must pass parent depths");return f(e,b,a[b],c,0,d,g)},d}function f(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],h=g;return!g||b==g[0]||b===a.nullContext&&null===g[0]||(h=[b].concat(g)),c(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),h)}return h=k(c,h,a,g,d,f),h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a="@partial-block"===c.name?c.data["partial-block"]:c.partials[c.name],a}function h(a,b,c){var d=c.data&&c.data["partial-block"];c.partial=!0,c.ids&&(c.data.contextPath=c.ids[0]||c.data.contextPath);var e=void 0;if(c.fn&&c.fn!==i&&!function(){c.data=s.createFrame(c.data);var a=c.fn;e=c.data["partial-block"]=function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return c.data=s.createFrame(c.data),c.data["partial-block"]=d,a(b,c)},a.partials&&(c.partials=p.extend({},c.partials,a.partials))}(),void 0===a&&e&&(a=e),void 0===a)throw new r["default"]("The partial "+c.name+" could not be found");if(a instanceof Function)return a(b,c)}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?s.createFrame(b):{},b.root=a),b}function k(a,b,c,d,e,f){if(a.decorator){var g={};b=a.decorator(b,g,c,d&&d[0],e,f,d),p.extend(b,g)}return b}var l=c(23)["default"],m=c(3)["default"],n=c(1)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var o=c(5),p=m(o),q=c(6),r=n(q),s=c(4)},function(a,b,c){a.exports={"default":c(24),__esModule:!0}},function(a,b,c){c(25),a.exports=c(30).Object.seal},function(a,b,c){var d=c(26);c(27)("seal",function(a){return function(b){return a&&d(b)?a(b):b}})},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b,c){var d=c(28),e=c(30),f=c(33);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){var d=c(29),e=c(30),f=c(31),g="prototype",h=function(a,b,c){var i,j,k,l=a&h.F,m=a&h.G,n=a&h.S,o=a&h.P,p=a&h.B,q=a&h.W,r=m?e:e[b]||(e[b]={}),s=m?d:n?d[b]:(d[b]||{})[g];m&&(c=b);for(i in c)j=!l&&s&&i in s,j&&i in r||(k=j?s[i]:c[i],r[i]=m&&"function"!=typeof s[i]?c[i]:p&&j?f(k,d):q&&s[i]==k?function(a){var b=function(b){return this instanceof a?new a(b):a(b)};return b[g]=a[g],b}(k):o&&"function"==typeof k?f(Function.call,k):k,o&&((r[g]||(r[g]={}))[i]=k))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,a.exports=h},function(a,b){var c=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=c)},function(a,b){var c=a.exports={version:"1.2.6"};"number"==typeof __e&&(__e=c)},function(a,b,c){var d=c(32);a.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b){(function(c){"use strict";b.__esModule=!0,b["default"]=function(a){var b="undefined"!=typeof c?c:window,d=b.Handlebars;a.noConflict=function(){return b.Handlebars===a&&(b.Handlebars=d),a}},a.exports=b["default"]}).call(b,function(){return this}())},function(a,b){"use strict";b.__esModule=!0;var c={helpers:{helperExpression:function(a){return"SubExpression"===a.type||("MustacheStatement"===a.type||"BlockStatement"===a.type)&&!!(a.params&&a.params.length||a.hash)},scopedId:function(a){return/^\.|this\b/.test(a.original)},simpleId:function(a){return 1===a.parts.length&&!c.helpers.scopedId(a)&&!a.depth}}};b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if("Program"===a.type)return a;h["default"].yy=n,n.locInfo=function(a){return new n.SourceLocation(b&&b.srcName,a)};var c=new j["default"](b);return c.accept(h["default"].parse(a))}var e=c(1)["default"],f=c(3)["default"];b.__esModule=!0,b.parse=d;var g=c(37),h=e(g),i=c(38),j=e(i),k=c(40),l=f(k),m=c(5);b.parser=h["default"];var n={};m.extend(n,l)},function(a,b){"use strict";b.__esModule=!0;var c=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition_plus0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,1],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 2:this.$=d.prepareProgram(f[h]);break;case 3:this.$=f[h];break;case 4:this.$=f[h];break;case 5:this.$=f[h];break;case 6:this.$=f[h];break;case 7:this.$=f[h];break;case 8:this.$=f[h];break;case 9:this.$={type:"CommentStatement",value:d.stripComment(f[h]),strip:d.stripFlags(f[h],f[h]),loc:d.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:f[h],value:f[h],loc:d.locInfo(this._$)};break;case 11:this.$=d.prepareRawBlock(f[h-2],f[h-1],f[h],this._$);break;case 12:this.$={path:f[h-3],params:f[h-2],hash:f[h-1]};break;case 13:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!1,this._$);break;case 14:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!0,this._$);break;case 15:this.$={open:f[h-5],path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 16:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 17:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 18:this.$={strip:d.stripFlags(f[h-1],f[h-1]),program:f[h]};break;case 19:var i=d.prepareBlock(f[h-2],f[h-1],f[h],f[h],!1,this._$),j=d.prepareProgram([i],f[h-1].loc);j.chained=!0,this.$={strip:f[h-2].strip,program:j,chain:!0};break;case 20:this.$=f[h];break;case 21:this.$={path:f[h-1],strip:d.stripFlags(f[h-2],f[h])};break;case 22:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 23:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 24:this.$={type:"PartialStatement",name:f[h-3],params:f[h-2],hash:f[h-1],indent:"",strip:d.stripFlags(f[h-4],f[h]),loc:d.locInfo(this._$)};break;case 25:this.$=d.preparePartialBlock(f[h-2],f[h-1],f[h],this._$);break;case 26:this.$={path:f[h-3],params:f[h-2],hash:f[h-1],strip:d.stripFlags(f[h-4],f[h])};break;case 27:this.$=f[h];break;case 28:this.$=f[h];break;case 29:this.$={type:"SubExpression",path:f[h-3],params:f[h-2],hash:f[h-1],loc:d.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:f[h],loc:d.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:d.id(f[h-2]),value:f[h],loc:d.locInfo(this._$)};break;case 32:this.$=d.id(f[h-1]);break;case 33:this.$=f[h];break;case 34:this.$=f[h];break;case 35:this.$={type:"StringLiteral",value:f[h],original:f[h],loc:d.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(f[h]),original:Number(f[h]),loc:d.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===f[h],original:"true"===f[h],loc:d.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:d.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:d.locInfo(this._$)};break;case 40:this.$=f[h];break;case 41:this.$=f[h];break;case 42:this.$=d.preparePath(!0,f[h],this._$);break;case 43:this.$=d.preparePath(!1,f[h],this._$);break;case 44:f[h-2].push({part:d.id(f[h]),original:f[h],separator:f[h-1]}),this.$=f[h-2];break;case 45:this.$=[{part:d.id(f[h]),original:f[h]}];break;case 46:this.$=[];break;case 47:f[h-1].push(f[h]);break;case 48:this.$=[f[h]];break;case 49:f[h-1].push(f[h]);break;case 50:this.$=[];break;case 51:f[h-1].push(f[h]);break;case 58:this.$=[];break;case 59:f[h-1].push(f[h]);break;case 64:this.$=[];break;case 65:f[h-1].push(f[h]);break;case 70:this.$=[];break;case 71:f[h-1].push(f[h]);break;case 78:this.$=[];break;case 79:f[h-1].push(f[h]);break;case 82:this.$=[];break;case 83:f[h-1].push(f[h]);break;case 86:this.$=[];break;case 87:f[h-1].push(f[h]);break;case 90:this.$=[];break;case 91:f[h-1].push(f[h]);break;case 94:this.$=[];break;case 95:f[h-1].push(f[h]);break;case 98:this.$=[f[h]];break;case 99:f[h-1].push(f[h]);break;case 100:this.$=[f[h]];break;case 101:f[h-1].push(f[h])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{13:40,15:[1,20],17:39},{20:42,56:41,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:45,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:48,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:42,56:49,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:50,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,51]},{72:[1,35],86:52},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:53,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:54,38:56,39:[1,58],43:57,44:[1,59],45:55,47:[2,54]},{28:60,43:61,44:[1,59],47:[2,56]},{13:63,15:[1,20],18:[1,62]},{15:[2,48],18:[2,48]},{33:[2,86],57:64,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:65,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:66,47:[1,67]},{30:68,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:69,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:70,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:71,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:75,33:[2,80],50:72,63:73,64:76,65:[1,44],69:74,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,80]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,51]},{20:75,53:81,54:[2,84],63:82,64:76,65:[1,44],69:83,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:84,47:[1,67]},{47:[2,55]},{4:85,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:86,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:87,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:88,47:[1,67]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:75,33:[2,88],58:89,63:90,64:76,65:[1,44],69:91,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:92,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:93,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,31:94,33:[2,60],63:95,64:76,65:[1,44],69:96,70:77,71:78,72:[1,79],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,66],36:97,63:98,64:76,65:[1,44],69:99,70:77,71:78,72:[1,79],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,22:100,23:[2,52],63:101,64:76,65:[1,44],69:102,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,92],62:103,63:104,64:76,65:[1,44],69:105,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,106]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:107,72:[1,108],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,109],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,110]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:56,39:[1,58],43:57,44:[1,59],45:112,46:111,47:[2,76]},{33:[2,70],40:113,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,114]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],
28
- 85:[2,87]},{33:[2,89]},{20:75,63:116,64:76,65:[1,44],67:115,68:[2,96],69:117,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,118]},{32:119,33:[2,62],74:120,75:[1,121]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:122,74:123,75:[1,121]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,124]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,125]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,109]},{20:75,63:126,64:76,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:75,33:[2,72],41:127,63:128,64:76,65:[1,44],69:129,70:77,71:78,72:[1,79],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,130]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,131]},{33:[2,63]},{72:[1,133],76:132},{33:[1,134]},{33:[2,69]},{15:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:135,74:136,75:[1,121]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,138],77:[1,137]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,139]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],55:[2,55],57:[2,20],61:[2,57],74:[2,81],83:[2,85],87:[2,18],91:[2,89],102:[2,53],105:[2,93],111:[2,19],112:[2,77],117:[2,97],120:[2,63],123:[2,69],124:[2,12],136:[2,75],137:[2,32]},parseError:function(a,b){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:(null!==n&&"undefined"!=typeof n||(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(b.yytext=b.yytext.substr(5,b.yyleng-9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return b.yytext=e(1,2).replace(/\\"/g,'"'),80;case 32:return b.yytext=e(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return b.yytext=b.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}var i=c(1)["default"];b.__esModule=!0;var j=c(39),k=i(j);d.prototype=new k["default"],d.prototype.Program=function(a){var b=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var d=a.body,i=0,j=d.length;i<j;i++){var k=d[i],l=this.accept(k);if(l){var m=e(d,i,c),n=f(d,i,c),o=l.openStandalone&&m,p=l.closeStandalone&&n,q=l.inlineStandalone&&m&&n;l.close&&g(d,i,!0),l.open&&h(d,i,!0),b&&q&&(g(d,i),h(d,i)&&"PartialStatement"===k.type&&(k.indent=/([ \t]+$)/.exec(d[i-1].original)[1])),b&&o&&(g((k.program||k.inverse).body),h(d,i)),b&&p&&(g(d,i),h((k.inverse||k.program).body))}}return a},d.prototype.BlockStatement=d.prototype.DecoratorBlock=d.prototype.PartialBlockStatement=function(a){this.accept(a.program),this.accept(a.inverse);var b=a.program||a.inverse,c=a.program&&a.inverse,d=c,i=c;if(c&&c.chained)for(d=c.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var j={open:a.openStrip.open,close:a.closeStrip.close,openStandalone:f(b.body),closeStandalone:e((d||b).body)};if(a.openStrip.close&&g(b.body,null,!0),c){var k=a.inverseStrip;k.open&&h(b.body,null,!0),k.close&&g(d.body,null,!0),a.closeStrip.open&&h(i.body,null,!0),!this.options.ignoreStandalone&&e(b.body)&&f(d.body)&&(h(b.body),g(d.body))}else a.closeStrip.open&&h(b.body,null,!0);return j},d.prototype.Decorator=d.prototype.MustacheStatement=function(a){return a.strip},d.prototype.PartialStatement=d.prototype.CommentStatement=function(a){var b=a.strip||{};return{inlineStandalone:!0,open:b.open,close:b.close}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(){this.parents=[]}function e(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function f(a){e.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function g(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}var h=c(1)["default"];b.__esModule=!0;var i=c(6),j=h(i);d.prototype={constructor:d,mutating:!1,acceptKey:function(a,b){var c=this.accept(a[b]);if(this.mutating){if(c&&!d.prototype[c.type])throw new j["default"]('Unexpected node type "'+c.type+'" found when accepting '+b+" on "+a.type);a[b]=c}},acceptRequired:function(a,b){if(this.acceptKey(a,b),!a[b])throw new j["default"](a.type+" requires "+b)},acceptArray:function(a){for(var b=0,c=a.length;b<c;b++)this.acceptKey(a,b),a[b]||(a.splice(b,1),b--,c--)},accept:function(a){if(a){if(!this[a.type])throw new j["default"]("Unknown type: "+a.type,a);this.current&&this.parents.unshift(this.current),this.current=a;var b=this[a.type](a);return this.current=this.parents.shift(),!this.mutating||b?b:b!==!1?a:void 0}},Program:function(a){this.acceptArray(a.body)},MustacheStatement:e,Decorator:e,BlockStatement:f,DecoratorBlock:f,PartialStatement:g,PartialBlockStatement:function(a){g.call(this,a),this.acceptKey(a,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:e,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(a){this.acceptArray(a.pairs)},HashPair:function(a){this.acceptRequired(a,"value")}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if(b=b.path?b.path.original:b,a.path.original!==b){var c={loc:a.path.loc};throw new q["default"](a.path.original+" doesn't match "+b,c)}}function e(a,b){this.source=a,this.start={line:b.first_line,column:b.first_column},this.end={line:b.last_line,column:b.last_column}}function f(a){return/^\[.*\]$/.test(a)?a.substr(1,a.length-2):a}function g(a,b){return{open:"~"===a.charAt(2),close:"~"===b.charAt(b.length-3)}}function h(a){return a.replace(/^\{\{~?\!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function i(a,b,c){c=this.locInfo(c);for(var d=a?"@":"",e=[],f=0,g="",h=0,i=b.length;h<i;h++){var j=b[h].part,k=b[h].original!==j;if(d+=(b[h].separator||"")+j,k||".."!==j&&"."!==j&&"this"!==j)e.push(j);else{if(e.length>0)throw new q["default"]("Invalid path: "+d,{loc:c});".."===j&&(f++,g+="../")}}return{type:"PathExpression",data:a,depth:f,parts:e,original:d,loc:c}}function j(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g,i=/\*/.test(d);return{type:i?"Decorator":"MustacheStatement",path:a,params:b,hash:c,escaped:h,strip:e,loc:this.locInfo(f)}}function k(a,b,c,e){d(a,c),e=this.locInfo(e);var f={type:"Program",body:b,strip:{},loc:e};return{type:"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:e}}function l(a,b,c,e,f,g){e&&e.path&&d(a,e);var h=/\*/.test(a.open);b.blockParams=a.blockParams;var i=void 0,j=void 0;if(c){if(h)throw new q["default"]("Unexpected inverse block on decorator",c);c.chain&&(c.program.body[0].closeStrip=e.strip),j=c.strip,i=c.program}return f&&(f=i,i=b,b=f),{type:h?"DecoratorBlock":"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:b,inverse:i,openStrip:a.strip,inverseStrip:j,closeStrip:e&&e.strip,loc:this.locInfo(g)}}function m(a,b){if(!b&&a.length){var c=a[0].loc,d=a[a.length-1].loc;c&&d&&(b={source:c.source,start:{line:c.start.line,column:c.start.column},end:{line:d.end.line,column:d.end.column}})}return{type:"Program",body:a,strip:{},loc:b}}function n(a,b,c,e){return d(a,c),{type:"PartialBlockStatement",name:a.path,params:a.params,hash:a.hash,program:b,openStrip:a.strip,closeStrip:c&&c.strip,loc:this.locInfo(e)}}var o=c(1)["default"];b.__esModule=!0,b.SourceLocation=e,b.id=f,b.stripFlags=g,b.stripComment=h,b.preparePath=i,b.prepareMustache=j,b.prepareRawBlock=k,b.prepareBlock=l,b.prepareProgram=m,b.preparePartialBlock=n;var p=c(6),q=o(p)},function(a,b,c){"use strict";function d(){}function e(a,b,c){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new k["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a,b),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function f(a,b,c){function d(){var d=c.parse(a,b),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}function e(a,b){return f||(f=d()),f.call(this,a,b)}if(void 0===b&&(b={}),null==a||"string"!=typeof a&&"Program"!==a.type)throw new k["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=l.extend({},b),"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var f=void 0;return e._setup=function(a){return f||(f=d()),f._setup(a)},e._child=function(a,b,c,e){return f||(f=d()),f._child(a,b,c,e)},e}function g(a,b){if(a===b)return!0;if(l.isArray(a)&&l.isArray(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!g(a[c],b[c]))return!1;return!0}}function h(a){if(!a.path.parts){var b=a.path;a.path={type:"PathExpression",data:!1,depth:0,parts:[b.original+""],original:b.original+"",loc:b.loc}}}var i=c(1)["default"];b.__esModule=!0,b.Compiler=d,b.precompile=e,b.compile=f;var j=c(6),k=i(j),l=c(5),m=c(35),n=i(m),o=[].slice;d.prototype={compiler:d,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;c<b;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!g(d.args,e.args))return!1}b=this.children.length;for(var c=0;c<b;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.sourceNode=[],this.opcodes=[],this.children=[],this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds,b.blockParams=b.blockParams||[];var c=b.knownHelpers;if(b.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)d in c&&(this.options.knownHelpers[d]=c[d]);return this.accept(a)},compileProgram:function(a){var b=new this.compiler,c=b.compile(a,this.options),d=this.guid++;return this.usePartial=this.usePartial||c.usePartial,this.children[d]=c,this.useDepths=this.useDepths||c.useDepths,d},accept:function(a){if(!this[a.type])throw new k["default"]("Unknown type: "+a.type,a);this.sourceNode.unshift(a);var b=this[a.type](a);return this.sourceNode.shift(),b},Program:function(a){this.options.blockParams.unshift(a.blockParams);for(var b=a.body,c=b.length,d=0;d<c;d++)this.accept(b[d]);return this.options.blockParams.shift(),this.isSimple=1===c,this.blockParams=a.blockParams?a.blockParams.length:0,this},BlockStatement:function(a){h(a);var b=a.program,c=a.inverse;b=b&&this.compileProgram(b),c=c&&this.compileProgram(c);var d=this.classifySexpr(a);"helper"===d?this.helperSexpr(a,b,c):"simple"===d?(this.simpleSexpr(a),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("blockValue",a.path.original)):(this.ambiguousSexpr(a,b,c),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(a){var b=a.program&&this.compileProgram(a.program),c=this.setupFullMustacheParams(a,b,void 0),d=a.path;this.useDecorators=!0,this.opcode("registerDecorator",c.length,d.original)},PartialStatement:function(a){this.usePartial=!0;var b=a.program;b&&(b=this.compileProgram(a.program));var c=a.params;if(c.length>1)throw new k["default"]("Unsupported number of partial arguments: "+c.length,a);c.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):c.push({type:"PathExpression",parts:[],depth:0}));var d=a.name.original,e="SubExpression"===a.name.type;e&&this.accept(a.name),this.setupFullMustacheParams(a,b,void 0,!0);var f=a.indent||"";this.options.preventIndent&&f&&(this.opcode("appendContent",f),f=""),this.opcode("invokePartial",e,d,f),this.opcode("append")},PartialBlockStatement:function(a){this.PartialStatement(a)},MustacheStatement:function(a){this.SubExpression(a),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(a){this.DecoratorBlock(a)},ContentStatement:function(a){a.value&&this.opcode("appendContent",a.value)},CommentStatement:function(){},SubExpression:function(a){h(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ambiguousSexpr:function(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),d.strict=!0,this.accept(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.path;b.strict=!0,this.accept(b),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new k["default"]("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.strict=!0,e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,n["default"].helpers.simpleId(e))}},PathExpression:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=n["default"].helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam",d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts,a.strict)):this.opcode("lookupOnContext",a.parts,a.falsy,a.strict,c):this.opcode("pushContext")},StringLiteral:function(a){this.opcode("pushString",a.value)},NumberLiteral:function(a){this.opcode("pushLiteral",a.value)},BooleanLiteral:function(a){this.opcode("pushLiteral",a.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");c<d;c++)this.pushParam(b[c].value);for(;c--;)this.opcode("assignToHash",b[c].key);this.opcode("popHash")},opcode:function(a){this.opcodes.push({opcode:a,args:o.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(a){a&&(this.useDepths=!0)},classifySexpr:function(a){var b=n["default"].helpers.simpleId(a.path),c=b&&!!this.blockParamIndex(a.path.parts[0]),d=!c&&n["default"].helpers.helperExpression(a),e=!c&&(d||b);if(e&&!d){var f=a.path.parts[0],g=this.options;g.knownHelpers[f]?d=!0:g.knownHelpersOnly&&(e=!1)}return d?"helper":e?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;b<c;b++)this.pushParam(a[b])},pushParam:function(a){var b=null!=a.value?a.value:a.original||"";if(this.stringParams)b.replace&&(b=b.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",b,a.type),"SubExpression"===a.type&&this.accept(a);else{if(this.trackIds){var c=void 0;if(!a.parts||n["default"].helpers.scopedId(a)||a.depth||(c=this.blockParamIndex(a.parts[0])),c){var d=a.parts.slice(1).join(".");this.opcode("pushId","BlockParam",c,d)}else b=a.original||b,b.replace&&(b=b.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",a.type,b)}this.accept(a)}},setupFullMustacheParams:function(a,b,c,d){var e=a.params;return this.pushParams(e),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.accept(a.hash):this.opcode("emptyHash",d),e},blockParamIndex:function(a){for(var b=0,c=this.options.blockParams.length;b<c;b++){var d=this.options.blockParams[b],e=d&&l.indexOf(d,a);if(d&&e>=0)return[b,e]}}}},function(a,b,c){"use strict";function d(a){this.value=a}function e(){}function f(a,b,c,d){var e=b.popStack(),f=0,g=c.length;for(a&&g--;f<g;f++)e=b.nameLookup(e,c[f],d);return a?[b.aliasable("container.strict"),"(",e,", ",b.quotedString(c[f]),")"]:e}var g=c(1)["default"];b.__esModule=!0;var h=c(4),i=c(6),j=g(i),k=c(5),l=c(43),m=g(l);e.prototype={nameLookup:function(a,b){return e.isValidJavaScriptVariableName(b)?[a,".",b]:[a,"[",JSON.stringify(b),"]"]},depthedLookup:function(a){return[this.aliasable("container.lookup"),'(depths, "',a,'")']},compilerInfo:function(){var a=h.COMPILER_REVISION,b=h.REVISION_CHANGES[a];return[a,b]},appendToBuffer:function(a,b,c){return k.isArray(a)||(a=[a]),a=this.source.wrap(a,b),this.environment.isSimple?["return ",a,";"]:c?["buffer += ",a,";"]:(a.appendToBuffer=!0,a)},initializeBuffer:function(){return this.quotedString("")},compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.useDepths||a.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||a.useBlockParams;var e=a.opcodes,f=void 0,g=void 0,h=void 0,i=void 0;for(h=0,i=e.length;h<i;h++)f=e[h],this.source.currentLocation=f.loc,g=g||f.loc,this[f.opcode].apply(this,f.args);if(this.source.currentLocation=g,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new j["default"]("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend("var decorators = container.decorators;\n"),this.decorators.push("return fn;"),d?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var k=this.createFunctionContext(d);if(this.isChild)return k;var l={compiler:this.compilerInfo(),main:k};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var m=this.context,n=m.programs,o=m.decorators;for(h=0,i=n.length;h<i;h++)n[h]&&(l[h]=n[h],o[h]&&(l[h+"_d"]=o[h],l.useDecorators=!0));return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),d?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),b.srcName?(l=l.toStringWithSourceMap({file:b.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new m["default"](this.options.srcName),this.decorators=new m["default"](this.options.srcName)},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));var d=0;for(var e in this.aliases){var f=this.aliases[e];this.aliases.hasOwnProperty(e)&&f.children&&f.referenceCount>1&&(b+=", alias"+ ++d+"="+e,f.children[0]="alias"+d)}var g=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&g.push("blockParams"),this.useDepths&&g.push("depths");var h=this.mergeSource(b);return a?(g.push(h),Function.apply(this,g)):this.source.wrap(["function(",g.join(","),") {\n ",h,"}"])},mergeSource:function(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend(" + "):f=a,g=a):(f&&(e?f.prepend("buffer += "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()},blockValue:function(a){var b=this.aliasable("helpers.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("helpers.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c,d){var e=0;d||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[e++])),this.resolvePath("context",a,e,b,c)},lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b,c){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,c)},resolvePath:function(a,b,c,d,e){var g=this;if(this.options.strict||this.options.assumeObjects)return void this.push(f(this.options.strict&&e,this,b,a));for(var h=b.length;c<h;c++)this.replaceStack(function(e){
29
- var f=g.nameLookup(e,b[c],a);return d?[" && ",f]:[" != null ? ",f," : ",e]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"SubExpression"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(a){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(a.ids)),this.stringParams&&(this.push(this.objectLiteral(a.contexts)),this.push(this.objectLiteral(a.types))),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},registerDecorator:function(a,b){var c=this.nameLookup("decorators",b,"decorator"),d=this.setupHelperArgs(b,a);this.decorators.push(["fn = ",this.decorators.functionCall(c,"",["fn","props","container",d])," || fn;"])},invokeHelper:function(a,b,c){var d=this.popStack(),e=this.setupHelper(a,b),f=c?[e.name," || "]:"",g=["("].concat(f,d);this.options.strict||g.push(" || ",this.aliasable("helpers.helperMissing")),g.push(")"),this.push(this.source.functionCall(g,"call",e.callParams))},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(this.source.functionCall(c.name,"call",c.callParams))},invokeAmbiguous:function(a,b){this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper"),f=["(","(helper = ",e," || ",c,")"];this.options.strict||(f[0]="(helper = ",f.push(" != null ? helper : ",this.aliasable("helpers.helperMissing"))),this.push(["(",f,d.paramsInit?["),(",d.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",d.callParams)," : helper))"])},invokePartial:function(a,b,c){var d=[],e=this.setupParams(b,1,d);a&&(b=this.popStack(),delete e.name),c&&(e.indent=JSON.stringify(c)),e.helpers="helpers",e.partials="partials",e.decorators="container.decorators",a?d.unshift(b):d.unshift(this.nameLookup("partials",b,"partial")),this.options.compat&&(e.depths="depths"),e=this.objectLiteral(e),d.push(e),this.push(this.source.functionCall("container.invokePartial","",d))},assignToHash:function(a){var b=this.popStack(),c=void 0,d=void 0,e=void 0;this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&(f.contexts[a]=c),d&&(f.types[a]=d),e&&(f.ids[a]=e),f.values[a]=b},pushId:function(a,b,c){"BlockParam"===a?this.pushStackLiteral("blockParams["+b[0]+"].path["+b[1]+"]"+(c?" + "+JSON.stringify("."+c):"")):"PathExpression"===a?this.pushString(b):"SubExpression"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:e,compileChildren:function(a,b){for(var c=a.children,d=void 0,e=void 0,f=0,g=c.length;f<g;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);if(null==h){this.context.programs.push("");var i=this.context.programs.length;d.index=i,d.name="program"+i,this.context.programs[i]=e.compile(d,b,this.context,!this.precompile),this.context.decorators[i]=e.decorators,this.context.environments[i]=d,this.useDepths=this.useDepths||e.useDepths,this.useBlockParams=this.useBlockParams||e.useBlockParams,d.useDepths=this.useDepths,d.useBlockParams=this.useBlockParams}else d.index=h.index,d.name="program"+h.index,this.useDepths=this.useDepths||h.useDepths,this.useBlockParams=this.useBlockParams||h.useBlockParams}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;b<c;b++){var d=this.context.environments[b];if(d&&d.equals(a))return d}},programExpression:function(a){var b=this.environment.children[a],c=[b.index,"data",b.blockParams];return(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths"),"container.program("+c.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof d||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new d(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var b=["("],c=void 0,e=void 0,f=void 0;if(!this.isInline())throw new j["default"]("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof d)c=[g.value],b=["(",c],f=!0;else{e=!0;var h=this.incrStack();b=["((",this.push(h)," = ",g,")"],c=this.topStack()}var i=a.call(this,c);f||this.popStack(),e&&this.stackSlot--,this.push(b.concat(i,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;b<c;b++){var e=a[b];if(e instanceof d)this.compileStack.push(e);else{var f=this.incrStack();this.pushSource([f," = ",e,";"]),this.compileStack.push(f)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof d)return c.value;if(!b){if(!this.stackSlot)throw new j["default"]("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof d?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var b=this.aliases[a];return b?(b.referenceCount++,b):(b=this.aliases[a]=this.source.wrap(a),b.aliasable=!0,b.referenceCount=1,b)},setupHelper:function(a,b,c){var d=[],e=this.setupHelperArgs(b,a,d,c),f=this.nameLookup("helpers",b,"helper"),g=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:d,paramsInit:e,name:f,callParams:[g].concat(d)}},setupParams:function(a,b,c){var d={},e=[],f=[],g=[],h=!c,i=void 0;h&&(c=[]),d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack());var j=this.popStack(),k=this.popStack();(k||j)&&(d.fn=k||"container.noop",d.inverse=j||"container.noop");for(var l=b;l--;)i=this.popStack(),c[l]=i,this.trackIds&&(g[l]=this.popStack()),this.stringParams&&(f[l]=this.popStack(),e[l]=this.popStack());return h&&(d.args=this.source.generateArray(c)),this.trackIds&&(d.ids=this.source.generateArray(g)),this.stringParams&&(d.types=this.source.generateArray(f),d.contexts=this.source.generateArray(e)),this.options.data&&(d.data="data"),this.useBlockParams&&(d.blockParams="blockParams"),d},setupHelperArgs:function(a,b,c,d){var e=this.setupParams(a,b,c);return e=this.objectLiteral(e),d?(this.useRegister("options"),c.push("options"),["options=",e]):c?(c.push(e),""):e}},function(){for(var a="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),b=e.RESERVED_WORDS={},c=0,d=a.length;c<d;c++)b[a[c]]=!0}(),e.isValidJavaScriptVariableName=function(a){return!e.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b,c){if(f.isArray(a)){for(var d=[],e=0,g=a.length;e<g;e++)d.push(b.wrap(a[e],c));return d}return"boolean"==typeof a||"number"==typeof a?a+"":a}function e(a){this.srcFile=a,this.source=[]}b.__esModule=!0;var f=c(5),g=void 0;try{}catch(h){}g||(g=function(a,b,c,d){this.src="",d&&this.add(d)},g.prototype={add:function(a){f.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){f.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),e.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,b){this.source.unshift(this.wrap(a,b))},push:function(a,b){this.source.push(this.wrap(a,b))},merge:function(){var a=this.empty();return this.each(function(b){a.add([" ",b,"\n"])}),a},each:function(a){for(var b=0,c=this.source.length;b<c;b++)a(this.source[b])},empty:function(){var a=this.currentLocation||{start:{}};return new g(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var b=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return a instanceof g?a:(a=d(a,this,b),new g(b.start.line,b.start.column,this.srcFile,a))},functionCall:function(a,b,c){return c=this.generateList(c),this.wrap([a,b?"."+b+"(":"(",c,")"])},quotedString:function(a){return'"'+(a+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)if(a.hasOwnProperty(c)){var e=d(a[c],this);"undefined"!==e&&b.push([this.quotedString(c),":",e])}var f=this.generateList(b);return f.prepend("{"),f.add("}"),f},generateList:function(a){for(var b=this.empty(),c=0,e=a.length;c<e;c++)c&&b.add(","),b.add(d(a[c],this));return b},generateArray:function(a){var b=this.generateList(a);return b.prepend("["),b.add("]"),b}},b["default"]=e,a.exports=b["default"]}])});
1
  /**!
2
 
3
  @license
4
+ handlebars v4.0.12
5
 
6
  Copyright (C) 2011-2017 by Yehuda Katz
7
 
24
  THE SOFTWARE.
25
 
26
  */
27
+ !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(){var a=r();return a.compile=function(b,c){return k.compile(b,c,a)},a.precompile=function(b,c){return k.precompile(b,c,a)},a.AST=i["default"],a.Compiler=k.Compiler,a.JavaScriptCompiler=m["default"],a.Parser=j.parser,a.parse=j.parse,a}var e=c(1)["default"];b.__esModule=!0;var f=c(2),g=e(f),h=c(35),i=e(h),j=c(36),k=c(41),l=c(42),m=e(l),n=c(39),o=e(n),p=c(34),q=e(p),r=g["default"].create,s=d();s.create=d,q["default"](s),s.Visitor=o["default"],s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0},function(a,b,c){"use strict";function d(){var a=new h.HandlebarsEnvironment;return n.extend(a,h),a.SafeString=j["default"],a.Exception=l["default"],a.Utils=n,a.escapeExpression=n.escapeExpression,a.VM=p,a.template=function(b){return p.template(b,a)},a}var e=c(3)["default"],f=c(1)["default"];b.__esModule=!0;var g=c(4),h=e(g),i=c(21),j=f(i),k=c(6),l=f(k),m=c(5),n=e(m),o=c(22),p=e(o),q=c(34),r=f(q),s=d();s.create=d,r["default"](s),s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},b.__esModule=!0},function(a,b,c){"use strict";function d(a,b,c){this.helpers=a||{},this.partials=b||{},this.decorators=c||{},i.registerDefaultHelpers(this),j.registerDefaultDecorators(this)}var e=c(1)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d;var f=c(5),g=c(6),h=e(g),i=c(10),j=c(18),k=c(20),l=e(k),m="4.0.12";b.VERSION=m;var n=7;b.COMPILER_REVISION=n;var o={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};b.REVISION_CHANGES=o;var p="[object Object]";d.prototype={constructor:d,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===p)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]}};var q=l["default"].log;b.log=q,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return k[a]}function d(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function e(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return m.test(a)?a.replace(l,c):a}function g(a){return!a&&0!==a||!(!p(a)||0!==a.length)}function h(a){var b=d({},a);return b._parent=a,b}function i(a,b){return a.path=b,a}function j(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.createFrame=h,b.blockParams=i,b.appendContextPath=j;var k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},l=/[&<>"'`=]/g,m=/[&<>"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function(a){return"function"==typeof a};o(/x/)&&(b.isFunction=o=function(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o;var p=Array.isArray||function(a){return!(!a||"object"!=typeof a)&&"[object Array]"===n.call(a)};b.isArray=p},function(a,b,c){"use strict";function d(a,b){var c=b&&b.loc,g=void 0,h=void 0;c&&(g=c.start.line,h=c.start.column,a+=" - "+g+":"+h);for(var i=Error.prototype.constructor.call(this,a),j=0;j<f.length;j++)this[f[j]]=i[f[j]];Error.captureStackTrace&&Error.captureStackTrace(this,d);try{c&&(this.lineNumber=g,e?Object.defineProperty(this,"column",{value:h,enumerable:!0}):this.column=h)}catch(k){}}var e=c(7)["default"];b.__esModule=!0;var f=["description","fileName","lineNumber","message","name","number","stack"];d.prototype=new Error,b["default"]=d,a.exports=b["default"]},function(a,b,c){a.exports={"default":c(8),__esModule:!0}},function(a,b,c){var d=c(9);a.exports=function(a,b,c){return d.setDesc(a,b,c)}},function(a,b){var c=Object;a.exports={create:c.create,getProto:c.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:c.getOwnPropertyDescriptor,setDesc:c.defineProperty,setDescs:c.defineProperties,getKeys:c.keys,getNames:c.getOwnPropertyNames,getSymbols:c.getOwnPropertySymbols,each:[].forEach}},function(a,b,c){"use strict";function d(a){g["default"](a),i["default"](a),k["default"](a),m["default"](a),o["default"](a),q["default"](a),s["default"](a)}var e=c(1)["default"];b.__esModule=!0,b.registerDefaultHelpers=d;var f=c(11),g=e(f),h=c(12),i=e(h),j=c(13),k=e(j),l=c(14),m=e(l),n=c(15),o=e(n),p=c(16),q=e(p),r=c(17),s=e(r)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("blockHelperMissing",function(b,c){var e=c.inverse,f=c.fn;if(b===!0)return f(this);if(b===!1||null==b)return e(this);if(d.isArray(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,f){j&&(j.key=b,j.index=c,j.first=0===c,j.last=!!f,k&&(j.contextPath=k+b)),i+=d(a[b],{data:j,blockParams:e.blockParams([a[b],b],[k+b,null])})}if(!b)throw new g["default"]("Must pass iterator to #each");var d=b.fn,f=b.inverse,h=0,i="",j=void 0,k=void 0;if(b.data&&b.ids&&(k=e.appendContextPath(b.data.contextPath,b.ids[0])+"."),e.isFunction(a)&&(a=a.call(this)),b.data&&(j=e.createFrame(b.data)),a&&"object"==typeof a)if(e.isArray(a))for(var l=a.length;h<l;h++)h in a&&c(h,h,h===a.length-1);else{var m=void 0;for(var n in a)a.hasOwnProperty(n)&&(void 0!==m&&c(m,h-1),m=n,h++);void 0!==m&&c(m,h-1,!0)}return 0===h&&(i=f(this)),i})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(6),f=d(e);b["default"]=function(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new f["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("if",function(a,b){return d.isFunction(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||d.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("log",function(){for(var b=[void 0],c=arguments[arguments.length-1],d=0;d<arguments.length-1;d++)b.push(arguments[d]);var e=1;null!=c.hash.level?e=c.hash.level:c.data&&null!=c.data.level&&(e=c.data.level),b[0]=e,a.log.apply(a,b)})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("lookup",function(a,b){return a&&a[b]})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("with",function(a,b){d.isFunction(a)&&(a=a.call(this));var c=b.fn;if(d.isEmpty(a))return b.inverse(this);var e=b.data;return b.data&&b.ids&&(e=d.createFrame(b.data),e.contextPath=d.appendContextPath(b.data.contextPath,b.ids[0])),c(a,{data:e,blockParams:d.blockParams([a],[e&&e.contextPath])})})},a.exports=b["default"]},function(a,b,c){"use strict";function d(a){g["default"](a)}var e=c(1)["default"];b.__esModule=!0,b.registerDefaultDecorators=d;var f=c(19),g=e(f)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerDecorator("inline",function(a,b,c,e){var f=a;return b.partials||(b.partials={},f=function(e,f){var g=c.partials;c.partials=d.extend({},g,b.partials);var h=a(e,f);return c.partials=g,h}),b.partials[e.args[0]]=e.fn,f})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5),e={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(a){if("string"==typeof a){var b=d.indexOf(e.methodMap,a.toLowerCase());a=b>=0?b:parseInt(a,10)}return a},log:function(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];console[b].apply(console,d)}}};b["default"]=e,a.exports=b["default"]},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=s.COMPILER_REVISION;if(b!==c){if(b<c){var d=s.REVISION_CHANGES[c],e=s.REVISION_CHANGES[b];throw new r["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new r["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=p.extend({},d,e.hash),e.ids&&(e.ids[0]=!0)),c=b.VM.resolvePartial.call(this,c,d,e);var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;h<i&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new r["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){function c(b){return""+a.main(e,b,e.helpers,e.partials,g,i,h)}var f=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],g=f.data;d._setup(f),!f.partial&&a.useData&&(g=j(b,g));var h=void 0,i=a.useBlockParams?[]:void 0;return a.useDepths&&(h=f.depths?b!=f.depths[0]?[b].concat(f.depths):f.depths:[b]),(c=k(a.main,c,e,f.depths||[],g,i))(b,f)}if(!b)throw new r["default"]("No environment passed to template");if(!a||!a.main)throw new r["default"]("Unknown template object: "+typeof a);a.main.decorator=a.main_d,b.VM.checkRevision(a.compiler);var e={strict:function(a,b){if(!(b in a))throw new r["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;d<c;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:p.escapeExpression,invokePartial:c,fn:function(b){var c=a[b];return c.decorator=a[b+"_d"],c},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=p.extend({},b,a)),c},nullContext:l({}),noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){c.partial?(e.helpers=c.helpers,e.partials=c.partials,e.decorators=c.decorators):(e.helpers=e.merge(c.helpers,b.helpers),a.usePartial&&(e.partials=e.merge(c.partials,b.partials)),(a.usePartial||a.useDecorators)&&(e.decorators=e.merge(c.decorators,b.decorators)))},d._child=function(b,c,d,g){if(a.useBlockParams&&!d)throw new r["default"]("must pass block params");if(a.useDepths&&!g)throw new r["default"]("must pass parent depths");return f(e,b,a[b],c,0,d,g)},d}function f(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],h=g;return!g||b==g[0]||b===a.nullContext&&null===g[0]||(h=[b].concat(g)),c(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),h)}return h=k(c,h,a,g,d,f),h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a="@partial-block"===c.name?c.data["partial-block"]:c.partials[c.name],a}function h(a,b,c){var d=c.data&&c.data["partial-block"];c.partial=!0,c.ids&&(c.data.contextPath=c.ids[0]||c.data.contextPath);var e=void 0;if(c.fn&&c.fn!==i&&!function(){c.data=s.createFrame(c.data);var a=c.fn;e=c.data["partial-block"]=function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return c.data=s.createFrame(c.data),c.data["partial-block"]=d,a(b,c)},a.partials&&(c.partials=p.extend({},c.partials,a.partials))}(),void 0===a&&e&&(a=e),void 0===a)throw new r["default"]("The partial "+c.name+" could not be found");if(a instanceof Function)return a(b,c)}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?s.createFrame(b):{},b.root=a),b}function k(a,b,c,d,e,f){if(a.decorator){var g={};b=a.decorator(b,g,c,d&&d[0],e,f,d),p.extend(b,g)}return b}var l=c(23)["default"],m=c(3)["default"],n=c(1)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var o=c(5),p=m(o),q=c(6),r=n(q),s=c(4)},function(a,b,c){a.exports={"default":c(24),__esModule:!0}},function(a,b,c){c(25),a.exports=c(30).Object.seal},function(a,b,c){var d=c(26);c(27)("seal",function(a){return function(b){return a&&d(b)?a(b):b}})},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b,c){var d=c(28),e=c(30),f=c(33);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){var d=c(29),e=c(30),f=c(31),g="prototype",h=function(a,b,c){var i,j,k,l=a&h.F,m=a&h.G,n=a&h.S,o=a&h.P,p=a&h.B,q=a&h.W,r=m?e:e[b]||(e[b]={}),s=m?d:n?d[b]:(d[b]||{})[g];m&&(c=b);for(i in c)j=!l&&s&&i in s,j&&i in r||(k=j?s[i]:c[i],r[i]=m&&"function"!=typeof s[i]?c[i]:p&&j?f(k,d):q&&s[i]==k?function(a){var b=function(b){return this instanceof a?new a(b):a(b)};return b[g]=a[g],b}(k):o&&"function"==typeof k?f(Function.call,k):k,o&&((r[g]||(r[g]={}))[i]=k))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,a.exports=h},function(a,b){var c=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=c)},function(a,b){var c=a.exports={version:"1.2.6"};"number"==typeof __e&&(__e=c)},function(a,b,c){var d=c(32);a.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b){(function(c){"use strict";b.__esModule=!0,b["default"]=function(a){var b="undefined"!=typeof c?c:window,d=b.Handlebars;a.noConflict=function(){return b.Handlebars===a&&(b.Handlebars=d),a}},a.exports=b["default"]}).call(b,function(){return this}())},function(a,b){"use strict";b.__esModule=!0;var c={helpers:{helperExpression:function(a){return"SubExpression"===a.type||("MustacheStatement"===a.type||"BlockStatement"===a.type)&&!!(a.params&&a.params.length||a.hash)},scopedId:function(a){return/^\.|this\b/.test(a.original)},simpleId:function(a){return 1===a.parts.length&&!c.helpers.scopedId(a)&&!a.depth}}};b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if("Program"===a.type)return a;h["default"].yy=n,n.locInfo=function(a){return new n.SourceLocation(b&&b.srcName,a)};var c=new j["default"](b);return c.accept(h["default"].parse(a))}var e=c(1)["default"],f=c(3)["default"];b.__esModule=!0,b.parse=d;var g=c(37),h=e(g),i=c(38),j=e(i),k=c(40),l=f(k),m=c(5);b.parser=h["default"];var n={};m.extend(n,l)},function(a,b){"use strict";b.__esModule=!0;var c=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition_plus0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,1],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 2:this.$=d.prepareProgram(f[h]);break;case 3:this.$=f[h];break;case 4:this.$=f[h];break;case 5:this.$=f[h];break;case 6:this.$=f[h];break;case 7:this.$=f[h];break;case 8:this.$=f[h];break;case 9:this.$={type:"CommentStatement",value:d.stripComment(f[h]),strip:d.stripFlags(f[h],f[h]),loc:d.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:f[h],value:f[h],loc:d.locInfo(this._$)};break;case 11:this.$=d.prepareRawBlock(f[h-2],f[h-1],f[h],this._$);break;case 12:this.$={path:f[h-3],params:f[h-2],hash:f[h-1]};break;case 13:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!1,this._$);break;case 14:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!0,this._$);break;case 15:this.$={open:f[h-5],path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 16:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 17:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 18:this.$={strip:d.stripFlags(f[h-1],f[h-1]),program:f[h]};break;case 19:var i=d.prepareBlock(f[h-2],f[h-1],f[h],f[h],!1,this._$),j=d.prepareProgram([i],f[h-1].loc);j.chained=!0,this.$={strip:f[h-2].strip,program:j,chain:!0};break;case 20:this.$=f[h];break;case 21:this.$={path:f[h-1],strip:d.stripFlags(f[h-2],f[h])};break;case 22:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 23:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 24:this.$={type:"PartialStatement",name:f[h-3],params:f[h-2],hash:f[h-1],indent:"",strip:d.stripFlags(f[h-4],f[h]),loc:d.locInfo(this._$)};break;case 25:this.$=d.preparePartialBlock(f[h-2],f[h-1],f[h],this._$);break;case 26:this.$={path:f[h-3],params:f[h-2],hash:f[h-1],strip:d.stripFlags(f[h-4],f[h])};break;case 27:this.$=f[h];break;case 28:this.$=f[h];break;case 29:this.$={type:"SubExpression",path:f[h-3],params:f[h-2],hash:f[h-1],loc:d.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:f[h],loc:d.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:d.id(f[h-2]),value:f[h],loc:d.locInfo(this._$)};break;case 32:this.$=d.id(f[h-1]);break;case 33:this.$=f[h];break;case 34:this.$=f[h];break;case 35:this.$={type:"StringLiteral",value:f[h],original:f[h],loc:d.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(f[h]),original:Number(f[h]),loc:d.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===f[h],original:"true"===f[h],loc:d.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:d.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:d.locInfo(this._$)};break;case 40:this.$=f[h];break;case 41:this.$=f[h];break;case 42:this.$=d.preparePath(!0,f[h],this._$);break;case 43:this.$=d.preparePath(!1,f[h],this._$);break;case 44:f[h-2].push({part:d.id(f[h]),original:f[h],separator:f[h-1]}),this.$=f[h-2];break;case 45:this.$=[{part:d.id(f[h]),original:f[h]}];break;case 46:this.$=[];break;case 47:f[h-1].push(f[h]);break;case 48:this.$=[f[h]];break;case 49:f[h-1].push(f[h]);break;case 50:this.$=[];break;case 51:f[h-1].push(f[h]);break;case 58:this.$=[];break;case 59:f[h-1].push(f[h]);break;case 64:this.$=[];break;case 65:f[h-1].push(f[h]);break;case 70:this.$=[];break;case 71:f[h-1].push(f[h]);break;case 78:this.$=[];break;case 79:f[h-1].push(f[h]);break;case 82:this.$=[];break;case 83:f[h-1].push(f[h]);break;case 86:this.$=[];break;case 87:f[h-1].push(f[h]);break;case 90:this.$=[];break;case 91:f[h-1].push(f[h]);break;case 94:this.$=[];break;case 95:f[h-1].push(f[h]);break;case 98:this.$=[f[h]];break;case 99:f[h-1].push(f[h]);break;case 100:this.$=[f[h]];break;case 101:f[h-1].push(f[h])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{13:40,15:[1,20],17:39},{20:42,56:41,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:45,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:48,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:42,56:49,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:50,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,51]},{72:[1,35],86:52},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:53,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:54,38:56,39:[1,58],43:57,44:[1,59],45:55,47:[2,54]},{28:60,43:61,44:[1,59],47:[2,56]},{13:63,15:[1,20],18:[1,62]},{15:[2,48],18:[2,48]},{33:[2,86],57:64,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:65,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:66,47:[1,67]},{30:68,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:69,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:70,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:71,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:75,33:[2,80],50:72,63:73,64:76,65:[1,44],69:74,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,80]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,51]},{20:75,53:81,54:[2,84],63:82,64:76,65:[1,44],69:83,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:84,47:[1,67]},{47:[2,55]},{4:85,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:86,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:87,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:88,47:[1,67]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:75,33:[2,88],58:89,63:90,64:76,65:[1,44],69:91,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:92,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:93,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,31:94,33:[2,60],63:95,64:76,65:[1,44],69:96,70:77,71:78,72:[1,79],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,66],36:97,63:98,64:76,65:[1,44],69:99,70:77,71:78,72:[1,79],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,22:100,23:[2,52],63:101,64:76,65:[1,44],69:102,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,92],62:103,63:104,64:76,65:[1,44],69:105,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,106]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:107,72:[1,108],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,109],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,110]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:56,39:[1,58],43:57,44:[1,59],45:112,46:111,47:[2,76]},{33:[2,70],40:113,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,114]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],
28
+ 85:[2,87]},{33:[2,89]},{20:75,63:116,64:76,65:[1,44],67:115,68:[2,96],69:117,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,118]},{32:119,33:[2,62],74:120,75:[1,121]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:122,74:123,75:[1,121]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,124]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,125]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,109]},{20:75,63:126,64:76,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:75,33:[2,72],41:127,63:128,64:76,65:[1,44],69:129,70:77,71:78,72:[1,79],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,130]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,131]},{33:[2,63]},{72:[1,133],76:132},{33:[1,134]},{33:[2,69]},{15:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:135,74:136,75:[1,121]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,138],77:[1,137]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,139]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],55:[2,55],57:[2,20],61:[2,57],74:[2,81],83:[2,85],87:[2,18],91:[2,89],102:[2,53],105:[2,93],111:[2,19],112:[2,77],117:[2,97],120:[2,63],123:[2,69],124:[2,12],136:[2,75],137:[2,32]},parseError:function(a,b){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:(null!==n&&"undefined"!=typeof n||(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(b.yytext=b.yytext.substr(5,b.yyleng-9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return b.yytext=e(1,2).replace(/\\"/g,'"'),80;case 32:return b.yytext=e(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return b.yytext=b.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}var i=c(1)["default"];b.__esModule=!0;var j=c(39),k=i(j);d.prototype=new k["default"],d.prototype.Program=function(a){var b=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var d=a.body,i=0,j=d.length;i<j;i++){var k=d[i],l=this.accept(k);if(l){var m=e(d,i,c),n=f(d,i,c),o=l.openStandalone&&m,p=l.closeStandalone&&n,q=l.inlineStandalone&&m&&n;l.close&&g(d,i,!0),l.open&&h(d,i,!0),b&&q&&(g(d,i),h(d,i)&&"PartialStatement"===k.type&&(k.indent=/([ \t]+$)/.exec(d[i-1].original)[1])),b&&o&&(g((k.program||k.inverse).body),h(d,i)),b&&p&&(g(d,i),h((k.inverse||k.program).body))}}return a},d.prototype.BlockStatement=d.prototype.DecoratorBlock=d.prototype.PartialBlockStatement=function(a){this.accept(a.program),this.accept(a.inverse);var b=a.program||a.inverse,c=a.program&&a.inverse,d=c,i=c;if(c&&c.chained)for(d=c.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var j={open:a.openStrip.open,close:a.closeStrip.close,openStandalone:f(b.body),closeStandalone:e((d||b).body)};if(a.openStrip.close&&g(b.body,null,!0),c){var k=a.inverseStrip;k.open&&h(b.body,null,!0),k.close&&g(d.body,null,!0),a.closeStrip.open&&h(i.body,null,!0),!this.options.ignoreStandalone&&e(b.body)&&f(d.body)&&(h(b.body),g(d.body))}else a.closeStrip.open&&h(b.body,null,!0);return j},d.prototype.Decorator=d.prototype.MustacheStatement=function(a){return a.strip},d.prototype.PartialStatement=d.prototype.CommentStatement=function(a){var b=a.strip||{};return{inlineStandalone:!0,open:b.open,close:b.close}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(){this.parents=[]}function e(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function f(a){e.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function g(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}var h=c(1)["default"];b.__esModule=!0;var i=c(6),j=h(i);d.prototype={constructor:d,mutating:!1,acceptKey:function(a,b){var c=this.accept(a[b]);if(this.mutating){if(c&&!d.prototype[c.type])throw new j["default"]('Unexpected node type "'+c.type+'" found when accepting '+b+" on "+a.type);a[b]=c}},acceptRequired:function(a,b){if(this.acceptKey(a,b),!a[b])throw new j["default"](a.type+" requires "+b)},acceptArray:function(a){for(var b=0,c=a.length;b<c;b++)this.acceptKey(a,b),a[b]||(a.splice(b,1),b--,c--)},accept:function(a){if(a){if(!this[a.type])throw new j["default"]("Unknown type: "+a.type,a);this.current&&this.parents.unshift(this.current),this.current=a;var b=this[a.type](a);return this.current=this.parents.shift(),!this.mutating||b?b:b!==!1?a:void 0}},Program:function(a){this.acceptArray(a.body)},MustacheStatement:e,Decorator:e,BlockStatement:f,DecoratorBlock:f,PartialStatement:g,PartialBlockStatement:function(a){g.call(this,a),this.acceptKey(a,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:e,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(a){this.acceptArray(a.pairs)},HashPair:function(a){this.acceptRequired(a,"value")}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if(b=b.path?b.path.original:b,a.path.original!==b){var c={loc:a.path.loc};throw new q["default"](a.path.original+" doesn't match "+b,c)}}function e(a,b){this.source=a,this.start={line:b.first_line,column:b.first_column},this.end={line:b.last_line,column:b.last_column}}function f(a){return/^\[.*\]$/.test(a)?a.substr(1,a.length-2):a}function g(a,b){return{open:"~"===a.charAt(2),close:"~"===b.charAt(b.length-3)}}function h(a){return a.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function i(a,b,c){c=this.locInfo(c);for(var d=a?"@":"",e=[],f=0,g=0,h=b.length;g<h;g++){var i=b[g].part,j=b[g].original!==i;if(d+=(b[g].separator||"")+i,j||".."!==i&&"."!==i&&"this"!==i)e.push(i);else{if(e.length>0)throw new q["default"]("Invalid path: "+d,{loc:c});".."===i&&f++}}return{type:"PathExpression",data:a,depth:f,parts:e,original:d,loc:c}}function j(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g,i=/\*/.test(d);return{type:i?"Decorator":"MustacheStatement",path:a,params:b,hash:c,escaped:h,strip:e,loc:this.locInfo(f)}}function k(a,b,c,e){d(a,c),e=this.locInfo(e);var f={type:"Program",body:b,strip:{},loc:e};return{type:"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:e}}function l(a,b,c,e,f,g){e&&e.path&&d(a,e);var h=/\*/.test(a.open);b.blockParams=a.blockParams;var i=void 0,j=void 0;if(c){if(h)throw new q["default"]("Unexpected inverse block on decorator",c);c.chain&&(c.program.body[0].closeStrip=e.strip),j=c.strip,i=c.program}return f&&(f=i,i=b,b=f),{type:h?"DecoratorBlock":"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:b,inverse:i,openStrip:a.strip,inverseStrip:j,closeStrip:e&&e.strip,loc:this.locInfo(g)}}function m(a,b){if(!b&&a.length){var c=a[0].loc,d=a[a.length-1].loc;c&&d&&(b={source:c.source,start:{line:c.start.line,column:c.start.column},end:{line:d.end.line,column:d.end.column}})}return{type:"Program",body:a,strip:{},loc:b}}function n(a,b,c,e){return d(a,c),{type:"PartialBlockStatement",name:a.path,params:a.params,hash:a.hash,program:b,openStrip:a.strip,closeStrip:c&&c.strip,loc:this.locInfo(e)}}var o=c(1)["default"];b.__esModule=!0,b.SourceLocation=e,b.id=f,b.stripFlags=g,b.stripComment=h,b.preparePath=i,b.prepareMustache=j,b.prepareRawBlock=k,b.prepareBlock=l,b.prepareProgram=m,b.preparePartialBlock=n;var p=c(6),q=o(p)},function(a,b,c){"use strict";function d(){}function e(a,b,c){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new k["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a,b),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function f(a,b,c){function d(){var d=c.parse(a,b),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}function e(a,b){return f||(f=d()),f.call(this,a,b)}if(void 0===b&&(b={}),null==a||"string"!=typeof a&&"Program"!==a.type)throw new k["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=l.extend({},b),"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var f=void 0;return e._setup=function(a){return f||(f=d()),f._setup(a)},e._child=function(a,b,c,e){return f||(f=d()),f._child(a,b,c,e)},e}function g(a,b){if(a===b)return!0;if(l.isArray(a)&&l.isArray(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!g(a[c],b[c]))return!1;return!0}}function h(a){if(!a.path.parts){var b=a.path;a.path={type:"PathExpression",data:!1,depth:0,parts:[b.original+""],original:b.original+"",loc:b.loc}}}var i=c(1)["default"];b.__esModule=!0,b.Compiler=d,b.precompile=e,b.compile=f;var j=c(6),k=i(j),l=c(5),m=c(35),n=i(m),o=[].slice;d.prototype={compiler:d,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;c<b;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!g(d.args,e.args))return!1}b=this.children.length;for(var c=0;c<b;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.sourceNode=[],this.opcodes=[],this.children=[],this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds,b.blockParams=b.blockParams||[];var c=b.knownHelpers;if(b.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},compileProgram:function(a){var b=new this.compiler,c=b.compile(a,this.options),d=this.guid++;return this.usePartial=this.usePartial||c.usePartial,this.children[d]=c,this.useDepths=this.useDepths||c.useDepths,d},accept:function(a){if(!this[a.type])throw new k["default"]("Unknown type: "+a.type,a);this.sourceNode.unshift(a);var b=this[a.type](a);return this.sourceNode.shift(),b},Program:function(a){this.options.blockParams.unshift(a.blockParams);for(var b=a.body,c=b.length,d=0;d<c;d++)this.accept(b[d]);return this.options.blockParams.shift(),this.isSimple=1===c,this.blockParams=a.blockParams?a.blockParams.length:0,this},BlockStatement:function(a){h(a);var b=a.program,c=a.inverse;b=b&&this.compileProgram(b),c=c&&this.compileProgram(c);var d=this.classifySexpr(a);"helper"===d?this.helperSexpr(a,b,c):"simple"===d?(this.simpleSexpr(a),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("blockValue",a.path.original)):(this.ambiguousSexpr(a,b,c),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(a){var b=a.program&&this.compileProgram(a.program),c=this.setupFullMustacheParams(a,b,void 0),d=a.path;this.useDecorators=!0,this.opcode("registerDecorator",c.length,d.original)},PartialStatement:function(a){this.usePartial=!0;var b=a.program;b&&(b=this.compileProgram(a.program));var c=a.params;if(c.length>1)throw new k["default"]("Unsupported number of partial arguments: "+c.length,a);c.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):c.push({type:"PathExpression",parts:[],depth:0}));var d=a.name.original,e="SubExpression"===a.name.type;e&&this.accept(a.name),this.setupFullMustacheParams(a,b,void 0,!0);var f=a.indent||"";this.options.preventIndent&&f&&(this.opcode("appendContent",f),f=""),this.opcode("invokePartial",e,d,f),this.opcode("append")},PartialBlockStatement:function(a){this.PartialStatement(a)},MustacheStatement:function(a){this.SubExpression(a),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(a){this.DecoratorBlock(a)},ContentStatement:function(a){a.value&&this.opcode("appendContent",a.value)},CommentStatement:function(){},SubExpression:function(a){h(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ambiguousSexpr:function(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),d.strict=!0,this.accept(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.path;b.strict=!0,this.accept(b),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new k["default"]("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.strict=!0,e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,n["default"].helpers.simpleId(e))}},PathExpression:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=n["default"].helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam",d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts,a.strict)):this.opcode("lookupOnContext",a.parts,a.falsy,a.strict,c):this.opcode("pushContext")},StringLiteral:function(a){this.opcode("pushString",a.value)},NumberLiteral:function(a){this.opcode("pushLiteral",a.value)},BooleanLiteral:function(a){this.opcode("pushLiteral",a.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");c<d;c++)this.pushParam(b[c].value);for(;c--;)this.opcode("assignToHash",b[c].key);this.opcode("popHash")},opcode:function(a){this.opcodes.push({opcode:a,args:o.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(a){a&&(this.useDepths=!0)},classifySexpr:function(a){var b=n["default"].helpers.simpleId(a.path),c=b&&!!this.blockParamIndex(a.path.parts[0]),d=!c&&n["default"].helpers.helperExpression(a),e=!c&&(d||b);if(e&&!d){var f=a.path.parts[0],g=this.options;g.knownHelpers[f]?d=!0:g.knownHelpersOnly&&(e=!1)}return d?"helper":e?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;b<c;b++)this.pushParam(a[b])},pushParam:function(a){var b=null!=a.value?a.value:a.original||"";if(this.stringParams)b.replace&&(b=b.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",b,a.type),"SubExpression"===a.type&&this.accept(a);else{if(this.trackIds){var c=void 0;if(!a.parts||n["default"].helpers.scopedId(a)||a.depth||(c=this.blockParamIndex(a.parts[0])),c){var d=a.parts.slice(1).join(".");this.opcode("pushId","BlockParam",c,d)}else b=a.original||b,b.replace&&(b=b.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",a.type,b)}this.accept(a)}},setupFullMustacheParams:function(a,b,c,d){var e=a.params;return this.pushParams(e),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.accept(a.hash):this.opcode("emptyHash",d),e},blockParamIndex:function(a){for(var b=0,c=this.options.blockParams.length;b<c;b++){var d=this.options.blockParams[b],e=d&&l.indexOf(d,a);if(d&&e>=0)return[b,e]}}}},function(a,b,c){"use strict";function d(a){this.value=a}function e(){}function f(a,b,c,d){var e=b.popStack(),f=0,g=c.length;for(a&&g--;f<g;f++)e=b.nameLookup(e,c[f],d);return a?[b.aliasable("container.strict"),"(",e,", ",b.quotedString(c[f]),")"]:e}var g=c(1)["default"];b.__esModule=!0;var h=c(4),i=c(6),j=g(i),k=c(5),l=c(43),m=g(l);e.prototype={nameLookup:function(a,b){return e.isValidJavaScriptVariableName(b)?[a,".",b]:[a,"[",JSON.stringify(b),"]"]},depthedLookup:function(a){return[this.aliasable("container.lookup"),'(depths, "',a,'")']},compilerInfo:function(){var a=h.COMPILER_REVISION,b=h.REVISION_CHANGES[a];return[a,b]},appendToBuffer:function(a,b,c){return k.isArray(a)||(a=[a]),a=this.source.wrap(a,b),this.environment.isSimple?["return ",a,";"]:c?["buffer += ",a,";"]:(a.appendToBuffer=!0,a)},initializeBuffer:function(){return this.quotedString("")},compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.useDepths||a.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||a.useBlockParams;var e=a.opcodes,f=void 0,g=void 0,h=void 0,i=void 0;for(h=0,i=e.length;h<i;h++)f=e[h],this.source.currentLocation=f.loc,g=g||f.loc,this[f.opcode].apply(this,f.args);if(this.source.currentLocation=g,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new j["default"]("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend("var decorators = container.decorators;\n"),this.decorators.push("return fn;"),d?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var k=this.createFunctionContext(d);if(this.isChild)return k;var l={compiler:this.compilerInfo(),main:k};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var m=this.context,n=m.programs,o=m.decorators;for(h=0,i=n.length;h<i;h++)n[h]&&(l[h]=n[h],o[h]&&(l[h+"_d"]=o[h],l.useDecorators=!0));return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),d?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),b.srcName?(l=l.toStringWithSourceMap({file:b.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new m["default"](this.options.srcName),this.decorators=new m["default"](this.options.srcName)},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));var d=0;for(var e in this.aliases){var f=this.aliases[e];this.aliases.hasOwnProperty(e)&&f.children&&f.referenceCount>1&&(b+=", alias"+ ++d+"="+e,f.children[0]="alias"+d)}var g=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&g.push("blockParams"),this.useDepths&&g.push("depths");var h=this.mergeSource(b);return a?(g.push(h),Function.apply(this,g)):this.source.wrap(["function(",g.join(","),") {\n ",h,"}"])},mergeSource:function(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend(" + "):f=a,g=a):(f&&(e?f.prepend("buffer += "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()},blockValue:function(a){var b=this.aliasable("helpers.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("helpers.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c,d){var e=0;d||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[e++])),this.resolvePath("context",a,e,b,c)},lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b,c){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,c)},resolvePath:function(a,b,c,d,e){var g=this;if(this.options.strict||this.options.assumeObjects)return void this.push(f(this.options.strict&&e,this,b,a));for(var h=b.length;c<h;c++)this.replaceStack(function(e){var f=g.nameLookup(e,b[c],a);
29
+ return d?[" && ",f]:[" != null ? ",f," : ",e]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"SubExpression"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(a){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(a.ids)),this.stringParams&&(this.push(this.objectLiteral(a.contexts)),this.push(this.objectLiteral(a.types))),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},registerDecorator:function(a,b){var c=this.nameLookup("decorators",b,"decorator"),d=this.setupHelperArgs(b,a);this.decorators.push(["fn = ",this.decorators.functionCall(c,"",["fn","props","container",d])," || fn;"])},invokeHelper:function(a,b,c){var d=this.popStack(),e=this.setupHelper(a,b),f=c?[e.name," || "]:"",g=["("].concat(f,d);this.options.strict||g.push(" || ",this.aliasable("helpers.helperMissing")),g.push(")"),this.push(this.source.functionCall(g,"call",e.callParams))},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(this.source.functionCall(c.name,"call",c.callParams))},invokeAmbiguous:function(a,b){this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper"),f=["(","(helper = ",e," || ",c,")"];this.options.strict||(f[0]="(helper = ",f.push(" != null ? helper : ",this.aliasable("helpers.helperMissing"))),this.push(["(",f,d.paramsInit?["),(",d.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",d.callParams)," : helper))"])},invokePartial:function(a,b,c){var d=[],e=this.setupParams(b,1,d);a&&(b=this.popStack(),delete e.name),c&&(e.indent=JSON.stringify(c)),e.helpers="helpers",e.partials="partials",e.decorators="container.decorators",a?d.unshift(b):d.unshift(this.nameLookup("partials",b,"partial")),this.options.compat&&(e.depths="depths"),e=this.objectLiteral(e),d.push(e),this.push(this.source.functionCall("container.invokePartial","",d))},assignToHash:function(a){var b=this.popStack(),c=void 0,d=void 0,e=void 0;this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&(f.contexts[a]=c),d&&(f.types[a]=d),e&&(f.ids[a]=e),f.values[a]=b},pushId:function(a,b,c){"BlockParam"===a?this.pushStackLiteral("blockParams["+b[0]+"].path["+b[1]+"]"+(c?" + "+JSON.stringify("."+c):"")):"PathExpression"===a?this.pushString(b):"SubExpression"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:e,compileChildren:function(a,b){for(var c=a.children,d=void 0,e=void 0,f=0,g=c.length;f<g;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);if(null==h){this.context.programs.push("");var i=this.context.programs.length;d.index=i,d.name="program"+i,this.context.programs[i]=e.compile(d,b,this.context,!this.precompile),this.context.decorators[i]=e.decorators,this.context.environments[i]=d,this.useDepths=this.useDepths||e.useDepths,this.useBlockParams=this.useBlockParams||e.useBlockParams,d.useDepths=this.useDepths,d.useBlockParams=this.useBlockParams}else d.index=h.index,d.name="program"+h.index,this.useDepths=this.useDepths||h.useDepths,this.useBlockParams=this.useBlockParams||h.useBlockParams}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;b<c;b++){var d=this.context.environments[b];if(d&&d.equals(a))return d}},programExpression:function(a){var b=this.environment.children[a],c=[b.index,"data",b.blockParams];return(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths"),"container.program("+c.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof d||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new d(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var b=["("],c=void 0,e=void 0,f=void 0;if(!this.isInline())throw new j["default"]("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof d)c=[g.value],b=["(",c],f=!0;else{e=!0;var h=this.incrStack();b=["((",this.push(h)," = ",g,")"],c=this.topStack()}var i=a.call(this,c);f||this.popStack(),e&&this.stackSlot--,this.push(b.concat(i,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;b<c;b++){var e=a[b];if(e instanceof d)this.compileStack.push(e);else{var f=this.incrStack();this.pushSource([f," = ",e,";"]),this.compileStack.push(f)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof d)return c.value;if(!b){if(!this.stackSlot)throw new j["default"]("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof d?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var b=this.aliases[a];return b?(b.referenceCount++,b):(b=this.aliases[a]=this.source.wrap(a),b.aliasable=!0,b.referenceCount=1,b)},setupHelper:function(a,b,c){var d=[],e=this.setupHelperArgs(b,a,d,c),f=this.nameLookup("helpers",b,"helper"),g=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:d,paramsInit:e,name:f,callParams:[g].concat(d)}},setupParams:function(a,b,c){var d={},e=[],f=[],g=[],h=!c,i=void 0;h&&(c=[]),d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack());var j=this.popStack(),k=this.popStack();(k||j)&&(d.fn=k||"container.noop",d.inverse=j||"container.noop");for(var l=b;l--;)i=this.popStack(),c[l]=i,this.trackIds&&(g[l]=this.popStack()),this.stringParams&&(f[l]=this.popStack(),e[l]=this.popStack());return h&&(d.args=this.source.generateArray(c)),this.trackIds&&(d.ids=this.source.generateArray(g)),this.stringParams&&(d.types=this.source.generateArray(f),d.contexts=this.source.generateArray(e)),this.options.data&&(d.data="data"),this.useBlockParams&&(d.blockParams="blockParams"),d},setupHelperArgs:function(a,b,c,d){var e=this.setupParams(a,b,c);return e=this.objectLiteral(e),d?(this.useRegister("options"),c.push("options"),["options=",e]):c?(c.push(e),""):e}},function(){for(var a="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),b=e.RESERVED_WORDS={},c=0,d=a.length;c<d;c++)b[a[c]]=!0}(),e.isValidJavaScriptVariableName=function(a){return!e.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b,c){if(f.isArray(a)){for(var d=[],e=0,g=a.length;e<g;e++)d.push(b.wrap(a[e],c));return d}return"boolean"==typeof a||"number"==typeof a?a+"":a}function e(a){this.srcFile=a,this.source=[]}b.__esModule=!0;var f=c(5),g=void 0;try{}catch(h){}g||(g=function(a,b,c,d){this.src="",d&&this.add(d)},g.prototype={add:function(a){f.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){f.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),e.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,b){this.source.unshift(this.wrap(a,b))},push:function(a,b){this.source.push(this.wrap(a,b))},merge:function(){var a=this.empty();return this.each(function(b){a.add([" ",b,"\n"])}),a},each:function(a){for(var b=0,c=this.source.length;b<c;b++)a(this.source[b])},empty:function(){var a=this.currentLocation||{start:{}};return new g(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var b=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return a instanceof g?a:(a=d(a,this,b),new g(b.start.line,b.start.column,this.srcFile,a))},functionCall:function(a,b,c){return c=this.generateList(c),this.wrap([a,b?"."+b+"(":"(",c,")"])},quotedString:function(a){return'"'+(a+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)if(a.hasOwnProperty(c)){var e=d(a[c],this);"undefined"!==e&&b.push([this.quotedString(c),":",e])}var f=this.generateList(b);return f.prepend("{"),f.add("}"),f},generateList:function(a){for(var b=this.empty(),c=0,e=a.length;c<e;c++)c&&b.add(","),b.add(d(a[c],this));return b},generateArray:function(a){var b=this.generateList(a);return b.prepend("["),b.add("]"),b}},b["default"]=e,a.exports=b["default"]}])});
js/handlebars/handlebars.runtime.js CHANGED
@@ -1,7 +1,7 @@
1
  /**!
2
 
3
  @license
4
- handlebars v4.0.11
5
 
6
  Copyright (C) 2011-2017 by Yehuda Katz
7
 
@@ -207,7 +207,7 @@ return /******/ (function(modules) { // webpackBootstrap
207
 
208
  var _logger2 = _interopRequireDefault(_logger);
209
 
210
- var VERSION = '4.0.11';
211
  exports.VERSION = VERSION;
212
  var COMPILER_REVISION = 7;
213
 
1
  /**!
2
 
3
  @license
4
+ handlebars v4.0.12
5
 
6
  Copyright (C) 2011-2017 by Yehuda Katz
7
 
207
 
208
  var _logger2 = _interopRequireDefault(_logger);
209
 
210
+ var VERSION = '4.0.12';
211
  exports.VERSION = VERSION;
212
  var COMPILER_REVISION = 7;
213
 
js/handlebars/handlebars.runtime.min.js CHANGED
@@ -1,7 +1,7 @@
1
  /**!
2
 
3
  @license
4
- handlebars v4.0.11
5
 
6
  Copyright (C) 2011-2017 by Yehuda Katz
7
 
@@ -24,4 +24,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
  THE SOFTWARE.
25
 
26
  */
27
- !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(){var a=new h.HandlebarsEnvironment;return n.extend(a,h),a.SafeString=j["default"],a.Exception=l["default"],a.Utils=n,a.escapeExpression=n.escapeExpression,a.VM=p,a.template=function(b){return p.template(b,a)},a}var e=c(1)["default"],f=c(2)["default"];b.__esModule=!0;var g=c(3),h=e(g),i=c(20),j=f(i),k=c(5),l=f(k),m=c(4),n=e(m),o=c(21),p=e(o),q=c(33),r=f(q),s=d();s.create=d,r["default"](s),s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},b.__esModule=!0},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0},function(a,b,c){"use strict";function d(a,b,c){this.helpers=a||{},this.partials=b||{},this.decorators=c||{},i.registerDefaultHelpers(this),j.registerDefaultDecorators(this)}var e=c(2)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d;var f=c(4),g=c(5),h=e(g),i=c(9),j=c(17),k=c(19),l=e(k),m="4.0.11";b.VERSION=m;var n=7;b.COMPILER_REVISION=n;var o={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};b.REVISION_CHANGES=o;var p="[object Object]";d.prototype={constructor:d,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===p)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]}};var q=l["default"].log;b.log=q,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return k[a]}function d(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function e(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return m.test(a)?a.replace(l,c):a}function g(a){return!a&&0!==a||!(!p(a)||0!==a.length)}function h(a){var b=d({},a);return b._parent=a,b}function i(a,b){return a.path=b,a}function j(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.createFrame=h,b.blockParams=i,b.appendContextPath=j;var k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},l=/[&<>"'`=]/g,m=/[&<>"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function(a){return"function"==typeof a};o(/x/)&&(b.isFunction=o=function(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o;var p=Array.isArray||function(a){return!(!a||"object"!=typeof a)&&"[object Array]"===n.call(a)};b.isArray=p},function(a,b,c){"use strict";function d(a,b){var c=b&&b.loc,g=void 0,h=void 0;c&&(g=c.start.line,h=c.start.column,a+=" - "+g+":"+h);for(var i=Error.prototype.constructor.call(this,a),j=0;j<f.length;j++)this[f[j]]=i[f[j]];Error.captureStackTrace&&Error.captureStackTrace(this,d);try{c&&(this.lineNumber=g,e?Object.defineProperty(this,"column",{value:h,enumerable:!0}):this.column=h)}catch(k){}}var e=c(6)["default"];b.__esModule=!0;var f=["description","fileName","lineNumber","message","name","number","stack"];d.prototype=new Error,b["default"]=d,a.exports=b["default"]},function(a,b,c){a.exports={"default":c(7),__esModule:!0}},function(a,b,c){var d=c(8);a.exports=function(a,b,c){return d.setDesc(a,b,c)}},function(a,b){var c=Object;a.exports={create:c.create,getProto:c.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:c.getOwnPropertyDescriptor,setDesc:c.defineProperty,setDescs:c.defineProperties,getKeys:c.keys,getNames:c.getOwnPropertyNames,getSymbols:c.getOwnPropertySymbols,each:[].forEach}},function(a,b,c){"use strict";function d(a){g["default"](a),i["default"](a),k["default"](a),m["default"](a),o["default"](a),q["default"](a),s["default"](a)}var e=c(2)["default"];b.__esModule=!0,b.registerDefaultHelpers=d;var f=c(10),g=e(f),h=c(11),i=e(h),j=c(12),k=e(j),l=c(13),m=e(l),n=c(14),o=e(n),p=c(15),q=e(p),r=c(16),s=e(r)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(4);b["default"]=function(a){a.registerHelper("blockHelperMissing",function(b,c){var e=c.inverse,f=c.fn;if(b===!0)return f(this);if(b===!1||null==b)return e(this);if(d.isArray(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(2)["default"];b.__esModule=!0;var e=c(4),f=c(5),g=d(f);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,f){j&&(j.key=b,j.index=c,j.first=0===c,j.last=!!f,k&&(j.contextPath=k+b)),i+=d(a[b],{data:j,blockParams:e.blockParams([a[b],b],[k+b,null])})}if(!b)throw new g["default"]("Must pass iterator to #each");var d=b.fn,f=b.inverse,h=0,i="",j=void 0,k=void 0;if(b.data&&b.ids&&(k=e.appendContextPath(b.data.contextPath,b.ids[0])+"."),e.isFunction(a)&&(a=a.call(this)),b.data&&(j=e.createFrame(b.data)),a&&"object"==typeof a)if(e.isArray(a))for(var l=a.length;h<l;h++)h in a&&c(h,h,h===a.length-1);else{var m=void 0;for(var n in a)a.hasOwnProperty(n)&&(void 0!==m&&c(m,h-1),m=n,h++);void 0!==m&&c(m,h-1,!0)}return 0===h&&(i=f(this)),i})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(2)["default"];b.__esModule=!0;var e=c(5),f=d(e);b["default"]=function(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new f["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(4);b["default"]=function(a){a.registerHelper("if",function(a,b){return d.isFunction(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||d.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("log",function(){for(var b=[void 0],c=arguments[arguments.length-1],d=0;d<arguments.length-1;d++)b.push(arguments[d]);var e=1;null!=c.hash.level?e=c.hash.level:c.data&&null!=c.data.level&&(e=c.data.level),b[0]=e,a.log.apply(a,b)})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("lookup",function(a,b){return a&&a[b]})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(4);b["default"]=function(a){a.registerHelper("with",function(a,b){d.isFunction(a)&&(a=a.call(this));var c=b.fn;if(d.isEmpty(a))return b.inverse(this);var e=b.data;return b.data&&b.ids&&(e=d.createFrame(b.data),e.contextPath=d.appendContextPath(b.data.contextPath,b.ids[0])),c(a,{data:e,blockParams:d.blockParams([a],[e&&e.contextPath])})})},a.exports=b["default"]},function(a,b,c){"use strict";function d(a){g["default"](a)}var e=c(2)["default"];b.__esModule=!0,b.registerDefaultDecorators=d;var f=c(18),g=e(f)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(4);b["default"]=function(a){a.registerDecorator("inline",function(a,b,c,e){var f=a;return b.partials||(b.partials={},f=function(e,f){var g=c.partials;c.partials=d.extend({},g,b.partials);var h=a(e,f);return c.partials=g,h}),b.partials[e.args[0]]=e.fn,f})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(4),e={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(a){if("string"==typeof a){var b=d.indexOf(e.methodMap,a.toLowerCase());a=b>=0?b:parseInt(a,10)}return a},log:function(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];console[b].apply(console,d)}}};b["default"]=e,a.exports=b["default"]},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=s.COMPILER_REVISION;if(b!==c){if(b<c){var d=s.REVISION_CHANGES[c],e=s.REVISION_CHANGES[b];throw new r["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new r["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=p.extend({},d,e.hash),e.ids&&(e.ids[0]=!0)),c=b.VM.resolvePartial.call(this,c,d,e);var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;h<i&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new r["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){function c(b){return""+a.main(e,b,e.helpers,e.partials,g,i,h)}var f=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],g=f.data;d._setup(f),!f.partial&&a.useData&&(g=j(b,g));var h=void 0,i=a.useBlockParams?[]:void 0;return a.useDepths&&(h=f.depths?b!=f.depths[0]?[b].concat(f.depths):f.depths:[b]),(c=k(a.main,c,e,f.depths||[],g,i))(b,f)}if(!b)throw new r["default"]("No environment passed to template");if(!a||!a.main)throw new r["default"]("Unknown template object: "+typeof a);a.main.decorator=a.main_d,b.VM.checkRevision(a.compiler);var e={strict:function(a,b){if(!(b in a))throw new r["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;d<c;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:p.escapeExpression,invokePartial:c,fn:function(b){var c=a[b];return c.decorator=a[b+"_d"],c},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=p.extend({},b,a)),c},nullContext:l({}),noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){c.partial?(e.helpers=c.helpers,e.partials=c.partials,e.decorators=c.decorators):(e.helpers=e.merge(c.helpers,b.helpers),a.usePartial&&(e.partials=e.merge(c.partials,b.partials)),(a.usePartial||a.useDecorators)&&(e.decorators=e.merge(c.decorators,b.decorators)))},d._child=function(b,c,d,g){if(a.useBlockParams&&!d)throw new r["default"]("must pass block params");if(a.useDepths&&!g)throw new r["default"]("must pass parent depths");return f(e,b,a[b],c,0,d,g)},d}function f(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],h=g;return!g||b==g[0]||b===a.nullContext&&null===g[0]||(h=[b].concat(g)),c(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),h)}return h=k(c,h,a,g,d,f),h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a="@partial-block"===c.name?c.data["partial-block"]:c.partials[c.name],a}function h(a,b,c){var d=c.data&&c.data["partial-block"];c.partial=!0,c.ids&&(c.data.contextPath=c.ids[0]||c.data.contextPath);var e=void 0;if(c.fn&&c.fn!==i&&!function(){c.data=s.createFrame(c.data);var a=c.fn;e=c.data["partial-block"]=function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return c.data=s.createFrame(c.data),c.data["partial-block"]=d,a(b,c)},a.partials&&(c.partials=p.extend({},c.partials,a.partials))}(),void 0===a&&e&&(a=e),void 0===a)throw new r["default"]("The partial "+c.name+" could not be found");if(a instanceof Function)return a(b,c)}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?s.createFrame(b):{},b.root=a),b}function k(a,b,c,d,e,f){if(a.decorator){var g={};b=a.decorator(b,g,c,d&&d[0],e,f,d),p.extend(b,g)}return b}var l=c(22)["default"],m=c(1)["default"],n=c(2)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var o=c(4),p=m(o),q=c(5),r=n(q),s=c(3)},function(a,b,c){a.exports={"default":c(23),__esModule:!0}},function(a,b,c){c(24),a.exports=c(29).Object.seal},function(a,b,c){var d=c(25);c(26)("seal",function(a){return function(b){return a&&d(b)?a(b):b}})},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b,c){var d=c(27),e=c(29),f=c(32);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){var d=c(28),e=c(29),f=c(30),g="prototype",h=function(a,b,c){var i,j,k,l=a&h.F,m=a&h.G,n=a&h.S,o=a&h.P,p=a&h.B,q=a&h.W,r=m?e:e[b]||(e[b]={}),s=m?d:n?d[b]:(d[b]||{})[g];m&&(c=b);for(i in c)j=!l&&s&&i in s,j&&i in r||(k=j?s[i]:c[i],r[i]=m&&"function"!=typeof s[i]?c[i]:p&&j?f(k,d):q&&s[i]==k?function(a){var b=function(b){return this instanceof a?new a(b):a(b)};return b[g]=a[g],b}(k):o&&"function"==typeof k?f(Function.call,k):k,o&&((r[g]||(r[g]={}))[i]=k))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,a.exports=h},function(a,b){var c=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=c)},function(a,b){var c=a.exports={version:"1.2.6"};"number"==typeof __e&&(__e=c)},function(a,b,c){var d=c(31);a.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b){(function(c){"use strict";b.__esModule=!0,b["default"]=function(a){var b="undefined"!=typeof c?c:window,d=b.Handlebars;a.noConflict=function(){return b.Handlebars===a&&(b.Handlebars=d),a}},a.exports=b["default"]}).call(b,function(){return this}())}])});
1
  /**!
2
 
3
  @license
4
+ handlebars v4.0.12
5
 
6
  Copyright (C) 2011-2017 by Yehuda Katz
7
 
24
  THE SOFTWARE.
25
 
26
  */
27
+ !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(){var a=new h.HandlebarsEnvironment;return n.extend(a,h),a.SafeString=j["default"],a.Exception=l["default"],a.Utils=n,a.escapeExpression=n.escapeExpression,a.VM=p,a.template=function(b){return p.template(b,a)},a}var e=c(1)["default"],f=c(2)["default"];b.__esModule=!0;var g=c(3),h=e(g),i=c(20),j=f(i),k=c(5),l=f(k),m=c(4),n=e(m),o=c(21),p=e(o),q=c(33),r=f(q),s=d();s.create=d,r["default"](s),s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},b.__esModule=!0},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0},function(a,b,c){"use strict";function d(a,b,c){this.helpers=a||{},this.partials=b||{},this.decorators=c||{},i.registerDefaultHelpers(this),j.registerDefaultDecorators(this)}var e=c(2)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d;var f=c(4),g=c(5),h=e(g),i=c(9),j=c(17),k=c(19),l=e(k),m="4.0.12";b.VERSION=m;var n=7;b.COMPILER_REVISION=n;var o={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};b.REVISION_CHANGES=o;var p="[object Object]";d.prototype={constructor:d,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===p)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]}};var q=l["default"].log;b.log=q,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return k[a]}function d(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function e(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return m.test(a)?a.replace(l,c):a}function g(a){return!a&&0!==a||!(!p(a)||0!==a.length)}function h(a){var b=d({},a);return b._parent=a,b}function i(a,b){return a.path=b,a}function j(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.createFrame=h,b.blockParams=i,b.appendContextPath=j;var k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},l=/[&<>"'`=]/g,m=/[&<>"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function(a){return"function"==typeof a};o(/x/)&&(b.isFunction=o=function(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o;var p=Array.isArray||function(a){return!(!a||"object"!=typeof a)&&"[object Array]"===n.call(a)};b.isArray=p},function(a,b,c){"use strict";function d(a,b){var c=b&&b.loc,g=void 0,h=void 0;c&&(g=c.start.line,h=c.start.column,a+=" - "+g+":"+h);for(var i=Error.prototype.constructor.call(this,a),j=0;j<f.length;j++)this[f[j]]=i[f[j]];Error.captureStackTrace&&Error.captureStackTrace(this,d);try{c&&(this.lineNumber=g,e?Object.defineProperty(this,"column",{value:h,enumerable:!0}):this.column=h)}catch(k){}}var e=c(6)["default"];b.__esModule=!0;var f=["description","fileName","lineNumber","message","name","number","stack"];d.prototype=new Error,b["default"]=d,a.exports=b["default"]},function(a,b,c){a.exports={"default":c(7),__esModule:!0}},function(a,b,c){var d=c(8);a.exports=function(a,b,c){return d.setDesc(a,b,c)}},function(a,b){var c=Object;a.exports={create:c.create,getProto:c.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:c.getOwnPropertyDescriptor,setDesc:c.defineProperty,setDescs:c.defineProperties,getKeys:c.keys,getNames:c.getOwnPropertyNames,getSymbols:c.getOwnPropertySymbols,each:[].forEach}},function(a,b,c){"use strict";function d(a){g["default"](a),i["default"](a),k["default"](a),m["default"](a),o["default"](a),q["default"](a),s["default"](a)}var e=c(2)["default"];b.__esModule=!0,b.registerDefaultHelpers=d;var f=c(10),g=e(f),h=c(11),i=e(h),j=c(12),k=e(j),l=c(13),m=e(l),n=c(14),o=e(n),p=c(15),q=e(p),r=c(16),s=e(r)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(4);b["default"]=function(a){a.registerHelper("blockHelperMissing",function(b,c){var e=c.inverse,f=c.fn;if(b===!0)return f(this);if(b===!1||null==b)return e(this);if(d.isArray(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(2)["default"];b.__esModule=!0;var e=c(4),f=c(5),g=d(f);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,f){j&&(j.key=b,j.index=c,j.first=0===c,j.last=!!f,k&&(j.contextPath=k+b)),i+=d(a[b],{data:j,blockParams:e.blockParams([a[b],b],[k+b,null])})}if(!b)throw new g["default"]("Must pass iterator to #each");var d=b.fn,f=b.inverse,h=0,i="",j=void 0,k=void 0;if(b.data&&b.ids&&(k=e.appendContextPath(b.data.contextPath,b.ids[0])+"."),e.isFunction(a)&&(a=a.call(this)),b.data&&(j=e.createFrame(b.data)),a&&"object"==typeof a)if(e.isArray(a))for(var l=a.length;h<l;h++)h in a&&c(h,h,h===a.length-1);else{var m=void 0;for(var n in a)a.hasOwnProperty(n)&&(void 0!==m&&c(m,h-1),m=n,h++);void 0!==m&&c(m,h-1,!0)}return 0===h&&(i=f(this)),i})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(2)["default"];b.__esModule=!0;var e=c(5),f=d(e);b["default"]=function(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new f["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(4);b["default"]=function(a){a.registerHelper("if",function(a,b){return d.isFunction(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||d.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("log",function(){for(var b=[void 0],c=arguments[arguments.length-1],d=0;d<arguments.length-1;d++)b.push(arguments[d]);var e=1;null!=c.hash.level?e=c.hash.level:c.data&&null!=c.data.level&&(e=c.data.level),b[0]=e,a.log.apply(a,b)})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("lookup",function(a,b){return a&&a[b]})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(4);b["default"]=function(a){a.registerHelper("with",function(a,b){d.isFunction(a)&&(a=a.call(this));var c=b.fn;if(d.isEmpty(a))return b.inverse(this);var e=b.data;return b.data&&b.ids&&(e=d.createFrame(b.data),e.contextPath=d.appendContextPath(b.data.contextPath,b.ids[0])),c(a,{data:e,blockParams:d.blockParams([a],[e&&e.contextPath])})})},a.exports=b["default"]},function(a,b,c){"use strict";function d(a){g["default"](a)}var e=c(2)["default"];b.__esModule=!0,b.registerDefaultDecorators=d;var f=c(18),g=e(f)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(4);b["default"]=function(a){a.registerDecorator("inline",function(a,b,c,e){var f=a;return b.partials||(b.partials={},f=function(e,f){var g=c.partials;c.partials=d.extend({},g,b.partials);var h=a(e,f);return c.partials=g,h}),b.partials[e.args[0]]=e.fn,f})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(4),e={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(a){if("string"==typeof a){var b=d.indexOf(e.methodMap,a.toLowerCase());a=b>=0?b:parseInt(a,10)}return a},log:function(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];console[b].apply(console,d)}}};b["default"]=e,a.exports=b["default"]},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=s.COMPILER_REVISION;if(b!==c){if(b<c){var d=s.REVISION_CHANGES[c],e=s.REVISION_CHANGES[b];throw new r["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new r["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=p.extend({},d,e.hash),e.ids&&(e.ids[0]=!0)),c=b.VM.resolvePartial.call(this,c,d,e);var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;h<i&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new r["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){function c(b){return""+a.main(e,b,e.helpers,e.partials,g,i,h)}var f=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],g=f.data;d._setup(f),!f.partial&&a.useData&&(g=j(b,g));var h=void 0,i=a.useBlockParams?[]:void 0;return a.useDepths&&(h=f.depths?b!=f.depths[0]?[b].concat(f.depths):f.depths:[b]),(c=k(a.main,c,e,f.depths||[],g,i))(b,f)}if(!b)throw new r["default"]("No environment passed to template");if(!a||!a.main)throw new r["default"]("Unknown template object: "+typeof a);a.main.decorator=a.main_d,b.VM.checkRevision(a.compiler);var e={strict:function(a,b){if(!(b in a))throw new r["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;d<c;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:p.escapeExpression,invokePartial:c,fn:function(b){var c=a[b];return c.decorator=a[b+"_d"],c},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=p.extend({},b,a)),c},nullContext:l({}),noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){c.partial?(e.helpers=c.helpers,e.partials=c.partials,e.decorators=c.decorators):(e.helpers=e.merge(c.helpers,b.helpers),a.usePartial&&(e.partials=e.merge(c.partials,b.partials)),(a.usePartial||a.useDecorators)&&(e.decorators=e.merge(c.decorators,b.decorators)))},d._child=function(b,c,d,g){if(a.useBlockParams&&!d)throw new r["default"]("must pass block params");if(a.useDepths&&!g)throw new r["default"]("must pass parent depths");return f(e,b,a[b],c,0,d,g)},d}function f(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],h=g;return!g||b==g[0]||b===a.nullContext&&null===g[0]||(h=[b].concat(g)),c(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),h)}return h=k(c,h,a,g,d,f),h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a="@partial-block"===c.name?c.data["partial-block"]:c.partials[c.name],a}function h(a,b,c){var d=c.data&&c.data["partial-block"];c.partial=!0,c.ids&&(c.data.contextPath=c.ids[0]||c.data.contextPath);var e=void 0;if(c.fn&&c.fn!==i&&!function(){c.data=s.createFrame(c.data);var a=c.fn;e=c.data["partial-block"]=function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return c.data=s.createFrame(c.data),c.data["partial-block"]=d,a(b,c)},a.partials&&(c.partials=p.extend({},c.partials,a.partials))}(),void 0===a&&e&&(a=e),void 0===a)throw new r["default"]("The partial "+c.name+" could not be found");if(a instanceof Function)return a(b,c)}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?s.createFrame(b):{},b.root=a),b}function k(a,b,c,d,e,f){if(a.decorator){var g={};b=a.decorator(b,g,c,d&&d[0],e,f,d),p.extend(b,g)}return b}var l=c(22)["default"],m=c(1)["default"],n=c(2)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var o=c(4),p=m(o),q=c(5),r=n(q),s=c(3)},function(a,b,c){a.exports={"default":c(23),__esModule:!0}},function(a,b,c){c(24),a.exports=c(29).Object.seal},function(a,b,c){var d=c(25);c(26)("seal",function(a){return function(b){return a&&d(b)?a(b):b}})},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b,c){var d=c(27),e=c(29),f=c(32);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){var d=c(28),e=c(29),f=c(30),g="prototype",h=function(a,b,c){var i,j,k,l=a&h.F,m=a&h.G,n=a&h.S,o=a&h.P,p=a&h.B,q=a&h.W,r=m?e:e[b]||(e[b]={}),s=m?d:n?d[b]:(d[b]||{})[g];m&&(c=b);for(i in c)j=!l&&s&&i in s,j&&i in r||(k=j?s[i]:c[i],r[i]=m&&"function"!=typeof s[i]?c[i]:p&&j?f(k,d):q&&s[i]==k?function(a){var b=function(b){return this instanceof a?new a(b):a(b)};return b[g]=a[g],b}(k):o&&"function"==typeof k?f(Function.call,k):k,o&&((r[g]||(r[g]={}))[i]=k))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,a.exports=h},function(a,b){var c=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=c)},function(a,b){var c=a.exports={version:"1.2.6"};"number"==typeof __e&&(__e=c)},function(a,b,c){var d=c(31);a.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b){(function(c){"use strict";b.__esModule=!0,b["default"]=function(a){var b="undefined"!=typeof c?c:window,d=b.Handlebars;a.noConflict=function(){return b.Handlebars===a&&(b.Handlebars=d),a}},a.exports=b["default"]}).call(b,function(){return this}())}])});
js/tablesorter/jquery.tablesorter.js CHANGED
@@ -1,14 +1,5 @@
1
- (function(factory) {
2
- if (typeof define === 'function' && define.amd) {
3
- define(['jquery'], factory);
4
- } else if (typeof module === 'object' && typeof module.exports === 'object') {
5
- module.exports = factory(require('jquery'));
6
- } else {
7
- factory(jQuery);
8
- }
9
- }(function(jQuery) {
10
-
11
- /*! TableSorter (FORK) v2.30.3 *//*
12
  * Client-side table sorting with ease!
13
  * @requires jQuery v1.2.6+
14
  *
@@ -32,7 +23,7 @@
32
  'use strict';
33
  var ts = $.tablesorter = {
34
 
35
- version : '2.30.3',
36
 
37
  parsers : [],
38
  widgets : [],
@@ -516,10 +507,13 @@
516
  return;
517
  }
518
  downTarget = null;
 
519
  // prevent sort being triggered on form elements
520
  if ( ts.regex.formElements.test( e.target.nodeName ) ||
521
  // nosort class name, or elements within a nosort container
522
  $target.hasClass( c.cssNoSort ) || $target.parents( '.' + c.cssNoSort ).length > 0 ||
 
 
523
  // elements within a button
524
  $target.parents( 'button' ).length > 0 ) {
525
  return !c.cancelSelection;
@@ -527,10 +521,9 @@
527
  if ( c.delayInit && ts.isEmptyObject( c.cache ) ) {
528
  ts.buildCache( c );
529
  }
530
- $cell = ts.getClosest( $( this ), '.' + ts.css.header );
531
  // use column index from data-attribute or index of current row; fixes #1116
532
  c.last.clickedIndex = $cell.attr( 'data-column' ) || $cell.index();
533
- cell = c.$headerIndexed[ c.last.clickedIndex ];
534
  if ( cell && !cell.sortDisabled ) {
535
  ts.initSort( c, cell, e );
536
  }
@@ -601,10 +594,11 @@
601
  // this may get updated numerous times if there are multiple rows
602
  c.sortVars[ column ] = {
603
  count : -1, // set to -1 because clicking on the header automatically adds one
604
- order: tmp ?
605
  ( c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ] ) : // desc, asc, unsorted
606
  ( c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ] ), // asc, desc, unsorted
607
- lockedOrder : false
 
608
  };
609
  tmp = ts.getData( $elem, configHeaders, 'lockedOrder' ) || false;
610
  if ( typeof tmp !== 'undefined' && tmp !== false ) {
@@ -1204,6 +1198,11 @@
1204
  txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ];
1205
  }
1206
  $header.attr( 'aria-label', txt );
 
 
 
 
 
1207
  }
1208
  },
1209
 
@@ -1558,6 +1557,7 @@
1558
  len = c.$headers.length,
1559
  th = ts.getClosest( $( cell ), 'th, td' ),
1560
  col = parseInt( th.attr( 'data-column' ), 10 ),
 
1561
  order = c.sortVars[ col ].order;
1562
  th = th[0];
1563
  // Only call sortStart if sorting is enabled
@@ -1578,6 +1578,9 @@
1578
  }
1579
  // user only wants to sort on one column
1580
  if ( notMultiSort ) {
 
 
 
1581
  // flush the sort list
1582
  c.sortList = [];
1583
  c.last.sortList = [];
@@ -1586,6 +1589,7 @@
1586
  for ( indx = 0; indx < arry.length; indx++ ) {
1587
  if ( arry[ indx ][ 0 ] !== col ) {
1588
  c.sortList[ c.sortList.length ] = arry[ indx ];
 
1589
  }
1590
  }
1591
  }
@@ -1593,12 +1597,14 @@
1593
  dir = order[ c.sortVars[ col ].count ];
1594
  if ( dir < 2 ) {
1595
  c.sortList[ c.sortList.length ] = [ col, dir ];
 
1596
  // add other columns if header spans across multiple
1597
  if ( th.colSpan > 1 ) {
1598
  for ( indx = 1; indx < th.colSpan; indx++ ) {
1599
  c.sortList[ c.sortList.length ] = [ col + indx, dir ];
1600
  // update count on columns in colSpan
1601
  c.sortVars[ col + indx ].count = $.inArray( dir, order );
 
1602
  }
1603
  }
1604
  }
@@ -1610,6 +1616,7 @@
1610
  // the user has clicked on an already sorted column
1611
  if ( ts.isValueInArray( col, c.sortList ) >= 0 ) {
1612
  // reverse the sorting direction
 
1613
  for ( indx = 0; indx < c.sortList.length; indx++ ) {
1614
  tmp = c.sortList[ indx ];
1615
  if ( tmp[ 0 ] === col ) {
@@ -1624,6 +1631,7 @@
1624
  } else {
1625
  // add column to sort list array
1626
  dir = order[ c.sortVars[ col ].count ];
 
1627
  if ( dir < 2 ) {
1628
  c.sortList[ c.sortList.length ] = [ col, dir ];
1629
  // add other columns if header spans across multiple
@@ -1632,6 +1640,7 @@
1632
  c.sortList[ c.sortList.length ] = [ col + indx, dir ];
1633
  // update count on columns in colSpan
1634
  c.sortVars[ col + indx ].count = $.inArray( dir, order );
 
1635
  }
1636
  }
1637
  }
@@ -1667,6 +1676,7 @@
1667
  }
1668
  }
1669
  c.sortList[ c.sortList.length ] = [ arry[ indx ][ 0 ], dir ];
 
1670
  }
1671
  }
1672
  }
@@ -1752,7 +1762,7 @@
1752
  sort = sorter[ col ]( x[ col ], y[ col ], dir, col, table );
1753
  } else {
1754
  // fall back to natural sort
1755
- sort = ts[ 'sortNatural' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ], b[ col ], col, c );
1756
  }
1757
  }
1758
  if ( sort ) { return sort; }
@@ -1798,8 +1808,12 @@
1798
  },
1799
 
1800
  sortOn : function( c, list, callback, init ) {
1801
- var table = c.table;
 
1802
  c.$table.triggerHandler( 'sortStart', table );
 
 
 
1803
  // update header count index
1804
  ts.updateHeaderSortCount( c, list );
1805
  // set css for headers
@@ -1822,13 +1836,14 @@
1822
 
1823
  sortReset : function( c, callback ) {
1824
  c.sortList = [];
1825
- ts.setHeadersCss( c );
1826
- ts.multisort( c );
1827
- ts.appendCache( c );
1828
  var indx;
1829
  for (indx = 0; indx < c.columns; indx++) {
1830
  c.sortVars[ indx ].count = -1;
 
1831
  }
 
 
 
1832
  if ( $.isFunction( callback ) ) {
1833
  callback( c.table );
1834
  }
@@ -1846,20 +1861,20 @@
1846
  // Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
1847
  sortNatural : function( a, b ) {
1848
  if ( a === b ) { return 0; }
1849
- a = a.toString();
1850
- b = b.toString();
1851
  var aNum, bNum, aFloat, bFloat, indx, max,
1852
  regex = ts.regex;
1853
  // first try and sort Hex codes
1854
  if ( regex.hex.test( b ) ) {
1855
- aNum = parseInt( ( a || '' ).match( regex.hex ), 16 );
1856
- bNum = parseInt( ( b || '' ).match( regex.hex ), 16 );
1857
  if ( aNum < bNum ) { return -1; }
1858
  if ( aNum > bNum ) { return 1; }
1859
  }
1860
  // chunk/tokenize
1861
- aNum = ( a || '' ).replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
1862
- bNum = ( b || '' ).replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
1863
  max = Math.max( aNum.length, bNum.length );
1864
  // natural sorting through split numeric strings and default strings
1865
  for ( indx = 0; indx < max; indx++ ) {
@@ -2896,6 +2911,4 @@
2896
  });
2897
 
2898
  })( jQuery );
2899
-
2900
- return jQuery.tablesorter;
2901
- }));
1
+ (function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
2
+ /*! TableSorter (FORK) v2.31.0 *//*
 
 
 
 
 
 
 
 
 
3
  * Client-side table sorting with ease!
4
  * @requires jQuery v1.2.6+
5
  *
23
  'use strict';
24
  var ts = $.tablesorter = {
25
 
26
+ version : '2.31.0',
27
 
28
  parsers : [],
29
  widgets : [],
507
  return;
508
  }
509
  downTarget = null;
510
+ $cell = ts.getClosest( $( this ), '.' + ts.css.header );
511
  // prevent sort being triggered on form elements
512
  if ( ts.regex.formElements.test( e.target.nodeName ) ||
513
  // nosort class name, or elements within a nosort container
514
  $target.hasClass( c.cssNoSort ) || $target.parents( '.' + c.cssNoSort ).length > 0 ||
515
+ // disabled cell directly clicked
516
+ $cell.hasClass( 'sorter-false' ) ||
517
  // elements within a button
518
  $target.parents( 'button' ).length > 0 ) {
519
  return !c.cancelSelection;
521
  if ( c.delayInit && ts.isEmptyObject( c.cache ) ) {
522
  ts.buildCache( c );
523
  }
 
524
  // use column index from data-attribute or index of current row; fixes #1116
525
  c.last.clickedIndex = $cell.attr( 'data-column' ) || $cell.index();
526
+ cell = c.$headerIndexed[ c.last.clickedIndex ][0];
527
  if ( cell && !cell.sortDisabled ) {
528
  ts.initSort( c, cell, e );
529
  }
594
  // this may get updated numerous times if there are multiple rows
595
  c.sortVars[ column ] = {
596
  count : -1, // set to -1 because clicking on the header automatically adds one
597
+ order : tmp ?
598
  ( c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ] ) : // desc, asc, unsorted
599
  ( c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ] ), // asc, desc, unsorted
600
+ lockedOrder : false,
601
+ sortedBy : ''
602
  };
603
  tmp = ts.getData( $elem, configHeaders, 'lockedOrder' ) || false;
604
  if ( typeof tmp !== 'undefined' && tmp !== false ) {
1198
  txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ];
1199
  }
1200
  $header.attr( 'aria-label', txt );
1201
+ if (vars.sortedBy) {
1202
+ $header.attr( 'data-sortedBy', vars.sortedBy );
1203
+ } else {
1204
+ $header.removeAttr('data-sortedBy');
1205
+ }
1206
  }
1207
  },
1208
 
1557
  len = c.$headers.length,
1558
  th = ts.getClosest( $( cell ), 'th, td' ),
1559
  col = parseInt( th.attr( 'data-column' ), 10 ),
1560
+ sortedBy = event.type === 'mouseup' ? 'user' : event.type,
1561
  order = c.sortVars[ col ].order;
1562
  th = th[0];
1563
  // Only call sortStart if sorting is enabled
1578
  }
1579
  // user only wants to sort on one column
1580
  if ( notMultiSort ) {
1581
+ $.each( c.sortVars, function( i ) {
1582
+ c.sortVars[ i ].sortedBy = '';
1583
+ });
1584
  // flush the sort list
1585
  c.sortList = [];
1586
  c.last.sortList = [];
1589
  for ( indx = 0; indx < arry.length; indx++ ) {
1590
  if ( arry[ indx ][ 0 ] !== col ) {
1591
  c.sortList[ c.sortList.length ] = arry[ indx ];
1592
+ c.sortVars[ arry[ indx ][ 0 ] ].sortedBy = 'sortForce';
1593
  }
1594
  }
1595
  }
1597
  dir = order[ c.sortVars[ col ].count ];
1598
  if ( dir < 2 ) {
1599
  c.sortList[ c.sortList.length ] = [ col, dir ];
1600
+ c.sortVars[ col ].sortedBy = sortedBy;
1601
  // add other columns if header spans across multiple
1602
  if ( th.colSpan > 1 ) {
1603
  for ( indx = 1; indx < th.colSpan; indx++ ) {
1604
  c.sortList[ c.sortList.length ] = [ col + indx, dir ];
1605
  // update count on columns in colSpan
1606
  c.sortVars[ col + indx ].count = $.inArray( dir, order );
1607
+ c.sortVars[ col + indx ].sortedBy = sortedBy;
1608
  }
1609
  }
1610
  }
1616
  // the user has clicked on an already sorted column
1617
  if ( ts.isValueInArray( col, c.sortList ) >= 0 ) {
1618
  // reverse the sorting direction
1619
+ c.sortVars[ col ].sortedBy = sortedBy;
1620
  for ( indx = 0; indx < c.sortList.length; indx++ ) {
1621
  tmp = c.sortList[ indx ];
1622
  if ( tmp[ 0 ] === col ) {
1631
  } else {
1632
  // add column to sort list array
1633
  dir = order[ c.sortVars[ col ].count ];
1634
+ c.sortVars[ col ].sortedBy = sortedBy;
1635
  if ( dir < 2 ) {
1636
  c.sortList[ c.sortList.length ] = [ col, dir ];
1637
  // add other columns if header spans across multiple
1640
  c.sortList[ c.sortList.length ] = [ col + indx, dir ];
1641
  // update count on columns in colSpan
1642
  c.sortVars[ col + indx ].count = $.inArray( dir, order );
1643
+ c.sortVars[ col + indx ].sortedBy = sortedBy;
1644
  }
1645
  }
1646
  }
1676
  }
1677
  }
1678
  c.sortList[ c.sortList.length ] = [ arry[ indx ][ 0 ], dir ];
1679
+ c.sortVars[ arry[ indx ][ 0 ] ].sortedBy = 'sortAppend';
1680
  }
1681
  }
1682
  }
1762
  sort = sorter[ col ]( x[ col ], y[ col ], dir, col, table );
1763
  } else {
1764
  // fall back to natural sort
1765
+ sort = ts[ 'sortNatural' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ] || '', b[ col ] || '', col, c );
1766
  }
1767
  }
1768
  if ( sort ) { return sort; }
1808
  },
1809
 
1810
  sortOn : function( c, list, callback, init ) {
1811
+ var indx,
1812
+ table = c.table;
1813
  c.$table.triggerHandler( 'sortStart', table );
1814
+ for (indx = 0; indx < c.columns; indx++) {
1815
+ c.sortVars[ indx ].sortedBy = ts.isValueInArray( indx, list ) > -1 ? 'sorton' : '';
1816
+ }
1817
  // update header count index
1818
  ts.updateHeaderSortCount( c, list );
1819
  // set css for headers
1836
 
1837
  sortReset : function( c, callback ) {
1838
  c.sortList = [];
 
 
 
1839
  var indx;
1840
  for (indx = 0; indx < c.columns; indx++) {
1841
  c.sortVars[ indx ].count = -1;
1842
+ c.sortVars[ indx ].sortedBy = '';
1843
  }
1844
+ ts.setHeadersCss( c );
1845
+ ts.multisort( c );
1846
+ ts.appendCache( c );
1847
  if ( $.isFunction( callback ) ) {
1848
  callback( c.table );
1849
  }
1861
  // Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
1862
  sortNatural : function( a, b ) {
1863
  if ( a === b ) { return 0; }
1864
+ a = ( a || '' ).toString();
1865
+ b = ( b || '' ).toString();
1866
  var aNum, bNum, aFloat, bFloat, indx, max,
1867
  regex = ts.regex;
1868
  // first try and sort Hex codes
1869
  if ( regex.hex.test( b ) ) {
1870
+ aNum = parseInt( a.match( regex.hex ), 16 );
1871
+ bNum = parseInt( b.match( regex.hex ), 16 );
1872
  if ( aNum < bNum ) { return -1; }
1873
  if ( aNum > bNum ) { return 1; }
1874
  }
1875
  // chunk/tokenize
1876
+ aNum = a.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
1877
+ bNum = b.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
1878
  max = Math.max( aNum.length, bNum.length );
1879
  // natural sorting through split numeric strings and default strings
1880
  for ( indx = 0; indx < max; indx++ ) {
2911
  });
2912
 
2913
  })( jQuery );
2914
+ return jQuery.tablesorter;}));
 
 
js/tablesorter/jquery.tablesorter.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(e){"use strict";var t=e.tablesorter={version:"2.30.3",parsers:[],widgets:[],defaults:{theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",duplicateSpan:!0,textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,initWidgets:!0,widgetClass:"widget-{name}",widgets:[],widgetOptions:{zebra:["even","odd"]},initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssIconDisabled:"",pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[],globalize:0,imgAttr:0},css:{table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},language:{sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",sortDisabled:"sorting is disabled",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},regex:{templateContent:/\{content\}/g,templateIcon:/\{icon\}/g,templateName:/\{name\}/i,spaces:/\s+/g,nonWord:/\W/g,formElements:/(input|select|button|textarea)/i,chunk:/(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i,comma:/,/g,digitNonUS:/[\s|\.]/g,digitNegativeTest:/^\s*\([.\d]+\)/,digitNegativeReplace:/^\s*\(([.\d]+)\)/,digitTest:/^[\-+(]?\d+[)]?$/,digitReplace:/[,.'"\s]/g},string:{max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},keyCodes:{enter:13},dates:{},instanceMethods:{},setup:function(r,o){if(r&&r.tHead&&0!==r.tBodies.length&&!0!==r.hasInitialized){var s="",a=e(r),n=e.metadata;r.hasInitialized=!1,r.isProcessing=!0,r.config=o,e.data(r,"tablesorter",o),t.debug(o,"core")&&(console[console.group?"group":"log"]("Initializing tablesorter v"+t.version),e.data(r,"startoveralltimer",new Date)),o.supportsDataObject=function(e){return e[0]=parseInt(e[0],10),e[0]>1||1===e[0]&&parseInt(e[1],10)>=4}(e.fn.jquery.split(".")),o.emptyTo=o.emptyTo.toLowerCase(),o.stringTo=o.stringTo.toLowerCase(),o.last={sortList:[],clickedIndex:-1},/tablesorter\-/.test(a.attr("class"))||(s=""!==o.theme?" tablesorter-"+o.theme:""),o.namespace?o.namespace="."+o.namespace.replace(t.regex.nonWord,""):o.namespace=".tablesorter"+Math.random().toString(16).slice(2),o.table=r,o.$table=a.addClass(t.css.table+" "+o.tableClass+s+" "+o.namespace.slice(1)).attr("role","grid"),o.$headers=a.find(o.selectorHeaders),o.$table.children().children("tr").attr("role","row"),o.$tbodies=a.children("tbody:not(."+o.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),o.$table.children("caption").length&&((s=o.$table.children("caption")[0]).id||(s.id=o.namespace.slice(1)+"caption"),o.$table.attr("aria-labelledby",s.id)),o.widgetInit={},o.textExtraction=o.$table.attr("data-text-extraction")||o.textExtraction||"basic",t.buildHeaders(o),t.fixColumnWidth(r),t.addWidgetFromClass(r),t.applyWidgetOptions(r),t.setupParsers(o),o.totalRows=0,o.debug&&t.validateOptions(o),o.delayInit||t.buildCache(o),t.bindEvents(r,o.$headers,!0),t.bindMethods(o),o.supportsDataObject&&void 0!==a.data().sortlist?o.sortList=a.data().sortlist:n&&a.metadata()&&a.metadata().sortlist&&(o.sortList=a.metadata().sortlist),t.applyWidget(r,!0),o.sortList.length>0?t.sortOn(o,o.sortList,{},!o.initWidgets):(t.setHeadersCss(o),o.initWidgets&&t.applyWidget(r,!1)),o.showProcessing&&a.unbind("sortBegin"+o.namespace+" sortEnd"+o.namespace).bind("sortBegin"+o.namespace+" sortEnd"+o.namespace,function(e){clearTimeout(o.timerProcessing),t.isProcessing(r),"sortBegin"===e.type&&(o.timerProcessing=setTimeout(function(){t.isProcessing(r,!0)},500))}),r.hasInitialized=!0,r.isProcessing=!1,t.debug(o,"core")&&(console.log("Overall initialization time:"+t.benchmark(e.data(r,"startoveralltimer"))),t.debug(o,"core")&&console.groupEnd&&console.groupEnd()),a.triggerHandler("tablesorter-initialized",r),"function"==typeof o.initialized&&o.initialized(r)}else t.debug(o,"core")&&(r.hasInitialized?console.warn("Stopping initialization. Tablesorter has already been initialized"):console.error("Stopping initialization! No table, thead or tbody",r))},bindMethods:function(r){var o=r.$table,s=r.namespace,a="sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(s+" ");o.unbind(a.replace(t.regex.spaces," ")).bind("sortReset"+s,function(e,r){e.stopPropagation(),t.sortReset(this.config,function(e){e.isApplyingWidgets?setTimeout(function(){t.applyWidget(e,"",r)},100):t.applyWidget(e,"",r)})}).bind("updateAll"+s,function(e,r,o){e.stopPropagation(),t.updateAll(this.config,r,o)}).bind("update"+s+" updateRows"+s,function(e,r,o){e.stopPropagation(),t.update(this.config,r,o)}).bind("updateHeaders"+s,function(e,r){e.stopPropagation(),t.updateHeaders(this.config,r)}).bind("updateCell"+s,function(e,r,o,s){e.stopPropagation(),t.updateCell(this.config,r,o,s)}).bind("addRows"+s,function(e,r,o,s){e.stopPropagation(),t.addRows(this.config,r,o,s)}).bind("updateComplete"+s,function(){this.isUpdating=!1}).bind("sorton"+s,function(e,r,o,s){e.stopPropagation(),t.sortOn(this.config,r,o,s)}).bind("appendCache"+s,function(r,o,s){r.stopPropagation(),t.appendCache(this.config,s),e.isFunction(o)&&o(this)}).bind("updateCache"+s,function(e,r,o){e.stopPropagation(),t.updateCache(this.config,r,o)}).bind("applyWidgetId"+s,function(e,r){e.stopPropagation(),t.applyWidgetId(this,r)}).bind("applyWidgets"+s,function(e,r){e.stopPropagation(),t.applyWidget(this,!1,r)}).bind("refreshWidgets"+s,function(e,r,o){e.stopPropagation(),t.refreshWidgets(this,r,o)}).bind("removeWidget"+s,function(e,r,o){e.stopPropagation(),t.removeWidget(this,r,o)}).bind("destroy"+s,function(e,r,o){e.stopPropagation(),t.destroy(this,r,o)}).bind("resetToLoadState"+s,function(o){o.stopPropagation(),t.removeWidget(this,!0,!1);var s=e.extend(!0,{},r.originalSettings);(r=e.extend(!0,{},t.defaults,s)).originalSettings=s,this.hasInitialized=!1,t.setup(this,r)})},bindEvents:function(r,o,s){var a,n=(r=e(r)[0]).config,i=n.namespace,l=null;!0!==s&&(o.addClass(i.slice(1)+"_extra_headers"),(a=t.getClosest(o,"table")).length&&"TABLE"===a[0].nodeName&&a[0]!==r&&e(a[0]).addClass(i.slice(1)+"_extra_table")),a=(n.pointerDown+" "+n.pointerUp+" "+n.pointerClick+" sort keyup ").replace(t.regex.spaces," ").split(" ").join(i+" "),o.find(n.selectorSort).add(o.filter(n.selectorSort)).unbind(a).bind(a,function(r,o){var s,a,i,d=e(r.target),c=" "+r.type+" ";if(!(1!==(r.which||r.button)&&!c.match(" "+n.pointerClick+" | sort | keyup ")||" keyup "===c&&r.which!==t.keyCodes.enter||c.match(" "+n.pointerClick+" ")&&void 0!==r.which||c.match(" "+n.pointerUp+" ")&&l!==r.target&&!0!==o)){if(c.match(" "+n.pointerDown+" "))return l=r.target,void("1"===(i=d.jquery.split("."))[0]&&i[1]<4&&r.preventDefault());if(l=null,t.regex.formElements.test(r.target.nodeName)||d.hasClass(n.cssNoSort)||d.parents("."+n.cssNoSort).length>0||d.parents("button").length>0)return!n.cancelSelection;n.delayInit&&t.isEmptyObject(n.cache)&&t.buildCache(n),s=t.getClosest(e(this),"."+t.css.header),n.last.clickedIndex=s.attr("data-column")||s.index(),(a=n.$headerIndexed[n.last.clickedIndex])&&!a.sortDisabled&&t.initSort(n,a,r)}}),n.cancelSelection&&o.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},buildHeaders:function(r){var o,s,a,n;for(r.headerList=[],r.headerContent=[],r.sortVars=[],t.debug(r,"core")&&(a=new Date),r.columns=t.computeColumnIndex(r.$table.children("thead, tfoot").children("tr")),s=r.cssIcon?'<i class="'+(r.cssIcon===t.css.icon?t.css.icon:r.cssIcon+" "+t.css.icon)+'"></i>':"",r.$headers=e(e.map(r.$table.find(r.selectorHeaders),function(o,a){var n,i,l,d,c,g=e(o);if(!t.getClosest(g,"tr").hasClass(r.cssIgnoreRow))return/(th|td)/i.test(o.nodeName)||(c=t.getClosest(g,"th, td"),g.attr("data-column",c.attr("data-column"))),n=t.getColumnData(r.table,r.headers,a,!0),r.headerContent[a]=g.html(),""===r.headerTemplate||g.find("."+t.css.headerIn).length||(d=r.headerTemplate.replace(t.regex.templateContent,g.html()).replace(t.regex.templateIcon,g.find("."+t.css.icon).length?"":s),r.onRenderTemplate&&(i=r.onRenderTemplate.apply(g,[a,d]))&&"string"==typeof i&&(d=i),g.html('<div class="'+t.css.headerIn+'">'+d+"</div>")),r.onRenderHeader&&r.onRenderHeader.apply(g,[a,r,r.$table]),l=parseInt(g.attr("data-column"),10),o.column=l,c=t.getOrder(t.getData(g,n,"sortInitialOrder")||r.sortInitialOrder),r.sortVars[l]={count:-1,order:c?r.sortReset?[1,0,2]:[1,0]:r.sortReset?[0,1,2]:[0,1],lockedOrder:!1},void 0!==(c=t.getData(g,n,"lockedOrder")||!1)&&!1!==c&&(r.sortVars[l].lockedOrder=!0,r.sortVars[l].order=t.getOrder(c)?[1,1]:[0,0]),r.headerList[a]=o,g.addClass(t.css.header+" "+r.cssHeader),t.getClosest(g,"tr").addClass(t.css.headerRow+" "+r.cssHeaderRow).attr("role","row"),r.tabIndex&&g.attr("tabindex",0),o})),r.$headerIndexed=[],n=0;n<r.columns;n++)t.isEmptyObject(r.sortVars[n])&&(r.sortVars[n]={}),o=r.$headers.filter('[data-column="'+n+'"]'),r.$headerIndexed[n]=o.length?o.not(".sorter-false").length?o.not(".sorter-false").filter(":last"):o.filter(":last"):e();r.$table.find(r.selectorHeaders).attr({scope:"col",role:"columnheader"}),t.updateHeader(r),t.debug(r,"core")&&(console.log("Built headers:"+t.benchmark(a)),console.log(r.$headers))},addInstanceMethods:function(r){e.extend(t.instanceMethods,r)},setupParsers:function(e,r){var o,s,a,n,i,l,d,c,g,p,u,f,h,m,b=e.table,y=0,w=t.debug(e,"core"),x={};if(e.$tbodies=e.$table.children("tbody:not(."+e.cssInfoBlock+")"),h=void 0===r?e.$tbodies:r,0===(m=h.length))return w?console.warn("Warning: *Empty table!* Not building a parser cache"):"";for(w&&(f=new Date,console[console.group?"group":"log"]("Detecting parsers for each column")),s={extractors:[],parsers:[]};y<m;){if((o=h[y].rows).length)for(i=0,n=e.columns,l=0;l<n;l++){if((d=e.$headerIndexed[i])&&d.length&&(c=t.getColumnData(b,e.headers,i),u=t.getParserById(t.getData(d,c,"extractor")),p=t.getParserById(t.getData(d,c,"sorter")),g="false"===t.getData(d,c,"parser"),e.empties[i]=(t.getData(d,c,"empty")||e.emptyTo||(e.emptyToBottom?"bottom":"top")).toLowerCase(),e.strings[i]=(t.getData(d,c,"string")||e.stringTo||"max").toLowerCase(),g&&(p=t.getParserById("no-parser")),u||(u=!1),p||(p=t.detectParserForColumn(e,o,-1,i)),w&&(x["("+i+") "+d.text()]={parser:p.id,extractor:u?u.id:"none",string:e.strings[i],empty:e.empties[i]}),s.parsers[i]=p,s.extractors[i]=u,(a=d[0].colSpan-1)>0))for(i+=a,n+=a;a+1>0;)s.parsers[i-a]=p,s.extractors[i-a]=u,a--;i++}y+=s.parsers.length?m:1}w&&(t.isEmptyObject(x)?console.warn(" No parsers detected!"):console[console.table?"table":"log"](x),console.log("Completed detecting parsers"+t.benchmark(f)),console.groupEnd&&console.groupEnd()),e.parsers=s.parsers,e.extractors=s.extractors},addParser:function(e){var r,o=t.parsers.length,s=!0;for(r=0;r<o;r++)t.parsers[r].id.toLowerCase()===e.id.toLowerCase()&&(s=!1);s&&(t.parsers[t.parsers.length]=e)},getParserById:function(e){if("false"==e)return!1;var r,o=t.parsers.length;for(r=0;r<o;r++)if(t.parsers[r].id.toLowerCase()===e.toString().toLowerCase())return t.parsers[r];return!1},detectParserForColumn:function(r,o,s,a){for(var n,i,l,d=t.parsers.length,c=!1,g="",p=t.debug(r,"core"),u=!0;""===g&&u;)(l=o[++s])&&s<50?l.className.indexOf(t.cssIgnoreRow)<0&&(c=o[s].cells[a],g=t.getElementText(r,c,a),i=e(c),p&&console.log("Checking if value was empty on row "+s+", column: "+a+': "'+g+'"')):u=!1;for(;--d>=0;)if((n=t.parsers[d])&&"text"!==n.id&&n.is&&n.is(g,r.table,c,i))return n;return t.getParserById("text")},getElementText:function(r,o,s){if(!o)return"";var a,n=r.textExtraction||"",i=o.jquery?o:e(o);return"string"==typeof n?"basic"===n&&void 0!==(a=i.attr(r.textAttribute))?e.trim(a):e.trim(o.textContent||i.text()):"function"==typeof n?e.trim(n(i[0],r.table,s)):"function"==typeof(a=t.getColumnData(r.table,n,s))?e.trim(a(i[0],r.table,s)):e.trim(i[0].textContent||i.text())},getParsedText:function(e,r,o,s){void 0===s&&(s=t.getElementText(e,r,o));var a=""+s,n=e.parsers[o],i=e.extractors[o];return n&&(i&&"function"==typeof i.format&&(s=i.format(s,e.table,r,o)),a="no-parser"===n.id?"":n.format(""+s,e.table,r,o),e.ignoreCase&&"string"==typeof a&&(a=a.toLowerCase())),a},buildCache:function(r,o,s){var a,n,i,l,d,c,g,p,u,f,h,m,b,y,w,x,v,C,$,I,D,R,T=r.table,L=r.parsers,A=t.debug(r,"core");if(r.$tbodies=r.$table.children("tbody:not(."+r.cssInfoBlock+")"),g=void 0===s?r.$tbodies:s,r.cache={},r.totalRows=0,!L)return A?console.warn("Warning: *Empty table!* Not building a cache"):"";for(A&&(m=new Date),r.showProcessing&&t.isProcessing(T,!0),c=0;c<g.length;c++){for(x=[],a=r.cache[c]={normalized:[]},b=g[c]&&g[c].rows.length||0,l=0;l<b;++l)if(y={child:[],raw:[]},p=e(g[c].rows[l]),u=[],!p.hasClass(r.selectorRemove.slice(1)))if(p.hasClass(r.cssChildRow)&&0!==l)for(D=a.normalized.length-1,(w=a.normalized[D][r.columns]).$row=w.$row.add(p),p.prev().hasClass(r.cssChildRow)||p.prev().addClass(t.css.cssHasChild),f=p.children("th, td"),D=w.child.length,w.child[D]=[],C=0,I=r.columns,d=0;d<I;d++)(h=f[d])&&(w.child[D][d]=t.getParsedText(r,h,d),(v=f[d].colSpan-1)>0&&(C+=v,I+=v)),C++;else{for(y.$row=p,y.order=l,C=0,I=r.columns,d=0;d<I;++d){if((h=p[0].cells[d])&&C<r.columns&&(!($=void 0!==L[C])&&A&&console.warn("No parser found for row: "+l+", column: "+d+'; cell containing: "'+e(h).text()+'"; does it have a header?'),n=t.getElementText(r,h,C),y.raw[C]=n,i=t.getParsedText(r,h,C,n),u[C]=i,$&&"numeric"===(L[C].type||"").toLowerCase()&&(x[C]=Math.max(Math.abs(i)||0,x[C]||0)),(v=h.colSpan-1)>0)){for(R=0;R<=v;)i=r.duplicateSpan||0===R?n:"string"!=typeof r.textExtraction?t.getElementText(r,h,C+R)||"":"",y.raw[C+R]=i,u[C+R]=i,R++;C+=v,I+=v}C++}u[r.columns]=y,a.normalized[a.normalized.length]=u}a.colMax=x,r.totalRows+=a.normalized.length}if(r.showProcessing&&t.isProcessing(T),A){for(D=Math.min(5,r.cache[0].normalized.length),console[console.group?"group":"log"]("Building cache for "+r.totalRows+" rows (showing "+D+" rows in log) and "+r.columns+" columns"+t.benchmark(m)),n={},d=0;d<r.columns;d++)for(C=0;C<D;C++)n["row: "+C]||(n["row: "+C]={}),n["row: "+C][r.$headerIndexed[d].text()]=r.cache[0].normalized[C][d];console[console.table?"table":"log"](n),console.groupEnd&&console.groupEnd()}e.isFunction(o)&&o(T)},getColumnText:function(r,o,s,a){var n,i,l,d,c,g,p,u,f,h,m="function"==typeof s,b="all"===o,y={raw:[],parsed:[],$cell:[]},w=(r=e(r)[0]).config;if(!t.isEmptyObject(w)){for(c=w.$tbodies.length,n=0;n<c;n++)for(g=(l=w.cache[n].normalized).length,i=0;i<g;i++)d=l[i],a&&!d[w.columns].$row.is(a)||(h=!0,u=b?d.slice(0,w.columns):d[o],d=d[w.columns],p=b?d.raw:d.raw[o],f=b?d.$row.children():d.$row.children().eq(o),m&&(h=s({tbodyIndex:n,rowIndex:i,parsed:u,raw:p,$row:d.$row,$cell:f})),!1!==h&&(y.parsed[y.parsed.length]=u,y.raw[y.raw.length]=p,y.$cell[y.$cell.length]=f));return y}t.debug(w,"core")&&console.warn("No cache found - aborting getColumnText function!")},setHeadersCss:function(r){var o,s,a=r.sortList,n=a.length,i=t.css.sortNone+" "+r.cssNone,l=[t.css.sortAsc+" "+r.cssAsc,t.css.sortDesc+" "+r.cssDesc],d=[r.cssIconAsc,r.cssIconDesc,r.cssIconNone],c=["ascending","descending"],g=function(e,r){e.removeClass(i).addClass(l[r]).attr("aria-sort",c[r]).find("."+t.css.icon).removeClass(d[2]).addClass(d[r])},p=r.$table.find("tfoot tr").children("td, th").add(e(r.namespace+"_extra_headers")).removeClass(l.join(" ")),u=r.$headers.add(e("thead "+r.namespace+"_extra_headers")).removeClass(l.join(" ")).addClass(i).attr("aria-sort","none").find("."+t.css.icon).removeClass(d.join(" ")).end();for(u.not(".sorter-false").find("."+t.css.icon).addClass(d[2]),r.cssIconDisabled&&u.filter(".sorter-false").find("."+t.css.icon).addClass(r.cssIconDisabled),o=0;o<n;o++)if(2!==a[o][1]){if(u=r.$headers.filter(function(e){for(var o=!0,s=r.$headers.eq(e),a=parseInt(s.attr("data-column"),10),n=a+t.getClosest(s,"th, td")[0].colSpan;a<n;a++)o=!!o&&(o||t.isValueInArray(a,r.sortList)>-1);return o}),(u=u.not(".sorter-false").filter('[data-column="'+a[o][0]+'"]'+(1===n?":last":""))).length)for(s=0;s<u.length;s++)u[s].sortDisabled||g(u.eq(s),a[o][1]);p.length&&g(p.filter('[data-column="'+a[o][0]+'"]'),a[o][1])}for(n=r.$headers.length,o=0;o<n;o++)t.setColumnAriaLabel(r,r.$headers.eq(o))},getClosest:function(t,r){return e.fn.closest?t.closest(r):t.is(r)?t:t.parents(r).filter(":first")},setColumnAriaLabel:function(r,o,s){if(o.length){var a=parseInt(o.attr("data-column"),10),n=r.sortVars[a],i=o.hasClass(t.css.sortAsc)?"sortAsc":o.hasClass(t.css.sortDesc)?"sortDesc":"sortNone",l=e.trim(o.text())+": "+t.language[i];o.hasClass("sorter-false")||!1===s?l+=t.language.sortDisabled:(i=(n.count+1)%n.order.length,s=n.order[i],l+=t.language[0===s?"nextAsc":1===s?"nextDesc":"nextNone"]),o.attr("aria-label",l)}},updateHeader:function(e){var r,o,s,a,n=e.table,i=e.$headers.length;for(r=0;r<i;r++)s=e.$headers.eq(r),a=t.getColumnData(n,e.headers,r,!0),o="false"===t.getData(s,a,"sorter")||"false"===t.getData(s,a,"parser"),t.setColumnSort(e,s,o)},setColumnSort:function(e,t,r){var o=e.table.id;t[0].sortDisabled=r,t[r?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+r),e.tabIndex&&(r?t.removeAttr("tabindex"):t.attr("tabindex","0")),o&&(r?t.removeAttr("aria-controls"):t.attr("aria-controls",o))},updateHeaderSortCount:function(r,o){var s,a,n,i,l,d,c,g,p=o||r.sortList,u=p.length;for(r.sortList=[],i=0;i<u;i++)if(c=p[i],(s=parseInt(c[0],10))<r.columns){switch(r.sortVars[s].order||(g=t.getOrder(r.sortInitialOrder)?r.sortReset?[1,0,2]:[1,0]:r.sortReset?[0,1,2]:[0,1],r.sortVars[s].order=g,r.sortVars[s].count=0),g=r.sortVars[s].order,a=(""+c[1]).match(/^(1|d|s|o|n)/),a=a?a[0]:""){case"1":case"d":a=1;break;case"s":a=l||0;break;case"o":a=0===(d=g[(l||0)%g.length])?1:1===d?0:2;break;case"n":a=g[++r.sortVars[s].count%g.length];break;default:a=0}l=0===i?a:l,n=[s,parseInt(a,10)||0],r.sortList[r.sortList.length]=n,a=e.inArray(n[1],g),r.sortVars[s].count=a>=0?a:n[1]%g.length}},updateAll:function(e,r,o){var s=e.table;s.isUpdating=!0,t.refreshWidgets(s,!0,!0),t.buildHeaders(e),t.bindEvents(s,e.$headers,!0),t.bindMethods(e),t.commonUpdate(e,r,o)},update:function(e,r,o){e.table.isUpdating=!0,t.updateHeader(e),t.commonUpdate(e,r,o)},updateHeaders:function(e,r){e.table.isUpdating=!0,t.buildHeaders(e),t.bindEvents(e.table,e.$headers,!0),t.resortComplete(e,r)},updateCell:function(r,o,s,a){if(e(o).closest("tr").hasClass(r.cssChildRow))console.warn('Tablesorter Warning! "updateCell" for child row content has been disabled, use "update" instead');else{if(t.isEmptyObject(r.cache))return t.updateHeader(r),void t.commonUpdate(r,s,a);r.table.isUpdating=!0,r.$table.find(r.selectorRemove).remove();var n,i,l,d,c,g,p=r.$tbodies,u=e(o),f=p.index(t.getClosest(u,"tbody")),h=r.cache[f],m=t.getClosest(u,"tr");if(o=u[0],p.length&&f>=0){if(l=p.eq(f).find("tr").not("."+r.cssChildRow).index(m),c=h.normalized[l],(g=m[0].cells.length)!==r.columns)for(d=0,n=!1,i=0;i<g;i++)n||m[0].cells[i]===o?n=!0:d+=m[0].cells[i].colSpan;else d=u.index();n=t.getElementText(r,o,d),c[r.columns].raw[d]=n,n=t.getParsedText(r,o,d,n),c[d]=n,"numeric"===(r.parsers[d].type||"").toLowerCase()&&(h.colMax[d]=Math.max(Math.abs(n)||0,h.colMax[d]||0)),!1!==(n="undefined"!==s?s:r.resort)?t.checkResort(r,n,a):t.resortComplete(r,a)}else t.debug(r,"core")&&console.error("updateCell aborted, tbody missing or not within the indicated table"),r.table.isUpdating=!1}},addRows:function(r,o,s,a){var n,i,l,d,c,g,p,u,f,h,m,b,y,w="string"==typeof o&&1===r.$tbodies.length&&/<tr/.test(o||""),x=r.table;if(w)o=e(o),r.$tbodies.append(o);else if(!(o&&o instanceof e&&t.getClosest(o,"table")[0]===r.table))return t.debug(r,"core")&&console.error("addRows method requires (1) a jQuery selector reference to rows that have already been added to the table, or (2) row HTML string to be added to a table with only one tbody"),!1;if(x.isUpdating=!0,t.isEmptyObject(r.cache))t.updateHeader(r),t.commonUpdate(r,s,a);else{for(c=o.filter("tr").attr("role","row").length,l=r.$tbodies.index(o.parents("tbody").filter(":first")),r.parsers&&r.parsers.length||t.setupParsers(r),d=0;d<c;d++){for(f=0,p=o[d].cells.length,u=r.cache[l].normalized.length,m=[],h={child:[],raw:[],$row:o.eq(d),order:u},g=0;g<p;g++)b=o[d].cells[g],n=t.getElementText(r,b,f),h.raw[f]=n,i=t.getParsedText(r,b,f,n),m[f]=i,"numeric"===(r.parsers[f].type||"").toLowerCase()&&(r.cache[l].colMax[f]=Math.max(Math.abs(i)||0,r.cache[l].colMax[f]||0)),(y=b.colSpan-1)>0&&(f+=y),f++;m[r.columns]=h,r.cache[l].normalized[u]=m}t.checkResort(r,s,a)}},updateCache:function(e,r,o){e.parsers&&e.parsers.length||t.setupParsers(e,o),t.buildCache(e,r,o)},appendCache:function(e,r){var o,s,a,n,i,l,d,c=e.table,g=e.$tbodies,p=[],u=e.cache;if(t.isEmptyObject(u))return e.appender?e.appender(c,p):c.isUpdating?e.$table.triggerHandler("updateComplete",c):"";for(t.debug(e,"core")&&(d=new Date),l=0;l<g.length;l++)if((a=g.eq(l)).length){for(n=t.processTbody(c,a,!0),s=(o=u[l].normalized).length,i=0;i<s;i++)p[p.length]=o[i][e.columns].$row,e.appender&&(!e.pager||e.pager.removeRows||e.pager.ajax)||n.append(o[i][e.columns].$row);t.processTbody(c,n,!1)}e.appender&&e.appender(c,p),t.debug(e,"core")&&console.log("Rebuilt table"+t.benchmark(d)),r||e.appender||t.applyWidget(c),c.isUpdating&&e.$table.triggerHandler("updateComplete",c)},commonUpdate:function(e,r,o){e.$table.find(e.selectorRemove).remove(),t.setupParsers(e),t.buildCache(e),t.checkResort(e,r,o)},initSort:function(r,o,s){if(r.table.isUpdating)return setTimeout(function(){t.initSort(r,o,s)},50);var a,n,i,l,d,c,g,p=!s[r.sortMultiSortKey],u=r.table,f=r.$headers.length,h=t.getClosest(e(o),"th, td"),m=parseInt(h.attr("data-column"),10),b=r.sortVars[m].order;if(h=h[0],r.$table.triggerHandler("sortStart",u),c=(r.sortVars[m].count+1)%b.length,r.sortVars[m].count=s[r.sortResetKey]?2:c,r.sortRestart)for(i=0;i<f;i++)g=r.$headers.eq(i),m!==(c=parseInt(g.attr("data-column"),10))&&(p||g.hasClass(t.css.sortNone))&&(r.sortVars[c].count=-1);if(p){if(r.sortList=[],r.last.sortList=[],null!==r.sortForce)for(a=r.sortForce,n=0;n<a.length;n++)a[n][0]!==m&&(r.sortList[r.sortList.length]=a[n]);if((l=b[r.sortVars[m].count])<2&&(r.sortList[r.sortList.length]=[m,l],h.colSpan>1))for(n=1;n<h.colSpan;n++)r.sortList[r.sortList.length]=[m+n,l],r.sortVars[m+n].count=e.inArray(l,b)}else if(r.sortList=e.extend([],r.last.sortList),t.isValueInArray(m,r.sortList)>=0)for(n=0;n<r.sortList.length;n++)(c=r.sortList[n])[0]===m&&(c[1]=b[r.sortVars[m].count],2===c[1]&&(r.sortList.splice(n,1),r.sortVars[m].count=-1));else if((l=b[r.sortVars[m].count])<2&&(r.sortList[r.sortList.length]=[m,l],h.colSpan>1))for(n=1;n<h.colSpan;n++)r.sortList[r.sortList.length]=[m+n,l],r.sortVars[m+n].count=e.inArray(l,b);if(r.last.sortList=e.extend([],r.sortList),r.sortList.length&&r.sortAppend&&(a=e.isArray(r.sortAppend)?r.sortAppend:r.sortAppend[r.sortList[0][0]],!t.isEmptyObject(a)))for(n=0;n<a.length;n++)if(a[n][0]!==m&&t.isValueInArray(a[n][0],r.sortList)<0){if(l=a[n][1],d=(""+l).match(/^(a|d|s|o|n)/))switch(c=r.sortList[0][1],d[0]){case"d":l=1;break;case"s":l=c;break;case"o":l=0===c?1:0;break;case"n":l=(c+1)%b.length;break;default:l=0}r.sortList[r.sortList.length]=[a[n][0],l]}r.$table.triggerHandler("sortBegin",u),setTimeout(function(){t.setHeadersCss(r),t.multisort(r),t.appendCache(r),r.$table.triggerHandler("sortBeforeEnd",u),r.$table.triggerHandler("sortEnd",u)},1)},multisort:function(e){var r,o,s,a,n=e.table,i=[],l=0,d=e.textSorter||"",c=e.sortList,g=c.length,p=e.$tbodies.length;if(!e.serverSideSorting&&!t.isEmptyObject(e.cache)){if(t.debug(e,"core")&&(o=new Date),"object"==typeof d)for(s=e.columns;s--;)"function"==typeof(a=t.getColumnData(n,d,s))&&(i[s]=a);for(r=0;r<p;r++)s=e.cache[r].colMax,e.cache[r].normalized.sort(function(r,o){var a,p,u,f,h,m,b;for(a=0;a<g;a++){if(u=c[a][0],f=c[a][1],l=0===f,e.sortStable&&r[u]===o[u]&&1===g)return r[e.columns].order-o[e.columns].order;if(p=/n/i.test(t.getSortType(e.parsers,u)),p&&e.strings[u]?(p="boolean"==typeof t.string[e.strings[u]]?(l?1:-1)*(t.string[e.strings[u]]?-1:1):e.strings[u]?t.string[e.strings[u]]||0:0,h=e.numberSorter?e.numberSorter(r[u],o[u],l,s[u],n):t["sortNumeric"+(l?"Asc":"Desc")](r[u],o[u],p,s[u],u,e)):(m=l?r:o,b=l?o:r,h="function"==typeof d?d(m[u],b[u],l,u,n):"function"==typeof i[u]?i[u](m[u],b[u],l,u,n):t["sortNatural"+(l?"Asc":"Desc")](r[u],o[u],u,e)),h)return h}return r[e.columns].order-o[e.columns].order});t.debug(e,"core")&&console.log("Applying sort "+c.toString()+t.benchmark(o))}},resortComplete:function(t,r){t.table.isUpdating&&t.$table.triggerHandler("updateComplete",t.table),e.isFunction(r)&&r(t.table)},checkResort:function(r,o,s){var a=e.isArray(o)?o:r.sortList;!1===(void 0===o?r.resort:o)||r.serverSideSorting||r.table.isProcessing?(t.resortComplete(r,s),t.applyWidget(r.table,!1)):a.length?t.sortOn(r,a,function(){t.resortComplete(r,s)},!0):t.sortReset(r,function(){t.resortComplete(r,s),t.applyWidget(r.table,!1)})},sortOn:function(r,o,s,a){var n=r.table;r.$table.triggerHandler("sortStart",n),t.updateHeaderSortCount(r,o),t.setHeadersCss(r),r.delayInit&&t.isEmptyObject(r.cache)&&t.buildCache(r),r.$table.triggerHandler("sortBegin",n),t.multisort(r),t.appendCache(r,a),r.$table.triggerHandler("sortBeforeEnd",n),r.$table.triggerHandler("sortEnd",n),t.applyWidget(n),e.isFunction(s)&&s(n)},sortReset:function(r,o){r.sortList=[],t.setHeadersCss(r),t.multisort(r),t.appendCache(r);var s;for(s=0;s<r.columns;s++)r.sortVars[s].count=-1;e.isFunction(o)&&o(r.table)},getSortType:function(e,t){return e&&e[t]?e[t].type||"":""},getOrder:function(e){return/^d/i.test(e)||1===e},sortNatural:function(e,r){if(e===r)return 0;e=e.toString(),r=r.toString();var o,s,a,n,i,l,d=t.regex;if(d.hex.test(r)){if(o=parseInt((e||"").match(d.hex),16),s=parseInt((r||"").match(d.hex),16),o<s)return-1;if(o>s)return 1}for(o=(e||"").replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0"),s=(r||"").replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0"),l=Math.max(o.length,s.length),i=0;i<l;i++){if(a=isNaN(o[i])?o[i]||0:parseFloat(o[i])||0,n=isNaN(s[i])?s[i]||0:parseFloat(s[i])||0,isNaN(a)!==isNaN(n))return isNaN(a)?1:-1;if(typeof a!=typeof n&&(a+="",n+=""),a<n)return-1;if(a>n)return 1}return 0},sortNaturalAsc:function(e,r,o,s){if(e===r)return 0;var a=t.string[s.empties[o]||s.emptyTo];return""===e&&0!==a?"boolean"==typeof a?a?-1:1:-a||-1:""===r&&0!==a?"boolean"==typeof a?a?1:-1:a||1:t.sortNatural(e,r)},sortNaturalDesc:function(e,r,o,s){if(e===r)return 0;var a=t.string[s.empties[o]||s.emptyTo];return""===e&&0!==a?"boolean"==typeof a?a?-1:1:a||1:""===r&&0!==a?"boolean"==typeof a?a?1:-1:-a||-1:t.sortNatural(r,e)},sortText:function(e,t){return e>t?1:e<t?-1:0},getTextValue:function(e,t,r){if(r){var o,s=e?e.length:0,a=r+t;for(o=0;o<s;o++)a+=e.charCodeAt(o);return t*a}return 0},sortNumericAsc:function(e,r,o,s,a,n){if(e===r)return 0;var i=t.string[n.empties[a]||n.emptyTo];return""===e&&0!==i?"boolean"==typeof i?i?-1:1:-i||-1:""===r&&0!==i?"boolean"==typeof i?i?1:-1:i||1:(isNaN(e)&&(e=t.getTextValue(e,o,s)),isNaN(r)&&(r=t.getTextValue(r,o,s)),e-r)},sortNumericDesc:function(e,r,o,s,a,n){if(e===r)return 0;var i=t.string[n.empties[a]||n.emptyTo];return""===e&&0!==i?"boolean"==typeof i?i?-1:1:i||1:""===r&&0!==i?"boolean"==typeof i?i?1:-1:-i||-1:(isNaN(e)&&(e=t.getTextValue(e,o,s)),isNaN(r)&&(r=t.getTextValue(r,o,s)),r-e)},sortNumeric:function(e,t){return e-t},addWidget:function(e){e.id&&!t.isEmptyObject(t.getWidgetById(e.id))&&console.warn('"'+e.id+'" widget was loaded more than once!'),t.widgets[t.widgets.length]=e},hasWidget:function(t,r){return(t=e(t)).length&&t[0].config&&t[0].config.widgetInit[r]||!1},getWidgetById:function(e){var r,o,s=t.widgets.length;for(r=0;r<s;r++)if((o=t.widgets[r])&&o.id&&o.id.toLowerCase()===e.toLowerCase())return o},applyWidgetOptions:function(r){var o,s,a,n=r.config,i=n.widgets.length;if(i)for(o=0;o<i;o++)(s=t.getWidgetById(n.widgets[o]))&&s.options&&(a=e.extend(!0,{},s.options),n.widgetOptions=e.extend(!0,a,n.widgetOptions),e.extend(!0,t.defaults.widgetOptions,s.options))},addWidgetFromClass:function(e){var r,o,s=e.config,a="^"+s.widgetClass.replace(t.regex.templateName,"(\\S+)+")+"$",n=new RegExp(a,"g"),i=(e.className||"").split(t.regex.spaces);if(i.length)for(r=i.length,o=0;o<r;o++)i[o].match(n)&&(s.widgets[s.widgets.length]=i[o].replace(n,"$1"))},applyWidgetId:function(r,o,s){var a,n,i,l=(r=e(r)[0]).config,d=l.widgetOptions,c=t.debug(l,"core"),g=t.getWidgetById(o);g&&(i=g.id,a=!1,e.inArray(i,l.widgets)<0&&(l.widgets[l.widgets.length]=i),c&&(n=new Date),!s&&l.widgetInit[i]||(l.widgetInit[i]=!0,r.hasInitialized&&t.applyWidgetOptions(r),"function"==typeof g.init&&(a=!0,c&&console[console.group?"group":"log"]("Initializing "+i+" widget"),g.init(r,g,l,d))),s||"function"!=typeof g.format||(a=!0,c&&console[console.group?"group":"log"]("Updating "+i+" widget"),g.format(r,l,d,!1)),c&&a&&(console.log("Completed "+(s?"initializing ":"applying ")+i+" widget"+t.benchmark(n)),console.groupEnd&&console.groupEnd()))},applyWidget:function(r,o,s){var a,n,i,l,d,c=(r=e(r)[0]).config,g=t.debug(c,"core"),p=[];if(!1===o||!r.hasInitialized||!r.isApplyingWidgets&&!r.isUpdating){if(g&&(d=new Date),t.addWidgetFromClass(r),clearTimeout(c.timerReady),c.widgets.length){for(r.isApplyingWidgets=!0,c.widgets=e.grep(c.widgets,function(t,r){return e.inArray(t,c.widgets)===r}),n=(i=c.widgets||[]).length,a=0;a<n;a++)(l=t.getWidgetById(i[a]))&&l.id?(l.priority||(l.priority=10),p[a]=l):g&&console.warn('"'+i[a]+'" was enabled, but the widget code has not been loaded!');for(p.sort(function(e,t){return e.priority<t.priority?-1:e.priority===t.priority?0:1}),n=p.length,g&&console[console.group?"group":"log"]("Start "+(o?"initializing":"applying")+" widgets"),a=0;a<n;a++)(l=p[a])&&l.id&&t.applyWidgetId(r,l.id,o);g&&console.groupEnd&&console.groupEnd()}c.timerReady=setTimeout(function(){r.isApplyingWidgets=!1,e.data(r,"lastWidgetApplication",new Date),c.$table.triggerHandler("tablesorter-ready"),o||"function"!=typeof s||s(r),g&&(l=c.widgets.length,console.log("Completed "+(!0===o?"initializing ":"applying ")+l+" widget"+(1!==l?"s":"")+t.benchmark(d)))},10)}},removeWidget:function(r,o,s){var a,n,i,l,d=(r=e(r)[0]).config;if(!0===o)for(o=[],l=t.widgets.length,i=0;i<l;i++)(n=t.widgets[i])&&n.id&&(o[o.length]=n.id);else o=(e.isArray(o)?o.join(","):o||"").toLowerCase().split(/[\s,]+/);for(l=o.length,a=0;a<l;a++)n=t.getWidgetById(o[a]),(i=e.inArray(o[a],d.widgets))>=0&&!0!==s&&d.widgets.splice(i,1),n&&n.remove&&(t.debug(d,"core")&&console.log((s?"Refreshing":"Removing")+' "'+o[a]+'" widget'),n.remove(r,d,d.widgetOptions,s),d.widgetInit[o[a]]=!1);d.$table.triggerHandler("widgetRemoveEnd",r)},refreshWidgets:function(r,o,s){var a,n,i=(r=e(r)[0]).config.widgets,l=t.widgets,d=l.length,c=[],g=function(t){e(t).triggerHandler("refreshComplete")};for(a=0;a<d;a++)(n=l[a])&&n.id&&(o||e.inArray(n.id,i)<0)&&(c[c.length]=n.id);t.removeWidget(r,c.join(","),!0),!0!==s?(t.applyWidget(r,o||!1,g),o&&t.applyWidget(r,!1,g)):g(r)},benchmark:function(e){return" ("+((new Date).getTime()-e.getTime())+" ms)"},log:function(){console.log(arguments)},debug:function(e,t){return e&&(!0===e.debug||"string"==typeof e.debug&&e.debug.indexOf(t)>-1)},isEmptyObject:function(e){for(var t in e)return!1;return!0},isValueInArray:function(e,t){var r,o=t&&t.length||0;for(r=0;r<o;r++)if(t[r][0]===e)return r;return-1},formatFloat:function(r,o){if("string"!=typeof r||""===r)return r;var s;return r=(o&&o.config?!1!==o.config.usNumberFormat:void 0===o||o)?r.replace(t.regex.comma,""):r.replace(t.regex.digitNonUS,"").replace(t.regex.comma,"."),t.regex.digitNegativeTest.test(r)&&(r=r.replace(t.regex.digitNegativeReplace,"-$1")),s=parseFloat(r),isNaN(s)?e.trim(r):s},isDigit:function(e){return isNaN(e)?t.regex.digitTest.test(e.toString().replace(t.regex.digitReplace,"")):""!==e},computeColumnIndex:function(r,o){var s,a,n,i,l,d,c,g,p,u,f=o&&o.columns||0,h=[],m=new Array(f);for(s=0;s<r.length;s++)for(d=r[s].cells,a=0;a<d.length;a++){for(c=s,g=(l=d[a]).rowSpan||1,p=l.colSpan||1,void 0===h[c]&&(h[c]=[]),n=0;n<h[c].length+1;n++)if(void 0===h[c][n]){u=n;break}for(f&&l.cellIndex===u||(l.setAttribute?l.setAttribute("data-column",u):e(l).attr("data-column",u)),n=c;n<c+g;n++)for(void 0===h[n]&&(h[n]=[]),m=h[n],i=u;i<u+p;i++)m[i]="x"}return t.checkColumnCount(r,h,m.length),m.length},checkColumnCount:function(e,t,r){var o,s,a=!0,n=[];for(o=0;o<t.length;o++)if(t[o]&&(s=t[o].length,t[o].length!==r)){a=!1;break}a||(e.each(function(e,t){var r=t.parentElement.nodeName;n.indexOf(r)<0&&n.push(r)}),console.error("Invalid or incorrect number of columns in the "+n.join(" or ")+"; expected "+r+", but found "+s+" columns"))},fixColumnWidth:function(r){var o,s,a,n,i,l=(r=e(r)[0]).config,d=l.$table.children("colgroup");if(d.length&&d.hasClass(t.css.colgroup)&&d.remove(),l.widthFixed&&0===l.$table.children("colgroup").length){for(d=e('<colgroup class="'+t.css.colgroup+'">'),o=l.$table.width(),n=(a=l.$tbodies.find("tr:first").children(":visible")).length,i=0;i<n;i++)s=parseInt(a.eq(i).width()/o*1e3,10)/10+"%",d.append(e("<col>").css("width",s));l.$table.prepend(d)}},getData:function(t,r,o){var s,a,n="",i=e(t);return i.length?(s=!!e.metadata&&i.metadata(),a=" "+(i.attr("class")||""),void 0!==i.data(o)||void 0!==i.data(o.toLowerCase())?n+=i.data(o)||i.data(o.toLowerCase()):s&&void 0!==s[o]?n+=s[o]:r&&void 0!==r[o]?n+=r[o]:" "!==a&&a.match(" "+o+"-")&&(n=a.match(new RegExp("\\s"+o+"-([\\w-]+)"))[1]||""),e.trim(n)):""},getColumnData:function(t,r,o,s,a){if("object"!=typeof r||null===r)return r;var n,i=(t=e(t)[0]).config,l=a||i.$headers,d=i.$headerIndexed&&i.$headerIndexed[o]||l.find('[data-column="'+o+'"]:last');if(void 0!==r[o])return s?r[o]:r[l.index(d)];for(n in r)if("string"==typeof n&&d.filter(n).add(d.find(n)).length)return r[n]},isProcessing:function(r,o,s){var a=(r=e(r))[0].config,n=s||r.find("."+t.css.header);o?(void 0!==s&&a.sortList.length>0&&(n=n.filter(function(){return!this.sortDisabled&&t.isValueInArray(parseFloat(e(this).attr("data-column")),a.sortList)>=0})),r.add(n).addClass(t.css.processing+" "+a.cssProcessing)):r.add(n).removeClass(t.css.processing+" "+a.cssProcessing)},processTbody:function(t,r,o){if(t=e(t)[0],o)return t.isProcessing=!0,r.before('<colgroup class="tablesorter-savemyplace"/>'),e.fn.detach?r.detach():r.remove();var s=e(t).find("colgroup.tablesorter-savemyplace");r.insertAfter(s),s.remove(),t.isProcessing=!1},clearTableBody:function(t){e(t)[0].config.$tbodies.children().detach()},characterEquivalents:{a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},replaceAccents:function(e){var r,o="[",s=t.characterEquivalents;if(!t.characterRegex){t.characterRegexArray={};for(r in s)"string"==typeof r&&(o+=s[r],t.characterRegexArray[r]=new RegExp("["+s[r]+"]","g"));t.characterRegex=new RegExp(o+"]")}if(t.characterRegex.test(e))for(r in s)"string"==typeof r&&(e=e.replace(t.characterRegexArray[r],r));return e},validateOptions:function(r){var o,s,a,n,i="headers sortForce sortList sortAppend widgets".split(" "),l=r.originalSettings;if(l){t.debug(r,"core")&&(n=new Date);for(o in l)if("undefined"===(a=typeof t.defaults[o]))console.warn('Tablesorter Warning! "table.config.'+o+'" option not recognized');else if("object"===a)for(s in l[o])a=t.defaults[o]&&typeof t.defaults[o][s],e.inArray(o,i)<0&&"undefined"===a&&console.warn('Tablesorter Warning! "table.config.'+o+"."+s+'" option not recognized');t.debug(r,"core")&&console.log("validate options time:"+t.benchmark(n))}},restoreHeaders:function(r){var o,s,a=e(r)[0].config,n=a.$table.find(a.selectorHeaders),i=n.length;for(o=0;o<i;o++)(s=n.eq(o)).find("."+t.css.headerIn).length&&s.html(a.headerContent[o])},destroy:function(r,o,s){if((r=e(r)[0]).hasInitialized){t.removeWidget(r,!0,!1);var a,n=e(r),i=r.config,l=n.find("thead:first"),d=l.find("tr."+t.css.headerRow).removeClass(t.css.headerRow+" "+i.cssHeaderRow),c=n.find("tfoot:first > tr").children("th, td");!1===o&&e.inArray("uitheme",i.widgets)>=0&&(n.triggerHandler("applyWidgetId",["uitheme"]),n.triggerHandler("applyWidgetId",["zebra"])),l.find("tr").not(d).remove(),a="sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave "+"keypress sortBegin sortEnd resetToLoadState ".split(" ").join(i.namespace+" "),n.removeData("tablesorter").unbind(a.replace(t.regex.spaces," ")),i.$headers.add(c).removeClass([t.css.header,i.cssHeader,i.cssAsc,i.cssDesc,t.css.sortAsc,t.css.sortDesc,t.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),d.find(i.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(i.namespace+" ").replace(t.regex.spaces," ")),t.restoreHeaders(r),n.toggleClass(t.css.table+" "+i.tableClass+" tablesorter-"+i.theme,!1===o),n.removeClass(i.namespace.slice(1)),r.hasInitialized=!1,delete r.config.cache,"function"==typeof s&&s(r),t.debug(i,"core")&&console.log("tablesorter has been removed")}}};e.fn.tablesorter=function(r){return this.each(function(){var o=this,s=e.extend(!0,{},t.defaults,r,t.instanceMethods);s.originalSettings=r,!o.hasInitialized&&t.buildTable&&"TABLE"!==this.nodeName?t.buildTable(o,s):t.setup(o,s)})},window.console&&window.console.log||(t.logs=[],console={},console.log=console.warn=console.error=console.table=function(){var e=arguments.length>1?arguments:arguments[0];t.logs[t.logs.length]={date:Date.now(),log:e}}),t.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),t.addParser({id:"text",is:function(){return!0},format:function(r,o){var s=o.config;return r&&(r=e.trim(s.ignoreCase?r.toLocaleLowerCase():r),r=s.sortLocaleCompare?t.replaceAccents(r):r),r},type:"text"}),t.regex.nondigit=/[^\w,. \-()]/g,t.addParser({id:"digit",is:function(e){return t.isDigit(e)},format:function(r,o){var s=t.formatFloat((r||"").replace(t.regex.nondigit,""),o);return r&&"number"==typeof s?s:r?e.trim(r&&o.config.ignoreCase?r.toLocaleLowerCase():r):r},type:"numeric"}),t.regex.currencyReplace=/[+\-,. ]/g,t.regex.currencyTest=/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/,t.addParser({id:"currency",is:function(e){return e=(e||"").replace(t.regex.currencyReplace,""),t.regex.currencyTest.test(e)},format:function(r,o){var s=t.formatFloat((r||"").replace(t.regex.nondigit,""),o);return r&&"number"==typeof s?s:r?e.trim(r&&o.config.ignoreCase?r.toLocaleLowerCase():r):r},type:"numeric"}),t.regex.urlProtocolTest=/^(https?|ftp|file):\/\//,t.regex.urlProtocolReplace=/(https?|ftp|file):\/\/(www\.)?/,t.addParser({id:"url",is:function(e){return t.regex.urlProtocolTest.test(e)},format:function(r){return r?e.trim(r.replace(t.regex.urlProtocolReplace,"")):r},type:"text"}),t.regex.dash=/-/g,t.regex.isoDate=/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/,t.addParser({id:"isoDate",is:function(e){return t.regex.isoDate.test(e)},format:function(e){var r=e?new Date(e.replace(t.regex.dash,"/")):e;return r instanceof Date&&isFinite(r)?r.getTime():e},type:"numeric"}),t.regex.percent=/%/g,t.regex.percentTest=/(\d\s*?%|%\s*?\d)/,t.addParser({id:"percent",is:function(e){return t.regex.percentTest.test(e)&&e.length<15},format:function(e,r){return e?t.formatFloat(e.replace(t.regex.percent,""),r):e},type:"numeric"}),t.addParser({id:"image",is:function(e,t,r,o){return o.find("img").length>0},format:function(t,r,o){return e(o).find("img").attr(r.config.imgAttr||"alt")||t},parsed:!0,type:"text"}),t.regex.dateReplace=/(\S)([AP]M)$/i,t.regex.usLongDateTest1=/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i,t.regex.usLongDateTest2=/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i,t.addParser({id:"usLongDate",is:function(e){return t.regex.usLongDateTest1.test(e)||t.regex.usLongDateTest2.test(e)},format:function(e){var r=e?new Date(e.replace(t.regex.dateReplace,"$1 $2")):e;return r instanceof Date&&isFinite(r)?r.getTime():e},type:"numeric"}),t.regex.shortDateTest=/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/,t.regex.shortDateReplace=/[\-.,]/g,t.regex.shortDateXXY=/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,t.regex.shortDateYMD=/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,t.convertFormat=function(e,r){e=(e||"").replace(t.regex.spaces," ").replace(t.regex.shortDateReplace,"/"),"mmddyyyy"===r?e=e.replace(t.regex.shortDateXXY,"$3/$1/$2"):"ddmmyyyy"===r?e=e.replace(t.regex.shortDateXXY,"$3/$2/$1"):"yyyymmdd"===r&&(e=e.replace(t.regex.shortDateYMD,"$1/$2/$3"));var o=new Date(e);return o instanceof Date&&isFinite(o)?o.getTime():""},t.addParser({id:"shortDate",is:function(e){return e=(e||"").replace(t.regex.spaces," ").replace(t.regex.shortDateReplace,"/"),t.regex.shortDateTest.test(e)},format:function(e,r,o,s){if(e){var a=r.config,n=a.$headerIndexed[s],i=n.length&&n.data("dateFormat")||t.getData(n,t.getColumnData(r,a.headers,s),"dateFormat")||a.dateFormat;return n.length&&n.data("dateFormat",i),t.convertFormat(e,i)||e}return e},type:"numeric"}),t.regex.timeTest=/^(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)$|^((?:[01]\d|[2][0-4]):[0-5]\d)$/i,t.regex.timeMatch=/(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i,t.addParser({id:"time",is:function(e){return t.regex.timeTest.test(e)},format:function(e){var r,o=(e||"").match(t.regex.timeMatch),s=new Date(e),a=e&&(null!==o?o[0]:"00:00 AM"),n=a?new Date("2000/01/01 "+a.replace(t.regex.dateReplace,"$1 $2")):a;return n instanceof Date&&isFinite(n)?(r=s instanceof Date&&isFinite(s)?s.getTime():0,r?parseFloat(n.getTime()+"."+s.getTime()):n.getTime()):e},type:"numeric"}),t.addParser({id:"metadata",is:function(){return!1},format:function(t,r,o){var s=r.config,a=s.parserMetadataName?s.parserMetadataName:"sortValue";return e(o).metadata()[a]},type:"numeric"}),t.addWidget({id:"zebra",priority:90,format:function(t,r,o){var s,a,n,i,l,d,c,g=new RegExp(r.cssChildRow,"i"),p=r.$tbodies.add(e(r.namespace+"_extra_table").children("tbody:not(."+r.cssInfoBlock+")"));for(l=0;l<p.length;l++)for(n=0,c=(s=p.eq(l).children("tr:visible").not(r.selectorRemove)).length,d=0;d<c;d++)a=s.eq(d),g.test(a[0].className)||n++,i=n%2==0,a.removeClass(o.zebra[i?1:0]).addClass(o.zebra[i?0:1])},remove:function(e,r,o,s){if(!s){var a,n,i=r.$tbodies,l=(o.zebra||["even","odd"]).join(" ");for(a=0;a<i.length;a++)(n=t.processTbody(e,i.eq(a),!0)).children().removeClass(l),t.processTbody(e,n,!1)}}})}(e),e.tablesorter});
1
+ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(A){"use strict";var L=A.tablesorter={version:"2.31.0",parsers:[],widgets:[],defaults:{theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",duplicateSpan:!0,textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,initWidgets:!0,widgetClass:"widget-{name}",widgets:[],widgetOptions:{zebra:["even","odd"]},initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssIconDisabled:"",pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[],globalize:0,imgAttr:0},css:{table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},language:{sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",sortDisabled:"sorting is disabled",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},regex:{templateContent:/\{content\}/g,templateIcon:/\{icon\}/g,templateName:/\{name\}/i,spaces:/\s+/g,nonWord:/\W/g,formElements:/(input|select|button|textarea)/i,chunk:/(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i,comma:/,/g,digitNonUS:/[\s|\.]/g,digitNegativeTest:/^\s*\([.\d]+\)/,digitNegativeReplace:/^\s*\(([.\d]+)\)/,digitTest:/^[\-+(]?\d+[)]?$/,digitReplace:/[,.'"\s]/g},string:{max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},keyCodes:{enter:13},dates:{},instanceMethods:{},setup:function(t,r){if(t&&t.tHead&&0!==t.tBodies.length&&!0!==t.hasInitialized){var e,o="",s=A(t),a=A.metadata;t.hasInitialized=!1,t.isProcessing=!0,t.config=r,A.data(t,"tablesorter",r),L.debug(r,"core")&&(console[console.group?"group":"log"]("Initializing tablesorter v"+L.version),A.data(t,"startoveralltimer",new Date)),r.supportsDataObject=((e=A.fn.jquery.split("."))[0]=parseInt(e[0],10),1<e[0]||1===e[0]&&4<=parseInt(e[1],10)),r.emptyTo=r.emptyTo.toLowerCase(),r.stringTo=r.stringTo.toLowerCase(),r.last={sortList:[],clickedIndex:-1},/tablesorter\-/.test(s.attr("class"))||(o=""!==r.theme?" tablesorter-"+r.theme:""),r.namespace?r.namespace="."+r.namespace.replace(L.regex.nonWord,""):r.namespace=".tablesorter"+Math.random().toString(16).slice(2),r.table=t,r.$table=s.addClass(L.css.table+" "+r.tableClass+o+" "+r.namespace.slice(1)).attr("role","grid"),r.$headers=s.find(r.selectorHeaders),r.$table.children().children("tr").attr("role","row"),r.$tbodies=s.children("tbody:not(."+r.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),r.$table.children("caption").length&&((o=r.$table.children("caption")[0]).id||(o.id=r.namespace.slice(1)+"caption"),r.$table.attr("aria-labelledby",o.id)),r.widgetInit={},r.textExtraction=r.$table.attr("data-text-extraction")||r.textExtraction||"basic",L.buildHeaders(r),L.fixColumnWidth(t),L.addWidgetFromClass(t),L.applyWidgetOptions(t),L.setupParsers(r),r.totalRows=0,r.debug&&L.validateOptions(r),r.delayInit||L.buildCache(r),L.bindEvents(t,r.$headers,!0),L.bindMethods(r),r.supportsDataObject&&void 0!==s.data().sortlist?r.sortList=s.data().sortlist:a&&s.metadata()&&s.metadata().sortlist&&(r.sortList=s.metadata().sortlist),L.applyWidget(t,!0),0<r.sortList.length?L.sortOn(r,r.sortList,{},!r.initWidgets):(L.setHeadersCss(r),r.initWidgets&&L.applyWidget(t,!1)),r.showProcessing&&s.unbind("sortBegin"+r.namespace+" sortEnd"+r.namespace).bind("sortBegin"+r.namespace+" sortEnd"+r.namespace,function(e){clearTimeout(r.timerProcessing),L.isProcessing(t),"sortBegin"===e.type&&(r.timerProcessing=setTimeout(function(){L.isProcessing(t,!0)},500))}),t.hasInitialized=!0,t.isProcessing=!1,L.debug(r,"core")&&(console.log("Overall initialization time:"+L.benchmark(A.data(t,"startoveralltimer"))),L.debug(r,"core")&&console.groupEnd&&console.groupEnd()),s.triggerHandler("tablesorter-initialized",t),"function"==typeof r.initialized&&r.initialized(t)}else L.debug(r,"core")&&(t.hasInitialized?console.warn("Stopping initialization. Tablesorter has already been initialized"):console.error("Stopping initialization! No table, thead or tbody",t))},bindMethods:function(r){var e=r.$table,t=r.namespace,o="sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(t+" ");e.unbind(o.replace(L.regex.spaces," ")).bind("sortReset"+t,function(e,t){e.stopPropagation(),L.sortReset(this.config,function(e){e.isApplyingWidgets?setTimeout(function(){L.applyWidget(e,"",t)},100):L.applyWidget(e,"",t)})}).bind("updateAll"+t,function(e,t,r){e.stopPropagation(),L.updateAll(this.config,t,r)}).bind("update"+t+" updateRows"+t,function(e,t,r){e.stopPropagation(),L.update(this.config,t,r)}).bind("updateHeaders"+t,function(e,t){e.stopPropagation(),L.updateHeaders(this.config,t)}).bind("updateCell"+t,function(e,t,r,o){e.stopPropagation(),L.updateCell(this.config,t,r,o)}).bind("addRows"+t,function(e,t,r,o){e.stopPropagation(),L.addRows(this.config,t,r,o)}).bind("updateComplete"+t,function(){this.isUpdating=!1}).bind("sorton"+t,function(e,t,r,o){e.stopPropagation(),L.sortOn(this.config,t,r,o)}).bind("appendCache"+t,function(e,t,r){e.stopPropagation(),L.appendCache(this.config,r),A.isFunction(t)&&t(this)}).bind("updateCache"+t,function(e,t,r){e.stopPropagation(),L.updateCache(this.config,t,r)}).bind("applyWidgetId"+t,function(e,t){e.stopPropagation(),L.applyWidgetId(this,t)}).bind("applyWidgets"+t,function(e,t){e.stopPropagation(),L.applyWidget(this,!1,t)}).bind("refreshWidgets"+t,function(e,t,r){e.stopPropagation(),L.refreshWidgets(this,t,r)}).bind("removeWidget"+t,function(e,t,r){e.stopPropagation(),L.removeWidget(this,t,r)}).bind("destroy"+t,function(e,t,r){e.stopPropagation(),L.destroy(this,t,r)}).bind("resetToLoadState"+t,function(e){e.stopPropagation(),L.removeWidget(this,!0,!1);var t=A.extend(!0,{},r.originalSettings);(r=A.extend(!0,{},L.defaults,t)).originalSettings=t,this.hasInitialized=!1,L.setup(this,r)})},bindEvents:function(e,t,r){var o,i=(e=A(e)[0]).config,s=i.namespace,d=null;!0!==r&&(t.addClass(s.slice(1)+"_extra_headers"),(o=L.getClosest(t,"table")).length&&"TABLE"===o[0].nodeName&&o[0]!==e&&A(o[0]).addClass(s.slice(1)+"_extra_table")),o=(i.pointerDown+" "+i.pointerUp+" "+i.pointerClick+" sort keyup ").replace(L.regex.spaces," ").split(" ").join(s+" "),t.find(i.selectorSort).add(t.filter(i.selectorSort)).unbind(o).bind(o,function(e,t){var r,o,s,a=A(e.target),n=" "+e.type+" ";if(!(1!==(e.which||e.button)&&!n.match(" "+i.pointerClick+" | sort | keyup ")||" keyup "===n&&e.which!==L.keyCodes.enter||n.match(" "+i.pointerClick+" ")&&void 0!==e.which||n.match(" "+i.pointerUp+" ")&&d!==e.target&&!0!==t)){if(n.match(" "+i.pointerDown+" "))return d=e.target,void("1"===(s=a.jquery.split("."))[0]&&s[1]<4&&e.preventDefault());if(d=null,r=L.getClosest(A(this),"."+L.css.header),L.regex.formElements.test(e.target.nodeName)||a.hasClass(i.cssNoSort)||0<a.parents("."+i.cssNoSort).length||r.hasClass("sorter-false")||0<a.parents("button").length)return!i.cancelSelection;i.delayInit&&L.isEmptyObject(i.cache)&&L.buildCache(i),i.last.clickedIndex=r.attr("data-column")||r.index(),(o=i.$headerIndexed[i.last.clickedIndex][0])&&!o.sortDisabled&&L.initSort(i,o,e)}}),i.cancelSelection&&t.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},buildHeaders:function(d){var e,l,t,r;for(d.headerList=[],d.headerContent=[],d.sortVars=[],L.debug(d,"core")&&(t=new Date),d.columns=L.computeColumnIndex(d.$table.children("thead, tfoot").children("tr")),l=d.cssIcon?'<i class="'+(d.cssIcon===L.css.icon?L.css.icon:d.cssIcon+" "+L.css.icon)+'"></i>':"",d.$headers=A(A.map(d.$table.find(d.selectorHeaders),function(e,t){var r,o,s,a,n,i=A(e);if(!L.getClosest(i,"tr").hasClass(d.cssIgnoreRow))return/(th|td)/i.test(e.nodeName)||(n=L.getClosest(i,"th, td"),i.attr("data-column",n.attr("data-column"))),r=L.getColumnData(d.table,d.headers,t,!0),d.headerContent[t]=i.html(),""===d.headerTemplate||i.find("."+L.css.headerIn).length||(a=d.headerTemplate.replace(L.regex.templateContent,i.html()).replace(L.regex.templateIcon,i.find("."+L.css.icon).length?"":l),d.onRenderTemplate&&(o=d.onRenderTemplate.apply(i,[t,a]))&&"string"==typeof o&&(a=o),i.html('<div class="'+L.css.headerIn+'">'+a+"</div>")),d.onRenderHeader&&d.onRenderHeader.apply(i,[t,d,d.$table]),s=parseInt(i.attr("data-column"),10),e.column=s,n=L.getOrder(L.getData(i,r,"sortInitialOrder")||d.sortInitialOrder),d.sortVars[s]={count:-1,order:n?d.sortReset?[1,0,2]:[1,0]:d.sortReset?[0,1,2]:[0,1],lockedOrder:!1,sortedBy:""},void 0!==(n=L.getData(i,r,"lockedOrder")||!1)&&!1!==n&&(d.sortVars[s].lockedOrder=!0,d.sortVars[s].order=L.getOrder(n)?[1,1]:[0,0]),d.headerList[t]=e,i.addClass(L.css.header+" "+d.cssHeader),L.getClosest(i,"tr").addClass(L.css.headerRow+" "+d.cssHeaderRow).attr("role","row"),d.tabIndex&&i.attr("tabindex",0),e})),d.$headerIndexed=[],r=0;r<d.columns;r++)L.isEmptyObject(d.sortVars[r])&&(d.sortVars[r]={}),e=d.$headers.filter('[data-column="'+r+'"]'),d.$headerIndexed[r]=e.length?e.not(".sorter-false").length?e.not(".sorter-false").filter(":last"):e.filter(":last"):A();d.$table.find(d.selectorHeaders).attr({scope:"col",role:"columnheader"}),L.updateHeader(d),L.debug(d,"core")&&(console.log("Built headers:"+L.benchmark(t)),console.log(d.$headers))},addInstanceMethods:function(e){A.extend(L.instanceMethods,e)},setupParsers:function(e,t){var r,o,s,a,n,i,d,l,c,g,p,u,f,h,m=e.table,b=0,y=L.debug(e,"core"),w={};if(e.$tbodies=e.$table.children("tbody:not(."+e.cssInfoBlock+")"),0===(h=(f=void 0===t?e.$tbodies:t).length))return y?console.warn("Warning: *Empty table!* Not building a parser cache"):"";for(y&&(u=new Date,console[console.group?"group":"log"]("Detecting parsers for each column")),o={extractors:[],parsers:[]};b<h;){if((r=f[b].rows).length)for(n=0,a=e.columns,i=0;i<a;i++){if((d=e.$headerIndexed[n])&&d.length&&(l=L.getColumnData(m,e.headers,n),p=L.getParserById(L.getData(d,l,"extractor")),g=L.getParserById(L.getData(d,l,"sorter")),c="false"===L.getData(d,l,"parser"),e.empties[n]=(L.getData(d,l,"empty")||e.emptyTo||(e.emptyToBottom?"bottom":"top")).toLowerCase(),e.strings[n]=(L.getData(d,l,"string")||e.stringTo||"max").toLowerCase(),c&&(g=L.getParserById("no-parser")),p||(p=!1),g||(g=L.detectParserForColumn(e,r,-1,n)),y&&(w["("+n+") "+d.text()]={parser:g.id,extractor:p?p.id:"none",string:e.strings[n],empty:e.empties[n]}),o.parsers[n]=g,o.extractors[n]=p,0<(s=d[0].colSpan-1)))for(n+=s,a+=s;0<s+1;)o.parsers[n-s]=g,o.extractors[n-s]=p,s--;n++}b+=o.parsers.length?h:1}y&&(L.isEmptyObject(w)?console.warn(" No parsers detected!"):console[console.table?"table":"log"](w),console.log("Completed detecting parsers"+L.benchmark(u)),console.groupEnd&&console.groupEnd()),e.parsers=o.parsers,e.extractors=o.extractors},addParser:function(e){var t,r=L.parsers.length,o=!0;for(t=0;t<r;t++)L.parsers[t].id.toLowerCase()===e.id.toLowerCase()&&(o=!1);o&&(L.parsers[L.parsers.length]=e)},getParserById:function(e){if("false"==e)return!1;var t,r=L.parsers.length;for(t=0;t<r;t++)if(L.parsers[t].id.toLowerCase()===e.toString().toLowerCase())return L.parsers[t];return!1},detectParserForColumn:function(e,t,r,o){for(var s,a,n,i=L.parsers.length,d=!1,l="",c=L.debug(e,"core"),g=!0;""===l&&g;)(n=t[++r])&&r<50?n.className.indexOf(L.cssIgnoreRow)<0&&(d=t[r].cells[o],l=L.getElementText(e,d,o),a=A(d),c&&console.log("Checking if value was empty on row "+r+", column: "+o+': "'+l+'"')):g=!1;for(;0<=--i;)if((s=L.parsers[i])&&"text"!==s.id&&s.is&&s.is(l,e.table,d,a))return s;return L.getParserById("text")},getElementText:function(e,t,r){if(!t)return"";var o,s=e.textExtraction||"",a=t.jquery?t:A(t);return"string"==typeof s?"basic"===s&&void 0!==(o=a.attr(e.textAttribute))?A.trim(o):A.trim(t.textContent||a.text()):"function"==typeof s?A.trim(s(a[0],e.table,r)):"function"==typeof(o=L.getColumnData(e.table,s,r))?A.trim(o(a[0],e.table,r)):A.trim(a[0].textContent||a.text())},getParsedText:function(e,t,r,o){void 0===o&&(o=L.getElementText(e,t,r));var s=""+o,a=e.parsers[r],n=e.extractors[r];return a&&(n&&"function"==typeof n.format&&(o=n.format(o,e.table,t,r)),s="no-parser"===a.id?"":a.format(""+o,e.table,t,r),e.ignoreCase&&"string"==typeof s&&(s=s.toLowerCase())),s},buildCache:function(e,t,r){var o,s,a,n,i,d,l,c,g,p,u,f,h,m,b,y,w,x,v,C,$,I,D=e.table,R=e.parsers,T=L.debug(e,"core");if(e.$tbodies=e.$table.children("tbody:not(."+e.cssInfoBlock+")"),l=void 0===r?e.$tbodies:r,e.cache={},e.totalRows=0,!R)return T?console.warn("Warning: *Empty table!* Not building a cache"):"";for(T&&(f=new Date),e.showProcessing&&L.isProcessing(D,!0),d=0;d<l.length;d++){for(y=[],o=e.cache[d]={normalized:[]},h=l[d]&&l[d].rows.length||0,n=0;n<h;++n)if(m={child:[],raw:[]},g=[],!(c=A(l[d].rows[n])).hasClass(e.selectorRemove.slice(1)))if(c.hasClass(e.cssChildRow)&&0!==n)for($=o.normalized.length-1,(b=o.normalized[$][e.columns]).$row=b.$row.add(c),c.prev().hasClass(e.cssChildRow)||c.prev().addClass(L.css.cssHasChild),p=c.children("th, td"),$=b.child.length,b.child[$]=[],x=0,C=e.columns,i=0;i<C;i++)(u=p[i])&&(b.child[$][i]=L.getParsedText(e,u,i),0<(w=p[i].colSpan-1)&&(x+=w,C+=w)),x++;else{for(m.$row=c,m.order=n,x=0,C=e.columns,i=0;i<C;++i){if((u=c[0].cells[i])&&x<e.columns&&(!(v=void 0!==R[x])&&T&&console.warn("No parser found for row: "+n+", column: "+i+'; cell containing: "'+A(u).text()+'"; does it have a header?'),s=L.getElementText(e,u,x),m.raw[x]=s,a=L.getParsedText(e,u,x,s),g[x]=a,v&&"numeric"===(R[x].type||"").toLowerCase()&&(y[x]=Math.max(Math.abs(a)||0,y[x]||0)),0<(w=u.colSpan-1))){for(I=0;I<=w;)a=e.duplicateSpan||0===I?s:"string"!=typeof e.textExtraction&&L.getElementText(e,u,x+I)||"",m.raw[x+I]=a,g[x+I]=a,I++;x+=w,C+=w}x++}g[e.columns]=m,o.normalized[o.normalized.length]=g}o.colMax=y,e.totalRows+=o.normalized.length}if(e.showProcessing&&L.isProcessing(D),T){for($=Math.min(5,e.cache[0].normalized.length),console[console.group?"group":"log"]("Building cache for "+e.totalRows+" rows (showing "+$+" rows in log) and "+e.columns+" columns"+L.benchmark(f)),s={},i=0;i<e.columns;i++)for(x=0;x<$;x++)s["row: "+x]||(s["row: "+x]={}),s["row: "+x][e.$headerIndexed[i].text()]=e.cache[0].normalized[x][i];console[console.table?"table":"log"](s),console.groupEnd&&console.groupEnd()}A.isFunction(t)&&t(D)},getColumnText:function(e,t,r,o){var s,a,n,i,d,l,c,g,p,u,f="function"==typeof r,h="all"===t,m={raw:[],parsed:[],$cell:[]},b=(e=A(e)[0]).config;if(!L.isEmptyObject(b)){for(d=b.$tbodies.length,s=0;s<d;s++)for(l=(n=b.cache[s].normalized).length,a=0;a<l;a++)i=n[a],o&&!i[b.columns].$row.is(o)||(u=!0,g=h?i.slice(0,b.columns):i[t],i=i[b.columns],c=h?i.raw:i.raw[t],p=h?i.$row.children():i.$row.children().eq(t),f&&(u=r({tbodyIndex:s,rowIndex:a,parsed:g,raw:c,$row:i.$row,$cell:p})),!1!==u&&(m.parsed[m.parsed.length]=g,m.raw[m.raw.length]=c,m.$cell[m.$cell.length]=p));return m}L.debug(b,"core")&&console.warn("No cache found - aborting getColumnText function!")},setHeadersCss:function(a){var e,t,r=a.sortList,o=r.length,s=L.css.sortNone+" "+a.cssNone,n=[L.css.sortAsc+" "+a.cssAsc,L.css.sortDesc+" "+a.cssDesc],i=[a.cssIconAsc,a.cssIconDesc,a.cssIconNone],d=["ascending","descending"],l=function(e,t){e.removeClass(s).addClass(n[t]).attr("aria-sort",d[t]).find("."+L.css.icon).removeClass(i[2]).addClass(i[t])},c=a.$table.find("tfoot tr").children("td, th").add(A(a.namespace+"_extra_headers")).removeClass(n.join(" ")),g=a.$headers.add(A("thead "+a.namespace+"_extra_headers")).removeClass(n.join(" ")).addClass(s).attr("aria-sort","none").find("."+L.css.icon).removeClass(i.join(" ")).end();for(g.not(".sorter-false").find("."+L.css.icon).addClass(i[2]),a.cssIconDisabled&&g.filter(".sorter-false").find("."+L.css.icon).addClass(a.cssIconDisabled),e=0;e<o;e++)if(2!==r[e][1]){if((g=(g=a.$headers.filter(function(e){for(var t=!0,r=a.$headers.eq(e),o=parseInt(r.attr("data-column"),10),s=o+L.getClosest(r,"th, td")[0].colSpan;o<s;o++)t=!!t&&(t||-1<L.isValueInArray(o,a.sortList));return t})).not(".sorter-false").filter('[data-column="'+r[e][0]+'"]'+(1===o?":last":""))).length)for(t=0;t<g.length;t++)g[t].sortDisabled||l(g.eq(t),r[e][1]);c.length&&l(c.filter('[data-column="'+r[e][0]+'"]'),r[e][1])}for(o=a.$headers.length,e=0;e<o;e++)L.setColumnAriaLabel(a,a.$headers.eq(e))},getClosest:function(e,t){return A.fn.closest?e.closest(t):e.is(t)?e:e.parents(t).filter(":first")},setColumnAriaLabel:function(e,t,r){if(t.length){var o=parseInt(t.attr("data-column"),10),s=e.sortVars[o],a=t.hasClass(L.css.sortAsc)?"sortAsc":t.hasClass(L.css.sortDesc)?"sortDesc":"sortNone",n=A.trim(t.text())+": "+L.language[a];t.hasClass("sorter-false")||!1===r?n+=L.language.sortDisabled:(a=(s.count+1)%s.order.length,r=s.order[a],n+=L.language[0===r?"nextAsc":1===r?"nextDesc":"nextNone"]),t.attr("aria-label",n),s.sortedBy?t.attr("data-sortedBy",s.sortedBy):t.removeAttr("data-sortedBy")}},updateHeader:function(e){var t,r,o,s,a=e.table,n=e.$headers.length;for(t=0;t<n;t++)o=e.$headers.eq(t),s=L.getColumnData(a,e.headers,t,!0),r="false"===L.getData(o,s,"sorter")||"false"===L.getData(o,s,"parser"),L.setColumnSort(e,o,r)},setColumnSort:function(e,t,r){var o=e.table.id;t[0].sortDisabled=r,t[r?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+r),e.tabIndex&&(r?t.removeAttr("tabindex"):t.attr("tabindex","0")),o&&(r?t.removeAttr("aria-controls"):t.attr("aria-controls",o))},updateHeaderSortCount:function(e,t){var r,o,s,a,n,i,d,l,c=t||e.sortList,g=c.length;for(e.sortList=[],a=0;a<g;a++)if(d=c[a],(r=parseInt(d[0],10))<e.columns){switch(e.sortVars[r].order||(l=L.getOrder(e.sortInitialOrder)?e.sortReset?[1,0,2]:[1,0]:e.sortReset?[0,1,2]:[0,1],e.sortVars[r].order=l,e.sortVars[r].count=0),l=e.sortVars[r].order,o=(o=(""+d[1]).match(/^(1|d|s|o|n)/))?o[0]:""){case"1":case"d":o=1;break;case"s":o=n||0;break;case"o":o=0===(i=l[(n||0)%l.length])?1:1===i?0:2;break;case"n":o=l[++e.sortVars[r].count%l.length];break;default:o=0}n=0===a?o:n,s=[r,parseInt(o,10)||0],e.sortList[e.sortList.length]=s,o=A.inArray(s[1],l),e.sortVars[r].count=0<=o?o:s[1]%l.length}},updateAll:function(e,t,r){var o=e.table;o.isUpdating=!0,L.refreshWidgets(o,!0,!0),L.buildHeaders(e),L.bindEvents(o,e.$headers,!0),L.bindMethods(e),L.commonUpdate(e,t,r)},update:function(e,t,r){e.table.isUpdating=!0,L.updateHeader(e),L.commonUpdate(e,t,r)},updateHeaders:function(e,t){e.table.isUpdating=!0,L.buildHeaders(e),L.bindEvents(e.table,e.$headers,!0),L.resortComplete(e,t)},updateCell:function(e,t,r,o){if(A(t).closest("tr").hasClass(e.cssChildRow))console.warn('Tablesorter Warning! "updateCell" for child row content has been disabled, use "update" instead');else{if(L.isEmptyObject(e.cache))return L.updateHeader(e),void L.commonUpdate(e,r,o);e.table.isUpdating=!0,e.$table.find(e.selectorRemove).remove();var s,a,n,i,d,l,c=e.$tbodies,g=A(t),p=c.index(L.getClosest(g,"tbody")),u=e.cache[p],f=L.getClosest(g,"tr");if(t=g[0],c.length&&0<=p){if(n=c.eq(p).find("tr").not("."+e.cssChildRow).index(f),d=u.normalized[n],(l=f[0].cells.length)!==e.columns)for(s=!1,a=i=0;a<l;a++)s||f[0].cells[a]===t?s=!0:i+=f[0].cells[a].colSpan;else i=g.index();s=L.getElementText(e,t,i),d[e.columns].raw[i]=s,s=L.getParsedText(e,t,i,s),d[i]=s,"numeric"===(e.parsers[i].type||"").toLowerCase()&&(u.colMax[i]=Math.max(Math.abs(s)||0,u.colMax[i]||0)),!1!==(s="undefined"!==r?r:e.resort)?L.checkResort(e,s,o):L.resortComplete(e,o)}else L.debug(e,"core")&&console.error("updateCell aborted, tbody missing or not within the indicated table"),e.table.isUpdating=!1}},addRows:function(e,t,r,o){var s,a,n,i,d,l,c,g,p,u,f,h,m,b="string"==typeof t&&1===e.$tbodies.length&&/<tr/.test(t||""),y=e.table;if(b)t=A(t),e.$tbodies.append(t);else if(!(t&&t instanceof A&&L.getClosest(t,"table")[0]===e.table))return L.debug(e,"core")&&console.error("addRows method requires (1) a jQuery selector reference to rows that have already been added to the table, or (2) row HTML string to be added to a table with only one tbody"),!1;if(y.isUpdating=!0,L.isEmptyObject(e.cache))L.updateHeader(e),L.commonUpdate(e,r,o);else{for(d=t.filter("tr").attr("role","row").length,n=e.$tbodies.index(t.parents("tbody").filter(":first")),e.parsers&&e.parsers.length||L.setupParsers(e),i=0;i<d;i++){for(p=0,c=t[i].cells.length,g=e.cache[n].normalized.length,f=[],u={child:[],raw:[],$row:t.eq(i),order:g},l=0;l<c;l++)h=t[i].cells[l],s=L.getElementText(e,h,p),u.raw[p]=s,a=L.getParsedText(e,h,p,s),f[p]=a,"numeric"===(e.parsers[p].type||"").toLowerCase()&&(e.cache[n].colMax[p]=Math.max(Math.abs(a)||0,e.cache[n].colMax[p]||0)),0<(m=h.colSpan-1)&&(p+=m),p++;f[e.columns]=u,e.cache[n].normalized[g]=f}L.checkResort(e,r,o)}},updateCache:function(e,t,r){e.parsers&&e.parsers.length||L.setupParsers(e,r),L.buildCache(e,t,r)},appendCache:function(e,t){var r,o,s,a,n,i,d,l=e.table,c=e.$tbodies,g=[],p=e.cache;if(L.isEmptyObject(p))return e.appender?e.appender(l,g):l.isUpdating?e.$table.triggerHandler("updateComplete",l):"";for(L.debug(e,"core")&&(d=new Date),i=0;i<c.length;i++)if((s=c.eq(i)).length){for(a=L.processTbody(l,s,!0),o=(r=p[i].normalized).length,n=0;n<o;n++)g[g.length]=r[n][e.columns].$row,e.appender&&(!e.pager||e.pager.removeRows||e.pager.ajax)||a.append(r[n][e.columns].$row);L.processTbody(l,a,!1)}e.appender&&e.appender(l,g),L.debug(e,"core")&&console.log("Rebuilt table"+L.benchmark(d)),t||e.appender||L.applyWidget(l),l.isUpdating&&e.$table.triggerHandler("updateComplete",l)},commonUpdate:function(e,t,r){e.$table.find(e.selectorRemove).remove(),L.setupParsers(e),L.buildCache(e),L.checkResort(e,t,r)},initSort:function(t,e,r){if(t.table.isUpdating)return setTimeout(function(){L.initSort(t,e,r)},50);var o,s,a,n,i,d,l,c=!r[t.sortMultiSortKey],g=t.table,p=t.$headers.length,u=L.getClosest(A(e),"th, td"),f=parseInt(u.attr("data-column"),10),h="mouseup"===r.type?"user":r.type,m=t.sortVars[f].order;if(u=u[0],t.$table.triggerHandler("sortStart",g),d=(t.sortVars[f].count+1)%m.length,t.sortVars[f].count=r[t.sortResetKey]?2:d,t.sortRestart)for(a=0;a<p;a++)l=t.$headers.eq(a),f!==(d=parseInt(l.attr("data-column"),10))&&(c||l.hasClass(L.css.sortNone))&&(t.sortVars[d].count=-1);if(c){if(A.each(t.sortVars,function(e){t.sortVars[e].sortedBy=""}),t.sortList=[],t.last.sortList=[],null!==t.sortForce)for(o=t.sortForce,s=0;s<o.length;s++)o[s][0]!==f&&(t.sortList[t.sortList.length]=o[s],t.sortVars[o[s][0]].sortedBy="sortForce");if((n=m[t.sortVars[f].count])<2&&(t.sortList[t.sortList.length]=[f,n],t.sortVars[f].sortedBy=h,1<u.colSpan))for(s=1;s<u.colSpan;s++)t.sortList[t.sortList.length]=[f+s,n],t.sortVars[f+s].count=A.inArray(n,m),t.sortVars[f+s].sortedBy=h}else if(t.sortList=A.extend([],t.last.sortList),0<=L.isValueInArray(f,t.sortList))for(t.sortVars[f].sortedBy=h,s=0;s<t.sortList.length;s++)(d=t.sortList[s])[0]===f&&(d[1]=m[t.sortVars[f].count],2===d[1]&&(t.sortList.splice(s,1),t.sortVars[f].count=-1));else if(n=m[t.sortVars[f].count],t.sortVars[f].sortedBy=h,n<2&&(t.sortList[t.sortList.length]=[f,n],1<u.colSpan))for(s=1;s<u.colSpan;s++)t.sortList[t.sortList.length]=[f+s,n],t.sortVars[f+s].count=A.inArray(n,m),t.sortVars[f+s].sortedBy=h;if(t.last.sortList=A.extend([],t.sortList),t.sortList.length&&t.sortAppend&&(o=A.isArray(t.sortAppend)?t.sortAppend:t.sortAppend[t.sortList[0][0]],!L.isEmptyObject(o)))for(s=0;s<o.length;s++)if(o[s][0]!==f&&L.isValueInArray(o[s][0],t.sortList)<0){if(i=(""+(n=o[s][1])).match(/^(a|d|s|o|n)/))switch(d=t.sortList[0][1],i[0]){case"d":n=1;break;case"s":n=d;break;case"o":n=0===d?1:0;break;case"n":n=(d+1)%m.length;break;default:n=0}t.sortList[t.sortList.length]=[o[s][0],n],t.sortVars[o[s][0]].sortedBy="sortAppend"}t.$table.triggerHandler("sortBegin",g),setTimeout(function(){L.setHeadersCss(t),L.multisort(t),L.appendCache(t),t.$table.triggerHandler("sortBeforeEnd",g),t.$table.triggerHandler("sortEnd",g)},1)},multisort:function(l){var e,t,c,r,g=l.table,p=[],u=0,f=l.textSorter||"",h=l.sortList,m=h.length,o=l.$tbodies.length;if(!l.serverSideSorting&&!L.isEmptyObject(l.cache)){if(L.debug(l,"core")&&(t=new Date),"object"==typeof f)for(c=l.columns;c--;)"function"==typeof(r=L.getColumnData(g,f,c))&&(p[c]=r);for(e=0;e<o;e++)c=l.cache[e].colMax,l.cache[e].normalized.sort(function(e,t){var r,o,s,a,n,i,d;for(r=0;r<m;r++){if(s=h[r][0],a=h[r][1],u=0===a,l.sortStable&&e[s]===t[s]&&1===m)return e[l.columns].order-t[l.columns].order;if((o=/n/i.test(L.getSortType(l.parsers,s)))&&l.strings[s]?(o="boolean"==typeof L.string[l.strings[s]]?(u?1:-1)*(L.string[l.strings[s]]?-1:1):l.strings[s]&&L.string[l.strings[s]]||0,n=l.numberSorter?l.numberSorter(e[s],t[s],u,c[s],g):L["sortNumeric"+(u?"Asc":"Desc")](e[s],t[s],o,c[s],s,l)):(i=u?e:t,d=u?t:e,n="function"==typeof f?f(i[s],d[s],u,s,g):"function"==typeof p[s]?p[s](i[s],d[s],u,s,g):L["sortNatural"+(u?"Asc":"Desc")](e[s]||"",t[s]||"",s,l)),n)return n}return e[l.columns].order-t[l.columns].order});L.debug(l,"core")&&console.log("Applying sort "+h.toString()+L.benchmark(t))}},resortComplete:function(e,t){e.table.isUpdating&&e.$table.triggerHandler("updateComplete",e.table),A.isFunction(t)&&t(e.table)},checkResort:function(e,t,r){var o=A.isArray(t)?t:e.sortList;!1===(void 0===t?e.resort:t)||e.serverSideSorting||e.table.isProcessing?(L.resortComplete(e,r),L.applyWidget(e.table,!1)):o.length?L.sortOn(e,o,function(){L.resortComplete(e,r)},!0):L.sortReset(e,function(){L.resortComplete(e,r),L.applyWidget(e.table,!1)})},sortOn:function(e,t,r,o){var s,a=e.table;for(e.$table.triggerHandler("sortStart",a),s=0;s<e.columns;s++)e.sortVars[s].sortedBy=-1<L.isValueInArray(s,t)?"sorton":"";L.updateHeaderSortCount(e,t),L.setHeadersCss(e),e.delayInit&&L.isEmptyObject(e.cache)&&L.buildCache(e),e.$table.triggerHandler("sortBegin",a),L.multisort(e),L.appendCache(e,o),e.$table.triggerHandler("sortBeforeEnd",a),e.$table.triggerHandler("sortEnd",a),L.applyWidget(a),A.isFunction(r)&&r(a)},sortReset:function(e,t){var r;for(e.sortList=[],r=0;r<e.columns;r++)e.sortVars[r].count=-1,e.sortVars[r].sortedBy="";L.setHeadersCss(e),L.multisort(e),L.appendCache(e),A.isFunction(t)&&t(e.table)},getSortType:function(e,t){return e&&e[t]&&e[t].type||""},getOrder:function(e){return/^d/i.test(e)||1===e},sortNatural:function(e,t){if(e===t)return 0;e=(e||"").toString(),t=(t||"").toString();var r,o,s,a,n,i,d=L.regex;if(d.hex.test(t)){if((r=parseInt(e.match(d.hex),16))<(o=parseInt(t.match(d.hex),16)))return-1;if(o<r)return 1}for(r=e.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0"),o=t.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0"),i=Math.max(r.length,o.length),n=0;n<i;n++){if(s=isNaN(r[n])?r[n]||0:parseFloat(r[n])||0,a=isNaN(o[n])?o[n]||0:parseFloat(o[n])||0,isNaN(s)!==isNaN(a))return isNaN(s)?1:-1;if(typeof s!=typeof a&&(s+="",a+=""),s<a)return-1;if(a<s)return 1}return 0},sortNaturalAsc:function(e,t,r,o){if(e===t)return 0;var s=L.string[o.empties[r]||o.emptyTo];return""===e&&0!==s?"boolean"==typeof s?s?-1:1:-s||-1:""===t&&0!==s?"boolean"==typeof s?s?1:-1:s||1:L.sortNatural(e,t)},sortNaturalDesc:function(e,t,r,o){if(e===t)return 0;var s=L.string[o.empties[r]||o.emptyTo];return""===e&&0!==s?"boolean"==typeof s?s?-1:1:s||1:""===t&&0!==s?"boolean"==typeof s?s?1:-1:-s||-1:L.sortNatural(t,e)},sortText:function(e,t){return t<e?1:e<t?-1:0},getTextValue:function(e,t,r){if(r){var o,s=e?e.length:0,a=r+t;for(o=0;o<s;o++)a+=e.charCodeAt(o);return t*a}return 0},sortNumericAsc:function(e,t,r,o,s,a){if(e===t)return 0;var n=L.string[a.empties[s]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:-n||-1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:n||1:(isNaN(e)&&(e=L.getTextValue(e,r,o)),isNaN(t)&&(t=L.getTextValue(t,r,o)),e-t)},sortNumericDesc:function(e,t,r,o,s,a){if(e===t)return 0;var n=L.string[a.empties[s]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:n||1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:-n||-1:(isNaN(e)&&(e=L.getTextValue(e,r,o)),isNaN(t)&&(t=L.getTextValue(t,r,o)),t-e)},sortNumeric:function(e,t){return e-t},addWidget:function(e){e.id&&!L.isEmptyObject(L.getWidgetById(e.id))&&console.warn('"'+e.id+'" widget was loaded more than once!'),L.widgets[L.widgets.length]=e},hasWidget:function(e,t){return(e=A(e)).length&&e[0].config&&e[0].config.widgetInit[t]||!1},getWidgetById:function(e){var t,r,o=L.widgets.length;for(t=0;t<o;t++)if((r=L.widgets[t])&&r.id&&r.id.toLowerCase()===e.toLowerCase())return r},applyWidgetOptions:function(e){var t,r,o,s=e.config,a=s.widgets.length;if(a)for(t=0;t<a;t++)(r=L.getWidgetById(s.widgets[t]))&&r.options&&(o=A.extend(!0,{},r.options),s.widgetOptions=A.extend(!0,o,s.widgetOptions),A.extend(!0,L.defaults.widgetOptions,r.options))},addWidgetFromClass:function(e){var t,r,o=e.config,s="^"+o.widgetClass.replace(L.regex.templateName,"(\\S+)+")+"$",a=new RegExp(s,"g"),n=(e.className||"").split(L.regex.spaces);if(n.length)for(t=n.length,r=0;r<t;r++)n[r].match(a)&&(o.widgets[o.widgets.length]=n[r].replace(a,"$1"))},applyWidgetId:function(e,t,r){var o,s,a,n=(e=A(e)[0]).config,i=n.widgetOptions,d=L.debug(n,"core"),l=L.getWidgetById(t);l&&(a=l.id,o=!1,A.inArray(a,n.widgets)<0&&(n.widgets[n.widgets.length]=a),d&&(s=new Date),!r&&n.widgetInit[a]||(n.widgetInit[a]=!0,e.hasInitialized&&L.applyWidgetOptions(e),"function"==typeof l.init&&(o=!0,d&&console[console.group?"group":"log"]("Initializing "+a+" widget"),l.init(e,l,n,i))),r||"function"!=typeof l.format||(o=!0,d&&console[console.group?"group":"log"]("Updating "+a+" widget"),l.format(e,n,i,!1)),d&&o&&(console.log("Completed "+(r?"initializing ":"applying ")+a+" widget"+L.benchmark(s)),console.groupEnd&&console.groupEnd()))},applyWidget:function(e,t,r){var o,s,a,n,i,d=(e=A(e)[0]).config,l=L.debug(d,"core"),c=[];if(!1===t||!e.hasInitialized||!e.isApplyingWidgets&&!e.isUpdating){if(l&&(i=new Date),L.addWidgetFromClass(e),clearTimeout(d.timerReady),d.widgets.length){for(e.isApplyingWidgets=!0,d.widgets=A.grep(d.widgets,function(e,t){return A.inArray(e,d.widgets)===t}),s=(a=d.widgets||[]).length,o=0;o<s;o++)(n=L.getWidgetById(a[o]))&&n.id?(n.priority||(n.priority=10),c[o]=n):l&&console.warn('"'+a[o]+'" was enabled, but the widget code has not been loaded!');for(c.sort(function(e,t){return e.priority<t.priority?-1:e.priority===t.priority?0:1}),s=c.length,l&&console[console.group?"group":"log"]("Start "+(t?"initializing":"applying")+" widgets"),o=0;o<s;o++)(n=c[o])&&n.id&&L.applyWidgetId(e,n.id,t);l&&console.groupEnd&&console.groupEnd()}d.timerReady=setTimeout(function(){e.isApplyingWidgets=!1,A.data(e,"lastWidgetApplication",new Date),d.$table.triggerHandler("tablesorter-ready"),t||"function"!=typeof r||r(e),l&&(n=d.widgets.length,console.log("Completed "+(!0===t?"initializing ":"applying ")+n+" widget"+(1!==n?"s":"")+L.benchmark(i)))},10)}},removeWidget:function(e,t,r){var o,s,a,n,i=(e=A(e)[0]).config;if(!0===t)for(t=[],n=L.widgets.length,a=0;a<n;a++)(s=L.widgets[a])&&s.id&&(t[t.length]=s.id);else t=(A.isArray(t)?t.join(","):t||"").toLowerCase().split(/[\s,]+/);for(n=t.length,o=0;o<n;o++)s=L.getWidgetById(t[o]),0<=(a=A.inArray(t[o],i.widgets))&&!0!==r&&i.widgets.splice(a,1),s&&s.remove&&(L.debug(i,"core")&&console.log((r?"Refreshing":"Removing")+' "'+t[o]+'" widget'),s.remove(e,i,i.widgetOptions,r),i.widgetInit[t[o]]=!1);i.$table.triggerHandler("widgetRemoveEnd",e)},refreshWidgets:function(e,t,r){var o,s,a=(e=A(e)[0]).config.widgets,n=L.widgets,i=n.length,d=[],l=function(e){A(e).triggerHandler("refreshComplete")};for(o=0;o<i;o++)(s=n[o])&&s.id&&(t||A.inArray(s.id,a)<0)&&(d[d.length]=s.id);L.removeWidget(e,d.join(","),!0),!0!==r?(L.applyWidget(e,t||!1,l),t&&L.applyWidget(e,!1,l)):l(e)},benchmark:function(e){return" ("+((new Date).getTime()-e.getTime())+" ms)"},log:function(){console.log(arguments)},debug:function(e,t){return e&&(!0===e.debug||"string"==typeof e.debug&&-1<e.debug.indexOf(t))},isEmptyObject:function(e){for(var t in e)return!1;return!0},isValueInArray:function(e,t){var r,o=t&&t.length||0;for(r=0;r<o;r++)if(t[r][0]===e)return r;return-1},formatFloat:function(e,t){return"string"!=typeof e||""===e?e:(e=(t&&t.config?!1!==t.config.usNumberFormat:void 0===t||t)?e.replace(L.regex.comma,""):e.replace(L.regex.digitNonUS,"").replace(L.regex.comma,"."),L.regex.digitNegativeTest.test(e)&&(e=e.replace(L.regex.digitNegativeReplace,"-$1")),r=parseFloat(e),isNaN(r)?A.trim(e):r);var r},isDigit:function(e){return isNaN(e)?L.regex.digitTest.test(e.toString().replace(L.regex.digitReplace,"")):""!==e},computeColumnIndex:function(e,t){var r,o,s,a,n,i,d,l,c,g,p=t&&t.columns||0,u=[],f=new Array(p);for(r=0;r<e.length;r++)for(i=e[r].cells,o=0;o<i.length;o++){for(d=r,l=(n=i[o]).rowSpan||1,c=n.colSpan||1,void 0===u[d]&&(u[d]=[]),s=0;s<u[d].length+1;s++)if(void 0===u[d][s]){g=s;break}for(p&&n.cellIndex===g||(n.setAttribute?n.setAttribute("data-column",g):A(n).attr("data-column",g)),s=d;s<d+l;s++)for(void 0===u[s]&&(u[s]=[]),f=u[s],a=g;a<g+c;a++)f[a]="x"}return L.checkColumnCount(e,u,f.length),f.length},checkColumnCount:function(e,t,r){var o,s,a=!0,n=[];for(o=0;o<t.length;o++)if(t[o]&&(s=t[o].length,t[o].length!==r)){a=!1;break}a||(e.each(function(e,t){var r=t.parentElement.nodeName;n.indexOf(r)<0&&n.push(r)}),console.error("Invalid or incorrect number of columns in the "+n.join(" or ")+"; expected "+r+", but found "+s+" columns"))},fixColumnWidth:function(e){var t,r,o,s,a,n=(e=A(e)[0]).config,i=n.$table.children("colgroup");if(i.length&&i.hasClass(L.css.colgroup)&&i.remove(),n.widthFixed&&0===n.$table.children("colgroup").length){for(i=A('<colgroup class="'+L.css.colgroup+'">'),t=n.$table.width(),s=(o=n.$tbodies.find("tr:first").children(":visible")).length,a=0;a<s;a++)r=parseInt(o.eq(a).width()/t*1e3,10)/10+"%",i.append(A("<col>").css("width",r));n.$table.prepend(i)}},getData:function(e,t,r){var o,s,a="",n=A(e);return n.length?(o=!!A.metadata&&n.metadata(),s=" "+(n.attr("class")||""),void 0!==n.data(r)||void 0!==n.data(r.toLowerCase())?a+=n.data(r)||n.data(r.toLowerCase()):o&&void 0!==o[r]?a+=o[r]:t&&void 0!==t[r]?a+=t[r]:" "!==s&&s.match(" "+r+"-")&&(a=s.match(new RegExp("\\s"+r+"-([\\w-]+)"))[1]||""),A.trim(a)):""},getColumnData:function(e,t,r,o,s){if("object"!=typeof t||null===t)return t;var a,n=(e=A(e)[0]).config,i=s||n.$headers,d=n.$headerIndexed&&n.$headerIndexed[r]||i.find('[data-column="'+r+'"]:last');if(void 0!==t[r])return o?t[r]:t[i.index(d)];for(a in t)if("string"==typeof a&&d.filter(a).add(d.find(a)).length)return t[a]},isProcessing:function(e,t,r){var o=(e=A(e))[0].config,s=r||e.find("."+L.css.header);t?(void 0!==r&&0<o.sortList.length&&(s=s.filter(function(){return!this.sortDisabled&&0<=L.isValueInArray(parseFloat(A(this).attr("data-column")),o.sortList)})),e.add(s).addClass(L.css.processing+" "+o.cssProcessing)):e.add(s).removeClass(L.css.processing+" "+o.cssProcessing)},processTbody:function(e,t,r){if(e=A(e)[0],r)return e.isProcessing=!0,t.before('<colgroup class="tablesorter-savemyplace"/>'),A.fn.detach?t.detach():t.remove();var o=A(e).find("colgroup.tablesorter-savemyplace");t.insertAfter(o),o.remove(),e.isProcessing=!1},clearTableBody:function(e){A(e)[0].config.$tbodies.children().detach()},characterEquivalents:{a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},replaceAccents:function(e){var t,r="[",o=L.characterEquivalents;if(!L.characterRegex){for(t in L.characterRegexArray={},o)"string"==typeof t&&(r+=o[t],L.characterRegexArray[t]=new RegExp("["+o[t]+"]","g"));L.characterRegex=new RegExp(r+"]")}if(L.characterRegex.test(e))for(t in o)"string"==typeof t&&(e=e.replace(L.characterRegexArray[t],t));return e},validateOptions:function(e){var t,r,o,s,a="headers sortForce sortList sortAppend widgets".split(" "),n=e.originalSettings;if(n){for(t in L.debug(e,"core")&&(s=new Date),n)if("undefined"===(o=typeof L.defaults[t]))console.warn('Tablesorter Warning! "table.config.'+t+'" option not recognized');else if("object"===o)for(r in n[t])o=L.defaults[t]&&typeof L.defaults[t][r],A.inArray(t,a)<0&&"undefined"===o&&console.warn('Tablesorter Warning! "table.config.'+t+"."+r+'" option not recognized');L.debug(e,"core")&&console.log("validate options time:"+L.benchmark(s))}},restoreHeaders:function(e){var t,r,o=A(e)[0].config,s=o.$table.find(o.selectorHeaders),a=s.length;for(t=0;t<a;t++)(r=s.eq(t)).find("."+L.css.headerIn).length&&r.html(o.headerContent[t])},destroy:function(e,t,r){if((e=A(e)[0]).hasInitialized){L.removeWidget(e,!0,!1);var o,s=A(e),a=e.config,n=s.find("thead:first"),i=n.find("tr."+L.css.headerRow).removeClass(L.css.headerRow+" "+a.cssHeaderRow),d=s.find("tfoot:first > tr").children("th, td");!1===t&&0<=A.inArray("uitheme",a.widgets)&&(s.triggerHandler("applyWidgetId",["uitheme"]),s.triggerHandler("applyWidgetId",["zebra"])),n.find("tr").not(i).remove(),o="sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave "+"keypress sortBegin sortEnd resetToLoadState ".split(" ").join(a.namespace+" "),s.removeData("tablesorter").unbind(o.replace(L.regex.spaces," ")),a.$headers.add(d).removeClass([L.css.header,a.cssHeader,a.cssAsc,a.cssDesc,L.css.sortAsc,L.css.sortDesc,L.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),i.find(a.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(a.namespace+" ").replace(L.regex.spaces," ")),L.restoreHeaders(e),s.toggleClass(L.css.table+" "+a.tableClass+" tablesorter-"+a.theme,!1===t),s.removeClass(a.namespace.slice(1)),e.hasInitialized=!1,delete e.config.cache,"function"==typeof r&&r(e),L.debug(a,"core")&&console.log("tablesorter has been removed")}}};A.fn.tablesorter=function(t){return this.each(function(){var e=A.extend(!0,{},L.defaults,t,L.instanceMethods);e.originalSettings=t,!this.hasInitialized&&L.buildTable&&"TABLE"!==this.nodeName?L.buildTable(this,e):L.setup(this,e)})},window.console&&window.console.log||(L.logs=[],console={},console.log=console.warn=console.error=console.table=function(){var e=1<arguments.length?arguments:arguments[0];L.logs[L.logs.length]={date:Date.now(),log:e}}),L.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),L.addParser({id:"text",is:function(){return!0},format:function(e,t){var r=t.config;return e&&(e=A.trim(r.ignoreCase?e.toLocaleLowerCase():e),e=r.sortLocaleCompare?L.replaceAccents(e):e),e},type:"text"}),L.regex.nondigit=/[^\w,. \-()]/g,L.addParser({id:"digit",is:function(e){return L.isDigit(e)},format:function(e,t){var r=L.formatFloat((e||"").replace(L.regex.nondigit,""),t);return e&&"number"==typeof r?r:e?A.trim(e&&t.config.ignoreCase?e.toLocaleLowerCase():e):e},type:"numeric"}),L.regex.currencyReplace=/[+\-,. ]/g,L.regex.currencyTest=/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/,L.addParser({id:"currency",is:function(e){return e=(e||"").replace(L.regex.currencyReplace,""),L.regex.currencyTest.test(e)},format:function(e,t){var r=L.formatFloat((e||"").replace(L.regex.nondigit,""),t);return e&&"number"==typeof r?r:e?A.trim(e&&t.config.ignoreCase?e.toLocaleLowerCase():e):e},type:"numeric"}),L.regex.urlProtocolTest=/^(https?|ftp|file):\/\//,L.regex.urlProtocolReplace=/(https?|ftp|file):\/\/(www\.)?/,L.addParser({id:"url",is:function(e){return L.regex.urlProtocolTest.test(e)},format:function(e){return e?A.trim(e.replace(L.regex.urlProtocolReplace,"")):e},type:"text"}),L.regex.dash=/-/g,L.regex.isoDate=/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/,L.addParser({id:"isoDate",is:function(e){return L.regex.isoDate.test(e)},format:function(e){var t=e?new Date(e.replace(L.regex.dash,"/")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),L.regex.percent=/%/g,L.regex.percentTest=/(\d\s*?%|%\s*?\d)/,L.addParser({id:"percent",is:function(e){return L.regex.percentTest.test(e)&&e.length<15},format:function(e,t){return e?L.formatFloat(e.replace(L.regex.percent,""),t):e},type:"numeric"}),L.addParser({id:"image",is:function(e,t,r,o){return 0<o.find("img").length},format:function(e,t,r){return A(r).find("img").attr(t.config.imgAttr||"alt")||e},parsed:!0,type:"text"}),L.regex.dateReplace=/(\S)([AP]M)$/i,L.regex.usLongDateTest1=/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i,L.regex.usLongDateTest2=/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i,L.addParser({id:"usLongDate",is:function(e){return L.regex.usLongDateTest1.test(e)||L.regex.usLongDateTest2.test(e)},format:function(e){var t=e?new Date(e.replace(L.regex.dateReplace,"$1 $2")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),L.regex.shortDateTest=/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/,L.regex.shortDateReplace=/[\-.,]/g,L.regex.shortDateXXY=/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,L.regex.shortDateYMD=/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,L.convertFormat=function(e,t){e=(e||"").replace(L.regex.spaces," ").replace(L.regex.shortDateReplace,"/"),"mmddyyyy"===t?e=e.replace(L.regex.shortDateXXY,"$3/$1/$2"):"ddmmyyyy"===t?e=e.replace(L.regex.shortDateXXY,"$3/$2/$1"):"yyyymmdd"===t&&(e=e.replace(L.regex.shortDateYMD,"$1/$2/$3"));var r=new Date(e);return r instanceof Date&&isFinite(r)?r.getTime():""},L.addParser({id:"shortDate",is:function(e){return e=(e||"").replace(L.regex.spaces," ").replace(L.regex.shortDateReplace,"/"),L.regex.shortDateTest.test(e)},format:function(e,t,r,o){if(e){var s=t.config,a=s.$headerIndexed[o],n=a.length&&a.data("dateFormat")||L.getData(a,L.getColumnData(t,s.headers,o),"dateFormat")||s.dateFormat;return a.length&&a.data("dateFormat",n),L.convertFormat(e,n)||e}return e},type:"numeric"}),L.regex.timeTest=/^(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)$|^((?:[01]\d|[2][0-4]):[0-5]\d)$/i,L.regex.timeMatch=/(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i,L.addParser({id:"time",is:function(e){return L.regex.timeTest.test(e)},format:function(e){var t=(e||"").match(L.regex.timeMatch),r=new Date(e),o=e&&(null!==t?t[0]:"00:00 AM"),s=o?new Date("2000/01/01 "+o.replace(L.regex.dateReplace,"$1 $2")):o;return s instanceof Date&&isFinite(s)?(r instanceof Date&&isFinite(r)?r.getTime():0)?parseFloat(s.getTime()+"."+r.getTime()):s.getTime():e},type:"numeric"}),L.addParser({id:"metadata",is:function(){return!1},format:function(e,t,r){var o=t.config,s=o.parserMetadataName?o.parserMetadataName:"sortValue";return A(r).metadata()[s]},type:"numeric"}),L.addWidget({id:"zebra",priority:90,format:function(e,t,r){var o,s,a,n,i,d,l,c=new RegExp(t.cssChildRow,"i"),g=t.$tbodies.add(A(t.namespace+"_extra_table").children("tbody:not(."+t.cssInfoBlock+")"));for(i=0;i<g.length;i++)for(a=0,l=(o=g.eq(i).children("tr:visible").not(t.selectorRemove)).length,d=0;d<l;d++)s=o.eq(d),c.test(s[0].className)||a++,n=a%2==0,s.removeClass(r.zebra[n?1:0]).addClass(r.zebra[n?0:1])},remove:function(e,t,r,o){if(!o){var s,a,n=t.$tbodies,i=(r.zebra||["even","odd"]).join(" ");for(s=0;s<n.length;s++)(a=L.processTbody(e,n.eq(s),!0)).children().removeClass(i),L.processTbody(e,a,!1)}}})}(e),e.tablesorter});
js/tablesorter/jquery.tablesorter.widgets.js CHANGED
@@ -1,15 +1,6 @@
1
- /*! tablesorter (FORK) - updated 2018-04-30 (v2.30.3)*/
2
  /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
3
- (function(factory) {
4
- if (typeof define === 'function' && define.amd) {
5
- define(['jquery'], factory);
6
- } else if (typeof module === 'object' && typeof module.exports === 'object') {
7
- module.exports = factory(require('jquery'));
8
- } else {
9
- factory(jQuery);
10
- }
11
- }(function(jQuery) {
12
-
13
  /*! Widget: storage - updated 2018-03-18 (v2.30.0) */
14
  /*global JSON:false */
15
  ;(function ($, window, document) {
@@ -3182,6 +3173,4 @@
3182
  });
3183
 
3184
  })(jQuery);
3185
-
3186
- return jQuery.tablesorter;
3187
- }));
1
+ /*! tablesorter (FORK) - updated 2018-08-27 (v2.31.0)*/
2
  /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
3
+ (function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery) {
 
 
 
 
 
 
 
 
 
4
  /*! Widget: storage - updated 2018-03-18 (v2.30.0) */
5
  /*global JSON:false */
6
  ;(function ($, window, document) {
3173
  });
3174
 
3175
  })(jQuery);
3176
+ return jQuery.tablesorter;}));
 
 
js/tablesorter/jquery.tablesorter.widgets.min.js CHANGED
@@ -1,2 +1,4 @@
1
- /*! tablesorter (FORK) - updated 2018-04-30 (v2.30.3)*/
2
- !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(e,t,r){"use strict";var i=e.tablesorter||{};e.extend(!0,i.defaults,{fixedUrl:"",widgetOptions:{storage_fixedUrl:"",storage_group:"",storage_page:"",storage_storageType:"",storage_tableId:"",storage_useSessionStorage:""}}),i.storage=function(a,l,s,n){var o,c,d,f=!1,h={},u=(a=e(a)[0]).config,p=u&&u.widgetOptions,g=i.debug(u,"storage"),m=(n&&n.storageType||p&&p.storage_storageType).toString().charAt(0).toLowerCase(),b=m?"":n&&n.useSessionStorage||p&&p.storage_useSessionStorage,y=e(a),_=n&&n.id||y.attr(n&&n.group||p&&p.storage_group||"data-table-group")||p&&p.storage_tableId||a.id||e(".tablesorter").index(y),v=n&&n.url||y.attr(n&&n.page||p&&p.storage_page||"data-table-page")||p&&p.storage_fixedUrl||u&&u.fixedUrl||t.location.pathname;if("c"!==m&&(m="s"===m||b?"sessionStorage":"localStorage")in t)try{t[m].setItem("_tmptest","temp"),f=!0,t[m].removeItem("_tmptest")}catch(e){console.warn(m+" is not supported in this browser")}if(g&&console.log("Storage >> Using",f?m:"cookies"),e.parseJSON&&(f?h=e.parseJSON(t[m][l]||"null")||{}:(c=r.cookie.split(/[;\s|=]/),h=0!==(o=e.inArray(l,c)+1)?e.parseJSON(c[o]||"null")||{}:{})),void 0===s||!t.JSON||!JSON.hasOwnProperty("stringify"))return h&&h[v]?h[v][_]:"";h[v]||(h[v]={}),h[v][_]=s,f?t[m][l]=JSON.stringify(h):((d=new Date).setTime(d.getTime()+31536e6),r.cookie=l+"="+JSON.stringify(h).replace(/\"/g,'"')+"; expires="+d.toGMTString()+"; path=/")}}(e,window,document),function(e){"use strict";var t=e.tablesorter||{};t.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"glyphicon glyphicon-chevron-up",iconSortDesc:"glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s ui-icon-caret-2-n-s",iconSortAsc:"ui-icon-carat-1-n ui-icon-caret-1-n",iconSortDesc:"ui-icon-carat-1-s ui-icon-caret-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},e.extend(t.css,{wrapper:"tablesorter-wrapper"}),t.addWidget({id:"uitheme",priority:10,format:function(r,i,a){var l,s,n,o,c,d,f,h,u,p,g,m,b,y=t.themes,_=i.$table.add(e(i.namespace+"_extra_table")),v=i.$headers.add(e(i.namespace+"_extra_headers")),w=i.theme||"jui",x=y[w]||{},S=e.trim([x.sortNone,x.sortDesc,x.sortAsc,x.active].join(" ")),C=e.trim([x.iconSortNone,x.iconSortDesc,x.iconSortAsc].join(" ")),z=t.debug(i,"uitheme");for(z&&(c=new Date),_.hasClass("tablesorter-"+w)&&i.theme===i.appliedTheme&&a.uitheme_applied||(a.uitheme_applied=!0,p=y[i.appliedTheme]||{},g=(b=!e.isEmptyObject(p))?[p.sortNone,p.sortDesc,p.sortAsc,p.active].join(" "):"",m=b?[p.iconSortNone,p.iconSortDesc,p.iconSortAsc].join(" "):"",b&&(a.zebra[0]=e.trim(" "+a.zebra[0].replace(" "+p.even,"")),a.zebra[1]=e.trim(" "+a.zebra[1].replace(" "+p.odd,"")),i.$tbodies.children().removeClass([p.even,p.odd].join(" "))),x.even&&(a.zebra[0]+=" "+x.even),x.odd&&(a.zebra[1]+=" "+x.odd),_.children("caption").removeClass(p.caption||"").addClass(x.caption),h=_.removeClass((i.appliedTheme?"tablesorter-"+(i.appliedTheme||""):"")+" "+(p.table||"")).addClass("tablesorter-"+w+" "+(x.table||"")).children("tfoot"),i.appliedTheme=i.theme,h.length&&h.children("tr").removeClass(p.footerRow||"").addClass(x.footerRow).children("th, td").removeClass(p.footerCells||"").addClass(x.footerCells),v.removeClass((b?[p.header,p.hover,g].join(" "):"")||"").addClass(x.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(t){e(this)["mouseenter"===t.type?"addClass":"removeClass"](x.hover||"")}),v.each(function(){var r=e(this);r.find("."+t.css.wrapper).length||r.wrapInner('<div class="'+t.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),i.cssIcon&&v.find("."+t.css.icon).removeClass(b?[p.icons,m].join(" "):"").addClass(x.icons||""),t.hasWidget(i.table,"filter")&&(s=function(){_.children("thead").children("."+t.css.filterRow).removeClass(b?p.filterRow||"":"").addClass(x.filterRow||"")},a.filter_initialized?s():_.one("filterInit",function(){s()}))),l=0;l<i.columns;l++)d=i.$headers.add(e(i.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+l+'"]'),f=t.css.icon?d.find("."+t.css.icon):e(),(u=v.not(".sorter-false").filter('[data-column="'+l+'"]:last')).length&&(d.removeClass(S),f.removeClass(C),u[0].sortDisabled?f.removeClass(x.icons||""):(n=x.sortNone,o=x.iconSortNone,u.hasClass(t.css.sortAsc)?(n=[x.sortAsc,x.active].join(" "),o=x.iconSortAsc):u.hasClass(t.css.sortDesc)&&(n=[x.sortDesc,x.active].join(" "),o=x.iconSortDesc),d.addClass(n),f.addClass(o||"")));z&&console.log("uitheme >> Applied "+w+" theme"+t.benchmark(c))},remove:function(e,r,i,a){if(i.uitheme_applied){var l=r.$table,s=r.appliedTheme||"jui",n=t.themes[s]||t.themes.jui,o=l.children("thead").children(),c=n.sortNone+" "+n.sortDesc+" "+n.sortAsc,d=n.iconSortNone+" "+n.iconSortDesc+" "+n.iconSortAsc;l.removeClass("tablesorter-"+s+" "+n.table),i.uitheme_applied=!1,a||(l.find(t.css.header).removeClass(n.header),o.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(n.hover+" "+c+" "+n.active).filter("."+t.css.filterRow).removeClass(n.filterRow),o.find("."+t.css.icon).removeClass(n.icons+" "+d))}}})}(e),function(e){"use strict";var t=e.tablesorter||{};t.addWidget({id:"columns",priority:65,options:{columns:["primary","secondary","tertiary"]},format:function(r,i,a){var l,s,n,o,c,d,f,h,u=i.$table,p=i.$tbodies,g=i.sortList,m=g.length,b=a&&a.columns||["primary","secondary","tertiary"],y=b.length-1;for(f=b.join(" "),s=0;s<p.length;s++)(n=(l=t.processTbody(r,p.eq(s),!0)).children("tr")).each(function(){if(c=e(this),"none"!==this.style.display&&(d=c.children().removeClass(f),g&&g[0]&&(d.eq(g[0][0]).addClass(b[0]),m>1)))for(h=1;h<m;h++)d.eq(g[h][0]).addClass(b[h]||b[y])}),t.processTbody(r,l,!1);if(o=!1!==a.columns_thead?["thead tr"]:[],!1!==a.columns_tfoot&&o.push("tfoot tr"),o.length&&(n=u.find(o.join(",")).children().removeClass(f),m))for(h=0;h<m;h++)n.filter('[data-column="'+g[h][0]+'"]').addClass(b[h]||b[y])},remove:function(r,i,a){var l,s,n=i.$tbodies,o=(a.columns||["primary","secondary","tertiary"]).join(" ");for(i.$headers.removeClass(o),i.$table.children("tfoot").children("tr").children("th, td").removeClass(o),l=0;l<n.length;l++)(s=t.processTbody(r,n.eq(l),!0)).children("tr").each(function(){e(this).children().removeClass(o)}),t.processTbody(r,s,!1)}})}(e),function(e){"use strict";var t,r,i=e.tablesorter||{},a=i.css,l=i.keyCodes;e.extend(a,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"}),e.extend(l,{backSpace:8,escape:27,space:32,left:37,down:40}),i.addWidget({id:"filter",priority:50,options:{filter_cellFilter:"",filter_childRows:!1,filter_childByColumn:!1,filter_childWithSibs:!0,filter_columnAnyMatch:!0,filter_columnFilters:!0,filter_cssFilter:"",filter_defaultAttrib:"data-value",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_filterLabel:'Filter "{{label}}" column by...',filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_matchType:{input:"exact",select:"exact"},filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_resetOnEsc:!0,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_selectSourceSeparator:"|",filter_serversideFiltering:!1,filter_startsWith:!1,filter_useParsedData:!1},format:function(e,r,i){r.$table.hasClass("hasFilters")||t.init(e,r,i)},remove:function(t,r,l,s){var n,o,c=r.$table,d=r.$tbodies,f="addRows updateCell update updateRows updateComplete appendCache filterReset filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit ".split(" ").join(r.namespace+"filter ");if(c.removeClass("hasFilters").unbind(f.replace(i.regex.spaces," ")).find("."+a.filterRow).remove(),l.filter_initialized=!1,!s){for(n=0;n<d.length;n++)(o=i.processTbody(t,d.eq(n),!0)).children().removeClass(l.filter_filteredRow).show(),i.processTbody(t,o,!1);l.filter_reset&&e(document).undelegate(l.filter_reset,"click"+r.namespace+"filter")}}}),t=i.filter={regex:{regex:/^\/((?:\\\/|[^\/])+)\/([migyu]{0,5})?$/,child:/tablesorter-childRow/,filtered:/filtered/,type:/undefined|number/,exact:/(^[\"\'=]+)|([\"\'=]+$)/g,operators:/[<>=]/g,query:"(q|query)",wild01:/\?/g,wild0More:/\*/g,quote:/\"/g,isNeg1:/(>=?\s*-\d)/,isNeg2:/(<=?\s*\d)/},types:{or:function(i,a,l){if((r.orTest.test(a.iFilter)||r.orSplit.test(a.filter))&&!r.regex.test(a.filter)){var s,n,o,c,d=e.extend({},a),f=a.filter.split(r.orSplit),h=a.iFilter.split(r.orSplit),u=f.length;for(s=0;s<u;s++){d.nestedFilters=!0,d.filter=""+(t.parseFilter(i,f[s],a)||""),d.iFilter=""+(t.parseFilter(i,h[s],a)||""),o="("+(t.parseFilter(i,d.filter,a)||"")+")";try{if(c=new RegExp(a.isMatch?o:"^"+o+"$",i.widgetOptions.filter_ignoreCase?"i":""),n=c.test(d.exact)||t.processTypes(i,d,l))return n}catch(e){return null}}return n||!1}return null},and:function(i,a,l){if(r.andTest.test(a.filter)){var s,n,o,c,d=e.extend({},a),f=a.filter.split(r.andSplit),h=a.iFilter.split(r.andSplit),u=f.length;for(s=0;s<u;s++){d.nestedFilters=!0,d.filter=""+(t.parseFilter(i,f[s],a)||""),d.iFilter=""+(t.parseFilter(i,h[s],a)||""),c=("("+(t.parseFilter(i,d.filter,a)||"")+")").replace(r.wild01,"\\S{1}").replace(r.wild0More,"\\S*");try{o=new RegExp(a.isMatch?c:"^"+c+"$",i.widgetOptions.filter_ignoreCase?"i":"").test(d.exact)||t.processTypes(i,d,l),n=0===s?o:n&&o}catch(e){return null}}return n||!1}return null},regex:function(e,t){if(r.regex.test(t.filter)){var i,a=t.filter_regexCache[t.index]||r.regex.exec(t.filter),l=a instanceof RegExp;try{l||(t.filter_regexCache[t.index]=a=new RegExp(a[1],a[2])),i=a.test(t.exact)}catch(e){i=!1}return i}return null},operators:function(a,l){if(r.operTest.test(l.iFilter)&&""!==l.iExact){var s,n,o,c=a.table,d=l.parsed[l.index],f=i.formatFloat(l.iFilter.replace(r.operators,""),c),h=a.parsers[l.index]||{},u=f;return(d||"numeric"===h.type)&&(o=e.trim(""+l.iFilter.replace(r.operators,"")),f="number"!=typeof(n=t.parseFilter(a,o,l,!0))||""===n||isNaN(n)?f:n),!d&&"numeric"!==h.type||isNaN(f)||void 0===l.cache?(o=isNaN(l.iExact)?l.iExact.replace(i.regex.nondigit,""):l.iExact,s=i.formatFloat(o,c)):s=l.cache,r.gtTest.test(l.iFilter)?n=r.gteTest.test(l.iFilter)?s>=f:s>f:r.ltTest.test(l.iFilter)&&(n=r.lteTest.test(l.iFilter)?s<=f:s<f),n||""!==u||(n=!0),n}return null},notMatch:function(i,a){if(r.notTest.test(a.iFilter)){var l,s=a.iFilter.replace("!",""),n=t.parseFilter(i,s,a)||"";return r.exact.test(n)?""===(n=n.replace(r.exact,""))||e.trim(n)!==a.iExact:(l=a.iExact.search(e.trim(n)),""===n||(a.anyMatch?l<0:!(i.widgetOptions.filter_startsWith?0===l:l>=0)))}return null},exact:function(i,a){if(r.exact.test(a.iFilter)){var l=a.iFilter.replace(r.exact,""),s=t.parseFilter(i,l,a)||"";return a.anyMatch?e.inArray(s,a.rowArray)>=0:s==a.iExact}return null},range:function(e,a){if(r.toTest.test(a.iFilter)){var l,s,n,o,c=e.table,d=a.index,f=a.parsed[d],h=a.iFilter.split(r.toSplit);return s=h[0].replace(i.regex.nondigit,"")||"",n=i.formatFloat(t.parseFilter(e,s,a),c),s=h[1].replace(i.regex.nondigit,"")||"",o=i.formatFloat(t.parseFilter(e,s,a),c),(f||"numeric"===e.parsers[d].type)&&(n=""===(l=e.parsers[d].format(""+h[0],c,e.$headers.eq(d),d))||isNaN(l)?n:l,o=""===(l=e.parsers[d].format(""+h[1],c,e.$headers.eq(d),d))||isNaN(l)?o:l),!f&&"numeric"!==e.parsers[d].type||isNaN(n)||isNaN(o)?(s=isNaN(a.iExact)?a.iExact.replace(i.regex.nondigit,""):a.iExact,l=i.formatFloat(s,c)):l=a.cache,n>o&&(s=n,n=o,o=s),l>=n&&l<=o||""===n||""===o}return null},wild:function(e,i){if(r.wildOrTest.test(i.iFilter)){var a=""+(t.parseFilter(e,i.iFilter,i)||"");!r.wildTest.test(a)&&i.nestedFilters&&(a=i.isMatch?a:"^("+a+")$");try{return new RegExp(a.replace(r.wild01,"\\S{1}").replace(r.wild0More,"\\S*"),e.widgetOptions.filter_ignoreCase?"i":"").test(i.exact)}catch(e){return null}}return null},fuzzy:function(e,i){if(r.fuzzyTest.test(i.iFilter)){var a,l=0,s=i.iExact.length,n=i.iFilter.slice(1),o=t.parseFilter(e,n,i)||"";for(a=0;a<s;a++)i.iExact[a]===o[l]&&(l+=1);return l===o.length}return null}},init:function(l){i.language=e.extend(!0,{},{to:"to",or:"or",and:"and"},i.language);var s,n,o,c,d,f,h,u,p=l.config,g=p.widgetOptions,m=function(e,t,r){return t=t.trim(),""===t?"":(e||"")+t+(r||"")};if(p.$table.addClass("hasFilters"),p.lastSearch=[],g.filter_searchTimer=null,g.filter_initTimer=null,g.filter_formatterCount=0,g.filter_formatterInit=[],g.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',g.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',f="\\{"+r.query+"\\}",e.extend(r,{child:new RegExp(p.cssChildRow),filtered:new RegExp(g.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+(-"+m("|",i.language.or)+m("|",i.language.to)+")\\s+)","i"),toTest:new RegExp("\\s+(-"+m("|",i.language.to)+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-"+m("|",i.language.to)+")\\s+)","gi"),andTest:new RegExp("\\s+("+m("",i.language.and,"|")+"&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+m("",i.language.and,"|")+"&&)\\s+)","gi"),orTest:new RegExp("(\\|"+m("|\\s+",i.language.or,"\\s+")+")","i"),orSplit:new RegExp("(?:\\|"+m("|\\s+(?:",i.language.or,")\\s+")+")","gi"),iQuery:new RegExp(f,"i"),igQuery:new RegExp(f,"ig"),operTest:/^[<>]=?/,gtTest:/>/,gteTest:/>=/,ltTest:/</,lteTest:/<=/,notTest:/^\!/,wildOrTest:/[\?\*\|]/,wildTest:/\?\*/,fuzzyTest:/^~/,exactTest:/[=\"\|!]/}),f=p.$headers.filter(".filter-false, .parser-false").length,!1!==g.filter_columnFilters&&f!==p.$headers.length&&t.buildRow(l,p,g),o="addRows updateCell update updateRows updateComplete appendCache filterReset "+"filterAndSortReset filterResetSaved filterEnd search ".split(" ").join(p.namespace+"filter "),p.$table.bind(o,function(r,s){return f=g.filter_hideEmpty&&e.isEmptyObject(p.cache)&&!(p.delayInit&&"appendCache"===r.type),p.$table.find("."+a.filterRow).toggleClass(g.filter_filteredRow,f),/(search|filter)/.test(r.type)||(r.stopPropagation(),t.buildDefault(l,!0)),"filterReset"===r.type||"filterAndSortReset"===r.type?(p.$table.find("."+a.filter).add(g.filter_$externalFilters).val(""),"filterAndSortReset"===r.type?i.sortReset(this.config,function(){t.searching(l,[])}):t.searching(l,[])):"filterResetSaved"===r.type?i.storage(l,"tablesorter-filters",""):"filterEnd"===r.type?t.buildDefault(l,!0):(s="search"===r.type?s:"updateComplete"===r.type?p.$table.data("lastSearch"):"",/(update|add)/.test(r.type)&&"updateComplete"!==r.type&&(p.lastCombinedFilter=null,p.lastSearch=[],setTimeout(function(){p.$table.triggerHandler("filterFomatterUpdate")},100)),t.searching(l,s,!0)),!1}),g.filter_reset&&(g.filter_reset instanceof e?g.filter_reset.click(function(){p.$table.triggerHandler("filterReset")}):e(g.filter_reset).length&&e(document).undelegate(g.filter_reset,"click"+p.namespace+"filter").delegate(g.filter_reset,"click"+p.namespace+"filter",function(){p.$table.triggerHandler("filterReset")})),g.filter_functions)for(d=0;d<p.columns;d++)if(h=i.getColumnData(l,g.filter_functions,d))if(c=p.$headerIndexed[d].removeClass("filter-select"),u=!(c.hasClass("filter-false")||c.hasClass("parser-false")),s="",!0===h&&u)t.buildSelect(l,d);else if("object"==typeof h&&u){for(n in h)"string"==typeof n&&(s+=""===s?'<option value="">'+(c.data("placeholder")||c.attr("data-placeholder")||g.filter_placeholder.select||"")+"</option>":"",f=n,o=n,n.indexOf(g.filter_selectSourceSeparator)>=0&&(o=(f=n.split(g.filter_selectSourceSeparator))[1],f=f[0]),s+="<option "+(o===f?"":'data-function-name="'+n+'" ')+'value="'+f+'">'+o+"</option>");p.$table.find("thead").find("select."+a.filter+'[data-column="'+d+'"]').append(s),(h="function"==typeof(o=g.filter_selectSource)||i.getColumnData(l,o,d))&&t.buildSelect(p.table,d,"",!0,c.hasClass(g.filter_onlyAvail))}t.buildDefault(l,!0),t.bindSearch(l,p.$table.find("."+a.filter),!0),g.filter_external&&t.bindSearch(l,g.filter_external),g.filter_hideFilters&&t.hideFilters(p),p.showProcessing&&(o="filterStart filterEnd ".split(" ").join(p.namespace+"filter-sp "),p.$table.unbind(o.replace(i.regex.spaces," ")).bind(o,function(t,r){c=r?p.$table.find("."+a.header).filter("[data-column]").filter(function(){return""!==r[e(this).data("column")]}):"",i.isProcessing(l,"filterStart"===t.type,r?c:"")})),p.filteredRows=p.totalRows,o="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(p.namespace+"filter "),p.$table.unbind(o.replace(i.regex.spaces," ")).bind(o,function(){t.completeInit(this)}),p.pager&&p.pager.initialized&&!g.filter_initialized?(p.$table.triggerHandler("filterFomatterUpdate"),setTimeout(function(){t.filterInitComplete(p)},100)):g.filter_initialized||t.completeInit(l)},completeInit:function(e){var r=e.config,a=r.widgetOptions,l=t.setDefaults(e,r,a)||[];l.length&&(r.delayInit&&""===l.join("")||i.setFilters(e,l,!0)),r.$table.triggerHandler("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||t.filterInitComplete(r)},100)},formatterUpdated:function(e,t){var r=e&&e.closest("table"),i=r.length&&r[0].config,a=i&&i.widgetOptions;a&&!a.filter_initialized&&(a.filter_formatterInit[t]=1)},filterInitComplete:function(r){var a,l,s=r.widgetOptions,n=0,o=function(){s.filter_initialized=!0,r.lastSearch=r.$table.data("lastSearch"),r.$table.triggerHandler("filterInit",r),t.findRows(r.table,r.lastSearch||[]),i.debug(r,"filter")&&console.log("Filter >> Widget initialized")};if(e.isEmptyObject(s.filter_formatter))o();else{for(l=s.filter_formatterInit.length,a=0;a<l;a++)1===s.filter_formatterInit[a]&&n++;clearTimeout(s.filter_initTimer),s.filter_initialized||n!==s.filter_formatterCount?s.filter_initialized||(s.filter_initTimer=setTimeout(function(){o()},500)):o()}},processFilters:function(e,t){var r,i=[],a=t?encodeURIComponent:decodeURIComponent,l=e.length;for(r=0;r<l;r++)e[r]&&(i[r]=a(e[r]));return i},setDefaults:function(r,a,l){var s,n,o,c,d,f=i.getFilters(r)||[];if(l.filter_saveFilters&&i.storage&&(n=i.storage(r,"tablesorter-filters")||[],(s=e.isArray(n))&&""===n.join("")||!s||(f=t.processFilters(n))),""===f.join(""))for(d=a.$headers.add(l.filter_$externalFilters).filter("["+l.filter_defaultAttrib+"]"),o=0;o<=a.columns;o++)c=o===a.columns?"all":o,f[o]=d.filter('[data-column="'+c+'"]').attr(l.filter_defaultAttrib)||f[o]||"";return a.$table.data("lastSearch",f),f},parseFilter:function(e,t,r,i){return i||r.parsed[r.index]?e.parsers[r.index].format(t,e.table,[],r.index):t},buildRow:function(r,l,s){var n,o,c,d,f,h,u,p,g,m=s.filter_cellFilter,b=l.columns,y=e.isArray(m),_='<tr role="search" class="'+a.filterRow+" "+l.cssIgnoreRow+'">';for(c=0;c<b;c++)l.$headerIndexed[c].length&&(_+=(g=l.$headerIndexed[c]&&l.$headerIndexed[c][0].colSpan||0)>1?'<td data-column="'+c+"-"+(c+g-1)+'" colspan="'+g+'"':'<td data-column="'+c+'"',_+=y?m[c]?' class="'+m[c]+'"':"":""!==m?' class="'+m+'"':"",_+="></td>");for(l.$filters=e(_+="</tr>").appendTo(l.$table.children("thead").eq(0)).children("td"),c=0;c<b;c++)h=!1,(d=l.$headerIndexed[c])&&d.length&&(n=t.getColumnElm(l,l.$filters,c),p=i.getColumnData(r,s.filter_functions,c),f=s.filter_functions&&p&&"function"!=typeof p||d.hasClass("filter-select"),o=i.getColumnData(r,l.headers,c),h="false"===i.getData(d[0],o,"filter")||"false"===i.getData(d[0],o,"parser"),f?_=e("<select>").appendTo(n):((p=i.getColumnData(r,s.filter_formatter,c))?(s.filter_formatterCount++,(_=p(n,c))&&0===_.length&&(_=n.children("input")),_&&(0===_.parent().length||_.parent().length&&_.parent()[0]!==n[0])&&n.append(_)):_=e('<input type="search">').appendTo(n),_&&(g=d.data("placeholder")||d.attr("data-placeholder")||s.filter_placeholder.search||"",_.attr("placeholder",g))),_&&(u=(e.isArray(s.filter_cssFilter)?void 0!==s.filter_cssFilter[c]?s.filter_cssFilter[c]||"":"":s.filter_cssFilter)||"",_.addClass(a.filter+" "+u),(g=(u=s.filter_filterLabel).match(/{{([^}]+?)}}/g))||(g=["{{label}}"]),e.each(g,function(t,r){var i=new RegExp(r,"g"),a=d.attr("data-"+r.replace(/{{|}}/g,"")),l=void 0===a?d.text():a;u=u.replace(i,e.trim(l))}),_.attr({"data-column":n.attr("data-column"),"aria-label":u}),h&&(_.attr("placeholder","").addClass(a.filterDisabled)[0].disabled=!0)))},bindSearch:function(r,a,s){if(r=e(r)[0],(a=e(a)).length){var n,o=r.config,c=o.widgetOptions,d=o.namespace+"filter",f=c.filter_$externalFilters;!0!==s&&(n=c.filter_anyColumnSelector+","+c.filter_multipleColumnSelector,c.filter_$anyMatch=a.filter(n),f&&f.length?c.filter_$externalFilters=c.filter_$externalFilters.add(a):c.filter_$externalFilters=a,i.setFilters(r,o.$table.data("lastSearch")||[],!1===s)),n="keypress keyup keydown search change input ".split(" ").join(d+" "),a.attr("data-lastSearchTime",(new Date).getTime()).unbind(n.replace(i.regex.spaces," ")).bind("keydown"+d,function(e){if(e.which===l.escape&&!r.config.widgetOptions.filter_resetOnEsc)return!1}).bind("keyup"+d,function(a){c=r.config.widgetOptions;var s=parseInt(e(this).attr("data-column"),10),n="boolean"==typeof c.filter_liveSearch?c.filter_liveSearch:i.getColumnData(r,c.filter_liveSearch,s);if(void 0===n&&(n=c.filter_liveSearch.fallback||!1),e(this).attr("data-lastSearchTime",(new Date).getTime()),a.which===l.escape)this.value=c.filter_resetOnEsc?"":o.lastSearch[s];else{if(""!==this.value&&("number"==typeof n&&this.value.length<n||a.which!==l.enter&&a.which!==l.backSpace&&(a.which<l.space||a.which>=l.left&&a.which<=l.down)))return;if(!1===n&&""!==this.value&&a.which!==l.enter)return}t.searching(r,!0,!0,s)}).bind("search change keypress input blur ".split(" ").join(d+" "),function(a){var s=parseInt(e(this).attr("data-column"),10),n=a.type,d="boolean"==typeof c.filter_liveSearch?c.filter_liveSearch:i.getColumnData(r,c.filter_liveSearch,s);!r.config.widgetOptions.filter_initialized||a.which!==l.enter&&"search"!==n&&"blur"!==n&&("change"!==n&&"input"!==n||!0!==d&&(!0===d||"INPUT"===a.target.nodeName)||this.value===o.lastSearch[s])||(a.preventDefault(),e(this).attr("data-lastSearchTime",(new Date).getTime()),t.searching(r,"keypress"!==n,!0,s))})}},searching:function(e,r,a,l){var s,n=e.config.widgetOptions;void 0===l?s=!1:void 0===(s="boolean"==typeof n.filter_liveSearch?n.filter_liveSearch:i.getColumnData(e,n.filter_liveSearch,l))&&(s=n.filter_liveSearch.fallback||!1),clearTimeout(n.filter_searchTimer),void 0===r||!0===r?n.filter_searchTimer=setTimeout(function(){t.checkFilters(e,r,a)},s?n.filter_searchDelay:10):t.checkFilters(e,r,a)},equalFilters:function(t,r,i){var a,l=[],s=[],n=t.columns+1;for(r=e.isArray(r)?r:[],i=e.isArray(i)?i:[],a=0;a<n;a++)l[a]=r[a]||"",s[a]=i[a]||"";return l.join(",")===s.join(",")},checkFilters:function(r,l,s){var n=r.config,o=n.widgetOptions,c=e.isArray(l),d=c?l:i.getFilters(r,!0),f=d||[];if(e.isEmptyObject(n.cache))n.delayInit&&(!n.pager||n.pager&&n.pager.initialized)&&i.updateCache(n,function(){t.checkFilters(r,!1,s)});else if(c&&(i.setFilters(r,d,!1,!0!==s),o.filter_initialized||(n.lastSearch=[],n.lastCombinedFilter="")),o.filter_hideFilters&&n.$table.find("."+a.filterRow).triggerHandler(t.hideFiltersCheck(n)?"mouseleave":"mouseenter"),!t.equalFilters(n,n.lastSearch,f)||!1===l){if(!1===l&&(n.lastCombinedFilter="",n.lastSearch=[]),d=d||[],d=Array.prototype.map?d.map(String):d.join("�").split("�"),o.filter_initialized&&n.$table.triggerHandler("filterStart",[d]),!n.showProcessing)return t.findRows(r,d,f),!1;setTimeout(function(){return t.findRows(r,d,f),!1},30)}},hideFiltersCheck:function(e){if("function"==typeof e.widgetOptions.filter_hideFilters){var t=e.widgetOptions.filter_hideFilters(e);if("boolean"==typeof t)return t}return""===i.getFilters(e.$table).join("")},hideFilters:function(r,i){var l;(i||r.$table).find("."+a.filterRow).addClass(a.filterRowHide).bind("mouseenter mouseleave",function(i){var s=i,n=e(this);clearTimeout(l),l=setTimeout(function(){/enter|over/.test(s.type)?n.removeClass(a.filterRowHide):e(document.activeElement).closest("tr")[0]!==n[0]&&n.toggleClass(a.filterRowHide,t.hideFiltersCheck(r))},200)}).find("input, select").bind("focus blur",function(i){var s=i,n=e(this).closest("tr");clearTimeout(l),l=setTimeout(function(){clearTimeout(l),n.toggleClass(a.filterRowHide,t.hideFiltersCheck(r)&&"focus"!==s.type)},200)})},defaultFilter:function(t,i){if(""===t)return t;var a=r.iQuery,l=i.match(r.igQuery).length,s=l>1?e.trim(t).split(/\s/):[e.trim(t)],n=s.length-1,o=0,c=i;for(n<1&&l>1&&(s[1]=s[0]);a.test(c);)c=c.replace(a,s[o++]||""),a.test(c)&&o<n&&""!==(s[o]||"")&&(c=i.replace(a,c));return c},getLatestSearch:function(t){return t?t.sort(function(t,r){return e(r).attr("data-lastSearchTime")-e(t).attr("data-lastSearchTime")}):t||e()},findRange:function(e,t,r){var i,a,l,s,n,o,c,d,f,h=[];if(/^[0-9]+$/.test(t))return[parseInt(t,10)];if(!r&&/-/.test(t))for(f=(a=t.match(/(\d+)\s*-\s*(\d+)/g))?a.length:0,d=0;d<f;d++){for(l=a[d].split(/\s*-\s*/),(s=parseInt(l[0],10)||0)>(n=parseInt(l[1],10)||e.columns-1)&&(i=s,s=n,n=i),n>=e.columns&&(n=e.columns-1);s<=n;s++)h[h.length]=s;t=t.replace(a[d],"")}if(!r&&/,/.test(t))for(f=(o=t.split(/\s*,\s*/)).length,c=0;c<f;c++)""!==o[c]&&(d=parseInt(o[c],10))<e.columns&&(h[h.length]=d);if(!h.length)for(d=0;d<e.columns;d++)h[h.length]=d;return h},getColumnElm:function(r,i,a){return i.filter(function(){var i=t.findRange(r,e(this).attr("data-column"));return e.inArray(a,i)>-1})},multipleColumns:function(r,i){var a=r.widgetOptions,l=a.filter_initialized||!i.filter(a.filter_anyColumnSelector).length,s=e.trim(t.getLatestSearch(i).attr("data-column")||"");return t.findRange(r,s,!l)},processTypes:function(r,i,a){var l,s=null,n=null;for(l in t.types)e.inArray(l,a.excludeMatch)<0&&null===n&&null!==(n=t.types[l](r,i,a))&&(i.matchedOn=l,s=n);return s},matchType:function(e,t){var r,i=e.widgetOptions,l=e.$headerIndexed[t];return l.hasClass("filter-exact")?r=!1:l.hasClass("filter-match")?r=!0:(i.filter_columnFilters?l=e.$filters.find("."+a.filter).add(i.filter_$externalFilters).filter('[data-column="'+t+'"]'):i.filter_$externalFilters&&(l=i.filter_$externalFilters.filter('[data-column="'+t+'"]')),r=!!l.length&&"match"===e.widgetOptions.filter_matchType[(l[0].nodeName||"").toLowerCase()]),r},processRow:function(a,l,s){var n,o,c,d,f,h=a.widgetOptions,u=!0,p=h.filter_$anyMatch&&h.filter_$anyMatch.length,g=h.filter_$anyMatch&&h.filter_$anyMatch.length?t.multipleColumns(a,h.filter_$anyMatch):[];if(l.$cells=l.$row.children(),l.matchedOn=null,l.anyMatchFlag&&g.length>1||l.anyMatchFilter&&!p){if(l.anyMatch=!0,l.isMatch=!0,l.rowArray=l.$cells.map(function(t){if(e.inArray(t,g)>-1||l.anyMatchFilter&&!p)return l.parsed[t]?f=l.cacheArray[t]:(f=l.rawArray[t],f=e.trim(h.filter_ignoreCase?f.toLowerCase():f),a.sortLocaleCompare&&(f=i.replaceAccents(f))),f}).get(),l.filter=l.anyMatchFilter,l.iFilter=l.iAnyMatchFilter,l.exact=l.rowArray.join(" "),l.iExact=h.filter_ignoreCase?l.exact.toLowerCase():l.exact,l.cache=l.cacheArray.slice(0,-1).join(" "),s.excludeMatch=s.noAnyMatch,null!==(o=t.processTypes(a,l,s)))u=o;else if(h.filter_startsWith)for(u=!1,g=Math.min(a.columns,l.rowArray.length);!u&&g>0;)g--,u=u||0===l.rowArray[g].indexOf(l.iFilter);else u=(l.iExact+l.childRowText).indexOf(l.iFilter)>=0;if(l.anyMatch=!1,l.filters.join("")===l.filter)return u}for(g=0;g<a.columns;g++)l.filter=l.filters[g],l.index=g,s.excludeMatch=s.excludeFilter[g],l.filter&&(l.cache=l.cacheArray[g],n=l.parsed[g]?l.cache:l.rawArray[g]||"",l.exact=a.sortLocaleCompare?i.replaceAccents(n):n,l.iExact=!r.type.test(typeof l.exact)&&h.filter_ignoreCase?l.exact.toLowerCase():l.exact,l.isMatch=t.matchType(a,g),n=u,d=h.filter_columnFilters?a.$filters.add(h.filter_$externalFilters).filter('[data-column="'+g+'"]').find("select option:selected").attr("data-function-name")||"":"",a.sortLocaleCompare&&(l.filter=i.replaceAccents(l.filter)),h.filter_defaultFilter&&r.iQuery.test(s.defaultColFilter[g])&&(l.filter=t.defaultFilter(l.filter,s.defaultColFilter[g])),l.iFilter=h.filter_ignoreCase?(l.filter||"").toLowerCase():l.filter,o=null,(c=s.functions[g])&&("function"==typeof c?o=c(l.exact,l.cache,l.filter,g,l.$row,a,l):"function"==typeof c[d||l.filter]&&(o=c[f=d||l.filter](l.exact,l.cache,l.filter,g,l.$row,a,l))),null===o?(o=t.processTypes(a,l,s),f=!0===c&&("and"===l.matchedOn||"or"===l.matchedOn),null===o||f?!0===c?n=l.isMatch?(""+l.iExact).search(l.iFilter)>=0:l.filter===l.exact:(f=(l.iExact+l.childRowText).indexOf(t.parseFilter(a,l.iFilter,l)),n=!h.filter_startsWith&&f>=0||h.filter_startsWith&&0===f):n=o):n=o,u=!!n&&u);return u},findRows:function(a,l,s){if(!t.equalFilters(a.config,a.config.lastSearch,s)&&a.config.widgetOptions.filter_initialized){var n,o,c,d,f,h,u,p,g,m,b,y,_,v,w,x,S,C,z,$,F,R,T,k=e.extend([],l),H=a.config,A=H.widgetOptions,I=i.debug(H,"filter"),O={anyMatch:!1,filters:l,filter_regexCache:[]},E={noAnyMatch:["range","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:i.getColumnData(a,A.filter_defaultFilter,H.columns,!0)||""};for(O.parsed=[],g=0;g<H.columns;g++)O.parsed[g]=A.filter_useParsedData||H.parsers&&H.parsers[g]&&H.parsers[g].parsed||i.getData&&"parsed"===i.getData(H.$headerIndexed[g],i.getColumnData(a,H.headers,g),"filter")||H.$headerIndexed[g].hasClass("filter-parsed"),E.functions[g]=i.getColumnData(a,A.filter_functions,g)||H.$headerIndexed[g].hasClass("filter-select"),E.defaultColFilter[g]=i.getColumnData(a,A.filter_defaultFilter,g)||"",E.excludeFilter[g]=(i.getColumnData(a,A.filter_excludeFilter,g,!0)||"").split(/\s+/);for(I&&(console.log("Filter >> Starting filter widget search",l),v=new Date),H.filteredRows=0,H.totalRows=0,s=k||[],u=0;u<H.$tbodies.length;u++){if(p=i.processTbody(a,H.$tbodies.eq(u),!0),g=H.columns,o=H.cache[u].normalized,d=e(e.map(o,function(e){return e[g].$row.get()})),""===s.join("")||A.filter_serversideFiltering)d.removeClass(A.filter_filteredRow).not("."+H.cssChildRow).css("display","");else{if(d=d.not("."+H.cssChildRow),n=d.length,(A.filter_$anyMatch&&A.filter_$anyMatch.length||void 0!==l[H.columns])&&(O.anyMatchFlag=!0,O.anyMatchFilter=""+(l[H.columns]||A.filter_$anyMatch&&t.getLatestSearch(A.filter_$anyMatch).val()||""),A.filter_columnAnyMatch)){for(z=O.anyMatchFilter.split(r.andSplit),$=!1,x=0;x<z.length;x++)(F=z[x].split(":")).length>1&&(isNaN(F[0])?e.each(H.headerContent,function(e,t){t.toLowerCase().indexOf(F[0])>-1&&(l[R=e]=F[1])}):R=parseInt(F[0],10)-1,R>=0&&R<H.columns&&(l[R]=F[1],z.splice(x,1),x--,$=!0));$&&(O.anyMatchFilter=z.join(" && "))}if(C=A.filter_searchFiltered,b=H.lastSearch||H.$table.data("lastSearch")||[],C)for(x=0;x<g+1;x++)w=l[x]||"",C||(x=g),C=C&&b.length&&0===w.indexOf(b[x]||"")&&!r.alreadyFiltered.test(w)&&!r.exactTest.test(w)&&!(r.isNeg1.test(w)||r.isNeg2.test(w))&&!(""!==w&&H.$filters&&H.$filters.filter('[data-column="'+x+'"]').find("select").length&&!t.matchType(H,x));for(S=d.not("."+A.filter_filteredRow).length,C&&0===S&&(C=!1),I&&console.log("Filter >> Searching through "+(C&&S<n?S:"all")+" rows"),O.anyMatchFlag&&(H.sortLocaleCompare&&(O.anyMatchFilter=i.replaceAccents(O.anyMatchFilter)),A.filter_defaultFilter&&r.iQuery.test(E.defaultAnyFilter)&&(O.anyMatchFilter=t.defaultFilter(O.anyMatchFilter,E.defaultAnyFilter),C=!1),O.iAnyMatchFilter=A.filter_ignoreCase&&H.ignoreCase?O.anyMatchFilter.toLowerCase():O.anyMatchFilter),h=0;h<n;h++)if(T=d[h].className,!(h&&r.child.test(T)||C&&r.filtered.test(T))){if(O.$row=d.eq(h),O.rowIndex=h,O.cacheArray=o[h],c=O.cacheArray[H.columns],O.rawArray=c.raw,O.childRowText="",!A.filter_childByColumn){for(T="",m=c.child,x=0;x<m.length;x++)T+=" "+m[x].join(" ")||"";O.childRowText=A.filter_childRows?A.filter_ignoreCase?T.toLowerCase():T:""}if(y=!1,_=t.processRow(H,O,E),f=c.$row,w=!!_,m=c.$row.filter(":gt(0)"),A.filter_childRows&&m.length){if(A.filter_childByColumn)for(A.filter_childWithSibs||(m.addClass(A.filter_filteredRow),f=f.eq(0)),x=0;x<m.length;x++)O.$row=m.eq(x),O.cacheArray=c.child[x],O.rawArray=O.cacheArray,w=t.processRow(H,O,E),y=y||w,!A.filter_childWithSibs&&w&&m.eq(x).removeClass(A.filter_filteredRow);y=y||_}else y=w;f.toggleClass(A.filter_filteredRow,!y)[0].display=y?"":"none"}}H.filteredRows+=d.not("."+A.filter_filteredRow).length,H.totalRows+=d.length,i.processTbody(a,p,!1)}H.lastCombinedFilter=k.join(""),H.lastSearch=k,H.$table.data("lastSearch",k),A.filter_saveFilters&&i.storage&&i.storage(a,"tablesorter-filters",t.processFilters(k,!0)),I&&console.log("Filter >> Completed search"+i.benchmark(v)),A.filter_initialized&&(H.$table.triggerHandler("filterBeforeEnd",H),H.$table.triggerHandler("filterEnd",H)),setTimeout(function(){i.applyWidget(H.table)},0)}},getOptionSource:function(r,a,l){var s=(r=e(r)[0]).config,n=!1,o=s.widgetOptions.filter_selectSource,c=s.$table.data("lastSearch")||[],d="function"==typeof o||i.getColumnData(r,o,a);if(l&&""!==c[a]&&(l=!1),!0===d)n=o(r,a,l);else{if(d instanceof e||"string"===e.type(d)&&d.indexOf("</option>")>=0)return d;if(e.isArray(d))n=d;else if("object"===e.type(o)&&d&&null===(n=d(r,a,l)))return null}return!1===n&&(n=t.getOptions(r,a,l)),t.processOptions(r,a,n)},processOptions:function(t,r,a){if(!e.isArray(a))return!1;var l,s,n,o,c,d,f=(t=e(t)[0]).config,h=void 0!==r&&null!==r&&r>=0&&r<f.columns,u=!!h&&f.$headerIndexed[r].hasClass("filter-select-sort-desc"),p=[];if(a=e.grep(a,function(t,r){return!!t.text||e.inArray(t,a)===r}),h&&f.$headerIndexed[r].hasClass("filter-select-nosort"))return a;for(o=a.length,n=0;n<o;n++)d=(s=a[n]).text?s.text:s,c=(h&&f.parsers&&f.parsers.length&&f.parsers[r].format(d,t,[],r)||d).toString(),c=f.widgetOptions.filter_ignoreCase?c.toLowerCase():c,s.text?(s.parsed=c,p[p.length]=s):p[p.length]={text:s,parsed:c};for(l=f.textSorter||"",p.sort(function(e,a){var s=u?a.parsed:e.parsed,n=u?e.parsed:a.parsed;return h&&"function"==typeof l?l(s,n,!0,r,t):h&&"object"==typeof l&&l.hasOwnProperty(r)?l[r](s,n,!0,r,t):!i.sortNatural||i.sortNatural(s,n)}),a=[],o=p.length,n=0;n<o;n++)a[a.length]=p[n];return a},getOptions:function(t,r,a){var l,s,n,o,c,d,f,h,u=(t=e(t)[0]).config,p=u.widgetOptions,g=[];for(s=0;s<u.$tbodies.length;s++)for(c=u.cache[s],n=u.cache[s].normalized.length,l=0;l<n;l++)if(o=c.row?c.row[l]:c.normalized[l][u.columns].$row[0],!a||!o.className.match(p.filter_filteredRow))if(p.filter_useParsedData||u.parsers[r].parsed||u.$headerIndexed[r].hasClass("filter-parsed")){if(g[g.length]=""+c.normalized[l][r],p.filter_childRows&&p.filter_childByColumn)for(h=c.normalized[l][u.columns].$row.length-1,d=0;d<h;d++)g[g.length]=""+c.normalized[l][u.columns].child[d][r]}else if(g[g.length]=c.normalized[l][u.columns].raw[r],p.filter_childRows&&p.filter_childByColumn)for(h=c.normalized[l][u.columns].$row.length,d=1;d<h;d++)f=c.normalized[l][u.columns].$row.eq(d).children().eq(r),g[g.length]=""+i.getElementText(u,f,r);return g},buildSelect:function(i,l,s,n,o){if(i=e(i)[0],l=parseInt(l,10),i.config.cache&&!e.isEmptyObject(i.config.cache)){var c,d,f,h,u,p,g,m=i.config,b=m.widgetOptions,y=m.$headerIndexed[l],_='<option value="">'+(y.data("placeholder")||y.attr("data-placeholder")||b.filter_placeholder.select||"")+"</option>",v=m.$table.find("thead").find("select."+a.filter+'[data-column="'+l+'"]').val();if(void 0!==s&&""!==s||null!==(s=t.getOptionSource(i,l,o))){if(e.isArray(s)){for(c=0;c<s.length;c++)if((g=s[c]).text){g["data-function-name"]=void 0===g.value?g.text:g.value,_+="<option";for(d in g)g.hasOwnProperty(d)&&"text"!==d&&(_+=" "+d+'="'+g[d].replace(r.quote,"&quot;")+'"');g.value||(_+=' value="'+g.text.replace(r.quote,"&quot;")+'"'),_+=">"+g.text.replace(r.quote,"&quot;")+"</option>"}else""+g!="[object Object]"&&(d=f=g=(""+g).replace(r.quote,"&quot;"),f.indexOf(b.filter_selectSourceSeparator)>=0&&(d=(h=f.split(b.filter_selectSourceSeparator))[0],f=h[1]),_+=""!==g?"<option "+(d===f?"":'data-function-name="'+g+'" ')+'value="'+d+'">'+f+"</option>":"");s=[]}u=(m.$filters?m.$filters:m.$table.children("thead")).find("."+a.filter),b.filter_$externalFilters&&(u=u&&u.length?u.add(b.filter_$externalFilters):b.filter_$externalFilters),(p=u.filter('select[data-column="'+l+'"]')).length&&(p[n?"html":"append"](_),e.isArray(s)||p.append(s).val(v),p.val(v))}}},buildDefault:function(e,r){var a,l,s,n=e.config,o=n.widgetOptions,c=n.columns;for(a=0;a<c;a++)s=!((l=n.$headerIndexed[a]).hasClass("filter-false")||l.hasClass("parser-false")),(l.hasClass("filter-select")||!0===i.getColumnData(e,o.filter_functions,a))&&s&&t.buildSelect(e,a,"",r,l.hasClass(o.filter_onlyAvail))}},r=t.regex,i.getFilters=function(r,i,l,s){var n,o,c,d,f=[],h=r?e(r)[0].config:"",u=h?h.widgetOptions:"";if(!0!==i&&u&&!u.filter_columnFilters||e.isArray(l)&&t.equalFilters(h,l,h.lastSearch))return e(r).data("lastSearch")||[];if(h&&(h.$filters&&(o=h.$filters.find("."+a.filter)),u.filter_$externalFilters&&(o=o&&o.length?o.add(u.filter_$externalFilters):u.filter_$externalFilters),o&&o.length))for(f=l||[],n=0;n<h.columns+1;n++)d=n===h.columns?u.filter_anyColumnSelector+","+u.filter_multipleColumnSelector:'[data-column="'+n+'"]',(c=o.filter(d)).length&&(c=t.getLatestSearch(c),e.isArray(l)?(s&&c.length>1&&(c=c.slice(1)),n===h.columns&&(c=(d=c.filter(u.filter_anyColumnSelector)).length?d:c),c.val(l[n]).trigger("change"+h.namespace)):(f[n]=c.val()||"",n===h.columns?c.slice(1).filter('[data-column*="'+c.attr("data-column")+'"]').val(f[n]):c.slice(1).val(f[n])),n===h.columns&&c.length&&(u.filter_$anyMatch=c));return f},i.setFilters=function(r,a,l,s){var n=r?e(r)[0].config:"",o=i.getFilters(r,!0,a,s);return void 0===l&&(l=!0),n&&l&&(n.lastCombinedFilter=null,n.lastSearch=[],t.searching(n.table,a,s),n.$table.triggerHandler("filterFomatterUpdate")),0!==o.length}}(e),function(e,t){"use strict";function r(t,r){var i=isNaN(r.stickyHeaders_offset)?e(r.stickyHeaders_offset):[];return i.length?i.height()||0:parseInt(r.stickyHeaders_offset,10)||0}var i=e.tablesorter||{};e.extend(i.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),i.addHeaderResizeEvent=function(t,r,i){if((t=e(t)[0]).config){var a={timer:250},l=e.extend({},a,i),s=t.config,n=s.widgetOptions,o=function(e){var t,r,i,a,l,o,c=s.$headers.length;for(n.resize_flag=!0,r=[],t=0;t<c;t++)a=(i=s.$headers.eq(t)).data("savedSizes")||[0,0],l=i[0].offsetWidth,o=i[0].offsetHeight,l===a[0]&&o===a[1]||(i.data("savedSizes",[l,o]),r.push(i[0]));r.length&&!1!==e&&s.$table.triggerHandler("resize",[r]),n.resize_flag=!1};if(clearInterval(n.resize_timer),r)return n.resize_flag=!1,!1;o(!1),n.resize_timer=setInterval(function(){n.resize_flag||o()},l.timer)}},i.addWidget({id:"stickyHeaders",priority:54,options:{stickyHeaders:"",stickyHeaders_appendTo:null,stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(a,l,s){if(!(l.$table.hasClass("hasStickyHeaders")||e.inArray("filter",l.widgets)>=0&&!l.$table.hasClass("hasFilters"))){var n,o,c,d,f=l.$table,h=e(s.stickyHeaders_attachTo||s.stickyHeaders_appendTo),u=l.namespace+"stickyheaders ",p=e(s.stickyHeaders_yScroll||s.stickyHeaders_attachTo||t),g=e(s.stickyHeaders_xScroll||s.stickyHeaders_attachTo||t),m=f.children("thead:first").children("tr").not(".sticky-false").children(),b=f.children("tfoot"),y=r(l,s),_=f.parent().closest("."+i.css.table).hasClass("hasStickyHeaders")?f.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],v=_.length?_.height():0,w=s.$sticky=f.clone().addClass("containsStickyHeaders "+i.css.sticky+" "+s.stickyHeaders+" "+l.namespace.slice(1)+"_extra_table").wrap('<div class="'+i.css.stickyWrap+'">'),x=w.parent().addClass(i.css.stickyHide).css({position:h.length?"absolute":"fixed",padding:parseInt(w.parent().parent().css("padding-left"),10),top:y+v,left:0,visibility:"hidden",zIndex:s.stickyHeaders_zIndex||2}),S=w.children("thead:first"),C="",z=function(e,r){var i,a,l,s,n,o=e.filter(":visible"),c=o.length;for(i=0;i<c;i++)s=r.filter(":visible").eq(i),"border-box"===(n=o.eq(i)).css("box-sizing")?a=n.outerWidth():"collapse"===s.css("border-collapse")?t.getComputedStyle?a=parseFloat(t.getComputedStyle(n[0],null).width):(l=parseFloat(n.css("border-width")),a=n.outerWidth()-parseFloat(n.css("padding-left"))-parseFloat(n.css("padding-right"))-l):a=n.width(),s.css({width:a,"min-width":a,"max-width":a})},$=function(r){return!1===r&&_.length?f.position().left:h.length?parseInt(h.css("padding-left"),10)||0:f.offset().left-parseInt(f.css("margin-left"),10)-e(t).scrollLeft()},F=function(){x.css({left:$(),width:f.outerWidth()}),z(f,w),z(m,d)},R=function(t){if(f.is(":visible")){v=_.length?_.offset().top-p.scrollTop()+_.height():0;var a,n=f.offset(),o=r(l,s),c=e.isWindow(p[0]),d=c?p.scrollTop():_.length?parseInt(_[0].style.top,10):p.offset().top,u=h.length?d:p.scrollTop(),g=s.stickyHeaders_includeCaption?0:f.children("caption").height()||0,m=u+o+v-g,y=f.height()-(x.height()+(b.height()||0))-g,w=m>n.top&&m<n.top+y?"visible":"hidden",S="visible"===w?i.css.stickyVis:i.css.stickyHide,z=!x.hasClass(S),R={visibility:w};h.length&&(z=!0,R.top=c?m-h.offset().top:h.scrollTop()),(a=$(c))!==parseInt(x.css("left"),10)&&(z=!0,R.left=a),R.top=(R.top||0)+(!c&&_.length?_.height():o+v),z&&x.removeClass(i.css.stickyVis+" "+i.css.stickyHide).addClass(S).css(R),(w!==C||t)&&(F(),C=w)}};if(h.length&&!h.css("position")&&h.css("position","relative"),w.attr("id")&&(w[0].id+=s.stickyHeaders_cloneId),w.find("> thead:gt(0), tr.sticky-false").hide(),w.find("> tbody, > tfoot").remove(),w.find("caption").toggle(s.stickyHeaders_includeCaption),d=S.children().children(),w.css({height:0,width:0,margin:0}),d.find("."+i.css.resizer).remove(),f.addClass("hasStickyHeaders").bind("pagerComplete"+u,function(){F()}),i.bindEvents(a,S.children().children("."+i.css.header)),s.stickyHeaders_appendTo?e(s.stickyHeaders_appendTo).append(x):f.after(x),l.onRenderHeader)for(o=(c=S.children("tr").children()).length,n=0;n<o;n++)l.onRenderHeader.apply(c.eq(n),[n,l,w]);g.add(p).unbind("scroll resize ".split(" ").join(u).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(u),function(e){R("resize"===e.type)}),l.$table.unbind("stickyHeadersUpdate"+u).bind("stickyHeadersUpdate"+u,function(){R(!0)}),s.stickyHeaders_addResizeEvent&&i.addHeaderResizeEvent(a),f.hasClass("hasFilters")&&s.filter_columnFilters&&(f.bind("filterEnd"+u,function(){var r=e(document.activeElement).closest("td"),a=r.parent().children().index(r);x.hasClass(i.css.stickyVis)&&s.stickyHeaders_filteredToTop&&(t.scrollTo(0,f.position().top),a>=0&&l.$filters&&l.$filters.eq(a).find("a, select, input").filter(":visible").focus())}),i.filter.bindSearch(f,d.find("."+i.css.filter)),s.filter_hideFilters&&i.filter.hideFilters(l,w)),s.stickyHeaders_addResizeEvent&&f.bind("resize"+l.namespace+"stickyheaders",function(){F()}),R(!0),f.triggerHandler("stickyHeadersInit")}},remove:function(r,a,l){var s=a.namespace+"stickyheaders ";a.$table.removeClass("hasStickyHeaders").unbind("pagerComplete resize filterEnd stickyHeadersUpdate ".split(" ").join(s).replace(/\s+/g," ")).next("."+i.css.stickyWrap).remove(),l.$sticky&&l.$sticky.length&&l.$sticky.remove(),e(t).add(l.stickyHeaders_xScroll).add(l.stickyHeaders_yScroll).add(l.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(s).replace(/\s+/g," ")),i.addHeaderResizeEvent(r,!0)}})}(e,window),function(e,t){"use strict";var r=e.tablesorter||{};e.extend(r.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),e(function(){var t="<style>body."+r.css.resizableNoSelect+" { -ms-user-select: none; -moz-user-select: -moz-none;-khtml-user-select: none; -webkit-user-select: none; user-select: none; }."+r.css.resizableContainer+" { position: relative; height: 1px; }."+r.css.resizableHandle+" { position: absolute; display: inline-block; width: 8px;top: 1px; cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }</style>";e("head").append(t)}),r.resizable={init:function(t,i){if(!t.$table.hasClass("hasResizable")){t.$table.addClass("hasResizable");var a,l,s,n,o=t.$table,c=o.parent(),d=parseInt(o.css("margin-top"),10),f=i.resizable_vars={useStorage:r.storage&&!1!==i.resizable,$wrap:c,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===c.css("overflow")||"scroll"===c.css("overflow")||"auto"===c.css("overflow-x")||"scroll"===c.css("overflow-x"),storedSizes:[]};for(r.resizableReset(t.table,!0),f.tableWidth=o.width(),f.fullWidth=Math.abs(c.width()-f.tableWidth)<20,f.useStorage&&f.overflow&&(r.storage(t.table,"tablesorter-table-original-css-width",f.tableWidth),n=r.storage(t.table,"tablesorter-table-resized-width")||"auto",r.resizable.setWidth(o,n,!0)),i.resizable_vars.storedSizes=s=(f.useStorage?r.storage(t.table,r.css.resizableStorage):[])||[],r.resizable.setWidths(t,i,s),r.resizable.updateStoredSizes(t,i),i.$resizable_container=e('<div class="'+r.css.resizableContainer+'">').css({top:d}).insertBefore(o),l=0;l<t.columns;l++)a=t.$headerIndexed[l],n=r.getColumnData(t.table,t.headers,l),"false"===r.getData(a,n,"resizable")||e('<div class="'+r.css.resizableHandle+'">').appendTo(i.$resizable_container).attr({"data-column":l,unselectable:"on"}).data("header",a).bind("selectstart",!1);r.resizable.bindings(t,i)}},updateStoredSizes:function(e,t){var r,i,a=e.columns,l=t.resizable_vars;for(l.storedSizes=[],r=0;r<a;r++)i=e.$headerIndexed[r],l.storedSizes[r]=i.is(":visible")?i.width():0},setWidth:function(e,t,r){e.css({width:t,"min-width":r?t:"","max-width":r?t:""})},setWidths:function(t,i,a){var l,s,n=i.resizable_vars,o=e(t.namespace+"_extra_headers"),c=t.$table.children("colgroup").children("col");if((a=a||n.storedSizes||[]).length){for(l=0;l<t.columns;l++)r.resizable.setWidth(t.$headerIndexed[l],a[l],n.overflow),o.length&&(s=o.eq(l).add(c.eq(l)),r.resizable.setWidth(s,a[l],n.overflow));(s=e(t.namespace+"_extra_table")).length&&!r.hasWidget(t.table,"scroller")&&r.resizable.setWidth(s,t.$table.outerWidth(),n.overflow)}},setHandlePosition:function(t,i){var a,l=t.$table.height(),s=i.$resizable_container.children(),n=Math.floor(s.width()/2);r.hasWidget(t.table,"scroller")&&(l=0,t.$table.closest("."+r.css.scrollerWrap).children().each(function(){var t=e(this);l+=t.filter('[style*="height"]').length?t.height():t.children("table").height()})),!i.resizable_includeFooter&&t.$table.children("tfoot").length&&(l-=t.$table.children("tfoot").height()),a=parseFloat(e.fn.jquery)>=3.3?0:t.$table.position().left,s.each(function(){var s=e(this),o=parseInt(s.attr("data-column"),10),c=t.columns-1,d=s.data("header");d&&(!d.is(":visible")||!i.resizable_addLastColumn&&r.resizable.checkVisibleColumns(t,o)?s.hide():(o<c||o===c&&i.resizable_addLastColumn)&&s.css({display:"inline-block",height:l,left:d.position().left-a+d.outerWidth()-n}))})},checkVisibleColumns:function(e,t){var r,i=0;for(r=t+1;r<e.columns;r++)i+=e.$headerIndexed[r].is(":visible")?1:0;return 0===i},toggleTextSelection:function(t,i,a){var l=t.namespace+"tsresize";i.resizable_vars.disabled=a,e("body").toggleClass(r.css.resizableNoSelect,a),a?e("body").attr("unselectable","on").bind("selectstart"+l,!1):e("body").removeAttr("unselectable").unbind("selectstart"+l)},bindings:function(i,a){var l=i.namespace+"tsresize";a.$resizable_container.children().bind("mousedown",function(t){var l,s=a.resizable_vars,n=e(i.namespace+"_extra_headers"),o=e(t.target).data("header");l=parseInt(o.attr("data-column"),10),s.$target=o=o.add(n.filter('[data-column="'+l+'"]')),s.target=l,s.$next=t.shiftKey||a.resizable_targetLast?o.parent().children().not(".resizable-false").filter(":last"):o.nextAll(":not(.resizable-false)").eq(0),l=parseInt(s.$next.attr("data-column"),10),s.$next=s.$next.add(n.filter('[data-column="'+l+'"]')),s.next=l,s.mouseXPosition=t.pageX,r.resizable.updateStoredSizes(i,a),r.resizable.toggleTextSelection(i,a,!0)}),e(document).bind("mousemove"+l,function(e){var t=a.resizable_vars;t.disabled&&0!==t.mouseXPosition&&t.$target&&(a.resizable_throttle?(clearTimeout(t.timer),t.timer=setTimeout(function(){r.resizable.mouseMove(i,a,e)},isNaN(a.resizable_throttle)?5:a.resizable_throttle)):r.resizable.mouseMove(i,a,e))}).bind("mouseup"+l,function(){a.resizable_vars.disabled&&(r.resizable.toggleTextSelection(i,a,!1),r.resizable.stopResize(i,a),r.resizable.setHandlePosition(i,a))}),e(t).bind("resize"+l+" resizeEnd"+l,function(){r.resizable.setHandlePosition(i,a)}),i.$table.bind("columnUpdate pagerComplete resizableUpdate ".split(" ").join(l+" "),function(){r.resizable.setHandlePosition(i,a)}).bind("resizableReset"+l,function(){r.resizableReset(i.table)}).find("thead:first").add(e(i.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+l,function(){var e=0===a.resizable_vars.storedSizes.length;return r.resizableReset(i.table),r.resizable.setHandlePosition(i,a),a.resizable_vars.storedSizes=[],e})},mouseMove:function(t,i,a){if(0!==i.resizable_vars.mouseXPosition&&i.resizable_vars.$target){var l,s=0,n=i.resizable_vars,o=n.$next,c=n.storedSizes[n.target],d=a.pageX-n.mouseXPosition;if(n.overflow){if(c+d>0){for(n.storedSizes[n.target]+=d,r.resizable.setWidth(n.$target,n.storedSizes[n.target],!0),l=0;l<t.columns;l++)s+=n.storedSizes[l];r.resizable.setWidth(t.$table.add(e(t.namespace+"_extra_table")),s)}o.length||(n.$wrap[0].scrollLeft=t.$table.width())}else n.fullWidth?(n.storedSizes[n.target]+=d,n.storedSizes[n.next]-=d,r.resizable.setWidths(t,i)):(n.storedSizes[n.target]+=d,r.resizable.setWidths(t,i));n.mouseXPosition=a.pageX,t.$table.triggerHandler("stickyHeadersUpdate")}},stopResize:function(e,t){var i=t.resizable_vars;r.resizable.updateStoredSizes(e,t),i.useStorage&&(r.storage(e.table,r.css.resizableStorage,i.storedSizes),r.storage(e.table,"tablesorter-table-resized-width",e.$table.width())),i.mouseXPosition=0,i.$target=i.$next=null,e.$table.triggerHandler("stickyHeadersUpdate"),e.$table.triggerHandler("resizableComplete")}},r.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_includeFooter:!0,resizable_widths:[],resizable_throttle:!1,resizable_targetLast:!1},init:function(e,t,i,a){r.resizable.init(i,a)},format:function(e,t,i){r.resizable.setHandlePosition(t,i)},remove:function(t,i,a,l){if(a.$resizable_container){var s=i.namespace+"tsresize";i.$table.add(e(i.namespace+"_extra_table")).removeClass("hasResizable").children("thead").unbind("contextmenu"+s),a.$resizable_container.remove(),r.resizable.toggleTextSelection(i,a,!1),r.resizableReset(t,l),e(document).unbind("mousemove"+s+" mouseup"+s)}}}),r.resizableReset=function(t,i){e(t).each(function(){var e,a,l=this.config,s=l&&l.widgetOptions,n=s.resizable_vars;if(t&&l&&l.$headerIndexed.length){for(n.overflow&&n.tableWidth&&(r.resizable.setWidth(l.$table,n.tableWidth,!0),n.useStorage&&r.storage(t,"tablesorter-table-resized-width",n.tableWidth)),e=0;e<l.columns;e++)a=l.$headerIndexed[e],s.resizable_widths&&s.resizable_widths[e]?r.resizable.setWidth(a,s.resizable_widths[e],n.overflow):a.hasClass("resizable-false")||r.resizable.setWidth(a,"",n.overflow);l.$table.triggerHandler("stickyHeadersUpdate"),r.storage&&!i&&r.storage(this,r.css.resizableStorage,[])}})}}(e,window),function(e){"use strict";function t(t){var r=i.storage(t.table,"tablesorter-savesort");return r&&r.hasOwnProperty("sortList")&&e.isArray(r.sortList)?r.sortList:[]}function r(e,r){return(r||t(e)).join(",")!==e.sortList.join(",")}var i=e.tablesorter||{};i.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(e,t,r,i){t.format(e,r,i,!0)},format:function(e,a,l,s){var n,o=a.$table,c=!1!==l.saveSort,d={sortList:a.sortList},f=i.debug(a,"saveSort");f&&(n=new Date),o.hasClass("hasSaveSort")?c&&e.hasInitialized&&i.storage&&r(a)&&(i.storage(e,"tablesorter-savesort",d),f&&console.log("saveSort >> Saving last sort: "+a.sortList+i.benchmark(n))):(o.addClass("hasSaveSort"),d="",i.storage&&(d=t(a),f&&console.log('saveSort >> Last sort loaded: "'+d+'"'+i.benchmark(n)),o.bind("saveSortReset",function(t){t.stopPropagation(),i.storage(e,"tablesorter-savesort","")})),s&&d&&d.length>0?a.sortList=d:e.hasInitialized&&d&&d.length>0&&r(a,d)&&i.sortOn(a,d))},remove:function(e,t){t.$table.removeClass("hasSaveSort"),i.storage&&i.storage(e,"tablesorter-savesort","")}})}(e),e.tablesorter});
 
 
1
+ (function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
2
+
3
+ /*! tablesorter (FORK) - updated 2018-08-27 (v2.31.0)*/
4
+ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(b,y,_){"use strict";var v=b.tablesorter||{};b.extend(!0,v.defaults,{fixedUrl:"",widgetOptions:{storage_fixedUrl:"",storage_group:"",storage_page:"",storage_storageType:"",storage_tableId:"",storage_useSessionStorage:""}}),v.storage=function(e,t,r,i){var a,l,s,n=!1,o={},c=(e=b(e)[0]).config,d=c&&c.widgetOptions,f=v.debug(c,"storage"),h=(i&&i.storageType||d&&d.storage_storageType).toString().charAt(0).toLowerCase(),u=h?"":i&&i.useSessionStorage||d&&d.storage_useSessionStorage,p=b(e),g=i&&i.id||p.attr(i&&i.group||d&&d.storage_group||"data-table-group")||d&&d.storage_tableId||e.id||b(".tablesorter").index(p),m=i&&i.url||p.attr(i&&i.page||d&&d.storage_page||"data-table-page")||d&&d.storage_fixedUrl||c&&c.fixedUrl||y.location.pathname;if("c"!==h&&(h="s"===h||u?"sessionStorage":"localStorage")in y)try{y[h].setItem("_tmptest","temp"),n=!0,y[h].removeItem("_tmptest")}catch(e){console.warn(h+" is not supported in this browser")}if(f&&console.log("Storage >> Using",n?h:"cookies"),b.parseJSON&&(n?o=b.parseJSON(y[h][t]||"null")||{}:(l=_.cookie.split(/[;\s|=]/),o=0!==(a=b.inArray(t,l)+1)&&b.parseJSON(l[a]||"null")||{})),void 0===r||!y.JSON||!JSON.hasOwnProperty("stringify"))return o&&o[m]?o[m][g]:"";o[m]||(o[m]={}),o[m][g]=r,n?y[h][t]=JSON.stringify(o):((s=new Date).setTime(s.getTime()+31536e6),_.cookie=t+"="+JSON.stringify(o).replace(/\"/g,'"')+"; expires="+s.toGMTString()+"; path=/")}}(e,window,document),function(C){"use strict";var z=C.tablesorter||{};z.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"glyphicon glyphicon-chevron-up",iconSortDesc:"glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s ui-icon-caret-2-n-s",iconSortAsc:"ui-icon-carat-1-n ui-icon-caret-1-n",iconSortDesc:"ui-icon-carat-1-s ui-icon-caret-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},C.extend(z.css,{wrapper:"tablesorter-wrapper"}),z.addWidget({id:"uitheme",priority:10,format:function(e,t,r){var i,a,l,s,n,o,c,d,f,h,u,p,g,m=z.themes,b=t.$table.add(C(t.namespace+"_extra_table")),y=t.$headers.add(C(t.namespace+"_extra_headers")),_=t.theme||"jui",v=m[_]||{},w=C.trim([v.sortNone,v.sortDesc,v.sortAsc,v.active].join(" ")),x=C.trim([v.iconSortNone,v.iconSortDesc,v.iconSortAsc].join(" ")),S=z.debug(t,"uitheme");for(S&&(n=new Date),b.hasClass("tablesorter-"+_)&&t.theme===t.appliedTheme&&r.uitheme_applied||(r.uitheme_applied=!0,h=m[t.appliedTheme]||{},u=(g=!C.isEmptyObject(h))?[h.sortNone,h.sortDesc,h.sortAsc,h.active].join(" "):"",p=g?[h.iconSortNone,h.iconSortDesc,h.iconSortAsc].join(" "):"",g&&(r.zebra[0]=C.trim(" "+r.zebra[0].replace(" "+h.even,"")),r.zebra[1]=C.trim(" "+r.zebra[1].replace(" "+h.odd,"")),t.$tbodies.children().removeClass([h.even,h.odd].join(" "))),v.even&&(r.zebra[0]+=" "+v.even),v.odd&&(r.zebra[1]+=" "+v.odd),b.children("caption").removeClass(h.caption||"").addClass(v.caption),d=b.removeClass((t.appliedTheme?"tablesorter-"+(t.appliedTheme||""):"")+" "+(h.table||"")).addClass("tablesorter-"+_+" "+(v.table||"")).children("tfoot"),t.appliedTheme=t.theme,d.length&&d.children("tr").removeClass(h.footerRow||"").addClass(v.footerRow).children("th, td").removeClass(h.footerCells||"").addClass(v.footerCells),y.removeClass((g?[h.header,h.hover,u].join(" "):"")||"").addClass(v.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(e){C(this)["mouseenter"===e.type?"addClass":"removeClass"](v.hover||"")}),y.each(function(){var e=C(this);e.find("."+z.css.wrapper).length||e.wrapInner('<div class="'+z.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),t.cssIcon&&y.find("."+z.css.icon).removeClass(g?[h.icons,p].join(" "):"").addClass(v.icons||""),z.hasWidget(t.table,"filter")&&(a=function(){b.children("thead").children("."+z.css.filterRow).removeClass(g&&h.filterRow||"").addClass(v.filterRow||"")},r.filter_initialized?a():b.one("filterInit",function(){a()}))),i=0;i<t.columns;i++)o=t.$headers.add(C(t.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+i+'"]'),c=z.css.icon?o.find("."+z.css.icon):C(),(f=y.not(".sorter-false").filter('[data-column="'+i+'"]:last')).length&&(o.removeClass(w),c.removeClass(x),f[0].sortDisabled?c.removeClass(v.icons||""):(l=v.sortNone,s=v.iconSortNone,f.hasClass(z.css.sortAsc)?(l=[v.sortAsc,v.active].join(" "),s=v.iconSortAsc):f.hasClass(z.css.sortDesc)&&(l=[v.sortDesc,v.active].join(" "),s=v.iconSortDesc),o.addClass(l),c.addClass(s||"")));S&&console.log("uitheme >> Applied "+_+" theme"+z.benchmark(n))},remove:function(e,t,r,i){if(r.uitheme_applied){var a=t.$table,l=t.appliedTheme||"jui",s=z.themes[l]||z.themes.jui,n=a.children("thead").children(),o=s.sortNone+" "+s.sortDesc+" "+s.sortAsc,c=s.iconSortNone+" "+s.iconSortDesc+" "+s.iconSortAsc;a.removeClass("tablesorter-"+l+" "+s.table),r.uitheme_applied=!1,i||(a.find(z.css.header).removeClass(s.header),n.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(s.hover+" "+o+" "+s.active).filter("."+z.css.filterRow).removeClass(s.filterRow),n.find("."+z.css.icon).removeClass(s.icons+" "+c))}}})}(e),function(b){"use strict";var y=b.tablesorter||{};y.addWidget({id:"columns",priority:65,options:{columns:["primary","secondary","tertiary"]},format:function(e,t,r){var i,a,l,s,n,o,c,d,f=t.$table,h=t.$tbodies,u=t.sortList,p=u.length,g=r&&r.columns||["primary","secondary","tertiary"],m=g.length-1;for(c=g.join(" "),a=0;a<h.length;a++)(l=(i=y.processTbody(e,h.eq(a),!0)).children("tr")).each(function(){if(n=b(this),"none"!==this.style.display&&(o=n.children().removeClass(c),u&&u[0]&&(o.eq(u[0][0]).addClass(g[0]),1<p)))for(d=1;d<p;d++)o.eq(u[d][0]).addClass(g[d]||g[m])}),y.processTbody(e,i,!1);if(s=!1!==r.columns_thead?["thead tr"]:[],!1!==r.columns_tfoot&&s.push("tfoot tr"),s.length&&(l=f.find(s.join(",")).children().removeClass(c),p))for(d=0;d<p;d++)l.filter('[data-column="'+u[d][0]+'"]').addClass(g[d]||g[m])},remove:function(e,t,r){var i,a,l=t.$tbodies,s=(r.columns||["primary","secondary","tertiary"]).join(" ");for(t.$headers.removeClass(s),t.$table.children("tfoot").children("tr").children("th, td").removeClass(s),i=0;i<l.length;i++)(a=y.processTbody(e,l.eq(i),!0)).children("tr").each(function(){b(this).children().removeClass(s)}),y.processTbody(e,a,!1)}})}(e),function(A){"use strict";var I,O,E=A.tablesorter||{},b=E.css,o=E.keyCodes;A.extend(b,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"}),A.extend(o,{backSpace:8,escape:27,space:32,left:37,down:40}),E.addWidget({id:"filter",priority:50,options:{filter_cellFilter:"",filter_childRows:!1,filter_childByColumn:!1,filter_childWithSibs:!0,filter_columnAnyMatch:!0,filter_columnFilters:!0,filter_cssFilter:"",filter_defaultAttrib:"data-value",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_filterLabel:'Filter "{{label}}" column by...',filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_matchType:{input:"exact",select:"exact"},filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_resetOnEsc:!0,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_selectSourceSeparator:"|",filter_serversideFiltering:!1,filter_startsWith:!1,filter_useParsedData:!1},format:function(e,t,r){t.$table.hasClass("hasFilters")||I.init(e,t,r)},remove:function(e,t,r,i){var a,l,s=t.$table,n=t.$tbodies,o="addRows updateCell update updateRows updateComplete appendCache filterReset filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit ".split(" ").join(t.namespace+"filter ");if(s.removeClass("hasFilters").unbind(o.replace(E.regex.spaces," ")).find("."+b.filterRow).remove(),r.filter_initialized=!1,!i){for(a=0;a<n.length;a++)(l=E.processTbody(e,n.eq(a),!0)).children().removeClass(r.filter_filteredRow).show(),E.processTbody(e,l,!1);r.filter_reset&&A(document).undelegate(r.filter_reset,"click"+t.namespace+"filter")}}}),O=(I=E.filter={regex:{regex:/^\/((?:\\\/|[^\/])+)\/([migyu]{0,5})?$/,child:/tablesorter-childRow/,filtered:/filtered/,type:/undefined|number/,exact:/(^[\"\'=]+)|([\"\'=]+$)/g,operators:/[<>=]/g,query:"(q|query)",wild01:/\?/g,wild0More:/\*/g,quote:/\"/g,isNeg1:/(>=?\s*-\d)/,isNeg2:/(<=?\s*\d)/},types:{or:function(e,t,r){if(!O.orTest.test(t.iFilter)&&!O.orSplit.test(t.filter)||O.regex.test(t.filter))return null;var i,a,l,s=A.extend({},t),n=t.filter.split(O.orSplit),o=t.iFilter.split(O.orSplit),c=n.length;for(i=0;i<c;i++){s.nestedFilters=!0,s.filter=""+(I.parseFilter(e,n[i],t)||""),s.iFilter=""+(I.parseFilter(e,o[i],t)||""),l="("+(I.parseFilter(e,s.filter,t)||"")+")";try{if(a=new RegExp(t.isMatch?l:"^"+l+"$",e.widgetOptions.filter_ignoreCase?"i":"").test(s.exact)||I.processTypes(e,s,r))return a}catch(e){return null}}return a||!1},and:function(e,t,r){if(O.andTest.test(t.filter)){var i,a,l,s,n=A.extend({},t),o=t.filter.split(O.andSplit),c=t.iFilter.split(O.andSplit),d=o.length;for(i=0;i<d;i++){n.nestedFilters=!0,n.filter=""+(I.parseFilter(e,o[i],t)||""),n.iFilter=""+(I.parseFilter(e,c[i],t)||""),s=("("+(I.parseFilter(e,n.filter,t)||"")+")").replace(O.wild01,"\\S{1}").replace(O.wild0More,"\\S*");try{l=new RegExp(t.isMatch?s:"^"+s+"$",e.widgetOptions.filter_ignoreCase?"i":"").test(n.exact)||I.processTypes(e,n,r),a=0===i?l:a&&l}catch(e){return null}}return a||!1}return null},regex:function(e,t){if(O.regex.test(t.filter)){var r,i=t.filter_regexCache[t.index]||O.regex.exec(t.filter),a=i instanceof RegExp;try{a||(t.filter_regexCache[t.index]=i=new RegExp(i[1],i[2])),r=i.test(t.exact)}catch(e){r=!1}return r}return null},operators:function(e,t){if(O.operTest.test(t.iFilter)&&""!==t.iExact){var r,i,a,l=e.table,s=t.parsed[t.index],n=E.formatFloat(t.iFilter.replace(O.operators,""),l),o=e.parsers[t.index]||{},c=n;return(s||"numeric"===o.type)&&(a=A.trim(""+t.iFilter.replace(O.operators,"")),n="number"!=typeof(i=I.parseFilter(e,a,t,!0))||""===i||isNaN(i)?n:i),!s&&"numeric"!==o.type||isNaN(n)||void 0===t.cache?(a=isNaN(t.iExact)?t.iExact.replace(E.regex.nondigit,""):t.iExact,r=E.formatFloat(a,l)):r=t.cache,O.gtTest.test(t.iFilter)?i=O.gteTest.test(t.iFilter)?n<=r:n<r:O.ltTest.test(t.iFilter)&&(i=O.lteTest.test(t.iFilter)?r<=n:r<n),i||""!==c||(i=!0),i}return null},notMatch:function(e,t){if(O.notTest.test(t.iFilter)){var r,i=t.iFilter.replace("!",""),a=I.parseFilter(e,i,t)||"";return O.exact.test(a)?""===(a=a.replace(O.exact,""))||A.trim(a)!==t.iExact:(r=t.iExact.search(A.trim(a)),""===a||(t.anyMatch?r<0:!(e.widgetOptions.filter_startsWith?0===r:0<=r)))}return null},exact:function(e,t){if(O.exact.test(t.iFilter)){var r=t.iFilter.replace(O.exact,""),i=I.parseFilter(e,r,t)||"";return t.anyMatch?0<=A.inArray(i,t.rowArray):i==t.iExact}return null},range:function(e,t){if(O.toTest.test(t.iFilter)){var r,i,a,l,s=e.table,n=t.index,o=t.parsed[n],c=t.iFilter.split(O.toSplit);return i=c[0].replace(E.regex.nondigit,"")||"",a=E.formatFloat(I.parseFilter(e,i,t),s),i=c[1].replace(E.regex.nondigit,"")||"",l=E.formatFloat(I.parseFilter(e,i,t),s),(o||"numeric"===e.parsers[n].type)&&(a=""===(r=e.parsers[n].format(""+c[0],s,e.$headers.eq(n),n))||isNaN(r)?a:r,l=""===(r=e.parsers[n].format(""+c[1],s,e.$headers.eq(n),n))||isNaN(r)?l:r),!o&&"numeric"!==e.parsers[n].type||isNaN(a)||isNaN(l)?(i=isNaN(t.iExact)?t.iExact.replace(E.regex.nondigit,""):t.iExact,r=E.formatFloat(i,s)):r=t.cache,l<a&&(i=a,a=l,l=i),a<=r&&r<=l||""===a||""===l}return null},wild:function(e,t){if(O.wildOrTest.test(t.iFilter)){var r=""+(I.parseFilter(e,t.iFilter,t)||"");!O.wildTest.test(r)&&t.nestedFilters&&(r=t.isMatch?r:"^("+r+")$");try{return new RegExp(r.replace(O.wild01,"\\S{1}").replace(O.wild0More,"\\S*"),e.widgetOptions.filter_ignoreCase?"i":"").test(t.exact)}catch(e){return null}}return null},fuzzy:function(e,t){if(O.fuzzyTest.test(t.iFilter)){var r,i=0,a=t.iExact.length,l=t.iFilter.slice(1),s=I.parseFilter(e,l,t)||"";for(r=0;r<a;r++)t.iExact[r]===s[i]&&(i+=1);return i===s.length}return null}},init:function(r){E.language=A.extend(!0,{},{to:"to",or:"or",and:"and"},E.language);var e,t,i,a,l,s,n,o,c=r.config,d=c.widgetOptions,f=function(e,t,r){return""===(t=t.trim())?"":(e||"")+t+(r||"")};if(c.$table.addClass("hasFilters"),c.lastSearch=[],d.filter_searchTimer=null,d.filter_initTimer=null,d.filter_formatterCount=0,d.filter_formatterInit=[],d.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',d.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',s="\\{"+O.query+"\\}",A.extend(O,{child:new RegExp(c.cssChildRow),filtered:new RegExp(d.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+(-"+f("|",E.language.or)+f("|",E.language.to)+")\\s+)","i"),toTest:new RegExp("\\s+(-"+f("|",E.language.to)+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-"+f("|",E.language.to)+")\\s+)","gi"),andTest:new RegExp("\\s+("+f("",E.language.and,"|")+"&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+f("",E.language.and,"|")+"&&)\\s+)","gi"),orTest:new RegExp("(\\|"+f("|\\s+",E.language.or,"\\s+")+")","i"),orSplit:new RegExp("(?:\\|"+f("|\\s+(?:",E.language.or,")\\s+")+")","gi"),iQuery:new RegExp(s,"i"),igQuery:new RegExp(s,"ig"),operTest:/^[<>]=?/,gtTest:/>/,gteTest:/>=/,ltTest:/</,lteTest:/<=/,notTest:/^\!/,wildOrTest:/[\?\*\|]/,wildTest:/\?\*/,fuzzyTest:/^~/,exactTest:/[=\"\|!]/}),s=c.$headers.filter(".filter-false, .parser-false").length,!1!==d.filter_columnFilters&&s!==c.$headers.length&&I.buildRow(r,c,d),i="addRows updateCell update updateRows updateComplete appendCache filterReset "+"filterAndSortReset filterResetSaved filterEnd search ".split(" ").join(c.namespace+"filter "),c.$table.bind(i,function(e,t){return s=d.filter_hideEmpty&&A.isEmptyObject(c.cache)&&!(c.delayInit&&"appendCache"===e.type),c.$table.find("."+b.filterRow).toggleClass(d.filter_filteredRow,s),/(search|filter)/.test(e.type)||(e.stopPropagation(),I.buildDefault(r,!0)),"filterReset"===e.type||"filterAndSortReset"===e.type?(c.$table.find("."+b.filter).add(d.filter_$externalFilters).val(""),"filterAndSortReset"===e.type?E.sortReset(this.config,function(){I.searching(r,[])}):I.searching(r,[])):"filterResetSaved"===e.type?E.storage(r,"tablesorter-filters",""):"filterEnd"===e.type?I.buildDefault(r,!0):(t="search"===e.type?t:"updateComplete"===e.type?c.$table.data("lastSearch"):"",/(update|add)/.test(e.type)&&"updateComplete"!==e.type&&(c.lastCombinedFilter=null,c.lastSearch=[],setTimeout(function(){c.$table.triggerHandler("filterFomatterUpdate")},100)),I.searching(r,t,!0)),!1}),d.filter_reset&&(d.filter_reset instanceof A?d.filter_reset.click(function(){c.$table.triggerHandler("filterReset")}):A(d.filter_reset).length&&A(document).undelegate(d.filter_reset,"click"+c.namespace+"filter").delegate(d.filter_reset,"click"+c.namespace+"filter",function(){c.$table.triggerHandler("filterReset")})),d.filter_functions)for(l=0;l<c.columns;l++)if(n=E.getColumnData(r,d.filter_functions,l))if(o=!((a=c.$headerIndexed[l].removeClass("filter-select")).hasClass("filter-false")||a.hasClass("parser-false")),!(e="")===n&&o)I.buildSelect(r,l);else if("object"==typeof n&&o){for(t in n)"string"==typeof t&&(e+=""===e?'<option value="">'+(a.data("placeholder")||a.attr("data-placeholder")||d.filter_placeholder.select||"")+"</option>":"",0<=(i=s=t).indexOf(d.filter_selectSourceSeparator)&&(i=(s=t.split(d.filter_selectSourceSeparator))[1],s=s[0]),e+="<option "+(i===s?"":'data-function-name="'+t+'" ')+'value="'+s+'">'+i+"</option>");c.$table.find("thead").find("select."+b.filter+'[data-column="'+l+'"]').append(e),(n="function"==typeof(i=d.filter_selectSource)||E.getColumnData(r,i,l))&&I.buildSelect(c.table,l,"",!0,a.hasClass(d.filter_onlyAvail))}I.buildDefault(r,!0),I.bindSearch(r,c.$table.find("."+b.filter),!0),d.filter_external&&I.bindSearch(r,d.filter_external),d.filter_hideFilters&&I.hideFilters(c),c.showProcessing&&(i="filterStart filterEnd ".split(" ").join(c.namespace+"filter-sp "),c.$table.unbind(i.replace(E.regex.spaces," ")).bind(i,function(e,t){a=t?c.$table.find("."+b.header).filter("[data-column]").filter(function(){return""!==t[A(this).data("column")]}):"",E.isProcessing(r,"filterStart"===e.type,t?a:"")})),c.filteredRows=c.totalRows,i="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(c.namespace+"filter "),c.$table.unbind(i.replace(E.regex.spaces," ")).bind(i,function(){I.completeInit(this)}),c.pager&&c.pager.initialized&&!d.filter_initialized?(c.$table.triggerHandler("filterFomatterUpdate"),setTimeout(function(){I.filterInitComplete(c)},100)):d.filter_initialized||I.completeInit(r)},completeInit:function(e){var t=e.config,r=t.widgetOptions,i=I.setDefaults(e,t,r)||[];i.length&&(t.delayInit&&""===i.join("")||E.setFilters(e,i,!0)),t.$table.triggerHandler("filterFomatterUpdate"),setTimeout(function(){r.filter_initialized||I.filterInitComplete(t)},100)},formatterUpdated:function(e,t){var r=e&&e.closest("table"),i=r.length&&r[0].config,a=i&&i.widgetOptions;a&&!a.filter_initialized&&(a.filter_formatterInit[t]=1)},filterInitComplete:function(e){var t,r,i=e.widgetOptions,a=0,l=function(){i.filter_initialized=!0,e.lastSearch=e.$table.data("lastSearch"),e.$table.triggerHandler("filterInit",e),I.findRows(e.table,e.lastSearch||[]),E.debug(e,"filter")&&console.log("Filter >> Widget initialized")};if(A.isEmptyObject(i.filter_formatter))l();else{for(r=i.filter_formatterInit.length,t=0;t<r;t++)1===i.filter_formatterInit[t]&&a++;clearTimeout(i.filter_initTimer),i.filter_initialized||a!==i.filter_formatterCount?i.filter_initialized||(i.filter_initTimer=setTimeout(function(){l()},500)):l()}},processFilters:function(e,t){var r,i=[],a=t?encodeURIComponent:decodeURIComponent,l=e.length;for(r=0;r<l;r++)e[r]&&(i[r]=a(e[r]));return i},setDefaults:function(e,t,r){var i,a,l,s,n,o=E.getFilters(e)||[];if(r.filter_saveFilters&&E.storage&&(a=E.storage(e,"tablesorter-filters")||[],(i=A.isArray(a))&&""===a.join("")||!i||(o=I.processFilters(a))),""===o.join(""))for(n=t.$headers.add(r.filter_$externalFilters).filter("["+r.filter_defaultAttrib+"]"),l=0;l<=t.columns;l++)s=l===t.columns?"all":l,o[l]=n.filter('[data-column="'+s+'"]').attr(r.filter_defaultAttrib)||o[l]||"";return t.$table.data("lastSearch",o),o},parseFilter:function(e,t,r,i){return i||r.parsed[r.index]?e.parsers[r.index].format(t,e.table,[],r.index):t},buildRow:function(e,t,r){var i,a,l,s,n,o,c,d,f,h=r.filter_cellFilter,u=t.columns,p=A.isArray(h),g='<tr role="search" class="'+b.filterRow+" "+t.cssIgnoreRow+'">';for(l=0;l<u;l++)t.$headerIndexed[l].length&&(g+=1<(f=t.$headerIndexed[l]&&t.$headerIndexed[l][0].colSpan||0)?'<td data-column="'+l+"-"+(l+f-1)+'" colspan="'+f+'"':'<td data-column="'+l+'"',g+=p?h[l]?' class="'+h[l]+'"':"":""!==h?' class="'+h+'"':"",g+="></td>");for(t.$filters=A(g+="</tr>").appendTo(t.$table.children("thead").eq(0)).children("td"),l=0;l<u;l++)o=!1,(s=t.$headerIndexed[l])&&s.length&&(i=I.getColumnElm(t,t.$filters,l),d=E.getColumnData(e,r.filter_functions,l),n=r.filter_functions&&d&&"function"!=typeof d||s.hasClass("filter-select"),a=E.getColumnData(e,t.headers,l),o="false"===E.getData(s[0],a,"filter")||"false"===E.getData(s[0],a,"parser"),n?g=A("<select>").appendTo(i):((d=E.getColumnData(e,r.filter_formatter,l))?(r.filter_formatterCount++,(g=d(i,l))&&0===g.length&&(g=i.children("input")),g&&(0===g.parent().length||g.parent().length&&g.parent()[0]!==i[0])&&i.append(g)):g=A('<input type="search">').appendTo(i),g&&(f=s.data("placeholder")||s.attr("data-placeholder")||r.filter_placeholder.search||"",g.attr("placeholder",f))),g&&(c=(A.isArray(r.filter_cssFilter)?void 0!==r.filter_cssFilter[l]&&r.filter_cssFilter[l]||"":r.filter_cssFilter)||"",g.addClass(b.filter+" "+c),(f=(c=r.filter_filterLabel).match(/{{([^}]+?)}}/g))||(f=["{{label}}"]),A.each(f,function(e,t){var r=new RegExp(t,"g"),i=s.attr("data-"+t.replace(/{{|}}/g,"")),a=void 0===i?s.text():i;c=c.replace(r,A.trim(a))}),g.attr({"data-column":i.attr("data-column"),"aria-label":c}),o&&(g.attr("placeholder","").addClass(b.filterDisabled)[0].disabled=!0)))},bindSearch:function(a,e,t){if(a=A(a)[0],(e=A(e)).length){var r,l=a.config,s=l.widgetOptions,i=l.namespace+"filter",n=s.filter_$externalFilters;!0!==t&&(r=s.filter_anyColumnSelector+","+s.filter_multipleColumnSelector,s.filter_$anyMatch=e.filter(r),n&&n.length?s.filter_$externalFilters=s.filter_$externalFilters.add(e):s.filter_$externalFilters=e,E.setFilters(a,l.$table.data("lastSearch")||[],!1===t)),r="keypress keyup keydown search change input ".split(" ").join(i+" "),e.attr("data-lastSearchTime",(new Date).getTime()).unbind(r.replace(E.regex.spaces," ")).bind("keydown"+i,function(e){if(e.which===o.escape&&!a.config.widgetOptions.filter_resetOnEsc)return!1}).bind("keyup"+i,function(e){s=a.config.widgetOptions;var t=parseInt(A(this).attr("data-column"),10),r="boolean"==typeof s.filter_liveSearch?s.filter_liveSearch:E.getColumnData(a,s.filter_liveSearch,t);if(void 0===r&&(r=s.filter_liveSearch.fallback||!1),A(this).attr("data-lastSearchTime",(new Date).getTime()),e.which===o.escape)this.value=s.filter_resetOnEsc?"":l.lastSearch[t];else{if(""!==this.value&&("number"==typeof r&&this.value.length<r||e.which!==o.enter&&e.which!==o.backSpace&&(e.which<o.space||e.which>=o.left&&e.which<=o.down)))return;if(!1===r&&""!==this.value&&e.which!==o.enter)return}I.searching(a,!0,!0,t)}).bind("search change keypress input blur ".split(" ").join(i+" "),function(e){var t=parseInt(A(this).attr("data-column"),10),r=e.type,i="boolean"==typeof s.filter_liveSearch?s.filter_liveSearch:E.getColumnData(a,s.filter_liveSearch,t);!a.config.widgetOptions.filter_initialized||e.which!==o.enter&&"search"!==r&&"blur"!==r&&("change"!==r&&"input"!==r||!0!==i&&(!0===i||"INPUT"===e.target.nodeName)||this.value===l.lastSearch[t])||(e.preventDefault(),A(this).attr("data-lastSearchTime",(new Date).getTime()),I.searching(a,"keypress"!==r,!0,t))})}},searching:function(e,t,r,i){var a,l=e.config.widgetOptions;void 0===i?a=!1:void 0===(a="boolean"==typeof l.filter_liveSearch?l.filter_liveSearch:E.getColumnData(e,l.filter_liveSearch,i))&&(a=l.filter_liveSearch.fallback||!1),clearTimeout(l.filter_searchTimer),void 0===t||!0===t?l.filter_searchTimer=setTimeout(function(){I.checkFilters(e,t,r)},a?l.filter_searchDelay:10):I.checkFilters(e,t,r)},equalFilters:function(e,t,r){var i,a=[],l=[],s=e.columns+1;for(t=A.isArray(t)?t:[],r=A.isArray(r)?r:[],i=0;i<s;i++)a[i]=t[i]||"",l[i]=r[i]||"";return a.join(",")===l.join(",")},checkFilters:function(e,t,r){var i=e.config,a=i.widgetOptions,l=A.isArray(t),s=l?t:E.getFilters(e,!0),n=s||[];if(A.isEmptyObject(i.cache))i.delayInit&&(!i.pager||i.pager&&i.pager.initialized)&&E.updateCache(i,function(){I.checkFilters(e,!1,r)});else if(l&&(E.setFilters(e,s,!1,!0!==r),a.filter_initialized||(i.lastSearch=[],i.lastCombinedFilter="")),a.filter_hideFilters&&i.$table.find("."+b.filterRow).triggerHandler(I.hideFiltersCheck(i)?"mouseleave":"mouseenter"),!I.equalFilters(i,i.lastSearch,n)||!1===t){if(!1===t&&(i.lastCombinedFilter="",i.lastSearch=[]),s=s||[],s=Array.prototype.map?s.map(String):s.join("�").split("�"),a.filter_initialized&&i.$table.triggerHandler("filterStart",[s]),!i.showProcessing)return I.findRows(e,s,n),!1;setTimeout(function(){return I.findRows(e,s,n),!1},30)}},hideFiltersCheck:function(e){if("function"==typeof e.widgetOptions.filter_hideFilters){var t=e.widgetOptions.filter_hideFilters(e);if("boolean"==typeof t)return t}return""===E.getFilters(e.$table).join("")},hideFilters:function(i,e){var a;(e||i.$table).find("."+b.filterRow).addClass(b.filterRowHide).bind("mouseenter mouseleave",function(e){var t=e,r=A(this);clearTimeout(a),a=setTimeout(function(){/enter|over/.test(t.type)?r.removeClass(b.filterRowHide):A(document.activeElement).closest("tr")[0]!==r[0]&&r.toggleClass(b.filterRowHide,I.hideFiltersCheck(i))},200)}).find("input, select").bind("focus blur",function(e){var t=e,r=A(this).closest("tr");clearTimeout(a),a=setTimeout(function(){clearTimeout(a),r.toggleClass(b.filterRowHide,I.hideFiltersCheck(i)&&"focus"!==t.type)},200)})},defaultFilter:function(e,t){if(""===e)return e;var r=O.iQuery,i=t.match(O.igQuery).length,a=1<i?A.trim(e).split(/\s/):[A.trim(e)],l=a.length-1,s=0,n=t;for(l<1&&1<i&&(a[1]=a[0]);r.test(n);)n=n.replace(r,a[s++]||""),r.test(n)&&s<l&&""!==(a[s]||"")&&(n=t.replace(r,n));return n},getLatestSearch:function(e){return e?e.sort(function(e,t){return A(t).attr("data-lastSearchTime")-A(e).attr("data-lastSearchTime")}):e||A()},findRange:function(e,t,r){var i,a,l,s,n,o,c,d,f,h=[];if(/^[0-9]+$/.test(t))return[parseInt(t,10)];if(!r&&/-/.test(t))for(f=(a=t.match(/(\d+)\s*-\s*(\d+)/g))?a.length:0,d=0;d<f;d++){for(l=a[d].split(/\s*-\s*/),s=parseInt(l[0],10)||0,(n=parseInt(l[1],10)||e.columns-1)<s&&(i=s,s=n,n=i),n>=e.columns&&(n=e.columns-1);s<=n;s++)h[h.length]=s;t=t.replace(a[d],"")}if(!r&&/,/.test(t))for(f=(o=t.split(/\s*,\s*/)).length,c=0;c<f;c++)""!==o[c]&&(d=parseInt(o[c],10))<e.columns&&(h[h.length]=d);if(!h.length)for(d=0;d<e.columns;d++)h[h.length]=d;return h},getColumnElm:function(t,e,r){return e.filter(function(){var e=I.findRange(t,A(this).attr("data-column"));return-1<A.inArray(r,e)})},multipleColumns:function(e,t){var r=e.widgetOptions,i=r.filter_initialized||!t.filter(r.filter_anyColumnSelector).length,a=A.trim(I.getLatestSearch(t).attr("data-column")||"");return I.findRange(e,a,!i)},processTypes:function(e,t,r){var i,a=null,l=null;for(i in I.types)A.inArray(i,r.excludeMatch)<0&&null===l&&null!==(l=I.types[i](e,t,r))&&(t.matchedOn=i,a=l);return a},matchType:function(e,t){var r,i=e.widgetOptions,a=e.$headerIndexed[t];return a.hasClass("filter-exact")?r=!1:a.hasClass("filter-match")?r=!0:(i.filter_columnFilters?a=e.$filters.find("."+b.filter).add(i.filter_$externalFilters).filter('[data-column="'+t+'"]'):i.filter_$externalFilters&&(a=i.filter_$externalFilters.filter('[data-column="'+t+'"]')),r=!!a.length&&"match"===e.widgetOptions.filter_matchType[(a[0].nodeName||"").toLowerCase()]),r},processRow:function(t,r,e){var i,a,l,s,n,o=t.widgetOptions,c=!0,d=o.filter_$anyMatch&&o.filter_$anyMatch.length,f=o.filter_$anyMatch&&o.filter_$anyMatch.length?I.multipleColumns(t,o.filter_$anyMatch):[];if(r.$cells=r.$row.children(),r.matchedOn=null,r.anyMatchFlag&&1<f.length||r.anyMatchFilter&&!d){if(r.anyMatch=!0,r.isMatch=!0,r.rowArray=r.$cells.map(function(e){if(-1<A.inArray(e,f)||r.anyMatchFilter&&!d)return r.parsed[e]?n=r.cacheArray[e]:(n=r.rawArray[e],n=A.trim(o.filter_ignoreCase?n.toLowerCase():n),t.sortLocaleCompare&&(n=E.replaceAccents(n))),n}).get(),r.filter=r.anyMatchFilter,r.iFilter=r.iAnyMatchFilter,r.exact=r.rowArray.join(" "),r.iExact=o.filter_ignoreCase?r.exact.toLowerCase():r.exact,r.cache=r.cacheArray.slice(0,-1).join(" "),e.excludeMatch=e.noAnyMatch,null!==(a=I.processTypes(t,r,e)))c=a;else if(o.filter_startsWith)for(c=!1,f=Math.min(t.columns,r.rowArray.length);!c&&0<f;)f--,c=c||0===r.rowArray[f].indexOf(r.iFilter);else c=0<=(r.iExact+r.childRowText).indexOf(r.iFilter);if(r.anyMatch=!1,r.filters.join("")===r.filter)return c}for(f=0;f<t.columns;f++)r.filter=r.filters[f],r.index=f,e.excludeMatch=e.excludeFilter[f],r.filter&&(r.cache=r.cacheArray[f],i=r.parsed[f]?r.cache:r.rawArray[f]||"",r.exact=t.sortLocaleCompare?E.replaceAccents(i):i,r.iExact=!O.type.test(typeof r.exact)&&o.filter_ignoreCase?r.exact.toLowerCase():r.exact,r.isMatch=I.matchType(t,f),i=c,s=o.filter_columnFilters&&t.$filters.add(o.filter_$externalFilters).filter('[data-column="'+f+'"]').find("select option:selected").attr("data-function-name")||"",t.sortLocaleCompare&&(r.filter=E.replaceAccents(r.filter)),o.filter_defaultFilter&&O.iQuery.test(e.defaultColFilter[f])&&(r.filter=I.defaultFilter(r.filter,e.defaultColFilter[f])),r.iFilter=o.filter_ignoreCase?(r.filter||"").toLowerCase():r.filter,a=null,(l=e.functions[f])&&("function"==typeof l?a=l(r.exact,r.cache,r.filter,f,r.$row,t,r):"function"==typeof l[s||r.filter]&&(a=l[n=s||r.filter](r.exact,r.cache,r.filter,f,r.$row,t,r))),null===a?(a=I.processTypes(t,r,e),n=!0===l&&("and"===r.matchedOn||"or"===r.matchedOn),null===a||n?!0===l?i=r.isMatch?0<=(""+r.iExact).search(r.iFilter):r.filter===r.exact:(n=(r.iExact+r.childRowText).indexOf(I.parseFilter(t,r.iFilter,r)),i=!o.filter_startsWith&&0<=n||o.filter_startsWith&&0===n):i=a):i=a,c=!!i&&c);return c},findRows:function(e,r,t){if(!I.equalFilters(e.config,e.config.lastSearch,t)&&e.config.widgetOptions.filter_initialized){var i,a,l,s,n,o,c,d,f,h,u,p,g,m,b,y,_,v,w,x,S,C,z,$=A.extend([],r),F=e.config,R=F.widgetOptions,T=E.debug(F,"filter"),k={anyMatch:!1,filters:r,filter_regexCache:[]},H={noAnyMatch:["range","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:E.getColumnData(e,R.filter_defaultFilter,F.columns,!0)||""};for(k.parsed=[],f=0;f<F.columns;f++)k.parsed[f]=R.filter_useParsedData||F.parsers&&F.parsers[f]&&F.parsers[f].parsed||E.getData&&"parsed"===E.getData(F.$headerIndexed[f],E.getColumnData(e,F.headers,f),"filter")||F.$headerIndexed[f].hasClass("filter-parsed"),H.functions[f]=E.getColumnData(e,R.filter_functions,f)||F.$headerIndexed[f].hasClass("filter-select"),H.defaultColFilter[f]=E.getColumnData(e,R.filter_defaultFilter,f)||"",H.excludeFilter[f]=(E.getColumnData(e,R.filter_excludeFilter,f,!0)||"").split(/\s+/);for(T&&(console.log("Filter >> Starting filter widget search",r),m=new Date),F.filteredRows=0,t=$||[],c=F.totalRows=0;c<F.$tbodies.length;c++){if(d=E.processTbody(e,F.$tbodies.eq(c),!0),f=F.columns,a=F.cache[c].normalized,s=A(A.map(a,function(e){return e[f].$row.get()})),""===t.join("")||R.filter_serversideFiltering)s.removeClass(R.filter_filteredRow).not("."+F.cssChildRow).css("display","");else{if(i=(s=s.not("."+F.cssChildRow)).length,(R.filter_$anyMatch&&R.filter_$anyMatch.length||void 0!==r[F.columns])&&(k.anyMatchFlag=!0,k.anyMatchFilter=""+(r[F.columns]||R.filter_$anyMatch&&I.getLatestSearch(R.filter_$anyMatch).val()||""),R.filter_columnAnyMatch)){for(w=k.anyMatchFilter.split(O.andSplit),x=!1,y=0;y<w.length;y++)1<(S=w[y].split(":")).length&&(isNaN(S[0])?A.each(F.headerContent,function(e,t){-1<t.toLowerCase().indexOf(S[0])&&(r[C=e]=S[1])}):C=parseInt(S[0],10)-1,0<=C&&C<F.columns&&(r[C]=S[1],w.splice(y,1),y--,x=!0));x&&(k.anyMatchFilter=w.join(" && "))}if(v=R.filter_searchFiltered,u=F.lastSearch||F.$table.data("lastSearch")||[],v)for(y=0;y<f+1;y++)b=r[y]||"",v||(y=f),v=v&&u.length&&0===b.indexOf(u[y]||"")&&!O.alreadyFiltered.test(b)&&!O.exactTest.test(b)&&!(O.isNeg1.test(b)||O.isNeg2.test(b))&&!(""!==b&&F.$filters&&F.$filters.filter('[data-column="'+y+'"]').find("select").length&&!I.matchType(F,y));for(_=s.not("."+R.filter_filteredRow).length,v&&0===_&&(v=!1),T&&console.log("Filter >> Searching through "+(v&&_<i?_:"all")+" rows"),k.anyMatchFlag&&(F.sortLocaleCompare&&(k.anyMatchFilter=E.replaceAccents(k.anyMatchFilter)),R.filter_defaultFilter&&O.iQuery.test(H.defaultAnyFilter)&&(k.anyMatchFilter=I.defaultFilter(k.anyMatchFilter,H.defaultAnyFilter),v=!1),k.iAnyMatchFilter=R.filter_ignoreCase&&F.ignoreCase?k.anyMatchFilter.toLowerCase():k.anyMatchFilter),o=0;o<i;o++)if(z=s[o].className,!(o&&O.child.test(z)||v&&O.filtered.test(z))){if(k.$row=s.eq(o),k.rowIndex=o,k.cacheArray=a[o],l=k.cacheArray[F.columns],k.rawArray=l.raw,k.childRowText="",!R.filter_childByColumn){for(z="",h=l.child,y=0;y<h.length;y++)z+=" "+h[y].join(" ")||"";k.childRowText=R.filter_childRows?R.filter_ignoreCase?z.toLowerCase():z:""}if(p=!1,g=I.processRow(F,k,H),n=l.$row,b=!!g,h=l.$row.filter(":gt(0)"),R.filter_childRows&&h.length){if(R.filter_childByColumn)for(R.filter_childWithSibs||(h.addClass(R.filter_filteredRow),n=n.eq(0)),y=0;y<h.length;y++)k.$row=h.eq(y),k.cacheArray=l.child[y],k.rawArray=k.cacheArray,b=I.processRow(F,k,H),p=p||b,!R.filter_childWithSibs&&b&&h.eq(y).removeClass(R.filter_filteredRow);p=p||g}else p=b;n.toggleClass(R.filter_filteredRow,!p)[0].display=p?"":"none"}}F.filteredRows+=s.not("."+R.filter_filteredRow).length,F.totalRows+=s.length,E.processTbody(e,d,!1)}F.lastCombinedFilter=$.join(""),F.lastSearch=$,F.$table.data("lastSearch",$),R.filter_saveFilters&&E.storage&&E.storage(e,"tablesorter-filters",I.processFilters($,!0)),T&&console.log("Filter >> Completed search"+E.benchmark(m)),R.filter_initialized&&(F.$table.triggerHandler("filterBeforeEnd",F),F.$table.triggerHandler("filterEnd",F)),setTimeout(function(){E.applyWidget(F.table)},0)}},getOptionSource:function(e,t,r){var i=(e=A(e)[0]).config,a=!1,l=i.widgetOptions.filter_selectSource,s=i.$table.data("lastSearch")||[],n="function"==typeof l||E.getColumnData(e,l,t);if(r&&""!==s[t]&&(r=!1),!0===n)a=l(e,t,r);else{if(n instanceof A||"string"===A.type(n)&&0<=n.indexOf("</option>"))return n;if(A.isArray(n))a=n;else if("object"===A.type(l)&&n&&null===(a=n(e,t,r)))return null}return!1===a&&(a=I.getOptions(e,t,r)),I.processOptions(e,t,a)},processOptions:function(a,l,r){if(!A.isArray(r))return!1;var s,e,t,i,n,o,c=(a=A(a)[0]).config,d=null!=l&&0<=l&&l<c.columns,f=!!d&&c.$headerIndexed[l].hasClass("filter-select-sort-desc"),h=[];if(r=A.grep(r,function(e,t){return!!e.text||A.inArray(e,r)===t}),d&&c.$headerIndexed[l].hasClass("filter-select-nosort"))return r;for(i=r.length,t=0;t<i;t++)o=(e=r[t]).text?e.text:e,n=(d&&c.parsers&&c.parsers.length&&c.parsers[l].format(o,a,[],l)||o).toString(),n=c.widgetOptions.filter_ignoreCase?n.toLowerCase():n,e.text?(e.parsed=n,h[h.length]=e):h[h.length]={text:e,parsed:n};for(s=c.textSorter||"",h.sort(function(e,t){var r=f?t.parsed:e.parsed,i=f?e.parsed:t.parsed;return d&&"function"==typeof s?s(r,i,!0,l,a):d&&"object"==typeof s&&s.hasOwnProperty(l)?s[l](r,i,!0,l,a):!E.sortNatural||E.sortNatural(r,i)}),r=[],i=h.length,t=0;t<i;t++)r[r.length]=h[t];return r},getOptions:function(e,t,r){var i,a,l,s,n,o,c,d,f=(e=A(e)[0]).config,h=f.widgetOptions,u=[];for(a=0;a<f.$tbodies.length;a++)for(n=f.cache[a],l=f.cache[a].normalized.length,i=0;i<l;i++)if(s=n.row?n.row[i]:n.normalized[i][f.columns].$row[0],!r||!s.className.match(h.filter_filteredRow))if(h.filter_useParsedData||f.parsers[t].parsed||f.$headerIndexed[t].hasClass("filter-parsed")){if(u[u.length]=""+n.normalized[i][t],h.filter_childRows&&h.filter_childByColumn)for(d=n.normalized[i][f.columns].$row.length-1,o=0;o<d;o++)u[u.length]=""+n.normalized[i][f.columns].child[o][t]}else if(u[u.length]=n.normalized[i][f.columns].raw[t],h.filter_childRows&&h.filter_childByColumn)for(d=n.normalized[i][f.columns].$row.length,o=1;o<d;o++)c=n.normalized[i][f.columns].$row.eq(o).children().eq(t),u[u.length]=""+E.getElementText(f,c,t);return u},buildSelect:function(e,t,r,i,a){if(e=A(e)[0],t=parseInt(t,10),e.config.cache&&!A.isEmptyObject(e.config.cache)){var l,s,n,o,c,d,f,h=e.config,u=h.widgetOptions,p=h.$headerIndexed[t],g='<option value="">'+(p.data("placeholder")||p.attr("data-placeholder")||u.filter_placeholder.select||"")+"</option>",m=h.$table.find("thead").find("select."+b.filter+'[data-column="'+t+'"]').val();if(void 0!==r&&""!==r||null!==(r=I.getOptionSource(e,t,a))){if(A.isArray(r)){for(l=0;l<r.length;l++)if((f=r[l]).text){for(s in f["data-function-name"]=void 0===f.value?f.text:f.value,g+="<option",f)f.hasOwnProperty(s)&&"text"!==s&&(g+=" "+s+'="'+f[s].replace(O.quote,"&quot;")+'"');f.value||(g+=' value="'+f.text.replace(O.quote,"&quot;")+'"'),g+=">"+f.text.replace(O.quote,"&quot;")+"</option>"}else""+f!="[object Object]"&&(0<=(s=n=f=(""+f).replace(O.quote,"&quot;")).indexOf(u.filter_selectSourceSeparator)&&(s=(o=n.split(u.filter_selectSourceSeparator))[0],n=o[1]),g+=""!==f?"<option "+(s===n?"":'data-function-name="'+f+'" ')+'value="'+s+'">'+n+"</option>":"");r=[]}c=(h.$filters?h.$filters:h.$table.children("thead")).find("."+b.filter),u.filter_$externalFilters&&(c=c&&c.length?c.add(u.filter_$externalFilters):u.filter_$externalFilters),(d=c.filter('select[data-column="'+t+'"]')).length&&(d[i?"html":"append"](g),A.isArray(r)||d.append(r).val(m),d.val(m))}}},buildDefault:function(e,t){var r,i,a,l=e.config,s=l.widgetOptions,n=l.columns;for(r=0;r<n;r++)a=!((i=l.$headerIndexed[r]).hasClass("filter-false")||i.hasClass("parser-false")),(i.hasClass("filter-select")||!0===E.getColumnData(e,s.filter_functions,r))&&a&&I.buildSelect(e,r,"",t,i.hasClass(s.filter_onlyAvail))}}).regex,E.getFilters=function(e,t,r,i){var a,l,s,n,o=[],c=e?A(e)[0].config:"",d=c?c.widgetOptions:"";if(!0!==t&&d&&!d.filter_columnFilters||A.isArray(r)&&I.equalFilters(c,r,c.lastSearch))return A(e).data("lastSearch")||[];if(c&&(c.$filters&&(l=c.$filters.find("."+b.filter)),d.filter_$externalFilters&&(l=l&&l.length?l.add(d.filter_$externalFilters):d.filter_$externalFilters),l&&l.length))for(o=r||[],a=0;a<c.columns+1;a++)n=a===c.columns?d.filter_anyColumnSelector+","+d.filter_multipleColumnSelector:'[data-column="'+a+'"]',(s=l.filter(n)).length&&(s=I.getLatestSearch(s),A.isArray(r)?(i&&1<s.length&&(s=s.slice(1)),a===c.columns&&(s=(n=s.filter(d.filter_anyColumnSelector)).length?n:s),s.val(r[a]).trigger("change"+c.namespace)):(o[a]=s.val()||"",a===c.columns?s.slice(1).filter('[data-column*="'+s.attr("data-column")+'"]').val(o[a]):s.slice(1).val(o[a])),a===c.columns&&s.length&&(d.filter_$anyMatch=s));return o},E.setFilters=function(e,t,r,i){var a=e?A(e)[0].config:"",l=E.getFilters(e,!0,t,i);return void 0===r&&(r=!0),a&&r&&(a.lastCombinedFilter=null,a.lastSearch=[],I.searching(a.table,t,i),a.$table.triggerHandler("filterFomatterUpdate")),0!==l.length}}(e),function(z,$){"use strict";var F=z.tablesorter||{};function R(e,t){var r=isNaN(t.stickyHeaders_offset)?z(t.stickyHeaders_offset):[];return r.length?r.height()||0:parseInt(t.stickyHeaders_offset,10)||0}z.extend(F.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),F.addHeaderResizeEvent=function(e,t,r){if((e=z(e)[0]).config){var i=z.extend({},{timer:250},r),o=e.config,c=o.widgetOptions,a=function(e){var t,r,i,a,l,s,n=o.$headers.length;for(c.resize_flag=!0,r=[],t=0;t<n;t++)a=(i=o.$headers.eq(t)).data("savedSizes")||[0,0],l=i[0].offsetWidth,s=i[0].offsetHeight,l===a[0]&&s===a[1]||(i.data("savedSizes",[l,s]),r.push(i[0]));r.length&&!1!==e&&o.$table.triggerHandler("resize",[r]),c.resize_flag=!1};if(clearInterval(c.resize_timer),t)return c.resize_flag=!1;a(!1),c.resize_timer=setInterval(function(){c.resize_flag||a()},i.timer)}},F.addWidget({id:"stickyHeaders",priority:54,options:{stickyHeaders:"",stickyHeaders_appendTo:null,stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(e,r,p){if(!(r.$table.hasClass("hasStickyHeaders")||0<=z.inArray("filter",r.widgets)&&!r.$table.hasClass("hasFilters"))){var t,i,a,l,g=r.$table,m=z(p.stickyHeaders_attachTo||p.stickyHeaders_appendTo),s=r.namespace+"stickyheaders ",b=z(p.stickyHeaders_yScroll||p.stickyHeaders_attachTo||$),n=z(p.stickyHeaders_xScroll||p.stickyHeaders_attachTo||$),o=g.children("thead:first").children("tr").not(".sticky-false").children(),y=g.children("tfoot"),c=R(0,p),_=g.parent().closest("."+F.css.table).hasClass("hasStickyHeaders")?g.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],v=_.length?_.height():0,d=p.$sticky=g.clone().addClass("containsStickyHeaders "+F.css.sticky+" "+p.stickyHeaders+" "+r.namespace.slice(1)+"_extra_table").wrap('<div class="'+F.css.stickyWrap+'">'),w=d.parent().addClass(F.css.stickyHide).css({position:m.length?"absolute":"fixed",padding:parseInt(d.parent().parent().css("padding-left"),10),top:c+v,left:0,visibility:"hidden",zIndex:p.stickyHeaders_zIndex||2}),f=d.children("thead:first"),x="",h=function(e,t){var r,i,a,l,s,n=e.filter(":visible"),o=n.length;for(r=0;r<o;r++)l=t.filter(":visible").eq(r),"border-box"===(s=n.eq(r)).css("box-sizing")?i=s.outerWidth():"collapse"===l.css("border-collapse")?$.getComputedStyle?i=parseFloat($.getComputedStyle(s[0],null).width):(a=parseFloat(s.css("border-width")),i=s.outerWidth()-parseFloat(s.css("padding-left"))-parseFloat(s.css("padding-right"))-a):i=s.width(),l.css({width:i,"min-width":i,"max-width":i})},S=function(e){return!1===e&&_.length?g.position().left:m.length?parseInt(m.css("padding-left"),10)||0:g.offset().left-parseInt(g.css("margin-left"),10)-z($).scrollLeft()},C=function(){w.css({left:S(),width:g.outerWidth()}),h(g,d),h(o,l)},u=function(e){if(g.is(":visible")){v=_.length?_.offset().top-b.scrollTop()+_.height():0;var t,r=g.offset(),i=R(0,p),a=z.isWindow(b[0]),l=a?b.scrollTop():_.length?parseInt(_[0].style.top,10):b.offset().top,s=m.length?l:b.scrollTop(),n=p.stickyHeaders_includeCaption?0:g.children("caption").height()||0,o=s+i+v-n,c=g.height()-(w.height()+(y.height()||0))-n,d=o>r.top&&o<r.top+c?"visible":"hidden",f="visible"===d?F.css.stickyVis:F.css.stickyHide,h=!w.hasClass(f),u={visibility:d};m.length&&(h=!0,u.top=a?o-m.offset().top:m.scrollTop()),(t=S(a))!==parseInt(w.css("left"),10)&&(h=!0,u.left=t),u.top=(u.top||0)+(!a&&_.length?_.height():i+v),h&&w.removeClass(F.css.stickyVis+" "+F.css.stickyHide).addClass(f).css(u),(d!==x||e)&&(C(),x=d)}};if(m.length&&!m.css("position")&&m.css("position","relative"),d.attr("id")&&(d[0].id+=p.stickyHeaders_cloneId),d.find("> thead:gt(0), tr.sticky-false").hide(),d.find("> tbody, > tfoot").remove(),d.find("caption").toggle(p.stickyHeaders_includeCaption),l=f.children().children(),d.css({height:0,width:0,margin:0}),l.find("."+F.css.resizer).remove(),g.addClass("hasStickyHeaders").bind("pagerComplete"+s,function(){C()}),F.bindEvents(e,f.children().children("."+F.css.header)),p.stickyHeaders_appendTo?z(p.stickyHeaders_appendTo).append(w):g.after(w),r.onRenderHeader)for(i=(a=f.children("tr").children()).length,t=0;t<i;t++)r.onRenderHeader.apply(a.eq(t),[t,r,d]);n.add(b).unbind("scroll resize ".split(" ").join(s).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(s),function(e){u("resize"===e.type)}),r.$table.unbind("stickyHeadersUpdate"+s).bind("stickyHeadersUpdate"+s,function(){u(!0)}),p.stickyHeaders_addResizeEvent&&F.addHeaderResizeEvent(e),g.hasClass("hasFilters")&&p.filter_columnFilters&&(g.bind("filterEnd"+s,function(){var e=z(document.activeElement).closest("td"),t=e.parent().children().index(e);w.hasClass(F.css.stickyVis)&&p.stickyHeaders_filteredToTop&&($.scrollTo(0,g.position().top),0<=t&&r.$filters&&r.$filters.eq(t).find("a, select, input").filter(":visible").focus())}),F.filter.bindSearch(g,l.find("."+F.css.filter)),p.filter_hideFilters&&F.filter.hideFilters(r,d)),p.stickyHeaders_addResizeEvent&&g.bind("resize"+r.namespace+"stickyheaders",function(){C()}),u(!0),g.triggerHandler("stickyHeadersInit")}},remove:function(e,t,r){var i=t.namespace+"stickyheaders ";t.$table.removeClass("hasStickyHeaders").unbind("pagerComplete resize filterEnd stickyHeadersUpdate ".split(" ").join(i).replace(/\s+/g," ")).next("."+F.css.stickyWrap).remove(),r.$sticky&&r.$sticky.length&&r.$sticky.remove(),z($).add(r.stickyHeaders_xScroll).add(r.stickyHeaders_yScroll).add(r.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(i).replace(/\s+/g," ")),F.addHeaderResizeEvent(e,!0)}})}(e,window),function(d,t){"use strict";var f=d.tablesorter||{};d.extend(f.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),d(function(){var e="<style>body."+f.css.resizableNoSelect+" { -ms-user-select: none; -moz-user-select: -moz-none;-khtml-user-select: none; -webkit-user-select: none; user-select: none; }."+f.css.resizableContainer+" { position: relative; height: 1px; }."+f.css.resizableHandle+" { position: absolute; display: inline-block; width: 8px;top: 1px; cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }</style>";d("head").append(e)}),f.resizable={init:function(e,t){if(!e.$table.hasClass("hasResizable")){e.$table.addClass("hasResizable");var r,i,a,l,s=e.$table,n=s.parent(),o=parseInt(s.css("margin-top"),10),c=t.resizable_vars={useStorage:f.storage&&!1!==t.resizable,$wrap:n,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===n.css("overflow")||"scroll"===n.css("overflow")||"auto"===n.css("overflow-x")||"scroll"===n.css("overflow-x"),storedSizes:[]};for(f.resizableReset(e.table,!0),c.tableWidth=s.width(),c.fullWidth=Math.abs(n.width()-c.tableWidth)<20,c.useStorage&&c.overflow&&(f.storage(e.table,"tablesorter-table-original-css-width",c.tableWidth),l=f.storage(e.table,"tablesorter-table-resized-width")||"auto",f.resizable.setWidth(s,l,!0)),t.resizable_vars.storedSizes=a=(c.useStorage?f.storage(e.table,f.css.resizableStorage):[])||[],f.resizable.setWidths(e,t,a),f.resizable.updateStoredSizes(e,t),t.$resizable_container=d('<div class="'+f.css.resizableContainer+'">').css({top:o}).insertBefore(s),i=0;i<e.columns;i++)r=e.$headerIndexed[i],l=f.getColumnData(e.table,e.headers,i),"false"===f.getData(r,l,"resizable")||d('<div class="'+f.css.resizableHandle+'">').appendTo(t.$resizable_container).attr({"data-column":i,unselectable:"on"}).data("header",r).bind("selectstart",!1);f.resizable.bindings(e,t)}},updateStoredSizes:function(e,t){var r,i,a=e.columns,l=t.resizable_vars;for(l.storedSizes=[],r=0;r<a;r++)i=e.$headerIndexed[r],l.storedSizes[r]=i.is(":visible")?i.width():0},setWidth:function(e,t,r){e.css({width:t,"min-width":r?t:"","max-width":r?t:""})},setWidths:function(e,t,r){var i,a,l=t.resizable_vars,s=d(e.namespace+"_extra_headers"),n=e.$table.children("colgroup").children("col");if((r=r||l.storedSizes||[]).length){for(i=0;i<e.columns;i++)f.resizable.setWidth(e.$headerIndexed[i],r[i],l.overflow),s.length&&(a=s.eq(i).add(n.eq(i)),f.resizable.setWidth(a,r[i],l.overflow));(a=d(e.namespace+"_extra_table")).length&&!f.hasWidget(e.table,"scroller")&&f.resizable.setWidth(a,e.$table.outerWidth(),l.overflow)}},setHandlePosition:function(a,l){var s,n=a.$table.height(),e=l.$resizable_container.children(),o=Math.floor(e.width()/2);f.hasWidget(a.table,"scroller")&&(n=0,a.$table.closest("."+f.css.scrollerWrap).children().each(function(){var e=d(this);n+=e.filter('[style*="height"]').length?e.height():e.children("table").height()})),!l.resizable_includeFooter&&a.$table.children("tfoot").length&&(n-=a.$table.children("tfoot").height()),s=3.3<=parseFloat(d.fn.jquery)?0:a.$table.position().left,e.each(function(){var e=d(this),t=parseInt(e.attr("data-column"),10),r=a.columns-1,i=e.data("header");i&&(!i.is(":visible")||!l.resizable_addLastColumn&&f.resizable.checkVisibleColumns(a,t)?e.hide():(t<r||t===r&&l.resizable_addLastColumn)&&e.css({display:"inline-block",height:n,left:i.position().left-s+i.outerWidth()-o}))})},checkVisibleColumns:function(e,t){var r,i=0;for(r=t+1;r<e.columns;r++)i+=e.$headerIndexed[r].is(":visible")?1:0;return 0===i},toggleTextSelection:function(e,t,r){var i=e.namespace+"tsresize";t.resizable_vars.disabled=r,d("body").toggleClass(f.css.resizableNoSelect,r),r?d("body").attr("unselectable","on").bind("selectstart"+i,!1):d("body").removeAttr("unselectable").unbind("selectstart"+i)},bindings:function(l,s){var e=l.namespace+"tsresize";s.$resizable_container.children().bind("mousedown",function(e){var t,r=s.resizable_vars,i=d(l.namespace+"_extra_headers"),a=d(e.target).data("header");t=parseInt(a.attr("data-column"),10),r.$target=a=a.add(i.filter('[data-column="'+t+'"]')),r.target=t,r.$next=e.shiftKey||s.resizable_targetLast?a.parent().children().not(".resizable-false").filter(":last"):a.nextAll(":not(.resizable-false)").eq(0),t=parseInt(r.$next.attr("data-column"),10),r.$next=r.$next.add(i.filter('[data-column="'+t+'"]')),r.next=t,r.mouseXPosition=e.pageX,f.resizable.updateStoredSizes(l,s),f.resizable.toggleTextSelection(l,s,!0)}),d(document).bind("mousemove"+e,function(e){var t=s.resizable_vars;t.disabled&&0!==t.mouseXPosition&&t.$target&&(s.resizable_throttle?(clearTimeout(t.timer),t.timer=setTimeout(function(){f.resizable.mouseMove(l,s,e)},isNaN(s.resizable_throttle)?5:s.resizable_throttle)):f.resizable.mouseMove(l,s,e))}).bind("mouseup"+e,function(){s.resizable_vars.disabled&&(f.resizable.toggleTextSelection(l,s,!1),f.resizable.stopResize(l,s),f.resizable.setHandlePosition(l,s))}),d(t).bind("resize"+e+" resizeEnd"+e,function(){f.resizable.setHandlePosition(l,s)}),l.$table.bind("columnUpdate pagerComplete resizableUpdate ".split(" ").join(e+" "),function(){f.resizable.setHandlePosition(l,s)}).bind("resizableReset"+e,function(){f.resizableReset(l.table)}).find("thead:first").add(d(l.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+e,function(){var e=0===s.resizable_vars.storedSizes.length;return f.resizableReset(l.table),f.resizable.setHandlePosition(l,s),s.resizable_vars.storedSizes=[],e})},mouseMove:function(e,t,r){if(0!==t.resizable_vars.mouseXPosition&&t.resizable_vars.$target){var i,a=0,l=t.resizable_vars,s=l.$next,n=l.storedSizes[l.target],o=r.pageX-l.mouseXPosition;if(l.overflow){if(0<n+o){for(l.storedSizes[l.target]+=o,f.resizable.setWidth(l.$target,l.storedSizes[l.target],!0),i=0;i<e.columns;i++)a+=l.storedSizes[i];f.resizable.setWidth(e.$table.add(d(e.namespace+"_extra_table")),a)}s.length||(l.$wrap[0].scrollLeft=e.$table.width())}else l.fullWidth?(l.storedSizes[l.target]+=o,l.storedSizes[l.next]-=o):l.storedSizes[l.target]+=o,f.resizable.setWidths(e,t);l.mouseXPosition=r.pageX,e.$table.triggerHandler("stickyHeadersUpdate")}},stopResize:function(e,t){var r=t.resizable_vars;f.resizable.updateStoredSizes(e,t),r.useStorage&&(f.storage(e.table,f.css.resizableStorage,r.storedSizes),f.storage(e.table,"tablesorter-table-resized-width",e.$table.width())),r.mouseXPosition=0,r.$target=r.$next=null,e.$table.triggerHandler("stickyHeadersUpdate"),e.$table.triggerHandler("resizableComplete")}},f.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_includeFooter:!0,resizable_widths:[],resizable_throttle:!1,resizable_targetLast:!1},init:function(e,t,r,i){f.resizable.init(r,i)},format:function(e,t,r){f.resizable.setHandlePosition(t,r)},remove:function(e,t,r,i){if(r.$resizable_container){var a=t.namespace+"tsresize";t.$table.add(d(t.namespace+"_extra_table")).removeClass("hasResizable").children("thead").unbind("contextmenu"+a),r.$resizable_container.remove(),f.resizable.toggleTextSelection(t,r,!1),f.resizableReset(e,i),d(document).unbind("mousemove"+a+" mouseup"+a)}}}),f.resizableReset=function(l,s){d(l).each(function(){var e,t,r=this.config,i=r&&r.widgetOptions,a=i.resizable_vars;if(l&&r&&r.$headerIndexed.length){for(a.overflow&&a.tableWidth&&(f.resizable.setWidth(r.$table,a.tableWidth,!0),a.useStorage&&f.storage(l,"tablesorter-table-resized-width",a.tableWidth)),e=0;e<r.columns;e++)t=r.$headerIndexed[e],i.resizable_widths&&i.resizable_widths[e]?f.resizable.setWidth(t,i.resizable_widths[e],a.overflow):t.hasClass("resizable-false")||f.resizable.setWidth(t,"",a.overflow);r.$table.triggerHandler("stickyHeadersUpdate"),f.storage&&!s&&f.storage(this,f.css.resizableStorage,[])}})}}(e,window),function(r){"use strict";var c=r.tablesorter||{};function d(e){var t=c.storage(e.table,"tablesorter-savesort");return t&&t.hasOwnProperty("sortList")&&r.isArray(t.sortList)?t.sortList:[]}function f(e,t){return(t||d(e)).join(",")!==e.sortList.join(",")}c.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(e,t,r,i){t.format(e,r,i,!0)},format:function(t,e,r,i){var a,l=e.$table,s=!1!==r.saveSort,n={sortList:e.sortList},o=c.debug(e,"saveSort");o&&(a=new Date),l.hasClass("hasSaveSort")?s&&t.hasInitialized&&c.storage&&f(e)&&(c.storage(t,"tablesorter-savesort",n),o&&console.log("saveSort >> Saving last sort: "+e.sortList+c.benchmark(a))):(l.addClass("hasSaveSort"),n="",c.storage&&(n=d(e),o&&console.log('saveSort >> Last sort loaded: "'+n+'"'+c.benchmark(a)),l.bind("saveSortReset",function(e){e.stopPropagation(),c.storage(t,"tablesorter-savesort","")})),i&&n&&0<n.length?e.sortList=n:t.hasInitialized&&n&&0<n.length&&f(e,n)&&c.sortOn(e,n))},remove:function(e,t){t.$table.removeClass("hasSaveSort"),c.storage&&c.storage(e,"tablesorter-savesort","")}})}(e),e.tablesorter});return jQuery;}));
js/wpadmin.js CHANGED
@@ -19,7 +19,7 @@ wp_optimize_send_command_admin_ajax = function (action, data, callback, json_par
19
  data: data
20
  };
21
 
22
- jQuery.post(ajaxurl, ajax_data, function (response) {
23
 
24
  if (json_parse) {
25
  try {
@@ -52,6 +52,11 @@ var WP_Optimize = function (send_command) {
52
  var $ = jQuery;
53
  var debug_level = 0;
54
  var queue = new Updraft_Queue();
 
 
 
 
 
55
 
56
  /**
57
  * Either display normally, or grey-out, the scheduling options, depending on whether any schedule has been selected.
@@ -92,6 +97,9 @@ var WP_Optimize = function (send_command) {
92
  cssInfoBlock: "tablesorter-no-sort",
93
  // This option is to specify with colums will be disabled for sorting
94
  headers: {
 
 
 
95
  // For Column Action
96
  7: {sorter: false }
97
  },
@@ -187,22 +195,25 @@ var WP_Optimize = function (send_command) {
187
  $('#wp-optimize-disable-enable-comments-disable').click(function () {
188
  enable_or_disable_feature('comments', false);
189
  });
190
-
191
- $('#wp-optimize-nav-tab-wrapper .nav-tab').click(function (e) {
192
-
193
- var clicked_tab_id = $(this).attr('id');
 
 
 
194
  if (!clicked_tab_id) { return; }
195
- if ('wp-optimize-nav-tab-' != clicked_tab_id.substring(0, 20)) { return; }
196
-
197
- var clicked_tab_id = clicked_tab_id.substring(20);
198
-
199
  e.preventDefault();
200
-
201
- $('#wp-optimize-nav-tab-wrapper .nav-tab:not(#wp-optimize-nav-tab-' + clicked_tab_id + ')').removeClass('nav-tab-active');
202
  $(this).addClass('nav-tab-active');
203
-
204
- $('#wp-optimize-wrap .wp-optimize-nav-tab-contents:not(#wp-optimize-nav-tab-contents-' + clicked_tab_id + ')').hide();
205
- $('#wp-optimize-nav-tab-contents-' + clicked_tab_id).show();
206
 
207
  // tablesorter fix.
208
  // At any time, there is a display none as 2 of the 3 tabs will be hidden.
@@ -213,6 +224,7 @@ var WP_Optimize = function (send_command) {
213
  $("#wpoptimize_table_list").trigger('applyWidgets');
214
  }
215
  });
 
216
 
217
  /**
218
  * Gathers the settings from the settings tab and return in selected format.
@@ -367,10 +379,24 @@ var WP_Optimize = function (send_command) {
367
  */
368
  function do_optimization(id) {
369
  var $optimization_row = $('#wp-optimize-nav-tab-contents-optimize .wp-optimize-settings-' + id);
 
370
  if (!$optimization_row) {
371
  console.log("do_optimization: row corresponding to this optimization (" + id + ") not found");
372
  }
373
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
  // don't run optimization if optimization active.
375
  if (true == $('.optimization_button_' + id).prop('disabled')) return;
376
 
@@ -408,6 +434,18 @@ var WP_Optimize = function (send_command) {
408
  }
409
  }
410
  });
 
 
 
 
 
 
 
 
 
 
 
 
411
  } else {
412
  queue.enqueue(id);
413
  }
@@ -609,6 +647,20 @@ var WP_Optimize = function (send_command) {
609
  return false;
610
  });
611
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
612
  // if "all items" checked/unchecked then check/uncheck items in the list.
613
  all_items_checkbox.on('change', function () {
614
  if (all_items_checkbox.is(':checked')) {
@@ -625,6 +677,7 @@ var WP_Optimize = function (send_command) {
625
  });
626
 
627
  update_wpo_all_items_checkbox_state(all_items_checkbox, items_list);
 
628
  }
629
 
630
  /**
@@ -1017,7 +1070,7 @@ var WP_Optimize = function (send_command) {
1017
  * @return void
1018
  */
1019
  var optimization_get_info = function(optimization_info_container, optimization_id, params) {
1020
- send_command('get_optimization_info', {optimization_id: optimization_id, data: params}, function(resp) {
1021
  var meta = (resp && resp.result && resp.result.meta) ? resp.result.meta : {},
1022
  message = (resp && resp.result && resp.result.output) ? resp.result.output.join('<br>') : '...';
1023
 
19
  data: data
20
  };
21
 
22
+ return jQuery.post(ajaxurl, ajax_data, function (response) {
23
 
24
  if (json_parse) {
25
  try {
52
  var $ = jQuery;
53
  var debug_level = 0;
54
  var queue = new Updraft_Queue();
55
+
56
+ /**
57
+ * Enable select all checkbox for optimizations list.
58
+ */
59
+ define_select_all_checkbox($('#select_all_optimizations'), $('#optimizations_list .optimization_checkbox'));
60
 
61
  /**
62
  * Either display normally, or grey-out, the scheduling options, depending on whether any schedule has been selected.
97
  cssInfoBlock: "tablesorter-no-sort",
98
  // This option is to specify with colums will be disabled for sorting
99
  headers: {
100
+ 2: {sorter: 'digit'},
101
+ 3: {sorter: 'digit'},
102
+ 4: {sorter: 'digit'},
103
  // For Column Action
104
  7: {sorter: false }
105
  },
195
  $('#wp-optimize-disable-enable-comments-disable').click(function () {
196
  enable_or_disable_feature('comments', false);
197
  });
198
+
199
+ $('#wp-optimize-nav-tab-wrapper .nav-tab, #wp-optimize-images-nav-tab-wrapper .nav-tab').click(function (e) {
200
+
201
+ var clicked_tab_id = $(this).attr('id'),
202
+ container_id = $(this).closest('.nav-tab-wrapper').attr('id'),
203
+ container_prefix_id = container_id.substring(0, container_id.length - 7);
204
+
205
  if (!clicked_tab_id) { return; }
206
+ if (container_prefix_id != clicked_tab_id.substring(0, container_prefix_id.length)) { return; }
207
+
208
+ var clicked_tab_id = clicked_tab_id.substring(container_prefix_id.length);
209
+
210
  e.preventDefault();
211
+
212
+ $('#' + container_id + ' .nav-tab:not(#wp-optimize-nav-tab-' + clicked_tab_id + ')').removeClass('nav-tab-active');
213
  $(this).addClass('nav-tab-active');
214
+
215
+ $('#wp-optimize-wrap .' + container_prefix_id + 'contents:not(#' + container_prefix_id + 'contents-' + clicked_tab_id + ')').hide();
216
+ $('#' + container_prefix_id + 'contents-' + clicked_tab_id).show();
217
 
218
  // tablesorter fix.
219
  // At any time, there is a display none as 2 of the 3 tabs will be hidden.
224
  $("#wpoptimize_table_list").trigger('applyWidgets');
225
  }
226
  });
227
+
228
 
229
  /**
230
  * Gathers the settings from the settings tab and return in selected format.
379
  */
380
  function do_optimization(id) {
381
  var $optimization_row = $('#wp-optimize-nav-tab-contents-optimize .wp-optimize-settings-' + id);
382
+
383
  if (!$optimization_row) {
384
  console.log("do_optimization: row corresponding to this optimization (" + id + ") not found");
385
  }
386
 
387
+ // check if there any additional inputs checkboxes.
388
+ var additional_data = {},
389
+ additional_data_length = 0;
390
+
391
+ $('input[type="checkbox"]', $('#optimization_info_' + id)).each(function() {
392
+ var checkbox = $(this);
393
+
394
+ if (checkbox.is(':checked')) {
395
+ additional_data[checkbox.attr('name')] = checkbox.val();
396
+ additional_data_length++;
397
+ }
398
+ });
399
+
400
  // don't run optimization if optimization active.
401
  if (true == $('.optimization_button_' + id).prop('disabled')) return;
402
 
434
  }
435
  }
436
  });
437
+ } else if (additional_data_length > 0) {
438
+ // check if additional data passed for optimization.
439
+ data = {
440
+ optimization_id: id,
441
+ };
442
+
443
+ for (var i in additional_data) {
444
+ if (!additional_data.hasOwnProperty(i)) continue;
445
+ data[i] = additional_data[i];
446
+ }
447
+
448
+ queue.enqueue(data);
449
  } else {
450
  queue.enqueue(id);
451
  }
647
  return false;
648
  });
649
 
650
+ // if "all items" checked/unchecked then check/uncheck items in the list.
651
+ define_select_all_checkbox(all_items_checkbox, items_list);
652
+ }
653
+
654
+ /**
655
+ * Defines "select all" check box, where all_items_checkbox is a select all check box jQuery object
656
+ * and items_list is a list of checkboxes assigned with all_items_checkbox.
657
+ *
658
+ * @param {Object} all_items_checkbox
659
+ * @param {Object} items_list
660
+ *
661
+ * @return void
662
+ */
663
+ function define_select_all_checkbox(all_items_checkbox, items_list) {
664
  // if "all items" checked/unchecked then check/uncheck items in the list.
665
  all_items_checkbox.on('change', function () {
666
  if (all_items_checkbox.is(':checked')) {
677
  });
678
 
679
  update_wpo_all_items_checkbox_state(all_items_checkbox, items_list);
680
+
681
  }
682
 
683
  /**
1070
  * @return void
1071
  */
1072
  var optimization_get_info = function(optimization_info_container, optimization_id, params) {
1073
+ return send_command('get_optimization_info', {optimization_id: optimization_id, data: params}, function(resp) {
1074
  var meta = (resp && resp.result && resp.result.meta) ? resp.result.meta : {},
1075
  message = (resp && resp.result && resp.result.output) ? resp.result.output.join('<br>') : '...';
1076
 
js/wpadmin.min.js CHANGED
@@ -1 +1 @@
1
- wp_optimize_send_command_admin_ajax=function(t,i,e,o){o="undefined"==typeof o||o;var n={action:"wp_optimize_ajax",subaction:t,nonce:wp_optimize_ajax_nonce,data:i};jQuery.post(ajaxurl,n,function(t){if(o){try{var i=JSON.parse(t)}catch(n){return console.log(n),console.log(t),void alert(wpoptimize.error_unexpected_response)}"undefined"!=typeof e&&e(i)}else"undefined"!=typeof e&&e(t)})},jQuery(document).ready(function(t){WP_Optimize=WP_Optimize(wp_optimize_send_command_admin_ajax)});var WP_Optimize=function(t){function i(){if(x("#enable-schedule").length){var t=x("#enable-schedule").is(":checked");t?x("#wp-optimize-auto-options").css("opacity","1"):x("#wp-optimize-auto-options").css("opacity","0.5")}}function e(t,i,e){i="undefined"==typeof i?"#wp-optimize-wrap":i,e="undefined"==typeof e?15:e,x(t).hide().prependTo(i).slideDown("slow").delay(1e3*e).slideUp("slow",function(){x(this).remove()})}function o(i,o){var n={type:i,enable:o?1:0};x("#"+i+"_spinner").show(),t("enable_or_disable_feature",n,function(t){if(x("#"+i+"_spinner").hide(),t&&t.hasOwnProperty("output"))for(var o=0,n=t.output.length;o<n;o++){var a='<div class="updated">'+t.output[o]+"</div>";e(a,"#actions-results-area")}})}function n(t){var i="",t="undefined"==typeof t?"string":t;return"object"==t?i=x("#wp-optimize-nav-tab-contents-settings form input[name!='action'], #wp-optimize-nav-tab-contents-settings form textarea, #wp-optimize-nav-tab-contents-settings form select, #wp-optimize-nav-tab-contents-optimize input[type='checkbox'], .wp-optimize-nav-tab-contents input[name^='enable-auto-backup-']").serializeJSON({useIntKeysAsArrayIndex:!0}):(i=x("#wp-optimize-nav-tab-contents-settings form input[name!='action'], #wp-optimize-nav-tab-contents-settings form textarea, #wp-optimize-nav-tab-contents-settings form select, #wp-optimize-nav-tab-contents-optimize input[type='checkbox'], .wp-optimize-nav-tab-contents input[name^='enable-auto-backup-']").serialize(),x.each(x('#wp-optimize-nav-tab-contents-settings form input[type=checkbox], .wp-optimize-nav-tab-contents input[name^="enable-auto-backup-"]').filter(function(t){return 0==x(this).prop("checked")}),function(t,e){var o="0";i+="&"+x(e).attr("name")+"="+o})),i}function a(){t("optimizations_done",{},function(){})}function s(){if(!O.get_lock())return void(j>0&&console.log("WP-Optimize: process_queue(): queue is currently locked - exiting"));j>0&&console.log("WP-Optimize: process_queue(): got queue lock");var i=O.peek();return"object"==typeof i?(data=i,i=i.optimization_id):data={},"undefined"==typeof i?(j>0&&console.log("WP-Optimize: process_queue(): queue is apparently empty - exiting"),O.unlock(),void a()):(j>0&&console.log("WP-Optimize: process_queue(): processing item: "+i),O.dequeue(),x(document).trigger(["do_optimization_",i,"_start"].join("")),void t("do_optimization",{optimization_id:i,data:data},function(t){if(x("#optimization_spinner_"+i).hide(),x("#optimization_checkbox_"+i).show(),x(".optimization_button_"+i).prop("disabled",!1),x(document).trigger(["do_optimization_",i,"_done"].join(""),t),t){for(var e="",o=0,n=t.errors.length;o<n;o++)e+='<span class="error">'+t.errors[o]+"</span><br>";for(var o=0,n=t.messages.length;o<n;o++)e+=t.errors[o]+"<br>";for(var o=0,n=t.result.output.length;o<n;o++)e+=t.result.output[o]+"<br>";if(x("#optimization_info_"+i).html(e),t.hasOwnProperty("status_box_contents")&&x("#wp_optimize_status_box").css("opacity","1").find(".inside").html(t.status_box_contents),t.hasOwnProperty("table_list")&&x("#wpoptimize_table_list tbody").html(x(t.table_list).find("tbody").html()),t.hasOwnProperty("total_size")&&x("#optimize_current_db_size").html(t.total_size),"optimizetables"==i&&data.optimization_table&&(O.is_empty()?(x("#optimization_spinner_"+i).hide(),x("#optimization_checkbox_"+i).show(),x(".optimization_button_"+i).prop("disabled",!1),x("#optimization_info_"+i).html(wpoptimize.optimization_complete)):(x("#optimization_checkbox_"+i).hide(),x("#optimization_spinner_"+i).show(),x(".optimization_button_"+i).prop("disabled",!0))),t.result.meta&&t.result.meta.hasOwnProperty("awaiting_mod")){var a=t.result.meta.awaiting_mod;a>0?x("#adminmenu .awaiting-mod .pending-count").remove(a):x("#adminmenu .awaiting-mod").remove()}}setTimeout(function(){O.unlock(),s()},10)}))}function p(t){var i=x("#wp-optimize-nav-tab-contents-optimize .wp-optimize-settings-"+t);if(i||console.log("do_optimization: row corresponding to this optimization ("+t+") not found"),1!=x(".optimization_button_"+t).prop("disabled")){if(x("#optimization_checkbox_"+t).hide(),x("#optimization_spinner_"+t).show(),x(".optimization_button_"+t).prop("disabled",!0),x("#optimization_info_"+t).html("..."),"optimizetables"==t){var e=x("#wpoptimize_table_list #the-list tr");x(e).each(function(i){var e=x(this).find("td");if(table_type=e.eq(5).text(),table=e.eq(1).text(),optimizable=e.eq(5).data("optimizable"),""!=table&&("1"==optimizable||B)){var o={optimization_id:t,optimization_table:e.eq(1).text(),optimization_table_type:table_type,optimization_force:B};O.enqueue(o)}})}else O.enqueue(t);s()}}function r(i){x("#wpo_settings_sites_list").length?t("save_site_settings",{"wpo-sites":l()},function(){i&&i()}):i&&i()}function l(){var t=[];return x('#wpo_settings_sites_list input[type="checkbox"]').each(function(){var i=x(this);i.is(":checked")&&t.push(i.attr("value"))}),t}function _(){var t=!1;x("#enable-auto-backup").is(":checked")&&(t=!0),d(),1==t?c(f):f()}function c(t){"function"==typeof updraft_backupnow_inpage_go?updraft_backupnow_inpage_go(function(){x("#updraft-backupnow-inpage-modal").dialog("close"),t&&t()},"","autobackup",0,1,0,wpoptimize.automatic_backup_before_optimizations):t&&t()}function d(){var i=n("object");i.auto_backup=x("#enable-auto-backup").is(":checked"),t("save_auto_backup_option",i)}function u(t,i,e,o){t.on("click",function(){return i.hasClass("wpo_always_visible")||i.toggleClass("wpo_hidden"),!1}),e.on("change",function(){e.is(":checked")?o.prop("checked",!0):o.prop("checked",!1),m(e,o)}),o.on("change",function(){m(e,o)}),m(e,o)}function m(t,i){var e=0,o=0;if(i.each(function(){x(this).is(":checked")&&o++,e++}),t.next().is("label")&&t.next().data("label")){var n=t.next(),a=n.data("label");e==o?n.text(a):n.text(a.replace("all",[o," of ",e].join("")))}e==o?t.prop("checked",!0):t.prop("checked",!1)}function f(){$optimizations=x("#optimizations_list .optimization_checkbox:checked"),$optimizations.sort(function(t,i){return t=x(t).closest(".wp-optimize-settings").data("optimization_run_sort_order"),i=x(i).closest(".wp-optimize-settings").data("optimization_run_sort_order"),t>i?1:t<i?-1:0});var i={};$optimizations.each(function(t){var e=x(this).closest(".wp-optimize-settings").data("optimization_id");return e?(i[e]={active:1},void p(e)):void console.log("Optimization ID corresponding to pressed button not found")}),t("save_manual_run_optimization_options",i)}function g(t){x(".run-single-table-optimization").each(function(){var i=x(this);i.data("disabled")&&(t?i.prop("disabled",!1):i.prop("disabled",!0))})}function w(t){var i,e,o;if(t)for(i in t)t.hasOwnProperty(i)&&(e=["#wp-optimize-settings-",t[i].dom_id].join(""),o=t[i].info?t[i].info.join("<br>"):"",x(e+" .wp-optimize-settings-optimization-info").html(o))}function b(){var i=["",l().join("_")].join("");G.hasOwnProperty(i)?w(G[i]):t("get_optimizations_info",{"wpo-sites":l()},function(t){t&&(G[i]=t,w(t))})}function h(i){var e=x("#wpo_import_spinner"),o=x("#wpo_import_success_message"),n=x("#wpo_import_error_message");e.show(),t("import_settings",{settings:i},function(t){e.hide(),t&&t.errors&&t.errors.length?(n.text(t.errors.join("<br>")),n.slideDown()):t&&t.messages&&t.messages.length&&(o.text(t.messages.join("<br>")),o.slideDown(),setTimeout(function(){window.location.reload()},500)),x("#wpo_import_settings_btn").prop("disabled",!1)})}function z(t,i){var e=document.body.appendChild(document.createElement("a")),o=new Date,n=o.getFullYear(),a=o.getMonth()<10?["0",o.getMonth()].join(""):o.getMonth(),s=o.getDay()<10?["0",o.getDay()].join(""):o.getDay();i=i?i:["wpo-settings-",n,"-",a,"-",s,".json"].join(""),e.setAttribute("download",i),e.setAttribute("style","display:none;"),e.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(JSON.stringify(t))),e.click()}function v(){var t=x("#wpoptimize_table_list"),i=!0;x("tr",t).each(function(){var t=x(this);if(x("button",t).length>0)return i=!1,!1}),x("tr",t).each(function(){var t=x(this);i?x("td:last, th:last",t).hide():x("td:last, th:last",t).show()})}function y(){var t=!0;return x(".wpo_logger_addition_option, .wpo_logger_type").each(function(){k(x(this),!0)?x(this).removeClass("wpo_error_field"):(t=!1,x(this).addClass("wpo_error_field"))}),t?x("#wp-optimize-logger-settings .save_settings_reminder").slideUp():x("#wp-optimize-settings-save-results").show().addClass("wpo_alert_notice").text(wpoptimize.fill_all_settings_fields).delay(5e3).fadeOut(3e3,function(){x(this).removeClass("wpo_alert_notice")}),t}function k(t,i){var e=t.val(),o=t.data("validate");if(!o&&i)return""!=x.trim(e);if(o&&!i&&""==x.trim(e))return!0;var n=!0;switch(o){case"email":for(var a=/\S+@\S+\.\S+/,s=e.split(","),p="",r=0;r<s.length;r++)p=x.trim(s[r]),""!=p&&a.test(p)||(n=!1);break;case"url":var a=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i;n=a.test(e)}return n}var x=jQuery,j=0,O=new Updraft_Queue;i(),x("#enable-schedule").change(function(){i()});var P=x("#wpoptimize_table_list_filter"),q=x("#wpoptimize_table_list"),C=x("#wpoptimize_table_list tbody:last"),D=x("#wpoptimize_table_list_tables_not_found");x(function(){q.tablesorter({theme:"default",widgets:["zebra","rows","filter"],cssInfoBlock:"tablesorter-no-sort",headers:{7:{sorter:!1}},widgetOptions:{filter_external:P,filter_defaultFilter:{2:"~{query}"}}}),q.on("filterEnd",function(){var t=x.trim(P.val());""==t?C.show():C.hide(),0==x("#the-list tr:visible",q).length?D.show():D.hide()})}),x("#wp-optimize-disable-enable-trackbacks-enable").click(function(){o("trackbacks",!0)}),x("#wp-optimize-disable-enable-trackbacks-disable").click(function(){o("trackbacks",!1)}),x("#wp-optimize-disable-enable-comments-enable").click(function(){o("comments",!0)}),x("#wp-optimize-disable-enable-comments-disable").click(function(){o("comments",!1)}),x("#wp-optimize-nav-tab-wrapper .nav-tab").click(function(t){var i=x(this).attr("id");if(i&&"wp-optimize-nav-tab-"==i.substring(0,20)){var i=i.substring(20);t.preventDefault(),x("#wp-optimize-nav-tab-wrapper .nav-tab:not(#wp-optimize-nav-tab-"+i+")").removeClass("nav-tab-active"),x(this).addClass("nav-tab-active"),x("#wp-optimize-wrap .wp-optimize-nav-tab-contents:not(#wp-optimize-nav-tab-contents-"+i+")").hide(),x("#wp-optimize-nav-tab-contents-"+i).show(),"tables"==i&&x("#wpoptimize_table_list").trigger("applyWidgets")}}),x("#wp-optimize-nav-tab-contents-optimize").on("click","button.wp-optimize-settings-optimization-run-button",function(){var t=x(this).closest(".wp-optimize-settings").data("optimization_id");return t?void(1!=x(".optimization_button_"+t).prop("disabled")&&(x(".optimization_button_"+t).prop("disabled",!0),r(function(){x(".optimization_button_"+t).prop("disabled",!1),p(t)}))):void console.log("Optimization ID corresponding to pressed button not found")}),x("#wp-optimize-nav-tab-contents-optimize").on("click","#wp-optimize",function(t){var i=x(this);t.preventDefault(),i.prop("disabled",!0),r(function(){i.prop("disabled",!1),_()})});var S=x("#wpo_settings_sites_list"),T=S.find("ul").first(),W=x('input[type="checkbox"]',T),A=S.find("#wpo_all_sites"),F=x("#wpo_sitelist_show_moreoptions"),I=x("#wpo_sitelist_moreoptions"),U=x("#wpo_settings_sites_list_cron"),Q=U.find("ul").first(),$=x('input[type="checkbox"]',Q),J=U.find("#wpo_all_sites_cron"),M=x("#wpo_sitelist_show_moreoptions_cron"),N=x("#wpo_sitelist_moreoptions_cron");u(F,I,A,W);var E=0;x([A,W]).each(function(){x(this).on("change",function(){E++,setTimeout(function(){E--,0==E&&b()},1e3)})}),u(M,N,J,$),x("#wp_optimize_table_list_refresh").click(function(){x("#wpoptimize_table_list tbody").css("opacity","0.5"),t("get_table_list",!1,function(t){if(t.hasOwnProperty("table_list")){var i=!0,e=function(t){x("#wpoptimize_table_list tbody").css("opacity","1")};x("#wpoptimize_table_list").trigger("updateAll",[i,e])}t.hasOwnProperty("total_size")&&x("#optimize_current_db_size").html(t.total_size),g(Y.is(":checked"))})}),x("#settings_form").on("click","#wp-optimize-settings-save",function(i){if(!y())return!1;i.preventDefault(),x("#save_spinner").show();var o=n();t("save_settings",o,function(t){if(x("#save_spinner").hide(),x("#save_done").show().delay(5e3).fadeOut(),t&&t.hasOwnProperty("save_results")&&t.save_results&&t.save_results.hasOwnProperty("errors")){for(var i=0,o=t.save_results.errors.length;i<o;i++){var n='<div class="error">'+t.errors[i]+"</div>";e(n,"#wp-optimize-settings-save-results")}console.log(t.save_results.messages)}t&&t.hasOwnProperty("status_box_contents")&&x("#wp_optimize_status_box .inside").html(t.status_box_contents),t&&t.hasOwnProperty("optimizations_table")&&x("#optimizations_list").replaceWith(t.optimizations_table),t.save_results.refresh&&location.reload()})}),x("#wp_optimize_status_box").on("click","#wp_optimize_status_box_refresh",function(i){i.preventDefault(),x("#wp_optimize_status_box").css("opacity","0.5"),t("get_status_box_contents",null,function(t){x("#wp_optimize_status_box").css("opacity","1").find(".inside").html(t)})});var R=x("#innodb_force_optimize"),B=R.is(":checked"),K=R.closest("tr"),Y=x("#innodb_force_optimize_single");R.on("change",function(){x('button, input[type="checkbox"]',K).each(function(){B=R.is(":checked");var t=x(this);t.data("disabled")&&(B?t.prop("disabled",!1):t.prop("disabled",!0))})}),x("#wpoptimize_table_list").on("click",".run-single-table-optimization",function(){var i=x(this),e=i.next(),o=e.next(),n=i.data("table"),a=i.data("type"),s={optimization_id:"optimizetables",optimization_table:n,optimization_table_type:a};Y.is(":checked")&&(s.optimization_force=!0),e.removeClass("visibility-hidden"),t("do_optimization",{optimization_id:"optimizetables",data:s},function(){i.prop("disabled",!1),e.addClass("visibility-hidden"),o.show().removeClass("visibility-hidden").delay(3e3).fadeOut("slow")})}),Y.change(function(){g(Y.is(":checked"))}),g(Y.is(":checked"));var G={};setTimeout(function(){t("check_overdue_crons",null,function(t){t&&t.hasOwnProperty("m")&&x("#wpo_settings_warnings").append(t.m)})},11e3),x("#wpo_import_settings_btn").on("click",function(t){var i=x("#wpo_import_settings_file"),e=i.val(),o=i[0].files[0],n=new FileReader;return x("#wpo_import_settings_btn").prop("disabled",!0),/\.json$/.test(e)?(n.onload=function(){h(this.result)},n.readAsText(o),!1):(t.preventDefault(),x("#wpo_import_settings_btn").prop("disabled",!1),x("#wpo_import_error_message").text(wpoptimize.please_select_settings_file).slideDown(),!1)}),x("#wpo_import_settings_file").on("change",function(){x("#wpo_import_error_message").slideUp()}),x("#wpo_export_settings_btn").on("click",function(t){return z(n("object")),!1});var H=function(i,e,o){t("get_optimization_info",{optimization_id:e,data:o},function(t){var o=t&&t.result&&t.result.meta?t.result.meta:{},n=t&&t.result&&t.result.output?t.result.output.join("<br>"):"...";x(document).trigger(["optimization_get_info_",e].join(""),n),i.html(n),o.finished?x(document).trigger(["optimization_get_info_",e,"_done"].join(""),t):setTimeout(function(){H(i,e,o)},1)})};return x(document).ready(function(){x(".wp-optimize-optimization-info-ajax").each(function(){var t=x(this),i=t.parent(),e=t.data("id");x(document).trigger(["optimization_get_info_",e,"_start"].join("")),H(i,e,{support_ajax_get_info:!0})})}),x("#wpoptimize_table_list").on("click",".run-single-table-repair",function(){var i=x(this),e=i.next(),o=e.next(),n=i.data("table"),a={optimization_id:"repairtables",optimization_table:n};e.removeClass("visibility-hidden"),t("do_optimization",{optimization_id:"repairtables",data:a},function(t){if(t.result.meta.success){var a=i.closest("tr"),s=t.result.meta.tableinfo;i.prop("disabled",!1),e.addClass("visibility-hidden"),o.show().removeClass("visibility-hidden"),x("td:eq(2)",a).text(s.rows),x("td:eq(3)",a).text(s.data_size),x("td:eq(4)",a).text(s.index_size),x("td:eq(5)",a).text(s.type),s.is_optimizable?x("td:eq(6)",a).html(['<span color="',s.overhead>0?"#0000FF":"#004600",'">',s.overhead,"</span>"].join("")):x("td:eq(6)",a).html('<span color="#0000FF">-</span>'),setTimeout(function(){var t=i.closest("td"),e=i.closest(".wpo_button_wrap");e.fadeOut("fast",function(){e.closest(".wpo_button_wrap").remove(),s.is_optimizable&&x(".wpo_button_wrap",t).removeClass("wpo_hidden")}),v()},1e3)}else i.prop("disabled",!1),e.addClass("visibility-hidden"),alert(wpoptimize.table_was_not_repaired.replace("%s",n))})}),v(),setTimeout(function(){t("check_overdue_crons",null,function(t){t&&t.hasOwnProperty("m")&&x("#wpo_settings_warnings").append(t.m)})},11e3),{send_command:t,optimization_get_info:H,take_a_backup_with_updraftplus:c,save_auto_backup_options:d}};jQuery(document).ready(function(t){function i(i){var e=["#",i.data("additional")].join("");i.is(":checked")?t(e).show():t(e).hide()}function e(){var i=t("#wp-optimize-logger-settings .save_settings_reminder");i.is(":visible")||i.slideDown("normal")}function o(){t(".wpo_logger_type").each(function(){n(t(this))})}function n(i){var e,o,n=a();for(e in n)o=n[e],wpoptimize.loggers_classes_info[o].allow_multiple?t('option[value="'+o+'"]',i).show():t('option[value="'+o+'"]',i).hide()}function a(){var i=[];return t(".wpo_logging_row, .wpo_logger_type").each(function(){var e=t(this).is("select")?t(this).val():t(this).data("id");e&&i.push(e)}),i}function s(){var t,i=['<option value="">Select destination</option>'];for(t in wpoptimize.loggers_classes_info)wpoptimize.loggers_classes_info.hasOwnProperty(t)&&wpoptimize.loggers_classes_info[t].available&&i.push(['<option value="',t,'">',wpoptimize.loggers_classes_info[t].description,"</option>"].join(""));return['<div class="wpo_add_logger_form">','<select class="wpo_logger_type" name="wpo-logger-type[]">',i.join(""),"<select>",'<a href="#" class="wpo_delete_logger dashicons dashicons-no-alt"></a>','<div class="wpo_additional_logger_options"></div>',"</div>"].join("")}function p(i){if(!wpoptimize.loggers_classes_info[i].options)return"";var e,o=wpoptimize.loggers_classes_info[i].options,n=[],a="",s="";for(e in o)o.hasOwnProperty(e)&&(t.isArray(o[e])?(a=t.trim(o[e][0]),s=t.trim(o[e][1])):(a=t.trim(o[e]),s=""),n.push(['<input class="wpo_logger_addition_option" type="text" name="wpo-logger-options[',e,'][]" value="" ','placeholder="',a,'" ',""!==s?'data-validate="'+s+'"':"","/>"].join("")));return n.push('<input type="hidden" name="wpo-logger-options[active][]" value="1" />'),n.join("")}t(".wp-optimize-logging-settings").each(function(){var e=t(this);i(e),e.on("change",function(){i(e)})});var r=t("#wpo_add_logger_link");r.on("click",function(){t("#wp-optimize-logger-settings .save_settings_reminder").after(s()),n(t(".wpo_logger_type").first())}),t("#wp-optimize-nav-tab-contents-settings").on("change",".wpo_logger_type",function(){var i=t(this),o=i.val(),n=i.parent().find(".wpo_additional_logger_options");n.html(p(o)),i.val()&&e()}),t(".wpo_logging_actions_row .dashicons-edit").on("click",function(){var i=t(this),e=i.closest(".wpo_logging_row");return t(".wpo_additional_logger_options",e).removeClass("wpo_hidden"),t(".wpo_logging_options_row",e).text(""),t(".wpo_logging_status_row",e).text(""),i.hide(),!1}),t("#wp-optimize-logger-settings").on("change",".wpo_logger_addition_option",function(){e()}),t(".wpo_logger_active_checkbox").on("change",function(){var i=t(this),e=i.closest("label").find('input[type="hidden"]');e.val(i.is(":checked")?"1":"0")}),t("#wp-optimize-nav-tab-contents-settings").on("click",".wpo_delete_logger",function(){if(!confirm(wpoptimize.are_you_sure_you_want_to_remove_logging_destination))return!1;var i=t(this);return i.closest(".wpo_logging_row, .wpo_add_logger_form").remove(),o(),0==t("#wp-optimize-logging-options .wpo_logging_row").length&&t("#wp-optimize-logging-options").hide(),e(),!1})});
1
+ wp_optimize_send_command_admin_ajax=function(t,i,e,o){o="undefined"==typeof o||o;var n={action:"wp_optimize_ajax",subaction:t,nonce:wp_optimize_ajax_nonce,data:i};return jQuery.post(ajaxurl,n,function(t){if(o){try{var i=JSON.parse(t)}catch(n){return console.log(n),console.log(t),void alert(wpoptimize.error_unexpected_response)}"undefined"!=typeof e&&e(i)}else"undefined"!=typeof e&&e(t)})},jQuery(document).ready(function(t){WP_Optimize=WP_Optimize(wp_optimize_send_command_admin_ajax)});var WP_Optimize=function(t){function i(){if(j("#enable-schedule").length){var t=j("#enable-schedule").is(":checked");t?j("#wp-optimize-auto-options").css("opacity","1"):j("#wp-optimize-auto-options").css("opacity","0.5")}}function e(t,i,e){i="undefined"==typeof i?"#wp-optimize-wrap":i,e="undefined"==typeof e?15:e,j(t).hide().prependTo(i).slideDown("slow").delay(1e3*e).slideUp("slow",function(){j(this).remove()})}function o(i,o){var n={type:i,enable:o?1:0};j("#"+i+"_spinner").show(),t("enable_or_disable_feature",n,function(t){if(j("#"+i+"_spinner").hide(),t&&t.hasOwnProperty("output"))for(var o=0,n=t.output.length;o<n;o++){var a='<div class="updated">'+t.output[o]+"</div>";e(a,"#actions-results-area")}})}function n(t){var i="",t="undefined"==typeof t?"string":t;return"object"==t?i=j("#wp-optimize-nav-tab-contents-settings form input[name!='action'], #wp-optimize-nav-tab-contents-settings form textarea, #wp-optimize-nav-tab-contents-settings form select, #wp-optimize-nav-tab-contents-optimize input[type='checkbox'], .wp-optimize-nav-tab-contents input[name^='enable-auto-backup-']").serializeJSON({useIntKeysAsArrayIndex:!0}):(i=j("#wp-optimize-nav-tab-contents-settings form input[name!='action'], #wp-optimize-nav-tab-contents-settings form textarea, #wp-optimize-nav-tab-contents-settings form select, #wp-optimize-nav-tab-contents-optimize input[type='checkbox'], .wp-optimize-nav-tab-contents input[name^='enable-auto-backup-']").serialize(),j.each(j('#wp-optimize-nav-tab-contents-settings form input[type=checkbox], .wp-optimize-nav-tab-contents input[name^="enable-auto-backup-"]').filter(function(t){return 0==j(this).prop("checked")}),function(t,e){var o="0";i+="&"+j(e).attr("name")+"="+o})),i}function a(){t("optimizations_done",{},function(){})}function s(){if(!P.get_lock())return void(O>0&&console.log("WP-Optimize: process_queue(): queue is currently locked - exiting"));O>0&&console.log("WP-Optimize: process_queue(): got queue lock");var i=P.peek();return"object"==typeof i?(data=i,i=i.optimization_id):data={},"undefined"==typeof i?(O>0&&console.log("WP-Optimize: process_queue(): queue is apparently empty - exiting"),P.unlock(),void a()):(O>0&&console.log("WP-Optimize: process_queue(): processing item: "+i),P.dequeue(),j(document).trigger(["do_optimization_",i,"_start"].join("")),void t("do_optimization",{optimization_id:i,data:data},function(t){if(j("#optimization_spinner_"+i).hide(),j("#optimization_checkbox_"+i).show(),j(".optimization_button_"+i).prop("disabled",!1),j(document).trigger(["do_optimization_",i,"_done"].join(""),t),t){for(var e="",o=0,n=t.errors.length;o<n;o++)e+='<span class="error">'+t.errors[o]+"</span><br>";for(var o=0,n=t.messages.length;o<n;o++)e+=t.errors[o]+"<br>";for(var o=0,n=t.result.output.length;o<n;o++)e+=t.result.output[o]+"<br>";if(j("#optimization_info_"+i).html(e),t.hasOwnProperty("status_box_contents")&&j("#wp_optimize_status_box").css("opacity","1").find(".inside").html(t.status_box_contents),t.hasOwnProperty("table_list")&&j("#wpoptimize_table_list tbody").html(j(t.table_list).find("tbody").html()),t.hasOwnProperty("total_size")&&j("#optimize_current_db_size").html(t.total_size),"optimizetables"==i&&data.optimization_table&&(P.is_empty()?(j("#optimization_spinner_"+i).hide(),j("#optimization_checkbox_"+i).show(),j(".optimization_button_"+i).prop("disabled",!1),j("#optimization_info_"+i).html(wpoptimize.optimization_complete)):(j("#optimization_checkbox_"+i).hide(),j("#optimization_spinner_"+i).show(),j(".optimization_button_"+i).prop("disabled",!0))),t.result.meta&&t.result.meta.hasOwnProperty("awaiting_mod")){var a=t.result.meta.awaiting_mod;a>0?j("#adminmenu .awaiting-mod .pending-count").remove(a):j("#adminmenu .awaiting-mod").remove()}}setTimeout(function(){P.unlock(),s()},10)}))}function p(t){var i=j("#wp-optimize-nav-tab-contents-optimize .wp-optimize-settings-"+t);i||console.log("do_optimization: row corresponding to this optimization ("+t+") not found");var e={},o=0;if(j('input[type="checkbox"]',j("#optimization_info_"+t)).each(function(){var t=j(this);t.is(":checked")&&(e[t.attr("name")]=t.val(),o++)}),1!=j(".optimization_button_"+t).prop("disabled")){if(j("#optimization_checkbox_"+t).hide(),j("#optimization_spinner_"+t).show(),j(".optimization_button_"+t).prop("disabled",!0),j("#optimization_info_"+t).html("..."),"optimizetables"==t){var n=j("#wpoptimize_table_list #the-list tr");j(n).each(function(i){var e=j(this).find("td");if(table_type=e.eq(5).text(),table=e.eq(1).text(),optimizable=e.eq(5).data("optimizable"),""!=table&&("1"==optimizable||K)){var o={optimization_id:t,optimization_table:e.eq(1).text(),optimization_table_type:table_type,optimization_force:K};P.enqueue(o)}})}else if(o>0){data={optimization_id:t};for(var a in e)e.hasOwnProperty(a)&&(data[a]=e[a]);P.enqueue(data)}else P.enqueue(t);s()}}function r(i){j("#wpo_settings_sites_list").length?t("save_site_settings",{"wpo-sites":l()},function(){i&&i()}):i&&i()}function l(){var t=[];return j('#wpo_settings_sites_list input[type="checkbox"]').each(function(){var i=j(this);i.is(":checked")&&t.push(i.attr("value"))}),t}function _(){var t=!1;j("#enable-auto-backup").is(":checked")&&(t=!0),d(),1==t?c(g):g()}function c(t){"function"==typeof updraft_backupnow_inpage_go?updraft_backupnow_inpage_go(function(){j("#updraft-backupnow-inpage-modal").dialog("close"),t&&t()},"","autobackup",0,1,0,wpoptimize.automatic_backup_before_optimizations):t&&t()}function d(){var i=n("object");i.auto_backup=j("#enable-auto-backup").is(":checked"),t("save_auto_backup_option",i)}function u(t,i,e,o){t.on("click",function(){return i.hasClass("wpo_always_visible")||i.toggleClass("wpo_hidden"),!1}),m(e,o)}function m(t,i){t.on("change",function(){t.is(":checked")?i.prop("checked",!0):i.prop("checked",!1),f(t,i)}),i.on("change",function(){f(t,i)}),f(t,i)}function f(t,i){var e=0,o=0;if(i.each(function(){j(this).is(":checked")&&o++,e++}),t.next().is("label")&&t.next().data("label")){var n=t.next(),a=n.data("label");e==o?n.text(a):n.text(a.replace("all",[o," of ",e].join("")))}e==o?t.prop("checked",!0):t.prop("checked",!1)}function g(){$optimizations=j("#optimizations_list .optimization_checkbox:checked"),$optimizations.sort(function(t,i){return t=j(t).closest(".wp-optimize-settings").data("optimization_run_sort_order"),i=j(i).closest(".wp-optimize-settings").data("optimization_run_sort_order"),t>i?1:t<i?-1:0});var i={};$optimizations.each(function(t){var e=j(this).closest(".wp-optimize-settings").data("optimization_id");return e?(i[e]={active:1},void p(e)):void console.log("Optimization ID corresponding to pressed button not found")}),t("save_manual_run_optimization_options",i)}function w(t){j(".run-single-table-optimization").each(function(){var i=j(this);i.data("disabled")&&(t?i.prop("disabled",!1):i.prop("disabled",!0))})}function b(t){var i,e,o;if(t)for(i in t)t.hasOwnProperty(i)&&(e=["#wp-optimize-settings-",t[i].dom_id].join(""),o=t[i].info?t[i].info.join("<br>"):"",j(e+" .wp-optimize-settings-optimization-info").html(o))}function h(){var i=["",l().join("_")].join("");H.hasOwnProperty(i)?b(H[i]):t("get_optimizations_info",{"wpo-sites":l()},function(t){t&&(H[i]=t,b(t))})}function z(i){var e=j("#wpo_import_spinner"),o=j("#wpo_import_success_message"),n=j("#wpo_import_error_message");e.show(),t("import_settings",{settings:i},function(t){e.hide(),t&&t.errors&&t.errors.length?(n.text(t.errors.join("<br>")),n.slideDown()):t&&t.messages&&t.messages.length&&(o.text(t.messages.join("<br>")),o.slideDown(),setTimeout(function(){window.location.reload()},500)),j("#wpo_import_settings_btn").prop("disabled",!1)})}function v(t,i){var e=document.body.appendChild(document.createElement("a")),o=new Date,n=o.getFullYear(),a=o.getMonth()<10?["0",o.getMonth()].join(""):o.getMonth(),s=o.getDay()<10?["0",o.getDay()].join(""):o.getDay();i=i?i:["wpo-settings-",n,"-",a,"-",s,".json"].join(""),e.setAttribute("download",i),e.setAttribute("style","display:none;"),e.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(JSON.stringify(t))),e.click()}function y(){var t=j("#wpoptimize_table_list"),i=!0;j("tr",t).each(function(){var t=j(this);if(j("button",t).length>0)return i=!1,!1}),j("tr",t).each(function(){var t=j(this);i?j("td:last, th:last",t).hide():j("td:last, th:last",t).show()})}function k(){var t=!0;return j(".wpo_logger_addition_option, .wpo_logger_type").each(function(){x(j(this),!0)?j(this).removeClass("wpo_error_field"):(t=!1,j(this).addClass("wpo_error_field"))}),t?j("#wp-optimize-logger-settings .save_settings_reminder").slideUp():j("#wp-optimize-settings-save-results").show().addClass("wpo_alert_notice").text(wpoptimize.fill_all_settings_fields).delay(5e3).fadeOut(3e3,function(){j(this).removeClass("wpo_alert_notice")}),t}function x(t,i){var e=t.val(),o=t.data("validate");if(!o&&i)return""!=j.trim(e);if(o&&!i&&""==j.trim(e))return!0;var n=!0;switch(o){case"email":for(var a=/\S+@\S+\.\S+/,s=e.split(","),p="",r=0;r<s.length;r++)p=j.trim(s[r]),""!=p&&a.test(p)||(n=!1);break;case"url":var a=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i;n=a.test(e)}return n}var j=jQuery,O=0,P=new Updraft_Queue;m(j("#select_all_optimizations"),j("#optimizations_list .optimization_checkbox")),i(),j("#enable-schedule").change(function(){i()});var q=j("#wpoptimize_table_list_filter"),C=j("#wpoptimize_table_list"),D=j("#wpoptimize_table_list tbody:last"),S=j("#wpoptimize_table_list_tables_not_found");j(function(){C.tablesorter({theme:"default",widgets:["zebra","rows","filter"],cssInfoBlock:"tablesorter-no-sort",headers:{2:{sorter:"digit"},3:{sorter:"digit"},4:{sorter:"digit"},7:{sorter:!1}},widgetOptions:{filter_external:q,filter_defaultFilter:{2:"~{query}"}}}),C.on("filterEnd",function(){var t=j.trim(q.val());""==t?D.show():D.hide(),0==j("#the-list tr:visible",C).length?S.show():S.hide()})}),j("#wp-optimize-disable-enable-trackbacks-enable").click(function(){o("trackbacks",!0)}),j("#wp-optimize-disable-enable-trackbacks-disable").click(function(){o("trackbacks",!1)}),j("#wp-optimize-disable-enable-comments-enable").click(function(){o("comments",!0)}),j("#wp-optimize-disable-enable-comments-disable").click(function(){o("comments",!1)}),j("#wp-optimize-nav-tab-wrapper .nav-tab, #wp-optimize-images-nav-tab-wrapper .nav-tab").click(function(t){var i=j(this).attr("id"),e=j(this).closest(".nav-tab-wrapper").attr("id"),o=e.substring(0,e.length-7);if(i&&o==i.substring(0,o.length)){var i=i.substring(o.length);t.preventDefault(),j("#"+e+" .nav-tab:not(#wp-optimize-nav-tab-"+i+")").removeClass("nav-tab-active"),j(this).addClass("nav-tab-active"),j("#wp-optimize-wrap ."+o+"contents:not(#"+o+"contents-"+i+")").hide(),j("#"+o+"contents-"+i).show(),"tables"==i&&j("#wpoptimize_table_list").trigger("applyWidgets")}}),j("#wp-optimize-nav-tab-contents-optimize").on("click","button.wp-optimize-settings-optimization-run-button",function(){var t=j(this).closest(".wp-optimize-settings").data("optimization_id");return t?void(1!=j(".optimization_button_"+t).prop("disabled")&&(j(".optimization_button_"+t).prop("disabled",!0),r(function(){j(".optimization_button_"+t).prop("disabled",!1),p(t)}))):void console.log("Optimization ID corresponding to pressed button not found")}),j("#wp-optimize-nav-tab-contents-optimize").on("click","#wp-optimize",function(t){var i=j(this);t.preventDefault(),i.prop("disabled",!0),r(function(){i.prop("disabled",!1),_()})});var T=j("#wpo_settings_sites_list"),W=T.find("ul").first(),A=j('input[type="checkbox"]',W),F=T.find("#wpo_all_sites"),I=j("#wpo_sitelist_show_moreoptions"),U=j("#wpo_sitelist_moreoptions"),Q=j("#wpo_settings_sites_list_cron"),$=Q.find("ul").first(),J=j('input[type="checkbox"]',$),M=Q.find("#wpo_all_sites_cron"),N=j("#wpo_sitelist_show_moreoptions_cron"),E=j("#wpo_sitelist_moreoptions_cron");u(I,U,F,A);var R=0;j([F,A]).each(function(){j(this).on("change",function(){R++,setTimeout(function(){R--,0==R&&h()},1e3)})}),u(N,E,M,J),j("#wp_optimize_table_list_refresh").click(function(){j("#wpoptimize_table_list tbody").css("opacity","0.5"),t("get_table_list",!1,function(t){if(t.hasOwnProperty("table_list")){var i=!0,e=function(t){j("#wpoptimize_table_list tbody").css("opacity","1")};j("#wpoptimize_table_list").trigger("updateAll",[i,e])}t.hasOwnProperty("total_size")&&j("#optimize_current_db_size").html(t.total_size),w(G.is(":checked"))})}),j("#settings_form").on("click","#wp-optimize-settings-save",function(i){if(!k())return!1;i.preventDefault(),j("#save_spinner").show();var o=n();t("save_settings",o,function(t){if(j("#save_spinner").hide(),j("#save_done").show().delay(5e3).fadeOut(),t&&t.hasOwnProperty("save_results")&&t.save_results&&t.save_results.hasOwnProperty("errors")){for(var i=0,o=t.save_results.errors.length;i<o;i++){var n='<div class="error">'+t.errors[i]+"</div>";e(n,"#wp-optimize-settings-save-results")}console.log(t.save_results.messages)}t&&t.hasOwnProperty("status_box_contents")&&j("#wp_optimize_status_box .inside").html(t.status_box_contents),t&&t.hasOwnProperty("optimizations_table")&&j("#optimizations_list").replaceWith(t.optimizations_table),t.save_results.refresh&&location.reload()})}),j("#wp_optimize_status_box").on("click","#wp_optimize_status_box_refresh",function(i){i.preventDefault(),j("#wp_optimize_status_box").css("opacity","0.5"),t("get_status_box_contents",null,function(t){j("#wp_optimize_status_box").css("opacity","1").find(".inside").html(t)})});var B=j("#innodb_force_optimize"),K=B.is(":checked"),Y=B.closest("tr"),G=j("#innodb_force_optimize_single");B.on("change",function(){j('button, input[type="checkbox"]',Y).each(function(){K=B.is(":checked");var t=j(this);t.data("disabled")&&(K?t.prop("disabled",!1):t.prop("disabled",!0))})}),j("#wpoptimize_table_list").on("click",".run-single-table-optimization",function(){var i=j(this),e=i.next(),o=e.next(),n=i.data("table"),a=i.data("type"),s={optimization_id:"optimizetables",optimization_table:n,optimization_table_type:a};G.is(":checked")&&(s.optimization_force=!0),e.removeClass("visibility-hidden"),t("do_optimization",{optimization_id:"optimizetables",data:s},function(){i.prop("disabled",!1),e.addClass("visibility-hidden"),o.show().removeClass("visibility-hidden").delay(3e3).fadeOut("slow")})}),G.change(function(){w(G.is(":checked"))}),w(G.is(":checked"));var H={};setTimeout(function(){t("check_overdue_crons",null,function(t){t&&t.hasOwnProperty("m")&&j("#wpo_settings_warnings").append(t.m)})},11e3),j("#wpo_import_settings_btn").on("click",function(t){var i=j("#wpo_import_settings_file"),e=i.val(),o=i[0].files[0],n=new FileReader;return j("#wpo_import_settings_btn").prop("disabled",!0),/\.json$/.test(e)?(n.onload=function(){z(this.result)},n.readAsText(o),!1):(t.preventDefault(),j("#wpo_import_settings_btn").prop("disabled",!1),j("#wpo_import_error_message").text(wpoptimize.please_select_settings_file).slideDown(),!1)}),j("#wpo_import_settings_file").on("change",function(){j("#wpo_import_error_message").slideUp()}),j("#wpo_export_settings_btn").on("click",function(t){return v(n("object")),!1});var L=function(i,e,o){return t("get_optimization_info",{optimization_id:e,data:o},function(t){var o=t&&t.result&&t.result.meta?t.result.meta:{},n=t&&t.result&&t.result.output?t.result.output.join("<br>"):"...";j(document).trigger(["optimization_get_info_",e].join(""),n),i.html(n),o.finished?j(document).trigger(["optimization_get_info_",e,"_done"].join(""),t):setTimeout(function(){L(i,e,o)},1)})};return j(document).ready(function(){j(".wp-optimize-optimization-info-ajax").each(function(){var t=j(this),i=t.parent(),e=t.data("id");j(document).trigger(["optimization_get_info_",e,"_start"].join("")),L(i,e,{support_ajax_get_info:!0})})}),j("#wpoptimize_table_list").on("click",".run-single-table-repair",function(){var i=j(this),e=i.next(),o=e.next(),n=i.data("table"),a={optimization_id:"repairtables",optimization_table:n};e.removeClass("visibility-hidden"),t("do_optimization",{optimization_id:"repairtables",data:a},function(t){if(t.result.meta.success){var a=i.closest("tr"),s=t.result.meta.tableinfo;i.prop("disabled",!1),e.addClass("visibility-hidden"),o.show().removeClass("visibility-hidden"),j("td:eq(2)",a).text(s.rows),j("td:eq(3)",a).text(s.data_size),j("td:eq(4)",a).text(s.index_size),j("td:eq(5)",a).text(s.type),s.is_optimizable?j("td:eq(6)",a).html(['<span color="',s.overhead>0?"#0000FF":"#004600",'">',s.overhead,"</span>"].join("")):j("td:eq(6)",a).html('<span color="#0000FF">-</span>'),setTimeout(function(){var t=i.closest("td"),e=i.closest(".wpo_button_wrap");e.fadeOut("fast",function(){e.closest(".wpo_button_wrap").remove(),s.is_optimizable&&j(".wpo_button_wrap",t).removeClass("wpo_hidden")}),y()},1e3)}else i.prop("disabled",!1),e.addClass("visibility-hidden"),alert(wpoptimize.table_was_not_repaired.replace("%s",n))})}),y(),setTimeout(function(){t("check_overdue_crons",null,function(t){t&&t.hasOwnProperty("m")&&j("#wpo_settings_warnings").append(t.m)})},11e3),{send_command:t,optimization_get_info:L,take_a_backup_with_updraftplus:c,save_auto_backup_options:d}};jQuery(document).ready(function(t){function i(i){var e=["#",i.data("additional")].join("");i.is(":checked")?t(e).show():t(e).hide()}function e(){var i=t("#wp-optimize-logger-settings .save_settings_reminder");i.is(":visible")||i.slideDown("normal")}function o(){t(".wpo_logger_type").each(function(){n(t(this))})}function n(i){var e,o,n=a();for(e in n)o=n[e],wpoptimize.loggers_classes_info[o].allow_multiple?t('option[value="'+o+'"]',i).show():t('option[value="'+o+'"]',i).hide()}function a(){var i=[];return t(".wpo_logging_row, .wpo_logger_type").each(function(){var e=t(this).is("select")?t(this).val():t(this).data("id");e&&i.push(e)}),i}function s(){var t,i=['<option value="">Select destination</option>'];for(t in wpoptimize.loggers_classes_info)wpoptimize.loggers_classes_info.hasOwnProperty(t)&&wpoptimize.loggers_classes_info[t].available&&i.push(['<option value="',t,'">',wpoptimize.loggers_classes_info[t].description,"</option>"].join(""));return['<div class="wpo_add_logger_form">','<select class="wpo_logger_type" name="wpo-logger-type[]">',i.join(""),"<select>",'<a href="#" class="wpo_delete_logger dashicons dashicons-no-alt"></a>','<div class="wpo_additional_logger_options"></div>',"</div>"].join("")}function p(i){if(!wpoptimize.loggers_classes_info[i].options)return"";var e,o=wpoptimize.loggers_classes_info[i].options,n=[],a="",s="";for(e in o)o.hasOwnProperty(e)&&(t.isArray(o[e])?(a=t.trim(o[e][0]),s=t.trim(o[e][1])):(a=t.trim(o[e]),s=""),n.push(['<input class="wpo_logger_addition_option" type="text" name="wpo-logger-options[',e,'][]" value="" ','placeholder="',a,'" ',""!==s?'data-validate="'+s+'"':"","/>"].join("")));return n.push('<input type="hidden" name="wpo-logger-options[active][]" value="1" />'),n.join("")}t(".wp-optimize-logging-settings").each(function(){var e=t(this);i(e),e.on("change",function(){i(e)})});var r=t("#wpo_add_logger_link");r.on("click",function(){t("#wp-optimize-logger-settings .save_settings_reminder").after(s()),n(t(".wpo_logger_type").first())}),t("#wp-optimize-nav-tab-contents-settings").on("change",".wpo_logger_type",function(){var i=t(this),o=i.val(),n=i.parent().find(".wpo_additional_logger_options");n.html(p(o)),i.val()&&e()}),t(".wpo_logging_actions_row .dashicons-edit").on("click",function(){var i=t(this),e=i.closest(".wpo_logging_row");return t(".wpo_additional_logger_options",e).removeClass("wpo_hidden"),t(".wpo_logging_options_row",e).text(""),t(".wpo_logging_status_row",e).text(""),i.hide(),!1}),t("#wp-optimize-logger-settings").on("change",".wpo_logger_addition_option",function(){e()}),t(".wpo_logger_active_checkbox").on("change",function(){var i=t(this),e=i.closest("label").find('input[type="hidden"]');e.val(i.is(":checked")?"1":"0")}),t("#wp-optimize-nav-tab-contents-settings").on("click",".wpo_delete_logger",function(){if(!confirm(wpoptimize.are_you_sure_you_want_to_remove_logging_destination))return!1;var i=t(this);return i.closest(".wpo_logging_row, .wpo_add_logger_form").remove(),o(),0==t("#wp-optimize-logging-options .wpo_logging_row").length&&t("#wp-optimize-logging-options").hide(),e(),!1})});
languages/wp-optimize.pot CHANGED
@@ -17,11 +17,11 @@ msgstr ""
17
  "X-Poedit-SearchPathExcluded-0: *.js\n"
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
 
20
- #: src/includes/class-commands.php:160, src/includes/class-commands.php:203
21
  msgid "No optimization was indicated."
22
  msgstr ""
23
 
24
- #: src/includes/class-commands.php:312, src/includes/class-commands.php:321
25
  msgid "Please upload a valid settings file."
26
  msgstr ""
27
 
@@ -37,6 +37,10 @@ msgstr ""
37
  msgid "Enter email for logs here"
38
  msgstr ""
39
 
 
 
 
 
40
  #: src/includes/class-updraft-php-logger.php:24
41
  msgid "Log events into the PHP error log"
42
  msgstr ""
@@ -49,6 +53,122 @@ msgstr ""
49
  msgid "How many last records store?"
50
  msgstr ""
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  #: src/includes/class-wp-optimize-options.php:142
53
  msgid "Auto backup option updated."
54
  msgstr ""
@@ -61,19 +181,19 @@ msgstr ""
61
  msgid "No such optimization"
62
  msgstr ""
63
 
64
- #: src/includes/class-wp-optimizer.php:454
65
  msgid "Comments have now been disabled on all current and previously published posts."
66
  msgstr ""
67
 
68
- #: src/includes/class-wp-optimizer.php:457
69
  msgid "Comments have now been enabled on all current and previously published posts."
70
  msgstr ""
71
 
72
- #: src/includes/class-wp-optimizer.php:464
73
  msgid "Trackbacks have now been disabled on all current and previously published posts."
74
  msgstr ""
75
 
76
- #: src/includes/class-wp-optimizer.php:467
77
  msgid "Trackbacks have now been enabled on all current and previously published posts."
78
  msgstr ""
79
 
@@ -167,7 +287,7 @@ msgid_plural "%s orphaned attachments deleted"
167
  msgstr[0] ""
168
  msgstr[1] ""
169
 
170
- #: src/optimizations/attachments.php:33, src/optimizations/attachments.php:73, src/optimizations/autodraft.php:28, src/optimizations/autodraft.php:63, src/optimizations/commentmeta.php:33, src/optimizations/commentmeta.php:90, src/optimizations/orphandata.php:16, src/optimizations/orphandata.php:45, src/optimizations/pingbacks.php:16, src/optimizations/pingbacks.php:44, src/optimizations/postmeta.php:20, src/optimizations/postmeta.php:48, src/optimizations/revisions.php:24, src/optimizations/revisions.php:59, src/optimizations/spam.php:48, src/optimizations/spam.php:117, src/optimizations/trackbacks.php:16, src/optimizations/trackbacks.php:44, src/optimizations/transient.php:30, src/optimizations/transient.php:160, src/optimizations/trash.php:31, src/optimizations/trash.php:94, src/optimizations/unapproved.php:24, src/optimizations/unapproved.php:65
171
  msgid "across %s site"
172
  msgid_plural "across %s sites"
173
  msgstr[0] ""
@@ -187,67 +307,95 @@ msgstr ""
187
  msgid "Remove orphaned attachments"
188
  msgstr ""
189
 
190
- #: src/optimizations/autodraft.php:25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  msgid "%s auto draft deleted"
192
  msgid_plural "%s auto drafts deleted"
193
  msgstr[0] ""
194
  msgstr[1] ""
195
 
196
- #: src/optimizations/autodraft.php:57
197
  msgid "%s auto draft post in your database"
198
  msgid_plural "%s auto draft posts in your database"
199
  msgstr[0] ""
200
  msgstr[1] ""
201
 
202
- #: src/optimizations/autodraft.php:59
203
- msgid "No auto draft posts found"
204
- msgstr ""
205
-
206
- #: src/optimizations/autodraft.php:92
207
  msgid "Clean auto draft posts which are older than %s weeks"
208
  msgstr ""
209
 
210
- #: src/optimizations/autodraft.php:94
211
  msgid "Clean all auto-draft posts"
212
  msgstr ""
213
 
214
- #: src/optimizations/autodraft.php:105
215
  msgid "Remove auto-draft posts"
216
  msgstr ""
217
 
218
- #: src/optimizations/commentmeta.php:29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  msgid "%s unused comment metadata item removed"
220
  msgid_plural "%s unused comment metadata items removed"
221
  msgstr[0] ""
222
  msgstr[1] ""
223
 
224
- #: src/optimizations/commentmeta.php:30
225
  msgid "%s unused akismet comment metadata item removed"
226
  msgid_plural "%s unused akismet comment metadata items removed"
227
  msgstr[0] ""
228
  msgstr[1] ""
229
 
230
- #: src/optimizations/commentmeta.php:78
231
  msgid "%s orphaned comment meta data in your database"
232
  msgid_plural "%s orphaned comment meta data in your database"
233
  msgstr[0] ""
234
  msgstr[1] ""
235
 
236
- #: src/optimizations/commentmeta.php:80
237
- msgid "No orphaned comment meta data in your database"
238
- msgstr ""
239
-
240
- #: src/optimizations/commentmeta.php:84
241
  msgid "%s unused Akismet comment meta rows in your database"
242
  msgid_plural "%s unused Akismet meta rows in your database"
243
  msgstr[0] ""
244
  msgstr[1] ""
245
 
246
- #: src/optimizations/commentmeta.php:86
247
  msgid "No Akismet comment meta rows in your database"
248
  msgstr ""
249
 
250
- #: src/optimizations/commentmeta.php:116, src/optimizations/commentmeta.php:120
251
  msgid "Clean comment meta data"
252
  msgstr ""
253
 
@@ -255,283 +403,317 @@ msgstr ""
255
  msgid "Remove unused tags"
256
  msgstr ""
257
 
258
- #: src/optimizations/optimizetables.php:65
259
  msgid "Optimizing Table:"
260
  msgstr ""
261
 
262
- #: src/optimizations/optimizetables.php:80
263
  msgid "Total gain:"
264
  msgstr ""
265
 
266
- #: src/optimizations/optimizetables.php:88
267
  msgid "Other tables will be optimized (%s)."
268
  msgstr ""
269
 
270
- #: src/optimizations/optimizetables.php:93
271
  msgid "Optimize InnoDB tables anyway."
272
  msgstr ""
273
 
274
- #: src/optimizations/optimizetables.php:93
275
  msgid "Warning: you should read the FAQ on the risks of this operation first."
276
  msgstr ""
277
 
278
- #: src/optimizations/optimizetables.php:96
279
  msgid "Tables will be optimized (%s)."
280
  msgstr ""
281
 
282
- #: src/optimizations/optimizetables.php:101, src/optimizations/optimizetables.php:105
283
  msgid "Optimize database tables"
284
  msgstr ""
285
 
286
- #: src/optimizations/orphandata.php:13
287
  msgid "%s orphaned meta data deleted"
288
  msgid_plural "%s orphaned meta data deleted"
289
  msgstr[0] ""
290
  msgstr[1] ""
291
 
292
- #: src/optimizations/orphandata.php:39
293
  msgid "%s orphaned relationship data in your database"
294
  msgid_plural "%s orphaned relationship data in your database"
295
  msgstr[0] ""
296
  msgstr[1] ""
297
 
298
- #: src/optimizations/orphandata.php:41
299
  msgid "No orphaned relationship data in your database"
300
  msgstr ""
301
 
302
- #: src/optimizations/orphandata.php:62
303
  msgid "Clean orphaned relationship data"
304
  msgstr ""
305
 
306
- #: src/optimizations/pingbacks.php:13
 
 
 
 
 
 
 
 
 
 
 
 
307
  msgid "%s pingback deleted"
308
  msgid_plural "%s pingbacks deleted"
309
  msgstr[0] ""
310
  msgstr[1] ""
311
 
312
- #: src/optimizations/pingbacks.php:38
313
  msgid "%s pingback found"
314
  msgid_plural "%s pingbacks found"
315
  msgstr[0] ""
316
  msgstr[1] ""
317
 
318
- #: src/optimizations/pingbacks.php:40
319
- msgid "No pingbacks found"
320
  msgstr ""
321
 
322
- #: src/optimizations/pingbacks.php:61
323
- msgid "Remove pingbacks"
324
  msgstr ""
325
 
326
- #: src/optimizations/postmeta.php:17
 
 
 
 
327
  msgid "%s orphaned post meta data deleted"
328
  msgid_plural "%s orphaned post meta data deleted"
329
  msgstr[0] ""
330
  msgstr[1] ""
331
 
332
- #: src/optimizations/postmeta.php:42
333
  msgid "%s orphaned post meta data in your database"
334
  msgid_plural "%s orphaned post meta data in your database"
335
  msgstr[0] ""
336
  msgstr[1] ""
337
 
338
- #: src/optimizations/postmeta.php:44
339
- msgid "No orphaned post meta data in your database"
340
- msgstr ""
341
-
342
- #: src/optimizations/postmeta.php:65
343
  msgid "Clean post meta data"
344
  msgstr ""
345
 
346
- #: src/optimizations/postmeta.php:74
347
  msgid "Remove orphaned post meta"
348
  msgstr ""
349
 
350
- #: src/optimizations/repairtables.php:123
351
  msgid "No corrupted tables found"
352
  msgstr ""
353
 
354
- #: src/optimizations/repairtables.php:135
355
  msgid "Repair database tables"
356
  msgstr ""
357
 
358
- #: src/optimizations/revisions.php:21
 
 
 
 
359
  msgid "%s post revision deleted"
360
  msgid_plural "%s post revisions deleted"
361
  msgstr[0] ""
362
  msgstr[1] ""
363
 
364
- #: src/optimizations/revisions.php:53
365
  msgid "%s post revision in your database"
366
  msgid_plural "%s post revisions in your database"
367
  msgstr[0] ""
368
  msgstr[1] ""
369
 
370
- #: src/optimizations/revisions.php:55
371
- msgid "No post revisions found"
372
- msgstr ""
373
-
374
- #: src/optimizations/revisions.php:81
375
  msgid "Clean post revisions which are older than %d weeks"
376
  msgstr ""
377
 
378
- #: src/optimizations/revisions.php:83
379
  msgid "Clean all post revisions"
380
  msgstr ""
381
 
382
- #: src/optimizations/revisions.php:88
383
  msgid "Remove auto revisions"
384
  msgstr ""
385
 
386
- #: src/optimizations/spam.php:43
 
 
 
 
387
  msgid "%s spam comment deleted"
388
  msgid_plural "%s spam comments deleted"
389
  msgstr[0] ""
390
  msgstr[1] ""
391
 
392
- #: src/optimizations/spam.php:44
393
  msgid "%s comment removed from Trash"
394
  msgid_plural "%s comments removed from Trash"
395
  msgstr[0] ""
396
  msgstr[1] ""
397
 
398
- #: src/optimizations/spam.php:105
399
  msgid "%s spam comment found"
400
  msgid_plural "%s spam comments found"
401
  msgstr[0] ""
402
  msgstr[1] ""
403
 
404
- #: src/optimizations/spam.php:105, src/optimizations/spam.php:111
405
  msgid "Review"
406
  msgstr ""
407
 
408
- #: src/optimizations/spam.php:107
409
  msgid "No spam comments found"
410
  msgstr ""
411
 
412
- #: src/optimizations/spam.php:111
413
  msgid "%s trashed comment found"
414
  msgid_plural "%s trashed comments found"
415
  msgstr[0] ""
416
  msgstr[1] ""
417
 
418
- #: src/optimizations/spam.php:113
419
  msgid "No trashed comments found"
420
  msgstr ""
421
 
422
- #: src/optimizations/spam.php:157
423
  msgid "Remove spam and trashed comments which are older than %d weeks"
424
  msgstr ""
425
 
426
- #: src/optimizations/spam.php:159, src/optimizations/spam.php:164
427
  msgid "Remove spam and trashed comments"
428
  msgstr ""
429
 
430
- #: src/optimizations/trackbacks.php:13
 
 
 
 
431
  msgid "%s trackback deleted"
432
  msgid_plural "%s trackbacks deleted"
433
  msgstr[0] ""
434
  msgstr[1] ""
435
 
436
- #: src/optimizations/trackbacks.php:38
437
  msgid "%s Trackback found"
438
  msgid_plural "%s Trackbacks found"
439
  msgstr[0] ""
440
  msgstr[1] ""
441
 
442
- #: src/optimizations/trackbacks.php:40
443
- msgid "No trackbacks found"
444
  msgstr ""
445
 
446
- #: src/optimizations/trackbacks.php:58
447
- msgid "Remove trackbacks"
 
 
 
 
448
  msgstr ""
449
 
450
- #: src/optimizations/transient.php:27
 
 
 
 
451
  msgid "%s transient option deleted"
452
  msgid_plural "%s transient options deleted"
453
  msgstr[0] ""
454
  msgstr[1] ""
455
 
456
- #: src/optimizations/transient.php:70
457
  msgid "%s network-wide transient option deleted"
458
  msgid_plural "%s network-wide transient options deleted"
459
  msgstr[0] ""
460
  msgstr[1] ""
461
 
462
- #: src/optimizations/transient.php:154
463
- msgid "%s transient option found"
464
- msgid_plural "%s transient options found"
465
  msgstr[0] ""
466
  msgstr[1] ""
467
 
468
- #: src/optimizations/transient.php:156
469
- msgid "No transient options found"
470
- msgstr ""
 
 
471
 
472
- #: src/optimizations/transient.php:167
473
- msgid "%d network-wide transient option found"
474
- msgid_plural "%d network-wide transient options found"
475
  msgstr[0] ""
476
  msgstr[1] ""
477
 
478
- #: src/optimizations/transient.php:169
479
  msgid "No site-wide transient options found"
480
  msgstr ""
481
 
482
- #: src/optimizations/transient.php:211, src/optimizations/transient.php:215
 
 
 
 
483
  msgid "Remove expired transient options"
484
  msgstr ""
485
 
486
- #: src/optimizations/trash.php:28
 
 
 
 
487
  msgid "%s post removed from Trash"
488
  msgid_plural "%s posts removed from Trash"
489
  msgstr[0] ""
490
  msgstr[1] ""
491
 
492
- #: src/optimizations/trash.php:88
493
  msgid "%s trashed post in your database"
494
  msgid_plural "%s trashed posts in your database"
495
  msgstr[0] ""
496
  msgstr[1] ""
497
 
498
- #: src/optimizations/trash.php:90
499
- msgid "No trashed posts found"
500
- msgstr ""
501
-
502
- #: src/optimizations/trash.php:124
503
  msgid "Clean trashed posts which are older than %d weeks"
504
  msgstr ""
505
 
506
- #: src/optimizations/trash.php:126
507
  msgid "Clean all trashed posts"
508
  msgstr ""
509
 
510
- #: src/optimizations/trash.php:136
511
  msgid "Remove trashed posts"
512
  msgstr ""
513
 
514
- #: src/optimizations/unapproved.php:21
 
 
 
 
515
  msgid "%s unapproved comment deleted"
516
  msgid_plural "%s unapproved comments deleted"
517
  msgstr[0] ""
518
  msgstr[1] ""
519
 
520
- #: src/optimizations/unapproved.php:59
521
  msgid "%s unapproved comment found"
522
  msgid_plural "%s unapproved comments found"
523
  msgstr[0] ""
524
  msgstr[1] ""
525
 
526
- #: src/optimizations/unapproved.php:61
527
- msgid "No unapproved comments found"
528
- msgstr ""
529
-
530
- #: src/optimizations/unapproved.php:88
531
  msgid "Remove unapproved comments which are older than %d weeks"
532
  msgstr ""
533
 
534
- #: src/optimizations/unapproved.php:90, src/optimizations/unapproved.php:95
535
  msgid "Remove unapproved comments"
536
  msgstr ""
537
 
@@ -1125,27 +1307,37 @@ msgstr ""
1125
  msgid "Total clean up overall:"
1126
  msgstr ""
1127
 
1128
- #: src/templates/status-box-contents.php:126
 
 
 
 
 
 
 
 
 
 
1129
  msgid "Support and feedback"
1130
  msgstr ""
1131
 
1132
- #: src/templates/status-box-contents.php:128
1133
  msgid "If you like WP-Optimize,"
1134
  msgstr ""
1135
 
1136
- #: src/templates/status-box-contents.php:128
1137
  msgid "please give us a positive review, here."
1138
  msgstr ""
1139
 
1140
- #: src/templates/status-box-contents.php:128
1141
  msgid "Or, if you did not like it,"
1142
  msgstr ""
1143
 
1144
- #: src/templates/status-box-contents.php:128
1145
  msgid "please tell us why at this link."
1146
  msgstr ""
1147
 
1148
- #: src/templates/status-box-contents.php:129
1149
  msgid "Support is available here."
1150
  msgstr ""
1151
 
@@ -1227,142 +1419,154 @@ msgstr ""
1227
  msgid "Follow this link to install UpdraftPlus, to take a backup before optimization"
1228
  msgstr ""
1229
 
1230
- #: src/templates/take-a-backup.php:75
1231
  msgid "UpdraftPlus needs to be updated to 1.12.33 or higher in order to backup the database before optimization."
1232
  msgstr ""
1233
 
1234
- #: src/templates/take-a-backup.php:75
1235
  msgid "Please update UpdraftPlus to the latest version."
1236
  msgstr ""
1237
 
1238
- #: src/wp-optimize.php:268
 
 
 
 
1239
  msgid "WP-Optimize (Free) has been de-activated, because WP-Optimize Premium is active."
1240
  msgstr ""
1241
 
1242
- #: src/wp-optimize.php:278
1243
  msgid "New feature: WP-Optimize Premium can now optimize all sites within a multisite install, not just the main one."
1244
  msgstr ""
1245
 
1246
- #: src/wp-optimize.php:393
1247
  msgid "Table information"
1248
  msgstr ""
1249
 
1250
- #: src/wp-optimize.php:393, src/wp-optimize.php:579
1251
  msgid "Settings"
1252
  msgstr ""
1253
 
1254
- #: src/wp-optimize.php:393
1255
  msgid "Premium / Plugin family"
1256
  msgstr ""
1257
 
1258
- #: src/wp-optimize.php:522
1259
  msgid "Automatic backup before optimizations"
1260
  msgstr ""
1261
 
1262
- #: src/wp-optimize.php:523
1263
  msgid "An unexpected response was received."
1264
  msgstr ""
1265
 
1266
- #: src/wp-optimize.php:524
1267
  msgid "Optimization complete"
1268
  msgstr ""
1269
 
1270
- #: src/wp-optimize.php:525
1271
  msgid "Run optimizations"
1272
  msgstr ""
1273
 
1274
- #: src/wp-optimize.php:526
1275
  msgid "Cancel"
1276
  msgstr ""
1277
 
1278
- #: src/wp-optimize.php:527
1279
  msgid "Please, select settings file."
1280
  msgstr ""
1281
 
1282
- #: src/wp-optimize.php:528
1283
  msgid "Are you sure you want to remove this logging destination?"
1284
  msgstr ""
1285
 
1286
- #: src/wp-optimize.php:529
1287
  msgid "Before saving, you need to complete the currently incomplete settings (or remove them)."
1288
  msgstr ""
1289
 
1290
- #: src/wp-optimize.php:530
1291
  msgid "%s was not repaired. For more details, please check your logs configured in logging destinations settings."
1292
  msgstr ""
1293
 
1294
- #: src/wp-optimize.php:560
1295
  msgid "Optimize"
1296
  msgstr ""
1297
 
1298
- #: src/wp-optimize.php:582
1299
  msgid "Optimizer"
1300
  msgstr ""
1301
 
1302
- #: src/wp-optimize.php:598
1303
  msgid "Repair"
1304
  msgstr ""
1305
 
1306
- #: src/wp-optimize.php:705
1307
  msgid "Warning"
1308
  msgstr ""
1309
 
1310
- #: src/wp-optimize.php:705
1311
  msgid "WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working."
1312
  msgstr ""
1313
 
1314
- #: src/wp-optimize.php:705
1315
  msgid "Read this page for a guide to possible causes and how to fix it."
1316
  msgstr ""
1317
 
1318
- #: src/wp-optimize.php:772
1319
  msgid "Error:"
1320
  msgstr ""
1321
 
1322
- #: src/wp-optimize.php:772
1323
  msgid "template not found"
1324
  msgstr ""
1325
 
1326
- #: src/wp-optimize.php:824
1327
  msgid "Automatic Operation Completed"
1328
  msgstr ""
1329
 
1330
- #: src/wp-optimize.php:826
1331
  msgid "Scheduled optimization was executed at"
1332
  msgstr ""
1333
 
1334
- #: src/wp-optimize.php:827
1335
  msgid "You can safely delete this email."
1336
  msgstr ""
1337
 
1338
- #: src/wp-optimize.php:829
1339
  msgid "Regards,"
1340
  msgstr ""
1341
 
1342
- #: src/wp-optimize.php:830
1343
  msgid "WP-Optimize Plugin"
1344
  msgstr ""
1345
 
1346
- #: src/wp-optimize.php:852
1347
  msgid "GB"
1348
  msgstr ""
1349
 
1350
- #: src/wp-optimize.php:854
1351
  msgid "MB"
1352
  msgstr ""
1353
 
1354
- #: src/wp-optimize.php:856
1355
  msgid "KB"
1356
  msgstr ""
1357
 
1358
- #: src/wp-optimize.php:858
1359
  msgid "bytes"
1360
  msgstr ""
1361
 
1362
- #: src/wp-optimize.php:1250
 
 
 
 
 
 
 
 
1363
  msgid "Only Network Administrator can activate WP-Optimize plugin."
1364
  msgstr ""
1365
 
1366
- #: src/wp-optimize.php:1251
1367
  msgid "go back"
1368
  msgstr ""
17
  "X-Poedit-SearchPathExcluded-0: *.js\n"
18
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
 
20
+ #: src/includes/class-commands.php:180, src/includes/class-commands.php:224, src/includes/class-commands.php:266
21
  msgid "No optimization was indicated."
22
  msgstr ""
23
 
24
+ #: src/includes/class-commands.php:376, src/includes/class-commands.php:385
25
  msgid "Please upload a valid settings file."
26
  msgstr ""
27
 
37
  msgid "Enter email for logs here"
38
  msgstr ""
39
 
40
+ #: src/includes/class-updraft-file-logger.php:32
41
+ msgid "Log events into a log file"
42
+ msgstr ""
43
+
44
  #: src/includes/class-updraft-php-logger.php:24
45
  msgid "Log events into the PHP error log"
46
  msgstr ""
53
  msgid "How many last records store?"
54
  msgstr ""
55
 
56
+ #: src/includes/class-updraft-smush-manager-commands.php:111
57
+ msgid "Image restored successfully"
58
+ msgstr ""
59
+
60
+ #: src/includes/class-updraft-smush-manager-commands.php:142
61
+ msgid "A total of %d image(s) were compressed on this site, saving appoximately %s of space at an average of %02d percent per image."
62
+ msgstr ""
63
+
64
+ #: src/includes/class-updraft-smush-manager-commands.php:143
65
+ msgid "%d image(s) could not be compressed. Please see the logs for more information or try again later."
66
+ msgstr ""
67
+
68
+ #: src/includes/class-updraft-smush-manager-commands.php:144
69
+ msgid "%d image(s) images were selected for compressing previously, but were not all processed. You can either complete them now or cancel and retry later."
70
+ msgstr ""
71
+
72
+ #: src/includes/class-updraft-smush-manager-commands.php:168
73
+ msgid "Options could not be updated"
74
+ msgstr ""
75
+
76
+ #: src/includes/class-updraft-smush-manager-commands.php:172
77
+ msgid "Options updated successfully"
78
+ msgstr ""
79
+
80
+ #: src/includes/class-updraft-smush-manager-commands.php:187
81
+ msgid "Stats could not be cleared"
82
+ msgstr ""
83
+
84
+ #: src/includes/class-updraft-smush-manager-commands.php:191
85
+ msgid "Stats cleared successfully"
86
+ msgstr ""
87
+
88
+ #: src/includes/class-updraft-smush-manager-commands.php:225
89
+ msgid "Pending tasks could not be cleared"
90
+ msgstr ""
91
+
92
+ #: src/includes/class-updraft-smush-manager-commands.php:229
93
+ msgid "Pending tasks cleared successfully"
94
+ msgstr ""
95
+
96
+ #: src/includes/class-updraft-smush-manager-commands.php:255
97
+ msgid "Log file does not exist or cant be read"
98
+ msgstr ""
99
+
100
+ #: src/includes/class-updraft-smush-manager.php:212
101
+ msgid "Backup not found, it may have been deleted or already restored"
102
+ msgstr ""
103
+
104
+ #: src/includes/class-updraft-smush-manager.php:216
105
+ msgid "The destination could not be written to, please check your folder permissions"
106
+ msgstr ""
107
+
108
+ #: src/includes/class-updraft-smush-manager.php:222
109
+ msgid "Could not copy file, check your PHP error logs for details"
110
+ msgstr ""
111
+
112
+ #: src/includes/class-updraft-smush-manager.php:434
113
+ msgid "All valid images are compresed now"
114
+ msgstr ""
115
+
116
+ #: src/includes/class-updraft-smush-manager.php:435
117
+ msgid "An unexpected response was received from the server."
118
+ msgstr ""
119
+
120
+ #: src/includes/class-updraft-smush-manager.php:436
121
+ msgid "Please wait. Compressing the selected image."
122
+ msgstr ""
123
+
124
+ #: src/includes/class-updraft-smush-manager.php:437
125
+ msgid "Please try again later."
126
+ msgstr ""
127
+
128
+ #: src/includes/class-updraft-smush-manager.php:438
129
+ msgid "Connecting to the Smush API server, please wait"
130
+ msgstr ""
131
+
132
+ #: src/includes/class-updraft-smush-manager.php:439
133
+ msgid "There was an error connecting to the Smush API server, please try later"
134
+ msgstr ""
135
+
136
+ #: src/includes/class-updraft-smush-task.php:187
137
+ msgid "The file was compressed from %s to %s saving %s percent using WP-Optimize"
138
+ msgstr ""
139
+
140
+ #: src/includes/class-updraft-smush-task.php:215
141
+ msgid "Failed with error code %s - %s"
142
+ msgstr ""
143
+
144
+ #: src/includes/class-updraft-smush-task.php:233
145
+ msgid "Initialised"
146
+ msgstr ""
147
+
148
+ #: src/includes/class-updraft-smush-task.php:234
149
+ msgid "Connecting to API server"
150
+ msgstr ""
151
+
152
+ #: src/includes/class-updraft-smush-task.php:235
153
+ msgid "Processing response"
154
+ msgstr ""
155
+
156
+ #: src/includes/class-updraft-smush-task.php:236
157
+ msgid "Backing up original image"
158
+ msgstr ""
159
+
160
+ #: src/includes/class-updraft-smush-task.php:237
161
+ msgid "Saving optimised image"
162
+ msgstr ""
163
+
164
+ #: src/includes/class-updraft-smush-task.php:238
165
+ msgid "Successful"
166
+ msgstr ""
167
+
168
+ #: src/includes/class-wp-optimization.php:452
169
+ msgid "Preview found items"
170
+ msgstr ""
171
+
172
  #: src/includes/class-wp-optimize-options.php:142
173
  msgid "Auto backup option updated."
174
  msgstr ""
181
  msgid "No such optimization"
182
  msgstr ""
183
 
184
+ #: src/includes/class-wp-optimizer.php:453
185
  msgid "Comments have now been disabled on all current and previously published posts."
186
  msgstr ""
187
 
188
+ #: src/includes/class-wp-optimizer.php:456
189
  msgid "Comments have now been enabled on all current and previously published posts."
190
  msgstr ""
191
 
192
+ #: src/includes/class-wp-optimizer.php:463
193
  msgid "Trackbacks have now been disabled on all current and previously published posts."
194
  msgstr ""
195
 
196
+ #: src/includes/class-wp-optimizer.php:466
197
  msgid "Trackbacks have now been enabled on all current and previously published posts."
198
  msgstr ""
199
 
287
  msgstr[0] ""
288
  msgstr[1] ""
289
 
290
+ #: src/optimizations/attachments.php:33, src/optimizations/attachments.php:73, src/optimizations/autodraft.php:85, src/optimizations/autodraft.php:130, src/optimizations/commentmeta.php:101, src/optimizations/commentmeta.php:170, src/optimizations/orphandata.php:18, src/optimizations/orphandata.php:46, src/optimizations/pingbacks.php:68, src/optimizations/pingbacks.php:107, src/optimizations/postmeta.php:63, src/optimizations/postmeta.php:98, src/optimizations/revisions.php:81, src/optimizations/revisions.php:125, src/optimizations/spam.php:111, src/optimizations/spam.php:198, src/optimizations/trackbacks.php:69, src/optimizations/trackbacks.php:109, src/optimizations/transient.php:178, src/optimizations/trash.php:96, src/optimizations/trash.php:169, src/optimizations/unapproved.php:84, src/optimizations/unapproved.php:130
291
  msgid "across %s site"
292
  msgid_plural "across %s sites"
293
  msgstr[0] ""
307
  msgid "Remove orphaned attachments"
308
  msgstr ""
309
 
310
+ #: src/optimizations/autodraft.php:54, src/optimizations/commentmeta.php:49, src/optimizations/pingbacks.php:35, src/optimizations/revisions.php:50, src/optimizations/spam.php:68, src/optimizations/trackbacks.php:36, src/optimizations/trash.php:58, src/optimizations/unapproved.php:51
311
+ msgid "no title"
312
+ msgstr ""
313
+
314
+ #: src/optimizations/autodraft.php:66, src/optimizations/commentmeta.php:72, src/optimizations/pingbacks.php:49, src/optimizations/postmeta.php:43, src/optimizations/revisions.php:62, src/optimizations/spam.php:82, src/optimizations/trackbacks.php:50, src/optimizations/transient.php:140, src/optimizations/transient.php:146, src/optimizations/trash.php:77, src/optimizations/unapproved.php:65
315
+ msgid "ID"
316
+ msgstr ""
317
+
318
+ #: src/optimizations/autodraft.php:67, src/optimizations/revisions.php:63, src/optimizations/trash.php:78
319
+ msgid "Title"
320
+ msgstr ""
321
+
322
+ #: src/optimizations/autodraft.php:68, src/optimizations/revisions.php:64, src/optimizations/trash.php:79, src/optimizations/unapproved.php:67
323
+ msgid "Date"
324
+ msgstr ""
325
+
326
+ #: src/optimizations/autodraft.php:74, src/optimizations/autodraft.php:126
327
+ msgid "No auto draft posts found"
328
+ msgstr ""
329
+
330
+ #: src/optimizations/autodraft.php:82
331
  msgid "%s auto draft deleted"
332
  msgid_plural "%s auto drafts deleted"
333
  msgstr[0] ""
334
  msgstr[1] ""
335
 
336
+ #: src/optimizations/autodraft.php:124
337
  msgid "%s auto draft post in your database"
338
  msgid_plural "%s auto draft posts in your database"
339
  msgstr[0] ""
340
  msgstr[1] ""
341
 
342
+ #: src/optimizations/autodraft.php:164
 
 
 
 
343
  msgid "Clean auto draft posts which are older than %s weeks"
344
  msgstr ""
345
 
346
+ #: src/optimizations/autodraft.php:166
347
  msgid "Clean all auto-draft posts"
348
  msgstr ""
349
 
350
+ #: src/optimizations/autodraft.php:177
351
  msgid "Remove auto-draft posts"
352
  msgstr ""
353
 
354
+ #: src/optimizations/commentmeta.php:73
355
+ msgid "Comment ID"
356
+ msgstr ""
357
+
358
+ #: src/optimizations/commentmeta.php:74, src/optimizations/postmeta.php:45
359
+ msgid "Meta Key"
360
+ msgstr ""
361
+
362
+ #: src/optimizations/commentmeta.php:75, src/optimizations/postmeta.php:46
363
+ msgid "Meta Value"
364
+ msgstr ""
365
+
366
+ #: src/optimizations/commentmeta.php:81, src/optimizations/commentmeta.php:160
367
+ msgid "No orphaned comment meta data in your database"
368
+ msgstr ""
369
+
370
+ #: src/optimizations/commentmeta.php:97
371
  msgid "%s unused comment metadata item removed"
372
  msgid_plural "%s unused comment metadata items removed"
373
  msgstr[0] ""
374
  msgstr[1] ""
375
 
376
+ #: src/optimizations/commentmeta.php:98
377
  msgid "%s unused akismet comment metadata item removed"
378
  msgid_plural "%s unused akismet comment metadata items removed"
379
  msgstr[0] ""
380
  msgstr[1] ""
381
 
382
+ #: src/optimizations/commentmeta.php:158
383
  msgid "%s orphaned comment meta data in your database"
384
  msgid_plural "%s orphaned comment meta data in your database"
385
  msgstr[0] ""
386
  msgstr[1] ""
387
 
388
+ #: src/optimizations/commentmeta.php:164
 
 
 
 
389
  msgid "%s unused Akismet comment meta rows in your database"
390
  msgid_plural "%s unused Akismet meta rows in your database"
391
  msgstr[0] ""
392
  msgstr[1] ""
393
 
394
+ #: src/optimizations/commentmeta.php:166
395
  msgid "No Akismet comment meta rows in your database"
396
  msgstr ""
397
 
398
+ #: src/optimizations/commentmeta.php:204, src/optimizations/commentmeta.php:208
399
  msgid "Clean comment meta data"
400
  msgstr ""
401
 
403
  msgid "Remove unused tags"
404
  msgstr ""
405
 
406
+ #: src/optimizations/optimizetables.php:70
407
  msgid "Optimizing Table:"
408
  msgstr ""
409
 
410
+ #: src/optimizations/optimizetables.php:85
411
  msgid "Total gain:"
412
  msgstr ""
413
 
414
+ #: src/optimizations/optimizetables.php:93
415
  msgid "Other tables will be optimized (%s)."
416
  msgstr ""
417
 
418
+ #: src/optimizations/optimizetables.php:98
419
  msgid "Optimize InnoDB tables anyway."
420
  msgstr ""
421
 
422
+ #: src/optimizations/optimizetables.php:98
423
  msgid "Warning: you should read the FAQ on the risks of this operation first."
424
  msgstr ""
425
 
426
+ #: src/optimizations/optimizetables.php:101
427
  msgid "Tables will be optimized (%s)."
428
  msgstr ""
429
 
430
+ #: src/optimizations/optimizetables.php:106, src/optimizations/optimizetables.php:110
431
  msgid "Optimize database tables"
432
  msgstr ""
433
 
434
+ #: src/optimizations/orphandata.php:15
435
  msgid "%s orphaned meta data deleted"
436
  msgid_plural "%s orphaned meta data deleted"
437
  msgstr[0] ""
438
  msgstr[1] ""
439
 
440
+ #: src/optimizations/orphandata.php:40
441
  msgid "%s orphaned relationship data in your database"
442
  msgid_plural "%s orphaned relationship data in your database"
443
  msgstr[0] ""
444
  msgstr[1] ""
445
 
446
+ #: src/optimizations/orphandata.php:42
447
  msgid "No orphaned relationship data in your database"
448
  msgstr ""
449
 
450
+ #: src/optimizations/orphandata.php:63
451
  msgid "Clean orphaned relationship data"
452
  msgstr ""
453
 
454
+ #: src/optimizations/pingbacks.php:50, src/optimizations/spam.php:83, src/optimizations/trackbacks.php:51, src/optimizations/unapproved.php:66
455
+ msgid "Author"
456
+ msgstr ""
457
+
458
+ #: src/optimizations/pingbacks.php:51, src/optimizations/spam.php:84, src/optimizations/trackbacks.php:52
459
+ msgid "Comment"
460
+ msgstr ""
461
+
462
+ #: src/optimizations/pingbacks.php:57, src/optimizations/pingbacks.php:103
463
+ msgid "No pingbacks found"
464
+ msgstr ""
465
+
466
+ #: src/optimizations/pingbacks.php:65
467
  msgid "%s pingback deleted"
468
  msgid_plural "%s pingbacks deleted"
469
  msgstr[0] ""
470
  msgstr[1] ""
471
 
472
+ #: src/optimizations/pingbacks.php:101
473
  msgid "%s pingback found"
474
  msgid_plural "%s pingbacks found"
475
  msgstr[0] ""
476
  msgstr[1] ""
477
 
478
+ #: src/optimizations/pingbacks.php:129
479
+ msgid "Remove pingbacks"
480
  msgstr ""
481
 
482
+ #: src/optimizations/postmeta.php:44
483
+ msgid "Post ID"
484
  msgstr ""
485
 
486
+ #: src/optimizations/postmeta.php:52, src/optimizations/postmeta.php:94
487
+ msgid "No orphaned post meta data in your database"
488
+ msgstr ""
489
+
490
+ #: src/optimizations/postmeta.php:60
491
  msgid "%s orphaned post meta data deleted"
492
  msgid_plural "%s orphaned post meta data deleted"
493
  msgstr[0] ""
494
  msgstr[1] ""
495
 
496
+ #: src/optimizations/postmeta.php:92
497
  msgid "%s orphaned post meta data in your database"
498
  msgid_plural "%s orphaned post meta data in your database"
499
  msgstr[0] ""
500
  msgstr[1] ""
501
 
502
+ #: src/optimizations/postmeta.php:120
 
 
 
 
503
  msgid "Clean post meta data"
504
  msgstr ""
505
 
506
+ #: src/optimizations/postmeta.php:129
507
  msgid "Remove orphaned post meta"
508
  msgstr ""
509
 
510
+ #: src/optimizations/repairtables.php:142
511
  msgid "No corrupted tables found"
512
  msgstr ""
513
 
514
+ #: src/optimizations/repairtables.php:154
515
  msgid "Repair database tables"
516
  msgstr ""
517
 
518
+ #: src/optimizations/revisions.php:70, src/optimizations/revisions.php:121
519
+ msgid "No post revisions found"
520
+ msgstr ""
521
+
522
+ #: src/optimizations/revisions.php:78
523
  msgid "%s post revision deleted"
524
  msgid_plural "%s post revisions deleted"
525
  msgstr[0] ""
526
  msgstr[1] ""
527
 
528
+ #: src/optimizations/revisions.php:119
529
  msgid "%s post revision in your database"
530
  msgid_plural "%s post revisions in your database"
531
  msgstr[0] ""
532
  msgstr[1] ""
533
 
534
+ #: src/optimizations/revisions.php:152
 
 
 
 
535
  msgid "Clean post revisions which are older than %d weeks"
536
  msgstr ""
537
 
538
+ #: src/optimizations/revisions.php:154
539
  msgid "Clean all post revisions"
540
  msgstr ""
541
 
542
+ #: src/optimizations/revisions.php:159
543
  msgid "Remove auto revisions"
544
  msgstr ""
545
 
546
+ #: src/optimizations/spam.php:90
547
+ msgid "No spam or trashed comments found"
548
+ msgstr ""
549
+
550
+ #: src/optimizations/spam.php:106
551
  msgid "%s spam comment deleted"
552
  msgid_plural "%s spam comments deleted"
553
  msgstr[0] ""
554
  msgstr[1] ""
555
 
556
+ #: src/optimizations/spam.php:107
557
  msgid "%s comment removed from Trash"
558
  msgid_plural "%s comments removed from Trash"
559
  msgstr[0] ""
560
  msgstr[1] ""
561
 
562
+ #: src/optimizations/spam.php:173
563
  msgid "%s spam comment found"
564
  msgid_plural "%s spam comments found"
565
  msgstr[0] ""
566
  msgstr[1] ""
567
 
568
+ #: src/optimizations/spam.php:178, src/optimizations/spam.php:191
569
  msgid "Review"
570
  msgstr ""
571
 
572
+ #: src/optimizations/spam.php:182
573
  msgid "No spam comments found"
574
  msgstr ""
575
 
576
+ #: src/optimizations/spam.php:186
577
  msgid "%s trashed comment found"
578
  msgid_plural "%s trashed comments found"
579
  msgstr[0] ""
580
  msgstr[1] ""
581
 
582
+ #: src/optimizations/spam.php:194
583
  msgid "No trashed comments found"
584
  msgstr ""
585
 
586
+ #: src/optimizations/spam.php:248
587
  msgid "Remove spam and trashed comments which are older than %d weeks"
588
  msgstr ""
589
 
590
+ #: src/optimizations/spam.php:250, src/optimizations/spam.php:255
591
  msgid "Remove spam and trashed comments"
592
  msgstr ""
593
 
594
+ #: src/optimizations/trackbacks.php:58, src/optimizations/trackbacks.php:105
595
+ msgid "No trackbacks found"
596
+ msgstr ""
597
+
598
+ #: src/optimizations/trackbacks.php:66
599
  msgid "%s trackback deleted"
600
  msgid_plural "%s trackbacks deleted"
601
  msgstr[0] ""
602
  msgstr[1] ""
603
 
604
+ #: src/optimizations/trackbacks.php:103
605
  msgid "%s Trackback found"
606
  msgid_plural "%s Trackbacks found"
607
  msgstr[0] ""
608
  msgstr[1] ""
609
 
610
+ #: src/optimizations/trackbacks.php:123
611
+ msgid "Remove trackbacks"
612
  msgstr ""
613
 
614
+ #: src/optimizations/transient.php:141, src/optimizations/transient.php:147
615
+ msgid "Name"
616
+ msgstr ""
617
+
618
+ #: src/optimizations/transient.php:142, src/optimizations/transient.php:148
619
+ msgid "Value"
620
  msgstr ""
621
 
622
+ #: src/optimizations/transient.php:159, src/optimizations/transient.php:386
623
+ msgid "No transient options found"
624
+ msgstr ""
625
+
626
+ #: src/optimizations/transient.php:175
627
  msgid "%s transient option deleted"
628
  msgid_plural "%s transient options deleted"
629
  msgstr[0] ""
630
  msgstr[1] ""
631
 
632
+ #: src/optimizations/transient.php:252
633
  msgid "%s network-wide transient option deleted"
634
  msgid_plural "%s network-wide transient options deleted"
635
  msgstr[0] ""
636
  msgstr[1] ""
637
 
638
+ #: src/optimizations/transient.php:384
639
+ msgid "%1$d of %2$d transient option expired"
640
+ msgid_plural "%1$d of %2$d transient options expired"
641
  msgstr[0] ""
642
  msgstr[1] ""
643
 
644
+ #: src/optimizations/transient.php:390
645
+ msgid "across %d site"
646
+ msgid_plural "across %d sites"
647
+ msgstr[0] ""
648
+ msgstr[1] ""
649
 
650
+ #: src/optimizations/transient.php:402
651
+ msgid "%1$d of %2$d network-wide transient option found"
652
+ msgid_plural "%1$d of %2$d network-wide transient options found"
653
  msgstr[0] ""
654
  msgstr[1] ""
655
 
656
+ #: src/optimizations/transient.php:405
657
  msgid "No site-wide transient options found"
658
  msgstr ""
659
 
660
+ #: src/optimizations/transient.php:414
661
+ msgid "Remove all transient options (not only expired)"
662
+ msgstr ""
663
+
664
+ #: src/optimizations/transient.php:463, src/optimizations/transient.php:467
665
  msgid "Remove expired transient options"
666
  msgstr ""
667
 
668
+ #: src/optimizations/trash.php:85, src/optimizations/trash.php:165
669
+ msgid "No trashed posts found"
670
+ msgstr ""
671
+
672
+ #: src/optimizations/trash.php:93
673
  msgid "%s post removed from Trash"
674
  msgid_plural "%s posts removed from Trash"
675
  msgstr[0] ""
676
  msgstr[1] ""
677
 
678
+ #: src/optimizations/trash.php:163
679
  msgid "%s trashed post in your database"
680
  msgid_plural "%s trashed posts in your database"
681
  msgstr[0] ""
682
  msgstr[1] ""
683
 
684
+ #: src/optimizations/trash.php:204
 
 
 
 
685
  msgid "Clean trashed posts which are older than %d weeks"
686
  msgstr ""
687
 
688
+ #: src/optimizations/trash.php:206
689
  msgid "Clean all trashed posts"
690
  msgstr ""
691
 
692
+ #: src/optimizations/trash.php:216
693
  msgid "Remove trashed posts"
694
  msgstr ""
695
 
696
+ #: src/optimizations/unapproved.php:73, src/optimizations/unapproved.php:126
697
+ msgid "No unapproved comments found"
698
+ msgstr ""
699
+
700
+ #: src/optimizations/unapproved.php:81
701
  msgid "%s unapproved comment deleted"
702
  msgid_plural "%s unapproved comments deleted"
703
  msgstr[0] ""
704
  msgstr[1] ""
705
 
706
+ #: src/optimizations/unapproved.php:124
707
  msgid "%s unapproved comment found"
708
  msgid_plural "%s unapproved comments found"
709
  msgstr[0] ""
710
  msgstr[1] ""
711
 
712
+ #: src/optimizations/unapproved.php:158
 
 
 
 
713
  msgid "Remove unapproved comments which are older than %d weeks"
714
  msgstr ""
715
 
716
+ #: src/optimizations/unapproved.php:160, src/optimizations/unapproved.php:165
717
  msgid "Remove unapproved comments"
718
  msgstr ""
719
 
1307
  msgid "Total clean up overall:"
1308
  msgstr ""
1309
 
1310
+ #: src/templates/status-box-contents.php:131
1311
+ msgid "Your database has %s corrupted table."
1312
+ msgid_plural "Your database has %s corrupted tables."
1313
+ msgstr[0] ""
1314
+ msgstr[1] ""
1315
+
1316
+ #: src/templates/status-box-contents.php:132
1317
+ msgid "Repair corrupted tables here."
1318
+ msgstr ""
1319
+
1320
+ #: src/templates/status-box-contents.php:136
1321
  msgid "Support and feedback"
1322
  msgstr ""
1323
 
1324
+ #: src/templates/status-box-contents.php:138
1325
  msgid "If you like WP-Optimize,"
1326
  msgstr ""
1327
 
1328
+ #: src/templates/status-box-contents.php:138
1329
  msgid "please give us a positive review, here."
1330
  msgstr ""
1331
 
1332
+ #: src/templates/status-box-contents.php:138
1333
  msgid "Or, if you did not like it,"
1334
  msgstr ""
1335
 
1336
+ #: src/templates/status-box-contents.php:138
1337
  msgid "please tell us why at this link."
1338
  msgstr ""
1339
 
1340
+ #: src/templates/status-box-contents.php:139
1341
  msgid "Support is available here."
1342
  msgstr ""
1343
 
1419
  msgid "Follow this link to install UpdraftPlus, to take a backup before optimization"
1420
  msgstr ""
1421
 
1422
+ #: src/templates/take-a-backup.php:87
1423
  msgid "UpdraftPlus needs to be updated to 1.12.33 or higher in order to backup the database before optimization."
1424
  msgstr ""
1425
 
1426
+ #: src/templates/take-a-backup.php:87
1427
  msgid "Please update UpdraftPlus to the latest version."
1428
  msgstr ""
1429
 
1430
+ #: src/templates/take-a-backup.php:90
1431
+ msgid "UpdraftPlus is installed but currently not active. Follow this link to activate UpdraftPlus, to take a backup before optimization."
1432
+ msgstr ""
1433
+
1434
+ #: src/wp-optimize.php:269
1435
  msgid "WP-Optimize (Free) has been de-activated, because WP-Optimize Premium is active."
1436
  msgstr ""
1437
 
1438
+ #: src/wp-optimize.php:279
1439
  msgid "New feature: WP-Optimize Premium can now optimize all sites within a multisite install, not just the main one."
1440
  msgstr ""
1441
 
1442
+ #: src/wp-optimize.php:394
1443
  msgid "Table information"
1444
  msgstr ""
1445
 
1446
+ #: src/wp-optimize.php:394, src/wp-optimize.php:595
1447
  msgid "Settings"
1448
  msgstr ""
1449
 
1450
+ #: src/wp-optimize.php:394
1451
  msgid "Premium / Plugin family"
1452
  msgstr ""
1453
 
1454
+ #: src/wp-optimize.php:536
1455
  msgid "Automatic backup before optimizations"
1456
  msgstr ""
1457
 
1458
+ #: src/wp-optimize.php:537
1459
  msgid "An unexpected response was received."
1460
  msgstr ""
1461
 
1462
+ #: src/wp-optimize.php:538
1463
  msgid "Optimization complete"
1464
  msgstr ""
1465
 
1466
+ #: src/wp-optimize.php:539
1467
  msgid "Run optimizations"
1468
  msgstr ""
1469
 
1470
+ #: src/wp-optimize.php:540
1471
  msgid "Cancel"
1472
  msgstr ""
1473
 
1474
+ #: src/wp-optimize.php:541
1475
  msgid "Please, select settings file."
1476
  msgstr ""
1477
 
1478
+ #: src/wp-optimize.php:542
1479
  msgid "Are you sure you want to remove this logging destination?"
1480
  msgstr ""
1481
 
1482
+ #: src/wp-optimize.php:543
1483
  msgid "Before saving, you need to complete the currently incomplete settings (or remove them)."
1484
  msgstr ""
1485
 
1486
+ #: src/wp-optimize.php:544
1487
  msgid "%s was not repaired. For more details, please check your logs configured in logging destinations settings."
1488
  msgstr ""
1489
 
1490
+ #: src/wp-optimize.php:576
1491
  msgid "Optimize"
1492
  msgstr ""
1493
 
1494
+ #: src/wp-optimize.php:598
1495
  msgid "Optimizer"
1496
  msgstr ""
1497
 
1498
+ #: src/wp-optimize.php:614
1499
  msgid "Repair"
1500
  msgstr ""
1501
 
1502
+ #: src/wp-optimize.php:720
1503
  msgid "Warning"
1504
  msgstr ""
1505
 
1506
+ #: src/wp-optimize.php:720
1507
  msgid "WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working."
1508
  msgstr ""
1509
 
1510
+ #: src/wp-optimize.php:720
1511
  msgid "Read this page for a guide to possible causes and how to fix it."
1512
  msgstr ""
1513
 
1514
+ #: src/wp-optimize.php:787
1515
  msgid "Error:"
1516
  msgstr ""
1517
 
1518
+ #: src/wp-optimize.php:787
1519
  msgid "template not found"
1520
  msgstr ""
1521
 
1522
+ #: src/wp-optimize.php:839
1523
  msgid "Automatic Operation Completed"
1524
  msgstr ""
1525
 
1526
+ #: src/wp-optimize.php:841
1527
  msgid "Scheduled optimization was executed at"
1528
  msgstr ""
1529
 
1530
+ #: src/wp-optimize.php:842
1531
  msgid "You can safely delete this email."
1532
  msgstr ""
1533
 
1534
+ #: src/wp-optimize.php:844
1535
  msgid "Regards,"
1536
  msgstr ""
1537
 
1538
+ #: src/wp-optimize.php:845
1539
  msgid "WP-Optimize Plugin"
1540
  msgstr ""
1541
 
1542
+ #: src/wp-optimize.php:867
1543
  msgid "GB"
1544
  msgstr ""
1545
 
1546
+ #: src/wp-optimize.php:869
1547
  msgid "MB"
1548
  msgstr ""
1549
 
1550
+ #: src/wp-optimize.php:871
1551
  msgid "KB"
1552
  msgstr ""
1553
 
1554
+ #: src/wp-optimize.php:873
1555
  msgid "bytes"
1556
  msgstr ""
1557
 
1558
+ #: src/wp-optimize.php:1192
1559
+ msgid "You have no permissions to run optimizations."
1560
+ msgstr ""
1561
+
1562
+ #: src/wp-optimize.php:1199
1563
+ msgid "You have no permissions to manage WP-Optimize settings."
1564
+ msgstr ""
1565
+
1566
+ #: src/wp-optimize.php:1349
1567
  msgid "Only Network Administrator can activate WP-Optimize plugin."
1568
  msgstr ""
1569
 
1570
+ #: src/wp-optimize.php:1350
1571
  msgid "go back"
1572
  msgstr ""
optimizations/autodraft.php CHANGED
@@ -18,6 +18,63 @@ class WP_Optimization_autodraft extends WP_Optimization {
18
 
19
  protected $auto_id = 'drafts';
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  /**
22
  * Do actions after optimize() function.
23
  */
@@ -43,9 +100,19 @@ class WP_Optimization_autodraft extends WP_Optimization {
43
  $clean .= ' AND post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
44
  }
45
 
 
 
 
 
 
46
  $clean .= ';';
47
 
48
  $this->processed_count += $this->query($clean);
 
 
 
 
 
49
  }
50
 
51
  /**
@@ -63,6 +130,11 @@ class WP_Optimization_autodraft extends WP_Optimization {
63
  $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
64
  }
65
 
 
 
 
 
 
66
  $this->register_output($message);
67
 
68
  }
18
 
19
  protected $auto_id = 'drafts';
20
 
21
+ /**
22
+ * Prepare data for preview widget.
23
+ *
24
+ * @param array $params
25
+ *
26
+ * @return array
27
+ */
28
+ public function preview($params) {
29
+
30
+ // get data requested for preview.
31
+
32
+ $retention_subquery = '';
33
+
34
+ if ('true' == $this->retention_enabled) {
35
+ $retention_subquery = ' and post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
36
+ }
37
+
38
+ $sql = $this->wpdb->prepare(
39
+ "SELECT `ID`, `post_title`, `post_date` FROM `" . $this->wpdb->posts . "`".
40
+ " WHERE post_status = 'auto-draft'".
41
+ $retention_subquery.
42
+ " ORDER BY `ID` LIMIT %d, %d;",
43
+ array(
44
+ $params['offset'],
45
+ $params['limit'],
46
+ )
47
+ );
48
+
49
+ $posts = $this->wpdb->get_results($sql, ARRAY_A);
50
+
51
+ // fix empty revision titles.
52
+ if (!empty($posts)) {
53
+ foreach ($posts as $key => $post) {
54
+ $posts[$key]['post_title'] = '' == $post['post_title'] ? '('.__('no title', 'wp-optimize').')' : $post['post_title'];
55
+ }
56
+ }
57
+
58
+ // get total count auto-draft for optimization.
59
+ $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->posts . "` WHERE post_status = 'auto-draft' ".$retention_subquery.";";
60
+
61
+ $total = $this->wpdb->get_var($sql);
62
+
63
+ return array(
64
+ 'id_key' => 'ID',
65
+ 'columns' => array(
66
+ 'ID' => __('ID', 'wp-optimize'),
67
+ 'post_title' => __('Title', 'wp-optimize'),
68
+ 'post_date' => __('Date', 'wp-optimize'),
69
+ ),
70
+ 'offset' => $params['offset'],
71
+ 'limit' => $params['limit'],
72
+ 'total' => $total,
73
+ 'data' => $this->htmlentities_array($posts, array('ID')),
74
+ 'message' => $total > 0 ? '' : __('No auto draft posts found', 'wp-optimize'),
75
+ );
76
+ }
77
+
78
  /**
79
  * Do actions after optimize() function.
80
  */
100
  $clean .= ' AND post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
101
  }
102
 
103
+ // if posted ids in params, then remove only selected items. used by preview widget.
104
+ if (isset($this->data['ids'])) {
105
+ $clean .= ' AND `ID` in ('.join(',', $this->data['ids']).')';
106
+ }
107
+
108
  $clean .= ';';
109
 
110
  $this->processed_count += $this->query($clean);
111
+
112
+ // clean orphaned post meta.
113
+ $clean = "DELETE pm FROM `" . $this->wpdb->postmeta . "` pm LEFT JOIN `" . $this->wpdb->posts . "` p ON pm.post_id = p.ID WHERE p.ID IS NULL";
114
+ $this->query($clean);
115
+
116
  }
117
 
118
  /**
130
  $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
131
  }
132
 
133
+ // add preview link for output.
134
+ if (0 != $this->found_count && null != $this->found_count) {
135
+ $message = $this->get_preview_link($message);
136
+ }
137
+
138
  $this->register_output($message);
139
 
140
  }
optimizations/commentmeta.php CHANGED
@@ -14,6 +14,74 @@ class WP_Optimization_commentmeta extends WP_Optimization {
14
 
15
  private $found_akismet_count;
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Do actions before optimize() function.
19
  */
@@ -43,17 +111,29 @@ class WP_Optimization_commentmeta extends WP_Optimization {
43
  }
44
 
45
  /**
46
- * TODO: The first query here (but not the second) used to be run on a cron run.
47
  * This needs reviewing when we review the whole cron-run set of options.
48
  */
49
  public function optimize() {
50
- $clean = "DELETE FROM `" . $this->wpdb->commentmeta . "` WHERE comment_id NOT IN (SELECT comment_id FROM `" . $this->wpdb->comments . "`);";
 
 
 
 
 
 
 
51
 
52
  $commentstrash_meta = $this->query($clean);
53
  $this->processed_trash_count += $commentstrash_meta;
54
 
55
- // TODO: still need to test now cleaning up comments meta tables - removing akismet related settings.
56
- $clean = "DELETE FROM `" . $this->wpdb->commentmeta . "` WHERE meta_key LIKE '%akismet%';";
 
 
 
 
 
 
57
 
58
  $commentstrash_meta2 = $this->query($clean);
59
  $this->processed_akismet_count += $commentstrash_meta2;
@@ -92,6 +172,14 @@ class WP_Optimization_commentmeta extends WP_Optimization {
92
  $message1 .= $blogs_count_text;
93
  }
94
 
 
 
 
 
 
 
 
 
95
  $this->register_output($message);
96
  $this->register_output($message1);
97
 
14
 
15
  private $found_akismet_count;
16
 
17
+ /**
18
+ * Prepare data for preview widget.
19
+ *
20
+ * @param array $params
21
+ *
22
+ * @return array
23
+ */
24
+ public function preview($params) {
25
+
26
+ // get clicked comment type link.
27
+ $type = isset($params['type']) && 'akismet' == $params['type'] ? 'akismet' : 'trash';
28
+
29
+ // get data requested for preview.
30
+ $sql = $this->wpdb->prepare(
31
+ "SELECT * FROM `" . $this->wpdb->commentmeta . "`".
32
+ " WHERE ".
33
+ ('trash' == $type ? "comment_id NOT IN (SELECT comment_id FROM `" . $this->wpdb->comments . "`)" : "").
34
+ ('akismet' == $type ? "meta_key LIKE" : "").
35
+ " %s ORDER BY `comment_ID` LIMIT %d, %d;",
36
+ array(
37
+ ('akismet' == $type ? '%akismet%' : ''),
38
+ $params['offset'],
39
+ $params['limit'],
40
+ )
41
+ );
42
+
43
+ $posts = $this->wpdb->get_results($sql, ARRAY_A);
44
+
45
+ // fix empty revision titles.
46
+ if (!empty($posts)) {
47
+ foreach ($posts as $key => $post) {
48
+ $posts[$key]['post_title'] = array(
49
+ 'text' => '' == $post['post_title'] ? '('.__('no title', 'wp-optimize').')' : $post['post_title'],
50
+ 'url' => get_edit_post_link($post['ID']),
51
+ );
52
+ }
53
+ }
54
+
55
+ // get total count comments for optimization.
56
+ $sql = $this->wpdb->prepare(
57
+ "SELECT COUNT(*) FROM `" . $this->wpdb->comments . "`".
58
+ "WHERE ".
59
+ ('trash' == $type ? "comment_id NOT IN (SELECT comment_id FROM `" . $this->wpdb->comments . "`)" : "").
60
+ ('akismet' == $type ? "meta_key LIKE " : "").
61
+ " %s;",
62
+ array(
63
+ ('akismet' == $type ? '%akismet%' : ''),
64
+ )
65
+ );
66
+
67
+ $total = $this->wpdb->get_var($sql);
68
+
69
+ return array(
70
+ 'id_key' => 'meta_id',
71
+ 'columns' => array(
72
+ 'meta_id' => __('ID', 'wp-optimize'),
73
+ 'comment_id' => __('Comment ID', 'wp-optimize'),
74
+ 'meta_key' => __('Meta Key', 'wp-optimize'),
75
+ 'meta_value' => __('Meta Value', 'wp-optimize'),
76
+ ),
77
+ 'offset' => $params['offset'],
78
+ 'limit' => $params['limit'],
79
+ 'total' => $total,
80
+ 'data' => $this->htmlentities_array($posts, array('comment_ID')),
81
+ 'message' => $total > 0 ? '' : __('No orphaned comment meta data in your database', 'wp-optimize'),
82
+ );
83
+ }
84
+
85
  /**
86
  * Do actions before optimize() function.
87
  */
111
  }
112
 
113
  /**
 
114
  * This needs reviewing when we review the whole cron-run set of options.
115
  */
116
  public function optimize() {
117
+ $clean = "DELETE FROM `" . $this->wpdb->commentmeta . "` WHERE comment_id NOT IN (SELECT comment_id FROM `" . $this->wpdb->comments . "`)";
118
+
119
+ // if posted ids in params, then remove only selected items. used by preview widget.
120
+ if (isset($this->data['ids'])) {
121
+ $clean .= ' AND meta_id in ('.join(',', $this->data['ids']).')';
122
+ }
123
+
124
+ $clean .= ";";
125
 
126
  $commentstrash_meta = $this->query($clean);
127
  $this->processed_trash_count += $commentstrash_meta;
128
 
129
+ $clean = "DELETE FROM `" . $this->wpdb->commentmeta . "` WHERE meta_key LIKE '%akismet%'";
130
+
131
+ // if posted ids in params, then remove only selected items. used by preview widget.
132
+ if (isset($this->data['ids'])) {
133
+ $clean .= ' AND meta_id in ('.join(',', $this->data['ids']).')';
134
+ }
135
+
136
+ $clean .= ";";
137
 
138
  $commentstrash_meta2 = $this->query($clean);
139
  $this->processed_akismet_count += $commentstrash_meta2;
172
  $message1 .= $blogs_count_text;
173
  }
174
 
175
+ if ($this->found_trash_count > 0) {
176
+ $message = $this->get_preview_link($message, array('data-type' => 'trash'));
177
+ }
178
+
179
+ if ($this->found_akismet_count > 0) {
180
+ $message1 = $this->get_preview_link($message1, array('data-type' => 'akismet'));
181
+ }
182
+
183
  $this->register_output($message);
184
  $this->register_output($message1);
185
 
optimizations/optimizetables.php CHANGED
@@ -24,6 +24,8 @@ class WP_Optimization_optimizetables extends WP_Optimization {
24
 
25
  public $run_multisite = false;
26
 
 
 
27
  /**
28
  * Run optimization.
29
  */
@@ -60,7 +62,10 @@ class WP_Optimization_optimizetables extends WP_Optimization {
60
  $this->logger->info('Optimizing: ' . $table_obj->Name);
61
  $this->query('OPTIMIZE TABLE ' . $table_obj->Name);
62
 
63
- $this->optimizer->update_total_cleaned(strval($table_obj->Data_free));
 
 
 
64
 
65
  $this->register_output(__('Optimizing Table:', 'wp-optimize') . ' ' . $table_obj->Name);
66
  }
@@ -88,7 +93,7 @@ class WP_Optimization_optimizetables extends WP_Optimization {
88
  $this->register_output(sprintf(__('Other tables will be optimized (%s).', 'wp-optimize'), $tablesstatus['non_inno_db_tables']));
89
  }
90
 
91
- $faq_url = apply_filters('wpo_faq_url', 'https://wordpress.org/plugins/wp-optimize/#faq');
92
  $force_db_option = $this->options->get_option('innodb-force-optimize', 'false');
93
  $this->register_output('<input id="innodb_force_optimize" name="innodb-force-optimize" type="checkbox" value="true" '.checked($force_db_option, 'true').'><label for="innodb_force_optimize">'.__('Optimize InnoDB tables anyway.', 'wp-optimize').'</label><br><a href="'.$faq_url.'" target="_blank">'.__('Warning: you should read the FAQ on the risks of this operation first.', 'wp-optimize').'</a>');
94
  }
24
 
25
  public $run_multisite = false;
26
 
27
+ public $support_preview = false;
28
+
29
  /**
30
  * Run optimization.
31
  */
62
  $this->logger->info('Optimizing: ' . $table_obj->Name);
63
  $this->query('OPTIMIZE TABLE ' . $table_obj->Name);
64
 
65
+ // For InnoDB Data_free doesn't contain free size.
66
+ if ('InnoDB' != $table_obj->Engine) {
67
+ $this->optimizer->update_total_cleaned(strval($table_obj->Data_free));
68
+ }
69
 
70
  $this->register_output(__('Optimizing Table:', 'wp-optimize') . ' ' . $table_obj->Name);
71
  }
93
  $this->register_output(sprintf(__('Other tables will be optimized (%s).', 'wp-optimize'), $tablesstatus['non_inno_db_tables']));
94
  }
95
 
96
+ $faq_url = apply_filters('wpo_faq_url', 'https://getwpo.com/faqs/');
97
  $force_db_option = $this->options->get_option('innodb-force-optimize', 'false');
98
  $this->register_output('<input id="innodb_force_optimize" name="innodb-force-optimize" type="checkbox" value="true" '.checked($force_db_option, 'true').'><label for="innodb_force_optimize">'.__('Optimize InnoDB tables anyway.', 'wp-optimize').'</label><br><a href="'.$faq_url.'" target="_blank">'.__('Warning: you should read the FAQ on the risks of this operation first.', 'wp-optimize').'</a>');
99
  }
optimizations/orphandata.php CHANGED
@@ -6,6 +6,8 @@ class WP_Optimization_orphandata extends WP_Optimization {
6
 
7
  public $ui_sort_order = 10000;
8
 
 
 
9
  /**
10
  * Do actions after optimize() function.
11
  */
@@ -18,7 +20,6 @@ class WP_Optimization_orphandata extends WP_Optimization {
18
 
19
  $this->logger->info($message);
20
  $this->register_output($message);
21
-
22
  }
23
 
24
  /**
6
 
7
  public $ui_sort_order = 10000;
8
 
9
+ public $support_preview = false;
10
+
11
  /**
12
  * Do actions after optimize() function.
13
  */
20
 
21
  $this->logger->info($message);
22
  $this->register_output($message);
 
23
  }
24
 
25
  /**
optimizations/pingbacks.php CHANGED
@@ -6,6 +6,58 @@ class WP_Optimization_pingbacks extends WP_Optimization {
6
 
7
  public $ui_sort_order = 6000;
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  /**
10
  * Do actions after optimize() function.
11
  */
@@ -24,10 +76,21 @@ class WP_Optimization_pingbacks extends WP_Optimization {
24
  * Do optimization.
25
  */
26
  public function optimize() {
27
- $clean = "DELETE FROM `" . $this->wpdb->comments . "` WHERE comment_type = 'pingback';";
 
 
 
 
 
 
 
28
 
29
  $comments = $this->query($clean);
30
  $this->processed_count += $comments;
 
 
 
 
31
  }
32
 
33
  /**
@@ -44,6 +107,11 @@ class WP_Optimization_pingbacks extends WP_Optimization {
44
  $message .= ' '.sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
45
  }
46
 
 
 
 
 
 
47
  $this->register_output($message);
48
  }
49
 
6
 
7
  public $ui_sort_order = 6000;
8
 
9
+ /**
10
+ * Prepare data for preview widget.
11
+ *
12
+ * @param array $params
13
+ *
14
+ * @return array
15
+ */
16
+ public function preview($params) {
17
+
18
+ // get data requested for preview.
19
+ $sql = $this->wpdb->prepare(
20
+ "SELECT comment_ID, comment_author, SUBSTR(comment_content, 1, 128) AS comment_content FROM `" . $this->wpdb->comments . "`".
21
+ " WHERE comment_type = 'pingback'".
22
+ " ORDER BY `comment_ID` LIMIT %d, %d;",
23
+ array(
24
+ $params['offset'],
25
+ $params['limit'],
26
+ )
27
+ );
28
+
29
+ $posts = $this->wpdb->get_results($sql, ARRAY_A);
30
+
31
+ // fix empty revision titles.
32
+ if (!empty($posts)) {
33
+ foreach ($posts as $key => $post) {
34
+ $posts[$key]['post_title'] = array(
35
+ 'text' => '' == $post['post_title'] ? '('.__('no title', 'wp-optimize').')' : $post['post_title'],
36
+ 'url' => get_edit_post_link($post['ID']),
37
+ );
38
+ }
39
+ }
40
+
41
+ // get total count comments for optimization.
42
+ $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->comments . "` WHERE comment_type = 'pingback';";
43
+
44
+ $total = $this->wpdb->get_var($sql);
45
+
46
+ return array(
47
+ 'id_key' => 'comment_ID',
48
+ 'columns' => array(
49
+ 'comment_ID' => __('ID', 'wp-optimize'),
50
+ 'comment_author' => __('Author', 'wp-optimize'),
51
+ 'comment_content' => __('Comment', 'wp-optimize'),
52
+ ),
53
+ 'offset' => $params['offset'],
54
+ 'limit' => $params['limit'],
55
+ 'total' => $total,
56
+ 'data' => $this->htmlentities_array($posts, array('comment_ID')),
57
+ 'message' => $total > 0 ? '' : __('No pingbacks found', 'wp-optimize'),
58
+ );
59
+ }
60
+
61
  /**
62
  * Do actions after optimize() function.
63
  */
76
  * Do optimization.
77
  */
78
  public function optimize() {
79
+ $clean = "DELETE FROM `" . $this->wpdb->comments . "` WHERE comment_type = 'pingback'";
80
+
81
+ // if posted ids in params, then remove only selected items. used by preview widget.
82
+ if (isset($this->data['ids'])) {
83
+ $clean .= ' AND comment_ID in ('.join(',', $this->data['ids']).')';
84
+ }
85
+
86
+ $clean .= ";";
87
 
88
  $comments = $this->query($clean);
89
  $this->processed_count += $comments;
90
+
91
+ // clean orphaned comment meta
92
+ $clean = "DELETE cm FROM `" . $this->wpdb->commentmeta . "` cm LEFT JOIN `" . $this->wpdb->comments . "` c ON cm.comment_id = c.comment_ID WHERE c.comment_ID IS NULL";
93
+ $this->query($clean);
94
  }
95
 
96
  /**
107
  $message .= ' '.sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
108
  }
109
 
110
+ // add preview link to message.
111
+ if ($this->found_count > 0) {
112
+ $message = $this->get_preview_link($message);
113
+ }
114
+
115
  $this->register_output($message);
116
  }
117
 
optimizations/postmeta.php CHANGED
@@ -10,6 +10,49 @@ class WP_Optimization_postmeta extends WP_Optimization {
10
 
11
  public $auto_default = false;
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  /**
14
  * Do actions after optimize() function.
15
  */
@@ -28,7 +71,14 @@ class WP_Optimization_postmeta extends WP_Optimization {
28
  * Do optimization.
29
  */
30
  public function optimize() {
31
- $clean = "DELETE pm FROM `" . $this->wpdb->postmeta . "` pm LEFT JOIN `" . $this->wpdb->posts . "` wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL;";
 
 
 
 
 
 
 
32
 
33
  $postmeta = $this->query($clean);
34
  $this->processed_count += $postmeta;
@@ -48,6 +98,11 @@ class WP_Optimization_postmeta extends WP_Optimization {
48
  $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
49
  }
50
 
 
 
 
 
 
51
  $this->register_output($message);
52
  }
53
 
10
 
11
  public $auto_default = false;
12
 
13
+ /**
14
+ * Prepare data for preview widget.
15
+ *
16
+ * @param array $params
17
+ *
18
+ * @return array
19
+ */
20
+ public function preview($params) {
21
+ // get data requested for preview.
22
+ $sql = $this->wpdb->prepare(
23
+ "SELECT pm.* FROM `" . $this->wpdb->postmeta . "` pm".
24
+ " LEFT JOIN `" . $this->wpdb->posts . "` wp ON wp.ID = pm.post_id".
25
+ " WHERE wp.ID IS NULL".
26
+ " ORDER BY pm.meta_id LIMIT %d, %d;",
27
+ array(
28
+ $params['offset'],
29
+ $params['limit'],
30
+ )
31
+ );
32
+
33
+ $posts = $this->wpdb->get_results($sql, ARRAY_A);
34
+
35
+ // get total count post meta for optimization.
36
+ $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->postmeta . "` pm LEFT JOIN `" . $this->wpdb->posts . "` wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL;";
37
+
38
+ $total = $this->wpdb->get_var($sql);
39
+
40
+ return array(
41
+ 'id_key' => 'meta_id',
42
+ 'columns' => array(
43
+ 'meta_id' => __('ID', 'wp-optimize'),
44
+ 'post_id' => __('Post ID', 'wp-optimize'),
45
+ 'meta_key' => __('Meta Key', 'wp-optimize'),
46
+ 'meta_value' => __('Meta Value', 'wp-optimize'),
47
+ ),
48
+ 'offset' => $params['offset'],
49
+ 'limit' => $params['limit'],
50
+ 'total' => $total,
51
+ 'data' => $this->htmlentities_array($posts, array('ID')),
52
+ 'message' => $total > 0 ? '' : __('No orphaned post meta data in your database', 'wp-optimize'),
53
+ );
54
+ }
55
+
56
  /**
57
  * Do actions after optimize() function.
58
  */
71
  * Do optimization.
72
  */
73
  public function optimize() {
74
+ $clean = "DELETE pm FROM `" . $this->wpdb->postmeta . "` pm LEFT JOIN `" . $this->wpdb->posts . "` wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL";
75
+
76
+ // if posted ids in params, then remove only selected items. used by preview widget.
77
+ if (isset($this->data['ids'])) {
78
+ $clean .= ' AND pm.meta_id in ('.join(',', $this->data['ids']).')';
79
+ }
80
+
81
+ $clean .= ";";
82
 
83
  $postmeta = $this->query($clean);
84
  $this->processed_count += $postmeta;
98
  $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
99
  }
100
 
101
+ // add preview link to message.
102
+ if ($this->found_count > 0) {
103
+ $message = $this->get_preview_link($message);
104
+ }
105
+
106
  $this->register_output($message);
107
  }
108
 
optimizations/repairtables.php CHANGED
@@ -12,6 +12,8 @@ class WP_Optimization_repairtables extends WP_Optimization {
12
 
13
  public $run_multisite = false;
14
 
 
 
15
  /**
16
  * Display or hide optimization in optimizations list.
17
  *
@@ -100,13 +102,17 @@ class WP_Optimization_repairtables extends WP_Optimization {
100
  }
101
  }
102
 
 
 
 
103
  return $success;
104
  }
105
 
106
  /**
107
- * Register info about optimization.
 
108
  */
109
- public function get_info() {
110
  $tablesinfo = $this->optimizer->get_tables();
111
 
112
  $corrupted_tables = 0;
@@ -119,6 +125,19 @@ class WP_Optimization_repairtables extends WP_Optimization {
119
  }
120
  }
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  if (0 == $corrupted_tables) {
123
  $this->register_output(__('No corrupted tables found', 'wp-optimize'));
124
  } else {
12
 
13
  public $run_multisite = false;
14
 
15
+ public $support_preview = false;
16
+
17
  /**
18
  * Display or hide optimization in optimizations list.
19
  *
102
  }
103
  }
104
 
105
+ // update info in options table and use it to notify user about corrupted tables.
106
+ $this->get_corrupted_tables_count();
107
+
108
  return $success;
109
  }
110
 
111
  /**
112
+ * Returns count of corrupted tables and update corrupted-tables-count value in options used to show
113
+ * information for user in sidebar about corrupted tables count.
114
  */
115
+ public function get_corrupted_tables_count() {
116
  $tablesinfo = $this->optimizer->get_tables();
117
 
118
  $corrupted_tables = 0;
125
  }
126
  }
127
 
128
+ // save results to options table and use it to notify user about corrupted tables.
129
+ $this->options->update_option('corrupted-tables-count', $corrupted_tables);
130
+
131
+ return $corrupted_tables;
132
+ }
133
+
134
+ /**
135
+ * Register info about optimization.
136
+ */
137
+ public function get_info() {
138
+
139
+ $corrupted_tables = $this->get_corrupted_tables_count();
140
+
141
  if (0 == $corrupted_tables) {
142
  $this->register_output(__('No corrupted tables found', 'wp-optimize'));
143
  } else {
optimizations/revisions.php CHANGED
@@ -14,6 +14,63 @@ class WP_Optimization_revisions extends WP_Optimization {
14
 
15
  public $available_for_saving = true;
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Do actions after optimize() function.
19
  */
@@ -28,7 +85,6 @@ class WP_Optimization_revisions extends WP_Optimization {
28
  $this->register_output($message);
29
  }
30
 
31
-
32
  /**
33
  * Do optimization.
34
  */
@@ -39,10 +95,20 @@ class WP_Optimization_revisions extends WP_Optimization {
39
  $clean .= '
40
  AND post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
41
  }
 
 
 
 
 
 
42
  $clean .= ';';
43
 
44
  $revisions = $this->query($clean);
45
  $this->processed_count += $revisions;
 
 
 
 
46
  }
47
 
48
  /**
@@ -59,6 +125,11 @@ class WP_Optimization_revisions extends WP_Optimization {
59
  $message .= ' '.sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
60
  }
61
 
 
 
 
 
 
62
  $this->register_output($message);
63
  }
64
 
14
 
15
  public $available_for_saving = true;
16
 
17
+ /**
18
+ * Prepare data for preview widget.
19
+ *
20
+ * @param array $params
21
+ *
22
+ * @return array
23
+ */
24
+ public function preview($params) {
25
+
26
+ $retention_subquery = '';
27
+
28
+ if ('true' == $this->retention_enabled) {
29
+ $retention_subquery = ' and post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
30
+ }
31
+
32
+ // get data requested for preview.
33
+ $sql = $this->wpdb->prepare(
34
+ "SELECT `ID`, `post_title`, `post_date`".
35
+ " FROM `" . $this->wpdb->posts . "`".
36
+ " WHERE post_type = 'revision'".
37
+ $retention_subquery.
38
+ " ORDER BY `ID` LIMIT %d, %d;",
39
+ array(
40
+ $params['offset'],
41
+ $params['limit'],
42
+ )
43
+ );
44
+
45
+ $posts = $this->wpdb->get_results($sql, ARRAY_A);
46
+
47
+ // fix empty revision titles.
48
+ if (!empty($posts)) {
49
+ foreach ($posts as $key => $post) {
50
+ $posts[$key]['post_title'] = '' == $post['post_title'] ? '('.__('no title', 'wp-optimize').')' : $post['post_title'];
51
+ }
52
+ }
53
+
54
+ // get total count revisions for optimization.
55
+ $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->posts . "` WHERE post_type = 'revision'".$retention_subquery.";";
56
+
57
+ $total = $this->wpdb->get_var($sql);
58
+
59
+ return array(
60
+ 'id_key' => 'ID',
61
+ 'columns' => array(
62
+ 'ID' => __('ID', 'wp-optimize'),
63
+ 'post_title' => __('Title', 'wp-optimize'),
64
+ 'post_date' => __('Date', 'wp-optimize'),
65
+ ),
66
+ 'offset' => $params['offset'],
67
+ 'limit' => $params['limit'],
68
+ 'total' => $total,
69
+ 'data' => $this->htmlentities_array($posts, array('ID')),
70
+ 'message' => $total > 0 ? '' : __('No post revisions found', 'wp-optimize'),
71
+ );
72
+ }
73
+
74
  /**
75
  * Do actions after optimize() function.
76
  */
85
  $this->register_output($message);
86
  }
87
 
 
88
  /**
89
  * Do optimization.
90
  */
95
  $clean .= '
96
  AND post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
97
  }
98
+
99
+ // if posted ids in params, then remove only selected items. used by preview widget.
100
+ if (isset($this->data['ids'])) {
101
+ $clean .= ' AND `ID` in ('.join(',', $this->data['ids']).')';
102
+ }
103
+
104
  $clean .= ';';
105
 
106
  $revisions = $this->query($clean);
107
  $this->processed_count += $revisions;
108
+
109
+ // clean orphaned post meta.
110
+ $clean = "DELETE pm FROM `" . $this->wpdb->postmeta . "` pm LEFT JOIN `" . $this->wpdb->posts . "` p ON pm.post_id = p.ID WHERE p.ID IS NULL";
111
+ $this->query($clean);
112
  }
113
 
114
  /**
125
  $message .= ' '.sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
126
  }
127
 
128
+ // add preview link to message.
129
+ if ($this->found_count > 0) {
130
+ $message = $this->get_preview_link($message);
131
+ }
132
+
133
  $this->register_output($message);
134
  }
135
 
optimizations/spam.php CHANGED
@@ -28,6 +28,69 @@ class WP_Optimization_spam extends WP_Optimization {
28
 
29
  private $found_trash_count;
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  /**
32
  * Do actions before optimize() function.
33
  */
@@ -84,6 +147,11 @@ class WP_Optimization_spam extends WP_Optimization {
84
  $clean .= ' and c.comment_date < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
85
  }
86
 
 
 
 
 
 
87
  $clean .= ';';
88
  return $this->query($clean);
89
  }
@@ -102,13 +170,26 @@ class WP_Optimization_spam extends WP_Optimization {
102
  public function after_get_info() {
103
 
104
  if ($this->found_spam_count > 0) {
105
- $message = sprintf(_n('%s spam comment found', '%s spam comments found', $this->found_spam_count, 'wp-optimize'), number_format_i18n($this->found_spam_count)).' | <a id="wp-optimize-edit-comments-spam" href="'.admin_url('edit-comments.php?comment_status=spam').'">'.' '.__('Review', 'wp-optimize').'</a>';
 
 
 
 
 
 
 
106
  } else {
107
  $message = __('No spam comments found', 'wp-optimize');
108
  }
109
 
110
  if ($this->found_trash_count > 0) {
111
- $message1 = sprintf(_n('%s trashed comment found', '%s trashed comments found', $this->found_trash_count, 'wp-optimize'), number_format_i18n($this->found_trash_count)).' | <a id="wp-optimize-edit-comments-trash" href="'.admin_url('edit-comments.php?comment_status=trash').'">'.' '.__('Review', 'wp-optimize').'</a>';
 
 
 
 
 
 
112
  } else {
113
  $message1 = __('No trashed comments found', 'wp-optimize');
114
  }
@@ -120,6 +201,16 @@ class WP_Optimization_spam extends WP_Optimization {
120
  $message1 .= ' '.$blogs_count_text;
121
  }
122
 
 
 
 
 
 
 
 
 
 
 
123
  $this->register_output($message);
124
  $this->register_output($message1);
125
  }
28
 
29
  private $found_trash_count;
30
 
31
+ /**
32
+ * Prepare data for preview widget.
33
+ *
34
+ * @param array $params
35
+ *
36
+ * @return array
37
+ */
38
+ public function preview($params) {
39
+
40
+ // get clicked comment type link.
41
+ $type = isset($params['type']) && 'spam' == $params['type'] ? 'spam' : 'trash';
42
+
43
+ $retention_subquery = '';
44
+
45
+ if ('true' == $this->retention_enabled) {
46
+ $retention_subquery = ' and comment_date < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
47
+ }
48
+
49
+ // get data requested for preview.
50
+ $sql = $this->wpdb->prepare(
51
+ "SELECT comment_ID, comment_author, SUBSTR(comment_content, 1, 128) AS comment_content FROM".
52
+ " `" . $this->wpdb->comments . "`".
53
+ " WHERE comment_approved = '{$type}'".
54
+ $retention_subquery.
55
+ " ORDER BY `comment_ID` LIMIT %d, %d;",
56
+ array(
57
+ $params['offset'],
58
+ $params['limit'],
59
+ )
60
+ );
61
+
62
+ $posts = $this->wpdb->get_results($sql, ARRAY_A);
63
+
64
+ // fix empty revision titles.
65
+ if (!empty($posts)) {
66
+ foreach ($posts as $key => $post) {
67
+ $posts[$key]['post_title'] = array(
68
+ 'text' => '' == $post['post_title'] ? '('.__('no title', 'wp-optimize').')' : $post['post_title'],
69
+ 'url' => get_edit_post_link($post['ID']),
70
+ );
71
+ }
72
+ }
73
+
74
+ // get total count comments for optimization.
75
+ $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->comments . "` WHERE comment_approved = '{$type}' ".$retention_subquery.";";
76
+
77
+ $total = $this->wpdb->get_var($sql);
78
+
79
+ return array(
80
+ 'id_key' => 'comment_ID',
81
+ 'columns' => array(
82
+ 'comment_ID' => __('ID', 'wp-optimize'),
83
+ 'comment_author' => __('Author', 'wp-optimize'),
84
+ 'comment_content' => __('Comment', 'wp-optimize'),
85
+ ),
86
+ 'offset' => $params['offset'],
87
+ 'limit' => $params['limit'],
88
+ 'total' => $total,
89
+ 'data' => $this->htmlentities_array($posts, array('comment_ID')),
90
+ 'message' => $total > 0 ? '' : __('No spam or trashed comments found', 'wp-optimize'),
91
+ );
92
+ }
93
+
94
  /**
95
  * Do actions before optimize() function.
96
  */
147
  $clean .= ' and c.comment_date < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
148
  }
149
 
150
+ // if posted ids in params, then remove only selected items. used by preview widget.
151
+ if (isset($this->data['ids'])) {
152
+ $clean .= ' AND c.comment_ID in ('.join(',', $this->data['ids']).')';
153
+ }
154
+
155
  $clean .= ';';
156
  return $this->query($clean);
157
  }
170
  public function after_get_info() {
171
 
172
  if ($this->found_spam_count > 0) {
173
+ $message = sprintf(_n('%s spam comment found', '%s spam comments found', $this->found_spam_count, 'wp-optimize'), number_format_i18n($this->found_spam_count));
174
+
175
+ // if current version is not premium and Preview feature not supported then
176
+ // add to message Review link to comments page
177
+ if (!WP_Optimize::is_premium()) {
178
+ $message .= ' | <a id="wp-optimize-edit-comments-spam" href="'.admin_url('edit-comments.php?comment_status=spam').'">'.' '.__('Review', 'wp-optimize').'</a>';
179
+ }
180
+
181
  } else {
182
  $message = __('No spam comments found', 'wp-optimize');
183
  }
184
 
185
  if ($this->found_trash_count > 0) {
186
+ $message1 = sprintf(_n('%s trashed comment found', '%s trashed comments found', $this->found_trash_count, 'wp-optimize'), number_format_i18n($this->found_trash_count));
187
+
188
+ // if current version is not premium and Preview feature not supported then
189
+ // add to message Review link to comments page
190
+ if (!WP_Optimize::is_premium()) {
191
+ $message .= ' | <a id="wp-optimize-edit-comments-trash" href="'.admin_url('edit-comments.php?comment_status=trash').'">'.' '.__('Review', 'wp-optimize').'</a>';
192
+ }
193
  } else {
194
  $message1 = __('No trashed comments found', 'wp-optimize');
195
  }
201
  $message1 .= ' '.$blogs_count_text;
202
  }
203
 
204
+ // add preview link to message.
205
+ if ($this->found_spam_count > 0) {
206
+ $message = $this->get_preview_link($message, array('data-type' => 'spam'));
207
+ }
208
+
209
+ // add preview link to message.
210
+ if ($this->found_trash_count > 0) {
211
+ $message = $this->get_preview_link($message1, array('data-type' => 'trash'));
212
+ }
213
+
214
  $this->register_output($message);
215
  $this->register_output($message1);
216
  }
optimizations/trackbacks.php CHANGED
@@ -6,6 +6,59 @@ class WP_Optimization_trackbacks extends WP_Optimization {
6
 
7
  public $ui_sort_order = 7000;
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  /**
10
  * Do actions after optimize() function.
11
  */
@@ -16,6 +69,11 @@ class WP_Optimization_trackbacks extends WP_Optimization {
16
  $message .= ' '. sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
17
  }
18
 
 
 
 
 
 
19
  $this->logger->info($message);
20
  $this->register_output($message);
21
  }
@@ -24,7 +82,14 @@ class WP_Optimization_trackbacks extends WP_Optimization {
24
  * Do optimization.
25
  */
26
  public function optimize() {
27
- $clean = "DELETE c, cm FROM `" . $this->wpdb->comments . "` c LEFT JOIN `" . $this->wpdb->commentmeta . "` cm ON c.comment_ID = cm.comment_id WHERE comment_type = 'trackback';";
 
 
 
 
 
 
 
28
 
29
  $comments = $this->query($clean);
30
  $this->processed_count += $comments;
6
 
7
  public $ui_sort_order = 7000;
8
 
9
+ /**
10
+ * Prepare data for preview widget.
11
+ *
12
+ * @param array $params
13
+ *
14
+ * @return array
15
+ */
16
+ public function preview($params) {
17
+
18
+ // get data requested for preview.
19
+ $sql = $this->wpdb->prepare(
20
+ "SELECT comment_ID, comment_author, SUBSTR(comment_content, 1, 128) AS comment_content".
21
+ " FROM `" . $this->wpdb->comments . "`".
22
+ " WHERE comment_type = 'trackback'".
23
+ " ORDER BY `comment_ID` LIMIT %d, %d;",
24
+ array(
25
+ $params['offset'],
26
+ $params['limit'],
27
+ )
28
+ );
29
+
30
+ $posts = $this->wpdb->get_results($sql, ARRAY_A);
31
+
32
+ // fix empty revision titles.
33
+ if (!empty($posts)) {
34
+ foreach ($posts as $key => $post) {
35
+ $posts[$key]['post_title'] = array(
36
+ 'text' => '' == $post['post_title'] ? '('.__('no title', 'wp-optimize').')' : $post['post_title'],
37
+ 'url' => get_edit_post_link($post['ID']),
38
+ );
39
+ }
40
+ }
41
+
42
+ // get total count comments for optimization.
43
+ $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->comments . "` WHERE comment_type = 'trackback';";
44
+
45
+ $total = $this->wpdb->get_var($sql);
46
+
47
+ return array(
48
+ 'id_key' => 'comment_ID',
49
+ 'columns' => array(
50
+ 'comment_ID' => __('ID', 'wp-optimize'),
51
+ 'comment_author' => __('Author', 'wp-optimize'),
52
+ 'comment_content' => __('Comment', 'wp-optimize'),
53
+ ),
54
+ 'offset' => $params['offset'],
55
+ 'limit' => $params['limit'],
56
+ 'total' => $total,
57
+ 'data' => $this->htmlentities_array($posts, array('comment_ID')),
58
+ 'message' => $total > 0 ? '' : __('No trackbacks found', 'wp-optimize'),
59
+ );
60
+ }
61
+
62
  /**
63
  * Do actions after optimize() function.
64
  */
69
  $message .= ' '. sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
70
  }
71
 
72
+ // add preview link for output.
73
+ if (0 != $this->found_count && null != $this->found_count) {
74
+ $message = $this->get_preview_link($message);
75
+ }
76
+
77
  $this->logger->info($message);
78
  $this->register_output($message);
79
  }
82
  * Do optimization.
83
  */
84
  public function optimize() {
85
+ $clean = "DELETE c, cm FROM `" . $this->wpdb->comments . "` c LEFT JOIN `" . $this->wpdb->commentmeta . "` cm ON c.comment_ID = cm.comment_id WHERE comment_type = 'trackback'";
86
+
87
+ // if posted ids in params, then remove only selected items. used by preview widget.
88
+ if (isset($this->data['ids'])) {
89
+ $clean .= ' AND comment_ID in ('.join(',', $this->data['ids']).')';
90
+ }
91
+
92
+ $clean .= ";";
93
 
94
  $comments = $this->query($clean);
95
  $this->processed_count += $comments;
optimizations/transient.php CHANGED
@@ -10,7 +10,155 @@ class WP_Optimization_transient extends WP_Optimization {
10
 
11
  public $ui_sort_order = 5000;
12
 
13
- public $run_multisite = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  /**
16
  * Do actions before optimize() function.
@@ -35,7 +183,43 @@ class WP_Optimization_transient extends WP_Optimization {
35
 
36
  // Delete transients from multisite, if configured as such.
37
  if (is_multisite() && is_main_network()) {
38
- $clean2 = "
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  DELETE
40
  a
41
  FROM
@@ -50,22 +234,20 @@ class WP_Optimization_transient extends WP_Optimization {
50
  CHAR_LENGTH('_site_transient_') + 1
51
  )
52
  )
53
- AND b.meta_value < UNIX_TIMESTAMP()
54
- ";
55
 
56
- $sitemeta_table_transients_deleted = $this->query($clean2);
57
-
58
- $clean2_timeouts = "
59
  DELETE
60
  b
61
  FROM
62
  " . $this->wpdb->options . " b
63
  WHERE
64
- b.option_name LIKE '_site_transient_timeout_%' AND
65
- b.option_value < UNIX_TIMESTAMP()
66
- ";
67
 
68
- $this->query($clean2_timeouts);
 
69
 
70
  $message2 = sprintf(_n('%s network-wide transient option deleted', '%s network-wide transient options deleted', $sitemeta_table_transients_deleted, 'wp-optimize'), number_format_i18n($sitemeta_table_transients_deleted));
71
 
@@ -79,39 +261,79 @@ class WP_Optimization_transient extends WP_Optimization {
79
  */
80
  public function optimize() {
81
 
82
- // clean transients rows.
83
- $clean = "
84
- DELETE
85
- a
86
- FROM
87
- " . $this->wpdb->options . " a, " . $this->wpdb->options . " b
88
- WHERE
89
- a.option_name LIKE '_transient_%' AND
90
- b.option_name = CONCAT(
91
- '_transient_timeout_',
92
- SUBSTRING(
93
- a.option_name,
94
- CHAR_LENGTH('_transient_') + 1
95
- )
96
- )
97
- AND b.option_value < UNIX_TIMESTAMP()
98
- ";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  $options_table_transients_deleted = $this->query($clean);
101
  $this->processed_count += $options_table_transients_deleted;
102
 
103
- // clean transient timeouts rows.
104
- $clean_timeouts = "
105
- DELETE
106
- b
107
- FROM
108
- " . $this->wpdb->options . " b
109
- WHERE
110
- b.option_name LIKE '_transient_timeout_%' AND
111
- b.option_value < UNIX_TIMESTAMP()
112
- ";
113
-
114
- $this->query($clean_timeouts);
115
  }
116
 
117
  /**
@@ -119,6 +341,7 @@ class WP_Optimization_transient extends WP_Optimization {
119
  */
120
  public function before_get_info() {
121
  $this->found_count = 0;
 
122
  }
123
 
124
  /**
@@ -131,46 +354,65 @@ class WP_Optimization_transient extends WP_Optimization {
131
  SELECT
132
  COUNT(*)
133
  FROM
134
- ".$this->wpdb->sitemeta." a, ".$this->wpdb->sitemeta." b
135
- WHERE
136
- a.meta_key LIKE '_site_transient_%' AND
137
- a.meta_key NOT LIKE '_site_transient_timeout_%' AND
138
  b.meta_key = CONCAT(
139
  '_site_transient_timeout_',
140
  SUBSTRING(
141
  a.meta_key,
142
  CHAR_LENGTH('_site_transient_') + 1
143
  )
144
- )
145
- AND b.meta_value < UNIX_TIMESTAMP()
146
- ";
 
 
 
147
 
148
- $sitemeta_table_transients = $this->wpdb->get_var($sitemeta_table_sql);
 
 
 
149
  } else {
150
  $sitemeta_table_transients = 0;
 
151
  }
152
 
153
- if ($this->found_count > 0) {
154
- $message = sprintf(_n('%s transient option found', '%s transient options found', $this->found_count, 'wp-optimize'), number_format_i18n($this->found_count));
155
  } else {
156
  $message = __('No transient options found', 'wp-optimize');
157
  }
158
 
159
  if ($this->is_multisite_mode()) {
160
- $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
 
 
 
 
 
161
  }
162
 
163
  $this->register_output($message);
164
 
165
  if ($this->is_multisite_mode()) {
166
- if ($sitemeta_table_transients > 0) {
167
- $message2 = sprintf(_n('%d network-wide transient option found', '%d network-wide transient options found', $sitemeta_table_transients, 'wp-optimize'), number_format_i18n($sitemeta_table_transients));
 
168
  } else {
169
  $message2 = __('No site-wide transient options found', 'wp-optimize');
170
  }
171
 
172
  $this->register_output($message2);
173
  }
 
 
 
 
 
 
174
  }
175
 
176
  /**
@@ -187,10 +429,10 @@ class WP_Optimization_transient extends WP_Optimization {
187
  SELECT
188
  COUNT(*)
189
  FROM
190
- " . $this->wpdb->options . " a, " . $this->wpdb->options . " b
191
- WHERE
192
- a.option_name LIKE '_transient_%' AND
193
- a.option_name NOT LIKE '_transient_timeout_%' AND
194
  b.option_name = CONCAT(
195
  '_transient_timeout_',
196
  SUBSTRING(
@@ -198,10 +440,20 @@ class WP_Optimization_transient extends WP_Optimization {
198
  CHAR_LENGTH('_transient_') + 1
199
  )
200
  )
201
- AND b.option_value < UNIX_TIMESTAMP()";
 
 
 
202
 
203
- $options_table_transients = $this->wpdb->get_var($options_table_sql);
 
 
 
204
  $this->found_count += $options_table_transients;
 
 
 
 
205
  $this->restore_current_blog();
206
  }
207
 
@@ -214,4 +466,17 @@ class WP_Optimization_transient extends WP_Optimization {
214
  public function get_auto_option_description() {
215
  return __('Remove expired transient options', 'wp-optimize');
216
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  }
10
 
11
  public $ui_sort_order = 5000;
12
 
13
+ public $run_multisite = true;
14
+
15
+ public $support_preview = true;
16
+
17
+ private $found_count_all = 0;
18
+
19
+ /**
20
+ * Prepare data for preview widget.
21
+ *
22
+ * @param array $params
23
+ *
24
+ * @return array
25
+ */
26
+ public function preview($params) {
27
+
28
+ // get type of data for return single site or multisite.
29
+ $type = isset($params['type']) && 'multisite' == $params['type'] ? 'multisite' : 'single';
30
+
31
+ // set remove_all_transients for correctly handling "all" checkbox for preview transients.
32
+ if (isset($params['remove_all_transients'])) {
33
+ $this->data['remove_all_transients'] = $params['remove_all_transients'];
34
+ }
35
+
36
+ // get data requested for preview.
37
+ if ('single' == $type) {
38
+ $sql = $this->wpdb->prepare("
39
+ SELECT
40
+ a.option_id,
41
+ a.option_name,
42
+ SUBSTR(a.option_value, 1, 128) as option_value
43
+ FROM
44
+ " . $this->wpdb->options . " a
45
+ LEFT JOIN
46
+ " . $this->wpdb->options . " b
47
+ ON
48
+ b.option_name = CONCAT(
49
+ '_transient_timeout_',
50
+ SUBSTRING(
51
+ a.option_name,
52
+ CHAR_LENGTH('_transient_') + 1
53
+ )
54
+ )
55
+ WHERE
56
+ a.option_name LIKE '_transient_%' AND
57
+ a.option_name NOT LIKE '_transient_timeout_%'
58
+ ". ($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : "").
59
+ " ORDER BY a.option_id LIMIT %d, %d;",
60
+ array(
61
+ $params['offset'],
62
+ $params['limit'],
63
+ )
64
+ );
65
+
66
+ $sql_count = "
67
+ SELECT
68
+ COUNT(*)
69
+ FROM
70
+ " . $this->wpdb->options . " a
71
+ LEFT JOIN
72
+ " . $this->wpdb->options . " b
73
+ ON
74
+ b.option_name = CONCAT(
75
+ '_transient_timeout_',
76
+ SUBSTRING(
77
+ a.option_name,
78
+ CHAR_LENGTH('_transient_') + 1
79
+ )
80
+ )
81
+ WHERE
82
+ a.option_name LIKE '_transient_%'
83
+ ". ($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : "");
84
+ } else {
85
+ $sql = $this->wpdb->prepare("
86
+ SELECT
87
+ a.meta_id,
88
+ a.meta_key,
89
+ SUBSTR(a.meta_value, 1, 128) as meta_value
90
+ FROM
91
+ ".$this->wpdb->sitemeta." a
92
+ LEFT JOIN
93
+ ".$this->wpdb->sitemeta." b
94
+ ON
95
+ b.meta_key = CONCAT(
96
+ '_site_transient_timeout_',
97
+ SUBSTRING(
98
+ a.meta_key,
99
+ CHAR_LENGTH('_site_transient_') + 1
100
+ )
101
+ )
102
+ WHERE
103
+ a.meta_key LIKE '_site_transient_%' AND
104
+ a.meta_key NOT LIKE '_site_transient_timeout_%'
105
+ ".($this->remove_only_expired() ? " AND b.meta_value < UNIX_TIMESTAMP()" : "").
106
+ " ORDER BY a.meta_id LIMIT %d, %d;",
107
+ array(
108
+ $params['offset'],
109
+ $params['limit'],
110
+ )
111
+ );
112
+
113
+ $sql_count = "
114
+ SELECT
115
+ COUNT(*)
116
+ FROM
117
+ ".$this->wpdb->sitemeta." a
118
+ LEFT JOIN ".$this->wpdb->sitemeta." b
119
+ ON
120
+ b.meta_key = CONCAT(
121
+ '_site_transient_timeout_',
122
+ SUBSTRING(
123
+ a.meta_key,
124
+ CHAR_LENGTH('_site_transient_') + 1
125
+ )
126
+ )
127
+ WHERE
128
+ a.meta_key LIKE '_site_transient_%' AND
129
+ a.meta_key NOT LIKE '_site_transient_timeout_%'
130
+ ".($this->remove_only_expired() ? " AND b.meta_value < UNIX_TIMESTAMP()" : "");
131
+ }
132
+
133
+ $posts = $this->wpdb->get_results($sql, ARRAY_A);
134
+
135
+ $total = $this->wpdb->get_var($sql_count);
136
+
137
+ // define columns array depends on source type of request.
138
+ if ('single' == $type) {
139
+ $columns = array(
140
+ 'option_id' => __('ID', 'wp-optimize'),
141
+ 'option_name' => __('Name', 'wp-optimize'),
142
+ 'option_value' => __('Value', 'wp-optimize'),
143
+ );
144
+ } else {
145
+ $columns = array(
146
+ 'meta_id' => __('ID', 'wp-optimize'),
147
+ 'meta_key' => __('Name', 'wp-optimize'),
148
+ 'meta_value' => __('Value', 'wp-optimize'),
149
+ );
150
+ }
151
+
152
+ return array(
153
+ 'id_key' => ('single' == $type) ? 'option_id' : 'meta_id',
154
+ 'columns' => $columns,
155
+ 'offset' => $params['offset'],
156
+ 'limit' => $params['limit'],
157
+ 'total' => $total,
158
+ 'data' => $this->htmlentities_array($posts, array('option_id', 'meta_id')),
159
+ 'message' => $total > 0 ? '' : __('No transient options found', 'wp-optimize'),
160
+ );
161
+ }
162
 
163
  /**
164
  * Do actions before optimize() function.
183
 
184
  // Delete transients from multisite, if configured as such.
185
  if (is_multisite() && is_main_network()) {
186
+ if (isset($this->data['ids'])) {
187
+ // clean timeouts rows by transient option ids, before deleting transients.
188
+ // this is done for correct counting deleted transient options.
189
+ $clean2_timeouts = "
190
+ DELETE
191
+ b
192
+ FROM
193
+ " . $this->wpdb->sitemeta . " a
194
+ LEFT JOIN " . $this->wpdb->sitemeta . " b
195
+ ON
196
+ b.meta_key = CONCAT(
197
+ '_site_transient_timeout_',
198
+ SUBSTRING(
199
+ a.meta_key,
200
+ CHAR_LENGTH('_site_transient_') + 1
201
+ )
202
+ )
203
+ WHERE
204
+ a.meta_id IN (".join(',', $this->data['ids']).")";
205
+
206
+ // run clean timeouts query.
207
+ $this->query($clean2_timeouts);
208
+
209
+ // reset clean timeouts query to avoid future run.
210
+ $clean2_timeouts = '';
211
+
212
+ // clean transients rows by id.
213
+ $clean2 = "
214
+ DELETE
215
+ a
216
+ FROM
217
+ " . $this->wpdb->sitemeta . " a
218
+ WHERE
219
+ a.meta_id IN (".join(',', $this->data['ids']).")
220
+ ". ($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : "");
221
+ } else {
222
+ $clean2 = "
223
  DELETE
224
  a
225
  FROM
234
  CHAR_LENGTH('_site_transient_') + 1
235
  )
236
  )
237
+ ".($this->remove_only_expired() ? " AND b.meta_value < UNIX_TIMESTAMP()" : "");
 
238
 
239
+ $clean2_timeouts = "
 
 
240
  DELETE
241
  b
242
  FROM
243
  " . $this->wpdb->options . " b
244
  WHERE
245
+ b.option_name LIKE '_site_transient_timeout_%'
246
+ ".($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : "");
247
+ }
248
 
249
+ $sitemeta_table_transients_deleted = $this->query($clean2);
250
+ if ('' != $clean2_timeouts) $this->query($clean2_timeouts);
251
 
252
  $message2 = sprintf(_n('%s network-wide transient option deleted', '%s network-wide transient options deleted', $sitemeta_table_transients_deleted, 'wp-optimize'), number_format_i18n($sitemeta_table_transients_deleted));
253
 
261
  */
262
  public function optimize() {
263
 
264
+ // if posted ids then build sql queries for deleting selected data.
265
+ if (isset($this->data['ids'])) {
266
+ // clean timeouts rows by transient option ids, before deleting transients.
267
+ // this is done for correct counting deleted transient options.
268
+ $clean_timeouts = "
269
+ DELETE
270
+ b
271
+ FROM
272
+ " . $this->wpdb->options . " a
273
+ LEFT JOIN " . $this->wpdb->options . " b
274
+ ON
275
+ b.option_name = CONCAT(
276
+ '_transient_timeout_',
277
+ SUBSTRING(
278
+ a.option_name,
279
+ CHAR_LENGTH('_transient_') + 1
280
+ )
281
+ )
282
+ WHERE
283
+ a.option_id IN (".join(',', $this->data['ids']).")";
284
+
285
+ // run clean timeouts query.
286
+ $this->query($clean_timeouts);
287
+
288
+ // reset clean timeouts query to avoid future run.
289
+ $clean_timeouts = '';
290
+
291
+ // clean transients rows by id.
292
+ $clean = "
293
+ DELETE
294
+ a
295
+ FROM
296
+ " . $this->wpdb->options . " a
297
+ WHERE
298
+ a.option_id IN (".join(',', $this->data['ids']).")
299
+ ". ($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : "");
300
+ } else {
301
+ // clean transients rows.
302
+ $clean = "
303
+ DELETE
304
+ a
305
+ FROM
306
+ " . $this->wpdb->options . " a
307
+ LEFT JOIN " . $this->wpdb->options . " b
308
+ ON
309
+ b.option_name = CONCAT(
310
+ '_transient_timeout_',
311
+ SUBSTRING(
312
+ a.option_name,
313
+ CHAR_LENGTH('_transient_') + 1
314
+ )
315
+ )
316
+ WHERE
317
+ a.option_name LIKE '_transient_%' AND
318
+ a.option_name NOT LIKE '_transient_timeout_%'
319
+ ". ($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : "");
320
 
321
+ // clean transient timeouts rows.
322
+ $clean_timeouts = "
323
+ DELETE
324
+ b
325
+ FROM
326
+ " . $this->wpdb->options . " b
327
+ WHERE
328
+ b.option_name LIKE '_transient_timeout_%'
329
+ ".($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : "");
330
+ }
331
+
332
+ // run clean transients query and get count of deleted rows.
333
  $options_table_transients_deleted = $this->query($clean);
334
  $this->processed_count += $options_table_transients_deleted;
335
 
336
+ if ('' != $clean_timeouts) $this->query($clean_timeouts);
 
 
 
 
 
 
 
 
 
 
 
337
  }
338
 
339
  /**
341
  */
342
  public function before_get_info() {
343
  $this->found_count = 0;
344
+ $this->found_count_all = 0;
345
  }
346
 
347
  /**
354
  SELECT
355
  COUNT(*)
356
  FROM
357
+ ".$this->wpdb->sitemeta." a
358
+ LEFT JOIN
359
+ ".$this->wpdb->sitemeta." b
360
+ ON
361
  b.meta_key = CONCAT(
362
  '_site_transient_timeout_',
363
  SUBSTRING(
364
  a.meta_key,
365
  CHAR_LENGTH('_site_transient_') + 1
366
  )
367
+ )
368
+ WHERE
369
+ a.meta_key LIKE '_site_transient_%' AND
370
+ a.meta_key NOT LIKE '_site_transient_timeout_%'";
371
+
372
+ $expired_suffix_sql = " AND b.meta_value < UNIX_TIMESTAMP()";
373
 
374
+ // get count of expired transients.
375
+ $sitemeta_table_transients = $this->wpdb->get_var($sitemeta_table_sql . $expired_suffix_sql);
376
+ // get count of all transients.
377
+ $sitemeta_table_transients_all = $this->wpdb->get_var($sitemeta_table_sql);
378
  } else {
379
  $sitemeta_table_transients = 0;
380
+ $sitemeta_table_transients_all = 0;
381
  }
382
 
383
+ if ($this->found_count_all > 0) {
384
+ $message = sprintf(_n('%1$d of %2$d transient option expired', '%1$d of %2$d transient options expired', $this->found_count_all, 'wp-optimize'), number_format_i18n($this->found_count), number_format_i18n($this->found_count_all));
385
  } else {
386
  $message = __('No transient options found', 'wp-optimize');
387
  }
388
 
389
  if ($this->is_multisite_mode()) {
390
+ $message .= ' ' . sprintf(_n('across %d site', 'across %d sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
391
+ }
392
+
393
+ // add preview link to $message.
394
+ if ($this->found_count_all > 0) {
395
+ $message = $this->get_preview_link($message, array('data-type' => 'single'));
396
  }
397
 
398
  $this->register_output($message);
399
 
400
  if ($this->is_multisite_mode()) {
401
+ if ($sitemeta_table_transients_all > 0) {
402
+ $message2 = sprintf(_n('%1$d of %2$d network-wide transient option found', '%1$d of %2$d network-wide transient options found', $sitemeta_table_transients_all, 'wp-optimize'), number_format_i18n($sitemeta_table_transients), number_format_i18n($sitemeta_table_transients_all));
403
+ $message2 = $this->get_preview_link($message2, array('data-type' => 'multisite'));
404
  } else {
405
  $message2 = __('No site-wide transient options found', 'wp-optimize');
406
  }
407
 
408
  $this->register_output($message2);
409
  }
410
+
411
+ // If any kind of transients exists then
412
+ if ($this->found_count_all > 0 || ($sitemeta_table_transients + $sitemeta_table_transients_all > 0)) {
413
+ $remove_all_transients = $this->options->get_option('remove_all_transients', 'false');
414
+ $this->register_output('<input id="remove_all_transients" name="remove_all_transients" type="checkbox" value="true" '.checked($remove_all_transients, 'true').'><label for="remove_all_transients" style="color: inherit;">'.__('Remove all transient options (not only expired)', 'wp-optimize').'</label>');
415
+ }
416
  }
417
 
418
  /**
429
  SELECT
430
  COUNT(*)
431
  FROM
432
+ " . $this->wpdb->options . " a
433
+ LEFT JOIN
434
+ " . $this->wpdb->options . " b
435
+ ON
436
  b.option_name = CONCAT(
437
  '_transient_timeout_',
438
  SUBSTRING(
440
  CHAR_LENGTH('_transient_') + 1
441
  )
442
  )
443
+ WHERE
444
+ a.option_name LIKE '_transient_%' AND
445
+ a.option_name NOT LIKE '_transient_timeout_%'
446
+ ";
447
 
448
+ $expired_suffix_sql = " AND b.option_value < UNIX_TIMESTAMP()";
449
+
450
+ // get count of expired transients.
451
+ $options_table_transients = $this->wpdb->get_var($options_table_sql . $expired_suffix_sql);
452
  $this->found_count += $options_table_transients;
453
+
454
+ // get count of all transients.
455
+ $options_table_transients = $this->wpdb->get_var($options_table_sql);
456
+ $this->found_count_all += $options_table_transients;
457
  $this->restore_current_blog();
458
  }
459
 
466
  public function get_auto_option_description() {
467
  return __('Remove expired transient options', 'wp-optimize');
468
  }
469
+
470
+ /**
471
+ * Check optimization param and return true if we should remove only expired transients.
472
+ *
473
+ * @return bool
474
+ */
475
+ private function remove_only_expired() {
476
+ if (isset($this->data['remove_all_transients']) && 'true' == $this->data['remove_all_transients']) {
477
+ return false;
478
+ }
479
+
480
+ return true;
481
+ }
482
  }
optimizations/trash.php CHANGED
@@ -21,6 +21,71 @@ class WP_Optimization_trash extends WP_Optimization {
21
 
22
  protected $auto_id = 'trash';
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  /**
25
  * Do actions after optimize() function.
26
  */
@@ -49,6 +114,11 @@ class WP_Optimization_trash extends WP_Optimization {
49
  // get trashed post ids.
50
  $post_remove_ids = $this->wpdb->get_col($remove_ids_sql);
51
 
 
 
 
 
 
52
  // remove related data for trashed posts.
53
  if (!empty($post_remove_ids)) {
54
  $post_remove_ids = join(',', $post_remove_ids);
@@ -72,6 +142,11 @@ class WP_Optimization_trash extends WP_Optimization {
72
  $clean .= ' AND post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
73
  }
74
 
 
 
 
 
 
75
  $clean .= ';';
76
 
77
  // remove trashed posts.
@@ -94,6 +169,11 @@ class WP_Optimization_trash extends WP_Optimization {
94
  $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
95
  }
96
 
 
 
 
 
 
97
  $this->register_output($message);
98
  }
99
 
21
 
22
  protected $auto_id = 'trash';
23
 
24
+ /**
25
+ * Prepare data for preview widget.
26
+ *
27
+ * @param array $params
28
+ *
29
+ * @return array
30
+ */
31
+ public function preview($params) {
32
+
33
+ $retention_subquery = '';
34
+
35
+ if ('true' == $this->retention_enabled) {
36
+ $retention_subquery = ' and post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
37
+ }
38
+
39
+ // get data requested for preview.
40
+ $sql = $this->wpdb->prepare(
41
+ "SELECT `ID`, `post_title`, `post_date`".
42
+ " FROM `" . $this->wpdb->posts . "`".
43
+ " WHERE post_type = 'trash'".
44
+ $retention_subquery.
45
+ " ORDER BY `ID` LIMIT %d, %d;",
46
+ array(
47
+ $params['offset'],
48
+ $params['limit'],
49
+ )
50
+ );
51
+
52
+ $posts = $this->wpdb->get_results($sql, ARRAY_A);
53
+
54
+ // fix empty revision titles.
55
+ if (!empty($posts)) {
56
+ foreach ($posts as $key => $post) {
57
+ $posts[$key]['post_title'] = array(
58
+ 'text' => '' == $post['post_title'] ? '('.__('no title', 'wp-optimize').')' : $post['post_title'],
59
+ 'url' => get_edit_post_link($post['ID']),
60
+ );
61
+ }
62
+ }
63
+
64
+ // get total count auto-draft for optimization.
65
+ $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->posts . "` WHERE post_type = 'trash'";
66
+
67
+ if ('true' == $this->retention_enabled) {
68
+ $sql .= ' and post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
69
+ }
70
+ $sql .= ';';
71
+
72
+ $total = $this->wpdb->get_var($sql);
73
+
74
+ return array(
75
+ 'id_key' => 'ID',
76
+ 'columns' => array(
77
+ 'ID' => __('ID', 'wp-optimize'),
78
+ 'post_title' => __('Title', 'wp-optimize'),
79
+ 'post_date' => __('Date', 'wp-optimize'),
80
+ ),
81
+ 'offset' => $params['offset'],
82
+ 'limit' => $params['limit'],
83
+ 'total' => $total,
84
+ 'data' => $this->htmlentities_array($posts, array('ID')),
85
+ 'message' => $total > 0 ? '' : __('No trashed posts found', 'wp-optimize'),
86
+ );
87
+ }
88
+
89
  /**
90
  * Do actions after optimize() function.
91
  */
114
  // get trashed post ids.
115
  $post_remove_ids = $this->wpdb->get_col($remove_ids_sql);
116
 
117
+ // if optimize called from preview dialog then get posted ids.
118
+ if (isset($this->data['ids'])) {
119
+ $post_remove_ids = array_intersect($post_remove_ids, $this->data['ids']);
120
+ }
121
+
122
  // remove related data for trashed posts.
123
  if (!empty($post_remove_ids)) {
124
  $post_remove_ids = join(',', $post_remove_ids);
142
  $clean .= ' AND post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
143
  }
144
 
145
+ // if posted ids in params, then remove only selected items. used by preview widget.
146
+ if (isset($this->data['ids'])) {
147
+ $clean .= ' AND `ID` in ('.join(',', $this->data['ids']).')';
148
+ }
149
+
150
  $clean .= ';';
151
 
152
  // remove trashed posts.
169
  $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
170
  }
171
 
172
+ // add preview link for output.
173
+ if (0 != $this->found_count && null != $this->found_count) {
174
+ $message = $this->get_preview_link($message);
175
+ }
176
+
177
  $this->register_output($message);
178
  }
179
 
optimizations/unapproved.php CHANGED
@@ -14,6 +14,66 @@ class WP_Optimization_unapproved extends WP_Optimization {
14
 
15
  public $ui_sort_order = 4000;
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Do actions after optimize() function.
19
  */
@@ -45,6 +105,11 @@ class WP_Optimization_unapproved extends WP_Optimization {
45
  $clean .= ' and c.comment_date < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
46
  }
47
 
 
 
 
 
 
48
  $clean .= ';';
49
 
50
  $comments = $this->query($clean);
@@ -65,6 +130,11 @@ class WP_Optimization_unapproved extends WP_Optimization {
65
  $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
66
  }
67
 
 
 
 
 
 
68
  $this->register_output($message);
69
  }
70
 
14
 
15
  public $ui_sort_order = 4000;
16
 
17
+ /**
18
+ * Prepare data for preview widget.
19
+ *
20
+ * @param array $params
21
+ *
22
+ * @return array
23
+ */
24
+ public function preview($params) {
25
+
26
+ $retention_subquery = '';
27
+
28
+ if ('true' == $this->retention_enabled) {
29
+ $retention_subquery = ' and comment_date < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
30
+ }
31
+
32
+ // get data requested for preview.
33
+ $sql = $this->wpdb->prepare(
34
+ "SELECT comment_ID, comment_author, comment_content".
35
+ " FROM `" . $this->wpdb->comments . "`".
36
+ " WHERE comment_approved = '0'".
37
+ $retention_subquery.
38
+ " ORDER BY `comment_ID` LIMIT %d, %d",
39
+ array(
40
+ $params['offset'],
41
+ $params['limit'],
42
+ )
43
+ );
44
+
45
+ $posts = $this->wpdb->get_results($sql, ARRAY_A);
46
+
47
+ // fix empty revision titles.
48
+ if (!empty($posts)) {
49
+ foreach ($posts as $key => $post) {
50
+ $posts[$key]['post_title'] = array(
51
+ 'text' => '' == $post['post_title'] ? '('.__('no title', 'wp-optimize').')' : $post['post_title'],
52
+ 'url' => get_edit_post_link($post['ID']),
53
+ );
54
+ }
55
+ }
56
+
57
+ // get total count comments for optimization.
58
+ $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->comments . "` WHERE comment_approved = '0' ".$retention_subquery.";";
59
+
60
+ $total = $this->wpdb->get_var($sql);
61
+
62
+ return array(
63
+ 'id_key' => 'comment_ID',
64
+ 'columns' => array(
65
+ 'comment_ID' => __('ID', 'wp-optimize'),
66
+ 'comment_author' => __('Author', 'wp-optimize'),
67
+ 'comment_content' => __('Date', 'wp-optimize'),
68
+ ),
69
+ 'offset' => $params['offset'],
70
+ 'limit' => $params['limit'],
71
+ 'total' => $total,
72
+ 'data' => $this->htmlentities_array($posts, array('comment_ID')),
73
+ 'message' => $total > 0 ? '' : __('No unapproved comments found', 'wp-optimize'),
74
+ );
75
+ }
76
+
77
  /**
78
  * Do actions after optimize() function.
79
  */
105
  $clean .= ' and c.comment_date < NOW() - INTERVAL ' . $this->retention_period . ' WEEK';
106
  }
107
 
108
+ // if posted ids in params, then remove only selected items. used by preview widget.
109
+ if (isset($this->data['ids'])) {
110
+ $clean .= ' AND c.comment_ID in ('.join(',', $this->data['ids']).')';
111
+ }
112
+
113
  $clean .= ';';
114
 
115
  $comments = $this->query($clean);
130
  $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids));
131
  }
132
 
133
+ // add preview link for output.
134
+ if (0 != $this->found_count && null != $this->found_count) {
135
+ $message = $this->get_preview_link($message);
136
+ }
137
+
138
  $this->register_output($message);
139
  }
140
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: DavidAnderson, ruhanirabin, DNutbourne, aporter, snightingale
3
  Donate link: https://david.dw-perspective.org.uk/donate
4
  Tags: comments, spam, optimize, database, revisions, users, posts, trash, schedule, automatic, clean, phpmyadmin, meta, postmeta, responsive, mobile
5
  Requires at least: 3.8
6
- Tested up to: 4.9
7
- Stable tag: 2.2.4
8
  License: GPLv2+
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -138,6 +138,31 @@ Please check your database for corrupted tables. That can happen, usually your w
138
 
139
  == Changelog ==
140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  = 2.2.4 - 07/May/2018 =
142
 
143
  * TWEAK: Changed the term 'Automatic' to 'Scheduled'.
@@ -405,4 +430,4 @@ Please check your database for corrupted tables. That can happen, usually your w
405
  * Fix Interface
406
 
407
  == Upgrade Notice ==
408
- * 2.2.4 : 2.2 has lots of new features, tweaks and fixes; including the introduction of a Premium version with even more features. 2.2.4 makes a number of small, cosmetic fixes.
3
  Donate link: https://david.dw-perspective.org.uk/donate
4
  Tags: comments, spam, optimize, database, revisions, users, posts, trash, schedule, automatic, clean, phpmyadmin, meta, postmeta, responsive, mobile
5
  Requires at least: 3.8
6
+ Tested up to: 5.0
7
+ Stable tag: 2.2.6
8
  License: GPLv2+
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
138
 
139
  == Changelog ==
140
 
141
+ = 2.2.6 - 30/October/2018 =
142
+
143
+ * TWEAK: Mark as supporting WordPress 5.0
144
+ * TWEAK: Update seasonal notices
145
+
146
+ = 2.2.5 - 24/August/2018 =
147
+
148
+ * FEATURE: Preview data before deleting. (Premium)
149
+ * FEATURE: Lazy Loading for images, iframes and videos. (Premium)
150
+ * FEATURE: Added custom capabilities wpo_prevent_run_optimizations and wpo_prevent_manage_options (Premium)
151
+ * FIX: Correct tables order sorting
152
+ * FIX: Wrong numbers in total cleaned field
153
+ * FIX: Don't show incorrect overhead value if option innodb_file_per_table disabled
154
+ * TWEAK: Added option to clean "all" transient options and network-wide transient options for multisite WordPress installation
155
+ * TWEAK: Links to UpdraftPlus automatically Install/Activate UpdraftPlus plugin
156
+ * TWEAK: FAQ links point to getwpo.com
157
+ * TWEAK: Auto-draft, revision posts and pingback comments removing with their meta data
158
+ * TWEAK: Scheduler is not using the WordPress timezone settings
159
+ * TWEAK: Detecting corrupted tables in background.
160
+ * TWEAK: Unused Images optimization correctly detects images in pages built with popular plugins - Page Builder by SiteOrigin, Visual Composer, Beaver Builder, Elementor.
161
+ * TWEAK: Paginate unused images
162
+ * TWEAK: Added checkbox for select all optimizations
163
+ * TWEAK: Prevent deleting homepage images in image optimization
164
+ * TWEAK: Override the default multisite site list fetch limit of 100 sites
165
+
166
  = 2.2.4 - 07/May/2018 =
167
 
168
  * TWEAK: Changed the term 'Automatic' to 'Scheduled'.
430
  * Fix Interface
431
 
432
  == Upgrade Notice ==
433
+ * 2.2.6 : Various tweaks and fixes, and new Premium features; a recommended update for all.
templates/info-message.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php if (!defined('ABSPATH')) die('No direct access.'); ?>
2
+ <div class="wpo_info">
3
+ <?php echo $message; ?>
4
+ </div>
templates/optimizations-table.php CHANGED
@@ -3,7 +3,7 @@
3
  <table id="optimizations_list" class="widefat">
4
  <thead>
5
  <tr>
6
- <th></th>
7
  <th><?php _e('Optimization', 'wp-optimize'); ?></th>
8
  <th><?php _e('Notes', 'wp-optimize'); ?></th>
9
  <th></th>
@@ -78,4 +78,4 @@
78
  </tr>
79
  <?php } ?>
80
  </tbody>
81
- </table>
3
  <table id="optimizations_list" class="widefat">
4
  <thead>
5
  <tr>
6
+ <th><input id="select_all_optimizations" type="checkbox" /></th>
7
  <th><?php _e('Optimization', 'wp-optimize'); ?></th>
8
  <th><?php _e('Notes', 'wp-optimize'); ?></th>
9
  <th></th>
78
  </tr>
79
  <?php } ?>
80
  </tbody>
81
+ </table>
templates/status-box-contents.php CHANGED
@@ -122,6 +122,16 @@ $total_cleaned = $options->get_option('total-cleaned');
122
  ?>
123
  </p>
124
 
 
 
 
 
 
 
 
 
 
 
125
 
126
  <h3><?php _e('Support and feedback', 'wp-optimize'); ?></h3>
127
  <p>
122
  ?>
123
  </p>
124
 
125
+ <?php
126
+ $corrupted_tables_count = $options->get_option('corrupted-tables-count', 0);
127
+
128
+ if ($corrupted_tables_count > 0) {
129
+ ?>
130
+ <p>
131
+ <span style="color: #9B0000;"><?php printf(_n('Your database has %s corrupted table.', 'Your database has %s corrupted tables.', $corrupted_tables_count, 'wp-optimize'), $corrupted_tables_count); ?></span><br>
132
+ <a href="<?php esc_attr($admin_page_url); ?>?page=WP-Optimize&tab=wp_optimize_tables" onclick="jQuery('#wp-optimize-nav-tab-tables').trigger('click'); return false;"><?php _e('Repair corrupted tables here.', 'wp-optimize'); ?></a>
133
+ </p>
134
+ <?php } ?>
135
 
136
  <h3><?php _e('Support and feedback', 'wp-optimize'); ?></h3>
137
  <p>
templates/take-a-backup.php CHANGED
@@ -68,16 +68,28 @@ $wpo_take_backup_checkbox_dom_id = 'enable-auto-backup'.($wpo_take_backup_checkb
68
  <?php
69
  // UpdraftPlus is not installed.
70
  if ('disabled' == $disabled_backup && !$updraftplus_status['installed']) {
71
- echo '<a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=updraftplus'), 'install-plugin_updraftplus').'"> '.__('Follow this link to install UpdraftPlus, to take a backup before optimization', 'wp-optimize').' </a>';
72
  } else {
 
 
 
 
 
 
 
 
 
 
 
 
73
  // Check updraftplus version first.
74
  if (!empty($updraftplus_version_check)) {
75
  echo '<small>'.__('UpdraftPlus needs to be updated to 1.12.33 or higher in order to backup the database before optimization.', 'wp-optimize').' <a href="'.admin_url('update-core.php').'">'.__('Please update UpdraftPlus to the latest version.', 'wp-optimize').'</a></small>';
76
  } else {
77
  if ($updraftplus_status['installed'] && !$updraftplus_status['active']) {
78
- echo '<small>'.__('UpdraftPlus is installed but currently not active. Please activate UpdraftPlus to backup the database before optimization.').'</small>';
79
  }
80
  }
81
  }
82
  ?>
83
- </p>
68
  <?php
69
  // UpdraftPlus is not installed.
70
  if ('disabled' == $disabled_backup && !$updraftplus_status['installed']) {
71
+ echo '<small><a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=updraftplus'), 'install-plugin_updraftplus').'"> '.__('Follow this link to install UpdraftPlus, to take a backup before optimization', 'wp-optimize').' </a></small>';
72
  } else {
73
+ // Build activate url.
74
+ $activate_url = add_query_arg(array(
75
+ '_wpnonce' => wp_create_nonce('activate-plugin_updraftplus/updraftplus.php'),
76
+ 'action' => 'activate',
77
+ 'plugin' => 'updraftplus/updraftplus.php'
78
+ ), network_admin_url('plugins.php'));
79
+
80
+ // If is network admin then add to link newtwork activation.
81
+ if (is_network_admin()) {
82
+ $activate_url = add_query_arg(array('networkwide' => 1), $activate_url);
83
+ }
84
+
85
  // Check updraftplus version first.
86
  if (!empty($updraftplus_version_check)) {
87
  echo '<small>'.__('UpdraftPlus needs to be updated to 1.12.33 or higher in order to backup the database before optimization.', 'wp-optimize').' <a href="'.admin_url('update-core.php').'">'.__('Please update UpdraftPlus to the latest version.', 'wp-optimize').'</a></small>';
88
  } else {
89
  if ($updraftplus_status['installed'] && !$updraftplus_status['active']) {
90
+ echo '<small><a href="'.$activate_url.'"> '.__('UpdraftPlus is installed but currently not active. Follow this link to activate UpdraftPlus, to take a backup before optimization.', 'wp-optimize').' </a></small>';
91
  }
92
  }
93
  }
94
  ?>
95
+ </p>
wp-optimize.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-Optimize
4
  Plugin URI: https://getwpo.com
5
  Description: WP-Optimize is WordPress's #1 most installed optimization plugin. With it, you can clean up your database easily and safely, without manual queries.
6
- Version: 2.2.4
7
  Author: David Anderson, Ruhani Rabin, Team Updraft
8
  Author URI: https://updraftplus.com
9
  Text Domain: wp-optimize
@@ -15,7 +15,7 @@ if (!defined('ABSPATH')) die('No direct access allowed');
15
 
16
  // Check to make sure if WP_Optimize is already call and returns.
17
  if (!class_exists('WP_Optimize')) :
18
- define('WPO_VERSION', '2.2.4');
19
  define('WPO_PLUGIN_URL', plugin_dir_url(__FILE__));
20
  define('WPO_PLUGIN_MAIN_PATH', plugin_dir_path(__FILE__));
21
  define('WPO_PREMIUM_NOTIFICATION', false);
@@ -73,6 +73,7 @@ class WP_Optimize {
73
 
74
  register_shutdown_function(array($this, 'log_fatal_errors'));
75
 
 
76
  }
77
 
78
  public static function instance() {
@@ -396,7 +397,7 @@ class WP_Optimize {
396
  public function wp_optimize_menu() {
397
  $capability_required = $this->capability_required();
398
 
399
- if (!current_user_can($capability_required)) {
400
  echo "Permission denied.";
401
  return;
402
  }
@@ -471,11 +472,19 @@ class WP_Optimize {
471
  echo '</strong></div>';
472
  }
473
 
474
- $this->include_template('optimize-table.php', false, array('optimize_db' => $optimize_db));
 
 
 
 
475
  break;
476
 
477
  case 'tables':
478
- $this->include_template('tables.php', false, array('optimize_db' => $optimize_db));
 
 
 
 
479
  break;
480
 
481
  case 'settings':
@@ -492,10 +501,15 @@ class WP_Optimize {
492
 
493
  $this->wpo_render_output_messages($output);
494
  }
495
- $this->include_template('admin-settings-general.php');
496
- $this->include_template('admin-settings-auto-cleanup.php');
497
- $this->include_template('admin-settings-logging.php');
498
- $this->include_template('admin-settings-sidebar.php');
 
 
 
 
 
499
  break;
500
 
501
  case 'may_also':
@@ -528,6 +542,8 @@ class WP_Optimize {
528
  'are_you_sure_you_want_to_remove_logging_destination' => __('Are you sure you want to remove this logging destination?', 'wp-optimize'),
529
  'fill_all_settings_fields' => __('Before saving, you need to complete the currently incomplete settings (or remove them).', 'wp-optimize'),
530
  'table_was_not_repaired' => __('%s was not repaired. For more details, please check your logs configured in logging destinations settings.', 'wp-optimize'),
 
 
531
  ));
532
  }
533
 
@@ -610,7 +626,7 @@ class WP_Optimize {
610
  * @return void
611
  */
612
  public function cron_activate() {
613
- $gmtoffset = (int) (3600 * ((double) get_option('gmt_offset')));
614
 
615
  $options = $this->get_options();
616
 
@@ -642,7 +658,7 @@ class WP_Optimize {
642
  }
643
 
644
  add_action('wpo_cron_event2', array($this, 'cron_action'));
645
- wp_schedule_event((current_time("timestamp", 0) + $this_time), $schedule_type, 'wpo_cron_event2');
646
  WP_Optimize()->log('running wp_schedule_event()');
647
  }
648
  }
@@ -701,8 +717,7 @@ class WP_Optimize {
701
  */
702
  public function show_admin_warning_overdue_crons($howmany) {
703
  $ret = '<div class="updated"><p>';
704
- // todo: update link to wp-optimize
705
- $ret .= '<strong>'.__('Warning', 'wp-optimize').':</strong> '.sprintf(__('WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working.', 'wp-optimize'), $howmany).' <a href="'.apply_filters('wpoptimize_com_link', "https://updraftplus.com/faqs/scheduler-wordpress-installation-working/").'">'.__('Read this page for a guide to possible causes and how to fix it.', 'wp-optimize').'</a>';
706
  $ret .= '</p></div>';
707
  return $ret;
708
  }
@@ -711,7 +726,7 @@ class WP_Optimize {
711
 
712
  $capability_required = $this->capability_required();
713
 
714
- if (!current_user_can($capability_required)) return;
715
 
716
  $icon_svg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmlld0JveD0iMCAwIDE2IDE2IgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmc0MzE2IgogICBoZWlnaHQ9IjE2IgogICB3aWR0aD0iMTYiPgogIDxkZWZzCiAgICAgaWQ9ImRlZnM0MzE4IiAvPgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTQzMjEiPgogICAgPHJkZjpSREY+CiAgICAgIDxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj4KICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD4KICAgICAgICA8ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B1cmwub3JnL2RjL2RjbWl0eXBlL1N0aWxsSW1hZ2UiIC8+CiAgICAgICAgPGRjOnRpdGxlPjwvZGM6dGl0bGU+CiAgICAgIDwvY2M6V29yaz4KICAgIDwvcmRmOlJERj4KICA8L21ldGFkYXRhPgogIDxnCiAgICAgaWQ9ImxheWVyMSI+CiAgICA8cGF0aAogICAgICAgc3R5bGU9ImZpbGw6I2EwYTVhYTtmaWxsLW9wYWNpdHk6MSIKICAgICAgIGlkPSJwYXRoNTciCiAgICAgICBkPSJtIDEwLjc2ODgwOSw2Ljc2MTYwNTEgMCwwIGMgLTAuMDE2ODgsLTAuMDE2ODc4IC0wLjAyNTMxLC0wLjA0MjE4MSAtMC4wMzM3NCwtMC4wNjc0OTkgLTAuMDA4NCwtMC4wMDgzOSAtMC4wMDg0LC0wLjAxNjg3OCAtMC4wMTY4OCwtMC4wMzM3NDMgQyA5Ljk5MjYxMTIsNS4xOTIzMzY2IDguMjIwODU1Nyw0LjU4NDg3ODEgNi43NDQzOTEyLDUuMjkzNTc5NyA1LjY3MjkwMDUsNS44MDgyMzI4IDUuMDU3MDA0Myw2Ljg4ODE2MTMgNS4wNjU0NDIsOC4wMDE4MzY1IDQuNDU3OTgyMiw3LjMxMDAwNzYgMy42OTg2NTg0LDYuNzk1MzU0NSAyLjg1NDk2NDIsNi40OTE2MjUzIDMuMjY4Mzc0Myw1LjA2NTc4MzEgNC4yNTU0OTYsMy44MTcxMTY2IDUuNjg5Nzc0NiwzLjEyNTI4NzggOC4zNjQyODMyLDEuODM0NDM2OCAxMS41NzAzMTksMi45Mzk2NzQ0IDEyLjg4NjQ4MSw1LjU4ODg3MjYgMTMuNDUxNzU1LDYuNzI3ODU5NiAxNC42NDk4MDEsNy4zNTIxOTIxIDE1Ljg0Nzg0Niw3LjIzNDA3NSAxNS43NjM0ODIsNi4zMzk3NiAxNS41MTg4MDUsNS40MzcwMDg2IDE1LjEwNTM5Niw0LjU3NjQ0MDQgMTMuMjE1NTIxLDAuNjg3MDEzNCA4LjUzMzAyMjYsLTAuOTQxMzE2MjcgNC42NDM1OTQzLDAuOTQwMTIxNzkgMi4zMjM0MzcsMi4wNjIyMzM0IDAuODA0Nzg4MTQsNC4xNzk5MDQ0IDAuMzU3NjMxMzIsNi41MzM4MDk4IDIuNDE2MjQzOCw2LjQyNDEyOSA0LjQzMjY3MTcsNy41MDQwNTc0IDUuNDM2NjY2Miw5LjQzNjExNjcgbCAwLjAwODM5LDAgYyAwLjc1OTMxOTIsMS4zNzUyMjAzIDIuNDcyMDE3OCwxLjk0MDQ5NTMgMy45MDYyOTYsMS4yNDg2NjczIDEuMDQ2MTc5OCwtMC41MDYyMTggMS42NTM2NDA4LC0xLjUzNTUyMzggMS42Nzg5NTA4LC0yLjYxNTQ1MTIgMC41ODIxNDgsMC43MDg3MDE4IDEuMzMzMDM1LDEuMjQ4NjY2OCAyLjE1OTg1NiwxLjU3NzcwNjQgLTAuNDM4NzIxLDEuMzU4MzQ3OCAtMS40MDA1MzMsMi41NDc5NTQ4IC0yLjc5MjYyNywzLjIxNDQ3ODggLTIuNTkwMTM4NywxLjI0ODY1OCAtNS42NzgwNTc0LDAuMjUzMTA0IC03LjA2MTcxNTEsLTIuMjI3MzU3IGwgMCwwIEMgMi43NjIxMDQ4LDkuNDUyOTg5NCAxLjUxMzQzODMsOC44MjAyMTkxIDAuMjgxNjQ1OTIsOC45NzIwODQ0IDAuMzgyODg3NjUsOS43OTg5MDQ2IDAuNjE5MTIzMzEsMTAuNjE3Mjg3IDAuOTk4Nzg1MiwxMS40MDE5MjIgYyAxLjg4MTQzNjgsMy44OTc4NjQgNi41NjM5MzcsNS41MjYxOTggMTAuNDYxODAwOCwzLjY0NDc2IDIuMjQ0MjI2LC0xLjA4ODM2OSAzLjczNzU2MiwtMy4xMDQ3OTYgNC4yMzUzNDIsLTUuMzc0MzMyMyAtMS45OTk1NTQsMC4wNDIxODEgLTMuOTQ4NDg2LC0xLjAyOTMwNjMgLTQuOTI3MTcsLTIuOTEwNzQzMyB6IgogICAgICAgY2xhc3M9InN0MTciIC8+CiAgPC9nPgo8L3N2Zz4K';
717
 
@@ -861,6 +876,8 @@ class WP_Optimize {
861
 
862
  /**
863
  * Executed this function on cron event.
 
 
864
  */
865
  public function cron_action() {
866
 
@@ -880,6 +897,51 @@ class WP_Optimize {
880
 
881
  }
882
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
883
  /**
884
  * This will customize a URL with a correct Affiliate link
885
  * This function can be update to suit any URL as longs as the URL is passed
@@ -1100,6 +1162,43 @@ class WP_Optimize {
1100
  return (is_multisite() && WP_Optimize()->is_premium());
1101
  }
1102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1103
  /**
1104
  * Returns list of all sites in multisite
1105
  *
@@ -1109,10 +1208,10 @@ class WP_Optimize {
1109
  $sites = array();
1110
  // check if function get_sites exists (since 4.6.0) else use wp_get_sites.
1111
  if (function_exists('get_sites')) {
1112
- $sites = get_sites(array('network_id' => null));
1113
  } elseif (function_exists('wp_get_sites')) {
1114
  // @codingStandardsIgnoreLine
1115
- $sites = wp_get_sites(array('network_id' => null));
1116
  }
1117
  return $sites;
1118
  }
@@ -1271,6 +1370,7 @@ function wpo_cron_deactivate() {
1271
  */
1272
  function wpo_uninstall_actions() {
1273
  WP_Optimize()->get_options()->delete_all_options();
 
1274
  }
1275
 
1276
  function WP_Optimize() {
3
  Plugin Name: WP-Optimize
4
  Plugin URI: https://getwpo.com
5
  Description: WP-Optimize is WordPress's #1 most installed optimization plugin. With it, you can clean up your database easily and safely, without manual queries.
6
+ Version: 2.2.6
7
  Author: David Anderson, Ruhani Rabin, Team Updraft
8
  Author URI: https://updraftplus.com
9
  Text Domain: wp-optimize
15
 
16
  // Check to make sure if WP_Optimize is already call and returns.
17
  if (!class_exists('WP_Optimize')) :
18
+ define('WPO_VERSION', '2.2.6');
19
  define('WPO_PLUGIN_URL', plugin_dir_url(__FILE__));
20
  define('WPO_PLUGIN_MAIN_PATH', plugin_dir_path(__FILE__));
21
  define('WPO_PREMIUM_NOTIFICATION', false);
73
 
74
  register_shutdown_function(array($this, 'log_fatal_errors'));
75
 
76
+ $this->schedule_plugin_cron_tasks();
77
  }
78
 
79
  public static function instance() {
397
  public function wp_optimize_menu() {
398
  $capability_required = $this->capability_required();
399
 
400
+ if (!current_user_can($capability_required) || (!$this->can_run_optimizations() && !$this->can_manage_options())) {
401
  echo "Permission denied.";
402
  return;
403
  }
472
  echo '</strong></div>';
473
  }
474
 
475
+ if ($this->can_run_optimizations()) {
476
+ $this->include_template('optimize-table.php', false, array('optimize_db' => $optimize_db));
477
+ } else {
478
+ $this->prevent_run_optimizations_message();
479
+ }
480
  break;
481
 
482
  case 'tables':
483
+ if ($this->can_run_optimizations()) {
484
+ $this->include_template('tables.php', false, array('optimize_db' => $optimize_db));
485
+ } else {
486
+ $this->prevent_run_optimizations_message();
487
+ }
488
  break;
489
 
490
  case 'settings':
501
 
502
  $this->wpo_render_output_messages($output);
503
  }
504
+
505
+ if ($this->can_manage_options()) {
506
+ $this->include_template('admin-settings-general.php');
507
+ $this->include_template('admin-settings-auto-cleanup.php');
508
+ $this->include_template('admin-settings-logging.php');
509
+ $this->include_template('admin-settings-sidebar.php');
510
+ } else {
511
+ $this->prevent_manage_options_info();
512
+ }
513
  break;
514
 
515
  case 'may_also':
542
  'are_you_sure_you_want_to_remove_logging_destination' => __('Are you sure you want to remove this logging destination?', 'wp-optimize'),
543
  'fill_all_settings_fields' => __('Before saving, you need to complete the currently incomplete settings (or remove them).', 'wp-optimize'),
544
  'table_was_not_repaired' => __('%s was not repaired. For more details, please check your logs configured in logging destinations settings.', 'wp-optimize'),
545
+ 'spinner_src' => esc_attr(admin_url('images/spinner-2x.gif')),
546
+ 'sites' => $this->get_sites(),
547
  ));
548
  }
549
 
626
  * @return void
627
  */
628
  public function cron_activate() {
629
+ $gmt_offset = (int) (3600 * get_option('gmt_offset'));
630
 
631
  $options = $this->get_options();
632
 
658
  }
659
 
660
  add_action('wpo_cron_event2', array($this, 'cron_action'));
661
+ wp_schedule_event((current_time("timestamp", 0) + $this_time - $gmt_offset), $schedule_type, 'wpo_cron_event2');
662
  WP_Optimize()->log('running wp_schedule_event()');
663
  }
664
  }
717
  */
718
  public function show_admin_warning_overdue_crons($howmany) {
719
  $ret = '<div class="updated"><p>';
720
+ $ret .= '<strong>'.__('Warning', 'wp-optimize').':</strong> '.sprintf(__('WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working.', 'wp-optimize'), $howmany).' <a href="'.apply_filters('wpoptimize_com_link', "https://getwpo.com/faqs/the-scheduler-in-my-wordpress-installation-is-not-working-what-should-i-do/").'">'.__('Read this page for a guide to possible causes and how to fix it.', 'wp-optimize').'</a>';
 
721
  $ret .= '</p></div>';
722
  return $ret;
723
  }
726
 
727
  $capability_required = $this->capability_required();
728
 
729
+ if (!current_user_can($capability_required) || (!$this->can_run_optimizations() && !$this->can_manage_options())) return;
730
 
731
  $icon_svg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmlld0JveD0iMCAwIDE2IDE2IgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmc0MzE2IgogICBoZWlnaHQ9IjE2IgogICB3aWR0aD0iMTYiPgogIDxkZWZzCiAgICAgaWQ9ImRlZnM0MzE4IiAvPgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTQzMjEiPgogICAgPHJkZjpSREY+CiAgICAgIDxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj4KICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD4KICAgICAgICA8ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B1cmwub3JnL2RjL2RjbWl0eXBlL1N0aWxsSW1hZ2UiIC8+CiAgICAgICAgPGRjOnRpdGxlPjwvZGM6dGl0bGU+CiAgICAgIDwvY2M6V29yaz4KICAgIDwvcmRmOlJERj4KICA8L21ldGFkYXRhPgogIDxnCiAgICAgaWQ9ImxheWVyMSI+CiAgICA8cGF0aAogICAgICAgc3R5bGU9ImZpbGw6I2EwYTVhYTtmaWxsLW9wYWNpdHk6MSIKICAgICAgIGlkPSJwYXRoNTciCiAgICAgICBkPSJtIDEwLjc2ODgwOSw2Ljc2MTYwNTEgMCwwIGMgLTAuMDE2ODgsLTAuMDE2ODc4IC0wLjAyNTMxLC0wLjA0MjE4MSAtMC4wMzM3NCwtMC4wNjc0OTkgLTAuMDA4NCwtMC4wMDgzOSAtMC4wMDg0LC0wLjAxNjg3OCAtMC4wMTY4OCwtMC4wMzM3NDMgQyA5Ljk5MjYxMTIsNS4xOTIzMzY2IDguMjIwODU1Nyw0LjU4NDg3ODEgNi43NDQzOTEyLDUuMjkzNTc5NyA1LjY3MjkwMDUsNS44MDgyMzI4IDUuMDU3MDA0Myw2Ljg4ODE2MTMgNS4wNjU0NDIsOC4wMDE4MzY1IDQuNDU3OTgyMiw3LjMxMDAwNzYgMy42OTg2NTg0LDYuNzk1MzU0NSAyLjg1NDk2NDIsNi40OTE2MjUzIDMuMjY4Mzc0Myw1LjA2NTc4MzEgNC4yNTU0OTYsMy44MTcxMTY2IDUuNjg5Nzc0NiwzLjEyNTI4NzggOC4zNjQyODMyLDEuODM0NDM2OCAxMS41NzAzMTksMi45Mzk2NzQ0IDEyLjg4NjQ4MSw1LjU4ODg3MjYgMTMuNDUxNzU1LDYuNzI3ODU5NiAxNC42NDk4MDEsNy4zNTIxOTIxIDE1Ljg0Nzg0Niw3LjIzNDA3NSAxNS43NjM0ODIsNi4zMzk3NiAxNS41MTg4MDUsNS40MzcwMDg2IDE1LjEwNTM5Niw0LjU3NjQ0MDQgMTMuMjE1NTIxLDAuNjg3MDEzNCA4LjUzMzAyMjYsLTAuOTQxMzE2MjcgNC42NDM1OTQzLDAuOTQwMTIxNzkgMi4zMjM0MzcsMi4wNjIyMzM0IDAuODA0Nzg4MTQsNC4xNzk5MDQ0IDAuMzU3NjMxMzIsNi41MzM4MDk4IDIuNDE2MjQzOCw2LjQyNDEyOSA0LjQzMjY3MTcsNy41MDQwNTc0IDUuNDM2NjY2Miw5LjQzNjExNjcgbCAwLjAwODM5LDAgYyAwLjc1OTMxOTIsMS4zNzUyMjAzIDIuNDcyMDE3OCwxLjk0MDQ5NTMgMy45MDYyOTYsMS4yNDg2NjczIDEuMDQ2MTc5OCwtMC41MDYyMTggMS42NTM2NDA4LC0xLjUzNTUyMzggMS42Nzg5NTA4LC0yLjYxNTQ1MTIgMC41ODIxNDgsMC43MDg3MDE4IDEuMzMzMDM1LDEuMjQ4NjY2OCAyLjE1OTg1NiwxLjU3NzcwNjQgLTAuNDM4NzIxLDEuMzU4MzQ3OCAtMS40MDA1MzMsMi41NDc5NTQ4IC0yLjc5MjYyNywzLjIxNDQ3ODggLTIuNTkwMTM4NywxLjI0ODY1OCAtNS42NzgwNTc0LDAuMjUzMTA0IC03LjA2MTcxNTEsLTIuMjI3MzU3IGwgMCwwIEMgMi43NjIxMDQ4LDkuNDUyOTg5NCAxLjUxMzQzODMsOC44MjAyMTkxIDAuMjgxNjQ1OTIsOC45NzIwODQ0IDAuMzgyODg3NjUsOS43OTg5MDQ2IDAuNjE5MTIzMzEsMTAuNjE3Mjg3IDAuOTk4Nzg1MiwxMS40MDE5MjIgYyAxLjg4MTQzNjgsMy44OTc4NjQgNi41NjM5MzcsNS41MjYxOTggMTAuNDYxODAwOCwzLjY0NDc2IDIuMjQ0MjI2LC0xLjA4ODM2OSAzLjczNzU2MiwtMy4xMDQ3OTYgNC4yMzUzNDIsLTUuMzc0MzMyMyAtMS45OTk1NTQsMC4wNDIxODEgLTMuOTQ4NDg2LC0xLjAyOTMwNjMgLTQuOTI3MTcsLTIuOTEwNzQzMyB6IgogICAgICAgY2xhc3M9InN0MTciIC8+CiAgPC9nPgo8L3N2Zz4K';
732
 
876
 
877
  /**
878
  * Executed this function on cron event.
879
+ *
880
+ * @return void
881
  */
882
  public function cron_action() {
883
 
897
 
898
  }
899
 
900
+ /**
901
+ * Schedule cron tasks used by plugin.
902
+ *
903
+ * @return void
904
+ */
905
+ public function schedule_plugin_cron_tasks() {
906
+ if (!wp_next_scheduled('wpo_plugin_cron_tasks')) {
907
+ wp_schedule_event(current_time("timestamp", 0), 'twicedaily', 'wpo_plugin_cron_tasks');
908
+ }
909
+
910
+ add_action('wpo_plugin_cron_tasks', array($this, 'do_plugin_cron_tasks'));
911
+ }
912
+
913
+ /**
914
+ * Do plugin background tasks.
915
+ *
916
+ * @return void
917
+ */
918
+ public function do_plugin_cron_tasks() {
919
+ // get information about corrupted tables.
920
+ $this->update_corrupted_tables_count();
921
+ }
922
+
923
+ /**
924
+ * Update corrupted tables count used with wp_optimize_get_tables filter.
925
+
926
+ * @return void
927
+ */
928
+ public function update_corrupted_tables_count() {
929
+ $tables = $this->get_optimizer()->get_tables();
930
+
931
+ $corrupted_tables_count = 0;
932
+
933
+ if (!empty($tables)) {
934
+ foreach ($tables as $table) {
935
+ if ($table->is_needing_repair) {
936
+ $corrupted_tables_count++;
937
+ }
938
+ }
939
+ }
940
+
941
+ // save results to options table and use it to notify user about corrupted tables.
942
+ $this->get_options()->update_option('corrupted-tables-count', $corrupted_tables_count);
943
+ }
944
+
945
  /**
946
  * This will customize a URL with a correct Affiliate link
947
  * This function can be update to suit any URL as longs as the URL is passed
1162
  return (is_multisite() && WP_Optimize()->is_premium());
1163
  }
1164
 
1165
+ /**
1166
+ * Returns true if current user can run optimizations.
1167
+ *
1168
+ * @return bool
1169
+ */
1170
+ public function can_run_optimizations() {
1171
+ // we don't check permissions for cron jobs.
1172
+ if (defined('DOING_CRON') && DOING_CRON) return true;
1173
+
1174
+ if (self::is_premium() && false == user_can(get_current_user_id(), 'wpo_run_optimizations')) return false;
1175
+ return true;
1176
+ }
1177
+
1178
+ /**
1179
+ * Returns true if current user can manage plugin options.
1180
+ *
1181
+ * @return bool
1182
+ */
1183
+ public function can_manage_options() {
1184
+ if (self::is_premium() && false == user_can(get_current_user_id(), 'wpo_manage_settings')) return false;
1185
+ return true;
1186
+ }
1187
+
1188
+ /**
1189
+ * Output information message for users who have no permissions to run optimizations.
1190
+ */
1191
+ public function prevent_run_optimizations_message() {
1192
+ $this->include_template('info-message.php', false, array('message' => __('You have no permissions to run optimizations.', 'wp-optimize')));
1193
+ }
1194
+
1195
+ /**
1196
+ * Output information message for users who have no permissions to manage settings.
1197
+ */
1198
+ public function prevent_manage_options_info() {
1199
+ $this->include_template('info-message.php', false, array('message' => __('You have no permissions to manage WP-Optimize settings.', 'wp-optimize')));
1200
+ }
1201
+
1202
  /**
1203
  * Returns list of all sites in multisite
1204
  *
1208
  $sites = array();
1209
  // check if function get_sites exists (since 4.6.0) else use wp_get_sites.
1210
  if (function_exists('get_sites')) {
1211
+ $sites = get_sites(array('network_id' => null, 'number' => 99999));
1212
  } elseif (function_exists('wp_get_sites')) {
1213
  // @codingStandardsIgnoreLine
1214
+ $sites = wp_get_sites(array('network_id' => null, 'limit' => 99999));
1215
  }
1216
  return $sites;
1217
  }
1370
  */
1371
  function wpo_uninstall_actions() {
1372
  WP_Optimize()->get_options()->delete_all_options();
1373
+ wp_clear_scheduled_hook('wpo_cron_plugin');
1374
  }
1375
 
1376
  function WP_Optimize() {