Plugin Directory

Changeset 3748178


Ignore:
Timestamp:
10/15/2026 10:23:45 AM (3 weeks ago)
Author:
teydeastudio
Message:

Deploy password-requirements 3.9.0

Location:
password-requirements
Files:
20 added
4 deleted
106 edited
1 copied

Legend:

Unmodified
Added
Removed
  • password-requirements/tags/3.9.0/build/password-hint-positioning/index.asset.php

    r3669586 r3748178  
    1 <?php return array('dependencies' => array(), 'version' => '24655f9c6f679144a629');
     1<?php return array(
     2        'dependencies' => array(
     3               
     4        ),
     5        'version' => '24655f9c6f679144a629'
     6);
  • password-requirements/tags/3.9.0/build/settings-page/index.asset.php

    r3669586 r3748178  
    1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'eaaef3828250d7cd6c1f');
     1<?php return array(
     2        'dependencies' => array(
     3                'react-jsx-runtime',
     4                'wp-a11y',
     5                'wp-api-fetch',
     6                'wp-components',
     7                'wp-compose',
     8                'wp-element',
     9                'wp-hooks',
     10                'wp-i18n',
     11                'wp-primitives',
     12                'wp-url'
     13        ),
     14        'version' => 'dc161bd61009694eeba6'
     15);
  • password-requirements/tags/3.9.0/build/settings-page/index.js

    r3669586 r3748178  
    1 (()=>{var e={694(e,s,t){"use strict";var r=t(925);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,s,t,a,i,n){if(n!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function s(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:s,element:e,elementType:e,instanceOf:s,node:e,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:i,resetWarningCache:a};return t.PropTypes=t,t}},556(e,s,t){e.exports=t(694)()},925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const s={};function t(r){const a=s[r];if(void 0!==a)return a.exports;const i=s[r]={exports:{}};return e[r](i,i.exports,t),i.exports}t.n=e=>{const s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},t.d=(e,s)=>{if(Array.isArray(s))for(var r=0;r<s.length;){var a=s[r++],i=s[r++];t.o(e,a)?0===i&&r++:0===i?Object.defineProperty(e,a,{enumerable:!0,value:s[r++]}):Object.defineProperty(e,a,{enumerable:!0,get:i})}else for(var a in s)t.o(s,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:s[a]})},t.o=(e,s)=>Object.hasOwn(e,s),(()=>{"use strict";const e=window.wp.element;var s=t(556),r=t.n(s);const a=window.wp.i18n,i=window.wp.primitives,n=window.ReactJSXRuntime,l=({slug:e})=>{const s=`ts-product-icon-${e}`;switch(e){case"bm-custom-login":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#ffe8db",d:"M372.367 0h-232.73C62.517 0 0 62.518 0 139.637v232.73c0 77.119 62.518 139.637 139.637 139.637h232.73c77.119 0 139.637-62.518 139.637-139.637v-232.73C512.004 62.517 449.486 0 372.367 0"}),(0,n.jsx)(i.Path,{fill:"#ffd7c1",d:"M170.66 426.662a85.41 85.41 0 0 1-85.318-85.318V170.66a85.41 85.41 0 0 1 85.318-85.318h170.684a85.41 85.41 0 0 1 85.318 85.318v170.684a85.41 85.41 0 0 1-85.318 85.318z"}),(0,n.jsx)(i.Path,{fill:"#ff9e68",d:"M192.001 384.003a64.06 64.06 0 0 1-45.234-18.766 64.07 64.07 0 0 1-18.766-45.235V192.001a64.06 64.06 0 0 1 18.766-45.234 64.06 64.06 0 0 1 45.234-18.766h128.001a64.07 64.07 0 0 1 45.235 18.766 64.06 64.06 0 0 1 18.766 45.234v128.001a64.07 64.07 0 0 1-18.766 45.235 64.07 64.07 0 0 1-45.235 18.766z"}),(0,n.jsx)(i.Path,{fill:"#dd3814",d:"M257.306 327.543a10.65 10.65 0 0 1-3.125-7.54 10.67 10.67 0 0 1 3.125-7.541l48.896-48.919a10.68 10.68 0 0 0 0-15.081l-48.896-48.92a10.662 10.662 0 0 1 7.54-18.204c2.829 0 5.541 1.123 7.541 3.123l48.896 48.92a32.02 32.02 0 0 1 0 45.242l-48.896 48.92c-4.189 4.189-10.915 4.189-15.081 0"}),(0,n.jsx)(i.Path,{fill:"#dd3814",d:"M319.887 266.661H85.343a10.65 10.65 0 0 1-9.848-6.58 10.657 10.657 0 0 1 5.769-13.926 10.7 10.7 0 0 1 4.079-.812h234.544a10.65 10.65 0 0 1 7.537 3.122 10.67 10.67 0 0 1 3.122 7.537 10.67 10.67 0 0 1-3.122 7.537 10.67 10.67 0 0 1-7.537 3.122"}),(0,n.jsx)(i.Path,{fill:"#dd3814",d:"M341.344 437.345H170.661a96.12 96.12 0 0 1-96-96.001 10.67 10.67 0 1 1 21.34 0 74.753 74.753 0 0 0 74.66 74.659h170.683a74.755 74.755 0 0 0 74.66-74.659V170.66A74.755 74.755 0 0 0 341.344 96H170.661a74.753 74.753 0 0 0-74.66 74.66 10.672 10.672 0 0 1-18.216 7.546 10.67 10.67 0 0 1-3.125-7.546 96.117 96.117 0 0 1 96.001-96h170.683a96.116 96.116 0 0 1 96.001 96v170.684a96.12 96.12 0 0 1-96.001 96.001"})]})});case"careers":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 256 256",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsxs)(i.G,{clipPath:(0,a.sprintf)("url(#%s-a)",s),children:[(0,n.jsx)(i.Rect,{fill:"#fff",height:"256",rx:"10.24",width:"256"}),(0,n.jsx)(i.Path,{d:"M0 0h256v256H0z",fill:"#AD1735",fillOpacity:".05"}),(0,n.jsx)(i.Path,{d:"M130.289 201.349c-14.461 0-27.185-3.062-38.172-9.188-10.988-6.188-19.576-14.776-25.764-25.763-6.189-10.988-9.283-23.744-9.283-38.267 0-10.988 1.8-21.06 5.4-30.216 3.599-9.156 8.682-17.081 15.25-23.775 6.63-6.693 14.428-11.871 23.395-15.534 9.03-3.662 18.975-5.494 29.837-5.494 7.83 0 15.628 1.01 23.396 3.032 7.767 1.957 14.713 4.799 20.838 8.524h.758l8.146-9.567h5.683v45.845h-8.904c-1.263-3.347-2.589-6.44-3.978-9.282-1.326-2.842-2.779-5.431-4.357-7.768-4.357-6.756-9.535-11.713-15.534-14.87-5.999-3.221-12.914-4.831-20.744-4.831-14.461 0-25.385 5.21-32.773 15.629-7.325 10.356-10.988 25.826-10.988 46.412 0 20.712 3.663 36.531 10.988 47.455 7.388 10.861 18.06 16.292 32.015 16.292 7.704 0 14.65-1.674 20.839-5.02 6.251-3.347 11.461-8.083 15.628-14.208 2.211-3.095 4.105-6.599 5.684-10.514 1.641-3.978 2.873-8.272 3.694-12.882h8.43v52.001h-7.009l-7.578-12.313c-7.325 4.988-14.587 8.619-21.786 10.892-7.135 2.274-14.839 3.41-23.111 3.41Z",fill:"#AD1735"})]}),(0,n.jsx)("defs",{children:(0,n.jsx)("clipPath",{id:(0,a.sprintf)("%s-a",s),children:(0,n.jsx)(i.Rect,{fill:"#fff",height:"256",rx:"10.24",width:"256"})})})]})});case"hiring-center":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#ffe2f7",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,n.jsx)(i.Path,{fill:"#ffd8f4",d:"m373.482 366.755-34.048-5.539-3.258.07-7.633.558c-8.611-13.335-14.173-32.186-39.611-44.73l-15.755-7.773c5.934-5.958 36.212-18.525 36.212-53.341a53.38 53.38 0 0 0-15.637-37.704 53.38 53.38 0 0 0-37.704-15.637A53.385 53.385 0 0 0 202.707 256c0 34.932 30.045 47.127 36.212 53.341l-15.755 7.773c-29.114 14.336-36.399 41.658-38.168 44.521l-9.728-.745c-5.678.768-41.588 6.33-39.796 6.051a21.48 21.48 0 0 1-18.595-10.636l-17.291-29.952a21.39 21.39 0 0 1 1.978-24.157l21.667-26.601a21.4 21.4 0 0 0 4.817-13.475v-12.241a21.5 21.5 0 0 0-4.817-13.498L101.54 209.78a21.39 21.39 0 0 1-1.931-24.157l17.268-29.929a21.51 21.51 0 0 1 18.618-10.659l37.144 5.749a20.95 20.95 0 0 0 14.056-2.56l10.659-6.144a21.57 21.57 0 0 0 9.286-10.892l12.148-32.093a21.49 21.49 0 0 1 19.968-13.754h34.584c8.797 0 16.803 5.516 19.944 13.73l12.195 32.164a21.42 21.42 0 0 0 9.263 10.845l10.612 6.12a20.95 20.95 0 0 0 14.01 2.584l37.26-5.772c7.657 0 14.755 4.096 18.572 10.659l17.291 29.975a21.39 21.39 0 0 1-1.978 24.157l-21.643 26.601a21.34 21.34 0 0 0-4.818 13.475v12.241c0 4.888 1.699 9.705 4.794 13.499l21.714 26.6c5.585 6.796 6.353 16.524 1.931 24.157l-17.291 29.929a21.48 21.48 0 0 1-18.549 10.682z"}),(0,n.jsx)(i.Path,{fill:"#ffd0f2",d:"M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,n.jsx)(i.Path,{fill:"#ffb8dd",d:"M238.774 426.658a21.435 21.435 0 0 1-19.968-13.731l-12.195-32.163a21.5 21.5 0 0 0-9.262-10.845l-12.94-7.494c1.699-2.117 16.384-53.085 71.634-53.085 55.296 0 69.934 50.968 71.633 53.109l-12.94 7.447a21.55 21.55 0 0 0-9.262 10.938l-12.195 32.093a21.432 21.432 0 0 1-19.945 13.731z"}),(0,n.jsx)(i.Path,{fill:"#ffb8dd",d:"M256.001 309.341a53.342 53.342 0 1 0 0-106.684 53.342 53.342 0 0 0 0 106.684"}),(0,n.jsx)(i.Path,{fill:"#ea1e87",d:"M256 320a64.06 64.06 0 0 1-45.234-18.766A64.06 64.06 0 0 1 192 256a64.06 64.06 0 0 1 18.766-45.234A64.06 64.06 0 0 1 256 192a64.06 64.06 0 0 1 45.234 18.766A64.06 64.06 0 0 1 320 256a64.06 64.06 0 0 1-18.766 45.234A64.06 64.06 0 0 1 256 320m0-106.659A42.707 42.707 0 0 0 213.341 256c0 23.505 19.13 42.659 42.659 42.659A42.707 42.707 0 0 0 298.659 256c0-23.505-19.13-42.659-42.659-42.659"}),(0,n.jsx)(i.Path,{fill:"#ea1e87",d:"M327.379 373.714a10.68 10.68 0 0 1-10.24-7.68A63.374 63.374 0 0 0 256.071 320a63.37 63.37 0 0 0-61.091 46.034 10.66 10.66 0 0 1-9.088 7.596 10.66 10.66 0 0 1-10.496-5.489 10.67 10.67 0 0 1-.873-8.112 84.55 84.55 0 0 1 81.548-61.37c37.981 0 70.749 24.669 81.524 61.393a10.657 10.657 0 0 1-10.24 13.662z"}),(0,n.jsx)(i.Path,{fill:"#ea1e87",d:"M273.322 437.341h-34.583a32.18 32.18 0 0 1-29.906-20.643l-12.195-32.116a10.77 10.77 0 0 0-4.654-5.446l-10.589-6.121a11 11 0 0 0-7.029-1.28l-33.908 5.492a32.11 32.11 0 0 1-32.815-15.592l-17.291-29.952a32.17 32.17 0 0 1 2.909-36.236l21.69-26.601a10.68 10.68 0 0 0 2.42-6.726v-12.241a10.75 10.75 0 0 0-2.42-6.749l-21.69-26.577a32.19 32.19 0 0 1-2.91-36.236l17.292-29.952a31.93 31.93 0 0 1 32.815-15.593l33.885 5.493a10.83 10.83 0 0 0 7.052-1.28l10.612-6.121a10.76 10.76 0 0 0 4.655-5.493l12.171-32.07c4.678-12.334 16.71-20.642 29.906-20.642h34.583c13.196 0 25.228 8.308 29.929 20.643l12.171 32.116a10.78 10.78 0 0 0 4.655 5.446l10.589 6.121c2.141 1.233 4.654 1.652 7.028 1.28l33.909-5.493c13.032-2.094 26.228 4.143 32.814 15.593l17.292 29.952a32.165 32.165 0 0 1-2.909 36.236l-21.69 26.6a10.66 10.66 0 0 0-2.421 6.726v12.241a10.7 10.7 0 0 0 2.421 6.75l21.69 26.6c8.355 10.24 9.542 24.786 2.909 36.213l-17.292 29.975a31.905 31.905 0 0 1-32.814 15.593l-33.885-5.516a10.9 10.9 0 0 0-7.052 1.303l-10.612 6.121a10.77 10.77 0 0 0-4.655 5.469l-12.148 32.093c-4.701 12.335-16.733 20.62-29.929 20.62m-97.28-87.063c5.585 0 11.148 1.443 16.035 4.282l10.589 6.12a32.3 32.3 0 0 1 13.917 16.315l12.172 32.116c1.559 4.119 5.585 6.889 9.984 6.889h34.583c4.422 0 8.425-2.793 9.984-6.866l12.172-32.116a32.24 32.24 0 0 1 13.917-16.338l10.612-6.12a31.88 31.88 0 0 1 21.132-3.863L375 356.189c4.422.651 8.751-1.397 10.939-5.213l17.291-29.952a10.7 10.7 0 0 0 1.396-6.187 10.7 10.7 0 0 0-2.35-5.892l-21.713-26.601a32.1 32.1 0 0 1-7.215-20.224v-12.241c0-7.331 2.56-14.522 7.215-20.224l21.69-26.601a10.68 10.68 0 0 0 .977-12.078l-17.291-29.952A10.8 10.8 0 0 0 375 155.811l-33.885 5.492a31.6 31.6 0 0 1-21.131-3.863l-10.589-6.121a32.16 32.16 0 0 1-13.917-16.314l-12.172-32.116a10.76 10.76 0 0 0-9.984-6.89h-34.583c-4.422 0-8.425 2.794-9.984 6.866l-12.172 32.117a32.2 32.2 0 0 1-13.917 16.337l-10.612 6.121c-6.354 3.723-13.848 5.12-21.132 3.863l-33.839-5.492a10.82 10.82 0 0 0-10.938 5.213l-17.291 29.952a10.705 10.705 0 0 0 .954 12.078l21.713 26.601a32.1 32.1 0 0 1 7.215 20.224v12.241c0 7.331-2.56 14.523-7.215 20.224l-21.69 26.624a10.68 10.68 0 0 0-.977 12.056l17.291 29.952c2.188 3.816 6.517 5.818 10.938 5.213l33.885-5.492a30 30 0 0 1 5.12-.419z"}),(0,n.jsx)(i.Path,{fill:"#ffd0f2",d:"M234.148 277.32a4.45 4.45 0 1 1 6.294-6.295c4.202 4.201 9.789 6.522 15.721 6.522a22.12 22.12 0 0 0 15.747-6.522 4.446 4.446 0 0 1 6.288 6.288c-5.883 5.883-13.709 9.124-22.035 9.13a30.94 30.94 0 0 1-22.015-9.123"})]})});case"password-requirements":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"102 94 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#e2edfd",d:"M474.364 94H241.636C164.517 94 102 156.517 102 233.636v232.728C102 543.483 164.517 606 241.636 606h232.728C551.483 606 614 543.483 614 466.364V233.636C614 156.517 551.483 94 474.364 94"}),(0,n.jsx)(i.Path,{fill:"#cfdefa",d:"M358.001 520.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,n.jsx)(i.Path,{fill:"#e2edfd",d:"M409.281 332.536c21.887-34.435 16.488-77.187-10.359-104.035-32.247-32.247-84.484-32.247-116.73 0-20.866 20.865-28.745 50.631-21.158 79.522l-61.866 61.867a15.46 15.46 0 0 0-4.524 10.943v36.478c0 8.463 7.004 15.467 15.467 15.467h31.809c6.712 0 12.694-4.232 14.737-10.652 0 0 3.648-10.943 3.794-11.089l1.167-.292.438-.438 20.282-6.566 7.295-21.887 21.887-7.295 8.025-8.025c34.873 9.192 70.038-4.086 89.882-33.852zm-68.724-45.67c-8.026-8.026-8.026-21.158 0-29.183s21.157-8.025 29.182 0 8.025 21.157 0 29.183-21.157 8.025-29.182 0"}),(0,n.jsx)(i.Path,{fill:"#99c7ff",d:"M501.06 272.266c-36.478-36.478-81.711-20.136-85.213-20.136.875 5.837 16.926 36.186-3.502 75.875l-.292-.292c-32.246 56.176-89.882 38.521-92.508 38.812l-7.879 7.88-21.887 7.295-7.296 21.887-21.887 7.296 94.843 94.843c8.025 8.025 21.157 8.025 29.183 0l116.73-116.73c32.246-32.247 32.246-84.483-.001-116.73zm-58.365 58.365c-8.025-8.025-8.025-21.157 0-29.183s21.157-8.025 29.182 0 8.025 21.158 0 29.183-21.157 8.025-29.182 0"}),(0,n.jsx)(i.Path,{fill:"#3140d7",d:"M184.431 417.311v-36.478c0-7.004 2.626-13.424 7.441-18.239l57.927-57.927c-5.982-30.204 3.356-61.721 25.097-83.462 36.186-36.186 95.135-36.186 131.321 0s36.186 95.135 0 131.321c-21.741 21.741-53.258 31.079-83.462 25.097l-4.085 4.085c-1.167 1.168-2.481 1.897-3.94 2.481l-17.072 5.691-5.69 17.071c-1.022 3.064-3.502 5.545-6.566 6.566l-17.072 5.691-2.043 6.42c-3.502 10.506-13.278 17.655-24.367 17.655h-31.809c-14.299 0-25.826-11.527-25.826-25.826zm207.195-181.515c-28.161-28.161-73.978-28.161-102.139 0-18.239 18.239-25.097 44.066-18.385 69.454.876 3.502 0 7.296-2.626 9.922l-61.867 61.867c-1.021 1.022-1.459 2.335-1.605 3.648v36.478c0 2.918 2.335 5.253 5.107 5.107h31.809c2.335 0 4.231-1.313 4.961-3.502l3.794-11.381c1.021-3.064 3.502-5.545 6.566-6.566l17.071-5.691 5.691-17.071c1.021-3.065 3.502-5.545 6.566-6.566l19.552-6.421 6.42-6.42c2.627-2.626 6.275-3.648 9.923-2.626 25.388 6.712 51.361-.292 69.454-18.385 28.161-28.161 28.161-73.978 0-102.139z"}),(0,n.jsx)(i.Path,{fill:"#3140d7",d:"m347.85 513.026-94.843-94.842c-4.086-4.086-4.086-10.506 0-14.592 4.085-4.085 10.505-4.085 14.591 0l94.843 94.843c4.085 4.086 10.505 4.086 14.591 0l116.73-116.73c28.015-28.015 28.453-73.685 0-102.138-19.698-19.698-48.297-26.118-74.853-16.78-5.399 1.897-11.235-1.021-13.132-6.42s1.021-11.235 6.42-13.132c33.997-11.819 70.913-3.502 96.156 21.741 36.478 36.478 36.04 95.28 0 131.321l-116.73 116.729c-12.11 12.111-31.663 12.111-43.773 0"}),(0,n.jsx)(i.Path,{fill:"#3140d7",d:"M333.262 294.161c-12.111-12.111-12.111-31.663 0-43.774 12.11-12.11 31.663-12.11 43.773 0 12.111 12.111 12.111 31.663 0 43.774-12.11 12.111-31.663 12.111-43.773 0m29.182-29.182c-4.085-4.086-10.506-4.086-14.591 0-4.086 4.085-4.086 10.505 0 14.591 4.085 4.085 10.506 4.085 14.591 0 4.086-4.086 4.086-10.506 0-14.591M435.4 337.935c-12.11-12.111-12.11-31.663 0-43.774 12.111-12.11 31.663-12.11 43.774 0 12.111 12.111 12.111 31.663 0 43.774s-31.663 12.111-43.774 0m29.183-29.183c-4.086-4.085-10.506-4.085-14.592 0-4.085 4.086-4.085 10.506 0 14.592 4.086 4.085 10.506 4.085 14.592 0 4.085-4.086 4.085-10.506 0-14.592"}),(0,n.jsx)(i.Path,{fill:"#3140d7",d:"M354.125 285.551c-3.21-4.669-2.335-11.089 2.481-14.445 4.669-3.21 11.089-2.335 14.445 2.481 3.94 4.523 12.986 23.783 37.791 34.289 12.257 5.253 26.118 7.15 39.98 5.253 5.691-.73 10.798 3.21 11.673 8.754.73 5.691-3.064 10.944-8.755 11.673-17.655 2.481-35.164.146-50.777-6.712-30.642-13.132-42.461-36.623-46.546-41.293z"})]})});case"password-reset-enforcement":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#f3d9ff",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,n.jsx)(i.Path,{fill:"#efceff",d:"M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"M369.151 384.234a10.67 10.67 0 0 1-2.321-11.641 10.7 10.7 0 0 1 2.321-3.463 158.97 158.97 0 0 0 46.848-113.129c0-88.437-71.563-160-160-160a10.67 10.67 0 1 1 0-21.341 181.23 181.23 0 0 1 167.569 111.926 181.2 181.2 0 0 1 13.772 69.415c0 48.43-18.85 93.975-53.108 128.233a10.665 10.665 0 0 1-15.081 0m-113.152 53.108a181.226 181.226 0 0 1-181.34-181.341c0-48.431 18.85-93.975 53.131-128.21a10.67 10.67 0 0 1 7.54-3.123 10.66 10.66 0 0 1 9.852 6.583 10.66 10.66 0 0 1-2.311 11.621 158.93 158.93 0 0 0-46.872 113.152 159.88 159.88 0 0 0 46.837 113.156 159.9 159.9 0 0 0 113.163 46.821 10.67 10.67 0 1 1 0 21.341"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"m165.691 120.016-2.232 42.601a10.66 10.66 0 0 1-21.289-1.116l1.675-31.956-31.956-1.675a10.671 10.671 0 0 1 1.116-21.312l42.601 2.233a10.65 10.65 0 0 1 9.495 7.103c.466 1.322.667 2.723.59 4.122M351.93 388.426l-.744-42.652a10.659 10.659 0 0 1 21.314-.372l.559 31.995 31.995-.558a10.67 10.67 0 0 1 10.855 10.482 10.67 10.67 0 0 1-10.482 10.855l-42.653.745a10.673 10.673 0 0 1-9.968-6.423 10.7 10.7 0 0 1-.876-4.072"}),(0,n.jsx)(i.Path,{fill:"#f5dfff",d:"M308.137 143.792a10.67 10.67 0 0 1-15.09 15.091c-10.072-10.072-23.467-15.634-37.685-15.634a52.99 52.99 0 0 0-37.751 15.634 10.66 10.66 0 0 1-15.074 0 10.66 10.66 0 0 1 0-15.074c14.103-14.103 32.863-21.871 52.825-21.887a74.17 74.17 0 0 1 52.775 21.87M203.546 367.89a10.671 10.671 0 1 1 15.09-15.09c10.071 10.071 23.467 15.634 37.685 15.634a52.997 52.997 0 0 0 37.751-15.634 10.659 10.659 0 1 1 15.074 15.074c-14.103 14.103-32.863 21.87-52.825 21.887a74.17 74.17 0 0 1-52.775-21.871"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"M255.492 299.997a10.993 10.993 0 0 1-10.992-10.992v-66a10.98 10.98 0 0 1 3.219-7.773 11 11 0 0 1 7.773-3.219 11 11 0 0 1 7.773 3.219 11 11 0 0 1 3.219 7.773v66a10.99 10.99 0 0 1-10.992 10.992"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"m277.33 281.946-55.008-33a11.02 11.02 0 0 1-5.01-6.768 11.005 11.005 0 0 1 8.01-13.339 11 11 0 0 1 8.328 1.243l55.008 33a11 11 0 0 1 5.011 6.767 11.005 11.005 0 0 1-8.01 13.339 11 11 0 0 1-8.329-1.242"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"M218.558 278.18a10.99 10.99 0 0 1 3.768-15.096l55.008-33a11 11 0 0 1 12.211.59 11 11 0 0 1 4.335 7.219 11.01 11.01 0 0 1-5.218 11.055l-55.008 33a10.99 10.99 0 0 1-12.212-.587 11 11 0 0 1-2.884-3.181m124.944 21.816a11 11 0 0 1-7.788-3.211 11 11 0 0 1-3.228-7.781v-66a11.004 11.004 0 1 1 22.008 0v66c0 2.915-1.158 5.711-3.219 7.773a11 11 0 0 1-7.773 3.219"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"m365.338 281.946-55.008-33a11.001 11.001 0 0 1 11.328-18.864l54.984 33a11 11 0 0 1 3.179 2.881 10.99 10.99 0 0 1-2.28 15.382 10.99 10.99 0 0 1-12.203.601"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"M306.564 278.18a10.985 10.985 0 0 1 .587-12.212 11 11 0 0 1 3.181-2.884l55.008-33a11.005 11.005 0 0 1 16.339 12.096 11.007 11.007 0 0 1-5.011 6.768l-55.008 33a10.992 10.992 0 0 1-15.12-3.768zm-139.08 21.816a10.983 10.983 0 0 1-10.155-6.786 11 11 0 0 1-.837-4.206v-66A11.01 11.01 0 0 1 167.496 212a11 11 0 0 1 11.004 11.004v66a10.99 10.99 0 0 1-6.802 10.162 11 11 0 0 1-4.214.83"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"m189.328 281.952-54.984-33a11 11 0 0 1-3.179-2.881 10.99 10.99 0 0 1 2.28-15.382 10.99 10.99 0 0 1 12.203-.601l55.008 33a11.02 11.02 0 0 1 5.01 6.768c.35 1.402.421 2.859.207 4.288a10.99 10.99 0 0 1-4.335 7.219 11 11 0 0 1-8.17 2.039 11 11 0 0 1-4.04-1.45"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"M130.574 278.178a11 11 0 0 1-1.247-8.33 10.98 10.98 0 0 1 5.015-6.766l54.984-33a11 11 0 0 1 8.328-1.243 11 11 0 0 1 6.768 5.011 11.005 11.005 0 0 1-3.768 15.096l-55.008 33a10.993 10.993 0 0 1-15.072-3.768"})]})});case"stalepilot":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#dafbf0",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,n.jsx)(i.Path,{fill:"#b9f3df",d:"M256.274 426.658a170.66 170.66 0 0 0 170.659-170.659 170.66 170.66 0 1 0-170.659 170.659"}),(0,n.jsx)(i.Path,{fill:"#b9f3df",d:"M389.747 382.787c-17.58-31.623-17.026-58.92-16.749-72.025V295.1H138.513v15.343c.213 12.252.703 40.913-16.791 72.365-7.246 13.105 1.363 29.492 16.706 29.492h234.634c15.322 0 23.994-16.408 16.685-29.513"}),(0,n.jsx)(i.Path,{fill:"#8ae7bc",d:"M138.574 295.1a19.562 19.562 0 0 1-19.541-19.52v-19.54a58.664 58.664 0 0 1 58.6-58.6h156.281a58.664 58.664 0 0 1 58.6 58.6v19.54a19.543 19.543 0 0 1-19.54 19.52z"}),(0,n.jsx)(i.Path,{fill:"#8ae7bc",d:"M285.074 90h-58.6v117.2h58.6z"}),(0,n.jsx)(i.Path,{fill:"#0e9f6e",d:"M372.973 304.88h-234.4a29.32 29.32 0 0 1-29.3-29.3v-19.54a68.45 68.45 0 0 1 68.36-68.36h156.281a68.446 68.446 0 0 1 68.359 68.36v19.54c0 16.152-13.147 29.3-29.3 29.3m-195.34-97.681a48.884 48.884 0 0 0-48.819 48.841v19.54a9.8 9.8 0 0 0 9.759 9.76h234.4a9.783 9.783 0 0 0 9.76-9.76v-19.54a48.886 48.886 0 0 0-48.819-48.841z"}),(0,n.jsx)(i.Path,{fill:"#0e9f6e",d:"M373.101 422.08H138.467c-22.418 0-36.29-24.058-25.23-44.024 10.207-18.326 15.577-39.103 15.577-60.071v-22.886a9.77 9.77 0 0 1 2.861-6.908 9.76 9.76 0 0 1 6.909-2.862 9.773 9.773 0 0 1 9.77 9.77v22.886a143.4 143.4 0 0 1-18.049 69.553c-3.708 6.691.362 15.002 8.162 15.002H373.08c7.778 0 11.911-8.289 8.161-15.002a143.47 143.47 0 0 1-18.027-69.553v-22.886a9.77 9.77 0 1 1 19.54 0v22.886c0 20.968 5.37 41.745 15.556 60.049 11.08 19.988-2.792 44.046-25.209 44.046"}),(0,n.jsx)(i.Path,{fill:"#0e9f6e",d:"M197.173 363.48a9.75 9.75 0 0 1-6.909-2.866 9.76 9.76 0 0 1-2.851-6.915v-58.6a9.757 9.757 0 0 1 9.76-9.759 9.76 9.76 0 0 1 9.759 9.759v58.6a9.74 9.74 0 0 1-2.851 6.915 9.752 9.752 0 0 1-6.908 2.866m78.14-19.54a9.78 9.78 0 0 1-6.915-2.851 9.757 9.757 0 0 1-2.866-6.909v-39.081a9.77 9.77 0 0 1 19.541 0v39.081a9.76 9.76 0 0 1-9.76 9.76m58.6 39.059a9.75 9.75 0 0 1-9.036-6.02 9.8 9.8 0 0 1-.745-3.739v-78.141a9.77 9.77 0 0 1 19.541 0v78.141a9.763 9.763 0 0 1-9.76 9.759m-107.44-175.8a9.76 9.76 0 0 1-9.76-9.759V99.78a9.757 9.757 0 0 1 9.76-9.76 9.76 9.76 0 0 1 9.759 9.76v97.66a9.76 9.76 0 0 1-9.759 9.759m58.6 0a9.76 9.76 0 0 1-9.76-9.759V99.78a9.757 9.757 0 0 1 9.76-9.76 9.76 9.76 0 0 1 9.759 9.76v97.66a9.76 9.76 0 0 1-9.759 9.759"})]})});case"teydea-pattern-library":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#fff5e6",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,n.jsx)(i.Path,{fill:"#ffe6c0",d:"M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,n.jsx)(i.Path,{fill:"#ffd18c",d:"M405.689 331h-21.341v-21.341a21.34 21.34 0 0 0-21.33-20.636 21.34 21.34 0 0 0-21.329 20.636V331h-21.341a21.365 21.365 0 0 0 0 42.659h21.341V395a21.36 21.36 0 0 0 21.329 20.144A21.36 21.36 0 0 0 384.348 395v-21.341h21.341A21.362 21.362 0 0 0 420 337.661 21.36 21.36 0 0 0 405.689 331M405.683 117.659H107.001A21.37 21.37 0 0 0 86.633 139a21.363 21.363 0 0 0 20.368 21.341h298.682a21.34 21.34 0 1 0 0-42.682M299.001 224.341h-192a21.344 21.344 0 0 0-20.637 21.33A21.34 21.34 0 0 0 107.001 267h192a21.34 21.34 0 0 0 20.636-21.329 21.343 21.343 0 0 0-20.636-21.33M213.683 331H107.001a21.366 21.366 0 0 0-14.312 35.999 21.37 21.37 0 0 0 14.312 6.66h106.682a21.34 21.34 0 0 0 20.636-21.329A21.34 21.34 0 0 0 213.683 331"}),(0,n.jsx)(i.Path,{fill:"#f89500",d:"M405.682 171H107a32.026 32.026 0 0 1-32-32c0-17.641 14.36-32 32-32h298.682c17.641 0 32 14.359 32 32s-14.359 32-32 32M107 128.341A10.685 10.685 0 0 0 97.023 139 10.68 10.68 0 0 0 107 149.659h298.682A10.685 10.685 0 0 0 415.66 139a10.68 10.68 0 0 0-9.978-10.659zm192 149.318H107a32.026 32.026 0 0 1-32-32c0-17.641 14.36-32 32-32h192a32.025 32.025 0 0 1 0 64M107 235a10.68 10.68 0 0 0-7.23 18.046 10.68 10.68 0 0 0 7.23 3.295h192a10.68 10.68 0 0 0 10.184-10.67A10.683 10.683 0 0 0 299 235zm106.682 149.341H107a32.02 32.02 0 0 1-32-32c0-17.664 14.36-32 32-32h106.682a32.023 32.023 0 0 1 0 64M107 341.659a10.68 10.68 0 0 0-7.23 18.046A10.68 10.68 0 0 0 107 363h106.682a10.68 10.68 0 0 0 10.184-10.671 10.68 10.68 0 0 0-10.184-10.67zM363 427a32.03 32.03 0 0 1-22.621-9.379A32.03 32.03 0 0 1 331 395v-10.659h-10.659a32.05 32.05 0 0 1-32-32c0-17.664 14.359-32 32-32H331v-10.682a32.025 32.025 0 0 1 64 0v10.682h10.682a32.023 32.023 0 0 1 0 64H395V395c0 17.641-14.336 32-32 32m-42.659-85.341a10.68 10.68 0 0 0-10.184 10.67A10.68 10.68 0 0 0 320.341 363h21.341c5.888 0 10.659 4.771 10.659 10.659V395a10.68 10.68 0 0 0 3.296 7.229 10.68 10.68 0 0 0 14.75 0 10.68 10.68 0 0 0 3.295-7.229v-21.341c0-5.888 4.771-10.659 10.659-10.659h21.341a10.68 10.68 0 0 0 10.184-10.671 10.68 10.68 0 0 0-10.184-10.67h-21.341A10.66 10.66 0 0 1 373.682 331v-21.341a10.68 10.68 0 0 0-10.67-10.184 10.68 10.68 0 0 0-7.375 2.955 10.68 10.68 0 0 0-3.296 7.229V331a10.66 10.66 0 0 1-10.659 10.659z"})]})})}return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 256 256",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsxs)(i.G,{clipPath:(0,a.sprintf)("url(#%s-a)",s),children:[(0,n.jsx)("mask",{height:"256",id:(0,a.sprintf)("%s-b",s),maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},width:"256",x:"0",y:"0",children:(0,n.jsx)(i.Path,{d:"M0 0h256v256H0z",fill:"#fff"})}),(0,n.jsxs)(i.G,{mask:(0,a.sprintf)("url(#%s-b)",s),children:[(0,n.jsx)(i.Rect,{fill:"#FCEBD8",height:"256",rx:"10.24",width:"256",x:"-.296"}),(0,n.jsxs)(i.G,{clipPath:(0,a.sprintf)("url(#%s-c)",s),children:[(0,n.jsx)(i.Path,{d:"M81.86 202.714c-4.212-5.711-9.207-10.766-14.743-15.179L10.774 194a120.343 120.343 0 0 0 19.781 9.306l.156.057c9.356 3.391 18.15 8.218 25.745 14.647 20.947 17.728 49.576 24.847 76.933 18.099-20.629-4.497-39.01-16.421-51.529-33.395ZM184.644 94.535c7.905 0 15.05 2.449 20.245 6.396-2.678-9.353-9.32-17.45-18.663-21.637-18.175-8.145-39.105.935-45.795 19.315-3.232 8.313-5.907 22.207-5.907 22.207l-.01.003a31.663 31.663 0 0 1 13.381 12.506c3.764 6.46 4.956 13.483 4.08 20.112l16.993-10.72c3.04-1.918 2.786-6.373-.407-8.023-7.636-3.946-12.656-10.622-12.656-18.198 0-12.128 12.867-21.96 28.739-21.96Z",fill:"#111"}),(0,n.jsx)(i.Path,{d:"m112.219 157.765-79.112 13.21",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,n.jsx)(i.Path,{d:"M147.895 133.326c-9.345-16.041-30.373-20.725-45.642-10.166l-30.074 20.796c2.197 4.576 9.653 6.09 18.016 4.029-.672 1.9-.731 3.753-.054 5.411 2.01 4.922 9.842 6.537 18.577 4.271-.736 1.967-.826 3.888-.126 5.602 2.208 5.403 11.432 6.823 21.164 3.495-1.22 2.397-1.527 4.777-.679 6.852.845 2.069 2.721 3.55 5.258 4.408 15.986-7.75 23.236-28.09 13.56-44.698Z",fill:"#111"}),(0,n.jsx)(i.Path,{d:"m46.684 211.546-59.718 23.285c-9.123 3.557-15.71-8.949-7.618-14.461l34.97-23.818M145.995 232.995l14.599 28.633M120.83 238.624l11.729 23.004",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,n.jsx)(i.Path,{d:"M15.902 196.848a120.77 120.77 0 0 0 14.653 6.458l.156.057c9.356 3.391 18.149 8.218 25.744 14.646 25.087 21.233 61.194 27.253 92.936 12.452 32.427-15.121 51.137-47.701 50.164-81.328-.264-9.138 1.122-18.257 4.393-26.793a34.657 34.657 0 0 0 1.162-3.619c4.162-15.903-3.882-32.705-18.884-39.427-18.175-8.145-39.105.935-45.795 19.315l-6.662 20.343",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,n.jsx)(i.Path,{d:"m206.525 101.23 15.166 7.023-15.489 7.744M-2.372 195.508l104.625-72.348c15.269-10.559 36.297-5.876 45.642 10.165 11.57 19.86-1.059 45.063-23.893 47.683l-126.374 14.5Z",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"})]})]})]}),(0,n.jsxs)("defs",{children:[(0,n.jsx)("clipPath",{id:(0,a.sprintf)("%s-a",s),children:(0,n.jsx)(i.Path,{d:"M0 0h256v256H0z",fill:"#fff"})}),(0,n.jsx)("clipPath",{id:(0,a.sprintf)("%s-c",s),children:(0,n.jsx)(i.Path,{fill:"#fff",transform:"translate(-29.31 40.96)",d:"M0 0h256v256H0z"})})]})]})})};l.propTypes={slug:s.string.isRequired};const o=({actions:e,children:s,pageTitle:t,product:r,width:a="full"})=>{const{key:i,type:o}=r,{slug:c}=window.teydeaStudio[i][o];return(0,n.jsxs)("div",{className:"tsc-settings-container",children:[(0,n.jsxs)("header",{className:"tsc-settings-container__header",children:[(0,n.jsx)(l,{slug:c}),(0,n.jsx)("h1",{children:t}),(0,n.jsx)("div",{className:"tsc-settings-container__actions",children:e})]}),(0,n.jsx)("div",{className:`tsc-settings-container__container tsc-settings-container__container--${a}-width`,children:s})]})};o.propTypes={actions:s.element.isRequired,children:s.element.isRequired,pageTitle:s.string.isRequired,product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,width:s.oneOf(["full","wide"])};const c=window.wp.components,d=window.wp.hooks,u=window.wp.url,h=({product:s,settings:t})=>{const{key:r,type:i}=s,{helpLinks:l}=window.teydeaStudio[r].settingsPage,{slug:o}=window.teydeaStudio[r][i];return(0,n.jsxs)("div",{className:"tsc-settings-sidebar",children:[(0,n.jsxs)(c.Panel,{children:[0<l.length&&(0,n.jsx)(c.PanelBody,{title:(0,a.__)("Help & support","password-requirements"),className:"tsc-settings-sidebar__panel",children:(0,n.jsx)("ul",{children:l.map(({url:e,title:s},t)=>(0,n.jsx)("li",{children:(0,n.jsx)("a",{href:e,target:"_blank",rel:"noreferrer noopener",children:s})},t))})}),(0,d.applyFilters)("password_requirements__upsell_panel",(0,n.jsx)(e.Fragment,{})),(0,d.applyFilters)("password_requirements__promoted_plugins_panel",(0,n.jsx)(e.Fragment,{})),(0,n.jsxs)(c.PanelBody,{className:"tsc-settings-sidebar__panel",initialOpen:!1,title:(0,a.__)("Write a review","password-requirements"),children:[(0,n.jsx)("p",{children:(0,a.sprintf)(
     1(()=>{var e={694(e,s,t){"use strict";var r=t(925);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,s,t,a,i,n){if(n!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function s(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:s,element:e,elementType:e,instanceOf:s,node:e,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:i,resetWarningCache:a};return t.PropTypes=t,t}},556(e,s,t){e.exports=t(694)()},925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const s={};function t(r){const a=s[r];if(void 0!==a)return a.exports;const i=s[r]={exports:{}};return e[r](i,i.exports,t),i.exports}(()=>{"use strict";const e=window.wp.element;var s=t(556);const r=window.wp.i18n,a=window.wp.primitives,i=window.ReactJSXRuntime,n=({slug:e})=>{const s=`ts-product-icon-${e}`;switch(e){case"bm-custom-login":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#ffe8db",d:"M372.367 0h-232.73C62.517 0 0 62.518 0 139.637v232.73c0 77.119 62.518 139.637 139.637 139.637h232.73c77.119 0 139.637-62.518 139.637-139.637v-232.73C512.004 62.517 449.486 0 372.367 0"}),(0,i.jsx)(a.Path,{fill:"#ffd7c1",d:"M170.66 426.662a85.41 85.41 0 0 1-85.318-85.318V170.66a85.41 85.41 0 0 1 85.318-85.318h170.684a85.41 85.41 0 0 1 85.318 85.318v170.684a85.41 85.41 0 0 1-85.318 85.318z"}),(0,i.jsx)(a.Path,{fill:"#ff9e68",d:"M192.001 384.003a64.06 64.06 0 0 1-45.234-18.766 64.07 64.07 0 0 1-18.766-45.235V192.001a64.06 64.06 0 0 1 18.766-45.234 64.06 64.06 0 0 1 45.234-18.766h128.001a64.07 64.07 0 0 1 45.235 18.766 64.06 64.06 0 0 1 18.766 45.234v128.001a64.07 64.07 0 0 1-18.766 45.235 64.07 64.07 0 0 1-45.235 18.766z"}),(0,i.jsx)(a.Path,{fill:"#dd3814",d:"M257.306 327.543a10.65 10.65 0 0 1-3.125-7.54 10.67 10.67 0 0 1 3.125-7.541l48.896-48.919a10.68 10.68 0 0 0 0-15.081l-48.896-48.92a10.662 10.662 0 0 1 7.54-18.204c2.829 0 5.541 1.123 7.541 3.123l48.896 48.92a32.02 32.02 0 0 1 0 45.242l-48.896 48.92c-4.189 4.189-10.915 4.189-15.081 0"}),(0,i.jsx)(a.Path,{fill:"#dd3814",d:"M319.887 266.661H85.343a10.65 10.65 0 0 1-9.848-6.58 10.657 10.657 0 0 1 5.769-13.926 10.7 10.7 0 0 1 4.079-.812h234.544a10.65 10.65 0 0 1 7.537 3.122 10.67 10.67 0 0 1 3.122 7.537 10.67 10.67 0 0 1-3.122 7.537 10.67 10.67 0 0 1-7.537 3.122"}),(0,i.jsx)(a.Path,{fill:"#dd3814",d:"M341.344 437.345H170.661a96.12 96.12 0 0 1-96-96.001 10.67 10.67 0 1 1 21.34 0 74.753 74.753 0 0 0 74.66 74.659h170.683a74.755 74.755 0 0 0 74.66-74.659V170.66A74.755 74.755 0 0 0 341.344 96H170.661a74.753 74.753 0 0 0-74.66 74.66 10.672 10.672 0 0 1-18.216 7.546 10.67 10.67 0 0 1-3.125-7.546 96.117 96.117 0 0 1 96.001-96h170.683a96.116 96.116 0 0 1 96.001 96v170.684a96.12 96.12 0 0 1-96.001 96.001"})]})});case"careers":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 256 256",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsxs)(a.G,{clipPath:(0,r.sprintf)("url(#%s-a)",s),children:[(0,i.jsx)(a.Rect,{fill:"#fff",height:"256",rx:"10.24",width:"256"}),(0,i.jsx)(a.Path,{d:"M0 0h256v256H0z",fill:"#AD1735",fillOpacity:".05"}),(0,i.jsx)(a.Path,{d:"M130.289 201.349c-14.461 0-27.185-3.062-38.172-9.188-10.988-6.188-19.576-14.776-25.764-25.763-6.189-10.988-9.283-23.744-9.283-38.267 0-10.988 1.8-21.06 5.4-30.216 3.599-9.156 8.682-17.081 15.25-23.775 6.63-6.693 14.428-11.871 23.395-15.534 9.03-3.662 18.975-5.494 29.837-5.494 7.83 0 15.628 1.01 23.396 3.032 7.767 1.957 14.713 4.799 20.838 8.524h.758l8.146-9.567h5.683v45.845h-8.904c-1.263-3.347-2.589-6.44-3.978-9.282-1.326-2.842-2.779-5.431-4.357-7.768-4.357-6.756-9.535-11.713-15.534-14.87-5.999-3.221-12.914-4.831-20.744-4.831-14.461 0-25.385 5.21-32.773 15.629-7.325 10.356-10.988 25.826-10.988 46.412 0 20.712 3.663 36.531 10.988 47.455 7.388 10.861 18.06 16.292 32.015 16.292 7.704 0 14.65-1.674 20.839-5.02 6.251-3.347 11.461-8.083 15.628-14.208 2.211-3.095 4.105-6.599 5.684-10.514 1.641-3.978 2.873-8.272 3.694-12.882h8.43v52.001h-7.009l-7.578-12.313c-7.325 4.988-14.587 8.619-21.786 10.892-7.135 2.274-14.839 3.41-23.111 3.41Z",fill:"#AD1735"})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:(0,r.sprintf)("%s-a",s),children:(0,i.jsx)(a.Rect,{fill:"#fff",height:"256",rx:"10.24",width:"256"})})})]})});case"hiring-center":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#ffe2f7",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,i.jsx)(a.Path,{fill:"#ffd8f4",d:"m373.482 366.755-34.048-5.539-3.258.07-7.633.558c-8.611-13.335-14.173-32.186-39.611-44.73l-15.755-7.773c5.934-5.958 36.212-18.525 36.212-53.341a53.38 53.38 0 0 0-15.637-37.704 53.38 53.38 0 0 0-37.704-15.637A53.385 53.385 0 0 0 202.707 256c0 34.932 30.045 47.127 36.212 53.341l-15.755 7.773c-29.114 14.336-36.399 41.658-38.168 44.521l-9.728-.745c-5.678.768-41.588 6.33-39.796 6.051a21.48 21.48 0 0 1-18.595-10.636l-17.291-29.952a21.39 21.39 0 0 1 1.978-24.157l21.667-26.601a21.4 21.4 0 0 0 4.817-13.475v-12.241a21.5 21.5 0 0 0-4.817-13.498L101.54 209.78a21.39 21.39 0 0 1-1.931-24.157l17.268-29.929a21.51 21.51 0 0 1 18.618-10.659l37.144 5.749a20.95 20.95 0 0 0 14.056-2.56l10.659-6.144a21.57 21.57 0 0 0 9.286-10.892l12.148-32.093a21.49 21.49 0 0 1 19.968-13.754h34.584c8.797 0 16.803 5.516 19.944 13.73l12.195 32.164a21.42 21.42 0 0 0 9.263 10.845l10.612 6.12a20.95 20.95 0 0 0 14.01 2.584l37.26-5.772c7.657 0 14.755 4.096 18.572 10.659l17.291 29.975a21.39 21.39 0 0 1-1.978 24.157l-21.643 26.601a21.34 21.34 0 0 0-4.818 13.475v12.241c0 4.888 1.699 9.705 4.794 13.499l21.714 26.6c5.585 6.796 6.353 16.524 1.931 24.157l-17.291 29.929a21.48 21.48 0 0 1-18.549 10.682z"}),(0,i.jsx)(a.Path,{fill:"#ffd0f2",d:"M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,i.jsx)(a.Path,{fill:"#ffb8dd",d:"M238.774 426.658a21.435 21.435 0 0 1-19.968-13.731l-12.195-32.163a21.5 21.5 0 0 0-9.262-10.845l-12.94-7.494c1.699-2.117 16.384-53.085 71.634-53.085 55.296 0 69.934 50.968 71.633 53.109l-12.94 7.447a21.55 21.55 0 0 0-9.262 10.938l-12.195 32.093a21.432 21.432 0 0 1-19.945 13.731z"}),(0,i.jsx)(a.Path,{fill:"#ffb8dd",d:"M256.001 309.341a53.342 53.342 0 1 0 0-106.684 53.342 53.342 0 0 0 0 106.684"}),(0,i.jsx)(a.Path,{fill:"#ea1e87",d:"M256 320a64.06 64.06 0 0 1-45.234-18.766A64.06 64.06 0 0 1 192 256a64.06 64.06 0 0 1 18.766-45.234A64.06 64.06 0 0 1 256 192a64.06 64.06 0 0 1 45.234 18.766A64.06 64.06 0 0 1 320 256a64.06 64.06 0 0 1-18.766 45.234A64.06 64.06 0 0 1 256 320m0-106.659A42.707 42.707 0 0 0 213.341 256c0 23.505 19.13 42.659 42.659 42.659A42.707 42.707 0 0 0 298.659 256c0-23.505-19.13-42.659-42.659-42.659"}),(0,i.jsx)(a.Path,{fill:"#ea1e87",d:"M327.379 373.714a10.68 10.68 0 0 1-10.24-7.68A63.374 63.374 0 0 0 256.071 320a63.37 63.37 0 0 0-61.091 46.034 10.66 10.66 0 0 1-9.088 7.596 10.66 10.66 0 0 1-10.496-5.489 10.67 10.67 0 0 1-.873-8.112 84.55 84.55 0 0 1 81.548-61.37c37.981 0 70.749 24.669 81.524 61.393a10.657 10.657 0 0 1-10.24 13.662z"}),(0,i.jsx)(a.Path,{fill:"#ea1e87",d:"M273.322 437.341h-34.583a32.18 32.18 0 0 1-29.906-20.643l-12.195-32.116a10.77 10.77 0 0 0-4.654-5.446l-10.589-6.121a11 11 0 0 0-7.029-1.28l-33.908 5.492a32.11 32.11 0 0 1-32.815-15.592l-17.291-29.952a32.17 32.17 0 0 1 2.909-36.236l21.69-26.601a10.68 10.68 0 0 0 2.42-6.726v-12.241a10.75 10.75 0 0 0-2.42-6.749l-21.69-26.577a32.19 32.19 0 0 1-2.91-36.236l17.292-29.952a31.93 31.93 0 0 1 32.815-15.593l33.885 5.493a10.83 10.83 0 0 0 7.052-1.28l10.612-6.121a10.76 10.76 0 0 0 4.655-5.493l12.171-32.07c4.678-12.334 16.71-20.642 29.906-20.642h34.583c13.196 0 25.228 8.308 29.929 20.643l12.171 32.116a10.78 10.78 0 0 0 4.655 5.446l10.589 6.121c2.141 1.233 4.654 1.652 7.028 1.28l33.909-5.493c13.032-2.094 26.228 4.143 32.814 15.593l17.292 29.952a32.165 32.165 0 0 1-2.909 36.236l-21.69 26.6a10.66 10.66 0 0 0-2.421 6.726v12.241a10.7 10.7 0 0 0 2.421 6.75l21.69 26.6c8.355 10.24 9.542 24.786 2.909 36.213l-17.292 29.975a31.905 31.905 0 0 1-32.814 15.593l-33.885-5.516a10.9 10.9 0 0 0-7.052 1.303l-10.612 6.121a10.77 10.77 0 0 0-4.655 5.469l-12.148 32.093c-4.701 12.335-16.733 20.62-29.929 20.62m-97.28-87.063c5.585 0 11.148 1.443 16.035 4.282l10.589 6.12a32.3 32.3 0 0 1 13.917 16.315l12.172 32.116c1.559 4.119 5.585 6.889 9.984 6.889h34.583c4.422 0 8.425-2.793 9.984-6.866l12.172-32.116a32.24 32.24 0 0 1 13.917-16.338l10.612-6.12a31.88 31.88 0 0 1 21.132-3.863L375 356.189c4.422.651 8.751-1.397 10.939-5.213l17.291-29.952a10.7 10.7 0 0 0 1.396-6.187 10.7 10.7 0 0 0-2.35-5.892l-21.713-26.601a32.1 32.1 0 0 1-7.215-20.224v-12.241c0-7.331 2.56-14.522 7.215-20.224l21.69-26.601a10.68 10.68 0 0 0 .977-12.078l-17.291-29.952A10.8 10.8 0 0 0 375 155.811l-33.885 5.492a31.6 31.6 0 0 1-21.131-3.863l-10.589-6.121a32.16 32.16 0 0 1-13.917-16.314l-12.172-32.116a10.76 10.76 0 0 0-9.984-6.89h-34.583c-4.422 0-8.425 2.794-9.984 6.866l-12.172 32.117a32.2 32.2 0 0 1-13.917 16.337l-10.612 6.121c-6.354 3.723-13.848 5.12-21.132 3.863l-33.839-5.492a10.82 10.82 0 0 0-10.938 5.213l-17.291 29.952a10.705 10.705 0 0 0 .954 12.078l21.713 26.601a32.1 32.1 0 0 1 7.215 20.224v12.241c0 7.331-2.56 14.523-7.215 20.224l-21.69 26.624a10.68 10.68 0 0 0-.977 12.056l17.291 29.952c2.188 3.816 6.517 5.818 10.938 5.213l33.885-5.492a30 30 0 0 1 5.12-.419z"}),(0,i.jsx)(a.Path,{fill:"#ffd0f2",d:"M234.148 277.32a4.45 4.45 0 1 1 6.294-6.295c4.202 4.201 9.789 6.522 15.721 6.522a22.12 22.12 0 0 0 15.747-6.522 4.446 4.446 0 0 1 6.288 6.288c-5.883 5.883-13.709 9.124-22.035 9.13a30.94 30.94 0 0 1-22.015-9.123"})]})});case"password-requirements":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"102 94 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#e2edfd",d:"M474.364 94H241.636C164.517 94 102 156.517 102 233.636v232.728C102 543.483 164.517 606 241.636 606h232.728C551.483 606 614 543.483 614 466.364V233.636C614 156.517 551.483 94 474.364 94"}),(0,i.jsx)(a.Path,{fill:"#cfdefa",d:"M358.001 520.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,i.jsx)(a.Path,{fill:"#e2edfd",d:"M409.281 332.536c21.887-34.435 16.488-77.187-10.359-104.035-32.247-32.247-84.484-32.247-116.73 0-20.866 20.865-28.745 50.631-21.158 79.522l-61.866 61.867a15.46 15.46 0 0 0-4.524 10.943v36.478c0 8.463 7.004 15.467 15.467 15.467h31.809c6.712 0 12.694-4.232 14.737-10.652 0 0 3.648-10.943 3.794-11.089l1.167-.292.438-.438 20.282-6.566 7.295-21.887 21.887-7.295 8.025-8.025c34.873 9.192 70.038-4.086 89.882-33.852zm-68.724-45.67c-8.026-8.026-8.026-21.158 0-29.183s21.157-8.025 29.182 0 8.025 21.157 0 29.183-21.157 8.025-29.182 0"}),(0,i.jsx)(a.Path,{fill:"#99c7ff",d:"M501.06 272.266c-36.478-36.478-81.711-20.136-85.213-20.136.875 5.837 16.926 36.186-3.502 75.875l-.292-.292c-32.246 56.176-89.882 38.521-92.508 38.812l-7.879 7.88-21.887 7.295-7.296 21.887-21.887 7.296 94.843 94.843c8.025 8.025 21.157 8.025 29.183 0l116.73-116.73c32.246-32.247 32.246-84.483-.001-116.73zm-58.365 58.365c-8.025-8.025-8.025-21.157 0-29.183s21.157-8.025 29.182 0 8.025 21.158 0 29.183-21.157 8.025-29.182 0"}),(0,i.jsx)(a.Path,{fill:"#3140d7",d:"M184.431 417.311v-36.478c0-7.004 2.626-13.424 7.441-18.239l57.927-57.927c-5.982-30.204 3.356-61.721 25.097-83.462 36.186-36.186 95.135-36.186 131.321 0s36.186 95.135 0 131.321c-21.741 21.741-53.258 31.079-83.462 25.097l-4.085 4.085c-1.167 1.168-2.481 1.897-3.94 2.481l-17.072 5.691-5.69 17.071c-1.022 3.064-3.502 5.545-6.566 6.566l-17.072 5.691-2.043 6.42c-3.502 10.506-13.278 17.655-24.367 17.655h-31.809c-14.299 0-25.826-11.527-25.826-25.826zm207.195-181.515c-28.161-28.161-73.978-28.161-102.139 0-18.239 18.239-25.097 44.066-18.385 69.454.876 3.502 0 7.296-2.626 9.922l-61.867 61.867c-1.021 1.022-1.459 2.335-1.605 3.648v36.478c0 2.918 2.335 5.253 5.107 5.107h31.809c2.335 0 4.231-1.313 4.961-3.502l3.794-11.381c1.021-3.064 3.502-5.545 6.566-6.566l17.071-5.691 5.691-17.071c1.021-3.065 3.502-5.545 6.566-6.566l19.552-6.421 6.42-6.42c2.627-2.626 6.275-3.648 9.923-2.626 25.388 6.712 51.361-.292 69.454-18.385 28.161-28.161 28.161-73.978 0-102.139z"}),(0,i.jsx)(a.Path,{fill:"#3140d7",d:"m347.85 513.026-94.843-94.842c-4.086-4.086-4.086-10.506 0-14.592 4.085-4.085 10.505-4.085 14.591 0l94.843 94.843c4.085 4.086 10.505 4.086 14.591 0l116.73-116.73c28.015-28.015 28.453-73.685 0-102.138-19.698-19.698-48.297-26.118-74.853-16.78-5.399 1.897-11.235-1.021-13.132-6.42s1.021-11.235 6.42-13.132c33.997-11.819 70.913-3.502 96.156 21.741 36.478 36.478 36.04 95.28 0 131.321l-116.73 116.729c-12.11 12.111-31.663 12.111-43.773 0"}),(0,i.jsx)(a.Path,{fill:"#3140d7",d:"M333.262 294.161c-12.111-12.111-12.111-31.663 0-43.774 12.11-12.11 31.663-12.11 43.773 0 12.111 12.111 12.111 31.663 0 43.774-12.11 12.111-31.663 12.111-43.773 0m29.182-29.182c-4.085-4.086-10.506-4.086-14.591 0-4.086 4.085-4.086 10.505 0 14.591 4.085 4.085 10.506 4.085 14.591 0 4.086-4.086 4.086-10.506 0-14.591M435.4 337.935c-12.11-12.111-12.11-31.663 0-43.774 12.111-12.11 31.663-12.11 43.774 0 12.111 12.111 12.111 31.663 0 43.774s-31.663 12.111-43.774 0m29.183-29.183c-4.086-4.085-10.506-4.085-14.592 0-4.085 4.086-4.085 10.506 0 14.592 4.086 4.085 10.506 4.085 14.592 0 4.085-4.086 4.085-10.506 0-14.592"}),(0,i.jsx)(a.Path,{fill:"#3140d7",d:"M354.125 285.551c-3.21-4.669-2.335-11.089 2.481-14.445 4.669-3.21 11.089-2.335 14.445 2.481 3.94 4.523 12.986 23.783 37.791 34.289 12.257 5.253 26.118 7.15 39.98 5.253 5.691-.73 10.798 3.21 11.673 8.754.73 5.691-3.064 10.944-8.755 11.673-17.655 2.481-35.164.146-50.777-6.712-30.642-13.132-42.461-36.623-46.546-41.293z"})]})});case"password-reset-enforcement":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#f3d9ff",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,i.jsx)(a.Path,{fill:"#efceff",d:"M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"M369.151 384.234a10.67 10.67 0 0 1-2.321-11.641 10.7 10.7 0 0 1 2.321-3.463 158.97 158.97 0 0 0 46.848-113.129c0-88.437-71.563-160-160-160a10.67 10.67 0 1 1 0-21.341 181.23 181.23 0 0 1 167.569 111.926 181.2 181.2 0 0 1 13.772 69.415c0 48.43-18.85 93.975-53.108 128.233a10.665 10.665 0 0 1-15.081 0m-113.152 53.108a181.226 181.226 0 0 1-181.34-181.341c0-48.431 18.85-93.975 53.131-128.21a10.67 10.67 0 0 1 7.54-3.123 10.66 10.66 0 0 1 9.852 6.583 10.66 10.66 0 0 1-2.311 11.621 158.93 158.93 0 0 0-46.872 113.152 159.88 159.88 0 0 0 46.837 113.156 159.9 159.9 0 0 0 113.163 46.821 10.67 10.67 0 1 1 0 21.341"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"m165.691 120.016-2.232 42.601a10.66 10.66 0 0 1-21.289-1.116l1.675-31.956-31.956-1.675a10.671 10.671 0 0 1 1.116-21.312l42.601 2.233a10.65 10.65 0 0 1 9.495 7.103c.466 1.322.667 2.723.59 4.122M351.93 388.426l-.744-42.652a10.659 10.659 0 0 1 21.314-.372l.559 31.995 31.995-.558a10.67 10.67 0 0 1 10.855 10.482 10.67 10.67 0 0 1-10.482 10.855l-42.653.745a10.673 10.673 0 0 1-9.968-6.423 10.7 10.7 0 0 1-.876-4.072"}),(0,i.jsx)(a.Path,{fill:"#f5dfff",d:"M308.137 143.792a10.67 10.67 0 0 1-15.09 15.091c-10.072-10.072-23.467-15.634-37.685-15.634a52.99 52.99 0 0 0-37.751 15.634 10.66 10.66 0 0 1-15.074 0 10.66 10.66 0 0 1 0-15.074c14.103-14.103 32.863-21.871 52.825-21.887a74.17 74.17 0 0 1 52.775 21.87M203.546 367.89a10.671 10.671 0 1 1 15.09-15.09c10.071 10.071 23.467 15.634 37.685 15.634a52.997 52.997 0 0 0 37.751-15.634 10.659 10.659 0 1 1 15.074 15.074c-14.103 14.103-32.863 21.87-52.825 21.887a74.17 74.17 0 0 1-52.775-21.871"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"M255.492 299.997a10.993 10.993 0 0 1-10.992-10.992v-66a10.98 10.98 0 0 1 3.219-7.773 11 11 0 0 1 7.773-3.219 11 11 0 0 1 7.773 3.219 11 11 0 0 1 3.219 7.773v66a10.99 10.99 0 0 1-10.992 10.992"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"m277.33 281.946-55.008-33a11.02 11.02 0 0 1-5.01-6.768 11.005 11.005 0 0 1 8.01-13.339 11 11 0 0 1 8.328 1.243l55.008 33a11 11 0 0 1 5.011 6.767 11.005 11.005 0 0 1-8.01 13.339 11 11 0 0 1-8.329-1.242"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"M218.558 278.18a10.99 10.99 0 0 1 3.768-15.096l55.008-33a11 11 0 0 1 12.211.59 11 11 0 0 1 4.335 7.219 11.01 11.01 0 0 1-5.218 11.055l-55.008 33a10.99 10.99 0 0 1-12.212-.587 11 11 0 0 1-2.884-3.181m124.944 21.816a11 11 0 0 1-7.788-3.211 11 11 0 0 1-3.228-7.781v-66a11.004 11.004 0 1 1 22.008 0v66c0 2.915-1.158 5.711-3.219 7.773a11 11 0 0 1-7.773 3.219"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"m365.338 281.946-55.008-33a11.001 11.001 0 0 1 11.328-18.864l54.984 33a11 11 0 0 1 3.179 2.881 10.99 10.99 0 0 1-2.28 15.382 10.99 10.99 0 0 1-12.203.601"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"M306.564 278.18a10.985 10.985 0 0 1 .587-12.212 11 11 0 0 1 3.181-2.884l55.008-33a11.005 11.005 0 0 1 16.339 12.096 11.007 11.007 0 0 1-5.011 6.768l-55.008 33a10.992 10.992 0 0 1-15.12-3.768zm-139.08 21.816a10.983 10.983 0 0 1-10.155-6.786 11 11 0 0 1-.837-4.206v-66A11.01 11.01 0 0 1 167.496 212a11 11 0 0 1 11.004 11.004v66a10.99 10.99 0 0 1-6.802 10.162 11 11 0 0 1-4.214.83"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"m189.328 281.952-54.984-33a11 11 0 0 1-3.179-2.881 10.99 10.99 0 0 1 2.28-15.382 10.99 10.99 0 0 1 12.203-.601l55.008 33a11.02 11.02 0 0 1 5.01 6.768c.35 1.402.421 2.859.207 4.288a10.99 10.99 0 0 1-4.335 7.219 11 11 0 0 1-8.17 2.039 11 11 0 0 1-4.04-1.45"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"M130.574 278.178a11 11 0 0 1-1.247-8.33 10.98 10.98 0 0 1 5.015-6.766l54.984-33a11 11 0 0 1 8.328-1.243 11 11 0 0 1 6.768 5.011 11.005 11.005 0 0 1-3.768 15.096l-55.008 33a10.993 10.993 0 0 1-15.072-3.768"})]})});case"stalepilot":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#dafbf0",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,i.jsx)(a.Path,{fill:"#b9f3df",d:"M256.274 426.658a170.66 170.66 0 0 0 170.659-170.659 170.66 170.66 0 1 0-170.659 170.659"}),(0,i.jsx)(a.Path,{fill:"#b9f3df",d:"M389.747 382.787c-17.58-31.623-17.026-58.92-16.749-72.025V295.1H138.513v15.343c.213 12.252.703 40.913-16.791 72.365-7.246 13.105 1.363 29.492 16.706 29.492h234.634c15.322 0 23.994-16.408 16.685-29.513"}),(0,i.jsx)(a.Path,{fill:"#8ae7bc",d:"M138.574 295.1a19.562 19.562 0 0 1-19.541-19.52v-19.54a58.664 58.664 0 0 1 58.6-58.6h156.281a58.664 58.664 0 0 1 58.6 58.6v19.54a19.543 19.543 0 0 1-19.54 19.52z"}),(0,i.jsx)(a.Path,{fill:"#8ae7bc",d:"M285.074 90h-58.6v117.2h58.6z"}),(0,i.jsx)(a.Path,{fill:"#0e9f6e",d:"M372.973 304.88h-234.4a29.32 29.32 0 0 1-29.3-29.3v-19.54a68.45 68.45 0 0 1 68.36-68.36h156.281a68.446 68.446 0 0 1 68.359 68.36v19.54c0 16.152-13.147 29.3-29.3 29.3m-195.34-97.681a48.884 48.884 0 0 0-48.819 48.841v19.54a9.8 9.8 0 0 0 9.759 9.76h234.4a9.783 9.783 0 0 0 9.76-9.76v-19.54a48.886 48.886 0 0 0-48.819-48.841z"}),(0,i.jsx)(a.Path,{fill:"#0e9f6e",d:"M373.101 422.08H138.467c-22.418 0-36.29-24.058-25.23-44.024 10.207-18.326 15.577-39.103 15.577-60.071v-22.886a9.77 9.77 0 0 1 2.861-6.908 9.76 9.76 0 0 1 6.909-2.862 9.773 9.773 0 0 1 9.77 9.77v22.886a143.4 143.4 0 0 1-18.049 69.553c-3.708 6.691.362 15.002 8.162 15.002H373.08c7.778 0 11.911-8.289 8.161-15.002a143.47 143.47 0 0 1-18.027-69.553v-22.886a9.77 9.77 0 1 1 19.54 0v22.886c0 20.968 5.37 41.745 15.556 60.049 11.08 19.988-2.792 44.046-25.209 44.046"}),(0,i.jsx)(a.Path,{fill:"#0e9f6e",d:"M197.173 363.48a9.75 9.75 0 0 1-6.909-2.866 9.76 9.76 0 0 1-2.851-6.915v-58.6a9.757 9.757 0 0 1 9.76-9.759 9.76 9.76 0 0 1 9.759 9.759v58.6a9.74 9.74 0 0 1-2.851 6.915 9.752 9.752 0 0 1-6.908 2.866m78.14-19.54a9.78 9.78 0 0 1-6.915-2.851 9.757 9.757 0 0 1-2.866-6.909v-39.081a9.77 9.77 0 0 1 19.541 0v39.081a9.76 9.76 0 0 1-9.76 9.76m58.6 39.059a9.75 9.75 0 0 1-9.036-6.02 9.8 9.8 0 0 1-.745-3.739v-78.141a9.77 9.77 0 0 1 19.541 0v78.141a9.763 9.763 0 0 1-9.76 9.759m-107.44-175.8a9.76 9.76 0 0 1-9.76-9.759V99.78a9.757 9.757 0 0 1 9.76-9.76 9.76 9.76 0 0 1 9.759 9.76v97.66a9.76 9.76 0 0 1-9.759 9.759m58.6 0a9.76 9.76 0 0 1-9.76-9.759V99.78a9.757 9.757 0 0 1 9.76-9.76 9.76 9.76 0 0 1 9.759 9.76v97.66a9.76 9.76 0 0 1-9.759 9.759"})]})});case"teydea-site-assistant":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#e0f3f7",d:"M372.364 0H139.636C62.5173 0 0 62.5173 0 139.636V372.364C0 449.483 62.5173 512 139.636 512H372.364C449.483 512 512 449.483 512 372.364V139.636C512 62.5173 449.483 0 372.364 0Z"}),(0,i.jsx)(a.Path,{fill:"#c7e5eb",d:"M256.001 426.658C301.262 426.658 344.67 408.678 376.675 376.673C408.68 344.669 426.66 301.261 426.66 255.999C426.66 210.738 408.68 167.33 376.675 135.325C344.67 103.32 301.262 85.3403 256.001 85.3403C210.739 85.3403 167.331 103.32 135.327 135.325C103.322 167.33 85.3418 210.738 85.3418 255.999C85.3418 301.261 103.322 344.669 135.327 376.673C167.331 408.678 210.739 426.658 256.001 426.658Z"}),(0,i.jsx)(a.Path,{fill:"#b0dde6",d:"M236.75 140.5C226.162 140.5 217.5 131.838 217.5 121.25V102H294.5V121.25C294.5 131.838 285.838 140.5 275.25 140.5H236.75Z"}),(0,i.jsx)(a.Path,{fill:"#b0dde6",d:"M159.75 410C149.162 410 140.5 401.338 140.5 390.75V121.25C140.5 110.662 149.162 102 159.75 102H217.5V121.25C217.5 131.838 226.162 140.5 236.75 140.5H275.25C285.838 140.5 294.5 131.838 294.5 121.25V102H352.25C362.838 102 371.5 110.662 371.5 121.25V390.75C371.5 401.338 362.838 410 352.25 410H159.75Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M352.25 419.625H159.75C143.773 419.625 130.875 406.727 130.875 390.75V121.25C130.875 105.273 143.773 92.375 159.75 92.375H352.25C368.227 92.375 381.125 105.273 381.125 121.25V390.75C381.125 406.727 368.227 419.625 352.25 419.625ZM159.75 111.625C154.36 111.625 150.125 115.86 150.125 121.25V390.75C150.125 396.14 154.36 400.375 159.75 400.375H352.25C357.64 400.375 361.875 396.14 361.875 390.75V121.25C361.875 115.86 357.64 111.625 352.25 111.625H159.75Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M275.25 150.125H236.75C220.773 150.125 207.875 137.227 207.875 121.25V102C207.875 96.61 212.11 92.375 217.5 92.375C222.89 92.375 227.125 96.61 227.125 102V121.25C227.125 126.64 231.36 130.875 236.75 130.875H275.25C280.64 130.875 284.875 126.64 284.875 121.25V102C284.875 96.61 289.11 92.375 294.5 92.375C299.89 92.375 304.125 96.61 304.125 102V121.25C304.125 137.227 291.227 150.125 275.25 150.125Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M201.137 243.492L181.888 224.242C178.038 220.392 178.038 214.425 181.888 210.575C185.738 206.725 191.705 206.725 195.555 210.575L208.068 223.087L230.205 200.95C234.055 197.1 240.023 197.1 243.873 200.95C247.723 204.8 247.723 210.767 243.873 214.617L214.998 243.492C211.148 247.342 205.18 247.342 201.33 243.492H201.137Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M323.375 236.75H275.25C269.86 236.75 265.625 232.515 265.625 227.125C265.625 221.735 269.86 217.5 275.25 217.5H323.375C328.765 217.5 333 221.735 333 227.125C333 232.515 328.765 236.75 323.375 236.75Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M201.137 301.242L181.888 281.992C178.038 278.142 178.038 272.175 181.888 268.325C185.738 264.475 191.705 264.475 195.555 268.325L208.068 280.837L230.205 258.7C234.055 254.85 240.023 254.85 243.873 258.7C247.723 262.55 247.723 268.517 243.873 272.367L214.998 301.242C211.148 305.092 205.18 305.092 201.33 301.242H201.137Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M323.375 294.5H275.25C269.86 294.5 265.625 290.265 265.625 284.875C265.625 279.485 269.86 275.25 275.25 275.25H323.375C328.765 275.25 333 279.485 333 284.875C333 290.265 328.765 294.5 323.375 294.5Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M201.137 358.992L181.888 339.742C178.038 335.892 178.038 329.925 181.888 326.075C185.738 322.225 191.705 322.225 195.555 326.075L208.068 338.587L230.205 316.45C234.055 312.6 240.023 312.6 243.873 316.45C247.723 320.3 247.723 326.267 243.873 330.117L214.998 358.992C211.148 362.842 205.18 362.842 201.33 358.992H201.137Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M323.375 352.25H275.25C269.86 352.25 265.625 348.015 265.625 342.625C265.625 337.235 269.86 333 275.25 333H323.375C328.765 333 333 337.235 333 342.625C333 348.015 328.765 352.25 323.375 352.25Z"})]})})}return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 256 256",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsxs)(a.G,{clipPath:(0,r.sprintf)("url(#%s-a)",s),children:[(0,i.jsx)("mask",{height:"256",id:(0,r.sprintf)("%s-b",s),maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},width:"256",x:"0",y:"0",children:(0,i.jsx)(a.Path,{d:"M0 0h256v256H0z",fill:"#fff"})}),(0,i.jsxs)(a.G,{mask:(0,r.sprintf)("url(#%s-b)",s),children:[(0,i.jsx)(a.Rect,{fill:"#FCEBD8",height:"256",rx:"10.24",width:"256",x:"-.296"}),(0,i.jsxs)(a.G,{clipPath:(0,r.sprintf)("url(#%s-c)",s),children:[(0,i.jsx)(a.Path,{d:"M81.86 202.714c-4.212-5.711-9.207-10.766-14.743-15.179L10.774 194a120.343 120.343 0 0 0 19.781 9.306l.156.057c9.356 3.391 18.15 8.218 25.745 14.647 20.947 17.728 49.576 24.847 76.933 18.099-20.629-4.497-39.01-16.421-51.529-33.395ZM184.644 94.535c7.905 0 15.05 2.449 20.245 6.396-2.678-9.353-9.32-17.45-18.663-21.637-18.175-8.145-39.105.935-45.795 19.315-3.232 8.313-5.907 22.207-5.907 22.207l-.01.003a31.663 31.663 0 0 1 13.381 12.506c3.764 6.46 4.956 13.483 4.08 20.112l16.993-10.72c3.04-1.918 2.786-6.373-.407-8.023-7.636-3.946-12.656-10.622-12.656-18.198 0-12.128 12.867-21.96 28.739-21.96Z",fill:"#111"}),(0,i.jsx)(a.Path,{d:"m112.219 157.765-79.112 13.21",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,i.jsx)(a.Path,{d:"M147.895 133.326c-9.345-16.041-30.373-20.725-45.642-10.166l-30.074 20.796c2.197 4.576 9.653 6.09 18.016 4.029-.672 1.9-.731 3.753-.054 5.411 2.01 4.922 9.842 6.537 18.577 4.271-.736 1.967-.826 3.888-.126 5.602 2.208 5.403 11.432 6.823 21.164 3.495-1.22 2.397-1.527 4.777-.679 6.852.845 2.069 2.721 3.55 5.258 4.408 15.986-7.75 23.236-28.09 13.56-44.698Z",fill:"#111"}),(0,i.jsx)(a.Path,{d:"m46.684 211.546-59.718 23.285c-9.123 3.557-15.71-8.949-7.618-14.461l34.97-23.818M145.995 232.995l14.599 28.633M120.83 238.624l11.729 23.004",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,i.jsx)(a.Path,{d:"M15.902 196.848a120.77 120.77 0 0 0 14.653 6.458l.156.057c9.356 3.391 18.149 8.218 25.744 14.646 25.087 21.233 61.194 27.253 92.936 12.452 32.427-15.121 51.137-47.701 50.164-81.328-.264-9.138 1.122-18.257 4.393-26.793a34.657 34.657 0 0 0 1.162-3.619c4.162-15.903-3.882-32.705-18.884-39.427-18.175-8.145-39.105.935-45.795 19.315l-6.662 20.343",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,i.jsx)(a.Path,{d:"m206.525 101.23 15.166 7.023-15.489 7.744M-2.372 195.508l104.625-72.348c15.269-10.559 36.297-5.876 45.642 10.165 11.57 19.86-1.059 45.063-23.893 47.683l-126.374 14.5Z",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"})]})]})]}),(0,i.jsxs)("defs",{children:[(0,i.jsx)("clipPath",{id:(0,r.sprintf)("%s-a",s),children:(0,i.jsx)(a.Path,{d:"M0 0h256v256H0z",fill:"#fff"})}),(0,i.jsx)("clipPath",{id:(0,r.sprintf)("%s-c",s),children:(0,i.jsx)(a.Path,{fill:"#fff",transform:"translate(-29.31 40.96)",d:"M0 0h256v256H0z"})})]})]})})};n.propTypes={slug:s.string.isRequired};const l=({actions:e,children:s,pageTitle:t,product:r,width:a="full"})=>{const{key:l,type:o}=r,{slug:c}=window.teydeaStudio[l][o];return(0,i.jsxs)("div",{className:"tsc-settings-container",children:[(0,i.jsxs)("header",{className:"tsc-settings-container__header",children:[(0,i.jsx)(n,{slug:c}),(0,i.jsx)("h1",{children:t}),(0,i.jsx)("div",{className:"tsc-settings-container__actions",children:e})]}),(0,i.jsx)("div",{className:`tsc-settings-container__container tsc-settings-container__container--${a}-width`,children:s})]})};l.propTypes={actions:s.element.isRequired,children:s.element.isRequired,pageTitle:s.string.isRequired,product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,width:s.oneOf(["full","wide"])};const o=window.wp.components,c=window.wp.hooks,d=window.wp.url,u=({product:s,settings:t=null,helpLinks:a=null})=>{const{key:n,type:l}=s,d=a??window.teydeaStudio[n].settingsPage.helpLinks,{slug:u}=window.teydeaStudio[n][l];return(0,i.jsxs)("div",{className:"tsc-settings-sidebar",children:[(0,i.jsxs)(o.Panel,{children:[0<d.length&&(0,i.jsx)(o.PanelBody,{title:(0,r.__)("Help & support","password-requirements"),className:"tsc-settings-sidebar__panel",children:(0,i.jsx)("ul",{children:d.map(({url:e,title:s},t)=>(0,i.jsx)("li",{children:(0,i.jsx)("a",{href:e,target:"_blank",rel:"noreferrer noopener",children:s})},t))})}),(0,c.applyFilters)("password_requirements__upsell_panel",(0,i.jsx)(e.Fragment,{})),(0,c.applyFilters)("password_requirements__promoted_plugins_panel",(0,i.jsx)(e.Fragment,{})),(0,i.jsxs)(o.PanelBody,{className:"tsc-settings-sidebar__panel",initialOpen:!1,title:(0,r.__)("Write a review","password-requirements"),children:[(0,i.jsx)("p",{children:(0,r.sprintf)(
    22// Translators: %s - either "plugin" or "theme".
    33// Translators: %s - either "plugin" or "theme".
    4 (0,a.__)("If you like this %s, share it with your network and write a review on WordPress.org to help others find it. Thank you!","password-requirements"),i)}),(0,n.jsx)("a",{className:"components-button is-secondary is-compact",href:`https://wordpress.org/support/${i}/${o}/reviews/#new-post`,rel:"noopener noreferrer",target:"_blank",children:(0,a.__)("Write a review","password-requirements")})]}),(0,n.jsxs)(c.PanelBody,{className:"tsc-settings-sidebar__panel",initialOpen:!1,title:(0,a.__)("Share your feedback","password-requirements"),children:[(0,n.jsx)("p",{children:(0,a.__)("We're eager to hear your feedback, feature requests, suggestions for improvements etc; we're waiting for a message from you!","password-requirements")}),(0,n.jsx)("a",{className:"components-button is-secondary is-compact",href:"https://teydeastudio.com/contact/",rel:"noopener noreferrer",target:"_blank",children:(0,a.__)("Contact us","password-requirements")})]})]}),(0,d.applyFilters)("password_requirements__after_sidebar_panel",(0,n.jsx)(e.Fragment,{}),t)]})};h.propTypes={product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,settings:s.object.isRequired};const p=e=>"string"!=typeof e||""===e?"":(0,u.cleanForSlug)(e),m=()=>"undefined"!=typeof window&&window.location?p(window.location.hash.replace(/^#/,"")):"",g=(e,s)=>{if(""!==s&&Array.isArray(e))return e.find(e=>{const t=p(e?.name);return""!==t&&t===s})},w=({product:s,settings:t,setSettings:r})=>{const a=(0,e.useMemo)(()=>(0,d.applyFilters)("password_requirements__settings_page_tabs",[],t,r),[t,r]),[i,l]=(0,e.useState)(()=>g(a,m())?.name),[o,u]=(0,e.useState)(0),w=(0,e.useRef)(i);w.current=i,(0,e.useEffect)(()=>{if("undefined"==typeof window)return;const e=()=>{const e=g(a,m())?.name;e!==w.current&&(l(e),u(e=>e+1))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[a]);const f=(0,e.useCallback)(e=>{if(l(e),"undefined"==typeof window||!window.history)return;const s=p(e);if(""===s)return void(""!==window.location.hash&&window.history.replaceState(null,"",window.location.pathname+window.location.search));const t=`#${s}`;window.location.hash!==t&&window.history.replaceState(null,"",t)},[]);return(0,n.jsxs)("div",{className:"tsc-settings-tabs",children:[(0,n.jsx)(c.TabPanel,{initialTabName:i,onSelect:f,tabs:a,className:"tsc-settings-tabs__wrapper",children:s=>(0,n.jsx)(e.Fragment,{children:s.component},s.name)},o),(0,n.jsx)(h,{product:s,settings:t})]})};w.propTypes={product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,settings:s.object.isRequired,setSettings:s.func.isRequired};const f=({url:e,benefits:s})=>{const t="ts-upsell-panel-icon";return(0,n.jsxs)(c.PanelBody,{title:(0,a.__)("Buy the PRO version","password-requirements"),className:"tsc-upsell-panel",children:[0<s.length&&(0,n.jsx)("ul",{children:s.map((e,s)=>(0,n.jsx)("li",{children:e},s))}),(0,n.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"512",height:"512",viewBox:"0 0 511.958 511.958",className:"tsc-upsell-panel__background-icon",children:[(0,n.jsxs)("linearGradient",{id:(0,a.sprintf)("%s-a",t),x1:"255.979",x2:"255.979",y1:"511.958",y2:"0",gradientUnits:"userSpaceOnUse",children:[(0,n.jsx)("stop",{offset:"0",stopColor:"#fd5900"}),(0,n.jsx)("stop",{offset:"1",stopColor:"#ffde00"})]}),(0,n.jsx)(i.Path,{fill:(0,a.sprintf)("url(#%s-a)",t),d:"M255.979 74.979c-99.371 0-181 81.651-181 181 0 99.371 81.651 181 181 181 99.371 0 181-81.651 181-181 0-99.371-81.652-181-181-181zm0 332c-83.262 0-151-67.738-151-151s67.738-151 151-151 151 67.738 151 151-67.739 151-151 151zM507.1 276.466c6.477-12.829 6.477-28.146 0-40.975l-6.707-13.285a15.376 15.376 0 0 1-1.478-9.328l2.273-14.707c2.196-14.202-2.537-28.77-12.662-38.969l-10.483-10.562a15.369 15.369 0 0 1-4.288-8.416l-2.382-14.69c-2.276-14.028-11.105-26.302-23.66-32.927 0 0-13.402-7.895-13.66-8.027a15.359 15.359 0 0 1-6.677-6.678l-6.806-13.234c-6.417-12.48-19.502-21.709-34.149-24.085l-14.689-2.382a15.38 15.38 0 0 1-8.416-4.287L352.755 23.43c-10.199-10.124-24.764-14.854-38.968-12.662l-14.707 2.273a15.369 15.369 0 0 1-9.329-1.477l-13.285-6.707c-12.828-6.476-28.145-6.477-40.973 0l-13.286 6.707a15.394 15.394 0 0 1-9.328 1.478l-14.707-2.273c-14.205-2.197-28.77 2.538-38.969 12.662L148.64 33.914a15.369 15.369 0 0 1-8.415 4.288l-14.691 2.382c-14.646 2.376-27.731 11.604-34.148 24.085l-6.805 13.234a15.369 15.369 0 0 1-6.679 6.678l-13.235 6.806c-12.48 6.417-21.709 19.502-24.084 34.148L38.2 140.226a15.366 15.366 0 0 1-4.288 8.415L23.43 159.203c-10.124 10.199-14.857 24.766-12.662 38.968l2.274 14.708a15.36 15.36 0 0 1-1.478 9.327l-6.707 13.285c-6.476 12.828-6.476 28.145 0 40.974l6.707 13.285a15.376 15.376 0 0 1 1.478 9.328l-2.274 14.708c-2.195 14.202 2.539 28.769 12.662 38.968l10.484 10.563a15.365 15.365 0 0 1 4.288 8.416l2.383 14.689c2.375 14.647 11.604 27.732 24.084 34.149l13.234 6.805a15.371 15.371 0 0 1 6.679 6.679l6.805 13.235c6.418 12.48 19.503 21.709 34.149 24.084l14.69 2.383a15.374 15.374 0 0 1 8.415 4.287l10.563 10.485c10.201 10.124 24.767 14.854 38.968 12.661l14.708-2.274a15.367 15.367 0 0 1 9.327 1.478l13.286 6.707a45.47 45.47 0 0 0 20.486 4.857 45.471 45.471 0 0 0 20.487-4.857l13.285-6.707a15.386 15.386 0 0 1 9.328-1.478l14.707 2.273c14.202 2.194 28.769-2.538 38.969-12.662l10.562-10.484a15.368 15.368 0 0 1 8.416-4.288l14.689-2.383c14.028-2.275 26.303-11.104 32.928-23.66 0 0 7.895-13.402 8.027-13.66a15.372 15.372 0 0 1 6.678-6.678l13.234-6.805c12.78-6.571 21.784-18.963 24.085-33.149l2.382-14.689a15.375 15.375 0 0 1 4.288-8.416c.159-.16.314-.324.465-.491l10.281-11.337c9.943-10.186 14.576-24.624 12.399-38.702l-2.273-14.707a15.371 15.371 0 0 1 1.477-9.329zm-26.78-13.52-6.707 13.284c-4.3 8.517-5.802 18.002-4.345 27.432l2.274 14.708a15.512 15.512 0 0 1-4.306 13.25c-.159.16-.314.324-.466.491l-10.279 11.335c-6.573 6.729-10.84 15.186-12.349 24.482l-2.382 14.689a15.514 15.514 0 0 1-8.19 11.272l-13.235 6.806c-8.343 4.291-15.048 10.928-19.417 19.215 0 0-7.894 13.401-8.026 13.659a15.513 15.513 0 0 1-11.272 8.189l-14.69 2.383a45.208 45.208 0 0 0-24.747 12.609l-10.562 10.484a15.53 15.53 0 0 1-13.251 4.306l-14.707-2.273a45.187 45.187 0 0 0-27.433 4.345l-13.284 6.707a15.518 15.518 0 0 1-13.934 0l-13.285-6.707c-6.406-3.234-13.359-4.886-20.424-4.886-2.329 0-4.67.179-7.008.541l-14.708 2.274a15.522 15.522 0 0 1-13.25-4.305l-10.562-10.484a45.205 45.205 0 0 0-24.746-12.609l-14.691-2.383c-5.26-.853-10.191-4.144-12.271-8.189l-6.806-13.235a45.212 45.212 0 0 0-19.639-19.639l-13.235-6.805c-4.045-2.08-7.336-7.012-8.189-12.272l-2.383-14.689a45.2 45.2 0 0 0-12.609-24.748L44.722 331.62a15.518 15.518 0 0 1-4.306-13.251l2.273-14.707a45.195 45.195 0 0 0-4.345-27.433l-6.707-13.284a15.515 15.515 0 0 1 0-13.934l6.707-13.284c4.3-8.518 5.803-18.004 4.345-27.432l-2.273-14.707a15.513 15.513 0 0 1 4.306-13.251l10.483-10.562c6.722-6.772 11.083-15.33 12.609-24.747l2.383-14.691c.853-5.26 4.144-10.191 8.189-12.271l13.234-6.806c8.485-4.362 15.276-11.153 19.64-19.639l6.805-13.235c2.08-4.045 7.012-7.337 12.272-8.19l14.691-2.382a45.205 45.205 0 0 0 24.746-12.609l10.562-10.483a15.528 15.528 0 0 1 13.251-4.306l14.708 2.274c9.429 1.456 18.915-.045 27.432-4.345l13.285-6.707a15.52 15.52 0 0 1 13.933 0l13.284 6.707c8.517 4.3 18.002 5.801 27.432 4.345l14.708-2.274c4.83-.742 9.783.863 13.25 4.305l10.562 10.484a45.198 45.198 0 0 0 24.747 12.609l14.689 2.382c5.261.853 10.192 4.145 12.272 8.19l6.806 13.234c4.29 8.343 10.928 15.049 19.215 19.418 0 0 13.401 7.894 13.659 8.026a15.513 15.513 0 0 1 8.189 11.272l2.382 14.69a45.215 45.215 0 0 0 12.609 24.747l10.484 10.562a15.52 15.52 0 0 1 4.306 13.251l-2.274 14.708c-1.457 9.43.045 18.916 4.345 27.432l6.707 13.285a15.514 15.514 0 0 1 .003 13.935zm-128.25-65.674a15.003 15.003 0 0 0-18.544 5.345c-3.314 4.935-18.551 23.363-32.547 23.363-2.484 0-10.18-5.782-18.108-23.656-7.113-16.035-11.892-36.668-11.892-51.344 0-8.284-6.716-15-15-15s-15 6.716-15 15c0 14.676-4.779 35.309-11.892 51.344-7.929 17.874-15.624 23.656-18.108 23.656-13.593 0-28.442-17.329-32.547-23.363a15.001 15.001 0 0 0-27.005 12.001l30 120a14.98 14.98 0 0 0 14.552 11.352h120a14.98 14.98 0 0 0 14.552-11.352l30-120a15 15 0 0 0-8.461-17.346zm-47.803 118.707H207.69L191.7 252.02c5.935 2.433 12.399 3.959 19.278 3.959 19.695 0 34.849-17.85 45-40.094 10.151 22.244 25.305 40.094 45 40.094 6.879 0 13.343-1.527 19.278-3.959z"})]}),(0,n.jsx)("p",{children:(0,n.jsx)("a",{href:e,target:"_blank",rel:"noreferrer noopener",className:"components-button is-primary is-compact",children:(0,a.sprintf)("%s →",(0,a.__)("Buy the PRO version","password-requirements"))})})]})};f.propTypes={url:s.string.isRequired,benefits:s.arrayOf(s.string).isRequired};const x=window.wp.apiFetch;var _=t.n(x);const y=window.wp.compose,j=({message:e,isCentered:s=!1,withPadding:t=!1})=>{const r=["tsc-waiting-indicator"];return s&&r.push("tsc-waiting-indicator--centered"),t&&r.push("tsc-waiting-indicator--with-padding"),(0,n.jsxs)("div",{className:r.join(" "),children:[(0,n.jsx)(c.Spinner,{}),(0,n.jsx)("p",{children:e})]})};j.propTypes={message:s.string.isRequired,isCentered:s.bool,withPadding:s.bool};const v=(e,s)=>{switch(s.type){case"fetchedSettings":return{...e,settings:s.settings,hasFetchedSettings:!0,isSettingsFetchFailed:!1};case"settingsFetchFailed":return{...e,hasFetchedSettings:!0,isSettingsFetchFailed:!0};case"saveSettings":return{...e,isSavingSettings:!0};case"settingsSaved":return{...e,notices:[...e.notices,{id:`n:${Date.now().toString()}`,status:"success",content:(0,a.__)("Settings saved","password-requirements"),isDismissible:!0,explicitDismiss:!1}],isSavingSettings:!1};case"settingsSaveFailed":{let t=(0,a.__)("Settings were not saved, something went wrong.","password-requirements");return"Invalid parameter(s): settings"===s.error.message&&"string"==typeof s.error?.data?.params?.settings&&(t=(0,a.sprintf)(
     4(0,r.__)("If you like this %s, share it with your network and write a review on WordPress.org to help others find it. Thank you!","password-requirements"),l)}),(0,i.jsx)("a",{className:"components-button is-secondary is-compact",href:`https://wordpress.org/support/${l}/${u}/reviews/#new-post`,rel:"noopener noreferrer",target:"_blank",children:(0,r.__)("Write a review","password-requirements")})]}),(0,i.jsxs)(o.PanelBody,{className:"tsc-settings-sidebar__panel",initialOpen:!1,title:(0,r.__)("Share your feedback","password-requirements"),children:[(0,i.jsx)("p",{children:(0,r.__)("We're eager to hear your feedback, feature requests, suggestions for improvements etc; we're waiting for a message from you!","password-requirements")}),(0,i.jsx)("a",{className:"components-button is-secondary is-compact",href:"https://teydeastudio.com/contact/",rel:"noopener noreferrer",target:"_blank",children:(0,r.__)("Contact us","password-requirements")})]})]}),(0,c.applyFilters)("password_requirements__after_sidebar_panel",(0,i.jsx)(e.Fragment,{}),t)]})};u.propTypes={product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,settings:s.object,helpLinks:s.arrayOf(s.shape({url:s.string.isRequired,title:s.string.isRequired}))};const p=e=>"string"!=typeof e||""===e?"":(0,d.cleanForSlug)(e),h=()=>"undefined"!=typeof window&&window.location?p(window.location.hash.replace(/^#/,"")):"",m=(e,s)=>{if(""!==s&&Array.isArray(e))return e.find(e=>{const t=p(e?.name);return""!==t&&t===s})},g=({product:s,settings:t,setSettings:r})=>{const a=(0,e.useMemo)(()=>(0,c.applyFilters)("password_requirements__settings_page_tabs",[],t,r),[t,r]),[n,l]=(0,e.useState)(()=>m(a,h())?.name),[d,g]=(0,e.useState)(0),w=(0,e.useRef)(n);w.current=n,(0,e.useEffect)(()=>{if("undefined"==typeof window)return;const e=()=>{const e=m(a,h())?.name;e!==w.current&&(l(e),g(e=>e+1))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[a]);const x=(0,e.useCallback)(e=>{if(l(e),"undefined"==typeof window||!window.history)return;const s=p(e);if(""===s)return void(""!==window.location.hash&&window.history.replaceState(null,"",window.location.pathname+window.location.search));const t=`#${s}`;window.location.hash!==t&&window.history.replaceState(null,"",t)},[]);return(0,i.jsxs)("div",{className:"tsc-settings-tabs",children:[(0,i.jsx)(o.TabPanel,{initialTabName:n,onSelect:x,tabs:a,className:"tsc-settings-tabs__wrapper",children:s=>(0,i.jsx)(e.Fragment,{children:s.component},s.name)},d),(0,i.jsx)(u,{product:s,settings:t})]})};g.propTypes={product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,settings:s.object.isRequired,setSettings:s.func.isRequired};const w=({url:e,benefits:s})=>{const t="ts-upsell-panel-icon";return(0,i.jsxs)(o.PanelBody,{title:(0,r.__)("Buy the PRO version","password-requirements"),className:"tsc-upsell-panel",children:[0<s.length&&(0,i.jsx)("ul",{children:s.map((e,s)=>(0,i.jsx)("li",{children:e},s))}),(0,i.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"512",height:"512",viewBox:"0 0 511.958 511.958",className:"tsc-upsell-panel__background-icon",children:[(0,i.jsxs)("linearGradient",{id:(0,r.sprintf)("%s-a",t),x1:"255.979",x2:"255.979",y1:"511.958",y2:"0",gradientUnits:"userSpaceOnUse",children:[(0,i.jsx)("stop",{offset:"0",stopColor:"#fd5900"}),(0,i.jsx)("stop",{offset:"1",stopColor:"#ffde00"})]}),(0,i.jsx)(a.Path,{fill:(0,r.sprintf)("url(#%s-a)",t),d:"M255.979 74.979c-99.371 0-181 81.651-181 181 0 99.371 81.651 181 181 181 99.371 0 181-81.651 181-181 0-99.371-81.652-181-181-181zm0 332c-83.262 0-151-67.738-151-151s67.738-151 151-151 151 67.738 151 151-67.739 151-151 151zM507.1 276.466c6.477-12.829 6.477-28.146 0-40.975l-6.707-13.285a15.376 15.376 0 0 1-1.478-9.328l2.273-14.707c2.196-14.202-2.537-28.77-12.662-38.969l-10.483-10.562a15.369 15.369 0 0 1-4.288-8.416l-2.382-14.69c-2.276-14.028-11.105-26.302-23.66-32.927 0 0-13.402-7.895-13.66-8.027a15.359 15.359 0 0 1-6.677-6.678l-6.806-13.234c-6.417-12.48-19.502-21.709-34.149-24.085l-14.689-2.382a15.38 15.38 0 0 1-8.416-4.287L352.755 23.43c-10.199-10.124-24.764-14.854-38.968-12.662l-14.707 2.273a15.369 15.369 0 0 1-9.329-1.477l-13.285-6.707c-12.828-6.476-28.145-6.477-40.973 0l-13.286 6.707a15.394 15.394 0 0 1-9.328 1.478l-14.707-2.273c-14.205-2.197-28.77 2.538-38.969 12.662L148.64 33.914a15.369 15.369 0 0 1-8.415 4.288l-14.691 2.382c-14.646 2.376-27.731 11.604-34.148 24.085l-6.805 13.234a15.369 15.369 0 0 1-6.679 6.678l-13.235 6.806c-12.48 6.417-21.709 19.502-24.084 34.148L38.2 140.226a15.366 15.366 0 0 1-4.288 8.415L23.43 159.203c-10.124 10.199-14.857 24.766-12.662 38.968l2.274 14.708a15.36 15.36 0 0 1-1.478 9.327l-6.707 13.285c-6.476 12.828-6.476 28.145 0 40.974l6.707 13.285a15.376 15.376 0 0 1 1.478 9.328l-2.274 14.708c-2.195 14.202 2.539 28.769 12.662 38.968l10.484 10.563a15.365 15.365 0 0 1 4.288 8.416l2.383 14.689c2.375 14.647 11.604 27.732 24.084 34.149l13.234 6.805a15.371 15.371 0 0 1 6.679 6.679l6.805 13.235c6.418 12.48 19.503 21.709 34.149 24.084l14.69 2.383a15.374 15.374 0 0 1 8.415 4.287l10.563 10.485c10.201 10.124 24.767 14.854 38.968 12.661l14.708-2.274a15.367 15.367 0 0 1 9.327 1.478l13.286 6.707a45.47 45.47 0 0 0 20.486 4.857 45.471 45.471 0 0 0 20.487-4.857l13.285-6.707a15.386 15.386 0 0 1 9.328-1.478l14.707 2.273c14.202 2.194 28.769-2.538 38.969-12.662l10.562-10.484a15.368 15.368 0 0 1 8.416-4.288l14.689-2.383c14.028-2.275 26.303-11.104 32.928-23.66 0 0 7.895-13.402 8.027-13.66a15.372 15.372 0 0 1 6.678-6.678l13.234-6.805c12.78-6.571 21.784-18.963 24.085-33.149l2.382-14.689a15.375 15.375 0 0 1 4.288-8.416c.159-.16.314-.324.465-.491l10.281-11.337c9.943-10.186 14.576-24.624 12.399-38.702l-2.273-14.707a15.371 15.371 0 0 1 1.477-9.329zm-26.78-13.52-6.707 13.284c-4.3 8.517-5.802 18.002-4.345 27.432l2.274 14.708a15.512 15.512 0 0 1-4.306 13.25c-.159.16-.314.324-.466.491l-10.279 11.335c-6.573 6.729-10.84 15.186-12.349 24.482l-2.382 14.689a15.514 15.514 0 0 1-8.19 11.272l-13.235 6.806c-8.343 4.291-15.048 10.928-19.417 19.215 0 0-7.894 13.401-8.026 13.659a15.513 15.513 0 0 1-11.272 8.189l-14.69 2.383a45.208 45.208 0 0 0-24.747 12.609l-10.562 10.484a15.53 15.53 0 0 1-13.251 4.306l-14.707-2.273a45.187 45.187 0 0 0-27.433 4.345l-13.284 6.707a15.518 15.518 0 0 1-13.934 0l-13.285-6.707c-6.406-3.234-13.359-4.886-20.424-4.886-2.329 0-4.67.179-7.008.541l-14.708 2.274a15.522 15.522 0 0 1-13.25-4.305l-10.562-10.484a45.205 45.205 0 0 0-24.746-12.609l-14.691-2.383c-5.26-.853-10.191-4.144-12.271-8.189l-6.806-13.235a45.212 45.212 0 0 0-19.639-19.639l-13.235-6.805c-4.045-2.08-7.336-7.012-8.189-12.272l-2.383-14.689a45.2 45.2 0 0 0-12.609-24.748L44.722 331.62a15.518 15.518 0 0 1-4.306-13.251l2.273-14.707a45.195 45.195 0 0 0-4.345-27.433l-6.707-13.284a15.515 15.515 0 0 1 0-13.934l6.707-13.284c4.3-8.518 5.803-18.004 4.345-27.432l-2.273-14.707a15.513 15.513 0 0 1 4.306-13.251l10.483-10.562c6.722-6.772 11.083-15.33 12.609-24.747l2.383-14.691c.853-5.26 4.144-10.191 8.189-12.271l13.234-6.806c8.485-4.362 15.276-11.153 19.64-19.639l6.805-13.235c2.08-4.045 7.012-7.337 12.272-8.19l14.691-2.382a45.205 45.205 0 0 0 24.746-12.609l10.562-10.483a15.528 15.528 0 0 1 13.251-4.306l14.708 2.274c9.429 1.456 18.915-.045 27.432-4.345l13.285-6.707a15.52 15.52 0 0 1 13.933 0l13.284 6.707c8.517 4.3 18.002 5.801 27.432 4.345l14.708-2.274c4.83-.742 9.783.863 13.25 4.305l10.562 10.484a45.198 45.198 0 0 0 24.747 12.609l14.689 2.382c5.261.853 10.192 4.145 12.272 8.19l6.806 13.234c4.29 8.343 10.928 15.049 19.215 19.418 0 0 13.401 7.894 13.659 8.026a15.513 15.513 0 0 1 8.189 11.272l2.382 14.69a45.215 45.215 0 0 0 12.609 24.747l10.484 10.562a15.52 15.52 0 0 1 4.306 13.251l-2.274 14.708c-1.457 9.43.045 18.916 4.345 27.432l6.707 13.285a15.514 15.514 0 0 1 .003 13.935zm-128.25-65.674a15.003 15.003 0 0 0-18.544 5.345c-3.314 4.935-18.551 23.363-32.547 23.363-2.484 0-10.18-5.782-18.108-23.656-7.113-16.035-11.892-36.668-11.892-51.344 0-8.284-6.716-15-15-15s-15 6.716-15 15c0 14.676-4.779 35.309-11.892 51.344-7.929 17.874-15.624 23.656-18.108 23.656-13.593 0-28.442-17.329-32.547-23.363a15.001 15.001 0 0 0-27.005 12.001l30 120a14.98 14.98 0 0 0 14.552 11.352h120a14.98 14.98 0 0 0 14.552-11.352l30-120a15 15 0 0 0-8.461-17.346zm-47.803 118.707H207.69L191.7 252.02c5.935 2.433 12.399 3.959 19.278 3.959 19.695 0 34.849-17.85 45-40.094 10.151 22.244 25.305 40.094 45 40.094 6.879 0 13.343-1.527 19.278-3.959z"})]}),(0,i.jsx)("p",{children:(0,i.jsx)("a",{href:e,target:"_blank",rel:"noreferrer noopener",className:"components-button is-primary is-compact",children:(0,r.sprintf)("%s →",(0,r.__)("Buy the PRO version","password-requirements"))})})]})};w.propTypes={url:s.string.isRequired,benefits:s.arrayOf(s.string).isRequired};const x=window.wp.apiFetch,f=window.wp.compose,_=({message:e,isCentered:s=!1,withPadding:t=!1})=>{const r=["tsc-waiting-indicator"];return s&&r.push("tsc-waiting-indicator--centered"),t&&r.push("tsc-waiting-indicator--with-padding"),(0,i.jsxs)("div",{className:r.join(" "),children:[(0,i.jsx)(o.Spinner,{}),(0,i.jsx)("p",{children:e})]})};_.propTypes={message:s.string.isRequired,isCentered:s.bool,withPadding:s.bool};const y=(e,s)=>{switch(s.type){case"fetchedSettings":return{...e,settings:s.settings,hasFetchedSettings:!0,isSettingsFetchFailed:!1};case"settingsFetchFailed":return{...e,hasFetchedSettings:!0,isSettingsFetchFailed:!0};case"saveSettings":return{...e,isSavingSettings:!0};case"settingsSaved":return{...e,notices:[...e.notices,{id:`n:${Date.now().toString()}`,status:"success",content:(0,r.__)("Settings saved","password-requirements"),isDismissible:!0,explicitDismiss:!1}],isSavingSettings:!1};case"settingsSaveFailed":{let t=(0,r.__)("Settings were not saved, something went wrong.","password-requirements");return"Invalid parameter(s): settings"===s.error.message&&"string"==typeof s.error?.data?.params?.settings&&(t=(0,r.sprintf)(
    55// Translators: %s - error message.
    66// Translators: %s - error message.
    7 (0,a.__)("Settings were not saved due to validation error: %s Please update the invalid field value and try again.","password-requirements"),s.error.data.params.settings)),{...e,notices:[...e.notices,{id:`n:${Date.now().toString()}`,status:"error",content:t,isDismissible:!0,explicitDismiss:!1}],isSavingSettings:!1}}case"settingsChanged":{const t=(0,d.applyFilters)("password_requirements__pre_change_settings",s.settings);return{...e,settings:t}}case"noticeRemoved":return{...e,notices:[...e.notices.filter(e=>e.id!==s.noticeId)]}}return e},b=(0,y.createHigherOrderComponent)(s=>t=>{const{product:r,LoadingContainer:i}=t,{key:l,type:o}=r,{slug:u}=window.teydeaStudio[l][o],{nonce:h}=window.teydeaStudio[l].settingsPage,[p,m]=(0,e.useReducer)(v,{notices:[],settings:{},hasFetchedSettings:!1,isSettingsFetchFailed:!1,isSavingSettings:!1});return(0,e.useEffect)(()=>{!0===p.isSavingSettings&&x({path:`/${u}/v1/settings`,method:"POST",data:{nonce:h,settings:p.settings}}).then(async e=>(m({type:"settingsSaved"}),await(d.doActionAsync??d.doAction)("password_requirements__settings_saved"),e)).catch(e=>{console.error(e),m({type:"settingsSaveFailed",error:e})})},[p.isSavingSettings]),(0,e.useEffect)(()=>{x({path:`/${u}/v1/settings`,method:"GET"}).then(e=>(m({type:"fetchedSettings",settings:e}),e)).catch(e=>{console.error(e),m({type:"settingsFetchFailed"})})},[]),!1===p.hasFetchedSettings?(0,n.jsx)(i,{children:(0,n.jsx)(j,{message:(0,a.__)("Loading…","password-requirements"),isCentered:!0,withPadding:!0})}):!0===p.isSettingsFetchFailed?(0,n.jsx)(i,{children:(0,n.jsxs)(c.Notice,{status:"error",isDismissible:!1,children:[(0,n.jsx)("p",{children:(0,a.__)("Settings fetch failed.","password-requirements")}),(0,n.jsx)("p",{children:(0,a.__)("Please try again; if the issue keeps repeating, reach out to our support team.","password-requirements")})]})}):(0,n.jsxs)("div",{className:"tsc-with-settings",children:[(0,n.jsx)(c.SnackbarList,{notices:p.notices,onRemove:e=>{m({type:"noticeRemoved",noticeId:e})}}),(0,n.jsx)(s,{...t,SaveSettingsButton:()=>(0,n.jsx)(c.Button,{__next40pxDefaultSize:!0,disabled:p.isSavingSettings||!p.hasFetchedSettings||p.isSettingsFetchFailed,isBusy:p.isSavingSettings,onClick:()=>{m({type:"saveSettings"})},variant:"primary",children:p.isSavingSettings?(0,a.__)("Saving…","password-requirements"):(0,a.__)("Save all settings","password-requirements")}),settings:p.settings,setSettings:e=>{m({type:"settingsChanged",settings:e})}})]})},"withSettings"),S=({children:e,className:s="",help:t="",label:r="",withBaseControl:a=!1,withBoxBorder:i=!1,withReducedGap:l=!1,withRowDirection:o=!1,...d})=>{let h=[s,"tsc-fields-group",l?"tsc-fields-group--with-reduced-gap":"",i?"tsc-fields-group--with-box-border":"",o?"tsc-fields-group--with-row-direction":""];if(h=h.filter(e=>""!==e),a){const{baseControlProps:s,controlProps:a}=(0,c.useBaseControlProps)({id:(p=(0,u.cleanForSlug)(r),`npm-components-fields-group-${p}`)});return(0,n.jsx)(c.BaseControl,{...s,__nextHasNoMarginBottom:!0,label:r,help:t,children:(0,n.jsx)("div",{...a,className:h.join(" "),...d,children:e})})}var p;return(0,n.jsx)("div",{className:h.join(" "),...d,children:e})};S.propTypes={children:s.element.isRequired,className:s.string,help:s.string,label:s.string,withBaseControl:s.bool,withBoxBorder:s.bool,withReducedGap:s.bool,withRowDirection:s.bool};const q=({settings:s,setSettings:t})=>{const r=Array.isArray(s.data?.general?.restrictedPhrases)?s.data.general.restrictedPhrases:[],i=Array.isArray(window.teydeaStudio?.passwordRequirements?.settingsPage?.runtimeRestrictedPhrases)?window.teydeaStudio.passwordRequirements.settingsPage.runtimeRestrictedPhrases:[];return(0,n.jsx)(c.Panel,{children:(0,n.jsx)(c.PanelBody,{title:(0,a.__)("Restricted words and phrases","password-requirements"),children:(0,n.jsxs)(S,{children:[(0,n.jsx)(c.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Words and phrases that user passwords cannot contain","password-requirements"),help:(0,a.__)('One entry per line. Matching is case-insensitive: a password is rejected if any entry appears anywhere inside it. Empty lines and lines that start with "#" are ignored. Use this to block site-specific tokens like your brand name, product names, your city, or a year token (for example: acme, summer, 2026).',"password-requirements"),rows:8,value:r.join("\n"),onChange:e=>{t({...s,data:{...s.data,general:{...s.data?.general??{},restrictedPhrases:e.split(/\r?\n/)}}})}}),0<i.length&&(0,n.jsxs)(c.Notice,{isDismissible:!1,status:"info",children:[(0,n.jsx)("p",{children:(0,a.__)("The following phrases are also blocked automatically — added by your site or by other plugins. They are not stored in the field above and cannot be edited from here:","password-requirements")}),(0,n.jsx)("p",{children:i.map((s,t)=>(0,n.jsxs)(e.Fragment,{children:[0<t&&", ",(0,n.jsx)("code",{children:s})]},s))})]})]})})})};q.propTypes={settings:r().object.isRequired,setSettings:r().func.isRequired};let C=0;const P=e=>" "===e?(0,a.__)("(space)","password-requirements"):"\t"===e?(0,a.__)("(tab)","password-requirements"):e,M=({help:e,label:s,onChange:t,value:r})=>{const{baseControlProps:a,controlProps:i}=(0,c.useBaseControlProps)({});return(0,n.jsxs)(c.BaseControl,{...a,__nextHasNoMarginBottom:!0,label:s,className:"tsc-character-token-control",children:[0<r.length&&(0,n.jsx)("div",{className:"tsc-character-token-control__characters-list",children:r.map((e,s)=>(0,n.jsx)(c.Button,{__next40pxDefaultSize:!0,size:"compact",variant:"secondary",onClick:()=>{const e=[...r];e.splice(s,1),t(e)},children:P(e)},`${e}-${s}`))}),(0,n.jsx)(c.TextControl,{...i,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:"",help:e,value:"",onChange:e=>{const s=[...e];1<s.length&&(e=s[s.length-1]),""!==e&&(r.includes(e)||t([...r,e]))}})]})};M.propTypes={help:s.string.isRequired,label:s.string.isRequired,onChange:s.func.isRequired,value:s.array.isRequired};const k=({message:e,id:s})=>(0,n.jsx)("div",{className:"tsc-field-notice",id:s,"aria-live":"polite",children:(0,n.jsx)("p",{children:e})});k.propTypes={message:s.string.isRequired,id:s.string};const R=(e,s,t)=>(e=""===e?s:Number.parseInt(e,10),(isNaN(e)||s>e)&&(e=s),null!==t&&t<e&&(e=t),e),N=(0,c.withFocusOutside)(class extends e.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}});N.propTypes={children:s.element.isRequired,onFocusOutside:s.func.isRequired};const A=({label:s,help:t,min:r,max:i,value:l,defaultValue:o,disabled:d=!1,onChange:u})=>{const[h,p]=(0,e.useState)(""),[m,g]=(0,e.useState)(l.toString()),w=(0,y.useInstanceId)(A,"tsc-integer-control"),f=`${w}-notice`,x=[t?`${w}__help`:null,""!==h?f:null].filter(Boolean).join(" ")||void 0;return(void 0===i||r>i)&&(i=null),(0,e.useEffect)(()=>{g(l.toString())},[l]),(0,e.useEffect)(()=>{m===R(m,r,i).toString()?p(""):p(null!==i?(0,a.sprintf)(
     7(0,r.__)("Settings were not saved due to validation error: %s Please update the invalid field value and try again.","password-requirements"),s.error.data.params.settings)),{...e,notices:[...e.notices,{id:`n:${Date.now().toString()}`,status:"error",content:t,isDismissible:!0,explicitDismiss:!1}],isSavingSettings:!1}}case"settingsChanged":{const t=(0,c.applyFilters)("password_requirements__pre_change_settings",s.settings);return{...e,settings:t}}case"noticeRemoved":return{...e,notices:[...e.notices.filter(e=>e.id!==s.noticeId)]}}return e},j=(0,f.createHigherOrderComponent)(s=>t=>{const{product:a,LoadingContainer:n}=t,{key:l,type:d}=a,{slug:u}=window.teydeaStudio[l][d],{nonce:p}=window.teydeaStudio[l].settingsPage,[h,m]=(0,e.useReducer)(y,{notices:[],settings:{},hasFetchedSettings:!1,isSettingsFetchFailed:!1,isSavingSettings:!1});return(0,e.useEffect)(()=>{!0===h.isSavingSettings&&x({path:`/${u}/v1/settings`,method:"POST",data:{nonce:p,settings:h.settings}}).then(async e=>(m({type:"settingsSaved"}),await(c.doActionAsync??c.doAction)("password_requirements__settings_saved"),e)).catch(e=>{console.error(e),m({type:"settingsSaveFailed",error:e})})},[h.isSavingSettings]),(0,e.useEffect)(()=>{x({path:`/${u}/v1/settings`,method:"GET"}).then(e=>(m({type:"fetchedSettings",settings:e}),e)).catch(e=>{console.error(e),m({type:"settingsFetchFailed"})})},[]),!1===h.hasFetchedSettings?(0,i.jsx)(n,{children:(0,i.jsx)(_,{message:(0,r.__)("Loading…","password-requirements"),isCentered:!0,withPadding:!0})}):!0===h.isSettingsFetchFailed?(0,i.jsx)(n,{children:(0,i.jsxs)(o.Notice,{status:"error",isDismissible:!1,children:[(0,i.jsx)("p",{children:(0,r.__)("Settings fetch failed.","password-requirements")}),(0,i.jsx)("p",{children:(0,r.__)("Please try again; if the issue keeps repeating, reach out to our support team.","password-requirements")})]})}):(0,i.jsxs)("div",{className:"tsc-with-settings",children:[(0,i.jsx)(o.SnackbarList,{notices:h.notices,onRemove:e=>{m({type:"noticeRemoved",noticeId:e})}}),(0,i.jsx)(s,{...t,SaveSettingsButton:()=>(0,i.jsx)(o.Button,{__next40pxDefaultSize:!0,disabled:h.isSavingSettings||!h.hasFetchedSettings||h.isSettingsFetchFailed,isBusy:h.isSavingSettings,onClick:()=>{m({type:"saveSettings"})},variant:"primary",children:h.isSavingSettings?(0,r.__)("Saving…","password-requirements"):(0,r.__)("Save all settings","password-requirements")}),settings:h.settings,setSettings:e=>{m({type:"settingsChanged",settings:e})}})]})},"withSettings"),v=({children:e,className:s="",help:t="",label:r="",withBaseControl:a=!1,withBoxBorder:n=!1,withReducedGap:l=!1,withRowDirection:c=!1,...u})=>{let p=[s,"tsc-fields-group",l?"tsc-fields-group--with-reduced-gap":"",n?"tsc-fields-group--with-box-border":"",c?"tsc-fields-group--with-row-direction":""];if(p=p.filter(e=>""!==e),a){const{baseControlProps:s,controlProps:a}=(0,o.useBaseControlProps)({id:(h=(0,d.cleanForSlug)(r),`npm-components-fields-group-${h}`)});return(0,i.jsx)(o.BaseControl,{...s,__nextHasNoMarginBottom:!0,label:r,help:t,children:(0,i.jsx)("div",{...a,className:p.join(" "),...u,children:e})})}var h;return(0,i.jsx)("div",{className:p.join(" "),...u,children:e})};v.propTypes={children:s.element.isRequired,className:s.string,help:s.string,label:s.string,withBaseControl:s.bool,withBoxBorder:s.bool,withReducedGap:s.bool,withRowDirection:s.bool};const b=({settings:s,setSettings:t})=>{const a=Array.isArray(s.data?.general?.restrictedPhrases)?s.data.general.restrictedPhrases:[],n=Array.isArray(window.teydeaStudio?.passwordRequirements?.settingsPage?.runtimeRestrictedPhrases)?window.teydeaStudio.passwordRequirements.settingsPage.runtimeRestrictedPhrases:[];return(0,i.jsx)(o.Panel,{children:(0,i.jsx)(o.PanelBody,{title:(0,r.__)("Restricted words and phrases","password-requirements"),children:(0,i.jsxs)(v,{children:[(0,i.jsx)(o.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Words and phrases that user passwords cannot contain","password-requirements"),help:(0,r.__)('One entry per line. Matching is case-insensitive: a password is rejected if any entry appears anywhere inside it. Empty lines and lines that start with "#" are ignored. Use this to block site-specific tokens like your brand name, product names, your city, or a year token (for example: acme, summer, 2026).',"password-requirements"),rows:8,value:a.join("\n"),onChange:e=>{t({...s,data:{...s.data,general:{...s.data?.general??{},restrictedPhrases:e.split(/\r?\n/)}}})}}),0<n.length&&(0,i.jsxs)(o.Notice,{isDismissible:!1,status:"info",children:[(0,i.jsx)("p",{children:(0,r.__)("The following phrases are also blocked automatically — added by your site or by other plugins. They are not stored in the field above and cannot be edited from here:","password-requirements")}),(0,i.jsx)("p",{children:n.map((s,t)=>(0,i.jsxs)(e.Fragment,{children:[0<t&&", ",(0,i.jsx)("code",{children:s})]},s))})]})]})})})};b.propTypes={settings:s.object.isRequired,setSettings:s.func.isRequired};let C=0;const S=e=>" "===e?(0,r.__)("(space)","password-requirements"):"\t"===e?(0,r.__)("(tab)","password-requirements"):e,q=({help:e,label:s,onChange:t,value:r})=>{const{baseControlProps:a,controlProps:n}=(0,o.useBaseControlProps)({});return(0,i.jsxs)(o.BaseControl,{...a,__nextHasNoMarginBottom:!0,label:s,className:"tsc-character-token-control",children:[0<r.length&&(0,i.jsx)("div",{className:"tsc-character-token-control__characters-list",children:r.map((e,s)=>(0,i.jsx)(o.Button,{__next40pxDefaultSize:!0,size:"compact",variant:"secondary",onClick:()=>{const e=[...r];e.splice(s,1),t(e)},children:S(e)},`${e}-${s}`))}),(0,i.jsx)(o.TextControl,{...n,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:"",help:e,value:"",onChange:e=>{const s=[...e];1<s.length&&(e=s[s.length-1]),""!==e&&(r.includes(e)||t([...r,e]))}})]})};q.propTypes={help:s.string.isRequired,label:s.string.isRequired,onChange:s.func.isRequired,value:s.array.isRequired};const P=({message:e,id:s})=>(0,i.jsx)("div",{className:"tsc-field-notice",id:s,"aria-live":"polite",children:(0,i.jsx)("p",{children:e})});P.propTypes={message:s.string.isRequired,id:s.string};const M=(e,s,t)=>(e=""===e?s:Number.parseInt(e,10),(isNaN(e)||s>e)&&(e=s),null!==t&&t<e&&(e=t),e),k=(0,o.withFocusOutside)(class extends e.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}});k.propTypes={children:s.element.isRequired,onFocusOutside:s.func.isRequired};const R=({label:s,help:t,min:a,max:n,value:l,defaultValue:c,disabled:d=!1,onChange:u})=>{const[p,h]=(0,e.useState)(""),[m,g]=(0,e.useState)(l.toString()),w=(0,f.useInstanceId)(R,"tsc-integer-control"),x=`${w}-notice`,_=[t?`${w}__help`:null,""!==p?x:null].filter(Boolean).join(" ")||void 0;return(void 0===n||a>n)&&(n=null),(0,e.useEffect)(()=>{g(l.toString())},[l]),(0,e.useEffect)(()=>{m===M(m,a,n).toString()?h(""):h(null!==n?(0,r.sprintf)(
    88// Translators: %1$s - field value, %2$d - minimum accepted value, %3$d - maximum accepted value.
    99// Translators: %1$s - field value, %2$d - minimum accepted value, %3$d - maximum accepted value.
    10 (0,a.__)('"%1$s" is not within the accepted range (%2$d-%3$d).',"password-requirements"),m,r,i):(0,a.sprintf)(
     10(0,r.__)('"%1$s" is not within the accepted range (%2$d-%3$d).',"password-requirements"),m,a,n):(0,r.sprintf)(
    1111// Translators: %1$s - field value, %2$d - minimum accepted value.
    1212// Translators: %1$s - field value, %2$d - minimum accepted value.
    13 (0,a.__)('"%1$s" must be greater than or equal to %2$d.',"password-requirements"),m,r))},[m,r,i]),(0,n.jsxs)("div",{className:"tsc-integer-control",children:[(0,n.jsx)(N,{onFocusOutside:()=>{if(d)return;const e=m===R(m,r,i).toString()?Number.parseInt(m,10):o;e!==l&&u(e),g(e.toString())},children:(0,n.jsx)(c.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,id:w,label:s,help:t,value:m,type:"number",disabled:d,"aria-describedby":x,onChange:e=>{g(""===e?"":Number.parseInt(e,10).toString())}})}),""!==h&&(0,n.jsx)(k,{id:f,message:h})]})};A.propTypes={label:s.string.isRequired,help:s.string,min:s.number.isRequired,max:s.number,value:s.number.isRequired,defaultValue:s.number.isRequired,disabled:s.bool,onChange:s.func.isRequired};const B=({children:e,title:s})=>(0,n.jsxs)("div",{className:"tsc-panel-section",children:[(0,n.jsx)("h2",{className:"tsc-panel-section__title",children:s}),(0,n.jsx)("div",{className:"tsc-panel-section__fields",children:e})]});B.propTypes={children:s.element.isRequired,title:s.string.isRequired};const T=window.wp.a11y,L=({data:s,onChange:t})=>{const r=R(s["ruleSettings.maximumConsecutiveUserSymbols"],0,50),i=!0===s.isActive&&!0===s["rules.complexity"]&&!0===s["ruleSettings.complexity.consecutiveUserSymbols"],l=Array.isArray(s["ruleSettings.restrictedCharacters"])?s["ruleSettings.restrictedCharacters"].join(""):"";return(0,n.jsx)("div",{className:"password-requirements-settings-tabs__container",children:(0,n.jsxs)(c.Panel,{header:(0,a.sprintf)("%1$s: %2$s",s.isActive?(0,a.__)("Policy","password-requirements"):(0,a.__)("Inactive Policy","password-requirements"),""===s.name?"-":s.name),children:[(0,n.jsx)(B,{title:(0,a.__)("General settings","password-requirements"),children:(0,n.jsxs)(S,{children:[(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Activate this policy","password-requirements"),help:(0,a.__)("You can deactivate any policy if you want to keep its settings but don't want to enforce it for users.","password-requirements"),checked:s.isActive,onChange:()=>{t({...s,isActive:!s.isActive})}}),(0,n.jsx)(c.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,a.__)("Policy name","password-requirements"),value:s.name,help:(0,a.__)("We suggest using a descriptive name.","password-requirements"),onChange:e=>{t({...s,name:e})}})]})}),(0,n.jsx)(B,{title:(0,a.__)("Enabled rules","password-requirements"),children:(0,n.jsxs)(S,{children:[(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Enforce the minimum password length","password-requirements"),help:(0,a.sprintf)(
     13(0,r.__)('"%1$s" must be greater than or equal to %2$d.',"password-requirements"),m,a))},[m,a,n]),(0,i.jsxs)("div",{className:"tsc-integer-control",children:[(0,i.jsx)(k,{onFocusOutside:()=>{if(d)return;const e=m===M(m,a,n).toString()?Number.parseInt(m,10):c;e!==l&&u(e),g(e.toString())},children:(0,i.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,id:w,label:s,help:t,value:m,type:"number",disabled:d,"aria-describedby":_,onChange:e=>{g(""===e?"":Number.parseInt(e,10).toString())}})}),""!==p&&(0,i.jsx)(P,{id:x,message:p})]})};R.propTypes={label:s.string.isRequired,help:s.string,min:s.number.isRequired,max:s.number,value:s.number.isRequired,defaultValue:s.number.isRequired,disabled:s.bool,onChange:s.func.isRequired};const N=({children:e,title:s})=>(0,i.jsxs)("div",{className:"tsc-panel-section",children:[(0,i.jsx)("h2",{className:"tsc-panel-section__title",children:s}),(0,i.jsx)("div",{className:"tsc-panel-section__fields",children:e})]});N.propTypes={children:s.element.isRequired,title:s.string.isRequired};const L=window.wp.a11y,H=({data:s,onChange:t})=>{const a=M(s["ruleSettings.maximumConsecutiveUserSymbols"],0,50),n=!0===s.isActive&&!0===s["rules.complexity"]&&!0===s["ruleSettings.complexity.consecutiveUserSymbols"],l=Array.isArray(s["ruleSettings.restrictedCharacters"])?s["ruleSettings.restrictedCharacters"].join(""):"";return(0,i.jsx)("div",{className:"password-requirements-settings-tabs__container",children:(0,i.jsxs)(o.Panel,{header:(0,r.sprintf)("%1$s: %2$s",s.isActive?(0,r.__)("Policy","password-requirements"):(0,r.__)("Inactive Policy","password-requirements"),""===s.name?"-":s.name),children:[(0,i.jsx)(N,{title:(0,r.__)("General settings","password-requirements"),children:(0,i.jsxs)(v,{children:[(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Activate this policy","password-requirements"),help:(0,r.__)("You can deactivate any policy if you want to keep its settings but don't want to enforce it for users.","password-requirements"),checked:s.isActive,onChange:()=>{t({...s,isActive:!s.isActive})}}),(0,i.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,r.__)("Policy name","password-requirements"),value:s.name,help:(0,r.__)("We suggest using a descriptive name.","password-requirements"),onChange:e=>{t({...s,name:e})}})]})}),(0,i.jsx)(N,{title:(0,r.__)("Enabled rules","password-requirements"),children:(0,i.jsxs)(v,{children:[(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Enforce the minimum password length","password-requirements"),help:(0,r.sprintf)(
    1414// Translators: %s - minimum password length (number of characters with text).
    1515// Translators: %s - minimum password length (number of characters with text).
    16 (0,a.__)("Once enabled, the users' password length must equal or exceed the defined value (currently set to %s).","password-requirements"),(0,a.sprintf)(
     16(0,r.__)("Once enabled, the users' password length must equal or exceed the defined value (currently set to %s).","password-requirements"),(0,r.sprintf)(
    1717// Translators: %d - number of characters.
    1818// Translators: %d - number of characters.
    19 (0,a._n)("%d character","%d characters",s["ruleSettings.minimumLength"],"password-requirements"),s["ruleSettings.minimumLength"])),checked:s["rules.minimumLength"],onChange:()=>{t({...s,"rules.minimumLength":!s["rules.minimumLength"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Enforce the maximum password length","password-requirements"),help:(0,a.sprintf)(
     19(0,r._n)("%d character","%d characters",s["ruleSettings.minimumLength"],"password-requirements"),s["ruleSettings.minimumLength"])),checked:s["rules.minimumLength"],onChange:()=>{t({...s,"rules.minimumLength":!s["rules.minimumLength"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Enforce the maximum password length","password-requirements"),help:(0,r.sprintf)(
    2020// Translators: %s - maximum password length (number of characters with text).
    2121// Translators: %s - maximum password length (number of characters with text).
    22 (0,a.__)("Once enabled, the users' password length must be equal or less than the defined value (currently set to %s).","password-requirements"),(0,a.sprintf)(
     22(0,r.__)("Once enabled, the users' password length must be equal or less than the defined value (currently set to %s).","password-requirements"),(0,r.sprintf)(
    2323// Translators: %d - number of characters.
    2424// Translators: %d - number of characters.
    25 (0,a._n)("%d character","%d characters",s["ruleSettings.maximumLength"],"password-requirements"),s["ruleSettings.maximumLength"])),checked:s["rules.maximumLength"],onChange:()=>{t({...s,"rules.maximumLength":!s["rules.maximumLength"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Enforce the minimum password age","password-requirements"),help:(0,a.sprintf)(
     25(0,r._n)("%d character","%d characters",s["ruleSettings.maximumLength"],"password-requirements"),s["ruleSettings.maximumLength"])),checked:s["rules.maximumLength"],onChange:()=>{t({...s,"rules.maximumLength":!s["rules.maximumLength"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Enforce the minimum password age","password-requirements"),help:(0,r.sprintf)(
    2626// Translators: %s - minimum password age (number of days with text).
    2727// Translators: %s - minimum password age (number of days with text).
    28 (0,a.__)("Once enabled, users can only change their passwords if the current password has been used for at least a defined period (currently set to %s).","password-requirements"),(0,a.sprintf)(
     28(0,r.__)("Once enabled, users can only change their passwords if the current password has been used for at least a defined period (currently set to %s).","password-requirements"),(0,r.sprintf)(
    2929// Translators: %d - number of days.
    3030// Translators: %d - number of days.
    31 (0,a._n)("%d day","%d days",s["ruleSettings.minimumAge"],"password-requirements"),s["ruleSettings.minimumAge"])),checked:s["rules.minimumAge"],onChange:()=>{t({...s,"rules.minimumAge":!s["rules.minimumAge"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Enforce the maximum password age","password-requirements"),help:(0,a.sprintf)(
     31(0,r._n)("%d day","%d days",s["ruleSettings.minimumAge"],"password-requirements"),s["ruleSettings.minimumAge"])),checked:s["rules.minimumAge"],onChange:()=>{t({...s,"rules.minimumAge":!s["rules.minimumAge"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Enforce the maximum password age","password-requirements"),help:(0,r.sprintf)(
    3232// Translators: %s - maximum password age (number of days with text).
    3333// Translators: %s - maximum password age (number of days with text).
    34 (0,a.__)("Once enabled, users will have to change their passwords if the current password has been in use for a defined period (currently set to %s).","password-requirements"),(0,a.sprintf)(
     34(0,r.__)("Once enabled, users will have to change their passwords if the current password has been in use for a defined period (currently set to %s).","password-requirements"),(0,r.sprintf)(
    3535// Translators: %d - number of days.
    3636// Translators: %d - number of days.
    37 (0,a._n)("%d day","%d days",s["ruleSettings.maximumAge"],"password-requirements"),s["ruleSettings.maximumAge"])),checked:s["rules.maximumAge"],onChange:()=>{t({...s,"rules.maximumAge":!s["rules.maximumAge"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Enforce the password complexity requirements","password-requirements"),help:(0,e.createInterpolateElement)((0,a.sprintf)(
     37(0,r._n)("%d day","%d days",s["ruleSettings.maximumAge"],"password-requirements"),s["ruleSettings.maximumAge"])),checked:s["rules.maximumAge"],onChange:()=>{t({...s,"rules.maximumAge":!s["rules.maximumAge"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Enforce the password complexity requirements","password-requirements"),help:(0,e.createInterpolateElement)((0,r.sprintf)(
    3838// Translators: %s - complexity explanation.
    3939// Translators: %s - complexity explanation.
    40 (0,a.__)("Once enabled, users' password must meet the complexity requirements. <explanation>%s</explanation>","password-requirements"),(()=>{const e=[];if(!0===s["ruleSettings.complexity.uppercase"]&&e.push((0,a.__)("uppercase letter(s)","password-requirements")),!0===s["ruleSettings.complexity.lowercase"]&&e.push((0,a.__)("lowercase letter(s)","password-requirements")),!0===s["ruleSettings.complexity.digit"]&&e.push((0,a.__)("base digit(s) (0 through 9)","password-requirements")),!0===s["ruleSettings.complexity.specialCharacter"]&&e.push((0,a.__)("special character(s)","password-requirements")),!0===s["ruleSettings.complexity.uniqueCharacters"]&&e.push((0,a.sprintf)(
     40(0,r.__)("Once enabled, users' password must meet the complexity requirements. <explanation>%s</explanation>","password-requirements"),(()=>{const e=[];if(!0===s["ruleSettings.complexity.uppercase"]&&e.push((0,r.__)("uppercase letter(s)","password-requirements")),!0===s["ruleSettings.complexity.lowercase"]&&e.push((0,r.__)("lowercase letter(s)","password-requirements")),!0===s["ruleSettings.complexity.digit"]&&e.push((0,r.__)("base digit(s) (0 through 9)","password-requirements")),!0===s["ruleSettings.complexity.specialCharacter"]&&e.push((0,r.__)("special character(s)","password-requirements")),!0===s["ruleSettings.complexity.uniqueCharacters"]&&e.push((0,r.sprintf)(
    4141// Translators: %d - number of characters.
    4242// Translators: %d - number of characters.
    43 (0,a._n)("%d distinct character","%d distinct characters",s["ruleSettings.minimumUniqueCharacters"],"password-requirements"),s["ruleSettings.minimumUniqueCharacters"])),!0===s["ruleSettings.complexity.consecutiveUserSymbols"]&&(0===r?e.push((0,a.__)("no symbols from the user's name or display name","password-requirements")):e.push((0,a.sprintf)(
     43(0,r._n)("%d distinct character","%d distinct characters",s["ruleSettings.minimumUniqueCharacters"],"password-requirements"),s["ruleSettings.minimumUniqueCharacters"])),!0===s["ruleSettings.complexity.consecutiveUserSymbols"]&&(0===a?e.push((0,r.__)("no symbols from the user's name or display name","password-requirements")):e.push((0,r.sprintf)(
    4444// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    4545// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    46 (0,a._n)("no more than %d consecutive symbol from the user's name or display name","no more than %d consecutive symbols from the user's name or display name",r,"password-requirements"),r))),!0===s["ruleSettings.complexity.restrictedCharacters"]&&Array.isArray(s["ruleSettings.restrictedCharacters"])&&0<s["ruleSettings.restrictedCharacters"].length&&e.push((0,a.sprintf)(
     46(0,r._n)("no more than %d consecutive symbol from the user's name or display name","no more than %d consecutive symbols from the user's name or display name",a,"password-requirements"),a))),!0===s["ruleSettings.complexity.restrictedCharacters"]&&Array.isArray(s["ruleSettings.restrictedCharacters"])&&0<s["ruleSettings.restrictedCharacters"].length&&e.push((0,r.sprintf)(
    4747// Translators: %s - restricted characters phrase, <code /> - the restricted characters themselves.
    4848// Translators: %s - restricted characters phrase, <code /> - the restricted characters themselves.
    49 (0,a.__)("not to contain the following %s: <code />","password-requirements"),(0,a._n)("restricted character","restricted characters",s["ruleSettings.restrictedCharacters"].length,"password-requirements"))),0===e.length)return(0,a.__)("Currently, all complexity rules for this password policy are disabled.","password-requirements");let t="";if(1===e.length)t=e[0];else{const s=e.pop();t=(0,a.sprintf)(
     49(0,r.__)("not to contain the following %s: <code />","password-requirements"),(0,r._n)("restricted character","restricted characters",s["ruleSettings.restrictedCharacters"].length,"password-requirements"))),0===e.length)return(0,r.__)("Currently, all complexity rules for this password policy are disabled.","password-requirements");let t="";if(1===e.length)t=e[0];else{const s=e.pop();t=(0,r.sprintf)(
    5050// Translators: %1$s - all parts except last, %2$s - last part.
    5151// Translators: %1$s - all parts except last, %2$s - last part.
    52 (0,a.__)("%1$s, and %2$s","password-requirements"),e.join(", "),s)}return(0,a.sprintf)(
     52(0,r.__)("%1$s, and %2$s","password-requirements"),e.join(", "),s)}return(0,r.sprintf)(
    5353// Translators: %s - complexity explanation.
    5454// Translators: %s - complexity explanation.
    55 (0,a.__)("Currently set to require: %s.","password-requirements"),t)})()),{explanation:(0,n.jsx)("span",{}),code:(0,n.jsx)("code",{children:l})}),checked:s["rules.complexity"],onChange:()=>{t({...s,"rules.complexity":!s["rules.complexity"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Require current password when changing password","password-requirements"),help:(0,a.__)("Once enabled, users must provide their current password to change it; applies to the User Profile screen.","password-requirements"),checked:s["rules.requireCurrentPassword"],onChange:()=>{t({...s,"rules.requireCurrentPassword":!s["rules.requireCurrentPassword"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Apply the restricted words and phrases list","password-requirements"),help:(0,a.__)('Once enabled, passwords containing any word or phrase from the site-wide list will be rejected. Manage the list under "General" tab.',"password-requirements"),checked:s["rules.restrictedPhrases"],onChange:()=>{t({...s,"rules.restrictedPhrases":!s["rules.restrictedPhrases"]})}})]})}),(0,n.jsx)(B,{title:(0,a.__)("Rule settings","password-requirements"),children:(0,n.jsxs)(S,{children:[(0,n.jsx)(A,{label:(0,a.__)("Minimum password length","password-requirements"),help:(0,a.__)("Number of characters required in passwords; a valid value should be between 1 and 50.","password-requirements"),min:1,max:50,value:s["ruleSettings.minimumLength"],defaultValue:10,onChange:e=>{t({...s,"ruleSettings.minimumLength":e})}}),(0,n.jsx)(A,{label:(0,a.__)("Maximum password length","password-requirements"),help:(0,a.__)("Maximum number of characters allowed in passwords; a valid value should be between 64 and 512.","password-requirements"),min:64,max:512,value:s["ruleSettings.maximumLength"],defaultValue:256,onChange:e=>{t({...s,"ruleSettings.maximumLength":e})}}),(0,n.jsx)(A,{label:(0,a.__)("Minimum password age","password-requirements"),help:(0,a.__)("Number of days; a valid value should be between 1 and 1000.","password-requirements"),min:1,max:1e3,value:s["ruleSettings.minimumAge"],defaultValue:2,onChange:e=>{t({...s,"ruleSettings.minimumAge":e})}}),(0,n.jsx)(A,{label:(0,a.__)("Maximum password age","password-requirements"),help:(0,a.__)("Number of days; a valid value should be between 1 and 1000.","password-requirements"),min:1,max:1e3,value:s["ruleSettings.maximumAge"],defaultValue:30,onChange:e=>{t({...s,"ruleSettings.maximumAge":e})}}),(0,n.jsxs)(S,{label:(0,a.__)("Password complexity requirements","password-requirements"),withBaseControl:!0,withReducedGap:!0,children:[(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Uppercase letter(s) required","password-requirements"),checked:s["ruleSettings.complexity.uppercase"],onChange:()=>{t({...s,"ruleSettings.complexity.uppercase":!s["ruleSettings.complexity.uppercase"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Lowercase letter(s) required","password-requirements"),checked:s["ruleSettings.complexity.lowercase"],onChange:()=>{t({...s,"ruleSettings.complexity.lowercase":!s["ruleSettings.complexity.lowercase"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Base digit(s) (0 through 9) required","password-requirements"),checked:s["ruleSettings.complexity.digit"],onChange:()=>{t({...s,"ruleSettings.complexity.digit":!s["ruleSettings.complexity.digit"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.sprintf)(
     55(0,r.__)("Currently set to require: %s.","password-requirements"),t)})()),{explanation:(0,i.jsx)("span",{}),code:(0,i.jsx)("code",{children:l})}),checked:s["rules.complexity"],onChange:()=>{t({...s,"rules.complexity":!s["rules.complexity"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Require current password when changing password","password-requirements"),help:(0,r.__)("Once enabled, users must provide their current password to change it; applies to the User Profile screen.","password-requirements"),checked:s["rules.requireCurrentPassword"],onChange:()=>{t({...s,"rules.requireCurrentPassword":!s["rules.requireCurrentPassword"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Apply the restricted words and phrases list","password-requirements"),help:(0,r.__)('Once enabled, passwords containing any word or phrase from the site-wide list will be rejected. Manage the list under "General" tab.',"password-requirements"),checked:s["rules.restrictedPhrases"],onChange:()=>{t({...s,"rules.restrictedPhrases":!s["rules.restrictedPhrases"]})}})]})}),(0,i.jsx)(N,{title:(0,r.__)("Rule settings","password-requirements"),children:(0,i.jsxs)(v,{children:[(0,i.jsx)(R,{label:(0,r.__)("Minimum password length","password-requirements"),help:(0,r.__)("Number of characters required in passwords; a valid value should be between 1 and 50.","password-requirements"),min:1,max:50,value:s["ruleSettings.minimumLength"],defaultValue:10,onChange:e=>{t({...s,"ruleSettings.minimumLength":e})}}),(0,i.jsx)(R,{label:(0,r.__)("Maximum password length","password-requirements"),help:(0,r.__)("Maximum number of characters allowed in passwords; a valid value should be between 64 and 512.","password-requirements"),min:64,max:512,value:s["ruleSettings.maximumLength"],defaultValue:256,onChange:e=>{t({...s,"ruleSettings.maximumLength":e})}}),(0,i.jsx)(R,{label:(0,r.__)("Minimum password age","password-requirements"),help:(0,r.__)("Number of days; a valid value should be between 1 and 1000.","password-requirements"),min:1,max:1e3,value:s["ruleSettings.minimumAge"],defaultValue:2,onChange:e=>{t({...s,"ruleSettings.minimumAge":e})}}),(0,i.jsx)(R,{label:(0,r.__)("Maximum password age","password-requirements"),help:(0,r.__)("Number of days; a valid value should be between 1 and 1000.","password-requirements"),min:1,max:1e3,value:s["ruleSettings.maximumAge"],defaultValue:30,onChange:e=>{t({...s,"ruleSettings.maximumAge":e})}}),(0,i.jsxs)(v,{label:(0,r.__)("Password complexity requirements","password-requirements"),withBaseControl:!0,withReducedGap:!0,children:[(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Uppercase letter(s) required","password-requirements"),checked:s["ruleSettings.complexity.uppercase"],onChange:()=>{t({...s,"ruleSettings.complexity.uppercase":!s["ruleSettings.complexity.uppercase"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Lowercase letter(s) required","password-requirements"),checked:s["ruleSettings.complexity.lowercase"],onChange:()=>{t({...s,"ruleSettings.complexity.lowercase":!s["ruleSettings.complexity.lowercase"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Base digit(s) (0 through 9) required","password-requirements"),checked:s["ruleSettings.complexity.digit"],onChange:()=>{t({...s,"ruleSettings.complexity.digit":!s["ruleSettings.complexity.digit"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.sprintf)(
    5656// Translators: %s - minimum number of distinct characters in password, with text.
    5757// Translators: %s - minimum number of distinct characters in password, with text.
    58 (0,a.__)("At least %s required","password-requirements"),(0,a.sprintf)(
     58(0,r.__)("At least %s required","password-requirements"),(0,r.sprintf)(
    5959// Translators: %d - number of characters.
    6060// Translators: %d - number of characters.
    61 (0,a._n)("%d distinct character","%d distinct characters",s["ruleSettings.minimumUniqueCharacters"],"password-requirements"),s["ruleSettings.minimumUniqueCharacters"])),checked:s["ruleSettings.complexity.uniqueCharacters"],help:(0,a.__)("Adjust the number in a dedicated field below.","password-requirements"),onChange:()=>{t({...s,"ruleSettings.complexity.uniqueCharacters":!s["ruleSettings.complexity.uniqueCharacters"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Limit symbols from the user's name or display name","password-requirements"),checked:s["ruleSettings.complexity.consecutiveUserSymbols"],help:(o=r,0===o?(0,a.__)("No symbols from the user's name or display name are allowed. Adjust the number in a dedicated field below.","password-requirements"):(0,a.sprintf)(
     61(0,r._n)("%d distinct character","%d distinct characters",s["ruleSettings.minimumUniqueCharacters"],"password-requirements"),s["ruleSettings.minimumUniqueCharacters"])),checked:s["ruleSettings.complexity.uniqueCharacters"],help:(0,r.__)("Adjust the number in a dedicated field below.","password-requirements"),onChange:()=>{t({...s,"ruleSettings.complexity.uniqueCharacters":!s["ruleSettings.complexity.uniqueCharacters"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Limit symbols from the user's name or display name","password-requirements"),checked:s["ruleSettings.complexity.consecutiveUserSymbols"],help:(c=a,0===c?(0,r.__)("No symbols from the user's name or display name are allowed. Adjust the number in a dedicated field below.","password-requirements"):(0,r.sprintf)(
    6262// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    6363// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    64 (0,a._n)("Up to %d consecutive symbol from the user's name or display name is allowed. Adjust the number in a dedicated field below.","Up to %d consecutive symbols from the user's name or display name are allowed. Adjust the number in a dedicated field below.",o,"password-requirements"),o)),onChange:()=>{t({...s,"ruleSettings.complexity.consecutiveUserSymbols":!s["ruleSettings.complexity.consecutiveUserSymbols"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Special character(s) required","password-requirements"),checked:s["ruleSettings.complexity.specialCharacter"],help:(0,e.createInterpolateElement)((0,a.__)("Special character: one of punctuation characters that are present on standard US keyboard. See: <a>Password Special Characters</a> for more details.","password-requirements"),{a:(0,n.jsx)(c.ExternalLink,{href:"https://owasp.org/www-community/password-special-characters"})}),onChange:()=>{t({...s,"ruleSettings.complexity.specialCharacter":!s["ruleSettings.complexity.specialCharacter"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Certain character(s) restricted","password-requirements"),checked:s["ruleSettings.complexity.restrictedCharacters"],help:(0,a.__)("Restrict specific characters in the password. Use this option only when required, such as to meet legacy system integration constraints.","password-requirements"),onChange:()=>{t({...s,"ruleSettings.complexity.restrictedCharacters":!s["ruleSettings.complexity.restrictedCharacters"]})}})]}),s["ruleSettings.complexity.restrictedCharacters"]&&(0,n.jsx)(M,{help:(0,a.__)("Type in a character that should be added to the list of restricted characters in the password.","password-requirements"),label:(0,a.__)("Restricted characters","password-requirements"),value:s["ruleSettings.restrictedCharacters"],onChange:e=>{t({...s,"ruleSettings.restrictedCharacters":e})}}),(0,n.jsx)(A,{label:(0,a.__)("Minimum number of distinct characters in password","password-requirements"),help:(0,a.__)('Example: the password "aabc" contains three distinct characters (a, b, c); a valid value should be between 1 and 50.',"password-requirements"),min:1,max:50,value:s["ruleSettings.minimumUniqueCharacters"],defaultValue:6,onChange:e=>{t({...s,"ruleSettings.minimumUniqueCharacters":e})}}),(0,n.jsx)(A,{label:(0,a.__)("Number of consecutive symbols of the user's name or display name allowed in the password","password-requirements"),help:(0,a.__)('A valid value should be between 0 and 50. Examples: if "0" is chosen, all characters used in user name or display name will not be allowed in user\'s password; if "2" is chosen and user name is "Bart", password can contain "ba", "ar", and "rt", but not "bar" or "art". Matching ignores letter case. The complete user name and display name are always rejected whatever the limit, so with "4" chosen and user name "Bart", password still cannot contain "bart".',"password-requirements"),min:0,max:50,value:s["ruleSettings.maximumConsecutiveUserSymbols"],defaultValue:4,onChange:e=>{(e=>{0!==e?(0,T.speak)((0,a.sprintf)(
     64(0,r._n)("Up to %d consecutive symbol from the user's name or display name is allowed. Adjust the number in a dedicated field below.","Up to %d consecutive symbols from the user's name or display name are allowed. Adjust the number in a dedicated field below.",c,"password-requirements"),c)),onChange:()=>{t({...s,"ruleSettings.complexity.consecutiveUserSymbols":!s["ruleSettings.complexity.consecutiveUserSymbols"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Special character(s) required","password-requirements"),checked:s["ruleSettings.complexity.specialCharacter"],help:(0,e.createInterpolateElement)((0,r.__)("Special character: one of punctuation characters that are present on standard US keyboard. See: <a>Password Special Characters</a> for more details.","password-requirements"),{a:(0,i.jsx)(o.ExternalLink,{href:"https://owasp.org/www-community/password-special-characters"})}),onChange:()=>{t({...s,"ruleSettings.complexity.specialCharacter":!s["ruleSettings.complexity.specialCharacter"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Certain character(s) restricted","password-requirements"),checked:s["ruleSettings.complexity.restrictedCharacters"],help:(0,r.__)("Restrict specific characters in the password. Use this option only when required, such as to meet legacy system integration constraints.","password-requirements"),onChange:()=>{t({...s,"ruleSettings.complexity.restrictedCharacters":!s["ruleSettings.complexity.restrictedCharacters"]})}})]}),s["ruleSettings.complexity.restrictedCharacters"]&&(0,i.jsx)(q,{help:(0,r.__)("Type in a character that should be added to the list of restricted characters in the password.","password-requirements"),label:(0,r.__)("Restricted characters","password-requirements"),value:s["ruleSettings.restrictedCharacters"],onChange:e=>{t({...s,"ruleSettings.restrictedCharacters":e})}}),(0,i.jsx)(R,{label:(0,r.__)("Minimum number of distinct characters in password","password-requirements"),help:(0,r.__)('Example: the password "aabc" contains three distinct characters (a, b, c); a valid value should be between 1 and 50.',"password-requirements"),min:1,max:50,value:s["ruleSettings.minimumUniqueCharacters"],defaultValue:6,onChange:e=>{t({...s,"ruleSettings.minimumUniqueCharacters":e})}}),(0,i.jsx)(R,{label:(0,r.__)("Number of consecutive symbols of the user's name or display name allowed in the password","password-requirements"),help:(0,r.__)('A valid value should be between 0 and 50. Examples: if "0" is chosen, all characters used in user name or display name will not be allowed in user\'s password; if "2" is chosen and user name is "Bart", password can contain "ba", "ar", and "rt", but not "bar" or "art". Matching ignores letter case. The complete user name and display name are always rejected whatever the limit, so with "4" chosen and user name "Bart", password still cannot contain "bart".',"password-requirements"),min:0,max:50,value:s["ruleSettings.maximumConsecutiveUserSymbols"],defaultValue:4,onChange:e=>{(e=>{0!==e?(0,L.speak)((0,r.sprintf)(
    6565// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    6666// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    67 (0,a._n)("Passwords may contain up to %d consecutive symbol from the user's name or display name.","Passwords may contain up to %d consecutive symbols from the user's name or display name.",e,"password-requirements"),e),"polite"):(0,T.speak)((0,a.__)("No character of the user's name or display name may appear in the password.","password-requirements"),"polite")})(e),t({...s,"ruleSettings.maximumConsecutiveUserSymbols":e})}}),i&&0===r&&(0,n.jsx)(k,{message:(0,a.__)("A value of 0 forbids every character of the user's name and display name in their password, letter case ignored. For a long display name that can rule out most of the alphabet and leave users unable to set any password.","password-requirements")})]})})]})});var o};L.propTypes={data:r().object.isRequired,onChange:r().func.isRequired};const H=({settings:s,setSettings:t})=>{(0,e.useEffect)(()=>{if(0===Object.keys(s.data?.policies).length){const e=`d:${Date.now().toString()}${String(C++%1e4).padStart(4,"0")}`,{policy:r}=s.templates.policies;t({...s,data:{...s.data,policies:{[e]:Object.assign({},{key:e,...r})}}})}},[s,t]);const r=s.data?.policies[Object.keys(s.data?.policies)?.[0]]??null;return null===r?null:(0,n.jsx)(L,{data:r,onChange:e=>{const a=Object.assign({},s.data?.policies??{});a[r.key]=e,t({...s,data:{...s.data,policies:a}})}})};H.propTypes={settings:r().object.isRequired,setSettings:r().func.isRequired},(0,d.addFilter)("password_requirements__settings_page_tabs","teydeastudio/password-requirements/settings-page",(e,s,t)=>(e.push({name:"password-policy",title:(0,a.__)("Policy","password-requirements"),component:(0,n.jsx)(H,{settings:s,setSettings:t})}),e.push({name:"general",title:(0,a.__)("General","password-requirements"),component:(0,n.jsx)(q,{settings:s,setSettings:t})}),e)),(0,d.addFilter)("password_requirements__upsell_panel","teydeastudio/password-requirements/settings-page",e=>(window?.teydeaStudio?.passwordRequirements?.plugin?.isPro||(e=(0,n.jsx)(f,{url:"https://teydeastudio.com/plugins/login-security/pricing/?utm_source=Teydea+Login+Security",benefits:[(0,n.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/pwned-passwords-integration/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,a.__)("Block Passwords Found in Real-World Data Breaches","password-requirements")},"pwned-passwords-integration"),(0,n.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/dedicated-policies-by-user-and-or-role/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,a.__)("Create Unlimited, Dedicated Password Policies for Different User Groups","password-requirements")},"dedicated-policies-by-user-and-or-role"),(0,n.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/passwords-reuse-prevention/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,a.__)("Prevent Reusing the Same Passwords","password-requirements")},"passwords-reuse-prevention"),(0,n.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/restricted-passwords-list/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,a.__)("Prevent Usage of Common, Weak Passwords","password-requirements")},"restricted-passwords-list"),(0,n.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/integrations/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,a.__)("Full integration with WooCommerce and multiple other plugins","password-requirements")},"integrations"),(0,a.__)("Access to PRO updates and our premium support","password-requirements")]})),e)),(0,d.addAction)("password_requirements__settings_saved","teydeastudio/password-requirements/settings-page",async()=>{await _()({path:"/password-requirements/v1/should-change-password"}).then(e=>(""!==e&&window.location.replace(e),e))});const F={key:"passwordRequirements",type:"plugin"},{key:O}=F,{pageTitle:z}=window.teydeaStudio[O].settingsPage,V=b(({SaveSettingsButton:e,setSettings:s,settings:t})=>(0,n.jsx)(o,{actions:(0,n.jsx)(e,{}),pageTitle:z,product:F,children:(0,n.jsx)(w,{product:F,settings:t,setSettings:s})}));var U,E;U=(0,n.jsx)(V,{product:F,LoadingContainer:({children:e})=>(0,n.jsx)(o,{pageTitle:z,product:F,children:e})}),E=document.querySelector("div#password-requirements-settings-page"),(0,e.createRoot)(E).render(U)})()})();
     67(0,r._n)("Passwords may contain up to %d consecutive symbol from the user's name or display name.","Passwords may contain up to %d consecutive symbols from the user's name or display name.",e,"password-requirements"),e),"polite"):(0,L.speak)((0,r.__)("No character of the user's name or display name may appear in the password.","password-requirements"),"polite")})(e),t({...s,"ruleSettings.maximumConsecutiveUserSymbols":e})}}),n&&0===a&&(0,i.jsx)(P,{message:(0,r.__)("A value of 0 forbids every character of the user's name and display name in their password, letter case ignored. For a long display name that can rule out most of the alphabet and leave users unable to set any password.","password-requirements")})]})})]})});var c};H.propTypes={data:s.object.isRequired,onChange:s.func.isRequired};const B=({settings:s,setSettings:t})=>{(0,e.useEffect)(()=>{if(0===Object.keys(s.data?.policies).length){const e=`d:${Date.now().toString()}${String(C++%1e4).padStart(4,"0")}`,{policy:r}=s.templates.policies;t({...s,data:{...s.data,policies:{[e]:Object.assign({},{key:e,...r})}}})}},[s,t]);const r=s.data?.policies[Object.keys(s.data?.policies)?.[0]]??null;return null===r?null:(0,i.jsx)(H,{data:r,onChange:e=>{const a=Object.assign({},s.data?.policies??{});a[r.key]=e,t({...s,data:{...s.data,policies:a}})}})};B.propTypes={settings:s.object.isRequired,setSettings:s.func.isRequired},(0,c.addFilter)("password_requirements__settings_page_tabs","teydeastudio/password-requirements/settings-page",(e,s,t)=>(e.push({name:"password-policy",title:(0,r.__)("Policy","password-requirements"),component:(0,i.jsx)(B,{settings:s,setSettings:t})}),e.push({name:"general",title:(0,r.__)("General","password-requirements"),component:(0,i.jsx)(b,{settings:s,setSettings:t})}),e)),(0,c.addFilter)("password_requirements__upsell_panel","teydeastudio/password-requirements/settings-page",e=>(window?.teydeaStudio?.passwordRequirements?.plugin?.isPro||(e=(0,i.jsx)(w,{url:"https://teydeastudio.com/plugins/login-security/pricing/?utm_source=Teydea+Login+Security",benefits:[(0,i.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/pwned-passwords-integration/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,r.__)("Block Passwords Found in Real-World Data Breaches","password-requirements")},"pwned-passwords-integration"),(0,i.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/dedicated-policies-by-user-and-or-role/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,r.__)("Create Unlimited, Dedicated Password Policies for Different User Groups","password-requirements")},"dedicated-policies-by-user-and-or-role"),(0,i.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/passwords-reuse-prevention/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,r.__)("Prevent Reusing the Same Passwords","password-requirements")},"passwords-reuse-prevention"),(0,i.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/restricted-passwords-list/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,r.__)("Prevent Usage of Common, Weak Passwords","password-requirements")},"restricted-passwords-list"),(0,i.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/integrations/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,r.__)("Full integration with WooCommerce and multiple other plugins","password-requirements")},"integrations"),(0,r.__)("Access to PRO updates and our premium support","password-requirements")]})),e)),(0,c.addAction)("password_requirements__settings_saved","teydeastudio/password-requirements/settings-page",async()=>{await x({path:"/password-requirements/v1/should-change-password"}).then(e=>(""!==e&&window.location.replace(e),e))});const T={key:"passwordRequirements",type:"plugin"},{key:A}=T,{pageTitle:F}=window.teydeaStudio[A].settingsPage,V=j(({SaveSettingsButton:e,setSettings:s,settings:t})=>(0,i.jsx)(l,{actions:(0,i.jsx)(e,{}),pageTitle:F,product:T,children:(0,i.jsx)(g,{product:T,settings:t,setSettings:s})}));var O,z;O=(0,i.jsx)(V,{product:T,LoadingContainer:({children:e})=>(0,i.jsx)(l,{pageTitle:F,product:T,children:e})}),z=document.querySelector("div#password-requirements-settings-page"),(0,e.createRoot)(z).render(O)})()})();
  • password-requirements/tags/3.9.0/changelog.txt

    r3669586 r3748178  
    11== Changelog ==
     2
     3= 3.9.0 (2026-10-15) =
     4* Improved compatibility of the sign-in password check with plugins that change login cookies
     5* On multisite, the "Current Password" field on the user-admin profile screen is now checked
     6* Personal data exports now include the date the user last changed their password
     7* Confirming the current password no longer counts as a failed login when it is mistyped, and no longer resets the password age when it is correct
     8* The "Current Password" field keeps its label visible, is recognized by password managers, and has its help text announced by screen readers
     9* The "Current Password" field is now positioned by an enqueued script, so it also works on sites whose Content-Security-Policy blocks inline scripts
     10* Dependencies updated
     11* Code improvements
    212
    313= 3.8.0 (2026-08-28) =
  • password-requirements/tags/3.9.0/classmap.php

    r3669586 r3748178  
    2626        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Module' => '/deps/php/utils/class-module.php',
    2727        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Nested_Array' => '/deps/php/utils/class-nested-array.php',
     28        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Network_Sites' => '/deps/php/utils/class-network-sites.php',
    2829        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Nonce' => '/deps/php/utils/class-nonce.php',
    2930        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Plugin' => '/deps/php/utils/class-plugin.php',
    30         'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Post_Meta' => '/deps/php/utils/class-post-meta.php',
    31         'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Post_Meta_Registry' => '/deps/php/utils/class-post-meta-registry.php',
    3231        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Runtime_Requirements' => '/deps/php/utils/class-runtime-requirements.php',
    3332        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Screen' => '/deps/php/utils/class-screen.php',
    … …  
    7170        'Teydea_Studio\\Login_Security\\Modules\\Password_Hint\\Submodules\\User_New_Screen\\Submodule_User_New_Screen' => '/src/modules/password-hint/submodules/user-new-screen/class-submodule-user-new-screen.php',
    7271        'Teydea_Studio\\Login_Security\\Modules\\Password_Hint\\Submodules\\User_Profile_Screen\\Submodule_User_Profile_Screen' => '/src/modules/password-hint/submodules/user-profile-screen/class-submodule-user-profile-screen.php',
     72        'Teydea_Studio\\Login_Security\\Modules\\Personal_Data\\Module_Personal_Data' => '/src/modules/personal-data/class-module-personal-data.php',
    7373        'Teydea_Studio\\Login_Security\\Modules\\Plugin_Upgrade_Action_Link\\Module_Plugin_Upgrade_Action_Link' => '/src/modules/plugin-upgrade-action-link/class-module-plugin-upgrade-action-link.php',
    7474        'Teydea_Studio\\Login_Security\\Modules\\Require_Current_Password\\Module_Require_Current_Password' => '/src/modules/require-current-password/class-module-require-current-password.php',
  • password-requirements/tags/3.9.0/deps/js/components/package.json

    r3669586 r3748178  
    33  "type": "module",
    44  "private": true,
    5   "dependencies": {
    6     "@dnd-kit/core": "^6.3.1",
    7     "@dnd-kit/modifiers": "^9.0.0",
    8     "@dnd-kit/sortable": "^10.0.0",
    9     "@dnd-kit/utilities": "^3.2.2"
    10   },
    115  "devDependencies": {
    12     "@wordpress/icons": "^15.3.0",
    13     "@wordpress/scripts": "^34.0.0",
    146    "prop-types": "^15.8.1"
    157  }
  • password-requirements/tags/3.9.0/deps/js/components/src/_variables.scss

    r3669586 r3748178  
    22 * Variables
    33 */
     4
     5/**
     6 * WordPress admin color palette, named the way core names each step
     7 */
     8$wp-admin--gray-0: #f6f7f7;
     9$wp-admin--gray-2: #f0f0f1;
     10$wp-admin--gray-5: #dcdcde;
     11$wp-admin--gray-30: #8c8f94;
     12$wp-admin--gray-50: #646970;
     13$wp-admin--gray-60: #50575e;
     14$wp-admin--gray-70: #3c434a;
     15$wp-admin--gray-90: #1d2327;
     16$wp-admin--blue-0: #f0f6fc;
     17$wp-admin--blue-50: #2271b1;
     18$wp-admin--blue-60: #135e96;
     19$wp-admin--blue-70: #0a4b78;
     20$wp-admin--green-50: #008a20;
     21$wp-admin--red-50: #d63638;
     22$wp-admin--yellow-50: #996800;
     23
     24/**
     25 * The admin color scheme the user picked, falling back to the default scheme's blue
     26 */
     27$wp-admin--theme-color: var(--wp-admin-theme-color, #{$wp-admin--blue-50});
     28$wp-admin--theme-color-darker-10: var(--wp-admin-theme-color-darker-10, #{$wp-admin--blue-60});
     29
    430$border-color: #e0e0e0;
    531$border-color--darker: #949494;
    632
    733$text-color--black: #1e1e1e;
    8 $text-color--wp-admin-text: #3c434a;
     34$text-color--wp-admin-text: $wp-admin--gray-70;
    935$text-color--gray: #757575;
    1036$text-color--green: #307d07;
    … …  
    1743$wp-admin-default--destructive: #cc1818;
    1844$wp-admin-default--destructive-darker-20: #710d0d;
     45
     46/**
     47 * Tinted surfaces and the text that sits on them, from the same palette
     48 *
     49 * A status said in a tinted box, such as a passing check or a warning, sits on the lightest
     50 * step of its hue. The yellow text step is the one that passes AA on its own surface.
     51 */
     52$wp-admin--green-0: #edfaef;
     53$wp-admin--green-60: #007017;
     54$wp-admin--red-0: #fcf0f1;
     55$wp-admin--red-60: #b32d2e;
     56$wp-admin--yellow-0: #fcf9e8;
     57$wp-admin--yellow-20: #f0c33c;
     58$wp-admin--yellow-60: #755100;
  • password-requirements/tags/3.9.0/deps/js/components/src/detect-outside/index.js

    r3669586 r3748178  
    1414 */
    1515export const DetectOutside = withFocusOutside(
     16        /**
     17         * Component that forwards a focus event landing outside it to its owner.
     18         */
    1619        class extends Component {
    1720                /**
  • password-requirements/tags/3.9.0/deps/js/components/src/product-icon/index.js

    r3669586 r3748178  
    252252                        );
    253253
    254                 // Teydea Pattern Library plugin icon.
    255                 case 'teydea-pattern-library':
    256                         return (
    257                                 <div className="tsc-product-icon">
    258                                         <SVG fill="none" height="256" viewBox="0 0 512 512" width="256" xmlns="http://www.w3.org/2000/svg">
    259                                                 <Path
    260                                                         fill="#fff5e6"
    261                                                         d="M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"
    262                                                 />
    263                                                 <Path fill="#ffe6c0" d="M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319" />
    264                                                 <Path
    265                                                         fill="#ffd18c"
    266                                                         d="M405.689 331h-21.341v-21.341a21.34 21.34 0 0 0-21.33-20.636 21.34 21.34 0 0 0-21.329 20.636V331h-21.341a21.365 21.365 0 0 0 0 42.659h21.341V395a21.36 21.36 0 0 0 21.329 20.144A21.36 21.36 0 0 0 384.348 395v-21.341h21.341A21.362 21.362 0 0 0 420 337.661 21.36 21.36 0 0 0 405.689 331M405.683 117.659H107.001A21.37 21.37 0 0 0 86.633 139a21.363 21.363 0 0 0 20.368 21.341h298.682a21.34 21.34 0 1 0 0-42.682M299.001 224.341h-192a21.344 21.344 0 0 0-20.637 21.33A21.34 21.34 0 0 0 107.001 267h192a21.34 21.34 0 0 0 20.636-21.329 21.343 21.343 0 0 0-20.636-21.33M213.683 331H107.001a21.366 21.366 0 0 0-14.312 35.999 21.37 21.37 0 0 0 14.312 6.66h106.682a21.34 21.34 0 0 0 20.636-21.329A21.34 21.34 0 0 0 213.683 331"
    267                                                 />
    268                                                 <Path
    269                                                         fill="#f89500"
    270                                                         d="M405.682 171H107a32.026 32.026 0 0 1-32-32c0-17.641 14.36-32 32-32h298.682c17.641 0 32 14.359 32 32s-14.359 32-32 32M107 128.341A10.685 10.685 0 0 0 97.023 139 10.68 10.68 0 0 0 107 149.659h298.682A10.685 10.685 0 0 0 415.66 139a10.68 10.68 0 0 0-9.978-10.659zm192 149.318H107a32.026 32.026 0 0 1-32-32c0-17.641 14.36-32 32-32h192a32.025 32.025 0 0 1 0 64M107 235a10.68 10.68 0 0 0-7.23 18.046 10.68 10.68 0 0 0 7.23 3.295h192a10.68 10.68 0 0 0 10.184-10.67A10.683 10.683 0 0 0 299 235zm106.682 149.341H107a32.02 32.02 0 0 1-32-32c0-17.664 14.36-32 32-32h106.682a32.023 32.023 0 0 1 0 64M107 341.659a10.68 10.68 0 0 0-7.23 18.046A10.68 10.68 0 0 0 107 363h106.682a10.68 10.68 0 0 0 10.184-10.671 10.68 10.68 0 0 0-10.184-10.67zM363 427a32.03 32.03 0 0 1-22.621-9.379A32.03 32.03 0 0 1 331 395v-10.659h-10.659a32.05 32.05 0 0 1-32-32c0-17.664 14.359-32 32-32H331v-10.682a32.025 32.025 0 0 1 64 0v10.682h10.682a32.023 32.023 0 0 1 0 64H395V395c0 17.641-14.336 32-32 32m-42.659-85.341a10.68 10.68 0 0 0-10.184 10.67A10.68 10.68 0 0 0 320.341 363h21.341c5.888 0 10.659 4.771 10.659 10.659V395a10.68 10.68 0 0 0 3.296 7.229 10.68 10.68 0 0 0 14.75 0 10.68 10.68 0 0 0 3.295-7.229v-21.341c0-5.888 4.771-10.659 10.659-10.659h21.341a10.68 10.68 0 0 0 10.184-10.671 10.68 10.68 0 0 0-10.184-10.67h-21.341A10.66 10.66 0 0 1 373.682 331v-21.341a10.68 10.68 0 0 0-10.67-10.184 10.68 10.68 0 0 0-7.375 2.955 10.68 10.68 0 0 0-3.296 7.229V331a10.66 10.66 0 0 1-10.659 10.659z"
     254                // Teydea Site Assistant plugin icon.
     255                case 'teydea-site-assistant':
     256                        return (
     257                                <div className="tsc-product-icon">
     258                                        <SVG fill="none" height="256" viewBox="0 0 512 512" width="256" xmlns="http://www.w3.org/2000/svg">
     259                                                <Path
     260                                                        fill="#e0f3f7"
     261                                                        d="M372.364 0H139.636C62.5173 0 0 62.5173 0 139.636V372.364C0 449.483 62.5173 512 139.636 512H372.364C449.483 512 512 449.483 512 372.364V139.636C512 62.5173 449.483 0 372.364 0Z"
     262                                                />
     263                                                <Path
     264                                                        fill="#c7e5eb"
     265                                                        d="M256.001 426.658C301.262 426.658 344.67 408.678 376.675 376.673C408.68 344.669 426.66 301.261 426.66 255.999C426.66 210.738 408.68 167.33 376.675 135.325C344.67 103.32 301.262 85.3403 256.001 85.3403C210.739 85.3403 167.331 103.32 135.327 135.325C103.322 167.33 85.3418 210.738 85.3418 255.999C85.3418 301.261 103.322 344.669 135.327 376.673C167.331 408.678 210.739 426.658 256.001 426.658Z"
     266                                                />
     267                                                <Path
     268                                                        fill="#b0dde6"
     269                                                        d="M236.75 140.5C226.162 140.5 217.5 131.838 217.5 121.25V102H294.5V121.25C294.5 131.838 285.838 140.5 275.25 140.5H236.75Z"
     270                                                />
     271                                                <Path
     272                                                        fill="#b0dde6"
     273                                                        d="M159.75 410C149.162 410 140.5 401.338 140.5 390.75V121.25C140.5 110.662 149.162 102 159.75 102H217.5V121.25C217.5 131.838 226.162 140.5 236.75 140.5H275.25C285.838 140.5 294.5 131.838 294.5 121.25V102H352.25C362.838 102 371.5 110.662 371.5 121.25V390.75C371.5 401.338 362.838 410 352.25 410H159.75Z"
     274                                                />
     275                                                <Path
     276                                                        fill="#0e87a0"
     277                                                        d="M352.25 419.625H159.75C143.773 419.625 130.875 406.727 130.875 390.75V121.25C130.875 105.273 143.773 92.375 159.75 92.375H352.25C368.227 92.375 381.125 105.273 381.125 121.25V390.75C381.125 406.727 368.227 419.625 352.25 419.625ZM159.75 111.625C154.36 111.625 150.125 115.86 150.125 121.25V390.75C150.125 396.14 154.36 400.375 159.75 400.375H352.25C357.64 400.375 361.875 396.14 361.875 390.75V121.25C361.875 115.86 357.64 111.625 352.25 111.625H159.75Z"
     278                                                />
     279                                                <Path
     280                                                        fill="#0e87a0"
     281                                                        d="M275.25 150.125H236.75C220.773 150.125 207.875 137.227 207.875 121.25V102C207.875 96.61 212.11 92.375 217.5 92.375C222.89 92.375 227.125 96.61 227.125 102V121.25C227.125 126.64 231.36 130.875 236.75 130.875H275.25C280.64 130.875 284.875 126.64 284.875 121.25V102C284.875 96.61 289.11 92.375 294.5 92.375C299.89 92.375 304.125 96.61 304.125 102V121.25C304.125 137.227 291.227 150.125 275.25 150.125Z"
     282                                                />
     283                                                <Path
     284                                                        fill="#0e87a0"
     285                                                        d="M201.137 243.492L181.888 224.242C178.038 220.392 178.038 214.425 181.888 210.575C185.738 206.725 191.705 206.725 195.555 210.575L208.068 223.087L230.205 200.95C234.055 197.1 240.023 197.1 243.873 200.95C247.723 204.8 247.723 210.767 243.873 214.617L214.998 243.492C211.148 247.342 205.18 247.342 201.33 243.492H201.137Z"
     286                                                />
     287                                                <Path
     288                                                        fill="#0e87a0"
     289                                                        d="M323.375 236.75H275.25C269.86 236.75 265.625 232.515 265.625 227.125C265.625 221.735 269.86 217.5 275.25 217.5H323.375C328.765 217.5 333 221.735 333 227.125C333 232.515 328.765 236.75 323.375 236.75Z"
     290                                                />
     291                                                <Path
     292                                                        fill="#0e87a0"
     293                                                        d="M201.137 301.242L181.888 281.992C178.038 278.142 178.038 272.175 181.888 268.325C185.738 264.475 191.705 264.475 195.555 268.325L208.068 280.837L230.205 258.7C234.055 254.85 240.023 254.85 243.873 258.7C247.723 262.55 247.723 268.517 243.873 272.367L214.998 301.242C211.148 305.092 205.18 305.092 201.33 301.242H201.137Z"
     294                                                />
     295                                                <Path
     296                                                        fill="#0e87a0"
     297                                                        d="M323.375 294.5H275.25C269.86 294.5 265.625 290.265 265.625 284.875C265.625 279.485 269.86 275.25 275.25 275.25H323.375C328.765 275.25 333 279.485 333 284.875C333 290.265 328.765 294.5 323.375 294.5Z"
     298                                                />
     299                                                <Path
     300                                                        fill="#0e87a0"
     301                                                        d="M201.137 358.992L181.888 339.742C178.038 335.892 178.038 329.925 181.888 326.075C185.738 322.225 191.705 322.225 195.555 326.075L208.068 338.587L230.205 316.45C234.055 312.6 240.023 312.6 243.873 316.45C247.723 320.3 247.723 326.267 243.873 330.117L214.998 358.992C211.148 362.842 205.18 362.842 201.33 358.992H201.137Z"
     302                                                />
     303                                                <Path
     304                                                        fill="#0e87a0"
     305                                                        d="M323.375 352.25H275.25C269.86 352.25 265.625 348.015 265.625 342.625C265.625 337.235 269.86 333 275.25 333H323.375C328.765 333 333 337.235 333 342.625C333 348.015 328.765 352.25 323.375 352.25Z"
    271306                                                />
    272307                                        </SVG>
  • password-requirements/tags/3.9.0/deps/js/components/src/settings-sidebar/index.js

    r3482299 r3748178  
    2020 * SettingsSidebar component
    2121 *
    22  * @param {Object} properties          Component properties object.
    23  * @param {Object} properties.product  Product's data object.
    24  * @param {Object} properties.settings Settings object.
     22 * A screen other than the settings page has no settings of its own and no settings-page data
     23 * to read the help links from, so it hands the links over itself and leaves the settings out.
     24 *
     25 * @param {Object}  properties           Component properties object.
     26 * @param {Object}  properties.product   Product's data object.
     27 * @param {?Object} properties.settings  Settings object, or null on a screen that has none.
     28 * @param {?Array}  properties.helpLinks Help links; read from the settings page's data when not given.
    2529 *
    2630 * @return {Element} Settings component.
    2731 */
    28 export const SettingsSidebar = ( { product, settings } ) => {
     32export const SettingsSidebar = ( { product, settings = null, helpLinks = null } ) => {
    2933        // Destructure the product object.
    3034        const { key: productKey, type: productType } = product;
    3135
    3236        // Collect the necessary data.
    33         const { helpLinks } = window.teydeaStudio[ productKey ].settingsPage;
     37        const links = helpLinks ?? window.teydeaStudio[ productKey ].settingsPage.helpLinks;
    3438        const { slug } = window.teydeaStudio[ productKey ][ productType ];
    3539
    … …  
    4448                                         * Render help links, if provided
    4549                                         */
    46                                         0 < helpLinks.length && (
     50                                        0 < links.length && (
    4751                                                <PanelBody title={ __( 'Help & support', 'password-requirements' ) } className="tsc-settings-sidebar__panel">
    4852                                                        <ul>
    49                                                                 { helpLinks.map( ( { url, title }, index ) => (
     53                                                                { links.map( ( { url, title }, index ) => (
    5054                                                                        <li key={ index }>
    5155                                                                                <a href={ url } target="_blank" rel="noreferrer noopener">
    … …  
    111115                                 *
    112116                                 * @param {Element} panel    The "after sidebar" panel.
    113                                  * @param {Object}  settings Settings object.
     117                                 * @param {?Object} settings Settings object, or null on a screen that has none.
    114118                                 */
    115119                                applyFilters( 'password_requirements__after_sidebar_panel', <Fragment />, settings )
    … …  
    127131                type: PropTypes.oneOf( [ 'plugin', 'theme' ] ),
    128132        } ).isRequired,
    129         settings: PropTypes.object.isRequired,
     133        settings: PropTypes.object,
     134        helpLinks: PropTypes.arrayOf(
     135                PropTypes.shape( {
     136                        url: PropTypes.string.isRequired,
     137                        title: PropTypes.string.isRequired,
     138                } ),
     139        ),
    130140};
  • password-requirements/tags/3.9.0/deps/js/components/src/settings-tabs/index.js

    r3669586 r3748178  
    6666        return tabs.find( ( tab ) => {
    6767                const tabSlug = toSlug( tab?.name );
    68 
    6968                return '' !== tabSlug && tabSlug === slug;
    7069        } );
  • password-requirements/tags/3.9.0/deps/js/utils/package.json

    r3669586 r3748178  
    22  "name": "@teydeastudio/utils",
    33  "type": "module",
    4   "private": true,
    5   "devDependencies": {
    6     "@wordpress/scripts": "^34.0.0"
    7   }
     4  "private": true
    85}
  • password-requirements/tags/3.9.0/deps/php/universal-modules/endpoint-settings/class-module-endpoint-settings.php

    r3669586 r3748178  
    2727         */
    2828        use Utils\With_REST_Helpers;
     29
     30        /**
     31         * Simplify access to the Settings class instance
     32         */
     33        use Utils\With_Settings;
    2934
    3035        /**
  • password-requirements/tags/3.9.0/deps/php/universal-modules/settings-page/class-module-settings-page.php

    r3669586 r3748178  
    5555
    5656        /**
     57         * Whether to register the settings page as a top-level admin menu,
     58         * rather than as a submenu of the parent slugs above
     59         *
     60         * @var bool
     61         */
     62        protected bool $is_top_level_menu = false;
     63
     64        /**
     65         * Dashicons class name, or an icon URL, of the top-level admin menu
     66         *
     67         * @var string
     68         */
     69        protected string $menu_icon = 'dashicons-admin-generic';
     70
     71        /**
     72         * Position of the top-level admin menu in the admin menu order;
     73         * null appends it at the end of the menu
     74         *
     75         * Fractional, because a position is one slot in an order shared with
     76         * every other plugin on the site. Core resolves a collision by nudging
     77         * the later menu with an offset derived from a hash of its slug and
     78         * title, so two plugins landing on the same integer end up in an order
     79         * neither of them chose. A fraction keeps the placement deliberate.
     80         *
     81         * @var ?float
     82         */
     83        protected ?float $menu_position = null;
     84
     85        /**
    5786         * Help & support links rendered on the settings page sidebar panel
    5887         *
    … …  
    76105                add_action( 'admin_menu', [ $this, 'register_settings_page' ] );
    77106
    78                 // Maybe redirect user to the settings screen.
     107                // Maybe redirect the user who activated the container to where it wants them.
    79108                add_action( 'admin_init', [ $this, 'maybe_redirect_after_activation' ] );
    80109
    … …  
    116145        /**
    117146         * Insert the option flag to redirect the user who has activated
    118          * the container, to the settings page
     147         * the container, to where the container wants them
    119148         *
    120149         * @return void
    … …  
    157186
    158187        /**
     188         * Get the admin file that serves the settings page
     189         *
     190         * A top-level menu is served by `admin.php` on both single-site and
     191         * network installations; the parent slugs only apply to a submenu.
     192         *
     193         * @return string The admin file that serves the settings page.
     194         */
     195        protected function get_menu_parent_file(): string {
     196                if ( $this->is_top_level_menu ) {
     197                        return 'admin.php';
     198                }
     199
     200                return $this->container->is_network_enabled()
     201                        ? $this->network_parent_slug
     202                        : $this->parent_slug;
     203        }
     204
     205        /**
    159206         * Get settings page URL
    160207         *
    … …  
    162209         */
    163210        protected function get_settings_page_url(): string {
     211                $url = add_query_arg(
     212                        [ 'page' => $this->get_page_slug() ],
     213                        $this->get_menu_parent_file(),
     214                );
     215
    164216                return $this->container->is_network_enabled()
    165                         ? network_admin_url(
    166                                 add_query_arg(
    167                                         [ 'page' => $this->get_page_slug() ],
    168                                         $this->network_parent_slug,
    169                                 ),
    170                         )
    171                         : admin_url(
    172                                 add_query_arg(
    173                                         [ 'page' => $this->get_page_slug() ],
    174                                         $this->parent_slug,
    175                                 ),
    176                         );
     217                        ? network_admin_url( $url )
     218                        : admin_url( $url );
     219        }
     220
     221        /**
     222         * Get the URL the user who activated this container is sent to
     223         *
     224         * The settings page is where a container with nothing else to show belongs. A container
     225         * that has somewhere better to send a site owner on their first admin page load, such as
     226         * a setup wizard, answers with that address instead.
     227         *
     228         * @return string The URL to send the activating user to.
     229         */
     230        protected function get_post_activation_url(): string {
     231                return $this->get_settings_page_url();
    177232        }
    178233
    … …  
    183238         */
    184239        public function is_settings_page(): bool {
    185                 return Utils\Settings_Page_URLs::is_current_screen( $this->container );
     240                if ( ! $this->is_top_level_menu ) {
     241                        return Utils\Settings_Page_URLs::is_current_screen( $this->container );
     242                }
     243
     244                $screen = new Utils\Screen( $this->container );
     245
     246                return $screen->is( $this->get_page_slug(), 'toplevel_page' );
    186247        }
    187248
    … …  
    197258                }
    198259
     260                if ( $this->is_top_level_menu ) {
     261                        add_menu_page(
     262                                $this->page_title,
     263                                $this->menu_title,
     264                                $this->container->get_managing_capability(),
     265                                $this->get_page_slug(),
     266                                [ $this, 'render_page' ],
     267                                $this->menu_icon,
     268                                $this->menu_position,
     269                        );
     270
     271                        return;
     272                }
     273
    199274                add_submenu_page(
    200                         (
    201                                 $this->container->is_network_enabled()
    202                                         ? $this->network_parent_slug
    203                                         : $this->parent_slug
    204                         ),
     275                        $this->get_menu_parent_file(),
    205276                        $this->page_title,
    206277                        $this->menu_title,
    … …  
    238309
    239310        /**
    240          * Maybe redirect user to the settings screen
     311         * Maybe redirect the user who activated the container to where it wants them
    241312         *
    242313         * @return void
    … …  
    273344                // No need to worry about the network URL as we skip this action for the network admins.
    274345                wp_safe_redirect(
    275                         $this->get_settings_page_url(),
     346                        $this->get_post_activation_url(),
    276347                );
    277348
  • password-requirements/tags/3.9.0/deps/php/utils/class-asset.php

    r3669586 r3748178  
    1616 */
    1717final class Asset {
     18        /**
     19         * JSON flags the inline data is encoded with
     20         *
     21         * The data is written into a `<script>` element, where the HTML parser reads the content
     22         * before JavaScript does. PHP escapes forward slashes by default, so no value can produce
     23         * a literal `</script>`, but `<`, `>` and `&` pass through as they are, and a value
     24         * holding `<!--` or `<script` sends the parser into the state it reads a nested script
     25         * in, where the rest of the element is no longer read as script content. Writing the
     26         * three as `\uXXXX` escapes keeps every value out of the parser's way, and JavaScript
     27         * reads the escaped and the unescaped form as the same string.
     28         *
     29         * @var int
     30         */
     31        private const INLINE_DATA_JSON_FLAGS = JSON_HEX_TAG | JSON_HEX_AMP;
     32
    1833        /**
    1934         * Container instance
    … …  
    193208                         */
    194209                        sprintf(
    195                                 'window.teydeaStudio.%1$s.environment=window.teydeaStudio.%1$s.environment||{type:\'%2$s\',domain:\'%3$s\',homeUrl:\'%4$s\'};',
    196                                 esc_attr( Strings::to_camel_case( $this->container->get_slug() ) ),
    197                                 esc_attr( wp_get_environment_type() ),
    198                                 esc_attr( Environment::get_domain() ?? '' ),
    199                                 esc_attr( get_home_url() ),
     210                                'window.teydeaStudio.%1$s.environment=window.teydeaStudio.%1$s.environment||%2$s;',
     211                                esc_attr( Strings::to_camel_case( $this->container->get_slug() ) ),
     212                                wp_json_encode(
     213                                        [
     214                                                'type'    => wp_get_environment_type(),
     215                                                'domain'  => Environment::get_domain() ?? '',
     216                                                'homeUrl' => get_home_url(),
     217                                        ],
     218                                        self::INLINE_DATA_JSON_FLAGS,
     219                                ) ?: '{}',
    200220                        ),
    201221
    … …  
    204224                         */
    205225                        sprintf(
    206                                 'window.teydeaStudio.%1$s.%2$s=window.teydeaStudio.%1$s.%2$s||{name:\'%3$s\',slug:\'%4$s\',dataPrefix:\'%5$s\',isPro:%6$s};',
     226                                'window.teydeaStudio.%1$s.%2$s=window.teydeaStudio.%1$s.%2$s||%3$s;',
    207227                                esc_attr( Strings::to_camel_case( $this->container->get_slug() ) ),
    208228                                esc_attr( $this->container->get_type() ),
    209                                 esc_attr( $this->container->get_name() ),
    210                                 esc_attr( $this->container->get_slug() ),
    211                                 esc_attr( $this->container->get_data_prefix() ),
    212                                 esc_attr( $this->container->get_is_pro() ? 'true' : 'false' ),
     229                                wp_json_encode(
     230                                        [
     231                                                'name'       => $this->container->get_name(),
     232                                                'slug'       => $this->container->get_slug(),
     233                                                'dataPrefix' => $this->container->get_data_prefix(),
     234                                                'isPro'      => $this->container->get_is_pro(),
     235                                        ],
     236                                        self::INLINE_DATA_JSON_FLAGS,
     237                                ) ?: '{}',
    213238                        ),
    214239
    … …  
    220245                                esc_attr( Strings::to_camel_case( $this->container->get_slug() ) ),
    221246                                esc_attr( Strings::to_camel_case( $this->asset_slug ) ),
    222                                 wp_json_encode( $data ) ?: '{}',
     247                                wp_json_encode( $data, self::INLINE_DATA_JSON_FLAGS ) ?: '{}',
    223248                        ),
    224249                ];
    … …  
    263288                                esc_attr( Strings::to_camel_case( $this->container->get_slug() ) ),
    264289                                esc_attr( Strings::to_camel_case( $this->asset_slug ) ),
    265                                 wp_json_encode( $data ) ?: '{}',
     290                                wp_json_encode( $data, self::INLINE_DATA_JSON_FLAGS ) ?: '{}',
    266291                        ),
    267292                ];
  • password-requirements/tags/3.9.0/deps/php/utils/class-cache.php

    r3669586 r3748178  
    311311                        case 'file':
    312312                                if ( null !== $this->file ) {
    313                                         $modified_at = File::get_modified_time( $this->file );
    314 
    315                                         if ( false === $modified_at ) {
    316                                                 $modified_at = 0;
    317                                         }
    318 
    319                                         $tokens['key'] = sprintf( 'file:%1$s:%2$d', md5( $this->file ), $modified_at );
     313                                        $modified_at   = File::get_modified_time( $this->file );
     314                                        $tokens['key'] = sprintf( 'file:%1$s:%2$d', md5( $this->file ), false === $modified_at ? 0 : $modified_at );
    320315                                }
    321316
    … …  
    323318                }
    324319
    325                 if ( ! empty( $tokens['key'] ) ) {
     320                if ( '' !== $tokens['key'] ) {
    326321                        $tokens['key'] = sprintf( '%1$s:%2$s', $tokens['key'], $this->container->get_version() );
    327322                }
    328323
    329                 return empty( $tokens['key'] ) ? null : $tokens;
     324                return '' === $tokens['key'] ? null : $tokens;
    330325        }
    331326
    … …  
    373368                }
    374369
    375                 /** @var array<int,int|string> $blog_ids */
    376                 $blog_ids = get_sites(
    377                         [
    378                                 'fields' => 'ids',
    379                                 'number' => 0,
    380                         ],
    381                 );
    382 
    383                 foreach ( $blog_ids as $blog_id ) {
    384                         switch_to_blog( Type::ensure_int( $blog_id ) );
     370                foreach ( Network_Sites::ids() as $blog_id ) {
     371                        switch_to_blog( $blog_id );
    385372                        $this->delete();
    386373                        restore_current_blog();
  • password-requirements/tags/3.9.0/deps/php/utils/class-container.php

    r3669586 r3748178  
    88namespace Teydea_Studio\Login_Security\Dependencies\Utils;
    99
    10 use WP_Role;
    11 use WP_User;
    12 
    1310if ( ! defined( 'ABSPATH' ) ) {
    1411        exit; // @codeCoverageIgnore
    … …  
    2017abstract class Container {
    2118        /**
    22          * Capabilities version
    23          *
    24          * Used to determine whether the custom capabilities should
    25          * be remapped for the user roles.
    26          *
    27          * @var string
    28          */
    29         const CAPABILITIES_VERSION = 'v1';
    30 
    31         /**
    3219         * Request-scoped memo of cache group-version counters
    3320         *
    … …  
    9077
    9178        /**
    92          * Lazy-constructed post-meta registry for this container
    93          *
    94          * @var ?Post_Meta_Registry
    95          */
    96         protected ?Post_Meta_Registry $post_meta_registry = null;
     79         * Objects shared by everything this container runs, keyed by class name
     80         *
     81         * @var array<class-string,object>
     82         */
     83        protected array $shared_instances = [];
    9784
    9885        /**
    … …  
    258245
    259246        /**
    260          * Get (lazy-construct) the post-meta registry for this container
    261          *
    262          * @return Post_Meta_Registry Registry scoped to this container.
    263          */
    264         public function get_post_meta_registry(): Post_Meta_Registry {
    265                 if ( null === $this->post_meta_registry ) {
    266                         $this->post_meta_registry = new Post_Meta_Registry();
     247         * Get (lazy-construct) the instance of a class shared by everything this container runs
     248         *
     249         * The container names no such class itself, so a collaborator only the plugins use, such
     250         * as the post-meta registry, is not shipped with a theme that never asks for it.
     251         *
     252         * @template T of object
     253         *
     254         * @param class-string<T> $class_name Class to instantiate; its constructor takes no arguments.
     255         *
     256         * @return T Instance scoped to this container.
     257         */
     258        public function get_shared_instance( string $class_name ): object {
     259                if ( ! isset( $this->shared_instances[ $class_name ] ) ) {
     260                        $this->shared_instances[ $class_name ] = new $class_name();
    267261                }
    268262
    269                 return $this->post_meta_registry;
     263                /** @var T */
     264                return $this->shared_instances[ $class_name ];
    270265        }
    271266
    … …  
    368363                $this->for_all_modules( 'register' );
    369364
    370                 // Maybe update the capabilities.
    371                 add_action( 'admin_init', [ $this, 'maybe_update_capabilities' ] );
    372 
    373                 // Only plugins can be enabled network-wide.
    374                 if ( 'plugin' === $this->get_type() ) {
    375                         // Add the network-wide capabilities after the user is granted Super Admin privileges.
    376                         add_action( 'granted_super_admin', [ $this, 'add_network_capabilities_to_user' ] );
    377 
    378                         // Remove the network-wide capabilities after the user's Super Admin privileges are revoked.
    379                         add_action( 'revoked_super_admin', [ $this, 'remove_network_capabilities_from_user' ] );
    380                 }
    381         }
     365                $this->register_container_hooks();
     366        }
     367
     368        /**
     369         * Register the hooks this kind of container needs once its modules are registered
     370         *
     371         * @return void
     372         */
     373        protected function register_container_hooks(): void {}
    382374
    383375        /**
    … …  
    454446
    455447        /**
    456          * Get the capability required for managing the
    457          * container's settings
     448         * Get the capability required for managing the container
    458449         *
    459450         * @param string $scope Capability scope, either "network" for managing network options or "single" for managing single site options. Defaults to "detect", which means it will detect whether the container is running on the network level.
    460451         *
    461          * @return string Capability required for managing the container's settings.
    462          */
    463         public function get_managing_capability( $scope = 'detect' ): string {
    464                 $for_network = 'network' === $scope || ( 'detect' === $scope && $this->is_network_enabled() );
    465                 $capability  = $for_network
    466                         ? 'manage_network_options'
    467                         : 'manage_options';
    468 
    469                 return sprintf( '%1$s__%2$s', $this->get_data_prefix(), $capability );
     452         * @return string Capability required for managing the container.
     453         */
     454        abstract public function get_managing_capability( string $scope = 'detect' ): string;
     455
     456        /**
     457         * Get the key of the role standing in for the network's Super Admins
     458         *
     459         * @return string Network Super Admin role key.
     460         */
     461        public function get_network_super_admin_role_key(): string {
     462                return sprintf( '%s:network-super-admin', $this->get_data_prefix() );
    470463        }
    471464
    … …  
    560553                return false;
    561554        }
    562 
    563         /**
    564          * Maybe update the capabilities
    565          *
    566          * @return void
    567          */
    568         public function maybe_update_capabilities(): void {
    569                 // The option key.
    570                 $option_key = sprintf( '%s__capabilities_version', $this->get_data_prefix() );
    571 
    572                 // Get the current capabilities version.
    573                 $capabilities_version = get_option( $option_key, false );
    574 
    575                 // Only proceed if capabilities has not yet been updated.
    576                 if ( self::CAPABILITIES_VERSION !== $capabilities_version ) {
    577                         /**
    578                          * Grant the capability to manage the container
    579                          * options for administrators
    580                          */
    581                         $role = get_role( 'administrator' );
    582 
    583                         if ( $role instanceof WP_Role ) {
    584                                 $role->add_cap( $this->get_managing_capability( 'single' ) );
    585                         }
    586 
    587                         /**
    588                          * Update the option so this will not be executed until
    589                          * the capabilities version changes in the future
    590                          */
    591                         update_option( $option_key, self::CAPABILITIES_VERSION );
    592                 }
    593 
    594                 /**
    595                  * On network installations, grant special capability
    596                  * to manage the network-level container options
    597                  * for Super Admin users
    598                  */
    599                 if ( is_multisite() && 'plugin' === $this->get_type() ) {
    600                         // Get the current network ID.
    601                         $network_id = get_current_network_id();
    602 
    603                         // The option key.
    604                         $network_option_key = sprintf( '%s__network_capabilities_version', $this->get_data_prefix() );
    605 
    606                         // Get the current capabilities version.
    607                         $network_capabilities_version = get_network_option( $network_id, $network_option_key, false );
    608 
    609                         // Only proceed if capabilities has not yet been updated.
    610                         if ( self::CAPABILITIES_VERSION !== $network_capabilities_version ) {
    611                                 $super_admins = get_super_admins();
    612 
    613                                 foreach ( $super_admins as $user_login ) {
    614                                         $user = get_user_by( 'login', $user_login );
    615 
    616                                         if ( $user instanceof WP_User ) {
    617                                                 $user->add_cap( $this->get_managing_capability( 'network' ) );
    618                                         }
    619                                 }
    620 
    621                                 /**
    622                                  * Update the option so this will not be executed until
    623                                  * the capabilities version changes in the future
    624                                  */
    625                                 update_network_option( $network_id, $network_option_key, self::CAPABILITIES_VERSION );
    626                         }
    627                 }
    628         }
    629 
    630         /**
    631          * Add the network-wide capabilities after the user is granted Super Admin privileges
    632          *
    633          * @param int $user_id ID of the user to grant the capabilities to.
    634          *
    635          * @return void
    636          */
    637         public function add_network_capabilities_to_user( int $user_id ): void {
    638                 $user = get_user_by( 'ID', $user_id );
    639 
    640                 if ( $user instanceof WP_User ) {
    641                         $user->add_cap( $this->get_managing_capability( 'network' ) );
    642                 }
    643         }
    644 
    645         /**
    646          * Remove the network-wide capabilities after the user's Super Admin privileges are revoked
    647          *
    648          * @param int $user_id ID of the user to revoke the capabilities from.
    649          *
    650          * @return void
    651          */
    652         public function remove_network_capabilities_from_user( int $user_id ): void {
    653                 $user = get_user_by( 'ID', $user_id );
    654 
    655                 if ( $user instanceof WP_User ) {
    656                         $user->remove_cap( $this->get_managing_capability( 'network' ) );
    657                 }
    658         }
    659 
    660         /**
    661          * Run custom actions on each module during the container activation
    662          *
    663          * Aborts activation with wp_die() if declared runtime requirements
    664          * are not met, so the plugin remains inactive afterwards.
    665          *
    666          * @return void
    667          */
    668         public function on_activation(): void {
    669                 $requirements = $this->get_requirements();
    670                 $requirements->check();
    671 
    672                 if ( $requirements->has_failures() ) {
    673                         $requirements->abort_activation();
    674                 }
    675 
    676                 $this->maybe_update_capabilities();
    677                 $this->for_all_modules( 'on_container_activation' );
    678         }
    679 
    680         /**
    681          * Run custom actions on each module during the container deactivation
    682          *
    683          * @return void
    684          */
    685         public function on_deactivation(): void {
    686                 $this->for_all_modules( 'on_container_deactivation' );
    687         }
    688555}
  • password-requirements/tags/3.9.0/deps/php/utils/class-date-time.php

    r3669586 r3748178  
    4040                $modifier = Strings::trim( $modifier );
    4141
    42                 if ( ! empty( $modifier ) ) {
     42                if ( '' !== $modifier ) {
    4343                        $datetime->modify( $modifier );
    4444                }
    … …  
    105105                $modifier  = Strings::trim( $modifier );
    106106
    107                 if ( ! empty( $modifier ) ) {
     107                if ( '' !== $modifier ) {
    108108                        $timestamp = strtotime( $modifier, $timestamp );
    109109
    … …  
    142142        public static function parse_utc_datetime( string $datetime ): int {
    143143                $parsed = DateTimeImmutable::createFromFormat( 'Y-m-d H:i:s', $datetime, new DateTimeZone( 'UTC' ) );
    144 
    145144                return false !== $parsed ? $parsed->getTimestamp() : 0;
    146145        }
    … …  
    192191                try {
    193192                        $datetime = new DateTime( $value, wp_timezone() );
    194 
    195193                        return $datetime->getTimestamp();
    196194                } catch ( Exception $exception ) {
  • password-requirements/tags/3.9.0/deps/php/utils/class-debug.php

    r3669586 r3748178  
    2828                $message = is_string( $error ) ? $error : $error->get_error_message();
    2929
    30                 if ( empty( $message ) ) {
     30                if ( '' === $message ) {
    3131                        $message = 'An error occurred, but no message was provided.';
    3232                }
    3333
    34                 if ( is_wp_error( $error ) && $error->get_error_code() ) {
     34                if ( is_wp_error( $error ) && ! in_array( $error->get_error_code(), [ 0, '', '0' ], true ) ) {
    3535                        $message = sprintf(
    3636                                'Error code: %s. %s',
  • password-requirements/tags/3.9.0/deps/php/utils/class-module.php

    r3669586 r3748178  
    1616 */
    1717abstract class Module {
    18         /**
    19          * Simplify access to the Settings class instance
    20          */
    21         use With_Settings;
    22 
    2318        /**
    2419         * Container instance
  • password-requirements/tags/3.9.0/deps/php/utils/class-nested-array.php

    r3669586 r3748178  
    1616 *
    1717 * Stateless helpers for converting between flat dot-notation keys and
    18  * nested array structures.
     18 * nested array structures, and for merging one nested structure into another.
    1919 */
    2020final class Nested_Array {
    … …  
    4545
    4646                return $flat;
     47        }
     48
     49        /**
     50         * Merge one nested array into another
     51         *
     52         * What is in the overlay decides how it lands. A list replaces whatever it lands on: a
     53         * list stands for the whole of something - a color palette, a set of choices - so merging
     54         * it entry by entry would leave behind the entries the overlay dropped and renumber the
     55         * rest. Anything else merges into what it lands on, list or map.
     56         *
     57         * An empty array is the one value that could be either. JSON decoded into arrays turns
     58         * `{}` and `[]` into the same thing, so what it lands on is what says which it was: over
     59         * a map it reads as an empty map and changes nothing, over a list it reads as an empty
     60         * list and replaces it. Reading it as a list everywhere would have an empty `styles`
     61         * object in an overlay wipe out every style the base held.
     62         *
     63         * @param array<mixed> $base    Data to merge into.
     64         * @param array<mixed> $overlay Data to merge in.
     65         *
     66         * @return array<mixed> Merged data.
     67         */
     68        public static function merge( array $base, array $overlay ): array {
     69                foreach ( $overlay as $key => $value ) {
     70                        if ( is_array( $value ) && isset( $base[ $key ] ) && is_array( $base[ $key ] ) && self::merges_into( $value, $base[ $key ] ) ) {
     71                                $base[ $key ] = self::merge( $base[ $key ], $value );
     72                                continue;
     73                        }
     74
     75                        $base[ $key ] = $value;
     76                }
     77
     78                return $base;
     79        }
     80
     81        /**
     82         * Check whether an overlay value merges into what it lands on rather than replacing it
     83         *
     84         * @param array<mixed> $value Overlay value.
     85         * @param array<mixed> $base  What it lands on.
     86         *
     87         * @return bool Whether the value merges in.
     88         */
     89        private static function merges_into( array $value, array $base ): bool {
     90                if ( [] === $value ) {
     91                        return ! self::is_list( $base );
     92                }
     93
     94                return ! self::is_list( $value );
     95        }
     96
     97        /**
     98         * Polyfill for the PHP 8.1 "array_is_list" function
     99         *
     100         * @param array<mixed> $value Array to check.
     101         *
     102         * @return bool Whether the array is a list rather than a map.
     103         */
     104        public static function is_list( array $value ): bool {
     105                if ( function_exists( 'array_is_list' ) ) {
     106                        return array_is_list( $value );
     107                }
     108
     109                return self::is_list_by_keys( $value );
     110        }
     111
     112        /**
     113         * Check whether an array's keys count up from zero without gaps
     114         *
     115         * This is the same check "array_is_list" makes, kept as its own method so that it can be
     116         * tested on the PHP versions that also have the native function.
     117         *
     118         * @param array<mixed> $value Array to check.
     119         *
     120         * @return bool Whether the array is a list rather than a map.
     121         */
     122        public static function is_list_by_keys( array $value ): bool {
     123                $index = 0;
     124
     125                foreach ( array_keys( $value ) as $key ) {
     126                        if ( $key !== $index ) {
     127                                return false;
     128                        }
     129
     130                        ++$index;
     131                }
     132
     133                return true;
    47134        }
    48135
  • password-requirements/tags/3.9.0/deps/php/utils/class-plugin.php

    r3669586 r3748178  
    88namespace Teydea_Studio\Login_Security\Dependencies\Utils;
    99
     10use WP_Role;
     11use WP_User;
     12
    1013if ( ! defined( 'ABSPATH' ) ) {
    1114        exit; // @codeCoverageIgnore
    … …  
    1720final class Plugin extends Container {
    1821        /**
     22         * Capabilities version
     23         *
     24         * Used to determine whether the custom capabilities should
     25         * be remapped for the user roles.
     26         *
     27         * @var string
     28         */
     29        const CAPABILITIES_VERSION = 'v1';
     30
     31        /**
    1932         * Whether the plugin is currently being activated network-wide
    2033         *
    … …  
    4659        public function get_activate_capability(): string {
    4760                return 'activate_plugins';
     61        }
     62
     63        /**
     64         * Get the capability required for managing the plugin's settings
     65         *
     66         * @param string $scope Capability scope, either "network" for managing network options or "single" for managing single site options. Defaults to "detect", which means it will detect whether the plugin is running on the network level.
     67         *
     68         * @return string Capability required for managing the plugin's settings.
     69         */
     70        public function get_managing_capability( string $scope = 'detect' ): string {
     71                $for_network = 'network' === $scope || ( 'detect' === $scope && $this->is_network_enabled() );
     72                $capability  = $for_network
     73                        ? 'manage_network_options'
     74                        : 'manage_options';
     75
     76                return sprintf( '%1$s__%2$s', $this->get_data_prefix(), $capability );
    4877        }
    4978
    … …  
    115144                $this->is_being_activated_network_wide = $network_wide;
    116145        }
     146
     147        /**
     148         * Register the capability hooks once the modules are registered
     149         *
     150         * @return void
     151         */
     152        protected function register_container_hooks(): void {
     153                // Maybe update the capabilities.
     154                add_action( 'admin_init', [ $this, 'maybe_update_capabilities' ] );
     155
     156                // Add the network-wide capabilities after the user is granted Super Admin privileges.
     157                add_action( 'granted_super_admin', [ $this, 'add_network_capabilities_to_user' ] );
     158
     159                // Remove the network-wide capabilities after the user's Super Admin privileges are revoked.
     160                add_action( 'revoked_super_admin', [ $this, 'remove_network_capabilities_from_user' ] );
     161        }
     162
     163        /**
     164         * Maybe update the capabilities
     165         *
     166         * @return void
     167         */
     168        public function maybe_update_capabilities(): void {
     169                // The option key.
     170                $option_key = sprintf( '%s__capabilities_version', $this->get_data_prefix() );
     171
     172                // Get the current capabilities version.
     173                $capabilities_version = get_option( $option_key, false );
     174
     175                // Only proceed if capabilities has not yet been updated.
     176                if ( self::CAPABILITIES_VERSION !== $capabilities_version ) {
     177                        /**
     178                         * Grant the capability to manage the plugin
     179                         * options for administrators
     180                         */
     181                        $role = get_role( 'administrator' );
     182
     183                        if ( $role instanceof WP_Role ) {
     184                                $role->add_cap( $this->get_managing_capability( 'single' ) );
     185                                $this->refresh_current_user_capabilities();
     186                        }
     187
     188                        /**
     189                         * Update the option so this will not be executed until
     190                         * the capabilities version changes in the future
     191                         */
     192                        update_option( $option_key, self::CAPABILITIES_VERSION );
     193                }
     194
     195                /**
     196                 * On network installations, grant special capability
     197                 * to manage the network-level plugin options
     198                 * for Super Admin users
     199                 */
     200                if ( ! is_multisite() ) {
     201                        return;
     202                }
     203
     204                $network_id                   = get_current_network_id();
     205                $network_option_key           = sprintf( '%s__network_capabilities_version', $this->get_data_prefix() );
     206                $network_capabilities_version = get_network_option( $network_id, $network_option_key, false );
     207
     208                // Only proceed if capabilities has not yet been updated.
     209                if ( self::CAPABILITIES_VERSION === $network_capabilities_version ) {
     210                        return;
     211                }
     212
     213                foreach ( get_super_admins() as $user_login ) {
     214                        $user = get_user_by( 'login', $user_login );
     215
     216                        if ( $user instanceof WP_User ) {
     217                                $user->add_cap( $this->get_managing_capability( 'network' ) );
     218                        }
     219                }
     220
     221                /**
     222                 * Update the option so this will not be executed until
     223                 * the capabilities version changes in the future
     224                 */
     225                update_network_option( $network_id, $network_option_key, self::CAPABILITIES_VERSION );
     226        }
     227
     228        /**
     229         * Rebuild the loaded user's capability list after a role has been changed
     230         *
     231         * WordPress builds the current user's capability list once, when the user is first
     232         * loaded, and on an admin page that happens before `admin_init`. Granting a capability
     233         * to a role after that point updates the role and the option it is stored in, but not
     234         * the list the loaded user already carries, so the grant is not visible until the next
     235         * request. A new capabilities version is granted on the first admin page after an
     236         * update, which is the page the site owner is looking at.
     237         *
     238         * @return void
     239         */
     240        private function refresh_current_user_capabilities(): void {
     241                $user = wp_get_current_user();
     242
     243                if ( 0 !== $user->ID ) {
     244                        $user->get_role_caps();
     245                }
     246        }
     247
     248        /**
     249         * Add the network-wide capabilities after the user is granted Super Admin privileges
     250         *
     251         * @param int $user_id ID of the user to grant the capabilities to.
     252         *
     253         * @return void
     254         */
     255        public function add_network_capabilities_to_user( int $user_id ): void {
     256                $user = get_user_by( 'ID', $user_id );
     257
     258                if ( $user instanceof WP_User ) {
     259                        $user->add_cap( $this->get_managing_capability( 'network' ) );
     260                }
     261        }
     262
     263        /**
     264         * Remove the network-wide capabilities after the user's Super Admin privileges are revoked
     265         *
     266         * @param int $user_id ID of the user to revoke the capabilities from.
     267         *
     268         * @return void
     269         */
     270        public function remove_network_capabilities_from_user( int $user_id ): void {
     271                $user = get_user_by( 'ID', $user_id );
     272
     273                if ( $user instanceof WP_User ) {
     274                        $user->remove_cap( $this->get_managing_capability( 'network' ) );
     275                }
     276        }
     277
     278        /**
     279         * Run custom actions on each module during the plugin activation
     280         *
     281         * Aborts activation with wp_die() if declared runtime requirements
     282         * are not met, so the plugin remains inactive afterwards.
     283         *
     284         * @return void
     285         */
     286        public function on_activation(): void {
     287                $requirements = $this->get_requirements();
     288                $requirements->check();
     289
     290                if ( $requirements->has_failures() ) {
     291                        $requirements->abort_activation();
     292                }
     293
     294                $this->maybe_update_capabilities();
     295                $this->for_all_modules( 'on_container_activation' );
     296        }
     297
     298        /**
     299         * Run custom actions on each module during the plugin deactivation
     300         *
     301         * @return void
     302         */
     303        public function on_deactivation(): void {
     304                $this->for_all_modules( 'on_container_deactivation' );
     305        }
    117306}
  • password-requirements/tags/3.9.0/deps/php/utils/class-runtime-requirements.php

    r3669586 r3748178  
    127127         */
    128128        public function has_failures(): bool {
    129                 return ! empty( $this->failures );
     129                return [] !== $this->failures;
    130130        }
    131131
    … …  
    156156                }
    157157
    158                 if ( empty( $this->failures ) ) {
     158                if ( [] === $this->failures ) {
    159159                        return;
    160160                }
    … …  
    181181         */
    182182        public function abort_activation(): void {
    183                 if ( empty( $this->failures ) ) {
     183                if ( [] === $this->failures ) {
    184184                        return;
    185185                }
  • password-requirements/tags/3.9.0/deps/php/utils/class-screen.php

    r3669586 r3748178  
    5959                }
    6060
    61                 $valid_id  = ! empty( $type ) ? sprintf( '%1$s_%2$s', $type, $screen_key ) : $screen_key;
     61                $valid_id  = '' !== $type ? sprintf( '%1$s_%2$s', $type, $screen_key ) : $screen_key;
    6262                $valid_ids = [ $valid_id ];
    6363
  • password-requirements/tags/3.9.0/deps/php/utils/class-type.php

    r3669586 r3748178  
    7979                                 */
    8080                                function ( $value ): bool {
    81                                         return is_string( $value ) && ! empty( $value );
     81                                        return is_string( $value ) && '' !== $value;
    8282                                },
    8383                        ),
    … …  
    217217         */
    218218        public static function is_date( $value ): bool {
    219                 if ( ! is_string( $value ) || empty( $value ) ) {
     219                if ( ! is_string( $value ) || '' === $value ) {
    220220                        return false;
    221221                }
    … …  
    247247                }
    248248
    249                 if ( is_string( $value ) && preg_match( '/^[1-9]\d*$/', $value ) ) {
     249                if ( is_string( $value ) && 1 === preg_match( '/^[1-9]\d*$/', $value ) ) {
    250250                        return true;
    251251                }
    … …  
    283283                }
    284284
    285                 if ( ! preg_match( '/^[^\s#?]+$/', $authority, $matches, PREG_UNMATCHED_AS_NULL ) ) {
     285                if ( 1 !== preg_match( '/^[^\s#?]+$/', $authority, $matches, PREG_UNMATCHED_AS_NULL ) ) {
    286286                        return false;
    287287                }
  • password-requirements/tags/3.9.0/deps/php/utils/class-user.php

    r3669586 r3748178  
    104104
    105105        /**
     106         * Check whether the user has every capability on a list
     107         *
     108         * An empty list passes, because there is then no capability the user is missing.
     109         *
     110         * @param string[] $capabilities Capabilities to check.
     111         *
     112         * @return bool Boolean "true" if user has every one of the given capabilities, "false" otherwise.
     113         */
     114        public function can_all( array $capabilities ): bool {
     115                foreach ( $capabilities as $capability ) {
     116                        if ( ! $this->can( $capability ) ) {
     117                                return false;
     118                        }
     119                }
     120
     121                return true;
     122        }
     123
     124        /**
    106125         * Delete user meta
    107126         *
    … …  
    264283
    265284                if ( true === $this->container->is_network_enabled() && $this->is_super_admin() ) {
    266                         $users   = new Users( $this->container );
    267                         $roles[] = $users->get_network_super_admin_role_key();
     285                        $roles[] = $this->container->get_network_super_admin_role_key();
    268286                }
    269287
    … …  
    292310         */
    293311        public function has_plugin_managing_permissions(): bool {
    294                 return $this->can( 'install_plugins' ) && $this->can( 'activate_plugins' );
     312                return $this->can_all( [ 'install_plugins', 'activate_plugins' ] );
    295313        }
    296314
  • password-requirements/tags/3.9.0/deps/php/utils/class-users.php

    r3669586 r3748178  
    99
    1010use Teydea_Studio\Login_Security\User;
    11 use WP_Site;
    1211use WP_User;
    1312use WP_User_Query;
    … …  
    135134
    136135                $roles        = array_values( $roles );
    137                 $explicit_ids = empty( $users ) ? [] : $this->maybe_map_user_logins_to_user_ids( $users );
     136                $explicit_ids = [] === $users ? [] : $this->maybe_map_user_logins_to_user_ids( $users );
    138137
    139138                // The mapper preserves duplicates (a login and its own numeric ID resolve alike); de-duplicate so the explicit-user counts below don't double-count.
    140139                $explicit_ids = array_values( array_unique( $explicit_ids, SORT_NUMERIC ) );
    141140
    142                 if ( empty( $roles ) ) {
     141                if ( [] === $roles ) {
    143142                        // Explicit-users-only coverage: the resolved explicit set is the whole covered set.
    144143                        $count = count( $explicit_ids );
    … …  
    153152                $count = $this->count_users_in_roles( $roles, [] );
    154153
    155                 if ( ! empty( $explicit_ids ) ) {
     154                if ( [] !== $explicit_ids ) {
    156155                        // Union: add the explicit users the role match did not already include.
    157156                        $count += count( $explicit_ids ) - $this->count_users_in_roles( $roles, $explicit_ids );
    … …  
    181180                ];
    182181
    183                 if ( ! empty( $include_ids ) ) {
     182                if ( [] !== $include_ids ) {
    184183                        $args['include'] = $include_ids;
    185184                }
    … …  
    204203                }
    205204
    206                 return ! empty( array_intersect( $user->roles, $roles ) );
     205                return [] !== array_intersect( $user->roles, $roles );
     206        }
     207
     208        /**
     209         * Add the roles the other sites of the network know and the current site does not
     210         *
     211         * @param array<int,array{value:string,title:string,id:int}> $data Roles collected so far.
     212         * @param array<string,true>                                 $seen Role slugs already collected, keyed by slug.
     213         *
     214         * @return array<int,array{value:string,title:string,id:int}> Roles with the other sites' unique roles appended.
     215         */
     216        private function collect_other_sites_roles( array $data, array $seen ): array {
     217                $current_blog_id = get_current_blog_id();
     218
     219                foreach ( Network_Sites::ids() as $blog_id ) {
     220                        if ( $blog_id === $current_blog_id ) {
     221                                continue;
     222                        }
     223
     224                        switch_to_blog( $blog_id );
     225
     226                        $site_roles = wp_roles();
     227
     228                        foreach ( $site_roles->role_names as $role => $display_name ) {
     229                                if ( isset( $seen[ $role ] ) ) {
     230                                        continue;
     231                                }
     232
     233                                $seen[ $role ] = true;
     234
     235                                $data[] = [
     236                                        'id'    => count( $data ),
     237                                        'value' => $role,
     238                                        'title' => $display_name,
     239                                ];
     240                        }
     241
     242                        restore_current_blog();
     243                }
     244
     245                return $data;
    207246        }
    208247
    … …  
    239278
    240279                        if ( true === $this->container->is_network_enabled() ) {
    241                                 $current_blog_id = get_current_blog_id();
    242 
    243                                 /** @var WP_Site $site */
    244                                 foreach ( get_sites( [ 'number' => 0 ] ) as $site ) {
    245                                         if ( Type::ensure_int( $site->blog_id ) === $current_blog_id ) {
    246                                                 continue;
    247                                         }
    248 
    249                                         switch_to_blog( Type::ensure_int( $site->blog_id ) );
    250 
    251                                         $site_roles = wp_roles();
    252 
    253                                         foreach ( $site_roles->role_names as $role => $display_name ) {
    254                                                 // Add unique roles only.
    255                                                 if ( isset( $seen[ $role ] ) ) {
    256                                                         continue;
    257                                                 }
    258 
    259                                                 $seen[ $role ] = true;
    260 
    261                                                 $data[] = [
    262                                                         'id'    => count( $data ),
    263                                                         'value' => $role,
    264                                                         'title' => $display_name,
    265                                                 ];
    266                                         }
    267 
    268                                         restore_current_blog();
    269                                 }
     280                                $data = $this->collect_other_sites_roles( $data, $seen );
    270281
    271282                                /**
    … …  
    279290                                $data[] = [
    280291                                        'id'    => count( $data ), // Ensure a unique ID.
    281                                         'value' => $this->get_network_super_admin_role_key(),
     292                                        'value' => $this->container->get_network_super_admin_role_key(),
    282293                                        'title' => __( 'Network Super Admin', 'password-requirements' ),
    283294                                ];
    … …  
    299310
    300311                return $data;
    301         }
    302 
    303         /**
    304          * Get the Network Super Admin role key
    305          *
    306          * @return string Network Super Admin role key.
    307          */
    308         public function get_network_super_admin_role_key(): string {
    309                 return sprintf( '%s:network-super-admin', $this->container->get_data_prefix() );
    310312        }
    311313
    … …  
    356358
    357359                if ( true === $this->container->is_network_enabled() ) {
    358                         /** @var WP_Site $site */
    359                         foreach ( get_sites( [ 'number' => 0 ] ) as $site ) {
    360                                 switch_to_blog( Type::ensure_int( $site->blog_id ) );
     360                        foreach ( Network_Sites::ids() as $blog_id ) {
     361                                switch_to_blog( $blog_id );
    361362
    362363                                $results = array_merge(
    … …  
    410411         */
    411412        protected function get_site_users( bool $include_all, array $roles, array $users ): array {
    412                 if ( false === $include_all && empty( $roles ) && empty( $users ) ) {
     413                if ( true === $include_all ) {
     414                        return array_unique( Type::ensure_array_of_ints( get_users( [ 'fields' => 'ID' ] ) ), SORT_NUMERIC );
     415                }
     416
     417                if ( [] === $roles && [] === $users ) {
    413418                        return [];
    414419                }
    … …  
    416421                $results = [];
    417422
    418                 if ( true === $include_all ) {
    419                         $results = get_users( [ 'fields' => 'ID' ] );
    420                 } else {
    421                         if ( ! empty( $roles ) ) {
    422                                 $results = array_merge(
    423                                         $results,
    424                                         get_users(
    425                                                 [
    426                                                         'role__in' => $roles,
    427                                                         'fields'   => 'ID',
    428                                                 ],
    429                                         ),
    430                                 );
    431 
    432                                 /**
    433                                  * Do we need to include Network Super Admins?
    434                                  */
    435                                 if ( true === $this->container->is_network_enabled() && in_array( $this->get_network_super_admin_role_key(), $roles, true ) ) {
    436                                         $super_admins = get_super_admins();
    437 
    438                                         if ( ! empty( $super_admins ) ) {
    439                                                 $results = array_merge(
    440                                                         $results,
    441                                                         get_users(
    442                                                                 [
    443                                                                         'include' => $this->maybe_map_user_logins_to_user_ids( $super_admins ),
    444                                                                         'fields'  => 'ID',
    445                                                                 ],
    446                                                         ),
    447                                                 );
    448                                         }
     423                if ( [] !== $roles ) {
     424                        $results = array_merge(
     425                                $results,
     426                                get_users(
     427                                        [
     428                                                'role__in' => $roles,
     429                                                'fields'   => 'ID',
     430                                        ],
     431                                ),
     432                        );
     433
     434                        /**
     435                         * Do we need to include Network Super Admins?
     436                         */
     437                        if ( true === $this->container->is_network_enabled() && in_array( $this->container->get_network_super_admin_role_key(), $roles, true ) ) {
     438                                $super_admins = get_super_admins();
     439
     440                                if ( [] !== $super_admins ) {
     441                                        $results = array_merge(
     442                                                $results,
     443                                                get_users(
     444                                                        [
     445                                                                'include' => $this->maybe_map_user_logins_to_user_ids( $super_admins ),
     446                                                                'fields'  => 'ID',
     447                                                        ],
     448                                                ),
     449                                        );
    449450                                }
    450451                        }
    451 
    452                         if ( ! empty( $users ) ) {
    453                                 $results = array_merge(
    454                                         $results,
    455                                         get_users(
    456                                                 [
    457                                                         'include' => $users,
    458                                                         'fields'  => 'ID',
    459                                                 ],
    460                                         ),
    461                                 );
    462                         }
     452                }
     453
     454                if ( [] !== $users ) {
     455                        $results = array_merge(
     456                                $results,
     457                                get_users(
     458                                        [
     459                                                'include' => $users,
     460                                                'fields'  => 'ID',
     461                                        ],
     462                                ),
     463                        );
    463464                }
    464465
    … …  
    502503                        $roles = $this->strip_super_admin_sentinel( $roles );
    503504
    504                         if ( empty( $roles ) ) {
     505                        if ( [] === $roles ) {
    505506                                return [];
    506507                        }
    … …  
    536537         */
    537538        public function get_explicit_coverage_ids( array $roles, array $user_logins ): array {
    538                 $resolved     = empty( $user_logins ) ? [] : $this->maybe_map_user_logins_to_user_ids( $user_logins );
     539                $resolved     = [] === $user_logins ? [] : $this->maybe_map_user_logins_to_user_ids( $user_logins );
    539540                $super_admins = $this->resolve_super_admins_for_sentinel( $roles );
    540541
    … …  
    557558                }
    558559
    559                 $sentinel = $this->get_network_super_admin_role_key();
     560                $sentinel = $this->container->get_network_super_admin_role_key();
    560561
    561562                return array_values( array_filter( $roles, static fn ( string $role ): bool => $role !== $sentinel ) );
    … …  
    574575                }
    575576
    576                 if ( ! in_array( $this->get_network_super_admin_role_key(), $roles, true ) ) {
     577                if ( ! in_array( $this->container->get_network_super_admin_role_key(), $roles, true ) ) {
    577578                        return [];
    578579                }
    … …  
    580581                $super_admins = get_super_admins();
    581582
    582                 return empty( $super_admins ) ? [] : $this->maybe_map_user_logins_to_user_ids( $super_admins );
     583                return [] === $super_admins ? [] : $this->maybe_map_user_logins_to_user_ids( $super_admins );
    583584        }
    584585
  • password-requirements/tags/3.9.0/deps/php/utils/trait-with-rest-helpers.php

    r3669586 r3748178  
    4949                         * Validate the nonce value against the prefixed action
    5050                         *
    51                          * @param string $value Nonce value.
     51                         * The value arrives as the request wrote it, whatever the `type` above says.
     52                         * WordPress wires `rest_validate_request_arg` in as an argument's default
     53                         * validator only, so an argument that names a `validate_callback` of its own is
     54                         * never checked against its schema, and a request body naming an array or a
     55                         * number for the nonce reaches this closure with one. `has_valid_params()` runs
     56                         * before the route's `permission_callback`, so the caller handing it over does
     57                         * not have to be signed in.
     58                         *
     59                         * @param mixed $value Nonce value, as the request carried it.
    5260                         *
    5361                         * @return bool Whether the nonce value is valid.
    5462                         */
    55                         'validate_callback' => function ( string $value ) use ( $action ): bool {
     63                        'validate_callback' => function ( $value ) use ( $action ): bool {
     64                                if ( ! is_string( $value ) ) {
     65                                        return false;
     66                                }
     67
    5668                                $nonce = new Nonce( $this->container, $action );
     69
    5770                                return false !== wp_verify_nonce( $value, $nonce->get_action() );
    5871                        },
  • password-requirements/tags/3.9.0/deps/php/utils/trait-with-settings.php

    r3669586 r3748178  
    1515/**
    1616 * The "With_Settings" trait
     17 *
     18 * Mixed in by each class that reads the settings, rather than by `Module`, so a package
     19 * whose modules never read any, such as a theme, ships without the settings classes.
     20 *
     21 * @phpstan-ignore trait.unused (Consumed only by classes in other packages; composer-utils itself never mixes it in, so PHPStan reports it as unused here. The body is analyzed in every consumer package that uses it.)
    1722 */
    1823trait With_Settings {
  • password-requirements/tags/3.9.0/deps/php/validatable-fields/class-closures.php

    r3669586 r3748178  
    418418                        if ( Utils\Type::is_date( $value ) ) {
    419419                                return true;
     420                        }
     421
     422                        if ( ! mb_check_encoding( $value, 'UTF-8' ) ) {
     423                                return new WP_Error(
     424                                        'field_value_incorrect',
     425                                        __( 'The date given could not be read as text.', 'password-requirements' ),
     426                                );
    420427                        }
    421428
    … …  
    546553                        }
    547554
    548                         if ( 1 !== preg_match( $pattern, $value ) ) {
     555                        if ( 1 === preg_match( $pattern, $value ) ) {
     556                                return true;
     557                        }
     558
     559                        if ( ! mb_check_encoding( $value, 'UTF-8' ) ) {
    549560                                return new WP_Error(
    550561                                        'field_value_incorrect',
    551                                         sprintf(
    552                                                 // Translators: %s - invalid unit value.
    553                                                 __( '"%s" is not a valid unit value.', 'password-requirements' ),
    554                                                 $value,
    555                                         ),
    556                                 );
    557                         }
    558 
    559                         return true;
     562                                        __( 'The unit value given could not be read as text.', 'password-requirements' ),
     563                                );
     564                        }
     565
     566                        return new WP_Error(
     567                                'field_value_incorrect',
     568                                sprintf(
     569                                        // Translators: %s - invalid unit value.
     570                                        __( '"%s" is not a valid unit value.', 'password-requirements' ),
     571                                        $value,
     572                                ),
     573                        );
    560574                };
    561575        }
    … …  
    582596                        }
    583597
    584                         return is_email( $value )
     598                        return false !== is_email( $value )
    585599                                ? sanitize_email( $value )
    586600                                : sanitize_url( $value );
    … …  
    614628                        }
    615629
    616                         if ( '' === $value || is_email( $value ) ) {
     630                        // Checked first because Type::is_url() ignores the encoding and would accept a URL carrying malformed bytes.
     631                        if ( ! mb_check_encoding( $value, 'UTF-8' ) ) {
     632                                return new WP_Error(
     633                                        'field_value_incorrect',
     634                                        __( 'The URL given could not be read as text.', 'password-requirements' ),
     635                                );
     636                        }
     637
     638                        if ( '' === $value || false !== is_email( $value ) ) {
    617639                                return true;
    618640                        }
    … …  
    653675                        }
    654676
    655                         if ( isset( $query_args['post_type__in'] ) && is_array( $query_args['post_type__in'] ) ) {
    656                                 $known_post_types = $query_args['post_type__in'];
    657                         } else {
    658                                 /** @var array<string,string> $found_post_types */
    659                                 $found_post_types = get_post_types( $query_args );
    660                                 $known_post_types = array_values( $found_post_types );
    661                         }
     677                        $known_post_types = self::resolve_known_post_types( $query_args );
    662678
    663679                        $valid_post_types = [];
    … …  
    700716                        }
    701717
    702                         if ( isset( $query_args['post_type__in'] ) && is_array( $query_args['post_type__in'] ) ) {
    703                                 $known_post_types = $query_args['post_type__in'];
    704                         } else {
    705                                 /** @var array<string,string> $found_post_types */
    706                                 $found_post_types = get_post_types( $query_args );
    707                                 $known_post_types = array_values( $found_post_types );
    708                         }
     718                        $known_post_types = self::resolve_known_post_types( $query_args );
     719
     720                        $position = 0;
    709721
    710722                        foreach ( $values as $value ) {
     723                                ++$position;
     724
    711725                                if ( ! in_array( $value, $known_post_types, true ) ) {
    712726                                        /** @var string[] $known_post_types */
    … …  
    714728                                                'field_value_out_of_scope',
    715729                                                sprintf(
    716                                                         // Translators: %1$s - invalid value, %2$s - list of known values.
    717                                                         __( '"%1$s" is not a value within "%2$s".', 'password-requirements' ),
    718                                                         Utils\Type::ensure_string( $value ),
     730                                                        // Translators: %1$d - position of the offending entry in the list, %2$s - list of known values.
     731                                                        __( 'Entry %1$d is not a value within "%2$s".', 'password-requirements' ),
     732                                                        $position,
    719733                                                        implode( ', ', $known_post_types ),
    720734                                                ),
    … …  
    744758                 */
    745759                return function ( $values ) use ( $users ): array {
     760                        if ( ! is_array( $values ) ) {
     761                                return [];
     762                        }
     763
    746764                        $known_roles = array_column( $users->get_known_user_roles(), 'value' );
    747765                        $valid_roles = [];
    748766
    749                         if ( is_array( $values ) ) {
    750                                 foreach ( $values as $value ) {
    751                                         if ( in_array( $value, $known_roles, true ) ) {
    752                                                 $valid_roles[] = $value;
    753                                         }
     767                        foreach ( $values as $value ) {
     768                                if ( in_array( $value, $known_roles, true ) ) {
     769                                        $valid_roles[] = $value;
    754770                                }
    755771                        }
    … …  
    788804
    789805                        $known_roles = array_column( $users->get_known_user_roles(), 'value' );
     806                        $position    = 0;
    790807
    791808                        foreach ( $values as $value ) {
     809                                ++$position;
     810
    792811                                if ( ! in_array( $value, $known_roles, true ) ) {
    793812                                        return new WP_Error(
    794813                                                'field_value_out_of_scope',
    795814                                                sprintf(
    796                                                         // Translators: %1$s - invalid value, %2$s - list of known values.
    797                                                         __( '"%1$s" is not a value within "%2$s".', 'password-requirements' ),
    798                                                         Utils\Type::ensure_string( $value ),
     815                                                        // Translators: %1$d - position of the offending entry in the list, %2$s - list of known values.
     816                                                        __( 'Entry %1$d is not a value within "%2$s".', 'password-requirements' ),
     817                                                        $position,
    799818                                                        implode( ', ', $known_roles ),
    800819                                                ),
    … …  
    866885
    867886                        $known_logins = self::resolve_known_user_logins( $values );
     887                        $position     = 0;
    868888
    869889                        foreach ( $values as $value ) {
     890                                ++$position;
     891
    870892                                if ( ! is_string( $value ) ) {
    871893                                        return new WP_Error(
    … …  
    883905                                                'field_value_out_of_scope',
    884906                                                sprintf(
    885                                                         // Translators: %s - unknown user value.
    886                                                         __( '"%s" does not correspond to any known user.', 'password-requirements' ),
    887                                                         Utils\Type::ensure_string( $value ),
     907                                                        // Translators: %d - position of the offending entry in the list.
     908                                                        __( 'Entry %d does not correspond to any known user.', 'password-requirements' ),
     909                                                        $position,
    888910                                                ),
    889911                                        );
    … …  
    893915                        return true;
    894916                };
     917        }
     918
     919        /**
     920         * Resolve the known post types from query arguments
     921         *
     922         * @param array<string,mixed> $query_args Query arguments used for getting a list of post types.
     923         *
     924         * @return array<mixed> Known post types.
     925         */
     926        private static function resolve_known_post_types( array $query_args ): array {
     927                if ( isset( $query_args['post_type__in'] ) && is_array( $query_args['post_type__in'] ) ) {
     928                        return $query_args['post_type__in'];
     929                }
     930
     931                /** @var array<string,string> $found_post_types */
     932                $found_post_types = get_post_types( $query_args );
     933
     934                return array_values( $found_post_types );
    895935        }
    896936
  • password-requirements/tags/3.9.0/deps/php/validatable-fields/class-configuration.php

    r3669586 r3748178  
    232232                         */
    233233                        'validator'     => function ( $value ) {
     234                                if ( is_string( $value ) && ! mb_check_encoding( $value, 'UTF-8' ) ) {
     235                                        return new WP_Error(
     236                                                'field_key_incorrect',
     237                                                __( 'The key given for the dynamic field could not be read as text.', 'password-requirements' ),
     238                                        );
     239                                }
     240
    234241                                if ( ! is_string( $value ) || ! Utils\Strings::str_starts_with( $value, 'd:' ) || 19 !== strlen( $value ) || 1 !== preg_match( '/^\\d+$/', str_replace( 'd:', '', $value ) ) ) {
    235242                                        return new WP_Error(
  • password-requirements/tags/3.9.0/deps/php/validatable-fields/class-dynamic-fields-group.php

    r3669586 r3748178  
    121121
    122122        /**
     123         * Extend a restorer or validator so it also receives the group it is built for
     124         *
     125         * @param ?Closure     $closure Closure registered for the field type, if any.
     126         * @param Fields_Group $group   Group the field belongs to.
     127         *
     128         * @return ?Closure Closure taking the value and calling the original one with the value and the group; null when there is none.
     129         */
     130        private function bind_group( ?Closure $closure, Fields_Group $group ): ?Closure {
     131                if ( null === $closure ) {
     132                        return null;
     133                }
     134
     135                return function ( $value ) use ( $closure, $group ) {
     136                        return call_user_func( $closure, $value, $group );
     137                };
     138        }
     139
     140        /**
     141         * Build the configuration of an integer field from its template group
     142         *
     143         * The bounds are made consistent before use: a maximum below the minimum is
     144         * raised to it, and the default value is clamped into the resulting range.
     145         *
     146         * @param Fields_Group $group     Group holding the field's template values.
     147         * @param ?Closure     $restorer  Additional function for value restore.
     148         * @param ?Closure     $sanitizer Additional sanitizer function.
     149         * @param ?Closure     $validator Additional validation function.
     150         *
     151         * @return array{type:'integer',default_value:int,min:int,max:?int,restorer:?Closure,sanitizer:?Closure,validator:?Closure} Field configuration array.
     152         */
     153        private function integer_field_config( Fields_Group $group, ?Closure $restorer, ?Closure $sanitizer, ?Closure $validator ): array {
     154                /** @var ?int $default_value */
     155                $default_value = $group->get_field_value( 'default_value' );
     156                $default_value = $default_value ?? 0;
     157
     158                /** @var int $min */
     159                $min = $group->get_field_value( 'min' );
     160
     161                /** @var bool $use_max */
     162                $use_max = $group->get_field_value( 'use_max' );
     163
     164                /** @var ?int $max */
     165                $max = $use_max ? $group->get_field_value( 'max' ) : null;
     166
     167                if ( $use_max && is_int( $max ) && $max < $min ) {
     168                        $max = $min;
     169                }
     170
     171                if ( $default_value < $min ) {
     172                        $default_value = $min;
     173                }
     174
     175                if ( $use_max && is_int( $max ) && $default_value > $max ) {
     176                        $default_value = $max;
     177                }
     178
     179                return Configuration::integer_field(
     180                        $default_value,
     181                        $min,
     182                        $max,
     183                        $restorer,
     184                        $sanitizer,
     185                        $validator,
     186                );
     187        }
     188
     189        /**
    123190         * Get dynamic fields
    124191         *
    … …  
    142209
    143210                        $field_config = null;
    144                         $restorer     = $this->restorers[ $field_type ] ?? null;
     211                        $restorer     = $this->bind_group( $this->restorers[ $field_type ] ?? null, $group );
    145212                        $sanitizer    = $this->sanitizers[ $field_type ] ?? null;
    146                         $validator    = $this->validators[ $field_type ] ?? null;
    147 
    148                         if ( null !== $restorer ) {
    149                                 /**
    150                                  * Extend the restorer function by passing the instance
    151                                  * of the current object
    152                                  *
    153                                  * @param mixed $value Value to restore.
    154                                  *
    155                                  * @return mixed Restored value.
    156                                  */
    157                                 $restorer = function ( $value ) use ( $restorer, $group ) {
    158                                         return call_user_func( $restorer, $value, $group );
    159                                 };
    160                         }
    161 
    162                         if ( null !== $validator ) {
    163                                 /**
    164                                  * Extend the validator function by passing the instance
    165                                  * of the current object
    166                                  *
    167                                  * @param mixed $value Value to validate.
    168                                  *
    169                                  * @return mixed Validated value.
    170                                  */
    171                                 $validator = function ( $value ) use ( $validator, $group ) {
    172                                         return call_user_func( $validator, $value, $group );
    173                                 };
    174                         }
     213                        $validator    = $this->bind_group( $this->validators[ $field_type ] ?? null, $group );
    175214
    176215                        switch ( $field_type ) {
    … …  
    218257
    219258                                case 'integer':
    220                                         /** @var ?int $default_value */
    221                                         $default_value = $group->get_field_value( 'default_value' );
    222                                         $default_value = $default_value ?? 0;
    223 
    224                                         /** @var int $min */
    225                                         $min = $group->get_field_value( 'min' );
    226 
    227                                         /** @var bool $use_max */
    228                                         $use_max = $group->get_field_value( 'use_max' );
    229 
    230                                         /** @var ?int $max */
    231                                         $max = $use_max ? $group->get_field_value( 'max' ) : null;
    232 
    233                                         /**
    234                                          * Ensure field configuration is valid
    235                                          */
    236                                         if ( $use_max && is_int( $max ) && $max < $min ) {
    237                                                 $max = $min;
    238                                         }
    239 
    240                                         if ( $default_value < $min ) {
    241                                                 $default_value = $min;
    242                                         }
    243 
    244                                         if ( $use_max && is_int( $max ) && $default_value > $max ) {
    245                                                 $default_value = $max;
    246                                         }
    247 
    248                                         $field_config = Configuration::integer_field(
    249                                                 $default_value,
    250                                                 $min,
    251                                                 $max,
    252                                                 $restorer,
    253                                                 $sanitizer,
    254                                                 $validator,
    255                                         );
    256 
     259                                        $field_config = $this->integer_field_config( $group, $restorer, $sanitizer, $validator );
    257260                                        break;
    258261                        }
  • password-requirements/tags/3.9.0/deps/php/validatable-fields/class-field-array-of-strings.php

    r3669586 r3748178  
    110110                                         */
    111111                                        function ( string $item ): bool {
    112                                                 return ! empty( $item );
     112                                                return '' !== $item;
    113113                                        },
    114114                                ),
  • password-requirements/tags/3.9.0/deps/php/validatable-fields/class-field-float.php

    r3669586 r3748178  
    115115         */
    116116        protected function validate_value( $value ) {
     117                if ( is_string( $value ) && ! mb_check_encoding( $value, 'UTF-8' ) ) {
     118                        return new WP_Error(
     119                                'non_float_value',
     120                                sprintf(
     121                                        // Translators: %s - field name.
     122                                        __( 'Value of the "%s" field could not be read as text.', 'password-requirements' ),
     123                                        $this->get_key_camel_case(),
     124                                ),
     125                        );
     126                }
     127
    117128                if ( is_int( $value ) ) {
    118129                        $value = Utils\Type::ensure_float( $value, $this->precision );
    … …  
    121132                if ( ! is_float( $value ) ) {
    122133                        if ( is_string( $value ) ) {
     134                                if ( '' === Utils\Strings::trim( $value ) ) {
     135                                        return new WP_Error(
     136                                                'non_float_value',
     137                                                sprintf(
     138                                                        // Translators: %s - field name.
     139                                                        __( 'The "%s" field can\'t be empty.', 'password-requirements' ),
     140                                                        $this->get_key_camel_case(),
     141                                                ),
     142                                        );
     143                                }
     144
    123145                                if ( ! is_numeric( $value ) ) {
    124146                                        return new WP_Error(
  • password-requirements/tags/3.9.0/deps/php/validatable-fields/class-field-integer-of-choice.php

    r3669586 r3748178  
    5454        protected function validate_value( $value ) {
    5555                if ( ! is_int( $value ) ) {
     56                        if ( is_string( $value ) && '' === Utils\Strings::trim( $value ) ) {
     57                                return new WP_Error(
     58                                        'non_integer_value',
     59                                        sprintf(
     60                                                // Translators: %s - field name.
     61                                                __( 'The "%s" field can\'t be empty.', 'password-requirements' ),
     62                                                $this->get_key_camel_case(),
     63                                        ),
     64                                );
     65                        }
     66
    5667                        if ( is_string( $value ) && 1 === preg_match( '/^-?\\d+$/', $value ) ) {
    5768                                $value = Utils\Type::ensure_int( $value );
  • password-requirements/tags/3.9.0/deps/php/validatable-fields/class-field-integer.php

    r3669586 r3748178  
    101101         */
    102102        protected function validate_value( $value ) {
     103                if ( is_string( $value ) && ! mb_check_encoding( $value, 'UTF-8' ) ) {
     104                        return new WP_Error(
     105                                'non_integer_value',
     106                                sprintf(
     107                                        // Translators: %s - field name.
     108                                        __( 'Value of the "%s" field could not be read as text.', 'password-requirements' ),
     109                                        $this->get_key_camel_case(),
     110                                ),
     111                        );
     112                }
     113
    103114                if ( ! is_int( $value ) ) {
    104115                        if ( is_string( $value ) ) {
     116                                if ( '' === Utils\Strings::trim( $value ) ) {
     117                                        return new WP_Error(
     118                                                'non_integer_value',
     119                                                sprintf(
     120                                                        // Translators: %s - field name.
     121                                                        __( 'The "%s" field can\'t be empty.', 'password-requirements' ),
     122                                                        $this->get_key_camel_case(),
     123                                                ),
     124                                        );
     125                                }
     126
    105127                                /**
    106128                                 * Reject a leading sign: this field is unsigned because string coercion
  • password-requirements/tags/3.9.0/deps/php/validatable-fields/class-field-string-of-choice.php

    r3669586 r3748178  
    6868
    6969                if ( ! in_array( $value, $this->allowed_values, true ) ) {
     70                        if ( ! mb_check_encoding( $value, 'UTF-8' ) ) {
     71                                return new WP_Error(
     72                                        'field_value_out_of_scope',
     73                                        sprintf(
     74                                                // Translators: %s - field name.
     75                                                __( 'Value of the "%s" field could not be read as text.', 'password-requirements' ),
     76                                                $this->get_key_camel_case(),
     77                                        ),
     78                                );
     79                        }
     80
    7081                        return new WP_Error(
    7182                                'field_value_out_of_scope',
  • password-requirements/tags/3.9.0/loader.php

    r3669586 r3748178  
    5757                $plugin->set_supports_network( true );
    5858                $plugin->set_text_domain( 'password-requirements' );
    59                 $plugin->set_version( '3.8.0' );
     59                $plugin->set_version( '3.9.0' );
    6060
    6161                $plugin->register_modules(
    … …  
    7070                                Modules\Logout_Cleanup\Module_Logout_Cleanup::class,
    7171                                Modules\Password_Hint\Module_Password_Hint::class,
     72                                Modules\Personal_Data\Module_Personal_Data::class,
    7273                                Modules\Plugin_Upgrade_Action_Link\Module_Plugin_Upgrade_Action_Link::class,
    7374                                Modules\Require_Current_Password\Module_Require_Current_Password::class,
  • password-requirements/tags/3.9.0/package.json

    r3669586 r3748178  
    11{
    22  "private": true,
     3  "type": "module",
    34  "scripts": {
    45    "build": "npm run build:scripts",
    56    "build:scripts": "concurrently \"npm:build:scripts:*\"",
    67    "build:scripts:password-hint-positioning": "wp-scripts build --webpack-src-dir=src/modules/password-hint/internal/positioning --output-path=build/password-hint-positioning",
     8    "build:scripts:require-current-password": "wp-scripts build --webpack-src-dir=src/modules/require-current-password --output-path=build/require-current-password",
    79    "build:scripts:settings-page": "wp-scripts build --webpack-src-dir=src/modules/settings-page --output-path=build/settings-page"
    810  },
    … …  
    1214  },
    1315  "devDependencies": {
    14     "@wordpress/scripts": "^34.0.0",
     16    "@wordpress/scripts": "^36.0.0",
    1517    "concurrently": "^9.2.4",
    1618    "prop-types": "^15.8.1"
  • password-requirements/tags/3.9.0/password-requirements.php

    r3669586 r3748178  
    44 * Plugin URI: https://teydeastudio.com/plugins/login-security/?utm_source=Teydea+Login+Security
    55 * Description: Define advanced password policies, enforce strong password requirements, and improve your WordPress site's security.
    6  * Version: 3.8.0
     6 * Version: 3.9.0
    77 * Text Domain: password-requirements
    88 * Requires PHP: 7.4
  • password-requirements/tags/3.9.0/readme.txt

    r3669586 r3748178  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 3.8.0
     7Stable tag: 3.9.0
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
    … …  
    4747* **Require current password** -- Add a "Current Password" field to the user profile screen and validate it before allowing password changes.
    4848* **Custom password hints** -- Replace the default WordPress password hint with a policy-specific hint based on active rules.
     49* **Policy-compliant generated passwords** -- When WordPress generates a password on an account's behalf, such as on the Add New User screen or during multisite signup, the plugin replaces it with one that meets the active policy. If no compliant password can be generated, the original password stands and the usual compliance check at first login still applies.
    4950* **Site Health integration** -- A Site Health test reports whether your plugin settings are properly configured.
    5051* **Multisite/network support** -- Works with both standard and multisite WordPress installations.
    … …  
    116117= Where can I find the unminified source code? =
    117118
    118 All source ships with the plugin: the plugin's own JavaScript is in `src/`, and the bundled `@teydeastudio/components` and `@teydeastudio/utils` libraries are in `deps/js/components/src/` and `deps/js/utils/src/`. To rebuild, install Node.js 20 and run `npm install && npm run build` in the plugin directory.
     119All source ships with the plugin: the plugin's own JavaScript is in `src/`, and the bundled `@teydeastudio/components` and `@teydeastudio/utils` libraries are in `deps/js/components/src/` and `deps/js/utils/src/`. To rebuild, install Node.js 24 and run `npm install && npm run build` in the plugin directory.
    119120
    120121== Screenshots ==
    … …  
    138139
    139140== Changelog ==
     141
     142= 3.9.0 (2026-10-15) =
     143* Improved compatibility of the sign-in password check with plugins that change login cookies
     144* On multisite, the "Current Password" field on the user-admin profile screen is now checked
     145* Personal data exports now include the date the user last changed their password
     146* Confirming the current password no longer counts as a failed login when it is mistyped, and no longer resets the password age when it is correct
     147* The "Current Password" field keeps its label visible, is recognized by password managers, and has its help text announced by screen readers
     148* The "Current Password" field is now positioned by an enqueued script, so it also works on sites whose Content-Security-Policy blocks inline scripts
     149* Dependencies updated
     150* Code improvements
    140151
    141152= 3.8.0 (2026-08-28) =
    … …  
    205216* Code improvements
    206217
    207 = 3.4.1 (2026-01-12) =
    208 * Harden handling of the "allow_password_reset" filter to improve compatibility with third-party plugins
    209 
    210218(For older records, see the `changelog.txt` file).
  • password-requirements/tags/3.9.0/src/class-compliance.php

    r3669586 r3748178  
    475475        /**
    476476         * Check whether the most recent compliance check made through this object
    477          * failed because the breach service was unreachable on a fail-closed site
     477         * failed over something other than the password itself
    478478         *
    479479         * Reports on a check this object ran, so callers that hand a password to
    … …  
    483483         * @phpstan-impure
    484484         *
    485          * @return bool True only when the last failure was caused by an unreachable breach service.
    486          */
    487         public function last_failure_was_breach_unreachable(): bool {
    488                 $password_policy = $this->get_password_policy();
    489                 return null !== $password_policy && $password_policy->last_failure_was_breach_unreachable();
     485         * @return bool True only when the last failure was decided by something other than the candidate.
     486         */
     487        public function last_failure_came_from_external_state(): bool {
     488                $password_policy = $this->get_password_policy();
     489                return null !== $password_policy && $password_policy->last_failure_came_from_external_state();
    490490        }
    491491
    … …  
    503503                        $user_login = $data['user_login'] ?? ( $data['username'] ?? ( $data['login'] ?? '' ) );
    504504
    505                         if ( ! empty( $user_login ) ) {
    506                                 if ( is_email( $user_login ) ) {
     505                        if ( is_string( $user_login ) && '' !== $user_login && '0' !== $user_login ) {
     506                                if ( false !== is_email( $user_login ) ) {
    507507                                        $wp_user = get_user_by( 'email', $user_login );
    508508                                } else {
  • password-requirements/tags/3.9.0/src/class-message-key.php

    r3669586 r3748178  
    6969                $nonce_action = $nonce->get_action();
    7070
    71                 if ( ! empty( $nonce_value ) && false !== wp_verify_nonce( $nonce_value, $nonce_action ) ) {
     71                if ( '' !== $nonce_value && false !== wp_verify_nonce( $nonce_value, $nonce_action ) ) {
    7272                        return isset( $_GET[ $nonce_action ] ) ? sanitize_text_field( Utils\Type::ensure_string( wp_unslash( $_GET[ $nonce_action ] ) ) ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    7373                }
  • password-requirements/tags/3.9.0/src/class-password-policy.php

    r3669586 r3748178  
    300300
    301301        /**
     302         * Check whether this request is the user finishing a password replacement
     303         * they cannot back out of
     304         *
     305         * A rule that refuses a candidate over something other than the candidate
     306         * needs this answer before it refuses. A user completing a reset is on a
     307         * form every request sends them back to, so a rule that turns down every
     308         * password submitted to it leaves them with nothing left to try.
     309         *
     310         * Narrower than {@see self::is_password_change_compelled()}, which the
     311         * minimum-age rule uses, and narrower on purpose:
     312         *
     313         * - The maximum-age rule is left out. It answers "true" for any account
     314         *   with no recorded password-change date, which is every account on a site
     315         *   that has just switched the rule on, and every account that does not
     316         *   exist yet.
     317         * - An administrator setting somebody else's password is left out. They
     318         *   opened that form themselves and can leave it again, and the settings
     319         *   that would let the password through are theirs to change.
     320         * - An account that does not exist yet is left out. Nobody is being held on
     321         *   a registration form, and refusing there strands no one.
     322         *
     323         * What is left is a reset key this request has proven against the account,
     324         * and a caller declaring the change compelled through
     325         * {@see Compliance::declare_change_compelled()}, which is how an integration
     326         * whose reset form runs without the core reset cookie says the same thing.
     327         * The filter is asked with "false" rather than with the reasons
     328         * is_password_change_compelled() seeds it with, so those reasons cannot
     329         * reach this answer through it.
     330         *
     331         * @return bool Whether the user is finishing a replacement they cannot back out of ("true") or not ("false").
     332         */
     333        protected function is_password_change_unavoidable(): bool {
     334                $user_id = $this->user->get_user_id();
     335
     336                // An account that does not exist yet carries the ID "0".
     337                if ( null === $user_id || 0 === $user_id ) {
     338                        return false;
     339                }
     340
     341                if ( true === $this->has_authorized_reset_in_flight() ) {
     342                        return true;
     343                }
     344
     345                // This filter is documented in is_password_change_compelled() above.
     346                return true === apply_filters( 'password_requirements__is_password_change_compelled', false, $this->user->get_user() );
     347        }
     348
     349        /**
    302350         * Check if user should change their password
    303351         *
    … …  
    334382         * @return bool Whether the password is compliant with the password policy or not.
    335383         */
    336         public function is_password_compliant( string $password, bool $is_new = false ): bool {
     384        final public function is_password_compliant( string $password, bool $is_new = false ): bool {
    337385                $this->last_failure_reason = null;
    338386
    … …  
    341389                 *
    342390                 * Applies:
    343                  * - always, ahead of every rule that walks the candidate, and ahead of
    344                  *   the no-policy bypass: a user no policy covers still reaches the
    345                  *   hashing this ceiling exists to bound
     391                 * - always, ahead of the no-policy bypass and of every rule of the policy
     392                 *
     393                 * WordPress core refuses to hash a password over this size and stores the
     394                 * unusable hash "*" in its place, so a user no policy covers who had such
     395                 * a password accepted could not sign in until it was reset. For a user a
     396                 * policy covers, the ceiling also bounds the cost of the rules, which walk
     397                 * the whole candidate. It runs here, outside
     398                 * check_password_against_policy_rules(), so that a subclass adding rules
     399                 * there cannot leave it out.
    346400                 */
    347401                if ( false === $this->check_has_not_exceeded_maximum_size( $password ) ) {
    … …  
    356410                }
    357411
     412                return $this->check_password_against_policy_rules( $password, $is_new, $this->policy );
     413        }
     414
     415        /**
     416         * Check if provided password passes every rule of the password policy
     417         * that applies to this user
     418         *
     419         * A subclass that adds rules overrides this method. is_password_compliant()
     420         * is final, and runs the size ceiling and the no-policy bypass before
     421         * calling it.
     422         *
     423         * @param string                          $password User's password.
     424         * @param bool                            $is_new   Whether the given password is new ("true") or not ("false").
     425         * @param Validatable_Fields\Fields_Group $policy   Settings of the password policy which applies to the given user.
     426         *
     427         * @return bool Whether the password passes every rule of the password policy or not.
     428         */
     429        protected function check_password_against_policy_rules( string $password, bool $is_new, Validatable_Fields\Fields_Group $policy ): bool {
    358430                /**
    359431                 * Check password minimum length
    … …  
    386458                 * - when enabled
    387459                 */
    388                 if ( true === $this->policy->get_field_value( 'rules.complexity' ) ) {
     460                if ( true === $policy->get_field_value( 'rules.complexity' ) ) {
    389461                        /**
    390462                         * Check if password contains at least one digit
    391463                         */
    392                         if ( true === $this->policy->get_field_value( 'rule_settings.complexity.digit' ) && false === $this->check_has_digit( $password ) ) {
     464                        if ( true === $policy->get_field_value( 'rule_settings.complexity.digit' ) && false === $this->check_has_digit( $password ) ) {
    393465                                return false;
    394466                        }
    … …  
    397469                         * Check if password contains at least one lowercase character
    398470                         */
    399                         if ( true === $this->policy->get_field_value( 'rule_settings.complexity.lowercase' ) && false === $this->check_has_lowercase_character( $password ) ) {
     471                        if ( true === $policy->get_field_value( 'rule_settings.complexity.lowercase' ) && false === $this->check_has_lowercase_character( $password ) ) {
    400472                                return false;
    401473                        }
    … …  
    404476                         * Check if password contains at least one uppercase character
    405477                         */
    406                         if ( true === $this->policy->get_field_value( 'rule_settings.complexity.uppercase' ) && false === $this->check_has_uppercase_character( $password ) ) {
     478                        if ( true === $policy->get_field_value( 'rule_settings.complexity.uppercase' ) && false === $this->check_has_uppercase_character( $password ) ) {
    407479                                return false;
    408480                        }
    … …  
    427499                         * Check if password contains no more than allowed maximum number of consecutive user symbols
    428500                         */
    429                         if ( true === $this->policy->get_field_value( 'rule_settings.complexity.consecutive_user_symbols' ) ) {
     501                        if ( true === $policy->get_field_value( 'rule_settings.complexity.consecutive_user_symbols' ) ) {
    430502                                /** @var int $max_consecutive_user_symbols */
    431                                 $max_consecutive_user_symbols = $this->policy->get_field_value( 'rule_settings.maximum_consecutive_user_symbols' );
     503                                $max_consecutive_user_symbols = $policy->get_field_value( 'rule_settings.maximum_consecutive_user_symbols' );
    432504
    433505                                if ( false === $this->check_has_not_exceeded_maximum_consecutive_user_symbols( $password, $max_consecutive_user_symbols ) ) {
    … …  
    441513                        $restricted_characters = $this->get_restricted_characters();
    442514
    443                         if ( ! empty( $restricted_characters ) && false === $this->check_has_no_restricted_characters( $password, $restricted_characters ) ) {
     515                        if ( [] !== $restricted_characters && false === $this->check_has_no_restricted_characters( $password, $restricted_characters ) ) {
    444516                                return false;
    445517                        }
    … …  
    452524                 * - when enabled, and user is logging in
    453525                 */
    454                 if ( true === $this->policy->get_field_value( 'rules.maximum_age' ) && false === $is_new ) {
     526                if ( true === $policy->get_field_value( 'rules.maximum_age' ) && false === $is_new ) {
    455527                        /** @var int $max_age */
    456                         $max_age         = $this->policy->get_field_value( 'rule_settings.maximum_age' );
     528                        $max_age         = $policy->get_field_value( 'rule_settings.maximum_age' );
    457529                        $last_changed_at = $this->passwords_store->get_password_changed_at();
    458530
    … …  
    490562                 * - when enabled, and the active list has at least one entry
    491563                 */
    492                 if ( true === $this->policy->get_field_value( 'rules.restricted_phrases' ) ) {
     564                if ( true === $policy->get_field_value( 'rules.restricted_phrases' ) ) {
    493565                        $words = $this->get_active_restricted_phrases();
    494566
    495                         if ( ! empty( $words ) && false === $this->check_has_no_restricted_phrases( $password, $words ) ) {
     567                        if ( [] !== $words && false === $this->check_has_no_restricted_phrases( $password, $words ) ) {
    496568                                $this->last_failure_reason = self::FAILURE__RESTRICTED_PHRASES;
    497569                                return false;
    … …  
    888960
    889961                        // Merge complexity hints into one hint.
    890                         if ( ! empty( $complexity_hints ) ) {
     962                        if ( [] !== $complexity_hints ) {
    891963                                // Translators: %s - password complexity hints.
    892964                                $hints[] = sprintf( __( 'must contain %s', 'password-requirements' ), implode( ', ', $complexity_hints ) );
    … …  
    920992                                        $user_symbol_characters = $this->get_user_symbol_characters();
    921993
    922                                         $hints[] = empty( $user_symbol_characters )
     994                                        $hints[] = [] === $user_symbol_characters
    923995                                                ? __( 'cannot contain any symbol of your user name or display name', 'password-requirements' )
    924996                                                : sprintf(
    … …  
    9451017                 * Restricted words/phrases list
    9461018                 */
    947                 if ( true === $this->policy->get_field_value( 'rules.restricted_phrases' ) && ! empty( $this->get_active_restricted_phrases() ) ) {
     1019                if ( true === $this->policy->get_field_value( 'rules.restricted_phrases' ) && [] !== $this->get_active_restricted_phrases() ) {
    9481020                        $hints[] = __( 'cannot contain words restricted by your site administrator', 'password-requirements' );
    9491021                }
    9501022
    9511023                // Return password hint.
    952                 return empty( $hints ) ? null : sprintf(
     1024                return [] === $hints ? null : sprintf(
    9531025                        // Translators: %s - semicolon-separated list of password requirements.
    9541026                        __( 'Hint: password %s.', 'password-requirements' ),
    … …  
    11021174
    11031175        /**
    1104          * Whether the most recent is_password_compliant() call failed because
    1105          * the breach service was unreachable and the policy rejects unverifiable
    1106          * passwords (fail-closed)
    1107          *
    1108          * Such a failure is caused by external state, not by the password's
    1109          * contents, so retrying with a different candidate cannot change the
    1110          * outcome.
    1111          *
    1112          * @return bool True only when the last failure was caused by an unreachable breach service.
    1113          */
    1114         public function last_failure_was_breach_unreachable(): bool {
     1176         * Whether the most recent is_password_compliant() call failed over
     1177         * something other than the password itself
     1178         *
     1179         * A rule that screens the candidate against something it has to consult
     1180         * first - a breach service, or a list shipped in a file - can refuse the
     1181         * candidate because that consultation failed rather than because of
     1182         * anything in the candidate. Trying a different one cannot change such an
     1183         * outcome, which is what a caller drawing candidates needs to know.
     1184         *
     1185         * None of this plugin's rules consults anything of the kind, so the answer
     1186         * here is always "false". The PRO plugin overrides it for the rules that do.
     1187         *
     1188         * @return bool True only when the last failure was decided by something other than the candidate.
     1189         */
     1190        public function last_failure_came_from_external_state(): bool {
    11151191                return false;
    11161192        }
  • password-requirements/tags/3.9.0/src/modules/abilities/class-module-abilities.php

    r3669586 r3748178  
    2323 */
    2424class Module_Abilities extends Utils\Module {
     25        /**
     26         * Simplify access to the Settings class instance
     27         */
     28        use Utils\With_Settings;
     29
    2530        /**
    2631         * Policy template fields group, resolved once per request
  • password-requirements/tags/3.9.0/src/modules/compliance-on-generation/class-module-compliance-on-generation.php

    r3669586 r3748178  
    3636 * is ever rewritten, and no request pays more than one policy evaluation.
    3737 *
    38  * When no compliant replacement can be produced (an unsatisfiable policy, an
    39  * unreachable breach service on a fail-closed site), the password core
    40  * produced is returned unchanged and the login-time compliance check remains
    41  * the backstop, exactly as without this module.
     38 * When no compliant replacement can be produced (an unsatisfiable policy, or a
     39 * rule that cannot consult what it screens against on a fail-closed site), the
     40 * password core produced is returned unchanged and the login-time compliance
     41 * check remains the backstop, exactly as without this module.
    4242 */
    4343final class Module_Compliance_On_Generation extends Utils\Module {
  • password-requirements/tags/3.9.0/src/modules/compliance-on-generation/internal/class-password-generator.php

    r3669586 r3748178  
    5757         * Bound on candidate-generation attempts
    5858         *
    59          * Exists so that an unsatisfiable policy, or an unreachable breach service
    60          * on a fail-closed site, cannot make account creation spin.
     59         * Exists so that an unsatisfiable policy, or a rule that cannot consult
     60         * what it screens against on a fail-closed site, cannot make account
     61         * creation spin.
    6162         *
    6263         * @var int
    … …  
    133134         * Draw a policy-compliant replacement on the site the account will land on
    134135         *
    135          * Candidate drawing stops the moment a rejection is caused by an
    136          * unreachable breach service on a fail-closed site rather than by the
    137          * candidate's contents: every further candidate would fail for the same
    138          * external reason, each one paying for a blocking network attempt inside a
    139          * user-facing account-creation request.
     136         * Candidate drawing stops the moment a rejection is decided by something
     137         * other than the candidate's contents — a breach service a fail-closed site
     138         * cannot reach, a weak-password list it cannot read. Every further candidate
     139         * would fail for the same reason, each one paying again for the lookup that
     140         * already failed, inside a user-facing account-creation request.
    140141         *
    141142         * @param string  $password         The password WordPress generated.
    … …  
    153154                }
    154155
    155                 if ( true === $compliance->last_failure_was_breach_unreachable() ) {
     156                if ( true === $compliance->last_failure_came_from_external_state() ) {
    156157                        return $password;
    157158                }
    … …  
    191192                        }
    192193
    193                         if ( true === $compliance->last_failure_was_breach_unreachable() ) {
     194                        if ( true === $compliance->last_failure_came_from_external_state() ) {
    194195                                return $password;
    195196                        }
  • password-requirements/tags/3.9.0/src/modules/compliance-on-login/class-module-compliance-on-login.php

    r3669586 r3748178  
    3131 * it until they happen to change it.
    3232 *
    33  * Scope follows from the nonce rendered on `login_form`: flows that never post
    34  * that form — application passwords, XML-RPC, SSO — supply no plaintext here
    35  * and are not checked.
     33 * Scope follows from the "login_redirect" filter, which core applies only after
     34 * a sign-in through "wp-login.php". Flows that never reach it — application
     35 * passwords, XML-RPC, SSO — supply no plaintext here and are not checked. No
     36 * field of the submitted form decides whether the check runs, because the
     37 * person signing in controls every one of them.
    3638 *
    3739 * The verdict is never cached or memoized per user: every covered sign-in
    … …  
    5153         */
    5254        public function register(): void {
    53                 // Render custom nonce field on login form.
    54                 add_action( 'login_form', [ $this, 'render_nonce_field' ] );
    55 
    5655                // Check if current password is compliant with the password policy when user is logging in.
    5756                add_filter( 'login_redirect', [ $this, 'on_login' ], 99, 3 );
    … …  
    5958                // Filter the login message.
    6059                add_filter( 'login_message', [ $this, 'filter_login_message' ] );
    61         }
    62 
    63         /**
    64          * Render custom nonce field on login form
    65          *
    66          * @return void
    67          */
    68         public function render_nonce_field(): void {
    69                 $nonce = new Utils\Nonce( $this->container, 'login' );
    70                 $nonce->render_field();
    7160        }
    7261
    … …  
    8170         */
    8271        public function on_login( string $redirect_to, string $requested_redirect_to, $user ): string {
    83                 // Predefine the variable's value.
    84                 $password = null;
    85 
    86                 // Get the nonce data.
    87                 $nonce        = new Utils\Nonce( $this->container, 'login' );
    88                 $nonce_value  = isset( $_POST[ $nonce->get_key() ] ) ? sanitize_text_field( Utils\Type::ensure_string( wp_unslash( $_POST[ $nonce->get_key() ] ) ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    89                 $nonce_action = $nonce->get_action();
    90 
    91                 /**
    92                  * Note we can not use the "sanitize_text_field" in this case as this would falsify
    93                  * the compliance checks due to stripped/changed characters.
    94                  *
    95                  * For example:
    96                  * - "pas&"<>word" passed through the "sanitize_text_field" function would become "pas&"word" (note missing angular brackets)
    97                  */
    98                 if ( ! empty( $nonce_value ) && false !== wp_verify_nonce( $nonce_value, $nonce_action ) && isset( $_POST['pwd'] ) ) {
    99                         $password = ( is_string( $_POST['pwd'] ) && '' === $_POST['pwd'] ) ? null : Utils\Type::ensure_string( wp_unslash( $_POST['pwd'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- reason described above.
    100                 }
     72                $password = $this->get_submitted_password();
    10173
    10274                /**
    … …  
    172144                return $message;
    173145        }
     146
     147        /**
     148         * Get the password submitted to the login form, as core authenticated it
     149         *
     150         * Core's "wp_authenticate()" trims the slashed password before checking it,
     151         * so whitespace padding never counts toward the policy here either. The value
     152         * is trimmed before it is unslashed, in the same order as core, and PHP's
     153         * "trim()" is used because "Utils\Strings::trim()" also changes internal
     154         * whitespace and HTML entities.
     155         *
     156         * Note we can not use the "sanitize_text_field" in this case as this would falsify
     157         * the compliance checks due to stripped/changed characters.
     158         *
     159         * For example:
     160         * - "pas&"<>word" passed through the "sanitize_text_field" function would become "pas&"word" (note missing angular brackets)
     161         *
     162         * @return ?string Submitted password, or "null" when the request carries none.
     163         */
     164        private function get_submitted_password(): ?string {
     165                $password = isset( $_POST['pwd'] ) ? Utils\Type::ensure_string( wp_unslash( trim( Utils\Type::ensure_string( $_POST['pwd'] ) ) ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput -- core authenticates the sign-in itself, and sanitizing would change the password, as described above.
     166                return '' === $password ? null : $password;
     167        }
    174168}
  • password-requirements/tags/3.9.0/src/modules/compliance-on-password-change/class-module-compliance-on-password-change.php

    r3669586 r3748178  
    7272                $form_field = null;
    7373
    74                 if ( isset( $_POST['pass1'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
    75                         $password   = Utils\Type::ensure_string( wp_unslash( $_POST['pass1'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
     74                if ( isset( $_POST['pass1'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- The reset key authenticates the request before this hook runs.
     75                        $password   = Utils\Type::ensure_string( wp_unslash( $_POST['pass1'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- The reset key authenticates the request; sanitizing the password would change the value checked for compliance.
    7676                        $form_field = 'pass1';
    77                 } elseif ( isset( $_POST['password_1'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
    78                         $password   = Utils\Type::ensure_string( wp_unslash( $_POST['password_1'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
     77                } elseif ( isset( $_POST['password_1'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- The reset key authenticates the request before this hook runs.
     78                        $password   = Utils\Type::ensure_string( wp_unslash( $_POST['password_1'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- The reset key authenticates the request; sanitizing the password would change the value checked for compliance.
    7979                        $form_field = 'password_1';
    8080                }
    … …  
    269269                $display_name = Utils\Type::ensure_string( $user_data->display_name ?? '' );
    270270
    271                 if ( ! empty( $display_name ) ) {
     271                if ( '' !== $display_name && '0' !== $display_name ) {
    272272                        return $display_name;
    273273                }
    … …  
    276276                $last_name  = Utils\Type::ensure_string( $user_data->last_name ?? '' );
    277277
    278                 if ( ! empty( $first_name ) && ! empty( $last_name ) ) {
     278                if ( '' !== $first_name && '0' !== $first_name && '' !== $last_name && '0' !== $last_name ) {
    279279                        /**
    280280                         * Deliberately core's own string, in core's own text domain rather than
    … …  
    292292                }
    293293
    294                 if ( ! empty( $first_name ) ) {
     294                if ( '' !== $first_name && '0' !== $first_name ) {
    295295                        return $first_name;
    296296                }
    297297
    298                 if ( ! empty( $last_name ) ) {
     298                if ( '' !== $last_name && '0' !== $last_name ) {
    299299                        return $last_name;
    300300                }
  • password-requirements/tags/3.9.0/src/modules/password-hint/class-module-password-hint.php

    r3669586 r3748178  
    102102                        $custom_hint = $compliance->get_hint();
    103103
    104                         if ( ! empty( $custom_hint ) ) {
     104                        if ( '' !== $custom_hint ) {
    105105                                $hint = $custom_hint;
    106106                        }
  • password-requirements/tags/3.9.0/src/modules/require-current-password/class-module-require-current-password.php

    r3669586 r3748178  
    2727final class Module_Require_Current_Password extends Utils\Module {
    2828        /**
     29         * Asset slug of the script and stylesheet that place the field
     30         *
     31         * @var string
     32         */
     33        const ASSET_SLUG = 'require-current-password';
     34
     35        /**
    2936         * Register hooks
    3037         *
    … …  
    5259         */
    5360        public function add_current_password_field( WP_User $user ): void {
     61                if ( ! $this->is_own_profile_page() ) {
     62                        return;
     63                }
     64
    5465                $compliance = new Compliance( $this->container, $user );
    5566
    … …  
    5869                }
    5970
     71                $asset = new Utils\Asset( $this->container, self::ASSET_SLUG );
     72
     73                /**
     74                 * The script needs no data from PHP, so nothing has to be emitted as the
     75                 * inline block that a strict Content-Security-Policy would drop. It has no
     76                 * translatable strings either.
     77                 */
     78                $asset->enqueue_script( false );
     79                $asset->enqueue_style();
     80
     81                // The enqueued script looks both ids below up; renaming either one stops it finding the elements.
    6082                ?>
    61                 <script>
    62                         document.addEventListener( 'DOMContentLoaded', function() {
    63                                 // Reposition input inside "Set New Password" section.
    64                                 const el = document.getElementById( 'current-password-confirm' );
    65                                 const parent = document.getElementsByClassName( 'wp-pwd' )[ 0 ];
    66 
    67                                 parent.insertBefore( el, parent.firstChild );
    68                                 el.style.marginBottom = '1em';
    69 
    70                                 // Hide no JS fallback UI
    71                                 const nojsParent = document.getElementById( 'nojs-current-pass' );
    72                                 nojsParent.style.display = 'none';
    73                         } );
    74                 </script>
    7583                <table id="nojs-current-pass" class="form-table" role="presentation">
    7684                        <tr>
    77                                 <th><label for="current_pass"><?php echo esc_html( __( 'Current Password', 'password-requirements' ) ); ?></label></th>
    7885                                <td>
    79                                         <div id="current-password-confirm">
    80                                                 <input type="password" name="current_pass" id="current_pass" placeholder="<?php esc_attr_e( 'Current Password', 'password-requirements' ); ?>" class="regular-text" value="" autocomplete="off" />
    81                                                 <p class="description"><?php echo esc_html( __( 'Please type your current password to update it.', 'password-requirements' ) ); ?></p>
     86                                        <div id="current-password-confirm" class="password-requirements-require-current-password__field">
     87                                                <label for="current_pass"><?php echo esc_html( __( 'Current Password', 'password-requirements' ) ); ?></label>
     88                                                <input type="password" name="current_pass" id="current_pass" class="regular-text" value="" autocomplete="current-password" aria-describedby="current-pass-description" />
     89                                                <p id="current-pass-description" class="description"><?php echo esc_html( __( 'Your current password is required when changing your password.', 'password-requirements' ) ); ?></p>
    8290                                        </div>
    8391                                </td>
    … …  
    101109                }
    102110
    103                 $screen = new Utils\Screen( $this->container );
    104 
    105                 if ( ! $screen->is( 'profile' ) ) {
     111                if ( ! $this->is_own_profile_page() ) {
    106112                        return;
    107113                }
    … …  
    115121                check_admin_referer( sprintf( 'update-user_%d', $user->ID ) );
    116122
    117                 if ( empty( $_POST['pass1'] ) ) {
     123                /**
     124                 * Core's edit_user() only treats a non-empty "pass1" as a password change,
     125                 * so a submitted "0" is not a change there and must not be one here either.
     126                 */
     127                if ( ! isset( $_POST['pass1'] ) || '' === $_POST['pass1'] || '0' === $_POST['pass1'] ) {
    118128                        return;
    119129                }
    … …  
    125135                }
    126136
    127                 if ( empty( $_POST['current_pass'] ) ) {
     137                /**
     138                 * Unlike "pass1", core never reads this field, so only a blank submission
     139                 * counts as missing: a current password of "0" is a value the user typed
     140                 * and is checked below like any other.
     141                 */
     142                if ( ! isset( $_POST['current_pass'] ) || '' === $_POST['current_pass'] ) {
    128143                        $errors->add(
    129144                                'empty_current_password',
    … …  
    153168                 *
    154169                 * "Utils\Type::ensure_string()" is a type coercion, not a transformation: a string
    155                  * is returned byte-for-byte, so neither omission above is undone. It only maps a
    156                  * non-string submission (e.g. "current_pass[]=x") to "", which fails authentication.
    157                  */
    158                 $auth = wp_authenticate( $user->user_login, Utils\Type::ensure_string( $_POST['current_pass'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- reason described above.
    159 
    160                 if ( is_wp_error( $auth ) ) {
     170                 * is returned byte-for-byte, so neither omission above is undone. An array
     171                 * submission (e.g. "current_pass[]=x") becomes "", which is rejected.
     172                 * Use PHP's "trim()" to match core's login trimming. "Utils\Strings::trim()"
     173                 * also changes internal whitespace and HTML entities, which alters passwords.
     174                 */
     175                $password = trim( Utils\Type::ensure_string( $_POST['current_pass'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- reason described above.
     176
     177                /**
     178                 * Omit the optional user ID: on WordPress 6.6 and 6.7 a matching legacy MD5
     179                 * hash otherwise triggers "wp_set_password()" during the comparison.
     180                 * Reject an empty trimmed value, even if an account has a hash of the
     181                 * empty string.
     182                 */
     183                if ( '' === $password || ! wp_check_password( $password, $user->user_pass ) ) {
    161184                        $errors->add(
    162185                                'wrong_current_password',
    … …  
    166189                }
    167190        }
     191
     192        /**
     193         * Check whether the request is for the screen where users edit their own profile
     194         *
     195         * Core fires "show_user_profile" only when "IS_PROFILE_PAGE" is true, and the
     196         * screen id that goes with it differs between admin areas ("profile",
     197         * "profile-network", "profile-user", or "user-edit" for one's own user ID).
     198         * The field is rendered and the submission is validated on this one condition,
     199         * so there is no screen where the field is shown and its value goes unchecked.
     200         *
     201         * @return bool Whether the request is for the screen where users edit their own profile.
     202         */
     203        private function is_own_profile_page(): bool {
     204                return defined( 'IS_PROFILE_PAGE' ) && true === IS_PROFILE_PAGE;
     205        }
    168206}
  • password-requirements/tags/3.9.0/src/modules/settings-page/components/component-password-policy-settings.js

    r3669586 r3748178  
    182182                if ( 0 === count ) {
    183183                        speak( __( "No character of the user's name or display name may appear in the password.", 'password-requirements' ), 'polite' );
    184 
    185184                        return;
    186185                }
  • password-requirements/tags/3.9.0/src/modules/site-health/class-module-site-health.php

    r3669586 r3748178  
    2323 */
    2424class Module_Site_Health extends Utils\Module {
     25        /**
     26         * Simplify access to the Settings class instance
     27         */
     28        use Utils\With_Settings;
     29
    2530        /**
    2631         * Register hooks
  • password-requirements/trunk/build/password-hint-positioning/index.asset.php

    r3669586 r3748178  
    1 <?php return array('dependencies' => array(), 'version' => '24655f9c6f679144a629');
     1<?php return array(
     2        'dependencies' => array(
     3               
     4        ),
     5        'version' => '24655f9c6f679144a629'
     6);
  • password-requirements/trunk/build/settings-page/index.asset.php

    r3669586 r3748178  
    1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'eaaef3828250d7cd6c1f');
     1<?php return array(
     2        'dependencies' => array(
     3                'react-jsx-runtime',
     4                'wp-a11y',
     5                'wp-api-fetch',
     6                'wp-components',
     7                'wp-compose',
     8                'wp-element',
     9                'wp-hooks',
     10                'wp-i18n',
     11                'wp-primitives',
     12                'wp-url'
     13        ),
     14        'version' => 'dc161bd61009694eeba6'
     15);
  • password-requirements/trunk/build/settings-page/index.js

    r3669586 r3748178  
    1 (()=>{var e={694(e,s,t){"use strict";var r=t(925);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,s,t,a,i,n){if(n!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function s(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:s,element:e,elementType:e,instanceOf:s,node:e,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:i,resetWarningCache:a};return t.PropTypes=t,t}},556(e,s,t){e.exports=t(694)()},925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const s={};function t(r){const a=s[r];if(void 0!==a)return a.exports;const i=s[r]={exports:{}};return e[r](i,i.exports,t),i.exports}t.n=e=>{const s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},t.d=(e,s)=>{if(Array.isArray(s))for(var r=0;r<s.length;){var a=s[r++],i=s[r++];t.o(e,a)?0===i&&r++:0===i?Object.defineProperty(e,a,{enumerable:!0,value:s[r++]}):Object.defineProperty(e,a,{enumerable:!0,get:i})}else for(var a in s)t.o(s,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:s[a]})},t.o=(e,s)=>Object.hasOwn(e,s),(()=>{"use strict";const e=window.wp.element;var s=t(556),r=t.n(s);const a=window.wp.i18n,i=window.wp.primitives,n=window.ReactJSXRuntime,l=({slug:e})=>{const s=`ts-product-icon-${e}`;switch(e){case"bm-custom-login":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#ffe8db",d:"M372.367 0h-232.73C62.517 0 0 62.518 0 139.637v232.73c0 77.119 62.518 139.637 139.637 139.637h232.73c77.119 0 139.637-62.518 139.637-139.637v-232.73C512.004 62.517 449.486 0 372.367 0"}),(0,n.jsx)(i.Path,{fill:"#ffd7c1",d:"M170.66 426.662a85.41 85.41 0 0 1-85.318-85.318V170.66a85.41 85.41 0 0 1 85.318-85.318h170.684a85.41 85.41 0 0 1 85.318 85.318v170.684a85.41 85.41 0 0 1-85.318 85.318z"}),(0,n.jsx)(i.Path,{fill:"#ff9e68",d:"M192.001 384.003a64.06 64.06 0 0 1-45.234-18.766 64.07 64.07 0 0 1-18.766-45.235V192.001a64.06 64.06 0 0 1 18.766-45.234 64.06 64.06 0 0 1 45.234-18.766h128.001a64.07 64.07 0 0 1 45.235 18.766 64.06 64.06 0 0 1 18.766 45.234v128.001a64.07 64.07 0 0 1-18.766 45.235 64.07 64.07 0 0 1-45.235 18.766z"}),(0,n.jsx)(i.Path,{fill:"#dd3814",d:"M257.306 327.543a10.65 10.65 0 0 1-3.125-7.54 10.67 10.67 0 0 1 3.125-7.541l48.896-48.919a10.68 10.68 0 0 0 0-15.081l-48.896-48.92a10.662 10.662 0 0 1 7.54-18.204c2.829 0 5.541 1.123 7.541 3.123l48.896 48.92a32.02 32.02 0 0 1 0 45.242l-48.896 48.92c-4.189 4.189-10.915 4.189-15.081 0"}),(0,n.jsx)(i.Path,{fill:"#dd3814",d:"M319.887 266.661H85.343a10.65 10.65 0 0 1-9.848-6.58 10.657 10.657 0 0 1 5.769-13.926 10.7 10.7 0 0 1 4.079-.812h234.544a10.65 10.65 0 0 1 7.537 3.122 10.67 10.67 0 0 1 3.122 7.537 10.67 10.67 0 0 1-3.122 7.537 10.67 10.67 0 0 1-7.537 3.122"}),(0,n.jsx)(i.Path,{fill:"#dd3814",d:"M341.344 437.345H170.661a96.12 96.12 0 0 1-96-96.001 10.67 10.67 0 1 1 21.34 0 74.753 74.753 0 0 0 74.66 74.659h170.683a74.755 74.755 0 0 0 74.66-74.659V170.66A74.755 74.755 0 0 0 341.344 96H170.661a74.753 74.753 0 0 0-74.66 74.66 10.672 10.672 0 0 1-18.216 7.546 10.67 10.67 0 0 1-3.125-7.546 96.117 96.117 0 0 1 96.001-96h170.683a96.116 96.116 0 0 1 96.001 96v170.684a96.12 96.12 0 0 1-96.001 96.001"})]})});case"careers":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 256 256",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsxs)(i.G,{clipPath:(0,a.sprintf)("url(#%s-a)",s),children:[(0,n.jsx)(i.Rect,{fill:"#fff",height:"256",rx:"10.24",width:"256"}),(0,n.jsx)(i.Path,{d:"M0 0h256v256H0z",fill:"#AD1735",fillOpacity:".05"}),(0,n.jsx)(i.Path,{d:"M130.289 201.349c-14.461 0-27.185-3.062-38.172-9.188-10.988-6.188-19.576-14.776-25.764-25.763-6.189-10.988-9.283-23.744-9.283-38.267 0-10.988 1.8-21.06 5.4-30.216 3.599-9.156 8.682-17.081 15.25-23.775 6.63-6.693 14.428-11.871 23.395-15.534 9.03-3.662 18.975-5.494 29.837-5.494 7.83 0 15.628 1.01 23.396 3.032 7.767 1.957 14.713 4.799 20.838 8.524h.758l8.146-9.567h5.683v45.845h-8.904c-1.263-3.347-2.589-6.44-3.978-9.282-1.326-2.842-2.779-5.431-4.357-7.768-4.357-6.756-9.535-11.713-15.534-14.87-5.999-3.221-12.914-4.831-20.744-4.831-14.461 0-25.385 5.21-32.773 15.629-7.325 10.356-10.988 25.826-10.988 46.412 0 20.712 3.663 36.531 10.988 47.455 7.388 10.861 18.06 16.292 32.015 16.292 7.704 0 14.65-1.674 20.839-5.02 6.251-3.347 11.461-8.083 15.628-14.208 2.211-3.095 4.105-6.599 5.684-10.514 1.641-3.978 2.873-8.272 3.694-12.882h8.43v52.001h-7.009l-7.578-12.313c-7.325 4.988-14.587 8.619-21.786 10.892-7.135 2.274-14.839 3.41-23.111 3.41Z",fill:"#AD1735"})]}),(0,n.jsx)("defs",{children:(0,n.jsx)("clipPath",{id:(0,a.sprintf)("%s-a",s),children:(0,n.jsx)(i.Rect,{fill:"#fff",height:"256",rx:"10.24",width:"256"})})})]})});case"hiring-center":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#ffe2f7",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,n.jsx)(i.Path,{fill:"#ffd8f4",d:"m373.482 366.755-34.048-5.539-3.258.07-7.633.558c-8.611-13.335-14.173-32.186-39.611-44.73l-15.755-7.773c5.934-5.958 36.212-18.525 36.212-53.341a53.38 53.38 0 0 0-15.637-37.704 53.38 53.38 0 0 0-37.704-15.637A53.385 53.385 0 0 0 202.707 256c0 34.932 30.045 47.127 36.212 53.341l-15.755 7.773c-29.114 14.336-36.399 41.658-38.168 44.521l-9.728-.745c-5.678.768-41.588 6.33-39.796 6.051a21.48 21.48 0 0 1-18.595-10.636l-17.291-29.952a21.39 21.39 0 0 1 1.978-24.157l21.667-26.601a21.4 21.4 0 0 0 4.817-13.475v-12.241a21.5 21.5 0 0 0-4.817-13.498L101.54 209.78a21.39 21.39 0 0 1-1.931-24.157l17.268-29.929a21.51 21.51 0 0 1 18.618-10.659l37.144 5.749a20.95 20.95 0 0 0 14.056-2.56l10.659-6.144a21.57 21.57 0 0 0 9.286-10.892l12.148-32.093a21.49 21.49 0 0 1 19.968-13.754h34.584c8.797 0 16.803 5.516 19.944 13.73l12.195 32.164a21.42 21.42 0 0 0 9.263 10.845l10.612 6.12a20.95 20.95 0 0 0 14.01 2.584l37.26-5.772c7.657 0 14.755 4.096 18.572 10.659l17.291 29.975a21.39 21.39 0 0 1-1.978 24.157l-21.643 26.601a21.34 21.34 0 0 0-4.818 13.475v12.241c0 4.888 1.699 9.705 4.794 13.499l21.714 26.6c5.585 6.796 6.353 16.524 1.931 24.157l-17.291 29.929a21.48 21.48 0 0 1-18.549 10.682z"}),(0,n.jsx)(i.Path,{fill:"#ffd0f2",d:"M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,n.jsx)(i.Path,{fill:"#ffb8dd",d:"M238.774 426.658a21.435 21.435 0 0 1-19.968-13.731l-12.195-32.163a21.5 21.5 0 0 0-9.262-10.845l-12.94-7.494c1.699-2.117 16.384-53.085 71.634-53.085 55.296 0 69.934 50.968 71.633 53.109l-12.94 7.447a21.55 21.55 0 0 0-9.262 10.938l-12.195 32.093a21.432 21.432 0 0 1-19.945 13.731z"}),(0,n.jsx)(i.Path,{fill:"#ffb8dd",d:"M256.001 309.341a53.342 53.342 0 1 0 0-106.684 53.342 53.342 0 0 0 0 106.684"}),(0,n.jsx)(i.Path,{fill:"#ea1e87",d:"M256 320a64.06 64.06 0 0 1-45.234-18.766A64.06 64.06 0 0 1 192 256a64.06 64.06 0 0 1 18.766-45.234A64.06 64.06 0 0 1 256 192a64.06 64.06 0 0 1 45.234 18.766A64.06 64.06 0 0 1 320 256a64.06 64.06 0 0 1-18.766 45.234A64.06 64.06 0 0 1 256 320m0-106.659A42.707 42.707 0 0 0 213.341 256c0 23.505 19.13 42.659 42.659 42.659A42.707 42.707 0 0 0 298.659 256c0-23.505-19.13-42.659-42.659-42.659"}),(0,n.jsx)(i.Path,{fill:"#ea1e87",d:"M327.379 373.714a10.68 10.68 0 0 1-10.24-7.68A63.374 63.374 0 0 0 256.071 320a63.37 63.37 0 0 0-61.091 46.034 10.66 10.66 0 0 1-9.088 7.596 10.66 10.66 0 0 1-10.496-5.489 10.67 10.67 0 0 1-.873-8.112 84.55 84.55 0 0 1 81.548-61.37c37.981 0 70.749 24.669 81.524 61.393a10.657 10.657 0 0 1-10.24 13.662z"}),(0,n.jsx)(i.Path,{fill:"#ea1e87",d:"M273.322 437.341h-34.583a32.18 32.18 0 0 1-29.906-20.643l-12.195-32.116a10.77 10.77 0 0 0-4.654-5.446l-10.589-6.121a11 11 0 0 0-7.029-1.28l-33.908 5.492a32.11 32.11 0 0 1-32.815-15.592l-17.291-29.952a32.17 32.17 0 0 1 2.909-36.236l21.69-26.601a10.68 10.68 0 0 0 2.42-6.726v-12.241a10.75 10.75 0 0 0-2.42-6.749l-21.69-26.577a32.19 32.19 0 0 1-2.91-36.236l17.292-29.952a31.93 31.93 0 0 1 32.815-15.593l33.885 5.493a10.83 10.83 0 0 0 7.052-1.28l10.612-6.121a10.76 10.76 0 0 0 4.655-5.493l12.171-32.07c4.678-12.334 16.71-20.642 29.906-20.642h34.583c13.196 0 25.228 8.308 29.929 20.643l12.171 32.116a10.78 10.78 0 0 0 4.655 5.446l10.589 6.121c2.141 1.233 4.654 1.652 7.028 1.28l33.909-5.493c13.032-2.094 26.228 4.143 32.814 15.593l17.292 29.952a32.165 32.165 0 0 1-2.909 36.236l-21.69 26.6a10.66 10.66 0 0 0-2.421 6.726v12.241a10.7 10.7 0 0 0 2.421 6.75l21.69 26.6c8.355 10.24 9.542 24.786 2.909 36.213l-17.292 29.975a31.905 31.905 0 0 1-32.814 15.593l-33.885-5.516a10.9 10.9 0 0 0-7.052 1.303l-10.612 6.121a10.77 10.77 0 0 0-4.655 5.469l-12.148 32.093c-4.701 12.335-16.733 20.62-29.929 20.62m-97.28-87.063c5.585 0 11.148 1.443 16.035 4.282l10.589 6.12a32.3 32.3 0 0 1 13.917 16.315l12.172 32.116c1.559 4.119 5.585 6.889 9.984 6.889h34.583c4.422 0 8.425-2.793 9.984-6.866l12.172-32.116a32.24 32.24 0 0 1 13.917-16.338l10.612-6.12a31.88 31.88 0 0 1 21.132-3.863L375 356.189c4.422.651 8.751-1.397 10.939-5.213l17.291-29.952a10.7 10.7 0 0 0 1.396-6.187 10.7 10.7 0 0 0-2.35-5.892l-21.713-26.601a32.1 32.1 0 0 1-7.215-20.224v-12.241c0-7.331 2.56-14.522 7.215-20.224l21.69-26.601a10.68 10.68 0 0 0 .977-12.078l-17.291-29.952A10.8 10.8 0 0 0 375 155.811l-33.885 5.492a31.6 31.6 0 0 1-21.131-3.863l-10.589-6.121a32.16 32.16 0 0 1-13.917-16.314l-12.172-32.116a10.76 10.76 0 0 0-9.984-6.89h-34.583c-4.422 0-8.425 2.794-9.984 6.866l-12.172 32.117a32.2 32.2 0 0 1-13.917 16.337l-10.612 6.121c-6.354 3.723-13.848 5.12-21.132 3.863l-33.839-5.492a10.82 10.82 0 0 0-10.938 5.213l-17.291 29.952a10.705 10.705 0 0 0 .954 12.078l21.713 26.601a32.1 32.1 0 0 1 7.215 20.224v12.241c0 7.331-2.56 14.523-7.215 20.224l-21.69 26.624a10.68 10.68 0 0 0-.977 12.056l17.291 29.952c2.188 3.816 6.517 5.818 10.938 5.213l33.885-5.492a30 30 0 0 1 5.12-.419z"}),(0,n.jsx)(i.Path,{fill:"#ffd0f2",d:"M234.148 277.32a4.45 4.45 0 1 1 6.294-6.295c4.202 4.201 9.789 6.522 15.721 6.522a22.12 22.12 0 0 0 15.747-6.522 4.446 4.446 0 0 1 6.288 6.288c-5.883 5.883-13.709 9.124-22.035 9.13a30.94 30.94 0 0 1-22.015-9.123"})]})});case"password-requirements":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"102 94 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#e2edfd",d:"M474.364 94H241.636C164.517 94 102 156.517 102 233.636v232.728C102 543.483 164.517 606 241.636 606h232.728C551.483 606 614 543.483 614 466.364V233.636C614 156.517 551.483 94 474.364 94"}),(0,n.jsx)(i.Path,{fill:"#cfdefa",d:"M358.001 520.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,n.jsx)(i.Path,{fill:"#e2edfd",d:"M409.281 332.536c21.887-34.435 16.488-77.187-10.359-104.035-32.247-32.247-84.484-32.247-116.73 0-20.866 20.865-28.745 50.631-21.158 79.522l-61.866 61.867a15.46 15.46 0 0 0-4.524 10.943v36.478c0 8.463 7.004 15.467 15.467 15.467h31.809c6.712 0 12.694-4.232 14.737-10.652 0 0 3.648-10.943 3.794-11.089l1.167-.292.438-.438 20.282-6.566 7.295-21.887 21.887-7.295 8.025-8.025c34.873 9.192 70.038-4.086 89.882-33.852zm-68.724-45.67c-8.026-8.026-8.026-21.158 0-29.183s21.157-8.025 29.182 0 8.025 21.157 0 29.183-21.157 8.025-29.182 0"}),(0,n.jsx)(i.Path,{fill:"#99c7ff",d:"M501.06 272.266c-36.478-36.478-81.711-20.136-85.213-20.136.875 5.837 16.926 36.186-3.502 75.875l-.292-.292c-32.246 56.176-89.882 38.521-92.508 38.812l-7.879 7.88-21.887 7.295-7.296 21.887-21.887 7.296 94.843 94.843c8.025 8.025 21.157 8.025 29.183 0l116.73-116.73c32.246-32.247 32.246-84.483-.001-116.73zm-58.365 58.365c-8.025-8.025-8.025-21.157 0-29.183s21.157-8.025 29.182 0 8.025 21.158 0 29.183-21.157 8.025-29.182 0"}),(0,n.jsx)(i.Path,{fill:"#3140d7",d:"M184.431 417.311v-36.478c0-7.004 2.626-13.424 7.441-18.239l57.927-57.927c-5.982-30.204 3.356-61.721 25.097-83.462 36.186-36.186 95.135-36.186 131.321 0s36.186 95.135 0 131.321c-21.741 21.741-53.258 31.079-83.462 25.097l-4.085 4.085c-1.167 1.168-2.481 1.897-3.94 2.481l-17.072 5.691-5.69 17.071c-1.022 3.064-3.502 5.545-6.566 6.566l-17.072 5.691-2.043 6.42c-3.502 10.506-13.278 17.655-24.367 17.655h-31.809c-14.299 0-25.826-11.527-25.826-25.826zm207.195-181.515c-28.161-28.161-73.978-28.161-102.139 0-18.239 18.239-25.097 44.066-18.385 69.454.876 3.502 0 7.296-2.626 9.922l-61.867 61.867c-1.021 1.022-1.459 2.335-1.605 3.648v36.478c0 2.918 2.335 5.253 5.107 5.107h31.809c2.335 0 4.231-1.313 4.961-3.502l3.794-11.381c1.021-3.064 3.502-5.545 6.566-6.566l17.071-5.691 5.691-17.071c1.021-3.065 3.502-5.545 6.566-6.566l19.552-6.421 6.42-6.42c2.627-2.626 6.275-3.648 9.923-2.626 25.388 6.712 51.361-.292 69.454-18.385 28.161-28.161 28.161-73.978 0-102.139z"}),(0,n.jsx)(i.Path,{fill:"#3140d7",d:"m347.85 513.026-94.843-94.842c-4.086-4.086-4.086-10.506 0-14.592 4.085-4.085 10.505-4.085 14.591 0l94.843 94.843c4.085 4.086 10.505 4.086 14.591 0l116.73-116.73c28.015-28.015 28.453-73.685 0-102.138-19.698-19.698-48.297-26.118-74.853-16.78-5.399 1.897-11.235-1.021-13.132-6.42s1.021-11.235 6.42-13.132c33.997-11.819 70.913-3.502 96.156 21.741 36.478 36.478 36.04 95.28 0 131.321l-116.73 116.729c-12.11 12.111-31.663 12.111-43.773 0"}),(0,n.jsx)(i.Path,{fill:"#3140d7",d:"M333.262 294.161c-12.111-12.111-12.111-31.663 0-43.774 12.11-12.11 31.663-12.11 43.773 0 12.111 12.111 12.111 31.663 0 43.774-12.11 12.111-31.663 12.111-43.773 0m29.182-29.182c-4.085-4.086-10.506-4.086-14.591 0-4.086 4.085-4.086 10.505 0 14.591 4.085 4.085 10.506 4.085 14.591 0 4.086-4.086 4.086-10.506 0-14.591M435.4 337.935c-12.11-12.111-12.11-31.663 0-43.774 12.111-12.11 31.663-12.11 43.774 0 12.111 12.111 12.111 31.663 0 43.774s-31.663 12.111-43.774 0m29.183-29.183c-4.086-4.085-10.506-4.085-14.592 0-4.085 4.086-4.085 10.506 0 14.592 4.086 4.085 10.506 4.085 14.592 0 4.085-4.086 4.085-10.506 0-14.592"}),(0,n.jsx)(i.Path,{fill:"#3140d7",d:"M354.125 285.551c-3.21-4.669-2.335-11.089 2.481-14.445 4.669-3.21 11.089-2.335 14.445 2.481 3.94 4.523 12.986 23.783 37.791 34.289 12.257 5.253 26.118 7.15 39.98 5.253 5.691-.73 10.798 3.21 11.673 8.754.73 5.691-3.064 10.944-8.755 11.673-17.655 2.481-35.164.146-50.777-6.712-30.642-13.132-42.461-36.623-46.546-41.293z"})]})});case"password-reset-enforcement":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#f3d9ff",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,n.jsx)(i.Path,{fill:"#efceff",d:"M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"M369.151 384.234a10.67 10.67 0 0 1-2.321-11.641 10.7 10.7 0 0 1 2.321-3.463 158.97 158.97 0 0 0 46.848-113.129c0-88.437-71.563-160-160-160a10.67 10.67 0 1 1 0-21.341 181.23 181.23 0 0 1 167.569 111.926 181.2 181.2 0 0 1 13.772 69.415c0 48.43-18.85 93.975-53.108 128.233a10.665 10.665 0 0 1-15.081 0m-113.152 53.108a181.226 181.226 0 0 1-181.34-181.341c0-48.431 18.85-93.975 53.131-128.21a10.67 10.67 0 0 1 7.54-3.123 10.66 10.66 0 0 1 9.852 6.583 10.66 10.66 0 0 1-2.311 11.621 158.93 158.93 0 0 0-46.872 113.152 159.88 159.88 0 0 0 46.837 113.156 159.9 159.9 0 0 0 113.163 46.821 10.67 10.67 0 1 1 0 21.341"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"m165.691 120.016-2.232 42.601a10.66 10.66 0 0 1-21.289-1.116l1.675-31.956-31.956-1.675a10.671 10.671 0 0 1 1.116-21.312l42.601 2.233a10.65 10.65 0 0 1 9.495 7.103c.466 1.322.667 2.723.59 4.122M351.93 388.426l-.744-42.652a10.659 10.659 0 0 1 21.314-.372l.559 31.995 31.995-.558a10.67 10.67 0 0 1 10.855 10.482 10.67 10.67 0 0 1-10.482 10.855l-42.653.745a10.673 10.673 0 0 1-9.968-6.423 10.7 10.7 0 0 1-.876-4.072"}),(0,n.jsx)(i.Path,{fill:"#f5dfff",d:"M308.137 143.792a10.67 10.67 0 0 1-15.09 15.091c-10.072-10.072-23.467-15.634-37.685-15.634a52.99 52.99 0 0 0-37.751 15.634 10.66 10.66 0 0 1-15.074 0 10.66 10.66 0 0 1 0-15.074c14.103-14.103 32.863-21.871 52.825-21.887a74.17 74.17 0 0 1 52.775 21.87M203.546 367.89a10.671 10.671 0 1 1 15.09-15.09c10.071 10.071 23.467 15.634 37.685 15.634a52.997 52.997 0 0 0 37.751-15.634 10.659 10.659 0 1 1 15.074 15.074c-14.103 14.103-32.863 21.87-52.825 21.887a74.17 74.17 0 0 1-52.775-21.871"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"M255.492 299.997a10.993 10.993 0 0 1-10.992-10.992v-66a10.98 10.98 0 0 1 3.219-7.773 11 11 0 0 1 7.773-3.219 11 11 0 0 1 7.773 3.219 11 11 0 0 1 3.219 7.773v66a10.99 10.99 0 0 1-10.992 10.992"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"m277.33 281.946-55.008-33a11.02 11.02 0 0 1-5.01-6.768 11.005 11.005 0 0 1 8.01-13.339 11 11 0 0 1 8.328 1.243l55.008 33a11 11 0 0 1 5.011 6.767 11.005 11.005 0 0 1-8.01 13.339 11 11 0 0 1-8.329-1.242"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"M218.558 278.18a10.99 10.99 0 0 1 3.768-15.096l55.008-33a11 11 0 0 1 12.211.59 11 11 0 0 1 4.335 7.219 11.01 11.01 0 0 1-5.218 11.055l-55.008 33a10.99 10.99 0 0 1-12.212-.587 11 11 0 0 1-2.884-3.181m124.944 21.816a11 11 0 0 1-7.788-3.211 11 11 0 0 1-3.228-7.781v-66a11.004 11.004 0 1 1 22.008 0v66c0 2.915-1.158 5.711-3.219 7.773a11 11 0 0 1-7.773 3.219"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"m365.338 281.946-55.008-33a11.001 11.001 0 0 1 11.328-18.864l54.984 33a11 11 0 0 1 3.179 2.881 10.99 10.99 0 0 1-2.28 15.382 10.99 10.99 0 0 1-12.203.601"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"M306.564 278.18a10.985 10.985 0 0 1 .587-12.212 11 11 0 0 1 3.181-2.884l55.008-33a11.005 11.005 0 0 1 16.339 12.096 11.007 11.007 0 0 1-5.011 6.768l-55.008 33a10.992 10.992 0 0 1-15.12-3.768zm-139.08 21.816a10.983 10.983 0 0 1-10.155-6.786 11 11 0 0 1-.837-4.206v-66A11.01 11.01 0 0 1 167.496 212a11 11 0 0 1 11.004 11.004v66a10.99 10.99 0 0 1-6.802 10.162 11 11 0 0 1-4.214.83"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"m189.328 281.952-54.984-33a11 11 0 0 1-3.179-2.881 10.99 10.99 0 0 1 2.28-15.382 10.99 10.99 0 0 1 12.203-.601l55.008 33a11.02 11.02 0 0 1 5.01 6.768c.35 1.402.421 2.859.207 4.288a10.99 10.99 0 0 1-4.335 7.219 11 11 0 0 1-8.17 2.039 11 11 0 0 1-4.04-1.45"}),(0,n.jsx)(i.Path,{fill:"#9718d2",d:"M130.574 278.178a11 11 0 0 1-1.247-8.33 10.98 10.98 0 0 1 5.015-6.766l54.984-33a11 11 0 0 1 8.328-1.243 11 11 0 0 1 6.768 5.011 11.005 11.005 0 0 1-3.768 15.096l-55.008 33a10.993 10.993 0 0 1-15.072-3.768"})]})});case"stalepilot":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#dafbf0",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,n.jsx)(i.Path,{fill:"#b9f3df",d:"M256.274 426.658a170.66 170.66 0 0 0 170.659-170.659 170.66 170.66 0 1 0-170.659 170.659"}),(0,n.jsx)(i.Path,{fill:"#b9f3df",d:"M389.747 382.787c-17.58-31.623-17.026-58.92-16.749-72.025V295.1H138.513v15.343c.213 12.252.703 40.913-16.791 72.365-7.246 13.105 1.363 29.492 16.706 29.492h234.634c15.322 0 23.994-16.408 16.685-29.513"}),(0,n.jsx)(i.Path,{fill:"#8ae7bc",d:"M138.574 295.1a19.562 19.562 0 0 1-19.541-19.52v-19.54a58.664 58.664 0 0 1 58.6-58.6h156.281a58.664 58.664 0 0 1 58.6 58.6v19.54a19.543 19.543 0 0 1-19.54 19.52z"}),(0,n.jsx)(i.Path,{fill:"#8ae7bc",d:"M285.074 90h-58.6v117.2h58.6z"}),(0,n.jsx)(i.Path,{fill:"#0e9f6e",d:"M372.973 304.88h-234.4a29.32 29.32 0 0 1-29.3-29.3v-19.54a68.45 68.45 0 0 1 68.36-68.36h156.281a68.446 68.446 0 0 1 68.359 68.36v19.54c0 16.152-13.147 29.3-29.3 29.3m-195.34-97.681a48.884 48.884 0 0 0-48.819 48.841v19.54a9.8 9.8 0 0 0 9.759 9.76h234.4a9.783 9.783 0 0 0 9.76-9.76v-19.54a48.886 48.886 0 0 0-48.819-48.841z"}),(0,n.jsx)(i.Path,{fill:"#0e9f6e",d:"M373.101 422.08H138.467c-22.418 0-36.29-24.058-25.23-44.024 10.207-18.326 15.577-39.103 15.577-60.071v-22.886a9.77 9.77 0 0 1 2.861-6.908 9.76 9.76 0 0 1 6.909-2.862 9.773 9.773 0 0 1 9.77 9.77v22.886a143.4 143.4 0 0 1-18.049 69.553c-3.708 6.691.362 15.002 8.162 15.002H373.08c7.778 0 11.911-8.289 8.161-15.002a143.47 143.47 0 0 1-18.027-69.553v-22.886a9.77 9.77 0 1 1 19.54 0v22.886c0 20.968 5.37 41.745 15.556 60.049 11.08 19.988-2.792 44.046-25.209 44.046"}),(0,n.jsx)(i.Path,{fill:"#0e9f6e",d:"M197.173 363.48a9.75 9.75 0 0 1-6.909-2.866 9.76 9.76 0 0 1-2.851-6.915v-58.6a9.757 9.757 0 0 1 9.76-9.759 9.76 9.76 0 0 1 9.759 9.759v58.6a9.74 9.74 0 0 1-2.851 6.915 9.752 9.752 0 0 1-6.908 2.866m78.14-19.54a9.78 9.78 0 0 1-6.915-2.851 9.757 9.757 0 0 1-2.866-6.909v-39.081a9.77 9.77 0 0 1 19.541 0v39.081a9.76 9.76 0 0 1-9.76 9.76m58.6 39.059a9.75 9.75 0 0 1-9.036-6.02 9.8 9.8 0 0 1-.745-3.739v-78.141a9.77 9.77 0 0 1 19.541 0v78.141a9.763 9.763 0 0 1-9.76 9.759m-107.44-175.8a9.76 9.76 0 0 1-9.76-9.759V99.78a9.757 9.757 0 0 1 9.76-9.76 9.76 9.76 0 0 1 9.759 9.76v97.66a9.76 9.76 0 0 1-9.759 9.759m58.6 0a9.76 9.76 0 0 1-9.76-9.759V99.78a9.757 9.757 0 0 1 9.76-9.76 9.76 9.76 0 0 1 9.759 9.76v97.66a9.76 9.76 0 0 1-9.759 9.759"})]})});case"teydea-pattern-library":return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)(i.Path,{fill:"#fff5e6",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,n.jsx)(i.Path,{fill:"#ffe6c0",d:"M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,n.jsx)(i.Path,{fill:"#ffd18c",d:"M405.689 331h-21.341v-21.341a21.34 21.34 0 0 0-21.33-20.636 21.34 21.34 0 0 0-21.329 20.636V331h-21.341a21.365 21.365 0 0 0 0 42.659h21.341V395a21.36 21.36 0 0 0 21.329 20.144A21.36 21.36 0 0 0 384.348 395v-21.341h21.341A21.362 21.362 0 0 0 420 337.661 21.36 21.36 0 0 0 405.689 331M405.683 117.659H107.001A21.37 21.37 0 0 0 86.633 139a21.363 21.363 0 0 0 20.368 21.341h298.682a21.34 21.34 0 1 0 0-42.682M299.001 224.341h-192a21.344 21.344 0 0 0-20.637 21.33A21.34 21.34 0 0 0 107.001 267h192a21.34 21.34 0 0 0 20.636-21.329 21.343 21.343 0 0 0-20.636-21.33M213.683 331H107.001a21.366 21.366 0 0 0-14.312 35.999 21.37 21.37 0 0 0 14.312 6.66h106.682a21.34 21.34 0 0 0 20.636-21.329A21.34 21.34 0 0 0 213.683 331"}),(0,n.jsx)(i.Path,{fill:"#f89500",d:"M405.682 171H107a32.026 32.026 0 0 1-32-32c0-17.641 14.36-32 32-32h298.682c17.641 0 32 14.359 32 32s-14.359 32-32 32M107 128.341A10.685 10.685 0 0 0 97.023 139 10.68 10.68 0 0 0 107 149.659h298.682A10.685 10.685 0 0 0 415.66 139a10.68 10.68 0 0 0-9.978-10.659zm192 149.318H107a32.026 32.026 0 0 1-32-32c0-17.641 14.36-32 32-32h192a32.025 32.025 0 0 1 0 64M107 235a10.68 10.68 0 0 0-7.23 18.046 10.68 10.68 0 0 0 7.23 3.295h192a10.68 10.68 0 0 0 10.184-10.67A10.683 10.683 0 0 0 299 235zm106.682 149.341H107a32.02 32.02 0 0 1-32-32c0-17.664 14.36-32 32-32h106.682a32.023 32.023 0 0 1 0 64M107 341.659a10.68 10.68 0 0 0-7.23 18.046A10.68 10.68 0 0 0 107 363h106.682a10.68 10.68 0 0 0 10.184-10.671 10.68 10.68 0 0 0-10.184-10.67zM363 427a32.03 32.03 0 0 1-22.621-9.379A32.03 32.03 0 0 1 331 395v-10.659h-10.659a32.05 32.05 0 0 1-32-32c0-17.664 14.359-32 32-32H331v-10.682a32.025 32.025 0 0 1 64 0v10.682h10.682a32.023 32.023 0 0 1 0 64H395V395c0 17.641-14.336 32-32 32m-42.659-85.341a10.68 10.68 0 0 0-10.184 10.67A10.68 10.68 0 0 0 320.341 363h21.341c5.888 0 10.659 4.771 10.659 10.659V395a10.68 10.68 0 0 0 3.296 7.229 10.68 10.68 0 0 0 14.75 0 10.68 10.68 0 0 0 3.295-7.229v-21.341c0-5.888 4.771-10.659 10.659-10.659h21.341a10.68 10.68 0 0 0 10.184-10.671 10.68 10.68 0 0 0-10.184-10.67h-21.341A10.66 10.66 0 0 1 373.682 331v-21.341a10.68 10.68 0 0 0-10.67-10.184 10.68 10.68 0 0 0-7.375 2.955 10.68 10.68 0 0 0-3.296 7.229V331a10.66 10.66 0 0 1-10.659 10.659z"})]})})}return(0,n.jsx)("div",{className:"tsc-product-icon",children:(0,n.jsxs)(i.SVG,{fill:"none",height:"256",viewBox:"0 0 256 256",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsxs)(i.G,{clipPath:(0,a.sprintf)("url(#%s-a)",s),children:[(0,n.jsx)("mask",{height:"256",id:(0,a.sprintf)("%s-b",s),maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},width:"256",x:"0",y:"0",children:(0,n.jsx)(i.Path,{d:"M0 0h256v256H0z",fill:"#fff"})}),(0,n.jsxs)(i.G,{mask:(0,a.sprintf)("url(#%s-b)",s),children:[(0,n.jsx)(i.Rect,{fill:"#FCEBD8",height:"256",rx:"10.24",width:"256",x:"-.296"}),(0,n.jsxs)(i.G,{clipPath:(0,a.sprintf)("url(#%s-c)",s),children:[(0,n.jsx)(i.Path,{d:"M81.86 202.714c-4.212-5.711-9.207-10.766-14.743-15.179L10.774 194a120.343 120.343 0 0 0 19.781 9.306l.156.057c9.356 3.391 18.15 8.218 25.745 14.647 20.947 17.728 49.576 24.847 76.933 18.099-20.629-4.497-39.01-16.421-51.529-33.395ZM184.644 94.535c7.905 0 15.05 2.449 20.245 6.396-2.678-9.353-9.32-17.45-18.663-21.637-18.175-8.145-39.105.935-45.795 19.315-3.232 8.313-5.907 22.207-5.907 22.207l-.01.003a31.663 31.663 0 0 1 13.381 12.506c3.764 6.46 4.956 13.483 4.08 20.112l16.993-10.72c3.04-1.918 2.786-6.373-.407-8.023-7.636-3.946-12.656-10.622-12.656-18.198 0-12.128 12.867-21.96 28.739-21.96Z",fill:"#111"}),(0,n.jsx)(i.Path,{d:"m112.219 157.765-79.112 13.21",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,n.jsx)(i.Path,{d:"M147.895 133.326c-9.345-16.041-30.373-20.725-45.642-10.166l-30.074 20.796c2.197 4.576 9.653 6.09 18.016 4.029-.672 1.9-.731 3.753-.054 5.411 2.01 4.922 9.842 6.537 18.577 4.271-.736 1.967-.826 3.888-.126 5.602 2.208 5.403 11.432 6.823 21.164 3.495-1.22 2.397-1.527 4.777-.679 6.852.845 2.069 2.721 3.55 5.258 4.408 15.986-7.75 23.236-28.09 13.56-44.698Z",fill:"#111"}),(0,n.jsx)(i.Path,{d:"m46.684 211.546-59.718 23.285c-9.123 3.557-15.71-8.949-7.618-14.461l34.97-23.818M145.995 232.995l14.599 28.633M120.83 238.624l11.729 23.004",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,n.jsx)(i.Path,{d:"M15.902 196.848a120.77 120.77 0 0 0 14.653 6.458l.156.057c9.356 3.391 18.149 8.218 25.744 14.646 25.087 21.233 61.194 27.253 92.936 12.452 32.427-15.121 51.137-47.701 50.164-81.328-.264-9.138 1.122-18.257 4.393-26.793a34.657 34.657 0 0 0 1.162-3.619c4.162-15.903-3.882-32.705-18.884-39.427-18.175-8.145-39.105.935-45.795 19.315l-6.662 20.343",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,n.jsx)(i.Path,{d:"m206.525 101.23 15.166 7.023-15.489 7.744M-2.372 195.508l104.625-72.348c15.269-10.559 36.297-5.876 45.642 10.165 11.57 19.86-1.059 45.063-23.893 47.683l-126.374 14.5Z",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"})]})]})]}),(0,n.jsxs)("defs",{children:[(0,n.jsx)("clipPath",{id:(0,a.sprintf)("%s-a",s),children:(0,n.jsx)(i.Path,{d:"M0 0h256v256H0z",fill:"#fff"})}),(0,n.jsx)("clipPath",{id:(0,a.sprintf)("%s-c",s),children:(0,n.jsx)(i.Path,{fill:"#fff",transform:"translate(-29.31 40.96)",d:"M0 0h256v256H0z"})})]})]})})};l.propTypes={slug:s.string.isRequired};const o=({actions:e,children:s,pageTitle:t,product:r,width:a="full"})=>{const{key:i,type:o}=r,{slug:c}=window.teydeaStudio[i][o];return(0,n.jsxs)("div",{className:"tsc-settings-container",children:[(0,n.jsxs)("header",{className:"tsc-settings-container__header",children:[(0,n.jsx)(l,{slug:c}),(0,n.jsx)("h1",{children:t}),(0,n.jsx)("div",{className:"tsc-settings-container__actions",children:e})]}),(0,n.jsx)("div",{className:`tsc-settings-container__container tsc-settings-container__container--${a}-width`,children:s})]})};o.propTypes={actions:s.element.isRequired,children:s.element.isRequired,pageTitle:s.string.isRequired,product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,width:s.oneOf(["full","wide"])};const c=window.wp.components,d=window.wp.hooks,u=window.wp.url,h=({product:s,settings:t})=>{const{key:r,type:i}=s,{helpLinks:l}=window.teydeaStudio[r].settingsPage,{slug:o}=window.teydeaStudio[r][i];return(0,n.jsxs)("div",{className:"tsc-settings-sidebar",children:[(0,n.jsxs)(c.Panel,{children:[0<l.length&&(0,n.jsx)(c.PanelBody,{title:(0,a.__)("Help & support","password-requirements"),className:"tsc-settings-sidebar__panel",children:(0,n.jsx)("ul",{children:l.map(({url:e,title:s},t)=>(0,n.jsx)("li",{children:(0,n.jsx)("a",{href:e,target:"_blank",rel:"noreferrer noopener",children:s})},t))})}),(0,d.applyFilters)("password_requirements__upsell_panel",(0,n.jsx)(e.Fragment,{})),(0,d.applyFilters)("password_requirements__promoted_plugins_panel",(0,n.jsx)(e.Fragment,{})),(0,n.jsxs)(c.PanelBody,{className:"tsc-settings-sidebar__panel",initialOpen:!1,title:(0,a.__)("Write a review","password-requirements"),children:[(0,n.jsx)("p",{children:(0,a.sprintf)(
     1(()=>{var e={694(e,s,t){"use strict";var r=t(925);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,s,t,a,i,n){if(n!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function s(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:s,element:e,elementType:e,instanceOf:s,node:e,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:i,resetWarningCache:a};return t.PropTypes=t,t}},556(e,s,t){e.exports=t(694)()},925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}};const s={};function t(r){const a=s[r];if(void 0!==a)return a.exports;const i=s[r]={exports:{}};return e[r](i,i.exports,t),i.exports}(()=>{"use strict";const e=window.wp.element;var s=t(556);const r=window.wp.i18n,a=window.wp.primitives,i=window.ReactJSXRuntime,n=({slug:e})=>{const s=`ts-product-icon-${e}`;switch(e){case"bm-custom-login":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#ffe8db",d:"M372.367 0h-232.73C62.517 0 0 62.518 0 139.637v232.73c0 77.119 62.518 139.637 139.637 139.637h232.73c77.119 0 139.637-62.518 139.637-139.637v-232.73C512.004 62.517 449.486 0 372.367 0"}),(0,i.jsx)(a.Path,{fill:"#ffd7c1",d:"M170.66 426.662a85.41 85.41 0 0 1-85.318-85.318V170.66a85.41 85.41 0 0 1 85.318-85.318h170.684a85.41 85.41 0 0 1 85.318 85.318v170.684a85.41 85.41 0 0 1-85.318 85.318z"}),(0,i.jsx)(a.Path,{fill:"#ff9e68",d:"M192.001 384.003a64.06 64.06 0 0 1-45.234-18.766 64.07 64.07 0 0 1-18.766-45.235V192.001a64.06 64.06 0 0 1 18.766-45.234 64.06 64.06 0 0 1 45.234-18.766h128.001a64.07 64.07 0 0 1 45.235 18.766 64.06 64.06 0 0 1 18.766 45.234v128.001a64.07 64.07 0 0 1-18.766 45.235 64.07 64.07 0 0 1-45.235 18.766z"}),(0,i.jsx)(a.Path,{fill:"#dd3814",d:"M257.306 327.543a10.65 10.65 0 0 1-3.125-7.54 10.67 10.67 0 0 1 3.125-7.541l48.896-48.919a10.68 10.68 0 0 0 0-15.081l-48.896-48.92a10.662 10.662 0 0 1 7.54-18.204c2.829 0 5.541 1.123 7.541 3.123l48.896 48.92a32.02 32.02 0 0 1 0 45.242l-48.896 48.92c-4.189 4.189-10.915 4.189-15.081 0"}),(0,i.jsx)(a.Path,{fill:"#dd3814",d:"M319.887 266.661H85.343a10.65 10.65 0 0 1-9.848-6.58 10.657 10.657 0 0 1 5.769-13.926 10.7 10.7 0 0 1 4.079-.812h234.544a10.65 10.65 0 0 1 7.537 3.122 10.67 10.67 0 0 1 3.122 7.537 10.67 10.67 0 0 1-3.122 7.537 10.67 10.67 0 0 1-7.537 3.122"}),(0,i.jsx)(a.Path,{fill:"#dd3814",d:"M341.344 437.345H170.661a96.12 96.12 0 0 1-96-96.001 10.67 10.67 0 1 1 21.34 0 74.753 74.753 0 0 0 74.66 74.659h170.683a74.755 74.755 0 0 0 74.66-74.659V170.66A74.755 74.755 0 0 0 341.344 96H170.661a74.753 74.753 0 0 0-74.66 74.66 10.672 10.672 0 0 1-18.216 7.546 10.67 10.67 0 0 1-3.125-7.546 96.117 96.117 0 0 1 96.001-96h170.683a96.116 96.116 0 0 1 96.001 96v170.684a96.12 96.12 0 0 1-96.001 96.001"})]})});case"careers":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 256 256",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsxs)(a.G,{clipPath:(0,r.sprintf)("url(#%s-a)",s),children:[(0,i.jsx)(a.Rect,{fill:"#fff",height:"256",rx:"10.24",width:"256"}),(0,i.jsx)(a.Path,{d:"M0 0h256v256H0z",fill:"#AD1735",fillOpacity:".05"}),(0,i.jsx)(a.Path,{d:"M130.289 201.349c-14.461 0-27.185-3.062-38.172-9.188-10.988-6.188-19.576-14.776-25.764-25.763-6.189-10.988-9.283-23.744-9.283-38.267 0-10.988 1.8-21.06 5.4-30.216 3.599-9.156 8.682-17.081 15.25-23.775 6.63-6.693 14.428-11.871 23.395-15.534 9.03-3.662 18.975-5.494 29.837-5.494 7.83 0 15.628 1.01 23.396 3.032 7.767 1.957 14.713 4.799 20.838 8.524h.758l8.146-9.567h5.683v45.845h-8.904c-1.263-3.347-2.589-6.44-3.978-9.282-1.326-2.842-2.779-5.431-4.357-7.768-4.357-6.756-9.535-11.713-15.534-14.87-5.999-3.221-12.914-4.831-20.744-4.831-14.461 0-25.385 5.21-32.773 15.629-7.325 10.356-10.988 25.826-10.988 46.412 0 20.712 3.663 36.531 10.988 47.455 7.388 10.861 18.06 16.292 32.015 16.292 7.704 0 14.65-1.674 20.839-5.02 6.251-3.347 11.461-8.083 15.628-14.208 2.211-3.095 4.105-6.599 5.684-10.514 1.641-3.978 2.873-8.272 3.694-12.882h8.43v52.001h-7.009l-7.578-12.313c-7.325 4.988-14.587 8.619-21.786 10.892-7.135 2.274-14.839 3.41-23.111 3.41Z",fill:"#AD1735"})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:(0,r.sprintf)("%s-a",s),children:(0,i.jsx)(a.Rect,{fill:"#fff",height:"256",rx:"10.24",width:"256"})})})]})});case"hiring-center":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#ffe2f7",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,i.jsx)(a.Path,{fill:"#ffd8f4",d:"m373.482 366.755-34.048-5.539-3.258.07-7.633.558c-8.611-13.335-14.173-32.186-39.611-44.73l-15.755-7.773c5.934-5.958 36.212-18.525 36.212-53.341a53.38 53.38 0 0 0-15.637-37.704 53.38 53.38 0 0 0-37.704-15.637A53.385 53.385 0 0 0 202.707 256c0 34.932 30.045 47.127 36.212 53.341l-15.755 7.773c-29.114 14.336-36.399 41.658-38.168 44.521l-9.728-.745c-5.678.768-41.588 6.33-39.796 6.051a21.48 21.48 0 0 1-18.595-10.636l-17.291-29.952a21.39 21.39 0 0 1 1.978-24.157l21.667-26.601a21.4 21.4 0 0 0 4.817-13.475v-12.241a21.5 21.5 0 0 0-4.817-13.498L101.54 209.78a21.39 21.39 0 0 1-1.931-24.157l17.268-29.929a21.51 21.51 0 0 1 18.618-10.659l37.144 5.749a20.95 20.95 0 0 0 14.056-2.56l10.659-6.144a21.57 21.57 0 0 0 9.286-10.892l12.148-32.093a21.49 21.49 0 0 1 19.968-13.754h34.584c8.797 0 16.803 5.516 19.944 13.73l12.195 32.164a21.42 21.42 0 0 0 9.263 10.845l10.612 6.12a20.95 20.95 0 0 0 14.01 2.584l37.26-5.772c7.657 0 14.755 4.096 18.572 10.659l17.291 29.975a21.39 21.39 0 0 1-1.978 24.157l-21.643 26.601a21.34 21.34 0 0 0-4.818 13.475v12.241c0 4.888 1.699 9.705 4.794 13.499l21.714 26.6c5.585 6.796 6.353 16.524 1.931 24.157l-17.291 29.929a21.48 21.48 0 0 1-18.549 10.682z"}),(0,i.jsx)(a.Path,{fill:"#ffd0f2",d:"M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,i.jsx)(a.Path,{fill:"#ffb8dd",d:"M238.774 426.658a21.435 21.435 0 0 1-19.968-13.731l-12.195-32.163a21.5 21.5 0 0 0-9.262-10.845l-12.94-7.494c1.699-2.117 16.384-53.085 71.634-53.085 55.296 0 69.934 50.968 71.633 53.109l-12.94 7.447a21.55 21.55 0 0 0-9.262 10.938l-12.195 32.093a21.432 21.432 0 0 1-19.945 13.731z"}),(0,i.jsx)(a.Path,{fill:"#ffb8dd",d:"M256.001 309.341a53.342 53.342 0 1 0 0-106.684 53.342 53.342 0 0 0 0 106.684"}),(0,i.jsx)(a.Path,{fill:"#ea1e87",d:"M256 320a64.06 64.06 0 0 1-45.234-18.766A64.06 64.06 0 0 1 192 256a64.06 64.06 0 0 1 18.766-45.234A64.06 64.06 0 0 1 256 192a64.06 64.06 0 0 1 45.234 18.766A64.06 64.06 0 0 1 320 256a64.06 64.06 0 0 1-18.766 45.234A64.06 64.06 0 0 1 256 320m0-106.659A42.707 42.707 0 0 0 213.341 256c0 23.505 19.13 42.659 42.659 42.659A42.707 42.707 0 0 0 298.659 256c0-23.505-19.13-42.659-42.659-42.659"}),(0,i.jsx)(a.Path,{fill:"#ea1e87",d:"M327.379 373.714a10.68 10.68 0 0 1-10.24-7.68A63.374 63.374 0 0 0 256.071 320a63.37 63.37 0 0 0-61.091 46.034 10.66 10.66 0 0 1-9.088 7.596 10.66 10.66 0 0 1-10.496-5.489 10.67 10.67 0 0 1-.873-8.112 84.55 84.55 0 0 1 81.548-61.37c37.981 0 70.749 24.669 81.524 61.393a10.657 10.657 0 0 1-10.24 13.662z"}),(0,i.jsx)(a.Path,{fill:"#ea1e87",d:"M273.322 437.341h-34.583a32.18 32.18 0 0 1-29.906-20.643l-12.195-32.116a10.77 10.77 0 0 0-4.654-5.446l-10.589-6.121a11 11 0 0 0-7.029-1.28l-33.908 5.492a32.11 32.11 0 0 1-32.815-15.592l-17.291-29.952a32.17 32.17 0 0 1 2.909-36.236l21.69-26.601a10.68 10.68 0 0 0 2.42-6.726v-12.241a10.75 10.75 0 0 0-2.42-6.749l-21.69-26.577a32.19 32.19 0 0 1-2.91-36.236l17.292-29.952a31.93 31.93 0 0 1 32.815-15.593l33.885 5.493a10.83 10.83 0 0 0 7.052-1.28l10.612-6.121a10.76 10.76 0 0 0 4.655-5.493l12.171-32.07c4.678-12.334 16.71-20.642 29.906-20.642h34.583c13.196 0 25.228 8.308 29.929 20.643l12.171 32.116a10.78 10.78 0 0 0 4.655 5.446l10.589 6.121c2.141 1.233 4.654 1.652 7.028 1.28l33.909-5.493c13.032-2.094 26.228 4.143 32.814 15.593l17.292 29.952a32.165 32.165 0 0 1-2.909 36.236l-21.69 26.6a10.66 10.66 0 0 0-2.421 6.726v12.241a10.7 10.7 0 0 0 2.421 6.75l21.69 26.6c8.355 10.24 9.542 24.786 2.909 36.213l-17.292 29.975a31.905 31.905 0 0 1-32.814 15.593l-33.885-5.516a10.9 10.9 0 0 0-7.052 1.303l-10.612 6.121a10.77 10.77 0 0 0-4.655 5.469l-12.148 32.093c-4.701 12.335-16.733 20.62-29.929 20.62m-97.28-87.063c5.585 0 11.148 1.443 16.035 4.282l10.589 6.12a32.3 32.3 0 0 1 13.917 16.315l12.172 32.116c1.559 4.119 5.585 6.889 9.984 6.889h34.583c4.422 0 8.425-2.793 9.984-6.866l12.172-32.116a32.24 32.24 0 0 1 13.917-16.338l10.612-6.12a31.88 31.88 0 0 1 21.132-3.863L375 356.189c4.422.651 8.751-1.397 10.939-5.213l17.291-29.952a10.7 10.7 0 0 0 1.396-6.187 10.7 10.7 0 0 0-2.35-5.892l-21.713-26.601a32.1 32.1 0 0 1-7.215-20.224v-12.241c0-7.331 2.56-14.522 7.215-20.224l21.69-26.601a10.68 10.68 0 0 0 .977-12.078l-17.291-29.952A10.8 10.8 0 0 0 375 155.811l-33.885 5.492a31.6 31.6 0 0 1-21.131-3.863l-10.589-6.121a32.16 32.16 0 0 1-13.917-16.314l-12.172-32.116a10.76 10.76 0 0 0-9.984-6.89h-34.583c-4.422 0-8.425 2.794-9.984 6.866l-12.172 32.117a32.2 32.2 0 0 1-13.917 16.337l-10.612 6.121c-6.354 3.723-13.848 5.12-21.132 3.863l-33.839-5.492a10.82 10.82 0 0 0-10.938 5.213l-17.291 29.952a10.705 10.705 0 0 0 .954 12.078l21.713 26.601a32.1 32.1 0 0 1 7.215 20.224v12.241c0 7.331-2.56 14.523-7.215 20.224l-21.69 26.624a10.68 10.68 0 0 0-.977 12.056l17.291 29.952c2.188 3.816 6.517 5.818 10.938 5.213l33.885-5.492a30 30 0 0 1 5.12-.419z"}),(0,i.jsx)(a.Path,{fill:"#ffd0f2",d:"M234.148 277.32a4.45 4.45 0 1 1 6.294-6.295c4.202 4.201 9.789 6.522 15.721 6.522a22.12 22.12 0 0 0 15.747-6.522 4.446 4.446 0 0 1 6.288 6.288c-5.883 5.883-13.709 9.124-22.035 9.13a30.94 30.94 0 0 1-22.015-9.123"})]})});case"password-requirements":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"102 94 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#e2edfd",d:"M474.364 94H241.636C164.517 94 102 156.517 102 233.636v232.728C102 543.483 164.517 606 241.636 606h232.728C551.483 606 614 543.483 614 466.364V233.636C614 156.517 551.483 94 474.364 94"}),(0,i.jsx)(a.Path,{fill:"#cfdefa",d:"M358.001 520.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,i.jsx)(a.Path,{fill:"#e2edfd",d:"M409.281 332.536c21.887-34.435 16.488-77.187-10.359-104.035-32.247-32.247-84.484-32.247-116.73 0-20.866 20.865-28.745 50.631-21.158 79.522l-61.866 61.867a15.46 15.46 0 0 0-4.524 10.943v36.478c0 8.463 7.004 15.467 15.467 15.467h31.809c6.712 0 12.694-4.232 14.737-10.652 0 0 3.648-10.943 3.794-11.089l1.167-.292.438-.438 20.282-6.566 7.295-21.887 21.887-7.295 8.025-8.025c34.873 9.192 70.038-4.086 89.882-33.852zm-68.724-45.67c-8.026-8.026-8.026-21.158 0-29.183s21.157-8.025 29.182 0 8.025 21.157 0 29.183-21.157 8.025-29.182 0"}),(0,i.jsx)(a.Path,{fill:"#99c7ff",d:"M501.06 272.266c-36.478-36.478-81.711-20.136-85.213-20.136.875 5.837 16.926 36.186-3.502 75.875l-.292-.292c-32.246 56.176-89.882 38.521-92.508 38.812l-7.879 7.88-21.887 7.295-7.296 21.887-21.887 7.296 94.843 94.843c8.025 8.025 21.157 8.025 29.183 0l116.73-116.73c32.246-32.247 32.246-84.483-.001-116.73zm-58.365 58.365c-8.025-8.025-8.025-21.157 0-29.183s21.157-8.025 29.182 0 8.025 21.158 0 29.183-21.157 8.025-29.182 0"}),(0,i.jsx)(a.Path,{fill:"#3140d7",d:"M184.431 417.311v-36.478c0-7.004 2.626-13.424 7.441-18.239l57.927-57.927c-5.982-30.204 3.356-61.721 25.097-83.462 36.186-36.186 95.135-36.186 131.321 0s36.186 95.135 0 131.321c-21.741 21.741-53.258 31.079-83.462 25.097l-4.085 4.085c-1.167 1.168-2.481 1.897-3.94 2.481l-17.072 5.691-5.69 17.071c-1.022 3.064-3.502 5.545-6.566 6.566l-17.072 5.691-2.043 6.42c-3.502 10.506-13.278 17.655-24.367 17.655h-31.809c-14.299 0-25.826-11.527-25.826-25.826zm207.195-181.515c-28.161-28.161-73.978-28.161-102.139 0-18.239 18.239-25.097 44.066-18.385 69.454.876 3.502 0 7.296-2.626 9.922l-61.867 61.867c-1.021 1.022-1.459 2.335-1.605 3.648v36.478c0 2.918 2.335 5.253 5.107 5.107h31.809c2.335 0 4.231-1.313 4.961-3.502l3.794-11.381c1.021-3.064 3.502-5.545 6.566-6.566l17.071-5.691 5.691-17.071c1.021-3.065 3.502-5.545 6.566-6.566l19.552-6.421 6.42-6.42c2.627-2.626 6.275-3.648 9.923-2.626 25.388 6.712 51.361-.292 69.454-18.385 28.161-28.161 28.161-73.978 0-102.139z"}),(0,i.jsx)(a.Path,{fill:"#3140d7",d:"m347.85 513.026-94.843-94.842c-4.086-4.086-4.086-10.506 0-14.592 4.085-4.085 10.505-4.085 14.591 0l94.843 94.843c4.085 4.086 10.505 4.086 14.591 0l116.73-116.73c28.015-28.015 28.453-73.685 0-102.138-19.698-19.698-48.297-26.118-74.853-16.78-5.399 1.897-11.235-1.021-13.132-6.42s1.021-11.235 6.42-13.132c33.997-11.819 70.913-3.502 96.156 21.741 36.478 36.478 36.04 95.28 0 131.321l-116.73 116.729c-12.11 12.111-31.663 12.111-43.773 0"}),(0,i.jsx)(a.Path,{fill:"#3140d7",d:"M333.262 294.161c-12.111-12.111-12.111-31.663 0-43.774 12.11-12.11 31.663-12.11 43.773 0 12.111 12.111 12.111 31.663 0 43.774-12.11 12.111-31.663 12.111-43.773 0m29.182-29.182c-4.085-4.086-10.506-4.086-14.591 0-4.086 4.085-4.086 10.505 0 14.591 4.085 4.085 10.506 4.085 14.591 0 4.086-4.086 4.086-10.506 0-14.591M435.4 337.935c-12.11-12.111-12.11-31.663 0-43.774 12.111-12.11 31.663-12.11 43.774 0 12.111 12.111 12.111 31.663 0 43.774s-31.663 12.111-43.774 0m29.183-29.183c-4.086-4.085-10.506-4.085-14.592 0-4.085 4.086-4.085 10.506 0 14.592 4.086 4.085 10.506 4.085 14.592 0 4.085-4.086 4.085-10.506 0-14.592"}),(0,i.jsx)(a.Path,{fill:"#3140d7",d:"M354.125 285.551c-3.21-4.669-2.335-11.089 2.481-14.445 4.669-3.21 11.089-2.335 14.445 2.481 3.94 4.523 12.986 23.783 37.791 34.289 12.257 5.253 26.118 7.15 39.98 5.253 5.691-.73 10.798 3.21 11.673 8.754.73 5.691-3.064 10.944-8.755 11.673-17.655 2.481-35.164.146-50.777-6.712-30.642-13.132-42.461-36.623-46.546-41.293z"})]})});case"password-reset-enforcement":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#f3d9ff",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,i.jsx)(a.Path,{fill:"#efceff",d:"M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"M369.151 384.234a10.67 10.67 0 0 1-2.321-11.641 10.7 10.7 0 0 1 2.321-3.463 158.97 158.97 0 0 0 46.848-113.129c0-88.437-71.563-160-160-160a10.67 10.67 0 1 1 0-21.341 181.23 181.23 0 0 1 167.569 111.926 181.2 181.2 0 0 1 13.772 69.415c0 48.43-18.85 93.975-53.108 128.233a10.665 10.665 0 0 1-15.081 0m-113.152 53.108a181.226 181.226 0 0 1-181.34-181.341c0-48.431 18.85-93.975 53.131-128.21a10.67 10.67 0 0 1 7.54-3.123 10.66 10.66 0 0 1 9.852 6.583 10.66 10.66 0 0 1-2.311 11.621 158.93 158.93 0 0 0-46.872 113.152 159.88 159.88 0 0 0 46.837 113.156 159.9 159.9 0 0 0 113.163 46.821 10.67 10.67 0 1 1 0 21.341"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"m165.691 120.016-2.232 42.601a10.66 10.66 0 0 1-21.289-1.116l1.675-31.956-31.956-1.675a10.671 10.671 0 0 1 1.116-21.312l42.601 2.233a10.65 10.65 0 0 1 9.495 7.103c.466 1.322.667 2.723.59 4.122M351.93 388.426l-.744-42.652a10.659 10.659 0 0 1 21.314-.372l.559 31.995 31.995-.558a10.67 10.67 0 0 1 10.855 10.482 10.67 10.67 0 0 1-10.482 10.855l-42.653.745a10.673 10.673 0 0 1-9.968-6.423 10.7 10.7 0 0 1-.876-4.072"}),(0,i.jsx)(a.Path,{fill:"#f5dfff",d:"M308.137 143.792a10.67 10.67 0 0 1-15.09 15.091c-10.072-10.072-23.467-15.634-37.685-15.634a52.99 52.99 0 0 0-37.751 15.634 10.66 10.66 0 0 1-15.074 0 10.66 10.66 0 0 1 0-15.074c14.103-14.103 32.863-21.871 52.825-21.887a74.17 74.17 0 0 1 52.775 21.87M203.546 367.89a10.671 10.671 0 1 1 15.09-15.09c10.071 10.071 23.467 15.634 37.685 15.634a52.997 52.997 0 0 0 37.751-15.634 10.659 10.659 0 1 1 15.074 15.074c-14.103 14.103-32.863 21.87-52.825 21.887a74.17 74.17 0 0 1-52.775-21.871"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"M255.492 299.997a10.993 10.993 0 0 1-10.992-10.992v-66a10.98 10.98 0 0 1 3.219-7.773 11 11 0 0 1 7.773-3.219 11 11 0 0 1 7.773 3.219 11 11 0 0 1 3.219 7.773v66a10.99 10.99 0 0 1-10.992 10.992"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"m277.33 281.946-55.008-33a11.02 11.02 0 0 1-5.01-6.768 11.005 11.005 0 0 1 8.01-13.339 11 11 0 0 1 8.328 1.243l55.008 33a11 11 0 0 1 5.011 6.767 11.005 11.005 0 0 1-8.01 13.339 11 11 0 0 1-8.329-1.242"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"M218.558 278.18a10.99 10.99 0 0 1 3.768-15.096l55.008-33a11 11 0 0 1 12.211.59 11 11 0 0 1 4.335 7.219 11.01 11.01 0 0 1-5.218 11.055l-55.008 33a10.99 10.99 0 0 1-12.212-.587 11 11 0 0 1-2.884-3.181m124.944 21.816a11 11 0 0 1-7.788-3.211 11 11 0 0 1-3.228-7.781v-66a11.004 11.004 0 1 1 22.008 0v66c0 2.915-1.158 5.711-3.219 7.773a11 11 0 0 1-7.773 3.219"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"m365.338 281.946-55.008-33a11.001 11.001 0 0 1 11.328-18.864l54.984 33a11 11 0 0 1 3.179 2.881 10.99 10.99 0 0 1-2.28 15.382 10.99 10.99 0 0 1-12.203.601"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"M306.564 278.18a10.985 10.985 0 0 1 .587-12.212 11 11 0 0 1 3.181-2.884l55.008-33a11.005 11.005 0 0 1 16.339 12.096 11.007 11.007 0 0 1-5.011 6.768l-55.008 33a10.992 10.992 0 0 1-15.12-3.768zm-139.08 21.816a10.983 10.983 0 0 1-10.155-6.786 11 11 0 0 1-.837-4.206v-66A11.01 11.01 0 0 1 167.496 212a11 11 0 0 1 11.004 11.004v66a10.99 10.99 0 0 1-6.802 10.162 11 11 0 0 1-4.214.83"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"m189.328 281.952-54.984-33a11 11 0 0 1-3.179-2.881 10.99 10.99 0 0 1 2.28-15.382 10.99 10.99 0 0 1 12.203-.601l55.008 33a11.02 11.02 0 0 1 5.01 6.768c.35 1.402.421 2.859.207 4.288a10.99 10.99 0 0 1-4.335 7.219 11 11 0 0 1-8.17 2.039 11 11 0 0 1-4.04-1.45"}),(0,i.jsx)(a.Path,{fill:"#9718d2",d:"M130.574 278.178a11 11 0 0 1-1.247-8.33 10.98 10.98 0 0 1 5.015-6.766l54.984-33a11 11 0 0 1 8.328-1.243 11 11 0 0 1 6.768 5.011 11.005 11.005 0 0 1-3.768 15.096l-55.008 33a10.993 10.993 0 0 1-15.072-3.768"})]})});case"stalepilot":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#dafbf0",d:"M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"}),(0,i.jsx)(a.Path,{fill:"#b9f3df",d:"M256.274 426.658a170.66 170.66 0 0 0 170.659-170.659 170.66 170.66 0 1 0-170.659 170.659"}),(0,i.jsx)(a.Path,{fill:"#b9f3df",d:"M389.747 382.787c-17.58-31.623-17.026-58.92-16.749-72.025V295.1H138.513v15.343c.213 12.252.703 40.913-16.791 72.365-7.246 13.105 1.363 29.492 16.706 29.492h234.634c15.322 0 23.994-16.408 16.685-29.513"}),(0,i.jsx)(a.Path,{fill:"#8ae7bc",d:"M138.574 295.1a19.562 19.562 0 0 1-19.541-19.52v-19.54a58.664 58.664 0 0 1 58.6-58.6h156.281a58.664 58.664 0 0 1 58.6 58.6v19.54a19.543 19.543 0 0 1-19.54 19.52z"}),(0,i.jsx)(a.Path,{fill:"#8ae7bc",d:"M285.074 90h-58.6v117.2h58.6z"}),(0,i.jsx)(a.Path,{fill:"#0e9f6e",d:"M372.973 304.88h-234.4a29.32 29.32 0 0 1-29.3-29.3v-19.54a68.45 68.45 0 0 1 68.36-68.36h156.281a68.446 68.446 0 0 1 68.359 68.36v19.54c0 16.152-13.147 29.3-29.3 29.3m-195.34-97.681a48.884 48.884 0 0 0-48.819 48.841v19.54a9.8 9.8 0 0 0 9.759 9.76h234.4a9.783 9.783 0 0 0 9.76-9.76v-19.54a48.886 48.886 0 0 0-48.819-48.841z"}),(0,i.jsx)(a.Path,{fill:"#0e9f6e",d:"M373.101 422.08H138.467c-22.418 0-36.29-24.058-25.23-44.024 10.207-18.326 15.577-39.103 15.577-60.071v-22.886a9.77 9.77 0 0 1 2.861-6.908 9.76 9.76 0 0 1 6.909-2.862 9.773 9.773 0 0 1 9.77 9.77v22.886a143.4 143.4 0 0 1-18.049 69.553c-3.708 6.691.362 15.002 8.162 15.002H373.08c7.778 0 11.911-8.289 8.161-15.002a143.47 143.47 0 0 1-18.027-69.553v-22.886a9.77 9.77 0 1 1 19.54 0v22.886c0 20.968 5.37 41.745 15.556 60.049 11.08 19.988-2.792 44.046-25.209 44.046"}),(0,i.jsx)(a.Path,{fill:"#0e9f6e",d:"M197.173 363.48a9.75 9.75 0 0 1-6.909-2.866 9.76 9.76 0 0 1-2.851-6.915v-58.6a9.757 9.757 0 0 1 9.76-9.759 9.76 9.76 0 0 1 9.759 9.759v58.6a9.74 9.74 0 0 1-2.851 6.915 9.752 9.752 0 0 1-6.908 2.866m78.14-19.54a9.78 9.78 0 0 1-6.915-2.851 9.757 9.757 0 0 1-2.866-6.909v-39.081a9.77 9.77 0 0 1 19.541 0v39.081a9.76 9.76 0 0 1-9.76 9.76m58.6 39.059a9.75 9.75 0 0 1-9.036-6.02 9.8 9.8 0 0 1-.745-3.739v-78.141a9.77 9.77 0 0 1 19.541 0v78.141a9.763 9.763 0 0 1-9.76 9.759m-107.44-175.8a9.76 9.76 0 0 1-9.76-9.759V99.78a9.757 9.757 0 0 1 9.76-9.76 9.76 9.76 0 0 1 9.759 9.76v97.66a9.76 9.76 0 0 1-9.759 9.759m58.6 0a9.76 9.76 0 0 1-9.76-9.759V99.78a9.757 9.757 0 0 1 9.76-9.76 9.76 9.76 0 0 1 9.759 9.76v97.66a9.76 9.76 0 0 1-9.759 9.759"})]})});case"teydea-site-assistant":return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 512 512",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)(a.Path,{fill:"#e0f3f7",d:"M372.364 0H139.636C62.5173 0 0 62.5173 0 139.636V372.364C0 449.483 62.5173 512 139.636 512H372.364C449.483 512 512 449.483 512 372.364V139.636C512 62.5173 449.483 0 372.364 0Z"}),(0,i.jsx)(a.Path,{fill:"#c7e5eb",d:"M256.001 426.658C301.262 426.658 344.67 408.678 376.675 376.673C408.68 344.669 426.66 301.261 426.66 255.999C426.66 210.738 408.68 167.33 376.675 135.325C344.67 103.32 301.262 85.3403 256.001 85.3403C210.739 85.3403 167.331 103.32 135.327 135.325C103.322 167.33 85.3418 210.738 85.3418 255.999C85.3418 301.261 103.322 344.669 135.327 376.673C167.331 408.678 210.739 426.658 256.001 426.658Z"}),(0,i.jsx)(a.Path,{fill:"#b0dde6",d:"M236.75 140.5C226.162 140.5 217.5 131.838 217.5 121.25V102H294.5V121.25C294.5 131.838 285.838 140.5 275.25 140.5H236.75Z"}),(0,i.jsx)(a.Path,{fill:"#b0dde6",d:"M159.75 410C149.162 410 140.5 401.338 140.5 390.75V121.25C140.5 110.662 149.162 102 159.75 102H217.5V121.25C217.5 131.838 226.162 140.5 236.75 140.5H275.25C285.838 140.5 294.5 131.838 294.5 121.25V102H352.25C362.838 102 371.5 110.662 371.5 121.25V390.75C371.5 401.338 362.838 410 352.25 410H159.75Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M352.25 419.625H159.75C143.773 419.625 130.875 406.727 130.875 390.75V121.25C130.875 105.273 143.773 92.375 159.75 92.375H352.25C368.227 92.375 381.125 105.273 381.125 121.25V390.75C381.125 406.727 368.227 419.625 352.25 419.625ZM159.75 111.625C154.36 111.625 150.125 115.86 150.125 121.25V390.75C150.125 396.14 154.36 400.375 159.75 400.375H352.25C357.64 400.375 361.875 396.14 361.875 390.75V121.25C361.875 115.86 357.64 111.625 352.25 111.625H159.75Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M275.25 150.125H236.75C220.773 150.125 207.875 137.227 207.875 121.25V102C207.875 96.61 212.11 92.375 217.5 92.375C222.89 92.375 227.125 96.61 227.125 102V121.25C227.125 126.64 231.36 130.875 236.75 130.875H275.25C280.64 130.875 284.875 126.64 284.875 121.25V102C284.875 96.61 289.11 92.375 294.5 92.375C299.89 92.375 304.125 96.61 304.125 102V121.25C304.125 137.227 291.227 150.125 275.25 150.125Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M201.137 243.492L181.888 224.242C178.038 220.392 178.038 214.425 181.888 210.575C185.738 206.725 191.705 206.725 195.555 210.575L208.068 223.087L230.205 200.95C234.055 197.1 240.023 197.1 243.873 200.95C247.723 204.8 247.723 210.767 243.873 214.617L214.998 243.492C211.148 247.342 205.18 247.342 201.33 243.492H201.137Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M323.375 236.75H275.25C269.86 236.75 265.625 232.515 265.625 227.125C265.625 221.735 269.86 217.5 275.25 217.5H323.375C328.765 217.5 333 221.735 333 227.125C333 232.515 328.765 236.75 323.375 236.75Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M201.137 301.242L181.888 281.992C178.038 278.142 178.038 272.175 181.888 268.325C185.738 264.475 191.705 264.475 195.555 268.325L208.068 280.837L230.205 258.7C234.055 254.85 240.023 254.85 243.873 258.7C247.723 262.55 247.723 268.517 243.873 272.367L214.998 301.242C211.148 305.092 205.18 305.092 201.33 301.242H201.137Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M323.375 294.5H275.25C269.86 294.5 265.625 290.265 265.625 284.875C265.625 279.485 269.86 275.25 275.25 275.25H323.375C328.765 275.25 333 279.485 333 284.875C333 290.265 328.765 294.5 323.375 294.5Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M201.137 358.992L181.888 339.742C178.038 335.892 178.038 329.925 181.888 326.075C185.738 322.225 191.705 322.225 195.555 326.075L208.068 338.587L230.205 316.45C234.055 312.6 240.023 312.6 243.873 316.45C247.723 320.3 247.723 326.267 243.873 330.117L214.998 358.992C211.148 362.842 205.18 362.842 201.33 358.992H201.137Z"}),(0,i.jsx)(a.Path,{fill:"#0e87a0",d:"M323.375 352.25H275.25C269.86 352.25 265.625 348.015 265.625 342.625C265.625 337.235 269.86 333 275.25 333H323.375C328.765 333 333 337.235 333 342.625C333 348.015 328.765 352.25 323.375 352.25Z"})]})})}return(0,i.jsx)("div",{className:"tsc-product-icon",children:(0,i.jsxs)(a.SVG,{fill:"none",height:"256",viewBox:"0 0 256 256",width:"256",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsxs)(a.G,{clipPath:(0,r.sprintf)("url(#%s-a)",s),children:[(0,i.jsx)("mask",{height:"256",id:(0,r.sprintf)("%s-b",s),maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},width:"256",x:"0",y:"0",children:(0,i.jsx)(a.Path,{d:"M0 0h256v256H0z",fill:"#fff"})}),(0,i.jsxs)(a.G,{mask:(0,r.sprintf)("url(#%s-b)",s),children:[(0,i.jsx)(a.Rect,{fill:"#FCEBD8",height:"256",rx:"10.24",width:"256",x:"-.296"}),(0,i.jsxs)(a.G,{clipPath:(0,r.sprintf)("url(#%s-c)",s),children:[(0,i.jsx)(a.Path,{d:"M81.86 202.714c-4.212-5.711-9.207-10.766-14.743-15.179L10.774 194a120.343 120.343 0 0 0 19.781 9.306l.156.057c9.356 3.391 18.15 8.218 25.745 14.647 20.947 17.728 49.576 24.847 76.933 18.099-20.629-4.497-39.01-16.421-51.529-33.395ZM184.644 94.535c7.905 0 15.05 2.449 20.245 6.396-2.678-9.353-9.32-17.45-18.663-21.637-18.175-8.145-39.105.935-45.795 19.315-3.232 8.313-5.907 22.207-5.907 22.207l-.01.003a31.663 31.663 0 0 1 13.381 12.506c3.764 6.46 4.956 13.483 4.08 20.112l16.993-10.72c3.04-1.918 2.786-6.373-.407-8.023-7.636-3.946-12.656-10.622-12.656-18.198 0-12.128 12.867-21.96 28.739-21.96Z",fill:"#111"}),(0,i.jsx)(a.Path,{d:"m112.219 157.765-79.112 13.21",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,i.jsx)(a.Path,{d:"M147.895 133.326c-9.345-16.041-30.373-20.725-45.642-10.166l-30.074 20.796c2.197 4.576 9.653 6.09 18.016 4.029-.672 1.9-.731 3.753-.054 5.411 2.01 4.922 9.842 6.537 18.577 4.271-.736 1.967-.826 3.888-.126 5.602 2.208 5.403 11.432 6.823 21.164 3.495-1.22 2.397-1.527 4.777-.679 6.852.845 2.069 2.721 3.55 5.258 4.408 15.986-7.75 23.236-28.09 13.56-44.698Z",fill:"#111"}),(0,i.jsx)(a.Path,{d:"m46.684 211.546-59.718 23.285c-9.123 3.557-15.71-8.949-7.618-14.461l34.97-23.818M145.995 232.995l14.599 28.633M120.83 238.624l11.729 23.004",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,i.jsx)(a.Path,{d:"M15.902 196.848a120.77 120.77 0 0 0 14.653 6.458l.156.057c9.356 3.391 18.149 8.218 25.744 14.646 25.087 21.233 61.194 27.253 92.936 12.452 32.427-15.121 51.137-47.701 50.164-81.328-.264-9.138 1.122-18.257 4.393-26.793a34.657 34.657 0 0 0 1.162-3.619c4.162-15.903-3.882-32.705-18.884-39.427-18.175-8.145-39.105.935-45.795 19.315l-6.662 20.343",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"}),(0,i.jsx)(a.Path,{d:"m206.525 101.23 15.166 7.023-15.489 7.744M-2.372 195.508l104.625-72.348c15.269-10.559 36.297-5.876 45.642 10.165 11.57 19.86-1.059 45.063-23.893 47.683l-126.374 14.5Z",stroke:"#111",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"10.333"})]})]})]}),(0,i.jsxs)("defs",{children:[(0,i.jsx)("clipPath",{id:(0,r.sprintf)("%s-a",s),children:(0,i.jsx)(a.Path,{d:"M0 0h256v256H0z",fill:"#fff"})}),(0,i.jsx)("clipPath",{id:(0,r.sprintf)("%s-c",s),children:(0,i.jsx)(a.Path,{fill:"#fff",transform:"translate(-29.31 40.96)",d:"M0 0h256v256H0z"})})]})]})})};n.propTypes={slug:s.string.isRequired};const l=({actions:e,children:s,pageTitle:t,product:r,width:a="full"})=>{const{key:l,type:o}=r,{slug:c}=window.teydeaStudio[l][o];return(0,i.jsxs)("div",{className:"tsc-settings-container",children:[(0,i.jsxs)("header",{className:"tsc-settings-container__header",children:[(0,i.jsx)(n,{slug:c}),(0,i.jsx)("h1",{children:t}),(0,i.jsx)("div",{className:"tsc-settings-container__actions",children:e})]}),(0,i.jsx)("div",{className:`tsc-settings-container__container tsc-settings-container__container--${a}-width`,children:s})]})};l.propTypes={actions:s.element.isRequired,children:s.element.isRequired,pageTitle:s.string.isRequired,product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,width:s.oneOf(["full","wide"])};const o=window.wp.components,c=window.wp.hooks,d=window.wp.url,u=({product:s,settings:t=null,helpLinks:a=null})=>{const{key:n,type:l}=s,d=a??window.teydeaStudio[n].settingsPage.helpLinks,{slug:u}=window.teydeaStudio[n][l];return(0,i.jsxs)("div",{className:"tsc-settings-sidebar",children:[(0,i.jsxs)(o.Panel,{children:[0<d.length&&(0,i.jsx)(o.PanelBody,{title:(0,r.__)("Help & support","password-requirements"),className:"tsc-settings-sidebar__panel",children:(0,i.jsx)("ul",{children:d.map(({url:e,title:s},t)=>(0,i.jsx)("li",{children:(0,i.jsx)("a",{href:e,target:"_blank",rel:"noreferrer noopener",children:s})},t))})}),(0,c.applyFilters)("password_requirements__upsell_panel",(0,i.jsx)(e.Fragment,{})),(0,c.applyFilters)("password_requirements__promoted_plugins_panel",(0,i.jsx)(e.Fragment,{})),(0,i.jsxs)(o.PanelBody,{className:"tsc-settings-sidebar__panel",initialOpen:!1,title:(0,r.__)("Write a review","password-requirements"),children:[(0,i.jsx)("p",{children:(0,r.sprintf)(
    22// Translators: %s - either "plugin" or "theme".
    33// Translators: %s - either "plugin" or "theme".
    4 (0,a.__)("If you like this %s, share it with your network and write a review on WordPress.org to help others find it. Thank you!","password-requirements"),i)}),(0,n.jsx)("a",{className:"components-button is-secondary is-compact",href:`https://wordpress.org/support/${i}/${o}/reviews/#new-post`,rel:"noopener noreferrer",target:"_blank",children:(0,a.__)("Write a review","password-requirements")})]}),(0,n.jsxs)(c.PanelBody,{className:"tsc-settings-sidebar__panel",initialOpen:!1,title:(0,a.__)("Share your feedback","password-requirements"),children:[(0,n.jsx)("p",{children:(0,a.__)("We're eager to hear your feedback, feature requests, suggestions for improvements etc; we're waiting for a message from you!","password-requirements")}),(0,n.jsx)("a",{className:"components-button is-secondary is-compact",href:"https://teydeastudio.com/contact/",rel:"noopener noreferrer",target:"_blank",children:(0,a.__)("Contact us","password-requirements")})]})]}),(0,d.applyFilters)("password_requirements__after_sidebar_panel",(0,n.jsx)(e.Fragment,{}),t)]})};h.propTypes={product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,settings:s.object.isRequired};const p=e=>"string"!=typeof e||""===e?"":(0,u.cleanForSlug)(e),m=()=>"undefined"!=typeof window&&window.location?p(window.location.hash.replace(/^#/,"")):"",g=(e,s)=>{if(""!==s&&Array.isArray(e))return e.find(e=>{const t=p(e?.name);return""!==t&&t===s})},w=({product:s,settings:t,setSettings:r})=>{const a=(0,e.useMemo)(()=>(0,d.applyFilters)("password_requirements__settings_page_tabs",[],t,r),[t,r]),[i,l]=(0,e.useState)(()=>g(a,m())?.name),[o,u]=(0,e.useState)(0),w=(0,e.useRef)(i);w.current=i,(0,e.useEffect)(()=>{if("undefined"==typeof window)return;const e=()=>{const e=g(a,m())?.name;e!==w.current&&(l(e),u(e=>e+1))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[a]);const f=(0,e.useCallback)(e=>{if(l(e),"undefined"==typeof window||!window.history)return;const s=p(e);if(""===s)return void(""!==window.location.hash&&window.history.replaceState(null,"",window.location.pathname+window.location.search));const t=`#${s}`;window.location.hash!==t&&window.history.replaceState(null,"",t)},[]);return(0,n.jsxs)("div",{className:"tsc-settings-tabs",children:[(0,n.jsx)(c.TabPanel,{initialTabName:i,onSelect:f,tabs:a,className:"tsc-settings-tabs__wrapper",children:s=>(0,n.jsx)(e.Fragment,{children:s.component},s.name)},o),(0,n.jsx)(h,{product:s,settings:t})]})};w.propTypes={product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,settings:s.object.isRequired,setSettings:s.func.isRequired};const f=({url:e,benefits:s})=>{const t="ts-upsell-panel-icon";return(0,n.jsxs)(c.PanelBody,{title:(0,a.__)("Buy the PRO version","password-requirements"),className:"tsc-upsell-panel",children:[0<s.length&&(0,n.jsx)("ul",{children:s.map((e,s)=>(0,n.jsx)("li",{children:e},s))}),(0,n.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"512",height:"512",viewBox:"0 0 511.958 511.958",className:"tsc-upsell-panel__background-icon",children:[(0,n.jsxs)("linearGradient",{id:(0,a.sprintf)("%s-a",t),x1:"255.979",x2:"255.979",y1:"511.958",y2:"0",gradientUnits:"userSpaceOnUse",children:[(0,n.jsx)("stop",{offset:"0",stopColor:"#fd5900"}),(0,n.jsx)("stop",{offset:"1",stopColor:"#ffde00"})]}),(0,n.jsx)(i.Path,{fill:(0,a.sprintf)("url(#%s-a)",t),d:"M255.979 74.979c-99.371 0-181 81.651-181 181 0 99.371 81.651 181 181 181 99.371 0 181-81.651 181-181 0-99.371-81.652-181-181-181zm0 332c-83.262 0-151-67.738-151-151s67.738-151 151-151 151 67.738 151 151-67.739 151-151 151zM507.1 276.466c6.477-12.829 6.477-28.146 0-40.975l-6.707-13.285a15.376 15.376 0 0 1-1.478-9.328l2.273-14.707c2.196-14.202-2.537-28.77-12.662-38.969l-10.483-10.562a15.369 15.369 0 0 1-4.288-8.416l-2.382-14.69c-2.276-14.028-11.105-26.302-23.66-32.927 0 0-13.402-7.895-13.66-8.027a15.359 15.359 0 0 1-6.677-6.678l-6.806-13.234c-6.417-12.48-19.502-21.709-34.149-24.085l-14.689-2.382a15.38 15.38 0 0 1-8.416-4.287L352.755 23.43c-10.199-10.124-24.764-14.854-38.968-12.662l-14.707 2.273a15.369 15.369 0 0 1-9.329-1.477l-13.285-6.707c-12.828-6.476-28.145-6.477-40.973 0l-13.286 6.707a15.394 15.394 0 0 1-9.328 1.478l-14.707-2.273c-14.205-2.197-28.77 2.538-38.969 12.662L148.64 33.914a15.369 15.369 0 0 1-8.415 4.288l-14.691 2.382c-14.646 2.376-27.731 11.604-34.148 24.085l-6.805 13.234a15.369 15.369 0 0 1-6.679 6.678l-13.235 6.806c-12.48 6.417-21.709 19.502-24.084 34.148L38.2 140.226a15.366 15.366 0 0 1-4.288 8.415L23.43 159.203c-10.124 10.199-14.857 24.766-12.662 38.968l2.274 14.708a15.36 15.36 0 0 1-1.478 9.327l-6.707 13.285c-6.476 12.828-6.476 28.145 0 40.974l6.707 13.285a15.376 15.376 0 0 1 1.478 9.328l-2.274 14.708c-2.195 14.202 2.539 28.769 12.662 38.968l10.484 10.563a15.365 15.365 0 0 1 4.288 8.416l2.383 14.689c2.375 14.647 11.604 27.732 24.084 34.149l13.234 6.805a15.371 15.371 0 0 1 6.679 6.679l6.805 13.235c6.418 12.48 19.503 21.709 34.149 24.084l14.69 2.383a15.374 15.374 0 0 1 8.415 4.287l10.563 10.485c10.201 10.124 24.767 14.854 38.968 12.661l14.708-2.274a15.367 15.367 0 0 1 9.327 1.478l13.286 6.707a45.47 45.47 0 0 0 20.486 4.857 45.471 45.471 0 0 0 20.487-4.857l13.285-6.707a15.386 15.386 0 0 1 9.328-1.478l14.707 2.273c14.202 2.194 28.769-2.538 38.969-12.662l10.562-10.484a15.368 15.368 0 0 1 8.416-4.288l14.689-2.383c14.028-2.275 26.303-11.104 32.928-23.66 0 0 7.895-13.402 8.027-13.66a15.372 15.372 0 0 1 6.678-6.678l13.234-6.805c12.78-6.571 21.784-18.963 24.085-33.149l2.382-14.689a15.375 15.375 0 0 1 4.288-8.416c.159-.16.314-.324.465-.491l10.281-11.337c9.943-10.186 14.576-24.624 12.399-38.702l-2.273-14.707a15.371 15.371 0 0 1 1.477-9.329zm-26.78-13.52-6.707 13.284c-4.3 8.517-5.802 18.002-4.345 27.432l2.274 14.708a15.512 15.512 0 0 1-4.306 13.25c-.159.16-.314.324-.466.491l-10.279 11.335c-6.573 6.729-10.84 15.186-12.349 24.482l-2.382 14.689a15.514 15.514 0 0 1-8.19 11.272l-13.235 6.806c-8.343 4.291-15.048 10.928-19.417 19.215 0 0-7.894 13.401-8.026 13.659a15.513 15.513 0 0 1-11.272 8.189l-14.69 2.383a45.208 45.208 0 0 0-24.747 12.609l-10.562 10.484a15.53 15.53 0 0 1-13.251 4.306l-14.707-2.273a45.187 45.187 0 0 0-27.433 4.345l-13.284 6.707a15.518 15.518 0 0 1-13.934 0l-13.285-6.707c-6.406-3.234-13.359-4.886-20.424-4.886-2.329 0-4.67.179-7.008.541l-14.708 2.274a15.522 15.522 0 0 1-13.25-4.305l-10.562-10.484a45.205 45.205 0 0 0-24.746-12.609l-14.691-2.383c-5.26-.853-10.191-4.144-12.271-8.189l-6.806-13.235a45.212 45.212 0 0 0-19.639-19.639l-13.235-6.805c-4.045-2.08-7.336-7.012-8.189-12.272l-2.383-14.689a45.2 45.2 0 0 0-12.609-24.748L44.722 331.62a15.518 15.518 0 0 1-4.306-13.251l2.273-14.707a45.195 45.195 0 0 0-4.345-27.433l-6.707-13.284a15.515 15.515 0 0 1 0-13.934l6.707-13.284c4.3-8.518 5.803-18.004 4.345-27.432l-2.273-14.707a15.513 15.513 0 0 1 4.306-13.251l10.483-10.562c6.722-6.772 11.083-15.33 12.609-24.747l2.383-14.691c.853-5.26 4.144-10.191 8.189-12.271l13.234-6.806c8.485-4.362 15.276-11.153 19.64-19.639l6.805-13.235c2.08-4.045 7.012-7.337 12.272-8.19l14.691-2.382a45.205 45.205 0 0 0 24.746-12.609l10.562-10.483a15.528 15.528 0 0 1 13.251-4.306l14.708 2.274c9.429 1.456 18.915-.045 27.432-4.345l13.285-6.707a15.52 15.52 0 0 1 13.933 0l13.284 6.707c8.517 4.3 18.002 5.801 27.432 4.345l14.708-2.274c4.83-.742 9.783.863 13.25 4.305l10.562 10.484a45.198 45.198 0 0 0 24.747 12.609l14.689 2.382c5.261.853 10.192 4.145 12.272 8.19l6.806 13.234c4.29 8.343 10.928 15.049 19.215 19.418 0 0 13.401 7.894 13.659 8.026a15.513 15.513 0 0 1 8.189 11.272l2.382 14.69a45.215 45.215 0 0 0 12.609 24.747l10.484 10.562a15.52 15.52 0 0 1 4.306 13.251l-2.274 14.708c-1.457 9.43.045 18.916 4.345 27.432l6.707 13.285a15.514 15.514 0 0 1 .003 13.935zm-128.25-65.674a15.003 15.003 0 0 0-18.544 5.345c-3.314 4.935-18.551 23.363-32.547 23.363-2.484 0-10.18-5.782-18.108-23.656-7.113-16.035-11.892-36.668-11.892-51.344 0-8.284-6.716-15-15-15s-15 6.716-15 15c0 14.676-4.779 35.309-11.892 51.344-7.929 17.874-15.624 23.656-18.108 23.656-13.593 0-28.442-17.329-32.547-23.363a15.001 15.001 0 0 0-27.005 12.001l30 120a14.98 14.98 0 0 0 14.552 11.352h120a14.98 14.98 0 0 0 14.552-11.352l30-120a15 15 0 0 0-8.461-17.346zm-47.803 118.707H207.69L191.7 252.02c5.935 2.433 12.399 3.959 19.278 3.959 19.695 0 34.849-17.85 45-40.094 10.151 22.244 25.305 40.094 45 40.094 6.879 0 13.343-1.527 19.278-3.959z"})]}),(0,n.jsx)("p",{children:(0,n.jsx)("a",{href:e,target:"_blank",rel:"noreferrer noopener",className:"components-button is-primary is-compact",children:(0,a.sprintf)("%s →",(0,a.__)("Buy the PRO version","password-requirements"))})})]})};f.propTypes={url:s.string.isRequired,benefits:s.arrayOf(s.string).isRequired};const x=window.wp.apiFetch;var _=t.n(x);const y=window.wp.compose,j=({message:e,isCentered:s=!1,withPadding:t=!1})=>{const r=["tsc-waiting-indicator"];return s&&r.push("tsc-waiting-indicator--centered"),t&&r.push("tsc-waiting-indicator--with-padding"),(0,n.jsxs)("div",{className:r.join(" "),children:[(0,n.jsx)(c.Spinner,{}),(0,n.jsx)("p",{children:e})]})};j.propTypes={message:s.string.isRequired,isCentered:s.bool,withPadding:s.bool};const v=(e,s)=>{switch(s.type){case"fetchedSettings":return{...e,settings:s.settings,hasFetchedSettings:!0,isSettingsFetchFailed:!1};case"settingsFetchFailed":return{...e,hasFetchedSettings:!0,isSettingsFetchFailed:!0};case"saveSettings":return{...e,isSavingSettings:!0};case"settingsSaved":return{...e,notices:[...e.notices,{id:`n:${Date.now().toString()}`,status:"success",content:(0,a.__)("Settings saved","password-requirements"),isDismissible:!0,explicitDismiss:!1}],isSavingSettings:!1};case"settingsSaveFailed":{let t=(0,a.__)("Settings were not saved, something went wrong.","password-requirements");return"Invalid parameter(s): settings"===s.error.message&&"string"==typeof s.error?.data?.params?.settings&&(t=(0,a.sprintf)(
     4(0,r.__)("If you like this %s, share it with your network and write a review on WordPress.org to help others find it. Thank you!","password-requirements"),l)}),(0,i.jsx)("a",{className:"components-button is-secondary is-compact",href:`https://wordpress.org/support/${l}/${u}/reviews/#new-post`,rel:"noopener noreferrer",target:"_blank",children:(0,r.__)("Write a review","password-requirements")})]}),(0,i.jsxs)(o.PanelBody,{className:"tsc-settings-sidebar__panel",initialOpen:!1,title:(0,r.__)("Share your feedback","password-requirements"),children:[(0,i.jsx)("p",{children:(0,r.__)("We're eager to hear your feedback, feature requests, suggestions for improvements etc; we're waiting for a message from you!","password-requirements")}),(0,i.jsx)("a",{className:"components-button is-secondary is-compact",href:"https://teydeastudio.com/contact/",rel:"noopener noreferrer",target:"_blank",children:(0,r.__)("Contact us","password-requirements")})]})]}),(0,c.applyFilters)("password_requirements__after_sidebar_panel",(0,i.jsx)(e.Fragment,{}),t)]})};u.propTypes={product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,settings:s.object,helpLinks:s.arrayOf(s.shape({url:s.string.isRequired,title:s.string.isRequired}))};const p=e=>"string"!=typeof e||""===e?"":(0,d.cleanForSlug)(e),h=()=>"undefined"!=typeof window&&window.location?p(window.location.hash.replace(/^#/,"")):"",m=(e,s)=>{if(""!==s&&Array.isArray(e))return e.find(e=>{const t=p(e?.name);return""!==t&&t===s})},g=({product:s,settings:t,setSettings:r})=>{const a=(0,e.useMemo)(()=>(0,c.applyFilters)("password_requirements__settings_page_tabs",[],t,r),[t,r]),[n,l]=(0,e.useState)(()=>m(a,h())?.name),[d,g]=(0,e.useState)(0),w=(0,e.useRef)(n);w.current=n,(0,e.useEffect)(()=>{if("undefined"==typeof window)return;const e=()=>{const e=m(a,h())?.name;e!==w.current&&(l(e),g(e=>e+1))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[a]);const x=(0,e.useCallback)(e=>{if(l(e),"undefined"==typeof window||!window.history)return;const s=p(e);if(""===s)return void(""!==window.location.hash&&window.history.replaceState(null,"",window.location.pathname+window.location.search));const t=`#${s}`;window.location.hash!==t&&window.history.replaceState(null,"",t)},[]);return(0,i.jsxs)("div",{className:"tsc-settings-tabs",children:[(0,i.jsx)(o.TabPanel,{initialTabName:n,onSelect:x,tabs:a,className:"tsc-settings-tabs__wrapper",children:s=>(0,i.jsx)(e.Fragment,{children:s.component},s.name)},d),(0,i.jsx)(u,{product:s,settings:t})]})};g.propTypes={product:s.shape({key:s.string.isRequired,type:s.oneOf(["plugin","theme"])}).isRequired,settings:s.object.isRequired,setSettings:s.func.isRequired};const w=({url:e,benefits:s})=>{const t="ts-upsell-panel-icon";return(0,i.jsxs)(o.PanelBody,{title:(0,r.__)("Buy the PRO version","password-requirements"),className:"tsc-upsell-panel",children:[0<s.length&&(0,i.jsx)("ul",{children:s.map((e,s)=>(0,i.jsx)("li",{children:e},s))}),(0,i.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"512",height:"512",viewBox:"0 0 511.958 511.958",className:"tsc-upsell-panel__background-icon",children:[(0,i.jsxs)("linearGradient",{id:(0,r.sprintf)("%s-a",t),x1:"255.979",x2:"255.979",y1:"511.958",y2:"0",gradientUnits:"userSpaceOnUse",children:[(0,i.jsx)("stop",{offset:"0",stopColor:"#fd5900"}),(0,i.jsx)("stop",{offset:"1",stopColor:"#ffde00"})]}),(0,i.jsx)(a.Path,{fill:(0,r.sprintf)("url(#%s-a)",t),d:"M255.979 74.979c-99.371 0-181 81.651-181 181 0 99.371 81.651 181 181 181 99.371 0 181-81.651 181-181 0-99.371-81.652-181-181-181zm0 332c-83.262 0-151-67.738-151-151s67.738-151 151-151 151 67.738 151 151-67.739 151-151 151zM507.1 276.466c6.477-12.829 6.477-28.146 0-40.975l-6.707-13.285a15.376 15.376 0 0 1-1.478-9.328l2.273-14.707c2.196-14.202-2.537-28.77-12.662-38.969l-10.483-10.562a15.369 15.369 0 0 1-4.288-8.416l-2.382-14.69c-2.276-14.028-11.105-26.302-23.66-32.927 0 0-13.402-7.895-13.66-8.027a15.359 15.359 0 0 1-6.677-6.678l-6.806-13.234c-6.417-12.48-19.502-21.709-34.149-24.085l-14.689-2.382a15.38 15.38 0 0 1-8.416-4.287L352.755 23.43c-10.199-10.124-24.764-14.854-38.968-12.662l-14.707 2.273a15.369 15.369 0 0 1-9.329-1.477l-13.285-6.707c-12.828-6.476-28.145-6.477-40.973 0l-13.286 6.707a15.394 15.394 0 0 1-9.328 1.478l-14.707-2.273c-14.205-2.197-28.77 2.538-38.969 12.662L148.64 33.914a15.369 15.369 0 0 1-8.415 4.288l-14.691 2.382c-14.646 2.376-27.731 11.604-34.148 24.085l-6.805 13.234a15.369 15.369 0 0 1-6.679 6.678l-13.235 6.806c-12.48 6.417-21.709 19.502-24.084 34.148L38.2 140.226a15.366 15.366 0 0 1-4.288 8.415L23.43 159.203c-10.124 10.199-14.857 24.766-12.662 38.968l2.274 14.708a15.36 15.36 0 0 1-1.478 9.327l-6.707 13.285c-6.476 12.828-6.476 28.145 0 40.974l6.707 13.285a15.376 15.376 0 0 1 1.478 9.328l-2.274 14.708c-2.195 14.202 2.539 28.769 12.662 38.968l10.484 10.563a15.365 15.365 0 0 1 4.288 8.416l2.383 14.689c2.375 14.647 11.604 27.732 24.084 34.149l13.234 6.805a15.371 15.371 0 0 1 6.679 6.679l6.805 13.235c6.418 12.48 19.503 21.709 34.149 24.084l14.69 2.383a15.374 15.374 0 0 1 8.415 4.287l10.563 10.485c10.201 10.124 24.767 14.854 38.968 12.661l14.708-2.274a15.367 15.367 0 0 1 9.327 1.478l13.286 6.707a45.47 45.47 0 0 0 20.486 4.857 45.471 45.471 0 0 0 20.487-4.857l13.285-6.707a15.386 15.386 0 0 1 9.328-1.478l14.707 2.273c14.202 2.194 28.769-2.538 38.969-12.662l10.562-10.484a15.368 15.368 0 0 1 8.416-4.288l14.689-2.383c14.028-2.275 26.303-11.104 32.928-23.66 0 0 7.895-13.402 8.027-13.66a15.372 15.372 0 0 1 6.678-6.678l13.234-6.805c12.78-6.571 21.784-18.963 24.085-33.149l2.382-14.689a15.375 15.375 0 0 1 4.288-8.416c.159-.16.314-.324.465-.491l10.281-11.337c9.943-10.186 14.576-24.624 12.399-38.702l-2.273-14.707a15.371 15.371 0 0 1 1.477-9.329zm-26.78-13.52-6.707 13.284c-4.3 8.517-5.802 18.002-4.345 27.432l2.274 14.708a15.512 15.512 0 0 1-4.306 13.25c-.159.16-.314.324-.466.491l-10.279 11.335c-6.573 6.729-10.84 15.186-12.349 24.482l-2.382 14.689a15.514 15.514 0 0 1-8.19 11.272l-13.235 6.806c-8.343 4.291-15.048 10.928-19.417 19.215 0 0-7.894 13.401-8.026 13.659a15.513 15.513 0 0 1-11.272 8.189l-14.69 2.383a45.208 45.208 0 0 0-24.747 12.609l-10.562 10.484a15.53 15.53 0 0 1-13.251 4.306l-14.707-2.273a45.187 45.187 0 0 0-27.433 4.345l-13.284 6.707a15.518 15.518 0 0 1-13.934 0l-13.285-6.707c-6.406-3.234-13.359-4.886-20.424-4.886-2.329 0-4.67.179-7.008.541l-14.708 2.274a15.522 15.522 0 0 1-13.25-4.305l-10.562-10.484a45.205 45.205 0 0 0-24.746-12.609l-14.691-2.383c-5.26-.853-10.191-4.144-12.271-8.189l-6.806-13.235a45.212 45.212 0 0 0-19.639-19.639l-13.235-6.805c-4.045-2.08-7.336-7.012-8.189-12.272l-2.383-14.689a45.2 45.2 0 0 0-12.609-24.748L44.722 331.62a15.518 15.518 0 0 1-4.306-13.251l2.273-14.707a45.195 45.195 0 0 0-4.345-27.433l-6.707-13.284a15.515 15.515 0 0 1 0-13.934l6.707-13.284c4.3-8.518 5.803-18.004 4.345-27.432l-2.273-14.707a15.513 15.513 0 0 1 4.306-13.251l10.483-10.562c6.722-6.772 11.083-15.33 12.609-24.747l2.383-14.691c.853-5.26 4.144-10.191 8.189-12.271l13.234-6.806c8.485-4.362 15.276-11.153 19.64-19.639l6.805-13.235c2.08-4.045 7.012-7.337 12.272-8.19l14.691-2.382a45.205 45.205 0 0 0 24.746-12.609l10.562-10.483a15.528 15.528 0 0 1 13.251-4.306l14.708 2.274c9.429 1.456 18.915-.045 27.432-4.345l13.285-6.707a15.52 15.52 0 0 1 13.933 0l13.284 6.707c8.517 4.3 18.002 5.801 27.432 4.345l14.708-2.274c4.83-.742 9.783.863 13.25 4.305l10.562 10.484a45.198 45.198 0 0 0 24.747 12.609l14.689 2.382c5.261.853 10.192 4.145 12.272 8.19l6.806 13.234c4.29 8.343 10.928 15.049 19.215 19.418 0 0 13.401 7.894 13.659 8.026a15.513 15.513 0 0 1 8.189 11.272l2.382 14.69a45.215 45.215 0 0 0 12.609 24.747l10.484 10.562a15.52 15.52 0 0 1 4.306 13.251l-2.274 14.708c-1.457 9.43.045 18.916 4.345 27.432l6.707 13.285a15.514 15.514 0 0 1 .003 13.935zm-128.25-65.674a15.003 15.003 0 0 0-18.544 5.345c-3.314 4.935-18.551 23.363-32.547 23.363-2.484 0-10.18-5.782-18.108-23.656-7.113-16.035-11.892-36.668-11.892-51.344 0-8.284-6.716-15-15-15s-15 6.716-15 15c0 14.676-4.779 35.309-11.892 51.344-7.929 17.874-15.624 23.656-18.108 23.656-13.593 0-28.442-17.329-32.547-23.363a15.001 15.001 0 0 0-27.005 12.001l30 120a14.98 14.98 0 0 0 14.552 11.352h120a14.98 14.98 0 0 0 14.552-11.352l30-120a15 15 0 0 0-8.461-17.346zm-47.803 118.707H207.69L191.7 252.02c5.935 2.433 12.399 3.959 19.278 3.959 19.695 0 34.849-17.85 45-40.094 10.151 22.244 25.305 40.094 45 40.094 6.879 0 13.343-1.527 19.278-3.959z"})]}),(0,i.jsx)("p",{children:(0,i.jsx)("a",{href:e,target:"_blank",rel:"noreferrer noopener",className:"components-button is-primary is-compact",children:(0,r.sprintf)("%s →",(0,r.__)("Buy the PRO version","password-requirements"))})})]})};w.propTypes={url:s.string.isRequired,benefits:s.arrayOf(s.string).isRequired};const x=window.wp.apiFetch,f=window.wp.compose,_=({message:e,isCentered:s=!1,withPadding:t=!1})=>{const r=["tsc-waiting-indicator"];return s&&r.push("tsc-waiting-indicator--centered"),t&&r.push("tsc-waiting-indicator--with-padding"),(0,i.jsxs)("div",{className:r.join(" "),children:[(0,i.jsx)(o.Spinner,{}),(0,i.jsx)("p",{children:e})]})};_.propTypes={message:s.string.isRequired,isCentered:s.bool,withPadding:s.bool};const y=(e,s)=>{switch(s.type){case"fetchedSettings":return{...e,settings:s.settings,hasFetchedSettings:!0,isSettingsFetchFailed:!1};case"settingsFetchFailed":return{...e,hasFetchedSettings:!0,isSettingsFetchFailed:!0};case"saveSettings":return{...e,isSavingSettings:!0};case"settingsSaved":return{...e,notices:[...e.notices,{id:`n:${Date.now().toString()}`,status:"success",content:(0,r.__)("Settings saved","password-requirements"),isDismissible:!0,explicitDismiss:!1}],isSavingSettings:!1};case"settingsSaveFailed":{let t=(0,r.__)("Settings were not saved, something went wrong.","password-requirements");return"Invalid parameter(s): settings"===s.error.message&&"string"==typeof s.error?.data?.params?.settings&&(t=(0,r.sprintf)(
    55// Translators: %s - error message.
    66// Translators: %s - error message.
    7 (0,a.__)("Settings were not saved due to validation error: %s Please update the invalid field value and try again.","password-requirements"),s.error.data.params.settings)),{...e,notices:[...e.notices,{id:`n:${Date.now().toString()}`,status:"error",content:t,isDismissible:!0,explicitDismiss:!1}],isSavingSettings:!1}}case"settingsChanged":{const t=(0,d.applyFilters)("password_requirements__pre_change_settings",s.settings);return{...e,settings:t}}case"noticeRemoved":return{...e,notices:[...e.notices.filter(e=>e.id!==s.noticeId)]}}return e},b=(0,y.createHigherOrderComponent)(s=>t=>{const{product:r,LoadingContainer:i}=t,{key:l,type:o}=r,{slug:u}=window.teydeaStudio[l][o],{nonce:h}=window.teydeaStudio[l].settingsPage,[p,m]=(0,e.useReducer)(v,{notices:[],settings:{},hasFetchedSettings:!1,isSettingsFetchFailed:!1,isSavingSettings:!1});return(0,e.useEffect)(()=>{!0===p.isSavingSettings&&x({path:`/${u}/v1/settings`,method:"POST",data:{nonce:h,settings:p.settings}}).then(async e=>(m({type:"settingsSaved"}),await(d.doActionAsync??d.doAction)("password_requirements__settings_saved"),e)).catch(e=>{console.error(e),m({type:"settingsSaveFailed",error:e})})},[p.isSavingSettings]),(0,e.useEffect)(()=>{x({path:`/${u}/v1/settings`,method:"GET"}).then(e=>(m({type:"fetchedSettings",settings:e}),e)).catch(e=>{console.error(e),m({type:"settingsFetchFailed"})})},[]),!1===p.hasFetchedSettings?(0,n.jsx)(i,{children:(0,n.jsx)(j,{message:(0,a.__)("Loading…","password-requirements"),isCentered:!0,withPadding:!0})}):!0===p.isSettingsFetchFailed?(0,n.jsx)(i,{children:(0,n.jsxs)(c.Notice,{status:"error",isDismissible:!1,children:[(0,n.jsx)("p",{children:(0,a.__)("Settings fetch failed.","password-requirements")}),(0,n.jsx)("p",{children:(0,a.__)("Please try again; if the issue keeps repeating, reach out to our support team.","password-requirements")})]})}):(0,n.jsxs)("div",{className:"tsc-with-settings",children:[(0,n.jsx)(c.SnackbarList,{notices:p.notices,onRemove:e=>{m({type:"noticeRemoved",noticeId:e})}}),(0,n.jsx)(s,{...t,SaveSettingsButton:()=>(0,n.jsx)(c.Button,{__next40pxDefaultSize:!0,disabled:p.isSavingSettings||!p.hasFetchedSettings||p.isSettingsFetchFailed,isBusy:p.isSavingSettings,onClick:()=>{m({type:"saveSettings"})},variant:"primary",children:p.isSavingSettings?(0,a.__)("Saving…","password-requirements"):(0,a.__)("Save all settings","password-requirements")}),settings:p.settings,setSettings:e=>{m({type:"settingsChanged",settings:e})}})]})},"withSettings"),S=({children:e,className:s="",help:t="",label:r="",withBaseControl:a=!1,withBoxBorder:i=!1,withReducedGap:l=!1,withRowDirection:o=!1,...d})=>{let h=[s,"tsc-fields-group",l?"tsc-fields-group--with-reduced-gap":"",i?"tsc-fields-group--with-box-border":"",o?"tsc-fields-group--with-row-direction":""];if(h=h.filter(e=>""!==e),a){const{baseControlProps:s,controlProps:a}=(0,c.useBaseControlProps)({id:(p=(0,u.cleanForSlug)(r),`npm-components-fields-group-${p}`)});return(0,n.jsx)(c.BaseControl,{...s,__nextHasNoMarginBottom:!0,label:r,help:t,children:(0,n.jsx)("div",{...a,className:h.join(" "),...d,children:e})})}var p;return(0,n.jsx)("div",{className:h.join(" "),...d,children:e})};S.propTypes={children:s.element.isRequired,className:s.string,help:s.string,label:s.string,withBaseControl:s.bool,withBoxBorder:s.bool,withReducedGap:s.bool,withRowDirection:s.bool};const q=({settings:s,setSettings:t})=>{const r=Array.isArray(s.data?.general?.restrictedPhrases)?s.data.general.restrictedPhrases:[],i=Array.isArray(window.teydeaStudio?.passwordRequirements?.settingsPage?.runtimeRestrictedPhrases)?window.teydeaStudio.passwordRequirements.settingsPage.runtimeRestrictedPhrases:[];return(0,n.jsx)(c.Panel,{children:(0,n.jsx)(c.PanelBody,{title:(0,a.__)("Restricted words and phrases","password-requirements"),children:(0,n.jsxs)(S,{children:[(0,n.jsx)(c.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Words and phrases that user passwords cannot contain","password-requirements"),help:(0,a.__)('One entry per line. Matching is case-insensitive: a password is rejected if any entry appears anywhere inside it. Empty lines and lines that start with "#" are ignored. Use this to block site-specific tokens like your brand name, product names, your city, or a year token (for example: acme, summer, 2026).',"password-requirements"),rows:8,value:r.join("\n"),onChange:e=>{t({...s,data:{...s.data,general:{...s.data?.general??{},restrictedPhrases:e.split(/\r?\n/)}}})}}),0<i.length&&(0,n.jsxs)(c.Notice,{isDismissible:!1,status:"info",children:[(0,n.jsx)("p",{children:(0,a.__)("The following phrases are also blocked automatically — added by your site or by other plugins. They are not stored in the field above and cannot be edited from here:","password-requirements")}),(0,n.jsx)("p",{children:i.map((s,t)=>(0,n.jsxs)(e.Fragment,{children:[0<t&&", ",(0,n.jsx)("code",{children:s})]},s))})]})]})})})};q.propTypes={settings:r().object.isRequired,setSettings:r().func.isRequired};let C=0;const P=e=>" "===e?(0,a.__)("(space)","password-requirements"):"\t"===e?(0,a.__)("(tab)","password-requirements"):e,M=({help:e,label:s,onChange:t,value:r})=>{const{baseControlProps:a,controlProps:i}=(0,c.useBaseControlProps)({});return(0,n.jsxs)(c.BaseControl,{...a,__nextHasNoMarginBottom:!0,label:s,className:"tsc-character-token-control",children:[0<r.length&&(0,n.jsx)("div",{className:"tsc-character-token-control__characters-list",children:r.map((e,s)=>(0,n.jsx)(c.Button,{__next40pxDefaultSize:!0,size:"compact",variant:"secondary",onClick:()=>{const e=[...r];e.splice(s,1),t(e)},children:P(e)},`${e}-${s}`))}),(0,n.jsx)(c.TextControl,{...i,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:"",help:e,value:"",onChange:e=>{const s=[...e];1<s.length&&(e=s[s.length-1]),""!==e&&(r.includes(e)||t([...r,e]))}})]})};M.propTypes={help:s.string.isRequired,label:s.string.isRequired,onChange:s.func.isRequired,value:s.array.isRequired};const k=({message:e,id:s})=>(0,n.jsx)("div",{className:"tsc-field-notice",id:s,"aria-live":"polite",children:(0,n.jsx)("p",{children:e})});k.propTypes={message:s.string.isRequired,id:s.string};const R=(e,s,t)=>(e=""===e?s:Number.parseInt(e,10),(isNaN(e)||s>e)&&(e=s),null!==t&&t<e&&(e=t),e),N=(0,c.withFocusOutside)(class extends e.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}});N.propTypes={children:s.element.isRequired,onFocusOutside:s.func.isRequired};const A=({label:s,help:t,min:r,max:i,value:l,defaultValue:o,disabled:d=!1,onChange:u})=>{const[h,p]=(0,e.useState)(""),[m,g]=(0,e.useState)(l.toString()),w=(0,y.useInstanceId)(A,"tsc-integer-control"),f=`${w}-notice`,x=[t?`${w}__help`:null,""!==h?f:null].filter(Boolean).join(" ")||void 0;return(void 0===i||r>i)&&(i=null),(0,e.useEffect)(()=>{g(l.toString())},[l]),(0,e.useEffect)(()=>{m===R(m,r,i).toString()?p(""):p(null!==i?(0,a.sprintf)(
     7(0,r.__)("Settings were not saved due to validation error: %s Please update the invalid field value and try again.","password-requirements"),s.error.data.params.settings)),{...e,notices:[...e.notices,{id:`n:${Date.now().toString()}`,status:"error",content:t,isDismissible:!0,explicitDismiss:!1}],isSavingSettings:!1}}case"settingsChanged":{const t=(0,c.applyFilters)("password_requirements__pre_change_settings",s.settings);return{...e,settings:t}}case"noticeRemoved":return{...e,notices:[...e.notices.filter(e=>e.id!==s.noticeId)]}}return e},j=(0,f.createHigherOrderComponent)(s=>t=>{const{product:a,LoadingContainer:n}=t,{key:l,type:d}=a,{slug:u}=window.teydeaStudio[l][d],{nonce:p}=window.teydeaStudio[l].settingsPage,[h,m]=(0,e.useReducer)(y,{notices:[],settings:{},hasFetchedSettings:!1,isSettingsFetchFailed:!1,isSavingSettings:!1});return(0,e.useEffect)(()=>{!0===h.isSavingSettings&&x({path:`/${u}/v1/settings`,method:"POST",data:{nonce:p,settings:h.settings}}).then(async e=>(m({type:"settingsSaved"}),await(c.doActionAsync??c.doAction)("password_requirements__settings_saved"),e)).catch(e=>{console.error(e),m({type:"settingsSaveFailed",error:e})})},[h.isSavingSettings]),(0,e.useEffect)(()=>{x({path:`/${u}/v1/settings`,method:"GET"}).then(e=>(m({type:"fetchedSettings",settings:e}),e)).catch(e=>{console.error(e),m({type:"settingsFetchFailed"})})},[]),!1===h.hasFetchedSettings?(0,i.jsx)(n,{children:(0,i.jsx)(_,{message:(0,r.__)("Loading…","password-requirements"),isCentered:!0,withPadding:!0})}):!0===h.isSettingsFetchFailed?(0,i.jsx)(n,{children:(0,i.jsxs)(o.Notice,{status:"error",isDismissible:!1,children:[(0,i.jsx)("p",{children:(0,r.__)("Settings fetch failed.","password-requirements")}),(0,i.jsx)("p",{children:(0,r.__)("Please try again; if the issue keeps repeating, reach out to our support team.","password-requirements")})]})}):(0,i.jsxs)("div",{className:"tsc-with-settings",children:[(0,i.jsx)(o.SnackbarList,{notices:h.notices,onRemove:e=>{m({type:"noticeRemoved",noticeId:e})}}),(0,i.jsx)(s,{...t,SaveSettingsButton:()=>(0,i.jsx)(o.Button,{__next40pxDefaultSize:!0,disabled:h.isSavingSettings||!h.hasFetchedSettings||h.isSettingsFetchFailed,isBusy:h.isSavingSettings,onClick:()=>{m({type:"saveSettings"})},variant:"primary",children:h.isSavingSettings?(0,r.__)("Saving…","password-requirements"):(0,r.__)("Save all settings","password-requirements")}),settings:h.settings,setSettings:e=>{m({type:"settingsChanged",settings:e})}})]})},"withSettings"),v=({children:e,className:s="",help:t="",label:r="",withBaseControl:a=!1,withBoxBorder:n=!1,withReducedGap:l=!1,withRowDirection:c=!1,...u})=>{let p=[s,"tsc-fields-group",l?"tsc-fields-group--with-reduced-gap":"",n?"tsc-fields-group--with-box-border":"",c?"tsc-fields-group--with-row-direction":""];if(p=p.filter(e=>""!==e),a){const{baseControlProps:s,controlProps:a}=(0,o.useBaseControlProps)({id:(h=(0,d.cleanForSlug)(r),`npm-components-fields-group-${h}`)});return(0,i.jsx)(o.BaseControl,{...s,__nextHasNoMarginBottom:!0,label:r,help:t,children:(0,i.jsx)("div",{...a,className:p.join(" "),...u,children:e})})}var h;return(0,i.jsx)("div",{className:p.join(" "),...u,children:e})};v.propTypes={children:s.element.isRequired,className:s.string,help:s.string,label:s.string,withBaseControl:s.bool,withBoxBorder:s.bool,withReducedGap:s.bool,withRowDirection:s.bool};const b=({settings:s,setSettings:t})=>{const a=Array.isArray(s.data?.general?.restrictedPhrases)?s.data.general.restrictedPhrases:[],n=Array.isArray(window.teydeaStudio?.passwordRequirements?.settingsPage?.runtimeRestrictedPhrases)?window.teydeaStudio.passwordRequirements.settingsPage.runtimeRestrictedPhrases:[];return(0,i.jsx)(o.Panel,{children:(0,i.jsx)(o.PanelBody,{title:(0,r.__)("Restricted words and phrases","password-requirements"),children:(0,i.jsxs)(v,{children:[(0,i.jsx)(o.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Words and phrases that user passwords cannot contain","password-requirements"),help:(0,r.__)('One entry per line. Matching is case-insensitive: a password is rejected if any entry appears anywhere inside it. Empty lines and lines that start with "#" are ignored. Use this to block site-specific tokens like your brand name, product names, your city, or a year token (for example: acme, summer, 2026).',"password-requirements"),rows:8,value:a.join("\n"),onChange:e=>{t({...s,data:{...s.data,general:{...s.data?.general??{},restrictedPhrases:e.split(/\r?\n/)}}})}}),0<n.length&&(0,i.jsxs)(o.Notice,{isDismissible:!1,status:"info",children:[(0,i.jsx)("p",{children:(0,r.__)("The following phrases are also blocked automatically — added by your site or by other plugins. They are not stored in the field above and cannot be edited from here:","password-requirements")}),(0,i.jsx)("p",{children:n.map((s,t)=>(0,i.jsxs)(e.Fragment,{children:[0<t&&", ",(0,i.jsx)("code",{children:s})]},s))})]})]})})})};b.propTypes={settings:s.object.isRequired,setSettings:s.func.isRequired};let C=0;const S=e=>" "===e?(0,r.__)("(space)","password-requirements"):"\t"===e?(0,r.__)("(tab)","password-requirements"):e,q=({help:e,label:s,onChange:t,value:r})=>{const{baseControlProps:a,controlProps:n}=(0,o.useBaseControlProps)({});return(0,i.jsxs)(o.BaseControl,{...a,__nextHasNoMarginBottom:!0,label:s,className:"tsc-character-token-control",children:[0<r.length&&(0,i.jsx)("div",{className:"tsc-character-token-control__characters-list",children:r.map((e,s)=>(0,i.jsx)(o.Button,{__next40pxDefaultSize:!0,size:"compact",variant:"secondary",onClick:()=>{const e=[...r];e.splice(s,1),t(e)},children:S(e)},`${e}-${s}`))}),(0,i.jsx)(o.TextControl,{...n,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:"",help:e,value:"",onChange:e=>{const s=[...e];1<s.length&&(e=s[s.length-1]),""!==e&&(r.includes(e)||t([...r,e]))}})]})};q.propTypes={help:s.string.isRequired,label:s.string.isRequired,onChange:s.func.isRequired,value:s.array.isRequired};const P=({message:e,id:s})=>(0,i.jsx)("div",{className:"tsc-field-notice",id:s,"aria-live":"polite",children:(0,i.jsx)("p",{children:e})});P.propTypes={message:s.string.isRequired,id:s.string};const M=(e,s,t)=>(e=""===e?s:Number.parseInt(e,10),(isNaN(e)||s>e)&&(e=s),null!==t&&t<e&&(e=t),e),k=(0,o.withFocusOutside)(class extends e.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}});k.propTypes={children:s.element.isRequired,onFocusOutside:s.func.isRequired};const R=({label:s,help:t,min:a,max:n,value:l,defaultValue:c,disabled:d=!1,onChange:u})=>{const[p,h]=(0,e.useState)(""),[m,g]=(0,e.useState)(l.toString()),w=(0,f.useInstanceId)(R,"tsc-integer-control"),x=`${w}-notice`,_=[t?`${w}__help`:null,""!==p?x:null].filter(Boolean).join(" ")||void 0;return(void 0===n||a>n)&&(n=null),(0,e.useEffect)(()=>{g(l.toString())},[l]),(0,e.useEffect)(()=>{m===M(m,a,n).toString()?h(""):h(null!==n?(0,r.sprintf)(
    88// Translators: %1$s - field value, %2$d - minimum accepted value, %3$d - maximum accepted value.
    99// Translators: %1$s - field value, %2$d - minimum accepted value, %3$d - maximum accepted value.
    10 (0,a.__)('"%1$s" is not within the accepted range (%2$d-%3$d).',"password-requirements"),m,r,i):(0,a.sprintf)(
     10(0,r.__)('"%1$s" is not within the accepted range (%2$d-%3$d).',"password-requirements"),m,a,n):(0,r.sprintf)(
    1111// Translators: %1$s - field value, %2$d - minimum accepted value.
    1212// Translators: %1$s - field value, %2$d - minimum accepted value.
    13 (0,a.__)('"%1$s" must be greater than or equal to %2$d.',"password-requirements"),m,r))},[m,r,i]),(0,n.jsxs)("div",{className:"tsc-integer-control",children:[(0,n.jsx)(N,{onFocusOutside:()=>{if(d)return;const e=m===R(m,r,i).toString()?Number.parseInt(m,10):o;e!==l&&u(e),g(e.toString())},children:(0,n.jsx)(c.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,id:w,label:s,help:t,value:m,type:"number",disabled:d,"aria-describedby":x,onChange:e=>{g(""===e?"":Number.parseInt(e,10).toString())}})}),""!==h&&(0,n.jsx)(k,{id:f,message:h})]})};A.propTypes={label:s.string.isRequired,help:s.string,min:s.number.isRequired,max:s.number,value:s.number.isRequired,defaultValue:s.number.isRequired,disabled:s.bool,onChange:s.func.isRequired};const B=({children:e,title:s})=>(0,n.jsxs)("div",{className:"tsc-panel-section",children:[(0,n.jsx)("h2",{className:"tsc-panel-section__title",children:s}),(0,n.jsx)("div",{className:"tsc-panel-section__fields",children:e})]});B.propTypes={children:s.element.isRequired,title:s.string.isRequired};const T=window.wp.a11y,L=({data:s,onChange:t})=>{const r=R(s["ruleSettings.maximumConsecutiveUserSymbols"],0,50),i=!0===s.isActive&&!0===s["rules.complexity"]&&!0===s["ruleSettings.complexity.consecutiveUserSymbols"],l=Array.isArray(s["ruleSettings.restrictedCharacters"])?s["ruleSettings.restrictedCharacters"].join(""):"";return(0,n.jsx)("div",{className:"password-requirements-settings-tabs__container",children:(0,n.jsxs)(c.Panel,{header:(0,a.sprintf)("%1$s: %2$s",s.isActive?(0,a.__)("Policy","password-requirements"):(0,a.__)("Inactive Policy","password-requirements"),""===s.name?"-":s.name),children:[(0,n.jsx)(B,{title:(0,a.__)("General settings","password-requirements"),children:(0,n.jsxs)(S,{children:[(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Activate this policy","password-requirements"),help:(0,a.__)("You can deactivate any policy if you want to keep its settings but don't want to enforce it for users.","password-requirements"),checked:s.isActive,onChange:()=>{t({...s,isActive:!s.isActive})}}),(0,n.jsx)(c.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,a.__)("Policy name","password-requirements"),value:s.name,help:(0,a.__)("We suggest using a descriptive name.","password-requirements"),onChange:e=>{t({...s,name:e})}})]})}),(0,n.jsx)(B,{title:(0,a.__)("Enabled rules","password-requirements"),children:(0,n.jsxs)(S,{children:[(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Enforce the minimum password length","password-requirements"),help:(0,a.sprintf)(
     13(0,r.__)('"%1$s" must be greater than or equal to %2$d.',"password-requirements"),m,a))},[m,a,n]),(0,i.jsxs)("div",{className:"tsc-integer-control",children:[(0,i.jsx)(k,{onFocusOutside:()=>{if(d)return;const e=m===M(m,a,n).toString()?Number.parseInt(m,10):c;e!==l&&u(e),g(e.toString())},children:(0,i.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,id:w,label:s,help:t,value:m,type:"number",disabled:d,"aria-describedby":_,onChange:e=>{g(""===e?"":Number.parseInt(e,10).toString())}})}),""!==p&&(0,i.jsx)(P,{id:x,message:p})]})};R.propTypes={label:s.string.isRequired,help:s.string,min:s.number.isRequired,max:s.number,value:s.number.isRequired,defaultValue:s.number.isRequired,disabled:s.bool,onChange:s.func.isRequired};const N=({children:e,title:s})=>(0,i.jsxs)("div",{className:"tsc-panel-section",children:[(0,i.jsx)("h2",{className:"tsc-panel-section__title",children:s}),(0,i.jsx)("div",{className:"tsc-panel-section__fields",children:e})]});N.propTypes={children:s.element.isRequired,title:s.string.isRequired};const L=window.wp.a11y,H=({data:s,onChange:t})=>{const a=M(s["ruleSettings.maximumConsecutiveUserSymbols"],0,50),n=!0===s.isActive&&!0===s["rules.complexity"]&&!0===s["ruleSettings.complexity.consecutiveUserSymbols"],l=Array.isArray(s["ruleSettings.restrictedCharacters"])?s["ruleSettings.restrictedCharacters"].join(""):"";return(0,i.jsx)("div",{className:"password-requirements-settings-tabs__container",children:(0,i.jsxs)(o.Panel,{header:(0,r.sprintf)("%1$s: %2$s",s.isActive?(0,r.__)("Policy","password-requirements"):(0,r.__)("Inactive Policy","password-requirements"),""===s.name?"-":s.name),children:[(0,i.jsx)(N,{title:(0,r.__)("General settings","password-requirements"),children:(0,i.jsxs)(v,{children:[(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Activate this policy","password-requirements"),help:(0,r.__)("You can deactivate any policy if you want to keep its settings but don't want to enforce it for users.","password-requirements"),checked:s.isActive,onChange:()=>{t({...s,isActive:!s.isActive})}}),(0,i.jsx)(o.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,r.__)("Policy name","password-requirements"),value:s.name,help:(0,r.__)("We suggest using a descriptive name.","password-requirements"),onChange:e=>{t({...s,name:e})}})]})}),(0,i.jsx)(N,{title:(0,r.__)("Enabled rules","password-requirements"),children:(0,i.jsxs)(v,{children:[(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Enforce the minimum password length","password-requirements"),help:(0,r.sprintf)(
    1414// Translators: %s - minimum password length (number of characters with text).
    1515// Translators: %s - minimum password length (number of characters with text).
    16 (0,a.__)("Once enabled, the users' password length must equal or exceed the defined value (currently set to %s).","password-requirements"),(0,a.sprintf)(
     16(0,r.__)("Once enabled, the users' password length must equal or exceed the defined value (currently set to %s).","password-requirements"),(0,r.sprintf)(
    1717// Translators: %d - number of characters.
    1818// Translators: %d - number of characters.
    19 (0,a._n)("%d character","%d characters",s["ruleSettings.minimumLength"],"password-requirements"),s["ruleSettings.minimumLength"])),checked:s["rules.minimumLength"],onChange:()=>{t({...s,"rules.minimumLength":!s["rules.minimumLength"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Enforce the maximum password length","password-requirements"),help:(0,a.sprintf)(
     19(0,r._n)("%d character","%d characters",s["ruleSettings.minimumLength"],"password-requirements"),s["ruleSettings.minimumLength"])),checked:s["rules.minimumLength"],onChange:()=>{t({...s,"rules.minimumLength":!s["rules.minimumLength"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Enforce the maximum password length","password-requirements"),help:(0,r.sprintf)(
    2020// Translators: %s - maximum password length (number of characters with text).
    2121// Translators: %s - maximum password length (number of characters with text).
    22 (0,a.__)("Once enabled, the users' password length must be equal or less than the defined value (currently set to %s).","password-requirements"),(0,a.sprintf)(
     22(0,r.__)("Once enabled, the users' password length must be equal or less than the defined value (currently set to %s).","password-requirements"),(0,r.sprintf)(
    2323// Translators: %d - number of characters.
    2424// Translators: %d - number of characters.
    25 (0,a._n)("%d character","%d characters",s["ruleSettings.maximumLength"],"password-requirements"),s["ruleSettings.maximumLength"])),checked:s["rules.maximumLength"],onChange:()=>{t({...s,"rules.maximumLength":!s["rules.maximumLength"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Enforce the minimum password age","password-requirements"),help:(0,a.sprintf)(
     25(0,r._n)("%d character","%d characters",s["ruleSettings.maximumLength"],"password-requirements"),s["ruleSettings.maximumLength"])),checked:s["rules.maximumLength"],onChange:()=>{t({...s,"rules.maximumLength":!s["rules.maximumLength"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Enforce the minimum password age","password-requirements"),help:(0,r.sprintf)(
    2626// Translators: %s - minimum password age (number of days with text).
    2727// Translators: %s - minimum password age (number of days with text).
    28 (0,a.__)("Once enabled, users can only change their passwords if the current password has been used for at least a defined period (currently set to %s).","password-requirements"),(0,a.sprintf)(
     28(0,r.__)("Once enabled, users can only change their passwords if the current password has been used for at least a defined period (currently set to %s).","password-requirements"),(0,r.sprintf)(
    2929// Translators: %d - number of days.
    3030// Translators: %d - number of days.
    31 (0,a._n)("%d day","%d days",s["ruleSettings.minimumAge"],"password-requirements"),s["ruleSettings.minimumAge"])),checked:s["rules.minimumAge"],onChange:()=>{t({...s,"rules.minimumAge":!s["rules.minimumAge"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Enforce the maximum password age","password-requirements"),help:(0,a.sprintf)(
     31(0,r._n)("%d day","%d days",s["ruleSettings.minimumAge"],"password-requirements"),s["ruleSettings.minimumAge"])),checked:s["rules.minimumAge"],onChange:()=>{t({...s,"rules.minimumAge":!s["rules.minimumAge"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Enforce the maximum password age","password-requirements"),help:(0,r.sprintf)(
    3232// Translators: %s - maximum password age (number of days with text).
    3333// Translators: %s - maximum password age (number of days with text).
    34 (0,a.__)("Once enabled, users will have to change their passwords if the current password has been in use for a defined period (currently set to %s).","password-requirements"),(0,a.sprintf)(
     34(0,r.__)("Once enabled, users will have to change their passwords if the current password has been in use for a defined period (currently set to %s).","password-requirements"),(0,r.sprintf)(
    3535// Translators: %d - number of days.
    3636// Translators: %d - number of days.
    37 (0,a._n)("%d day","%d days",s["ruleSettings.maximumAge"],"password-requirements"),s["ruleSettings.maximumAge"])),checked:s["rules.maximumAge"],onChange:()=>{t({...s,"rules.maximumAge":!s["rules.maximumAge"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Enforce the password complexity requirements","password-requirements"),help:(0,e.createInterpolateElement)((0,a.sprintf)(
     37(0,r._n)("%d day","%d days",s["ruleSettings.maximumAge"],"password-requirements"),s["ruleSettings.maximumAge"])),checked:s["rules.maximumAge"],onChange:()=>{t({...s,"rules.maximumAge":!s["rules.maximumAge"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Enforce the password complexity requirements","password-requirements"),help:(0,e.createInterpolateElement)((0,r.sprintf)(
    3838// Translators: %s - complexity explanation.
    3939// Translators: %s - complexity explanation.
    40 (0,a.__)("Once enabled, users' password must meet the complexity requirements. <explanation>%s</explanation>","password-requirements"),(()=>{const e=[];if(!0===s["ruleSettings.complexity.uppercase"]&&e.push((0,a.__)("uppercase letter(s)","password-requirements")),!0===s["ruleSettings.complexity.lowercase"]&&e.push((0,a.__)("lowercase letter(s)","password-requirements")),!0===s["ruleSettings.complexity.digit"]&&e.push((0,a.__)("base digit(s) (0 through 9)","password-requirements")),!0===s["ruleSettings.complexity.specialCharacter"]&&e.push((0,a.__)("special character(s)","password-requirements")),!0===s["ruleSettings.complexity.uniqueCharacters"]&&e.push((0,a.sprintf)(
     40(0,r.__)("Once enabled, users' password must meet the complexity requirements. <explanation>%s</explanation>","password-requirements"),(()=>{const e=[];if(!0===s["ruleSettings.complexity.uppercase"]&&e.push((0,r.__)("uppercase letter(s)","password-requirements")),!0===s["ruleSettings.complexity.lowercase"]&&e.push((0,r.__)("lowercase letter(s)","password-requirements")),!0===s["ruleSettings.complexity.digit"]&&e.push((0,r.__)("base digit(s) (0 through 9)","password-requirements")),!0===s["ruleSettings.complexity.specialCharacter"]&&e.push((0,r.__)("special character(s)","password-requirements")),!0===s["ruleSettings.complexity.uniqueCharacters"]&&e.push((0,r.sprintf)(
    4141// Translators: %d - number of characters.
    4242// Translators: %d - number of characters.
    43 (0,a._n)("%d distinct character","%d distinct characters",s["ruleSettings.minimumUniqueCharacters"],"password-requirements"),s["ruleSettings.minimumUniqueCharacters"])),!0===s["ruleSettings.complexity.consecutiveUserSymbols"]&&(0===r?e.push((0,a.__)("no symbols from the user's name or display name","password-requirements")):e.push((0,a.sprintf)(
     43(0,r._n)("%d distinct character","%d distinct characters",s["ruleSettings.minimumUniqueCharacters"],"password-requirements"),s["ruleSettings.minimumUniqueCharacters"])),!0===s["ruleSettings.complexity.consecutiveUserSymbols"]&&(0===a?e.push((0,r.__)("no symbols from the user's name or display name","password-requirements")):e.push((0,r.sprintf)(
    4444// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    4545// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    46 (0,a._n)("no more than %d consecutive symbol from the user's name or display name","no more than %d consecutive symbols from the user's name or display name",r,"password-requirements"),r))),!0===s["ruleSettings.complexity.restrictedCharacters"]&&Array.isArray(s["ruleSettings.restrictedCharacters"])&&0<s["ruleSettings.restrictedCharacters"].length&&e.push((0,a.sprintf)(
     46(0,r._n)("no more than %d consecutive symbol from the user's name or display name","no more than %d consecutive symbols from the user's name or display name",a,"password-requirements"),a))),!0===s["ruleSettings.complexity.restrictedCharacters"]&&Array.isArray(s["ruleSettings.restrictedCharacters"])&&0<s["ruleSettings.restrictedCharacters"].length&&e.push((0,r.sprintf)(
    4747// Translators: %s - restricted characters phrase, <code /> - the restricted characters themselves.
    4848// Translators: %s - restricted characters phrase, <code /> - the restricted characters themselves.
    49 (0,a.__)("not to contain the following %s: <code />","password-requirements"),(0,a._n)("restricted character","restricted characters",s["ruleSettings.restrictedCharacters"].length,"password-requirements"))),0===e.length)return(0,a.__)("Currently, all complexity rules for this password policy are disabled.","password-requirements");let t="";if(1===e.length)t=e[0];else{const s=e.pop();t=(0,a.sprintf)(
     49(0,r.__)("not to contain the following %s: <code />","password-requirements"),(0,r._n)("restricted character","restricted characters",s["ruleSettings.restrictedCharacters"].length,"password-requirements"))),0===e.length)return(0,r.__)("Currently, all complexity rules for this password policy are disabled.","password-requirements");let t="";if(1===e.length)t=e[0];else{const s=e.pop();t=(0,r.sprintf)(
    5050// Translators: %1$s - all parts except last, %2$s - last part.
    5151// Translators: %1$s - all parts except last, %2$s - last part.
    52 (0,a.__)("%1$s, and %2$s","password-requirements"),e.join(", "),s)}return(0,a.sprintf)(
     52(0,r.__)("%1$s, and %2$s","password-requirements"),e.join(", "),s)}return(0,r.sprintf)(
    5353// Translators: %s - complexity explanation.
    5454// Translators: %s - complexity explanation.
    55 (0,a.__)("Currently set to require: %s.","password-requirements"),t)})()),{explanation:(0,n.jsx)("span",{}),code:(0,n.jsx)("code",{children:l})}),checked:s["rules.complexity"],onChange:()=>{t({...s,"rules.complexity":!s["rules.complexity"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Require current password when changing password","password-requirements"),help:(0,a.__)("Once enabled, users must provide their current password to change it; applies to the User Profile screen.","password-requirements"),checked:s["rules.requireCurrentPassword"],onChange:()=>{t({...s,"rules.requireCurrentPassword":!s["rules.requireCurrentPassword"]})}}),(0,n.jsx)(c.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Apply the restricted words and phrases list","password-requirements"),help:(0,a.__)('Once enabled, passwords containing any word or phrase from the site-wide list will be rejected. Manage the list under "General" tab.',"password-requirements"),checked:s["rules.restrictedPhrases"],onChange:()=>{t({...s,"rules.restrictedPhrases":!s["rules.restrictedPhrases"]})}})]})}),(0,n.jsx)(B,{title:(0,a.__)("Rule settings","password-requirements"),children:(0,n.jsxs)(S,{children:[(0,n.jsx)(A,{label:(0,a.__)("Minimum password length","password-requirements"),help:(0,a.__)("Number of characters required in passwords; a valid value should be between 1 and 50.","password-requirements"),min:1,max:50,value:s["ruleSettings.minimumLength"],defaultValue:10,onChange:e=>{t({...s,"ruleSettings.minimumLength":e})}}),(0,n.jsx)(A,{label:(0,a.__)("Maximum password length","password-requirements"),help:(0,a.__)("Maximum number of characters allowed in passwords; a valid value should be between 64 and 512.","password-requirements"),min:64,max:512,value:s["ruleSettings.maximumLength"],defaultValue:256,onChange:e=>{t({...s,"ruleSettings.maximumLength":e})}}),(0,n.jsx)(A,{label:(0,a.__)("Minimum password age","password-requirements"),help:(0,a.__)("Number of days; a valid value should be between 1 and 1000.","password-requirements"),min:1,max:1e3,value:s["ruleSettings.minimumAge"],defaultValue:2,onChange:e=>{t({...s,"ruleSettings.minimumAge":e})}}),(0,n.jsx)(A,{label:(0,a.__)("Maximum password age","password-requirements"),help:(0,a.__)("Number of days; a valid value should be between 1 and 1000.","password-requirements"),min:1,max:1e3,value:s["ruleSettings.maximumAge"],defaultValue:30,onChange:e=>{t({...s,"ruleSettings.maximumAge":e})}}),(0,n.jsxs)(S,{label:(0,a.__)("Password complexity requirements","password-requirements"),withBaseControl:!0,withReducedGap:!0,children:[(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Uppercase letter(s) required","password-requirements"),checked:s["ruleSettings.complexity.uppercase"],onChange:()=>{t({...s,"ruleSettings.complexity.uppercase":!s["ruleSettings.complexity.uppercase"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Lowercase letter(s) required","password-requirements"),checked:s["ruleSettings.complexity.lowercase"],onChange:()=>{t({...s,"ruleSettings.complexity.lowercase":!s["ruleSettings.complexity.lowercase"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Base digit(s) (0 through 9) required","password-requirements"),checked:s["ruleSettings.complexity.digit"],onChange:()=>{t({...s,"ruleSettings.complexity.digit":!s["ruleSettings.complexity.digit"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.sprintf)(
     55(0,r.__)("Currently set to require: %s.","password-requirements"),t)})()),{explanation:(0,i.jsx)("span",{}),code:(0,i.jsx)("code",{children:l})}),checked:s["rules.complexity"],onChange:()=>{t({...s,"rules.complexity":!s["rules.complexity"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Require current password when changing password","password-requirements"),help:(0,r.__)("Once enabled, users must provide their current password to change it; applies to the User Profile screen.","password-requirements"),checked:s["rules.requireCurrentPassword"],onChange:()=>{t({...s,"rules.requireCurrentPassword":!s["rules.requireCurrentPassword"]})}}),(0,i.jsx)(o.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Apply the restricted words and phrases list","password-requirements"),help:(0,r.__)('Once enabled, passwords containing any word or phrase from the site-wide list will be rejected. Manage the list under "General" tab.',"password-requirements"),checked:s["rules.restrictedPhrases"],onChange:()=>{t({...s,"rules.restrictedPhrases":!s["rules.restrictedPhrases"]})}})]})}),(0,i.jsx)(N,{title:(0,r.__)("Rule settings","password-requirements"),children:(0,i.jsxs)(v,{children:[(0,i.jsx)(R,{label:(0,r.__)("Minimum password length","password-requirements"),help:(0,r.__)("Number of characters required in passwords; a valid value should be between 1 and 50.","password-requirements"),min:1,max:50,value:s["ruleSettings.minimumLength"],defaultValue:10,onChange:e=>{t({...s,"ruleSettings.minimumLength":e})}}),(0,i.jsx)(R,{label:(0,r.__)("Maximum password length","password-requirements"),help:(0,r.__)("Maximum number of characters allowed in passwords; a valid value should be between 64 and 512.","password-requirements"),min:64,max:512,value:s["ruleSettings.maximumLength"],defaultValue:256,onChange:e=>{t({...s,"ruleSettings.maximumLength":e})}}),(0,i.jsx)(R,{label:(0,r.__)("Minimum password age","password-requirements"),help:(0,r.__)("Number of days; a valid value should be between 1 and 1000.","password-requirements"),min:1,max:1e3,value:s["ruleSettings.minimumAge"],defaultValue:2,onChange:e=>{t({...s,"ruleSettings.minimumAge":e})}}),(0,i.jsx)(R,{label:(0,r.__)("Maximum password age","password-requirements"),help:(0,r.__)("Number of days; a valid value should be between 1 and 1000.","password-requirements"),min:1,max:1e3,value:s["ruleSettings.maximumAge"],defaultValue:30,onChange:e=>{t({...s,"ruleSettings.maximumAge":e})}}),(0,i.jsxs)(v,{label:(0,r.__)("Password complexity requirements","password-requirements"),withBaseControl:!0,withReducedGap:!0,children:[(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Uppercase letter(s) required","password-requirements"),checked:s["ruleSettings.complexity.uppercase"],onChange:()=>{t({...s,"ruleSettings.complexity.uppercase":!s["ruleSettings.complexity.uppercase"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Lowercase letter(s) required","password-requirements"),checked:s["ruleSettings.complexity.lowercase"],onChange:()=>{t({...s,"ruleSettings.complexity.lowercase":!s["ruleSettings.complexity.lowercase"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Base digit(s) (0 through 9) required","password-requirements"),checked:s["ruleSettings.complexity.digit"],onChange:()=>{t({...s,"ruleSettings.complexity.digit":!s["ruleSettings.complexity.digit"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.sprintf)(
    5656// Translators: %s - minimum number of distinct characters in password, with text.
    5757// Translators: %s - minimum number of distinct characters in password, with text.
    58 (0,a.__)("At least %s required","password-requirements"),(0,a.sprintf)(
     58(0,r.__)("At least %s required","password-requirements"),(0,r.sprintf)(
    5959// Translators: %d - number of characters.
    6060// Translators: %d - number of characters.
    61 (0,a._n)("%d distinct character","%d distinct characters",s["ruleSettings.minimumUniqueCharacters"],"password-requirements"),s["ruleSettings.minimumUniqueCharacters"])),checked:s["ruleSettings.complexity.uniqueCharacters"],help:(0,a.__)("Adjust the number in a dedicated field below.","password-requirements"),onChange:()=>{t({...s,"ruleSettings.complexity.uniqueCharacters":!s["ruleSettings.complexity.uniqueCharacters"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Limit symbols from the user's name or display name","password-requirements"),checked:s["ruleSettings.complexity.consecutiveUserSymbols"],help:(o=r,0===o?(0,a.__)("No symbols from the user's name or display name are allowed. Adjust the number in a dedicated field below.","password-requirements"):(0,a.sprintf)(
     61(0,r._n)("%d distinct character","%d distinct characters",s["ruleSettings.minimumUniqueCharacters"],"password-requirements"),s["ruleSettings.minimumUniqueCharacters"])),checked:s["ruleSettings.complexity.uniqueCharacters"],help:(0,r.__)("Adjust the number in a dedicated field below.","password-requirements"),onChange:()=>{t({...s,"ruleSettings.complexity.uniqueCharacters":!s["ruleSettings.complexity.uniqueCharacters"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Limit symbols from the user's name or display name","password-requirements"),checked:s["ruleSettings.complexity.consecutiveUserSymbols"],help:(c=a,0===c?(0,r.__)("No symbols from the user's name or display name are allowed. Adjust the number in a dedicated field below.","password-requirements"):(0,r.sprintf)(
    6262// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    6363// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    64 (0,a._n)("Up to %d consecutive symbol from the user's name or display name is allowed. Adjust the number in a dedicated field below.","Up to %d consecutive symbols from the user's name or display name are allowed. Adjust the number in a dedicated field below.",o,"password-requirements"),o)),onChange:()=>{t({...s,"ruleSettings.complexity.consecutiveUserSymbols":!s["ruleSettings.complexity.consecutiveUserSymbols"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Special character(s) required","password-requirements"),checked:s["ruleSettings.complexity.specialCharacter"],help:(0,e.createInterpolateElement)((0,a.__)("Special character: one of punctuation characters that are present on standard US keyboard. See: <a>Password Special Characters</a> for more details.","password-requirements"),{a:(0,n.jsx)(c.ExternalLink,{href:"https://owasp.org/www-community/password-special-characters"})}),onChange:()=>{t({...s,"ruleSettings.complexity.specialCharacter":!s["ruleSettings.complexity.specialCharacter"]})}}),(0,n.jsx)(c.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Certain character(s) restricted","password-requirements"),checked:s["ruleSettings.complexity.restrictedCharacters"],help:(0,a.__)("Restrict specific characters in the password. Use this option only when required, such as to meet legacy system integration constraints.","password-requirements"),onChange:()=>{t({...s,"ruleSettings.complexity.restrictedCharacters":!s["ruleSettings.complexity.restrictedCharacters"]})}})]}),s["ruleSettings.complexity.restrictedCharacters"]&&(0,n.jsx)(M,{help:(0,a.__)("Type in a character that should be added to the list of restricted characters in the password.","password-requirements"),label:(0,a.__)("Restricted characters","password-requirements"),value:s["ruleSettings.restrictedCharacters"],onChange:e=>{t({...s,"ruleSettings.restrictedCharacters":e})}}),(0,n.jsx)(A,{label:(0,a.__)("Minimum number of distinct characters in password","password-requirements"),help:(0,a.__)('Example: the password "aabc" contains three distinct characters (a, b, c); a valid value should be between 1 and 50.',"password-requirements"),min:1,max:50,value:s["ruleSettings.minimumUniqueCharacters"],defaultValue:6,onChange:e=>{t({...s,"ruleSettings.minimumUniqueCharacters":e})}}),(0,n.jsx)(A,{label:(0,a.__)("Number of consecutive symbols of the user's name or display name allowed in the password","password-requirements"),help:(0,a.__)('A valid value should be between 0 and 50. Examples: if "0" is chosen, all characters used in user name or display name will not be allowed in user\'s password; if "2" is chosen and user name is "Bart", password can contain "ba", "ar", and "rt", but not "bar" or "art". Matching ignores letter case. The complete user name and display name are always rejected whatever the limit, so with "4" chosen and user name "Bart", password still cannot contain "bart".',"password-requirements"),min:0,max:50,value:s["ruleSettings.maximumConsecutiveUserSymbols"],defaultValue:4,onChange:e=>{(e=>{0!==e?(0,T.speak)((0,a.sprintf)(
     64(0,r._n)("Up to %d consecutive symbol from the user's name or display name is allowed. Adjust the number in a dedicated field below.","Up to %d consecutive symbols from the user's name or display name are allowed. Adjust the number in a dedicated field below.",c,"password-requirements"),c)),onChange:()=>{t({...s,"ruleSettings.complexity.consecutiveUserSymbols":!s["ruleSettings.complexity.consecutiveUserSymbols"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Special character(s) required","password-requirements"),checked:s["ruleSettings.complexity.specialCharacter"],help:(0,e.createInterpolateElement)((0,r.__)("Special character: one of punctuation characters that are present on standard US keyboard. See: <a>Password Special Characters</a> for more details.","password-requirements"),{a:(0,i.jsx)(o.ExternalLink,{href:"https://owasp.org/www-community/password-special-characters"})}),onChange:()=>{t({...s,"ruleSettings.complexity.specialCharacter":!s["ruleSettings.complexity.specialCharacter"]})}}),(0,i.jsx)(o.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Certain character(s) restricted","password-requirements"),checked:s["ruleSettings.complexity.restrictedCharacters"],help:(0,r.__)("Restrict specific characters in the password. Use this option only when required, such as to meet legacy system integration constraints.","password-requirements"),onChange:()=>{t({...s,"ruleSettings.complexity.restrictedCharacters":!s["ruleSettings.complexity.restrictedCharacters"]})}})]}),s["ruleSettings.complexity.restrictedCharacters"]&&(0,i.jsx)(q,{help:(0,r.__)("Type in a character that should be added to the list of restricted characters in the password.","password-requirements"),label:(0,r.__)("Restricted characters","password-requirements"),value:s["ruleSettings.restrictedCharacters"],onChange:e=>{t({...s,"ruleSettings.restrictedCharacters":e})}}),(0,i.jsx)(R,{label:(0,r.__)("Minimum number of distinct characters in password","password-requirements"),help:(0,r.__)('Example: the password "aabc" contains three distinct characters (a, b, c); a valid value should be between 1 and 50.',"password-requirements"),min:1,max:50,value:s["ruleSettings.minimumUniqueCharacters"],defaultValue:6,onChange:e=>{t({...s,"ruleSettings.minimumUniqueCharacters":e})}}),(0,i.jsx)(R,{label:(0,r.__)("Number of consecutive symbols of the user's name or display name allowed in the password","password-requirements"),help:(0,r.__)('A valid value should be between 0 and 50. Examples: if "0" is chosen, all characters used in user name or display name will not be allowed in user\'s password; if "2" is chosen and user name is "Bart", password can contain "ba", "ar", and "rt", but not "bar" or "art". Matching ignores letter case. The complete user name and display name are always rejected whatever the limit, so with "4" chosen and user name "Bart", password still cannot contain "bart".',"password-requirements"),min:0,max:50,value:s["ruleSettings.maximumConsecutiveUserSymbols"],defaultValue:4,onChange:e=>{(e=>{0!==e?(0,L.speak)((0,r.sprintf)(
    6565// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    6666// Translators: %d - number of consecutive symbols of the user's name or display name allowed in the password.
    67 (0,a._n)("Passwords may contain up to %d consecutive symbol from the user's name or display name.","Passwords may contain up to %d consecutive symbols from the user's name or display name.",e,"password-requirements"),e),"polite"):(0,T.speak)((0,a.__)("No character of the user's name or display name may appear in the password.","password-requirements"),"polite")})(e),t({...s,"ruleSettings.maximumConsecutiveUserSymbols":e})}}),i&&0===r&&(0,n.jsx)(k,{message:(0,a.__)("A value of 0 forbids every character of the user's name and display name in their password, letter case ignored. For a long display name that can rule out most of the alphabet and leave users unable to set any password.","password-requirements")})]})})]})});var o};L.propTypes={data:r().object.isRequired,onChange:r().func.isRequired};const H=({settings:s,setSettings:t})=>{(0,e.useEffect)(()=>{if(0===Object.keys(s.data?.policies).length){const e=`d:${Date.now().toString()}${String(C++%1e4).padStart(4,"0")}`,{policy:r}=s.templates.policies;t({...s,data:{...s.data,policies:{[e]:Object.assign({},{key:e,...r})}}})}},[s,t]);const r=s.data?.policies[Object.keys(s.data?.policies)?.[0]]??null;return null===r?null:(0,n.jsx)(L,{data:r,onChange:e=>{const a=Object.assign({},s.data?.policies??{});a[r.key]=e,t({...s,data:{...s.data,policies:a}})}})};H.propTypes={settings:r().object.isRequired,setSettings:r().func.isRequired},(0,d.addFilter)("password_requirements__settings_page_tabs","teydeastudio/password-requirements/settings-page",(e,s,t)=>(e.push({name:"password-policy",title:(0,a.__)("Policy","password-requirements"),component:(0,n.jsx)(H,{settings:s,setSettings:t})}),e.push({name:"general",title:(0,a.__)("General","password-requirements"),component:(0,n.jsx)(q,{settings:s,setSettings:t})}),e)),(0,d.addFilter)("password_requirements__upsell_panel","teydeastudio/password-requirements/settings-page",e=>(window?.teydeaStudio?.passwordRequirements?.plugin?.isPro||(e=(0,n.jsx)(f,{url:"https://teydeastudio.com/plugins/login-security/pricing/?utm_source=Teydea+Login+Security",benefits:[(0,n.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/pwned-passwords-integration/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,a.__)("Block Passwords Found in Real-World Data Breaches","password-requirements")},"pwned-passwords-integration"),(0,n.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/dedicated-policies-by-user-and-or-role/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,a.__)("Create Unlimited, Dedicated Password Policies for Different User Groups","password-requirements")},"dedicated-policies-by-user-and-or-role"),(0,n.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/passwords-reuse-prevention/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,a.__)("Prevent Reusing the Same Passwords","password-requirements")},"passwords-reuse-prevention"),(0,n.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/restricted-passwords-list/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,a.__)("Prevent Usage of Common, Weak Passwords","password-requirements")},"restricted-passwords-list"),(0,n.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/integrations/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,a.__)("Full integration with WooCommerce and multiple other plugins","password-requirements")},"integrations"),(0,a.__)("Access to PRO updates and our premium support","password-requirements")]})),e)),(0,d.addAction)("password_requirements__settings_saved","teydeastudio/password-requirements/settings-page",async()=>{await _()({path:"/password-requirements/v1/should-change-password"}).then(e=>(""!==e&&window.location.replace(e),e))});const F={key:"passwordRequirements",type:"plugin"},{key:O}=F,{pageTitle:z}=window.teydeaStudio[O].settingsPage,V=b(({SaveSettingsButton:e,setSettings:s,settings:t})=>(0,n.jsx)(o,{actions:(0,n.jsx)(e,{}),pageTitle:z,product:F,children:(0,n.jsx)(w,{product:F,settings:t,setSettings:s})}));var U,E;U=(0,n.jsx)(V,{product:F,LoadingContainer:({children:e})=>(0,n.jsx)(o,{pageTitle:z,product:F,children:e})}),E=document.querySelector("div#password-requirements-settings-page"),(0,e.createRoot)(E).render(U)})()})();
     67(0,r._n)("Passwords may contain up to %d consecutive symbol from the user's name or display name.","Passwords may contain up to %d consecutive symbols from the user's name or display name.",e,"password-requirements"),e),"polite"):(0,L.speak)((0,r.__)("No character of the user's name or display name may appear in the password.","password-requirements"),"polite")})(e),t({...s,"ruleSettings.maximumConsecutiveUserSymbols":e})}}),n&&0===a&&(0,i.jsx)(P,{message:(0,r.__)("A value of 0 forbids every character of the user's name and display name in their password, letter case ignored. For a long display name that can rule out most of the alphabet and leave users unable to set any password.","password-requirements")})]})})]})});var c};H.propTypes={data:s.object.isRequired,onChange:s.func.isRequired};const B=({settings:s,setSettings:t})=>{(0,e.useEffect)(()=>{if(0===Object.keys(s.data?.policies).length){const e=`d:${Date.now().toString()}${String(C++%1e4).padStart(4,"0")}`,{policy:r}=s.templates.policies;t({...s,data:{...s.data,policies:{[e]:Object.assign({},{key:e,...r})}}})}},[s,t]);const r=s.data?.policies[Object.keys(s.data?.policies)?.[0]]??null;return null===r?null:(0,i.jsx)(H,{data:r,onChange:e=>{const a=Object.assign({},s.data?.policies??{});a[r.key]=e,t({...s,data:{...s.data,policies:a}})}})};B.propTypes={settings:s.object.isRequired,setSettings:s.func.isRequired},(0,c.addFilter)("password_requirements__settings_page_tabs","teydeastudio/password-requirements/settings-page",(e,s,t)=>(e.push({name:"password-policy",title:(0,r.__)("Policy","password-requirements"),component:(0,i.jsx)(B,{settings:s,setSettings:t})}),e.push({name:"general",title:(0,r.__)("General","password-requirements"),component:(0,i.jsx)(b,{settings:s,setSettings:t})}),e)),(0,c.addFilter)("password_requirements__upsell_panel","teydeastudio/password-requirements/settings-page",e=>(window?.teydeaStudio?.passwordRequirements?.plugin?.isPro||(e=(0,i.jsx)(w,{url:"https://teydeastudio.com/plugins/login-security/pricing/?utm_source=Teydea+Login+Security",benefits:[(0,i.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/pwned-passwords-integration/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,r.__)("Block Passwords Found in Real-World Data Breaches","password-requirements")},"pwned-passwords-integration"),(0,i.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/dedicated-policies-by-user-and-or-role/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,r.__)("Create Unlimited, Dedicated Password Policies for Different User Groups","password-requirements")},"dedicated-policies-by-user-and-or-role"),(0,i.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/passwords-reuse-prevention/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,r.__)("Prevent Reusing the Same Passwords","password-requirements")},"passwords-reuse-prevention"),(0,i.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/features/restricted-passwords-list/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,r.__)("Prevent Usage of Common, Weak Passwords","password-requirements")},"restricted-passwords-list"),(0,i.jsx)("a",{href:"https://teydeastudio.com/plugins/login-security/integrations/?utm_source=Teydea+Login+Security",target:"_blank",rel:"noreferrer",children:(0,r.__)("Full integration with WooCommerce and multiple other plugins","password-requirements")},"integrations"),(0,r.__)("Access to PRO updates and our premium support","password-requirements")]})),e)),(0,c.addAction)("password_requirements__settings_saved","teydeastudio/password-requirements/settings-page",async()=>{await x({path:"/password-requirements/v1/should-change-password"}).then(e=>(""!==e&&window.location.replace(e),e))});const T={key:"passwordRequirements",type:"plugin"},{key:A}=T,{pageTitle:F}=window.teydeaStudio[A].settingsPage,V=j(({SaveSettingsButton:e,setSettings:s,settings:t})=>(0,i.jsx)(l,{actions:(0,i.jsx)(e,{}),pageTitle:F,product:T,children:(0,i.jsx)(g,{product:T,settings:t,setSettings:s})}));var O,z;O=(0,i.jsx)(V,{product:T,LoadingContainer:({children:e})=>(0,i.jsx)(l,{pageTitle:F,product:T,children:e})}),z=document.querySelector("div#password-requirements-settings-page"),(0,e.createRoot)(z).render(O)})()})();
  • password-requirements/trunk/changelog.txt

    r3669586 r3748178  
    11== Changelog ==
     2
     3= 3.9.0 (2026-10-15) =
     4* Improved compatibility of the sign-in password check with plugins that change login cookies
     5* On multisite, the "Current Password" field on the user-admin profile screen is now checked
     6* Personal data exports now include the date the user last changed their password
     7* Confirming the current password no longer counts as a failed login when it is mistyped, and no longer resets the password age when it is correct
     8* The "Current Password" field keeps its label visible, is recognized by password managers, and has its help text announced by screen readers
     9* The "Current Password" field is now positioned by an enqueued script, so it also works on sites whose Content-Security-Policy blocks inline scripts
     10* Dependencies updated
     11* Code improvements
    212
    313= 3.8.0 (2026-08-28) =
  • password-requirements/trunk/classmap.php

    r3669586 r3748178  
    2626        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Module' => '/deps/php/utils/class-module.php',
    2727        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Nested_Array' => '/deps/php/utils/class-nested-array.php',
     28        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Network_Sites' => '/deps/php/utils/class-network-sites.php',
    2829        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Nonce' => '/deps/php/utils/class-nonce.php',
    2930        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Plugin' => '/deps/php/utils/class-plugin.php',
    30         'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Post_Meta' => '/deps/php/utils/class-post-meta.php',
    31         'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Post_Meta_Registry' => '/deps/php/utils/class-post-meta-registry.php',
    3231        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Runtime_Requirements' => '/deps/php/utils/class-runtime-requirements.php',
    3332        'Teydea_Studio\\Login_Security\\Dependencies\\Utils\\Screen' => '/deps/php/utils/class-screen.php',
    … …  
    7170        'Teydea_Studio\\Login_Security\\Modules\\Password_Hint\\Submodules\\User_New_Screen\\Submodule_User_New_Screen' => '/src/modules/password-hint/submodules/user-new-screen/class-submodule-user-new-screen.php',
    7271        'Teydea_Studio\\Login_Security\\Modules\\Password_Hint\\Submodules\\User_Profile_Screen\\Submodule_User_Profile_Screen' => '/src/modules/password-hint/submodules/user-profile-screen/class-submodule-user-profile-screen.php',
     72        'Teydea_Studio\\Login_Security\\Modules\\Personal_Data\\Module_Personal_Data' => '/src/modules/personal-data/class-module-personal-data.php',
    7373        'Teydea_Studio\\Login_Security\\Modules\\Plugin_Upgrade_Action_Link\\Module_Plugin_Upgrade_Action_Link' => '/src/modules/plugin-upgrade-action-link/class-module-plugin-upgrade-action-link.php',
    7474        'Teydea_Studio\\Login_Security\\Modules\\Require_Current_Password\\Module_Require_Current_Password' => '/src/modules/require-current-password/class-module-require-current-password.php',
  • password-requirements/trunk/deps/js/components/package.json

    r3669586 r3748178  
    33  "type": "module",
    44  "private": true,
    5   "dependencies": {
    6     "@dnd-kit/core": "^6.3.1",
    7     "@dnd-kit/modifiers": "^9.0.0",
    8     "@dnd-kit/sortable": "^10.0.0",
    9     "@dnd-kit/utilities": "^3.2.2"
    10   },
    115  "devDependencies": {
    12     "@wordpress/icons": "^15.3.0",
    13     "@wordpress/scripts": "^34.0.0",
    146    "prop-types": "^15.8.1"
    157  }
  • password-requirements/trunk/deps/js/components/src/_variables.scss

    r3669586 r3748178  
    22 * Variables
    33 */
     4
     5/**
     6 * WordPress admin color palette, named the way core names each step
     7 */
     8$wp-admin--gray-0: #f6f7f7;
     9$wp-admin--gray-2: #f0f0f1;
     10$wp-admin--gray-5: #dcdcde;
     11$wp-admin--gray-30: #8c8f94;
     12$wp-admin--gray-50: #646970;
     13$wp-admin--gray-60: #50575e;
     14$wp-admin--gray-70: #3c434a;
     15$wp-admin--gray-90: #1d2327;
     16$wp-admin--blue-0: #f0f6fc;
     17$wp-admin--blue-50: #2271b1;
     18$wp-admin--blue-60: #135e96;
     19$wp-admin--blue-70: #0a4b78;
     20$wp-admin--green-50: #008a20;
     21$wp-admin--red-50: #d63638;
     22$wp-admin--yellow-50: #996800;
     23
     24/**
     25 * The admin color scheme the user picked, falling back to the default scheme's blue
     26 */
     27$wp-admin--theme-color: var(--wp-admin-theme-color, #{$wp-admin--blue-50});
     28$wp-admin--theme-color-darker-10: var(--wp-admin-theme-color-darker-10, #{$wp-admin--blue-60});
     29
    430$border-color: #e0e0e0;
    531$border-color--darker: #949494;
    632
    733$text-color--black: #1e1e1e;
    8 $text-color--wp-admin-text: #3c434a;
     34$text-color--wp-admin-text: $wp-admin--gray-70;
    935$text-color--gray: #757575;
    1036$text-color--green: #307d07;
    … …  
    1743$wp-admin-default--destructive: #cc1818;
    1844$wp-admin-default--destructive-darker-20: #710d0d;
     45
     46/**
     47 * Tinted surfaces and the text that sits on them, from the same palette
     48 *
     49 * A status said in a tinted box, such as a passing check or a warning, sits on the lightest
     50 * step of its hue. The yellow text step is the one that passes AA on its own surface.
     51 */
     52$wp-admin--green-0: #edfaef;
     53$wp-admin--green-60: #007017;
     54$wp-admin--red-0: #fcf0f1;
     55$wp-admin--red-60: #b32d2e;
     56$wp-admin--yellow-0: #fcf9e8;
     57$wp-admin--yellow-20: #f0c33c;
     58$wp-admin--yellow-60: #755100;
  • password-requirements/trunk/deps/js/components/src/detect-outside/index.js

    r3669586 r3748178  
    1414 */
    1515export const DetectOutside = withFocusOutside(
     16        /**
     17         * Component that forwards a focus event landing outside it to its owner.
     18         */
    1619        class extends Component {
    1720                /**
  • password-requirements/trunk/deps/js/components/src/product-icon/index.js

    r3669586 r3748178  
    252252                        );
    253253
    254                 // Teydea Pattern Library plugin icon.
    255                 case 'teydea-pattern-library':
    256                         return (
    257                                 <div className="tsc-product-icon">
    258                                         <SVG fill="none" height="256" viewBox="0 0 512 512" width="256" xmlns="http://www.w3.org/2000/svg">
    259                                                 <Path
    260                                                         fill="#fff5e6"
    261                                                         d="M372.364 0H139.636C62.517 0 0 62.517 0 139.636v232.728C0 449.483 62.517 512 139.636 512h232.728C449.483 512 512 449.483 512 372.364V139.636C512 62.517 449.483 0 372.364 0"
    262                                                 />
    263                                                 <Path fill="#ffe6c0" d="M256.001 426.658a170.66 170.66 0 1 0 0-341.319 170.66 170.66 0 0 0 0 341.319" />
    264                                                 <Path
    265                                                         fill="#ffd18c"
    266                                                         d="M405.689 331h-21.341v-21.341a21.34 21.34 0 0 0-21.33-20.636 21.34 21.34 0 0 0-21.329 20.636V331h-21.341a21.365 21.365 0 0 0 0 42.659h21.341V395a21.36 21.36 0 0 0 21.329 20.144A21.36 21.36 0 0 0 384.348 395v-21.341h21.341A21.362 21.362 0 0 0 420 337.661 21.36 21.36 0 0 0 405.689 331M405.683 117.659H107.001A21.37 21.37 0 0 0 86.633 139a21.363 21.363 0 0 0 20.368 21.341h298.682a21.34 21.34 0 1 0 0-42.682M299.001 224.341h-192a21.344 21.344 0 0 0-20.637 21.33A21.34 21.34 0 0 0 107.001 267h192a21.34 21.34 0 0 0 20.636-21.329 21.343 21.343 0 0 0-20.636-21.33M213.683 331H107.001a21.366 21.366 0 0 0-14.312 35.999 21.37 21.37 0 0 0 14.312 6.66h106.682a21.34 21.34 0 0 0 20.636-21.329A21.34 21.34 0 0 0 213.683 331"
    267                                                 />
    268                                                 <Path
    269                                                         fill="#f89500"
    270                                                         d="M405.682 171H107a32.026 32.026 0 0 1-32-32c0-17.641 14.36-32 32-32h298.682c17.641 0 32 14.359 32 32s-14.359 32-32 32M107 128.341A10.685 10.685 0 0 0 97.023 139 10.68 10.68 0 0 0 107 149.659h298.682A10.685 10.685 0 0 0 415.66 139a10.68 10.68 0 0 0-9.978-10.659zm192 149.318H107a32.026 32.026 0 0 1-32-32c0-17.641 14.36-32 32-32h192a32.025 32.025 0 0 1 0 64M107 235a10.68 10.68 0 0 0-7.23 18.046 10.68 10.68 0 0 0 7.23 3.295h192a10.68 10.68 0 0 0 10.184-10.67A10.683 10.683 0 0 0 299 235zm106.682 149.341H107a32.02 32.02 0 0 1-32-32c0-17.664 14.36-32 32-32h106.682a32.023 32.023 0 0 1 0 64M107 341.659a10.68 10.68 0 0 0-7.23 18.046A10.68 10.68 0 0 0 107 363h106.682a10.68 10.68 0 0 0 10.184-10.671 10.68 10.68 0 0 0-10.184-10.67zM363 427a32.03 32.03 0 0 1-22.621-9.379A32.03 32.03 0 0 1 331 395v-10.659h-10.659a32.05 32.05 0 0 1-32-32c0-17.664 14.359-32 32-32H331v-10.682a32.025 32.025 0 0 1 64 0v10.682h10.682a32.023 32.023 0 0 1 0 64H395V395c0 17.641-14.336 32-32 32m-42.659-85.341a10.68 10.68 0 0 0-10.184 10.67A10.68 10.68 0 0 0 320.341 363h21.341c5.888 0 10.659 4.771 10.659 10.659V395a10.68 10.68 0 0 0 3.296 7.229 10.68 10.68 0 0 0 14.75 0 10.68 10.68 0 0 0 3.295-7.229v-21.341c0-5.888 4.771-10.659 10.659-10.659h21.341a10.68 10.68 0 0 0 10.184-10.671 10.68 10.68 0 0 0-10.184-10.67h-21.341A10.66 10.66 0 0 1 373.682 331v-21.341a10.68 10.68 0 0 0-10.67-10.184 10.68 10.68 0 0 0-7.375 2.955 10.68 10.68 0 0 0-3.296 7.229V331a10.66 10.66 0 0 1-10.659 10.659z"
     254                // Teydea Site Assistant plugin icon.
     255                case 'teydea-site-assistant':
     256                        return (
     257                                <div className="tsc-product-icon">
     258                                        <SVG fill="none" height="256" viewBox="0 0 512 512" width="256" xmlns="http://www.w3.org/2000/svg">
     259                                                <Path
     260                                                        fill="#e0f3f7"
     261                                                        d="M372.364 0H139.636C62.5173 0 0 62.5173 0 139.636V372.364C0 449.483 62.5173 512 139.636 512H372.364C449.483 512 512 449.483 512 372.364V139.636C512 62.5173 449.483 0 372.364 0Z"
     262                                                />
     263                                                <Path
     264                                                        fill="#c7e5eb"
     265                                                        d="M256.001 426.658C301.262 426.658 344.67 408.678 376.675 376.673C408.68 344.669 426.66 301.261 426.66 255.999C426.66 210.738 408.68 167.33 376.675 135.325C344.67 103.32 301.262 85.3403 256.001 85.3403C210.739 85.3403 167.331 103.32 135.327 135.325C103.322 167.33 85.3418 210.738 85.3418 255.999C85.3418 301.261 103.322 344.669 135.327 376.673C167.331 408.678 210.739 426.658 256.001 426.658Z"
     266                                                />
     267                                                <Path
     268                                                        fill="#b0dde6"
     269                                                        d="M236.75 140.5C226.162 140.5 217.5 131.838 217.5 121.25V102H294.5V121.25C294.5 131.838 285.838 140.5 275.25 140.5H236.75Z"
     270                                                />
     271                                                <Path
     272                                                        fill="#b0dde6"
     273                                                        d="M159.75 410C149.162 410 140.5 401.338 140.5 390.75V121.25C140.5 110.662 149.162 102 159.75 102H217.5V121.25C217.5 131.838 226.162 140.5 236.75 140.5H275.25C285.838 140.5 294.5 131.838 294.5 121.25V102H352.25C362.838 102 371.5 110.662 371.5 121.25V390.75C371.5 401.338 362.838 410 352.25 410H159.75Z"
     274                                                />
     275                                                <Path
     276                                                        fill="#0e87a0"
     277                                                        d="M352.25 419.625H159.75C143.773 419.625 130.875 406.727 130.875 390.75V121.25C130.875 105.273 143.773 92.375 159.75 92.375H352.25C368.227 92.375 381.125 105.273 381.125 121.25V390.75C381.125 406.727 368.227 419.625 352.25 419.625ZM159.75 111.625C154.36 111.625 150.125 115.86 150.125 121.25V390.75C150.125 396.14 154.36 400.375 159.75 400.375H352.25C357.64 400.375 361.875 396.14 361.875 390.75V121.25C361.875 115.86 357.64 111.625 352.25 111.625H159.75Z"
     278                                                />
     279                                                <Path
     280                                                        fill="#0e87a0"
     281                                                        d="M275.25 150.125H236.75C220.773 150.125 207.875 137.227 207.875 121.25V102C207.875 96.61 212.11 92.375 217.5 92.375C222.89 92.375 227.125 96.61 227.125 102V121.25C227.125 126.64 231.36 130.875 236.75 130.875H275.25C280.64 130.875 284.875 126.64 284.875 121.25V102C284.875 96.61 289.11 92.375 294.5 92.375C299.89 92.375 304.125 96.61 304.125 102V121.25C304.125 137.227 291.227 150.125 275.25 150.125Z"
     282                                                />
     283                                                <Path
     284                                                        fill="#0e87a0"
     285                                                        d="M201.137 243.492L181.888 224.242C178.038 220.392 178.038 214.425 181.888 210.575C185.738 206.725 191.705 206.725 195.555 210.575L208.068 223.087L230.205 200.95C234.055 197.1 240.023 197.1 243.873 200.95C247.723 204.8 247.723 210.767 243.873 214.617L214.998 243.492C211.148 247.342 205.18 247.342 201.33 243.492H201.137Z"
     286                                                />
     287                                                <Path
     288                                                        fill="#0e87a0"
     289                                                        d="M323.375 236.75H275.25C269.86 236.75 265.625 232.515 265.625 227.125C265.625 221.735 269.86 217.5 275.25 217.5H323.375C328.765 217.5 333 221.735 333 227.125C333 232.515 328.765 236.75 323.375 236.75Z"
     290                                                />
     291                                                <Path
     292                                                        fill="#0e87a0"
     293                                                        d="M201.137 301.242L181.888 281.992C178.038 278.142 178.038 272.175 181.888 268.325C185.738 264.475 191.705 264.475 195.555 268.325L208.068 280.837L230.205 258.7C234.055 254.85 240.023 254.85 243.873 258.7C247.723 262.55 247.723 268.517 243.873 272.367L214.998 301.242C211.148 305.092 205.18 305.092 201.33 301.242H201.137Z"
     294                                                />
     295                                                <Path
     296                                                        fill="#0e87a0"
     297                                                        d="M323.375 294.5H275.25C269.86 294.5 265.625 290.265 265.625 284.875C265.625 279.485 269.86 275.25 275.25 275.25H323.375C328.765 275.25 333 279.485 333 284.875C333 290.265 328.765 294.5 323.375 294.5Z"
     298                                                />
     299                                                <Path
     300                                                        fill="#0e87a0"
     301                                                        d="M201.137 358.992L181.888 339.742C178.038 335.892 178.038 329.925 181.888 326.075C185.738 322.225 191.705 322.225 195.555 326.075L208.068 338.587L230.205 316.45C234.055 312.6 240.023 312.6 243.873 316.45C247.723 320.3 247.723 326.267 243.873 330.117L214.998 358.992C211.148 362.842 205.18 362.842 201.33 358.992H201.137Z"
     302                                                />
     303                                                <Path
     304                                                        fill="#0e87a0"
     305                                                        d="M323.375 352.25H275.25C269.86 352.25 265.625 348.015 265.625 342.625C265.625 337.235 269.86 333 275.25 333H323.375C328.765 333 333 337.235 333 342.625C333 348.015 328.765 352.25 323.375 352.25Z"
    271306                                                />
    272307                                        </SVG>
  • password-requirements/trunk/deps/js/components/src/settings-sidebar/index.js

    r3482299 r3748178  
    2020 * SettingsSidebar component
    2121 *
    22  * @param {Object} properties          Component properties object.
    23  * @param {Object} properties.product  Product's data object.
    24  * @param {Object} properties.settings Settings object.
     22 * A screen other than the settings page has no settings of its own and no settings-page data
     23 * to read the help links from, so it hands the links over itself and leaves the settings out.
     24 *
     25 * @param {Object}  properties           Component properties object.
     26 * @param {Object}  properties.product   Product's data object.
     27 * @param {?Object} properties.settings  Settings object, or null on a screen that has none.
     28 * @param {?Array}  properties.helpLinks Help links; read from the settings page's data when not given.
    2529 *
    2630 * @return {Element} Settings component.
    2731 */
    28 export const SettingsSidebar = ( { product, settings } ) => {
     32export const SettingsSidebar = ( { product, settings = null, helpLinks = null } ) => {
    2933        // Destructure the product object.
    3034        const { key: productKey, type: productType } = product;
    3135
    3236        // Collect the necessary data.
    33         const { helpLinks } = window.teydeaStudio[ productKey ].settingsPage;
     37        const links = helpLinks ?? window.teydeaStudio[ productKey ].settingsPage.helpLinks;
    3438        const { slug } = window.teydeaStudio[ productKey ][ productType ];
    3539
    … …  
    4448                                         * Render help links, if provided
    4549                                         */
    46                                         0 < helpLinks.length && (
     50                                        0 < links.length && (
    4751                                                <PanelBody title={ __( 'Help & support', 'password-requirements' ) } className="tsc-settings-sidebar__panel">
    4852                                                        <ul>
    49                                                                 { helpLinks.map( ( { url, title }, index ) => (
     53                                                                { links.map( ( { url, title }, index ) => (
    5054                                                                        <li key={ index }>
    5155                                                                                <a href={ url } target="_blank" rel="noreferrer noopener">
    … …  
    111115                                 *
    112116                                 * @param {Element} panel    The "after sidebar" panel.
    113                                  * @param {Object}  settings Settings object.
     117                                 * @param {?Object} settings Settings object, or null on a screen that has none.
    114118                                 */
    115119                                applyFilters( 'password_requirements__after_sidebar_panel', <Fragment />, settings )
    … …  
    127131                type: PropTypes.oneOf( [ 'plugin', 'theme' ] ),
    128132        } ).isRequired,
    129         settings: PropTypes.object.isRequired,
     133        settings: PropTypes.object,
     134        helpLinks: PropTypes.arrayOf(
     135                PropTypes.shape( {
     136                        url: PropTypes.string.isRequired,
     137                        title: PropTypes.string.isRequired,
     138                } ),
     139        ),
    130140};
  • password-requirements/trunk/deps/js/components/src/settings-tabs/index.js

    r3669586 r3748178  
    6666        return tabs.find( ( tab ) => {
    6767                const tabSlug = toSlug( tab?.name );
    68 
    6968                return '' !== tabSlug && tabSlug === slug;
    7069        } );
  • password-requirements/trunk/deps/js/utils/package.json

    r3669586 r3748178  
    22  "name": "@teydeastudio/utils",
    33  "type": "module",
    4   "private": true,
    5   "devDependencies": {
    6     "@wordpress/scripts": "^34.0.0"
    7   }
     4  "private": true
    85}
  • password-requirements/trunk/deps/php/universal-modules/endpoint-settings/class-module-endpoint-settings.php

    r3669586 r3748178  
    2727         */
    2828        use Utils\With_REST_Helpers;
     29
     30        /**
     31         * Simplify access to the Settings class instance
     32         */
     33        use Utils\With_Settings;
    2934
    3035        /**
  • password-requirements/trunk/deps/php/universal-modules/settings-page/class-module-settings-page.php

    r3669586 r3748178  
    5555
    5656        /**
     57         * Whether to register the settings page as a top-level admin menu,
     58         * rather than as a submenu of the parent slugs above
     59         *
     60         * @var bool
     61         */
     62        protected bool $is_top_level_menu = false;
     63
     64        /**
     65         * Dashicons class name, or an icon URL, of the top-level admin menu
     66         *
     67         * @var string
     68         */
     69        protected string $menu_icon = 'dashicons-admin-generic';
     70
     71        /**
     72         * Position of the top-level admin menu in the admin menu order;
     73         * null appends it at the end of the menu
     74         *
     75         * Fractional, because a position is one slot in an order shared with
     76         * every other plugin on the site. Core resolves a collision by nudging
     77         * the later menu with an offset derived from a hash of its slug and
     78         * title, so two plugins landing on the same integer end up in an order
     79         * neither of them chose. A fraction keeps the placement deliberate.
     80         *
     81         * @var ?float
     82         */
     83        protected ?float $menu_position = null;
     84
     85        /**
    5786         * Help & support links rendered on the settings page sidebar panel
    5887         *
    … …  
    76105                add_action( 'admin_menu', [ $this, 'register_settings_page' ] );
    77106
    78                 // Maybe redirect user to the settings screen.
     107                // Maybe redirect the user who activated the container to where it wants them.
    79108                add_action( 'admin_init', [ $this, 'maybe_redirect_after_activation' ] );
    80109
    … …  
    116145        /**
    117146         * Insert the option flag to redirect the user who has activated
    118          * the container, to the settings page
     147         * the container, to where the container wants them
    119148         *
    120149         * @return void
    … …  
    157186
    158187        /**
     188         * Get the admin file that serves the settings page
     189         *
     190         * A top-level menu is served by `admin.php` on both single-site and
     191         * network installations; the parent slugs only apply to a submenu.
     192         *
     193         * @return string The admin file that serves the settings page.
     194         */
     195        protected function get_menu_parent_file(): string {
     196                if ( $this->is_top_level_menu ) {
     197                        return 'admin.php';
     198                }
     199
     200                return $this->container->is_network_enabled()
     201                        ? $this->network_parent_slug
     202                        : $this->parent_slug;
     203        }
     204
     205        /**
    159206         * Get settings page URL
    160207         *
    … …  
    162209         */
    163210        protected function get_settings_page_url(): string {
     211                $url = add_query_arg(
     212                        [ 'page' => $this->get_page_slug() ],
     213                        $this->get_menu_parent_file(),
     214                );
     215
    164216                return $this->container->is_network_enabled()
    165                         ? network_admin_url(
    166                                 add_query_arg(
    167                                         [ 'page' => $this->get_page_slug() ],
    168                                         $this->network_parent_slug,
    169                                 ),
    170                         )
    171                         : admin_url(
    172                                 add_query_arg(
    173                                         [ 'page' => $this->get_page_slug() ],
    174                                         $this->parent_slug,
    175                                 ),
    176                         );
     217                        ? network_admin_url( $url )
     218                        : admin_url( $url );
     219        }
     220
     221        /**
     222         * Get the URL the user who activated this container is sent to
     223         *
     224         * The settings page is where a container with nothing else to show belongs. A container
     225         * that has somewhere better to send a site owner on their first admin page load, such as
     226         * a setup wizard, answers with that address instead.
     227         *
     228         * @return string The URL to send the activating user to.
     229         */
     230        protected function get_post_activation_url(): string {
     231                return $this->get_settings_page_url();
    177232        }
    178233
    … …  
    183238         */
    184239        public function is_settings_page(): bool {
    185                 return Utils\Settings_Page_URLs::is_current_screen( $this->container );
     240                if ( ! $this->is_top_level_menu ) {
     241                        return Utils\Settings_Page_URLs::is_current_screen( $this->container );
     242                }
     243
     244                $screen = new Utils\Screen( $this->container );
     245
     246                return $screen->is( $this->get_page_slug(), 'toplevel_page' );
    186247        }
    187248
    … …  
    197258                }
    198259
     260                if ( $this->is_top_level_menu ) {
     261                        add_menu_page(
     262                                $this->page_title,
     263                                $this->menu_title,
     264                                $this->container->get_managing_capability(),
     265                                $this->get_page_slug(),
     266                                [ $this, 'render_page' ],
     267                                $this->menu_icon,
     268                                $this->menu_position,
     269                        );
     270
     271                        return;
     272                }
     273
    199274                add_submenu_page(
    200                         (
    201                                 $this->container->is_network_enabled()
    202                                         ? $this->network_parent_slug
    203                                         : $this->parent_slug
    204                         ),
     275                        $this->get_menu_parent_file(),
    205276                        $this->page_title,
    206277                        $this->menu_title,
    … …  
    238309
    239310        /**
    240          * Maybe redirect user to the settings screen
     311         * Maybe redirect the user who activated the container to where it wants them
    241312         *
    242313         * @return void
    … …  
    273344                // No need to worry about the network URL as we skip this action for the network admins.
    274345                wp_safe_redirect(
    275                         $this->get_settings_page_url(),
     346                        $this->get_post_activation_url(),
    276347                );
    277348
  • password-requirements/trunk/deps/php/utils/class-asset.php

    r3669586 r3748178  
    1616 */
    1717final class Asset {
     18        /**
     19         * JSON flags the inline data is encoded with
     20         *
     21         * The data is written into a `<script>` element, where the HTML parser reads the content
     22         * before JavaScript does. PHP escapes forward slashes by default, so no value can produce
     23         * a literal `</script>`, but `<`, `>` and `&` pass through as they are, and a value
     24         * holding `<!--` or `<script` sends the parser into the state it reads a nested script
     25         * in, where the rest of the element is no longer read as script content. Writing the
     26         * three as `\uXXXX` escapes keeps every value out of the parser's way, and JavaScript
     27         * reads the escaped and the unescaped form as the same string.
     28         *
     29         * @var int
     30         */
     31        private const INLINE_DATA_JSON_FLAGS = JSON_HEX_TAG | JSON_HEX_AMP;
     32
    1833        /**
    1934         * Container instance
    … …  
    193208                         */
    194209                        sprintf(
    195                                 'window.teydeaStudio.%1$s.environment=window.teydeaStudio.%1$s.environment||{type:\'%2$s\',domain:\'%3$s\',homeUrl:\'%4$s\'};',
    196                                 esc_attr( Strings::to_camel_case( $this->container->get_slug() ) ),
    197                                 esc_attr( wp_get_environment_type() ),
    198                                 esc_attr( Environment::get_domain() ?? '' ),
    199                                 esc_attr( get_home_url() ),
     210                                'window.teydeaStudio.%1$s.environment=window.teydeaStudio.%1$s.environment||%2$s;',
     211                                esc_attr( Strings::to_camel_case( $this->container->get_slug() ) ),
     212                                wp_json_encode(
     213                                        [
     214                                                'type'    => wp_get_environment_type(),
     215                                                'domain'  => Environment::get_domain() ?? '',
     216                                                'homeUrl' => get_home_url(),
     217                                        ],
     218                                        self::INLINE_DATA_JSON_FLAGS,
     219                                ) ?: '{}',
    200220                        ),
    201221
    … …  
    204224                         */
    205225                        sprintf(
    206                                 'window.teydeaStudio.%1$s.%2$s=window.teydeaStudio.%1$s.%2$s||{name:\'%3$s\',slug:\'%4$s\',dataPrefix:\'%5$s\',isPro:%6$s};',
     226                                'window.teydeaStudio.%1$s.%2$s=window.teydeaStudio.%1$s.%2$s||%3$s;',
    207227                                esc_attr( Strings::to_camel_case( $this->container->get_slug() ) ),
    208228                                esc_attr( $this->container->get_type() ),
    209                                 esc_attr( $this->container->get_name() ),
    210                                 esc_attr( $this->container->get_slug() ),
    211                                 esc_attr( $this->container->get_data_prefix() ),
    212                                 esc_attr( $this->container->get_is_pro() ? 'true' : 'false' ),
     229                                wp_json_encode(
     230                                        [
     231                                                'name'       => $this->container->get_name(),
     232                                                'slug'       => $this->container->get_slug(),
     233                                                'dataPrefix' => $this->container->get_data_prefix(),
     234                                                'isPro'      => $this->container->get_is_pro(),
     235                                        ],
     236                                        self::INLINE_DATA_JSON_FLAGS,
     237                                ) ?: '{}',
    213238                        ),
    214239
    … …  
    220245                                esc_attr( Strings::to_camel_case( $this->container->get_slug() ) ),
    221246                                esc_attr( Strings::to_camel_case( $this->asset_slug ) ),
    222                                 wp_json_encode( $data ) ?: '{}',
     247                                wp_json_encode( $data, self::INLINE_DATA_JSON_FLAGS ) ?: '{}',
    223248                        ),
    224249                ];
    … …  
    263288                                esc_attr( Strings::to_camel_case( $this->container->get_slug() ) ),
    264289                                esc_attr( Strings::to_camel_case( $this->asset_slug ) ),
    265                                 wp_json_encode( $data ) ?: '{}',
     290                                wp_json_encode( $data, self::INLINE_DATA_JSON_FLAGS ) ?: '{}',
    266291                        ),
    267292                ];
  • password-requirements/trunk/deps/php/utils/class-cache.php

    r3669586 r3748178  
    311311                        case 'file':
    312312                                if ( null !== $this->file ) {
    313                                         $modified_at = File::get_modified_time( $this->file );
    314 
    315                                         if ( false === $modified_at ) {
    316                                                 $modified_at = 0;
    317                                         }
    318 
    319                                         $tokens['key'] = sprintf( 'file:%1$s:%2$d', md5( $this->file ), $modified_at );
     313                                        $modified_at   = File::get_modified_time( $this->file );
     314                                        $tokens['key'] = sprintf( 'file:%1$s:%2$d', md5( $this->file ), false === $modified_at ? 0 : $modified_at );
    320315                                }
    321316
    … …  
    323318                }
    324319
    325                 if ( ! empty( $tokens['key'] ) ) {
     320                if ( '' !== $tokens['key'] ) {
    326321                        $tokens['key'] = sprintf( '%1$s:%2$s', $tokens['key'], $this->container->get_version() );
    327322                }
    328323
    329                 return empty( $tokens['key'] ) ? null : $tokens;
     324                return '' === $tokens['key'] ? null : $tokens;
    330325        }
    331326
    … …  
    373368                }
    374369
    375                 /** @var array<int,int|string> $blog_ids */
    376                 $blog_ids = get_sites(
    377                         [
    378                                 'fields' => 'ids',
    379                                 'number' => 0,
    380                         ],
    381                 );
    382 
    383                 foreach ( $blog_ids as $blog_id ) {
    384                         switch_to_blog( Type::ensure_int( $blog_id ) );
     370                foreach ( Network_Sites::ids() as $blog_id ) {
     371                        switch_to_blog( $blog_id );
    385372                        $this->delete();
    386373                        restore_current_blog();
  • password-requirements/trunk/deps/php/utils/class-container.php

    r3669586 r3748178  
    88namespace Teydea_Studio\Login_Security\Dependencies\Utils;
    99
    10 use WP_Role;
    11 use WP_User;
    12 
    1310if ( ! defined( 'ABSPATH' ) ) {
    1411        exit; // @codeCoverageIgnore
    … …  
    2017abstract class Container {
    2118        /**
    22          * Capabilities version
    23          *
    24          * Used to determine whether the custom capabilities should
    25          * be remapped for the user roles.
    26          *
    27          * @var string
    28          */
    29         const CAPABILITIES_VERSION = 'v1';
    30 
    31         /**
    3219         * Request-scoped memo of cache group-version counters
    3320         *
    … …  
    9077
    9178        /**
    92          * Lazy-constructed post-meta registry for this container
    93          *
    94          * @var ?Post_Meta_Registry
    95          */
    96         protected ?Post_Meta_Registry $post_meta_registry = null;
     79         * Objects shared by everything this container runs, keyed by class name
     80         *
     81         * @var array<class-string,object>
     82         */
     83        protected array $shared_instances = [];
    9784
    9885        /**
    … …  
    258245
    259246        /**
    260          * Get (lazy-construct) the post-meta registry for this container
    261          *
    262          * @return Post_Meta_Registry Registry scoped to this container.
    263          */
    264         public function get_post_meta_registry(): Post_Meta_Registry {
    265                 if ( null === $this->post_meta_registry ) {
    266                         $this->post_meta_registry = new Post_Meta_Registry();
     247         * Get (lazy-construct) the instance of a class shared by everything this container runs
     248         *
     249         * The container names no such class itself, so a collaborator only the plugins use, such
     250         * as the post-meta registry, is not shipped with a theme that never asks for it.
     251         *
     252         * @template T of object
     253         *
     254         * @param class-string<T> $class_name Class to instantiate; its constructor takes no arguments.
     255         *
     256         * @return T Instance scoped to this container.
     257         */
     258        public function get_shared_instance( string $class_name ): object {
     259                if ( ! isset( $this->shared_instances[ $class_name ] ) ) {
     260                        $this->shared_instances[ $class_name ] = new $class_name();
    267261                }
    268262
    269                 return $this->post_meta_registry;
     263                /** @var T */
     264                return $this->shared_instances[ $class_name ];
    270265        }
    271266
    … …  
    368363                $this->for_all_modules( 'register' );
    369364
    370                 // Maybe update the capabilities.
    371                 add_action( 'admin_init', [ $this, 'maybe_update_capabilities' ] );
    372 
    373                 // Only plugins can be enabled network-wide.
    374                 if ( 'plugin' === $this->get_type() ) {
    375                         // Add the network-wide capabilities after the user is granted Super Admin privileges.
    376                         add_action( 'granted_super_admin', [ $this, 'add_network_capabilities_to_user' ] );
    377 
    378                         // Remove the network-wide capabilities after the user's Super Admin privileges are revoked.
    379                         add_action( 'revoked_super_admin', [ $this, 'remove_network_capabilities_from_user' ] );
    380                 }
    381         }
     365                $this->register_container_hooks();
     366        }
     367
     368        /**
     369         * Register the hooks this kind of container needs once its modules are registered
     370         *
     371         * @return void
     372         */
     373        protected function register_container_hooks(): void {}
    382374
    383375        /**
    … …  
    454446
    455447        /**
    456          * Get the capability required for managing the
    457          * container's settings
     448         * Get the capability required for managing the container
    458449         *
    459450         * @param string $scope Capability scope, either "network" for managing network options or "single" for managing single site options. Defaults to "detect", which means it will detect whether the container is running on the network level.
    460451         *
    461          * @return string Capability required for managing the container's settings.
    462          */
    463         public function get_managing_capability( $scope = 'detect' ): string {
    464                 $for_network = 'network' === $scope || ( 'detect' === $scope && $this->is_network_enabled() );
    465                 $capability  = $for_network
    466                         ? 'manage_network_options'
    467                         : 'manage_options';
    468 
    469                 return sprintf( '%1$s__%2$s', $this->get_data_prefix(), $capability );
     452         * @return string Capability required for managing the container.
     453         */
     454        abstract public function get_managing_capability( string $scope = 'detect' ): string;
     455
     456        /**
     457         * Get the key of the role standing in for the network's Super Admins
     458         *
     459         * @return string Network Super Admin role key.
     460         */
     461        public function get_network_super_admin_role_key(): string {
     462                return sprintf( '%s:network-super-admin', $this->get_data_prefix() );
    470463        }
    471464
    … …  
    560553                return false;
    561554        }
    562 
    563         /**
    564          * Maybe update the capabilities
    565          *
    566          * @return void
    567          */
    568         public function maybe_update_capabilities(): void {
    569                 // The option key.
    570                 $option_key = sprintf( '%s__capabilities_version', $this->get_data_prefix() );
    571 
    572                 // Get the current capabilities version.
    573                 $capabilities_version = get_option( $option_key, false );
    574 
    575                 // Only proceed if capabilities has not yet been updated.
    576                 if ( self::CAPABILITIES_VERSION !== $capabilities_version ) {
    577                         /**
    578                          * Grant the capability to manage the container
    579                          * options for administrators
    580                          */
    581                         $role = get_role( 'administrator' );
    582 
    583                         if ( $role instanceof WP_Role ) {
    584                                 $role->add_cap( $this->get_managing_capability( 'single' ) );
    585                         }
    586 
    587                         /**
    588                          * Update the option so this will not be executed until
    589                          * the capabilities version changes in the future
    590                          */
    591                         update_option( $option_key, self::CAPABILITIES_VERSION );
    592                 }
    593 
    594                 /**
    595                  * On network installations, grant special capability
    596                  * to manage the network-level container options
    597                  * for Super Admin users
    598                  */
    599                 if ( is_multisite() && 'plugin' === $this->get_type() ) {
    600                         // Get the current network ID.
    601                         $network_id = get_current_network_id();
    602 
    603                         // The option key.
    604                         $network_option_key = sprintf( '%s__network_capabilities_version', $this->get_data_prefix() );
    605 
    606                         // Get the current capabilities version.
    607                         $network_capabilities_version = get_network_option( $network_id, $network_option_key, false );
    608 
    609                         // Only proceed if capabilities has not yet been updated.
    610                         if ( self::CAPABILITIES_VERSION !== $network_capabilities_version ) {
    611                                 $super_admins = get_super_admins();
    612 
    613                                 foreach ( $super_admins as $user_login ) {
    614                                         $user = get_user_by( 'login', $user_login );
    615 
    616                                         if ( $user instanceof WP_User ) {
    617                                                 $user->add_cap( $this->get_managing_capability( 'network' ) );
    618                                         }
    619                                 }
    620 
    621                                 /**
    622                                  * Update the option so this will not be executed until
    623                                  * the capabilities version changes in the future
    624                                  */
    625                                 update_network_option( $network_id, $network_option_key, self::CAPABILITIES_VERSION );
    626                         }
    627                 }
    628         }
    629 
    630         /**
    631          * Add the network-wide capabilities after the user is granted Super Admin privileges
    632          *
    633          * @param int $user_id ID of the user to grant the capabilities to.
    634          *
    635          * @return void
    636          */
    637         public function add_network_capabilities_to_user( int $user_id ): void {
    638                 $user = get_user_by( 'ID', $user_id );
    639 
    640                 if ( $user instanceof WP_User ) {
    641                         $user->add_cap( $this->get_managing_capability( 'network' ) );
    642                 }
    643         }
    644 
    645         /**
    646          * Remove the network-wide capabilities after the user's Super Admin privileges are revoked
    647          *
    648          * @param int $user_id ID of the user to revoke the capabilities from.
    649          *
    650          * @return void
    651          */
    652         public function remove_network_capabilities_from_user( int $user_id ): void {
    653                 $user = get_user_by( 'ID', $user_id );
    654 
    655                 if ( $user instanceof WP_User ) {
    656                         $user->remove_cap( $this->get_managing_capability( 'network' ) );
    657                 }
    658         }
    659 
    660         /**
    661          * Run custom actions on each module during the container activation
    662          *
    663          * Aborts activation with wp_die() if declared runtime requirements
    664          * are not met, so the plugin remains inactive afterwards.
    665          *
    666          * @return void
    667          */
    668         public function on_activation(): void {
    669                 $requirements = $this->get_requirements();
    670                 $requirements->check();
    671 
    672                 if ( $requirements->has_failures() ) {
    673                         $requirements->abort_activation();
    674                 }
    675 
    676                 $this->maybe_update_capabilities();
    677                 $this->for_all_modules( 'on_container_activation' );
    678         }
    679 
    680         /**
    681          * Run custom actions on each module during the container deactivation
    682          *
    683          * @return void
    684          */
    685         public function on_deactivation(): void {
    686                 $this->for_all_modules( 'on_container_deactivation' );
    687         }
    688555}
  • password-requirements/trunk/deps/php/utils/class-date-time.php

    r3669586 r3748178  
    4040                $modifier = Strings::trim( $modifier );
    4141
    42                 if ( ! empty( $modifier ) ) {
     42                if ( '' !== $modifier ) {
    4343                        $datetime->modify( $modifier );
    4444                }
    … …  
    105105                $modifier  = Strings::trim( $modifier );
    106106
    107                 if ( ! empty( $modifier ) ) {
     107                if ( '' !== $modifier ) {
    108108                        $timestamp = strtotime( $modifier, $timestamp );
    109109
    … …  
    142142        public static function parse_utc_datetime( string $datetime ): int {
    143143                $parsed = DateTimeImmutable::createFromFormat( 'Y-m-d H:i:s', $datetime, new DateTimeZone( 'UTC' ) );
    144 
    145144                return false !== $parsed ? $parsed->getTimestamp() : 0;
    146145        }
    … …  
    192191                try {
    193192                        $datetime = new DateTime( $value, wp_timezone() );
    194 
    195193                        return $datetime->getTimestamp();
    196194                } catch ( Exception $exception ) {
  • password-requirements/trunk/deps/php/utils/class-debug.php

    r3669586 r3748178  
    2828                $message = is_string( $error ) ? $error : $error->get_error_message();
    2929
    30                 if ( empty( $message ) ) {
     30                if ( '' === $message ) {
    3131                        $message = 'An error occurred, but no message was provided.';
    3232                }
    3333
    34                 if ( is_wp_error( $error ) && $error->get_error_code() ) {
     34                if ( is_wp_error( $error ) && ! in_array( $error->get_error_code(), [ 0, '', '0' ], true ) ) {
    3535                        $message = sprintf(
    3636                                'Error code: %s. %s',
  • password-requirements/trunk/deps/php/utils/class-module.php

    r3669586 r3748178  
    1616 */
    1717abstract class Module {
    18         /**
    19          * Simplify access to the Settings class instance
    20          */
    21         use With_Settings;
    22 
    2318        /**
    2419         * Container instance
  • password-requirements/trunk/deps/php/utils/class-nested-array.php

    r3669586 r3748178  
    1616 *
    1717 * Stateless helpers for converting between flat dot-notation keys and
    18  * nested array structures.
     18 * nested array structures, and for merging one nested structure into another.
    1919 */
    2020final class Nested_Array {
    … …  
    4545
    4646                return $flat;
     47        }
     48
     49        /**
     50         * Merge one nested array into another
     51         *
     52         * What is in the overlay decides how it lands. A list replaces whatever it lands on: a
     53         * list stands for the whole of something - a color palette, a set of choices - so merging
     54         * it entry by entry would leave behind the entries the overlay dropped and renumber the
     55         * rest. Anything else merges into what it lands on, list or map.
     56         *
     57         * An empty array is the one value that could be either. JSON decoded into arrays turns
     58         * `{}` and `[]` into the same thing, so what it lands on is what says which it was: over
     59         * a map it reads as an empty map and changes nothing, over a list it reads as an empty
     60         * list and replaces it. Reading it as a list everywhere would have an empty `styles`
     61         * object in an overlay wipe out every style the base held.
     62         *
     63         * @param array<mixed> $base    Data to merge into.
     64         * @param array<mixed> $overlay Data to merge in.
     65         *
     66         * @return array<mixed> Merged data.
     67         */
     68        public static function merge( array $base, array $overlay ): array {
     69                foreach ( $overlay as $key => $value ) {
     70                        if ( is_array( $value ) && isset( $base[ $key ] ) && is_array( $base[ $key ] ) && self::merges_into( $value, $base[ $key ] ) ) {
     71                                $base[ $key ] = self::merge( $base[ $key ], $value );
     72                                continue;
     73                        }
     74
     75                        $base[ $key ] = $value;
     76                }
     77
     78                return $base;
     79        }
     80
     81        /**
     82         * Check whether an overlay value merges into what it lands on rather than replacing it
     83         *
     84         * @param array<mixed> $value Overlay value.
     85         * @param array<mixed> $base  What it lands on.
     86         *
     87         * @return bool Whether the value merges in.
     88         */
     89        private static function merges_into( array $value, array $base ): bool {
     90                if ( [] === $value ) {
     91                        return ! self::is_list( $base );
     92                }
     93
     94                return ! self::is_list( $value );
     95        }
     96
     97        /**
     98         * Polyfill for the PHP 8.1 "array_is_list" function
     99         *
     100         * @param array<mixed> $value Array to check.
     101         *
     102         * @return bool Whether the array is a list rather than a map.
     103         */
     104        public static function is_list( array $value ): bool {
     105                if ( function_exists( 'array_is_list' ) ) {
     106                        return array_is_list( $value );
     107                }
     108
     109                return self::is_list_by_keys( $value );
     110        }
     111
     112        /**
     113         * Check whether an array's keys count up from zero without gaps
     114         *
     115         * This is the same check "array_is_list" makes, kept as its own method so that it can be
     116         * tested on the PHP versions that also have the native function.
     117         *
     118         * @param array<mixed> $value Array to check.
     119         *
     120         * @return bool Whether the array is a list rather than a map.
     121         */
     122        public static function is_list_by_keys( array $value ): bool {
     123                $index = 0;
     124
     125                foreach ( array_keys( $value ) as $key ) {
     126                        if ( $key !== $index ) {
     127                                return false;
     128                        }
     129
     130                        ++$index;
     131                }
     132
     133                return true;
    47134        }
    48135
  • password-requirements/trunk/deps/php/utils/class-plugin.php

    r3669586 r3748178  
    88namespace Teydea_Studio\Login_Security\Dependencies\Utils;
    99
     10use WP_Role;
     11use WP_User;
     12
    1013if ( ! defined( 'ABSPATH' ) ) {
    1114        exit; // @codeCoverageIgnore
    … …  
    1720final class Plugin extends Container {
    1821        /**
     22         * Capabilities version
     23         *
     24         * Used to determine whether the custom capabilities should
     25         * be remapped for the user roles.
     26         *
     27         * @var string
     28         */
     29        const CAPABILITIES_VERSION = 'v1';
     30
     31        /**
    1932         * Whether the plugin is currently being activated network-wide
    2033         *
    … …  
    4659        public function get_activate_capability(): string {
    4760                return 'activate_plugins';
     61        }
     62
     63        /**
     64         * Get the capability required for managing the plugin's settings
     65         *
     66         * @param string $scope Capability scope, either "network" for managing network options or "single" for managing single site options. Defaults to "detect", which means it will detect whether the plugin is running on the network level.
     67         *
     68         * @return string Capability required for managing the plugin's settings.
     69         */
     70        public function get_managing_capability( string $scope = 'detect' ): string {
     71                $for_network = 'network' === $scope || ( 'detect' === $scope && $this->is_network_enabled() );
     72                $capability  = $for_network
     73                        ? 'manage_network_options'
     74                        : 'manage_options';
     75
     76                return sprintf( '%1$s__%2$s', $this->get_data_prefix(), $capability );
    4877        }
    4978
    … …  
    115144                $this->is_being_activated_network_wide = $network_wide;
    116145        }
     146
     147        /**
     148         * Register the capability hooks once the modules are registered
     149         *
     150         * @return void
     151         */
     152        protected function register_container_hooks(): void {
     153                // Maybe update the capabilities.
     154                add_action( 'admin_init', [ $this, 'maybe_update_capabilities' ] );
     155
     156                // Add the network-wide capabilities after the user is granted Super Admin privileges.
     157                add_action( 'granted_super_admin', [ $this, 'add_network_capabilities_to_user' ] );
     158
     159                // Remove the network-wide capabilities after the user's Super Admin privileges are revoked.
     160                add_action( 'revoked_super_admin', [ $this, 'remove_network_capabilities_from_user' ] );
     161        }
     162
     163        /**
     164         * Maybe update the capabilities
     165         *
     166         * @return void
     167         */
     168        public function maybe_update_capabilities(): void {
     169                // The option key.
     170                $option_key = sprintf( '%s__capabilities_version', $this->get_data_prefix() );
     171
     172                // Get the current capabilities version.
     173                $capabilities_version = get_option( $option_key, false );
     174
     175                // Only proceed if capabilities has not yet been updated.
     176                if ( self::CAPABILITIES_VERSION !== $capabilities_version ) {
     177                        /**
     178                         * Grant the capability to manage the plugin
     179                         * options for administrators
     180                         */
     181                        $role = get_role( 'administrator' );
     182
     183                        if ( $role instanceof WP_Role ) {
     184                                $role->add_cap( $this->get_managing_capability( 'single' ) );
     185                                $this->refresh_current_user_capabilities();
     186                        }
     187
     188                        /**
     189                         * Update the option so this will not be executed until
     190                         * the capabilities version changes in the future
     191                         */
     192                        update_option( $option_key, self::CAPABILITIES_VERSION );
     193                }
     194
     195                /**
     196                 * On network installations, grant special capability
     197                 * to manage the network-level plugin options
     198                 * for Super Admin users
     199                 */
     200                if ( ! is_multisite() ) {
     201                        return;
     202                }
     203
     204                $network_id                   = get_current_network_id();
     205                $network_option_key           = sprintf( '%s__network_capabilities_version', $this->get_data_prefix() );
     206                $network_capabilities_version = get_network_option( $network_id, $network_option_key, false );
     207
     208                // Only proceed if capabilities has not yet been updated.
     209                if ( self::CAPABILITIES_VERSION === $network_capabilities_version ) {
     210                        return;
     211                }
     212
     213                foreach ( get_super_admins() as $user_login ) {
     214                        $user = get_user_by( 'login', $user_login );
     215
     216                        if ( $user instanceof WP_User ) {
     217                                $user->add_cap( $this->get_managing_capability( 'network' ) );
     218                        }
     219                }
     220
     221                /**
     222                 * Update the option so this will not be executed until
     223                 * the capabilities version changes in the future
     224                 */
     225                update_network_option( $network_id, $network_option_key, self::CAPABILITIES_VERSION );
     226        }
     227
     228        /**
     229         * Rebuild the loaded user's capability list after a role has been changed
     230         *
     231         * WordPress builds the current user's capability list once, when the user is first
     232         * loaded, and on an admin page that happens before `admin_init`. Granting a capability
     233         * to a role after that point updates the role and the option it is stored in, but not
     234         * the list the loaded user already carries, so the grant is not visible until the next
     235         * request. A new capabilities version is granted on the first admin page after an
     236         * update, which is the page the site owner is looking at.
     237         *
     238         * @return void
     239         */
     240        private function refresh_current_user_capabilities(): void {
     241                $user = wp_get_current_user();
     242
     243                if ( 0 !== $user->ID ) {
     244                        $user->get_role_caps();
     245                }
     246        }
     247
     248        /**
     249         * Add the network-wide capabilities after the user is granted Super Admin privileges
     250         *
     251         * @param int $user_id ID of the user to grant the capabilities to.
     252         *
     253         * @return void
     254         */
     255        public function add_network_capabilities_to_user( int $user_id ): void {
     256                $user = get_user_by( 'ID', $user_id );
     257
     258                if ( $user instanceof WP_User ) {
     259                        $user->add_cap( $this->get_managing_capability( 'network' ) );
     260                }
     261        }
     262
     263        /**
     264         * Remove the network-wide capabilities after the user's Super Admin privileges are revoked
     265         *
     266         * @param int $user_id ID of the user to revoke the capabilities from.
     267         *
     268         * @return void
     269         */
     270        public function remove_network_capabilities_from_user( int $user_id ): void {
     271                $user = get_user_by( 'ID', $user_id );
     272
     273                if ( $user instanceof WP_User ) {
     274                        $user->remove_cap( $this->get_managing_capability( 'network' ) );
     275                }
     276        }
     277
     278        /**
     279         * Run custom actions on each module during the plugin activation
     280         *
     281         * Aborts activation with wp_die() if declared runtime requirements
     282         * are not met, so the plugin remains inactive afterwards.
     283         *
     284         * @return void
     285         */
     286        public function on_activation(): void {
     287                $requirements = $this->get_requirements();
     288                $requirements->check();
     289
     290                if ( $requirements->has_failures() ) {
     291                        $requirements->abort_activation();
     292                }
     293
     294                $this->maybe_update_capabilities();
     295                $this->for_all_modules( 'on_container_activation' );
     296        }
     297
     298        /**
     299         * Run custom actions on each module during the plugin deactivation
     300         *
     301         * @return void
     302         */
     303        public function on_deactivation(): void {
     304                $this->for_all_modules( 'on_container_deactivation' );
     305        }
    117306}
  • password-requirements/trunk/deps/php/utils/class-runtime-requirements.php

    r3669586 r3748178  
    127127         */
    128128        public function has_failures(): bool {
    129                 return ! empty( $this->failures );
     129                return [] !== $this->failures;
    130130        }
    131131
    … …  
    156156                }
    157157
    158                 if ( empty( $this->failures ) ) {
     158                if ( [] === $this->failures ) {
    159159                        return;
    160160                }
    … …  
    181181         */
    182182        public function abort_activation(): void {
    183                 if ( empty( $this->failures ) ) {
     183                if ( [] === $this->failures ) {
    184184                        return;
    185185                }
  • password-requirements/trunk/deps/php/utils/class-screen.php

    r3669586 r3748178  
    5959                }
    6060
    61                 $valid_id  = ! empty( $type ) ? sprintf( '%1$s_%2$s', $type, $screen_key ) : $screen_key;
     61                $valid_id  = '' !== $type ? sprintf( '%1$s_%2$s', $type, $screen_key ) : $screen_key;
    6262                $valid_ids = [ $valid_id ];
    6363
  • password-requirements/trunk/deps/php/utils/class-type.php

    r3669586 r3748178  
    7979                                 */
    8080                                function ( $value ): bool {
    81                                         return is_string( $value ) && ! empty( $value );
     81                                        return is_string( $value ) && '' !== $value;
    8282                                },
    8383                        ),
    … …  
    217217         */
    218218        public static function is_date( $value ): bool {
    219                 if ( ! is_string( $value ) || empty( $value ) ) {
     219                if ( ! is_string( $value ) || '' === $value ) {
    220220                        return false;
    221221                }
    … …  
    247247                }
    248248
    249                 if ( is_string( $value ) && preg_match( '/^[1-9]\d*$/', $value ) ) {
     249                if ( is_string( $value ) && 1 === preg_match( '/^[1-9]\d*$/', $value ) ) {
    250250                        return true;
    251251                }
    … …  
    283283                }
    284284
    285                 if ( ! preg_match( '/^[^\s#?]+$/', $authority, $matches, PREG_UNMATCHED_AS_NULL ) ) {
     285                if ( 1 !== preg_match( '/^[^\s#?]+$/', $authority, $matches, PREG_UNMATCHED_AS_NULL ) ) {
    286286                        return false;
    287287                }
  • password-requirements/trunk/deps/php/utils/class-user.php

    r3669586 r3748178  
    104104
    105105        /**
     106         * Check whether the user has every capability on a list
     107         *
     108         * An empty list passes, because there is then no capability the user is missing.
     109         *
     110         * @param string[] $capabilities Capabilities to check.
     111         *
     112         * @return bool Boolean "true" if user has every one of the given capabilities, "false" otherwise.
     113         */
     114        public function can_all( array $capabilities ): bool {
     115                foreach ( $capabilities as $capability ) {
     116                        if ( ! $this->can( $capability ) ) {
     117                                return false;
     118                        }
     119                }
     120
     121                return true;
     122        }
     123
     124        /**
    106125         * Delete user meta
    107126         *
    … …  
    264283
    265284                if ( true === $this->container->is_network_enabled() && $this->is_super_admin() ) {
    266                         $users   = new Users( $this->container );
    267                         $roles[] = $users->get_network_super_admin_role_key();
     285                        $roles[] = $this->container->get_network_super_admin_role_key();
    268286                }
    269287
    … …  
    292310         */
    293311        public function has_plugin_managing_permissions(): bool {
    294                 return $this->can( 'install_plugins' ) && $this->can( 'activate_plugins' );
     312                return $this->can_all( [ 'install_plugins', 'activate_plugins' ] );
    295313        }
    296314
  • password-requirements/trunk/deps/php/utils/class-users.php

    r3669586 r3748178  
    99
    1010use Teydea_Studio\Login_Security\User;
    11 use WP_Site;
    1211use WP_User;
    1312use WP_User_Query;
    … …  
    135134
    136135                $roles        = array_values( $roles );
    137                 $explicit_ids = empty( $users ) ? [] : $this->maybe_map_user_logins_to_user_ids( $users );
     136                $explicit_ids = [] === $users ? [] : $this->maybe_map_user_logins_to_user_ids( $users );
    138137
    139138                // The mapper preserves duplicates (a login and its own numeric ID resolve alike); de-duplicate so the explicit-user counts below don't double-count.
    140139                $explicit_ids = array_values( array_unique( $explicit_ids, SORT_NUMERIC ) );
    141140
    142                 if ( empty( $roles ) ) {
     141                if ( [] === $roles ) {
    143142                        // Explicit-users-only coverage: the resolved explicit set is the whole covered set.
    144143                        $count = count( $explicit_ids );
    … …  
    153152                $count = $this->count_users_in_roles( $roles, [] );
    154153
    155                 if ( ! empty( $explicit_ids ) ) {
     154                if ( [] !== $explicit_ids ) {
    156155                        // Union: add the explicit users the role match did not already include.
    157156                        $count += count( $explicit_ids ) - $this->count_users_in_roles( $roles, $explicit_ids );
    … …  
    181180                ];
    182181
    183                 if ( ! empty( $include_ids ) ) {
     182                if ( [] !== $include_ids ) {
    184183                        $args['include'] = $include_ids;
    185184                }
    … …  
    204203                }
    205204
    206                 return ! empty( array_intersect( $user->roles, $roles ) );
     205                return [] !== array_intersect( $user->roles, $roles );
     206        }
     207
     208        /**
     209         * Add the roles the other sites of the network know and the current site does not
     210         *
     211         * @param array<int,array{value:string,title:string,id:int}> $data Roles collected so far.
     212         * @param array<string,true>                                 $seen Role slugs already collected, keyed by slug.
     213         *
     214         * @return array<int,array{value:string,title:string,id:int}> Roles with the other sites' unique roles appended.
     215         */
     216        private function collect_other_sites_roles( array $data, array $seen ): array {
     217                $current_blog_id = get_current_blog_id();
     218
     219                foreach ( Network_Sites::ids() as $blog_id ) {
     220                        if ( $blog_id === $current_blog_id ) {
     221                                continue;
     222                        }
     223
     224                        switch_to_blog( $blog_id );
     225
     226                        $site_roles = wp_roles();
     227
     228                        foreach ( $site_roles->role_names as $role => $display_name ) {
     229                                if ( isset( $seen[ $role ] ) ) {
     230                                        continue;
     231                                }
     232
     233                                $seen[ $role ] = true;
     234
     235                                $data[] = [
     236                                        'id'    => count( $data ),
     237                                        'value' => $role,
     238                                        'title' => $display_name,
     239                                ];
     240                        }
     241
     242                        restore_current_blog();
     243                }
     244
     245                return $data;
    207246        }
    208247
    … …  
    239278
    240279                        if ( true === $this->container->is_network_enabled() ) {
    241                                 $current_blog_id = get_current_blog_id();
    242 
    243                                 /** @var WP_Site $site */
    244                                 foreach ( get_sites( [ 'number' => 0 ] ) as $site ) {
    245                                         if ( Type::ensure_int( $site->blog_id ) === $current_blog_id ) {
    246                                                 continue;
    247                                         }
    248 
    249                                         switch_to_blog( Type::ensure_int( $site->blog_id ) );
    250 
    251                                         $site_roles = wp_roles();
    252 
    253                                         foreach ( $site_roles->role_names as $role => $display_name ) {
    254                                                 // Add unique roles only.
    255                                                 if ( isset( $seen[ $role ] ) ) {
    256                                                         continue;
    257                                                 }
    258 
    259                                                 $seen[ $role ] = true;
    260 
    261                                                 $data[] = [
    262                                                         'id'    => count( $data ),
    263                                                         'value' => $role,
    264                                                         'title' => $display_name,
    265                                                 ];
    266                                         }
    267 
    268                                         restore_current_blog();
    269                                 }
     280                                $data = $this->collect_other_sites_roles( $data, $seen );
    270281
    271282                                /**
    … …  
    279290                                $data[] = [
    280291                                        'id'    => count( $data ), // Ensure a unique ID.
    281                                         'value' => $this->get_network_super_admin_role_key(),
     292                                        'value' => $this->container->get_network_super_admin_role_key(),
    282293                                        'title' => __( 'Network Super Admin', 'password-requirements' ),
    283294                                ];
    … …  
    299310
    300311                return $data;
    301         }
    302 
    303         /**
    304          * Get the Network Super Admin role key
    305          *
    306          * @return string Network Super Admin role key.
    307          */
    308         public function get_network_super_admin_role_key(): string {
    309                 return sprintf( '%s:network-super-admin', $this->container->get_data_prefix() );
    310312        }
    311313
    … …  
    356358
    357359                if ( true === $this->container->is_network_enabled() ) {
    358                         /** @var WP_Site $site */
    359                         foreach ( get_sites( [ 'number' => 0 ] ) as $site ) {
    360                                 switch_to_blog( Type::ensure_int( $site->blog_id ) );
     360                        foreach ( Network_Sites::ids() as $blog_id ) {
     361                                switch_to_blog( $blog_id );
    361362
    362363                                $results = array_merge(
    … …  
    410411         */
    411412        protected function get_site_users( bool $include_all, array $roles, array $users ): array {
    412                 if ( false === $include_all && empty( $roles ) && empty( $users ) ) {
     413                if ( true === $include_all ) {
     414                        return array_unique( Type::ensure_array_of_ints( get_users( [ 'fields' => 'ID' ] ) ), SORT_NUMERIC );
     415                }
     416
     417                if ( [] === $roles && [] === $users ) {
    413418                        return [];
    414419                }
    … …  
    416421                $results = [];
    417422
    418                 if ( true === $include_all ) {
    419                         $results = get_users( [ 'fields' => 'ID' ] );
    420                 } else {
    421                         if ( ! empty( $roles ) ) {
    422                                 $results = array_merge(
    423                                         $results,
    424                                         get_users(
    425                                                 [
    426                                                         'role__in' => $roles,
    427                                                         'fields'   => 'ID',
    428                                                 ],
    429                                         ),
    430                                 );
    431 
    432                                 /**
    433                                  * Do we need to include Network Super Admins?
    434                                  */
    435                                 if ( true === $this->container->is_network_enabled() && in_array( $this->get_network_super_admin_role_key(), $roles, true ) ) {
    436                                         $super_admins = get_super_admins();
    437 
    438                                         if ( ! empty( $super_admins ) ) {
    439                                                 $results = array_merge(
    440                                                         $results,
    441                                                         get_users(
    442                                                                 [
    443                                                                         'include' => $this->maybe_map_user_logins_to_user_ids( $super_admins ),
    444                                                                         'fields'  => 'ID',
    445                                                                 ],
    446                                                         ),
    447                                                 );
    448                                         }
     423                if ( [] !== $roles ) {
     424                        $results = array_merge(
     425                                $results,
     426                                get_users(
     427                                        [
     428                                                'role__in' => $roles,
     429                                                'fields'   => 'ID',
     430                                        ],
     431                                ),
     432                        );
     433
     434                        /**
     435                         * Do we need to include Network Super Admins?
     436                         */
     437                        if ( true === $this->container->is_network_enabled() && in_array( $this->container->get_network_super_admin_role_key(), $roles, true ) ) {
     438                                $super_admins = get_super_admins();
     439
     440                                if ( [] !== $super_admins ) {
     441                                        $results = array_merge(
     442                                                $results,
     443                                                get_users(
     444                                                        [
     445                                                                'include' => $this->maybe_map_user_logins_to_user_ids( $super_admins ),
     446                                                                'fields'  => 'ID',
     447                                                        ],
     448                                                ),
     449                                        );
    449450                                }
    450451                        }
    451 
    452                         if ( ! empty( $users ) ) {
    453                                 $results = array_merge(
    454                                         $results,
    455                                         get_users(
    456                                                 [
    457                                                         'include' => $users,
    458                                                         'fields'  => 'ID',
    459                                                 ],
    460                                         ),
    461                                 );
    462                         }
     452                }
     453
     454                if ( [] !== $users ) {
     455                        $results = array_merge(
     456                                $results,
     457                                get_users(
     458                                        [
     459                                                'include' => $users,
     460                                                'fields'  => 'ID',
     461                                        ],
     462                                ),
     463                        );
    463464                }
    464465
    … …  
    502503                        $roles = $this->strip_super_admin_sentinel( $roles );
    503504
    504                         if ( empty( $roles ) ) {
     505                        if ( [] === $roles ) {
    505506                                return [];
    506507                        }
    … …  
    536537         */
    537538        public function get_explicit_coverage_ids( array $roles, array $user_logins ): array {
    538                 $resolved     = empty( $user_logins ) ? [] : $this->maybe_map_user_logins_to_user_ids( $user_logins );
     539                $resolved     = [] === $user_logins ? [] : $this->maybe_map_user_logins_to_user_ids( $user_logins );
    539540                $super_admins = $this->resolve_super_admins_for_sentinel( $roles );
    540541
    … …  
    557558                }
    558559
    559                 $sentinel = $this->get_network_super_admin_role_key();
     560                $sentinel = $this->container->get_network_super_admin_role_key();
    560561
    561562                return array_values( array_filter( $roles, static fn ( string $role ): bool => $role !== $sentinel ) );
    … …  
    574575                }
    575576
    576                 if ( ! in_array( $this->get_network_super_admin_role_key(), $roles, true ) ) {
     577                if ( ! in_array( $this->container->get_network_super_admin_role_key(), $roles, true ) ) {
    577578                        return [];
    578579                }
    … …  
    580581                $super_admins = get_super_admins();
    581582
    582                 return empty( $super_admins ) ? [] : $this->maybe_map_user_logins_to_user_ids( $super_admins );
     583                return [] === $super_admins ? [] : $this->maybe_map_user_logins_to_user_ids( $super_admins );
    583584        }
    584585
  • password-requirements/trunk/deps/php/utils/trait-with-rest-helpers.php

    r3669586 r3748178  
    4949                         * Validate the nonce value against the prefixed action
    5050                         *
    51                          * @param string $value Nonce value.
     51                         * The value arrives as the request wrote it, whatever the `type` above says.
     52                         * WordPress wires `rest_validate_request_arg` in as an argument's default
     53                         * validator only, so an argument that names a `validate_callback` of its own is
     54                         * never checked against its schema, and a request body naming an array or a
     55                         * number for the nonce reaches this closure with one. `has_valid_params()` runs
     56                         * before the route's `permission_callback`, so the caller handing it over does
     57                         * not have to be signed in.
     58                         *
     59                         * @param mixed $value Nonce value, as the request carried it.
    5260                         *
    5361                         * @return bool Whether the nonce value is valid.
    5462                         */
    55                         'validate_callback' => function ( string $value ) use ( $action ): bool {
     63                        'validate_callback' => function ( $value ) use ( $action ): bool {
     64                                if ( ! is_string( $value ) ) {
     65                                        return false;
     66                                }
     67
    5668                                $nonce = new Nonce( $this->container, $action );
     69
    5770                                return false !== wp_verify_nonce( $value, $nonce->get_action() );
    5871                        },
  • password-requirements/trunk/deps/php/utils/trait-with-settings.php

    r3669586 r3748178  
    1515/**
    1616 * The "With_Settings" trait
     17 *
     18 * Mixed in by each class that reads the settings, rather than by `Module`, so a package
     19 * whose modules never read any, such as a theme, ships without the settings classes.
     20 *
     21 * @phpstan-ignore trait.unused (Consumed only by classes in other packages; composer-utils itself never mixes it in, so PHPStan reports it as unused here. The body is analyzed in every consumer package that uses it.)
    1722 */
    1823trait With_Settings {
  • password-requirements/trunk/deps/php/validatable-fields/class-closures.php

    r3669586 r3748178  
    418418                        if ( Utils\Type::is_date( $value ) ) {
    419419                                return true;
     420                        }
     421
     422                        if ( ! mb_check_encoding( $value, 'UTF-8' ) ) {
     423                                return new WP_Error(
     424                                        'field_value_incorrect',
     425                                        __( 'The date given could not be read as text.', 'password-requirements' ),
     426                                );
    420427                        }
    421428
    … …  
    546553                        }
    547554
    548                         if ( 1 !== preg_match( $pattern, $value ) ) {
     555                        if ( 1 === preg_match( $pattern, $value ) ) {
     556                                return true;
     557                        }
     558
     559                        if ( ! mb_check_encoding( $value, 'UTF-8' ) ) {
    549560                                return new WP_Error(
    550561                                        'field_value_incorrect',
    551                                         sprintf(
    552                                                 // Translators: %s - invalid unit value.
    553                                                 __( '"%s" is not a valid unit value.', 'password-requirements' ),
    554                                                 $value,
    555                                         ),
    556                                 );
    557                         }
    558 
    559                         return true;
     562                                        __( 'The unit value given could not be read as text.', 'password-requirements' ),
     563                                );
     564                        }
     565
     566                        return new WP_Error(
     567                                'field_value_incorrect',
     568                                sprintf(
     569                                        // Translators: %s - invalid unit value.
     570                                        __( '"%s" is not a valid unit value.', 'password-requirements' ),
     571                                        $value,
     572                                ),
     573                        );
    560574                };
    561575        }
    … …  
    582596                        }
    583597
    584                         return is_email( $value )
     598                        return false !== is_email( $value )
    585599                                ? sanitize_email( $value )
    586600                                : sanitize_url( $value );
    … …  
    614628                        }
    615629
    616                         if ( '' === $value || is_email( $value ) ) {
     630                        // Checked first because Type::is_url() ignores the encoding and would accept a URL carrying malformed bytes.
     631                        if ( ! mb_check_encoding( $value, 'UTF-8' ) ) {
     632                                return new WP_Error(
     633                                        'field_value_incorrect',
     634                                        __( 'The URL given could not be read as text.', 'password-requirements' ),
     635                                );
     636                        }
     637
     638                        if ( '' === $value || false !== is_email( $value ) ) {
    617639                                return true;
    618640                        }
    … …  
    653675                        }
    654676
    655                         if ( isset( $query_args['post_type__in'] ) && is_array( $query_args['post_type__in'] ) ) {
    656                                 $known_post_types = $query_args['post_type__in'];
    657                         } else {
    658                                 /** @var array<string,string> $found_post_types */
    659                                 $found_post_types = get_post_types( $query_args );
    660                                 $known_post_types = array_values( $found_post_types );
    661                         }
     677                        $known_post_types = self::resolve_known_post_types( $query_args );
    662678
    663679                        $valid_post_types = [];
    … …  
    700716                        }
    701717
    702                         if ( isset( $query_args['post_type__in'] ) && is_array( $query_args['post_type__in'] ) ) {
    703                                 $known_post_types = $query_args['post_type__in'];
    704                         } else {
    705                                 /** @var array<string,string> $found_post_types */
    706                                 $found_post_types = get_post_types( $query_args );
    707                                 $known_post_types = array_values( $found_post_types );
    708                         }
     718                        $known_post_types = self::resolve_known_post_types( $query_args );
     719
     720                        $position = 0;
    709721
    710722                        foreach ( $values as $value ) {
     723                                ++$position;
     724
    711725                                if ( ! in_array( $value, $known_post_types, true ) ) {
    712726                                        /** @var string[] $known_post_types */
    … …  
    714728                                                'field_value_out_of_scope',
    715729                                                sprintf(
    716                                                         // Translators: %1$s - invalid value, %2$s - list of known values.
    717                                                         __( '"%1$s" is not a value within "%2$s".', 'password-requirements' ),
    718                                                         Utils\Type::ensure_string( $value ),
     730                                                        // Translators: %1$d - position of the offending entry in the list, %2$s - list of known values.
     731                                                        __( 'Entry %1$d is not a value within "%2$s".', 'password-requirements' ),
     732                                                        $position,
    719733                                                        implode( ', ', $known_post_types ),
    720734                                                ),
    … …  
    744758                 */
    745759                return function ( $values ) use ( $users ): array {
     760                        if ( ! is_array( $values ) ) {
     761                                return [];
     762                        }
     763
    746764                        $known_roles = array_column( $users->get_known_user_roles(), 'value' );
    747765                        $valid_roles = [];
    748766
    749                         if ( is_array( $values ) ) {
    750                                 foreach ( $values as $value ) {
    751                                         if ( in_array( $value, $known_roles, true ) ) {
    752                                                 $valid_roles[] = $value;
    753                                         }
     767                        foreach ( $values as $value ) {
     768                                if ( in_array( $value, $known_roles, true ) ) {
     769                                        $valid_roles[] = $value;
    754770                                }
    755771                        }
    … …  
    788804
    789805                        $known_roles = array_column( $users->get_known_user_roles(), 'value' );
     806                        $position    = 0;
    790807
    791808                        foreach ( $values as $value ) {
     809                                ++$position;
     810
    792811                                if ( ! in_array( $value, $known_roles, true ) ) {
    793812                                        return new WP_Error(
    794813                                                'field_value_out_of_scope',
    795814                                                sprintf(
    796                                                         // Translators: %1$s - invalid value, %2$s - list of known values.
    797                                                         __( '"%1$s" is not a value within "%2$s".', 'password-requirements' ),
    798                                                         Utils\Type::ensure_string( $value ),
     815                                                        // Translators: %1$d - position of the offending entry in the list, %2$s - list of known values.
     816                                                        __( 'Entry %1$d is not a value within "%2$s".', 'password-requirements' ),
     817                                                        $position,
    799818                                                        implode( ', ', $known_roles ),
    800819                                                ),
    … …  
    866885
    867886                        $known_logins = self::resolve_known_user_logins( $values );
     887                        $position     = 0;
    868888
    869889                        foreach ( $values as $value ) {
     890                                ++$position;
     891
    870892                                if ( ! is_string( $value ) ) {
    871893                                        return new WP_Error(
    … …  
    883905                                                'field_value_out_of_scope',
    884906                                                sprintf(
    885                                                         // Translators: %s - unknown user value.
    886                                                         __( '"%s" does not correspond to any known user.', 'password-requirements' ),
    887                                                         Utils\Type::ensure_string( $value ),
     907                                                        // Translators: %d - position of the offending entry in the list.
     908                                                        __( 'Entry %d does not correspond to any known user.', 'password-requirements' ),
     909                                                        $position,
    888910                                                ),
    889911                                        );
    … …  
    893915                        return true;
    894916                };
     917        }
     918
     919        /**
     920         * Resolve the known post types from query arguments
     921         *
     922         * @param array<string,mixed> $query_args Query arguments used for getting a list of post types.
     923         *
     924         * @return array<mixed> Known post types.
     925         */
     926        private static function resolve_known_post_types( array $query_args ): array {
     927                if ( isset( $query_args['post_type__in'] ) && is_array( $query_args['post_type__in'] ) ) {
     928                        return $query_args['post_type__in'];
     929                }
     930
     931                /** @var array<string,string> $found_post_types */
     932                $found_post_types = get_post_types( $query_args );
     933
     934                return array_values( $found_post_types );
    895935        }
    896936
  • password-requirements/trunk/deps/php/validatable-fields/class-configuration.php

    r3669586 r3748178  
    232232                         */
    233233                        'validator'     => function ( $value ) {
     234                                if ( is_string( $value ) && ! mb_check_encoding( $value, 'UTF-8' ) ) {
     235                                        return new WP_Error(
     236                                                'field_key_incorrect',
     237                                                __( 'The key given for the dynamic field could not be read as text.', 'password-requirements' ),
     238                                        );
     239                                }
     240
    234241                                if ( ! is_string( $value ) || ! Utils\Strings::str_starts_with( $value, 'd:' ) || 19 !== strlen( $value ) || 1 !== preg_match( '/^\\d+$/', str_replace( 'd:', '', $value ) ) ) {
    235242                                        return new WP_Error(
  • password-requirements/trunk/deps/php/validatable-fields/class-dynamic-fields-group.php

    r3669586 r3748178  
    121121
    122122        /**
     123         * Extend a restorer or validator so it also receives the group it is built for
     124         *
     125         * @param ?Closure     $closure Closure registered for the field type, if any.
     126         * @param Fields_Group $group   Group the field belongs to.
     127         *
     128         * @return ?Closure Closure taking the value and calling the original one with the value and the group; null when there is none.
     129         */
     130        private function bind_group( ?Closure $closure, Fields_Group $group ): ?Closure {
     131                if ( null === $closure ) {
     132                        return null;
     133                }
     134
     135                return function ( $value ) use ( $closure, $group ) {
     136                        return call_user_func( $closure, $value, $group );
     137                };
     138        }
     139
     140        /**
     141         * Build the configuration of an integer field from its template group
     142         *
     143         * The bounds are made consistent before use: a maximum below the minimum is
     144         * raised to it, and the default value is clamped into the resulting range.
     145         *
     146         * @param Fields_Group $group     Group holding the field's template values.
     147         * @param ?Closure     $restorer  Additional function for value restore.
     148         * @param ?Closure     $sanitizer Additional sanitizer function.
     149         * @param ?Closure     $validator Additional validation function.
     150         *
     151         * @return array{type:'integer',default_value:int,min:int,max:?int,restorer:?Closure,sanitizer:?Closure,validator:?Closure} Field configuration array.
     152         */
     153        private function integer_field_config( Fields_Group $group, ?Closure $restorer, ?Closure $sanitizer, ?Closure $validator ): array {
     154                /** @var ?int $default_value */
     155                $default_value = $group->get_field_value( 'default_value' );
     156                $default_value = $default_value ?? 0;
     157
     158                /** @var int $min */
     159                $min = $group->get_field_value( 'min' );
     160
     161                /** @var bool $use_max */
     162                $use_max = $group->get_field_value( 'use_max' );
     163
     164                /** @var ?int $max */
     165                $max = $use_max ? $group->get_field_value( 'max' ) : null;
     166
     167                if ( $use_max && is_int( $max ) && $max < $min ) {
     168                        $max = $min;
     169                }
     170
     171                if ( $default_value < $min ) {
     172                        $default_value = $min;
     173                }
     174
     175                if ( $use_max && is_int( $max ) && $default_value > $max ) {
     176                        $default_value = $max;
     177                }
     178
     179                return Configuration::integer_field(
     180                        $default_value,
     181                        $min,
     182                        $max,
     183                        $restorer,
     184                        $sanitizer,
     185                        $validator,
     186                );
     187        }
     188
     189        /**
    123190         * Get dynamic fields
    124191         *
    … …  
    142209
    143210                        $field_config = null;
    144                         $restorer     = $this->restorers[ $field_type ] ?? null;
     211                        $restorer     = $this->bind_group( $this->restorers[ $field_type ] ?? null, $group );
    145212                        $sanitizer    = $this->sanitizers[ $field_type ] ?? null;
    146                         $validator    = $this->validators[ $field_type ] ?? null;
    147 
    148                         if ( null !== $restorer ) {
    149                                 /**
    150                                  * Extend the restorer function by passing the instance
    151                                  * of the current object
    152                                  *
    153                                  * @param mixed $value Value to restore.
    154                                  *
    155                                  * @return mixed Restored value.
    156                                  */
    157                                 $restorer = function ( $value ) use ( $restorer, $group ) {
    158                                         return call_user_func( $restorer, $value, $group );
    159                                 };
    160                         }
    161 
    162                         if ( null !== $validator ) {
    163                                 /**
    164                                  * Extend the validator function by passing the instance
    165                                  * of the current object
    166                                  *
    167                                  * @param mixed $value Value to validate.
    168                                  *
    169                                  * @return mixed Validated value.
    170                                  */
    171                                 $validator = function ( $value ) use ( $validator, $group ) {
    172                                         return call_user_func( $validator, $value, $group );
    173                                 };
    174                         }
     213                        $validator    = $this->bind_group( $this->validators[ $field_type ] ?? null, $group );
    175214
    176215                        switch ( $field_type ) {
    … …  
    218257
    219258                                case 'integer':
    220                                         /** @var ?int $default_value */
    221                                         $default_value = $group->get_field_value( 'default_value' );
    222                                         $default_value = $default_value ?? 0;
    223 
    224                                         /** @var int $min */
    225                                         $min = $group->get_field_value( 'min' );
    226 
    227                                         /** @var bool $use_max */
    228                                         $use_max = $group->get_field_value( 'use_max' );
    229 
    230                                         /** @var ?int $max */
    231                                         $max = $use_max ? $group->get_field_value( 'max' ) : null;
    232 
    233                                         /**
    234                                          * Ensure field configuration is valid
    235                                          */
    236                                         if ( $use_max && is_int( $max ) && $max < $min ) {
    237                                                 $max = $min;
    238                                         }
    239 
    240                                         if ( $default_value < $min ) {
    241                                                 $default_value = $min;
    242                                         }
    243 
    244                                         if ( $use_max && is_int( $max ) && $default_value > $max ) {
    245                                                 $default_value = $max;
    246                                         }
    247 
    248                                         $field_config = Configuration::integer_field(
    249                                                 $default_value,
    250                                                 $min,
    251                                                 $max,
    252                                                 $restorer,
    253                                                 $sanitizer,
    254                                                 $validator,
    255                                         );
    256 
     259                                        $field_config = $this->integer_field_config( $group, $restorer, $sanitizer, $validator );
    257260                                        break;
    258261                        }
  • password-requirements/trunk/deps/php/validatable-fields/class-field-array-of-strings.php

    r3669586 r3748178  
    110110                                         */
    111111                                        function ( string $item ): bool {
    112                                                 return ! empty( $item );
     112                                                return '' !== $item;
    113113                                        },
    114114                                ),
  • password-requirements/trunk/deps/php/validatable-fields/class-field-float.php

    r3669586 r3748178  
    115115         */
    116116        protected function validate_value( $value ) {
     117                if ( is_string( $value ) && ! mb_check_encoding( $value, 'UTF-8' ) ) {
     118                        return new WP_Error(
     119                                'non_float_value',
     120                                sprintf(
     121                                        // Translators: %s - field name.
     122                                        __( 'Value of the "%s" field could not be read as text.', 'password-requirements' ),
     123                                        $this->get_key_camel_case(),
     124                                ),
     125                        );
     126                }
     127
    117128                if ( is_int( $value ) ) {
    118129                        $value = Utils\Type::ensure_float( $value, $this->precision );
    … …  
    121132                if ( ! is_float( $value ) ) {
    122133                        if ( is_string( $value ) ) {
     134                                if ( '' === Utils\Strings::trim( $value ) ) {
     135                                        return new WP_Error(
     136                                                'non_float_value',
     137                                                sprintf(
     138                                                        // Translators: %s - field name.
     139                                                        __( 'The "%s" field can\'t be empty.', 'password-requirements' ),
     140                                                        $this->get_key_camel_case(),
     141                                                ),
     142                                        );
     143                                }
     144
    123145                                if ( ! is_numeric( $value ) ) {
    124146                                        return new WP_Error(
  • password-requirements/trunk/deps/php/validatable-fields/class-field-integer-of-choice.php

    r3669586 r3748178  
    5454        protected function validate_value( $value ) {
    5555                if ( ! is_int( $value ) ) {
     56                        if ( is_string( $value ) && '' === Utils\Strings::trim( $value ) ) {
     57                                return new WP_Error(
     58                                        'non_integer_value',
     59                                        sprintf(
     60                                                // Translators: %s - field name.
     61                                                __( 'The "%s" field can\'t be empty.', 'password-requirements' ),
     62                                                $this->get_key_camel_case(),
     63                                        ),
     64                                );
     65                        }
     66
    5667                        if ( is_string( $value ) && 1 === preg_match( '/^-?\\d+$/', $value ) ) {
    5768                                $value = Utils\Type::ensure_int( $value );
  • password-requirements/trunk/deps/php/validatable-fields/class-field-integer.php

    r3669586 r3748178  
    101101         */
    102102        protected function validate_value( $value ) {
     103                if ( is_string( $value ) && ! mb_check_encoding( $value, 'UTF-8' ) ) {
     104                        return new WP_Error(
     105                                'non_integer_value',
     106                                sprintf(
     107                                        // Translators: %s - field name.
     108                                        __( 'Value of the "%s" field could not be read as text.', 'password-requirements' ),
     109                                        $this->get_key_camel_case(),
     110                                ),
     111                        );
     112                }
     113
    103114                if ( ! is_int( $value ) ) {
    104115                        if ( is_string( $value ) ) {
     116                                if ( '' === Utils\Strings::trim( $value ) ) {
     117                                        return new WP_Error(
     118                                                'non_integer_value',
     119                                                sprintf(
     120                                                        // Translators: %s - field name.
     121                                                        __( 'The "%s" field can\'t be empty.', 'password-requirements' ),
     122                                                        $this->get_key_camel_case(),
     123                                                ),
     124                                        );
     125                                }
     126
    105127                                /**
    106128                                 * Reject a leading sign: this field is unsigned because string coercion
  • password-requirements/trunk/deps/php/validatable-fields/class-field-string-of-choice.php

    r3669586 r3748178  
    6868
    6969                if ( ! in_array( $value, $this->allowed_values, true ) ) {
     70                        if ( ! mb_check_encoding( $value, 'UTF-8' ) ) {
     71                                return new WP_Error(
     72                                        'field_value_out_of_scope',
     73                                        sprintf(
     74                                                // Translators: %s - field name.
     75                                                __( 'Value of the "%s" field could not be read as text.', 'password-requirements' ),
     76                                                $this->get_key_camel_case(),
     77                                        ),
     78                                );
     79                        }
     80
    7081                        return new WP_Error(
    7182                                'field_value_out_of_scope',
  • password-requirements/trunk/loader.php

    r3669586 r3748178  
    5757                $plugin->set_supports_network( true );
    5858                $plugin->set_text_domain( 'password-requirements' );
    59                 $plugin->set_version( '3.8.0' );
     59                $plugin->set_version( '3.9.0' );
    6060
    6161                $plugin->register_modules(
    … …  
    7070                                Modules\Logout_Cleanup\Module_Logout_Cleanup::class,
    7171                                Modules\Password_Hint\Module_Password_Hint::class,
     72                                Modules\Personal_Data\Module_Personal_Data::class,
    7273                                Modules\Plugin_Upgrade_Action_Link\Module_Plugin_Upgrade_Action_Link::class,
    7374                                Modules\Require_Current_Password\Module_Require_Current_Password::class,
  • password-requirements/trunk/package.json

    r3669586 r3748178  
    11{
    22  "private": true,
     3  "type": "module",
    34  "scripts": {
    45    "build": "npm run build:scripts",
    56    "build:scripts": "concurrently \"npm:build:scripts:*\"",
    67    "build:scripts:password-hint-positioning": "wp-scripts build --webpack-src-dir=src/modules/password-hint/internal/positioning --output-path=build/password-hint-positioning",
     8    "build:scripts:require-current-password": "wp-scripts build --webpack-src-dir=src/modules/require-current-password --output-path=build/require-current-password",
    79    "build:scripts:settings-page": "wp-scripts build --webpack-src-dir=src/modules/settings-page --output-path=build/settings-page"
    810  },
    … …  
    1214  },
    1315  "devDependencies": {
    14     "@wordpress/scripts": "^34.0.0",
     16    "@wordpress/scripts": "^36.0.0",
    1517    "concurrently": "^9.2.4",
    1618    "prop-types": "^15.8.1"
  • password-requirements/trunk/password-requirements.php

    r3669586 r3748178  
    44 * Plugin URI: https://teydeastudio.com/plugins/login-security/?utm_source=Teydea+Login+Security
    55 * Description: Define advanced password policies, enforce strong password requirements, and improve your WordPress site's security.
    6  * Version: 3.8.0
     6 * Version: 3.9.0
    77 * Text Domain: password-requirements
    88 * Requires PHP: 7.4
  • password-requirements/trunk/readme.txt

    r3669586 r3748178  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 3.8.0
     7Stable tag: 3.9.0
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
    … …  
    4747* **Require current password** -- Add a "Current Password" field to the user profile screen and validate it before allowing password changes.
    4848* **Custom password hints** -- Replace the default WordPress password hint with a policy-specific hint based on active rules.
     49* **Policy-compliant generated passwords** -- When WordPress generates a password on an account's behalf, such as on the Add New User screen or during multisite signup, the plugin replaces it with one that meets the active policy. If no compliant password can be generated, the original password stands and the usual compliance check at first login still applies.
    4950* **Site Health integration** -- A Site Health test reports whether your plugin settings are properly configured.
    5051* **Multisite/network support** -- Works with both standard and multisite WordPress installations.
    … …  
    116117= Where can I find the unminified source code? =
    117118
    118 All source ships with the plugin: the plugin's own JavaScript is in `src/`, and the bundled `@teydeastudio/components` and `@teydeastudio/utils` libraries are in `deps/js/components/src/` and `deps/js/utils/src/`. To rebuild, install Node.js 20 and run `npm install && npm run build` in the plugin directory.
     119All source ships with the plugin: the plugin's own JavaScript is in `src/`, and the bundled `@teydeastudio/components` and `@teydeastudio/utils` libraries are in `deps/js/components/src/` and `deps/js/utils/src/`. To rebuild, install Node.js 24 and run `npm install && npm run build` in the plugin directory.
    119120
    120121== Screenshots ==
    … …  
    138139
    139140== Changelog ==
     141
     142= 3.9.0 (2026-10-15) =
     143* Improved compatibility of the sign-in password check with plugins that change login cookies
     144* On multisite, the "Current Password" field on the user-admin profile screen is now checked
     145* Personal data exports now include the date the user last changed their password
     146* Confirming the current password no longer counts as a failed login when it is mistyped, and no longer resets the password age when it is correct
     147* The "Current Password" field keeps its label visible, is recognized by password managers, and has its help text announced by screen readers
     148* The "Current Password" field is now positioned by an enqueued script, so it also works on sites whose Content-Security-Policy blocks inline scripts
     149* Dependencies updated
     150* Code improvements
    140151
    141152= 3.8.0 (2026-08-28) =
    … …  
    205216* Code improvements
    206217
    207 = 3.4.1 (2026-01-12) =
    208 * Harden handling of the "allow_password_reset" filter to improve compatibility with third-party plugins
    209 
    210218(For older records, see the `changelog.txt` file).
  • password-requirements/trunk/src/class-compliance.php

    r3669586 r3748178  
    475475        /**
    476476         * Check whether the most recent compliance check made through this object
    477          * failed because the breach service was unreachable on a fail-closed site
     477         * failed over something other than the password itself
    478478         *
    479479         * Reports on a check this object ran, so callers that hand a password to
    … …  
    483483         * @phpstan-impure
    484484         *
    485          * @return bool True only when the last failure was caused by an unreachable breach service.
    486          */
    487         public function last_failure_was_breach_unreachable(): bool {
    488                 $password_policy = $this->get_password_policy();
    489                 return null !== $password_policy && $password_policy->last_failure_was_breach_unreachable();
     485         * @return bool True only when the last failure was decided by something other than the candidate.
     486         */
     487        public function last_failure_came_from_external_state(): bool {
     488                $password_policy = $this->get_password_policy();
     489                return null !== $password_policy && $password_policy->last_failure_came_from_external_state();
    490490        }
    491491
    … …  
    503503                        $user_login = $data['user_login'] ?? ( $data['username'] ?? ( $data['login'] ?? '' ) );
    504504
    505                         if ( ! empty( $user_login ) ) {
    506                                 if ( is_email( $user_login ) ) {
     505                        if ( is_string( $user_login ) && '' !== $user_login && '0' !== $user_login ) {
     506                                if ( false !== is_email( $user_login ) ) {
    507507                                        $wp_user = get_user_by( 'email', $user_login );
    508508                                } else {
  • password-requirements/trunk/src/class-message-key.php

    r3669586 r3748178  
    6969                $nonce_action = $nonce->get_action();
    7070
    71                 if ( ! empty( $nonce_value ) && false !== wp_verify_nonce( $nonce_value, $nonce_action ) ) {
     71                if ( '' !== $nonce_value && false !== wp_verify_nonce( $nonce_value, $nonce_action ) ) {
    7272                        return isset( $_GET[ $nonce_action ] ) ? sanitize_text_field( Utils\Type::ensure_string( wp_unslash( $_GET[ $nonce_action ] ) ) ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    7373                }
  • password-requirements/trunk/src/class-password-policy.php

    r3669586 r3748178  
    300300
    301301        /**
     302         * Check whether this request is the user finishing a password replacement
     303         * they cannot back out of
     304         *
     305         * A rule that refuses a candidate over something other than the candidate
     306         * needs this answer before it refuses. A user completing a reset is on a
     307         * form every request sends them back to, so a rule that turns down every
     308         * password submitted to it leaves them with nothing left to try.
     309         *
     310         * Narrower than {@see self::is_password_change_compelled()}, which the
     311         * minimum-age rule uses, and narrower on purpose:
     312         *
     313         * - The maximum-age rule is left out. It answers "true" for any account
     314         *   with no recorded password-change date, which is every account on a site
     315         *   that has just switched the rule on, and every account that does not
     316         *   exist yet.
     317         * - An administrator setting somebody else's password is left out. They
     318         *   opened that form themselves and can leave it again, and the settings
     319         *   that would let the password through are theirs to change.
     320         * - An account that does not exist yet is left out. Nobody is being held on
     321         *   a registration form, and refusing there strands no one.
     322         *
     323         * What is left is a reset key this request has proven against the account,
     324         * and a caller declaring the change compelled through
     325         * {@see Compliance::declare_change_compelled()}, which is how an integration
     326         * whose reset form runs without the core reset cookie says the same thing.
     327         * The filter is asked with "false" rather than with the reasons
     328         * is_password_change_compelled() seeds it with, so those reasons cannot
     329         * reach this answer through it.
     330         *
     331         * @return bool Whether the user is finishing a replacement they cannot back out of ("true") or not ("false").
     332         */
     333        protected function is_password_change_unavoidable(): bool {
     334                $user_id = $this->user->get_user_id();
     335
     336                // An account that does not exist yet carries the ID "0".
     337                if ( null === $user_id || 0 === $user_id ) {
     338                        return false;
     339                }
     340
     341                if ( true === $this->has_authorized_reset_in_flight() ) {
     342                        return true;
     343                }
     344
     345                // This filter is documented in is_password_change_compelled() above.
     346                return true === apply_filters( 'password_requirements__is_password_change_compelled', false, $this->user->get_user() );
     347        }
     348
     349        /**
    302350         * Check if user should change their password
    303351         *
    … …  
    334382         * @return bool Whether the password is compliant with the password policy or not.
    335383         */
    336         public function is_password_compliant( string $password, bool $is_new = false ): bool {
     384        final public function is_password_compliant( string $password, bool $is_new = false ): bool {
    337385                $this->last_failure_reason = null;
    338386
    … …  
    341389                 *
    342390                 * Applies:
    343                  * - always, ahead of every rule that walks the candidate, and ahead of
    344                  *   the no-policy bypass: a user no policy covers still reaches the
    345                  *   hashing this ceiling exists to bound
     391                 * - always, ahead of the no-policy bypass and of every rule of the policy
     392                 *
     393                 * WordPress core refuses to hash a password over this size and stores the
     394                 * unusable hash "*" in its place, so a user no policy covers who had such
     395                 * a password accepted could not sign in until it was reset. For a user a
     396                 * policy covers, the ceiling also bounds the cost of the rules, which walk
     397                 * the whole candidate. It runs here, outside
     398                 * check_password_against_policy_rules(), so that a subclass adding rules
     399                 * there cannot leave it out.
    346400                 */
    347401                if ( false === $this->check_has_not_exceeded_maximum_size( $password ) ) {
    … …  
    356410                }
    357411
     412                return $this->check_password_against_policy_rules( $password, $is_new, $this->policy );
     413        }
     414
     415        /**
     416         * Check if provided password passes every rule of the password policy
     417         * that applies to this user
     418         *
     419         * A subclass that adds rules overrides this method. is_password_compliant()
     420         * is final, and runs the size ceiling and the no-policy bypass before
     421         * calling it.
     422         *
     423         * @param string                          $password User's password.
     424         * @param bool                            $is_new   Whether the given password is new ("true") or not ("false").
     425         * @param Validatable_Fields\Fields_Group $policy   Settings of the password policy which applies to the given user.
     426         *
     427         * @return bool Whether the password passes every rule of the password policy or not.
     428         */
     429        protected function check_password_against_policy_rules( string $password, bool $is_new, Validatable_Fields\Fields_Group $policy ): bool {
    358430                /**
    359431                 * Check password minimum length
    … …  
    386458                 * - when enabled
    387459                 */
    388                 if ( true === $this->policy->get_field_value( 'rules.complexity' ) ) {
     460                if ( true === $policy->get_field_value( 'rules.complexity' ) ) {
    389461                        /**
    390462                         * Check if password contains at least one digit
    391463                         */
    392                         if ( true === $this->policy->get_field_value( 'rule_settings.complexity.digit' ) && false === $this->check_has_digit( $password ) ) {
     464                        if ( true === $policy->get_field_value( 'rule_settings.complexity.digit' ) && false === $this->check_has_digit( $password ) ) {
    393465                                return false;
    394466                        }
    … …  
    397469                         * Check if password contains at least one lowercase character
    398470                         */
    399                         if ( true === $this->policy->get_field_value( 'rule_settings.complexity.lowercase' ) && false === $this->check_has_lowercase_character( $password ) ) {
     471                        if ( true === $policy->get_field_value( 'rule_settings.complexity.lowercase' ) && false === $this->check_has_lowercase_character( $password ) ) {
    400472                                return false;
    401473                        }
    … …  
    404476                         * Check if password contains at least one uppercase character
    405477                         */
    406                         if ( true === $this->policy->get_field_value( 'rule_settings.complexity.uppercase' ) && false === $this->check_has_uppercase_character( $password ) ) {
     478                        if ( true === $policy->get_field_value( 'rule_settings.complexity.uppercase' ) && false === $this->check_has_uppercase_character( $password ) ) {
    407479                                return false;
    408480                        }
    … …  
    427499                         * Check if password contains no more than allowed maximum number of consecutive user symbols
    428500                         */
    429                         if ( true === $this->policy->get_field_value( 'rule_settings.complexity.consecutive_user_symbols' ) ) {
     501                        if ( true === $policy->get_field_value( 'rule_settings.complexity.consecutive_user_symbols' ) ) {
    430502                                /** @var int $max_consecutive_user_symbols */
    431                                 $max_consecutive_user_symbols = $this->policy->get_field_value( 'rule_settings.maximum_consecutive_user_symbols' );
     503                                $max_consecutive_user_symbols = $policy->get_field_value( 'rule_settings.maximum_consecutive_user_symbols' );
    432504
    433505                                if ( false === $this->check_has_not_exceeded_maximum_consecutive_user_symbols( $password, $max_consecutive_user_symbols ) ) {
    … …  
    441513                        $restricted_characters = $this->get_restricted_characters();
    442514
    443                         if ( ! empty( $restricted_characters ) && false === $this->check_has_no_restricted_characters( $password, $restricted_characters ) ) {
     515                        if ( [] !== $restricted_characters && false === $this->check_has_no_restricted_characters( $password, $restricted_characters ) ) {
    444516                                return false;
    445517                        }
    … …  
    452524                 * - when enabled, and user is logging in
    453525                 */
    454                 if ( true === $this->policy->get_field_value( 'rules.maximum_age' ) && false === $is_new ) {
     526                if ( true === $policy->get_field_value( 'rules.maximum_age' ) && false === $is_new ) {
    455527                        /** @var int $max_age */
    456                         $max_age         = $this->policy->get_field_value( 'rule_settings.maximum_age' );
     528                        $max_age         = $policy->get_field_value( 'rule_settings.maximum_age' );
    457529                        $last_changed_at = $this->passwords_store->get_password_changed_at();
    458530
    … …  
    490562                 * - when enabled, and the active list has at least one entry
    491563                 */
    492                 if ( true === $this->policy->get_field_value( 'rules.restricted_phrases' ) ) {
     564                if ( true === $policy->get_field_value( 'rules.restricted_phrases' ) ) {
    493565                        $words = $this->get_active_restricted_phrases();
    494566
    495                         if ( ! empty( $words ) && false === $this->check_has_no_restricted_phrases( $password, $words ) ) {
     567                        if ( [] !== $words && false === $this->check_has_no_restricted_phrases( $password, $words ) ) {
    496568                                $this->last_failure_reason = self::FAILURE__RESTRICTED_PHRASES;
    497569                                return false;
    … …  
    888960
    889961                        // Merge complexity hints into one hint.
    890                         if ( ! empty( $complexity_hints ) ) {
     962                        if ( [] !== $complexity_hints ) {
    891963                                // Translators: %s - password complexity hints.
    892964                                $hints[] = sprintf( __( 'must contain %s', 'password-requirements' ), implode( ', ', $complexity_hints ) );
    … …  
    920992                                        $user_symbol_characters = $this->get_user_symbol_characters();
    921993
    922                                         $hints[] = empty( $user_symbol_characters )
     994                                        $hints[] = [] === $user_symbol_characters
    923995                                                ? __( 'cannot contain any symbol of your user name or display name', 'password-requirements' )
    924996                                                : sprintf(
    … …  
    9451017                 * Restricted words/phrases list
    9461018                 */
    947                 if ( true === $this->policy->get_field_value( 'rules.restricted_phrases' ) && ! empty( $this->get_active_restricted_phrases() ) ) {
     1019                if ( true === $this->policy->get_field_value( 'rules.restricted_phrases' ) && [] !== $this->get_active_restricted_phrases() ) {
    9481020                        $hints[] = __( 'cannot contain words restricted by your site administrator', 'password-requirements' );
    9491021                }
    9501022
    9511023                // Return password hint.
    952                 return empty( $hints ) ? null : sprintf(
     1024                return [] === $hints ? null : sprintf(
    9531025                        // Translators: %s - semicolon-separated list of password requirements.
    9541026                        __( 'Hint: password %s.', 'password-requirements' ),
    … …  
    11021174
    11031175        /**
    1104          * Whether the most recent is_password_compliant() call failed because
    1105          * the breach service was unreachable and the policy rejects unverifiable
    1106          * passwords (fail-closed)
    1107          *
    1108          * Such a failure is caused by external state, not by the password's
    1109          * contents, so retrying with a different candidate cannot change the
    1110          * outcome.
    1111          *
    1112          * @return bool True only when the last failure was caused by an unreachable breach service.
    1113          */
    1114         public function last_failure_was_breach_unreachable(): bool {
     1176         * Whether the most recent is_password_compliant() call failed over
     1177         * something other than the password itself
     1178         *
     1179         * A rule that screens the candidate against something it has to consult
     1180         * first - a breach service, or a list shipped in a file - can refuse the
     1181         * candidate because that consultation failed rather than because of
     1182         * anything in the candidate. Trying a different one cannot change such an
     1183         * outcome, which is what a caller drawing candidates needs to know.
     1184         *
     1185         * None of this plugin's rules consults anything of the kind, so the answer
     1186         * here is always "false". The PRO plugin overrides it for the rules that do.
     1187         *
     1188         * @return bool True only when the last failure was decided by something other than the candidate.
     1189         */
     1190        public function last_failure_came_from_external_state(): bool {
    11151191                return false;
    11161192        }
  • password-requirements/trunk/src/modules/abilities/class-module-abilities.php

    r3669586 r3748178  
    2323 */
    2424class Module_Abilities extends Utils\Module {
     25        /**
     26         * Simplify access to the Settings class instance
     27         */
     28        use Utils\With_Settings;
     29
    2530        /**
    2631         * Policy template fields group, resolved once per request
  • password-requirements/trunk/src/modules/compliance-on-generation/class-module-compliance-on-generation.php

    r3669586 r3748178  
    3636 * is ever rewritten, and no request pays more than one policy evaluation.
    3737 *
    38  * When no compliant replacement can be produced (an unsatisfiable policy, an
    39  * unreachable breach service on a fail-closed site), the password core
    40  * produced is returned unchanged and the login-time compliance check remains
    41  * the backstop, exactly as without this module.
     38 * When no compliant replacement can be produced (an unsatisfiable policy, or a
     39 * rule that cannot consult what it screens against on a fail-closed site), the
     40 * password core produced is returned unchanged and the login-time compliance
     41 * check remains the backstop, exactly as without this module.
    4242 */
    4343final class Module_Compliance_On_Generation extends Utils\Module {
  • password-requirements/trunk/src/modules/compliance-on-generation/internal/class-password-generator.php

    r3669586 r3748178  
    5757         * Bound on candidate-generation attempts
    5858         *
    59          * Exists so that an unsatisfiable policy, or an unreachable breach service
    60          * on a fail-closed site, cannot make account creation spin.
     59         * Exists so that an unsatisfiable policy, or a rule that cannot consult
     60         * what it screens against on a fail-closed site, cannot make account
     61         * creation spin.
    6162         *
    6263         * @var int
    … …  
    133134         * Draw a policy-compliant replacement on the site the account will land on
    134135         *
    135          * Candidate drawing stops the moment a rejection is caused by an
    136          * unreachable breach service on a fail-closed site rather than by the
    137          * candidate's contents: every further candidate would fail for the same
    138          * external reason, each one paying for a blocking network attempt inside a
    139          * user-facing account-creation request.
     136         * Candidate drawing stops the moment a rejection is decided by something
     137         * other than the candidate's contents — a breach service a fail-closed site
     138         * cannot reach, a weak-password list it cannot read. Every further candidate
     139         * would fail for the same reason, each one paying again for the lookup that
     140         * already failed, inside a user-facing account-creation request.
    140141         *
    141142         * @param string  $password         The password WordPress generated.
    … …  
    153154                }
    154155
    155                 if ( true === $compliance->last_failure_was_breach_unreachable() ) {
     156                if ( true === $compliance->last_failure_came_from_external_state() ) {
    156157                        return $password;
    157158                }
    … …  
    191192                        }
    192193
    193                         if ( true === $compliance->last_failure_was_breach_unreachable() ) {
     194                        if ( true === $compliance->last_failure_came_from_external_state() ) {
    194195                                return $password;
    195196                        }
  • password-requirements/trunk/src/modules/compliance-on-login/class-module-compliance-on-login.php

    r3669586 r3748178  
    3131 * it until they happen to change it.
    3232 *
    33  * Scope follows from the nonce rendered on `login_form`: flows that never post
    34  * that form — application passwords, XML-RPC, SSO — supply no plaintext here
    35  * and are not checked.
     33 * Scope follows from the "login_redirect" filter, which core applies only after
     34 * a sign-in through "wp-login.php". Flows that never reach it — application
     35 * passwords, XML-RPC, SSO — supply no plaintext here and are not checked. No
     36 * field of the submitted form decides whether the check runs, because the
     37 * person signing in controls every one of them.
    3638 *
    3739 * The verdict is never cached or memoized per user: every covered sign-in
    … …  
    5153         */
    5254        public function register(): void {
    53                 // Render custom nonce field on login form.
    54                 add_action( 'login_form', [ $this, 'render_nonce_field' ] );
    55 
    5655                // Check if current password is compliant with the password policy when user is logging in.
    5756                add_filter( 'login_redirect', [ $this, 'on_login' ], 99, 3 );
    … …  
    5958                // Filter the login message.
    6059                add_filter( 'login_message', [ $this, 'filter_login_message' ] );
    61         }
    62 
    63         /**
    64          * Render custom nonce field on login form
    65          *
    66          * @return void
    67          */
    68         public function render_nonce_field(): void {
    69                 $nonce = new Utils\Nonce( $this->container, 'login' );
    70                 $nonce->render_field();
    7160        }
    7261
    … …  
    8170         */
    8271        public function on_login( string $redirect_to, string $requested_redirect_to, $user ): string {
    83                 // Predefine the variable's value.
    84                 $password = null;
    85 
    86                 // Get the nonce data.
    87                 $nonce        = new Utils\Nonce( $this->container, 'login' );
    88                 $nonce_value  = isset( $_POST[ $nonce->get_key() ] ) ? sanitize_text_field( Utils\Type::ensure_string( wp_unslash( $_POST[ $nonce->get_key() ] ) ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    89                 $nonce_action = $nonce->get_action();
    90 
    91                 /**
    92                  * Note we can not use the "sanitize_text_field" in this case as this would falsify
    93                  * the compliance checks due to stripped/changed characters.
    94                  *
    95                  * For example:
    96                  * - "pas&"<>word" passed through the "sanitize_text_field" function would become "pas&"word" (note missing angular brackets)
    97                  */
    98                 if ( ! empty( $nonce_value ) && false !== wp_verify_nonce( $nonce_value, $nonce_action ) && isset( $_POST['pwd'] ) ) {
    99                         $password = ( is_string( $_POST['pwd'] ) && '' === $_POST['pwd'] ) ? null : Utils\Type::ensure_string( wp_unslash( $_POST['pwd'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- reason described above.
    100                 }
     72                $password = $this->get_submitted_password();
    10173
    10274                /**
    … …  
    172144                return $message;
    173145        }
     146
     147        /**
     148         * Get the password submitted to the login form, as core authenticated it
     149         *
     150         * Core's "wp_authenticate()" trims the slashed password before checking it,
     151         * so whitespace padding never counts toward the policy here either. The value
     152         * is trimmed before it is unslashed, in the same order as core, and PHP's
     153         * "trim()" is used because "Utils\Strings::trim()" also changes internal
     154         * whitespace and HTML entities.
     155         *
     156         * Note we can not use the "sanitize_text_field" in this case as this would falsify
     157         * the compliance checks due to stripped/changed characters.
     158         *
     159         * For example:
     160         * - "pas&"<>word" passed through the "sanitize_text_field" function would become "pas&"word" (note missing angular brackets)
     161         *
     162         * @return ?string Submitted password, or "null" when the request carries none.
     163         */
     164        private function get_submitted_password(): ?string {
     165                $password = isset( $_POST['pwd'] ) ? Utils\Type::ensure_string( wp_unslash( trim( Utils\Type::ensure_string( $_POST['pwd'] ) ) ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput -- core authenticates the sign-in itself, and sanitizing would change the password, as described above.
     166                return '' === $password ? null : $password;
     167        }
    174168}
  • password-requirements/trunk/src/modules/compliance-on-password-change/class-module-compliance-on-password-change.php

    r3669586 r3748178  
    7272                $form_field = null;
    7373
    74                 if ( isset( $_POST['pass1'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
    75                         $password   = Utils\Type::ensure_string( wp_unslash( $_POST['pass1'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
     74                if ( isset( $_POST['pass1'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- The reset key authenticates the request before this hook runs.
     75                        $password   = Utils\Type::ensure_string( wp_unslash( $_POST['pass1'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- The reset key authenticates the request; sanitizing the password would change the value checked for compliance.
    7676                        $form_field = 'pass1';
    77                 } elseif ( isset( $_POST['password_1'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
    78                         $password   = Utils\Type::ensure_string( wp_unslash( $_POST['password_1'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
     77                } elseif ( isset( $_POST['password_1'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- The reset key authenticates the request before this hook runs.
     78                        $password   = Utils\Type::ensure_string( wp_unslash( $_POST['password_1'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- The reset key authenticates the request; sanitizing the password would change the value checked for compliance.
    7979                        $form_field = 'password_1';
    8080                }
    … …  
    269269                $display_name = Utils\Type::ensure_string( $user_data->display_name ?? '' );
    270270
    271                 if ( ! empty( $display_name ) ) {
     271                if ( '' !== $display_name && '0' !== $display_name ) {
    272272                        return $display_name;
    273273                }
    … …  
    276276                $last_name  = Utils\Type::ensure_string( $user_data->last_name ?? '' );
    277277
    278                 if ( ! empty( $first_name ) && ! empty( $last_name ) ) {
     278                if ( '' !== $first_name && '0' !== $first_name && '' !== $last_name && '0' !== $last_name ) {
    279279                        /**
    280280                         * Deliberately core's own string, in core's own text domain rather than
    … …  
    292292                }
    293293
    294                 if ( ! empty( $first_name ) ) {
     294                if ( '' !== $first_name && '0' !== $first_name ) {
    295295                        return $first_name;
    296296                }
    297297
    298                 if ( ! empty( $last_name ) ) {
     298                if ( '' !== $last_name && '0' !== $last_name ) {
    299299                        return $last_name;
    300300                }
  • password-requirements/trunk/src/modules/password-hint/class-module-password-hint.php

    r3669586 r3748178  
    102102                        $custom_hint = $compliance->get_hint();
    103103
    104                         if ( ! empty( $custom_hint ) ) {
     104                        if ( '' !== $custom_hint ) {
    105105                                $hint = $custom_hint;
    106106                        }
  • password-requirements/trunk/src/modules/require-current-password/class-module-require-current-password.php

    r3669586 r3748178  
    2727final class Module_Require_Current_Password extends Utils\Module {
    2828        /**
     29         * Asset slug of the script and stylesheet that place the field
     30         *
     31         * @var string
     32         */
     33        const ASSET_SLUG = 'require-current-password';
     34
     35        /**
    2936         * Register hooks
    3037         *
    … …  
    5259         */
    5360        public function add_current_password_field( WP_User $user ): void {
     61                if ( ! $this->is_own_profile_page() ) {
     62                        return;
     63                }
     64
    5465                $compliance = new Compliance( $this->container, $user );
    5566
    … …  
    5869                }
    5970
     71                $asset = new Utils\Asset( $this->container, self::ASSET_SLUG );
     72
     73                /**
     74                 * The script needs no data from PHP, so nothing has to be emitted as the
     75                 * inline block that a strict Content-Security-Policy would drop. It has no
     76                 * translatable strings either.
     77                 */
     78                $asset->enqueue_script( false );
     79                $asset->enqueue_style();
     80
     81                // The enqueued script looks both ids below up; renaming either one stops it finding the elements.
    6082                ?>
    61                 <script>
    62                         document.addEventListener( 'DOMContentLoaded', function() {
    63                                 // Reposition input inside "Set New Password" section.
    64                                 const el = document.getElementById( 'current-password-confirm' );
    65                                 const parent = document.getElementsByClassName( 'wp-pwd' )[ 0 ];
    66 
    67                                 parent.insertBefore( el, parent.firstChild );
    68                                 el.style.marginBottom = '1em';
    69 
    70                                 // Hide no JS fallback UI
    71                                 const nojsParent = document.getElementById( 'nojs-current-pass' );
    72                                 nojsParent.style.display = 'none';
    73                         } );
    74                 </script>
    7583                <table id="nojs-current-pass" class="form-table" role="presentation">
    7684                        <tr>
    77                                 <th><label for="current_pass"><?php echo esc_html( __( 'Current Password', 'password-requirements' ) ); ?></label></th>
    7885                                <td>
    79                                         <div id="current-password-confirm">
    80                                                 <input type="password" name="current_pass" id="current_pass" placeholder="<?php esc_attr_e( 'Current Password', 'password-requirements' ); ?>" class="regular-text" value="" autocomplete="off" />
    81                                                 <p class="description"><?php echo esc_html( __( 'Please type your current password to update it.', 'password-requirements' ) ); ?></p>
     86                                        <div id="current-password-confirm" class="password-requirements-require-current-password__field">
     87                                                <label for="current_pass"><?php echo esc_html( __( 'Current Password', 'password-requirements' ) ); ?></label>
     88                                                <input type="password" name="current_pass" id="current_pass" class="regular-text" value="" autocomplete="current-password" aria-describedby="current-pass-description" />
     89                                                <p id="current-pass-description" class="description"><?php echo esc_html( __( 'Your current password is required when changing your password.', 'password-requirements' ) ); ?></p>
    8290                                        </div>
    8391                                </td>
    … …  
    101109                }
    102110
    103                 $screen = new Utils\Screen( $this->container );
    104 
    105                 if ( ! $screen->is( 'profile' ) ) {
     111                if ( ! $this->is_own_profile_page() ) {
    106112                        return;
    107113                }
    … …  
    115121                check_admin_referer( sprintf( 'update-user_%d', $user->ID ) );
    116122
    117                 if ( empty( $_POST['pass1'] ) ) {
     123                /**
     124                 * Core's edit_user() only treats a non-empty "pass1" as a password change,
     125                 * so a submitted "0" is not a change there and must not be one here either.
     126                 */
     127                if ( ! isset( $_POST['pass1'] ) || '' === $_POST['pass1'] || '0' === $_POST['pass1'] ) {
    118128                        return;
    119129                }
    … …  
    125135                }
    126136
    127                 if ( empty( $_POST['current_pass'] ) ) {
     137                /**
     138                 * Unlike "pass1", core never reads this field, so only a blank submission
     139                 * counts as missing: a current password of "0" is a value the user typed
     140                 * and is checked below like any other.
     141                 */
     142                if ( ! isset( $_POST['current_pass'] ) || '' === $_POST['current_pass'] ) {
    128143                        $errors->add(
    129144                                'empty_current_password',
    … …  
    153168                 *
    154169                 * "Utils\Type::ensure_string()" is a type coercion, not a transformation: a string
    155                  * is returned byte-for-byte, so neither omission above is undone. It only maps a
    156                  * non-string submission (e.g. "current_pass[]=x") to "", which fails authentication.
    157                  */
    158                 $auth = wp_authenticate( $user->user_login, Utils\Type::ensure_string( $_POST['current_pass'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- reason described above.
    159 
    160                 if ( is_wp_error( $auth ) ) {
     170                 * is returned byte-for-byte, so neither omission above is undone. An array
     171                 * submission (e.g. "current_pass[]=x") becomes "", which is rejected.
     172                 * Use PHP's "trim()" to match core's login trimming. "Utils\Strings::trim()"
     173                 * also changes internal whitespace and HTML entities, which alters passwords.
     174                 */
     175                $password = trim( Utils\Type::ensure_string( $_POST['current_pass'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- reason described above.
     176
     177                /**
     178                 * Omit the optional user ID: on WordPress 6.6 and 6.7 a matching legacy MD5
     179                 * hash otherwise triggers "wp_set_password()" during the comparison.
     180                 * Reject an empty trimmed value, even if an account has a hash of the
     181                 * empty string.
     182                 */
     183                if ( '' === $password || ! wp_check_password( $password, $user->user_pass ) ) {
    161184                        $errors->add(
    162185                                'wrong_current_password',
    … …  
    166189                }
    167190        }
     191
     192        /**
     193         * Check whether the request is for the screen where users edit their own profile
     194         *
     195         * Core fires "show_user_profile" only when "IS_PROFILE_PAGE" is true, and the
     196         * screen id that goes with it differs between admin areas ("profile",
     197         * "profile-network", "profile-user", or "user-edit" for one's own user ID).
     198         * The field is rendered and the submission is validated on this one condition,
     199         * so there is no screen where the field is shown and its value goes unchecked.
     200         *
     201         * @return bool Whether the request is for the screen where users edit their own profile.
     202         */
     203        private function is_own_profile_page(): bool {
     204                return defined( 'IS_PROFILE_PAGE' ) && true === IS_PROFILE_PAGE;
     205        }
    168206}
  • password-requirements/trunk/src/modules/settings-page/components/component-password-policy-settings.js

    r3669586 r3748178  
    182182                if ( 0 === count ) {
    183183                        speak( __( "No character of the user's name or display name may appear in the password.", 'password-requirements' ), 'polite' );
    184 
    185184                        return;
    186185                }
  • password-requirements/trunk/src/modules/site-health/class-module-site-health.php

    r3669586 r3748178  
    2323 */
    2424class Module_Site_Health extends Utils\Module {
     25        /**
     26         * Simplify access to the Settings class instance
     27         */
     28        use Utils\With_Settings;
     29
    2530        /**
    2631         * Register hooks
Note: See TracChangeset for help on using the changeset viewer.