WordPress Page Builder – Beaver Builder - Version 2.1.4.5

Version Description

Download this release

Release Info

Developer pross
Plugin Icon 128x128 WordPress Page Builder – Beaver Builder
Version 2.1.4.5
Comparing to
See all releases

Code changes from version 2.1.4.3 to 2.1.4.5

changelog.txt CHANGED
@@ -1,3 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  <h4>2.1.4.3 - 08/20/2018</h4>
2
  <p><strong>HotFix</strong></p>
3
  <ul>
1
+ <h4>2.1.4.5 - 09/10/2018</h4>
2
+ <p><strong>HotFix</strong></p>
3
+ <ul>
4
+ <li>Fix image settings apparently reverting to thumbnail in rare cases.</li>
5
+ </ul>
6
+
7
+ <h4>2.1.4.4 - 09/04/2018</h4>
8
+ <p><strong>HotFix</strong></p>
9
+ <ul>
10
+ <li>Fixed issue when duplicating with multiple copies of a module appearing after refreshing.</li>
11
+ </ul>
12
+
13
  <h4>2.1.4.3 - 08/20/2018</h4>
14
  <p><strong>HotFix</strong></p>
15
  <ul>
classes/class-fl-builder-admin-settings.php CHANGED
@@ -123,7 +123,7 @@ final class FLBuilderAdminSettings {
123
  $name = FLBuilderModel::get_branding();
124
 
125
  if ( ! empty( $icon ) ) {
126
- echo '<img src="' . $icon . '" />';
127
  }
128
 
129
  echo '<span>' . sprintf( _x( '%s Settings', '%s stands for custom branded "Page Builder" name.', 'fl-builder' ), FLBuilderModel::get_branding() ) . '</span>';
123
  $name = FLBuilderModel::get_branding();
124
 
125
  if ( ! empty( $icon ) ) {
126
+ echo '<img role="presentation" src="' . $icon . '" />';
127
  }
128
 
129
  echo '<span>' . sprintf( _x( '%s Settings', '%s stands for custom branded "Page Builder" name.', 'fl-builder' ), FLBuilderModel::get_branding() ) . '</span>';
classes/class-fl-builder-loader.php CHANGED
@@ -46,7 +46,7 @@ if ( ! class_exists( 'FLBuilderLoader' ) ) {
46
  * @return void
47
  */
48
  static private function define_constants() {
49
- define( 'FL_BUILDER_VERSION', '2.1.4.3' );
50
  define( 'FL_BUILDER_FILE', trailingslashit( dirname( dirname( __FILE__ ) ) ) . 'fl-builder.php' );
51
  define( 'FL_BUILDER_DIR', plugin_dir_path( FL_BUILDER_FILE ) );
52
  define( 'FL_BUILDER_URL', plugins_url( '/', FL_BUILDER_FILE ) );
46
  * @return void
47
  */
48
  static private function define_constants() {
49
+ define( 'FL_BUILDER_VERSION', '2.1.4.5' );
50
  define( 'FL_BUILDER_FILE', trailingslashit( dirname( dirname( __FILE__ ) ) ) . 'fl-builder.php' );
51
  define( 'FL_BUILDER_DIR', plugin_dir_path( FL_BUILDER_FILE ) );
52
  define( 'FL_BUILDER_URL', plugins_url( '/', FL_BUILDER_FILE ) );
classes/class-fl-builder-ui-settings-forms.php CHANGED
@@ -90,12 +90,12 @@ class FLBuilderUISettingsForms {
90
  * errors we were running into on some hosts.
91
  *
92
  * @since 2.1.0.2
93
- * @param string $buffer
94
  * @return string
95
  */
96
 
97
- static public function compress_settings_config( $buffer ) {
98
- @ob_gzhandler( $buffer ); // @codingStandardsIgnoreLine
99
  return $buffer;
100
  }
101
 
90
  * errors we were running into on some hosts.
91
  *
92
  * @since 2.1.0.2
93
+ * @param string $buffer $mode
94
  * @return string
95
  */
96
 
97
+ static public function compress_settings_config( $buffer, $mode ) {
98
+ @ob_gzhandler( $buffer, null ); // @codingStandardsIgnoreLine
99
  return $buffer;
100
  }
101
 
classes/class-fl-builder.php CHANGED
@@ -2872,7 +2872,7 @@ final class FLBuilder {
2872
  $min = FLJSMin::minify( $js );
2873
  } catch ( Exception $e ) {}
2874
 
2875
- if ( $min ) {
2876
  $js = $min;
2877
  }
2878
  }
2872
  $min = FLJSMin::minify( $js );
2873
  } catch ( Exception $e ) {}
2874
 
2875
+ if ( isset( $min ) ) {
2876
  $js = $min;
2877
  }
2878
  }
fl-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Beaver Builder Plugin (Lite Version)
4
  * Plugin URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-uri
5
  * Description: A drag and drop frontend WordPress page builder plugin that works with almost any theme!
6
- * Version: 2.1.4.3
7
  * Author: The Beaver Builder Team
8
  * Author URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-author
9
  * Copyright: (c) 2014 Beaver Builder
3
  * Plugin Name: Beaver Builder Plugin (Lite Version)
4
  * Plugin URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-uri
5
  * Description: A drag and drop frontend WordPress page builder plugin that works with almost any theme!
6
+ * Version: 2.1.4.5
7
  * Author: The Beaver Builder Team
8
  * Author URI: https://www.wpbeaverbuilder.com/?utm_medium=bb&utm_source=plugins-admin-page&utm_campaign=plugins-admin-author
9
  * Copyright: (c) 2014 Beaver Builder
includes/admin-settings-welcome.php CHANGED
@@ -20,7 +20,7 @@ $fb_url = 'https://www.facebook.com/groups/beaverbuilders/';
20
  ?>
21
  <div id="fl-welcome-form" class="fl-settings-form">
22
 
23
- <h3 class="fl-settings-form-header"><?php _e( 'Welcome to Beaver Builder!', 'fl-builder' ); ?></h3>
24
 
25
  <div class="fl-settings-form-content fl-welcome-page-content">
26
 
@@ -34,7 +34,7 @@ $fb_url = 'https://www.facebook.com/groups/beaverbuilders/';
34
 
35
  </p>
36
 
37
- <h4><?php _e( 'Getting Started - Building your first page.', 'fl-builder' ); ?></h4>
38
 
39
  <div class="fl-welcome-col-wrap">
40
 
@@ -44,7 +44,7 @@ $fb_url = 'https://www.facebook.com/groups/beaverbuilders/';
44
 
45
  <p><?php _e( 'Ready to start building? Add a new page and jump into Beaver Builder by clicking the Page Builder tab shown on the image.', 'fl-builder' ); ?></p>
46
 
47
- <h4><?php _e( 'Join the Community', 'fl-builder' ); ?></h4>
48
 
49
  <p><?php _e( 'There\'s a wonderful community of "Beaver Builders" out there and we\'d love it if <em>you</em> joined us!', 'fl-builder' ); ?></p>
50
 
@@ -58,7 +58,7 @@ $fb_url = 'https://www.facebook.com/groups/beaverbuilders/';
58
  </div>
59
 
60
  <div class="fl-welcome-col">
61
- <img class="fl-welcome-img" src="<?php echo FL_BUILDER_URL; ?>img/screenshot-getting-started.png" alt="">
62
  </div>
63
 
64
  </div>
20
  ?>
21
  <div id="fl-welcome-form" class="fl-settings-form">
22
 
23
+ <h2 class="fl-settings-form-header"><?php _e( 'Welcome to Beaver Builder!', 'fl-builder' ); ?></h2>
24
 
25
  <div class="fl-settings-form-content fl-welcome-page-content">
26
 
34
 
35
  </p>
36
 
37
+ <h2><?php _e( 'Getting Started - Building your first page.', 'fl-builder' ); ?></h2>
38
 
39
  <div class="fl-welcome-col-wrap">
40
 
44
 
45
  <p><?php _e( 'Ready to start building? Add a new page and jump into Beaver Builder by clicking the Page Builder tab shown on the image.', 'fl-builder' ); ?></p>
46
 
47
+ <h3><?php _e( 'Join the Community', 'fl-builder' ); ?></h3>
48
 
49
  <p><?php _e( 'There\'s a wonderful community of "Beaver Builders" out there and we\'d love it if <em>you</em> joined us!', 'fl-builder' ); ?></p>
50
 
58
  </div>
59
 
60
  <div class="fl-welcome-col">
61
+ <img role="presentation" class="fl-welcome-img" src="<?php echo FL_BUILDER_URL; ?>img/screenshot-getting-started.png" alt="" />
62
  </div>
63
 
64
  </div>
includes/admin-settings.php CHANGED
@@ -1,9 +1,9 @@
1
  <div class="wrap <?php FLBuilderAdminSettings::render_page_class(); ?>">
2
 
3
- <h2 class="fl-settings-heading">
4
  <?php FLBuilderAdminSettings::render_page_heading(); ?>
5
- </h2>
6
-
7
  <?php FLBuilderAdminSettings::render_update_message(); ?>
8
 
9
  <div class="fl-settings-nav">
1
  <div class="wrap <?php FLBuilderAdminSettings::render_page_class(); ?>">
2
 
3
+ <h1 class="fl-settings-heading">
4
  <?php FLBuilderAdminSettings::render_page_heading(); ?>
5
+ </h1>
6
+
7
  <?php FLBuilderAdminSettings::render_update_message(); ?>
8
 
9
  <div class="fl-settings-nav">
includes/updater-config.php CHANGED
@@ -3,7 +3,7 @@
3
  if ( class_exists( 'FLUpdater' ) ) {
4
  FLUpdater::add_product(array(
5
  'name' => 'Beaver Builder Plugin (Lite Version)',
6
- 'version' => '2.1.4.3',
7
  'slug' => 'bb-plugin',
8
  'type' => 'plugin',
9
  ));
3
  if ( class_exists( 'FLUpdater' ) ) {
4
  FLUpdater::add_product(array(
5
  'name' => 'Beaver Builder Plugin (Lite Version)',
6
+ 'version' => '2.1.4.5',
7
  'slug' => 'bb-plugin',
8
  'type' => 'plugin',
9
  ));
js/fl-builder.js CHANGED
@@ -5084,7 +5084,8 @@
5084
  {
5085
  var module = $( this ).closest( '.fl-module' ),
5086
  nodeId = module.attr( 'data-node' ),
5087
- position = module.index() + 1,
 
5088
  clone = module.clone(),
5089
  form = $( '.fl-builder-module-settings[data-node=' + nodeId + ']' ),
5090
  settings = null;
@@ -5103,7 +5104,7 @@
5103
  }, 500 );
5104
 
5105
  FLBuilder._showNodeLoading( nodeId + '-clone' );
5106
- FLBuilder._newModuleParent = module.parent();
5107
  FLBuilder._newModulePosition = position;
5108
 
5109
  FLBuilder.ajax({
@@ -7406,7 +7407,7 @@
7406
  // Check the selected value without the protocol so we get a match if
7407
  // a site has switched to HTTPS since selecting this photo (#641).
7408
  if ( selectedSize ) {
7409
- selectedSize = selectedSize.replace( /https?/, '' );
7410
  }
7411
 
7412
  for(size in photo.sizes) {
@@ -7425,7 +7426,7 @@
7425
 
7426
  if ( ! selectedSize ) {
7427
  selected = size == 'full' ? ' selected="selected"' : '';
7428
- } else if( selectedSize === photo.sizes[ size ].url.replace( /https?/, '' ) ) {
7429
  selected = ' selected="selected"';
7430
  }
7431
 
5084
  {
5085
  var module = $( this ).closest( '.fl-module' ),
5086
  nodeId = module.attr( 'data-node' ),
5087
+ parent = module.parent(),
5088
+ position = parent.find( ' > .fl-col-group, > .fl-module' ).index( module ) + 1,
5089
  clone = module.clone(),
5090
  form = $( '.fl-builder-module-settings[data-node=' + nodeId + ']' ),
5091
  settings = null;
5104
  }, 500 );
5105
 
5106
  FLBuilder._showNodeLoading( nodeId + '-clone' );
5107
+ FLBuilder._newModuleParent = parent;
5108
  FLBuilder._newModulePosition = position;
5109
 
5110
  FLBuilder.ajax({
7407
  // Check the selected value without the protocol so we get a match if
7408
  // a site has switched to HTTPS since selecting this photo (#641).
7409
  if ( selectedSize ) {
7410
+ selectedSize = selectedSize.split(/[\\/]/).pop();
7411
  }
7412
 
7413
  for(size in photo.sizes) {
7426
 
7427
  if ( ! selectedSize ) {
7428
  selected = size == 'full' ? ' selected="selected"' : '';
7429
+ } else if( selectedSize === photo.sizes[ size ].url.split(/[\\/]/).pop() ) {
7430
  selected = ' selected="selected"';
7431
  }
7432
 
js/fl-builder.min.js CHANGED
@@ -1,8 +1,8 @@
1
  var FLBuilderColorPicker;!function(e,t){function i(){var t,i,l="backgroundImage";h?f="filter":(t=e('<div id="iris-gradtest" />'),i="linear-gradient(top,#fff,#000)",e.each(g,function(e,o){if(t.css(l,o+i),t.css(l).match("gradient"))return f=e,!1}),f===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css(this.bgImageString).match("gradient")&&(f="webkit")),t.remove())}function l(t,i){return t="top"===t?"top":"left",i=e.isArray(i)?i:Array.prototype.slice.call(arguments,1),"webkit"===f?s(t,i):g[f]+"linear-gradient("+t+", "+i.join(", ")+")"}function o(t,i){var l,o,s,r,a,d,u,c,h;t="top"===t?"top":"left",i=e.isArray(i)?i:Array.prototype.slice.call(arguments,1),l="top"===t?0:1,o=e(this),s=i.length-1,r="filter",a=1===l?"left":"top",d=1===l?"right":"bottom",u=1===l?"height":"width",c='<div class="iris-ie-gradient-shim" style="position:absolute;'+u+":100%;"+a+":%start%;"+d+":%end%;"+r+':%filter%;" data-color:"%color%"></div>',h="","static"===o.css("position")&&o.css({position:"relative"}),i=n(i),e.each(i,function(e,t){var o,n,r;return e!==s&&(o=i[e+1],void(t.stop!==o.stop&&(n=100-parseFloat(o.stop)+"%",t.octoHex=new FLBuilderColor(t.color).toIEOctoHex(),o.octoHex=new FLBuilderColor(o.color).toIEOctoHex(),r="progid:DXImageTransform.Microsoft.Gradient(GradientType="+l+", StartColorStr='"+t.octoHex+"', EndColorStr='"+o.octoHex+"')",h+=c.replace("%start%",t.stop).replace("%end%",n).replace("%filter%",r))))}),o.find(".iris-ie-gradient-shim").remove(),e(h).prependTo(o)}function s(t,i){var l=[];return t="top"===t?"0% 0%,0% 100%,":"0% 100%,100% 100%,",i=n(i),e.each(i,function(e,t){l.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+l.join(",")+")"}function n(t){var i=[],l=[],o=[],s=t.length-1;return e.each(t,function(e,t){var o=t,s=!1,n=t.match(/1?[0-9]{1,2}%$/);n&&(o=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=n.shift()),i.push(o),l.push(s)}),l[0]===!1&&(l[0]="0%"),l[s]===!1&&(l[s]="100%"),l=r(l),e.each(l,function(e){o[e]={color:i[e],stop:l[e]}}),o}function r(t){var i,l,o,s,n=0,a=t.length-1,d=0,u=!1;if(t.length<=2||e.inArray(!1,t)<0)return t;for(;d<t.length-1;)u||t[d]!==!1?u&&t[d]!==!1&&(a=d,d=t.length):(n=d-1,u=!0),d++;for(l=a-n,s=parseInt(t[n].replace("%"),10),i=(parseFloat(t[a].replace("%"))-s)/l,d=n+1,o=1;d<a;)t[d]=s+o*i+"%",o++,d++;return r(t)}var a=[],d=navigator.userAgent.toLowerCase(),u="Microsoft Internet Explorer"===navigator.appName,c=u?parseFloat(d.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,h=u&&c<10,f=!1,g=["-moz-","-webkit-","-o-","-ms-"];flBuilderParseColorValue=function(e){var t=e.replace(/\s+/g,""),i=t.indexOf("rgba")!==-1?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100,l=i<100;return{value:t,alpha:i,rgba:l}},e.fn.flBuilderColorPickerGradient=function(){var t=arguments;return this.each(function(){h?o.apply(this,t):e(this).css("backgroundImage",l.apply(this,t))})},e.fn.flBuilderColorPickerRaninbowGradient=function(t,i){var l,o,s,n;for(t=t||"top",l=e.extend({},{s:100,l:50},i),o="hsl(%h%,"+l.s+"%,"+l.l+"%)",s=0,n=[];s<=360;)n.push(o.replace("%h%",s)),s+=30;return this.each(function(){e(this).flBuilderColorPickerGradient(t,n)})},FLBuilderColorPicker=function(t){this._html='<div class="fl-color-picker-ui"><div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="javascript:void(0);"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-inner iris-square-horiz"></div><div class="iris-square-inner iris-square-vert"></div></div><div class="iris-slider iris-strip"><div class="iris-slider-offset"></div></div></div></div></div>';var i={elements:null,color:"",mode:"hsl",controls:{horiz:"s",vert:"l",strip:"h"},target:!1,width:200,presets:[],labels:{colorPresets:"Color Presets",colorPicker:"Color Picker",placeholder:"Paste color here...",removePresetConfirm:"Are you sure?",noneColorSelected:"None color selected.",alreadySaved:"%s is already a saved preset.",noPresets:"Add a color preset first.",presetAdded:"%s added to presets!"}};this.options=e.extend({},i,t),(h===!1||h===!0&&c>7)&&this._init()},FLBuilderColorPicker.prototype={_html:"",_color:"",_currentElement:"",_inited:!1,_defaultHSLControls:{horiz:"s",vert:"l",strip:"h"},_defaultHSVControls:{horiz:"h",vert:"v",strip:"s"},_scale:{h:360,s:100,l:100,v:100},_init:function(){var t=this;e(t.options.elements);this._color=new FLBuilderColor("#ff0000").setHSpace(t.options.mode),a=this.options.presets,f===!1&&i(),e("html").hasClass("fl-color-picker-init")?t.picker=e(".fl-color-picker-ui"):t.picker=e(this._html).appendTo("body"),u?9===c?t.picker.addClass("iris-ie-9"):c<=8&&t.picker.addClass("iris-ie-lt9"):d.indexOf("compatible")<0&&d.indexOf("khtml")<0&&d.match(/mozilla/)&&t.picker.addClass("iris-mozilla"),t.controls={square:t.picker.find(".iris-square"),squareDrag:t.picker.find(".iris-square-value"),horiz:t.picker.find(".iris-square-horiz"),vert:t.picker.find(".iris-square-vert"),strip:t.picker.find(".iris-strip"),stripSlider:t.picker.find(".iris-strip .iris-slider-offset")},"hsv"===t.options.mode&&t._has("l",t.options.controls)?t.options.controls=t._defaultHSVControls:"hsl"===t.options.mode&&t._has("v",t.options.controls)&&(t.options.controls=t._defaultHSLControls),t.hue=t._color.h(),this._setTemplates(),this._ui=e(".fl-color-picker-ui"),this._iris=e(".iris-picker"),this._wrapper=e("body"),e("html").hasClass("fl-color-picker-init")||this._ui.prepend(this._hexHtml).append(this._presetsHtml),t.element=this._ui.find(".fl-color-picker-input"),t._initControls(),t.active="external",t._change(),t._addInputListeners(t.element),this._buildUI(),this._prepareColorFields(),this._pickerControls(),this._presetsControls(),this._buildAlphaUI(),e("html").addClass("fl-color-picker-init")},_prepareColorFields:function(){var t=this;e(".fl-color-picker-value").each(function(){var i=e(this),l=i.val(),o=i.parent().find(".fl-color-picker-color"),s=flBuilderParseColorValue(l),n="";if(l){if(o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba)n=i.val().toString();else if(!o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba){var r=l.replace("rgba","rgb");r=r.substr(0,r.lastIndexOf(","))+")",t._color._alpha=1,n=r,i.val(r)}else n="#"+i.val().toString();o.css({backgroundColor:n})}})},_setTemplates:function(){this._alphaHtml='<div class="fl-alpha-wrap"><div class="fl-alpha-slider"></div><div class="fl-alpha-slider-offset"></div><div class="fl-alpha-text"></div></div>',this._presetsHtml='<div class="fl-color-picker-presets"><div class="fl-color-picker-presets-toggle"><div class="fl-color-picker-presets-open-label fl-color-picker-active">'+this.options.labels.colorPresets+' <span class="fl-color-picker-icon-arrow-up"></span></div><div class="fl-color-picker-presets-close-label">'+this.options.labels.colorPicker+' <span class="fl-color-picker-icon-arrow-down"></span></div></div><ul class="fl-color-picker-presets-list"></ul></div>',this._hexHtml='<input type="text" class="fl-color-picker-input" maxlength="7" placeholder="'+this.options.labels.placeholder+'"><div class="fl-color-picker-preset-add"></div>',this._presetsTpl='<li class="fl-color-picker-preset"><span class="fl-color-picker-preset-color"></span> <span class="fl-color-picker-preset-label"></span> <span class="fl-color-picker-preset-remove fl-color-picker-icon-remove"></span></li>',this._noPresetsTpl='<li class="fl-color-picker-no-preset"><span class="fl-color-picker-preset-label">'+this.options.labels.noPresets+"</span></li>"},_has:function(t,i){var l=!1;return e.each(i,function(e,i){if(t===i)return l=!0,!1}),l},_buildUI:function(){var t=this;t._presetsList=this._ui.find(".fl-color-picker-presets-list"),t._presetsList.html(""),this.options.presets.length>0?e.each(this.options.presets,function(e,i){t._addPresetView(i)}):t._presetsList.append(this._noPresetsTpl)},_addPresetView:function(t){var i=this._presetsList.find(".fl-color-picker-no-preset");i.length>0&&i.remove();var l=e(this._presetsTpl),o=FLBuilderColor(t);l.attr("data-color",t).find(".fl-color-picker-preset-color").css({backgroundColor:o.toString()}).end().find(".fl-color-picker-preset-label").html(o.toString()),this._presetsList.append(l)},_addPresetFeedback:function(){this._ui.append('<div class="fl-color-picker-added"><div class="fl-color-picker-added-text"><div class="fl-color-picker-icon-check"></div> "'+this.options.labels.presetAdded.replace("%s",this._color.toString())+'"</div></div>'),this._ui.find(".fl-color-picker-added").hide().fadeIn(200).delay(2e3).fadeOut(200,function(){e(this).remove()})},_pickerControls:function(){var t=this;this._wrapper.on("click",".fl-color-picker-color",function(){var i=e(this);t._currentElement=i.parent().find(".fl-color-picker-value"),t._ui.position({my:"left top",at:"left bottom",of:i,collision:"flip",using:function(e,i){t._togglePicker(e)}})}).on("click",".fl-color-picker-clear",function(){var i=e(this);t._currentElement=i.parent().find(".fl-color-picker-value"),i.prev(".fl-color-picker-color").css({backgroundColor:"transparent"}).addClass("fl-color-picker-empty"),t._setColor(""),t.element.val(""),t._currentElement.val("").trigger("change")}),e(document).on("mousedown",function(t){0===e(t.target).closest(".fl-color-picker-ui").length&&e(".fl-color-picker-ui.fl-color-picker-active").removeClass("fl-color-picker-active")})},_presetsControls:function(){var t=this,i=t._ui.find(".fl-color-picker-preset-add"),l=t._ui.find(".fl-color-picker-presets"),o=l.find(".fl-color-picker-presets-open-label"),s=l.find(".fl-color-picker-presets-close-label"),n=l.find(".fl-color-picker-presets-list");i.off("click").on("click",function(){t._addPreset(t.element.val())}),n.css({height:t.element.innerHeight()+t._iris.innerHeight()+14+"px"}).hide(),l.off("click").on("click",".fl-color-picker-presets-toggle",function(){o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),n.slideToggle(500)}).on("click",".fl-color-picker-preset",function(i){var l=new FLBuilderColor(e(this).data("color").toString());t._setColor(l),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:l.toString()}).removeClass("fl-color-picker-empty"),o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),n.slideToggle(500)}).on("click",".fl-color-picker-preset-remove",function(i){i.stopPropagation(),t._removePreset(e(this).parent().data("color"))})},_removePreset:function(t){if(confirm(this.options.labels.removePresetConfirm)){var i=t.toString(),l=a.indexOf(i);l>-1&&(a.splice(l,1),this.options.presets=a,this._presetsList.find('.fl-color-picker-preset[data-color="'+i+'"]').slideUp(function(){e(this).remove()})),a.length<1&&this._presetsList.append(this._noPresetsTpl),e(this).trigger("presetRemoved",{presets:a})}},_addPreset:function(t){var i=t.toString().replace(/^#/,"");""===i?alert(this.options.labels.noneColorSelected):a.indexOf(i)>-1?alert(this.options.labels.alreadySaved.replace("%s","#"+i)):(this._addPresetView(i),this._addPresetFeedback(),a.push(i),this.options.presets=a,e(this).trigger("presetAdded",{presets:a}))},_togglePicker:function(e){var t=this;this._ui.hasClass("fl-color-picker-active")?(this._ui.removeClass("fl-color-picker-active"),e&&setTimeout(function(){t._ui.css(e),t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200)):(e&&t._ui.css(e),setTimeout(function(){t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200))},_paint:function(){var e=this;e._paintDimension("right","strip"),e._paintDimension("top","vert"),e._paintDimension("left","horiz")},_paintDimension:function(e,t){var i,l=this,o=l._color,s=l.options.mode,n=l._getHSpaceColor(),r=l.controls[t],a=l.options.controls;if(t!==l.active&&("square"!==l.active||"strip"===t))switch(a[t]){case"h":if("hsv"===s){switch(n=o.clone(),t){case"horiz":n[a.vert](100);break;case"vert":n[a.horiz](100);break;case"strip":n.setHSpace("hsl")}i=n.toHsl()}else i="strip"===t?{s:n.s,l:n.l}:{s:100,l:n.l};r.flBuilderColorPickerRaninbowGradient(e,i);break;case"s":"hsv"===s?"vert"===t?i=[o.clone().a(0).s(0).toCSS("rgba"),o.clone().a(1).s(0).toCSS("rgba")]:"strip"===t?i=[o.clone().s(100).toCSS("hsl"),o.clone().s(0).toCSS("hsl")]:"horiz"===t&&(i=["#fff","hsl("+n.h+",100%,50%)"]):i="vert"===t&&"h"===l.options.controls.horiz?["hsla(0, 0%, "+n.l+"%, 0)","hsla(0, 0%, "+n.l+"%, 1)"]:["hsl("+n.h+",0%,50%)","hsl("+n.h+",100%,50%)"],r.flBuilderColorPickerGradient(e,i);break;case"l":i="strip"===t?["hsl("+n.h+",100%,100%)","hsl("+n.h+", "+n.s+"%,50%)","hsl("+n.h+",100%,0%)"]:["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],r.flBuilderColorPickerGradient(e,i);break;case"v":i="strip"===t?[o.clone().v(100).toCSS(),o.clone().v(0).toCSS()]:["rgba(0,0,0,0)","#000"],r.flBuilderColorPickerGradient(e,i)}},_getHSpaceColor:function(){return"hsv"===this.options.mode?this._color.toHsv():this._color.toHsl()},_dimensions:function(e){var t,i=this,l=i.options,o=i.controls,s=o.square,n=i.picker.find(".iris-strip"),r="77.5%",a="12%",d=20,u=l.border?l.width-d:l.width;if(e&&(s.css("width",""),n.css("width",""),i.picker.css({width:"",height:""})),r=u*(parseFloat(r)/100),a=u*(parseFloat(a)/100),t=l.border?r+d:r,s.width(r).height(r),n.height(r).width(a),i.picker.css({width:l.width,height:t}),!l.palettes)return i.picker.css("paddingBottom","")},_addInputListeners:function(e){var t=this,i=100,l=function(i){var l=new FLBuilderColor(e.val()),o=e.val().replace(/^#/,""),s=t._currentElement.hasClass("fl-color-picker-empty");if(e.removeClass("iris-error"),l.error)""!==o&&e.addClass("iris-error");else if(l.toString()!==t._color.toString()||""!==t._color.toString()&&s)if("keyup"===i.type){if(o.match(/^[0-9a-fA-F]{3}$/))return;t._setColor(o),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:FLBuilderColor(o).toString()}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change")}else if("paste"===i.type)return o=i.originalEvent.clipboardData.getData("text").replace(/^#/,""),hex=FLBuilderColor(o).toString(),t._setColor(o),e.val(hex),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:hex}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change"),!1};e.on("change",l).on("keyup",t._debounce(l,i))},_initControls:function(){var t=this,i=t.controls,l=i.square,o=t.options.controls,s=t._scale[o.strip];i.stripSlider.slider({orientation:"horizontal",max:s,slide:function(e,i){t.active="strip","h"===o.strip&&(i.value=s-i.value),t._color[o.strip](i.value),t._change.apply(t,arguments)}}),i.squareDrag.draggable({containment:i.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(e,i){t._squareDrag(e,i)},start:function(){l.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){l.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(i){var l="ui-state-focus";i.preventDefault(),"mousedown"===i.type?(t.picker.find("."+l).removeClass(l).blur(),e(this).addClass(l).focus()):e(this).removeClass(l)}).on("keydown",function(e){var l=i.square,o=i.squareDrag,s=o.position(),n=2;switch(e.altKey&&(n*=10),e.keyCode){case 37:s.left-=n;break;case 38:s.top-=n;break;case 39:s.left+=n;break;case 40:s.top+=n;break;default:return!0}s.left=Math.max(0,Math.min(s.left,l.width())),s.top=Math.max(0,Math.min(s.top,l.height())),o.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),l.mousedown(function(i){var l,o;1===i.which&&e(i.target).is("div")&&(l=t.controls.square.offset(),o={top:i.pageY-l.top,left:i.pageX-l.left},i.preventDefault(),t._squareDrag(i,{position:o}),i.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(o).trigger(i))})},_squareDrag:function(e,t){var i=this,l=i.options.controls,o=i._squareDimensions(),s=Math.round((o.h-t.position.top)/o.h*i._scale[l.vert]),n=i._scale[l.horiz]-Math.round((o.w-t.position.left)/o.w*i._scale[l.horiz]);i._color[l.horiz](n)[l.vert](s),i.active="square",i._change.apply(i,arguments)},_setColor:function(e){var t,i,l=this,o=l.options.color,s="#ff0000";""===e?(e=s,l["default"]=!0):l["default"]=!1,l.options.color=e,e=""+e,t=e.replace(/^#/,""),i=new FLBuilderColor(e).setHSpace(l.options.mode),i.error?l.options.color=o:(l._color=i,l.options.color=l._color.toString(),l.active="external",l._change())},_squareDimensions:function(e){var i,l,o=this.controls.square;return e!==t&&o.data("dimensions")?o.data("dimensions"):(l=this.controls.squareDrag,i={w:o.width(),h:o.height()},o.data("dimensions",i),i)},_isNonHueControl:function(e,t){return"square"===e&&"h"===this.options.controls.strip||"external"!==t&&("h"!==t||"strip"!==e)},_change:function(){var t=this,i=t.controls,l=t._getHSpaceColor(),o=["square","strip"],s=t.options.controls,n=s[t.active]||"external",r=t.hue;"strip"===t.active?o=[]:"external"!==t.active&&o.pop(),e.each(o,function(e,o){var n,r,a;if(o!==t.active)switch(o){case"strip":n="h"===s.strip?t._scale[s.strip]-l[s.strip]:l[s.strip],i.stripSlider.slider("value",n);break;case"square":r=t._squareDimensions(),a={left:l[s.horiz]/t._scale[s.horiz]*r.w,top:r.h-l[s.vert]/t._scale[s.vert]*r.h},t.controls.squareDrag.css(a)}}),l.h!==r&&t._isNonHueControl(t.active,n)&&t._color.h(r),t.hue=t._color.h(),t.options.color=t._color.toString(),t.element.is(":input")&&!t._color.error&&(t.element.removeClass("iris-error"),t.element.val()!==t._color.toString()&&(t.element.val(t._color.toString()),this._currentElement&&(!t["default"]||t["default"]&&"external"!==t.active?this._currentElement.val(t._color.toString().replace(/^#/,"")).parent().find(".fl-color-picker-color").css({backgroundColor:t._color.toString()}).removeClass("fl-color-picker-empty"):this._currentElement.val(""),t._wrapper.find(".fl-alpha-slider-offset").css("background-color",t._color.toString()),this._currentElement.trigger("change")))),t._paint(),t._inited=!0,t.active=!1},_debounce:function(e,t,i){var l,o;return function(){var s,n,r=this,a=arguments;return s=function(){l=null,i||(o=e.apply(r,a))},n=i&&!l,clearTimeout(l),l=setTimeout(s,t),n&&(o=e.apply(r,a)),o}},_buildAlphaUI:function(){var t=this;t._wrapper.on("click",".fl-color-picker-color",function(){var i=e(this);t._currentElement.val();i.hasClass("fl-color-picker-alpha-enabled")?(t._ui.find(".fl-alpha-wrap").length<=0&&e(t._alphaHtml).insertAfter(t._iris),t.picker.addClass("fl-color-alpha-enabled"),t._pickerAlphaControls()):t._ui.find(".fl-alpha-wrap").remove()})},_pickerAlphaControls:function(){var e=this,t=e._currentElement,i=flBuilderParseColorValue(t.val()),l=parseFloat(i.alpha/100),o=e._wrapper,s=e._ui,n=s.find(".fl-alpha-wrap"),r=n.find(".fl-alpha-slider"),a=n.find(".fl-alpha-text"),d=n.find(".fl-alpha-slider-offset");alphaHandle=n.find(".ui-slider-handle"),a.text(l<1?l:""),r.slider({orientation:"vertical",slide:function(t,i){var l=parseFloat(i.value/100);e._color._alpha=l,a.text(l<1?l:""),e._change.apply(e,arguments)},create:function(){d.css({backgroundColor:i.value}),o.on("click",".fl-color-picker-clear",function(){e._color._alpha=1,a.text(""),r.slider("value",100).trigger("slide")})},value:i.alpha,step:1,min:1,max:100})}}}(jQuery),function(e,t){var i=function(e,t){return this instanceof i?this._init(e,t):new i(e,t)};i.fn=i.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(e){var i="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),i=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":i,this[i](e);case"string":return this.fromCSS(e);case"number":return this.fromInt(parseInt(e,10))}return this},_error:function(){return this.error=!0,this},clone:function(){for(var e=new i(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"],l=t.length-1;l>=0;l--)e[t[l]]=this[t[l]];return e},setHSpace:function(e){return this._hSpace="hsv"===e?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,i=/^(rgb|hs(l|v))a?\(/;if(this.error=!1,e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,""),e.match(i)&&e.match(/\)$/)){if(t=e.replace(/(\s|%)/g,"").replace(i,"").replace(/,?\);?$/,"").split(","),t.length<3)return this._error();if(4===t.length&&(this.a(parseFloat(t.pop())),this.error))return this;for(var l=t.length-1;l>=0;l--)if(t[l]=parseInt(t[l],10),isNaN(t[l]))return this._error();return e.match(/^rgb/)?this.fromRgb({r:t[0],g:t[1],b:t[2]}):e.match(/^hsv/)?this.fromHsv({h:t[0],s:t[1],v:t[2]}):this.fromHsl({h:t[0],s:t[1],l:t[2]})}return this.fromHex(e)},fromRgb:function(e,i){return"object"!=typeof e||e.r===t||e.g===t||e.b===t?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),i))},fromHex:function(e){return e=e.replace(/^#/,"").replace(/^0x/,""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),this.error=!/^[0-9A-F]{6}$/i.test(e),this.fromInt(parseInt(e,16))},fromHsl:function(e){var i,l,o,s,n,r,a,d;return"object"!=typeof e||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",r=e.h/360,a=e.s/100,d=e.l/100,0===a?i=l=o=d:(s=d<.5?d*(1+a):d+a-d*a,n=2*d-s,i=this.hue2rgb(n,s,r+1/3),l=this.hue2rgb(n,s,r),o=this.hue2rgb(n,s,r-1/3)),this.fromRgb({r:255*i,g:255*l,b:255*o},!0))},fromHsv:function(e){var i,l,o,s,n,r,a,d,u,c,h;if("object"!=typeof e||e.h===t||e.s===t||e.v===t)return this._error();switch(this._hsv=e,this._hSpace="hsv",i=e.h/360,l=e.s/100,o=e.v/100,a=Math.floor(6*i),d=6*i-a,u=o*(1-l),c=o*(1-d*l),h=o*(1-(1-d)*l),a%6){case 0:s=o,n=h,r=u;break;case 1:s=c,n=o,r=u;break;case 2:s=u,n=o,r=h;break;case 3:s=u,n=c,r=o;break;case 4:s=h,n=u,r=o;break;case 5:s=o,n=u,r=c}return this.fromRgb({r:255*s,g:255*n,b:255*r},!0)},fromInt:function(e,i){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),i===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},toString:function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e},toCSS:function(e,t){switch(e=e||"hex",t=parseFloat(t||this._alpha),e){case"rgb":case"rgba":var i=this.toRgb();return t<1?"rgba( "+i.r+", "+i.g+", "+i.b+", "+t+" )":"rgb( "+i.r+", "+i.g+", "+i.b+" )";case"hsl":case"hsla":var l=this.toHsl();return t<1?"hsla( "+l.h+", "+l.s+"%, "+l.l+"%, "+t+" )":"hsl( "+l.h+", "+l.s+"%, "+l.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var e,t,i=this.toRgb(),l=i.r/255,o=i.g/255,s=i.b/255,n=Math.max(l,o,s),r=Math.min(l,o,s),a=(n+r)/2;if(n===r)e=t=0;else{var d=n-r;switch(t=a>.5?d/(2-n-r):d/(n+r),n){case l:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-l)/d+2;break;case s:e=(l-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsl.h!==e&&(e=this._hsl.h),t=Math.round(100*t),0===t&&this._hsl.s&&(t=this._hsl.s),{h:e,s:t,l:Math.round(100*a)}},toHsv:function(){var e,t,i=this.toRgb(),l=i.r/255,o=i.g/255,s=i.b/255,n=Math.max(l,o,s),r=Math.min(l,o,s),a=n,d=n-r;if(t=0===n?0:d/n,n===r)e=t=0;else{switch(n){case l:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-l)/d+2;break;case s:e=(l-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsv.h!==e&&(e=this._hsv.h),t=Math.round(100*t),0===t&&this._hsv.s&&(t=this._hsv.s),{h:e,s:t,v:Math.round(100*a)}},toInt:function(){return this._color},toIEOctoHex:function(){var e=this.toString(),t=parseInt(255*this._alpha,10).toString(16);return 1===t.length&&(t="0"+t),"#"+t+e.replace(/^#/,"")},toLuminosity:function(){var e=this.toRgb();return.2126*Math.pow(e.r/255,2.2)+.7152*Math.pow(e.g/255,2.2)+.0722*Math.pow(e.b/255,2.2)},getDistanceLuminosityFrom:function(e){if(!(e instanceof i))throw"getDistanceLuminosityFrom requires a Color object";var t=this.toLuminosity(),l=e.toLuminosity();return t>l?(t+.05)/(l+.05):(l+.05)/(t+.05)},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new i(t)},getReadableContrastingColor:function(e,l){if(!(e instanceof i))return this;var o=l===t?5:l,s=e.getDistanceLuminosityFrom(this),n=e.getMaxContrastColor(),r=n.getDistanceLuminosityFrom(e);if(r<=o)return n;if(s>=o)return this;for(var a=0===n.toInt()?-1:1;s<o&&(this.l(a,!0),s=this.getDistanceLuminosityFrom(e),0!==this._color&&16777215!==this._color););return this},a:function(e){if(e===t)return this._alpha;var i=parseFloat(e);return isNaN(i)?this._error():(this._alpha=i,this)},darken:function(e){return e=e||5,this.l(-e,!0)},lighten:function(e){return e=e||5,this.l(e,!0)},saturate:function(e){return e=e||15,this.s(e,!0)},desaturate:function(e){return e=e||15,this.s(-e,!0)},toGrayscale:function(){return this.setHSpace("hsl").s(0)},getComplement:function(){return this.h(180,!0)},getSplitComplement:function(e){e=e||1;var t=180+30*e;return this.h(t,!0)},getAnalog:function(e){e=e||1;var t=30*e;return this.h(t,!0)},getTetrad:function(e){e=e||1;var t=60*e;return this.h(t,!0)},getTriad:function(e){e=e||1;var t=120*e;return this.h(t,!0)},_partial:function(e){var i=l[e];return function(l,o){var s=this._spaceFunc("to",i.space);return l===t?s[e]:(o===!0&&(l=s[e]+l),i.mod&&(l%=i.mod),i.range&&(l=l<i.range[0]?i.range[0]:l>i.range[1]?i.range[1]:l),s[e]=l,this._spaceFunc("from",i.space,s))}},_spaceFunc:function(e,t,i){var l=t||this._hSpace,o=e+l.charAt(0).toUpperCase()+l.substr(1);return this[o](i)}};var l={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var o in l)l.hasOwnProperty(o)&&(i.fn[o]=i.fn._partial(o));"object"==typeof exports?module.exports=i:(e.FLBuilderColor=i,e.Color=i)}(this),function(e){FLLightbox=function(e){this._init(e)},FLLightbox.closeParent=function(t){var i=e(t).closest(".fl-lightbox-wrap").attr("data-instance-id");_.isUndefined(i)||FLLightbox._instances[i].close()},FLLightbox.getResizableControlClass=function(){var t=e(".fl-lightbox-resizable").eq(0),i="far fa-window-maximize";return t.length&&t.hasClass("fl-lightbox-width-full")&&(i="far fa-window-minimize"),i},FLLightbox.unbindAll=function(){var e;for(e in FLLightbox._instances)FLLightbox._instances[e]._unbind()},FLLightbox.bindAll=function(){var e;for(e in FLLightbox._instances)FLLightbox._instances[e]._bind()},FLLightbox.closeAll=function(){var e;for(e in FLLightbox._instances)FLLightbox._instances[e].close()},FLLightbox._instances={},FLLightbox.prototype={_id:null,_node:null,_visible:!1,_allowClosing:!0,_resizeTimer:null,_defaults:{className:"",destroyOnClose:!1,resizable:!1},open:function(e){var t=this._node.find(".fl-lightbox"),i=t.closest(".fl-builder-ui-pinned").length,l=this._getPositionSettings();!i&&l&&this._defaults.resizable&&t.css(l),this._bind(),this._node.show(),this._visible=!0,"undefined"!=typeof e?this.setContent(e):this._resize(),this.trigger("open"),FLBuilder.triggerHook("didShowLightbox",this)},close:function(){var e=this._node.data("parent");this._allowClosing&&(this.trigger("beforeCloseLightbox"),this._unbind(),this._node.hide(),this._visible=!1,this.trigger("close"),FLBuilder.triggerHook("didHideLightbox"),this._defaults.resizable&&_.isUndefined(e)&&FLBuilder.triggerHook("didHideAllLightboxes"),this._defaults.destroyOnClose&&this.destroy())},disableClose:function(){this._allowClosing=!1},enableClose:function(){this._allowClosing=!0},setContent:function(e){this._node.find(".fl-lightbox-content").html(e),this._resize()},empty:function(){this._node.find(".fl-lightbox-content").empty()},on:function(e,t){this._node.on(e,t)},off:function(e,t){this._node.off(e,t)},trigger:function(e,t){this._node.trigger(e,t)},destroy:function(){this._node.empty(),this._node.remove(),FLLightbox._instances[this._id]="undefined";try{delete FLLightbox._instances[this._id]}catch(e){}},_init:function(t){var i=0,l=null;for(l in FLLightbox._instances)i++;this._defaults=e.extend({},this._defaults,t),this._id=(new Date).getTime()+i,FLLightbox._instances[this._id]=this,this._render(),this._resizable()},_render:function(){this._node=e('<div class="fl-lightbox-wrap" data-instance-id="'+this._id+'"><div class="fl-lightbox-mask"></div><div class="fl-lightbox"><div class="fl-lightbox-content-wrap"><div class="fl-lightbox-content"></div></div></div></div>'),this._node.addClass(this._defaults.className),e("body").append(this._node)},_bind:function(){e(window).on("resize.fl-lightbox-"+this._id,this._delayedResize.bind(this))},_unbind:function(){e(window).off("resize.fl-lightbox-"+this._id)},_resizable:function(){var t=(e("body"),this._node.find(".fl-lightbox-mask")),i=this._node.find(".fl-lightbox"),l=e(".fl-lightbox-resizable").eq(0);this._defaults.resizable?(t.hide(),i.addClass("fl-lightbox-resizable"),i.delegate(".fl-lightbox-resize-toggle","click",this._resizeClicked.bind(this)),i.draggable({cursor:"move",handle:".fl-lightbox-header"}).resizable({handles:"all",minHeight:500,minWidth:380,start:this._resizeStart.bind(this),stop:this._resizeStop.bind(this)}),l.length&&l.hasClass("fl-lightbox-width-full")?(i.addClass("fl-lightbox-width-full"),i.draggable("disable")):this._restorePosition()):t.show(),this._resize()},_delayedResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._resize.bind(this),250)},_resize:function(){var t=this._node.find(".fl-lightbox"),i=parseInt(this._node.css("padding-top")),l=parseInt(this._node.css("padding-bottom")),o=parseInt(this._node.css("padding-left")),s=parseInt(this._node.css("padding-right")),n=t.height(),r=t.width(),a=e(window),d=a.height()-i-l,u=(a.width()-o-s,"0px");this._defaults.resizable?(r<600?t.addClass("fl-lightbox-width-slim"):t.removeClass("fl-lightbox-width-slim"),r<450?t.addClass("fl-lightbox-width-micro"):t.removeClass("fl-lightbox-width-micro"),this._resizeEditors()):(d>n&&(u=(d-n-46)/2+"px"),t.attr("style","").css("margin",u+" auto 0")),this.trigger("resized")},_resizeStart:function(){e("body").addClass("fl-builder-resizable-is-resizing"),e(".fl-builder-lightbox:visible").append('<div class="fl-builder-resizable-iframe-fix"></div>'),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()},_resizeStop:function(t,i){var l=e(".fl-lightbox-resizable:visible");parseInt(l.css("top"))<0&&l.css("top","0"),this._savePosition(),e("body").removeClass("fl-builder-resizable-is-resizing"),e(".fl-builder-resizable-iframe-fix").remove(),FLBuilder._bindOverlayEvents()},_resizeClicked:function(){var t=e(".fl-lightbox-resizable"),i=(t.find(".fl-lightbox-resize-toggle"),this._node.find(".fl-lightbox"));i.hasClass("fl-lightbox-width-full")?this._resizeExitFull():this._resizeEnterFull(),this._resize()},_resizeEnterFull:function(){var t=e(".fl-lightbox-resizable"),i=t.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");i.removeClass("fa-window-maximize").addClass("fa-window-minimize"),t.addClass("fl-lightbox-width-full"),t.draggable("disable"),t.resizable("disable")},_resizeExitFull:function(){var t=e(".fl-lightbox-resizable"),i=t.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");i.removeClass("fa-window-minimize").addClass("fa-window-maximize"),t.removeClass("fl-lightbox-width-full"),t.draggable("enable"),t.resizable("enable")},_resizeEditors:function(){e(".fl-lightbox-resizable").each(function(){var t=e(this),i=t.find(".fl-builder-settings-fields").height(),l=t.find(".mce-edit-area > iframe, textarea.wp-editor-area, .ace_editor"),o=null;i<350&&(i=350),l.each(function(){o=e(this),o.hasClass("ace_editor")?(o.height(i-60),o.closest(".fl-field").data("editor").resize()):o.closest(".mce-container-body").find(".mce-toolbar-grp .mce-toolbar.mce-last").is(":visible")?o.height(i-175):o.height(i-150)})})},_savePosition:function(){var e=this._node.find(".fl-lightbox"),t={width:e.width(),height:e.height(),top:parseInt(e.css("top"))<0?"0px":e.css("top"),left:e.css("left")};e.closest(".fl-builder-ui-pinned").length||(FLBuilderConfig.userSettings.lightbox=t,FLBuilder.ajax({action:"save_lightbox_position",
2
  data:t}))},_restorePosition:function(){var e=this._node.find(".fl-lightbox"),t=this._getPositionSettings();t?e.css(t):e.css({top:25,left:FLBuilderConfig.isRtl?"-25":25})},_getPositionSettings:function(){var t=FLBuilderConfig.userSettings.lightbox;if(!t)return!1;var i=e(window).height(),l=parseInt(t.height);return l>i&&i>546&&(t.height=i-50,t.top=0),t}}}(jQuery),function(e){FLIconSelector={_content:null,_lightbox:null,_rendered:!1,_filterText:"",open:function(e){FLIconSelector._rendered||FLIconSelector._render(),null===FLIconSelector._content?(FLIconSelector._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),FLBuilder.ajax({action:"render_icon_selector"},FLIconSelector._getContentComplete)):FLIconSelector._lightbox.open(),FLIconSelector._lightbox.on("icon-selected",function(t,i){FLIconSelector._lightbox.off("icon-selected"),FLIconSelector._lightbox.close(),e(i)})},_render:function(){FLIconSelector._lightbox=new FLLightbox({className:"fl-icon-selector"}),FLIconSelector._rendered=!0,FLBuilder.addHook("endEditingSession",function(){FLIconSelector._lightbox.close()})},_getContentComplete:function(t){var i=JSON.parse(t);FLIconSelector._content=i.html,FLIconSelector._lightbox.setContent(i.html),e(".fl-icons-filter-select").on("change",FLIconSelector._filter),e(".fl-icons-filter-text").on("keyup",FLIconSelector._filter),e(".fl-icons-list i").on("click",FLIconSelector._select),e(".fl-icon-selector-cancel").on("click",e.proxy(FLIconSelector._lightbox.close,FLIconSelector._lightbox))},_filter:function(){var t=e(".fl-icons-filter-select").val(),i=e(".fl-icons-filter-text").val();"all"==t?e(".fl-icons-section").show():(e(".fl-icons-section").hide(),e(".fl-"+t).show()),FLIconSelector._filterText=i,""!==i?e(".fl-icons-list i").each(FLIconSelector._filterIcon):e(".fl-icons-list i").show()},_filterIcon:function(){var t=e(this);-1==t.attr("class").indexOf(FLIconSelector._filterText)?t.hide():t.show()},_select:function(){var t=e(this).attr("class");FLIconSelector._lightbox.trigger("icon-selected",t)}}}(jQuery),function(e){FLStyleSheet=function(t){"object"==typeof t&&e.extend(this,t),this._createSheet()},FLStyleSheet.prototype={id:null,_sheet:null,_sheetElement:null,updateRule:function(e,t,i){for(var l=this._sheet.cssRules?this._sheet.cssRules:this._sheet.rules,o=null,s=0;s<l.length;s++)l[s].selectorText.toLowerCase()==e.toLowerCase()&&(o=l[s]);if(o)if("object"==typeof t)for(s in t)o.style[this._toCamelCase(s)]=t[s];else o.style[this._toCamelCase(t)]=i;else this.addRule(e,t,i)},addRule:function(e,t,i){var l="",o="";if("object"==typeof t)for(o in t)l+=o+":"+t[o]+";";else l=t+":"+i+";";this._sheet.insertRule?this._sheet.insertRule(e+" { "+l+" }",this._sheet.cssRules.length):this._sheet.addRule(e,l)},destroy:function(){this._sheetElement&&(this._sheetElement.remove(),this._sheetElement=null),this._sheet&&(this._sheet=null)},disable:function(){this._sheet.disabled=!0},enable:function(){this._sheet.disabled=!1},_createSheet:function(){var t=this.id?' id="'+this.id+'"':"",i=this.className?' class="'+this.className+'"':"";this._sheet||(this._sheetElement=e('<style type="text/css"'+t+i+"></style>"),e("body").append(this._sheetElement),this._sheet=this._sheetElement[0].sheet)},_toCamelCase:function(e){return e.toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()})}}}(jQuery),function(e){FLBuilder={preview:null,_actionsLightbox:null,_addModuleAfterNodeRender:null,_colResizeData:null,_colResizing:!1,_contentClass:!1,_dragEnabled:!1,_dragging:!1,_dragInitialScrollTop:0,_exitUrl:null,_layout:null,_layoutSettingsCSSCache:null,_layoutSettingsCSSTimeout:null,_lightbox:null,_lightboxScrollbarTimeout:null,_loadedModuleAssets:[],_moduleHelpers:{},_multiplePhotoSelector:null,_newColParent:null,_newColPosition:0,_newColGroupParent:null,_newColGroupPosition:0,_newModuleParent:null,_newModulePosition:0,_newRowPosition:0,_selectedTemplateId:null,_selectedTemplateType:null,_singlePhotoSelector:null,_singleVideoSelector:null,_multipleAudiosSelector:null,_init:function(){FLBuilder._initJQueryReadyFix(),FLBuilder._initGlobalErrorHandling(),FLBuilder._initPostLock(),FLBuilder._initClassNames(),FLBuilder._initMediaUploader(),FLBuilder._initOverflowFix(),FLBuilder._initScrollbars(),FLBuilder._initLightboxes(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._initStrings(),FLBuilder._initTipTips(),FLBuilder._initTinyMCE(),FLBuilder._bindEvents(),FLBuilder._bindOverlayEvents(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder.addHook("didInitUI",FLBuilder._showTourOrTemplates.bind(FLBuilder)),FLBuilder.triggerHook("init")},_initJQueryReadyFix:function(){FLBuilderConfig.debug||(jQuery.fn.oldReady=jQuery.fn.ready,jQuery.fn.ready=function(t){return jQuery.fn.oldReady(function(){try{"function"==typeof t&&t(e)}catch(i){FLBuilder.logError(i)}})})},_initGlobalErrorHandling:function(){FLBuilderConfig.debug||(window.onerror=function(e,t,i,l,o){return FLBuilder.logGlobalError(e,t,i,l,o),!0})},_initPostLock:function(){"undefined"!=typeof wp.heartbeat&&(wp.heartbeat.interval(30),wp.heartbeat.enqueue("fl_builder_post_lock",{post_id:FLBuilderConfig.postId}))},_initClassNames:function(){e("html").addClass("fl-builder-edit"),e("body").addClass("fl-builder"),FLBuilderConfig.simpleUi&&e("body").addClass("fl-builder-simple"),FLBuilder._contentClass=".fl-builder-content-"+FLBuilderConfig.postId,e(FLBuilder._contentClass).addClass("fl-builder-content-editing")},_initMediaUploader:function(){wp.media.model.settings.post.id=FLBuilderConfig.postId},_initOverflowFix:function(){e(FLBuilder._contentClass).parents().css("overflow","visible")},_initScrollbars:function(){e(".fl-nanoscroller").nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"})},_initSortables:function(){var t={appendTo:"body",cursor:"move",cursorAt:{left:85,top:20},distance:1,helper:FLBuilder._blockDragHelper,start:FLBuilder._blockDragStart,sort:FLBuilder._blockDragSort,change:FLBuilder._blockDragChange,stop:FLBuilder._blockDragStop,placeholder:"fl-builder-drop-zone",tolerance:"intersect"},i="",l="",o="";o="row"==FLBuilderConfig.userTemplateType||"column"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-col-content":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-col:not(.fl-node-global) .fl-col-content",l="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target",i=FLBuilderConfig.nestedColumns?o:"row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target",e(".fl-builder-rows").sortable(e.extend({},t,{connectWith:i,items:".fl-builder-block-row",stop:FLBuilder._rowDragStop})),e(".fl-builder-row-templates").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-row-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-rows").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-saved-row",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-columns").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:l,items:".fl-builder-block-saved-column",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-modules, .fl-builder-widgets").sortable(e.extend({},t,{connectWith:o,items:".fl-builder-block-module",stop:FLBuilder._moduleDragStop})),e(".fl-builder-module-templates").sortable(e.extend({},t,{connectWith:o,items:".fl-builder-block-module-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-modules").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:o,items:".fl-builder-block-saved-module",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-row-sortable-proxy").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",helper:FLBuilder._rowDragHelper,start:FLBuilder._rowDragStart,stop:FLBuilder._rowDragStop})),e(".fl-col-sortable-proxy").sortable(e.extend({},t,{connectWith:o,helper:FLBuilder._colDragHelper,start:FLBuilder._colDragStart,stop:FLBuilder._colDragStop})),e(FLBuilder._contentClass+" .fl-col-content").sortable(e.extend({},t,{connectWith:o,handle:".fl-module-overlay .fl-block-overlay-actions .fl-block-move",helper:FLBuilder._moduleDragHelper,items:".fl-module, .fl-col-group",start:FLBuilder._moduleDragStart,stop:FLBuilder._moduleDragStop})),e(FLBuilder._contentClass+" .fl-row-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-group-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-drop-target").sortable(t)},_initStrings:function(){e.validator.messages.required=FLBuilderStrings.validateRequiredMessage},_bindEvents:function(){$excludedLinks=e(".fl-builder-bar a, .fl-builder--content-library-panel a, .fl-page-nav .nav a"),e("a").not($excludedLinks).on("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),e("body").delegate(".fl-builder-content a","click",FLBuilder._preventDefault),e("body").delegate("button.fl-builder-button","mouseup",this._buttonMouseUp.bind(this)),e(document).on("heartbeat-tick",FLBuilder._initPostLock),e(window).on("beforeunload",FLBuilder._warnBeforeUnload),e("body").delegate(".fl-builder-has-submenu","click",FLBuilder._submenuParentClicked),e("body").delegate(".fl-builder-has-submenu a","click",FLBuilder._submenuChildClicked),e("body").delegate(".fl-builder-submenu","mouseenter",FLBuilder._submenuMouseenter),e("body").delegate(".fl-builder-submenu","mouseleave",FLBuilder._submenuMouseleave),e("body").delegate(".fl-builder-submenu .fl-builder-has-submenu","mouseenter",FLBuilder._submenuNestedParentMouseenter),e(".fl-builder-panel-actions .fl-builder-panel-close").on("click",FLBuilder._closePanel),e(".fl-builder-blocks-section-title").on("click",FLBuilder._blockSectionTitleClicked),e("body").delegate(".fl-builder-node-template-actions","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-delete","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","click",FLBuilder._editNodeTemplateClicked),e("body").delegate(".fl-builder-node-template-delete","click",FLBuilder._deleteNodeTemplateClicked),e("body").delegate(".fl-builder-block","mousedown",FLBuilder._blockDragInit),e("body").on("mouseup",FLBuilder._blockDragCancel),e("body").delegate(".fl-builder-actions .fl-builder-cancel-button","click",FLBuilder._cancelButtonClicked),e("body").delegate(".fl-builder-save-user-template-button","click",FLBuilder._saveUserTemplateClicked),e("body").delegate(".fl-builder-duplicate-layout-button","click",FLBuilder._duplicateLayoutClicked),e("body").delegate(".fl-builder-layout-settings-button","click",FLBuilder._layoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-save","click",FLBuilder._saveLayoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-builder-global-settings-button","click",FLBuilder._globalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-save","click",FLBuilder._saveGlobalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-user-template","click",FLBuilder._userTemplateClicked),e("body").delegate(".fl-user-template-edit","click",FLBuilder._editUserTemplateClicked),e("body").delegate(".fl-user-template-delete","click",FLBuilder._deleteUserTemplateClicked),e("body").delegate(".fl-builder-template-replace-button","click",FLBuilder._templateReplaceClicked),e("body").delegate(".fl-builder-template-append-button","click",FLBuilder._templateAppendClicked),e("body").delegate(".fl-builder-template-actions .fl-builder-cancel-button","click",FLBuilder._templateCancelClicked),e("body").delegate(".fl-builder-user-template-settings .fl-builder-settings-save","click",FLBuilder._saveUserTemplateSettings),e("body").delegate(".fl-builder-help-tour-button","click",FLBuilder._startHelpTour),e("body").delegate(".fl-builder-knowledge-base-button","click",FLBuilder._viewKnowledgeBaseClicked),e("body").delegate(".fl-builder-forums-button","click",FLBuilder._visitForumsClicked),e("body").delegate(".fl-builder-no-tour-button","click",FLBuilder._noTourButtonClicked),e("body").delegate(".fl-builder-yes-tour-button","click",FLBuilder._yesTourButtonClicked),e("body").delegate(".fl-builder-alert-close","click",FLBuilder._alertClose),e("body").delegate(".fl-block-overlay","contextmenu",FLBuilder._onContextmenu),e("body").delegate(".fl-row-overlay .fl-block-remove","click",FLBuilder._deleteRowClicked),e("body").delegate(".fl-row-overlay .fl-block-copy","click",FLBuilder._rowCopyClicked),e("body").delegate(".fl-row-overlay .fl-block-move","mousedown",FLBuilder._rowDragInit),e("body").delegate(".fl-row-overlay .fl-block-settings","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-row-overlay","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-builder-row-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-block-col-submenu .fl-block-row-reset","click",FLBuilder._resetRowWidthClicked),e("body").delegate(".fl-col-overlay .fl-block-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-copy","click",FLBuilder._copyColClicked),e("body").delegate(".fl-col-overlay .fl-block-remove","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-col-overlay .fl-block-settings","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-col-overlay","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-col-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-block-col-submenu .fl-block-col-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-delete","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-reset","click",FLBuilder._resetColumnWidthsClicked),e("body").delegate(".fl-block-col-submenu li","mouseenter",FLBuilder._showColHighlightGuide),e("body").delegate(".fl-block-col-submenu li","mouseleave",FLBuilder._removeColHighlightGuides),e("body").delegate(".fl-block-col-submenu .fl-block-col-move-parent","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit-parent","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-module-overlay .fl-block-remove","click",FLBuilder._deleteModuleClicked),e("body").delegate(".fl-module-overlay .fl-block-copy","click",FLBuilder._moduleCopyClicked),e("body").delegate(".fl-module-overlay .fl-block-move","mousedown",FLBuilder._blockDragInit),e("body").delegate(".fl-module-overlay .fl-block-settings","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-module-overlay","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-builder-module-settings .fl-builder-settings-save","click",FLBuilder._saveModuleClicked),e("body").delegate(".fl-module-overlay .fl-block-col-settings","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-settings-save-as","click",FLBuilder._showNodeTemplateSettings),e("body").delegate(".fl-builder-node-template-settings .fl-builder-settings-save","click",FLBuilder._saveNodeTemplate),e("body").delegate(".fl-builder-settings-tabs a","click",FLBuilder._settingsTabClicked),e("body").delegate(".fl-builder-settings-tabs a","show",FLBuilder._calculateSettingsTabsOverflow),e("body").delegate(".fl-builder-settings-tabs a","hide",FLBuilder._calculateSettingsTabsOverflow),e("body").delegate(".fl-builder-settings-cancel","click",FLBuilder._settingsCancelClicked),e("body").delegate(".fl-builder-settings-tabs-overflow-menu > a","click",FLBuilder._settingsTabsToOverflowMenuItemClicked.bind(this)),e("body").delegate(".fl-builder-settings-tabs-more","click",FLBuilder._toggleTabsOverflowMenu.bind(this)),e("body").delegate(".fl-builder-settings-tabs-overflow-click-mask","click",FLBuilder._hideTabsOverflowMenu.bind(this)),e("body").delegate(".fl-help-tooltip-icon","mouseover",FLBuilder._showHelpTooltip),e("body").delegate(".fl-help-tooltip-icon","mouseout",FLBuilder._hideHelpTooltip),e("body").delegate(".fl-builder-field-add","click",FLBuilder._addFieldClicked),e("body").delegate(".fl-builder-field-copy","click",FLBuilder._copyFieldClicked),e("body").delegate(".fl-builder-field-delete","click",FLBuilder._deleteFieldClicked),e("body").delegate(".fl-builder-settings-fields select","change",FLBuilder._settingsSelectChanged),e("body").delegate(".fl-photo-field .fl-photo-select","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-edit","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-replace","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-remove","click",FLBuilder._singlePhotoRemoved),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-select","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-edit","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-add","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-video-field .fl-video-select","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-video-field .fl-video-replace","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-video-field .fl-video-remove","click",FLBuilder._singleVideoRemoved),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-select","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-edit","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-add","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-icon-field .fl-icon-select","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-replace","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-remove","click",FLBuilder._removeIcon),e("body").delegate(".fl-form-field .fl-form-field-edit","click",FLBuilder._formFieldClicked),e("body").delegate(".fl-form-field-settings .fl-builder-settings-save","click",FLBuilder._saveFormFieldClicked),e("body").delegate(".fl-layout-field-option","click",FLBuilder._layoutFieldClicked),e("body").delegate(".fl-link-field-select","click",FLBuilder._linkFieldSelectClicked),e("body").delegate(".fl-link-field-search-cancel","click",FLBuilder._linkFieldSelectCancelClicked),e("body").delegate(".fl-loop-data-source-select select[name=data_source]","change",FLBuilder._loopDataSourceChange),e("body").delegate(".fl-custom-query select[name=post_type]","change",FLBuilder._customQueryPostTypeChange),e("body").delegate(".fl-text-field-add-value","change",FLBuilder._textFieldAddValueSelectChange),e("body").delegate(".fl-field input[type=number]","focus",FLBuilder._onNumberFieldFocus),e("body").delegate(".fl-field input[type=number]","blur",FLBuilder._onNumberFieldBlur),FLBuilder.addHook("didCompleteAJAX",FLBuilder._refreshSettingsPreviewReference),FLBuilder.addHook("didRenderLayoutComplete",FLBuilder._refreshSettingsPreviewReference)},_unbindEvents:function(){e("a").off("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").off("click",FLBuilder._headerLinkClicked),e("body").undelegate(".fl-builder-content a","click",FLBuilder._preventDefault)},_rebindEvents:function(){e("a").on("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),e("body").delegate(".fl-builder-content a","click",FLBuilder._preventDefault)},_bindOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.delegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.delegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.delegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.delegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.delegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_destroyOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.undelegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.undelegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.undelegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.undelegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.undelegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_onContextmenu:function(t){e(this).hide()},_preventDefault:function(e){e.preventDefault()},_stopPropagation:function(e){e.stopPropagation()},_headerLinkClicked:function(t){var i=e(this),l=i.attr("href");this.hash||(t.preventDefault(),FLBuilderConfig.isUserTemplate||(FLBuilder._exitUrl=l.indexOf("?")>-1?l:l+"?fl_builder",FLBuilder.triggerHook("triggerDone")))},_warnBeforeUnload:function(){var t=e(".fl-builder-row-settings").length>0,i=e(".fl-builder-col-settings").length>0,l=e(".fl-builder-module-settings").length>0;if(t||i||l)return FLBuilderStrings.unloadWarning},_initTipTips:function(){e(".fl-tip:not(.fl-has-tip)").each(function(){var t=e(this);t.addClass("fl-has-tip"),void 0==t.attr("data-title")&&t.attr("data-title",t.attr("title"))}).tipTip({defaultPosition:"top",delay:1e3})},_hideTipTips:function(){e("#tiptip_holder").stop().hide()},_submenuParentClicked:function(t){var i=e("body"),l=e(this),o=l.find(".fl-builder-submenu");l.hasClass("fl-builder-submenu-open")?(i.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-right")):(l.offset().left+o.width()>e(window).width()&&l.addClass("fl-builder-submenu-right"),i.addClass("fl-builder-submenu-open"),l.addClass("fl-builder-submenu-open")),o.closest(".fl-row-overlay").addClass("fl-row-menu-active"),FLBuilder._hideTipTips(),t.preventDefault(),t.stopPropagation()},_submenuChildClicked:function(t){var i=e("body"),l=e(this).parents(".fl-builder-has-submenu");l.parents(".fl-builder-has-submenu").length||(i.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-open"))},_submenuMouseenter:function(t){var i=e(this),l=i.data("timeout");"undefined"!=typeof l&&clearTimeout(l)},_submenuMouseleave:function(t){var i=e("body"),l=e(this),o=setTimeout(function(){i.removeClass("fl-builder-submenu-open"),l.closest(".fl-builder-has-submenu").removeClass("fl-builder-submenu-open")},500);l.closest(".fl-row-overlay").removeClass("fl-row-menu-active"),l.data("timeout",o)},_submenuNestedParentMouseenter:function(t){var i=e(this),l=i.find(".fl-builder-submenu");i.width()+i.offset().left+l.width()>e(window).width()&&i.addClass("fl-builder-submenu-right")},_closeAllSubmenus:function(){e(".fl-builder-submenu-open").removeClass("fl-builder-submenu-open")},_upgradeClicked:function(){window.open(FLBuilderConfig.upgradeUrl)},_buttonMouseUp:function(t){e(t.currentTarget).blur()},_closePanel:function(){FLBuilder.triggerHook("hideContentPanel")},_showPanel:function(){FLBuilder.triggerHook("showContentPanel")},_togglePanel:function(){FLBuilder.triggerHook("toggleContentPanel")},_blockSectionTitleClicked:function(){var t=e(this),i=t.parent();i.hasClass("fl-active")?i.removeClass("fl-active"):(e(".fl-builder-blocks-section").removeClass("fl-active"),i.addClass("fl-active")),FLBuilder._initScrollbars()},_publishLayout:function(e){if(FLBuilder._triggerSettingsSave(!1,!0)){if(_.isUndefined(e))var e=!0;FLBuilder.ajax({action:"save_layout"},this._onPublishComplete.bind(this,e))}},_publishButtonClicked:function(e){FLBuilder._publishLayout(e)},_onPublishComplete:function(t){t&&(FLBuilderConfig.shouldRefreshOnPublish?FLBuilder._exit():FLBuilder._exitWithoutRefresh()),e("#wp-admin-bar-fl-builder-frontend-edit-link .fl-builder-admin-bar-status-dot").css("color","#6bc373"),FLBuilder.triggerHook("didPublishLayout")},_draftButtonClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_draft"},FLBuilder._exit)},_discardButtonClicked:function(){var e=confirm(FLBuilderStrings.discardMessage);e?(FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"clear_draft_layout"},FLBuilder._exit)):FLBuilder.triggerHook("didCancelDiscard")},_cancelButtonClicked:function(){FLBuilder._exitUrl=null,FLBuilder._actionsLightbox.close()},_exit:function(){var e=window.location.href;FLBuilderConfig.isUserTemplate&&"undefined"!=typeof window.opener&&window.opener?("undefined"!=typeof window.opener.FLBuilder&&("undefined"==typeof FLBuilderGlobalNodeId?window.opener.FLBuilder._updateLayout():window.opener.FLBuilder._updateNode(FLBuilderGlobalNodeId)),window.close()):(FLBuilder._exitUrl?e=FLBuilder._exitUrl:(e=e.replace("?fl_builder&","?"),e=e.replace("?fl_builder",""),e=e.replace("&fl_builder","")),window.location.href=e)},_exitWithoutRefresh:function(){window.location.href;FLBuilderConfig.isUserTemplate&&"undefined"!=typeof window.opener&&window.opener?("undefined"!=typeof window.opener.FLBuilder&&("undefined"==typeof FLBuilderGlobalNodeId?window.opener.FLBuilder._updateLayout():window.opener.FLBuilder._updateNode(FLBuilderGlobalNodeId)),window.close()):FLBuilder.triggerHook("endEditingSession")},_duplicateLayoutClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"duplicate_post"},FLBuilder._duplicateLayoutComplete)},_duplicateLayoutComplete:function(e){var t=FLBuilderConfig.adminUrl;window.location.href=t+"post.php?post="+e+"&action=edit"},_layoutSettingsClicked:function(){FLBuilderSettingsForms.render({id:"layout",className:"fl-builder-layout-settings",settings:FLBuilderSettingsConfig.settings.layout},function(){FLBuilder._layoutSettingsInitCSS()})},_layoutSettingsInitCSS:function(){var t=e(".fl-builder-settings #fl-field-css textarea:not(.ace_text-input)");t.on("change",FLBuilder._layoutSettingsCSSChanged),FLBuilder._layoutSettingsCSSCache=t.val()},_layoutSettingsCSSChanged:function(){FLBuilder._layoutSettingsCSSTimeout&&clearTimeout(FLBuilder._layoutSettingsCSSTimeout),FLBuilder._layoutSettingsCSSTimeout=setTimeout(e.proxy(FLBuilder._layoutSettingsCSSDoChange,this),600)},_layoutSettingsCSSDoChange:function(){var t=e(".fl-builder-settings"),i=e(this),l=i.parents("#fl-field-css");l.find(".ace_error").length>0||(t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(i.val()):e("#fl-builder-global-css").html(i.val()),FLBuilder._layoutSettingsCSSTimeout=null)},_saveLayoutSettingsClicked:function(){for(var t=e(this).closest(".fl-builder-settings"),i=t.serializeArray(),l={},o=0;o<i.length;o++)l[i[o].name]=i[o].value;FLBuilder.showAjaxLoader(),FLBuilder._lightbox.close(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_layout_settings",settings:l},function(){FLBuilder.triggerHook("didSaveLayoutSettingsComplete",l),FLBuilder._updateLayout()})},_cancelLayoutSettingsClicked:function(){var t=e(".fl-builder-settings");t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(FLBuilder._layoutSettingsCSSCache):e("#fl-builder-global-css").html(FLBuilder._layoutSettingsCSSCache),FLBuilder._layoutSettingsCSSCache=null},_globalSettingsClicked:function(){FLBuilderSettingsForms.render({id:"global",className:"fl-builder-global-settings",settings:FLBuilderSettingsConfig.settings.global},function(){FLBuilder._layoutSettingsInitCSS()})},_saveGlobalSettingsClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=t.validate().form(),l=FLBuilder._getSettings(t);i&&(FLBuilder.showAjaxLoader(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_global_settings",settings:l},FLBuilder._saveGlobalSettingsComplete),FLBuilder._lightbox.close())},_saveGlobalSettingsComplete:function(e){FLBuilderConfig.global=JSON.parse(e),FLBuilder.triggerHook("didSaveGlobalSettingsComplete",FLBuilderConfig.global),FLBuilder._updateLayout()},_initTemplateSelector:function(){var t=e(FLBuilder._contentClass).find(".fl-row"),i=t.length>0;i||FLBuilder.ContentPanel.show("modules")},_requestTemplateInsert:function(e,t){FLBuilder.layoutHasContent()?0==e?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate(0,!1,t)):(FLBuilder._selectedTemplateId=e,FLBuilder._selectedTemplateType=t,FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(e,!1,t)},_showTemplateActions:function(){var e=[];e[10]={key:"template-replace",label:FLBuilderStrings.templateReplace},e[20]={key:"template-append",label:FLBuilderStrings.templateAppend},FLBuilder._showActionsLightbox({className:"fl-builder-template-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_templateReplaceClicked:function(){confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!1,FLBuilder._selectedTemplateType))},_templateAppendClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!0,FLBuilder._selectedTemplateType)},_templateCancelClicked:function(){FLBuilder.triggerHook("showContentPanel")},_applyTemplate:function(e,t,i){t="undefined"!=typeof t&&t?"1":"0",i="undefined"==typeof i?"core":i,FLBuilder._lightbox.close(),FLBuilder.showAjaxLoader(),"core"==i?FLBuilder.ajax({action:"apply_template",template_id:e,append:t},FLBuilder._applyTemplateComplete):FLBuilder.ajax({action:"apply_user_template",template_id:e,append:t},FLBuilder._applyUserTemplateComplete),FLBuilder.triggerHook("didApplyTemplate")},_applyTemplateComplete:function(e){var t=JSON.parse(e);FLBuilder._renderLayout(t.layout),FLBuilder.triggerHook("didApplyTemplateComplete",t.config)},_applyUserTemplateComplete:function(t){var i=JSON.parse(t);null!==i.layout_css&&e("#fl-builder-layout-css").html(i.layout_css),FLBuilder._renderLayout(i.layout),FLBuilder.triggerHook("didApplyTemplateComplete",i.config)},_saveUserTemplateClicked:function(){FLBuilderSettingsForms.render({id:"user_template",className:"fl-builder-user-template-settings",rules:{name:{required:!0}}})},_saveUserTemplateSettings:function(){var t=e(this).closest(".fl-builder-settings"),i=t.validate().form(),l=FLBuilder._getSettings(t);i&&(FLBuilder.ajax({action:"save_user_template",settings:l},FLBuilder._saveUserTemplateSettingsComplete),FLBuilder._lightbox.close())},_saveUserTemplateSettingsComplete:function(e){if(e){var e=JSON.parse(e);FLBuilderConfig.contentItems.template.push(e),FLBuilder.triggerHook("contentItemsChanged")}},_userTemplateClicked:function(){var t=e(this).attr("data-id");e(FLBuilder._contentClass).children(".fl-row").length>0?"blank"==t?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),
3
  FLBuilder._applyTemplate("blank",!1,"user")):(FLBuilder._selectedTemplateId=t,FLBuilder._selectedTemplateType="user",FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(t,!1,"user")},_editUserTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteUserTemplateClicked:function(t){var i=e(this).closest(".fl-user-template"),l=i.attr("data-id"),o=(e(".fl-user-template[data-id="+l+"]"),null),s=null,n=null;if(confirm(FLBuilderStrings.deleteTemplate)){FLBuilder.ajax({action:"delete_user_template",template_id:l});for(s in FLBuilderConfig.contentItems.template)n=FLBuilderConfig.contentItems.template[s],n.postId==l&&(o=s);_.isNull(o)||(FLBuilderConfig.contentItems.template.splice(o,1),FLBuilder.triggerHook("contentItemsChanged"))}t.stopPropagation()},_viewKnowledgeBaseClicked:function(){window.open(FLBuilderConfig.help.knowledge_base_url)},_visitForumsClicked:function(){window.open(FLBuilderConfig.help.forums_url)},_showTourOrTemplates:function(){FLBuilderConfig.simpleUi||FLBuilderConfig.isUserTemplate||(FLBuilderConfig.help.tour&&FLBuilderConfig.newUser?FLBuilder._showTourLightbox():FLBuilder._initTemplateSelector())},_showTourLightbox:function(){var e=wp.template("fl-tour-lightbox");FLBuilder._actionsLightbox.open(e())},_noTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._initTemplateSelector()},_yesTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_startHelpTour:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_setupEmptyLayout:function(){var t=e(FLBuilder._contentClass);FLBuilderConfig.isUserTemplate&&"module"==FLBuilderConfig.userTemplateType||FLBuilderConfig.isUserTemplate&&"column"==FLBuilderConfig.userTemplateType||(t.removeClass("fl-builder-empty"),t.find(".fl-builder-empty-message").remove(),t.find(".fl-row, .fl-builder-block").length||(t.addClass("fl-builder-empty"),t.append('<span class="fl-builder-empty-message">'+FLBuilderStrings.emptyMessage+"</span>"),FLBuilder._initSortables()))},_updateNode:function(t,i){e(".fl-node-"+t).length&&(FLBuilder._showNodeLoading(t),FLBuilder.ajax({action:"render_node",node_id:t},function(e){FLBuilder._renderLayout(JSON.parse(e),i)}.bind(this)))},_updateLayout:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"render_layout"},FLBuilder._renderLayout)},_renderLayout:function(e,t){FLBuilder._layout=new FLBuilderAJAXLayout(e,t)},_renderLayoutComplete:function(){FLBuilder._layout&&(FLBuilder._layout._complete(),FLBuilder._layout=null)},_resizeLayout:function(){e(window).trigger("resize"),"undefined"!=typeof YUI&&YUI().use("node-event-simulate",function(e){e.one(window).simulate("resize")})},layoutHasContent:function(){return e(FLBuilder._contentClass).children(".fl-row").length>0},_initMediaElements:function(){var t={};"undefined"!=typeof e.fn.mediaelementplayer&&("undefined"!=typeof _wpmejsSettings&&(t.pluginPath=_wpmejsSettings.pluginPath),e(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").mediaelementplayer(t))},_initDropTargets:function(){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",l=e(FLBuilder._contentClass+" .fl-row"),o=null,s=e(FLBuilder._contentClass+" .fl-row"+t).find(".fl-col-group"),n=null,r=null,a="column"==FLBuilderConfig.userTemplateType?e(FLBuilder._contentClass+"> .fl-col").eq(0):null;for(i=0,e(".fl-col-drop-target").remove(),e(".fl-col-group-drop-target").remove(),e(".fl-row-drop-target").remove(),e(FLBuilder._contentClass).append('<div class="fl-drop-target fl-row-drop-target"></div>'),l.prepend('<div class="fl-drop-target fl-row-drop-target"></div>'),l.append('<div class="fl-drop-target fl-drop-target-last fl-row-drop-target fl-row-drop-target-last"></div>');i<l.length;i++)o=l.eq(i),0===o.find(".fl-col-group").length&&o.find(".fl-row-content").prepend('<div class="fl-drop-target fl-col-group-drop-target"></div>');for(a&&0===s.length&&(s=a.find(".fl-col-group"),a.append('<div class="fl-drop-target fl-col-drop-target"></div>'),a.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')),i=0;i<s.length;i++)n=s.eq(i),r=n.find("> .fl-col"),n.hasClass("fl-col-group-nested")||(n.append('<div class="fl-drop-target fl-col-group-drop-target"></div>'),n.append('<div class="fl-drop-target fl-drop-target-last fl-col-group-drop-target fl-col-group-drop-target-last"></div>')),r.append('<div class="fl-drop-target fl-col-drop-target"></div>'),r.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')},_blockDragHelper:function(e,t){var i=t.clone();return t.clone().insertAfter(t),i.addClass("fl-builder-block-drag-helper"),i},_blockDragInit:function(t){var i=e(t.currentTarget),l=null,o=e(window).scrollTop(),s=0;FLBuilder._dragEnabled=!0,FLBuilder._dragInitialScrollTop=o,i.closest("[data-node]").length>0?(l=i.closest("[data-node]"),l.addClass("fl-node-drag-init")):i.hasClass("fl-builder-block")&&e(".fl-row").each(function(){null===l&&e(this).offset().top-o>0&&(l=e(this))}),null!==l&&(s=l.offset().top-o),FLBuilder._highlightRowsAndColsForDrag(i),FLBuilder._adjustColHeightsForDrag(),FLBuilder._disableGlobalRows(),FLBuilder._disableGlobalCols(),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays(),FLBuilder._initSortables(),e("body").addClass("fl-builder-dragging"),e(".fl-builder-empty-message").hide(),e(".fl-sortable-disabled").removeClass("fl-sortable-disabled"),s>0&&scrollTo(0,l.offset().top-s),FLBuilder.triggerHook("didInitDrag")},_blockDragStart:function(t,i){FLBuilder._dragging=!0,e(".fl-node-drag-init").removeClass("fl-node-drag-init"),FLBuilder.triggerHook("didStartDrag")},_blockDragSort:function(t,i){var l=i.placeholder.parent(),o=FLBuilderStrings.insert;FLBuilder._blockPreventSort(i.item,l)||(l.hasClass("fl-col-content")?o=i.item.hasClass("fl-builder-block-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-col-sortable-proxy-item")?FLBuilderStrings.column:i.item.hasClass("fl-builder-block-module")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-module")||i.item.hasClass("fl-builder-block-module-template")?i.item.find(".fl-builder-block-title").text():i.item.attr("data-name"):l.hasClass("fl-col-drop-target")?o="":l.hasClass("fl-col-group-drop-target")?o="":l.hasClass("fl-row-drop-target")&&(o=i.item.hasClass("fl-builder-block-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-column")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-row-sortable-proxy-item")?FLBuilderStrings.row:FLBuilderStrings.newRow),i.placeholder.html(o),i.item.hasClass("fl-node-global")||i.item.hasClass("fl-builder-block-global")||e(".fl-node-dragging").hasClass("fl-node-global")?i.placeholder.addClass("fl-builder-drop-zone-global"):i.placeholder.removeClass("fl-builder-drop-zone-global"))},_blockDragChange:function(e,t){t.placeholder.css("opacity","0"),t.placeholder.animate({opacity:"1"},100)},_blockPreventSort:function(t,i){var l=!1,o=t.hasClass("fl-builder-block-row"),s=t.hasClass("fl-col-sortable-proxy-item"),n=i.hasClass("fl-col-content"),r=i.hasClass("fl-col-drop-target"),a=i.parents(".fl-col-group:not(.fl-col-group-nested)"),d=i.parents(".fl-col-group-nested");return(o||s)&&n&&d.length>0&&(l=!0),n&&!i.find(".fl-module, .fl-col").length&&(o&&"1-col"==t.data("cols")?l=!0:s&&(l=!0)),o&&n&&e.inArray(t.data("cols"),["5-cols","6-cols"])>-1&&(l=!0),s&&e(".fl-node-dragging").find(".fl-col-group-nested").length>0&&(n||r&&d.length>0)&&(l=!0),r&&a.length>0&&0===d.length&&a.find("> .fl-col:visible").length>11&&(l=!0),r&&d.length>0&&d.find(".fl-col:visible").length>3&&(l=!0),l&&i.addClass("fl-sortable-disabled"),l},_blockDragStop:function(t,i){var l=e(window).scrollTop(),o=i.item.parent(),s=null;o.hasClass("fl-drop-target")&&o.closest("[data-node]").length?(o=o.closest("[data-node]"),s=o.offset().top-l):s=o.offset().top-l,o.hasClass("fl-builder-blocks-section-content")&&FLBuilder._showPanel(),FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._enableGlobalCols(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),scrollTo(0,o.offset().top-s),FLBuilder.triggerHook("didStopDrag")},_blockDragCancel:function(){FLBuilder._dragEnabled&&!FLBuilder._dragging&&(FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),e(".fl-node-drag-init").removeClass("fl-node-drag-init"),e(".fl-node-dragging").removeClass("fl-node-dragging"),scrollTo(0,FLBuilder._dragInitialScrollTop))},_reorderNode:function(e,t){FLBuilder.ajax({action:"reorder_node",node_id:e,position:t})},_moveNode:function(e,t,i){FLBuilder.ajax({action:"move_node",new_parent:e,node_id:t,position:i})},_removeAllOverlays:function(){FLBuilder._removeRowOverlays(),FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._removeModuleOverlays(),FLBuilder._hideTipTips(),FLBuilder._closeAllSubmenus()},_appendOverlay:function(e,t){var i=0,l=null,o=e.hasClass("fl-row"),s=o?e.find("> .fl-row-content-wrap"):e.find("> .fl-node-content"),n={top:parseInt(s.css("margin-top"),10),bottom:parseInt(s.css("margin-bottom"),10)};return e.append(t),e.addClass("fl-block-overlay-active"),FLBuilder._initTipTips(),l=e.find("> .fl-block-overlay"),n.top<0&&(i=parseInt(l.css("top"),10),i=isNaN(i)?0:i,l.css("top",n.top+i+"px")),n.bottom<0&&(i=parseInt(l.css("bottom"),10),i=isNaN(i)?0:i,l.css("bottom",n.bottom+i+"px")),l},_buildOverlayOverflowMenu:function(e){var t=e.find(".fl-block-overlay-header");for(actions=e.find(".fl-block-overlay-actions"),hasRules=e.find(".fl-block-has-rules"),original=actions.data("original"),actionsWidth=0,items=null,itemsWidth=0,item=null,i=0,visibleItems=[],overflowItems=[],menuData=[],template=wp.template("fl-overlay-overflow-menu"),void 0!=original&&(actions.after(original),actions.remove(),actions=original),actions.data("original",actions.clone()),actionsWidth=Math.floor(actions[0].getBoundingClientRect().width)-8,items=actions.find(" > i, > span.fl-builder-has-submenu"),hasRules.length&&actionsWidth+hasRules.outerWidth()>t.outerWidth()&&(itemsWidth+=hasRules.outerWidth());i<items.length;i++)item=items.eq(i),itemsWidth+=Math.floor(item[0].getBoundingClientRect().width),itemsWidth>actionsWidth?(overflowItems.push(item),item.remove()):visibleItems.push(item);if(overflowItems.length>0){for(visibleItems.length>0&&overflowItems.unshift(visibleItems.pop().remove()),i=0;i<overflowItems.length;i++)overflowItems[i].is(".fl-builder-has-submenu")?menuData.push({type:"submenu",label:overflowItems[i].find(".fa, .fas, .far").data("title"),submenu:overflowItems[i].find(".fl-builder-submenu")[0].outerHTML}):menuData.push({type:"action",label:overflowItems[i].data("title"),className:overflowItems[i].removeClass(function(e,t){return t.replace(/fl-block-([^\s]+)/,"")}).attr("class")});actions.append(template(menuData)),FLBuilder._initTipTips()}},_removeRowOverlays:function(){e(".fl-row").removeClass("fl-block-overlay-active"),e(".fl-row-overlay").remove(),e(".fl-module").removeClass("fl-module-adjust-height"),e("body").removeClass("fl-builder-row-resizing"),FLBuilder._closeAllSubmenus()},_disableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-row.fl-node-global").addClass("fl-node-disabled")},_disableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&e(".fl-row:not(.fl-node-global) .fl-col.fl-node-global").addClass("fl-node-disabled")},_enableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-node-disabled").removeClass("fl-node-disabled")},_enableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&e(".fl-node-disabled").removeClass("fl-node-disabled")},_rowMouseenter:function(){var t=e(this),i=t.offset().top,l=null,o=null,s=wp.template("fl-row-overlay");t.closest(".fl-builder-node-loading").length||t.hasClass("fl-block-overlay-active")||(o=FLBuilder._appendOverlay(t,s({node:t.attr("data-node"),global:t.hasClass("fl-node-global"),hasRules:t.hasClass("fl-node-has-rules")})),t.find(".fl-node-content:visible").each(function(){var t=e(this).offset().top;l=null===l||l>t?t:l}),null!==l&&l<i&&o.css("top",l-i-30+"px"),o.offset().top<43&&o.addClass("fl-row-overlay-header-bottom"),t.find(".fl-module").each(function(){var t=e(this);t.outerHeight(!0)<20&&t.addClass("fl-module-adjust-height")}),FLBuilder._buildOverlayOverflowMenu(o))},_rowMouseleave:function(t){var i=e(t.toElement)||e(t.relatedTarget),l=i.hasClass("fl-row-overlay"),o=i.closest(".fl-row-overlay").length>0,s=i.is("#tiptip_holder"),n=i.closest("#tiptip_holder").length>0;l||o||s||n||FLBuilder._removeRowOverlays()},_rowDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.row+"</div>")},_rowDragInit:function(t){var i=e(t.target),l=e(".fl-row-sortable-proxy-item"),o=i.closest(".fl-row");o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),t.target=l[0],l.trigger(t)},_rowDragStart:function(t,i){var l=e(FLBuilder._contentClass+" .fl-row"),o=e(".fl-node-dragging");1===l.length&&e(FLBuilder._contentClass).addClass("fl-builder-empty"),o.hide(),FLBuilder._blockDragStart(t,i)},_rowDragStop:function(t,i){var l=i.item,o=l.parent(),s=null,n=null,r=0;if(FLBuilder._blockDragStop(t,i),o.hasClass("fl-builder-rows"))return void l.remove();if(o.hasClass("fl-row-sortable-proxy"))return void e(".fl-node-dragging").removeClass("fl-node-dragging").show();if(l.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-col-content")?FLBuilder._addColGroup(l.closest(".fl-col").attr("data-node"),l.attr("data-cols"),o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(l)):o.hasClass("fl-col-drop-target")?FLBuilder._addCols(o.closest(".fl-col"),o.hasClass("fl-col-drop-target-last")?"after":"before",l.attr("data-cols"),o.closest(".fl-col-group-nested").length>0):o.hasClass("fl-col-group-drop-target")?(n=l.closest(".fl-col-group"),r=l.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(n),FLBuilder._addColGroup(l.closest(".fl-row").attr("data-node"),l.attr("data-cols"),o.hasClass("fl-drop-target-last")?r+1:r)):(s=l.closest(".fl-row"),r=s.length?e(FLBuilder._contentClass+" > .fl-row").index(s):0,FLBuilder._addRow(l.attr("data-cols"),o.hasClass("fl-drop-target-last")?r+1:r)),l.remove(),FLBuilder._showPanel(),e(".fl-builder-modules").siblings(".fl-builder-blocks-section-title").eq(0).trigger("click")}else s=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o.parent().hasClass("fl-builder-content")||(o.hasClass("fl-drop-target-last")?o.parent().after(s):o.parent().before(s),FLBuilder._reorderNode(s.attr("data-node"),s.index())),e(".fl-row-sortable-proxy").append(i.item)},_addRow:function(t,i){FLBuilder._showNodeLoadingPlaceholder(e(FLBuilder._contentClass),i),FLBuilder._newRowPosition=i,FLBuilder.ajax({action:"render_new_row",cols:t,position:i},FLBuilder._addRowComplete)},_addRowComplete:function(t){var i="object"==typeof t?t:JSON.parse(t),l=e(FLBuilder._contentClass),o=e(i.html).data("node"),s=FLBuilder._addModuleAfterNodeRender;i.nodeParent=l,i.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(i,function(){null!==s&&(e(".fl-node-"+o+" .fl-col-content").append(s),FLBuilder._reorderModule(s),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+o)),FLBuilder.triggerHook("didAddRow",o)})},_deleteRowClicked:function(t){var i=e(this).closest(".fl-row"),l=null;i.find(".fl-module").length?(l=confirm(FLBuilderStrings.deleteRowMessage),l&&FLBuilder._deleteRow(i)):FLBuilder._deleteRow(i),FLBuilder._removeAllOverlays(),t.stopPropagation()},_deleteRow:function(e){var t=e.attr("data-node");FLBuilder.ajax({action:"delete_node",node_id:t}),e.empty(),e.remove(),FLBuilder._setupEmptyLayout(),FLBuilder._removeRowOverlays(),FLBuilder.triggerHook("didDeleteRow",t)},_rowCopyClicked:function(t){var i=e(this).closest(".fl-row"),l=i.attr("data-node"),o=e(FLBuilder._contentClass+" > .fl-row").index(i)+1,s=i.clone(),n=e(".fl-builder-settings[data-node]"),r=n.attr("data-node"),a=r===l?i:i.find('[data-node="'+r+'"]'),d=null;n.length&&a.length&&(d=FLBuilder._getSettings(n),FLBuilderSettingsConfig.nodes[r]=d),s.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),s.find(".fl-block-overlay").remove(),i.after(s),e("html, body").animate({scrollTop:s.offset().top-75},500),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newRowPosition=o,FLBuilder.ajax({action:"copy_row",node_id:l,settings:d,settings_id:r},function(e){var t=JSON.parse(e);t.duplicatedRow=l,FLBuilder._rowCopyComplete(t)}),t.stopPropagation()},_rowCopyComplete:function(t){t.nodeParent=e(FLBuilder._contentClass),t.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(t,function(){FLBuilder.triggerHook("didDuplicateRow",{newNodeId:t.nodeId,oldNodeId:t.duplicatedRow}),t.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_rowSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-row").attr("data-node"),o=i.closest(".fl-block-overlay-global").length>0,s=null;o&&"row"!=FLBuilderConfig.userTemplateType?FLBuilderConfig.userCanEditGlobalTemplates&&(s=window.open(e('.fl-row[data-node="'+l+'"]').attr("data-template-url")),s.FLBuilderGlobalNodeId=l):i.hasClass("fl-block-settings")&&FLBuilderSettingsForms.render({id:"row",nodeId:l,className:"fl-builder-row-settings",attrs:'data-node="'+l+'"',buttons:o||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:o?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[l],preview:{type:"row"}},function(){e("#fl-field-width select").on("change",FLBuilder._rowWidthChanged),e("#fl-field-content_width select").on("change",FLBuilder._rowWidthChanged)}),t.stopPropagation()},_rowWidthChanged:function(){var t=e("#fl-field-width select").val(),i=e("#fl-field-content_width select").val(),l=e("#fl-field-max_content_width");"fixed"==t||"full"==t&&"fixed"==i?l.show():l.hide()},_resetRowWidthClicked:function(t){var i=e(this),l=i.closest(".fl-row"),o=l.attr("data-node"),s=l.find(".fl-row-content"),n=FLBuilderConfig.global.row_width+"px",r=e(".fl-builder-row-settings");l.hasClass("fl-row-fixed-width")&&l.css("max-width",n),s.css("max-width",n),r.length&&r.find("[name=max_content_width]").val(""),FLBuilder.ajax({action:"resize_row_content",node:o,width:""}),FLBuilder._closeAllSubmenus(),FLBuilder.triggerHook("didResetRowWidth",o),t.stopPropagation()},_highlightEmptyCols:function(){var t="row"==FLBuilderConfig.userTemplateType||"column"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",i=(e(FLBuilder._contentClass+" .fl-row"+t),e(FLBuilder._contentClass+" .fl-col"+t));e(".fl-row-highlight").removeClass("fl-row-highlight"),i.removeClass("fl-col-highlight").find(".fl-col-content").css("height",""),i.each(function(){var t=e(this);0===t.find(".fl-module, .fl-col").length&&t.addClass("fl-col-highlight")})},_removeEmptyColHighlights:function(){e(".fl-row-highlight").removeClass("fl-row-highlight"),e(".fl-col-highlight").removeClass("fl-col-highlight")},_highlightRowsAndColsForDrag:function(t){var i="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)";"column"==FLBuilderConfig.userTemplateType&&(i=":not(:first)"),e(FLBuilder._contentClass+" .fl-row").addClass("fl-row-highlight"),t.closest(".fl-row-overlay").length||e(FLBuilder._contentClass+" .fl-col"+i).addClass("fl-col-highlight")},_adjustColHeightsForDrag:function(){var t="row"==FLBuilderConfig.userTemplateType?"":".fl-row:not(.fl-node-global) ",i="column"==FLBuilderConfig.userTemplateType?"":".fl-col:not(.fl-node-global) ",l=e(FLBuilder._contentClass),o=l.find(t+".fl-col-group:not(.fl-col-group-nested) > "+i+"> .fl-col-content"),s=l.find(t+".fl-col-group-nested "+i+".fl-col-content"),n=0;for(e(".fl-node-drag-init").hide();n<s.length;n++)FLBuilder._adjustColHeightForDrag(s.eq(n));for(n=0;n<o.length;n++)FLBuilder._adjustColHeightForDrag(o.eq(n));e(".fl-node-drag-init").show()},_adjustColHeightForDrag:function(e){e.find(".fl-module:visible, .fl-col:visible").length&&e.height(e.height()+45)},_showColHighlightGuide:function(){var t=e(this),i=t.find("a"),l=t.closest(".fl-col"),o=l.parents(".fl-col"),s=e('<div class="fl-col-highlight-guide"></div>'),n=null,r=t.closest(".fl-block-overlay").offset().top;(i.hasClass("fl-block-col-move-parent")||i.hasClass("fl-block-col-edit-parent"))&&(l=o),l.hasClass("fl-col-highlight")||(l.find("> .fl-col-content").append(s),l.addClass("fl-col-has-highlight-guide"),n=s.offset().top,n>r&&s.css("top",r-n+4+"px"))},_removeColHighlightGuides:function(){e(".fl-col-has-highlight-guide").removeClass("fl-col-has-highlight-guide"),e(".fl-col-highlight-guide").remove()},_colMouseenter:function(){var t=e(this),i=t.closest(".fl-col-group"),l=i.hasClass("fl-col-group-has-child-loading"),o=t.hasClass("fl-node-global"),s=t.parents(".fl-node-global").length>0,n=t.closest(".fl-col-group").find("> .fl-col").length,r=i.find("> .fl-col").index(t),a=0===r,d=n===r+1,u=t.find(".fl-col").length>0,c=t.find(".fl-module").length>0,h=t.parents(".fl-col"),f=h.closest(".fl-col-group"),g=h.length>0,p="undefined"!=typeof t.data("template-url"),b="column"==FLBuilderConfig.userTemplateType&&!g;numParentCols=g?f.find("> .fl-col").length:0,parentIndex=f.find("> .fl-col").index(h),parentFirst=!!g&&0===parentIndex,parentLast=!!g&&numParentCols===parentIndex+1,contentWidth=t.find("> .fl-col-content").width(),row=t.closest(".fl-row"),rowIsFixedWidth=!!row.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,userCanResizeRows=FLBuilderConfig.rowResize.userCanResizeRows,hasRules=t.hasClass("fl-node-has-rules"),template=wp.template("fl-col-overlay"),overlay=null,FLBuilderConfig.simpleUi||o&&s&&c&&!p||o&&"column"==FLBuilderConfig.userTemplateType&&c||!o&&t.find(".fl-module").length>0||t.find(".fl-builder-node-loading-placeholder").length>0||!c&&u||s&&u&&!p||t.closest(".fl-builder-node-loading").length||(t.hasClass("fl-block-overlay-active")||(FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),overlay=FLBuilder._appendOverlay(t,template({global:o,groupLoading:l,numCols:n,first:a,last:d,isRootCol:b,hasChildCols:u,hasParentCol:g,parentFirst:parentFirst,parentLast:parentLast,numParentCols:numParentCols,contentWidth:contentWidth,rowIsFixedWidth:rowIsFixedWidth,userCanResizeRows:userCanResizeRows,hasRules:hasRules})),FLBuilder._buildOverlayOverflowMenu(overlay),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_colMouseleave:function(t){var i=e(this),l=e(t.toElement)||e(t.relatedTarget),o=i.find(".fl-module").length>0,s=(i.hasClass("fl-node-global"),"undefined"!=typeof i.data("template-url")),n=l.is("#tiptip_holder"),r=l.closest("#tiptip_holder").length>0;n||r||o&&!s||(FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._closeAllSubmenus())},_removeColOverlays:function(){var t=e(".fl-col");t.removeClass("fl-block-overlay-active"),t.find(".fl-col-overlay").remove(),e("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_colDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.column+"</div>")},_colDragInit:function(t){var i=e(t.target),l=e(".fl-col-sortable-proxy-item"),o=i.closest(".fl-col");i.hasClass("fl-block-col-move-parent")&&(o=o.parents(".fl-col")),o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),FLBuilder._removeColHighlightGuides(),t.target=l[0],l.trigger(t)},_colDragStart:function(t,i){var l=e(".fl-node-dragging");l.hide(),FLBuilder._resetColumnWidths(l.parent()),FLBuilder._blockDragStart(t,i)},_colDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o=l.attr("data-node"),s=i.item.parent(),n=l.parent(),r=n.attr("data-node");newGroup=s.closest(".fl-col-group"),newGroupId=newGroup.attr("data-node"),newRow=s.closest(".fl-row"),position=0,s.hasClass("fl-sortable-disabled")?FLBuilder._resetColumnWidths(n):s.hasClass("fl-col-sortable-proxy")?FLBuilder._resetColumnWidths(n):s.hasClass("fl-col-content")?(l.remove(),0===n.find(".fl-col").length&&n.remove(),position=s.find("> .fl-module, .fl-col-group, .fl-col-sortable-proxy-item").index(i.item),FLBuilder._addColGroup(s.closest(".fl-col").attr("data-node"),o,position)):s.hasClass("fl-col-drop-target")?(s.hasClass("fl-col-drop-target-last")?s.parent().after(l):s.parent().before(l),FLBuilder._resetColumnWidths(newGroup),r==newGroupId?FLBuilder.ajax({action:"reorder_col",node_id:o,position:l.index()}):FLBuilder.ajax({action:"move_col",node_id:o,new_parent:newGroupId,position:l.index(),resize:[r,newGroupId]}),FLBuilder._resizeLayout()):s.hasClass("fl-col-group-drop-target")?(l.remove(),0===n.find(".fl-col").length&&n.remove(),position=newRow.find(".fl-row-content > .fl-col-group").index(newGroup),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addColGroup(newRow.attr("data-node"),o,position)):s.hasClass("fl-row-drop-target")&&(l.remove(),position=s.closest(".fl-builder-content").find(".fl-row").index(newRow),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addRow(o,position)),0===n.find(".fl-col").length&&n.remove(),e(".fl-col-sortable-proxy").append(i.item),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._closeAllSubmenus()},_colSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-col"),o=l.find("> .fl-col-content"),s=i.parent().find("ul.fl-builder-submenu").length>0,n=i.closest(".fl-block-overlay-global").length>0,r=i.closest(".fl-block-overlay-global").hasClass("fl-col-overlay"),a="column"!=FLBuilderConfig.userTemplateType&&"undefined"!=typeof l.attr("data-template-url"),d=null;FLBuilder._colResizing||n&&!FLBuilderConfig.userCanEditGlobalTemplates||s&&!i.hasClass("fl-col-overlay")||(i.hasClass("fl-block-col-edit-parent")&&(l=l.parents(".fl-col")),d=l.attr("data-node"),n&&r&&a?FLBuilderConfig.userCanEditGlobalTemplates&&(win=window.open(e('.fl-col[data-node="'+d+'"]').attr("data-template-url")),win.FLBuilderGlobalNodeId=d):FLBuilderSettingsForms.render({id:"col",nodeId:d,className:"fl-builder-col-settings",attrs:'data-node="'+d+'"',buttons:n||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:n?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[d],preview:{type:"col"}},function(){0===l.siblings(".fl-col").length?e("#fl-builder-settings-section-general").hide():o.width()<=40&&e("#fl-field-size").hide()}),t.stopPropagation())},_copyColClicked:function(t){var i=e(this).closest(".fl-col"),l=i.attr("data-node"),o=i.clone(),s=i.parent(),n=e(".fl-builder-settings[data-node]"),r=n.attr("data-node"),a=r===l?i:i.find('[data-node="'+r+'"]'),d=null;n.length&&a.length&&(d=FLBuilder._getSettings(n),FLBuilderSettingsConfig.nodes[r]=d),o.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),o.find(".fl-block-overlay").remove(),i.after(o),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newColParent=s,FLBuilder._newColPosition=i.index()+1,FLBuilder._resetColumnWidths(s),FLBuilder.ajax({action:"copy_col",node_id:l,settings:d,settings_id:r},function(e){var t=JSON.parse(e);t.duplicatedColumn=l,FLBuilder._copyColComplete(t)}),t.stopPropagation()},_copyColComplete:function(e){e.nodeParent=FLBuilder._newColParent,e.nodePosition=FLBuilder._newColPosition,FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateColumn",{newNodeId:e.nodeId,oldNodeId:e.duplicatedColumn}),e.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_deleteColClicked:function(t){var i=e(this),l=i.closest(".fl-col"),o=l.closest(".fl-col-group"),s=l.parents(".fl-col"),n=s.length>0,r=s.find("> .fl-col-content > .fl-module, > .fl-col-content > .fl-col-group"),a=l.siblings(".fl-col"),d=!0;l.find(".fl-module").length>0&&(d=confirm(FLBuilderStrings.deleteColumnMessage)),n&&1===r.length&&(0===a.length?l=s:1!==a.length||a.find(".fl-module").length||(l=o)),d&&(FLBuilder._deleteCol(l),FLBuilder._removeAllOverlays(),FLBuilder._highlightEmptyCols()),t.stopPropagation()},_deleteCol:function(e){var t=e.attr("data-node"),i=e.closest(".fl-row"),l=e.closest(".fl-col-group"),o=0;e.remove(),rowCols=i.find(".fl-row-content > .fl-col-group > .fl-col"),groupCols=l.find(" > .fl-col"),0===rowCols.length&&"row"!=FLBuilderConfig.userTemplateType&&"column"!=FLBuilderConfig.userTemplateType?FLBuilder._deleteRow(i):(0===groupCols.length?l.remove():(o=6===groupCols.length?16.65:7===groupCols.length?14.28:Math.round(100/groupCols.length*100)/100,groupCols.css("width",o+"%"),FLBuilder.triggerHook("didResetColumnWidths",{cols:groupCols})),FLBuilder.ajax({action:"delete_col",node_id:t,new_width:o}),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder.triggerHook("didDeleteColumn",t))},_addCols:function(e,t,i,l){var o=e.closest(".fl-col-group"),s=o.find(".fl-col").index(e);i="undefined"==typeof i?"1-col":i,l="undefined"!=typeof l&&l,"after"==t&&s++,FLBuilder._showNodeLoadingPlaceholder(o,s),FLBuilder._removeAllOverlays(),FLBuilder.ajax({action:"render_new_columns",node_id:e.attr("data-node"),insert:t,type:i,nested:l?1:0},FLBuilder._addColsComplete)},_addColsComplete:function(t){var i="object"==typeof t?t:JSON.parse(t),l=null,o=FLBuilder._addModuleAfterNodeRender;i.nodeParent=FLBuilder._newColParent,i.nodePosition=FLBuilder._newColPosition,FLBuilder._renderLayout(i,function(){null!==o&&(e('.fl-module[data-node="'+o.module.data("node")+'"]').remove(),l=e('.fl-col[data-node="'+o.colId+'"]'),"after"==o.position?l.next().find(".fl-col-content").append(o.module):l.prev().find(".fl-col-content").append(o.module),FLBuilder._reorderModule(o.module),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+i.nodeId)),FLBuilder.triggerHook("didAddColumn",i.nodeId),FLBuilder.triggerHook("didResetColumnWidths",{cols:e(".fl-node-"+i.nodeId).find("> .fl-col")})})},_addColGroup:function(t,i,l){var o=e(".fl-node-"+t);FLBuilder._newColGroupPosition=l,o.hasClass("fl-col")?FLBuilder._newColGroupParent=o.find(" > .fl-col-content"):FLBuilder._newColGroupParent=o.find(".fl-row-content"),FLBuilder._showNodeLoadingPlaceholder(FLBuilder._newColGroupParent,l),FLBuilder.ajax({action:"render_new_column_group",cols:i,node_id:t,position:l},FLBuilder._addColGroupComplete)},_addColGroupComplete:function(t){var i=JSON.parse(t),l=e(i.html),o=l.data("node"),s=l.find(".fl-col").data("node"),n=FLBuilder._addModuleAfterNodeRender;i.nodeParent=FLBuilder._newColGroupParent,i.nodePosition=FLBuilder._newColGroupPosition,FLBuilder._renderLayout(i,function(){i.nodeParent.hasClass("fl-col-content")&&i.nodeParent.parents(".fl-col").addClass("fl-col-has-cols"),null!==n&&(e(".fl-node-"+s+" .fl-col-content").append(n),FLBuilder._reorderModule(n),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+o)),FLBuilder.triggerHook("didAddColumnGroup",o)})},_initColDragResizing:function(){e(".fl-block-col-resize").not(".fl-block-row-resize").draggable({axis:"x",start:FLBuilder._colDragResizeStart,drag:FLBuilder._colDragResize,stop:FLBuilder._colDragResizeStop})},_colDragResizeStart:function(t,i){var l=e(i.helper),o="",s=l.hasClass("fl-block-col-resize-parent"),n=s?l.closest(".fl-col").parents(".fl-col"):null,r=s?n.parents(".fl-col-group"):l.closest(".fl-col-group"),a=r.find("> .fl-col"),d=s?n:l.closest(".fl-col"),u=d.attr("data-node"),c=e("[data-node="+u+"] #fl-field-size input"),h=null,f=null,g=null,p=100,b=0,m=null,v=null;for(l.hasClass("fl-block-col-resize-e")?(o="e",h=d.nextAll(".fl-col").first()):(o="w",
4
- h=d.prevAll(".fl-col").first()),f=h.attr("data-node"),g=e("[data-node="+f+"] #fl-field-size input");b<a.length;b++)a.eq(b).data("node")!=d.data("node")&&a.eq(b).data("node")!=h.data("node")&&(p-=parseFloat(a.eq(b)[0].style.width));c.length?(m=c,v="col"):g.length&&(m=g,v="sibling"),FLBuilder._colResizeData={handle:l,feedbackLeft:l.find(".fl-block-col-resize-feedback-left"),feedbackRight:l.find(".fl-block-col-resize-feedback-right"),direction:o,groupWidth:r.outerWidth(),col:d,colWidth:parseFloat(d[0].style.width)/100,sibling:h,offset:i.position.left,availWidth:p,setting:m,settingType:v},FLBuilder._colResizing=!0,e("body").addClass("fl-builder-col-resizing"),FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents(),FLBuilder.triggerHook("col-resize-start")},_colDragResize:function(e,t){var i=FLBuilder._colResizeData,l=FLBuilderConfig.isRtl?"w":"e",o=i.handle.closest(".fl-block-overlay"),s=(i.offset-t.position.left)/i.groupWidth,n=l==i.direction?100*(i.colWidth-s):100*(i.colWidth+s),r=Math.round(100*n)/100,a=i.availWidth-n,d=Math.round(100*a)/100,u=8,c=Math.round(100*(i.availWidth-u))/100;r<u?(r=u,d=c):d<u&&(r=c,d=u),l==i.direction?(i.feedbackLeft.html(r.toFixed(1)+"%").show(),i.feedbackRight.html(d.toFixed(1)+"%").show()):(i.feedbackLeft.html(d.toFixed(1)+"%").show(),i.feedbackRight.html(r.toFixed(1)+"%").show()),i.col.css("width",r+"%"),i.sibling.css("width",d+"%"),i.setting&&("col"===i.settingType?i.setting.val(parseFloat(i.col[0].style.width)):"sibling"===i.settingType&&i.setting.val(parseFloat(i.sibling[0].style.width))),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder.triggerHook("col-resize-drag")},_colDragResizeStop:function(t,i){var l=FLBuilder._colResizeData,o=FLBuilder._colResizeData.handle.closest(".fl-block-overlay"),s=l.col.data("node"),n=parseFloat(l.col[0].style.width),r=l.sibling.data("node"),a=parseFloat(l.sibling[0].style.width);FLBuilder._colResizeData.feedbackLeft.hide(),FLBuilder._colResizeData.feedbackRight.hide(),FLBuilder.ajax({action:"resize_cols",col_id:s,col_width:n,sibling_id:r,sibling_width:a}),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder._colResizeData=null,e("body").removeClass("fl-builder-col-resizing"),FLBuilder._bindOverlayEvents(),setTimeout(function(){FLBuilder._colResizing=!1},50),FLBuilder.triggerHook("col-resize-stop"),FLBuilder.triggerHook("didResizeColumn",{colId:s,colWidth:n,siblingId:r,siblingWidth:a})},_resetColumnWidthsClicked:function(t){var i=e(this),l=!!i.closest(".fl-row-overlay").length,o=null,s=null,n=[],r=null,a=0,d=e(".fl-builder-col-settings"),u=null;s=l?i.closest(".fl-row").find(".fl-row-content > .fl-col-group"):i.parents(".fl-col-group").last(),s.each(function(){for(o=e(this),r=o.find(".fl-col-group"),n.push(o.data("node")),FLBuilder._resetColumnWidths(o),a=0;a<r.length;a++)FLBuilder._resetColumnWidths(r.eq(a)),n.push(r.eq(a).data("node"))}),d.length&&(u=e(".fl-node-"+d.attr("data-node")),d.find("#fl-field-size input").val(parseFloat(u[0].style.width))),FLBuilder.ajax({action:"reset_col_widths",group_id:n}),FLBuilder.triggerHook("col-reset-widths"),FLBuilder._closeAllSubmenus(),t.stopPropagation()},_resetColumnWidths:function(e){var t=e.find(" > .fl-col:visible"),i=0;i=6===t.length?16.65:7===t.length?14.28:Math.round(100/t.length*100)/100,t.css("width",i+"%"),FLBuilder.triggerHook("didResetColumnWidths",{cols:t})},_moduleMouseenter:function(){var t=e(this),i=t.attr("data-name"),l=t.hasClass("fl-node-global"),o=t.parents(".fl-node-global").length>0,s=t.parents(".fl-col-group").last(),n=s.hasClass("fl-col-group-has-child-loading"),r=t.closest(".fl-col-group").find("> .fl-col").length,a=t.closest(".fl-col"),d=0===a.index(),u=r===a.index()+1,c=a.parents(".fl-col"),h=c.length>0,f=h?c.closest(".fl-col-group").find("> .fl-col").length:0,g=!!h&&0===c.index(),p=!!h&&f===c.index()+1,b="column"==FLBuilderConfig.userTemplateType&&!h;contentWidth=a.find("> .fl-col-content").width(),row=t.closest(".fl-row"),isGlobalRow=row.hasClass("fl-node-global"),rowIsFixedWidth=!!row.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,userCanResizeRows=FLBuilderConfig.rowResize.userCanResizeRows,hasRules=t.hasClass("fl-node-has-rules"),colHasRules=a.hasClass("fl-node-has-rules"),template=wp.template("fl-module-overlay"),overlay=null,FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),l&&o&&"row"!=FLBuilderConfig.userTemplateType&&isGlobalRow||l&&o&&"column"!=FLBuilderConfig.userTemplateType&&!isGlobalRow||t.closest(".fl-builder-node-loading").length||t.find(".fl-inline-editor:visible").length||(t.hasClass("fl-block-overlay-active")||(overlay=FLBuilder._appendOverlay(t,template({global:l,moduleName:i,groupLoading:n,numCols:r,colFirst:d,colLast:u,isRootCol:b,hasParentCol:h,numParentCols:f,parentFirst:g,parentLast:p,contentWidth:contentWidth,rowIsFixedWidth:rowIsFixedWidth,userCanResizeRows:userCanResizeRows,hasRules:hasRules,colHasRules:colHasRules})),FLBuilder._buildOverlayOverflowMenu(overlay),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_moduleMouseleave:function(t){var i=(e(this),e(t.toElement)||e(t.relatedTarget)),l=i.is("#tiptip_holder"),o=i.closest("#tiptip_holder").length>0;l||o||(FLBuilder._removeModuleOverlays(),FLBuilder._removeColHighlightGuides())},_removeModuleOverlays:function(){var t=e(".fl-module");t.removeClass("fl-block-overlay-active"),t.find(".fl-module-overlay").remove(),e("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_moduleDragHelper:function(t,i){return e('<div class="fl-builder-block-drag-helper">'+i.attr("data-name")+"</div>")},_moduleDragStart:function(t,i){e(i.item).data("original-position",i.item.index()),FLBuilder._blockDragStart(t,i)},_moduleDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=i.item,o=l.parent(),s=null,n=0,r=0;if(o.hasClass("fl-builder-modules")||o.hasClass("fl-builder-widgets"))return void l.remove();if(l.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=l.closest(".fl-builder-content"),r=0,s=l.closest(".fl-row"),n=o.find(".fl-row").index(s)):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),r=o.closest(".fl-row").attr("data-node"),s=l.closest(".fl-col-group"),n=o.find(" > .fl-col-group").index(s)):o.hasClass("fl-col-drop-target")?(o=l.closest(".fl-col-group"),r=o.attr("data-node"),s=l.closest(".fl-col"),n=o.find(" > .fl-col").index(s)):(n=o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(l),r=l.closest(".fl-col").attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),FLBuilder._addModule(o,r,l.attr("data-type"),n,l.attr("data-widget"),l.attr("data-alias")),l.remove()}else{if(o.hasClass("fl-sortable-disabled"))return e(t.target).append(i.item),e(t.target).children().eq(i.item.data("original-position")).before(i.item),void FLBuilder._highlightEmptyCols();o.hasClass("fl-row-drop-target")?(s=l.closest(".fl-row"),n=l.closest(".fl-builder-content").children(".fl-row").index(s),n=l.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addModuleAfterNodeRender=l,FLBuilder._addRow("1-col",n),l.remove()):o.hasClass("fl-col-group-drop-target")?(s=l.closest(".fl-col-group"),n=l.closest(".fl-row-content ").find(" > .fl-col-group").index(s),n=l.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addModuleAfterNodeRender=l,FLBuilder._addColGroup(l.closest(".fl-row").attr("data-node"),"1-col",n),l.remove()):o.hasClass("fl-col-drop-target")?(s=l.closest(".fl-col"),n=l.closest(".fl-col-drop-target-last").length?"after":"before",FLBuilder._addModuleAfterNodeRender={module:l,colId:s.data("node"),position:n},FLBuilder._addCols(s,n,"1-col",l.closest(".fl-col-group-nested").length>0),l.remove()):FLBuilder._reorderModule(l)}FLBuilder._resizeLayout()},_reorderModule:function(e){var t=e.closest(".fl-col").attr("data-node"),i=e.attr("data-parent"),l=e.attr("data-node"),o=e.index();t==i?FLBuilder._reorderNode(l,o):(e.attr("data-parent",t),FLBuilder._moveNode(t,l,o))},_deleteModuleClicked:function(t){var i=e(this).closest(".fl-module"),l=confirm(FLBuilderStrings.deleteModuleMessage);l&&(FLBuilder._deleteModule(i),FLBuilder._removeAllOverlays()),t.stopPropagation()},_deleteModule:function(e){var t=e.closest(".fl-row"),i=e.attr("data-node");FLBuilder.ajax({action:"delete_node",node_id:i}),e.empty(),e.remove(),t.removeClass("fl-block-overlay-muted"),FLBuilder._highlightEmptyCols(),FLBuilder._removeAllOverlays(),FLBuilder.triggerHook("didDeleteModule",i)},_moduleCopyClicked:function(t){var i=e(this).closest(".fl-module"),l=i.attr("data-node"),o=i.index()+1,s=i.clone(),n=e(".fl-builder-module-settings[data-node="+l+"]"),r=null;n.length&&(r=FLBuilder._getSettings(n),FLBuilderSettingsConfig.nodes[l]=r),s.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),s.find(".fl-block-overlay").remove(),i.after(s),e("html, body").animate({scrollTop:s.offset().top-75},500),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newModuleParent=i.parent(),FLBuilder._newModulePosition=o,FLBuilder.ajax({action:"copy_module",node_id:l,settings:r},function(e){var t=JSON.parse(e);t.duplicatedModule=l,FLBuilder._moduleCopyComplete(t)}),t.stopPropagation()},_moduleCopyComplete:function(e){e.nodeParent=FLBuilder._newModuleParent,e.nodePosition=FLBuilder._newModulePosition,FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateModule",{newNodeId:e.nodeId,oldNodeId:e.duplicatedModule}),e.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_moduleSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-module").attr("data-type"),o=i.closest(".fl-module").attr("data-node"),s=i.closest(".fl-col").attr("data-node"),n=i.closest(".fl-block-overlay-global").length>0;t.stopPropagation(),FLBuilder._colResizing||n&&!FLBuilderConfig.userCanEditGlobalTemplates||FLBuilder._showModuleSettings({type:l,nodeId:o,parentId:s,global:n})},_showModuleSettings:function(t,i){if(FLBuilderSettingsConfig.modules){var l=FLBuilderSettingsConfig.modules[t.type],o=t.settings?t.settings:FLBuilderSettingsConfig.nodes[t.nodeId],s=e("head");-1===e.inArray(t.type,FLBuilder._loadedModuleAssets)&&(""!==l.assets.css&&s.append(l.assets.css),""!==l.assets.js&&s.append(l.assets.js),FLBuilder._loadedModuleAssets.push(t.type)),FLBuilderSettingsForms.render({type:"module",id:t.type,nodeId:t.nodeId,className:"fl-builder-module-settings fl-builder-"+t.type+"-settings",attrs:'data-node="'+t.nodeId+'" data-parent="'+t.parentId+'" data-type="'+t.type+'"',buttons:t.global||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:t.global?[FLBuilderStrings.global]:[],settings:o,legacy:t.legacy,helper:FLBuilder._moduleHelpers[t.type],rules:FLBuilder._moduleHelpers[t.type]?FLBuilder._moduleHelpers[t.type].rules:null,preview:{type:"module",layout:t.layout,callback:function(){FLBuilder.triggerHook("didAddModule",t.nodeId)}}},i)}},_saveModuleClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=t.attr("data-type"),l=(t.attr("data-node"),FLBuilder._moduleHelpers[i]),o=!0;"undefined"!=typeof l&&(t.find("label.error").remove(),t.validate().hideErrors(),o=t.validate().form(),o&&(o=l.submit())),o?FLBuilder._saveSettings():FLBuilder._toggleSettingsTabErrors()},_addModule:function(e,t,i,l,o,s){FLBuilder._showNodeLoadingPlaceholder(e,l),e.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=e,FLBuilder._newModulePosition=l),FLBuilder.ajax({action:"render_new_module",parent_id:t,type:i,position:l,node_preview:1,widget:"undefined"==typeof o?"":o,alias:"undefined"==typeof s?"":s},FLBuilder._addModuleComplete)},_addModuleComplete:function(t){var i=JSON.parse(t);i.layout&&(i.layout.nodeParent=FLBuilder._newModuleParent,i.layout.nodePosition=FLBuilder._newModulePosition),i.settings||(i.settings=FLBuilderSettingsConfig.defaults.modules[i.type]),e("form.fl-builder-settings").length?i.layout&&FLBuilder._renderLayout(i.layout):FLBuilder._showModuleSettings(i,function(){e(".fl-builder-module-settings").data("new-module","1")})},registerModuleHelper:function(t,i){var l={rules:{},init:function(){},submit:function(){return!0},preview:function(){}};FLBuilder._moduleHelpers[t]=e.extend({},l,i)},_registerModuleHelper:function(e,t){FLBuilder.registerModuleHelper(e,t)},_showNodeTemplateSettings:function(t){var i=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=i.attr("data-node"),o=FLBuilderStrings.saveModule;return i.hasClass("fl-builder-row-settings")?o=FLBuilderStrings.saveRow:i.hasClass("fl-builder-col-settings")&&(o=FLBuilderStrings.saveColumn),!!FLBuilder._triggerSettingsSave(!1,!1,!1)&&void FLBuilderSettingsForms.render({id:"node_template",nodeId:l,title:o,attrs:'data-node="'+l+'"',className:"fl-builder-node-template-settings",rules:{name:{required:!0}}},function(){FLBuilderConfig.userCanEditGlobalTemplates||e("#fl-field-global").hide()})},_saveNodeTemplate:function(){var t=e(".fl-builder-node-template-settings"),i=t.attr("data-node"),l=t.validate().form();l&&(FLBuilder._showNodeLoading(i),FLBuilder.ajax({action:"save_node_template",node_id:i,settings:FLBuilder._getSettings(t)},function(e){FLBuilder._saveNodeTemplateComplete(e),FLBuilder._hideNodeLoading(i)}),FLBuilder._lightbox.close())},_saveNodeTemplateComplete:function(t){var i=JSON.parse(t),l=e(".fl-builder-saved-"+i.type+"s"),o=l.find(".fl-builder-block"),s=null,n="",r=i.name.toLowerCase(),a=0,d=wp.template("fl-node-template-block"),u={name:i.name,isGlobal:i.global,content:i.type,id:i.id,postID:i.postID,kind:"template",type:"user",link:i.link,category:{uncategorized:FLBuilderStrings.uncategorized}};if(FLBuilderConfig.contentItems.template.push(u),FLBuilder.triggerHook("contentItemsChanged"),i.layout&&(FLBuilder._renderLayout(i.layout),FLBuilder.triggerHook("didSaveGlobalNodeTemplate",i.config)),0===o.length)l.append(d(i));else for(;a<o.length;a++){if(s=o.eq(a),n=s.text().toLowerCase().trim(),0===a&&r<n){l.prepend(d(i));break}if(r<n){s.before(d(i));break}if(o.length-1===a){l.append(d(i));break}}l.find(".fl-builder-block-no-node-templates").remove()},_nodeTemplateDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=i.item,o=l.parent(),s=null,n=0,r=null,a="",d=null;if(o.hasClass("fl-builder-blocks-section-content"))return void l.remove();if(l.hasClass("fl-builder-block-saved-row")||l.hasClass("fl-builder-block-row-template"))r=l.closest(".fl-row"),n=r.length?e(FLBuilder._contentClass+" .fl-row").index(r):0,n=o.hasClass("fl-drop-target-last")?n+1:n,s=null,a="render_new_row",d=FLBuilder._addRowComplete,FLBuilder._newRowPosition=n,FLBuilder._showNodeLoadingPlaceholder(e(FLBuilder._contentClass),n);else if(l.hasClass("fl-builder-block-saved-column")){if(r=l.closest(".fl-col"),colGroup=o.closest(".fl-col-group"),colGroupId=colGroup.attr("data-node"),a="render_new_col_template",d=FLBuilder._addColsComplete,o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(r=l.closest(".fl-row"),s=0,o=e(FLBuilder._contentClass),n=r.length?o.find(".fl-row").index(r):0):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),s=l.closest(".fl-row").attr("data-node"),n=l.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(l.closest(".fl-col-group"))):o.hasClass("fl-col-drop-target")&&(o=l.closest(".fl-col-group"),n=o.children(".fl-col").index(l.closest(".fl-col")),s=o.attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),o.hasClass("fl-col-group")?FLBuilder._newColParent=null:FLBuilder._newColParent=o,FLBuilder._newColPosition=n,FLBuilder._showNodeLoadingPlaceholder(o,n)}else if(l.hasClass("fl-builder-block-saved-module")||l.hasClass("fl-builder-block-module-template")){if(a="render_new_module",d=FLBuilder._addModuleComplete,o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=l.closest(".fl-builder-content"),s=0,n=o.find(".fl-row").index(l.closest(".fl-row"))):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),s=o.closest(".fl-row").attr("data-node"),n=o.find(" > .fl-col-group").index(l.closest(".fl-col-group"))):o.hasClass("fl-col-drop-target")?(o=l.closest(".fl-col-group"),n=o.children(".fl-col").index(l.closest(".fl-col")),s=o.attr("data-node")):(n=o.children(".fl-module, .fl-builder-block").index(l),s=l.closest(".fl-col").attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),o.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=o,FLBuilder._newModulePosition=n),FLBuilder._showNodeLoadingPlaceholder(o,n)}FLBuilder.ajax({action:a,template_id:l.attr("data-id"),template_type:l.attr("data-type"),parent_id:s,position:n},function(e){if(a.indexOf("row")>-1){var t=JSON.parse(e);FLBuilder.triggerHook("didApplyRowTemplateComplete",t.config),d(t.layout)}else if(a.indexOf("col")>-1){var t=JSON.parse(e);FLBuilder.triggerHook("didApplyColTemplateComplete",t.config),d(t.layout)}else d(e)}),l.remove()},_editNodeTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteNodeTemplateClicked:function(t){var i=e(t.target),l=i.closest(".fl-builder-blocks-section"),o=l.find(".fl-builder-blocks-section-content"),s=o.find(".fl-builder-block"),n=i.closest(".fl-builder-block"),r=n.hasClass("fl-builder-block-global"),a=r?FLBuilder._updateLayout:void 0,d=r?FLBuilderStrings.deleteGlobalTemplate:FLBuilderStrings.deleteTemplate,u=null;confirm(d)&&(n.remove(),1===s.length&&(n.hasClass("fl-builder-block-saved-row")?o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedRows+"</span>"):o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedModules+"</span>")),n.hasClass("fl-builder-block-global")&&FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"delete_node_template",template_id:n.attr("data-id")},a),u=_.findIndex(FLBuilderConfig.contentItems.template,{id:n.attr("data-id"),type:"user"}),FLBuilderConfig.contentItems.template.splice(u,1),FLBuilder.triggerHook("contentItemsChanged"))},_initSettingsForms:function(){FLBuilder._initCodeFields(),FLBuilder._initColorPickers(),FLBuilder._initSelectFields(),FLBuilder._initEditorFields(),FLBuilder._initMultipleFields(),FLBuilder._initAutoSuggestFields(),FLBuilder._initLinkFields(),FLBuilder._initFontFields(),FLBuilder._initOrderingFields(),FLBuilder._initTimezoneFields(),FLBuilder._focusFirstSettingsControl(),FLBuilder._lightbox._resizeEditors(),e(".fl-builder-settings-fields").css("visibility","visible"),FLBuilder.triggerHook("settings-form-init")},_destroySettingsForms:function(){FLBuilder._destroyEditorFields()},_setSettingsFormContent:function(t){e(".fl-legacy-settings").remove(),e("body").append(t)},_settingsTabClicked:function(t){var i=e(this),l=i.closest(".fl-builder-settings"),o=i.attr("href").split("#").pop();FLBuilder._resetSettingsTabsState(),l.find(".fl-builder-settings-tab").removeClass("fl-active"),l.find("#"+o).addClass("fl-active"),l.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),l.find("a[href*="+o+"]").addClass("fl-active"),FLBuilder._focusFirstSettingsControl(),t.preventDefault()},_resetSettingsTabsState:function(){var t=e(".fl-lightbox:visible");FLBuilder._hideTabsOverflowMenu(),t.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),t.find(".fl-builder-settings-tabs-overflow-menu .fl-active").removeClass("fl-active"),t.find(".fl-contains-active").removeClass("fl-contains-active")},_calculateSettingsTabsOverflow:function(){var t=e(".fl-lightbox:visible"),i=t.outerWidth(),l=t.hasClass("fl-lightbox-width-slim"),o=t.find(".fl-builder-settings-tabs"),s=t.find(".fl-builder-settings-tabs-overflow-menu"),n=t.find(".fl-builder-settings-tabs-more"),r=o.find("a"),a=!1,d=i-60,u=0,c=l?16:30;s.html(""),FLBuilder._hideTabsOverflowMenu(),r.removeClass("fl-overflowed"),r.each(function(){if(!e(this).is(":visible"))return!0;if(!a){var t=e(this).textWidth()+c+12;u+=t,u>=d&&(a=!0)}if(a){var i=e(this).html(),l=e(this).attr("href"),o="";e(this).hasClass("fl-active")&&(o="fl-active"),e(this).hasClass("error")&&(o+=" error"),""!==o&&(o='class="'+o+'"');var n=e('<a href="'+l+'" '+o+">"+i+"</a>");s.append(n),e(this).addClass("fl-overflowed")}else e(this).removeClass("fl-overflowed")}),a?t.addClass("fl-lightbox-has-tab-overflow"):t.removeClass("fl-lightbox-has-tab-overflow"),s.find(".fl-active").length>0?n.addClass("fl-contains-active"):n.removeClass("fl-contains-active"),s.find(".error").length>0?n.addClass("fl-contains-errors"):n.removeClass("fl-contains-errors")},_settingsTabsToOverflowMenuItemClicked:function(t){var i=e(t.currentTarget),l=i.attr("href"),o=i.closest(".fl-lightbox-header-wrap").find(".fl-builder-settings-tabs"),s=o.find('a[href="'+l+'"]'),n=o.find(".fl-builder-settings-tabs-more");FLBuilder._resetSettingsTabsState(),s.trigger("click"),i.addClass("fl-active"),n.addClass("fl-contains-active"),FLBuilder._hideTabsOverflowMenu(),t.preventDefault()},_hasOverflowTabs:function(){var t=e(".fl-lightbox:visible"),i=t.find(".fl-builder-settings-tabs-overflow-menu a");return i.length>0},_showTabsOverflowMenu:function(){if(FLBuilder._hasOverflowTabs()){var t=e(".fl-lightbox:visible");t.find(".fl-builder-settings-tabs-overflow-menu").css("display","flex"),t.find(".fl-builder-settings-tabs-overflow-click-mask").show(),this.isShowingSettingsTabsOverflowMenu=!0}},_hideTabsOverflowMenu:function(){var t=e(".fl-lightbox:visible");t.find(".fl-builder-settings-tabs-overflow-menu").css("display","none"),t.find(".fl-builder-settings-tabs-overflow-click-mask").hide(),this.isShowingSettingsTabsOverflowMenu=!1},_toggleTabsOverflowMenu:function(e){FLBuilder.isShowingSettingsTabsOverflowMenu?FLBuilder._hideTabsOverflowMenu():FLBuilder._showTabsOverflowMenu(),e.stopPropagation()},_settingsCancelClicked:function(t){var i=e(".fl-builder-lightbox[data-parent]"),l=e(".fl-builder-module-settings"),o=null,s=null,n=null,r=null;return i.length>0?void FLBuilder._closeNestedSettings():(l.length>0&&"undefined"!=typeof l.data("new-module")?(o=e(FLBuilder.preview.state.html),s=e(".fl-node-"+l.data("node")),n=s.closest(".fl-col"),r=o.find(".fl-node-"+n.data("node")),r.length>0?FLBuilder._deleteModule(s):FLBuilder._deleteCol(n)):FLBuilder.preview&&FLBuilder.preview.revert(),FLBuilder.preview=null,void FLLightbox.closeParent(this))},_focusFirstSettingsControl:function(){var t=e(".fl-builder-settings:visible"),i=t.find(".fl-builder-settings-tab.fl-active"),l=t.data("node"),o=i.find(".fl-field").first(),s=o.find('input:not([type="hidden"]), textarea, select, button, a, .fl-editor-field').first();if(!l||!e(".fl-node-"+l+" .fl-inline-editor").length){if("undefined"!=typeof tinyMCE&&s.hasClass("fl-editor-field")){var n=s.find("textarea.wp-editor-area").attr("id");tinyMCE.get(n).focus()}else setTimeout(function(){s.focus().css("animation-name","fl-grab-attention")},300);o.css("animation-name","fl-grab-attention"),o.on("animationend",function(){o.css("animation-name","")})}},_initSettingsValidation:function(t,i){var l=e(".fl-builder-settings").last();l.validate({ignore:".fl-ignore-validation",rules:t,messages:i,errorPlacement:FLBuilder._settingsErrorPlacement})},_settingsErrorPlacement:function(e,t){e.appendTo(t.parent())},_toggleSettingsTabErrors:function(){for(var t=e(".fl-builder-settings:visible"),i=t.find(".fl-builder-settings-tab"),l=null,o=null,s=0;s<i.length;s++)l=i.eq(s),o=l.find("label.error"),tabLink=t.find(".fl-builder-settings-tabs a[href*="+l.attr("id")+"]"),tabLink.find(".fl-error-icon").remove(),tabLink.removeClass("error"),o.length>0&&(tabLink.append('<span class="fl-error-icon"></span>'),tabLink.addClass("error"));FLBuilder._calculateSettingsTabsOverflow()},_getSettings:function(t){FLBuilder._updateEditorFields();var i=t.serializeArray(),l=0,o=0,s="",n="",r="",a=[],d=[],u={};for(l=0;l<i.length;l++)if(s=i[l].value.replace(/\r/gm,"").replace(/&#39;/g,"'"),!(i[l].name.indexOf("flrich")>-1))if(i[l].name.indexOf("[")>-1){for(n=i[l].name.replace(/\[(.*)\]/,""),r=i[l].name.replace(n,""),a=[],d=r.match(/\[[^\]]*\]/g),o=0;o<d.length;o++)"[]"!=d[o]&&a.push(d[o].replace(/\[|\]/g,""));r.match(/\[\]\[[^\]]*\]\[[^\]]+\]/)?("undefined"==typeof u[n]&&(u[n]={}),"undefined"==typeof u[n][a[0]]&&(u[n][a[0]]={}),"undefined"==typeof u[n][a[0]][a[1]]&&(u[n][a[0]][a[1]]={}),u[n][a[0]][a[1]]=s):r.match(/\[\]\[[^\]]*\]\[\]/)?("undefined"==typeof u[n]&&(u[n]={}),"undefined"==typeof u[n][a[0]]&&(u[n][a[0]]=[]),u[n][a[0]].push(s)):r.match(/\[\]\[[^\]]*\]/)?("undefined"==typeof u[n]&&(u[n]={}),u[n][a[0]]=s):r.match(/\[\]/)&&("undefined"==typeof u[n]&&(u[n]=[]),u[n].push(s))}else u[i[l].name]=s;for(r in u)if("undefined"!=typeof u["as_values_"+r]){u[r]=e.grep(u["as_values_"+r].split(","),function(e){return""!==e}).join(",");try{delete u["as_values_"+r]}catch(c){}}return e.each(t.find("[name]"),function(t,i){var l=e(i).attr("name").replace(/\[(.*)\]/,"");l in u||(u[l]="")}),u=e.extend({},FLBuilder._getOriginalSettings(t),u)},_getSettingsJSONForHTML:function(e){return JSON.stringify(e).replace(/\'/g,"&#39;").replace("<wbr />","<wbr>")},_getOriginalSettings:function(t,i){var l=t.find(".fl-builder-settings-json"),o=t.data("node"),s=FLBuilderSettingsConfig.nodes,n=null,r={};if(o&&s[o]?n=s[o]:l.length&&(n=JSON.parse(l.val().replace(/&#39;/g,"'"))),n)for(key in n)(e("#fl-field-"+key).length||i)&&(r[key]=n[key]);return r},_getSettingsForChangedCheck:function(t,i){var l=FLBuilder._getSettings(i);if(t){var o=e(".fl-node-"+t);if(o.hasClass("fl-module")){var s=o.data("type"),n=FLBuilderSettingsConfig.editables[s];if(n&&FLBuilderSettingsConfig.nodes[t])for(var r in n)l[r]=FLBuilderSettingsConfig.nodes[t][r]}}return l},_saveSettings:function(t){var i=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=i.data("new-module"),o=i.attr("data-node"),s=FLBuilder._getSettings(i),n=FLBuilder.preview;return!_.isUndefined(t)&&_.isBoolean(t)||(t=!0),n&&!n._settingsHaveChanged()&&_.isUndefined(l)?void FLBuilder._lightbox.close():(FLBuilder._showNodeLoading(o),FLBuilderSettingsConfig.nodes[o]=s,FLBuilder.ajax({action:"save_settings",node_id:o,settings:s},FLBuilder._saveSettingsComplete.bind(this,t,n)),FLBuilder.triggerHook("didSaveNodeSettings",{nodeId:o,settings:s}),void FLBuilder._lightbox.close())},_saveSettingsComplete:function(e,t,i){var l=JSON.parse(i),o=function(){t&&l.layout.partial&&l.layout.nodeId===t.nodeId&&(t.clear(),t=null)};!0===e?FLBuilder._renderLayout(l.layout,o):o(),FLBuilder.triggerHook("didSaveNodeSettingsComplete",{nodeId:l.node_id,settings:l.settings})},_triggerSettingsSave:function(t,i,l){var o=FLBuilder._lightbox._node.find("form.fl-builder-settings"),s=FLBuilder._lightbox._node.data("instance-id"),n=FLLightbox._instances[s],r=e(".fl-lightbox-wrap[data-parent]:visible"),a=!1,d=!0;return t=!_.isUndefined(t)&&t,i=!_.isUndefined(i)&&i,l=!!_.isUndefined(l)||l,o.length&&(r.length&&(r.find(".fl-builder-settings-save").trigger("click"),(r.find("label.error").length||e(".fl-builder-alert-lightbox:visible").length)&&(d=!1)),d&&!o.validate().form()&&(d=!1),a=FLBuilderSettingsForms.settingsHaveChanged(),d&&a&&(t&&n.disableClose(),o.find(".fl-builder-settings-save").trigger("click"),t&&n.enableClose(),(o.find("label.error").length||e(".fl-builder-alert-lightbox:visible").length)&&(d=!1)),l&&(FLBuilder._destroySettingsForms(),!a&&FLBuilder.preview&&(FLBuilder.preview.clear(),FLBuilder.preview=null)),a||t||n.close()),d||(FLBuilder.triggerHook("didFailSettingsSave"),FLBuilder._toggleSettingsTabErrors(),i&&!e(".fl-builder-alert-lightbox:visible").length&&FLBuilder.alert(FLBuilderStrings.settingsHaveErrors)),d},_refreshSettingsPreviewReference:function(){FLBuilder.preview&&FLBuilder.preview._initElementsAndClasses()},_openNestedSettings:function(t){t.className&&-1===t.className.indexOf("fl-builder-settings-lightbox")&&(t.className+=" fl-builder-settings-lightbox"),t=e.extend({className:"fl-builder-lightbox fl-builder-settings-lightbox",destroyOnClose:!0,resizable:!0},t);var i=e(".fl-lightbox-wrap:visible"),l=i.find(".fl-lightbox"),o=new FLLightbox(t),s=o._node,n=s.find(".fl-lightbox");return i.hide(),s.attr("data-parent",i.attr("data-instance-id")),n.attr("style",l.attr("style")),o.on("resized",FLBuilder._calculateSettingsTabsOverflow),o.open('<div class="fl-builder-lightbox-loading"></div>'),o},_closeNestedSettings:function(){var t=e(".fl-builder-lightbox[data-parent]:visible"),i=t.find(".fl-lightbox"),l=t.attr("data-instance-id"),o=FLLightbox._instances[l],s=t.attr("data-parent"),n=e('[data-instance-id="'+s+'"]'),r=n.find(".fl-lightbox"),a=n.find("form"),d=FLLightbox._instances[s];o.on("close",function(){r.attr("style",i.attr("style")),n.show(),d._resize(),n.find("label.error").remove(),a.validate().hideErrors(),FLBuilder._toggleSettingsTabErrors()}),o.close()},_showHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeIn()},_hideHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeOut()},_initAutoSuggestFields:function(){var t=e(".fl-builder-settings:visible .fl-suggest-field"),i=null,l=null,o=null,s=[];t.each(function(){i=e(this),""!==i.attr("data-value")&&(FLBuilderSettingsForms.showFieldLoader(i),s.push({name:i.attr("name"),value:i.attr("data-value"),action:i.attr("data-action"),data:i.attr("data-action-data")}))}),s.length?FLBuilder.ajax({action:"get_autosuggest_values",fields:s},function(i){l=JSON.parse(i);for(o in l)e('.fl-suggest-field[name="'+o+'"]').attr("data-value",l[o]);t.each(FLBuilder._initAutoSuggestField)}):t.each(FLBuilder._initAutoSuggestField)},_initAutoSuggestField:function(){var t=e(this);t.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:t.data("action"),fl_as_action_data:t.data("action-data"),_wpnonce:FLBuilderConfig.ajaxNonce}),e.extend({},{asHtmlID:t.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:2,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,preFill:t.data("value"),queryParam:"fl_as_query",afterSelectionAdd:FLBuilder._updateAutoSuggestField,afterSelectionRemove:FLBuilder._updateAutoSuggestField,selectionLimit:t.data("limit")},t.data("args"))),FLBuilderSettingsForms.hideFieldLoader(t)},_updateAutoSuggestField:function(t,i,l){e(this).siblings(".as-values").val(l.join(",")).trigger("change")},_initCodeFields:function(){e(".fl-builder-settings:visible").find(".fl-code-field").each(FLBuilder._initCodeField)},_initCodeField:function(){var t=e(this),i=t.closest(".fl-builder-settings"),l=t.find("textarea"),o=(l.attr("id"),l.data("editor")),s=l.data("wrap"),n=e("<div>",{position:"absolute",height:20*parseInt(l.attr("rows"),10)}),r=null;n.insertBefore(l),l.css("display","none"),ace.require("ace/ext/language_tools"),r=ace.edit(n[0]),r.$blockScrolling=1/0,r.getSession().setValue(l.val()),r.getSession().setMode("ace/mode/"+o),s&&r.getSession().setUseWrapMode(!0),r.setOptions(FLBuilderConfig.AceEditorSettings),r.getSession().on("change",function(e){l.val(r.getSession().getValue()).trigger("change")}),r.getSession().on("changeAnnotation",function(){for(var e=r.getSession().getAnnotations(),t=i.find(".fl-builder-settings-save"),l=i.find(".fl-builder-settings-error"),o=!1,s=0;s<e.length;s++)if(!(e[s].text.indexOf("DOCTYPE")>-1||e[s].text.indexOf("Named entity expected")>-1||e[s].text.indexOf("@supports")>-1||"error"!==e[s].type)){o=!0;break}o&&!l.length&&FLBuilderConfig.CheckCodeErrors?(t.addClass("fl-builder-settings-error"),t.on("click",FLBuilder._showCodeFieldError)):!o&&l.length&&(l.removeClass("fl-builder-settings-error"),l.off("click",FLBuilder._showCodeFieldError))}),l.closest(".fl-field").data("editor",r)},_showCodeFieldError:function(t){t.stopImmediatePropagation(),FLBuilder.confirm({message:FLBuilderStrings.codeError,cancel:function(){var t=e(".fl-builder-settings:visible .fl-builder-settings-save");t.removeClass("fl-builder-settings-error"),t.off("click",FLBuilder._showCodeFieldError),t.trigger("click")},strings:{
5
- ok:FLBuilderStrings.codeErrorFix,cancel:FLBuilderStrings.codeErrorIgnore}})},_initMultipleFields:function(){for(var t=e(".fl-builder-settings:visible .fl-builder-field-multiples"),i=null,l=null,o=0,s=FLBuilderConfig.isRtl?{left:10}:{right:10};o<t.length;o++)i=t.eq(o),l=i.find(".fl-builder-field-multiple"),1===l.length?l.eq(0).find(".fl-builder-field-actions").addClass("fl-builder-field-actions-single"):l.find(".fl-builder-field-actions").removeClass("fl-builder-field-actions-single");e(".fl-builder-field-multiples").sortable({items:".fl-builder-field-multiple",cursor:"move",cursorAt:s,distance:5,opacity:.5,placeholder:"fl-builder-field-dd-zone",stop:FLBuilder._fieldDragStop,tolerance:"pointer",axis:"y"})},_addFieldClicked:function(){var t=e(this),i=t.attr("data-field"),l=t.closest("tr").siblings("tr[data-field="+i+"]").last(),o=l.clone(),s=o.find(".fl-form-field"),n=null,r=parseInt(l.find("label span.fl-builder-field-index").html(),10)+1;o.find("th label span.fl-builder-field-index").html(r),o.find(".fl-form-field-preview-text").html(""),o.find(".fl-form-field-before").remove(),o.find(".fl-form-field-after").remove(),o.find("input, textarea, select").val(""),l.after(o),FLBuilder._initMultipleFields(),s.length&&(n=s.find(".fl-form-field-edit").data("type"),s.find("input").val(JSON.stringify(FLBuilderSettingsConfig.defaults.forms[n])))},_copyFieldClicked:function(){var t=e(this),i=t.closest("tr"),l=i.clone(),o=parseInt(i.find("label span.fl-builder-field-index").html(),10)+1;l.find("th label span.fl-builder-field-index").html(o),i.after(l),FLBuilder._renumberFields(i.parent()),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview()},_deleteFieldClicked:function(){var t=e(this).closest("tr"),i=t.parent(),l=confirm(FLBuilderStrings.deleteFieldMessage);l&&(t.remove(),FLBuilder._renumberFields(i),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview())},_renumberFields:function(e){for(var t=e.find(".fl-builder-field-multiple"),i=0;i<t.length;i++)t.eq(i).find("th label span.fl-builder-field-index").html(i+1)},_fieldDragHelper:function(){return e('<div class="fl-builder-field-dd-helper"></div>')},_fieldDragStop:function(e,t){FLBuilder._renumberFields(t.item.parent()),FLBuilder.preview.delayPreview()},_initSelectFields:function(){e(".fl-builder-settings:visible").find(".fl-builder-settings-fields select").trigger("change")},_settingsSelectChanged:function(){var t=e(this),i=t.attr("data-toggle"),l=t.attr("data-hide"),o=t.attr("data-trigger"),s=t.val(),n=0;if("undefined"!=typeof i){i=JSON.parse(i);for(n in i)FLBuilder._settingsSelectToggle(i[n].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(i[n].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[n].tabs,"hide","a[href*=fl-builder-settings-tab-","]");"undefined"!=typeof i[s]&&(FLBuilder._settingsSelectToggle(i[s].fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(i[s].sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[s].tabs,"show","a[href*=fl-builder-settings-tab-","]"))}if("undefined"!=typeof l&&(l=JSON.parse(l),"undefined"!=typeof l[s]&&(FLBuilder._settingsSelectToggle(l[s].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(l[s].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(l[s].tabs,"hide","a[href*=fl-builder-settings-tab-","]"))),"undefined"!=typeof o&&(o=JSON.parse(o),"undefined"!=typeof o[s]&&"undefined"!=typeof o[s].fields))for(n=0;n<o[s].fields.length;n++)e("#fl-field-"+o[s].fields[n]).find("select").trigger("change");FLBuilder._calculateSettingsTabsOverflow()},_settingsSelectToggle:function(t,i,l,o){var s=0;if(o="undefined"==typeof o?"":o,"undefined"!=typeof t)for(;s<t.length;s++)e(".fl-builder-settings:visible").find(l+t[s]+o)[i](),e(l+t[s]+o).parent().find('.fl-field[data-type="code"]').each(function(){e(this).data("editor").resize()})},_initColorPickers:function(){var t=FLBuilderConfig.colorPresets?FLBuilderConfig.colorPresets:[];FLBuilder.colorPicker=new FLBuilderColorPicker({mode:"hsv",elements:".fl-color-picker .fl-color-picker-value",presets:t,labels:{colorPresets:FLBuilderStrings.colorPresets,colorPicker:FLBuilderStrings.colorPicker,placeholder:FLBuilderStrings.placeholder,removePresetConfirm:FLBuilderStrings.removePresetConfirm,noneColorSelected:FLBuilderStrings.noneColorSelected,alreadySaved:FLBuilderStrings.alreadySaved,noPresets:FLBuilderStrings.noPresets,presetAdded:FLBuilderStrings.presetAdded}}),e(FLBuilder.colorPicker).on("presetRemoved presetAdded",function(e,t){FLBuilder.ajax({action:"save_color_presets",presets:t.presets})})},_initSinglePhotoSelector:function(){null===FLBuilder._singlePhotoSelector&&(FLBuilder._singlePhotoSelector=wp.media({title:FLBuilderStrings.selectPhoto,button:{text:FLBuilderStrings.selectPhoto},library:{type:"image"},multiple:!1}),FLBuilder._singlePhotoSelector.on("open",FLBuilder._wpmedia_reset_errors),_wpPluploadSettings.defaults.multipart_params.fl_upload_type="photo")},_selectSinglePhoto:function(){FLBuilder._initSinglePhotoSelector(),FLBuilder._singlePhotoSelector.once("open",e.proxy(FLBuilder._singlePhotoOpened,this)),FLBuilder._singlePhotoSelector.once("select",e.proxy(FLBuilder._singlePhotoSelected,this)),FLBuilder._singlePhotoSelector.open()},_singlePhotoOpened:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection"),i=e(this).closest(".fl-photo-field"),l=i.find("input[type=hidden]"),o=l.val(),s=null;e(this).hasClass("fl-photo-replace")?(t.reset(),i.addClass("fl-photo-empty"),l.val("")):""!==o?(s=wp.media.attachment(o),s.fetch(),t.add(s?[s]:[])):t.reset()},_singlePhotoSelected:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection").first().toJSON(),i=e(this).closest(".fl-photo-field"),l=i.find("input[type=hidden]"),o=i.find(".fl-photo-preview img"),s=i.find("select");l.val(t.id),o.attr("src",FLBuilder._getPhotoSrc(t)),i.removeClass("fl-photo-empty").removeClass("fl-photo-no-attachment"),i.find("label.error").remove(),s.show(),s.html(FLBuilder._getPhotoSizeOptions(t)),s.trigger("change"),FLBuilderSettingsConfig.attachments[t.id]=t},_singlePhotoRemoved:function(){FLBuilder._initSinglePhotoSelector();var t=FLBuilder._singlePhotoSelector.state(),i="undefined"!=typeof t?t.get("selection"):null,l=e(this).closest(".fl-photo-field"),o=l.find("input[type=hidden]"),s=l.find("select");i&&i.reset(),l.addClass("fl-photo-empty"),o.val(""),s.html('<option value="" selected></option>'),s.trigger("change")},_getPhotoSrc:function(e){return"undefined"==typeof e.sizes?e.url:"undefined"!=typeof e.sizes.thumbnail?e.sizes.thumbnail.url:e.sizes.full.url},_getPhotoSizeOptions:function(e,t){var i="",l=null,o=null,s="",n={full:FLBuilderStrings.fullSize,large:FLBuilderStrings.large,medium:FLBuilderStrings.medium,thumbnail:FLBuilderStrings.thumbnail};if("undefined"==typeof e.sizes||0===e.sizes.length)i+='<option value="'+e.url+'">'+FLBuilderStrings.fullSize+"</option>";else{t&&(t=t.replace(/https?/,""));for(l in e.sizes)s="undefined"!=typeof n[l]?n[l]+" - ":"undefined"!=typeof FLBuilderConfig.customImageSizeTitles[l]?FLBuilderConfig.customImageSizeTitles[l]+" - ":"",o="",t?t===e.sizes[l].url.replace(/https?/,"")&&(o=' selected="selected"'):o="full"==l?' selected="selected"':"",i+='<option value="'+e.sizes[l].url+'"'+o+">"+s+e.sizes[l].width+" x "+e.sizes[l].height+"</option>"}return i},_selectMultiplePhotos:function(){var t=e(this).closest(".fl-multiple-photos-field"),i=t.find("input[type=hidden]"),l=i.val(),o=""===l?"":JSON.parse(l),s=wp.media.gallery.defaults.id,n='[gallery ids="-1"]',r=null,a=null,d=null,u=null,c=[];if("object"==typeof o){for(u in o)c.push(o[u]);n='[gallery ids="'+c.join()+'"]'}r=wp.shortcode.next("gallery",n).shortcode,_.isUndefined(r.get("id"))&&!_.isUndefined(s)&&r.set("id",s),a=wp.media.gallery.attachments(r),d=new wp.media.model.Selection(a.models,{props:a.props.toJSON(),multiple:!0}),d.gallery=a.gallery,d.more().done(function(){d.length||FLBuilder._multiplePhotoSelector.setState("gallery-library"),d.props.set({query:!1}),d.unmirror(),d.props.unset("orderby")}),FLBuilder._multiplePhotoSelector&&FLBuilder._multiplePhotoSelector.dispose(),FLBuilder._multiplePhotoSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-photos-edit")?"gallery-edit":"gallery-library",title:wp.media.view.l10n.editGalleryTitle,editing:!0,multiple:!0,selection:d}).open(),e(FLBuilder._multiplePhotoSelector.views.view.el).addClass("fl-multiple-photos-lightbox"),FLBuilder._multiplePhotoSelector.once("update",e.proxy(FLBuilder._multiplePhotosSelected,this))},_multiplePhotosSelected:function(t){for(var i=e(this).closest(".fl-multiple-photos-field"),l=i.find("input[type=hidden]"),o=i.find(".fl-multiple-photos-count"),s=[],n=0;n<t.models.length;n++)s.push(t.models[n].id);1==s.length?o.html("1 "+FLBuilderStrings.photoSelected):o.html(s.length+" "+FLBuilderStrings.photosSelected),i.removeClass("fl-multiple-photos-empty"),i.find("label.error").remove(),l.val(JSON.stringify(s)).trigger("change")},_initSingleVideoSelector:function(){null===FLBuilder._singleVideoSelector&&(FLBuilder._singleVideoSelector=wp.media({title:FLBuilderStrings.selectVideo,button:{text:FLBuilderStrings.selectVideo},library:{type:"video"},multiple:!1}),FLBuilder._singleVideoSelector.on("open",FLBuilder._wpmedia_reset_errors),_wpPluploadSettings.defaults.multipart_params.fl_upload_type="video")},_selectSingleVideo:function(){FLBuilder._initSingleVideoSelector(),FLBuilder._singleVideoSelector.once("select",e.proxy(FLBuilder._singleVideoSelected,this)),FLBuilder._singleVideoSelector.open()},_singleVideoSelected:function(){var t=FLBuilder._singleVideoSelector.state().get("selection").first().toJSON(),i=e(this).closest(".fl-video-field"),l=i.find(".fl-video-preview-img"),o=i.find(".fl-video-preview-filename"),s=i.find("input[type=hidden]");l.html('<span class="dashicons dashicons-media-video"></span>'),o.html(t.filename),i.removeClass("fl-video-empty"),i.find("label.error").remove(),s.val(t.id).trigger("change"),FLBuilderSettingsConfig.attachments[t.id]=t},_singleVideoRemoved:function(){FLBuilder._initSingleVideoSelector();var t=FLBuilder._singleVideoSelector.state(),i="undefined"!=typeof t?t.get("selection"):null,l=e(this).closest(".fl-video-field"),o=l.find(".fl-video-preview-img img"),s=l.find(".fl-video-preview-filename"),n=l.find("input[type=hidden]");i&&i.reset(),o.attr("src",""),s.html(""),l.addClass("fl-video-empty"),n.val("").trigger("change")},_selectMultipleAudios:function(){var t=e(this).closest(".fl-multiple-audios-field"),i=t.find("input[type=hidden]"),l=i.val(),o=""==l?'[playlist ids="-1"]':'[playlist ids="'+JSON.parse(l).join()+'"]',s=wp.shortcode.next("playlist",o).shortcode,n=wp.media.playlist.defaults.id,r=null,a=null;_.isUndefined(s.get("id"))&&!_.isUndefined(n)&&s.set("id",n),r=wp.media.playlist.attachments(s),a=new wp.media.model.Selection(r.models,{props:r.props.toJSON(),multiple:!0}),a.playlist=r.playlist,a.more().done(function(){a.props.set({query:!1}),a.unmirror(),a.props.unset("orderby")}),FLBuilder._multipleAudiosSelector&&FLBuilder._multipleAudiosSelector.dispose(),FLBuilder._multipleAudiosSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-audios-edit")?"playlist-edit":"playlist-library",title:wp.media.view.l10n.editPlaylistTitle,editing:!0,multiple:!0,selection:a}).open(),FLBuilder._multipleAudiosSelector.content.get("view").sidebar.unset("playlist"),FLBuilder._multipleAudiosSelector.on("content:render:browse",function(e){e&&e.sidebar.on("ready",function(){e.sidebar.unset("playlist")})}),FLBuilder._multipleAudiosSelector.once("update",e.proxy(FLBuilder._multipleAudiosSelected,this))},_multipleAudiosSelected:function(t){for(var i=e(this).closest(".fl-multiple-audios-field"),l=i.find(".fl-multiple-audios-count"),o=i.find("input[type=hidden]"),s=[],n=0;n<t.models.length;n++)s.push(t.models[n].id);1==s.length?l.html("1 "+FLBuilderStrings.audioSelected):l.html(s.length+" "+FLBuilderStrings.audiosSelected),o.val(JSON.stringify(s)).trigger("change"),i.removeClass("fl-multiple-audios-empty"),i.find("label.error").remove()},_selectIcon:function(){var e=this;FLIconSelector.open(function(t){FLBuilder._iconSelected.apply(e,[t])})},_iconSelected:function(t){var i=e(this).closest(".fl-icon-field"),l=i.find("input[type=hidden]"),o=i.find("i"),s=o.attr("data-icon");l.val(t).trigger("change"),o.removeClass(s),o.addClass(t),o.attr("data-icon",t),i.removeClass("fl-icon-empty"),i.find("label.error").remove()},_removeIcon:function(){var t=e(this).closest(".fl-icon-field"),i=t.find("input[type=hidden]"),l=t.find("i");i.val("").trigger("change"),l.removeClass(),l.attr("data-icon",""),t.addClass("fl-icon-empty")},_formFieldClicked:function(){var t=e(this),i=t.closest(".fl-builder-settings"),l=t.attr("data-type"),o=t.siblings("input").val(),s=FLBuilder._moduleHelpers[l],n=(FLBuilderSettingsConfig.forms[l],FLBuilder._openNestedSettings({className:"fl-builder-lightbox fl-form-field-settings"}));""===o&&(o=JSON.stringify(FLBuilderSettingsConfig.forms[l])),FLBuilderSettingsForms.render({id:l,nodeId:i.attr("data-node"),nodeSettings:FLBuilder._getSettings(i),settings:JSON.parse(o.replace(/&#39;/g,"'")),lightbox:n,helper:s,rules:s?s.rules:null},function(){t.attr("id","fl-"+n._node.attr("data-instance-id")),n._node.find("form.fl-builder-settings").attr("data-type",l)})},_saveFormFieldClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=e(this).closest(".fl-lightbox-wrap").attr("data-instance-id"),l=t.attr("data-type"),o=FLBuilder._getSettings(t),s={},n=FLBuilder._moduleHelpers[l],r=e(".fl-builder-settings #fl-"+i),a=r.parent().attr("data-preview-text"),d=t.find("#fl-field-"+a),u=o[a],c=e('select[name="'+a+'"]'),h=document.createElement("div"),f=!0;return c.length>0&&(u=c.find('option[value="'+o[a]+'"]').text()),"undefined"!=typeof n&&(t.find("label.error").remove(),t.validate().hideErrors(),f=t.validate().form(),f&&(f=n.submit())),f?("undefined"!=typeof a&&"undefined"!=typeof u&&("icon"===d.data("type")?u='<i class="'+u+'"></i>':u.length>35&&(h.innerHTML=u,u=(h.textContent||h.innerText||"").replace(/^(.{35}[^\s]*).*/,"$1")+"..."),r.siblings(".fl-form-field-preview-text").html(u)),s=r.siblings("input").val().replace(/&#39;/g,"'"),""!=s&&(o=e.extend(JSON.parse(s),o)),r.siblings("input").val(JSON.stringify(o)).trigger("change"),FLBuilder._closeNestedSettings(),!0):(FLBuilder._toggleSettingsTabErrors(),!1)},_layoutFieldClicked:function(){var t=e(this);t.siblings().removeClass("fl-layout-field-option-selected"),t.addClass("fl-layout-field-option-selected"),t.siblings("input").val(t.attr("data-value"))},_initLinkFields:function(){e(".fl-builder-settings:visible .fl-link-field").each(FLBuilder._initLinkField)},_initLinkField:function(){var t=e(this),i=t.find(".fl-link-field-search-input");i.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:"fl_as_links",_wpnonce:FLBuilderConfig.ajaxNonce}),{asHtmlID:i.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:3,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,queryParam:"fl_as_query",selectionLimit:1,afterSelectionAdd:FLBuilder._updateLinkField})},_updateLinkField:function(e,t,i){var l=e.closest(".fl-link-field"),o=l.find(".fl-link-field-search"),s=l.find(".fl-link-field-search-input"),n=l.find(".fl-link-field-input");n.val(t.value).trigger("keyup"),s.autoSuggest("remove",t.value),o.hide()},_linkFieldSelectClicked:function(){var t=e(this).closest(".fl-link-field").find(".fl-link-field-search");t.show(),t.find("input").focus()},_linkFieldSelectCancelClicked:function(){var t=e(this);t.parent().hide(),t.closest(".fl-link-field").find("input.fl-link-field-input").focus()},_initFontFields:function(){e(".fl-builder-settings:visible .fl-font-field").each(FLBuilder._initFontField)},_initFontField:function(){var t=e(this),i=t.attr("data-value"),l=t.find(".fl-font-field-font"),o=t.find(".fl-font-field-weight");l.on("change",function(){FLBuilder._getFontWeights(l)}),i.indexOf("family")>-1&&(i=JSON.parse(i),l.val(i.family),l.trigger("change"),o.find("option[value="+i.weight+"]").length&&o.val(i.weight))},_getFontWeights:function(t){var i=t.next(".fl-font-field-weight"),l=t.val(),o={"default":"Default",regular:"Regular",100:"Thin 100",200:"Extra-Light 200",300:"Light 300",400:"Normal 400",500:"Medium 500",600:"Semi-Bold 600",700:"Bold 700",800:"Extra-Bold 800",900:"Ultra-Bold 900"},s={};i.html(""),s="undefined"!=typeof FLBuilderFontFamilies.system[l]?FLBuilderFontFamilies.system[l].weights:"undefined"!=typeof FLBuilderFontFamilies.google[l]?FLBuilderFontFamilies.google[l]:FLBuilderFontFamilies["default"][l],e.each(s,function(e,t){i.append('<option value="'+t+'">'+o[t]+"</option>")})},_initTinyMCE:function(){tinymce.ui.FloatPanel&&(tinymce.ui.FloatPanel.zIndex=100100),e(".fl-builder-hidden-editor").each(FLBuilder._initEditorField)},_initEditorFields:function(){e(".fl-builder-settings:visible .fl-editor-field").each(FLBuilder._initEditorField)},_initEditorField:function(){var t=e(this),i=t.find("textarea"),l=t.attr("data-name"),o="flrich"+(new Date).getTime()+"_"+l,s=FLBuilderConfig.wp_editor,n=tinyMCEPreInit,r=Number(t.attr("data-buttons")),a=t.attr("data-rows"),d=null,u=null;s=s.replace(/flbuildereditor/g,o),n=JSON.parse(JSON.stringify(n).replace(/flbuildereditor/g,o)),i.after(s).remove(),e("textarea#"+o).val(i.val()),void 0!==typeof tinymce&&void 0!==n.mceInit[o]&&(d=n.mceInit[o],u=tinymce.$("#wp-"+o+"-wrap"),u.find("textarea").attr("rows",a),r||u.find(".wp-media-buttons").remove(),!u.hasClass("tmce-active")&&n.qtInit.hasOwnProperty(o)||d.wp_skip_init||tinymce.init(d)),void 0!==typeof quicktags&&quicktags(n.qtInit[o]),window.wpActiveEditor=o},_reinitEditorFields:function(){e(".fl-lightbox-resizable:visible").length&&setTimeout(function(){var t,i;if("undefined"!=typeof tinymce){for(t=tinymce.editors.length-1;t>-1;t--)tinymce.editors[t].inline||(i=tinymce.editors[t].id,tinyMCE.execCommand("mceRemoveEditor",!0,i),tinyMCE.execCommand("mceAddEditor",!0,i));FLBuilder.preview&&FLBuilder.preview._initDefaultFieldPreviews(e('.fl-field[data-type="editor"]'))}},1)},_destroyEditorFields:function(){var t;if("undefined"!=typeof tinymce){for(t=tinymce.editors.length-1;t>-1;t--)tinymce.editors[t].inline||tinyMCE.execCommand("mceRemoveEditor",!0,tinymce.editors[t].id);e(".wplink-autocomplete").remove(),e(".ui-helper-hidden-accessible").remove()}},_updateEditorFields:function(){var t=e(".fl-builder-settings:visible textarea.wp-editor-area");t.each(FLBuilder._updateEditorField)},_updateEditorField:function(){var t=e(this),i=t.closest(".fl-editor-field"),l=(t.closest(".fl-builder-settings"),t.closest(".wp-editor-wrap")),o=t.attr("id"),s=i.attr("data-name"),n="undefined"!=typeof tinymce&&tinymce.get(o),r=t.siblings('textarea[name="'+s+'"]'),a=i.data("wpautop");0===r.length&&(r=e('<textarea name="'+s+'"></textarea>').hide(),t.after(r)),a?n&&l.hasClass("tmce-active")?r.val(n.getContent()):"undefined"!=typeof switchEditors?r.val(switchEditors.wpautop(t.val())):r.val(t.val()):(n&&l.hasClass("tmce-active")&&n.save(),r.val(t.val()))},_loopDataSourceChange:function(){var t=e(this).val();e(".fl-loop-data-source").hide(),e('.fl-loop-data-source[data-source="'+t+'"]').show()},_customQueryPostTypeChange:function(){var t=e(this).val();e(".fl-custom-query-filter").hide(),e(".fl-custom-query-"+t+"-filter").show()},_initOrderingFields:function(){e(".fl-builder-settings:visible .fl-ordering-field-options").each(FLBuilder._initOrderingField)},_initOrderingField:function(){e(this).sortable({items:".fl-ordering-field-option",containment:"parent",tolerance:"pointer",stop:FLBuilder._updateOrderingField})},_updateOrderingField:function(t){var i=e(t.target),l=i.siblings("input[type=hidden]"),o=[];i.find(".fl-ordering-field-option").each(function(){o.push(e(this).attr("data-key"))}),l.val(JSON.stringify(o)).trigger("change")},_textFieldAddValueSelectChange:function(){var t=e(this),i=e('input[name="'+t.data("target")+'"]'),l=i.val(),o=t.val(),s="";-1==l.indexOf(o)&&(s=(l.trim()+" "+o.trim()).trim(),i.val(s).trigger("change").trigger("keyup")),t.val("")},_onNumberFieldFocus:function(t){var i=e(t.currentTarget);i.addClass("mousetrap"),Mousetrap.bind("up",function(){i.attr("step",1)}),Mousetrap.bind("down",function(){i.attr("step",1)}),Mousetrap.bind("shift+up",function(){i.attr("step",10)}),Mousetrap.bind("shift+down",function(){i.attr("step",10)})},_onNumberFieldBlur:function(t){var i=e(t.currentTarget);i.attr("step",1).removeClass("mousetrap")},_initTimezoneFields:function(){e(".fl-builder-settings:visible .fl-field[data-type=timezone]").each(FLBuilder._initTimezoneField)},_initTimezoneField:function(){var t=e(this).find("select"),i=t.attr("data-value");t.find('option[value="'+i+'"]').attr("selected","selected")},ajax:function(t,i){var l;FLBuilder.triggerHook("didBeginAJAX",t);for(l in t)"undefined"==typeof t[l]&&(t[l]=null);return t._wpnonce=FLBuilderConfig.ajaxNonce,t.post_id=FLBuilderConfig.postId,t.fl_builder=1,t.fl_action=t.action,"undefined"!=typeof t.settings&&(t.settings=FLBuilder._ajaxModSecFix(e.extend(!0,{},t.settings))),"undefined"!=typeof t.node_settings&&(t.node_settings=FLBuilder._ajaxModSecFix(e.extend(!0,{},t.node_settings))),t={fl_builder_data:t},e.post(FLBuilder._ajaxUrl(),t,function(e){FLBuilder._ajaxComplete(),"undefined"!=typeof i&&i.call(this,e),FLBuilder.triggerHook("didCompleteAJAX",t)})},_ajaxComplete:function(){FLBuilder.hideAjaxLoader()},_ajaxUrl:function(e){var t=window.location.href.split("#").shift(),i=null;if("undefined"!=typeof e)for(i in e)t+=t.indexOf("?")>-1?"&":"?",t+=i+"="+e[i];return t},showAjaxLoader:function(){0===e(".fl-builder-lightbox-loading").length&&e(".fl-builder-loading").show()},hideAjaxLoader:function(){e(".fl-builder-loading").hide()},_showNodeLoading:function(t){var i=e(".fl-node-"+t);i.addClass("fl-builder-node-loading"),FLBuilder.triggerHook("didStartNodeLoading",i)},_hideNodeLoading:function(t){var i=e(".fl-node-"+t);i.removeClass("fl-builder-node-loading")},_showNodeLoadingPlaceholder:function(t,i){var l=e('<div class="fl-builder-node-loading-placeholder"></div>');t.hasClass("fl-builder-content")?siblings=t.find(" > .fl-row"):t.hasClass("fl-row-content")?siblings=t.find(" > .fl-col-group"):t.hasClass("fl-col-group")?(t.addClass("fl-col-group-has-child-loading"),siblings=t.find(" > .fl-col")):siblings=t.find(" > .fl-col-group, > .fl-module"),0===siblings.length||siblings.length==i?t.append(l):siblings.eq(i).before(l)},_removeNodeLoadingPlaceholder:function(e){var t=e.prev(".fl-builder-node-loading-placeholder"),i=e.next(".fl-builder-node-loading-placeholder");t.length?t.remove():i.remove()},_ajaxModSecFix:function(e){var t;if(FLBuilderConfig.modSecFix&&"undefined"!=typeof btoa)if("string"==typeof e)e=FLBuilder._btoa(e);else for(t in e)"string"==typeof e[t]?e[t]=FLBuilder._btoa(e[t]):"object"==typeof e[t]&&(e[t]=FLBuilder._ajaxModSecFix(e[t]));return e},_btoa:function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))},_wpmedia_reset_errors:function(){e(".upload-error").remove(),e(".media-uploader-status").removeClass("errors").hide()},_initLightboxes:function(){FLBuilder._lightbox=new FLLightbox({className:"fl-builder-lightbox fl-builder-settings-lightbox",resizable:!0}),FLBuilder._lightbox.on("resized",FLBuilder._calculateSettingsTabsOverflow),FLBuilder._lightbox.on("close",FLBuilder._lightboxClosed),FLBuilder._lightbox.on("beforeCloseLightbox",FLBuilder._destroyEditorFields),FLBuilder._actionsLightbox=new FLLightbox({className:"fl-builder-actions-lightbox"})},_showLightbox:function(){FLBuilder._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),FLBuilder._initLightboxScrollbars()},_setLightboxContent:function(e){FLBuilder._lightbox.setContent(e)},_initLightboxScrollbars:function(){FLBuilder._initScrollbars(),FLBuilder._lightboxScrollbarTimeout=setTimeout(FLBuilder._initLightboxScrollbars,500)},_lightboxClosed:function(){FLBuilder.triggerHook("settings-lightbox-closed"),FLBuilder._lightbox.empty(),clearTimeout(FLBuilder._lightboxScrollbarTimeout)},_showActionsLightbox:function(e){var t=wp.template("fl-actions-lightbox");FLBuilder.triggerHook("actions-lightbox-settings",e),FLBuilder._actionsLightbox.open(t(e))},alert:function(e){var t=new FLLightbox({className:"fl-builder-alert-lightbox",destroyOnClose:!0}),i=wp.template("fl-alert-lightbox");t.open(i({message:e}))},_alertClose:function(){FLLightbox.closeParent(this)},confirm:function(t){var i={message:"",ok:function(){},cancel:function(){},strings:{ok:FLBuilderStrings.ok,cancel:FLBuilderStrings.cancel}},l=e.extend({},i,"undefined"==typeof t?{}:t);lightbox=new FLLightbox({className:"fl-builder-confirm-lightbox fl-builder-alert-lightbox",destroyOnClose:!0}),template=wp.template("fl-confirm-lightbox"),lightbox.open(template(l)),lightbox._node.find(".fl-builder-confirm-ok").on("click",l.ok),lightbox._node.find(".fl-builder-confirm-cancel").on("click",l.cancel)},triggerHook:function(t,i){e("body").trigger("fl-builder."+t,i)},addHook:function(t,i){e("body").on("fl-builder."+t,i)},removeHook:function(t,i){e("body").off("fl-builder."+t,i)},log:function(e){"undefined"!=typeof window.console&&"undefined"!=typeof window.console.log&&console.log(e)},logError:function(e){var t=null;"undefined"!=typeof e&&("undefined"!=typeof e.stack?t=e.stack:"undefined"!=typeof e.message&&(t=e.message),t&&(FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(t),FLBuilder.log("************************************************************************")))},logGlobalError:function(e,t,i,l,o){FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(FLBuilderStrings.globalErrorMessage.replace("{message}",e).replace("{line}",i).replace("{file}",t)),"undefined"!=typeof o&&"undefined"!=typeof o.stack&&(FLBuilder.log(o.stack),FLBuilder.log("************************************************************************"))}},e(function(){FLBuilder._init()})}(jQuery),function(e){FLBuilderAJAXLayout=function(t,i){this._data=e.extend({},this._defaults,"string"==typeof t?JSON.parse(t):t),this._callback=i,this._post=FLBuilderConfig.postId,this._head=e("head").eq(0),this._body=e("body").eq(0),this._data.css&&(this._loader=e('<img src="'+this._data.css+'" />'),this._oldCss=e('link[href*="/cache/'+this._post+'-layout"]'),this._newCss=e('<link rel="stylesheet" id="fl-builder-layout-'+this._post+'-css" href="'+this._data.css+'" />')),this._data.partial?(this._data.js&&(this._oldJs=e("#fl-builder-partial-refresh-js"),this._newJs=e('<script type="text/javascript" id="fl-builder-partial-refresh-js">'+this._data.js+"</script>")),this._data.nodeId&&(this._data.oldNodeId?(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.oldNodeId+'"]'),this._content=e(".fl-node-"+this._data.oldNodeId)):(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.nodeId+'"]'),this._content=e(".fl-node-"+this._data.nodeId).eq(0)))):(this._oldJs=e('script[src*="/cache/'+this._post+'"]'),this._newJs=e('<script src="'+this._data.js+'"></script>'),this._oldScriptsStyles=e(".fl-builder-layout-scripts-styles"),this._content=e(FLBuilder._contentClass)),this._init()},FLBuilderAJAXLayout.prototype={_defaults:{partial:!1,nodeId:null,nodeType:null,nodeParent:null,nodePosition:null,oldNodeId:null,html:null,scriptsStyles:null,css:null,js:null},_data:null,_callback:function(){},_post:null,_head:null,_body:null,_loader:null,_oldCss:null,_newCss:null,_oldJs:null,_newJs:null,_oldScriptsStyles:null,_content:null,_init:function(){this._body.height(this._body.height()),this._loader?"onload"in document.createElement("link")?(this._newCss.on("load",e.proxy(this._finish,this)),this._addNewCSS()):(this._loader.on("error",e.proxy(this._loadNewCSSFallbackComplete,this)),this._body.append(this._loader)):this._finish()},_loadNewCSSFallbackComplete:function(){this._loader.remove(),this._addNewCSS(),setTimeout(e.proxy(this._finish,this),250)},_addNewCSS:function(){this._oldCss.length>0?this._oldCss.after(this._newCss):this._head.append(this._newCss)},_finish:function(){this._removeOldContentAndAssets(),this._cleanNewHTML(),this._cleanNewAssets(),this._addNewHTML(),this._addNewScriptsStyles(),this._addNewJS(),e(FLBuilder._contentClass).trigger("fl-builder.layout-rendered"),FLBuilder.hideAjaxLoader(),"undefined"!=typeof this._callback&&this._callback(),FLBuilder.triggerHook("didRenderLayoutComplete")},_removeOldContentAndAssets:function(){this._content&&this._content.empty(),this._oldCss&&this._oldCss.remove(),this._oldJs&&this._oldJs.remove(),this._oldScriptsStyles&&this._oldScriptsStyles.remove()},_cleanNewHTML:function(){if(this._data.scriptsStyles){var t=e("<div>"+this._data.html+"</div>"),i="fl-row",l=this._data.scriptsStyles,o="";this._data.partial&&(i="column-group"==this._data.nodeType?"fl-col-group":"column"==this._data.nodeType?"fl-col":"fl-"+this._data.nodeType),t.find("> *, script").each(function(){e(this).hasClass(i)||(o=e(this).remove(),l+=o[0].outerHTML)}),""!==l&&(l=this._data.partial?'<div class="fl-builder-node-scripts-styles" data-node="'+this._data.nodeId+'">'+l+"<div>":'<div class="fl-builder-node-scripts-styles">'+l+"<div>"),this._data.html=t.html(),this._data.scriptsStyles=l}},_addNewHTML:function(){var t;if(this._data.partial?this._data.nodeParent?(t=this._data.nodeParent.hasClass("fl-builder-content")?this._data.nodeParent.find(" > .fl-row"):this._data.nodeParent.hasClass("fl-row-content")?this._data.nodeParent.find(" > .fl-col-group"):this._data.nodeParent.hasClass("fl-col-group")?this._data.nodeParent.find(" > .fl-col"):this._data.nodeParent.find(" > .fl-col-group, > .fl-module"),t=t.filter(":not(.fl-builder-node-clone)"),0===t.length||t.length==this._data.nodePosition?this._data.nodeParent.append(this._data.html):t.eq(this._data.nodePosition).before(this._data.html),this._data.nodeId&&FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+this._data.nodeId))):(this._content.after(this._data.html),this._content.remove()):this._content.append(this._data.html),FLBuilder.preview&&this._data.nodeId&&this._data.nodeId!=FLBuilder.preview.nodeId){var i=e(FLBuilder.preview.classes.node),l=i.closest(".fl-node-"+this._data.nodeId).length;l&&i.html(FLBuilder.preview.elements.node.html())}},_cleanNewAssets:function(){var t=this;this._data.html=this._removeDuplicateAssets(this._data.html),this._data.scriptsStyles&&""!==this._data.scriptsStyles&&(this._data.scriptsStyles=this._removeDuplicateAssets(this._data.scriptsStyles)),this._data.partial?e(".fl-builder-node-scripts-styles").each(function(){t._data.html.indexOf("fl-node-"+e(this).data("node"))>-1&&e(this).remove()}):(e("#fl-builder-partial-refresh-js").remove(),e(".fl-builder-node-scripts-styles").remove())},_removeDuplicateAssets:function(t){var i=e("<div>"+t+"</div>"),l="",o=null,s="",n=null,r=window.location,a=r.protocol+"//"+r.hostname+(r.port?":"+r.port:"");return i.find("script").each(function(){l=e(this).attr("src"),"undefined"!=typeof l&&(l=l.replace(a,""),o=e('script[src*="'+l+'"]'),o.length>0&&e(this).remove())}),i.find("link").each(function(){s=e(this).attr("href"),"undefined"!=typeof s&&(s=s.replace(a,""),n=e('link[href*="'+s+'"]'),n.length>0&&e(this).remove())}),i.html()},_addNewScriptsStyles:function(){this._data.scriptsStyles&&""!==this._data.scriptsStyles&&this._body.append(this._data.scriptsStyles)},_addNewJS:function(){setTimeout(e.proxy(function(){this._newJs&&this._head.append(this._newJs)},this),50)},_complete:function(){FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._resizeLayout(),FLBuilder._initMediaElements(),FLBuilderLayout.init(),FLBuilderResponsiveEditing.refreshPreview(),
6
  this._body.height("auto")}}}(jQuery),function(e){FLBuilderPreview=function(e){this.type=e.type,this._saveState(),e.layout?FLBuilder._renderLayout(e.layout,function(){this._init(),e.callback&&e.callback()}.bind(this)):this._init()},FLBuilderPreview._fontsList={},FLBuilderPreview.getFormattedSelector=function(e,t){for(var i="",l=t.split(","),o=0;o<l.length;o++)l[o].indexOf("{node}")>-1?i=l[o].replace("{node}",e):i+=e+" "+l[o],o!=l.length-1&&(i+=", ");return i},FLBuilderPreview.prototype={type:"",nodeId:null,classes:{},elements:{},state:null,_savedSettings:null,_styleSheet:null,_styleSheetMedium:null,_styleSheetResponsive:null,_timeout:null,_loaderTimeout:null,_lastClassName:null,_xhr:null,_init:function(){switch(this.nodeId=e(".fl-builder-settings").data("node"),this._saveSettings(),this._initElementsAndClasses(),this._createSheets(),this._initResponsivePreviews(),this._initDefaultFieldPreviews(),this.type){case"row":this._initRow();break;case"col":this._initColumn();break;case"module":this._initModule()}},_saveSettings:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings");this._savedSettings=FLBuilder._getSettingsForChangedCheck(this.nodeId,t)},_settingsHaveChanged:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),i=FLBuilder._getSettings(t);return JSON.stringify(this._savedSettings)!=JSON.stringify(i)},_initElementsAndClasses:function(){var t;t="row"==this.type?".fl-row-content-wrap":".fl-"+this.type+"-content",e.extend(this.classes,{settings:".fl-builder-"+this.type+"-settings",settingsHeader:".fl-builder-"+this.type+"-settings .fl-lightbox-header",node:FLBuilder._contentClass+" .fl-node-"+this.nodeId,content:FLBuilder._contentClass+" .fl-node-"+this.nodeId+" > "+t}),e.extend(this.elements,{settings:e(this.classes.settings),settingsHeader:e(this.classes.settingsHeader),node:e(this.classes.node),content:e(this.classes.content)})},_createSheets:function(){this._destroySheets(),this._styleSheet||(this._styleSheet=new FLStyleSheet({id:"fl-builder-preview",className:"fl-builder-preview-style"})),this._styleSheetMedium||(this._styleSheetMedium=new FLStyleSheet({id:"fl-builder-preview-medium",className:"fl-builder-preview-style"})),this._styleSheetResponsive||(this._styleSheetResponsive=new FLStyleSheet({id:"fl-builder-preview-responsive",className:"fl-builder-preview-style"}))},_destroySheets:function(){this._styleSheet&&(this._styleSheet.destroy(),this._styleSheet=null),this._styleSheetMedium&&(this._styleSheetMedium.destroy(),this._styleSheetMedium=null),this._styleSheetResponsive&&(this._styleSheetResponsive.destroy(),this._styleSheetResponsive=null)},updateCSSRule:function(e,t,i){this._styleSheet.updateRule(e,t,i)},delay:function(e,t){this._cancelDelay(),this._timeout=setTimeout(t,e)},_cancelDelay:function(){null!==this._timeout&&clearTimeout(this._timeout)},hexToRgb:function(e){var t=parseInt(e,16),i=t>>16&255,l=t>>8&255,o=255&t;return[i,l,o]},parseFloat:function(e){return isNaN(parseFloat(e))?0:parseFloat(e)},_initResponsivePreviews:function(){FLBuilder.addHook("responsive-editing-switched.preview",e.proxy(this._responsiveEditingSwitched,this))},_destroyResponsivePreviews:function(){FLBuilder.removeHook("responsive-editing-switched.preview")},_responsiveEditingSwitched:function(e,t){"default"==t?(this._styleSheetMedium.disable(),this._styleSheetResponsive.disable()):"medium"==t?(this._styleSheetMedium.enable(),this._styleSheetResponsive.disable()):"responsive"==t&&(this._styleSheetMedium.disable(),this._styleSheetResponsive.enable())},updateResponsiveCSSRule:function(e,t,i){var l=FLBuilderResponsiveEditing._mode,o="default"==l?"":l.charAt(0).toUpperCase()+l.slice(1);this["_styleSheet"+o].updateRule(e,t,i)},_saveState:function(){var t=FLBuilderConfig.postId,i=e('link[href*="/cache/'+t+'"]').attr("href"),l=e('script[src*="/cache/'+t+'"]').attr("src"),o=e(FLBuilder._contentClass).html();this.state={css:i,js:l,html:o}},preview:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),i=t.attr("data-node"),l=FLBuilder._getSettings(t);FLBuilder._showNodeLoading(i),this._cancelPreview(),this._xhr=FLBuilder.ajax({action:"render_layout",node_id:i,node_preview:l},e.proxy(this._renderPreview,this))},delayPreview:function(t){var i="undefined"==typeof t?[]:e(t.target).closest("tr").find("th"),l=e(".fl-builder-widget-settings .fl-builder-settings-title"),o=e(".fl-builder-settings .fl-lightbox-header"),s=FLBuilderLayoutConfig.paths.pluginUrl+"img/ajax-loader-small.svg",n=e('<img class="fl-builder-preview-loader" src="'+s+'" />');this.delay(1e3,e.proxy(this.preview,this)),this._loaderTimeout=setTimeout(function(){e(".fl-builder-preview-loader").remove(),i.length>0?i.append(n):l.length>0?l.append(n):o.length>0&&o.append(n)},1500)},_cancelPreview:function(){this._xhr&&(this._xhr.abort(),this._xhr=null)},_renderPreview:function(t){this._xhr=null,FLBuilder._renderLayout(t,e.proxy(this._renderPreviewComplete,this))},_renderPreviewComplete:function(){this._createSheets(),this._initElementsAndClasses(),null!==this._loaderTimeout&&clearTimeout(this._loaderTimeout),e(".fl-builder-preview-loader").remove(),e(FLBuilder._contentClass).trigger("fl-builder.preview-rendered")},revert:function(){return this._settingsHaveChanged()?void FLBuilder._updateNode(this.nodeId,function(){this.clear()}.bind(this)):void this.clear()},cancel:function(){this._cancelDelay(),this._cancelPreview()},clear:function(){this.cancel(),this._destroySheets(),this._destroyResponsivePreviews()},_initNodeTextColor:function(){e.extend(this.elements,{textColor:e(this.classes.settings+" input[name=text_color]"),linkColor:e(this.classes.settings+" input[name=link_color]"),hoverColor:e(this.classes.settings+" input[name=hover_color]"),headingColor:e(this.classes.settings+" input[name=heading_color]")}),this.elements.textColor.on("change",e.proxy(this._textColorChange,this)),this.elements.linkColor.on("change",e.proxy(this._textColorChange,this)),this.elements.hoverColor.on("change",e.proxy(this._textColorChange,this)),this.elements.headingColor.on("change",e.proxy(this._textColorChange,this))},_textColorChange:function(t){var i=this.elements.textColor.val(),l=this.elements.linkColor.val(),o=this.elements.hoverColor.val(),s=this.elements.headingColor.val();l=""===l?i:l,o=""===o?i:o,s=""===s?i:s,this.delay(100,e.proxy(function(){""===i?this.updateCSSRule(this.classes.node,"color","inherit"):this.updateCSSRule(this.classes.node,"color","#"+i),""===l?this.updateCSSRule(this.classes.node+" a","color","inherit"):this.updateCSSRule(this.classes.node+" a","color","#"+l),""===o?this.updateCSSRule(this.classes.node+" a:hover","color","inherit"):this.updateCSSRule(this.classes.node+" a:hover","color","#"+o),""===s?(this.updateCSSRule(this.classes.node+" h1","color","inherit"),this.updateCSSRule(this.classes.node+" h2","color","inherit"),this.updateCSSRule(this.classes.node+" h3","color","inherit"),this.updateCSSRule(this.classes.node+" h4","color","inherit"),this.updateCSSRule(this.classes.node+" h5","color","inherit"),this.updateCSSRule(this.classes.node+" h6","color","inherit"),this.updateCSSRule(this.classes.node+" h1 a","color","inherit"),this.updateCSSRule(this.classes.node+" h2 a","color","inherit"),this.updateCSSRule(this.classes.node+" h3 a","color","inherit"),this.updateCSSRule(this.classes.node+" h4 a","color","inherit"),this.updateCSSRule(this.classes.node+" h5 a","color","inherit"),this.updateCSSRule(this.classes.node+" h6 a","color","inherit")):(this.updateCSSRule(this.classes.node+" h1","color","#"+s),this.updateCSSRule(this.classes.node+" h2","color","#"+s),this.updateCSSRule(this.classes.node+" h3","color","#"+s),this.updateCSSRule(this.classes.node+" h4","color","#"+s),this.updateCSSRule(this.classes.node+" h5","color","#"+s),this.updateCSSRule(this.classes.node+" h6","color","#"+s),this.updateCSSRule(this.classes.node+" h1 a","color","#"+s),this.updateCSSRule(this.classes.node+" h2 a","color","#"+s),this.updateCSSRule(this.classes.node+" h3 a","color","#"+s),this.updateCSSRule(this.classes.node+" h4 a","color","#"+s),this.updateCSSRule(this.classes.node+" h5 a","color","#"+s),this.updateCSSRule(this.classes.node+" h6 a","color","#"+s))},this))},_initNodeBg:function(){e.extend(this.elements,{bgType:e(this.classes.settings+" select[name=bg_type]"),bgColor:e(this.classes.settings+" input[name=bg_color]"),bgColorPicker:e(this.classes.settings+" .fl-picker-bg_color"),bgOpacity:e(this.classes.settings+" input[name=bg_opacity]"),bgImageSrc:e(this.classes.settings+" select[name=bg_image_src]"),bgRepeat:e(this.classes.settings+" select[name=bg_repeat]"),bgPosition:e(this.classes.settings+" select[name=bg_position]"),bgAttachment:e(this.classes.settings+" select[name=bg_attachment]"),bgSize:e(this.classes.settings+" select[name=bg_size]"),bgVideoSource:e(this.classes.settings+" select[name=bg_video_source]"),bgVideo:e(this.classes.settings+" input[name=bg_video]"),bgVideoServiceUrl:e(this.classes.settings+" input[name=bg_video_service_url]"),bgVideoFallbackSrc:e(this.classes.settings+" select[name=bg_video_fallback_src]"),bgSlideshowSource:e(this.classes.settings+" select[name=ss_source]"),bgSlideshowPhotos:e(this.classes.settings+" input[name=ss_photos]"),bgSlideshowFeedUrl:e(this.classes.settings+" input[name=ss_feed_url]"),bgSlideshowSpeed:e(this.classes.settings+" input[name=ss_speed]"),bgSlideshowTrans:e(this.classes.settings+" select[name=ss_transition]"),bgSlideshowTransSpeed:e(this.classes.settings+" input[name=ss_transitionDuration]"),bgParallaxImageSrc:e(this.classes.settings+" select[name=bg_parallax_image_src]"),bgOverlayColor:e(this.classes.settings+" input[name=bg_overlay_color]"),bgOverlayOpacity:e(this.classes.settings+" input[name=bg_overlay_opacity]")}),this.elements.bgType.on("change",e.proxy(this._bgTypeChange,this)),this.elements.bgColor.on("change",e.proxy(this._bgColorChange,this)),this.elements.bgOpacity.on("keyup",e.proxy(this._bgOpacityChange,this)),this.elements.bgImageSrc.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgRepeat.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgPosition.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgAttachment.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgSize.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgVideoServiceUrl.on("change",e.proxy(this._bgVideoChange,this)),this.elements.bgSlideshowSource.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowPhotos.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowFeedUrl.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTrans.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTransSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgParallaxImageSrc.on("change",e.proxy(this._bgParallaxChange,this)),this.elements.bgOverlayColor.on("change",e.proxy(this._bgOverlayChange,this)),this.elements.bgOverlayOpacity.on("keyup",e.proxy(this._bgOverlayChange,this))},_bgTypeChange:function(e){var t=this.elements.bgType.val();this.elements.node.removeClass("fl-row-bg-video"),this.elements.node.removeClass("fl-row-bg-slideshow"),this.elements.node.removeClass("fl-row-bg-parallax"),this.elements.node.find(".fl-bg-video").remove(),this.elements.node.find(".fl-bg-slideshow").remove(),this.elements.content.css("background-image",""),this.updateCSSRule(this.classes.content,{"background-color":"transparent","background-image":"none"}),"none"==t?this._bgOverlayClear():"color"==t?(this.elements.bgColor.trigger("change"),this._bgOverlayClear()):"photo"==t?(this.elements.bgColor.trigger("change"),this.elements.bgImageSrc.trigger("change")):"video"==t?(this.elements.bgColor.trigger("change"),this._bgVideoChange()):"slideshow"==t?(this.elements.bgColor.trigger("change"),this._bgSlideshowChange()):"parallax"==t&&(this.elements.bgColor.trigger("change"),this.elements.bgParallaxImageSrc.trigger("change"))},_bgColorChange:function(t){var i,l,o;""===this.elements.bgColor.val()||isNaN(this.elements.bgOpacity.val())?this.updateCSSRule(this.classes.content,"background-color","transparent"):(i=this.hexToRgb(this.elements.bgColor.val()),l=this.parseFloat(this.elements.bgOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"background-color",o)},this)))},_bgOpacityChange:function(e){this.elements.bgColor.trigger("change")},_bgPhotoChange:function(e){this.elements.bgImageSrc.val()?this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgImageSrc.val()+")","background-repeat":this.elements.bgRepeat.val(),"background-position":this.elements.bgPosition.val(),"background-attachment":this.elements.bgAttachment.val(),"background-size":this.elements.bgSize.val()}):this.updateCSSRule(this.classes.content,{"background-image":"none"})},_bgVideoChange:function(t){var i=this.elements,l=i.bgVideoSource.val(),o=i.bgVideo.val(),s=i.bgVideoServiceUrl.val(),n="https://www.youtube.com/iframe_api",r="https://player.vimeo.com/api/player.js",a=e("<script>");"video_service"==l&&""!=s?(/^(?:(?:(?:https?:)?\/\/)?(?:www.)?(?:youtu(?:be.com|.be))\/(?:watch\?v\=|v\/|embed\/)?([\w\-]+))/i.test(s)&&e('script[src*="youtube.com"').length<1?a.attr("src",n):/^(http\:\/\/|https\:\/\/)?(www\.)?(vimeo\.com\/)([0-9]+)$/.test(s)&&e('script[src*="vimeo.com"').length<1&&a.attr("src",r),a.attr("type","text/javascript").appendTo("head"),this.delay(500,e.proxy(this.preview,this))):""!=o&&this.preview()},_bgSlideshowChange:function(t){var i=this.elements,l=i.bgSlideshowSource.val(),o=i.bgSlideshowPhotos.val(),s=i.bgSlideshowFeedUrl.val(),n=i.bgSlideshowSpeed.val(),r=i.bgSlideshowTransSpeed.val();"wordpress"==l&&""===o||"smugmug"==l&&""===s||isNaN(parseInt(n))||isNaN(parseInt(r))||this.delay(500,e.proxy(this.preview,this))},_bgParallaxChange:function(e){this.elements.bgParallaxImageSrc.val()&&this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgParallaxImageSrc.val()+")","background-repeat":"no-repeat","background-position":"center center","background-attachment":"fixed","background-size":"cover"})},_bgOverlayChange:function(t){var i,l,o;""===this.elements.bgOverlayColor.val()||isNaN(this.elements.bgOverlayOpacity.val())?(this.elements.node.removeClass("fl-row-bg-overlay"),this.elements.node.removeClass("fl-col-bg-overlay"),this.updateCSSRule(this.classes.content+":after","background-color","transparent")):(i=this.hexToRgb(this.elements.bgOverlayColor.val()),l=this.parseFloat(this.elements.bgOverlayOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.elements.node.hasClass("fl-col")?this.elements.node.addClass("fl-col-bg-overlay"):this.elements.node.addClass("fl-row-bg-overlay"),this.updateCSSRule(this.classes.content+":after","background-color",o)},this)))},_bgOverlayClear:function(e){this.elements.bgOverlayColor.prev(".fl-color-picker-clear").trigger("click")},_initNodeBorder:function(){e.extend(this.elements,{borderType:e(this.classes.settings+" select[name=border_type]"),borderColor:e(this.classes.settings+" input[name=border_color]"),borderColorPicker:e(this.classes.settings+" .fl-picker-border_color"),borderOpacity:e(this.classes.settings+" input[name=border_opacity]")}),this.elements.borderType.on("change",e.proxy(this._borderTypeChange,this)),this.elements.borderColor.on("change",e.proxy(this._borderColorChange,this)),this.elements.borderOpacity.on("keyup",e.proxy(this._borderOpacityChange,this))},_borderTypeChange:function(e){var t=this.elements.borderType.val();this.updateCSSRule(this.classes.content,{"border-style":""===t?"none":t}),this.elements.borderColor.trigger("change"),this.elements.borderTop.trigger("keyup")},_borderColorChange:function(t){var i,l,o;""===this.elements.borderColor.val()||isNaN(this.elements.borderOpacity.val())?this.updateCSSRule(this.classes.content,"border-color","transparent"):(i=this.hexToRgb(this.elements.borderColor.val()),l=parseInt(this.elements.borderOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"border-color",o)},this)))},_borderOpacityChange:function(e){this.elements.borderColor.trigger("change")},_initNodeClassName:function(){e.extend(this.elements,{className:e(this.classes.settings+" input[name=class]")}),this.elements.className.on("keyup",e.proxy(this._classNameChange,this)),this._lastClassName=this.elements.className.val()},_classNameChange:function(e){var t=this.elements.className.val();null!==this._lastClassName&&this.elements.node.removeClass(this._lastClassName),this.elements.node.addClass(t),this._lastClassName=t},_initResponsiveDimensions:function(t){var i={},l=["Top","Bottom","Left","Right"],o=["","Medium","Responsive"],s=this.classes.settings,n="",r="",a=null,d=null;for(a=0;a<l.length;a++)for(d=0;d<o.length;d++)n=t+l[a]+o[d],r=t+"_"+l[a].toLowerCase(),""!=o[d]&&(r+="_"+o[d].toLowerCase()),i[n]=e(s+" input[name="+r+"]"),i[n].on("keyup",e.proxy(this._responsiveDimensionChange,this,t));e.extend(this.elements,i)},_getDimensions:function(e){for(var t=FLBuilderResponsiveEditing._mode,i=["Top","Bottom","Left","Right"],l="default"==t?"":t.charAt(0).toUpperCase()+t.slice(1),o={},s=0;s<i.length;s++)o[i[s].toLowerCase()]=this.elements[e+i[s]+l].val();return this._normalizeDimensionValues(o,e)},_responsiveDimensionChange:function(t){var i=this._getDimensions(t),l={},o="border"==t;e.each(i,function(e,i){l[t+"-"+e+(o?"-width":"")]=i}),this.updateResponsiveCSSRule(this.classes.content,l),this._positionAbsoluteBgs()},_normalizeDimensionValues:function(t,i){var l=this,o=FLBuilderResponsiveEditing._mode,s="default"==o?"":o.charAt(0).toUpperCase()+o.slice(1),i=i.split("-");return"undefined"==typeof i[1]?i[1]="":i[1]=i[1].charAt(0).toUpperCase()+i[1].slice(1),e.map(t,function(e,o){if(e=e.toLowerCase().replace(/[^a-z0-9%.\-]/g,""),""===e){var n=i[0]+o.charAt(0).toUpperCase()+o.slice(1)+i[1]+s,r=l.elements[n].attr("placeholder");r&&(e=r)}null===e||""===e||isNaN(e)||(e=parseFloat(e)+"px"),t[o]=e}),t},_positionAbsoluteBgs:function(){var t=this.elements.node.find(".fl-bg-slideshow"),i=this.elements.node.find(".fl-bg-video"),l=null,o=null,s={top:0,bottom:0,left:0,right:0};(t.length>0||i.length>0)&&(l=this._getDimensions("margin"),o=this._getDimensions("border"),e.map(s,function(e,t){l[t]&&o[t]?s[t]="calc("+l[t]+"+"+o[t]+")":l[t]?s[t]=l[t]:o[t]&&(s[t]=o[t])}),t.length>0&&(this.updateCSSRule(this.classes.node+" .fl-bg-slideshow",s),FLBuilder._resizeLayout()),i.length>0&&this.updateCSSRule(this.classes.node+" .fl-bg-video",s))},_initRow:function(){e.extend(this.elements,{width:e(this.classes.settings+" select[name=width]"),contentWidth:e(this.classes.settings+" select[name=content_width]"),maxContentWidth:e(this.classes.settings+" input[name=max_content_width]"),height:e(this.classes.settings+" select[name=full_height]"),align:e(this.classes.settings+" select[name=content_alignment]")}),this.elements.width.on("change",e.proxy(this._rowWidthChange,this)),this.elements.contentWidth.on("change",e.proxy(this._rowContentWidthChange,this)),this.elements.maxContentWidth.on("keyup",e.proxy(this._rowMaxContentWidthChange,this)),this.elements.height.on("change",e.proxy(this._rowHeightChange,this)),this.elements.align.on("change",e.proxy(this._rowHeightChange,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_rowWidthChange:function(e){var t=this.elements.node,i=this.elements.maxContentWidth.val();"full"==this.elements.width.val()?(t.css("max-width","none"),t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"),""!==i?t.css("max-width",i+"px"):t.css("max-width",FLBuilderConfig.global.row_width+"px"))},_rowHeightChange:function(e){var t=this.elements.node;t.removeClass("fl-row-align-top"),t.removeClass("fl-row-align-center"),t.removeClass("fl-row-align-bottom"),"full"==this.elements.height.val()?(t.addClass("fl-row-full-height"),t.addClass("fl-row-align-"+this.elements.align.val())):t.removeClass("fl-row-full-height")},_rowContentWidthChange:function(e){var t=this.elements.content.find(".fl-row-content"),i=this.elements.maxContentWidth.val();"full"==this.elements.contentWidth.val()?(t.css("max-width","none"),t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"),""!==i?t.css("max-width",i+"px"):t.css("max-width",FLBuilderConfig.global.row_width+"px"))},_rowMaxContentWidthChange:function(e){var t=this.elements.node,i=this.elements.content.find(".fl-row-content"),l=this.elements.maxContentWidth.val();""==l?l=FLBuilderConfig.global.row_width+"px":l+="px","fixed"==this.elements.width.val()&&t.css("max-width",l),"fixed"==this.elements.contentWidth.val()&&i.css("max-width",l)},_initColumn:function(){e.extend(this.elements,{size:e(this.classes.settings+" input[name=size]"),columnHeight:e(this.classes.settings+" select[name=equal_height]"),columnAlign:e(this.classes.settings+" select[name=content_alignment]"),responsiveOrder:e(this.classes.settings+" select[name=responsive_order]")}),this.elements.size.on("keyup",e.proxy(this._colSizeChange,this)),this.elements.columnHeight.on("change",e.proxy(this._colHeightChange,this)),this.elements.columnAlign.on("change",e.proxy(this._colHeightChange,this)),this.elements.responsiveOrder.on("change",e.proxy(this._colResponsiveOrder,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_colSizeChange:function(){var t=8,i=100-t,l=parseFloat(this.elements.size.val()),o=this.elements.node.prev(".fl-col"),s=this.elements.node.next(".fl-col"),n=0===s.length?o:s,r=this.elements.node.siblings(".fl-col"),a=0;0===r.length||isNaN(l)||(r.each(function(){e(this).data("node")!=n.data("node")&&(i-=parseFloat(e(this)[0].style.width),a+=parseFloat(e(this)[0].style.width))}),l<t&&(l=t),l>i&&(l=i),n.css("width",100-a-l+"%"),this.elements.node.css("width",l+"%"))},_colHeightChange:function(){var e=this.elements.node.parent(".fl-col-group");e.removeClass("fl-col-group-align-top"),e.removeClass("fl-col-group-align-center"),e.removeClass("fl-col-group-align-bottom"),"yes"==this.elements.columnHeight.val()?(e.addClass("fl-col-group-equal-height"),e.addClass("fl-col-group-align-"+this.elements.columnAlign.val())):e.removeClass("fl-col-group-equal-height")},_colResponsiveOrder:function(){var e=this.elements.node.parent(".fl-col-group");"reversed"==this.elements.responsiveOrder.val()?e.addClass("fl-col-group-responsive-reversed"):e.removeClass("fl-col-group-responsive-reversed")},_initModule:function(){this._initNodeClassName(),this._initResponsiveDimensions("margin")},_initDefaultFieldPreviews:function(e){for(var e=_.isUndefined(e)?this.elements.settings.find(".fl-field"):e,t=null,i=null,l=0;l<e.length;l++)t=e.eq(l),i=t.data("preview"),"refresh"==i.type&&this._initFieldRefreshPreview(t),"text"==i.type&&this._initFieldTextPreview(t),"css"==i.type&&this._initFieldCSSPreview(t),"widget"==i.type&&this._initFieldWidgetPreview(t),"font"==i.type&&this._initFieldFontPreview(t)},_initFieldRefreshPreview:function(t){var i=t.data("type"),l=t.data("preview"),o=e.proxy(this.delayPreview,this);switch(i){case"text":t.find("input[type=text]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"select":t.find("select").on("change",o);break;case"color":t.find(".fl-color-picker-value").on("change",o);break;case"photo":t.find("select").on("change",o);break;case"multiple-photos":t.find("input").on("change",o);break;case"photo-sizes":t.find("select").on("change",o);break;case"video":t.find("input").on("change",o);break;case"multiple-audios":t.find("input").on("change",o);break;case"icon":t.find("input").on("change",o);break;case"form":t.delegate("input","change",o);break;case"editor":this._addTextEditorCallback(t,l);break;case"code":t.find("textarea").on("change",o);break;case"post-type":t.find("select").on("change",o);break;case"suggest":t.find(".as-values").on("change",o),t.find("select").on("change",o);break;case"unit":case"dimension":t.find("input[type=number]").on("keyup",o);break;case"ordering":t.find("input[type=hidden]").on("change",o);break;default:t.on("change",o)}},_initFieldTextPreview:function(t){var i=t.data("type"),l=t.data("preview"),o=e.proxy(this._previewText,this,l);switch(i){case"text":t.find("input[type=text]").on("keyup",o);break;case"unit":t.find("input[type=number]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"code":t.find("textarea").on("change",o);break;case"editor":this._addTextEditorCallback(t,l)}},_previewText:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=e(l),s=e("<div>"+e(i.target).val()+"</div>");o.length>0?(s.find("script").remove(),o.html(s.html())):this.delayPreview(i)},_previewTextEditor:function(t,i,l){var o=this._getPreviewSelector(this.classes.node,t.selector),s=e(o),n="undefined"!=typeof tinyMCE?tinyMCE.get(i):null,r=e("#"+i),a="";s.length>0&&(a=e(n&&"none"==r.css("display")?"<div>"+n.getContent()+"</div>":"undefined"==typeof switchEditors||"undefined"==typeof switchEditors.wpautop?"<div>"+r.val()+"</div>":"<div>"+switchEditors.wpautop(r.val())+"</div>"),a.find("script").remove(),s.html(a.html()))},_addTextEditorCallback:function(t,i){var l=t.find("textarea.wp-editor-area").attr("id"),o=null;if("refresh"==i.type)o=e.proxy(this.delayPreview,this);else{if("text"!=i.type)return;o=e.proxy(this._previewTextEditor,this,i,l)}e("#"+l).on("keyup",o),"undefined"!=typeof tinyMCE&&(editor=tinyMCE.get(l),editor.on("change",o),editor.on("keyup",o))},_initFieldFontPreview:function(t){var i=t.data("type"),l=t.data("preview");l.id=t.attr("id");var o=e.proxy(this._previewFont,this,l);"font"==i&&t.find(".fl-font-field").on("change","select",o)},_previewFont:function(t,i){var l=e(i.delegateTarget),o=l.find(".fl-font-field-font"),s=e(o).find(":selected"),n=s.parent().attr("label"),r=l.find(".fl-font-field-weight"),a=t.id+"-"+this.nodeId,d=this._getPreviewSelector(this.classes.node,t.selector);"Google"==n&&this._buildFontStylesheet(a,o.val(),r.val()),"Default"==o.val()?(this.updateCSSRule(d,"font-family",""),this.updateCSSRule(d,"font-weight","")):(this.updateCSSRule(d,"font-family",o.val()),this.updateCSSRule(d,"font-weight",r.val()))},_buildFontStylesheet:function(t,i,l){var o=FLBuilderConfig.googleFontsUrl,s="",n={},r={};n[i]=[l],FLBuilderPreview._fontsList[t]=n,Object.keys(FLBuilderPreview._fontsList).forEach(function(e){var t=FLBuilderPreview._fontsList[e];Object.keys(t).forEach(function(e){var i=t[e];r[e]=r[e]||[],i=i.filter(function(t){return r[e].indexOf(t)<0}),r[e]=r[e].concat(i)})}),e.each(r,function(e,t){s+=e+":"+t.join()+"|"}),s=o+s.slice(0,-1).replace(" ","+"),e("#fl-builder-google-fonts-preview").length<1?e("<link>").attr("id","fl-builder-google-fonts-preview").attr("type","text/css").attr("rel","stylesheet").attr("href",s).appendTo("head"):e("#fl-builder-google-fonts-preview").attr("href",s)},_initFieldCSSPreview:function(e){var t=e.data("preview"),i=null;if("undefined"!=typeof t.rules)for(i in t.rules)this._initFieldCSSPreviewCallback(e,t.rules[i]);else this._initFieldCSSPreviewCallback(e,t)},_initFieldCSSPreviewCallback:function(t,i){switch(t.data("type")){case"text":t.find("input[type=text]").on("keyup",e.proxy(this._previewCSS,this,i));break;case"unit":t.find("input[type=number]").on("keyup",e.proxy(this._previewCSS,this,i));break;case"dimension":t.find("input[type=number]").on("keyup",e.proxy(this._previewDimensionCSS,this,i));break;case"select":t.find("select").on("change",e.proxy(this._previewCSS,this,i));break;case"color":t.find(".fl-color-picker-value").on("change",e.proxy(this._previewColor,this,i))}},_previewCSS:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=t.property,s="undefined"==typeof t.unit?"":t.unit,n=e(i.target),r=n.val();"%"===s&&"opacity"===o?r=parseInt(r)/100:""!==r&&(r+=s),n.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(l,o,r):this.updateCSSRule(l,o,r)},_previewDimensionCSS:function(t,i){var l=e.extend({},t),o=l.property,s=e(i.target).data("unit");"border-width"===o?l.property="border-"+s+"-width":l.property=o+"-"+s,this._previewCSS(l,i)},_previewColor:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=e(i.target),s=o.val(),n=""===s?"inherit":"#"+s;/^rgb/.test(s.replace(/\s+/g,""))&&(n=s),o.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(l,t.property,n):this.updateCSSRule(l,t.property,n)},_initFieldWidgetPreview:function(t){var i=e.proxy(this.delayPreview,this);t.find("input").on("keyup",i),t.find("input[type=checkbox]").on("click",i),t.find("textarea").on("keyup",i),t.find("select").on("change",i)},_getPreviewSelector:function(e,t){return FLBuilderPreview.getFormattedSelector(e,t)}}}(jQuery),function(e){var t={ignored:[],reparsed:[],width:null,callback:null,sheets:{},styles:[],queue:[],emPxValue:null,regex:{media:/@media[^{]*{([\s\S]+?})\s*}/gi,empty:/@media[^{]*{([^{}]*?)}/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^\/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)\}$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},ignore:function(e){Array.prototype.push.apply(this.ignored,e)},reparse:function(e){Array.prototype.push.apply(this.reparsed,e)},update:function(e,t){this.width=void 0===e?null:e,this.callback=void 0===t?null:t,i.update(),this.queueSheets()?this.runQueue():this.applyStyles()},queueSheets:function(){for(var t=e("link, style"),i=null,l=null,o=null,s=null,n=null,r=null,a=null,d=!1,u=0,c=0;u<t.length;u++)if(element=t[u],i=element.href,l=element.id,o=element.tagName.toLowerCase(),s=element.rel,n=element.media,r=i?i:l?l:"style-"+u,a=!0,d=!1,"style"===o||i&&s&&"stylesheet"===s.toLowerCase()){for(c=0;c<this.ignored.length;c++)if(r.indexOf(this.ignored[c])>-1){d=!0;break}if(d)continue;for(c=0;c<this.reparsed.length;c++)if(r.indexOf(this.reparsed[c])>-1){this.sheets[r]=null;break}void 0!==this.sheets[r]&&this.sheets[r]||this.queue.push({element:t.eq(u),key:r,tagName:o,href:i,id:l,media:n})}return this.queue.length},runQueue:function(){var t;this.queue.length?(t=this.queue.shift(),"style"===t.tagName?(this.parse(t.element.html(),t),this.runQueue()):e.get(t.href,e.proxy(function(e){this.parse(e,t),this.runQueue()},this))):this.applyStyles()},parse:function(e,t){var i=this.regex,l=this.cleanStyles(e),o=l.match(i.media),s=o&&o.length||0,n=!s&&t.media,r=null,a=null,d=null,u="",c=0,h=0;for(o?u=l.replace(i.media,""):n&&"all"!=t.media?s=1:u=l,this.sheets[t.key]={element:t.element,key:t.key,tagName:t.tagName,href:t.href,id:t.id,all:u,queries:[]},c=0;c<s;c++)for(n?(r=t.media,l=this.convertURLs(l,t.href)):(r=o[c].match(i.findStyles)&&RegExp.$1,l=RegExp.$2&&this.convertURLs(RegExp.$2,t.href)),a=r.split(","),h=0;h<a.length;h++)r=a[h],d=r.split("(")[0].match(i.only)&&RegExp.$2,"print"!=d&&(r.replace(i.minmaxwh,"").match(i.other)||this.sheets[t.key].queries.push({minw:r.match(i.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:r.match(i.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),styles:l}))},applyStyles:function(){var t=e("head"),i=null,l=null,o=null,s=null,n=null,r=null,a=null,d=null,u=!1;this.clearStyles();
7
  for(s in this.sheets)if(i="",l=e("<style></style>"),o=this.sheets[s],o.queries.length&&this.width){for(i+=o.all,r=0;r<o.queries.length;r++)n=o.queries[r],a=n.minw,d=n.maxw,u=!1,a&&(a=parseFloat(a)*(a.indexOf("em")>-1?this.getEmPxValue():1),this.width>=a&&(i+=n.styles,u=!0)),d&&!u&&(d=parseFloat(d)*(d.indexOf("em")>-1?this.getEmPxValue():1),this.width<=d&&(i+=n.styles));this.styles.push(l),t.append(l),l.html(i),o.element.remove(),this.callback&&(this.callback(),this.callback=null)}},clearStyles:function(){var t=e("head"),i=null,l=this.styles.slice(0);this.styles=[];for(i in this.sheets)this.sheets[i].element.parent().length||t.append(this.sheets[i].element);setTimeout(function(){for(var e=0;e<l.length;e++)l[e].empty(),l[e].remove()},50)},cleanStyles:function(e){var t=this.regex;return e.replace(t.comments,"").replace(t.keyframes,"").replace(t.empty,"")},convertURLs:function(e,t){return t?(t=t.substring(0,t.lastIndexOf("/")),t.length&&(t+="/"),e.replace(this.regex.urls,"$1"+t+"$2$3")):e},getEmPxValue:function(){if(this.emPxValue)return this.emPxValue;var e=null,t=window.document,i=t.documentElement,l=t.body,o=t.createElement("div"),s=i.style.fontSize,n=l&&l.style.fontSize,r=!1;return o.style.cssText="position:absolute;font-size:1em;width:1em",l||(l=r=t.createElement("body"),l.style.background="none"),i.style.fontSize="100%",l.style.fontSize="100%",l.appendChild(o),r&&i.insertBefore(l,i.firstChild),e=parseFloat(o.offsetWidth),r?i.removeChild(l):l.removeChild(o),i.style.fontSize=s,n?l.style.fontSize=n:l.style.fontSize="",this.emPxValue=e,e}},i={_functions:null,update:function(){var e;if(!this._functions){this._functions={};for(e in l)this._functions[e]=jQuery.fn[e]}if(t.width)for(e in l)jQuery.fn[e]=l[e];else for(e in this._functions)jQuery.fn[e]=this._functions[e]}},l={width:function(l){return void 0!=l?i._functions.width.call(this,l):e.isWindow(this[0])?t.width:i._functions.width.call(this)}};FLBuilderSimulateMediaQuery={ignore:function(e){t.ignore(e)},reparse:function(e){t.reparse(e)},update:function(e,i){t.update(e,i)}}}(jQuery),function(e){FLBuilderResponsiveEditing={_mode:"default",refreshPreview:function(){var t;e(".fl-responsive-preview").length&&"default"!=this._mode&&("responsive"==this._mode?(t=FLBuilderConfig.global.responsive_breakpoint>=320?320:FLBuilderConfig.global.responsive_breakpoint,FLBuilderSimulateMediaQuery.update(t)):"medium"==this._mode&&(t=FLBuilderConfig.global.medium_breakpoint>=769?769:FLBuilderConfig.global.medium_breakpoint,FLBuilderSimulateMediaQuery.update(t)),FLBuilder._resizeLayout())},_init:function(){this._bind(),this._initMediaQueries()},_bind:function(){FLBuilder.addHook("settings-form-init",this._initSettingsForms),FLBuilder.addHook("settings-lightbox-closed",this._clearPreview),e("body").delegate(".fl-field-responsive-toggle","click",this._settingToggleClicked)},_initMediaQueries:function(){FLBuilderSimulateMediaQuery.ignore([FLBuilderConfig.pluginUrl,"fl-theme-builder","/wp-includes/","/wp-admin/","admin-bar-inline-css","ace-tm","ace_editor.css"]),FLBuilderSimulateMediaQuery.reparse([FLBuilderConfig.postId+"-layout-draft.css?",FLBuilderConfig.postId+"-layout-draft-partial.css?",FLBuilderConfig.postId+"-layout-preview.css?",FLBuilderConfig.postId+"-layout-preview-partial.css?","fl-builder-global-css","fl-builder-layout-css"])},_switchTo:function(t,i){var l=e("html"),o=e("body"),s=e(FLBuilder._contentClass),n=e(".fl-responsive-preview"),r=e(".fl-responsive-preview-mask"),a=e(".fl-content-placeholder"),d=null;if(FLBuilderResponsiveEditing._mode=t,"default"==t){if(0===a.length)return;l.removeClass("fl-responsive-preview-enabled"),a.after(s),a.remove(),n.remove(),r.remove()}else 0===n.length?(l.addClass("fl-responsive-preview-enabled"),s.after('<div class="fl-content-placeholder"></div>'),o.prepend(wp.template("fl-responsive-preview")()),e(".fl-responsive-preview").addClass("fl-preview-"+t),e(".fl-responsive-preview-content").append(s)):(n.removeClass("fl-preview-responsive fl-preview-medium"),n.addClass("fl-preview-"+t));"responsive"==t?(d=FLBuilderConfig.global.responsive_breakpoint>=360?360:FLBuilderConfig.global.responsive_breakpoint,s.width(d),FLBuilderSimulateMediaQuery.update(d,i)):"medium"==t?(d=FLBuilderConfig.global.medium_breakpoint>=769?769:FLBuilderConfig.global.medium_breakpoint,s.width(d),FLBuilderSimulateMediaQuery.update(d,i)):(s.width(""),FLBuilderSimulateMediaQuery.update(null,i)),this._setContentBackgroundColor(),FLBuilder._resizeLayout(),FLBuilder.triggerHook("responsive-editing-switched",t)},_setContentBackgroundColor:function(){var t=e(FLBuilder._contentClass),i=e(".fl-responsive-preview"),l=e(".fl-content-placeholder"),o=l.parents(),s="#fff",n=0;if(0===i.length)t.css("background-color","");else{for(;n<o.length&&(s=o.eq(n).css("background-color"),"rgba(0, 0, 0, 0)"==s);n++);t.css("background-color",s)}},_switchToAndScroll:function(t){var i=e(".fl-builder-settings").data("node"),l=void 0===i?void 0:e(".fl-node-"+i);FLBuilderResponsiveEditing._switchTo(t,function(){void 0!==l&&l&&setTimeout(function(){var t=e(window),i=e(".fl-responsive-preview-content");!i.length||t.height()<i.height()?e("html, body").animate({scrollTop:l.offset().top-100},250):scrollTo(0,0)},250)})},_clearPreview:function(){FLBuilderResponsiveEditing._switchToAndScroll("default")},_settingToggleClicked:function(){var t=e(this),i=t.data("mode");i="default"==i?"medium":"medium"==i?"responsive":"default",FLBuilderResponsiveEditing._switchAllSettingsTo(i),t.siblings(".fl-field-responsive-setting:visible").find("input").focus()},_switchAllSettingsTo:function(t){var i="dashicons-desktop dashicons-tablet dashicons-smartphone";e(".fl-field-responsive-toggle").removeClass(i),e(".fl-field-responsive-setting").hide(),i="default"==t?"dashicons-desktop":"medium"==t?"dashicons-tablet":"dashicons-smartphone",e(".fl-field-responsive-toggle").addClass(i).data("mode",t),e(".fl-field-responsive-setting-"+t).css("display","inline-block"),FLBuilderResponsiveEditing._switchToAndScroll(t)},_initSettingsForms:function(){var e=FLBuilderResponsiveEditing;Number(FLBuilderConfig.global.responsive_enabled)&&(e._initFields("dimension","input","keyup",e._spacingFieldKeyup,["margin","padding"]),e._initFields("dimension","input","keyup",e._textFieldKeyup),e._initFields("unit","input","keyup",e._textFieldKeyup)),e._switchAllSettingsTo(e._mode)},_initFields:function(t,i,l,o,s){for(var n=e(".fl-builder-settings"),r=n.find(".fl-field").has(".fl-field-responsive-setting"),a=null,d=null,u=0;u<r.length;u++)a=r.eq(u),d=a.attr("id").replace("fl-field-",""),"object"==typeof s&&e.inArray(d,s)<0||t==a.attr("data-type")&&void 0===a.attr("data-responsive-init")&&(a.find(".fl-field-responsive-setting-default "+i).on(l,o),a.find(".fl-field-responsive-setting-medium "+i).on(l,o),a.find(".fl-field-responsive-setting-responsive "+i).on(l,o),a.find(".fl-field-responsive-setting-default "+i).trigger(l),a.attr("data-responsive-init",1))},_getFields:function(t,i){var l=e(t).closest(".fl-field");return{"default":l.find(".fl-field-responsive-setting-default "+i),medium:l.find(".fl-field-responsive-setting-medium "+i),responsive:l.find(".fl-field-responsive-setting-responsive "+i)}},_textFieldKeyup:function(){var e=FLBuilderResponsiveEditing._getFields(this,"input");e["default"].each(function(t){var i=e["default"].eq(t).attr("placeholder"),l=e["default"].eq(t).val(),o=e.medium.eq(t).val();""==l?e.medium.eq(t).attr("placeholder",void 0===i?"":i):e.medium.eq(t).attr("placeholder",l),""==o?e.responsive.eq(t).attr("placeholder",e.medium.eq(t).attr("placeholder")):e.responsive.eq(t).attr("placeholder",o)})},_spacingFieldKeyup:function(){var t=e(".fl-builder-settings"),i="row",l=e(this).closest(".fl-field").attr("id").replace("fl-field-",""),o=FLBuilderResponsiveEditing._getFields(this,"input"),s=FLBuilderConfig.global,n=null,r=null,a=null,d=null;t.hasClass("fl-builder-row-settings")?i="row":t.hasClass("fl-builder-col-settings")?i="col":t.hasClass("fl-builder-module-settings")&&(i="module"),e.extend(s,{col_margins:0,col_margins_medium:"",col_margins_responsive:"",col_padding:0,col_padding_medium:"",col_padding_responsive:""}),n=i+"_"+l+("margin"===l?"s":""),r=s[n],a=s[n+"_medium"],d=s[n+"_responsive"],o["default"].each(function(e){var t=o["default"].eq(e).attr("name").split("_").pop(),n=o["default"].eq(e).val(),u=o.medium.eq(e).val(),c=(o.responsive.eq(e).val(),null),h=null;""===a&&(""!==n?o.medium.eq(e).attr("placeholder",n):""!==r&&o.medium.eq(e).attr("placeholder",r)),""===d&&("module"===i&&Number(s.auto_spacing)?(c=""===a?Number(r):a,h=""===u?Number(n):u,""!==h&&(h>c||h<0)?o.responsive.eq(e).attr("placeholder",c):""!==h?o.responsive.eq(e).attr("placeholder",h):o.responsive.eq(e).attr("placeholder",c)):(!Number(s.auto_spacing)||"padding"===l&&"top|bottom".indexOf(t)>-1)&&(""!==u?o.responsive.eq(e).attr("placeholder",u):""!==a?o.responsive.eq(e).attr("placeholder",a):""!==n?o.responsive.eq(e).attr("placeholder",n):""!==r&&o.responsive.eq(e).attr("placeholder",r)))})}},e(function(){FLBuilderResponsiveEditing._init()})}(jQuery),function(e){FLBuilderResponsivePreview={enter:function(){this.render()},exit:function(){this.destroy()},switchTo:function(t){var i=FLBuilderConfig.global,l=e("#fl-builder-preview-frame"),o="100%";"responsive"==t?(o=i.responsive_breakpoint>=360?360:i.responsive_breakpoint,l.width(o)):"medium"==t&&(o=i.medium_breakpoint>=769?769:i.medium_breakpoint,l.width(o)),l.width(o)},render:function(){var t=e("body"),i=FLBuilderConfig.previewUrl,l=e("#fl-builder-preview-mask, #fl-builder-preview-frame"),o=e('<div id="fl-builder-preview-mask"></div>'),s=e('<iframe id="fl-builder-preview-frame" src="'+i+'" frameborder="0"></iframe>');l.remove(),t.append(o),t.append(s)},destroy:function(){e("#fl-builder-preview-mask, #fl-builder-preview-frame").remove()}}}(jQuery),function(e){var t={init:function(){var t=e("body");t.delegate(".fl-builder-service-select","change",this._serviceChange),t.delegate(".fl-builder-service-connect-button","click",this._connectClicked),t.delegate(".fl-builder-service-account-select","change",this._accountChange),t.delegate(".fl-builder-service-account-delete","click",this._accountDeleteClicked),t.delegate(".fl-builder-campaign-monitor-client-select","change",this._campaignMonitorClientChange),t.delegate(".fl-builder-mailchimp-list-select","change",this._mailChimpListChange),t.delegate(".fl-builder-activecampaign-list_type-select","change",this._activeCampaignChange)},_startSettingsLoading:function(t){var i=e(".fl-builder-settings"),l=t.closest(".fl-builder-service-settings"),o=e(".fl-builder-service-error");i.append('<div class="fl-builder-loading"></div>'),l.addClass("fl-builder-service-settings-loading"),o.remove()},_finishSettingsLoading:function(){var t=e(".fl-builder-settings"),i=e(".fl-builder-service-settings-loading");t.find(".fl-builder-loading").remove(),i.removeClass("fl-builder-service-settings-loading")},_serviceChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this),o=l.closest("tr"),s=l.val();o.siblings("tr.fl-builder-service-account-row").remove(),o.siblings("tr.fl-builder-service-connect-row").remove(),o.siblings("tr.fl-builder-service-field-row").remove(),e(".fl-builder-service-error").remove(),""!==s&&(t._startSettingsLoading(l),FLBuilder.ajax({action:"render_service_settings",node_id:i,service:s},t._serviceChangeComplete))},_serviceChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row");s.after(l.html),t._addAccountDelete(o),t._finishSettingsLoading()},_connectClicked:function(){for(var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-connect-row"),n=l.find(".fl-builder-service-connect-input"),r=null,a=null,d=0,u={action:"connect_service",node_id:i,service:o.val(),fields:{}};d<n.length;d++)r=n.eq(d),a=r.attr("name"),u.fields[a]=r.val();s.hide(),t._startSettingsLoading(o),FLBuilder.ajax(u,t._connectComplete)},_connectComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row"),n=o.find(".fl-builder-service-select"),r=o.find(".fl-builder-service-account-row"),a=o.find(".fl-builder-service-account-select"),d=o.find(".fl-builder-service-connect-row");l.error?(d.show(),0===a.length?n.after('<div class="fl-builder-service-error">'+l.error+"</div>"):a.after('<div class="fl-builder-service-error">'+l.error+"</div>")):(d.remove(),r.remove(),s.after(l.html)),t._addAccountDelete(o),t._finishSettingsLoading()},_accountChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-connect-row"),r=l.find("tr.fl-builder-service-field-row"),a=e(".fl-builder-service-error"),d=s.val(),u=null;n.remove(),r.remove(),a.remove(),"add_new_account"==d?u={action:"render_service_settings",node_id:i,service:o.val(),add_new:!0}:""!==d&&(u={action:"render_service_fields",node_id:i,service:o.val(),account:d}),u&&(t._startSettingsLoading(o),FLBuilder.ajax(u,t._accountChangeComplete)),t._addAccountDelete(l)},_accountChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-account-row");s.after(l.html),t._finishSettingsLoading()},_addAccountDelete:function(e){var t=e.find(".fl-builder-service-account-select");t.length>0&&(e.find(".fl-builder-service-account-delete").remove(),""!==t.val()&&"add_new_account"!=t.val()&&t.after('<a href="javascript:void(0);" class="fl-builder-service-account-delete">'+FLBuilderStrings.deleteAccount+"</a>"))},_accountDeleteClicked:function(){var i=e(this).closest(".fl-builder-service-settings"),l=i.find(".fl-builder-service-select"),o=i.find(".fl-builder-service-account-select");confirm(FLBuilderStrings.deleteAccountWarning)&&(FLBuilder.ajax({action:"delete_service_account",service:l.val(),account:o.val()},t._accountDeleteComplete),t._startSettingsLoading(o))},_accountDeleteComplete:function(){var i=e(".fl-builder-service-settings-loading"),l=i.find(".fl-builder-service-select");t._finishSettingsLoading(),l.trigger("change")},_campaignMonitorClientChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=e(this),r=l.find(".fl-builder-service-list-select"),a=n.val();0!==r.length&&r.closest("tr").remove(),""!==a&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),client:a},t._campaignMonitorClientChangeComplete))},_campaignMonitorClientChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-campaign-monitor-client-select");s.closest("tr").after(l.html),t._finishSettingsLoading()},_mailChimpListChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-list-select");e(".fl-builder-mailchimp-group-select").closest("tr").remove(),""!==n.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),list_id:n.val()},t._mailChimpListChangeComplete))},_mailChimpListChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-list-select");s.closest("tr").after(l.html),t._finishSettingsLoading()},_activeCampaignChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-list-select");list_type=l.find('select[name="list_type"]'),0!==n.length&&n.closest("tr").remove(),""!==list_type.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),list_type:list_type.val()},t._activeCampaignTypeChangeComplete))},_activeCampaignTypeChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-field-row");s.after(l.html),t._finishSettingsLoading()}};e(function(){t.init()})}(jQuery),function(e){FLBuilderTour={_tour:null,start:function(){FLBuilderTour._tour?FLBuilderTour._tour.restart():(FLBuilderTour._tour=new Tour(FLBuilderTour._config()),FLBuilderTour._tour.init()),FLBuilder._triggerSettingsSave(!1,!0)&&FLBuilderTour._tour.start()},_config:function(){var t={storage:!1,onStart:FLBuilderTour._onStart,onPrev:FLBuilderTour._onPrev,onNext:FLBuilderTour._onNext,onEnd:FLBuilderTour._onEnd,template:'<div class="popover" role="tooltip"> <i class="fas fa-times" data-role="end"></i> <div class="arrow"></div> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="next">'+FLBuilderStrings.tourNext+"</button> </div> </div>",steps:[{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourTemplatesTitle,content:FLBuilderStrings.tourTemplates,onShow:function(){FLBuilder.ContentPanel.show("templates")}},{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourAddRowsTitle,content:FLBuilderStrings.tourAddRows,onShow:function(){FLBuilder.ContentPanel.show("rows")}},{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourAddContentTitle,content:FLBuilderStrings.tourAddContent,onShow:function(){FLBuilder.ContentPanel.show("modules")}},{animation:!1,element:".fl-row:first-of-type",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-row:first-of-type .fl-module-overlay .fl-block-overlay-actions",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent2,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-builder-content-panel-button",placement:"bottom",title:FLBuilderStrings.tourAddContentButtonTitle,content:FLBuilderStrings.tourAddContentButton,onShow:function(){FLBuilderTour._dimSection("body"),e(".fl-row").eq(0).trigger("mouseleave"),e(".fl-module").eq(0).trigger("mouseleave")}},{animation:!1,element:".fl-builder-templates-button",placement:"bottom",title:FLBuilderStrings.tourTemplatesButtonTitle,content:FLBuilderStrings.tourTemplatesButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-tools-button",placement:"bottom",title:FLBuilderStrings.tourToolsButtonTitle,content:FLBuilderStrings.tourToolsButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-done-button",placement:"bottom",title:FLBuilderStrings.tourDoneButtonTitle,content:FLBuilderStrings.tourDoneButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,orphan:!0,backdrop:!0,title:FLBuilderStrings.tourFinishedTitle,content:FLBuilderStrings.tourFinished,template:'<div class="popover" role="tooltip"> <div class="arrow"></div> <i class="fas fa-times" data-role="end"></i> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="end">'+FLBuilderStrings.tourEnd+"</button> </div> </div>"}]};return FLBuilderConfig.lite?t.steps.shift():"disabled"==FLBuilderConfig.enabledTemplates?t.steps.shift():"fl-builder-template"==FLBuilderConfig.postType&&t.steps.shift(),t},_onStart:function(){var t=e("body");t.scrollTop(0),t.append('<div class="fl-builder-tour-mask"></div>'),0===e(".fl-row").length&&"module"!=FLBuilderConfig.userTemplateType&&(e(".fl-builder-content").append('<div class="fl-builder-tour-demo-content fl-row fl-row-fixed-width fl-row-bg-none"> <div class="fl-row-content-wrap"> <div class="fl-row-content fl-row-fixed-width fl-node-content"> <div class="fl-col-group"> <div class="fl-col" style="width:100%"> <div class="fl-col-content fl-node-content"> <div class="fl-module fl-module-rich-text" data-type="rich-text" data-name="Text Editor"> <div class="fl-module-content fl-node-content"> <div class="fl-rich-text"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus pellentesque ut lorem non cursus. Sed mauris nunc, porttitor iaculis lorem a, sollicitudin lacinia sapien. Proin euismod orci lacus, et sollicitudin leo posuere ac. In hac habitasse platea dictumst. Maecenas elit magna, consequat in turpis suscipit, ultrices rhoncus arcu. Phasellus finibus sapien nec elit tempus venenatis. Maecenas tincidunt sapien non libero maximus, in aliquam felis tincidunt. Mauris mollis ultricies facilisis. Duis condimentum dignissim tortor sit amet facilisis. Aenean gravida lacus eu risus molestie egestas. Donec ut dolor dictum, fringilla metus malesuada, viverra nunc. Maecenas ut purus ac justo aliquet lacinia. Cras vestibulum elementum tincidunt. Maecenas mattis tortor neque, consectetur dignissim neque tempor nec.</p></div> </div> </div> </div> </div> </div> </div> </div> </div>'),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols())},_onPrev:function(){e(".fl-builder-tour-dimmed").remove()},_onNext:function(){e(".fl-builder-tour-dimmed").remove()},_onEnd:function(){e("body").off("fl-builder.template-selector-loaded"),e(".fl-builder-tour-mask").remove(),e(".fl-builder-tour-dimmed").remove(),e(".fl-builder-tour-demo-content").remove(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._showPanel(),FLBuilder._initTemplateSelector()},_dimSection:function(t){e(t).find(".fl-builder-tour-dimmed").remove(),e(t).append('<div class="fl-builder-tour-dimmed"></div>')}}}(jQuery),function(e,t){String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var i=this.toString();("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>i.length)&&(t=i.length),t-=e.length;var l=i.indexOf(e,t);return l!==-1&&l===t}),e.fn.textWidth=function(t,i){return e.fn.textWidth.fakeEl||(e.fn.textWidth.fakeEl=e("<span>").hide().appendTo(document.body)),e.fn.textWidth.fakeEl.text(t||this.val()||this.text()).css("font",i||this.css("font")),e.fn.textWidth.fakeEl.width()},FLExtendableObject={create:function(t){var i=Object.create(this);return i=e.extend(i,t),e(this).trigger("onCreate"),i}},e.fn.switchClass=function(t,i){return this.each(function(){return e(this).removeClass(function(e,i){var l=[],o=i.split(" ");for(var e in o)o[e].startsWith(t)&&l.push(o[e]);return l.join(" ")}),e(this).addClass(t+i)})};var i={init:function(){t.addHook("cancelTask",this.onCancelTask.bind(this)),t.addHook("showSavedMessage",this.onSaveShortcut.bind(this)),t.addHook("goToNextTab",this.onNextPrevTabShortcut.bind(this,"next")),t.addHook("goToPrevTab",this.onNextPrevTabShortcut.bind(this,"prev")),t.addHook("endEditingSession",this.onEndEditingSession.bind(this)),t.addHook("restartEditingSession",this.onRestartEditingSession.bind(this)),this.setDefaultKeyboardShortcuts()},addShortcut:function(t,i,l){var o=e.proxy(this,"onTriggerKey",t);l?Mousetrap.bindGlobal(i,o):Mousetrap.bind(i,o)},reset:function(){Mousetrap.reset()},setDefaultKeyboardShortcuts:function(){this.reset();for(var e in FLBuilderConfig.keyboardShortcuts){var t=FLBuilderConfig.keyboardShortcuts[e].keyCode,i=FLBuilderConfig.keyboardShortcuts[e].isGlobal;this.addShortcut(e,t,i)}},onTriggerKey:function(e,i){t.triggerHook(e),i.preventDefault?i.preventDefault():i.returnValue=!1},onCancelTask:function(){return s.isPreviewing?void s.endPreview():o.isShowing?void o.hide():t.ContentPanel.isShowing?void t.ContentPanel.hide():void 0},pause:function(){Mousetrap.pause()},unpause:function(){Mousetrap.unpause()},onEndEditingSession:function(){this.reset(),this.addShortcut("restartEditingSession","mod+e")},onRestartEditingSession:function(){this.reset(),this.setDefaultKeyboardShortcuts()},onSaveShortcut:function(){if(t.SaveManager.layoutNeedsPublish()){var e=FLBuilderStrings.savedStatus.hasAlreadySaved;t.SaveManager.showStatusMessage(e),setTimeout(function(){t.SaveManager.resetStatusMessage()},2e3)}else{var e=FLBuilderStrings.savedStatus.nothingToSave;t.SaveManager.showStatusMessage(e),setTimeout(function(){t.SaveManager.resetStatusMessage()},2e3)}},onNextPrevTabShortcut:function(i,l){var o,s,n=e(".fl-lightbox:visible"),r=n.find(".fl-builder-settings-tabs a");n.length>0&&(o=r.filter("a.fl-active"),s="next"==i?o.is(r.last())?r.first():o.next("a"):o.is(r.first())?r.last():o.prev("a"),s.trigger("click")),t._calculateSettingsTabsOverflow(),l.preventDefault()}},l={isShowing:!1,init:function(){this.render(),t.addHook("showKeyboardShortcuts",this.show.bind(this))},render:function(){var t=wp.template("fl-keyboard-shortcuts"),i=FLBuilderConfig.keyboardShortcuts;this.$el=e(t(i)),e("body").append(this.$el),this.$el.find(".dismiss-shortcut-ui").on("click",this.hide.bind(this)),this.$el.on("click",this.hide.bind(this))},show:function(){this.isShowing||(this.$el.addClass("is-showing"),this.isShowing=!0)},hide:function(){this.isShowing&&(this.$el.removeClass("is-showing"),this.isShowing=!1)},toggle:function(){this.isShowing?this.hide():this.show()}},o=FLExtendableObject.create({isShowing:!1,init:function(){this.$el=e(".fl-builder-publish-actions"),this.$defaultBarButtons=e(".fl-builder-bar-actions"),this.$clickAwayMask=e(".fl-builder-publish-actions-click-away-mask"),this.$doneBtn=this.$defaultBarButtons.find(".fl-builder-done-button"),this.$doneBtn.on("click",this.onDoneTriggered.bind(this)),this.$actions=this.$el.find(".fl-builder-button"),this.$actions.on("click",this.onActionClicked.bind(this)),t.addHook("triggerDone",this.onDoneTriggered.bind(this));var i=this.hide.bind(this);t.addHook("cancelPublishActions",i),t.addHook("endEditingSession",i),this.$clickAwayMask.on("click",i)},onDoneTriggered:function(){t.SaveManager.layoutNeedsPublish()?this.show():FLBuilderConfig.shouldRefreshOnPublish?t._exit():t._exitWithoutRefresh()},show:function(){this.isShowing||t._triggerSettingsSave(!1,!0)&&(this.$el.removeClass("is-hidden"),this.$defaultBarButtons.css("opacity","0"),this.$clickAwayMask.show(),this.isShowing=!0,t.triggerHook("didShowPublishActions"))},hide:function(){this.isShowing&&(this.$el.addClass("is-hidden"),this.$defaultBarButtons.css("opacity","1"),this.$clickAwayMask.hide(),this.isShowing=!1)},onActionClicked:function(i){var l=e(i.currentTarget).data("action");switch(l){case"dismiss":this.hide();break;case"discard":this.hide(),s.muteToolbar(),t._discardButtonClicked();break;case"publish":this.hide(),s.muteToolbar(),t._publishButtonClicked(),t._destroyOverlayEvents();break;case"draft":this.hide(),s.muteToolbar(),t._draftButtonClicked();break;default:this.hide(),s.muteToolbar(),t._draftButtonClicked()}t.triggerHook(l+"ButtonClicked")}}),s={isPreviewing:!1,init:function(){this.$el=e("body"),this.$mainToolbar=e(".fl-builder-bar"),this.$mainToolbarContent=this.$mainToolbar.find(".fl-builder-bar-content"),this.$wpAdminBar=e("#wpadminbar"),this.$endPreviewBtn=e(".fl-builder--preview-actions .end-preview-btn"),t.addHook("endEditingSession",this.endEditingSession.bind(this)),t.addHook("previewLayout",this.togglePreview.bind(this)),this.$endPreviewBtn.on("click",this.endPreview.bind(this)),this.$deviceIcons=e(".fl-builder--preview-actions i"),this.$deviceIcons.on("click",this.onDeviceIconClick.bind(this));var i=this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a, #wp-admin-bar-fl-theme-builder-frontend-edit-link > a");i.on("click",this.onClickPageBuilderToolbarLink.bind(this)),e("#wpadminbar a").attr("tabindex","-1");var l=this.restartEditingSession.bind(this);t.addHook("restartEditingSession",l),t.addHook("didHideAllLightboxes",this.unmuteToolbar.bind(this)),t.addHook("didCancelDiscard",this.unmuteToolbar.bind(this)),t.addHook("didEnterRevisionPreview",this.hide.bind(this)),t.addHook("didExitRevisionPreview",this.show.bind(this)),t.addHook("didPublishLayout",this.onPublish.bind(this))},endEditingSession:function(){t._destroyOverlayEvents(),t._removeAllOverlays(),t._removeEmptyColHighlights(),t._removeColHighlightGuides(),t._unbindEvents(),e("html").removeClass("fl-builder-edit").addClass("fl-builder-show-admin-bar"),e("body").removeClass("fl-builder-edit"),e("#wpadminbar a").attr("tabindex",null),e(t._contentClass).removeClass("fl-builder-content-editing"),this.hideMainToolbar(),t.ContentPanel.hide(),FLBuilderLayout.init()},restartEditingSession:function(i){t._initTemplateSelector(),t._bindOverlayEvents(),t._highlightEmptyCols(),t._rebindEvents(),e("html").addClass("fl-builder-edit").removeClass("fl-builder-show-admin-bar"),e("body").addClass("fl-builder-edit"),e("#wpadminbar a").attr("tabindex","-1"),e(t._contentClass).addClass("fl-builder-content-editing"),this.showMainToolbar(),i.preventDefault()},onClickPageBuilderToolbarLink:function(e){t.triggerHook("restartEditingSession"),e.preventDefault()},onPublish:function(){var e=this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a span");e.css("color","#6bc373")},hide:function(){e("html").hasClass("fl-builder-edit")&&(t._unbindEvents(),t._destroyOverlayEvents(),t._removeAllOverlays(),e("html").removeClass("fl-builder-edit"),e("body").removeClass("admin-bar"),this.hideMainToolbar(),t.ContentPanel.hide(),FLBuilderLayout.init(),t.triggerHook("didHideEditingUI"))},show:function(){e("html").hasClass("fl-builder-edit")||(t._rebindEvents(),t._bindOverlayEvents(),this.showMainToolbar(),FLBuilderResponsiveEditing._switchTo("default"),e("html").addClass("fl-builder-edit"),e("body").addClass("admin-bar"),t.triggerHook("didShowEditingUI"))},beginPreview:function(){t._triggerSettingsSave(!1,!0)&&(this.isPreviewing=!0,this.hide(),e("html").addClass("fl-builder-preview"),e("html, body").removeClass("fl-builder-edit"),t._removeEmptyColHighlights(),t._removeColHighlightGuides(),t.triggerHook("didBeginPreview"),FLBuilderResponsivePreview.enter())},endPreview:function(){this.isPreviewing=!1,this.show(),t._highlightEmptyCols(),FLBuilderResponsivePreview.exit(),e("html").removeClass("fl-builder-preview"),e("html, body").addClass("fl-builder-edit")},togglePreview:function(){this.isPreviewing?this.endPreview():this.beginPreview()},hideMainToolbar:function(){this.$mainToolbar.addClass("is-hidden"),e("html").removeClass("fl-builder-is-showing-toolbar")},showMainToolbar:function(){this.unmuteToolbar(),this.$mainToolbar.removeClass("is-hidden"),e("html").addClass("fl-builder-is-showing-toolbar")},onDeviceIconClick:function(t){var i=e(t.target).data("mode");FLBuilderResponsivePreview.switchTo(i)},muteToolbar:function(){this.$mainToolbarContent.addClass("is-muted"),t._hideTipTips()},unmuteToolbar:function(){this.$mainToolbarContent.removeClass("is-muted")}},n={isEditing:!0,init:function(){history.pushState&&(t.addHook("endEditingSession",this.onLeaveBuilder.bind(this)),t.addHook("restartEditingSession",this.onEnterBuilder.bind(this)))},onEnterBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.editUrl),this.isEditing=!0},onLeaveBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.url),this.isEditing=!1}},r={$row:null,$rowContent:null,row:null,drag:{},init:function(){
8
  if(this.userCanResize()){var i=e(t._contentClass);i.delegate(".fl-block-row-resize","mouseenter",this.onDragHandleHover.bind(this)),i.delegate(".fl-block-row-resize","mousedown",this.onDragHandleDown.bind(this))}},userCanResize:function(){return FLBuilderConfig.rowResize.userCanResizeRows},onDragHandleHover:function(t){if(!this.drag.isDragging){var i=e(t.target);this.$row=i.closest(".fl-row"),this.$rowContent=this.$row.find(".fl-row-content"),this.row={node:this.$row.data("node"),isFixedWidth:this.$row.hasClass("fl-row-fixed-width"),settings:e(".fl-builder-row-settings[data-node="+this.$row.data("node")+"]")},this.drag={edge:null,isDragging:!1,originalPosition:null,originalWidth:null,calculatedWidth:null,operation:null},this.row.isFixedWidth?this.drag.originalWidth=this.$row.width():this.drag.originalWidth=this.$rowContent.width(),this.dragInit()}},onDragHandleDown:function(){e("body").addClass("fl-builder-row-resizing")},dragInit:function(e){this.$row.find(".fl-block-row-resize").draggable({axis:"x",start:this.dragStart.bind(this),drag:this.dragging.bind(this),stop:this.dragStop.bind(this)})},dragStart:function(i,l){var o=e("body"),s=e(l.helper);this.drag.isDragging=!0,this.row.isFixedWidth?this.drag.originalWidth=this.$row.width():this.drag.originalWidth=this.$rowContent.width(),s.hasClass("fl-block-col-resize-e")&&(this.drag.edge="e",this.$feedback=s.find(".fl-block-col-resize-feedback-left")),s.hasClass("fl-block-col-resize-w")&&(this.drag.edge="w",this.$feedback=s.find(".fl-block-col-resize-feedback-right")),o.addClass("fl-builder-row-resizing"),t._colResizing=!0,t._destroyOverlayEvents(),t._closePanel()},dragging:function(e,t){var i=t.position.left,l=t.originalPosition.left,o=this.drag.originalWidth,s=0,n=this.drag.edge,r=FLBuilderConfig.rowResize.minAllowedWidth,a=FLBuilderConfig.rowResize.maxAllowedWidth;l!==i&&(FLBuilderConfig.isRtl&&(n="w"==n?"e":"w"),l>i?"w"===n?this.drag.operation="+":this.drag.operation="-":"e"===n?this.drag.operation="+":this.drag.operation="-",s=Math.abs(l-i),"+"===this.drag.operation?this.drag.calculatedWidth=o+2*s:this.drag.calculatedWidth=o-2*s,!1!==r&&this.drag.calculatedWidth<r&&(this.drag.calculatedWidth=r),!1!==a&&this.drag.calculatedWidth>a&&(this.drag.calculatedWidth=a),this.row.isFixedWidth&&this.$row.css("max-width",this.drag.calculatedWidth+"px"),this.$rowContent.css("max-width",this.drag.calculatedWidth+"px"),_.isUndefined(this.$feedback)||this.$feedback.html(this.drag.calculatedWidth+"px").show(),this.row.settings.length&&this.row.settings.find("[name=max_content_width]").val(this.drag.calculatedWidth))},dragStop:function(i,l){this.drag.isDragging=!1,_.isUndefined(this.$feedback)||this.$feedback.hide();var o={action:"resize_row_content",node:this.row.node,width:this.drag.calculatedWidth},s=e("body");t.ajax(o),t._bindOverlayEvents(),s.removeClass("fl-builder-row-resizing"),e(".fl-block-overlay").each(function(){t._buildOverlayOverflowMenu(e(this))}),e("body").removeClass("fl-builder-row-resizing"),setTimeout(function(){t._colResizing=!1},50),t.triggerHook("didResizeRow",{rowId:this.row.node,rowWidth:this.drag.calculatedWidth})}},a={templateName:"fl-toolbar",init:function(){this.template=wp.template(this.templateName),this.render(),this.initTipTips();var e=this.$el.find(".fl-builder-content-panel-button");e.on("click",t._togglePanel),this.$el.find(".fl-builder-buy-button").on("click",t._upgradeClicked),this.$el.find(".fl-builder-upgrade-button").on("click",t._upgradeClicked),this.$el.find("#fl-builder-toggle-notifications").on("click",this.onNotificationsButtonClicked.bind(this)),t.addHook("notificationsLoaded",this.onNotificationsLoaded.bind(this))},render:function(t){var i=e(this.template(t));this.$el=i,this.el=i.get(0),s.$mainToolbar=this.$el,e("body").prepend(i),e("html").addClass("fl-builder-is-showing-toolbar")},initTipTips:function(){e(".fl-builder--saving-indicator").tipTip({defaultPosition:"bottom",edgeOffset:14}),e(".fl-builder-publish-actions .fl-builder-button-group .fl-builder-button").tipTip({defaultPosition:"bottom",edgeOffset:6})},onNotificationsButtonClicked:function(){t.triggerHook("toggleNotifications")},onNotificationsLoaded:function(){e("body").removeClass("fl-builder-has-new-notifications");var i={action:"fl_builder_notifications",read:!0};t.ajax(i)}};e(function(){t.ContentPanel.init(),FLBuilderConfig.simpleUi||t.MainMenu.init(),FLBuilderConfig.showToolbar?(a.init(),t.ContentPanel.alignPanelArrow()):e("html").addClass("fl-builder-no-toolbar"),i.init(),l.init(),s.init(),n.init(),r.init(),o.init(),t.triggerHook("didInitUI")})}(jQuery,FLBuilder),function(e,t){var i=FLExtendableObject.create({templateName:"fl-main-menu-panel-view",name:"Untitled View",isShowing:!1,isRootView:!1,items:{},init:function(){this.template=wp.template(this.templateName)},render:function(){return this.template(this)},bindEvents:function(){this.$items=this.$el.find(".fl-builder--menu-item")},show:function(){this.$el.addClass("is-showing")},hide:function(){this.$el.removeClass("is-showing")},transitionIn:function(e){requestAnimationFrame(this.show.bind(this))},transitionOut:function(e){this.hide()}}),l=FLExtendableObject.create({templateName:"fl-main-menu-panel",template:null,menu:null,views:{},viewNavigationStack:[],isShowing:!1,shouldShowTabs:!1,init:function(){this.template=wp.template(this.templateName),e("body").prepend(this.template(this)),this.$el=e(".fl-builder--main-menu-panel"),this.$el.find(".fl-builder--main-menu-panel-views").html("");for(var i in FLBuilderConfig.mainMenu){this.renderPanel(i);var l="render"+i.charAt(0).toUpperCase()+i.slice(1)+"Panel";t.addHook(l,e.proxy(function(){this.renderPanel(i)},this))}e("body").on("click",".fl-builder--main-menu-panel .pop-view",this.goToPreviousView.bind(this)),this.$tabs=this.$el.find(".fl-builder--tabs > span"),this.$tabs.on("click",this.onItemClick.bind(this)),this.$barTitle=e(".fl-builder-bar-title"),e("body").on("click",".fl-builder-bar-title",this.toggle.bind(this));var n=this.hide.bind(this);t.addHook("didShowPublishActions",n),t.addHook("didBeginSearch",n),t.addHook("didBeginPreview",n),t.addHook("didShowContentPanel",n),t.addHook("endEditingSession",n),t.addHook("didFocusSearchBox",n),t.addHook("didEnterRevisionPreview",n),t.addHook("didFailSettingsSave",n),t.addHook("showKeyboardShortcuts",n),this.$mask=e(".fl-builder--main-menu-panel-mask"),this.$mask.on("click",n),o.init(),s.init()},renderPanel:function(t){var l,o,s;e('fl-builder--main-menu-panel-view[data-name="'+t+'"]').remove(),l=FLBuilderConfig.mainMenu[t],l.handle=t,o=i.create(l),o.init(),s=e(o.render()),o.$el=s,e(".fl-builder--main-menu-panel-views").append(s),o.bindEvents(),o.$el.find(".fl-builder--menu-item").on("click",this.onItemClick.bind(this)),o.isRootView&&(this.rootView=o,this.currentView=o),this.views[t]=o},show:function(){this.isShowing||(this.$el.addClass("is-showing"),this.$barTitle.addClass("is-showing-menu"),this.currentView.transitionIn(),this.isShowing=!0,this.$mask.show(),t.triggerHook("didOpenMainMenu"))},hide:function(){this.isShowing&&(this.$el.removeClass("is-showing"),this.$barTitle.removeClass("is-showing-menu"),this.isShowing=!1,this.resetViews(),this.$mask.hide())},toggle:function(){this.isShowing?this.hide():this.show()},onItemClick:function(i){var l=e(i.currentTarget),o=l.data("type");switch(o){case"view":var s=l.data("view");this.goToView(s);break;case"event":var n=l.data("event");t.triggerHook(n,l);break;case"link":}},goToView:function(e){var t=this.currentView,i=this.views[e];t.transitionOut(),i.transitionIn(),this.currentView=i,this.viewNavigationStack.push(t)},goToPreviousView:function(){var t=this.currentView,i=this.viewNavigationStack.pop();t.transitionOut(!0),i.transitionIn(!0),this.currentView=i,e(".fl-builder-bar-title-caret").focus()},resetViews:function(){this.currentView!=this.rootView&&(this.currentView.hide(),this.rootView.show(),this.currentView=this.rootView,this.viewNavigationStack=[])}});t.MainMenu=l;var o={init:function(){t.addHook("saveTemplate",this.saveTemplate.bind(this)),t.addHook("saveCoreTemplate",this.saveCoreTemplate.bind(this)),t.addHook("duplicateLayout",this.duplicateLayout.bind(this)),t.addHook("showLayoutSettings",this.showLayoutSettings.bind(this)),t.addHook("showGlobalSettings",this.showGlobalSettings.bind(this)),t.addHook("toggleUISkin",this.toggleUISkin.bind(this)),t.addHook("clearLayoutCache",this.clearLayoutCache.bind(this))},saveTemplate:function(){t._saveUserTemplateClicked(),l.hide()},saveCoreTemplate:function(){FLBuilderCoreTemplatesAdmin._saveClicked(),l.hide()},duplicateLayout:function(){t._duplicateLayoutClicked(),l.hide()},showGlobalSettings:function(){t._globalSettingsClicked(),l.hide()},showLayoutSettings:function(){t._layoutSettingsClicked(),l.hide()},clearLayoutCache:function(){t.ajax({action:"clear_cache"},function(){location.href=FLBuilderConfig.editUrl}),t.showAjaxLoader(),l.hide()},toggleUISkin:function(i){e('a[data-event="toggleUISkin"]');if(e("body").hasClass("fl-builder-ui-skin--light"))var l="light",o="dark";if(e("body").hasClass("fl-builder-ui-skin--dark"))var l="dark",o="light";e("body").removeClass("fl-builder-ui-skin--"+l).addClass("fl-builder-ui-skin--"+o),t.ajax({action:"save_ui_skin",skin_name:o})}},s={init:function(){t.addHook("beginTour",this.onStartTourClicked.bind(this))},onStartTourClicked:function(){FLBuilderTour.start(),l.hide()}}}(jQuery,FLBuilder),function(e,t){var i=FLExtendableObject.create({handle:"",name:"",panel:null,shouldShowTabItem:!0,isShowing:!1,views:{},activeView:null,defaultView:null,categorySelector:null,init:function(i){this.categorySelector=a.create({handle:"selector-"+this.handle,tab:this,items:[]}),this.categorySelector.init(),e(this.categorySelector).on("categorySelected",this.onViewSelected.bind(this));i.views;if(this.initViews(i.views),0===Object.keys(this.views).length){var l={handle:"noViews",name:"No Views",templateName:"fl-content-panel-no-view"};this.addView(l)}if(!this.activeView){var o=Object.keys(this.views)[0],l=this.views[o];this.activeView=l}this.defaultView=this.activeView,e(this.panel).on("afterRender",this.renderView.bind(this,this.activeView)),e(this.panel).on("onShow onShowTab",this.initScroller.bind(this)),t.addHook("contentItemsChanged",this.onLibraryDataChanged.bind(this))},initViews:function(e){for(var t in e){var i=e[t];this.categorySelector.addItem(i),"separator"!==i.type&&this.addView(i)}},addView:function(e){var t=l;switch(this.handle){case"modules":t=o;break;case"rows":t=s;break;case"templates":t=n;break;case"saved":t=r;break;default:t=l}_.isNull(this.viewController)||_.isUndefined(this.viewController)||(t=window[this.viewController]);var i=t.create(e),a=i.handle;i.init(),this.views[a]=i,i.isShowing&&(this.activeView=i)},renderView:function(e){if(this.$el=this.panel.$el.find('.fl-builder--panel-view[data-tab="'+this.handle+'"]'),_.isObject(e))var i=e;else var i=this.views[e];if(_.isObject(i)&&_.isFunction(i.render)){var l=i.render();this.$el.find(".fl-nanoscroller-content").html(l),this.activeView=i,t._initSortables(),this===this.panel.activeTab&&this.renderGroupSelector(),this.initScroller(),this.$el.find(".fl-nanoscroller-content").scrollTop(0)}},initScroller:function(){this.$el.nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"})},show:function(){e(this.activeView).trigger("onBeforeShow"),this.renderGroupSelector(),this.isShowing=!0,this.$el.addClass("is-showing"),this.$el.find(".fl-nanoscroller-content").scrollTop(0)},hide:function(){this.isShowing=!1,this.$el.removeClass("is-showing"),this.activeView!==this.defaultView&&this.renderView(this.defaultView),_.isObject(this.categorySelector)&&this.categorySelector.close()},renderGroupSelector:function(){var e=this.panel.$groupSelect,t=this.panel.$el.find(".fl-builder-panel-search");if(this.isSearchEnabled?t.show():t.hide(),Object.keys(this.views).length>1&&!_.isUndefined(this.categorySelector)){var i=this.categorySelector.render();this.panel.$el.find(".fl-builder-content-group-select");e.html(i),e.show(),this.panel.$el.removeClass("single-view")}else e.hide(),t.hide(),this.panel.$el.addClass("single-view")},onViewSelected:function(e,t){this.renderView(t),this.categorySelector.close()},onLibraryDataChanged:function(){this.renderView(this.activeView)}}),l=FLExtendableObject.create({templateName:"",name:"",handle:"",query:null,init:function(){this.template=wp.template(this.templateName),e(this).on("afterRender",this.bindEvents.bind(this)),e(this).trigger("afterInit")},filterTemplateData:function(e){return _.isNull(this.query)||_.isUndefined(this.query)||(e.queryResults=t.Search.byQuery(this.query)),e},render:function(){e(this).trigger("beforeRender");var t=this;t=this.filterTemplateData(t);var i=e(this.template(t));return this.$el=i,e(this).trigger("afterRender"),i},bindEvents:function(){},transitionIn:function(){},transitionOut:function(){}}),o=l.create({templateName:"fl-content-panel-modules-view",bindEvents:function(){this.$sections=this.$el,this.$items=this.$el.find(".fl-builder-block, .fl-builder-blocks-section-title")}}),s=l.create({templateName:"fl-content-panel-row-templates-view",bindEvents:function(){this.$items=this.$el.find(".fl-builder-block, .fl-builder-blocks-section-title")}}),n=l.create({templateName:"fl-content-panel-templates-view",bindEvents:function(){this.$items=this.$el.find(".fl-builder--template-collection-item"),this.$items.on("click",this.onTemplateClick.bind(this)),this.$userTemplateSections=e(".fl-user-templates"),this.$userTemplates=this.$el.find(".fl-user-template, .fl-builder--save-new-user-template"),this.$saveNewTemplateInput=this.$el.find('.fl-save-control input[name="template-name"]'),this.$saveNewTemplateCat=this.$el.find('.fl-save-control input[name="template-category"]'),this.$saveNewTemplateBtn=this.$el.find(".fl-save-control button"),this.$saveNewMask=this.$el.find(".fl-save-control-mask"),this.$saveNewTemplateInput.on("focus",this.onSaveInputFocus.bind(this)),this.$saveNewTemplateInput.on("keyup",this.onSaveInputKeyup.bind(this)),this.$saveNewTemplateBtn.on("click",this.onSaveButtonClick.bind(this)),this.$saveNewMask.on("click",this.resetSaveInput.bind(this))},onSaveInputFocus:function(){this.resetSaveInput(),this.$saveNewMask.show()},resetSaveInput:function(){this.$saveNewTemplateInput.val(""),this.$saveNewTemplateBtn.hide(),this.$saveNewMask.hide()},onSaveInputKeyup:function(t){var i=e(t.currentTarget),l=i.val(),o=i.siblings("button");""!==l?o.show():o.hide()},onSaveButtonClick:function(i){var l=e(i.currentTarget),o=l.siblings('input[name="template-name"]').val(),s=l.siblings('input[name="template-category"]').val(),n={name:o,category:s};""!==o&&t.ajax({action:"save_user_template",settings:n},t._saveUserTemplateSettingsComplete)},onTemplateClick:function(i){var l=e(i.currentTarget),o=l.data("id"),s=l.data("type");t._requestTemplateInsert(o,s)}}),r=l.create({templateName:"fl-content-panel-saved-view",filterTemplateData:function(e){return e.queryResults=t.Search.byQuery({kind:"template",type:"user",content:["module","column","row"]}),e}}),a=FLExtendableObject.create({templateName:"fl-content-panel-category-selector",template:null,tab:null,isOpen:!1,items:{},init:function(){this.template=wp.template(this.templateName),e(this).on("afterRender",this.bindEvents.bind(this)),e(this.tab.panel).on("didShowSearchControls",this.close.bind(this))},render:function(){this.close();var t=e(this.template(this));return this.$el=t,e(this).trigger("afterRender"),t},bindEvents:function(){this.$selectorTitle=this.$el.find(".fl-builder--selector-display"),this.$selectorTitle.on("click",this.toggleOpenClose.bind(this)),this.$categories=this.$el.find(".fl-builder--selector-menu .fl-builder--menu-item"),this.$categories.on("click",this.onCategoryClick.bind(this))},addItem:function(e){var t;t=_.isUndefined(e.handle)?_.uniqueId("sep_"):e.handle,this.items[t]=e},open:function(){this.isOpen||(this.$el.addClass("is-showing"),this.isOpen=!0)},close:function(){this.isOpen&&(this.$el.removeClass("is-showing"),this.isOpen=!1,this.$selectorTitle.find("button").focus())},toggleOpenClose:function(){this.isOpen?this.close():this.open()},onCategoryClick:function(t){var i=e(t.target).data("view");e(this).trigger("categorySelected",i)}});t.ContentPanel=FLExtendableObject.create({templateName:"fl-content-panel-base",template:null,tabs:{},activeTab:null,isShowing:!1,init:function(){if(FLBuilderConfig.panelData){var e=FLBuilderConfig.panelData.tabs;for(var l in e){var o=e[l];if(n=i.create(o),n.panel=this,n.views={},n.init(o),this.tabs[l]=n,n.isShowing&&(this.activeTab=n),!this.activeTab){var s=Object.keys(this.tabs)[0],n=this.tabs[s];n.isShowing=!0,this.activeTab=n}}this.template=wp.template(this.templateName),this.render(),this.renderSearchResults=wp.template("fl-search-results-panel"),this.renderNoResults=wp.template("fl-search-no-results"),t.triggerHook("contentPanelDidInit")}},render:function(){e("body").prepend(this.template(this)),this.$el=e(".fl-builder--content-library-panel"),this.bindEvents(),this.$groupSelect=this.$el.find(".fl-builder-content-group-select"),e(this).trigger("afterRender")},bindEvents:function(){this.$tabs=this.$el.find(".fl-builder--tabs [data-tab]"),this.$tabs.on("mouseup",this.onTabItemMouseUp.bind(this)),this.$tabs.on("click",this.onTabItemClick.bind(this)),this.$search=this.$el.find(".fl-builder-panel-search"),this.$searchBtn=this.$search.find(".fl-builder-toggle-panel-search"),this.$searchInput=this.$search.find('input[name="search-term"]'),this.$searchBtn.on("click",this.onSearchButtonClicked.bind(this)),this.$search.find(".fl-builder-dismiss-panel-search").on("click",this.onDismissButtonClicked.bind(this)),this.$searchInput.on("keyup",this.onSearchTermChanged.bind(this)),this.$searchPanel=this.$el.find(".fl-builder--search-results-panel"),t.addHook("showContentPanel",this.show.bind(this)),t.addHook("showModules",this.show.bind(this,"modules")),t.addHook("showRows",this.show.bind(this,"rows")),t.addHook("showTemplates",this.show.bind(this,"templates")),t.addHook("showSaved",this.show.bind(this,"saved")),t.addHook("showSearch",this.goToSearch.bind(this));var e=this.hide.bind(this);t.addHook("hideContentPanel",e),t.addHook("didShowLightbox",e),t.addHook("didShowPublishActions",e),t.addHook("didBeginSearch",e),t.addHook("didInitDrag",e),t.addHook("didOpenMainMenu",e),t.addHook("didApplyTemplate",e);var i=this.toggleShowHide.bind(this);t.addHook("toggleContentPanel",i),t.addHook("didStopDrag",this.hideSearchControls.bind(this))},alignPanelArrow:function(){var t,i,l=this.$el,o=null,s=this.$el.find(".fl-builder--panel-arrow"),n=e(".fl-builder-content-panel-button"),r=this.$el.css("animation-duration");if(0!=n.length){this.$el.css("animation-duration","0s"),this.show(),o=l[0].getBoundingClientRect(),t=s[0].getBoundingClientRect(),this.hide(),this.$el.css("animation-duration",r),buttonOffset=n[0].getBoundingClientRect();var a=buttonOffset.x+buttonOffset.width/2;i=a<o.x?20:a-o.x-t.width/2,s.css({right:"auto",left:i+"px"})}},show:function(i){"module"===FLBuilderConfig.userTemplateType||FLBuilderConfig.simpleUi||(t.triggerHook("willShowContentPanel"),"undefined"!=typeof i&&this.showTab(i),this.isShowing||t._triggerSettingsSave(!1,!0)&&(e("body").addClass("fl-builder-content-panel-is-showing"),this.isShowing=!0,e(this).trigger("onShow"),t.triggerHook("didShowContentPanel")))},hide:function(){this.isShowing&&(this.$el.hasClass("fl-builder-ui-pinned")||(e("body").removeClass("fl-builder-content-panel-is-showing"),this.isShowing=!1,e(this).trigger("onHide"),t.triggerHook("didHideContentPanel")))},toggleShowHide:function(){this.isShowing?this.hide():this.show()},showTab:function(t){var i=this.tabs[t];_.isObject(i)&&(_.isObject(this.activeTab)&&(this.activeTab.hide(),this.$tabs.filter(".is-showing").removeClass("is-showing")),this.hideSearchControls(),i.show(),this.$tabs.filter('[data-tab="'+i.handle+'"]').addClass("is-showing"),this.activeTab=i,e(this).trigger("onShowTab"))},goToSearch:function(){this.show("modules"),this.$el.find(".fl-builder-toggle-panel-search").trigger("click")},onTabItemMouseUp:function(t){e(t.currentTarget).blur()},onTabItemClick:function(t){var i=e(t.target),l=i.data("tab");this.showTab(l)},onSearchButtonClicked:function(){this.showSearchControls()},onDismissButtonClicked:function(){this.hideSearchControls(),this.$searchBtn.focus()},showSearchControls:function(){this.$search.addClass("is-showing-input"),this.$search.find('input[name="search-term"]').focus(),e(".fl-builder--selector-display-label").attr("tabindex",-1),this.$searchBtn.attr("tabindex",-1),e(this).trigger("didShowSearchControls")},hideSearchControls:function(){this.$search.removeClass("is-showing-input"),this.clearSearchInput(),this.hideSearchResults(),e(".fl-builder--selector-display-label").attr("tabindex",null),this.$searchBtn.attr("tabindex",null)},onSearchTermChanged:function(e){var i=this.$searchInput.val();if(""!==i){var l=t.Search.byTerm(i);""!=l.term?this.showSearchResults(l):this.hideSearchResults()}else this.hideSearchResults()},clearSearchInput:function(){this.$searchInput.val(""),this.hideSearchResults()},showSearchResults:function(i){if(i.total>0){var l=e(this.renderSearchResults(i));this.$searchPanel.html(l),t._initSortables()}else{var l=e(this.renderNoResults(i));this.$searchPanel.html(l)}e("body").addClass("fl-builder-search-results-panel-is-showing")},hideSearchResults:function(){e("body").removeClass("fl-builder-search-results-panel-is-showing")}})}(jQuery,FLBuilder),function(e){FLBuilderSettingsForms={config:null,settings:null,legacyXhr:null,init:function(){this.bind()},bind:function(){FLBuilder.addHook("didDeleteRow",this.closeOnDeleteNode),FLBuilder.addHook("didDeleteColumn",this.closeOnDeleteNode),FLBuilder.addHook("didDeleteModule",this.closeOnDeleteNode)},render:function(t,i){var l=FLBuilderSettingsConfig.forms,o=FLBuilderSettingsConfig.modules,s={type:"general",id:null,nodeId:null,className:"",attrs:"",title:"",badges:[],tabs:[],buttons:[],settings:{},legacy:null,rules:null,preview:null,helper:null};if(t.nodeId&&!t.settings)return void this.loadNodeSettings(t,i);if(t=e.extend(s,t),i=void 0===i?function(){}:i,t.id){if("general"===t.type&&void 0!==l[t.id])t=e.extend(!0,t,l[t.id]);else{if("module"!==t.type||void 0===o[t.id])return;t=e.extend(!0,t,o[t.id])}this.config=t,this.renderLightbox(t)&&(t.legacy||!this.renderLegacySettings(t,i)?this.renderComplete(t,i):this.showLightboxLoader())}},loadNodeSettings:function(e,t){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"get_node_settings",node_id:e.nodeId},function(i){e.settings=JSON.parse(i),FLBuilderSettingsConfig.nodes[e.nodeId]=e.settings,FLBuilderSettingsForms.render(e,t),FLBuilder.hideAjaxLoader()})},renderLightbox:function(t){var i=wp.template("fl-builder-settings"),l=FLBuilder._lightbox._node.find("form.fl-builder-settings");e(".fl-lightbox-wrap[data-parent]");if(t.nodeId&&t.nodeId===l.data("node")&&!t.lightbox)return FLBuilder._focusFirstSettingsControl(),!1;if(t.lightbox)t.lightbox.setContent(i(t));else{if(!FLBuilder._triggerSettingsSave(!0,!0))return!1;FLBuilder.preview&&FLBuilder.preview.cancel(),FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder._setLightboxContent(i(t))}return!0},renderComplete:function(t,i){var l=e(".fl-builder-settings:visible");setTimeout(function(){t.legacy&&this.renderLegacySettingsComplete(t.legacy),i(),FLBuilder._initSettingsForms(),t.rules&&FLBuilder._initSettingsValidation(t.rules),t.preview&&(FLBuilder.preview=new FLBuilderPreview(t.preview)),t.helper&&t.helper.init(),l.closest(".fl-lightbox-wrap[data-parent]").length||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,l))}.bind(this),1)},renderFields:function(t,i){var l=wp.template("fl-builder-settings-row"),o="",s=null,n=null,r=null,a=!1,d=null,u=["dimension","unit"],i=i?i:this.config.settings,c=FLBuilderConfig.global;for(n in t)s=t[n],a=!!s.multiple,supportsResponsive=e.inArray(s.type,u)>-1,r=_.isUndefined(i[n])?"":i[n],_.isUndefined(i[n])&&s["default"]&&(r=s["default"]),d=s.responsive&&c.responsive_enabled&&!a&&supportsResponsive?s.responsive:null,o+=l({field:s,name:n,rootName:n,value:r,preview:JSON.stringify(s.preview?s.preview:{type:"refresh"}),responsive:d,rowClass:s.row_class?" "+s.row_class:"",isMultiple:a,supportsMultiple:"editor"!==s.type&&"photo"!==s.type&&"service"!==s.type,settings:i,globalSettings:c,template:e("#tmpl-fl-builder-field-"+s.type)});return o},renderField:function(e){var t=wp.template("fl-builder-field");return t(e)},renderSectionTemplate:function(e,t){var i=wp.template(e.template.id);return i({section:e,settings:t})},renderTabTemplate:function(e,t){var i=wp.template(e.template.id);return i({tab:e,settings:t})},renderLegacySettings:function(t,i){var l=e(".fl-builder-settings:visible"),o=null,s=!1,n={tabs:[],sections:[],fields:[],settings:null,node_id:null};return l.find(".fl-legacy-field").each(function(){o=e(this),n.fields.push(o.attr("data-field")),FLBuilderSettingsForms.showFieldLoader(o),s=!0}),l.find(".fl-legacy-settings-section").each(function(){o=e(this),n.sections.push({tab:o.attr("data-tab"),section:o.attr("data-section")}),s=!0}),l.find(".fl-legacy-settings-tab").each(function(){o=e(this),n.tabs.push(o.attr("data-tab")),s=!0}),l.attr("data-node")?n.node_id=l.attr("data-node"):n.settings=FLBuilder._getOriginalSettings(l,!0),this.legacyXhr&&(this.legacyXhr.abort(),this.legacyXhr=null),this.legacyXhr=FLBuilder.ajax(e.extend(this.getLegacyVars(),{action:"render_legacy_settings",data:n,form:l.attr("data-form-id"),group:l.attr("data-form-group"),lightbox:l.closest(".fl-builder-lightbox").attr("data-instance-id")}),function(e){FLBuilderSettingsForms.renderLegacySettingsComplete(e),s&&FLBuilderSettingsForms.renderComplete(t,i),FLBuilderSettingsForms.hideLightboxLoader()}),s},renderLegacySettingsComplete:function(t){var i="object"==typeof t?t:JSON.parse(t),l=null,o=null,s="",n=null,r=null,a=null;if(i.lightbox?(l=e(".fl-builder-lightbox[data-instance-id="+i.lightbox+"]"),o=l.length?l.find(".fl-builder-settings"):null):(o=e(".fl-builder-settings:visible"),l=o.closest(".fl-builder-lightbox")),o&&o.length){for(s in i.fields)n=e("#fl-field-"+s).attr("id",""),n.after(i.fields[s]).remove();for(s in i.extras)n=e("#fl-field-"+s).find(".fl-field-control-wrapper"),i.extras[s].multiple?n.each(function(t,l){t in i.extras[s].before&&""!=i.extras[s].before[t]&&e(this).prepend('<div class="fl-form-field-before">'+i.extras[s].before[t]+"</div>"),t in i.extras[s].after&&""!=i.extras[s].after[t]&&e(this).append('<div class="fl-form-field-after">'+i.extras[s].after[t]+"</div>")}):(""!=i.extras[s].before&&n.prepend('<div class="fl-form-field-before">'+i.extras[s].before+"</div>"),""!=i.extras[s].after&&n.append('<div class="fl-form-field-after">'+i.extras[s].after+"</div>"));for(a in i.sections)for(s in i.sections[a])r=e("#fl-builder-settings-section-"+s),r.html(i.sections[a][s]);for(s in i.tabs)a=e("#fl-builder-settings-tab-"+s),a.html(i.tabs[s]);l.data("parent")||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,o),FLBuilder.preview&&(FLBuilder.preview._savedSettings=this.settings)),_.isUndefined(window.FLThemeBuilderFieldConnections)||FLThemeBuilderFieldConnections._initSettingsForms(),this.legacyXhr=null}},getLegacyVars:function(){var t=e(".fl-builder-settings:visible"),i=t.closest(".fl-builder-lightbox"),l=i.attr("data-parent"),o=null,s=null,n={};return l&&(l=e(".fl-builder-lightbox[data-instance-id="+l+"]"),t=l.find("form.fl-builder-settings"),o=FLBuilder._getSettings(t),s=t.attr("data-node"),s&&(n.node_id=s,n.node_settings=o)),n},settingsHaveChanged:function(){var e=FLBuilder._lightbox._node.find("form.fl-builder-settings"),t=FLBuilder._getSettings(e),i=!!this.settings&&JSON.stringify(this.settings)!=JSON.stringify(t);return i},closeOnDeleteNode:function(t,i){var l=e(".fl-builder-settings[data-node]"),o=FLBuilder._contentClass+" .fl-node-"+l.data("node");l.length&&!e(o).length&&FLLightbox.closeAll()},showLightboxLoader:function(){e(".fl-builder-settings:visible").append('<div class="fl-builder-loading"></div>')},hideLightboxLoader:function(t){e(".fl-builder-settings:visible .fl-builder-loading").remove()},showFieldLoader:function(e){var t=e.closest(".fl-field-control").find(".fl-field-control-wrapper");t.hide().after('<div class="fl-field-loader">'+FLBuilderStrings.fieldLoading+"</div>")},hideFieldLoader:function(e){var t=e.closest(".fl-field"),i=e.closest(".fl-field-control").find(".fl-field-control-wrapper");i.show(),t.find(".fl-field-loader").remove()}},FLBuilderSettingsConfig="undefined"==typeof FLBuilderSettingsConfig?{}:FLBuilderSettingsConfig,e.extend(FLBuilderSettingsConfig,{init:function(){FLBuilder.addHook("didSaveNodeSettings",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveNodeSettingsComplete",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveGlobalSettingsComplete",this.updateOnSaveGlobalSettings.bind(this)),FLBuilder.addHook("didSaveLayoutSettingsComplete",this.updateOnSaveLayoutSettings.bind(this)),FLBuilder.addHook("didAddRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddColumnGroup",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didResizeRow",this.updateOnRowResize.bind(this)),FLBuilder.addHook("didResizeColumn",this.updateOnColumnResize.bind(this)),FLBuilder.addHook("didResetRowWidth",this.updateOnResetRowWidth.bind(this)),FLBuilder.addHook("didResetColumnWidths",this.updateOnResetColumnWidths.bind(this)),FLBuilder.addHook("didApplyTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didApplyRowTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didApplyColTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didSaveGlobalNodeTemplate",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didRestoreRevisionComplete",this.updateOnApplyTemplate.bind(this))},updateOnSaveGlobalSettings:function(e,t){this.settings.global=t},updateOnSaveLayoutSettings:function(e,t){this.settings.layout=t},updateOnNodeEvent:function(){var e=arguments[0];e.namespace.indexOf("didAdd")>-1?this.addNode(arguments[1]):e.namespace.indexOf("didSaveNodeSettings")>-1?this.updateNode(arguments[1].nodeId,arguments[1].settings):e.namespace.indexOf("didDelete")>-1?this.deleteNodes():e.namespace.indexOf("didDuplicate")>-1&&this.duplicateNode(arguments[1].oldNodeId,arguments[1].newNodeId)},updateOnRowResize:function(e,t){this.nodes[t.rowId].max_content_width=t.rowWidth},updateOnResetRowWidth:function(e,t){this.nodes[t].max_content_width=""},updateOnColumnResize:function(e,t){this.nodes[t.colId].size=t.colWidth,this.nodes[t.siblingId].size=t.siblingWidth},updateOnResetColumnWidths:function(t,i){var l=this;i.cols.each(function(){var t=e(this),i=t.attr("data-node");l.nodes[i]&&(l.nodes[i].size=parseFloat(t[0].style.width))})},updateOnApplyTemplate:function(e,t){this.nodes=t.nodes,this.attachments=t.attachments},addNode:function(t,i){var l=e(".fl-node-"+t),o=l.hasClass("fl-row"),s=l.hasClass("fl-col"),n=l.hasClass("fl-col-group"),r=l.hasClass("fl-module"),a=this;this.nodes[t]||(i||(o?i=e.extend({},this.defaults.row):s?i=e.extend({},this.defaults.column):r&&(i=e.extend({},this.defaults.modules[l.attr("data-type")])),o||n?l.find(".fl-col").each(function(){var t=e(this),i=e.extend({},a.defaults.column);i.size=parseFloat(t[0].style.width),a.addNode(t.attr("data-node"),i);
1
  var FLBuilderColorPicker;!function(e,t){function i(){var t,i,l="backgroundImage";h?f="filter":(t=e('<div id="iris-gradtest" />'),i="linear-gradient(top,#fff,#000)",e.each(g,function(e,o){if(t.css(l,o+i),t.css(l).match("gradient"))return f=e,!1}),f===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css(this.bgImageString).match("gradient")&&(f="webkit")),t.remove())}function l(t,i){return t="top"===t?"top":"left",i=e.isArray(i)?i:Array.prototype.slice.call(arguments,1),"webkit"===f?s(t,i):g[f]+"linear-gradient("+t+", "+i.join(", ")+")"}function o(t,i){var l,o,s,r,a,d,u,c,h;t="top"===t?"top":"left",i=e.isArray(i)?i:Array.prototype.slice.call(arguments,1),l="top"===t?0:1,o=e(this),s=i.length-1,r="filter",a=1===l?"left":"top",d=1===l?"right":"bottom",u=1===l?"height":"width",c='<div class="iris-ie-gradient-shim" style="position:absolute;'+u+":100%;"+a+":%start%;"+d+":%end%;"+r+':%filter%;" data-color:"%color%"></div>',h="","static"===o.css("position")&&o.css({position:"relative"}),i=n(i),e.each(i,function(e,t){var o,n,r;return e!==s&&(o=i[e+1],void(t.stop!==o.stop&&(n=100-parseFloat(o.stop)+"%",t.octoHex=new FLBuilderColor(t.color).toIEOctoHex(),o.octoHex=new FLBuilderColor(o.color).toIEOctoHex(),r="progid:DXImageTransform.Microsoft.Gradient(GradientType="+l+", StartColorStr='"+t.octoHex+"', EndColorStr='"+o.octoHex+"')",h+=c.replace("%start%",t.stop).replace("%end%",n).replace("%filter%",r))))}),o.find(".iris-ie-gradient-shim").remove(),e(h).prependTo(o)}function s(t,i){var l=[];return t="top"===t?"0% 0%,0% 100%,":"0% 100%,100% 100%,",i=n(i),e.each(i,function(e,t){l.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+l.join(",")+")"}function n(t){var i=[],l=[],o=[],s=t.length-1;return e.each(t,function(e,t){var o=t,s=!1,n=t.match(/1?[0-9]{1,2}%$/);n&&(o=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=n.shift()),i.push(o),l.push(s)}),l[0]===!1&&(l[0]="0%"),l[s]===!1&&(l[s]="100%"),l=r(l),e.each(l,function(e){o[e]={color:i[e],stop:l[e]}}),o}function r(t){var i,l,o,s,n=0,a=t.length-1,d=0,u=!1;if(t.length<=2||e.inArray(!1,t)<0)return t;for(;d<t.length-1;)u||t[d]!==!1?u&&t[d]!==!1&&(a=d,d=t.length):(n=d-1,u=!0),d++;for(l=a-n,s=parseInt(t[n].replace("%"),10),i=(parseFloat(t[a].replace("%"))-s)/l,d=n+1,o=1;d<a;)t[d]=s+o*i+"%",o++,d++;return r(t)}var a=[],d=navigator.userAgent.toLowerCase(),u="Microsoft Internet Explorer"===navigator.appName,c=u?parseFloat(d.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,h=u&&c<10,f=!1,g=["-moz-","-webkit-","-o-","-ms-"];flBuilderParseColorValue=function(e){var t=e.replace(/\s+/g,""),i=t.indexOf("rgba")!==-1?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100,l=i<100;return{value:t,alpha:i,rgba:l}},e.fn.flBuilderColorPickerGradient=function(){var t=arguments;return this.each(function(){h?o.apply(this,t):e(this).css("backgroundImage",l.apply(this,t))})},e.fn.flBuilderColorPickerRaninbowGradient=function(t,i){var l,o,s,n;for(t=t||"top",l=e.extend({},{s:100,l:50},i),o="hsl(%h%,"+l.s+"%,"+l.l+"%)",s=0,n=[];s<=360;)n.push(o.replace("%h%",s)),s+=30;return this.each(function(){e(this).flBuilderColorPickerGradient(t,n)})},FLBuilderColorPicker=function(t){this._html='<div class="fl-color-picker-ui"><div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="javascript:void(0);"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-inner iris-square-horiz"></div><div class="iris-square-inner iris-square-vert"></div></div><div class="iris-slider iris-strip"><div class="iris-slider-offset"></div></div></div></div></div>';var i={elements:null,color:"",mode:"hsl",controls:{horiz:"s",vert:"l",strip:"h"},target:!1,width:200,presets:[],labels:{colorPresets:"Color Presets",colorPicker:"Color Picker",placeholder:"Paste color here...",removePresetConfirm:"Are you sure?",noneColorSelected:"None color selected.",alreadySaved:"%s is already a saved preset.",noPresets:"Add a color preset first.",presetAdded:"%s added to presets!"}};this.options=e.extend({},i,t),(h===!1||h===!0&&c>7)&&this._init()},FLBuilderColorPicker.prototype={_html:"",_color:"",_currentElement:"",_inited:!1,_defaultHSLControls:{horiz:"s",vert:"l",strip:"h"},_defaultHSVControls:{horiz:"h",vert:"v",strip:"s"},_scale:{h:360,s:100,l:100,v:100},_init:function(){var t=this;e(t.options.elements);this._color=new FLBuilderColor("#ff0000").setHSpace(t.options.mode),a=this.options.presets,f===!1&&i(),e("html").hasClass("fl-color-picker-init")?t.picker=e(".fl-color-picker-ui"):t.picker=e(this._html).appendTo("body"),u?9===c?t.picker.addClass("iris-ie-9"):c<=8&&t.picker.addClass("iris-ie-lt9"):d.indexOf("compatible")<0&&d.indexOf("khtml")<0&&d.match(/mozilla/)&&t.picker.addClass("iris-mozilla"),t.controls={square:t.picker.find(".iris-square"),squareDrag:t.picker.find(".iris-square-value"),horiz:t.picker.find(".iris-square-horiz"),vert:t.picker.find(".iris-square-vert"),strip:t.picker.find(".iris-strip"),stripSlider:t.picker.find(".iris-strip .iris-slider-offset")},"hsv"===t.options.mode&&t._has("l",t.options.controls)?t.options.controls=t._defaultHSVControls:"hsl"===t.options.mode&&t._has("v",t.options.controls)&&(t.options.controls=t._defaultHSLControls),t.hue=t._color.h(),this._setTemplates(),this._ui=e(".fl-color-picker-ui"),this._iris=e(".iris-picker"),this._wrapper=e("body"),e("html").hasClass("fl-color-picker-init")||this._ui.prepend(this._hexHtml).append(this._presetsHtml),t.element=this._ui.find(".fl-color-picker-input"),t._initControls(),t.active="external",t._change(),t._addInputListeners(t.element),this._buildUI(),this._prepareColorFields(),this._pickerControls(),this._presetsControls(),this._buildAlphaUI(),e("html").addClass("fl-color-picker-init")},_prepareColorFields:function(){var t=this;e(".fl-color-picker-value").each(function(){var i=e(this),l=i.val(),o=i.parent().find(".fl-color-picker-color"),s=flBuilderParseColorValue(l),n="";if(l){if(o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba)n=i.val().toString();else if(!o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba){var r=l.replace("rgba","rgb");r=r.substr(0,r.lastIndexOf(","))+")",t._color._alpha=1,n=r,i.val(r)}else n="#"+i.val().toString();o.css({backgroundColor:n})}})},_setTemplates:function(){this._alphaHtml='<div class="fl-alpha-wrap"><div class="fl-alpha-slider"></div><div class="fl-alpha-slider-offset"></div><div class="fl-alpha-text"></div></div>',this._presetsHtml='<div class="fl-color-picker-presets"><div class="fl-color-picker-presets-toggle"><div class="fl-color-picker-presets-open-label fl-color-picker-active">'+this.options.labels.colorPresets+' <span class="fl-color-picker-icon-arrow-up"></span></div><div class="fl-color-picker-presets-close-label">'+this.options.labels.colorPicker+' <span class="fl-color-picker-icon-arrow-down"></span></div></div><ul class="fl-color-picker-presets-list"></ul></div>',this._hexHtml='<input type="text" class="fl-color-picker-input" maxlength="7" placeholder="'+this.options.labels.placeholder+'"><div class="fl-color-picker-preset-add"></div>',this._presetsTpl='<li class="fl-color-picker-preset"><span class="fl-color-picker-preset-color"></span> <span class="fl-color-picker-preset-label"></span> <span class="fl-color-picker-preset-remove fl-color-picker-icon-remove"></span></li>',this._noPresetsTpl='<li class="fl-color-picker-no-preset"><span class="fl-color-picker-preset-label">'+this.options.labels.noPresets+"</span></li>"},_has:function(t,i){var l=!1;return e.each(i,function(e,i){if(t===i)return l=!0,!1}),l},_buildUI:function(){var t=this;t._presetsList=this._ui.find(".fl-color-picker-presets-list"),t._presetsList.html(""),this.options.presets.length>0?e.each(this.options.presets,function(e,i){t._addPresetView(i)}):t._presetsList.append(this._noPresetsTpl)},_addPresetView:function(t){var i=this._presetsList.find(".fl-color-picker-no-preset");i.length>0&&i.remove();var l=e(this._presetsTpl),o=FLBuilderColor(t);l.attr("data-color",t).find(".fl-color-picker-preset-color").css({backgroundColor:o.toString()}).end().find(".fl-color-picker-preset-label").html(o.toString()),this._presetsList.append(l)},_addPresetFeedback:function(){this._ui.append('<div class="fl-color-picker-added"><div class="fl-color-picker-added-text"><div class="fl-color-picker-icon-check"></div> "'+this.options.labels.presetAdded.replace("%s",this._color.toString())+'"</div></div>'),this._ui.find(".fl-color-picker-added").hide().fadeIn(200).delay(2e3).fadeOut(200,function(){e(this).remove()})},_pickerControls:function(){var t=this;this._wrapper.on("click",".fl-color-picker-color",function(){var i=e(this);t._currentElement=i.parent().find(".fl-color-picker-value"),t._ui.position({my:"left top",at:"left bottom",of:i,collision:"flip",using:function(e,i){t._togglePicker(e)}})}).on("click",".fl-color-picker-clear",function(){var i=e(this);t._currentElement=i.parent().find(".fl-color-picker-value"),i.prev(".fl-color-picker-color").css({backgroundColor:"transparent"}).addClass("fl-color-picker-empty"),t._setColor(""),t.element.val(""),t._currentElement.val("").trigger("change")}),e(document).on("mousedown",function(t){0===e(t.target).closest(".fl-color-picker-ui").length&&e(".fl-color-picker-ui.fl-color-picker-active").removeClass("fl-color-picker-active")})},_presetsControls:function(){var t=this,i=t._ui.find(".fl-color-picker-preset-add"),l=t._ui.find(".fl-color-picker-presets"),o=l.find(".fl-color-picker-presets-open-label"),s=l.find(".fl-color-picker-presets-close-label"),n=l.find(".fl-color-picker-presets-list");i.off("click").on("click",function(){t._addPreset(t.element.val())}),n.css({height:t.element.innerHeight()+t._iris.innerHeight()+14+"px"}).hide(),l.off("click").on("click",".fl-color-picker-presets-toggle",function(){o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),n.slideToggle(500)}).on("click",".fl-color-picker-preset",function(i){var l=new FLBuilderColor(e(this).data("color").toString());t._setColor(l),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:l.toString()}).removeClass("fl-color-picker-empty"),o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),n.slideToggle(500)}).on("click",".fl-color-picker-preset-remove",function(i){i.stopPropagation(),t._removePreset(e(this).parent().data("color"))})},_removePreset:function(t){if(confirm(this.options.labels.removePresetConfirm)){var i=t.toString(),l=a.indexOf(i);l>-1&&(a.splice(l,1),this.options.presets=a,this._presetsList.find('.fl-color-picker-preset[data-color="'+i+'"]').slideUp(function(){e(this).remove()})),a.length<1&&this._presetsList.append(this._noPresetsTpl),e(this).trigger("presetRemoved",{presets:a})}},_addPreset:function(t){var i=t.toString().replace(/^#/,"");""===i?alert(this.options.labels.noneColorSelected):a.indexOf(i)>-1?alert(this.options.labels.alreadySaved.replace("%s","#"+i)):(this._addPresetView(i),this._addPresetFeedback(),a.push(i),this.options.presets=a,e(this).trigger("presetAdded",{presets:a}))},_togglePicker:function(e){var t=this;this._ui.hasClass("fl-color-picker-active")?(this._ui.removeClass("fl-color-picker-active"),e&&setTimeout(function(){t._ui.css(e),t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200)):(e&&t._ui.css(e),setTimeout(function(){t._ui.addClass("fl-color-picker-active"),t._setColor(t._currentElement.val())},200))},_paint:function(){var e=this;e._paintDimension("right","strip"),e._paintDimension("top","vert"),e._paintDimension("left","horiz")},_paintDimension:function(e,t){var i,l=this,o=l._color,s=l.options.mode,n=l._getHSpaceColor(),r=l.controls[t],a=l.options.controls;if(t!==l.active&&("square"!==l.active||"strip"===t))switch(a[t]){case"h":if("hsv"===s){switch(n=o.clone(),t){case"horiz":n[a.vert](100);break;case"vert":n[a.horiz](100);break;case"strip":n.setHSpace("hsl")}i=n.toHsl()}else i="strip"===t?{s:n.s,l:n.l}:{s:100,l:n.l};r.flBuilderColorPickerRaninbowGradient(e,i);break;case"s":"hsv"===s?"vert"===t?i=[o.clone().a(0).s(0).toCSS("rgba"),o.clone().a(1).s(0).toCSS("rgba")]:"strip"===t?i=[o.clone().s(100).toCSS("hsl"),o.clone().s(0).toCSS("hsl")]:"horiz"===t&&(i=["#fff","hsl("+n.h+",100%,50%)"]):i="vert"===t&&"h"===l.options.controls.horiz?["hsla(0, 0%, "+n.l+"%, 0)","hsla(0, 0%, "+n.l+"%, 1)"]:["hsl("+n.h+",0%,50%)","hsl("+n.h+",100%,50%)"],r.flBuilderColorPickerGradient(e,i);break;case"l":i="strip"===t?["hsl("+n.h+",100%,100%)","hsl("+n.h+", "+n.s+"%,50%)","hsl("+n.h+",100%,0%)"]:["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],r.flBuilderColorPickerGradient(e,i);break;case"v":i="strip"===t?[o.clone().v(100).toCSS(),o.clone().v(0).toCSS()]:["rgba(0,0,0,0)","#000"],r.flBuilderColorPickerGradient(e,i)}},_getHSpaceColor:function(){return"hsv"===this.options.mode?this._color.toHsv():this._color.toHsl()},_dimensions:function(e){var t,i=this,l=i.options,o=i.controls,s=o.square,n=i.picker.find(".iris-strip"),r="77.5%",a="12%",d=20,u=l.border?l.width-d:l.width;if(e&&(s.css("width",""),n.css("width",""),i.picker.css({width:"",height:""})),r=u*(parseFloat(r)/100),a=u*(parseFloat(a)/100),t=l.border?r+d:r,s.width(r).height(r),n.height(r).width(a),i.picker.css({width:l.width,height:t}),!l.palettes)return i.picker.css("paddingBottom","")},_addInputListeners:function(e){var t=this,i=100,l=function(i){var l=new FLBuilderColor(e.val()),o=e.val().replace(/^#/,""),s=t._currentElement.hasClass("fl-color-picker-empty");if(e.removeClass("iris-error"),l.error)""!==o&&e.addClass("iris-error");else if(l.toString()!==t._color.toString()||""!==t._color.toString()&&s)if("keyup"===i.type){if(o.match(/^[0-9a-fA-F]{3}$/))return;t._setColor(o),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:FLBuilderColor(o).toString()}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change")}else if("paste"===i.type)return o=i.originalEvent.clipboardData.getData("text").replace(/^#/,""),hex=FLBuilderColor(o).toString(),t._setColor(o),e.val(hex),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:hex}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change"),!1};e.on("change",l).on("keyup",t._debounce(l,i))},_initControls:function(){var t=this,i=t.controls,l=i.square,o=t.options.controls,s=t._scale[o.strip];i.stripSlider.slider({orientation:"horizontal",max:s,slide:function(e,i){t.active="strip","h"===o.strip&&(i.value=s-i.value),t._color[o.strip](i.value),t._change.apply(t,arguments)}}),i.squareDrag.draggable({containment:i.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(e,i){t._squareDrag(e,i)},start:function(){l.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){l.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(i){var l="ui-state-focus";i.preventDefault(),"mousedown"===i.type?(t.picker.find("."+l).removeClass(l).blur(),e(this).addClass(l).focus()):e(this).removeClass(l)}).on("keydown",function(e){var l=i.square,o=i.squareDrag,s=o.position(),n=2;switch(e.altKey&&(n*=10),e.keyCode){case 37:s.left-=n;break;case 38:s.top-=n;break;case 39:s.left+=n;break;case 40:s.top+=n;break;default:return!0}s.left=Math.max(0,Math.min(s.left,l.width())),s.top=Math.max(0,Math.min(s.top,l.height())),o.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),l.mousedown(function(i){var l,o;1===i.which&&e(i.target).is("div")&&(l=t.controls.square.offset(),o={top:i.pageY-l.top,left:i.pageX-l.left},i.preventDefault(),t._squareDrag(i,{position:o}),i.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(o).trigger(i))})},_squareDrag:function(e,t){var i=this,l=i.options.controls,o=i._squareDimensions(),s=Math.round((o.h-t.position.top)/o.h*i._scale[l.vert]),n=i._scale[l.horiz]-Math.round((o.w-t.position.left)/o.w*i._scale[l.horiz]);i._color[l.horiz](n)[l.vert](s),i.active="square",i._change.apply(i,arguments)},_setColor:function(e){var t,i,l=this,o=l.options.color,s="#ff0000";""===e?(e=s,l["default"]=!0):l["default"]=!1,l.options.color=e,e=""+e,t=e.replace(/^#/,""),i=new FLBuilderColor(e).setHSpace(l.options.mode),i.error?l.options.color=o:(l._color=i,l.options.color=l._color.toString(),l.active="external",l._change())},_squareDimensions:function(e){var i,l,o=this.controls.square;return e!==t&&o.data("dimensions")?o.data("dimensions"):(l=this.controls.squareDrag,i={w:o.width(),h:o.height()},o.data("dimensions",i),i)},_isNonHueControl:function(e,t){return"square"===e&&"h"===this.options.controls.strip||"external"!==t&&("h"!==t||"strip"!==e)},_change:function(){var t=this,i=t.controls,l=t._getHSpaceColor(),o=["square","strip"],s=t.options.controls,n=s[t.active]||"external",r=t.hue;"strip"===t.active?o=[]:"external"!==t.active&&o.pop(),e.each(o,function(e,o){var n,r,a;if(o!==t.active)switch(o){case"strip":n="h"===s.strip?t._scale[s.strip]-l[s.strip]:l[s.strip],i.stripSlider.slider("value",n);break;case"square":r=t._squareDimensions(),a={left:l[s.horiz]/t._scale[s.horiz]*r.w,top:r.h-l[s.vert]/t._scale[s.vert]*r.h},t.controls.squareDrag.css(a)}}),l.h!==r&&t._isNonHueControl(t.active,n)&&t._color.h(r),t.hue=t._color.h(),t.options.color=t._color.toString(),t.element.is(":input")&&!t._color.error&&(t.element.removeClass("iris-error"),t.element.val()!==t._color.toString()&&(t.element.val(t._color.toString()),this._currentElement&&(!t["default"]||t["default"]&&"external"!==t.active?this._currentElement.val(t._color.toString().replace(/^#/,"")).parent().find(".fl-color-picker-color").css({backgroundColor:t._color.toString()}).removeClass("fl-color-picker-empty"):this._currentElement.val(""),t._wrapper.find(".fl-alpha-slider-offset").css("background-color",t._color.toString()),this._currentElement.trigger("change")))),t._paint(),t._inited=!0,t.active=!1},_debounce:function(e,t,i){var l,o;return function(){var s,n,r=this,a=arguments;return s=function(){l=null,i||(o=e.apply(r,a))},n=i&&!l,clearTimeout(l),l=setTimeout(s,t),n&&(o=e.apply(r,a)),o}},_buildAlphaUI:function(){var t=this;t._wrapper.on("click",".fl-color-picker-color",function(){var i=e(this);t._currentElement.val();i.hasClass("fl-color-picker-alpha-enabled")?(t._ui.find(".fl-alpha-wrap").length<=0&&e(t._alphaHtml).insertAfter(t._iris),t.picker.addClass("fl-color-alpha-enabled"),t._pickerAlphaControls()):t._ui.find(".fl-alpha-wrap").remove()})},_pickerAlphaControls:function(){var e=this,t=e._currentElement,i=flBuilderParseColorValue(t.val()),l=parseFloat(i.alpha/100),o=e._wrapper,s=e._ui,n=s.find(".fl-alpha-wrap"),r=n.find(".fl-alpha-slider"),a=n.find(".fl-alpha-text"),d=n.find(".fl-alpha-slider-offset");alphaHandle=n.find(".ui-slider-handle"),a.text(l<1?l:""),r.slider({orientation:"vertical",slide:function(t,i){var l=parseFloat(i.value/100);e._color._alpha=l,a.text(l<1?l:""),e._change.apply(e,arguments)},create:function(){d.css({backgroundColor:i.value}),o.on("click",".fl-color-picker-clear",function(){e._color._alpha=1,a.text(""),r.slider("value",100).trigger("slide")})},value:i.alpha,step:1,min:1,max:100})}}}(jQuery),function(e,t){var i=function(e,t){return this instanceof i?this._init(e,t):new i(e,t)};i.fn=i.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(e){var i="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),i=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":i,this[i](e);case"string":return this.fromCSS(e);case"number":return this.fromInt(parseInt(e,10))}return this},_error:function(){return this.error=!0,this},clone:function(){for(var e=new i(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"],l=t.length-1;l>=0;l--)e[t[l]]=this[t[l]];return e},setHSpace:function(e){return this._hSpace="hsv"===e?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,i=/^(rgb|hs(l|v))a?\(/;if(this.error=!1,e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,""),e.match(i)&&e.match(/\)$/)){if(t=e.replace(/(\s|%)/g,"").replace(i,"").replace(/,?\);?$/,"").split(","),t.length<3)return this._error();if(4===t.length&&(this.a(parseFloat(t.pop())),this.error))return this;for(var l=t.length-1;l>=0;l--)if(t[l]=parseInt(t[l],10),isNaN(t[l]))return this._error();return e.match(/^rgb/)?this.fromRgb({r:t[0],g:t[1],b:t[2]}):e.match(/^hsv/)?this.fromHsv({h:t[0],s:t[1],v:t[2]}):this.fromHsl({h:t[0],s:t[1],l:t[2]})}return this.fromHex(e)},fromRgb:function(e,i){return"object"!=typeof e||e.r===t||e.g===t||e.b===t?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),i))},fromHex:function(e){return e=e.replace(/^#/,"").replace(/^0x/,""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),this.error=!/^[0-9A-F]{6}$/i.test(e),this.fromInt(parseInt(e,16))},fromHsl:function(e){var i,l,o,s,n,r,a,d;return"object"!=typeof e||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",r=e.h/360,a=e.s/100,d=e.l/100,0===a?i=l=o=d:(s=d<.5?d*(1+a):d+a-d*a,n=2*d-s,i=this.hue2rgb(n,s,r+1/3),l=this.hue2rgb(n,s,r),o=this.hue2rgb(n,s,r-1/3)),this.fromRgb({r:255*i,g:255*l,b:255*o},!0))},fromHsv:function(e){var i,l,o,s,n,r,a,d,u,c,h;if("object"!=typeof e||e.h===t||e.s===t||e.v===t)return this._error();switch(this._hsv=e,this._hSpace="hsv",i=e.h/360,l=e.s/100,o=e.v/100,a=Math.floor(6*i),d=6*i-a,u=o*(1-l),c=o*(1-d*l),h=o*(1-(1-d)*l),a%6){case 0:s=o,n=h,r=u;break;case 1:s=c,n=o,r=u;break;case 2:s=u,n=o,r=h;break;case 3:s=u,n=c,r=o;break;case 4:s=h,n=u,r=o;break;case 5:s=o,n=u,r=c}return this.fromRgb({r:255*s,g:255*n,b:255*r},!0)},fromInt:function(e,i){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),i===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},toString:function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e},toCSS:function(e,t){switch(e=e||"hex",t=parseFloat(t||this._alpha),e){case"rgb":case"rgba":var i=this.toRgb();return t<1?"rgba( "+i.r+", "+i.g+", "+i.b+", "+t+" )":"rgb( "+i.r+", "+i.g+", "+i.b+" )";case"hsl":case"hsla":var l=this.toHsl();return t<1?"hsla( "+l.h+", "+l.s+"%, "+l.l+"%, "+t+" )":"hsl( "+l.h+", "+l.s+"%, "+l.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var e,t,i=this.toRgb(),l=i.r/255,o=i.g/255,s=i.b/255,n=Math.max(l,o,s),r=Math.min(l,o,s),a=(n+r)/2;if(n===r)e=t=0;else{var d=n-r;switch(t=a>.5?d/(2-n-r):d/(n+r),n){case l:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-l)/d+2;break;case s:e=(l-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsl.h!==e&&(e=this._hsl.h),t=Math.round(100*t),0===t&&this._hsl.s&&(t=this._hsl.s),{h:e,s:t,l:Math.round(100*a)}},toHsv:function(){var e,t,i=this.toRgb(),l=i.r/255,o=i.g/255,s=i.b/255,n=Math.max(l,o,s),r=Math.min(l,o,s),a=n,d=n-r;if(t=0===n?0:d/n,n===r)e=t=0;else{switch(n){case l:e=(o-s)/d+(o<s?6:0);break;case o:e=(s-l)/d+2;break;case s:e=(l-o)/d+4}e/=6}return e=Math.round(360*e),0===e&&this._hsv.h!==e&&(e=this._hsv.h),t=Math.round(100*t),0===t&&this._hsv.s&&(t=this._hsv.s),{h:e,s:t,v:Math.round(100*a)}},toInt:function(){return this._color},toIEOctoHex:function(){var e=this.toString(),t=parseInt(255*this._alpha,10).toString(16);return 1===t.length&&(t="0"+t),"#"+t+e.replace(/^#/,"")},toLuminosity:function(){var e=this.toRgb();return.2126*Math.pow(e.r/255,2.2)+.7152*Math.pow(e.g/255,2.2)+.0722*Math.pow(e.b/255,2.2)},getDistanceLuminosityFrom:function(e){if(!(e instanceof i))throw"getDistanceLuminosityFrom requires a Color object";var t=this.toLuminosity(),l=e.toLuminosity();return t>l?(t+.05)/(l+.05):(l+.05)/(t+.05)},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new i(t)},getReadableContrastingColor:function(e,l){if(!(e instanceof i))return this;var o=l===t?5:l,s=e.getDistanceLuminosityFrom(this),n=e.getMaxContrastColor(),r=n.getDistanceLuminosityFrom(e);if(r<=o)return n;if(s>=o)return this;for(var a=0===n.toInt()?-1:1;s<o&&(this.l(a,!0),s=this.getDistanceLuminosityFrom(e),0!==this._color&&16777215!==this._color););return this},a:function(e){if(e===t)return this._alpha;var i=parseFloat(e);return isNaN(i)?this._error():(this._alpha=i,this)},darken:function(e){return e=e||5,this.l(-e,!0)},lighten:function(e){return e=e||5,this.l(e,!0)},saturate:function(e){return e=e||15,this.s(e,!0)},desaturate:function(e){return e=e||15,this.s(-e,!0)},toGrayscale:function(){return this.setHSpace("hsl").s(0)},getComplement:function(){return this.h(180,!0)},getSplitComplement:function(e){e=e||1;var t=180+30*e;return this.h(t,!0)},getAnalog:function(e){e=e||1;var t=30*e;return this.h(t,!0)},getTetrad:function(e){e=e||1;var t=60*e;return this.h(t,!0)},getTriad:function(e){e=e||1;var t=120*e;return this.h(t,!0)},_partial:function(e){var i=l[e];return function(l,o){var s=this._spaceFunc("to",i.space);return l===t?s[e]:(o===!0&&(l=s[e]+l),i.mod&&(l%=i.mod),i.range&&(l=l<i.range[0]?i.range[0]:l>i.range[1]?i.range[1]:l),s[e]=l,this._spaceFunc("from",i.space,s))}},_spaceFunc:function(e,t,i){var l=t||this._hSpace,o=e+l.charAt(0).toUpperCase()+l.substr(1);return this[o](i)}};var l={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var o in l)l.hasOwnProperty(o)&&(i.fn[o]=i.fn._partial(o));"object"==typeof exports?module.exports=i:(e.FLBuilderColor=i,e.Color=i)}(this),function(e){FLLightbox=function(e){this._init(e)},FLLightbox.closeParent=function(t){var i=e(t).closest(".fl-lightbox-wrap").attr("data-instance-id");_.isUndefined(i)||FLLightbox._instances[i].close()},FLLightbox.getResizableControlClass=function(){var t=e(".fl-lightbox-resizable").eq(0),i="far fa-window-maximize";return t.length&&t.hasClass("fl-lightbox-width-full")&&(i="far fa-window-minimize"),i},FLLightbox.unbindAll=function(){var e;for(e in FLLightbox._instances)FLLightbox._instances[e]._unbind()},FLLightbox.bindAll=function(){var e;for(e in FLLightbox._instances)FLLightbox._instances[e]._bind()},FLLightbox.closeAll=function(){var e;for(e in FLLightbox._instances)FLLightbox._instances[e].close()},FLLightbox._instances={},FLLightbox.prototype={_id:null,_node:null,_visible:!1,_allowClosing:!0,_resizeTimer:null,_defaults:{className:"",destroyOnClose:!1,resizable:!1},open:function(e){var t=this._node.find(".fl-lightbox"),i=t.closest(".fl-builder-ui-pinned").length,l=this._getPositionSettings();!i&&l&&this._defaults.resizable&&t.css(l),this._bind(),this._node.show(),this._visible=!0,"undefined"!=typeof e?this.setContent(e):this._resize(),this.trigger("open"),FLBuilder.triggerHook("didShowLightbox",this)},close:function(){var e=this._node.data("parent");this._allowClosing&&(this.trigger("beforeCloseLightbox"),this._unbind(),this._node.hide(),this._visible=!1,this.trigger("close"),FLBuilder.triggerHook("didHideLightbox"),this._defaults.resizable&&_.isUndefined(e)&&FLBuilder.triggerHook("didHideAllLightboxes"),this._defaults.destroyOnClose&&this.destroy())},disableClose:function(){this._allowClosing=!1},enableClose:function(){this._allowClosing=!0},setContent:function(e){this._node.find(".fl-lightbox-content").html(e),this._resize()},empty:function(){this._node.find(".fl-lightbox-content").empty()},on:function(e,t){this._node.on(e,t)},off:function(e,t){this._node.off(e,t)},trigger:function(e,t){this._node.trigger(e,t)},destroy:function(){this._node.empty(),this._node.remove(),FLLightbox._instances[this._id]="undefined";try{delete FLLightbox._instances[this._id]}catch(e){}},_init:function(t){var i=0,l=null;for(l in FLLightbox._instances)i++;this._defaults=e.extend({},this._defaults,t),this._id=(new Date).getTime()+i,FLLightbox._instances[this._id]=this,this._render(),this._resizable()},_render:function(){this._node=e('<div class="fl-lightbox-wrap" data-instance-id="'+this._id+'"><div class="fl-lightbox-mask"></div><div class="fl-lightbox"><div class="fl-lightbox-content-wrap"><div class="fl-lightbox-content"></div></div></div></div>'),this._node.addClass(this._defaults.className),e("body").append(this._node)},_bind:function(){e(window).on("resize.fl-lightbox-"+this._id,this._delayedResize.bind(this))},_unbind:function(){e(window).off("resize.fl-lightbox-"+this._id)},_resizable:function(){var t=(e("body"),this._node.find(".fl-lightbox-mask")),i=this._node.find(".fl-lightbox"),l=e(".fl-lightbox-resizable").eq(0);this._defaults.resizable?(t.hide(),i.addClass("fl-lightbox-resizable"),i.delegate(".fl-lightbox-resize-toggle","click",this._resizeClicked.bind(this)),i.draggable({cursor:"move",handle:".fl-lightbox-header"}).resizable({handles:"all",minHeight:500,minWidth:380,start:this._resizeStart.bind(this),stop:this._resizeStop.bind(this)}),l.length&&l.hasClass("fl-lightbox-width-full")?(i.addClass("fl-lightbox-width-full"),i.draggable("disable")):this._restorePosition()):t.show(),this._resize()},_delayedResize:function(){clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(this._resize.bind(this),250)},_resize:function(){var t=this._node.find(".fl-lightbox"),i=parseInt(this._node.css("padding-top")),l=parseInt(this._node.css("padding-bottom")),o=parseInt(this._node.css("padding-left")),s=parseInt(this._node.css("padding-right")),n=t.height(),r=t.width(),a=e(window),d=a.height()-i-l,u=(a.width()-o-s,"0px");this._defaults.resizable?(r<600?t.addClass("fl-lightbox-width-slim"):t.removeClass("fl-lightbox-width-slim"),r<450?t.addClass("fl-lightbox-width-micro"):t.removeClass("fl-lightbox-width-micro"),this._resizeEditors()):(d>n&&(u=(d-n-46)/2+"px"),t.attr("style","").css("margin",u+" auto 0")),this.trigger("resized")},_resizeStart:function(){e("body").addClass("fl-builder-resizable-is-resizing"),e(".fl-builder-lightbox:visible").append('<div class="fl-builder-resizable-iframe-fix"></div>'),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays()},_resizeStop:function(t,i){var l=e(".fl-lightbox-resizable:visible");parseInt(l.css("top"))<0&&l.css("top","0"),this._savePosition(),e("body").removeClass("fl-builder-resizable-is-resizing"),e(".fl-builder-resizable-iframe-fix").remove(),FLBuilder._bindOverlayEvents()},_resizeClicked:function(){var t=e(".fl-lightbox-resizable"),i=(t.find(".fl-lightbox-resize-toggle"),this._node.find(".fl-lightbox"));i.hasClass("fl-lightbox-width-full")?this._resizeExitFull():this._resizeEnterFull(),this._resize()},_resizeEnterFull:function(){var t=e(".fl-lightbox-resizable"),i=t.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");i.removeClass("fa-window-maximize").addClass("fa-window-minimize"),t.addClass("fl-lightbox-width-full"),t.draggable("disable"),t.resizable("disable")},_resizeExitFull:function(){var t=e(".fl-lightbox-resizable"),i=t.find(".fl-lightbox-resize-toggle");this._node.find(".fl-lightbox");i.removeClass("fa-window-minimize").addClass("fa-window-maximize"),t.removeClass("fl-lightbox-width-full"),t.draggable("enable"),t.resizable("enable")},_resizeEditors:function(){e(".fl-lightbox-resizable").each(function(){var t=e(this),i=t.find(".fl-builder-settings-fields").height(),l=t.find(".mce-edit-area > iframe, textarea.wp-editor-area, .ace_editor"),o=null;i<350&&(i=350),l.each(function(){o=e(this),o.hasClass("ace_editor")?(o.height(i-60),o.closest(".fl-field").data("editor").resize()):o.closest(".mce-container-body").find(".mce-toolbar-grp .mce-toolbar.mce-last").is(":visible")?o.height(i-175):o.height(i-150)})})},_savePosition:function(){var e=this._node.find(".fl-lightbox"),t={width:e.width(),height:e.height(),top:parseInt(e.css("top"))<0?"0px":e.css("top"),left:e.css("left")};e.closest(".fl-builder-ui-pinned").length||(FLBuilderConfig.userSettings.lightbox=t,FLBuilder.ajax({action:"save_lightbox_position",
2
  data:t}))},_restorePosition:function(){var e=this._node.find(".fl-lightbox"),t=this._getPositionSettings();t?e.css(t):e.css({top:25,left:FLBuilderConfig.isRtl?"-25":25})},_getPositionSettings:function(){var t=FLBuilderConfig.userSettings.lightbox;if(!t)return!1;var i=e(window).height(),l=parseInt(t.height);return l>i&&i>546&&(t.height=i-50,t.top=0),t}}}(jQuery),function(e){FLIconSelector={_content:null,_lightbox:null,_rendered:!1,_filterText:"",open:function(e){FLIconSelector._rendered||FLIconSelector._render(),null===FLIconSelector._content?(FLIconSelector._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),FLBuilder.ajax({action:"render_icon_selector"},FLIconSelector._getContentComplete)):FLIconSelector._lightbox.open(),FLIconSelector._lightbox.on("icon-selected",function(t,i){FLIconSelector._lightbox.off("icon-selected"),FLIconSelector._lightbox.close(),e(i)})},_render:function(){FLIconSelector._lightbox=new FLLightbox({className:"fl-icon-selector"}),FLIconSelector._rendered=!0,FLBuilder.addHook("endEditingSession",function(){FLIconSelector._lightbox.close()})},_getContentComplete:function(t){var i=JSON.parse(t);FLIconSelector._content=i.html,FLIconSelector._lightbox.setContent(i.html),e(".fl-icons-filter-select").on("change",FLIconSelector._filter),e(".fl-icons-filter-text").on("keyup",FLIconSelector._filter),e(".fl-icons-list i").on("click",FLIconSelector._select),e(".fl-icon-selector-cancel").on("click",e.proxy(FLIconSelector._lightbox.close,FLIconSelector._lightbox))},_filter:function(){var t=e(".fl-icons-filter-select").val(),i=e(".fl-icons-filter-text").val();"all"==t?e(".fl-icons-section").show():(e(".fl-icons-section").hide(),e(".fl-"+t).show()),FLIconSelector._filterText=i,""!==i?e(".fl-icons-list i").each(FLIconSelector._filterIcon):e(".fl-icons-list i").show()},_filterIcon:function(){var t=e(this);-1==t.attr("class").indexOf(FLIconSelector._filterText)?t.hide():t.show()},_select:function(){var t=e(this).attr("class");FLIconSelector._lightbox.trigger("icon-selected",t)}}}(jQuery),function(e){FLStyleSheet=function(t){"object"==typeof t&&e.extend(this,t),this._createSheet()},FLStyleSheet.prototype={id:null,_sheet:null,_sheetElement:null,updateRule:function(e,t,i){for(var l=this._sheet.cssRules?this._sheet.cssRules:this._sheet.rules,o=null,s=0;s<l.length;s++)l[s].selectorText.toLowerCase()==e.toLowerCase()&&(o=l[s]);if(o)if("object"==typeof t)for(s in t)o.style[this._toCamelCase(s)]=t[s];else o.style[this._toCamelCase(t)]=i;else this.addRule(e,t,i)},addRule:function(e,t,i){var l="",o="";if("object"==typeof t)for(o in t)l+=o+":"+t[o]+";";else l=t+":"+i+";";this._sheet.insertRule?this._sheet.insertRule(e+" { "+l+" }",this._sheet.cssRules.length):this._sheet.addRule(e,l)},destroy:function(){this._sheetElement&&(this._sheetElement.remove(),this._sheetElement=null),this._sheet&&(this._sheet=null)},disable:function(){this._sheet.disabled=!0},enable:function(){this._sheet.disabled=!1},_createSheet:function(){var t=this.id?' id="'+this.id+'"':"",i=this.className?' class="'+this.className+'"':"";this._sheet||(this._sheetElement=e('<style type="text/css"'+t+i+"></style>"),e("body").append(this._sheetElement),this._sheet=this._sheetElement[0].sheet)},_toCamelCase:function(e){return e.toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()})}}}(jQuery),function(e){FLBuilder={preview:null,_actionsLightbox:null,_addModuleAfterNodeRender:null,_colResizeData:null,_colResizing:!1,_contentClass:!1,_dragEnabled:!1,_dragging:!1,_dragInitialScrollTop:0,_exitUrl:null,_layout:null,_layoutSettingsCSSCache:null,_layoutSettingsCSSTimeout:null,_lightbox:null,_lightboxScrollbarTimeout:null,_loadedModuleAssets:[],_moduleHelpers:{},_multiplePhotoSelector:null,_newColParent:null,_newColPosition:0,_newColGroupParent:null,_newColGroupPosition:0,_newModuleParent:null,_newModulePosition:0,_newRowPosition:0,_selectedTemplateId:null,_selectedTemplateType:null,_singlePhotoSelector:null,_singleVideoSelector:null,_multipleAudiosSelector:null,_init:function(){FLBuilder._initJQueryReadyFix(),FLBuilder._initGlobalErrorHandling(),FLBuilder._initPostLock(),FLBuilder._initClassNames(),FLBuilder._initMediaUploader(),FLBuilder._initOverflowFix(),FLBuilder._initScrollbars(),FLBuilder._initLightboxes(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._initStrings(),FLBuilder._initTipTips(),FLBuilder._initTinyMCE(),FLBuilder._bindEvents(),FLBuilder._bindOverlayEvents(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder.addHook("didInitUI",FLBuilder._showTourOrTemplates.bind(FLBuilder)),FLBuilder.triggerHook("init")},_initJQueryReadyFix:function(){FLBuilderConfig.debug||(jQuery.fn.oldReady=jQuery.fn.ready,jQuery.fn.ready=function(t){return jQuery.fn.oldReady(function(){try{"function"==typeof t&&t(e)}catch(i){FLBuilder.logError(i)}})})},_initGlobalErrorHandling:function(){FLBuilderConfig.debug||(window.onerror=function(e,t,i,l,o){return FLBuilder.logGlobalError(e,t,i,l,o),!0})},_initPostLock:function(){"undefined"!=typeof wp.heartbeat&&(wp.heartbeat.interval(30),wp.heartbeat.enqueue("fl_builder_post_lock",{post_id:FLBuilderConfig.postId}))},_initClassNames:function(){e("html").addClass("fl-builder-edit"),e("body").addClass("fl-builder"),FLBuilderConfig.simpleUi&&e("body").addClass("fl-builder-simple"),FLBuilder._contentClass=".fl-builder-content-"+FLBuilderConfig.postId,e(FLBuilder._contentClass).addClass("fl-builder-content-editing")},_initMediaUploader:function(){wp.media.model.settings.post.id=FLBuilderConfig.postId},_initOverflowFix:function(){e(FLBuilder._contentClass).parents().css("overflow","visible")},_initScrollbars:function(){e(".fl-nanoscroller").nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"})},_initSortables:function(){var t={appendTo:"body",cursor:"move",cursorAt:{left:85,top:20},distance:1,helper:FLBuilder._blockDragHelper,start:FLBuilder._blockDragStart,sort:FLBuilder._blockDragSort,change:FLBuilder._blockDragChange,stop:FLBuilder._blockDragStop,placeholder:"fl-builder-drop-zone",tolerance:"intersect"},i="",l="",o="";o="row"==FLBuilderConfig.userTemplateType||"column"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-col-content":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target, "+FLBuilder._contentClass+" .fl-col:not(.fl-node-global) .fl-col-content",l="row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target",i=FLBuilderConfig.nestedColumns?o:"row"==FLBuilderConfig.userTemplateType?FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target":FLBuilder._contentClass+" .fl-row-drop-target, "+FLBuilder._contentClass+" .fl-col-group-drop-target, "+FLBuilder._contentClass+" .fl-col-drop-target",e(".fl-builder-rows").sortable(e.extend({},t,{connectWith:i,items:".fl-builder-block-row",stop:FLBuilder._rowDragStop})),e(".fl-builder-row-templates").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-row-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-rows").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:FLBuilder._contentClass+" .fl-row-drop-target",items:".fl-builder-block-saved-row",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-columns").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:l,items:".fl-builder-block-saved-column",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-modules, .fl-builder-widgets").sortable(e.extend({},t,{connectWith:o,items:".fl-builder-block-module",stop:FLBuilder._moduleDragStop})),e(".fl-builder-module-templates").sortable(e.extend({},t,{connectWith:o,items:".fl-builder-block-module-template",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-builder-saved-modules").sortable(e.extend({},t,{cancel:".fl-builder-node-template-actions, .fl-builder-node-template-edit, .fl-builder-node-template-delete",connectWith:o,items:".fl-builder-block-saved-module",stop:FLBuilder._nodeTemplateDragStop})),e(".fl-row-sortable-proxy").sortable(e.extend({},t,{connectWith:FLBuilder._contentClass+" .fl-row-drop-target",helper:FLBuilder._rowDragHelper,start:FLBuilder._rowDragStart,stop:FLBuilder._rowDragStop})),e(".fl-col-sortable-proxy").sortable(e.extend({},t,{connectWith:o,helper:FLBuilder._colDragHelper,start:FLBuilder._colDragStart,stop:FLBuilder._colDragStop})),e(FLBuilder._contentClass+" .fl-col-content").sortable(e.extend({},t,{connectWith:o,handle:".fl-module-overlay .fl-block-overlay-actions .fl-block-move",helper:FLBuilder._moduleDragHelper,items:".fl-module, .fl-col-group",start:FLBuilder._moduleDragStart,stop:FLBuilder._moduleDragStop})),e(FLBuilder._contentClass+" .fl-row-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-group-drop-target").sortable(t),e(FLBuilder._contentClass+" .fl-col-drop-target").sortable(t)},_initStrings:function(){e.validator.messages.required=FLBuilderStrings.validateRequiredMessage},_bindEvents:function(){$excludedLinks=e(".fl-builder-bar a, .fl-builder--content-library-panel a, .fl-page-nav .nav a"),e("a").not($excludedLinks).on("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),e("body").delegate(".fl-builder-content a","click",FLBuilder._preventDefault),e("body").delegate("button.fl-builder-button","mouseup",this._buttonMouseUp.bind(this)),e(document).on("heartbeat-tick",FLBuilder._initPostLock),e(window).on("beforeunload",FLBuilder._warnBeforeUnload),e("body").delegate(".fl-builder-has-submenu","click",FLBuilder._submenuParentClicked),e("body").delegate(".fl-builder-has-submenu a","click",FLBuilder._submenuChildClicked),e("body").delegate(".fl-builder-submenu","mouseenter",FLBuilder._submenuMouseenter),e("body").delegate(".fl-builder-submenu","mouseleave",FLBuilder._submenuMouseleave),e("body").delegate(".fl-builder-submenu .fl-builder-has-submenu","mouseenter",FLBuilder._submenuNestedParentMouseenter),e(".fl-builder-panel-actions .fl-builder-panel-close").on("click",FLBuilder._closePanel),e(".fl-builder-blocks-section-title").on("click",FLBuilder._blockSectionTitleClicked),e("body").delegate(".fl-builder-node-template-actions","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-delete","mousedown",FLBuilder._stopPropagation),e("body").delegate(".fl-builder-node-template-edit","click",FLBuilder._editNodeTemplateClicked),e("body").delegate(".fl-builder-node-template-delete","click",FLBuilder._deleteNodeTemplateClicked),e("body").delegate(".fl-builder-block","mousedown",FLBuilder._blockDragInit),e("body").on("mouseup",FLBuilder._blockDragCancel),e("body").delegate(".fl-builder-actions .fl-builder-cancel-button","click",FLBuilder._cancelButtonClicked),e("body").delegate(".fl-builder-save-user-template-button","click",FLBuilder._saveUserTemplateClicked),e("body").delegate(".fl-builder-duplicate-layout-button","click",FLBuilder._duplicateLayoutClicked),e("body").delegate(".fl-builder-layout-settings-button","click",FLBuilder._layoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-save","click",FLBuilder._saveLayoutSettingsClicked),e("body").delegate(".fl-builder-layout-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-builder-global-settings-button","click",FLBuilder._globalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-save","click",FLBuilder._saveGlobalSettingsClicked),e("body").delegate(".fl-builder-global-settings .fl-builder-settings-cancel","click",FLBuilder._cancelLayoutSettingsClicked),e("body").delegate(".fl-user-template","click",FLBuilder._userTemplateClicked),e("body").delegate(".fl-user-template-edit","click",FLBuilder._editUserTemplateClicked),e("body").delegate(".fl-user-template-delete","click",FLBuilder._deleteUserTemplateClicked),e("body").delegate(".fl-builder-template-replace-button","click",FLBuilder._templateReplaceClicked),e("body").delegate(".fl-builder-template-append-button","click",FLBuilder._templateAppendClicked),e("body").delegate(".fl-builder-template-actions .fl-builder-cancel-button","click",FLBuilder._templateCancelClicked),e("body").delegate(".fl-builder-user-template-settings .fl-builder-settings-save","click",FLBuilder._saveUserTemplateSettings),e("body").delegate(".fl-builder-help-tour-button","click",FLBuilder._startHelpTour),e("body").delegate(".fl-builder-knowledge-base-button","click",FLBuilder._viewKnowledgeBaseClicked),e("body").delegate(".fl-builder-forums-button","click",FLBuilder._visitForumsClicked),e("body").delegate(".fl-builder-no-tour-button","click",FLBuilder._noTourButtonClicked),e("body").delegate(".fl-builder-yes-tour-button","click",FLBuilder._yesTourButtonClicked),e("body").delegate(".fl-builder-alert-close","click",FLBuilder._alertClose),e("body").delegate(".fl-block-overlay","contextmenu",FLBuilder._onContextmenu),e("body").delegate(".fl-row-overlay .fl-block-remove","click",FLBuilder._deleteRowClicked),e("body").delegate(".fl-row-overlay .fl-block-copy","click",FLBuilder._rowCopyClicked),e("body").delegate(".fl-row-overlay .fl-block-move","mousedown",FLBuilder._rowDragInit),e("body").delegate(".fl-row-overlay .fl-block-settings","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-row-overlay","click",FLBuilder._rowSettingsClicked),e("body").delegate(".fl-builder-row-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-block-col-submenu .fl-block-row-reset","click",FLBuilder._resetRowWidthClicked),e("body").delegate(".fl-col-overlay .fl-block-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-copy","click",FLBuilder._copyColClicked),e("body").delegate(".fl-col-overlay .fl-block-remove","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-col-overlay .fl-block-settings","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-col-overlay","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-col-settings .fl-builder-settings-save","click",FLBuilder._saveSettings),e("body").delegate(".fl-block-col-submenu .fl-block-col-move","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-delete","click",FLBuilder._deleteColClicked),e("body").delegate(".fl-block-col-submenu .fl-block-col-reset","click",FLBuilder._resetColumnWidthsClicked),e("body").delegate(".fl-block-col-submenu li","mouseenter",FLBuilder._showColHighlightGuide),e("body").delegate(".fl-block-col-submenu li","mouseleave",FLBuilder._removeColHighlightGuides),e("body").delegate(".fl-block-col-submenu .fl-block-col-move-parent","mousedown",FLBuilder._colDragInit),e("body").delegate(".fl-block-col-submenu .fl-block-col-edit-parent","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-module-overlay .fl-block-remove","click",FLBuilder._deleteModuleClicked),e("body").delegate(".fl-module-overlay .fl-block-copy","click",FLBuilder._moduleCopyClicked),e("body").delegate(".fl-module-overlay .fl-block-move","mousedown",FLBuilder._blockDragInit),e("body").delegate(".fl-module-overlay .fl-block-settings","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-module-overlay","click",FLBuilder._moduleSettingsClicked),e("body").delegate(".fl-builder-module-settings .fl-builder-settings-save","click",FLBuilder._saveModuleClicked),e("body").delegate(".fl-module-overlay .fl-block-col-settings","click",FLBuilder._colSettingsClicked),e("body").delegate(".fl-builder-settings-save-as","click",FLBuilder._showNodeTemplateSettings),e("body").delegate(".fl-builder-node-template-settings .fl-builder-settings-save","click",FLBuilder._saveNodeTemplate),e("body").delegate(".fl-builder-settings-tabs a","click",FLBuilder._settingsTabClicked),e("body").delegate(".fl-builder-settings-tabs a","show",FLBuilder._calculateSettingsTabsOverflow),e("body").delegate(".fl-builder-settings-tabs a","hide",FLBuilder._calculateSettingsTabsOverflow),e("body").delegate(".fl-builder-settings-cancel","click",FLBuilder._settingsCancelClicked),e("body").delegate(".fl-builder-settings-tabs-overflow-menu > a","click",FLBuilder._settingsTabsToOverflowMenuItemClicked.bind(this)),e("body").delegate(".fl-builder-settings-tabs-more","click",FLBuilder._toggleTabsOverflowMenu.bind(this)),e("body").delegate(".fl-builder-settings-tabs-overflow-click-mask","click",FLBuilder._hideTabsOverflowMenu.bind(this)),e("body").delegate(".fl-help-tooltip-icon","mouseover",FLBuilder._showHelpTooltip),e("body").delegate(".fl-help-tooltip-icon","mouseout",FLBuilder._hideHelpTooltip),e("body").delegate(".fl-builder-field-add","click",FLBuilder._addFieldClicked),e("body").delegate(".fl-builder-field-copy","click",FLBuilder._copyFieldClicked),e("body").delegate(".fl-builder-field-delete","click",FLBuilder._deleteFieldClicked),e("body").delegate(".fl-builder-settings-fields select","change",FLBuilder._settingsSelectChanged),e("body").delegate(".fl-photo-field .fl-photo-select","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-edit","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-replace","click",FLBuilder._selectSinglePhoto),e("body").delegate(".fl-photo-field .fl-photo-remove","click",FLBuilder._singlePhotoRemoved),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-select","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-edit","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-multiple-photos-field .fl-multiple-photos-add","click",FLBuilder._selectMultiplePhotos),e("body").delegate(".fl-video-field .fl-video-select","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-video-field .fl-video-replace","click",FLBuilder._selectSingleVideo),e("body").delegate(".fl-video-field .fl-video-remove","click",FLBuilder._singleVideoRemoved),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-select","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-edit","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-multiple-audios-field .fl-multiple-audios-add","click",FLBuilder._selectMultipleAudios),e("body").delegate(".fl-icon-field .fl-icon-select","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-replace","click",FLBuilder._selectIcon),e("body").delegate(".fl-icon-field .fl-icon-remove","click",FLBuilder._removeIcon),e("body").delegate(".fl-form-field .fl-form-field-edit","click",FLBuilder._formFieldClicked),e("body").delegate(".fl-form-field-settings .fl-builder-settings-save","click",FLBuilder._saveFormFieldClicked),e("body").delegate(".fl-layout-field-option","click",FLBuilder._layoutFieldClicked),e("body").delegate(".fl-link-field-select","click",FLBuilder._linkFieldSelectClicked),e("body").delegate(".fl-link-field-search-cancel","click",FLBuilder._linkFieldSelectCancelClicked),e("body").delegate(".fl-loop-data-source-select select[name=data_source]","change",FLBuilder._loopDataSourceChange),e("body").delegate(".fl-custom-query select[name=post_type]","change",FLBuilder._customQueryPostTypeChange),e("body").delegate(".fl-text-field-add-value","change",FLBuilder._textFieldAddValueSelectChange),e("body").delegate(".fl-field input[type=number]","focus",FLBuilder._onNumberFieldFocus),e("body").delegate(".fl-field input[type=number]","blur",FLBuilder._onNumberFieldBlur),FLBuilder.addHook("didCompleteAJAX",FLBuilder._refreshSettingsPreviewReference),FLBuilder.addHook("didRenderLayoutComplete",FLBuilder._refreshSettingsPreviewReference)},_unbindEvents:function(){e("a").off("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").off("click",FLBuilder._headerLinkClicked),e("body").undelegate(".fl-builder-content a","click",FLBuilder._preventDefault)},_rebindEvents:function(){e("a").on("click",FLBuilder._preventDefault),e(".fl-page-nav .nav a").on("click",FLBuilder._headerLinkClicked),e("body").delegate(".fl-builder-content a","click",FLBuilder._preventDefault)},_bindOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.delegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.delegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.delegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.delegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.delegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.delegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_destroyOverlayEvents:function(){var t=e(FLBuilder._contentClass);t.undelegate(".fl-row","mouseenter",FLBuilder._rowMouseenter),t.undelegate(".fl-row","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-row-overlay","mouseleave",FLBuilder._rowMouseleave),t.undelegate(".fl-col","mouseenter",FLBuilder._colMouseenter),t.undelegate(".fl-col","mouseleave",FLBuilder._colMouseleave),t.undelegate(".fl-module","mouseenter",FLBuilder._moduleMouseenter),t.undelegate(".fl-module","mouseleave",FLBuilder._moduleMouseleave)},_onContextmenu:function(t){e(this).hide()},_preventDefault:function(e){e.preventDefault()},_stopPropagation:function(e){e.stopPropagation()},_headerLinkClicked:function(t){var i=e(this),l=i.attr("href");this.hash||(t.preventDefault(),FLBuilderConfig.isUserTemplate||(FLBuilder._exitUrl=l.indexOf("?")>-1?l:l+"?fl_builder",FLBuilder.triggerHook("triggerDone")))},_warnBeforeUnload:function(){var t=e(".fl-builder-row-settings").length>0,i=e(".fl-builder-col-settings").length>0,l=e(".fl-builder-module-settings").length>0;if(t||i||l)return FLBuilderStrings.unloadWarning},_initTipTips:function(){e(".fl-tip:not(.fl-has-tip)").each(function(){var t=e(this);t.addClass("fl-has-tip"),void 0==t.attr("data-title")&&t.attr("data-title",t.attr("title"))}).tipTip({defaultPosition:"top",delay:1e3})},_hideTipTips:function(){e("#tiptip_holder").stop().hide()},_submenuParentClicked:function(t){var i=e("body"),l=e(this),o=l.find(".fl-builder-submenu");l.hasClass("fl-builder-submenu-open")?(i.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-right")):(l.offset().left+o.width()>e(window).width()&&l.addClass("fl-builder-submenu-right"),i.addClass("fl-builder-submenu-open"),l.addClass("fl-builder-submenu-open")),o.closest(".fl-row-overlay").addClass("fl-row-menu-active"),FLBuilder._hideTipTips(),t.preventDefault(),t.stopPropagation()},_submenuChildClicked:function(t){var i=e("body"),l=e(this).parents(".fl-builder-has-submenu");l.parents(".fl-builder-has-submenu").length||(i.removeClass("fl-builder-submenu-open"),l.removeClass("fl-builder-submenu-open"))},_submenuMouseenter:function(t){var i=e(this),l=i.data("timeout");"undefined"!=typeof l&&clearTimeout(l)},_submenuMouseleave:function(t){var i=e("body"),l=e(this),o=setTimeout(function(){i.removeClass("fl-builder-submenu-open"),l.closest(".fl-builder-has-submenu").removeClass("fl-builder-submenu-open")},500);l.closest(".fl-row-overlay").removeClass("fl-row-menu-active"),l.data("timeout",o)},_submenuNestedParentMouseenter:function(t){var i=e(this),l=i.find(".fl-builder-submenu");i.width()+i.offset().left+l.width()>e(window).width()&&i.addClass("fl-builder-submenu-right")},_closeAllSubmenus:function(){e(".fl-builder-submenu-open").removeClass("fl-builder-submenu-open")},_upgradeClicked:function(){window.open(FLBuilderConfig.upgradeUrl)},_buttonMouseUp:function(t){e(t.currentTarget).blur()},_closePanel:function(){FLBuilder.triggerHook("hideContentPanel")},_showPanel:function(){FLBuilder.triggerHook("showContentPanel")},_togglePanel:function(){FLBuilder.triggerHook("toggleContentPanel")},_blockSectionTitleClicked:function(){var t=e(this),i=t.parent();i.hasClass("fl-active")?i.removeClass("fl-active"):(e(".fl-builder-blocks-section").removeClass("fl-active"),i.addClass("fl-active")),FLBuilder._initScrollbars()},_publishLayout:function(e){if(FLBuilder._triggerSettingsSave(!1,!0)){if(_.isUndefined(e))var e=!0;FLBuilder.ajax({action:"save_layout"},this._onPublishComplete.bind(this,e))}},_publishButtonClicked:function(e){FLBuilder._publishLayout(e)},_onPublishComplete:function(t){t&&(FLBuilderConfig.shouldRefreshOnPublish?FLBuilder._exit():FLBuilder._exitWithoutRefresh()),e("#wp-admin-bar-fl-builder-frontend-edit-link .fl-builder-admin-bar-status-dot").css("color","#6bc373"),FLBuilder.triggerHook("didPublishLayout")},_draftButtonClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"save_draft"},FLBuilder._exit)},_discardButtonClicked:function(){var e=confirm(FLBuilderStrings.discardMessage);e?(FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"clear_draft_layout"},FLBuilder._exit)):FLBuilder.triggerHook("didCancelDiscard")},_cancelButtonClicked:function(){FLBuilder._exitUrl=null,FLBuilder._actionsLightbox.close()},_exit:function(){var e=window.location.href;FLBuilderConfig.isUserTemplate&&"undefined"!=typeof window.opener&&window.opener?("undefined"!=typeof window.opener.FLBuilder&&("undefined"==typeof FLBuilderGlobalNodeId?window.opener.FLBuilder._updateLayout():window.opener.FLBuilder._updateNode(FLBuilderGlobalNodeId)),window.close()):(FLBuilder._exitUrl?e=FLBuilder._exitUrl:(e=e.replace("?fl_builder&","?"),e=e.replace("?fl_builder",""),e=e.replace("&fl_builder","")),window.location.href=e)},_exitWithoutRefresh:function(){window.location.href;FLBuilderConfig.isUserTemplate&&"undefined"!=typeof window.opener&&window.opener?("undefined"!=typeof window.opener.FLBuilder&&("undefined"==typeof FLBuilderGlobalNodeId?window.opener.FLBuilder._updateLayout():window.opener.FLBuilder._updateNode(FLBuilderGlobalNodeId)),window.close()):FLBuilder.triggerHook("endEditingSession")},_duplicateLayoutClicked:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"duplicate_post"},FLBuilder._duplicateLayoutComplete)},_duplicateLayoutComplete:function(e){var t=FLBuilderConfig.adminUrl;window.location.href=t+"post.php?post="+e+"&action=edit"},_layoutSettingsClicked:function(){FLBuilderSettingsForms.render({id:"layout",className:"fl-builder-layout-settings",settings:FLBuilderSettingsConfig.settings.layout},function(){FLBuilder._layoutSettingsInitCSS()})},_layoutSettingsInitCSS:function(){var t=e(".fl-builder-settings #fl-field-css textarea:not(.ace_text-input)");t.on("change",FLBuilder._layoutSettingsCSSChanged),FLBuilder._layoutSettingsCSSCache=t.val()},_layoutSettingsCSSChanged:function(){FLBuilder._layoutSettingsCSSTimeout&&clearTimeout(FLBuilder._layoutSettingsCSSTimeout),FLBuilder._layoutSettingsCSSTimeout=setTimeout(e.proxy(FLBuilder._layoutSettingsCSSDoChange,this),600)},_layoutSettingsCSSDoChange:function(){var t=e(".fl-builder-settings"),i=e(this),l=i.parents("#fl-field-css");l.find(".ace_error").length>0||(t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(i.val()):e("#fl-builder-global-css").html(i.val()),FLBuilder._layoutSettingsCSSTimeout=null)},_saveLayoutSettingsClicked:function(){for(var t=e(this).closest(".fl-builder-settings"),i=t.serializeArray(),l={},o=0;o<i.length;o++)l[i[o].name]=i[o].value;FLBuilder.showAjaxLoader(),FLBuilder._lightbox.close(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_layout_settings",settings:l},function(){FLBuilder.triggerHook("didSaveLayoutSettingsComplete",l),FLBuilder._updateLayout()})},_cancelLayoutSettingsClicked:function(){var t=e(".fl-builder-settings");t.hasClass("fl-builder-layout-settings")?e("#fl-builder-layout-css").html(FLBuilder._layoutSettingsCSSCache):e("#fl-builder-global-css").html(FLBuilder._layoutSettingsCSSCache),FLBuilder._layoutSettingsCSSCache=null},_globalSettingsClicked:function(){FLBuilderSettingsForms.render({id:"global",className:"fl-builder-global-settings",settings:FLBuilderSettingsConfig.settings.global},function(){FLBuilder._layoutSettingsInitCSS()})},_saveGlobalSettingsClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=t.validate().form(),l=FLBuilder._getSettings(t);i&&(FLBuilder.showAjaxLoader(),FLBuilder._layoutSettingsCSSCache=null,FLBuilder.ajax({action:"save_global_settings",settings:l},FLBuilder._saveGlobalSettingsComplete),FLBuilder._lightbox.close())},_saveGlobalSettingsComplete:function(e){FLBuilderConfig.global=JSON.parse(e),FLBuilder.triggerHook("didSaveGlobalSettingsComplete",FLBuilderConfig.global),FLBuilder._updateLayout()},_initTemplateSelector:function(){var t=e(FLBuilder._contentClass).find(".fl-row"),i=t.length>0;i||FLBuilder.ContentPanel.show("modules")},_requestTemplateInsert:function(e,t){FLBuilder.layoutHasContent()?0==e?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),FLBuilder._applyTemplate(0,!1,t)):(FLBuilder._selectedTemplateId=e,FLBuilder._selectedTemplateType=t,FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(e,!1,t)},_showTemplateActions:function(){var e=[];e[10]={key:"template-replace",label:FLBuilderStrings.templateReplace},e[20]={key:"template-append",label:FLBuilderStrings.templateAppend},FLBuilder._showActionsLightbox({className:"fl-builder-template-actions",title:FLBuilderStrings.actionsLightboxTitle,buttons:e})},_templateReplaceClicked:function(){confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!1,FLBuilder._selectedTemplateType))},_templateAppendClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._applyTemplate(FLBuilder._selectedTemplateId,!0,FLBuilder._selectedTemplateType)},_templateCancelClicked:function(){FLBuilder.triggerHook("showContentPanel")},_applyTemplate:function(e,t,i){t="undefined"!=typeof t&&t?"1":"0",i="undefined"==typeof i?"core":i,FLBuilder._lightbox.close(),FLBuilder.showAjaxLoader(),"core"==i?FLBuilder.ajax({action:"apply_template",template_id:e,append:t},FLBuilder._applyTemplateComplete):FLBuilder.ajax({action:"apply_user_template",template_id:e,append:t},FLBuilder._applyUserTemplateComplete),FLBuilder.triggerHook("didApplyTemplate")},_applyTemplateComplete:function(e){var t=JSON.parse(e);FLBuilder._renderLayout(t.layout),FLBuilder.triggerHook("didApplyTemplateComplete",t.config)},_applyUserTemplateComplete:function(t){var i=JSON.parse(t);null!==i.layout_css&&e("#fl-builder-layout-css").html(i.layout_css),FLBuilder._renderLayout(i.layout),FLBuilder.triggerHook("didApplyTemplateComplete",i.config)},_saveUserTemplateClicked:function(){FLBuilderSettingsForms.render({id:"user_template",className:"fl-builder-user-template-settings",rules:{name:{required:!0}}})},_saveUserTemplateSettings:function(){var t=e(this).closest(".fl-builder-settings"),i=t.validate().form(),l=FLBuilder._getSettings(t);i&&(FLBuilder.ajax({action:"save_user_template",settings:l},FLBuilder._saveUserTemplateSettingsComplete),FLBuilder._lightbox.close())},_saveUserTemplateSettingsComplete:function(e){if(e){var e=JSON.parse(e);FLBuilderConfig.contentItems.template.push(e),FLBuilder.triggerHook("contentItemsChanged")}},_userTemplateClicked:function(){var t=e(this).attr("data-id");e(FLBuilder._contentClass).children(".fl-row").length>0?"blank"==t?confirm(FLBuilderStrings.changeTemplateMessage)&&(FLBuilder._lightbox._node.hide(),
3
  FLBuilder._applyTemplate("blank",!1,"user")):(FLBuilder._selectedTemplateId=t,FLBuilder._selectedTemplateType="user",FLBuilder._showTemplateActions(),FLBuilder._lightbox._node.hide()):FLBuilder._applyTemplate(t,!1,"user")},_editUserTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteUserTemplateClicked:function(t){var i=e(this).closest(".fl-user-template"),l=i.attr("data-id"),o=(e(".fl-user-template[data-id="+l+"]"),null),s=null,n=null;if(confirm(FLBuilderStrings.deleteTemplate)){FLBuilder.ajax({action:"delete_user_template",template_id:l});for(s in FLBuilderConfig.contentItems.template)n=FLBuilderConfig.contentItems.template[s],n.postId==l&&(o=s);_.isNull(o)||(FLBuilderConfig.contentItems.template.splice(o,1),FLBuilder.triggerHook("contentItemsChanged"))}t.stopPropagation()},_viewKnowledgeBaseClicked:function(){window.open(FLBuilderConfig.help.knowledge_base_url)},_visitForumsClicked:function(){window.open(FLBuilderConfig.help.forums_url)},_showTourOrTemplates:function(){FLBuilderConfig.simpleUi||FLBuilderConfig.isUserTemplate||(FLBuilderConfig.help.tour&&FLBuilderConfig.newUser?FLBuilder._showTourLightbox():FLBuilder._initTemplateSelector())},_showTourLightbox:function(){var e=wp.template("fl-tour-lightbox");FLBuilder._actionsLightbox.open(e())},_noTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilder._initTemplateSelector()},_yesTourButtonClicked:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_startHelpTour:function(){FLBuilder._actionsLightbox.close(),FLBuilderTour.start()},_setupEmptyLayout:function(){var t=e(FLBuilder._contentClass);FLBuilderConfig.isUserTemplate&&"module"==FLBuilderConfig.userTemplateType||FLBuilderConfig.isUserTemplate&&"column"==FLBuilderConfig.userTemplateType||(t.removeClass("fl-builder-empty"),t.find(".fl-builder-empty-message").remove(),t.find(".fl-row, .fl-builder-block").length||(t.addClass("fl-builder-empty"),t.append('<span class="fl-builder-empty-message">'+FLBuilderStrings.emptyMessage+"</span>"),FLBuilder._initSortables()))},_updateNode:function(t,i){e(".fl-node-"+t).length&&(FLBuilder._showNodeLoading(t),FLBuilder.ajax({action:"render_node",node_id:t},function(e){FLBuilder._renderLayout(JSON.parse(e),i)}.bind(this)))},_updateLayout:function(){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"render_layout"},FLBuilder._renderLayout)},_renderLayout:function(e,t){FLBuilder._layout=new FLBuilderAJAXLayout(e,t)},_renderLayoutComplete:function(){FLBuilder._layout&&(FLBuilder._layout._complete(),FLBuilder._layout=null)},_resizeLayout:function(){e(window).trigger("resize"),"undefined"!=typeof YUI&&YUI().use("node-event-simulate",function(e){e.one(window).simulate("resize")})},layoutHasContent:function(){return e(FLBuilder._contentClass).children(".fl-row").length>0},_initMediaElements:function(){var t={};"undefined"!=typeof e.fn.mediaelementplayer&&("undefined"!=typeof _wpmejsSettings&&(t.pluginPath=_wpmejsSettings.pluginPath),e(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").mediaelementplayer(t))},_initDropTargets:function(){var t="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",l=e(FLBuilder._contentClass+" .fl-row"),o=null,s=e(FLBuilder._contentClass+" .fl-row"+t).find(".fl-col-group"),n=null,r=null,a="column"==FLBuilderConfig.userTemplateType?e(FLBuilder._contentClass+"> .fl-col").eq(0):null;for(i=0,e(".fl-col-drop-target").remove(),e(".fl-col-group-drop-target").remove(),e(".fl-row-drop-target").remove(),e(FLBuilder._contentClass).append('<div class="fl-drop-target fl-row-drop-target"></div>'),l.prepend('<div class="fl-drop-target fl-row-drop-target"></div>'),l.append('<div class="fl-drop-target fl-drop-target-last fl-row-drop-target fl-row-drop-target-last"></div>');i<l.length;i++)o=l.eq(i),0===o.find(".fl-col-group").length&&o.find(".fl-row-content").prepend('<div class="fl-drop-target fl-col-group-drop-target"></div>');for(a&&0===s.length&&(s=a.find(".fl-col-group"),a.append('<div class="fl-drop-target fl-col-drop-target"></div>'),a.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')),i=0;i<s.length;i++)n=s.eq(i),r=n.find("> .fl-col"),n.hasClass("fl-col-group-nested")||(n.append('<div class="fl-drop-target fl-col-group-drop-target"></div>'),n.append('<div class="fl-drop-target fl-drop-target-last fl-col-group-drop-target fl-col-group-drop-target-last"></div>')),r.append('<div class="fl-drop-target fl-col-drop-target"></div>'),r.append('<div class="fl-drop-target fl-drop-target-last fl-col-drop-target fl-col-drop-target-last"></div>')},_blockDragHelper:function(e,t){var i=t.clone();return t.clone().insertAfter(t),i.addClass("fl-builder-block-drag-helper"),i},_blockDragInit:function(t){var i=e(t.currentTarget),l=null,o=e(window).scrollTop(),s=0;FLBuilder._dragEnabled=!0,FLBuilder._dragInitialScrollTop=o,i.closest("[data-node]").length>0?(l=i.closest("[data-node]"),l.addClass("fl-node-drag-init")):i.hasClass("fl-builder-block")&&e(".fl-row").each(function(){null===l&&e(this).offset().top-o>0&&(l=e(this))}),null!==l&&(s=l.offset().top-o),FLBuilder._highlightRowsAndColsForDrag(i),FLBuilder._adjustColHeightsForDrag(),FLBuilder._disableGlobalRows(),FLBuilder._disableGlobalCols(),FLBuilder._destroyOverlayEvents(),FLBuilder._removeAllOverlays(),FLBuilder._initSortables(),e("body").addClass("fl-builder-dragging"),e(".fl-builder-empty-message").hide(),e(".fl-sortable-disabled").removeClass("fl-sortable-disabled"),s>0&&scrollTo(0,l.offset().top-s),FLBuilder.triggerHook("didInitDrag")},_blockDragStart:function(t,i){FLBuilder._dragging=!0,e(".fl-node-drag-init").removeClass("fl-node-drag-init"),FLBuilder.triggerHook("didStartDrag")},_blockDragSort:function(t,i){var l=i.placeholder.parent(),o=FLBuilderStrings.insert;FLBuilder._blockPreventSort(i.item,l)||(l.hasClass("fl-col-content")?o=i.item.hasClass("fl-builder-block-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-col-sortable-proxy-item")?FLBuilderStrings.column:i.item.hasClass("fl-builder-block-module")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-module")||i.item.hasClass("fl-builder-block-module-template")?i.item.find(".fl-builder-block-title").text():i.item.attr("data-name"):l.hasClass("fl-col-drop-target")?o="":l.hasClass("fl-col-group-drop-target")?o="":l.hasClass("fl-row-drop-target")&&(o=i.item.hasClass("fl-builder-block-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-row")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-builder-block-saved-column")?i.item.find(".fl-builder-block-title").text():i.item.hasClass("fl-row-sortable-proxy-item")?FLBuilderStrings.row:FLBuilderStrings.newRow),i.placeholder.html(o),i.item.hasClass("fl-node-global")||i.item.hasClass("fl-builder-block-global")||e(".fl-node-dragging").hasClass("fl-node-global")?i.placeholder.addClass("fl-builder-drop-zone-global"):i.placeholder.removeClass("fl-builder-drop-zone-global"))},_blockDragChange:function(e,t){t.placeholder.css("opacity","0"),t.placeholder.animate({opacity:"1"},100)},_blockPreventSort:function(t,i){var l=!1,o=t.hasClass("fl-builder-block-row"),s=t.hasClass("fl-col-sortable-proxy-item"),n=i.hasClass("fl-col-content"),r=i.hasClass("fl-col-drop-target"),a=i.parents(".fl-col-group:not(.fl-col-group-nested)"),d=i.parents(".fl-col-group-nested");return(o||s)&&n&&d.length>0&&(l=!0),n&&!i.find(".fl-module, .fl-col").length&&(o&&"1-col"==t.data("cols")?l=!0:s&&(l=!0)),o&&n&&e.inArray(t.data("cols"),["5-cols","6-cols"])>-1&&(l=!0),s&&e(".fl-node-dragging").find(".fl-col-group-nested").length>0&&(n||r&&d.length>0)&&(l=!0),r&&a.length>0&&0===d.length&&a.find("> .fl-col:visible").length>11&&(l=!0),r&&d.length>0&&d.find(".fl-col:visible").length>3&&(l=!0),l&&i.addClass("fl-sortable-disabled"),l},_blockDragStop:function(t,i){var l=e(window).scrollTop(),o=i.item.parent(),s=null;o.hasClass("fl-drop-target")&&o.closest("[data-node]").length?(o=o.closest("[data-node]"),s=o.offset().top-l):s=o.offset().top-l,o.hasClass("fl-builder-blocks-section-content")&&FLBuilder._showPanel(),FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._enableGlobalCols(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),scrollTo(0,o.offset().top-s),FLBuilder.triggerHook("didStopDrag")},_blockDragCancel:function(){FLBuilder._dragEnabled&&!FLBuilder._dragging&&(FLBuilder._dragEnabled=!1,FLBuilder._dragging=!1,FLBuilder._bindOverlayEvents(),FLBuilder._highlightEmptyCols(),FLBuilder._enableGlobalRows(),FLBuilder._setupEmptyLayout(),e("body").removeClass("fl-builder-dragging"),e(".fl-node-drag-init").removeClass("fl-node-drag-init"),e(".fl-node-dragging").removeClass("fl-node-dragging"),scrollTo(0,FLBuilder._dragInitialScrollTop))},_reorderNode:function(e,t){FLBuilder.ajax({action:"reorder_node",node_id:e,position:t})},_moveNode:function(e,t,i){FLBuilder.ajax({action:"move_node",new_parent:e,node_id:t,position:i})},_removeAllOverlays:function(){FLBuilder._removeRowOverlays(),FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._removeModuleOverlays(),FLBuilder._hideTipTips(),FLBuilder._closeAllSubmenus()},_appendOverlay:function(e,t){var i=0,l=null,o=e.hasClass("fl-row"),s=o?e.find("> .fl-row-content-wrap"):e.find("> .fl-node-content"),n={top:parseInt(s.css("margin-top"),10),bottom:parseInt(s.css("margin-bottom"),10)};return e.append(t),e.addClass("fl-block-overlay-active"),FLBuilder._initTipTips(),l=e.find("> .fl-block-overlay"),n.top<0&&(i=parseInt(l.css("top"),10),i=isNaN(i)?0:i,l.css("top",n.top+i+"px")),n.bottom<0&&(i=parseInt(l.css("bottom"),10),i=isNaN(i)?0:i,l.css("bottom",n.bottom+i+"px")),l},_buildOverlayOverflowMenu:function(e){var t=e.find(".fl-block-overlay-header");for(actions=e.find(".fl-block-overlay-actions"),hasRules=e.find(".fl-block-has-rules"),original=actions.data("original"),actionsWidth=0,items=null,itemsWidth=0,item=null,i=0,visibleItems=[],overflowItems=[],menuData=[],template=wp.template("fl-overlay-overflow-menu"),void 0!=original&&(actions.after(original),actions.remove(),actions=original),actions.data("original",actions.clone()),actionsWidth=Math.floor(actions[0].getBoundingClientRect().width)-8,items=actions.find(" > i, > span.fl-builder-has-submenu"),hasRules.length&&actionsWidth+hasRules.outerWidth()>t.outerWidth()&&(itemsWidth+=hasRules.outerWidth());i<items.length;i++)item=items.eq(i),itemsWidth+=Math.floor(item[0].getBoundingClientRect().width),itemsWidth>actionsWidth?(overflowItems.push(item),item.remove()):visibleItems.push(item);if(overflowItems.length>0){for(visibleItems.length>0&&overflowItems.unshift(visibleItems.pop().remove()),i=0;i<overflowItems.length;i++)overflowItems[i].is(".fl-builder-has-submenu")?menuData.push({type:"submenu",label:overflowItems[i].find(".fa, .fas, .far").data("title"),submenu:overflowItems[i].find(".fl-builder-submenu")[0].outerHTML}):menuData.push({type:"action",label:overflowItems[i].data("title"),className:overflowItems[i].removeClass(function(e,t){return t.replace(/fl-block-([^\s]+)/,"")}).attr("class")});actions.append(template(menuData)),FLBuilder._initTipTips()}},_removeRowOverlays:function(){e(".fl-row").removeClass("fl-block-overlay-active"),e(".fl-row-overlay").remove(),e(".fl-module").removeClass("fl-module-adjust-height"),e("body").removeClass("fl-builder-row-resizing"),FLBuilder._closeAllSubmenus()},_disableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-row.fl-node-global").addClass("fl-node-disabled")},_disableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&e(".fl-row:not(.fl-node-global) .fl-col.fl-node-global").addClass("fl-node-disabled")},_enableGlobalRows:function(){"row"!=FLBuilderConfig.userTemplateType&&e(".fl-node-disabled").removeClass("fl-node-disabled")},_enableGlobalCols:function(){"column"!=FLBuilderConfig.userTemplateType&&e(".fl-node-disabled").removeClass("fl-node-disabled")},_rowMouseenter:function(){var t=e(this),i=t.offset().top,l=null,o=null,s=wp.template("fl-row-overlay");t.closest(".fl-builder-node-loading").length||t.hasClass("fl-block-overlay-active")||(o=FLBuilder._appendOverlay(t,s({node:t.attr("data-node"),global:t.hasClass("fl-node-global"),hasRules:t.hasClass("fl-node-has-rules")})),t.find(".fl-node-content:visible").each(function(){var t=e(this).offset().top;l=null===l||l>t?t:l}),null!==l&&l<i&&o.css("top",l-i-30+"px"),o.offset().top<43&&o.addClass("fl-row-overlay-header-bottom"),t.find(".fl-module").each(function(){var t=e(this);t.outerHeight(!0)<20&&t.addClass("fl-module-adjust-height")}),FLBuilder._buildOverlayOverflowMenu(o))},_rowMouseleave:function(t){var i=e(t.toElement)||e(t.relatedTarget),l=i.hasClass("fl-row-overlay"),o=i.closest(".fl-row-overlay").length>0,s=i.is("#tiptip_holder"),n=i.closest("#tiptip_holder").length>0;l||o||s||n||FLBuilder._removeRowOverlays()},_rowDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.row+"</div>")},_rowDragInit:function(t){var i=e(t.target),l=e(".fl-row-sortable-proxy-item"),o=i.closest(".fl-row");o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),t.target=l[0],l.trigger(t)},_rowDragStart:function(t,i){var l=e(FLBuilder._contentClass+" .fl-row"),o=e(".fl-node-dragging");1===l.length&&e(FLBuilder._contentClass).addClass("fl-builder-empty"),o.hide(),FLBuilder._blockDragStart(t,i)},_rowDragStop:function(t,i){var l=i.item,o=l.parent(),s=null,n=null,r=0;if(FLBuilder._blockDragStop(t,i),o.hasClass("fl-builder-rows"))return void l.remove();if(o.hasClass("fl-row-sortable-proxy"))return void e(".fl-node-dragging").removeClass("fl-node-dragging").show();if(l.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-col-content")?FLBuilder._addColGroup(l.closest(".fl-col").attr("data-node"),l.attr("data-cols"),o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(l)):o.hasClass("fl-col-drop-target")?FLBuilder._addCols(o.closest(".fl-col"),o.hasClass("fl-col-drop-target-last")?"after":"before",l.attr("data-cols"),o.closest(".fl-col-group-nested").length>0):o.hasClass("fl-col-group-drop-target")?(n=l.closest(".fl-col-group"),r=l.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(n),FLBuilder._addColGroup(l.closest(".fl-row").attr("data-node"),l.attr("data-cols"),o.hasClass("fl-drop-target-last")?r+1:r)):(s=l.closest(".fl-row"),r=s.length?e(FLBuilder._contentClass+" > .fl-row").index(s):0,FLBuilder._addRow(l.attr("data-cols"),o.hasClass("fl-drop-target-last")?r+1:r)),l.remove(),FLBuilder._showPanel(),e(".fl-builder-modules").siblings(".fl-builder-blocks-section-title").eq(0).trigger("click")}else s=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o.parent().hasClass("fl-builder-content")||(o.hasClass("fl-drop-target-last")?o.parent().after(s):o.parent().before(s),FLBuilder._reorderNode(s.attr("data-node"),s.index())),e(".fl-row-sortable-proxy").append(i.item)},_addRow:function(t,i){FLBuilder._showNodeLoadingPlaceholder(e(FLBuilder._contentClass),i),FLBuilder._newRowPosition=i,FLBuilder.ajax({action:"render_new_row",cols:t,position:i},FLBuilder._addRowComplete)},_addRowComplete:function(t){var i="object"==typeof t?t:JSON.parse(t),l=e(FLBuilder._contentClass),o=e(i.html).data("node"),s=FLBuilder._addModuleAfterNodeRender;i.nodeParent=l,i.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(i,function(){null!==s&&(e(".fl-node-"+o+" .fl-col-content").append(s),FLBuilder._reorderModule(s),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+o)),FLBuilder.triggerHook("didAddRow",o)})},_deleteRowClicked:function(t){var i=e(this).closest(".fl-row"),l=null;i.find(".fl-module").length?(l=confirm(FLBuilderStrings.deleteRowMessage),l&&FLBuilder._deleteRow(i)):FLBuilder._deleteRow(i),FLBuilder._removeAllOverlays(),t.stopPropagation()},_deleteRow:function(e){var t=e.attr("data-node");FLBuilder.ajax({action:"delete_node",node_id:t}),e.empty(),e.remove(),FLBuilder._setupEmptyLayout(),FLBuilder._removeRowOverlays(),FLBuilder.triggerHook("didDeleteRow",t)},_rowCopyClicked:function(t){var i=e(this).closest(".fl-row"),l=i.attr("data-node"),o=e(FLBuilder._contentClass+" > .fl-row").index(i)+1,s=i.clone(),n=e(".fl-builder-settings[data-node]"),r=n.attr("data-node"),a=r===l?i:i.find('[data-node="'+r+'"]'),d=null;n.length&&a.length&&(d=FLBuilder._getSettings(n),FLBuilderSettingsConfig.nodes[r]=d),s.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),s.find(".fl-block-overlay").remove(),i.after(s),e("html, body").animate({scrollTop:s.offset().top-75},500),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newRowPosition=o,FLBuilder.ajax({action:"copy_row",node_id:l,settings:d,settings_id:r},function(e){var t=JSON.parse(e);t.duplicatedRow=l,FLBuilder._rowCopyComplete(t)}),t.stopPropagation()},_rowCopyComplete:function(t){t.nodeParent=e(FLBuilder._contentClass),t.nodePosition=FLBuilder._newRowPosition,FLBuilder._renderLayout(t,function(){FLBuilder.triggerHook("didDuplicateRow",{newNodeId:t.nodeId,oldNodeId:t.duplicatedRow}),t.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_rowSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-row").attr("data-node"),o=i.closest(".fl-block-overlay-global").length>0,s=null;o&&"row"!=FLBuilderConfig.userTemplateType?FLBuilderConfig.userCanEditGlobalTemplates&&(s=window.open(e('.fl-row[data-node="'+l+'"]').attr("data-template-url")),s.FLBuilderGlobalNodeId=l):i.hasClass("fl-block-settings")&&FLBuilderSettingsForms.render({id:"row",nodeId:l,className:"fl-builder-row-settings",attrs:'data-node="'+l+'"',buttons:o||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:o?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[l],preview:{type:"row"}},function(){e("#fl-field-width select").on("change",FLBuilder._rowWidthChanged),e("#fl-field-content_width select").on("change",FLBuilder._rowWidthChanged)}),t.stopPropagation()},_rowWidthChanged:function(){var t=e("#fl-field-width select").val(),i=e("#fl-field-content_width select").val(),l=e("#fl-field-max_content_width");"fixed"==t||"full"==t&&"fixed"==i?l.show():l.hide()},_resetRowWidthClicked:function(t){var i=e(this),l=i.closest(".fl-row"),o=l.attr("data-node"),s=l.find(".fl-row-content"),n=FLBuilderConfig.global.row_width+"px",r=e(".fl-builder-row-settings");l.hasClass("fl-row-fixed-width")&&l.css("max-width",n),s.css("max-width",n),r.length&&r.find("[name=max_content_width]").val(""),FLBuilder.ajax({action:"resize_row_content",node:o,width:""}),FLBuilder._closeAllSubmenus(),FLBuilder.triggerHook("didResetRowWidth",o),t.stopPropagation()},_highlightEmptyCols:function(){var t="row"==FLBuilderConfig.userTemplateType||"column"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)",i=(e(FLBuilder._contentClass+" .fl-row"+t),e(FLBuilder._contentClass+" .fl-col"+t));e(".fl-row-highlight").removeClass("fl-row-highlight"),i.removeClass("fl-col-highlight").find(".fl-col-content").css("height",""),i.each(function(){var t=e(this);0===t.find(".fl-module, .fl-col").length&&t.addClass("fl-col-highlight")})},_removeEmptyColHighlights:function(){e(".fl-row-highlight").removeClass("fl-row-highlight"),e(".fl-col-highlight").removeClass("fl-col-highlight")},_highlightRowsAndColsForDrag:function(t){var i="row"==FLBuilderConfig.userTemplateType?"":":not(.fl-node-global)";"column"==FLBuilderConfig.userTemplateType&&(i=":not(:first)"),e(FLBuilder._contentClass+" .fl-row").addClass("fl-row-highlight"),t.closest(".fl-row-overlay").length||e(FLBuilder._contentClass+" .fl-col"+i).addClass("fl-col-highlight")},_adjustColHeightsForDrag:function(){var t="row"==FLBuilderConfig.userTemplateType?"":".fl-row:not(.fl-node-global) ",i="column"==FLBuilderConfig.userTemplateType?"":".fl-col:not(.fl-node-global) ",l=e(FLBuilder._contentClass),o=l.find(t+".fl-col-group:not(.fl-col-group-nested) > "+i+"> .fl-col-content"),s=l.find(t+".fl-col-group-nested "+i+".fl-col-content"),n=0;for(e(".fl-node-drag-init").hide();n<s.length;n++)FLBuilder._adjustColHeightForDrag(s.eq(n));for(n=0;n<o.length;n++)FLBuilder._adjustColHeightForDrag(o.eq(n));e(".fl-node-drag-init").show()},_adjustColHeightForDrag:function(e){e.find(".fl-module:visible, .fl-col:visible").length&&e.height(e.height()+45)},_showColHighlightGuide:function(){var t=e(this),i=t.find("a"),l=t.closest(".fl-col"),o=l.parents(".fl-col"),s=e('<div class="fl-col-highlight-guide"></div>'),n=null,r=t.closest(".fl-block-overlay").offset().top;(i.hasClass("fl-block-col-move-parent")||i.hasClass("fl-block-col-edit-parent"))&&(l=o),l.hasClass("fl-col-highlight")||(l.find("> .fl-col-content").append(s),l.addClass("fl-col-has-highlight-guide"),n=s.offset().top,n>r&&s.css("top",r-n+4+"px"))},_removeColHighlightGuides:function(){e(".fl-col-has-highlight-guide").removeClass("fl-col-has-highlight-guide"),e(".fl-col-highlight-guide").remove()},_colMouseenter:function(){var t=e(this),i=t.closest(".fl-col-group"),l=i.hasClass("fl-col-group-has-child-loading"),o=t.hasClass("fl-node-global"),s=t.parents(".fl-node-global").length>0,n=t.closest(".fl-col-group").find("> .fl-col").length,r=i.find("> .fl-col").index(t),a=0===r,d=n===r+1,u=t.find(".fl-col").length>0,c=t.find(".fl-module").length>0,h=t.parents(".fl-col"),f=h.closest(".fl-col-group"),g=h.length>0,p="undefined"!=typeof t.data("template-url"),b="column"==FLBuilderConfig.userTemplateType&&!g;numParentCols=g?f.find("> .fl-col").length:0,parentIndex=f.find("> .fl-col").index(h),parentFirst=!!g&&0===parentIndex,parentLast=!!g&&numParentCols===parentIndex+1,contentWidth=t.find("> .fl-col-content").width(),row=t.closest(".fl-row"),rowIsFixedWidth=!!row.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,userCanResizeRows=FLBuilderConfig.rowResize.userCanResizeRows,hasRules=t.hasClass("fl-node-has-rules"),template=wp.template("fl-col-overlay"),overlay=null,FLBuilderConfig.simpleUi||o&&s&&c&&!p||o&&"column"==FLBuilderConfig.userTemplateType&&c||!o&&t.find(".fl-module").length>0||t.find(".fl-builder-node-loading-placeholder").length>0||!c&&u||s&&u&&!p||t.closest(".fl-builder-node-loading").length||(t.hasClass("fl-block-overlay-active")||(FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),overlay=FLBuilder._appendOverlay(t,template({global:o,groupLoading:l,numCols:n,first:a,last:d,isRootCol:b,hasChildCols:u,hasParentCol:g,parentFirst:parentFirst,parentLast:parentLast,numParentCols:numParentCols,contentWidth:contentWidth,rowIsFixedWidth:rowIsFixedWidth,userCanResizeRows:userCanResizeRows,hasRules:hasRules})),FLBuilder._buildOverlayOverflowMenu(overlay),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_colMouseleave:function(t){var i=e(this),l=e(t.toElement)||e(t.relatedTarget),o=i.find(".fl-module").length>0,s=(i.hasClass("fl-node-global"),"undefined"!=typeof i.data("template-url")),n=l.is("#tiptip_holder"),r=l.closest("#tiptip_holder").length>0;n||r||o&&!s||(FLBuilder._removeColOverlays(),FLBuilder._removeColHighlightGuides(),FLBuilder._closeAllSubmenus())},_removeColOverlays:function(){var t=e(".fl-col");t.removeClass("fl-block-overlay-active"),t.find(".fl-col-overlay").remove(),e("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_colDragHelper:function(){return e('<div class="fl-builder-block-drag-helper">'+FLBuilderStrings.column+"</div>")},_colDragInit:function(t){var i=e(t.target),l=e(".fl-col-sortable-proxy-item"),o=i.closest(".fl-col");i.hasClass("fl-block-col-move-parent")&&(o=o.parents(".fl-col")),o.addClass("fl-node-dragging"),FLBuilder._blockDragInit(t),FLBuilder._removeColHighlightGuides(),t.target=l[0],l.trigger(t)},_colDragStart:function(t,i){var l=e(".fl-node-dragging");l.hide(),FLBuilder._resetColumnWidths(l.parent()),FLBuilder._blockDragStart(t,i)},_colDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=e(".fl-node-dragging").removeClass("fl-node-dragging").show(),o=l.attr("data-node"),s=i.item.parent(),n=l.parent(),r=n.attr("data-node");newGroup=s.closest(".fl-col-group"),newGroupId=newGroup.attr("data-node"),newRow=s.closest(".fl-row"),position=0,s.hasClass("fl-sortable-disabled")?FLBuilder._resetColumnWidths(n):s.hasClass("fl-col-sortable-proxy")?FLBuilder._resetColumnWidths(n):s.hasClass("fl-col-content")?(l.remove(),0===n.find(".fl-col").length&&n.remove(),position=s.find("> .fl-module, .fl-col-group, .fl-col-sortable-proxy-item").index(i.item),FLBuilder._addColGroup(s.closest(".fl-col").attr("data-node"),o,position)):s.hasClass("fl-col-drop-target")?(s.hasClass("fl-col-drop-target-last")?s.parent().after(l):s.parent().before(l),FLBuilder._resetColumnWidths(newGroup),r==newGroupId?FLBuilder.ajax({action:"reorder_col",node_id:o,position:l.index()}):FLBuilder.ajax({action:"move_col",node_id:o,new_parent:newGroupId,position:l.index(),resize:[r,newGroupId]}),FLBuilder._resizeLayout()):s.hasClass("fl-col-group-drop-target")?(l.remove(),0===n.find(".fl-col").length&&n.remove(),position=newRow.find(".fl-row-content > .fl-col-group").index(newGroup),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addColGroup(newRow.attr("data-node"),o,position)):s.hasClass("fl-row-drop-target")&&(l.remove(),position=s.closest(".fl-builder-content").find(".fl-row").index(newRow),position=s.hasClass("fl-drop-target-last")?position+1:position,FLBuilder._addRow(o,position)),0===n.find(".fl-col").length&&n.remove(),e(".fl-col-sortable-proxy").append(i.item),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._closeAllSubmenus()},_colSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-col"),o=l.find("> .fl-col-content"),s=i.parent().find("ul.fl-builder-submenu").length>0,n=i.closest(".fl-block-overlay-global").length>0,r=i.closest(".fl-block-overlay-global").hasClass("fl-col-overlay"),a="column"!=FLBuilderConfig.userTemplateType&&"undefined"!=typeof l.attr("data-template-url"),d=null;FLBuilder._colResizing||n&&!FLBuilderConfig.userCanEditGlobalTemplates||s&&!i.hasClass("fl-col-overlay")||(i.hasClass("fl-block-col-edit-parent")&&(l=l.parents(".fl-col")),d=l.attr("data-node"),n&&r&&a?FLBuilderConfig.userCanEditGlobalTemplates&&(win=window.open(e('.fl-col[data-node="'+d+'"]').attr("data-template-url")),win.FLBuilderGlobalNodeId=d):FLBuilderSettingsForms.render({id:"col",nodeId:d,className:"fl-builder-col-settings",attrs:'data-node="'+d+'"',buttons:n||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:n?[FLBuilderStrings.global]:[],settings:FLBuilderSettingsConfig.nodes[d],preview:{type:"col"}},function(){0===l.siblings(".fl-col").length?e("#fl-builder-settings-section-general").hide():o.width()<=40&&e("#fl-field-size").hide()}),t.stopPropagation())},_copyColClicked:function(t){var i=e(this).closest(".fl-col"),l=i.attr("data-node"),o=i.clone(),s=i.parent(),n=e(".fl-builder-settings[data-node]"),r=n.attr("data-node"),a=r===l?i:i.find('[data-node="'+r+'"]'),d=null;n.length&&a.length&&(d=FLBuilder._getSettings(n),FLBuilderSettingsConfig.nodes[r]=d),o.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),o.find(".fl-block-overlay").remove(),i.after(o),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newColParent=s,FLBuilder._newColPosition=i.index()+1,FLBuilder._resetColumnWidths(s),FLBuilder.ajax({action:"copy_col",node_id:l,settings:d,settings_id:r},function(e){var t=JSON.parse(e);t.duplicatedColumn=l,FLBuilder._copyColComplete(t)}),t.stopPropagation()},_copyColComplete:function(e){e.nodeParent=FLBuilder._newColParent,e.nodePosition=FLBuilder._newColPosition,FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateColumn",{newNodeId:e.nodeId,oldNodeId:e.duplicatedColumn}),e.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_deleteColClicked:function(t){var i=e(this),l=i.closest(".fl-col"),o=l.closest(".fl-col-group"),s=l.parents(".fl-col"),n=s.length>0,r=s.find("> .fl-col-content > .fl-module, > .fl-col-content > .fl-col-group"),a=l.siblings(".fl-col"),d=!0;l.find(".fl-module").length>0&&(d=confirm(FLBuilderStrings.deleteColumnMessage)),n&&1===r.length&&(0===a.length?l=s:1!==a.length||a.find(".fl-module").length||(l=o)),d&&(FLBuilder._deleteCol(l),FLBuilder._removeAllOverlays(),FLBuilder._highlightEmptyCols()),t.stopPropagation()},_deleteCol:function(e){var t=e.attr("data-node"),i=e.closest(".fl-row"),l=e.closest(".fl-col-group"),o=0;e.remove(),rowCols=i.find(".fl-row-content > .fl-col-group > .fl-col"),groupCols=l.find(" > .fl-col"),0===rowCols.length&&"row"!=FLBuilderConfig.userTemplateType&&"column"!=FLBuilderConfig.userTemplateType?FLBuilder._deleteRow(i):(0===groupCols.length?l.remove():(o=6===groupCols.length?16.65:7===groupCols.length?14.28:Math.round(100/groupCols.length*100)/100,groupCols.css("width",o+"%"),FLBuilder.triggerHook("didResetColumnWidths",{cols:groupCols})),FLBuilder.ajax({action:"delete_col",node_id:t,new_width:o}),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder.triggerHook("didDeleteColumn",t))},_addCols:function(e,t,i,l){var o=e.closest(".fl-col-group"),s=o.find(".fl-col").index(e);i="undefined"==typeof i?"1-col":i,l="undefined"!=typeof l&&l,"after"==t&&s++,FLBuilder._showNodeLoadingPlaceholder(o,s),FLBuilder._removeAllOverlays(),FLBuilder.ajax({action:"render_new_columns",node_id:e.attr("data-node"),insert:t,type:i,nested:l?1:0},FLBuilder._addColsComplete)},_addColsComplete:function(t){var i="object"==typeof t?t:JSON.parse(t),l=null,o=FLBuilder._addModuleAfterNodeRender;i.nodeParent=FLBuilder._newColParent,i.nodePosition=FLBuilder._newColPosition,FLBuilder._renderLayout(i,function(){null!==o&&(e('.fl-module[data-node="'+o.module.data("node")+'"]').remove(),l=e('.fl-col[data-node="'+o.colId+'"]'),"after"==o.position?l.next().find(".fl-col-content").append(o.module):l.prev().find(".fl-col-content").append(o.module),FLBuilder._reorderModule(o.module),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+i.nodeId)),FLBuilder.triggerHook("didAddColumn",i.nodeId),FLBuilder.triggerHook("didResetColumnWidths",{cols:e(".fl-node-"+i.nodeId).find("> .fl-col")})})},_addColGroup:function(t,i,l){var o=e(".fl-node-"+t);FLBuilder._newColGroupPosition=l,o.hasClass("fl-col")?FLBuilder._newColGroupParent=o.find(" > .fl-col-content"):FLBuilder._newColGroupParent=o.find(".fl-row-content"),FLBuilder._showNodeLoadingPlaceholder(FLBuilder._newColGroupParent,l),FLBuilder.ajax({action:"render_new_column_group",cols:i,node_id:t,position:l},FLBuilder._addColGroupComplete)},_addColGroupComplete:function(t){var i=JSON.parse(t),l=e(i.html),o=l.data("node"),s=l.find(".fl-col").data("node"),n=FLBuilder._addModuleAfterNodeRender;i.nodeParent=FLBuilder._newColGroupParent,i.nodePosition=FLBuilder._newColGroupPosition,FLBuilder._renderLayout(i,function(){i.nodeParent.hasClass("fl-col-content")&&i.nodeParent.parents(".fl-col").addClass("fl-col-has-cols"),null!==n&&(e(".fl-node-"+s+" .fl-col-content").append(n),FLBuilder._reorderModule(n),FLBuilder._addModuleAfterNodeRender=null),FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+o)),FLBuilder.triggerHook("didAddColumnGroup",o)})},_initColDragResizing:function(){e(".fl-block-col-resize").not(".fl-block-row-resize").draggable({axis:"x",start:FLBuilder._colDragResizeStart,drag:FLBuilder._colDragResize,stop:FLBuilder._colDragResizeStop})},_colDragResizeStart:function(t,i){var l=e(i.helper),o="",s=l.hasClass("fl-block-col-resize-parent"),n=s?l.closest(".fl-col").parents(".fl-col"):null,r=s?n.parents(".fl-col-group"):l.closest(".fl-col-group"),a=r.find("> .fl-col"),d=s?n:l.closest(".fl-col"),u=d.attr("data-node"),c=e("[data-node="+u+"] #fl-field-size input"),h=null,f=null,g=null,p=100,b=0,m=null,v=null;for(l.hasClass("fl-block-col-resize-e")?(o="e",h=d.nextAll(".fl-col").first()):(o="w",
4
+ h=d.prevAll(".fl-col").first()),f=h.attr("data-node"),g=e("[data-node="+f+"] #fl-field-size input");b<a.length;b++)a.eq(b).data("node")!=d.data("node")&&a.eq(b).data("node")!=h.data("node")&&(p-=parseFloat(a.eq(b)[0].style.width));c.length?(m=c,v="col"):g.length&&(m=g,v="sibling"),FLBuilder._colResizeData={handle:l,feedbackLeft:l.find(".fl-block-col-resize-feedback-left"),feedbackRight:l.find(".fl-block-col-resize-feedback-right"),direction:o,groupWidth:r.outerWidth(),col:d,colWidth:parseFloat(d[0].style.width)/100,sibling:h,offset:i.position.left,availWidth:p,setting:m,settingType:v},FLBuilder._colResizing=!0,e("body").addClass("fl-builder-col-resizing"),FLBuilder._closePanel(),FLBuilder._destroyOverlayEvents(),FLBuilder.triggerHook("col-resize-start")},_colDragResize:function(e,t){var i=FLBuilder._colResizeData,l=FLBuilderConfig.isRtl?"w":"e",o=i.handle.closest(".fl-block-overlay"),s=(i.offset-t.position.left)/i.groupWidth,n=l==i.direction?100*(i.colWidth-s):100*(i.colWidth+s),r=Math.round(100*n)/100,a=i.availWidth-n,d=Math.round(100*a)/100,u=8,c=Math.round(100*(i.availWidth-u))/100;r<u?(r=u,d=c):d<u&&(r=c,d=u),l==i.direction?(i.feedbackLeft.html(r.toFixed(1)+"%").show(),i.feedbackRight.html(d.toFixed(1)+"%").show()):(i.feedbackLeft.html(d.toFixed(1)+"%").show(),i.feedbackRight.html(r.toFixed(1)+"%").show()),i.col.css("width",r+"%"),i.sibling.css("width",d+"%"),i.setting&&("col"===i.settingType?i.setting.val(parseFloat(i.col[0].style.width)):"sibling"===i.settingType&&i.setting.val(parseFloat(i.sibling[0].style.width))),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder.triggerHook("col-resize-drag")},_colDragResizeStop:function(t,i){var l=FLBuilder._colResizeData,o=FLBuilder._colResizeData.handle.closest(".fl-block-overlay"),s=l.col.data("node"),n=parseFloat(l.col[0].style.width),r=l.sibling.data("node"),a=parseFloat(l.sibling[0].style.width);FLBuilder._colResizeData.feedbackLeft.hide(),FLBuilder._colResizeData.feedbackRight.hide(),FLBuilder.ajax({action:"resize_cols",col_id:s,col_width:n,sibling_id:r,sibling_width:a}),FLBuilder._buildOverlayOverflowMenu(o),FLBuilder._colResizeData=null,e("body").removeClass("fl-builder-col-resizing"),FLBuilder._bindOverlayEvents(),setTimeout(function(){FLBuilder._colResizing=!1},50),FLBuilder.triggerHook("col-resize-stop"),FLBuilder.triggerHook("didResizeColumn",{colId:s,colWidth:n,siblingId:r,siblingWidth:a})},_resetColumnWidthsClicked:function(t){var i=e(this),l=!!i.closest(".fl-row-overlay").length,o=null,s=null,n=[],r=null,a=0,d=e(".fl-builder-col-settings"),u=null;s=l?i.closest(".fl-row").find(".fl-row-content > .fl-col-group"):i.parents(".fl-col-group").last(),s.each(function(){for(o=e(this),r=o.find(".fl-col-group"),n.push(o.data("node")),FLBuilder._resetColumnWidths(o),a=0;a<r.length;a++)FLBuilder._resetColumnWidths(r.eq(a)),n.push(r.eq(a).data("node"))}),d.length&&(u=e(".fl-node-"+d.attr("data-node")),d.find("#fl-field-size input").val(parseFloat(u[0].style.width))),FLBuilder.ajax({action:"reset_col_widths",group_id:n}),FLBuilder.triggerHook("col-reset-widths"),FLBuilder._closeAllSubmenus(),t.stopPropagation()},_resetColumnWidths:function(e){var t=e.find(" > .fl-col:visible"),i=0;i=6===t.length?16.65:7===t.length?14.28:Math.round(100/t.length*100)/100,t.css("width",i+"%"),FLBuilder.triggerHook("didResetColumnWidths",{cols:t})},_moduleMouseenter:function(){var t=e(this),i=t.attr("data-name"),l=t.hasClass("fl-node-global"),o=t.parents(".fl-node-global").length>0,s=t.parents(".fl-col-group").last(),n=s.hasClass("fl-col-group-has-child-loading"),r=t.closest(".fl-col-group").find("> .fl-col").length,a=t.closest(".fl-col"),d=0===a.index(),u=r===a.index()+1,c=a.parents(".fl-col"),h=c.length>0,f=h?c.closest(".fl-col-group").find("> .fl-col").length:0,g=!!h&&0===c.index(),p=!!h&&f===c.index()+1,b="column"==FLBuilderConfig.userTemplateType&&!h;contentWidth=a.find("> .fl-col-content").width(),row=t.closest(".fl-row"),isGlobalRow=row.hasClass("fl-node-global"),rowIsFixedWidth=!!row.find(".fl-row-fixed-width").addBack(".fl-row-fixed-width").length,userCanResizeRows=FLBuilderConfig.rowResize.userCanResizeRows,hasRules=t.hasClass("fl-node-has-rules"),colHasRules=a.hasClass("fl-node-has-rules"),template=wp.template("fl-module-overlay"),overlay=null,FLBuilder._removeColOverlays(),FLBuilder._removeModuleOverlays(),l&&o&&"row"!=FLBuilderConfig.userTemplateType&&isGlobalRow||l&&o&&"column"!=FLBuilderConfig.userTemplateType&&!isGlobalRow||t.closest(".fl-builder-node-loading").length||t.find(".fl-inline-editor:visible").length||(t.hasClass("fl-block-overlay-active")||(overlay=FLBuilder._appendOverlay(t,template({global:l,moduleName:i,groupLoading:n,numCols:r,colFirst:d,colLast:u,isRootCol:b,hasParentCol:h,numParentCols:f,parentFirst:g,parentLast:p,contentWidth:contentWidth,rowIsFixedWidth:rowIsFixedWidth,userCanResizeRows:userCanResizeRows,hasRules:hasRules,colHasRules:colHasRules})),FLBuilder._buildOverlayOverflowMenu(overlay),FLBuilder._initColDragResizing()),e("body").addClass("fl-block-overlay-muted"))},_moduleMouseleave:function(t){var i=(e(this),e(t.toElement)||e(t.relatedTarget)),l=i.is("#tiptip_holder"),o=i.closest("#tiptip_holder").length>0;l||o||(FLBuilder._removeModuleOverlays(),FLBuilder._removeColHighlightGuides())},_removeModuleOverlays:function(){var t=e(".fl-module");t.removeClass("fl-block-overlay-active"),t.find(".fl-module-overlay").remove(),e("body").removeClass("fl-block-overlay-muted"),FLBuilder._closeAllSubmenus()},_moduleDragHelper:function(t,i){return e('<div class="fl-builder-block-drag-helper">'+i.attr("data-name")+"</div>")},_moduleDragStart:function(t,i){e(i.item).data("original-position",i.item.index()),FLBuilder._blockDragStart(t,i)},_moduleDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=i.item,o=l.parent(),s=null,n=0,r=0;if(o.hasClass("fl-builder-modules")||o.hasClass("fl-builder-widgets"))return void l.remove();if(l.hasClass("fl-builder-block")){if(o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=l.closest(".fl-builder-content"),r=0,s=l.closest(".fl-row"),n=o.find(".fl-row").index(s)):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),r=o.closest(".fl-row").attr("data-node"),s=l.closest(".fl-col-group"),n=o.find(" > .fl-col-group").index(s)):o.hasClass("fl-col-drop-target")?(o=l.closest(".fl-col-group"),r=o.attr("data-node"),s=l.closest(".fl-col"),n=o.find(" > .fl-col").index(s)):(n=o.find("> .fl-module, .fl-col-group, .fl-builder-block").index(l),r=l.closest(".fl-col").attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),FLBuilder._addModule(o,r,l.attr("data-type"),n,l.attr("data-widget"),l.attr("data-alias")),l.remove()}else{if(o.hasClass("fl-sortable-disabled"))return e(t.target).append(i.item),e(t.target).children().eq(i.item.data("original-position")).before(i.item),void FLBuilder._highlightEmptyCols();o.hasClass("fl-row-drop-target")?(s=l.closest(".fl-row"),n=l.closest(".fl-builder-content").children(".fl-row").index(s),n=l.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addModuleAfterNodeRender=l,FLBuilder._addRow("1-col",n),l.remove()):o.hasClass("fl-col-group-drop-target")?(s=l.closest(".fl-col-group"),n=l.closest(".fl-row-content ").find(" > .fl-col-group").index(s),n=l.closest(".fl-drop-target-last").length?n+1:n,FLBuilder._addModuleAfterNodeRender=l,FLBuilder._addColGroup(l.closest(".fl-row").attr("data-node"),"1-col",n),l.remove()):o.hasClass("fl-col-drop-target")?(s=l.closest(".fl-col"),n=l.closest(".fl-col-drop-target-last").length?"after":"before",FLBuilder._addModuleAfterNodeRender={module:l,colId:s.data("node"),position:n},FLBuilder._addCols(s,n,"1-col",l.closest(".fl-col-group-nested").length>0),l.remove()):FLBuilder._reorderModule(l)}FLBuilder._resizeLayout()},_reorderModule:function(e){var t=e.closest(".fl-col").attr("data-node"),i=e.attr("data-parent"),l=e.attr("data-node"),o=e.index();t==i?FLBuilder._reorderNode(l,o):(e.attr("data-parent",t),FLBuilder._moveNode(t,l,o))},_deleteModuleClicked:function(t){var i=e(this).closest(".fl-module"),l=confirm(FLBuilderStrings.deleteModuleMessage);l&&(FLBuilder._deleteModule(i),FLBuilder._removeAllOverlays()),t.stopPropagation()},_deleteModule:function(e){var t=e.closest(".fl-row"),i=e.attr("data-node");FLBuilder.ajax({action:"delete_node",node_id:i}),e.empty(),e.remove(),t.removeClass("fl-block-overlay-muted"),FLBuilder._highlightEmptyCols(),FLBuilder._removeAllOverlays(),FLBuilder.triggerHook("didDeleteModule",i)},_moduleCopyClicked:function(t){var i=e(this).closest(".fl-module"),l=i.attr("data-node"),o=i.parent(),s=o.find(" > .fl-col-group, > .fl-module").index(i)+1,n=i.clone(),r=e(".fl-builder-module-settings[data-node="+l+"]"),a=null;r.length&&(a=FLBuilder._getSettings(r),FLBuilderSettingsConfig.nodes[l]=a),n.addClass("fl-node-"+l+"-clone fl-builder-node-clone"),n.find(".fl-block-overlay").remove(),i.after(n),e("html, body").animate({scrollTop:n.offset().top-75},500),FLBuilder._showNodeLoading(l+"-clone"),FLBuilder._newModuleParent=o,FLBuilder._newModulePosition=s,FLBuilder.ajax({action:"copy_module",node_id:l,settings:a},function(e){var t=JSON.parse(e);t.duplicatedModule=l,FLBuilder._moduleCopyComplete(t)}),t.stopPropagation()},_moduleCopyComplete:function(e){e.nodeParent=FLBuilder._newModuleParent,e.nodePosition=FLBuilder._newModulePosition,FLBuilder._renderLayout(e,function(){FLBuilder.triggerHook("didDuplicateModule",{newNodeId:e.nodeId,oldNodeId:e.duplicatedModule}),e.nodeParent.find(".fl-builder-node-loading").eq(0).remove()})},_moduleSettingsClicked:function(t){var i=e(this),l=i.closest(".fl-module").attr("data-type"),o=i.closest(".fl-module").attr("data-node"),s=i.closest(".fl-col").attr("data-node"),n=i.closest(".fl-block-overlay-global").length>0;t.stopPropagation(),FLBuilder._colResizing||n&&!FLBuilderConfig.userCanEditGlobalTemplates||FLBuilder._showModuleSettings({type:l,nodeId:o,parentId:s,global:n})},_showModuleSettings:function(t,i){if(FLBuilderSettingsConfig.modules){var l=FLBuilderSettingsConfig.modules[t.type],o=t.settings?t.settings:FLBuilderSettingsConfig.nodes[t.nodeId],s=e("head");-1===e.inArray(t.type,FLBuilder._loadedModuleAssets)&&(""!==l.assets.css&&s.append(l.assets.css),""!==l.assets.js&&s.append(l.assets.js),FLBuilder._loadedModuleAssets.push(t.type)),FLBuilderSettingsForms.render({type:"module",id:t.type,nodeId:t.nodeId,className:"fl-builder-module-settings fl-builder-"+t.type+"-settings",attrs:'data-node="'+t.nodeId+'" data-parent="'+t.parentId+'" data-type="'+t.type+'"',buttons:t.global||FLBuilderConfig.lite||FLBuilderConfig.simpleUi?[]:["save-as"],badges:t.global?[FLBuilderStrings.global]:[],settings:o,legacy:t.legacy,helper:FLBuilder._moduleHelpers[t.type],rules:FLBuilder._moduleHelpers[t.type]?FLBuilder._moduleHelpers[t.type].rules:null,preview:{type:"module",layout:t.layout,callback:function(){FLBuilder.triggerHook("didAddModule",t.nodeId)}}},i)}},_saveModuleClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=t.attr("data-type"),l=(t.attr("data-node"),FLBuilder._moduleHelpers[i]),o=!0;"undefined"!=typeof l&&(t.find("label.error").remove(),t.validate().hideErrors(),o=t.validate().form(),o&&(o=l.submit())),o?FLBuilder._saveSettings():FLBuilder._toggleSettingsTabErrors()},_addModule:function(e,t,i,l,o,s){FLBuilder._showNodeLoadingPlaceholder(e,l),e.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=e,FLBuilder._newModulePosition=l),FLBuilder.ajax({action:"render_new_module",parent_id:t,type:i,position:l,node_preview:1,widget:"undefined"==typeof o?"":o,alias:"undefined"==typeof s?"":s},FLBuilder._addModuleComplete)},_addModuleComplete:function(t){var i=JSON.parse(t);i.layout&&(i.layout.nodeParent=FLBuilder._newModuleParent,i.layout.nodePosition=FLBuilder._newModulePosition),i.settings||(i.settings=FLBuilderSettingsConfig.defaults.modules[i.type]),e("form.fl-builder-settings").length?i.layout&&FLBuilder._renderLayout(i.layout):FLBuilder._showModuleSettings(i,function(){e(".fl-builder-module-settings").data("new-module","1")})},registerModuleHelper:function(t,i){var l={rules:{},init:function(){},submit:function(){return!0},preview:function(){}};FLBuilder._moduleHelpers[t]=e.extend({},l,i)},_registerModuleHelper:function(e,t){FLBuilder.registerModuleHelper(e,t)},_showNodeTemplateSettings:function(t){var i=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=i.attr("data-node"),o=FLBuilderStrings.saveModule;return i.hasClass("fl-builder-row-settings")?o=FLBuilderStrings.saveRow:i.hasClass("fl-builder-col-settings")&&(o=FLBuilderStrings.saveColumn),!!FLBuilder._triggerSettingsSave(!1,!1,!1)&&void FLBuilderSettingsForms.render({id:"node_template",nodeId:l,title:o,attrs:'data-node="'+l+'"',className:"fl-builder-node-template-settings",rules:{name:{required:!0}}},function(){FLBuilderConfig.userCanEditGlobalTemplates||e("#fl-field-global").hide()})},_saveNodeTemplate:function(){var t=e(".fl-builder-node-template-settings"),i=t.attr("data-node"),l=t.validate().form();l&&(FLBuilder._showNodeLoading(i),FLBuilder.ajax({action:"save_node_template",node_id:i,settings:FLBuilder._getSettings(t)},function(e){FLBuilder._saveNodeTemplateComplete(e),FLBuilder._hideNodeLoading(i)}),FLBuilder._lightbox.close())},_saveNodeTemplateComplete:function(t){var i=JSON.parse(t),l=e(".fl-builder-saved-"+i.type+"s"),o=l.find(".fl-builder-block"),s=null,n="",r=i.name.toLowerCase(),a=0,d=wp.template("fl-node-template-block"),u={name:i.name,isGlobal:i.global,content:i.type,id:i.id,postID:i.postID,kind:"template",type:"user",link:i.link,category:{uncategorized:FLBuilderStrings.uncategorized}};if(FLBuilderConfig.contentItems.template.push(u),FLBuilder.triggerHook("contentItemsChanged"),i.layout&&(FLBuilder._renderLayout(i.layout),FLBuilder.triggerHook("didSaveGlobalNodeTemplate",i.config)),0===o.length)l.append(d(i));else for(;a<o.length;a++){if(s=o.eq(a),n=s.text().toLowerCase().trim(),0===a&&r<n){l.prepend(d(i));break}if(r<n){s.before(d(i));break}if(o.length-1===a){l.append(d(i));break}}l.find(".fl-builder-block-no-node-templates").remove()},_nodeTemplateDragStop:function(t,i){FLBuilder._blockDragStop(t,i);var l=i.item,o=l.parent(),s=null,n=0,r=null,a="",d=null;if(o.hasClass("fl-builder-blocks-section-content"))return void l.remove();if(l.hasClass("fl-builder-block-saved-row")||l.hasClass("fl-builder-block-row-template"))r=l.closest(".fl-row"),n=r.length?e(FLBuilder._contentClass+" .fl-row").index(r):0,n=o.hasClass("fl-drop-target-last")?n+1:n,s=null,a="render_new_row",d=FLBuilder._addRowComplete,FLBuilder._newRowPosition=n,FLBuilder._showNodeLoadingPlaceholder(e(FLBuilder._contentClass),n);else if(l.hasClass("fl-builder-block-saved-column")){if(r=l.closest(".fl-col"),colGroup=o.closest(".fl-col-group"),colGroupId=colGroup.attr("data-node"),a="render_new_col_template",d=FLBuilder._addColsComplete,o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(r=l.closest(".fl-row"),s=0,o=e(FLBuilder._contentClass),n=r.length?o.find(".fl-row").index(r):0):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),s=l.closest(".fl-row").attr("data-node"),n=l.closest(".fl-row").find(".fl-row-content > .fl-col-group").index(l.closest(".fl-col-group"))):o.hasClass("fl-col-drop-target")&&(o=l.closest(".fl-col-group"),n=o.children(".fl-col").index(l.closest(".fl-col")),s=o.attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),o.hasClass("fl-col-group")?FLBuilder._newColParent=null:FLBuilder._newColParent=o,FLBuilder._newColPosition=n,FLBuilder._showNodeLoadingPlaceholder(o,n)}else if(l.hasClass("fl-builder-block-saved-module")||l.hasClass("fl-builder-block-module-template")){if(a="render_new_module",d=FLBuilder._addModuleComplete,o.hasClass("fl-sortable-disabled"))return l.remove(),void FLBuilder._showPanel();o.hasClass("fl-row-drop-target")?(o=l.closest(".fl-builder-content"),s=0,n=o.find(".fl-row").index(l.closest(".fl-row"))):o.hasClass("fl-col-group-drop-target")?(o=l.closest(".fl-row-content"),s=o.closest(".fl-row").attr("data-node"),n=o.find(" > .fl-col-group").index(l.closest(".fl-col-group"))):o.hasClass("fl-col-drop-target")?(o=l.closest(".fl-col-group"),n=o.children(".fl-col").index(l.closest(".fl-col")),s=o.attr("data-node")):(n=o.children(".fl-module, .fl-builder-block").index(l),s=l.closest(".fl-col").attr("data-node")),l.closest(".fl-drop-target-last").length&&(n+=1),o.hasClass("fl-col-group")?(FLBuilder._newModuleParent=null,FLBuilder._newModulePosition=0):(FLBuilder._newModuleParent=o,FLBuilder._newModulePosition=n),FLBuilder._showNodeLoadingPlaceholder(o,n)}FLBuilder.ajax({action:a,template_id:l.attr("data-id"),template_type:l.attr("data-type"),parent_id:s,position:n},function(e){if(a.indexOf("row")>-1){var t=JSON.parse(e);FLBuilder.triggerHook("didApplyRowTemplateComplete",t.config),d(t.layout)}else if(a.indexOf("col")>-1){var t=JSON.parse(e);FLBuilder.triggerHook("didApplyColTemplateComplete",t.config),d(t.layout)}else d(e)}),l.remove()},_editNodeTemplateClicked:function(t){t.preventDefault(),t.stopPropagation(),window.open(e(this).attr("href"))},_deleteNodeTemplateClicked:function(t){var i=e(t.target),l=i.closest(".fl-builder-blocks-section"),o=l.find(".fl-builder-blocks-section-content"),s=o.find(".fl-builder-block"),n=i.closest(".fl-builder-block"),r=n.hasClass("fl-builder-block-global"),a=r?FLBuilder._updateLayout:void 0,d=r?FLBuilderStrings.deleteGlobalTemplate:FLBuilderStrings.deleteTemplate,u=null;confirm(d)&&(n.remove(),1===s.length&&(n.hasClass("fl-builder-block-saved-row")?o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedRows+"</span>"):o.append('<span class="fl-builder-block-no-node-templates">'+FLBuilderStrings.noSavedModules+"</span>")),n.hasClass("fl-builder-block-global")&&FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"delete_node_template",template_id:n.attr("data-id")},a),u=_.findIndex(FLBuilderConfig.contentItems.template,{id:n.attr("data-id"),type:"user"}),FLBuilderConfig.contentItems.template.splice(u,1),FLBuilder.triggerHook("contentItemsChanged"))},_initSettingsForms:function(){FLBuilder._initCodeFields(),FLBuilder._initColorPickers(),FLBuilder._initSelectFields(),FLBuilder._initEditorFields(),FLBuilder._initMultipleFields(),FLBuilder._initAutoSuggestFields(),FLBuilder._initLinkFields(),FLBuilder._initFontFields(),FLBuilder._initOrderingFields(),FLBuilder._initTimezoneFields(),FLBuilder._focusFirstSettingsControl(),FLBuilder._lightbox._resizeEditors(),e(".fl-builder-settings-fields").css("visibility","visible"),FLBuilder.triggerHook("settings-form-init")},_destroySettingsForms:function(){FLBuilder._destroyEditorFields()},_setSettingsFormContent:function(t){e(".fl-legacy-settings").remove(),e("body").append(t)},_settingsTabClicked:function(t){var i=e(this),l=i.closest(".fl-builder-settings"),o=i.attr("href").split("#").pop();FLBuilder._resetSettingsTabsState(),l.find(".fl-builder-settings-tab").removeClass("fl-active"),l.find("#"+o).addClass("fl-active"),l.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),l.find("a[href*="+o+"]").addClass("fl-active"),FLBuilder._focusFirstSettingsControl(),t.preventDefault()},_resetSettingsTabsState:function(){var t=e(".fl-lightbox:visible");FLBuilder._hideTabsOverflowMenu(),t.find(".fl-builder-settings-tabs .fl-active").removeClass("fl-active"),t.find(".fl-builder-settings-tabs-overflow-menu .fl-active").removeClass("fl-active"),t.find(".fl-contains-active").removeClass("fl-contains-active")},_calculateSettingsTabsOverflow:function(){var t=e(".fl-lightbox:visible"),i=t.outerWidth(),l=t.hasClass("fl-lightbox-width-slim"),o=t.find(".fl-builder-settings-tabs"),s=t.find(".fl-builder-settings-tabs-overflow-menu"),n=t.find(".fl-builder-settings-tabs-more"),r=o.find("a"),a=!1,d=i-60,u=0,c=l?16:30;s.html(""),FLBuilder._hideTabsOverflowMenu(),r.removeClass("fl-overflowed"),r.each(function(){if(!e(this).is(":visible"))return!0;if(!a){var t=e(this).textWidth()+c+12;u+=t,u>=d&&(a=!0)}if(a){var i=e(this).html(),l=e(this).attr("href"),o="";e(this).hasClass("fl-active")&&(o="fl-active"),e(this).hasClass("error")&&(o+=" error"),""!==o&&(o='class="'+o+'"');var n=e('<a href="'+l+'" '+o+">"+i+"</a>");s.append(n),e(this).addClass("fl-overflowed")}else e(this).removeClass("fl-overflowed")}),a?t.addClass("fl-lightbox-has-tab-overflow"):t.removeClass("fl-lightbox-has-tab-overflow"),s.find(".fl-active").length>0?n.addClass("fl-contains-active"):n.removeClass("fl-contains-active"),s.find(".error").length>0?n.addClass("fl-contains-errors"):n.removeClass("fl-contains-errors")},_settingsTabsToOverflowMenuItemClicked:function(t){var i=e(t.currentTarget),l=i.attr("href"),o=i.closest(".fl-lightbox-header-wrap").find(".fl-builder-settings-tabs"),s=o.find('a[href="'+l+'"]'),n=o.find(".fl-builder-settings-tabs-more");FLBuilder._resetSettingsTabsState(),s.trigger("click"),i.addClass("fl-active"),n.addClass("fl-contains-active"),FLBuilder._hideTabsOverflowMenu(),t.preventDefault()},_hasOverflowTabs:function(){var t=e(".fl-lightbox:visible"),i=t.find(".fl-builder-settings-tabs-overflow-menu a");return i.length>0},_showTabsOverflowMenu:function(){if(FLBuilder._hasOverflowTabs()){var t=e(".fl-lightbox:visible");t.find(".fl-builder-settings-tabs-overflow-menu").css("display","flex"),t.find(".fl-builder-settings-tabs-overflow-click-mask").show(),this.isShowingSettingsTabsOverflowMenu=!0}},_hideTabsOverflowMenu:function(){var t=e(".fl-lightbox:visible");t.find(".fl-builder-settings-tabs-overflow-menu").css("display","none"),t.find(".fl-builder-settings-tabs-overflow-click-mask").hide(),this.isShowingSettingsTabsOverflowMenu=!1},_toggleTabsOverflowMenu:function(e){FLBuilder.isShowingSettingsTabsOverflowMenu?FLBuilder._hideTabsOverflowMenu():FLBuilder._showTabsOverflowMenu(),e.stopPropagation()},_settingsCancelClicked:function(t){var i=e(".fl-builder-lightbox[data-parent]"),l=e(".fl-builder-module-settings"),o=null,s=null,n=null,r=null;return i.length>0?void FLBuilder._closeNestedSettings():(l.length>0&&"undefined"!=typeof l.data("new-module")?(o=e(FLBuilder.preview.state.html),s=e(".fl-node-"+l.data("node")),n=s.closest(".fl-col"),r=o.find(".fl-node-"+n.data("node")),r.length>0?FLBuilder._deleteModule(s):FLBuilder._deleteCol(n)):FLBuilder.preview&&FLBuilder.preview.revert(),FLBuilder.preview=null,void FLLightbox.closeParent(this))},_focusFirstSettingsControl:function(){var t=e(".fl-builder-settings:visible"),i=t.find(".fl-builder-settings-tab.fl-active"),l=t.data("node"),o=i.find(".fl-field").first(),s=o.find('input:not([type="hidden"]), textarea, select, button, a, .fl-editor-field').first();if(!l||!e(".fl-node-"+l+" .fl-inline-editor").length){if("undefined"!=typeof tinyMCE&&s.hasClass("fl-editor-field")){var n=s.find("textarea.wp-editor-area").attr("id");tinyMCE.get(n).focus()}else setTimeout(function(){s.focus().css("animation-name","fl-grab-attention")},300);o.css("animation-name","fl-grab-attention"),o.on("animationend",function(){o.css("animation-name","")})}},_initSettingsValidation:function(t,i){var l=e(".fl-builder-settings").last();l.validate({ignore:".fl-ignore-validation",rules:t,messages:i,errorPlacement:FLBuilder._settingsErrorPlacement})},_settingsErrorPlacement:function(e,t){e.appendTo(t.parent())},_toggleSettingsTabErrors:function(){for(var t=e(".fl-builder-settings:visible"),i=t.find(".fl-builder-settings-tab"),l=null,o=null,s=0;s<i.length;s++)l=i.eq(s),o=l.find("label.error"),tabLink=t.find(".fl-builder-settings-tabs a[href*="+l.attr("id")+"]"),tabLink.find(".fl-error-icon").remove(),tabLink.removeClass("error"),o.length>0&&(tabLink.append('<span class="fl-error-icon"></span>'),tabLink.addClass("error"));FLBuilder._calculateSettingsTabsOverflow()},_getSettings:function(t){FLBuilder._updateEditorFields();var i=t.serializeArray(),l=0,o=0,s="",n="",r="",a=[],d=[],u={};for(l=0;l<i.length;l++)if(s=i[l].value.replace(/\r/gm,"").replace(/&#39;/g,"'"),!(i[l].name.indexOf("flrich")>-1))if(i[l].name.indexOf("[")>-1){for(n=i[l].name.replace(/\[(.*)\]/,""),r=i[l].name.replace(n,""),a=[],d=r.match(/\[[^\]]*\]/g),o=0;o<d.length;o++)"[]"!=d[o]&&a.push(d[o].replace(/\[|\]/g,""));r.match(/\[\]\[[^\]]*\]\[[^\]]+\]/)?("undefined"==typeof u[n]&&(u[n]={}),"undefined"==typeof u[n][a[0]]&&(u[n][a[0]]={}),"undefined"==typeof u[n][a[0]][a[1]]&&(u[n][a[0]][a[1]]={}),u[n][a[0]][a[1]]=s):r.match(/\[\]\[[^\]]*\]\[\]/)?("undefined"==typeof u[n]&&(u[n]={}),"undefined"==typeof u[n][a[0]]&&(u[n][a[0]]=[]),u[n][a[0]].push(s)):r.match(/\[\]\[[^\]]*\]/)?("undefined"==typeof u[n]&&(u[n]={}),u[n][a[0]]=s):r.match(/\[\]/)&&("undefined"==typeof u[n]&&(u[n]=[]),u[n].push(s))}else u[i[l].name]=s;for(r in u)if("undefined"!=typeof u["as_values_"+r]){u[r]=e.grep(u["as_values_"+r].split(","),function(e){return""!==e}).join(",");try{delete u["as_values_"+r]}catch(c){}}return e.each(t.find("[name]"),function(t,i){var l=e(i).attr("name").replace(/\[(.*)\]/,"");l in u||(u[l]="")}),u=e.extend({},FLBuilder._getOriginalSettings(t),u)},_getSettingsJSONForHTML:function(e){return JSON.stringify(e).replace(/\'/g,"&#39;").replace("<wbr />","<wbr>")},_getOriginalSettings:function(t,i){var l=t.find(".fl-builder-settings-json"),o=t.data("node"),s=FLBuilderSettingsConfig.nodes,n=null,r={};if(o&&s[o]?n=s[o]:l.length&&(n=JSON.parse(l.val().replace(/&#39;/g,"'"))),n)for(key in n)(e("#fl-field-"+key).length||i)&&(r[key]=n[key]);return r},_getSettingsForChangedCheck:function(t,i){var l=FLBuilder._getSettings(i);if(t){var o=e(".fl-node-"+t);if(o.hasClass("fl-module")){var s=o.data("type"),n=FLBuilderSettingsConfig.editables[s];if(n&&FLBuilderSettingsConfig.nodes[t])for(var r in n)l[r]=FLBuilderSettingsConfig.nodes[t][r]}}return l},_saveSettings:function(t){var i=e(".fl-builder-settings-lightbox .fl-builder-settings"),l=i.data("new-module"),o=i.attr("data-node"),s=FLBuilder._getSettings(i),n=FLBuilder.preview;return!_.isUndefined(t)&&_.isBoolean(t)||(t=!0),n&&!n._settingsHaveChanged()&&_.isUndefined(l)?void FLBuilder._lightbox.close():(FLBuilder._showNodeLoading(o),FLBuilderSettingsConfig.nodes[o]=s,FLBuilder.ajax({action:"save_settings",node_id:o,settings:s},FLBuilder._saveSettingsComplete.bind(this,t,n)),FLBuilder.triggerHook("didSaveNodeSettings",{nodeId:o,settings:s}),void FLBuilder._lightbox.close())},_saveSettingsComplete:function(e,t,i){var l=JSON.parse(i),o=function(){t&&l.layout.partial&&l.layout.nodeId===t.nodeId&&(t.clear(),t=null)};!0===e?FLBuilder._renderLayout(l.layout,o):o(),FLBuilder.triggerHook("didSaveNodeSettingsComplete",{nodeId:l.node_id,settings:l.settings})},_triggerSettingsSave:function(t,i,l){var o=FLBuilder._lightbox._node.find("form.fl-builder-settings"),s=FLBuilder._lightbox._node.data("instance-id"),n=FLLightbox._instances[s],r=e(".fl-lightbox-wrap[data-parent]:visible"),a=!1,d=!0;return t=!_.isUndefined(t)&&t,i=!_.isUndefined(i)&&i,l=!!_.isUndefined(l)||l,o.length&&(r.length&&(r.find(".fl-builder-settings-save").trigger("click"),(r.find("label.error").length||e(".fl-builder-alert-lightbox:visible").length)&&(d=!1)),d&&!o.validate().form()&&(d=!1),a=FLBuilderSettingsForms.settingsHaveChanged(),d&&a&&(t&&n.disableClose(),o.find(".fl-builder-settings-save").trigger("click"),t&&n.enableClose(),(o.find("label.error").length||e(".fl-builder-alert-lightbox:visible").length)&&(d=!1)),l&&(FLBuilder._destroySettingsForms(),!a&&FLBuilder.preview&&(FLBuilder.preview.clear(),FLBuilder.preview=null)),a||t||n.close()),d||(FLBuilder.triggerHook("didFailSettingsSave"),FLBuilder._toggleSettingsTabErrors(),i&&!e(".fl-builder-alert-lightbox:visible").length&&FLBuilder.alert(FLBuilderStrings.settingsHaveErrors)),d},_refreshSettingsPreviewReference:function(){FLBuilder.preview&&FLBuilder.preview._initElementsAndClasses()},_openNestedSettings:function(t){t.className&&-1===t.className.indexOf("fl-builder-settings-lightbox")&&(t.className+=" fl-builder-settings-lightbox"),t=e.extend({className:"fl-builder-lightbox fl-builder-settings-lightbox",destroyOnClose:!0,resizable:!0},t);var i=e(".fl-lightbox-wrap:visible"),l=i.find(".fl-lightbox"),o=new FLLightbox(t),s=o._node,n=s.find(".fl-lightbox");return i.hide(),s.attr("data-parent",i.attr("data-instance-id")),n.attr("style",l.attr("style")),o.on("resized",FLBuilder._calculateSettingsTabsOverflow),o.open('<div class="fl-builder-lightbox-loading"></div>'),o},_closeNestedSettings:function(){var t=e(".fl-builder-lightbox[data-parent]:visible"),i=t.find(".fl-lightbox"),l=t.attr("data-instance-id"),o=FLLightbox._instances[l],s=t.attr("data-parent"),n=e('[data-instance-id="'+s+'"]'),r=n.find(".fl-lightbox"),a=n.find("form"),d=FLLightbox._instances[s];o.on("close",function(){r.attr("style",i.attr("style")),n.show(),d._resize(),n.find("label.error").remove(),a.validate().hideErrors(),FLBuilder._toggleSettingsTabErrors()}),o.close()},_showHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeIn()},_hideHelpTooltip:function(){e(this).siblings(".fl-help-tooltip-text").fadeOut()},_initAutoSuggestFields:function(){var t=e(".fl-builder-settings:visible .fl-suggest-field"),i=null,l=null,o=null,s=[];t.each(function(){i=e(this),""!==i.attr("data-value")&&(FLBuilderSettingsForms.showFieldLoader(i),s.push({name:i.attr("name"),value:i.attr("data-value"),action:i.attr("data-action"),data:i.attr("data-action-data")}))}),s.length?FLBuilder.ajax({action:"get_autosuggest_values",fields:s},function(i){l=JSON.parse(i);for(o in l)e('.fl-suggest-field[name="'+o+'"]').attr("data-value",l[o]);t.each(FLBuilder._initAutoSuggestField)}):t.each(FLBuilder._initAutoSuggestField)},_initAutoSuggestField:function(){var t=e(this);t.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:t.data("action"),fl_as_action_data:t.data("action-data"),_wpnonce:FLBuilderConfig.ajaxNonce}),e.extend({},{asHtmlID:t.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:2,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,preFill:t.data("value"),queryParam:"fl_as_query",afterSelectionAdd:FLBuilder._updateAutoSuggestField,afterSelectionRemove:FLBuilder._updateAutoSuggestField,selectionLimit:t.data("limit")},t.data("args"))),FLBuilderSettingsForms.hideFieldLoader(t)},_updateAutoSuggestField:function(t,i,l){e(this).siblings(".as-values").val(l.join(",")).trigger("change")},_initCodeFields:function(){e(".fl-builder-settings:visible").find(".fl-code-field").each(FLBuilder._initCodeField)},_initCodeField:function(){var t=e(this),i=t.closest(".fl-builder-settings"),l=t.find("textarea"),o=(l.attr("id"),l.data("editor")),s=l.data("wrap"),n=e("<div>",{position:"absolute",height:20*parseInt(l.attr("rows"),10)}),r=null;n.insertBefore(l),l.css("display","none"),ace.require("ace/ext/language_tools"),r=ace.edit(n[0]),r.$blockScrolling=1/0,r.getSession().setValue(l.val()),r.getSession().setMode("ace/mode/"+o),s&&r.getSession().setUseWrapMode(!0),r.setOptions(FLBuilderConfig.AceEditorSettings),r.getSession().on("change",function(e){l.val(r.getSession().getValue()).trigger("change")}),r.getSession().on("changeAnnotation",function(){for(var e=r.getSession().getAnnotations(),t=i.find(".fl-builder-settings-save"),l=i.find(".fl-builder-settings-error"),o=!1,s=0;s<e.length;s++)if(!(e[s].text.indexOf("DOCTYPE")>-1||e[s].text.indexOf("Named entity expected")>-1||e[s].text.indexOf("@supports")>-1||"error"!==e[s].type)){o=!0;break}o&&!l.length&&FLBuilderConfig.CheckCodeErrors?(t.addClass("fl-builder-settings-error"),t.on("click",FLBuilder._showCodeFieldError)):!o&&l.length&&(l.removeClass("fl-builder-settings-error"),l.off("click",FLBuilder._showCodeFieldError))}),l.closest(".fl-field").data("editor",r)},_showCodeFieldError:function(t){t.stopImmediatePropagation(),FLBuilder.confirm({message:FLBuilderStrings.codeError,cancel:function(){var t=e(".fl-builder-settings:visible .fl-builder-settings-save");t.removeClass("fl-builder-settings-error"),t.off("click",FLBuilder._showCodeFieldError),
5
+ t.trigger("click")},strings:{ok:FLBuilderStrings.codeErrorFix,cancel:FLBuilderStrings.codeErrorIgnore}})},_initMultipleFields:function(){for(var t=e(".fl-builder-settings:visible .fl-builder-field-multiples"),i=null,l=null,o=0,s=FLBuilderConfig.isRtl?{left:10}:{right:10};o<t.length;o++)i=t.eq(o),l=i.find(".fl-builder-field-multiple"),1===l.length?l.eq(0).find(".fl-builder-field-actions").addClass("fl-builder-field-actions-single"):l.find(".fl-builder-field-actions").removeClass("fl-builder-field-actions-single");e(".fl-builder-field-multiples").sortable({items:".fl-builder-field-multiple",cursor:"move",cursorAt:s,distance:5,opacity:.5,placeholder:"fl-builder-field-dd-zone",stop:FLBuilder._fieldDragStop,tolerance:"pointer",axis:"y"})},_addFieldClicked:function(){var t=e(this),i=t.attr("data-field"),l=t.closest("tr").siblings("tr[data-field="+i+"]").last(),o=l.clone(),s=o.find(".fl-form-field"),n=null,r=parseInt(l.find("label span.fl-builder-field-index").html(),10)+1;o.find("th label span.fl-builder-field-index").html(r),o.find(".fl-form-field-preview-text").html(""),o.find(".fl-form-field-before").remove(),o.find(".fl-form-field-after").remove(),o.find("input, textarea, select").val(""),l.after(o),FLBuilder._initMultipleFields(),s.length&&(n=s.find(".fl-form-field-edit").data("type"),s.find("input").val(JSON.stringify(FLBuilderSettingsConfig.defaults.forms[n])))},_copyFieldClicked:function(){var t=e(this),i=t.closest("tr"),l=i.clone(),o=parseInt(i.find("label span.fl-builder-field-index").html(),10)+1;l.find("th label span.fl-builder-field-index").html(o),i.after(l),FLBuilder._renumberFields(i.parent()),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview()},_deleteFieldClicked:function(){var t=e(this).closest("tr"),i=t.parent(),l=confirm(FLBuilderStrings.deleteFieldMessage);l&&(t.remove(),FLBuilder._renumberFields(i),FLBuilder._initMultipleFields(),FLBuilder.preview.delayPreview())},_renumberFields:function(e){for(var t=e.find(".fl-builder-field-multiple"),i=0;i<t.length;i++)t.eq(i).find("th label span.fl-builder-field-index").html(i+1)},_fieldDragHelper:function(){return e('<div class="fl-builder-field-dd-helper"></div>')},_fieldDragStop:function(e,t){FLBuilder._renumberFields(t.item.parent()),FLBuilder.preview.delayPreview()},_initSelectFields:function(){e(".fl-builder-settings:visible").find(".fl-builder-settings-fields select").trigger("change")},_settingsSelectChanged:function(){var t=e(this),i=t.attr("data-toggle"),l=t.attr("data-hide"),o=t.attr("data-trigger"),s=t.val(),n=0;if("undefined"!=typeof i){i=JSON.parse(i);for(n in i)FLBuilder._settingsSelectToggle(i[n].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(i[n].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[n].tabs,"hide","a[href*=fl-builder-settings-tab-","]");"undefined"!=typeof i[s]&&(FLBuilder._settingsSelectToggle(i[s].fields,"show","#fl-field-"),FLBuilder._settingsSelectToggle(i[s].sections,"show","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(i[s].tabs,"show","a[href*=fl-builder-settings-tab-","]"))}if("undefined"!=typeof l&&(l=JSON.parse(l),"undefined"!=typeof l[s]&&(FLBuilder._settingsSelectToggle(l[s].fields,"hide","#fl-field-"),FLBuilder._settingsSelectToggle(l[s].sections,"hide","#fl-builder-settings-section-"),FLBuilder._settingsSelectToggle(l[s].tabs,"hide","a[href*=fl-builder-settings-tab-","]"))),"undefined"!=typeof o&&(o=JSON.parse(o),"undefined"!=typeof o[s]&&"undefined"!=typeof o[s].fields))for(n=0;n<o[s].fields.length;n++)e("#fl-field-"+o[s].fields[n]).find("select").trigger("change");FLBuilder._calculateSettingsTabsOverflow()},_settingsSelectToggle:function(t,i,l,o){var s=0;if(o="undefined"==typeof o?"":o,"undefined"!=typeof t)for(;s<t.length;s++)e(".fl-builder-settings:visible").find(l+t[s]+o)[i](),e(l+t[s]+o).parent().find('.fl-field[data-type="code"]').each(function(){e(this).data("editor").resize()})},_initColorPickers:function(){var t=FLBuilderConfig.colorPresets?FLBuilderConfig.colorPresets:[];FLBuilder.colorPicker=new FLBuilderColorPicker({mode:"hsv",elements:".fl-color-picker .fl-color-picker-value",presets:t,labels:{colorPresets:FLBuilderStrings.colorPresets,colorPicker:FLBuilderStrings.colorPicker,placeholder:FLBuilderStrings.placeholder,removePresetConfirm:FLBuilderStrings.removePresetConfirm,noneColorSelected:FLBuilderStrings.noneColorSelected,alreadySaved:FLBuilderStrings.alreadySaved,noPresets:FLBuilderStrings.noPresets,presetAdded:FLBuilderStrings.presetAdded}}),e(FLBuilder.colorPicker).on("presetRemoved presetAdded",function(e,t){FLBuilder.ajax({action:"save_color_presets",presets:t.presets})})},_initSinglePhotoSelector:function(){null===FLBuilder._singlePhotoSelector&&(FLBuilder._singlePhotoSelector=wp.media({title:FLBuilderStrings.selectPhoto,button:{text:FLBuilderStrings.selectPhoto},library:{type:"image"},multiple:!1}),FLBuilder._singlePhotoSelector.on("open",FLBuilder._wpmedia_reset_errors),_wpPluploadSettings.defaults.multipart_params.fl_upload_type="photo")},_selectSinglePhoto:function(){FLBuilder._initSinglePhotoSelector(),FLBuilder._singlePhotoSelector.once("open",e.proxy(FLBuilder._singlePhotoOpened,this)),FLBuilder._singlePhotoSelector.once("select",e.proxy(FLBuilder._singlePhotoSelected,this)),FLBuilder._singlePhotoSelector.open()},_singlePhotoOpened:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection"),i=e(this).closest(".fl-photo-field"),l=i.find("input[type=hidden]"),o=l.val(),s=null;e(this).hasClass("fl-photo-replace")?(t.reset(),i.addClass("fl-photo-empty"),l.val("")):""!==o?(s=wp.media.attachment(o),s.fetch(),t.add(s?[s]:[])):t.reset()},_singlePhotoSelected:function(){var t=FLBuilder._singlePhotoSelector.state().get("selection").first().toJSON(),i=e(this).closest(".fl-photo-field"),l=i.find("input[type=hidden]"),o=i.find(".fl-photo-preview img"),s=i.find("select");l.val(t.id),o.attr("src",FLBuilder._getPhotoSrc(t)),i.removeClass("fl-photo-empty").removeClass("fl-photo-no-attachment"),i.find("label.error").remove(),s.show(),s.html(FLBuilder._getPhotoSizeOptions(t)),s.trigger("change"),FLBuilderSettingsConfig.attachments[t.id]=t},_singlePhotoRemoved:function(){FLBuilder._initSinglePhotoSelector();var t=FLBuilder._singlePhotoSelector.state(),i="undefined"!=typeof t?t.get("selection"):null,l=e(this).closest(".fl-photo-field"),o=l.find("input[type=hidden]"),s=l.find("select");i&&i.reset(),l.addClass("fl-photo-empty"),o.val(""),s.html('<option value="" selected></option>'),s.trigger("change")},_getPhotoSrc:function(e){return"undefined"==typeof e.sizes?e.url:"undefined"!=typeof e.sizes.thumbnail?e.sizes.thumbnail.url:e.sizes.full.url},_getPhotoSizeOptions:function(e,t){var i="",l=null,o=null,s="",n={full:FLBuilderStrings.fullSize,large:FLBuilderStrings.large,medium:FLBuilderStrings.medium,thumbnail:FLBuilderStrings.thumbnail};if("undefined"==typeof e.sizes||0===e.sizes.length)i+='<option value="'+e.url+'">'+FLBuilderStrings.fullSize+"</option>";else{t&&(t=t.split(/[\\/]/).pop());for(l in e.sizes)s="undefined"!=typeof n[l]?n[l]+" - ":"undefined"!=typeof FLBuilderConfig.customImageSizeTitles[l]?FLBuilderConfig.customImageSizeTitles[l]+" - ":"",o="",t?t===e.sizes[l].url.split(/[\\/]/).pop()&&(o=' selected="selected"'):o="full"==l?' selected="selected"':"",i+='<option value="'+e.sizes[l].url+'"'+o+">"+s+e.sizes[l].width+" x "+e.sizes[l].height+"</option>"}return i},_selectMultiplePhotos:function(){var t=e(this).closest(".fl-multiple-photos-field"),i=t.find("input[type=hidden]"),l=i.val(),o=""===l?"":JSON.parse(l),s=wp.media.gallery.defaults.id,n='[gallery ids="-1"]',r=null,a=null,d=null,u=null,c=[];if("object"==typeof o){for(u in o)c.push(o[u]);n='[gallery ids="'+c.join()+'"]'}r=wp.shortcode.next("gallery",n).shortcode,_.isUndefined(r.get("id"))&&!_.isUndefined(s)&&r.set("id",s),a=wp.media.gallery.attachments(r),d=new wp.media.model.Selection(a.models,{props:a.props.toJSON(),multiple:!0}),d.gallery=a.gallery,d.more().done(function(){d.length||FLBuilder._multiplePhotoSelector.setState("gallery-library"),d.props.set({query:!1}),d.unmirror(),d.props.unset("orderby")}),FLBuilder._multiplePhotoSelector&&FLBuilder._multiplePhotoSelector.dispose(),FLBuilder._multiplePhotoSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-photos-edit")?"gallery-edit":"gallery-library",title:wp.media.view.l10n.editGalleryTitle,editing:!0,multiple:!0,selection:d}).open(),e(FLBuilder._multiplePhotoSelector.views.view.el).addClass("fl-multiple-photos-lightbox"),FLBuilder._multiplePhotoSelector.once("update",e.proxy(FLBuilder._multiplePhotosSelected,this))},_multiplePhotosSelected:function(t){for(var i=e(this).closest(".fl-multiple-photos-field"),l=i.find("input[type=hidden]"),o=i.find(".fl-multiple-photos-count"),s=[],n=0;n<t.models.length;n++)s.push(t.models[n].id);1==s.length?o.html("1 "+FLBuilderStrings.photoSelected):o.html(s.length+" "+FLBuilderStrings.photosSelected),i.removeClass("fl-multiple-photos-empty"),i.find("label.error").remove(),l.val(JSON.stringify(s)).trigger("change")},_initSingleVideoSelector:function(){null===FLBuilder._singleVideoSelector&&(FLBuilder._singleVideoSelector=wp.media({title:FLBuilderStrings.selectVideo,button:{text:FLBuilderStrings.selectVideo},library:{type:"video"},multiple:!1}),FLBuilder._singleVideoSelector.on("open",FLBuilder._wpmedia_reset_errors),_wpPluploadSettings.defaults.multipart_params.fl_upload_type="video")},_selectSingleVideo:function(){FLBuilder._initSingleVideoSelector(),FLBuilder._singleVideoSelector.once("select",e.proxy(FLBuilder._singleVideoSelected,this)),FLBuilder._singleVideoSelector.open()},_singleVideoSelected:function(){var t=FLBuilder._singleVideoSelector.state().get("selection").first().toJSON(),i=e(this).closest(".fl-video-field"),l=i.find(".fl-video-preview-img"),o=i.find(".fl-video-preview-filename"),s=i.find("input[type=hidden]");l.html('<span class="dashicons dashicons-media-video"></span>'),o.html(t.filename),i.removeClass("fl-video-empty"),i.find("label.error").remove(),s.val(t.id).trigger("change"),FLBuilderSettingsConfig.attachments[t.id]=t},_singleVideoRemoved:function(){FLBuilder._initSingleVideoSelector();var t=FLBuilder._singleVideoSelector.state(),i="undefined"!=typeof t?t.get("selection"):null,l=e(this).closest(".fl-video-field"),o=l.find(".fl-video-preview-img img"),s=l.find(".fl-video-preview-filename"),n=l.find("input[type=hidden]");i&&i.reset(),o.attr("src",""),s.html(""),l.addClass("fl-video-empty"),n.val("").trigger("change")},_selectMultipleAudios:function(){var t=e(this).closest(".fl-multiple-audios-field"),i=t.find("input[type=hidden]"),l=i.val(),o=""==l?'[playlist ids="-1"]':'[playlist ids="'+JSON.parse(l).join()+'"]',s=wp.shortcode.next("playlist",o).shortcode,n=wp.media.playlist.defaults.id,r=null,a=null;_.isUndefined(s.get("id"))&&!_.isUndefined(n)&&s.set("id",n),r=wp.media.playlist.attachments(s),a=new wp.media.model.Selection(r.models,{props:r.props.toJSON(),multiple:!0}),a.playlist=r.playlist,a.more().done(function(){a.props.set({query:!1}),a.unmirror(),a.props.unset("orderby")}),FLBuilder._multipleAudiosSelector&&FLBuilder._multipleAudiosSelector.dispose(),FLBuilder._multipleAudiosSelector=wp.media({frame:"post",state:e(this).hasClass("fl-multiple-audios-edit")?"playlist-edit":"playlist-library",title:wp.media.view.l10n.editPlaylistTitle,editing:!0,multiple:!0,selection:a}).open(),FLBuilder._multipleAudiosSelector.content.get("view").sidebar.unset("playlist"),FLBuilder._multipleAudiosSelector.on("content:render:browse",function(e){e&&e.sidebar.on("ready",function(){e.sidebar.unset("playlist")})}),FLBuilder._multipleAudiosSelector.once("update",e.proxy(FLBuilder._multipleAudiosSelected,this))},_multipleAudiosSelected:function(t){for(var i=e(this).closest(".fl-multiple-audios-field"),l=i.find(".fl-multiple-audios-count"),o=i.find("input[type=hidden]"),s=[],n=0;n<t.models.length;n++)s.push(t.models[n].id);1==s.length?l.html("1 "+FLBuilderStrings.audioSelected):l.html(s.length+" "+FLBuilderStrings.audiosSelected),o.val(JSON.stringify(s)).trigger("change"),i.removeClass("fl-multiple-audios-empty"),i.find("label.error").remove()},_selectIcon:function(){var e=this;FLIconSelector.open(function(t){FLBuilder._iconSelected.apply(e,[t])})},_iconSelected:function(t){var i=e(this).closest(".fl-icon-field"),l=i.find("input[type=hidden]"),o=i.find("i"),s=o.attr("data-icon");l.val(t).trigger("change"),o.removeClass(s),o.addClass(t),o.attr("data-icon",t),i.removeClass("fl-icon-empty"),i.find("label.error").remove()},_removeIcon:function(){var t=e(this).closest(".fl-icon-field"),i=t.find("input[type=hidden]"),l=t.find("i");i.val("").trigger("change"),l.removeClass(),l.attr("data-icon",""),t.addClass("fl-icon-empty")},_formFieldClicked:function(){var t=e(this),i=t.closest(".fl-builder-settings"),l=t.attr("data-type"),o=t.siblings("input").val(),s=FLBuilder._moduleHelpers[l],n=(FLBuilderSettingsConfig.forms[l],FLBuilder._openNestedSettings({className:"fl-builder-lightbox fl-form-field-settings"}));""===o&&(o=JSON.stringify(FLBuilderSettingsConfig.forms[l])),FLBuilderSettingsForms.render({id:l,nodeId:i.attr("data-node"),nodeSettings:FLBuilder._getSettings(i),settings:JSON.parse(o.replace(/&#39;/g,"'")),lightbox:n,helper:s,rules:s?s.rules:null},function(){t.attr("id","fl-"+n._node.attr("data-instance-id")),n._node.find("form.fl-builder-settings").attr("data-type",l)})},_saveFormFieldClicked:function(){var t=e(this).closest(".fl-builder-settings"),i=e(this).closest(".fl-lightbox-wrap").attr("data-instance-id"),l=t.attr("data-type"),o=FLBuilder._getSettings(t),s={},n=FLBuilder._moduleHelpers[l],r=e(".fl-builder-settings #fl-"+i),a=r.parent().attr("data-preview-text"),d=t.find("#fl-field-"+a),u=o[a],c=e('select[name="'+a+'"]'),h=document.createElement("div"),f=!0;return c.length>0&&(u=c.find('option[value="'+o[a]+'"]').text()),"undefined"!=typeof n&&(t.find("label.error").remove(),t.validate().hideErrors(),f=t.validate().form(),f&&(f=n.submit())),f?("undefined"!=typeof a&&"undefined"!=typeof u&&("icon"===d.data("type")?u='<i class="'+u+'"></i>':u.length>35&&(h.innerHTML=u,u=(h.textContent||h.innerText||"").replace(/^(.{35}[^\s]*).*/,"$1")+"..."),r.siblings(".fl-form-field-preview-text").html(u)),s=r.siblings("input").val().replace(/&#39;/g,"'"),""!=s&&(o=e.extend(JSON.parse(s),o)),r.siblings("input").val(JSON.stringify(o)).trigger("change"),FLBuilder._closeNestedSettings(),!0):(FLBuilder._toggleSettingsTabErrors(),!1)},_layoutFieldClicked:function(){var t=e(this);t.siblings().removeClass("fl-layout-field-option-selected"),t.addClass("fl-layout-field-option-selected"),t.siblings("input").val(t.attr("data-value"))},_initLinkFields:function(){e(".fl-builder-settings:visible .fl-link-field").each(FLBuilder._initLinkField)},_initLinkField:function(){var t=e(this),i=t.find(".fl-link-field-search-input");i.autoSuggest(FLBuilder._ajaxUrl({fl_action:"fl_builder_autosuggest",fl_as_action:"fl_as_links",_wpnonce:FLBuilderConfig.ajaxNonce}),{asHtmlID:i.attr("name"),selectedItemProp:"name",searchObjProps:"name",minChars:3,keyDelay:1e3,fadeOut:!1,usePlaceholder:!0,emptyText:FLBuilderStrings.noResultsFound,showResultListWhenNoMatch:!0,queryParam:"fl_as_query",selectionLimit:1,afterSelectionAdd:FLBuilder._updateLinkField})},_updateLinkField:function(e,t,i){var l=e.closest(".fl-link-field"),o=l.find(".fl-link-field-search"),s=l.find(".fl-link-field-search-input"),n=l.find(".fl-link-field-input");n.val(t.value).trigger("keyup"),s.autoSuggest("remove",t.value),o.hide()},_linkFieldSelectClicked:function(){var t=e(this).closest(".fl-link-field").find(".fl-link-field-search");t.show(),t.find("input").focus()},_linkFieldSelectCancelClicked:function(){var t=e(this);t.parent().hide(),t.closest(".fl-link-field").find("input.fl-link-field-input").focus()},_initFontFields:function(){e(".fl-builder-settings:visible .fl-font-field").each(FLBuilder._initFontField)},_initFontField:function(){var t=e(this),i=t.attr("data-value"),l=t.find(".fl-font-field-font"),o=t.find(".fl-font-field-weight");l.on("change",function(){FLBuilder._getFontWeights(l)}),i.indexOf("family")>-1&&(i=JSON.parse(i),l.val(i.family),l.trigger("change"),o.find("option[value="+i.weight+"]").length&&o.val(i.weight))},_getFontWeights:function(t){var i=t.next(".fl-font-field-weight"),l=t.val(),o={"default":"Default",regular:"Regular",100:"Thin 100",200:"Extra-Light 200",300:"Light 300",400:"Normal 400",500:"Medium 500",600:"Semi-Bold 600",700:"Bold 700",800:"Extra-Bold 800",900:"Ultra-Bold 900"},s={};i.html(""),s="undefined"!=typeof FLBuilderFontFamilies.system[l]?FLBuilderFontFamilies.system[l].weights:"undefined"!=typeof FLBuilderFontFamilies.google[l]?FLBuilderFontFamilies.google[l]:FLBuilderFontFamilies["default"][l],e.each(s,function(e,t){i.append('<option value="'+t+'">'+o[t]+"</option>")})},_initTinyMCE:function(){tinymce.ui.FloatPanel&&(tinymce.ui.FloatPanel.zIndex=100100),e(".fl-builder-hidden-editor").each(FLBuilder._initEditorField)},_initEditorFields:function(){e(".fl-builder-settings:visible .fl-editor-field").each(FLBuilder._initEditorField)},_initEditorField:function(){var t=e(this),i=t.find("textarea"),l=t.attr("data-name"),o="flrich"+(new Date).getTime()+"_"+l,s=FLBuilderConfig.wp_editor,n=tinyMCEPreInit,r=Number(t.attr("data-buttons")),a=t.attr("data-rows"),d=null,u=null;s=s.replace(/flbuildereditor/g,o),n=JSON.parse(JSON.stringify(n).replace(/flbuildereditor/g,o)),i.after(s).remove(),e("textarea#"+o).val(i.val()),void 0!==typeof tinymce&&void 0!==n.mceInit[o]&&(d=n.mceInit[o],u=tinymce.$("#wp-"+o+"-wrap"),u.find("textarea").attr("rows",a),r||u.find(".wp-media-buttons").remove(),!u.hasClass("tmce-active")&&n.qtInit.hasOwnProperty(o)||d.wp_skip_init||tinymce.init(d)),void 0!==typeof quicktags&&quicktags(n.qtInit[o]),window.wpActiveEditor=o},_reinitEditorFields:function(){e(".fl-lightbox-resizable:visible").length&&setTimeout(function(){var t,i;if("undefined"!=typeof tinymce){for(t=tinymce.editors.length-1;t>-1;t--)tinymce.editors[t].inline||(i=tinymce.editors[t].id,tinyMCE.execCommand("mceRemoveEditor",!0,i),tinyMCE.execCommand("mceAddEditor",!0,i));FLBuilder.preview&&FLBuilder.preview._initDefaultFieldPreviews(e('.fl-field[data-type="editor"]'))}},1)},_destroyEditorFields:function(){var t;if("undefined"!=typeof tinymce){for(t=tinymce.editors.length-1;t>-1;t--)tinymce.editors[t].inline||tinyMCE.execCommand("mceRemoveEditor",!0,tinymce.editors[t].id);e(".wplink-autocomplete").remove(),e(".ui-helper-hidden-accessible").remove()}},_updateEditorFields:function(){var t=e(".fl-builder-settings:visible textarea.wp-editor-area");t.each(FLBuilder._updateEditorField)},_updateEditorField:function(){var t=e(this),i=t.closest(".fl-editor-field"),l=(t.closest(".fl-builder-settings"),t.closest(".wp-editor-wrap")),o=t.attr("id"),s=i.attr("data-name"),n="undefined"!=typeof tinymce&&tinymce.get(o),r=t.siblings('textarea[name="'+s+'"]'),a=i.data("wpautop");0===r.length&&(r=e('<textarea name="'+s+'"></textarea>').hide(),t.after(r)),a?n&&l.hasClass("tmce-active")?r.val(n.getContent()):"undefined"!=typeof switchEditors?r.val(switchEditors.wpautop(t.val())):r.val(t.val()):(n&&l.hasClass("tmce-active")&&n.save(),r.val(t.val()))},_loopDataSourceChange:function(){var t=e(this).val();e(".fl-loop-data-source").hide(),e('.fl-loop-data-source[data-source="'+t+'"]').show()},_customQueryPostTypeChange:function(){var t=e(this).val();e(".fl-custom-query-filter").hide(),e(".fl-custom-query-"+t+"-filter").show()},_initOrderingFields:function(){e(".fl-builder-settings:visible .fl-ordering-field-options").each(FLBuilder._initOrderingField)},_initOrderingField:function(){e(this).sortable({items:".fl-ordering-field-option",containment:"parent",tolerance:"pointer",stop:FLBuilder._updateOrderingField})},_updateOrderingField:function(t){var i=e(t.target),l=i.siblings("input[type=hidden]"),o=[];i.find(".fl-ordering-field-option").each(function(){o.push(e(this).attr("data-key"))}),l.val(JSON.stringify(o)).trigger("change")},_textFieldAddValueSelectChange:function(){var t=e(this),i=e('input[name="'+t.data("target")+'"]'),l=i.val(),o=t.val(),s="";-1==l.indexOf(o)&&(s=(l.trim()+" "+o.trim()).trim(),i.val(s).trigger("change").trigger("keyup")),t.val("")},_onNumberFieldFocus:function(t){var i=e(t.currentTarget);i.addClass("mousetrap"),Mousetrap.bind("up",function(){i.attr("step",1)}),Mousetrap.bind("down",function(){i.attr("step",1)}),Mousetrap.bind("shift+up",function(){i.attr("step",10)}),Mousetrap.bind("shift+down",function(){i.attr("step",10)})},_onNumberFieldBlur:function(t){var i=e(t.currentTarget);i.attr("step",1).removeClass("mousetrap")},_initTimezoneFields:function(){e(".fl-builder-settings:visible .fl-field[data-type=timezone]").each(FLBuilder._initTimezoneField)},_initTimezoneField:function(){var t=e(this).find("select"),i=t.attr("data-value");t.find('option[value="'+i+'"]').attr("selected","selected")},ajax:function(t,i){var l;FLBuilder.triggerHook("didBeginAJAX",t);for(l in t)"undefined"==typeof t[l]&&(t[l]=null);return t._wpnonce=FLBuilderConfig.ajaxNonce,t.post_id=FLBuilderConfig.postId,t.fl_builder=1,t.fl_action=t.action,"undefined"!=typeof t.settings&&(t.settings=FLBuilder._ajaxModSecFix(e.extend(!0,{},t.settings))),"undefined"!=typeof t.node_settings&&(t.node_settings=FLBuilder._ajaxModSecFix(e.extend(!0,{},t.node_settings))),t={fl_builder_data:t},e.post(FLBuilder._ajaxUrl(),t,function(e){FLBuilder._ajaxComplete(),"undefined"!=typeof i&&i.call(this,e),FLBuilder.triggerHook("didCompleteAJAX",t)})},_ajaxComplete:function(){FLBuilder.hideAjaxLoader()},_ajaxUrl:function(e){var t=window.location.href.split("#").shift(),i=null;if("undefined"!=typeof e)for(i in e)t+=t.indexOf("?")>-1?"&":"?",t+=i+"="+e[i];return t},showAjaxLoader:function(){0===e(".fl-builder-lightbox-loading").length&&e(".fl-builder-loading").show()},hideAjaxLoader:function(){e(".fl-builder-loading").hide()},_showNodeLoading:function(t){var i=e(".fl-node-"+t);i.addClass("fl-builder-node-loading"),FLBuilder.triggerHook("didStartNodeLoading",i)},_hideNodeLoading:function(t){var i=e(".fl-node-"+t);i.removeClass("fl-builder-node-loading")},_showNodeLoadingPlaceholder:function(t,i){var l=e('<div class="fl-builder-node-loading-placeholder"></div>');t.hasClass("fl-builder-content")?siblings=t.find(" > .fl-row"):t.hasClass("fl-row-content")?siblings=t.find(" > .fl-col-group"):t.hasClass("fl-col-group")?(t.addClass("fl-col-group-has-child-loading"),siblings=t.find(" > .fl-col")):siblings=t.find(" > .fl-col-group, > .fl-module"),0===siblings.length||siblings.length==i?t.append(l):siblings.eq(i).before(l)},_removeNodeLoadingPlaceholder:function(e){var t=e.prev(".fl-builder-node-loading-placeholder"),i=e.next(".fl-builder-node-loading-placeholder");t.length?t.remove():i.remove()},_ajaxModSecFix:function(e){var t;if(FLBuilderConfig.modSecFix&&"undefined"!=typeof btoa)if("string"==typeof e)e=FLBuilder._btoa(e);else for(t in e)"string"==typeof e[t]?e[t]=FLBuilder._btoa(e[t]):"object"==typeof e[t]&&(e[t]=FLBuilder._ajaxModSecFix(e[t]));return e},_btoa:function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))},_wpmedia_reset_errors:function(){e(".upload-error").remove(),e(".media-uploader-status").removeClass("errors").hide()},_initLightboxes:function(){FLBuilder._lightbox=new FLLightbox({className:"fl-builder-lightbox fl-builder-settings-lightbox",resizable:!0}),FLBuilder._lightbox.on("resized",FLBuilder._calculateSettingsTabsOverflow),FLBuilder._lightbox.on("close",FLBuilder._lightboxClosed),FLBuilder._lightbox.on("beforeCloseLightbox",FLBuilder._destroyEditorFields),FLBuilder._actionsLightbox=new FLLightbox({className:"fl-builder-actions-lightbox"})},_showLightbox:function(){FLBuilder._lightbox.open('<div class="fl-builder-lightbox-loading"></div>'),FLBuilder._initLightboxScrollbars()},_setLightboxContent:function(e){FLBuilder._lightbox.setContent(e)},_initLightboxScrollbars:function(){FLBuilder._initScrollbars(),FLBuilder._lightboxScrollbarTimeout=setTimeout(FLBuilder._initLightboxScrollbars,500)},_lightboxClosed:function(){FLBuilder.triggerHook("settings-lightbox-closed"),FLBuilder._lightbox.empty(),clearTimeout(FLBuilder._lightboxScrollbarTimeout)},_showActionsLightbox:function(e){var t=wp.template("fl-actions-lightbox");FLBuilder.triggerHook("actions-lightbox-settings",e),FLBuilder._actionsLightbox.open(t(e))},alert:function(e){var t=new FLLightbox({className:"fl-builder-alert-lightbox",destroyOnClose:!0}),i=wp.template("fl-alert-lightbox");t.open(i({message:e}))},_alertClose:function(){FLLightbox.closeParent(this)},confirm:function(t){var i={message:"",ok:function(){},cancel:function(){},strings:{ok:FLBuilderStrings.ok,cancel:FLBuilderStrings.cancel}},l=e.extend({},i,"undefined"==typeof t?{}:t);lightbox=new FLLightbox({className:"fl-builder-confirm-lightbox fl-builder-alert-lightbox",destroyOnClose:!0}),template=wp.template("fl-confirm-lightbox"),lightbox.open(template(l)),lightbox._node.find(".fl-builder-confirm-ok").on("click",l.ok),lightbox._node.find(".fl-builder-confirm-cancel").on("click",l.cancel)},triggerHook:function(t,i){e("body").trigger("fl-builder."+t,i)},addHook:function(t,i){e("body").on("fl-builder."+t,i)},removeHook:function(t,i){e("body").off("fl-builder."+t,i)},log:function(e){"undefined"!=typeof window.console&&"undefined"!=typeof window.console.log&&console.log(e)},logError:function(e){var t=null;"undefined"!=typeof e&&("undefined"!=typeof e.stack?t=e.stack:"undefined"!=typeof e.message&&(t=e.message),t&&(FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(t),FLBuilder.log("************************************************************************")))},logGlobalError:function(e,t,i,l,o){FLBuilder.log("************************************************************************"),FLBuilder.log(FLBuilderStrings.errorMessage),FLBuilder.log(FLBuilderStrings.globalErrorMessage.replace("{message}",e).replace("{line}",i).replace("{file}",t)),"undefined"!=typeof o&&"undefined"!=typeof o.stack&&(FLBuilder.log(o.stack),FLBuilder.log("************************************************************************"))}},e(function(){FLBuilder._init()})}(jQuery),function(e){FLBuilderAJAXLayout=function(t,i){this._data=e.extend({},this._defaults,"string"==typeof t?JSON.parse(t):t),this._callback=i,this._post=FLBuilderConfig.postId,this._head=e("head").eq(0),this._body=e("body").eq(0),this._data.css&&(this._loader=e('<img src="'+this._data.css+'" />'),this._oldCss=e('link[href*="/cache/'+this._post+'-layout"]'),this._newCss=e('<link rel="stylesheet" id="fl-builder-layout-'+this._post+'-css" href="'+this._data.css+'" />')),this._data.partial?(this._data.js&&(this._oldJs=e("#fl-builder-partial-refresh-js"),this._newJs=e('<script type="text/javascript" id="fl-builder-partial-refresh-js">'+this._data.js+"</script>")),this._data.nodeId&&(this._data.oldNodeId?(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.oldNodeId+'"]'),this._content=e(".fl-node-"+this._data.oldNodeId)):(this._oldScriptsStyles=e('.fl-builder-node-scripts-styles[data-node="'+this._data.nodeId+'"]'),this._content=e(".fl-node-"+this._data.nodeId).eq(0)))):(this._oldJs=e('script[src*="/cache/'+this._post+'"]'),this._newJs=e('<script src="'+this._data.js+'"></script>'),this._oldScriptsStyles=e(".fl-builder-layout-scripts-styles"),this._content=e(FLBuilder._contentClass)),this._init()},FLBuilderAJAXLayout.prototype={_defaults:{partial:!1,nodeId:null,nodeType:null,nodeParent:null,nodePosition:null,oldNodeId:null,html:null,scriptsStyles:null,css:null,js:null},_data:null,_callback:function(){},_post:null,_head:null,_body:null,_loader:null,_oldCss:null,_newCss:null,_oldJs:null,_newJs:null,_oldScriptsStyles:null,_content:null,_init:function(){this._body.height(this._body.height()),this._loader?"onload"in document.createElement("link")?(this._newCss.on("load",e.proxy(this._finish,this)),this._addNewCSS()):(this._loader.on("error",e.proxy(this._loadNewCSSFallbackComplete,this)),this._body.append(this._loader)):this._finish()},_loadNewCSSFallbackComplete:function(){this._loader.remove(),this._addNewCSS(),setTimeout(e.proxy(this._finish,this),250)},_addNewCSS:function(){this._oldCss.length>0?this._oldCss.after(this._newCss):this._head.append(this._newCss)},_finish:function(){this._removeOldContentAndAssets(),this._cleanNewHTML(),this._cleanNewAssets(),this._addNewHTML(),this._addNewScriptsStyles(),this._addNewJS(),e(FLBuilder._contentClass).trigger("fl-builder.layout-rendered"),FLBuilder.hideAjaxLoader(),"undefined"!=typeof this._callback&&this._callback(),FLBuilder.triggerHook("didRenderLayoutComplete")},_removeOldContentAndAssets:function(){this._content&&this._content.empty(),this._oldCss&&this._oldCss.remove(),this._oldJs&&this._oldJs.remove(),this._oldScriptsStyles&&this._oldScriptsStyles.remove()},_cleanNewHTML:function(){if(this._data.scriptsStyles){var t=e("<div>"+this._data.html+"</div>"),i="fl-row",l=this._data.scriptsStyles,o="";this._data.partial&&(i="column-group"==this._data.nodeType?"fl-col-group":"column"==this._data.nodeType?"fl-col":"fl-"+this._data.nodeType),t.find("> *, script").each(function(){e(this).hasClass(i)||(o=e(this).remove(),l+=o[0].outerHTML)}),""!==l&&(l=this._data.partial?'<div class="fl-builder-node-scripts-styles" data-node="'+this._data.nodeId+'">'+l+"<div>":'<div class="fl-builder-node-scripts-styles">'+l+"<div>"),this._data.html=t.html(),this._data.scriptsStyles=l}},_addNewHTML:function(){var t;if(this._data.partial?this._data.nodeParent?(t=this._data.nodeParent.hasClass("fl-builder-content")?this._data.nodeParent.find(" > .fl-row"):this._data.nodeParent.hasClass("fl-row-content")?this._data.nodeParent.find(" > .fl-col-group"):this._data.nodeParent.hasClass("fl-col-group")?this._data.nodeParent.find(" > .fl-col"):this._data.nodeParent.find(" > .fl-col-group, > .fl-module"),t=t.filter(":not(.fl-builder-node-clone)"),0===t.length||t.length==this._data.nodePosition?this._data.nodeParent.append(this._data.html):t.eq(this._data.nodePosition).before(this._data.html),this._data.nodeId&&FLBuilder._removeNodeLoadingPlaceholder(e(".fl-node-"+this._data.nodeId))):(this._content.after(this._data.html),this._content.remove()):this._content.append(this._data.html),FLBuilder.preview&&this._data.nodeId&&this._data.nodeId!=FLBuilder.preview.nodeId){var i=e(FLBuilder.preview.classes.node),l=i.closest(".fl-node-"+this._data.nodeId).length;l&&i.html(FLBuilder.preview.elements.node.html())}},_cleanNewAssets:function(){var t=this;this._data.html=this._removeDuplicateAssets(this._data.html),this._data.scriptsStyles&&""!==this._data.scriptsStyles&&(this._data.scriptsStyles=this._removeDuplicateAssets(this._data.scriptsStyles)),this._data.partial?e(".fl-builder-node-scripts-styles").each(function(){t._data.html.indexOf("fl-node-"+e(this).data("node"))>-1&&e(this).remove()}):(e("#fl-builder-partial-refresh-js").remove(),e(".fl-builder-node-scripts-styles").remove())},_removeDuplicateAssets:function(t){var i=e("<div>"+t+"</div>"),l="",o=null,s="",n=null,r=window.location,a=r.protocol+"//"+r.hostname+(r.port?":"+r.port:"");return i.find("script").each(function(){l=e(this).attr("src"),"undefined"!=typeof l&&(l=l.replace(a,""),o=e('script[src*="'+l+'"]'),o.length>0&&e(this).remove())}),i.find("link").each(function(){s=e(this).attr("href"),"undefined"!=typeof s&&(s=s.replace(a,""),n=e('link[href*="'+s+'"]'),n.length>0&&e(this).remove())}),i.html()},_addNewScriptsStyles:function(){this._data.scriptsStyles&&""!==this._data.scriptsStyles&&this._body.append(this._data.scriptsStyles)},_addNewJS:function(){setTimeout(e.proxy(function(){this._newJs&&this._head.append(this._newJs)},this),50)},_complete:function(){FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._initDropTargets(),FLBuilder._initSortables(),FLBuilder._resizeLayout(),FLBuilder._initMediaElements(),FLBuilderLayout.init(),FLBuilderResponsiveEditing.refreshPreview(),
6
  this._body.height("auto")}}}(jQuery),function(e){FLBuilderPreview=function(e){this.type=e.type,this._saveState(),e.layout?FLBuilder._renderLayout(e.layout,function(){this._init(),e.callback&&e.callback()}.bind(this)):this._init()},FLBuilderPreview._fontsList={},FLBuilderPreview.getFormattedSelector=function(e,t){for(var i="",l=t.split(","),o=0;o<l.length;o++)l[o].indexOf("{node}")>-1?i=l[o].replace("{node}",e):i+=e+" "+l[o],o!=l.length-1&&(i+=", ");return i},FLBuilderPreview.prototype={type:"",nodeId:null,classes:{},elements:{},state:null,_savedSettings:null,_styleSheet:null,_styleSheetMedium:null,_styleSheetResponsive:null,_timeout:null,_loaderTimeout:null,_lastClassName:null,_xhr:null,_init:function(){switch(this.nodeId=e(".fl-builder-settings").data("node"),this._saveSettings(),this._initElementsAndClasses(),this._createSheets(),this._initResponsivePreviews(),this._initDefaultFieldPreviews(),this.type){case"row":this._initRow();break;case"col":this._initColumn();break;case"module":this._initModule()}},_saveSettings:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings");this._savedSettings=FLBuilder._getSettingsForChangedCheck(this.nodeId,t)},_settingsHaveChanged:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),i=FLBuilder._getSettings(t);return JSON.stringify(this._savedSettings)!=JSON.stringify(i)},_initElementsAndClasses:function(){var t;t="row"==this.type?".fl-row-content-wrap":".fl-"+this.type+"-content",e.extend(this.classes,{settings:".fl-builder-"+this.type+"-settings",settingsHeader:".fl-builder-"+this.type+"-settings .fl-lightbox-header",node:FLBuilder._contentClass+" .fl-node-"+this.nodeId,content:FLBuilder._contentClass+" .fl-node-"+this.nodeId+" > "+t}),e.extend(this.elements,{settings:e(this.classes.settings),settingsHeader:e(this.classes.settingsHeader),node:e(this.classes.node),content:e(this.classes.content)})},_createSheets:function(){this._destroySheets(),this._styleSheet||(this._styleSheet=new FLStyleSheet({id:"fl-builder-preview",className:"fl-builder-preview-style"})),this._styleSheetMedium||(this._styleSheetMedium=new FLStyleSheet({id:"fl-builder-preview-medium",className:"fl-builder-preview-style"})),this._styleSheetResponsive||(this._styleSheetResponsive=new FLStyleSheet({id:"fl-builder-preview-responsive",className:"fl-builder-preview-style"}))},_destroySheets:function(){this._styleSheet&&(this._styleSheet.destroy(),this._styleSheet=null),this._styleSheetMedium&&(this._styleSheetMedium.destroy(),this._styleSheetMedium=null),this._styleSheetResponsive&&(this._styleSheetResponsive.destroy(),this._styleSheetResponsive=null)},updateCSSRule:function(e,t,i){this._styleSheet.updateRule(e,t,i)},delay:function(e,t){this._cancelDelay(),this._timeout=setTimeout(t,e)},_cancelDelay:function(){null!==this._timeout&&clearTimeout(this._timeout)},hexToRgb:function(e){var t=parseInt(e,16),i=t>>16&255,l=t>>8&255,o=255&t;return[i,l,o]},parseFloat:function(e){return isNaN(parseFloat(e))?0:parseFloat(e)},_initResponsivePreviews:function(){FLBuilder.addHook("responsive-editing-switched.preview",e.proxy(this._responsiveEditingSwitched,this))},_destroyResponsivePreviews:function(){FLBuilder.removeHook("responsive-editing-switched.preview")},_responsiveEditingSwitched:function(e,t){"default"==t?(this._styleSheetMedium.disable(),this._styleSheetResponsive.disable()):"medium"==t?(this._styleSheetMedium.enable(),this._styleSheetResponsive.disable()):"responsive"==t&&(this._styleSheetMedium.disable(),this._styleSheetResponsive.enable())},updateResponsiveCSSRule:function(e,t,i){var l=FLBuilderResponsiveEditing._mode,o="default"==l?"":l.charAt(0).toUpperCase()+l.slice(1);this["_styleSheet"+o].updateRule(e,t,i)},_saveState:function(){var t=FLBuilderConfig.postId,i=e('link[href*="/cache/'+t+'"]').attr("href"),l=e('script[src*="/cache/'+t+'"]').attr("src"),o=e(FLBuilder._contentClass).html();this.state={css:i,js:l,html:o}},preview:function(){var t=e(".fl-builder-settings-lightbox .fl-builder-settings"),i=t.attr("data-node"),l=FLBuilder._getSettings(t);FLBuilder._showNodeLoading(i),this._cancelPreview(),this._xhr=FLBuilder.ajax({action:"render_layout",node_id:i,node_preview:l},e.proxy(this._renderPreview,this))},delayPreview:function(t){var i="undefined"==typeof t?[]:e(t.target).closest("tr").find("th"),l=e(".fl-builder-widget-settings .fl-builder-settings-title"),o=e(".fl-builder-settings .fl-lightbox-header"),s=FLBuilderLayoutConfig.paths.pluginUrl+"img/ajax-loader-small.svg",n=e('<img class="fl-builder-preview-loader" src="'+s+'" />');this.delay(1e3,e.proxy(this.preview,this)),this._loaderTimeout=setTimeout(function(){e(".fl-builder-preview-loader").remove(),i.length>0?i.append(n):l.length>0?l.append(n):o.length>0&&o.append(n)},1500)},_cancelPreview:function(){this._xhr&&(this._xhr.abort(),this._xhr=null)},_renderPreview:function(t){this._xhr=null,FLBuilder._renderLayout(t,e.proxy(this._renderPreviewComplete,this))},_renderPreviewComplete:function(){this._createSheets(),this._initElementsAndClasses(),null!==this._loaderTimeout&&clearTimeout(this._loaderTimeout),e(".fl-builder-preview-loader").remove(),e(FLBuilder._contentClass).trigger("fl-builder.preview-rendered")},revert:function(){return this._settingsHaveChanged()?void FLBuilder._updateNode(this.nodeId,function(){this.clear()}.bind(this)):void this.clear()},cancel:function(){this._cancelDelay(),this._cancelPreview()},clear:function(){this.cancel(),this._destroySheets(),this._destroyResponsivePreviews()},_initNodeTextColor:function(){e.extend(this.elements,{textColor:e(this.classes.settings+" input[name=text_color]"),linkColor:e(this.classes.settings+" input[name=link_color]"),hoverColor:e(this.classes.settings+" input[name=hover_color]"),headingColor:e(this.classes.settings+" input[name=heading_color]")}),this.elements.textColor.on("change",e.proxy(this._textColorChange,this)),this.elements.linkColor.on("change",e.proxy(this._textColorChange,this)),this.elements.hoverColor.on("change",e.proxy(this._textColorChange,this)),this.elements.headingColor.on("change",e.proxy(this._textColorChange,this))},_textColorChange:function(t){var i=this.elements.textColor.val(),l=this.elements.linkColor.val(),o=this.elements.hoverColor.val(),s=this.elements.headingColor.val();l=""===l?i:l,o=""===o?i:o,s=""===s?i:s,this.delay(100,e.proxy(function(){""===i?this.updateCSSRule(this.classes.node,"color","inherit"):this.updateCSSRule(this.classes.node,"color","#"+i),""===l?this.updateCSSRule(this.classes.node+" a","color","inherit"):this.updateCSSRule(this.classes.node+" a","color","#"+l),""===o?this.updateCSSRule(this.classes.node+" a:hover","color","inherit"):this.updateCSSRule(this.classes.node+" a:hover","color","#"+o),""===s?(this.updateCSSRule(this.classes.node+" h1","color","inherit"),this.updateCSSRule(this.classes.node+" h2","color","inherit"),this.updateCSSRule(this.classes.node+" h3","color","inherit"),this.updateCSSRule(this.classes.node+" h4","color","inherit"),this.updateCSSRule(this.classes.node+" h5","color","inherit"),this.updateCSSRule(this.classes.node+" h6","color","inherit"),this.updateCSSRule(this.classes.node+" h1 a","color","inherit"),this.updateCSSRule(this.classes.node+" h2 a","color","inherit"),this.updateCSSRule(this.classes.node+" h3 a","color","inherit"),this.updateCSSRule(this.classes.node+" h4 a","color","inherit"),this.updateCSSRule(this.classes.node+" h5 a","color","inherit"),this.updateCSSRule(this.classes.node+" h6 a","color","inherit")):(this.updateCSSRule(this.classes.node+" h1","color","#"+s),this.updateCSSRule(this.classes.node+" h2","color","#"+s),this.updateCSSRule(this.classes.node+" h3","color","#"+s),this.updateCSSRule(this.classes.node+" h4","color","#"+s),this.updateCSSRule(this.classes.node+" h5","color","#"+s),this.updateCSSRule(this.classes.node+" h6","color","#"+s),this.updateCSSRule(this.classes.node+" h1 a","color","#"+s),this.updateCSSRule(this.classes.node+" h2 a","color","#"+s),this.updateCSSRule(this.classes.node+" h3 a","color","#"+s),this.updateCSSRule(this.classes.node+" h4 a","color","#"+s),this.updateCSSRule(this.classes.node+" h5 a","color","#"+s),this.updateCSSRule(this.classes.node+" h6 a","color","#"+s))},this))},_initNodeBg:function(){e.extend(this.elements,{bgType:e(this.classes.settings+" select[name=bg_type]"),bgColor:e(this.classes.settings+" input[name=bg_color]"),bgColorPicker:e(this.classes.settings+" .fl-picker-bg_color"),bgOpacity:e(this.classes.settings+" input[name=bg_opacity]"),bgImageSrc:e(this.classes.settings+" select[name=bg_image_src]"),bgRepeat:e(this.classes.settings+" select[name=bg_repeat]"),bgPosition:e(this.classes.settings+" select[name=bg_position]"),bgAttachment:e(this.classes.settings+" select[name=bg_attachment]"),bgSize:e(this.classes.settings+" select[name=bg_size]"),bgVideoSource:e(this.classes.settings+" select[name=bg_video_source]"),bgVideo:e(this.classes.settings+" input[name=bg_video]"),bgVideoServiceUrl:e(this.classes.settings+" input[name=bg_video_service_url]"),bgVideoFallbackSrc:e(this.classes.settings+" select[name=bg_video_fallback_src]"),bgSlideshowSource:e(this.classes.settings+" select[name=ss_source]"),bgSlideshowPhotos:e(this.classes.settings+" input[name=ss_photos]"),bgSlideshowFeedUrl:e(this.classes.settings+" input[name=ss_feed_url]"),bgSlideshowSpeed:e(this.classes.settings+" input[name=ss_speed]"),bgSlideshowTrans:e(this.classes.settings+" select[name=ss_transition]"),bgSlideshowTransSpeed:e(this.classes.settings+" input[name=ss_transitionDuration]"),bgParallaxImageSrc:e(this.classes.settings+" select[name=bg_parallax_image_src]"),bgOverlayColor:e(this.classes.settings+" input[name=bg_overlay_color]"),bgOverlayOpacity:e(this.classes.settings+" input[name=bg_overlay_opacity]")}),this.elements.bgType.on("change",e.proxy(this._bgTypeChange,this)),this.elements.bgColor.on("change",e.proxy(this._bgColorChange,this)),this.elements.bgOpacity.on("keyup",e.proxy(this._bgOpacityChange,this)),this.elements.bgImageSrc.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgRepeat.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgPosition.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgAttachment.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgSize.on("change",e.proxy(this._bgPhotoChange,this)),this.elements.bgVideoServiceUrl.on("change",e.proxy(this._bgVideoChange,this)),this.elements.bgSlideshowSource.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowPhotos.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowFeedUrl.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTrans.on("change",e.proxy(this._bgSlideshowChange,this)),this.elements.bgSlideshowTransSpeed.on("keyup",e.proxy(this._bgSlideshowChange,this)),this.elements.bgParallaxImageSrc.on("change",e.proxy(this._bgParallaxChange,this)),this.elements.bgOverlayColor.on("change",e.proxy(this._bgOverlayChange,this)),this.elements.bgOverlayOpacity.on("keyup",e.proxy(this._bgOverlayChange,this))},_bgTypeChange:function(e){var t=this.elements.bgType.val();this.elements.node.removeClass("fl-row-bg-video"),this.elements.node.removeClass("fl-row-bg-slideshow"),this.elements.node.removeClass("fl-row-bg-parallax"),this.elements.node.find(".fl-bg-video").remove(),this.elements.node.find(".fl-bg-slideshow").remove(),this.elements.content.css("background-image",""),this.updateCSSRule(this.classes.content,{"background-color":"transparent","background-image":"none"}),"none"==t?this._bgOverlayClear():"color"==t?(this.elements.bgColor.trigger("change"),this._bgOverlayClear()):"photo"==t?(this.elements.bgColor.trigger("change"),this.elements.bgImageSrc.trigger("change")):"video"==t?(this.elements.bgColor.trigger("change"),this._bgVideoChange()):"slideshow"==t?(this.elements.bgColor.trigger("change"),this._bgSlideshowChange()):"parallax"==t&&(this.elements.bgColor.trigger("change"),this.elements.bgParallaxImageSrc.trigger("change"))},_bgColorChange:function(t){var i,l,o;""===this.elements.bgColor.val()||isNaN(this.elements.bgOpacity.val())?this.updateCSSRule(this.classes.content,"background-color","transparent"):(i=this.hexToRgb(this.elements.bgColor.val()),l=this.parseFloat(this.elements.bgOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"background-color",o)},this)))},_bgOpacityChange:function(e){this.elements.bgColor.trigger("change")},_bgPhotoChange:function(e){this.elements.bgImageSrc.val()?this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgImageSrc.val()+")","background-repeat":this.elements.bgRepeat.val(),"background-position":this.elements.bgPosition.val(),"background-attachment":this.elements.bgAttachment.val(),"background-size":this.elements.bgSize.val()}):this.updateCSSRule(this.classes.content,{"background-image":"none"})},_bgVideoChange:function(t){var i=this.elements,l=i.bgVideoSource.val(),o=i.bgVideo.val(),s=i.bgVideoServiceUrl.val(),n="https://www.youtube.com/iframe_api",r="https://player.vimeo.com/api/player.js",a=e("<script>");"video_service"==l&&""!=s?(/^(?:(?:(?:https?:)?\/\/)?(?:www.)?(?:youtu(?:be.com|.be))\/(?:watch\?v\=|v\/|embed\/)?([\w\-]+))/i.test(s)&&e('script[src*="youtube.com"').length<1?a.attr("src",n):/^(http\:\/\/|https\:\/\/)?(www\.)?(vimeo\.com\/)([0-9]+)$/.test(s)&&e('script[src*="vimeo.com"').length<1&&a.attr("src",r),a.attr("type","text/javascript").appendTo("head"),this.delay(500,e.proxy(this.preview,this))):""!=o&&this.preview()},_bgSlideshowChange:function(t){var i=this.elements,l=i.bgSlideshowSource.val(),o=i.bgSlideshowPhotos.val(),s=i.bgSlideshowFeedUrl.val(),n=i.bgSlideshowSpeed.val(),r=i.bgSlideshowTransSpeed.val();"wordpress"==l&&""===o||"smugmug"==l&&""===s||isNaN(parseInt(n))||isNaN(parseInt(r))||this.delay(500,e.proxy(this.preview,this))},_bgParallaxChange:function(e){this.elements.bgParallaxImageSrc.val()&&this.updateCSSRule(this.classes.content,{"background-image":"url("+this.elements.bgParallaxImageSrc.val()+")","background-repeat":"no-repeat","background-position":"center center","background-attachment":"fixed","background-size":"cover"})},_bgOverlayChange:function(t){var i,l,o;""===this.elements.bgOverlayColor.val()||isNaN(this.elements.bgOverlayOpacity.val())?(this.elements.node.removeClass("fl-row-bg-overlay"),this.elements.node.removeClass("fl-col-bg-overlay"),this.updateCSSRule(this.classes.content+":after","background-color","transparent")):(i=this.hexToRgb(this.elements.bgOverlayColor.val()),l=this.parseFloat(this.elements.bgOverlayOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.elements.node.hasClass("fl-col")?this.elements.node.addClass("fl-col-bg-overlay"):this.elements.node.addClass("fl-row-bg-overlay"),this.updateCSSRule(this.classes.content+":after","background-color",o)},this)))},_bgOverlayClear:function(e){this.elements.bgOverlayColor.prev(".fl-color-picker-clear").trigger("click")},_initNodeBorder:function(){e.extend(this.elements,{borderType:e(this.classes.settings+" select[name=border_type]"),borderColor:e(this.classes.settings+" input[name=border_color]"),borderColorPicker:e(this.classes.settings+" .fl-picker-border_color"),borderOpacity:e(this.classes.settings+" input[name=border_opacity]")}),this.elements.borderType.on("change",e.proxy(this._borderTypeChange,this)),this.elements.borderColor.on("change",e.proxy(this._borderColorChange,this)),this.elements.borderOpacity.on("keyup",e.proxy(this._borderOpacityChange,this))},_borderTypeChange:function(e){var t=this.elements.borderType.val();this.updateCSSRule(this.classes.content,{"border-style":""===t?"none":t}),this.elements.borderColor.trigger("change"),this.elements.borderTop.trigger("keyup")},_borderColorChange:function(t){var i,l,o;""===this.elements.borderColor.val()||isNaN(this.elements.borderOpacity.val())?this.updateCSSRule(this.classes.content,"border-color","transparent"):(i=this.hexToRgb(this.elements.borderColor.val()),l=parseInt(this.elements.borderOpacity.val())/100,o="rgba("+i.join()+", "+l+")",this.delay(100,e.proxy(function(){this.updateCSSRule(this.classes.content,"border-color",o)},this)))},_borderOpacityChange:function(e){this.elements.borderColor.trigger("change")},_initNodeClassName:function(){e.extend(this.elements,{className:e(this.classes.settings+" input[name=class]")}),this.elements.className.on("keyup",e.proxy(this._classNameChange,this)),this._lastClassName=this.elements.className.val()},_classNameChange:function(e){var t=this.elements.className.val();null!==this._lastClassName&&this.elements.node.removeClass(this._lastClassName),this.elements.node.addClass(t),this._lastClassName=t},_initResponsiveDimensions:function(t){var i={},l=["Top","Bottom","Left","Right"],o=["","Medium","Responsive"],s=this.classes.settings,n="",r="",a=null,d=null;for(a=0;a<l.length;a++)for(d=0;d<o.length;d++)n=t+l[a]+o[d],r=t+"_"+l[a].toLowerCase(),""!=o[d]&&(r+="_"+o[d].toLowerCase()),i[n]=e(s+" input[name="+r+"]"),i[n].on("keyup",e.proxy(this._responsiveDimensionChange,this,t));e.extend(this.elements,i)},_getDimensions:function(e){for(var t=FLBuilderResponsiveEditing._mode,i=["Top","Bottom","Left","Right"],l="default"==t?"":t.charAt(0).toUpperCase()+t.slice(1),o={},s=0;s<i.length;s++)o[i[s].toLowerCase()]=this.elements[e+i[s]+l].val();return this._normalizeDimensionValues(o,e)},_responsiveDimensionChange:function(t){var i=this._getDimensions(t),l={},o="border"==t;e.each(i,function(e,i){l[t+"-"+e+(o?"-width":"")]=i}),this.updateResponsiveCSSRule(this.classes.content,l),this._positionAbsoluteBgs()},_normalizeDimensionValues:function(t,i){var l=this,o=FLBuilderResponsiveEditing._mode,s="default"==o?"":o.charAt(0).toUpperCase()+o.slice(1),i=i.split("-");return"undefined"==typeof i[1]?i[1]="":i[1]=i[1].charAt(0).toUpperCase()+i[1].slice(1),e.map(t,function(e,o){if(e=e.toLowerCase().replace(/[^a-z0-9%.\-]/g,""),""===e){var n=i[0]+o.charAt(0).toUpperCase()+o.slice(1)+i[1]+s,r=l.elements[n].attr("placeholder");r&&(e=r)}null===e||""===e||isNaN(e)||(e=parseFloat(e)+"px"),t[o]=e}),t},_positionAbsoluteBgs:function(){var t=this.elements.node.find(".fl-bg-slideshow"),i=this.elements.node.find(".fl-bg-video"),l=null,o=null,s={top:0,bottom:0,left:0,right:0};(t.length>0||i.length>0)&&(l=this._getDimensions("margin"),o=this._getDimensions("border"),e.map(s,function(e,t){l[t]&&o[t]?s[t]="calc("+l[t]+"+"+o[t]+")":l[t]?s[t]=l[t]:o[t]&&(s[t]=o[t])}),t.length>0&&(this.updateCSSRule(this.classes.node+" .fl-bg-slideshow",s),FLBuilder._resizeLayout()),i.length>0&&this.updateCSSRule(this.classes.node+" .fl-bg-video",s))},_initRow:function(){e.extend(this.elements,{width:e(this.classes.settings+" select[name=width]"),contentWidth:e(this.classes.settings+" select[name=content_width]"),maxContentWidth:e(this.classes.settings+" input[name=max_content_width]"),height:e(this.classes.settings+" select[name=full_height]"),align:e(this.classes.settings+" select[name=content_alignment]")}),this.elements.width.on("change",e.proxy(this._rowWidthChange,this)),this.elements.contentWidth.on("change",e.proxy(this._rowContentWidthChange,this)),this.elements.maxContentWidth.on("keyup",e.proxy(this._rowMaxContentWidthChange,this)),this.elements.height.on("change",e.proxy(this._rowHeightChange,this)),this.elements.align.on("change",e.proxy(this._rowHeightChange,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_rowWidthChange:function(e){var t=this.elements.node,i=this.elements.maxContentWidth.val();"full"==this.elements.width.val()?(t.css("max-width","none"),t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"),""!==i?t.css("max-width",i+"px"):t.css("max-width",FLBuilderConfig.global.row_width+"px"))},_rowHeightChange:function(e){var t=this.elements.node;t.removeClass("fl-row-align-top"),t.removeClass("fl-row-align-center"),t.removeClass("fl-row-align-bottom"),"full"==this.elements.height.val()?(t.addClass("fl-row-full-height"),t.addClass("fl-row-align-"+this.elements.align.val())):t.removeClass("fl-row-full-height")},_rowContentWidthChange:function(e){var t=this.elements.content.find(".fl-row-content"),i=this.elements.maxContentWidth.val();"full"==this.elements.contentWidth.val()?(t.css("max-width","none"),t.removeClass("fl-row-fixed-width"),t.addClass("fl-row-full-width")):(t.removeClass("fl-row-full-width"),t.addClass("fl-row-fixed-width"),""!==i?t.css("max-width",i+"px"):t.css("max-width",FLBuilderConfig.global.row_width+"px"))},_rowMaxContentWidthChange:function(e){var t=this.elements.node,i=this.elements.content.find(".fl-row-content"),l=this.elements.maxContentWidth.val();""==l?l=FLBuilderConfig.global.row_width+"px":l+="px","fixed"==this.elements.width.val()&&t.css("max-width",l),"fixed"==this.elements.contentWidth.val()&&i.css("max-width",l)},_initColumn:function(){e.extend(this.elements,{size:e(this.classes.settings+" input[name=size]"),columnHeight:e(this.classes.settings+" select[name=equal_height]"),columnAlign:e(this.classes.settings+" select[name=content_alignment]"),responsiveOrder:e(this.classes.settings+" select[name=responsive_order]")}),this.elements.size.on("keyup",e.proxy(this._colSizeChange,this)),this.elements.columnHeight.on("change",e.proxy(this._colHeightChange,this)),this.elements.columnAlign.on("change",e.proxy(this._colHeightChange,this)),this.elements.responsiveOrder.on("change",e.proxy(this._colResponsiveOrder,this)),this._initNodeTextColor(),this._initNodeBg(),this._initNodeClassName(),this._initNodeBorder(),this._initResponsiveDimensions("border"),this._initResponsiveDimensions("margin"),this._initResponsiveDimensions("padding")},_colSizeChange:function(){var t=8,i=100-t,l=parseFloat(this.elements.size.val()),o=this.elements.node.prev(".fl-col"),s=this.elements.node.next(".fl-col"),n=0===s.length?o:s,r=this.elements.node.siblings(".fl-col"),a=0;0===r.length||isNaN(l)||(r.each(function(){e(this).data("node")!=n.data("node")&&(i-=parseFloat(e(this)[0].style.width),a+=parseFloat(e(this)[0].style.width))}),l<t&&(l=t),l>i&&(l=i),n.css("width",100-a-l+"%"),this.elements.node.css("width",l+"%"))},_colHeightChange:function(){var e=this.elements.node.parent(".fl-col-group");e.removeClass("fl-col-group-align-top"),e.removeClass("fl-col-group-align-center"),e.removeClass("fl-col-group-align-bottom"),"yes"==this.elements.columnHeight.val()?(e.addClass("fl-col-group-equal-height"),e.addClass("fl-col-group-align-"+this.elements.columnAlign.val())):e.removeClass("fl-col-group-equal-height")},_colResponsiveOrder:function(){var e=this.elements.node.parent(".fl-col-group");"reversed"==this.elements.responsiveOrder.val()?e.addClass("fl-col-group-responsive-reversed"):e.removeClass("fl-col-group-responsive-reversed")},_initModule:function(){this._initNodeClassName(),this._initResponsiveDimensions("margin")},_initDefaultFieldPreviews:function(e){for(var e=_.isUndefined(e)?this.elements.settings.find(".fl-field"):e,t=null,i=null,l=0;l<e.length;l++)t=e.eq(l),i=t.data("preview"),"refresh"==i.type&&this._initFieldRefreshPreview(t),"text"==i.type&&this._initFieldTextPreview(t),"css"==i.type&&this._initFieldCSSPreview(t),"widget"==i.type&&this._initFieldWidgetPreview(t),"font"==i.type&&this._initFieldFontPreview(t)},_initFieldRefreshPreview:function(t){var i=t.data("type"),l=t.data("preview"),o=e.proxy(this.delayPreview,this);switch(i){case"text":t.find("input[type=text]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"select":t.find("select").on("change",o);break;case"color":t.find(".fl-color-picker-value").on("change",o);break;case"photo":t.find("select").on("change",o);break;case"multiple-photos":t.find("input").on("change",o);break;case"photo-sizes":t.find("select").on("change",o);break;case"video":t.find("input").on("change",o);break;case"multiple-audios":t.find("input").on("change",o);break;case"icon":t.find("input").on("change",o);break;case"form":t.delegate("input","change",o);break;case"editor":this._addTextEditorCallback(t,l);break;case"code":t.find("textarea").on("change",o);break;case"post-type":t.find("select").on("change",o);break;case"suggest":t.find(".as-values").on("change",o),t.find("select").on("change",o);break;case"unit":case"dimension":t.find("input[type=number]").on("keyup",o);break;case"ordering":t.find("input[type=hidden]").on("change",o);break;default:t.on("change",o)}},_initFieldTextPreview:function(t){var i=t.data("type"),l=t.data("preview"),o=e.proxy(this._previewText,this,l);switch(i){case"text":t.find("input[type=text]").on("keyup",o);break;case"unit":t.find("input[type=number]").on("keyup",o);break;case"textarea":t.find("textarea").on("keyup",o);break;case"code":t.find("textarea").on("change",o);break;case"editor":this._addTextEditorCallback(t,l)}},_previewText:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=e(l),s=e("<div>"+e(i.target).val()+"</div>");o.length>0?(s.find("script").remove(),o.html(s.html())):this.delayPreview(i)},_previewTextEditor:function(t,i,l){var o=this._getPreviewSelector(this.classes.node,t.selector),s=e(o),n="undefined"!=typeof tinyMCE?tinyMCE.get(i):null,r=e("#"+i),a="";s.length>0&&(a=e(n&&"none"==r.css("display")?"<div>"+n.getContent()+"</div>":"undefined"==typeof switchEditors||"undefined"==typeof switchEditors.wpautop?"<div>"+r.val()+"</div>":"<div>"+switchEditors.wpautop(r.val())+"</div>"),a.find("script").remove(),s.html(a.html()))},_addTextEditorCallback:function(t,i){var l=t.find("textarea.wp-editor-area").attr("id"),o=null;if("refresh"==i.type)o=e.proxy(this.delayPreview,this);else{if("text"!=i.type)return;o=e.proxy(this._previewTextEditor,this,i,l)}e("#"+l).on("keyup",o),"undefined"!=typeof tinyMCE&&(editor=tinyMCE.get(l),editor.on("change",o),editor.on("keyup",o))},_initFieldFontPreview:function(t){var i=t.data("type"),l=t.data("preview");l.id=t.attr("id");var o=e.proxy(this._previewFont,this,l);"font"==i&&t.find(".fl-font-field").on("change","select",o)},_previewFont:function(t,i){var l=e(i.delegateTarget),o=l.find(".fl-font-field-font"),s=e(o).find(":selected"),n=s.parent().attr("label"),r=l.find(".fl-font-field-weight"),a=t.id+"-"+this.nodeId,d=this._getPreviewSelector(this.classes.node,t.selector);"Google"==n&&this._buildFontStylesheet(a,o.val(),r.val()),"Default"==o.val()?(this.updateCSSRule(d,"font-family",""),this.updateCSSRule(d,"font-weight","")):(this.updateCSSRule(d,"font-family",o.val()),this.updateCSSRule(d,"font-weight",r.val()))},_buildFontStylesheet:function(t,i,l){var o=FLBuilderConfig.googleFontsUrl,s="",n={},r={};n[i]=[l],FLBuilderPreview._fontsList[t]=n,Object.keys(FLBuilderPreview._fontsList).forEach(function(e){var t=FLBuilderPreview._fontsList[e];Object.keys(t).forEach(function(e){var i=t[e];r[e]=r[e]||[],i=i.filter(function(t){return r[e].indexOf(t)<0}),r[e]=r[e].concat(i)})}),e.each(r,function(e,t){s+=e+":"+t.join()+"|"}),s=o+s.slice(0,-1).replace(" ","+"),e("#fl-builder-google-fonts-preview").length<1?e("<link>").attr("id","fl-builder-google-fonts-preview").attr("type","text/css").attr("rel","stylesheet").attr("href",s).appendTo("head"):e("#fl-builder-google-fonts-preview").attr("href",s)},_initFieldCSSPreview:function(e){var t=e.data("preview"),i=null;if("undefined"!=typeof t.rules)for(i in t.rules)this._initFieldCSSPreviewCallback(e,t.rules[i]);else this._initFieldCSSPreviewCallback(e,t)},_initFieldCSSPreviewCallback:function(t,i){switch(t.data("type")){case"text":t.find("input[type=text]").on("keyup",e.proxy(this._previewCSS,this,i));break;case"unit":t.find("input[type=number]").on("keyup",e.proxy(this._previewCSS,this,i));break;case"dimension":t.find("input[type=number]").on("keyup",e.proxy(this._previewDimensionCSS,this,i));break;case"select":t.find("select").on("change",e.proxy(this._previewCSS,this,i));break;case"color":t.find(".fl-color-picker-value").on("change",e.proxy(this._previewColor,this,i))}},_previewCSS:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=t.property,s="undefined"==typeof t.unit?"":t.unit,n=e(i.target),r=n.val();"%"===s&&"opacity"===o?r=parseInt(r)/100:""!==r&&(r+=s),n.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(l,o,r):this.updateCSSRule(l,o,r)},_previewDimensionCSS:function(t,i){var l=e.extend({},t),o=l.property,s=e(i.target).data("unit");"border-width"===o?l.property="border-"+s+"-width":l.property=o+"-"+s,this._previewCSS(l,i)},_previewColor:function(t,i){var l=this._getPreviewSelector(this.classes.node,t.selector),o=e(i.target),s=o.val(),n=""===s?"inherit":"#"+s;/^rgb/.test(s.replace(/\s+/g,""))&&(n=s),o.closest(".fl-field-responsive-setting").length?this.updateResponsiveCSSRule(l,t.property,n):this.updateCSSRule(l,t.property,n)},_initFieldWidgetPreview:function(t){var i=e.proxy(this.delayPreview,this);t.find("input").on("keyup",i),t.find("input[type=checkbox]").on("click",i),t.find("textarea").on("keyup",i),t.find("select").on("change",i)},_getPreviewSelector:function(e,t){return FLBuilderPreview.getFormattedSelector(e,t)}}}(jQuery),function(e){var t={ignored:[],reparsed:[],width:null,callback:null,sheets:{},styles:[],queue:[],emPxValue:null,regex:{media:/@media[^{]*{([\s\S]+?})\s*}/gi,empty:/@media[^{]*{([^{}]*?)}/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^\/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)\}$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},ignore:function(e){Array.prototype.push.apply(this.ignored,e)},reparse:function(e){Array.prototype.push.apply(this.reparsed,e)},update:function(e,t){this.width=void 0===e?null:e,this.callback=void 0===t?null:t,i.update(),this.queueSheets()?this.runQueue():this.applyStyles()},queueSheets:function(){for(var t=e("link, style"),i=null,l=null,o=null,s=null,n=null,r=null,a=null,d=!1,u=0,c=0;u<t.length;u++)if(element=t[u],i=element.href,l=element.id,o=element.tagName.toLowerCase(),s=element.rel,n=element.media,r=i?i:l?l:"style-"+u,a=!0,d=!1,"style"===o||i&&s&&"stylesheet"===s.toLowerCase()){for(c=0;c<this.ignored.length;c++)if(r.indexOf(this.ignored[c])>-1){d=!0;break}if(d)continue;for(c=0;c<this.reparsed.length;c++)if(r.indexOf(this.reparsed[c])>-1){this.sheets[r]=null;break}void 0!==this.sheets[r]&&this.sheets[r]||this.queue.push({element:t.eq(u),key:r,tagName:o,href:i,id:l,media:n})}return this.queue.length},runQueue:function(){var t;this.queue.length?(t=this.queue.shift(),"style"===t.tagName?(this.parse(t.element.html(),t),this.runQueue()):e.get(t.href,e.proxy(function(e){this.parse(e,t),this.runQueue()},this))):this.applyStyles()},parse:function(e,t){var i=this.regex,l=this.cleanStyles(e),o=l.match(i.media),s=o&&o.length||0,n=!s&&t.media,r=null,a=null,d=null,u="",c=0,h=0;for(o?u=l.replace(i.media,""):n&&"all"!=t.media?s=1:u=l,this.sheets[t.key]={element:t.element,key:t.key,tagName:t.tagName,href:t.href,id:t.id,all:u,queries:[]},c=0;c<s;c++)for(n?(r=t.media,l=this.convertURLs(l,t.href)):(r=o[c].match(i.findStyles)&&RegExp.$1,l=RegExp.$2&&this.convertURLs(RegExp.$2,t.href)),a=r.split(","),h=0;h<a.length;h++)r=a[h],d=r.split("(")[0].match(i.only)&&RegExp.$2,"print"!=d&&(r.replace(i.minmaxwh,"").match(i.other)||this.sheets[t.key].queries.push({minw:r.match(i.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:r.match(i.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),styles:l}))},applyStyles:function(){var t=e("head"),i=null,l=null,o=null,s=null,n=null,r=null,a=null,d=null,u=!1;this.clearStyles();
7
  for(s in this.sheets)if(i="",l=e("<style></style>"),o=this.sheets[s],o.queries.length&&this.width){for(i+=o.all,r=0;r<o.queries.length;r++)n=o.queries[r],a=n.minw,d=n.maxw,u=!1,a&&(a=parseFloat(a)*(a.indexOf("em")>-1?this.getEmPxValue():1),this.width>=a&&(i+=n.styles,u=!0)),d&&!u&&(d=parseFloat(d)*(d.indexOf("em")>-1?this.getEmPxValue():1),this.width<=d&&(i+=n.styles));this.styles.push(l),t.append(l),l.html(i),o.element.remove(),this.callback&&(this.callback(),this.callback=null)}},clearStyles:function(){var t=e("head"),i=null,l=this.styles.slice(0);this.styles=[];for(i in this.sheets)this.sheets[i].element.parent().length||t.append(this.sheets[i].element);setTimeout(function(){for(var e=0;e<l.length;e++)l[e].empty(),l[e].remove()},50)},cleanStyles:function(e){var t=this.regex;return e.replace(t.comments,"").replace(t.keyframes,"").replace(t.empty,"")},convertURLs:function(e,t){return t?(t=t.substring(0,t.lastIndexOf("/")),t.length&&(t+="/"),e.replace(this.regex.urls,"$1"+t+"$2$3")):e},getEmPxValue:function(){if(this.emPxValue)return this.emPxValue;var e=null,t=window.document,i=t.documentElement,l=t.body,o=t.createElement("div"),s=i.style.fontSize,n=l&&l.style.fontSize,r=!1;return o.style.cssText="position:absolute;font-size:1em;width:1em",l||(l=r=t.createElement("body"),l.style.background="none"),i.style.fontSize="100%",l.style.fontSize="100%",l.appendChild(o),r&&i.insertBefore(l,i.firstChild),e=parseFloat(o.offsetWidth),r?i.removeChild(l):l.removeChild(o),i.style.fontSize=s,n?l.style.fontSize=n:l.style.fontSize="",this.emPxValue=e,e}},i={_functions:null,update:function(){var e;if(!this._functions){this._functions={};for(e in l)this._functions[e]=jQuery.fn[e]}if(t.width)for(e in l)jQuery.fn[e]=l[e];else for(e in this._functions)jQuery.fn[e]=this._functions[e]}},l={width:function(l){return void 0!=l?i._functions.width.call(this,l):e.isWindow(this[0])?t.width:i._functions.width.call(this)}};FLBuilderSimulateMediaQuery={ignore:function(e){t.ignore(e)},reparse:function(e){t.reparse(e)},update:function(e,i){t.update(e,i)}}}(jQuery),function(e){FLBuilderResponsiveEditing={_mode:"default",refreshPreview:function(){var t;e(".fl-responsive-preview").length&&"default"!=this._mode&&("responsive"==this._mode?(t=FLBuilderConfig.global.responsive_breakpoint>=320?320:FLBuilderConfig.global.responsive_breakpoint,FLBuilderSimulateMediaQuery.update(t)):"medium"==this._mode&&(t=FLBuilderConfig.global.medium_breakpoint>=769?769:FLBuilderConfig.global.medium_breakpoint,FLBuilderSimulateMediaQuery.update(t)),FLBuilder._resizeLayout())},_init:function(){this._bind(),this._initMediaQueries()},_bind:function(){FLBuilder.addHook("settings-form-init",this._initSettingsForms),FLBuilder.addHook("settings-lightbox-closed",this._clearPreview),e("body").delegate(".fl-field-responsive-toggle","click",this._settingToggleClicked)},_initMediaQueries:function(){FLBuilderSimulateMediaQuery.ignore([FLBuilderConfig.pluginUrl,"fl-theme-builder","/wp-includes/","/wp-admin/","admin-bar-inline-css","ace-tm","ace_editor.css"]),FLBuilderSimulateMediaQuery.reparse([FLBuilderConfig.postId+"-layout-draft.css?",FLBuilderConfig.postId+"-layout-draft-partial.css?",FLBuilderConfig.postId+"-layout-preview.css?",FLBuilderConfig.postId+"-layout-preview-partial.css?","fl-builder-global-css","fl-builder-layout-css"])},_switchTo:function(t,i){var l=e("html"),o=e("body"),s=e(FLBuilder._contentClass),n=e(".fl-responsive-preview"),r=e(".fl-responsive-preview-mask"),a=e(".fl-content-placeholder"),d=null;if(FLBuilderResponsiveEditing._mode=t,"default"==t){if(0===a.length)return;l.removeClass("fl-responsive-preview-enabled"),a.after(s),a.remove(),n.remove(),r.remove()}else 0===n.length?(l.addClass("fl-responsive-preview-enabled"),s.after('<div class="fl-content-placeholder"></div>'),o.prepend(wp.template("fl-responsive-preview")()),e(".fl-responsive-preview").addClass("fl-preview-"+t),e(".fl-responsive-preview-content").append(s)):(n.removeClass("fl-preview-responsive fl-preview-medium"),n.addClass("fl-preview-"+t));"responsive"==t?(d=FLBuilderConfig.global.responsive_breakpoint>=360?360:FLBuilderConfig.global.responsive_breakpoint,s.width(d),FLBuilderSimulateMediaQuery.update(d,i)):"medium"==t?(d=FLBuilderConfig.global.medium_breakpoint>=769?769:FLBuilderConfig.global.medium_breakpoint,s.width(d),FLBuilderSimulateMediaQuery.update(d,i)):(s.width(""),FLBuilderSimulateMediaQuery.update(null,i)),this._setContentBackgroundColor(),FLBuilder._resizeLayout(),FLBuilder.triggerHook("responsive-editing-switched",t)},_setContentBackgroundColor:function(){var t=e(FLBuilder._contentClass),i=e(".fl-responsive-preview"),l=e(".fl-content-placeholder"),o=l.parents(),s="#fff",n=0;if(0===i.length)t.css("background-color","");else{for(;n<o.length&&(s=o.eq(n).css("background-color"),"rgba(0, 0, 0, 0)"==s);n++);t.css("background-color",s)}},_switchToAndScroll:function(t){var i=e(".fl-builder-settings").data("node"),l=void 0===i?void 0:e(".fl-node-"+i);FLBuilderResponsiveEditing._switchTo(t,function(){void 0!==l&&l&&setTimeout(function(){var t=e(window),i=e(".fl-responsive-preview-content");!i.length||t.height()<i.height()?e("html, body").animate({scrollTop:l.offset().top-100},250):scrollTo(0,0)},250)})},_clearPreview:function(){FLBuilderResponsiveEditing._switchToAndScroll("default")},_settingToggleClicked:function(){var t=e(this),i=t.data("mode");i="default"==i?"medium":"medium"==i?"responsive":"default",FLBuilderResponsiveEditing._switchAllSettingsTo(i),t.siblings(".fl-field-responsive-setting:visible").find("input").focus()},_switchAllSettingsTo:function(t){var i="dashicons-desktop dashicons-tablet dashicons-smartphone";e(".fl-field-responsive-toggle").removeClass(i),e(".fl-field-responsive-setting").hide(),i="default"==t?"dashicons-desktop":"medium"==t?"dashicons-tablet":"dashicons-smartphone",e(".fl-field-responsive-toggle").addClass(i).data("mode",t),e(".fl-field-responsive-setting-"+t).css("display","inline-block"),FLBuilderResponsiveEditing._switchToAndScroll(t)},_initSettingsForms:function(){var e=FLBuilderResponsiveEditing;Number(FLBuilderConfig.global.responsive_enabled)&&(e._initFields("dimension","input","keyup",e._spacingFieldKeyup,["margin","padding"]),e._initFields("dimension","input","keyup",e._textFieldKeyup),e._initFields("unit","input","keyup",e._textFieldKeyup)),e._switchAllSettingsTo(e._mode)},_initFields:function(t,i,l,o,s){for(var n=e(".fl-builder-settings"),r=n.find(".fl-field").has(".fl-field-responsive-setting"),a=null,d=null,u=0;u<r.length;u++)a=r.eq(u),d=a.attr("id").replace("fl-field-",""),"object"==typeof s&&e.inArray(d,s)<0||t==a.attr("data-type")&&void 0===a.attr("data-responsive-init")&&(a.find(".fl-field-responsive-setting-default "+i).on(l,o),a.find(".fl-field-responsive-setting-medium "+i).on(l,o),a.find(".fl-field-responsive-setting-responsive "+i).on(l,o),a.find(".fl-field-responsive-setting-default "+i).trigger(l),a.attr("data-responsive-init",1))},_getFields:function(t,i){var l=e(t).closest(".fl-field");return{"default":l.find(".fl-field-responsive-setting-default "+i),medium:l.find(".fl-field-responsive-setting-medium "+i),responsive:l.find(".fl-field-responsive-setting-responsive "+i)}},_textFieldKeyup:function(){var e=FLBuilderResponsiveEditing._getFields(this,"input");e["default"].each(function(t){var i=e["default"].eq(t).attr("placeholder"),l=e["default"].eq(t).val(),o=e.medium.eq(t).val();""==l?e.medium.eq(t).attr("placeholder",void 0===i?"":i):e.medium.eq(t).attr("placeholder",l),""==o?e.responsive.eq(t).attr("placeholder",e.medium.eq(t).attr("placeholder")):e.responsive.eq(t).attr("placeholder",o)})},_spacingFieldKeyup:function(){var t=e(".fl-builder-settings"),i="row",l=e(this).closest(".fl-field").attr("id").replace("fl-field-",""),o=FLBuilderResponsiveEditing._getFields(this,"input"),s=FLBuilderConfig.global,n=null,r=null,a=null,d=null;t.hasClass("fl-builder-row-settings")?i="row":t.hasClass("fl-builder-col-settings")?i="col":t.hasClass("fl-builder-module-settings")&&(i="module"),e.extend(s,{col_margins:0,col_margins_medium:"",col_margins_responsive:"",col_padding:0,col_padding_medium:"",col_padding_responsive:""}),n=i+"_"+l+("margin"===l?"s":""),r=s[n],a=s[n+"_medium"],d=s[n+"_responsive"],o["default"].each(function(e){var t=o["default"].eq(e).attr("name").split("_").pop(),n=o["default"].eq(e).val(),u=o.medium.eq(e).val(),c=(o.responsive.eq(e).val(),null),h=null;""===a&&(""!==n?o.medium.eq(e).attr("placeholder",n):""!==r&&o.medium.eq(e).attr("placeholder",r)),""===d&&("module"===i&&Number(s.auto_spacing)?(c=""===a?Number(r):a,h=""===u?Number(n):u,""!==h&&(h>c||h<0)?o.responsive.eq(e).attr("placeholder",c):""!==h?o.responsive.eq(e).attr("placeholder",h):o.responsive.eq(e).attr("placeholder",c)):(!Number(s.auto_spacing)||"padding"===l&&"top|bottom".indexOf(t)>-1)&&(""!==u?o.responsive.eq(e).attr("placeholder",u):""!==a?o.responsive.eq(e).attr("placeholder",a):""!==n?o.responsive.eq(e).attr("placeholder",n):""!==r&&o.responsive.eq(e).attr("placeholder",r)))})}},e(function(){FLBuilderResponsiveEditing._init()})}(jQuery),function(e){FLBuilderResponsivePreview={enter:function(){this.render()},exit:function(){this.destroy()},switchTo:function(t){var i=FLBuilderConfig.global,l=e("#fl-builder-preview-frame"),o="100%";"responsive"==t?(o=i.responsive_breakpoint>=360?360:i.responsive_breakpoint,l.width(o)):"medium"==t&&(o=i.medium_breakpoint>=769?769:i.medium_breakpoint,l.width(o)),l.width(o)},render:function(){var t=e("body"),i=FLBuilderConfig.previewUrl,l=e("#fl-builder-preview-mask, #fl-builder-preview-frame"),o=e('<div id="fl-builder-preview-mask"></div>'),s=e('<iframe id="fl-builder-preview-frame" src="'+i+'" frameborder="0"></iframe>');l.remove(),t.append(o),t.append(s)},destroy:function(){e("#fl-builder-preview-mask, #fl-builder-preview-frame").remove()}}}(jQuery),function(e){var t={init:function(){var t=e("body");t.delegate(".fl-builder-service-select","change",this._serviceChange),t.delegate(".fl-builder-service-connect-button","click",this._connectClicked),t.delegate(".fl-builder-service-account-select","change",this._accountChange),t.delegate(".fl-builder-service-account-delete","click",this._accountDeleteClicked),t.delegate(".fl-builder-campaign-monitor-client-select","change",this._campaignMonitorClientChange),t.delegate(".fl-builder-mailchimp-list-select","change",this._mailChimpListChange),t.delegate(".fl-builder-activecampaign-list_type-select","change",this._activeCampaignChange)},_startSettingsLoading:function(t){var i=e(".fl-builder-settings"),l=t.closest(".fl-builder-service-settings"),o=e(".fl-builder-service-error");i.append('<div class="fl-builder-loading"></div>'),l.addClass("fl-builder-service-settings-loading"),o.remove()},_finishSettingsLoading:function(){var t=e(".fl-builder-settings"),i=e(".fl-builder-service-settings-loading");t.find(".fl-builder-loading").remove(),i.removeClass("fl-builder-service-settings-loading")},_serviceChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this),o=l.closest("tr"),s=l.val();o.siblings("tr.fl-builder-service-account-row").remove(),o.siblings("tr.fl-builder-service-connect-row").remove(),o.siblings("tr.fl-builder-service-field-row").remove(),e(".fl-builder-service-error").remove(),""!==s&&(t._startSettingsLoading(l),FLBuilder.ajax({action:"render_service_settings",node_id:i,service:s},t._serviceChangeComplete))},_serviceChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row");s.after(l.html),t._addAccountDelete(o),t._finishSettingsLoading()},_connectClicked:function(){for(var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-connect-row"),n=l.find(".fl-builder-service-connect-input"),r=null,a=null,d=0,u={action:"connect_service",node_id:i,service:o.val(),fields:{}};d<n.length;d++)r=n.eq(d),a=r.attr("name"),u.fields[a]=r.val();s.hide(),t._startSettingsLoading(o),FLBuilder.ajax(u,t._connectComplete)},_connectComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-select-row"),n=o.find(".fl-builder-service-select"),r=o.find(".fl-builder-service-account-row"),a=o.find(".fl-builder-service-account-select"),d=o.find(".fl-builder-service-connect-row");l.error?(d.show(),0===a.length?n.after('<div class="fl-builder-service-error">'+l.error+"</div>"):a.after('<div class="fl-builder-service-error">'+l.error+"</div>")):(d.remove(),r.remove(),s.after(l.html)),t._addAccountDelete(o),t._finishSettingsLoading()},_accountChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-connect-row"),r=l.find("tr.fl-builder-service-field-row"),a=e(".fl-builder-service-error"),d=s.val(),u=null;n.remove(),r.remove(),a.remove(),"add_new_account"==d?u={action:"render_service_settings",node_id:i,service:o.val(),add_new:!0}:""!==d&&(u={action:"render_service_fields",node_id:i,service:o.val(),account:d}),u&&(t._startSettingsLoading(o),FLBuilder.ajax(u,t._accountChangeComplete)),t._addAccountDelete(l)},_accountChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-account-row");s.after(l.html),t._finishSettingsLoading()},_addAccountDelete:function(e){var t=e.find(".fl-builder-service-account-select");t.length>0&&(e.find(".fl-builder-service-account-delete").remove(),""!==t.val()&&"add_new_account"!=t.val()&&t.after('<a href="javascript:void(0);" class="fl-builder-service-account-delete">'+FLBuilderStrings.deleteAccount+"</a>"))},_accountDeleteClicked:function(){var i=e(this).closest(".fl-builder-service-settings"),l=i.find(".fl-builder-service-select"),o=i.find(".fl-builder-service-account-select");confirm(FLBuilderStrings.deleteAccountWarning)&&(FLBuilder.ajax({action:"delete_service_account",service:l.val(),account:o.val()},t._accountDeleteComplete),t._startSettingsLoading(o))},_accountDeleteComplete:function(){var i=e(".fl-builder-service-settings-loading"),l=i.find(".fl-builder-service-select");t._finishSettingsLoading(),l.trigger("change")},_campaignMonitorClientChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=e(this),r=l.find(".fl-builder-service-list-select"),a=n.val();0!==r.length&&r.closest("tr").remove(),""!==a&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),client:a},t._campaignMonitorClientChangeComplete))},_campaignMonitorClientChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-campaign-monitor-client-select");s.closest("tr").after(l.html),t._finishSettingsLoading()},_mailChimpListChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-list-select");e(".fl-builder-mailchimp-group-select").closest("tr").remove(),""!==n.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),list_id:n.val()},t._mailChimpListChangeComplete))},_mailChimpListChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-list-select");s.closest("tr").after(l.html),t._finishSettingsLoading()},_activeCampaignChange:function(){var i=e(".fl-builder-settings").data("node"),l=e(this).closest(".fl-builder-service-settings"),o=l.find(".fl-builder-service-select"),s=l.find(".fl-builder-service-account-select"),n=l.find(".fl-builder-service-list-select");list_type=l.find('select[name="list_type"]'),0!==n.length&&n.closest("tr").remove(),""!==list_type.val()&&(t._startSettingsLoading(o),FLBuilder.ajax({action:"render_service_fields",node_id:i,service:o.val(),account:s.val(),list_type:list_type.val()},t._activeCampaignTypeChangeComplete))},_activeCampaignTypeChangeComplete:function(i){var l=JSON.parse(i),o=e(".fl-builder-service-settings-loading"),s=o.find(".fl-builder-service-field-row");s.after(l.html),t._finishSettingsLoading()}};e(function(){t.init()})}(jQuery),function(e){FLBuilderTour={_tour:null,start:function(){FLBuilderTour._tour?FLBuilderTour._tour.restart():(FLBuilderTour._tour=new Tour(FLBuilderTour._config()),FLBuilderTour._tour.init()),FLBuilder._triggerSettingsSave(!1,!0)&&FLBuilderTour._tour.start()},_config:function(){var t={storage:!1,onStart:FLBuilderTour._onStart,onPrev:FLBuilderTour._onPrev,onNext:FLBuilderTour._onNext,onEnd:FLBuilderTour._onEnd,template:'<div class="popover" role="tooltip"> <i class="fas fa-times" data-role="end"></i> <div class="arrow"></div> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="next">'+FLBuilderStrings.tourNext+"</button> </div> </div>",steps:[{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourTemplatesTitle,content:FLBuilderStrings.tourTemplates,onShow:function(){FLBuilder.ContentPanel.show("templates")}},{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourAddRowsTitle,content:FLBuilderStrings.tourAddRows,onShow:function(){FLBuilder.ContentPanel.show("rows")}},{animation:!1,element:".fl-builder--content-library-panel",placement:"left",title:FLBuilderStrings.tourAddContentTitle,content:FLBuilderStrings.tourAddContent,onShow:function(){FLBuilder.ContentPanel.show("modules")}},{animation:!1,element:".fl-row:first-of-type",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-row:first-of-type .fl-module-overlay .fl-block-overlay-actions",placement:"top",title:FLBuilderStrings.tourEditContentTitle,content:FLBuilderStrings.tourEditContent2,onShow:function(){FLBuilderTour._dimSection(".fl-builder-bar"),FLBuilder._closePanel(),e(".fl-row").eq(0).trigger("mouseenter"),e(".fl-module").eq(0).trigger("mouseenter")}},{animation:!1,element:".fl-builder-content-panel-button",placement:"bottom",title:FLBuilderStrings.tourAddContentButtonTitle,content:FLBuilderStrings.tourAddContentButton,onShow:function(){FLBuilderTour._dimSection("body"),e(".fl-row").eq(0).trigger("mouseleave"),e(".fl-module").eq(0).trigger("mouseleave")}},{animation:!1,element:".fl-builder-templates-button",placement:"bottom",title:FLBuilderStrings.tourTemplatesButtonTitle,content:FLBuilderStrings.tourTemplatesButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-tools-button",placement:"bottom",title:FLBuilderStrings.tourToolsButtonTitle,content:FLBuilderStrings.tourToolsButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,element:".fl-builder-done-button",placement:"bottom",title:FLBuilderStrings.tourDoneButtonTitle,content:FLBuilderStrings.tourDoneButton,onShow:function(){FLBuilderTour._dimSection("body")}},{animation:!1,orphan:!0,backdrop:!0,title:FLBuilderStrings.tourFinishedTitle,content:FLBuilderStrings.tourFinished,template:'<div class="popover" role="tooltip"> <div class="arrow"></div> <i class="fas fa-times" data-role="end"></i> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation clearfix"> <button class="fl-builder-button fl-builder-button-primary fl-builder-tour-next" data-role="end">'+FLBuilderStrings.tourEnd+"</button> </div> </div>"}]};return FLBuilderConfig.lite?t.steps.shift():"disabled"==FLBuilderConfig.enabledTemplates?t.steps.shift():"fl-builder-template"==FLBuilderConfig.postType&&t.steps.shift(),t},_onStart:function(){var t=e("body");t.scrollTop(0),t.append('<div class="fl-builder-tour-mask"></div>'),0===e(".fl-row").length&&"module"!=FLBuilderConfig.userTemplateType&&(e(".fl-builder-content").append('<div class="fl-builder-tour-demo-content fl-row fl-row-fixed-width fl-row-bg-none"> <div class="fl-row-content-wrap"> <div class="fl-row-content fl-row-fixed-width fl-node-content"> <div class="fl-col-group"> <div class="fl-col" style="width:100%"> <div class="fl-col-content fl-node-content"> <div class="fl-module fl-module-rich-text" data-type="rich-text" data-name="Text Editor"> <div class="fl-module-content fl-node-content"> <div class="fl-rich-text"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus pellentesque ut lorem non cursus. Sed mauris nunc, porttitor iaculis lorem a, sollicitudin lacinia sapien. Proin euismod orci lacus, et sollicitudin leo posuere ac. In hac habitasse platea dictumst. Maecenas elit magna, consequat in turpis suscipit, ultrices rhoncus arcu. Phasellus finibus sapien nec elit tempus venenatis. Maecenas tincidunt sapien non libero maximus, in aliquam felis tincidunt. Mauris mollis ultricies facilisis. Duis condimentum dignissim tortor sit amet facilisis. Aenean gravida lacus eu risus molestie egestas. Donec ut dolor dictum, fringilla metus malesuada, viverra nunc. Maecenas ut purus ac justo aliquet lacinia. Cras vestibulum elementum tincidunt. Maecenas mattis tortor neque, consectetur dignissim neque tempor nec.</p></div> </div> </div> </div> </div> </div> </div> </div> </div>'),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols())},_onPrev:function(){e(".fl-builder-tour-dimmed").remove()},_onNext:function(){e(".fl-builder-tour-dimmed").remove()},_onEnd:function(){e("body").off("fl-builder.template-selector-loaded"),e(".fl-builder-tour-mask").remove(),e(".fl-builder-tour-dimmed").remove(),e(".fl-builder-tour-demo-content").remove(),FLBuilder._setupEmptyLayout(),FLBuilder._highlightEmptyCols(),FLBuilder._showPanel(),FLBuilder._initTemplateSelector()},_dimSection:function(t){e(t).find(".fl-builder-tour-dimmed").remove(),e(t).append('<div class="fl-builder-tour-dimmed"></div>')}}}(jQuery),function(e,t){String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var i=this.toString();("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>i.length)&&(t=i.length),t-=e.length;var l=i.indexOf(e,t);return l!==-1&&l===t}),e.fn.textWidth=function(t,i){return e.fn.textWidth.fakeEl||(e.fn.textWidth.fakeEl=e("<span>").hide().appendTo(document.body)),e.fn.textWidth.fakeEl.text(t||this.val()||this.text()).css("font",i||this.css("font")),e.fn.textWidth.fakeEl.width()},FLExtendableObject={create:function(t){var i=Object.create(this);return i=e.extend(i,t),e(this).trigger("onCreate"),i}},e.fn.switchClass=function(t,i){return this.each(function(){return e(this).removeClass(function(e,i){var l=[],o=i.split(" ");for(var e in o)o[e].startsWith(t)&&l.push(o[e]);return l.join(" ")}),e(this).addClass(t+i)})};var i={init:function(){t.addHook("cancelTask",this.onCancelTask.bind(this)),t.addHook("showSavedMessage",this.onSaveShortcut.bind(this)),t.addHook("goToNextTab",this.onNextPrevTabShortcut.bind(this,"next")),t.addHook("goToPrevTab",this.onNextPrevTabShortcut.bind(this,"prev")),t.addHook("endEditingSession",this.onEndEditingSession.bind(this)),t.addHook("restartEditingSession",this.onRestartEditingSession.bind(this)),this.setDefaultKeyboardShortcuts()},addShortcut:function(t,i,l){var o=e.proxy(this,"onTriggerKey",t);l?Mousetrap.bindGlobal(i,o):Mousetrap.bind(i,o)},reset:function(){Mousetrap.reset()},setDefaultKeyboardShortcuts:function(){this.reset();for(var e in FLBuilderConfig.keyboardShortcuts){var t=FLBuilderConfig.keyboardShortcuts[e].keyCode,i=FLBuilderConfig.keyboardShortcuts[e].isGlobal;this.addShortcut(e,t,i)}},onTriggerKey:function(e,i){t.triggerHook(e),i.preventDefault?i.preventDefault():i.returnValue=!1},onCancelTask:function(){return s.isPreviewing?void s.endPreview():o.isShowing?void o.hide():t.ContentPanel.isShowing?void t.ContentPanel.hide():void 0},pause:function(){Mousetrap.pause()},unpause:function(){Mousetrap.unpause()},onEndEditingSession:function(){this.reset(),this.addShortcut("restartEditingSession","mod+e")},onRestartEditingSession:function(){this.reset(),this.setDefaultKeyboardShortcuts()},onSaveShortcut:function(){if(t.SaveManager.layoutNeedsPublish()){var e=FLBuilderStrings.savedStatus.hasAlreadySaved;t.SaveManager.showStatusMessage(e),setTimeout(function(){t.SaveManager.resetStatusMessage()},2e3)}else{var e=FLBuilderStrings.savedStatus.nothingToSave;t.SaveManager.showStatusMessage(e),setTimeout(function(){t.SaveManager.resetStatusMessage()},2e3)}},onNextPrevTabShortcut:function(i,l){var o,s,n=e(".fl-lightbox:visible"),r=n.find(".fl-builder-settings-tabs a");n.length>0&&(o=r.filter("a.fl-active"),s="next"==i?o.is(r.last())?r.first():o.next("a"):o.is(r.first())?r.last():o.prev("a"),s.trigger("click")),t._calculateSettingsTabsOverflow(),l.preventDefault()}},l={isShowing:!1,init:function(){this.render(),t.addHook("showKeyboardShortcuts",this.show.bind(this))},render:function(){var t=wp.template("fl-keyboard-shortcuts"),i=FLBuilderConfig.keyboardShortcuts;this.$el=e(t(i)),e("body").append(this.$el),this.$el.find(".dismiss-shortcut-ui").on("click",this.hide.bind(this)),this.$el.on("click",this.hide.bind(this))},show:function(){this.isShowing||(this.$el.addClass("is-showing"),this.isShowing=!0)},hide:function(){this.isShowing&&(this.$el.removeClass("is-showing"),this.isShowing=!1)},toggle:function(){this.isShowing?this.hide():this.show()}},o=FLExtendableObject.create({isShowing:!1,init:function(){this.$el=e(".fl-builder-publish-actions"),this.$defaultBarButtons=e(".fl-builder-bar-actions"),this.$clickAwayMask=e(".fl-builder-publish-actions-click-away-mask"),this.$doneBtn=this.$defaultBarButtons.find(".fl-builder-done-button"),this.$doneBtn.on("click",this.onDoneTriggered.bind(this)),this.$actions=this.$el.find(".fl-builder-button"),this.$actions.on("click",this.onActionClicked.bind(this)),t.addHook("triggerDone",this.onDoneTriggered.bind(this));var i=this.hide.bind(this);t.addHook("cancelPublishActions",i),t.addHook("endEditingSession",i),this.$clickAwayMask.on("click",i)},onDoneTriggered:function(){t.SaveManager.layoutNeedsPublish()?this.show():FLBuilderConfig.shouldRefreshOnPublish?t._exit():t._exitWithoutRefresh()},show:function(){this.isShowing||t._triggerSettingsSave(!1,!0)&&(this.$el.removeClass("is-hidden"),this.$defaultBarButtons.css("opacity","0"),this.$clickAwayMask.show(),this.isShowing=!0,t.triggerHook("didShowPublishActions"))},hide:function(){this.isShowing&&(this.$el.addClass("is-hidden"),this.$defaultBarButtons.css("opacity","1"),this.$clickAwayMask.hide(),this.isShowing=!1)},onActionClicked:function(i){var l=e(i.currentTarget).data("action");switch(l){case"dismiss":this.hide();break;case"discard":this.hide(),s.muteToolbar(),t._discardButtonClicked();break;case"publish":this.hide(),s.muteToolbar(),t._publishButtonClicked(),t._destroyOverlayEvents();break;case"draft":this.hide(),s.muteToolbar(),t._draftButtonClicked();break;default:this.hide(),s.muteToolbar(),t._draftButtonClicked()}t.triggerHook(l+"ButtonClicked")}}),s={isPreviewing:!1,init:function(){this.$el=e("body"),this.$mainToolbar=e(".fl-builder-bar"),this.$mainToolbarContent=this.$mainToolbar.find(".fl-builder-bar-content"),this.$wpAdminBar=e("#wpadminbar"),this.$endPreviewBtn=e(".fl-builder--preview-actions .end-preview-btn"),t.addHook("endEditingSession",this.endEditingSession.bind(this)),t.addHook("previewLayout",this.togglePreview.bind(this)),this.$endPreviewBtn.on("click",this.endPreview.bind(this)),this.$deviceIcons=e(".fl-builder--preview-actions i"),this.$deviceIcons.on("click",this.onDeviceIconClick.bind(this));var i=this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a, #wp-admin-bar-fl-theme-builder-frontend-edit-link > a");i.on("click",this.onClickPageBuilderToolbarLink.bind(this)),e("#wpadminbar a").attr("tabindex","-1");var l=this.restartEditingSession.bind(this);t.addHook("restartEditingSession",l),t.addHook("didHideAllLightboxes",this.unmuteToolbar.bind(this)),t.addHook("didCancelDiscard",this.unmuteToolbar.bind(this)),t.addHook("didEnterRevisionPreview",this.hide.bind(this)),t.addHook("didExitRevisionPreview",this.show.bind(this)),t.addHook("didPublishLayout",this.onPublish.bind(this))},endEditingSession:function(){t._destroyOverlayEvents(),t._removeAllOverlays(),t._removeEmptyColHighlights(),t._removeColHighlightGuides(),t._unbindEvents(),e("html").removeClass("fl-builder-edit").addClass("fl-builder-show-admin-bar"),e("body").removeClass("fl-builder-edit"),e("#wpadminbar a").attr("tabindex",null),e(t._contentClass).removeClass("fl-builder-content-editing"),this.hideMainToolbar(),t.ContentPanel.hide(),FLBuilderLayout.init()},restartEditingSession:function(i){t._initTemplateSelector(),t._bindOverlayEvents(),t._highlightEmptyCols(),t._rebindEvents(),e("html").addClass("fl-builder-edit").removeClass("fl-builder-show-admin-bar"),e("body").addClass("fl-builder-edit"),e("#wpadminbar a").attr("tabindex","-1"),e(t._contentClass).addClass("fl-builder-content-editing"),this.showMainToolbar(),i.preventDefault()},onClickPageBuilderToolbarLink:function(e){t.triggerHook("restartEditingSession"),e.preventDefault()},onPublish:function(){var e=this.$wpAdminBar.find("#wp-admin-bar-fl-builder-frontend-edit-link > a span");e.css("color","#6bc373")},hide:function(){e("html").hasClass("fl-builder-edit")&&(t._unbindEvents(),t._destroyOverlayEvents(),t._removeAllOverlays(),e("html").removeClass("fl-builder-edit"),e("body").removeClass("admin-bar"),this.hideMainToolbar(),t.ContentPanel.hide(),FLBuilderLayout.init(),t.triggerHook("didHideEditingUI"))},show:function(){e("html").hasClass("fl-builder-edit")||(t._rebindEvents(),t._bindOverlayEvents(),this.showMainToolbar(),FLBuilderResponsiveEditing._switchTo("default"),e("html").addClass("fl-builder-edit"),e("body").addClass("admin-bar"),t.triggerHook("didShowEditingUI"))},beginPreview:function(){t._triggerSettingsSave(!1,!0)&&(this.isPreviewing=!0,this.hide(),e("html").addClass("fl-builder-preview"),e("html, body").removeClass("fl-builder-edit"),t._removeEmptyColHighlights(),t._removeColHighlightGuides(),t.triggerHook("didBeginPreview"),FLBuilderResponsivePreview.enter())},endPreview:function(){this.isPreviewing=!1,this.show(),t._highlightEmptyCols(),FLBuilderResponsivePreview.exit(),e("html").removeClass("fl-builder-preview"),e("html, body").addClass("fl-builder-edit")},togglePreview:function(){this.isPreviewing?this.endPreview():this.beginPreview()},hideMainToolbar:function(){this.$mainToolbar.addClass("is-hidden"),e("html").removeClass("fl-builder-is-showing-toolbar")},showMainToolbar:function(){this.unmuteToolbar(),this.$mainToolbar.removeClass("is-hidden"),e("html").addClass("fl-builder-is-showing-toolbar")},onDeviceIconClick:function(t){var i=e(t.target).data("mode");FLBuilderResponsivePreview.switchTo(i)},muteToolbar:function(){this.$mainToolbarContent.addClass("is-muted"),t._hideTipTips()},unmuteToolbar:function(){this.$mainToolbarContent.removeClass("is-muted")}},n={isEditing:!0,init:function(){history.pushState&&(t.addHook("endEditingSession",this.onLeaveBuilder.bind(this)),t.addHook("restartEditingSession",this.onEnterBuilder.bind(this)))},onEnterBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.editUrl),this.isEditing=!0},onLeaveBuilder:function(){history.replaceState({},document.title,FLBuilderConfig.url),this.isEditing=!1}},r={$row:null,$rowContent:null,row:null,drag:{},init:function(){
8
  if(this.userCanResize()){var i=e(t._contentClass);i.delegate(".fl-block-row-resize","mouseenter",this.onDragHandleHover.bind(this)),i.delegate(".fl-block-row-resize","mousedown",this.onDragHandleDown.bind(this))}},userCanResize:function(){return FLBuilderConfig.rowResize.userCanResizeRows},onDragHandleHover:function(t){if(!this.drag.isDragging){var i=e(t.target);this.$row=i.closest(".fl-row"),this.$rowContent=this.$row.find(".fl-row-content"),this.row={node:this.$row.data("node"),isFixedWidth:this.$row.hasClass("fl-row-fixed-width"),settings:e(".fl-builder-row-settings[data-node="+this.$row.data("node")+"]")},this.drag={edge:null,isDragging:!1,originalPosition:null,originalWidth:null,calculatedWidth:null,operation:null},this.row.isFixedWidth?this.drag.originalWidth=this.$row.width():this.drag.originalWidth=this.$rowContent.width(),this.dragInit()}},onDragHandleDown:function(){e("body").addClass("fl-builder-row-resizing")},dragInit:function(e){this.$row.find(".fl-block-row-resize").draggable({axis:"x",start:this.dragStart.bind(this),drag:this.dragging.bind(this),stop:this.dragStop.bind(this)})},dragStart:function(i,l){var o=e("body"),s=e(l.helper);this.drag.isDragging=!0,this.row.isFixedWidth?this.drag.originalWidth=this.$row.width():this.drag.originalWidth=this.$rowContent.width(),s.hasClass("fl-block-col-resize-e")&&(this.drag.edge="e",this.$feedback=s.find(".fl-block-col-resize-feedback-left")),s.hasClass("fl-block-col-resize-w")&&(this.drag.edge="w",this.$feedback=s.find(".fl-block-col-resize-feedback-right")),o.addClass("fl-builder-row-resizing"),t._colResizing=!0,t._destroyOverlayEvents(),t._closePanel()},dragging:function(e,t){var i=t.position.left,l=t.originalPosition.left,o=this.drag.originalWidth,s=0,n=this.drag.edge,r=FLBuilderConfig.rowResize.minAllowedWidth,a=FLBuilderConfig.rowResize.maxAllowedWidth;l!==i&&(FLBuilderConfig.isRtl&&(n="w"==n?"e":"w"),l>i?"w"===n?this.drag.operation="+":this.drag.operation="-":"e"===n?this.drag.operation="+":this.drag.operation="-",s=Math.abs(l-i),"+"===this.drag.operation?this.drag.calculatedWidth=o+2*s:this.drag.calculatedWidth=o-2*s,!1!==r&&this.drag.calculatedWidth<r&&(this.drag.calculatedWidth=r),!1!==a&&this.drag.calculatedWidth>a&&(this.drag.calculatedWidth=a),this.row.isFixedWidth&&this.$row.css("max-width",this.drag.calculatedWidth+"px"),this.$rowContent.css("max-width",this.drag.calculatedWidth+"px"),_.isUndefined(this.$feedback)||this.$feedback.html(this.drag.calculatedWidth+"px").show(),this.row.settings.length&&this.row.settings.find("[name=max_content_width]").val(this.drag.calculatedWidth))},dragStop:function(i,l){this.drag.isDragging=!1,_.isUndefined(this.$feedback)||this.$feedback.hide();var o={action:"resize_row_content",node:this.row.node,width:this.drag.calculatedWidth},s=e("body");t.ajax(o),t._bindOverlayEvents(),s.removeClass("fl-builder-row-resizing"),e(".fl-block-overlay").each(function(){t._buildOverlayOverflowMenu(e(this))}),e("body").removeClass("fl-builder-row-resizing"),setTimeout(function(){t._colResizing=!1},50),t.triggerHook("didResizeRow",{rowId:this.row.node,rowWidth:this.drag.calculatedWidth})}},a={templateName:"fl-toolbar",init:function(){this.template=wp.template(this.templateName),this.render(),this.initTipTips();var e=this.$el.find(".fl-builder-content-panel-button");e.on("click",t._togglePanel),this.$el.find(".fl-builder-buy-button").on("click",t._upgradeClicked),this.$el.find(".fl-builder-upgrade-button").on("click",t._upgradeClicked),this.$el.find("#fl-builder-toggle-notifications").on("click",this.onNotificationsButtonClicked.bind(this)),t.addHook("notificationsLoaded",this.onNotificationsLoaded.bind(this))},render:function(t){var i=e(this.template(t));this.$el=i,this.el=i.get(0),s.$mainToolbar=this.$el,e("body").prepend(i),e("html").addClass("fl-builder-is-showing-toolbar")},initTipTips:function(){e(".fl-builder--saving-indicator").tipTip({defaultPosition:"bottom",edgeOffset:14}),e(".fl-builder-publish-actions .fl-builder-button-group .fl-builder-button").tipTip({defaultPosition:"bottom",edgeOffset:6})},onNotificationsButtonClicked:function(){t.triggerHook("toggleNotifications")},onNotificationsLoaded:function(){e("body").removeClass("fl-builder-has-new-notifications");var i={action:"fl_builder_notifications",read:!0};t.ajax(i)}};e(function(){t.ContentPanel.init(),FLBuilderConfig.simpleUi||t.MainMenu.init(),FLBuilderConfig.showToolbar?(a.init(),t.ContentPanel.alignPanelArrow()):e("html").addClass("fl-builder-no-toolbar"),i.init(),l.init(),s.init(),n.init(),r.init(),o.init(),t.triggerHook("didInitUI")})}(jQuery,FLBuilder),function(e,t){var i=FLExtendableObject.create({templateName:"fl-main-menu-panel-view",name:"Untitled View",isShowing:!1,isRootView:!1,items:{},init:function(){this.template=wp.template(this.templateName)},render:function(){return this.template(this)},bindEvents:function(){this.$items=this.$el.find(".fl-builder--menu-item")},show:function(){this.$el.addClass("is-showing")},hide:function(){this.$el.removeClass("is-showing")},transitionIn:function(e){requestAnimationFrame(this.show.bind(this))},transitionOut:function(e){this.hide()}}),l=FLExtendableObject.create({templateName:"fl-main-menu-panel",template:null,menu:null,views:{},viewNavigationStack:[],isShowing:!1,shouldShowTabs:!1,init:function(){this.template=wp.template(this.templateName),e("body").prepend(this.template(this)),this.$el=e(".fl-builder--main-menu-panel"),this.$el.find(".fl-builder--main-menu-panel-views").html("");for(var i in FLBuilderConfig.mainMenu){this.renderPanel(i);var l="render"+i.charAt(0).toUpperCase()+i.slice(1)+"Panel";t.addHook(l,e.proxy(function(){this.renderPanel(i)},this))}e("body").on("click",".fl-builder--main-menu-panel .pop-view",this.goToPreviousView.bind(this)),this.$tabs=this.$el.find(".fl-builder--tabs > span"),this.$tabs.on("click",this.onItemClick.bind(this)),this.$barTitle=e(".fl-builder-bar-title"),e("body").on("click",".fl-builder-bar-title",this.toggle.bind(this));var n=this.hide.bind(this);t.addHook("didShowPublishActions",n),t.addHook("didBeginSearch",n),t.addHook("didBeginPreview",n),t.addHook("didShowContentPanel",n),t.addHook("endEditingSession",n),t.addHook("didFocusSearchBox",n),t.addHook("didEnterRevisionPreview",n),t.addHook("didFailSettingsSave",n),t.addHook("showKeyboardShortcuts",n),this.$mask=e(".fl-builder--main-menu-panel-mask"),this.$mask.on("click",n),o.init(),s.init()},renderPanel:function(t){var l,o,s;e('fl-builder--main-menu-panel-view[data-name="'+t+'"]').remove(),l=FLBuilderConfig.mainMenu[t],l.handle=t,o=i.create(l),o.init(),s=e(o.render()),o.$el=s,e(".fl-builder--main-menu-panel-views").append(s),o.bindEvents(),o.$el.find(".fl-builder--menu-item").on("click",this.onItemClick.bind(this)),o.isRootView&&(this.rootView=o,this.currentView=o),this.views[t]=o},show:function(){this.isShowing||(this.$el.addClass("is-showing"),this.$barTitle.addClass("is-showing-menu"),this.currentView.transitionIn(),this.isShowing=!0,this.$mask.show(),t.triggerHook("didOpenMainMenu"))},hide:function(){this.isShowing&&(this.$el.removeClass("is-showing"),this.$barTitle.removeClass("is-showing-menu"),this.isShowing=!1,this.resetViews(),this.$mask.hide())},toggle:function(){this.isShowing?this.hide():this.show()},onItemClick:function(i){var l=e(i.currentTarget),o=l.data("type");switch(o){case"view":var s=l.data("view");this.goToView(s);break;case"event":var n=l.data("event");t.triggerHook(n,l);break;case"link":}},goToView:function(e){var t=this.currentView,i=this.views[e];t.transitionOut(),i.transitionIn(),this.currentView=i,this.viewNavigationStack.push(t)},goToPreviousView:function(){var t=this.currentView,i=this.viewNavigationStack.pop();t.transitionOut(!0),i.transitionIn(!0),this.currentView=i,e(".fl-builder-bar-title-caret").focus()},resetViews:function(){this.currentView!=this.rootView&&(this.currentView.hide(),this.rootView.show(),this.currentView=this.rootView,this.viewNavigationStack=[])}});t.MainMenu=l;var o={init:function(){t.addHook("saveTemplate",this.saveTemplate.bind(this)),t.addHook("saveCoreTemplate",this.saveCoreTemplate.bind(this)),t.addHook("duplicateLayout",this.duplicateLayout.bind(this)),t.addHook("showLayoutSettings",this.showLayoutSettings.bind(this)),t.addHook("showGlobalSettings",this.showGlobalSettings.bind(this)),t.addHook("toggleUISkin",this.toggleUISkin.bind(this)),t.addHook("clearLayoutCache",this.clearLayoutCache.bind(this))},saveTemplate:function(){t._saveUserTemplateClicked(),l.hide()},saveCoreTemplate:function(){FLBuilderCoreTemplatesAdmin._saveClicked(),l.hide()},duplicateLayout:function(){t._duplicateLayoutClicked(),l.hide()},showGlobalSettings:function(){t._globalSettingsClicked(),l.hide()},showLayoutSettings:function(){t._layoutSettingsClicked(),l.hide()},clearLayoutCache:function(){t.ajax({action:"clear_cache"},function(){location.href=FLBuilderConfig.editUrl}),t.showAjaxLoader(),l.hide()},toggleUISkin:function(i){e('a[data-event="toggleUISkin"]');if(e("body").hasClass("fl-builder-ui-skin--light"))var l="light",o="dark";if(e("body").hasClass("fl-builder-ui-skin--dark"))var l="dark",o="light";e("body").removeClass("fl-builder-ui-skin--"+l).addClass("fl-builder-ui-skin--"+o),t.ajax({action:"save_ui_skin",skin_name:o})}},s={init:function(){t.addHook("beginTour",this.onStartTourClicked.bind(this))},onStartTourClicked:function(){FLBuilderTour.start(),l.hide()}}}(jQuery,FLBuilder),function(e,t){var i=FLExtendableObject.create({handle:"",name:"",panel:null,shouldShowTabItem:!0,isShowing:!1,views:{},activeView:null,defaultView:null,categorySelector:null,init:function(i){this.categorySelector=a.create({handle:"selector-"+this.handle,tab:this,items:[]}),this.categorySelector.init(),e(this.categorySelector).on("categorySelected",this.onViewSelected.bind(this));i.views;if(this.initViews(i.views),0===Object.keys(this.views).length){var l={handle:"noViews",name:"No Views",templateName:"fl-content-panel-no-view"};this.addView(l)}if(!this.activeView){var o=Object.keys(this.views)[0],l=this.views[o];this.activeView=l}this.defaultView=this.activeView,e(this.panel).on("afterRender",this.renderView.bind(this,this.activeView)),e(this.panel).on("onShow onShowTab",this.initScroller.bind(this)),t.addHook("contentItemsChanged",this.onLibraryDataChanged.bind(this))},initViews:function(e){for(var t in e){var i=e[t];this.categorySelector.addItem(i),"separator"!==i.type&&this.addView(i)}},addView:function(e){var t=l;switch(this.handle){case"modules":t=o;break;case"rows":t=s;break;case"templates":t=n;break;case"saved":t=r;break;default:t=l}_.isNull(this.viewController)||_.isUndefined(this.viewController)||(t=window[this.viewController]);var i=t.create(e),a=i.handle;i.init(),this.views[a]=i,i.isShowing&&(this.activeView=i)},renderView:function(e){if(this.$el=this.panel.$el.find('.fl-builder--panel-view[data-tab="'+this.handle+'"]'),_.isObject(e))var i=e;else var i=this.views[e];if(_.isObject(i)&&_.isFunction(i.render)){var l=i.render();this.$el.find(".fl-nanoscroller-content").html(l),this.activeView=i,t._initSortables(),this===this.panel.activeTab&&this.renderGroupSelector(),this.initScroller(),this.$el.find(".fl-nanoscroller-content").scrollTop(0)}},initScroller:function(){this.$el.nanoScroller({alwaysVisible:!0,preventPageScrolling:!0,paneClass:"fl-nanoscroller-pane",sliderClass:"fl-nanoscroller-slider",contentClass:"fl-nanoscroller-content"})},show:function(){e(this.activeView).trigger("onBeforeShow"),this.renderGroupSelector(),this.isShowing=!0,this.$el.addClass("is-showing"),this.$el.find(".fl-nanoscroller-content").scrollTop(0)},hide:function(){this.isShowing=!1,this.$el.removeClass("is-showing"),this.activeView!==this.defaultView&&this.renderView(this.defaultView),_.isObject(this.categorySelector)&&this.categorySelector.close()},renderGroupSelector:function(){var e=this.panel.$groupSelect,t=this.panel.$el.find(".fl-builder-panel-search");if(this.isSearchEnabled?t.show():t.hide(),Object.keys(this.views).length>1&&!_.isUndefined(this.categorySelector)){var i=this.categorySelector.render();this.panel.$el.find(".fl-builder-content-group-select");e.html(i),e.show(),this.panel.$el.removeClass("single-view")}else e.hide(),t.hide(),this.panel.$el.addClass("single-view")},onViewSelected:function(e,t){this.renderView(t),this.categorySelector.close()},onLibraryDataChanged:function(){this.renderView(this.activeView)}}),l=FLExtendableObject.create({templateName:"",name:"",handle:"",query:null,init:function(){this.template=wp.template(this.templateName),e(this).on("afterRender",this.bindEvents.bind(this)),e(this).trigger("afterInit")},filterTemplateData:function(e){return _.isNull(this.query)||_.isUndefined(this.query)||(e.queryResults=t.Search.byQuery(this.query)),e},render:function(){e(this).trigger("beforeRender");var t=this;t=this.filterTemplateData(t);var i=e(this.template(t));return this.$el=i,e(this).trigger("afterRender"),i},bindEvents:function(){},transitionIn:function(){},transitionOut:function(){}}),o=l.create({templateName:"fl-content-panel-modules-view",bindEvents:function(){this.$sections=this.$el,this.$items=this.$el.find(".fl-builder-block, .fl-builder-blocks-section-title")}}),s=l.create({templateName:"fl-content-panel-row-templates-view",bindEvents:function(){this.$items=this.$el.find(".fl-builder-block, .fl-builder-blocks-section-title")}}),n=l.create({templateName:"fl-content-panel-templates-view",bindEvents:function(){this.$items=this.$el.find(".fl-builder--template-collection-item"),this.$items.on("click",this.onTemplateClick.bind(this)),this.$userTemplateSections=e(".fl-user-templates"),this.$userTemplates=this.$el.find(".fl-user-template, .fl-builder--save-new-user-template"),this.$saveNewTemplateInput=this.$el.find('.fl-save-control input[name="template-name"]'),this.$saveNewTemplateCat=this.$el.find('.fl-save-control input[name="template-category"]'),this.$saveNewTemplateBtn=this.$el.find(".fl-save-control button"),this.$saveNewMask=this.$el.find(".fl-save-control-mask"),this.$saveNewTemplateInput.on("focus",this.onSaveInputFocus.bind(this)),this.$saveNewTemplateInput.on("keyup",this.onSaveInputKeyup.bind(this)),this.$saveNewTemplateBtn.on("click",this.onSaveButtonClick.bind(this)),this.$saveNewMask.on("click",this.resetSaveInput.bind(this))},onSaveInputFocus:function(){this.resetSaveInput(),this.$saveNewMask.show()},resetSaveInput:function(){this.$saveNewTemplateInput.val(""),this.$saveNewTemplateBtn.hide(),this.$saveNewMask.hide()},onSaveInputKeyup:function(t){var i=e(t.currentTarget),l=i.val(),o=i.siblings("button");""!==l?o.show():o.hide()},onSaveButtonClick:function(i){var l=e(i.currentTarget),o=l.siblings('input[name="template-name"]').val(),s=l.siblings('input[name="template-category"]').val(),n={name:o,category:s};""!==o&&t.ajax({action:"save_user_template",settings:n},t._saveUserTemplateSettingsComplete)},onTemplateClick:function(i){var l=e(i.currentTarget),o=l.data("id"),s=l.data("type");t._requestTemplateInsert(o,s)}}),r=l.create({templateName:"fl-content-panel-saved-view",filterTemplateData:function(e){return e.queryResults=t.Search.byQuery({kind:"template",type:"user",content:["module","column","row"]}),e}}),a=FLExtendableObject.create({templateName:"fl-content-panel-category-selector",template:null,tab:null,isOpen:!1,items:{},init:function(){this.template=wp.template(this.templateName),e(this).on("afterRender",this.bindEvents.bind(this)),e(this.tab.panel).on("didShowSearchControls",this.close.bind(this))},render:function(){this.close();var t=e(this.template(this));return this.$el=t,e(this).trigger("afterRender"),t},bindEvents:function(){this.$selectorTitle=this.$el.find(".fl-builder--selector-display"),this.$selectorTitle.on("click",this.toggleOpenClose.bind(this)),this.$categories=this.$el.find(".fl-builder--selector-menu .fl-builder--menu-item"),this.$categories.on("click",this.onCategoryClick.bind(this))},addItem:function(e){var t;t=_.isUndefined(e.handle)?_.uniqueId("sep_"):e.handle,this.items[t]=e},open:function(){this.isOpen||(this.$el.addClass("is-showing"),this.isOpen=!0)},close:function(){this.isOpen&&(this.$el.removeClass("is-showing"),this.isOpen=!1,this.$selectorTitle.find("button").focus())},toggleOpenClose:function(){this.isOpen?this.close():this.open()},onCategoryClick:function(t){var i=e(t.target).data("view");e(this).trigger("categorySelected",i)}});t.ContentPanel=FLExtendableObject.create({templateName:"fl-content-panel-base",template:null,tabs:{},activeTab:null,isShowing:!1,init:function(){if(FLBuilderConfig.panelData){var e=FLBuilderConfig.panelData.tabs;for(var l in e){var o=e[l];if(n=i.create(o),n.panel=this,n.views={},n.init(o),this.tabs[l]=n,n.isShowing&&(this.activeTab=n),!this.activeTab){var s=Object.keys(this.tabs)[0],n=this.tabs[s];n.isShowing=!0,this.activeTab=n}}this.template=wp.template(this.templateName),this.render(),this.renderSearchResults=wp.template("fl-search-results-panel"),this.renderNoResults=wp.template("fl-search-no-results"),t.triggerHook("contentPanelDidInit")}},render:function(){e("body").prepend(this.template(this)),this.$el=e(".fl-builder--content-library-panel"),this.bindEvents(),this.$groupSelect=this.$el.find(".fl-builder-content-group-select"),e(this).trigger("afterRender")},bindEvents:function(){this.$tabs=this.$el.find(".fl-builder--tabs [data-tab]"),this.$tabs.on("mouseup",this.onTabItemMouseUp.bind(this)),this.$tabs.on("click",this.onTabItemClick.bind(this)),this.$search=this.$el.find(".fl-builder-panel-search"),this.$searchBtn=this.$search.find(".fl-builder-toggle-panel-search"),this.$searchInput=this.$search.find('input[name="search-term"]'),this.$searchBtn.on("click",this.onSearchButtonClicked.bind(this)),this.$search.find(".fl-builder-dismiss-panel-search").on("click",this.onDismissButtonClicked.bind(this)),this.$searchInput.on("keyup",this.onSearchTermChanged.bind(this)),this.$searchPanel=this.$el.find(".fl-builder--search-results-panel"),t.addHook("showContentPanel",this.show.bind(this)),t.addHook("showModules",this.show.bind(this,"modules")),t.addHook("showRows",this.show.bind(this,"rows")),t.addHook("showTemplates",this.show.bind(this,"templates")),t.addHook("showSaved",this.show.bind(this,"saved")),t.addHook("showSearch",this.goToSearch.bind(this));var e=this.hide.bind(this);t.addHook("hideContentPanel",e),t.addHook("didShowLightbox",e),t.addHook("didShowPublishActions",e),t.addHook("didBeginSearch",e),t.addHook("didInitDrag",e),t.addHook("didOpenMainMenu",e),t.addHook("didApplyTemplate",e);var i=this.toggleShowHide.bind(this);t.addHook("toggleContentPanel",i),t.addHook("didStopDrag",this.hideSearchControls.bind(this))},alignPanelArrow:function(){var t,i,l=this.$el,o=null,s=this.$el.find(".fl-builder--panel-arrow"),n=e(".fl-builder-content-panel-button"),r=this.$el.css("animation-duration");if(0!=n.length){this.$el.css("animation-duration","0s"),this.show(),o=l[0].getBoundingClientRect(),t=s[0].getBoundingClientRect(),this.hide(),this.$el.css("animation-duration",r),buttonOffset=n[0].getBoundingClientRect();var a=buttonOffset.x+buttonOffset.width/2;i=a<o.x?20:a-o.x-t.width/2,s.css({right:"auto",left:i+"px"})}},show:function(i){"module"===FLBuilderConfig.userTemplateType||FLBuilderConfig.simpleUi||(t.triggerHook("willShowContentPanel"),"undefined"!=typeof i&&this.showTab(i),this.isShowing||t._triggerSettingsSave(!1,!0)&&(e("body").addClass("fl-builder-content-panel-is-showing"),this.isShowing=!0,e(this).trigger("onShow"),t.triggerHook("didShowContentPanel")))},hide:function(){this.isShowing&&(this.$el.hasClass("fl-builder-ui-pinned")||(e("body").removeClass("fl-builder-content-panel-is-showing"),this.isShowing=!1,e(this).trigger("onHide"),t.triggerHook("didHideContentPanel")))},toggleShowHide:function(){this.isShowing?this.hide():this.show()},showTab:function(t){var i=this.tabs[t];_.isObject(i)&&(_.isObject(this.activeTab)&&(this.activeTab.hide(),this.$tabs.filter(".is-showing").removeClass("is-showing")),this.hideSearchControls(),i.show(),this.$tabs.filter('[data-tab="'+i.handle+'"]').addClass("is-showing"),this.activeTab=i,e(this).trigger("onShowTab"))},goToSearch:function(){this.show("modules"),this.$el.find(".fl-builder-toggle-panel-search").trigger("click")},onTabItemMouseUp:function(t){e(t.currentTarget).blur()},onTabItemClick:function(t){var i=e(t.target),l=i.data("tab");this.showTab(l)},onSearchButtonClicked:function(){this.showSearchControls()},onDismissButtonClicked:function(){this.hideSearchControls(),this.$searchBtn.focus()},showSearchControls:function(){this.$search.addClass("is-showing-input"),this.$search.find('input[name="search-term"]').focus(),e(".fl-builder--selector-display-label").attr("tabindex",-1),this.$searchBtn.attr("tabindex",-1),e(this).trigger("didShowSearchControls")},hideSearchControls:function(){this.$search.removeClass("is-showing-input"),this.clearSearchInput(),this.hideSearchResults(),e(".fl-builder--selector-display-label").attr("tabindex",null),this.$searchBtn.attr("tabindex",null)},onSearchTermChanged:function(e){var i=this.$searchInput.val();if(""!==i){var l=t.Search.byTerm(i);""!=l.term?this.showSearchResults(l):this.hideSearchResults()}else this.hideSearchResults()},clearSearchInput:function(){this.$searchInput.val(""),this.hideSearchResults()},showSearchResults:function(i){if(i.total>0){var l=e(this.renderSearchResults(i));this.$searchPanel.html(l),t._initSortables()}else{var l=e(this.renderNoResults(i));this.$searchPanel.html(l)}e("body").addClass("fl-builder-search-results-panel-is-showing")},hideSearchResults:function(){e("body").removeClass("fl-builder-search-results-panel-is-showing")}})}(jQuery,FLBuilder),function(e){FLBuilderSettingsForms={config:null,settings:null,legacyXhr:null,init:function(){this.bind()},bind:function(){FLBuilder.addHook("didDeleteRow",this.closeOnDeleteNode),FLBuilder.addHook("didDeleteColumn",this.closeOnDeleteNode),FLBuilder.addHook("didDeleteModule",this.closeOnDeleteNode)},render:function(t,i){var l=FLBuilderSettingsConfig.forms,o=FLBuilderSettingsConfig.modules,s={type:"general",id:null,nodeId:null,className:"",attrs:"",title:"",badges:[],tabs:[],buttons:[],settings:{},legacy:null,rules:null,preview:null,helper:null};if(t.nodeId&&!t.settings)return void this.loadNodeSettings(t,i);if(t=e.extend(s,t),i=void 0===i?function(){}:i,t.id){if("general"===t.type&&void 0!==l[t.id])t=e.extend(!0,t,l[t.id]);else{if("module"!==t.type||void 0===o[t.id])return;t=e.extend(!0,t,o[t.id])}this.config=t,this.renderLightbox(t)&&(t.legacy||!this.renderLegacySettings(t,i)?this.renderComplete(t,i):this.showLightboxLoader())}},loadNodeSettings:function(e,t){FLBuilder.showAjaxLoader(),FLBuilder.ajax({action:"get_node_settings",node_id:e.nodeId},function(i){e.settings=JSON.parse(i),FLBuilderSettingsConfig.nodes[e.nodeId]=e.settings,FLBuilderSettingsForms.render(e,t),FLBuilder.hideAjaxLoader()})},renderLightbox:function(t){var i=wp.template("fl-builder-settings"),l=FLBuilder._lightbox._node.find("form.fl-builder-settings");e(".fl-lightbox-wrap[data-parent]");if(t.nodeId&&t.nodeId===l.data("node")&&!t.lightbox)return FLBuilder._focusFirstSettingsControl(),!1;if(t.lightbox)t.lightbox.setContent(i(t));else{if(!FLBuilder._triggerSettingsSave(!0,!0))return!1;FLBuilder.preview&&FLBuilder.preview.cancel(),FLBuilder._closePanel(),FLBuilder._showLightbox(),FLBuilder._setLightboxContent(i(t))}return!0},renderComplete:function(t,i){var l=e(".fl-builder-settings:visible");setTimeout(function(){t.legacy&&this.renderLegacySettingsComplete(t.legacy),i(),FLBuilder._initSettingsForms(),t.rules&&FLBuilder._initSettingsValidation(t.rules),t.preview&&(FLBuilder.preview=new FLBuilderPreview(t.preview)),t.helper&&t.helper.init(),l.closest(".fl-lightbox-wrap[data-parent]").length||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,l))}.bind(this),1)},renderFields:function(t,i){var l=wp.template("fl-builder-settings-row"),o="",s=null,n=null,r=null,a=!1,d=null,u=["dimension","unit"],i=i?i:this.config.settings,c=FLBuilderConfig.global;for(n in t)s=t[n],a=!!s.multiple,supportsResponsive=e.inArray(s.type,u)>-1,r=_.isUndefined(i[n])?"":i[n],_.isUndefined(i[n])&&s["default"]&&(r=s["default"]),d=s.responsive&&c.responsive_enabled&&!a&&supportsResponsive?s.responsive:null,o+=l({field:s,name:n,rootName:n,value:r,preview:JSON.stringify(s.preview?s.preview:{type:"refresh"}),responsive:d,rowClass:s.row_class?" "+s.row_class:"",isMultiple:a,supportsMultiple:"editor"!==s.type&&"photo"!==s.type&&"service"!==s.type,settings:i,globalSettings:c,template:e("#tmpl-fl-builder-field-"+s.type)});return o},renderField:function(e){var t=wp.template("fl-builder-field");return t(e)},renderSectionTemplate:function(e,t){var i=wp.template(e.template.id);return i({section:e,settings:t})},renderTabTemplate:function(e,t){var i=wp.template(e.template.id);return i({tab:e,settings:t})},renderLegacySettings:function(t,i){var l=e(".fl-builder-settings:visible"),o=null,s=!1,n={tabs:[],sections:[],fields:[],settings:null,node_id:null};return l.find(".fl-legacy-field").each(function(){o=e(this),n.fields.push(o.attr("data-field")),FLBuilderSettingsForms.showFieldLoader(o),s=!0}),l.find(".fl-legacy-settings-section").each(function(){o=e(this),n.sections.push({tab:o.attr("data-tab"),section:o.attr("data-section")}),s=!0}),l.find(".fl-legacy-settings-tab").each(function(){o=e(this),n.tabs.push(o.attr("data-tab")),s=!0}),l.attr("data-node")?n.node_id=l.attr("data-node"):n.settings=FLBuilder._getOriginalSettings(l,!0),this.legacyXhr&&(this.legacyXhr.abort(),this.legacyXhr=null),this.legacyXhr=FLBuilder.ajax(e.extend(this.getLegacyVars(),{action:"render_legacy_settings",data:n,form:l.attr("data-form-id"),group:l.attr("data-form-group"),lightbox:l.closest(".fl-builder-lightbox").attr("data-instance-id")}),function(e){FLBuilderSettingsForms.renderLegacySettingsComplete(e),s&&FLBuilderSettingsForms.renderComplete(t,i),FLBuilderSettingsForms.hideLightboxLoader()}),s},renderLegacySettingsComplete:function(t){var i="object"==typeof t?t:JSON.parse(t),l=null,o=null,s="",n=null,r=null,a=null;if(i.lightbox?(l=e(".fl-builder-lightbox[data-instance-id="+i.lightbox+"]"),o=l.length?l.find(".fl-builder-settings"):null):(o=e(".fl-builder-settings:visible"),l=o.closest(".fl-builder-lightbox")),o&&o.length){for(s in i.fields)n=e("#fl-field-"+s).attr("id",""),n.after(i.fields[s]).remove();for(s in i.extras)n=e("#fl-field-"+s).find(".fl-field-control-wrapper"),i.extras[s].multiple?n.each(function(t,l){t in i.extras[s].before&&""!=i.extras[s].before[t]&&e(this).prepend('<div class="fl-form-field-before">'+i.extras[s].before[t]+"</div>"),t in i.extras[s].after&&""!=i.extras[s].after[t]&&e(this).append('<div class="fl-form-field-after">'+i.extras[s].after[t]+"</div>")}):(""!=i.extras[s].before&&n.prepend('<div class="fl-form-field-before">'+i.extras[s].before+"</div>"),""!=i.extras[s].after&&n.append('<div class="fl-form-field-after">'+i.extras[s].after+"</div>"));for(a in i.sections)for(s in i.sections[a])r=e("#fl-builder-settings-section-"+s),r.html(i.sections[a][s]);for(s in i.tabs)a=e("#fl-builder-settings-tab-"+s),a.html(i.tabs[s]);l.data("parent")||(this.settings=FLBuilder._getSettingsForChangedCheck(this.config.nodeId,o),FLBuilder.preview&&(FLBuilder.preview._savedSettings=this.settings)),_.isUndefined(window.FLThemeBuilderFieldConnections)||FLThemeBuilderFieldConnections._initSettingsForms(),this.legacyXhr=null}},getLegacyVars:function(){var t=e(".fl-builder-settings:visible"),i=t.closest(".fl-builder-lightbox"),l=i.attr("data-parent"),o=null,s=null,n={};return l&&(l=e(".fl-builder-lightbox[data-instance-id="+l+"]"),t=l.find("form.fl-builder-settings"),o=FLBuilder._getSettings(t),s=t.attr("data-node"),s&&(n.node_id=s,n.node_settings=o)),n},settingsHaveChanged:function(){var e=FLBuilder._lightbox._node.find("form.fl-builder-settings"),t=FLBuilder._getSettings(e),i=!!this.settings&&JSON.stringify(this.settings)!=JSON.stringify(t);return i},closeOnDeleteNode:function(t,i){var l=e(".fl-builder-settings[data-node]"),o=FLBuilder._contentClass+" .fl-node-"+l.data("node");l.length&&!e(o).length&&FLLightbox.closeAll()},showLightboxLoader:function(){e(".fl-builder-settings:visible").append('<div class="fl-builder-loading"></div>')},hideLightboxLoader:function(t){e(".fl-builder-settings:visible .fl-builder-loading").remove()},showFieldLoader:function(e){var t=e.closest(".fl-field-control").find(".fl-field-control-wrapper");t.hide().after('<div class="fl-field-loader">'+FLBuilderStrings.fieldLoading+"</div>")},hideFieldLoader:function(e){var t=e.closest(".fl-field"),i=e.closest(".fl-field-control").find(".fl-field-control-wrapper");i.show(),t.find(".fl-field-loader").remove()}},FLBuilderSettingsConfig="undefined"==typeof FLBuilderSettingsConfig?{}:FLBuilderSettingsConfig,e.extend(FLBuilderSettingsConfig,{init:function(){FLBuilder.addHook("didSaveNodeSettings",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveNodeSettingsComplete",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didSaveGlobalSettingsComplete",this.updateOnSaveGlobalSettings.bind(this)),FLBuilder.addHook("didSaveLayoutSettingsComplete",this.updateOnSaveLayoutSettings.bind(this)),FLBuilder.addHook("didAddRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddColumnGroup",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didAddModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDeleteModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateRow",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateColumn",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didDuplicateModule",this.updateOnNodeEvent.bind(this)),FLBuilder.addHook("didResizeRow",this.updateOnRowResize.bind(this)),FLBuilder.addHook("didResizeColumn",this.updateOnColumnResize.bind(this)),FLBuilder.addHook("didResetRowWidth",this.updateOnResetRowWidth.bind(this)),FLBuilder.addHook("didResetColumnWidths",this.updateOnResetColumnWidths.bind(this)),FLBuilder.addHook("didApplyTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didApplyRowTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didApplyColTemplateComplete",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didSaveGlobalNodeTemplate",this.updateOnApplyTemplate.bind(this)),FLBuilder.addHook("didRestoreRevisionComplete",this.updateOnApplyTemplate.bind(this))},updateOnSaveGlobalSettings:function(e,t){this.settings.global=t},updateOnSaveLayoutSettings:function(e,t){this.settings.layout=t},updateOnNodeEvent:function(){var e=arguments[0];e.namespace.indexOf("didAdd")>-1?this.addNode(arguments[1]):e.namespace.indexOf("didSaveNodeSettings")>-1?this.updateNode(arguments[1].nodeId,arguments[1].settings):e.namespace.indexOf("didDelete")>-1?this.deleteNodes():e.namespace.indexOf("didDuplicate")>-1&&this.duplicateNode(arguments[1].oldNodeId,arguments[1].newNodeId)},updateOnRowResize:function(e,t){this.nodes[t.rowId].max_content_width=t.rowWidth},updateOnResetRowWidth:function(e,t){this.nodes[t].max_content_width=""},updateOnColumnResize:function(e,t){this.nodes[t.colId].size=t.colWidth,this.nodes[t.siblingId].size=t.siblingWidth},updateOnResetColumnWidths:function(t,i){var l=this;i.cols.each(function(){var t=e(this),i=t.attr("data-node");l.nodes[i]&&(l.nodes[i].size=parseFloat(t[0].style.width))})},updateOnApplyTemplate:function(e,t){this.nodes=t.nodes,this.attachments=t.attachments},addNode:function(t,i){var l=e(".fl-node-"+t),o=l.hasClass("fl-row"),s=l.hasClass("fl-col"),n=l.hasClass("fl-col-group"),r=l.hasClass("fl-module"),a=this;this.nodes[t]||(i||(o?i=e.extend({},this.defaults.row):s?i=e.extend({},this.defaults.column):r&&(i=e.extend({},this.defaults.modules[l.attr("data-type")])),o||n?l.find(".fl-col").each(function(){var t=e(this),i=e.extend({},a.defaults.column);i.size=parseFloat(t[0].style.width),a.addNode(t.attr("data-node"),i);