(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[5675],{98404:(e,t,r)=>{"use strict";r.r(t);var n=r(6293),s=r(95122),i=r(3571),a=r(64893),o=r(87514),c=r.n(o),l=r(48015),p=r(33590),u=r(8476),d=r(31600);function h({label:e,detectIp:t}){return(0,n.createElement)("div",{className:"itsec-global-detected-ip"},(0,n.createElement)(a.Button,{variant:"secondary",onClick:t},(0,s.__)("Check IP","better-wp-security")),(0,n.createElement)("span",null,e))}function g({value:e,onChange:t,ip:r}){return(0,n.createElement)(a.Button,{variant:"secondary",onClick:()=>{t([...e,r])},disabled:!r,className:"itsec-global-add-authorized-ip"},(0,s.__)("Authorize my IP address","better-wp-security"))}function w(){const{label:e,detectIp:t,ip:r}=function(){const{proxy:e,proxyHeader:t,schema:r}=(0,l.useSelect)((e=>({proxy:e(d.MODULES_STORE_NAME).getEditedSetting("global","proxy"),proxyHeader:e(d.MODULES_STORE_NAME).getEditedSetting("global","proxy_header"),schema:e(d.MODULES_STORE_NAME).getSettingSchema("global","proxy")}))),i=(0,n.useCallback)((()=>{const n={proxy:r.enum.includes(e)?e:r.default};return"manual"===n.proxy&&(n.args={header:t}),c()({method:"POST",path:"ithemes-security/rpc/global/detect-ip",data:n})}),[e,t,r]),{execute:a,status:o,value:p,error:h}=(0,u.r5)(i,!!e&&!!r);let g;switch(o){case"idle":break;case"pending":g=(0,s.__)("Detecting IP","better-wp-security");break;case"success":g=(0,s.sprintf)((0,s.__)("Detected IP: %s","better-wp-security"),p.ip);break;case"error":g=(0,s.sprintf)((0,s.__)("Error detecting IP: %s","better-wp-security"),h.message||(0,s.__)("Unknown error."))}return{label:g,detectIp:a,ip:p?.ip}}();return(0,n.createElement)(React.Fragment,null,(0,n.createElement)(p.bB,{name:"itsec_global_lockout_white_list"},(({formData:e,onChange:t})=>(0,n.createElement)(g,{value:e,onChange:t,ip:r}))),(0,n.createElement)(p.bB,{name:"itsec_global_proxy"},(()=>(0,n.createElement)(h,{label:e,detectIp:t}))))}r.p=window.itsecWebpackPublicPath,(0,s.setLocaleData)({"":{}},"ithemes-security-pro"),(0,i.registerPlugin)("itsec-global-settings",{render:()=>(0,n.createElement)(w,null)})},31600:e=>{e.exports=function(){return this.itsec.packages.data}()},82839:e=>{e.exports=function(){return this.wp.a11y}()},87514:e=>{e.exports=function(){return this.wp.apiFetch}()},64893:e=>{e.exports=function(){return this.wp.components}()},9576:e=>{e.exports=function(){return this.wp.compose}()},48015:e=>{e.exports=function(){return this.wp.data}()},82521:e=>{e.exports=function(){return this.wp.date}()},6293:e=>{e.exports=function(){return this.wp.element}()},95122:e=>{e.exports=function(){return this.wp.i18n}()},81834:e=>{e.exports=function(){return this.wp.isShallowEqual}()},81019:e=>{e.exports=function(){return this.wp.keycodes}()},3571:e=>{e.exports=function(){return this.wp.plugins}()},14776:e=>{e.exports=function(){return this.wp.primitives}()},73470:e=>{e.exports=function(){return this.wp.url}()},99196:e=>{"use strict";e.exports=window.React},91850:e=>{"use strict";e.exports=window.ReactDOM},92819:e=>{"use strict";e.exports=window.lodash},76292:e=>{"use strict";e.exports=window.moment}},e=>{e.O(0,[7271,1930,5307,9443,135,976,6179,2018],(()=>(98404,e(e.s=98404))));var t=e.O();((window.itsec=window.itsec||{}).global=window.itsec.global||{}).settings=t}]);