"use strict";(self.webpackChunkelementorFrontend=self.webpackChunkelementorFrontend||[]).push([[768],{3323:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(5724),n(4846),n(6211),n(9655);class GridContainer extends elementorModules.frontend.handlers.Base{static cacheByValues=new Map;static isDeviceModeListenerBound=!1;static bindDeviceModeListener(){GridContainer.isDeviceModeListenerBound||(GridContainer.isDeviceModeListenerBound=!0,elementor.channels.deviceMode.on("change",()=>{GridContainer.clearCache()}))}static clearCache(){GridContainer.cacheByValues.clear()}static isGridLayoutReady(e){return e.elements?.container?.classList.contains("e-grid")}static hasValidGridDimensions(e){return e?.rows?.length>0&&e?.columns?.length>0}static isDimensionsEntryCacheable(e,t){return GridContainer.isGridLayoutReady(e)&&GridContainer.hasValidGridDimensions(t.dimensions)}static buildCalculationKey(e){const t=elementor.channels.deviceMode.request("currentMode"),n=e.getElementSettings(),{grid_auto_flow:i}=n,s=elementorFrontend.utils.controls.getResponsiveControlValue(n,"grid_rows_grid","size",t),r=elementorFrontend.utils.controls.getResponsiveControlValue(n,"grid_columns_grid","size",t),o=[t,i,s,elementorFrontend.utils.controls.getResponsiveControlValue(n,"grid_rows_grid","unit",t),r,elementorFrontend.utils.controls.getResponsiveControlValue(n,"grid_columns_grid","unit",t)],{outlineParentContainer:l}=e.elements;if(l){const t=e.getComputedStyle(l,"grid-template-columns"),n=e.getComputedStyle(l,"grid-template-rows");o.push(t?.trim()??"",n?.trim()??"")}return o.join("|")}static buildOutlineCacheKey(e,t){return e+"|children:"+t}static computeMaxElementsNumber(e,t){const n=e.getElementSettings(),i=elementor.channels.deviceMode.request("currentMode"),{grid_auto_flow:s}=n;if("row"===s){const e=elementorFrontend.utils.controls.getResponsiveControlValue(n,"grid_rows_grid","size",i),s=isNaN(e)?String(e).split(" ").length:e;return t.columns.length*s}const r=elementorFrontend.utils.controls.getResponsiveControlValue(n,"grid_columns_grid","size",i),o=isNaN(r)?String(r).split(" ").length:r;return t.rows.length*o}static computeDimensionsCache(e){const t=elementor.channels.deviceMode.request("currentMode"),n={rows:e.getControlValues("grid_rows_grid",t,"grid-template-rows")||1,columns:e.getControlValues("grid_columns_grid",t,"grid-template-columns")||1};return{dimensions:n,maxElementsNumber:GridContainer.computeMaxElementsNumber(e,n)}}static getDimensionsCache(e){const t=GridContainer.buildCalculationKey(e),n=GridContainer.cacheByValues.get(t);if(n?.dimensions)return n;const i=GridContainer.computeDimensionsCache(e);return GridContainer.isDimensionsEntryCacheable(e,i)&&GridContainer.cacheByValues.set(t,i),i}static getCachedMaxOutlineElementsNumber(e,t){const n=GridContainer.buildCalculationKey(e),i=GridContainer.buildOutlineCacheKey(n,t),s=GridContainer.cacheByValues.get(i);if(void 0!==s)return s;const{dimensions:r,maxElementsNumber:o}=GridContainer.getDimensionsCache(e),{grid_auto_flow:l}=e.getElementSettings(),a="row"===l?"columns":"rows",d=Math.ceil(t/r[a].length)*r[a].length,m=o>d?o:d,c={dimensions:r,maxElementsNumber:o};return GridContainer.isDimensionsEntryCacheable(e,c)&&GridContainer.cacheByValues.set(i,m),m}__construct(e){super.__construct(e),this.onDeviceModeChange=this.onDeviceModeChange.bind(this),this.updateEmptyViewHeight=this.updateEmptyViewHeight.bind(this)}isActive(){return elementorFrontend.isEditMode()}getDefaultSettings(){return{selectors:{gridOutline:".e-grid-outline",directGridOverlay:":scope > .e-grid-outline",boxedContainer:":scope > .e-con-inner",emptyView:".elementor-empty-view"},classes:{outline:"e-grid-outline",outlineItem:"e-grid-outline-item",gridItemControls:["_heading_grid_item","_grid_column","_grid_column_custom","_grid_row","_grid_row_custom","heading_grid_item","grid_column","grid_column_custom","grid_row","grid_row_custom"].map(e=>`[class*="elementor-control-${e}"]`).join(", ")}}}getDefaultElements(){const e=this.getSettings("selectors");return{outlineParentContainer:null,gridOutline:this.findElement(e.gridOutline),directChildGridOverlay:this.findElement(e.directGridOverlay),emptyView:this.findElement(e.emptyView)[0],container:this.$element[0]}}onInit(){super.onInit(),this.scheduleInitLayoutOverlay(),this.updateEmptyViewHeight(),elementor.hooks.addAction("panel/open_editor/container",this.onPanelShow)}handleGridControls(e,t){["_section_style","section_layout"].includes(e)&&(this.isItemInGridCell(t)||this.hideGridControls(t))}isItemInGridCell(e){const t=e?.getOption("editedElementView")?.getContainer();return"function"==typeof t?.parent?.model?.getSetting&&"grid"===t?.parent?.model?.getSetting("container_type")}hideGridControls(e){const t=this.getSettings("classes"),n=e?.el.querySelectorAll(t.gridItemControls);n.forEach(e=>{e.style.display="none"})}onPanelShow(e,t){const n=t.get("settings").get("container_type"),i=e.$el.find("#elementor-panel__editor__help__link"),s="grid"===n?"https://go.elementor.com/widget-container-grid":"https://go.elementor.com/widget-container";i&&i.attr("href",s)}bindEvents(){GridContainer.bindDeviceModeListener(),elementor.channels.deviceMode.on("change",this.onDeviceModeChange),elementorFrontend.elements.$window.on("resize",this.onDeviceModeChange),elementorFrontend.elements.$window.on("resize",this.updateEmptyViewHeight),this.addChildLifeCycleEventListeners(),elementor.channels.editor.on("section:activated",this.handleGridControls.bind(this))}onDestroy(){elementorModules.frontend.handlers.Base.prototype.onDestroy.apply(this,arguments)}unbindEvents(){this.removeChildLifeCycleEventListeners(),elementor.channels.deviceMode.off("change",this.onDeviceModeChange),elementorFrontend.elements.$window.off("resize",this.onDeviceModeChange),elementorFrontend.elements.$window.off("resize",this.updateEmptyViewHeight),elementor.channels.editor.off("section:activated",this.handleGridControls.bind(this))}initLayoutOverlay(){this.getCorrectContainer();const e=this.getSettings("selectors");this.elements.emptyView=this.findElement(e.emptyView)[0];"grid"===this.getElementSettings("container_type")&&this.elements?.emptyView&&(this.elements.emptyView.style.display=this.shouldRemoveEmptyView()?"none":"block"),this.updateGridOutline()}updateGridOutline(){if(!this.shouldDrawOutline())return void this.removeExistingOverlay();const e=this.getMaxOutlineElementsNumber(),t=this.getGridOutlineElement();e>0&&t?.isConnected&&t.parentElement===this.elements.outlineParentContainer&&t.childElementCount===e?this.setGridOutlineDimensions():(this.removeExistingOverlay(),this.createOverlayContainer(),this.createOverlayItems())}shouldDrawOutline(){const{grid_outline:e}=this.getElementSettings();return e}getCorrectContainer(){const e=this.elements.container,t=this.getDefaultSettings(),{selectors:{boxedContainer:n}}=t;this.elements.outlineParentContainer=e.querySelector(n)||e}getGridOutlineElement(){const{gridOutline:e}=this.elements;return e?e[0]||e:null}removeExistingOverlay(){this.getGridOutlineElement()?.remove(),this.elements.gridOutline=null}createOverlayContainer(){const{outlineParentContainer:e}=this.elements,{classes:{outline:t}}=this.getDefaultSettings(),n=document.createElement("div");n.classList.add(t),e.appendChild(n),this.elements.gridOutline=n,this.setGridOutlineDimensions()}createOverlayItems(){const{gridOutline:e}=this.elements,{classes:{outlineItem:t}}=this.getDefaultSettings(),n=this.getMaxOutlineElementsNumber(),i=[];for(let e=0;e{this.layoutOverlayAnimationFrame=null,this.initLayoutOverlay()}))}addChildLifeCycleEventListeners(){this.lifecycleChangeListener=this.onChildLifecycleEvent.bind(this),window.addEventListener("elementor/editor/element-rendered",this.lifecycleChangeListener),window.addEventListener("elementor/editor/element-destroyed",this.lifecycleChangeListener)}removeChildLifeCycleEventListeners(){window.removeEventListener("elementor/editor/element-rendered",this.lifecycleChangeListener),window.removeEventListener("elementor/editor/element-destroyed",this.lifecycleChangeListener),this.layoutOverlayAnimationFrame&&(cancelAnimationFrame(this.layoutOverlayAnimationFrame),this.layoutOverlayAnimationFrame=null)}updateEmptyViewHeight(){if(this.shouldUpdateEmptyViewHeight()){const{emptyView:e}=this.elements,t=elementor.channels.deviceMode.request("currentMode"),n=this.getElementSettings(),i="desktop"===t?n.grid_rows_grid:n.grid_rows_grid+"_"+t;e?.style.removeProperty("min-height"),this.hasCustomUnit(i)&&this.isNotOnlyANumber(i)&&this.sizeNotEmpty(i)&&(e.style.minHeight="auto"),e?.offsetHeight<=0&&(e.style.minHeight="100px")}}shouldUpdateEmptyViewHeight(){return!!this.elements.container.querySelector(".elementor-empty-view")}hasCustomUnit(e){return"custom"===e?.unit}sizeNotEmpty(e){return""!==e?.size?.trim()}isNotOnlyANumber(e){return!/^\d+$/.test(e?.size)}shouldRemoveEmptyView(){const e=this.elements.outlineParentContainer.querySelectorAll(":scope > .elementor-element").length;if(0===e)return!1;return this.getMaxElementsNumber()<=e&&this.isFullFilled(e)}isFullFilled(e){const t=GridContainer.getDimensionsCache(this).dimensions,{grid_auto_flow:n}=this.getElementSettings();return 0===e%t["row"===n?"columns":"rows"].length}getMaxOutlineElementsNumber(){const e=this.elements.outlineParentContainer.querySelectorAll(":scope > .elementor-element").length;return GridContainer.getCachedMaxOutlineElementsNumber(this,e)}getMaxElementsNumber(){return GridContainer.getDimensionsCache(this).maxElementsNumber}}t.default=GridContainer},8847:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(4846),n(6211);class Shapes extends elementorModules.frontend.handlers.Base{getDefaultSettings(){return{selectors:{container:"boxed"===this.getElementSettings("content_width")?"> .e-con-inner > .elementor-shape-%s":"> .elementor-shape-%s"},svgURL:elementorFrontend.config.urls.assets+"shapes/"}}getDefaultElements(){const e={},t=this.getSettings("selectors");return e.$topContainer=this.$element.find(t.container.replace("%s","top")),e.$bottomContainer=this.$element.find(t.container.replace("%s","bottom")),e}isActive(){return elementorFrontend.isEditMode()}getSvgURL(e,t){let n=this.getSettings("svgURL")+t+".svg";return elementor.config.additional_shapes&&e in elementor.config.additional_shapes&&(n=elementor.config.additional_shapes[e],-1{i.empty().append(e.childNodes[0])}),this.setNegative(e)}setNegative(e){this.elements["$"+e+"Container"].attr("data-negative",!!this.getElementSettings("shape_divider_"+e+"_negative"))}onInit(...e){this.isActive(this.getSettings())&&(super.onInit(...e),["top","bottom"].forEach(e=>{this.getElementSettings("shape_divider_"+e)&&this.buildSVG(e)}))}onElementChange(e){const t=e.match(/^shape_divider_(top|bottom)$/);if(t)return void this.buildSVG(t[1]);const n=e.match(/^shape_divider_(top|bottom)_negative$/);n&&(this.buildSVG(n[1]),this.setNegative(n[1]))}}t.default=Shapes}}]);