105 lines
35 KiB
JavaScript
105 lines
35 KiB
JavaScript
window.yoast=window.yoast||{},window.yoast.components=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return 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 o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));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=401)}({0:function(e,t){e.exports=window.yoast.propTypes},1:function(e,t){e.exports=window.wp.element},10:function(e,t){e.exports=window.yoast.helpers},110:function(e,t){e.exports=window.yoast.jed},12: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.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},16:function(e,t){e.exports=window.yoast.replacementVariableEditor},19:function(e,t){e.exports=window.yoast.redux},195:function(e,t,n){var r,o,i;o=[e,n(324),n(326),n(327)],void 0===(i="function"==typeof(r=function(e,t,n,r){"use strict";var o=a(t),i=a(n),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}var l="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},u=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.resolveOptions(n),r.listenClick(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),u(t,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===l(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=(0,s.default)(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new o.default({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return d("action",e)}},{key:"defaultTarget",value:function(e){var t=d("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return d("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}]),t}(i.default);function d(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}e.exports=c})?r.apply(t,o):r)||(e.exports=i)},196:function(e,t){e.exports=window.lodash.assign},197:function(e,t){e.exports=window.lodash.isUndefined},2:function(e,t){e.exports=window.lodash},26: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},o=a(n(3)),i=a(n(53)),s=a(n(56));function a(e){return e&&e.__esModule?e:{default:e}}var l=void 0;t.default=function(e){var t=e.mixedString,n=e.components,a=e.throwErrors;if(l=t,!n)return t;if("object"!==(void 0===n?"undefined":r(n))){if(a)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,a,u,c,d,f,p,g,h=[],y={};for(f=0;f<t.length;f++)if("string"!==(d=t[f]).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> "+l);if("componentClose"===d.type)throw new Error("Missing opening component token: `"+d.value+"`");if("componentOpen"===d.type){s=n[d.value],u=f;break}h.push(n[d.value])}else h.push(d.value);return s&&(c=function(e,t){var n,r,o=t[e],i=0;for(r=e+1;r<t.length;r++)if((n=t[r]).value===o.value){if("componentOpen"===n.type){i++;continue}if("componentClose"===n.type){if(0===i)return r;i--}}throw new Error("Missing closing component token `"+o.value+"`")}(u,t),p=e(t.slice(u+1,c),n),a=o.default.cloneElement(s,{},p),h.push(a),c<t.length-1&&(g=e(t.slice(c+1),n),h=h.concat(g))),1===h.length?h[0]:(h.forEach((function(e,t){e&&(y["interpolation-child-"+t]=e)})),(0,i.default)(y))}(u,n)}catch(e){if(a)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},3:function(e,t){e.exports=window.React},32:function(e,t){e.exports=window.yoast.analysisReport},324:function(e,t,n){var r,o,i;o=[e,n(325)],void 0===(i="function"==typeof(r=function(e,t){"use strict";var n,r=(n=t)&&n.__esModule?n:{default:n},o="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},i=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return i(e,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,r.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,r.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":o(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}();e.exports=s})?r.apply(t,o):r)||(e.exports=i)},325:function(e,t){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},326:function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,s=r.length;i<s;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=n,e.exports.TinyEmitter=n},327:function(e,t,n){var r=n(328),o=n(329);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},328:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},329:function(e,t,n){var r=n(330);function o(e,t,n,r,o){var s=i.apply(this,arguments);return e.addEventListener(n,s,o),{destroy:function(){e.removeEventListener(n,s,o)}}}function i(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}e.exports=function(e,t,n,r,i){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,n,r,i)})))}},330:function(e,t){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},35:function(e,t){e.exports=window.lodash.omit},36:function(e,t){e.exports=window.wp.a11y},37:function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},4:function(e,t){e.exports=window.wp.i18n},401:function(e,t,n){"use strict";n.r(t),n.d(t,"OnboardingWizard",(function(){return qe})),n.d(t,"MessageBox",(function(){return Ge})),n.d(t,"LinkSuggestions",(function(){return B})),n.d(t,"ContentAnalysis",(function(){return g.ContentAnalysis})),n.d(t,"Collapsible",(function(){return i.Collapsible})),n.d(t,"ButtonSection",(function(){return p})),n.d(t,"LoadingIndicator",(function(){return Xe})),n.d(t,"CornerstoneToggle",(function(){return S})),n.d(t,"sendRequest",(function(){return r.sendRequest})),n.d(t,"decodeHTML",(function(){return r.decodeHTML})),n.d(t,"getRtlStyle",(function(){return Ke})),n.d(t,"colors",(function(){return o.colors})),n.d(t,"DashboardWidgetSeoAssessment",(function(){return g.SiteSEOReport})),n.d(t,"DashboardWidgetWordpressFeed",(function(){return i.ArticleList})),n.d(t,"AnalysisList",(function(){return g.AnalysisList})),n.d(t,"renderRatingToColor",(function(){return g.renderRatingToColor})),n.d(t,"FixedWidthContainer",(function(){return W.FixedWidthContainer})),n.d(t,"HelpTextWrapper",(function(){return W.HelpTextWrapper})),n.d(t,"SnippetPreview",(function(){return W.SnippetPreview})),n.d(t,"SettingsSnippetEditor",(function(){return W.SettingsSnippetEditor})),n.d(t,"SnippetEditor",(function(){return W.SnippetEditor})),n.d(t,"lengthProgressShape",(function(){return W.lengthProgressShape})),n.d(t,"ReplacementVariableEditor",(function(){return H.ReplacementVariableEditor})),n.d(t,"recommendedReplacementVariablesShape",(function(){return H.recommendedReplacementVariablesShape})),n.d(t,"replacementVariablesShape",(function(){return H.replacementVariablesShape})),n.d(t,"utils",(function(){return V})),n.d(t,"localize",(function(){return ee})),n.d(t,"setTranslations",(function(){return J})),n.d(t,"translate",(function(){return Z})),n.d(t,"analysis",(function(){return Ae})),n.d(t,"WordpressFeed",(function(){return i.ArticleList})),n.d(t,"SeoAssessment",(function(){return g.SiteSEOReport})),n.d(t,"KeywordInput",(function(){return He})),n.d(t,"insightsReducer",(function(){return ze})),n.d(t,"setWordsForInsights",(function(){return $e})),n.d(t,"setReadabilityResults",(function(){return ne})),n.d(t,"setSeoResultsForKeyword",(function(){return te})),n.d(t,"setInclusiveLanguageResults",(function(){return re})),n.d(t,"setOverallReadabilityScore",(function(){return oe})),n.d(t,"setOverallSeoScore",(function(){return ie})),n.d(t,"setOverallInclusiveLanguageScore",(function(){return se})),n.d(t,"Card",(function(){return i.Card})),n.d(t,"FullHeightCard",(function(){return i.FullHeightCard})),n.d(t,"CardBanner",(function(){return i.CardBanner})),n.d(t,"CardDetails",(function(){return i.CourseDetails})),n.d(t,"HelpText",(function(){return i.HelpText})),n.d(t,"Icon",(function(){return i.Icon})),n.d(t,"KeywordSuggestions",(function(){return i.KeywordSuggestions})),n.d(t,"WordOccurrenceInsights",(function(){return i.WordOccurrenceInsights})),n.d(t,"LanguageNotice",(function(){return i.LanguageNotice})),n.d(t,"Loader",(function(){return i.Loader})),n.d(t,"ScoreAssessments",(function(){return i.ScoreAssessments})),n.d(t,"SvgIcon",(function(){return i.SvgIcon})),n.d(t,"SynonymsInput",(function(){return i.SynonymsInput})),n.d(t,"UpsellButton",(function(){return i.UpsellButton})),n.d(t,"UpsellLinkButton",(function(){return i.UpsellLinkButton})),n.d(t,"YoastButton",(function(){return i.YoastButton})),n.d(t,"YoastModal",(function(){return i.Modal})),n.d(t,"YoastSeoIcon",(function(){return i.YoastSeoIcon})),n.d(t,"YoastWarning",(function(){return i.Warning})),n.d(t,"StyledSection",(function(){return i.StyledSection})),n.d(t,"StyledHeading",(function(){return i.StyledHeading})),n.d(t,"StyledSectionBase",(function(){return i.StyledSectionBase}));var r=n(10),o=n(6),i=n(9),s=n(1),a=n(0),l=n.n(a),u=n(3),c=n.n(u);const d=Object(i.wrapInHeading)(i.StyledIconsButton,{level:2,fontSize:"1rem",fontWeight:"normal"}),f=e=>{const t=e.hasSeparator?i.StyledContainerTopLevel:i.StyledContainer;return Object(s.createElement)(t,{onClick:e.onClick,className:e.className},Object(s.createElement)(e.Heading,{prefixIcon:e.prefixIcon,suffixIcon:e.suffixIcon,hasSubTitle:!!e.subTitle,id:e.id},Object(s.createElement)(i.SectionTitle,{title:e.title,titleScreenReaderText:e.titleScreenReaderText,subTitle:e.subTitle})))};f.propTypes={hasSeparator:l.a.bool,className:l.a.string,Heading:l.a.func,prefixIcon:l.a.shape({icon:l.a.string,color:l.a.string,size:l.a.string}),suffixIcon:l.a.shape({icon:l.a.string,color:l.a.string,size:l.a.string}),subTitle:l.a.string,title:l.a.string.isRequired,titleScreenReaderText:l.a.string,onClick:l.a.func.isRequired,id:l.a.string},f.defaultProps={Heading:d,id:null};var p=f,g=n(32),h=n(5),y=n.n(h),b=n(4);const m=y.a.div`
|
|
display: flex;
|
|
margin-top: 8px;
|
|
`;class v extends c.a.Component{render(){return Object(s.createElement)(m,null,Object(s.createElement)(i.Toggle,{id:this.props.id,labelText:Object(b.__)("Mark as cornerstone content","wordpress-seo"),isEnabled:this.props.isEnabled,onSetToggleState:this.props.onToggle,onToggleDisabled:this.props.onToggleDisabled}))}}v.propTypes={id:l.a.string,isEnabled:l.a.bool,onSetToggleState:l.a.func,onToggle:l.a.func,disable:l.a.bool,onToggleDisabled:l.a.func},v.defaultProps={id:"cornerstone-toggle"};var S=v,E=n(12),w=n.n(E);const x=y.a.div`
|
|
display: flex;
|
|
align-items: center;
|
|
min-height: 40px;
|
|
margin-bottom: 5px;
|
|
`,O=y.a.button`
|
|
box-sizing: border-box;
|
|
height: 30px;
|
|
width: 30px;
|
|
background-color: ${o.colors.$color_button};
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
outline:none;
|
|
margin-right: 8px;
|
|
border: 1px solid ${o.colors.$color_button_border};
|
|
|
|
&:focus {
|
|
box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8);
|
|
}
|
|
`,_=Object(r.makeOutboundLink)(y.a.a`
|
|
max-width: 128px;
|
|
padding: 6px 0;
|
|
margin-right: 8px;
|
|
`),T=y.a.span`
|
|
max-width: 75px;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
text-align: center;
|
|
display: block;
|
|
padding: 3px 8px;
|
|
margin-left: auto;
|
|
font-size: 0.85em;
|
|
background-color: #f3f4f5;
|
|
border-radius: 2px;
|
|
`,k=e=>{let{value:t,url:n,isActive:r,type:a}=e;const l=Object(b.__)("Copy link","wordpress-seo"),u=Object(b.sprintf)(
|
|
/* translators: %s expands to the link value */
|
|
Object(b.__)("Copy link to suggested article: %s","wordpress-seo"),t);let c="clipboard";return r&&(c="check"),Object(s.createElement)(x,null,Object(s.createElement)(O,{type:"button",className:"yoast-link-suggestion__copy yoast-tooltip yoast-tooltip-alt yoast-tooltip-s",onBlur:e=>{e.nativeEvent.target.setAttribute("aria-label",u),e.nativeEvent.target.setAttribute("data-label",l)},"data-clipboard-text":n,"aria-label":u,"data-label":l},Object(s.createElement)(i.SvgIcon,{icon:c,color:o.colors.$color_grey_dark}),Object(s.createElement)(i.ScreenReaderText,null,l)),Object(s.createElement)(_,{href:n},t),Object(s.createElement)(T,{title:a},a))};k.propTypes={value:l.a.string.isRequired,url:l.a.string.isRequired,isActive:l.a.bool,type:l.a.string.isRequired},k.defaultProps={isActive:!1};var A=k,j=n(195),L=n.n(j),C=n(26),R=n.n(C),N=n(36);const I=Object(r.makeOutboundLink)(),M=y.a.div`
|
|
display: table-cell;
|
|
`,P=Object(b.__)("We could not find any relevant articles on your website that you could link to from your post.","wordpress-seo"),F=Object(b.__)("{{a}}Read our article about site structure{{/a}} to learn more about how internal linking can help improve your SEO.","wordpress-seo"),U=Object(b.__)("Consider linking to these {{a}}cornerstone articles:{{/a}}","wordpress-seo"),D=Object(b.__)("Consider linking to these articles:","wordpress-seo");class Y extends c.a.Component{constructor(e){super(e),this.state={clipboard:new L.a(".yoast-link-suggestion__copy")},this.state.clipboard.on("success",this.handleSuccess.bind(this)),this.state.clipboard.on("error",this.handleError.bind(this))}handleSuccess(e){const t=Object(b.__)("Copied!","wordpress-seo");e.trigger.focus(),e.trigger.setAttribute("aria-label",t),e.trigger.setAttribute("data-label",t),Object(N.speak)(t,"assertive")}handleError(e){const t=Object(b.__)("Not supported!","wordpress-seo");e.trigger.el.setAttribute("aria-label",t),e.trigger.setAttribute("data-label",t),Object(N.speak)(t,"assertive")}renderEmptyList(){let e=this.props.customMessages.lengthMessage;return e=""===e?P:e,Object(s.createElement)("div",null,Object(s.createElement)("p",null,e),Object(s.createElement)("p",null,this.props.customMessages.metaMessage),Object(s.createElement)("p",null,this.getArticleLink()))}render(){const e=this.props.suggestions,t=this.props.maxSuggestions;if(0===e.length)return this.renderEmptyList();e.length>t&&(e.length=t);const n=this.getCornerstoneSuggestions(),r=this.getDefaultSuggestions();return Object(s.createElement)(M,null,n,r,Object(s.createElement)("p",null,this.getArticleLink()),Object(s.createElement)("p",null,this.props.customMessages.metaMessage))}getCornerstoneSuggestions(){const e=this.filterSuggestionsByCornerstone(!0);if(0===e.length)return null;const t=R()({mixedString:U,components:{a:Object(s.createElement)(I,{href:"https://yoa.st/metabox-ls-help-cornerstone"})}});return this.getSuggestionsList(t,e)}getDefaultSuggestions(){const e=this.filterSuggestionsByCornerstone(!1);return 0===e.length?null:this.getSuggestionsList(D,e)}getArticleLink(){return R()({mixedString:F,components:{a:Object(s.createElement)(I,{href:"https://yoa.st/site-structure-metabox"})}})}getSuggestionsList(e,t){return Object(s.createElement)("div",null,Object(s.createElement)("p",null,e),t.map((e,t)=>Object(s.createElement)(A,w()({key:t},e))))}filterSuggestionsByCornerstone(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.props.suggestions.filter(t=>t.isCornerstone===e)}}Y.propTypes={suggestions:l.a.array.isRequired,maxSuggestions:l.a.number,customMessages:l.a.object},Y.defaultProps={maxSuggestions:10,customMessages:{lengthMessage:"",metaMessage:""}};var B=Y,W=n(47),H=n(16),$=n(2),V={getFeed:r.getFeed,getCourseFeed:r.getCourseFeed,getPostFeed:r.getPostFeed,makeOutboundLink:r.makeOutboundLink,buildStructuredUrl:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Object.keys(t);let r=e;return n.forEach(e=>{const n=t[e],o=Object($.isArray)(n)?n.join("/"):n,i=`%${e}%`;r=r.replace(new RegExp(i,"g"),o)}),r}},z=n(110),K=n.n(z),q=n(196),G=n.n(q),X=null;function J(e){X=new K.a(e)}function Q(){return null===X&&(X=new K.a({})),X}function Z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=Q();return""===t?r.gettext(e):r.ngettext(e,t,n)}function ee(e){const t=e.displayName||e.name||"",n={translate:Z};class r extends c.a.Component{constructor(e){super(e),this.displayName="Localized"+t}render(){const t=G()({},this.props,n);return Object(s.createElement)(e,t)}}return r}function te(e,t){return{type:"CONTENT_ANALYSIS_SET_SEO_RESULTS_FOR_KEYWORD",keyword:e,results:t}}function ne(e){return{type:"CONTENT_ANALYSIS_SET_READABILITY_RESULTS",results:e}}function re(e){return{type:"CONTENT_ANALYSIS_SET_INCLUSIVE_LANGUAGE_RESULTS",results:e}}function oe(e){return{type:"CONTENT_ANALYSIS_SET_OVERALL_READABILITY_SCORE",overallScore:e}}function ie(e,t){return{type:"CONTENT_ANALYSIS_SET_OVERALL_SEO_SCORE",keyword:t,overallScore:e}}function se(e){return{type:"CONTENT_ANALYSIS_SET_OVERALL_INCLUSIVE_LANGUAGE_SCORE",overallScore:e}}var ae=n(89),le=n.n(ae),ue=n(197),ce=n.n(ue);const de={};function fe(e,t){return Object.assign({},e,{results:t.results})}function pe(e,t){if(ce()(e.results))return Object.assign({},e,{results:[t.result]});const n=le()(e.results,{id:t.result.id});if(-1!==n){const r=e.results.filter((function(t){return t!==e.results[n]}));return Object.assign({},e,{results:r.concat(t.result)})}return Object.assign({},e,{results:[...e.results,t.result]})}function ge(e,t){return Object.assign({},e,{overallScore:t.overallScore})}var he=n(35),ye=n.n(he);const be={};function me(e,t,n){return Object.assign({},e,{[t]:{results:n}})}function ve(e,t){return e[t.keyword]?-1!==le()(e[t.keyword].results,{id:t.result.id})?function(e,t){const n=Array.from(e[t.keyword].results,e=>e.id===t.result.id?t.result:e);return Object.assign({},e,{[t.keyword]:{results:n}})}(e,t):Object.assign({},e,{[t.keyword]:{results:[...e[t.keyword].results,t.result]}}):me(e,t.keyword,[t.result])}function Se(e,t){return e[t.keyword]?Object.assign({},e,{[t.keyword]:{results:t.results}}):me(e,t.keyword,t.results)}function Ee(e){const t={};return e.resultsPerKeyword.forEach((function(e){t[e.keyword]={results:e.results}})),t}function we(e,t){return Object.assign({},e,{[t.keyword]:{...e[t.keyword],overallScore:t.overallScore}})}const xe={results:[],overallScore:null};function Oe(e,t){return Object.assign({},e,{results:t.results})}function _e(e,t){if(Object($.isUndefined)(e.results))return Object.assign({},e,{results:[t.result]});const n=Object($.findIndex)(e.results,{id:t.result.id});if(-1!==n){const r=e.results.filter((function(t){return t!==e.results[n]}));return Object.assign({},e,{results:r.concat(t.result)})}return Object.assign({},e,{results:[...e.results,t.result]})}function Te(e,t){return Object.assign({},e,{overallScore:t.overallScore})}var ke=n(19),Ae=Object(ke.combineReducers)({seo:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:be,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CONTENT_ANALYSIS_SET_SEO_RESULTS":return Ee(t);case"CONTENT_ANALYSIS_UPDATE_SEO_RESULT":return ve(e,t);case"CONTENT_ANALYSIS_REMOVE_KEYWORD":return ye()(e,t.keyword);case"CONTENT_ANALYSIS_SET_SEO_RESULTS_FOR_KEYWORD":return Se(e,t);case"CONTENT_ANALYSIS_SET_OVERALL_SEO_SCORE":return we(e,t);default:return e}},readability:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CONTENT_ANALYSIS_SET_READABILITY_RESULTS":return fe(e,t);case"CONTENT_ANALYSIS_UPDATE_READABILITY_RESULT":return pe(e,t);case"CONTENT_ANALYSIS_SET_OVERALL_READABILITY_SCORE":return ge(e,t);default:return e}},inclusiveLanguage:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xe,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CONTENT_ANALYSIS_SET_INCLUSIVE_LANGUAGE_RESULTS":return Oe(e,t);case"CONTENT_ANALYSIS_UPDATE_INCLUSIVE_LANGUAGE_RESULT":return _e(e,t);case"CONTENT_ANALYSIS_SET_OVERALL_INCLUSIVE_LANGUAGE_SCORE":return Te(e,t);default:return e}}});const je=o.colors.$color_bad,Le=o.colors.$palette_error_background,Ce=o.colors.$color_grey_text_light,Re=o.colors.$palette_error_text,Ne=y.a.div`
|
|
display: flex;
|
|
flex-direction: column;
|
|
`,Ie=y.a.label`
|
|
font-size: var(--yoast-font-size-default);
|
|
font-weight: var(--yoast-font-weight-bold);
|
|
${Object(r.getDirectionalStyle)("margin-right: 4px","margin-left: 4px")};
|
|
`,Me=y.a.span`
|
|
margin-bottom: 0.5em;
|
|
`,Pe=y()(i.InputField)`
|
|
flex: 1 !important;
|
|
box-sizing: border-box;
|
|
max-width: 100%;
|
|
margin: 0; // Reset margins inherited from WordPress.
|
|
|
|
// Hide native X in Edge and IE11.
|
|
&::-ms-clear {
|
|
display: none;
|
|
}
|
|
|
|
&.has-error {
|
|
border-color: ${je} !important;
|
|
background-color: ${Le} !important;
|
|
|
|
&:focus {
|
|
box-shadow: 0 0 2px ${je} !important;
|
|
}
|
|
}
|
|
`,Fe=y.a.ul`
|
|
color: ${Re};
|
|
list-style-type: disc;
|
|
list-style-position: outside;
|
|
margin: 0;
|
|
margin-left: 1.2em;
|
|
`,Ue=y.a.li`
|
|
color: ${Re};
|
|
margin: 0 0 0.5em 0;
|
|
`,De=Object(i.addFocusStyle)(y.a.button`
|
|
border: 1px solid transparent;
|
|
box-shadow: none;
|
|
background: none;
|
|
flex: 0 0 32px;
|
|
height: 32px;
|
|
max-width: 32px;
|
|
padding: 0;
|
|
cursor: pointer;
|
|
`);De.propTypes={type:l.a.string,focusColor:l.a.string,focusBackgroundColor:l.a.string,focusBorderColor:l.a.string},De.defaultProps={type:"button",focusColor:o.colors.$color_button_text_hover,focusBackgroundColor:"transparent",focusBorderColor:o.colors.$color_blue};const Ye=y()(i.SvgIcon)`
|
|
margin-top: 4px;
|
|
`,Be=y.a.div`
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
|
|
&.has-remove-keyword-button {
|
|
${Pe} {
|
|
${Object(r.getDirectionalStyle)("padding-right: 40px","padding-left: 40px")};
|
|
}
|
|
|
|
${De} {
|
|
${Object(r.getDirectionalStyle)("margin-left: -32px","margin-right: -32px")};
|
|
}
|
|
}
|
|
`;class We extends c.a.Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){this.props.onChange(e.target.value)}renderLabel(){const{id:e,label:t,helpLink:n}=this.props;return Object(s.createElement)(Me,null,Object(s.createElement)(Ie,{htmlFor:e},t),n)}renderErrorMessages(){const e=[...this.props.errorMessages];return!Object($.isEmpty)(e)&&Object(s.createElement)(Fe,null,e.map((e,t)=>Object(s.createElement)(Ue,{key:t},Object(s.createElement)("span",{role:"alert"},e))))}render(){const{id:e,showLabel:t,keyword:n,onRemoveKeyword:r,onBlurKeyword:o,onFocusKeyword:i,hasError:a}=this.props,l=!t,u=r!==$.noop;return Object(s.createElement)(Ne,null,t&&this.renderLabel(),a&&this.renderErrorMessages(),Object(s.createElement)(Be,{className:u?"has-remove-keyword-button":null},Object(s.createElement)(Pe,{"aria-label":l?this.props.label:null,type:"text",id:e,className:a?"has-error":null,onChange:this.handleChange,onFocus:i,onBlur:o,value:n,autoComplete:"off"}),u&&Object(s.createElement)(De,{onClick:r,focusBoxShadowColor:"#084A67"},Object(s.createElement)(Ye,{size:"18px",icon:"times-circle",color:Ce}))))}}We.propTypes={id:l.a.string.isRequired,showLabel:l.a.bool,keyword:l.a.string,onChange:l.a.func.isRequired,onRemoveKeyword:l.a.func,onBlurKeyword:l.a.func,onFocusKeyword:l.a.func,label:l.a.string.isRequired,helpLink:l.a.node,hasError:l.a.bool,errorMessages:l.a.arrayOf(l.a.string)},We.defaultProps={showLabel:!0,keyword:"",onRemoveKeyword:$.noop,onBlurKeyword:$.noop,onFocusKeyword:$.noop,helpLink:null,hasError:!1,errorMessages:[]};var He=We;function $e(e){return{type:"SET_WORDS_FOR_INSIGHTS",wordsForInsights:e}}const Ve=[],ze=Object(ke.combineReducers)({prominentWords:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ve,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_WORDS_FOR_INSIGHTS":return t.wordsForInsights;default:return e}}}),Ke=r.getDirectionalStyle,qe=()=>(console.warn("Deprecation Warning: Deprecated since 5.13.1. Use the `OnboardingWizard` from the `@yoast/configuration-wizard` package instead."),null),Ge=()=>(console.warn("Deprecation Warning: Deprecated since 5.13.1. Use the `MessageBox` from the `@yoast/configuration-wizard` package instead."),null),Xe=()=>(console.warn("Deprecation Warning: Deprecated since 5.13.1. Use the `LoadingIndicator` from the `@yoast/configuration-wizard` package instead."),null)},47:function(e,t){e.exports=window.yoast.searchMetadataPreviews},5:function(e,t){e.exports=window.yoast.styledComponents},53:function(e,t,n){"use strict";var r=n(3),o="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,i=n(37),s=n(54),a=n(55),l="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 c=/\/+/g;function d(e){return(""+e).replace(c,"$&/")}var f,p,g=h,h=function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)};function y(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function b(e,t,n){var o,s,a=e.result,l=e.keyPrefix,u=e.func,c=e.context,f=u.call(c,t,e.count++);Array.isArray(f)?m(f,a,n,i.thatReturnsArgument):null!=f&&(r.isValidElement(f)&&(o=f,s=l+(!f.key||t&&t.key===f.key?"":d(f.key)+"/")+n,f=r.cloneElement(o,{key:s},void 0!==o.props?o.props.children:void 0)),a.push(f))}function m(e,t,n,r,i){var a="";null!=n&&(a=d(n)+"/");var c=y.getPooled(t,a,r,i);!function(e,t,n){null==e||function e(t,n,r,i){var a,c=typeof t;if("undefined"!==c&&"boolean"!==c||(t=null),null===t||"string"===c||"number"===c||"object"===c&&t.$$typeof===o)return r(i,t,""===n?"."+u(t,0):n),1;var d=0,f=""===n?".":n+":";if(Array.isArray(t))for(var p=0;p<t.length;p++)d+=e(a=t[p],f+u(a,p),r,i);else{var g=function(e){var t=e&&(l&&e[l]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(g)for(var h,y=g.call(t),b=0;!(h=y.next()).done;)d+=e(a=h.value,f+u(a,b++),r,i);else if("object"===c){var m=""+t;s(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===m?"object with keys {"+Object.keys(t).join(", ")+"}":m,"")}}return d}(e,"",t,n)}(e,b,c),y.release(c)}y.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},f=function(e,t,n,r){if(this.instancePool.length){var o=this.instancePool.pop();return this.call(o,e,t,n,r),o}return new this(e,t,n,r)},(p=y).instancePool=[],p.getPooled=f||g,p.poolSize||(p.poolSize=10),p.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 a(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(r.isValidElement(e))return a(!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)m(e[n],t,n,i.thatReturnsArgument);return t}},54:function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,s,a){if(!e){var l;if(void 0===t)l=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,o,i,s,a],c=0;(l=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},55:function(e,t,n){"use strict";var r=n(37);e.exports=r},56: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)}},6:function(e,t){e.exports=window.yoast.styleGuide},89:function(e,t){e.exports=window.lodash.findIndex},9:function(e,t){e.exports=window.yoast.componentsNew}}); |