<!doctype html>
<html>
  <head>
        <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
      <meta name="ulp-version" content="1.115.0">
    
    
    
    <meta name="robots" content="noindex, nofollow">
    
    
    <link rel="stylesheet" href="https://cdn.auth0.com/ulp/react-components/1.192.0/css/main_wcag_compliant.cdn.min.css">
    <style id="custom-styles-container">
      
        




        
          :root, .af-custom-form-container .af-form {
    --primary-color: #078480;
  }
        
      

        
          :root, .af-custom-form-container .af-form {
    --button-font-color: #ffffff;
  }
        
      

        
          :root {
    --secondary-button-border-color: #c9cace;
    --social-button-border-color: #c9cace;
    --radio-button-border-color: #c9cace;
  }
        
      

        
          :root {
    --secondary-button-text-color: #1e212a;
  }
        
      

        
      

        
          :root {
    --link-color: #078480;
  }
        
      

        
          :root {
    --title-font-color: #1e212a;
  }
        
      

        
          :root {
    --font-default-color: #1e212a;
  }
        
      

        
          :root {
    --widget-background-color: #ffffff;
  }
        
      

        
          :root {
    --box-border-color: #c9cace;
  }
        
      

        
          :root {
    --font-light-color: #65676e;
  }
        
      

        
          :root {
    --input-text-color: #000000;
  }
        
      

        
          :root {
    --input-border-color: #c9cace;
    --border-default-color: #c9cace;
  }
        
      

        
          :root {
    --input-background-color: #ffffff;
  }
        
      

        
          :root {
    --icon-default-color: #65676e;
  }
        
      

        
          :root {
    --error-color: #d03c38;
    --error-text-color: #ffffff;
  }
        
      

        
          :root {
    --success-color: #078480;
  }
        
      

        
          :root {
    --base-focus-color: #078480;
    --transparency-focus-color: rgba(7,132,128, 0.15);
  }
        
      

        
          :root {
    --base-hover-color: #000000;
    --transparency-hover-color: rgba(0,0,0, var(--hover-transparency-value));
  }
        
      

        
      




        
          
        
      

        
          html, :root {
    font-size: 100%;
    --default-font-size: 1rem;
    --small-font-size: 0.75rem;
    --title-font-size: 1.5rem;
    --lg-font-size: 1rem;
    --xl-font-size: 1.25rem;
    --spacing: 0.5rem;
  }
  .af-custom-form-container .af-form {
    font-size: 1rem;
  }
        
      

        
          body {
    --title-font-size: 1.5rem;
    --title-font-weight: var(--font-default-weight);
  }
        
      

        
          .cddf422f5 {
    font-size: 0.875rem;
    font-weight: var(--font-default-weight);
  }
        
      

        
          .c5b9cb0cf {
    font-size: 0.875rem;
    font-weight: var(--font-default-weight);
  }
  .ulp-passkey-benefit-heading {
    font-size: 1.025rem;
  }
        
      

        
          .cc9c37347, .c17ed0264 {
    font-size: 1rem;
    font-weight: var(--font-default-weight);
  }
        
      

        
          body {
    --ulp-label-font-size: 1rem;
    --ulp-label-font-weight: var(--font-default-weight);
  }
        
      

        
          .ce30c2469, .c41cc1129, [id^='ulp-container-'] a {
    font-size: 0.875rem;
    font-weight: var(--font-bold-weight) !important;
  }
        
      

        
          
        
      




        
          :root {
    --button-border-width: 1px;
    --social-button-border-width: 1px;
    --radio-border-width: 1px;
  }
        
      

        
          body {
    --button-border-radius: 3px;
    --radio-border-radius: 3px;
  }
        
      

        
          :root {
    --input-border-width: 1px;
  }
        
      

        
          body {
    --input-border-radius: 3px;
  }

  .af-custom-form-container .af-form {
    --border-radius: 3px;
  }
        
      

        
          :root {
    --border-radius-outer: 5px;
  }
        
      

        
          :root {
    --box-border-width: 0px;
  }
        
      

        
          
        
      




        
          
    body {
      --logo-alignment: 0 auto;
    }
  
        
      

        
          
    .c7bbeb26c {
      content: url('https://www.myprosperity.com.au/wp-content/uploads/2020/02/cropped-circle-rgb-favicon-192x192.png');
    }
  
        
      

        
          body {
    --logo-height: 52px;
  }
  .c7bbeb26c {
    height: var(--logo-height);
  }
  
        
      

        
          
    body {
      --header-alignment: center;
    }
  
        
      

        
          
        
      




        
          .cf0f63c27 {
    --page-background-alignment: center;
  }
        
      

        
          body {
    --page-background-color: #F5F5F5;
  }
        
      

        
          
        
      




      
    </style>
    <style>
    /* By default, hide features for javascript-disabled browsing */
    /* We use !important to override any css with higher specificity */
    /* It is also overriden by the styles in <noscript> in the header file */
    .no-js {
      clip: rect(0 0 0 0);
      clip-path: inset(50%);
      height: 1px;
      overflow: hidden;
      position: absolute;
      white-space: nowrap;
      width: 1px;
    }
  </style>
  <noscript>
    <style>
      /* We use !important to override the default for js enabled */
      /* If the display should be other than block, it should be defined specifically here */
      .js-required { display: none !important; }
      .no-js {
        clip: auto;
        clip-path: none;
        height: auto;
        overflow: auto;
        position: static;
        white-space: normal;
        width: 100%;
      }
      .no-js-container {
        width: var(--prompt-width);
      }
    </style>
  </noscript>
    

    <title>Log in | mp-app-prod</title>
  </head>
  <body
    class="_widget-auto-layout _widget-auto-layout _use-custom-prompt-logo"
    data-token="mp"
    data-show-branding=""
    data-cobrand-white-header="False"
    data-cobrand-hide-registration="True"
    data-promp-id="login-id"
  >
    <main class="_widget login-id">
  <section class="c5431f316 _prompt-box-outer ca8ae2309">
    <div class="cea408cbe c3294138f">
      
    
      
        
          
        
      
    
      <div class="c6cde4daa">
        <header class="ca43254f0 c499f492f" id="screen-header" tabindex="-1">
          <div title="myprosperity" id="custom-prompt-logo" style="width: auto !important; height: 60px !important; position: static !important; margin: auto !important; padding: 0 !important; background-color: transparent !important; background-position: center !important; background-size: contain !important; background-repeat: no-repeat !important"></div>
        
          <img class="c7bbeb26c ca2220b5a" id="prompt-logo-center" src="https://www.myprosperity.com.au/wp-content/uploads/2020/02/cropped-circle-rgb-favicon-192x192.png" alt="myprosperity">
        
          
            <h1 class="cba8df1ce c9b7c85f1">Welcome</h1>
          
        
          <div class="cddf422f5 cbdcf07fd">
            <p class="c5ff91828 c4ff0973c">Log in to access your portal</p>
          </div>
        </header>
      
        <div class="c5b9cb0cf c56e48ef2">
          
        
          
            <div class="cc4069bbe cc22a6267">
              <div class="c4402ca7c">
                
              
                
              
                
                  
                    <form method="POST" class="c583c0a13 _form-login-id" data-form-primary="true" data-disable-html-validations="true">
                      <div id="ulp-error-announcer" class="screen-reader-only" aria-live="assertive" aria-atomic="true"></div>
                    
                      
                        
                          <button type="submit" name="action" class="ulp-hidden-form-submit-button" style="opacity: 0 !important; position: absolute !important; pointer-events: none !important" value="default" aria-hidden="true" tabindex="-1">Continue</button>
                        
                      
                    
                      <input type="hidden" name="state" value="hKFo2SBZS0ZBbTRTenNsaV9XbFFjZ2NmOG5zbGxvdGo4b1gtNaFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIE9va2tBLWVhTEd5ek1KZUNJa29EZmV6RENKcGs4QWVVo2NpZNkgaWxmcGNDeVZTOWFKbFZmV24ydm1sWmJ4Y3haVm41Rno">
                    
                      
                    
                      
                    
                      <div class="cc4069bbe cc22a6267">
                        <div class="c4402ca7c">
                          
                        
                          
                        
                          
                            
                              
                                
                                  
                                    <div class="input-wrapper _input-wrapper">
                                      <div class="cb4eb055c c48f044e7 text cb62648e6 ulp-field" data-action-text="" data-alternate-action-text="">
                                        <label id="username-label" class="cb1ce033b ce3dd32dd c019efb25" for="username">
                                          Username or Email address
                                        
                                           
                                            <span class="required" aria-hidden="true">*</span>
                                          
                                        </label>
                                      
                                        <input class="input c2b8d38fa cc829e2ad" inputMode="text" name="username" id="username" type="text" aria-labelledby="username-label" aria-required="true" value="" required autoComplete="username" autoCapitalize="none" spellCheck="false">
                                      
                                        
                                      </div>
                                    
                                      
                                        <div id="error-cs-username-required" class="ulp-error-info aria-error-check" data-ulp-validation-function="ulpRequiredFunction" data-ulp-validation-event-listeners="blur,change,input,focus" data-ulp-validation-target="username" aria-live="polite" aria-atomic="true">
                                          Email address or username is required
                                        </div>
                                      
                                    
                                      
                                    
                                      
                                    
                                      
                                    
                                      
                                        <div id="error-cs-pattern-mismatch" class="ulp-error-info aria-error-check" data-ulp-validation-function="ulpPatternCheckFunction" data-ulp-validation-event-listeners="blur,change,input,focus" data-ulp-validation-target="username" aria-live="polite" aria-atomic="true">Enter a valid email address or username</div>
                                      
                                    
                                      
                                    </div>
                                  
                                
                              
                            
                          
                        
                          
                        </div>
                      </div>
                    
                      
                    
                      <input class="hide" type="password" autoComplete="off" tabindex="-1" aria-hidden="true">
                    
                      <input type="hidden" id="js-available" name="js-available" value="false">
                    
                      <input type="hidden" id="webauthn-available" name="webauthn-available" value="false">
                    
                      <input type="hidden" id="is-brave" name="is-brave" value="false">
                    
                      <input type="hidden" id="webauthn-platform-available" name="webauthn-platform-available" value="false">
                    
                      
                    
                      <div class="c854fadc6">
                        
                          <button type="submit" name="action" value="default" class="cc9c37347 ccfae5bcb ce0a9fe30 cf9a2ed2e _button-login-id" data-action-button-primary="true">Continue</button>
                        
                      </div>
                    </form>
                  
                
              </div>
            </div>
          
        
          
        
          
            <div class="ulp-alternate-action  _alternate-action __s16nu9">
              <p class="c5ff91828 c4ff0973c ce2e12ef9">Don&#39;t have an account? 
                <a class="c41cc1129 caabfe509" href="/u/signup/identifier?state=hKFo2SBZS0ZBbTRTenNsaV9XbFFjZ2NmOG5zbGxvdGo4b1gtNaFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIE9va2tBLWVhTEd5ek1KZUNJa29EZmV6RENKcGs4QWVVo2NpZNkgaWxmcGNDeVZTOWFKbFZmV24ydm1sWmJ4Y3haVm41Rno">Sign up</a>
              </p>
            </div>
          
        
          
        
          
            <div class="c357271f4 cfc3ebfc3">
              <span>Or</span>
            </div>
          
        
          
        
          
            
          
            <div class="cb38313b0 ceebe3fc8">
              
            
              
                <form method="post" data-provider="google" class="c17ed0264 cb2f06e4b c794f9603" data-form-secondary="true">
                  <input type="hidden" name="state" value="hKFo2SBZS0ZBbTRTenNsaV9XbFFjZ2NmOG5zbGxvdGo4b1gtNaFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIE9va2tBLWVhTEd5ek1KZUNJa29EZmV6RENKcGs4QWVVo2NpZNkgaWxmcGNDeVZTOWFKbFZmV24ydm1sWmJ4Y3haVm41Rno">
                
                  <input type="hidden" name="connection" value="google-oauth2">
                
                  <button type="submit" class="ca1c710b0 c0132c108 c5f992768" data-provider="google" data-action-button-secondary="true">
                    
                      <span class="cb8afc6a6 c3c12af60" data-provider="google"></span>
                    
                  
                    <span class="c17890ef2">Continue with Google</span>
                  </button>
                </form>
              
                <form method="post" data-provider="windowslive" class="c17ed0264 cb2f06e4b ccee65824" data-form-secondary="true">
                  <input type="hidden" name="state" value="hKFo2SBZS0ZBbTRTenNsaV9XbFFjZ2NmOG5zbGxvdGo4b1gtNaFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIE9va2tBLWVhTEd5ek1KZUNJa29EZmV6RENKcGs4QWVVo2NpZNkgaWxmcGNDeVZTOWFKbFZmV24ydm1sWmJ4Y3haVm41Rno">
                
                  <input type="hidden" name="connection" value="windowslive">
                
                  <button type="submit" class="ca1c710b0 c0132c108 cd24ed1f4" data-provider="windowslive" data-action-button-secondary="true">
                    
                      <span class="cb8afc6a6 c3c12af60" data-provider="windowslive"></span>
                    
                  
                    <span class="c17890ef2">Continue with Microsoft Account</span>
                  </button>
                </form>
              
            
              
            </div>
          
        </div>
      </div>
    
      
    </div>
  
    
  </section>
