Files
roi-theme/wp-content/plugins/thrive-visual-editor/editor/js/dist/woo.min.js
root a22573bf0b Commit inicial - WordPress Análisis de Precios Unitarios
- 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>
2025-11-03 21:04:30 -06:00

1 line
11 KiB
JavaScript
Executable File

(()=>{var t={18928:(t,e,o)=>{t.exports=(t,e)=>{const r=o(25452)(t),i=o(49208)(t,e),a=o(34206)(t,e),s=o(90856)(t,e);class n{static get ajaxButtonClassName(){return"ajax_add_to_cart"}static get wooButtonClassName(){return"add_to_cart_button"}static init(){if(tve_frontend_options.is_editor_page){if("product"===tve_frontend_options.post_type){const e=t(".product[id^=product-]:not(.thrive-woocommerce-product-editable)");e.length>0&&0===e.find("#tab-description").length&&TVE.main.$(".add-element").addClass("tve-disabled")}}else n.updateAddToCartButtons(),t(document.body).on("added_to_cart",r.added_to_cart).on("adding_to_cart",r.adding_to_cart),t(e.document).find(i.selector).each((e,o)=>{new i(t(o))}),t(e.document).find(a.selector).each((e,o)=>{new a(t(o))})}static updateAddToCartButtons(){t('[data-dynamic-link="thrive_woo_link_shortcode"][data-shortcode-id="add_to_cart"]').each((t,e)=>{e.classList.add(n.wooButtonClassName,n.ajaxButtonClassName),e.setAttribute("data-quantity",1),e.setAttribute("data-product_id",n.getPostIdFromElement(e))})}static getPostIdFromElement(t){let e=tve_frontend_options.post_id;const o=t.closest(".post-wrapper");if(o){const t=o.getAttribute("class").match(/post-(\d+)/);t&&2===t.length&&(e=t[1])}return e}}return{Main:n,Shop:a,MiniCart:i,ProductCategories:s,AbstractWoo:o(37124)(t)}}},25452:t=>{t.exports=()=>({added_to_cart:(t,e,o,r="")=>{if(!r||0===r.length)return;if("_blank"===r.attr("target")){const t=r.attr("href").replace(/\?.*/,"");window.open(t,"_blank")}const i=r.parent().find(".added_to_cart"),a=i.attr("style");if(i.length>0&&(void 0===a||!a.includes("--tve-view-cart-arrow-color"))){let t;i.css("border-width").includes("0px")||(t=i.css("border-left-color")),void 0===t&&(t=i.css("background-image").includes("none")?i.css("background-color"):"transparent"),void 0!==t&&i[0].style.setProperty("--tve-view-cart-arrow-color",t,"important")}setTimeout(()=>{r[0].style.setProperty("color","")},1700)},adding_to_cart:(t,e)=>{void 0!==e&&e[0].style.setProperty("color","transparent","important")}})},34206:(t,e,o)=>{t.exports=(t,e)=>{const r=o(37124)(t),i=["columns","limit","orderby","order","ids","category","cat_operator","taxonomy","terms","terms_operator","tag","tag_operator"];class a extends r{constructor(t){super(t),e.tve_frontend_options.is_editor_page||t.find(".prev,.next").addClass("tcb-prev-next")}static get productElementSelectors(){return{"result-count":".woocommerce-result-count","catalog-ordering":".woocommerce-ordering","sale-flash":".onsale",title:".woocommerce-loop-product__title",rating:".star-rating",price:".price",cart:".button",pagination:".woocommerce-pagination"}}static get selector(){return".tcb-woo-shop"}updateProductsSection(e,o=i){const r={};return o.forEach(t=>{r[t]=this.getData(t)}),this.ajaxRenderFunction(r).done(e=>{e.content&&(this.$template.html(t(e.content).html()),this.toggleProductElements(),this.initializeCartButtons(),TVE.WooCommerceFn.content.initShopSubElements(this.$template))})}initializeCartButtons(){this.$template.find(".ajax_add_to_cart").removeClass("ajax_add_to_cart"),0===this.$template.find("a.added_to_cart").length&&this.$template.find(TVE.CONST.woocommerce.sub_element_identifiers["product-button"]).after('<a class="added_to_cart" style="display:none;"></div>')}toggleProductElements(t,e){void 0===t&&(t=Object.keys(a.productElementSelectors)),t.forEach(t=>{this.$template.find(a.productElementSelectors[t]).toggle(void 0===e?!Number(this.getData(`hide-${t}`)):e)})}ajaxRenderFunction(t){return this.loading(!0),TCB_Front.Utils.restAjax({route:tve_frontend_options.woo_rest_routes.shop,data:{args:t}}).always(()=>this.loading(!1))}}return a}},37124:t=>{t.exports=t=>{class e{constructor(e=null){this.$template=e&&e.length?e:t(this.constructor.selector)}static get selector(){return""}static get imageWidthVar(){return"--tve-woo-image-size"}static get defaultProductsSelector(){return".products"}static getProductsSectionSelector(t=""){return`${t?`.${t}`:""}${e.defaultProductsSelector}`}static defaultAttr(t=""){const e={"align-items":"left",columns:4,limit:8,orderby:"date",order:"desc",ids:"",category:"",cat_operator:"in",taxonomy:"",terms:"",terms_operator:"in",tag:"",tag_operator:"in"};return t?e[t]:e}getProductsSection(t=""){return this.$template.find(e.getProductsSectionSelector(t))}loading(t=!0){this.$template.toggleClass("tve-loader-square",t)}getData(t,e=""){let o=`data-${t}`;e&&(o=`data-${e}-${t}`);const r=this.$template.attr(o);return void 0===r?this.constructor.defaultAttr(t):r}setData(t,e,o=""){let r=`data-${t}`;return o&&(r=`data-${o}-${t}`),this.$template.attr(r,e),this}}return e}},49208:t=>{t.exports=(t,e)=>{class o{constructor(t){this.$cart=t,o.isEditorPage()&&this.initSelectors(),this.initEvents()}static get selector(){return".tcb-woo-mini-cart"}static get animationPosition(){return"-1000px"}get dataSelector(){let t=this.getAttr("css");return void 0===t&&(t=TVE.CSS_Rule_Cache.uniq_id(this.$cart)),`[data-css="${t}"]`}get $content(){if(!this.$cart.data("content")){const e=t('<div class="tcb-woo-mini-cart-content woocommerce"></div>');let r=this.getAttr("css");void 0===r&&o.isEditorPage()&&(r=TVE.CSS_Rule_Cache.uniq_id(this.$cart)),e.attr("data-css",r),this.$cart.find(o.isEditorPage()?".tcb-woo-mini-cart-items":".widget_shopping_cart_content").addClass("widget_shopping_cart_content").appendTo(e),o.isEditorPage()?t('<div class="tcb-woo-mini-cart-no-products">'+TVE.inner_$("#tve-woocommerce-mini-cart-no-products").html()+"</div>").appendTo(e):o.toggleEmptyCartClass(e),this.addCloseIcon(e),this.$cartContentWrapper=e.wrap('<div class="tcb-woo-mini-cart-content-wrapper"></div>').parent(),this.$cartContentWrapper.data("source",this.$cart).appendTo(this.$cart.closest("body")),this.refreshContentSelector(),this.$cart.data("content",this.$cartContentWrapper)}return this.$cart.data("content")}static isEditorPage(){return e.tve_frontend_options.is_editor_page}static defaultAttr(t){const e={trigger:"click",direction:"under",text:"Cart"};return t?e[t]:e}static toggleEmptyCartClass(t){const e=t.find(".woocommerce-mini-cart__empty-message");t.find(".widget_shopping_cart_content").toggleClass("tcb-woo-no-items",e.length>0)}getAttr(t){let e=this.$cart.attr(`data-${t}`);return void 0===e&&(e=o.defaultAttr(t)),e}setAttr(t,e){return this.$cart.attr(`data-${t}`,e)}initEvents(){if(t(e.document.body).on("wc_fragments_loaded",this.onCartFragmentsLoaded.bind(this)),o.isEditorPage())t(e.document.body).on("wc_fragments_loaded",this.initSelectors.bind(this));else{switch(this.getAttr("trigger")){case"click":this.$cart.off("click").on("click",this.toggle.bind(this));break;case"hover":this.$cart.off("mouseenter").on("mouseenter",this.toggle.bind(this))}t(e.document.body).on("click",t=>{setTimeout(()=>{const e=t.target;"tcb-cart-close-icon"!==e.className&&null!==e.closest(".tcb-woo-mini-cart-content")||null!==e.closest(o.selector)||null!==e.closest(".add_to_cart_button")||this.isOpen()&&this.toggle(!1)})})}}initSelectors(){["wc-cart-item","wc-cart-item-image","wc-cart-item-properties","wc-cart-item-title","wc-cart-total","wc-view-cart-button","wc-checkout-button","wc-cart-wrapper","wc-empty-cart"].forEach(t=>{const e=TVE.Elements[t].identifier.split(",").map(t=>`${this.dataSelector}${t.includes(".tcb-woo-mini-cart-content")?"":" "}${t}`).join(",").trim().replace(/ {2,}/g," ");this.$content.find(TVE.Elements[t].identifier).attr("data-selector",e).addClass("tve_no_icons tve_editable")}),["wc-cart-icon","wc-cart-count"].forEach(t=>{this.$cart.find(TVE.Elements[t].identifier).attr("data-selector",`${this.dataSelector} ${TVE.Elements[t].identifier}`).addClass("tve_no_icons tve_editable")})}onCartFragmentsLoaded(){o.isEditorPage()||(this.updateCartItemsCount(),this.updateCartTotalAmount(),o.toggleEmptyCartClass(this.$content)),this.addCloseIcon()}addCloseIcon(t=this.$content){0===t.find(".tcb-cart-close-icon").length&&t.find(".widget_shopping_cart_content").prepend('<span class="tcb-cart-close-icon"></span>')}updateCartItemsCount(){let t=0;this.$content.find(".woocommerce-mini-cart-item .quantity").each((e,o)=>{t+=parseInt(o.innerText)}),0===t&&(t=""),this.$cart.find(".tcb-woo-mini-cart-count").html(t)}updateCartTotalAmount(){this.$cart.find(".tcb-woo-mini-cart-amount").html(this.$content.find(".woocommerce-mini-cart__total .woocommerce-Price-amount").text())}toggle(t){"boolean"!=typeof t&&(t=!this.isOpen()),this.positionCart(t),this.refreshContentSelector()}isOpen(){return this.$content.hasClass("open")}hasSideAnimation(){const t=this.getAttr("direction");return"left"===t||"right"===t}positionCart(r=!0){if(this.$content.toggleClass("full-height",this.hasSideAnimation()),r&&this.$content.addClass("open"),o.isEditorPage()&&this.$content.css({left:"",right:"",top:"",opacity:"","max-height":"","max-width":""}).find(".cart_list > li").css({opacity:"",left:""}),this.hasSideAnimation()){const t=this.getAttr("direction");window.document.body.closest("html").classList.add("tve-hide-x-overflow"),this.$content.css({opacity:r?"0":"1",[t]:r?o.animationPosition:"0"}),this.$content.animate({[t]:r?"0":o.animationPosition,opacity:r?"1":"0"},{complete:()=>{this.$content.toggleClass("open",r),window.document.body.closest("html").classList.remove("tve-hide-x-overflow")}})}else{const o=this.$cart.offset(),i=o.top+this.$cart.height(),a=t(e).width(),s=this.$content.width();let n=a-o.left-this.$cart.width();o.left<s&&(n-=s-o.left+50),this.$content.css({top:i,right:n,"max-width":r?"0":"100%","max-height":r?"0":"100%"});const c=this.$content.find(".cart_list").addClass("animate-cart"),d=c.children();d.each((t,e)=>{r&&(e.style.left="200px",e.style.opacity="0"),setTimeout(()=>{e.style.left=r?"0":"200px",e.style.opacity=r?"1":"0"},50*(t+1))}),setTimeout(()=>{c.removeClass("animate-cart"),r||this.$content.removeClass("open")},50*d.length+(r?500:200)),this.$content.css({"max-height":r?"100%":"0","max-width":r?"100%":"0"})}}refreshContentSelector(){const t=this.$cart.closest('[class*="thrv_symbol_"]');if(void 0===this.$cartContentWrapper&&(this.$cartContentWrapper=this.$content),t.length){const e=t.attr("class").match(/(thrv_symbol_\d*)/g);e&&this.$cartContentWrapper.addClass(e[0]).attr("data-symbol-id",e[0])}else this.$cart.trigger("tcb_mini_cart_content_generated",this)}}return o}},90856:(t,e,o)=>{t.exports=t=>{const e=o(37124)(t);class r extends e{static get subElementSelectors(){return{title:".woocommerce-loop-category__title","product-number":".thrive-product-category-count"}}static get selector(){return".tcb-woo-product-categories"}static defaultAttr(t=""){const e={limit:4,columns:4,parent:0,hide_empty:1,orderby:"id",ids:"",order:"desc","align-items":"left","text-layout":"text_on_image","text-position":"center"};return t?e[t]:e}render(e,o=Object.keys(r.defaultAttr())){const i={};return o.forEach(t=>{i[t]=this.getData(t)}),this.ajaxRenderFunction(i).done(e=>{e.content&&(this.$template.html(t(e.content).html()),this.toggleSubElementVisibility(),TVE.WooCommerceFn.content.initProductCategorySubElements(this.$template))})}toggleSubElementVisibility(t,e){void 0===t&&(t=Object.keys(r.subElementSelectors)),t.forEach(t=>{this.$template.find(r.subElementSelectors[t]).toggle(void 0===e?!Number(this.getData(`hide-${t}`)):e)})}ajaxRenderFunction(t={}){return this.loading(!0),TCB_Front.Utils.restAjax({route:tve_frontend_options.woo_rest_routes.product_categories,data:{args:t}}).always(()=>this.loading(!1))}}return r}}},e={};const o=function o(r){var i=e[r];if(void 0!==i)return i.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,o),a.exports}(18928)(ThriveGlobal.$j,window);window.TCB_Front.woocommerce=o,ThriveGlobal.$j(window).on("tcb_after_dom_ready",()=>o.Main.init())})();