HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/linde/wp-content/plugins/better-wp-security/dist/pages/firewall.js
/*! For license information please see firewall.js.LICENSE.txt */
(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[2832,2932],{1694:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(51609),a=n(55933);const l=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"}))},3075:e=>{e.exports=function(){return this.wp.i18n}()},8601:e=>{e.exports=function(){return this.wp.element}()},17232:e=>{e.exports=function(){return this.wp.domReady}()},26425:e=>{e.exports=function(){return this.itsec.pages.settings}()},29672:e=>{e.exports=function(){return this.wp.notices}()},30040:e=>{e.exports=function(){return this.itsec.core["active-lockouts"]}()},31987:e=>{e.exports=function(){return this.wp.data}()},38125:e=>{e.exports=function(){return this.wp.plugins}()},39959:e=>{e.exports=function(){return this.wp.components}()},46627:e=>{e.exports=function(){return this.itsec.packages.data}()},47406:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(51609),a=n(55933);const l=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"}))},51609:e=>{"use strict";e.exports=window.React},55933:e=>{e.exports=function(){return this.wp.primitives}()},56897:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(51609),a=n(55933);const l=(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(a.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"}))},62932:(e,t,n)=>{"use strict";n.d(t,{Z$:()=>O,Q7:()=>y,AR:()=>E,cM:()=>S,n7:()=>k,pC:()=>L,qD:()=>F,tO:()=>B,TE:()=>R,Cc:()=>D,Ng:()=>N,ZB:()=>A,d7:()=>w,KK:()=>b,Wy:()=>M,dD:()=>I,_t:()=>C,z6:()=>x,_D:()=>T,Mr:()=>P,aZ:()=>v});var r=n(66087),a=n(63282),l=n.n(a),i=n(8601),s=n(77172),o=n(3075),c=n(64467);function u(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function m(e,t,n){return e.set(p(e,t),n),n}function d(e,t){return e.get(p(e,t))}function p(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var g=new WeakMap,h=new WeakMap;class E{constructor(e=void 0,t=void 0,n=void 0){u(this,g,{}),u(this,h,{}),(0,c.A)(this,"add",((e,t,n)=>(d(g,this)[e]||(d(g,this)[e]=[]),d(g,this)[e].push(t),n&&(d(h,this)[e]||(d(h,this)[e]=[]),d(h,this)[e].push(n)),this))),(0,c.A)(this,"hasErrors",(()=>this.getErrorCodes().length>0)),(0,c.A)(this,"getErrorCodes",(()=>Object.keys(d(g,this)))),(0,c.A)(this,"getErrorCode",(()=>this.getErrorCodes()[0])),(0,c.A)(this,"getErrorMessages",((e=void 0)=>{if(e)return d(g,this)[e];const t=[];for(const e in d(g,this))d(g,this).hasOwnProperty(e)&&t.concat(d(g,this)[e]);return t})),(0,c.A)(this,"getErrorMessage",((e=void 0)=>(e=e||this.getErrorCode(),this.getErrorMessages(e)[0]))),(0,c.A)(this,"getErrorData",((e=void 0)=>(e=e||this.getErrorCode(),d(h,this)[e]))),(0,c.A)(this,"getAllErrorMessages",(()=>{const e=[];for(const t in d(g,this))d(g,this).hasOwnProperty(t)&&e.push(...d(g,this)[t]);return e})),e&&(t&&(d(g,this)[e]=[t]),n&&(d(h,this)[e]=n))}static fromPHPObject(e){const t=new E;return m(g,t,e.errors),m(h,t,e.error_data),t}static fromApiError(e){const t=new E;if(d(g,t)[e.code]=[e.message],d(h,t)[e.code]=[e.data],e.additional_errors)for(const n of e.additional_errors)d(g,t)[n.code]=[n.message],n.data&&(d(h,t)||m(h,t,[]),d(h,t)[n.code].push(n.data));return t}}class f extends Error{constructor(e,...t){super(e.message||(0,o.__)("An unknown error occurred.","better-wp-security"),...t),Error.captureStackTrace&&Error.captureStackTrace(this,f),this.__response=e;for(const t in e)e.hasOwnProperty(t)&&Object.defineProperty(this,t,{value:e[t],configurable:!0,enumerable:!0,writable:!0})}toString(){return this.__response.toString()}getResponse(){return this.__response}}class y{constructor(e,t,n,r=[],a=[],l=[]){(0,c.A)(this,"type",void 0),(0,c.A)(this,"error",void 0),(0,c.A)(this,"data",void 0),(0,c.A)(this,"success",void 0),(0,c.A)(this,"info",void 0),(0,c.A)(this,"warning",void 0),this.type=e,this.error=t,this.data=n,this.success=r,this.info=a,this.warning=l,Object.seal(this)}isSuccess(){return this.type===y.SUCCESS}static async fromResponse(e){const t=t=>{const n=e.headers?.get(`X-Messages-${t}`);return n?JSON.parse(n):[]},n=204!==e.status&&e.json?await e.json():null,r=k(n),a=r.hasErrors()?y.ERROR:y.SUCCESS,l=t("Success"),i=t("Info"),s=t("Warning");return new y(a,r,n,l,i,s)}}Object.defineProperty(y,"SUCCESS",{value:"success",writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(y,"ERROR",{value:"error",writable:!1,enumerable:!1,configurable:!1});const _=(0,i.createContext)({getUrl(e,t){e="settings"===e?"itsec":"itsec-"+e;const n=(0,s.removeQueryArgs)(document.location.href,...Object.keys((0,s.getQueryArgs)(document.location.href)));return(0,s.addQueryArgs)(n,t?{page:e,path:t}:{page:e})}});function v(e,t){const{getUrl:n}=(0,i.useContext)(_);return n(e,t)}function x(e){if(e<=999)return e.toString();if(e<=9999){const t=(e/1e3).toFixed(1);return"0"===t.charAt(t.length-1)?t.replace(".0","k"):`${t}k`}if(e<=99999)return e.toString().substring(0,2)+"k";if(e<=999999)return e.toString().substring(0,3)+"k";if(e<=9999999){const t=(e/1e6).toFixed(1);return"0"===t.charAt(t.length-1)?t.replace(".0","m"):`${t}m`}if(e<=99999999)return e.toString().substring(0,2)+"m";if(e<=999999999)return e.toString().substring(0,3)+"m";if(e<=9999999999){const t=(e/1e9).toFixed(1);return"0"===t.charAt(t.length-1)?t.replace(".0","b"):`${t}b`}return e}function b(e){if(!(0,r.isPlainObject)(e))return!1;const t=Object.keys(e);return 2===t.length&&t.includes("errors")&&t.includes("error_data")}function w(e){if(!(0,r.isPlainObject)(e))return!1;const t=Object.keys(e);return(3===t.length||4===t.length)&&!(4===t.length&&!t.includes("additional_errors"))&&t.includes("code")&&t.includes("message")&&t.includes("data")}function k(e){return e instanceof E?e:b(e)?E.fromPHPObject(e):w(e)?E.fromApiError(e):new E}function L(e){const t={};for(const[n,r]of e)t[n]=r;return t}function S(e,t){const n=[[],[]];for(const r of e)n[t(r)?0:1].push(r);return n}function I(e){if(e instanceof Error)throw e;throw new f(e)}const O="https://secure.gravatar.com/avatar/d7a973c7dab26985da5f961be7b74480?s=96&d=mm&f=y&r=g";function A(e,t,n=!0){return(0,r.get)(e,["_links","self",0,"targetHints",t],n?void 0:[])}function N(e){return R(e,"self")}function C(e){const t=e.indexOf("/ithemes-security/");if(-1!==t)return e.substring(t)}function R(e,t){return(0,r.get)(e,["_links",t,0,"href"])}function D(e,t){if(e&&e.links)for(const n of e.links)if(n.rel===t)return n}function M(e,t){if("object"!==e.type)return e;let n;for(const a in t)t.hasOwnProperty(a)&&"hidden"===t[a]["ui:widget"]&&(n||(n=(0,r.cloneDeep)(e)),delete n.properties[a]);return n||e}function P(e){let t=[];if(!e)return t;const n=e instanceof E?e:k((0,r.pick)(e,["code","message","data"]));return"rest_invalid_param"===n.getErrorCode()&&(t=Object.values(n.getErrorData().params)),[...n.getAllErrorMessages(),...t]}function T(e){const t=new Date;if(e>t)return(0,o.__)("Online Recently","better-wp-security");const n=Math.floor((t-e)/1e3);let r=n/31536e3;return r>1?(0,o.sprintf)((0,o.__)("%s years","better-wp-security"),Math.floor(r)):(r=n/2592e3,r>1?(0,o.sprintf)((0,o.__)("%s months","better-wp-security"),Math.floor(r)):(r=n/86400,r>1?(0,o.sprintf)((0,o.__)("%s days","better-wp-security"),Math.floor(r)):(r=n/3600,r>1?(0,o.sprintf)((0,o.__)("%s hours","better-wp-security"),Math.floor(r)):(r=n/60,r>1?(0,o.sprintf)((0,o.__)("%s minutes","better-wp-security"),Math.floor(r)):(0,o.sprintf)((0,o.__)("%s seconds","better-wp-security"),Math.floor(r))))))}function F(){return F.instance||(F.instance=new(l())({strict:!1}),F.instance.addFormat("html",{type:"string",validate:()=>!0}),F.instance.addFormat("relative-file-path",{type:"string",validate:e=>!e.includes("../")}),F.instance.addFormat("file-path",{type:"string",validate:e=>!!e.startsWith("/")&&!e.includes("../")}),F.instance.addFormat("directory",{type:"string",validate:e=>!!e.startsWith("/")&&!e.includes("../")})),F.instance}function B(e){if(!e)return"";const t=e.toUpperCase().split("").map((e=>127397+e.charCodeAt()));return String.fromCodePoint(...t)}},63718:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AsideHeaderFill:()=>b,BeforeCreateFirewallRuleFill:()=>v,FirewallBannerFill:()=>k});var r=n(51609),a=n(8601),l=n(17232),i=n.n(l),s=n(3075),o=n(81923),c=n(56347),u=n(7e3),m=n(79487),d=n(39959),p=n(38125),g=n(88356),h=n(48620),E=(n(68440),n(31987)),f=n(46627);function y(){const{firewallRulesActive:e}=(0,E.useSelect)((e=>({firewallRulesActive:e(f.modulesStore).isActive("firewall")})),[]);return(0,r.createElement)(h.pe,null,(0,r.createElement)(h.G9,{to:"/logs",title:(0,s.__)("Logs","better-wp-security")}),e&&(0,r.createElement)(h.G9,{to:"/rules",title:(0,s.__)("Rules","better-wp-security")}),(0,r.createElement)(h.G9,{to:"/ip-management",title:(0,s.__)("IP Management","better-wp-security")}),(0,r.createElement)(h.G9,{to:"/configure",title:(0,s.__)("Configure","better-wp-security")}),(0,r.createElement)(h.G9,{to:"/automated",title:(0,s.__)("Automated","better-wp-security")}))}const{Slot:_,Fill:v}=(0,d.createSlotFill)("BeforeCreateFirewallRule"),{Slot:x,Fill:b}=(0,d.createSlotFill)("AsideHeader"),{Slot:w,Fill:k}=(0,d.createSlotFill)("FirewallBanner"),L=(0,o.A)("header",{target:"e1ao50kc1"})({name:"1eoy87d",styles:"display:flex;justify-content:space-between"}),S=(0,o.A)("div",{target:"e1ao50kc0"})({name:"damvy5",styles:"display:flex;gap:1rem"});function I(){return(0,r.createElement)(React.Fragment,null,(0,r.createElement)(w,null),(0,r.createElement)(L,null,(0,r.createElement)(S,null,(0,r.createElement)(g.DZ,{level:1,weight:g.uL.NORMAL,text:(0,s.__)("Firewall")}),(0,r.createElement)(h.i$,null),(0,r.createElement)(h.Fe,null)),(0,r.createElement)(x,null)))}const O=(0,o.A)("div",{target:"e1yvga8v0"})({name:"vgwucc",styles:"display:flex;align-self:center;flex-direction:column;gap:1.25rem;width:100%;max-width:1680px;padding:1.25rem 1.25rem 4rem 1.5rem"});function A({children:e}){return(0,r.createElement)(O,null,(0,r.createElement)(I,null),(0,r.createElement)(y,null),e)}var N=n(66087),C=n(89897),R=n(88053);const D=(0,n(32196).AH)({name:"1dlyed8",styles:"flex-basis:50%"}),M=(0,o.A)(g.$n,{target:"ekwhszr0"})({name:"o4byn8",styles:"margin-top:23px"}),P={inclusive:!0};function T({value:e,onChange:t,className:n}){var a,l;const i=(0,C.useInstanceId)(T,"solid-rule-form"),{config:o={rules:[P]}}=e;return(0,r.createElement)(d.Flex,{direction:"column",gap:4,align:"stretch",expanded:!1,className:n},(0,r.createElement)(d.__experimentalInputControl,{value:null!==(a=e.name)&&void 0!==a?a:"",onChange:n=>t({...e,name:n}),label:(0,s.__)("Rule Name","better-wp-security"),required:!0,__next36pxDefaultSize:!0}),(0,r.createElement)(g.DZ,{level:3,text:(0,s.__)("If incoming requests match…","better-wp-security"),weight:g.uL.HEAVY}),(0,r.createElement)(d.Flex,{direction:"column",gap:3,align:"stretch",expanded:!1},o.rules.map(((n,a)=>{return(0,r.createElement)(F,{key:a,idx:a,value:n,onAndRule:(l=a,()=>{t({...e,config:{...o,rules:o.rules.toSpliced(l+1,0,P)}})}),onChange:n=>t({...e,config:{...o,rules:o.rules.map(((e,t)=>t===a?n:e))}}),onDelete:1===o.rules.length?null:()=>t({...e,config:{...o,rules:o.rules.toSpliced(a,1)}})});var l}))),(0,r.createElement)(g.DZ,{level:3,text:(0,s.__)("Then take action…","better-wp-security"),weight:g.uL.HEAVY}),(0,r.createElement)(d.Flex,{direction:"column",gap:3,align:"stretch",expanded:!1},(0,r.createElement)(d.BaseControl,{id:i+"__action",label:(0,s.__)("Action","better-wp-security"),__nextHasNoMarginBottom:!0},(0,r.createElement)(h.l6,{inputId:i+"__action",options:H,value:H.find((e=>e.value===o.type)),onChange:n=>t({...e,config:{...o,type:n.value,type_params:""}})})),"REDIRECT"===o.type&&(0,r.createElement)(d.__experimentalInputControl,{value:null!==(l=o.type_params)&&void 0!==l?l:"",onChange:n=>t({...e,config:{...o,type_params:n}}),type:"url",label:(0,s.__)("Redirect Location","better-wp-security"),__next36pxDefaultSize:!0})))}function F({idx:e,value:t,onChange:n,onDelete:a,onAndRule:l}){const i=(0,C.useViewportMatch)("large"),o=(0,C.useInstanceId)(F,"solid-rule-form-rule"),c=t.parameter&&$.find((e=>U(t.parameter,e))),u=j.filter((e=>!0===c?.operators||c?.operators.includes(e.value))),m=t.match?.type&&u.find((e=>e.value===t.match?.type));return(0,r.createElement)("fieldset",null,(0,r.createElement)(d.VisuallyHidden,{as:"legend"},(0,s.sprintf)((0,s.__)("Rule %d","better-wp-security"),e+1)),(0,r.createElement)(d.Flex,{gap:1,align:i?"start":"stretch",direction:i?"row":"column",expanded:i},(0,r.createElement)(d.FlexBlock,null,(0,r.createElement)(d.Flex,{align:"start",gap:1},(0,r.createElement)(d.FlexBlock,{className:D},(0,r.createElement)(B,{id:o,field:c,value:t,onChange:n})),c?.allowSubFields&&(0,r.createElement)(d.FlexItem,{className:D},(0,r.createElement)(z,{field:c,value:t,onChange:n})))),(0,r.createElement)(d.FlexBlock,null,(0,r.createElement)(Y,{id:o,operator:m,allowedOperators:u,value:t,onChange:n})),(0,r.createElement)(d.FlexBlock,null,(0,r.createElement)(q,{id:o,field:c,operator:m,value:t,onChange:n})),(0,r.createElement)(d.FlexItem,null,(0,r.createElement)(d.Flex,{gap:1,justify:"start"},(0,r.createElement)(M,{onClick:l,variant:"secondary",text:(0,s.__)("And","better-wp-security")}),a&&(0,r.createElement)(M,{onClick:a,variant:"tertiary",icon:R.A,label:(0,s.__)("Remove","better-wp-security")})))))}function B({id:e,field:t,value:n,onChange:a}){return(0,r.createElement)(d.BaseControl,{id:e+"__field",label:(0,s.__)("Field","better-wp-security"),help:(0,s.__)("Select a field to inspect.","better-wp-security"),__nextHasNoMarginBottom:!0},(0,r.createElement)(h.l6,{inputId:e+"__field",key:t?.value,options:$,value:t,onChange:e=>a({...n,parameter:e.value,match:{type:"equals"}}),isOptionSelected:(e,t)=>t.some((t=>U(e.value,t))),required:!0}))}function z({field:e,value:t,onChange:n}){var a;const{example:l,sanitize:i,display:o}=e.allowSubFields;return(0,r.createElement)(d.__experimentalInputControl,{label:(0,s.__)("Name","better-wp-security"),help:(0,s.sprintf)((0,s.__)("e.g. %s","better-wp-security"),l),value:o(null!==(a=t.parameter?.replace(e.value,""))&&void 0!==a?a:""),onChange:r=>n({...t,parameter:e.value+i(r)}),required:!0,__next36pxDefaultSize:!0})}function Y({id:e,operator:t,allowedOperators:n,value:a,onChange:l}){return(0,r.createElement)(d.BaseControl,{id:e+"__operator",label:(0,s.__)("Operator","better-wp-security"),__nextHasNoMarginBottom:!0},(0,r.createElement)(h.l6,{inputId:e+"__operator",options:n,value:t,onChange:e=>l({...a,match:{...a.match||{},type:e.value,value:(()=>{const t=a.match?.value;return t?e.isList?Array.isArray(t)?t:[t]:Array.isArray(t)?t[0]:t:e.isList?[]:""})()}}),isDisabled:!n.length,required:!0}))}function q({id:e,field:t,operator:n,value:a,onChange:l}){return n?.isList?(0,r.createElement)(d.BaseControl,{id:e+"__value",label:(0,s.__)("Value","better-wp-security"),__nextHasNoMarginBottom:!0},(0,r.createElement)(h.qJ,{inputId:e+"__value",key:t?.value,options:t?.listOptions?.map((e=>({value:e,label:e}))),value:a.match?.value?.map((e=>({value:e,label:e}))),onChange:e=>l({...a,match:{...a.match||{},value:(0,N.map)(e,"value")}}),isMulti:!0,isClearable:!0,required:!0})):t?.listOptions?(0,r.createElement)(d.BaseControl,{id:e+"__value",label:(0,s.__)("Value","better-wp-security"),__nextHasNoMarginBottom:!0},(0,r.createElement)(h.qJ,{inputId:e+"__value",key:t?.value,options:t?.listOptions?.map((e=>({value:e,label:e}))),value:{value:null!==(i=a.match?.value)&&void 0!==i?i:"",label:null!==(o=a.match?.value)&&void 0!==o?o:""},onChange:e=>l({...a,match:{...a.match||{},value:e.value}}),isClearable:!0,required:!0})):(0,r.createElement)(d.__experimentalInputControl,{label:(0,s.__)("Value","better-wp-security"),help:t?.example&&(0,s.sprintf)((0,s.__)("e.g. %s","better-wp-security"),t.example),value:a.match?.value,onChange:e=>l({...a,match:{...a.match||{},value:e}}),disabled:!t,required:!0,__next36pxDefaultSize:!0});var i,o}function U(e,t){return t.value===e||!(!t.allowSubFields||!e.startsWith(t.value))}const $=[{value:"server.REQUEST_URI",label:(0,s.__)("URI","better-wp-security"),operators:["equals","contains","not_contains"],example:"/test?param=value"},{value:"server.REQUEST_METHOD",label:(0,s.__)("Request Method","better-wp-security"),operators:!0,listOptions:["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"]},{value:"server.CONTENT_TYPE",label:(0,s.__)("Content Type","better-wp-security"),operators:!0},{value:"server.HTTP_",label:(0,s.__)("Header","better-wp-security"),operators:!0,allowSubFields:{example:"user-agent",sanitize:e=>e.toUpperCase().replace("-","_"),display:e=>e.toLowerCase().replace("_","-")}},{value:"cookie.",label:(0,s.__)("Cookie","better-wp-security"),operators:!0,allowSubFields:{example:"my-cookie",sanitize:e=>e.replace(".","_"),display:e=>e}},{value:"server.ip",label:(0,s.__)("IP Address"),operators:["equals","in_array","not_in_array"],example:"127.0.0.1"}],j=[{value:"equals",label:(0,s.__)("equals","better-wp-security")},{value:"contains",label:(0,s.__)("contains","better-wp-security")},{value:"not_contains",label:(0,s.__)("does not contain","better-wp-security")},{value:"in_array",label:(0,s.__)("is in","better-wp-security"),isList:!0},{value:"not_in_array",label:(0,s.__)("is not in","better-wp-security"),isList:!0}],H=[{value:"BLOCK",label:(0,s.__)("Block","better-wp-security")},{value:"REDIRECT",label:(0,s.__)("Redirect","better-wp-security")},{value:"LOG",label:(0,s.__)("Log only","better-wp-security")},{value:"WHITELIST",label:(0,s.__)("Allow","better-wp-security")}];var V=n(54625),K=n(89959),W=n(98883),J=n(62932),Q=n(55095),G=n(41588);const Z=(0,o.A)("div",{target:"e1vlnfa92"})({name:"1r4ht29",styles:"display:flex;align-items:center;justify-content:center;max-width:1680px;min-height:400px"}),X=(0,o.A)("div",{target:"e1vlnfa91"})({name:"i8rek5",styles:"display:flex;flex-direction:column;align-items:center;gap:1.25rem;max-width:400px;padding-top:70px;padding-bottom:70px"}),ee=(0,o.A)(V.N_,{target:"e1vlnfa90"})({name:"bp9nrr",styles:"padding-right:14px!important"});function te(){return(0,r.createElement)(Z,null,(0,r.createElement)(X,null,(0,r.createElement)(h.zf,{icon:(0,r.createElement)(G.ZW,null)}),(0,r.createElement)(g.EY,{variant:g.J3.DARK,weight:700,text:(0,s.__)("Your site has no firewall rules installed.","better-wp-security")}),(0,r.createElement)(ee,{to:"/rules/new",component:(0,W.kk)(g.$n),variant:"primary",icon:Q.A,text:(0,s.__)("Create a Rule","better-wp-security")})))}function ne(){const e=(0,J.aZ)("vulnerabilities");return(0,r.createElement)(Z,null,(0,r.createElement)(X,null,(0,r.createElement)(h.zf,{icon:(0,r.createElement)(G.rF,null)}),(0,r.createElement)(g.EY,{align:"center",variant:g.J3.DARK,weight:700,text:(0,s.__)("Your site has vulnerable software installed, but there are no firewall rules available.","better-wp-security")}),(0,r.createElement)(g.EY,{align:"center",variant:g.J3.DARK,text:(0,s.__)("Visit the vulnerabilities page to learn how to keep your site safe.","better-wp-security")}),(0,r.createElement)(g.$n,{href:e,variant:"primary",text:(0,s.__)("View Vulnerabilities","better-wp-security")})))}function re(){return(0,r.createElement)(Z,null,(0,r.createElement)(X,null,(0,r.createElement)(h.zf,{icon:(0,r.createElement)(G.KC,null)}),(0,r.createElement)(g.EY,{align:"center",variant:g.J3.DARK,weight:700,text:(0,s.__)("No firewall rules are active on your site because you have no vulnerable software installed.","better-wp-security")}),(0,r.createElement)(g.EY,{align:"center",variant:g.J3.DARK,text:(0,s.__)("Keep up the good work!","better-wp-security")})))}function ae({provider:e}){return(0,r.createElement)(g.Ex,function(e){switch(e){case"patchstack":return{text:"Patchstack",icon:(0,r.createElement)(G.yh,null)};case"solid":return{text:"Solid Security",icon:(0,r.createElement)(G.J9,null)};default:return{text:(0,s.__)("Custom Rule","better-wp-security"),icon:le}}}(e))}const le=(0,r.createElement)("svg",{width:"10",height:"13",viewBox:"0 0 10 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.76133 11.0773C9.7724 10.9901 9.78226 10.9027 9.78893 10.8155C9.79782 10.7025 9.80226 10.5865 9.80226 10.4674C9.80226 9.27326 9.32787 8.12798 8.48345 7.28356C7.63903 6.43914 6.49376 5.96475 5.29957 5.96475C4.10538 5.96475 2.9601 6.43914 2.11568 7.28356C1.27126 8.12798 0.796875 9.27326 0.796875 10.4674C0.796875 10.5865 0.801319 10.7026 0.810207 10.8155C0.816873 10.9027 0.825673 10.9901 0.837805 11.0773C2.1415 12.0028 3.70075 12.5 5.29957 12.5C6.89839 12.5 8.45764 12.0028 9.76133 11.0773ZM7.07169 1.23194C6.66166 0.822659 6.12242 0.568184 5.54583 0.511865C4.96923 0.455547 4.39094 0.60087 3.90947 0.92308C3.428 1.24529 3.07312 1.72445 2.9053 2.27895C2.73747 2.83345 2.76707 3.42898 2.98906 3.96411C3.21105 4.49923 3.61169 4.94084 4.12274 5.21371C4.63379 5.48659 5.22364 5.57385 5.79181 5.46063C6.35998 5.34741 6.87132 5.04071 7.23874 4.59279C7.60616 4.14486 7.80692 3.5834 7.80683 3.00406C7.80716 2.6748 7.74238 2.34873 7.61622 2.04459C7.49005 1.74046 7.30499 1.46428 7.07169 1.23194Z",fill:"#6C6C6C"})),ie=(0,o.A)(g.$n,{shouldForwardProp:e=>"isActive"!==e,target:"el7gie40"})("box-shadow:inset 0 0 0 1px ",(({isActive:e})=>null!=e?e:"#545454"),"!important;color:",(({isActive:e,theme:t})=>null!=e?e:t.colors.text.muted),"!important;&:hover{background:",(({isActive:e,theme:t})=>null!=e?e:t.colors.surface.primaryContrast),"!important;}");function se(){const{rules:e,hasResolved:t,installType:n,hasVulnerabilities:a}=(0,E.useSelect)((e=>({rules:e(f.firewallStore).getFirewallRules(),hasResolved:e(f.firewallStore).hasFinishedResolution("getFirewallRules"),installType:e(f.coreStore).getInstallType(),hasVulnerabilities:e(f.vulnerabilitiesStore).getVulnerabilities().length>0})),[]),l=!e.length&&t;return(0,r.createElement)("table",{className:"itsec-firewall-rules-table"},(0,r.createElement)("thead",null,(0,r.createElement)("tr",null,(0,r.createElement)(g.EY,{as:"th",text:(0,s.__)("Title","better-wp-security")}),(0,r.createElement)(g.EY,{as:"th",text:(0,s.__)("Source","better-wp-security")}),(0,r.createElement)(g.EY,{as:"th",text:(0,s.__)("Status","better-wp-security")}),(0,r.createElement)(g.EY,{as:"th",text:(0,s.__)("Action","better-wp-security")}))),(0,r.createElement)("tbody",null,e?.map((e=>(0,r.createElement)(oe,{key:e.id,rule:e}))),l&&"free"===n&&(0,r.createElement)("tr",null,(0,r.createElement)("td",{colSpan:4},(0,r.createElement)(te,null))),l&&"pro"===n&&a&&(0,r.createElement)("tr",null,(0,r.createElement)("td",{colSpan:4},(0,r.createElement)(ne,null))),l&&"pro"===n&&!a&&(0,r.createElement)("tr",null,(0,r.createElement)("td",{colSpan:4},(0,r.createElement)(re,null)))))}function oe({rule:e}){const{isSaving:t,isDeleting:n}=(0,E.useSelect)((t=>({isSaving:t(f.firewallStore).isSaving(e),isDeleting:t(f.firewallStore).isDeleting(e)})),[e]),{saveItem:a,deleteItem:l}=(0,E.useDispatch)(f.firewallStore);return(0,r.createElement)("tr",null,(0,r.createElement)("td",null,(0,r.createElement)(g.EY,{weight:g.uL.HEAVY},e.name)),(0,r.createElement)("td",null,(0,r.createElement)(ae,{provider:e.provider})),(0,r.createElement)("td",null,(0,r.createElement)(g.EY,{text:e.paused_at?(0,s.__)("Inactive","better-wp-security"):(0,s.__)("Active","better-wp-security")})),(0,r.createElement)("td",null,(0,r.createElement)(d.Flex,{justify:"start"},(0,r.createElement)(ie,{onClick:()=>{a({...e,paused_at:e.paused_at?null:(0,K.gmdate)("Y-m-d\\TH:i:s")})},isBusy:t,isActive:e.paused_at,text:e.paused_at?(0,s.__)("Activate","better-wp-security"):(0,s.__)("Deactivate","better-wp-security")}),"user"===e.provider&&(0,r.createElement)(React.Fragment,null,(0,r.createElement)(V.N_,{to:`/rules/${e.id}`,component:(0,W.kk)(g.$n),text:(0,s.__)("Edit","better-wp-security")}),(0,r.createElement)(g.$n,{onClick:()=>l((0,J.Ng)(e)),isDestructive:!0,isBusy:n,text:(0,s.__)("Delete","better-wp-security")})))))}var ce=n(39214);const ue=(0,o.A)("form",{target:"e11u33xz4"})({name:"1qs6zrd",styles:"padding:1rem 1.25rem;display:flex;flex-direction:column;gap:0.25rem"}),me=(0,o.A)("div",{target:"e11u33xz3"})({name:"1p6jri8",styles:"display:flex;align-items:center;gap:0.5rem;margin-top:0.25rem"}),de=(0,o.A)(g.qz,{target:"e11u33xz2"})({name:"s6qh76",styles:"max-width:360px;flex-grow:1"}),pe=(0,o.A)(g.Cu,{target:"e11u33xz1"})({name:"lee4ct",styles:"width:350px"}),ge=(0,o.A)("span",{target:"e11u33xz0"})({name:"14cgj8g",styles:"color:#c0c0c0"}),he={per_page:100},Ee={paused:"false"};function fe(){const{isQuerying:e}=(0,E.useSelect)((e=>({isQuerying:e(f.firewallStore).isQuerying("main")})),[]),{query:t}=(0,E.useDispatch)(f.firewallStore),[n,l]=(0,a.useState)(""),i=()=>{t("main",{search:n,...o,...he})},[o,c]=(0,a.useState)(Ee),u=e=>{c(e),t("main",{...e,search:n,...he})},m=Object.keys(o).filter((e=>!(0,N.isEmpty)(o[e]))).length;return(0,r.createElement)(ue,{onSubmit:e=>{e.preventDefault(),i()}},(0,r.createElement)(g.DZ,{level:2,size:g.$C.LARGE,variant:g.J3.DARK,weight:g.uL.HEAVY,text:(0,s.__)("Firewall Rules","better-wp-security")}),(0,r.createElement)(g.EY,{text:(0,s.__)("Firewall rules block requests based on patterns.","better-wp-security"),variant:g.J3.MUTED,size:g.$C.SMALL}),(0,r.createElement)(me,{role:"search"},(0,r.createElement)(de,{label:(0,s.__)("Search firewall rules","better-wp-security"),value:n,onChange:l,isSearching:e,size:"medium",placeholder:(0,s.__)("Search by title","better-wp-security"),onSubmit:i}),(0,r.createElement)(d.Dropdown,{popoverProps:{focusOnMount:"container"},renderToggle:({isOpen:e,onToggle:t})=>(0,r.createElement)(g.$n,{icon:ce.A,onClick:t,"aria-expanded":e,variant:"tertiary",text:(0,s.sprintf)((0,s.__)("Filter (%d)","better-wp-security"),m)}),renderContent:()=>(0,r.createElement)(pe,{initialValue:o,initialOpen:"paused",expandSingle:!0,isBusy:e,onApply:u},(0,r.createElement)(g.YS,{slug:"paused",title:(0,s.__)("Status","better-wp-security"),options:[{value:"false",label:(0,s.__)("Active","better-wp-security"),summary:(0,s.__)("Active Rules","better-wp-security")},{value:"true",label:(0,s.__)("Inactive","better-wp-security"),summary:(0,s.__)("Inactive Rules","better-wp-security")}]}),(0,r.createElement)(g.OV,{slug:"provider",title:(0,s.__)("Source","better-wp-security"),options:[{value:"patchstack",label:(0,s.__)("Patchstack","better-wp-security")},{value:"solid",label:(0,s.__)("Solid Security","better-wp-security")},{value:"user",label:(0,s.__)("Custom Rules","better-wp-security")}]}))}),(0,r.createElement)(ge,null,"|"),(0,r.createElement)(g.$n,{onClick:()=>{l(""),c(Ee),t("main",{...Ee,...he})},variant:"tertiary",text:(0,s.__)("Reset all","better-wp-security")})))}var ye=n(1694),_e=n(56897);const ve=(0,o.A)("div",{target:"eyx51y0"})({name:"1vltohq",styles:"display:flex;gap:2rem;justify-content:flex-end;& .components-button.is-tertiary:disabled{background:transparent!important;}"});function xe(){const{isQuerying:e,hasPrev:t,hasNext:n}=(0,E.useSelect)((e=>({isQuerying:e(f.firewallStore).isQuerying("main"),hasPrev:e(f.firewallStore).queryHasPrevPage("main"),hasNext:e(f.firewallStore).queryHasNextPage("main")})),[]),{fetchQueryPrevPage:a,fetchQueryNextPage:l}=(0,E.useDispatch)(f.firewallStore);return(0,r.createElement)(ve,null,(0,r.createElement)(g.$n,{disabled:!t||e,icon:ye.A,iconGap:0,variant:"tertiary",onClick:()=>a("main","replace"),text:(0,s.__)("Prev","better-wp-security")}),(0,r.createElement)(g.$n,{disabled:!n||e,icon:_e.A,iconPosition:"right",iconGap:0,variant:"tertiary",onClick:()=>l("main","replace"),text:(0,s.__)("Next","better-wp-security")}))}var be=n(44653),we=n(50300),ke=n(77984),Le=n(23495),Se=n(78687),Ie=n(84124),Oe=n(85631),Ae=n.n(Oe),Ne=n(77172);const Ce=(0,o.A)(d.Card,{target:"es30p7y5"})("display:flex;flex-direction:column;& circle{fill:",(({theme:e})=>e.colors.surface.primaryAccent),";fill-opacity:1;}"),Re=(0,o.A)(d.CardHeader,{target:"es30p7y4"})({name:"1x2b7cs",styles:"padding:1rem 1.25rem"}),De=(0,o.A)(g.ui,{target:"es30p7y3"})({name:"mizjgb",styles:"display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 8px;border-radius:2px"}),Me=(0,o.A)(g.ui,{target:"es30p7y2"})({name:"1v8nd53",styles:"height:275px"}),Pe=(0,o.A)(g.$T,{target:"es30p7y1"})({name:"vtxs8z",styles:"margin:1rem"}),Te=(0,o.A)("div",{target:"es30p7y0"})({name:"1m84zdt",styles:"display:flex;flex-direction:column;justify-content:center;align-items:center;height:275px;gap:1rem;padding:2rem"});function Fe({active:e,payload:t}){if(!e||!t?.length)return null;const n=(0,s.sprintf)((0,s._n)("%d attempt","%d attempts",t[0].value,"better-wp-security"),t[0].value);return(0,r.createElement)(De,{variant:g.ls.DARK},(0,r.createElement)(g.EY,{as:"p",text:n}),(0,r.createElement)(g.EY,{as:"p",text:t[0].payload.name}))}function Be({period:e,setPeriod:t}){const n=(0,m.u)();let l;const i=(0,C.useViewportMatch)("medium","<"),o=(0,a.useCallback)((()=>{const t={events:["local-brute-force","network-brute-force","firewall-block"],period:e};return Ae()({path:(0,Ne.addQueryArgs)("/ithemes-security/v1/dashboard/events",t)})}),[e]),{status:c,value:u,error:d}=(0,W.Yb)(o),p=(0,J.aZ)("settings","/settings/configure/lockout");"success"===c&&(l={"firewall-graph":{data:Object.values(u.data)}});const E=[],f=[];let y=0;if(!(0,N.isEmpty)(l))for(const t in l){for(let n=0;n<l[t].data.length;n++){const r=l[t].data[n];if(y+=r.y,E[n])E[n][t]=r.y;else{const n="24-hours"===e?"g A":"M j";E.push({name:r.t?(0,K.dateI18n)(n,r.t):r.x,[t]:r.y})}}f.push({dataKey:t})}return(0,r.createElement)(Ce,null,(0,r.createElement)(Re,null,(0,r.createElement)(g.EY,{size:g.$C.LARGE,variant:g.J3.DARK,weight:600,text:"success"===c?(0,s.sprintf)((0,s._n)("%d Threat Blocked","%d Threats Blocked",y,"better-wp-security"),y):(0,s.__)("Threats Blocked","better-wp-security")}),(0,r.createElement)(h.n_,{value:e,onChange:e=>t(e)})),"pending"===c&&(0,r.createElement)(Me,null,(0,r.createElement)(Pe,{text:(0,s.__)("Data Loading","better-wp-security")})),"error"===c&&(0,r.createElement)(Me,null,(0,r.createElement)(Pe,{type:"danger",text:(0,s.sprintf)((0,s.__)("An error has occurred: %s","better-wp-security"),d.message)})),"success"===c&&(y>0?(0,r.createElement)(be.u,{width:"100%",height:275},(0,r.createElement)(we.Q,{data:E,margin:{top:40,left:-15,right:50,bottom:10}},i?(0,r.createElement)(ke.W,{ticks:[E[0]?.name,E[E.length/2]?.name,E[E.length-1]?.name],dataKey:"name",tickLine:!1,stroke:n.colors.text.muted}):(0,r.createElement)(ke.W,{interval:1,dataKey:"name",tickLine:!1,stroke:n.colors.text.muted}),(0,r.createElement)(Le.h,{allowDecimals:!1,tickLine:!1,stroke:n.colors.text.muted}),(0,r.createElement)(Se.m,{content:(0,r.createElement)(Fe,null)}),f.map((e=>(0,r.createElement)(Ie.G,{type:"linear",key:e.dataKey,dataKey:e.dataKey,stroke:n.colors.primary.darker20,fill:n.colors.tertiary.base,isAnimationActive:!1,dot:!0}))))):(0,r.createElement)(Te,null,(0,r.createElement)(h.zf,{icon:(0,r.createElement)(G.r,null)}),(0,r.createElement)(g.EY,{align:"center",variant:g.J3.DARK,text:(0,s.__)("There are no recently blocked threats. This could mean there haven’t been any attacks recently.","better-wp-security")}),(0,r.createElement)(g.EY,{align:"center",variant:g.J3.DARK,text:(0,s.__)("Make sure to configure the firewall settings if you haven’t yet!","better-wp-security")}),(0,r.createElement)(g.$n,{href:p,text:(0,s.__)("Configure Firewall","better-wp-security")}))))}var ze=n(58168);const Ye=(0,o.A)("div",{target:"e1o61d9v6"})("display:flex;flex-direction:column;flex-grow:1;@media screen and (min-width: ",(({theme:e})=>e.breaks.wide),"px){flex-grow:0;}"),qe=(0,o.A)("div",{target:"e1o61d9v5"})({name:"tgad8j",styles:"margin:0.75rem 0"}),Ue=(0,o.A)(g.ui,{target:"e1o61d9v4"})({name:"13ftngy",styles:"display:flex;gap:0.5rem;padding:8px 12px;border-radius:2px 2px 0 0"}),$e=(0,o.A)(g.ui,{target:"e1o61d9v3"})("display:flex;justify-content:space-between;padding:8px 12px;border-top-left-radius:",(({hasHeading:e})=>!e&&"2px"),";border-top-right-radius:",(({hasHeading:e})=>!e&&"2px"),";:last-of-type{border-bottom-right-radius:2px;border-bottom-left-radius:2px;}"),je=(0,o.A)("div",{target:"e1o61d9v2"})({name:"15idi1d",styles:"display:flex;flex-direction:column;gap:0.75rem"}),He=(0,o.A)(g.ui,{target:"e1o61d9v1"})({name:"1cx1nbv",styles:"display:flex;flex-direction:column;gap:0.75rem;margin:0.75rem 0;padding:1rem 0.75rem"}),Ve=(0,o.A)(g.$n,{target:"e1o61d9v0"})({name:"6heuj6",styles:"width:fit-content;align-self:center"});function Ke(e){return(0,r.createElement)(g.EY,(0,ze.A)({as:"p",size:g.$C.SMALL},e))}function We({heading:e,children:t}){return(0,r.createElement)(qe,null,e&&(0,r.createElement)(Ue,{variant:g.ls.SECONDARY},(0,r.createElement)(g.EY,{weight:600,text:e})),t)}function Je({text:e,count:t,hasHeading:n}){return(0,r.createElement)($e,{hasHeading:n},(0,r.createElement)(g.EY,{variant:g.J3.DARK,weight:600,text:e}),(0,r.createElement)(g.EY,{variant:g.J3.DARK,text:t}))}function Qe({title:e,description:t,actionText:n,actionLink:a}){return(0,r.createElement)(je,null,(0,r.createElement)(He,null,(0,r.createElement)(g.EY,{variant:g.J3.MUTED,weight:600,text:e}),(0,r.createElement)(g.EY,{variant:g.J3.MUTED,text:t})),(0,r.createElement)(Ve,{variant:"link",text:n,href:a}))}function Ge({title:e,children:t}){return(0,r.createElement)(Ye,null,(0,r.createElement)(g.EY,{size:g.$C.LARGE,variant:g.J3.DARK,weight:g.uL.HEAVY,text:e}),t)}const Ze=(0,o.A)(d.Modal,{target:"e12mdcim6"})("width:60%;max-width:718px;.components-modal__header{padding:0.5rem 1.5rem;}.components-modal__header-heading{font-size:1rem;}.components-modal__content{padding:0;}& button:hover{color:",(({theme:e})=>e.colors.secondary.darker20),";}& button:focus{box-shadow:0 0 0 2px ",(({theme:e})=>e.colors.primary.base),"!important;}"),Xe=(0,o.A)("div",{target:"e12mdcim5"})({name:"3yscd8",styles:"display:flex;flex-direction:column;gap:2rem;padding:1.5rem 1.5rem 3.5rem"}),et=(0,o.A)("div",{target:"e12mdcim4"})({name:"bbmwc3",styles:"display:grid;grid-template-columns:1fr 1fr;margin-bottom:2rem"}),tt=(0,o.A)("div",{target:"e12mdcim3"})("display:flex;flex-direction:column;gap:0.75rem;padding-top:0.5rem;padding-bottom:1rem;:first-child{border-right:1px solid ",(({theme:e})=>e.colors.border.normal),";padding-right:3rem;}:nth-child(2){margin-left:3rem;}"),nt=(0,o.A)("div",{target:"e12mdcim2"})("display:grid;grid-template-columns:0.175fr 1fr;gap:1rem;:nth-child(even){border-bottom:1px solid ",(({theme:e})=>e.colors.border.normal),";padding-bottom:2rem;}@media screen and (min-width: ",(({theme:e})=>e.breaks.xlarge),"px){align-items:center;}"),rt=(0,o.A)("div",{target:"e12mdcim1"})({name:"damvy5",styles:"display:flex;gap:1rem"}),at=(0,o.A)(g.EY,{target:"e12mdcim0"})({name:"17w62k0",styles:"color:#D63638"});function lt({actionText:e,rule:t,ip:n,geolocation:a,date:l,requestUrl:i,requestMethod:o,userAgent:c,onRequestClose:u}){return(0,r.createElement)(Ze,{title:(0,s.__)("Log Details","better-wp-security"),onRequestClose:u},(0,r.createElement)(Xe,null,(0,r.createElement)(et,null,(0,r.createElement)(tt,null,(0,r.createElement)(g.EY,{size:g.$C.SMALL,variant:g.J3.MUTED,text:(0,s.__)("Triggered Rule","better-wp-security")}),(0,r.createElement)(g.EY,{size:g.$C.EXTRA_LARGE,variant:g.J3.DARK,text:t||(0,s.__)("Unknown rule","better-wp-security")})),(0,r.createElement)(tt,null,(0,r.createElement)(g.EY,{size:g.$C.SMALL,variant:g.J3.MUTED,text:(0,s.__)("Action Taken","better-wp-security")}),(0,r.createElement)(g.EY,{size:g.$C.EXTRA_LARGE,text:e,variant:g.J3.DARK}))),(0,r.createElement)(nt,null,(0,r.createElement)(g.EY,{size:g.$C.SMALL,variant:g.J3.MUTED,text:(0,s.__)("Date & Time:","better-wp-security")}),(0,r.createElement)(g.EY,{variant:g.J3.DARK,text:(0,K.dateI18n)("M d, Y - g:i:s",l)})),i&&(0,r.createElement)(nt,null,(0,r.createElement)(g.EY,{size:g.$C.SMALL,variant:g.J3.MUTED,text:(0,s.__)("Request:","better-wp-security")}),(0,r.createElement)(rt,null,o&&(0,r.createElement)(at,{text:o}),(0,r.createElement)(g.EY,{variant:g.J3.DARK,text:i}))),(0,r.createElement)(nt,null,(0,r.createElement)(g.EY,{size:g.$C.SMALL,variant:g.J3.MUTED,text:(0,s.__)("Origin:","better-wp-security")}),(0,r.createElement)(rt,null,a&&!(0,J.d7)(a)&&(0,r.createElement)(React.Fragment,null,(0,r.createElement)(g.EY,{variant:g.J3.DARK,text:(0,J.tO)(a.country_code)+" "+a.label}),(0,r.createElement)(g.EY,{variant:g.J3.MUTED},"•")),(0,r.createElement)(g.EY,{text:n}))),c&&(0,r.createElement)(nt,null,(0,r.createElement)(g.EY,{size:g.$C.SMALL,variant:g.J3.MUTED,text:(0,s.__)("User Agent:","better-wp-security")}),(0,r.createElement)(g.EY,{variant:g.J3.DARK,text:c}))))}const it=(0,o.A)(g.ui,{target:"e1abd2u510"})("border:1px solid ",(({theme:e})=>e.colors.border.normal),";"),st=(0,o.A)("div",{target:"e1abd2u59"})({name:"xuq0dw",styles:"display:flex;flex-direction:column;gap:0.5rem;padding:1rem 1.5rem"}),ot=(0,o.A)(g.EY,{target:"e1abd2u58"})({name:"hra6zc",styles:"font-size:0.75rem"}),ct=(0,o.A)(g.qz,{target:"e1abd2u57"})({name:"s6qh76",styles:"max-width:360px;flex-grow:1"}),ut=(0,o.A)(g.EY,{target:"e1abd2u56"})("color:",(({action:e,theme:t})=>"BLOCK"===e?"red":t.colors.text.dark),";width:80px;"),mt=(0,o.A)(g.EY,{target:"e1abd2u55"})("@media screen and (min-width: ",(({theme:e})=>e.breaks.medium),"px){width:22%;max-width:300px;}@media screen and (min-width: ",(({theme:e})=>e.breaks.wide),"px){width:30%;}"),dt=(0,o.A)("div",{target:"e1abd2u54"})({name:"1sfvdl0",styles:"display:flex;align-items:center;gap:1rem;justify-content:space-between"}),pt=(0,o.A)(dt,{target:"e1abd2u53"})({name:"11g6mpt",styles:"justify-content:flex-start"}),gt=(0,o.A)(g.$T,{target:"e1abd2u52"})({name:"vtxs8z",styles:"margin:1rem"}),ht=(0,o.A)(g.ui,{target:"e1abd2u51"})({name:"1v8nd53",styles:"height:275px"}),Et=(0,o.A)(ht,{target:"e1abd2u50"})({name:"195w10n",styles:"display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1.25rem;padding:2.5rem 0"}),ft={module:["firewall","lockout"],code:["BLOCK::%","host-lockout::%","host-triggered-blacklist"],per_page:20,_embed:1};function yt(){const[e,t]=(0,a.useState)(0),{isQuerying:n,items:l,logStorageDuration:i}=(0,E.useSelect)((e=>{var t;return{isQuerying:e(f.logsStore).isQuerying("firewall"),items:e(f.logsStore).getQueryResults("firewall"),logStorageDuration:null!==(t=e(f.modulesStore).getSetting("global","log_rotation"))&&void 0!==t?t:60}}),[]),{query:o}=(0,E.useDispatch)(f.logsStore);(0,a.useEffect)((()=>{o("firewall",ft)}),[o]);const[c,u]=(0,a.useState)(""),m=()=>o("firewall",{...ft,search:c}),d=(0,C.useViewportMatch)("medium","<");return(0,r.createElement)(it,null,(0,r.createElement)(st,null,(0,r.createElement)(g.DZ,{level:3,size:g.$C.LARGE,variant:g.J3.DARK,weight:g.uL.HEAVY,text:(0,s.__)("Firewall Logs","better-wp-security")}),(0,r.createElement)(ot,{variant:g.J3.MUTED,text:(0,s.sprintf)((0,s._n)("Firewall logs are stored for up to %d day and then archived.","Firewall logs are stored for up to %d days and then archived.",i,"better-wp-security"),i)}),(0,r.createElement)("form",{onSubmit:e=>{e.preventDefault(),m()}},(0,r.createElement)(ct,{label:(0,s.__)("Search firewall logs","better-wp-security"),value:c,onChange:u,isSearching:n,size:"medium",placeholder:(0,s.__)("Search by IP address or URL","better-wp-security"),onSubmit:m}))),(0,r.createElement)("table",{className:"itsec-firewall-logs-table"},(0,r.createElement)("thead",null,d?(0,r.createElement)("tr",null,(0,r.createElement)("th",null,(0,s.__)("Action & Origin","better-wp-security")),(0,r.createElement)("th",null,(0,s.__)("Protected By","better-wp-security"))):(0,r.createElement)("tr",null,(0,r.createElement)("th",null,(0,s.__)("Action","better-wp-security")),(0,r.createElement)("th",null,(0,s.__)("Rule","better-wp-security")),(0,r.createElement)("th",null,(0,s.__)("Origin","better-wp-security")),(0,r.createElement)("th",null,(0,s.__)("Date & Time","better-wp-security")),(0,r.createElement)("th",null,(0,s.__)("Protected By","better-wp-security")))),(0,r.createElement)("tbody",null,n&&(0,r.createElement)("tr",null,(0,r.createElement)("td",{colSpan:d?2:5},(0,r.createElement)(ht,null,(0,r.createElement)(gt,{text:(0,s.__)("Data Loading","better-wp-security")})))),!n&&l.length>0&&l.map((n=>(0,r.createElement)(_t,{key:n.id,log:n,isSmall:d,viewEntry:e,setViewEntry:t}))),!n&&0===l.length&&(0,r.createElement)(wt,{isSmall:d}))))}function _t(e){return"firewall"===e.log.module.raw?(0,r.createElement)(vt,e):"lockout"===e.log.module.raw?(0,r.createElement)(xt,e):null}function vt({log:e,isSmall:t,viewEntry:n,setViewEntry:a}){return(0,r.createElement)(bt,{id:e.id,action:"BLOCK",actionText:(0,s.__)("Block","better-wp-security"),rule:e._embedded?.["ithemes-security:firewall-rule"]?.[0].name,ip:e.ip.raw,geolocation:e._embedded?.["ithemes-security:geolocate"]?.[0],date:e.created_at,protectedBy:e._embedded?.["ithemes-security:firewall-rule"]?.[0].provider,requestUrl:e.url,requestMethod:e.data.method,userAgent:e.data.user_agent,isSmall:t,viewEntry:n,setViewEntry:a})}function xt({log:e,isSmall:t,viewEntry:n,setViewEntry:a}){var l;return(0,r.createElement)(bt,{id:e.id,action:"BLOCK",actionText:"host-triggered-blacklist"===e.code.raw.code?(0,s.__)("Ban","better-wp-security"):(0,s.__)("Lockout","better-wp-security"),rule:"host-triggered-blacklist"===e.code.raw.code?(0,s.__)("Locked out too many times","better-wp-security"):null!==(l=e.data.module_details?.reason)&&void 0!==l?l:e.data.module,ip:e.ip.raw,geolocation:e._embedded?.["ithemes-security:geolocate"]?.[0],date:e.created_at,protectedBy:"solid",requestUrl:e.url,isSmall:t,viewEntry:n,setViewEntry:a})}function bt({id:e,actionText:t,action:n,rule:a,ip:l,geolocation:i,date:o,protectedBy:c,requestUrl:u,requestMethod:m,userAgent:p,isSmall:h,viewEntry:E,setViewEntry:f}){const y=i&&!(0,J.d7)(i)&&(0,r.createElement)(d.Tooltip,{text:i.label},(0,r.createElement)("span",null,(0,J.tO)(i.country_code)," "));return(0,r.createElement)("tr",null,h?(0,r.createElement)(React.Fragment,null,(0,r.createElement)("td",null,(0,r.createElement)(pt,null,(0,r.createElement)(ut,{weight:g.uL.HEAVY,action:n,text:t,textTransform:"uppercase"}),y,l)),(0,r.createElement)("td",null,(0,r.createElement)(dt,null,(0,r.createElement)(ae,{provider:c}),(0,r.createElement)(g.$n,{text:(0,s.__)("Details","better-wp-security")})))):(0,r.createElement)(React.Fragment,null,(0,r.createElement)(ut,{as:"td",action:n,weight:g.uL.HEAVY,text:t,textTransform:"uppercase"}),(0,r.createElement)(mt,{as:"td"},a||(0,s.__)("Unknown rule","better-wp-security")),(0,r.createElement)("td",null,y,l),(0,r.createElement)("td",null,(0,K.dateI18n)("M d, Y - g:i:s",o)),(0,r.createElement)("td",null,(0,r.createElement)(dt,null,(0,r.createElement)(ae,{provider:c}),(0,r.createElement)(g.$n,{"aria-pressed":E===e,onClick:()=>f(e),text:(0,s.__)("Details","better-wp-security")})))),E===e&&(0,r.createElement)(lt,{actionText:t,rule:a,ip:l,geolocation:i,date:o,requestUrl:u,requestMethod:m,userAgent:p,onRequestClose:()=>f(0)}))}function wt({isSmall:e}){const{logTypeFile:t}=(0,E.useSelect)((e=>({logTypeFile:"file"===e(f.modulesStore).getSetting("global","log_type")})),[]);return(0,r.createElement)("tr",null,(0,r.createElement)("td",{colSpan:e?2:5},t?(0,r.createElement)(ht,null,(0,r.createElement)(gt,{text:(0,s.__)("To view logs inside Solid Security, you must enable database logging in Global Settings.","better-wp-security")})):(0,r.createElement)(Et,null,(0,r.createElement)(h.zf,{icon:(0,r.createElement)(G.OB,null)}),(0,r.createElement)(g.EY,{text:(0,s.__)("We haven’t logged any activity yet.","better-wp-security")}))))}function kt({period:e}){const{hasGeolocation:t}=(0,E.useSelect)((e=>({hasGeolocation:"active"===e(f.MODULES_STORE_NAME).getModule("geolocation")?.status.selected})),[]),n=(0,a.useCallback)((()=>Ae()({path:(0,Ne.addQueryArgs)("/ithemes-security/rpc/lockout-stats/top-blocked-ips",{period:e})})),[e]),{status:l,value:i,error:o}=(0,W.Yb)(n),c=(0,J.aZ)("settings","/settings/configure/lockout");return(0,r.createElement)(Ge,{title:(0,s.__)("Top Blocked IPs","better-wp-security")},"error"===l&&(0,r.createElement)(g.$T,{type:"danger",text:(0,s.sprintf)((0,s.__)("An error has occurred: %s","better-wp-security"),o.message)}),t&&("success"===l||"pending"===l)&&(0,r.createElement)(St,{data:i}),!t&&("success"===l||"pending"===l)&&(0,r.createElement)(Lt,{data:i}),0===i?.length&&"success"===l&&(0,r.createElement)(Qe,{title:(0,s.__)("No IPs have been locked out recently","better-wp-security"),description:(0,s.__)("Consider customizing your firewall settings.","better-wp-security"),actionText:(0,s.__)("Firewall Settings","better-wp-security"),actionLink:c}))}function Lt({data:e}){return e?.map((e=>(0,r.createElement)(We,{key:e.ip},(0,r.createElement)(Je,{text:e.ip,count:e.count}))))}function St({data:e}){if(!e?.length)return null;const t=(0,N.groupBy)(e,(e=>e.location?`${e.location?.country}:${e.location?.country_code}`:"")),n=e.reduce(((e,t)=>{const n=t.location?.credit;return n&&!e.includes(n)&&e.push(n),e}),[]);return(0,r.createElement)(React.Fragment,null,(0,N.map)(t,((e,t)=>{let n=(0,s.__)("Unknown","better-wp-security");if(t){const[e,r]=t.split(":");n=e,r&&(n=(0,J.tO)(r)+" "+n)}return(0,r.createElement)(We,{key:t,heading:n},e.map((e=>(0,r.createElement)(Je,{key:e.ip,text:e.ip,count:e.count,hasHeading:!0}))))})),n.length>0&&(0,r.createElement)(Ke,null,n.map(((e,t)=>(0,r.createElement)(h.VK,{key:t,noWrap:!0,content:e+(t<n.length-1?". ":".")})))))}const It=(0,o.A)("div",{target:"e1ytzd2n0"})({name:"1vltohq",styles:"display:flex;gap:2rem;justify-content:flex-end;& .components-button.is-tertiary:disabled{background:transparent!important;}"});function Ot(){const{isQuerying:e,hasPrev:t,hasNext:n}=(0,E.useSelect)((e=>({isQuerying:e(f.logsStore).isQuerying("firewall"),hasPrev:e(f.logsStore).queryHasPrevPage("firewall"),hasNext:e(f.logsStore).queryHasNextPage("firewall")})),[]),{fetchQueryPrevPage:a,fetchQueryNextPage:l}=(0,E.useDispatch)(f.logsStore);return(0,r.createElement)(It,null,(0,r.createElement)(g.$n,{disabled:!t||e,icon:ye.A,iconGap:0,variant:"tertiary",onClick:()=>a("firewall","replace"),text:(0,s.__)("Prev","better-wp-security")}),(0,r.createElement)(g.$n,{disabled:!n||e,icon:_e.A,iconPosition:"right",iconGap:0,variant:"tertiary",onClick:()=>l("firewall","replace"),text:(0,s.__)("Next","better-wp-security")}))}var At=n(2359),Nt=n(26425);const Ct=(0,o.A)("div",{target:"enb5tf30"})({name:"1fo50kt",styles:"margin-top:1.5rem"}),Rt=["user_lockout_message","lockout_period","blacklist_period","blacklist","blacklist_count","lockout_message","user_lockout_message","community_lockout_message","automatic_temp_auth","lockout_white_list"];function Dt({module:e}){const t=(0,a.useCallback)(((e,t)=>Rt.includes(t)),[]),{schema:n,uiSchema:l,formData:i,setFormData:s}=(0,Nt.useSettingsForm)(e,t);return(0,r.createElement)(g.ui,null,(0,r.createElement)(g.zY,{title:e.title,description:e.description,fullWidth:!0,hasBorder:!0}),(0,r.createElement)(Ct,null,(0,r.createElement)(Nt.ModuleFormInputs,{module:e,schema:n,uiSchema:l,formData:i,setFormData:s})))}const Mt=(0,o.A)("div",{target:"eh8pj490"})({name:"1m3j4vw",styles:"padding:1.5rem"});function Pt({module:e}){return(0,r.createElement)(React.Fragment,null,(0,r.createElement)(g.zY,{title:e.title,description:e.description,fullWidth:!0,hasBorder:!0}),(0,r.createElement)(Mt,null,(0,r.createElement)(Nt.ModuleCard,{module:e,persistStatus:!0,includeTitle:!0})))}const Tt=(0,o.A)(d.Flex,{target:"e1yhr99q0"})({name:"1m3j4vw",styles:"padding:1.5rem"});function Ft(){const{tab:e}=(0,c.g)(),{module:t,config:n,isDirty:a,isSaving:l}=(0,E.useSelect)((t=>({module:t(f.MODULES_STORE_NAME).getModule(e),config:t(f.MODULES_STORE_NAME).getEditedModule(e),isDirty:t(f.MODULES_STORE_NAME).areSettingsDirty(e),isSaving:t(f.MODULES_STORE_NAME).isSavingSettings(e)})),[e]),{saveSettings:i,resetSettingEdits:o}=(0,E.useDispatch)(f.MODULES_STORE_NAME);return(0,r.createElement)(d.FlexBlock,null,(0,r.createElement)("form",{onSubmit:e=>{e.preventDefault(),i(n.id,!0)}},(0,r.createElement)(At.ErrorBoundary,{FallbackComponent:Nt.ErrorRenderer},(0,r.createElement)(g.ui,{variant:"primary"},(0,r.createElement)(Bt,{module:t}),(0,r.createElement)(Tt,{justify:"end"},(0,r.createElement)(g.$n,{text:(0,s.__)("Undo Changes","better-wp-security"),variant:"secondary",onClick:()=>o(t.id),disabled:l||!a,align:"right"}),(0,r.createElement)(g.$n,{type:"submit",text:(0,s.__)("Save Settings","better-wp-security"),variant:"primary",isBusy:l,disabled:l||!a,align:"right"}))))))}function Bt({module:e}){return"global"===e.id?(0,r.createElement)(Dt,{module:e}):(0,r.createElement)(Pt,{module:e})}const zt=(0,o.A)("div",{target:"e1sdc93o2"})("display:flex;flex-direction:column;gap:1.5rem;@media screen and (min-width: ",(({theme:e})=>e.breaks.wide),"px){flex-direction:row;}"),Yt=(0,o.A)("div",{target:"e1sdc93o1"})("display:flex;flex-direction:column;gap:1rem;@media screen and (min-width: ",(({theme:e})=>e.breaks.huge),"px){flex-grow:1.5;gap:2rem;}"),qt=(0,o.A)("div",{target:"e1sdc93o0"})("display:flex;flex-direction:column;gap:2rem;min-width:300px;@media screen and (min-width: ",(({theme:e})=>e.breaks.medium),"px){flex-direction:row;gap:3.5rem;}@media screen and (min-width: ",(({theme:e})=>e.breaks.wide),"px){flex-direction:column;border-left:1px solid ",(({theme:e})=>e.colors.border.normal),";padding-left:1.25rem;}");function Ut(){const[e,t]=(0,a.useState)("30-days");return(0,r.createElement)(A,null,(0,r.createElement)(zt,null,(0,r.createElement)(Yt,null,(0,r.createElement)(Be,{period:e,setPeriod:t}),(0,r.createElement)(yt,null),(0,r.createElement)(Ot,null)),(0,r.createElement)(qt,null,(0,r.createElement)(kt,{period:e}))))}const $t=(0,o.A)(V.N_,{target:"e15k91o70"})({name:"bp9nrr",styles:"padding-right:14px!important"});function jt(){return(0,r.createElement)(A,null,(0,r.createElement)(d.Flex,{justify:"end"},(0,r.createElement)($t,{to:"/rules/new",component:(0,W.kk)(g.$n),variant:"primary",icon:Q.A,text:(0,s.__)("Create Rule","better-wp-security")})),(0,r.createElement)(g.ui,null,(0,r.createElement)(fe,null),(0,r.createElement)(se,null)),(0,r.createElement)(xe,null))}var Ht=n(47406);const Vt=(0,o.A)(T,{target:"e1afec1l0"})({name:"1s8ymgn",styles:"padding:1rem 1.5rem"});function Kt(){const{push:e}=(0,c.W6)(),{id:t}=(0,c.g)(),{item:n,self:a,isSaving:l,notFound:i,error:o}=(0,E.useSelect)((e=>{const n=(0,J.Ng)(e(f.firewallStore).getItemById(t));return{item:n&&e(f.firewallStore).getEditedItem(n),self:n,isSaving:n&&e(f.firewallStore).isSaving(n),notFound:e(f.firewallStore).hasResolutionFailed("getItemById",[t]),error:n&&e(f.firewallStore).getLastSaveError(n)}}),[t]),{editItem:u,saveEditedItem:m}=(0,E.useDispatch)(f.firewallStore),p=async()=>{try{await m(a)}catch(e){return}e("/rules")};return(0,r.createElement)(A,null,(0,r.createElement)(d.Flex,{gap:5,direction:"column",align:"stretch",justify:"start",expanded:!1,as:"form"},(0,r.createElement)(d.FlexItem,null,(0,r.createElement)(V.N_,{to:"/rules",component:(0,W.kk)(g.$n),variant:"tertiary",icon:Ht.A,text:(0,s.__)("Back to Rules overview","better-wp-security")})),o&&(0,r.createElement)(g.$T,{type:"danger",text:o.message||(0,s.__)("Could not save rule.","better-wp-security")}),i&&(0,r.createElement)(g.$T,{type:"warning",text:(0,s.__)("Firewall rule not found.","better-wp-security")}),n&&(0,r.createElement)(React.Fragment,null,(0,r.createElement)(g.ui,{as:d.FlexBlock},(0,r.createElement)(g.zY,{hasBorder:!0,title:(0,s.__)("Edit Firewall Rule","better-wp-security"),description:(0,s.__)("Custom firewall rules let you block attackers or allow authorized traffic.","better-wp-security")}),(0,r.createElement)(Vt,{value:n,onChange:e=>u(a,e)})),(0,r.createElement)(d.Flex,{justify:"end"},(0,r.createElement)(g.$n,{variant:"secondary",text:(0,s.__)("Save as Draft","better-wp-security"),onClick:async()=>{n.paused_at||await u(a,{paused_at:(0,K.gmdate)("Y-m-d\\TH:i:s")}),await p()},disabled:l,isBusy:l&&n.paused_at}),(0,r.createElement)(g.$n,{variant:"primary",text:(0,s.__)("Deploy","better-wp-security"),onClick:async()=>(n.paused_at&&await u(a,{paused_at:null}),p()),disabled:l,isBusy:l&&null===n.paused_at})))))}var Wt=n(29672);const Jt=(0,o.A)(d.SnackbarList,{target:"edvbg1c0"})({name:"1a7cr9x",styles:".components-snackbar-list__notice-container{display:flex;flex-direction:column;align-items:flex-end;margin-right:100px;}"});function Qt(){const{removeNotice:e}=(0,E.useDispatch)(Wt.store),{modules:t,snackbarNotices:n}=(0,E.useSelect)((e=>({modules:e(f.MODULES_STORE_NAME).getModules(),snackbarNotices:e(Wt.store).getNotices("ithemes-security")})),[]),a=(0,N.sortBy)(t.filter((e=>"lockout"===e.type)),"order");return(0,r.createElement)(A,null,(0,r.createElement)(Jt,{notices:n,onRemove:t=>e(t,"ithemes-security")}),(0,r.createElement)(d.Flex,{gap:5,align:"start"},(0,r.createElement)(g.Nz,{orientation:"vertical"},(0,r.createElement)(V.k2,{key:"global",to:"/configure/global",component:(0,W.kk)(g.W0)},(0,s.__)("Global Settings","better-wp-security")),a.map((e=>(0,r.createElement)(V.k2,{key:e.id,to:"/configure/"+e.id,component:(0,W.kk)(g.W0)},e.title)))),(0,r.createElement)(Ft,null)))}function Gt(){const{push:e}=(0,c.W6)(),{saveItem:t,refreshQuery:n}=(0,E.useDispatch)(f.firewallStore),[l,i]=(0,a.useState)({}),[o,u]=(0,a.useState)(""),[m,p]=(0,a.useState)(null),h=async(r,a)=>{u(r);try{p(null),await t(a),await n("main")}catch(e){return void p(e)}finally{u("")}e("/rules")};return(0,r.createElement)(A,null,(0,r.createElement)(d.Flex,{gap:5,direction:"column",align:"stretch",justify:"start",expanded:!1,as:"form"},(0,r.createElement)(d.FlexItem,null,(0,r.createElement)(V.N_,{to:"/rules",component:(0,W.kk)(g.$n),variant:"tertiary",icon:Ht.A,text:(0,s.__)("Back to Rules overview","better-wp-security")})),(0,r.createElement)(_,null),m&&(0,r.createElement)(g.$T,{type:"danger",text:m.message||(0,s.__)("Could not create rule.","better-wp-security")}),(0,r.createElement)(g.ui,{as:d.FlexBlock},(0,r.createElement)(g.zY,{hasBorder:!0,title:(0,s.__)("Create Firewall Rule","better-wp-security"),description:(0,s.__)("Custom firewall rules let you block attackers or allow authorized traffic.","better-wp-security")}),(0,r.createElement)(Vt,{value:l,onChange:i})),(0,r.createElement)(d.Flex,{justify:"end"},(0,r.createElement)(g.$n,{variant:"secondary",text:(0,s.__)("Save as Draft","better-wp-security"),onClick:()=>h("draft",{...l,paused_at:(0,K.gmdate)("Y-m-d\\TH:i:s")}),disabled:!!o,isBusy:"draft"===o}),(0,r.createElement)(g.$n,{variant:"primary",text:(0,s.__)("Deploy","better-wp-security"),onClick:()=>h("publish",l),disabled:!!o,isBusy:"publish"===o}))))}var Zt=n(76154),Xt=n.n(Zt),en=n(28351),tn=n(67108),nn=n(84910);const rn=(0,o.A)(g.ui,{target:"e17y765k29"})({name:"1x4izjv",styles:"position:relative;padding:1.5rem;border-radius:8px"}),an=(0,o.A)("div",{target:"e17y765k28"})("display:grid;grid-template-columns:",(({isMedium:e})=>e?"1fr":"1.25fr 0.75fr"),";gap:.8rem;margin-bottom:",(({isMedium:e})=>e?".8rem":"0"),";.itsec-basic-banner-title svg{width:78px;height:25px;}"),ln=(0,o.A)(g.EY,{target:"e17y765k27"})({name:"n8ra49",styles:"font-size:1.125rem"}),sn=(0,o.A)(g.$n,{shouldForwardProp:e=>"singleColumn"!==e,target:"e17y765k26"})("padding-left:10px!important;justify-self:",(({singleColumn:e})=>e?"start":"end"),";align-self:center;"),on=(0,o.A)(g.EY,{target:"e17y765k25"})("align-self:start;justify-self:",(({isMedium:e})=>e?"start":"end"),";height:fit-content;background:#FBF9FF;border:1px solid #E0E0E0;border-radius:20px;padding:4px 16px 4px 12px;margin-right:2.5rem;"),cn=(0,o.A)(g.ui,{target:"e17y765k24"})({name:"1nmp4lx",styles:"padding:1.25rem;border-radius:8px"}),un=(0,o.A)(G.yh,{target:"e17y765k23"})({name:"s0560a",styles:"width:24px;height:18px;align-self:start"}),mn=(0,o.A)(g.EY,{target:"e17y765k22"})({name:"1gcz0h6",styles:"padding-bottom:2.5rem"}),dn=(0,o.A)(g.EY,{target:"e17y765k21"})({name:"1wfxxmo",styles:"padding-bottom:.75rem"}),pn=(0,o.A)(g.ui,{target:"e17y765k20"})({name:"1d3w5wq",styles:"width:100%"}),gn=(0,o.A)(g.ui,{target:"e17y765k19"})("padding:1.5rem;display:grid;grid-template-columns:",(({isMedium:e})=>e?"1fr":"1fr 0.5fr"),";align-items:center;gap:.8rem;"),hn=(0,o.A)(g.EY,{target:"e17y765k18"})("display:",(({hasPatchstack:e})=>!e&&"flex"),";align-items:center;.itsec-header-title-small{color:#6817C5;}.itsec-header-title-large{font-size:2rem;color:#6817C5;padding-right:.5rem;}"),En=(0,o.A)("div",{target:"e17y765k17"})("display:flex;flex-direction:column;align-items:",(({isMedium:e})=>e?"flex-start":"flex-end"),";align-self:start;"),fn=(0,o.A)(g.EY,{target:"e17y765k16"})({name:"kc0l0i",styles:"font-size:0.625rem"}),yn=(0,o.A)(G.Tk,{shouldForwardProp:e=>"isLarge"!==e,target:"e17y765k15"})("width:",(({isLarge:e})=>e?"170px":"124px"),";"),_n=(0,o.A)("div",{target:"e17y765k14"})("display:grid;grid-template-columns:",(({isSmall:e})=>e?"1fr 1fr":"0.5fr 0.5fr 1fr"),';grid-template-areas:"name version detail";justify-items:start;padding:.625rem;gap:0.6rem;'),vn=(0,o.A)(g.EY,{target:"e17y765k13"})({name:"104g9nb",styles:"grid-area:name"}),xn=(0,o.A)(g.EY,{target:"e17y765k12"})({name:"1olbkha",styles:"grid-area:version"}),bn=(0,o.A)(g.EY,{target:"e17y765k11"})({name:"29p8i5",styles:"grid-area:detail"}),wn=(0,o.A)(g.EY,{target:"e17y765k10"})("display:flex;justify-content:center;width:min-content;min-width:2rem;margin:",(({isSmall:e})=>!e&&"0 auto"),";padding:1.5px 6.5px;background-color:",(({backgroundColor:e})=>e),";border-radius:2px;"),kn=(0,o.A)(g.ui,{target:"e17y765k9"})({name:"shat3k",styles:"flex-shrink:1;position:relative;overflow-y:auto;max-height:31vh;@media ( max-width: 1100px ){max-height:35vh;}@media ( max-width: 700px ){max-height:46vh;}"}),Ln=(0,o.A)(g.EY,{target:"e17y765k7"})({name:"jr8xee",styles:"background:#F9F9F9;padding:.625rem;border-collapse:collapse;overflow-y:auto"}),Sn=(0,o.A)("table",{target:"e17y765k6"})({name:"1uixtsi",styles:"width:100%;border-collapse:collapse"}),In=(0,o.A)("div",{target:"e17y765k5"})("display:grid;justify-items:start;gap:.8rem;grid-template-columns:",(({isSmall:e})=>e?"1fr":"1fr 0.5fr"),";"),On=(0,o.A)("div",{target:"e17y765k4"})({name:"o6kot3",styles:"display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2rem;padding:2rem;svg{margin:0 auto;}"}),An=(0,o.A)(g.$n,{target:"e17y765k3"})({name:"1257f36",styles:"width:fit-content;color:#53129E;margin:0 auto"}),Nn=(0,o.A)("div",{target:"e17y765k2"})({name:"1q7c919",styles:"display:grid;grid-template-rows:1fr 1fr;gap:.8rem"}),Cn=(0,o.A)(g.EY,{target:"e17y765k1"})({name:"1fl3hkd",styles:"padding:.625rem"}),Rn=(0,o.A)(g.$n,{target:"e17y765k0"})("position:absolute;top:1rem;right:1rem;box-shadow:inset 0 0 0 1px transparent!important;svg{fill:",(({theme:e})=>e.colors.text.normal),";&:hover,&:active,&:focus{fill:#6817c5;}}"),Dn={patchable:!0,per_page:100,last_seen_after:Xt()().subtract(90,"days").toISOString()},Mn={resolution:"auto-updated",per_page:100,last_seen_after:Xt()().subtract(90,"days").toISOString(),software_type:["plugin","theme"]};function Pn(){const e=(0,C.useViewportMatch)("small","<"),t=(0,C.useViewportMatch)("medium","<"),n=(0,C.useViewportMatch)("large"),{items:l,hasPatchstack:i,installType:s,isQuerying:o}=(0,E.useSelect)((e=>({items:e(f.vulnerabilitiesStore).getQueryResults("autoPatched"),hasPatchstack:e(f.coreStore).hasPatchstack(),installType:e(f.coreStore).getInstallType(),isQuerying:e(f.vulnerabilitiesStore).isQuerying("autoPatched")})),[]),{query:c}=(0,E.useDispatch)(f.vulnerabilitiesStore);(0,a.useEffect)((()=>{c("autoPatched",Dn)}),[c]);const u=l.length;return(0,r.createElement)(A,null,!o&&(0,r.createElement)(React.Fragment,null,(0,r.createElement)(Tn,{hasPatchstack:i,isSmall:e,numberOfVulnerabilities:u,installType:s,isMedium:t}),(0,r.createElement)(In,{isSmall:e},(0,r.createElement)(pn,{variant:"primary"},(0,r.createElement)(Fn,{hasPatchstack:i,isLarge:n,numberOfVulnerabilities:u,isMedium:t}),(0,r.createElement)(Bn,{items:l,isSmall:e,installType:s,hasPatchstack:i})),(0,r.createElement)(Nn,null,(0,r.createElement)(zn,{hasPatchstack:i,numberOfVulnerabilities:u}),(0,r.createElement)(Yn,{installType:s})))))}function Tn({hasPatchstack:e,isSmall:t,numberOfVulnerabilities:n,installType:a,isMedium:l}){const[i,o]=(0,W.Mj)("itsecFWAutoHasPatchstack");if(i)return null;const c=e?(0,s.__)("Thanks for valuing your site security!","better-wp-security"):(0,s.__)("Interested in always-on, automated firewall protection?","better-wp-security");let u="";return e?u=(0,s.__)("You’re getting the best protection available with our Patchstack integration.","better-wp-security"):n>0&&(u=(0,s.sprintf)((0,s._n)("Solid Security Pro could have instantly protected you from %d vulnerability in the last 90 days using automated firewall protection from Patchstack.","Solid Security Pro could have instantly protected you from %d vulnerabilities in the last 90 days using automated firewall protection from Patchstack.",n,"better-wp-security"),n)),(0,r.createElement)(rn,{variant:e?"primary":"dark",isSmall:t},(0,r.createElement)(an,{isMedium:l},(0,r.createElement)(d.Flex,{direction:"column",expanded:!1,justify:"center",gap:3},(0,r.createElement)(ln,{as:"h3",className:e?"":"itsec-basic-banner-title",text:c,icon:e?G.Ot:G.WJ,size:g.$C.LARGE,iconSize:25}),u&&(0,r.createElement)(g.EY,{as:"p",text:u,variant:e?g.J3.DARK:g.J3.WHITE,isSmall:t})),e&&!t&&(0,r.createElement)(React.Fragment,null,(0,r.createElement)(on,{text:(0,s.__)("Automated Firewall Active","better-wp-security"),icon:en.A,iconColor:"#5FB370",isMedium:l,align:l?"left":"right"}),(0,r.createElement)(Rn,{label:(0,s.__)("Dismiss","better-wp-security"),icon:R.A,onClick:()=>o(!0)})),!e&&(0,r.createElement)(sn,{text:"free"===a?(0,s.__)("Get Solid Security Pro + Patchstack","better-wp-security"):(0,s.__)("Upgrade to Patchstack","better-wp-security"),variant:"primary",href:"free"===a?"https://go.solidwp.com/patchstack-banner-upgrade-now":"https://go.solidwp.com/enable-patchstack",icon:tn.A,iconPosition:"right",align:"right",singleColumn:l})),e&&t&&(0,r.createElement)(React.Fragment,null,(0,r.createElement)(g.Ex,{text:(0,s.__)("Automated Firewall Active","better-wp-security"),icon:en.A,iconColor:"#5FB370"}),(0,r.createElement)(Rn,{label:(0,s.__)("Dismiss","better-wp-security"),icon:R.A,onClick:()=>o(!0)})))}function Fn({hasPatchstack:e,isLarge:t,numberOfVulnerabilities:n,isMedium:l}){let i="";return i=e?(0,a.createInterpolateElement)((0,s.sprintf)((0,s._n)("Solid Security Pro with Patchstack automatically protected you from <b>%d</b> vulnerability in the last 90 days","Solid Security Pro with Patchstack automatically protected you from <b>%d</b> vulnerabilities in the last 90 days",n,"better-wp-security"),n),{b:(0,r.createElement)("span",{className:"itsec-header-title-small"})}):(0,a.createInterpolateElement)((0,s.sprintf)((0,s._n)("<b>%d</b> Vulnerability we could have patched automatically","<b>%d</b> Vulnerabilities we could have patched automatically",n,"better-wp-security"),n),{b:(0,r.createElement)("span",{className:"itsec-header-title-large"})}),(0,r.createElement)(gn,{variant:"primary",isMedium:l},(0,r.createElement)(hn,{as:"h3",size:g.$C.LARGE,text:i,hasPatchstack:e}),(0,r.createElement)(En,{isMedium:l},(0,r.createElement)(fn,{weight:600,text:(0,s.__)("Powered by","better-wp-security")}),(0,r.createElement)(yn,{isLarge:t})))}function Bn({items:e,isSmall:t,installType:n,hasPatchstack:l}){return(0,r.createElement)(kn,{as:"section"},e.length>0&&(0,r.createElement)(Sn,null,(0,r.createElement)("thead",null,(0,r.createElement)("tr",null,(0,r.createElement)(Ln,{as:"th",text:(0,s.__)("Type","better-wp-security"),textTransform:"uppercase",weight:400}),(0,r.createElement)(Ln,{as:"th",text:(0,s.__)("Vulnerability","better-wp-security"),textTransform:"uppercase",weight:400}),(0,r.createElement)(Ln,{as:"th",text:(0,s.__)("Severity","better-wp-security"),textTransform:"uppercase",weight:400,align:"center"}))),(0,r.createElement)("tbody",null,e.map((e=>{var n;const a=e.details.id;return(0,r.createElement)("tr",{key:a},(0,r.createElement)(React.Fragment,null,(0,r.createElement)("td",null,(0,r.createElement)(Cn,{icon:(0,nn.vulnerabilityIcon)(e.software.type.slug)})),(0,r.createElement)("td",null,(0,r.createElement)(_n,{isSmall:t},(0,r.createElement)(vn,{weight:500,text:e.software.label||e.software.slug}),(0,r.createElement)(xn,{text:e.details.affected_in}),!t&&(0,r.createElement)(bn,{text:e.details.type.label}))),(0,r.createElement)("td",null,(0,r.createElement)(wn,{backgroundColor:(0,nn.severityColor)(e.details.score),status:e.status,weight:600,text:null!==(n=e.details.score)&&void 0!==n?n:"??"}))))})))),0===e.length&&!l&&(0,r.createElement)(On,null,(0,r.createElement)(G.al,null),(0,r.createElement)(g.EY,{text:(0,a.createInterpolateElement)((0,s.__)("We didn’t spot vulnerabilities that could have been patched automatically in the last 90 days, <b>but they can still appear any day</b>. Solid Security Pro with Patchstack gives peace of mind and proactive security upgrade to be automatically protected today!","better-wp-security"),{b:(0,r.createElement)("strong",null)}),align:"center"}),(0,r.createElement)(An,{variant:"text",text:(0,s.__)("Go Pro with Patchstack","better-wp-security"),href:"free"===n?"https://go.solidwp.com/patchstack-banner-upgrade-now":"https://go.solidwp.com/enable-patchstack"})),0===e.length&&l&&(0,r.createElement)(On,null,(0,r.createElement)(h.zf,{icon:(0,r.createElement)(G.KC,null)}),(0,r.createElement)(g.EY,{text:(0,s.__)("We didn’t spot vulnerabilities that could have been patched automatically in the last 90 days, great job keeping your site secure!","better-wp-security"),align:"center"})))}function zn({hasPatchstack:e,numberOfVulnerabilities:t}){const n=e?(0,s.__)("Instant Protection","better-wp-security"):(0,s.__)("Get Instant Protection","better-wp-security");let l="";return l=e?(0,a.createInterpolateElement)((0,s.sprintf)((0,s._n)("You were automatically protected from <b>%d vulnerability</b> using <b>virtual patching,</b> Solid Security Pro’s instant protection feature!","You were automatically protected from <b>%d vulnerabilities</b> using <b>virtual patching,</b> Solid Security Pro’s instant protection feature!",t,"better-wp-security"),t),{b:(0,r.createElement)("strong",null)}):(0,a.createInterpolateElement)((0,s.sprintf)((0,s._n)("Automated protection was available for <b>%d vulnerabilities</b> using <b>virtual patches</b> that instantly deploy when using Solid Security Pro with Patchstack integration. Get ’round the clock protection. Go Pro today.","Automated protection was available for <b>%d vulnerabilities</b> using <b>virtual patches</b> that instantly deploy when using Solid Security Pro with Patchstack integration. Get ’round the clock protection. Go Pro today.",t,"better-wp-security"),t),{b:(0,r.createElement)("strong",null)}),(0,r.createElement)(cn,{variant:"primary"},(0,r.createElement)(d.Flex,null,(0,r.createElement)(dn,{as:"h4",text:n,size:g.$C.SUBTITLE_SMALL}),(0,r.createElement)(un,null)),(0,r.createElement)(mn,{as:"p",text:l,variant:g.J3.MUTED}),(0,r.createElement)(h.Fe,null))}function Yn({installType:e}){const{items:t}=(0,E.useSelect)((e=>({items:e(f.vulnerabilitiesStore).getQueryResults("autoUpdated")})),[]),{query:n}=(0,E.useDispatch)(f.vulnerabilitiesStore);(0,a.useEffect)((()=>{n("autoUpdated",Mn)}),[n]);const l=e?(0,s.__)("Real-time Updates","better-wp-security"):(0,s.__)("Get Real-time Updates","better-wp-security");let i="";return i="pro"===e?(0,a.createInterpolateElement)((0,s.sprintf)((0,s._n)("Solid Security with the help of Patchstack has <b>automatically updated %d plugin or theme</b> in the last 90 days!","Solid Security with the help of Patchstack has <b>automatically updated %d plugins or themes</b> in the last 90 days!",t.length,"better-wp-security"),t.length),{b:(0,r.createElement)("strong",null)}):(0,a.createInterpolateElement)((0,s.__)("Avoid vulnerabilities from harming your site with <b>Real-Time Updates,</b> never forget to upgrade a plugin or theme ever again.","better-wp-security"),{b:(0,r.createElement)("strong",null)}),(0,r.createElement)(cn,{variant:"primary"},(0,r.createElement)(dn,{as:"h4",text:l,size:g.$C.SUBTITLE_SMALL}),(0,r.createElement)(mn,{as:"p",text:i,variant:g.J3.MUTED}),(0,r.createElement)(h.i$,null))}var qn=n(89552);function Un(){const{isCreating:e,setCreating:t,isSaving:n,setSaving:a,isQuerying:l,createBan:i,afterSave:o,query:c,selected:u,onSelect:m}=(0,qn.useBanHosts)("firewall"),p=(0,C.useInstanceId)(Un,"itsec-banned-ips-form-");return(0,r.createElement)(d.FlexBlock,null,(0,r.createElement)(g.ui,null,(0,r.createElement)(g.zY,{title:(0,s.__)("Banned IPs","better-wp-security"),description:(0,s.__)("Add, remove and edit banned IPs.","better-wp-security"),fullWidth:!0,hasBorder:!0}),!e&&(0,r.createElement)(React.Fragment,null,(0,r.createElement)(qn.List,{selected:!e&&u,onSelect:m,querying:l,query:c,queryId:"firewall",className:"itsec-banned-ips-data"})),e&&(0,r.createElement)(qn.AddNew,{id:p,createForm:e,save:i,setSaving:a,afterSave:o}),(0,r.createElement)(qn.BanHostsActions,{isCreating:e,isSaving:n,setCreating:t,formId:p})))}const $n=(0,o.A)("form",{target:"eqhicwv1"})({name:"1fo50kt",styles:"margin-top:1.5rem"}),jn=(0,o.A)("div",{target:"eqhicwv0"})({name:"sbzvkn",styles:"display:flex;align-items:center;justify-content:end;gap:1.5rem;padding:1rem 2rem"}),Hn=["automatic_temp_auth","lockout_white_list"];function Vn(){const{module:e,config:t}=(0,E.useSelect)((e=>({module:e(f.MODULES_STORE_NAME).getModule("global"),config:e(f.MODULES_STORE_NAME).getEditedModule("global")})),[]),{saveSettings:n}=(0,E.useDispatch)(f.MODULES_STORE_NAME),l=(0,a.useCallback)(((e,t)=>Hn.includes(t)),[]),i=(0,C.useInstanceId)(Vn,"itsec-ip-management-authorize-ips"),{schema:o,uiSchema:c,formData:u,setFormData:m}=(0,Nt.useSettingsForm)(e,l);return t?(0,r.createElement)(d.FlexBlock,null,(0,r.createElement)(g.ui,null,(0,r.createElement)(g.zY,{title:(0,s.__)("Authorized IPs","better-wp-security"),description:(0,s.__)("Add or remove authorized IPs.","better-wp-security"),fullWidth:!0,hasBorder:!0}),(0,r.createElement)($n,{onSubmit:e=>{e.preventDefault(),n(t.id,!0)},id:i},(0,r.createElement)(Nt.ModuleFormInputs,{module:e,schema:o,uiSchema:c,formData:u,setFormData:m}),(0,r.createElement)(Kn,{moduleId:e.id,form:i})))):null}function Kn({moduleId:e,form:t}){const{isSaving:n,isDirty:a}=(0,E.useSelect)((t=>({isDirty:t(f.MODULES_STORE_NAME).getDirtySettings(),isSaving:t(f.MODULES_STORE_NAME).isSavingSettings(e)})),[e]),{resetSettingEdits:l}=(0,E.useDispatch)(f.MODULES_STORE_NAME);return(0,r.createElement)(jn,null,(0,r.createElement)(g.$n,{text:(0,s.__)("Undo Changes","better-wp-security"),variant:"secondary",onClick:()=>l(e),disabled:n||!a}),(0,r.createElement)(g.$n,{type:"submit",form:t,text:(0,s.__)("Save","better-wp-security"),variant:"primary",isBusy:n,disabled:n||!a}))}var Wn=n(30040);const Jn=(0,o.A)("div",{target:"euitk5y5"})({name:"1sxflrz",styles:"padding:1rem;max-width:400px"}),Qn=(0,o.A)(g.ui,{target:"euitk5y4"})({name:"13ku56z",styles:"display:flex;flex-direction:column;height:100%"}),Gn=(0,o.A)("div",{target:"euitk5y3"})({name:"2yaztx",styles:"text-align:center;display:flex;gap:1.25rem;flex-direction:column;align-items:center;flex-grow:1;height:100%;justify-content:center;padding:1rem"}),Zn=(0,o.A)("section",{target:"euitk5y2"})({name:"rrldme",styles:"max-width:70ch;display:flex;flex-direction:column;gap:0.5rem"}),Xn=(0,o.A)("div",{target:"euitk5y1"})({name:"o0x664",styles:"padding-bottom:2rem"}),er=(0,o.A)(g.vp,{target:"euitk5y0"})({name:"1bwon5h",styles:"padding:1rem!important;margin-top:1rem"});function tr(){return(0,r.createElement)(Qn,null,(0,r.createElement)(Gn,null,(0,r.createElement)(Zn,null,(0,r.createElement)(g.DZ,{level:4,size:g.$C.NORMAL,weight:g.uL.HEAVY,text:(0,s.__)("All Clear!","better-wp-security"),align:"center"}),(0,r.createElement)(g.EY,{as:"p",text:(0,s.__)("No users are currently locked out of your site.","better-wp-security"),align:"center"})),(0,r.createElement)(h.zf,{icon:(0,r.createElement)(G.r,null),isSmall:!0})))}function nr({searchTerm:e,setSearchTerm:t,isQuerying:n}){return(0,r.createElement)(Jn,null,(0,r.createElement)(g.qz,{placeholder:(0,s.__)("Search Lockouts","better-wp-security"),value:e,onChange:e=>{t(e)},isSearching:n,size:"small"}))}function rr(e){return(0,r.createElement)(Qn,null,(0,r.createElement)(Gn,null,(0,r.createElement)(Zn,null,(0,r.createElement)(g.DZ,{level:4,size:g.$C.NORMAL,weight:g.uL.HEAVY,text:(0,s.__)("Unexpected Error","better-wp-security"),align:"center"}),(0,r.createElement)(g.EY,{as:"p",text:(0,s.__)("An error occurred while rendering the list of lockouts.","better-wp-security"),align:"center"}),(0,r.createElement)(g.EY,{as:"p",text:(0,s.__)("Try refreshing you browser. If the error persists, please contact support.","better-wp-security"),align:"center"}),(0,r.createElement)(g.EY,{as:"p",text:e.text,align:"center"})),(0,r.createElement)(h.zf,{icon:(0,r.createElement)(G.sA,null),isSmall:!0})))}function ar(){const{selectedId:e,searchTerm:t,setSearchTerm:n,banningIds:l,releasingIds:i,lockouts:o,getLockoutsError:c,isQuerying:u,select:m,getDetails:p,onBan:h,onRelease:y}=function(){const[e,t]=(0,a.useState)(0),[n,r]=(0,a.useState)(""),[l,i]=function(e){const[t,n]=(0,a.useState)([]),{createNotice:r,removeNotice:l}=(0,E.useDispatch)("core/notices");return[t,(0,a.useCallback)((async()=>{const t="/ithemes-security/v1/lockouts/"+e+"/ban-lockout",a=`ban-lockout-${e}`;n((t=>[...t,e])),l(a,"ithemes-security");try{return await Ae()({banUrl:t,method:"POST"}),setTimeout((()=>l(a,"ithemes-security")),5e3),r("success",(0,s.__)("Ban Created","better-wp-security"),{id:a,context:"ithemes-security"}),!0}catch(e){return r("error",(0,s.sprintf)((0,s.__)("Error when banning lockout: %s","better-wp-security"),e.message||(0,s.__)("An unexpected error occurred.","better-wp-security")),{id:a,context:"ithemes-security"}),!1}finally{n((t=>t.filter((t=>t!==e))))}}),[r,l,e])]}(e),[o,c]=function(e){const[t,n]=(0,a.useState)([]),{createNotice:r,removeNotice:l}=(0,E.useDispatch)("core/notices");return[t,(0,a.useCallback)((async()=>{const t="/ithemes-security/v1/lockouts/"+e+"/release-lockout",a=`release-lockout-${e}`;n((t=>[...t,e])),l(a,"ithemes-security");try{return await Ae()({path:t,method:"POST"}),setTimeout((()=>l(a,"ithemes-security")),5e3),r("success",(0,s.__)("Lockout Released","better-wp-security"),{id:a,context:"ithemes-security"}),!0}catch(e){return r("error",(0,s.sprintf)((0,s.__)("Error when releasing lockout: %s","better-wp-security"),e.message||(0,s.__)("An unexpected error occurred.","better-wp-security")),{id:a,context:"ithemes-security"}),!1}finally{n((t=>t.filter((t=>t!==e))))}}),[r,l,e])]}(e),{getLockouts:u,isQuerying:m,value:d,error:p}=function(e){const t=(0,a.useMemo)((()=>({search:e})),[e]),n=(0,a.useCallback)((async()=>{try{return await Ae()({path:(0,Ne.addQueryArgs)("/ithemes-security/v1/lockouts",t)})}catch(e){return!1}}),[t]),{execute:r,status:l,value:i,error:s}=(0,W.Yb)(n);return{getLockouts:r,status:l,value:i,error:s}}(n),g=(0,a.useCallback)((e=>{if(!e._links.self[0].href)return Promise.reject(new Error("No data available."));const t=(0,Ne.addQueryArgs)(e._links.self[0].href,{context:"edit"});return Ae()({url:t}).then((e=>e.detail))}),[]);return{selectedId:e,searchTerm:n,setSearchTerm:r,banningIds:l,releasingIds:o,lockouts:d,getLockoutsError:p,isQuerying:m,select:e=>t(e),getDetails:g,onBan:async r=>{r.preventDefault(),await i(e)&&(t((t=>t===e?0:t)),u(n))},onRelease:async r=>{r.preventDefault(),await c(e)&&(t((t=>t===e?0:t)),u(n))}}}(),{banUsersActive:_}=(0,E.useSelect)((e=>({banUsersActive:e(f.modulesStore).isActive("ban-users")})),[]),v=(0,N.find)(o,["id",e]),x=v?.bannable&&_,b=v?.active;return(0,r.createElement)(d.FlexBlock,null,(0,r.createElement)(g.ui,null,(0,r.createElement)(g.zY,{title:(0,s.__)("Active Lockouts","better-wp-security"),description:(0,s.__)("View, ban, or release lockout out users and IP addresses.","better-wp-security"),fullWidth:!0,hasBorder:!0}),(0,r.createElement)(d.FlexBlock,null,(0,r.createElement)(d.Flex,null,(0,r.createElement)(er,{isSinglePane:!0,onSelect:m,selectedId:v?.id||0}))),!v?.id&&(0,r.createElement)(nr,{searchTerm:t,setSearchTerm:n,isQuerying:u}),!(0,N.isEmpty)(c)&&(0,r.createElement)(rr,{error:c}),(0,N.isEmpty)(o)?(0,r.createElement)(tr,null):(0,r.createElement)(Xn,null,(0,r.createElement)(Wn.List,{lockouts:o,select:m,selectedLockout:v,fetchLockoutDetails:p})),v?.id>0&&(b||x)&&(0,r.createElement)(Wn.ActiveLockoutActions,{isReleaseAvailable:b,selectedId:v,releasingIds:i,banningIds:l,onRelease:y,onBan:h})))}const lr=(0,o.A)("header",{target:"e1d931rk1"})({name:"1smerdt",styles:"padding:1rem 0"});function ir(){const{banUsersActive:e}=(0,E.useSelect)((e=>({banUsersActive:e(f.modulesStore).isActive("ban-users")})),[]);return(0,r.createElement)(A,null,(0,r.createElement)(lr,null,(0,r.createElement)(g.DZ,{level:1,weight:g.uL.NORMAL,text:(0,s.__)("IP Management","better-wp-security")}),(0,r.createElement)(g.EY,{text:(0,s.__)("Your one-stop for all things IP management. Ban troublesome IPs from wreaking havoc, ensure everyone who needs access to your site has it by authorizing IPs and manage temporarily locked out users.","better-wp-security")})),(0,r.createElement)(d.Flex,{gap:5,align:"start"},(0,r.createElement)(g.Nz,{orientation:"vertical"},e&&(0,r.createElement)(V.k2,{key:"ban-users",to:"/ip-management/ban-users",component:(0,W.kk)(g.W0)},(0,s.__)("Banned IPs","better-wp-security")),(0,r.createElement)(V.k2,{key:"active-lockouts",to:"/ip-management/active-lockouts",component:(0,W.kk)(g.W0)},(0,s.__)("Active Lockouts","better-wp-security")),(0,r.createElement)(V.k2,{key:"global",to:"/ip-management/authorize-ips",component:(0,W.kk)(g.W0)},(0,s.__)("Authorized IPs","better-wp-security"))),e&&(0,r.createElement)(c.qh,{path:"/ip-management/ban-users",component:Un}),(0,r.createElement)(c.qh,{path:"/ip-management/active-lockouts",component:ar}),(0,r.createElement)(c.qh,{path:"/ip-management/authorize-ips",component:Vn})))}const sr=(0,o.A)(g.ui,{target:"e1yyl6z60"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"});function or({history:e}){return(0,r.createElement)(m.b,{theme:g.$f},(0,r.createElement)(c.Ix,{history:e},(0,r.createElement)(u.HX,{ReactRouterRoute:c.qh},(0,r.createElement)(sr,{className:"itsec-firewall",variant:g.ls.UNDER_PAGE},(0,r.createElement)(d.SlotFillProvider,null,(0,r.createElement)(p.PluginArea,null),(0,r.createElement)(d.Popover.Slot,null),(0,r.createElement)(h.Nr,null),(0,r.createElement)(c.dO,null,(0,r.createElement)(c.qh,{path:"/logs",component:Ut}),(0,r.createElement)(c.qh,{path:"/rules/new",component:Gt}),(0,r.createElement)(c.qh,{path:"/rules/:id",component:Kt}),(0,r.createElement)(c.qh,{path:"/rules",component:jt}),(0,r.createElement)(c.qh,{path:"/configure/:tab",component:Qt}),(0,r.createElement)(c.qh,{path:"/configure",component:Qt},(0,r.createElement)(c.rd,{to:"/configure/global"})),(0,r.createElement)(c.qh,{path:"/ip-management/:tab",component:ir}),(0,r.createElement)(c.qh,{path:"/ip-management",component:ir},(0,r.createElement)(c.rd,{to:"/ip-management/ban-users"})),(0,r.createElement)(c.qh,{path:"/automated",component:Pn}),(0,r.createElement)(c.qh,{path:"/"},(0,r.createElement)(c.rd,{to:"/logs"}))))))))}var cr=n(75413);n.p=window.itsecWebpackPublicPath,(0,s.setLocaleData)({"":{}},"ithemes-security-pro");const ur=(0,cr.n)(document.location,{page:"itsec-firewall"});i()((()=>(0,a.render)((0,r.createElement)(or,{history:ur}),document.getElementById("itsec-firewall-root"))))},66087:e=>{"use strict";e.exports=window.lodash},68440:e=>{e.exports=function(){return this.itsec["user-groups"].ui}()},75413:(e,t,n)=>{"use strict";n.d(t,{n:()=>i});var r=n(17929),a=n(86663),l=n(66087);function i(e,t){const n=(0,r.zR)(),i=n=>{const l="string"==typeof n?(0,r.Rr)(n):n,i=(0,a.parse)(l.search?.substring(1))||{};return{...l,pathname:e.pathname,search:"?"+(0,a.stringify)({...i,path:l.pathname,...t})}};return{get length(){return n.length},get action(){return n.action},get location(){const e=(0,a.parse)(n.location.search.substring(1)),r=e.path||"/";return{...n.location,pathname:r,search:"?"+(0,a.stringify)((0,l.omit)(e,["path",Object.keys(t)]))}},createHref:e=>n.createHref(i(e)),push:(e,t)=>{n.push(i(e),t)},replace:(e,t)=>{n.replace(i(e),t)},go:(...e)=>n.go.apply(n,e),goBack:(...e)=>n.goBack.apply(n,e),goForward:(...e)=>n.goForward.apply(n,e),block:(...e)=>n.block.apply(n,e),listen(e){return n.listen((()=>{e(this.location,this.action)}))}}}},75795:e=>{"use strict";e.exports=window.ReactDOM},76154:e=>{"use strict";e.exports=window.moment},77172:e=>{e.exports=function(){return this.wp.url}()},79860:e=>{e.exports=function(){return this.wp.keycodes}()},84910:e=>{e.exports=function(){return this.itsec.pages.vulnerabilities}()},85631:e=>{e.exports=function(){return this.wp.apiFetch}()},89552:e=>{e.exports=function(){return this.itsec.core["ban-hosts"]}()},89897:e=>{e.exports=function(){return this.wp.compose}()},89959:e=>{e.exports=function(){return this.wp.date}()},98883:(e,t,n)=>{"use strict";n.d(t,{Yb:()=>E,ML:()=>f,$I:()=>_,Mj:()=>v,SV:()=>x,ee:()=>h,sy:()=>c,qY:()=>u,kk:()=>p,wl:()=>d,pq:()=>s});var r=n(58168),a=n(51609),l=n(8601),i=n(89897);function s(e){return(0,i.createHigherOrderComponent)((t=>class extends l.Component{render(){return(0,a.createElement)(t,(0,r.A)({},this.props,e))}}),"withProps")}var o=n(66087);function c(e,t,n={}){return(0,i.createHigherOrderComponent)((r=>class extends l.Component{constructor(){super(...arguments),this.debouncedPropInvoke=(0,o.debounce)(((...t)=>this.props[e](...t)),"function"==typeof t?t(this.props):t,n),this.handler=(e,...t)=>(e&&"function"==typeof e.persist&&e.persist(),this.debouncedPropInvoke(e,...t))}componentWillUnmount(){this.debouncedPropInvoke.cancel()}render(){const t={...this.props,[e]:this.handler};return(0,a.createElement)(r,t)}}),"withDebounceHandler")}function u(e,t){let n;return n=(0,o.isFunction)(t)?[{delay:e,cb:t}]:e,(0,i.createHigherOrderComponent)((e=>class extends l.Component{constructor(){super(...arguments),this.intervalIds=[]}componentDidMount(){for(const e of n)(t=>{this.intervalIds.push(setInterval((()=>t(this.props)),e.delay))})(e.cb)}componentWillUnmount(){this.intervalIds.forEach(clearInterval)}render(){return(0,a.createElement)(e,this.props)}}),"withInterval")}var m=n(64467);(0,i.createHigherOrderComponent)((e=>{var t;return t=class extends l.Component{constructor(...e){super(...e),(0,m.A)(this,"state",{width:1280}),(0,m.A)(this,"mounted",!1),(0,m.A)(this,"ref",null),(0,m.A)(this,"onWindowResize",(()=>{if(!this.mounted)return;const e=(0,l.findDOMNode)(this);if(e instanceof window.HTMLElement){const t=e.offsetWidth;this.setState({width:t})}}))}componentDidMount(){this.mounted=!0,window.addEventListener("resize",this.onWindowResize),document.getElementById("collapse-button").addEventListener("click",this.onWindowResize),this.onWindowResize()}componentWillUnmount(){this.mounted=!1,window.removeEventListener("resize",this.onWindowResize),document.getElementById("collapse-button").removeEventListener("click",this.onWindowResize)}render(){const{measureBeforeMount:t,...n}=this.props;return t&&!this.mounted?(0,a.createElement)("div",{className:this.props.className,style:this.props.style}):(0,a.createElement)(e,(0,r.A)({},n,{width:this.state.width+20}))}},(0,m.A)(t,"defaultProps",{measureBeforeMount:!1}),t}),"withWidth");const d=(0,i.createHigherOrderComponent)((e=>class extends l.Component{constructor(){super(...arguments),(0,m.A)(this,"state",{pressed:{shift:!1,ctrl:!1,meta:!1,alt:!1}}),(0,m.A)(this,"mounted",!1),this.listener=this.listener.bind(this),this.onBlur=this.onBlur.bind(this)}componentDidMount(){this.mounted=!0,window.addEventListener("keydown",this.listener),window.addEventListener("keyup",this.listener),window.addEventListener("click",this.listener),window.addEventListener("blur",this.onBlur)}componentWillUnmount(){this.mounted=!1,window.removeEventListener("keydown",this.listener),window.removeEventListener("keyup",this.listener),window.removeEventListener("click",this.listener),window.removeEventListener("blur",this.onBlur)}listener(e){this.mounted&&this.setState({pressed:{shift:e.shiftKey,ctrl:e.ctrlKey,meta:e.metaKey,alt:e.altKey}})}onBlur(){this.setState({pressed:{shift:!1,ctrl:!1,meta:!1,alt:!1}})}render(){return(0,a.createElement)(e,(0,r.A)({pressedModifierKeys:this.state.pressed},this.props))}}),"withPressedModifierKeys"),p=(0,i.createHigherOrderComponent)((e=>function({navigate:t,...n}){return(0,a.createElement)(e,(0,r.A)({},n,{onClick:e=>{try{n.onClick&&n.onClick(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||n.target&&"_self"!==n.target||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),t())}}))}),"withNavigate"),g=new WeakMap;function h(e,t){(0,l.useLayoutEffect)((()=>{g.has(e)||(t(),g.set(e,!0))}),[])}function E(e,t=!0){const[n,r]=(0,l.useState)("idle"),[a,i]=(0,l.useState)(null),[s,o]=(0,l.useState)(null),c=(0,l.useCallback)(((...t)=>(r("pending"),o(null),e(...t).then((e=>{i(e),r("success")})).catch((e=>{o(e),i(null),r("error")})))),[e]);return(0,l.useEffect)((()=>{t&&c()}),[c,t]),{execute:c,status:n,value:a,error:s}}function f(e,t,n=window){const r=(0,l.useRef)();(0,l.useEffect)((()=>{r.current=t}),[t]),(0,l.useEffect)((()=>{if(!n||!n.addEventListener)return;const t=e=>r.current(e);return n.addEventListener(e,t),()=>n.removeEventListener(e,t)}),[e,n])}const y=["button","submit"];function _(e){const t=(0,l.useRef)(e);(0,l.useEffect)((()=>{t.current=e}),[e]);const n=(0,l.useRef)(!1),r=(0,l.useRef)(),a=(0,l.useCallback)((()=>{clearTimeout(r.current)}),[]);(0,l.useEffect)((()=>()=>a()),[]),(0,l.useEffect)((()=>{e||a()}),[e,a]);const i=(0,l.useCallback)((e=>{const{type:t,target:r}=e;(0,o.includes)(["mouseup","touchend"],t)?n.current=!1:function(e){if(!(e instanceof window.HTMLElement))return!1;switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return(0,o.includes)(y,e.type)}return!1}(r)&&(n.current=!0)}),[]),s=(0,l.useCallback)((e=>{e.persist(),n.current||(r.current=setTimeout((()=>{document.hasFocus()?"function"==typeof t.current&&t.current(e):e.preventDefault()}),0))}),[]);return{onFocus:a,onMouseDown:i,onMouseUp:i,onTouchStart:i,onTouchEnd:i,onBlur:s}}function v(e,t){const[n,r]=(0,l.useState)((()=>{try{const n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return console.error(e),t}}));return[n,t=>{try{const a=t instanceof Function?t(n):t;r(a),window.localStorage.setItem(e,JSON.stringify(a))}catch(e){console.error(e)}}]}function x(e){const t=(0,l.useRef)(null),n=(0,l.useRef)(!1),r=(0,l.useRef)(e),a=(0,l.useRef)(e);return a.current=e,(0,l.useLayoutEffect)((()=>{e.forEach(((e,a)=>{const l=r.current[a];"function"==typeof e&&e!==l&&!1===n.current&&(l(null),e(t.current))})),r.current=e}),e),(0,l.useLayoutEffect)((()=>{n.current=!1})),(0,l.useCallback)((e=>{t.current=e,n.current=!0,(e?a.current:r.current).forEach((t=>{"function"==typeof t?t(e):t&&t.hasOwnProperty("current")&&(t.current=e)}))}),[])}n(31987),n(46627)}},e=>{e.O(0,[9427,9787,8356,222,3733,8363,1321,5152,4400,1588,8620],(()=>e(e.s=63718)));var t=e.O();((window.itsec=window.itsec||{}).pages=window.itsec.pages||{}).firewall=t}]);