</main>
<script id="client-scripts">
window.ulpFlags = {"custom_prompts_passkeys":true,"ulp_field_validation_double_submit_fix":false,"enable_ulp_wcag_compliance":true,"enable_ulp_rtl_support":false,"disable_ulp_form_submission_fix":false};!function(){var e,t,P,R,N,q,I,O,n,j,D,M,U,H,W,r,a,i,o,u,c={exports:function(e,t){return"object"==typeof e.ulpFlags&&null!==e.ulpFlags?e.ulpFlags:{}}}.exports(window,document),l=((e={}).exports=function(n,l){var r={},a={};function u(e,t){if(e.classList)return e.classList.add(t);var n=e.className.split(" ");-1===n.indexOf(t)&&(n.push(t),e.className=n.join(" "))}function i(e,t,n,r){return e.addEventListener(t,n,r)}function o(e){return"string"==typeof e}function c(e,t){return o(e)?l.querySelector(e):e.querySelector(t)}function s(e,t){var n=o(e)?l.querySelectorAll(e):e.querySelectorAll(t);return Array.prototype.slice.call(n)}function f(e,t){if(e.classList)return e.classList.remove(t);var n=e.className.split(" "),r=n.indexOf(t);-1!==r&&(n.splice(r,1),e.className=n.join(" "))}function d(e,t){return e.getAttribute(t)}function p(e,t,n){return e.setAttribute(t,n)}function v(e){return e.remove()}var e=["text","number","email","password","tel","url"],t="select,textarea,"+e.map(function(e){return'input[type="'+e+'"]'}).join(",");return{addClass:u,toggleClass:function(e,t,n){if(!0===n||!1===n)return r=e,a=t,!0!==n?f(r,a):u(r,a);var r,a;if(e.classList)return e.classList.toggle(t);var i=e.className.split(" "),o=i.indexOf(t);-1!==o?i.splice(o,1):i.push(t),e.className=i.join(" ")},hasClass:function(e,t){return e.classList?e.classList.contains(t):-1!==e.className.split(" ").indexOf(t)},addClickListener:function(e,t){return i(e,"click",t)},addEventListener:i,getAttribute:d,hasAttribute:function(e,t){return e.hasAttribute(t)},getElementById:function(e){return l.getElementById(e)},getParent:function(e){return e.parentNode},isString:o,loadScript:function(e,t){var n=l.createElement("script");for(var r in t)r.startsWith("data-")?n.dataset[r.replace("data-","")]=t[r]:n[r]=t[r];n.src=e,l.body.appendChild(n)},removeScript:function(e){l.querySelectorAll('script[src="'+e+'"]').forEach(function(e){e.remove()})},poll:function(e){var i=e.interval||2e3,t=e.url||n.location.href,o=e.condition||function(){return!0},u=e.onSuccess||function(){},c=e.onError||function(){};return setTimeout(function r(){if(l.hidden)return setTimeout(r,i);var a=new XMLHttpRequest;return a.open("GET",t),a.setRequestHeader("Accept","application/json"),a.onload=function(){if(200===a.status){var e="application/json"===a.getResponseHeader("Content-Type").split(";")[0]?JSON.parse(a.responseText):a.responseText;return o(e)?u():setTimeout(r,i)}if(429!==a.status)return c({status:a.status,responseText:a.responseText});var t=1e3*Number.parseInt(a.getResponseHeader("X-RateLimit-Reset")),n=t-(new Date).getTime();return setTimeout(r,i<n?n:i)},a.send()},i)},querySelector:c,querySelectorAll:s,removeClass:f,removeElement:v,setAttribute:p,removeAttribute:function(e,t){return e.removeAttribute(t)},swapAttributes:function(e,t,n){var r=d(e,t),a=d(e,n);p(e,n,r),p(e,t,a)},setGlobalFlag:function(e,t){r[e]=!!t},getGlobalFlag:function(e){return!!r[e]},setSubmittedForm:function(e,t){a[e]=t},getSubmittedForm:function(e){return a[e]},preventFormSubmit:function(e){e.stopPropagation(),e.preventDefault()},getUlpFields:function(e){var t=[];return s(e,'input[name^="ulp-"], textarea[name^="ulp-"], select[name^="ulp-"]').forEach(function(e){t.push({name:d(e,"name"),value:e.value})}),t},appendUlpFieldsToForm:function(n,e){e&&e.length&&(s(n,'input[type="hidden"][name^="ulp-"], textarea[name^="ulp-"], select[name^="ulp-"]').forEach(function(e){v(e)}),e.forEach(function(e){var t=l.createElement("input");p(t,"type","hidden"),p(t,"name",e.name),p(t,"value",e.value),n.appendChild(t)}))},matchMedia:function(e){return"function"==typeof n.matchMedia&&n.matchMedia(e).matches},dispatchEvent:function(e,t,n){var r;"function"!=typeof Event?(r=l.createEvent("Event")).initCustomEvent(t,n,!1):r=new Event(t,{bubbles:n}),e.dispatchEvent(r)},timeoutPromise:function(e,a){return new Promise(function(t,n){var r=setTimeout(function(){n(new Error("timeoutPromise: promise timed out"))},e);a.then(function(e){clearTimeout(r),t(e)},function(e){clearTimeout(r),n(e)})})},createMutationObserver:function(e){return"undefined"==typeof MutationObserver?null:new MutationObserver(e)},consoleWarn:function(){(console.warn||console.log).apply(console,arguments)},getConfigJson:function(e){try{var t=c(e);if(!t)return null;var n=t.value;return n?JSON.parse(n):null}catch(e){return null}},getCSSVariable:function(e){return getComputedStyle(l.documentElement).getPropertyValue(e)},removeAndTrimString:function(e,t){var n=new RegExp(t,"g"),r=e.replace(n,"");return r=r.replace(/\s+/g,"  ").trim()},htmlEncode:function(e){var t=l.createTextNode(e),n=l.createElement("span");return n.appendChild(t),n.innerHTML||""},cleanServerErrorMessage:function(e,t){0<e.length&&0<t.length&&t.forEach(function(e){v(e)})},arrayFrom:function(e){return Array.prototype.slice.call(e)},arrayIncludes:function(e,t){return-1!==e.indexOf(t)},stringStartsWith:function(e,t){return 0===e.indexOf(t)},stringEndsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},setTimeout:setTimeout,globalWindow:n,SUPPORTED_INPUT_TYPES:e,ELEMENT_TYPE_SELECTOR:t,RUN_INIT:!0}},e.exports)(window,document),s=function(){var e={};function g(e){if(!("string"==typeof e||e instanceof String)){var t=typeof e;throw null===e?t="null":"object"===t&&(t=e.constructor.name),new TypeError("Expected a string but received a "+t)}}function b(e,t){var n,r;g(e),r="object"==typeof t?(n=t.min||0,t.max):(n=t,arguments[2]);var a=encodeURI(e).split(/%..|./).length-1;return n<=a&&(void 0===r||a<=r)}function y(e,t){for(var n in void 0===e&&(e={}),t)void 0===e[n]&&(e[n]=t[n]);return e}var w={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1},t="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",n="("+t+"[.]){3}"+t,r=new RegExp("^"+n+"$"),a="(?:[0-9a-fA-F]{1,4})",i=new RegExp("^((?:"+a+":){7}(?:"+a+"|:)|(?:"+a+":){6}(?:"+n+"|:"+a+"|:)|(?:"+a+":){5}(?::"+n+"|(:"+a+"){1,2}|:)|(?:"+a+":){4}(?:(:"+a+"){0,1}:"+n+"|(:"+a+"){1,3}|:)|(?:"+a+":){3}(?:(:"+a+"){0,2}:"+n+"|(:"+a+"){1,4}|:)|(?:"+a+":){2}(?:(:"+a+"){0,3}:"+n+"|(:"+a+"){1,5}|:)|(?:"+a+":){1}(?:(:"+a+"){0,4}:"+n+"|(:"+a+"){1,6}|:)|(?::((?::"+a+"){0,5}:"+n+"|(?::"+a+"){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})?$");function _(e,t){return void 0===t&&(t=""),g(e),(t=String(t))?"4"===t?r.test(e):"6"===t&&i.test(e):_(e,4)||_(e,6)}var x={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},E=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,C=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,A=/^[a-z\d]+$/,S=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,T=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,L=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,F=254;function u(e,t,n,r,a){if(g(e),e=e.trim(),(t=y(t,x)).require_display_name||t.allow_display_name){var i=e.match(E);if(i){var o=i[1];if(e=e.replace(o,"").replace(/(^<|>$)/g,""),a(o," ")&&(o=o.slice(0,-1)),!function(e){var t=e.replace(/^"(.+)"$/,"$1");if(!t.trim())return!1;if(/[\.";<>]/.test(t)){if(t===e)return!1;if(t.split('"').length!==t.split('\\"').length)return!1}return!0}(o))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>F)return!1;var u=e.split("@"),c=u.pop(),l=c.toLowerCase();if(n(t.host_blacklist,l))return!1;if(0<t.host_whitelist.length&&!n(t.host_whitelist,l))return!1;var s=u.join("@");if(t.domain_specific_validation&&("gmail.com"===l||"googlemail.com"===l)){var f=(s=s.toLowerCase()).split("+")[0];if(!b(f.replace(/\./g,""),{min:6,max:30}))return!1;for(var d=f.split("."),p=0;p<d.length;p++)if(!A.test(d[p]))return!1}if(!(!1!==t.ignore_max_length||b(s,{max:64})&&b(c,{max:254})))return!1;if(!function(e,t){g(e),(t=y(t,w)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1)),!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var n=e.split("."),r=n[n.length-1];if(t.require_tld){if(n.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(r))return!1;if(/\s/.test(r))return!1}return!(!t.allow_numeric_tld&&/^\d+$/.test(r))&&n.every(function(e){return!(63<e.length&&!t.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)||/[\uff01-\uff5e]/.test(e)||/^-|-$/.test(e)||!t.allow_underscores&&/_/.test(e))})}(c,{require_tld:t.require_tld,ignore_max_length:t.ignore_max_length,allow_underscores:t.allow_underscores})){if(!t.allow_ip_domain)return!1;if(!_(c)){if(!r(c,"[")||!a(c,"]"))return!1;var v=c.slice(1,-1);if(0===v.length||!_(v))return!1}}if('"'===s[0])return s=s.slice(1,s.length-1),t.allow_utf8_local_part?L.test(s):S.test(s);for(var h=t.allow_utf8_local_part?T:C,m=(d=s.split("."),0);m<d.length;m++)if(!h.test(d[m]))return!1;return!t.blacklisted_chars||-1===s.search(new RegExp("["+t.blacklisted_chars+"]+","g"))}return e.exports=function(r,a,n,i,o){return{ulpRequiredFunction:function(e,t){return!t||!!e.value},ulpPasswordPolicyFunction:function(e,t){if(r&&r.ulpFlags&&r.ulpFlags.disable_ulp_form_submission_fix)return!0;if(!e||"password"!==e.name)return!0;if(!a.querySelector(".ca7221dd0.cef456bac"))return!0;if(!e.value)return!0;var n=e.classList&&e.classList.contains("ca02405fd");return!t&&!n||!n},ulpEmailValidationFunction:function(e,t){return!t||!e.value||!!u(e.value,void 0,n,i,o)},ulpPatternCheckFunction:function(e,t){return!t||!e.value||function(e){if("password"===e.name)return!0;var t=e.getAttribute("pattern");return!t||null!==e.value.match(t)}(e)}}},e.exports}()(window,document,l.arrayIncludes,l.stringStartsWith,l.stringEndsWith),f={exports:function(e,t){for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",s=new Uint8Array(256),o=0;o<i.length;o++)s[i.charCodeAt(o)]=o;function u(e){var t,n=new Uint8Array(e),r=n.length,a="";for(t=0;t<r;t+=3)a+=i[n[t]>>2],a+=i[(3&n[t])<<4|n[t+1]>>4],a+=i[(15&n[t+1])<<2|n[t+2]>>6],a+=i[63&n[t+2]];return r%3==2?a=a.substring(0,a.length-1):r%3==1&&(a=a.substring(0,a.length-2)),a}function n(){return navigator&&navigator.credentials&&"undefined"!=typeof PublicKeyCredential}return{base64URLEncode:u,base64URLDecode:function(e){var t,n,r,a,i,o=.75*e.length,u=e.length,c=0,l=new Uint8Array(o);for(t=0;t<u;t+=4)n=s[e.charCodeAt(t)],r=s[e.charCodeAt(t+1)],a=s[e.charCodeAt(t+2)],i=s[e.charCodeAt(t+3)],l[c++]=n<<2|r>>4,l[c++]=(15&r)<<4|a>>2,l[c++]=(3&a)<<6|63&i;return l.buffer},publicKeyCredentialToJSON:function e(t){if(t instanceof Array){var n=[];for(o=0;o<t.length;o+=1)n.push(e(t[o]));return n}if(t instanceof ArrayBuffer)return u(t);if(t instanceof Object){var r={};for(var a in t)r[a]=e(t[a]);return r}return t},str2ab:function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0,a=e.length;r<a;r++)n[r]=e.charCodeAt(r);return t},isWebAuthnAvailable:n,isWebauthnPlatformAuthenticatorAvailableAsync:function(e){return n()?e(1e3,PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()):Promise.resolve(!1)}}}}.exports(window,document);({exports:function(e,r,a,t){var n=e(".ce6d6c470"),i=e("#alert-trigger"),o=e(".c547ff72d"),u=e(".c3d6ad67e"),c=!1;i&&u&&n&&t(n,function(e){var t=e.target===i,n=u.contains(e.target);return t&&!c?(r(o,"show"),void(c=!0)):t&&c||c&&!n?(a(o,"show"),void(c=!1)):void 0})}}).exports(l.querySelector,l.addClass,l.removeClass,l.addClickListener),(P="recaptcha_v2",R="recaptcha_enterprise",N="hcaptcha",q="friendly_captcha",I="arkose",O="auth0_v2",(t={}).exports=function(i,u,c,l,s,f,d,p,n,a){if(!n.enable_ulp_rtl_support){var v=500,h=3,m=0,g=c("div[data-captcha-sitekey]"),b=c(".ulp-captcha-client-error"),r=b?b.innerHTML:"",y=c("div[data-captcha-sitekey] input");if(g){var e=E(),t=C();e&&t&&function(){var e="captchaCallback_"+Math.floor(1000001*Math.random()),t=E(),n={async:!0,defer:!0},r=function(e,t,n,r){switch(E()){case P:return"https://www.recaptcha.net/recaptcha/api.js?render=explicit&hl="+e+"&onload="+t;case R:return"https://www.recaptcha.net/recaptcha/enterprise.js?render=explicit&hl="+e+"&onload="+t;case N:return"https://js.hcaptcha.com/1/api.js?render=explicit&hl="+e+"&onload="+t;case q:return"https://cdn.jsdelivr.net/npm/friendly-challenge@0.9.14/widget.min.js";case I:return"https://"+n+".arkoselabs.com/v2/"+r+"/api.js";case O:return"https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload="+t}}(x(),e,g?g.getAttribute("data-captcha-client-subdomain"):null,C());if(t===I||t===O){n["data-callback"]=e;var o=!(n.onerror=function(){if(m<h)return u(r),i(r,n),void m++;u(r),S("BYPASS_CAPTCHA")}),a=function(e){o=!0;try{if(!e||"function"!=typeof e.run||"function"!=typeof e.setConfig)return void F("INVALID_CREDENTIALS");r=e,a=A(),i=function(e){var t=y?y.value:"";t&&""!==t||(e.preventDefault(),e.stopPropagation(),setTimeout(function(){r.run()},v))},a&&(a.addEventListener("submit",i,!0),r.setConfig({onCompleted:function(e){if(!e||!e.token)return a&&a.removeEventListener("submit",i,!0),void F("INVALID_CREDENTIALS");S(e.token),a&&(a.removeEventListener("submit",i,!0),a.requestSubmit?a.requestSubmit():a.submit())},onError:function(n){return fetch("https://status.arkoselabs.com/api/v2/status.json").then(function(e){return e.json()}).then(function(e){var t=e.status.indicator;return"none"===t}).catch(function(e){return!1}).then(function(e){if(e&&m<h)return r.reset(),new Promise(function(e){setTimeout(function(){e(r.run())},v),m++});var t=n&&n.cbe90896e?n.cbe90896e:"RUNTIME_ERROR";b.innerHTML=b.innerHTML.replace("#{errorCode}",p(t)),l(g,"cbe90896e"),s(b,"hide"),S("BYPASS_CAPTCHA"),a.removeEventListener("submit",i,!0)})}}))}catch(e){F("INIT_ERROR")}var r,a,i};t===O&&(a=function(){k()}),window[e]=a,t===I&&(n.onload=function(){setTimeout(function(){o||F("INVALID_CREDENTIALS")},250)})}else window[e]=function(){delete window[e],k()},t===q&&(l(_(),"frc-captcha"),d(_(),"data-sitekey",C()),n.onload=window[e]);i(r,n)}()}}function w(){switch(E()){case P:return window.grecaptcha;case R:return window.grecaptcha.enterprise;case N:return window.hcaptcha;case q:return window.friendlyChallenge;case I:return window.arkose;case O:return window.turnstile}}function _(){return c(function(){switch(E()){case P:case R:return"#ulp-recaptcha";case N:return"#ulp-hcaptcha";case q:return"#ulp-friendly-captcha";case I:return"#ulp-arkose";case O:return"#ulp-auth0-v2-captcha"}}())}function x(){return g?g.getAttribute("data-captcha-lang"):null}function E(){return g?g.getAttribute("data-captcha-provider"):null}function C(){return g?g.getAttribute("data-captcha-sitekey"):null}function A(){return c('form[data-form-primary="true"]')}function S(e){return y.value=e}function o(){return c("#error-element-captcha-required")}function T(){var e=o();e&&l(e,"hide");var t=c("#captcha-required-status");t&&(t.textContent=""),a&&a("invalidCaptcha",!1)}function L(t){if(n.enable_ulp_wcag_compliance){var e=A();e&&y&&t&&e.addEventListener("submit",function(e){y.value?T():(e.preventDefault(),l(g,"cbe90896e"),function(){var e=o();e&&s(e,"hide");var t=c("#captcha-required-status");if(t){var n=t.getAttribute("data-captcha-required-error");if(n){var r=-1!==t.textContent.indexOf("​");t.textContent=n+(r?"":"​")}}a&&a("invalidCaptcha",!0)}(),t.focus())},!0)}}function F(e){if(b&&g){b.innerHTML=r.replace("#{errorCode}",p(e||"INIT_ERROR")),l(g,"cbe90896e"),s(b,"hide");var t=c("#error-element-captcha");t&&l(t,"hide")}}function k(){var e=w(),t=f("--ulp-captcha-widget-theme");t=t?t.trim():"light";var n=c("#captcha-status"),r=n?n.getAttribute("data-captcha-expired-error"):"";if(E()===q)"dark"===t&&l(c(".frc-captcha"),"dark"),(o=e.autoWidget).opts.language=x(),o.opts.doneCallback=function(e){S(e)};else{var a=_();d(a,"tabindex","-1");var i={sitekey:C(),theme:t,"expired-callback":function(){S(""),l(g,"cbe90896e"),e.reset(o),n&&(n.textContent=r),a.focus()},callback:function(e){S(e),s(g,"cbe90896e"),n&&(n.textContent=""),T()}};E()===O&&(i.language=x(),i.retry="never",i.size="flexible",i["response-field"]=!1,i["error-callback"]=function(e){return console.error("ERROR: Auth Challenge Error Code",e),S(""),m<h?(m++,w().reset(o)):(b.innerHTML=b.innerHTML.replace("#{errorCode}",p(e)),l(g,"cbe90896e"),s(b,"hide")),!0});var o=e.render(a,i);n&&(n.textContent=""),E()===P&&L(a)}}},t.exports)(l.loadScript,l.removeScript,l.querySelector,l.addClass,l.removeClass,l.getCSSVariable,l.setAttribute,l.htmlEncode,c,l.setGlobalFlag),(j="recaptcha_v2",D="recaptcha_enterprise",M="hcaptcha",U="friendly_captcha",H="arkose",W="auth0_v2",(n={}).exports=function(i,u,c,l,s,f,d,p,n,a){if(n.enable_ulp_rtl_support){var v=500,h=3,m=0,g=c("div[data-captcha-sitekey]"),b=c(".ulp-captcha-client-error"),r=b?b.innerHTML:"",y=c("div[data-captcha-sitekey] input");if(g){var e=E(),t=C();e&&t&&function(){var e="captchaCallback_"+Math.floor(1000001*Math.random()),t=E(),n={async:!0,defer:!0},r=function(e,t,n,r){switch(E()){case j:return"https://www.recaptcha.net/recaptcha/api.js?render=explicit&hl="+e+"&onload="+t;case D:return"https://www.recaptcha.net/recaptcha/enterprise.js?render=explicit&hl="+e+"&onload="+t;case M:return"https://js.hcaptcha.com/1/api.js?render=explicit&hl="+e+"&onload="+t;case U:return"https://cdn.jsdelivr.net/npm/friendly-challenge@0.9.14/widget.min.js";case H:return"https://"+n+".arkoselabs.com/v2/"+r+"/api.js";case W:return"https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload="+t}}(x(),e,g?g.getAttribute("data-captcha-client-subdomain"):null,C());if(t===H||t===W){n["data-callback"]=e;var o=!(n.onerror=function(){if(m<h)return u(r),i(r,n),void m++;u(r),S("BYPASS_CAPTCHA")}),a=function(e){o=!0;try{if(!e||"function"!=typeof e.run||"function"!=typeof e.setConfig)return void F("INVALID_CREDENTIALS");r=e,a=A(),i=function(e){var t=y?y.value:"";t&&""!==t||(e.preventDefault(),e.stopPropagation(),setTimeout(function(){r.run()},v))},a&&(a.addEventListener("submit",i,!0),r.setConfig({language:x(),onCompleted:function(e){if(!e||!e.token)return a&&a.removeEventListener("submit",i,!0),void F("INVALID_CREDENTIALS");S(e.token),a&&(a.removeEventListener("submit",i,!0),a.requestSubmit?a.requestSubmit():a.submit())},onError:function(n){return fetch("https://status.arkoselabs.com/api/v2/status.json").then(function(e){return e.json()}).then(function(e){var t=e.status.indicator;return"none"===t}).catch(function(e){return!1}).then(function(e){if(e&&m<h)return r.reset(),new Promise(function(e){setTimeout(function(){e(r.run())},v),m++});var t=n&&n.cbe90896e?n.cbe90896e:"RUNTIME_ERROR";b.innerHTML=b.innerHTML.replace("#{errorCode}",p(t)),l(g,"cbe90896e"),s(b,"hide"),S("BYPASS_CAPTCHA"),a.removeEventListener("submit",i,!0)})}}))}catch(e){F("INIT_ERROR")}var r,a,i};t===W&&(a=function(){k()}),window[e]=a,t===H&&(n.onload=function(){setTimeout(function(){o||F("INVALID_CREDENTIALS")},250)})}else window[e]=function(){delete window[e],k()},t===U&&(l(_(),"frc-captcha"),d(_(),"data-sitekey",C()),d(_(),"data-lang",x()),n.onload=window[e]);i(r,n)}()}}function w(){switch(E()){case j:return window.grecaptcha;case D:return window.grecaptcha.enterprise;case M:return window.hcaptcha;case U:return window.friendlyChallenge;case H:return window.arkose;case W:return window.turnstile}}function _(){return c(function(){switch(E()){case j:case D:return"#ulp-recaptcha";case M:return"#ulp-hcaptcha";case U:return"#ulp-friendly-captcha";case H:return"#ulp-arkose";case W:return"#ulp-auth0-v2-captcha"}}())}function x(){return g?g.getAttribute("data-captcha-lang"):null}function E(){return g?g.getAttribute("data-captcha-provider"):null}function C(){return g?g.getAttribute("data-captcha-sitekey"):null}function A(){return c('form[data-form-primary="true"]')}function S(e){return y.value=e}function o(){return c("#error-element-captcha-required")}function T(){var e=o();e&&l(e,"hide");var t=c("#captcha-required-status");t&&(t.textContent=""),a&&a("invalidCaptcha",!1)}function L(t){if(n.enable_ulp_wcag_compliance){var e=A();e&&y&&t&&e.addEventListener("submit",function(e){y.value?T():(e.preventDefault(),l(g,"cbe90896e"),function(){var e=o();e&&s(e,"hide");var t=c("#captcha-required-status");if(t){var n=t.getAttribute("data-captcha-required-error");if(n){var r=-1!==t.textContent.indexOf("​");t.textContent=n+(r?"":"​")}}a&&a("invalidCaptcha",!0)}(),t.focus())},!0)}}function F(e){if(b&&g){b.innerHTML=r.replace("#{errorCode}",p(e||"INIT_ERROR")),l(g,"cbe90896e"),s(b,"hide");var t=c("#error-element-captcha");t&&l(t,"hide")}}function k(){var e=w(),t=f("--ulp-captcha-widget-theme");t=t?t.trim():"light";var n=c("#captcha-status"),r=n?n.getAttribute("data-captcha-expired-error"):"";if(E()===U)"dark"===t&&l(c(".frc-captcha"),"dark"),(o=e.autoWidget).opts.language=x(),o.opts.doneCallback=function(e){S(e)};else{var a=_();d(a,"tabindex","-1");var i={sitekey:C(),theme:t,"expired-callback":function(){S(""),l(g,"cbe90896e"),e.reset(o),n&&(n.textContent=r),a.focus()},callback:function(e){S(e),s(g,"cbe90896e"),n&&(n.textContent=""),T()}};E()===W&&(i.language=x(),i.retry="never",i.size="flexible",i["response-field"]=!1,i["error-callback"]=function(e){return console.error("ERROR: Auth Challenge Error Code",e),S(""),m<h?(m++,w().reset(o)):(b.innerHTML=b.innerHTML.replace("#{errorCode}",p(e)),l(g,"cbe90896e"),s(b,"hide")),!0});var o=e.render(a,i);n&&(n.textContent=""),E()===j&&L(a)}}},n.exports)(l.loadScript,l.removeScript,l.querySelector,l.addClass,l.removeClass,l.getCSSVariable,l.setAttribute,l.htmlEncode,c,l.setGlobalFlag),((r={}).exports=function(r,e,a,i,o,u,c,l,n,s,t){if(!t.enable_ulp_wcag_compliance){if(r("body._simple-labels"))return e(".cb1ce033b.no-js").forEach(function(e){o(e,"no-js")}),void e(".cb1ce033b.js-required").forEach(function(e){i(e,"hide")});e(".cb4eb055c:not(.c42747798):not(disabled)").forEach(function(e){i(e,"c3402afc4");var t,n=r(e,".input");n.value&&i(e,"c10c9571a"),a(e,"change",f),a(n,"blur",f),a(n,"animationstart",d),t=n,c(function(){t.value&&l(t,"change",!0)},100)})}function f(e){var t=e.target,n=u(t);t.value||s(t,"data-autofilled")?i(n,"c10c9571a"):o(n,"c10c9571a")}function d(e){var t=e.target;"onAutoFillStart"===e.animationName&&(n(t,"data-autofilled",!0),l(e.target,"change",!0),a(t,"keyup",p,{once:!0}))}function p(e){var t=e.target;n(t,"data-autofilled","")}},r.exports)(l.querySelector,l.querySelectorAll,l.addEventListener,l.addClass,l.removeClass,l.getParent,l.setTimeout,l.dispatchEvent,l.setAttribute,l.getAttribute,c),{exports:function(e,t,r,a,i,o,u,c){function n(e){var t=r("submitted"),n=i("submittedForm");a("submitted",!0),o("submittedForm",e.currentTarget),t&&n&&n===e.currentTarget?u(e):"apple"===c(e.target,"data-provider")&&setTimeout(function(){a("submitted",!1)},2e3)}var l=e("form");l&&l.forEach(function(e){t(e,"submit",n)})}}.exports(l.querySelectorAll,l.addEventListener,l.getGlobalFlag,l.setGlobalFlag,l.getSubmittedForm,l.setSubmittedForm,l.preventFormSubmit,l.getAttribute),{exports:function(t,e,n){var r=t("form._form-detect-browser-capabilities"),a=t("main.login-id"),i=t("main.signup-with-passkeys"),o=t("div#passkey-detect-browser-capabilities");if(r||a||i||o){var u=e.isWebAuthnAvailable();t("#webauthn-available").value=u?"true":"false",t("#js-available").value="true",navigator.brave?navigator.brave.isBrave().then(function(e){t("#is-brave").value=e,c()}):c()}function c(){u?e.isWebauthnPlatformAuthenticatorAvailableAsync(n).then(function(e){t("#webauthn-platform-available").value=e?"true":"false",r&&r.submit()}).catch(function(e){t("#webauthn-platform-available").value="false",r&&r.submit()}):(t("#webauthn-platform-available").value="false",r&&r.submit())}}}.exports(l.querySelector,f,l.timeoutPromise),function(){var e={};function s(e,a,n,t,r,i,o,u,c){var l="user-initiated-passkey-challenge",s=a("#allow-passkeys");if(s&&s.value){var f=r("#passkey-config-json");if(f){var d=a(".passkey-begin-button"),p=n.isWebauthnPlatformAuthenticatorAvailableAsync(t),v=a("#username"),h=f,m=new AbortController;h.publicKey.challenge=n.base64URLDecode(h.publicKey.challenge);var g=a('form[data-form-primary="true"]');d&&e(d,function(e){d.disabled=!0,m.abort(l),navigator.credentials.get(h).then(function(e){var r=_(e);p.then(function(e){if(r.isUserVerifyingPlatformAuthenticatorAvailable=e,w(JSON.stringify(r)),c.custom_prompts_passkeys){var t=g?o(g):[];if(t.length){var n=a("form._form-passkey-challenge");u(n,t)}}b()})}).catch(function(e){y(e)})}),window.PublicKeyCredential&&window.PublicKeyCredential.isConditionalMediationAvailable&&window.PublicKeyCredential.isConditionalMediationAvailable().then(function(e){if(e){var t=Object.assign({},h,{mediation:"conditional",signal:m.signal});navigator.credentials.get(t).then(function(e){v.blur();var r=_(e);p.then(function(e){if(r.isUserVerifyingPlatformAuthenticatorAvailable=e,w(JSON.stringify(r)),c.custom_prompts_passkeys){var t=g?o(g):[];if(t.length){var n=a("form._form-passkey-challenge");u(n,t)}}b()})}).catch(function(e){e!==l&&"AbortError"!==e.name&&i("autofill UI error",e)})}}).catch(function(){})}}function b(){a("form._form-passkey-challenge").submit()}function y(e){var t;a("#action").value="showError::"+(t=e,JSON.stringify({name:t.name,message:t.message,stack:t.stack})),a("form._form-passkey-challenge").submit()}function w(e){a("#passkey").value=e}function _(e){var t={id:e.id,rawId:n.base64URLEncode(e.rawId),type:e.type,response:{clientDataJSON:n.base64URLEncode(e.response.clientDataJSON),authenticatorData:n.base64URLEncode(e.response.authenticatorData),signature:n.base64URLEncode(e.response.signature),userHandle:e.response.userHandle?n.base64URLEncode(e.response.userHandle):null}};return e.authenticatorAttachment&&(t.authenticatorAttachment=e.authenticatorAttachment),t}}return e.exports=function(e,t,n,r,a,i,o,u,c,l){return e(window,"load",function(e){s(t,n,r,a,i,o,u,c,l)}),{configurePasskeys:s}},e.exports}()(l.addEventListener,l.addClickListener,l.querySelector,f,l.timeoutPromise,l.getConfigJson,l.consoleWarn,l.getUlpFields,l.appendUlpFieldsToForm,c),{exports:function(t,e,n){var r=e(".passkey-hidden-ui"),a=navigator.userAgent.toLowerCase(),i=!!window.safari||a.match(/safari/)&&!a.match(/chrome/)&&!a.match(/chromium/);!r||r.length<=0||(i?r.forEach(function(e){t(e,"passkey-hidden-ui")}):window.PublicKeyCredential&&window.PublicKeyCredential.isConditionalMediationAvailable&&window.PublicKeyCredential.isConditionalMediationAvailable().then(function(e){e?r.forEach(function(e){n(e)}):r.forEach(function(e){t(e,"passkey-hidden-ui")})}).catch(function(e){r.forEach(function(e){t(e,"passkey-hidden-ui")})}))}}.exports(l.removeClass,l.querySelectorAll,l.removeElement),{exports:function(n,e,r,a,i,o,u,c,l,t,s,f){if(f.enable_ulp_wcag_compliance){var d=e("[id^='ulp-container-']");if(d&&d.length){var p=t(_);if(p)for(var v=0;v<d.length;v++)p.observe(d[v],{childList:!0,subtree:!0})}_()}function h(e){var t=e.target,n=o(t);t.value||c(t,"data-autofilled")?a(n,"c10c9571a"):i(n,"c10c9571a")}function m(e){var t=e.target,n=o(t);a(n,"focus"),w(t,n)}function g(e){var t=e.target,n=o(t);i(n,"focus"),h(e),w(t,n)}function b(e){var t=e.target;l(t,"data-autofilled","")}function y(e){var t=e.target;"onAutoFillStart"===e.animationName&&(l(t,"data-autofilled",!0),dispatchEvent(e.target,"change",!0),r(t,"keyup",b,{once:!0}))}function w(e,t){e.value?a(t,"c10c9571a"):i(t,"c10c9571a")}function _(){e(".ulp-field").forEach(function(e){if(!u(e,"c3402afc4")){var t=n(e,s);t&&(a(e,"c3402afc4"),w(t,e),setTimeout(function(){w(t,e)},50),t===document.activeElement&&a(e,"focus"),r(t,"change",h),r(t,"focus",m),r(t,"blur",g),r(t,"animationstart",y))}})}}}.exports(l.querySelector,l.querySelectorAll,l.addEventListener,l.addClass,l.removeClass,l.getParent,l.hasClass,l.getAttribute,l.setAttribute,l.createMutationObserver,l.ELEMENT_TYPE_SELECTOR,c),{exports:function(n,e,r,a,i,o,u,t,c,l){if(!l.enable_ulp_wcag_compliance){var s=e("[id^='ulp-container-']");if(s&&s.length){var f=t(g);if(f)for(var d=0;d<s.length;d++)f.observe(s[d],{childList:!0,subtree:!0});g()}}function p(e){var t=e.target,n=o(t);t.value?a(n,"c10c9571a"):i(n,"c10c9571a")}function v(e){var t=e.target,n=o(t);a(n,"focus"),m(t,n)}function h(e){var t=e.target,n=o(t);i(n,"focus"),m(t,n)}function m(e,t){e.value?a(t,"c10c9571a"):i(t,"c10c9571a")}function g(){e("[id^='ulp-container-'] .ulp-field").forEach(function(e){if(!u(e,"c3402afc4")){var t=n(e,c);t&&(a(e,"c3402afc4"),m(t,e),setTimeout(function(){m(t,e)},50),t===document.activeElement&&a(e,"focus"),r(t,"change",p),r(t,"focus",v),r(t,"blur",h))}})}}}.exports(l.querySelector,l.querySelectorAll,l.addEventListener,l.addClass,l.removeClass,l.getParent,l.hasClass,l.createMutationObserver,l.ELEMENT_TYPE_SELECTOR,c),((a={}).exports=function(i,o,r,a,c,l,u,s,f,d,p,v,t,h,m,e,n,g,b,y,w){if(y.enable_ulp_wcag_compliance){var _=!1,x=e+',input[type="checkbox"]',E=50;return q(),[x,C,A,S,T,k,R,P,N,q]}function C(e){var t=c(e,"data-ulp-validation-function"),n=a(e);return{functionName:t,element:i(n,x),parent:n}}function A(e){var a=[],i=[];return o(e,"[data-ulp-validation-function]").forEach(function(e){var t=C(e),n=[];if(t.element){if("input"===t.element.tagName.toLowerCase()){var r=c(t.element,"type");"checkbox"!==r&&-1===m.indexOf(r)&&n.push("Unsupported input type: "+r)}}else n.push("Could not find element");v[t.functionName]||n.push("Could not find function with name: "+t.functionName),n.length?i=i.concat(n):a.push(e)}),i.length&&t(i.join("\r\n")),a}function S(e,t,n){var r=C(e),a=(0,v[r.functionName])(r.element,t,n);a?s(e,"ulp-validator-error")&&(d(e,"ulp-validator-error"),u(e,"data-is-error")):s(e,"ulp-validator-error")||(f(e,"ulp-validator-error"),l(e,"data-is-error",!0));var i=o(r.parent,".ulp-validator-error");return p(r.parent,"ulp-error",!!i.length),a}function T(t){var n=C(t),e=(c(t,"data-ulp-validation-event-listeners")||"").replace(/\s/g,"").split(",").filter(function(e){return!!e});e.length&&e.forEach(function(e){r(n.element,e,function(){S(t,_,e)})})}function L(e){e.forEach(function(e){var t=e.id,n=c(e,"data-ulp-validation-target"),r=i('[id="'+n+'"]');if(r){var a=c(r,"aria-describedby");a&&-1!==a.indexOf(t)||l(r,"aria-describedby",a?a+" "+t:t),l(r,"aria-invalid","true")}})}function F(e,t){var n=i("#ulp-error-announcer");if(n){n.textContent="";var r=[];if(e.forEach(function(e){var t=e.textContent;t&&t.trim()&&r.push(t.trim())}),t){var a=function(){var e=i(".ca7221dd0.cef456bac");if(!e)return[];var a=[],t=i(e,".c18295842");t&&t.textContent&&t.textContent.trim()&&a.push(t.textContent.trim());var n=o(e,"li.c29f6f23e");return n&&n.length&&n.forEach(function(e){var t="";if(s(e,"c5852e8f4")){var n=i(e,".c7124d53a");n&&(t=n.textContent)}else if(s(e,"cbe90896e")){var r=i(e,".cce4579b1");r&&(t=r.textContent)}t&&t.trim()&&a.push(t.trim())}),a}();a.length&&(r=r.concat(a))}r.length&&v.setTimeout(function(){n.textContent=r.map(function(e){return e.replace(/\.+$/,"")}).join(". ")},E)}}function k(e,t,n){_=!0;var r=n.filter(function(e){return!S(e,_,"submit")});if(y.disable_ulp_form_submission_fix){if(!r.length)return t.submitter&&"default"==c(t.submitter,"value")&&l(t.submitter,"disabled",!0),void e.submit();h(t),L(r),F(r,!1);var a=C(r[0]);return a.element.focus({preventScroll:!0}),void a.parent.scrollIntoView({behavior:"smooth"})}var i=w&&w("invalidPasswordPolicy"),o=w&&w("invalidCaptcha");if(!r.length&&!i&&!o)return t.submitter&&"default"==c(t.submitter,"value")&&l(t.submitter,"disabled",!0),void e.submit();if(h(t),L(r),F(r,!!i),r.length){var u=C(r[0]);u.element.focus({preventScroll:!0}),u.parent.scrollIntoView({behavior:"smooth"})}}function P(){var t=i('form[data-form-primary="true"]'),n=A(t);0!==n.length&&(n.forEach(function(e){T(e)}),r(t,"submit",function(e){k(t,e,n)}))}function R(){var n=i('form[data-form-primary="true"]'),e=o('form[data-form-secondary="true"]');n&&e.length&&e.forEach(function(t){r(t,"submit",function(){var e=g(n);e.length&&b(t,e)})})}function N(){if(n)for(var e in n)n.hasOwnProperty(e)&&(v[e]=n[e])}function q(){var e=i("form[data-disable-html-validations]");e&&(N(),l(e,"novalidate",""),P(),y.custom_prompts_passkeys&&R())}},a.exports)(l.querySelector,l.querySelectorAll,l.addEventListener,l.getParent,l.getAttribute,l.setAttribute,l.removeAttribute,l.hasClass,l.addClass,l.removeClass,l.toggleClass,l.globalWindow,l.consoleWarn,l.preventFormSubmit,l.SUPPORTED_INPUT_TYPES,l.ELEMENT_TYPE_SELECTOR,s,l.getUlpFields,l.appendUlpFieldsToForm,c,l.getGlobalFlag),{exports:function(r,o,a,i,u,c,l,t,s,f,e,n){if(!n.enable_ulp_wcag_compliance){var d=!1,p=e+',input[type="checkbox"]';return w(),[p,v,h,m,g,b,y,w]}function v(e){var t=u(e,"data-ulp-validation-function"),n=i(e);return{functionName:t,element:r(n,p),parent:n}}function h(e){var a=[],i=[];return o(e,"[data-ulp-validation-function]").forEach(function(e){var t=v(e),n=[];if(t.element){if("input"===t.element.tagName.toLowerCase()){var r=u(t.element,"type");"checkbox"!==r&&-1===f.indexOf(r)&&n.push("Unsupported input type: "+r)}}else n.push("Could not find element");l[t.functionName]||n.push("Could not find function with name: "+t.functionName),n.length?i=i.concat(n):a.push(e)}),i.length&&t(i.join("\r\n")),a}function m(e,t,n){var r=v(e),a=(0,l[r.functionName])(r.element,t,n);c(e,"ulp-validator-error",!a);var i=o(r.parent,".ulp-validator-error");return c(r.parent,"ulp-error",!!i.length),a}function g(t){var n=v(t),e=(u(t,"data-ulp-validation-event-listeners")||"").replace(/\s/g,"").split(",").filter(function(e){return!!e});e.length&&e.forEach(function(e){a(n.element,e,function(){m(t,d,e)})})}function b(e,t,n){d=!0;var r=n.filter(function(e){return!m(e,d,"submit")});if(r.length){s(t);var a=v(r[0]);a.element.focus({preventScroll:!0}),a.parent.scrollIntoView({behavior:"smooth"})}else e.submit()}function y(){var t=r('form[data-form-primary="true"]'),n=h(t);0!==n.length&&(n.forEach(function(e){g(e)}),a(t,"submit",function(e){b(t,e,n)}))}function w(){var e=o("[id^='ulp-container-']");e&&e.length&&y()}}}.exports(l.querySelector,l.querySelectorAll,l.addEventListener,l.getParent,l.getAttribute,l.toggleClass,l.globalWindow,l.consoleWarn,l.preventFormSubmit,l.SUPPORTED_INPUT_TYPES,l.ELEMENT_TYPE_SELECTOR,c),{exports:function(e,t,n){function r(n){t(n,"click",function(e){e.preventDefault();var t=document.createElement("input");t.name="action",t.type="hidden",t.value=n.value,n.form.appendChild(t),n.form.submit(),n.form.removeChild(t)})}function a(){e('form button[type="submit"][formnovalidate], form input[type="submit"][formnovalidate]').forEach(function(e){r(e)})}return n&&a(),[a,r]}}.exports(l.querySelectorAll,l.addEventListener,l.RUN_INIT),((i={}).exports=function(o,e,u,c,l,s,t,f,n){if(n.enable_ulp_wcag_compliance){var r=e('[class*="aria-error-check"]');if(r&&r.length){var a=t(function(e){e&&e.length&&e.map(function(e){if(e.target&&u(e.target,"aria-error-check")){var t=o('[id="'+c(e.target,"data-ulp-validation-target")+'"');if(t){var n=c(t,"aria-describedby");c(e.target,"data-is-error")?(r=t,a=n,i=e.target.id,a&&-1!==a.search(i)||l(r,"aria-describedby",a?a+" "+i:i),l(r,"aria-invalid",!0)):function(e,t,n){if(t){var r=f(t,n);r.length?l(e,"aria-describedby",r):(s(e,"aria-invalid"),s(e,"aria-describedby"))}else s(e,"aria-invalid"),s(e,"aria-describedby")}(t,n,e.target.id)}}var r,a,i})});a&&r.map(function(e){a.observe(e,{attributes:!0,attributeFilter:["class","data-is-error"]})})}}},i.exports)(l.querySelector,l.querySelectorAll,l.hasClass,l.getAttribute,l.setAttribute,l.removeAttribute,l.createMutationObserver,l.removeAndTrimString,c),(u="https://accounts.google.com/gsi/client",(o={}).exports=function(t,n,c,e){var r=e("#one-tap-config-json");if(r&&r.clientId){var a=0;!function e(){t(u,{async:!0,defer:!0,onload:function(){!function(){var e=window.google;if(e&&e.accounts&&e.accounts.id){var t={client_id:r.clientId,callback:i,auto_select:!!r.autoSelect,nonce:r.nonce,cancel_on_tap_outside:!!r.cancelOnTapOutside,itp_support:!!r.itpSupport};r.context&&(t.context=r.context),e.accounts.id.initialize(t),e.accounts.id.prompt()}}()},onerror:function(){n(u),a<2&&(a++,e())}})}()}function i(e){if(e&&e.credential){var t,n=document.createElement("form");n.method="POST",n.action=(t=c('form[data-form-primary="true"]'))&&t.getAttribute("action")?t.getAttribute("action"):window.location.pathname,n.style.display="none";var r=document.createElement("input");r.type="hidden",r.name="action",r.value="google-one-tap",n.appendChild(r);var a=document.createElement("input");a.type="hidden",a.name="one_tap_credential",a.value=e.credential,n.appendChild(a);var i=c('form[data-form-primary="true"]'),o=i?c(i,'input[name="state"]'):null;if(o){var u=document.createElement("input");u.type="hidden",u.name="state",u.value=o.value,n.appendChild(u),document.body.appendChild(n),n.submit()}}}},o.exports)(l.loadScript,l.removeScript,l.querySelector,l.getConfigJson),function(){var e={},p=['input[type="text"]','input[type="email"]','input[type="tel"]','input[type="number"]','input[type="url"]','input[type="password"]',"input:not([type])"].join(", "),v=['input:not([type="hidden"]):not([aria-hidden="true"]):not([disabled])','select:not([aria-hidden="true"]):not([disabled])','textarea:not([aria-hidden="true"]):not([disabled])','button:not([aria-hidden="true"]):not([disabled])'].join(", ");function h(e){var t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility}return e.exports=function(t,e,n,r){if(e.enable_ulp_wcag_compliance&&!t("#prompt-alert")){var a=r("(pointer: coarse), (pointer: fine), (pointer: none)"),i=r("(hover: hover), (hover: none)");if(a&&i&&(r("(pointer: coarse)")||!r("(hover: hover)")))return;var o=t(".c5431f316");if(o){for(var u=n(o.querySelectorAll(v)),c=null,l=0;l<u.length;l++)if(h(u[l])){c=u[l];break}if(c){for(var s=n(o.querySelectorAll(p)),f=null,d=0;d<s.length;d++)if(h(s[d])){f=s[d];break}setTimeout(function(){if(f&&f===c)f.focus();else{var e=t("#screen-header");e&&e.focus()}},250)}}}},e.exports}()(l.querySelector,c,l.arrayFrom,l.matchMedia)}();
</script>

  </body>

  <script>
    let env;
    let isDev = false;
    let isStaging = false;
    let isProd = false;
    let isSandbox = false;

    function getCurrentEnv() {
      const currentUrl = window.location.href;
      const envMapping = {
        dev2: "dev",
        staging2: "staging",
        sandbox: "sandbox"
      };

      for (const [key, value] of Object.entries(envMapping)) {
        if (currentUrl.includes(key)) {
          env = value;
          if (value === "dev") {
            isDev = true;
          } else if (value === "staging") {
            isStaging = true;
          } else if (value === "sandbox") {
            isSandbox = true;
          }
          return;
        }
      }

      env = "prod";
      isProd = true;
    }

    getCurrentEnv();

    const pageData = document.querySelector("body").dataset;
    const cobrandHideRegistration = pageData.cobrandHideRegistration || "true";
    const cobrandToken = pageData.token;
    const cobrandWhiteHeader = pageData.cobrandWhiteHeader ?? "true";
    const showBranding = pageData.showBranding || "false";

    if (cobrandHideRegistration.toLowerCase() == "true") {
      // Remove sign up
      const prompId = pageData.prompId ?? "";
      if (
        prompId == "login-password" ||
        prompId == "login" ||
        prompId == "login-id"
      ) {
        var elementsToRemove = document.querySelectorAll(
          ".ulp-alternate-action"
        );
        elementsToRemove.forEach(function (element) {
          element.remove();
        });
      }
    } else {
      // replace reset password link
      const elements = document.querySelectorAll('a[href*="signup"]');
      elements.forEach(function (element) {
        let registerLink;
        if (window.location.href.includes("accounts.")) {
          registerLink = `${location.origin.replace("accounts.", "")}/accounts/account/register?cobrand=${cobrandToken}`;
        } else {
          registerLink = `${location.origin.replace("auth0.", "")}/accounts/account/register?cobrand=${cobrandToken}`;
        }
        element.setAttribute("href", registerLink);
      });
    }

    // replace reset password link
    const elements = document.querySelectorAll('a[href*="password"]');
    elements.forEach(function (element) {
      let baseUrl;
      if (window.location.href.includes("accounts.")) {
        baseUrl = `${location.origin.replace("accounts.", "portal.")}/account/resetPassword?cobrand=${cobrandToken}&cobrandWhiteHeader=${cobrandWhiteHeader}`;
      } else {
        baseUrl = `${location.origin.replace("auth0", "portal")}/account/resetPassword?cobrand=${cobrandToken}&cobrandWhiteHeader=${cobrandWhiteHeader}`;
      }
      const emailSelectors = document.getElementsByClassName(
        "ulp-authenticator-selector-text"
      );
      const email =
        emailSelectors.length > 0 ? emailSelectors[0].textContent : "";
      element.setAttribute("href", `${baseUrl}&email=${email}`);
    });

    // display cobrand logo
    const logoContainer = document.getElementById("custom-prompt-logo");

    //for MYP-1983, need to copy following
    //seven lines deploying to other tenants
    //commented out MYP-1983 for MYP-1991
    //if (logoContainer) {
    //    logoContainer.addEventListener("click", () => {
    //        window.location.href = "https://www.myprosperity.com.au/";
    //    });

    //    logoContainer.style.cursor = "pointer";
    //}

    // set logo background color
    const isBlackHeader = cobrandWhiteHeader.toLowerCase() == "false";

    //for ticket MYP-1707, follwoing 6 lines and line 75 and 100
    const hashParams = new URLSearchParams(window.location.hash.slice(1));
    const cobrandFromURL = hashParams.get("ext-cobrand");
    const cobrandWhiteHeaderFromURL = hashParams.get(
      "ext-cobrand-white-header"
    );
    const isBlackHeaderFromURL =
      cobrandWhiteHeaderFromURL?.toLowerCase() == "false";

    const existingCobrand = cobrandToken || cobrandFromURL;
    const existingBlackHeader = isBlackHeader || isBlackHeaderFromURL;

    if (existingBlackHeader) {
      logoContainer.style.backgroundColor = "black";
      logoContainer.style.borderRadius = "4px";
    }

    function getMpImageCdnPath() {
      if (isDev) {
        return "d1988xjrdouta0.cloudfront.net";
      } else if (isStaging) {
        return "d3er37fstbzjwi.cloudfront.net";
      } else if (isSandbox) {
        return "d3qi717l0xkktx.cloudfront.net";
      } else {
        return "djkrz9vtm0lx7.cloudfront.net";
      }
    }

    function getCobrandImageCdnPath() {
      if (isDev) {
        return "d3ksphyrj19ids.cloudfront.net";
      } else if (isStaging) {
        return "d3ogppd879e4t8.cloudfront.net";
      } else if (isSandbox) {
        return "d2pyp7ncidpyfs.cloudfront.net";
      } else {
        return "d1x5wjo3pa9mx6.cloudfront.net";
      }
    }

    function handleImageError() {
      const cdnPath = getMpImageCdnPath();
      var defaultImageURL = existingBlackHeader
        ? `https://${cdnPath}/images/full_logo_header_dark.png`
        : `https://${cdnPath}/images/full_logo_header.png`;

      if (
        defaultImageURL ===
          "https://d1x5wjo3pa9mx6.cloudfront.net/header/mp.png" ||
        defaultImageURL ===
          "https://djkrz9vtm0lx7.cloudfront.net/images/full_logo_header.png"
      ) {
        img.src =
          "https://d3er37fstbzjwi.cloudfront.net/images/full_logo_header_dark.png";
        logoContainer.style.backgroundColor = "black";
        logoContainer.style.borderRadius = "4px";
      }

      logoContainer.style.backgroundImage = 'url("' + defaultImageURL + '")';
    }

    // if showBranding is false, hide the logo container for debranding
    if (showBranding === "false") {
      logoContainer.style.display = "none";
    }
    // if showBranding is true, use the cobrand logo from the CDN
    else {
      var img = new Image();
      img.src = `https://${getCobrandImageCdnPath()}/header/${existingCobrand}.png`; // Replace with the actual path to your logo

      if (img.src === "https://d1x5wjo3pa9mx6.cloudfront.net/header/mp.png") {
        img.src =
          "https://d3er37fstbzjwi.cloudfront.net/images/full_logo_header_dark.png";
        logoContainer.style.backgroundColor = "black";
        logoContainer.style.borderRadius = "4px";
      }

      img.onload = function () {
        logoContainer.style.backgroundImage = 'url("' + img.src + '")';
      };

      img.onerror = handleImageError;
    }

    function getLoginLink() {
      if (isDev) {
        return "https://dev2.myprosperity.com.au/Accounts/SignIn/SignIn";
      } else if (isStaging) {
        return "https://staging2.myprosperity.com.au/Accounts/SignIn/SignIn";
      } else if (isSandbox) {
        return "https://sandbox.myprosperity.com.au/Accounts/SignIn/SignIn";
      } else {
        return "https://myprosperity.com.au/Accounts/SignIn/SignIn";
      }
    }

    // handle token expiry alert
    let showAlert = false;
    const FIVE_MINUTES = 300000;
    const startTime = Date.now();

    function handleExpiration() {
      if (!alert("Token expired, please refresh the page")) {
        window.location.href = getLoginLink(); //redirect to login page
      }
    }

    function isMobileBrowser() {
      const userAgent = navigator.userAgent || navigator.vendor || window.opera;

      return /android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(
        userAgent
      );
    }

    if (!isMobileBrowser()) {
      // Set an interval to check the elapsed time every second (1000ms)
      const checkInterval = setInterval(() => {
        const currentTime = Date.now();

        // Check if 5 minutes (300000ms) have elapsed since the page load
        if (
          startTime &&
          currentTime - startTime >= FIVE_MINUTES &&
          !showAlert
        ) {
          showAlert = true;
          handleExpiration();
          clearInterval(checkInterval); // Stop the interval once the expiration is handled
        }
      }, 1000); // Run every 1 second

      // Handle page unload to clean up any resources (optional)
      window.onbeforeunload = function () {
        clearInterval(checkInterval); // Clear the interval when the user leaves the page
      };
    }

    function getCookieName(name) {
      if (isDev) {
        return `MpDev_${name}`;
      } else if (isStaging) {
        return `MpStaging_${name}`;
      } else if (isSandbox) {
        return `MpDev_${name}`;
      } else {
        return `MpProd_${name}`;
      }
    }

    function getCookieDomain() {
      if (isDev) {
        return ".dev2.myprosperity.com.au";
      } else if (isStaging) {
        return ".staging.myprosperity.com.au";
      } else if (isSandbox) {
        return ".sandbox.myprosperity.com.au";
      } else {
        return ".myprosperity.com.au";
      }
    }

    //for issue MYP-1650, following 28 lines
    //need to change MpDev_ and dev2 for other env
    function getCookie(name) {
      const value = `; ${document.cookie}`;
      const parts = value.split(`; ${name}=`);
      if (parts.length === 2) return parts.pop().split(";").shift();
    }
    //set localStorage from BE email link
    const emailFromResetPassword = hashParams.get("ext-email");
    if (emailFromResetPassword) {
      localStorage.setItem("resetPasswordEmail", emailFromResetPassword);
    }
    //get email input box
    const usernameInput = document.querySelector(
      'input[name="username"][id="username"]'
    );
    if (usernameInput) {
      const emailForResetPassword = localStorage.getItem("resetPasswordEmail");
      //cookie name for dev
      const emailForActivateAccount = getCookie(
        getCookieName("ext-activate-account-email")
      );
      if (emailForResetPassword) {
        usernameInput.value = decodeURIComponent(emailForResetPassword);
        localStorage.removeItem("resetPasswordEmail");
      }
      if (emailForActivateAccount) {
        usernameInput.value = decodeURIComponent(emailForActivateAccount);
        //cookie domain for dev2
        document.cookie = `${getCookieName("ext-activate-account-email")}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${getCookieDomain()}`;
      }
    }

    //for issue MYP-1837
    const callbackErrorDescription = getCookie(
      getCookieName("callback-error-description")
    );
    const callbackError = getCookie(getCookieName("callback-error"));
    if (
      callbackErrorDescription === "non-registered" &&
      callbackError === "access_denied"
    ) {
      if (!alert("Your account does not exist")) {
        document.cookie = `${getCookieName("callback-error-description")}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${getCookieDomain()}`;
        document.cookie = `${getCookieName("callback-error")}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${getCookieDomain()}`;
      }
    }

    //for issue MYP-2094
    function setFavicon() {
      const defaultFavicon =
        "https://portal.dev2.myprosperity.com.au/favicon.ico";
      const favicon =
        document.querySelector("link[rel='icon']") ||
        document.createElement("link");
      favicon.rel = "icon";

      // If showBranding is false, use default favicon only
      if (showBranding === "false") {
        favicon.href = defaultFavicon;
        document.head.appendChild(favicon);
        return;
      }

      // If showBranding is not false, try cobrand favicon with fallback to default
      const primaryFavicon = `https://${getCobrandImageCdnPath()}/bookmark/${existingCobrand}.png`;
      const testImage = new Image();

      testImage.onload = function () {
        favicon.href = primaryFavicon;
        document.head.appendChild(favicon);
      };

      testImage.onerror = function () {
        favicon.href = defaultFavicon;
        document.head.appendChild(favicon);
      };

      testImage.src = primaryFavicon;
    }
    window.addEventListener("load", setFavicon);

    //for issue SP-3196
    document.addEventListener("DOMContentLoaded", function () {
      const alertTrigger = document.getElementById("alert-trigger");
      if (alertTrigger) {
        alertTrigger.style.display = "none";
      }
    });

    //for issue 2273
    const section = document.querySelector("section");
    const sectionDiv = section.querySelector("div");

    if (sectionDiv) {
      // Create a single container for both text and image
      const footerDiv = document.createElement("div");
      footerDiv.style.width = "100%";
      footerDiv.style.display = "flex";
      footerDiv.style.justifyContent = "center";
      footerDiv.style.alignItems = "center";
      footerDiv.style.paddingBottom = "20px";
      footerDiv.style.gap = "4px";

      // Add the "powered by" text
      const footerDivText = document.createElement("span");
      footerDivText.textContent = "Powered by:";
      footerDivText.style.color = "#D3D3D3";
      footerDivText.style.fontSize = "12px";

      // Add the logo image
      const poweredByImage = document.createElement("img");
      poweredByImage.src =
        "https://s3.ap-southeast-2.amazonaws.com/myprosperity.auprod.tardis/header/poweredbymyprosperity_gray.png";
      poweredByImage.alt = "Logo";
      poweredByImage.style.maxWidth = "130px";
      poweredByImage.style.height = "16px";

      // Add text and image to the container
      footerDiv.appendChild(footerDivText);
      footerDiv.appendChild(poweredByImage);

      // Add the container to the page
      sectionDiv.appendChild(footerDiv);
    }

    //for issue 1341
    function setLoginPageUrl() {
      const currentUrl = window.location.href;

      if (currentUrl.includes("u/login/identifier")) {
        const accountPage = localStorage.getItem("Account_Page");
        localStorage.setItem("Account_Page", currentUrl);
      }
    }
    setLoginPageUrl();

    function checkLoginPageUrlExist() {
      const accountPage = localStorage.getItem("Account_Page");
      if (accountPage) {
        return true;
      }
      return false;
    }

    function clearAllCookies() {
      const cookies = document.cookie.split(";");
      cookies.forEach((cookie) => {
        const cookieName = cookie.split("=")[0].trim();
        document.cookie =
          cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
      });
    }

    function checkButtonExists() {
      const buttonElements = document.getElementsByTagName("button");
      for (let i = 0; i < buttonElements.length; i++) {
        if (buttonElements[i].textContent.trim() === "Try another method") {
          const newButton = document.createElement("button");
          newButton.textContent = "Use other account";
          newButton.type = "button";
          newButton.className = buttonElements[i].className;
          newButton.style.marginTop = "10px";
          newButton.style.display = "block";
          newButton.style.marginLeft = "auto";
          newButton.style.marginRight = "auto";

          if (checkLoginPageUrlExist()) {
            newButton.addEventListener("click", () => {
              clearAllCookies();
              window.location.href = localStorage.getItem("Account_Page");
            });

            // add new button
            buttonElements[i].insertAdjacentElement("afterend", newButton);
          }
        }
      }
    }
    checkButtonExists();

    ///for remove the 3 rules in reset password page
    const observer = new MutationObserver((mutations) => {
      mutations.forEach((mutation) => {
        if (mutation.type === "childList") {
          const spans = document.querySelectorAll("span");
          spans.forEach((span) => {
            if (span.textContent.includes("At least 3 of the following:")) {
              span.remove();
            }
          });
        }
      });
    });

    observer.observe(document.body, {
      childList: true,
      subtree: true
    });

    //change mp-app-prod to myprosperity
    function replaceTextInPage() {
      const textNodes = document.createTreeWalker(
        document.body,
        NodeFilter.SHOW_TEXT
      );

      let currentNode;
      while ((currentNode = textNodes.nextNode())) {
        if (currentNode.nodeValue.includes("mp-app-prod")) {
          currentNode.nodeValue = currentNode.nodeValue.replace(
            /mp-app-prod/g,
            "myprosperity"
          );
        }
      }
    }

    replaceTextInPage();

    //for issue MYP-1974
    //need to check class name when deploying other tenant
    //also need to update custom text when deploying other tenant
    document.addEventListener("DOMContentLoaded", function () {
      // if the logo container exists, target its parent
      if (
        logoContainer &&
        logoContainer.parentElement &&
        showBranding === "false"
      ) {
        // Set padding-top to 0
        logoContainer.parentElement.style.paddingTop = "0";
      }

      var auth0Form = document.querySelector("form");

      var errorMessage =
        document.querySelector("#prompt-alert") ||
        document.querySelector(".ulp-input-error-message");
      if (errorMessage) {
        var errorText = errorMessage.textContent.trim();
        errorMessage.style.display = "none";
        if (errorText === "Incorrect email address, username, or password") {
          const message = "Incorrect email address or password";
          showInlineErrorMessage(message);
        } else if (
          errorText ===
          "Your account has been blocked after multiple consecutive login attempts"
        ) {
          const message =
            "Account has been locked. Reset your password or contact support.";
          showInlineErrorMessage(message);
        } else {
            showInlineErrorMessage(errorText);
        }
      }

      function showInlineErrorMessage(message) {
        var passwordField = document.querySelector(".input-wrapper");
        if (passwordField) {
          var passwordInput = document.querySelector(".password");
          //update red border color
          passwordInput.classList.add(
            "c2a146493",
            "caf438645",
            "password",
            "caef406c0",
            "cbcdb6b10",
            "cf9e9efc8",
            "c88a45da2",
            "c4219d28d"
          );

          var passwordText = passwordField.querySelector(".js-required");
          //update red password text
          passwordText.style.color = "#d03c38";

          var errorElement = document.createElement("span");
          errorElement.className = "ulp-input-error-message";

          //create red exclamation mark
          var iconElement = document.createElement("span");
          iconElement.className = "ulp-input-error-icon";
          iconElement.setAttribute("role", "img");
          errorElement.appendChild(iconElement);

          //create red prompt message
          var errorText = document.createTextNode(message);
          errorElement.appendChild(errorText);

          passwordField.parentNode.appendChild(errorElement);
        }
      }

      //for issue reset password requirement
      const inputElement = document.getElementById("password-reset");
      const passwordRegex =
        /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!"#$%&'()*+,\-./:;<=>?@\[\\\]^_`{|}~])[\x21-\x7E]{12,}$/;

      // Function to check if character is within ASCII 33-126 range
      function isValidAsciiChar(char) {
        const charCode = char.charCodeAt(0);
        return charCode >= 33 && charCode <= 126;
      }

      // Function to check for invalid characters and show error message
      function checkForInvalidChars(inputValue) {
        const invalidChars = inputValue
          .split("")
          .filter((char) => !isValidAsciiChar(char));

        if (invalidChars.length > 0) {
          showAsciiError(invalidChars);
          return false;
        } else {
          hideAsciiError();
          return true;
        }
      }

      // Function to create ASCII error message div (always present, just hidden/shown)
      function createAsciiErrorDiv() {
        // Check if error div already exists
        let existingError = document.querySelector(".ascii-error");
        if (existingError) {
          return existingError;
        }

        // Find the reset password button
        const buttons = document.querySelectorAll("button");
        const resetButton = Array.from(buttons).find(
          (button) => button.textContent.trim() === "Reset password"
        );

        if (resetButton) {
          // Create error message div
          const errorDiv = document.createElement("div");
          errorDiv.className = "ascii-error";
          errorDiv.style.color = "#d03c38";
          errorDiv.style.fontSize = "12px";
          errorDiv.style.marginTop = "8px";
          errorDiv.style.textAlign = "center";
          errorDiv.style.fontWeight = "normal";
          errorDiv.style.visibility = "hidden";
          errorDiv.style.height = "auto";

          // Insert error after reset button
          resetButton.parentNode.insertBefore(
            errorDiv,
            resetButton.nextSibling
          );

          return errorDiv;
        }
        return null;
      }

      // Function to show ASCII error message with specific characters
      function showAsciiError(invalidChars) {
        const errorDiv = createAsciiErrorDiv();

        if (errorDiv && invalidChars.length > 0) {
          // Format the error message with specific characters
          const uniqueInvalidChars = [...new Set(invalidChars)]; // Remove duplicates
          let charDisplay = uniqueInvalidChars
            .map((char) => {
              // Handle special characters for display
              if (char === " ") return "space";
              if (char === "\t") return "tab";
              if (char === "\n") return "newline";
              if (char === "\r") return "carriage return";
              return `'${char}'`;
            })
            .join(", ");

          errorDiv.textContent = `Character ${charDisplay} is not allowed.`;
          errorDiv.style.visibility = "visible"; // Show the error
        }
      }

      // Function to hide ASCII error message (don't remove, just hide)
      function hideAsciiError() {
        const errorDiv = createAsciiErrorDiv();
        if (errorDiv) {
          errorDiv.style.visibility = "hidden"; // Hide the error
        }
      }

      if (inputElement) {
        // Create the error div immediately when page loads
        createAsciiErrorDiv();

        const overlay = document.createElement("div");
        overlay.style.position = "absolute";
        overlay.style.top = 0;
        overlay.style.left = 0;
        overlay.style.width = "100%";
        overlay.style.height = "100%";
        overlay.style.backgroundColor = "rgba(255, 255, 255, 0.7)";
        overlay.style.pointerEvents = "none";
        overlay.style.zIndex = "1";

        const buttons = document.querySelectorAll("button");

        const targetButton = Array.from(buttons).find(
          (button) => button.textContent.trim() === "Reset password"
        );

        if (targetButton) {
          targetButton.disabled = true;
          targetButton.style.position = "relative";
          targetButton.appendChild(overlay);
        }

        inputElement.addEventListener("input", () => {
          const hasValidPassword = passwordRegex.test(inputElement.value);
          const hasValidAscii = checkForInvalidChars(inputElement.value);

          // Enable button only if password meets regex AND has valid ASCII characters
          if (hasValidPassword && hasValidAscii) {
            targetButton.disabled = false;
            if (overlay.parentNode) {
              overlay.parentNode.removeChild(overlay);
            }
          } else {
            targetButton.disabled = true;
            targetButton.style.position = "relative";
            targetButton.appendChild(overlay);
          }
        });
      }

      //MYP-2776
      function replaceUsernameOrEmailText() {
        const elements = document.querySelectorAll("*");
        elements.forEach((element) => {
          element.childNodes.forEach((node) => {
            if (node.nodeType === Node.TEXT_NODE) {
              const text = node.nodeValue.trim();
              if (text.includes("Username or")) {
                node.nodeValue = "Email Address ";
              }
            }
          });
        });
      }
      window.addEventListener("load", replaceUsernameOrEmailText);

      //MPLAN-1710 Renmoving Asterisk
      function removeAsterisks() {
        // find all spans inside labels with class 'required'
        document.querySelectorAll('label .required').forEach(span => span.remove());
      }
      window.addEventListener("load", removeAsterisks);

    // Add Pre/Post-Release Message ===> Temporary code for pre-release and post-release messages
      function addReleaseMessage(messageType = null) {
        const headerElements = document.querySelectorAll('p');
        const loginElement = Array.from(headerElements).find(el => el.textContent.includes("Log in to"));

        if (loginElement) {
          var infoBox = document.createElement("div");

          var releaseMessage = 
            messageType == 'pre-release' ? 
              `<p style="font-weight: 400;">
                Soon, you'll notice a simplified login page. Your firm's branding will show after you log in.
              </p>` 
            : messageType == 'post-release' ? 
              `<p style="font-weight: 700;">
                Notice something different?
              </p>
              <p style="font-weight: 400;">
                We've simplified the login page.
              </p>
              <p style="font-weight: 400;">
                Your firm's branding will show after you log in.
              </p>` 
            : messageType == 'issue' ?
              `<p style="font-weight: 400;">
                 We are aware of an ongoing issue with SMS delivery through our third party provider, AWS. In the mean time please use other means of MFA associated with your account.
               </p>`
            : messageType == 'docSigningIssue' ? 
              `<p style="font-weight: 400;">
                 A vendor-related issue is currently affecting document signing. We're working closely with the vendor to resolve this as quickly as possible. Thank you for your patience.
              </p>`
            : messageType == 'unavailable' ? 
              `<p style="font-weight: 400;">
                 Our portal will be temporarily unavailable on <b>Thursday, May 28th at 7 pm</b> for scheduled maintenance. We apologise for any inconvenience.
              </p>`
            : ``;

          if(releaseMessage) {
            infoBox.innerHTML = `
            <div style="display: flex; border-radius: 5px; border: 1px solid #005AD6; border-left-width: 5px; background: #FFFFFF; padding: 12px 10px 12px 5px; margin-top: 24px;">
              <div style="display: flex; padding-right: 15px; align-items: center; gap: 8px;">
                <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
                  <g clip-path="url(#clip0_25306_101471)">
                    <path d="M11.0049 1.71875C16.1019 1.71875 20.2861 5.84697 20.2861 11C20.2861 16.1258 16.1349 20.2812 11.0049 20.2812C5.88112 20.2812 1.72363 16.1321 1.72363 11C1.72363 5.878 5.8745 1.71875 11.0049 1.71875ZM11.0049 0.34375C5.12001 0.34375 0.348633 5.11685 0.348633 11C0.348633 16.8866 5.12001 21.6562 11.0049 21.6562C16.8898 21.6562 21.6611 16.8866 21.6611 11C21.6611 5.11685 16.8898 0.34375 11.0049 0.34375ZM9.45801 15.125H9.97363V9.96875H9.45801C9.17325 9.96875 8.94238 9.73788 8.94238 9.45312V9.10938C8.94238 8.82462 9.17325 8.59375 9.45801 8.59375H11.5205C11.8053 8.59375 12.0361 8.82462 12.0361 9.10938V15.125H12.5518C12.8365 15.125 13.0674 15.3559 13.0674 15.6406V15.9844C13.0674 16.2691 12.8365 16.5 12.5518 16.5H9.45801C9.17325 16.5 8.94238 16.2691 8.94238 15.9844V15.6406C8.94238 15.3559 9.17325 15.125 9.45801 15.125ZM11.0049 4.8125C10.2455 4.8125 9.62988 5.42811 9.62988 6.1875C9.62988 6.94689 10.2455 7.5625 11.0049 7.5625C11.7643 7.5625 12.3799 6.94689 12.3799 6.1875C12.3799 5.42811 11.7643 4.8125 11.0049 4.8125Z" fill="#005AD6"/>
                  </g>
                  <defs>
                    <clipPath id="clip0_25306_101471">
                      <rect width="22" height="22" fill="white" transform="translate(0.00488281)"/>
                    </clipPath>
                  </defs>
                </svg>
              </div>
              <div style="display: flex; flex-direction: column; text-align: start; font-size: 14px; font-style: normal; line-height: 150%; letter-spacing: 0.024px; text-align: justify;">
                ${releaseMessage}
              </div>
            </div>
          `;
          loginElement.insertAdjacentElement("afterend", infoBox);
          }
        }
      }
      window.addEventListener("load", addReleaseMessage(null)); // can be commented out or pass `null` when displaying the message is not required
    });
  </script>
</html>
