wp_back/wp-content/plugins/wordpress-seo/js/dist/post-edit.js

25 lines
128 KiB
JavaScript
Raw Normal View History

2024-05-20 15:37:46 +03:00
!function(e){var t={};function n(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},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 s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(s,i,function(t){return e[t]}.bind(null,i));return s},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=290)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.yoast.propTypes},function(e,t){e.exports=window.React},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wp.data},,function(e,t){e.exports=window.yoast.uiLibrary},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r}));const s={request:"request",success:"success",error:"error"},i={idle:"idle",loading:"loading",success:"success",error:"error"},r={showPlay:"showPlay",askPermission:"askPermission",isPlaying:"isPlaying"}},function(e,t){e.exports=window.yoast.styledComponents},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 s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}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},function(e,t){e.exports=window.yoast.reduxJsToolkit},function(e,t){e.exports=window.yoast.analysis},function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.yoast.externals.redux},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var s=n(4);function i(){return Object(s.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}},function(e,t){e.exports=window.wp.components},,function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.jQuery},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"e",(function(){return c})),n.d(t,"k",(function(){return l})),n.d(t,"i",(function(){return d})),n.d(t,"j",(function(){return u})),n.d(t,"b",(function(){return p})),n.d(t,"f",(function(){return g})),n.d(t,"n",(function(){return f})),n.d(t,"l",(function(){return m})),n.d(t,"m",(function(){return y})),n.d(t,"c",(function(){return b})),n.d(t,"g",(function(){return v})),n.d(t,"q",(function(){return O})),n.d(t,"o",(function(){return _})),n.d(t,"p",(function(){return j})),n.d(t,"d",(function(){return S})),n.d(t,"h",(function(){return C})),n.d(t,"u",(function(){return T})),n.d(t,"r",(function(){return P})),n.d(t,"s",(function(){return A})),n.d(t,"t",(function(){return I}));var s=n(13),i=n(15),r=n(4);const a="linkParams",o=Object(s.createSlice)({name:a,initialState:{},reducers:{setLinkParams:(e,t)=>{let{payload:n}=t;return n}}}),c=o.getInitialState,l={selectLinkParam:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object(r.get)(e,`${a}.${t}`,n)},selectLinkParams:e=>Object(r.get)(e,a,{})};l.selectLink=Object(s.createSelector)([l.selectLinkParams,(e,t)=>t],(e,t)=>Object(i.addQueryArgs)(t,e));const d=o.actions,u=o.reducer,p="notifications",h=Object(s.createSlice)({name:p,initialState:{},reducers:{addNotification:{reducer:(e,t)=>{let{payload:n}=t;e[n.id]={id:n.id,variant:n.variant,size:n.size,title:n.title,description:n.description}},prepare:e=>{let{id:t,variant:n="info",size:i="default",title:r,description:a}=e;return{payload:{id:t||Object(s.nanoid)(),variant:n,size:i,title:r||"",description:a}}}},removeNotification:(e,t)=>{let{payload:n
/* translators: %1$s expands to "Yoast SEO" academy, which is a clickable link. */
Object(i.__)("Want to learn SEO from Team Yoast? Check out our %1$s!","wordpress-seo"),"<link/>"),{link:Object(s.createElement)("a",{href:t,target:"_blank",rel:"noopener"},"Yoast SEO academy")}),[]);return Object(s.createElement)(r.Paper,{as:"div",className:"yst-p-6 yst-space-y-3"},Object(s.createElement)(r.Title,{as:"h2",size:"4",className:"yst-text-base yst-text-primary-500"},Object(i.__)("Learn SEO","wordpress-seo")),Object(s.createElement)("p",null,n,Object(s.createElement)("br",null),Object(i.__)("We have both free and premium online courses to learn everything you need to know about SEO.","wordpress-seo")),Object(s.createElement)(r.Link,{href:t,className:"yst-block",target:"_blank",rel:"noopener"},Object(i.sprintf)(
/* translators: %1$s expands to "Yoast SEO academy". */
Object(i.__)("Check out %1$s","wordpress-seo"),"Yoast SEO academy")))};c.propTypes={link:o.a.string.isRequired};var l=n(132),d=n(3),u=d.forwardRef((function(e,t){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),d.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"}))}));const p=e=>{let{learnMoreLink:t,upsellLink:n,thumbnail:a,wistiaEmbedPermission:o}=e;const{onClose:c,initialFocus:d}=Object(r.useModalContext)();return Object(s.createElement)("div",{className:"yst-flex yst-flex-col yst-items-center yst-p-10"},Object(s.createElement)("div",{className:"yst-relative yst-w-full"},Object(s.createElement)(Y,{videoId:"vmrahpfjxp",thumbnail:a,wistiaEmbedPermission:o}),Object(s.createElement)(r.Badge,{className:"yst-absolute yst-top-0 yst-right-2 yst-mt-2 yst-ml-2",variant:"info"},"Beta")),Object(s.createElement)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium"},Object(s.createElement)("span",{className:"yst-uppercase yst-text-slate-500"},Object(i.sprintf)(
/* translators: %1$s expands to Yoast SEO Premium. */
Object(i.__)("New to %1$s","wordpress-seo"),"Yoast SEO Premium"))," ",Object(s.createElement)("span",{className:"yst-uppercase yst-text-slate-700"},"21.0")),Object(s.createElement)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center"},Object(s.createElement)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium"},Object(i.__)("Generate titles & descriptions with Yoast AI!","wordpress-seo")),Object(s.createElement)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm"},Object(s.createInterpolateElement)(Object(i.sprintf)(
/* translators: %1$s and %2$s are anchor tag; %3$s is the arrow icon. */
Object(i.__)("Speed up your workflow with generative AI. Get high-quality title and description suggestions for your search and social appearance. %1$sLearn more%2$s%3$s","wordpress-seo"),"<a>","<ArrowNarrowRightIcon />","</a>"),{a:Object(s.createElement)(b,{href:t,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:Object(s.createElement)(u,{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"})}))),Object(s.createElement)("div",{className:"yst-w-full yst-flex yst-mt-10"},Object(s.createElement)(r.Button,{as:"a",className:"yst-grow",size:"large",variant:"upsell",href:n,target:"_blank",ref:d},Object(s.createElement)(l.a,{className:"yst--ml-1 yst-mr-2 yst-h-5 yst-w-5"}),Object(i.__)("Unlock with Premium","wordpress-seo"),Object(s.createElement)("span",{className:"yst-sr-only"},Object(i.__)("(Opens in a new browser tab)","wordpress-seo")))),Object(s.createElement)(r.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:c},Object(i.__)("Close","wordpress-seo")))};var h;function g(){return(g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(this,arguments)}function f(e){return d.createElement("svg",g({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 1000 1000"},e),h||(h=d.createElement("path",{d:"M500 0C223.9 0 0 223.9 0 500s223.9 500 500 500 500-223.9 500-500S776.1 0 500 0zm87.2 412.4c0-21.9 4.3-40.2 13.1-54.4s24-27.1 45.9-38.2l10.1-4.9c17.8-9 22.4-16.7 22.4-26 0-11.1-9.5-19.1-25-19.1-18.3 0-32.2 9.5-41.8 28.9l-24.7-24.8c5.4-11.6 14.1-20.9 25.8-28.1a70.8 70.8 0 0138.9-11.1c17.8 0 33.3 4.6 45.9 14.2s19.4 22.7 19.4 39.4c0 26.6-15 42.9-43.1 57.3l-15.7 8c-16.8 8.5-25.1 16-27.4 29.4h85.4v35.4H587.2zm-82.1 373.3c-157.8 0-285.7-127.9-285.7-285.7s127.9-285.7 285.7-285.7a286.4 286.4 0 0155.9 5.5l-55.9 116.9c-90 0-163.3 73.3-163.3 163.3s73.3 163.3 163.3 163.3a162.8 162.8 0 00106.4-39.6l61.8 107.2a283.9 283.9 0 01-168.2 54.8zM705 704.1l-70.7-122.5H492.9l70.7-122.4H705l70.7 122.4z",fill:"#fff"})))}p.propTypes={learnMoreLink:o.a.string.isRequired,upsellLink:o.a.string.isRequired,thumbnail:o.a.shape({src:o.a.string.isRequired,width:o.a.string,height:o.a.string}).isRequired,wistiaEmbedPermission:o.a.shape({value:o.a.bool.isRequired,status:o.a.string.isRequired,set:o.a.func.isRequired}).isRequired},n(87);var m=n(12),y=n.n(m);const b=e=>{let{href:t,children:n,...a}=e;return Object(s.createElement)(r.Link,y()({target:"_blank",rel:"noopener noreferrer"},a,{href:t}),n,Object(s.createElement)("span",{className:"yst-sr-only"},Object(i.__)("(Opens in a new browser tab)","wordpress-seo")))};b.propTypes={href:o.a.string.isRequired,children:o.a.node},b.defaultProps={children:null};var w,v,O,_,j,k,x,E,S,R,C,T,P,A,I=n(199);function M(){return(M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(this,arguments)}function D(e){return d.createElement("svg",M({xmlns:"http://www.w3.org/2000/svg",id:"star-rating-half_svg__Layer_1","data-name":"Layer 1",viewBox:"0 0 500 475.53"},e),w||(w=d.createElement("defs",null,d.createElement("style",null,".star-rating-half_svg__cls-1{fill:#fbbf24}"))),v||(v=d.createElement("path",{className:"star-rating-half_svg__cls-1",d:"M250 392.04L98.15 471.87l29-169.09L4.3 183.03l169.77-24.67L250 4.52l75.93 153.84 169.77 24.67-122.85 119.75 29 169.09L250 392.04z"})),O||(O=d.createElement("path",{className:"star-rating-half_svg__cls-1",d:"M250 33.51l73.67 149.27.93 1.88 2.08.3L491.4 208.9 372.21 325.09l-1.51 1.47.36 2.07 28.14 164.06-147.34-77.46-1.86-1-1.86 1-147.34 77.46 28.14-164.06.36-2.07-1.51-1.47L8.6 208.9 173.32 185l2.08-.3.93-1.88L250 33.51m0-9L172.75 181 0 206.11 125 328 95.49 500 250 418.77 404.51 500 375 328l125-121.89L327.25 181 250 24.47z",transform:"translate(0 -24.47)"})),_||(_=d.createElement("path",{fill:"#f3f4f6",d:"M500 181.64l-172.75-25.11L250 0v394.3l154.51 81.23L375 303.48l125-1
/* translators: %1$s and %2$s expand to opening and closing <strong> tags. */
Object(i.__)("Be more efficient in creating titles and meta descriptions with the help of AI. %1$sGet 24/7 support%2$s and boost your websites visibility.","wordpress-seo"),"<strong>","</strong>"),{strong:Object(s.createElement)("strong",null)}),[]),o=Object(s.createInterpolateElement)(Object(i.sprintf)(
/* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */
Object(i.__)("%1$sGet%2$s %3$s","wordpress-seo"),"<nowrap>","</nowrap>","Yoast SEO Premium"),{nowrap:Object(s.createElement)("span",{className:"yst-whitespace-nowrap"})});return Object(s.createElement)("div",{className:"yst-p-6 yst-rounded-lg yst-text-white yst-bg-primary-500 yst-shadow"},Object(s.createElement)("figure",{className:"yst-logo-square yst-w-16 yst-h-16 yst-mt-[-2.6rem] yst-mx-auto yst-overflow-hidden yst-border yst-border-white yst-rounded-xl yst-rounded-br-none"},Object(s.createElement)($,null)),Object(s.createElement)(r.Title,{as:"h2",className:"yst-mt-6 yst-text-base yst-font-extrabold yst-text-white"},o),Object(s.createElement)("p",{className:"yst-mt-2"},a),Object(s.createElement)(r.Button,y()({as:"a",variant:"upsell",href:t,target:"_blank",rel:"noopener",className:"yst-flex yst-justify-center yst-gap-2 yst-mt-4 focus:yst-ring-offset-primary-500"},n),Object(s.createElement)("span",null,o),Object(s.createElement)(I.a,{className:"yst-w-4 yst-h-4 yst-icon-rtl"})),Object(s.createElement)("a",{className:"yst-block yst-mt-4 yst-no-underline",href:"https://www.g2.com/products/yoast-yoast/reviews",target:"_blank",rel:"noopener noreferrer"},Object(s.createElement)("span",{className:"yst-font-medium yst-text-white hover:yst-underline"},Object(i.__)("Read reviews from real users","wordpress-seo")),Object(s.createElement)("span",{className:"yst-flex yst-gap-2 yst-mt-2 yst-items-center"},Object(s.createElement)(f,{className:"yst-w-5 yst-h-5"}),Object(s.createElement)("span",{className:"yst-flex yst-gap-1"},Object(s.createElement)(L,{className:"yst-w-5 yst-h-5"}),Object(s.createElement)(L,{className:"yst-w-5 yst-h-5"}),Object(s.createElement)(L,{className:"yst-w-5 yst-h-5"}),Object(s.createElement)(L,{className:"yst-w-5 yst-h-5"}),Object(s.createElement)(D,{className:"yst-w-5 yst-h-5"})),Object(s.createElement)("span",{className:"yst-text-sm yst-font-semibold yst-text-white"},"4.6 / 5"))))};z.propTypes={link:o.a.string.isRequired,linkProps:o.a.object},z.defaultProps={linkProps:{}};const F=e=>{let{children:t}=e;return Object(s.createElement)("div",{className:"xl:yst-max-w-3xl xl:yst-fixed xl:yst-right-8 xl:yst-w-[16rem]"},Object(s.createElement)("div",{className:"yst-grid yst-grid-cols-1 sm:yst-grid-cols-2 min-[783px]:yst-grid-cols-1 lg:yst-grid-cols-2 xl:yst-grid-cols-1 yst-gap-4"},t))};F.propTypes={children:o.a.node.isRequired};var U=n(97),q=n(10);const Y=e=>{let{videoId:t,thumbnail:n,wistiaEmbedPermission:a}=e;const[o,c]=Object(s.useState)(a.value?q.c.isPlaying:q.c.showPlay),l=Object(s.useCallback)(()=>c(q.c.isPlaying),[c]),d=Object(s.useCallback)(()=>{a.value?l():c(q.c.askPermission)},[a.value,l,c]),u=Object(s.useCallback)(()=>c(q.c.showPlay),[c]),p=Object(s.useCallback)(()=>{a.set(!0),l()},[a.set,l]);return Object(s.createElement)(s.Fragment,null,a.value&&Object(s.createElement)(U.Helmet,null,Object(s.createElement)("script",{src:"https://fast.wistia.com/assets/external/E-v1.js",async:!0})),Object(s.createElement)("div",{className:"yst-relative yst-w-full yst-h-0 yst-pt-[56.25%] yst-overflow-hidden yst-rounded-md yst-drop-shadow-md yst-bg-white"},o===q.c.showPlay&&Object(s.createElement)("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:d},Object(s.createElement)("img",y()({className:"yst-w-full yst-h-auto",alt:"",loading:"lazy",decoding:"async"},n))),o===q.c.askPermission&&Object(s.createElement)("div",{className:"yst-absolute yst-inset-0 yst-flex yst-flex-col yst-items-center yst-justify-center yst-bg-white"},Object(s.createElement)("p",{className:"yst-max-w-xs yst-mx-auto yst-text-center"},a.status===q.b.loading&&Object(s.createElement)(r.Spinner,null),a.status!==q.b.loading&&Object(i.sprintf)(
/* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */
Object(i.__)("To see this video, you need to allow %1$s to load embedded videos from %2$s.","wordpress-seo"),"Yoast SEO","Wistia")),Object(s.createElement)("div",{className:"yst-flex yst-mt-6 yst-gap-x-4"},Object(s.createElement)(r.Button,{type:"button",variant:"secondary",onClick:u,disabled:a.status===q.b.loading},Object(i.__)("Deny","wordpress-seo")),Object(s.createElement)(r.Button,{type:"button",variant:"primary",onClick:p,disabled:a.status===q.b.loading},Object(i.__)("Allow","wordpress-seo")))),a.value&&o===q.c.isPlaying&&Object(s.createElement)("div",{className:"yst-absolute yst-w-full yst-h-full yst-top-0 yst-left-0"},null===t&&Object(s.createElement)(r.Spinner,{className:"yst-h-full yst-mx-auto"}),null!==t&&Object(s.createElement)("div",{className:`wistia_embed wistia_async_${t} videoFoam=true`}))))};Y.propTypes={videoId:o.a.string.isRequired,thumbnail:o.a.shape({src:o.a.string.isRequired,width:o.a.string,height:o.a.string}).isRequired,wistiaEmbedPermission:o.a.shape({value:o.a.bool.isRequired,status:o.a.string.isRequired,set:o.a.func.isRequired}).isRequired}},function(e,t,n){"use strict";function s(){return window.wpseoScriptData&&"1"===window.wpseoScriptData.isBlockEditor}n.d(t,"a",(function(){return s}))},function(e,t,n){"use strict";function s(e){var t=jQuery(".yst-traffic-light"),n=t.closest(".wpseo-meta-section-link"),s=jQuery("#wpseo-traffic-light-desc"),i=e.className||"na";t.attr("class","yst-traffic-light "+i),n.attr("aria-describedby","wpseo-traffic-light-desc"),s.length>0?s.text(e.screenReaderText):n.closest("li").append("<span id='wpseo-traffic-light-desc' class='screen-reader-text'>"+e.screenReaderText+"</span>")}n.d(t,"a",(function(){return s}))},,,function(e,t,n){"use strict";n.r(t),n.d(t,"refreshDelay",(function(){return s}));const s=500},function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l}));var s=n(14),i=n(4);function r(e,t){return e._properties.position.startOffset>t.length||e._properties.position.endOffset>t.length}function a(e,t,n){const a=e.dom;let o=e.getContent();if(o=s.markers.removeMarks(o),Object(i.isEmpty)(n))return void e.setContent(o);o=n[0].hasPosition()?function(e,t){if(!t)return"";for(let n=(e=Object(i.orderBy)(e,e=>e._properties.position.startOffset,["asc"])).length-1;n>=0;n--){const s=e[n];r(s,t)||(t=s.applyWithPosition(t))}return t}(n,o):function(e,t,n,r){const{fieldsToMark:a,selectedHTML:o}=s.languageProcessing.getFieldsToMark(n,r);return Object(i.forEach)(n,(function(t){"acf_content"!==e.id&&(t._properties.marked=s.languageProcessing.normalizeHTML(t._properties.marked),t._properties.original=s.languageProcessing.normalizeHTML(t._properties.original)),a.length>0?o.forEach(e=>{const n=t.applyWithReplace(e);r=r.replace(e,n)}):r=t.applyWithReplace(r)})),r}(e,0,n,o),e.setContent(o),function(e){let t=e.getContent();t=t.replace(new RegExp("&lt;yoastmark.+?&gt;","g"),"").replace(new RegExp("&lt;/yoastmark&gt;","g"),""),e.setContent(t)}(e);const c=a.select("yoastmark");Object(i.forEach)(c,(function(e){e.setAttribute("data-mce-bogus","1")}))}function o(e){return window.test=e,a.bind(null,e)}function c(e){return-1!==e.getContent({format:"raw"}).indexOf("<yoastmark")}function l(e){o(e)(null,[])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return h}));var s=n(4),i=n(14),r=n(65);function a(){return Object(s.get)(window,["wpseoAdminL10n","default_query_params"],{})}var o=n(123),c=n(68),l=n(55),d=n(101),u=n(88);function p(){const e=Object(s.get)(window,["wpseoScriptData","analysis","worker","url"],"analysis-worker.js"),t=Object(i.createWorker)(e),n=Object(s.get)(window,["wpseoScriptData","analysis","worker","dependencies"],[]),r=[];for(const e in n){if(!Object.prototype.hasOwnProperty.call(n,e))continue;const t=window.document.getElementById(e+"-js-translations");if(!t)continue;const s=t.innerHTML.slice(214),i=s.indexOf(","),a=s.slice(0,i-1);try{const e=JSON.parse(s.slice(i+1,-4));r.push([a,e])}catch(t){console.warn(`Failed to parse translation data for ${e} to send to the Y
padding-top: 6px;
`,je=e=>{const{value:t,id:n,terms:s,onChange:i}=e;return Object(pe.createElement)(_e,null,Object(pe.createElement)("select",{className:"components-select-control__input",id:n,value:t,onChange:e=>{i(parseInt(e.target.value,10))}},s.map(e=>Object(pe.createElement)("option",{key:e.id,value:e.id},Object(o.unescape)(e.name)))))};je.propTypes={terms:ge.a.arrayOf(ge.a.shape({id:ge.a.string.isRequired,name:ge.a.string.isRequired})),onChange:ge.a.func.isRequired,id:ge.a.string,value:ge.a.string};var ke=je;const xe=ye.a.div`
padding-top: 16px;
`;class Ee extends pe.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.updateReplacementVariable=this.updateReplacementVariable.bind(this);const{fieldId:t,name:n}=e.taxonomy;this.input=document.getElementById(t),e.setPrimaryTaxonomyId(n,parseInt(this.input.value,10)),this.state={selectedTerms:[],terms:[]}}componentDidMount(){this.fetchTerms()}componentDidUpdate(e,t){if(e.selectedTermIds.length<this.props.selectedTermIds.length){const t=Object(o.difference)(this.props.selectedTermIds,e.selectedTermIds)[0];if(!this.termIsAvailable(t))return void this.fetchTerms()}e.selectedTermIds!==this.props.selectedTermIds&&this.updateSelectedTerms(this.state.terms,this.props.selectedTermIds),t.selectedTerms!==this.state.selectedTerms&&this.handleSelectedTermsChange()}handleSelectedTermsChange(){const{selectedTerms:e}=this.state,{primaryTaxonomyId:t}=this.props;e.find(e=>e.id===t)||this.onChange(e.length?e[0].id:-1)}termIsAvailable(e){return!!this.state.terms.find(t=>t.id===e)}fetchTerms(){const{taxonomy:e}=this.props;e&&(this.fetchRequest=ve()({path:Object(Oe.addQueryArgs)("/wp/v2/"+e.restBase,{per_page:-1,orderby:"count",order:"desc",_fields:"id,name"})}),this.fetchRequest.then(e=>{const t=this.state;this.setState({terms:e,selectedTerms:this.getSelectedTerms(e,this.props.selectedTermIds)},()=>{0===t.terms.length&&this.state.terms.length>0&&this.updateReplacementVariable(this.props.primaryTaxonomyId)})}))}getSelectedTerms(e,t){return e.filter(e=>t.includes(e.id))}updateSelectedTerms(e,t){const n=this.getSelectedTerms(e,t);this.setState({selectedTerms:n})}onChange(e){const{name:t}=this.props.taxonomy;this.updateReplacementVariable(e),this.props.setPrimaryTaxonomyId(t,e),this.input.value=-1===e?"":e}updateReplacementVariable(e){if("category"!==this.props.taxonomy.name)return;const t=this.state.selectedTerms.find(t=>t.id===e);this.props.updateReplacementVariable("primary_"+this.props.taxonomy.name,t?t.name:"")}render(){const{primaryTaxonomyId:e,taxonomy:t}=this.props;if(this.state.selectedTerms.length<2)return null;const n=`yoast-primary-${t.name}-picker`;return Object(pe.createElement)(xe,{className:"components-base-control__field"},Object(pe.createElement)("label",{htmlFor:n,className:"components-base-control__label"},Object(N.sprintf)(
/* translators: %s expands to the taxonomy name. */
Object(N.__)("Select the primary %s","wordpress-seo"),t.singularLabel.toLowerCase())),Object(pe.createElement)(ke,{value:e,onChange:this.onChange,id:n,terms:this.state.selectedTerms}))}}Ee.propTypes={selectedTermIds:ge.a.arrayOf(ge.a.number),primaryTaxonomyId:ge.a.number,setPrimaryTaxonomyId:ge.a.func,updateReplacementVariable:ge.a.func,receiveEntityRecords:ge.a.func,taxonomy:ge.a.shape({name:ge.a.string,fieldId:ge.a.string,restBase:ge.a.string,singularLabel:ge.a.string})};var Se=Ee,Re=Object(be.compose)([Object(p.withSelect)((e,t)=>{const n=e("core/editor"),s=e("yoast-seo/editor"),{taxonomy:i}=t;return{selectedTermIds:n.getEditedPostAttribute(i.restBase)||[],primaryTaxonomyId:s.getPrimaryTaxonomyId(i.name)}}),Object(p.withDispatch)(e=>{const{setPrimaryTaxonomyId:t,updateReplacementVariable:n}=e("yoast-seo/editor");return{setPrimaryTaxonomyId:t,updateReplacementVariable:n}})])(Se);let Ce=null,Te=null;const Pe=ye.a.div`
margin: 16px 0 8px;
`;class Ae extends pe.Component{constructor(){super(),Ce&&Te||(Ce=Object(o.get)(window.wpseoPrimaryCategoryL10n,"taxonomies",{}),Te=Object(o.values)(Ce).map(e=>e.name)),this.state={exceptionCaught:!1,error:null}}componentDidCatch(e){this.setState({exceptionCaught:!0,error:e})}taxonomyHasPrimaryTermSupport(){return Te.includes(this.props.slug)}render(){const{slug:e,OriginalComponent:t}=this.props;if(this.state.exceptionCaught){const e=Object(o.get)(this.state,"error.stack");return Object(pe.createElement)(pe.Fragment,null,Object(pe.createElement)(t,this.props),Object(pe.createElement)(Pe,null,Object(N.sprintf)(
/* translators: %s expands to Yoast SEO. */
Object(N.__)("An error occurred loading the %s primary taxonomy picker.","wordpress-seo"),"Yoast SEO")),e&&Object(pe.createElement)(fe.ClipboardButton,{isLarge:!0,text:e},Object(N.__)("Copy error","wordpress-seo")))}return this.taxonomyHasPrimaryTermSupport()?Object(pe.createElement)(pe.Fragment,null,Object(pe.createElement)(t,this.props),Object(pe.createElement)(Re,{taxonomy:Ce[e]})):Object(pe.createElement)(t,this.props)}}Ae.propTypes={OriginalComponent:ge.a.func.isRequired,slug:ge.a.string.isRequired};var Ie=Ae;var Me=n(166);window.wpseoPostScraperL10n=window.wpseoScriptData.metabox,window.wpseoShortcodePluginL10n=window.wpseoScriptData.analysis.plugins.shortcodes,window.YoastSEO=window.YoastSEO||{},i()(()=>{Object(m.a)(a.a),"undefined"!=typeof wpseoPrimaryCategoryL10n&&function(e){var t,n,s=wpseoPrimaryCategoryL10n.taxonomies;function i(t){return e("#yoast-wpseo-primary-"+t).val()}function r(t,n){e("#yoast-wpseo-primary-"+t).val(n).trigger("change");const s=Object(p.dispatch)("yoast-seo/editor");if(s){const i=parseInt(n,10);s.setPrimaryTaxonomyId(t,i),"category"===t&&s.updateReplacementVariable("primary_category",function(t){const n=e("#category-all").find(`#category-${t} > label`);if(0===n.length)return"";const s=n.clone();return s.children().remove(),s.text().trim()}(i))}}function a(r){var a,o,c;a=e("#"+r+'checklist input[type="checkbox"]:checked');var l=e("#"+r+"checklist li");l.removeClass("wpseo-term-unchecked wpseo-primary-term wpseo-non-primary-term"),e(".wpseo-primary-category-label").remove(),l.addClass("wpseo-term-unchecked"),a.length<=1||a.each((function(a,l){l=e(l),(o=l.closest("li")).removeClass("wpseo-term-unchecked"),1!==e(l).closest("li").children(".wpseo-make-primary-term").length&&function(n,i){var r,a;r=e(i).closest("label"),a=t({taxonomy:s[n],term:r.text()}),r.after(a)}(r,l),l.val()===i(r)?(o.addClass("wpseo-primary-term"),(c=l.closest("label")).find(".wpseo-primary-category-label").remove(),c.append(n({taxonomy:s[r]}))):o.addClass("wpseo-non-primary-term")}))}function c(t){r(t,e("#"+t+'checklist input[type="checkbox"]:checked:first').val()),a(t)}function l(e){""===i(e)&&c(e)}e.fn.initYstSEOPrimaryCategory=function(){return this.each((function(t,n){const s=e("#"+n.name+"div");var o;a(n.name),s.on("click",'input[type="checkbox"]',(o=n.name,function(){!1===e(this).prop("checked")&&e(this).val()===i(o)&&c(o),l(o),a(o)})),s.on("wpListAddEnd","#"+n.name+"checklist",function(e){return function(){l(e),a(e)}}(n.name)),s.on("click",".wpseo-make-primary-term",function(t){return function(n){var s;s=e(n.currentTarget).siblings("label").find("input"),r(t,s.val()),a(t),s.trigger("focus")}}(n.name))}))},t=wp.template("primary-term-ui"),n=wp.template("primary-term-screen-reader"),e(_.values(s)).initYstSEOPrimaryCategory(),Object(f.a)()&&Object(o.get)(window,"wp.hooks.addFilter",o.noop)("editor.PostTaxonomyType","yoast-seo",e=>class extends pe.Component{render(){return Object(pe.createElement)(Ie,ue()({OriginalComponent:e},this.props))}})}(a.a);const e=Object(u.a)();window.yoast.initEditorIntegration(e);const t=new window.yoast.EditorData(o.noop,e);t.initialize(window.wpseoScriptData.analysis.plugins.replaceVars.replace_vars,window.wpseoScriptData.analysis.plugins.replaceVars.hidden_replace_vars),le(a.a,e,t),window.wpseoScriptData&&void 0!==window.wpseoScriptData.featuredImage&&function(e){var t,n,s,i=function(e){this._app=e,this.featuredImage=null,this.pluginName="addFeaturedImagePlugin",this.registerPlugin(),this.registerModifications()};function r(){e("#yst_opengraph_image_warning").remove(),n.removeClass("yoast-opengraph-image-notice")}i.prototype.setFeaturedImage=function(e){this.featuredImage=e,this._app.pluginReloaded(this.pluginName)},i.prototype.removeFeaturedImage=function(){this.setFeaturedImage(null)},i.prototype.registerPlugin=function(){this._app.registerPlugin(this.pluginName,{status:"ready"})},i.prototype.registerModifications=function(){this._app.registerModification("content",this.addImageToContent.bind(this),this.pluginName,10)},i.prototype.addImageToContent=function(e){return null!==this.featu