"use strict";(window.webpackChunkdivi_areas_pro=window.webpackChunkdivi_areas_pro||[]).push([[256],{423:function(e,t,i){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},a(e)}function s(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,a=new Array(t);i<t;i++)a[i]=e[i];return a}function n(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,h(a.key),a)}}function o(e,t,i){return(t=h(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h(e){var t=function(e,t){if("object"!==a(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t||"default");if("object"!==a(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===a(t)?t:String(t)}i.r(t);var l=jQuery,d=window.DiviArea,u=d.Core,c=d.Utils,p=d.Debug,f=d.UI,g=d.Data,v={hideclose:!1,showclose:!0,notmobile:!1,onmobile:!0,nottablet:!1,ontablet:!0,notdesktop:!1,ondesktop:!0,closealt:!1,notmodal:!0,ismodal:!1,notblocking:!1,isblocking:!1,triggerexit:!1,shadow:!0,noshadow:!1,darkmode:!1,singleton:!1,static:!1,withloader:!1,pushcontent:!1},_={hideclose:"showclose",notdesktop:"ondesktop",notmobile:"onmobile",notmodal:"ismodal",notblocking:"isblocking",nottablet:"ontablet",shadow:"noshadow",dynamic:"static"},y=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,"$area",void 0),o(this,"_conf",void 0),o(this,"_triggers",{}),o(this,"$areaWrap",null),o(this,"$closeButtonWrapper",null),o(this,"observeArea",null),o(this,"observeWrap",null),o(this,"$replacedElement",null),o(this,"_id",void 0),o(this,"_postId",void 0),o(this,"_hook",void 0),o(this,"_names",void 0),o(this,"_type",void 0),o(this,"_inDom",void 0),o(this,"_isVisible",void 0),o(this,"_isPrepared",void 0),o(this,"_size",void 0),o(this,"_session",void 0),o(this,"_state",void 0),o(this,"_hasFocus",void 0),o(this,"_isTrigger",void 0),l=jQuery,d=window.DiviArea,u=d.Core,c=d.Utils,p=d.Debug,f=d.UI,g=d.Data,this.$area=l(t),this._triggers=new Map,this.refreshArea=this.debounce(this.refreshArea,0),this.debouncedSetPosition=this.debounce(this.setPosition,0),this.debouncedInitTriggers=this.debounce(this._initCoreTriggers,0),this.debouncedResize=this.debounce(this._resizeArea,15),this._id=this.$area.attr("id"),this._hook=c.sanitizeHookName(this._id),this._type=m(i),this._inDom=c.isInDom(this.$area[0]),this._isVisible=this._inDom&&this.$area[0].getClientRects().length>0,this._hasFocus=!1,this._isTrigger=!1,this._postId=null,this._names=[],this._size={},this._isPrepared=!1,this._session=c.getUniqueId(),this._state=g.newAreaState(this),this.debug("Area Type",this.type),this.debug("Area Hook",this.key),this._configure(),f.initializeAreaAnimation(this),this._setupWrap(),this._setupCloseButton(),this._setupJQuery(this.$area),this._setupJQuery(this.$areaWrap),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this._setAttrs(),this._setupHooks(),this._setupObserver(),this._initTracking()}var t,i,r;return t=e,i=[{key:"_configure",value:function(){for(var e in this._conf=new Map(Object.entries({zindex:0,container:"body",hasshowanim:!0,position:"center-center",positionv:"center",positionh:"center",overflow:"clip",size:"auto",animationspeedin:c.getOption("animateSpeed"),animationspeedout:c.getOption("animateSpeed")})),v)void 0!==this.$area.data("da-"+e)?this.setData(c.toBool(this.$area.data("da-"+e))):void 0!==this.$area.data(e)?this.setData(c.toBool(this.$area.data(e))):this.setData(e,v[e]);var t={};for(var i in t[c.getOption("notMobileClass")]=["onmobile",!1],t[c.getOption("notTabletClass")]=["ontablet",!1],t[c.getOption("notDesktopClass")]=["ondesktop",!1],t[c.getOption("noCloseClass")]=["showclose",!1],t[c.getOption("withCloseClass")]=["showclose",!0],t[c.getOption("altCloseClass")]=["closealt",!0],t[c.getOption("modalIndicatorClass")]=["ismodal",!0],t[c.getOption("blockingIndicatorClass")]=["isblocking",!0],t[c.getOption("exitIndicatorClass")]=["triggerexit",!0],t[c.getOption("noShadowClass")]=["noshadow",!0],t[c.getOption("darkModeClass")]=["darkmode",!0],t[c.getOption("singletonClass")]=["singleton",!0],t[c.getOption("withLoaderClass")]=["withloader",!0],t)if(this.$area.hasClass(i)){var a=t[i];this.setData(a[0],a[1])}}},{key:"_setupWrap",value:function(){if(!this.$areaWrap){var e=c.getOption("popupWrapperClass");if(this.$areaWrap=this.$area.parent(),!this.$areaWrap.hasClass(e)){this.$area.wrap("<div>"),this.$areaWrap=this.$area.parent(),this.$areaWrap.addClass(e);var t=this.$area.attr("id"),i=this.getNames(0)||t;i&&(this.$areaWrap.attr("id",i),t===i&&this.$area.removeAttr("id"))}this.$areaWrap.detach().hide().appendTo("body"),this.doAction("area_wrap",this.$areaWrap)}}},{key:"_setupCloseButton",value:function(){if(!this.$closeButtonWrapper){var e=c.getOption("closeButtonClass"),t=e+"-wrap";this.$closeButtonWrapper=l("<span>").addClass(t).appendTo(this.$areaWrap),l("<a>").attr("href","#close").addClass(e).html("&times;").appendTo(this.$closeButtonWrapper),this.$closeButtonWrapper.hide(),this.doAction("area_close_button",this.$closeButtonWrapper)}}},{key:"_setupObserver",value:function(){var e=this;this.observeArea||(this.observeArea=new ResizeObserver((function(){var t=e.$area[0],i=t.scrollHeight-t.clientHeight;i>0&&i-t.scrollTop<1&&(t.scrollTop-=1),e.invalidateSize(!0)})),this.observeWrap=new ResizeObserver((function(){return e.invalidateSize()})),this.$area.on("resize",this.debouncedResize),this.$areaWrap.on("resize",this.debouncedResize))}},{key:"_setupHooks",value:function(){this.addActionOnce("pre_init_area",this._initCoreTriggers),this.addAction("setup_area",this._setTriggerEvent,2),this.addAction("cleanup_area",this._setTriggerEvent)}},{key:"refreshArea",value:function(){this.attached&&this._setAttrs()}},{key:"_setAttrs",value:function(){this.$area.attr("data-da-area",this.id),this.$areaWrap.attr("data-da-area",this.id),this.$areaWrap.attr("data-da-type",this.type),this.$areaWrap.attr("data-da-registered",1),this.$areaWrap.attr("data-da-close-btn",this.getData("showclose")?"yes":"no"),this.$areaWrap.attr("data-da-close-bg",this.getData("closeAlt")?"none":"solid"),this.$areaWrap.attr("data-da-loader",this.getData("withLoader")?"yes":"no"),this.$areaWrap.attr("data-da-shadow",this.getData("shadow")?"yes":"no"),this.$areaWrap.attr("data-da-color",this.getData("darkMode")?"dark":"light"),this.$areaWrap.attr("data-da-overflow",this.getData("overflow")),this.$areaWrap.attr("data-da-size",this.getData("size"));var e=this.getData("wrapClasses");e&&this.$areaWrap.addClass(e),this.debouncedSetPosition(),this.doAction("refresh_area")}},{key:"setPosition",value:function(){var e={},t={};if(!this.visible)return this;if(this.getData("maxheight")&&(e.overflow="auto",e.maxHeight="100%",t.maxHeight=this.getData("maxheight")),this.getData("maxwidth")&&(e.maxWidth="100%",t.maxWidth=this.getData("maxwidth")),t.zIndex=this.getData("zindex"),this.doAction("resize_area"),this.isType("inline")||this.isType("hover"))this.$areaWrap.removeAttr("data-da-position"),this.$areaWrap.removeAttr("data-da-position-h"),this.$areaWrap.removeAttr("data-da-position-v");else{var i=this.getData("positionh"),a=this.getData("positionv"),s=this.getData("size"),r=this.getSize(),n={minX:0,minY:0,maxX:r.windowWidth,maxY:r.windowHeight};if(this.$areaWrap.attr("data-da-position",this.getData("position")),this.$areaWrap.attr("data-da-position-h",i),this.$areaWrap.attr("data-da-position-v",a),this.isType("flyin")&&(n.minY=parseInt(l("html").css("margin-top"))),this.doAction("position_boundary",n),n.minX>n.maxX){var o=n.maxX;n.maxX=n.minX,n.minX=o}if(n.minY>n.maxY){var h=n.maxY;n.maxY=n.minY,n.minY=h}if("full_width"===s||"full_screen"===s)t.left=n.minX,t.right=n.maxX,t.width="auto";else switch(i){case"left":t.left=n.minX;break;case"right":t.right=parseInt(r.windowWidth-n.maxX);break;case"center":t.left=parseInt(n.minX+(n.maxX-n.minX-r.wrapperWidth)/2)}if("full_height"===s||"full_screen"===s)t.top=n.minY,t.bottom=n.maxY,t.height="auto";else if(!this.$areaWrap.attr("data-da-size-full-height"))switch(a){case"top":t.top=n.minY;break;case"bottom":t.bottom=parseInt(r.windowHeight-n.maxY);break;case"center":t.top=parseInt(n.minY+(n.maxY-n.minY-r.wrapperHeight)/2)}this.doAction("position_area",t,e)}return this.$area.css(e),this.$areaWrap.css(t),this}},{key:"_fixAreaDimensions",value:function(){var e=this._getDefinedStyle("width",!1),t=this._getDefinedStyle("max-width",!0);e&&"auto"!==e||(this.isType("popup")||this.$areaWrap.css("width","100%"),this.$area.css("width","100%")),t&&this.$area.css("max-width",t)}},{key:"getSize",value:function(){var e=this.visible;this._size&&void 0!==this._size.width||(this._size={});var t=this.$area[0],i=this.$areaWrap[0];if(this._size.width||(this._size.width=e?t.clientWidth:0),this._size.height||(this._size.height=e?t.clientHeight:0),this._size.contentWidth||(this._size.contentWidth=e?t.scrollWidth:0),!this._size.contentHeight&&(this._size.contentHeight=0,e))if(this.$area.hasClass("et_pb_section")){var a=window.getComputedStyle(t);this._size.contentHeight+=parseInt(a["border-top-width"]),this._size.contentHeight+=parseInt(a["padding-top"]),this._size.contentHeight+=parseInt(a["padding-bottom"]),this._size.contentHeight+=parseInt(a["border-bottom-width"]);for(var s=t.children,r=0;r<s.length;r++)this._size.contentHeight+=s[r].offsetHeight}else this._size.contentHeight=t.scrollHeight;return this._size.wrapperWidth||(this._size.wrapperWidth=e?i.offsetWidth:0),this._size.wrapperHeight||(this._size.wrapperHeight=e?i.offsetHeight:0),this._size.windowWidth||(this._size.windowWidth=window.innerWidth),this._size.windowHeight||(this._size.windowHeight=window.innerHeight),this._size}},{key:"invalidateSize",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?(this._size.width=0,this._size.height=0,this._size.contentWidth=0,this._size.contentHeight=0):(this._size.windowWidth=0,this._size.windowHeight=0,this._size.wrapperWidth=0,this._size.wrapperHeight=0),this.debouncedResize()}},{key:"_resizeArea",value:function(){if(this.visible){var e=this.getSize(),t=[e.width,e.height,e.contentWidth,e.contentHeight,e.windowWidth,e.windowHeight].join("-");if(this._conf.get("_resizeState")!==t){this._conf.set("_resizeState",t),this.$closeButtonWrapper.css({width:e.width,height:e.height});var i=this.isType("popup")||this.isType("flyin"),a=this.getData("overflow"),s=-1===["full_height","full_screen"].indexOf(this.getData("size"));if(i&&"show"!==a&&s){var r="auto"===this.getData("size")?20:0,n=c.getOption("fullHeightClass");this.$areaWrap.attr("data-da-size-full-height")?e.windowHeight-e.contentHeight>r&&(this.$areaWrap.removeAttr("data-da-size-full-height"),this.$areaWrap.removeClass(n)):e.windowHeight-e.contentHeight<r&&(this.$areaWrap.attr("data-da-size-full-height",1),this.$areaWrap.addClass(n))}this.debouncedSetPosition()}}}},{key:"focus",value:function(){if(!this.focused){u.activateContainer(this.$area),this._hasFocus=!0;var e=c.getOption("activePopupClass");this.addClass(e),this.doAction("focus_area")}}},{key:"blur",value:function(){if(this.focused){var e=c.getOption("activePopupClass");this._hasFocus=!1,this.removeClass(e),this.doAction("blur_area")}}},{key:"prepare",value:function(){var e=this;return!!this.prepared||(this._inDom=c.isInDom(this.$area[0]),this._isPrepared=!0,setTimeout((function(){return e.doAction("area_prepared")})),!1)}},{key:"_initCoreTriggers",value:function(){var e=this.getNames(),t=c.getOption("areaPrefix"),i=c.getOption("triggerClassPrefix"),a=c.getOption("idAttrib"),s=c.getOption("hoverTriggerClass"),r=[],n=[],o=function(e){r.push('[href="#'+e+'"]'),r.push('[href="#popup:'+e+'"]'),r.push("."+e),i&&r.push("."+i+e),a&&r.push("["+a+'="'+e+'"]')};o(this.id);for(var h=0;h<e.length;h++){var l=e[h];o(l),t&&o(l.replace(t,""))}for(var d=0;d<r.length;d++)n.push(r[d]+"."+s);this.addTrigger("on-hover","hover",{selector:n}),this.addTrigger("on-click","click",{selector:r}),this.getData("triggerexit")&&this.addTrigger("on-exit","exit"),this.isPro&&this.addTrigger("on-hash","hash")}},{key:"trigger",value:function(e,t,i){var a=this;this.prepare(),this.isPro?this.applyFilters("before_trigger",!1,e,i)||this._checkTriggerConditions(t).then((function(){a.applyFilters("before_trigger_show",!1,e)||(a._isTrigger=!0,a._state.reset(),a._state.setTriggerDetails(i,e,t),a.show(e),a._isTrigger=!1)})).catch((function(e){a.log("Trigger failed",e),a.prepared||a.detach()})):this.show(e)}},{key:"addTrigger",value:function(e,t){var i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=function(){var r=g.createNewTrigger(t,i,a,s);r?(r.id=e,i._triggers.set(r.id,r),r.start(),i.log("Trigger added to Area",r.id)):i.log("Could not create trigger!",t,"Args:",a)};this.removeTrigger(e),this.isPro&&s?d.Pro.checkConditions(this,s).then(r).catch((function(e){i.log("Trigger not added, because condition failed",t,"Reason:",e)})):r()}},{key:"removeTrigger",value:function(e){var t=this._triggers.get(e);t&&(t.stop(),this._triggers.delete(e))}},{key:"getTrigger",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?this._triggers.get(e):Object.fromEntries(this._triggers)}},{key:"_setTriggerEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null!=e&&e.type?this.setData("event",e):this.setData("event",!1)}},{key:"_checkTriggerConditions",value:function(e){var t=this,i=Promise.resolve();return i=(i=i.then((function(){return new Promise((function(e,i){c.showOnViewport(t)?e():i("Area is not available on this device")}))}))).then((function(){return new Promise((function(e,i){d.isClosed(t)?i("Area is still marked as closed"):e()}))})),e&&e.dev&&(i=i.then((function(){return new Promise((function(t,i){c.showOnViewport(e.dev)?t():i("Do not trigger Area on current device")}))}))),i=this.applyFilters("area_trigger_conditions",i)}},{key:"show",value:function(e){this._isTrigger||(this._state.reset(),this._state.setTriggerDetails("api")),this.setData("opencount",this.getData("opencount")+1||1),p.group(this.id,"| Show Area"),this.setData("hasShowAnim",!this.visible),this.doAction("setup_area",e),u.attachArea(this),u.reOrderAreas(),p.group()}},{key:"hide",value:function(){this._state.setCloseDetails("api"),this.setData("hasShowAnim",!0),this.doAction("cleanup_area"),this.setData("event",void 0),this.debug("Close Area and unlink event handlers"),u.detachArea(this),u.reOrderAreas()}},{key:"attach",value:function(){var e=this;if(this.refreshArea(),this.prepare()){if(this.visible)return this}else this._isVisible=!1;this._inDom=!0;var t=this.findHook();return this.$area.hide(),t?("replace"===t.position&&!0===t.target.data("isArea")?(t.target.blur(),t.target.data("area").detach(!1),t=this.findHook()):"before"===t.position&&(t.target=t.target.prev()),t.target.after(this.$areaWrap.detach()),this.$areaWrap.attr("data-inline-pos",t.position),"replace"===t.position&&(this.$replacedElement=t.target.detach())):this.$areaWrap.detach().appendTo(this.getData("container")),this.$areaWrap.closest("#et-boc").length||(this.$areaWrap.wrap('<div id="et-boc" class="dynamic">'),this.$areaWrap.wrap('<div class="et-l dynamic">')),this.debouncedSetPosition(),this.setVisible(!0,(function(){if(e.debug("Prepare Size-Observer and position the Area"),e.observeArea){var t=c.getOption("closeButtonClass")+"-wrap";e.$area.children().each((function(i,a){-1===a.className.indexOf(t)&&e.observeArea.observe(a)})),e.observeArea.observe(e.$area[0]),e.observeWrap.observe(e.$areaWrap[0])}e.debouncedSetPosition(),e.doAction("area_visible"),e.debug("Area.attach() is completed for Area")})),this}},{key:"detach",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.prepared){if(!this.attached)return this}else this.prepare(),this._isVisible=!0;return this.observeArea&&this.observeArea.disconnect(),this.observeWrap&&this.observeWrap.disconnect(),this.setVisible(!1,(function(){e.debug("Remove Area from DOM");var t=e.$areaWrap.parent();e.$replacedElement&&(e.$areaWrap.after(e.$replacedElement),e.$replacedElement=null),e.$area.hide(),e.$areaWrap.detach(),e.$areaWrap.removeAttr("data-inline-pos"),e._inDom=!1,t.hasClass("dynamic")&&!t.children().length&&t.parent().remove(),e.doAction("area_hidden"),e.debug("Area.detach() is completed for Area")}),t),this}},{key:"findHook",value:function(){var e='[data-area-hook="'+this.getData("hookid")+'"]',t=l(e);return!!t.length&&{position:t.data("area-place"),target:t.nextAll(':not([data-area-hook]):not([data-inline-pos="before"]):not([data-inline-pos="after"])').first()}}},{key:"setVisible",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.prepared&&this.visible===e)return this;"function"!=typeof i&&(i=function(e){});var s=function(i,a,s){if(a&&t.prepared)return t.debug("".concat(i," the prepared Area: Trigger animation")),void t._triggerAnimation((function(){t._isVisible===e&&s()}));t.debug("".concat(i," the Area without animation")),s()};return this._isVisible=e,this._setVisibilityEvents(),this.$areaWrap.show(),e?(s("SHOW",a,i),this._fixAreaDimensions(),this.doAction("show_area")):(s("HIDE",a,i),this.doAction("hide_area"),this._session=c.getUniqueId()),this}},{key:"_setVisibilityEvents",value:function(){var e=this,t=c.getOption("triggerCloseClass"),i=c.getOption("closeButtonClass");if(this.visible){this.$area.find("."+i).off(".da");var a=function(t,i){return e.debug("Click on [".concat(i,"] close-button")),e._state.setCloseDetails(i,t),e.doAction("close_area",e,i),t.preventDefault(),!1};this.$areaWrap.find("div ."+t).off(".da").on("click.da",(function(e){return a(e,"custom")})),this.$closeButtonWrapper.find("a").off(".da").on("click.da",(function(e){return a(e,"default")})),l(window).on("resize.da",(function(){return e.invalidateSize()})),this.addAction("close_area",this._handleCloseEvent)}else this.$areaWrap.find("div ."+t).off(".da"),this.$closeButtonWrapper.find("a").off(".da"),l(window).off("resize.da"),this.removeAction("close_area",this._handleCloseEvent)}},{key:"_triggerAnimation",value:function(e){var t=this;if(this.visible){if(this.getData("hasShowAnim"))return this.log("✨ Animate the area (show)"),void f.animateArea(this,"show",(function(){t.getData("showclose")&&(t.debug("Show the default close button"),t.$closeButtonWrapper.show()),e()}))}else if(this.getData("hasShowAnim"))return this.$closeButtonWrapper.hide(),this.log("✨ Animate the area (hide)"),void f.animateArea(this,"hide",e);e()}},{key:"_handleCloseEvent",value:function(e,t){var i=!1;if(this.visible){if(i=this.applyFilters("ignore_close_area",i,this,t))return this.debug("Ignored, manually cancelled in filter"),!0;this._state.setCloseDetails(t),this.hide()}}},{key:"log",value:function(){for(var e,t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];(e=p).info.apply(e,[this.id,"|"].concat(i))}},{key:"debug",value:function(){for(var e,t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];(e=p).debug.apply(e,[this.id,"|"].concat(i))}},{key:"error",value:function(){for(var e,t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];(e=p).error.apply(e,[this.id,"|"].concat(i))}},{key:"hasClass",value:function(e){var t;return(t=this.$area).hasClass.apply(t,arguments)}},{key:"addClass",value:function(e){var t;return(t=this.$area).addClass.apply(t,arguments)}},{key:"removeClass",value:function(e){var t;return(t=this.$area).removeClass.apply(t,arguments)}},{key:"attr",value:function(e){var t;return(t=this.$area).attr.apply(t,arguments)}},{key:"removeAttr",value:function(e){var t;return(t=this.$area).removeAttr.apply(t,arguments)}},{key:"find",value:function(e){var t;return(t=this.$area).find.apply(t,arguments)}},{key:"css",value:function(e){var t;return(t=this.$area).css.apply(t,arguments)}},{key:"on",value:function(e){var t;return(t=this.$area).on.apply(t,arguments)}},{key:"off",value:function(e){var t;return(t=this.$area).off.apply(t,arguments)}},{key:"_setupJQuery",value:function(e){var t=this;e.data("isArea",!0),e.data("area",this),e.getArea=function(){return t},e[0].DiviAreaItem=this}},{key:"get",value:function(e){return e?l(e,this.$area):this.$area}},{key:"getWrap",value:function(){return this.$areaWrap}},{key:"getCloseButton",value:function(){return this.$closeButtonWrapper}},{key:"id",get:function(){return this._id}},{key:"ids",get:function(){return[this.id].concat(s(this._names))}},{key:"postId",get:function(){if(null===this._postId){var e=c.getOption("areaPrefix");if(e&&0===this.id.indexOf(e)){var t=this.id.replace(e,"");isNaN(t)?this._postId="":this._postId=t}else this._postId=""}return this._postId}},{key:"key",get:function(){return this._hook}},{key:"type",get:function(){return this._type}},{key:"attached",get:function(){return this._inDom}},{key:"visible",get:function(){return this.attached&&this._isVisible}},{key:"prepared",get:function(){return this._isPrepared}},{key:"focused",get:function(){return this._hasFocus}},{key:"state",get:function(){return this._state.serialize()}},{key:"session",get:function(){return this._session}},{key:"isPro",get:function(){var e;return!(null===(e=d)||void 0===e||null===(e=e.Pro)||void 0===e||!e.trackEvent)}},{key:"theType",value:function(){return console.warn("Deprecated function. Please use `area.type` instead of `area.theType()`"),this.type}},{key:"theId",value:function(){return console.warn("Deprecated function. Please use `area.id` instead of `area.theId()`"),this.id}},{key:"allIds",value:function(){return console.warn("Deprecated function. Please use `area.ids` instead of `area.allIds()`"),this.ids}},{key:"inDom",value:function(){return console.warn("Deprecated function. Please use `area.attached` instead of `area.inDom()`"),this.attached}},{key:"isVisible",value:function(){return console.warn("Deprecated function. Please use `area.visible` instead of `area.isVisible()`"),this.visible}},{key:"isFocused",value:function(){return console.warn("Deprecated function. Please use `area.focused` instead of `area.isFocused()`"),this.focused}},{key:"addName",value:function(e){if("string"==typeof e)-1===this._names.indexOf(e)&&(this._names.push(e.replace(/^#/,"")),this.prepared&&this.debouncedInitTriggers());else if(Array.isArray(e))for(var t=0;t<e.length;t++)this.addName(e[t])}},{key:"getNames",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;return t>=0?String(null!==(e=this._names[t])&&void 0!==e?e:""):this._names.slice()}},{key:"isType",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!e)return!0;if("string"!=typeof e)throw new Error("DiviAreaItem.isType() expects a string parameter. Given value is a "+a(e));if((e=m(e))===this._type)return!0;if("any"===e||"all"===e)return!0;for(var t=0===e.indexOf("not:"),i=e.replace(/^not:\s*/,"").split(/\s*,\s*/),s=0;s<i.length;s++)if(i[s]===this._type)return!t;return t}},{key:"hasId",value:function(e){if(!e)return!1;var t=c.getOption("areaPrefix");if((e=e.toString().replace(/^#/,""))===this.id)return!0;if(e===this.postId)return!0;for(var i=0;i<this._names.length;i++){if(e===this._names[i])return!0;if(e===this._names[i].replace(t,""))return!0}return!1}},{key:"getData",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(t){t=b(t);var i=_.hasOwnProperty(t);i&&(t=_[t]),this._conf.has(t)?(e=this._conf.get(t),i&&(e=!e)):e=null}else e={},this._conf.forEach((function(t,i){"_"!==i[0]&&(e[i]=t)}));return e}},{key:"setData",value:function(e,t){if(void 0===t)return this;if(e=b(e),v.hasOwnProperty(e))t=c.toBool(t,v[e]),_.hasOwnProperty(e)&&(e=_[e],t=!t);else{var i=null,a=null;switch(e){case"fixzindex":case"zindex":t=parseInt(t);break;case"closedelay":t=parseFloat(t);break;case"position":i=-1!==t.indexOf("top")?"top":-1!==t.indexOf("bottom")?"bottom":"center",a=-1!==t.indexOf("left")?"left":-1!==t.indexOf("right")?"right":"center",t=null;break;case"positionh":["left","right","center"].indexOf(t)<0&&(t=null);break;case"positionv":["top","bottom","center"].indexOf(t)<0&&(t=null);break;case"container":t&&(t=l(t).first()),t&&t.length||(t=l("body"));break;case"attachto":t=!!t&&l(t).first()}null!==a&&this._conf.set("positionh",a),null!==i&&this._conf.set("positionv",i)}switch(null!==t&&this._conf.set(e,t),e){case"positionh":case"positionv":this._conf.set("position",this._conf.get("positionv")+"-"+this._conf.get("positionh"))}return this.refreshArea(),this}},{key:"doAction",value:function(e){for(var t,i=arguments.length,a=new Array(i>1?i-1:0),r=1;r<i;r++)a[r-1]=arguments[r];Array.isArray(a)||(a=[]),a.push(this),(t=DiviArea).doAction.apply(t,[[e,e+"_"+this.key]].concat(s(a)))}},{key:"applyFilters",value:function(e,t){for(var i,a=arguments.length,r=new Array(a>2?a-2:0),n=2;n<a;n++)r[n-2]=arguments[n];return Array.isArray(r)||(r=[]),r.push(this),(i=DiviArea).applyFilters.apply(i,[[e,e+"_"+this.key],t].concat(s(r)))}},{key:"addFilter",value:function(e,t,i){DiviArea.addFilter(e+"_"+this.key,t,i,this)}},{key:"addAction",value:function(e,t,i){DiviArea.addAction(e+"_"+this.key,t,i,this)}},{key:"removeFilter",value:function(e,t){DiviArea.removeFilter(e+"_"+this.key,t)}},{key:"removeAction",value:function(e,t){DiviArea.removeAction(e+"_"+this.key,t)}},{key:"addActionOnce",value:function(e,t,i){DiviArea.addActionOnce(e+"_"+this.key,t,i,this)}},{key:"_initTracking",value:function(){this.isPro&&(this.getData("static")||this.applyFilters("disable_tracking",this.getData("disable_tracking"))||d.Pro.initTracking(this))}},{key:"trackEvent",value:function(e,t){this.isPro&&d.Pro.trackEvent(this,e,t)}},{key:"debounce",value:function(e,t){var i;return function(){for(var a=this,s=arguments.length,r=new Array(s),n=0;n<s;n++)r[n]=arguments[n];clearTimeout(i),i=setTimeout((function(){clearTimeout(i),e.apply(a,r)}),t)}}},{key:"_getDefinedStyle",value:function(e,t){var i,a="";if(t||""===(a=c.getStyleDef(this.$areaWrap[0],e))&&(a=c.getStyleDef(this.$area[0],e)),""===a){var s=this.$areaWrap.find(".et_pb_section");for(i=0;i<s.length&&!a;i++)a=c.getStyleDef(s[i],e,['[class*="et_pb_section_dap_"]'])}return a}}],i&&n(t.prototype,i),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function m(e){return e.toLowerCase().trim().replace(/-/g,"")}function b(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}window.DiviAreaItem=y,t.default=y}}]);