(()=>{"use strict";var s={n:e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},d:(e,t)=>{for(var o in t)s.o(t,o)&&!s.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},o:(s,e)=>Object.prototype.hasOwnProperty.call(s,e),r:s=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})}},e={};s.r(e),s.d(e,{AnalysisList:()=>_,AnalysisResult:()=>w,ContentAnalysis:()=>S,SiteSEOReport:()=>j,renderRatingToColor:()=>I});const t=window.wp.i18n,o=window.yoast.styleGuide,r=window.lodash.noop;var n=s.n(r);const i=window.yoast.propTypes;var l=s.n(i);const a=window.React;var u=s.n(a);const d=window.yoast.styledComponents;var p=s.n(d);const g=window.yoast.componentsNew,c=window.yoast.helpers,m=window.lodash,h=window.ReactJSXRuntime,{stripTagsFromHtmlString:k}=c.strings,B=["a","b","strong","em","i"],b=p().div`
	display: grid;
	grid-template-rows: 1fr;
	max-width: 32px;
	// This gap value is half the gap value between assessment result list items, which is 12px.
	gap: 6px;
`,C=p().li`
	// This is the height of the IconButtonToggle.
	min-height: 24px;
	margin-bottom: 12px;
	padding: 0;
	display: flex;
	align-items: flex-start;
	position: relative;
	gap: 12px;
`,x=p()(g.SvgIcon)`
	margin: 3px 0 0 0;
`,y=p().p`
	margin: 0;
	flex: 1 1 auto;
	color: ${s=>s.suppressedText?"rgba(30,30,30,0.5)":"inherit"};
`,R=({ariaLabel:s,id:e,className:t,status:o,onClick:r,isPressed:n})=>(0,h.jsx)(g.IconButtonToggle,{marksButtonStatus:o,className:t,onClick:r,id:e,icon:"eye",pressed:n,ariaLabel:s}),f=({ariaLabelMarks:s,ariaLabelEdit:e="",bulletColor:t,buttonIdMarks:o,buttonIdEdit:r="",editButtonClassName:n="",hasAIFixes:i=!1,hasBetaBadgeLabel:l=!1,hasEditButton:u=!1,hasMarksButton:d,id:p="",isPremium:c=!1,marker:f=m.noop,markButtonFactory:w=null,marksButtonStatus:v="enabled",marksButtonClassName:I="",onButtonClickMarks:_,onButtonClickEdit:N=m.noop,onResultChange:A=m.noop,pressed:M,renderHighlightingUpsell:S=m.noop,renderAIOptimizeButton:H=m.noop,shouldUpsellHighlighting:E=!1,suppressedText:T=!1,text:j})=>{const[L,O]=(0,a.useState)(!1),P=(0,a.useCallback)(()=>O(!1),[]),U=(0,a.useCallback)(()=>O(!0),[]);w=w||R;let F=null;return function(s,e){return!s||"hidden"===e}(d,v)||(F=w({onClick:E?U:_,status:v,className:I,id:o,isPressed:M,ariaLabel:s})),(0,a.useEffect)(()=>{A(p,f,d)},[p,f,d]),(0,h.jsxs)(C,{children:[(0,h.jsx)(x,{icon:"circle",color:t,size:"13px"}),(0,h.jsxs)(y,{suppressedText:T,children:[l&&(0,h.jsx)(g.BetaBadge,{}),(0,h.jsx)("span",{dangerouslySetInnerHTML:{__html:k(j,B)}})]}),(0,h.jsxs)(b,{children:[F,S(L,P),u&&c&&(0,h.jsx)(g.IconCTAEditButton,{className:n,onClick:N,id:r,icon:"edit",ariaLabel:e}),H(i,p)]})]})};f.propTypes={text:l().string.isRequired,suppressedText:l().bool,bulletColor:l().string.isRequired,hasMarksButton:l().bool.isRequired,hasEditButton:l().bool,hasAIFixes:l().bool,buttonIdMarks:l().string.isRequired,buttonIdEdit:l().string,pressed:l().bool.isRequired,ariaLabelMarks:l().string.isRequired,ariaLabelEdit:l().string,onButtonClickMarks:l().func.isRequired,onButtonClickEdit:l().func,marksButtonStatus:l().string,marksButtonClassName:l().string,markButtonFactory:l().func,editButtonClassName:l().string,hasBetaBadgeLabel:l().bool,isPremium:l().bool,onResultChange:l().func,id:l().string,marker:l().oneOfType([l().func,l().array]),shouldUpsellHighlighting:l().bool,renderHighlightingUpsell:l().func,renderAIOptimizeButton:l().func};const w=f,v=p().ul`
	margin: 8px 0;
	padding: 0;
	list-style: none;
`;function I(s){switch(s){case"good":return o.colors.$color_good;case"OK":return o.colors.$color_ok;case"bad":return o.colors.$color_bad;default:return o.colors.$color_score_icon}}function _({results:s,marksButtonActivatedResult:e="",marksButtonStatus:o="enabled",marksButtonClassName:r="",editButtonClassName:i="",markButtonFactory:l=null,onMarksButtonClick:a=n(),onEditButtonClick:u=n(),isPremium:d=!1,onResultChange:p=n(),shouldUpsellHighlighting:g=!1,renderHighlightingUpsell:c=n(),renderAIOptimizeButton:m=n()}){return(0,h.jsx)(v,{role:"list",children:s.map(s=>{const n=I(s.rating),k=s.markerId===e,B=s.editFieldName,b=s.id+"Mark",C=B+"Edit";let x="";x="disabled"===o?(0,t.__)("Highlighting is currently disabled","wordpress-seo"):k?(0,t.__)("Remove highlight from the text","wordpress-seo"):(0,t.__)("Highlight this result in the text","wordpress-seo");const y=s.editFieldAriaLabel;return(0,h.jsx)(w,{id:s.id,text:s.text,marker:s.marker,bulletColor:n,hasMarksButton:s.hasMarks,hasEditButton:s.hasJumps,hasAIFixes:s.hasAIFixes,ariaLabelMarks:x,ariaLabelEdit:y,pressed:k,suppressedText:"upsell"===s.rating,buttonIdMarks:b,buttonIdEdit:C,onButtonClickMarks:()=>a(s.id,s.marker),onButtonClickEdit:s=>u(B,s),marksButtonClassName:r,editButtonClassName:i,marksButtonStatus:o,hasBetaBadgeLabel:s.hasBetaBadge,isPremium:d,onResultChange:p,markButtonFactory:l,shouldUpsellHighlighting:g,renderAIOptimizeButton:m,renderHighlightingUpsell:c},s.id)})})}_.propTypes={results:l().array.isRequired,marksButtonActivatedResult:l().string,marksButtonStatus:l().string,marksButtonClassName:l().string,editButtonClassName:l().string,markButtonFactory:l().func,onMarksButtonClick:l().func,onEditButtonClick:l().func,isPremium:l().bool,onResultChange:l().func,shouldUpsellHighlighting:l().bool,renderHighlightingUpsell:l().func,renderAIOptimizeButton:l().func};const N=p().div`
	width: 100%;
	background-color: white;
	border-bottom: 1px solid transparent; // Avoid parent and child margin collapsing.
`,A=p()(g.Collapsible)`
	margin-bottom: 8px;

	${g.StyledIconsButton} {
		padding: 8px 0;
		color: ${o.colors.$color_blue};
		margin: -2px 8px 0 -2px; // Compensate icon size set to 18px.
	}
`;class M extends u().Component{renderCollapsible(s,e,t,r=null){return(0,h.jsx)(A,{id:r?`${r}-collapsible`:null,initialIsOpen:!0,title:`${s} (${t.length})`,prefixIcon:{icon:"angle-up",color:o.colors.$color_grey_dark,size:"18px"},prefixIconCollapsed:{icon:"angle-down",color:o.colors.$color_grey_dark,size:"18px"},suffixIcon:null,suffixIconCollapsed:null,headingProps:{level:e,fontSize:"13px",fontWeight:"500",color:"#1e1e1e"},children:(0,h.jsx)(_,{results:t,marksButtonActivatedResult:this.props.activeMarker,marksButtonStatus:this.props.marksButtonStatus,marksButtonClassName:this.props.marksButtonClassName,editButtonClassName:this.props.editButtonClassName,markButtonFactory:this.props.markButtonFactory,onMarksButtonClick:this.props.onMarkButtonClick,onEditButtonClick:this.props.onEditButtonClick,renderAIOptimizeButton:this.props.renderAIOptimizeButton,isPremium:this.props.isPremium,onResultChange:this.props.onResultChange,shouldUpsellHighlighting:this.props.shouldUpsellHighlighting,renderHighlightingUpsell:this.props.renderHighlightingUpsell})})}render(){const{problemsResults:s,improvementsResults:e,goodResults:o,considerationsResults:r,errorsResults:n,upsellResults:i,headingLevel:l,resultCategoryLabels:a,id:u}=this.props,d=n.length,p=s.length,g=e.length,c=r.length,m=o.length,k=i.length,B={errors:(0,t.__)("Errors","wordpress-seo"),problems:(0,t.__)("Problems","wordpress-seo"),improvements:(0,t.__)("Improvements","wordpress-seo"),considerations:(0,t.__)("Considerations","wordpress-seo"),goodResults:(0,t.__)("Good results","wordpress-seo")},b=Object.assign(B,a);return(0,h.jsxs)(N,{children:[d>0&&this.renderCollapsible(b.errors,l,n),p+k>0&&this.renderCollapsible(b.problems,l,[...i,...s],u?`${u}-problems`:null),g>0&&this.renderCollapsible(b.improvements,l,e),c>0&&this.renderCollapsible(b.considerations,l,r),m>0&&this.renderCollapsible(b.goodResults,l,o)]})}}M.propTypes={onMarkButtonClick:l().func,onEditButtonClick:l().func,problemsResults:l().array,improvementsResults:l().array,goodResults:l().array,considerationsResults:l().array,errorsResults:l().array,upsellResults:l().array,headingLevel:l().number,marksButtonStatus:l().string,marksButtonClassName:l().string,markButtonFactory:l().func,editButtonClassName:l().string,activeMarker:l().string,isPremium:l().bool,resultCategoryLabels:l().shape({errors:l().string,problems:l().string,improvements:l().string,considerations:l().string,goodResults:l().string}),onResultChange:l().func,shouldUpsellHighlighting:l().bool,renderHighlightingUpsell:l().func,renderAIOptimizeButton:l().func,id:l().string},M.defaultProps={onMarkButtonClick:()=>{},onEditButtonClick:()=>{},problemsResults:[],improvementsResults:[],goodResults:[],considerationsResults:[],errorsResults:[],upsellResults:[],headingLevel:4,marksButtonStatus:"enabled",marksButtonClassName:"",markButtonFactory:null,editButtonClassName:"",activeMarker:"",isPremium:!1,resultCategoryLabels:{},onResultChange:()=>{},shouldUpsellHighlighting:!1,renderHighlightingUpsell:()=>{},renderAIOptimizeButton:()=>{},id:""};const S=M,H=p().div`
`,E=p().p`
	font-size: 14px;
`,T=({className:s="seo-assessment",seoAssessmentText:e="SEO Assessment",seoAssessmentItems:t=null,barHeight:o="24px"})=>(0,h.jsxs)(H,{className:s,children:[(0,h.jsx)(E,{className:`${s}__text`,children:e}),(0,h.jsx)(g.StackedProgressBar,{className:"progress",items:t,barHeight:o}),(0,h.jsx)(g.ScoreAssessments,{className:"assessments",items:t})]});T.propTypes={className:l().string,seoAssessmentText:l().string,seoAssessmentItems:l().arrayOf(l().shape({html:l().string.isRequired,value:l().number.isRequired,color:l().string.isRequired})),barHeight:l().string};const j=T;(window.yoast=window.yoast||{}).analysisReport=e})();