LBuilderWhiteLabel::get_branding(); } return __( 'Page Builder', 'fl-builder' ); } /** * Returns the custom branding icon URL. * * @since 1.3.7 * @return string */ static public function get_branding_icon() { if ( class_exists( 'FLBuilderWhiteLabel' ) ) { return FLBuilderWhiteLabel::get_branding_icon(); } return FL_BUILDER_URL . 'img/beaver.png'; } /** * Returns an array of slugs for all enabled icon sets. * * @since 1.4.6 * @return array */ static public function get_enabled_icons() { $value = self::get_admin_settings_option( '_fl_builder_enabled_icons', true ); return ! $value ? array( 'font-awesome', 'foundation-icons', 'dashicons' ) : $value; } /** * Returns the capability necessary for a user to access all * editing features in the builder interface. * * @since 1.3.9 * @return string */ static public function get_editing_capability() { $value = self::get_admin_settings_option( '_fl_builder_editing_capability', true ); return ! $value ? 'edit_posts' : $value; } /** * Checks to see if the current user has the capability necessary * to use the builders advanced editing features. * * @since 1.7 * @return bool */ static public function current_user_has_editing_capability() { $cap = self::get_editing_capability(); return self::current_user_has_capability($cap); } /** * Check if the current user has the specific capabilities * * @param string $cap The capability to evaluate if it's single or multiple (comma separated) value * @return bool */ static public function current_user_has_capability($cap) { if ( strstr( $cap, ',' ) ) { $parts = explode( ',', $cap ); foreach( $parts as $part ) { if ( current_user_can( trim( $part ) ) ) { return true; } } return false; } else { return current_user_can( $cap ); } } /** * Returns the capability necessary for a user to edit global templates. * * @since 1.6.3 * @return string */ static public function get_global_templates_editing_capability() { $value = self::get_admin_settings_option( '_fl_builder_global_templates_editing_capability', true ); return ! $value ? 'edit_posts' : $value; } /** * Returns the default settings for the builder's help button. * * @since 1.4.9 * @return array */ static public function get_help_button_defaults() { $defaults = array( 'enabled' => true, 'tour' => true, 'video' => true, 'video_embed' => '', 'knowledge_base' => true, 'knowledge_base_url' => self::get_store_url( 'knowledge-base', array( 'utm_medium' => ( true === FL_BUILDER_LITE ? 'bb-lite' : 'bb-pro' ), 'utm_source' => 'builder-ui', 'utm_campaign' => 'kb-help-button' ) ), 'forums' => true, 'forums_url' => self::get_store_url( 'knowledge-base', array( 'utm_medium' => ( true === FL_BUILDER_LITE ? 'bb-lite' : 'bb-pro' ), 'utm_source' => 'builder-ui', 'utm_campaign' => 'forums-help-button' ) ) ); return $defaults; } /** * Returns the settings for the builder's help button. * * @since 1.4.9 * @return array */ static public function get_help_button_settings() { if ( class_exists( 'FLBuilderWhiteLabel' ) ) { return FLBuilderWhiteLabel::get_help_button_settings(); } return self::get_help_button_defaults(); } /** * Returns an array of account data for all integrated services. * * @since 1.5.4 * @return array */ static public function get_services() { return get_option( '_fl_builder_services', array() ); } /** * Updates the account data for an integrated service. * * @since 1.5.4 * @param string $service The service id. * @param string $account The account name. * @param array $data The account data. * @return void */ static public function update_services( $service, $account, $data ) { $services = self::get_services(); $account = sanitize_text_field( $account ); if ( ! isset( $services[ $service ] ) ) { $services[ $service ] = array(); } $services[ $service ][ $account ] = $data; update_option( '_fl_builder_services', $services ); } /** * Deletes an account for an integrated service. * * @since 1.5.4 * @param string $service The service id. * @param string $account The account name. * @return void */ static public function delete_service_account( $service, $account ) { $services = self::get_services(); if ( isset( $services[ $service ][ $account ] ) ) { unset( $services[ $service ][ $account ] ); } if ( 0 === count( $services[ $service ] ) ) { unset( $services[ $service ] ); } update_option( '_fl_builder_services', $services ); } /** * Returns an option from the database for * the admin settings page. * * @since 1.5.7 * @param string $key The option key. * @param bool $network_override Whether to allow the network admin setting to be overridden on subsites. * @return mixed */ static public function get_admin_settings_option( $key, $network_override = true ) { // Get the site-wide option if we're in the network admin. if ( is_network_admin() ) { $value = get_site_option( $key ); } // Get the site-wide option if network overrides aren't allowed. else if ( ! $network_override && class_exists( 'FLBuilderMultisiteSettings' ) ) { $value = get_site_option( $key ); } // Network overrides are allowed. Return the subsite option if it exists. else if ( class_exists( 'FLBuilderMultisiteSettings' ) ) { $value = get_option( $key ); $value = false === $value ? get_site_option( $key ) : $value; } // This must be a single site install. Get the single site option. else { $value = get_option( $key ); } return $value; } /** * Updates an option from the admin settings page. * * @since 1.5.7 * @param string $key The option key. * @param mixed $value The value to update. * @param bool $network_override Whether to allow the network admin setting to be overridden on subsites. * @return mixed */ static public function update_admin_settings_option( $key, $value, $network_override = true ) { // Update the site-wide option since we're in the network admin. if ( is_network_admin() ) { update_site_option( $key, $value ); } // Delete the option if network overrides are allowed and the override checkbox isn't checked. else if ( $network_override && FLBuilderAdminSettings::multisite_support() && ! isset( $_POST['fl-override-ms'] ) ) { delete_option( $key ); } // Update the option for single install or subsite. else { update_option( $key, $value ); } } /** * Returns the plugin basename for Beaver Builder. * * @since 1.0 * @return string */ static public function plugin_basename() { return plugin_basename( FL_BUILDER_DIR . 'fl-builder.php' ); } /** * Deletes almost all database data and asset cache for the builder. * We don't delete _fl_builder_enabled, _fl_builder_data and _fl_builder_draft * so layouts can be recovered should the plugin be installed again. * * @since 1.0 * @return void */ static public function uninstall_database() { if(current_user_can('delete_plugins')) { // Delete builder options. delete_option('_fl_builder_settings'); delete_option('_fl_builder_enabled_modules'); delete_option('_fl_builder_enabled_templates'); delete_option('_fl_builder_user_templates_admin'); delete_option('_fl_builder_template_data_exporter'); delete_option('_fl_builder_templates_override'); delete_option('_fl_builder_templates_override_rows'); delete_option('_fl_builder_templates_override_modules'); delete_option('_fl_builder_post_types'); delete_option('_fl_builder_enabled_icons'); delete_option('_fl_builder_branding'); delete_option('_fl_builder_branding_icon'); delete_option('_fl_builder_theme_branding'); delete_option('_fl_builder_editing_capability'); delete_option('_fl_builder_global_templates_editing_capability'); delete_option('_fl_builder_help_button'); delete_option('_fl_builder_color_presets'); // Delete builder user meta. delete_metadata('user', 0, '_fl_builder_launched', 1, true); // Delete uploaded files and folders. $upload_dir = self::get_upload_dir(); $filesystem = FLBuilderUtils::get_filesystem(); $filesystem->rmdir( $upload_dir['path'], true ); // Deactivate and delete the plugin. if (!function_exists('deactivate_plugins')) { require_once(ABSPATH . 'wp-admin/includes/plugin.php'); } deactivate_plugins(array(self::plugin_basename()), false, is_network_admin()); delete_plugins(array(self::plugin_basename())); // Redirect to the plugins page. wp_redirect(admin_url('plugins.php?deleted=true&plugin_status=all&paged=1&s=')); exit; } } /** * @since 1.6.4.3 * @deprecated 1.8 */ static public function get_theme_branding() { _deprecated_function( __METHOD__, '1.8', 'FLBuilderWhiteLabel::get_theme_branding()' ); if ( class_exists( 'FLBuilderWhiteLabel' ) ) { return FLBuilderWhiteLabel::get_theme_branding(); } } /** * @since 1.0 * @deprecated 1.8 */ static public function save_templates( $templates = array() ) { _deprecated_function( __METHOD__, '1.8', 'FLBuilderCoreTemplatesAdmin::save_templates()' ); if ( class_exists( 'FLBuilderCoreTemplatesAdmin' ) ) { FLBuilderCoreTemplatesAdmin::save_templates( $templates ); } } /** * @since 1.0 * @deprecated 1.8 */ static public function save_template( $settings ) { _deprecated_function( __METHOD__, '1.8', 'FLBuilderCoreTemplatesAdmin::save_template()' ); if ( class_exists( 'FLBuilderCoreTemplatesAdmin' ) ) { FLBuilderCoreTemplatesAdmin::save_template( $settings ); } } /** * @since 1.0 * @deprecated 1.8 */ static public function update_template( $old_index, $settings ) { _deprecated_function( __METHOD__, '1.8', 'FLBuilderCoreTemplatesAdmin::update_template()' ); if ( class_exists( 'FLBuilderCoreTemplatesAdmin' ) ) { FLBuilderCoreTemplatesAdmin::update_template( $old_index, $settings ); } } /** * @since 1.0 * @deprecated 1.8 */ static public function delete_template( $index ) { _deprecated_function( __METHOD__, '1.8', 'FLBuilderCoreTemplatesAdmin::delete_template()' ); if ( class_exists( 'FLBuilderCoreTemplatesAdmin' ) ) { FLBuilderCoreTemplatesAdmin::delete_template( $index ); } } } FLBuilderModel::init(); ถพบคีย์ API ของคุณในบัญชี GetResponse ภายใต้บัญชีของฉัน > GetResponse APIสามารถพบคีย์ API ของคุณในบัญชี Hatchbuck ภายใต้การตั้งค่าบัญชี > Web APIสามารถพบคีย์ API ของคุณในบัญชี Campayn ของคุณภายใต้ผู้ดูแลระบบ > แอพพลิเคชัน > คีย์เข้ารหัสสามารถพบคีย์ API ของคุณในบัญชี Mad Mimi ภายใต้บัญชี > การตั้งค่า & การเรียกเก็บเงิน > APIสามารถพบคีย์ API ของคุณในบัญชี MailChimp ของคุณภายใต้บัญชี > เพิ่มเติมพิเศษ > คีย์ APIสามารถพบคีย์ API ของคุณในบัญชี Mailrelay ของคุณภายใต้เมนู > การตั้งค่า > การเข้าถึง APIคุณสามารถหาคีย์การเข้าถึงของคุณได้ในบัญชี SendinBlue ของคุณภายใต้ API & การผสานการทำงาน > ผู้จ้ัดการคีย์ของคุณ > เวอร์ชัน 2.0 > คีย์การเข้าถึงสามารถพบ ID บัญชีของคุณในบัญชี Drip ภายใต้การตั้งค่า > การกำหนดค่าเว็บไซต์คุณสามารถหา ID แอพได้ใน URL สำหรับบัญชีของคุณ ตัวอย่างเช่น หาก URL สำหรับบัญชีของคุณคือ myaccount.infusionsoft.com ดังนั้น ID แอพของคุณคือ myaccountคีย์ Constant Contact API ของคุณโทเคนการเข้าถึง Constant Contact ของคุณข้อความของคุณเทมเพลทของคุณอีเมลของคุณID แอพ iContact ของคุณรหัสผ่านแอพ iContact ของคุณชื่อผู้ใช้ iContact ของคุณข้อความของคุณชื่อของคุณโทรศัพท์ของคุณexample@mail.comhttp://www.example.comhttp://www.example.com/my-photo.jpgต่อปี,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 l=e(this),i=l.val(),o=l.parent().find(".fl-color-picker-color"),s=flBuilderParseColorValue(i),r="";if(i){if(o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba)r=l.val().toString();else if(!o.hasClass("fl-color-picker-alpha-enabled")&&s.rgba){var n=i.replace("rgba","rgb");n=n.substr(0,n.lastIndexOf(","))+")",t._color._alpha=1,r=n,l.val(n)}else r="#"+l.val().toString();o.css({backgroundColor:r})}})},_setTemplates:function(){this._alphaHtml='
',this._presetsHtml='
'+this.options.labels.colorPresets+'
'+this.options.labels.colorPicker+'
',this._hexHtml='
',this._presetsTpl='
  • ',this._noPresetsTpl='
  • '+this.options.labels.noPresets+"
  • "},_has:function(t,l){var i=!1;return e.each(l,function(e,l){if(t===l)return i=!0,!1}),i},_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,l){t._addPresetView(l)}):t._presetsList.append(this._noPresetsTpl)},_addPresetView:function(t){var l=this._presetsList.find(".fl-color-picker-no-preset");l.length>0&&l.remove();var i=e(this._presetsTpl),o=Color(t);i.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(i)},_addPresetFeedback:function(){this._ui.append('
    "'+this.options.labels.presetAdded.replace("%s",this._color.toString())+'"
    '),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 l=e(this);t._currentElement=l.parent().find(".fl-color-picker-value"),t._ui.position({my:"left top",at:"left bottom",of:l,collision:"flipfit",using:function(e,l){t._togglePicker(e)}})}).on("click",".fl-color-picker-clear",function(){var l=e(this);t._currentElement=l.parent().find(".fl-color-picker-value"),l.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("click",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,l=t._ui.find(".fl-color-picker-preset-add"),i=t._ui.find(".fl-color-picker-presets"),o=i.find(".fl-color-picker-presets-open-label"),s=i.find(".fl-color-picker-presets-close-label"),r=i.find(".fl-color-picker-presets-list"); l.off("click").on("click",function(){t._addPreset(t.element.val())}),r.css({height:t.element.innerHeight()+t._iris.innerHeight()+14+"px"}).hide(),i.off("click").on("click",".fl-color-picker-presets-toggle",function(){o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),r.slideToggle(500)}).on("click",".fl-color-picker-preset",function(l){var i=new Color(e(this).data("color").toString());t._setColor(i),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:i.toString()}).removeClass("fl-color-picker-empty"),o.toggleClass("fl-color-picker-active"),s.toggleClass("fl-color-picker-active"),r.slideToggle(500)}).on("click",".fl-color-picker-preset-remove",function(l){l.stopPropagation(),t._removePreset(e(this).parent().data("color"))})},_removePreset:function(t){if(confirm(this.options.labels.removePresetConfirm)){var l=t.toString(),i=a.indexOf(l);i>-1&&(a.splice(i,1),this.options.presets=a,this._presetsList.find('.fl-color-picker-preset[data-color="'+l+'"]').slideUp(function(){e(this).remove()})),a.length<1&&this._presetsList.append(this._noPresetsTpl),e(this).trigger("presetRemoved",{presets:a})}},_addPreset:function(t){var l=t.toString().replace(/^#/,"");""===l?alert(this.options.labels.noneColorSelected):a.indexOf(l)>-1?alert(this.options.labels.alreadySaved.replace("%s","#"+l)):(this._addPresetView(l),this._addPresetFeedback(),a.push(l),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 l,i=this,o=i._color,s=i.options.mode,r=i._getHSpaceColor(),n=i.controls[t],a=i.options.controls;if(t!==i.active&&("square"!==i.active||"strip"===t))switch(a[t]){case"h":if("hsv"===s){switch(r=o.clone(),t){case"horiz":r[a.vert](100);break;case"vert":r[a.horiz](100);break;case"strip":r.setHSpace("hsl")}l=r.toHsl()}else l="strip"===t?{s:r.s,l:r.l}:{s:100,l:r.l};n.flBuilderColorPickerRaninbowGradient(e,l);break;case"s":"hsv"===s?"vert"===t?l=[o.clone().a(0).s(0).toCSS("rgba"),o.clone().a(1).s(0).toCSS("rgba")]:"strip"===t?l=[o.clone().s(100).toCSS("hsl"),o.clone().s(0).toCSS("hsl")]:"horiz"===t&&(l=["#fff","hsl("+r.h+",100%,50%)"]):l="vert"===t&&"h"===i.options.controls.horiz?["hsla(0, 0%, "+r.l+"%, 0)","hsla(0, 0%, "+r.l+"%, 1)"]:["hsl("+r.h+",0%,50%)","hsl("+r.h+",100%,50%)"],n.flBuilderColorPickerGradient(e,l);break;case"l":l="strip"===t?["hsl("+r.h+",100%,100%)","hsl("+r.h+", "+r.s+"%,50%)","hsl("+r.h+",100%,0%)"]:["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],n.flBuilderColorPickerGradient(e,l);break;case"v":l="strip"===t?[o.clone().v(100).toCSS(),o.clone().v(0).toCSS()]:["rgba(0,0,0,0)","#000"],n.flBuilderColorPickerGradient(e,l)}},_getHSpaceColor:function(){return"hsv"===this.options.mode?this._color.toHsv():this._color.toHsl()},_dimensions:function(e){var t,l=this,i=l.options,o=l.controls,s=o.square,r=l.picker.find(".iris-strip"),n="77.5%",a="12%",d=20,u=i.border?i.width-d:i.width;if(e&&(s.css("width",""),r.css("width",""),l.picker.css({width:"",height:""})),n=u*(parseFloat(n)/100),a=u*(parseFloat(a)/100),t=i.border?n+d:n,s.width(n).height(n),r.height(n).width(a),l.picker.css({width:i.width,height:t}),!i.palettes)return l.picker.css("paddingBottom","")},_addInputListeners:function(e){var t=this,l=100,i=function(l){var i=new Color(e.val()),o=e.val().replace(/^#/,"");if(e.removeClass("iris-error"),i.error)""!==o&&e.addClass("iris-error");else if(i.toString()!==t._color.toString())if("keyup"===l.type){if(o.match(/^[0-9a-fA-F]{3}$/))return;t._setColor(o),t._currentElement.parent().find(".fl-color-picker-color").css({backgroundColor:Color(o).toString()}).removeClass("fl-color-picker-empty"),t._currentElement.val(o).trigger("change")}else if("paste"===l.type)return o=l.originalEvent.clipboardData.getData("text").replace(/^#/,""),hex=Color(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",i).on("keyup",t._debounce(i,l))},_initControls:function(){var t=this,l=t.controls,i=l.square,o=t.options.controls,s=t._scale[o.strip];l.stripSlider.slider({orientation:"horizontal",max:s,slide:function(e,l){t.active="strip","h"===o.strip&&(l.value=s-l.value),t._color[o.strip](l.value),t._change.apply(t,arguments)}}),l.squareDrag.draggable({containment:l.square.find(".iris-square-inner"),zIndex:1e3,cursor:"move",drag:function(e,l){t._squareDrag(e,l)},start:function(){i.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){i.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(l){var i="ui-state-focus";l.preventDefault(),"mousedown"===l.type?(t.picker.find("."+i).removeClass(i).blur(),e(this).addClass(i).focus()):e(this).removeClass(i)}).on("keydown",function(e){var i=l.square,o=l.squareDrag,s=o.position(),r=2;switch(e.altKey&&(r*=10),e.keyCode){case 37:s.left-=r;break;case 38:s.top-=r;break;case 39:s.left+=r;break;case 40:s.top+=r;break;default:return!0}s.left=Math.max(0,Math.min(s.left,i.width())),s.top=Math.max(0,Math.min(s.top,i.height())),o.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),i.mousedown(function(l){var i,o;1===l.which&&e(l.target).is("div")&&(i=t.controls.square.offset(),o={top:l.pageY-i.top,left:l.pageX-i.left},l.preventDefault(),t._squareDrag(l,{position:o}),l.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(o).trigger(l))})},_squareDrag:function(e,t){var l=this,i=l.options.controls,o=l._squareDimensions(),s=Math.round((o.h-t.position.top)/o.h*l._scale[i.vert]),r=l._scale[i.horiz]-Math.round((o.w-t.position.left)/o.w*l._scale[i.horiz]);l._color[i.horiz](r)[i.vert](s),l.active="square",l._change.apply(l,arguments)},_setColor:function(e){var t,l,i=this,o=i.options.color;i.options.color=e,e=""+e,t=e.replace(/^#/,""),l=new Color(e).setHSpace(i.options.mode),l.error?i.options.color=o:(i._color=l,i.options.color=i._color.toString(),i.active="external",i._change())},_squareDimensions:function(e){var l,i,o=this.controls.square;return e!==t&&o.data("dimensions")?o.data("dimensions"):(i=this.controls.squareDrag,l={w:o.width(),h:o.height()},o.data("dimensions",l),l)},_isNonHueControl:function(e,t){return"square"===e&&"h"===this.options.controls.strip||"external"!==t&&("h"!==t||"strip"!==e)},_change:function(){var t=this,l=t.controls,i=t._getHSpaceColor(),o=["square","strip"],s=t.options.controls,r=s[t.active]||"external",n=t.hue;"strip"===t.active?o=[]:"external"!==t.active&&o.pop(),e.each(o,function(e,o){var r,n,a;if(o!==t.active)switch(o){case"strip":r="h"===s.strip?t._scale[s.strip]-i[s.strip]:i[s.strip],l.stripSlider.slider("value",r);break;case"square":n=t._squareDimensions(),a={left:i[s.horiz]/t._scale[s.horiz]*n.w,top:n.h-i[s.vert]/t._scale[s.vert]*n.h},t.controls.squareDrag.css(a)}}),i.h!==n&&t._isNonHueControl(t.active,r)&&t._color.h(n),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&&(this._currentElement.val(t._color.toString().replace(/^#/,"")).parent().find(".fl-color-picker-color").css({backgroundColor:t._color.toString()}).removeClass("fl-color-picker-empty"),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,l){var i,o;return function(){var s,r,n=this,a=arguments;return s=function(){i=null,l||(o=e.apply(n,a))},r=l&&!i,clearTimeout(i),i=setTimeout(s,t),r&&(o=e.apply(n,a)),o}},_buildAlphaUI:function(){var t=this;t._wrapper.on("click",".fl-color-picker-color",function(){var l=e(this);t._currentElement.val();l.hasClass("fl-color-picker-alpha-enabled")?(t._ui.find(".fl-alpha-wrap").length<=0&&e(t._alphaHtml).insertAfter(t._iris),t._pickerAlphaControls()):t._ui.find(".fl-alpha-wrap").remove()})},_pickerAlphaControls:function(){var e=this,t=e._currentElement,l=flBuilderParseColorValue(t.val()),i=parseFloat(l.alpha/100),o=e._wrapper,s=e._ui,r=s.find(".fl-alpha-wrap"),n=r.find(".fl-alpha-slider"),a=r.find(".fl-alpha-text"),d=r.find(".fl-alpha-slider-offset");alphaHandle=r.find(".ui-slider-handle"),a.text(i<1?i:""),n.slider({orientation:"vertical",slide:function(t,l){var i=parseFloat(l.value/100);e._color._alpha=i,a.text(i<1?i:""),e._change.apply(e,arguments)},create:function(){d.css({backgroundColor:l.value}),o.on("click",".fl-color-picker-clear",function(){e._color._alpha=1,a.text(""),n.slider("value",100).trigger("slide")})},value:l.alpha,step:1,min:1,max:100})}}}(jQuery),function(e,t){var l=function(e,t){return this instanceof l?this._init(e,t):new l(e,t)};l.fn=l.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 l="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),l=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":l,this[l](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 l(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"],i=t.length-1;i>=0;i--)e[t[i]]=this[t[i]];return e},setHSpace:function(e){return this._hSpace="hsv"===e?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,l=/^(rgb|hs(l|v))a?\(/;if(this.error=!1,e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,""),e.match(l)&&e.match(/\)$/)){if(t=e.replace(/(\s|%)/g,"").replace(l,"").replace(/,?\);?$/,"").split(","),t.length<3)return this._error();if(4===t.length&&(this.a(parseFloat(t.pop())),this.error))return this;for(var i=t.length-1;i>=0;i--)if(t[i]=parseInt(t[i],10),isNaN(t[i]))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,l){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),l))},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 l,i,o,s,r,n,a,d;return"object"!=typeof e||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",n=e.h/360,a=e.s/100,d=e.l/100,0===a?l=i=o=d:(s=d<.5?d*(1+a):d+a-d*a,r=2*d-s,l=this.hue2rgb(r,s,n+1/3),i=this.hue2rgb(r,s,n),o=this.hue2rgb(r,s,n-1/3)),this.fromRgb({r:255*l,g:255*i,b:255*o},!0))},fromHsv:function(e){var l,i,o,s,r,n,a,d,u,c,f;if("object"!=typeof e||e.h===t||e.s===t||e.v===t)return this._error();switch(this._hsv=e,this._hSpace="hsv",l=e.h/360,i=e.s/100,o=e.v/100,a=Math.floor(6*l),d=6*l-a,u=o*(1-i),c=o*(1-d*i),f=o*(1-(1-d)*i),a%6){case 0:s=o,r=f,n=u;break;case 1:s=c,r=o,n=u;break;case 2:s=u,r=o,n=f;break;case 3:s=u,r=c,n=o;break;case 4:s=f,r=u,n=o;break;case 5:s=o,r=u,n=c}return this.fromRgb({r:255*s,g:255*r,b:255*n},!0)},fromInt:function(e,l){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),l===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?e+6*(t-e)*l:l<.5?t:l<2/3?e+(t-e)*(2/3-l)*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 l=this.toRgb();return t<1?"rgba( "+l.r+", "+l.g+", "+l.b+", "+t+" )":"rgb( "+l.r+", "+l.g+", "+l.b+" )";case"hsl":case"hsla":var i=this.toHsl();return t<1?"hsla( "+i.h+", "+i.s+"%, "+i.l+"%, "+t+" )":"hsl( "+i.h+", "+i.s+"%, "+i.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,l=this.toRgb(),i=l.r/255,o=l.g/255,s=l.b/255,r=Math.max(i,o,s),n=Math.min(i,o,s),a=(r+n)/2;if(r===n)e=t=0;else{var d=r-n;switch(t=a>.5?d/(2-r-n):d/(r+n),r){case i:e=(o-s)/d+(oi?(t+.05)/(i+.05):(i+.05)/(t+.05)},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new l(t)},getReadableContrastingColor:function(e,i){if(!(e instanceof l))return this;var o=i===t?5:i,s=e.getDistanceLuminosityFrom(this),r=e.getMaxContrastColor(),n=r.getDistanceLuminosityFrom(e);if(n<=o)return r;if(s>=o)return this;for(var a=0===r.toInt()?-1:1;sl.range[1]?l.range[1]:i),s[e]=i,this._spaceFunc("from",l.space,s))}},_spaceFunc:function(e,t,l){var i=t||this._hSpace,o=e+i.charAt(0).toUpperCase()+i.substr(1);return this[o](l)}};var i={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 i)i.hasOwnProperty(o)&&(l.fn[o]=l.fn._partial(o));"object"==typeof exports?module.exports=l:e.Color=l}(this),function(e){FLIconSelector={_content:null,_lightbox:null,_rendered:!1,_filterText:"",open:function(e){FLIconSelector._rendered||FLIconSelector._render(),null===FLIconSelector._content?(FLIconSelector._lightbox.open('
    '),FLBuilder.ajax({action:"render_icon_selector"},FLIconSelector._getContentComplete)):FLIconSelector._lightbox.open(),FLIconSelector._lightbox.on("icon-selected",function(t,l){FLIconSelector._lightbox.off("icon-selected"),FLIconSelector._lightbox.close(),e(l)})},_render:function(){FLIconSelector._lightbox=new FLLightbox({className:"fl-icon-selector"}),FLIconSelector._rendered=!0},_getContentComplete:function(t){var l=JSON.parse(t);FLIconSelector._content=l.html,FLIconSelector._lightbox.setContent(l.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(),l=e(".fl-icons-filter-text").val();"all"==t?e(".fl-icons-section").show():(e(".fl-icons-section").hide(),e(".fl-"+t).show()),FLIconSelector._filterText=l,""!==l?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){FLLightbox=function(e){this._init(e),this._render(),this._bind()},FLLightbox.closeParent=function(t){var l=e(t).closest(".fl-lightbox-wrap").attr("data-instance-id");FLLightbox._instances[l].close()},FLLightbox._instances={},FLLightbox.prototype={_id:null,_node:null,_visible:!1,_resizeTimer:null,_draggable:!1,_defaults:{className:"",destroyOnClose:!1},open:function(e){this._node.find(".fl-lightbox").attr("style",""),this._node.show(),this._visible=!0,"undefined"!=typeof e?this.setContent(e):this._resize(),this.trigger("open")},close:function(){"undefined"!=typeof tinymce&&"undefined"!=typeof tinymce.EditorManager.activeEditor&&null!=tinymce.EditorManager.activeEditor&&tinymce.EditorManager.activeEditor.hide(),this._node.hide(),this._visible=!1,this.trigger("close"),this._defaults.destroyOnClose&&this.destroy()},setContent:function(e){this._node.find(".fl-lightbox-content").html(e),this._resize()},empty:function(){this._node.find(".fl-lightbox-content").empty(),this._node.find(".fl-lightbox").removeClass("fl-lightbox-expanded")},on:function(e,t){this._node.on(e,t)},off:function(e){this._node.off(e)},trigger:function(e,t){this._node.trigger(e,t)},draggable:function(e){var t=this._node.find(".fl-lightbox-mask"),l=this._node.find(".fl-lightbox");e="undefined"!=typeof e&&e,this._draggable&&l.draggable("destroy"),e?(this._unbind(),this._draggable=!0,t.hide(),l.draggable({cursor:"move",handle:e.handle||""})):(t.show(),this._bind(),this._draggable=!1),this._resize()},destroy:function(){e(window).off("resize.fl-lightbox-"+this._id),this._node.empty(),this._node.remove(),FLLightbox._instances[this._id]="undefined";try{delete FLLightbox._instances[this._id]}catch(t){}},renderResize:function(t){if("undefined"!=typeof t){var l=this._getActiveNode();if(lightbox=l.find(".fl-lightbox"),boxFields=lightbox.find(".fl-builder-settings-fields"),win=e(window),winHeight=win.height(),winWidth=win.width(),boxHeaderHeight=lightbox.find(".fl-lightbox-header").height(),boxTabsHeight=lightbox.find(".fl-builder-settings-tabs").height(),boxFooterHeight=lightbox.find(".fl-lightbox-footer").height(),boxFieldHeight=winHeight-(boxHeaderHeight+boxTabsHeight+boxFooterHeight+103),editor="undefined"!=typeof tinymce&&tinymce.EditorManager.activeEditor?tinymce:null,editorId=editor?editor.EditorManager.activeEditor.id:"flhiddeneditor",editorIframeEl=lightbox.find("#"+editorId+"_ifr"),editorTextarea=lightbox.find("#"+editorId),codeField=lightbox.find(".fl-code-field .ace_editor"),"expand"==t||"window_resize"==t){if("window_resize"==t&&!lightbox.hasClass("fl-lightbox-expanded"))return!1;boxFields.css("height",boxFieldHeight+"px"),"expand"==t&&(lightbox.addClass("fl-.com/cnubetter/style/global/js/common.js">