PluginProbe
Elementor Website Builder – more than just a page builder / 3.35.0-dev4
Elementor Website Builder – more than just a page builder v3.35.0-dev4
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
← All changes | assets/js/editor-one-menu.min.js +1 -1 4.3.0 → 3.35.0-dev4 View file →
@@ -1 +1 @@
1 -(function(){function _classCallCheck(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function _typeof(e){"@babel/helpers - typeof";return _typeof=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},_typeof(e)}function toPrimitive(e,t){if(_typeof(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_typeof(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function toPropertyKey(e){var t=toPrimitive(e,`string`);return _typeof(t)==`symbol`?t:t+``}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var e=function(){function FlyoutMenuRenderer(e){_classCallCheck(this,FlyoutMenuRenderer),this.config=e}return _createClass(FlyoutMenuRenderer,[{key:`render`,value:function render(){var e=this.config.editorFlyout;if(!e||!e.items||!e.items.length)return!1;var t=this.findEditorInMenu(`#toplevel_page_elementor-home`);if(!t)return!1;t.classList.add(`elementor-has-flyout`);var n=document.createElement(`ul`);return n.className=`elementor-submenu-flyout elementor-level-3`,e.items.forEach(function(e){if(e.has_divider_before){var t=document.createElement(`li`);t.className=`elementor-flyout-divider`,t.setAttribute(`role`,`separator`),n.appendChild(t)}var r=document.createElement(`li`);r.setAttribute(`data-group-id`,e.group_id||``),r.setAttribute(`data-slug`,e.slug||``);var i=document.createElement(`a`);i.href=e.url,i.textContent=e.label,r.appendChild(i),n.appendChild(r)}),t.appendChild(n),!0}},{key:`findEditorInMenu`,value:function findEditorInMenu(e){var t=document.querySelector(e);if(!t)return null;var n=t.querySelector(`.wp-submenu`);if(!n)return null;var r=n.querySelector(`a[href$="page=elementor"]`);return r?r.closest(`li`):null}}])}(),t=function(){function SidebarMenuHandler(){_classCallCheck(this,SidebarMenuHandler),this.elementorHomeMenu=this.findElementorHomeMenu(),this.elementorHomeMenu&&(this.deactivateOtherMenus(),this.activateElementorMenu(),this.highlightSubmenu())}return _createClass(SidebarMenuHandler,[{key:`findElementorHomeMenu`,value:function findElementorHomeMenu(){return document.querySelector(`#toplevel_page_elementor-home`)}},{key:`deactivateOtherMenus`,value:function deactivateOtherMenus(){var e=this;document.querySelectorAll(`#adminmenu li.wp-has-current-submenu`).forEach(function(t){if(t!==e.elementorHomeMenu){t.classList.remove(`wp-has-current-submenu`,`wp-menu-open`,`selected`),t.classList.add(`wp-not-current-submenu`);var n=t.querySelector(`:scope > a`);n&&n.classList.remove(`wp-has-current-submenu`,`wp-menu-open`,`current`)}})}},{key:`activateElementorMenu`,value:function activateElementorMenu(){this.elementorHomeMenu.classList.remove(`wp-not-current-submenu`),this.elementorHomeMenu.classList.add(`wp-has-current-submenu`,`wp-menu-open`,`selected`);var e=this.elementorHomeMenu.querySelector(`:scope > a.menu-top`);e&&e.classList.add(`wp-has-current-submenu`,`wp-menu-open`)}},{key:`highlightSubmenu`,value:function highlightSubmenu(){var e=new URL(window.location.href).searchParams.get(`page`),t=`elementor`;e===`elementor`||e===`elementor-home`?t=`elementor`:e===`e-form-submissions`?t=`e-form-submissions`:e===`elementor-mcp`?t=`elementor-mcp`:e===`elementor-theme-builder`&&(t=`elementor-theme-builder`),this.elementorHomeMenu.querySelectorAll(`.wp-submenu li`).forEach(function(e){var n=e.querySelector(`a`);n&&(e.classList.remove(`current`),n.classList.remove(`current`),n.setAttribute(`aria-current`,``),new URL(n.href,window.location.origin).searchParams.get(`page`)===t&&(e.classList.add(`current`),n.classList.add(`current`),n.setAttribute(`aria-current`,`page`)))})}}])}();function _defineProperty(e,t,n){return(t=toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var n=function(){function EditorOneEventManager(){_classCallCheck(this,EditorOneEventManager)}return _createClass(EditorOneEventManager,null,[{key:`getEventsManager`,value:function getEventsManager(){var e;return(e=elementorCommon)==null?void 0:e.eventsManager}},{key:`getConfig`,value:function getConfig(){var e;return(e=this.getEventsManager())==null?void 0:e.config}},{key:`canSendEvents`,value:function canSendEvents(){var e;return((e=elementorCommon)==null||(e=e.config)==null||(e=e.editor_events)==null?void 0:e.can_send_events)||!1}},{key:`isEventsManagerAvailable`,value:function isEventsManagerAvailable(){var e=this.getEventsManager();return e&&typeof e.dispatchEvent==`function`}},{key:`dispatchEvent`,value:function dispatchEvent(e,t){try{return!this.isEventsManagerAvailable()||!this.canSendEvents()?!1:(this.getEventsManager().dispatchEvent(e,t),!0)}catch(e){return!1}}},{key:`toLowerSnake`,value:function toLowerSnake(e){return!e||typeof e!=`string`?e:e.replace(/\s+/g,`_`).toLowerCase()}},{key:`decodeHtmlEntities`,value:function decodeHtmlEntities(e){return!e||typeof e!=`string`?e:new DOMParser().parseFromString(e,`text/html`).body.textContent||e}},{key:`isInEditorContext`,value:function isInEditorContext(){var e;return window.elementor!==void 0&&!!((e=window.elementor)!=null&&e.documents)}},{key:`getFinderContext`,value:function getFinderContext(){var e,t,n,r,i=this.getConfig(),a=this.isInEditorContext();return{windowName:a?i==null||(e=i.appTypes)==null?void 0:e.editor:i==null||(t=i.appTypes)==null?void 0:t.wpAdmin,targetLocation:this.toLowerSnake(a?i==null||(n=i.locations)==null?void 0:n.topBar:i==null||(r=i.locations)==null?void 0:r.sidebar)}}},{key:`createBasePayload`,value:function createBasePayload(){var e,t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this.getConfig();return _objectSpread({window_name:(e=r==null||(t=r.appTypes)==null?void 0:t.editor)==null?`editor`:e},n)}},{key:`sendTopBarPublishDropdown`,value:function sendTopBarPublishDropdown(e){var t,n,r,i,a,o,s,c=this.getConfig();return this.dispatchEvent(c==null||(t=c.names)==null||(t=t.editorOne)==null?void 0:t.topBarPublishDropdown,this.createBasePayload({interaction_type:this.toLowerSnake(c==null||(n=c.triggers)==null?void 0:n.click),target_type:c==null||(r=c.targetTypes)==null?void 0:r.dropdownItem,target_name:e,interaction_result:c==null||(i=c.interactionResults)==null?void 0:i.actionSelected,target_location:this.toLowerSnake(c==null||(a=c.locations)==null?void 0:a.topBar),location_l1:this.toLowerSnake(c==null||(o=c.secondaryLocations)==null?void 0:o.publishDropdown),location_l2:c==null||(s=c.targetTypes)==null?void 0:s.dropdownItem,interaction_description:`User selected an action from the publish dropdown`}))}},{key:`sendTopBarPageList`,value:function sendTopBarPageList(e){var t,n,r,i,a,o,s,c,l=arguments.length>1&&arguments[1]!==void 0&&arguments[1],u=this.getConfig();return this.dispatchEvent(u==null||(t=u.names)==null||(t=t.editorOne)==null?void 0:t.topBarPageList,this.createBasePayload({interaction_type:this.toLowerSnake(u==null||(n=u.triggers)==null?void 0:n.click),target_type:u==null||(r=u.targetTypes)==null?void 0:r.dropdownItem,target_name:e,interaction_result:l?u==null||(i=u.interactionResults)==null?void 0:i.create:u==null||(a=u.interactionResults)==null?void 0:a.navigate,target_location:this.toLowerSnake(u==null||(o=u.locations)==null?void 0:o.topBar),location_l1:this.toLowerSnake(u==null||(s=u.secondaryLocations)==null?void 0:s.pageListDropdown),location_l2:u==null||(c=u.targetTypes)==null?void 0:c.dropdownItem,interaction_description:`User selected an action from the page list dropdown`}))}},{key:`sendSiteSettingsSession`,value:function sendSiteSettingsSession(e){var t,n,r,i,a,o=e.targetType,s=e.visitedItems,c=s===void 0?[]:s,l=e.savedItems,u=l===void 0?[]:l,d=e.state,f=this.getConfig();return this.dispatchEvent(f==null||(t=f.names)==null||(t=t.editorOne)==null?void 0:t.siteSettingsSession,this.createBasePayload({interaction_type:this.toLowerSnake(f==null||(n=f.triggers)==null?void 0:n.click),target_type:o,target_name:`site_settings`,interaction_result:f==null||(r=f.interactionResults)==null?void 0:r.sessionEnd,target_location:this.toLowerSnake(f==null||(i=f.locations)==null?void 0:i.leftPanel),location_l1:this.toLowerSnake(f==null||(a=f.secondaryLocations)==null?void 0:a.siteSettings),interaction_description:`Records areas visited as part of the site setting session`,metadata:{visited_items:c,saved_items:u},state:d}))}},{key:`sendELibraryNav`,value:function sendELibraryNav(e){var t,n,r,i,a,o,s=this.getConfig();return this.dispatchEvent(s==null||(t=s.names)==null||(t=t.editorOne)==null?void 0:t.eLibraryNav,this.createBasePayload({interaction_type:this.toLowerSnake(s==null||(n=s.triggers)==null?void 0:n.tabSelect),target_type:s==null||(r=s.targetTypes)==null?void 0:r.tab,target_name:this.toLowerSnake(e),interaction_result:s==null||(i=s.interactionResults)==null?void 0:i.tabChanged,target_location:this.toLowerSnake(s==null||(a=s.locations)==null?void 0:a.elementorLibrary),location_l1:this.toLowerSnake(s==null||(o=s.secondaryLocations)==null?void 0:o.libraryTabs),interaction_description:`User navigates within elementor library`}))}},{key:`sendELibraryInsert`,value:function sendELibraryInsert(e){var t,n,r,i,a,o,s=e.assetId,c=e.assetName,l=e.libraryType,u=e.proRequired,d=u!==void 0&&u,f=this.getConfig(),p=this.createBasePayload({interaction_type:this.toLowerSnake(f==null||(t=f.triggers)==null?void 0:t.insert),target_type:f==null||(n=f.targetTypes)==null?void 0:n.button,target_name:String(s),interaction_result:f==null||(r=f.interactionResults)==null?void 0:r.assetInserted,target_location:this.toLowerSnake(f==null||(i=f.locations)==null?void 0:i.elementorLibrary),location_l1:this.toLowerSnake(l),location_l2:this.toLowerSnake(f==null||(a=f.secondaryLocations)==null?void 0:a.assetCard),interaction_description:`User inserts block/pages from elementor library`,metadata:{template_id:String(s),template_name:this.decodeHtmlEntities(c)||``}});return d&&(p.state=`pro_plan_required`),this.dispatchEvent(f==null||(o=f.names)==null||(o=o.editorOne)==null?void 0:o.eLibraryInsert,p)}},{key:`sendELibraryFavorite`,value:function sendELibraryFavorite(e){var t,n,r,i,a,o,s=e.assetId,c=e.assetName,l=e.libraryType,u=e.isFavorite,d=e.proRequired,f=d!==void 0&&d,p=this.getConfig(),m=this.createBasePayload({interaction_type:this.toLowerSnake(p==null||(t=p.triggers)==null?void 0:t.click),target_type:p==null||(n=p.targetTypes)==null?void 0:n.toggle,target_name:String(s),interaction_result:p==null||(r=p.interactionResults)==null?void 0:r.assetFavorite,target_value:!!u,target_location:this.toLowerSnake(p==null||(i=p.locations)==null?void 0:i.elementorLibrary),location_l1:this.toLowerSnake(l),location_l2:this.toLowerSnake(p==null||(a=p.secondaryLocations)==null?void 0:a.assetCard),interaction_description:`User favorite block/pages from elementor library`,metadata:{template_id:String(s),template_name:this.decodeHtmlEntities(c)||``}});return f&&(m.state=`pro_plan_required`),this.dispatchEvent(p==null||(o=p.names)==null||(o=o.editorOne)==null?void 0:o.eLibraryFavorite,m)}},{key:`sendELibraryGenerateAi`,value:function sendELibraryGenerateAi(e){var t,n,r,i,a,o,s=e.assetId,c=e.assetName,l=e.libraryType,u=this.getConfig();return this.dispatchEvent(u==null||(t=u.names)==null||(t=t.editorOne)==null?void 0:t.eLibraryGenerateAi,this.createBasePayload({interaction_type:this.toLowerSnake(u==null||(n=u.triggers)==null?void 0:n.click),target_type:u==null||(r=u.targetTypes)==null?void 0:r.button,target_name:String(s),interaction_result:u==null||(i=u.interactionResults)==null?void 0:i.aiGenerate,target_location:this.toLowerSnake(u==null||(a=u.locations)==null?void 0:a.elementorLibrary),location_l1:this.toLowerSnake(l),location_l2:this.toLowerSnake(u==null||(o=u.secondaryLocations)==null?void 0:o.assetCard),interaction_description:`User generated block/page based on a library asset`,metadata:{template_id:String(s),template_name:this.decodeHtmlEntities(c)||``}}))}},{key:`sendFinderSearchInput`,value:function sendFinderSearchInput(e){var t,n,r,i,a,o,s=e.resultsCount,c=e.searchTerm,l=c===void 0?null:c,u=this.getConfig(),d=s>0,f=this.getFinderContext(),p=this.createBasePayload({window_name:f.windowName,interaction_type:this.toLowerSnake(u==null||(t=u.triggers)==null?void 0:t.typing),target_type:u==null||(n=u.targetTypes)==null?void 0:n.searchInput,target_name:`finder`,interaction_result:d?u==null||(r=u.interactionResults)==null?void 0:r.resultsUpdated:u==null||(i=u.interactionResults)==null?void 0:i.noResults,target_location:f.targetLocation,location_l1:this.toLowerSnake(u==null||(a=u.secondaryLocations)==null?void 0:a.finder),interaction_description:`Finder search input, follows debounce behavior`,metadata:{results_count:s}});return!d&&l&&(p.metadata.search_term=l),this.dispatchEvent(u==null||(o=u.names)==null||(o=o.editorOne)==null?void 0:o.finderSearchInput,p)}},{key:`sendFinderResultSelect`,value:function sendFinderResultSelect(e){var t,n,r,i,a,o,s=this.getConfig(),c=this.getFinderContext();return this.dispatchEvent(s==null||(t=s.names)==null||(t=t.editorOne)==null?void 0:t.finderResultSelect,this.createBasePayload({window_name:c.windowName,interaction_type:this.toLowerSnake(s==null||(n=s.triggers)==null?void 0:n.click),target_type:s==null||(r=s.targetTypes)==null?void 0:r.searchResult,target_name:e,interaction_result:s==null||(i=s.interactionResults)==null?void 0:i.selected,target_location:c.targetLocation,location_l1:this.toLowerSnake(s==null||(a=s.secondaryLocations)==null?void 0:a.finder),location_l2:this.toLowerSnake(s==null||(o=s.secondaryLocations)==null?void 0:o.finderResults),interaction_description:`Finder search results was selected`}))}},{key:`sendCanvasEmptyBoxAction`,value:function sendCanvasEmptyBoxAction(e){var t,n,r,i,a,o,s=e.targetName,c=e.metadata,l=c===void 0?{}:c,u=e.containerCreated,d=u===void 0?null:u,f=this.getConfig(),p=this.createBasePayload({interaction_type:this.toLowerSnake(f==null||(t=f.triggers)==null?void 0:t.click),target_type:f==null||(n=f.targetTypes)==null?void 0:n.buttons,target_name:s,interaction_result:f==null||(r=f.interactionResults)==null?void 0:r.selected,target_location:this.toLowerSnake(f==null||(i=f.locations)==null?void 0:i.canvas),location_l1:this.toLowerSnake(f==null||(a=f.secondaryLocations)==null?void 0:a.emptyBox),interaction_description:`Empty box on canvas actions`});return Object.keys(l).length>0&&(p.metadata=l),d!==null&&(p.state=d),this.dispatchEvent(f==null||(o=f.names)==null||(o=o.editorOne)==null?void 0:o.canvasEmptyBoxAction,p)}},{key:`sendWidgetPanelSearch`,value:function sendWidgetPanelSearch(e){var t,n,r,i,a,o,s,c,l=e.resultsCount,u=e.userInput,d=u===void 0?null:u,f=this.getConfig(),p=l>0,m=this.createBasePayload({interaction_type:this.toLowerSnake(f==null||(t=f.triggers)==null?void 0:t.typing),target_type:f==null||(n=f.targetTypes)==null?void 0:n.searchWidget,target_name:`search_widget`,interaction_result:p?f==null||(r=f.interactionResults)==null?void 0:r.resultsUpdated:f==null||(i=f.interactionResults)==null?void 0:i.noResults,target_location:this.toLowerSnake(f==null||(a=f.locations)==null?void 0:a.leftPanel),location_l1:this.toLowerSnake(f==null||(o=f.locations)==null?void 0:o.widgetPanel),location_l2:this.toLowerSnake(f==null||(s=f.secondaryLocations)==null?void 0:s.searchBar),interaction_description:`Widget search input, follows debounce behavior`});return!p&&d&&(m.metadata={user_input:d}),this.dispatchEvent(f==null||(c=f.names)==null||(c=c.editorOne)==null?void 0:c.widgetPanelSearch,m)}},{key:`createWpDashPayload`,value:function createWpDashPayload(){var e,t,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=this.getConfig();return this.createBasePayload(_objectSpread({window_name:(e=i==null||(t=i.appTypes)==null?void 0:t.wpDash)==null?`wpdash`:e,target_location:this.toLowerSnake(i==null||(n=i.locations)==null?void 0:n.wpDashAdmin),location_l2:``},r))}},{key:`sendWpDashElementorMenuClick`,value:function sendWpDashElementorMenuClick(){var e,t,n,r,i,a=this.getConfig();return this.dispatchEvent(a==null||(e=a.names)==null||(e=e.editorOne)==null?void 0:e.wpDashElementorMenuClick,this.createWpDashPayload({interaction_type:this.toLowerSnake(a==null||(t=a.triggers)==null?void 0:t.click),target_type:a==null||(n=a.targetTypes)==null?void 0:n.wpDashAdminMenuItem,target_name:`elementor_menu_item`,interaction_result:a==null||(r=a.interactionResults)==null?void 0:r.elementorSideMenuOpened,location_l1:this.toLowerSnake(a==null||(i=a.secondaryLocations)==null?void 0:i.wpDashElementorCoreMenu),interaction_description:`core_user_clicked_elementor_menu_item`}))}},{key:`sendWpDashEditorSubMenuHover`,value:function sendWpDashEditorSubMenuHover(){var e,t,n,r,i,a=this.getConfig();return this.dispatchEvent(a==null||(e=a.names)==null||(e=e.editorOne)==null?void 0:e.wpDashEditorSubMenuHover,this.createWpDashPayload({interaction_type:this.toLowerSnake(a==null||(t=a.triggers)==null?void 0:t.hover),target_type:a==null||(n=a.targetTypes)==null?void 0:n.wpDashEditorMenu,target_name:`wpdash_editor_sub_menu`,interaction_result:a==null||(r=a.interactionResults)==null?void 0:r.editorSubMenuOpened,location_l1:this.toLowerSnake(a==null||(i=a.secondaryLocations)==null?void 0:i.wpDashElementorCoreSubMenu),interaction_description:`core_user_hovered_sub_menu`}))}},{key:`sendWpDashThemeBuilderClick`,value:function sendWpDashThemeBuilderClick(){var e,t,n,r,i,a=this.getConfig();return this.dispatchEvent(a==null||(e=a.names)==null||(e=e.editorOne)==null?void 0:e.wpDashThemeBuilderClick,this.createWpDashPayload({interaction_type:this.toLowerSnake(a==null||(t=a.triggers)==null?void 0:t.click),target_type:a==null||(n=a.targetTypes)==null?void 0:n.wpDashSubMenuItem,target_name:`theme_builder_menu_item`,interaction_result:a==null||(r=a.interactionResults)==null?void 0:r.themeBuilderPromotionWindow,location_l1:this.toLowerSnake(a==null||(i=a.secondaryLocations)==null?void 0:i.wpDashThemeBuilder),interaction_description:`core_user_clicked_theme_builder_menu_item`}))}},{key:`sendSidebarMenuItemClicked`,value:function sendSidebarMenuItemClicked(e){var t=e.eventId,n=e.groupEventId;try{var r,i,a,o,s,c,l=this.getConfig(),u=this.createBasePayload({window_name:l==null||(r=l.windowNames)==null?void 0:r.sidebarMenu,interaction_type:this.toLowerSnake(l==null||(i=l.triggers)==null?void 0:i.click),target_type:l==null||(a=l.targetTypes)==null?void 0:a.link,target_name:t,interaction_result:l==null||(o=l.interactionResults)==null?void 0:o.pageOpened,target_location:this.toLowerSnake(l==null||(s=l.locations)==null?void 0:s.sidebar)});return n&&(u.location_l1=n),this.dispatchEvent(l==null||(c=l.names)==null||(c=c.editorOne)==null?void 0:c.sidebarMenuItemClicked,u)}catch(e){return!1}}},{key:`sendSidebarMenuGroupToggled`,value:function sendSidebarMenuGroupToggled(e){var t=e.eventId,n=e.isExpanded;try{var r,i,a,o,s,c,l,u=this.getConfig(),d=n?u==null||(r=u.interactionResults)==null?void 0:r.expanded:u==null||(i=u.interactionResults)==null?void 0:i.collapsed;return this.dispatchEvent(u==null||(a=u.names)==null||(a=a.editorOne)==null?void 0:a.sidebarMenuGroupToggled,this.createBasePayload({window_name:u==null||(o=u.windowNames)==null?void 0:o.sidebarMenu,interaction_type:this.toLowerSnake(u==null||(s=u.triggers)==null?void 0:s.click),target_type:u==null||(c=u.targetTypes)==null?void 0:c.toggle,target_name:t,interaction_result:d,target_location:this.toLowerSnake(u==null||(l=u.locations)==null?void 0:l.sidebar)}))}catch(e){return!1}}}])}(),r={elementorMenuLink:`#toplevel_page_elementor-home > a.menu-top`,themeBuilderItem:`[data-slug="elementor-theme-builder"] a, .wp-submenu a[href*="page=elementor-theme-builder"]`},i=function(){function MenuEventsTracker(){_classCallCheck(this,MenuEventsTracker)}return _createClass(MenuEventsTracker,null,[{key:`attach`,value:function attach(){this.attachElementorMenuClick(),this.attachThemeBuilderClick()}},{key:`attachElementorMenuClick`,value:function attachElementorMenuClick(){var e=document.querySelector(r.elementorMenuLink);e&&e.addEventListener(`click`,function(){n.sendWpDashElementorMenuClick()})}},{key:`attachThemeBuilderClick`,value:function attachThemeBuilderClick(){document.addEventListener(`click`,function(e){e.target.closest(r.themeBuilderItem)&&n.sendWpDashThemeBuilderClick()},!0)}},{key:`trackEditorSubMenuOpened`,value:function trackEditorSubMenuOpened(){n.sendWpDashEditorSubMenuHover()}}])}(),a=function(){function FlyoutInteractionHandler(){_classCallCheck(this,FlyoutInteractionHandler),this.activeMenu=null,this.activeParent=null,this.closeTimeout=null,this.lastMousePos=null,this.exitPoint=null,this.mouseMoveHandler=null}return _createClass(FlyoutInteractionHandler,[{key:`handle`,value:function handle(){this.setupFlyoutMenus(),this.setupMobileSupport()}},{key:`setupFlyoutMenus`,value:function setupFlyoutMenus(){var e=this;document.querySelectorAll(`#adminmenu li.elementor-has-flyout`).forEach(function(t){var n=t.querySelector(`.elementor-submenu-flyout`);n&&(e.attachHoverEvents(t,n),e.attachFocusEvents(t,n),e.attachKeyboardEvents(t,n))})}},{key:`attachHoverEvents`,value:function attachHoverEvents(e,t){var n=this;e.addEventListener(`mouseenter`,function(){n.activeMenu&&!n.activeMenu.contains(e)&&n.activeMenu!==t&&(n.isCursorInSafeZone()||n.hideFlyout(n.activeMenu)),n.clearCloseTimeout(),n.showFlyout(e,t)}),e.addEventListener(`mouseleave`,function(r){n.exitPoint={x:r.clientX,y:r.clientY},n.scheduleClose(e,t)}),t.addEventListener(`mouseenter`,function(){n.clearCloseTimeout(),n.stopMouseTracking()}),t.addEventListener(`mouseleave`,function(r){n.exitPoint={x:r.clientX,y:r.clientY},n.scheduleClose(e,t)})}},{key:`attachFocusEvents`,value:function attachFocusEvents(e,t){var n=this,r=e.querySelector(`:scope > a`);r&&r.addEventListener(`focus`,function(){n.showFlyout(e,t)}),t.addEventListener(`focusout`,function(r){e.contains(r.relatedTarget)||n.hideFlyout(t)})}},{key:`attachKeyboardEvents`,value:function attachKeyboardEvents(e,t){var n=this;e.addEventListener(`keydown`,function(r){n.handleKeyNavigation(r,e,t)})}},{key:`showFlyout`,value:function showFlyout(e,t){var n=t.classList.contains(`elementor-submenu-flyout-visible`);this.activeMenu&&this.activeMenu!==t&&this.hideFlyout(this.activeMenu),this.exitPoint=null,this.positionFlyout(e,t),t.classList.add(`elementor-submenu-flyout-visible`),this.activeMenu=t,this.activeParent=e,n||i.trackEditorSubMenuOpened()}},{key:`hideFlyout`,value:function hideFlyout(e){e.classList.remove(`elementor-submenu-flyout-visible`),this.activeMenu===e&&(this.activeMenu=null,this.activeParent=null,this.exitPoint=null,this.stopMouseTracking())}},{key:`scheduleClose`,value:function scheduleClose(e,t){var n=this;this.clearCloseTimeout(),this.startMouseTracking(e,t),this.closeTimeout=setTimeout(function(){n.checkAndClose(t)},300)}},{key:`checkAndClose`,value:function checkAndClose(e){var t=this;this.activeMenu&&(this.isCursorInSafeZone()?this.closeTimeout=setTimeout(function(){t.checkAndClose(e)},300):this.hideFlyout(e))}},{key:`clearCloseTimeout`,value:function clearCloseTimeout(){this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null)}},{key:`startMouseTracking`,value:function startMouseTracking(){var e=this;this.stopMouseTracking(),this.mouseMoveHandler=function(t){e.lastMousePos={x:t.clientX,y:t.clientY}},document.addEventListener(`mousemove`,this.mouseMoveHandler)}},{key:`stopMouseTracking`,value:function stopMouseTracking(){this.mouseMoveHandler&&(document.removeEventListener(`mousemove`,this.mouseMoveHandler),this.mouseMoveHandler=null),this.lastMousePos=null}},{key:`isCursorInSafeZone`,value:function isCursorInSafeZone(){if(!this.lastMousePos||!this.activeMenu||!this.activeParent)return!1;var e=this.lastMousePos,t=this.activeParent.getBoundingClientRect();if(this.isPointInRect(e,t))return!0;var n=this.activeMenu.getBoundingClientRect();return this.isPointInRect(e,n)?!0:this.isPointInTriangle(e,t,n)}},{key:`isPointInRect`,value:function isPointInRect(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}},{key:`isPointInTriangle`,value:function isPointInTriangle(e,t,n){var r=this.exitPoint?this.exitPoint.x:t.right,i=Math.abs(r-t.right),a=Math.abs(r-n.left),o,s,c;return i<a?(o=this.exitPoint||{x:t.right,y:t.top+t.height/2},s={x:n.left,y:n.top-100},c={x:n.left,y:n.bottom+100}):(o=this.exitPoint||{x:n.left,y:n.top+n.height/2},s={x:t.right,y:t.top-100},c={x:t.right,y:t.bottom+100}),this.pointInTriangle(e,o,s,c)}},{key:`pointInTriangle`,value:function pointInTriangle(e,t,n,r){var i=function sign(e,t,n){return(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y)},a=i(e,t,n),o=i(e,n,r),s=i(e,r,t);return!((0>a||0>o||0>s)&&(0<a||0<o||0<s))}},{key:`positionFlyout`,value:function positionFlyout(e,t){var n=window.innerHeight,r=t.offsetHeight,i=e.getBoundingClientRect().top;if(i+r>n){var a=n-r-i;a<-i&&(a=-i+10),t.style.top=a+`px`}else delete t.style.top}},{key:`handleKeyNavigation`,value:function handleKeyNavigation(e,t,n){var r=n.querySelectorAll(`a`),i=n.querySelector(`a:focus`),a=Array.from(r).indexOf(i),o=n.classList.contains(`elementor-submenu-flyout-visible`);switch(e.key){case`ArrowRight`:if(!o){var s;e.preventDefault(),this.showFlyout(t,n),(s=r[0])==null||s.focus()}break;case`ArrowLeft`:if(o){var c;e.preventDefault(),this.hideFlyout(n),(c=t.querySelector(`:scope > a`))==null||c.focus()}break;case`ArrowDown`:if(o&&a>=0){var l;e.preventDefault(),(l=r[(a+1)%r.length])==null||l.focus()}break;case`ArrowUp`:if(o&&a>=0){var u;e.preventDefault(),(u=r[(a-1+r.length)%r.length])==null||u.focus()}break;case`Escape`:if(o){var d;e.preventDefault(),this.hideFlyout(n),(d=t.querySelector(`:scope > a`))==null||d.focus()}break}}},{key:`setupMobileSupport`,value:function setupMobileSupport(){var e=this;window.innerWidth>782||(document.querySelectorAll(`#adminmenu li.elementor-has-flyout > a`).forEach(function(t){t.addEventListener(`click`,function(n){e.handleMobileClick(n,t)})}),document.addEventListener(`click`,function(t){e.handleDocumentClick(t)}))}},{key:`handleMobileClick`,value:function handleMobileClick(e,t){var n=t.parentElement;n.querySelector(`.elementor-submenu-flyout`)&&(n.classList.contains(`elementor-flyout-open`)||(e.preventDefault(),document.querySelectorAll(`#adminmenu li.elementor-has-flyout`).forEach(function(e){e.classList.remove(`elementor-flyout-open`)}),n.classList.add(`elementor-flyout-open`)))}},{key:`handleDocumentClick`,value:function handleDocumentClick(e){e.target.closest(`#adminmenu li.elementor-has-flyout`)||document.querySelectorAll(`#adminmenu li.elementor-has-flyout`).forEach(function(e){e.classList.remove(`elementor-flyout-open`)})}}])}(),o=function(){function EditorOneMenu(){var e;_classCallCheck(this,EditorOneMenu),this.config=((e=window)==null?void 0:e.editorOneMenuConfig)||{}}return _createClass(EditorOneMenu,[{key:`init`,value:function init(){if(i.attach(),this.isSidebarNavigationActive()){new t;return}this.buildFlyoutMenus()}},{key:`isSidebarNavigationActive`,value:function isSidebarNavigationActive(){return document.body.classList.contains(`e-has-sidebar-navigation`)}},{key:`buildFlyoutMenus`,value:function buildFlyoutMenus(){new e(this.config).render()&&new a().handle()}}])}(),s=function initEditorOneMenu(){new o().init()};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,s):s()})();
1 +(()=>{var e={8569:(e,t,n)=>{"use strict";var o=n(96784);Object.defineProperty(t,"__esModule",{value:!0}),t.FlyoutInteractionHandler=void 0;var i=o(n(39805)),r=o(n(40989));t.FlyoutInteractionHandler=function(){return(0,r.default)(function FlyoutInteractionHandler(){(0,i.default)(this,FlyoutInteractionHandler),this.activeMenu=null,this.activeParent=null,this.closeTimeout=null,this.lastMousePos=null,this.exitPoint=null,this.mouseMoveHandler=null},[{key:"handle",value:function handle(){this.setupFlyoutMenus(),this.setupMobileSupport()}},{key:"setupFlyoutMenus",value:function setupFlyoutMenus(){var e=this;document.querySelectorAll("#adminmenu li.elementor-has-flyout").forEach(function(t){var n=t.querySelector(".elementor-submenu-flyout");n&&(e.attachHoverEvents(t,n),e.attachFocusEvents(t,n),e.attachKeyboardEvents(t,n))})}},{key:"attachHoverEvents",value:function attachHoverEvents(e,t){var n=this;e.addEventListener("mouseenter",function(){n.activeMenu&&!n.activeMenu.contains(e)&&n.activeMenu!==t&&(n.isCursorInSafeZone()||n.hideFlyout(n.activeMenu)),n.clearCloseTimeout(),n.showFlyout(e,t)}),e.addEventListener("mouseleave",function(o){n.exitPoint={x:o.clientX,y:o.clientY},n.scheduleClose(e,t)}),t.addEventListener("mouseenter",function(){n.clearCloseTimeout(),n.stopMouseTracking()}),t.addEventListener("mouseleave",function(o){n.exitPoint={x:o.clientX,y:o.clientY},n.scheduleClose(e,t)})}},{key:"attachFocusEvents",value:function attachFocusEvents(e,t){var n=this,o=e.querySelector(":scope > a");o&&o.addEventListener("focus",function(){n.showFlyout(e,t)}),t.addEventListener("focusout",function(o){e.contains(o.relatedTarget)||n.hideFlyout(t)})}},{key:"attachKeyboardEvents",value:function attachKeyboardEvents(e,t){var n=this;e.addEventListener("keydown",function(o){n.handleKeyNavigation(o,e,t)})}},{key:"showFlyout",value:function showFlyout(e,t){this.activeMenu&&this.activeMenu!==t&&this.hideFlyout(this.activeMenu),this.exitPoint=null,this.positionFlyout(e,t),t.classList.add("elementor-submenu-flyout-visible"),this.activeMenu=t,this.activeParent=e}},{key:"hideFlyout",value:function hideFlyout(e){e.classList.remove("elementor-submenu-flyout-visible"),this.activeMenu===e&&(this.activeMenu=null,this.activeParent=null,this.exitPoint=null,this.stopMouseTracking())}},{key:"scheduleClose",value:function scheduleClose(e,t){var n=this;this.clearCloseTimeout(),this.startMouseTracking(e,t),this.closeTimeout=setTimeout(function(){n.checkAndClose(t)},300)}},{key:"checkAndClose",value:function checkAndClose(e){var t=this;this.activeMenu&&(this.isCursorInSafeZone()?this.closeTimeout=setTimeout(function(){t.checkAndClose(e)},300):this.hideFlyout(e))}},{key:"clearCloseTimeout",value:function clearCloseTimeout(){this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null)}},{key:"startMouseTracking",value:function startMouseTracking(){var e=this;this.stopMouseTracking(),this.mouseMoveHandler=function(t){e.lastMousePos={x:t.clientX,y:t.clientY}},document.addEventListener("mousemove",this.mouseMoveHandler)}},{key:"stopMouseTracking",value:function stopMouseTracking(){this.mouseMoveHandler&&(document.removeEventListener("mousemove",this.mouseMoveHandler),this.mouseMoveHandler=null),this.lastMousePos=null}},{key:"isCursorInSafeZone",value:function isCursorInSafeZone(){if(!this.lastMousePos||!this.activeMenu||!this.activeParent)return!1;var e=this.lastMousePos,t=this.activeParent.getBoundingClientRect();if(this.isPointInRect(e,t))return!0;var n=this.activeMenu.getBoundingClientRect();return!!this.isPointInRect(e,n)||this.isPointInTriangle(e,t,n)}},{key:"isPointInRect",value:function isPointInRect(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}},{key:"isPointInTriangle",value:function isPointInTriangle(e,t,n){var o,i,r,u=this.exitPoint?this.exitPoint.x:t.right;return Math.abs(u-t.right)<Math.abs(u-n.left)?(o=this.exitPoint||{x:t.right,y:t.top+t.height/2},i={x:n.left,y:n.top-100},r={x:n.left,y:n.bottom+100}):(o=this.exitPoint||{x:n.left,y:n.top+n.height/2},i={x:t.right,y:t.top-100},r={x:t.right,y:t.bottom+100}),this.pointInTriangle(e,o,i,r)}},{key:"pointInTriangle",value:function pointInTriangle(e,t,n,o){var i=function sign(e,t,n){return(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y)},r=i(e,t,n),u=i(e,n,o),l=i(e,o,t);return!((0>r||0>u||0>l)&&(0<r||0<u||0<l))}},{key:"positionFlyout",value:function positionFlyout(e,t){var n=window.innerHeight,o=t.offsetHeight,i=e.getBoundingClientRect().top;if(i+o>n){var r=n-o-i;r<-i&&(r=10-i),t.style.top=r+"px"}else delete t.style.top}},{key:"handleKeyNavigation",value:function handleKeyNavigation(e,t,n){var o=n.querySelectorAll("a"),i=n.querySelector("a:focus"),r=Array.from(o).indexOf(i),u=n.classList.contains("elementor-submenu-flyout-visible");switch(e.key){case"ArrowRight":var l;if(!u)e.preventDefault(),this.showFlyout(t,n),null===(l=o[0])||void 0===l||l.focus();break;case"ArrowLeft":var s;if(u)e.preventDefault(),this.hideFlyout(n),null===(s=t.querySelector(":scope > a"))||void 0===s||s.focus();break;case"ArrowDown":var a;if(u&&r>=0)e.preventDefault(),null===(a=o[(r+1)%o.length])||void 0===a||a.focus();break;case"ArrowUp":var c;if(u&&r>=0)e.preventDefault(),null===(c=o[(r-1+o.length)%o.length])||void 0===c||c.focus();break;case"Escape":var d;if(u)e.preventDefault(),this.hideFlyout(n),null===(d=t.querySelector(":scope > a"))||void 0===d||d.focus()}}},{key:"setupMobileSupport",value:function setupMobileSupport(){var e=this;window.innerWidth>782||(document.querySelectorAll("#adminmenu li.elementor-has-flyout > a").forEach(function(t){t.addEventListener("click",function(n){e.handleMobileClick(n,t)})}),document.addEventListener("click",function(t){e.handleDocumentClick(t)}))}},{key:"handleMobileClick",value:function handleMobileClick(e,t){var n=t.parentElement;n.querySelector(".elementor-submenu-flyout")&&(n.classList.contains("elementor-flyout-open")||(e.preventDefault(),document.querySelectorAll("#adminmenu li.elementor-has-flyout").forEach(function(e){e.classList.remove("elementor-flyout-open")}),n.classList.add("elementor-flyout-open")))}},{key:"handleDocumentClick",value:function handleDocumentClick(e){e.target.closest("#adminmenu li.elementor-has-flyout")||document.querySelectorAll("#adminmenu li.elementor-has-flyout").forEach(function(e){e.classList.remove("elementor-flyout-open")})}}])}()},10564:e=>{function _typeof(t){return e.exports=_typeof="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.exports.__esModule=!0,e.exports.default=e.exports,_typeof(t)}e.exports=_typeof,e.exports.__esModule=!0,e.exports.default=e.exports},11327:(e,t,n)=>{var o=n(10564).default;e.exports=function toPrimitive(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},36981:(e,t,n)=>{"use strict";var o=n(96784);Object.defineProperty(t,"__esModule",{value:!0}),t.FlyoutMenuRenderer=void 0;var i=o(n(39805)),r=o(n(40989));t.FlyoutMenuRenderer=function(){return(0,r.default)(function FlyoutMenuRenderer(e){(0,i.default)(this,FlyoutMenuRenderer),this.config=e},[{key:"render",value:function render(){var e=this.config.editorFlyout;if(!e||!e.items||!e.items.length)return!1;var t=this.findEditorInMenu("#toplevel_page_elementor-home");if(!t)return!1;t.classList.add("elementor-has-flyout");var n=document.createElement("ul");return n.className="elementor-submenu-flyout elementor-level-3",e.items.forEach(function(e){if(e.has_divider_before){var t=document.createElement("li");t.className="elementor-flyout-divider",t.setAttribute("role","separator"),n.appendChild(t)}var o=document.createElement("li");o.setAttribute("data-group-id",e.group_id||"");var i=document.createElement("a");i.href=e.url,i.textContent=e.label,o.appendChild(i),n.appendChild(o)}),t.appendChild(n),!0}},{key:"findEditorInMenu",value:function findEditorInMenu(e){var t=document.querySelector(e);if(!t)return null;var n=t.querySelector(".wp-submenu");if(!n)return null;var o=n.querySelector('a[href$="page=elementor"]');return o?o.closest("li"):null}}])}()},39805:e=>{e.exports=function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},40989:(e,t,n)=>{var o=n(45498);function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}e.exports=function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},45498:(e,t,n)=>{var o=n(10564).default,i=n(11327);e.exports=function toPropertyKey(e){var t=i(e,"string");return"symbol"==o(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},96784:e=>{e.exports=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},98263:(e,t,n)=>{"use strict";var o=n(96784);Object.defineProperty(t,"__esModule",{value:!0}),t.SidebarMenuHandler=void 0;var i=o(n(39805)),r=o(n(40989));t.SidebarMenuHandler=function(){return(0,r.default)(function SidebarMenuHandler(){(0,i.default)(this,SidebarMenuHandler),this.elementorHomeMenu=this.findElementorHomeMenu(),this.elementorHomeMenu&&(this.deactivateOtherMenus(),this.activateElementorMenu(),this.highlightSubmenu())},[{key:"findElementorHomeMenu",value:function findElementorHomeMenu(){return document.querySelector("#toplevel_page_elementor-home")}},{key:"deactivateOtherMenus",value:function deactivateOtherMenus(){var e=this;document.querySelectorAll("#adminmenu li.wp-has-current-submenu").forEach(function(t){if(t!==e.elementorHomeMenu){t.classList.remove("wp-has-current-submenu","wp-menu-open","selected"),t.classList.add("wp-not-current-submenu");var n=t.querySelector(":scope > a");n&&n.classList.remove("wp-has-current-submenu","wp-menu-open","current")}})}},{key:"activateElementorMenu",value:function activateElementorMenu(){this.elementorHomeMenu.classList.remove("wp-not-current-submenu"),this.elementorHomeMenu.classList.add("wp-has-current-submenu","wp-menu-open","selected");var e=this.elementorHomeMenu.querySelector(":scope > a.menu-top");e&&e.classList.add("wp-has-current-submenu","wp-menu-open")}},{key:"highlightSubmenu",value:function highlightSubmenu(){var e=new URL(window.location.href).searchParams.get("page"),t="elementor";"elementor"===e||"elementor-home"===e?t="elementor":"e-form-submissions"===e?t="e-form-submissions":"elementor-theme-builder"===e&&(t="elementor-theme-builder"),this.elementorHomeMenu.querySelectorAll(".wp-submenu li").forEach(function(e){var n=e.querySelector("a");n&&(e.classList.remove("current"),n.classList.remove("current"),n.setAttribute("aria-current",""),new URL(n.href,window.location.origin).searchParams.get("page")===t&&(e.classList.add("current"),n.classList.add("current"),n.setAttribute("aria-current","page")))})}}])}()}},t={};function __webpack_require__(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,__webpack_require__),i.exports}(()=>{"use strict";var e=__webpack_require__(96784),t=e(__webpack_require__(39805)),n=e(__webpack_require__(40989)),o=__webpack_require__(36981),i=__webpack_require__(98263),r=__webpack_require__(8569),u=function(){return(0,n.default)(function EditorOneMenu(){var e;(0,t.default)(this,EditorOneMenu),this.config=(null===(e=window)||void 0===e?void 0:e.editorOneMenuConfig)||{}},[{key:"init",value:function init(){this.isSidebarNavigationActive()?new i.SidebarMenuHandler:this.buildFlyoutMenus()}},{key:"isSidebarNavigationActive",value:function isSidebarNavigationActive(){return document.body.classList.contains("e-has-sidebar-navigation")}},{key:"buildFlyoutMenus",value:function buildFlyoutMenus(){new o.FlyoutMenuRenderer(this.config).render()&&(new r.FlyoutInteractionHandler).handle()}}])}(),l=function initEditorOneMenu(){(new u).init()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",l):l()})()})();