Files
roi-theme/wp-content/plugins/thrive-ultimatum/thrive-dashboard/inc/auto-responder/dist/admin-global.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
19 KiB
JavaScript
Executable File

(()=>{function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function t(t){for(var s=1;s<arguments.length;s++){var i=null!=arguments[s]?arguments[s]:{};s%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function n(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}TVE_Dash.API=TVE_Dash.API||{},TVE_Dash.API.models=TVE_Dash.API.models||{},TVE_Dash.API.collections=TVE_Dash.API.collections||{},TVE_Dash.API.views=TVE_Dash.API.views||{},function(e){"use strict";_.templateSettings={evaluate:/<#([\s\S]+?)#>/g,interpolate:/<#=([\s\S]+?)#>/g,escape:/<#-([\s\S]+?)#>/g},Backbone.emulateHTTP=!0;var n=Backbone.Router.extend({routes:{"done/:api":"done","failed/:api":"failed","edit/:api(/:action)":"edit"},done:function(e){TVE_Dash.API.ConnectedAPIs.findWhere({key:e}).set("state","done")},failed:function(e){TVE_Dash.API.ToBeConnected.set({key:e,state:"error",response:{message:window.tve_dash_api_error&&"constantcontact_v3"!==e?tve_dash_api_error.message:"Failed to connect",success:!1}})},edit:function(e,t){TVE_Dash.API.ConnectedAPIs.findWhere({key:e}).set({state:"edit",customAction:t})}});TVE_Dash.API.models.Connection=Backbone.Model.extend({defaults:{state:""}}),TVE_Dash.API.models.ToBeConnected=Backbone.Model.extend({defaults:{state:"new"}}),TVE_Dash.API.models.APIType=Backbone.Model.extend({}),TVE_Dash.API.collections.APITypes=Backbone.Collection.extend({model:TVE_Dash.API.models.APIType}),TVE_Dash.API.collections.Connections=Backbone.Collection.extend({model:TVE_Dash.API.models.Connection,getAPIs:function(e){return!0!==e&&(e=!1),e=this.filter((function(t){return t.get("connected")===e})),new TVE_Dash.API.collections.Connections(e)},getByType:function(e){if(void 0===e)return this;var t=this.filter((function(t){return t.get("type")===e}));return new TVE_Dash.API.collections.Connections(t)}}),TVE_Dash.API.views.Connection=Backbone.View.extend({initialize:function(){this.listenTo(this.model,"change:state",_.bind(this.renderState,this))},render:function(){return this.renderState(),this},renderState:function(){var t,n,s;return"Edit"===(t=this.model.get("state").length?this.model.get("state")[0].toUpperCase()+this.model.get("state").slice(1):"connected")&&(s=!0),(n=TVE_Dash.API.views["Connection"+t]?new TVE_Dash.API.views["Connection"+t]({model:this.model,collection:this.collection}):new TVE_Dash.API.views.ConnectionConnected({model:this.model,collection:this.collection})).render(s),this.$el.replaceWith(n.$el),this.setElement(n.$el),"zapier"===this.model.get("key")&&(TVE_Dash.bindZClip(e(".tvd-zapier-copy-key")),TVE_Dash.bindZClip(e(".tvd-zapier-copy-url"))),void 0!==this.model.attributes.credentials.api&&this.$el.addClass("api-cls-"+this.model.attributes.credentials.api),this.$el.find("select").select2(),this}}),TVE_Dash.API.views.ConnectionConnected=Backbone.View.extend({className:"tvd-col tvd-s6 tvd-ms6 tvd-m4 tvd-l3",events:{"click .tvd-api-edit":function(){if(this.collection.each(_.bind((function(e){e.set("state","connected")}),this)),this.model.set("state","edit"),void 0!==this.model.attributes.credentials.connection){for(var t=["client_id","api_key","key","api_url","api_token","token","url","apiUsername","apiPassword","appId","kt_user","kt_password","username","password","email","app_id","account_url","client_id","client_secret","access_code","hash_key","secretkey","secret","app_secret","access_token","blog_url","domain","pixel_id","memberid"],n=0;n<t.length;n++)e(".api-cls-"+this.model.attributes.credentials.api).find('input[name="connection['+t[n]+']"]').val(this.model.attributes.credentials.connection[t[n]]).change();e("#tvd-mm-api-key").val(this.model.attributes.credentials.connection["key "]).change(),e("#tvd-rc-api-client-id").val(this.model.attributes.credentials.client_id).change(),e("#tvd-ac-api-client-secret").val(this.model.attributes.credentials.client_secret).change(),e("#tvd-ac-api-key").val(this.model.attributes.credentials.api_key).change(),e("#tvd-rc-api-access-token").val(this.model.attributes.credentials.access_token).change(),e("#tvd-rc-api-token-secret").val(this.model.attributes.credentials.token_secret).change(),e("#tvd-rc-api-api-key").val(this.model.attributes.credentials.api_key).change(),e("#tvd-ac-api-api-secret").val(this.model.attributes.credentials.api_secret).change()}},"click .tvd-api-test":function(){this.model.set("state","test")},"click .tvd-api-delete":function(){this.model.set("state","delete")}},render:function(){return TVE_Dash.API.ToBeConnected.set("state","new"),this.$el.html(TVE_Dash.tpl("tvd-api-connected",{item:this.model})),this.model.get("notification")&&void 0!==this.model.get("notification").info&&this.$el.append('<div class="tvd-ni-notify">'+this.model.get("notification").info+"</div>"),this}}),TVE_Dash.API.views.ConnectionTest=Backbone.View.extend({className:"tvd-col tvd-s6 tvd-ms6 tvd-m4 tvd-l3",events:{"click .tvd-close-card":function(){this.model.set("state","connected")},"click .tvd-close-anywhere":function(){this.model.set("state","connected")}},render:function(){return this.$el.html(TVE_Dash.tpl("tvd-api-connection-hover",{text:TVE_Dash_Const.translations.Testing,color:"",icon:"tvd-no-icon"})),TVE_Dash.cardLoader(this.$el.find(".tvd-card")),this.test(),this},test:function(){var t=this,n=e.ajax({type:"post",url:ajaxurl,dataType:"json",data:{api:this.model.get("key"),action:TVE_Dash_Const.actions.api_handle_save,test:!0}});n.fail((function(){t.model.set("title","Connection Error"),t.model.set("state","connected")})),n.done((function(e){var n={};e.success?(n.text=TVE_Dash_Const.translations.ConnectionWorks,n.color="tvd-green tvd-close-anywhere",n.icon="tvd-icon-check",t.$el.html(TVE_Dash.tpl("tvd-api-connection-hover",n))):(t.model.set("response",e),t.model.set("state","error"))}))}}),TVE_Dash.API.views.ConnectionError=Backbone.View.extend({className:"tvd-col tvd-s6 tvd-ms6 tvd-m4 tvd-l3",events:{"click .tvd-api-edit":function(){this.model.set("state","edit")},"click .tvd-close-card":function(){this.model.set("state","connected")}},render:function(){return this.$el.html(TVE_Dash.tpl("tvd-api-connection-error",{item:this.model})),this}}),TVE_Dash.API.views.ConnectionDelete=Backbone.View.extend({className:"tvd-col tvd-s6 tvd-ms6 tvd-m4 tvd-l3",events:{"click .tvd-api-delete-yes":"yes","click .tvd-api-delete-no":function(){this.model.set("state","connected")}},render:function(){return this.$el.html(TVE_Dash.tpl("tvd-api-confirm-delete",{item:this.model})),this},yes:function(){var t=this,n=e.ajax({type:"post",url:ajaxurl,data:{api:this.model.get("key"),action:TVE_Dash_Const.actions.api_handle_save,disconnect:!0},dataType:"json"});this.$el.find(".tvd-card").replaceWith(TVE_Dash.tpl("tvd-api-connection-hover",{text:TVE_Dash_Const.translations.Deleting,color:"tvd-red",icon:"tvd-icon-spinner mdi-pulse"})),n.fail((function(e){t.model.set("state","connected")})),n.done((function(e){e.success?(new TVE_Dash.API.models.Connection({connected:!1,key:t.model.get("key"),credentials:t.model.get("credentials"),title:t.model.get("title"),type:t.model.get("type"),logoUrl:t.model.get("logoUrl")}),window.location.reload()):t.model.set("state","connected")}))}}),TVE_Dash.API.views.ConnectionDone=Backbone.View.extend({className:"tvd-col tvd-s6 tvd-ms6 tvd-m4 tvd-l3",events:{"click .tvd-api-done":function(){this.model.set("state","connected"),TVE_Dash.API.router.navigate("",{trigger:!0})}},render:function(){return this.$el.html(TVE_Dash.tpl("tvd-api-state-success",{item:this.model})),this}}),TVE_Dash.API.views.ConnectionSuccess=TVE_Dash.API.views.ConnectionDone.extend({}),TVE_Dash.API.views.NewState=Backbone.View.extend({className:"tvd-col tvd-s12 tvd-m4 tvd-l3",events:{"click .tvd-card-content":function(){this.model.set("state","select")},"click .tvd-request-api":function(e){e.stopPropagation()}},render:function(){return this.$el.html(TVE_Dash.tpl("tvd-api-state-new",{item:this.model})),this}}),TVE_Dash.API.views.HiddenState=Backbone.View.extend({render:function(){return this}}),TVE_Dash.API.views.SelectState=Backbone.View.extend({className:"tvd-col tvd-s12 tvd-m4 tvd-l3",events:{"change #selected-api":"onAPISelect"},render:function(){return this.$el.html(TVE_Dash.tpl("tvd-api-state-select",{item:this.model})),this.renderAPIsList(),this},onAPISelect:function(n){const s=e(n.target).val();if("none"===s)return;const i=TVE_Dash.API.AvailableAPIs.findWhere({key:s});this.model.set(t(t({},i.toJSON()),{},{state:"form"}))},renderAPIsList:function(){var t=this.$el.find("#selected-api");TVE_Dash.API.APITypes.each((function(n){var s=e("<optgroup/>").attr("label",n.get("label")),i=this.collection.getAPIs(!1).getByType(n.get("type"));i.each((function(t){let n=t.get("title");"Brevo"===n&&(n="Brevo formerly SendinBlue");const i=e("<option/>").html(n).attr("value",t.get("key"));s.append(i)}),this),i.length&&t.append(s)}),this)}}),TVE_Dash.API.views.FormState=Backbone.View.extend({className:"tvd-col tvd-s6 tvd-ms6 tvd-m4 tvd-l3",input_selector:"input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea",events:{"click .tvd-api-cancel":function(){this.model.set("state","new")},"click .tvd-api-connect":"connect","click .tvd-api-redirect":"redirect","click .tvd-api-show-extra-options":"showExtraOptions","click .tvd-api-hide-extra-options":"hideExtraOptions","keypress .tvd-api-add-chip":"addChip","click .tvd-icon-close2":"deleteChip","change .tvd-recaptcha-version":"changeRecaptchaVersion","change .tvd-change-version":"changeVersion","click [data-custom-action]":function(e){const t=e.currentTarget.dataset.customAction.split(".");if("function"==typeof TVE_Dash.API.customActions[t])return TVE_Dash.API.customActions[t].call(TVE_Dash.API.customActions,this,e)}},render:function(t){if(TVE_Dash.API.ToBeConnected.set("state","hidden"),this.$el.html(TVE_Dash.tpl("tvd-api-state-form",{item:this.model})),this.$el.find(".tvd-card-content").prepend(TVE_Dash.tpl("tvd-api-form-"+this.model.get("key"),{item:this.model.get("credentials")})),!0!==t&&-1===["awsses","campaignmonitor","get-response"].indexOf(this.model.get("key"))&&"zapier"!==this.model.get("key")&&this.$el.find('input[type="text"]').val(""),this.$el.find(this.input_selector).each((function(t,n){e(n).val().length>0||void 0!==e(this).attr("placeholder")||!0===e(n)[0].validity.badInput?e(this).siblings("label").addClass("tvd-active"):e(this).siblings("label, i").removeClass("tvd-active")})),1===this.model.get("new_credentials")){var n=this;e.each(this.model.get("credentials"),(function(e,t){n.$el.find('input[name="connection['+e+']"]').val(t)})),this.model.unset("new_credentials")}return"mailchimp"===this.model.get("key")&&this.$("#tvd-show-mandrill-options").is(":checked")&&this.$(".tvd-extra-options").removeClass("tvd-hide"),this.$("#tvd-zapier-api-key, #tvd-zapier-api-blog_url").click((function(){e(this).select()})),n=this,setTimeout((function(){n.$("input,textarea").filter(":visible").first().focus()})),this},changeRecaptchaVersion:function(){const e=this.$("#tvd-recaptcha-v3").is(":checked");this.$(".tvd-use-browsing-history").toggle(e);const t=this.model.get("credentials");t&&(t.connection.version=e?"v3":"v2",this.model.set("credentials",t))},changeVersion:function(){const e=this.$(".tvd-change-version.tvd-version-2").is(":checked"),t=this.model.get("credentials"),n=!t||t&&t.version!==this.$("input.tvd-change-version:checked").attr("value")?"":t.key;this.$(".tvd-toggle-version-2").toggleClass("tvd-hide",!e),this.$(".tvd-toggle-version-1").toggleClass("tvd-hide",e),this.$("#tvd-hs-api-key").val(n)},showExtraOptions:function(){if(this.$(".tvd-extra-options").removeClass("tvd-hide"),"mailchimp"===this.model.get("key")){var e=this.$("#tvd-show-mandrill-options").is(":checked");this.$("#tvd-show-mandrill-options").val(e),this.model.set({show_mandrill:e}),e||this.$(".tvd-extra-options").addClass("tvd-hide")}TVE_Dash.materialize(this.$el)},hideExtraOptions:function(){this.$(".tvd-extra-options").addClass("tvd-hide")},addChip:function(t){if(13===t.keyCode){var n=e(t.target);if(n.val().length){var s=e("<input/>").attr("type","hidden").attr("name",n.data("name")).val(n.val()),i=e('<div class="tvd-chip">'+n.val()+'<i class="tvd-icon-close2"></i></div>');i.on("click",".tvd-icon-close2",_.bind(this.deleteChip,this)),this.$el.find("form").prepend(s),this.$el.find(".tvd-api-chip-wrapper").append(i),n.val("")}}},deleteChip:function(t){var n=e(t.target).parent(),s=n.contents().filter((function(){return 3===this.nodeType})).text();this.$el.find('input[value="'+s+'"]').remove(),n.remove()},connect:function(t){var n=this.$el.find("form").serialize(),s={},i={},o=[];e.each(this.$el.find("form").serializeArray(),(function(e,t){s[t.name]=t.value,t.name.includes("connection[")?o[t.name.replace("connection[","").replace("]","")]=t.value:i[t.name]=t.value})),i.connection=o,n+="&action="+TVE_Dash_Const.actions.api_handle_save;let a=!1;t.currentTarget&&t.currentTarget.className&&t.currentTarget.className.includes("tvd-api-upgrade-v3")&&(n+=`&${i.api}-upgraded=1`,a=!0);var c=this,d=e.ajax({url:ajaxurl,type:"post",dataType:"json",data:n});TVE_Dash.cardLoader(this.$el),d.fail((function(e){TVE_Dash.hideCardLoader(c.$el),c.model.set("response",{success:!1,message:TVE_Dash_Const.translations.UnknownError}),c.model.set("state","error")})),d.done((function(e){if(TVE_Dash.hideCardLoader(c.$el),e.success)if("0"===e)c.model.set("response",{success:!1,message:TVE_Dash_Const.translations.UnknownError}),c.model.set("state","error");else{c.model.set("credentials",i),c.model.set("new_credentials",1),c.model.set("response",e),c.model.set("state","success");var t=TVE_Dash.API.AvailableAPIs.findWhere({key:c.model.get("key")});t&&t.set("credentials",i),TVE_Dash.LocalStorage.set("tve_new_api",{key:s.api,name:c.model.get("title")}),-1!==window.location.hash.indexOf("tve_new_api")&&setTimeout((function(){window.close()}),2e3),a&&window.location.reload()}else c.model.set("response",e),c.model.set("state","error")}))},redirect:function(){var t=this.$el.find("form").serialize(),n={};e.each(this.$el.find("form").serializeArray(),(function(e,t){n[t.name]=t.value})),t+="&action="+TVE_Dash_Const.actions.api_handle_redirect;var s={};for(var i in this.model.get("credentials"))s[i]=n["connection["+i+"]"];var o=this,a=e.ajax({url:ajaxurl,type:"post",dataType:"json",data:t});TVE_Dash.cardLoader(this.$el),a.fail((function(e){TVE_Dash.hideCardLoader(o.$el),o.model.set("response",{success:!1,message:TVE_Dash_Const.translations.UnknownError}),o.model.set("state","error")})),a.done((function(e){e.success?"0"===e?(o.model.set("response",{success:!1,message:TVE_Dash_Const.translations.UnknownError}),o.model.set("state","error")):window.location.href=e.message:(o.model.set("response",e),o.model.set("state","error")),TVE_Dash.hideCardLoader(o.$el)}))}}),TVE_Dash.API.views.ErrorState=Backbone.View.extend({className:"tvd-col tvd-s6 tvd-ms6 tvd-m4 tvd-l3",events:{"click .tvd-api-cancel":function(){this.model.set("state","new")},"click .tvd-api-retry":function(){this.model.set("state","form")}},render:function(){return this.$el.html(TVE_Dash.tpl("tvd-api-state-error",{item:this.model})),this}}),TVE_Dash.API.views.SuccessState=Backbone.View.extend({className:"tvd-col tvd-s6 tvd-ms6 tvd-m4 tvd-l3",events:{"click .tvd-api-done":function(){var e=TVE_Dash.API.AvailableAPIs.findWhere({key:this.model.get("key")});e.set("connected",!0),e.set("state","connected"),this.model.clear({silent:!0}),this.model.set("state","new"),TVE_Dash.API.ConnectedAPIs.push(e),TVE_Dash.API.AvailableAPIs.remove(e)}},render:function(){return this.$el.html(TVE_Dash.tpl("tvd-api-state-success",{item:this.model})),this}}),TVE_Dash.API.views.ToBeConnected=Backbone.View.extend({className:"tvd-col",initialize:function(){this.listenTo(this.model,"change:state",_.bind(this.renderState,this))},render:function(){return this.collection.getAPIs(!1).length<=0?(this.$el.html(""),this):(this.renderState(),this)},renderState:function(){var t=this.model.get("state")[0].toUpperCase()+this.model.get("state").slice(1);if(TVE_Dash.API.views[t+"State"])var n=new TVE_Dash.API.views[t+"State"]({model:this.model,collection:this.collection});else n=new TVE_Dash.API.views.NewState({model:this.model});n.render(),this.$el.replaceWith(n.$el),this.setElement(n.$el),this.$el.find("select").select2(),this.$el.find("#selected-api").on("select2:open",(function(t){0===e(".select2-dropdown .tvd-request-api").length&&e(".select2-dropdown").append('<div class="tvd-request-api"><a href="https://thrivethemes.com/request-a-new-api-integration/" target="_blank">REQUEST A NEW INTEGRATION</a></div>')})),"zapier"===this.model.get("key")&&(TVE_Dash.bindZClip(e(".tvd-zapier-copy-key")),TVE_Dash.bindZClip(e(".tvd-zapier-copy-url")))}}),TVE_Dash.API.views.ConnectionEdit=TVE_Dash.API.views.FormState.extend({}),TVE_Dash.API.views.App=Backbone.View.extend({el:".tvd-api-list",initialize:function(){this.listenTo(this.collection,"add",_.bind(this.renderConnection,this))},render:function(){this.$el.html(""),this.renderAddNewConnection(TVE_Dash.API.ToBeConnected),this.collection.each(this.renderConnection,this)},renderConnection:function(e){var t=new TVE_Dash.API.views.Connection({model:e,collection:this.collection});this.$el.find("> .tvd-col").last().before(t.render().$el)},renderAddNewConnection:function(e){var t=new TVE_Dash.API.views.ToBeConnected({model:e,collection:TVE_Dash.API.AvailableAPIs});this.$el.append(t.render().$el)}}),TVE_Dash.API.views.ThirdPartyList=Backbone.View.extend({el:".tvd-third-party-api-list",render:function(){this.$el.empty(),this.collection.each(this.renderConnection,this)},renderConnection:function(e){this.$el.append(TVE_Dash.tpl("tvd-third-party-api",{item:e}))}}),TVE_Dash.API.customActions={wordpressToggleState:function(t){const n=t.model,s=1===parseInt(n.get("credentials").registration_disabled)?0:1;TVE_Dash.cardLoader(t.$el);const i=e.ajax({url:ajaxurl,type:"post",dataType:"json",data:{action:TVE_Dash_Const.actions.api_handle_save,api:"wordpress",registration_disabled:s}});return i.done((()=>{const e=s?"Connection disabled":"Connection enabled";n.set("credentials",{connected:!0,registration_disabled:s}),n.set("status_icon",`<span data-tooltip="${e}" class="tvd-api-status-icon tvd-tooltipped status-${s?"red":"green"}"></span>`),n.set("state","connected"),TVE_Dash[s?"err":"success"](e),TVE_Dash.LocalStorage.set("connection_edit_wordpress",{registration_disabled:s}),"autoclose"===n.get("customAction")&&setTimeout((function(){window.close()}),1500)})),i.always((()=>{TVE_Dash.hideCardLoader(t.$el)})),!1}},e((function(){window.app=new TVE_Dash.API.views.App({collection:TVE_Dash.API.ConnectedAPIs}),window.app.render(),TVE_Dash.API.ThirdPartyAPIs.length>0&&new TVE_Dash.API.views.ThirdPartyList({collection:TVE_Dash.API.ThirdPartyAPIs}).render(),TVE_Dash.API.router=new n,Backbone.history.start(),TVE_Dash.showLoader(),setTimeout((function(){e(".tvd-show-onload").removeClass("tvd-hide"),TVE_Dash.hideLoader()}),200)}))}(jQuery)})();