- WordPress core y plugins - Tema Twenty Twenty-Four configurado - Plugin allow-unfiltered-html.php simplificado - .gitignore configurado para excluir wp-config.php y uploads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 line
18 KiB
JavaScript
Executable File
1 line
18 KiB
JavaScript
Executable File
(()=>{var t={50618:t=>{t.exports=t=>{class e{constructor(e){this.post=e,this.flags={},this.$container=t()}static get selectorsToRemoveRegExp(){if(!e._regexp){const s=[":hover",":active",":focus-within",":focus",":visited",":after",":before",":checked",":empty",".tve_flt",".tve_anim_start",".thrv_data_element_start",".go-down",".next",".ct_finished",".expired",".tcb-disabled-pagination-button",".tve-state-expanded",".expand-children",".tve-m-expanded",".tve-state-active",".tcb_show_all_hidden",".tcb-style-wrap",".tve_empty_dropzone",".tve_shortcode_editor",".tve-mobile-browser",".tve-tablet-browser",".tcb-animated",":not(#_s)",":not(.inc)",":not(#tve)","#tve_editor","#wrapper",".tve-lg-field-disabled",".tve-lg-state-field-empty",".tve-lg-dropdown-message-after",".tve-hide-country"];t("#tcb_landing_page").length>0&&s.push("#tcb_landing_page"),e._regexp=new RegExp(`(${s.map(t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")})`,"g")}return e._regexp}get customSelectorChecks(){return[this.hasAnimationsAndActions,this.hasConditionalDisplay,this.hasNumericPagination,this.isInsidePostContent,this.hasGalleryLightbox,this.hasLeadGeneration,this.hasLightboxAction,this.hasPostListFilter,this.hasNumberCounter,this.hasFloatingVideo,this.hasImageGallery,this.hasNotification,this.hasAvatarPicker,this.hasWooMiniCart,this.hasUserProfile,this.hasImagePopup,this.isTCBLightbox,this.hasVideoPopup,this.hasDatePicker,this.hasFileUpload,this.hasTableSort,this.hasLoginForm,this.hasACFVideo,this.hasParallax,this.hasMegaMenu,this.hasPostList,this.hasCarousel,this.hasToggles,this.hasTooltip,this.hasSocial,this.hasModal,this.hasMenu,this.hasTOC,this.hasTabs,this.hasSearch,this.isBodyRule,this.frontendClasses].map(t=>t.bind(this)).concat(window.lightspeed_extra_checks||[])}static getRealSelector(t){return(t=(t=(t=(t=t.replace(/::\S+/g,"")).replace(":not(.tve_editor_page)","")).replace(".tve_editor_page",".just-a-class-that-you-wont-find-in-the-page")).replace(e.selectorsToRemoveRegExp,"")).trim()}static conditionText(t){let e=null;return t.conditionText&&(e=t.conditionText),t.cssText.match(/([^{]*){/m)&&(e=RegExp.$1.trim()),e}static getMediaRules(){return"undefined"==typeof TVE?["(min-width: 300px)","(max-width: 1023px)","(max-width: 767px)"]:TVE.main.all_media()}resetFlags(){this.flags={}}getContainer(t){if(this.$editorContainer=t,"undefined"!=typeof tve_frontend_options&&"tcb_symbol"===tve_frontend_options.post_type){const e=t.closest("#tve_editor");e.length>0&&(this.$editorContainer=e.parent())}const e=this.$editorContainer.clone().wrap("<div></div>").parent();return"undefined"==typeof tve_frontend_options||"tcb_symbol"===tve_frontend_options.post_type||this.$editorContainer.hasClass("thrv_symbol")||e.find('[class*="thrv_symbol_"]').empty(),e}getLightspeedData({$content:t=TVE.Editor_Page.editor,stylesToOptimize:e=null,jsModules:s=null,gutenbergModules:i=null,wooModules:a=TVE.CONST.lightspeed.woo_modules}){return this.$container=this.getContainer(t),null===e&&(e=TVE.CONST.lightspeed.styles_to_optimize),null===s&&(s=TVE.CONST.lightspeed.js_modules),null===i&&(i=TVE.CONST.lightspeed.gutenberg_modules),a||(a={}),{optimized_styles:this.getOptimizedCss(e),js_modules:this.getJsModulesToSave(s),woo_modules:this.getJsModulesToSave(a),gutenberg_modules:this.getJsModulesToSave(i),assets_to_preload:this.getAssetsToPreload()}}isSelectorInContent(e){const s=this.$container.find(e);return"undefined"!=typeof TVE&&TVE.CONST.debug_mode&&0===s.length&&t(e).filter((e,s)=>t(s).closest(this.$editorContainer).length>0&&null===s.closest('[class*="thrv_symbol_"]')).length>0&&console.error(this.$container.children().attr("class"),e),s.length>0}parseCssRule(t){return t.includes("url")&&(t=t.replace(/url\([^)]*images\/([a-zA-Z.\-_0-9]*)(['"]?)\)/gm,(t,e,s)=>e?`url(${s}${TVE.CONST.cpanel_dir}/css/images/${e}${s})`:t)),t.includes("background-clip")&&!t.includes("--webkit-background-clip")&&(t=t.replace(new RegExp("background-clip:(.+?);","g"),t=>`-webkit-${t}`)),t}getOptimizedCss(s=[]){this.resetFlags();const i=[],a={},o={};e.getMediaRules().forEach(t=>a[`@media ${t}`]=[]),t(s.map(t=>`#${t}-css`).join(",")).each((t,s)=>{const n=s.sheet;try{n&&n.cssRules&&[...n.cssRules].forEach(t=>{let s;switch(t.type){case CSSRule.STYLE_RULE:s=this.isSelectorUsed(t.selectorText),s&&i.push(this.parseCssRule(t.cssText.replace(t.selectorText,s)));break;case CSSRule.MEDIA_RULE:const n=e.conditionText(t);n?(void 0===a[n]&&(a[n]=[]),[...t.cssRules].forEach(t=>{t.type===CSSRule.STYLE_RULE?(s=this.isSelectorUsed(t.selectorText),s&&a[n].push(this.parseCssRule(t.cssText.replace(t.selectorText,s)))):console.error(t)})):i.push(this.parseCssRule(t.cssText));break;case CSSRule.KEYFRAMES_RULE:o[t.name]=t.cssText;case CSSRule.SUPPORTS_RULE:}})}catch(t){console.warn(t)}});for(const t in a)a[t].length&&i.push(`${t}{${a[t].join("")}}`);const n=i.join("");for(const t in o)n.includes(t)&&i.push(o[t]);return i.join("")}isSelectorUsed(t){return t.split(",").filter(t=>!(t.includes(".tve-state-hover")||t.includes("tcb-edit-mode")||t.includes("edit_mode"))&&(t=e.getRealSelector(t),this.customSelectorChecks.some(e=>"function"==typeof e&&e(t))||this.isSelectorInContent(t))).map(t=>t.trim()).join(",")}isBodyRule(e){return e.match(/html|body/)&&!e.match(/tbody|-html|html-/)&&t(e).length>0}frontendClasses(t){return t.match(/tcb-permanently-hidden|tar-disabled/)}hasAnimationsAndActions(t){let e=!1;return t.includes("tve_anim_start")&&(void 0===this.flags["has-animations-actions-element"]&&(this.flags["has-animations-actions-element"]=[...new Set([...this.$container.find(".tve_ea_thrive_animation").addBack(".tve_ea_thrive_animation")].map(t=>(t.className.replace("tve_anim_start","").match(/(tve_anim_\S*)/),RegExp.$1.trim())))]),e=!t.replace("tve_anim_start","").match(/tve_anim_\S*/)||this.flags["has-animations-actions-element"].some(e=>t.includes(e))),e}hasFileUpload(t){return void 0===this.flags["has-file-upload"]&&(this.flags["has-file-upload"]=this.isSelectorInContent(".tve_lg_file")),this.flags["has-file-upload"]&&t.match(/tcb-file-list/)}hasDatePicker(t){return void 0===this.flags["has-date-picker"]&&(this.flags["has-date-picker"]=this.isSelectorInContent(".lg-date-picker")),this.flags["has-date-picker"]&&t.match(/flatpickr/)}isInsidePostContent(t){void 0===this.flags["inside-post-content"]&&(this.flags["inside-post-content"]=this.$editorContainer.closest(".tcb-post-content").length>0);let e=this.flags["inside-post-content"]&&t.match(/tcb-post-content/);return e&&(e=(t=t.replace(/\.tcb-post-content/g,"").trim()).length>0&&this.$container.find(t).length>0),e}hasLeadGeneration(t){return void 0===this.flags["has-lead-generation"]&&(this.flags["has-lead-generation"]=this.isSelectorInContent(".thrv_lead_generation_container")),this.flags["has-lead-generation"]&&t.match(/tve-lg-error|thrv-svg-icon svg|tvd-toast|thrv_lead_generation_container|tcb-form-loader-icon/)}hasLoginForm(t){return void 0===this.flags["has-login-form"]&&(this.flags["has-login-form"]=this.isSelectorInContent(".thrv-login-element")),this.flags["has-login-form"]&&t.match(/thrv-login-element|thrv-svg-icon svg|tvd-toast/)}hasContactForm(t){return void 0===this.flags["contact-form"]&&(this.flags["contact-form"]=this.isSelectorInContent(".thrv-contact-form")),this.flags["contact-form"]&&t.match(/tcb-cf-error|thrv-svg-icon svg|tvd-toast/)}hasUserProfile(t){return void 0===this.flags["has-user-profile"]&&(this.flags["has-user-profile"]=this.isSelectorInContent(".tve-user-profile")),this.flags["has-user-profile"]&&t.match(/tve-up-error|tvd-toast|tcb-form-loader-icon/)}hasSocial(t){return void 0===this.flags["has-social"]&&(this.flags["has-social"]=this.isSelectorInContent(".tve_social_items")),this.flags["has-social"]&&t.includes(".rtl .tve_social_custom")}hasToggles(t){return void 0===this.flags["has-faq-element"]&&(this.flags["has-faq-element"]=this.isSelectorInContent(".tve_faq")),this.flags["has-faq-element"]&&t.includes("tve_oFaq")}hasTooltip(t){return void 0===this.flags["has-tooltip"]&&(this.flags["has-tooltip"]=this.isSelectorInContent(".tve_ea_thrive_tooltip")),this.flags["has-tooltip"]&&t.includes(".tve_ui_tooltip")}hasMenu(t){return void 0===this.flags["has-menu"]&&(this.flags["has-menu"]=this.isSelectorInContent(".thrv_widget_menu")),this.flags["has-menu"]&&t.includes(".thrv_widget_menu")}hasMegaMenu(t){return void 0===this.flags["has-megamenu"]&&(this.flags["has-megamenu"]=this.isSelectorInContent(".thrv_widget_menu.tcb-mega-std")),this.flags["has-megamenu"]&&t.match(/tcb-mega-|tcb-mm-/)}hasTOC(t){return void 0===this.flags["has-toc"]&&(this.flags["has-toc"]=this.isSelectorInContent(".tve-toc")),this.flags["has-toc"]&&t.includes(".tve-toc")}hasTabs(t){return void 0===this.flags["has-tabs-element"]&&(this.flags["has-tabs-element"]=this.isSelectorInContent(".tve_scT")),this.flags["has-tabs-element"]&&t.includes("tve_scT")}hasNotification(t){return void 0===this.flags["has-notification"]&&(this.flags["has-notification"]="tve_notifications"===this.post.post_type||this.isSelectorInContent(".thrv_lead_generation, .tve-user-profile, .tcb-login-form-wrapper")),this.flags["has-notification"]&&t.includes(".notifications-content-wrapper")}hasWooMiniCart(t){return void 0===this.flags["has-woo-mini-cart"]&&(this.flags["has-woo-mini-cart"]=this.isSelectorInContent(".tcb-woo-mini-cart")),this.flags["has-woo-mini-cart"]&&t.match(/tcb-woo-mini-cart-content-wrapper|widget_shopping_cart_content|tcb-woo-mini-cart/)}hasPostList(t){return void 0===this.flags["has-post-list"]&&(this.flags["has-post-list"]=this.isSelectorInContent(".tcb-post-list")),this.flags["has-post-list"]&&t.match(/-article-cover|tve-loading|empty-list/)}hasPostListFilter(t){return void 0===this.flags["has-post-list-filter"]&&(this.flags["has-post-list-filter"]=this.isSelectorInContent(".tcb-post-list-filter")),this.flags["has-post-list"]&&t.match(/tcb-post-list-filter.*tcb-active-state/)}hasParallax(t){return void 0===this.flags["has-parallax-element"]&&(this.flags["has-parallax-element"]=[...this.$container.find('[data-tve-scroll*="parallax"]').addBack('[data-tve-scroll*="parallax"]')].some(t=>{let e;try{const s=JSON.parse(t.dataset.tveScroll);e="parallax"===s.mode&&Object.keys(s.parallax).length>0}catch(t){e=!1}return e})),this.flags["has-parallax-element"]&&t.includes("tve-scroll-parallax")}hasImagePopup(t){return void 0===this.flags["has-image-popup"]&&(this.flags["has-image-popup"]=this.isSelectorInContent('[data-tcb-events*="thrive_zoom"]')),this.flags["has-image-popup"]&&t.match(/tve_zoom_|tve_close_lb|thrv-svg-icon svg/)}hasNumericPagination(t){return void 0===this.flags["has-numeric-pagination"]&&(this.flags["has-numeric-pagination"]=this.isSelectorInContent('[data-type="numeric"].tcb-pagination')),this.flags["has-numeric-pagination"]&&t.match(/tcb-pagination-number/)}hasVideoPopup(t){return void 0===this.flags["has-video-popup"]&&(this.flags["has-video-popup"]=this.isSelectorInContent('[data-tcb-events*="thrive_video"]')),this.flags["has-video-popup"]&&t.match(/tve_responsive_video_container|tcb-video-popup/)}hasLightboxAction(t){return void 0===this.flags["has-lightbox-action"]&&(this.isSelectorInContent(".tve_evt_manager_listen")?this.flags["has-lightbox-action"]=[...this.$container.find(".tve_evt_manager_listen")].map(t=>{let e="";return t.dataset.tcbEvents&&(t.dataset.tcbEvents.match(/l_anim":"(\w*)"/),e=RegExp.$1.trim()),e}).filter(t=>t):this.flags["has-lightbox-action"]=[]),this.flags["has-lightbox-action"].some(e=>t.includes(`tve_lb_anim_${e}`))}hasConditionalDisplay(t){return void 0===this.flags["has-conditional-display"]&&(this.flags["has-conditional-display"]=this.$container.find("[data-display-group]")),this.flags["has-conditional-display"]&&t.match(/tcb-conditional-display-placeholder/)}hasFloatingVideo(t){return void 0===this.flags["has-floating-video"]&&(this.flags["has-floating-video"]=[...this.$container.find(".thrv_responsive_video[data-float-position]")].map(t=>t.dataset.floatPosition)),this.flags["has-floating-video"].length&&t.includes(".tcb-no-perspective")||this.flags["has-floating-video"].length&&t.includes(".tcb-no-transform")||t.includes(".tve_responsive_video_container")&&this.flags["has-floating-video"].some(e=>t.includes(e))}hasACFVideo(t){return void 0===this.flags["has-acf-video"]&&(this.flags["has-acf-video"]=this.isSelectorInContent(".thrv_responsive_video.tcb-custom-field-source")),this.flags["has-acf-video"]&&t.match(/tve_responsive_video_container/)}hasGalleryLightbox(t){return void 0===this.flags["has-gallery-lightbox"]&&(this.flags["has-gallery-lightbox"]=this.isSelectorInContent('[data-click-behavior="fullscreen"].tcb-image-gallery')),this.flags["has-gallery-lightbox"]&&t.match(/tcb-gallery-overlay/)}hasTableSort(t){return void 0===this.flags["has-table-sort"]&&(this.flags["has-table-sort"]=this.isSelectorInContent(".tve_make_sortable")),this.flags["has-table-sort"]&&t.match(/tcb-sort/)}hasNumberCounter(t){return void 0===this.flags["has-number-counter"]&&(this.flags["has-number-counter"]=this.isSelectorInContent(".tve-number-counter")),this.flags["has-number-counter"]&&t.match(/tcb-digit|tve-number-counter-temporary-clone/)}hasImageGallery(t){return void 0===this.flags["has-image-gallery"]&&(this.flags["has-image-gallery"]=this.isSelectorInContent(".tcb-image-gallery")),this.flags["has-image-gallery"]&&t.match(/tcb-image-gallery/)}hasCarousel(t){return void 0===this.flags["has-carousel"]&&(this.flags["has-carousel"]=this.isSelectorInContent('[data-type="carousel"]')),this.flags["has-carousel"]&&t.match(/slick-|data-cwv|data-type="carousel"/)}hasSearch(t){return void 0===this.flags["has-search-form"]&&(this.flags["has-search-form"]=this.isSelectorInContent(".thrv-search-form")),this.flags["has-search-form"]&&t.match(/thrv-search-form|tve-sf-overlay-container/)}hasAvatarPicker(t){return void 0===this.flags["has-avatar-picker"]&&(this.flags["has-avatar-picker"]=this.isSelectorInContent(".tve-avatar-picker-element")),this.flags["has-avatar-picker"]&&t.match(/avatar-picker|/)}hasModal(t){return void 0===this.flags["has-modal"]&&(this.flags["has-modal"]=this.isSelectorInContent('[data-action="open-modal"]')),this.flags["has-modal"]&&t.match(/tve-modal/)}getJsModulesToSave(t){const e=[];for(const s in t)if(t.hasOwnProperty(s)){const i=t[s];i&&this.isSelectorInContent(i)&&e.push(s)}return e}getAssetsToPreload(){const e=[];return this.$container.find('.tcb-video-cover[data-preload="1"]').each((s,i)=>{const a=t(i);if("dynamic"===a.attr("data-cover-thumbnail-type"))e.push({type:"dynamic",url:"featured"});else{const t=a.find(".tcb-video-cover-image").attr("src");void 0!==t&&t.length>0&&e.push({type:"image",url:t})}}),e.filter((t,e,s)=>e===s.findIndex(e=>e.url===t.url))}isTCBLightbox(e){return void 0===this.flags["has-lightbox"]&&(this.flags["has-lightbox"]="tcb_lightbox"===this.post.post_type||t(".tve_p_lb_content:visible").length>0),this.flags["has-lightbox"]&&e.match(/tve-l-open|article|tve_lb_|tve_p_lb_/)}}return e}}},e={};function s(i){var a=e[i];if(void 0!==a)return a.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,s),o.exports}function i(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),s.push.apply(s,i)}return s}function a(t,e,s){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}(t=>{const e=t(document.body);e.on("update_checkout",t=>t.stopImmediatePropagation()),t(()=>{let o=e;if(void 0===tcb_lightspeed_optimize.optimization_type&&(tcb_lightspeed_optimize.optimization_type=[]),"undefined"!=typeof tve_frontend_options&&"tcb_symbol"===tve_frontend_options.post_type&&(o=o.find(".thrv_symbol").addClass("thrv_wrapper").parent()),["post","page"].includes(tcb_lightspeed_optimize.post.post_type)){const t=o.find(".tcb-post-content").filter((t,e)=>null===e.closest(".tcb-post-list"));1===t.length&&(o=t)}const n=new(s(50618)(t))(tcb_lightspeed_optimize.post);document.dispatchEvent(new CustomEvent("before_lightspeed_optimize.tcb"));const l=function(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?i(Object(s),!0).forEach(function(e){a(t,e,s[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):i(Object(s)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))})}return t}({key:tcb_lightspeed_optimize.key,id:tcb_lightspeed_optimize.post.ID},n.getLightspeedData({$content:o,stylesToOptimize:tcb_lightspeed_optimize.optimization_type.includes("css")?tcb_lightspeed_optimize.styles:[],jsModules:tcb_lightspeed_optimize.optimization_type.includes("js")?tcb_lightspeed_optimize.js_modules:{},gutenbergModules:tcb_lightspeed_optimize.optimization_type.includes("gutenberg")?tcb_lightspeed_optimize.gutenberg_modules:{},wooModules:tcb_lightspeed_optimize.optimization_type.includes("woo")?tcb_lightspeed_optimize.woo_modules:{}}));0===l.optimized_styles.length&&console.warn(`[${tcb_lightspeed_optimize.post.ID}] "${tcb_lightspeed_optimize.post.post_title}" has no styles saved!!!`),0===l.js_modules.length&&console.warn(`[${tcb_lightspeed_optimize.post.ID}] "${tcb_lightspeed_optimize.post.post_title}" has no js modules saved!!!`),0===l.gutenberg_modules.length&&console.warn(`[${tcb_lightspeed_optimize.post.ID}] "${tcb_lightspeed_optimize.post.post_title}" has no gutenberg modules saved!!!`),0===l.woo_modules.length&&console.warn(`[${tcb_lightspeed_optimize.post.ID}] "${tcb_lightspeed_optimize.post.post_title}" has no woo modules saved!!!`);const r={};document.dispatchEvent(new CustomEvent("lightspeed_data.tcb",{detail:r})),l.extra_data=r,setTimeout(()=>{t.ajax({xhrFields:{withCredentials:!0},headers:{"X-WP-Nonce":tcb_lightspeed_optimize.nonce},type:"POST",url:tcb_lightspeed_optimize.route,data:l}).always(t=>{parent&&"function"==typeof parent.postMessage&&parent.postMessage({from:"lightspeed-optimize",id:parseInt(tcb_lightspeed_optimize.post.ID),result:!!t.success,key:tcb_lightspeed_optimize.key},"*")})},42)})})(jQuery)})(); |