Files
brppfinanse.pl/wp-content/plugins/wordpress-seo/js/dist/introductions.js
2025-09-22 10:45:29 +02:00

7 lines
14 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.apiFetch;var s=e.n(t);const n=window.wp.data,a=window.wp.domReady;var i=e.n(a);const o=window.wp.hooks,r=window.wp.element,d=window.yoast.uiLibrary,l=window.lodash,c=window.yoast.reduxJsToolkit,u="adminUrl",m=(0,c.createSlice)({name:u,initialState:"",reducers:{setAdminUrl:(e,{payload:t})=>t}}),y=(m.getInitialState,{selectAdminUrl:e=>(0,l.get)(e,u,"")});y.selectAdminLink=(0,c.createSelector)([y.selectAdminUrl,(e,t)=>t],((e,t="")=>{try{return new URL(t,e).href}catch(t){return e}})),m.actions,m.reducer;const p="hasConsent",h=`${p}/storeConsent`,w=(0,c.createSlice)({name:p,initialState:{hasConsent:!1,endpoint:"yoast/v1/ai_generator/consent"},reducers:{giveAiGeneratorConsent:(e,{payload:t})=>{e.hasConsent=t},setAiGeneratorConsentEndpoint:(e,{payload:t})=>{e.endpoint=t}}}),g=w.getInitialState,x={selectHasAiGeneratorConsent:e=>(0,l.get)(e,[p,"hasConsent"],w.getInitialState().hasConsent),selectAiGeneratorConsentEndpoint:e=>(0,l.get)(e,[p,"endpoint"],w.getInitialState().endpoint)},f={...w.actions,storeAiGeneratorConsent:function*(e,t){try{yield{type:h,payload:{consent:e,endpoint:t}}}catch(e){return!1}return yield{type:`${p}/giveAiGeneratorConsent`,payload:e},!0}},v={[h]:async({payload:e})=>await s()({path:e.endpoint,method:"POST",data:{consent:e.consent},parse:!1})},b=w.reducer,S=window.wp.url,j="linkParams",C=(0,c.createSlice)({name:j,initialState:{},reducers:{setLinkParams:(e,{payload:t})=>t}}),k=C.getInitialState,I={selectLinkParam:(e,t,s={})=>(0,l.get)(e,`${j}.${t}`,s),selectLinkParams:e=>(0,l.get)(e,j,{})};I.selectLink=(0,c.createSelector)([I.selectLinkParams,(e,t)=>t,(e,t,s={})=>s],((e,t,s)=>(0,S.addQueryArgs)(t,{...e,...s})));const _=C.actions,N=C.reducer,E=(0,c.createSlice)({name:"notifications",initialState:{},reducers:{addNotification:{reducer:(e,{payload:t})=>{e[t.id]={id:t.id,variant:t.variant,size:t.size,title:t.title,description:t.description}},prepare:({id:e,variant:t="info",size:s="default",title:n,description:a})=>({payload:{id:e||(0,c.nanoid)(),variant:t,size:s,title:n||"",description:a}})},removeNotification:(e,{payload:t})=>(0,l.omit)(e,t)}}),$=(E.getInitialState,E.actions,E.reducer,"pluginUrl"),L=(0,c.createSlice)({name:$,initialState:"",reducers:{setPluginUrl:(e,{payload:t})=>t}}),P=L.getInitialState,O={selectPluginUrl:e=>(0,l.get)(e,$,"")};O.selectImageLink=(0,c.createSelector)([O.selectPluginUrl,(e,t,s="images")=>s,(e,t)=>t],((e,t,s)=>[(0,l.trimEnd)(e,"/"),(0,l.trim)(t,"/"),(0,l.trimStart)(s,"/")].join("/")));const A=L.actions,M=L.reducer,R="request",W="success",B="error",T="idle",U="wistiaEmbedPermission",z=(0,c.createSlice)({name:U,initialState:{value:!1,status:T,error:{}},reducers:{setWistiaEmbedPermissionValue:(e,{payload:t})=>{e.value=Boolean(t)}},extraReducers:e=>{e.addCase(`${U}/${R}`,(e=>{e.status="loading"})),e.addCase(`${U}/${W}`,((e,{payload:t})=>{e.status="success",e.value=Boolean(t&&t.value)})),e.addCase(`${U}/${B}`,((e,{payload:t})=>{e.status="error",e.value=Boolean(t&&t.value),e.error={code:(0,l.get)(t,"error.code",500),message:(0,l.get)(t,"error.message","Unknown")}}))}}),G=z.getInitialState,F={selectWistiaEmbedPermission:e=>(0,l.get)(e,U,{value:!1,status:T}),selectWistiaEmbedPermissionValue:e=>(0,l.get)(e,[U,"value"],!1),selectWistiaEmbedPermissionStatus:e=>(0,l.get)(e,[U,"status"],T),selectWistiaEmbedPermissionError:e=>(0,l.get)(e,[U,"error"],{})},Y={...z.actions,setWistiaEmbedPermission:function*(e){yield{type:`${U}/${R}`};try{return yield{type:U,payload:e},{type:`${U}/${W}`,payload:{value:e}}}catch(t){return{type:`${U}/${B}`,payload:{error:t,value:e}}}}},V={[U]:async({payload:e})=>s()({path:"/yoast/v1/wistia_embed_permission",method:"POST",data:{value:Boolean(e)}})},q=z.reducer;var D;const H=(0,c.createSlice)({name:"documentTitle",initialState:(0,l.defaultTo)(null===(D=document)||void 0===D?void 0:D.title,""),reducers:{setDocumentTitle:(e,{payload:t})=>t}}),J=(H.getInitialState,H.actions,H.reducer,"yoast-seo/introductions"),Q=window.yoast.propTypes;var X=e.n(Q);const K=window.ReactJSXRuntime;window.YoastSEO=window.YoastSEO||{};const Z=(0,r.createContext)({}),ee=({children:e,initialComponents:t})=>{const[s,a]=(0,r.useState)(t),i=(0,n.useSelect)((e=>e(J).selectIntroductions()),[]),d=(0,r.useCallback)(((e,t)=>{(0,l.find)(i,{id:e})&&a((s=>({...s,[e]:t})))}),[i,a]);return(0,r.useEffect)((()=>{window.YoastSEO._registerIntroductionComponent=d,(0,o.doAction)("yoast.introductions.ready")}),[d]),(0,K.jsx)(Z.Provider,{value:s,children:e})};ee.propTypes={children:X().node.isRequired,initialComponents:X().object.isRequired};const te=()=>{const e=(0,n.useSelect)((e=>e(J).selectCurrentIntroduction()),[]),t=(0,r.useContext)(Z),s=(0,r.useMemo)((()=>null==t?void 0:t[null==e?void 0:e.id]),[e,t]);return s?(0,K.jsx)(s,{}):null},se=({children:e})=>{const[t,s]=(0,r.useState)(!0),n=(0,r.useRef)(null),a=(0,r.useCallback)((()=>s(!1)),[]);return(0,K.jsx)(d.Modal,{className:"yst-introduction-modal yst-h-[calc(100vh - 1rem)] sm:yst-h-[calc(100vh - 2rem)] md:yst-h-[calc(100vh - 5rem)]) yst-overflow-y-auto",isOpen:t,onClose:a,initialFocus:n,children:(0,K.jsx)(d.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-rounded-3xl",children:e})})};se.propTypes={children:X().node.isRequired};const ne=window.wp.i18n,ae=window.React,ie=ae.forwardRef((function(e,t){return ae.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:t},e),ae.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"}))})),oe=({thumbnail:e,buttonLink:t,buttonLabel:s=(0,ne.__)("Join the waitlist","wordpress-seo"),productName:n=(0,ne.sprintf)(/* translators: %1$s expands to Yoast AI brand insights. */
(0,ne.__)("Introducing %1$s","wordpress-seo"),"Yoast AI brand insights"),description:a=(0,ne.__)("Track visibility, control perception, and stay ahead - tools to manage your AI presence are coming soon!","wordpress-seo")})=>{const{onClose:i,initialFocus:o}=(0,d.useModalContext)();return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:[(0,K.jsx)("img",{className:"yst-w-full yst-h-auto yst-rounded-md yst-drop-shadow-md",alt:(0,ne.__)("Web chart showing aspects of brand visibility in AI responses","wordpress-seo"),loading:"lazy",decoding:"async",...e}),(0,K.jsx)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center",children:(0,K.jsxs)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center",children:[(0,K.jsx)("span",{className:"yst-ai-insights-icon"}),n]})})]}),(0,K.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,K.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,K.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:(0,ne.__)("How does your brand show up in AI responses?","wordpress-seo")}),(0,K.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:(0,K.jsx)("p",{children:a})})]}),(0,K.jsx)("div",{className:"yst-w-full yst-flex yst-mt-6",children:(0,K.jsxs)(d.Button,{as:"a",className:"yst-grow yst-border-slate-200 yst-ai-insights-waitlist-button",size:"extra-large",variant:"upsell",href:t,target:"_blank",ref:o,children:[(0,K.jsx)(ie,{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5 yst-text-white"}),s,(0,K.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */
(0,ne.__)("(Opens in a new browser tab)","wordpress-seo")})]})}),(0,K.jsx)(d.Button,{className:"yst-mt-2",variant:"tertiary",onClick:i,children:(0,ne.__)("Close","wordpress-seo")})]})]})},re=()=>{const e=(0,n.useSelect)((e=>e(J).selectImageLink("ai-brand-insights-pre-launch.png")),[]),t=(0,n.useSelect)((e=>e(J).selectLink("https://yoa.st/ai-brand-insights-introduction-pre-launch/")),[]),s=(0,r.useMemo)((()=>({src:e,width:"432",height:"243"})),[e]);return(0,K.jsx)(se,{children:(0,K.jsx)(oe,{buttonLink:t,thumbnail:s})})},de=ae.forwardRef((function(e,t){return ae.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:t},e),ae.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"}))})),le=({thumbnail:e,buttonLink:t,isWooEnabled:s})=>{const{onClose:n,initialFocus:a}=(0,d.useModalContext)(),i=(0,r.useMemo)((()=>s?"Yoast WooCommerce SEO":"Yoast SEO Premium"),[s]),o=(0,r.useMemo)((()=>{const e=s?"WooCommerce SEO":"Premium";return(0,ne.sprintf)(/* translators: %1$s expands to either Premium or WooCommerce SEO. */
(0,ne.__)("Get %1$s with 30%% off","wordpress-seo"),e)}),[s]),l=(0,r.useMemo)((()=>s?"yst-cart-icon":"yst-logo-icon"),[s]),c=(0,r.useMemo)((()=>s?"yst-woo-introduction-gradient":"yst-introduction-gradient"),[s]),u=(0,r.useMemo)((()=>s?"c7e7baa1-2020-420c-a427-89701700b607":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"),[s]),m=(0,r.useMemo)((()=>s?(0,ne.sprintf)(/* translators: %1$s expands to Premium, %2$s expands to Local, %3$s expands to News, %4$s expands to Video SEO, %5$s expands to Google. */
(0,ne.__)("We added even more value than ever this year: %1$s, %2$s, %3$s, %4$s, and seamless %5$s Docs add-on, all included. If you've been waiting to upgrade, nows the time..","wordpress-seo"),"Premium","Local","News","Video SEO","Google"):(0,ne.sprintf)(/* translators: %1$s expands to Local, %2$s expands to News, %3$s expands to Video SEO, %4$s expands to Google. */
(0,ne.__)("We added even more value than ever this year: %1$s, %2$s, %3$s, and seamless %4$s Docs add-on, all included. If you've been waiting to upgrade, nows the time.","wordpress-seo"),"Local","News","Video SEO","Google")),[s]);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:`yst-px-10 yst-pt-10 yst-text-center ${c}`,children:[(0,K.jsx)("img",{className:"yst-w-full yst-h-auto yst-rounded-md yst-drop-shadow-md",alt:(0,ne.__)("Thumbnail for the Black Friday announcement","wordpress-seo"),loading:"lazy",decoding:"async",...e}),(0,K.jsx)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center",children:(0,K.jsxs)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center",children:[(0,K.jsx)("span",{className:l}),i]})})]}),(0,K.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,K.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,K.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:(0,ne.__)("Black Friday: Our biggest sale just dropped!","wordpress-seo")}),(0,K.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:(0,K.jsx)("p",{children:m})})]}),(0,K.jsx)("div",{className:"yst-w-full yst-flex yst-mt-6",children:(0,K.jsxs)(d.Button,{as:"a",className:"yst-grow yst-border-slate-200",size:"extra-large",variant:"upsell",href:t,target:"_blank",ref:a,"data-action":"load-nfd-ctb","data-ctb-id":u,children:[(0,K.jsx)(de,{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5"}),o,(0,K.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */
(0,ne.__)("(Opens in a new browser tab)","wordpress-seo")})]})}),(0,K.jsx)(d.Button,{className:"yst-mt-2",variant:"tertiary",onClick:n,children:(0,ne.__)("Close","wordpress-seo")})]})]})},ce=()=>{const e=(0,n.useSelect)((e=>e(J).selectImageLink("black-friday-2025.gif")),[]),t=(0,r.useMemo)((()=>Boolean((0,l.get)(window,"wpseoIntroductions.isWooEnabled",!1))),[]),s=(0,n.useSelect)((e=>e(J).selectLink("https://yoa.st/black-friday-modal-premium/")),[]),a=(0,n.useSelect)((e=>e(J).selectLink("https://yoa.st/black-friday-modal-ecommerce/")),[]),i=(0,r.useMemo)((()=>({src:e,width:"432",height:"243"})),[e]);return(0,K.jsx)(se,{children:(0,K.jsx)(le,{buttonLink:t?a:s,thumbnail:i,isWooEnabled:t})})},ue="introductions",me=(0,c.createEntityAdapter)({selectId:e=>e.id,sortComparer:(e,t)=>e.priority===t.priority?0:e.priority<t.priority?-1:1}),ye=e=>({id:e.id||(0,c.nanoid)(),priority:e.priority||0}),pe=(0,c.createSlice)({name:ue,initialState:me.getInitialState({current:0}),reducers:{addIntroduction:{reducer:me.addOne,prepare:e=>({payload:ye(e)})},addIntroductions:{reducer:me.addMany,prepare:e=>({payload:(0,l.map)(e,ye)})},setIntroductions:{reducer:me.setAll,prepare:e=>({payload:(0,l.map)(e,ye)})}}}),he=pe.getInitialState,we=me.getSelectors((e=>(0,l.get)(e,ue,{}))),ge={selectCurrentIntroductionIndex:e=>(0,l.get)(e,[ue,"current"],0),selectIntroduction:we.selectById,selectIntroductions:we.selectAll};ge.selectCurrentIntroduction=(0,c.createSelector)([ge.selectCurrentIntroductionIndex,ge.selectIntroductions],((e,t)=>t[e]));const xe=pe.actions,fe=pe.reducer,ve="wpseoIntroductions";i()((()=>{const e=(0,l.get)(window,`${ve}.introductions`,[]);if((0,l.isEmpty)(e))return;const t={"ai-brand-insights-pre-launch":re,"black-friday-announcement":ce};if(-1!==location.href.indexOf("page=wpseo_dashboard#/first-time-configuration"))return window.YoastSEO._registerIntroductionComponent=t=>{(0,l.find)(e,{id:t})&&s()({path:`/yoast/v1/introductions/${t}/seen`,method:"POST",data:{is_seen:!1}})},Object.keys(t).forEach((e=>{window.YoastSEO._registerIntroductionComponent(e)})),void(0,o.doAction)("yoast.introductions.ready");((e={})=>{(0,n.register)((e=>(0,n.createReduxStore)(J,{actions:{...xe,..._,...A,...Y,...f},selectors:{...ge,...I,...O,...F,...x},initialState:(0,l.merge)({},{[ue]:he(),[j]:k(),[$]:P(),[U]:G(),[p]:g()},e),reducer:(0,n.combineReducers)({[ue]:fe,[j]:N,[$]:M,[U]:q,[p]:b}),controls:{...V,...v}}))(e))})({[j]:(0,l.get)(window,`${ve}.linkParams`,{}),[$]:(0,l.get)(window,`${ve}.pluginUrl`,""),[U]:{value:"1"===(0,l.get)(window,`${ve}.wistiaEmbedPermission`,!1)}}),(0,n.dispatch)(J).setIntroductions(e);const a={isRtl:Boolean((0,l.get)(window,`${ve}.isRtl`,!1))},i=document.createElement("div");i.id="wpseo-introductions",document.body.appendChild(i),(0,r.createRoot)(i).render((0,K.jsx)(d.Root,{context:a,children:(0,K.jsx)(ee,{initialComponents:t,children:(0,K.jsx)(te,{})})}))}))})();