You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
81 KiB
JavaScript
1 line
81 KiB
JavaScript
!function(){"use strict";var t={n:function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,{a:r}),r},d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{deleteSchema:function(){return pe},refreshResults:function(){return Wt},resetDirtyMetadata:function(){return J},resetRedirection:function(){return ct},saveSchema:function(){return le},saveTemplate:function(){return fe},schemaUpdated:function(){return ne},setEditingSchemaId:function(){return ie},setEditorTab:function(){return ae},setTemplateTab:function(){return oe},setVersion:function(){return Jt},toggleFrontendScore:function(){return K},toggleIsDiviPageSettingsBarActive:function(){return $t},toggleIsDiviRankMathModalActive:function(){return qt},toggleLoaded:function(){return Gt},toggleSchemaEditor:function(){return ee},toggleSchemaTemplates:function(){return re},toggleSnippetEditor:function(){return gt},updateAIScore:function(){return he},updateAdvancedRobots:function(){return B},updateAnalysisScore:function(){return z},updateAppData:function(){return N},updateAppUi:function(){return F},updateBreadcrumbTitle:function(){return W},updateCanonicalUrl:function(){return G},updateDescription:function(){return nt},updateEditSchema:function(){return se},updateEditSchemas:function(){return ue},updateFacebookDescription:function(){return q},updateFacebookHasOverlay:function(){return X},updateFacebookImage:function(){return Y},updateFacebookImageID:function(){return Q},updateFacebookImageOverlay:function(){return Z},updateFacebookTitle:function(){return $},updateFeaturedImage:function(){return it},updateHasRedirect:function(){return st},updateHighlightedParagraphs:function(){return Yt},updateKeywords:function(){return L},updateKeywordsData:function(){return de},updatePermalink:function(){return et},updatePillarContent:function(){return H},updatePostID:function(){return tt},updatePrimaryTermID:function(){return at},updateRedirection:function(){return ot},updateRedirectionItem:function(){return ut},updateRobots:function(){return V},updateSchemas:function(){return ce},updateSelectedKeyword:function(){return Bt},updateSerpDescription:function(){return yt},updateSerpSlug:function(){return mt},updateSerpTitle:function(){return ht},updateSnippetPreviewType:function(){return vt},updateSocialTab:function(){return Vt},updateTitle:function(){return rt},updateTwitterAppCountry:function(){return zt},updateTwitterAppDescription:function(){return Ct},updateTwitterAppGoogleplayID:function(){return Lt},updateTwitterAppGoogleplayName:function(){return Ht},updateTwitterAppGoogleplayUrl:function(){return Kt},updateTwitterAppIpadID:function(){return Ut},updateTwitterAppIpadName:function(){return Nt},updateTwitterAppIpadUrl:function(){return Ft},updateTwitterAppIphoneID:function(){return Mt},updateTwitterAppIphoneName:function(){return xt},updateTwitterAppIphoneUrl:function(){return Rt},updateTwitterAuthor:function(){return _t},updateTwitterCardType:function(){return kt},updateTwitterDescription:function(){return St},updateTwitterHasOverlay:function(){return Dt},updateTwitterImage:function(){return Pt},updateTwitterImageID:function(){return Tt},updateTwitterImageOverlay:function(){return It},updateTwitterPlayerSize:function(){return Ot},updateTwitterPlayerStreamCtype:function(){return At},updateTwitterPlayerStreamUrl:function(){return jt},updateTwitterPlayerUrl:function(){return Et},updateTwitterTitle:function(){return wt},updateTwitterUseFacebook:function(){return bt}});var r={};t.r(r),t.d(r,{appData:function(){return Se},appUi:function(){return Ee}});var n={};t.r(n),t.d(n,{getAdvancedRobots:function(){return Re},getAnalysisScore:function(){return Ae},getAppData:function(){return Oe},getBreadcrumbTitle:function(){return Ne},getCanonicalUrl:function(){return Ue},getContentAIScore:function(){return Zr},getDescription:function(){return ir},getDirtyMetadata:function(){return je},getEditSchemas:function(){return _r},getEditingSchema:function(){return Tr},getEditorTab:function(){return Dr},getFacebookAuthor:function(){return Ye},getFacebookDescription:function(){return qe},getFacebookHasOverlay:function(){return Ze},getFacebookImage:function(){return Xe},getFacebookImageID:function(){return Qe},getFacebookImageOverlay:function(){return tr},getFacebookTitle:function(){return $e},getFeaturedImage:function(){return ar},getFeaturedImageHtml:function(){return or},getHighlightedParagraphs:function(){return Je},getKeywords:function(){return Ce},getKeywordsData:function(){return Xr},getPermalink:function(){return nr},getPillarContent:function(){return Me},getPostID:function(){return er},getPreviewSchema:function(){return Pr},getPrimaryTermID:function(){return ur},getRedirectionID:function(){return cr},getRedirectionItem:function(){return pr},getRedirectionType:function(){return sr},getRedirectionUrl:function(){return lr},getRichSnippets:function(){return Fe},getRobots:function(){return xe},getSchemas:function(){return Sr},getSelectedKeyword:function(){return Ke},getSerpDescription:function(){return yr},getSerpSlug:function(){return mr},getSerpTitle:function(){return hr},getShowScoreFrontend:function(){return Le},getSnippetPreviewType:function(){return vr},getSocialTab:function(){return ze},getTemplateTab:function(){return Ir},getTitle:function(){return rr},getTwitterAppCountry:function(){return Jr},getTwitterAppDescription:function(){return Nr},getTwitterAppGoogleplayID:function(){return Br},getTwitterAppGoogleplayName:function(){return Vr},getTwitterAppGoogleplayUrl:function(){return Wr},getTwitterAppIpadID:function(){return Kr},getTwitterAppIpadName:function(){return zr},getTwitterAppIpadUrl:function(){return Gr},getTwitterAppIphoneID:function(){return Fr},getTwitterAppIphoneName:function(){return Lr},getTwitterAppIphoneUrl:function(){return Hr},getTwitterAuthor:function(){return Cr},getTwitterCardType:function(){return Or},getTwitterDescription:function(){return Ar},getTwitterHasOverlay:function(){return Rr},getTwitterImage:function(){return xr},getTwitterImageID:function(){return Mr},getTwitterImageOverlay:function(){return Ur},getTwitterPlayerSize:function(){return qr},getTwitterPlayerStream:function(){return Yr},getTwitterPlayerStreamCtype:function(){return Qr},getTwitterPlayerUrl:function(){return $r},getTwitterTitle:function(){return jr},getTwitterUseFacebook:function(){return Er},hasRedirect:function(){return fr},hasSchemaUpdated:function(){return wr},isDiviPageSettingsBarActive:function(){return Ve},isDiviRankMathModalActive:function(){return We},isLoaded:function(){return He},isPro:function(){return Be},isRefreshing:function(){return Ge},isSchemaEditorOpen:function(){return br},isSchemaTemplatesOpen:function(){return kr},isSnippetEditorOpen:function(){return gr}});var i=jQuery,a=t.n(i),o=lodash,u=rankMathAnalyzer,c=wp.hooks,s=wp.data,l=wp.element,p=wp.i18n;var f=wp.apiFetch,d=t.n(f),h={"&":"&",""":'"',"'":"'"},m=/&(?:amp|quot|#(0+)?39);/g,y=RegExp(m.source);var g=function(t){return t&&y.test(t)?t.replace(m,(function(t){return h[t]||"'"})):t||""};function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function b(){b=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var a=e&&e.prototype instanceof g?e:g,o=Object.create(a.prototype),u=new C(n||[]);return i(o,"_invoke",{value:E(t,r,u)}),o}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f="suspendedStart",d="suspendedYield",h="executing",m="completed",y={};function g(){}function k(){}function w(){}var S={};s(S,o,(function(){return this}));var _=Object.getPrototypeOf,T=_&&_(_(M([])));T&&T!==r&&n.call(T,o)&&(S=T);var P=w.prototype=g.prototype=Object.create(S);function D(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function I(t,e){function r(i,a,o,u){var c=p(t[i],t,a);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==v(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,o,u)}),(function(t){r("throw",t,o,u)})):e.resolve(l).then((function(t){s.value=t,o(s)}),(function(t){return r("throw",t,o,u)}))}u(c.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function E(e,r,n){var i=f;return function(a,o){if(i===h)throw new Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var u=n.delegate;if(u){var c=O(u,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=h;var s=p(e,r,n);if("normal"===s.type){if(i=n.done?m:d,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(i=m,n.method="throw",n.arg=s.arg)}}}function O(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=p(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(v(e)+" is not iterable")}return k.prototype=w,i(P,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:k,configurable:!0}),k.displayName=s(w,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===k||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,s(t,c,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},D(I.prototype),s(I.prototype,u,(function(){return this})),e.AsyncIterator=I,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new I(l(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},D(P),s(P,c,"Generator"),s(P,o,(function(){return this})),s(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=M,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return u.type="throw",u.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],u=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function k(t,e,r,n,i,a,o){try{var u=t[a](o),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,i)}function w(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){k(a,n,i,o,u,"next",t)}function u(t){k(a,n,i,o,u,"throw",t)}o(void 0)}))}}function S(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,a=void 0,a=function(t,e){if("object"!==v(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===v(a)?a:String(a)),n)}var i,a}var _=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.analyzer=new u.Analyzer({i18n:p,analyses:rankMath.assessor.researchesTests}),this.dataCollector=e,this.promises=[],this.hooks(),this.registerRefresh(),this.saveEvent()}var e,r,n;return e=t,r=[{key:"hooks",value:function(){this.updateKeywordResult=this.updateKeywordResult.bind(this),this.sanitizeData=this.sanitizeData.bind(this),this.addScoreElem=this.addScoreElem.bind(this),(0,c.addAction)("rankMath_analysis_keywordUsage_updated","rank-math",this.updateKeywordResult),(0,c.addFilter)("rank_math_sanitize_meta_value","rank-math",this.sanitizeData),(0,c.addFilter)("rank_math_sanitize_data","rank-math",this.sanitizeData),(0,c.addAction)("rank_math_loaded","rank-math",this.addScoreElem,11)}},{key:"addScoreElem",value:function(){var t=this;rankMath.showScore&&rankMath.canUser.analysis&&rankMath.canUser.general&&(this.scoreElem=a()('<div class="misc-pub-section rank-math-seo-score"></div>'),a()("#misc-publishing-actions").append(this.scoreElem),setTimeout((function(){t.scoreText='<span class="score-text"><span class="score-icon"><i class="rm-icon-rank-math"></i></span> SEO: <strong>Not available</strong></span>',t.scoreElem.html(t.scoreText),t.scoreText=t.scoreElem.find("strong"),t.fkScoreText='<span class="score-text">Not available</span>',t.fkScoreElem=a()('<div class="rank-math-seo-score below-focus-keyword">'+t.fkScoreText+"</div>"),t.fkScoreText=t.fkScoreElem.find("span"),a()("#rank-math-metabox-wrapper .rank-math-focus-keyword").find("tags").parent("div").append(t.fkScoreElem),t.updateScore=t.updateScore.bind(t),t.updateScore(),(0,c.addAction)("rank_math_refresh_results","rank-math",t.updateScore)}),1500))}},{key:"updateScore",value:function(){var t,e=rankMathEditor.resultManager.getScore(rankMathEditor.getPrimaryKeyword()),r=100<(t=e)?"bad-fk dark":80<t?"good-fk":50<t?"ok-fk":"bad-fk";this.scoreElem.removeClass("loading bad-fk ok-fk good-fk"),this.fkScoreElem.removeClass("loading bad-fk ok-fk good-fk"),this.scoreElem.addClass(r),this.fkScoreElem.addClass(r),this.scoreText.html(e+" / 100"),this.fkScoreText.html(e+" / 100")}},{key:"sanitizeData",value:function(t,e){return"schemas"===e||(0,o.isObject)(t)||(0,o.isEmpty)(t)?t:u.Helpers.sanitizeAppData(t)}},{key:"getPaper",value:function(t,e){var r=this.dataCollector.getData(),n=new u.Paper("",{locale:rankMath.localeFull});return n.setTitle((0,s.select)("rank-math").getSerpTitle()),n.setPermalink(r.slug),n.setDescription((0,s.select)("rank-math").getSerpDescription()),n.setUrl(r.permalink),n.setText(g((0,c.applyFilters)("rank_math_content",r.content))),n.setKeyword(t),n.setKeywords(e),n.setSchema((0,s.select)("rank-math").getSchemas()),(0,o.isUndefined)(r.featuredImage)||(n.setThumbnail(r.featuredImage.source_url),n.setThumbnailAltText(u.Helpers.removeDiacritics(r.featuredImage.alt_text))),(0,o.isEmpty)((0,s.select)("rank-math").getContentAIScore())&&(0,o.isEmpty)(rankMath.ca_keyword)||n.setContentAI(!0),n}},{key:"registerRefresh",value:function(){var t=this;this.refresh=(0,o.debounce)((function(e){if(!1!==(0,s.select)("rank-math").isLoaded()){var r=(0,s.select)("rank-math").getKeywords().split(","),n=[];(0,c.doAction)("rank_math_"+e+"_refresh"),r.map((function(e,i){var a=t.getPaper(u.Helpers.removeDiacritics(e),r),o=0===i?rankMath.assessor.researchesTests:t.filterTests(t.getSecondaryKeywordTests());n.push(t.analyzer.analyzeSome(o,a).then((function(t){rankMathEditor.resultManager.update(a.getKeyword(),t,0===i),0===i&&(0,s.dispatch)("rank-math").updateAnalysisScore(rankMathEditor.resultManager.getScore(a.getKeyword()))}))),Promise.all(n).then((function(){(0,s.dispatch)("rank-math").refreshResults(),t.refreshResults()}))}))}}),500)}},{key:"updateKeywordResult",value:function(t,e){rankMathEditor.resultManager.update(t,{keywordNotUsed:e}),t===rankMathEditor.getSelectedKeyword().toLowerCase()&&(0,s.dispatch)("rank-math").refreshResults()}},{key:"getSecondaryKeywordTests",value:function(){return["keywordInContent","lengthContent","keywordInSubheadings","keywordDensity","lengthPermalink","linksHasExternals","linksNotAllExternals","linksHasInternal","titleSentiment","titleHasPowerWords","titleHasNumber","contentHasTOC","contentHasShortParagraphs","contentHasAssets"]}},{key:"getPrimaryKeyword",value:function(){var t=(0,s.select)("rank-math").getKeywords();return u.Helpers.removeDiacritics(t.split(",")[0])}},{key:"getSelectedKeyword",value:function(){var t=(0,s.select)("rank-math").getKeywords(),e=(0,s.select)("rank-math").getSelectedKeyword(),r=""!==e.data.value?e.data.value:t.split(",")[0];return u.Helpers.removeDiacritics(r)}},{key:"getResearch",value:function(t){return this.analyzer.researcher.getResearch(t)}},{key:"refreshResults",value:function(){(0,c.doAction)("rank_math_refresh_results")}},{key:"filterTests",value:function(t){return(0,o.intersection)(t,rankMath.assessor.researchesTests)}},{key:"saveEvent",value:function(){var t=this;if(!(0,o.isUndefined)(this.dataCollector.form)&&!(0,o.isUndefined)(this.dataCollector.updateBtn)){var e=!0;this.dataCollector.form.on("submit",(function(r){if(e&&!(0,o.isUndefined)(r.originalEvent)){r.preventDefault();var n=t.dataCollector.updateBtn.data("disable")&&t.dataCollector.saveDraft.length?t.dataCollector.saveDraft:t.dataCollector.updateBtn;n.addClass("disabled").parent().find(".spinner").addClass("is-active"),e=!1;var i=t.saveMeta(),a=t.saveSchemas(i),u=t.saveRedirection(a);return Promise.all([i,a,u]).then((function(){n.removeClass("disabled").trigger("click")})).catch((function(){n.removeClass("disabled").trigger("click")})),!1}}))}}},{key:"saveMeta",value:function(){return new Promise((function(t){var e=(0,s.select)("rank-math").getDirtyMetadata();(0,o.isEmpty)(e)?t(!0):(d()({method:"POST",path:"rankmath/v1/updateMeta",data:{objectID:rankMath.objectID,objectType:rankMath.objectType,meta:e,content:rankMathEditor.assessor.dataCollector.getContent()}}).then((function(){t(!0)})).catch((function(){t(!0)})),(0,s.dispatch)("rank-math").resetDirtyMetadata())}))}},{key:"saveRedirection",value:function(t){return new Promise(function(){var e=w(b().mark((function e(r){var n,i,a;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(n=(0,s.select)("rank-math").getRedirectionItem(),!(0,o.isEmpty)(n)){e.next=6;break}return r(!0),e.abrupt("return");case 6:n.objectID=window.rankMath.objectID,n.objectType=window.rankMath.objectType,n.redirectionSources=rankMathEditor.assessor.dataCollector.getData("permalink"),i=(0,s.dispatch)("rank-math"),a=(0,s.dispatch)("core/notices"),i.resetRedirection(),d()({method:"POST",path:"rankmath/v1/updateRedirection",data:n}).then((function(t){"delete"===t.action?(a.createInfoNotice(t.message,{id:"redirectionNotice"}),i.updateRedirection("redirectionID",0)):"update"===t.action?a.createInfoNotice(t.message,{id:"redirectionNotice"}):"new"===t.action&&(i.updateRedirection("redirectionID",t.id),a.createSuccessNotice(t.message,{id:"redirectionNotice"})),setTimeout((function(){a.removeNotice("redirectionNotice")}),2e3),r(!0)})).catch((function(){r(!0)}));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"saveSchemas",value:function(t){return new Promise(function(){var e=w(b().mark((function e(r){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(n=(0,s.select)("rank-math").getSchemas(),!(0,o.isEmpty)(n)&&(0,s.select)("rank-math").hasSchemaUpdated()){e.next=6;break}return r(!0),e.abrupt("return");case 6:d()({method:"POST",path:"rankmath/v1/updateSchemas",data:{objectID:rankMath.objectID,objectType:rankMath.objectType,schemas:n}}).then((function(){r(!0)})).catch((function(){r(!0)}));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}}],r&&S(e.prototype,r),n&&S(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),T=_,P=function(){return!((0,o.isNil)(window.wp)||(0,o.isNil)(wp.data)||(0,o.isNil)(wp.data.select("core/editor"))||!window.document.body.classList.contains("block-editor-page")||!(0,o.isFunction)(wp.data.select("core/editor").getEditedPostAttribute))};function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function I(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,a=void 0,a=function(t,e){if("object"!==D(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==D(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===D(a)?a:String(a)),n)}var i,a}var E=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),rankMath.is_front_page&&((0,c.addFilter)("rankMath_analysis_contentLength","rank-math",this.contentLength),(0,c.addFilter)("rankMath_analysis_contentLength_boundaries","rank-math",this.contentLengthBoundary))}var e,r,n;return e=t,(r=[{key:"contentLength",value:function(t){return{hasScore:t.hasScore,failed:(0,p.__)("Content is %1$d words long. Consider using at least 300 words.","rank-math"),tooltipText:(0,p.__)("Minimum recommended content length should be 300 words.","rank-math"),emptyContent:(0,p.sprintf)((0,p.__)("Content should be %1$s long.","rank-math"),'<a href="https://rankmath.com/kb/score-100-in-tests/?utm_source=Plugin&utm_campaign=WP#overall-content-length" target="_blank">'+(0,p.__)("300 words","rank-math")+"</a>")}}},{key:"contentLengthBoundary",value:function(){return{recommended:{boundary:299,score:8},belowRecommended:{boundary:200,score:5},low:{boundary:50,score:2}}}}])&&I(e.prototype,r),n&&I(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function j(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,a=void 0,a=function(t,e){if("object"!==O(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===O(a)?a:String(a)),n)}var i,a}var A=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.methods=[],this.init=this.init.bind(this),this.refresh=this.refresh.bind(this),(0,c.addAction)("rank_math_loaded","rank-math",this.init)}var e,r,n;return e=t,r=[{key:"init",value:function(){this.methods.length&&rankMathEditor.refresh("content")}},{key:"registerPlugin",value:function(){console.warn("RankMathApp.registerPlugin is deprecated.")}},{key:"refresh",value:function(t){console.warn("RankMathApp.refresh is deprecated, use rankMathEditor.refresh()"),this.methods.push(t)}},{key:"reloadPlugin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"content";console.warn("RankMathApp.reloadPlugin is deprecated, use rankMathEditor.refresh()"),this.refresh(e)}}],r&&j(e.prototype,r),n&&j(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),C=A;function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function x(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R(n.key),n)}}function R(t){var e=function(t,e){if("object"!==M(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===M(e)?e:String(e)}var U=new(function(){function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=null,(r=R(r="map"))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n}var e,r,n;return e=t,(r=[{key:"swap",value:function(t,e){var r=this;if(!(t=t||""))return"";var n=new RegExp(/%(([a-z0-9_-]+)\(([^)]*)\)|[^\s]+)%/,"giu");return t.replace(" %page%","").replace("%sep% %sep%","%sep%").replace(n,(function(t){return r.replace(e,t)})).trim()}},{key:"replace",value:function(t,e){var r=e.toLowerCase().slice(1,-1);return["term_description","user_description"].includes(r)?"undefined"!=typeof tinymce&&tinymce.activeEditor&&"rank_math_description_editor"===tinymce.activeEditor.id?tinymce.activeEditor.getContent():a()("#description").val():r.includes("customfield(")?(r=r.replace("customfield(","").replace(")",""))in rankMath.customFields?rankMath.customFields[r]:"":(t=t||this.getMap(),(r="seo_description"===(r="seo_title"===(r=r.includes("(")?r.split("(")[0]:r)?"title":r)?"excerpt":r)in t?t[r]:"")}},{key:"getMap",value:function(){var t=this;return null!==this.map||(this.map={},a().each(rankMath.variables,(function(e,r){e=e.toLowerCase().replace(/%+/g,"").split("(")[0],t.map[e]=r.example}))),this.map}},{key:"setVariable",value:function(t,e){null!==this.map?this.map[t]=e:void 0!==rankMath.variables[t]&&(rankMath.variables[t].example=e)}}])&&x(e.prototype,r),n&&x(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}());function N(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return e=(0,c.applyFilters)("rank_math_sanitize_data",e,t,r),null!==n&&(n=(0,c.applyFilters)("rank_math_sanitize_meta_value",n,t,r)),n=null===n?e:n,(0,c.doAction)("rank_math_data_changed",t,e,r),{type:"RANK_MATH_APP_DATA",key:t,value:e,metaKey:r,metaValue:n}}function F(t,e){return(0,c.doAction)("rank_math_update_app_ui",t,e),{type:"RANK_MATH_APP_UI",key:t,value:e}}function L(t){return U.setVariable("focuskw",t.split(",")[0]),rankMathEditor.refresh("keyword"),N("keywords",t,"rank_math_focus_keyword")}function H(t){return N("pillarContent",t,"rank_math_pillar_content",!0===t?"on":"off")}function K(t){return N("showScoreFrontend",t,"rank_math_dont_show_seo_score",!0===t?"off":"on")}function z(t){return N("score",t,"rank_math_seo_score")}function G(t){return N("canonicalUrl",t,"rank_math_canonical_url")}function B(t){return N("advancedRobots",t,"rank_math_advanced_robots")}function V(t){return N("robots",t,"rank_math_robots",Object.keys(t))}function W(t){return N("breadcrumbTitle",t,"rank_math_breadcrumb_title")}function J(){return N("dirtyMetadata",{})}function $(t){return N("facebookTitle",t,"rank_math_facebook_title")}function q(t){return N("facebookDescription",t,"rank_math_facebook_description")}function Y(t){return N("facebookImage",t,"rank_math_facebook_image")}function Q(t){return N("facebookImageID",t,"rank_math_facebook_image_id")}function X(t){return N("facebookHasOverlay",t,"rank_math_facebook_enable_image_overlay",!0===t?"on":"off")}function Z(t){return N("facebookImageOverlay",t,"rank_math_facebook_image_overlay")}function tt(t){return rankMath.objectID=t,N("postID",t)}function et(t){return N("permalink",t,"permalink")}function rt(t){return N("title",t,"rank_math_title")}function nt(t){return N("description",t,"rank_math_description")}function it(t){return N("featuredImage",t)}function at(t,e){return N("primaryTerm",parseInt(t),"rank_math_primary_"+e)}function ot(t,e){return N(t,e)}function ut(t){return F("redirectionItem",t)}function ct(){return F("redirectionItem",{})}function st(t){return F("hasRedirect",t)}var lt=document.createElement("div");function pt(t){return t&&"string"==typeof t&&(t=t.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"").replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),lt.innerHTML=t,t=lt.textContent,lt.textContent=""),t}var ft=function(t,e){return t=(t=u.Helpers.cleanText(t)).replace(/\r?\n|\r/g," "),e?(0,o.truncate)(t,{length:e,separator:" "}):t},dt=function(t){if((0,o.isEmpty)(t))return"";t=u.Helpers.stripScript(t),t=u.Helpers.stripStyle(t),t=(0,o.unescape)(t).replace(/\[caption[^\]]*\](.*)\[\/caption\]/g,"");var e=(0,o.filter)(u.Helpers.matchParagraphs(t,!0,!0),(function(t){return""!==t.trim()}));if(!e.length)return"";var r=rankMathEditor.getPrimaryKeyword();if(""!==r){var n=(0,o.filter)(e,(function(t){return(0,o.includes)(t.toLowerCase(),r.toLowerCase())}));if(0<n.length)return ft(n[0],160)}return ft(e[0],160)};function ht(t){return t=U.swap(""!==t?t:rankMath.assessor.serpData.titleTemplate),rankMathEditor.refresh("title"),F("serpTitle",pt(t))}function mt(t){return t=""!==t?t:rankMathEditor.assessor.dataCollector.getSlug(),rankMathEditor.refresh("permalink"),F("serpSlug",t)}function yt(t){return t=U.swap(function(t){var e=rankMathEditor.assessor.dataCollector.getData(),r=e.excerpt,n=dt(e.content),i=(0,o.isUndefined)(r)||(0,o.isEmpty)(r)?n:(0,o.unescape)(r);if(U.setVariable("excerpt",i),U.setVariable("seo_description",i),""!==(t=pt((0,c.applyFilters)("rankMath/description",t))))return u.Helpers.cleanText(t);if(!(0,o.isUndefined)(r)&&!(0,o.isEmpty)(r))return u.Helpers.cleanText(r);var a=(0,o.unescape)(rankMath.assessor.serpData.descriptionTemplate);return(0,o.isUndefined)(a)||""===a?n:u.Helpers.cleanText(a)}(t)),rankMathEditor.refresh("description"),F("serpDescription",t)}function gt(t){return F("isSnippetEditorOpen",t)}function vt(t){return F("snippetPreviewType",t)}function bt(t){return N("twitterUseFacebook",t,"rank_math_twitter_use_facebook",!0===t?"on":"off")}function kt(t){return N("twitterCardType",t,"rank_math_twitter_card_type")}function wt(t){return N("twitterTitle",t,"rank_math_twitter_title")}function St(t){return N("twitterDescription",t,"rank_math_twitter_description")}function _t(t){return N("twitterAuthor",t,"rank_math_twitter_author")}function Tt(t){return N("twitterImageID",t,"rank_math_twitter_image_id")}function Pt(t){return N("twitterImage",t,"rank_math_twitter_image")}function Dt(t){return N("twitterHasOverlay",t,"rank_math_twitter_enable_image_overlay",!0===t?"on":"off")}function It(t){return N("twitterImageOverlay",t,"rank_math_twitter_image_overlay")}function Et(t){return N("twitterPlayerUrl",t,"rank_math_twitter_player_url")}function Ot(t){return N("twitterPlayerSize",t,"rank_math_twitter_player_size")}function jt(t){return N("twitterPlayerStream",t,"rank_math_twitter_player_stream")}function At(t){return N("twitterPlayerStreamCtype",t,"rank_math_twitter_player_stream_ctype")}function Ct(t){return N("twitterAppDescription",t,"rank_math_twitter_app_description")}function Mt(t){return N("twitterAppIphoneID",t,"rank_math_twitter_app_iphone_id")}function xt(t){return N("twitterAppIphoneName",t,"rank_math_twitter_app_iphone_name")}function Rt(t){return N("twitterAppIphoneUrl",t,"rank_math_twitter_app_iphone_url")}function Ut(t){return N("twitterAppIpadID",t,"rank_math_twitter_app_ipad_id")}function Nt(t){return N("twitterAppIpadName",t,"rank_math_twitter_app_ipad_name")}function Ft(t){return N("twitterAppIpadUrl",t,"rank_math_twitter_app_ipad_url")}function Lt(t){return N("twitterAppGoogleplayID",t,"rank_math_twitter_app_googleplay_id")}function Ht(t){return N("twitterAppGoogleplayName",t,"rank_math_twitter_app_googleplay_name")}function Kt(t){return N("twitterAppGoogleplayUrl",t,"rank_math_twitter_app_googleplay_url")}function zt(t){return N("twitterAppCountry",t,"rank_math_twitter_app_country")}function Gt(t){return F("isLoaded",t)}function Bt(t){return F("selectedKeyword",t)}function Vt(t){return F("socialTab",t)}function Wt(){return F("refreshResults",Date.now())}function Jt(){return F("isPro",!0)}function $t(t){return F("isDiviPageSettingsBarActive",t)}function qt(t){return F("isDiviRankMathModalActive",t)}function Yt(t){return F("highlightedParagraphs",t)}function Qt(t){return Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qt(t)}function Xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Zt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Xt(Object(r),!0).forEach((function(e){te(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function te(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Qt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Qt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Qt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ee(t){return F("isSchemaEditorOpen",t)}function re(t){return F("isSchemaTemplatesOpen",t)}function ne(t){return F("schemaUpdated",t)}function ie(t){return F("editingSchemaId",t)}function ae(t){return F("editorTab",t)}function oe(t){return F("templateTab",t)}function ue(t){return F("editSchemas",t)}function ce(t){return N("schemas",t)}function se(t,e){var r=Zt({},(0,s.select)("rank-math").getEditSchemas());return r[t]=e,F("editSchemas",r)}function le(t,e){var r=Zt({},(0,s.select)("rank-math").getSchemas());return r[t]=e,N("schemas",r)}function pe(t){var e=Zt({},(0,s.select)("rank-math").getSchemas());return delete e[t],(0,c.doAction)("rank_math_schema_trash",t),N("schemas",e,"rank_math_delete_"+t,"")}function fe(t,e,r){return d()({method:"POST",path:"rankmath/v1/saveTemplate",data:{schema:t,postId:r}}).then((function(r){e({loading:!1,showNotice:!0,postId:r.id}),setTimeout((function(){e({showNotice:!1}),(0,o.get)(rankMath,"isTemplateScreen",!1)&&(document.title=(0,p.__)("Edit Schema","rank-math"),window.history.pushState(null,"",r.link.replace(/&/g,"&")))}),2e3),rankMath.schemaTemplates.push({schema:t,title:t.metadata.title,type:t["@type"]})})),e({loading:!0}),{type:"DONT_WANT_TO_DO_SOMETHING"}}function de(t){return F("keywordsData",t)}function he(t){return N("contentAIScore",t,"rank_math_contentai_score")}function me(t){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(t)}function ye(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ge(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ye(Object(r),!0).forEach((function(e){ve(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ve(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==me(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===me(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var be=rankMath.assessor.serpData,ke=rankMath.assessor.hasRedirection,we={postID:null,title:be.title?be.title:be.titleTemplate,description:be.description,keywords:be.focusKeywords,pillarContent:be.pillarContent,featuredImage:"",permalink:!1,primaryTerm:be.primaryTerm,robots:be.robots,advancedRobots:be.advancedRobots,canonicalUrl:be.canonicalUrl,breadcrumbTitle:be.breadcrumbTitle,showScoreFrontend:be.showScoreFrontend,redirectionID:ke?(0,o.get)(rankMath.assessor,"redirection.id",""):"",redirectionType:ke?(0,o.get)(rankMath.assessor,"redirection.header_code",""):"",redirectionUrl:ke?(0,o.get)(rankMath.assessor,"redirection.url_to",""):"",facebookTitle:be.facebookTitle,facebookImage:be.facebookImage,facebookImageID:be.facebookImageID,facebookAuthor:be.facebookAuthor,facebookDescription:be.facebookDescription,facebookHasOverlay:be.facebookHasOverlay,facebookImageOverlay:be.facebookImageOverlay,twitterTitle:be.twitterTitle,twitterImage:be.twitterImage,twitterAuthor:be.twitterAuthor,twitterImageID:be.twitterImageID,twitterCardType:be.twitterCardType,twitterUseFacebook:be.twitterUseFacebook,twitterDescription:be.twitterDescription,twitterHasOverlay:be.twitterHasOverlay,twitterImageOverlay:be.twitterImageOverlay,twitterPlayerUrl:be.twitterPlayerUrl,twitterPlayerSize:be.twitterPlayerSize,twitterPlayerStream:be.twitterPlayerStream,twitterPlayerStreamCtype:be.twitterPlayerStreamCtype,twitterAppDescription:be.twitterAppDescription,twitterAppIphoneName:be.twitterAppIphoneName,twitterAppIphoneID:be.twitterAppIphoneID,twitterAppIphoneUrl:be.twitterAppIphoneUrl,twitterAppIpadName:be.twitterAppIpadName,twitterAppIpadID:be.twitterAppIpadID,twitterAppIpadUrl:be.twitterAppIpadUrl,twitterAppGoogleplayName:be.twitterAppGoogleplayName,twitterAppGoogleplayID:be.twitterAppGoogleplayID,twitterAppGoogleplayUrl:be.twitterAppGoogleplayUrl,twitterAppCountry:be.twitterAppCountry,schemas:(0,o.get)(rankMath,"schemas",{}),score:0,contentAIScore:{},dirtyMetadata:{}};function Se(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:we,e=arguments.length>1?arguments[1]:void 0,r=ge({},t.dirtyMetadata);return!1!==e.metaKey&&(r[e.metaKey]=e.metaValue),"RANK_MATH_APP_DATA"===e.type?"dirtyMetadata"===e.key?ge(ge({},t),{},{dirtyMetadata:e.value}):ge(ge({},t),{},ve(ve({},e.key,e.value),"dirtyMetadata",r)):t}function _e(t){return _e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_e(t)}function Te(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Pe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Te(Object(r),!0).forEach((function(e){De(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function De(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==_e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==_e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===_e(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ie={isLoaded:!1,isPro:!1,selectedKeyword:{tag:"",index:0,data:{value:""}},hasRedirect:rankMath.assessor.hasRedirection&&!(0,o.isEmpty)((0,o.get)(rankMath.assessor,"redirection.id",""))&&!(0,o.isEmpty)((0,o.get)(rankMath.assessor,"redirection.url_to","")),serpTitle:"",serpSlug:"",serpDescription:"",isSnippetEditorOpen:!1,snippetPreviewType:"",refreshResults:"",redirectionItem:{},socialTab:"facebook",highlightedParagraphs:[],editorTab:"",templateTab:"",editSchemas:{},editingSchemaId:"",isSchemaEditorOpen:!1,isSchemaTemplatesOpen:!1,schemaUpdated:!1,isDiviRankMathModalActive:!1,isDiviPageSettingsBarActive:!1,keywordsData:(0,o.get)(rankMath,"ca_data",[])};function Ee(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ie,e=arguments.length>1?arguments[1]:void 0;return"RANK_MATH_APP_UI"===e.type?Pe(Pe({},t),{},De({},e.key,e.value)):t}function Oe(t){return t.appData}function je(t){return t.appData.dirtyMetadata}function Ae(t){return t.appData.score}function Ce(t){return t.appData.keywords}function Me(t){return t.appData.pillarContent}function xe(t){return t.appData.robots}function Re(t){return t.appData.advancedRobots}function Ue(t){return t.appData.canonicalUrl}function Ne(t){return t.appData.breadcrumbTitle}function Fe(t){return"todo"}function Le(t){return t.appData.showScoreFrontend}function He(t){return t.appUi.isLoaded}function Ke(t){return t.appUi.selectedKeyword}function ze(t){return t.appUi.socialTab}function Ge(t){return t.appUi.refreshResults}function Be(t){return t.appUi.isPro}function Ve(t){return t.appUi.isDiviPageSettingsBarActive}function We(t){return t.appUi.isDiviRankMathModalActive}function Je(t){return t.appUi.highlightedParagraphs}function $e(t){return t.appData.facebookTitle}function qe(t){return t.appData.facebookDescription}function Ye(t){return t.appData.facebookAuthor}function Qe(t){return t.appData.facebookImageID}function Xe(t){return t.appData.facebookImage}function Ze(t){return t.appData.facebookHasOverlay}function tr(t){return""!==t.appData.facebookImageOverlay?t.appData.facebookImageOverlay:"play"}function er(t){return t.appData.postID}function rr(t){return t.appData.title}function nr(t){return t.appData.permalink}function ir(t){return t.appData.description}function ar(t){return t.appData.featuredImage}function or(t){var e=t.appData.featuredImage;return'<img src="'.concat(e.source_url,'" alt="').concat(e.alt_text,'" >')}function ur(t){return t.appData.primaryTerm}function cr(t){return t.appData.redirectionID}function sr(t){return t.appData.redirectionType}function lr(t){return t.appData.redirectionUrl}function pr(t){return t.appUi.redirectionItem}function fr(t){return t.appUi.hasRedirect}var dr=wp.url;function hr(t){return pt(t.appUi.serpTitle)}function mr(t){return(0,dr.safeDecodeURIComponent)(t.appUi.serpSlug)}function yr(t){return t.appUi.serpDescription}function gr(t){return t.appUi.isSnippetEditorOpen}function vr(t){return t.appUi.snippetPreviewType}function br(t){return t.appUi.isSchemaEditorOpen}function kr(t){return t.appUi.isSchemaTemplatesOpen}function wr(t){return t.appUi.schemaUpdated}function Sr(t){return t.appData.schemas}function _r(t){return t.appUi.editSchemas}function Tr(t){return{id:t.appUi.editingSchemaId,data:t.appUi.editSchemas[t.appUi.editingSchemaId]}}function Pr(t){return t.appData.schemas[t.appUi.editingSchemaId]}function Dr(t){return t.appUi.editorTab}function Ir(t){return t.appUi.templateTab}function Er(t){return t.appData.twitterUseFacebook}function Or(t){return t.appData.twitterCardType}function jr(t){return t.appData.twitterTitle}function Ar(t){return t.appData.twitterDescription}function Cr(t){return t.appData.twitterAuthor}function Mr(t){return t.appData.twitterImageID}function xr(t){return t.appData.twitterImage}function Rr(t){return t.appData.twitterHasOverlay}function Ur(t){return""!==t.appData.twitterImageOverlay?t.appData.twitterImageOverlay:"play"}function Nr(t){return t.appData.twitterAppDescription}function Fr(t){return t.appData.twitterAppIphoneID}function Lr(t){return t.appData.twitterAppIphoneName}function Hr(t){return t.appData.twitterAppIphoneUrl}function Kr(t){return t.appData.twitterAppIpadID}function zr(t){return t.appData.twitterAppIpadName}function Gr(t){return t.appData.twitterAppIpadUrl}function Br(t){return t.appData.twitterAppGoogleplayID}function Vr(t){return t.appData.twitterAppGoogleplayName}function Wr(t){return t.appData.twitterAppGoogleplayUrl}function Jr(t){return t.appData.twitterAppCountry}function $r(t){return t.appData.twitterPlayerUrl}function qr(t){return t.appData.twitterPlayerSize}function Yr(t){return t.appData.twitterPlayerStream}function Qr(t){return t.appData.twitterPlayerStreamCtype}function Xr(t){return t.appUi.keywordsData}function Zr(t){return t.appData.contentAIScore}(0,s.registerStore)("rank-math",{reducer:(0,s.combineReducers)(r),selectors:n,actions:e});function tn(t){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tn(t)}function en(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,a=void 0,a=function(t,e){if("object"!==tn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===tn(a)?a:String(a)),n)}var i,a}var rn=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.updateBtn=a()("#publish"),this.form=a()("#post"),this._data={id:!1,slug:!1,permalink:!1,content:!1,title:!1,excerpt:!1,featuredImage:!1,description:""},this.refresh=this.refresh.bind(this),(0,c.addAction)("rank_math_loaded","rank-math",this.refresh),this.setup(),this.init()}var e,r,n;return e=t,r=[{key:"init",value:function(){var t=this;this.elemTitle.on("input",(0,o.debounce)((function(){t.handleTitleChange(t.elemTitle.val())}),500)).trigger("input"),this.elemDescription.on("input",(0,o.debounce)((function(){t.handleExcerptChange(t.elemDescription.val())}),500)).trigger("input"),this.elemSlug.on("input",(0,o.debounce)((function(){rankMathEditor.updatePermalink(t.elemSlug.val())}),500))}},{key:"collectData",value:function(){this._data={id:this.getPostID(),slug:this.getSlug(),permalink:this.getPermalink(),content:this.getContent(),title:this.getTitle(),excerpt:this.getExcerpt(),featuredImage:this.getFeaturedImage()}}},{key:"getPostID",value:function(){return rankMath.objectID}},{key:"getTitle",value:function(){return this.elemTitle.val()}},{key:"getExcerpt",value:function(){var t=this.elemDescription.val();return U.setVariable("excerpt",t),U.setVariable("excerpt_only",t),U.setVariable("wc_shortdesc",t),U.setVariable("seo_description",t),t}},{key:"getPermalink",value:function(){return this.getSlug()?rankMath.permalinkFormat.replace(/%(postname|pagename|term|author)%/,this.getSlug()):""}},{key:"getSlug",value:function(){return this.elemSlug.val()}},{key:"getFeaturedImage",value:function(){return this.featuredImage}},{key:"refresh",value:function(){this.collectData(),(0,s.dispatch)("rank-math").toggleLoaded(!0),rankMathEditor.refresh("init")}},{key:"handleSlugChange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];("auto-draft"!==this.getStatus()||e)&&this.elemSlug.val(t),a()("#editable-post-name").text(t),a()("#editable-post-name-full").text(t),this._data.slug=this.getSlug(),this._data.permalink=this.getPermalink(),(0,s.dispatch)("rank-math").updateSerpSlug(t),rankMathEditor.refresh("permalink")}},{key:"handleTitleChange",value:function(t){U.setVariable("title",t),U.setVariable("term",t),U.setVariable("author",t),(0,s.dispatch)("rank-math").updateSerpTitle((0,s.select)("rank-math").getTitle()),rankMathEditor.refresh("title")}},{key:"handleExcerptChange",value:function(){this._data.excerpt=this.getExcerpt(),(0,s.dispatch)("rank-math").updateSerpDescription((0,s.select)("rank-math").getDescription()),rankMathEditor.refresh("content")}},{key:"handleFeaturedImageChange",value:function(){this._data.featuredImage=this.getFeaturedImage(),(0,s.dispatch)("rank-math").updateFeaturedImage(this.getFeaturedImage()),rankMathEditor.refresh("featuredImage")}},{key:"handleContentChange",value:function(){this._data.excerpt=this.getExcerpt(),this._data.content=this.getContent(),(0,s.dispatch)("rank-math").updateSerpDescription((0,s.select)("rank-math").getDescription()),rankMathEditor.refresh("content")}},{key:"getData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t?this._data[t]:this._data}},{key:"updateData",value:function(t,e){this._data[t]=e}},{key:"isTinymce",value:function(){return"undefined"!=typeof tinymce}},{key:"getStatus",value:function(){var t=!(0,o.isUndefined)(this.postStatus)&&this.postStatus.length?this.postStatus.val():"";return(0,o.isUndefined)(t)?"":t}}],r&&en(e.prototype,r),n&&en(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),nn=rn;function an(t){return an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},an(t)}function on(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,a=void 0,a=function(t,e){if("object"!==an(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==an(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===an(a)?a:String(a)),n)}var i,a}function un(t,e){return un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},un(t,e)}function cn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=sn(t);if(e){var i=sn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===an(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function sn(t){return sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sn(t)}var ln=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&un(t,e)}(u,t);var e,r,n,i=cn(u);function u(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),i.apply(this,arguments)}return e=u,(r=[{key:"setup",value:function(){this.elemSlug=a()("#post_name"),this.elemTitle=a()("#title"),this.elemDescription=a()("#excerpt"),this.elemContent=a()("#content"),this.saveDraft=a()("#save-post"),this.postStatus=a()("#original_post_status"),this.assessThumbnail=this.assessThumbnail.bind(this),(0,c.addAction)("rank_math_updated_featured_image","rank-math",this.assessThumbnail),this.events()}},{key:"getContent",value:function(){if(null!==this.elemContent&&0!==this.elemContent.length)return this.isTinymce()&&tinymce.activeEditor&&"content"===tinymce.activeEditor.id?tinymce.activeEditor.getContent():this.elemContent.val()}},{key:"getSlug",value:function(){var t=""===this.elemSlug.val()&&a()("#editable-post-name-full").length?a()("#editable-post-name-full").text():this.elemSlug.val();return(0,o.isUndefined)(t)?"":t}},{key:"events",value:function(){var t=this;this.elemContent.on("input change",(0,o.debounce)((function(){t.handleContentChange()}),500)).trigger("change"),a()(window).on("load",(function(){t.isTinymce()&&(tinymce.activeEditor&&!(0,o.isUndefined)(tinymce.editors.content)&&tinymce.editors.content.on("keyup change",(0,o.debounce)((function(){t.handleContentChange()}),500)),tinymce.editors&&!(0,o.isUndefined)(tinymce.editors.excerpt)&&tinymce.editors.excerpt.on("keyup change",(0,o.debounce)((function(){tinymce.editors.excerpt.save(),t.handleExcerptChange()}),500)))})),a()(document).on("ajaxComplete",(function(e,r,n){var i="/admin-ajax.php";if(i===n.url.substr(-15)){var o="";"string"==typeof n.data&&-1!==n.data.indexOf("action=sample-permalink")&&(o=""===r.responseText?t.elemTitle.val():a()("<div>"+r.responseText+"</div>").find("#editable-post-name-full").text(),rankMathEditor.updatePermalink(o))}})),this.saveDraft.on("click",(function(){t.updateBtn.attr("data-disable","true")}))}},{key:"assessThumbnail",value:function(t){this.featuredImage={source_url:t.src,alt_text:t.alt},this.handleFeaturedImageChange(t)}}])&&on(e.prototype,r),n&&on(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(nn),pn=ln;function fn(t){return fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fn(t)}function dn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,a=void 0,a=function(t,e){if("object"!==fn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==fn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===fn(a)?a:String(a)),n)}var i,a}function hn(t,e){return hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hn(t,e)}function mn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=yn(t);if(e){var i=yn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===fn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function yn(t){return yn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yn(t)}var gn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hn(t,e)}(u,t);var e,r,n,i=mn(u);function u(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),i.apply(this,arguments)}return e=u,(r=[{key:"setup",value:function(){this.updateBtn=a()('.edit-tag-actions input[type="submit"]'),this.form=a()("#edittag"),this.elemSlug=a()("#slug"),this.elemTitle=a()("#name"),this.elemDescription=a()("#rank_math_description_editor"),this.events()}},{key:"getContent",value:function(){return null===this.elemDescription||0===this.elemDescription.length?"":this.isTinymce()&&tinymce.activeEditor&&"rank_math_description_editor"===tinymce.activeEditor.id?tinymce.activeEditor.getContent():this.elemDescription.val()}},{key:"events",value:function(){var t=this;a()(window).on("load",(function(){t.isTinymce()&&tinymce.activeEditor&&!(0,o.isUndefined)(tinymce.editors.rank_math_description_editor)&&tinymce.editors.rank_math_description_editor.on("keyup change",(0,o.debounce)((function(){t.handleContentChange()}),500))}))}}])&&dn(e.prototype,r),n&&dn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(nn),vn=gn;function bn(t){return bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bn(t)}function kn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,a=void 0,a=function(t,e){if("object"!==bn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==bn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===bn(a)?a:String(a)),n)}var i,a}function wn(t,e){return wn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wn(t,e)}function Sn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_n(t);if(e){var i=_n(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===bn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function _n(t){return _n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_n(t)}var Tn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wn(t,e)}(o,t);var e,r,n,i=Sn(o);function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),i.apply(this,arguments)}return e=o,(r=[{key:"setup",value:function(){this.updateBtn=a()("#submit"),this.form=a()("#your-profile"),this.elemSlug=a()("#user_login"),this.elemTitle=a()("#display_name"),this.elemDescription=a()("#description")}},{key:"getContent",value:function(){return this.elemDescription.val()}}])&&kn(e.prototype,r),n&&kn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(nn),Pn=Tn;function Dn(t){return Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dn(t)}function In(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function En(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?In(Object(r),!0).forEach((function(e){jn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):In(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function On(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,An(n.key),n)}}function jn(t,e,r){return(e=An(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function An(t){var e=function(t,e){if("object"!==Dn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Dn(e)?e:String(e)}var Cn=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),jn(this,"initialize",!1),jn(this,"isSavingRedirection",!1),jn(this,"isSavingSchemas",!1),jn(this,"oldSlug",!1),this._data={id:!1,slug:!1,permalink:!1,content:!1,title:!1,excerpt:!1,featuredImage:!1},this.refresh=this.refresh.bind(this),this.isSavingPost=this.isSavingPost.bind(this),this.getPostAttribute=this.getPostAttribute.bind(this),this.subscribeToGutenberg()}var e,r,n;return e=t,(r=[{key:"collectGutenbergData",value:function(){if(P())return this._coreEditorSelect||(this._coreEditorSelect=(0,s.select)("core/editor")),!1===this.oldSlug&&""!==this.getSlug()&&(this.oldSlug=this.getSlug()),{id:this.getPostID(),slug:this.getSlug(),permalink:this.getPermalink(),content:this.getPostAttribute("content"),title:this.getPostAttribute("title"),excerpt:this.getPostAttribute("excerpt"),featuredImage:this.getFeaturedImage()}}},{key:"getPostID",value:function(){return this._coreEditorSelect.getCurrentPostId()}},{key:"getPermalink",value:function(){if("auto-draft"===this.getPostAttribute("status"))return"";var t=this.getPostAttribute("generated_slug");return"auto-draft"!==t&&"en"===rankMath.locale||(t=""),(0,dr.safeDecodeURIComponent)(this._coreEditorSelect.getPermalink())}},{key:"getSlug",value:function(){var t=this.getPostAttribute("generated_slug");return"auto-draft"!==t&&"en"===rankMath.locale||(t=""),(0,dr.safeDecodeURIComponent)(this.getPostAttribute("slug")||t)}},{key:"getFeaturedImage",value:function(){var t=this.getPostAttribute("featured_media");if(this.isValidMediaId(t)){var e=(0,s.select)("core").getMedia(t);if(!(0,o.isUndefined)(e))return e}}},{key:"isValidMediaId",value:function(t){return"number"==typeof t&&0<t}},{key:"getPostAttribute",value:function(t){return P()?(this._coreEditorSelect||(this._coreEditorSelect=(0,s.select)("core/editor")),this._coreEditorSelect.getEditedPostAttribute(t)):""}},{key:"subscribeToGutenberg",value:function(){this.subscriber=(0,o.debounce)(this.refresh,500),(0,s.subscribe)(this.subscriber),(0,s.subscribe)(this.isSavingPost)}},{key:"refresh",value:function(){var t=En({},this._data);this._data=this.collectGutenbergData(),this.handleEditorChange(t)}},{key:"isSavingPost",value:function(){var t=(0,s.select)("core/editor");if(!t.isAutosavingPost()&&t.isSavingPost()){var e=(0,s.select)("rank-math").getDirtyMetadata();(0,o.isEmpty)(e)||(d()({method:"POST",path:"rankmath/v1/updateMeta",data:{objectID:rankMath.objectID,objectType:rankMath.objectType,meta:e,content:this.getPostAttribute("content")}}).then((function(t){(0,c.doAction)("rank_math_metadata_updated",t)})),(0,s.dispatch)("rank-math").resetDirtyMetadata()),"publish"===this.getPostAttribute("status")&&(this.saveRedirection(),this.autoCreateRedirectionNotice()),this.saveSchemas()}}},{key:"saveSchemas",value:function(){var t=this;if(!this.isSavingSchemas){var e=(0,s.select)("rank-math").getSchemas();if(!(0,o.isEmpty)(e)&&(0,s.select)("rank-math").hasSchemaUpdated()){this.isSavingSchemas=!0;var r=(0,s.select)("rank-math").getEditSchemas();d()({method:"POST",path:"rankmath/v1/updateSchemas",data:{objectID:this.getPostID(),objectType:rankMath.objectType,schemas:e}}).then((function(n){var i=En({},e),a=En({},r);(0,o.isEmpty)(n)||(0,o.map)(n,(function(t,e){i["schema-"+t]=En({},i[e]),a["schema-"+t]=En({},a[e]),delete i[e],delete a[e]})),(0,s.dispatch)("rank-math").updateSchemas(i),(0,s.dispatch)("rank-math").updateEditSchemas(a),setTimeout((function(){(0,s.dispatch)("rank-math").schemaUpdated(!1),(0,c.doAction)("rank_math_schema_changed"),t.isSavingSchemas=!1}),2e3)}))}}}},{key:"saveRedirection",value:function(){var t=this;if(!this.isSavingRedirection){var e=(0,s.select)("rank-math").getRedirectionItem();if(!(0,o.isEmpty)(e)){this.isSavingRedirection=!0,e.objectID=this.getPostID(),e.redirectionSources=this.getPermalink();var r=(0,s.dispatch)("rank-math"),n=(0,s.dispatch)("core/notices");r.resetRedirection(),d()({method:"POST",path:"rankmath/v1/updateRedirection",data:e}).then((function(e){"delete"===e.action?(n.createInfoNotice(e.message,{id:"redirectionNotice"}),r.updateRedirection("redirectionID",0)):"update"===e.action?n.createInfoNotice(e.message,{id:"redirectionNotice"}):"new"===e.action&&(r.updateRedirection("redirectionID",e.id),n.createSuccessNotice(e.message,{id:"redirectionNotice"})),setTimeout((function(){t.isSavingRedirection=!1,n.removeNotice("redirectionNotice")}),2e3)}))}}}},{key:"autoCreateRedirectionNotice",value:function(){if(rankMath.assessor.hasRedirection&&(0,o.get)(rankMath,["assessor","autoCreateRedirection"],!1)&&!(0,s.select)("core/editor").isEditedPostNew()&&!1!==this.oldSlug){var t=this.getSlug();if(this.oldSlug!==t){var e=(0,s.dispatch)("core/notices");this.oldSlug=t,e.createSuccessNotice((0,p.__)("Auto redirection created.","rank-math"),{id:"redirectionAutoCreationNotice"}),setTimeout((function(){e.removeNotice("redirectionAutoCreationNotice")}),2e3)}}}},{key:"handleEditorChange",value:function(t){var e=this,r={id:"handleIDChange",slug:"handleSlugChange",title:"handleTitleChange",excerpt:"handleExcerptChange",content:"handleContentChange",featuredImage:"handleFeaturedImageChange"};if((0,o.isInteger)(t.id))return this.initialize?void(0,o.forEach)(r,(function(r,n){e._data[n]!==t[n]&&e[r](e._data[n])})):(this.initialize=!0,(0,o.forEach)(r,(function(t,r){e[t](e._data[r])})),void rankMathEditor.refresh("init"));(0,s.dispatch)("rank-math").refreshResults()}},{key:"handleIDChange",value:function(t){(0,s.dispatch)("rank-math").updatePostID(t),(0,s.dispatch)("rank-math").toggleLoaded(!0)}},{key:"handleSlugChange",value:function(){""!==this.getSlug()&&!1===this.oldSlug&&(this.oldSlug=this.getSlug()),rankMathEditor.refresh("permalink")}},{key:"handleTitleChange",value:function(t){U.setVariable("title",t),U.setVariable("term",t),U.setVariable("author",t),(0,s.dispatch)("rank-math").updateSerpTitle((0,s.select)("rank-math").getTitle()),rankMathEditor.refresh("title")}},{key:"handleExcerptChange",value:function(t){U.setVariable("excerpt",t),U.setVariable("excerpt_only",t),U.setVariable("wc_shortdesc",t),U.setVariable("seo_description",t),(0,s.dispatch)("rank-math").updateSerpDescription((0,s.select)("rank-math").getDescription())}},{key:"handleFeaturedImageChange",value:function(t){(0,s.dispatch)("rank-math").updateFeaturedImage(t),rankMathEditor.refresh("featuredImage")}},{key:"handleContentChange",value:function(){(0,s.dispatch)("rank-math").updateSerpDescription((0,s.select)("rank-math").getDescription()),rankMathEditor.refresh("content")}},{key:"getData",value:function(){return this._data}}])&&On(e.prototype,r),n&&On(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Mn=Cn;function xn(t){return xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xn(t)}function Rn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,a=void 0,a=function(t,e){if("object"!==xn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==xn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===xn(a)?a:String(a)),n)}var i,a}function Un(t,e,r){return e&&Rn(t.prototype,e),r&&Rn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Nn=Un((function t(){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"post"===rankMath.objectType&&rankMath.postSettings.linkSuggestions){a().fn.extend({insertLink:function(t,e){var r=this[0],n="";if(r.selectionStart||"0"===r.selectionStart){var i=r.selectionStart,a=r.selectionEnd,o=r.scrollTop;n='<a href="'+t+'">'+r.value.substring(i,a)+"</a>",i===a&&(n='<a href="'+t+'">'+e+"</a>"),r.value=r.value.substring(0,i)+n+r.value.substring(a,r.value.length),r.focus(),r.selectionStart=i+n.length,r.selectionEnd=i+n.length,r.scrollTop=o}else n='<a href="'+t+'">'+e+"</a>",r.value+=n,r.focus()}});if("function"==typeof ClipboardJS&&a()(".suggestion-copy").on("click",(function(t){t.preventDefault(),new ClipboardJS(".suggestion-copy");var e=a()(this).parent().next(".suggestion-title"),r=e.html();e.text("Link Copied"),setTimeout((function(){e.html(r)}),1500)})),"object"!==("undefined"==typeof tinymce?"undefined":xn(tinymce)))return!0;var e=null,r=null;a()(".suggestion-insert").on("click",(function(t){t.preventDefault();var n,i,o,u,c=a()(this);if(c.hasClass("clicked"))return!0;if(null!==tinymce.activeEditor&&!0!==tinymce.activeEditor.isHidden()&&"content"===tinymce.activeEditor.id){e=tinymce.activeEditor,r=a()(e.getBody());var l=e.selection.getContent()||"";if(r.find("a[data-mce-selected]").length){var p=(n="",i="",o=e.selection.getStart(),(u=e.dom.getParent(o,"a[href]"))||(i=e.selection.getContent({format:"raw"}))&&-1!==i.indexOf("</a>")&&((n=i.match(/href="([^">]+)"/))&&n[1]&&(u=e.$('a[href="'+n[1]+'"]',o)[0]),u&&e.selection.select(u)),u);e.dom.setAttribs(p,{href:c.data("url")}),a()(p).text()!==l&&e.insertContent(l)}else l.length?e.insertContent('<a href="'+c.data("url")+'">'+l+"</a>"):e.insertContent('<a href="'+c.data("url")+'">'+c.data("text")+"</a>")}else if(P()){var f=(0,s.select)("core/block-editor").getSelectedBlock().clientId,d=(0,s.select)("core/block-editor").getSelectionStart().offset,h=(0,s.select)("core/block-editor").getSelectionEnd().offset;if(document.getSelection){var m=document.getSelection();if(m.rangeCount){var y=m.getRangeAt(0),g=a()("#block-"+f).text().substring(d,h),v=document.createElement("a");v.href=c.data("url"),v.innerText=""!==g?g:c.data("text"),y.deleteContents(),y.insertNode(v);var b=m.focusNode.innerHTML;(0,s.dispatch)("core/block-editor").updateBlock(f,{attributes:{content:b}})}}}var k=c.closest(".suggestion-item").find(".suggestion-title"),w=k.html();k.text("Link Inserted"),c.addClass("clicked"),setTimeout((function(){var t,e,r,n;k.html(w),c.removeClass("clicked"),!0===rankMath.postSettings.useFocusKeyword&&(e=c,r=(t=k).data("fkcount")||0,n=t.data("fk"),(r+=1)===n.length&&(r=0),t.find(">a").text(n[r]),t.data("fkcount",r),e.data("text",n[r]))}),1500)})),a()("#rank_math_metabox_link_suggestions").find("h2").append(a()("#rank-math-link-suggestions-tooltip").html())}}));function Fn(t){return Fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fn(t)}function Ln(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,a=void 0,a=function(t,e){if("object"!==Fn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Fn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===Fn(a)?a:String(a)),n)}var i,a}function Hn(t,e,r){return e&&Ln(t.prototype,e),r&&Ln(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Kn=Hn((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"post"===rankMath.objectType&&!1!==rankMath.assessor.primaryTaxonomy&&a()("[data-primary-term]").each((function(){var t=a()(this),e=t.val(),r=t.data("primary-term"),n=a()("#"+r+"div"),i=a()("#"+r+"checklist"),o=i.find("li"),u=i.find('input[type="checkbox"]:checked');o.addClass("rank-math-primary-term-li"),o.find("input").each((function(){var t=a()(this);t.parent().append('<span class="rank-math-tooltip"><input class="rank-math-make-primary" value="'+t.val()+'" type="radio" name="rank_math_primary_'+r+'"><span>Make Term Primary</span></span>')})),u.each((function(){var t=a()(this).closest("li");t.addClass("term-checked"),r+"-"+e===t.attr("id")&&(t.addClass("term-marked-primary"),t.find(">label .rank-math-make-primary").prop("checked",!0))})),n.on("click",'input[type="checkbox"]',(function(){var e=a()(this).closest("li");if(e.toggleClass("term-checked"),1===i.find("li.term-checked").length||e.hasClass("term-marked-primary")&&!e.hasClass("term-checked")){var r=i.find("li.term-checked:first > label .rank-math-make-primary");0<r.length?r.trigger("click"):(o.removeClass("term-marked-primary"),o.find('input[type="radio"]').prop("checked",!1),t.val(""))}})),n.on("click",".rank-math-make-primary",(function(){var e=a()(this),r=e.closest("li");o.removeClass("term-marked-primary"),r.addClass("term-marked-primary"),t.val(e.val())})),i.on("wpListAddEnd",(function(){i.find("li:not(.rank-math-primary-term-li)").addClass("rank-math-primary-term-li term-checked").find("input").each((function(){var t=a()(this);t.parent().append('<span class="rank-math-tooltip"><input class="rank-math-make-primary" value="'+t.val()+'" type="radio" name="rank_math_primary_'+r+'"><span>Make Term Primary</span></span>')}))}))}))}));function zn(t){return zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zn(t)}function Gn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,a=void 0,a=function(t,e){if("object"!==zn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==zn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===zn(a)?a:String(a)),n)}var i,a}var Bn=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.image_src="",this.image_alt="",this.getFeaturedImage(),this.setImage(),this.removeImage(),P()&&this.gutenbergImage()}var e,r,n;return e=t,(r=[{key:"setImage",value:function(){var t=this;if(!(0,o.isUndefined)(wp.media)){var e=wp.media.featuredImage.frame();e.on("select",(function(){var r=a()("#rank_math_post_thumbnail"),n=e.state().get("selection").first().toJSON();t.sizeWarning(n),1>r.length&&(r=a()('<img id="rank_math_post_thumbnail" />'),a()(".facebook-thumbnail",".rank-math-social-preview-image").before(r)),"large"in n.sizes?r.attr("src",n.sizes.large.url):r.attr("src",n.sizes.full.url),t.setFeaturedImage(n)}))}}},{key:"removeImage",value:function(){var t=this;a()("#postimagediv").on("click","#remove-post-thumbnail",(function(){a()("#rank_math_image_warning").remove(),a()("#rank_math_post_thumbnail").remove(),t.setFeaturedImage("")}))}},{key:"gutenbergImage",value:function(){var t,e,r=this;wp.data.subscribe((function(){var n=wp.data.select("core/editor").getEditedPostAttribute("featured_media");r.isValidMediaId(n)&&(t=wp.data.select("core").getMedia(n),(0,o.isUndefined)(t)||t!==e&&(e=t,r.setFeaturedImage({url:t.guid.rendered,alt:t.alt_text})))}))}},{key:"setFeaturedImage",value:function(t){var e={src:(0,o.get)(t,"url",""),alt:(0,o.get)(t,"alt","")};(0,c.doAction)("rank_math_updated_featured_image",e)}},{key:"sizeWarning",value:function(t){if(a()("#rank_math_image_warning").remove(),!(200<t.width&&200<t.height)){var e=a()("#postimagediv").find(".hndle");a()('<div id="rank_math_image_warning" class="notice notice-error notice-alt"><p>'+rankMath.featuredImageNotice+"</p></div>").insertAfter(e)}}},{key:"getFeaturedImage",value:function(){var t=a()("#postimagediv img");if(!t||t.length){var e={url:t[0].src,alt:t[0].alt};this.setFeaturedImage(e)}}},{key:"isValidMediaId",value:function(t){return"number"==typeof t&&0<t}}])&&Gn(e.prototype,r),n&&Gn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Vn=wp.components,Wn=(0,Vn.createSlotFill)("RankMathAfterEditor"),Jn=Wn.Fill,$n=Wn.Slot,qn=function(t){var e=t.children,r=t.className;return wp.element.createElement(Jn,null,wp.element.createElement(Vn.PanelRow,{className:r},e))};qn.Slot=$n;var Yn=qn,Qn=(0,Vn.createSlotFill)("RankMathAdvancedTab"),Xn=Qn.Fill,Zn=Qn.Slot,ti=function(t){var e=t.children,r=t.className;return wp.element.createElement(Xn,null,wp.element.createElement(Vn.PanelRow,{className:r},e))};ti.Slot=Zn;var ei=ti,ri=(0,Vn.createSlotFill)("RankMathAfterFocusKeyword"),ni=ri.Fill,ii=ri.Slot,ai=function(t){var e=t.children,r=t.className;return wp.element.createElement(ni,null,wp.element.createElement("div",{className:r},e))};ai.Slot=ii;var oi=ai;function ui(t){return ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ui(t)}function ci(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(i=n.key,a=void 0,a=function(t,e){if("object"!==ui(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ui(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"),"symbol"===ui(a)?a:String(a)),n)}var i,a}var si=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,n;return e=t,r=[{key:"setup",value:function(){this.registerSlots=this.registerSlots.bind(this),(0,c.addAction)("rank_math_loaded","rank-math",this.registerSlots,0),this.resultManager=new u.ResultManager,this.assessor=new T(this.getCollector()),new E,this.registerComponents=this.registerComponents.bind(this),(0,c.addAction)("rank_math_loaded","rank-math",this.registerComponents,11)}},{key:"registerSlots",value:function(){this.RankMathAfterEditor=Yn,this.RankMathAfterFocusKeyword=oi,this.RankMathAdvancedTab=ei,this.slots={AfterEditor:Yn,AfterFocusKeyword:oi,AdvancedTab:ei}}},{key:"registerComponents",value:function(){this.components={},this.components.linkSuggestions=new Nn,this.components.primaryTerm=new Kn,this.components.featuredImage=new Bn,rankMathAdmin.variableInserter(!1),setTimeout((function(){(0,l.render)((0,l.createElement)((0,c.applyFilters)("rank_math_app",{})),document.getElementById("rank-math-metabox-wrapper"))}),1e3)}},{key:"refresh",value:function(t){this.assessor.refresh(t)}},{key:"updatePermalink",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.assessor.dataCollector.handleSlugChange(t,e),(0,s.dispatch)("rank-math").updatePermalink(t)}},{key:"updatePermalinkSanitize",value:function(t){t=this.assessor.getResearch("slugify")(t),(0,s.dispatch)("rank-math").updatePermalink(t)}},{key:"getPrimaryKeyword",value:function(){return u.Helpers.removeDiacritics(this.assessor.getPrimaryKeyword())}},{key:"getSelectedKeyword",value:function(){var t=this.assessor.getSelectedKeyword();return(0,o.isUndefined)(t)?"":u.Helpers.removeDiacritics(t)}},{key:"getCollector",value:function(){return"post"===rankMath.objectType?P()?new Mn:new pn(this):"term"===rankMath.objectType?new vn:"user"===rankMath.objectType?new Pn:void 0}}],r&&ci(e.prototype,r),n&&ci(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();a()((function(){window.rankMathEditor=new si,window.rankMathEditor.setup(),window.RankMathApp=new C})),a()(window).on("load",(function(){a().when(a().ready).then((function(){(0,c.doAction)("rank_math_loaded")}))}))}(); |