{
  "version": 3,
  "sources": ["/cdn/shop/t/1380/assets/customer-password.js?inputName=customer%5Bpassword%5D"],
  "sourcesContent": ["(() => {\n  // Get the target input name for this script's component.\n  const scriptUrl = new URL(document.currentScript.src);\n  const inputName = scriptUrl.searchParams.get('inputName');\n\n  const passwordInput = document.querySelector(\n    `.customer-password [name=\"${inputName}\"]`,\n  );\n\n  if (!passwordInput) {\n    return;\n  }\n\n  // Toggle the password's text visibility.\n  const togglePasswordButton = document.querySelector(\n    '.customer-password .toggle-password',\n  );\n  if (togglePasswordButton) {\n    togglePasswordButton.addEventListener('click', (event) => {\n      event.preventDefault();\n      const { passwordVisible } = event.target.dataset;\n\n      if (passwordVisible === 'false') {\n        event.target.setAttribute('data-password-visible', true);\n        passwordInput.type = 'text';\n        return;\n      }\n\n      event.target.setAttribute('data-password-visible', false);\n      passwordInput.type = 'password';\n    });\n  }\n\n  // Validate the password input value as its entered.\n  const validator = passwordInput\n    .closest('.customer-password')\n    .querySelector('.customer-password__validator');\n\n  if (!validator) {\n    return;\n  }\n\n  const requirements = {\n    length: false,\n    number: false,\n    lowercase: false,\n    uppercase: false,\n  };\n\n  const updateVisualFeedback = (state) => {\n    Object.keys(state).forEach((requirement) => {\n      const requirementListItem = validator.querySelector(\n        `[data-requirement=\"${requirement}\"]`,\n      );\n      if (!requirementListItem) {\n        return;\n      }\n      requirementListItem.setAttribute('data-satisfied', state[requirement]);\n    });\n  };\n\n  passwordInput.addEventListener('keyup', (event) => {\n    const password = event.target.value;\n    // Update requirements as they're satisfied.\n    requirements.length = password.length >= 8;\n    requirements.number = /[0-9]/.test(password);\n    requirements.lowercase = /[a-z]/.test(password);\n    requirements.uppercase = /[A-Z]/.test(password);\n\n    updateVisualFeedback(requirements);\n  });\n})();\n"],
  "mappings": "CAAC,IAAM,CAGL,MAAM,UADY,IAAI,IAAI,SAAS,cAAc,GAAG,EACxB,aAAa,IAAI,WAAW,EAElD,cAAgB,SAAS,cAC7B,6BAA6B,SAAS,IACxC,EAEA,GAAI,CAAC,cACH,OAIF,MAAM,qBAAuB,SAAS,cACpC,qCACF,EACI,sBACF,qBAAqB,iBAAiB,QAAU,OAAU,CACxD,MAAM,eAAe,EACrB,KAAM,CAAE,eAAgB,EAAI,MAAM,OAAO,QAEzC,GAAI,kBAAoB,QAAS,CAC/B,MAAM,OAAO,aAAa,wBAAyB,EAAI,EACvD,cAAc,KAAO,OACrB,MACF,CAEA,MAAM,OAAO,aAAa,wBAAyB,EAAK,EACxD,cAAc,KAAO,UACvB,CAAC,EAIH,MAAM,UAAY,cACf,QAAQ,oBAAoB,EAC5B,cAAc,+BAA+B,EAEhD,GAAI,CAAC,UACH,OAGF,MAAM,aAAe,CACnB,OAAQ,GACR,OAAQ,GACR,UAAW,GACX,UAAW,EACb,EAEM,qBAAwB,OAAU,CACtC,OAAO,KAAK,KAAK,EAAE,QAAS,aAAgB,CAC1C,MAAM,oBAAsB,UAAU,cACpC,sBAAsB,WAAW,IACnC,EACK,qBAGL,oBAAoB,aAAa,iBAAkB,MAAM,WAAW,CAAC,CACvE,CAAC,CACH,EAEA,cAAc,iBAAiB,QAAU,OAAU,CACjD,MAAM,SAAW,MAAM,OAAO,MAE9B,aAAa,OAAS,SAAS,QAAU,EACzC,aAAa,OAAS,QAAQ,KAAK,QAAQ,EAC3C,aAAa,UAAY,QAAQ,KAAK,QAAQ,EAC9C,aAAa,UAAY,QAAQ,KAAK,QAAQ,EAE9C,qBAAqB,YAAY,CACnC,CAAC,CACH,GAAG",
  "names": []
}
