laipower/wp-content/plugins/jetpack-protect/build/index.js

31 lines
177 KiB
JavaScript
Raw Normal View History

/*! For license information please see index.js.LICENSE.txt */
!function(){var e={9487:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});const c={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:",
__("There was an error reconnecting Jetpack. Error: %s","jetpack-protect"),s))):null;return m().createElement(m().Fragment,null,u,m().createElement(r.Notice,{status:"error",isDismissible:!1,className:d.Z.notice},m().createElement(i.Z,{icon:o.Z}),m().createElement("div",{className:d.Z.message},t),l&&m().createElement("a",{onClick:l,onKeyDown:l,className:d.Z.link,href:"#"},__("Restore Connection","jetpack-protect"))))};p.propTypes={message:s().string.isRequired,restoreConnectionCallback:s().func,isRestoringConnection:s().bool,restoreConnectionError:s().string},t.Z=p},1294:function(e,t,n){"use strict";var c,r=n(4743),a=n(9818),i=n(9196),o=n(428);const l=null!==(c=window)&&void 0!==c&&c.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};t.Z=function(){let{registrationNonce:e=l.registrationNonce,apiRoot:t=l.apiRoot,apiNonce:n=l.apiNonce,redirectUri:c,autoTrigger:s,from:u,skipUserConnection:m}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{registerSite:d,connectUser:p,refreshConnectedPlugins:h}=(0,a.useDispatch)(o.t),g=(0,a.useSelect)((e=>e(o.t).getRegistrationError())),{siteIsRegistering:f,userIsConnecting:v,userConnectionData:E,connectedPlugins:y,connectionErrors:b,isRegistered:k,isUserConnected:Z,hasConnectedOwner:C}=(0,a.useSelect)((e=>({siteIsRegistering:e(o.t).getSiteIsRegistering(),userIsConnecting:e(o.t).getUserIsConnecting(),userConnectionData:e(o.t).getUserConnectionData(),connectedPlugins:e(o.t).getConnectedPlugins(),connectionErrors:e(o.t).getConnectionErrors(),...e(o.t).getConnectionStatus()}))),w=()=>m?c?(window.location=c,Promise.resolve(c)):Promise.resolve():p({from:u,redirectUri:c}),_=t=>(t&&t.preventDefault(),k?w():d({registrationNonce:e,redirectUri:c}).then((()=>w())));return(0,i.useEffect)((()=>{r.ZP.setApiRoot(t),r.ZP.setApiNonce(n)}),[t,n]),(0,i.useEffect)((()=>{!s||f||v||_()}),[]),{handleRegisterSite:_,handleConnectUser:w,refreshConnectedPlugins:h,isRegistered:k,isUserConnected:Z,siteIsRegistering:f,userIsConnecting:v,registrationError:g,userConnectionData:E,hasConnectedOwner:C,connectedPlugins:y,connectionErrors:b}}},3329:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},h:function(){return o}});var c=n(6186),r=n(1294),a=n(1045);function i(){const{connectionErrors:e}=(0,r.Z)({}),t=Object.values(e).shift(),n=t&&Object.values(t).length&&Object.values(t).shift().error_message;return{hasConnectionError:Boolean(n),connectionErrorMessage:n}}const o=()=>{const{hasConnectionError:e,connectionErrorMessage:t}=i(),{restoreConnection:n,isRestoringConnection:r,restoreConnectionError:o}=(0,a.Z)();return e?React.createElement(c.Z,{isRestoringConnection:r,restoreConnectionError:o,restoreConnectionCallback:n,message:t}):null}},8258:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var c,r=n(4743),a=n(4153),i=n(9818),o=n(9196),l=n(1294),s=n(428);const{registrationNonce:u,apiRoot:m,apiNonce:d,siteSuffix:p}=null!==(c=window)&&void 0!==c&&c.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function h(){let{productSlug:e,redirectUrl:t,siteSuffix:n=p,siteProductAvailabilityHandler:c=null,from:h}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[g,f]=(0,o.useState)(!1),{registerSite:v}=(0,i.useDispatch)(s.t),{isUserConnected:E,isRegistered:y,handleConnectUser:b}=(0,l.Z)({redirectUri:t,from:h}),k=(0,a.Z)(e,n,t,E),Z=()=>Promise.resolve(c&&c()).then((e=>{if(e)return b();window.location.href=k})),C=e=>{if(e&&e.preventDefault(),f(!0),y)return Z();v({registrationNonce:u,redirectUri:t}).then(Z)};return(0,o.useEffect)((()=>{r.ZP.setApiRoot(m),r.ZP.setApiNonce(d)}),[]),{run:C,isRegistered:y,hasCheckoutStarted:g}}},1045:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var c,r=n(4743),a=n(9818),i=n(9196),o=n(428);const{apiRoot:l,apiNonce:s}=null!==(c=window)&&void 0!==c&&c.JP_CONNECTION_INITIAL_STATE?window.JP_CONNECTION_INITIAL_STATE:{};function u(){const[e,t]=(0,i.useState)(!1),[n,c]=(0,i.useState)(null),{disconnectUserSuccess:u}=(0,a.useDispatch)(o.t),m="/wp-admin/admin.php?page=my-jetpack#/connection";return(0,i.useEffect)((()=>{r.ZP.setApi
__("Show %s more","jetpack-protect"),f):(0,r.sprintf)(/* translators: %s: Number of hide items */
__("Hide %s items","jetpack-protect"),f)))))}},5338:function(e,t,n){"use strict";n.d(t,{Dx:function(){return h.Z},KB:function(){return p.Z}});var c=n(5106),r=n(5609),a=n(5736),i=n(1074),o=n(7489),l=n(2229),s=n(5235),u=n.n(s),m=n(9196),d=n.n(m),p=n(2328),h=n(6119),g=n(513),f=n(246);const __=a.__,v=e=>{let{children:t}=e;return d().createElement("ul",{className:g.Z.navigation,role:"menu"},t)},E=e=>{var t,n,a,s;let{children:p,data:h}=e;const f=(0,m.useRef)(),[v,E]=(0,m.useState)(!1),y=(null==h||null===(t=h.items)||void 0===t?void 0:t.find((e=>(null==e?void 0:e.id)===(null==h?void 0:h.selectedItem))))??{label:__("See all results","jetpack-protect")},{label:b,icon:k}=y,Z=(0,m.useCallback)((()=>{E((e=>!e))}),[]);return d().createElement("button",{className:g.Z["navigation-dropdown-button"],onClick:Z,ref:f},d().createElement("div",{className:g.Z["navigation-dropdown-label"]},k&&d().createElement(i.Z,{icon:k,className:g.Z["navigation-dropdown-icon"]}),d().createElement(c.ZP,null,b)),d().createElement(i.Z,{icon:v?o.Z:l.Z,size:32}),d().createElement(r.Popover,{position:"bottom center",anchorRef:null==f?void 0:f.current,className:u()({[g.Z["navigation-dropdown-open"]]:v,[g.Z["navigation-dropdown-closed"]]:!v})},d().createElement("div",{style:{width:null==f||null===(n=f.current)||void 0===n||null===(a=n.getBoundingClientRect)||void 0===a||null===(s=a.call(n))||void 0===s?void 0:s.width}},p)))};t.ZP=e=>{let{children:t,selected:n,onSelect:c,mode:r="list"}=e;const a=(0,f.Z)({selected:n,onSelect:c}),i=(e=>{switch(e){case"list":default:return v;case"dropdown":return E}})(r);return d().createElement(f.k.Provider,{value:{...a,mode:r}},d().createElement(i,{data:a},t))}},6119:function(e,t,n){"use strict";var c=n(5235),r=n.n(c),a=n(9196),i=n.n(a),o=n(5167),l=n(2389),s=n(513),u=n(246);t.Z=e=>{let{id:t,label:n,icon:c,badge:m,disabled:d,onClick:p,onKeyDown:h,onFocus:g,checked:f}=e;const v=(0,a.useContext)(u.k),E=(null==v?void 0:v.selectedItem)===t,y=null==v?void 0:v.registerItem,b=null==v?void 0:v.registerRef,k=null==v?void 0:v.handleClickItem,Z=null==v?void 0:v.handleKeyDownItem,C=null==v?void 0:v.handleFocusItem,w=r()(s.Z["navigation-item"],{[s.Z.clickable]:!d,[s.Z.selected]:E}),_=(0,a.useCallback)((e=>{null==p||p(e),null==k||k(t)}),[k,t,p]),N=(0,a.useCallback)((e=>{null==h||h(e),null==Z||Z(e)}),[Z,h]),R=(0,a.useCallback)((e=>{b(e,t)}),[b,t]),S=(0,a.useCallback)((e=>{null==g||g(e),null==C||C(t)}),[C,t,g]);return(0,a.useEffect)((()=>{y({id:t,disabled:d,label:n,icon:c})}),[]),i().createElement("li",{className:w,onClick:d?null:_,onKeyDown:N,onFocus:d?null:S,role:"menuitem",tabIndex:d?-1:0,ref:R},i().createElement(l.Z,{icon:c},n),i().createElement(o.Z,{count:m,checked:f}))}},2389:function(e,t,n){"use strict";var c=n(5106),r=n(1074),a=n(5235),i=n.n(a),o=n(5162),l=n.n(o),s=n(9196),u=n.n(s),m=n(513);const d=e=>{let{icon:t,children:n,className:a}=e;return u().createElement(c.ZP,{className:i()(m.Z["navigation-item-label"],a)},t&&u().createElement(r.Z,{icon:t,className:m.Z["navigation-item-icon"],size:28}),u().createElement("span",{className:m.Z["navigation-item-label-content"]},n))};d.propTypes={icon:l().node,children:l().node.isRequired},t.Z=d},246:function(e,t,n){"use strict";n.d(t,{k:function(){return r}});var c=n(9196);const r=n.n(c)().createContext();t.Z=e=>{let{selected:t,onSelect:n}=e;const[r,a]=(0,c.useState)([]),[i,o]=(0,c.useState)([]),[l,s]=(0,c.useState)(),u=(e,t)=>{const n=e-1,c=n<0?t:n,a=r[c];return null!=a&&a.disabled?u(c,t):a},m=(e,t)=>{const n=e+1,c=n>t?0:n,a=r[c];return null!=a&&a.disabled?m(c,t):a};return{selectedItem:t,handleClickItem:e=>{n(e)},handleKeyDownItem:e=>{const c=null==e?void 0:e.code,a=r.findIndex((e=>(null==e?void 0:e.id)===t)),o=r.length-1;let s;if("ArrowUp"===c){const e=u(a,o);s=null==e?void 0:e.id}else if("ArrowDown"===c){const e=m(a,o);s=null==e?void 0:e.id}else"Enter"!==c&&"Space"!==c||!l||(s=l);if(s){const e=i[s];null==e||e.focus(),n(s)}},handleFocusItem:e=>{s(e)},registerRef:(e,t)=>{o((n=>!n[t]&&e?{...n,[t]:e}:n))},registerItem:e=>{a((t=>{const n=[...t],c=null==e?void 0:e.id,r=n.findIndex((e=>(null==e?void 0:e.id
__("Latest results as of %s","jetpack-protect"),(0,s.dateI18n)("F jS",t))),e>0&&d().createElement(i.ZP,{variant:"headline-small",component:"h1"},(0,u.sprintf)(/* translators: %s: Total number of threats */
__("%1$s %2$s found","jetpack-protect"),e,1===e?"threat":"threats"))),d().createElement("div",{className:f.Z.summary__notice},m&&m.message&&d().createElement(g.Z,m)),n&&0===e&&d().createElement(o.Z,{variant:"secondary",className:f.Z["summary__scan-button"],isLoading:v,onClick:e=>{e.preventDefault(),E()}},__("Scan now","jetpack-protect")))))}},8891:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var c=n(5106),r=n(5736),a=n(1074),i=n(9196),o=n.n(i),l=n(2251),s=n(9971);const __=r.__;function u(e){let{threat:t,fixAllDialog:n,onCheckFix:u}=e;const[m,d]=(0,i.useState)(!0),p=(0,i.useCallback)((e=>{d(e.target.checked),u(e.target.checked,t)}),[u,t]);return o().createElement(o().Fragment,null,o().createElement("div",{className:s.Z.threat},o().createElement(a.Z,{icon:t.icon,className:s.Z.threat__icon}),o().createElement("div",{className:s.Z.threat__summary},o().createElement(c.ZP,{className:s.Z.threat__summary__label,mb:1},t.label),o().createElement(c.ZP,{className:s.Z.threat__summary__title},(e=>{switch(e.fixer){case"replace":return __("Jetpack Scan will replace the affected file or directory.","jetpack-protect");case"delete":return __("Jetpack Scan will delete the affected file or directory.","jetpack-protect");case"update":return e.target?(0,r.sprintf)(/* translators: %s: Version that the plugin will be upgraded to */
__("Jetpack Scan will update to a newer version %s.","jetpack-protect"),e.target):__("Jetpack Scan will update to a newer version.","jetpack-protect");case"edit":return __("Jetpack Scan will edit the affected file or directory.","jetpack-protect");case"rollback":return e.target?(0,r.sprintf)(/* translators: %s: Version that the plugin will be upgraded to */
__("Jetpack Scan will rollback the affected file to the version from %s.","jetpack-protect"),e.target):__("Jetpack Scan will rollback the affected file to an older (clean) version.","jetpack-protect");default:return __("Jetpack Scan will resolve the threat.","jetpack-protect")}})(t.fixable))),o().createElement("div",{className:s.Z.threat__severity},o().createElement(l.Z,{severity:t.severity})),n&&o().createElement("div",{className:s.Z.threat__checkbox},o().createElement("input",{type:"checkbox",checked:m,onChange:p,value:t.id}))))}},5658:function(e,t,n){"use strict";var c=n(5106),r=n(9307),a=n(5736),i=n(9196),o=n(5773),l=n(9709);const __=a.__,_n=a._n,s=()=>React.createElement("svg",{width:"80",height:"96",viewBox:"0 0 80 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40 0.00634766L80 17.7891V44.2985C80 66.8965 65.1605 88.2927 44.2352 95.0425C41.4856 95.9295 38.5144 95.9295 35.7648 95.0425C14.8395 88.2927 0 66.8965 0 44.2985V17.7891L40 0.00634766Z",fill:"#069E08"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.9 33.6909L35.375 67.9124L19.2047 55.9263L22.7848 51.1264L34.1403 59.5436L56.0851 30.122L60.9 33.6909Z",fill:"white"}));t.Z=()=>{const{lastChecked:e}=(0,o.Z)(),t=(0,i.useMemo)((()=>e?(e=>{const t=new Date,n=6e4*t.getTimezoneOffset(),c=Math.floor((new Date(t.getTime()+n).getTime()-e)/1e3);let r=c/31536e3;return r>1?(0,a.sprintf)(
// translators: placeholder is a number amount of years i.e. "5 years ago".
_n("%s year ago","%s years ago",Math.floor(r),"jetpack-protect"),Math.floor(r)):(r=c/2592e3,r>1?(0,a.sprintf)(
// translators: placeholder is a number amount of months i.e. "5 months ago".
_n("%s month ago","%s months ago",Math.floor(r),"jetpack-protect"),Math.floor(r)):(r=c/86400,r>1?(0,a.sprintf)(
// translators: placeholder is a number amount of days i.e. "5 days ago".
_n("%s day ago","%s days ago",Math.floor(r),"jetpack-protect"),Math.floor(r)):(r=c/3600,r>1?(0,a.sprintf)(
// translators: placeholder is a number amount of hours i.e. "5 hours ago".
_n("%s hour ago","%s hours ago",Math.floor(r),"jetpack-protect"),Math.floor(r)):(r=c/60,r>1?(0,a.sprintf)(
// translators: placeholder is a number amount of minutes i.e. "5 minutes ago".
_n("%s minute ago","%s minutes ago",Math.floor(r),"jetpack-protect"),Math.floor(r)):__("a few seconds ago","jetpack-protect")))))})(Date.parse(e)):null),[e]);return React.createElement("div",{className:l.Z.empty},React.createElement(s,null),React.createElement(c.H3,{weight:"bold",mt:8},__("Don't worry about a thing","jetpack-protect")),React.createElement(c.ZP,null,(0,r.createInterpolateElement)((0,a.sprintf)(
// translators: placeholder is the amount of time since the last scan, i.e. "5 minutes ago".
__("The last Protect scan ran <strong>%s</strong> and everything looked great.","jetpack-protect"),t),{strong:React.createElement("strong",null)})))}},2831:function(e,t,n){"use strict";var c=n(526),r=n(5106),a=n(857),i=n(8258),o=n(5736),l=n(9196),s=n.n(l),u=n(6477),m=n(7267),d=n(3584),p=n(9709);const __=o.__,h=e=>{let{description:t,filename:n,fixedIn:h,icon:g,id:f,name:v,source:E,table:y,title:b,type:k,version:Z}=e;const{adminUrl:C}=window.jetpackProtectInitialState||{},{run:w}=(0,i.Z)({productSlug:m.QJ,redirectUrl:C}),{recordEventHandler:_}=(0,u.Z)(),N=_("jetpack_protect_threat_list_get_scan_link_click",w),R=E?s().createElement(c.Z,{variant:"link",isExternalLink:!0,weight:"regular",href:E},__("See more technical details of this threat","jetpack-protect")):null,S=(0,l.useCallback)((()=>v&&Z?`${v} (${Z})`:n?n.split("/").pop():y||void 0),[n,v,y,Z]);return s().createElement(d.U,{id:f,label:S(),title:b,icon:g,onOpen:(0,l.useCallback)((()=>{["core","plugin","theme"].includes(k)&&_(`jetpack_protect_${k}_threat_open`)}),[_,k])},t&&s().createElement("div",{className:p.Z["threat-section"]},s().createElement(r.ZP,{variant:"title-small",mb:2},__("What is the problem?","jetpack-protect")),s().createElement(r.ZP,{mb:2},t),R),h&&s().createElement("div",{className:p.Z["threat-section"]},s().createElement(r.ZP,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),s().createElement(r.ZP,{mb:2},/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */
(0,o.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),v,h)),s().createElement(a.Z,{description:__("Looking for advanced scan results and one-click fixes?","jetpack-protect"),cta:__("Upgrade Jetpack Protect now","jetpack-protect"),onClick:N,className:p.Z["threat-item-cta"]})),!t&&s().createElement("div",{className:p.Z["threat-section"]},R))};t.Z=e=>{let{list:t}=e;return s().createElement(d.Z,null,t.map((e=>{let{description:t,fixedIn:n,icon:c,id:r,name:a,source:i,table:o,title:l,type:u,version:m}=e;return s().createElement(h,{description:t,fixedIn:n,icon:c,id:r,key:r,name:a,source:i,table:o,title:l,type:u,version:m})})))}},5207:function(e,t,n){"use strict";var c=n(3363),r=n(3846),a=n(5106),i=n(526),o=n(9818),l=n(5736),s=n(9196),u=n.n(s),m=n(5773),d=n(4633),p=n(5658),h=n(2831),g=n(4289),f=n(1400),v=n(9709),E=n(7930);const __=l.__;t.Z=()=>{const{hasRequiredPlan:e}=(0,m.Z)(),{item:t,list:n,selected:y,setSelected:b}=(0,E.Z)(),k=n.filter((e=>e.fixable)),{setModal:Z}=(0,o.useDispatch)(d.t),{scan:C}=(0,o.useDispatch)(d.t),w=(0,o.useSelect)((e=>e(d.t).getScanIsEnqueuing())),_=(0,s.useCallback)((()=>{switch(y){case"all":return(0,l.sprintf)(/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */
__("All %s threats","jetpack-protect"),n.length);case"files":return(0,l.sprintf)(/* translators: placeholder is the amount of file threats found on the site. */
__("%1$s file %2$s","jetpack-protect"),n.length,1===n.length?"threat":"threats");case"database":return(0,l.sprintf)(/* translators: placeholder is the amount of database threats found on the site. */
__("%1$s database %2$s","jetpack-protect"),n.length,1===n.length?"threat":"threats");default:return(0,l.sprintf)(/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */
__("%1$s %2$s in your %3$s %4$s","jetpack-protect"),n.length,1===n.length?"threat":"threats",null==t?void 0:t.name,null==t?void 0:t.version)}}),[y,n,t]);return u().createElement(c.Z,{fluid:!0,horizontalSpacing:0,horizontalGap:3},u().createElement(r.Z,{lg:4},u().createElement(g.Z,{selected:y,onSelect:b})),u().createElement(r.Z,{lg:8},(null==n?void 0:n.length)>0?u().createElement(u().Fragment,null,u().createElement("div",{className:v.Z["list-header"]},u().createElement(a.Dx,{className:v.Z["list-title"]},_()),e&&u().createElement(u().Fragment,null,k.length>0&&u().createElement(i.Z,{variant:"primary",className:v.Z["list-header-button"],onClick:(N=k,e=>{e.preventDefault(),Z({type:"FIX_ALL_THREATS",props:{threatList:N}})})},/* translators: Translates to Auto fix all. $s: Number of fixable threats. */
(0,l.sprintf)(__("Auto fix all (%s)","jetpack-protect"),k.length)),u().createElement(i.Z,{variant:"secondary",className:v.Z["list-header-button"],isLoading:w,onClick:e=>{e.preventDefault(),C()}},__("Scan now","jetpack-protect")))),e?u().createElement(f.Z,{list:n}):u().createElement(h.Z,{list:n})):u().createElement(p.Z,null)));var N}},4289:function(e,t,n){"use strict";var c=n(2054),r=n(5736),a=n(797),i=n(2817),o=n(7663),l=n(8960),s=n(4160),u=n(6376),m=n(9196),d=n(6477),p=n(5773),h=n(5338);const __=r.__;t.Z=e=>{let{selected:t,onSelect:n}=e;const{plugins:r,themes:g,numThreats:f,numCoreThreats:v,numFilesThreats:E,numDatabaseThreats:y,hasRequiredPlan:b}=(0,p.Z)(),{recordEvent:k}=(0,d.Z)(),[Z]=(0,c.Z)("lg","<"),C=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_all_click")}),[k]),w=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_core_click")}),[k]),_=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_plugin_click")}),[k]),N=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_theme_click")}),[k]),R=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_file_click")}),[k]),S=(0,m.useCallback)((()=>{k("jetpack_protect_navigation_database_click")}),[k]);return React.createElement(h.ZP,{selected:t,onSelect:n,mode:Z?"dropdown":"list"},React.createElement(h.Dx,{initial:!0,id:"all",label:__("All threats","jetpack-protect"),icon:a.Z,badge:f,disabled:f<=0,onClick:C,checked:!0}),React.createElement(h.Dx,{id:"wordpress",label:__("WordPress","jetpack-protect"),icon:i.Z,badge:v,disabled:v<=0,onClick:w,checked:!0}),React.createElement(h.KB,{label:__("Plugins","jetpack-protect"),icon:o.Z},r.map((e=>{let{name:t,threats:n,checked:c}=e;return React.createElement(h.Dx,{key:t,id:t,label:t,checked:c,badge:null==n?void 0:n.length,disabled:(null==n?void 0:n.length)<=0,onClick:_})}))),React.createElement(h.KB,{label:__("Themes","jetpack-protect"),icon:l.Z},g.map((e=>{let{name:t,threats:n,checked:c}=e;return React.createElement(h.Dx,{key:t,id:t,label:t,checked:c,badge:null==n?void 0:n.length,disabled:(null==n?void 0:n.length)<=0,onClick:N})}))),b&&React.createElement(React.Fragment,null,React.createElement(h.Dx,{id:"files",label:__("Files","jetpack-protect"),icon:s.Z,badge:E,disabled:E<=0,onClick:R,checked:!0}),React.createElement(h.Dx,{id:"database",label:__("Database","jetpack-protect"),icon:u.Z,badge:y,disabled:y<=0,onClick:S,checked:!0})))}},1400:function(e,t,n){"use strict";var c=n(526),r=n(5106),a=n(2054),i=n(9818),o=n(9307),l=n(5736),s=n(9196),u=n.n(s),m=n(6477),d=n(4633),p=n(7127),h=n(4257),g=n(289),f=n(9709);const __=l.__,v=e=>{let{context:t,description:n,diff:a,filename:o,fixedIn:v,icon:E,fixable:y,id:b,label:k,name:Z,source:C,title:w,type:_,severity:N}=e;const{setModal:R}=(0,i.useDispatch)(d.t),{recordEvent:S}=(0,m.Z)(),j=C?u().createElement(c.Z,{variant:"link",isExternalLink:!0,weight:"regular",href:C},__("See more technical details of this threat","jetpack-protect")):null;return u().createElement(g.c,{id:b,label:k,title:w,icon:E,fixable:y,severity:N,onOpen:(0,s.useCallback)((()=>{["core","plugin","theme"].includes(_)&&S(`jetpack_protect_${_}_threat_open`)}),[S,_])},n&&u().createElement("div",{className:f.Z["threat-section"]},u().createElement(r.ZP,{variant:"title-small",mb:2},__("What is the problem?","jetpack-protect")),u().createElement(r.ZP,{mb:2},n),j),(o||t||a)&&u().createElement(r.ZP,{variant:"title-small",mb:2},__("The technical details","jetpack-protect")),o&&u().createElement(u().Fragment,null,u().createElement(r.ZP,{mb:2},/* translators: filename follows in separate line; e.g. "PHP.Injection.5 in: `post.php`" */
__("Threat found in file:","jetpack-protect"),u().createElement("pre",{className:f.Z["threat-filename"]},o))),t&&u().createElement(h.Z,{context:t}),a&&u().createElement(p.C,{diff:a}),v&&u().createElement("div",{className:f.Z["threat-section"]},u().createElement(r.ZP,{variant:"title-small",mb:2},__("How to fix it?","jetpack-protect")),u().createElement(r.ZP,{mb:2},/* translators: Translates to Update to. %1$s: Name. %2$s: Fixed version */
(0,l.sprintf)(__("Update to %1$s %2$s","jetpack-protect"),Z,v))),!n&&u().createElement("div",{className:f.Z["threat-section"]},j),u().createElement("div",{className:f.Z["threat-footer"]},u().createElement(c.Z,{isDestructive:!0,variant:"secondary",onClick:e=>{e.preventDefault(),R({type:"IGNORE_THREAT",props:{id:b,label:k,title:w,icon:E,severity:N}})}},__("Ignore threat","jetpack-protect")),y&&u().createElement(c.Z,{onClick:e=>{e.preventDefault(),R({type:"FIX_THREAT",props:{id:b,label:k,title:w,icon:E,severity:N,fixable:y}})}},__("Fix threat","jetpack-protect"))))};t.Z=e=>{let{list:t}=e;const{scan:n}=(0,i.useDispatch)(d.t),l=(0,o.createInterpolateElement)(__("If you have manually fixed any of the threats listed above, <manualScanLink>you can run a manual scan now</manualScanLink> or wait for Jetpack to scan your site later today.","jetpack-protect"),{manualScanLink:u().createElement(c.Z,{variant:"link",onClick:e=>{e.preventDefault(),n()}})}),[s]=(0,a.Z)(["sm","lg"],[null,"<"]),m=e=>e.name&&e.version?`${e.name} (${e.version})`:e.filename?e.filename.split("/").pop():e.table?e.table:void 0;return t=t.map((e=>({label:m(e),...e}))),u().createElement(u().Fragment,null,!s&&u().createElement("div",{className:f.Z["accordion-heading"]},u().createElement("span",null,__("Details","jetpack-protect")),u().createElement("span",null,__("Severity","jetpack-protect")),u().createElement("span",null,__("Auto-fix","jetpack-protect")),u().createElement("span",null)),u().createElement(g.Z,null,t.map((e=>{let{context:t,description:n,diff:c,filename:r,fixedIn:a,icon:i,fixable:o,id:l,label:s,name:m,severity:d,source:p,table:h,title:g,type:f,version:E}=e;return u().createElement(v,{context:t,description:n,diff:c,filename:r,fixedIn:a,icon:i,fixable:o,id:l,key:l,label:s,name:m,severity:d,source:p,table:h,title:g,type:f,version:E})}))),u().createElement(r.ZP,{className:f.Z["manual-scan"],variant:"body-small"},l))}},7930:function(e,t,n){"use strict";var c=n(2817),r=n(7663),a=n(8960),i=n(4160),o=n(6376),l=n(9196),s=n(5773);const u=(e,t)=>{var n;return Array.isArray(e)?e.map((e=>u(e,t))).flat():null==e||null===(n=e.threats)||void 0===n?void 0:n.map((n=>({...n,...e,icon:t})))},m=e=>{let{core:t,plugins:n,themes:l,files:s,database:m}=e;return[...u(t,c.Z),...u(n,r.Z),...u(l,a.Z),...u(s,i.Z),...u(m,o.Z)]};t.Z=()=>{const{plugins:e,themes:t,core:n,files:d,database:p}=(0,s.Z)();let h=m({core:n,plugins:e,themes:t,files:d,database:p}),g={};const[f,v]=(0,l.useState)(h.length?"all":null);switch(f){case"all":h=m({core:n,plugins:e,themes:t,files:d,database:p});break;case"wordpress":h=u(n,c.Z),g=n;break;case"files":h=u(d,i.Z),g=d;break;case"database":h=u(p,o.Z),g=p}const E=e.find((e=>(null==e?void 0:e.name)===f));E&&(h=u(E,r.Z),g=E);const y=t.find((e=>(null==e?void 0:e.name)===f));return y&&(h=u(y,a.Z),g=y),{item:g,list:h,selected:f,setSelected:v}}},2854:function(e,t,n){"use strict";var c=n(1294),r=n(8227);t.Z=e=>{let{children:t}=e;const{isUserConnected:n,hasConnectedOwner:a}=(0,c.Z)();return n&&a?t:React.createElement(r.Z,null)}},8227:function(e,t,n){"use strict";var c=n(5106),r=n(526),a=n(1294),i=n(9818),o=n(5736),l=n(4633),s=n(291),u=n(541);const __=o.__;t.Z=()=>{const{setModal:e}=(0,i.useDispatch)(l.t),{userIsConnecting:t,handleConnectUser:n}=(0,a.Z)({redirectUri:"admin.php?page=jetpack-protect"});return React.createElement(React.Fragment,null,React.createElement(c.ZP,{variant:"title-medium",mb:2},__("User connection needed","jetpack-protect")),React.createElement(s.Z,{type:"info",message:__("Before Jetpack Protect can ignore and auto-fix threats on your site, a user connection is needed.","jetpack-protect")}),React.createElement(c.ZP,{mb:3},__("A user connection provides Jetpack Protect the access necessary to perform these tasks.","jetpack-protect")),React.createElement(c.ZP,{mb:3},__("Once youve secured a user connection, all Jetpack Protect features will be available for use.","jetpack-protect")),React.createElement("div",{className:u.Z.footer},React.createElement(r.Z,{variant:"secondary",onClick:t=>{t.preventDefault(),e({type:null})}},__("Not now","jetpack-
// translators: placeholder is the number amount of fixed threats.
__("%s threats were fixed successfully","jetpack-protect"),e.length)}))})).catch((()=>{n(D({type:"error",message:__("Not all threats could be fixed. Please contact our support.","jetpack-protect")}))})).finally((()=>{n(V([]))}))},D=e=>({type:C,payload:e}),F=e=>({type:_,hasRequiredPlan:e}),H={checkCredentials:()=>async e=>{let{dispatch:t}=e;return await new Promise(((e,n)=>(t(x(!0)),r()({path:"jetpack-protect/v1/check-credentials",method:"POST"}).then((n=>{t(M(n)),e(n)})).catch((e=>{n(e)})).finally((()=>{t(x(!1))})))))},setCredentials:M,setCredentialsIsFetching:x,setStatus:N,startScanOptimistically:R,refreshStatus:j,setStatusIsFetching:I,setScanIsEnqueuing:z,setInstalledPlugins:e=>({type:g,plugins:e}),setInstalledThemes:e=>({type:f,themes:e}),setwpVersion:e=>({type:v,version:e}),setJetpackScan:e=>({type:E,scan:e}),setProductData:e=>({type:y,productData:e}),ignoreThreat:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return async n=>{let{dispatch:c}=n;return c(L(e,!0)),await new Promise((()=>r()({path:`jetpack-protect/v1/ignore-threat?threat_id=${e}`,method:"POST"}).then((()=>c(j()))).then((()=>c(D({type:"success",message:__("Threat ignored","jetpack-protect")})))).catch((()=>c(D({type:"error",message:__("An error ocurred ignoring the threat.","jetpack-protect")})))).finally((()=>{c(L(e,!1)),t()}))))}},setModal:e=>({type:Z,payload:e}),setNotice:D,clearNotice:()=>({type:w}),fixThreats:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return async n=>{let{dispatch:c}=n;return e.forEach((e=>{c(L(e,!0))})),await new Promise((()=>r()({path:`jetpack-protect/v1/fix-threats?threat_ids=${e}`,method:"POST",data:{threatIds:e}}).then((()=>c(D({type:"success",message:__("We're hard at work fixing this threat in the background. Please check back shortly.","jetpack-protect")})))).then((()=>{setTimeout((()=>c(A(e))),1e3)})).catch((()=>c(D({type:"error",message:__("Error fixing threats. Please contact support.","jetpack-protect")})))).finally((()=>{e.forEach((e=>{c(L(e,!1))})),t()}))))}},scan:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};return async t=>{let{dispatch:n}=t;return n(z(!0)),await new Promise((()=>r()({path:"jetpack-protect/v1/scan",method:"POST"}).then((()=>{n(R()),setTimeout((()=>n(j(!0))),5e3)})).catch((()=>n(D({type:"error",message:__("An error ocurred enqueuing the scan","jetpack-protect")})))).finally((()=>{n(z(!1)),e()}))))}},setThreatsAreFixing:V,refreshPlan:()=>e=>{let{dispatch:t}=e;r()({path:"jetpack-protect/v1/check-plan",method:"GET"}).then((e=>t(F(e))))},setHasRequiredPlan:F,setScanIsUnavailable:T}},3638:function(e,t,n){"use strict";var c=n(9818),r=n(5230);const a=(0,c.combineReducers)({credentials:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===r.jA?t.credentials:e},credentialsIsFetching:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===r._N?t.isFetching:e},status:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case r.d0:return t.status;case r.Y2:return{...e,status:"optimistically_scanning"}}return e},statusIsFetching:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===r.Gk?t.status:e},scanIsUnavailable:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===r.eG?t.status:e},scanIsEnqueuing:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return t.type===r.hI?t.isEnqueuing:e},installedPlugins:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return t.type===r.RR?t.plugins:e},installedThemes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]