Formidable Forms – Form Builder for WordPress - Version 2.03.07

Version Description

  • New: Add frm_after_import_view hook.
  • New: Add frmPageChanged, frmFormComplete, and frmFormErrors jQuery events.
  • Fix: Include full where query in cache key to avoid identical keys for different queries.
  • Fix: Show all forms on the entry listing page.
  • Fix: Remove IE8-specific CSS causing errors in stylesheet.
  • Pro Version *
  • New: Add frm_before_create_post hook.
  • Enhancement: Add frm_final_submit class to submit button to make styling easier.
  • Fix: Add more file upload spam protection.
  • Fix: Allow star rating statistics to work for non-scale fields.
  • Fix: Prevent file uploads from some specific headless browsers.
  • Fix: Clear options when switching to Lookup field type to prevent conditional logic conflicts.
  • Fix: Convert show=id to show=ID in user ID shortcodes to prevent error messages.
  • Fix: Make sure Entry Status filter works.
  • Fix: Include Lookup Checkboxes in calculations.
Download this release

Release Info

Developer sswells
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 2.03.07
Comparing to
See all releases

Code changes from version 2.03.06 to 2.03.07

classes/helpers/FrmAppHelper.php CHANGED
@@ -10,7 +10,7 @@ class FrmAppHelper {
10
  /**
11
  * @since 2.0
12
  */
13
- public static $plug_version = '2.03.06';
14
 
15
  /**
16
  * @since 1.07.02
10
  /**
11
  * @since 2.0
12
  */
13
+ public static $plug_version = '2.03.07';
14
 
15
  /**
16
  * @since 1.07.02
classes/helpers/FrmEntriesListHelper.php CHANGED
@@ -19,7 +19,7 @@ class FrmEntriesListHelper extends FrmListHelper {
19
  $s_query['it.form_id'] = $form_id;
20
  $join_form_in_query = false;
21
  } else {
22
- $s_query['fr.parent_form_id'] = 0;
23
  $join_form_in_query = true;
24
  }
25
 
19
  $s_query['it.form_id'] = $form_id;
20
  $join_form_in_query = false;
21
  } else {
22
+ $s_query[] = array( 'or' => 1, 'parent_form_id' => null, 'parent_form_id <' => 1 );
23
  $join_form_in_query = true;
24
  }
25
 
classes/helpers/FrmXMLHelper.php CHANGED
@@ -588,9 +588,11 @@ class FrmXMLHelper {
588
  $imported['imported'][ $this_type ]++;
589
  }
590
 
591
- unset($post);
592
-
593
  $imported['posts'][ (int) $old_id ] = $post_id;
 
 
 
 
594
  }
595
 
596
  self::maybe_update_stylesheet( $imported );
588
  $imported['imported'][ $this_type ]++;
589
  }
590
 
 
 
591
  $imported['posts'][ (int) $old_id ] = $post_id;
592
+
593
+ do_action( 'frm_after_import_view', $post_id, $post );
594
+
595
+ unset( $post );
596
  }
597
 
598
  self::maybe_update_stylesheet( $imported );
classes/models/FrmDb.php CHANGED
@@ -349,11 +349,35 @@ class FrmDb {
349
 
350
  $query = self::generate_query_string_from_pieces( $field, $table, $where, $args );
351
 
352
- $cache_key = str_replace( array( ' ', ',' ), '_', trim( implode( '_', FrmAppHelper::array_flatten( $where ) ) . implode( '_', $args ) . $field . '_' . $type, ' WHERE' ) );
353
  $results = FrmAppHelper::check_cache( $cache_key, $group, $query, 'get_' . $type );
354
  return $results;
355
  }
356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  /**
358
  * @param string $table
359
  * @param array $where
349
 
350
  $query = self::generate_query_string_from_pieces( $field, $table, $where, $args );
351
 
352
+ $cache_key = self::generate_cache_key( $where, $args, $field, $type );
353
  $results = FrmAppHelper::check_cache( $cache_key, $group, $query, 'get_' . $type );
354
  return $results;
355
  }
356
 
357
+ /**
358
+ * Generate a cache key from the where query, field, type, and other arguments
359
+ *
360
+ * @since 2.03.07
361
+ *
362
+ * @param array $where
363
+ * @param array $args
364
+ * @param string $field
365
+ * @param string $type
366
+ *
367
+ * @return string
368
+ */
369
+ private static function generate_cache_key( $where, $args, $field, $type ) {
370
+ $cache_key = '';
371
+ $where = FrmAppHelper::array_flatten( $where );
372
+ foreach ( $where as $key => $value ) {
373
+ $cache_key .= $key . '_' . $value;
374
+ }
375
+ $cache_key .= implode( '_', $args ) . $field . '_' . $type;
376
+ $cache_key = str_replace( array( ' ', ',' ), '_', $cache_key );
377
+
378
+ return $cache_key;
379
+ }
380
+
381
  /**
382
  * @param string $table
383
  * @param array $where
classes/models/FrmEntryValidate.php CHANGED
@@ -2,8 +2,6 @@
2
 
3
  class FrmEntryValidate {
4
  public static function validate( $values, $exclude = false ) {
5
- global $wpdb;
6
-
7
  FrmEntry::sanitize_entry_post( $values );
8
  $errors = array();
9
 
@@ -16,36 +14,60 @@ class FrmEntryValidate {
16
  $errors['form'] = __( 'You do not have permission to do that', 'formidable' );
17
  }
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  if ( ! isset( $values['item_key'] ) || $values['item_key'] == '' ) {
 
20
  $values['item_key'] = FrmAppHelper::get_unique_key( '', $wpdb->prefix . 'frm_items', 'item_key' );
21
  $_POST['item_key'] = $values['item_key'];
22
  }
 
 
 
 
23
 
24
- $where = apply_filters('frm_posted_field_ids', array( 'fi.form_id' => $values['form_id'] ) );
25
  // Don't get subfields
26
  $where['fr.parent_form_id'] = array( null, 0 );
 
27
  // Don't get excluded fields (like file upload fields in the ajax validation)
28
  if ( ! empty( $exclude ) ) {
29
  $where['fi.type not'] = $exclude;
30
  }
31
 
32
- $posted_fields = FrmField::getAll($where, 'field_order');
33
-
34
- // Pass exclude value to validate_field function so it can be used for repeating sections
35
- $args = array( 'exclude' => $exclude );
36
-
37
- foreach ( $posted_fields as $posted_field ) {
38
- self::validate_field($posted_field, $errors, $values, $args);
39
- unset($posted_field);
40
- }
41
-
42
- // check for spam
43
- self::spam_check( $exclude, $values, $errors );
44
-
45
- $errors = apply_filters( 'frm_validate_entry', $errors, $values, compact('exclude') );
46
-
47
- return $errors;
48
- }
49
 
50
  public static function validate_field( $posted_field, &$errors, $values, $args = array() ) {
51
  $defaults = array(
2
 
3
  class FrmEntryValidate {
4
  public static function validate( $values, $exclude = false ) {
 
 
5
  FrmEntry::sanitize_entry_post( $values );
6
  $errors = array();
7
 
14
  $errors['form'] = __( 'You do not have permission to do that', 'formidable' );
15
  }
16
 
17
+ self::set_item_key( $values );
18
+
19
+ $posted_fields = self::get_fields_to_validate( $values, $exclude );
20
+
21
+ // Pass exclude value to validate_field function so it can be used for repeating sections
22
+ $args = array( 'exclude' => $exclude );
23
+
24
+ $check_later = array();
25
+ foreach ( $posted_fields as $posted_field ) {
26
+ if ( $posted_field->type == 'file' ) {
27
+ $check_later[] = $posted_field;
28
+ } else {
29
+ self::validate_field( $posted_field, $errors, $values, $args );
30
+ }
31
+ unset( $posted_field );
32
+ }
33
+
34
+ // check for spam
35
+ self::spam_check( $exclude, $values, $errors );
36
+ if ( ! empty( $errors ) ) {
37
+ return $errors;
38
+ }
39
+
40
+ foreach ( $check_later as $posted_field ) {
41
+ self::validate_field( $posted_field, $errors, $values, $args );
42
+ unset( $posted_field );
43
+ }
44
+
45
+ $errors = apply_filters( 'frm_validate_entry', $errors, $values, compact('exclude') );
46
+
47
+ return $errors;
48
+ }
49
+
50
+ private static function set_item_key( &$values ) {
51
  if ( ! isset( $values['item_key'] ) || $values['item_key'] == '' ) {
52
+ global $wpdb;
53
  $values['item_key'] = FrmAppHelper::get_unique_key( '', $wpdb->prefix . 'frm_items', 'item_key' );
54
  $_POST['item_key'] = $values['item_key'];
55
  }
56
+ }
57
+
58
+ private static function get_fields_to_validate( $values, $exclude ) {
59
+ $where = apply_filters( 'frm_posted_field_ids', array( 'fi.form_id' => $values['form_id'] ) );
60
 
 
61
  // Don't get subfields
62
  $where['fr.parent_form_id'] = array( null, 0 );
63
+
64
  // Don't get excluded fields (like file upload fields in the ajax validation)
65
  if ( ! empty( $exclude ) ) {
66
  $where['fi.type not'] = $exclude;
67
  }
68
 
69
+ return FrmField::getAll( $where, 'field_order' );
70
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  public static function validate_field( $posted_field, &$errors, $values, $args = array() ) {
73
  $defaults = array(
css/_single_theme.css.php CHANGED
@@ -530,10 +530,8 @@ if ( ! $submit_style ) { ?>
530
  -ms-box-sizing:border-box;
531
  <?php if ( ! empty( $submit_shadow_color ) ) { ?>
532
  -moz-box-shadow:0 1px 1px #<?php echo esc_html( $submit_shadow_color ); ?>;
533
- -webkit-box-shadow:0px 1px 1px #<?php echo esc_html( $submit_shadow_color ); ?>;
534
  box-shadow:0 1px 1px #<?php echo esc_html( $submit_shadow_color ); ?>;
535
- -ms-filter:"progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=135, Color='#<?php echo esc_html( $submit_shadow_color ); ?>')";
536
- filter:progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=135, Color='#<?php echo esc_html( $submit_shadow_color ); ?>');
537
  <?php } ?>
538
  margin:<?php echo esc_html( $submit_margin ) ?>;
539
  margin-left:0;
530
  -ms-box-sizing:border-box;
531
  <?php if ( ! empty( $submit_shadow_color ) ) { ?>
532
  -moz-box-shadow:0 1px 1px #<?php echo esc_html( $submit_shadow_color ); ?>;
533
+ -webkit-box-shadow:0 1px 1px #<?php echo esc_html( $submit_shadow_color ); ?>;
534
  box-shadow:0 1px 1px #<?php echo esc_html( $submit_shadow_color ); ?>;
 
 
535
  <?php } ?>
536
  margin:<?php echo esc_html( $submit_margin ) ?>;
537
  margin-left:0;
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 2.03.06
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
2
  /*
3
  Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 2.03.07
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
js/formidable.js CHANGED
@@ -160,6 +160,7 @@ function frmFrontFormJS(){
160
  },
161
  init: function() {
162
  this.on('sending', function(file, xhr, formData) {
 
163
  if ( isSpam() ) {
164
  this.removeFile(file);
165
  alert('Oops. That file looks like Spam.');
@@ -244,13 +245,23 @@ function frmFrontFormJS(){
244
 
245
  function isSpam() {
246
  var val = document.getElementById('frm_verify').value;
247
- if ( val !== '' ) {
248
  return true;
249
  } else {
250
  return false;
251
  }
252
  }
253
 
 
 
 
 
 
 
 
 
 
 
254
  function getHiddenUploadHTML( field, mediaID, fieldName ) {
255
  return '<input name="'+ fieldName +'[]" type="hidden" value="'+ mediaID +'" data-frmfile="'+ field.fieldID +'" />';
256
  }
@@ -3419,12 +3430,8 @@ function frmFrontFormJS(){
3419
  jQuery(document.getElementById('frm_edit_'+ entryIdField.val())).find('a').addClass('frm_ajax_edited').click();
3420
  }
3421
 
3422
- var formCompleted = jQuery(response.content).find('.frm_message');
3423
- if ( formCompleted.length ) {
3424
- // if the success message is showing, run the logic
3425
- checkConditionalLogic( 'pageLoad' );
3426
- }
3427
- checkFieldsOnPage();
3428
  } else if ( Object.keys(response.errors).length ) {
3429
  // errors were returned
3430
 
@@ -3474,6 +3481,8 @@ function frmFrontFormJS(){
3474
  }
3475
  }
3476
 
 
 
3477
  fieldset.removeClass('frm_doing_ajax');
3478
  scrollToFirstField( object );
3479
 
@@ -3532,6 +3541,19 @@ function frmFrontFormJS(){
3532
  return kvp.join('&');
3533
  }
3534
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3535
  function addFieldError( $fieldCont, key, jsErrors ) {
3536
  if ( $fieldCont.length && $fieldCont.is(':visible') ) {
3537
  $fieldCont.addClass('frm_blank_field');
160
  },
161
  init: function() {
162
  this.on('sending', function(file, xhr, formData) {
163
+
164
  if ( isSpam() ) {
165
  this.removeFile(file);
166
  alert('Oops. That file looks like Spam.');
245
 
246
  function isSpam() {
247
  var val = document.getElementById('frm_verify').value;
248
+ if ( val !== '' || isHeadless() ) {
249
  return true;
250
  } else {
251
  return false;
252
  }
253
  }
254
 
255
+ function isHeadless() {
256
+ return (
257
+ window._phantom || window.callPhantom || //phantomjs
258
+ window.__phantomas || //PhantomJS-based web perf metrics
259
+ window.Buffer || //nodejs
260
+ window.emit || //couchjs
261
+ window.spawn //rhino
262
+ );
263
+ }
264
+
265
  function getHiddenUploadHTML( field, mediaID, fieldName ) {
266
  return '<input name="'+ fieldName +'[]" type="hidden" value="'+ mediaID +'" data-frmfile="'+ field.fieldID +'" />';
267
  }
3430
  jQuery(document.getElementById('frm_edit_'+ entryIdField.val())).find('a').addClass('frm_ajax_edited').click();
3431
  }
3432
 
3433
+ afterFormSubmitted( object, response );
3434
+
 
 
 
 
3435
  } else if ( Object.keys(response.errors).length ) {
3436
  // errors were returned
3437
 
3481
  }
3482
  }
3483
 
3484
+ jQuery(document).trigger( 'frmFormErrors', [ object, response ] );
3485
+
3486
  fieldset.removeClass('frm_doing_ajax');
3487
  scrollToFirstField( object );
3488
 
3541
  return kvp.join('&');
3542
  }
3543
 
3544
+ function afterFormSubmitted( object, response ) {
3545
+ var formCompleted = jQuery(response.content).find('.frm_message');
3546
+ if ( formCompleted.length ) {
3547
+ jQuery(document).trigger( 'frmFormComplete', [ object, response ] );
3548
+
3549
+ // if the success message is showing, run the logic
3550
+ checkConditionalLogic( 'pageLoad' );
3551
+ } else {
3552
+ jQuery(document).trigger( 'frmPageChanged', [ object, response ] );
3553
+ }
3554
+ checkFieldsOnPage();
3555
+ }
3556
+
3557
  function addFieldError( $fieldCont, key, jsErrors ) {
3558
  if ( $fieldCont.length && $fieldCont.is(':visible') ) {
3559
  $fieldCont.addClass('frm_blank_field');
js/formidable.min.js CHANGED
@@ -3,35 +3,35 @@ f+'"]'),jQuery(a).append('<input name="frm_last_page" type="hidden" value="'+f.v
3
  function q(){if(-1===this.className.indexOf("frm_custom_date")&&"undefined"!==typeof __frmDatepicker){var a=__frmDatepicker,b=this.id,c=b.split("-"),c=H(this.name)?'input[id^="'+c[0]+'"]':'input[id^="'+c.join("-")+'"]';jQuery.datepicker.setDefaults(jQuery.datepicker.regional[""]);for(var d=0,e=0;e<a.length;e++)if(a[e].triggerID=="#"+b||a[e].triggerID==c){d=e;break}""!==a[d].options.defaultDate&&(a[d].options.defaultDate=new Date(a[d].options.defaultDate));jQuery(this).datepicker(jQuery.extend(jQuery.datepicker.regional[a[d].locale],
4
  a[d].options))}}function t(a){if("undefined"!==typeof __frmDropzone)for(var b=__frmDropzone,c=0;c<b.length;c++)y(c,a)}function y(a,b){var c=__frmDropzone,d="#"+c[a].htmlID+"_dropzone",e=c[a].fieldName;"undefined"!==typeof b&&-1!==d.indexOf("-0_dropzone")&&(d=d.replace("-0_dropzone","-"+b+"_dropzone"),e=e.replace("[0]","["+b+"]"),delete c[a].mockFiles);d=jQuery(d);if(!(1>d.length||d.hasClass("dz-clickable"))){var f=c[a].maxFiles;if("undefined"!==typeof c[a].mockFiles){var h=c[a].mockFiles.length;0<
5
  f&&(f-=h)}var g=d.closest("form"),h="#"+g.attr("id");"#undefined"==h&&(h="form."+g.attr("class").replace(" ","."));d.dropzone({url:frm_js.ajax_url,addRemoveLinks:!0,paramName:d.attr("id").replace("_dropzone",""),maxFilesize:c[a].maxFilesize,maxFiles:f,uploadMultiple:c[a].uploadMultiple,hiddenInputContainer:h,dictDefaultMessage:c[a].defaultMessage,dictFallbackMessage:c[a].fallbackMessage,dictFallbackText:c[a].fallbackText,dictFileTooBig:c[a].fileTooBig,dictInvalidFileType:c[a].invalidFileType,dictResponseError:c[a].responseError,
6
- dictCancelUpload:c[a].cancel,dictCancelUploadConfirmation:c[a].cancelConfirm,dictRemoveFile:c[a].remove,dictMaxFilesExceeded:c[a].maxFilesExceeded,fallback:function(){jQuery(this.element).closest("form").removeClass("frm_ajax_submit")},init:function(){this.on("sending",function(b,d,e){d=""!==document.getElementById("frm_verify").value?!0:!1;if(d)return this.removeFile(b),alert("Oops. That file looks like Spam."),!1;e.append("action","frm_submit_dropzone");e.append("field_id",c[a].fieldID);e.append("form_id",
7
- c[a].formID);e.append("nonce",frm_js.nonce)});this.on("success",function(b,d){for(var f=jQuery.parseJSON(d),g=0;g<f.length;g++)!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val(f[g])});this.on("successmultiple",function(b,d){for(var f=jQuery.parseJSON(d),g=0;g<b.length;g++)jQuery(b[g].previewElement).append(z(c[a],f[g],e))});this.on("complete",function(b){if("undefined"!==typeof b.mediaID){c[a].uploadMultiple&&jQuery(b.previewElement).append(z(c[a],b.mediaID,e));for(var d=b.previewElement.querySelectorAll("[data-dz-name]"),
8
- f=0,g=d.length;f<g;f++)d[f].innerHTML='<a href="'+b.url+'">'+b.name+"</a>"}});this.on("addedfile",function(){S(g)});this.on("queuecomplete",function(){I(g,"enable")});this.on("removedfile",function(b){!1!==b.accepted&&!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val("");!1!==b.accepted&&"undefined"!==typeof b.mediaID&&(jQuery(b.previewElement).remove(),this.options.maxFiles=c[a].maxFiles-this.files.length)});if("undefined"!==typeof c[a].mockFiles)for(var b=0;b<c[a].mockFiles.length;b++){var d=
9
- {name:c[a].mockFiles[b].name,size:c[a].mockFiles[b].size,url:c[a].mockFiles[b].file_url,mediaID:c[a].mockFiles[b].id};this.emit("addedfile",d);this.emit("thumbnail",d,c[a].mockFiles[b].url);this.emit("complete",d);this.files.push(d)}}})}}function z(a,b,c){return'<input name="'+c+'[]" type="hidden" value="'+b+'" data-frmfile="'+a.fieldID+'" />'}function B(){var a=jQuery(this).data("frm-remove");bb(jQuery(this).parent(".dz-preview"));a=jQuery('input[name="'+a+'"]');a.length&&a.val("")}function w(){var a=
10
- this.type,b=!1,c=!1;if("select-one"===a)c=!0,"frm_other_trigger"===this.options[this.selectedIndex].className&&(b=!0);else if("select-multiple"===a)for(var c=!0,d=this.options,b=!1,e=0;e<d.length;e++)if("frm_other_trigger"===d[e].className&&d[e].selected){b=!0;break}c?(a=jQuery(this).parent().children(".frm_other_input"),a.length&&(b?a[0].className=a[0].className.replace("frm_pos_none",""):(1>a[0].className.indexOf("frm_pos_none")&&(a[0].className+=" frm_pos_none"),a[0].value=""))):"radio"===a?jQuery(this).is(":checked")&&
11
- (jQuery(this).closest(".frm_radio").children(".frm_other_input").removeClass("frm_pos_none"),jQuery(this).closest(".frm_radio").siblings().children(".frm_other_input").addClass("frm_pos_none").val("")):"checkbox"===a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}function A(a){var b=p(this,!1);if(b&&"undefined"!==typeof b&&(!a.frmTriggered||
12
- a.frmTriggered!=b)&&(la(b,jQuery(this)),a="undefined"!==typeof a.originalEvent||-1<a.currentTarget.className.indexOf("frm_chzn")?"value changed":"other",ma(b,jQuery(this),a),T(b,jQuery(this)),jQuery(this).closest("form").hasClass("frm_js_validate"))){b=[];a=jQuery(this).closest(".frm_form_field");a.hasClass("frm_required_field")&&!jQuery(this).hasClass("frm_optional")&&(b=na(this,b));if(1>b.length)if("email"==this.type)var c=jQuery(this).closest("form").find("input[type=email]"),b=oa(this,b,c);else"number"==
13
- this.type?b=pa(this,b):null!==this.pattern&&(b=qa(this,b));a.removeClass("frm_blank_field");a.find(".frm_error").remove();if(0<Object.keys(b).length)for(var d in b)U(a,d,b)}}function p(a,b){var c="",c=a instanceof jQuery?a.attr("name"):a.name;if(""===c)return c=a instanceof jQuery?a.data("name"):a.getAttribute("data-name"),""!==c&&c?c:0;c=c.replace("item_meta[","").replace("[]","").split("]");if(1>c.length)return 0;var c=c.filter(function(a){return""!==a}),d=c[0],e=!1;if(1===c.length)return d;if("[form"===
14
- c[1]||"[row_ids"===c[1])return 0;jQuery('input[name="item_meta['+d+'][form]"]').length&&(d=c[2].replace("[",""),e=!0);"other"===d&&(d=e?c[3].replace("[",""):c[1].replace("[",""));!0===b&&(d=d===c[0]?d+"-"+c[1].replace("[",""):d+"-"+c[0]+"-"+c[1].replace("[",""));return d}function la(a,b){if(!("undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[a]||1>__FRMRULES[a].dependents.length||null===b||"undefined"===typeof b))for(var c=__FRMRULES[a],d=J(b[0].name),e=0,f=c.dependents.length;e<f;e++)K(c.dependents[e],
15
- d)}function K(a,b){var c=V(a);if(!(!1===c||1>c.conditions.length)){var d;d=[];if(c.isRepeating)if(""!==b.repeatingSection){var e="frm_field_"+c.fieldId+"-",e=e+(b.repeatingSection+"-"+b.repeatRow+"_container");d.push(e)}else if(d=L(c),null!==document.getElementById("frm_field_"+d+"_container")){d=[];for(var e=document.querySelectorAll(".frm_field_"+c.fieldId+"_container"),f=0,h=e.length;f<h;f++)d.push(e[f].id)}else{d=[];for(var f=L(c),e="frm_field_"+c.fieldId+"-"+f+"-",f=document.querySelectorAll('[name="item_meta['+
16
- f+'][row_ids][]"]'),h=0,g=f.length;h<g;h++)""!==f[h].value&&d.push(e+f[h].value+"_container");1>d.length&&d.push(e+"0_container")}else d.push("frm_field_"+c.fieldId+"_container");e=d.length;for(f=0;f<e;f++)c.containerId=d[f],ra(c,d[f]),sa(c)}}function L(a){var b="";"0"!==a.inEmbedForm?b=a.inEmbedForm:"0"!==a.inSection&&(b=a.inSection);return b}function ra(a,b){if(a.isRepeating){var c=b.replace("_container","").split("-");a.repeatRow=c[2]}else a.repeatRow=""}function sa(a){for(var b=[],c=a.conditions.length,
17
- d=0;d<c;d++)b.push(cb(a.conditions[d],a));c=D="any"==a.anyAll?-1<b.indexOf(!0)?a.showHide:ta(a.showHide):-1<b.indexOf(!1)?ta(a.showHide):a.showHide;b=null!==document.getElementById(a.containerId);"show"==c?"data"==a.fieldType&&a.hasOwnProperty("dataLogic")?(a={fieldId:a.fieldId,fieldKey:a.fieldKey,formId:a.formId,containerId:a.containerId,repeatRow:a.repeatRow,dataLogic:{actualValue:a.dataLogic.actualValue,fieldId:a.dataLogic.fieldId},children:"",inputType:a.inputType},"data"==a.inputType?db(a,b):
18
- b&&eb(a)):!1!==C(a.containerId,a.formId)&&(E(a.containerId,a.formId),b?(b=ua(a.containerId),va(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId),jQuery("#"+a.containerId).show()):(b=wa(a),va(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId))):W(a,b)}function V(a){return"undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[a]?!1:__FRMRULES[a]}function cb(a,b){var c=V(a.fieldId),d=xa(c,b);"data"==b.fieldType&&"data"==c.fieldType?(c=""===a.value?""===d||1==d.length&&""===d[0]?
19
- !1:!0:X(a.operator,a.value,d),b.dataLogic=a,b.dataLogic.actualValue=d,d=c):d=X(a.operator,a.value,d);return d}function xa(a,b){var c;if("radio"==a.inputType||"checkbox"==a.inputType)c=ya(a,b),c=document.querySelectorAll('input[name^="'+c+'"]'),c="checkbox"==a.inputType?M(c):Y(c);else if(!0===a.isMultiSelect){c=ya(a,b);var d=document.querySelectorAll('[name^="'+c+'"]');1==d.length&&"hidden"!=d[0].type?(c=jQuery('[name^="'+c+'"]').val(),null===c&&(c="")):c=M(d)}else if(c="field_"+a.fieldKey,a.isRepeating&&
20
- (c+="-"+b.repeatRow),d=document.getElementById(c),null===d){d="";if("time"==a.fieldType){var e=document.getElementById(c+"_H");null!==e&&(d=document.getElementById(c+"_m"),d=e.value+":"+d.value,c=document.getElementById(c+"_A"),":"==d?d="":null!==c&&(d+=" "+c.value))}c=d}else c=d.value;"undefined"===typeof c?c="":"string"===typeof c&&(c=c.trim());return c}function ya(a,b){return a.isRepeating?"item_meta["+("0"!==b.inEmbedForm?b.inEmbedForm:b.inSection)+"]["+b.repeatRow+"]["+a.fieldId+"]":"item_meta["+
21
- a.fieldId+"]"}function M(a){for(var b=[],c=0,d=a.length;c<d;c++)("hidden"==a[c].type||a[c].checked)&&b.push(a[c].value);0===b.length&&(b=!1);return b}function X(a,b,c){b=fb(b);c=gb(b,c);return"string"===typeof b&&"-1"!=b.indexOf("&quot;")&&X(a,b.replace("&quot;",'"'),c)?!0:{"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"<":function(a,b){return a>b},">":function(a,b){return a<b},LIKE:function(a,b){if(!b)return!1;a=Z(a);b=za(a,b);return-1!=b.indexOf(a)},"not LIKE":function(a,b){if(!b)return!0;
22
- a=Z(a);b=za(a,b);return-1==b.indexOf(a)}}[a](b,c)}function fb(a){-1!==String(a).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)?a=parseFloat(a):"string"===typeof a&&(a=a.trim());return a}function gb(a,b){"undefined"===typeof b&&(b="");jQuery.isArray(b)&&-1<jQuery.inArray(String(a),b)&&(b=a);"number"===typeof a&&"string"===typeof b&&(b=parseFloat(b));"string"===typeof b&&(b=b.trim());return b}function za(a,b){b=Z(b);var c;if(jQuery.isArray(b))for(var d=0,e=b.length;d<e;d++)if(c=b[d].toLowerCase(),
23
- -1<c.indexOf(a)){b=a;break}return b}function Z(a){"string"===typeof a?a=a.toLowerCase():"number"===typeof a&&(a=a.toString());return a}function ta(a){return"show"==a?"hide":"show"}function ua(a){return document.getElementById(a).querySelectorAll('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]')}function wa(a){if("divider"==a.fieldType){var b=[];"divider"==a.fieldType&&(b=document.querySelectorAll('[data-sectionid="'+a.fieldId+'"]'));a=b}else"form"==a.fieldType?a=
24
- document.querySelectorAll('[id^="field_'+a.fieldKey+'-"]'):(a=a.isRepeating?"item_meta["+L(a)+"]["+a.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]",a=document.querySelectorAll('[name^="'+a+'"]'));return a}function va(a,b,c){if(a.length)for(var d,e=["checkbox","radio"],f=0;f<a.length;f++)if(!(0<f&&"undefined"!==typeof d&&d.name==a[f].name&&-1<e.indexOf(d.type)||b&&N(a[f],c))){d=a[f];var h=jQuery(d),g=h.data("frmval");if("undefined"!==typeof g){if("checkbox"==d.type||"radio"==d.type)Aa(d.name,
25
- g);else if(-1<d.name.indexOf("[]")){var k=document.getElementsByName(d.name);if(jQuery.isArray(g))for(var n=0,l=g.length;n<l;n++)n in k&&(k[n].value=g[n]);else null!==k[0]&&(k[0].value=g)}else g.constructor===Object&&(k=d.getAttribute("name").split("[").slice(-1)[0],null!==k&&(k=k.replace("]",""),g=g[k],"undefined"==typeof g&&(g=""))),d.value=g;"SELECT"==d.tagName&&O(d);v(h)}d=a[f];h=p(d,!1);h=aa(h);!1!==h&&"lookup"!=h.fieldType&&Ba(h,d,"value changed");d=a[f];if(h="undefined"!==typeof __FRMCALC){h=
26
- d.type;g=!1;if("text"==h||"hidden"==h||"number"==h)g=!0;h=g}if(h){h=__FRMCALC;g=d.name;k=d.id.replace("field_","");if(H(g))for(g=k.split("-"),k="",n=0;n<g.length-1;n++)k=""===k?g[n]:k+"-"+g[n];g=k;k=null;H(d.name)&&(k="hidden"!=d.type?jQuery(d).closest(".frm_form_field"):jQuery(d));d=k;void 0!==h.calc[g]&&ba(h,g,[],d)}d=a[f]}}function N(a,b){var c=p(a,!0);return C("frm_field_"+c+"_container",b)}function W(a,b){if(!C(a.containerId,a.formId)){if(b){jQuery("#"+a.containerId).hide();var c=ua(a.containerId)}else c=
27
- wa(a);ca(c);Ca(a.containerId,a.formId)}}function ca(a){if(!(1>a.length)){for(var b,c=!0,d=0,e=a.length;d<e;d++)-1<a[d].className.indexOf("frm_dnc")||(0<d&&b.name!=a[d].name&&!0===c&&v(jQuery(b)),c=!0,"radio"==a[d].type||"checkbox"==a[d].type?a[d].checked=!1:"SELECT"==a[d].tagName?(0===a[d].selectedIndex?c=!1:a[d].selectedIndex=0,b=a[d].id.replace(/[^\w]/g,"_"),null!==document.getElementById(b+"_chosen")&&jQuery(a[d]).trigger("chosen:updated")):a[d].value=""),b=a[d];!0===c&&v(jQuery(b))}}function C(a,
28
- b){var c=!1;-1<F(b).indexOf(a)&&(c=!0);return c}function Ca(a,b){var c=F(b);if(!(-1<c.indexOf(a))){c.push(a);var c=JSON.stringify(c),d=document.getElementById("frm_hide_fields_"+b);null!==d&&(d.value=c)}}function F(a){var b=[];a=document.getElementById("frm_hide_fields_"+a);return null===a?b:b=(b=a.value)?JSON.parse(b):[]}function Aa(a,b){for(var c=document.getElementsByName(a),d=0,e=c.length;d<e;d++)if("hidden"==c[d].type)jQuery.isArray(b)&&null!==b[d]?c[d].value=b[d]:c[d].value=b;else if(c[d].value==
29
- b||jQuery.isArray(b)&&-1<b.indexOf(c[d].value))if(c[d].checked=!0,"radio"==c[d].type)break}function E(a,b){var c=F(b),d=c.indexOf(a);-1<d&&(c.splice(d,1),c=JSON.stringify(c),document.getElementById("frm_hide_fields_"+b).value=c)}function ma(a,b,c){if(!("undefined"===typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]||1>__FRMLOOKUP[a].dependents.length||null===b||"undefined"===typeof b)){a=__FRMLOOKUP[a];b=J(b[0].name);for(var d=0,e=a.dependents.length;d<e;d++)da(a.dependents[d],b,c)}}function da(a,
30
- b,c){a=aa(a);if(!(!1===a||1>a.parents.length))if("lookup"==a.fieldType){if(""!==b.repeatRow){c=[];var d="frm_field_"+a.fieldId+"-",d=d+(b.repeatingSection+"-"+b.repeatRow+"_container");b=document.getElementById(d);null!==b&&c.push(b);b=c}else b=[],a.isRepeating?b=document.querySelectorAll(".frm_field_"+a.fieldId+"_container"):(c=document.getElementById("frm_field_"+a.fieldId+"_container"),null!==c&&b.push(c));c=0;for(d=b.length;c<d;c++){ra(a,b[c].id);var e=a,f=b[c];e.parentVals=Da(e);if("select"==
31
- e.inputType)hb(e,f);else if("radio"==e.inputType||"checkbox"==e.inputType)if(!1===e.parentVals){var h=f.getElementsByTagName("input");Ea(e,f);ca(h)}else ib(e,f)}}else if("value changed"===c)for(c="field_"+a.fieldKey,c=a.isRepeating?""!==b.repeatingSection?'[id="'+c+"-"+b.repeatRow+'"]':'[id^="'+c+'-"]':'[id="'+c+'"]',b=document.querySelectorAll(c),c=0,d=b.length;c<d;c++)e=a,f=J(b[c].name),e.repeatRow=""!==f.repeatRow?f.repeatRow:"",Ba(a,b[c])}function aa(a){return"undefined"===typeof __FRMLOOKUP||
32
- "undefined"===typeof __FRMLOOKUP[a]?!1:__FRMLOOKUP[a]}function Ba(a,b){a.parentVals=Da(a);var c=b.id;c in r&&0<r[c].length?Fa(a,b):(Fa(a,b),Ga(a,b))}function Da(a){for(var b=[],c=a.parents,d,e=0,f=c.length;e<f;e++){d=aa(c[e]);d=xa(d,a);if(""===d||!1===d){b=!1;break}b[e]=d}return b}function Y(a){for(var b=!1,c=a.length,d=0;d<c;d++)if("hidden"==a[d].type||a[d].checked){b=a[d].value;break}return b}function hb(a,b){var c=b.getElementsByTagName("SELECT")[0];if(null!==c){var d=c.value;!1===a.parentVals?
33
- (c.options.length=1,c.value="",O(c),""!==d&&v(jQuery(c),a.fieldKey)):(jb(c),ea(a.formId),jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_lookup_field_options",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(d){var e=c.value;d=JSON.parse(d);for(var h=c.options.length;0<h;h--)c.remove(h);for(var g=d.length,h=0;h<g;h++)c.options[h+1]=new Option(d[h],d[h],!1,!1);c.value=e;""===c.value&&(d=c.getAttribute("data-frmval"),null!==
34
- d&&(c.value=d));!1===a.isReadOnly&&(c.disabled=!1);c.className=c.className.replace(" frm_loading_lookup","");O(c);c.value!=e&&v(jQuery(c),a.fieldKey);Ha(jQuery(b));fa(a.formId)}}))}}function O(a){-1<a.className.indexOf("frm_chzn")&&jQuery().chosen&&jQuery(a).trigger("chosen:updated")}function jb(a){a.className+=" frm_loading_lookup";a.disabled=!0;O(a)}function ea(a){P++;1>=P&&(a=Ia(a),null!==a&&S(jQuery(a)))}function fa(a){P--;0>=P&&(a=Ia(a),null!==a&&I(jQuery(a),"enable"))}function Ia(a){return document.querySelector("#frm_form_"+
35
  a+"_container form")}function ib(a,b){var c=b.getElementsByClassName("frm_opt_container")[0],d=c.getElementsByTagName("input");kb(b,c);var e="",e="radio"==a.inputType?Y(d):M(d),f=jQuery(d[0]).data("frmval");ea(a.formId);jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_cb_radio_lookup_options",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,container_field_id:L(a),row_index:a.repeatRow,current_value:e,default_value:f,nonce:frm_js.nonce},success:function(e){c.innerHTML=
36
  e;e=b.getElementsByClassName("frm-loading-img")[0];null!==e&&void 0!==e&&e.parentNode.removeChild(e);c.style.display="block";1==d.length&&""===d[0].value?Ea(a,b):(!1!==C(b.id,a.formId)&&(e=V(a.fieldId),!1===e||1>e.conditions.length?(E(b.id,a.formId),jQuery("#"+b.id).show()):(e.containerId=b.id,e.repeatRow=a.repeatRow,sa(e))),void 0!==f&&(!1!==("radio"==a.inputType?Y(d):M(d))||1>d.length||Aa(d[0].name,f)));v(jQuery(d[0]),a.fieldKey);Ha(jQuery(b));fa(a.formId)}})}function Ha(a){a.trigger("frmLookupOptionsLoaded")}
37
  function Ea(a,b){C(b.id,a.formId)||(jQuery("#"+b.id).hide(),Ca(b.id,a.formId))}function Ga(a,b){if(N(b,a.formId))ga(b.id);else if(!1===a.parentVals){var c=b.getAttribute("data-frmval");null===c&&(c="");Ja(a,b,c);ga(b.id)}else ea(a.formId),jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_get_lookup_text_value",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(c){N(b,a.formId)||b.value==c||Ja(a.fieldKey,b,c);fa(a.formId);ga(b.id)}})}
@@ -55,42 +55,42 @@ e in b||(b[e]=G(a,"data-reqmsg")));return b}function qb(a){var b="";jQuery('inpu
55
  d&&!1===h.test(d)?(b[e]=g,f&&(b[e.replace("conf_","")]="")):f&&(a=a.name.replace("conf_",""),c.filter('[name="'+a+'"]').val()!==d&&(b[e]="",b[e.replace("conf_","")]=""))}return b}function pa(a,b){var c=a.value;""!==c&&!1!==isNaN(c/1)&&(c=p(a,!0),c in b||(b[c]=G(a,"data-invmsg")));return b}function qa(a,b){var c=a.value,d=G(a,"pattern");if(""!==d&&""!==c){var e=p(a,!0);e in b||(d=new RegExp("^"+d+"$","i"),!1===d.test(c)&&(b[e]=G(a,"data-invmsg")))}return b}function G(a,b){var c=a.getAttribute(b);null===
56
  c&&(c="");return c}function rb(a,b){"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();var c=jQuery(a).find(".frm_form_field");c.addClass("frm_doing_ajax");jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){var d={content:"",errors:{},pass:!1};null===b&&(b=d);b=b.replace(/^\s+|\s+$/g,"");b=0===b.indexOf("{")?jQuery.parseJSON(b):d;if("undefined"!=typeof b.redirect)window.location=b.redirect;
57
  else if(""!==b.content){I(jQuery(a));-1!=frm_js.offset&&frmFrontForm.scrollMsg(jQuery(a),!1);var f=jQuery(a).find('input[name="form_id"]').val();b.content=b.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");jQuery(a).closest(".frm_forms").replaceWith(b.content);d=b;if(history.pushState&&"undefined"!=typeof d.page){var h,g=d.page;h=encodeURI("frm_page");for(var g=encodeURI(g),k=document.location.search.substr(1).split("&"),n=k.length,l;n--;)if(l=k[n].split("="),l[0]==h){l[1]=g;k[n]=l.join("=");
58
- break}0>n&&(k[k.length]=[h,g].join("="));h=k.join("&");window.history.pushState({html:d.html},"","?"+h)}"function"==typeof frmThemeOverride_frmAfterSubmit&&(f=jQuery('input[name="frm_page_order_'+f+'"]').val(),d=jQuery(b.content).find('input[name="form_id"]').val(),frmThemeOverride_frmAfterSubmit(d,f,b.content,a));f=jQuery(a).find('input[name="id"]');f.length&&jQuery(document.getElementById("frm_edit_"+f.val())).find("a").addClass("frm_ajax_edited").click();jQuery(b.content).find(".frm_message").length&&
59
- ja("pageLoad");ka()}else if(Object.keys(b.errors).length){I(jQuery(a),"enable");d=!0;Va();h=!1;for(f in b.errors)g=jQuery(a).find("#frm_field_"+f+"_container"),g.length&&(g.is(":visible")||(k=g.closest(".frm_toggle_container"),k.length&&(k=k.prev(),k.hasClass("frm_trigger")||(k=k.prev(".frm_trigger")),k.click())),g.is(":visible")&&(U(g,f,b.errors),d=!1,g=jQuery(a).find("#frm_field_"+f+"_container .frm-g-recaptcha, #frm_field_"+f+"_container .g-recaptcha"),g.length&&(h=!0,g=g.data("rid"),jQuery().grecaptcha&&
60
- (g?grecaptcha.reset(g):grecaptcha.reset()))));c.removeClass("frm_doing_ajax");Wa(a);!0!==h&&Xa(a,!1);d?a.submit():jQuery(a).prepend(b.error_message)}else sb(a),Xa(a,!0),a.submit()},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");a.submit()}})}function U(a,b,c){a.length&&a.is(":visible")&&(a.addClass("frm_blank_field"),"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(b,c):a.append('<div class="frm_error">'+c[b]+"</div>"))}
61
- function Va(){jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function Wa(a){var b=jQuery(a).find(".frm_blank_field:first");b.length&&frmFrontForm.scrollMsg(b,a,!0)}function S(a){a.hasClass("frm_loading_form")||a.addClass("frm_loading_form");a.find('input[type="submit"], input[type="button"], button[type="submit"]').attr("disabled","disabled")}function I(a,b){a.removeClass("frm_loading_form");"enable"==b&&a.find('input[type="submit"], input[type="button"], button[type="submit"]').removeAttr("disabled")}
62
- function sb(a){var b=document.getElementById("frm_loading");null!==b&&(a=jQuery(a).find("input[type=file]").val(),"undefined"!=typeof a&&""!==a&&setTimeout(function(){jQuery(b).fadeIn("slow")},2E3))}function Xa(a,b){var c=jQuery(a).find(".frm-g-recaptcha, .g-recaptcha");c.length&&(!b||1>jQuery(a).find(".frm_next_page").length||1>jQuery(a).find(".frm_next_page").val())&&c.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">')}function tb(){Ya(jQuery(this),
63
- "clear")}function ub(){Ya(jQuery(this),"replace")}function Ya(a,b){var c=a.data("frmval").replace(/(\n|\r\n)/g,"\r");if(""===c||"undefined"==typeof c)return!1;var d=a.val().replace(/(\n|\r\n)/g,"\r");"replace"==b?""===d&&a.addClass("frm_default").val(c):d==c&&a.removeClass("frm_default").val("")}function vb(){var a=jQuery(this),b=a.data("eid"),c=a.data("fid");a.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",
64
- entry_id:b,form_id:c,nonce:frm_js.nonce},success:function(b){a.replaceWith(b)}});return!1}function wb(a,b){google.load("visualization","1.0",{packages:[b],callback:function(){var b=new google.visualization.DataTable,d=!1;-1!==jQuery.inArray("id",a.options.fields)&&(d=!0,b.addColumn("number",frm_js.id));for(var e=a.fields.length,f,h=0,g=e;h<g;h++){var k=a.fields[h];f=Za(k);b.addColumn(f,k.name)}h=!1;a.options.edit_link&&(h=!0,b.addColumn("string",a.options.edit_link));g=!1;a.options.delete_link&&(g=
65
- !0,b.addColumn("string",a.options.delete_link));if(null!==a.entries){var l=a.entries.length;b.addRows(l);for(var m=0,q=0;q<l;q++){var k=0,p=a.entries[q];d&&(b.setCell(m,k,p.id),k++);for(var r=0,t=e;r<t;r++){var u=a.fields[r];f=Za(u);u=p.metas[u.id];"number"!=f||null!==u&&""!==u?"boolean"==f&&(u=null===u||"false"==u||!1===u?!1:!0):u=0;b.setCell(m,k,u);k++}h&&("undefined"!==typeof p.editLink?b.setCell(m,k,'<a href="'+p.editLink+'">'+a.options.edit_link+"</a>"):b.setCell(m,k,""),k++);g&&("undefined"!==
66
- typeof p.deleteLink?b.setCell(m,k,'<a href="'+p.deleteLink+'" class="frm_delete_link" data-frmconfirm="'+a.options.confirm+'">'+a.options.delete_link+"</a>"):b.setCell(m,k,""));m++}}else for(b.addRows(1),h=k=0,g=e;h<g;h++)0<k?b.setCell(0,k,""):b.setCell(0,k,a.options.no_entries),k++;(new google.visualization.Table(document.getElementById("frm_google_table_"+a.options.form_id))).draw(b,a.graphOpts)}})}function xb(a){google.load("visualization","1.0",{packages:[a["package"]],callback:function(){var b;
67
- new google.visualization.DataTable;b=google.visualization.arrayToDataTable(a.data);var c=document.getElementById("chart_"+a.graph_id);if(null!==c){var d=a.type.charAt(0).toUpperCase()+a.type.slice(1);"Histogram"!==d&&"Table"!==d&&(d+="Chart");c=new google.visualization[d](c);c.draw(b,a.options);jQuery(document).trigger("frmDrawChart",[c,"chart_"+a.graph_id,b])}}})}function Za(a){var b="string";if("number"==a.type)b="number";else if("checkbox"==a.type||"select"==a.type){var c=a.options.length;"select"==
68
- a.type&&""===a.options[0]&&(c="post_status"==a.field_options.post_field?3:c-1);1==c&&(b="boolean")}return b}function yb(){var a=jQuery(this).data("key"),b=jQuery(this).data("parent"),c="frm_section_"+b+"-"+a,d=jQuery(document.getElementById(c)),e=d.find("input, select, textarea"),f=jQuery(this).closest("form").find('input[name="form_id"]').val();d.fadeOut("slow",function(){d.remove();e.each(function(){var c=p(this,!1);"file"!=this.type&&T(c,jQuery(this));E("frm_field_"+c+"-"+b+"-"+a+"_container",
69
- f)});"function"==typeof frmThemeOverride_frmRemoveRow&&frmThemeOverride_frmRemoveRow(c,d)});return!1}function zb(){if(!0===R)return!1;R=!0;var a=jQuery(this).data("parent"),b=0;if(0<jQuery(".frm_repeat_"+a).length)var c=jQuery(".frm_repeat_"+a+":last").attr("id").replace("frm_section_"+a+"-",""),b=-1<c.indexOf("i")?1:1+parseInt(c);jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"json",data:{action:"frm_add_form_row",field_id:a,i:b,nonce:frm_js.nonce},success:function(c){var d=c.html,f=jQuery(d).hide().fadeIn("slow");
70
- jQuery(".frm_repeat_"+a+":last").after(f);var h=["other"],g,k,l={repeatingSection:a.toString(),repeatRow:b.toString()};jQuery(d).find("input, select, textarea").each(function(){if("file"!=this.type){if(""===this.name)return!0;g=this.name.replace("item_meta[","").split("]")[2].replace("[","");-1==jQuery.inArray(g,h)&&!1!==this.id&&""!==this.id&&(k=jQuery("#"+this.id),h.push(g),K(g,l),da(g,l,"value changed"),la(g,k),ma(g,k,"value changed"),T(g,k))}});t(l.repeatRow);$a();ha();"function"==typeof frmThemeOverride_frmAddRow&&
71
- frmThemeOverride_frmAddRow(a,c);R=!1},error:function(){R=!1}});return!1}function Ab(){var a=jQuery(this),b=a.data("entryid"),c=a.data("prefix"),d=a.data("pageid"),e=a.data("formid"),f=a.data("cancel"),h=a.data("fields"),g=a.data("excludefields"),k=jQuery(document.getElementById(c+b)),l=k.html();k.html('<span class="frm-loading-img" id="'+c+b+'"></span><div class="frm_orig_content" style="display:none">'+l+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",
72
- post_id:d,entry_id:b,id:e,nonce:frm_js.nonce,fields:h,exclude_fields:g},success:function(d){k.children(".frm-loading-img").replaceWith(d);a.removeClass("frm_inplace_edit").addClass("frm_cancel_edit");a.html(f);ja("editInPlace");jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',A);ka(c+b)}});return!1}function Bb(){var a=jQuery(this),b=a.data("entryid"),c=a.data("prefix"),d=a.data("edit");a.hasClass("frm_ajax_edited")||
73
- (b=jQuery(document.getElementById(c+b)),b.children(".frm_forms").replaceWith(""),b.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));a.removeClass("frm_cancel_edit").addClass("frm_inplace_edit");a.html(d);return!1}function Cb(){var a=jQuery(this),b=a.data("deleteconfirm");if(confirm(b)){var c=a.data("entryid"),d=a.data("prefix");a.replaceWith('<span class="frm-loading-img" id="frm_delete_'+c+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",
74
- entry:c,nonce:frm_js.nonce},success:function(a){if("success"==a.replace(/^\s+|\s+$/g,"")){var b=jQuery(document.getElementById(d+c));b.fadeOut("slow",function(){b.remove()});jQuery(document.getElementById("frm_delete_"+c)).fadeOut("slow")}else jQuery(document.getElementById("frm_delete_"+c)).replaceWith(a)}})}return!1}function ka(a){"undefined"!==typeof __frmHideFields&&frmFrontForm.hidePreviouslyHiddenFields();jQuery(document).on("focusin",".frm_date",q);if("undefined"!==typeof __frmMasks)for(var b=
75
- __frmMasks,c=0;c<b.length;c++)jQuery(b[c].trigger).attr("data-frmmask",b[c].mask);$a();ha(a);"undefined"!==typeof __frmDepDynamicFields&&frmFrontForm.checkDependentDynamicFields(__frmDepDynamicFields);"undefined"!==typeof __frmDepLookupFields&&frmFrontForm.checkDependentLookupFields(__frmDepLookupFields);if("undefined"!==typeof __FRMCALC){(a=__FRMCALC.triggers)&&jQuery(a.join()).trigger({type:"change",selfTriggered:!0});a=__FRMCALC.calc;var b=[],d;for(d in a)1>a[d].fields.length&&(c=document.getElementById("field_"+
76
- d),null===c||N(c,a[d].form_id)||ba(__FRMCALC,d,b))}t()}function ha(a){if(jQuery().chosen){var b={allow_single_deselect:!0,no_results_text:frm_js.no_results};"undefined"!==typeof __frmChosen&&(b="{"+__frmChosen+"}");"undefined"!==typeof a?jQuery("#"+a).find(".frm_chzn").chosen(b):jQuery(".frm_chzn").chosen(b)}}function $a(){if(jQuery().rating){var a=jQuery(".star");a.length&&a.rating()}}function ja(a){"undefined"!==typeof __frmHideOrShowFields?frmFrontForm.hideOrShowFields(__frmHideOrShowFields,a):
77
- ab()}function ab(){jQuery(".frm_pro_form").fadeIn("slow")}function v(a,b){"undefined"===typeof b&&(b="dependent");1<a.length&&(a=a.eq(0));a.trigger({type:"change",selfTriggered:!0,frmTriggered:b})}function J(a){var b={repeatingSection:"",repeatRow:""};"undefined"!==typeof a&&H(a)&&(a=a.split("]["),b.repeatingSection=a[0].replace("item_meta[",""),b.repeatRow=a[1]);return b}function bb(a){a.fadeOut("slow",function(){a.remove()})}function Db(){var a=jQuery(this).data("frmconfirm");return confirm(a)}
78
- function Eb(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function lb(a,b){for(var c in a)if(a.hasOwnProperty(c)&&a[c]===b)return c;return null}function Qa(a){return!jQuery.isArray(a)&&0<=a-parseFloat(a)+1}function Fb(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c=this.length>>>0,d=Number(b)||0,d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=c);d<c;d++)if(d in this&&this[d]===a)return d;return-1})}
79
- function Gb(){"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})}function Hb(){Array.prototype.filter||(Array.prototype.filter=function(a,b){if(void 0===this||null===this)throw new TypeError;var c=Object(this),d=c.length>>>0;if("function"!==typeof a)throw new TypeError;for(var e=[],f=0;f<d;f++)if(f in c){var h=c[f];a.call(b,h,f,c)&&e.push(h)}return e})}function Ib(){Object.keys||(Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&
80
- b.push(c);return b})}var R=!1,D="",x=[],P=0,r={};return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);jQuery(document).on("click",".frm_trigger",m);var a=jQuery(".frm_blank_field");a.length&&a.closest(".frm_toggle_container").prev(".frm_trigger").click();jQuery.isFunction(jQuery.fn.placeholder)?jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===
81
- jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",tb);jQuery(document).on("blur",".frm_toggle_default",ub);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(vb);jQuery(document).on("click",".frm_remove_link",B);jQuery(document).on("focusin","input[data-frmmask]",function(){jQuery(this).mask(jQuery(this).data("frmmask").toString())});jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',
82
- A);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm_page_back, .frm_page_skip, .frm-show-form .frm_save_draft, .frm_prev_page, .frm_button_submit',l);jQuery(document).on("change",'.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',w);jQuery(document).on("click",".frm_remove_form_row",yb);jQuery(document).on("click",".frm_add_form_row",zb);jQuery(document).on("click","a[data-frmconfirm]",
83
- Db);jQuery("a[data-frmtoggle]").click(Eb);jQuery(".frm_edit_link_container").on("click","a.frm_inplace_edit",Ab);jQuery(".frm_edit_link_container").on("click","a.frm_cancel_edit",Bb);jQuery(document).on("click",".frm_ajax_delete",Cb);jQuery(".frm_month_heading, .frm_year_heading").click(function(){var a=jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s");a.hasClass("ui-icon-triangle-1-e")?(a.addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e"),jQuery(this).next(".frm_toggle_container").fadeIn("slow")):
84
- (a.addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s"),jQuery(this).next(".frm_toggle_container").hide())});ja("pageLoad");ka();Fb();Gb();Hb();Ib()},submitForm:function(a){frmFrontForm.submitFormManual(a,this)},submitFormManual:function(a,b){var c=b.className.trim().split(/\s+/gi);if((!c||-1<c.indexOf("frm_pro_form"))&&!jQuery("body").hasClass("wp-admin")){a.preventDefault();var d=frmFrontForm.validateFormSubmit(b);0===Object.keys(d).length&&(S(jQuery(b)),-1<c.indexOf("frm_ajax_submit")?
85
- 1>jQuery(b).find('input[type="file"]').filter(function(){return!!this.value}).length?(D=jQuery(b).find('input[name="frm_action"]').val(),frmFrontForm.checkFormErrors(b,D)):b.submit():b.submit())}},validateFormSubmit:function(a){"undefined"!=typeof tinyMCE&&jQuery(a).find(".wp-editor-wrap").length&&tinyMCE.triggerSave();x=[];var b=jQuery(a).hasClass("frm_js_validate");b&&(Ta(a)||Ua(a))&&(b=!1);b&&(frmFrontForm.getAjaxFormErrors(a),Object.keys(x).length&&frmFrontForm.addAjaxFormErrors(a));return x},
86
- getAjaxFormErrors:function(a){var b=[],c=jQuery(a).find(".frm_required_field:visible input, .frm_required_field:visible select, .frm_required_field:visible textarea").filter(":not(.frm_optional)");if(c.length)for(var d=0,e=c.length;d<e;d++)b=na(c[d],b);c=jQuery(a).find("input[type=email]").filter(":visible");d=jQuery(a).find("input,select,textarea");if(d.length)for(var e=0,f=d.length;e<f;e++){var h=d[e];""!==h.value&&"hidden"!=h.type&&("number"==h.type?b=pa(h,b):"email"==h.type?b=oa(h,b,c):null!==
87
- h.pattern&&(b=qa(h,b)))}c=jQuery(a).find(".frm-g-recaptcha");c.length&&(d=c.data("rid"),0===grecaptcha.getResponse(d).length&&(c=c.closest(".frm_form_field").attr("id").replace("frm_field_","").replace("_container",""),b[c]=""));x=b;if("function"==typeof frmThemeOverride_jsErrors&&(D=jQuery(a).find('input[name="frm_action"]').val(),a=frmThemeOverride_jsErrors(D,a),Object.keys(a).length))for(var g in a)x[g]=a[g];return x},addAjaxFormErrors:function(a){Va();for(var b in x){var c=jQuery(a).find("#frm_field_"+
88
- b+"_container");c.length?U(c,b,x):delete x[b]}Wa(a)},checkFormErrors:function(a,b){rb(a,b)},scrollToID:function(a){a=jQuery(document.getElementById(a));frmFrontForm.scrollMsg(a,!1)},scrollMsg:function(a,b,c){if("undefined"==typeof b){if(a=jQuery(document.getElementById("frm_form_"+a+"_container")),1>a.length)return}else a="string"==typeof a?jQuery(b).find("#frm_field_"+a+"_container"):a;if(a=a.offset().top){a-=frm_js.offset;b=jQuery("html").css("margin-top");var d=jQuery("body").css("margin-top");
89
- if(b||d)a=a-parseInt(b)-parseInt(d);if(a&&window.innerHeight&&(b=document.documentElement.scrollTop||document.body.scrollTop,a>b+window.innerHeight||a<b))return"undefined"===typeof c?jQuery(window).scrollTop(a):jQuery("html,body").animate({scrollTop:a},500),!1}},savingDraft:function(a){return Ta(a)},goingToPreviousPage:function(a){return Ua(a)},hideOrShowFields:function(a,b){if("pageLoad"===b){var c=document.querySelectorAll('[id^="frm_hide_fields_"]');ca(c)}for(var c={repeatingSection:"",repeatRow:""},
90
- d=0,e=a.length;d<e;d++)K(a[d],c),d==e-1&&ab()},hidePreviouslyHiddenFields:function(){var a;a=[];for(var b=document.querySelectorAll('*[id^="frm_hide_fields_"]'),c=b.length,d,e=0;e<c;e++)d=b[e].id.replace("frm_hide_fields_",""),a=a.concat(F(d));b=0;for(c=a.length;b<c;b++)d=document.getElementById(a[b]),null!==d&&(d.style.display="none")},checkDependentDynamicFields:function(a){for(var b={repeatingSection:"",repeatRow:""},c=0,d=a.length;c<d;c++)K(a[c],b)},checkDependentLookupFields:function(a){for(var b,
91
- c={repeatingSection:"",repeatRow:""},d=0,e=a.length;d<e;d++)b=a[d],da(b,c,"value changed")},loadGoogle:function(){if("undefined"!==typeof google&&google&&google.load)for(var a=__FRMTABLES,b=Object.keys(a),c=0;c<b.length;c++)if("graphs"===b[c])for(var d=a[b[c]],e=0,f=d.length;e<f;e++)xb(d[e]);else for(d=a[b[c]],e=b[c],f=0;f<d.length;f++)wb(d[f],e);else setTimeout(frmFrontForm.loadGoogle,30)},removeUsedTimes:function(a,b){console.warn("DEPRECATED: function frmFrontForm.removeUsedTimes v2.03")},escapeHtml:function(a){return a.replace(/&/g,
92
- "&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},invisible:function(a){jQuery(a).css("visibility","hidden")},visible:function(a){jQuery(a).css("visibility","visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(l){frmFrontForm.init()});
93
- function frmRecaptcha(){for(var l=jQuery(".frm-g-recaptcha"),m=0,q=l.length;m<q;m++){var t=grecaptcha.render(l[m].id,{sitekey:l[m].getAttribute("data-sitekey"),size:l[m].getAttribute("data-size"),theme:l[m].getAttribute("data-theme")});l[m].setAttribute("data-rid",t)}}
94
  function frmUpdateField(l,m,q,t,y){jQuery(document.getElementById("frm_update_field_"+l+"_"+m)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:l,field_id:m,value:q,nonce:frm_js.nonce},success:function(){""===t.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+l+"_"+m+"_"+y)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+l+"_"+m+"_"+y)).replaceWith(t)}})}
95
  function frmEditEntry(l,m,q,t,y,z){console.warn("DEPRECATED: function frmEditEntry in v2.0.13 use frmFrontForm.editEntry");var B=jQuery(document.getElementById("frm_edit_"+l)),w=B.html(),A=jQuery(document.getElementById(m+l)),p=A.html();A.html('<span class="frm-loading-img" id="'+m+l+'"></span><div class="frm_orig_content" style="display:none">'+p+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:q,entry_id:l,id:t,nonce:frm_js.nonce},
96
  success:function(p){A.children(".frm-loading-img").replaceWith(p);B.replaceWith('<span id="frm_edit_'+l+'"><a onclick="frmCancelEdit('+l+",'"+m+"','"+frmFrontForm.escapeHtml(w)+"',"+q+","+t+",'"+z+'\')" class="'+z+'">'+y+"</a></span>")}})}
3
  function q(){if(-1===this.className.indexOf("frm_custom_date")&&"undefined"!==typeof __frmDatepicker){var a=__frmDatepicker,b=this.id,c=b.split("-"),c=H(this.name)?'input[id^="'+c[0]+'"]':'input[id^="'+c.join("-")+'"]';jQuery.datepicker.setDefaults(jQuery.datepicker.regional[""]);for(var d=0,e=0;e<a.length;e++)if(a[e].triggerID=="#"+b||a[e].triggerID==c){d=e;break}""!==a[d].options.defaultDate&&(a[d].options.defaultDate=new Date(a[d].options.defaultDate));jQuery(this).datepicker(jQuery.extend(jQuery.datepicker.regional[a[d].locale],
4
  a[d].options))}}function t(a){if("undefined"!==typeof __frmDropzone)for(var b=__frmDropzone,c=0;c<b.length;c++)y(c,a)}function y(a,b){var c=__frmDropzone,d="#"+c[a].htmlID+"_dropzone",e=c[a].fieldName;"undefined"!==typeof b&&-1!==d.indexOf("-0_dropzone")&&(d=d.replace("-0_dropzone","-"+b+"_dropzone"),e=e.replace("[0]","["+b+"]"),delete c[a].mockFiles);d=jQuery(d);if(!(1>d.length||d.hasClass("dz-clickable"))){var f=c[a].maxFiles;if("undefined"!==typeof c[a].mockFiles){var h=c[a].mockFiles.length;0<
5
  f&&(f-=h)}var g=d.closest("form"),h="#"+g.attr("id");"#undefined"==h&&(h="form."+g.attr("class").replace(" ","."));d.dropzone({url:frm_js.ajax_url,addRemoveLinks:!0,paramName:d.attr("id").replace("_dropzone",""),maxFilesize:c[a].maxFilesize,maxFiles:f,uploadMultiple:c[a].uploadMultiple,hiddenInputContainer:h,dictDefaultMessage:c[a].defaultMessage,dictFallbackMessage:c[a].fallbackMessage,dictFallbackText:c[a].fallbackText,dictFileTooBig:c[a].fileTooBig,dictInvalidFileType:c[a].invalidFileType,dictResponseError:c[a].responseError,
6
+ dictCancelUpload:c[a].cancel,dictCancelUploadConfirmation:c[a].cancelConfirm,dictRemoveFile:c[a].remove,dictMaxFilesExceeded:c[a].maxFilesExceeded,fallback:function(){jQuery(this.element).closest("form").removeClass("frm_ajax_submit")},init:function(){this.on("sending",function(b,d,e){d=""!==document.getElementById("frm_verify").value||window._phantom||window.callPhantom||window.__phantomas||window.Buffer||window.emit||window.spawn?!0:!1;if(d)return this.removeFile(b),alert("Oops. That file looks like Spam."),
7
+ !1;e.append("action","frm_submit_dropzone");e.append("field_id",c[a].fieldID);e.append("form_id",c[a].formID);e.append("nonce",frm_js.nonce)});this.on("success",function(b,d){for(var f=jQuery.parseJSON(d),g=0;g<f.length;g++)!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val(f[g])});this.on("successmultiple",function(b,d){for(var f=jQuery.parseJSON(d),g=0;g<b.length;g++)jQuery(b[g].previewElement).append(z(c[a],f[g],e))});this.on("complete",function(b){if("undefined"!==typeof b.mediaID){c[a].uploadMultiple&&
8
+ jQuery(b.previewElement).append(z(c[a],b.mediaID,e));for(var d=b.previewElement.querySelectorAll("[data-dz-name]"),f=0,g=d.length;f<g;f++)d[f].innerHTML='<a href="'+b.url+'">'+b.name+"</a>"}});this.on("addedfile",function(){S(g)});this.on("queuecomplete",function(){I(g,"enable")});this.on("removedfile",function(b){!1!==b.accepted&&!0!==c[a].uploadMultiple&&jQuery('input[name="'+e+'"]').val("");!1!==b.accepted&&"undefined"!==typeof b.mediaID&&(jQuery(b.previewElement).remove(),this.options.maxFiles=
9
+ c[a].maxFiles-this.files.length)});if("undefined"!==typeof c[a].mockFiles)for(var b=0;b<c[a].mockFiles.length;b++){var d={name:c[a].mockFiles[b].name,size:c[a].mockFiles[b].size,url:c[a].mockFiles[b].file_url,mediaID:c[a].mockFiles[b].id};this.emit("addedfile",d);this.emit("thumbnail",d,c[a].mockFiles[b].url);this.emit("complete",d);this.files.push(d)}}})}}function z(a,b,c){return'<input name="'+c+'[]" type="hidden" value="'+b+'" data-frmfile="'+a.fieldID+'" />'}function B(){var a=jQuery(this).data("frm-remove");
10
+ bb(jQuery(this).parent(".dz-preview"));a=jQuery('input[name="'+a+'"]');a.length&&a.val("")}function w(){var a=this.type,b=!1,c=!1;if("select-one"===a)c=!0,"frm_other_trigger"===this.options[this.selectedIndex].className&&(b=!0);else if("select-multiple"===a)for(var c=!0,d=this.options,b=!1,e=0;e<d.length;e++)if("frm_other_trigger"===d[e].className&&d[e].selected){b=!0;break}c?(a=jQuery(this).parent().children(".frm_other_input"),a.length&&(b?a[0].className=a[0].className.replace("frm_pos_none",""):
11
+ (1>a[0].className.indexOf("frm_pos_none")&&(a[0].className+=" frm_pos_none"),a[0].value=""))):"radio"===a?jQuery(this).is(":checked")&&(jQuery(this).closest(".frm_radio").children(".frm_other_input").removeClass("frm_pos_none"),jQuery(this).closest(".frm_radio").siblings().children(".frm_other_input").addClass("frm_pos_none").val("")):"checkbox"===a&&(this.checked?jQuery(this).closest(".frm_checkbox").children(".frm_other_input").removeClass("frm_pos_none"):jQuery(this).closest(".frm_checkbox").children(".frm_other_input").addClass("frm_pos_none").val(""))}
12
+ function A(a){var b=p(this,!1);if(b&&"undefined"!==typeof b&&(!a.frmTriggered||a.frmTriggered!=b)&&(la(b,jQuery(this)),a="undefined"!==typeof a.originalEvent||-1<a.currentTarget.className.indexOf("frm_chzn")?"value changed":"other",ma(b,jQuery(this),a),T(b,jQuery(this)),jQuery(this).closest("form").hasClass("frm_js_validate"))){b=[];a=jQuery(this).closest(".frm_form_field");a.hasClass("frm_required_field")&&!jQuery(this).hasClass("frm_optional")&&(b=na(this,b));if(1>b.length)if("email"==this.type)var c=
13
+ jQuery(this).closest("form").find("input[type=email]"),b=oa(this,b,c);else"number"==this.type?b=pa(this,b):null!==this.pattern&&(b=qa(this,b));a.removeClass("frm_blank_field");a.find(".frm_error").remove();if(0<Object.keys(b).length)for(var d in b)U(a,d,b)}}function p(a,b){var c="",c=a instanceof jQuery?a.attr("name"):a.name;if(""===c)return c=a instanceof jQuery?a.data("name"):a.getAttribute("data-name"),""!==c&&c?c:0;c=c.replace("item_meta[","").replace("[]","").split("]");if(1>c.length)return 0;
14
+ var c=c.filter(function(a){return""!==a}),d=c[0],e=!1;if(1===c.length)return d;if("[form"===c[1]||"[row_ids"===c[1])return 0;jQuery('input[name="item_meta['+d+'][form]"]').length&&(d=c[2].replace("[",""),e=!0);"other"===d&&(d=e?c[3].replace("[",""):c[1].replace("[",""));!0===b&&(d=d===c[0]?d+"-"+c[1].replace("[",""):d+"-"+c[0]+"-"+c[1].replace("[",""));return d}function la(a,b){if(!("undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[a]||1>__FRMRULES[a].dependents.length||null===b||"undefined"===
15
+ typeof b))for(var c=__FRMRULES[a],d=J(b[0].name),e=0,f=c.dependents.length;e<f;e++)K(c.dependents[e],d)}function K(a,b){var c=V(a);if(!(!1===c||1>c.conditions.length)){var d;d=[];if(c.isRepeating)if(""!==b.repeatingSection){var e="frm_field_"+c.fieldId+"-",e=e+(b.repeatingSection+"-"+b.repeatRow+"_container");d.push(e)}else if(d=L(c),null!==document.getElementById("frm_field_"+d+"_container")){d=[];for(var e=document.querySelectorAll(".frm_field_"+c.fieldId+"_container"),f=0,h=e.length;f<h;f++)d.push(e[f].id)}else{d=
16
+ [];for(var f=L(c),e="frm_field_"+c.fieldId+"-"+f+"-",f=document.querySelectorAll('[name="item_meta['+f+'][row_ids][]"]'),h=0,g=f.length;h<g;h++)""!==f[h].value&&d.push(e+f[h].value+"_container");1>d.length&&d.push(e+"0_container")}else d.push("frm_field_"+c.fieldId+"_container");e=d.length;for(f=0;f<e;f++)c.containerId=d[f],ra(c,d[f]),sa(c)}}function L(a){var b="";"0"!==a.inEmbedForm?b=a.inEmbedForm:"0"!==a.inSection&&(b=a.inSection);return b}function ra(a,b){if(a.isRepeating){var c=b.replace("_container",
17
+ "").split("-");a.repeatRow=c[2]}else a.repeatRow=""}function sa(a){for(var b=[],c=a.conditions.length,d=0;d<c;d++)b.push(cb(a.conditions[d],a));c=D="any"==a.anyAll?-1<b.indexOf(!0)?a.showHide:ta(a.showHide):-1<b.indexOf(!1)?ta(a.showHide):a.showHide;b=null!==document.getElementById(a.containerId);"show"==c?"data"==a.fieldType&&a.hasOwnProperty("dataLogic")?(a={fieldId:a.fieldId,fieldKey:a.fieldKey,formId:a.formId,containerId:a.containerId,repeatRow:a.repeatRow,dataLogic:{actualValue:a.dataLogic.actualValue,
18
+ fieldId:a.dataLogic.fieldId},children:"",inputType:a.inputType},"data"==a.inputType?db(a,b):b&&eb(a)):!1!==C(a.containerId,a.formId)&&(E(a.containerId,a.formId),b?(b=ua(a.containerId),va(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId),jQuery("#"+a.containerId).show()):(b=wa(a),va(b,"divider"==a.fieldType||"form"==a.fieldType,a.formId))):W(a,b)}function V(a){return"undefined"===typeof __FRMRULES||"undefined"===typeof __FRMRULES[a]?!1:__FRMRULES[a]}function cb(a,b){var c=V(a.fieldId),d=xa(c,
19
+ b);"data"==b.fieldType&&"data"==c.fieldType?(c=""===a.value?""===d||1==d.length&&""===d[0]?!1:!0:X(a.operator,a.value,d),b.dataLogic=a,b.dataLogic.actualValue=d,d=c):d=X(a.operator,a.value,d);return d}function xa(a,b){var c;if("radio"==a.inputType||"checkbox"==a.inputType)c=ya(a,b),c=document.querySelectorAll('input[name^="'+c+'"]'),c="checkbox"==a.inputType?M(c):Y(c);else if(!0===a.isMultiSelect){c=ya(a,b);var d=document.querySelectorAll('[name^="'+c+'"]');1==d.length&&"hidden"!=d[0].type?(c=jQuery('[name^="'+
20
+ c+'"]').val(),null===c&&(c="")):c=M(d)}else if(c="field_"+a.fieldKey,a.isRepeating&&(c+="-"+b.repeatRow),d=document.getElementById(c),null===d){d="";if("time"==a.fieldType){var e=document.getElementById(c+"_H");null!==e&&(d=document.getElementById(c+"_m"),d=e.value+":"+d.value,c=document.getElementById(c+"_A"),":"==d?d="":null!==c&&(d+=" "+c.value))}c=d}else c=d.value;"undefined"===typeof c?c="":"string"===typeof c&&(c=c.trim());return c}function ya(a,b){return a.isRepeating?"item_meta["+("0"!==b.inEmbedForm?
21
+ b.inEmbedForm:b.inSection)+"]["+b.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]"}function M(a){for(var b=[],c=0,d=a.length;c<d;c++)("hidden"==a[c].type||a[c].checked)&&b.push(a[c].value);0===b.length&&(b=!1);return b}function X(a,b,c){b=fb(b);c=gb(b,c);return"string"===typeof b&&"-1"!=b.indexOf("&quot;")&&X(a,b.replace("&quot;",'"'),c)?!0:{"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"<":function(a,b){return a>b},">":function(a,b){return a<b},LIKE:function(a,b){if(!b)return!1;
22
+ a=Z(a);b=za(a,b);return-1!=b.indexOf(a)},"not LIKE":function(a,b){if(!b)return!0;a=Z(a);b=za(a,b);return-1==b.indexOf(a)}}[a](b,c)}function fb(a){-1!==String(a).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)?a=parseFloat(a):"string"===typeof a&&(a=a.trim());return a}function gb(a,b){"undefined"===typeof b&&(b="");jQuery.isArray(b)&&-1<jQuery.inArray(String(a),b)&&(b=a);"number"===typeof a&&"string"===typeof b&&(b=parseFloat(b));"string"===typeof b&&(b=b.trim());return b}function za(a,b){b=Z(b);
23
+ var c;if(jQuery.isArray(b))for(var d=0,e=b.length;d<e;d++)if(c=b[d].toLowerCase(),-1<c.indexOf(a)){b=a;break}return b}function Z(a){"string"===typeof a?a=a.toLowerCase():"number"===typeof a&&(a=a.toString());return a}function ta(a){return"show"==a?"hide":"show"}function ua(a){return document.getElementById(a).querySelectorAll('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]')}function wa(a){if("divider"==a.fieldType){var b=[];"divider"==a.fieldType&&(b=document.querySelectorAll('[data-sectionid="'+
24
+ a.fieldId+'"]'));a=b}else"form"==a.fieldType?a=document.querySelectorAll('[id^="field_'+a.fieldKey+'-"]'):(a=a.isRepeating?"item_meta["+L(a)+"]["+a.repeatRow+"]["+a.fieldId+"]":"item_meta["+a.fieldId+"]",a=document.querySelectorAll('[name^="'+a+'"]'));return a}function va(a,b,c){if(a.length)for(var d,e=["checkbox","radio"],f=0;f<a.length;f++)if(!(0<f&&"undefined"!==typeof d&&d.name==a[f].name&&-1<e.indexOf(d.type)||b&&N(a[f],c))){d=a[f];var h=jQuery(d),g=h.data("frmval");if("undefined"!==typeof g){if("checkbox"==
25
+ d.type||"radio"==d.type)Aa(d.name,g);else if(-1<d.name.indexOf("[]")){var k=document.getElementsByName(d.name);if(jQuery.isArray(g))for(var n=0,l=g.length;n<l;n++)n in k&&(k[n].value=g[n]);else null!==k[0]&&(k[0].value=g)}else g.constructor===Object&&(k=d.getAttribute("name").split("[").slice(-1)[0],null!==k&&(k=k.replace("]",""),g=g[k],"undefined"==typeof g&&(g=""))),d.value=g;"SELECT"==d.tagName&&O(d);v(h)}d=a[f];h=p(d,!1);h=aa(h);!1!==h&&"lookup"!=h.fieldType&&Ba(h,d,"value changed");d=a[f];if(h=
26
+ "undefined"!==typeof __FRMCALC){h=d.type;g=!1;if("text"==h||"hidden"==h||"number"==h)g=!0;h=g}if(h){h=__FRMCALC;g=d.name;k=d.id.replace("field_","");if(H(g))for(g=k.split("-"),k="",n=0;n<g.length-1;n++)k=""===k?g[n]:k+"-"+g[n];g=k;k=null;H(d.name)&&(k="hidden"!=d.type?jQuery(d).closest(".frm_form_field"):jQuery(d));d=k;void 0!==h.calc[g]&&ba(h,g,[],d)}d=a[f]}}function N(a,b){var c=p(a,!0);return C("frm_field_"+c+"_container",b)}function W(a,b){if(!C(a.containerId,a.formId)){if(b){jQuery("#"+a.containerId).hide();
27
+ var c=ua(a.containerId)}else c=wa(a);ca(c);Ca(a.containerId,a.formId)}}function ca(a){if(!(1>a.length)){for(var b,c=!0,d=0,e=a.length;d<e;d++)-1<a[d].className.indexOf("frm_dnc")||(0<d&&b.name!=a[d].name&&!0===c&&v(jQuery(b)),c=!0,"radio"==a[d].type||"checkbox"==a[d].type?a[d].checked=!1:"SELECT"==a[d].tagName?(0===a[d].selectedIndex?c=!1:a[d].selectedIndex=0,b=a[d].id.replace(/[^\w]/g,"_"),null!==document.getElementById(b+"_chosen")&&jQuery(a[d]).trigger("chosen:updated")):a[d].value=""),b=a[d];
28
+ !0===c&&v(jQuery(b))}}function C(a,b){var c=!1;-1<F(b).indexOf(a)&&(c=!0);return c}function Ca(a,b){var c=F(b);if(!(-1<c.indexOf(a))){c.push(a);var c=JSON.stringify(c),d=document.getElementById("frm_hide_fields_"+b);null!==d&&(d.value=c)}}function F(a){var b=[];a=document.getElementById("frm_hide_fields_"+a);return null===a?b:b=(b=a.value)?JSON.parse(b):[]}function Aa(a,b){for(var c=document.getElementsByName(a),d=0,e=c.length;d<e;d++)if("hidden"==c[d].type)jQuery.isArray(b)&&null!==b[d]?c[d].value=
29
+ b[d]:c[d].value=b;else if(c[d].value==b||jQuery.isArray(b)&&-1<b.indexOf(c[d].value))if(c[d].checked=!0,"radio"==c[d].type)break}function E(a,b){var c=F(b),d=c.indexOf(a);-1<d&&(c.splice(d,1),c=JSON.stringify(c),document.getElementById("frm_hide_fields_"+b).value=c)}function ma(a,b,c){if(!("undefined"===typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]||1>__FRMLOOKUP[a].dependents.length||null===b||"undefined"===typeof b)){a=__FRMLOOKUP[a];b=J(b[0].name);for(var d=0,e=a.dependents.length;d<
30
+ e;d++)da(a.dependents[d],b,c)}}function da(a,b,c){a=aa(a);if(!(!1===a||1>a.parents.length))if("lookup"==a.fieldType){if(""!==b.repeatRow){c=[];var d="frm_field_"+a.fieldId+"-",d=d+(b.repeatingSection+"-"+b.repeatRow+"_container");b=document.getElementById(d);null!==b&&c.push(b);b=c}else b=[],a.isRepeating?b=document.querySelectorAll(".frm_field_"+a.fieldId+"_container"):(c=document.getElementById("frm_field_"+a.fieldId+"_container"),null!==c&&b.push(c));c=0;for(d=b.length;c<d;c++){ra(a,b[c].id);var e=
31
+ a,f=b[c];e.parentVals=Da(e);if("select"==e.inputType)hb(e,f);else if("radio"==e.inputType||"checkbox"==e.inputType)if(!1===e.parentVals){var h=f.getElementsByTagName("input");Ea(e,f);ca(h)}else ib(e,f)}}else if("value changed"===c)for(c="field_"+a.fieldKey,c=a.isRepeating?""!==b.repeatingSection?'[id="'+c+"-"+b.repeatRow+'"]':'[id^="'+c+'-"]':'[id="'+c+'"]',b=document.querySelectorAll(c),c=0,d=b.length;c<d;c++)e=a,f=J(b[c].name),e.repeatRow=""!==f.repeatRow?f.repeatRow:"",Ba(a,b[c])}function aa(a){return"undefined"===
32
+ typeof __FRMLOOKUP||"undefined"===typeof __FRMLOOKUP[a]?!1:__FRMLOOKUP[a]}function Ba(a,b){a.parentVals=Da(a);var c=b.id;c in r&&0<r[c].length?Fa(a,b):(Fa(a,b),Ga(a,b))}function Da(a){for(var b=[],c=a.parents,d,e=0,f=c.length;e<f;e++){d=aa(c[e]);d=xa(d,a);if(""===d||!1===d){b=!1;break}b[e]=d}return b}function Y(a){for(var b=!1,c=a.length,d=0;d<c;d++)if("hidden"==a[d].type||a[d].checked){b=a[d].value;break}return b}function hb(a,b){var c=b.getElementsByTagName("SELECT")[0];if(null!==c){var d=c.value;
33
+ !1===a.parentVals?(c.options.length=1,c.value="",O(c),""!==d&&v(jQuery(c),a.fieldKey)):(jb(c),ea(a.formId),jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_lookup_field_options",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(d){var e=c.value;d=JSON.parse(d);for(var h=c.options.length;0<h;h--)c.remove(h);for(var g=d.length,h=0;h<g;h++)c.options[h+1]=new Option(d[h],d[h],!1,!1);c.value=e;""===c.value&&(d=c.getAttribute("data-frmval"),
34
+ null!==d&&(c.value=d));!1===a.isReadOnly&&(c.disabled=!1);c.className=c.className.replace(" frm_loading_lookup","");O(c);c.value!=e&&v(jQuery(c),a.fieldKey);Ha(jQuery(b));fa(a.formId)}}))}}function O(a){-1<a.className.indexOf("frm_chzn")&&jQuery().chosen&&jQuery(a).trigger("chosen:updated")}function jb(a){a.className+=" frm_loading_lookup";a.disabled=!0;O(a)}function ea(a){P++;1>=P&&(a=Ia(a),null!==a&&S(jQuery(a)))}function fa(a){P--;0>=P&&(a=Ia(a),null!==a&&I(jQuery(a),"enable"))}function Ia(a){return document.querySelector("#frm_form_"+
35
  a+"_container form")}function ib(a,b){var c=b.getElementsByClassName("frm_opt_container")[0],d=c.getElementsByTagName("input");kb(b,c);var e="",e="radio"==a.inputType?Y(d):M(d),f=jQuery(d[0]).data("frmval");ea(a.formId);jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_replace_cb_radio_lookup_options",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,container_field_id:L(a),row_index:a.repeatRow,current_value:e,default_value:f,nonce:frm_js.nonce},success:function(e){c.innerHTML=
36
  e;e=b.getElementsByClassName("frm-loading-img")[0];null!==e&&void 0!==e&&e.parentNode.removeChild(e);c.style.display="block";1==d.length&&""===d[0].value?Ea(a,b):(!1!==C(b.id,a.formId)&&(e=V(a.fieldId),!1===e||1>e.conditions.length?(E(b.id,a.formId),jQuery("#"+b.id).show()):(e.containerId=b.id,e.repeatRow=a.repeatRow,sa(e))),void 0!==f&&(!1!==("radio"==a.inputType?Y(d):M(d))||1>d.length||Aa(d[0].name,f)));v(jQuery(d[0]),a.fieldKey);Ha(jQuery(b));fa(a.formId)}})}function Ha(a){a.trigger("frmLookupOptionsLoaded")}
37
  function Ea(a,b){C(b.id,a.formId)||(jQuery("#"+b.id).hide(),Ca(b.id,a.formId))}function Ga(a,b){if(N(b,a.formId))ga(b.id);else if(!1===a.parentVals){var c=b.getAttribute("data-frmval");null===c&&(c="");Ja(a,b,c);ga(b.id)}else ea(a.formId),jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_get_lookup_text_value",parent_fields:a.parents,parent_vals:a.parentVals,field_id:a.fieldId,nonce:frm_js.nonce},success:function(c){N(b,a.formId)||b.value==c||Ja(a.fieldKey,b,c);fa(a.formId);ga(b.id)}})}
55
  d&&!1===h.test(d)?(b[e]=g,f&&(b[e.replace("conf_","")]="")):f&&(a=a.name.replace("conf_",""),c.filter('[name="'+a+'"]').val()!==d&&(b[e]="",b[e.replace("conf_","")]=""))}return b}function pa(a,b){var c=a.value;""!==c&&!1!==isNaN(c/1)&&(c=p(a,!0),c in b||(b[c]=G(a,"data-invmsg")));return b}function qa(a,b){var c=a.value,d=G(a,"pattern");if(""!==d&&""!==c){var e=p(a,!0);e in b||(d=new RegExp("^"+d+"$","i"),!1===d.test(c)&&(b[e]=G(a,"data-invmsg")))}return b}function G(a,b){var c=a.getAttribute(b);null===
56
  c&&(c="");return c}function rb(a,b){"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();var c=jQuery(a).find(".frm_form_field");c.addClass("frm_doing_ajax");jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){var d={content:"",errors:{},pass:!1};null===b&&(b=d);b=b.replace(/^\s+|\s+$/g,"");b=0===b.indexOf("{")?jQuery.parseJSON(b):d;if("undefined"!=typeof b.redirect)window.location=b.redirect;
57
  else if(""!==b.content){I(jQuery(a));-1!=frm_js.offset&&frmFrontForm.scrollMsg(jQuery(a),!1);var f=jQuery(a).find('input[name="form_id"]').val();b.content=b.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");jQuery(a).closest(".frm_forms").replaceWith(b.content);d=b;if(history.pushState&&"undefined"!=typeof d.page){var h,g=d.page;h=encodeURI("frm_page");for(var g=encodeURI(g),k=document.location.search.substr(1).split("&"),n=k.length,l;n--;)if(l=k[n].split("="),l[0]==h){l[1]=g;k[n]=l.join("=");
58
+ break}0>n&&(k[k.length]=[h,g].join("="));h=k.join("&");window.history.pushState({html:d.html},"","?"+h)}"function"==typeof frmThemeOverride_frmAfterSubmit&&(f=jQuery('input[name="frm_page_order_'+f+'"]').val(),d=jQuery(b.content).find('input[name="form_id"]').val(),frmThemeOverride_frmAfterSubmit(d,f,b.content,a));f=jQuery(a).find('input[name="id"]');f.length&&jQuery(document.getElementById("frm_edit_"+f.val())).find("a").addClass("frm_ajax_edited").click();jQuery(b.content).find(".frm_message").length?
59
+ (jQuery(document).trigger("frmFormComplete",[a,b]),ja("pageLoad")):jQuery(document).trigger("frmPageChanged",[a,b]);ka()}else if(Object.keys(b.errors).length){I(jQuery(a),"enable");d=!0;Va();h=!1;for(f in b.errors)g=jQuery(a).find("#frm_field_"+f+"_container"),g.length&&(g.is(":visible")||(k=g.closest(".frm_toggle_container"),k.length&&(k=k.prev(),k.hasClass("frm_trigger")||(k=k.prev(".frm_trigger")),k.click())),g.is(":visible")&&(U(g,f,b.errors),d=!1,g=jQuery(a).find("#frm_field_"+f+"_container .frm-g-recaptcha, #frm_field_"+
60
+ f+"_container .g-recaptcha"),g.length&&(h=!0,g=g.data("rid"),jQuery().grecaptcha&&(g?grecaptcha.reset(g):grecaptcha.reset()))));jQuery(document).trigger("frmFormErrors",[a,b]);c.removeClass("frm_doing_ajax");Wa(a);!0!==h&&Xa(a,!1);d?a.submit():jQuery(a).prepend(b.error_message)}else sb(a),Xa(a,!0),a.submit()},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");a.submit()}})}function U(a,b,c){a.length&&a.is(":visible")&&(a.addClass("frm_blank_field"),
61
+ "function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(b,c):a.append('<div class="frm_error">'+c[b]+"</div>"))}function Va(){jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function Wa(a){var b=jQuery(a).find(".frm_blank_field:first");b.length&&frmFrontForm.scrollMsg(b,a,!0)}function S(a){a.hasClass("frm_loading_form")||a.addClass("frm_loading_form");a.find('input[type="submit"], input[type="button"], button[type="submit"]').attr("disabled",
62
+ "disabled")}function I(a,b){a.removeClass("frm_loading_form");"enable"==b&&a.find('input[type="submit"], input[type="button"], button[type="submit"]').removeAttr("disabled")}function sb(a){var b=document.getElementById("frm_loading");null!==b&&(a=jQuery(a).find("input[type=file]").val(),"undefined"!=typeof a&&""!==a&&setTimeout(function(){jQuery(b).fadeIn("slow")},2E3))}function Xa(a,b){var c=jQuery(a).find(".frm-g-recaptcha, .g-recaptcha");c.length&&(!b||1>jQuery(a).find(".frm_next_page").length||
63
+ 1>jQuery(a).find(".frm_next_page").val())&&c.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">')}function tb(){Ya(jQuery(this),"clear")}function ub(){Ya(jQuery(this),"replace")}function Ya(a,b){var c=a.data("frmval").replace(/(\n|\r\n)/g,"\r");if(""===c||"undefined"==typeof c)return!1;var d=a.val().replace(/(\n|\r\n)/g,"\r");"replace"==b?""===d&&a.addClass("frm_default").val(c):d==c&&a.removeClass("frm_default").val("")}function vb(){var a=
64
+ jQuery(this),b=a.data("eid"),c=a.data("fid");a.append('<span class="spinner" style="display:inline"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:b,form_id:c,nonce:frm_js.nonce},success:function(b){a.replaceWith(b)}});return!1}function wb(a,b){google.load("visualization","1.0",{packages:[b],callback:function(){var b=new google.visualization.DataTable,d=!1;-1!==jQuery.inArray("id",a.options.fields)&&(d=!0,b.addColumn("number",frm_js.id));for(var e=
65
+ a.fields.length,f,h=0,g=e;h<g;h++){var k=a.fields[h];f=Za(k);b.addColumn(f,k.name)}h=!1;a.options.edit_link&&(h=!0,b.addColumn("string",a.options.edit_link));g=!1;a.options.delete_link&&(g=!0,b.addColumn("string",a.options.delete_link));if(null!==a.entries){var l=a.entries.length;b.addRows(l);for(var m=0,q=0;q<l;q++){var k=0,p=a.entries[q];d&&(b.setCell(m,k,p.id),k++);for(var r=0,t=e;r<t;r++){var u=a.fields[r];f=Za(u);u=p.metas[u.id];"number"!=f||null!==u&&""!==u?"boolean"==f&&(u=null===u||"false"==
66
+ u||!1===u?!1:!0):u=0;b.setCell(m,k,u);k++}h&&("undefined"!==typeof p.editLink?b.setCell(m,k,'<a href="'+p.editLink+'">'+a.options.edit_link+"</a>"):b.setCell(m,k,""),k++);g&&("undefined"!==typeof p.deleteLink?b.setCell(m,k,'<a href="'+p.deleteLink+'" class="frm_delete_link" data-frmconfirm="'+a.options.confirm+'">'+a.options.delete_link+"</a>"):b.setCell(m,k,""));m++}}else for(b.addRows(1),h=k=0,g=e;h<g;h++)0<k?b.setCell(0,k,""):b.setCell(0,k,a.options.no_entries),k++;(new google.visualization.Table(document.getElementById("frm_google_table_"+
67
+ a.options.form_id))).draw(b,a.graphOpts)}})}function xb(a){google.load("visualization","1.0",{packages:[a["package"]],callback:function(){var b;new google.visualization.DataTable;b=google.visualization.arrayToDataTable(a.data);var c=document.getElementById("chart_"+a.graph_id);if(null!==c){var d=a.type.charAt(0).toUpperCase()+a.type.slice(1);"Histogram"!==d&&"Table"!==d&&(d+="Chart");c=new google.visualization[d](c);c.draw(b,a.options);jQuery(document).trigger("frmDrawChart",[c,"chart_"+a.graph_id,
68
+ b])}}})}function Za(a){var b="string";if("number"==a.type)b="number";else if("checkbox"==a.type||"select"==a.type){var c=a.options.length;"select"==a.type&&""===a.options[0]&&(c="post_status"==a.field_options.post_field?3:c-1);1==c&&(b="boolean")}return b}function yb(){var a=jQuery(this).data("key"),b=jQuery(this).data("parent"),c="frm_section_"+b+"-"+a,d=jQuery(document.getElementById(c)),e=d.find("input, select, textarea"),f=jQuery(this).closest("form").find('input[name="form_id"]').val();d.fadeOut("slow",
69
+ function(){d.remove();e.each(function(){var c=p(this,!1);"file"!=this.type&&T(c,jQuery(this));E("frm_field_"+c+"-"+b+"-"+a+"_container",f)});"function"==typeof frmThemeOverride_frmRemoveRow&&frmThemeOverride_frmRemoveRow(c,d)});return!1}function zb(){if(!0===R)return!1;R=!0;var a=jQuery(this).data("parent"),b=0;if(0<jQuery(".frm_repeat_"+a).length)var c=jQuery(".frm_repeat_"+a+":last").attr("id").replace("frm_section_"+a+"-",""),b=-1<c.indexOf("i")?1:1+parseInt(c);jQuery.ajax({type:"POST",url:frm_js.ajax_url,
70
+ dataType:"json",data:{action:"frm_add_form_row",field_id:a,i:b,nonce:frm_js.nonce},success:function(c){var d=c.html,f=jQuery(d).hide().fadeIn("slow");jQuery(".frm_repeat_"+a+":last").after(f);var h=["other"],g,k,l={repeatingSection:a.toString(),repeatRow:b.toString()};jQuery(d).find("input, select, textarea").each(function(){if("file"!=this.type){if(""===this.name)return!0;g=this.name.replace("item_meta[","").split("]")[2].replace("[","");-1==jQuery.inArray(g,h)&&!1!==this.id&&""!==this.id&&(k=jQuery("#"+
71
+ this.id),h.push(g),K(g,l),da(g,l,"value changed"),la(g,k),ma(g,k,"value changed"),T(g,k))}});t(l.repeatRow);$a();ha();"function"==typeof frmThemeOverride_frmAddRow&&frmThemeOverride_frmAddRow(a,c);R=!1},error:function(){R=!1}});return!1}function Ab(){var a=jQuery(this),b=a.data("entryid"),c=a.data("prefix"),d=a.data("pageid"),e=a.data("formid"),f=a.data("cancel"),h=a.data("fields"),g=a.data("excludefields"),k=jQuery(document.getElementById(c+b)),l=k.html();k.html('<span class="frm-loading-img" id="'+
72
+ c+b+'"></span><div class="frm_orig_content" style="display:none">'+l+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:d,entry_id:b,id:e,nonce:frm_js.nonce,fields:h,exclude_fields:g},success:function(d){k.children(".frm-loading-img").replaceWith(d);a.removeClass("frm_inplace_edit").addClass("frm_cancel_edit");a.html(f);ja("editInPlace");jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',
73
+ A);ka(c+b)}});return!1}function Bb(){var a=jQuery(this),b=a.data("entryid"),c=a.data("prefix"),d=a.data("edit");a.hasClass("frm_ajax_edited")||(b=jQuery(document.getElementById(c+b)),b.children(".frm_forms").replaceWith(""),b.children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));a.removeClass("frm_cancel_edit").addClass("frm_inplace_edit");a.html(d);return!1}function Cb(){var a=jQuery(this),b=a.data("deleteconfirm");if(confirm(b)){var c=a.data("entryid"),d=a.data("prefix");
74
+ a.replaceWith('<span class="frm-loading-img" id="frm_delete_'+c+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:c,nonce:frm_js.nonce},success:function(a){if("success"==a.replace(/^\s+|\s+$/g,"")){var b=jQuery(document.getElementById(d+c));b.fadeOut("slow",function(){b.remove()});jQuery(document.getElementById("frm_delete_"+c)).fadeOut("slow")}else jQuery(document.getElementById("frm_delete_"+c)).replaceWith(a)}})}return!1}function ka(a){"undefined"!==
75
+ typeof __frmHideFields&&frmFrontForm.hidePreviouslyHiddenFields();jQuery(document).on("focusin",".frm_date",q);if("undefined"!==typeof __frmMasks)for(var b=__frmMasks,c=0;c<b.length;c++)jQuery(b[c].trigger).attr("data-frmmask",b[c].mask);$a();ha(a);"undefined"!==typeof __frmDepDynamicFields&&frmFrontForm.checkDependentDynamicFields(__frmDepDynamicFields);"undefined"!==typeof __frmDepLookupFields&&frmFrontForm.checkDependentLookupFields(__frmDepLookupFields);if("undefined"!==typeof __FRMCALC){(a=__FRMCALC.triggers)&&
76
+ jQuery(a.join()).trigger({type:"change",selfTriggered:!0});a=__FRMCALC.calc;var b=[],d;for(d in a)1>a[d].fields.length&&(c=document.getElementById("field_"+d),null===c||N(c,a[d].form_id)||ba(__FRMCALC,d,b))}t()}function ha(a){if(jQuery().chosen){var b={allow_single_deselect:!0,no_results_text:frm_js.no_results};"undefined"!==typeof __frmChosen&&(b="{"+__frmChosen+"}");"undefined"!==typeof a?jQuery("#"+a).find(".frm_chzn").chosen(b):jQuery(".frm_chzn").chosen(b)}}function $a(){if(jQuery().rating){var a=
77
+ jQuery(".star");a.length&&a.rating()}}function ja(a){"undefined"!==typeof __frmHideOrShowFields?frmFrontForm.hideOrShowFields(__frmHideOrShowFields,a):ab()}function ab(){jQuery(".frm_pro_form").fadeIn("slow")}function v(a,b){"undefined"===typeof b&&(b="dependent");1<a.length&&(a=a.eq(0));a.trigger({type:"change",selfTriggered:!0,frmTriggered:b})}function J(a){var b={repeatingSection:"",repeatRow:""};"undefined"!==typeof a&&H(a)&&(a=a.split("]["),b.repeatingSection=a[0].replace("item_meta[",""),b.repeatRow=
78
+ a[1]);return b}function bb(a){a.fadeOut("slow",function(){a.remove()})}function Db(){var a=jQuery(this).data("frmconfirm");return confirm(a)}function Eb(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function lb(a,b){for(var c in a)if(a.hasOwnProperty(c)&&a[c]===b)return c;return null}function Qa(a){return!jQuery.isArray(a)&&0<=a-parseFloat(a)+1}function Fb(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,
79
+ b){var c=this.length>>>0,d=Number(b)||0,d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=c);d<c;d++)if(d in this&&this[d]===a)return d;return-1})}function Gb(){"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})}function Hb(){Array.prototype.filter||(Array.prototype.filter=function(a,b){if(void 0===this||null===this)throw new TypeError;var c=Object(this),d=c.length>>>0;if("function"!==typeof a)throw new TypeError;for(var e=[],f=0;f<d;f++)if(f in
80
+ c){var h=c[f];a.call(b,h,f,c)&&e.push(h)}return e})}function Ib(){Object.keys||(Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b})}var R=!1,D="",x=[],P=0,r={};return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);jQuery(document).on("click",".frm_trigger",m);var a=jQuery(".frm_blank_field");a.length&&a.closest(".frm_toggle_container").prev(".frm_trigger").click();
81
+ jQuery.isFunction(jQuery.fn.placeholder)?jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",tb);jQuery(document).on("blur",".frm_toggle_default",ub);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(vb);jQuery(document).on("click",".frm_remove_link",B);
82
+ jQuery(document).on("focusin","input[data-frmmask]",function(){jQuery(this).mask(jQuery(this).data("frmmask").toString())});jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',A);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm_page_back, .frm_page_skip, .frm-show-form .frm_save_draft, .frm_prev_page, .frm_button_submit',l);jQuery(document).on("change",
83
+ '.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',w);jQuery(document).on("click",".frm_remove_form_row",yb);jQuery(document).on("click",".frm_add_form_row",zb);jQuery(document).on("click","a[data-frmconfirm]",Db);jQuery("a[data-frmtoggle]").click(Eb);jQuery(".frm_edit_link_container").on("click","a.frm_inplace_edit",Ab);jQuery(".frm_edit_link_container").on("click","a.frm_cancel_edit",Bb);jQuery(document).on("click",".frm_ajax_delete",
84
+ Cb);jQuery(".frm_month_heading, .frm_year_heading").click(function(){var a=jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s");a.hasClass("ui-icon-triangle-1-e")?(a.addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e"),jQuery(this).next(".frm_toggle_container").fadeIn("slow")):(a.addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s"),jQuery(this).next(".frm_toggle_container").hide())});ja("pageLoad");ka();Fb();Gb();Hb();Ib()},submitForm:function(a){frmFrontForm.submitFormManual(a,
85
+ this)},submitFormManual:function(a,b){var c=b.className.trim().split(/\s+/gi);if((!c||-1<c.indexOf("frm_pro_form"))&&!jQuery("body").hasClass("wp-admin")){a.preventDefault();var d=frmFrontForm.validateFormSubmit(b);0===Object.keys(d).length&&(S(jQuery(b)),-1<c.indexOf("frm_ajax_submit")?1>jQuery(b).find('input[type="file"]').filter(function(){return!!this.value}).length?(D=jQuery(b).find('input[name="frm_action"]').val(),frmFrontForm.checkFormErrors(b,D)):b.submit():b.submit())}},validateFormSubmit:function(a){"undefined"!=
86
+ typeof tinyMCE&&jQuery(a).find(".wp-editor-wrap").length&&tinyMCE.triggerSave();x=[];var b=jQuery(a).hasClass("frm_js_validate");b&&(Ta(a)||Ua(a))&&(b=!1);b&&(frmFrontForm.getAjaxFormErrors(a),Object.keys(x).length&&frmFrontForm.addAjaxFormErrors(a));return x},getAjaxFormErrors:function(a){var b=[],c=jQuery(a).find(".frm_required_field:visible input, .frm_required_field:visible select, .frm_required_field:visible textarea").filter(":not(.frm_optional)");if(c.length)for(var d=0,e=c.length;d<e;d++)b=
87
+ na(c[d],b);c=jQuery(a).find("input[type=email]").filter(":visible");d=jQuery(a).find("input,select,textarea");if(d.length)for(var e=0,f=d.length;e<f;e++){var h=d[e];""!==h.value&&"hidden"!=h.type&&("number"==h.type?b=pa(h,b):"email"==h.type?b=oa(h,b,c):null!==h.pattern&&(b=qa(h,b)))}c=jQuery(a).find(".frm-g-recaptcha");c.length&&(d=c.data("rid"),0===grecaptcha.getResponse(d).length&&(c=c.closest(".frm_form_field").attr("id").replace("frm_field_","").replace("_container",""),b[c]=""));x=b;if("function"==
88
+ typeof frmThemeOverride_jsErrors&&(D=jQuery(a).find('input[name="frm_action"]').val(),a=frmThemeOverride_jsErrors(D,a),Object.keys(a).length))for(var g in a)x[g]=a[g];return x},addAjaxFormErrors:function(a){Va();for(var b in x){var c=jQuery(a).find("#frm_field_"+b+"_container");c.length?U(c,b,x):delete x[b]}Wa(a)},checkFormErrors:function(a,b){rb(a,b)},scrollToID:function(a){a=jQuery(document.getElementById(a));frmFrontForm.scrollMsg(a,!1)},scrollMsg:function(a,b,c){if("undefined"==typeof b){if(a=
89
+ jQuery(document.getElementById("frm_form_"+a+"_container")),1>a.length)return}else a="string"==typeof a?jQuery(b).find("#frm_field_"+a+"_container"):a;if(a=a.offset().top){a-=frm_js.offset;b=jQuery("html").css("margin-top");var d=jQuery("body").css("margin-top");if(b||d)a=a-parseInt(b)-parseInt(d);if(a&&window.innerHeight&&(b=document.documentElement.scrollTop||document.body.scrollTop,a>b+window.innerHeight||a<b))return"undefined"===typeof c?jQuery(window).scrollTop(a):jQuery("html,body").animate({scrollTop:a},
90
+ 500),!1}},savingDraft:function(a){return Ta(a)},goingToPreviousPage:function(a){return Ua(a)},hideOrShowFields:function(a,b){if("pageLoad"===b){var c=document.querySelectorAll('[id^="frm_hide_fields_"]');ca(c)}for(var c={repeatingSection:"",repeatRow:""},d=0,e=a.length;d<e;d++)K(a[d],c),d==e-1&&ab()},hidePreviouslyHiddenFields:function(){var a;a=[];for(var b=document.querySelectorAll('*[id^="frm_hide_fields_"]'),c=b.length,d,e=0;e<c;e++)d=b[e].id.replace("frm_hide_fields_",""),a=a.concat(F(d));b=
91
+ 0;for(c=a.length;b<c;b++)d=document.getElementById(a[b]),null!==d&&(d.style.display="none")},checkDependentDynamicFields:function(a){for(var b={repeatingSection:"",repeatRow:""},c=0,d=a.length;c<d;c++)K(a[c],b)},checkDependentLookupFields:function(a){for(var b,c={repeatingSection:"",repeatRow:""},d=0,e=a.length;d<e;d++)b=a[d],da(b,c,"value changed")},loadGoogle:function(){if("undefined"!==typeof google&&google&&google.load)for(var a=__FRMTABLES,b=Object.keys(a),c=0;c<b.length;c++)if("graphs"===b[c])for(var d=
92
+ a[b[c]],e=0,f=d.length;e<f;e++)xb(d[e]);else for(d=a[b[c]],e=b[c],f=0;f<d.length;f++)wb(d[f],e);else setTimeout(frmFrontForm.loadGoogle,30)},removeUsedTimes:function(a,b){console.warn("DEPRECATED: function frmFrontForm.removeUsedTimes v2.03")},escapeHtml:function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},invisible:function(a){jQuery(a).css("visibility","hidden")},visible:function(a){jQuery(a).css("visibility","visible")}}}
93
+ var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(l){frmFrontForm.init()});function frmRecaptcha(){for(var l=jQuery(".frm-g-recaptcha"),m=0,q=l.length;m<q;m++){var t=grecaptcha.render(l[m].id,{sitekey:l[m].getAttribute("data-sitekey"),size:l[m].getAttribute("data-size"),theme:l[m].getAttribute("data-theme")});l[m].setAttribute("data-rid",t)}}
94
  function frmUpdateField(l,m,q,t,y){jQuery(document.getElementById("frm_update_field_"+l+"_"+m)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:l,field_id:m,value:q,nonce:frm_js.nonce},success:function(){""===t.replace(/^\s+|\s+$/g,"")?jQuery(document.getElementById("frm_update_field_"+l+"_"+m+"_"+y)).fadeOut("slow"):jQuery(document.getElementById("frm_update_field_"+l+"_"+m+"_"+y)).replaceWith(t)}})}
95
  function frmEditEntry(l,m,q,t,y,z){console.warn("DEPRECATED: function frmEditEntry in v2.0.13 use frmFrontForm.editEntry");var B=jQuery(document.getElementById("frm_edit_"+l)),w=B.html(),A=jQuery(document.getElementById(m+l)),p=A.html();A.html('<span class="frm-loading-img" id="'+m+l+'"></span><div class="frm_orig_content" style="display:none">'+p+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:{action:"frm_entries_edit_entry_ajax",post_id:q,entry_id:l,id:t,nonce:frm_js.nonce},
96
  success:function(p){A.children(".frm-loading-img").replaceWith(p);B.replaceWith('<span id="frm_edit_'+l+'"><a onclick="frmCancelEdit('+l+",'"+m+"','"+frmFrontForm.escapeHtml(w)+"',"+q+","+t+",'"+z+'\')" class="'+z+'">'+y+"</a></span>")}})}
languages/formidable-az_AZ.mo ADDED
Binary file
languages/formidable-az_AZ.po ADDED
@@ -0,0 +1,7775 @@