laipower/wp-content/upgrade-temp-backup/plugins/jetpack-protect/jetpack_vendor/automattic/jetpack-my-jetpack/build/index.js

72 lines
406 KiB
JavaScript
Raw Normal View History

2024-10-09 12:44:43 +00:00
/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={9487:(e,t,a)=>{"use strict";a.d(t,{X:()=>c});const n={AED:{symbol:"د.إ.",grouping:",",decimal:".",precision:2},AFN:{symbol:"؋",grouping:",",decimal:".",precision:2},ALL:{symbol:"Lek",grouping:".",decimal:",",precision:2},AMD:{symbol:"֏",grouping:",",decimal:".",precision:2},ANG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AOA:{symbol:"Kz",grouping:",",decimal:".",precision:2},ARS:{symbol:"$",grouping:".",decimal:",",precision:2},AUD:{symbol:"A$",grouping:",",decimal:".",precision:2},AWG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AZN:{symbol:"₼",grouping:" ",decimal:",",precision:2},BAM:{symbol:"КМ",grouping:".",decimal:",",precision:2},BBD:{symbol:"Bds$",grouping:",",decimal:".",precision:2},BDT:{symbol:"৳",grouping:",",decimal:".",precision:0},BGN:{symbol:"лв.",grouping:" ",decimal:",",precision:2},BHD:{symbol:"د.ب.",grouping:",",decimal:".",precision:3},BIF:{symbol:"FBu",grouping:",",decimal:".",precision:0},BMD:{symbol:"$",grouping:",",decimal:".",precision:2},BND:{symbol:"$",grouping:".",decimal:",",precision:0},BOB:{symbol:"Bs",grouping:".",decimal:",",precision:2},BRL:{symbol:"R$",grouping:".",decimal:",",precision:2},BSD:{symbol:"$",grouping:",",decimal:".",precision:2},BTC:{symbol:"Ƀ",grouping:",",decimal:".",precision:2},BTN:{symbol:"Nu.",grouping:",",decimal:".",precision:1},BWP:{symbol:"P",grouping:",",decimal:".",precision:2},BYR:{symbol:"р.",grouping:" ",decimal:",",precision:2},BZD:{symbol:"BZ$",grouping:",",decimal:".",precision:2},CAD:{symbol:"C$",grouping:",",decimal:".",precision:2},CDF:{symbol:"FC",grouping:",",decimal:".",precision:2},CHF:{symbol:"CHF",grouping:"'",decimal:".",precision:2},CLP:{symbol:"$",grouping:".",decimal:",",precision:2},CNY:{symbol:"¥",grouping:",",decimal:".",precision:2},COP:{symbol:"$",grouping:".",decimal:",",precision:2},CRC:{symbol:"₡",grouping:".",decimal:",",precision:2},CUC:{symbol:"CUC",grouping:",",decimal:".",precision:2},CUP:{symbol:"$MN",grouping:",",decimal:".",precision:2},CVE:{symbol:"$",grouping:",",decimal:".",precision:2},CZK:{symbol:"Kč",grouping:" ",decimal:",",precision:2},DJF:{symbol:"Fdj",grouping:",",decimal:".",precision:0},DKK:{symbol:"kr.",grouping:"",decimal:",",precision:2},DOP:{symbol:"RD$",grouping:",",decimal:".",precision:2},DZD:{symbol:"د.ج.",grouping:",",decimal:".",precision:2},EGP:{symbol:"ج.م.",grouping:",",decimal:".",precision:2},ERN:{symbol:"Nfk",grouping:",",decimal:".",precision:2},ETB:{symbol:"ETB",grouping:",",decimal:".",precision:2},EUR:{symbol:"€",grouping:".",decimal:",",precision:2},FJD:{symbol:"FJ$",grouping:",",decimal:".",precision:2},FKP:{symbol:"£",grouping:",",decimal:".",precision:2},GBP:{symbol:"£",grouping:",",decimal:".",precision:2},GEL:{symbol:"Lari",grouping:" ",decimal:",",precision:2},GHS:{symbol:"₵",grouping:",",decimal:".",precision:2},GIP:{symbol:"£",grouping:",",decimal:".",precision:2},GMD:{symbol:"D",grouping:",",decimal:".",precision:2},GNF:{symbol:"FG",grouping:",",decimal:".",precision:0},GTQ:{symbol:"Q",grouping:",",decimal:".",precision:2},GYD:{symbol:"G$",grouping:",",decimal:".",precision:2},HKD:{symbol:"HK$",grouping:",",decimal:".",precision:2},HNL:{symbol:"L.",grouping:",",decimal:".",precision:2},HRK:{symbol:"kn",grouping:".",decimal:",",precision:2},HTG:{symbol:"G",grouping:",",decimal:".",precision:2},HUF:{symbol:"Ft",grouping:".",decimal:",",precision:0},IDR:{symbol:"Rp",grouping:".",decimal:",",precision:0},ILS:{symbol:"₪",grouping:",",decimal:".",precision:2},INR:{symbol:"₹",grouping:",",decimal:".",precision:2},IQD:{symbol:"د.ع.",grouping:",",decimal:".",precision:2},IRR:{symbol:"﷼",grouping:",",decimal:"/",precision:2},ISK:{symbol:"kr.",grouping:".",decimal:",",precision:0},JMD:{symbol:"J$",grouping:",",decimal:".",precision:2},JOD:{symbol:"د.ا.",grouping:",",decimal:".",precision:3},JPY:{symbol:"¥",grouping:",",decimal:".",precision:0},KES:{symbol:"S",grouping:",",decimal:".",precision:2},KGS:{symbol:"сом",grouping:" ",decimal:"-",precision:2},KHR:{symbol:"៛",grouping:",",decimal:".",precision:0},
__("Received invalid response while communicating with your WordPress site: %s","jetpack-my-jetpack"),this.parseError.message)}return(0,n.sprintf)(/* Translators: %d refers to numeric HTTP error code */
__("HTTP %d error received while communicating with the server.","jetpack-my-jetpack"),this.httpCode)}getDisplayBody(){return(0,r.b)(this.body)?JSON.stringify(this.body,null," "):(0,c.x)(this.body,"").substring(0,1e3)}getRestApiErrorMessage(){return __("Your site's REST API does not seem to be accessible. Jetpack Boost requires access to your REST API in order to receive site performance scores. Please make sure that your site's REST API is active and accessible, and try again.","jetpack-my-jetpack")}}},8426:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5736),c=a(2264),r=a(259);const __=n.__;async function s(e,t,a,c=null,s){const i={method:e,mode:"cors",headers:{"X-WP-Nonce":s}};"post"!==e&&"delete"!==e||!c||(i.body=JSON.stringify(c),i.headers["Content-Type"]="application/json");const o=function(e,t){return t+r.N+r.L+e}(a,t);let l;try{l=await fetch(o,i)}catch(e){const t=i;delete t.body,delete t.headers["X-WP-Nonce"];const a={requestInitiator:window.location.href,requestUrl:o,requestArgs:t,originalErrorMessage:e.toString()};throw new Error((0,n.sprintf)(/* Translators: %s refers to a string representation of an error object containing useful debug information */
__("An error occurred while trying to communicate with the site REST API. Extra debug info: %s","jetpack-my-jetpack"),JSON.stringify(a)))}return l}async function i(e,t,a,n=null,r){const i=await s(e,t,a,n,r);let o,l;try{o=await i.text()}catch(e){throw new c.M(i.status,null,e)}try{l=JSON.parse(o)}catch(e){throw new c.M(i.status,o,e)}if(!i.ok)throw new c.M(i.status,l,null);return l}const o={get:function(e,t,a){return i("get",e,t,null,a)},post:function(e,t,a=null,n){return i("post",e,t,a,n)}}},259:(e,t,a)=>{"use strict";a.d(t,{L:()=>c,N:()=>n});const n="jetpack-boost/v1",c=""},128:(e,t,a)=>{"use strict";a.d(t,{Fr:()=>g,tZ:()=>m,yn:()=>h});var n=a(5736),c=a(8426),r=a(1061),s=a(5146),i=a(6873),o=a(2653),l=a(2893);const __=n.__,u=12e4,d=5e3;async function m(e=!1,t,a,n){const r=p(await c.Z.post(t,e?"/speed-scores/refresh":"/speed-scores",{url:a},n));return r.scores?r.scores:await async function(e,t,a){return(0,o.Z)({timeout:u,interval:d,timeoutError:__("Timed out while waiting for speed-score.","jetpack-my-jetpack"),callback:async n=>{const r=p(await c.Z.post(e,"/speed-scores",{url:t},a));r.scores&&n(r.scores)}})}(t,a,n)}function p(e){if(e.error){const t=__("An unknown error occurred while requesting metrics","jetpack-my-jetpack");throw(0,l.V)(e.error,t)}if((0,i.b)(e.scores))return{status:"success",scores:{current:(0,i.b)(e.scores.current)?{mobile:(0,r.W)(e.scores.current.mobile,0),desktop:(0,r.W)(e.scores.current.desktop,0)}:{mobile:0,desktop:0},noBoost:(0,i.b)(e.scores.noBoost)?{mobile:(0,r.W)(e.scores.noBoost.mobile,0),desktop:(0,r.W)(e.scores.noBoost.desktop,0)}:null,isStale:!!e.scores.isStale}};const t=(0,s.x)(e.status);if(!t)throw new Error(__("Invalid response while requesting metrics","jetpack-my-jetpack"));return{status:t}}function h(e,t){const a=(e+t)/2;return a>90?"A":a>75?"B":a>50?"C":a>35?"D":a>25?"E":"F"}function g(e){const t=new Date(e),a=(new Date).valueOf()-t.valueOf();return Math.floor(a/864e5)}},1061:(e,t,a)=>{"use strict";function n(e,t=void 0){if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);if(!isNaN(t))return t}return t}a.d(t,{W:()=>n})},5146:(e,t,a)=>{"use strict";function n(e,t=void 0){return"string"==typeof e?e:e&&e.toString instanceof Function?e.toString():t}a.d(t,{x:()=>n})},6873:(e,t,a)=>{"use strict";function n(e){return!!e&&e instanceof Object&&!(e instanceof Array)}a.d(t,{b:()=>n})},2653:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(5736);const __=n.__;async function c({interval:e,callback:t,timeout:a,timeoutError:n}){let c,r;return new Promise(((s,i)=>{c=setTimeout((()=>{i(new Error(n||__("Timed out","jetpack-my-jetpack")))}),a||12e4),r=setInterval((async()=>{try{await Promise.resolve(t(s))}catch(e){i(e)}}),e)})).finally((()=>{clearTimeout(c),clearInterval(r)}))}},2893:(e,t,a)=>{"use strict";function n(e,t){return e instanceof Error?e:"string"==typeof e||e instanceof String?new Error(e.toString()):e.message?new Error(e.message):t?new Error(t):new Error(JSON.stringify(e))}a.d(t,{V:()=>n})},7121:(e,t,a)=>{"use strict";a.d(t,{Z:()=>h});var n=a(5609),c=a(5736),r=a(5235),s=a.n(r),i=a(5844),o=a.n(i),l=a(9196),u=a.n(l),d=a(526),m=a(2289);const __=c.__,p=e=>{const{label:t,onClick:a,isLoading:c=!1,loadingText:r,isDisabled:i,displayError:o=!1,errorMessage:l=__("An error occurred. Please try again.","jetpack-my-jetpack"),customClass:p}=e,h=r||u().createElement(n.Spinner,null);return u().createElement(u().Fragment,null,u().createElement(d.Z,{className:s()(m.Z.button,"jp-action-button--button",p),label:t,onClick:a,variant:"primary",disabled:c||i},c?h:t),o&&u().createElement("p",{className:s()(m.Z.error,"jp-action-button__error")},l))};p.propTypes={label:o().string.isRequired,onClick:o().func,isLoading:o().bool,isDisabled:o().bool,displayError:o().bool,errorMessage:o().oneOfType([o().string,o().element])};const h=p},9105:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(5736),c=a(5235),r=a.n(c),s=a(8237),i=a(8868),o=a(3846),l=a(3363),u=a(1494);const __=n.__,d=({children:e,moduleName:t=__("Jetpack","jetpack-my-jetpack"),moduleNameHref:a,showHeader:n=!0,showFooter:c=!0,showBackground:
__("(opens in a new tab)","jetpack-my-jetpack"))),N=w?"_blank":void 0,R=a?.[0]&&null!==a[0]&&"components-tooltip"!==a?.[0]?.props?.className;return m().createElement(r.Button,c()({target:N,variant:n,className:u()(_,{"has-text":!!d&&R}),icon:w?void 0:d,iconSize:h,disabled:g,"aria-disabled":g,isDestructive:v,text:E},b),f&&m().createElement(r.Spinner,null),m().createElement("span",null,a),C)}));h.displayName="Button";const g=h},9026:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});a(2404);const n=({format:e="horizontal",icon:t,imageUrl:a})=>React.createElement("div",{className:"jp-components__decorative-card "+(e?"jp-components__decorative-card--"+e:"")},React.createElement("div",{className:"jp-components__decorative-card__image",style:{backgroundImage:a?`url( ${a} )`:""}}),React.createElement("div",{className:"jp-components__decorative-card__content"},React.createElement("div",{className:"jp-components__decorative-card__lines"})),t?React.createElement("div",{className:"jp-components__decorative-card__icon-container"},React.createElement("span",{className:"jp-components__decorative-card__icon jp-components__decorative-card__icon--"+t})):null)},7172:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5736),c=a(5235),r=a.n(c),s=a(9196);a(5785);const __=n.__;class i extends s.Component{static defaultProps={"aria-hidden":"false",focusable:"true"};needsOffset(e,t){return["gridicons-arrow-left","gridicons-arrow-right","gridicons-calendar","gridicons-cart","gridicons-folder","gridicons-info","gridicons-info-outline","gridicons-posts","gridicons-star-outline","gridicons-star"].indexOf(e)>=0&&t%18==0}getSVGDescription(e){if("description"in this.props)return this.props.description;switch(e){default:return"";case"gridicons-audio":return __("Has audio.","jetpack-my-jetpack");case"gridicons-arrow-left":return __("Arrow left","jetpack-my-jetpack");case"gridicons-arrow-right":return __("Arrow right","jetpack-my-jetpack");case"gridicons-calendar":return __("Is an event.","jetpack-my-jetpack");case"gridicons-cart":return __("Is a product.","jetpack-my-jetpack");case"chevron-down":return __("Show filters","jetpack-my-jetpack");case"gridicons-comment":return __("Matching comment.","jetpack-my-jetpack");case"gridicons-cross":return __("Close.","jetpack-my-jetpack");case"gridicons-filter":return __("Toggle search filters.","jetpack-my-jetpack");case"gridicons-folder":return __("Category","jetpack-my-jetpack");case"gridicons-info":case"gridicons-info-outline":return __("Information.","jetpack-my-jetpack");case"gridicons-image-multiple":return __("Has multiple images.","jetpack-my-jetpack");case"gridicons-image":return __("Has an image.","jetpack-my-jetpack");case"gridicons-page":return __("Page","jetpack-my-jetpack");case"gridicons-post":return __("Post","jetpack-my-jetpack");case"gridicons-jetpack-search":case"gridicons-search":return __("Magnifying Glass","jetpack-my-jetpack");case"gridicons-tag":return __("Tag","jetpack-my-jetpack");case"gridicons-video":return __("Has a video.","jetpack-my-jetpack")}}renderIcon(e){switch(e){default:return null;case"gridicons-audio":return React.createElement("g",null,React.createElement("path",{d:"M8 4v10.184C7.686 14.072 7.353 14 7 14c-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V7h7v4.184c-.314-.112-.647-.184-1-.184-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3V4H8z"}));case"gridicons-arrow-left":return React.createElement("g",null,React.createElement("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}));case"gridicons-arrow-right":return React.createElement("g",null,React.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8-8-8z"}));case"gridicons-block":return React.createElement("g",null,React.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12c0-4.418 3.582-8 8-8 1.848 0 3.545.633 4.9 1.686L5.686 16.9C4.633 15.545 4 13.848 4 12zm8 8c-1.848 0-3.546-.633-4.9-1.686L18.314 7.1C19.367 8.455 20 10.152 20 12c0 4.418-3.582 8-8 8z"}));case"gridicons-calendar":return React.createElement("g",null,React.createElement("path",{d:"M
__("(opens in a new tab)","jetpack-my-jetpack"))),y=({moduleName:e=__("Jetpack","jetpack-my-jetpack"),className:t,moduleNameHref:a="https://jetpack.com",menu:n,onAboutClick:s,onPrivacyClick:i,onTermsClick:o,...l})=>{const[d]=(0,w.Z)("sm","<="),[f]=(0,w.Z)("md","<="),[y]=(0,w.Z)("lg",">"),{isActive:b,connectedPlugins:_}=(0,r.useSelect)((e=>{const t=e(h.t);return{connectedPlugins:t?.getConnectedPlugins(),...t.getConnectionStatus()}}),[h.t]),j=(0,g.Z)(),C=j&&b&&_?.some((({slug:e})=>"jetpack"===e));let N=[{label:_x("About","Link to learn more about Jetpack.","jetpack-my-jetpack"),title:__("About Jetpack","jetpack-my-jetpack"),href:C?new URL("admin.php?page=jetpack_about",j).href:(0,p.Z)("jetpack-about"),target:C?"_self":"_blank",onClick:s},{label:_x("Privacy","Shorthand for Privacy Policy.","jetpack-my-jetpack"),title:__("Automattic's Privacy Policy","jetpack-my-jetpack"),href:C?new URL("admin.php?page=jetpack#/privacy",j).href:(0,p.Z)("a8c-privacy"),target:C?"_self":"_blank",onClick:i},{label:_x("Terms","Shorthand for Terms of Service.","jetpack-my-jetpack"),title:__("WordPress.com Terms of Service","jetpack-my-jetpack"),href:(0,p.Z)("wpcom-tos"),target:"_blank",onClick:o}];n&&(N=[...N,...n]);const R=m().createElement(m().Fragment,null,m().createElement(k,null),e);return m().createElement("footer",c()({className:u()("jp-dashboard-footer",{"is-sm":d,"is-md":f,"is-lg":y},t),"aria-label":__("Jetpack","jetpack-my-jetpack")},l),m().createElement("ul",null,m().createElement("li",{className:"jp-dashboard-footer__jp-item"},a?m().createElement("a",{href:a},R):R),N.map((e=>{const t="button"===e.role,a=!t&&"_blank"===e.target;return m().createElement("li",{key:e.label},m().createElement("a",{href:e.href,title:e.title,target:e.target,onClick:e.onClick,onKeyDown:e.onKeyDown,className:u()("jp-dashboard-footer__menu-item",{"is-external":a}),role:e.role,rel:a?"noopener noreferrer":void 0,tabIndex:t?0:void 0},e.label,a&&m().createElement(E,null)))})),m().createElement("li",{className:"jp-dashboard-footer__a8c-item"},m().createElement("a",{href:C?new URL("admin.php?page=jetpack_about",j).href:(0,p.Z)("a8c-about"),"aria-label":__("An Automattic Airline","jetpack-my-jetpack")},m().createElement(v.Z,{"aria-hidden":"true"})))))}},8868:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(2674),c=a.n(n),r=a(5736),s=a(5235),i=a.n(s),o=a(9196),l=a.n(o);const __=r.__,u=({logoColor:e="#069e08",showText:t=!0,className:a,height:n=32,...r})=>{const s=t?"0 0 118 32":"0 0 32 32";return l().createElement("svg",c()({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:s,className:i()("jetpack-logo",a),"aria-labelledby":"jetpack-logo-title",height:n},r,{role:"img"}),l().createElement("title",{id:"jetpack-logo-title"},__("Jetpack Logo","jetpack-my-jetpack")),l().createElement("path",{fill:e,d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z"}),t&&l().createElement(l().Fragment,null,l().createElement("path",{d:"M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z"}),l().createElement("path",{d:"M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z"}),l().createElement("path",{d:"M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z"}),l().createElement("path",{d:"M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z"}),l().createElement("path",{d:"M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5V13 c-0.8-0.3-2-0.6-3.2-0.6c-1.7,0-3.2,0.9-3.2,3.6c0,2.9,1.5,3.8,3.3,3.8c0.9,0,1.9-0.2,3.2-0.7V21.3z"}),l().createElement("path",{d:"M110,15.2c0.2-0.3,0.2-
// translators: Name of the current feature
default:(0,n.sprintf)(__("%s coming soon","jetpack-my-jetpack"),a)}:{lg:t?v:f,default:t?a:(0,n.sprintf)(/* translators: Name of the current feature */
__("%s not included","jetpack-my-jetpack"),a)})(t,e,C),z=b?x.lg:x.default;return u().createElement("div",{className:o()(g.Z.item,g.Z.value)},u().createElement(c.Z,{className:o()(g.Z.icon,j?g.Z["icon-check"]:g.Z["icon-cross"]),size:32,icon:j?r.Z:s.Z}),u().createElement(h.ZP,{variant:"body-small"},i||z),Z&&u().createElement(d.Z,{title:E||R,iconClassName:g.Z["popover-icon"],className:o()(g.Z.popover,y),placement:"bottom-end",iconSize:14,offset:4,wide:Boolean(E&&p)},u().createElement(h.ZP,{variant:"body-small",component:"div"},p||N)))},y=({children:e})=>u().createElement("div",{className:g.Z.header},e),b=({primary:e=!1,children:t})=>{let a=0;return u().createElement("div",{className:o()(g.Z.card,{[g.Z["is-primary"]]:e})},l.Children.map(t,(e=>{const t=e;return t.type===E?(a++,(0,l.cloneElement)(t,{index:a-1})):t})))},_=({title:e,items:t,children:a,showIntroOfferDisclaimer:n=!1})=>{const[c]=(0,m.Z)("lg");return u().createElement(k.Provider,{value:t},u().createElement("div",{className:o()(g.Z.container,{[g.Z["is-viewport-large"]]:c}),style:{"--rows":t.length+1,"--columns":l.Children.toArray(a).length+1}},u().createElement("div",{className:g.Z.table},u().createElement(h.ZP,{variant:"headline-small"},e),c&&t.map(((e,a)=>u().createElement("div",{className:o()(g.Z.item,{[g.Z["last-feature"]]:a===t.length-1}),key:a},u().createElement(h.ZP,{variant:"body-small"},u().createElement("strong",null,e.name)),e.tooltipInfo&&u().createElement(d.Z,{title:e.tooltipTitle,iconClassName:g.Z["popover-icon"],className:g.Z.popover,placement:e.tooltipPlacement?e.tooltipPlacement:"bottom-end",iconSize:14,offset:4,wide:Boolean(e.tooltipTitle&&e.tooltipInfo)},u().createElement(h.ZP,{variant:"body-small"},e.tooltipInfo))))),a)),u().createElement("div",{className:g.Z["tos-container"]},u().createElement("div",{className:g.Z.tos},n&&u().createElement(h.ZP,{variant:"body-small"},__("Reduced pricing is a limited offer for the first year and renews at regular price.","jetpack-my-jetpack")),u().createElement(p.Z,{multipleButtons:!0}))))}},5347:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5736),c=a(5235),r=a.n(c),s=a(5106),i=a(3789),o=a(9184);const __=n.__,l=({price:e,offPrice:t,currency:a="",showNotOffPrice:n=!0,hideDiscountLabel:c=!0,promoLabel:l="",legend:u=__("/month, paid yearly","jetpack-my-jetpack"),isNotConvenientPrice:d=!1,hidePriceFraction:m=!1,children:p})=>{if(null==e&&null==t||!a)return null;n=n&&null!=t;const h="number"==typeof e&&"number"==typeof t?Math.floor((e-t)/e*100):0,g=!c&&h&&h>0?h+__("% off","jetpack-my-jetpack"):null;return React.createElement(React.Fragment,null,React.createElement("div",{className:o.Z.container},React.createElement("div",{className:r()(o.Z["price-container"],"product-price_container")},React.createElement(i.t,{value:t??e,currency:a,isOff:!d,hidePriceFraction:m}),n&&React.createElement(i.t,{value:e,currency:a,isOff:!1,hidePriceFraction:m}),g&&React.createElement(s.ZP,{className:r()(o.Z["promo-label"],"product-price_promo_label")},g))),React.createElement("div",{className:o.Z.footer},p||React.createElement(s.ZP,{className:r()(o.Z.legend,"product-price_legend")},u),l&&React.createElement(s.ZP,{className:r()(o.Z["promo-label"],"product-price_promo_label")},l)))}},3789:(e,t,a)=>{"use strict";a.d(t,{t:()=>o});var n=a(8899),c=a(5235),r=a.n(c),s=a(5106),i=a(9184);const o=({value:e,currency:t,isOff:a,hidePriceFraction:c})=>{const o=r()(i.Z.price,"product-price_price",{[i.Z["is-not-off-price"]]:!a}),{symbol:l,integer:u,fraction:d}=(0,n.LR)(e,t),m=!c||!d.endsWith("00");return React.createElement(s.ZP,{className:o,variant:"headline-medium",component:"p"},React.createElement(s.ZP,{className:i.Z.symbol,component:"sup",variant:"title-medium"},l),u,m&&React.createElement(s.ZP,{component:"sup",variant:"body-small","data-testid":"PriceFraction"},React.createElement("strong",null,d)))}},5033:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r);a(1683);const i=({color:e="#FFFFFF",className:t="",size:a=20})=>{const n=t+" jp-components-spinner",c={width:a,height:a,fontSize:a,borderTopColor:e},r={borderTopColo
__("By clicking the <strong>%s</strong> button, you agree to our <tosLink>Terms of Service</tosLink> and to <shareDetailsLink>share details</shareDetailsLink> with WordPress.com.","jetpack-my-jetpack"),e),{strong:React.createElement("strong",null),tosLink:React.createElement(d,{slug:"wpcom-tos"}),shareDetailsLink:React.createElement(d,{slug:"jetpack-support-what-data-does-jetpack-sync"})}),d=({slug:e,children:t})=>React.createElement("a",{className:"terms-of-service__link",href:(0,i.Z)(e),rel:"noopener noreferrer",target:"_blank"},t),m=({className:e,multipleButtons:t,agreeButtonLabel:a})=>React.createElement(o.ZP,{className:s()(e,"terms-of-service")},t?React.createElement(l,null):React.createElement(u,{agreeButtonLabel:a}))},6017:(e,t,a)=>{"use strict";a.d(t,{h:()=>n,s:()=>c});const n={"headline-medium":"h1","headline-small":"h2","headline-small-regular":"h2","title-medium":"h3","title-medium-semi-bold":"h3","title-small":"h4",body:"p","body-small":"p","body-extra-small":"p","body-extra-small-bold":"p",label:"p"},c=["mt","mr","mb","ml","mx","my","m","pt","pr","pb","pl","px","py","p"]},5106:(e,t,a)=>{"use strict";a.d(t,{Dx:()=>h,H3:()=>p,ZP:()=>m});var n=a(2674),c=a.n(n),r=a(5235),s=a.n(r),i=a(9196),o=a.n(i),l=a(6017),u=a(3280);const d=(0,i.forwardRef)((({variant:e="body",children:t,component:a,className:n,...r},d)=>{const m=a||l.h[e]||"span",p=(0,i.useMemo)((()=>l.s.reduce(((e,t)=>(void 0!==r[t]&&(e+=u.Z[`${t}-${r[t]}`]+" ",delete r[t]),e)),"")),[r]);return r.ref=d,o().createElement(m,c()({className:s()(u.Z.reset,u.Z[e],n,p)},r),t)}));d.displayName="Text";const m=d,p=({children:e,weight:t="bold",...a})=>{const n="headline-small"+("bold"===t?"":`-${t}`);return o().createElement(d,c()({variant:n,mb:3},a),e)},h=({children:e,size:t="medium",...a})=>o().createElement(d,c()({variant:`title-${t}`,mb:1},a),e)},8275:(e,t,a)=>{"use strict";a.d(t,{ZP:()=>m});var n=a(9196),c=a.n(n),r=a(3591);const s={"--font-headline-medium":"48px","--font-headline-small":"36px","--font-title-medium":"24px","--font-title-small":"20px","--font-body":"16px","--font-body-small":"14px","--font-body-extra-small":"12px","--font-title-large":"var(--font-headline-small)","--font-label":"var(--font-body-extra-small)"},i={"--jp-black":"#000000","--jp-black-80":"#2c3338","--jp-white":"#ffffff","--jp-white-off":"#f9f9f6","--jp-gray":"#dcdcde","--jp-gray-0":"#F6F7F7","--jp-gray-5":"var(--jp-gray)","--jp-gray-10":"#C3C4C7","--jp-gray-20":"#A7AAAD","--jp-gray-40":"#787C82","--jp-gray-50":"#646970","--jp-gray-60":"#50575E","--jp-gray-70":"#3C434A","--jp-gray-80":"#2C3338","--jp-gray-90":"#1d2327","--jp-gray-off":"#e2e2df","--jp-red-0":"#F7EBEC","--jp-red-5":"#FACFD2","--jp-red-40":"#E65054","--jp-red-50":"#D63638","--jp-red-60":"#B32D2E","--jp-red-70":"#8A2424","--jp-red-80":"#691C1C","--jp-red":"#d63639","--jp-yellow-5":"#F5E6B3","--jp-yellow-10":"#F2CF75","--jp-yellow-20":"#F0C930","--jp-yellow-30":"#DEB100","--jp-yellow-40":"#C08C00","--jp-yellow-50":"#9D6E00","--jp-yellow-60":"#7D5600","--jp-blue-20":"#68B3E8","--jp-blue-40":"#1689DB","--jp-pink":"#C9356E","--jp-green-0":"#f0f2eb","--jp-green-5":"#d0e6b8","--jp-green-10":"#9dd977","--jp-green-20":"#64ca43","--jp-green-30":"#2fb41f","--jp-green-40":"#069e08","--jp-green-50":"#008710","--jp-green-60":"#007117","--jp-green-70":"#005b18","--jp-green-80":"#004515","--jp-green-90":"#003010","--jp-green-100":"#001c09","--jp-green":"#069e08","--jp-green-primary":"var( --jp-green-40 )","--jp-green-secondary":"var( --jp-green-30 )"},o={"--jp-border-radius":"4px","--jp-menu-border-height":"1px","--jp-underline-thickness":"2px"},l={"--spacing-base":"8px"},u={},d=(e,t,a)=>{const n={...s,...i,...o,...l};for(const t in n)e.style.setProperty(t,n[t]);a&&e.classList.add(r.Z.global),t&&(u[t]={provided:!0,root:e})},m=({children:e=null,targetDom:t,id:a,withGlobalStyles:r=!0})=>{const s=(0,n.useRef)(),i=u?.[a]?.provided;return(0,n.useLayoutEffect)((()=>{if(!i)return t?d(t,a,r):void(s?.current&&d(s.current,a,r))}),[t,s,i,a,r]),t?c().createElement(c().Fragment,null,e):c().createElement("div",{ref:s},e)}},4706:(e,t,a)=>{"use strict";a
__("%1$s - %2$s","jetpack-my-jetpack"),e,t),value:t}))),{label:__("I want to add a license key manually","jetpack-my-jetpack"),value:""}]),[a,u]);(0,p.useEffect)((()=>{l(d?.length?d[0].value:"")}),[d]);const m=(0,p.useCallback)((e=>{l(e),c(e)}),[c]);return h().createElement(h().Fragment,null,h().createElement(s.SelectControl,{className:t,disabled:n,label:__("Select a license key","jetpack-my-jetpack"),value:i,options:d,onChange:m}),!u&&!i&&h().createElement(s.TextControl,{className:t,label:__("Input a license key","jetpack-my-jetpack"),value:r,onChange:c,disabled:n}))},f=e=>{const{activateLicense:t,availableLicenses:a,fetchingAvailableLicenses:o,isActivating:d,license:m,licenseError:f,onLicenseChange:w}=e,k=null!=f;(0,p.useEffect)((()=>{n.Z.tracks.recordEvent("jetpack_wpa_license_key_activation_view")}),[]);const E=k?"jp-license-activation-screen-controls--license-field-with-error":"jp-license-activation-screen-controls--license-field",y=a&&a.length;return h().createElement("div",{className:"jp-license-activation-screen-controls"},h().createElement("div",{className:"jp-license-activation-screen-controls--content"},h().createElement(c.Z,{showText:!1,height:48}),h().createElement("h1",null,__("Add a license key","jetpack-my-jetpack")),h().createElement("p",null,(0,i.createInterpolateElement)(__("<strong>Check your email</strong> for your license key. You should have received it after making your purchase.","jetpack-my-jetpack"),{strong:h().createElement("strong",null)})),o||y?h().createElement(v,{className:E,disabled:o||d,onChange:w,availableLicenses:o?null:a,value:m}):h().createElement(g,{className:E,disabled:d,onChange:w,value:m}),k&&h().createElement("div",{className:"jp-license-activation-screen-controls--license-field-error"},h().createElement(l.Z,{icon:u.Z}),h().createElement("span",null,f))),h().createElement("div",null,h().createElement(s.Button,{className:"jp-license-activation-screen-controls--button",onClick:t,disabled:!m},d?h().createElement(r.Z,null):__("Activate","jetpack-my-jetpack"))))};f.propTypes={activateLicense:m().func.isRequired,availableLicenses:m().array,fetchingAvailableLicenses:m().bool,isActivating:m().bool.isRequired,license:m().string.isRequired,licenseError:m().string,onLicenseChange:m().func.isRequired,siteUrl:m().string.isRequired};const w=f},8781:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(6895),c=a(9307),r=a(5736),s=a(3059),i=a.n(s),o=a(9196),l=a.n(o);const __=r.__,u=e=>{const{imageUrl:t,showSupportLink:a=!1}=e;return l().createElement("div",{className:"jp-license-activation-screen-illustration"},l().createElement("div",{className:"jp-license-activation-screen-illustration--wrapper"},l().createElement("img",{className:"jp-license-activation-screen-illustration--img",src:t,alt:""})),a&&l().createElement("p",{className:"jp-license-activation-screen-illustration--support-link"},(0,c.createInterpolateElement)(__("Do you need help? <a>Contact us.</a>","jetpack-my-jetpack"),{a:l().createElement("a",{href:(0,n.Z)("jetpack-support-license-activation")})})))};u.propTypes={imageUrl:i().string.isRequired,showSupportLink:i().bool};const d=u},7554:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(8868),c=a(3059),r=a.n(c),s=a(9196),i=a.n(s),o=a(3157),l=a(8288),u=a(4172);const d=e=>{const{productId:t,siteRawUrl:a,siteAdminUrl:c,currentRecommendationsStep:r}=e;return i().createElement("div",{className:"jp-license-activation-screen-success-info"},i().createElement("div",{className:"jp-license-activation-screen-success-info--content"},i().createElement(n.Z,{showText:!1,height:48})),i().createElement(l.Z,{siteRawUrl:a,productId:t}),i().createElement("div",{className:"jp-license-activation-screen-success-info--buttons"},i().createElement(o.c,{currentRecommendationsStep:r,siteAdminUrl:c,siteRawUrl:a,productId:t}),i().createElement(u.o,{siteRawUrl:a,productId:t})))};d.propTypes={siteRawUrl:r().string,productId:r().number,siteAdminUrl:r().string,currentRecommendationsStep:r().string};const m=d},3157:(e,t,a)=>{"use strict";a.d(t,{c:()=>p});var n=a(5033),c=a(6895),r=a(5609),s=a(5736),i=a(3059),o=a.n(i),l=a(9196
__("Hey, %s","jetpack-my-jetpack"),t)),g().createElement("h2",{className:v.Z.headline},__("You have been gifted a Jetpack Golden Token.","jetpack-my-jetpack")),g().createElement("p",null,u&&__("This unlocked a lifetime of Jetpack powers for your website. Your exclusive Jetpack Experience is already active.","jetpack-my-jetpack"),!u&&__("This unlocks a lifetime of Jetpack powers for your website. Your exclusive Jetpack Experience awaits.","jetpack-my-jetpack"))),g().createElement(i.Z,{variant:"primary",weight:"regular",onClick:y,className:v.Z.button},u&&__("Awesome!","jetpack-my-jetpack"),!u&&__("Redeem your token","jetpack-my-jetpack"))),g().createElement("div",{className:`${v.Z["powers-wrap"]} ${v.Z["content-wrap"]}`},g().createElement("div",{className:v.Z["content-wrap-text"]},g().createElement("h2",{className:v.Z.headline},__("Super powers are ready!","jetpack-my-jetpack")),g().createElement("p",{className:v.Z.paragraph},__("Your Jetpack Golden Token provides a lifetime license for this website and includes the following products:","jetpack-my-jetpack"))),g().createElement("div",{className:v.Z["jetpack-products"]},g().createElement("div",null,g().createElement(E,null),g().createElement("h3",null,__("VaultPress Backup","jetpack-my-jetpack")),g().createElement("p",null,__("Save every change and get back online quickly with oneclick restores.","jetpack-my-jetpack"))),g().createElement("div",null,g().createElement(k,null),g().createElement("h3",null,_x("Scan","Plugin name (noun).","jetpack-my-jetpack")),g().createElement("p",null,__("Automated scanning and oneclick fixes to keep your site ahead of security threats.","jetpack-my-jetpack")))),g().createElement(i.Z,{variant:"primary",weight:"regular",onClick:y,href:window?.myJetpackInitialState?.myJetpackUrl,className:v.Z.button},__("Explore your new powers","jetpack-my-jetpack")))))))}w.propTypes={redeemClick:p().func,tokenRedeemed:p().bool,displayName:p().string,onModalClose:p().func};const k=w},3281:(e,t,a)=>{"use strict";a.d(t,{H:()=>c.Z,I:()=>n.Z});var n=a(468),c=a(9644)},4311:(e,t,a)=>{"use strict";a(9906),a(838)},838:(e,t,a)=>{"use strict"},9906:(e,t,a)=>{"use strict";a(2674);var n=a(5844),c=a.n(n);a(9196),a(838);c().string.isRequired,c().number,c().func,c().string},1899:(e,t,a)=>{"use strict";a.d(t,{Z:()=>g});var n=a(9105),c=a(3363),r=a(3846),s=a(1294),i=a(3281),o=a(9196),l=a.n(o),u=a(5544),d=a(6178),m=a(1838),p=a(4848),h=a(5626);function g(){const{recordEvent:e}=(0,p.Z)(),{data:t=[],isLoading:a}=(0,d.Z)({name:u.nF,queryFn:async e=>(await e.getUserLicenses())?.items}),{userConnectionData:g}=(0,s.Z)(),[v,f]=(0,o.useState)(!1),w=g?.currentUser?.wpcomUser?.display_name||g?.currentUser?.wpcomUser?.login||g?.currentUser?.username,k=(0,o.useCallback)((()=>{e("jetpack_myjetpack_license_activation_back_link_click")}),[e]),E=(0,o.useCallback)((()=>{f(!0)}),[]),y=(0,o.useMemo)((()=>t.filter((({attached_at:e,revoked_at:t})=>null===e&&null===t))),[t]),{siteSuffix:b="",adminUrl:_=""}=(0,m.$9)();return l().createElement(n.Z,{showHeader:!1,showBackground:!1},l().createElement(c.Z,{horizontalSpacing:3,horizontalGap:3},l().createElement(r.Z,null,l().createElement(h.Z,{onClick:k,reload:v})),l().createElement(r.Z,null,l().createElement(i.I,{currentRecommendationsStep:null,availableLicenses:y,fetchingAvailableLicenses:a,onActivationSuccess:E,siteAdminUrl:_,siteRawUrl:b,displayName:w}))))}},1062:(e,t,a)=>{"use strict";a.d(t,{U:()=>d,Z:()=>p});var n=a(5106),c=a(5235),r=a.n(c),s=a(5844),i=a.n(s),o=a(9196),l=a.n(o),u=a(5893);const d=e=>{const{children:t,className:a}=e,n=r()(u.Z.container,a);return l().createElement("div",{className:n},t)},m=e=>{const{title:t,headerRightContent:a,className:c,children:r}=e;return l().createElement(d,{className:c},l().createElement("div",{className:u.Z.title},l().createElement("div",{className:u.Z.name},l().createElement(n.ZP,{variant:"title-medium"},t)),a),r)};m.propTypes={children:i().node,title:i().string.isRequired,className:i().string,headerRightContent:i().node};const p=m},3890:(e,t,a)=>{"use strict";a.d(t,{Z:()=>d});var n=a(1074),c=a(9517),r=a(52
__("(opens in a new tab)","jetpack-my-jetpack"))))))}},3256:(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var n=a(5736),c=a(5242),r=a(184),s=a(8578),i=a(4403);const __=n.__,o=()=>React.createElement(React.Fragment,null,React.createElement("div",{className:s.Z["account-description"]},__("You can use your existing account on any of these services:","jetpack-my-jetpack")),React.createElement("ul",{className:s.Z["account-images"],role:"list"},React.createElement("li",null,React.createElement("img",{src:i,className:s.Z.wordpress,alt:"WordPress.com"})),React.createElement("li",null,React.createElement("img",{src:r,className:s.Z.google,alt:"Google"})),React.createElement("li",null,React.createElement("img",{src:c,className:s.Z.apple,alt:"Apple"}))))},6317:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(9105),c=a(3363),r=a(3846),s=a(5736),i=a(5162),o=a(1607),l=a(3890),u=a(489),d=a(3256),m=a(8578);const __=s.__,p=()=>{const e=(0,o.Z)(),{apiRoot:t,apiNonce:a,registrationNonce:s}=(0,i.Z)();return React.createElement(n.Z,{showHeader:!1,showBackground:!1},React.createElement(c.Z,{horizontalSpacing:8,horizontalGap:0},React.createElement(r.Z,{className:m.Z["relative-col"]},React.createElement(l.Z,{className:m.Z["close-link"],accessibleName:__("Go back to previous screen","jetpack-my-jetpack")})),React.createElement(r.Z,null,React.createElement(u.Z,{from:"my-jetpack",redirectUri:e,apiRoot:t,apiNonce:a,registrationNonce:s,footer:React.createElement(d.Z,null)}))))}},247:(e,t,a)=>{"use strict";a.d(t,{Z:()=>R});var n=a(5106),c=a(526),r=a(6895),s=a(1294),i=a(428),o=a(8137),l=a(9818),u=a(5736),d=a(1074),m=a(496),p=a(9201),h=a(5235),g=a.n(h),v=a(5844),f=a.n(v),w=a(9196),k=a.n(w),E=a(4848),y=a(5050),b=a(3815),_=a(9182),j=a(6322);const __=u.__,C=({text:e,actionText:t,onClick:a,status:r})=>k().createElement("div",{className:j.Z["list-item"]},k().createElement(n.ZP,{className:g()(j.Z["list-item-text"],{[j.Z.error]:"error"===r})},k().createElement(d.Z,{icon:"error"===r?m.Z:p.Z,className:g()({[j.Z.info]:"error"===r})}),e),t&&k().createElement(c.Z,{variant:"link",weight:"regular",onClick:a},t)),N=e=>{const{apiRoot:t,apiNonce:a,redirectUri:d=null,title:m=__("Connection","jetpack-my-jetpack"),connectionInfoText:p=__("Jetpack connects your site and user account to the WordPress.com cloud to provide more powerful features.","jetpack-my-jetpack"),onDisconnected:h,connectedPlugins:v,connectedSiteId:f,context:N,onConnectUser:R=null}=e,{isRegistered:Z,isUserConnected:x,userConnectionData:z}=(0,s.Z)({apiRoot:t,apiNonce:a,redirectUri:d}),{recordEvent:S}=(0,E.Z)(),[M,L]=(0,w.useState)(!1),{setConnectionStatus:P,setUserIsConnecting:A}=(0,l.useDispatch)(i.t),V=R||A,H=z.currentUser?.wpcomUser?.avatar,O=(0,w.useMemo)((()=>({isUserConnected:x,isRegistered:Z})),[x,Z]),I=(0,w.useCallback)((e=>t=>{t&&t.preventDefault(),S("jetpack_myjetpack_connection_manage_dialog_click",{...O,connectionType:e}),L(!0)}),[S,L,O]),B=I("user"),T=I("site"),U=(0,w.useCallback)((e=>{e&&e.preventDefault(),L(!1)}),[L]),F=(0,w.useCallback)((e=>{e&&e.preventDefault(),P({isActive:!1,isRegistered:!1,isUserConnected:!1}),h?.()}),[h,P]),D=(0,w.useCallback)((()=>{S("jetpack_myjetpack_connection_learnmore_link_click",O)}),[S,O]),q=(0,w.useCallback)((e=>{e&&e.preventDefault(),S("jetpack_myjetpack_connection_connect_user_click",O),V()}),[V,S,O]);return k().createElement("div",{className:j.Z["connection-status-card"]},k().createElement(n.H3,null,m),k().createElement(n.ZP,{variant:"body",mb:3},`${p} `,k().createElement(c.Z,{href:(0,r.Z)("why-the-wordpress-com-connection-is-important-for-jetpack"),variant:"link",weight:"regular",isExternalLink:!0,onClick:D},__("Learn more about connections","jetpack-my-jetpack"))),k().createElement("div",{className:j.Z.status},k().createElement("img",{src:y,alt:"",className:j.Z.cloud}),k().createElement("div",{className:g()(j.Z.line,{[j.Z.disconnected]:!Z||!x})}),k().createElement("div",{className:j.Z["avatar-wrapper"]},k().createElement("img",{src:_,alt:"",className:j.Z.jetpack}),k().createElement("img",{src:x&&H?H:b,alt:"",className:j.Z.avatar}))),k().createElement("div",null
__("Connected as %1$s%2$s.","jetpack-my-jetpack"),z.currentUser?.wpcomUser?.display_name,z.currentUser?.isMaster?__(" (Owner)","jetpack-my-jetpack"):"")}),x&&z?.connectionOwner&&!z.currentUser?.isMaster&&k().createElement(C,{text:(0,u.sprintf)(/* translators: placeholder is the username of the Jetpack connection owner */
__("Also connected: %s (Owner).","jetpack-my-jetpack"),z.connectionOwner)}),!x&&k().createElement(C,{onClick:q,text:__("User account not connected.","jetpack-my-jetpack"),actionText:__("Connect","jetpack-my-jetpack"),status:"error"})):k().createElement(C,{onClick:q,text:__("Jetpack is not connected.","jetpack-my-jetpack"),actionText:__("Connect","jetpack-my-jetpack"),status:"error"})),k().createElement(o.Z,{apiRoot:t,apiNonce:a,onDisconnected:F,connectedPlugins:v,connectedSiteId:f,connectedUser:z,isOpen:M,onClose:U,context:N}))};N.propTypes={apiRoot:f().string.isRequired,apiNonce:f().string.isRequired,redirectUri:f().string,connectedPlugins:f().array,connectedSiteId:f().number,title:f().string,connectionInfoText:f().string,onDisconnected:f().func,context:f().string,onConnectUser:f().func,requiresUserConnection:f().bool};const R=N},5784:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(8209),c=a(4598),r=a(1950),s=a(5162),i=a(7555),o=a(247);function l(){const{apiRoot:e,apiNonce:t,topJetpackMenuItemUrl:a,connectedPlugins:l}=(0,s.Z)(),u=(0,i.Z)(n.xB.Connection),d=(0,c.B)(),m=(0,r.Z)(d);return React.createElement(o.Z,{apiRoot:e,apiNonce:t,redirectUri:a,onConnectUser:u,connectedPlugins:l,requiresUserConnection:m.length>0,onDisconnected:()=>document?.location?.reload(!0)})}},5626:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(5736),c=a(1074),r=a(3259),s=a(9196),i=a.n(s),o=a(9997),l=a(197);const __=n.__;const u=function({onClick:e=(()=>{}),reload:t}){const a=t?"/?reload=true":"/";return i().createElement(o.rU,{to:a,className:l.Z.link,onClick:e},i().createElement(c.Z,{icon:r.Z,className:l.Z.icon}),__("Go back","jetpack-my-jetpack"))}},8607:(e,t,a)=>{"use strict";a.d(t,{r:()=>m});var n=a(526),c=a(3396),r=a(5609),s=a(9771),i=a(5736),o=a(5235),l=a.n(o),u=a(9196),d=a(4416);a(1854);const __=i.__;function m({productName:e,giftedDate:t}){const[a,o]=(0,u.useState)(!1),m=(0,u.useCallback)((()=>o(!0)),[o]),p={position:"top center",placement:"top",animate:!0,noArrow:!1,resize:!1,flip:!1,offset:6,focusOnMount:"container",onClose:(0,u.useCallback)((()=>o(!1)),[o]),className:d.Z.container},h=l()(d.Z.wrapper,"golden-token-icon-tooltip");return React.createElement("div",{className:h},React.createElement(n.Z,{variant:"link",onClick:m},React.createElement(c._1,{className:d.Z.logo})),React.createElement("div",{className:d.Z.helper},a&&React.createElement(r.Popover,p,React.createElement("div",null,React.createElement("div",{className:d.Z.title},e),React.createElement("div",{className:d.Z.content},(0,i.sprintf)(
// translators: %1$s is a product name, %2$s is the date the product was gifted.
__("%1$s was gifted on %2$s. It gives you access to a lifetime subscription of Jetpack VaultPress Backup and Jetpack Scan.","jetpack-my-jetpack"),e,(0,s.dateI18n)("F j, Y",t)))))))}},4159:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5609),c=a(9196),r=a.n(c),s=a(73);const i=function(){const[e,t]=(0,c.useState)(!0),a=(0,c.useCallback)((()=>t(!1)),[]);if(!e)return null;if(!window.hasOwnProperty("JP_IDENTITY_CRISIS__INITIAL_STATE"))return null;const{containerID:i,isSafeModeConfirmed:o}=window.JP_IDENTITY_CRISIS__INITIAL_STATE;return!i||o?null:r().createElement(n.Modal,{onRequestClose:a,overlayClassName:s.Z.modal},r().createElement("div",{id:i,className:s.Z.container}))}},642:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var n=a(4706),c=a(6895),r=a(5736),s=a(9196),i=a.n(s),o=a(4848),l=a(4730);const __=r.__,u=e=>{const{isAgencyAccount:t=!1}=e,{recordEvent:a}=(0,o.Z)();(0,s.useEffect)((()=>{a("jetpack_myjetpack_manage_banner_view",{})}),[a]);const r=(0,s.useCallback)((e=>{a("jetpack_myjetpack_manage_banner_click",{target:e,feature:"manage"})}),[a]),u=(0,s.useCallback)((()=>{r("jp-agencies-register-interest")}),[r]);return i().createElement(n.Z,{icon:l,title:__("Manage client sites and grow your business","jetpack-my-jetpack"),description:__("Are you an agency or freelancer? Were working on a new partnership program bringing together the best of Jetpack, Woo, WordPress.com, and Pressable. Get bulk discounts, referral commissions, and more.","jetpack-my-jetpack"),primaryCtaLabel:__("Register your interest","jetpack-my-jetpack"),primaryCtaURL:(0,c.Z)("jetpack-for-agencies-register-interest"),primaryCtaIsExternalLink:!0,primaryCtaOnClick:u})}},8966:(e,t,a)=>{"use strict";a.d(t,{Z:()=>H});var n=a(2674),c=a.n(n),r=a(2054),s=a(7121),i=a(1342),o=a(9105),l=a(216),u=a(3363),d=a(3846),m=a(5106),p=a(6579),h=a(4164),g=a(5736),v=a(5235),f=a.n(v),w=a(9196),k=a(8437),E=a(5544),y=a(4598),b=a(7108),_=a(1838),j=a(8059),C=a(4848),N=a(8064),R=a(5784),Z=a(4159),x=a(642),z=a(6800),S=a(2307),M=a(5943),L=a(9593),P=a(3851),A=a(1017);const __=g.__,V=({message:e,title:t,options:a})=>{const{recordEvent:n}=(0,C.Z)();(0,w.useEffect)((()=>{n("jetpack_myjetpack_global_notice_view",{noticeId:a.id})}),[a.id,n]);const[o]=(0,r.Z)(["md"],[">"]),l=a.actions?.map((e=>React.createElement(s.Z,c()({customClass:A.Z.cta},e))));return React.createElement("div",{className:f()(A.Z.notice,{[A.Z["bigger-than-medium"]]:o})},React.createElement(i.Z,c()({hideCloseButton:!0},a,{title:t,actions:l}),React.createElement("div",{className:A.Z.message},e)))};function H(){(0,N.Z)();const{redBubbleAlerts:e}=(0,_.$9)(),{showFullJetpackStatsCard:t=!1}=(0,_.$9)("myJetpackFlags"),{jetpackManage:a={},adminUrl:n}=(0,_.$9)(),{isWelcomeBannerVisible:c}=(0,j.Z)(),{currentNotice:r}=(0,w.useContext)(k.T),{message:s,title:i,options:g}=r||{},{data:v,isLoading:H}=(0,b.Z)({name:E.gb,query:{path:E.Hq}}),{detail:O}=(0,y.Z)("stats"),{data:I,isLoading:B}=(0,b.Z)({name:E.kl,query:{path:E.xD}}),T=v?.is_available,U=I?.user?.jwt,F=!B&&!H&&T&&U,D="1"===(0,_.$9)("userIsNewToJetpack"),{recordEvent:q}=(0,C.Z)(),[J,G]=(0,w.useState)(!1);return(0,w.useLayoutEffect)((()=>{q("jetpack_myjetpack_page_view",{red_bubble_alerts:Object.keys(e).join(",")})}),[q,e]),window.location.hash.includes("?reload=true")&&(window.history.replaceState(null,"",window.location.href.replace("?reload=true","")),window.location.reload(),G(!0)),J?null:React.createElement(o.Z,{siteAdminUrl:n},React.createElement(Z.Z,null),React.createElement(l.Z,null,!D&&React.createElement(u.Z,{horizontalSpacing:0},React.createElement(d.Z,null,React.createElement("div",{id:"jp-admin-notices",className:"my-jetpack-jitm-card"}))),React.createElement(P.Z,null),React.createElement(u.Z,{horizontalSpacing:5,horizontalGap:s?3:6},React.createElement(d.Z,{sm:4,md:8,lg:12},React.createElement(m.ZP,{variant:"headline-small"},__("Discover all Jetpack Products","jetpack-my-jetpack"))),s&&!c&&React.createElement(d.Z,null,React.createElement(V,{message:s,title:i,options:g})),t&&React.createElement(d.Z,{className:f()({[A.Z.stats]:O?.status!==S.N.ERROR})},React.createElement(
(0,s.sprintf)(__("Learn about %s","jetpack-my-jetpack"),a));const W=U&&React.createElement("div",{ref:O,className:f.Z["action-button-dropdown"]},React.createElement("ul",{className:f.Z["dropdown-menu"]},[...k,D()].map((({label:e,isExternalLink:t},a)=>React.createElement("li",{key:a},React.createElement("button",{onClick:()=>{L(q[a]),S(!1),B("jetpack_myjetpack_product_card_dropdown_action_click",{product:n,action:e})},className:f.Z["dropdown-item"]},React.createElement("div",{className:f.Z["dropdown-item-label"]},e,t&&React.createElement(i.Z,{icon:o.Z,size:16})),e===M.label&&React.createElement("div",{className:f.Z["active-action-checkmark"]},React.createElement(i.Z,{icon:l.Z,size:24,fill:"white"}))))))));return React.createElement(React.Fragment,null,React.createElement("div",{className:m()(f.Z["action-button"],U?f.Z["has-additional-actions"]:null)},React.createElement(r.Z,c()({},F,M),M.label),U&&React.createElement("button",{className:m()(f.Z["dropdown-chevron"],"primary"===M.variant?f.Z.primary:f.Z.secondary),onClick:G,ref:I},React.createElement(i.Z,{icon:u.Z,size:24,fill:"primary"===M.variant?"white":"black"})),z&&W))}},2728:(e,t,a)=>{"use strict";a.d(t,{ZP:()=>E,bY:()=>f});var n=a(2674),c=a.n(n),r=a(526),s=a(5736),i=a(5235),o=a.n(i),l=a(5844),u=a.n(l),d=a(9196),m=a(4848),p=a(1062),h=a(2307),g=a(6086),v=a(9720);const __=s.__,f={[h.N.ACTIVE]:__("Active","jetpack-my-jetpack"),[h.N.INACTIVE]:__("Inactive","jetpack-my-jetpack"),[h.N.MODULE_DISABLED]:__("Inactive","jetpack-my-jetpack"),[h.N.NEEDS_PURCHASE]:__("Inactive","jetpack-my-jetpack"),[h.N.NEEDS_PURCHASE_OR_FREE]:__("Inactive","jetpack-my-jetpack"),[h.N.ABSENT]:__("Inactive","jetpack-my-jetpack"),[h.N.ABSENT_WITH_PLAN]:__("Needs Plugin","jetpack-my-jetpack"),[h.N.NEEDS_FIRST_SITE_CONNECTION]:__("Inactive","jetpack-my-jetpack"),[h.N.USER_CONNECTION_ERROR]:__("Needs user account","jetpack-my-jetpack"),[h.N.SITE_CONNECTION_ERROR]:__("Needs connection","jetpack-my-jetpack"),[h.N.CAN_UPGRADE]:__("Active","jetpack-my-jetpack")},w=e=>{const{shouldShowButton:t=(()=>!0),positionFirst:a,...n}={size:"small",variant:"secondary",weight:"regular",label:__("Learn more","jetpack-my-jetpack"),...e};return!!t()&&React.createElement(r.Z,n,n.label)};w.propTypes={href:u().string,size:u().oneOf(["normal","small"]),variant:u().oneOf(["primary","secondary","link","tertiary"]),weight:u().oneOf(["bold","regular"]),label:u().string,shouldShowButton:u().func,onClick:u().func,positionFirst:u().bool,isExternalLink:u().bool,icon:u().node,iconSize:u().number,disabled:u().bool,isLoading:u().bool,className:u().string};const k=e=>{const t={isFetching:!1,isInstallingStandalone:!1,onActivate:()=>{},...e},{name:a,Description:n,status:r,onActivate:s,isFetching:i,isDataLoading:l,isInstallingStandalone:u,slug:f,additionalActions:k,primaryActionOverride:E,secondaryAction:y,children:b,onInstallStandalone:_,onActivateStandalone:j}=t,C=r===h.N.ERROR,N=r===h.N.ABSENT||r===h.N.ABSENT_WITH_PLAN,R=r===h.N.NEEDS_PURCHASE||r===h.N.NEEDS_PURCHASE_OR_FREE,Z=o()({[v.Z.plugin_absent]:N,[v.Z["is-purchase-required"]]:R,[v.Z["is-link"]]:N,[v.Z["has-error"]]:C}),{recordEvent:x}=(0,m.Z)(),z=(0,d.useCallback)((e=>{e.preventDefault(),x("jetpack_myjetpack_product_card_activate_click",{product:f}),s()}),[f,s,x]),S=(0,d.useCallback)((()=>{x("jetpack_myjetpack_product_card_add_click",{product:f})}),[f,x]),M=(0,d.useCallback)((()=>{x("jetpack_myjetpack_product_card_manage_click",{product:f})}),[f,x]),L=(0,d.useCallback)((()=>{x("jetpack_myjetpack_product_card_fixconnection_click",{product:f})}),[f,x]),P=(0,d.useCallback)((()=>{x("jetpack_myjetpack_product_card_learnmore_click",{product:f})}),[f,x]),A=(0,d.useCallback)((e=>{e.preventDefault(),x("jetpack_myjetpack_product_card_install_standalone_plugin_click",{product:f}),_()}),[f,_,x]);(0,d.useCallback)((e=>{e.preventDefault(),x("jetpack_myjetpack_product_card_activate_standalone_plugin_click",{product:f}),j()}),[f,j,x]);return(0,d.useEffect)((()=>{x("jetpack_myjetpack_product_card_loaded",{product:f,status:r})}),[x,f,r]),React.createElement(p.Z,{title:a,className:o()(v.Z.container
// translators: %s is the number of days since the last backup
_n("%s day ago","%s days ago",e,"jetpack-my-jetpack"),e):a>0?(0,i.sprintf)(
// translators: %s is the number of hours since the last backup
_n("%s hour ago","%s hours ago",a,"jetpack-my-jetpack"),a):n>0?(0,i.sprintf)(
// translators: %s is the number of minutes since the last backup
_n("%s minute ago","%s minutes ago",n,"jetpack-my-jetpack"),n):(0,i.sprintf)(
// translators: %s is the number of seconds since the last backup
_n("%s second ago","%s seconds ago",c,"jetpack-my-jetpack"),c)}})(o))):null,additionalActions:s?[p]:[]},s?React.createElement("div",{className:y.Z.activity},React.createElement(u.Z,{icon:s.gridicon,size:24}),React.createElement("p",{className:y.Z.summary},s.summary)):null)},j=({admin:e,slug:t})=>{const[a,n]=(0,p.useState)(3),{data:c,isLoading:o}=(0,v.Z)({name:h.RQ,query:{path:h.hd}}),d=(0,p.useMemo)((()=>{const e=[];return c?(Object.keys(c).forEach((t=>{0!==c[t]&&e.push([t,c[t]])})),e.sort(((e,t)=>e[1]<t[1]?1:-1)),e):e}),[c]);(0,p.useEffect)((()=>(window.onresize=()=>{window.innerWidth>=961&&window.innerWidth<=1070||window.innerWidth<290?n(2):n(3)},()=>{window.onresize=null})),[]);const m=d.length>a?d.length-a:0,g={maximumFractionDigits:1,notation:"compact"};return React.createElement(k.Z,{admin:e,slug:t,showMenu:!0,isDataLoading:o},React.createElement("div",{className:y.Z["no-backup-stats"]},React.createElement("ul",{className:y.Z["main-stats"],role:"list"},d.map(((e,t)=>{const n=e[0].split("_")[1],c=e[1];return React.createElement("li",{className:l()(y.Z["main-stat"],`main-stat-${t}`),key:t+n},React.createElement(React.Fragment,null,t<a&&React.createElement("span",{className:l()(y.Z["visual-stat"]),"aria-hidden":"true"},(e=>{switch(e){case"post":return React.createElement(u.Z,{icon:"posts",size:24});case"page":return React.createElement(u.Z,{icon:"pages",size:24});default:return React.createElement(u.Z,{icon:e,size:24})}})(n),React.createElement("span",null,(0,r.Z)(c,g))),React.createElement(s.VisuallyHidden,null,({comment:e=>(0,i.sprintf)(
// translators: %d is the number of comments
_n("%d comment","%d comments",e,"jetpack-my-jetpack"),e),post:e=>(0,i.sprintf)(
// translators: %d is the number of posts
_n("%d post","%d posts",e,"jetpack-my-jetpack"),e),page:e=>(0,i.sprintf)(
// translators: %d is the number of pages
_n("%d page","%d pages",e,"jetpack-my-jetpack"),e),image:e=>(0,i.sprintf)(
// translators: %d is the number of images
_n("%d image","%d images",e,"jetpack-my-jetpack"),e),video:e=>(0,i.sprintf)(
// translators: %d is the number of videos
_n("%d video","%d videos",e,"jetpack-my-jetpack"),e),audio:e=>(0,i.sprintf)(
// translators: %d is the number of files
_n("%d audio file","%d audio files",e,"jetpack-my-jetpack"),e)}[o=n]||(e=>`${e} ${o}`))(c))));var o}))),m>0&&React.createElement("span",{className:y.Z["more-stats"],"aria-hidden":"true"},
// translators: %s is the number of items that are not shown
// translators: %s is the number of items that are not shown
(0,i.sprintf)(__("+%s more","jetpack-my-jetpack"),m))))};b.propTypes={admin:m().bool.isRequired},j.propTypes={productData:m().object};const C=b},8489:(e,t,a)=>{"use strict";a.d(t,{Z:()=>w});var n=a(128),c=a(5033),r=a(4186),s=a(5609),i=a(4333),o=a(5736),l=a(1074),u=a(986),d=a(9196),m=a(4598),p=a(1838),h=a(4848),g=a(5162),v=a(2307),f=a(9578);a(1200);const __=o.__,w=()=>{const{recordEvent:e}=(0,h.Z)(),[t,a]=(0,d.useState)(!1),[o,w]=(0,d.useState)(""),[k,E]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[_,j]=(0,d.useState)(!1),[C,N]=(0,d.useState)(!1),R=(0,i.useViewportMatch)("medium","<"),{siteUrl:Z="",latestBoostSpeedScores:x}=(0,p.$9)(),{apiRoot:z,apiNonce:S,isSiteConnected:M}=(0,g.Z)(),{detail:L}=(0,m.Z)("boost"),{status:P}=L,A=P===v.N.ACTIVE||P===v.N.CAN_UPGRADE,V=(e,t)=>{const{mobile:a,desktop:n}=t||{};var c,r;a&&n&&e((c=a,r=n,Math.round((c+r)/2)))},H=e=>{const{scores:t,previousScores:a}=e||{};V(E,t),V(b,a),(e=>{const{mobile:t,desktop:a}=e||{};t&&a&&w((0,n.yn)(t,a))})(t)},O=async()=>{M?(a(!0),(0,n.tZ)(!0,z,Z,S).then((e=>{const t=(0,n.yn)(e.current.mobile,e.current.desktop);w(t),V(E,e.current),V(b,x.scores),a(!1)})).catch((t=>{e("jetpack_boost_speed_score_error",{feature:"jetpack-boost",position:"my-jetpack",error:t}),x&&x.scores?H(x):j(!0),a(!1)}))):j(!0)},I=(0,d.useMemo)((()=>y&&k?k<y?null:k-y:null),[k,y]),B=(0,f.c)({speedLetterGrade:o,boostScoreIncrease:I}),T=(0,d.useCallback)((()=>{N(!0)}),[N]),U=(0,d.useCallback)((()=>{N(!1)}),[N]);return(0,d.useEffect)((()=>{x?A?(0,n.Fr)(1e3*x.timestamp)<1?H(x):O():(0,n.Fr)(1e3*x.timestamp)<14?H(x):O():O()}),[]),!_&&React.createElement("div",{className:"mj-boost-speed-score"},t?React.createElement(c.Z,{color:"#23282d",size:16}):React.createElement(React.Fragment,null,React.createElement("div",{className:"mj-boost-speed-score__grade"},React.createElement("span",null,__("Your websites overall speed score:","jetpack-my-jetpack")),React.createElement("span",{className:"mj-boost-speed-score__grade--letter"},React.createElement("button",{onMouseEnter:T,onFocus:T,onMouseLeave:U,onBlur:U},o,C&&React.createElement(s.Popover,{placement:R?"top-end":"right",noArrow:!1,offset:10},React.createElement("p",{className:"boost-score-tooltip__heading"},__("Site speed performance:","jetpack-my-jetpack")," ",o),React.createElement("p",{className:"boost-score-tooltip__content"},B))))),React.createElement("div",{className:"mj-boost-speed-score__bar"},React.createElement(r.Z,{score:k,active:k>0,isLoading:t,showPrevScores:!1,scoreBarType:"desktop",noBoostScoreTooltip:null})),!!I&&React.createElement("div",{className:"mj-boost-speed-score__increase"},React.createElement(l.Z,{size:18,icon:u.Z}),React.createElement("span",null,I))))}},6631:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5736),c=a(5745),r=a(2307),s=a(8489);const __=n.__,i=({admin:e})=>{const t={[r.N.ABSENT]:{label:__("Boost your site","jetpack-my-jetpack")}};return React.createElement(c.Z,{admin:e,slug:"boost",primaryActionOverride:t},React.createElement(s.Z,null))}},9578:(e,t,a)=>{"use strict";a.d(t,{c:()=>r});var n=a(5736),c=a(4598);const __=n.__;function r({speedLetterGrade:e,boostScoreIncrease:t}){const{detail:a}=(0,c.Z)("boost"),{isPluginActive:r,hasPaidPlanForProduct:s}=a;if(r){if(s){if(t)return(0,n.sprintf)(/* translators: %d is the number (positive integer) of points the speed has increased */
__("Your speed has improved by %d points! Boost is working to enhance your performance with automated tools.","jetpack-my-jetpack"),t);switch(e){case"A":return __("Your site is fast! Boost is working to enhance your performance with automated tools.","jetpack-my-jetpack");case"B":case"C":case"D":case"E":case"F":return __("Visit the Boost dashboard to view your historical speed scores and manage your product settings.","jetpack-my-jetpack");default:return __("Visit the Boost dashboard to view your sites speed scores and manage your product settings.","jetpack-my-jetpack")}}if(t)return(0,n.sprintf)(/* translators: %d is the number (integer) of points the speed has increased */
__("Your speed has improved by %d points! Upgrade Boost to unlock automated CSS and image optimization tools to maintain your high score.","jetpack-my-jetpack"),t);switch(e){case"A":return __("Your site is fast! But maintaining a high speed isnt easy. Upgrade Boost to use automated CSS and image optimization tools to improve your performance on the go.","jetpack-my-jetpack");case"B":return __("You are one step away from making your site blazing fast. Upgrade Boost to use automated CSS and image optimization tools to improve your performance.","jetpack-my-jetpack");default:return __("Improve your performance with automated CSS and image optimization tools by upgrading Boost.","jetpack-my-jetpack")}}switch(e){case"A":return __("Your site is fast! But maintaining a high speed isnt easy. Use Boosts automated acceleration tools to optimize your performance on the go.","jetpack-my-jetpack");case"B":return __("You are one step away from making your site blazing fast. Install Boost to enhance your sites performance like top websites, no developer needed.","jetpack-my-jetpack");default:return __("Your site needs performance improvements. Make your site blazing fast with Boosts simple dashboard and acceleration tools.","jetpack-my-jetpack")}}},8112:(e,t,a)=>{"use strict";a.d(t,{G:()=>w,X:()=>f});var n=a(2947),c=a(5106),r=a(2636),s=a(5736),i=a(986),o=a(9404),l=a(1074),u=a(5235),d=a.n(u),m=a(5844),p=a.n(m),h=a(9196),g=a.n(h),v=a(523);const __=s.__,f=({change:e,changePercentage:t})=>{if(!Number.isFinite(e))return null;const a=e>0?i.Z:o.Z,r=(0,n.Z)(Math.abs(e),{notation:"compact",compactDisplay:"short"});return g().createElement("div",{className:d()(v.Z["contextual-percentage-change"],{[v.Z.neutral]:0===e,[v.Z.positive]:e>0,[v.Z.negative]:e<0})},!!e&&g().createElement(l.Z,{icon:a,size:14,className:v.Z["change-icon"]}),g().createElement(c.ZP,{className:v.Z["change-values"]},(0,s.sprintf)(/* translators: both placeholders are numbers */
__("%1$s (%2$s%%)","jetpack-my-jetpack"),r,t)))};f.propTypes={change:p().number,changePercentage:p().number};const w=({description:e,value:t,context:a,loading:n})=>n?g().createElement("div",{className:v.Z["single-contextual-info-placeholder"]},g().createElement(r.Z,{height:24}),g().createElement(r.Z,{height:36})):g().createElement(g().Fragment,null,g().createElement(c.ZP,null,e),g().createElement("div",{className:v.Z["single-contextual-info"]},g().createElement(c.ZP,{className:v.Z["main-value"]},t),a));w.propTypes={description:p().string.isRequired,value:p().string,context:p().node,loading:p().bool}},9963:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"creator",upgradeInInterstitial:!0});o.propTypes={admin:c().bool.isRequired};const l=o},5996:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"crm"});o.propTypes={admin:c().bool.isRequired};const l=o},5943:(e,t,a)=>{"use strict";a.d(t,{Z:()=>E});var n=a(3363),c=a(3846),r=a(9196),s=a.n(r),i=a(1838),o=a(8777),l=a(1640),u=a(7427),d=a(6631),m=a(9963),p=a(5996),h=a(3232),g=a(687),v=a(419),f=a(6217),w=a(523),k=a(9894);const E=()=>{const{isAtomic:e=!1,userIsAdmin:t=!1}=(0,i.$9)(),{showFullJetpackStatsCard:a=!1}=(0,i.$9)("myJetpackFlags"),r={backups:u.Z,protect:h.Z,antispam:l.Z,boost:d.Z,search:g.Z,videopress:k.Z,stats:a?null:f.Z,crm:p.Z,creator:e?null:m.Z,social:v.Z,ai:o.Z};return s().createElement(n.Z,{className:w.Z.cardlist,tagName:"ul",fluid:!0,horizontalSpacing:0,horizontalGap:3},Object.entries(r).map((([e,a])=>a?s().createElement(c.Z,{tagName:"li",sm:4,md:4,lg:4,key:e},s().createElement(a,{admin:!!t})):null)))}},3232:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"protect"});o.propTypes={admin:c().bool.isRequired};const l=o},687:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"search",showMenu:!0});o.propTypes={admin:c().bool.isRequired};const l=o},419:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"social",showMenu:!0});o.propTypes={admin:c().bool.isRequired};const l=o},6217:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5844),c=a.n(n),r=a(9196),s=a.n(r),i=a(5745);const o=({admin:e})=>s().createElement(i.Z,{admin:e,slug:"stats",showMenu:!0});o.propTypes={admin:c().bool.isRequired};const l=o},9894:(e,t,a)=>{"use strict";a.d(t,{Z:()=>p});var n=a(2947),c=a(5736),r=a(5844),s=a.n(r),i=a(5544),o=a(7108),l=a(1838),u=a(5745),d=a(8112);const __=c.__,m=({admin:e})=>{const{videoPressStats:t=!1}=(0,l.$9)("myJetpackFlags"),{loading:a,hasError:c,change:r,currentFormatted:s,changePercentage:m}=(()=>{const{data:e,isLoading:t,isError:a}=(0,o.Z)({name:i.db,query:{path:i.n2}}),c=e?.data?.views??{},{previous:r=null,current:s=null}=c,l=null!==s?(0,n.Z)(s,{notation:"compact",compactDisplay:"short"}):null,u=null!==s&&null!==r?s-r:null;let d=null;return null!==u&&(d=0===u?0:0===r?100:Math.round(u/r*100)),{isLoading:t,isError:a,currentFormatted:l,change:u,changePercentage:d}})();if(!t||c)return React.createElement(u.Z,{admin:e,slug:"videopress",showMenu:!0});const p=__("Views, last 7 days","jetpack-my-jetpack");return React.createElement(u.Z,{admin:e,slug:"videopress",showMenu:!0},React.createElement(d.G,{loading:a,description:p,value:s,context:React.createElement(d.X,{change:r,changePercentage:m})}))};m.propTypes={admin:s().bool.isRequired};const p=m},2667:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5609),c=a(5844),r=a.n(c),s=a(9196),i=a.n(s);const o=({children:e,className:t,href:a,isLoading:c=!1,onClick:r,isPrimary:s=!0,disabled:o=!1})=>i().createElement(n.Button,{onClick:r,className:t,href:a,variant:s?"primary":"secondary",disabled:c||o},c?i().createElement(n.Spinner,null):e);o.propTypes={clas
// translators: %s is the monthly price for a product
__("trial for the first month, then $%s /month, billed yearly","jetpack-my-jetpack"),$):"year"===ne?__("/month, paid yearly","jetpack-my-jetpack"):__("/month","jetpack-my-jetpack",0);const he=(0,v.useCallback)((()=>{a(),t?.(oe,A)}),[t,a,oe,A]),ge=(0,v.useCallback)((()=>{a(!0,te,A),t?.(ue,A)}),[t,a,ue,te,A]),ve=(0,v.useCallback)((t=>{ce("jetpack_myjetpack_product_card_disclaimer_click",{id:t,product:e})}),[e,ce]);function fe({slug:e}){const t=(0,r.VS)(e);return t?f().createElement("div",{className:_.Z["product-icon"]},f().createElement(t,null)):null}const we=(!U||U&&!D)&&K,ke=V&&h?V:H,Ee=!U&&D?(0,u.sprintf)(/* translators: placeholder is product name. */
__("Install %s","jetpack-my-jetpack"),ke):(0,u.sprintf)(/* translators: placeholder is product name. */
__("Get %s","jetpack-my-jetpack"),ke),ye=N||Ee;return f().createElement("div",{className:g()(_.Z.card,n,{[_.Z["is-bundle-card"]]:U})},U&&f().createElement("div",{className:_.Z["card-header"]},f().createElement(r.r7,{className:_.Z["product-bundle-icon"],size:16}),f().createElement(c.ZP,{variant:"label"},__("Popular upgrade","jetpack-my-jetpack"))),f().createElement("div",{className:_.Z.container},U&&f().createElement("div",{className:_.Z["product-bundle-icons"]},me),f().createElement(fe,{slug:e}),f().createElement(c.H3,null,ke),f().createElement(c.ZP,{mb:3},O),f().createElement("ul",{className:g()(_.Z.features,{[_.Z["highlight-last-feature"]]:x})},I.map(((e,t)=>f().createElement(c.ZP,{component:"li",key:`feature-${t}`,variant:"body"},f().createElement(d.Z,{icon:p.Z,size:24}),e)))),re&&X&&f().createElement(f().Fragment,null,f().createElement("div",{className:_.Z["price-container"]},f().createElement(j,{value:X,currency:Y,isOld:!1}),X<$&&f().createElement(j,{value:$,currency:Y,isOld:!0})),f().createElement(c.ZP,{className:_.Z["price-description"]},pe)),Q&&f().createElement(c.H3,null,__("Free","jetpack-my-jetpack")),W&&f().createElement(s.Z,null,f().createElement(c.ZP,null,(0,u.sprintf)(
// translators: %s is the plugin name.
__("Due to your server settings, we can't automatically install the plugin for you. Please manually install the %s plugin.","jetpack-my-jetpack"),ke)," ",f().createElement(l.ExternalLink,{href:`https://wordpress.org/plugins/${J}`},__("Get plugin","jetpack-my-jetpack")))),!R&&f().createElement("div",{className:_.Z["tos-container"]},f().createElement(i.Z,{agreeButtonLabel:we?(0,u.sprintf)(/* translators: placeholder is cta label. */
__("%s or Start for free","jetpack-my-jetpack"),ye):ye})),(!U||U&&!D)&&f().createElement(c.ZP,{component:b.Z,onClick:he,isLoading:z||le,disabled:W,isPrimary:!U,className:_.Z["checkout-button"],variant:"body"},ye),!U&&K&&!D&&f().createElement(c.ZP,{component:b.Z,onClick:ge,isLoading:z||de,disabled:W,isPrimary:!1,className:[_.Z["checkout-button"],_.Z["free-product-checkout-button"]],variant:"body"},__("Start for free","jetpack-my-jetpack")),B.length>0&&f().createElement("div",{className:_.Z.disclaimers},B.map(((e,t)=>{const{text:a,link_text:n=null,url:r=null}=e;return f().createElement(c.ZP,{key:`disclaimer-${t}`,component:"p",variant:"body-small"},`${a} `,r&&n&&f().createElement(l.ExternalLink,{onClick:()=>ve(t),href:r,target:"_blank",rel:"noopener noreferrer"},n))}))),U&&D&&f().createElement("div",{className:_.Z["product-has-required-plan"]},f().createElement(r.KM,{size:36}),f().createElement(c.ZP,null,__("Active on your site","jetpack-my-jetpack"))),C&&f().createElement(c.ZP,{className:_.Z["supporting-info"],variant:"body-extra-small"},C)))}},9144:(e,t,a)=>{"use strict";a.d(t,{Z:()=>w});var n=a(9608),c=a(5347),r=a(526),s=a(1342),i=a(5106),o=a(8258),l=a(5736),u=a(5844),d=a.n(u),m=a(9196),p=a(4598),h=a(1838),g=a(199);const __=l.__,v=({cantInstallPlugin:e,onProductButtonClick:t,detail:a,isFetching:s,tier:i,trackProductButtonClick:u,preferProductName:d})=>{const{siteSuffix:p="",myJetpackCheckoutUri:v=""}=(0,h.$9)(),{name:f,featuresByTier:w=[],pricingForUi:{tiers:k},title:E,postCheckoutUrl:y,isBundle:b,hasPaidPlanForProduct:_}=a,{callToAction:j,currencyCode:C,fullPrice:N,introductoryOffer:R,isFree:Z,wpcomProductSlug:x,quantity:z=null}=k[i],S=(0,g.a)(),M=(0,m.useCallback)((()=>y||(S||v)),[y,S,v])(),{run:L,hasCheckoutStarted:P}=(0,o.Z)({from:"my-jetpack",productSlug:x,redirectUrl:M,connectAfterCheckout:!0,siteSuffix:p,useBlogIdSuffix:!0,quantity:z}),A=(0,m.useCallback)((()=>{u(Z),t?.(L,a,i)}),[u,t,L,a,i,Z]),V=N?Math.round(N/12*100)/100:null,H=R?.costPerInterval?Math.round(R.costPerInterval/12*100)/100:null,O="month"===R?.intervalUnit&&1===R?.intervalCount,I=O?(0,l.sprintf)(
// translators: %s is the monthly price for a product
__("trial for the first month, then $%s /month, billed yearly","jetpack-my-jetpack"),V):__("/month, paid yearly","jetpack-my-jetpack",0),B=f&&d?f:E,T=!b&&_?(0,l.sprintf)(/* translators: placeholder is product name. */
__("Install %s","jetpack-my-jetpack"),B):(0,l.sprintf)(/* translators: placeholder is product name. */
__("Get %s","jetpack-my-jetpack"),B),U=j||(Z?__("Start for Free","jetpack-my-jetpack"):T);return React.createElement(n.oK,{primary:!Z},React.createElement(n.NE,null,Z?React.createElement(c.Z,{price:0,legend:"",currency:"USD",hidePriceFraction:!0}):!_&&React.createElement(c.Z,{price:V,offPrice:H,legend:I,currency:C,hideDiscountLabel:O,hidePriceFraction:!0}),React.createElement(r.Z,{fullWidth:!0,variant:Z?"secondary":"primary",onClick:A,isLoading:P||s,disabled:P||e||s},U)),w.map(((e,t)=>{const{included:a,description:c,struck_description:r,info:s}=e.tiers[i],o=r||c?React.createElement(React.Fragment,null,r?React.createElement(React.Fragment,null,React.createElement("del",null,r)," "):null,c?React.createElement("strong",null,c):null):null;return React.createElement(n.kF,{key:t,isIncluded:a,label:o,tooltipTitle:s?.title,tooltipInfo:s?.content?React.createElement("div",{dangerouslySetInnerHTML:{__html:s?.content}}):null,tooltipClassName:s?.class})})))};v.propTypes={cantInstallPlugin:d().bool.isRequired,onProductButtonClick:d().func.isRequired,detail:d().object.isRequired,tier:d().string.isRequired,trackProductButtonClick:d().func.isRequired,preferProductName:d().bool.isRequired};const f=({slug:e,onProductButtonClick:t,trackProductButtonClick:a,isFetching:c,preferProductName:o})=>{const{fileSystemWriteAccess:u="no"}=(0,h.$9)(),{detail:d}=(0,p.Z)(e),{description:g,featuresByTier:f=[],pluginSlug:w,status:k,tiers:E=[],hasPaidPlanForProduct:y,title:b,pricingForUi:{tiers:_}}=d,j="plugin_absent"===k&&"no"===u,C=j&&React.createElement(s.Z,{level:"error",hideCloseButton:!0,title:React.createElement(i.ZP,null,(0,l.sprintf)(
// translators: %s is the plugin name.
__("Due to your server settings, we can't automatically install the plugin for you. Please manually install the %s plugin.","jetpack-my-jetpack"),b)),actions:[React.createElement(r.Z,{variant:"secondary",href:`https://wordpress.org/plugins/${w}`,isExternalLink:!0},__("Get plugin","jetpack-my-jetpack"))]}),N=(0,m.useMemo)((()=>f.map((e=>({name:e?.name,tooltipTitle:e?.info?.title,tooltipInfo:e?.info?.content?React.createElement("div",{dangerouslySetInnerHTML:{__html:e?.info?.content}}):null})))),[f]);return React.createElement(React.Fragment,null,C,React.createElement(n.ZP,{title:g,items:N},E.map(((e,n)=>y&&(e=>{const{isFree:t}=_[e];return t})(e)?null:React.createElement(v,{key:n,tier:e,detail:d,isFetching:c,onProductButtonClick:t,trackProductButtonClick:a,primary:0===n,cantInstallPlugin:j,preferProductName:o})))))};f.propTypes={slug:d().string.isRequired,onProductButtonClick:d().func.isRequired,trackProductButtonClick:d().func.isRequired,isFetching:d().bool.isRequired,preferProductName:d().bool.isRequired};const w=f},8093:(e,t,a)=>{"use strict";a.d(t,{B$:()=>O,Jw:()=>q,Q5:()=>T,WJ:()=>V,Wf:()=>H,Yi:()=>I,ZP:()=>L,jO:()=>B,q:()=>P,qA:()=>A,r:()=>D,uw:()=>F,y$:()=>U});var n=a(9105),c=a(3363),r=a(3846),s=a(5106),i=a(526),o=a(1294),l=a(9307),u=a(5736),d=a(5235),m=a.n(d),p=a(9196),h=a.n(p),g=a(8209),v=a(7363),f=a(4598),w=a(1838),k=a(4848),E=a(3629),y=a(7555),b=a(5626),_=a(968),j=a(9144),C=a(5610),N=a(4763),R=a(2605),Z=a(720),x=a(1657),z=a(7690),S=a(1287),M=a(1439);const __=u.__;function L({bundle:e,existingLicenseKeyUrl:t="admin.php?page=my-jetpack#/add-license",installsPlugin:a=!1,slug:u,supportingInfo:d,preferProductName:C=!1,children:N=null,imageContainerClassName:R="",ctaButtonLabel:Z=null,hideTOS:x=!1,quantity:z=null,directCheckout:M=!1,highlightLastFeature:L=!1,ctaCallback:P=null}){const{detail:A}=(0,f.Z)(u),{activate:V,isPending:H}=(0,v.Z)(u),{isUpgradableByBundle:O,tiers:I,pricingForUi:B}=A,{recordEvent:T}=(0,k.Z)(),{onClickGoBack:U}=(0,E.U)({slug:u}),{myJetpackCheckoutUri:F=""}=(0,w.$9)(),{siteIsRegistering:D,handleRegisterSite:q}=(0,o.Z)({skipUserConnection:!0,redirectUri:A.postActivationUrl?A.postActivationUrl:null});(0,p.useEffect)((()=>{T("jetpack_myjetpack_product_interstitial_view",{product:u})}),[T,u]);const J=(0,p.useCallback)(((e=!1)=>e?"":"crm"===u?"jetpack-crm":B?.tiers?.upgraded?.wpcomProductSlug?B.tiers.upgraded.wpcomProductSlug:B.wpcomProductSlug),[u,B]),G=(0,p.useCallback)(((e=!1,t=null)=>{T("jetpack_myjetpack_product_interstitial_add_link_click",{product:t??u,product_slug:J(e)})}),[T,u,J]),W=(0,p.useCallback)(((t=!1)=>{T("jetpack_myjetpack_product_interstitial_add_link_click",{product:e,product_slug:J(t)})}),[T,e,J]),Q=(0,y.Z)(g.xB.Home),K=(0,p.useCallback)(((e,t,a)=>{let n=t?.postCheckoutUrl?t?.postCheckoutUrl:F;P?.({slug:u,product:t,tier:a}),t?.isBundle||M?e?.():V({productId:u},{onSettled:({productId:c})=>{n=c?.post_checkout_url?c.post_checkout_url:F;const r=t?.hasPaidPlanForProduct,s=a?t?.pricingForUi?.tiers?.[a]?.isFree:t?.pricingForUi?.isFree,i=!s&&!r||a&&t?.pricingForUi?.tiers?.[a]&&!s&&t?.isUpgradable;"zero-bs-crm"!==t.pluginSlug||r?i?e?.(null,n):q().then((e=>{if(!e)return Q()})):window.location.href="https://jetpackcrm.com/pricing/"}})}),[M,V,Q,u,F,P,q]);return h().createElement(n.Z,{showHeader:!1,showBackground:!1},h().createElement(c.Z,{horizontalSpacing:3,horizontalGap:3},h().createElement(r.Z,{className:S.Z["product-interstitial__header"]},h().createElement(b.Z,{onClick:U}),t&&h().createElement(s.ZP,{variant:"body-small"},(0,l.createInterpolateElement)(__("Already have an existing plan or license key? <a>Get started</a>.","jetpack-my-jetpack"),{a:h().createElement(i.Z,{className:S.Z["product-interstitial__license-activation-link"],href:t,variant:"link"})}))),h().createElement(r.Z,null,I&&I.length?h().createElement(j.Z,{slug:u,clickHandler:K,onProductButtonClick:K,trackProductButtonClick:G,preferProductName:C,isFetching:H||D}):h().createElement(c.Z,{className:O?null:S.Z.container,horizontalSpacing:0,horizontalGap:0,fluid:!0},h().createElement(r.Z,{sm:4,md:4,lg:7},h().createElement(_.Z,{slug
// translators: %d is the number of days left in the month.
__("Wait for %d days to reset your limit, or upgrade now to a higher tier for additional requests and keep your work moving forward.","jetpack-my-jetpack"),Math.floor((new Date(H?.["next-start"])-new Date)/864e5)),oe=__("Reach for More with Jetpack AI! Upgrade now for additional requests and keep your momentum going.","jetpack-my-jetpack"),le=(0,m.sprintf)(
// translators: %s is the next upgrade value
__("Get %s requests","jetpack-my-jetpack"),V?.value||"more"),ue=__("Upgrade now","jetpack-my-jetpack"),de=(0,C.Z)("/add-jetpack-ai"),{recordEvent:me}=(0,_.Z)(),pe=(0,y.useCallback)((()=>{me("jetpack_ai_upgrade_contact_us",{placement:"product-page"})}),[me]),he=(0,y.useCallback)((()=>{me("jetpack_ai_upgrade_button",{placement:"product-page",context:"my-jetpack",current_tier_slug:A?.slug||"",requests_count:P}),de()}),[me,P,A,de]),ge=(0,y.useCallback)((()=>E(!1)),[]);(0,y.useEffect)((()=>{me("jetpack_ai_myjetpack_product_page_view",{current_tier_slug:A?.slug||"",requests_count:P})}),[P,A?.slug,me]),(0,y.useEffect)((()=>{E(ee||te)}),[ee,te]);const ve=React.createElement("span",{className:R.Z["product-interstitial__new-badge"]},__("New","jetpack-my-jetpack")," ");return React.createElement(c.Z,{showHeader:!1,showBackground:!0},React.createElement(r.Z,{fluid:!0,horizontalSpacing:3,horizontalGap:2},React.createElement(s.Z,{className:w()(R.Z["product-interstitial__section"])},React.createElement("div",{className:R.Z["product-interstitial__section-wrapper-wide"]},React.createElement(N.Z,{onClick:e})),React.createElement("div",{className:w()(R.Z["product-interstitial__section-wrapper-wide"],R.Z["product-interstitial__product-header"])},React.createElement(i.Z,null),React.createElement("div",{className:R.Z["product-interstitial__product-header-name"]},__("AI Assistant","jetpack-my-jetpack")))),React.createElement(s.Z,{className:w()(R.Z["product-interstitial__section"])},React.createElement("div",{className:R.Z["product-interstitial__hero-section"]},React.createElement("div",{className:R.Z["product-interstitial__hero-content"]},React.createElement("h1",{className:R.Z["product-interstitial__hero-heading"]},a),React.createElement("div",{className:R.Z["product-interstitial__hero-sub-heading"]},__("Draft, transform, translate, and alter both new and existing content leveraging the capabilities of AI, inside the block editor.","jetpack-my-jetpack")),!U&&!I&&React.createElement(d.Button,{variant:"primary",onClick:he,className:R.Z["product-interstitial__hero-cta"]},__("Get more requests","jetpack-my-jetpack")),U&&React.createElement(d.Button,{variant:"primary",onClick:pe,href:J,className:R.Z["product-interstitial__hero-cta"]},__("Contact Us","jetpack-my-jetpack"))),React.createElement("div",{className:R.Z["product-interstitial__hero-side"]},D&&React.createElement(d.Card,{className:R.Z["stats-card"]},React.createElement(o.pJ,null),React.createElement("div",null,React.createElement("div",{className:R.Z["product-interstitial__stats-card-text"]},__("Requests for this month","jetpack-my-jetpack")),React.createElement("div",{className:R.Z["product-interstitial__stats-card-value"]},ce))),q&&React.createElement(d.Card,{className:R.Z["stats-card"]},React.createElement(p.Z,{icon:h.Z,className:R.Z["stats-card-icon-check"]}),React.createElement("div",null,React.createElement("div",{className:R.Z["product-interstitial__stats-card-text"]},__("All-time requests used","jetpack-my-jetpack")),React.createElement("div",{className:R.Z["product-interstitial__stats-card-value"]},P))),B&&React.createElement(d.Card,{className:R.Z["stats-card"]},React.createElement(p.Z,{icon:h.Z,className:R.Z["stats-card-icon-check"]}),React.createElement("div",null,React.createElement("div",{className:R.Z["product-interstitial__stats-card-text"]},__("Free requests available","jetpack-my-jetpack")),React.createElement("div",{className:R.Z["product-interstitial__stats-card-value"]},F)))))),React.createElement(s.Z,{className:R.Z["product-interstitial__section"]},React.createElement("div",{className:R.Z["product-interstitial__section-wrapper"]},k&&React.createElement("div",{className:R.Z["product-interstitial__ai-notice"]},React.createElement(l.Z,{actions:[React.createElement(d.Button,{isPrimary:!0,onClick:he},ee?le:ue)],onClose:ge,level:ee?"warning":"error",title:ee?re:se},ee?ie:oe)),React.createElement("h2",{className:R.Z["product-interstitial__section-heading"]},__("AI Features","jetpack-my-jetpack")),React.createElement("p",{className:R.Z["product-interstitial__section-sub-headi
// translators: %s is the name of the information being fetched, e.g. "site purchases".
__("There was an error fetching your %s information. Check your site connectivity and try again.","jetpack-my-jetpack"),e);(0,c.useEffect)((()=>{t&&o.includes(e)&&i({message:l,options:{id:"fetching-error-notice",level:"error",priority:r.E3}})}),[l,i,t,e])}},7363:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var n=a(5736),c=a(4848),r=a(5544),s=a(7296),i=a(1838),o=a(4598);const __=n.__,l=e=>{const{detail:t,refetch:a}=(0,o.Z)(e),{recordEvent:l}=(0,c.Z)(),{mutate:u,isPending:d}=(0,s.Z)({name:r.iG,query:{path:`${r.Jk}/${e}`,method:"POST"},options:{onSuccess:()=>{(e=>{const{standalonePluginInfo:t,isPluginActive:a}=e;return t?.hasStandalonePlugin?t?.isStandaloneActive:a})(t)||(l("jetpack_myjetpack_product_activated",{product:e}),(e=>{const{items:t}=(0,i.$9)("products");t[e]?.standalone_plugin_info.has_standalone_plugin&&(window.myJetpackInitialState.products.items[e].standalone_plugin_info.is_standalone_active=!0,window.myJetpackInitialState.products.items[e].standalone_plugin_info.is_standalone_installed=!0)})(e)),a()}},errorMessage:(0,n.sprintf)(
// translators: %$1s: Jetpack Product name
__("Failed to activate %1$s. Please try again","jetpack-my-jetpack"),t.name)});return{activate:u,isPending:d}}},5595:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5736),c=a(5544),r=a(7296),s=a(4598);const __=n.__,i=e=>{const{detail:t,refetch:a}=(0,s.Z)(e),{mutate:i,isPending:o}=(0,r.Z)({name:c.yv,query:{path:`${c.Jk}/${e}/install-standalone`,method:"POST"},options:{onSuccess:a},errorMessage:(0,n.sprintf)(
// translators: %$1s: Jetpack Product name
__("Failed to install standalone plugin for %1$s. Please try again","jetpack-my-jetpack"),t.name)});return{install:i,isPending:o}}},4598:(e,t,a)=>{"use strict";a.d(t,{B:()=>o,Z:()=>u});var n=a(9196),c=a(5544),r=a(7108),s=a(1838),i=a(466);const o=()=>{const{items:e}=(0,s.$9)("products");return Object.entries(e).reduce(((e,[t,a])=>({...e,[t]:l(a)})),{})},l=e=>{const t=(0,i.Z)(e);return t.features=t.features||[],t.supportedProducts=t.supportedProducts||[],t.pricingForUi.fullPricePerMonth=(e=>"year"===e.pricingForUi.productTerm?Math.round(e.pricingForUi.fullPrice/12*100)/100:e.pricingForUi.fullPrice)(t),t.pricingForUi.discountPricePerMonth=(e=>"year"===e.pricingForUi.productTerm?Math.round(e.pricingForUi.discountPrice/12*100)/100:e.pricingForUi.discountPrice)(t),t},u=e=>{const t=o(),a=t?.[e],{refetch:s,isLoading:i}=(e=>(0,r.Z)({name:c.q9,query:{path:`${c.Jk}/${e}`},options:{enabled:!1}}))(e);return{detail:a,refetch:(0,n.useCallback)((()=>(async(e,t)=>{const{data:a}=await t();window.myJetpackInitialState.products.items[e]=a})(e,s)),[e,s]),isLoading:i}}},6178:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(4743),c=a(5885),r=a(6916),s=a(1838);const i=({name:e,queryFn:t,errorMessage:a})=>{const i=(0,c.a)({queryKey:[e],queryFn:()=>{const{apiRoot:e,apiNonce:a}=(0,s.M_)();return n.ZP.setApiRoot(e),n.ZP.setApiNonce(a),t(n.ZP)},refetchOnWindowFocus:!1,refetchIntervalInBackground:!1}),{isError:o,isLoading:l}=i;return(0,r.o)({infoName:e,isError:!l&&o,overrideMessage:a}),i}},7296:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(2016),c=a(6989),r=a.n(c),s=a(6916);const i=({name:e,query:t,options:a,errorMessage:c})=>{const i=(0,n.D)({mutationKey:[e],mutationFn:()=>r()(t),...a}),{isError:o,isPending:l}=i;return(0,s.o)({infoName:e,isError:!l&&o,overrideMessage:c}),i}},7108:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5885),c=a(6989),r=a.n(c),s=a(6916);const i=({name:e,query:t,options:a,errorMessage:c})=>{const i=(0,n.a)({queryKey:[e],queryFn:()=>r()(t),refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,...a}),{error:o,isError:l,isLoading:u}=i;return(0,s.o)({infoName:e,isError:!u&&l&&"not_connected"!==o.code,overrideMessage:c}),i}},1838:(e,t,a)=>{"use strict";a.d(t,{$9:()=>n,M_:()=>c,vH:()=>r});const n=e=>e?window?.myJetpackInitialState?.[e]??{}:window?.myJetpackInitialState,c=()=>window?.myJetpackRest??{},r=e=>e?window?.JP_CONNECTION_INITIAL_STATE?.[e]??{}:window?.JP_CONNECTION_INITIAL_STATE},1950:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(2307);const c=e=>Object.values(e).filter((({requiresUserConnection:e,status:t})=>e&&(t===n.N.ACTIVE||t===n.N.ERROR))).map((({name:e})=>e))},466:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});const n=e=>Array.isArray(e)?e.map((e=>n(e))):"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map((([e,t])=>[e.replace(/([-_][a-z])/gi,(e=>e.toUpperCase().replace(/[-_]/g,""))),n(t)]))):e,c=n},8059:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(5736),c=a(5544),r=a(7296),s=a(1838);const __=n.__,i=()=>{const{redBubbleAlerts:e}=(0,s.$9)(),t=Object.keys(e).includes("welcome-banner-active"),{mutate:a}=(0,r.Z)({name:c.Vu,query:{path:c.YF,method:"POST"},errorMessage:__("Failed to dismiss the welcome banner. Please try again","jetpack-my-jetpack")});return{dismissWelcomeBanner:a,isWelcomeBannerVisible:t}}},4848:(e,t,a)=>{"use strict";a.d(t,{Z:()=>i});var n=a(6975),c=a(9196),r=a(1838),s=a(5162);const i=()=>{const{isUserConnected:e,connectedPlugins:t,userConnectionData:a={}}=(0,s.Z)(),{login:i,ID:o}=a.currentUser?.wpcomUser||{},{myJetpackVersion:l=""}=(0,r.$9)();(0,c.useEffect)((()=>{e&&o&&i&&n.Z.initialize(o,i)}),[o,e,i]);const u=Object.keys(t||{}).sort().join(",").replaceAll("jetpack-","");return{recordEvent:(0,c.useCallback)(((e,t)=>{n.Z.tracks.recordEvent(e,{...t,version:l,referring_plugins:u})}),[])}}},3629:(e,t,a)=>{"use strict";a.d(t,{U:()=>i});var n=a(9196),c=a(8209),r=a(4848),s=a(7555);function i({slug:e}){const{recordEvent:t}=(0,r.Z)(),a=(0,s.Z)(c.xB.Home);return{onClickGoBack:(0,n.useCallback)((n=>{e&&t("jetpack_myjetpack_product_interstitial_back_link_click",{product:e}),document.referrer.incl
// translators: %s is the name of the plugin that has a bad installation.
__("Your installation of %1$s is incomplete. If you installed %1$s from GitHub, please refer to the developer documentation to set up your development environment.","jetpack-my-jetpack"),i),l={id:"bad-installation-notice",level:"error",actions:[{label:__("See documentation","jetpack-my-jetpack"),onClick:()=>{window.open("https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md"),a("jetpack_my_jetpack_bad_installation_notice_cta_click",{plugin:i})},noDefaultClasses:!0}],priority:r.dR};t({message:o,options:l})}),[e,t,a])}},8505:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var n=a(3846),c=a(5106),r=a(3329),s=a(1045),i=a(5736),o=a(9196),l=a(1647),u=a(8437),d=a(4848);const __=i.__,m=()=>{const{setNotice:e,resetNotice:t}=(0,o.useContext)(u.T),{hasConnectionError:a,connectionErrorMessage:m}=(0,r.Z)(),{restoreConnection:p,isRestoringConnection:h,restoreConnectionError:g}=(0,s.Z)(),{recordEvent:v}=(0,d.Z)();(0,o.useEffect)((()=>{t()}),[t,g]),(0,o.useEffect)((()=>{if(!a)return;let t=m;g&&(t=React.createElement(n.Z,null,React.createElement(c.ZP,{mb:2},(0,i.sprintf)(/* translators: placeholder is the error. */
__("There was an error reconnecting Jetpack. Error: %s","jetpack-my-jetpack"),g)),React.createElement(c.ZP,{mb:2},m)));const r=__("Reconnecting Jetpack…","jetpack-my-jetpack"),s={id:"connection-error-notice",level:"error",actions:[{label:__("Restore Connection","jetpack-my-jetpack"),onClick:()=>{p(),v("jetpack_my_jetpack_connection_error_notice_reconnect_cta_click")},isLoading:h,loadingText:r,noDefaultClasses:!0}],priority:l.hg+(h?1:0)};e({message:t,options:s})}),[e,v,a,m,p,h,g,t])}},4307:(e,t,a)=>{"use strict";a.d(t,{Z:()=>w});var n=a(3846),c=a(5106),r=a(7325),s=a(1294),i=a(5736),o=a(9196),l=a(8209),u=a(1647),d=a(8437),m=a(4598),p=a(1838),h=a(1950),g=a(4848),v=a(5162),f=a(7555);const __=i.__,w=e=>{const{recordEvent:t}=(0,g.Z)(),{setNotice:a,resetNotice:w}=(0,o.useContext)(d.T),{apiRoot:k,apiNonce:E}=(0,p.M_)(),{isRegistered:y,isUserConnected:b,hasConnectedOwner:_}=(0,v.Z)(),{siteIsRegistering:j,handleRegisterSite:C}=(0,s.Z)({skipUserConnection:!0,apiRoot:k,apiNonce:E,from:"my-jetpack"}),N=(0,m.B)(),R=(0,f.Z)(l.xB.Connection);(0,o.useEffect)((()=>{if(!Object.keys(e).includes("missing-site-connection"))return;const s=(0,h.Z)(N),o=!_&&!b&&s.length>0;if(!o&&y)return;const l=(0,i.sprintf)(/* translators: placeholder is product name. */
__("Jetpack %s needs a user connection to WordPress.com to be able to work.","jetpack-my-jetpack"),s[0]),d={message:1===s.length?l:__("Some products need a user connection to WordPress.com to be able to work.","jetpack-my-jetpack"),buttonLabel:__("Connect your user account","jetpack-my-jetpack"),title:__("Missing user connection","jetpack-my-jetpack")},m={message:__("Some products need a connection to WordPress.com to be able to work.","jetpack-my-jetpack"),buttonLabel:__("Connect your site","jetpack-my-jetpack"),title:__("Missing site connection","jetpack-my-jetpack")},p={id:o?"user-connection-notice":"site-connection-notice",level:"info",actions:[{label:o?d.buttonLabel:m.buttonLabel,isLoading:j,loadingText:__("Connecting…","jetpack-my-jetpack"),onClick:()=>{o&&(t("jetpack_my_jetpack_user_connection_notice_cta_click"),R()),t("jetpack_my_jetpack_site_connection_notice_cta_click"),C().then((()=>{w(),a({message:__("Your site has been successfully connected.","jetpack-my-jetpack"),options:{id:"site-connection-success-notice",level:"success",actions:[],priority:u.hg,hideCloseButton:!1,onClose:w}})}))},noDefaultClasses:!0}],priority:u.hg+(j?1:0),isRedBubble:!0},g=o?d.message:React.createElement(n.Z,null,React.createElement(c.ZP,{mb:2},m.message),React.createElement(r.Z,{agreeButtonLabel:m.buttonLabel}));a({message:g,title:o?d.title:m.title,options:p})}),[C,_,y,b,R,N,t,e,w,a,j])}},938:(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var n=a(9196);const c=(e,t)=>{(0,n.useEffect)((()=>{const a=a=>{a.target instanceof Element&&e.current&&!e.current.contains(a.target)&&t(a)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}}),[e,t])}},199:(e,t,a)=>{"use strict";function n(){const e=window.location.search;return new URLSearchParams(e).has("redirect_to_referrer","1")&&""!==document.referrer?document.referrer:null}a.d(t,{a:()=>n})},6864:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(6895),c=a(8209),r=a(1838);const s=()=>{const{siteSuffix:e="",blogID:t}=(0,r.$9)();return(0,n.Z)(c.w6,{site:t??e})}},7356:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(6895),c=a(8209),r=a(1838);const s=()=>{const{siteSuffix:e="",blogID:t,myJetpackCheckoutUri:a}=(0,r.$9)(),s=a?`redirect_to=${a}`:null;return(0,n.Z)(c.f6,{site:t??e,query:s})}},7111:(e,t,a)=>{"use strict";a.d(t,{h:()=>n,o:()=>c});const n=({partner_slug:e})=>!!e&&"goldenticket"===e;function c(e){return!!Array.isArray(e)&&e.filter((e=>n(e))).length>0}},2042:(e,t,a)=>{"use strict";e.exports=a.p+"images/disconnect-confirm-dc9fe8f5c68cfd1320e0.jpg"},724:(e,t,a)=>{"use strict";e.exports=a.p+"images/disconnect-thanks-5873bfac56a9bd7322cd.jpg"},8702:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-license-activation-with-lock-7b01c1a4cf56de799cd7.png"},1160:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-license-activation-with-success-cad524ede4e793cc0ece.png"},5242:(e,t,a)=>{"use strict";e.exports=a.p+"images/apple-92dacafad84e79708a74.svg"},6790:(e,t,a)=>{"use strict";e.exports=a.p+"images/connect-f27775ac15cf885713c2.png"},184:(e,t,a)=>{"use strict";e.exports=a.p+"images/google-dec2a429bf1d8e83f9ad.svg"},4403:(e,t,a)=>{"use strict";e.exports=a.p+"images/wordpress-1fc3e0ba6c52e9707900.svg"},5050:(e,t,a)=>{"use strict";e.exports=a.p+"images/cloud-81ac85ba680343200f54.svg"},3815:(e,t,a)=>{"use strict";e.exports=a.p+"images/empty-avatar-fea23feddfa99b07c2e8.svg"},9182:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-9de1caef5eb5c22da5d6.svg"},4730:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-manage-3a7ecaa604823c98c3cf.svg"},5610:(e,t,a)=>{"use strict";e.exports=a.p+"images/boost-a54137485af36fdffe9c.png"},4763:(e,t,a)=>{"use strict";e.exports=a.p+"images/crm-7e7684ae2c40327d8fed.png"},2605:(e,t,a)=>{"use strict";e.exports=a.p+"images/extras-26daf36507504c96d066.png"},1488:(e,t,a)=>{"use strict";e.exports=a.p+"images/jetpack-ai-1a265a198f75543e342e.png"},720:(e,t,a)=>{"use strict";e.exports=a.p+"images/search-f9756bd9c926d905fe70.png"},1657:(e,t,a)=>{"use strict";e.exports=a.p+"images/social-e3fb80b2f32534fefe63.png"},7690:(e,t,a)=>{"us