!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=jQuery,n=e.n(t),a=lodash,r=wp.i18n,l=wp.element,o=wp.components,i=React;function c(e){return e.startsWith("{{/")?{type:"componentClose",value:e.replace(/\W/g,"")}:e.endsWith("/}}")?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.startsWith("{{")?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}function s(e,t){let n,a,r=[];for(let l=0;l0,v=rankMath.contentAiMigrating;if(f&&m&&!k&&rankMath.contentAICredits<500&&(f=!1),h&&d&&f&&!v&&!k)return null;var _,g="width-"+n;return!h||!d||f&&k?wp.element.createElement("div",{id:"rank-math-pro-cta",className:"center rank-math-content-ai-warning-wrapper"},wp.element.createElement("div",{className:"rank-math-cta-box blue-ticks top-20 less-padding "+g},wp.element.createElement("h3",null,(0,r.__)("🚀 Supercharge Your Content With AI","rank-math")),wp.element.createElement("p",null,!h&&!c&&(0,r.__)("Start using Content AI by connecting your RankMath.com Account","rank-math"),h&&!d&&!c&&!k&&(0,r.__)("To access this Content AI feature, you need to have an active subscription plan.","rank-math"),h&&!c&&k&&(0,r.__)("To access this Content AI feature, you have to purchase a Content AI Subscription.","rank-math"),c&&(0,r.__)("You are one step away from unlocking this premium feature along with many more.","rank-math")),function(e,t,n){return t?wp.element.createElement("ul",null,wp.element.createElement("li",null,(0,r.__)("Bulk Update Your SEO Meta using AI","rank-math")),wp.element.createElement("li",null,(0,r.__)("Get Access to 40+ AI SEO Tools","rank-math")),wp.element.createElement("li",null,(0,r.__)("125+ Expert-Written Prompts","rank-math")),wp.element.createElement("li",null,(0,r.__)("1-Click Competitor Content Research","rank-math")),wp.element.createElement("li",null,(0,r.__)("1-Click WooCommerce Product Descriptions","rank-math"))):n?wp.element.createElement("ul",null,wp.element.createElement("li",null,(0,r.__)("1-Click Competitor Research","rank-math")),wp.element.createElement("li",null,(0,r.__)("On-Page SEO Suggestions","rank-math")),wp.element.createElement("li",null,(0,r.__)("1-Click Bulk SEO Meta","rank-math")),wp.element.createElement("li",null,(0,r.__)("125+ Pre-Built Prompts","rank-math")),wp.element.createElement("li",null,(0,r.__)("Multiple RankBot Sessions","rank-math"))):40===e?wp.element.createElement("ul",null,wp.element.createElement("li",null,(0,r.__)("1-Click SEO Content","rank-math")),wp.element.createElement("li",null,(0,r.__)("1-Click SEO Meta","rank-math")),wp.element.createElement("li",null,(0,r.__)("40+ Specialized AI Tools","rank-math")),wp.element.createElement("li",null,(0,r.__)("1-Click Competitor Research","rank-math")),wp.element.createElement("li",null,(0,r.__)("125+ Pre-Built Prompts","rank-math"))):wp.element.createElement("ul",null,wp.element.createElement("li",null,(0,r.__)("Gain access to 40+ advanced AI tools, empowering your content strategy.","rank-math")),wp.element.createElement("li",null,(0,r.__)("Experience the revolutionary AI-powered Content Editor for unparalleled efficiency.","rank-math")),wp.element.createElement("li",null,(0,r.__)("Engage with RankBot, your personal AI Chat Assistant, for real-time assistance.","rank-math")))}(n,c,k),!h&&wp.element.createElement(o.Button,{href:rankMath.connectSiteUrl,className:"button button-primary is-green"},(0,r.__)("Connect Now","rank-math")),h&&(!d||k)&&wp.element.createElement(o.Button,{href:p(rankMath.links["content-ai"]+"?play-video=ioPeVIntJWw","Buy+Plan+Button"),className:"button button-primary is-green",target:"_blank"},(0,r.__)("Learn More","rank-math")))):v?wp.element.createElement("div",{id:"rank-math-pro-cta",className:"center rank-math-content-ai-warning-wrapper"},wp.element.createElement("div",{style:{textAlign:"center"},className:"rank-math-cta-box less-padding top-20 "+g},wp.element.createElement("h3",null,(0,r.__)("Server Maintenance Underway","rank-math")),wp.element.createElement("p",null,(0,r.__)("We are working on improving your Content AI experience. Please wait for 5 minutes and then refresh to start using the optimized Content AI. If you see this for more than 5 minutes, please ","rank-math"),wp.element.createElement("a",{href:rankMath.links.support,target:"_blank",rel:"noreferrer"},(0,r.__)("reach out to the support team.","rank-math")),(0,r.__)(" We are sorry for the inconvenience.","rank-math")))):wp.element.createElement("div",{id:"rank-math-pro-cta",className:"center rank-math-content-ai-warning-wrapper"},wp.element.createElement("div",{className:"rank-math-cta-box less-padding top-20 "+g},wp.element.createElement("h3",null,(0,r.__)("⛔️ Content AI Credit Alert!","rank-math")),wp.element.createElement("p",null,(_=rankMath.contentAIRefreshDate?rankMath.contentAIRefreshDate:"")?wp.element.createElement(u,{components:{strong:wp.element.createElement("strong",null)}},(0,r.sprintf)((0,r.__)("Your monthly Content AI credits have been fully utilized. You can wait till %s for your credits to refresh or upgrade to continue enjoying seamless content creation","rank-math"),"{{strong}}"+_+"{{/strong}}")):(0,r.__)("Your monthly Content AI credits have been fully utilized. To continue enjoying seamless content creation, simply click the button below to upgrade your plan and access more credits.","rank-math")),wp.element.createElement(o.Button,{href:p(rankMath.links["content-ai"]+"?play-video=ioPeVIntJWw","Buy+Credits+Button"),className:"button button-primary is-green",target:"_blank"},(0,r.__)("Learn More","rank-math")),wp.element.createElement(o.Button,{variant:"link",href:p(rankMath.links["content-ai-restore-credits"],"Buy+Credits+Button"),className:"button button-secondary",target:"_blank"},(0,r.__)("Missing Credits?","rank-math"))))};function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function k(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,r=function(){};return{s:r,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,o=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){i=!0,l=e},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw l}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n'),e.wrapInner(""),e.append(' '+(0,r.__)("Save All Edits","rank-math")+' '+(0,r.__)("Cancel","rank-math")+"")})),e.on("click",".dashicons-edit, .rank-math-column-cancel-all",(function(t){t.preventDefault();var a=n()(this).closest("th");n()(this).hasClass("rank-math-column-cancel-all")?(e.removeClass("bulk-editing"),n()(".rank-math-column-cancel","td.bulk-editing.dirty").trigger("click"),n()("td.bulk-editing").removeClass("bulk-editing")):(a.toggleClass("bulk-editing"),n()("td.column-"+a.attr("id")).toggleClass("bulk-editing"))}))}},{key:"bulkEvents",value:function(){var e=this,t=n()(".tablenav .bulkactions select");t.find('option[value="rank_math_ai_options"]').attr("disabled","disabled"),t.find('option[value="rank_math_options"]').attr("disabled","disabled");var r=["rank_math_content_ai_fetch_seo_title","rank_math_content_ai_fetch_seo_description","rank_math_content_ai_fetch_seo_title_description"];t.on("change",(function(){var n=t.val();!(0,a.includes)(r,n)||rankMath.isUserRegistered&&rankMath.contentAICredits&&rankMath.contentAIPlan&&"free"!==rankMath.contentAIPlan||(t.val("-1").change(),e.showCTABox()),(0,a.startsWith)(n,"rank_math_bulk")&&!rankMath.isProActive&&(t.val("-1").change(),e.showCTABox(!0))}))}},{key:"showCTABox",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,a.isNull)(document.getElementById("rank-math-content-ai-modal-wrapper"))&&n()("#wpwrap").append('
'),setTimeout((function(){(0,l.render)(wp.element.createElement(o.Modal,{className:"rank-math-contentai-modal rank-math-modal rank-math-error-modal",onRequestClose:function(){n()(".components-modal__screen-overlay").remove(),document.getElementById("rank-math-content-ai-modal-wrapper").remove()},shouldCloseOnClickOutside:!0},wp.element.createElement(h,{width:100,showProNotice:e,isBulkEdit:!0})),document.getElementById("rank-math-content-ai-modal-wrapper"))}),100)}},{key:"editingEvents",value:function(){n()(".rank-math-column-value").on("input",(function(){var e=n()(this),t=e.closest("td");e.val()!==e.prev().text()?t.addClass("dirty"):t.removeClass("dirty")})).on("keypress",(function(e){if(13===e.keyCode)return n()(this).parent().find(".rank-math-column-save").trigger("click"),!1})),n()(".rank-math-column-cancel").on("click",(function(e){e.preventDefault();var t=n()(this).closest("td");t.removeClass("dirty");var a=t.find(".rank-math-column-value").prev(".rank-math-column-display");a.find("span").length&&(a=a.find("span"));var r=a.html(),l=r.match(/]*?src=("|')([^"']+)">/gm);if(l){var o,i=k(l);try{for(i.s();!(o=i.n()).done;){var c=o.value,s=c.match(/alt=("|')([^"']+)/gm)[0];s=s.replace('alt="',""),r=r.replaceAll(c,s)}}catch(e){i.e(e)}finally{i.f()}}t.find(".rank-math-column-value").val(r)}))}},{key:"saveEvents",value:function(){var e=this;n()(".rank-math-column-save-all").on("click",(function(t){t.preventDefault();var a=n()(this),r={},l=[];if(n()(".dirty.bulk-editing").each((function(){var e=n()(this),t=parseInt(e.closest("tr").attr("id").replace("post-","")),a=e.find(".rank-math-column-value");l.push(e),r[t]=r[t]||{},r[t][a.data("field")]=a.val()})),n().isEmptyObject(r))return n()(a.next()).trigger("click"),!0;e.save(r).done((function(t){t.success&&(l.forEach((function(t){e.setColumn(t)})),n()(a.next()).trigger("click"))}))})),n()(".rank-math-column-save").on("click",(function(t){t.preventDefault();var a=n()(this).closest(".dirty"),r=parseInt(a.closest("tr").attr("id").replace("post-","")),l=a.find(".rank-math-column-value"),o={};o[r]={},o[r][l.data("field")]=l.val(),e.save(o).done((function(t){t.success&&e.setColumn(a)}))}))}},{key:"setColumn",value:function(e){e.removeClass("dirty bulk-editing");var t=e.find(".rank-math-column-value").prev(".rank-math-column-display");t.find("span").length&&(t=t.find("span"));var n=e.find(".rank-math-column-value").val();t.text(n)}},{key:"save",value:function(e){return n().ajax({url:rankMath.endpoint+"/updateMetaBulk",method:"POST",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",rankMath.restNonce)},data:{rows:e}})}}],i&&v(t.prototype,i),c&&v(t,c),Object.defineProperty(t,"prototype",{writable:!1}),e}();n()((function(){new _}))}();