1 line
29 KiB
JavaScript
1 line
29 KiB
JavaScript
(window.yoastPremiumWebpackJsonp=window.yoastPremiumWebpackJsonp||[]).push([[11],{0:function(e,t){e.exports=React},1:function(e,t){e.exports=window.lodash},11:function(e,t){e.exports=window.yoast.componentsNew},123:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){var o=!0;var r=!1;var a=void 0;try{for(var i,s=t[Symbol.iterator]();!(o=(i=s.next()).done);o=!0){var l=i.value;n(l),l.innerBlocks&&e(l.innerBlocks,n)}}catch(e){r=!0,a=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw a}}}},13:function(e,t){e.exports=window.wp.components},14:function(e,t){e.exports=window.yoast.styledComponents},16:function(e,t){e.exports=window.yoast.helpers},176:function(e,t,n){"use strict";var o=n(1),r=i(n(177)),a=i(n(178));function i(e){return e&&e.__esModule?e:{default:e}}(0,r.default)(),(0,o.get)(window,"wpseoTOCData.data.disableTableOfContents",!1)||(0,a.default)()},177:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};t.default=function(){(0,l.default)(function(){window.wpseoPremiumMetaboxData?function(){var e=(0,s.select)("core/block-editor").getBlocks(),t=_(),n=k();(0,s.subscribe)(function(){var o=(0,s.select)("core/block-editor").getBlocks(),r=_(),a=k(),i=!(0,d.isEqual)(e,o),l=!(0,d.isEqual)(t,r),u=!(0,d.isEqual)(n,a);(i||l||u)&&(0,f.default)(o,function(e){"yoast-seo/related-links"===e.name&&(i&&"loading"===e.attributes.status?v(e.clientId):(l&&"no-content"===e.attributes.status&&v(e.clientId),u&&"loaded"!==e.attributes.status&&v(e.clientId)))}),e=o,t=r,n=a})}():(0,r.unregisterBlockType)("yoast-seo/related-links")}),(0,r.registerBlockType)("yoast-seo/related-links",{title:(0,c.__)("Yoast Related Links","wordpress-seo-premium"),icon:"editor-ul",category:"yoast-internal-linking-blocks",description:(0,c.__)("Adds a list of links related to this page.","wordpress-seo-premium"),keywords:[(0,c.__)("seo","wordpress-seo-premium"),(0,c.__)("internal linking","wordpress-seo-premium"),(0,c.__)("site structure","wordpress-seo-premium"),(0,c.__)("related posts","wordpress-seo-premium"),(0,c.__)("related pages","wordpress-seo-premium")],attributes:{status:{type:"string",default:"loading"},values:{type:"string",source:"html",selector:"ul",multiline:"li",default:""}},example:{attributes:{status:"loaded",values:"<li><a href='https://example.org'>Related link 1</a></li><li><a href='https://example.org'>Related link 2</a></li><li><a href='https://example.org'>Related link 3</a></li>"}},edit:y,save:function(e){var t=e.attributes;return"loaded"!==t.status?null:wp.element.createElement(a.RichText.Content,{tagName:"ul",multiline:"li",value:t.values})}})};var r=n(60),a=n(71),i=n(13),s=n(5),l=g(n(18)),u=n(3),c=n(2),d=n(1),p=n(56),m=g(n(46)),f=g(n(123));function g(e){return e&&e.__esModule?e:{default:e}}var h=window.yoast.editorModules.helpers.createInterpolateElement;function w(e,t,n,o){t!==n&&o(e,{status:t})}function v(e){if((0,s.select)("yoast-seo-premium/editor")){(0,d.get)(YoastSEO,"analysis.linkSuggester")&&YoastSEO.analysis.linkSuggester.update();var t=(0,s.select)("yoast-seo-premium/editor").linkSuggestionsAreLoading,n=(0,(0,s.select)("core/block-editor").getBlockAttributes)(e);"loaded"!==n.status&&(t()?setTimeout(v.bind(null,e),500):function(e,t){var n=(0,s.select)("yoast-seo-premium/editor"),o=n.linkSuggestionsAreUnindexed,r=n.getLinkSuggestions,a=n.getWordsForLinking,i=(0,s.dispatch)("core/block-editor").updateBlockAttributes;if(o())w(e,"unindexed",t.status,i);else{var l=a();if(Array.isArray(l)&&0!==l.length){var u=r();0!==u.length?"loading"===t.status?i(e,{values:u.map(function(e){return'<li><a href="'+e.url+'">'+e.value+"</a></li>"}).join(""),status:"loaded"}):w(e,"has-suggestions",t.status,i):w(e,"no-suggestions",t.status,i)}else w(e,"no-content",t.status,i)}}(e,n))}else setTimeout(v.bind(null,e),500)}function b(e){var t="notice notice-"+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"warning")+" notice-alt wpseo-notice-breakout-inside yoast-links-suggestions-notice";return wp.element.createElement("div",{className:t},wp.element.createElement("p",null,e))}function y(e){var t=e.clientId,n=e.attributes,s=e.setAttributes,l=e.mergeBlocks,d=e.onReplace,f=n.values,g=n.status,w=function(){s({status:"loading"}),v(t)};(0,u.useEffect)(function(){"loaded"!==g&&w()},[]);var y=(0,u.useCallback)(function(e){s({values:e})},[s]),k=(0,u.useCallback)(function(e){(0,r.createBlock)(name,o({},n,{values:e}))},[n]),_=(0,u.useCallback)(function(){d([])},d);if(!(0,m.default)()&&"loaded"!==g)return b(h((0,c.__)("You have disabled Link suggestions, which is needed for Related links to work. If you want to add Related links, please go to <a>Site features</a> and enable Link suggestions.","wordpress-seo-premium"),{a:wp.element.createElement("a",{href:wpseoPremiumMetaboxData.data.settingsPageUrl,target:"_blank"},"#21441-gutenberg")}),"error");if("loaded"!==g)return function(e,t){if("unindexed"===e)return(0,p.getUnindexedWarning)();var n=(0,c.__)("We could not find any relevant articles on your website that you could link to from your post.","wordpress-seo-premium");return"no-content"===e&&(n=(0,c.__)("Once you add a bit more copy, we'll give you a list of related content here to which you could link in your post.","wordpress-seo-premium")),"loading"===e&&(n=(0,c.__)("It takes a few seconds to show you a list of related content to which you could link. The suggestions will be shown here as soon as we have them.","wordpress-seo-premium")),"has-suggestions"===e&&(n=wp.element.createElement(u.Fragment,null,n,wp.element.createElement("br",null),wp.element.createElement("br",null),wp.element.createElement("button",{type:"button",className:"button",onClick:t},(0,c.__)("Load suggestions","wordpress-seo-premium")))),b(n)}(g,w);return wp.element.createElement(a.RichText,{identifier:"values",multiline:"li",tagName:"ul",onChange:y,value:f,placeholder:(0,c.__)("Write list…","wordpress-seo-premium"),onMerge:l,onSplit:k,onReplace:d,onRemove:_},function(){return wp.element.createElement(a.BlockControls,null,wp.element.createElement(i.ToolbarGroup,{controls:[{icon:"image-rotate",title:(0,c.__)("Refresh suggestions","wordpress-seo-premium"),isActive:!1,onClick:w}]}))})}function k(){return(0,s.select)("yoast-seo-premium/editor")?(0,s.select)("yoast-seo-premium/editor").getLinkSuggestions():null}function _(){return(0,s.select)("yoast-seo-premium/editor")?(0,s.select)("yoast-seo-premium/editor").getWordsForLinking():null}},178:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addAnchorOnParagraphToHeadingConversion=void 0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};t.default=function(){var e=(0,r.get)(window,"wpseoTOCData.data",{}).TOCTitle;(0,u.default)(function(){!function(){var e=null,t="",n=!1,o=[],i={};(0,l.subscribe)(function(){if(!n){var s=(0,l.select)("core/block-editor").getBlocks(),u=[];if(e!==s){var c=[],d=[],p="";n=!0;var m=v(s),g=m.every(function(e){return(0,r.isUndefined)(e)});(0,f.default)(s,function(e){if("core/heading"===e.name){var t=h((0,a.getBlockContent)(e)),n=e.attributes.level,s=function(e,t,n,o,i){var s=e.attributes.anchor,u=t[e.clientId],c=h((0,a.getBlockContent)(e));u&&u===c||s&&!s.startsWith("h-")||(s=function(e,t,n,o){if((0,r.isNil)(e.attributes.anchor)&&!o&&!(0,r.isEmpty)((0,a.getBlockContent)(e))&&!n.includes(e.clientId))return"";return w(e,t)}(e,n,o,i))!==e.attributes.anchor&&(0,l.dispatch)("core/block-editor").updateBlockAttributes(e.clientId,{anchor:s});return s}(e,i,u,o,g);if(i[e.clientId]=t,""===s||(0,r.isEmpty)(t))return;u.push(s),c.push({content:t,href:"#"+s,level:n}),p+="$"+n+":"+s+":"+t}else d.push(e.clientId)}),(0,f.default)(s,function(e){if("yoast-seo/table-of-contents"===e.name){var n=e.attributes.headings&&e.attributes.headings.length>0;(t!==p||c.length>0&&!n)&&(0,l.dispatch)("core/block-editor").updateBlockAttributes(e.clientId,{headings:c})}}),n=!1,t=p,o=d}e=s}})}()}),function(e){(0,a.registerBlockType)("yoast-seo/table-of-contents",{title:(0,d.__)("Yoast Table of Contents","wordpress-seo-premium"),icon:"editor-ul",category:"yoast-internal-linking-blocks",description:(0,d.__)("Adds a table of contents to this page.","wordpress-seo-premium"),keywords:[(0,d.__)("seo","wordpress-seo-premium"),(0,d.__)("links","wordpress-seo-premium"),(0,d.__)("site structure","wordpress-seo-premium"),(0,d.__)("toc","wordpress-seo-premium")],attributes:{title:{type:"string",source:"html",selector:"h2",default:e},level:{type:"number",default:2},maxHeadingLevel:{type:"number",default:3},headings:{type:"array",source:"query",selector:"a",query:{content:{type:"string",source:"html"},href:{type:"string",source:"attribute",attribute:"href"},level:{type:"string",source:"attribute",attribute:"data-level"}}}},example:{attributes:{headings:[{content:"Heading 1",href:"#heading-1",level:"2"},{content:"Subheading 1",href:"#subheading-1",level:"3"},{content:"Subheading 2",href:"#subheading-2",level:"3"},{content:"Heading 2",href:"#heading-2",level:"2"}]}},edit:function(e){var t=e.attributes,n=e.setAttributes,o=(0,c.useCallback)(function(e){return n({title:e})},[n]),r=(0,c.useCallback)(function(e){return n({level:e})},[n]),a=(0,c.useCallback)(function(e){return n({maxHeadingLevel:Number(e)})},[n]);return wp.element.createElement(c.Fragment,null,wp.element.createElement(i.BlockControls,null,wp.element.createElement(s.ToolbarGroup,null,wp.element.createElement(i.HeadingLevelDropdown,{value:t.level,options:[1,2,3,4,5,6],onChange:r}))),wp.element.createElement(i.InspectorControls,null,wp.element.createElement(s.PanelBody,{title:(0,d.__)("Settings","wordpress-seo"),className:"yoast-table-of-contents-controls"},wp.element.createElement(s.SelectControl,{label:(0,d.__)("Maximum heading level","wordpress-seo"),value:t.maxHeadingLevel,options:[1,2,3,4,5,6].map(function(e){return{label:(0,d.sprintf)((0,d.__)("Heading %d"),e),value:e}}),onChange:a}))),wp.element.createElement("div",{className:"yoast-table-of-contents"},wp.element.createElement(i.RichText,{tagName:"h"+t.level,value:t.title,onChange:o}),y(t.headings,t.maxHeadingLevel)))},save:function(e){var t=e.attributes,n=null;return t.title&&(n=wp.element.createElement(i.RichText.Content,{tagName:"h"+t.level,value:t.title})),wp.element.createElement("div",{className:"yoast-table-of-contents"},n,y(t.headings,t.maxHeadingLevel))},deprecated:[{attributes:{title:{type:"string",source:"html",selector:"h2",default:(0,d.__)("Table of contents","wordpress-seo-premium")},level:{type:"number",default:2},headings:{type:"array",source:"query",selector:"a",query:{content:{type:"string",source:"html"},href:{type:"string",source:"attribute",attribute:"href"},level:{type:"string",source:"attribute",attribute:"data-level"}}}},migrate:function(e){return o({maxHeadingLevel:6},e)},save:function(e){var t=e.attributes,n=null;return t.title&&(n=wp.element.createElement(i.RichText.Content,{tagName:"h"+t.level,value:t.title})),wp.element.createElement("div",{className:"yoast-table-of-contents"},n,y(t.headings))}}]})}(e)};var r=n(1),a=n(60),i=n(71),s=n(13),l=n(5),u=g(n(18)),c=n(3),d=n(2),p=n(21),m=n(9),f=g(n(123));function g(e){return e&&e.__esModule?e:{default:e}}var h=m.languageProcessing.stripHTMLTags;var w=function(e,t){for(var n="h-"+function(e){var t=new RegExp("[^\\p{L}\\p{N}]+","gu");return(0,r.trim)((0,r.deburr)(h(e)).replace(t,"-").toLowerCase(),"-")}((0,a.getBlockContent)(e)),o=n,i=0;t.includes(o);)o=n+"-"+i,i++;return o};var v=function(e){var t=[];return(0,f.default)(e,function(e){"core/heading"===e.name&&t.push(e.attributes.anchor)}),t};function b(e,t){for(var n=e;n&&n.level>=t;)n=n.parent;return n}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:99;return e&&0!==e.length?function e(t){var n=t.map(function(t){var n=null;return t.children&&t.children.length>0&&(n=e(t.children)),wp.element.createElement("li",{key:t.href},wp.element.createElement("a",{href:t.href,"data-level":t.level},t.content),n)});return wp.element.createElement("ul",null,n)}(e=function(e){var t=[],n=void 0,r=!0,a=!1,i=void 0;try{for(var s,l=e[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var u=s.value,c=parseInt(u.level,10),d=o({children:[],parent:null},u,{level:c}),p=b(n,c);p?(d.parent=p,p.children.push(d)):t.push(d),n=d}}catch(e){a=!0,i=e}finally{try{!r&&l.return&&l.return()}finally{if(a)throw i}}return t}(e=e.filter(function(e){return e.level<=t}))):null}var k=t.addAnchorOnParagraphToHeadingConversion=function(e){if((0,r.isNil)(e.attributes.anchor)&&"core/heading"===e.name){var t=(0,l.select)("core/block-editor").getBlocks(),n=v(t);e.attributes.anchor=w(e,n)}return e};(0,p.addFilter)("blocks.switchToBlockType.transformedBlock","yoast-seo-table-of-contents/transformed-block",k)},18:function(e,t){e.exports=window.wp.domReady},19:function(e,t){e.exports=window.wp.url},2:function(e,t){e.exports=window.wp.i18n},21:function(e,t){e.exports=window.wp.hooks},22:function(e,t,n){"use strict";function o(e){return function(){return e}}var r=function(){};r.thatReturns=o,r.thatReturnsFalse=o(!1),r.thatReturnsTrue=o(!0),r.thatReturnsNull=o(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},23:function(e,t){e.exports=window.yoast.styleGuide},25:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var 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},r=s(n(0)),a=s(n(38)),i=s(n(41));function s(e){return e&&e.__esModule?e:{default:e}}var l=void 0;function u(e,t){var n,i,s,c,d,p,m,f,g=[],h={};for(p=0;p<e.length;p++)if("string"!==(d=e[p]).type){if(!t.hasOwnProperty(d.value)||void 0===t[d.value])throw new Error("Invalid interpolation, missing component node: `"+d.value+"`");if("object"!==o(t[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){n=t[d.value],s=p;break}g.push(t[d.value])}else g.push(d.value);return n&&(c=function(e,t){var n,o,r=t[e],a=0;for(o=e+1;o<t.length;o++)if((n=t[o]).value===r.value){if("componentOpen"===n.type){a++;continue}if("componentClose"===n.type){if(0===a)return o;a--}}throw new Error("Missing closing component token `"+r.value+"`")}(s,e),m=u(e.slice(s+1,c),t),i=r.default.cloneElement(n,{},m),g.push(i),c<e.length-1&&(f=u(e.slice(c+1),t),g=g.concat(f))),1===g.length?g[0]:(g.forEach(function(e,t){e&&(h["interpolation-child-"+t]=e)}),(0,a.default)(h))}t.default=function(e){var t=e.mixedString,n=e.components,r=e.throwErrors;if(l=t,!n)return t;if("object"!==(void 0===n?"undefined":o(n))){if(r)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var a=(0,i.default)(t);try{return u(a,n)}catch(e){if(r)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},3:function(e,t){e.exports=window.wp.element},38:function(e,t,n){"use strict";var o=n(0),r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,a=n(22),i=n(39),s=n(40),l=".",u=":",c="function"==typeof Symbol&&Symbol.iterator,d="@@iterator";function p(e,t){return e&&"object"==typeof e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function m(e,t,n,o){var a,s=typeof e;if("undefined"!==s&&"boolean"!==s||(e=null),null===e||"string"===s||"number"===s||"object"===s&&e.$$typeof===r)return n(o,e,""===t?l+p(e,0):t),1;var f=0,g=""===t?l:t+u;if(Array.isArray(e))for(var h=0;h<e.length;h++)f+=m(a=e[h],g+p(a,h),n,o);else{var w=function(e){var t=e&&(c&&e[c]||e[d]);if("function"==typeof t)return t}(e);if(w){0;for(var v,b=w.call(e),y=0;!(v=b.next()).done;)f+=m(a=v.value,g+p(a,y++),n,o)}else if("object"===s){0;var k=""+e;i(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===k?"object with keys {"+Object.keys(e).join(", ")+"}":k,"")}}return f}var f=/\/+/g;function g(e){return(""+e).replace(f,"$&/")}var h=w,w=function(e){if(this.instancePool.length){var t=this.instancePool.pop();return this.call(t,e),t}return new this(e)},v=function(e){i(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)};function b(e,t,n,o){this.result=e,this.keyPrefix=t,this.func=n,this.context=o,this.count=0}function y(e,t,n){var r=e.result,i=e.keyPrefix,s=e.func,l=e.context,u=s.call(l,t,e.count++);Array.isArray(u)?k(u,r,n,a.thatReturnsArgument):null!=u&&(o.isValidElement(u)&&(u=function(e,t){return o.cloneElement(e,{key:t},void 0!==e.props?e.props.children:void 0)}(u,i+(!u.key||t&&t.key===u.key?"":g(u.key)+"/")+n)),r.push(u))}function k(e,t,n,o,r){var a="";null!=n&&(a=g(n)+"/");var i=b.getPooled(t,a,o,r);!function(e,t,n){null==e||m(e,"",t,n)}(e,y,i),b.release(i)}b.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},function(e,t){var n=e;n.instancePool=[],n.getPooled=t||h,n.poolSize||(n.poolSize=10),n.release=v}(b,function(e,t,n,o){if(this.instancePool.length){var r=this.instancePool.pop();return this.call(r,e,t,n,o),r}return new this(e,t,n,o)});e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return s(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(o.isValidElement(e))return s(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;i(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)k(e[n],t,n,a.thatReturnsArgument);return t}},39:function(e,t,n){"use strict";var o=function(e){};e.exports=function(e,t,n,r,a,i,s,l){if(o(t),!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,i,s,l],d=0;(u=new Error(t.replace(/%s/g,function(){return c[d++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},4:function(e,t){e.exports=window.yoast.propTypes},40:function(e,t,n){"use strict";var o=n(22);e.exports=o},41:function(e,t,n){"use strict";function o(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(o)}},42:function(e,t){e.exports=window.wp.a11y},46:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return window.wpseoPremiumMetaboxData.data.restApi.available&&window.wpseoPremiumMetaboxData.data.restApi.contentEndpointsAvailable&&(0,o.default)()};var o=function(e){return e&&e.__esModule?e:{default:e}}(n(55))},5:function(e,t){e.exports=window.wp.data},55:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return"enabled"===window.wpseoPremiumMetaboxData.data.linkSuggestionsEnabled&&window.wpseoPremiumMetaboxData.data.linkSuggestionsAvailable}},56:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUnindexedWarning=void 0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=n(0),a=(m(r),m(n(4))),i=m(n(14)),s=m(n(25)),l=n(2),u=n(42),c=n(19),d=m(n(57)),p=n(16);function m(e){return e&&e.__esModule?e:{default:e}}var f=i.default.div.withConfig({displayName:"LinkSuggestions__LinkSuggestionsWrapper",componentId:"sc-1mipca3-0"})(["display:table-cell;"]),g=(0,l.__)("We could not find any relevant articles on your website that you could link to from your post.","wordpress-seo-premium"),h=(0,l.__)("To improve your site structure, consider linking to other relevant posts or pages on your website.","wordpress-seo-premium"),w=void 0,v=function(e){var t=(0,l.__)("Copied!","wordpress-seo-premium");e.trigger.focus(),e.trigger.setAttribute("aria-label",t),e.trigger.setAttribute("data-label",t),(0,u.speak)(t,"assertive")},b=function(e){var t=(0,l.__)("Not supported!","wordpress-seo-premium");e.trigger.el.setAttribute("aria-label",t),e.trigger.setAttribute("data-label",t),(0,u.speak)(t,"assertive")};var y=function(e){var t=e.suggestions,n=e.maxSuggestions,r=e.customMessages,a=function(e){var t=(0,p.makeOutboundLink)(),n=(0,c.addQueryArgs)(wpseoAdminL10n["shortlinks.site_structure_metabox"],{context:e});return(0,s.default)({mixedString:(0,l.__)("{{a}}Read our guide on internal linking for SEO{{/a}} to learn more.","wordpress-seo-premium"),components:{a:wp.element.createElement(t,{href:n})}})}(e.location);if(0===t.length){var i=r.lengthMessage;return i=""===i?g:i,wp.element.createElement("div",null,wp.element.createElement("p",null,i),wp.element.createElement("p",null,r.metaMessage),wp.element.createElement("p",null,a))}return t.length>n&&(t.length=n),wp.element.createElement(f,null,wp.element.createElement("p",null,h," ",a),wp.element.createElement("p",null,r.metaMessage),t.map(function(e,t){return wp.element.createElement(d.default,o({key:t},e))}))};y.propTypes={suggestions:a.default.array.isRequired,maxSuggestions:a.default.number,customMessages:a.default.object,location:a.default.string},y.defaultProps={maxSuggestions:10,customMessages:{lengthMessage:"",metaMessage:""},location:""};var k=function(){window.open("admin.php?page=wpseo_tools&start-indexation=true","yoastSeoAnalyzeProminentWords")},_=function(e){var t="";return e.hasWordsForLinking||(t=(0,l.__)("Once you add a bit more copy, we'll give you a list of related content here to which you could link in your post.","wordpress-seo-premium")),{lengthMessage:t,metaMessage:function(e,t,n){switch(!0){case n&&!t&&""===e:return(0,l.__)("Add a title to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&t&&""===e:return(0,l.__)("Add a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&!t&&""===e:return(0,l.__)("Add a title and a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium");case n&&!t&&""!==e:return(0,l.__)("Also, add a title to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&t&&""!==e:return(0,l.__)("Also, add a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&!t&&""!==e:return(0,l.__)("Also, add a title and a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium")}}(t,e.hasTitle,e.hasMetaDescription)}},x=t.getUnindexedWarning=function(){var e=(0,l.__)("We need to optimize your site’s SEO data so we can offer you the best %1$slinking suggestions%2$s.\n\n%3$sStart SEO Data optimization%4$s","wordpress-seo-premium");return e=(e=(e=(e=(e=e.replace("%1$s","{{a}}")).replace("%2$s","{{/a}}")).replace("%3$s","{{startAnalysis}}")).replace("%4$s","{{/startAnalysis}}")).replace("\n\n","{{br /}}{{br /}}"),e=(0,s.default)({mixedString:e,components:{a:wp.element.createElement("a",{href:wpseoAdminL10n["shortlinks.notification_internal_link"],target:"_blank"}),startAnalysis:wp.element.createElement("button",{type:"button",className:"button",onClick:k}),br:wp.element.createElement("br",null)}}),wp.element.createElement("div",{className:"notice notice-warning notice-alt wpseo-notice-breakout-inside yoast-links-suggestions-notice"},wp.element.createElement("p",null,e))},E=function(e){if((0,r.useEffect)(function(){return e.suggester.subscribe(),function(){e.suggester.unsubscribe()}},[]),e.isLoading)return wp.element.createElement("div",{className:"yoast-link-suggestions"},wp.element.createElement("p",null,(0,l.__)("It takes a few seconds to show you a list of related content to which you could link. The suggestions will be shown here as soon as we have them.","wordpress-seo-premium")));w||((w=new ClipboardJS(".yoast-link-suggestion__copy")).on("success",v),w.on("error",b));var t=null;e.showUnindexedWarning&&(t=x());var n=o({},e.messageData,{hasWordsForLinking:Array.isArray(e.wordsForLinking)&&e.wordsForLinking.length>0}),a=_(n);return wp.element.createElement("div",{className:"yoast-link-suggestions"},t,wp.element.createElement(y,{suggestions:e.suggestions,customMessages:a,location:e.location}))};E.propTypes={suggester:a.default.object,suggestions:a.default.array.isRequired,wordsForLinking:a.default.array,messageData:a.default.object,isLoading:a.default.bool.isRequired,showUnindexedWarning:a.default.bool,location:a.default.string},E.defaultProps={suggester:null,showUnindexedWarning:!1,messageData:{hasMetaDescription:!1,hasTitle:!1},wordsForLinking:[],location:""},t.default=E},57:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});u(n(0));var o=u(n(4)),r=u(n(14)),a=n(2),i=n(23),s=n(11),l=n(16);function u(e){return e&&e.__esModule?e:{default:e}}var c=r.default.div.withConfig({displayName:"LinkSuggestion__LinkSuggestionWrapper",componentId:"sc-1gewdgc-0"})(["display:flex;align-items:normal;min-height:40px;margin:10px 0 5px;"]),d=(0,l.createSvgIconComponent)({copy:{viewbox:"0 0 448 512",path:"M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"},check:{viewbox:"0 0 512 512",path:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}),p=r.default.div.withConfig({displayName:"LinkSuggestion__LinkSuggestionDivider",componentId:"sc-1gewdgc-1"})(["background-color:#e5e5e5;width:100%;height:1px;"]),m=r.default.button.withConfig({displayName:"LinkSuggestion__LinkSuggestionIcon",componentId:"sc-1gewdgc-2"})(["box-sizing:border-box;flex:0 0 30px;height:30px;width:30px;background-color:",";border-radius:5px;cursor:pointer;outline:none;border:1px solid ",";margin-left:3px;&:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,0.8);}"],function(e){return e.iconBackground},function(e){return e.iconBorder});m.props={iconBackground:o.default.string,iconBorder:o.default.string},m.defaultProps={iconBackground:i.colors.$color_button,iconBorder:i.colors.$color_button_border};var f=r.default.div.withConfig({displayName:"LinkSuggestion__LinkContainer",componentId:"sc-1gewdgc-3"})(["flex:auto;"]),g=(0,l.makeOutboundLink)(r.default.a.withConfig({displayName:"LinkSuggestion__Link",componentId:"sc-1gewdgc-4"})(["text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;max-height:40px;margin-bottom:4px;-webkit-box-orient:vertical;overflow:hidden;padding:0 0 4px;"])),h=r.default.div.withConfig({displayName:"LinkSuggestion__BadgesWrapper",componentId:"sc-1gewdgc-5"})(["flex-wrap:wrap;display:flex;flex-direction:row;justify-content:unset;margin-top:4px;"]),w=r.default.span.withConfig({displayName:"LinkSuggestion__Badge",componentId:"sc-1gewdgc-6"})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;padding:3px 8px;font-size:0.85em;background-color:#f3f4f5;border-radius:2px;margin-bottom:4px;margin-right:4px;text-transform:lowercase;"]),v=function(e){var t=e.badges;return wp.element.createElement(h,null,t.map(function(e,t){return wp.element.createElement(w,{key:t},e)}))};v.propTypes={badges:o.default.array.isRequired};var b=function(e){var t=e.value,n=e.url,o=e.isActive,r=e.labels,l=(0,a.__)("Copy link","wordpress-seo-premium"),u=(0,a.sprintf)((0,a.__)("Copy link to suggested article: %s","wordpress-seo-premium"),t),h="copy",w=i.colors.$color_black,b=i.colors.$color_button,y="#979797";return o&&(h="check",w=i.colors.$color_alert_success_text,b=i.colors.$color_alert_success_background,y=i.colors.$color_alert_success_background),wp.element.createElement("div",null,wp.element.createElement(p,null),wp.element.createElement(c,{className:"yoast-link-suggestion__wrapper"},wp.element.createElement(f,{className:"yoast-link-suggestion__container"},wp.element.createElement(g,{href:n},t),wp.element.createElement(v,{badges:r})),wp.element.createElement(m,{type:"button",className:"yoast-link-suggestion__copy yoast-tooltip yoast-tooltip-alt yoast-tooltip-s",onBlur:function(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,iconBackground:b,iconBorder:y},wp.element.createElement(d,{icon:h,color:w}),wp.element.createElement(s.ScreenReaderText,null,l))))};b.propTypes={value:o.default.string.isRequired,url:o.default.string.isRequired,isActive:o.default.bool,labels:o.default.array.isRequired},b.defaultProps={isActive:!1},t.default=b},60:function(e,t){e.exports=window.wp.blocks},71:function(e,t){e.exports=window.wp.blockEditor},9:function(e,t){e.exports=window.yoast.analysis}},[[176,0]]]); |