| @@ -1,41 +1,477 @@ | ||
| 1 | -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=216)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.yoast.propTypes},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.React},function(e,t){e.exports=window.yoast.componentsNew},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.yoast.styledComponents},function(e,t){e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.yoast.helpers},function(e,t){function n(e,t,n,r,a,o,s){try{var i=e[o](s),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(r,a)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(a,o){var s=e.apply(t,r);function i(e){n(s,a,o,i,c,"next",e)}function c(e){n(s,a,o,i,c,"throw",e)}i(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(46);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(34).default,a=n(10);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return a(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.yoast.externals.redux},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.components},,function(e,t){e.exports=window.yoast.styleGuide},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3);function a(){return Object(r.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}},function(e,t,n){var r=n(70),a=n(71),o=n(41),s=n(72);e.exports=function(e){return r(e)||a(e)||o(e)||s()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(60),a=n(61),o=n(41),s=n(62);e.exports=function(e,t){return r(e)||a(e,t)||o(e,t)||s()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.yoast.analysis},,function(e,t){e.exports=window.yoast.externals.contexts},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="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},a=i(n(4)),o=i(n(96)),s=i(n(99));function i(e){return e&&e.__esModule?e:{default:e}}var c=void 0;t.default=function(e){var t=e.mixedString,n=e.components,i=e.throwErrors;if(c=t,!n)return t;if("object"!==(void 0===n?"undefined":r(n))){if(i)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var u=(0,s.default)(t);try{return function e(t,n){var s,i,u,l,d,p,f,h,m=[],b={};for(p=0;p<t.length;p++)if("string"!==(d=t[p]).type){if(!n.hasOwnProperty(d.value)||void 0===n[d.value])throw new Error("Invalid interpolation, missing component node: `"+d.value+"`");if("object"!==r(n[d.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+d.value+"`","\n> "+c);if("componentClose"===d.type)throw new Error("Missing opening component token: `"+d.value+"`");if("componentOpen"===d.type){s=n[d.value],u=p;break}m.push(n[d.value])}else m.push(d.value);return s&&(l=function(e,t){var n,r,a=t[e],o=0;for(r=e+1;r<t.length;r++)if((n=t[r]).value===a.value){if("componentOpen"===n.type){o++;continue}if("componentClose"===n.type){if(0===o)return r;o--}}throw new Error("Missing closing component token `"+a.value+"`")}(u,t),f=e(t.slice(u+1,l),n),i=a.default.cloneElement(s,{},f),m.push(i),l<t.length-1&&(h=e(t.slice(l+1),n),m=m.concat(h))),1===m.length?m[0]:(m.forEach((function(e,t){e&&(b["interpolation-child-"+t]=e)})),(0,o.default)(b))}(u,n)}catch(e){if(i)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return d}));var r=n(15),a=n.n(r),o=n(9),s=n.n(o),i=n(38),c=n.n(i);function u(_x,e,t){return l.apply(this,arguments)}function l(){return(l=a()(s.a.mark((function e(t,n,r){var a,o,i=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.length>3&&void 0!==i[3]?i[3]:200,e.prev=1,e.next=4,t();case 4:if(!(o=e.sent)){e.next=9;break}if(o.status!==a){e.next=8;break}return e.abrupt("return",n(o));case 8:return e.abrupt("return",r(o));case 9:return e.abrupt("return",!1);case 12:e.prev=12,e.t0=e.catch(1),console.error(e.t0.message);case 15:case"end":return e.stop()}}),e,null,[[1,12]])})))).apply(this,arguments)}function d(e){return p.apply(this,arguments)}function p(){return(p=a()(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c()(t);case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),!e.t0.error||!e.t0.status){e.next=10;break}return e.abrupt("return",e.t0);case 10:if(!(e.t0 instanceof Response)){e.next=14;break}return e.next=13,e.t0.json();case 13:return e.abrupt("return",e.sent);case 14:return e.abrupt("return",!1);case 15:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}},function(e,t,n){"use strict";var r=n(0),a=n(1),o=n.n(a),s=function(e){var t=e.children;return Object(r.createElement)("div",null,t)};s.propTypes={renderPriority:o.a.number.isRequired,children:o.a.node.isRequired},t.a=s},function(e,t){function n(t){return e.exports=n="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},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},,function(e,t){e.exports=window.yoast.replacementVariableEditor},function(e,t,n){var r=n(84);e.exports=function(e,t){if(null==e)return{};var n,a,o=r(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)n=s[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},,function(e,t,n){var r=n(39);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return d})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return m})),n.d(t,"e",(function(){return g}));var r=n(15),a=n.n(r),o=n(9),s=n.n(o),i=n(3),c=n(32);function u(){return l.apply(this,arguments)}function l(){return(l=a()(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(c.a)({path:"yoast/v1/wincher/authorization-url",method:"GET"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function d(_x){return p.apply(this,arguments)}function p(){return(p=a()(s.a.mark((function e(t){var n,r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.code,r=t.websiteId,e.next=3,Object(c.a)({path:"yoast/v1/wincher/authenticate",method:"POST",data:{code:n,websiteId:r}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return h.apply(this,arguments)}function h(){return(h=a()(s.a.mark((function e(){var t,n,r,a=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:null,n=a.length>1&&void 0!==a[1]?a[1]:null,r=a.length>2?a[2]:void 0,e.next=5,Object(c.a)({path:"yoast/v1/wincher/keyphrases",method:"POST",data:{keyphrases:t,permalink:n},signal:r});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(e){return b.apply(this,arguments)}function b(){return(b=a()(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Object(i.isArray)(t)||(t=[t]),e.next=3,Object(c.a)({path:"yoast/v1/wincher/keyphrases/track",method:"POST",data:{keyphrases:t}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e){return y.apply(this,arguments)}function y(){return(y=a()(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(c.a)({path:"yoast/v1/wincher/keyphrases/untrack",method:"DELETE",data:{keyphraseID:t}});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return $e})),n.d(t,"b",(function(){return Ze})),n.d(t,"c",(function(){return Je})),n.d(t,"d",(function(){return Xe}));var r,a=n(3),o=n(14),s=n(12),i=n.n(s),c=n(13),u=n.n(c),l=n(10),d=n.n(l),p=n(16),f=n.n(p),h=n(17),m=n.n(h),b=n(11),g=n.n(b),y=n(8),v=n.n(y),w=n(0),O=n(4),k=n.n(O),j=n(1),x=n.n(j),E=n(7),R=n.n(E),_=R.a.p(r||(r=v()(["\n\tcolor: #606770;\n\tflex-shrink: 0;\n\tfont-size: 12px;\n\tline-height: 16px;\n\toverflow: hidden;\n\tpadding: 0;\n\ttext-overflow: ellipsis;\n\ttext-transform: uppercase;\n\twhite-space: nowrap;\n\tmargin: 0;\n\tposition: ",";\n"])),(function(e){return"landscape"===e.mode?"relative":"static"})),T=function(e){var t=e.siteUrl;return Object(w.createElement)(O.Fragment,null,Object(w.createElement)("span",{className:"screen-reader-text"},t),Object(w.createElement)(_,{"aria-hidden":"true"},Object(w.createElement)("span",null,t)))};T.propTypes={siteUrl:x.a.string.isRequired};var S,C,I,L=T,M=n(15),P=n.n(M),q=n(9),A=n.n(q),D=n(2),N=n(23),F=R.a.img(S||(S=v()(["\n\t&& {\n\t\tmax-width: ","px;\n\t\theight: ","px;\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -50%);\n\t\tmax-width: none;\n\t}\n"])),(function(e){return e.width}),(function(e){return e.height})),H=R.a.img(C||(C=v()(["\n\t&&{\n\t\theight: 100%;\n\t\tposition: absolute;\n\t\twidth: 100%;\n\t\tobject-fit: cover;\n\t}\n"]))),K=R.a.div(I||(I=v()(["\n\tpadding-bottom: ","%;\n"])),(function(e){return e.aspectRatio})),W=function(e){var t=e.imageProps,n=e.width,r=e.height;return"landscape"===e.imageMode?Object(w.createElement)(K,{aspectRatio:t.aspectRatio},Object(w.createElement)(H,{src:t.src,alt:t.alt})):Object(w.createElement)(F,{src:t.src,alt:t.alt,width:n,height:r,imageProperties:t})};W.propTypes={imageProps:x.a.shape({src:x.a.string.isRequired,alt:x.a.string.isRequired,aspectRatio:x.a.number.isRequired}).isRequired,width:x.a.number.isRequired,height:x.a.number.isRequired,imageMode:x.a.string},W.defaultProps={imageMode:"landscape"};var B,U,z={squareWidth:125,squareHeight:125,landscapeWidth:506,landscapeHeight:265,aspectRatio:50.2},V={squareWidth:158,squareHeight:158,landscapeWidth:527,landscapeHeight:273,portraitWidth:158,portraitHeight:237,aspectRatio:52.2,largeThreshold:{width:446,height:233}};function Y(e){var t=V.largeThreshold;return e.height>e.width?"portrait":e.width<t.width||e.height<t.height||e.height===e.width?"square":"landscape"}function G(e){return"Twitter"===e?z:V}function $(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t({width:r.width,height:r.height})},r.onerror=n,r.src=e}))}function Z(e,t,n){return"square"===n&&t.width===t.height?{width:e.squareWidth,height:e.squareHeight}:function(e,t){return t.widthRatio<=t.heightRatio?{width:Math.round(e.width/t.widthRatio),height:Math.round(e.height/t.widthRatio)}:{width:Math.round(e.width/t.heightRatio),height:Math.round(e.height/t.heightRatio)}}(t,function(e,t,n){return"landscape"===n?{widthRatio:t.width/e.landscapeWidth,heightRatio:t.height/e.landscapeHeight}:"portrait"===n?{widthRatio:t.width/e.portraitWidth,heightRatio:t.height/e.portraitHeight}:{widthRatio:t.width/e.squareWidth,heightRatio:t.height/e.squareHeight}}(e,t,n))}function J(_x,e){return X.apply(this,arguments)}function X(){return(X=P()(A.a.mark((function e(t,n){var r,a,o,s,i,c=arguments;return A.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=c.length>2&&void 0!==c[2]&&c[2],e.next=3,$(t);case 3:return a=e.sent,o=r?"landscape":"square","Facebook"===n&&(o=Y(a)),s=G(n),i=Z(s,a,o),e.abrupt("return",{mode:o,height:i.height,width:i.width});case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q(e,t){return ee.apply(this,arguments)}function ee(){return(ee=P()(A.a.mark((function e(t,n){var r,a,o=arguments;return A.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>2&&void 0!==o[2]&&o[2],e.prev=1,e.next=4,J(t,n,r);case 4:return a=e.sent,e.abrupt("return",{imageProperties:a,status:"loaded"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{imageProperties:null,status:"errored"});case 11:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var te=R.a.div(B||(B=v()(["\n\tposition: relative;\n\t",";\n\toverflow: hidden;\n\tbackground-color: ",";\n"])),(function(e){return"landscape"===e.mode?"max-width: ".concat(e.dimensions.width):"min-width: ".concat(e.dimensions.width,"; height: ").concat(e.dimensions.height)}),N.colors.$color_white),ne=R.a.div(U||(U=v()(["\n\tbox-sizing: border-box;\n\tmax-width: ","px;\n\theight: ","px;\n\tbackground-color: ",";\n\tborder-style: dashed;\n\tborder-width: 1px;\n\t// We're not using standard colors to increase contrast for accessibility.\n\tcolor: #006DAC;\n\t// We're not using standard colors to increase contrast for accessibility.\n\tbackground-color: #f1f1f1;\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\ttext-decoration: underline;\n\tfont-size: 14px;\n\tcursor: pointer;\n"])),V.landscapeWidth,V.landscapeHeight,N.colors.$color_grey),re=function(e){f()(o,e);var t,n,r,a=(n=o,r=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(e){return!1}}(),function(){var e,t=g()(n);if(r){var a=g()(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return m()(this,e)});function o(e){var t;return i()(this,o),(t=a.call(this,e)).state={imageProperties:null,status:"loading"},t.socialMedium="Facebook",t.handleFacebookImage=t.handleFacebookImage.bind(d()(t)),t.setState=t.setState.bind(d()(t)),t}return u()(o,[{key:"handleFacebookImage",value:(t=P()(A.a.mark((function e(){var t;return A.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Q(this.props.src,this.socialMedium);case 3:t=e.sent,this.setState(t),this.props.onImageLoaded(t.imageProperties.mode||"landscape"),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),this.setState(e.t0),this.props.onImageLoaded("landscape");case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(){return t.apply(this,arguments)})},{key:"componentDidUpdate",value:function(e){e.src!==this.props.src&&this.handleFacebookImage()}},{key:"componentDidMount",value:function(){this.handleFacebookImage()}},{key:"retrieveContainerDimensions",value:function(e){switch(e){case"square":return{height:V.squareHeight+"px",width:V.squareWidth+"px"};case"portrait":return{height:V.portraitHeight+"px",width:V.portraitWidth+"px"};case"landscape":return{height:V.landscapeHeight+"px",width:V.landscapeWidth+"px"}}}},{key:"render",value:function(){var e=this.state,t=e.imageProperties,n=e.status;if("loading"===n||""===this.props.src||"errored"===n)return Object(w.createElement)(ne,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},Object(D.__)("Select image","wordpress-seo"));var r=this.retrieveContainerDimensions(t.mode);return Object(w.createElement)(te,{mode:t.mode,dimensions:r,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick},Object(w.createElement)(W,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:V.aspectRatio},width:t.width,height:t.height,imageMode:t.mode}))}}]),o}(O.Component);re.propTypes={src:x.a.string,alt:x.a.string,onImageLoaded:x.a.func,onImageClick:x.a.func,onMouseEnter:x.a.func,onMouseLeave:x.a.func},re.defaultProps={src:"",alt:"",onImageLoaded:a.noop,onImageClick:a.noop,onMouseEnter:a.noop,onMouseLeave:a.noop};var ae,oe,se,ie,ce=re,ue=R.a.span(ae||(ae=v()(["\n\tline-height: ","px;\n\tmin-height : ","px;\n\tcolor: #1d2129;\n\tfont-weight: 600;\n\toverflow: hidden;\n\tfont-size: 16px;\n\tmargin: 3px 0 0;\n\tletter-spacing: normal;\n\twhite-space: normal;\n\tflex-shrink: 0;\n\tcursor: pointer;\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: ",";\n\t-webkit-box-orient: vertical;\n\toverflow: hidden;\n"])),20,20,(function(e){return e.lineCount})),le=R.a.p(oe||(oe=v()(["\n\tline-height: ","px;\n\tmin-height : ","px;\n\tcolor: #606770;\n\tfont-size: 14px;\n\tpadding: 0;\n\ttext-overflow: ellipsis;\n\tmargin: 3px 0 0 0;\n\tdisplay: -webkit-box;\n\tcursor: pointer;\n\t-webkit-line-clamp: ",";\n\t-webkit-box-orient: vertical;\n\toverflow: hidden;\n\n\t@media all and ( max-width: "," ) {\n\t\tdisplay: none;\n\t}\n"])),16,16,(function(e){return e.lineCount}),(function(e){return e.maxWidth}));var de=function(e){switch(e){case"landscape":return"527px";case"square":case"portrait":return"369px";default:return"476px"}},pe=R.a.div(se||(se=v()(["\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tflex-direction: ",";\n\tbackground-color: #f2f3f5;\n\tmax-width: 527px;\n"])),(function(e){return"landscape"===e.mode?"column":"row"})),fe=R.a.div(ie||(ie=v()(["\n\tbox-sizing: border-box;\n\tbackground-color: #f2f3f5;\n\tmargin: 0;\n\tpadding: 10px 12px;\n\tposition: relative;\n\tborder-bottom: ",";\n\tborder-top: ",";\n\tborder-right: ",";\n\tborder: ",";\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-grow: 1;\n\tjustify-content: ",";\n\tfont-size: 12px;\n\toverflow: hidden;\n"])),(function(e){return"landscape"===e.mode?"":"1px solid #dddfe2"}),(function(e){return"landscape"===e.mode?"":"1px solid #dddfe2"}),(function(e){return"landscape"===e.mode?"":"1px solid #dddfe2"}),(function(e){return"landscape"===e.mode?"1px solid #dddfe2":""}),(function(e){return"landscape"===e.mode?"flex-start":"center"})),he=function(e){f()(a,e);var t,n,r=(t=a,n=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(e){return!1}}(),function(){var e,r=g()(t);if(n){var a=g()(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return m()(this,e)});function a(e){var t;return i()(this,a),(t=r.call(this,e)).state={imageMode:null,maxLineCount:0,descriptionLineCount:0},t.facebookTitleRef=k.a.createRef(),t.onImageLoaded=t.onImageLoaded.bind(d()(t)),t.onImageEnter=t.props.onMouseHover.bind(d()(t),"image"),t.onTitleEnter=t.props.onMouseHover.bind(d()(t),"title"),t.onDescriptionEnter=t.props.onMouseHover.bind(d()(t),"description"),t.onLeave=t.props.onMouseHover.bind(d()(t),""),t.onSelectTitle=t.props.onSelect.bind(d()(t),"title"),t.onSelectDescription=t.props.onSelect.bind(d()(t),"description"),t}return u()(a,[{key:"onImageLoaded",value:function(e){this.setState({imageMode:e})}},{key:"getTitleLineCount",value:function(){return this.facebookTitleRef.current.offsetHeight/20}},{key:"maybeSetMaxLineCount",value:function(){var e=this.state,t="landscape"===e.imageMode?2:5;t!==e.maxLineCount&&this.setState({maxLineCount:t})}},{key:"maybeSetDescriptionLineCount",value:function(){var e=this.state,t=e.descriptionLineCount,n=e.maxLineCount,r=e.imageMode,a=this.getTitleLineCount(),o=n-a;"portrait"===r&&(o=5===a?0:4),o!==t&&this.setState({descriptionLineCount:o})}},{key:"componentDidUpdate",value:function(){this.maybeSetMaxLineCount(),this.maybeSetDescriptionLineCount()}},{key:"render",value:function(){var e=this.state,t=e.imageMode,n=e.maxLineCount,r=e.descriptionLineCount;return Object(w.createElement)(pe,{id:"facebookPreview",mode:t},Object(w.createElement)(ce,{src:this.props.imageUrl||this.props.imageFallbackUrl,alt:this.props.alt,onImageLoaded:this.onImageLoaded,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),Object(w.createElement)(fe,{mode:t},Object(w.createElement)(L,{siteUrl:this.props.siteUrl,mode:t}),Object(w.createElement)(ue,{ref:this.facebookTitleRef,onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,lineCount:n},this.props.title),r>0&&Object(w.createElement)(le,{maxWidth:de(t),onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,lineCount:r},this.props.description)))}}]),a}(O.Component);he.propTypes={siteUrl:x.a.string.isRequired,title:x.a.string.isRequired,description:x.a.string,imageUrl:x.a.string,imageFallbackUrl:x.a.string,alt:x.a.string,onSelect:x.a.func,onImageClick:x.a.func,onMouseHover:x.a.func},he.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:function(){},onImageClick:function(){},onMouseHover:function(){}};var me,be=he,ge=R.a.div(me||(me=v()(["\n\ttext-transform: lowercase;\n\tcolor: rgb(83, 100, 113);\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tmargin: 0;\n\tfill: currentcolor;\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: flex-end;\n"]))),ye=function(e){return Object(w.createElement)(ge,null,Object(w.createElement)("span",null,e.siteUrl))};ye.propTypes={siteUrl:x.a.string.isRequired};var ve,we,Oe,ke=ye;var je,xe=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e?"\n\t\t\tmax-width: ".concat(z.landscapeWidth,"px;\n\t\t\t").concat(t?"border-bottom: 1px solid #E1E8ED;":"","\n\t\t\tborder-radius: 14px 14px 0 0;\n\t\t\t"):"\n\t\twidth: ".concat(z.squareWidth,"px;\n\t\t").concat(t?"border-right: 1px solid #E1E8ED;":"","\n\t\tborder-radius: 14px 0 0 14px;\n\t\t")},Ee=R.a.div(ve||(ve=v()(["\n\tposition: relative;\n\tbox-sizing: content-box;\n\toverflow: hidden;\n\tbackground-color: #e1e8ed;\n\tflex-shrink: 0;\n\t","\n"])),(function(e){return xe(e.isLarge)})),Re=R.a.div(we||(we=v()(["\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tmax-width: 100%;\n\tmargin: 0;\n\tpadding: 1em;\n\ttext-align: center;\n\tfont-size: 1rem;\n\t","\n"])),(function(e){return xe(e.isLarge,!1)})),_e=R()(Re)(Oe||(Oe=v()(["\n\t","\n\tborder-top-left-radius: 14px;\n\t",": 14px;\n\tborder-style: dashed;\n\tborder-width: 1px;\n\t// We're not using standard colors to increase contrast for accessibility.\n\tcolor: #006DAC;\n\t// We're not using standard colors to increase contrast for accessibility.\n\tbackground-color: #f1f1f1;\n\ttext-decoration: underline;\n\tfont-size: 14px;\n\tcursor: pointer;\n"])),(function(e){return e.isLarge&&"height: ".concat(z.landscapeHeight,"px;")}),(function(e){return e.isLarge?"border-top-right-radius":"border-bottom-left-radius"})),Te=function(e){f()(o,e);var t,n,r,a=(n=o,r=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(e){return!1}}(),function(){var e,t=g()(n);if(r){var a=g()(this).constructor;e=Reflect.construct(t,arguments,a)}else e=t.apply(this,arguments);return m()(this,e)});function o(e){var t;return i()(this,o),(t=a.call(this,e)).state={status:"loading"},t.socialMedium="Twitter",t.handleTwitterImage=t.handleTwitterImage.bind(d()(t)),t.setState=t.setState.bind(d()(t)),t}return u()(o,[{key:"handleTwitterImage",value:(t=P()(A.a.mark((function e(){var t;return A.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==this.props.src){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Q(this.props.src,this.socialMedium,this.props.isLarge);case 4:t=e.sent,this.setState(t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"componentDidUpdate",value:function(e){e.src!==this.props.src&&this.handleTwitterImage()}},{key:"componentDidMount",value:function(){this.handleTwitterImage()}},{key:"render",value:function(){var e=this.state,t=e.status,n=e.imageProperties;return"loading"===t||""===this.props.src||"errored"===t?Object(w.createElement)(_e,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},Object(D.__)("Select image","wordpress-seo")):Object(w.createElement)(Ee,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},Object(w.createElement)(W,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:z.aspectRatio},width:n.width,height:n.height,imageMode:n.mode}))}}]),o}(k.a.Component);Te.propTypes={isLarge:x.a.bool.isRequired,src:x.a.string,alt:x.a.string,onImageClick:x.a.func,onMouseEnter:x.a.func,onMouseLeave:x.a.func},Te.defaultProps={src:"",alt:"",onMouseEnter:a.noop,onImageClick:a.noop,onMouseLeave:a.noop};var Se=R.a.div(je||(je=v()(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tpadding: 12px;\n\tjustify-content: center;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\tflex: auto;\n\tmin-width: 0px;\n\tgap:2px;\n\t> * {\n\t\tline-height:20px;\n\t\tmin-height:20px;\n\t\tfont-size:15px;\n }\n"]))),Ce=function(e){return Object(w.createElement)(Se,null,e.children)};Ce.propTypes={children:x.a.array.isRequired};var Ie,Le,Me,Pe,qe,Ae=Ce,De=R.a.p(Ie||(Ie=v()(["\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tmargin: 0;\n\tcolor: rgb(15, 20, 25);\n\tcursor: pointer;\n"]))),Ne=R.a.p(Le||(Le=v()(["\n\tmax-height: 55px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tmargin: 0;\n\tcolor: rgb(83, 100, 113);\n\tdisplay: -webkit-box;\n\tcursor: pointer;\n\t-webkit-line-clamp: 2;\n\t-webkit-box-orient: vertical;\n\n\t@media all and ( max-width: ","px ) {\n\t\tdisplay: none;\n\t}\n"])),z.landscapeWidth);var Fe=R.a.div(Me||(Me=v()(['\n\tfont-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;\n\tfont-size: 15px;\n\tfont-weight: 400;\n\tline-height: 20px;\n\tmax-width: 507px;\n\tborder: 1px solid #E1E8ED;\n\tbox-sizing: border-box;\n\tborder-radius: 14px;\n\tcolor: #292F33;\n\tbackground: #FFFFFF;\n\ttext-overflow: ellipsis;\n\tdisplay: flex;\n\n\t&:hover {\n\t\tbackground: #f5f8fa;\n\t\tborder: 1px solid rgba(136,153,166,.5);\n\t}\n']))),He=R()(Fe)(Pe||(Pe=v()(["\n\tflex-direction: column;\n\tmax-height: 370px;\n"]))),Ke=R()(Fe)(qe||(qe=v()(["\n\tflex-direction: row;\n\theight: 125px;\n"]))),We=function(e){f()(a,e);var t,n,r=(t=a,n=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(e){return!1}}(),function(){var e,r=g()(t);if(n){var a=g()(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return m()(this,e)});function a(e){var t;return i()(this,a),(t=r.call(this,e)).onImageEnter=t.props.onMouseHover.bind(d()(t),"image"),t.onTitleEnter=t.props.onMouseHover.bind(d()(t),"title"),t.onDescriptionEnter=t.props.onMouseHover.bind(d()(t),"description"),t.onLeave=t.props.onMouseHover.bind(d()(t),""),t.onSelectTitle=t.props.onSelect.bind(d()(t),"title"),t.onSelectDescription=t.props.onSelect.bind(d()(t),"description"),t}return u()(a,[{key:"render",value:function(){var e=this.props,t=e.isLarge,n=e.imageUrl,r=e.imageFallbackUrl,a=e.alt,o=e.title,s=e.description,i=e.siteUrl,c=t?He:Ke;return Object(w.createElement)(c,{id:"twitterPreview"},Object(w.createElement)(Te,{src:n||r,alt:a,isLarge:t,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),Object(w.createElement)(Ae,null,Object(w.createElement)(ke,{siteUrl:i}),Object(w.createElement)(De,{onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle},o),Object(w.createElement)(Ne,{onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription},s)))}}]),a}(O.Component);We.propTypes={siteUrl:x.a.string.isRequired,title:x.a.string.isRequired,description:x.a.string,isLarge:x.a.bool,imageUrl:x.a.string,imageFallbackUrl:x.a.string,alt:x.a.string,onSelect:x.a.func,onImageClick:x.a.func,onMouseHover:x.a.func},We.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:function(){},onImageClick:function(){},onMouseHover:function(){},isLarge:!0};var Be=We,Ue=n(5),ze=n(63),Ve=n(36);var Ye=function(e){f()(a,e);var t,n,r=(t=a,n=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(e){return!1}}(),function(){var e,r=g()(t);if(n){var a=g()(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return m()(this,e)});function a(e){var t;return i()(this,a),(t=r.call(this,e)).state={activeField:"",hoveredField:""},t.SocialPreview="Facebook"===e.socialMediumName?be:Be,t.setHoveredField=t.setHoveredField.bind(d()(t)),t.setActiveField=t.setActiveField.bind(d()(t)),t.setEditorRef=t.setEditorRef.bind(d()(t)),t.setEditorFocus=t.setEditorFocus.bind(d()(t)),t}return u()(a,[{key:"setHoveredField",value:function(e){e!==this.state.hoveredField&&this.setState({hoveredField:e})}},{key:"setActiveField",value:function(e){var t=this;e!==this.state.activeField&&this.setState({activeField:e},(function(){return t.setEditorFocus(e)}))}},{key:"setEditorFocus",value:function(e){switch(e){case"title":this.titleEditorRef.focus();break;case"description":this.descriptionEditorRef.focus()}}},{key:"setEditorRef",value:function(e,t){switch(e){case"title":this.titleEditorRef=t;break;case"description":this.descriptionEditorRef=t}}},{key:"render",value:function(){var e=this.props,t=e.onDescriptionChange,n=e.onTitleChange,r=e.onSelectImageClick,a=e.onRemoveImageClick,o=e.socialMediumName,s=e.imageWarnings,i=e.siteUrl,c=e.description,u=e.descriptionInputPlaceholder,l=e.descriptionPreviewFallback,d=e.imageUrl,p=e.imageFallbackUrl,f=e.alt,h=e.title,m=e.titleInputPlaceholder,b=e.titlePreviewFallback,g=e.replacementVariables,y=e.recommendedReplacementVariables,v=e.applyReplacementVariables,O=e.isPremium,j=e.isLarge,x=e.socialPreviewLabel,E=e.idSuffix,R=e.activeMetaTabId,_=v({title:h||b,description:c||l});return Object(w.createElement)(k.a.Fragment,null,x&&Object(w.createElement)(Ue.SimulatedLabel,null,x),Object(w.createElement)(this.SocialPreview,{onMouseHover:this.setHoveredField,onSelect:this.setActiveField,onImageClick:r,siteUrl:i,title:_.title,description:_.description,imageUrl:d,imageFallbackUrl:p,alt:f,isLarge:j,activeMetaTabId:R}),Object(w.createElement)(ze.SocialMetadataPreviewForm,{onDescriptionChange:t,socialMediumName:o,title:h,titleInputPlaceholder:m,onRemoveImageClick:a,imageSelected:!!d,imageUrl:d,onTitleChange:n,onSelectImageClick:r,description:c,descriptionInputPlaceholder:u,imageWarnings:s,replacementVariables:g,recommendedReplacementVariables:y,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:O,setEditorRef:this.setEditorRef,idSuffix:E}))}}]),a}(O.Component);Ye.propTypes={title:x.a.string.isRequired,onTitleChange:x.a.func.isRequired,description:x.a.string.isRequired,onDescriptionChange:x.a.func.isRequired,imageUrl:x.a.string.isRequired,imageFallbackUrl:x.a.string.isRequired,onSelectImageClick:x.a.func.isRequired,onRemoveImageClick:x.a.func.isRequired,socialMediumName:x.a.string.isRequired,alt:x.a.string,isPremium:x.a.bool,imageWarnings:x.a.array,isLarge:x.a.bool,siteUrl:x.a.string,descriptionInputPlaceholder:x.a.string,titleInputPlaceholder:x.a.string,descriptionPreviewFallback:x.a.string,titlePreviewFallback:x.a.string,replacementVariables:Ve.replacementVariablesShape,recommendedReplacementVariables:Ve.recommendedReplacementVariablesShape,applyReplacementVariables:x.a.func,socialPreviewLabel:x.a.string,idSuffix:x.a.string,activeMetaTabId:x.a.string},Ye.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",titleInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",alt:"",applyReplacementVariables:function(e){return e},socialPreviewLabel:"",idSuffix:"",activeMetaTabId:""};var Ge=function(e){return{type:e.subtype,width:e.width,height:e.height,url:e.url,id:e.id,sizes:e.sizes,alt:e.alt||e.title||e.name}};function $e(e){return new Promise((function(t,n){window.wp.media.attachment||n(),window.wp.media.attachment(e).fetch().then((function(e){t(Ge(e))})).catch((function(){return n()}))}))}function Ze(e){(function(e){var t=window.wp.media();return t.on("select",(function(){var n=t.state().get("selection").first();e(Ge(n.attributes))})),t})(e).open()}var Je=function(e){var t=Y({width:e.width,height:e.height}),n=V[t+"Width"],r=V[t+"Height"],a=Object.values(e.sizes).find((function(e){return e.width>=n&&e.height>=r}));return{url:a?a.url:e.url,id:e.id,warnings:Object(o.validateFacebookImage)(e),alt:e.alt||""}},Xe=function(e){var t="summary"!==Object(a.get)(window,"wpseoScriptData.metabox.twitterCardType")?"landscape":"square",n=z[t+"Width"],r=z[t+"Height"],s=Object.values(e.sizes).find((function(e){return e.width>=n&&e.height>=r}));return{url:s?s.url:e.url,id:e.id,warnings:Object(o.validateTwitterImage)(e),alt:e.alt||""}}},function(e,t){e.exports=window.wp.url},function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return o})),n.d(t,"g",(function(){return s})),n.d(t,"a",(function(){return i})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"h",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"l",(function(){return p})),n.d(t,"m",(function(){return f})),n.d(t,"n",(function(){return h})),n.d(t,"o",(function(){return m})),n.d(t,"k",(function(){return b})),n.d(t,"j",(function(){return g})),n.d(t,"i",(function(){return y}));var r=n(14),a="SNIPPET_EDITOR_SWITCH_MODE",o="SNIPPET_EDITOR_UPDATE_DATA",s="SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLE",i="SNIPPET_EDITOR_HIDE_REPLACEMENT_VARIABLES",c="SNIPPET_EDITOR_REMOVE_REPLACEMENT_VARIABLE",u="SNIPPET_EDITOR_REFRESH",l="SNIPPET_EDITOR_UPDATE_WORDS_TO_HIGHLIGHT",d="LOAD_SNIPPET_EDITOR_DATA";function p(e){return{type:a,mode:e}}function f(e){return{type:o,data:e}}function h(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o="string"==typeof t?Object(r.decodeHTML)(t):t;return{type:s,name:e,value:o,label:n,hidden:a}}function m(e){return{type:l,wordsToHighlight:e}}function b(e){return{type:c,name:e}}function g(){return{type:u,time:(new Date).getMilliseconds()}}function y(e){return{type:i,data:e}}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=n(0);function a(e){return e.charAt(0).toUpperCase()+e.slice(1)}function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object(r.createInterpolateElement)(e,{a:Object(r.createElement)("a",{id:n,href:t,target:"_blank",rel:"noopener noreferrer"})})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(0),a=n(1),o=n.n(a);function s(e){var t=e.target,n=e.children,a=t;return"string"==typeof t&&(a=document.getElementById(t)),a?Object(r.createPortal)(n,a):null}s.propTypes={target:o.a.oneOfType([o.a.string,o.a.object]).isRequired,children:o.a.node.isRequired}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(2),a=n(28),o=n(3);function s(e){return Object(o.isNil)(e)||(e/=10),function(e){switch(e){case"feedback":return{className:"na",screenReaderText:Object(r.__)("Feedback","wordpress-seo"),screenReaderReadabilityText:""};case"bad":return{className:"bad",screenReaderText:Object(r.__)("Needs improvement","wordpress-seo"),screenReaderReadabilityText:Object(r.__)("Needs improvement","wordpress-seo")};case"ok":return{className:"ok",screenReaderText:Object(r.__)("OK SEO score","wordpress-seo"),screenReaderReadabilityText:Object(r.__)("OK","wordpress-seo")};case"good":return{className:"good",screenReaderText:Object(r.__)("Good SEO score","wordpress-seo"),screenReaderReadabilityText:Object(r.__)("Good","wordpress-seo")};default:return{className:"loading",screenReaderText:"",screenReaderReadabilityText:""}}}(a.interpreters.scoreToRating(e))}},,function(e,t){e.exports=window.yoast.components},,function(e,t,n){"use strict";n.d(t,"b",(function(){return p}));var r=n(26),a=n.n(r),o=n(37),s=n.n(o),i=n(0),c=n(1),u=n.n(c),l=n(21),d=["title","className","showYoastIcon","additionalClassName"],p="yoast yoast-gutenberg-modal",f=function(e){var t=e.title,n=e.className,r=e.showYoastIcon,o=e.additionalClassName,c=s()(e,d),u=r?Object(i.createElement)("span",{className:"yoast-icon"}):null;return Object(i.createElement)(l.Modal,a()({title:t,className:"".concat(n," ").concat(o),icon:u},c),e.children)};f.propTypes={title:u.a.string,className:u.a.string,showYoastIcon:u.a.bool,children:u.a.oneOfType([u.a.node,u.a.arrayOf(u.a.node)]),additionalClassName:u.a.string},f.defaultProps={title:"Yoast SEO",className:p,showYoastIcon:!0,children:null,additionalClassName:""},t.a=f},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3),a=n(24);function o(){var e=Object(a.a)();return Object(r.get)(e,"contentLocale","en_US")}},function(e,t,n){"use strict";var r,a=n(8),o=n.n(a),s=n(23),i=n(14),c=n(7),u=n.n(c),l=Object(i.makeOutboundLink)(u.a.a(r||(r=o()(["\n\tdisplay: inline-block;\n\tposition: relative;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 100%;\n\twidth: 24px;\n\theight: 24px;\n\tmargin: -4px 0;\n\tvertical-align: middle;\n\n\tcolor: ",";\n\t\n\t&:hover,\n\t&:focus {\n\t\tcolor: ",";\t\n\t}\n\t\n\t// Overwrite the default blue active color for links.\n\t&:active {\n\t\tcolor: ",';\t\n\t}\n\n\t&::before {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tpadding: 2px;\n\t\tcontent: "\f223";\n\t}\n'],["\n\tdisplay: inline-block;\n\tposition: relative;\n\toutline: none;\n\ttext-decoration: none;\n\tborder-radius: 100%;\n\twidth: 24px;\n\theight: 24px;\n\tmargin: -4px 0;\n\tvertical-align: middle;\n\n\tcolor: ",";\n\t\n\t&:hover,\n\t&:focus {\n\t\tcolor: ",";\t\n\t}\n\t\n\t// Overwrite the default blue active color for links.\n\t&:active {\n\t\tcolor: ",';\t\n\t}\n\n\t&::before {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tpadding: 2px;\n\t\tcontent: "\\f223";\n\t}\n'])),s.colors.$color_help_text,s.colors.$color_snippet_focus,s.colors.$color_help_text));t.a=l},function(e,t,n){"use strict";var r,a=n(26),o=n.n(a),s=n(8),i=n.n(s),c=n(0),u=n(5),l=n(7),d=n.n(l)()(u.Collapsible)(r||(r=i()(['\n\th2 > button {\n\t\tpadding-left: 24px;\n\t\tpadding-top: 16px;\n\n\t\t&:hover {\n\t\t\tbackground-color: #f0f0f0;\n\t\t}\n\t}\n\n\tdiv[class^="collapsible_content"] {\n\t\tpadding: 24px 0;\n\t\tmargin: 0 24px;\n\t\tborder-top: 1px solid rgba(0,0,0,0.2);\n\t}\n\n'])));t.a=function(e){return Object(c.createElement)(d,o()({hasPadding:!0,hasSeparator:!0},e))}},,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],_n=!0,s=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);_n=!0);}catch(e){s=!0,a=e}finally{try{_n||null==n.return||n.return()}finally{if(s)throw a}}return o}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.yoast.socialMetadataForms},function(e,t,n){"use strict";n.r(t),n.d(t,"nonReplaceVars",(function(){return p})),n.d(t,"fillReplacementVariables",(function(){return f})),n.d(t,"handlePrefixes",(function(){return h})),n.d(t,"createLabelFromName",(function(){return m})),n.d(t,"pushNewReplaceVar",(function(){return b})),n.d(t,"replaceSpaces",(function(){return g})),n.d(t,"prepareCustomFieldForDispatch",(function(){return y})),n.d(t,"prepareCustomTaxonomyForDispatch",(function(){return v})),n.d(t,"mapCustomTaxonomies",(function(){return w})),n.d(t,"mapCustomFields",(function(){return O})),n.d(t,"excerptFromContent",(function(){return k})),n.d(t,"applyReplaceUsingPlugin",(function(){return j}));var r=n(18),a=n.n(r),o=n(3),s=n(113),i=n(45),c=n(47);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=n(14).strings.stripHTMLTags,p=["slug","content","contentImage","snippetPreviewImageURL"];function f(e,t){Object(o.forEach)(e,(function(e,n){p.includes(n)||t.dispatch(Object(i.n)(n,e))}))}function h(e){if(!["ct_","cf_","pt_"].includes(e.substr(0,3)))return e.replace(/_/g," ");var t=e.slice(0,3);switch(-1!==(e=e.slice(3)).indexOf("desc_")&&(e=e.slice(5)+" description"),t){case"ct_":e+=" (custom taxonomy)";break;case"cf_":e+=" (custom field)";break;case"pt_":e="Post type ("+(e=e.replace("single","singular"))+")"}return e}function m(e){return e=h(e),Object(c.b)(e)}function b(e,t){return e.push({name:t.name,label:t.label||m(t.name),value:t.value}),e}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_";return e.replace(/\s/g,t)}function y(e){return{name:"cf_"+g(e),label:Object(c.b)(e+" (custom field)")}}function v(e){var t=g(e);return{name:"ct_"+t,label:Object(c.b)(e+" (custom taxonomy)"),descriptionName:"ct_desc_"+t,descriptionLabel:Object(c.b)(e+" description (custom taxonomy)")}}function w(e,t){return e.custom_taxonomies?(Object(o.forEach)(e.custom_taxonomies,(function(e,n){var r=v(n),a=r.name,o=r.label,s=r.descriptionName,c=r.descriptionLabel;t.dispatch(Object(i.n)(a,e.name,o)),t.dispatch(Object(i.n)(s,e.description,c))})),Object(o.omit)(l({},e),"custom_taxonomies")):e}function O(e,t){return e.custom_fields?(Object(o.forEach)(e.custom_fields,(function(e,n){var r=y(n),a=r.name,o=r.label;t.dispatch(Object(i.n)(a,e,o))})),Object(o.omit)(l({},e),"custom_fields")):e}function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:156;return(e=(e=Object(s.stripTags)(e)).trim()).length<=t||(e=e.substring(0,t),/\s/.test(e)&&(e=e.substring(0,e.lastIndexOf(" ")))),e}var j=function(e){var t=Object(o.get)(window,["YoastSEO","app","pluggable"],!1);if(!t||!Object(o.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){var t=Object(o.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],o.identity);return{url:e.url,title:d(t(e.title)),description:d(t(e.description))}}(e);var n=t._applyModifications.bind(t);return{url:e.url,title:d(n("data_page_title",e.title)),description:d(n("data_meta_desc",e.description))}}},function(e,t,n){"use strict";var r=n(25),a=n.n(r),o=n(0),s=n(1),i=n.n(s),c=n(2),u=function(e){var t=e.data,n=e.mapChartDataToTableData,r=e.dataTableCaption,a=e.dataTableHeaderLabels,s=e.isDataTableVisuallyHidden;return t.length!==a.length?Object(o.createElement)("p",null,Object(c.__)("The number of headers and header labels don't match.","wordpress-seo")):Object(o.createElement)("div",{className:s?"screen-reader-text":null},Object(o.createElement)("table",null,Object(o.createElement)("caption",null,r),Object(o.createElement)("thead",null,Object(o.createElement)("tr",null,a.map((function(e,t){return Object(o.createElement)("th",{key:t},e)})))),Object(o.createElement)("tbody",null,Object(o.createElement)("tr",null,t.map((function(e,t){return Object(o.createElement)("td",{key:t},n(e.y))}))))))};u.propTypes={data:i.a.arrayOf(i.a.shape({x:i.a.number,y:i.a.number})).isRequired,mapChartDataToTableData:i.a.func,dataTableCaption:i.a.string.isRequired,dataTableHeaderLabels:i.a.array.isRequired,isDataTableVisuallyHidden:i.a.bool},u.defaultProps={mapChartDataToTableData:null,isDataTableVisuallyHidden:!0};var l=u,d=function(e){var t=e.data,n=e.width,r=e.height,s=e.fillColor,i=e.strokeColor,c=e.strokeWidth,u=e.className,d=e.mapChartDataToTableData,p=e.dataTableCaption,f=e.dataTableHeaderLabels,h=e.isDataTableVisuallyHidden,m=Math.max(1,Math.max.apply(Math,a()(t.map((function(e){return e.x}))))),b=Math.max(1,Math.max.apply(Math,a()(t.map((function(e){return e.y}))))),g=r-c,y=t.map((function(e){var t=e.x/m*n,r=g-e.y/b*g+c;return"".concat(t,",").concat(r)})).join(" "),v="0,".concat(g+c," ")+y+" ".concat(n,",").concat(g+c);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("svg",{width:n,height:r,viewBox:"0 0 ".concat(n," ").concat(r),className:u,role:"img","aria-hidden":"true",focusable:"false"},Object(o.createElement)("polygon",{fill:s,points:v}),Object(o.createElement)("polyline",{fill:"none",stroke:i,strokeWidth:c,strokeLinejoin:"round",strokeLinecap:"round",points:y})),d&&Object(o.createElement)(l,{data:t,mapChartDataToTableData:d,dataTableCaption:p,dataTableHeaderLabels:f,isDataTableVisuallyHidden:h}))};d.propTypes={data:i.a.arrayOf(i.a.shape({x:i.a.number,y:i.a.number})).isRequired,width:i.a.number.isRequired,height:i.a.number.isRequired,fillColor:i.a.string,strokeColor:i.a.string,strokeWidth:i.a.number,className:i.a.string,mapChartDataToTableData:i.a.func,dataTableCaption:i.a.string.isRequired,dataTableHeaderLabels:i.a.array.isRequired,isDataTableVisuallyHidden:i.a.bool},d.defaultProps={fillColor:null,strokeColor:"#000000",strokeWidth:1,className:"",mapChartDataToTableData:null,isDataTableVisuallyHidden:!0},t.a=d},function(e,t,n){"use strict";function r(){}n.d(t,"a",(function(){return r}))},,function(e,t,n){"use strict";function r(e){return function(){return e}}var a=function(){};a.thatReturns=r,a.thatReturnsFalse=r(!1),a.thatReturnsTrue=r(!0),a.thatReturnsNull=r(null),a.thatReturnsThis=function(){return this},a.thatReturnsArgument=function(e){return e},e.exports=a},function(e,t,n){"use strict";n.r(t),n.d(t,"getIconForScore",(function(){return i})),n.d(t,"default",(function(){return c}));var r=n(28),a=n(23);function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.getIdentifier(),a={score:e.score,rating:r.interpreters.scoreToRating(e.score),hasMarks:e.hasMarks(),marker:e.getMarker(),id:n,text:e.text,markerId:t.length>0?"".concat(t,":").concat(n):n};return"ok"===a.rating&&(a.rating="OK"),a}function s(e,t){switch(e.rating){case"error":t.errorsResults.push(e);break;case"feedback":t.considerationsResults.push(e);break;case"bad":t.problemsResults.push(e);break;case"OK":t.improvementsResults.push(e);break;case"good":t.goodResults.push(e)}return t}function i(e){var t={icon:"seo-score-none",color:a.colors.$color_red};switch(e){case"loading":t={icon:"loading-spinner",color:a.colors.$color_green_medium_light};break;case"good":t={icon:"seo-score-good",color:a.colors.$color_green_medium};break;case"ok":t={icon:"seo-score-ok",color:a.colors.$color_ok};break;case"bad":t={icon:"seo-score-bad",color:a.colors.$color_red}}return t}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={errorsResults:[],problemsResults:[],improvementsResults:[],goodResults:[],considerationsResults:[]};if(!e)return n;for(var r=0;r<e.length;r++){var a=e[r];if(a.text){var i=o(a,t);n=s(i,n)}}return n}},function(e,t,n){var r=n(39);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(0),a=n(1),o=n.n(a),s=n(7),i=n(30),c=function(e){var t=e.theme,n=e.location,a=e.children;return Object(r.createElement)(i.LocationProvider,{value:n},Object(r.createElement)(s.ThemeProvider,{theme:t},a))};c.propTypes={theme:o.a.object.isRequired,location:o.a.oneOf(["sidebar","metabox","modal"]).isRequired,children:o.a.element.isRequired},t.a=c},function(e,t){e.exports=window.moment},function(e,t,n){"use strict";var r=n(27),a=n.n(r),o=n(0),s=n(5),i=n(1),c=n.n(i),u=function(e){var t=Object(o.useState)(!1),n=a()(t,2),r=n[0],i=n[1],c=e.prefixIcon;return Object(o.createElement)("div",{className:"yoast components-panel__body ".concat(r?"is-opened":"")},Object(o.createElement)("h2",{className:"components-panel__body-title"},Object(o.createElement)("button",{onClick:function(){i(!r)},className:"components-button components-panel__body-toggle"},Object(o.createElement)("span",{className:"yoast-icon-span",style:{fill:"".concat(c&&c.color||"")}},c&&Object(o.createElement)(s.SvgIcon,{icon:c.icon,color:c.color,size:c.size})),Object(o.createElement)("span",{className:"yoast-title-container"},Object(o.createElement)("div",{className:"yoast-title"},e.title),Object(o.createElement)("div",{className:"yoast-subtitle"},e.subTitle)),Object(o.createElement)("span",{className:"yoast-chevron","aria-hidden":"true"}))),r&&e.children)};t.a=u,u.propTypes={title:c.a.string.isRequired,children:c.a.oneOfType([c.a.node,c.a.arrayOf(c.a.node)]).isRequired,prefixIcon:c.a.object,subTitle:c.a.string},u.defaultProps={prefixIcon:null,subTitle:""}},function(e,t,n){"use strict";function r(){return window.wpseoScriptData&&"1"===window.wpseoScriptData.isBlockEditor}n.d(t,"a",(function(){return r}))},,,function(e,t,n){"use strict";var r=n(20),a=n(6),o=n(85);t.a=Object(r.compose)([Object(a.withSelect)((function(e,t){var n=e("yoast-seo/editor"),r=n.getPostOrPageString,a=n.getIsModalOpen;return{postTypeName:r(),isOpen:a(t.id)}})),Object(a.withDispatch)((function(e,t){var n=e("yoast-seo/editor"),r=n.openEditorModal;return{open:function(){return r(t.id)},close:n.closeEditorModal}}))])(o.a)},,,,function(e,t,n){"use strict";n.r(t),n.d(t,"sortResultsByIdentifier",(function(){return i})),n.d(t,"default",(function(){return c})),n.d(t,"initializationDone",(function(){return u}));var r=n(19),a=n(66),o=n(52),s=!1;function i(e){return e.sort((function(e,t){return e._identifier.localeCompare(t._identifier)}))}function c(e,t,n,c,u){var l=t();s&&e.analyze(l).then((function(e){var t=e.result,a=t.seo,s=t.readability;if(a){var d=a[""];d.results.forEach((function(e){e.getMarker=function(){return function(){return n(l,e.marks)}}})),d.results=i(d.results),c.dispatch(r.actions.setSeoResultsForKeyword(l.getKeyword(),d.results)),c.dispatch(Object(o.setOverallSeoScore)(d.score,l.getKeyword())),c.dispatch(r.actions.refreshSnippetEditor()),u.saveScores(d.score,l.getKeyword())}s&&(s.results.forEach((function(e){e.getMarker=function(){return function(){return n(l,e.marks)}}})),s.results=i(s.results),c.dispatch(r.actions.setReadabilityResults(s.results)),c.dispatch(Object(o.setOverallReadabilityScore)(s.score)),c.dispatch(r.actions.refreshSnippetEditor()),u.saveContentScore(s.score))})).catch(a.a)}function u(){s=!0}},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"b",(function(){return d}));var r=n(0),a=n(2),o=n(54),s=n(1),i=n.n(s),c=n(3),u=n(86),l=n(30),d=function(e){var t=!0;if("blur"===e.type){var n=e.relatedTarget;if(n){var r=["media-modal","wp-core-ui"];t=Object(c.intersection)(r,Array.from(n.classList)).length!==r.length}}return t},p=function(e){var t=e.id,n=e.postTypeName,s=e.children,i=e.title,c=e.isOpen,p=e.close,f=e.open,h=e.shouldCloseOnClickOutside,m=Object(r.useCallback)((function(e){d(e)&&p()}),[p]);return Object(r.createElement)(r.Fragment,null,c&&Object(r.createElement)(l.LocationProvider,{value:"modal"},Object(r.createElement)(o.a,{title:i,onRequestClose:m,additionalClassName:"yoast-collapsible-modal yoast-post-settings-modal",id:"id",shouldCloseOnClickOutside:h},Object(r.createElement)("div",{className:"yoast-content-container"},Object(r.createElement)("div",{className:"yoast-modal-content"},s)),Object(r.createElement)("div",{className:"yoast-notice-container"},Object(r.createElement)("hr",null),Object(r.createElement)("div",{className:"yoast-button-container"},Object(r.createElement)("p",null, | |
| 2 | -/* Translators: %s translates to the Post Label in singular form */ | |
| 3 | -Object(a.sprintf)(Object(a.__)("Make sure to save your %s for changes to take effect","wordpress-seo"),n)),Object(r.createElement)("button",{className:"yoast-button yoast-button--primary yoast-button--post-settings-modal",type:"button",onClick:m}, | |
| 4 | -/* Translators: %s translates to the Post Label in singular form */ | |
| 5 | -Object(a.sprintf)(Object(a.__)("Return to your %s","wordpress-seo"),n)))))),Object(r.createElement)(u.a,{id:t+"-open-button",title:i,suffixIcon:{size:"20px",icon:"pencil-square"},onClick:f}))};p.propTypes={id:i.a.string.isRequired,postTypeName:i.a.string.isRequired,children:i.a.oneOfType([i.a.node,i.a.arrayOf(i.a.node)]).isRequired,title:i.a.string.isRequired,isOpen:i.a.bool.isRequired,open:i.a.func.isRequired,close:i.a.func.isRequired,shouldCloseOnClickOutside:i.a.bool},p.defaultProps={shouldCloseOnClickOutside:!0},t.a=p},function(e,t,n){"use strict";var r=n(0),a=n(5),o=n(1),s=n.n(o),i=function(e){return Object(r.createElement)("div",{className:"yoast components-panel__body"},Object(r.createElement)("h2",{className:"components-panel__body-title"},Object(r.createElement)("button",{id:e.id,onClick:e.onClick,className:"components-button components-panel__body-toggle"},e.prefixIcon&&Object(r.createElement)("span",{className:"yoast-icon-span",style:{fill:"".concat(e.prefixIcon&&e.prefixIcon.color||"")}},Object(r.createElement)(a.SvgIcon,{size:e.prefixIcon.size,icon:e.prefixIcon.icon})),Object(r.createElement)("span",{className:"yoast-title-container"},Object(r.createElement)("div",{className:"yoast-title"},e.title),Object(r.createElement)("div",{className:"yoast-subtitle"},e.subTitle)),e.suffixIcon&&Object(r.createElement)(a.SvgIcon,{size:e.suffixIcon.size,icon:e.suffixIcon.icon}))))};t.a=i,i.propTypes={onClick:s.a.func.isRequired,title:s.a.string.isRequired,id:s.a.string,subTitle:s.a.string,suffixIcon:s.a.object,prefixIcon:s.a.object},i.defaultProps={id:"",suffixIcon:null,prefixIcon:null,subTitle:""}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return g})),n.d(t,"b",(function(){return y}));var r=n(0),a=n(1),o=n.n(a),s=n(2),i=n(3),c=n(74),u=n.n(c),l=n(5),d=n(14),p=n(65),f=function(){return Object(r.createElement)("p",{className:"yoast-wincher-seo-performance-modal__loading-message"},Object(s.__)("Tracking the ranking position...","wordpress-seo")," ",Object(r.createElement)(l.SvgIcon,{icon:"loading-spinner"}))},h=Object(d.makeOutboundLink)();function m(e){return Math.round(100*e)}function b(e){var t=e.chartData;if(Object(i.isEmpty)(t)||Object(i.isEmpty)(t.position))return"?";var n=function(e){return Array.from({length:e.position.history.length},(function(e,t){return t+1})).map((function(e){ | |
| 6 | -/* translators: %d expands to the amount of days */ | |
| 7 | -return Object(s.sprintf)(Object(s._n)("%d day","%d days",e,"wordpress-seo"),e)}))}(t),a=t.position.history.map((function(e,t){return{x:t,y:101-e.value}}));return Object(r.createElement)(p.a,{width:66,height:24,data:a,strokeWidth:1.8,strokeColor:"#498afc",fillColor:"#ade3fc",className:"yoast-related-keyphrases-modal__chart",mapChartDataToTableData:m,dataTableCaption:Object(s.__)("Keyphrase position in the last 90 days on a scale from 0 to 100.","wordpress-seo"),dataTableHeaderLabels:n})}function g(e){return!e||!e.position||e.position.value>100?"> 100":e.position.value}function y(e){var t=e.keyphrase,n=e.rowData,a=e.onTrackKeyphrase,o=e.onUntrackKeyphrase,c=e.isFocusKeyphrase,d=e.isDisabled,p=e.isLoading,m=!Object(i.isEmpty)(n),y=Object(r.useCallback)((function(){d||(m?o(t,n.id):a(t))}),[t,a,o,m,n,d]);return Object(r.createElement)("tr",null,Object(r.createElement)("td",{className:"yoast-table--nopadding"},function(e){var t=e.keyphrase,n=e.isEnabled,a=e.toggleAction;return e.isLoading?Object(r.createElement)(l.SvgIcon,{icon:"loading-spinner"}):Object(r.createElement)(l.Toggle,{id:"toggle-keyphrase-tracking-".concat(t),className:"wincher-toggle",isEnabled:n,onSetToggleState:a,showToggleStateLabel:!1})}({keyphrase:t,isEnabled:m,toggleAction:y,isLoading:p})),Object(r.createElement)("td",null,t,c&&Object(r.createElement)("span",null,"*")),function(e){var t=e.rowData,n=e.websiteId,a=!Object(i.isEmpty)(t),o=t&&t.updated_at&&u()(t.updated_at)>=u()().subtract(7,"days"),c=t?Object(s.sprintf)("https://app.wincher.com/websites/%s/keywords?serp=%s&utm_medium=plugin&utm_source=yoast&referer=yoast&partner=yoast",n,t.id):null;return a?o?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("td",null,g(t)),Object(r.createElement)("td",{className:"yoast-table--nopadding"},Object(r.createElement)(b,{chartData:t})),Object(r.createElement)("td",{className:"yoast-table--nobreak"},Object(r.createElement)(h,{href:c},Object(s.__)("View","wordpress-seo")))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("td",{className:"yoast-table--nopadding",colSpan:"3"},Object(r.createElement)(f,null))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("td",null,"?"),Object(r.createElement)("td",{className:"yoast-table--nopadding"},"?"),Object(r.createElement)("td",{className:"yoast-table--nobreak"}))}(e))}b.propTypes={chartData:o.a.object},b.defaultProps={chartData:{}},y.propTypes={rowData:o.a.object,keyphrase:o.a.string.isRequired,onTrackKeyphrase:o.a.func,onUntrackKeyphrase:o.a.func,isFocusKeyphrase:o.a.bool,isDisabled:o.a.bool,isLoading:o.a.bool,websiteId:o.a.string},y.defaultProps={rowData:{},onTrackKeyphrase:function(){},onUntrackKeyphrase:function(){},isFocusKeyphrase:!1,isDisabled:!1,isLoading:!1,websiteId:""}},,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(15),a=n.n(r),o=n(12),s=n.n(o),i=n(13),c=n.n(i),u=n(9),l=n.n(u),d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s()(this,e),this.url=t,this.origin=new URL(t).origin,this.eventHandlers=Object.assign({success:{type:"",callback:function(){}},error:{type:"",callback:function(){}}},n),this.options=Object.assign({height:570,width:340,title:""},r),this.popup=null,this.createPopup=this.createPopup.bind(this),this.messageHandler=this.messageHandler.bind(this),this.getPopup=this.getPopup.bind(this)}var t;return c()(e,[{key:"createPopup",value:function(){var e=this.options,t=e.height,n=e.width,r=e.title,a=["top="+(window.top.outerHeight/2+window.top.screenY-t/2),"left="+(window.top.outerWidth/2+window.top.screenX-n/2),"width="+n,"height="+t,"resizable=1","scrollbars=1","status=0"];this.popup&&!this.popup.closed||(this.popup=window.open(this.url,r,a.join(","))),this.popup&&this.popup.focus(),window.addEventListener("message",this.messageHandler,!1)}},{key:"messageHandler",value:(t=a()(l.a.mark((function e(t){var n,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.data,r=t.source,t.origin===this.origin&&this.popup===r){e.next=3;break}return e.abrupt("return");case 3:if(n.type!==this.eventHandlers.success.type){e.next=8;break}return this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),e.next=8,this.eventHandlers.success.callback(n);case 8:if(n.type!==this.eventHandlers.error.type){e.next=13;break}return this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),e.next=13,this.eventHandlers.error.callback(n);case 13:case"end":return e.stop()}}),e,this)}))),function(_x){return t.apply(this,arguments)})},{key:"getPopup",value:function(){return this.popup}},{key:"isClosed",value:function(){return!this.popup||this.popup.closed}},{key:"focus",value:function(){this.isClosed()||this.popup.focus()}}]),e}()},function(e,t,n){"use strict";var r=n(0),a=n(1),o=n.n(a),s=n(2),i=n(31),c=n.n(i),u=n(5),l=function(e){var t=Object(s.sprintf)( | |
| 8 | -/* translators: %s expands to a link to open the Wincher login popup. */ | |
| 9 | -Object(s.__)("It seems like something went wrong when retrieving your website's data. Please %s and try again.","wordpress-seo"),"{{reconnectToWincher/}}","Wincher");return Object(r.createElement)(u.Alert,{type:"error"},c()({mixedString:t,components:{reconnectToWincher:Object(r.createElement)("a",{href:"#",onClick:e.onReconnect},Object(s.sprintf)( | |
| 10 | -/* translators: %s : Expands to "Wincher". */ | |
| 11 | -Object(s.__)("reconnect to %s","wordpress-seo"),"Wincher"))}}))};l.propTypes={onReconnect:o.a.func.isRequired},t.a=l},,,function(e,t,n){"use strict";var r=n(4),a="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=n(68),s=n(97),i=n(98),c="function"==typeof Symbol&&Symbol.iterator;function u(e,t){return e&&"object"==typeof e&&null!=e.key?(n=e.key,r={"=":"=0",":":"=2"},"$"+(""+n).replace(/[=:]/g,(function(e){return r[e]}))):t.toString(36);var n,r}var l=/\/+/g;function d(e){return(""+e).replace(l,"$&/")}var p,f,h=m,m=function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)};function b(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function g(e,t,n){var a,s,i=e.result,c=e.keyPrefix,u=e.func,l=e.context,p=u.call(l,t,e.count++);Array.isArray(p)?y(p,i,n,o.thatReturnsArgument):null!=p&&(r.isValidElement(p)&&(a=p,s=c+(!p.key||t&&t.key===p.key?"":d(p.key)+"/")+n,p=r.cloneElement(a,{key:s},void 0!==a.props?a.props.children:void 0)),i.push(p))}function y(e,t,n,r,o){var i="";null!=n&&(i=d(n)+"/");var l=b.getPooled(t,i,r,o);!function(e,t,n){null==e||function e(t,n,r,o){var i,l=typeof t;if("undefined"!==l&&"boolean"!==l||(t=null),null===t||"string"===l||"number"===l||"object"===l&&t.$$typeof===a)return r(o,t,""===n?"."+u(t,0):n),1;var d=0,p=""===n?".":n+":";if(Array.isArray(t))for(var f=0;f<t.length;f++)d+=e(i=t[f],p+u(i,f),r,o);else{var h=function(e){var t=e&&(c&&e[c]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(h)for(var m,b=h.call(t),g=0;!(m=b.next()).done;)d+=e(i=m.value,p+u(i,g++),r,o);else if("object"===l){var y=""+t;s(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===y?"object with keys {"+Object.keys(t).join(", ")+"}":y,"")}}return d}(e,"",t,n)}(e,g,l),b.release(l)}b.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},p=function(e,t,n,r){if(this.instancePool.length){var a=this.instancePool.pop();return this.call(a,e,t,n,r),a}return new this(e,t,n,r)},(f=b).instancePool=[],f.getPooled=p||h,f.poolSize||(f.poolSize=10),f.release=function(e){s(e instanceof this,"Trying to release an instance into a pool of a different type."),e.destructor(),this.instancePool.length<this.poolSize&&this.instancePool.push(e)},e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return i(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(r.isValidElement(e))return i(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;s(1!==e.nodeType,"React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.");var t=[];for(var n in e)y(e[n],t,n,o.thatReturnsArgument);return t}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,a,o,s,i){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,a,o,s,i],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){"use strict";var r=n(68);e.exports=r},function(e,t,n){"use strict";function r(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(r)}},function(e,t,n){"use strict";var r=n(0),a=n(2),o=n(31),s=n.n(o),i=n(14),c=Object(i.makeOutboundLink)(),u=Object(i.makeOutboundLink)();t.a=function(){var e=Object(a.sprintf)(Object(a.__)( | |
| 12 | -/* translators: %1$s expands to a link to Wincher, %2$s expands to a link to the keyphrase tracking article on Yoast.com */ | |
| 13 | -"With %1$s you can track the ranking position of your page in the search results based on your keyphrase(s). %2$s","wordpress-seo"),"{{wincherLink/}}","{{wincherReadMoreLink/}}");return Object(r.createElement)("p",null,s()({mixedString:e,components:{wincherLink:Object(r.createElement)(c,{href:wpseoAdminGlobalL10n["links.wincher.website"]},"Wincher"),wincherReadMoreLink:Object(r.createElement)(u,{href:wpseoAdminL10n["shortlinks.wincher.seo_performance"]},Object(a.__)("Read more about keyphrase tracking with Wincher","wordpress-seo"))}}))}},function(e,t,n){"use strict";var r=n(6),a=n(20),o=n(26),s=n.n(o),i=n(8),c=n.n(i),u=n(15),l=n.n(u),d=n(0),p=n(9),f=n.n(p),h=n(2),m=n(1),b=n.n(m),g=n(3),y=n(7),v=n.n(y),w=n(5),O=n(14),k=n(31),j=n.n(k),x=Object(O.makeOutboundLink)(),E=function(e){var t=Object(h.sprintf)( | |
| 14 | -/* translators: %d expands to the amount of allowed keyphrases on a free account, %s expands to a link to Wincher plans. */ | |
| 15 | -Object(h.__)("You've reached the maximum amount of %d keyphrases you can add to your Wincher account. If you wish to add more keyphrases, please %s.","wordpress-seo"),e.limit,"{{updateWincherPlanLink/}}");return Object(d.createElement)(w.Alert,{type:"error"},j()({mixedString:t,components:{updateWincherPlanLink:Object(d.createElement)(x,{href:wpseoAdminGlobalL10n["links.wincher.pricing"]},Object(h.sprintf)( | |
| 16 | -/* translators: %s : Expands to "Wincher". */ | |
| 17 | -Object(h.__)("upgrade your %s plan","wordpress-seo"),"Wincher"))}}))};E.propTypes={limit:b.a.number},E.defaultProps={limit:10};var R,_,T,S=E,C=function(){return Object(d.createElement)(w.Alert,{type:"error"},Object(h.__)("Something went wrong while tracking the ranking position(s) of your page. Please try again later.","wordpress-seo"))},I=function(){return Object(d.createElement)(w.Alert,{type:"success"},Object(h.sprintf)( | |
| 18 | -/* translators: %s: Expands to "Wincher". */ | |
| 19 | -Object(h.__)("You have successfully connected to %s! You can now track the SEO performance for the keyphrase(s) of this page.","wordpress-seo"),"Wincher"))},L=function(){return Object(d.createElement)(w.Alert,{type:"info"},Object(h.sprintf)( | |
| 20 | -/* translators: %s: Expands to "Wincher". */ | |
| 21 | -Object(h.__)("%s is currently tracking the ranking position(s) of your page. This may take a few minutes. Please wait or check back later.","wordpress-seo"),"Wincher"))},M=n(25),P=n.n(M),q=n(27),A=n.n(q),D=n(88),N=n(42),F=n(32),H=Object(O.makeOutboundLink)(),K=v.a.span(R||(R=c()(["\n\tdisplay: block;\n\tfont-style: italic;\n\n\t@media (min-width: 782px) {\n\t\tdisplay: inline;\n\t\tposition: absolute;\n\t\t",": 8px;\n\t}\n"])),Object(O.getDirectionalStyle)("right","left")),W=v.a.th(_||(_=c()(["\n\tmin-width: 60px;\n"]))),B=v.a.div(T||(T=c()(["\n\twidth: 100%;\n\toverflow-y: auto;\n"]))),U=function(e){var t=Object(d.useRef)();return Object(d.useEffect)((function(){t.current=e})),t.current},z=Object(g.debounce)(N.c,500,{leading:!0}),V=function(e){var t=e.addTrackedKeyphrase,n=e.isLoggedIn,r=e.keyphrases,a=e.permalink,o=e.removeTrackedKeyphrase,s=e.setKeyphraseLimitReached,i=e.setRequestFailed,c=e.setRequestSucceeded,u=e.setTrackedKeyphrases,p=e.setHasTrackedAll,m=e.trackAll,b=e.trackedKeyphrases,y=e.isNewlyAuthenticated,v=e.websiteId,w=e.focusKeyphrase,O=e.newRequest,k=Object(d.useRef)(),j=Object(d.useRef)(),x=Object(d.useRef)(!1),E=Object(d.useState)([]),R=A()(E,2),_=R[0],T=R[1],S=Object(d.useCallback)((function(e){var t=e.toLowerCase();return b&&!Object(g.isEmpty)(b)&&b.hasOwnProperty(t)?b[t]:null}),[b]),C=Object(d.useMemo)((function(){return l()(f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(F.b)((function(){return j.current&&j.current.abort(),j.current="undefined"==typeof AbortController?null:new AbortController,z(r,a,j.current.signal)}),(function(e){c(e),u(e.results)}),(function(e){i(e)}));case 2:case"end":return e.stop()}}),e)})))}),[c,i,u,r,a]),I=Object(d.useCallback)(function(){var e=l()(f.a.mark((function e(n){var r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(Array.isArray(n)?n:[n]).map((function(e){return e.toLowerCase()})),T((function(e){return[].concat(P()(e),P()(r))})),e.next=4,Object(F.b)((function(){return Object(N.d)(r)}),(function(e){c(e),t(e.results),C()}),(function(e){400===e.status&&e.limit&&s(e.limit),i(e)}),201);case 4:T((function(e){return g.without.apply(void 0,[e].concat(P()(r)))}));case 5:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}(),[c,i,s,t,C]),L=Object(d.useCallback)(function(){var e=l()(f.a.mark((function e(t,n){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=t.toLowerCase(),T((function(e){return[].concat(P()(e),[t])})),e.next=4,Object(F.b)((function(){return Object(N.e)(n)}),(function(e){c(e),o(t)}),(function(e){i(e)}));case 4:T((function(e){return Object(g.without)(e,t)}));case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),[c,o,i]),M=Object(d.useCallback)(function(){var e=l()(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(),e.next=3,I(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[O,I]),q=U(a),V=U(r);Object(d.useEffect)((function(){n&&a&&(a!==q||Object(g.difference)(r,V).length)&&C()}),[n,a,q,r,V,C]),Object(d.useEffect)((function(){if(n&&m&&null!==b){var e=r.filter((function(e){return!S(e)}));e.length&&I(e),p()}}),[n,m,b,I,p,S,r]),Object(d.useEffect)((function(){y&&!x.current&&(C(),x.current=!0)}),[y,C]),Object(d.useEffect)((function(){if(n&&!Object(g.isEmpty)(b))return Object(g.filter)(b,(function(e){return Object(g.isEmpty)(e.updated_at)})).length>0&&(k.current=setInterval((function(){C()}),1e4)),function(){clearInterval(k.current)}}),[n,b,C]);var Y=n&&null===b;return r&&!Object(g.isEmpty)(r)&&Object(d.createElement)(d.Fragment,null,Object(d.createElement)(B,null,Object(d.createElement)("table",{className:"yoast yoast-table"},Object(d.createElement)("thead",null,Object(d.createElement)("tr",null,Object(d.createElement)("th",{scope:"col",abbr:Object(h.__)("Tracking","wordpress-seo")},Object(h.__)("Tracking","wordpress-seo")),Object(d.createElement)("th",{scope:"col",abbr:Object(h.__)("Keyphrase","wordpress-seo")},Object(h.__)("Keyphrase","wordpress-seo")),Object(d.createElement)("th",{scope:"col",abbr:Object(h.__)("Position","wordpress-seo")},Object(h.__)("Position","wordpress-seo")),Object(d.createElement)("th",{scope:"col",abbr:Object(h.__)("Position over time","wordpress-seo")},Object(h.__)("Position over time","wordpress-seo")),Object(d.createElement)(W,{className:"yoast-table--nobreak"}))),Object(d.createElement)("tbody",null,r.map((function(e,t){return Object(d.createElement)(D.b,{key:"trackable-keyphrase-".concat(t),keyphrase:e,onTrackKeyphrase:M,onUntrackKeyphrase:L,rowData:S(e),isFocusKeyphrase:e===w.trim(),websiteId:v,isDisabled:!n,isLoading:Y||_.indexOf(e.toLowerCase())>=0})}))))),Object(d.createElement)("p",{style:{marginBottom:0,position:"relative"}},Object(d.createElement)(H,{href:wpseoAdminGlobalL10n["links.wincher.login"]},Object(h.sprintf)( | |
| 22 | -/* translators: %s expands to Wincher */ | |
| 23 | -Object(h.__)("Get more insights over at %s","wordpress-seo"),"Wincher")),Object(d.createElement)(K,null,Object(h.__)("* focus keyphrase","wordpress-seo"))))};V.propTypes={addTrackedKeyphrase:b.a.func.isRequired,isLoggedIn:b.a.bool,isNewlyAuthenticated:b.a.bool,keyphrases:b.a.array,newRequest:b.a.func.isRequired,removeTrackedKeyphrase:b.a.func.isRequired,setRequestFailed:b.a.func.isRequired,setKeyphraseLimitReached:b.a.func.isRequired,setRequestSucceeded:b.a.func.isRequired,setTrackedKeyphrases:b.a.func.isRequired,setHasTrackedAll:b.a.func.isRequired,trackAll:b.a.bool,trackedKeyphrases:b.a.object,websiteId:b.a.string,permalink:b.a.string.isRequired,focusKeyphrase:b.a.string},V.defaultProps={isLoggedIn:!1,isNewlyAuthenticated:!1,keyphrases:[],trackAll:!1,trackedKeyphrases:null,websiteId:"",focusKeyphrase:""};var Y,G,$,Z=V,J=Object(a.compose)([Object(r.withSelect)((function(e){var t=e("yoast-seo/editor"),n=t.getWincherWebsiteId,r=t.getWincherTrackedKeyphrases,a=t.getWincherTrackableKeyphrases,o=t.getWincherLoginStatus,s=t.getWincherPermalink,i=t.getFocusKeyphrase,c=t.isWincherNewlyAuthenticated,u=t.shouldWincherTrackAll;return{focusKeyphrase:i(),keyphrases:a(),trackedKeyphrases:r(),isLoggedIn:o(),trackAll:u(),websiteId:n(),isNewlyAuthenticated:c(),permalink:s()}})),Object(r.withDispatch)((function(e){var t=e("yoast-seo/editor"),n=t.setWincherNewRequest,r=t.setWincherRequestSucceeded,a=t.setWincherRequestFailed,o=t.setWincherSetKeyphraseLimitReached,s=t.setWincherTrackedKeyphrases,i=t.setWincherTrackingForKeyphrase,c=t.setWincherTrackAllKeyphrases,u=t.unsetWincherTrackingForKeyphrase;return{newRequest:function(){n()},setRequestSucceeded:function(e){r(e)},setRequestFailed:function(e){a(e)},setKeyphraseLimitReached:function(e){o(e)},addTrackedKeyphrase:function(e){i(e)},removeTrackedKeyphrase:function(e){u(e)},setTrackedKeyphrases:function(e){s(e)},setHasTrackedAll:function(){c(!1)}}}))])(Z),X=n(100),Q=function(){return Object(d.createElement)(w.Alert,{type:"error"},Object(h.__)("No keyphrase has been set. Please set a keyphrase first.","wordpress-seo"))},ee=function(){return Object(d.createElement)(w.Alert,{type:"info"},Object(h.sprintf)( | |
| 24 | -/* translators: %s: Expands to "Wincher". */ | |
| 25 | -Object(h.__)("Automatic tracking of keyphrases is enabled. Your keyphrase(s) will automatically be tracked by %s when you publish your post.","wordpress-seo"),"Wincher"))},te=n(92),ne=n(93),re=function(){return Object(d.createElement)(w.Alert,{type:"error"},Object(h.__)("Before you can track your SEO performance make sure to set either the post’s title and save it as a draft or manually set the post’s slug.","wordpress-seo"))},ae=function(e){var t=e.response,n=e.onLogin;return 403===t.status||404===t.status?Object(d.createElement)(ne.a,{onReconnect:n}):Object(d.createElement)(C,null)};ae.propTypes={response:b.a.object.isRequired,onLogin:b.a.func.isRequired};var oe=function(e){var t=e.isSuccess,n=e.response,r=e.allKeyphrasesMissRanking,a=e.onLogin,o=e.keyphraseLimitReached,s=e.limit;return o?Object(d.createElement)(S,{limit:s}):Object(g.isEmpty)(n)||t?r?Object(d.createElement)(L,null):null:Object(d.createElement)(ae,{response:n,onLogin:a})};oe.propTypes={isSuccess:b.a.bool.isRequired,allKeyphrasesMissRanking:b.a.bool.isRequired,response:b.a.object,onLogin:b.a.func.isRequired,keyphraseLimitReached:b.a.bool.isRequired,limit:b.a.number.isRequired},oe.defaultProps={response:{}};var se=null,ie=function(){var e=l()(f.a.mark((function e(t,n){var r,a,o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.onAuthentication,a=t.setRequestSucceeded,o=t.setRequestFailed,e.next=3,Object(F.b)((function(){return Object(N.a)(n)}),function(){var e=l()(f.a.mark((function e(t){var o;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r(!0,!0,n.websiteId.toString()),a(t),(o=se.getPopup())&&o.close();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),function(){var e=l()(f.a.mark((function e(t){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 3:case"end":return e.stop()}}),e)})));return function(_x,t){return e.apply(this,arguments)}}(),ce=function(){var e=l()(f.a.mark((function e(t){var n,r;return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!se||se.isClosed()){e.next=3;break}return se.focus(),e.abrupt("return");case 3:return e.next=5,Object(N.b)();case 5:n=e.sent,r=n.url,(se=new te.a(r,{success:{type:"wincher:oauth:success",callback:function(e){return ie(t,e)}},error:{type:"wincher:oauth:error",callback:function(){return t.onAuthentication(!1,!1)}}},{title:"Wincher_login",width:500,height:700})).createPopup();case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ue=function(e){return e.isLoggedIn?null:Object(d.createElement)("p",null,Object(d.createElement)(w.NewButton,{onClick:e.onLogin,variant:"primary"},Object(h.sprintf)( | |
| 26 | -/* translators: %s expands to Wincher */ | |
| 27 | -Object(h.__)("Connect with %s","wordpress-seo"),"Wincher")))};ue.propTypes={isLoggedIn:b.a.bool.isRequired,onLogin:b.a.func.isRequired};var le=v.a.div(Y||(Y=c()(["\n\tp {\n\t\tmargin: 1em 0;\n\t}\n"]))),de=v.a.div(G||(G=c()(["\n\t",";\n"])),(function(e){return e.isDisabled&&"\n\t\topacity: .5;\n\t\tpointer-events: none;\n\t"})),pe=v.a.div($||($=c()(["\n\tfont-weight: var(--yoast-font-weight-bold);\n\tcolor: var(--yoast-color-label);\n\tfont-size: var(--yoast-font-size-default);\n"]))),fe=function(e){var t=e.isLoggedIn,n=e.keyphrases,r=e.shouldTrackAll;return!e.permalink&&t?Object(d.createElement)(re,null):0===n.length?Object(d.createElement)(Q,null):Object(d.createElement)(de,{isDisabled:!t},Object(d.createElement)("p",null,Object(h.__)("You can enable / disable tracking the SEO performance for each keyphrase below.","wordpress-seo")),t&&r&&Object(d.createElement)(ee,null),Object(d.createElement)(J,null))};function he(e){var t=e.isNewlyAuthenticated,n=e.isLoggedIn,r=Object(d.useCallback)((function(){ce(e)}),[ce,e]);return Object(d.createElement)(le,null,t&&Object(d.createElement)(I,null),Object(d.createElement)(pe,null,Object(h.__)("SEO performance","wordpress-seo"),Object(d.createElement)(w.HelpIcon,{linkTo:wpseoAdminL10n["shortlinks.wincher.seo_performance"],linkText:Object(h.__)("Learn more about the SEO performance feature.","wordpress-seo")})),Object(d.createElement)(X.a,null),Object(d.createElement)(ue,{isLoggedIn:n,onLogin:r}),Object(d.createElement)(oe,s()({},e,{onLogin:r})),Object(d.createElement)(fe,e))}fe.propTypes={keyphrases:b.a.array.isRequired,isLoggedIn:b.a.bool.isRequired,shouldTrackAll:b.a.bool.isRequired,permalink:b.a.string.isRequired},he.propTypes={isLoggedIn:b.a.bool,isNewlyAuthenticated:b.a.bool,keyphrases:b.a.array,response:b.a.object,shouldTrackAll:b.a.bool,permalink:b.a.string},he.defaultProps={isLoggedIn:!1,isNewlyAuthenticated:!1,keyphrases:[],response:{},shouldTrackAll:!1,permalink:""},t.a=Object(a.compose)([Object(r.withSelect)((function(e){var t=e("yoast-seo/editor"),n=t.isWincherNewlyAuthenticated,r=t.getWincherKeyphraseLimitReached,a=t.getWincherLimit,o=t.getWincherLoginStatus,s=t.getWincherRequestIsSuccess,i=t.getWincherRequestResponse,c=t.getWincherTrackableKeyphrases,u=t.getWincherAllKeyphrasesMissRanking,l=t.getWincherPermalink,d=t.shouldWincherAutomaticallyTrackAll;return{keyphrases:c(),allKeyphrasesMissRanking:u(),isLoggedIn:o(),isNewlyAuthenticated:n(),isSuccess:s(),keyphraseLimitReached:r(),limit:a(),response:i(),shouldTrackAll:d(),permalink:l()}})),Object(r.withDispatch)((function(e){var t=e("yoast-seo/editor"),n=t.setWincherWebsiteId,r=t.setWincherRequestSucceeded,a=t.setWincherRequestFailed,o=t.setWincherLoginStatus;return{setRequestSucceeded:function(e){r(e)},setRequestFailed:function(e){a(e)},onAuthentication:function(e,t,r){n(r),o(e,t)}}}))])(he)},function(e,t,n){"use strict";n.r(t),n.d(t,"refreshDelay",(function(){return r}));var r=500},,,,,,,,,,,function(e,t){e.exports=window.wp.sanitize},function(e,t,n){"use strict";var r=n(6),a=n(20),o=n(0),s=n(2),i=n(1),c=n.n(i),u=n(3),l=n(5),d=function(){return Object(o.createElement)("p",{className:"yoast-related-keyphrases-modal__loading-message"},Object(s.sprintf)( | |
| 28 | -/* translators: %1$s expands to "Yoast SEO", %2$s expands to "Semrush". */ | |
| 29 | -Object(s.__)("Please wait while %1$s connects to %2$s to get related keyphrases...","wordpress-seo"),"Yoast SEO","Semrush")," ",Object(o.createElement)(l.SvgIcon,{icon:"loading-spinner"}))},p=n(14),f=Object(p.makeOutboundLink)(),h=function(){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("p",null,Object(s.sprintf)( | |
| 30 | -/* translators: %s : Expands to "Semrush". */ | |
| 31 | -Object(s.__)("You've reached your request limit for today. Check back tomorrow or upgrade your plan over at %s.","wordpress-seo"),"Semrush")),Object(o.createElement)(f,{href:window.wpseoAdminL10n["shortlinks.semrush.prices"],className:"yoast-button-upsell"},Object(s.sprintf)( | |
| 32 | -/* translators: %s : Expands to "Semrush". */ | |
| 33 | -Object(s.__)("Upgrade your %s plan","wordpress-seo"),"Semrush"),Object(o.createElement)("span",{"aria-hidden":"true",className:"yoast-button-upsell__caret"})))},m=n(15),b=n.n(m),g=n(12),y=n.n(g),v=n(13),w=n.n(v),O=n(10),k=n.n(O),j=n(16),x=n.n(j),E=n(17),R=n.n(E),_=n(11),T=n.n(_),S=n(9),C=n.n(S),I=n(38),L=n.n(I),M=n(44);var P="yoast-semrush-country-selector",q=[{value:"us",name:"United States - US"},{value:"uk",name:"United Kingdom - UK"},{value:"ca",name:"Canada - CA"},{value:"ru",name:"Russia - RU"},{value:"de",name:"Germany - DE"},{value:"fr",name:"France - FR"},{value:"es",name:"Spain - ES"},{value:"it",name:"Italy - IT"},{value:"br",name:"Brazil - BR"},{value:"au",name:"Australia - AU"},{value:"ar",name:"Argentina - AR"},{value:"be",name:"Belgium - BE"},{value:"ch",name:"Switzerland - CH"},{value:"dk",name:"Denmark - DK"},{value:"fi",name:"Finland - FI"},{value:"hk",name:"Hong Kong - HK"},{value:"ie",name:"Ireland - IE"},{value:"il",name:"Israel - IL"},{value:"mx",name:"Mexico - MX"},{value:"nl",name:"Netherlands - NL"},{value:"no",name:"Norway - NO"},{value:"pl",name:"Poland - PL"},{value:"se",name:"Sweden - SE"},{value:"sg",name:"Singapore - SG"},{value:"tr",name:"Turkey - TR"},{value:"jp",name:"Japan - JP"},{value:"in",name:"India - IN"},{value:"hu",name:"Hungary - HU"},{value:"af",name:"Afghanistan - AF"},{value:"al",name:"Albania - AL"},{value:"dz",name:"Algeria - DZ"},{value:"ao",name:"Angola - AO"},{value:"am",name:"Armenia - AM"},{value:"at",name:"Austria - AT"},{value:"az",name:"Azerbaijan - AZ"},{value:"bh",name:"Bahrain - BH"},{value:"bd",name:"Bangladesh - BD"},{value:"by",name:"Belarus - BY"},{value:"bz",name:"Belize - BZ"},{value:"bo",name:"Bolivia - BO"},{value:"ba",name:"Bosnia and Herzegovina - BA"},{value:"bw",name:"Botswana - BW"},{value:"bn",name:"Brunei - BN"},{value:"bg",name:"Bulgaria - BG"},{value:"cv",name:"Cabo Verde - CV"},{value:"kh",name:"Cambodia - KH"},{value:"cm",name:"Cameroon - CM"},{value:"cl",name:"Chile - CL"},{value:"co",name:"Colombia - CO"},{value:"cr",name:"Costa Rica - CR"},{value:"hr",name:"Croatia - HR"},{value:"cy",name:"Cyprus - CY"},{value:"cz",name:"Czech Republic - CZ"},{value:"cd",name:"Congo - CD"},{value:"do",name:"Dominican Republic - DO"},{value:"ec",name:"Ecuador - EC"},{value:"eg",name:"Egypt - EG"},{value:"sv",name:"El Salvador - SV"},{value:"ee",name:"Estonia - EE"},{value:"et",name:"Ethiopia - ET"},{value:"ge",name:"Georgia - GE"},{value:"gh",name:"Ghana - GH"},{value:"gr",name:"Greece - GR"},{value:"gt",name:"Guatemala - GT"},{value:"gy",name:"Guyana - GY"},{value:"ht",name:"Haiti - HT"},{value:"hn",name:"Honduras - HN"},{value:"is",name:"Iceland - IS"},{value:"id",name:"Indonesia - ID"},{value:"jm",name:"Jamaica - JM"},{value:"jo",name:"Jordan - JO"},{value:"kz",name:"Kazakhstan - KZ"},{value:"kw",name:"Kuwait - KW"},{value:"lv",name:"Latvia - LV"},{value:"lb",name:"Lebanon - LB"},{value:"lt",name:"Lithuania - LT"},{value:"lu",name:"Luxembourg - LU"},{value:"mg",name:"Madagascar - MG"},{value:"my",name:"Malaysia - MY"},{value:"mt",name:"Malta - MT"},{value:"mu",name:"Mauritius - MU"},{value:"md",name:"Moldova - MD"},{value:"mn",name:"Mongolia - MN"},{value:"me",name:"Montenegro - ME"},{value:"ma",name:"Morocco - MA"},{value:"mz",name:"Mozambique - MZ"},{value:"na",name:"Namibia - NA"},{value:"np",name:"Nepal - NP"},{value:"nz",name:"New Zealand - NZ"},{value:"ni",name:"Nicaragua - NI"},{value:"ng",name:"Nigeria - NG"},{value:"om",name:"Oman - OM"},{value:"py",name:"Paraguay - PY"},{value:"pe",name:"Peru - PE"},{value:"ph",name:"Philippines - PH"},{value:"pt",name:"Portugal - PT"},{value:"ro",name:"Romania - RO"},{value:"sa",name:"Saudi Arabia - SA"},{value:"sn",name:"Senegal - SN"},{value:"rs",name:"Serbia - RS"},{value:"sk",name:"Slovakia - SK"},{value:"si",name:"Slovenia - SI"},{value:"za",name:"South Africa - ZA"},{value:"kr",name:"South Korea - KR"},{value:"lk",name:"Sri Lanka - LK"},{value:"th",name:"Thailand - TH"},{value:"bs",name:"Bahamas - BS"},{value:"tt",name:"Trinidad and Tobago - TT"},{value:"tn",name:"Tunisia - TN"},{value:"ua",name:"Ukraine - UA"},{value:"ae",name:"United Arab Emirates - AE"},{value:"uy",name:"Uruguay - UY"},{value:"ve",name:"Venezuela - VE"},{value:"vn",name:"Vietnam - VN"},{value:"zm",name:"Zambia - ZM"},{value:"zw",name:"Zimbabwe - ZW"},{value:"ly",name:"Libya - LY"}],A=function(e){x()(c,e);var t,n,r,a,i=(r=c,a=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(e){return!1}}(),function(){var e,t=T()(r);if(a){var n=T()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return R()(this,e)});function c(e){var t;return y()(this,c),(t=i.call(this,e)).relatedKeyphrasesRequest=t.relatedKeyphrasesRequest.bind(k()(t)),t.onChangeHandler=t.onChangeHandler.bind(k()(t)),t}return w()(c,[{key:"componentDidMount",value:function(){this.props.response&&this.props.keyphrase===this.props.lastRequestKeyphrase||this.relatedKeyphrasesRequest()}},{key:"storeCountryCode",value:function(e){L()({path:"yoast/v1/semrush/country_code",method:"POST",data:{country_code:e}})}},{key:"relatedKeyphrasesRequest",value:(n=b()(C.a.mark((function e(){var t,n,r,a;return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,n=t.keyphrase,r=t.countryCode,(0,t.newRequest)(r,n),this.storeCountryCode(r),e.next=5,this.doRequest(n,r);case 5:if(200!==(a=e.sent).status){e.next=9;break}return this.handleSuccessResponse(a),e.abrupt("return");case 9:this.handleFailedResponse(a);case 10:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"handleSuccessResponse",value:function(e){var t=this.props,n=t.setNoResultsFound,r=t.setRequestSucceeded;0!==e.results.rows.length?r(e):n()}},{key:"handleFailedResponse",value:function(e){var t=this.props,n=t.setRequestLimitReached,r=t.setRequestFailed;"error"in e&&(e.error.includes("TOTAL LIMIT EXCEEDED")?n():r(e))}},{key:"doRequest",value:(t=b()(C.a.mark((function e(t,n){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L()({path:Object(M.addQueryArgs)("/yoast/v1/semrush/related_keyphrases",{keyphrase:t,country_code:n})});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(_x,e){return t.apply(this,arguments)})},{key:"onChangeHandler",value:function(e){this.props.setCountry(e)}},{key:"render",value:function(){return Object(o.createElement)("div",{id:P},Object(o.createElement)(l.SingleSelect,{id:P+"-select",label:Object(s.__)("Show results for:","wordpress-seo"),name:"semrush-country-code",options:q,selected:this.props.countryCode,onChange:this.onChangeHandler,wrapperClassName:"yoast-field-group yoast-field-group--inline"}),Object(o.createElement)(l.NewButton,{id:P+"-button",variant:"secondary",onClick:this.relatedKeyphrasesRequest},Object(s.__)("Select country","wordpress-seo")))}}]),c}(o.Component);A.propTypes={keyphrase:c.a.string,countryCode:c.a.string,response:c.a.object,lastRequestKeyphrase:c.a.string,setCountry:c.a.func.isRequired,newRequest:c.a.func.isRequired,setNoResultsFound:c.a.func.isRequired,setRequestSucceeded:c.a.func.isRequired,setRequestLimitReached:c.a.func.isRequired,setRequestFailed:c.a.func.isRequired},A.defaultProps={keyphrase:"",countryCode:"us",response:{},lastRequestKeyphrase:""};var D=A,N=n(65),F=n(56);var H=Object(p.makeOutboundLink)(),K=function(e){x()(a,e);var t,n,r=(t=a,n=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(e){return!1}}(),function(){var e,r=T()(t);if(n){var a=T()(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return R()(this,e)});function a(e){var t;return y()(this,a),(t=r.call(this,e)).transformTrendDataToChartPoints=t.transformTrendDataToChartPoints.bind(k()(t)),t.getAreaChartDataTableHeaderLabels=t.getAreaChartDataTableHeaderLabels.bind(k()(t)),t.mapAreaChartDataToTableData=t.mapAreaChartDataToTableData.bind(k()(t)),t}return w()(a,[{key:"transformTrendDataToChartPoints",value:function(e){return e.split(",").map((function(e,t){return{x:t,y:parseFloat(e)}}))}},{key:"getAreaChartDataTableHeaderLabels",value:function(){return[Object(s.__)("Twelve months ago","wordpress-seo"),Object(s.__)("Eleven months ago","wordpress-seo"),Object(s.__)("Ten months ago","wordpress-seo"),Object(s.__)("Nine months ago","wordpress-seo"),Object(s.__)("Eight months ago","wordpress-seo"),Object(s.__)("Seven months ago","wordpress-seo"),Object(s.__)("Six months ago","wordpress-seo"),Object(s.__)("Five months ago","wordpress-seo"),Object(s.__)("Four months ago","wordpress-seo"),Object(s.__)("Three months ago","wordpress-seo"),Object(s.__)("Two months ago","wordpress-seo"),Object(s.__)("Last month","wordpress-seo")]}},{key:"mapAreaChartDataToTableData",value:function(e){return Math.round(100*e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.keyphrase,r=t.relatedKeyphrases,a=t.countryCode,i=t.data,c=t.renderAction,l="https://www.semrush.com/analytics/keywordoverview/?q="+encodeURIComponent(n)+"&db="+encodeURIComponent(a);return i&&!Object(u.isEmpty)(i.results)&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)("table",{className:"yoast yoast-table"},Object(o.createElement)("thead",null,Object(o.createElement)("tr",null,Object(o.createElement)("th",{scope:"col",className:"yoast-table--primary"},Object(s.__)("Related keyphrase","wordpress-seo")),Object(o.createElement)("th",{scope:"col",abbr:Object(s.__)("Volume","wordpress-seo")},Object(s.__)("Volume","wordpress-seo"),Object(o.createElement)(F.a,{href:window.wpseoAdminL10n["shortlinks.semrush.volume_help"],className:"dashicons"},Object(o.createElement)("span",{className:"screen-reader-text"},Object(s.__)("Learn more about the related keyphrases volume","wordpress-seo")))),Object(o.createElement)("th",{scope:"col",abbr:Object(s.__)("Trend","wordpress-seo")},Object(s.__)("Trend","wordpress-seo"),Object(o.createElement)(F.a,{href:window.wpseoAdminL10n["shortlinks.semrush.trend_help"],className:"dashicons"},Object(o.createElement)("span",{className:"screen-reader-text"},Object(s.__)("Learn more about the related keyphrases trend","wordpress-seo")))),c&&Object(o.createElement)("td",{className:"yoast-table--nobreak"}))),Object(o.createElement)("tbody",null,i.results.rows.map((function(t,n){var a=t[0],i=e.transformTrendDataToChartPoints(t[2]),u=e.getAreaChartDataTableHeaderLabels();return Object(o.createElement)("tr",{key:n},Object(o.createElement)("td",null,a),Object(o.createElement)("td",null,t[1]),Object(o.createElement)("td",{className:"yoast-table--nopadding"},Object(o.createElement)(N.a,{width:66,height:24,data:i,strokeWidth:1.8,strokeColor:"#498afc",fillColor:"#ade3fc",className:"yoast-related-keyphrases-modal__chart",mapChartDataToTableData:e.mapAreaChartDataToTableData,dataTableCaption:Object(s.__)("Keyphrase volume in the last 12 months on a scale from 0 to 100.","wordpress-seo"),dataTableHeaderLabels:u})),c&&Object(o.createElement)("td",{className:"yoast-table--nobreak"},c(a,r)))})))),Object(o.createElement)("p",{style:{marginBottom:0}},Object(o.createElement)(H,{href:l},Object(s.sprintf)( | |
| 34 | -/* translators: %s expands to Semrush */ | |
| 35 | -Object(s.__)("Get more insights at %s","wordpress-seo"),"Semrush"))))}}]),a}(o.Component);K.propTypes={data:c.a.object,keyphrase:c.a.string,relatedKeyphrases:c.a.array,countryCode:c.a.string,renderAction:c.a.func},K.defaultProps={data:{},keyphrase:"",relatedKeyphrases:[],countryCode:"us",renderAction:null};var W=K,B=Object(p.makeOutboundLink)(),U=function(){return Object(o.createElement)(l.Alert,{type:"info"},Object(s.sprintf)( | |
| 36 | -/* translators: %s: Expands to "Yoast SEO". */ | |
| 37 | -Object(s.__)("Would you like to be able to add these related keyphrases to the %s analysis so you can optimize your content even further?","wordpress-seo"),"Yoast SEO")+" ",Object(o.createElement)(B,{href:window.wpseoAdminL10n["shortlinks.semrush.premium_landing_page"]},Object(s.sprintf)( | |
| 38 | -/* translators: %s: Expands to "Yoast SEO Premium". */ | |
| 39 | -Object(s.__)("Check out %s!","wordpress-seo"),"Yoast SEO Premium")))},z=function(){return Object(o.createElement)(l.Alert,{type:"error"},Object(s.__)("We've encountered a problem trying to get related keyphrases. Please try again later.","wordpress-seo"))},V=function(){return Object(o.createElement)(l.Alert,{type:"warning"},Object(s.sprintf)( | |
| 40 | -/* translators: %s: Expands to "Yoast SEO". */ | |
| 41 | -Object(s.__)("You've reached the maximum amount of 4 related keyphrases. You can change or remove related keyphrases in the %s metabox or sidebar.","wordpress-seo"),"Yoast SEO"))},Y=n(24);function G(e){var t=e.response,n=e.lastRequestKeyphrase,r=e.keyphrase,a=e.newRequest,i=e.setCountry,c=e.renderAction,l=e.countryCode,p=e.requestLimitReached,f=e.setRequestFailed,m=e.setNoResultsFound,b=e.relatedKeyphrases,g=e.setRequestSucceeded,y=e.setRequestLimitReached,v=Object(Y.a)().isPremium;return Object(o.createElement)(o.Fragment,null,!p&&Object(o.createElement)(o.Fragment,null,!v&&Object(o.createElement)(U,null),v&&function(e){return e&&e.length>=4}(b)&&Object(o.createElement)(V,null),Object(o.createElement)(D,{countryCode:l,setCountry:i,newRequest:a,keyphrase:r,setRequestFailed:f,setNoResultsFound:m,setRequestSucceeded:g,setRequestLimitReached:y,response:t,lastRequestKeyphrase:n})),function(e){var t=e.isPending,n=e.requestLimitReached,r=e.isSuccess,a=e.response,i=e.requestHasData;return t?Object(o.createElement)(d,null):n?Object(o.createElement)(h,null):!r&&function(e){return!Object(u.isEmpty)(e)&&"error"in e}(a)?Object(o.createElement)(z,null):i?void 0:Object(o.createElement)("p",null,Object(s.__)("Sorry, there's no data available for that keyphrase/country combination.","wordpress-seo"))}(e),Object(o.createElement)(W,{keyphrase:r,relatedKeyphrases:b,countryCode:l,renderAction:c,data:t}))}G.propTypes={keyphrase:c.a.string,relatedKeyphrases:c.a.array,renderAction:c.a.func,requestLimitReached:c.a.bool,countryCode:c.a.string.isRequired,setCountry:c.a.func.isRequired,newRequest:c.a.func.isRequired,setRequestSucceeded:c.a.func.isRequired,setRequestLimitReached:c.a.func.isRequired,setRequestFailed:c.a.func.isRequired,setNoResultsFound:c.a.func.isRequired,response:c.a.object,lastRequestKeyphrase:c.a.string},G.defaultProps={keyphrase:"",relatedKeyphrases:[],renderAction:null,requestLimitReached:!1,response:{},lastRequestKeyphrase:""},t.a=Object(a.compose)([Object(r.withSelect)((function(e){var t=e("yoast-seo/editor"),n=t.getFocusKeyphrase,r=t.getSEMrushSelectedCountry,a=t.getSEMrushRequestLimitReached,o=t.getSEMrushRequestResponse,s=t.getSEMrushRequestIsSuccess,i=t.getSEMrushIsRequestPending,c=t.getSEMrushRequestHasData,u=t.getSEMrushRequestKeyphrase;return{keyphrase:n(),countryCode:r(),requestLimitReached:a(),response:o(),isSuccess:s(),isPending:i(),requestHasData:c(),lastRequestKeyphrase:u()}})),Object(r.withDispatch)((function(e){var t=e("yoast-seo/editor"),n=t.setSEMrushChangeCountry,r=t.setSEMrushNewRequest,a=t.setSEMrushRequestSucceeded,o=t.setSEMrushRequestFailed,s=t.setSEMrushSetRequestLimitReached,i=t.setSEMrushNoResultsFound;return{setCountry:function(e){n(e)},newRequest:function(e,t){r(e,t)},setRequestSucceeded:function(e){a(e)},setRequestFailed:function(e){o(e)},setRequestLimitReached:function(){s()},setNoResultsFound:function(){i()}}}))])(G)},,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n(0),a=n(1),o=n.n(a),s=n(26),i=n.n(s),c=n(27),u=n.n(c),l=n(37),d=n.n(l),p=n(5),f=n(14),h=n(43),m=["hiddenField","hiddenFieldImageId","hasImageValidation"],b=function(e){var t=e.hiddenField,n=e.hiddenFieldImageId,a=e.hasImageValidation,o=d()(e,m),s=Object(r.useMemo)((function(){return document.getElementById(t)})),c=Object(r.useMemo)((function(){return document.getElementById(n)})),l=Object(r.useState)({url:s?s.value:"",id:c?parseInt(c.value,10):"",alt:""}),b=u()(l,2),g=b[0],y=b[1],v=Object(r.useState)([]),w=u()(v,2),O=w[0],k=w[1],j=Object(r.useCallback)((function(e){s&&(s.value=e.url),c&&(c.value=e.id)})),x=Object(r.useCallback)((function(){return Object(h.b)((function(e){y(e),j(e),a&&k(Object(f.validateFacebookImage)(e))}))}),[a,j]),E=Object(r.useCallback)((function(){var e={url:"",id:"",alt:""};y(e),j(e),k([])}),[j]);return Object(r.useEffect)((function(){g.id&&!g.alt&&Object(h.a)(g.id).then((function(e){return y(e)}))}),[g]),Object(r.createElement)(p.ImageSelect,i()({},o,{imageUrl:g.url,imageId:g.id,imageAltText:g.alt,onClick:x,onRemoveImageClick:E,warnings:O}))};b.propTypes={hiddenField:o.a.string.isRequired,hiddenFieldImageId:o.a.string,hasImageValidation:o.a.bool},b.defaultProps={hiddenFieldImageId:"",hasImageValidation:!1};var g=b,y=n(48);function v(e){var t=e.target,n=e.label,a=e.hasPreview,o=e.hiddenField,s=e.hiddenFieldImageId,i=e.selectImageButtonId,c=e.replaceImageButtonId,u=e.removeImageButtonId,l=e.hasNewBadge,d=e.isDisabled,p=e.hasPremiumBadge,f=e.hasImageValidation;return Object(r.createElement)(y.a,{target:t},Object(r.createElement)(g,{label:n,hasPreview:a,hiddenField:o,hiddenFieldImageId:s,selectImageButtonId:i,replaceImageButtonId:c,removeImageButtonId:u,hasNewBadge:l,isDisabled:d,hasPremiumBadge:p,hasImageValidation:f}))}v.propTypes={target:o.a.string.isRequired,label:o.a.string.isRequired,hasPreview:o.a.bool.isRequired,hiddenField:o.a.string.isRequired,hiddenFieldImageId:o.a.string,selectImageButtonId:o.a.string,replaceImageButtonId:o.a.string,removeImageButtonId:o.a.string,hasNewBadge:o.a.bool,isDisabled:o.a.bool,hasPremiumBadge:o.a.bool,hasImageValidation:o.a.bool},v.defaultProps={hiddenFieldImageId:"",selectImageButtonId:"",replaceImageButtonId:"",removeImageButtonId:"",hasNewBadge:!1,isDisabled:!1,hasPremiumBadge:!1,hasImageValidation:!1}},,,,,function(e,t){e.exports=window.yoast.analysisReport},,,,,,,,,,,function(e,t,n){"use strict";var r=n(6),a=n(20),o=n(12),s=n.n(o),i=n(13),c=n.n(i),u=n(10),l=n.n(u),d=n(16),p=n.n(d),f=n(17),h=n.n(f),m=n(11),b=n.n(m),g=n(0),y=n(1),v=n.n(y),w=n(130),O=n(28),k=n(69);var j=function(e){p()(a,e);var t,n,r=(t=a,n=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(e){return!1}}(),function(){var e,r=b()(t);if(n){var a=b()(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return h()(this,e)});function a(e){var t;s()(this,a);var n=(t=r.call(this,e)).props.results;return t.state={mappedResults:{}},null!==n&&(t.state={mappedResults:Object(k.default)(n,t.props.keywordKey)}),t.handleMarkButtonClick=t.handleMarkButtonClick.bind(l()(t)),t}return c()(a,[{key:"componentDidUpdate",value:function(e){null!==this.props.results&&this.props.results!==e.results&&this.setState({mappedResults:Object(k.default)(this.props.results,this.props.keywordKey)})}},{key:"handleMarkButtonClick",value:function(e,t){var n=this.props.keywordKey.length>0?"".concat(this.props.keywordKey,":").concat(e):e;n===this.props.activeMarker?(this.props.setActiveMarker(null),this.props.setMarkerPauseStatus(!1),this.removeMarkers()):(this.props.setActiveMarker(n),t())}},{key:"removeMarkers",value:function(){window.YoastSEO.analysis.applyMarks(new O.Paper("",{}),[])}},{key:"render",value:function(){var e=this.state.mappedResults,t=e.errorsResults,n=e.improvementsResults,r=e.goodResults,a=e.considerationsResults,o=e.problemsResults;return Object(g.createElement)(g.Fragment,null,Object(g.createElement)(w.ContentAnalysis,{errorsResults:t,problemsResults:o,improvementsResults:n,considerationsResults:a,goodResults:r,activeMarker:this.props.activeMarker,onMarkButtonClick:this.handleMarkButtonClick,marksButtonClassName:this.props.marksButtonClassName,marksButtonStatus:this.props.marksButtonStatus,headingLevel:3,keywordKey:this.props.keywordKey}))}}]),a}(g.Component);j.propTypes={results:v.a.array,marksButtonClassName:v.a.string,marksButtonStatus:v.a.string,setActiveMarker:v.a.func.isRequired,setMarkerPauseStatus:v.a.func.isRequired,activeMarker:v.a.string,keywordKey:v.a.string},j.defaultProps={results:null,marksButtonStatus:"enabled",marksButtonClassName:"",activeMarker:null,keywordKey:""};var x=j;t.a=Object(a.compose)([Object(r.withSelect)((function(e){return{activeMarker:(0,e("yoast-seo/editor").getActiveMarker)()}})),Object(r.withDispatch)((function(e){var t=e("yoast-seo/editor");return{setActiveMarker:t.setActiveMarker,setMarkerPauseStatus:t.setMarkerPauseStatus}}))])(x)},,,,,,,function(e,t,n){"use strict";var r,a,o,s,i=n(34),c=n.n(i),u=n(25),l=n.n(u),d=n(27),p=n.n(d),f=n(0),h=/<(\/)?(\w+)\s*(\/)?>/g;function m(e,t,n,r,a){return{element:e,tokenStart:t,tokenLength:n,prevOffset:r,leadingTextStart:a,children:[]}}function b(){var e=r.length-a;0!==e&&o.push(r.substr(a,e))}function g(e){var t=e.element,n=e.tokenStart,a=e.tokenLength,o=e.prevOffset,i=e.children,c=s[s.length-1],u=r.substr(c.prevOffset,n-c.prevOffset);u&&c.children.push(u),c.children.push(f.cloneElement.apply(void 0,[t,null].concat(l()(i)))),c.prevOffset=o||n+a}function y(e){var t=function(){var e=h.exec(r);if(null===e)return["no-more-tokens"];var t=e.index,n=p()(e,4),a=n[0],o=n[1],s=n[2],i=n[3],c=a.length;return i?["self-closed",s,t,c]:o?["closer",s,t,c]:["opener",s,t,c]}(),n=p()(t,4),i=n[0],c=n[1],u=n[2],d=n[3],y=s.length,v=u>a?a:null;if(!e[c])return b(),!1;switch(i){case"no-more-tokens":if(0!==y){var w=s.pop(),O=w.leadingTextStart,k=w.tokenStart;o.push(r.substr(O,k))}return b(),!1;case"self-closed":return 0===y?(null!==v&&o.push(r.substr(v,u-v)),o.push(e[c]),a=u+d,!0):(g(m(e[c],u,d)),a=u+d,!0);case"opener":return s.push(m(e[c],u,d,u+d,v)),a=u+d,!0;case"closer":if(1===y)return function(e){var t=s.pop(),n=t.element,a=t.leadingTextStart,i=t.prevOffset,c=t.tokenStart,u=t.children,d=e?r.substr(i,e-i):r.substr(i);d&&u.push(d),null!==a&&o.push(r.substr(a,c-a)),o.push(f.cloneElement.apply(void 0,[n,null].concat(l()(u))))}(u),a=u+d,!0;var j=s.pop(),x=r.substr(j.prevOffset,u-j.prevOffset);j.children.push(x),j.prevOffset=u+d;var E=m(j.element,j.tokenStart,j.tokenLength,u+d);return E.children=j.children,g(E),a=u+d,!0;default:return b(),!1}}t.a=function(e,t){if(r=e,a=0,o=[],s=[],h.lastIndex=0,!function(e){var t="object"===c()(e),n=t&&Object.values(e);return t&&n.length&&n.every((function(e){return Object(f.isValidElement)(e)}))}(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are WPElements");do{}while(y(t));return f.createElement.apply(void 0,[f.Fragment,null].concat(l()(o)))}},,,,,,function(e,t,n){"use strict";n.r(t),n.d(t,"setTextdomainL10n",(function(){return o}));var r=n(2),a=n(3);function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"wpseoYoastJSL10n",n=Object(a.get)(window,[t,e,"locale_data",e],!1);"yoast-components"===e&&(e="wordpress-seo"),!1===n?Object(r.setLocaleData)({"":{}},e):Object(r.setLocaleData)(n,e)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"doAjaxRequest",(function(){return S}));var a=n(24),o=n(55),s=n(50),i=n(102),c=n(83),u=n(56),l=n(73),d=n(154),p=n(37),f=n.n(p),h=n(0),m=n(1),b=n.n(m),g=["renderPriority"],y=n(69),v=n(57),w=n(114),O=n(75),k=n(141),j=n(148),x=n(76),E=n(64),R=n(30),_=n(54),T=n(33);function S(e,t,n,r){return new Promise((function(a,o){jQuery.ajax({type:e,url:t,beforeSend:n?function(e){e.setRequestHeader("X-WP-Nonce",n)}:null,data:r,dataType:"json",success:a,error:o})}))}var C=n(79),I=n(125),L=n(5),M=n(20),P=n(6),q=Object(M.compose)([Object(P.withSelect)((function(e,t){return{isAlertDismissed:(0,e(t.store||"yoast-seo/editor").isAlertDismissed)(t.alertKey)}})),Object(P.withDispatch)((function(e,t){var n=e(t.store||"yoast-seo/editor").dismissAlert;return{onDismissed:function(){return n(t.alertKey)}}}))])(L.Alert),A=n(101);window.yoast=window.yoast||{},window.yoast.editorModules={analysis:{getL10nObject:a.a,getContentLocale:o.a,getIndicatorForScore:s.a,constants:i,refreshAnalysis:c},components:{HelpLink:u.a,TopLevelProviders:l.a,higherorder:{withYoastSidebarPriority:function(e){var t=function(t){t.renderPriority;var n=f()(t,g);return Object(h.createElement)(e,n)};return t.propTypes={renderPriority:b.a.number},t}},contentAnalysis:{mapResults:y},contexts:{location:{LocationContext:R.LocationContext,LocationProvider:R.LocationProvider,LocationConsumer:R.LocationConsumer}},SidebarItem:T.a,SidebarCollapsible:O.a,MetaboxCollapsible:v.a,Modal:_.a,portals:{ImageSelectPortal:I.a}},containers:{EditorModal:C.a,PersistentDismissableAlert:q,Results:k.a,SEMrushRelatedKeyphrases:w.a,WincherSEOPerformance:A.a},helpers:{ajaxHelper:r,createInterpolateElement:j.a,isBlockEditor:x.a,i18n:d,replacementVariableHelpers:E}}}]); | |
| 1 | +(()=>{var e={465(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"}))});e.exports=o},818(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=o},1609(e){"use strict";e.exports=window.React},2485(e,s){var t;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],s=0;s<arguments.length;s++){var t=arguments[s];if(t){var i=typeof t;if("string"===i||"number"===i)e.push(t);else if(Array.isArray(t)){if(t.length){var n=o.apply(null,t);n&&e.push(n)}}else if("object"===i){if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]")){e.push(t.toString());continue}for(var a in t)r.call(t,a)&&t[a]&&e.push(a)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(t=function(){return o}.apply(s,[]))||(e.exports=t)}()},2514(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"}))});e.exports=o},2863(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}))});e.exports=o},3473(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"}))});e.exports=o},5074(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});e.exports=o},5687(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{fillRule:"evenodd",d:"M10.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L12.586 11H5a1 1 0 110-2h7.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=o},6702(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});e.exports=o},7219(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))});e.exports=o},7656(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}))});e.exports=o},8738(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),r.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))});e.exports=o}},s={};function t(r){var o=s[r];if(void 0!==o)return o.exports;var i=s[r]={exports:{}};return e[r](i,i.exports,t),i.exports}t.n=e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},t.d=(e,s)=>{for(var r in s)t.o(s,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:s[r]})},t.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};t.r(e),t.d(e,{refreshDelay:()=>a});var s={};t.r(s),t.d(s,{default:()=>k,initializationDone:()=>S,sortResultsByIdentifier:()=>b});var r={};t.r(r),t.d(r,{default:()=>Q,getIconForScore:()=>Z});var o={};t.r(o),t.d(o,{doAjaxRequest:()=>ns});var i={};t.r(i),t.d(i,{applyReplaceUsingPlugin:()=>js,createLabelFromName:()=>ys,excerptFromContent:()=>Ss,fillReplacementVariables:()=>ms,handlePrefixes:()=>gs,mapCustomFields:()=>ks,mapCustomTaxonomies:()=>bs,nonReplaceVars:()=>hs,prepareCustomFieldForDispatch:()=>ws,prepareCustomTaxonomyForDispatch:()=>vs,pushNewReplaceVar:()=>xs,replaceSpaces:()=>fs});const n=window.yoast.externals.contexts,a=500,l=window.lodash;function c(){return(0,l.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}const d=window.wp.i18n,u=window.yoast.analysis,p=window.wp.hooks,h=window.yoast.externals.redux;class m{static get keyphraseElement(){var e;return document.getElementById(null!==(e=window.wpseoScriptData)&&void 0!==e&&e.isPost?"yoast_wpseo_focuskw":"hidden_wpseo_focuskw")}static get isCornerstoneElement(){var e;return document.getElementById(null!==(e=window.wpseoScriptData)&&void 0!==e&&e.isPost?"yoast_wpseo_is_cornerstone":"hidden_wpseo_is_cornerstone")}static get seoScoreElement(){var e;return document.getElementById(null!==(e=window.wpseoScriptData)&&void 0!==e&&e.isPost?"yoast_wpseo_linkdex":"hidden_wpseo_linkdex")}static get readabilityScoreElement(){var e;return document.getElementById(null!==(e=window.wpseoScriptData)&&void 0!==e&&e.isPost?"yoast_wpseo_content_score":"hidden_wpseo_content_score")}static get inclusiveLanguageScoreElement(){var e;return document.getElementById(null!==(e=window.wpseoScriptData)&&void 0!==e&&e.isPost?"yoast_wpseo_inclusive_language_score":"hidden_wpseo_inclusive_language_score")}static get seoTitleScoreElement(){var e;return document.getElementById(null!==(e=window.wpseoScriptData)&&void 0!==e&&e.isPost?"yoast_wpseo_seo_title_score":"hidden_wpseo_seo_title_score")}static get metaDescriptionScoreElement(){var e;return document.getElementById(null!==(e=window.wpseoScriptData)&&void 0!==e&&e.isPost?"yoast_wpseo_meta_description_score":"hidden_wpseo_meta_description_score")}static set keyphrase(e){m.keyphraseElement&&(m.keyphraseElement.value=e)}static get keyphrase(){var e,s;return null!==(e=null===(s=m.keyphraseElement)||void 0===s?void 0:s.value)&&void 0!==e?e:""}static set isCornerstone(e){m.isCornerstoneElement&&(m.isCornerstoneElement.value=e?"1":"0")}static get isCornerstone(){var e;return"1"===(null===(e=m.isCornerstoneElement)||void 0===e?void 0:e.value)}static set seoScore(e){m.seoScoreElement&&(m.seoScoreElement.value=e)}static get seoScore(){var e,s;return null!==(e=null===(s=m.seoScoreElement)||void 0===s?void 0:s.value)&&void 0!==e?e:""}static set readabilityScore(e){m.readabilityScoreElement&&(m.readabilityScoreElement.value=e)}static get readabilityScore(){var e,s;return null!==(e=null===(s=m.readabilityScoreElement)||void 0===s?void 0:s.value)&&void 0!==e?e:""}static set inclusiveLanguageScore(e){m.inclusiveLanguageScoreElement&&(m.inclusiveLanguageScoreElement.value=e)}static get inclusiveLanguageScore(){var e,s;return null!==(e=null===(s=m.inclusiveLanguageScoreElement)||void 0===s?void 0:s.value)&&void 0!==e?e:""}static set seoTitleScore(e){m.seoTitleScoreElement&&(m.seoTitleScoreElement.value=e)}static get seoTitleScore(){var e,s;return null!==(e=null===(s=m.seoTitleScoreElement)||void 0===s?void 0:s.value)&&void 0!==e?e:""}static set metaDescriptionScore(e){m.metaDescriptionScoreElement&&(m.metaDescriptionScoreElement.value=e)}static get metaDescriptionScore(){var e,s;return null!==(e=null===(s=m.metaDescriptionScoreElement)||void 0===s?void 0:s.value)&&void 0!==e?e:""}}const g=["titleWidth","keyphraseInSEOTitle"],y=["metaDescriptionKeyword","metaDescriptionLength"],x=(e,s)=>{const t=(e||[]).filter(e=>{var t,r;return s.includes(null==e?void 0:e._identifier)&&(null===(t=e.hasScore)||void 0===t?void 0:t.call(e))&&(null===(r=e.hasText)||void 0===r?void 0:r.call(e))}),r=t.reduce((e,s)=>e+s.getScore(),0);return Math.round(r/(9*t.length)*100)||0},f=e=>{const s=(e=>x(e,g))(e);s>0&&(m.seoTitleScore=String(s));const t=(e=>x(e,y))(e);t>0&&(m.metaDescriptionScore=String(t))};function w(){}let v=!1;function b(e){return e.sort((e,s)=>e._identifier.localeCompare(s._identifier))}function k(e,s,t,r,o){if(!v)return;const i=u.Paper.parse(s());e.analyze(i).then(n=>{const{result:{seo:a,readability:l,inclusiveLanguage:c}}=n;if(a){const e=a[""];e.results.forEach(e=>{e.getMarker=()=>()=>t(i,e.marks)}),e.results=b(e.results),r.dispatch(h.actions.setSeoResultsForKeyword(i.getKeyword(),e.results)),r.dispatch(h.actions.setOverallSeoScore(e.score,i.getKeyword())),r.dispatch(h.actions.refreshSnippetEditor()),o.saveScores(e.score,i.getKeyword()),f(e.results)}l&&(l.results.forEach(e=>{e.getMarker=()=>()=>t(i,e.marks)}),l.results=b(l.results),r.dispatch(h.actions.setReadabilityResults(l.results)),r.dispatch(h.actions.setOverallReadabilityScore(l.score)),r.dispatch(h.actions.refreshSnippetEditor()),o.saveContentScore(l.score)),c&&(c.results.forEach(e=>{e.getMarker=()=>()=>t(i,e.marks)}),c.results=b(c.results),r.dispatch(h.actions.setInclusiveLanguageResults(c.results)),r.dispatch(h.actions.setOverallInclusiveLanguageScore(c.score)),r.dispatch(h.actions.refreshSnippetEditor()),o.saveInclusiveLanguageScore(c.score)),(0,p.doAction)("yoast.analysis.refresh",n,{paper:i,worker:e,collectData:s,applyMarks:t,store:r,dataCollector:o})}).catch(w)}function S(){v=!0}const j=window.wp.element,_=window.yoast.styledComponents;var C=t.n(_);const R=window.yoast.propTypes;var E=t.n(R);const I=window.yoast.componentsNew,L=window.yoast.helpers,T=window.yoast.styleGuide,N=window.ReactJSXRuntime,M=T.colors.$color_bad,P=T.colors.$palette_error_background,A=T.colors.$color_grey_text_light,O=T.colors.$palette_error_text,F=C().div` | |
| 2 | + display: flex; | |
| 3 | + flex-direction: column; | |
| 4 | +`,q=C().label` | |
| 5 | + font-size: var(--yoast-font-size-default); | |
| 6 | + font-weight: var(--yoast-font-weight-bold); | |
| 7 | + ${(0,L.getDirectionalStyle)("margin-right: 4px","margin-left: 4px")}; | |
| 8 | +`,$=C().span` | |
| 9 | + margin-bottom: 0.5em; | |
| 10 | +`,B=C()(I.InputField)` | |
| 11 | + flex: 1 !important; | |
| 12 | + box-sizing: border-box; | |
| 13 | + max-width: 100%; | |
| 14 | + margin: 0; // Reset margins inherited from WordPress. | |
| 15 | + | |
| 16 | + // Hide native X in Edge and IE11. | |
| 17 | + &::-ms-clear { | |
| 18 | + display: none; | |
| 19 | + } | |
| 20 | + | |
| 21 | + &.has-error { | |
| 22 | + border-color: ${M} !important; | |
| 23 | + background-color: ${P} !important; | |
| 24 | + | |
| 25 | + &:focus { | |
| 26 | + box-shadow: 0 0 2px ${M} !important; | |
| 27 | + } | |
| 28 | + } | |
| 29 | +`,U=C().ul` | |
| 30 | + color: ${O}; | |
| 31 | + list-style-type: disc; | |
| 32 | + list-style-position: outside; | |
| 33 | + margin: 0; | |
| 34 | + margin-left: 1.2em; | |
| 35 | +`,W=C().li` | |
| 36 | + color: ${O}; | |
| 37 | + margin: 0 0 0.5em 0; | |
| 38 | +`,D=(0,I.addFocusStyle)(C().button` | |
| 39 | + border: 1px solid transparent; | |
| 40 | + box-shadow: none; | |
| 41 | + background: none; | |
| 42 | + flex: 0 0 32px; | |
| 43 | + height: 32px; | |
| 44 | + max-width: 32px; | |
| 45 | + padding: 0; | |
| 46 | + cursor: pointer; | |
| 47 | + `);D.propTypes={type:E().string,focusColor:E().string,focusBackgroundColor:E().string,focusBorderColor:E().string},D.defaultProps={type:"button",focusColor:T.colors.$color_button_text_hover,focusBackgroundColor:"transparent",focusBorderColor:T.colors.$color_blue};const H=C()(I.SvgIcon)` | |
| 48 | + margin-top: 4px; | |
| 49 | +`,z=C().div` | |
| 50 | + display: flex; | |
| 51 | + flex-direction: row; | |
| 52 | + align-items: center; | |
| 53 | + | |
| 54 | + &.has-remove-keyword-button { | |
| 55 | + ${B} { | |
| 56 | + ${(0,L.getDirectionalStyle)("padding-right: 40px","padding-left: 40px")}; | |
| 57 | + } | |
| 58 | + | |
| 59 | + ${D} { | |
| 60 | + ${(0,L.getDirectionalStyle)("margin-left: -32px","margin-right: -32px")}; | |
| 61 | + } | |
| 62 | + } | |
| 63 | +`;class G extends j.Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){this.props.onChange(e.target.value)}renderLabel(){const{id:e,label:s,helpLink:t}=this.props;return(0,N.jsxs)($,{children:[(0,N.jsx)(q,{htmlFor:e,children:s}),t]})}renderErrorMessages(){const e=[...this.props.errorMessages];return!(0,l.isEmpty)(e)&&(0,N.jsx)(U,{children:e.map((e,s)=>(0,N.jsx)(W,{children:(0,N.jsx)("span",{role:"alert",children:e})},s))})}render(){const{id:e,showLabel:s,keyword:t,onRemoveKeyword:r,onBlurKeyword:o,onFocusKeyword:i,hasError:n}=this.props,a=!s,c=r!==l.noop;return(0,N.jsxs)(F,{children:[s&&this.renderLabel(),n&&this.renderErrorMessages(),(0,N.jsxs)(z,{className:c?"has-remove-keyword-button":null,children:[(0,N.jsx)(B,{"aria-label":a?this.props.label:null,type:"text",id:e,className:n?"has-error":null,onChange:this.handleChange,onFocus:i,onBlur:o,value:t,autoComplete:"off"}),c&&(0,N.jsx)(D,{onClick:r,focusBoxShadowColor:"#084A67",children:(0,N.jsx)(H,{size:"18px",icon:"times-circle",color:A})})]})]})}}G.propTypes={id:E().string.isRequired,showLabel:E().bool,keyword:E().string,onChange:E().func.isRequired,onRemoveKeyword:E().func,onBlurKeyword:E().func,onFocusKeyword:E().func,label:E().string.isRequired,helpLink:E().node,hasError:E().bool,errorMessages:E().arrayOf(E().string)},G.defaultProps={showLabel:!0,keyword:"",onRemoveKeyword:l.noop,onBlurKeyword:l.noop,onFocusKeyword:l.noop,helpLink:null,hasError:!1,errorMessages:[]};const V=G;function K(e,s=""){const t=e.getIdentifier(),r={score:e.score,rating:u.interpreters.scoreToRating(e.score),hasMarks:e.hasMarks(),marker:e.getMarker(),id:t,text:e.text,markerId:s.length>0?`${s}:${t}`:t,hasBetaBadge:e.isBeta(),hasJumps:e.hasJumps(),hasAIFixes:e.isOptimizable(),editFieldName:e.editFieldName,editFieldAriaLabel:e.editFieldAriaLabel};return"ok"===r.rating&&(r.rating="OK"),r}function Y(e,s){switch(e.rating){case"error":s.errorsResults.push(e);break;case"feedback":s.considerationsResults.push(e);break;case"bad":s.problemsResults.push(e);break;case"OK":s.improvementsResults.push(e);break;case"good":s.goodResults.push(e)}return s}function Z(e){switch(e){case"loading":return{icon:"loading-spinner",color:T.colors.$color_green_medium_light};case"not-set":return{icon:"seo-score-none",color:T.colors.$color_score_icon};case"noindex":return{icon:"seo-score-none",color:T.colors.$color_noindex};case"good":return{icon:"seo-score-good",color:T.colors.$color_green_medium};case"ok":return{icon:"seo-score-ok",color:T.colors.$color_ok};default:return{icon:"seo-score-bad",color:T.colors.$color_red}}}function Q(e,s=""){let t={errorsResults:[],problemsResults:[],improvementsResults:[],goodResults:[],considerationsResults:[]};if(!e)return t;for(let r=0;r<e.length;r++){const o=e[r];o.text&&(t=Y(K(o,s),t))}return t}const X=window.yoast.uiLibrary,J=({id:e,label:s,description:t="",onChange:r,...o})=>(0,N.jsx)(X.Root,{children:(0,N.jsx)(X.TextField,{id:e,label:s,onChange:r,autoComplete:"off",description:t,...o})});J.propTypes={id:E().string.isRequired,label:E().string.isRequired,onChange:E().func.isRequired,description:E().node};const ee=J,se=(0,L.makeOutboundLink)(C().a` | |
| 64 | + display: inline-block; | |
| 65 | + position: relative; | |
| 66 | + outline: none; | |
| 67 | + text-decoration: none; | |
| 68 | + border-radius: 100%; | |
| 69 | + width: 24px; | |
| 70 | + height: 24px; | |
| 71 | + margin: -4px 0; | |
| 72 | + vertical-align: middle; | |
| 73 | + | |
| 74 | + color: ${T.colors.$color_help_text}; | |
| 75 | + | |
| 76 | + &:hover, | |
| 77 | + &:focus { | |
| 78 | + color: ${T.colors.$color_snippet_focus}; | |
| 79 | + } | |
| 80 | + | |
| 81 | + // Overwrite the default blue active color for links. | |
| 82 | + &:active { | |
| 83 | + color: ${T.colors.$color_help_text}; | |
| 84 | + } | |
| 85 | + | |
| 86 | + &::before { | |
| 87 | + position: absolute; | |
| 88 | + top: 0; | |
| 89 | + left: 0; | |
| 90 | + padding: 2px; | |
| 91 | + content: "\f223"; | |
| 92 | + } | |
| 93 | +`),te=C()(I.Collapsible)` | |
| 94 | + h2 > button { | |
| 95 | + padding-left: 24px; | |
| 96 | + padding-top: 16px; | |
| 97 | + | |
| 98 | + &:hover { | |
| 99 | + background-color: #f0f0f0; | |
| 100 | + } | |
| 101 | + } | |
| 102 | + | |
| 103 | + div[class^="collapsible_content"] { | |
| 104 | + padding: 24px 0; | |
| 105 | + margin: 0 24px; | |
| 106 | + border-top: 1px solid rgba(0,0,0,0.2); | |
| 107 | + } | |
| 108 | + | |
| 109 | +`,re=(0,L.getDirectionalStyle)("right: 16px","left: 24px"),oe=C().h2` | |
| 110 | + // wrapInHeading's resets, as longhands so the icon's lane below can override one side. | |
| 111 | + margin: 0 !important; | |
| 112 | + padding-block: 0 !important; | |
| 113 | + padding-inline-start: 0 !important; | |
| 114 | + font-size: ${e=>e.headingProps.fontSize} !important; | |
| 115 | + font-weight: ${e=>e.headingProps.fontWeight} !important; | |
| 116 | + color: ${e=>e.headingProps.color} !important; | |
| 117 | + | |
| 118 | + ${I.StyledTitle} { | |
| 119 | + font-weight: ${e=>e.headingProps.fontWeight}; | |
| 120 | + color: ${e=>e.headingProps.color}; | |
| 121 | + } | |
| 122 | + | |
| 123 | + position: relative; | |
| 124 | + display: flex; | |
| 125 | + align-items: center; | |
| 126 | + // The suffix icon's lane, so the title and the link shrink before reaching it. | |
| 127 | + padding-inline-end: 48px !important; | |
| 128 | + | |
| 129 | + &:hover { | |
| 130 | + background-color: #f0f0f0; | |
| 131 | + } | |
| 132 | + | |
| 133 | + // The link's wrapper, above the button's overlay so the link stays clickable. | |
| 134 | + > span { | |
| 135 | + position: relative; | |
| 136 | + z-index: 1; | |
| 137 | + flex: 0 0 auto; | |
| 138 | + } | |
| 139 | + | |
| 140 | + ${I.StyledIconsButton} { | |
| 141 | + flex: 0 1 auto; | |
| 142 | + min-width: 0; | |
| 143 | + width: auto; | |
| 144 | + /* | |
| 145 | + * Restates the shared h2 > button padding instead of inheriting a selector this heading does not | |
| 146 | + * own. Physical on purpose: the collapsibles it has to line up with are padded physically too. | |
| 147 | + */ | |
| 148 | + padding-block-start: 16px; | |
| 149 | + ${(0,L.getDirectionalStyle)("padding-left: 24px","padding-right: 16px")}; | |
| 150 | + // The help link brings its own leading gap, so the button ends at its title. | |
| 151 | + padding-inline-end: 0; | |
| 152 | + // Only the heading paints the hover, so it covers the row in one even color. | |
| 153 | + background-color: transparent; | |
| 154 | + | |
| 155 | + &:hover { | |
| 156 | + background-color: transparent; | |
| 157 | + } | |
| 158 | + | |
| 159 | + &::after { | |
| 160 | + content: ""; | |
| 161 | + position: absolute; | |
| 162 | + inset: 0; | |
| 163 | + } | |
| 164 | + | |
| 165 | + /* | |
| 166 | + * The ring moves to the overlay, because on the button it would frame the title alone. It cannot | |
| 167 | + * be reused: elsewhere it is the browser's own, which no pseudo-element can draw. Colors from Button.js. | |
| 168 | + */ | |
| 169 | + &:focus { | |
| 170 | + outline: none; | |
| 171 | + box-shadow: none; | |
| 172 | + } | |
| 173 | + | |
| 174 | + &:focus::after { | |
| 175 | + outline: 1px solid ${T.colors.$color_blue}; | |
| 176 | + outline-offset: -1px; | |
| 177 | + box-shadow: 0 0 3px ${(0,T.rgba)(T.colors.$color_blue_dark,.8)}; | |
| 178 | + } | |
| 179 | + | |
| 180 | + > svg:last-child { | |
| 181 | + position: absolute; | |
| 182 | + ${re}; | |
| 183 | + top: 50%; | |
| 184 | + transform: translateY(-50%); | |
| 185 | + margin: 0; | |
| 186 | + } | |
| 187 | + } | |
| 188 | +`,ie=({initialIsOpen:e=!1,id:s=null,HeaderHelpLink:t=null,headingProps:r=I.Collapsible.defaultProps.headingProps,...o})=>{const i=(0,j.useRef)(t);i.current=t;const n=(0,j.useRef)(r);n.current=r;const a=Boolean(t),l=(0,j.useMemo)(()=>a?function(e){const s=i.current;return(0,N.jsxs)(oe,{headingProps:n.current,children:[(0,N.jsx)(I.StyledIconsButton,{...e}),(0,N.jsx)("span",{children:(0,N.jsx)(s,{})})]})}:null,[a]);return(0,N.jsx)(te,{hasPadding:!0,hasSeparator:!0,initialIsOpen:e,id:s,headingProps:r,...l?{Heading:l}:{},...o})};ie.propTypes={initialIsOpen:E().bool,id:E().string,HeaderHelpLink:E().elementType,headingProps:E().shape({level:E().number,fontSize:E().string,fontWeight:E().string,color:E().string})};const ne=ie,ae=window.wp.components,le=({title:e="Yoast SEO",className:s="yoast yoast-gutenberg-modal",showYoastIcon:t=!0,children:r=null,additionalClassName:o="",...i})=>{const n=t?(0,N.jsx)("span",{className:"yoast-icon"}):null;return(0,N.jsx)(ae.Modal,{title:e,className:`${s} ${o}`,icon:n,...i,children:r})};le.propTypes={title:E().node,className:E().string,showYoastIcon:E().bool,children:E().oneOfType([E().node,E().arrayOf(E().node)]),additionalClassName:E().string};const ce=le,de=window.yoast.socialMetadataForms,ue=e=>({type:e.subtype,width:e.width,height:e.height,url:e.url,id:e.id,sizes:e.sizes,alt:e.alt||e.title||e.name});const pe=({hiddenField:e,hiddenFieldImageId:s="",hiddenFieldFallbackImageId:t="",hasImageValidation:r=!1,...o})=>{const[i,n]=(0,j.useState)(null!==document.getElementById(t)),a=(0,j.useMemo)(()=>document.getElementById(e)),l=(0,j.useMemo)(()=>document.getElementById(s));let c=null;c=t&&document.getElementById(t)?(0,j.useMemo)(()=>document.getElementById(t)):l;const[d,u]=(0,j.useState)({url:a?a.value:"",id:c?parseInt(c.value,10):"",alt:""}),[p,h]=(0,j.useState)([]),m=(0,j.useCallback)(e=>{a&&(a.value=e.url),c&&(c.value=e.id)}),g=(0,j.useCallback)(()=>{(function(e){const s=window.wp.media();return s.on("select",()=>{const t=s.state().get("selection").first();e(ue(t.attributes))}),s})(e=>{c=l,u(e),m(e),r&&h((0,L.validateFacebookImage)(e)),n(!1)}).open()},[r,m]),y=(0,j.useCallback)(()=>{c=l;const e={url:"",id:"",alt:""};u(e),m(e),h([]),n(!0)},[m]);return(0,j.useEffect)(()=>{var e;d.id&&!d.alt&&(e=d.id,new Promise((s,t)=>{window.wp.media.attachment||t(),window.wp.media.attachment(e).fetch().then(e=>{s(ue(e))}).catch(()=>t())})).then(e=>u(e))},[d]),(0,N.jsx)(I.ImageSelect,{...o,usingFallback:i,imageUrl:d.url,imageId:d.id,imageAltText:d.alt,onClick:g,onRemoveImageClick:y,warnings:p})};pe.propTypes={hiddenField:E().string.isRequired,hiddenFieldImageId:E().string,hiddenFieldFallbackImageId:E().string,hasImageValidation:E().bool};const he=pe;function me({target:e,children:s}){let t=e;return"string"==typeof e&&(t=document.getElementById(e)),t?(0,j.createPortal)(s,t):null}function ge({target:e,label:s,hasPreview:t,hiddenField:r,hiddenFieldImageId:o="",hiddenFieldFallbackImageId:i="",selectImageButtonId:n="",replaceImageButtonId:a="",removeImageButtonId:l="",hasNewBadge:c=!1,isDisabled:d=!1,hasPremiumBadge:u=!1,hasImageValidation:p=!1}){return(0,N.jsx)(me,{target:e,children:(0,N.jsx)(he,{label:s,hasPreview:t,hiddenField:r,hiddenFieldImageId:o,hiddenFieldFallbackImageId:i,selectImageButtonId:n,replaceImageButtonId:a,removeImageButtonId:l,hasNewBadge:c,isDisabled:d,hasPremiumBadge:u,hasImageValidation:p})})}me.propTypes={target:E().oneOfType([E().string,E().object]).isRequired,children:E().node.isRequired},ge.propTypes={target:E().string.isRequired,label:E().string.isRequired,hasPreview:E().bool.isRequired,hiddenField:E().string.isRequired,hiddenFieldImageId:E().string,hiddenFieldFallbackImageId:E().string,selectImageButtonId:E().string,replaceImageButtonId:E().string,removeImageButtonId:E().string,hasNewBadge:E().bool,isDisabled:E().bool,hasPremiumBadge:E().bool,hasImageValidation:E().bool};const ye=({target:e,scoreIndicator:s})=>(0,N.jsx)(me,{target:e,children:(0,N.jsx)(I.SvgIcon,{...Z(s)})});ye.propTypes={target:E().string.isRequired,scoreIndicator:E().string.isRequired};const xe=ye,fe=({title:e,children:s,id:t=null,prefixIcon:r=null,subTitle:o="",hasBetaBadgeLabel:i=!1,hasNewBadgeLabel:n=!1,buttonId:a=null,renderNewBadgeLabel:l=()=>{},initialIsOpen:c=!1})=>{const[d,u]=(0,j.useState)(c),p=(0,j.useRef)(null);(0,j.useEffect)(()=>{c&&p.current&&p.current.focus()},[]);const h=(0,j.useCallback)(()=>{u(e=>!e)},[u]);return(0,N.jsxs)("div",{id:t,className:"yoast components-panel__body "+(d?"is-opened":""),children:[(0,N.jsx)("h2",{className:"components-panel__body-title",children:(0,N.jsxs)("button",{ref:p,onClick:h,className:"components-button components-panel__body-toggle",type:"button",id:a,children:[(0,N.jsx)("span",{className:"yoast-icon-span",style:{fill:`${r&&r.color||""}`},children:r&&(0,N.jsx)(I.SvgIcon,{icon:r.icon,color:r.color,size:r.size})}),!n&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("span",{className:"yoast-title-container",children:[(0,N.jsx)("div",{className:"yoast-title",children:e}),o&&(0,N.jsx)("div",{className:"yoast-subtitle",children:o})]}),i&&(0,N.jsx)(I.BetaBadge,{})]}),n&&(0,N.jsxs)("div",{className:"yst-flex-grow yst-flex yst-items-center yst-gap-2",children:[(0,N.jsxs)("span",{className:"yst-overflow-x-hidden yst-leading-normal",children:[(0,N.jsx)("div",{className:"yoast-title",children:e}),o&&(0,N.jsx)("div",{className:"yoast-subtitle",children:o})]}),l()]}),(0,N.jsx)("span",{className:"yoast-chevron","aria-hidden":"true"})]})}),d&&s]})},we=fe;fe.propTypes={title:E().string.isRequired,children:E().oneOfType([E().node,E().arrayOf(E().node)]).isRequired,id:E().string,prefixIcon:E().object,subTitle:E().string,hasBetaBadgeLabel:E().bool,hasNewBadgeLabel:E().bool,buttonId:E().string,renderNewBadgeLabel:E().func,initialIsOpen:E().bool};const ve=({children:e})=>(0,N.jsx)("div",{children:e});ve.propTypes={renderPriority:E().number.isRequired,children:E().node.isRequired};const be=ve,ke=({theme:e,location:s,children:t})=>(0,N.jsx)(n.LocationProvider,{value:s,children:(0,N.jsx)(_.ThemeProvider,{theme:e,children:t})});ke.propTypes={theme:E().object.isRequired,location:E().oneOf(["sidebar","metabox","modal"]).isRequired,children:E().node.isRequired};const Se=ke,je=window.wp.compose,_e=window.wp.data,Ce=({onClick:e,title:s,id:t="",subTitle:r="",suffixIcon:o=null,SuffixHeroIcon:i=null,prefixIcon:n=null,children:a=null})=>(0,N.jsx)("div",{className:"yoast components-panel__body",children:(0,N.jsx)("h2",{className:"components-panel__body-title",children:(0,N.jsxs)("button",{id:t,onClick:e,className:"components-button components-panel__body-toggle",type:"button",children:[n&&(0,N.jsx)("span",{className:"yoast-icon-span",style:{fill:`${n&&n.color||""}`},children:(0,N.jsx)(I.SvgIcon,{size:n.size,icon:n.icon})}),(0,N.jsxs)("span",{className:"yoast-title-container",children:[(0,N.jsx)("div",{className:"yoast-title",children:s}),(0,N.jsx)("div",{className:"yoast-subtitle",children:r})]}),a,o&&(0,N.jsx)(I.SvgIcon,{size:o.size,icon:o.icon}),i]})})}),Re=Ce;Ce.propTypes={onClick:E().func.isRequired,title:E().string.isRequired,id:E().string,subTitle:E().string,suffixIcon:E().object,SuffixHeroIcon:E().element,prefixIcon:E().object,children:E().node};const Ee=({id:e,postTypeName:s,children:t,title:r,isOpen:o,open:i,close:a,shouldCloseOnClickOutside:l=!0,showChangesWarning:c=!0,SuffixHeroIcon:u=null,titleHelpLink:p=null})=>(0,N.jsxs)(j.Fragment,{children:[o&&(0,N.jsx)(n.LocationProvider,{value:"modal",children:(0,N.jsxs)(ce,{title:p?(0,N.jsxs)(N.Fragment,{children:[r,p]}):r,contentLabel:p?r:null,onRequestClose:a,additionalClassName:"yoast-collapsible-modal yoast-post-settings-modal",id:"id",shouldCloseOnClickOutside:l,children:[(0,N.jsx)("div",{className:"yoast-content-container",children:(0,N.jsx)("div",{className:"yoast-modal-content",children:t})}),(0,N.jsxs)("div",{className:"yoast-notice-container",children:[(0,N.jsx)("hr",{}),(0,N.jsxs)("div",{className:"yoast-button-container",children:[c&&(0,N.jsx)("p",{children:/* Translators: %s translates to the Post Label in singular form */ /* Translators: %s translates to the Post Label in singular form */ | |
| 189 | +(0,d.sprintf)((0,d.__)("Make sure to save your %s for changes to take effect","wordpress-seo"),s)}),(0,N.jsx)("button",{className:"yoast-button yoast-button--primary yoast-button--post-settings-modal",type:"button",onClick:a,children:/* Translators: %s translates to the Post Label in singular form */ /* Translators: %s translates to the Post Label in singular form */ | |
| 190 | +(0,d.sprintf)((0,d.__)("Return to your %s","wordpress-seo"),s)})]})]})]})}),(0,N.jsx)(Re,{id:e+"-open-button",title:r,SuffixHeroIcon:u,suffixIcon:u?null:{size:"20px",icon:"pencil-square"},onClick:i})]});Ee.propTypes={id:E().string.isRequired,postTypeName:E().string.isRequired,children:E().oneOfType([E().node,E().arrayOf(E().node)]).isRequired,title:E().string.isRequired,isOpen:E().bool.isRequired,open:E().func.isRequired,close:E().func.isRequired,shouldCloseOnClickOutside:E().bool,showChangesWarning:E().bool,SuffixHeroIcon:E().element,titleHelpLink:E().element};const Ie=Ee,Le=(0,je.compose)([(0,_e.withSelect)((e,s)=>{const{getPostOrPageString:t,getIsModalOpen:r}=e("yoast-seo/editor");return{postTypeName:t(),isOpen:r(s.id)}}),(0,_e.withDispatch)((e,s)=>{const{openEditorModal:t,closeEditorModal:r}=e("yoast-seo/editor");return{open:()=>t(s.id),close:r}})])(Ie),Te=(0,je.compose)([(0,_e.withSelect)((e,s)=>{const{isAlertDismissed:t}=e(s.store||"yoast-seo/editor");return{isAlertDismissed:t(s.alertKey)}}),(0,_e.withDispatch)((e,s)=>{const{dismissAlert:t}=e(s.store||"yoast-seo/editor");return{onDismissed:()=>t(s.alertKey)}})])(I.Alert),Ne=window.yoast.analysisReport;var Me=t(465),Pe=t.n(Me);const Ae=window.wp.url,Oe=(e,s)=>{try{return(0,j.createInterpolateElement)(e,s)}catch(s){return console.error("Error in translation for:",e,s),e}};var Fe,qe,$e=t(1609),Be=t.n($e);function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Ue.apply(null,arguments)}const We=e=>$e.createElement("svg",Ue({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 425 456.27"},e),Fe||(Fe=$e.createElement("path",{d:"M73 405.26a66.79 66.79 0 0 1-6.54-1.7 64.75 64.75 0 0 1-6.28-2.31c-1-.42-2-.89-3-1.37-1.49-.72-3-1.56-4.77-2.56-1.5-.88-2.71-1.64-3.83-2.39-.9-.61-1.8-1.26-2.68-1.92a70.154 70.154 0 0 1-5.08-4.19 69.21 69.21 0 0 1-8.4-9.17c-.92-1.2-1.68-2.25-2.35-3.24a70.747 70.747 0 0 1-3.44-5.64 68.29 68.29 0 0 1-8.29-32.55V142.13a68.26 68.26 0 0 1 8.29-32.55c1-1.92 2.21-3.82 3.44-5.64s2.55-3.58 4-5.27a69.26 69.26 0 0 1 14.49-13.25C50.37 84.19 52.27 83 54.2 82A67.59 67.59 0 0 1 73 75.09a68.75 68.75 0 0 1 13.75-1.39h169.66L263 55.39H86.75A86.84 86.84 0 0 0 0 142.13v196.09A86.84 86.84 0 0 0 86.75 425h11.32v-18.35H86.75A68.75 68.75 0 0 1 73 405.26zM368.55 60.85l-1.41-.53-6.41 17.18 1.41.53a68.06 68.06 0 0 1 8.66 4c1.93 1 3.82 2.2 5.65 3.43A69.19 69.19 0 0 1 391 98.67c1.4 1.68 2.72 3.46 3.95 5.27s2.39 3.72 3.44 5.64a68.29 68.29 0 0 1 8.29 32.55v264.52H233.55l-.44.76c-3.07 5.37-6.26 10.48-9.49 15.19L222 425h203V142.13a87.2 87.2 0 0 0-56.45-81.28z"})),qe||(qe=$e.createElement("path",{stroke:"#000",strokeMiterlimit:10,strokeWidth:3.81,d:"M119.8 408.28v46c28.49-1.12 50.73-10.6 69.61-29.58 19.45-19.55 36.17-50 52.61-96L363.94 1.9H305l-98.25 272.89-48.86-153h-54l71.7 184.18a75.67 75.67 0 0 1 0 55.12c-7.3 18.68-20.25 40.66-55.79 47.19z"})));var De=t(2514),He=t.n(De),ze=t(8738),Ge=t.n(ze),Ve=t(7656),Ke=t.n(Ve),Ye=t(2485),Ze=t.n(Ye);const Qe=({isOpen:e,onClose:s,id:t,upsellLink:r,title:o="",description:i="",benefits:n=[],note:a="",ctbId:l="",modalTitle:c})=>{const{isBlackFriday:u,isWooCommerceActive:p,isProductEntity:h,isWooSEOActive:m}=(0,_e.useSelect)(e=>{const s=e("yoast-seo/editor");return{isProductEntity:s.getIsProductEntity(),isWooCommerceActive:s.getIsWooCommerceActive(),isBlackFriday:s.isPromotionActive("black-friday-promotion"),isWooSEOActive:s.getIsWooSeoActive()}},[]),g=(0,j.useMemo)(()=>p&&h,[p,h]),y=(0,j.useRef)(null);return(0,N.jsx)(X.Modal,{isOpen:e,onClose:s,id:t,initialFocus:y,children:(0,N.jsx)(X.Modal.Panel,{className:"yst-max-w-md yst-p-0",hasCloseButton:!1,children:(0,N.jsxs)(X.Modal.Container,{children:[(0,N.jsxs)(X.Modal.Container.Header,{className:"yst-p-6 yst-border-b-slate-200 yst-border-b yst-flex yst-justify-start yst-gap-3 yst-items-center",children:[g?(0,N.jsx)(Ke(),{className:"yst-text-woo-light yst-w-6 yst-h-6 yst-scale-x-[-1]"}):(0,N.jsx)(We,{className:"yst-fill-primary-500 yst-w-5 yst-h-5"}),(0,N.jsx)(X.Modal.Title,{as:"h3",className:Ze()(g?"yst-text-woo-light":"yst-text-primary-500","yst-text-base yst-font-normal"),children:c}),(0,N.jsx)(X.Modal.CloseButton,{className:"yst-top-2",onClick:s,screenReaderText:(0,d.__)("Close modal","wordpress-seo")})]}),(0,N.jsxs)(X.Modal.Container.Content,{className:"yst-p-0",children:[u&&(0,N.jsx)("div",{className:"yst-flex yst-font-semibold yst-items-center yst-text-lg yst-content-between yst-bg-black yst-text-amber-300 yst-h-9 yst-border-amber-300 yst-border-y yst-border-x-0 yst-border-solid yst-px-6",children:(0,N.jsx)("div",{className:"yst-mx-auto",children:(0,d.__)("BLACK FRIDAY | 30% OFF","wordpress-seo")})}),(0,N.jsxs)("div",{className:"yst-py-6 yst-px-12",children:[(0,N.jsx)(X.Title,{as:"h3",className:"yst-mb-1 yst-leading-5 yst-text-sm yst-font-medium yst-text-slate-800",children:o}),(0,N.jsx)("p",{className:"yst-mb-2",children:i}),Array.isArray(n)&&n.length>0&&(0,N.jsx)("ul",{className:"yst-my-2",children:n.map((e,s)=>(0,N.jsxs)("li",{className:"yst-flex yst-gap-1 yst-mb-2",children:[(0,N.jsx)(Ge(),{className:"yst-mr-1 yst-text-green-500 yst-w-[19.5px] yst-h-[19.5px] yst-flex-shrink-0"}),(0,N.jsx)("p",{className:"yst-text-slate-600",children:e})]},`${t}-upsell-benefit-${s}`))}),"function"==typeof n&&n(),(0,N.jsxs)("div",{className:"yst-text-center",children:[(0,N.jsxs)(X.Button,{as:"a",variant:"upsell",className:"yst-my-2 yst-gap-1.5 yst-w-full",href:r,target:"_blank","data-action":"load-nfd-ctb","data-ctb-id":l,ref:y,children:[(0,N.jsx)(He(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-shrink-0"}),(0,d.sprintf)(/* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */ /* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */ | |
| 191 | +(0,d.__)("Explore %s","wordpress-seo"),g&&!m?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,N.jsx)("span",{className:"yst-sr-only",children:(0,d.__)("Opens in a new tab","wordpress-seo")})]}),(0,N.jsx)("div",{className:"yst-italic yst-text-slate-500 yst-mt-1",children:a})]})]})]})]})})})},Xe=({isOpen:e,closeModal:s,id:t,upsellLink:r})=>{const{locationContext:o}=(0,n.useRootContext)(),i=(0,Ae.addQueryArgs)(wpseoAdminL10n[r],{context:o}),a=[Oe((0,d.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */ | |
| 192 | +(0,d.__)("%1$sKeyphrase distribution:%2$s See if your keywords are spread evenly so search engines understand your topic","wordpress-seo"),"<span>","</span>"),{span:(0,N.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),Oe((0,d.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */ | |
| 193 | +(0,d.__)("%1$sTitle check:%2$s Instantly spot missing titles and fix them for better click-through rates","wordpress-seo"),"<span>","</span>"),{span:(0,N.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),Oe((0,d.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */ | |
| 194 | +(0,d.__)("%1$sSynonyms:%2$s Include synonyms of your keyphrase for a more natural flow and smarter suggestions","wordpress-seo"),"<span>","</span>"),{span:(0,N.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})})];return(0,N.jsx)(Qe,{isOpen:e,onClose:s,id:t,modalTitle:(0,d.__)("Get deeper SEO insights with Premium","wordpress-seo"),title:(0,d.__)("Find new ways to grow your rankings.","wordpress-seo"),description:(0,d.__)("Premium gives you advanced content checks that reveal new ranking opportunities and help you reach more readers.","wordpress-seo"),upsellLink:i,benefits:a,note:(0,d.__)("Upgrade to optimize with precision","wordpress-seo"),ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})};Xe.propTypes={isOpen:E().bool.isRequired,closeModal:E().func.isRequired,id:E().string.isRequired,upsellLink:E().string.isRequired};class Je extends j.Component{constructor(e){super(e);const s=this.props.results;this.state={mappedResults:{}},null!==s&&(this.state={mappedResults:Q(s,this.props.keywordKey)}),this.handleMarkButtonClick=this.handleMarkButtonClick.bind(this),this.handleEditButtonClick=this.handleEditButtonClick.bind(this),this.handleResultsChange=this.handleResultsChange.bind(this),this.renderHighlightingUpsell=this.renderHighlightingUpsell.bind(this),this.createMarkButton=this.createMarkButton.bind(this)}componentDidUpdate(e){null!==this.props.results&&this.props.results!==e.results&&this.setState({mappedResults:Q(this.props.results,this.props.keywordKey)})}createMarkButton({ariaLabel:e,id:s,className:t,status:r,onClick:o,isPressed:i}){return(0,N.jsxs)(j.Fragment,{children:[(0,N.jsx)(I.IconButtonToggle,{marksButtonStatus:r,className:t,onClick:o,id:s,icon:"eye",pressed:i,ariaLabel:e}),this.props.shouldUpsellHighlighting&&(0,N.jsx)("div",{className:"yst-root",children:(0,N.jsx)(X.Badge,{className:"yst-absolute yst-px-[3px] yst-py-[3px] yst--end-[6.5px] yst--top-[6.5px]",size:"small",variant:"upsell",children:(0,N.jsx)(Pe(),{className:"yst-w-2.5 yst-h-2.5 yst-shrink-0",role:"img","aria-hidden":!0,focusable:!1})})})]})}deactivateMarker(){this.props.setActiveMarker(null),this.props.setMarkerPauseStatus(!1),this.removeMarkers()}activateMarker(e,s){this.props.setActiveMarker(e),s()}handleMarkButtonClick(e,s){const t=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;this.props.activeAIFixesButton&&this.props.setActiveAIFixesButton(null),t===this.props.activeMarker?this.deactivateMarker():this.activateMarker(t,s)}handleResultsChange(e,s,t){const r=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;r===this.props.activeMarker&&(t?(0,l.isUndefined)(s)||this.activateMarker(r,s):this.deactivateMarker())}focusOnKeyphraseField(e){const s=this.props.keywordKey,t=""===s?"focus-keyword-input-"+e:"yoast-keyword-input-"+s+"-"+e,r=document.getElementById(t);r.focus(),r.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}focusOnGooglePreviewField(e,s){const t=document.getElementById("yoast-google-preview-"+e+"-"+s);t.focus(),t.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}handleEditButtonClick(e,s){var t;null==s||null===(t=s.currentTarget)||void 0===t||t.blur();const r=this.props.location;"keyphrase"!==e?(["description","title","slug"].includes(e)&&this.handleGooglePreviewFocus(r,e),(0,p.doAction)("yoast.focus.input",e)):this.focusOnKeyphraseField(r)}handleGooglePreviewFocus(e,s){if("sidebar"===e)document.getElementById("yoast-search-appearance-modal-open-button").click(),setTimeout(()=>this.focusOnGooglePreviewField(s,"modal"),500);else{const t=document.getElementById("yoast-snippet-editor-metabox");t&&"false"===t.getAttribute("aria-expanded")?(t.click(),setTimeout(()=>this.focusOnGooglePreviewField(s,e),100)):this.focusOnGooglePreviewField(s,e)}}removeMarkers(){window.YoastSEO.analysis.applyMarks(new u.Paper("",{}),[])}renderHighlightingUpsell(e,s){const t=(0,d.__)("Highlight areas of improvement in your text, no more searching for a needle in a haystack, straight to optimizing! Now also in Elementor!","wordpress-seo");return(0,N.jsx)(Xe,{isOpen:e,closeModal:s,id:"yoast-premium-seo-analysis-highlighting-modal",upsellLink:this.props.highlightingUpsellLink,description:t})}render(){const{mappedResults:e}=this.state,{errorsResults:s,improvementsResults:t,goodResults:r,considerationsResults:o,problemsResults:i}=e,{upsellResults:n,resultCategoryLabels:a}=this.props,l={errors:(0,d.__)("Errors","wordpress-seo"),problems:(0,d.__)("Problems","wordpress-seo"),improvements:(0,d.__)("Improvements","wordpress-seo"),considerations:(0,d.__)("Considerations","wordpress-seo"),goodResults:(0,d.__)("Good results","wordpress-seo")},c=Object.assign(l,a);let u=this.props.marksButtonStatus;return"enabled"===u&&this.props.shortcodesForParsing.length>0&&(u="disabled"),(0,N.jsx)(j.Fragment,{children:(0,N.jsx)(Ne.ContentAnalysis,{errorsResults:s,problemsResults:i,upsellResults:n,improvementsResults:t,considerationsResults:o,goodResults:r,activeMarker:this.props.activeMarker,onMarkButtonClick:this.handleMarkButtonClick,onEditButtonClick:this.handleEditButtonClick,marksButtonClassName:this.props.marksButtonClassName,editButtonClassName:this.props.editButtonClassName,marksButtonStatus:u,headingLevel:3,keywordKey:this.props.keywordKey,id:this.props.id,isPremium:this.props.isPremium,resultCategoryLabels:c,onResultChange:this.handleResultsChange,shouldUpsellHighlighting:this.props.shouldUpsellHighlighting,renderAIOptimizeButton:this.props.renderAIOptimizeButton,renderHighlightingUpsell:this.renderHighlightingUpsell,markButtonFactory:this.createMarkButton})})}}Je.propTypes={results:E().array,upsellResults:E().array,marksButtonClassName:E().string,editButtonClassName:E().string,marksButtonStatus:E().oneOf(["enabled","disabled","hidden"]),setActiveMarker:E().func.isRequired,setMarkerPauseStatus:E().func.isRequired,setActiveAIFixesButton:E().func.isRequired,activeMarker:E().string,activeAIFixesButton:E().string,keywordKey:E().string,location:E().string,id:E().string,isPremium:E().bool,resultCategoryLabels:E().shape({errors:E().string,problems:E().string,improvements:E().string,considerations:E().string,goodResults:E().string}),shortcodesForParsing:E().array,shouldUpsellHighlighting:E().bool,highlightingUpsellLink:E().string,renderAIOptimizeButton:E().func},Je.defaultProps={results:null,upsellResults:[],marksButtonStatus:"enabled",marksButtonClassName:"",editButtonClassName:"",activeMarker:null,activeAIFixesButton:null,keywordKey:"",location:"",id:"",isPremium:!1,resultCategoryLabels:{},shortcodesForParsing:[],shouldUpsellHighlighting:!1,highlightingUpsellLink:"",renderAIOptimizeButton:()=>{}};const es=Je,ss=(0,je.compose)([(0,_e.withSelect)(e=>{const{getActiveMarker:s,getIsPremium:t,getShortcodesForParsing:r,getActiveAIFixesButton:o}=e("yoast-seo/editor");return{activeMarker:s(),isPremium:t(),shortcodesForParsing:r(),activeAIFixesButton:o()}}),(0,_e.withDispatch)(e=>{const{setActiveMarker:s,setMarkerPauseStatus:t,setActiveAIFixesButton:r}=e("yoast-seo/editor");return{setActiveMarker:s,setMarkerPauseStatus:t,setActiveAIFixesButton:r}})])(es),ts=window.yoast.relatedKeyphraseSuggestions;function rs({requestLimitReached:e,isSuccess:s,response:t,requestHasData:r,relatedKeyphrases:o}){return e?"requestLimitReached":!s&&function(e){return"invalid_json"===(null==e?void 0:e.code)||"fetch_error"===(null==e?void 0:e.code)||!(0,l.isEmpty)(e)&&"error"in e}(t)?"requestFailed":r?function(e){return e&&e.length>=4}(o)?"maxRelatedKeyphrases":null:"requestEmpty"}function os({keyphrase:e="",relatedKeyphrases:s=[],renderAction:t=null,requestLimitReached:r=!1,countryCode:o,setCountry:i,newRequest:n,response:a={},isRtl:l=!1,userLocale:c="en_US",isPending:d=!1,isSuccess:u=!1,requestHasData:p=!0,isPremium:h=!1,semrushUpsellLink:m="",premiumUpsellLink:g=""}){var y,x;const[f,w]=(0,j.useState)(o),v=(0,j.useCallback)(async()=>{n(o,e),w(o)},[o,e,n]);return(0,N.jsxs)(X.Root,{context:{isRtl:l},children:[!r&&!h&&(0,N.jsx)(ts.PremiumUpsell,{url:g,className:"yst-mb-4"}),!r&&(0,N.jsx)(ts.CountrySelector,{countryCode:o,activeCountryCode:f,onChange:i,onClick:v,className:"yst-mb-4",userLocale:c.split("_")[0]}),!d&&(0,N.jsx)(ts.UserMessage,{variant:rs({requestLimitReached:r,isSuccess:u,response:a,requestHasData:p,relatedKeyphrases:s}),upsellLink:m}),(0,N.jsx)(ts.KeyphrasesTable,{relatedKeyphrases:s,columnNames:null==a||null===(y=a.results)||void 0===y?void 0:y.columnNames,data:null==a||null===(x=a.results)||void 0===x?void 0:x.rows,isPending:d,renderButton:t,className:"yst-mt-4"})]})}os.propTypes={keyphrase:E().string,relatedKeyphrases:E().array,renderAction:E().func,requestLimitReached:E().bool,countryCode:E().string.isRequired,setCountry:E().func.isRequired,newRequest:E().func.isRequired,response:E().object,isRtl:E().bool,userLocale:E().string,isPending:E().bool,isSuccess:E().bool,requestHasData:E().bool,isPremium:E().bool,semrushUpsellLink:E().string,premiumUpsellLink:E().string};const is=(0,je.compose)([(0,_e.withSelect)(e=>{const{getFocusKeyphrase:s,getSEMrushSelectedCountry:t,getSEMrushRequestLimitReached:r,getSEMrushRequestResponse:o,getSEMrushRequestIsSuccess:i,getSEMrushIsRequestPending:n,getSEMrushRequestHasData:a,getPreference:l,getIsPremium:c,selectLinkParams:d}=e("yoast-seo/editor");return{keyphrase:s(),countryCode:t(),requestLimitReached:r(),response:o(),isSuccess:i(),isPending:n(),requestHasData:a(),isRtl:l("isRtl",!1),userLocale:l("userLocale","en_US"),isPremium:c(),semrushUpsellLink:(0,Ae.addQueryArgs)("https://yoa.st/semrush-prices",d()),premiumUpsellLink:(0,Ae.addQueryArgs)("https://yoa.st/413",d())}}),(0,_e.withDispatch)(e=>{const{setSEMrushChangeCountry:s,setSEMrushNewRequest:t}=e("yoast-seo/editor");return{setCountry:e=>{s(e)},newRequest:(e,s)=>{t(e,s)}}})])(os);function ns(e,s,t,r){return new Promise((o,i)=>{jQuery.ajax({type:e,url:s,beforeSend:t?e=>{e.setRequestHeader("X-WP-Nonce",t)}:null,data:r,dataType:"json",success:o,error:i})})}const as=window.wp.sanitize,ls="SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLE",cs="SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLES_BATCH";function ds(e,s,t="",r=!1){const o="string"==typeof s?(0,L.decodeHTML)(s):s;return{type:ls,name:e,value:o,label:t,hidden:r}}function us(e){return e.charAt(0).toUpperCase()+e.slice(1)}const{stripHTMLTags:ps}=L.strings,hs=["slug","content","contentImage","snippetPreviewImageURL"];function ms(e,s){(0,l.forEach)(e,(e,t)=>{hs.includes(t)||s.dispatch(ds(t,e))})}function gs(e){if(!["ct_","cf_","pt_"].includes(e.substring(0,3)))return e.replace(/_/g," ");const s=e.slice(0,3);switch(-1!==(e=e.slice(3)).indexOf("desc_")&&(e=e.slice(5)+" description"),s){case"ct_":e+=" (custom taxonomy)";break;case"cf_":e+=" (custom field)";break;case"pt_":e="Post type ("+(e=e.replace("single","singular"))+")"}return e}function ys(e){return us(e=gs(e))}function xs(e,s){return e.push({name:s.name,label:s.label||ys(s.name),value:s.value}),e}function fs(e,s="_"){return e.replace(/\s/g,s)}function ws(e){return{name:"cf_"+fs(e),label:us(e+" (custom field)")}}function vs(e){const s=fs(e);return{name:"ct_"+s,label:us(e+" (custom taxonomy)"),descriptionName:"ct_desc_"+s,descriptionLabel:us(e+" description (custom taxonomy)")}}function bs(e,s){if(!e.custom_taxonomies)return e;const t={};return(0,l.forEach)(e.custom_taxonomies,(e,s)=>{const{name:r,label:o,descriptionName:i,descriptionLabel:n}=vs(s),a="string"==typeof e.name?(0,L.decodeHTML)(e.name):e.name,l="string"==typeof e.description?(0,L.decodeHTML)(e.description):e.description;t[r]={value:a,label:o},t[i]={value:l,label:n}}),s.dispatch(function(e){return{type:cs,updatedVariables:e}}(t)),(0,l.omit)({...e},"custom_taxonomies")}function ks(e,s){return e.custom_fields?((0,l.forEach)(e.custom_fields,(e,t)=>{const{name:r,label:o}=ws(t);s.dispatch(ds(r,e,o))}),(0,l.omit)({...e},"custom_fields")):e}function Ss(e,s=156){return(e=(e=(0,as.stripTags)(e)).trim()).length<=s||(e=e.substring(0,s),/\s/.test(e)&&(e=e.substring(0,e.lastIndexOf(" ")))),e}const js=function(e){const s=(0,l.get)(window,["YoastSEO","app","pluggable"],!1);if(!s||!(0,l.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){const s=(0,l.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],l.identity);return{url:e.url,title:ps(s(e.title)),description:ps(s(e.description)),filteredSEOTitle:e.filteredSEOTitle?ps(s(e.filteredSEOTitle)):""}}(e);const t=s._applyModifications.bind(s);return{url:e.url,title:ps(t("data_page_title",e.title)),description:ps(t("data_meta_desc",e.description)),filteredSEOTitle:e.filteredSEOTitle?ps(t("data_page_title",e.filteredSEOTitle)):""}};var _s="score-text",Cs="image yoast-logo svg",Rs=jQuery;function Es(e,s,t=null){var r,o,i,n,a;if(null!==t)return(0,l.get)(t,s,"");const c=(0,_e.select)("yoast-seo/editor").getIsPremium(),u={na:(0,d.__)("Not available","wordpress-seo"),bad:(0,d.__)("Needs improvement","wordpress-seo"),ok:(0,d.__)("OK","wordpress-seo"),good:(0,d.__)("Good","wordpress-seo")},p={keyword:{label:c?(0,d.__)("Premium SEO analysis:","wordpress-seo"):(0,d.__)("SEO analysis:","wordpress-seo"),anchor:"yoast-seo-analysis-collapsible-metabox",status:u},content:{label:(0,d.__)("Readability analysis:","wordpress-seo"),anchor:"yoast-readability-analysis-collapsible-metabox",status:u},"inclusive-language":{label:(0,d.__)("Inclusive language:","wordpress-seo"),anchor:"yoast-inclusive-language-analysis-collapsible-metabox",status:{...u,ok:(0,d.__)("Potentially non-inclusive","wordpress-seo")}}};return null!=p&&null!==(r=p[e])&&void 0!==r&&null!==(o=r.status)&&void 0!==o&&o[s]?`<a href="#${null===(i=p[e])||void 0===i?void 0:i.anchor}">${null===(n=p[e])||void 0===n?void 0:n.label}</a> <strong>${null===(a=p[e])||void 0===a?void 0:a.status[s]}</strong>`:""}var Is=t(6702),Ls=t.n(Is);E().string.isRequired;var Ts=t(818),Ns=t.n(Ts);E().string.isRequired,E().string.isRequired,E().shape({src:E().string.isRequired,width:E().string,height:E().string}).isRequired,E().shape({value:E().bool.isRequired,status:E().string.isRequired,set:E().func.isRequired}).isRequired,E().string,E().string,E().string;const Ms=({handleRefreshClick:e,supportLink:s})=>(0,N.jsxs)("div",{className:"yst-flex yst-gap-2",children:[(0,N.jsx)(X.Button,{onClick:e,children:(0,d.__)("Refresh this page","wordpress-seo")}),(0,N.jsx)(X.Button,{variant:"secondary",as:"a",href:s,target:"_blank",rel:"noopener",children:(0,d.__)("Contact support","wordpress-seo")})]});Ms.propTypes={handleRefreshClick:E().func.isRequired,supportLink:E().string.isRequired};const Ps=({handleRefreshClick:e,supportLink:s})=>(0,N.jsxs)("div",{className:"yst-grid yst-grid-cols-1 yst-gap-y-2",children:[(0,N.jsx)(X.Button,{className:"yst-order-last",onClick:e,children:(0,d.__)("Refresh this page","wordpress-seo")}),(0,N.jsx)(X.Button,{variant:"secondary",as:"a",href:s,target:"_blank",rel:"noopener",children:(0,d.__)("Contact support","wordpress-seo")})]});Ps.propTypes={handleRefreshClick:E().func.isRequired,supportLink:E().string.isRequired};const As=({error:e,children:s=null})=>(0,N.jsxs)("div",{role:"alert",className:"yst-max-w-screen-sm yst-p-8 yst-space-y-4",children:[(0,N.jsx)(X.Title,{children:(0,d.__)("Something went wrong. An unexpected error occurred.","wordpress-seo")}),(0,N.jsx)("p",{children:(0,d.__)("We're very sorry, but it seems like the following error has interrupted our application:","wordpress-seo")}),(0,N.jsx)(X.Alert,{variant:"error",children:(null==e?void 0:e.message)||(0,d.__)("Undefined error message.","wordpress-seo")}),(0,N.jsx)("p",{children:(0,d.__)("Unfortunately, this means that any unsaved changes in this section will be lost. You can try and refresh this page to resolve the problem. If this error still occurs, please get in touch with our support team, and we'll get you all the help you need!","wordpress-seo")}),s]});As.propTypes={error:E().object.isRequired,children:E().node},As.VerticalButtons=Ps,As.HorizontalButtons=Ms;const Os={variant:{lg:{grid:"yst-grid lg:yst-grid-cols-3 lg:yst-gap-12",col1:"yst-col-span-1",col2:"lg:yst-mt-0 lg:yst-col-span-2"},xl:{grid:"yst-grid xl:yst-grid-cols-3 xl:yst-gap-12",col1:"yst-col-span-1",col2:"xl:yst-mt-0 xl:yst-col-span-2"},"2xl":{grid:"yst-grid 2xl:yst-grid-cols-3 2xl:yst-gap-12",col1:"yst-col-span-1",col2:"2xl:yst-mt-0 2xl:yst-col-span-2"}}},Fs=({id:e,children:s,title:t,description:r=null,variant:o="2xl"})=>(0,N.jsxs)("section",{id:e,className:Os.variant[o].grid,children:[(0,N.jsx)("div",{className:Os.variant[o].col1,children:(0,N.jsxs)("div",{className:"yst-max-w-screen-sm",children:[(0,N.jsx)(X.Title,{as:"h2",size:"4",children:t}),r&&(0,N.jsx)("p",{className:"yst-mt-2",children:r})]})}),(0,N.jsxs)("fieldset",{className:`yst-min-w-0 yst-mt-8 ${Os.variant[o].col2}`,children:[(0,N.jsx)("legend",{className:"yst-sr-only",children:t}),(0,N.jsx)("div",{className:"yst-space-y-8",children:s})]})]});Fs.propTypes={id:E().string,children:E().node.isRequired,title:E().node.isRequired,description:E().node,variant:E().oneOf(Object.keys(Os.variant))};const qs=window.ReactDOM;var $s,Bs,Us;(Bs=$s||($s={})).Pop="POP",Bs.Push="PUSH",Bs.Replace="REPLACE",function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(Us||(Us={})),new Set(["lazy","caseSensitive","path","id","index","children"]),Error;const Ws=["post","put","patch","delete"],Ds=(new Set(Ws),["get",...Ws]);new Set(Ds),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred"),$e.Component,$e.startTransition,new Promise(()=>{}),$e.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}var Hs,zs,Gs,Vs;new Map,$e.startTransition,qs.flushSync,$e.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,(Vs=Hs||(Hs={})).UseScrollRestoration="useScrollRestoration",Vs.UseSubmit="useSubmit",Vs.UseSubmitFetcher="useSubmitFetcher",Vs.UseFetcher="useFetcher",Vs.useViewTransitionState="useViewTransitionState",(Gs=zs||(zs={})).UseFetcher="useFetcher",Gs.UseFetchers="useFetchers",Gs.UseScrollRestoration="useScrollRestoration",E().string.isRequired,E().string;const Ks=({href:e,children:s=null,...t})=>(0,N.jsxs)(X.Link,{target:"_blank",rel:"noopener noreferrer",...t,href:e,children:[s,(0,N.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */ | |
| 195 | +(0,d.__)("(Opens in a new browser tab)","wordpress-seo")})]});Ks.propTypes={href:E().string.isRequired,children:E().node};(0,d.__)("Create optimized SEO titles & meta descriptions in seconds","wordpress-seo"),(0,d.__)("Apply AI suggestions to improve content in 1 click","wordpress-seo"),(0,d.__)("Manage redirects with ease and without extra plugins","wordpress-seo"),(0,d.__)("Optimize pages for multiple keywords with guidance","wordpress-seo"),(0,d.__)("Add product details to help your listings stand out","wordpress-seo"),(0,d.__)("Make sure search engines show the right version of your product page","wordpress-seo"),(0,d.__)("Create optimized SEO titles & meta descriptions with AI","wordpress-seo"),(0,d.__)("Receive clear SEO and readability guidance to optimize your products","wordpress-seo"),(0,d.__)("Generate SEO optimized metadata in seconds with AI","wordpress-seo"),(0,d.__)("Make your articles visible, be seen in Google News","wordpress-seo"),(0,d.__)("Built to get found by search, AI, and real users","wordpress-seo"),(0,d.__)("Easy Local SEO. Show up in Google Maps results","wordpress-seo"),(0,d.__)("Internal links and redirect management, easy","wordpress-seo"),(0,d.__)("Access to friendly help when you need it, day or night","wordpress-seo");E().string.isRequired,E().object.isRequired,E().func.isRequired,E().bool.isRequired,t(3473),E().string.isRequired,E().object,E().func.isRequired,E().bool.isRequired,E().string.isRequired,E().object.isRequired,E().string.isRequired,E().func.isRequired,E().bool.isRequired;var Ys=t(5074),Zs=t.n(Ys);const Qs=({isOpen:e,onClose:s=l.noop,onDiscard:t=l.noop,title:r,description:o,dismissLabel:i,discardLabel:n})=>{const a=(0,X.useSvgAria)();return(0,N.jsx)(X.Modal,{isOpen:e,onClose:s,children:(0,N.jsxs)(X.Modal.Panel,{closeButtonScreenReaderText:(0,d.__)("Close","wordpress-seo"),children:[(0,N.jsxs)("div",{className:"sm:yst-flex sm:yst-items-start",children:[(0,N.jsx)("div",{className:"yst-mx-auto yst-flex-shrink-0 yst-flex yst-items-center yst-justify-center yst-h-12 yst-w-12 yst-rounded-full yst-bg-red-100 sm:yst-mx-0 sm:yst-h-10 sm:yst-w-10",children:(0,N.jsx)(Zs(),{className:"yst-h-6 yst-w-6 yst-text-red-600",...a})}),(0,N.jsxs)("div",{className:"yst-mt-3 yst-text-center sm:yst-mt-0 sm:yst-ms-4 sm:yst-text-start",children:[(0,N.jsx)(X.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900 yst-mb-3",children:r}),(0,N.jsx)(X.Modal.Description,{className:"yst-text-sm yst-text-slate-500",children:o})]})]}),(0,N.jsxs)("div",{className:"yst-flex yst-flex-col sm:yst-flex-row-reverse yst-gap-3 yst-mt-6",children:[(0,N.jsx)(X.Button,{type:"button",variant:"error",onClick:t,className:"yst-block",children:n}),(0,N.jsx)(X.Button,{type:"button",variant:"secondary",onClick:s,className:"yst-block",children:i})]})]})})};Qs.propTypes={isOpen:E().bool.isRequired,onClose:E().func,onDiscard:E().func,title:E().string.isRequired,description:E().string.isRequired,dismissLabel:E().string.isRequired,discardLabel:E().string.isRequired};const Xs=window.yoast.reactHelmet,Js="error",et="loading",st="error",tt="showPlay",rt="askPermission",ot="isPlaying",it=({videoId:e,thumbnail:s,wistiaEmbedPermission:t,className:r=""})=>{const[o,i]=(0,j.useState)(t.value?ot:tt),n=(0,j.useCallback)(()=>i(ot),[i]),a=(0,j.useCallback)(()=>{t.value?n():i(rt)},[t.value,n,i]),l=(0,j.useCallback)(()=>i(tt),[i]),c=(0,j.useCallback)(()=>{t.set(!0),n()},[t.set,n]);return(0,N.jsxs)(N.Fragment,{children:[t.value&&(0,N.jsx)(Xs.Helmet,{children:(0,N.jsx)("script",{src:"https://fast.wistia.com/assets/external/E-v1.js",async:!0})}),(0,N.jsxs)("div",{className:Ze()("yst-relative yst-w-full yst-h-0 yst-pt-[47.25%] yst-overflow-hidden yst-rounded-md yst-drop-shadow-md yst-bg-white",r),children:[o===tt&&(0,N.jsx)("button",{type:"button",className:"yst-absolute yst-inset-0 yst-button yst-p-0 yst-border-none yst-bg-white yst-transition-opacity yst-duration-1000 yst-opacity-100",onClick:a,children:(0,N.jsx)("img",{className:"yst-w-full yst-h-auto yst-object-contain",alt:"",loading:"lazy",decoding:"async",...s})}),o===rt&&(0,N.jsxs)("div",{className:"yst-absolute yst-inset-0 yst-flex yst-flex-col yst-items-center yst-justify-center yst-bg-white",children:[(0,N.jsxs)("p",{className:"yst-max-w-xs yst-mx-auto yst-text-center",children:[t.status===et&&(0,N.jsx)(X.Spinner,{}),t.status!==et&&(0,d.sprintf)(/* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */ /* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */ | |
| 196 | +(0,d.__)("To see this video, you need to allow %1$s to load embedded videos from %2$s.","wordpress-seo"),"Yoast SEO","Wistia")]}),(0,N.jsxs)("div",{className:"yst-flex yst-mt-6 yst-gap-x-4",children:[(0,N.jsx)(X.Button,{type:"button",variant:"secondary",onClick:l,disabled:t.status===et,children:(0,d.__)("Deny","wordpress-seo")}),(0,N.jsx)(X.Button,{type:"button",variant:"primary",onClick:c,disabled:t.status===et,children:(0,d.__)("Allow","wordpress-seo")})]})]}),t.value&&o===ot&&(0,N.jsxs)("div",{className:"yst-absolute yst-w-full yst-h-full yst-top-0 yst-right-0",children:[null===e&&(0,N.jsx)(X.Spinner,{className:"yst-h-full yst-mx-auto"}),null!==e&&(0,N.jsx)("div",{className:`wistia_embed wistia_async_${e} videoFoam=true`})]})]})]})};var nt,at;function lt(){return lt=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},lt.apply(null,arguments)}it.propTypes={videoId:E().string.isRequired,thumbnail:E().shape({src:E().string.isRequired,width:E().string,height:E().string}).isRequired,wistiaEmbedPermission:E().shape({value:E().bool.isRequired,status:E().string.isRequired,set:E().func.isRequired}).isRequired,hasPadding:E().bool},t(5687),E().bool.isRequired,E().func.isRequired,E().func,E().string;const ct="yoast-seo/ai-generator",dt="yoast-seo/editor",ut="google",pt="social",ht="twitter",mt="title",gt="description",yt="post",xt="term",ft={post:"title",term:"term_title"},wt=(0,l.mapValues)(ft,e=>`%%${e}%%`),vt={idle:"idle",loading:"loading",success:"success",error:"error"},bt="success",kt="error",St="abort",jt=({children:e})=>(0,N.jsx)("p",{className:"yst-mt-2",children:e});jt.propTypes={children:E().node.isRequired};const _t=()=>(0,_e.useSelect)(e=>{const s=e(dt);return{commonErrorsLink:s.selectLink("https://yoa.st/ai-common-errors"),supportLink:s.selectAdminLink("?page=wpseo_page_support")}},[]),Ct=(0,d.__)("Something went wrong","wordpress-seo"),Rt=({linkStoreName:e=dt})=>{const s=(0,_e.useSelect)(s=>s(e).selectLink("https://yoa.st/ai-common-errors"),[e]),t=(0,_e.useSelect)(s=>s(e).selectAdminLink("?page=wpseo_page_support"),[e]);return(0,N.jsx)(jt,{children:Oe((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ | |
| 197 | +(0,d.__)("Please try again later. If this issue persists, you can learn more about possible reasons for this error on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,N.jsx)(Ks,{variant:"error",href:s}),a2:(0,N.jsx)(Ks,{variant:"error",href:t})})})};Rt.propTypes={linkStoreName:E().string};const Et=({linkStoreName:e=dt,className:s=""})=>(0,N.jsxs)(X.Alert,{variant:"error",className:s,children:[(0,N.jsx)("span",{className:"yst-block yst-font-medium",children:Ct}),(0,N.jsx)(Rt,{linkStoreName:e})]});Et.propTypes={linkStoreName:E().string,className:E().string};const It=(0,d.__)("Not enough content","wordpress-seo"),Lt=()=>{const{commonErrorsLink:e,supportLink:s}=_t();return(0,N.jsx)(jt,{children:Oe((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ | |
| 198 | +(0,d.__)("Please add more content to ensure a valuable AI suggestion. Learn more on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,N.jsx)(Ks,{variant:"error",href:e}),a2:(0,N.jsx)(Ks,{variant:"error",href:s})})})},Tt=()=>(0,N.jsxs)(X.Alert,{variant:"error",children:[(0,N.jsx)("span",{className:"yst-block yst-font-medium",children:It}),(0,N.jsx)(Lt,{})]}),Nt=(0,d.__)("SEO analysis required","wordpress-seo"),Mt=()=>{const e=(0,_e.useSelect)(e=>e(dt).selectAdminLink("?page=wpseo_page_settings#/site-features#card-wpseo-keyword_analysis_active"),[]);return(0,N.jsx)(jt,{children:Oe((0,d.sprintf)( | |
| 199 | +/** | |
| 200 | + * translators: | |
| 201 | + * %1$s expands to Yoast SEO. | |
| 202 | + * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page. | |
| 203 | + * %4$s expands to Yoast AI. | |
| 204 | + */ | |
| 205 | +/** | |
| 206 | + * translators: | |
| 207 | + * %1$s expands to Yoast SEO. | |
| 208 | + * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page. | |
| 209 | + * %4$s expands to Yoast AI. | |
| 210 | + */ | |
| 211 | +(0,d.__)("%4$s requires the SEO analysis to be enabled. To enable it, please navigate to %2$sSite features%3$s in %1$s, turn on the SEO analysis, and click 'Save changes'. If it's disabled in your WordPress user profile, access your profile and enable it there. Please contact your administrator if you don't have access to these settings.","wordpress-seo"),"Yoast SEO","<a>","</a>","Yoast AI"),{a:(0,N.jsx)(Ks,{variant:"error",href:e})})})},Pt=()=>{const e=(0,j.useCallback)(()=>{window.location.reload()},[]),{onClose:s}=(0,X.useModalContext)();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(X.Alert,{variant:"error",children:[(0,N.jsx)("span",{className:"yst-block yst-font-medium",children:Nt}),(0,N.jsx)(Mt,{})]}),(0,N.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,N.jsx)(X.Button,{variant:"secondary",onClick:s,children:(0,d.__)("Close","wordpress-seo")}),(0,N.jsx)(X.Button,{className:"yst-revoke-button",variant:"primary",onClick:e,children:(0,d.__)("Refresh page","wordpress-seo")})]})]})},At=(0,d.__)("You've reached the Yoast AI rate limit","wordpress-seo"),Ot=()=>{const e=(0,_e.useSelect)(e=>e(dt).selectLink("https://yoa.st/ai-generator-rate-limit-help"),[]);return(0,N.jsx)(jt,{children:Oe((0,d.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ | |
| 212 | +(0,d.__)("You might have reached your Yoast AI rate limit for a specific time frame or your sparks limit for this month. If you have reached your rate limit, please reduce the frequency of your requests to continue using Yoast AI features. Our %1$shelp article%2$s provides guidance on effectively planning and pacing your requests for an optimized workflow.","wordpress-seo"),"<a>","</a>"),{a:(0,N.jsx)(Ks,{variant:"error",href:e})})})},Ft=()=>(0,N.jsxs)(X.Alert,{variant:"error",children:[(0,N.jsx)("span",{className:"yst-block yst-font-medium",children:At}),(0,N.jsx)(Ot,{})]}),qt=window.wp.apiFetch;var $t=t.n(qt);const Bt=(0,d.__)("Subscription required","wordpress-seo"),Ut=({invalidSubscriptions:e=[]})=>{const{newYoastWooLink:s,activateYoastWooLink:t,newPremiumLink:r,activatePremiumLink:o}=(0,_e.useSelect)(e=>{const s=e(dt);return{newYoastWooLink:s.selectLink("https://yoa.st/ai-generator-new-yoast-woocommerce"),activateYoastWooLink:s.selectLink("https://yoa.st/ai-generator-activate-yoast-woocommerce"),newPremiumLink:s.selectLink("https://yoa.st/ai-generator-new-premium"),activatePremiumLink:s.selectLink("https://yoa.st/ai-generator-activate-premium")}},[]);let i,n,a;return e.includes("Yoast WooCommerce SEO")?(i="Yoast WooCommerce SEO",n=t,a=s):e.includes("Yoast SEO Premium")&&(i="Yoast SEO Premium",n=o,a=r),i?(0,N.jsx)(jt,{children:Oe((0,d.sprintf)( | |
| 213 | +/** | |
| 214 | + * translators: | |
| 215 | + * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. | |
| 216 | + * %2$s expands to MyYoast. | |
| 217 | + * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription. | |
| 218 | + * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription. | |
| 219 | + **/ | |
| 220 | +/** | |
| 221 | + * translators: | |
| 222 | + * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. | |
| 223 | + * %2$s expands to MyYoast. | |
| 224 | + * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription. | |
| 225 | + * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription. | |
| 226 | + **/ | |
| 227 | +(0,d.__)("To access this feature, you need an active %1$s subscription. Please %3$sactivate your subscription in %2$s%4$s or %5$sget a new %1$s subscription%6$s. Afterward, refresh this page. It may take up to 30 seconds for the feature to function correctly.","wordpress-seo"),i,"MyYoast","<Activate>","</Activate>","<New>","</New>"),{Activate:(0,N.jsx)(Ks,{variant:"error",href:n}),New:(0,N.jsx)(Ks,{variant:"error",href:a})})}):(0,N.jsx)(jt,{children:Oe((0,d.sprintf)( | |
| 228 | +/** | |
| 229 | + * translators: | |
| 230 | + * %1$s expands to MyYoast. | |
| 231 | + * %2$s and %3$s expand to an opening and closing anchor tag, respectively, to activate your subscription. | |
| 232 | + **/ | |
| 233 | +/** | |
| 234 | + * translators: | |
| 235 | + * %1$s expands to MyYoast. | |
| 236 | + * %2$s and %3$s expand to an opening and closing anchor tag, respectively, to activate your subscription. | |
| 237 | + **/ | |
| 238 | +(0,d.__)("To access this feature, you need an active subscription. Please %2$sactivate your subscription in %1$s%3$s. Afterward, refresh this page. It may take up to 30 seconds for the feature to function correctly.","wordpress-seo"),"MyYoast","<Activate>","</Activate>"),{Activate:(0,N.jsx)(Ks,{variant:"error",href:o})})})};Ut.propTypes={invalidSubscriptions:E().arrayOf(E().string)};const Wt=({invalidSubscriptions:e=[]})=>{const s=(0,_e.useSelect)(e=>e(ct).selectBustSubscriptionCacheEndpoint(),[]),{onClose:t}=(0,X.useModalContext)(),r=(0,j.useCallback)(async()=>{try{await $t()({path:s,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[]);return(0,N.jsxs)(j.Fragment,{children:[(0,N.jsxs)(X.Alert,{variant:"error",children:[(0,N.jsx)("span",{className:"yst-block yst-font-medium",children:Bt}),(0,N.jsx)(Ut,{invalidSubscriptions:e})]}),(0,N.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,N.jsx)(X.Button,{variant:"secondary",onClick:t,children:(0,d.__)("Close","wordpress-seo")}),(0,N.jsx)(X.Button,{variant:"primary",onClick:r,children:(0,d.__)("Refresh page","wordpress-seo")})]})]})};Wt.propTypes={invalidSubscriptions:E().arrayOf(E().string)};const Dt=(0,d.__)("Connection timeout","wordpress-seo"),Ht=()=>{const{commonErrorsLink:e,supportLink:s}=_t();return(0,N.jsx)(jt,{children:Oe((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ | |
| 239 | +(0,d.__)("It seems that a connection timeout has occurred. Please check your internet connection and try again later. Learn more on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,N.jsx)(Ks,{variant:"error",href:e}),a2:(0,N.jsx)(Ks,{variant:"error",href:s})})})},zt=()=>(0,N.jsxs)(X.Alert,{variant:"error",children:[(0,N.jsx)("span",{className:"yst-block yst-font-medium",children:Dt}),(0,N.jsx)(Ht,{})]}),Gt=(0,d.__)("Usage policy violation","wordpress-seo"),Vt=()=>{const e=(0,_e.useSelect)(e=>e(dt).selectAdminLink("?page=wpseo_page_support"),[]);return(0,N.jsx)(jt,{children:Oe((0,d.sprintf)(/* translators: %1$s, %2$s, %3$s, %4$s are anchor tags. %5$s expands to OpenAI. */ /* translators: %1$s, %2$s, %3$s, %4$s are anchor tags. %5$s expands to OpenAI. */ | |
| 240 | +(0,d.__)("Due to %5$s's strict ethical guidelines and %1$susage policies%2$s, we cannot generate suggestions for the content on this page. If you intend to use AI, kindly avoid the use of explicit, violent, copyrighted, or sexually explicit content. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>","OpenAI"),{a1:(0,N.jsx)(Ks,{variant:"error",href:"https://openai.com/policies/usage-policies"}),a2:(0,N.jsx)(Ks,{variant:"error",href:e})})})},Kt=()=>(0,N.jsxs)(X.Alert,{variant:"error",children:[(0,N.jsx)("span",{className:"yst-block yst-font-medium",children:Gt}),(0,N.jsx)(Vt,{})]}),Yt=(0,d.__)("Something went wrong","wordpress-seo"),Zt=({errorMessage:e=""})=>{const s=(0,_e.useSelect)(e=>e(dt).selectAdminLink("?page=wpseo_page_support"),[]);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(jt,{children:(0,d.sprintf)(/* translators: %s is the error response of the request. */ /* translators: %s is the error response of the request. */ | |
| 241 | +(0,d.__)("The request came back with the following error: '%s'.","wordpress-seo"),e)}),(0,N.jsx)(jt,{children:Oe((0,d.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ | |
| 242 | +(0,d.__)("Please try again later. If the issue persists, please %1$scontact our support team%2$s.","wordpress-seo"),"<a>","</a>"),{a:(0,N.jsx)(Ks,{variant:"error",href:s})})})]})};Zt.propTypes={errorMessage:E().string};const Qt=({errorMessage:e=""})=>(0,N.jsxs)(X.Alert,{variant:"error",children:[(0,N.jsx)("span",{className:"yst-block yst-font-medium",children:Yt}),(0,N.jsx)(Zt,{errorMessage:e})]});Qt.propTypes={errorMessage:E().string};const Xt=(0,d.__)("Something went wrong","wordpress-seo"),Jt=()=>{const e=(0,_e.useSelect)(e=>e(dt).selectAdminLink("plugins.php"),[]);return(0,N.jsx)(jt,{children:Oe((0,d.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. %2$s expands to an opening link tag. %3$s expands to a closing link tag. */ /* translators: %1$s expands to Yoast SEO Premium. %2$s expands to an opening link tag. %3$s expands to a closing link tag. */ | |
| 243 | +(0,d.__)("The version of %1$s is outdated. Please upgrade %1$s %2$shere%3$s!","wordpress-seo"),"Yoast SEO Premium","<a>","</a>"),{a:(0,N.jsx)(Ks,{variant:"error",href:e})})})},er=()=>(0,N.jsxs)(X.Alert,{variant:"error",children:[(0,N.jsx)("span",{className:"yst-block yst-font-medium",children:Xt}),(0,N.jsx)(Jt,{})]}),sr=({children:e})=>(0,N.jsx)(X.Modal.Description,{as:"div",className:"yst-mt-2 yst-text-sm yst-text-slate-500",children:e}),tr=({children:e})=>(0,N.jsx)("div",{className:"yst-mt-6 yst-flex yst-flex-row yst-justify-end yst-gap-3",children:e}),rr=({onClose:e,...s})=>(0,N.jsx)(X.Button,{variant:"secondary",onClick:e,...s,children:(0,d.__)("Close","wordpress-seo")}),or=({isOpen:e,title:s,onClose:t=l.noop,children:r})=>{const o=(0,X.useSvgAria)();return(0,N.jsx)(X.Modal,{isOpen:e,onClose:t,children:(0,N.jsx)(X.Modal.Panel,{className:"yst-max-w-lg",closeButtonScreenReaderText:(0,d.__)("Dismiss","wordpress-seo"),children:(0,N.jsxs)("div",{className:"yst-flex yst-items-start yst-gap-4",children:[(0,N.jsx)("div",{className:"yst-flex-shrink-0 yst-flex yst-items-center yst-justify-center yst-h-10 yst-w-10 yst-rounded-full yst-bg-red-100",children:(0,N.jsx)(Zs(),{className:"yst-h-6 yst-w-6 yst-text-red-600",...o})}),(0,N.jsxs)("div",{className:"yst-text-start yst-flex-1 yst-min-w-0",children:[(0,N.jsx)(X.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900",children:s}),r]})]})})})},ir=({showActions:e=!1,onRetry:s,onClose:t})=>(0,N.jsxs)(tr,{children:[(0,N.jsx)(rr,{onClose:t}),e&&(0,N.jsx)(X.Button,{variant:"primary",onClick:s,children:(0,d.__)("Try again","wordpress-seo")})]});ir.propTypes={showActions:E().bool,onRetry:E().func.isRequired,onClose:E().func.isRequired};const nr=({isOpen:e=!0,showActions:s=!1,onRetry:t=l.noop,onClose:r=l.noop})=>(0,N.jsxs)(or,{isOpen:e,title:Ct,onClose:r,children:[(0,N.jsx)(sr,{children:(0,N.jsx)(Rt,{})}),(0,N.jsx)(ir,{showActions:s,onRetry:t,onClose:r})]});nr.propTypes={isOpen:E().bool,showActions:E().bool,onRetry:E().func,onClose:E().func};const ar=({isOpen:e=!0,showActions:s=!1,onRetry:t=l.noop,onClose:r=l.noop})=>(0,N.jsxs)(or,{isOpen:e,title:Dt,onClose:r,children:[(0,N.jsx)(sr,{children:(0,N.jsx)(Ht,{})}),(0,N.jsx)(ir,{showActions:s,onRetry:t,onClose:r})]});ar.propTypes={isOpen:E().bool,showActions:E().bool,onRetry:E().func,onClose:E().func};const lr=({errorMessage:e="",isOpen:s=!0,showActions:t=!1,onRetry:r=l.noop,onClose:o=l.noop})=>(0,N.jsxs)(or,{isOpen:s,title:Yt,onClose:o,children:[(0,N.jsx)(sr,{children:(0,N.jsx)(Zt,{errorMessage:e})}),(0,N.jsx)(ir,{showActions:t,onRetry:r,onClose:o})]});lr.propTypes={errorMessage:E().string,isOpen:E().bool,showActions:E().bool,onRetry:E().func,onClose:E().func};const cr=({isOpen:e=!0,onClose:s=l.noop})=>(0,N.jsxs)(or,{isOpen:e,title:It,onClose:s,children:[(0,N.jsx)(sr,{children:(0,N.jsx)(Lt,{})}),(0,N.jsx)(tr,{children:(0,N.jsx)(rr,{onClose:s})})]});cr.propTypes={isOpen:E().bool,onClose:E().func};const dr=({isOpen:e=!0,onClose:s=l.noop})=>(0,N.jsxs)(or,{isOpen:e,title:Gt,onClose:s,children:[(0,N.jsx)(sr,{children:(0,N.jsx)(Vt,{})}),(0,N.jsx)(tr,{children:(0,N.jsx)(rr,{onClose:s})})]});dr.propTypes={isOpen:E().bool,onClose:E().func};const ur=({isOpen:e=!0,onClose:s=l.noop})=>(0,N.jsxs)(or,{isOpen:e,title:At,onClose:s,children:[(0,N.jsx)(sr,{children:(0,N.jsx)(Ot,{})}),(0,N.jsx)(tr,{children:(0,N.jsx)(rr,{onClose:s})})]});ur.propTypes={isOpen:E().bool,onClose:E().func};const pr=({isOpen:e=!0,onClose:s=l.noop})=>(0,N.jsxs)(or,{isOpen:e,title:Xt,onClose:s,children:[(0,N.jsx)(sr,{children:(0,N.jsx)(Jt,{})}),(0,N.jsx)(tr,{children:(0,N.jsx)(rr,{onClose:s})})]});pr.propTypes={isOpen:E().bool,onClose:E().func};const hr=({invalidSubscriptions:e=[],isOpen:s=!0,onClose:t=l.noop})=>{const r=(0,_e.useSelect)(e=>e(ct).selectBustSubscriptionCacheEndpoint(),[]),o=(0,j.useCallback)(async()=>{try{await $t()({path:r,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[r]);return(0,N.jsxs)(or,{isOpen:s,title:Bt,onClose:t,children:[(0,N.jsx)(sr,{children:(0,N.jsx)(Ut,{invalidSubscriptions:e})}),(0,N.jsxs)(tr,{children:[(0,N.jsx)(rr,{onClose:t}),(0,N.jsx)(X.Button,{variant:"primary",onClick:o,children:(0,d.__)("Refresh page","wordpress-seo")})]})]})};hr.propTypes={invalidSubscriptions:E().arrayOf(E().string),isOpen:E().bool,onClose:E().func};const mr=({isOpen:e=!0,onClose:s=l.noop})=>{const t=(0,j.useCallback)(()=>window.location.reload(),[]);return(0,N.jsxs)(or,{isOpen:e,title:Nt,onClose:s,children:[(0,N.jsx)(sr,{children:(0,N.jsx)(Mt,{})}),(0,N.jsxs)(tr,{children:[(0,N.jsx)(rr,{onClose:s}),(0,N.jsx)(X.Button,{variant:"primary",onClick:t,children:(0,d.__)("Refresh page","wordpress-seo")})]})]})};mr.propTypes={isOpen:E().bool,onClose:E().func};const gr=(0,d.__)("Yoast AI cannot reach your site","wordpress-seo"),yr=()=>{const{commonErrorsLink:e,supportLink:s}=_t();return(0,N.jsx)(jt,{children:Oe((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ | |
| 244 | +(0,d.__)("To use this feature, your site must be publicly accessible. This applies to both test sites and instances where your REST API is password-protected. Please ensure your site is accessible to the public and try again. Learn more on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,N.jsx)(Ks,{variant:"error",href:e}),a2:(0,N.jsx)(Ks,{variant:"error",href:s})})})},xr=({learnMoreUrl:e=""})=>(0,N.jsx)(jt,{children:Oe((0,d.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ | |
| 245 | +(0,d.__)("%1$sLearn more about connecting with MyYoast.%2$s","wordpress-seo"),"<a>","</a>"),{a:(0,N.jsx)(Ks,{variant:"error",href:e})})});xr.propTypes={learnMoreUrl:E().string};const fr=()=>{const e=(0,X.useSvgAria)(),{commonErrorsLink:s,supportLink:t}=(0,_e.useSelect)(e=>{const s=e(dt);return{commonErrorsLink:s.selectLink("https://yoa.st/ai-common-errors"),supportLink:s.selectAdminLink("?page=wpseo_page_support")}},[]);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(sr,{children:(0,N.jsx)(jt,{children:(0,d.__)("This feature requires a publicly accessible site. Check that your site (including any password-protected REST APIs or test environments) is visible to the public, then try again.","wordpress-seo")})}),(0,N.jsxs)(tr,{children:[(0,N.jsxs)(X.Button,{as:"a",href:t,target:"_blank",rel:"noopener noreferrer",variant:"secondary",children:[(0,d.__)("Still need help?","wordpress-seo"),(0,N.jsx)(Ls(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 yst-text-slate-400 rtl:yst-rotate-[270deg]",...e}),(0,N.jsx)("span",{className:"yst-sr-only",children:(0,d.__)("(Opens in a new browser tab)","wordpress-seo")})]}),(0,N.jsxs)(X.Button,{as:"a",href:s,target:"_blank",rel:"noopener noreferrer",variant:"primary",children:[(0,d.__)("Learn more","wordpress-seo"),(0,N.jsx)(Ns(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 rtl:yst-rotate-180",...e})]})]})]})},wr=({isAvailable:e,canConnect:s,connectUrl:t,learnMoreUrl:r},o,i)=>e&&s&&t?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(sr,{children:[(0,N.jsx)(jt,{children:(0,d.__)("This feature requires a publicly accessible site. Connect to MyYoast to use Yoast AI even when your site is offline, behind a firewall, or with the REST API disabled.","wordpress-seo")}),(0,N.jsx)(xr,{learnMoreUrl:r})]}),(0,N.jsxs)(tr,{children:[(0,N.jsx)(rr,{onClose:o}),(0,N.jsxs)(X.Button,{as:"a",href:t,target:"_blank",rel:"noopener noreferrer",variant:"primary",children:[(0,d.__)("Connect to MyYoast","wordpress-seo"),(0,N.jsx)(Ls(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 rtl:yst-rotate-[270deg]",...i}),(0,N.jsx)("span",{className:"yst-sr-only",children:(0,d.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]}):e&&!s?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(sr,{children:[(0,N.jsx)(jt,{children:(0,d.__)("Your site isn't publicly accessible. Ask your site administrator to connect to MyYoast. They can find it on the Integrations page in Yoast SEO. This allows Yoast AI to work even when your site is offline, behind a firewall, or with the REST API disabled.","wordpress-seo")}),(0,N.jsx)(xr,{learnMoreUrl:r})]}),(0,N.jsx)(tr,{children:(0,N.jsx)(rr,{onClose:o})})]}):(0,N.jsx)(fr,{}),vr=({isOpen:e=!0,onClose:s=l.noop})=>{const t=(0,X.useSvgAria)(),r=(0,_e.useSelect)(e=>e(ct).selectMyyoastConnection(),[]);return(0,N.jsx)(or,{isOpen:e,title:gr,onClose:s,children:wr(r,s,t)})};vr.propTypes={isOpen:E().bool,onClose:E().func};const br=({onGiveConsent:e,learnMoreLink:s,privacyPolicyLink:t,termsOfServiceLink:r,imageLink:o,linkStoreName:i})=>{const{onClose:n,initialFocus:a}=(0,X.useModalContext)(),[l,c]=(0,X.useToggleState)(!1),[u,p]=(0,j.useState)(!1),h=(0,j.useMemo)(()=>({src:o,width:"432",height:"244"}),[o]),m=Oe((0,d.sprintf)(/* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */ /* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */ | |
| 246 | +(0,d.__)("I approve the %1$sTerms of Service%2$s & %3$sPrivacy Policy%4$s of the Yoast AI service. This includes consenting to the collection and use of data to improve user experience.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,N.jsx)(Ks,{href:r}),a2:(0,N.jsx)(Ks,{href:t})}),[g,y]=(0,X.useToggleState)(!1),x=(0,j.useCallback)(async()=>{y();const s=await e();p(!1===s),y()},[e]);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:(0,N.jsx)("div",{className:"yst-relative yst-w-full",children:(0,N.jsx)("img",{className:"yst-w-full yst-h-auto yst-rounded-md yst-drop-shadow-md",alt:"",loading:"lazy",decoding:"async",...h})})}),(0,N.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,N.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,N.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:(0,d.sprintf)(/* translators: %s expands to Yoast AI. */ /* translators: %s expands to Yoast AI. */ | |
| 247 | +(0,d.__)("Grant consent for %s","wordpress-seo"),"Yoast AI")}),(0,N.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:Oe((0,d.sprintf)(/* translators: %1$s is a break tag; %2$s and %3$s are anchor tag; %4$s is the arrow icon. */ /* translators: %1$s is a break tag; %2$s and %3$s are anchor tag; %4$s is the arrow icon. */ | |
| 248 | +(0,d.__)("Enable AI-powered SEO! Use all Yoast AI features to boost your efficiency. Just give us the green light. %1$s%2$sLearn more%3$s%4$s","wordpress-seo"),"<br/>","<a>","<ArrowNarrowRightIcon />","</a>"),{a:(0,N.jsx)(Ks,{href:s,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,N.jsx)(Ns(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,N.jsx)("br",{})})})]}),(0,N.jsx)("div",{className:"yst-flex yst-w-full yst-mt-6",children:(0,N.jsx)("hr",{className:"yst-w-full yst-text-gray-200"})}),(0,N.jsxs)("div",{className:"yst-flex yst-items-start yst-mt-4",children:[(0,N.jsx)("input",{type:"checkbox",id:"yst-ai-consent-checkbox",name:"yst-ai-consent-checkbox",checked:l,value:l?"true":"false",onChange:c,className:"yst-checkbox__input",ref:a}),(0,N.jsx)("label",{htmlFor:"yst-ai-consent-checkbox",className:"yst-label yst-checkbox__label yst-text-xs yst-font-normal yst-text-slate-500",children:m})]}),u&&(0,N.jsx)(Et,{className:"yst-mt-3",linkStoreName:i}),(0,N.jsx)("div",{className:"yst-w-full yst-flex yst-mt-4",children:(0,N.jsxs)(X.Button,{as:"button",className:"yst-grow",size:"large",disabled:!l||u,onClick:x,children:[g&&!u&&(0,N.jsx)(X.Spinner,{className:"yst-me-2"}),(0,d.__)("Grant consent","wordpress-seo")]})}),(0,N.jsx)(X.Button,{as:"button",className:"yst-mt-4",variant:"tertiary",onClick:n,children:(0,d.__)("Close","wordpress-seo")})]})]})};br.propTypes={onGiveConsent:E().func.isRequired,learnMoreLink:E().string.isRequired,privacyPolicyLink:E().string.isRequired,termsOfServiceLink:E().string.isRequired,imageLink:E().string.isRequired,linkStoreName:E().string.isRequired};const kr={termsOfService:"https://yoa.st/ai-generator-terms-of-service",privacyPolicy:"https://yoa.st/ai-generator-privacy-policy",learnMore:"https://yoa.st/ai-generator-learn-more"},Sr=({storeName:e,onConsentGranted:s,linkStoreName:t,links:r={}})=>{const o=(0,j.useMemo)(()=>({...kr,...r}),[r]),{termsOfServiceLink:i,privacyPolicyLink:n,learnMoreLink:a,imageLink:l,endpoint:c}=(0,_e.useSelect)(s=>{const r=s(t),i=s(e);return{termsOfServiceLink:r.selectLink(o.termsOfService),privacyPolicyLink:r.selectLink(o.privacyPolicy),learnMoreLink:r.selectLink(o.learnMore),imageLink:r.selectImageLink("ai-consent.jpg"),endpoint:i.selectAiGeneratorConsentEndpoint()}},[t,e,o]),{storeAiGeneratorConsent:d}=(0,_e.useDispatch)(e),u=(0,j.useCallback)(async()=>{const e=await d(!0,c);return!1!==e&&s(),e},[d,s,c]);return(0,N.jsx)(br,{termsOfServiceLink:i,privacyPolicyLink:n,learnMoreLink:a,imageLink:l,onGiveConsent:u,linkStoreName:t})};Sr.propTypes={storeName:E().string.isRequired,onConsentGranted:E().func.isRequired,linkStoreName:E().string.isRequired,links:E().shape({termsOfService:E().string,privacyPolicy:E().string,learnMore:E().string})};const jr=({errorCode:e,errorIdentifier:s="",isOpen:t=!0,invalidSubscriptions:r=[],showActions:o=!1,onRetry:i=l.noop,errorMessage:n="",onClose:a=l.noop})=>{if("SEO_ANALYSIS_INACTIVE"===s)return(0,N.jsx)(mr,{isOpen:t,onClose:a});if(402===e||429===e&&"USAGE_LIMIT_REACHED"===s)return(0,N.jsx)(hr,{isOpen:t,invalidSubscriptions:r,onClose:a});switch(e){case 400:switch(s){case"AI_CONTENT_FILTER":return(0,N.jsx)(dr,{isOpen:t,onClose:a});case"NOT_ENOUGH_CONTENT":return(0,N.jsx)(cr,{isOpen:t,onClose:a});case"SITE_UNREACHABLE":return(0,N.jsx)(vr,{isOpen:t,onClose:a});case"WP_HTTP_REQUEST_ERROR":return(0,N.jsx)(lr,{isOpen:t,errorMessage:n,showActions:o,onRetry:i,onClose:a});default:return(0,N.jsx)(nr,{isOpen:t,showActions:o,onRetry:i,onClose:a})}case 408:return(0,N.jsx)(ar,{isOpen:t,showActions:o,onRetry:i,onClose:a});case 429:return(0,N.jsx)(ur,{isOpen:t,onClose:a});case 410:return(0,N.jsx)(pr,{isOpen:t,onClose:a});default:return(0,N.jsx)(nr,{isOpen:t,showActions:o,onRetry:i,onClose:a})}};jr.propTypes={errorCode:E().number.isRequired,errorIdentifier:E().string,isOpen:E().bool,invalidSubscriptions:E().arrayOf(E().string),showActions:E().bool,onRetry:E().func,errorMessage:E().string,onClose:E().func};var _r=t(2863),Cr=t.n(_r);const Rr=window.yoast.aiFrontend,Er=["_formal","_informal","_ao90"],Ir=e=>{for(const s of Er)if(e.endsWith(s))return e.slice(0,-s.length);return e};let Lr,Tr=!1;const Nr=async({endpoint:e,data:s})=>{let t;const r=1e3*(0,l.get)(window,"wpseoAiGenerator.requestTimeout",30);try{Lr&&Lr.abort(),Lr=new AbortController,Tr=!1,t=setTimeout(()=>{Tr=!0,Lr.abort()},r);const o=await $t()({path:e,method:"POST",data:s,parse:!1,signal:Lr.signal}),i=await o.json();return{status:bt,payload:i}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return Tr?{status:kt,payload:{message:"timeout",code:408}}:{status:St};const{message:s,missingLicenses:t,errorIdentifier:r}=await(async e=>{try{const s=e.body.getReader(),{value:t}=await s.read(),r=new TextDecoder("utf-8").decode(t);return console.error(r),JSON.parse(r)}catch(e){return{message:"Unknown"}}})(e);return{status:kt,payload:{message:s,code:e.status||500,missingLicenses:t,errorIdentifier:r}}}finally{clearTimeout(t)}},Mr="\\–\\-\\(\\)_\\[\\]’‘“”〝〞〟‟„\"'.?!:;,¿¡«»‹›—×+&۔؟،؛。。!‼?⁇⁉⁈‥…・ー、〃〄〆〇〈〉《》「」『』【】〒〓〔〕〖〗〘〙〚〛〜〝〞〟〠〶〼〽{}|~⦅⦆「」、[]・¥$%@&'()*/:;<>\\\<>";Mr.split(""),new RegExp("^["+Mr+"]+"),new RegExp("["+Mr+"]+$");const Pr=new RegExp("["+Mr+"#$%&*+/=@^`{|}~ -¿–-⁊ -₠-⃀]","g"),Ar=e=>{const s={...e};return""!==e.value||["title","excerpt","excerpt_only"].includes(e.name)||(s.value="%%"+e.name+"%%"),s.badge=`<badge>${e.label}</badge>`,s},Or={editType:mt,previewType:ut,postType:"post",contentType:yt},Fr=(0,j.createContext)(Or),qr=(Fr.Provider,()=>(0,j.useContext)(Fr)),$r=()=>(0,j.useContext)(n.LocationContext),Br=e=>{const s=(0,j.useRef)(null);return(0,j.useCallback)(t=>{(0,l.attempt)(()=>s.current&&s.current.disconnect()),null!==t&&(s.current=new ResizeObserver(s=>{(0,l.forEach)(s,s=>e(s))}),s.current.observe(t))},[e])},Ur=window.yoast.reduxJsToolkit,Wr=(0,Ur.createSlice)({name:"suggestions",initialState:{status:vt.loading,error:{code:200,message:""},entities:[],selected:""},reducers:{setLoading:e=>{e.status=vt.loading},setSuccess:(e,{payload:s})=>{e.status=vt.success,e.selected=s[0],e.entities.push(...s)},setError:(e,{payload:s})=>{e.status=vt.error,e.error=s},setSelected:(e,{payload:s})=>{e.selected=s}}}),Dr=e=>{switch(e){case pt:return"Facebook";case ht:return"Twitter";default:return"Google"}},Hr=window.yoast.searchMetadataPreviews,zr="usageCount",Gr="fetchUsageCount",Vr=`${Gr}/success`,Kr=`${Gr}/${Js}`,Yr={errorCode:null,errorIdentifier:null,errorMessage:null},Zr=(0,Ur.createSlice)({name:zr,initialState:{status:"idle",count:0,limit:10,endpoint:"",error:Yr},reducers:{addUsageCount:(e,{payload:s=1})=>{e.count+=s},setUsageCount:(e,{payload:s})=>{e.count=s},setUsageCountEndpoint:(e,{payload:s})=>{e.endpoint=s},setUsageCountLimit:(e,{payload:s})=>{e.limit=s}},extraReducers:e=>{e.addCase(`${Gr}/request`,e=>{e.status=et,e.error=Yr}),e.addCase(Vr,(e,{payload:s})=>{e.status="success",e.count=s.count,e.limit=s.limit,e.error=Yr}),e.addCase(`${Gr}/${Js}`,(e,{payload:s})=>{e.status=st,e.error={errorCode:502,...s}})}}),Qr=(Zr.getInitialState,{selectUsageCountStatus:e=>(0,l.get)(e,[zr,"status"],Zr.getInitialState()),selectUsageCount:e=>(0,l.get)(e,[zr,"count"],Zr.getInitialState().count),selectUsageCountLimit:e=>(0,l.get)(e,[zr,"limit"],Zr.getInitialState().limit),selectUsageCountEndpoint:e=>(0,l.get)(e,[zr,"endpoint"],Zr.getInitialState().endpoint),selectUsageCountError:e=>(0,l.get)(e,[zr,"error"],Zr.getInitialState().error)});Qr.selectUsageCountRemaining=(0,Ur.createSelector)([Qr.selectUsageCount,Qr.selectUsageCountLimit],(e,s)=>Math.max(s-e,0)),Qr.isUsageCountLimitReached=(0,Ur.createSelector)([Qr.selectUsageCount,Qr.selectUsageCountLimit,Qr.selectUsageCountError],(e,s,t)=>429===t.errorCode||e>=s),Zr.actions,Zr.reducer;const Xr=({onStartGenerating:e})=>(0,N.jsx)(Sr,{storeName:ct,linkStoreName:dt,onConsentGranted:e});Xr.propTypes={onStartGenerating:E().func.isRequired};var Jr=t(7219),eo=t.n(Jr);const so=e=>{var s,t;const r=null===(s=(0,_e.useDispatch)("core/edit-post"))||void 0===s?void 0:s.openGeneralSidebar,o=null===(t=(0,_e.useDispatch)("core/editor"))||void 0===t?void 0:t.closePublishSidebar,{openEditorModal:i}=(0,_e.useDispatch)("yoast-seo/editor");return(0,j.useCallback)(()=>{o(),r("yoast-seo/seo-sidebar"),e&&i("yoast-search-appearance-modal")},[o,r,i])},to=/(?<start><\/badge>|^(?!<badge>))(?<wrap>[\s\S]+?)(?<end><badge>|$)/g,ro=({total:e,current:s,onNavigate:t,disabled:r=!1,...o})=>(0,N.jsxs)("div",{className:"yst-flex yst-justify-between yst-gap-x-2 yst-items-start",children:[(0,N.jsx)("p",{className:"yst-text-slate-500 yst-text-xxs yst-mt-1",children:(0,d.__)("Text generated by AI may be offensive or inaccurate.","wordpress-seo")}),e>1&&(0,N.jsx)(X.Pagination,{className:"yst-shrink-0",current:s,total:e,onNavigate:t,disabled:r,variant:"text" | |
| 249 | +/* translators: Hidden accessibility text. */,screenReaderTextPrevious:(0,d.__)("Previous","wordpress-seo") | |
| 250 | +/* translators: Hidden accessibility text. */,screenReaderTextNext:(0,d.__)("Next","wordpress-seo"),...o})]}),oo=({height:e,onFatalError:s})=>{const[t,r]=(0,j.useState)(""),{onClose:o}=(0,X.useModalContext)(),{editType:i,previewType:n,contentType:a}=qr(),c=(()=>{const{editType:e,previewType:s}=qr();let t="SEO";switch(s){case pt:t="social";break;case ht:t="X"}switch(e){case mt:return(0,d.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */ | |
| 251 | +(0,d.__)("Generated %s titles","wordpress-seo"),t);case gt:return s===ut&&(t="meta"),(0,d.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */ | |
| 252 | +(0,d.__)("Generated %s descriptions","wordpress-seo"),t)}})(),p=(()=>{const{editType:e,previewType:s}=qr();let t="SEO";switch(s){case pt:t="social";break;case ht:t="X"}switch(e){case mt:return(0,d.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */ | |
| 253 | +(0,d.__)("Apply %s title","wordpress-seo"),t);case gt:return s===ut&&(t="meta"),(0,d.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */ | |
| 254 | +(0,d.__)("Apply %s description","wordpress-seo"),t)}})(),h=$r(),{suggestions:m,fetchSuggestions:g,setSelectedSuggestion:y}=(()=>{const[e,s]=(0,j.useReducer)(Wr.reducer,Wr.getInitialState()),{editType:t,previewType:r,postType:o,contentType:i}=qr(),n=(0,_e.useSelect)(e=>e(ct).selectPromptContent(),[]),a=(0,_e.useSelect)(e=>e(ct).selectGetSuggestionsEndpoint(),[]),{contentLocale:l,focusKeyphrase:c,isWooCommerceActive:d,isGutenberg:p,isElementor:h}=(0,_e.useSelect)(e=>({contentLocale:e(dt).getContentLocale(),focusKeyphrase:e(dt).getFocusKeyphrase(),isWooCommerceActive:e(dt).getIsWooCommerceActive(),isGutenberg:e(dt).getIsBlockEditor(),isElementor:e(dt).getIsElementorEditor()}),[]);let m,g=u.languageProcessing.helpers.processExactMatchRequest(c).keyphrase;g.length>191&&(g=g.slice(0,191)),m=h?"elementor":p?"gutenberg":"classic";const y=((e,s,t,r)=>{const o=e===gt?"meta-description":"seo-title";let i=((e,s)=>{if(e)switch(s){case"product":return"product-";case"product_cat":case"product_tag":return"product-taxonomy-"}return""})(s,t);return i&&s||r!==xt||(i="taxonomy-"),`${i}${o}`})(t,d,o,i);return{suggestions:e,fetchSuggestions:(0,j.useCallback)(async(e=!0)=>{s(Wr.actions.setLoading());const{status:t,payload:o}=await Nr({endpoint:a,canAbort:e,data:{type:y,prompt_content:n,focus_keyphrase:g,platform:Dr(r),language:Ir(l).replace("_","-"),editor:m}});switch(t){case St:break;case kt:s(Wr.actions.setError(o));break;case bt:s(Wr.actions.setSuccess(o))}return t},[s]),setSelectedSuggestion:(0,j.useCallback)(e=>s(Wr.actions.setSelected(e)),[s])}})(),x=(()=>{const{previewType:e}=qr();switch(e){case pt:return go;case ht:return wi;default:return co}})(),{addAppliedSuggestion:f,addUsageCount:w}=(0,_e.useDispatch)(ct),{isUsageCountLimitReached:v,isWooProductEntity:b,hasValidPremiumSubscription:k,hasValidWooSubscription:S}=(0,_e.useSelect)(e=>{const s=e(ct),t=e(dt);return{isUsageCountLimitReached:s.isUsageCountLimitReached(),isPremium:t.getIsPremium(),isWooProductEntity:t.getIsWooProductEntity(),isWooSeoActive:t.getIsWooSeoActive(),hasValidPremiumSubscription:s.selectPremiumSubscription(),hasValidWooSubscription:s.selectWooCommerceSubscription()}},[]),_=(0,j.useMemo)(()=>m.status===vt.loading||!(S||!v||!b)||!(k||!v),[k,v,m.status,b,S]),C=(0,X.usePrevious)(e),R=m.status===vt.success?e:C,{bottom:E}={bottom:`calc( (${R+"px"} - 100vh) / 2 + 32px )`},[I,L]=(0,j.useState)(!1),T=(0,j.useCallback)(e=>{L(e.target.offsetHeight!==e.target.scrollHeight)},[L]),M=Br(T),P=(()=>{const{editType:e,previewType:s,contentType:t}=qr(),r=(()=>{const{previewType:e}=qr();return(0,j.useMemo)(()=>{switch(e){case ut:return()=>(0,_e.select)(dt).getSnippetEditorData().title;case pt:return(0,_e.select)(dt).getFacebookTitleOrFallback;case ht:return(0,_e.select)(dt).getTwitterTitleOrFallback;default:return(0,l.constant)("")}},[e])})(),o=(0,_e.useSelect)(t=>t(ct).selectAppliedSuggestionFor({editType:e,previewType:s}),[e,s]);return(0,j.useMemo)(()=>{let s=r();return e===gt?s:(o&&(s=s.replace(o,wt[t])),((e,s)=>e.includes(wt[s])?e:wt[s])(s,t))},[e,r])})(),A=(()=>{const e=(()=>{const{previewType:e}=qr();return(0,j.useMemo)(()=>{switch(e){case ut:return()=>(0,_e.select)(dt).getSnippetEditorData().description;case pt:return(0,_e.select)(dt).getFacebookDescriptionOrFallback;case ht:return(0,_e.select)(dt).getTwitterDescriptionOrFallback;default:return(0,l.constant)("")}},[e])})();return(0,j.useMemo)(e,[e])})(),O=(()=>{const e=(0,_e.useSelect)(e=>e(dt).getReplaceVars(),[]),s=(0,j.useMemo)(()=>e.map(Ar),[e]);return(0,j.useCallback)((e,{key:t="value",overrides:r={},applyPluggable:o=!0,editType:i=mt,contentType:n=yt}={})=>{for(const o of s)e=e.replace(new RegExp("%%"+(0,l.escapeRegExp)(o.name)+"%%","g"),(0,l.get)(r,o.name,o[t]));return n===xt&&(e=e.replace(" Archives","")),o?((e,s=mt)=>{const t=js({title:"",description:"",[s]:u.languageProcessing.stripSpaces(e)});return(0,l.get)(t,s,e)})(e,i):e},[s])})(),F=(0,j.useMemo)(()=>i===mt?{[ft[a]]:m.selected}:{},[i,a,m.selected]),q=(0,j.useMemo)(()=>O(P,{overrides:F,contentType:a}),[O,P,i,a,m.selected]),$=(0,j.useMemo)(()=>O(P,{overrides:{...F,sep:"",sitename:""},contentType:a}),[O,P,i,a,m.selected]),B=(0,j.useMemo)(()=>i===gt?m.selected:O(A,{editType:gt}),[O,A,i,m.selected]),U=(0,j.useCallback)(e=>O(P,{overrides:{[ft[a]]:e},key:"badge",applyPluggable:!1,contentType:a}),[O,P,a]),{currentPage:W,setCurrentPage:D,isOnLastPage:H,totalPages:z,getItemsOnCurrentPage:G}=(({totalItems:e=0,perPage:s=5})=>{const[t,r]=(0,j.useState)(1),o=(0,j.useMemo)(()=>Math.ceil(e/s),[e,s]),i=(0,j.useMemo)(()=>t*s,[t,s]),n=(0,j.useMemo)(()=>i-s,[i,s]),a=(0,j.useMemo)(()=>1===t,[t]),c=(0,j.useMemo)(()=>t===o,[t,o]),d=(0,j.useCallback)(()=>{t>1&&r(t-1)},[t,r]),u=(0,j.useCallback)(()=>{t<o&&r(t+1)},[t,r,o]),p=(0,j.useCallback)(e=>(0,l.slice)(e,n,i),[n,i]);return{currentPage:t,setCurrentPage:r,totalPages:o,isOnFirstPage:a,isOnLastPage:c,previousPage:d,nextPage:u,firstOnPage:n,lastOnPage:i,getItemsOnCurrentPage:p}})({totalItems:m.status===vt.loading||m.status===vt.error?m.entities.length+5:m.entities.length,perPage:5}),V=(0,j.useMemo)(()=>(0,l.map)(G(m.entities),e=>{let s=e;return i===mt&&(s=U(e),s=s.replace(to,(e,s,t,r,o,i,{start:n,wrap:a,end:l})=>{const c=a.trim();return 0===c.length?`${n}${a}${l}`:`${n}<span>${c}</span>${l}`}),s=Oe(s,{badge:(0,N.jsx)(X.Badge,{className:"yst-me-2 last:yst-me-0",variant:"plain",children:" "}),span:(0,N.jsx)("span",{className:"yst-flex yst-items-center yst-me-2 last:yst-me-0"})})),{value:e,label:s}}),[m.entities,G,i,U]),K=(0,j.useMemo)(()=>m.status!==vt.error||m.status===vt.error&&!H,[m.status,H]),Y=(0,j.useMemo)(()=>m.status===vt.loading&&H,[m.status,H]),Z=(0,j.useMemo)(()=>m.status===vt.error&&H,[m.status,H]),Q=(0,j.useCallback)(()=>{_||(D(m.status===vt.error?z:z+1),g().then(e=>{e===bt&&w()}))},[g,m.status,z,D,y,v]),J=(()=>{const{editType:e}=qr();switch(e){case mt:return(()=>{const{previewType:e}=qr(),{updateData:s,setFacebookPreviewTitle:t,setTwitterPreviewTitle:r}=(0,_e.useDispatch)(dt);return(0,j.useMemo)(()=>{switch(e){case ut:return e=>s({title:e});case pt:return t;case ht:return r;default:return l.noop}},[e,s,t,r])})();case gt:return(()=>{const{previewType:e}=qr(),{updateData:s,setFacebookPreviewDescription:t,setTwitterPreviewDescription:r}=(0,_e.useDispatch)(dt);return(0,j.useMemo)(()=>{switch(e){case ut:return e=>s({description:e});case pt:return t;case ht:return r;default:return l.noop}},[e,s,t,r])})();default:return l.noop}})(),ee=so(!0),se=(0,j.useCallback)(()=>{const e=i===mt?P.replace(new RegExp(wt[a]+"( Archives)?"),m.selected):m.selected;J(e),f({editType:i,previewType:n,suggestion:m.selected}),o(),"pre-publish"===h&&ee()},[J,i,n,m.selected,P,o,f,ee,h]);((e,s=[])=>{const t=(0,j.useRef)(!1);(0,j.useEffect)(()=>{t.current||(t.current=!0,e().finally(()=>{t.current=!1}))},[e,s])})(()=>""===t?g().then(e=>{r(e),e===bt&&w()}):Promise.resolve(),[t,w,g]);const te=t===kt||m.status===vt.error&&402===m.error.code;return(0,j.useEffect)(()=>{var e,t,r,o,i,n,a,l;te&&s({errorCode:null!==(e=null===(t=m.error)||void 0===t?void 0:t.code)&&void 0!==e?e:0,errorIdentifier:null!==(r=null===(o=m.error)||void 0===o?void 0:o.errorIdentifier)&&void 0!==r?r:"",invalidSubscriptions:null!==(i=null===(n=m.error)||void 0===n?void 0:n.missingLicenses)&&void 0!==i?i:[],errorMessage:null!==(a=null===(l=m.error)||void 0===l?void 0:l.message)&&void 0!==a?a:""})},[te,m.error,s]),te?null:(0,N.jsxs)(j.Fragment,{children:[(0,N.jsxs)(X.Modal.Container.Content,{ref:M,className:"yst-flex yst-flex-col yst-py-6 yst-space-y-2",children:[(0,N.jsx)(x,{title:q,description:B,status:m.status,titleForLength:$,showPreviewSkeleton:""===t,showLengthProgress:!Y}),K&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"yst-flex yst-space-y-4",children:[(0,N.jsx)(X.Label,{as:"span",className:"yst-flex-grow yst-cursor-default yst-mt-auto",children:c}),(0,N.jsx)(X.Button,{variant:"ai-secondary",size:"small",onClick:m.status===vt.loading?l.noop:Q,isLoading:m.status===vt.loading,disabled:_,children:(0,d.__)("Generate 5 more","wordpress-seo")})]}),Y?(0,N.jsx)(yi,{idSuffix:h,suggestionClassNames:i===mt?[["yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-8/12"]]:void 0}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(mi,{idSuffix:h,suggestions:V,selected:m.selected,onChange:y}),(0,N.jsx)(ro,{current:W,total:z,onNavigate:D,disabled:m.status===vt.loading||Z})]})]}),Z&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"yst-mt-8"}),(0,N.jsx)(ui,{errorCode:m.error.code,errorIdentifier:m.error.errorIdentifier,invalidSubscriptions:m.error.missingLicenses,errorMessage:m.error.message}),(0,N.jsx)(ro,{current:W,total:z,onNavigate:D,disabled:m.status===vt.loading})]})]}),(0,N.jsxs)(X.Modal.Container.Footer,{children:[I&&(0,N.jsx)("div",{className:"yst-absolute yst-inset-x-0 yst--mt-10 yst-me-[calc(2.5rem-1px)] yst-h-10 yst-pointer-events-none yst-bg-gradient-to-t yst-from-slate-50"}),(0,N.jsx)("hr",{className:"yst-mb-6 yst--mx-6"}),(0,N.jsxs)("div",{className:"sm:yst-flex sm:yst-justify-end sm:yst-space-x-2 sm:rtl:yst-space-x-reverse",children:[(0,N.jsx)("div",{className:"yst-hidden sm:yst-inline",children:(0,N.jsx)(X.Button,{variant:"secondary",onClick:o,children:(0,d.__)("Close","wordpress-seo")})}),(0,N.jsx)("div",{className:"yst-block sm:yst-inline",children:(0,N.jsxs)(X.Button,{className:"yst-w-full sm:yst-w-auto",variant:"primary",onClick:se,disabled:""===m.selected||m.status===vt.loading||Z,children:[(0,N.jsx)(eo(),{className:"yst--ms-1 yst-me-1 yst-h-4 yst-w-4 yst-text-white"}),p]})}),(0,N.jsx)("div",{className:"yst-mt-3 sm:yst-hidden",children:(0,N.jsx)(X.Button,{variant:"secondary",onClick:o,className:"yst-w-full sm:yst-w-auto",children:(0,d.__)("Close","wordpress-seo")})})]})]}),(0,N.jsxs)(X.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{bottom:E},position:"bottom-left",children:[m.status!==vt.loading&&(0,N.jsx)(Ci,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all"}),(m.status===vt.success||m.status===vt.loading)&&(0,N.jsx)(fi,{})]})]})};oo.propTypes={height:E().number.isRequired,onFatalError:E().func.isRequired};const io=({onActivateFreeSparks:e})=>{const{premiumUpsellLink:s,wooUpsellLink:t,isWooCommerceActive:r,isProductPost:o,learnMoreLink:i,imageLink:n,wistiaEmbedPermissionValue:a,wistiaEmbedPermissionStatus:l,isUsageCountLimitReached:c,activateFreeSparksEndpoint:u}=(0,_e.useSelect)(e=>{const s=e(ct),t=e(dt);return{premiumUpsellLink:t.selectLink("https://yoa.st/ai-generator-upsell"),wooUpsellLink:t.selectLink("https://yoa.st/ai-generator-upsell-woo-seo"),isWooCommerceActive:t.getIsWooCommerceActive(),isProductPost:t.getIsProduct(),learnMoreLink:t.selectLink("https://yoa.st/ai-generator-learn-more"),imageLink:t.selectImageLink("ai-generator-preview.jpg"),wistiaEmbedPermissionValue:t.selectWistiaEmbedPermissionValue(),wistiaEmbedPermissionStatus:t.selectWistiaEmbedPermissionStatus(),isUsageCountLimitReached:s.isUsageCountLimitReached(),activateFreeSparksEndpoint:s.selectFreeSparksActiveEndpoint()}},[]),{onClose:p,initialFocus:h}=(0,X.useModalContext)(),{title:m,upsellLabel:g,upsellLink:y,ctbId:x,newToText:f}=(e=>{const{isWooProductEntity:s,isProductPost:t,hasValidWooSubscription:r}=(0,_e.useSelect)(e=>{const s=e(dt),t=e(ct);return{isWooProductEntity:s.getIsWooProductEntity(),isProductPost:s.getIsProduct(),hasValidWooSubscription:t.selectWooCommerceSubscription()}},[]);return(0,j.useMemo)(()=>{const o={upsellLink:e.premium,upsellLabel:(0,d.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */ | |
| 255 | +(0,d.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),newToText:"Yoast SEO Premium",ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",title:(0,d.__)("Use AI to generate your titles & descriptions!","wordpress-seo")};return s&&(t&&(o.title=(0,d.__)("Generate product titles & descriptions with AI!","wordpress-seo")),r||(o.newToText="Yoast WooCommerce SEO",o.upsellLabel=(0,d.sprintf)(/* translators: %1$s expands to Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast WooCommerce SEO. */ | |
| 256 | +(0,d.__)("Unlock with %1$s","wordpress-seo"),"Yoast WooCommerce SEO"),o.upsellLink=e.woo,o.ctbId="5b32250e-e6f0-44ae-ad74-3cefc8e427f9")),o},[s,t,e.premium,e.woo])})({premium:s,woo:t}),w=(0,j.useMemo)(()=>r&&o,[r,o]),v=(0,j.useMemo)(()=>({src:n,width:"432",height:"244"}),[n]),{setWistiaEmbedPermission:b}=(0,_e.useDispatch)(dt),{activateFreeSparks:k}=(0,_e.useDispatch)(ct),S=(0,j.useMemo)(()=>({value:a,status:l,set:b}),[a,l,b]),_=(0,j.useCallback)(()=>{k({endpoint:u}),e()},[k,u,p,e]),C={a:(0,N.jsx)(Ks,{href:i,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,N.jsx)(Ns(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"})};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:[(0,N.jsxs)("div",{className:"yst-relative yst-w-full",children:[(0,N.jsx)(it,{videoId:"vmrahpfjxp",thumbnail:v,wistiaEmbedPermission:S}),(0,N.jsx)(X.Badge,{className:"yst-absolute yst--top-2 yst-end-4",variant:"info",children:"Beta"})]}),(0,N.jsx)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center",children:(0,N.jsxs)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center",children:[(0,N.jsx)("span",{className:"yst-logo-icon"}),f]})})]}),(0,N.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,N.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,N.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:m}),(0,N.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:Oe(w?(0,d.sprintf)(/* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ /* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ | |
| 257 | +(0,d.__)("Let AI do some of the thinking for you and help you save time. Get high-quality suggestions for product titles and meta descriptions to make your content rank high and look good on social media. %1$sLearn more%2$s%3$s","wordpress-seo"),"<a>","<ArrowNarrowRightIcon />","</a>"):(0,d.sprintf)(/* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ /* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ | |
| 258 | +(0,d.__)("Let AI do some of the thinking for you and help you save time. Get high-quality suggestions for titles and meta descriptions to make your content rank high and look good on social media. %1$sLearn more%2$s%3$s","wordpress-seo"),"<a>","<ArrowNarrowRightIcon />","</a>"),C)})]}),c&&(0,N.jsx)(X.Alert,{className:"yst-my-4",children:(0,d.sprintf)(/* translators: %s is for Yoast SEO Premium. */ /* translators: %s is for Yoast SEO Premium. */ | |
| 259 | +(0,d.__)("Oh no! Its seems like you're out of free Sparks. Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),"Yoast SEO Premium")}),(0,N.jsxs)("div",{className:Ze()("yst-w-full yst-flex yst-flex-col",c?"yst-mt-0":"yst-mt-6"),children:[(0,N.jsxs)(X.Button,{as:"a",className:"yst-grow",size:"extra-large",variant:"upsell",href:y,target:"_blank",ref:h,"data-action":"load-nfd-ctb","data-ctb-id":x,children:[(0,N.jsx)(He(),{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5"}),g,(0,N.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */ | |
| 260 | +(0,d.__)("(Opens in a new browser tab)","wordpress-seo")})]}),!c&&(0,N.jsx)(X.Button,{variant:"ai-secondary",onClick:_,className:"yst-mt-2 yst-w-full yst-text-base yst-text-slate-800 yst-font-medium yst-h-11",children:(0,d.__)("Try for free","wordpress-seo")})]}),(0,N.jsx)(X.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:p,children:(0,d.__)("Close","wordpress-seo")})]})]})},no=({isOpen:e,onClose:s,closeButtonScreenReaderText:t,panelRef:r,title:o,aiModalHelperLink:i,children:n})=>{const a=(0,X.useSvgAria)();return(0,N.jsx)(X.Modal,{className:"yst-ai-modal",isOpen:e,onClose:s,children:(0,N.jsx)(X.Modal.Panel,{ref:r,className:"yst-max-w-3xl yst-relative",closeButtonScreenReaderText:t,children:(0,N.jsxs)(X.Modal.Container,{children:[(0,N.jsxs)(X.Modal.Container.Header,{children:[(0,N.jsxs)("div",{className:"yst-flex yst-items-center",children:[(0,N.jsx)("span",{className:"yst-logo-icon yst-h-5 yst-w-5"}),(0,N.jsx)(X.Modal.Title,{className:"yst-ms-3 yst-me-1.5",as:"h1",size:"2",children:o}),(0,N.jsx)(X.Link,{id:"ai-modal-learn-more",href:i,variant:"primary",className:"yst-no-underline yst-me-2",target:"_blank",rel:"noopener" | |
| 261 | +/* translators: Hidden accessibility text. */,"aria-label":(0,d.__)("Learn more about AI (Opens in a new browser tab)","wordpress-seo"),children:(0,N.jsx)(Cr(),{...a,className:"yst-w-4 yst-h-4 yst-text-slate-500 yst-shrink-0"})}),(0,N.jsx)(X.Badge,{variant:"info",children:(0,d.__)("Beta","wordpress-seo")})]}),(0,N.jsx)("hr",{className:"yst-mt-6 yst--mx-6"})]}),n]})})})},ao=({isOpen:e,onClose:s,closeButtonScreenReaderText:t,children:r})=>(0,N.jsx)(X.Modal,{className:"yst-introduction-modal",isOpen:e,onClose:s,children:(0,N.jsx)(X.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-rounded-3xl",closeButtonScreenReaderText:t,children:r})}),lo={inactive:"inactive",askConsent:"askConsent",upsell:"upsell",generate:"generate"};(({onUseAi:e})=>{const[s,t]=(0,j.useState)(lo.inactive),{editType:r,previewType:o}=qr(),i=$r(),n=(()=>{const{editType:e,previewType:s}=qr();switch(s){case pt:return e===gt?(0,d.__)("AI social description generator","wordpress-seo"):(0,d.__)("AI social title generator","wordpress-seo");case ht:return e===gt?(0,d.__)("AI X description generator","wordpress-seo"):(0,d.__)("AI X title generator","wordpress-seo");default:return e===gt?(0,d.__)("AI description generator","wordpress-seo"):(0,d.__)("AI title generator","wordpress-seo")}})(),{hasConsent:a,promptContentInitialized:l,currentSubscriptions:c,usageCountStatus:u,usageCount:p,usageCountLimit:h,usageCountEndpoint:m,hasValidPremiumSubscription:g,hasValidWooSubscription:y,focusKeyphrase:x,isPremium:f,isSeoAnalysisActive:w,aiModalHelperLink:v,isWooProductEntity:b,isFreeSparksActive:k,isWooSeoActive:S}=(0,_e.useSelect)(e=>{const s=e(ct),t=e(dt);return{hasConsent:s.selectHasAiGeneratorConsent(),promptContentInitialized:s.selectPromptContentInitialized(),currentSubscriptions:s.selectProductSubscriptions(),usageCountStatus:s.selectUsageCountStatus(),usageCount:s.selectUsageCount(),usageCountLimit:s.selectUsageCountLimit(),usageCountEndpoint:s.selectUsageCountEndpoint(),hasValidPremiumSubscription:s.selectPremiumSubscription(),hasValidWooSubscription:s.selectWooCommerceSubscription(),focusKeyphrase:t.getFocusKeyphrase(),isPremium:t.getIsPremium(),isWooSeoActive:t.getIsWooSeoActive(),isSeoAnalysisActive:t.getPreference("isKeywordAnalysisActive",!0),aiModalHelperLink:t.selectLink("https://yoa.st/ai-generator-help-button-modal"),isWooProductEntity:t.getIsWooProductEntity(),isFreeSparksActive:e(ct).selectIsFreeSparksActive()}},[]),{fetchUsageCount:_}=(0,_e.useDispatch)(ct),{closeEditorModal:C}=(0,_e.useDispatch)(dt),R=(0,d.__)("Close modal","wordpress-seo"),[E,I]=(0,j.useState)(!1),[L,T]=(0,j.useState)(0),M=(0,j.useCallback)(e=>T(e.borderBoxSize[0].blockSize),[T]),P=Br(M),[A,O]=(0,j.useState)(null),F=(0,j.useCallback)(({currentSubscriptions:e,isSeoAnalysisActive:s})=>{const t=(e=>{const s=(0,_e.select)(dt),t=[];return((e,s)=>(e.getIsPremium()||e.getIsWooProductEntity())&&!s.premiumSubscription)(s,e)&&t.push("Yoast SEO Premium"),((e,s)=>e.getIsWooProductEntity()&&e.getIsWooSeoActive()&&!s.wooCommerceSubscription)(s,e)&&t.push("Yoast WooCommerce SEO"),t})(e);return t.length>0?{errorCode:402,errorIdentifier:"",invalidSubscriptions:t,errorMessage:""}:s?(()=>{var e,s;const t=(0,_e.select)(ct);if(t.selectUsageCountStatus()!==st)return null;const r=t.selectUsageCountError();return{errorCode:r.errorCode,errorIdentifier:null!==(e=r.errorIdentifier)&&void 0!==e?e:"",invalidSubscriptions:[],errorMessage:null!==(s=r.errorMessage)&&void 0!==s?s:""}})():{errorCode:0,errorIdentifier:"SEO_ANALYSIS_INACTIVE",invalidSubscriptions:[],errorMessage:""}},[]),q=(0,j.useCallback)(()=>{t(lo.inactive)},[]),$=(0,j.useCallback)(()=>O(null),[]),B=(0,j.useCallback)(()=>{O(null),t(lo.generate)},[]),U=(0,j.useCallback)(()=>{O(F({currentSubscriptions:c,isSeoAnalysisActive:w})),t(lo.inactive)},[F,c,w]),W=(0,j.useCallback)(e=>{O(e),t(lo.inactive)},[]),D={onClose:q,closeButtonScreenReaderText:R},H=(0,j.useCallback)(()=>!(0===x.replace(Pr,"").trim().length),[x]),z=so(!1),G=(0,j.useCallback)(()=>{C(),"pre-publish"===i&&z(),setTimeout(()=>(e=>{const s=`focus-keyword-input-${["modal","pre-publish"].includes(e)?"sidebar":e}`;if("metabox"===e){const e=document.getElementById("wpseo-meta-tab-content");e&&e.click()}const t=document.getElementById(s);t&&t.focus()})(i),0)},[C,i,z]),V=(0,j.useCallback)(()=>b?y&&g:g,[g,y,b]),K=(0,j.useCallback)(async()=>{if(e(),!w)return void U();if(!H())return t(lo.inactive),void G();const s=V();if(!s&&f&&S&&b)return void U();if(!s&&f&&!b)return void U();if(!a&&(k||s))return void t(lo.askConsent);I(!0);const{type:r,payload:o}=await _({endpoint:m,isWooProductEntity:b}),i=429===(null==o?void 0:o.errorCode)&&!(null!=o&&o.errorIdentifier)&&0===(null==o?void 0:o.missingLicenses.length),n=429===(null==o?void 0:o.errorCode)&&"USAGE_LIMIT_REACHED"===(null==o?void 0:o.errorIdentifier)||o.count>=o.limit;I(!1),i?U():403!==(null==o?void 0:o.errorCode)||!k&&!s?r!==Kr||429===(null==o?void 0:o.errorCode)||403===(null==o?void 0:o.errorCode)?r===Kr&&429===(null==o?void 0:o.errorCode)&&s?U():!s&&!k||!s&&n?t(lo.upsell):(s&&a&&t(lo.generate),!s&&k&&!n&&a&&t(lo.generate)):U():t(lo.askConsent)},[e,f,k,a,w,H,G,U,m,_,S,b,E]),Y=(0,j.useCallback)(async()=>{const{type:e,payload:s}=await _({endpoint:m,isWooProductEntity:b}),r=429===(null==s?void 0:s.errorCode)||s.count>=s.limit,o=V();!r||o?e!==Kr?t(lo.generate):U():t(lo.upsell)},[t,U,m,_,V,b]),Z=(0,j.useCallback)(()=>{t(a?lo.generate:lo.askConsent)},[t,a]),Q=(0,j.useMemo)(()=>"google"===o?"title"===r?(0,d.__)("Generate SEO title","wordpress-seo"):(0,d.__)("Generate meta description","wordpress-seo"):"social"===o||"twitter"===o?"title"===r?(0,d.__)("Generate social title","wordpress-seo"):(0,d.__)("Generate social description","wordpress-seo"):void 0,[o,r]);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(X.Button,{type:"button",variant:"ai-secondary",size:"small",id:`yst-replacevar__use-ai-button__${r}__${i}`,onClick:K,disabled:u===et||!l,isLoading:E&&u===et,children:Q}),(0,N.jsxs)(ao,{...D,isOpen:[lo.askConsent,lo.upsell].includes(s),children:[s===lo.askConsent&&(0,N.jsx)(Xr,{onStartGenerating:Y}),s===lo.upsell&&(0,N.jsx)(io,{onActivateFreeSparks:Z})]}),(0,N.jsx)(no,{...D,isOpen:s===lo.generate,aiModalHelperLink:v,panelRef:P,title:n,children:s===lo.generate&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Rr.UsageCounter,{limit:h,requests:p,isSkeleton:!1,className:"yst-absolute yst-top-[-11px] yst-end-12 sm:yst-end-16",mentionBetaInTooltip:f,mentionResetInTooltip:f}),(0,N.jsx)(oo,{height:L,onFatalError:W})]})}),A&&(0,N.jsx)(jr,{isOpen:!0,errorCode:A.errorCode,errorIdentifier:A.errorIdentifier,invalidSubscriptions:A.invalidSubscriptions,errorMessage:A.errorMessage,showActions:!0,onRetry:B,onClose:$})]})}).propTypes={onUseAi:E().func.isRequired};const co=({title:e,description:s,status:t,titleForLength:r,showPreviewSkeleton:o,showLengthProgress:i})=>{const n=(0,_e.useSelect)(e=>e(dt).getSnippetEditorMode(),[]),[a,l]=(0,j.useState)(n),{editType:c}=qr(),u=$r(),p=(({editType:e,title:s,description:t})=>{const r=(0,_e.useSelect)(e=>e(dt).getDateFromSettings(),[]),o=(0,_e.useSelect)(e=>e(dt).getContentLocale(),[]),i=(0,_e.useSelect)(e=>e(dt).isCornerstoneContent(),[]),n=(0,_e.useSelect)(e=>e(dt).getIsTerm(),[]);return(0,j.useMemo)(()=>e===gt?(0,Hr.getDescriptionProgress)(t,r,i,n,o):(0,Hr.getTitleProgress)(s),[e,s,t,r,i,n,o])})({editType:c,title:r,description:s});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Hr.ModeSwitcher,{onChange:l,active:a,id:`yst-ai-google-preview-mode-switcher-${u}`,disabled:t===vt.loading}),o?(0,N.jsx)(ho,{}):(0,N.jsx)(po,{mode:a,title:e,description:s}),(0,N.jsxs)("div",{className:"yst-pt-4",children:[(0,N.jsx)(X.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:c===mt?(0,d.__)("SEO title width","wordpress-seo"):(0,d.__)("Meta description length","wordpress-seo")}),(0,N.jsx)(mo,{className:"yst-mt-2",progress:i?p.actual:0,min:0,max:p.max,score:p.score})]})]})};co.propTypes={title:E().string.isRequired,description:E().string.isRequired,status:E().oneOf(Object.keys(vt)).isRequired,titleForLength:E().string.isRequired,showPreviewSkeleton:E().bool.isRequired,showLengthProgress:E().bool.isRequired};const uo=/mobi/i,po=({mode:e,title:s,description:t})=>{var r,o;const i=(0,_e.useSelect)(e=>e(dt).getBaseUrlFromSettings(),[]),n=(0,_e.useSelect)(e=>e(dt).getSnippetEditorData().slug||"",[]),a=(0,_e.useSelect)(e=>e(dt).getDateFromSettings(),[]),c=(0,_e.useSelect)(e=>e(dt).getFocusKeyphrase(),[]),d=(0,_e.useSelect)(e=>e(dt).getSnippetEditorPreviewImageUrl(),[]),u=(0,_e.useSelect)(e=>e(dt).getSiteIconUrlFromSettings(),[]),p=(0,_e.useSelect)(e=>e(dt).getShoppingData(),[]),h=(0,_e.useSelect)(e=>e(dt).getSnippetEditorWordsToHighlight(),[]),m=(0,_e.useSelect)(e=>e(dt).getSiteName(),[]),g=(0,_e.useSelect)(e=>e(dt).getContentLocale(),[]),y=(0,j.useMemo)(()=>i+n,[i,n]),x=(0,j.useMemo)(()=>{var e,s;return uo.test(null===(e=window)||void 0===e||null===(s=e.navigator)||void 0===s?void 0:s.userAgent)},[null===(r=window)||void 0===r||null===(o=r.navigator)||void 0===o?void 0:o.userAgent]);return(0,N.jsx)("div",{className:`yst-ai-generator-preview-section ${e}${x?" yst-user-agent__mobile":""}`,children:(0,N.jsx)(Hr.SnippetPreview,{title:s,description:t,mode:e,url:y,keyword:c,date:a,faviconSrc:u,mobileImageSrc:d,wordsToHighlight:h,siteName:m,locale:g,shoppingData:p,onMouseUp:l.noop})})};po.propTypes={mode:E().oneOf(Object.keys({mobile:"mobile",desktop:"desktop"})).isRequired,title:E().string.isRequired,description:E().string.isRequired};const ho=()=>(0,N.jsxs)("div",{className:"yst-max-w-[400px] yst-py-4 yst-px-3 yst-border yst-rounded-lg yst-w-full yst-mx-auto",children:[(0,N.jsxs)("div",{className:"yst-flex yst-gap-x-3",children:[(0,N.jsx)(X.SkeletonLoader,{className:"yst-flex-shrink-0 yst-h-7 yst-w-7 yst-rounded-full"}),(0,N.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-full yst-gap-y-1",children:[(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-2.5 yst-w-10/12"})]})]}),(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-4 yst-w-full yst-mt-6 yst-mb-4"}),(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-3 yst-w-full"}),(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-3 yst-w-10/12 yst-mt-2.5"})]}),mo=({className:e="",progress:s,max:t,score:r})=>{const o=(0,j.useMemo)(()=>(e=>e>=7?"yst-score-good":e>=5?"yst-score-ok":"yst-score-bad")(r),[r]);return(0,N.jsx)(X.ProgressBar,{className:Ze()("yst-length-progress-bar",o,e),progress:s,min:0,max:t})};mo.propTypes={className:E().string,progress:E().number.isRequired,max:E().number.isRequired,score:E().number.isRequired};const go=({title:e,description:s,showPreviewSkeleton:t})=>(0,N.jsxs)("div",{children:[(0,N.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,N.jsx)(X.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,d.__)("Social preview","wordpress-seo")})}),t?(0,N.jsx)(li,{}):(0,N.jsx)(ai,{title:e,description:s})]});go.propTypes={title:E().string.isRequired,description:E().string.isRequired,showPreviewSkeleton:E().bool.isRequired};const yo=C().p` | |
| 262 | + color: #606770; | |
| 263 | + flex-shrink: 0; | |
| 264 | + font-size: 12px; | |
| 265 | + line-height: 16px; | |
| 266 | + overflow: hidden; | |
| 267 | + padding: 0; | |
| 268 | + text-overflow: ellipsis; | |
| 269 | + text-transform: uppercase; | |
| 270 | + white-space: nowrap; | |
| 271 | + margin: 0; | |
| 272 | + position: ${e=>"landscape"===e.mode?"relative":"static"}; | |
| 273 | +`,xo=e=>{const{siteUrl:s}=e;return(0,N.jsxs)($e.Fragment,{children:[(0,N.jsx)("span",{className:"screen-reader-text",children:s}),(0,N.jsx)(yo,{"aria-hidden":"true",children:(0,N.jsx)("span",{children:s})})]})};xo.propTypes={siteUrl:E().string.isRequired};const fo=xo,wo=C().img` | |
| 274 | + && { | |
| 275 | + max-width: ${e=>e.width}px; | |
| 276 | + height: ${e=>e.height}px; | |
| 277 | + position: absolute; | |
| 278 | + top: 50%; | |
| 279 | + left: 50%; | |
| 280 | + transform: translate(-50%, -50%); | |
| 281 | + max-width: none; | |
| 282 | + } | |
| 283 | +`,vo=C().img` | |
| 284 | + && { | |
| 285 | + height: 100%; | |
| 286 | + position: absolute; | |
| 287 | + width: 100%; | |
| 288 | + object-fit: cover; | |
| 289 | + } | |
| 290 | +`,bo=C().div` | |
| 291 | + padding-bottom: ${e=>e.aspectRatio}%; | |
| 292 | +`,ko=({imageProps:e,width:s,height:t,imageMode:r="landscape"})=>"landscape"===r?(0,N.jsx)(bo,{aspectRatio:e.aspectRatio,children:(0,N.jsx)(vo,{src:e.src,alt:e.alt})}):(0,N.jsx)(wo,{src:e.src,alt:e.alt,width:s,height:t,imageProperties:e});function So(e,s,t){return"landscape"===t?{widthRatio:s.width/e.landscapeWidth,heightRatio:s.height/e.landscapeHeight}:"portrait"===t?{widthRatio:s.width/e.portraitWidth,heightRatio:s.height/e.portraitHeight}:{widthRatio:s.width/e.squareWidth,heightRatio:s.height/e.squareHeight}}function jo(e,s){return s.widthRatio<=s.heightRatio?{width:Math.round(e.width/s.widthRatio),height:Math.round(e.height/s.widthRatio)}:{width:Math.round(e.width/s.heightRatio),height:Math.round(e.height/s.heightRatio)}}async function _o(e,s,t=!1){const r=await function(e){return new Promise((s,t)=>{const r=new Image;r.onload=()=>{s({width:r.width,height:r.height})},r.onerror=t,r.src=e})}(e);let o=t?"landscape":"square";"Facebook"===s&&(o=(0,de.determineFacebookImageMode)(r));const i=function(e){return"Twitter"===e?de.TWITTER_IMAGE_SIZES:de.FACEBOOK_IMAGE_SIZES}(s),n=function(e,s,t){return"square"===t&&s.width===s.height?{width:e.squareWidth,height:e.squareHeight}:jo(s,So(e,s,t))}(i,r,o);return{mode:o,height:n.height,width:n.width}}async function Co(e,s,t=!1){try{return{imageProperties:await _o(e,s,t),status:"loaded"}}catch(e){return{imageProperties:null,status:"errored"}}}ko.propTypes={imageProps:E().shape({src:E().string.isRequired,alt:E().string.isRequired,aspectRatio:E().number.isRequired}).isRequired,width:E().number.isRequired,height:E().number.isRequired,imageMode:E().string};const Ro=C().div` | |
| 293 | + position: relative; | |
| 294 | + ${e=>"landscape"===e.mode?`max-width: ${e.dimensions.width}`:`min-width: ${e.dimensions.width}; height: ${e.dimensions.height}`}; | |
| 295 | + overflow: hidden; | |
| 296 | + background-color: ${T.colors.$color_white}; | |
| 297 | +`,Eo=C().div` | |
| 298 | + box-sizing: border-box; | |
| 299 | + max-width: ${de.FACEBOOK_IMAGE_SIZES.landscapeWidth}px; | |
| 300 | + height: ${de.FACEBOOK_IMAGE_SIZES.landscapeHeight}px; | |
| 301 | + background-color: ${T.colors.$color_grey}; | |
| 302 | + border-style: dashed; | |
| 303 | + border-width: 1px; | |
| 304 | + // We're not using standard colors to increase contrast for accessibility. | |
| 305 | + color: #006DAC; | |
| 306 | + // We're not using standard colors to increase contrast for accessibility. | |
| 307 | + background-color: #f1f1f1; | |
| 308 | + display: flex; | |
| 309 | + justify-content: center; | |
| 310 | + align-items: center; | |
| 311 | + text-decoration: underline; | |
| 312 | + font-size: 14px; | |
| 313 | + cursor: pointer; | |
| 314 | +`;class Io extends $e.Component{constructor(e){super(e),this.state={imageProperties:null,status:"loading"},this.socialMedium="Facebook",this.handleFacebookImage=this.handleFacebookImage.bind(this),this.setState=this.setState.bind(this)}async handleFacebookImage(){try{const e=await Co(this.props.src,this.socialMedium);this.setState(e),this.props.onImageLoaded(e.imageProperties.mode||"landscape")}catch(e){this.setState(e),this.props.onImageLoaded("landscape")}}componentDidUpdate(e){e.src!==this.props.src&&this.handleFacebookImage()}componentDidMount(){this.handleFacebookImage()}retrieveContainerDimensions(e){switch(e){case"square":return{height:de.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:de.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:de.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:de.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:de.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:de.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){const{imageProperties:e,status:s}=this.state;if("loading"===s||""===this.props.src||"errored"===s)return(0,N.jsx)(Eo,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,d.__)("Select image","wordpress-seo")});const t=this.retrieveContainerDimensions(e.mode);return(0,N.jsx)(Ro,{mode:e.mode,dimensions:t,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick,children:(0,N.jsx)(ko,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:de.FACEBOOK_IMAGE_SIZES.aspectRatio},width:e.width,height:e.height,imageMode:e.mode})})}}Io.propTypes={src:E().string,alt:E().string,onImageLoaded:E().func,onImageClick:E().func,onMouseEnter:E().func,onMouseLeave:E().func},Io.defaultProps={src:"",alt:"",onImageLoaded:l.noop,onImageClick:l.noop,onMouseEnter:l.noop,onMouseLeave:l.noop};const Lo=Io,To=C().span` | |
| 315 | + line-height: ${20}px; | |
| 316 | + min-height : ${20}px; | |
| 317 | + color: #1d2129; | |
| 318 | + font-weight: 600; | |
| 319 | + overflow: hidden; | |
| 320 | + font-size: 16px; | |
| 321 | + margin: 3px 0 0; | |
| 322 | + letter-spacing: normal; | |
| 323 | + white-space: normal; | |
| 324 | + flex-shrink: 0; | |
| 325 | + cursor: pointer; | |
| 326 | + display: -webkit-box; | |
| 327 | + -webkit-line-clamp: ${e=>e.lineCount}; | |
| 328 | + -webkit-box-orient: vertical; | |
| 329 | + overflow: hidden; | |
| 330 | +`,No=C().p` | |
| 331 | + line-height: ${16}px; | |
| 332 | + min-height : ${16}px; | |
| 333 | + color: #606770; | |
| 334 | + font-size: 14px; | |
| 335 | + padding: 0; | |
| 336 | + text-overflow: ellipsis; | |
| 337 | + margin: 3px 0 0 0; | |
| 338 | + display: -webkit-box; | |
| 339 | + cursor: pointer; | |
| 340 | + -webkit-line-clamp: ${e=>e.lineCount}; | |
| 341 | + -webkit-box-orient: vertical; | |
| 342 | + overflow: hidden; | |
| 343 | + | |
| 344 | + @media all and ( max-width: ${e=>e.maxWidth} ) { | |
| 345 | + display: none; | |
| 346 | + } | |
| 347 | +`,Mo=e=>{switch(e){case"landscape":return"527px";case"square":case"portrait":return"369px";default:return"476px"}},Po=C().div` | |
| 348 | + box-sizing: border-box; | |
| 349 | + display: flex; | |
| 350 | + flex-direction: ${e=>"landscape"===e.mode?"column":"row"}; | |
| 351 | + background-color: #f2f3f5; | |
| 352 | + max-width: 527px; | |
| 353 | +`,Ao=C().div` | |
| 354 | + box-sizing: border-box; | |
| 355 | + background-color: #f2f3f5; | |
| 356 | + margin: 0; | |
| 357 | + padding: 10px 12px; | |
| 358 | + position: relative; | |
| 359 | + border-bottom: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; | |
| 360 | + border-top: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; | |
| 361 | + border-right: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; | |
| 362 | + border: ${e=>"landscape"===e.mode?"1px solid #dddfe2":""}; | |
| 363 | + display: flex; | |
| 364 | + flex-direction: column; | |
| 365 | + flex-grow: 1; | |
| 366 | + justify-content: ${e=>"landscape"===e.mode?"flex-start":"center"}; | |
| 367 | + font-size: 12px; | |
| 368 | + overflow: hidden; | |
| 369 | +`;class Oo extends $e.Component{constructor(e){super(e),this.state={imageMode:null,maxLineCount:0,descriptionLineCount:0},this.facebookTitleRef=Be().createRef(),this.onImageLoaded=this.onImageLoaded.bind(this),this.onImageEnter=this.props.onMouseHover.bind(this,"image"),this.onTitleEnter=this.props.onMouseHover.bind(this,"title"),this.onDescriptionEnter=this.props.onMouseHover.bind(this,"description"),this.onLeave=this.props.onMouseHover.bind(this,""),this.onSelectTitle=this.props.onSelect.bind(this,"title"),this.onSelectDescription=this.props.onSelect.bind(this,"description")}onImageLoaded(e){this.setState({imageMode:e})}getTitleLineCount(){return this.facebookTitleRef.current.offsetHeight/20}maybeSetMaxLineCount(){const{imageMode:e,maxLineCount:s}=this.state,t="landscape"===e?2:5;t!==s&&this.setState({maxLineCount:t})}maybeSetDescriptionLineCount(){const{descriptionLineCount:e,maxLineCount:s,imageMode:t}=this.state,r=this.getTitleLineCount();let o=s-r;"portrait"===t&&(o=5===r?0:4),o!==e&&this.setState({descriptionLineCount:o})}componentDidUpdate(){this.maybeSetMaxLineCount(),this.maybeSetDescriptionLineCount()}render(){const{imageMode:e,maxLineCount:s,descriptionLineCount:t}=this.state;return(0,N.jsxs)(Po,{id:"facebookPreview",mode:e,children:[(0,N.jsx)(Lo,{src:this.props.imageUrl||this.props.imageFallbackUrl,alt:this.props.alt,onImageLoaded:this.onImageLoaded,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,N.jsxs)(Ao,{mode:e,children:[(0,N.jsx)(fo,{siteUrl:this.props.siteUrl,mode:e}),(0,N.jsx)(To,{ref:this.facebookTitleRef,onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,lineCount:s,children:this.props.title}),t>0&&(0,N.jsx)(No,{maxWidth:Mo(e),onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,lineCount:t,children:this.props.description})]})]})}}Oo.propTypes={siteUrl:E().string.isRequired,title:E().string.isRequired,description:E().string,imageUrl:E().string,imageFallbackUrl:E().string,alt:E().string,onSelect:E().func,onImageClick:E().func,onMouseHover:E().func},Oo.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{}};const Fo=Oo,qo=C().div` | |
| 370 | + text-transform: lowercase; | |
| 371 | + color: rgb(83, 100, 113); | |
| 372 | + white-space: nowrap; | |
| 373 | + overflow: hidden; | |
| 374 | + text-overflow: ellipsis; | |
| 375 | + margin: 0; | |
| 376 | + fill: currentcolor; | |
| 377 | + display: flex; | |
| 378 | + flex-direction: row; | |
| 379 | + align-items: flex-end; | |
| 380 | +`,$o=e=>(0,N.jsx)(qo,{children:(0,N.jsx)("span",{children:e.siteUrl})});$o.propTypes={siteUrl:E().string.isRequired};const Bo=$o,Uo=(e,s=!0)=>e?`\n\t\t\tmax-width: ${de.TWITTER_IMAGE_SIZES.landscapeWidth}px;\n\t\t\t${s?"border-bottom: 1px solid #E1E8ED;":""}\n\t\t\tborder-radius: 14px 14px 0 0;\n\t\t\t`:`\n\t\twidth: ${de.TWITTER_IMAGE_SIZES.squareWidth}px;\n\t\t${s?"border-right: 1px solid #E1E8ED;":""}\n\t\tborder-radius: 14px 0 0 14px;\n\t\t`,Wo=C().div` | |
| 381 | + position: relative; | |
| 382 | + box-sizing: content-box; | |
| 383 | + overflow: hidden; | |
| 384 | + background-color: #e1e8ed; | |
| 385 | + flex-shrink: 0; | |
| 386 | + ${e=>Uo(e.isLarge)} | |
| 387 | +`,Do=C().div` | |
| 388 | + display: flex; | |
| 389 | + justify-content: center; | |
| 390 | + align-items: center; | |
| 391 | + box-sizing: border-box; | |
| 392 | + max-width: 100%; | |
| 393 | + margin: 0; | |
| 394 | + padding: 1em; | |
| 395 | + text-align: center; | |
| 396 | + font-size: 1rem; | |
| 397 | + ${e=>Uo(e.isLarge,!1)} | |
| 398 | +`,Ho=C()(Do)` | |
| 399 | + ${e=>e.isLarge&&`height: ${de.TWITTER_IMAGE_SIZES.landscapeHeight}px;`} | |
| 400 | + border-top-left-radius: 14px; | |
| 401 | + ${e=>e.isLarge?"border-top-right-radius":"border-bottom-left-radius"}: 14px; | |
| 402 | + border-style: dashed; | |
| 403 | + border-width: 1px; | |
| 404 | + // We're not using standard colors to increase contrast for accessibility. | |
| 405 | + color: #006DAC; | |
| 406 | + // We're not using standard colors to increase contrast for accessibility. | |
| 407 | + background-color: #f1f1f1; | |
| 408 | + text-decoration: underline; | |
| 409 | + font-size: 14px; | |
| 410 | + cursor: pointer; | |
| 411 | +`;class zo extends Be().Component{constructor(e){super(e),this.state={status:"loading"},this.socialMedium="Twitter",this.handleTwitterImage=this.handleTwitterImage.bind(this),this.setState=this.setState.bind(this)}async handleTwitterImage(){if(null===this.props.src)return;const e=await Co(this.props.src,this.socialMedium,this.props.isLarge);this.setState(e)}componentDidUpdate(e){e.src!==this.props.src&&this.handleTwitterImage()}componentDidMount(){this.handleTwitterImage()}render(){const{status:e,imageProperties:s}=this.state;return"loading"===e||""===this.props.src||"errored"===e?(0,N.jsx)(Ho,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,d.__)("Select image","wordpress-seo")}):(0,N.jsx)(Wo,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,N.jsx)(ko,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:de.TWITTER_IMAGE_SIZES.aspectRatio},width:s.width,height:s.height,imageMode:s.mode})})}}zo.propTypes={isLarge:E().bool.isRequired,src:E().string,alt:E().string,onImageClick:E().func,onMouseEnter:E().func,onMouseLeave:E().func},zo.defaultProps={src:"",alt:"",onMouseEnter:l.noop,onImageClick:l.noop,onMouseLeave:l.noop};const Go=C().div` | |
| 412 | + display: flex; | |
| 413 | + flex-direction: column; | |
| 414 | + padding: 12px; | |
| 415 | + justify-content: center; | |
| 416 | + margin: 0; | |
| 417 | + box-sizing: border-box; | |
| 418 | + flex: auto; | |
| 419 | + min-width: 0px; | |
| 420 | + gap:2px; | |
| 421 | + > * { | |
| 422 | + line-height:20px; | |
| 423 | + min-height:20px; | |
| 424 | + font-size:15px; | |
| 425 | + } | |
| 426 | +`,Vo=e=>(0,N.jsx)(Go,{children:e.children});Vo.propTypes={children:E().array.isRequired};const Ko=Vo,Yo=C().p` | |
| 427 | + white-space: nowrap; | |
| 428 | + overflow: hidden; | |
| 429 | + text-overflow: ellipsis; | |
| 430 | + margin: 0; | |
| 431 | + color: rgb(15, 20, 25); | |
| 432 | + cursor: pointer; | |
| 433 | +`,Zo=C().p` | |
| 434 | + max-height: 55px; | |
| 435 | + overflow: hidden; | |
| 436 | + text-overflow: ellipsis; | |
| 437 | + margin: 0; | |
| 438 | + color: rgb(83, 100, 113); | |
| 439 | + display: -webkit-box; | |
| 440 | + cursor: pointer; | |
| 441 | + -webkit-line-clamp: 2; | |
| 442 | + -webkit-box-orient: vertical; | |
| 443 | + | |
| 444 | + @media all and ( max-width: ${de.TWITTER_IMAGE_SIZES.landscapeWidth}px ) { | |
| 445 | + display: none; | |
| 446 | + } | |
| 447 | +`,Qo=C().div` | |
| 448 | + font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif; | |
| 449 | + font-size: 15px; | |
| 450 | + font-weight: 400; | |
| 451 | + line-height: 20px; | |
| 452 | + max-width: 507px; | |
| 453 | + border: 1px solid #E1E8ED; | |
| 454 | + box-sizing: border-box; | |
| 455 | + border-radius: 14px; | |
| 456 | + color: #292F33; | |
| 457 | + background: #FFFFFF; | |
| 458 | + text-overflow: ellipsis; | |
| 459 | + display: flex; | |
| 460 | + | |
| 461 | + &:hover { | |
| 462 | + background: #f5f8fa; | |
| 463 | + border: 1px solid rgba(136,153,166,.5); | |
| 464 | + } | |
| 465 | +`,Xo=C()(Qo)` | |
| 466 | + flex-direction: column; | |
| 467 | + max-height: 370px; | |
| 468 | +`,Jo=C()(Qo)` | |
| 469 | + flex-direction: row; | |
| 470 | + height: 125px; | |
| 471 | +`;class ei extends $e.Component{constructor(e){super(e),this.onImageEnter=this.props.onMouseHover.bind(this,"image"),this.onTitleEnter=this.props.onMouseHover.bind(this,"title"),this.onDescriptionEnter=this.props.onMouseHover.bind(this,"description"),this.onLeave=this.props.onMouseHover.bind(this,""),this.onSelectTitle=this.props.onSelect.bind(this,"title"),this.onSelectDescription=this.props.onSelect.bind(this,"description")}render(){const{isLarge:e,imageUrl:s,imageFallbackUrl:t,alt:r,title:o,description:i,siteUrl:n}=this.props,a=e?Xo:Jo;return(0,N.jsxs)(a,{id:"twitterPreview",children:[(0,N.jsx)(zo,{src:s||t,alt:r,isLarge:e,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,N.jsxs)(Ko,{children:[(0,N.jsx)(Bo,{siteUrl:n}),(0,N.jsx)(Yo,{onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,children:o}),(0,N.jsx)(Zo,{onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,children:i})]})]})}}ei.propTypes={siteUrl:E().string.isRequired,title:E().string.isRequired,description:E().string,isLarge:E().bool,imageUrl:E().string,imageFallbackUrl:E().string,alt:E().string,onSelect:E().func,onImageClick:E().func,onMouseHover:E().func},ei.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{},isLarge:!0};const si=ei,ti=window.yoast.replacementVariableEditor;class ri extends $e.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},this.SocialPreview="Social"===e.socialMediumName?Fo:si,this.setHoveredField=this.setHoveredField.bind(this),this.setActiveField=this.setActiveField.bind(this),this.setEditorRef=this.setEditorRef.bind(this),this.setEditorFocus=this.setEditorFocus.bind(this)}setHoveredField(e){e!==this.state.hoveredField&&this.setState({hoveredField:e})}setActiveField(e){e!==this.state.activeField&&this.setState({activeField:e},()=>this.setEditorFocus(e))}setEditorFocus(e){switch(e){case"title":this.titleEditorRef.focus();break;case"description":this.descriptionEditorRef.focus()}}setEditorRef(e,s){switch(e){case"title":this.titleEditorRef=s;break;case"description":this.descriptionEditorRef=s}}render(){const{onDescriptionChange:e,onTitleChange:s,onSelectImageClick:t,onRemoveImageClick:r,socialMediumName:o,imageWarnings:i,siteUrl:n,description:a,descriptionInputPlaceholder:l,descriptionPreviewFallback:c,imageUrl:d,imageFallbackUrl:u,alt:p,title:h,titleInputPlaceholder:m,titlePreviewFallback:g,replacementVariables:y,recommendedReplacementVariables:x,applyReplacementVariables:f,onReplacementVariableSearchChange:w,isPremium:v,isLarge:b,socialPreviewLabel:k,idSuffix:S,activeMetaTabId:j}=this.props,_=f({title:h||g,description:a||c});return(0,N.jsxs)(Be().Fragment,{children:[k&&(0,N.jsx)(I.SimulatedLabel,{children:k}),(0,N.jsx)(this.SocialPreview,{onMouseHover:this.setHoveredField,onSelect:this.setActiveField,onImageClick:t,siteUrl:n,title:_.title,description:_.description,imageUrl:d,imageFallbackUrl:u,alt:p,isLarge:b,activeMetaTabId:j}),(0,N.jsx)(de.SocialMetadataPreviewForm,{onDescriptionChange:e,socialMediumName:o,title:h,titleInputPlaceholder:m,onRemoveImageClick:r,imageSelected:!!d,imageUrl:d,imageFallbackUrl:u,onTitleChange:s,onSelectImageClick:t,description:a,descriptionInputPlaceholder:l,imageWarnings:i,replacementVariables:y,recommendedReplacementVariables:x,onReplacementVariableSearchChange:w,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:v,setEditorRef:this.setEditorRef,idSuffix:S})]})}}ri.propTypes={title:E().string.isRequired,onTitleChange:E().func.isRequired,description:E().string.isRequired,onDescriptionChange:E().func.isRequired,imageUrl:E().string.isRequired,imageFallbackUrl:E().string.isRequired,onSelectImageClick:E().func.isRequired,onRemoveImageClick:E().func.isRequired,socialMediumName:E().string.isRequired,alt:E().string,isPremium:E().bool,imageWarnings:E().array,isLarge:E().bool,siteUrl:E().string,descriptionInputPlaceholder:E().string,titleInputPlaceholder:E().string,descriptionPreviewFallback:E().string,titlePreviewFallback:E().string,replacementVariables:ti.replacementVariablesShape,recommendedReplacementVariables:ti.recommendedReplacementVariablesShape,applyReplacementVariables:E().func,onReplacementVariableSearchChange:E().func,socialPreviewLabel:E().string,idSuffix:E().string,activeMetaTabId:E().string},ri.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",titleInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",alt:"",applyReplacementVariables:e=>e,onReplacementVariableSearchChange:null,socialPreviewLabel:"",idSuffix:"",activeMetaTabId:""};const oi={},ii=(e,s,{log:t=console.warn}={})=>{oi[e]||(oi[e]=!0,t(s))},ni=(e,s=l.noop)=>{const t={};for(const r in e)Object.hasOwn(e,r)&&Object.defineProperty(t,r,{set:t=>{e[r]=t,s("set",r,t)},get:()=>(s("get",r),e[r])});return t};ni({squareWidth:125,squareHeight:125,landscapeWidth:506,landscapeHeight:265,aspectRatio:50.2},(e,s)=>ii(`@yoast/social-metadata-previews/TWITTER_IMAGE_SIZES/${e}/${s}`,`[@yoast/social-metadata-previews] "TWITTER_IMAGE_SIZES.${s}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`)),ni({squareWidth:158,squareHeight:158,landscapeWidth:527,landscapeHeight:273,portraitWidth:158,portraitHeight:237,aspectRatio:52.2,largeThreshold:{width:446,height:233}},(e,s)=>ii(`@yoast/social-metadata-previews/FACEBOOK_IMAGE_SIZES/${e}/${s}`,`[@yoast/social-metadata-previews] "FACEBOOK_IMAGE_SIZES.${s}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`));const ai=({title:e,description:s})=>{const t=(0,_e.useSelect)(e=>e(dt).getSiteUrl(),[]),r=(0,_e.useSelect)(e=>e(dt).getFacebookImageUrl(),[]),o=(0,_e.useSelect)(e=>e(dt).getEditorDataImageFallback(),[]),i=(0,_e.useSelect)(e=>e(dt).getFacebookAltText(),[]);return(0,N.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,N.jsx)(Fo,{title:e,description:s,siteUrl:t,imageUrl:r,imageFallbackUrl:o,alt:i,onSelect:l.noop,onImageClick:l.noop,onMouseHover:l.noop})})};ai.propTypes={title:E().string.isRequired,description:E().string.isRequired};const li=()=>(0,N.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-[527px] yst-border yst-mx-auto",children:[(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-[273px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,N.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),ci=()=>(0,N.jsxs)(X.Alert,{variant:"error",children:[(0,N.jsx)("span",{className:"yst-block yst-font-medium",children:gr}),(0,N.jsx)(yr,{})]}),di=({children:e,onRetry:s})=>{const{onClose:t}=(0,X.useModalContext)();return(0,N.jsxs)(j.Fragment,{children:[e,(0,N.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,N.jsx)(X.Button,{variant:"secondary",onClick:t,children:(0,d.__)("Close","wordpress-seo")}),(0,N.jsx)(X.Button,{variant:"primary",onClick:s,children:(0,d.__)("Try again","wordpress-seo")})]})]})};di.propTypes={children:E().node.isRequired,onRetry:E().func.isRequired};const ui=({errorCode:e,errorIdentifier:s,invalidSubscriptions:t=[],showActions:r=!1,onRetry:o=l.noop,errorMessage:i=""})=>{switch(e){case 400:switch(s){case"AI_CONTENT_FILTER":return(0,N.jsx)(Kt,{});case"NOT_ENOUGH_CONTENT":return(0,N.jsx)(Tt,{});case"SITE_UNREACHABLE":return(0,N.jsx)(ci,{});case"WP_HTTP_REQUEST_ERROR":return r?(0,N.jsx)(di,{onRetry:o,children:(0,N.jsx)(Qt,{errorMessage:i})}):(0,N.jsx)(Qt,{errorMessage:i});default:return r?(0,N.jsx)(di,{onRetry:o,children:(0,N.jsx)(Et,{})}):(0,N.jsx)(Et,{})}case 402:return(0,N.jsx)(Wt,{invalidSubscriptions:t});case 408:return r?(0,N.jsx)(di,{onRetry:o,children:(0,N.jsx)(zt,{})}):(0,N.jsx)(zt,{});case 429:return"USAGE_LIMIT_REACHED"===s?(0,N.jsx)(Wt,{invalidSubscriptions:t}):(0,N.jsx)(Ft,{});case 410:return(0,N.jsx)(er,{});default:return r?(0,N.jsx)(di,{onRetry:o,children:(0,N.jsx)(Et,{})}):(0,N.jsx)(Et,{})}};ui.propTypes={errorCode:E().number.isRequired,errorIdentifier:E().string.isRequired,invalidSubscriptions:E().array,showActions:E().bool,onRetry:E().func,errorMessage:E().string};const pi=E().shape({value:E().string.isRequired,label:E().node.isRequired}),hi=({id:e,name:s,suggestion:t,isChecked:r,onChange:o})=>{const i=(0,j.useCallback)(()=>o(t.value),[t,o]);return(0,N.jsxs)("label",{htmlFor:e,className:Ze()("yst-flex yst-p-4 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",r&&"yst-z-10 yst-border-primary-500"),children:[(0,N.jsx)("input",{type:"radio",id:e,name:s,className:"yst-radio__input",value:t.value,checked:r,onChange:i}),(0,N.jsx)("div",{className:Ze()("yst-label yst-radio__label yst-flex yst-flex-wrap yst-items-center",!r&&"yst-text-slate-600"),children:t.label})]})};hi.propTypes={id:E().string.isRequired,name:E().string.isRequired,suggestion:pi.isRequired,isChecked:E().bool.isRequired,onChange:E().func.isRequired};const mi=({idSuffix:e,suggestions:s,selected:t,onChange:r})=>(0,N.jsx)("div",{children:(0,N.jsx)(X.RadioGroup,{className:"yst-suggestions-radio-group yst-flex yst-flex-col",id:`yst-ai-suggestions-radio-group__${e}`,children:s.map((s,o)=>(0,N.jsx)(hi,{id:`yst-ai-suggestions-radio-${e}__${o}`,name:`ai-suggestion__${e}`,isChecked:s.value===t,onChange:r,suggestion:s},`yst-ai-suggestions-radio-${e}__${o}`))})});mi.propTypes={idSuffix:E().string.isRequired,suggestions:E().arrayOf(pi).isRequired,selected:E().string.isRequired,onChange:E().func.isRequired};const gi=[["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-8/12"]],yi=({suggestionClassNames:e=gi})=>(0,N.jsx)("div",{className:"yst-flex yst-flex-col yst--space-y-[1px]",children:e.map((e,s)=>(0,N.jsxs)("div",{className:"yst-flex yst-p-4 yst-gap-x-3 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",children:[(0,N.jsx)("input",{type:"radio",disabled:!0,className:"yst-my-0.5"}),(0,N.jsx)("div",{className:"yst-flex yst-flex-col yst-w-full",children:e.map((e,t)=>(0,N.jsx)(X.SkeletonLoader,{className:e},`yst-ai-suggestion-radio-skeleton-${s}__${t}`))})]},`yst-ai-suggestion-radio-skeleton__${s}`))});yi.propTypes={suggestionClassNames:E().arrayOf(E().arrayOf(E().string))};const xi="ai_generator_tip_notification",fi=()=>{const e=(0,_e.useSelect)(e=>e(dt).isAlertDismissed(xi),[]),s=(0,_e.useSelect)(e=>e(dt).getEditorDataContent(),[]),t=(0,_e.useSelect)(e=>e(dt).getIsWooProductEntity(),[]),[r,,,o]=(0,X.useToggleState)(!1),{editType:i,contentType:n}=qr(),{dismissAlert:a}=(0,_e.useDispatch)(dt),l=(0,j.useCallback)(()=>{a(xi)},[a]),c=(0,j.useMemo)(()=>i===gt?(0,d.__)("%1$sTip%2$s: Improve the accuracy of your generated AI descriptions by writing more content in your page.","wordpress-seo"):(0,d.__)("%1$sTip%2$s: Improve the accuracy of your generated AI titles by writing more content in your page.","wordpress-seo") | |
| 472 | +/* translators: %1$s and %2$s expand to opening and closing of a span in order to emphasise the word. */,[i]),p=(0,j.useMemo)(()=>((e,s)=>e||s===xt?150:300)(t,n),[n,t]),h=(0,j.useMemo)(()=>(e=>u.languageProcessing.sanitizeString(e||"").length)(s),[s]);return e||r||h>p?null:(0,N.jsxs)(X.Notifications.Notification,{id:"ai-generator-content-tip",variant:"info",dismissScreenReaderLabel:(0,d.__)("Dismiss","wordpress-seo"),children:[Oe((0,d.sprintf)(c,"<span>","</span>"),{span:(0,N.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),(0,N.jsxs)("div",{className:"yst-flex yst-mt-3 yst--ms-3 yst-gap-1",children:[(0,N.jsx)(X.Button,{type:"button",variant:"tertiary",onClick:l,children:(0,d.__)("Don’t show again","wordpress-seo")}),(0,N.jsx)(X.Button,{type:"button",variant:"tertiary",className:"yst-text-slate-800",onClick:o,children:(0,d.__)("Dismiss","wordpress-seo")})]})]})},wi=({title:e,description:s,showPreviewSkeleton:t})=>(0,N.jsxs)("div",{children:[(0,N.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,N.jsx)(X.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,d.__)("X preview","wordpress-seo")})}),t?(0,N.jsx)(bi,{}):(0,N.jsx)(vi,{title:e,description:s})]});wi.propTypes={title:E().string.isRequired,description:E().string.isRequired,showPreviewSkeleton:E().bool.isRequired};const vi=({title:e,description:s})=>{const t=(0,_e.useSelect)(e=>e(dt).getSiteUrl(),[]),r=(0,_e.useSelect)(e=>e(dt).getTwitterImageUrl(),[]),o=(0,_e.useSelect)(e=>e(dt).getFacebookImageUrl(),[]),i=(0,_e.useSelect)(e=>e(dt).getEditorDataImageFallback(),[]),n=(0,_e.useSelect)(e=>e(dt).getTwitterImageType(),[]),a=(0,_e.useSelect)(e=>e(dt).getTwitterAltText(),[]);return(0,N.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,N.jsx)(si,{title:e,description:s,siteUrl:t,imageUrl:r,imageFallbackUrl:o||i,isLarge:"summary"!==n,alt:a,onSelect:l.noop,onImageClick:l.noop,onMouseHover:l.noop})})};vi.propTypes={title:E().string.isRequired,description:E().string.isRequired};const bi=()=>(0,N.jsxs)("div",{className:"yst-flex yst-flex-col yst-max-h-[370px] yst-w-[507px] yst-border yst-rounded-t-[14px] yst-overflow-hidden yst-mx-auto",children:[(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-[265px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,N.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,N.jsx)(X.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),ki="yst-mt-1 yst-mb-3",Si="yst-flex yst-justify-end yst--me-8 yst-gap-3 yst--ms-2",ji=({onClose:e})=>(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{className:ki,children:(0,d.__)("As long as this is a beta feature, you get unlimited sparks.","wordpress-seo")}),(0,N.jsx)("div",{className:Si,children:(0,N.jsx)(X.Button,{type:"button",variant:"primary",size:"small",onClick:e,children:(0,d.__)("Got it!","wordpress-seo")})})]}),_i=({onClose:e,upsellLink:s,isWooProductEntity:t=!1,ctbId:r="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const o=(0,X.useSvgAria)();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{className:ki,children:(0,d.sprintf)(/* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ | |
| 473 | +(0,d.__)("Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),t?"Yoast WooCommerce SEO":"Yoast SEO Premium")}),(0,N.jsxs)("div",{className:Si,children:[(0,N.jsx)(X.Button,{type:"button",variant:"tertiary",size:"small",onClick:e,children:(0,d.__)("Close","wordpress-seo")}),(0,N.jsxs)(X.Button,{as:"a",size:"small",variant:"upsell",href:s,target:"_blank",rel:"noopener noreferrer","data-action":"load-nfd-ctb","data-ctb-id":r,children:[(0,N.jsx)(He(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-me-2 yst-shrink-0",...o}),(0,d.sprintf)(/* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ | |
| 474 | +(0,d.__)("Unlock with %1$s","wordpress-seo"),t?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,N.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */ | |
| 475 | +(0,d.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]})},Ci=({className:e=""})=>{const{isUsageCountLimitReached:s,usageCount:t,usageCountLimit:r,premiumUpsellLink:o,wooUpsellLink:i,isWooProductEntity:n,hasValidPremiumSubscription:a,hasValidWooSubscription:l}=(0,_e.useSelect)(e=>{const s=e(ct),t=e(dt);return{isUsageCountLimitReached:s.isUsageCountLimitReached(),usageCount:s.selectUsageCount(),usageCountLimit:s.selectUsageCountLimit(),premiumUpsellLink:t.selectLink("https://yoa.st/ai-toast-out-of-free-sparks"),wooUpsellLink:t.selectLink("https://yoa.st/ai-toast-out-of-free-sparks-woo"),isWooProductEntity:t.getIsWooProductEntity(),hasValidPremiumSubscription:s.selectPremiumSubscription(),hasValidWooSubscription:s.selectWooCommerceSubscription()}},[]),c=(0,j.useMemo)(()=>a&&!n||n&&l&&a,[a,n,l]),[u,,p,,h]=(0,X.useToggleState)(t===r),m=Math.max(0,r-t);(0,j.useEffect)(()=>{p(c&&t===r||!c&&m<=5)},[t,r,c,s]);const g=(0,j.useMemo)(()=>n?i:o,[n,i,o]),y=(0,j.useMemo)(()=>n&&!l,[n,l]);return u&&(0,N.jsx)(X.Notifications.Notification,{id:"ai-sparks-limit",className:e,variant:"info",dismissScreenReaderLabel:(0,d.__)("Close","wordpress-seo"),title:c?(0,d.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */ | |
| 476 | +(0,d._n)("You've used %s spark this month.","You've used %s sparks this month.",t,"wordpress-seo"),t):m<=5&&!s?(0,d.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */ | |
| 477 | +(0,d._n)("%s free spark left!","%s free sparks left!",m,"wordpress-seo"),m):(0,d.__)("You're out of free sparks!","wordpress-seo"),size:c?"default":"large",children:c?(0,N.jsx)(ji,{onClose:h}):(0,N.jsx)(_i,{onClose:h,upsellLink:g,isWooUpsell:y})})},Ri=({errorCode:e,errorIdentifier:s="",errorMessage:t=""})=>{switch(e){case 400:switch(s){case"SITE_UNREACHABLE":return(0,N.jsx)(ci,{});case"WP_HTTP_REQUEST_ERROR":return(0,N.jsx)(Qt,{errorMessage:t});default:return(0,N.jsx)(Et,{})}case 429:return(0,N.jsx)(Ft,{});default:return(0,N.jsx)(Et,{})}};Ri.propTypes={errorCode:E().number.isRequired,errorIdentifier:E().string,errorMessage:E().string};const Ei=({currentSubscriptions:e,isSeoAnalysisActive:s=!0})=>{const{isPremium:t,usageCountStatus:r,usageCountError:o,isWooProductEntity:i,isWooSeoActive:n}=(0,_e.useSelect)(e=>{const s=e(dt);return{isPremium:s.getIsPremium(),usageCountStatus:e(ct).selectUsageCountStatus(),usageCountError:e(ct).selectUsageCountError(),isWooProductEntity:s.getIsWooProductEntity(),isWooSeoActive:s.getIsWooSeoActive()}},[]),a=(0,j.useMemo)(()=>!e.wooCommerceSubscription&&i,[e.wooCommerceSubscription]),l=(0,j.useMemo)(()=>{const s=[];return!t&&!i||e.premiumSubscription||s.push("Yoast SEO Premium"),a&&n&&s.push("Yoast WooCommerce SEO"),s},[t,e.premiumSubscription,a,n,i]);return l.length>0?(0,N.jsx)(Wt,{invalidSubscriptions:l}):s?r===vt.error?(0,N.jsx)(Ri,{...o}):void 0:(0,N.jsx)(Pt,{})};Ei.propTypes={currentSubscriptions:E().object.isRequired,isSeoAnalysisActive:E().bool};const Ii=({id:e,label:s,description:t="",onChange:r,...o})=>(0,N.jsx)(X.Root,{children:(0,N.jsx)(X.TextField,{id:e,label:s,onChange:r,autoComplete:"off",description:t,...o})});Ii.propTypes={id:E().string.isRequired,label:E().string.isRequired,onChange:E().func.isRequired,description:E().oneOfType([E().string,E().element])};const Li=Ii;window.yoast=window.yoast||{},window.yoast.editorModules={analysis:{getL10nObject:c,getContentLocale:function(){const e=c();return(0,l.get)(e,"contentLocale","en_US")},getIndicatorForScore:function(e){return(0,l.isNil)(e)||(e/=10),function(e){switch(e){case"feedback":return{className:"na",screenReaderText:(0,d.__)("Not available","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("Not available","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Not available","wordpress-seo")};case"bad":return{className:"bad",screenReaderText:(0,d.__)("Needs improvement","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("Needs improvement","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Needs improvement","wordpress-seo")};case"ok":return{className:"ok",screenReaderText:(0,d.__)("OK SEO score","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("OK","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Potentially non-inclusive","wordpress-seo")};case"good":return{className:"good",screenReaderText:(0,d.__)("Good SEO score","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("Good","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Good","wordpress-seo")};default:return{className:"loading",screenReaderText:"",screenReaderReadabilityText:"",screenReaderInclusiveLanguageText:""}}}(u.interpreters.scoreToRating(e))},constants:e,refreshAnalysis:s},aiGenerator:{components:{AIErrorModal:jr,Introduction:Xr,SuggestionError:ui,SparksLimitNotification:Ci,FeatureError:Ei},helpers:{removesLocaleVariantSuffixes:Ir,fetchSuggestions:Nr}},components:{HelpLink:se,TopLevelProviders:Se,higherorder:{withYoastSidebarPriority:e=>{const s=({renderPriority:s,...t})=>(0,N.jsx)(e,{...t});return s.propTypes={renderPriority:E().number},s}},contentAnalysis:{KeywordInput:V,RelatedKeyphraseInputField:ee,SynonymsInputField:Li,mapResults:r},contexts:{location:{LocationContext:n.LocationContext,LocationProvider:n.LocationProvider,LocationConsumer:n.LocationConsumer}},SidebarItem:be,SidebarCollapsible:we,MetaboxCollapsible:ne,Modal:ce,portals:{Portal:me,ImageSelectPortal:ge,ScoreIconPortal:xe},FieldsetLayout:Fs,UnsavedChangesModal:Qs,YoastLogo:e=>$e.createElement("svg",lt({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"yoast-logo_svg__w-40",viewBox:"0 0 842 224"},e),nt||(nt=$e.createElement("path",{fill:"#a61e69",d:"M166.55 54.09c-38.69 0-54.17 25.97-54.17 54.88s15.25 56.02 54.17 56.02 54.07-27.19 54-54.26c-.09-32.97-16.77-56.65-54-56.65Zm-23.44 56.52c.94-38.69 30.66-38.65 40.59-24.79 9.05 12.63 10.9 55.81-17.14 55.5-12.92-.14-23.06-8.87-23.44-30.71Zm337.25 27.55V82.11h20.04V57.78h-20.04V28.39h-30.95v29.39h-15.7v24.33h15.7v52.87c0 30.05 20.95 47.91 43.06 51.61l9.24-24.88c-12.89-1.63-21.23-11.27-21.35-23.54Zm-156.15-8.87V87.16c0-1.54-.1-2.98-.25-4.39-2.68-34.04-51.02-33.97-88.46-20.9l10.82 21.78c24.38-11.58 38.97-8.59 44.07-2.89.13.15.26.29.38.45.01.02.03.04.04.06 2.6 3.51 1.98 9.05 1.98 13.41-31.86 0-65.77 4.23-65.77 39.17 0 26.56 33.28 43.65 68.06 18.33l5.16 12.45h29.81c-2.66-14.62-5.85-27.14-5.85-35.34Zm-31.18-.23c-24.51 27.43-46.96 1.61-23.97-9.65 6.77-2.31 15.95-2.41 23.97-2.41v12.06Zm78.75-44.17c0-10.38 16.61-15.23 42.82-3.27l9.06-22.01c-35.27-10.66-83.44-11.62-83.75 25.28-.15 17.68 11.19 27.19 27.52 33.26 11.31 4.2 27.64 6.38 27.59 15.39-.06 11.77-25.38 13.57-48.42-2.26l-9.31 23.87c31.43 15.64 89.87 16.08 89.56-23.12-.31-38.76-55.08-32.11-55.08-47.14ZM99.3 1 54.44 125.61 32.95 58.32H1l35.78 91.89a33.49 33.49 0 0 1 0 24.33c-4 10.25-10.65 19.03-26.87 21.21v27.24c31.58 0 48.65-19.41 63.88-61.96L133.48 1H99.3ZM598.64 139.05c0 8.17-2.96 14.58-8.87 19.23-5.91 4.65-14.07 6.98-24.47 6.98s-18.92-1.61-25.54-4.84v-14.2c4.19 1.97 8.65 3.52 13.37 4.65 4.72 1.13 9.11 1.7 13.18 1.7 5.95 0 10.35-1.13 13.18-3.39 2.83-2.26 4.25-5.3 4.25-9.11 0-3.43-1.3-6.35-3.9-8.74-2.6-2.39-7.97-5.22-16.1-8.48-8.39-3.39-14.3-7.27-17.74-11.63-3.44-4.36-5.16-9.59-5.16-15.71 0-7.67 2.72-13.7 8.18-18.1 5.45-4.4 12.77-6.6 21.95-6.6s17.57 1.93 26.29 5.78l-4.78 12.26c-8.18-3.43-15.47-5.15-21.89-5.15-4.87 0-8.55 1.06-11.07 3.17-2.52 2.12-3.77 4.91-3.77 8.39 0 2.39.5 4.43 1.51 6.13s2.66 3.3 4.97 4.81c2.3 1.51 6.46 3.5 12.45 5.97 6.75 2.81 11.7 5.43 14.85 7.86 3.15 2.43 5.45 5.18 6.92 8.23 1.46 3.06 2.2 6.66 2.2 10.81Zm68.53 24.96h-52.02V72.12h52.02v12.7h-36.99v25.01h34.66v12.57h-34.66v28.85h36.99v12.76Zm100.24-46.07c0 14.96-3.74 26.59-11.23 34.88-7.49 8.3-18.08 12.44-31.8 12.44s-24.54-4.12-31.99-12.35c-7.44-8.23-11.17-19.93-11.17-35.1s3.74-26.82 11.23-34.95c7.49-8.13 18.17-12.19 32.05-12.19s24.24 4.13 31.7 12.38c7.47 8.26 11.2 19.88 11.2 34.88Zm-70.2 0c0 11.31 2.29 19.89 6.86 25.74 4.57 5.85 11.35 8.77 20.32 8.77s15.67-2.89 20.22-8.67c4.55-5.78 6.82-14.39 6.82-25.83s-2.25-19.82-6.76-25.64-11.23-8.74-20.16-8.74-15.82 2.91-20.41 8.74c-4.59 5.82-6.89 14.37-6.89 25.64Z"})),at||(at=$e.createElement("path",{fill:"#77b227",d:"m790.45 165.35 36.05-94.96H840l-36.02 94.96h-13.53z"}))),SidebarLayout:({contentClassName:e="",children:s})=>(0,N.jsx)("div",{className:"yst-flex yst-gap-6 xl:yst-flex-row yst-flex-col relative",children:(0,N.jsx)("div",{className:Ze()("yst-@container yst-flex yst-flex-grow yst-flex-col",e),children:s})}),ErrorFallback:As},containers:{EditorModal:Le,PersistentDismissableAlert:Te,Results:ss,SEMrushRelatedKeyphrases:is},helpers:{ajaxHelper:o,createInterpolateElement:Oe,createWatcher:(e,s)=>{let t=e();return()=>{const r=e();(0,l.isEqual)(r,t)||(t=r,s((0,l.clone)(r)))}},isBlockEditor:function(){return window.wpseoScriptData&&"1"===window.wpseoScriptData.isBlockEditor},i18n:{setTextdomainL10n:function(e,s="wpseoYoastJSL10n"){const t=(0,l.get)(window,[s,e,"locale_data",e],!1);"yoast-components"===e&&(e="wordpress-seo"),!1===t?(0,d.setLocaleData)({"":{}},e):(0,d.setLocaleData)(t,e)}},replacementVariableHelpers:i,publishBox:{updateScore:function(e,s,t=null){var r=Rs("#"+e+"-score"),o=Cs+" "+s;r.children(".image").attr("class",o);var i=Es(e,s,t);r.children("."+_s).html(i)},createScoresInPublishBox:function(e,s,t=null){const r=Rs("<div />",{class:"misc-pub-section yoast yoast-seo-score "+e+"-score",id:e+"-score"}),o=Rs("<span />",{class:_s,html:Es(e,s,t)}),i=Rs("<span>").attr("class",Cs+" na");r.append(i).append(o),Rs("#yoast-seo-publishbox-section").append(r)},scrollToCollapsible:function(e){const s=Rs("#wpadminbar"),t=Rs(e);if(!s||!t)return;const r="fixed"===s.css("position")?s.height():0;Rs([document.documentElement,document.body]).animate({scrollTop:t.offset().top-r},1e3),t.trigger("focus"),0===t.parent().siblings().length&&t.trigger("click")}},updateAdminBar:function(e){jQuery("#wp-admin-bar-wpseo-menu .wpseo-score-icon").attr("title",e.screenReaderText).attr("class","wpseo-score-icon "+e.className).find(".wpseo-score-text").text(e.screenReaderText)},updateTrafficLight:function(e){var s=jQuery(".yst-traffic-light"),t=s.closest(".wpseo-meta-section-link"),r=jQuery("#wpseo-traffic-light-desc"),o=e.className||"na";s.attr("class","yst-traffic-light "+o),t.attr("aria-describedby","wpseo-traffic-light-desc"),r.length>0?r.text(e.screenReaderText):t.closest("li").append("<span id='wpseo-traffic-light-desc' class='screen-reader-text'>"+e.screenReaderText+"</span>")}}}})()})(); | |