import{a6 as Te,u as re,l as We}from"./js/links.cMjoa9mX.js";import{k as Le}from"./js/default-i18n.Bd0Z306Z.js";import"./js/vue.esm-bundler.CWQFYt9y.js";import"./js/helpers.D2xRWOvn.js";var se={exports:{}},d={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var E=Symbol.for("react.element"),Ae=Symbol.for("react.portal"),Be=Symbol.for("react.fragment"),Me=Symbol.for("react.strict_mode"),Fe=Symbol.for("react.profiler"),Ve=Symbol.for("react.provider"),Ie=Symbol.for("react.context"),Ze=Symbol.for("react.forward_ref"),Ge=Symbol.for("react.suspense"),Ue=Symbol.for("react.memo"),qe=Symbol.for("react.lazy"),X=Symbol.iterator;function Ye(e){return e===null||typeof e!="object"?null:(e=X&&e[X]||e["@@iterator"],typeof e=="function"?e:null)}var le={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ie=Object.assign,ce={};function H(e,a,o){this.props=e,this.context=a,this.refs=ce,this.updater=o||le}H.prototype.isReactComponent={};H.prototype.setState=function(e,a){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,a,"setState")};H.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function de(){}de.prototype=H.prototype;function U(e,a,o){this.props=e,this.context=a,this.refs=ce,this.updater=o||le}var q=U.prototype=new de;q.constructor=U;ie(q,H.prototype);q.isPureReactComponent=!0;var K=Array.isArray,ue=Object.prototype.hasOwnProperty,Y={current:null},he={key:!0,ref:!0,__self:!0,__source:!0};function fe(e,a,o){var r,t={},s=null,i=null;if(a!=null)for(r in a.ref!==void 0&&(i=a.ref),a.key!==void 0&&(s=""+a.key),a)ue.call(a,r)&&!he.hasOwnProperty(r)&&(t[r]=a[r]);var l=arguments.length-2;if(l===1)t.children=o;else if(1Te.agent().set("X-WP-Nonce",e).use(a=>{a.on("response",o=>{(o.status===401||o.status===403)&&console.error(o)})}),ln=e=>e.replace(/^\//,""),ge=e=>e.replace(/\/$/,""),V=e=>ge(e)+"/",xe=e=>{const a=re();return e=a.aioseo.data.hasUrlTrailingSlash?V(e):ge(e),V(a.aioseo.urls.restUrl)+V("aioseo/v1")+ln(e)};var je={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var a={}.hasOwnProperty;function o(){for(var s="",i=0;i{const a=e.barScore,o=e.color;return n.jsx(dn,{children:n.jsx("div",{className:"aioseo-donut-container",style:{flexDirection:"column"},children:n.jsxs("svg",{className:"aioseo-donut-score-svg",viewBox:"0 0 33.83098862 33.83098862",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("circle",{className:"aioseo-seo-headline-analyzer-score__background",stroke:"#e8e8eb",strokeWidth:"2",fill:"none",cx:"16.91549431",cy:"16.91549431",r:"15.91549431"}),n.jsx("circle",{className:"aioseo-seo-headline-analyzer-score__circle",stroke:o,strokeWidth:"2",strokeDasharray:`${a}, 100`,strokeLinecap:"round",fill:"none",cx:"16.91549431",cy:"16.91549431",r:"15.91549431"})]})})})},{__:M,sprintf:D}=window.wp.i18n,un=D(M("Headlines that are lists and how-to get more engagement on average than other types of headlines. %1$s%2$sLearn More%3$s β†’","all-in-one-seo-pack"),"

",'',""),be=D(M("A very good score is between %1$d and %2$d.","all-in-one-seo-pack"),70,90),Ce=D(M("For best results, you should strive for %1$d and above.","all-in-one-seo-pack"),70),hn=()=>{We();const e=re();return D(M("This Headline Analyzer is part of %1$s to help you increase your traffic. %2$sAnalyze your site further here%3$s β†’%4$s","all-in-one-seo-pack"),"AIOSEO",D('',e.aioseo.urls.aio.seoAnalysis),"","")},{__:P}=window.wp.i18n,{Fragment:fn}=window.wp.element,{PanelBody:yn,PanelRow:wn}=window.wp.components,$="all-in-one-seo-pack",mn=e=>{const a=e.analyzer.currentHeadlineData.sentence,o=P("Score",$),r=e.analyzer.currentHeadlineData.score,t=40>r?"red":70>=r?"orange":"green",s=t==="red"?"#df2a4a":t==="orange"?"#F2994A":"#00aa63";let i;switch(!0){case 25>r:i=n.jsx("span",{children:P("Not Looking Great",$)});break;case 50>r:i=n.jsx("span",{children:P("Could Be Better",$)});break;case 60>r:i=n.jsx("span",{children:P("Getting There",$)});break;case 75>r:i=n.jsx("span",{children:P("Looks Good! πŸ‘πŸ‘",$)});break;case 75{const a=I("Try New Headline",Z),o=I("Enter a different headline than your post title to see how it compares.",Z),r=I("Analyze Headline",Z),t=typeof e.analyzer.newHeadline<"u"?e.analyzer.newHeadline:"",s=typeof e.analyzer.previousHeadlinesData<"u"?e.analyzer.previousHeadlinesData:[],i=!t,l=c=>{const f=c.trim();f&&pe(window.aioseo.nonce).post(xe("analyze-headline")).send({headline:f,shouldStoreHeadline:!1}).then(h=>{const u=JSON.parse(h.body[Object.keys(h.body)[0]]);e.setAnalyzer({newHeadlineData:u,headlineData:u,previousHeadlinesData:[e.analyzer.headlineData,...s],isNewData:!0})}).catch(h=>{e.setAnalyzer({isNewData:!1}),console.error(h)})};return n.jsx(pn,{children:n.jsx(gn,{title:a,className:m("aioseo-headline-analyzer-panel-tab-new-score-form"),children:n.jsx(xn,{children:n.jsx("div",{className:"aioseo-headline-analyzer-new-tab",children:n.jsx("div",{className:"aioseo-headline-analyzer-new-score-form-block",children:n.jsxs("form",{onSubmit:c=>{c.preventDefault(),l(t)},children:[n.jsx(jn,{label:o,value:t,onChange:c=>{c!==" "&&e.setAnalyzer({newHeadline:c})},className:"aioseo-headline-analyzer-input-field"}),n.jsx(vn,{className:m("aioseo-headline-analyzer-button"),onClick:()=>{l(t)},disabled:i,children:r})]})})})})})})},{__:z}=window.wp.i18n,{Fragment:Cn}=window.wp.element,{PanelBody:_n,PanelRow:zn}=window.wp.components,S="all-in-one-seo-pack",Sn=e=>{const a=e.analyzer.currentHeadlineData.sentence,o=z("New Score",S),r=z("Current Score",S),t=typeof e.analyzer.newHeadlineData<"u"?e.analyzer.newHeadlineData.sentence:"",s=typeof e.analyzer.newHeadlineData<"u"?e.analyzer.newHeadlineData.score:"",i=typeof e.analyzer.currentHeadlineData.score<"u"?e.analyzer.currentHeadlineData.score:"",l=40>s?"red":60>=s?"orange":"green",c=l==="red"?"#df2a4a":l==="orange"?"#F2994A":"#00aa63",f=40>i?"red-bg":60>=i?"orange-bg":"green-bg",h=Math.abs(s-i);let u;switch(!0){case 25>s:u=n.jsx("span",{children:z("Not Looking Great",S)});break;case 50>s:u=n.jsx("span",{children:z("Could Be Better",S)});break;case 60>s:u=n.jsx("span",{children:z("Getting There",S)});break;case 75>s:u=n.jsx("span",{children:z("Looks Good! πŸ‘πŸ‘",S)});break;case 75i?"+ ":s===i?"":"- ",h]}),u&&n.jsx("div",{className:m("aioseo-headline-analyzer-score-status",l),children:u})]}),n.jsxs("div",{className:"current-score",children:[n.jsx("span",{className:m("aioseo-headline-analyzer-score",f),children:i}),n.jsxs("div",{className:"aioseo-headline-analyzer-current-score-content",children:[n.jsx("h5",{children:r}),n.jsx("p",{children:a})]})]})]})})})})})},{__:ee}=window.wp.i18n,{Fragment:kn,useState:Nn,useEffect:Pn}=window.wp.element,$n=e=>{const a=ee("Current Score","all-in-one-seo-pack"),o=ee("Try New Headline","all-in-one-seo-pack"),[r,t]=Nn("current-score"),s=()=>t("current-score"),i=()=>t("new-headline"),l=typeof e.analyzer.isNewData<"u"?e.analyzer.isNewData:!1;return Pn(()=>{e.setAnalyzer({activeTab:r})},[r]),n.jsxs(kn,{children:[n.jsxs("div",{className:"aioseo-inline-buttons",children:[n.jsx("button",{onClick:s,className:m("aioseo-switcher-button",{active:r==="current-score"}),children:a}),n.jsx("button",{onClick:i,className:m("aioseo-switcher-button",{active:r==="new-headline"}),children:o})]}),r==="new-headline"?n.jsx(n.Fragment,{children:n.jsx(bn,{analyzer:e.analyzer,setAnalyzer:e.setAnalyzer})}):n.jsx(mn,{analyzer:e.analyzer}),l?n.jsx(Sn,{analyzer:e.analyzer}):""]})},{__:Hn}=window.wp.i18n,{Fragment:Dn}=window.wp.element,{PanelBody:En,PanelRow:On}=window.wp.components,Rn=e=>{const a=Hn("Previous Scores","all-in-one-seo-pack"),o=e.analyzer.previousHeadlinesData!=="undefined"?e.analyzer.previousHeadlinesData:[],r=document.querySelector(".edit-post-sidebar"),s=(e.analyzer.activeTab!=="undefined"?e.analyzer.activeTab:"current-score")==="current-score"?390:300,i=l=>{e.setAnalyzer({newHeadlineData:o[l],headlineData:o[l],newHeadline:o[l].sentence,isNewData:!0}),r&&(r.scrollTop=s)};return n.jsx(Dn,{children:n.jsx(En,{title:a,className:"aioseo-headline-analyzer-panel-previous-scores",children:n.jsx(On,{children:n.jsx("div",{className:"aioseo-headline-analyzer-panel-first-block",children:n.jsx("ul",{className:"aioseo-headline-analyzer-previous-scores",children:o.map((l,c)=>{if(10>c&&(typeof l.sentence<"u"||typeof l.score<"u")){const f=40>l.score?"red-bg":60>=l.score?"orange-bg":"green-bg";return n.jsxs("li",{onClick:()=>i(c),children:[n.jsx("span",{className:m("aioseo-headline-analyzer-score",f),children:l.score}),n.jsx("span",{className:"aioseo-headline-analyzer-score-text",children:l.sentence})]},c)}return null})})})})})})},{__:Tn}=window.wp.i18n,R=e=>{const a=Tn("Goal: ","all-in-one-seo-pack"),o={width:e.value+"%"};return n.jsxs("div",{className:"aioseo-headline-analyzer-words-block",children:[n.jsx("h5",{children:e.title}),n.jsxs("div",{className:"aioseo-headline-analyzer-words-block-data",children:[n.jsxs("span",{className:m("aioseo-headline-analyzer-words-block-percentage",e.classOnScore),children:[e.value,"%"]}),n.jsxs("span",{className:m("aioseo-headline-analyzer-words-block-percentage-right-column",e.classOnScore),children:[n.jsxs("span",{className:"aioseo-headline-analyzer-words-block-goal",children:[a," ",e.goalValue]}),n.jsxs("span",{className:"aioseo-headline-analyzer-words-block-progressbar",children:[n.jsx("span",{className:"aioseo-headline-analyzer-progressbar-bg"}),n.jsx("span",{className:m("aioseo-headline-analyzer-progressbar-part",e.classOnScoreBg),style:o})]})]})]}),n.jsx("ul",{className:"aioseo-headline-analyzer-words-tag-list",children:0n.jsx("li",{children:r},t)):""}),n.jsx("p",{className:"aioseo-headline-analyzer-words-guideline",children:e.guideLine})]})},{__:y}=window.wp.i18n,{Fragment:Wn}=window.wp.element,{PanelBody:Ln,PanelRow:An}=window.wp.components,w="all-in-one-seo-pack",Bn=e=>{const a=y("Word Balance",w),o=y("Compare the percentages of your results to the goal for each category and adjust as necessary.",w),r=e.data.score,t=40>e.data.score?"red":60>=e.data.score?"orange":"green",s=e.data.result.commonWordsPercentage===0?"red":.2>e.data.result.commonWordsPercentage?"orange":"green",i=e.data.result.commonWordsPercentage===0?"red-bg":.2>e.data.result.commonWordsPercentage?"orange-bg":"green-bg",l=.2>e.data.result.commonWordsPercentage?y("Your headline would be more likely to get clicks if it had more common words.",w):y("Headlines with 20-30% common words are more likely to get clicks.",w),c=e.data.result.uncommonWordsPercentage===0?"red":.1>e.data.result.uncommonWordsPercentage?"orange":"green",f=e.data.result.uncommonWordsPercentage===0?"red-bg":.1>e.data.result.uncommonWordsPercentage?"orange-bg":"green-bg",h=.1>e.data.result.uncommonWordsPercentage?y("Your headline would be more likely to get clicks if it had more uncommon words.",w):y("Headlines with uncommon words are more likely to get clicks.",w),u=e.data.result.emotionalWordsPercentage===0?"red":.1>e.data.result.emotionalWordsPercentage?"orange":"green",x=e.data.result.emotionalWordsPercentage===0?"red-bg":.1>e.data.result.emotionalWordsPercentage?"orange-bg":"green-bg",_e=y("Emotionally triggered headlines are likely to drive more clicks.",w),ze=e.data.result.powerWords.length===0?"orange":"green",Se=e.data.result.powerWords.length===0?"orange":"green-bg",ke=y("Headlines with power words are more likely to get clicks.",w),Ne=y("Common Words",w),Pe=y("20-30%",w),$e=y("Uncommon Words",w),He=y("10-20%",w),De=y("Emotional Words",w),Ee=y("10-15%",w),Oe=y("Power Words",w),Re=y("At least one",w);let _;switch(!0){case 25>r:_=n.jsx("span",{children:y("Not Looking Great",w)});break;case 50>r:_=n.jsx("span",{children:y("Could Be Better",w)});break;case 60>r:_=n.jsx("span",{children:y("Getting There",w)});break;case 75>r:_=n.jsx("span",{children:y("Looks Good! πŸ‘πŸ‘",w)});break;case 75{const a=j("Your headline has a neutral sentiment.",v),o=j("Headlines that are strongly positive or negative tend to get more engagement than neutral ones.",v),r=j("Your headline has a positive sentiment.",v),t=j("Positive headlines tend to get better engagement than neutral or negative ones.",v),s=j("Your headline has a negative sentiment.",v),i=j("Negative headlines are attention-grabbing and tend to perform better than neutral ones.",v),l=j("Sentiment",v),c=e.data.result.sentiment==="neu"?j("Neutral",v):e.data.result.sentiment==="pos"?j("Positive",v):j("Negative",v),f=e.data.result.sentiment==="neu"?p.neutral:e.data.result.sentiment==="pos"?p.smile:p.negative,h=e.data.result.sentiment==="neu"?"orange":e.data.result.sentiment==="pos"?"green":"red";return n.jsx(Mn,{children:n.jsx(Fn,{title:l,className:m("aioseo-headline-analyzer-panel-sentiment","aioseo-headline-analyzer-panel-has-icon",h),icon:f,children:n.jsx(Vn,{children:n.jsxs("div",{className:"aioseo-headline-analyzer-panel-first-block",children:[n.jsx("h4",{children:c}),e.data.result.sentiment==="neu"?n.jsxs("p",{children:[n.jsx("strong",{children:a}),n.jsx("br",{}),o]}):"",e.data.result.sentiment==="pos"?n.jsxs("p",{children:[n.jsx("strong",{children:r}),n.jsx("br",{}),t]}):"",e.data.result.sentiment==="neg"?n.jsxs("p",{children:[n.jsx("strong",{children:s}),n.jsx("br",{})," ",i]}):""]})})})})},{__:Zn}=window.wp.i18n,{Fragment:Gn}=window.wp.element,{PanelBody:Un,PanelRow:qn}=window.wp.components,Yn=e=>{const a=e.data.result.headlineTypes.join(", "),o=Zn("Headline Type","all-in-one-seo-pack"),r=n.jsxs("span",{className:"aioseo-headline-analyzer-panel-types-title",children:[o,n.jsx("span",{children:a})]});return n.jsx(Gn,{children:n.jsx(Un,{title:r,className:"aioseo-headline-analyzer-panel-types",children:n.jsx(qn,{children:n.jsxs("div",{className:"aioseo-headline-analyzer-panel-first-block",children:[n.jsx("h4",{children:a}),n.jsx("p",{dangerouslySetInnerHTML:{__html:un}})]})})})})},{__:k}=window.wp.i18n,{Fragment:Jn}=window.wp.element,{PanelBody:Xn,PanelRow:Kn}=window.wp.components,N="all-in-one-seo-pack",Qn=e=>{const a=k("Character Count",N),o=e.data.result.length,r=o.toString();let t="",s="",i="",l="";if(r.length===1&&(l=`00${o}`),r.length===2){l='0';for(const c of r)l+=`${c}`}if(o.toString().length===3)for(const c of r)l+=`${c}`;return 19>=o?t="red":20<=o&&34>=o?t="orange":35<=o&&66>=o?t="green":67<=o&&79>=o?t="orange":80<=o&&(t="red"),34>=o?(s=k("Too Short πŸ™ƒ",N),i=k("You have space to add more keywords and power words to boost your rankings and click-through rate.",N)):35<=o&&66>=o?(s=k("Good πŸ™‚",N),i=k("Headlines that are about 55 characters long will display fully in search results and tend to get more clicks.",N)):67<=o&&(s=k("Too Long πŸ˜‘",N),i=k("At this length, it will get cut off in search results. Try reducing it to about 55 characters.",N)),n.jsx(Jn,{children:n.jsx(Xn,{title:a,className:m("aioseo-headline-analyzer-panel-character-count","aioseo-headline-analyzer-panel-has-icon",t),icon:t==="green"?p.check:p.warning,children:n.jsx(Kn,{children:n.jsxs("div",{className:"aioseo-headline-analyzer-panel-first-block",children:[n.jsxs("div",{className:"aioseo-headline-analyzer-character-count-container",children:[n.jsx("span",{className:"aioseo-headline-analyzer-status-on-character-length",children:s}),n.jsx("span",{className:m("aioseo-headline-analyzer-character-length",t),dangerouslySetInnerHTML:{__html:l}})]}),n.jsx("p",{children:i})]})})})})},{__:b}=window.wp.i18n,{Fragment:et}=window.wp.element,{PanelBody:nt,PanelRow:tt}=window.wp.components,C="all-in-one-seo-pack",at=e=>{const a=b("Word Count",C),o=e.data.result.wordCount,r=o.toString();let t="",s="",i="",l="";if(r.length===1&&(l=`00${o}`),r.length===2){l='0';for(const c of r)l+=`${c}`}if(r.length===3)for(const c of r)l+=`${c}`;return 4>=o?(t="red",s=b("Not Enough Words πŸ™ƒ",C),i=b("Your headline doesn’t use enough words. You have more space to add keywords and power words to improve your SEO and get more engagement.",C)):5<=o&&9>=o?(t="green",s=b("Good πŸ™‚",C),i=b("Your headline has the right amount of words. Headlines are more likely to be clicked on in search results if they have about 6 words.",C)):10<=o&&11>=o?(t="orange",s=b("Reduce Word Count πŸ™‚",C)):(t="red",s=b("Too Many Words πŸ˜‘",C),i=b("Your headline has too many words. Long headlines will get cut off in search results and won’t get as many clicks.",C)),n.jsx(et,{children:n.jsx(nt,{title:a,className:m("aioseo-headline-analyzer-panel-word-count","aioseo-headline-analyzer-panel-has-icon",t),icon:t==="green"?p.check:p.warning,children:n.jsx(tt,{children:n.jsxs("div",{className:"aioseo-headline-analyzer-panel-first-block",children:[n.jsxs("div",{className:"aioseo-headline-analyzer-word-counter",children:[n.jsx("span",{className:"aioseo-headline-analyzer-status-on-word-length",children:s}),n.jsx("span",{className:m("aioseo-headline-analyzer-word-length",t),dangerouslySetInnerHTML:{__html:l}})]}),n.jsx("p",{children:i})]})})})})},{__:T}=window.wp.i18n,{Fragment:ot}=window.wp.element,{PanelBody:rt,PanelRow:st}=window.wp.components,W="all-in-one-seo-pack",lt=e=>{const a=T("Beginning & Ending Words",W),o=e.data.result.originalExplodedHeadline,r=T("Most readers only look at the first and last 3 words of a headline before deciding whether to click.",W);let t="",s="";return 6<=o.length?(t=o.slice(0,3).join(" "),s=o.slice(-3).join(" ")):3=o.length?(t=o.slice(0,3).join(" "),s=o.slice(3).join(" ")):t=o.slice(0,3).join(" "),n.jsx(ot,{children:n.jsx(rt,{title:a,className:"aioseo-headline-analyzer-panel-beginning-ending-words",children:n.jsx(st,{children:n.jsxs("div",{className:"aioseo-headline-analyzer-panel-first-block",children:[t?n.jsxs(n.Fragment,{children:[n.jsx("ul",{className:"aioseo-headline-analyzer-word-begining-title",children:n.jsx("li",{children:T("Beginning Words",W)})}),n.jsx("div",{className:"aioseo-headline-analyzer-words beginning",children:n.jsx("span",{children:t})})]}):"",s?n.jsxs(n.Fragment,{children:[n.jsx("ul",{className:"aioseo-headline-analyzer-word-ending-title",children:n.jsx("li",{children:T("Ending Words",W)})}),n.jsx("div",{className:"aioseo-headline-analyzer-words ending",children:n.jsx("span",{children:s})})]}):"",n.jsx("p",{className:"aioseo-headline-analyzer-words-guideline",children:r})]})})})})},{__:ne}=window.wp.i18n,{Fragment:it}=window.wp.element,{PanelBody:ct,PanelRow:dt}=window.wp.components,{select:ut}=window.wp.data,ht=e=>{const a=ne("Search Preview","all-in-one-seo-pack"),o=ne("Here is how your headline will look like in Google search results page.","all-in-one-seo-pack"),r=ut("core/editor").getPermalink(),t={href:r};return n.jsx(it,{children:n.jsx(ct,{title:a,className:"aioseo-headline-analyzer-panel-search-preview",children:n.jsx(dt,{children:n.jsx("div",{className:"aioseo-headline-analyzer-panel-first-block",children:n.jsxs("div",{className:"aioseo-headline-analyzer-search-prevew-wrap",children:[n.jsx("p",{className:"aioseo-headline-analyzer-post-url",children:n.jsx("a",{...t,target:"_blank",children:r})}),n.jsx("h4",{children:e.data.sentence}),n.jsx("p",{children:o})]})})})})})},{__:te}=window.wp.i18n,{Fragment:ft,useState:yt,useEffect:wt}=window.wp.element,{registerPlugin:mt}=window.wp.plugins,{PluginSidebar:pt,PluginSidebarMoreMenuItem:gt}=window.wp.editPost,{select:G}=window.wp.data,ae="all-in-one-seo-pack";let oe;const xt=(e,a)=>((...o)=>{const r=()=>e(...o);clearTimeout(oe),oe=setTimeout(r,a)}).call(),jt=()=>{let e=G("core/editor").getEditedPostAttribute("title");const a=()=>{if(!e){s({...t,...{dataExist:!1}});return}pe(window.aioseo.nonce).post(xe("analyze-headline")).send({headline:e,shouldStoreHeadline:!1}).then(h=>{const u={dataExist:!1},x=JSON.parse(h.body[Object.keys(h.body)[0]]);x.analysed&&(u.currentHeadlineData=x,u.headlineData=x,u.dataExist=!0,typeof t.headlineData<"u"&&(u.previousHeadlinesData=[t.headlineData,...i])),s({...t,...u})}).catch(h=>{s({...t,...{dataExist:!1}}),console.error("Couldn't fetch score for headline:",h)})};wt(()=>a(),[]),window.wp.data.subscribe(()=>{e!==G("core/editor").getEditedPostAttribute("title")&&(e=G("core/editor").getEditedPostAttribute("title"),xt(()=>a(),2e3))});const o=te("SEO Headline Analyzer",ae),r=te("Write your post title to see the analyzer data. This Headline Analyzer tool enables you to write irresistible SEO headlines that drive traffic, shares, and rank better in search results.",ae),[t,s]=yt({}),i=typeof t.previousHeadlinesData<"u"?t.previousHeadlinesData:[],l=document.querySelector(`.components-button[aria-label='${o}'] svg`);if(l){const h=document.createElement("span");if(t.dataExist&&typeof t.currentHeadlineData.score<"u"){const u=t.currentHeadlineData.score,x=50>u?"red":80>=u?"orange":"green";l.parentNode.setAttribute("aioseo-button-color",x),l.nextElementSibling?l.nextElementSibling.innerHTML=`${u}/100`:(h.innerHTML=`${u}/100`,l.parentNode.insertBefore(h,l.nextSibling))}else l.parentNode.setAttribute("aioseo-button-color","red"),l.nextElementSibling?l.nextElementSibling.innerHTML="0/100":(h.innerHTML="0/100",l.parentNode.insertBefore(h,l.nextSibling))}const c=document.querySelector(".aioseo-headline-analyzer-wrapper");if(c){const h=c.parentNode.querySelectorAll(".components-panel__header");h&&h.forEach(function(u){const x=u.querySelector(".interface-complementary-area__pin-unpin-item");x&&x!==null&&(x.style.display="none")})}const f=h=>{s({...t,...h})};return n.jsxs(ft,{children:[n.jsx(gt,{target:"aioseo-headline-analyzer",children:o}),n.jsxs(pt,{name:"aioseo-headline-analyzer",title:o,className:"aioseo-headline-analyzer-wrapper",children:[typeof t.headlineData<"u"&&t.dataExist&&t.headlineData.analysed?n.jsx($n,{analyzer:t,setAnalyzer:f}):n.jsx("p",{className:"aioseo-headline-analyzer-empty-title-warning",children:r}),typeof t.headlineData<"u"&&t.dataExist&&t.headlineData.analysed&&0