!function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=295)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){e.exports=window.yoast.styledComponents},115:function(e,t,o){"use strict";o.d(t,"b",(function(){return u})),o.d(t,"a",(function(){return d}));var n=o(0),r=o(18),a=o(17),c=o(77);const l=[];let s=null;class i extends n.Component{constructor(e){super(e),this.state={registeredComponents:[]}}registerComponent(e,t){this.setState({registeredComponents:[...this.state.registeredComponents,{key:e,Component:t}]})}render(){return this.state.registeredComponents.map(e=>{let{Component:t,key:o}=e;return Object(n.createElement)(t,{key:o})})}}function u(e,t){const o=Object(a.a)();s=Object(n.createRef)();const u={isRtl:o.isRtl};Object(n.render)(Object(n.createElement)(c.a,{theme:u,location:"sidebar"},Object(n.createElement)(r.SlotFillProvider,null,Object(n.createElement)(n.Fragment,null,t,Object(n.createElement)(i,{ref:s})))),document.getElementById(e)),l.forEach(e=>{s.current.registerComponent(e.key,e.Component)})}function d(e,t){null===s||null===s.current?l.push({key:e,Component:t}):s.current.registerComponent(e,t)}},153:function(e,t,o){"use strict";o.d(t,"a",(function(){return u}));var n=o(0),r=o(2),a=o.n(r),c=o(1),l=o(5),s=o(8),i=o(9);function u(e){let{name:t,title:o,subtitle:r,usps:a,id:u,image:d,finishableSteps:p,finishedSteps:m,upsellLink:f,upsellText:h,workout:k,badges:w}=e;const{openWorkout:b,toggleWorkout:E}=Object(l.useDispatch)("yoast-seo/workouts"),g=Object(l.useSelect)(e=>e("yoast-seo/workouts").getActiveWorkout(),[]),[O,y]=Object(n.useState)(!1),z=k,S=d;Object(n.useEffect)(()=>{p&&m&&m.length===p.length?y(!0):y(!1)},[m,p]);const v=Object(n.useMemo)(()=>m&&0!==m.length?m.length
{b(t),O&&E(t)},[k,O,b,E]),x=Object(i.makeOutboundLink)(),M=h||Object(c.sprintf)(
/* translators: %s : Expands to the add-on name. */
Object(c.__)("Unlock with %s!","wordpress-seo"),"Premium"),B=k?"":" card-disabled";return Object(n.createElement)(n.Fragment,null,!g&&Object(n.createElement)("div",{id:u,className:"card card-small"+B},Object(n.createElement)("h2",null,o," ",w),Object(n.createElement)("h3",null,r),Object(n.createElement)("div",{className:"workout-card-content-flex"},Object(n.createElement)("ul",{id:u+"-usp-list",className:"yoast-list--usp"},a.map((e,t)=>Object(n.createElement)("li",{id:`${u}-usp-${t}`,key:`${u}-${t}`},e))),d&&Object(n.createElement)(S,null)),Object(n.createElement)("span",null,k&&Object(n.createElement)(s.NewButton,{id:u+"-action-button",className:"yoast-button yoast-button--"+(O?"secondary":"primary"),onClick:j},v),!k&&Object(n.createElement)(x,{id:u+"-upsell-button",href:f,className:"yoast-button yoast-button-upsell","data-action":"load-nfd-ctb","data-ctb-id":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"},M,Object(n.createElement)("span",{"aria-hidden":"true",className:"yoast-button-upsell__caret"})),p&&m&&Object(n.createElement)("div",{className:"workout-card-progress"},Object(n.createElement)(s.ProgressBar,{id:u+"-progress",max:p.length,value:m.length}),Object(n.createElement)("label",{htmlFor:u+"-progress"},Object(n.createElement)("i",null,Object(c.sprintf)(// translators: %1$s: number of finished steps, %2$s: number of finishable steps
Object(c.__)("%1$s/%2$s steps completed","wordpress-seo"),m.length,p.length)))))),k&&g===t&&Object(n.createElement)(z,null))}u.propTypes={name:a.a.string.isRequired,title:a.a.string.isRequired,subtitle:a.a.string.isRequired,usps:a.a.arrayOf(a.a.string).isRequired,id:a.a.string,finishableSteps:a.a.arrayOf(a.a.string),finishedSteps:a.a.arrayOf(a.a.string),image:a.a.func,upsellLink:a.a.string,upsellText:a.a.string,workout:a.a.func,badges:a.a.arrayOf(a.a.element)},u.defaultProps={id:"",finishableSteps:null,finishedSteps:null,image:null,upsellLink:null,upsellText:null,workout:null,badges:[]}},17:function(e,t,o){"use strict";o.d(t,"a",(function(){return r}));var n=o(4);function r(){return Object(n.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}},18:function(e,t){e.exports=window.wp.components},2:function(e,t){e.exports=window.yoast.propTypes},20:function(e,t){e.exports=window.wp.compose},210:function(e,t,o){"use strict";o.d(t,"a",(function(){return f}));var n,r=o(0),a=o(2),c=o.n(a),l=o(1),s=o(5),i=o(153),u=o(3);function d(){return(d=Object.assign||function(e){for(var t=1;te("yoast-seo/workouts").getFinishedSteps(m.c.cornerstone)),u=n||"https://yoa.st/workout-cornerstone-upsell";return Object(r.createElement)(i.a,{id:"cornerstone-workout-card",name:m.c.cornerstone,title:Object(l.__)("The cornerstone approach","wordpress-seo"),subtitle:Object(l.__)("Rank with articles you want to rank with","wordpress-seo"),usps:[Object(l.__)("Make your important articles rank higher","wordpress-seo"),Object(l.__)("Bring more visitors to your articles","wordpress-seo")],image:p,finishableSteps:m.a.cornerstone,finishedSteps:c,upsellLink:u,upsellText:a,workout:t,badges:o})}f.propTypes={workout:c.a.func,badges:c.a.arrayOf(c.a.element),upsellLink:c.a.string,upsellText:c.a.string},f.defaultProps={workout:null,badges:[],upsellLink:null,upsellText:null}},211:function(e,t,o){"use strict";o.d(t,"a",(function(){return f}));var n,r=o(0),a=o(2),c=o.n(a),l=o(1),s=o(5),i=o(153),u=o(3);function d(){return(d=Object.assign||function(e){for(var t=1;te("yoast-seo/workouts").getFinishedSteps(m.c.orphaned)),u=n||"https://yoa.st/workout-orphaned-content-upsell";return Object(r.createElement)(i.a,{id:"orphaned-workout-card",name:m.c.orphaned,title:Object(l.__)("Orphaned content","wordpress-seo"),subtitle:Object(l.__)("Clean up your unlinked content to make sure people can find it","wordpress-seo"),usps:[Object(l.__)("Make pages easier for Google and visitors to find","wordpress-seo"),Object(l.__)("Add internal links to your posts and pages","wordpress-seo")],image:p,finishableSteps:m.a.orphaned,finishedSteps:c,upsellLink:u,upsellText:a,workout:t,badges:o})}f.propTypes={workout:c.a.func,badges:c.a.arrayOf(c.a.element),upsellLink:c.a.string,upsellText:c.a.string},f.defaultProps={workout:null,badges:[],upsellLink:null,upsellText:null}},22:function(e,t){e.exports=window.yoast.externals.contexts},25:function(e,t){e.exports=window.wp.apiFetch},295:function(e,t,o){"use strict";o.r(t);var n={};o.r(n),o.d(n,"REGISTER_WORKOUT",(function(){return _})),o.d(n,"FINISH_STEPS",(function(){return A})),o.d(n,"REVISE_STEP",(function(){return F})),o.d(n,"TOGGLE_WORKOUT",(function(){return T})),o.d(n,"SET_WORKOUTS",(function(){return C})),o.d(n,"OPEN_WORKOUT",(function(){return W})),o.d(n,"CLEAR_ACTIVE_WORKOUT",(function(){return R})),o.d(n,"TOGGLE_STEP",(function(){return L})),o.d(n,"MOVE_INDEXABLES",(function(){return D})),o.d(n,"CLEAR_INDEXABLES",(function(){return I})),o.d(n,"CLEAR_INDEXABLES_IN_STEPS",(function(){return P})),o.d(n,"registerWorkout",(function(){return N})),o.d(n,"finishSteps",(function(){return q})),o.d(n,"reviseStep",(function(){return G})),o.d(n,"toggleWorkout",(function(){return U})),o.d(n,"initWorkouts",(function(){return K})),o.d(n,"openWorkout",(function(){return $})),o.d(n,"clearActiveWorkout",(function(){return V})),o.d(n,"toggleStep",(function(){return X})),o.d(n,"moveIndexables",(function(){return H})),o.d(n,"clearIndexables",(function(){return J})),o.d(n,"clearIndexablesInSteps",(function(){return Q}));var r={};o.r(r),o.d(r,"getWorkouts",(function(){return Y})),o.d(r,"getFinishedSteps",(function(){return Z})),o.d(r,"getIndexablesByStep",(function(){return ee})),o.d(r,"getFinishedWorkouts",(function(){return te})),o.d(r,"getLoading",(function(){return oe})),o.d(r,"getActiveWorkout",(function(){return ne}));var a=o(0),c=o(5),l=o(18),s=o(52),i=o.n(s),u=o(25),d=o.n(u),p=o(20),m=o(4),f=o(2),h=o.n(f),k=o(1),w=o(8);function b(e){return Object(a.createElement)(l.Slot,{name:e.name},t=>0===t.length?e.children:t)}b.propTypes={name:h.a.string.isRequired,children:h.a.oneOfType([h.a.node,h.a.arrayOf(h.a.node)])},b.defaultProps={children:null};var E=o(210),g=o(211),O=o(43);const{workouts:y,upsellLink:z,upsellText:S}=window.wpseoWorkoutsData,v={[O.c.cornerstone]:()=>Object(a.createElement)(E.a,{badges:[Object(a.createElement)(w.PremiumBadge,{key:"premium-badge-cornerstone-workout"})],upsellLink:z,upsellText:S}),[O.c.orphaned]:()=>Object(a.createElement)(g.a,{badges:[Object(a.createElement)(w.PremiumBadge,{key:"premium-badge-orphaned-workout"})],upsellLink:z,upsellText:S})};function j(e){const{activeWorkout:t,clearActiveWorkout:o,openWorkout:n,workouts:r,loading:c,initWorkouts:s,saveWorkouts:i}=e;Object(a.useEffect)(()=>{if(!0===c)return s(y),void(window.location.hash&&window.location.hash.length>1&&("configuration"===window.location.hash.substr(1)?window.location.href=window.wpseoWorkoutsData.firstTimeConfigurationUrl:n(window.location.hash.substr(1))));i(r)},[r,c]);const u=Object(a.useMemo)(()=>{const e=Object.keys(r);return Object(m.sortBy)(e.map(e=>({...r[e],id:e})),"priority").map(e=>{if(v[e.id]){const t=v[e.id];return Object(a.createElement)(b,{key:e.id,name:""+e.id},Object(a.createElement)(t,null))}return Object(a.createElement)(l.Slot,{key:e.id,name:""+e.id})})},[r]);return Object(a.createElement)("div",{className:"wrap"},Object(a.createElement)("h1",{id:"workouts-page-title"},Object(k.__)("SEO workouts","wordpress-seo")),Object(a.createElement)("p",{id:"workouts-page-description"},Object(k.__)("Getting your site in shape and keeping it SEO fit can be hard. We can help you get started! Take these step-by-step workouts, and you’ll be tackling some of the most fundamental SEO challenges!","wordpress-seo")),t&&Object(a.createElement)(w.Button,{id:"yoast-workouts-back-to-workouts-button",onClick:o},// translators: %1$s translates to a leftward pointing arrow ( ← )
Object(k.sprintf)(Object(k.__)("%1$sBack to all workouts","worpdress-seo"),"← ")),Object(a.createElement)("div",{className:t?"":"workflows__index"},u))}j.propTypes={activeWorkout:h.a.string.isRequired,clearActiveWorkout:h.a.func.isRequired,openWorkout:h.a.func.isRequired,workouts:h.a.object.isRequired,loading:h.a.bool.isRequired,initWorkouts:h.a.func.isRequired,saveWorkouts:h.a.func.isRequired};const x=function(e){const t=Object(m.cloneDeep)(e);return Object.keys(e).forEach((function(o){e[o].indexablesByStep&&Object.keys(e[o].indexablesByStep).forEach((function(e){t[o].indexablesByStep[e]=t[o].indexablesByStep[e].filter((function(e){return!e.purge}))}))})),t};async function M(e){try{const t=await d()({path:"yoast/v1/workouts",method:"POST",data:x(e)});return await t.json}catch(e){return console.error(e.message),!1}}var B=Object(p.compose)([Object(c.withSelect)(e=>{const t=e("yoast-seo/workouts").getWorkouts(),o=e("yoast-seo/workouts").getLoading(),n=e("yoast-seo/workouts").getActiveWorkout(),r=e("yoast-seo/workouts").getFinishedWorkouts(),a=e("yoast-seo/workouts").getIndexablesByStep;return{workouts:t,loading:o,activeWorkout:n,finishedWorkouts:r,isStepFinished:(e,o)=>t[e].finishedSteps.includes(o),getIndexablesByStep:a}}),Object(c.withDispatch)(e=>{const{finishSteps:t,toggleStep:o,toggleWorkout:n,initWorkouts:r,clearActiveWorkout:a,openWorkout:c,moveIndexables:l,clearIndexablesInSteps:s}=e("yoast-seo/workouts");return{finishSteps:t,toggleStep:o,toggleWorkout:n,initWorkouts:r,clearActiveWorkout:a,openWorkout:c,moveIndexables:l,clearIndexablesInSteps:s,saveWorkouts:M}})])(j);const _="REGISTER_WORKOUT",A="FINISH_STEPS",F="REVISE_STEP",T="TOGGLE_WORKOUT",C="SET_WORKOUTS",W="OPEN_WORKOUT",R="CLEAR_ACTIVE_WORKOUT",L="TOGGLE_STEP",D="MOVE_INDEXABLES",I="CLEAR_INDEXABLES",P="CLEAR_INDEXABLES_IN_STEPS",N=(e,t)=>({type:_,payload:{key:e,priority:t}}),q=(e,t)=>({type:A,workout:e,steps:t}),G=(e,t)=>({type:F,workout:e,step:t}),U=e=>({type:T,workout:e}),K=e=>({type:C,workouts:e}),$=e=>(window.location.hash=e,{type:W,workout:e}),V=()=>(window.location.hash="",{type:R}),X=(e,t)=>({type:L,workout:e,step:t}),H=(e,t,o,n)=>({type:D,workout:e,indexables:t,fromStep:o,toStep:n}),J=e=>({type:I,workout:e}),Q=(e,t)=>({type:P,workout:e,steps:t}),Y=e=>e.workouts,Z=(e,t)=>Object(m.get)(e,`workouts.${t}.finishedSteps`,[]),ee=(e,t,o)=>e.workouts[t].indexablesByStep[o],te=e=>{const t=[];return Object.keys(e.workouts).forEach((function(o){O.a[o]&&e.workouts[o].finishedSteps.length===O.a[o].length&&t.push(o)})),t},oe=e=>e.loading,ne=e=>e.activeWorkout,re={loading:!0,activeWorkout:"",workouts:{cornerstone:{priority:50,finishedSteps:[],indexablesByStep:{[O.b.cornerstone.addLinks]:[],[O.b.cornerstone.checkLinks]:[],[O.b.cornerstone.chooseCornerstones]:[],[O.b.orphaned.improved]:[],[O.b.orphaned.skipped]:[]}},orphaned:{priority:50,finishedSteps:[],indexablesByStep:{[O.b.orphaned.improveRemove]:Object(m.get)(window,"wpseoPremiumWorkoutsData.orphaned",[]),[O.b.orphaned.update]:[],[O.b.orphaned.addLinks]:[],[O.b.orphaned.removed]:[],[O.b.orphaned.noindexed]:[],[O.b.orphaned.improved]:[],[O.b.orphaned.skipped]:[]}}}};var ae=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:re,o=arguments.length>1?arguments[1]:void 0;const n=Object(m.cloneDeep)(t);switch(o.type){case _:return n.workouts[o.payload.key]={finishedSteps:[],indexablesByStep:{},...n.workouts[o.payload.key],priority:o.payload.priority},n;case A:return n.workouts[o.workout].finishedSteps=Object(m.union)(t.workouts[o.workout].finishedSteps,o.steps),n;case F:return n.workouts[o.workout].finishedSteps=n.workouts[o.workout].finishedSteps.filter(e=>e!==o.step),n;case L:return t.workouts[o.workout].finishedSteps.includes(o.step)?(e=t.workouts[o.workout].finishedSteps.indexOf(o.step),e>-1&&(n.workouts[o.workout].finishedSteps=t.workouts[o.workout].finishedSteps.slice(),n.workouts[o.workout].finishedSteps.splice(e,1)),n):(n.workouts[o.workout].finishedSteps=Object(m.union)(t.workouts[o.workout].finishedSteps,[o.step]),n);case T:if(O.a[o.workout].length===t.workouts[o.workout].finishedSteps.length){n.workouts[o.workout].finishedSteps=[];for(const e of O.a[o.workout])re.workouts[o.workout].indexablesByStep&&(n.workouts[o.workout].indexablesByStep[e]=re.workouts[o.workout].indexablesByStep[e])}else n.workouts[o.workout].finishedSteps=O.a[o.workout];return n;case W:return n.activeWorkout=o.workout,n;case R:return n.activeWorkout="",n;case C:return n.workouts=Object(m.merge)(n.workouts,o.workouts),n.loading=!1,n;case D:return o.indexables.forEach((function(e){if(""!==o.fromStep){const t=n.workouts[o.workout].indexablesByStep[o.fromStep].findIndex(t=>t.id===e.id);n.workouts[o.workout].indexablesByStep[o.fromStep][t].purge=!0,n.workouts[o.workout].indexablesByStep[o.fromStep][t].movedTo=o.toStep}if(""!==o.toStep){const t=n.workouts[o.workout].indexablesByStep[o.toStep].findIndex(t=>t.id===e.id);-1===t?n.workouts[o.workout].indexablesByStep[o.toStep].push(e):(n.workouts[o.workout].indexablesByStep[o.toStep][t].purge=!1,n.workouts[o.workout].indexablesByStep[o.toStep][t].movedTo="")}})),n;case I:return n.workouts[o.workout].indexablesByStep=re.workouts[o.workout].indexablesByStep,n;case P:for(const e of o.steps)n.workouts[o.workout].indexablesByStep[e]=[];return n;default:return t}},ce=o(115);if(window.wp.data.createReduxStore){const e=Object(c.createReduxStore)("yoast-seo/workouts",{reducer:ae,actions:n,selectors:r});Object(c.register)(e)}else Object(c.registerStore)("yoast-seo/workouts",{reducer:ae,actions:n,selectors:r});window.wpseoWorkoutsData=window.wpseoWorkoutsData||{},window.wpseoWorkoutsData.registerWorkout=function(e,t,o){Object(c.dispatch)("yoast-seo/workouts").registerWorkout(e,t),Object(ce.a)(e,()=>Object(a.createElement)(l.Fill,{name:""+e},Object(a.createElement)(o,null)))},i()(()=>{Object(ce.b)("wpseo-workouts-container-free",Object(a.createElement)(B,null))})},3:function(e,t){e.exports=window.React},4:function(e,t){e.exports=window.lodash},43:function(e,t,o){"use strict";o.d(t,"c",(function(){return n})),o.d(t,"b",(function(){return r})),o.d(t,"a",(function(){return a}));const n={configuration:"configuration",cornerstone:"cornerstone",orphaned:"orphaned"},r={cornerstone:{chooseCornerstones:"chooseCornerstones",checkLinks:"checkLinks",addLinks:"addLinks",improved:"improved",skipped:"skipped"},orphaned:{improveRemove:"improveRemove",update:"update",addLinks:"addLinks",removed:"removed",noindexed:"noindexed",improved:"improved",skipped:"skipped"}},a={cornerstone:[r.cornerstone.chooseCornerstones,r.cornerstone.checkLinks,r.cornerstone.addLinks],orphaned:[r.orphaned.improveRemove,r.orphaned.update,r.orphaned.addLinks]}},5:function(e,t){e.exports=window.wp.data},52:function(e,t){e.exports=window.wp.domReady},77:function(e,t,o){"use strict";var n=o(0),r=o(2),a=o.n(r),c=o(11),l=o(22);const s=e=>{let{theme:t,location:o,children:r}=e;return Object(n.createElement)(l.LocationProvider,{value:o},Object(n.createElement)(c.ThemeProvider,{theme:t},r))};s.propTypes={theme:a.a.object.isRequired,location:a.a.oneOf(["sidebar","metabox","modal"]).isRequired,children:a.a.element.isRequired},t.a=s},8:function(e,t){e.exports=window.yoast.componentsNew},9:function(e,t){e.exports=window.yoast.helpers}});