芝麻web文件管理V1.00
编辑当前文件:/home/ezdajrnh/www/wp-content/plugins/wordpress-seo-premium/assets/js/dist/ai-generator-2300.min.js
(()=>{var e={951:(e,t)=>{var s;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t
{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React,t=window.wp.components,r=window.wp.data,a=window.wp.domReady;var o=s.n(a);const n=window.wp.hooks,i=window.wp.i18n,l=window.yoast.uiLibrary,c=window.lodash,u=window.yoast.reduxJsToolkit,m="adminUrl",p=(0,u.createSlice)({name:m,initialState:"",reducers:{setAdminUrl:(e,{payload:t})=>t}}),d=p.getInitialState,y={selectAdminUrl:e=>(0,c.get)(e,m,"")};y.selectAdminLink=(0,u.createSelector)([y.selectAdminUrl,(e,t)=>t],((e,t)=>{try{return new URL(t,e).href}catch(t){return e}}));const g=p.actions,w=p.reducer,h=window.wp.apiFetch;var f=s.n(h);const E="hasConsent",v=`${E}/storeConsent`,b=(0,u.createSlice)({name:E,initialState:!1,reducers:{giveAiGeneratorConsent:(e,{payload:t})=>t}}),S=b.getInitialState,_={selectHasAiGeneratorConsent:e=>(0,c.get)(e,E,!1)},k={...b.actions,storeAiGeneratorConsent:function*(e){try{yield{type:v,payload:e}}catch(e){return!1}return yield{type:`${E}/giveAiGeneratorConsent`,payload:e},!0}},x={[v]:({payload:e})=>f()({path:"yoast/v1/ai_generator/consent",method:"POST",data:{consent:e},parse:!1})},C=b.reducer,N="pluginUrl",T=(0,u.createSlice)({name:N,initialState:"",reducers:{setPluginUrl:(e,{payload:t})=>t}}),P=(T.getInitialState,{selectPluginUrl:e=>(0,c.get)(e,N,"")});P.selectImageLink=(0,u.createSelector)([P.selectPluginUrl,(e,t,s="assets/images")=>s,(e,t)=>t],((e,t,s)=>[(0,c.trimEnd)(e,"/"),(0,c.trim)(t,"/"),(0,c.trimStart)(s,"/")].join("/"))),T.actions,T.reducer;const R=window.wp.url,A="linkParams",I=(0,u.createSlice)({name:A,initialState:{},reducers:{setLinkParams:(e,{payload:t})=>t}}),$=(I.getInitialState,{selectLinkParam:(e,t,s={})=>(0,c.get)(e,`${A}.${t}`,s),selectLinkParams:e=>(0,c.get)(e,A,{})});$.selectLink=(0,u.createSelector)([$.selectLinkParams,(e,t)=>t],((e,t)=>(0,R.addQueryArgs)(t,e))),I.actions,I.reducer;const L="yoast-seo/editor",M="loading",q="showPlay",O="askPermission",F="isPlaying",B="wistiaEmbedPermission",D=(0,u.createSlice)({name:B,initialState:{value:!1,status:"idle",error:{}},reducers:{setWistiaEmbedPermissionValue:(e,{payload:t})=>{e.value=Boolean(t)}},extraReducers:e=>{e.addCase(`${B}/request`,(e=>{e.status=M})),e.addCase(`${B}/success`,((e,{payload:t})=>{e.status="success",e.value=Boolean(t&&t.value)})),e.addCase(`${B}/error`,((e,{payload:t})=>{e.status="error",e.value=Boolean(t&&t.value),e.error={code:(0,c.get)(t,"error.code",500),message:(0,c.get)(t,"error.message","Unknown")}}))}}),G=(D.getInitialState,D.actions,D.reducer,window.wp.element),U=window.yoast.propTypes;var W=s.n(U);const j="yoast-seo-premium/ai-generator",H="google",Y="social",z="twitter",V="title",K="description",X="product",Q="post",J="term",Z={post:"title",term:"term_title"},ee=(0,c.mapValues)(Z,(e=>`%%${e}%%`)),te={mobile:"mobile",desktop:"desktop"},se={idle:"idle",loading:"loading",success:"success",error:"error"},re="success",ae="error",oe="abort",ne=window.yoast.analysis;let ie,le=!1;const ce=["_formal","_informal","_ao90"],ue=e=>{for(const t of ce)if(e.endsWith(t))return e.slice(0,-t.length);return e},me="\\–\\-\\(\\)_\\[\\]’‘“”〝〞〟‟„\"'.?!:;,¿¡«»‹›—×+&۔؟،؛。。!‼?⁇⁉⁈‥…・ー、〃〄〆〇〈〉《》「」『』【】〒〓〔〕〖〗〘〙〚〛〜〝〞〟〠〶〼〽{}|~⦅⦆「」、[]・¥$%@&'()*/:;<>\\\<>";me.split(""),new RegExp("^["+me+"]+"),new RegExp("["+me+"]+$");const pe=new RegExp("["+me+"#$%&*+/=@^`{|}~ -¿–-⁊ -₠-⃀]","g"),de=e=>0===e.replace(pe,"").trim().length,ye={editType:V,previewType:H,postType:"post",contentType:Q},ge=(0,G.createContext)(ye),we=ge.Provider,he=()=>(0,G.useContext)(ge),fe=(0,c.get)(window,"yoast.editorModules.components.contexts.location.LocationContext",(0,G.createContext)("unknown")),Ee=()=>(0,G.useContext)(fe),ve=e=>{const t=(0,G.useRef)(null);return(0,G.useCallback)((s=>{(0,c.attempt)((()=>t.current&&t.current.disconnect())),null!==s&&(t.current=new ResizeObserver((t=>{(0,c.forEach)(t,(t=>e(t)))})),t.current.observe(s))}),[e])},be=(0,u.createSlice)({name:"suggestions",initialState:{status:se.loading,error:{code:200,message:""},entities:[],selected:""},reducers:{setLoading:e=>{e.status=se.loading},setSuccess:(e,{payload:t})=>{e.status=se.success,e.selected=t[0],e.entities.push(...t)},setError:(e,{payload:t})=>{e.status=se.error,e.error=t},setSelected:(e,{payload:t})=>{e.selected=t}}}),Se=e=>{switch(e){case Y:return"Facebook";case z:return"Twitter";default:return"Google"}},_e=window.yoast.searchMetadataPreviews,ke=e.forwardRef((function(t,s){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},t),e.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}))})),xe=e.forwardRef((function(t,s){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},t),e.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"}))})),Ce=({onGiveConsent:t,learnMoreLink:s,privacyPolicyLink:r,termsOfServiceLink:a,thumbnail:o,wistiaEmbedPermission:n})=>{const{onClose:c,initialFocus:u}=(0,l.useModalContext)(),[m,p]=(0,l.useToggleState)(!1),d=(0,G.useCallback)((()=>{c(),t(!0)}),[t,c]),y=(0,G.createInterpolateElement)((0,i.sprintf)(/* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */ /* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */ (0,i.__)("I approve the %1$sTerms of Service%2$s & %3$sPrivacy Policy%4$s of the Yoast AI service. This includes consenting to the collection and use of data to improve user experience.","wordpress-seo-premium"),"
","
","
","
"),{a1:(0,e.createElement)(Ne,{href:a}),a2:(0,e.createElement)(Ne,{href:r})});return(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst-items-center yst-p-10"},(0,e.createElement)("div",{className:"yst-relative yst-w-full"},(0,e.createElement)(Pe,{videoId:"vmrahpfjxp",thumbnail:o,wistiaEmbedPermission:n}),(0,e.createElement)(l.Badge,{className:"yst-absolute yst-top-0 yst-right-2 yst-mt-2 yst-ml-2",variant:"info"},"Beta")),(0,e.createElement)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium"},(0,e.createElement)("span",{className:"yst-introduction-modal-uppercase"},(0,i.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */ (0,i.__)("New to %1$s","wordpress-seo-premium"),"Yoast SEO Premium"))," ",(0,e.createElement)("span",{className:"yst-uppercase yst-text-slate-700"},"21.0")),(0,e.createElement)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center"},(0,e.createElement)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium"},(0,i.__)("Generate titles & descriptions with Yoast AI!","wordpress-seo-premium")),(0,e.createElement)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm"},(0,G.createInterpolateElement)((0,i.sprintf)(/* translators: %1$s and %2$s are anchor tag; %3$s is the arrow icon. */ /* translators: %1$s and %2$s are anchor tag; %3$s is the arrow icon. */ (0,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-premium"),"
","
","
"),{a:(0,e.createElement)(Ne,{href:s,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,e.createElement)(xe,{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"})}))),(0,e.createElement)("div",{className:"yst-flex yst-w-full yst-mt-6"},(0,e.createElement)("hr",{className:"yst-w-full yst-text-gray-200"})),(0,e.createElement)("div",{className:"yst-flex yst-items-start yst-mt-4"},(0,e.createElement)("input",{type:"checkbox",id:"yst-ai-consent-checkbox",name:"yst-ai-consent-checkbox",checked:m,value:m?"true":"false",onChange:p,className:"yst-checkbox__input",ref:u}),(0,e.createElement)("label",{htmlFor:"yst-ai-consent-checkbox",className:"yst-label yst-checkbox__label yst-text-xs yst-font-normal yst-text-slate-500"},y)),(0,e.createElement)("div",{className:"yst-w-full yst-flex yst-mt-4"},(0,e.createElement)(l.Button,{as:"button",className:"yst-grow",size:"large",disabled:!m,onClick:d},(0,i.__)("Start generating","wordpress-seo-premium"))),(0,e.createElement)(l.Button,{as:"button",className:"yst-mt-4",variant:"tertiary",onClick:c},(0,i.__)("Close","wordpress-seo-premium")))};Ce.propTypes={onGiveConsent:W().func.isRequired,learnMoreLink:W().string.isRequired,privacyPolicyLink:W().string.isRequired,termsOfServiceLink:W().string.isRequired,thumbnail:W().shape({src:W().string.isRequired,width:W().string,height:W().string}).isRequired,wistiaEmbedPermission:W().shape({value:W().bool.isRequired,status:W().string.isRequired,set:W().func.isRequired}).isRequired};const Ne=({href:t,children:s,...r})=>(0,e.createElement)(l.Link,{target:"_blank",rel:"noopener noreferrer",...r,href:t},s,(0,e.createElement)("span",{className:"yst-sr-only"},/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */ (0,i.__)("(Opens in a new browser tab)","wordpress-seo-premium")));Ne.propTypes={href:W().string.isRequired,children:W().node},Ne.defaultProps={children:null};const Te=window.yoast.reactHelmet,Pe=({videoId:t,thumbnail:s,wistiaEmbedPermission:r})=>{const[a,o]=(0,G.useState)(r.value?F:q),n=(0,G.useCallback)((()=>o(F)),[o]),c=(0,G.useCallback)((()=>{r.value?n():o(O)}),[r.value,n,o]),u=(0,G.useCallback)((()=>o(q)),[o]),m=(0,G.useCallback)((()=>{r.set(!0),n()}),[r.set,n]);return(0,e.createElement)(G.Fragment,null,r.value&&(0,e.createElement)(Te.Helmet,null,(0,e.createElement)("script",{src:"https://fast.wistia.com/assets/external/E-v1.js",async:!0})),(0,e.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"},a===q&&(0,e.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:c},(0,e.createElement)("img",{className:"yst-w-full yst-h-auto",alt:"",loading:"lazy",decoding:"async",...s})),a===O&&(0,e.createElement)("div",{className:"yst-absolute yst-inset-0 yst-flex yst-flex-col yst-items-center yst-justify-center yst-bg-white"},(0,e.createElement)("p",{className:"yst-max-w-xs yst-mx-auto yst-text-center"},r.status===M&&(0,e.createElement)(l.Spinner,null),r.status!==M&&(0,i.sprintf)(/* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */ /* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */ (0,i.__)("To see this video, you need to allow %1$s to load embedded videos from %2$s.","wordpress-seo-premium"),"Yoast SEO","Wistia")),(0,e.createElement)("div",{className:"yst-flex yst-mt-6 yst-gap-x-4"},(0,e.createElement)(l.Button,{type:"button",variant:"secondary",onClick:u,disabled:r.status===M},(0,i.__)("Deny","wordpress-seo-premium")),(0,e.createElement)(l.Button,{type:"button",variant:"primary",onClick:m,disabled:r.status===M},(0,i.__)("Allow","wordpress-seo-premium")))),r.value&&a===F&&(0,e.createElement)("div",{className:"yst-absolute yst-w-full yst-h-full yst-top-0 yst-left-0"},null===t&&(0,e.createElement)(l.Spinner,{className:"yst-h-full yst-mx-auto"}),null!==t&&(0,e.createElement)("div",{className:`wistia_embed wistia_async_${t} videoFoam=true`}))))};Pe.propTypes={videoId:W().string.isRequired,thumbnail:W().shape({src:W().string.isRequired,width:W().string,height:W().string}).isRequired,wistiaEmbedPermission:W().shape({value:W().bool.isRequired,status:W().string.isRequired,set:W().func.isRequired}).isRequired};const Re=()=>{const t=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-support")),[]);return(0,e.createElement)(l.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,i.__)("Something went wrong","wordpress-seo-premium")),(0,e.createElement)("p",{className:"yst-mt-2"},(0,G.createInterpolateElement)((0,i.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ (0,i.__)("Please try again later. If the issue persists, please %1$scontact our support team%2$s!","wordpress-seo-premium"),"
","
"),{a:(0,e.createElement)(Ne,{variant:"error",href:t})})))},Ae=()=>{const t=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-support")),[]);return(0,e.createElement)(l.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,i.__)("Not enough content","wordpress-seo-premium")),(0,e.createElement)("p",{className:"yst-mt-2"},(0,G.createInterpolateElement)((0,i.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ (0,i.__)("Please try again later. If the issue persists, please %1$scontact our support team%2$s!","wordpress-seo-premium"),"
","
"),{a:(0,e.createElement)(Ne,{variant:"error",href:t})})))},Ie=()=>{const t=(0,r.useSelect)((e=>e(j).selectAdminLink("?page=wpseo_page_settings#/site-features#card-wpseo-keyword_analysis_active")),[]),s=(0,G.useCallback)((()=>{window.location.reload()}),[]),{onClose:a}=(0,l.useModalContext)();return(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst-space-y-6 yst-mt-6"},(0,e.createElement)(l.Alert,{variant:"error"},(0,e.createElement)("p",null,(0,G.createInterpolateElement)((0,i.sprintf)( /** * translators: * %1$s expands to Yoast SEO. * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page. */ /** * translators: * %1$s expands to Yoast SEO. * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page. */ (0,i.__)("The AI title generator requires the SEO analysis to be enabled before use. To enable it, please navigate to the %2$sSite features of %1$s%3$s, turn on the SEO analysis, and click 'Save changes'. If the SEO analysis is disabled in your WordPress user profile, access your profile and enable it there. Please contact your administrator if you don't have access to these settings.","wordpress-seo-premium"),"Yoast SEO","
","
"),{a:(0,e.createElement)(Ne,{variant:"error",href:t})}))),(0,e.createElement)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 yst-place-content-end"},(0,e.createElement)(l.Button,{variant:"secondary",onClick:a},(0,i.__)("Close","wordpress-seo-premium")),(0,e.createElement)(l.Button,{className:"yst-revoke-button",variant:"primary",onClick:s},(0,i.__)("Refresh page","wordpress-seo-premium"))))},$e=()=>{const t=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-rate-limit-help")),[]);return(0,e.createElement)(l.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,i.__)("You've reached the Yoast AI rate limit.","wordpress-seo-premium")),(0,e.createElement)("p",{className:"yst-mt-2"},(0,G.createInterpolateElement)((0,i.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ (0,i.__)("To continue using the Yoast AI feature, kindly reduce the frequency of your requests. Our %1$shelp article%2$s provides guidance on effectively planning and pacing your requests for an optimized workflow.","wordpress-seo-premium"),"
","
"),{a:(0,e.createElement)(Ne,{variant:"error",href:t})})))},Le=({invalidSubscriptions:t})=>{const s=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-activate-premium")),[]),a=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-new-premium")),[]),o=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-activate-yoast-woocommerce")),[]),n=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-new-yoast-woocommerce")),[]),c=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-activate-woocommerce-premium-bundle")),[]),u=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-new-woocommerce-premium-bundle")),[]),{onClose:m}=(0,l.useModalContext)(),p=(0,G.useCallback)((async()=>{try{await f()({path:"yoast/v1/ai_generator/bust_subscription_cache",method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()}),[]);let d,y,g;1===t.length&&(d=t[0],y="Yoast SEO Premium"===d?s:o,g="Yoast SEO Premium"===d?a:n);const w=(0,G.createInterpolateElement)((0,i.sprintf)( /** * translators: * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. * %2$s expands to MyYoast. * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription. * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription. **/ /** * translators: * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. * %2$s expands to MyYoast. * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription. * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription. **/ (0,i.__)("To access this feature, you need an active %1$s subscription. Please %3$sactivate your subscription in %2$s%4$s or %5$sget a new %1$s subscription%6$s. Afterward, please refresh this page for the feature to function correctly, which may take up to 30 seconds.","wordpress-seo-premium"),d,"MyYoast","
","
","
","
"),{Activate:(0,e.createElement)(Ne,{variant:"error",href:y}),New:(0,e.createElement)(Ne,{variant:"error",href:g})}),h=(0,G.createInterpolateElement)((0,i.sprintf)( /** * translators: * %1$s expands to MyYoast. * %2$s expands to Yoast SEO Premium. * %3$s expands to Yoast WooCommerce SEO. * %4$s expands to Yoast WooCommerce SEO Premium bundle. * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to activate your subscription. * %7$s and %8$s expand to an opening and closing anchor tag, respectively, to get a new subscription. **/ /** * translators: * %1$s expands to MyYoast. * %2$s expands to Yoast SEO Premium. * %3$s expands to Yoast WooCommerce SEO. * %4$s expands to Yoast WooCommerce SEO Premium bundle. * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to activate your subscription. * %7$s and %8$s expand to an opening and closing anchor tag, respectively, to get a new subscription. **/ (0,i.__)("To access this feature, you need active %2$s and %3$s subscriptions. Please %5$sactivate your subscriptions in %1$s%6$s or %7$sget a new %4$s%8$s. Afterward, please refresh this page for the feature to function correctly, which may take up to 30 seconds.","wordpress-seo-premium"),"MyYoast","Yoast SEO Premium","Yoast WooCommerce SEO","Yoast WooCommerce SEO Premium bundle","
","
","
","
"),{Activate:(0,e.createElement)(Ne,{variant:"error",href:c}),New:(0,e.createElement)(Ne,{variant:"error",href:u})});return(0,e.createElement)(G.Fragment,null,(0,e.createElement)(l.Alert,{variant:"error"},(0,e.createElement)("p",null,1===t.length&&w,t.length>1&&h)),(0,e.createElement)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 yst-place-content-end"},(0,e.createElement)(l.Button,{variant:"secondary",onClick:m},(0,i.__)("Close","wordpress-seo-premium")),(0,e.createElement)(l.Button,{variant:"primary",onClick:p},(0,i.__)("Refresh page","wordpress-seo-premium"))))};Le.propTypes={invalidSubscriptions:W().array},Le.defaultProps={invalidSubscriptions:[]};const Me=()=>{const t=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-support")),[]);return(0,e.createElement)(l.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,i.__)("Connection timeout","wordpress-seo-premium")),(0,e.createElement)("p",{className:"yst-mt-2"},(0,G.createInterpolateElement)((0,i.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ (0,i.__)("It seems that a connection timeout has occurred. Please check your internet connection and try again later. If the issue persists, please %1$scontact our support team%2$s","wordpress-seo-premium"),"
","
"),{a:(0,e.createElement)(Ne,{variant:"error",href:t})})))},qe=()=>{const{editType:t}=he(),s=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-configure-page")),[]),a=(0,G.useMemo)((()=>t===K?(0,i.__)("Due to the OpenAI's strict ethical guidelines and %1$susage policies%2$s, we are unable to generate meta descriptions for your page. If you intend to use AI, kindly avoid the use of explicit, violent, or sexually explicit content. %3$sRead more on how to configure your page to make sure you get the best results with AI%4$s.","wordpress-seo-premium"):(0,i.__)("Due to the OpenAI's strict ethical guidelines and %1$susage policies%2$s, we are unable to generate SEO titles for your page. If you intend to use AI, kindly avoid the use of explicit, violent, or sexually explicit content. %3$sRead more on how to configure your page to make sure you get the best results with AI%4$s.","wordpress-seo-premium") /** * translators: %1$s and %2$s expand to an opening and closing anchor tag, respectively, that links to the usage policy. * %3$s and %4$s expand to an opening and closing anchor tag, respectively, that links to a configure page guide. */),[t]);return(0,e.createElement)(l.Alert,{variant:"error"},(0,e.createElement)("p",null,(0,G.createInterpolateElement)((0,i.sprintf)(a,"
","
","
","
"),{a1:(0,e.createElement)(Ne,{variant:"error",href:"https://openai.com/policies/usage-policies"}),a2:(0,e.createElement)(Ne,{variant:"error",href:s})})))},Oe=({errorMessage:t})=>{const s=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-support")),[]);return(0,e.createElement)(l.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,i.__)("Something went wrong","wordpress-seo-premium")),(0,e.createElement)("p",{className:"yst-mt-2"},(0,i.sprintf)(/* translators: %s is the error response of the request. */ /* translators: %s is the error response of the request. */ (0,i.__)('The request came back with the following error: "%s"',"wordpress-seo-premium"),t)),(0,e.createElement)("p",{className:"yst-mt-2"},(0,G.createInterpolateElement)((0,i.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ (0,i.__)("Please try again later. If the issue persists, please %1$scontact our support team%2$s!","wordpress-seo-premium"),"
","
"),{a:(0,e.createElement)(Ne,{variant:"error",href:s})})))};Oe.propTypes={errorMessage:W().string},Oe.defaultProps={errorMessage:""};const Fe=({currentSubscriptions:t,isSeoAnalysisActive:s})=>{const{postType:a}=he(),o=(0,r.useSelect)((e=>e(L).getIsWooCommerceActive()),[]),n=(0,G.useMemo)((()=>!t.wooCommerceSubscription&&a===X&&o),[o,a,t.wooCommerceSubscription]),i=[];return t.premiumSubscription||i.push("Yoast SEO Premium"),n&&i.push("Yoast WooCommerce SEO"),i.length>0?(0,e.createElement)(l.Modal.Container.Content,{className:"yst-pt-6"},(0,e.createElement)(Le,{invalidSubscriptions:i})):s?void 0:(0,e.createElement)(Ie,null)};Fe.propTypes={currentSubscriptions:W().object,isSeoAnalysisActive:W().bool};const Be=({onStartGenerating:t})=>{const s=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-terms-of-service")),[]),a=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-privacy-policy")),[]),o=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-learn-more")),[]),n=(0,r.useSelect)((e=>e(L).selectImageLink("ai-generator-preview.png")),[]),i=(0,G.useMemo)((()=>({src:n,width:"432",height:"244"})),[n]),l=(0,r.useSelect)((e=>e(L).selectWistiaEmbedPermissionValue()),[]),c=(0,r.useSelect)((e=>e(L).selectWistiaEmbedPermissionStatus()),[]),{setWistiaEmbedPermission:u}=(0,r.useDispatch)(L),m=(0,G.useMemo)((()=>({value:l,status:c,set:u})),[l,c,u]),{storeAiGeneratorConsent:p}=(0,r.useDispatch)(j),d=(0,G.useCallback)((()=>{p(!0),t()}),[p,t]);return(0,e.createElement)(Ce,{onGiveConsent:d,learnMoreLink:o,termsOfServiceLink:s,privacyPolicyLink:a,thumbnail:i,wistiaEmbedPermission:m})};Be.propTypes={onStartGenerating:W().func.isRequired};const De=e.forwardRef((function(t,s){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},t),e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))})),Ge=e.forwardRef((function(t,s){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:s},t),e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))})),Ue=/(?
<\/badge>|^(?!
))(?
[\s\S]+?)(?
|$)/g,We=({height:t})=>{const[s,a]=(0,G.useState)(""),{onClose:o}=(0,l.useModalContext)(),{editType:n,previewType:u,contentType:m}=he(),p=(()=>{const{editType:e,previewType:t}=he();let s="SEO";switch(t){case Y:s="social";break;case z:s="X"}switch(e){case V:return(0,i.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */ (0,i.__)("Generated %s titles","wordpress-seo-premium"),s);case K:return t===H&&(s="meta"),(0,i.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */ (0,i.__)("Generated %s descriptions","wordpress-seo-premium"),s)}})(),d=(()=>{const{editType:e,previewType:t}=he();let s="SEO";switch(t){case Y:s="social";break;case z:s="X"}switch(e){case V:return(0,i.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */ (0,i.__)("Apply %s title","wordpress-seo-premium"),s);case K:return t===H&&(s="meta"),(0,i.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */ (0,i.__)("Apply %s description","wordpress-seo-premium"),s)}})(),y=Ee(),{suggestions:g,fetchSuggestions:w,setSelectedSuggestion:h}=(()=>{const[e,t]=(0,G.useReducer)(be.reducer,be.getInitialState()),{editType:s,previewType:a,postType:o,contentType:n}=he(),i=(0,r.useSelect)((e=>e(L).getContentLocale()),[]),l=(0,r.useSelect)((e=>e(j).selectPromptContent()),[]);let u=(0,r.useSelect)((e=>e(L).getFocusKeyphrase()),[]);const m=(0,r.useSelect)((e=>e(L).getIsWooCommerceActive()),[]);u.length>191&&(u=u.slice(0,191));let p=s===K?"meta-description":"seo-title";return o===X&&m?p=`product-${p}`:n===J&&(p=`taxonomy-${p}`),{suggestions:e,fetchSuggestions:(0,G.useCallback)((async(e=!0)=>{t(be.actions.setLoading());const{status:s,payload:r}=await(async({type:e,promptContent:t,focusKeyphrase:s,platform:r,language:a})=>{let o;const n=1e3*(0,c.get)(window,"wpseoPremiumAiGenerator.requestTimeout",30);try{ie&&ie.abort(),ie=new AbortController,le=!1,o=setTimeout((()=>{le=!0,ie.abort()}),n);const i=await f()({path:"yoast/v1/ai_generator/get_suggestions/",method:"POST",data:{type:e,prompt_content:t,focus_keyphrase:s,platform:r,language:ue(a).replace("_","-")},parse:!1,signal:ie.signal}),l=await i.json();return{status:re,payload:l}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return le?{status:ae,payload:{message:"timeout",code:408}}:{status:oe};const{message:t,missingLicenses:s,errorIdentifier:r}=await(async e=>{try{const t=e.body.getReader(),{value:s}=await t.read(),r=new TextDecoder("utf-8").decode(s);return console.error(r),JSON.parse(r)}catch(e){return{message:"Unknown"}}})(e);return{status:ae,payload:{message:t,code:e.status||500,missingLicenses:s,errorIdentifier:r}}}finally{clearTimeout(o)}})({canAbort:e,type:p,promptContent:l,focusKeyphrase:u,platform:Se(a),language:i});switch(s){case oe:break;case ae:t(be.actions.setError(r));break;case re:t(be.actions.setSuccess(r))}return s}),[t]),setSelectedSuggestion:(0,G.useCallback)((e=>t(be.actions.setSelected(e))),[t])}})(),E=(()=>{const{previewType:e}=he();switch(e){case Y:return Je;case z:return mt;default:return He}})(),{addAppliedSuggestion:v}=(0,r.useDispatch)(j),b=(0,l.usePrevious)(t),[S,_]=(0,G.useState)(!1),k=(0,G.useCallback)((e=>{_(e.target.offsetHeight!==e.target.scrollHeight)}),[_]),x=ve(k),C=(()=>{const{editType:e,previewType:t,contentType:s}=he(),a=(()=>{const{previewType:e}=he();return(0,G.useMemo)((()=>{switch(e){case H:return()=>(0,r.select)(L).getSnippetEditorData().title;case Y:return(0,r.select)(L).getFacebookTitleOrFallback;case z:return(0,r.select)(L).getTwitterTitleOrFallback;default:return(0,c.constant)("")}}),[e])})(),o=(0,r.useSelect)((s=>s(j).selectAppliedSuggestionFor({editType:e,previewType:t})),[e,t]);return(0,G.useMemo)((()=>{let t=a();return e===K?t:(o&&(t=t.replace(o,ee[s])),((e,t)=>e.includes(ee[t])?e:ee[t])(t,s))}),[e,a])})(),N=(()=>{const e=(()=>{const{previewType:e}=he();return(0,G.useMemo)((()=>{switch(e){case H:return()=>(0,r.select)(L).getSnippetEditorData().description;case Y:return(0,r.select)(L).getFacebookDescriptionOrFallback;case z:return(0,r.select)(L).getTwitterDescriptionOrFallback;default:return(0,c.constant)("")}}),[e])})();return(0,G.useMemo)(e,[e])})(),T=(()=>{const e=(0,r.useSelect)((e=>{const t=e(L).getReplaceVars();return t.forEach((e=>{""!==e.value||["title","excerpt","excerpt_only"].includes(e.name)||(e.value="%%"+e.name+"%%"),e.badge=`
${e.label}
`})),t}),[]);return(0,G.useCallback)(((t,{key:s="value",overrides:r={},applyPluggable:a=!0,editType:o=V,contentType:n=Q}={})=>{for(const a of e)t=t.replace(new RegExp("%%"+(0,c.escapeRegExp)(a.name)+"%%","g"),(0,c.get)(r,a.name,a[s]));return n===J&&(t=t.replace(" Archives","")),a?((e,t=V)=>{const s=(0,c.get)(window,"yoast.editorModules.helpers.replacementVariableHelpers.applyReplaceUsingPlugin",(e=>({url:e.url,title:ne.languageProcessing.stripHTMLTags(e.title),description:ne.languageProcessing.stripHTMLTags(e.description)}))),r=ne.languageProcessing.stripSpaces(e),a=s({title:"",description:"",[t]:r});return(0,c.get)(a,t,e)})(t,o):t}),[e])})(),P=(0,G.useMemo)((()=>n===V?{[Z[m]]:g.selected}:{}),[n,m,g.selected]),R=(0,G.useMemo)((()=>T(C,{overrides:P,contentType:m})),[T,C,n,m,g.selected]),A=(0,G.useMemo)((()=>T(C,{overrides:{...P,sep:"",sitename:""},contentType:m})),[T,C,n,m,g.selected]),I=(0,G.useMemo)((()=>n===K?g.selected:T(N,{editType:K})),[T,N,n,g.selected]),$=(0,G.useCallback)((e=>T(C,{overrides:{[Z[m]]:e},key:"badge",applyPluggable:!1,contentType:m})),[T,C,m]),{currentPage:M,setCurrentPage:q,isOnLastPage:O,totalPages:F,getItemsOnCurrentPage:B}=(({totalItems:e=0,perPage:t=5})=>{const[s,r]=(0,G.useState)(1),a=(0,G.useMemo)((()=>Math.ceil(e/t)),[e,t]),o=(0,G.useMemo)((()=>s*t),[s,t]),n=(0,G.useMemo)((()=>o-t),[o,t]),i=(0,G.useMemo)((()=>1===s),[s]),l=(0,G.useMemo)((()=>s===a),[s,a]),u=(0,G.useCallback)((()=>{s>1&&r(s-1)}),[s,r]),m=(0,G.useCallback)((()=>{s
(0,c.slice)(e,n,o)),[n,o]);return{currentPage:s,setCurrentPage:r,totalPages:a,isOnFirstPage:i,isOnLastPage:l,previousPage:u,nextPage:m,firstOnPage:n,lastOnPage:o,getItemsOnCurrentPage:p}})({totalItems:g.status===se.loading||g.status===se.error?g.entities.length+5:g.entities.length,perPage:5}),D=(0,G.useMemo)((()=>(0,c.map)(B(g.entities),(t=>{let s=t;return n===V&&(s=$(t),s=s.replace(Ue,((e,t,s,r,a,o,{start:n,wrap:i,end:l})=>{const c=i.trim();return 0===c.length?`${n}${i}${l}`:`${n}
${c}
${l}`})),s=(0,G.createInterpolateElement)(s,{badge:(0,e.createElement)(l.Badge,{className:"yst-mr-2 last:yst-mr-0",variant:"plain"}," "),span:(0,e.createElement)("span",{className:"yst-flex yst-items-center yst-mr-2 last:yst-mr-0"})})),{value:t,label:s}}))),[g.entities,B,n,$]),U=(0,G.useMemo)((()=>g.status!==se.error||g.status===se.error&&!O),[g.status,O]),W=(0,G.useMemo)((()=>g.status===se.loading&&O),[g.status,O]),te=(0,G.useMemo)((()=>g.status===se.error&&O),[g.status,O]),ce=(0,G.useCallback)((()=>{q(g.status===se.error?F:F+1),w()}),[w,g.status,F,q,h]),me=(0,G.useCallback)((()=>a("")),[a]),pe=(()=>{const{editType:e}=he();switch(e){case V:return(()=>{const{previewType:e}=he(),{updateData:t,setFacebookPreviewTitle:s,setTwitterPreviewTitle:a}=(0,r.useDispatch)(L);return(0,G.useMemo)((()=>{switch(e){case H:return e=>t({title:e});case Y:return s;case z:return a;default:return c.noop}}),[e,t,s,a])})();case K:return(()=>{const{previewType:e}=he(),{updateData:t,setFacebookPreviewDescription:s,setTwitterPreviewDescription:a}=(0,r.useDispatch)(L);return(0,G.useMemo)((()=>{switch(e){case H:return e=>t({description:e});case Y:return s;case z:return a;default:return c.noop}}),[e,t,s,a])})();default:return c.noop}})(),de=(0,G.useCallback)((()=>{const e=n===V?C.replace(new RegExp(ee[m]+"( Archives)?"),g.selected):g.selected;pe(e),v({editType:n,previewType:u,suggestion:g.selected}),o()}),[pe,n,u,g.selected,C,o,v]);return(0,G.useEffect)((()=>{""===s&&w().then((e=>a(e)))}),[s,a,w]),s===ae||g.status===se.error&&402===g.error.code?(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst-space-y-6 yst-mt-6"},(0,e.createElement)(at,{errorCode:g.error.code,errorIdentifier:g.error.errorIdentifier,invalidSubscriptions:g.error.missingLicenses,showActions:!0,onRetry:me,errorMessage:g.error.message})):(0,e.createElement)(G.Fragment,null,(0,e.createElement)(l.Modal.Container.Content,{ref:x,className:"yst-flex yst-flex-col yst-py-6 yst-space-y-2"},(0,e.createElement)(E,{title:R,description:I,status:g.status,titleForLength:A,showPreviewSkeleton:""===s,showLengthProgress:!W}),U&&(W?(0,e.createElement)(lt,{idSuffix:y,suggestionClassNames:n===V?[["yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-8/12"]]:void 0}):(0,e.createElement)(G.Fragment,null,(0,e.createElement)("div",{className:"yst-flex yst-space-y-4"},(0,e.createElement)(l.Label,{as:"span",className:"yst-flex-grow yst-cursor-default yst-mt-auto"},p),(0,e.createElement)(l.Button,{variant:"secondary",size:"small",onClick:g.status===se.loading?c.noop:ce,isLoading:g.status===se.loading},g.status!==se.loading&&(0,e.createElement)(Ge,{className:"yst--ml-1 yst-mr-2 yst-h-4 yst-w-4 yst-text-gray-400"}),(0,i.__)("Generate 5 more","wordpress-seo-premium"))),(0,e.createElement)(it,{idSuffix:y,suggestions:D,selected:g.selected,onChange:h}),(0,e.createElement)("div",{className:"sm:yst-flex sm:yst-justify-between"},(0,e.createElement)("p",{className:"yst-text-slate-500 yst-text-[11px] yst-mt-1"},(0,i.__)("Text generated by AI may be offensive or inaccurate.","wordpress-seo-premium")),F>1&&(0,e.createElement)(l.Pagination,{current:M,total:F,onNavigate:q,disabled:g.status===se.loading,variant:"text" /* translators: Hidden accessibility text. */,screenReaderTextPrevious:(0,i.__)("Previous","wordpress-seo-premium") /* translators: Hidden accessibility text. */,screenReaderTextNext:(0,i.__)("Next","wordpress-seo-premium")})))),g.status===se.error&&O&&(0,e.createElement)(at,{errorCode:g.error.code,errorIdentifier:g.error.errorIdentifier,invalidSubscriptions:g.error.missingLicenses,errorMessage:g.error.message})),(0,e.createElement)(l.Modal.Container.Footer,null,S&&(0,e.createElement)("div",{className:"yst-absolute yst-inset-x-0 yst--mt-10 yst-mr-[calc(2.5rem-1px)] yst-h-10 yst-pointer-events-none yst-bg-gradient-to-t yst-from-slate-50"}),(0,e.createElement)("hr",{className:"yst-mb-6 yst--mx-6"}),(0,e.createElement)("div",{className:"sm:yst-flex sm:yst-justify-end sm:yst-space-x-2"},(0,e.createElement)("div",{className:"yst-hidden sm:yst-inline"},(0,e.createElement)(l.Button,{variant:"secondary",onClick:o},(0,i.__)("Close","wordpress-seo-premium"))),(0,e.createElement)("div",{className:"yst-block sm:yst-inline"},(0,e.createElement)(l.Button,{className:"yst-w-full sm:yst-w-auto",variant:"primary",onClick:de,disabled:""===g.selected||g.status===se.loading||te},(0,e.createElement)(De,{className:"yst--ml-1 yst-mr-1 yst-h-4 yst-w-4 yst-text-white"}),d)),(0,e.createElement)("div",{className:"yst-mt-4 sm:yst-hidden"},(0,e.createElement)(l.Button,{variant:"secondary",onClick:o,className:"yst-w-full sm:yst-w-auto"},(0,i.__)("Close","wordpress-seo-premium"))))),(g.status===se.success||g.status===se.loading)&&(0,e.createElement)(ut,{height:g.status===se.success?t:b}))};We.propTypes={height:W().number.isRequired};const je=({onUseAi:t})=>{const{editType:s,postType:a}=he(),o=Ee(),n=(()=>{const{editType:e,previewType:t}=he();switch(t){case Y:return e===K?(0,i.__)("AI social description generator","wordpress-seo-premium"):(0,i.__)("AI social title generator","wordpress-seo-premium");case z:return e===K?(0,i.__)("AI X description generator","wordpress-seo-premium"):(0,i.__)("AI X title generator","wordpress-seo-premium");default:return e===K?(0,i.__)("AI description generator","wordpress-seo-premium"):(0,i.__)("AI title generator","wordpress-seo-premium")}})(),[c,,,u,m]=(0,l.useToggleState)(!1),p=(0,G.useRef)(null),d=(0,r.useSelect)((e=>e(L).getFocusKeyphrase()),[]),y=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-help-button-modal")),[]),{closeEditorModal:g}=(0,r.useDispatch)(L),w=(0,r.useSelect)((e=>e(j).selectHasAiGeneratorConsent()),[]),h=(0,r.useSelect)((e=>e(j).selectProductSubscriptions()),[]),f=(0,r.useSelect)((e=>e(j).selectPremiumSubscription()),[]),E=(0,r.useSelect)((e=>e(j).selectWooCommerceSubscription()),[]),v=(0,r.useSelect)((e=>e(L).getPreference("isKeywordAnalysisActive",!0)),[]),b=(0,r.useSelect)((e=>e(L).getIsWooCommerceActive()),[]),S=(0,i.__)("Close modal","wordpress-seo-premium"),_=function(e,t,s,r,a){return e===X&&a?t&&s&&r:t&&r}(a,f,E,v,b),k=(0,G.useCallback)((()=>{if(de(d))return m(),g(),void setTimeout((()=>(e=>{const t=`focus-keyword-input-${"modal"===e?"sidebar":e}`;if("metabox"===e){const e=document.getElementById("wpseo-meta-tab-content");e&&e.click()}const s=document.getElementById(t);s&&s.focus()})(o)),0);u()}),[d,u,m,g,o]),x=(0,G.useCallback)((()=>{v?k():u()}),[k,v,u]),C=(0,G.useCallback)((()=>{t(),u(),w&&v&&k()}),[t,u,w,v,k]),N=(0,l.useSvgAria)(),[T,P]=(0,G.useState)(0),R=(0,G.useCallback)((e=>P(e.borderBoxSize[0].blockSize)),[P]),A=ve(R);return(0,e.createElement)(G.Fragment,null,(0,e.createElement)("button",{type:"button",id:`yst-replacevar__use-ai-button__${s}__${o}`,className:"yst-replacevar__use-ai-button",onClick:C},(0,i.__)("Use AI","wordpress-seo-premium")),(0,e.createElement)(l.Modal,{className:"yst-introduction-modal",isOpen:!w&&c,onClose:m,initialFocus:p},(0,e.createElement)(l.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-introduction-modal-panel yst-rounded-3xl",closeButtonScreenReaderText:S},(0,e.createElement)(Be,{onStartGenerating:x,focusElementRef:p}))),(0,e.createElement)(l.Modal,{className:"yst-ai-modal",isOpen:w&&c,onClose:m},(0,e.createElement)(l.Modal.Panel,{ref:A,className:"yst-max-w-3xl yst-relative",closeButtonScreenReaderText:S},(0,e.createElement)(l.Modal.Container,null,(0,e.createElement)(l.Modal.Container.Header,null,(0,e.createElement)("div",{className:"yst-flex yst-items-center"},(0,e.createElement)("span",{className:"yst-logo-icon yst-h-5 yst-w-5"}),(0,e.createElement)(l.Modal.Title,{className:"yst-ml-3 yst-mr-1.5",as:"h1",size:"2"},n),(0,e.createElement)(l.Link,{id:"ai-modal-learn-more",href:y,variant:"primary",className:"yst-no-underline yst-mr-2",target:"_blank",rel:"noopener" /* translators: Hidden accessibility text. */,"aria-label":(0,i.__)("Learn more about AI (Opens in a new browser tab)","wordpress-seo-premium")},(0,e.createElement)(ke,{...N,className:"yst-w-4 yst-h-4 yst-text-slate-500"})),(0,e.createElement)(l.Badge,{variant:"info"},"Beta")),(0,e.createElement)("hr",{className:"yst-mt-6 yst--mx-6"})),_?(0,e.createElement)(We,{height:T}):(0,e.createElement)(Fe,{currentSubscriptions:h,isSeoAnalysisActive:v})))))};je.propTypes={onUseAi:W().func.isRequired};const He=({title:t,description:s,status:a,titleForLength:o,showPreviewSkeleton:n,showLengthProgress:c})=>{const u=(0,r.useSelect)((e=>e(L).getSnippetEditorMode()),[]),[m,p]=(0,G.useState)(u),{editType:d}=he(),y=Ee(),g=(({editType:e,title:t,description:s})=>{const a=(0,r.useSelect)((e=>e(L).getDateFromSettings()),[]),o=(0,r.useSelect)((e=>e(L).getContentLocale()),[]),n=(0,r.useSelect)((e=>e(L).isCornerstoneContent()),[]),i=(0,r.useSelect)((e=>e(L).getIsTerm()),[]);return(0,G.useMemo)((()=>e===K?(0,_e.getDescriptionProgress)(s,a,n,i,o):(0,_e.getTitleProgress)(t)),[e,t,s,a,n,i,o])})({editType:d,title:o,description:s});return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"lg:yst-flex"},(0,e.createElement)(l.Label,{as:"span",className:"yst-flex-grow yst-cursor-default lg:yst-mb-2"},(0,i.__)("Google preview","wordpress-seo-premium")),(0,e.createElement)(Qe,{mode:m,idSuffix:y,onChange:p,disabled:a===se.loading})),n?(0,e.createElement)(ze,null):(0,e.createElement)(Ye,{mode:m,title:t,description:s}),(0,e.createElement)("div",{className:"yst-mt-6"},(0,e.createElement)(l.Label,{as:"span",className:"yst-flex-grow yst-cursor-default"},d===V&&(0,i.__)("SEO title width","wordpress-seo-premium"),d===K&&(0,i.__)("Meta description length","wordpress-seo-premium")),(0,e.createElement)(Xe,{className:"yst-mt-2",progress:c?g.actual:0,min:0,max:g.max,score:g.score})))};He.propTypes={title:W().string.isRequired,description:W().string.isRequired,status:W().oneOf(Object.keys(se)).isRequired,titleForLength:W().string.isRequired,showPreviewSkeleton:W().bool.isRequired,showLengthProgress:W().bool.isRequired};const Ye=({mode:t,title:s,description:a})=>{const o=(0,r.useSelect)((e=>e(L).getBaseUrlFromSettings()),[]),n=(0,r.useSelect)((e=>e(L).getSnippetEditorData().slug||""),[]),i=(0,r.useSelect)((e=>e(L).getDateFromSettings()),[]),l=(0,r.useSelect)((e=>e(L).getFocusKeyphrase()),[]),u=(0,r.useSelect)((e=>e(L).getSnippetEditorPreviewImageUrl()),[]),m=(0,r.useSelect)((e=>e(L).getSiteIconUrlFromSettings()),[]),p=(0,r.useSelect)((e=>e(L).getShoppingData()),[]),d=(0,r.useSelect)((e=>e(L).getSnippetEditorWordsToHighlight()),[]),y=(0,r.useSelect)((e=>e(L).getSiteName()),[]),g=(0,r.useSelect)((e=>e(L).getContentLocale()),[]),w=(0,G.useMemo)((()=>o+n),[o,n]);return(0,e.createElement)("div",{className:`yst-bg-slate-200 yst-p-2 yst--mx-6 ${t}`},(0,e.createElement)(_e.SnippetPreview,{title:s,description:a,mode:t,url:w,keyword:l,date:i,faviconSrc:m,mobileImageSrc:u,wordsToHighlight:d,siteName:y,locale:g,shoppingData:p,onMouseUp:c.noop}))};Ye.propTypes={mode:W().oneOf(Object.keys(te)).isRequired,title:W().string.isRequired,description:W().string.isRequired};const ze=()=>(0,e.createElement)("div",{className:"yst-max-w-[400px] yst-py-4 yst-px-3 yst-border yst-rounded-lg yst-w-full yst-mx-auto"},(0,e.createElement)("div",{className:"yst-flex yst-gap-x-3"},(0,e.createElement)(l.SkeletonLoader,{className:"yst-flex-shrink-0 yst-h-7 yst-w-7 yst-rounded-full"}),(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst-w-full yst-gap-y-1"},(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-2.5 yst-w-10/12"}))),(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-4 yst-w-full yst-mt-6 yst-mb-4"}),(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-3 yst-w-full"}),(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-3 yst-w-10/12 yst-mt-2.5"}));var Ve=s(951),Ke=s.n(Ve);const Xe=({className:t,progress:s,max:r,score:a})=>{const o=(0,G.useMemo)((()=>(e=>e>=7?"yst-score-good":e>=5?"yst-score-ok":"yst-score-bad")(a)),[a]);return(0,e.createElement)(l.ProgressBar,{className:Ke()("yst-length-progress-bar",o,t),progress:s,min:0,max:r})};Xe.propTypes={className:W().string,progress:W().number.isRequired,max:W().number.isRequired,score:W().number.isRequired},Xe.defaultProps={className:""};const Qe=({idSuffix:t,mode:s,onChange:r,disabled:a})=>{const o=(0,G.useCallback)((({target:e})=>e.checked&&r(e.value)),[r]);return(0,e.createElement)(l.RadioGroup,{id:`yst-ai-mode__${t}`,className:"yst-ai-mode sm:yst-pt-2 lg:yst-pt-0",disabled:a},(0,e.createElement)(l.RadioGroup.Radio,{id:`yst-ai-mode__mobile__${t}`,name:`yst-ai-mode__${t}`,label:(0,i.__)("Mobile result","wordpress-seo-premium"),value:te.mobile,checked:s===te.mobile,onChange:o,disabled:a}),(0,e.createElement)(l.RadioGroup.Radio,{id:`yst-ai-mode__desktop__${t}`,name:`yst-ai-mode__${t}`,label:(0,i.__)("Desktop result","wordpress-seo-premium"),value:te.desktop,checked:s===te.desktop,onChange:o,disabled:a}))};Qe.propTypes={idSuffix:W().string.isRequired,mode:W().oneOf(Object.keys(te)).isRequired,onChange:W().func.isRequired,disabled:W().bool.isRequired};const Je=({title:t,description:s,showPreviewSkeleton:r})=>(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"yst-flex yst-mb-6"},(0,e.createElement)(l.Label,{as:"span",className:"yst-flex-grow yst-cursor-default"},(0,i.__)("Social preview","wordpress-seo-premium"))),r?(0,e.createElement)(tt,null):(0,e.createElement)(et,{title:t,description:s}));Je.propTypes={title:W().string.isRequired,description:W().string.isRequired,showPreviewSkeleton:W().bool.isRequired};const Ze=window.yoast["social-metadata-previews"],et=({title:t,description:s})=>{const a=(0,r.useSelect)((e=>e(L).getSiteUrl()),[]),o=(0,r.useSelect)((e=>e(L).getFacebookImageUrl()),[]),n=(0,r.useSelect)((e=>e(L).getEditorDataImageFallback()),[]),i=(0,r.useSelect)((e=>e(L).getFacebookAltText()),[]);return(0,e.createElement)("div",{className:"yst-bg-slate-200 yst-p-2 yst--mx-6 yst-mx-auto"},(0,e.createElement)(Ze.FacebookPreview,{title:t,description:s,siteUrl:a,imageUrl:o,imageFallbackUrl:n,alt:i,onSelect:c.noop,onImageClick:c.noop,onMouseHover:c.noop}))};et.propTypes={title:W().string.isRequired,description:W().string.isRequired};const tt=()=>(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst-w-[527px] yst-border yst-mx-auto"},(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-[273px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,e.createElement)("div",{className:"yst-w-full yst-p-4 yst-space-y-1"},(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-3 yst-w-full"}))),st=()=>{const t=(0,r.useSelect)((e=>e(L).selectLink("https://yoa.st/ai-generator-support")),[]);return(0,e.createElement)(l.Alert,{variant:"error"},(0,e.createElement)("span",{className:"yst-block yst-font-medium"},(0,i.__)("Yoast AI cannot reach your site","wordpress-seo-premium")),(0,e.createElement)("p",{className:"yst-mt-2"},(0,G.createInterpolateElement)((0,i.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ (0,i.__)("To use this feature, your site must be publicly accessible. This applies to both test sites and instances where your REST API is password-protected. Please ensure your site is accessible to the public and try again. If the issue persists, please %1$scontact our support team%2$s.","wordpress-seo-premium"),"
","
"),{a:(0,e.createElement)(Ne,{variant:"error",href:t})})))},rt=({children:t,onRetry:s})=>{const{onClose:r}=(0,l.useModalContext)();return(0,e.createElement)(G.Fragment,null,t,(0,e.createElement)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 yst-place-content-end"},(0,e.createElement)(l.Button,{variant:"secondary",onClick:r},(0,i.__)("Close","wordpress-seo-premium")),(0,e.createElement)(l.Button,{variant:"primary",onClick:s},(0,i.__)("Try again","wordpress-seo-premium"))))};rt.propTypes={children:W().node.isRequired,onRetry:W().func.isRequired};const at=({errorCode:t,errorIdentifier:s,invalidSubscriptions:r,showActions:a,onRetry:o,errorMessage:n})=>{switch(t){case 400:switch(s){case"AI_CONTENT_FILTER":return(0,e.createElement)(qe,null);case"NOT_ENOUGH_CONTENT":return(0,e.createElement)(Ae,null);case"SITE_UNREACHABLE":return(0,e.createElement)(st,null);case"WP_HTTP_REQUEST_ERROR":return a?(0,e.createElement)(rt,{onRetry:o},(0,e.createElement)(Oe,{errorMessage:n})):(0,e.createElement)(Oe,{errorMessage:n});default:return a?(0,e.createElement)(rt,{onRetry:o},(0,e.createElement)(Re,null)):(0,e.createElement)(Re,null)}case 402:return(0,e.createElement)(Le,{invalidSubscriptions:r});case 408:return a?(0,e.createElement)(rt,{onRetry:o},(0,e.createElement)(Me,null)):(0,e.createElement)(Me,null);case 429:return(0,e.createElement)($e,null);default:return a?(0,e.createElement)(rt,{onRetry:o},(0,e.createElement)(Re,null)):(0,e.createElement)(Re,null)}};at.propTypes={errorCode:W().number.isRequired,errorIdentifier:W().string.isRequired,invalidSubscriptions:W().array,showActions:W().bool,onRetry:W().func,errorMessage:W().string},at.defaultProps={showActions:!1,onRetry:c.noop,invalidSubscriptions:[],errorMessage:""};const ot=W().shape({value:W().string.isRequired,label:W().node.isRequired}),nt=({id:t,name:s,suggestion:r,isChecked:a,onChange:o})=>{const n=(0,G.useCallback)((()=>o(r.value)),[r,o]);return(0,e.createElement)("label",{htmlFor:t,className:Ke()("yst-flex yst-p-4 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",a&&"yst-z-10 yst-border-primary-500")},(0,e.createElement)("input",{type:"radio",id:t,name:s,className:"yst-radio__input",value:r.value,checked:a,onChange:n}),(0,e.createElement)("div",{className:Ke()("yst-label yst-radio__label yst-flex yst-flex-wrap yst-items-center",!a&&"yst-text-slate-600")},r.label))};nt.propTypes={id:W().string.isRequired,name:W().string.isRequired,suggestion:ot.isRequired,isChecked:W().bool.isRequired,onChange:W().func.isRequired};const it=({idSuffix:t,suggestions:s,selected:r,onChange:a})=>(0,e.createElement)("div",null,(0,e.createElement)(l.RadioGroup,{className:"yst-suggestions-radio-group yst-flex yst-flex-col",id:`yst-ai-suggestions-radio-group__${t}`},s.map(((s,o)=>(0,e.createElement)(nt,{key:`yst-ai-suggestions-radio-${t}__${o}`,id:`yst-ai-suggestions-radio-${t}__${o}`,name:`ai-suggestion__${t}`,isChecked:s.value===r,onChange:a,suggestion:s})))));it.propTypes={idSuffix:W().string.isRequired,suggestions:W().arrayOf(ot).isRequired,selected:W().string.isRequired,onChange:W().func.isRequired};const lt=({suggestionClassNames:t})=>(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst--space-y-[1px]"},t.map(((t,s)=>(0,e.createElement)("div",{key:`yst-ai-suggestion-radio-skeleton__${s}`,className:"yst-flex yst-p-4 yst-gap-x-3 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md"},(0,e.createElement)("input",{type:"radio",disabled:!0,className:"yst-my-0.5"}),(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst-w-full"},t.map(((t,r)=>(0,e.createElement)(l.SkeletonLoader,{key:`yst-ai-suggestion-radio-skeleton-${s}__${r}`,className:t}))))))));lt.propTypes={suggestionClassNames:W().arrayOf(W().arrayOf(W().string))},lt.defaultProps={suggestionClassNames:[["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-8/12"]]};const ct="wpseo_premium_ai_generator",ut=({height:t})=>{const s=(0,r.useSelect)((e=>e(L).isAlertDismissed(ct)),[]),a=(0,r.useSelect)((e=>e(L).getEditorDataContent()),[]),o=(0,r.useSelect)((e=>e(L).getIsWooCommerceActive()),[]),[n,,,c]=(0,l.useToggleState)(!1),{editType:u,postType:m,contentType:p}=he(),{dismissAlert:d}=(0,r.useDispatch)(L),y=(0,G.useCallback)((()=>{d(ct)}),[d]),g=(0,G.useMemo)((()=>u===K?(0,i.__)("%1$sTip%2$s: Improve the accuracy of your generated AI descriptions by writing more content in your page.","wordpress-seo-premium"):(0,i.__)("%1$sTip%2$s: Improve the accuracy of your generated AI titles by writing more content in your page.","wordpress-seo-premium") /* translators: %1$s and %2$s expand to opening and closing of a span in order to emphasise the word. */),[u]),w=(0,G.useMemo)((()=>((e,t,s)=>e===X&&s||t===J?150:300)(m,p,o)),[m,p,o]);if(s||n||a.length>w)return null;const h=`calc(${0===t?"50%":t/2+"px"} - 50vh)`;return(0,e.createElement)(l.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{marginTop:h,marginBottom:h},position:"bottom-left"},(0,e.createElement)(l.Notifications.Notification,{id:"ai-generator-content-tip",variant:"info",dismissScreenReaderLabel:(0,i.__)("Dismiss","wordpress-seo-premium")},(0,G.createInterpolateElement)((0,i.sprintf)(g,"
","
"),{span:(0,e.createElement)("span",{className:"yst-font-medium yst-text-slate-800"})}),(0,e.createElement)("div",{className:"yst-flex yst-mt-3 yst--ml-3 yst-gap-1"},(0,e.createElement)(l.Button,{type:"button",variant:"tertiary",onClick:y},(0,i.__)("Don’t show again","wordpress-seo-premium")),(0,e.createElement)(l.Button,{type:"button",variant:"tertiary",className:"yst-text-slate-800",onClick:c},(0,i.__)("Dismiss","wordpress-seo-premium")))))};ut.propTypes={height:W().number.isRequired};const mt=({title:t,description:s,showPreviewSkeleton:r})=>(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"yst-flex yst-mb-6"},(0,e.createElement)(l.Label,{as:"span",className:"yst-flex-grow yst-cursor-default"},(0,i.__)("X preview","wordpress-seo-premium"))),r?(0,e.createElement)(dt,null):(0,e.createElement)(pt,{title:t,description:s}));mt.propTypes={title:W().string.isRequired,description:W().string.isRequired,showPreviewSkeleton:W().bool.isRequired};const pt=({title:t,description:s})=>{const a=(0,r.useSelect)((e=>e(L).getSiteUrl()),[]),o=(0,r.useSelect)((e=>e(L).getTwitterImageUrl()),[]),n=(0,r.useSelect)((e=>e(L).getFacebookImageUrl()),[]),i=(0,r.useSelect)((e=>e(L).getEditorDataImageFallback()),[]),l=(0,r.useSelect)((e=>e(L).getTwitterImageType()),[]),u=(0,r.useSelect)((e=>e(L).getTwitterAltText()),[]);return(0,e.createElement)("div",{className:"yst-bg-slate-200 yst-p-2 yst--mx-6"},(0,e.createElement)(Ze.TwitterPreview,{title:t,description:s,siteUrl:a,imageUrl:o,imageFallbackUrl:n||i,isLarge:"summary"!==l,alt:u,onSelect:c.noop,onImageClick:c.noop,onMouseHover:c.noop}))};pt.propTypes={title:W().string.isRequired,description:W().string.isRequired};const dt=()=>(0,e.createElement)("div",{className:"yst-flex yst-flex-col yst-max-h-[370px] yst-w-[507px] yst-border yst-rounded-t-[14px] yst-overflow-hidden yst-mx-auto"},(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-[265px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,e.createElement)("div",{className:"yst-w-full yst-p-4 yst-space-y-1"},(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,e.createElement)(l.SkeletonLoader,{className:"yst-h-3 yst-w-full"}))),yt="appliedSuggestions",gt=(0,u.createSlice)({name:yt,initialState:{},reducers:{addAppliedSuggestion:(e,{payload:{editType:t,previewType:s,suggestion:r}})=>{e[s]={...e[s],[t]:r}}}}),wt=gt.getInitialState,ht={selectAppliedSuggestions:e=>(0,c.get)(e,yt,{})};ht.selectAppliedSuggestionFor=(0,u.createSelector)([ht.selectAppliedSuggestions,(e,t)=>t],((e,{editType:t,previewType:s})=>(0,c.get)(e,[s,t],"")));const ft=gt.actions,Et=gt.reducer,vt="productSubscriptions",bt=(0,u.createSlice)({name:vt,initialState:{premiumSubscription:!1,wooCommerceSubscription:!1},reducers:{}}),St=bt.getInitialState,_t={selectProductSubscriptions:e=>(0,c.get)(e,vt,!1),selectPremiumSubscription:e=>(0,c.get)(e,`${vt}.premiumSubscription`),selectWooCommerceSubscription:e=>(0,c.get)(e,`${vt}.wooCommerceSubscription`)},kt=bt.actions,xt=bt.reducer,Ct="promptContent",Nt=(0,u.createSlice)({name:Ct,initialState:"",reducers:{setPromptContent:(e,{payload:t})=>t}}),Tt=Nt.getInitialState,Pt={selectPromptContent:e=>(0,c.get)(e,Ct,"")},Rt=Nt.actions,At=Nt.reducer;let It=!1;const $t=()=>{It||(It=!0,"1"!==(0,c.get)(window,"wpseoPremiumAiGenerator.hasSeenIntroduction",!1)&&(()=>{try{f()({path:"yoast/v1/introductions/ai-generate-titles-and-descriptions/seen/",method:"POST"})}catch(e){}})())},Lt=["attachment","product_cat","product_tag"],Mt=(s,{fieldId:r,type:a})=>{const o=(0,c.get)(window,"wpseoPremiumAiGenerator.postType",""),n=(0,c.get)(window,"wpseoPremiumAiGenerator.contentType",""),i=(0,c.get)(window,"wpseoScriptData.woocommerceUpsell",!1);if(Lt.includes(o)||i)return s;const u=function(e){return e.startsWith("yoast-google-preview")?H:e.startsWith("social")?Y:e.startsWith("x-")?z:void 0}(r);if(!u)return s;const m=(0,c.get)(window,"wpseoScriptData.metabox.isRtl",!1);return s.push((0,e.createElement)(t.Fill,{name:`yoast.replacementVariableEditor.additionalButtons.${r}`},(0,e.createElement)(l.Root,{context:{isRtl:m}},(0,e.createElement)(we,{value:{editType:a,previewType:u,postType:o,contentType:n}},(0,e.createElement)(je,{onUseAi:$t}))))),s},qt=(e,t)=>It&&(0,r.select)(j).selectHasAiGeneratorConsent()?(de(t)&&e.push((0,i.__)("Please enter a valid focus keyphrase.","wordpress-seo-premium")),e):e,Ot=()=>{const{setPromptContent:e}=(0,r.dispatch)(j);return()=>{(e=>{const t=(0,c.get)(window,"wpseoPremiumAiGenerator.postType","")===X,s=(0,c.get)(window,"wpseoPremiumAiGenerator.contentType","")===J,r=(0,c.get)(window,"wpseoScriptData.isWooCommerceActive",!1),a=t&&r||s?150:300,o=(0,c.get)(window,"YoastSEO.analysis.worker.runResearch",c.noop),n=(0,c.get)(window,"YoastSEO.analysis.collectData",!1);o("getParagraphs",n?ne.Paper.parse(n()):null).then((t=>{let s="";if(t.result){const e=t.result;if(e){let t=0;e.forEach((e=>{e.sentences.forEach((e=>{if(t+=e.tokens.length,t>a)return s;s+=e.text})),s+=" ",t+=1}))}}e(s.trimEnd()||".")}))})(e)}},Ft=()=>{Ot(),(0,r.subscribe)((0,c.debounce)((()=>{const{getEditorDataContent:e}=(0,r.select)("yoast-seo/editor"),t=(0,c.get)(window,"yoast.editorModules.helpers.createWatcher",c.noop),s=Ot();return setTimeout(s,1500),t(e,s)})(),1500,{maxWait:3e3}))};o()((()=>{((e={})=>{(0,r.register)((e=>(0,r.createReduxStore)(j,{actions:{...g,...k,...ft,...kt,...Rt},selectors:{...y,..._,...ht,..._t,...Pt},initialState:(0,c.merge)({},{[m]:d(),[E]:S(),[yt]:wt(),[vt]:St(),[Ct]:Tt()},e),reducer:(0,r.combineReducers)({[m]:w,[E]:C,[yt]:Et,[vt]:xt,[Ct]:At}),controls:{...x}}))(e))})({[m]:(0,c.get)(window,"wpseoPremiumAiGenerator.adminUrl",""),[E]:"1"===(0,c.get)(window,"wpseoPremiumAiGenerator.hasConsent",!1),[vt]:(0,c.get)(window,"wpseoPremiumAiGenerator.productSubscriptions",{})}),(0,n.addFilter)("yoast.replacementVariableEditor.additionalButtons","yoast/yoast-seo-premium/AiGenerator",Mt),(0,n.addFilter)("yoast.focusKeyphrase.errors","yoast/yoast-seo-premium/AiGenerator",qt),(0,n.addAction)("yoast.elementor.loaded","yoast/yoast-seo-premium/AiGenerator",Ft)})),window.jQuery(window).on("YoastSEO:ready",(()=>{Ft()}))})()})();