/*
 * TO CHANGE MODULE, JUST CHANGE VAR NAME AT LINE 61 
 * PLUS eventual JS actions on line 202
 */


!function(e) {
    var t = {};

    function r(o) {
        if (t[o]) return t[o].exports;
        var n = t[o] = {
            i: o,
            l: !1,
            exports: {}
        };
        return e[o].call(n.exports, n, n.exports, r), n.l = !0, n.exports
    }
    r.m = e, r.c = t, r.d = function(e, t, o) {
        r.o(e, t) || Object.defineProperty(e, t, {
            configurable: !1,
            enumerable: !0,
            get: o
        })
    }, r.n = function(e) {
        var t = e && e.__esModule ? function() {
            return e.default
        } : function() {
            return e
        };
        return r.d(t, "a", t), t
    }, r.o = function(e, t) {
        return Object.prototype.hasOwnProperty.call(e, t)
    }, r.p = "/", r(r.s = 1)
}([function(e, t) {}, function(e, t, r) {
    r(2), e.exports = r(3)
}, function(e, t, r) {
    "use strict"
}, function(e, t, r) {
    "use strict";
    Object.defineProperty(t, "__esModule", {
        value: !0
    });
    var o = r(4),
        n = r.n(o),
        c = r(5);
    n()(window).on("et_builder_api_ready", function(e, t) {
        t.registerModules(c.a)
    })
}, function(e, t) {
    e.exports = jQuery
}, function(e, t, r) {
    "use strict";
    var o = r(6);
    t.a = [o.a]
}, function(e, t, r) {
    "use strict";
    
    
    /*************************************/
    const module_js_vars= gg_slider_divi_vars;
    const module_slug   = module_js_vars.slug; 
    /*************************************/

    var o = r(7),
        n = r.n(o),
        c = r(0);
    r.n(c);
    

    function a(e) {
        return (a = "function" === typeof Symbol && "symbol" === typeof Symbol.iterator ? function(e) {
            return typeof e
        } : function(e) {
            return e && "function" === typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        })(e)
    }

    function s(e, t) {
        return !t || "object" !== a(t) && "function" !== typeof t ? function(e) {
            if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return e
        }(e) : t
    }

    function i(e, t) {
        for (var r = 0; r < t.length; r++) {
            var o = t[r];
            o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
        }
    }

    function l(e, t, r) {
        return t && i(e.prototype, t), r && i(e, r), e
    }
    
    
    var u = function(e) {
        function t(e) {
            var r;
            return function(e, t) {
                if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
            }(this, t), (r = s(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))).state = {
                isLoaded: !1,
                title: null,
                html: null,
                code: module_js_vars.default_display, 
            }, r
        }
        
        
        var get_useful_props = function(props) {
            var to_keep = module_js_vars.field_indexes; 
            var useful_props = {};
            
            jQuery.each(to_keep, function(i, tk) {
                if(typeof( props[tk] ) != 'undefined') {
                    useful_props[tk] = props[tk];    
                }
            });
            return useful_props;
        }
        
        
        var get_shortcode = function($this, props) {
            if(
                typeof(window.lcwp_divi_antiloop_props) != 'undefined' && 
                typeof(window.lcwp_divi_antiloop_props[module_slug]) != 'undefined' && 
                window.lcwp_divi_antiloop_props[module_slug] == JSON.stringify(get_useful_props(props))
            ) {
                return true;    
            }
                
            // setup react antiloop global var
            if(typeof(window.lcwp_divi_antiloop_props) == 'undefined') {
                window.lcwp_divi_antiloop_props = {};             
            }
            window.lcwp_divi_antiloop_props[module_slug] = JSON.stringify(get_useful_props(props));

            // setup global var to abort ajax calls in case of sequential changes
            if(typeof(window.lcwp_divi_ajax_instances) == 'undefined') {
                window.lcwp_divi_ajax_instances = {};             
            }
            if(typeof(window.lcwp_divi_ajax_instances[module_slug]) != 'undefined' && window.lcwp_divi_ajax_instances[module_slug]) {
                window.lcwp_divi_ajax_instances[module_slug].abort();    
            }
            
            window.lcwp_divi_ajax_instances[module_slug] = jQuery.post(
                module_js_vars.ajax_url, 
                {
                    action  : module_slug +'_for_divi',
                    module  : module_slug,
                    params  : get_useful_props(props),    
                },
                function(response) {
                    $this.setState({code : response});
                }
            )
            .fail(function(e, x, errorMessage) {
                if(e.status) {
                    'Error: '+ $this.setState({code : errorMessage.toString()});
                }
            });
        };
        
        
        return function(e, t) {
            if ("function" !== typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
            e.prototype = Object.create(t && t.prototype, {
                constructor: {
                    value: e,
                    enumerable: !1,
                    writable: !0,
                    configurable: !0
                }
            }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
        }(t, o["Component"]), l(t, null, [{
            key: "css",
            value: function(e) {}
        }]), l(t, [{
            key: "componentDidMount",
            value: function() {
                get_shortcode(this, this.props);
            }
        }, {
            key: "componentDidUpdate",
            value: function() {
                get_shortcode(this, this.props);
            }
        }, {
            key: "render",
            value: function() {
                const props = {
                    dangerouslySetInnerHTML: {
                        __html: this.state.code,
                    },
                };
                
                
                // JS actions once rendered
                setTimeout(function() {
                    jQuery(window).trigger('lc_rendered_on_divi', [module_slug]);
                    
                    jQuery('.gg_lcms_slider:not(.lc_divi_js_init)').each(function() {
                        var id = jQuery(this).attr('id');
                        jQuery(this).addClass('lc_divi_js_init');

                        gg_lcms_init('#'+id);
                    });
                }, 100);
                
                
                return React.createElement('div', props);
            }
        }]), t
    }();
    
    
    Object.defineProperty(u, "slug", {
        configurable: !0,
        enumerable: !0,
        writable: !0,
        value: module_slug
    }), t.a = u
}, function(e, t) {
    e.exports = (typeof(React) == 'undefined') ? false : React;
}]);