@alfadocs/ui-kit-debug 1.112.2 → 1.113.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/dist/_chunks/{calendar-appointment-editor-dialog-FvdoKZ54.js → calendar-appointment-editor-dialog-CaZm5wGR.js} +2 -2
  2. package/dist/_chunks/{calendar-appointment-editor-dialog-FvdoKZ54.js.map → calendar-appointment-editor-dialog-CaZm5wGR.js.map} +1 -1
  3. package/dist/_chunks/email-input-DxwbREpx.js +156 -0
  4. package/dist/_chunks/email-input-DxwbREpx.js.map +1 -0
  5. package/dist/_chunks/{forgot-password-form-vfCO2-Tt.js → forgot-password-form-YQVzSskq.js} +8 -7
  6. package/dist/_chunks/{forgot-password-form-vfCO2-Tt.js.map → forgot-password-form-YQVzSskq.js.map} +1 -1
  7. package/dist/_chunks/isEmail-BfVspSvV.js +248 -0
  8. package/dist/_chunks/isEmail-BfVspSvV.js.map +1 -0
  9. package/dist/_chunks/{login-dev-card-Cz1Clugq.js → login-dev-card-B6-zCFq3.js} +47 -46
  10. package/dist/_chunks/{login-dev-card-Cz1Clugq.js.map → login-dev-card-B6-zCFq3.js.map} +1 -1
  11. package/dist/_chunks/{patient-details-BwkDIm4D.js → patient-details-RsT3SaYh.js} +2 -2
  12. package/dist/_chunks/{patient-details-BwkDIm4D.js.map → patient-details-RsT3SaYh.js.map} +1 -1
  13. package/dist/_chunks/{patient-field-row-CBba7w9V.js → patient-field-row-D9rb-QJH.js} +2 -2
  14. package/dist/_chunks/{patient-field-row-CBba7w9V.js.map → patient-field-row-D9rb-QJH.js.map} +1 -1
  15. package/dist/_chunks/{patient-summary-card-DtYTo9w_.js → patient-summary-card-BjZErlbt.js} +2 -2
  16. package/dist/_chunks/{patient-summary-card-DtYTo9w_.js.map → patient-summary-card-BjZErlbt.js.map} +1 -1
  17. package/dist/_chunks/{practice-results-BOpaPaav.js → practice-results-BByRCIuR.js} +620 -566
  18. package/dist/_chunks/practice-results-BByRCIuR.js.map +1 -0
  19. package/dist/_chunks/{registration-form-DEyUFysm.js → registration-form-Cq5_OSIL.js} +7 -6
  20. package/dist/_chunks/{registration-form-DEyUFysm.js.map → registration-form-Cq5_OSIL.js.map} +1 -1
  21. package/dist/_chunks/{reserved.agent-W_Zgj564.js → reserved.agent-BMkapgom.js} +2 -2
  22. package/dist/_chunks/{reserved.agent-W_Zgj564.js.map → reserved.agent-BMkapgom.js.map} +1 -1
  23. package/dist/_chunks/{reset-password-form-B0acanDD.js → reset-password-form-BVsL2fOJ.js} +2 -2
  24. package/dist/_chunks/{reset-password-form-B0acanDD.js.map → reset-password-form-BVsL2fOJ.js.map} +1 -1
  25. package/dist/_chunks/{send-registration-link-form-Nn0jf65G.js → send-registration-link-form-OgPomrZN.js} +8 -7
  26. package/dist/_chunks/{send-registration-link-form-Nn0jf65G.js.map → send-registration-link-form-OgPomrZN.js.map} +1 -1
  27. package/dist/_chunks/{use-appointment-details-read-DYyCYI9f.js → use-appointment-details-read-DvK7Looa.js} +2 -2
  28. package/dist/_chunks/{use-appointment-details-read-DYyCYI9f.js.map → use-appointment-details-read-DvK7Looa.js.map} +1 -1
  29. package/dist/_chunks/verify-identity-types-C85EXNzy.js +707 -0
  30. package/dist/_chunks/verify-identity-types-C85EXNzy.js.map +1 -0
  31. package/dist/agent-catalog.json +106 -2
  32. package/dist/agent-i18n/en.json +11 -0
  33. package/dist/components/appointment-details-panel/index.js +1 -1
  34. package/dist/components/booking/index.js +1 -1
  35. package/dist/components/email-input/index.js +1 -1
  36. package/dist/components/index.d.ts +1 -0
  37. package/dist/components/index.d.ts.map +1 -1
  38. package/dist/components/patient-details/index.js +1 -1
  39. package/dist/components/patient-summary-card/index.js +1 -1
  40. package/dist/components/practice-results/index.js +1 -1
  41. package/dist/components/practice-results/practice-results.d.ts +28 -0
  42. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  43. package/dist/core.css +1 -1
  44. package/dist/i18n/locales/ar.d.ts +67 -0
  45. package/dist/i18n/locales/ar.d.ts.map +1 -1
  46. package/dist/i18n/locales/ar.js +68 -1
  47. package/dist/i18n/locales/ar.js.map +1 -1
  48. package/dist/i18n/locales/de.d.ts +67 -0
  49. package/dist/i18n/locales/de.d.ts.map +1 -1
  50. package/dist/i18n/locales/de.js +68 -1
  51. package/dist/i18n/locales/de.js.map +1 -1
  52. package/dist/i18n/locales/el.d.ts +67 -0
  53. package/dist/i18n/locales/el.d.ts.map +1 -1
  54. package/dist/i18n/locales/el.js +68 -1
  55. package/dist/i18n/locales/el.js.map +1 -1
  56. package/dist/i18n/locales/en.d.ts +67 -0
  57. package/dist/i18n/locales/en.d.ts.map +1 -1
  58. package/dist/i18n/locales/en.js +67 -0
  59. package/dist/i18n/locales/en.js.map +1 -1
  60. package/dist/i18n/locales/es.d.ts +67 -0
  61. package/dist/i18n/locales/es.d.ts.map +1 -1
  62. package/dist/i18n/locales/es.js +68 -1
  63. package/dist/i18n/locales/es.js.map +1 -1
  64. package/dist/i18n/locales/fr.d.ts +67 -0
  65. package/dist/i18n/locales/fr.d.ts.map +1 -1
  66. package/dist/i18n/locales/fr.js +68 -1
  67. package/dist/i18n/locales/fr.js.map +1 -1
  68. package/dist/i18n/locales/hi.d.ts +67 -0
  69. package/dist/i18n/locales/hi.d.ts.map +1 -1
  70. package/dist/i18n/locales/hi.js +68 -1
  71. package/dist/i18n/locales/hi.js.map +1 -1
  72. package/dist/i18n/locales/it.d.ts +67 -0
  73. package/dist/i18n/locales/it.d.ts.map +1 -1
  74. package/dist/i18n/locales/it.js +68 -1
  75. package/dist/i18n/locales/it.js.map +1 -1
  76. package/dist/i18n/locales/ja.d.ts +67 -0
  77. package/dist/i18n/locales/ja.d.ts.map +1 -1
  78. package/dist/i18n/locales/ja.js +68 -1
  79. package/dist/i18n/locales/ja.js.map +1 -1
  80. package/dist/i18n/locales/nl.d.ts +67 -0
  81. package/dist/i18n/locales/nl.d.ts.map +1 -1
  82. package/dist/i18n/locales/nl.js +68 -1
  83. package/dist/i18n/locales/nl.js.map +1 -1
  84. package/dist/i18n/locales/pl.d.ts +67 -0
  85. package/dist/i18n/locales/pl.d.ts.map +1 -1
  86. package/dist/i18n/locales/pl.js +68 -1
  87. package/dist/i18n/locales/pl.js.map +1 -1
  88. package/dist/i18n/locales/pt.d.ts +67 -0
  89. package/dist/i18n/locales/pt.d.ts.map +1 -1
  90. package/dist/i18n/locales/pt.js +68 -1
  91. package/dist/i18n/locales/pt.js.map +1 -1
  92. package/dist/i18n/locales/ro.d.ts +67 -0
  93. package/dist/i18n/locales/ro.d.ts.map +1 -1
  94. package/dist/i18n/locales/ro.js +68 -1
  95. package/dist/i18n/locales/ro.js.map +1 -1
  96. package/dist/i18n/locales/ru.d.ts +67 -0
  97. package/dist/i18n/locales/ru.d.ts.map +1 -1
  98. package/dist/i18n/locales/ru.js +68 -1
  99. package/dist/i18n/locales/ru.js.map +1 -1
  100. package/dist/i18n/locales/sq.d.ts +67 -0
  101. package/dist/i18n/locales/sq.d.ts.map +1 -1
  102. package/dist/i18n/locales/sq.js +68 -1
  103. package/dist/i18n/locales/sq.js.map +1 -1
  104. package/dist/i18n/locales/sv.d.ts +67 -0
  105. package/dist/i18n/locales/sv.d.ts.map +1 -1
  106. package/dist/i18n/locales/sv.js +68 -1
  107. package/dist/i18n/locales/sv.js.map +1 -1
  108. package/dist/i18n/locales/tr.d.ts +67 -0
  109. package/dist/i18n/locales/tr.d.ts.map +1 -1
  110. package/dist/i18n/locales/tr.js +68 -1
  111. package/dist/i18n/locales/tr.js.map +1 -1
  112. package/dist/i18n/locales/zh.d.ts +67 -0
  113. package/dist/i18n/locales/zh.d.ts.map +1 -1
  114. package/dist/i18n/locales/zh.js +68 -1
  115. package/dist/i18n/locales/zh.js.map +1 -1
  116. package/dist/index.js +345 -340
  117. package/dist/index.js.map +1 -1
  118. package/dist/locales/ar.json +68 -1
  119. package/dist/locales/de.json +68 -1
  120. package/dist/locales/el.json +68 -1
  121. package/dist/locales/en.json +67 -0
  122. package/dist/locales/es.json +68 -1
  123. package/dist/locales/fr.json +68 -1
  124. package/dist/locales/hi.json +68 -1
  125. package/dist/locales/it.json +68 -1
  126. package/dist/locales/ja.json +68 -1
  127. package/dist/locales/nl.json +68 -1
  128. package/dist/locales/pl.json +68 -1
  129. package/dist/locales/pt.json +68 -1
  130. package/dist/locales/ro.json +68 -1
  131. package/dist/locales/ru.json +68 -1
  132. package/dist/locales/sq.json +68 -1
  133. package/dist/locales/sv.json +68 -1
  134. package/dist/locales/tr.json +68 -1
  135. package/dist/locales/zh.json +68 -1
  136. package/dist/patterns/calendar/index.js +1 -1
  137. package/dist/patterns/forgot-password-form/index.js +1 -1
  138. package/dist/patterns/login-form/index.js +1 -1
  139. package/dist/patterns/registration-form/index.js +1 -1
  140. package/dist/patterns/reset-password-form/index.js +1 -1
  141. package/dist/patterns/send-registration-link-form/index.js +1 -1
  142. package/dist/patterns/verify-identity/change-email-dialog.d.ts +26 -0
  143. package/dist/patterns/verify-identity/change-email-dialog.d.ts.map +1 -0
  144. package/dist/patterns/verify-identity/index.d.ts +7 -0
  145. package/dist/patterns/verify-identity/index.d.ts.map +1 -0
  146. package/dist/patterns/verify-identity/index.js +8 -0
  147. package/dist/patterns/verify-identity/index.js.map +1 -0
  148. package/dist/patterns/verify-identity/use-countdown.d.ts +12 -0
  149. package/dist/patterns/verify-identity/use-countdown.d.ts.map +1 -0
  150. package/dist/patterns/verify-identity/verify-identity-steps.d.ts +21 -0
  151. package/dist/patterns/verify-identity/verify-identity-steps.d.ts.map +1 -0
  152. package/dist/patterns/verify-identity/verify-identity-types.d.ts +47 -0
  153. package/dist/patterns/verify-identity/verify-identity-types.d.ts.map +1 -0
  154. package/dist/patterns/verify-identity/verify-identity.d.ts +54 -0
  155. package/dist/patterns/verify-identity/verify-identity.d.ts.map +1 -0
  156. package/dist/tokens.css +1 -1
  157. package/package.json +5 -1
  158. package/dist/_chunks/email-input-BEO3vonE.js +0 -399
  159. package/dist/_chunks/email-input-BEO3vonE.js.map +0 -1
  160. package/dist/_chunks/practice-results-BOpaPaav.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isEmail-BfVspSvV.js","sources":["../../node_modules/validator/lib/util/assertString.js","../../node_modules/validator/lib/util/checkHost.js","../../node_modules/validator/lib/isByteLength.js","../../node_modules/validator/lib/util/merge.js","../../node_modules/validator/lib/isFQDN.js","../../node_modules/validator/lib/isIP.js","../../node_modules/validator/lib/isEmail.js"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = assertString;\nfunction assertString(input) {\n if (input === undefined || input === null) throw new TypeError(\"Expected a string but received a \".concat(input));\n if (input.constructor.name !== 'String') throw new TypeError(\"Expected a string but received a \".concat(input.constructor.name));\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = checkHost;\nfunction isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n}\nfunction checkHost(host, matches) {\n for (var i = 0; i < matches.length; i++) {\n var match = matches[i];\n if (host === match || isRegExp(match) && match.test(host)) {\n return true;\n }\n }\n return false;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isByteLength;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/* eslint-disable prefer-rest-params */\nfunction isByteLength(str, options) {\n (0, _assertString.default)(str);\n var min;\n var max;\n if (_typeof(options) === 'object') {\n min = options.min || 0;\n max = options.max;\n } else {\n // backwards compatibility: isByteLength(str, min [, max])\n min = arguments[1];\n max = arguments[2];\n }\n var len = encodeURI(str).split(/%..|./).length - 1;\n return len >= min && (typeof max === 'undefined' || len <= max);\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = merge;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction merge() {\n var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var defaults = arguments.length > 1 ? arguments[1] : undefined;\n if (_typeof(obj) !== 'object' || obj === null) {\n obj = {};\n }\n for (var key in defaults) {\n if (typeof obj[key] === 'undefined') {\n obj[key] = defaults[key];\n }\n }\n return obj;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isFQDN;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nvar _merge = _interopRequireDefault(require(\"./util/merge\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nvar default_fqdn_options = {\n require_tld: true,\n allow_underscores: false,\n allow_trailing_dot: false,\n allow_numeric_tld: false,\n allow_wildcard: false,\n ignore_max_length: false\n};\nfunction isFQDN(str, options) {\n (0, _assertString.default)(str);\n options = (0, _merge.default)(options, default_fqdn_options);\n\n /* Remove the optional trailing dot before checking validity */\n if (options.allow_trailing_dot && str[str.length - 1] === '.') {\n str = str.substring(0, str.length - 1);\n }\n\n /* Remove the optional wildcard before checking validity */\n if (options.allow_wildcard === true && str.indexOf('*.') === 0) {\n str = str.substring(2);\n }\n var parts = str.split('.');\n var tld = parts[parts.length - 1];\n if (options.require_tld) {\n // disallow fqdns without tld\n if (parts.length < 2) {\n return false;\n }\n if (!options.allow_numeric_tld && !/^([a-z\\u00A1-\\u00A8\\u00AA-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {\n return false;\n }\n\n // disallow spaces\n if (/\\s/.test(tld)) {\n return false;\n }\n }\n\n // reject numeric TLDs\n if (!options.allow_numeric_tld && /^\\d+$/.test(tld)) {\n return false;\n }\n return parts.every(function (part) {\n if (part.length > 63 && !options.ignore_max_length) {\n return false;\n }\n if (!/^[a-z_\\u00a1-\\uffff0-9-]+$/i.test(part)) {\n return false;\n }\n\n // disallow full-width chars\n if (/[\\uff01-\\uff5e]/.test(part)) {\n return false;\n }\n\n // disallow parts starting or ending with hyphen\n if (/^-|-$/.test(part)) {\n return false;\n }\n if (!options.allow_underscores && /_/.test(part)) {\n return false;\n }\n return true;\n });\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isIP;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/**\n11.3. Examples\n\n The following addresses\n\n fe80::1234 (on the 1st link of the node)\n ff02::5678 (on the 5th link of the node)\n ff08::9abc (on the 10th organization of the node)\n\n would be represented as follows:\n\n fe80::1234%1\n ff02::5678%5\n ff08::9abc%10\n\n (Here we assume a natural translation from a zone index to the\n <zone_id> part, where the Nth zone of any scope is translated into\n \"N\".)\n\n If we use interface names as <zone_id>, those addresses could also be\n represented as follows:\n\n fe80::1234%ne0\n ff02::5678%pvc1.3\n ff08::9abc%interface10\n\n where the interface \"ne0\" belongs to the 1st link, \"pvc1.3\" belongs\n to the 5th link, and \"interface10\" belongs to the 10th organization.\n * * */\nvar IPv4SegmentFormat = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';\nvar IPv4AddressFormat = \"(\".concat(IPv4SegmentFormat, \"[.]){3}\").concat(IPv4SegmentFormat);\nvar IPv4AddressRegExp = new RegExp(\"^\".concat(IPv4AddressFormat, \"$\"));\nvar IPv6SegmentFormat = '(?:[0-9a-fA-F]{1,4})';\nvar IPv6AddressRegExp = new RegExp('^(' + \"(?:\".concat(IPv6SegmentFormat, \":){7}(?:\").concat(IPv6SegmentFormat, \"|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){6}(?:\").concat(IPv4AddressFormat, \"|:\").concat(IPv6SegmentFormat, \"|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){5}(?::\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,2}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){4}(?:(:\").concat(IPv6SegmentFormat, \"){0,1}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,3}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){3}(?:(:\").concat(IPv6SegmentFormat, \"){0,2}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,4}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){2}(?:(:\").concat(IPv6SegmentFormat, \"){0,3}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,5}|:)|\") + \"(?:\".concat(IPv6SegmentFormat, \":){1}(?:(:\").concat(IPv6SegmentFormat, \"){0,4}:\").concat(IPv4AddressFormat, \"|(:\").concat(IPv6SegmentFormat, \"){1,6}|:)|\") + \"(?::((?::\".concat(IPv6SegmentFormat, \"){0,5}:\").concat(IPv4AddressFormat, \"|(?::\").concat(IPv6SegmentFormat, \"){1,7}|:))\") + ')(%[0-9a-zA-Z.]{1,})?$');\nfunction isIP(ipAddress) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n (0, _assertString.default)(ipAddress);\n\n // accessing 'arguments' for backwards compatibility: isIP(ipAddress [, version])\n // eslint-disable-next-line prefer-rest-params\n var version = (_typeof(options) === 'object' ? options.version : arguments[1]) || '';\n if (!version) {\n return isIP(ipAddress, {\n version: 4\n }) || isIP(ipAddress, {\n version: 6\n });\n }\n if (version.toString() === '4') {\n return IPv4AddressRegExp.test(ipAddress);\n }\n if (version.toString() === '6') {\n return IPv6AddressRegExp.test(ipAddress);\n }\n return false;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isEmail;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nvar _checkHost = _interopRequireDefault(require(\"./util/checkHost\"));\nvar _isByteLength = _interopRequireDefault(require(\"./isByteLength\"));\nvar _isFQDN = _interopRequireDefault(require(\"./isFQDN\"));\nvar _isIP = _interopRequireDefault(require(\"./isIP\"));\nvar _merge = _interopRequireDefault(require(\"./util/merge\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nvar default_email_options = {\n allow_display_name: false,\n allow_underscores: false,\n require_display_name: false,\n allow_utf8_local_part: true,\n require_tld: true,\n blacklisted_chars: '',\n ignore_max_length: false,\n host_blacklist: [],\n host_whitelist: []\n};\n\n/* eslint-disable max-len */\n/* eslint-disable no-control-regex */\nvar splitNameAddress = /^([^\\x00-\\x1F\\x7F-\\x9F\\cX]+)</i;\nvar emailUserPart = /^[a-z\\d!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]+$/i;\nvar gmailUserPart = /^[a-z\\d]+$/;\nvar quotedEmailUser = /^([\\s\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f\\x21\\x23-\\x5b\\x5d-\\x7e]|(\\\\[\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]))*$/i;\nvar emailUserUtf8Part = /^[a-z\\d!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\u00A1-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+$/i;\nvar quotedEmailUserUtf8 = /^([\\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;\nvar defaultMaxEmailLength = 254;\n/* eslint-enable max-len */\n/* eslint-enable no-control-regex */\n\n/**\n * Validate display name according to the RFC2822: https://tools.ietf.org/html/rfc2822#appendix-A.1.2\n * @param {String} display_name\n */\nfunction validateDisplayName(display_name) {\n var display_name_without_quotes = display_name.replace(/^\"(.+)\"$/, '$1');\n // display name with only spaces is not valid\n if (!display_name_without_quotes.trim()) {\n return false;\n }\n\n // check whether display name contains illegal character\n var contains_illegal = /[\\.\";<>]/.test(display_name_without_quotes);\n if (contains_illegal) {\n // if contains illegal characters,\n // must to be enclosed in double-quotes, otherwise it's not a valid display name\n if (display_name_without_quotes === display_name) {\n return false;\n }\n\n // the quotes in display name must start with character symbol \\\n var all_start_with_back_slash = display_name_without_quotes.split('\"').length === display_name_without_quotes.split('\\\\\"').length;\n if (!all_start_with_back_slash) {\n return false;\n }\n }\n return true;\n}\nfunction isEmail(str, options) {\n (0, _assertString.default)(str);\n options = (0, _merge.default)(options, default_email_options);\n if (options.require_display_name || options.allow_display_name) {\n var display_email = str.match(splitNameAddress);\n if (display_email) {\n var display_name = display_email[1];\n\n // Remove display name and angle brackets to get email address\n // Can be done in the regex but will introduce a ReDOS (See #1597 for more info)\n str = str.replace(display_name, '').replace(/(^<|>$)/g, '');\n\n // sometimes need to trim the last space to get the display name\n // because there may be a space between display name and email address\n // eg. myname <address@gmail.com>\n // the display name is `myname` instead of `myname `, so need to trim the last space\n if (display_name.endsWith(' ')) {\n display_name = display_name.slice(0, -1);\n }\n if (!validateDisplayName(display_name)) {\n return false;\n }\n } else if (options.require_display_name) {\n return false;\n }\n }\n if (!options.ignore_max_length && str.length > defaultMaxEmailLength) {\n return false;\n }\n var parts = str.split('@');\n var domain = parts.pop();\n var lower_domain = domain.toLowerCase();\n if (options.host_blacklist.length > 0 && (0, _checkHost.default)(lower_domain, options.host_blacklist)) {\n return false;\n }\n if (options.host_whitelist.length > 0 && !(0, _checkHost.default)(lower_domain, options.host_whitelist)) {\n return false;\n }\n var user = parts.join('@');\n if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {\n /*\n Previously we removed dots for gmail addresses before validating.\n This was removed because it allows `multiple..dots@gmail.com`\n to be reported as valid, but it is not.\n Gmail only normalizes single dots, removing them from here is pointless,\n should be done in normalizeEmail\n */\n user = user.toLowerCase();\n\n // Removing sub-address from username before gmail validation\n var username = user.split('+')[0];\n\n // Dots are not included in gmail length restriction\n if (!(0, _isByteLength.default)(username.replace(/\\./g, ''), {\n min: 6,\n max: 30\n })) {\n return false;\n }\n var _user_parts = username.split('.');\n for (var i = 0; i < _user_parts.length; i++) {\n if (!gmailUserPart.test(_user_parts[i])) {\n return false;\n }\n }\n }\n if (options.ignore_max_length === false && (!(0, _isByteLength.default)(user, {\n max: 64\n }) || !(0, _isByteLength.default)(domain, {\n max: 254\n }))) {\n return false;\n }\n if (!(0, _isFQDN.default)(domain, {\n require_tld: options.require_tld,\n ignore_max_length: options.ignore_max_length,\n allow_underscores: options.allow_underscores\n })) {\n if (!options.allow_ip_domain) {\n return false;\n }\n if (!(0, _isIP.default)(domain)) {\n if (!domain.startsWith('[') || !domain.endsWith(']')) {\n return false;\n }\n var noBracketdomain = domain.slice(1, -1);\n if (noBracketdomain.length === 0 || !(0, _isIP.default)(noBracketdomain)) {\n return false;\n }\n }\n }\n if (options.blacklisted_chars) {\n if (user.search(new RegExp(\"[\".concat(options.blacklisted_chars, \"]+\"), 'g')) !== -1) return false;\n }\n if (user[0] === '\"' && user[user.length - 1] === '\"') {\n user = user.slice(1, user.length - 1);\n return options.allow_utf8_local_part ? quotedEmailUserUtf8.test(user) : quotedEmailUser.test(user);\n }\n var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart;\n var user_parts = user.split('.');\n for (var _i = 0; _i < user_parts.length; _i++) {\n if (!pattern.test(user_parts[_i])) {\n return false;\n }\n }\n return true;\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;"],"names":["exports","assertString","input","module","checkHost","isRegExp","obj","host","matches","i","match","isByteLength","_assertString","_interopRequireDefault","e","_typeof","o","str","options","min","max","len","merge","defaults","key","isFQDN","_merge","default_fqdn_options","parts","tld","part","isIP","IPv4SegmentFormat","IPv4AddressFormat","IPv4AddressRegExp","IPv6SegmentFormat","IPv6AddressRegExp","ipAddress","version","isEmail","_checkHost","_isByteLength","_isFQDN","_isIP","default_email_options","splitNameAddress","emailUserPart","gmailUserPart","quotedEmailUser","emailUserUtf8Part","quotedEmailUserUtf8","defaultMaxEmailLength","validateDisplayName","display_name","display_name_without_quotes","contains_illegal","all_start_with_back_slash","display_email","domain","lower_domain","user","username","_user_parts","noBracketdomain","pattern","user_parts","_i"],"mappings":";;;;AAEA,WAAO,eAAcA,GAAU,cAAc;AAAA,MAC3C,OAAO;AAAA,IACT,CAAC,GACDA,EAAA,UAAkBC;AAClB,aAASA,EAAaC,GAAO;AAC3B,UAA2BA,KAAU,KAAM,OAAM,IAAI,UAAU,oCAAoC,OAAOA,CAAK,CAAC;AAChH,UAAIA,EAAM,YAAY,SAAS,SAAU,OAAM,IAAI,UAAU,oCAAoC,OAAOA,EAAM,YAAY,IAAI,CAAC;AAAA,IACjI;AACA,IAAAC,EAAA,UAAiBH,EAAQ,SACzBG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AAG,GAAG,CAAC,MAAM;AAAI,eAAO;AAE/F,UAAI0C,EAAK,CAAC,MAAM,OAAOA,EAAKA,EAAK,SAAS,CAAC,MAAM;AAC/C,eAAAA,IAAOA,EAAK,MAAM,GAAGA,EAAK,SAAS,CAAC,GAC7B1C,EAAQ,wBAAwBgC,EAAoB,KAAKU,CAAI,IAAIZ,EAAgB,KAAKY,CAAI;AAInG,eAFII,IAAU9C,EAAQ,wBAAwB+B,IAAoBH,GAC9DmB,IAAaL,EAAK,MAAM,GAAG,GACtBM,IAAK,GAAGA,IAAKD,EAAW,QAAQC;AACvC,YAAI,CAACF,EAAQ,KAAKC,EAAWC,CAAE,CAAC;AAC9B,iBAAO;AAGX,aAAO;AAAA,IACT;AACA,IAAA/D,EAAA,UAAiBH,EAAQ,SACzBG,EAAA,QAAA,UAAyBH,EAAQ;AAAA;;;;","x_google_ignoreList":[0,1,2,3,4,5,6]}
@@ -2,10 +2,11 @@ import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
2
  import { forwardRef as ge, useId as k, useState as l, useEffect as me, useRef as ce } from "react";
3
3
  import { useTranslation as ze } from "react-i18next";
4
4
  import { c as B } from "./index-D2ZczOXr.js";
5
- import { E as Pe, i as Te } from "./email-input-BEO3vonE.js";
5
+ import { i as Pe } from "./isEmail-BfVspSvV.js";
6
6
  import { B as he } from "./button-DohK_Ak_.js";
7
- import { C as je } from "./checkbox-a7Sh-dXb.js";
7
+ import { C as Te } from "./checkbox-a7Sh-dXb.js";
8
8
  import { C as b } from "./card-C85_Ndhb.js";
9
+ import { E as je } from "./email-input-DxwbREpx.js";
9
10
  import { T as De } from "./text-input-B6iAgCr3.js";
10
11
  import { E as He } from "./error-summary-DxNhwf_G.js";
11
12
  import { F as ue } from "./form-field-CyHfOVKF.js";
@@ -19,20 +20,20 @@ import { M as es } from "./matrix-rain-sDOUUwZp.js";
19
20
  import { a as ss } from "./error-page-illustration-BdJLuMdV.js";
20
21
  const W = ["email", "password"], rs = B(
21
22
  "ds:flex ds:w-full ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-lg)] ds:text-start ds:text-[var(--foreground)] ds:lg:flex-row ds:lg:items-stretch"
22
- ), fe = B("ds:w-full ds:max-w-[400px]"), as = B(
23
+ ), fe = B("ds:w-full ds:max-w-[400px]"), ts = B(
23
24
  "ds:flex ds:flex-wrap ds:justify-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-lg)]"
24
- ), G = (a) => a && ve(a) ? a : void 0, ts = (a) => Object.values(a).some(Boolean), os = (a) => W.some((m) => !!a[m]), pe = (a) => W.find((m) => a[m]) ?? (a.form ? "password" : void 0), ns = ge(
25
+ ), G = (t) => t && ve(t) ? t : void 0, as = (t) => Object.values(t).some(Boolean), os = (t) => W.some((m) => !!t[m]), pe = (t) => W.find((m) => t[m]) ?? (t.form ? "password" : void 0), ns = ge(
25
26
  ({
26
- title: a,
27
+ title: t,
27
28
  description: m,
28
29
  headingLevel: w = 1,
29
30
  showLogo: L = !0,
30
31
  logoMotion: R = "assemble",
31
32
  children: x,
32
- initialValues: t,
33
+ initialValues: a,
33
34
  allowUsername: F = !1,
34
35
  errors: u,
35
- forgotPasswordHref: d,
36
+ forgotPasswordHref: i,
36
37
  showRememberMe: A = !1,
37
38
  registerDoctorHref: be,
38
39
  registerPatientHref: we,
@@ -46,15 +47,15 @@ const W = ["email", "password"], rs = B(
46
47
  className: Ee,
47
48
  ...Ce
48
49
  }, Ie) => {
49
- const { t: n } = ze("ui"), K = k(), S = k(), ke = k(), q = (e) => `${ke}-${e}`, i = o !== void 0, [p, g] = l(() => (t == null ? void 0 : t.email) ?? ""), [y, M] = l(""), [Q, Be] = l(
50
- () => (t == null ? void 0 : t.rememberMe) === !0
51
- ), z = A || !!(o != null && o.rememberMe), U = i && z && !(o != null && o.rememberMe);
50
+ const { t: n } = ze("ui"), K = k(), S = k(), ke = k(), q = (e) => `${ke}-${e}`, d = o !== void 0, [p, g] = l(() => (a == null ? void 0 : a.email) ?? ""), [y, M] = l(""), [Q, Be] = l(
51
+ () => (a == null ? void 0 : a.rememberMe) === !0
52
+ ), z = A || !!(o != null && o.rememberMe), U = d && z && !(o != null && o.rememberMe);
52
53
  me(() => {
53
54
  U && $e() && console.warn(
54
55
  "LoginForm: the remember-me box is shown but `fieldNames.rememberMe` is not set, so the server will not read it."
55
56
  );
56
57
  }, [U]);
57
- const [Le, X] = l(() => ({ email: !!(t != null && t.email) })), [Re, Y] = l(!1), [Z, V] = l(
58
+ const [Le, X] = l(() => ({ email: !!(a != null && a.email) })), [Re, Y] = l(!1), [Z, V] = l(
58
59
  () => u ?? {}
59
60
  ), P = (e) => X(
60
61
  (r) => r[e] ? r : { ...r, [e]: !0 }
@@ -74,13 +75,13 @@ const W = ["email", "password"], rs = B(
74
75
  return r.email !== p && g(r.email), r.password !== y && M(r.password), r;
75
76
  }, re = (e) => {
76
77
  const r = e.trim();
77
- return r === "" || (!F || /[@\uFF20\uFE6B]/.test(r)) && !Te(r);
78
- }, ae = {
78
+ return r === "" || (!F || /[@\uFF20\uFE6B]/.test(r)) && !Pe(r);
79
+ }, te = {
79
80
  email: re(p),
80
81
  password: y === ""
81
- }, te = (e) => Re || Le[e] === !0, Ae = {
82
- email: te("email") && ae.email ? p.trim() === "" ? n("loginForm.emailRequired") : n("inputs.email.invalid") : void 0,
83
- password: te("password") && ae.password ? n("loginForm.passwordRequired") : void 0
82
+ }, ae = (e) => Re || Le[e] === !0, Ae = {
83
+ email: ae("email") && te.email ? p.trim() === "" ? n("loginForm.emailRequired") : n("inputs.email.invalid") : void 0,
84
+ password: ae("password") && te.password ? n("loginForm.passwordRequired") : void 0
84
85
  }, I = (e) => Z[e] ?? Ae[e], [oe] = l(
85
86
  () => os(u ?? {})
86
87
  ), c = Ye(
@@ -95,10 +96,10 @@ const W = ["email", "password"], rs = B(
95
96
  var e;
96
97
  D && ((e = (D.target === "email" ? E : j).current) == null || e.focus());
97
98
  }, [D]);
98
- const de = Ze({
99
+ const ie = Ze({
99
100
  errors: u,
100
101
  submitting: Fe,
101
- native: i,
102
+ native: d,
102
103
  captcha: !1,
103
104
  firstProblem: () => {
104
105
  const e = se();
@@ -111,7 +112,7 @@ const W = ["email", "password"], rs = B(
111
112
  deliver: () => N == null ? void 0 : N(se()),
112
113
  onAnswer: (e) => {
113
114
  const r = e;
114
- V(r), ts(r) && (ee(), Y(!1), c.open(() => {
115
+ V(r), as(r) && (ee(), Y(!1), c.open(() => {
115
116
  const v = pe(r);
116
117
  v && ne({ target: v });
117
118
  }));
@@ -119,9 +120,9 @@ const W = ["email", "password"], rs = B(
119
120
  // The page came back from the browser's cache as it was left: the
120
121
  // password must not come back with it.
121
122
  onRestore: ee
122
- }), { busy: H } = de, Ne = We("LoginForm", i, ye), ie = G(d), O = G(be), $ = G(we), Se = Je(
123
+ }), { busy: H } = ie, Ne = We("LoginForm", d, ye), de = G(i), O = G(be), $ = G(we), Se = Je(
123
124
  "LoginForm",
124
- i,
125
+ d,
125
126
  o,
126
127
  Me
127
128
  ), h = Z.form, qe = Ve(
@@ -141,7 +142,7 @@ const W = ["email", "password"], rs = B(
141
142
  Ke,
142
143
  {
143
144
  id: K,
144
- title: a ?? n("loginForm.title"),
145
+ title: t ?? n("loginForm.title"),
145
146
  description: m,
146
147
  level: w,
147
148
  showLogo: L,
@@ -164,7 +165,7 @@ const W = ["email", "password"], rs = B(
164
165
  action: Ne,
165
166
  "aria-labelledby": K,
166
167
  "aria-busy": H || void 0,
167
- onSubmit: de.handleSubmit,
168
+ onSubmit: ie.handleSubmit,
168
169
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
169
170
  children: [
170
171
  /* @__PURE__ */ s(
@@ -205,7 +206,7 @@ const W = ["email", "password"], rs = B(
205
206
  De,
206
207
  {
207
208
  ref: C.ref,
208
- name: i ? o.email : "email",
209
+ name: d ? o.email : "email",
209
210
  type: "text",
210
211
  inputMode: "email",
211
212
  autoComplete: "username",
@@ -222,10 +223,10 @@ const W = ["email", "password"], rs = B(
222
223
  }
223
224
  )
224
225
  ) : /* @__PURE__ */ s(
225
- Pe,
226
+ je,
226
227
  {
227
228
  ref: C.ref,
228
- name: i ? o.email : "email",
229
+ name: d ? o.email : "email",
229
230
  autoComplete: "username",
230
231
  disableBuiltInValidation: !0,
231
232
  onChange: C.quiet((e) => {
@@ -252,7 +253,7 @@ const W = ["email", "password"], rs = B(
252
253
  Oe,
253
254
  {
254
255
  ref: j,
255
- name: i ? o.password : "password",
256
+ name: d ? o.password : "password",
256
257
  autoComplete: "current-password",
257
258
  "aria-describedby": h ? S : void 0,
258
259
  value: y,
@@ -266,19 +267,19 @@ const W = ["email", "password"], rs = B(
266
267
  )
267
268
  }
268
269
  ),
269
- ie && /* @__PURE__ */ s(
270
+ de && /* @__PURE__ */ s(
270
271
  _,
271
272
  {
272
- href: ie,
273
+ href: de,
273
274
  action: "forgot-password",
274
275
  align: "end",
275
276
  children: n("loginForm.forgot")
276
277
  }
277
278
  ),
278
279
  z && /* @__PURE__ */ s("div", { "data-field": "remember-me", children: /* @__PURE__ */ s(
279
- je,
280
+ Te,
280
281
  {
281
- name: i && o.rememberMe || "rememberMe",
282
+ name: d && o.rememberMe || "rememberMe",
282
283
  checked: Q,
283
284
  onCheckedChange: (e) => Be(e === !0),
284
285
  label: n("loginForm.rememberMe")
@@ -304,7 +305,7 @@ const W = ["email", "password"], rs = B(
304
305
  "div",
305
306
  {
306
307
  "data-slot": "register-links",
307
- className: as(),
308
+ className: ts(),
308
309
  children: [
309
310
  O && /* @__PURE__ */ s(_, { href: O, action: "register-doctor", children: n("signedOutHeader.registerDoctor") }),
310
311
  $ && /* @__PURE__ */ s(_, { href: $, action: "register-patient", children: n("signedOutHeader.registerPatient") })
@@ -320,21 +321,21 @@ const W = ["email", "password"], rs = B(
320
321
  }
321
322
  );
322
323
  ns.displayName = "LoginForm";
323
- const ds = B("ds:h-full ds:w-full"), is = ge(
324
- ({ title: a, options: m, headingLevel: w = 2, className: L, ...R }, x) => {
325
- const t = k(), F = `h${w}`, u = m.filter((d) => ve(d.href));
324
+ const is = B("ds:h-full ds:w-full"), ds = ge(
325
+ ({ title: t, options: m, headingLevel: w = 2, className: L, ...R }, x) => {
326
+ const a = k(), F = `h${w}`, u = m.filter((i) => ve(i.href));
326
327
  return /* @__PURE__ */ s(
327
328
  "div",
328
329
  {
329
330
  ref: x,
330
331
  ...R,
331
332
  "data-component": "login-dev-card",
332
- className: ds({ className: L }),
333
+ className: is({ className: L }),
333
334
  children: /* @__PURE__ */ f(
334
335
  b,
335
336
  {
336
337
  variant: "elevated",
337
- "aria-labelledby": t,
338
+ "aria-labelledby": a,
338
339
  className: "ds:relative ds:isolate ds:flex ds:h-full ds:flex-col ds:overflow-hidden",
339
340
  children: [
340
341
  /* @__PURE__ */ s("div", { className: "ds:absolute ds:inset-0 ds:z-0 ds:[display:var(--accessible-off,block)]", children: /* @__PURE__ */ s(
@@ -352,22 +353,22 @@ const ds = B("ds:h-full ds:w-full"), is = ge(
352
353
  /* @__PURE__ */ s(
353
354
  F,
354
355
  {
355
- id: t,
356
+ id: a,
356
357
  className: "type-title-card ds:text-[var(--foreground)]",
357
- children: a
358
+ children: t
358
359
  }
359
360
  )
360
361
  ] }) }),
361
- /* @__PURE__ */ s(b.Body, { className: "ds:relative ds:z-[1] ds:flex ds:flex-1 ds:flex-col ds:justify-center", children: /* @__PURE__ */ s("div", { className: "ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: u.map((d, A) => /* @__PURE__ */ s(
362
+ /* @__PURE__ */ s(b.Body, { className: "ds:relative ds:z-[1] ds:flex ds:flex-1 ds:flex-col ds:justify-center", children: /* @__PURE__ */ s("div", { className: "ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: u.map((i, A) => /* @__PURE__ */ s(
362
363
  he,
363
364
  {
364
365
  asChild: !0,
365
366
  intent: "primary",
366
- startIcon: d.icon,
367
+ startIcon: i.icon,
367
368
  className: "ds:min-h-[var(--min-target-size)] ds:w-full",
368
- children: /* @__PURE__ */ s("a", { href: d.href, "data-action": "dev-login", children: d.label })
369
+ children: /* @__PURE__ */ s("a", { href: i.href, "data-action": "dev-login", children: i.label })
369
370
  },
370
- `${A}:${d.href}`
371
+ `${A}:${i.href}`
371
372
  )) }) })
372
373
  ]
373
374
  }
@@ -376,10 +377,10 @@ const ds = B("ds:h-full ds:w-full"), is = ge(
376
377
  );
377
378
  }
378
379
  );
379
- is.displayName = "LoginDevCard";
380
+ ds.displayName = "LoginDevCard";
380
381
  export {
381
382
  W as L,
382
- is as a,
383
+ ds as a,
383
384
  ns as b
384
385
  };
385
- //# sourceMappingURL=login-dev-card-Cz1Clugq.js.map
386
+ //# sourceMappingURL=login-dev-card-B6-zCFq3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"login-dev-card-Cz1Clugq.js","sources":["../../src/patterns/login-form/login-form.tsx","../../src/patterns/login-form/login-dev-card.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* LoginForm — the sign-in card. */\n/* */\n/* One export for the card: the mark, the heading, email and password, */\n/* the way to a new password, the button and the ways to register. The */\n/* host keeps the page around it and every server rule. The card checks */\n/* what a browser can check, then hands the values to `onSubmit` or */\n/* posts a real form to the host's own field names. */\n/* */\n/* By default the email must be an email address. A host whose server */\n/* also signs people in by a username sets `allowUsername`: the email */\n/* format is then checked only when the text contains an \"@\". */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\n// The validator EmailInput itself uses, so the two never disagree.\nimport isEmail from 'validator/lib/isEmail';\nimport { Button } from '../../components/button';\nimport { Checkbox } from '../../components/checkbox';\nimport { Card } from '../../components/card';\nimport { EmailInput } from '../../components/email-input';\nimport { TextInput } from '../../components/text-input';\nimport { ErrorSummary } from '../../components/error-summary';\nimport { FormField } from '../../components/form-field';\nimport { PasswordInput } from '../../components/password-input';\nimport { isDevelopment } from '../../components/_shared/is-development';\nimport { isSafeHref } from '../../components/_shared/safe-href';\nimport {\n useStateBackedInput,\n writeInputValue,\n} from '../../components/_shared/use-state-backed-input';\nimport {\n AuthCardHeading,\n AuthFormMessage,\n AuthFormStatus,\n AuthTextLink,\n ExtraFields,\n useExtraFields,\n useFormAction,\n} from '../_shared/auth-form-parts';\nimport type { BrandMarkMotion } from '../_shared/brand-mark';\nimport {\n useErrorSummary,\n useFormMessageAnnounce,\n} from '../_shared/use-error-summary';\nimport { useRegistrationSubmit } from '../registration-form/use-registration-submit';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\n/** The fields of the form, in the order they appear. */\nexport const LOGIN_FORM_FIELDS = ['email', 'password'] as const;\n\nexport type LoginFormField = (typeof LOGIN_FORM_FIELDS)[number];\n\n/** What `onSubmit` receives once both checks have passed. */\nexport interface LoginFormValues {\n email: string;\n password: string;\n /** True when the \"Remember me\" box is ticked. Always false when the\n * box is not shown. */\n rememberMe: boolean;\n}\n\n/** Values to show when the form opens. There is no password here, on\n * purpose: a password is never sent back to the browser. */\nexport type LoginFormInitialValues = Partial<\n Pick<LoginFormValues, 'email' | 'rememberMe'>\n>;\n\n/** Messages from the server, already translated: one per field, plus\n * `form` for a message about the whole form, such as \"the email or\n * password is incorrect\". */\nexport type LoginFormErrors = Partial<Record<LoginFormField | 'form', string>>;\n\n/** The host's own form field names, for a native form post. `email` and\n * `password` are needed: a field without a name is not posted.\n * `rememberMe` is optional and also turns the \"Remember me\" box on. */\nexport type LoginFormFieldNames = Record<LoginFormField, string> & {\n rememberMe?: string;\n};\n\nexport interface LoginFormProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'onSubmit'\n> {\n /** Replaces the heading \"Sign in to Alfadocs\". Pass it translated. */\n title?: string;\n /** A line under the heading. Pass it translated. */\n description?: string;\n /**\n * The heading's level. Default 1: a sign-in page usually has no other\n * heading. Pass 2 on a page that has its own `h1`.\n */\n headingLevel?: 1 | 2 | 3;\n /**\n * Shows the Alfadocs mark above the heading, with the heading and its\n * line centred under it. Default true. With `false` the heading sits\n * at the start edge, for a host that shows its own logo.\n */\n showLogo?: boolean;\n /**\n * How the mark arrives when the card opens: its pieces come together\n * (`assemble`, the default), it turns once (`spin`), it beats\n * (`pulse`), or it is still (`none`). It plays once and rests, and\n * holds still under reduced motion and in the accessible themes.\n */\n logoMotion?: BrandMarkMotion;\n /**\n * Host content between the heading and the fields, such as a notice\n * (\"You have been signed out\"). It sits outside the form, so nothing in\n * it is posted. Keep any heading inside it below the card's own level.\n */\n children?: ReactNode;\n /**\n * For hosts whose server also signs people in by a username. The first\n * field is still labelled \"Email\", but text without an \"@\" is accepted as\n * a username: it only has to be filled in. Text with an \"@\" must be a\n * valid email address, as when this is off. Default false.\n */\n allowUsername?: boolean;\n /** The email to show when the form opens, such as the one last used,\n * and whether \"Remember me\" starts ticked (default false). Read once.\n * There is never an initial password. */\n initialValues?: LoginFormInitialValues;\n /**\n * Messages from the server, already translated. A field's message\n * shows on that field until the user changes it; `form` shows above\n * the fields.\n *\n * When messages arrive, the password is emptied and focus moves: to\n * the error summary at the top of the form, which lists each field\n * with a message, or, when only `form` says something, to the\n * password, which is then described by that message. The same happens\n * for messages present when the form opens (a page the server rendered\n * after a failed post).\n *\n * Never say which of the two values was wrong: one message for both.\n * Set `submitting` while you send, so the form also notices an answer\n * that says the same as the last one.\n */\n errors?: LoginFormErrors;\n /**\n * Adds \"Forgot password?\" under the password. A path on the same site,\n * or an address written in full (`https://…`). Anything else shows no\n * link. The same rule holds for the two addresses below.\n */\n forgotPasswordHref?: string;\n /**\n * Adds a \"Remember me on this computer\" box under the password, unticked\n * by default. Off unless you set this or name the box in\n * `fieldNames.rememberMe`. What \"remember\" means is the server's: the\n * kit only reports the box (`rememberMe` in `onSubmit`, or the posted\n * field).\n */\n showRememberMe?: boolean;\n /** Adds \"Register as a doctor\" under the button. */\n registerDoctorHref?: string;\n /** Adds \"Register as a patient\" under the button. */\n registerPatientHref?: string;\n /** Replaces the button's \"Sign in\". Pass it translated. */\n submitLabel?: string;\n /**\n * True while the host sends the values: the button shows a spinner and\n * a second submit is ignored. Set it inside `onSubmit`, before anything\n * is awaited: until it is true, a second press sends a second sign-in.\n */\n submitting?: boolean;\n /** For React hosts: called with the values once both checks have\n * passed. Not called when `fieldNames` is set. */\n onSubmit?: (values: LoginFormValues) => void;\n /**\n * For a native form post: the host's own field names, both of them,\n * e.g. `{ email: 'email', password: 'password' }`. When set, the inputs\n * carry these names and the browser posts the form. Add `rememberMe`\n * (e.g. `'_remember_me'`) to show the \"Remember me\" box: ticked, it posts\n * `<name>=on`; unticked, it posts nothing.\n */\n fieldNames?: LoginFormFieldNames;\n /**\n * Where a native form post goes. Default: the current address. Only a\n * path, or an address on the page's own origin, is accepted: another\n * origin is never sent what the user typed, and the post then goes to\n * the current address. Does nothing without `fieldNames`.\n */\n action?: string;\n /**\n * Extra hidden inputs posted with a native form, by name: a CSRF token,\n * a return address. Not used with `onSubmit`. A name that is also one\n * of `fieldNames` is left out: the form's own field wins. The server\n * must check a return address itself: anyone can change a hidden input.\n */\n hiddenFields?: Readonly<Record<string, string>>;\n /**\n * A second card beside the sign-in, the same height: the development\n * quick sign-in (`LoginDevCard`). Pass it only when the server says\n * this is a development environment: the kit never decides that\n * itself. The two sit side by side where there is room and stack on a\n * phone.\n */\n devCard?: ReactNode;\n}\n\n/* -------------------------------------------------------------------- */\n/* Styles */\n/* -------------------------------------------------------------------- */\n\n// The card is 400px wide at most, written in px: a host whose root font\n// size is not 16px would stretch or squeeze a width in rem.\nconst loginFormVariants = cva(\n 'ds:flex ds:w-full ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-lg)] ds:text-start ds:text-[var(--foreground)] ds:lg:flex-row ds:lg:items-stretch',\n);\n\nconst columnVariants = cva('ds:w-full ds:max-w-[400px]');\n\n// The two ways to register, side by side where they fit. The row gap\n// keeps the links' 44px touch targets apart when they wrap.\nconst registerLinksVariants = cva(\n 'ds:flex ds:flex-wrap ds:justify-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-lg)]',\n);\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** An address a link may use, or nothing. */\nconst linkTo = (href: string | undefined): string | undefined =>\n href && isSafeHref(href) ? href : undefined;\n\nconst hasMessage = (errors: LoginFormErrors): boolean =>\n Object.values(errors).some(Boolean);\n\nconst hasFieldMessage = (errors: LoginFormErrors): boolean =>\n LOGIN_FORM_FIELDS.some((field) => Boolean(errors[field]));\n\n/**\n * Where to send the user for a set of server messages: the first field\n * that has one. A message about the whole form sends them to the\n * password, the field they will have to type again.\n */\nconst focusTargetFor = (\n messages: LoginFormErrors,\n): LoginFormField | undefined =>\n LOGIN_FORM_FIELDS.find((field) => messages[field]) ??\n (messages.form ? 'password' : undefined);\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\n/**\n * The sign-in card. Mount it on the login page, inside `SignedOutFrame`\n * or the host's own chrome.\n */\nexport const LoginForm = forwardRef<HTMLDivElement, LoginFormProps>(\n (\n {\n title,\n description,\n headingLevel = 1,\n showLogo = true,\n logoMotion = 'assemble',\n children,\n initialValues,\n allowUsername = false,\n errors,\n forgotPasswordHref,\n showRememberMe = false,\n registerDoctorHref,\n registerPatientHref,\n submitLabel,\n submitting = false,\n onSubmit,\n fieldNames,\n action,\n hiddenFields,\n devCard,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const titleId = useId();\n const formMessageId = useId();\n const fieldIdBase = useId();\n /** The id of a field's wrapper: where the summary's link leads. */\n const fieldId = (field: LoginFormField) => `${fieldIdBase}-${field}`;\n const native = fieldNames !== undefined;\n\n /* ------------------------------ State ----------------------------- */\n\n // Read once. The password always starts empty.\n const [email, setEmail] = useState(() => initialValues?.email ?? '');\n const [password, setPassword] = useState('');\n const [rememberMe, setRememberMe] = useState(\n () => initialValues?.rememberMe === true,\n );\n const rememberShown = showRememberMe || Boolean(fieldNames?.rememberMe);\n const rememberUnnamed = native && rememberShown && !fieldNames?.rememberMe;\n useEffect(() => {\n if (rememberUnnamed && isDevelopment()) {\n console.warn(\n 'LoginForm: the remember-me box is shown but `fieldNames.rememberMe` is not set, so the server will not read it.',\n );\n }\n }, [rememberUnnamed]);\n // A field the user has filled in and left. An email that arrives\n // filled in counts: a bad one is then flagged at once, with its\n // message. An empty field is not flagged for being passed through: a\n // keyboard user on the way to \"Forgot password?\" has made no mistake.\n // Its message waits for a submit.\n const [touched, setTouched] = useState<\n Partial<Record<LoginFormField, boolean>>\n >(() => ({ email: Boolean(initialValues?.email) }));\n const [submitted, setSubmitted] = useState(false);\n const [serverErrors, setServerErrors] = useState<LoginFormErrors>(\n () => errors ?? {},\n );\n\n const leave = (field: LoginFormField) =>\n setTouched((previous) =>\n previous[field] ? previous : { ...previous, [field]: true },\n );\n // The server's message was about the old value.\n const forget = (field: LoginFormField) =>\n setServerErrors((previous) =>\n previous[field] ? { ...previous, [field]: undefined } : previous,\n );\n\n const emailInput = useRef<HTMLInputElement>(null);\n const passwordInput = useRef<HTMLInputElement>(null);\n // The address stays out of the input's `value` attribute, where a\n // copied outerHTML or a session replay could read it.\n const emailField = useStateBackedInput(email, emailInput);\n\n const emptyPassword = () => {\n setPassword('');\n setTouched((previous) => ({ ...previous, password: false }));\n };\n /**\n * What the two inputs hold now. Read from the inputs, not from state:\n * a browser or a password manager can fill a field without telling\n * React, and the form must not refuse a field that is visibly filled.\n */\n const held = (): LoginFormValues => {\n // Outer spaces are never sent: a server that compares the address or\n // the username exactly would refuse them. Written back into the field\n // so a native post sends the same text. The password is left as typed.\n const typedEmail = emailInput.current?.value ?? email;\n if (typedEmail.trim() !== typedEmail) {\n writeInputValue(emailInput.current, typedEmail.trim());\n }\n const values: LoginFormValues = {\n email: typedEmail.trim(),\n password: passwordInput.current?.value ?? password,\n rememberMe: rememberShown && rememberMe,\n };\n if (values.email !== email) setEmail(values.email);\n if (values.password !== password) setPassword(values.password);\n return values;\n };\n\n /* ---------------------------- Validation -------------------------- */\n\n // One rule for the message, the red mark and the submit: with\n // `allowUsername`, text without an \"@\" only has to be there.\n // Checked without outer spaces, as a type=\"email\" field does.\n const emailRefused = (value: string) => {\n const text = value.trim();\n return (\n text === '' ||\n ((!allowUsername || /[@\\uFF20\\uFE6B]/.test(text)) && !isEmail(text))\n );\n };\n /** What stops a submit, whether or not the message shows yet. The\n * password only has to be there: its rules are for a new password. */\n const invalid: Record<LoginFormField, boolean> = {\n email: emailRefused(email),\n password: password === '',\n };\n // A message shows once the user has filled in and left the field, or\n // tried to submit.\n const due = (field: LoginFormField) => submitted || touched[field] === true;\n const ownErrors: Record<LoginFormField, string | undefined> = {\n email:\n due('email') && invalid.email\n ? email.trim() === ''\n ? t('loginForm.emailRequired')\n : t('inputs.email.invalid')\n : undefined,\n password:\n due('password') && invalid.password\n ? t('loginForm.passwordRequired')\n : undefined,\n };\n const errorFor = (field: LoginFormField) =>\n serverErrors[field] ?? ownErrors[field];\n\n /* ------------------------------ Focus ----------------------------- */\n\n // Every field with a message after a refused submit, or after a server\n // answer, is listed at the top of the form, and focus goes there. A\n // page the server rendered after a failed post opens that way too: it\n // announces nothing itself.\n const [openedWithFieldMessage] = useState(() =>\n hasFieldMessage(errors ?? {}),\n );\n const summary = useErrorSummary(\n LOGIN_FORM_FIELDS,\n errorFor,\n openedWithFieldMessage,\n );\n\n // Any other place focus goes: the password, when only the message\n // about the whole form says something. A new object for each request,\n // so asking twice for the same place moves focus twice. The effect runs\n // after the messages are drawn, so a screen reader lands on something\n // that already says what is wrong.\n const [focusRequest, setFocusRequest] = useState<{\n target: LoginFormField;\n } | null>(() => {\n const target = openedWithFieldMessage\n ? undefined\n : focusTargetFor(errors ?? {});\n return target ? { target } : null;\n });\n useEffect(() => {\n if (!focusRequest) return;\n (focusRequest.target === 'email'\n ? emailInput\n : passwordInput\n ).current?.focus();\n }, [focusRequest]);\n\n /* ------------------------------ Submit ---------------------------- */\n\n const submit = useRegistrationSubmit<LoginFormField>({\n errors,\n submitting,\n native,\n captcha: false,\n firstProblem: () => {\n const values = held();\n if (emailRefused(values.email)) return 'email';\n return values.password === '' ? 'password' : undefined;\n },\n onRefused: (field) => {\n // Both messages now show, listed in the summary, which takes focus.\n setSubmitted(true);\n summary.open(() => setFocusRequest({ target: field }));\n },\n // Only a React host gets here: a native post is the browser's own.\n deliver: () => onSubmit?.(held()),\n onAnswer: (answer) => {\n const next: LoginFormErrors = answer;\n setServerErrors(next);\n if (!hasMessage(next)) return;\n // Never keep a password the server did not accept.\n emptyPassword();\n setSubmitted(false);\n // The summary when a field has a message, else the password.\n summary.open(() => {\n const target = focusTargetFor(next);\n if (target) setFocusRequest({ target });\n });\n },\n // The page came back from the browser's cache as it was left: the\n // password must not come back with it.\n onRestore: emptyPassword,\n });\n const { busy } = submit;\n\n /* ------------------------------ Render ---------------------------- */\n\n const formAction = useFormAction('LoginForm', native, action);\n const forgotLink = linkTo(forgotPasswordHref);\n const doctorLink = linkTo(registerDoctorHref);\n const patientLink = linkTo(registerPatientHref);\n const extraFields = useExtraFields(\n 'LoginForm',\n native,\n fieldNames,\n hiddenFields,\n );\n const formError = serverErrors.form;\n // Quiet while the summary lists a field: the summary reads it then.\n const formMessageAnnounce = useFormMessageAnnounce(\n formError,\n summary.listed.length > 0,\n );\n\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"login-form\"\n className={loginFormVariants({ className })}\n >\n <div className={columnVariants()}>\n <Card variant=\"elevated\" className=\"ds:h-full\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <AuthCardHeading\n id={titleId}\n title={title ?? t('loginForm.title')}\n description={description}\n level={headingLevel}\n showLogo={showLogo}\n logoMotion={logoMotion}\n />\n\n {children ? (\n <div\n data-slot=\"host-content\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n {children}\n </div>\n ) : null}\n\n {/* Always POST, in both modes: should the script ever fail to\n run, the browser must not put a password in the address. */}\n <form\n noValidate\n method=\"post\"\n action={formAction}\n aria-labelledby={titleId}\n aria-busy={busy || undefined}\n onSubmit={submit.handleSubmit}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n <ErrorSummary\n ref={summary.ref}\n headingLevel={(headingLevel + 1) as 2 | 3 | 4}\n // The message about the whole form is read with it.\n aria-describedby={formError ? formMessageId : undefined}\n errors={summary.listed.map((field) => ({\n field,\n message: errorFor(field) ?? '',\n targetId: fieldId(field),\n }))}\n />\n\n {formError && (\n <AuthFormMessage\n id={formMessageId}\n announce={formMessageAnnounce}\n >\n {formError}\n </AuthFormMessage>\n )}\n\n <FormField\n id={fieldId('email')}\n label={t('loginForm.email')}\n required\n error={errorFor('email')}\n // Quiet while the summary lists it: the summary reads it.\n announceError={!summary.lists('email')}\n data-field=\"email\"\n >\n {/* One check, above, drives the message, the red mark and\n aria-invalid through FormField. EmailInput's own check\n is off so the two cannot disagree. `username` is the\n name browsers and password managers give the field\n that goes with `current-password`. */}\n {allowUsername ? (\n // A plain text field: a type=\"email\" field holding a\n // username is \"invalid\" to a screen reader, whatever\n // `noValidate` says.\n <TextInput\n ref={emailField.ref}\n name={native ? fieldNames.email : 'email'}\n type=\"text\"\n inputMode=\"email\"\n autoComplete=\"username\"\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n spellCheck={false}\n onChange={emailField.quiet((event) => {\n setEmail(event.target.value);\n forget('email');\n })}\n onBlur={(event) => {\n const typed = event.target.value.trim();\n setEmail(typed);\n if (typed !== '') leave('email');\n }}\n />\n ) : (\n <EmailInput\n ref={emailField.ref}\n name={native ? fieldNames.email : 'email'}\n autoComplete=\"username\"\n disableBuiltInValidation\n onChange={emailField.quiet((event) => {\n setEmail(event.target.value);\n forget('email');\n })}\n onBlur={(event) => {\n // Whatever a browser filled in without saying so,\n // without outer spaces.\n const typed = event.target.value.trim();\n setEmail(typed);\n if (typed !== '') leave('email');\n }}\n />\n )}\n </FormField>\n\n <FormField\n id={fieldId('password')}\n label={t('loginForm.password')}\n required\n error={errorFor('password')}\n announceError={!summary.lists('password')}\n data-field=\"password\"\n >\n {/* Described by the message above the fields when there is\n one: focus lands here after a refused sign-in, and a\n screen reader then reads why. */}\n <PasswordInput\n ref={passwordInput}\n name={native ? fieldNames.password : 'password'}\n autoComplete=\"current-password\"\n aria-describedby={formError ? formMessageId : undefined}\n value={password}\n onChange={(event) => {\n setPassword(event.target.value);\n forget('password');\n }}\n onBlur={(event) => {\n setPassword(event.target.value);\n if (event.target.value !== '') leave('password');\n }}\n />\n </FormField>\n\n {forgotLink && (\n <AuthTextLink\n href={forgotLink}\n action=\"forgot-password\"\n align=\"end\"\n >\n {t('loginForm.forgot')}\n </AuthTextLink>\n )}\n\n {rememberShown && (\n <div data-field=\"remember-me\">\n {/* No `value`: a ticked box posts `on`, which is what\n a server's remember-me reads. */}\n <Checkbox\n name={\n native\n ? fieldNames.rememberMe || 'rememberMe'\n : 'rememberMe'\n }\n checked={rememberMe}\n onCheckedChange={(next) => setRememberMe(next === true)}\n label={t('loginForm.rememberMe')}\n />\n </div>\n )}\n\n <ExtraFields fields={extraFields} />\n\n <Button\n type=\"submit\"\n intent=\"primary\"\n size=\"lg\"\n loading={busy}\n className=\"ds:w-full\"\n data-action=\"submit\"\n >\n {submitLabel ?? t('loginForm.submit')}\n </Button>\n </form>\n\n {/* Outside the form: they lead to other pages and post\n nothing. The header's own labels, already translated. */}\n {(doctorLink || patientLink) && (\n <div\n data-slot=\"register-links\"\n className={registerLinksVariants()}\n >\n {doctorLink && (\n <AuthTextLink href={doctorLink} action=\"register-doctor\">\n {t('signedOutHeader.registerDoctor')}\n </AuthTextLink>\n )}\n {patientLink && (\n <AuthTextLink href={patientLink} action=\"register-patient\">\n {t('signedOutHeader.registerPatient')}\n </AuthTextLink>\n )}\n </div>\n )}\n {/* Outside the form: a screen reader may hold back what\n changes inside a busy region. */}\n <AuthFormStatus busy={busy} />\n </Card.Body>\n </Card>\n </div>\n {devCard ? <div className={columnVariants()}>{devCard}</div> : null}\n </div>\n );\n },\n);\nLoginForm.displayName = 'LoginForm';\n","/* -------------------------------------------------------------------- */\n/* LoginDevCard — the development quick sign-in card. */\n/* */\n/* A second card beside the login, for developers: one link per test */\n/* account the host's server can sign in. The kit only draws it. The */\n/* host decides whether it is rendered, supplies every word on it, and */\n/* its server must refuse the routes outside development. */\n/* -------------------------------------------------------------------- */\n\nimport { forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { Button } from '../../components/button';\nimport { Card } from '../../components/card';\nimport { MatrixRain } from '../../components/matrix-rain';\nimport { isSafeHref } from '../../components/_shared/safe-href';\nimport { ErrorPageIllustration } from '../error-page/error-page-illustration';\n\nexport interface LoginDevOption {\n /** The link's text, e.g. \"Sign in as admin\". The host supplies it, so\n * the kit ships no text for a card that users never see. */\n label: string;\n /** The development-only route that signs the test account in. A path\n * on the same site, or an address written in full. */\n href: string;\n /** A Lucide icon for the link, passed bare: `<ShieldUser />`. */\n icon?: ReactNode;\n}\n\nexport interface LoginDevCardProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /** The card's heading, e.g. \"Developer quick login\". */\n title: string;\n /** One link per test account. An option with an unsafe address is\n * left out. */\n options: readonly LoginDevOption[];\n /** The heading's level. Default 2, under the login's own heading. */\n headingLevel?: 2 | 3;\n}\n\n// As tall as the login beside it, so the two cards read as a pair.\nconst loginDevCardVariants = cva('ds:h-full ds:w-full');\n\n/**\n * The development quick sign-in card. Render it only when the server\n * says this is a development environment: it never checks the\n * environment itself. Pass it to `LoginForm` as `devCard`.\n */\nexport const LoginDevCard = forwardRef<HTMLDivElement, LoginDevCardProps>(\n ({ title, options, headingLevel = 2, className, ...rest }, ref) => {\n const titleId = useId();\n const Heading = `h${headingLevel}` as const;\n const links = options.filter((option) => isSafeHref(option.href));\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"login-dev-card\"\n className={loginDevCardVariants({ className })}\n >\n <Card\n variant=\"elevated\"\n aria-labelledby={titleId}\n className=\"ds:relative ds:isolate ds:flex ds:h-full ds:flex-col ds:overflow-hidden\"\n >\n {/* Code rain round the edges, clear in the middle so it never runs\n behind the links. MatrixRain holds still under reduced motion by\n itself; it does not know the accessible themes, so the rain is\n taken out there, like the kit's other decorative motion. */}\n <div className=\"ds:absolute ds:inset-0 ds:z-0 ds:[display:var(--accessible-off,block)]\">\n <MatrixRain\n glyphs=\"hex\"\n decay=\"fast\"\n mask=\"center\"\n maskRadius=\"xl\"\n className=\"ds:size-full\"\n />\n </div>\n <Card.Header className=\"ds:relative ds:z-[1]\">\n <div className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)] ds:text-center\">\n {/* The melting mark from the error pages, at half its size\n there. */}\n <div className=\"ds:[&>div]:w-24\">\n <ErrorPageIllustration mood=\"melt\" />\n </div>\n <Heading\n id={titleId}\n className=\"type-title-card ds:text-[var(--foreground)]\"\n >\n {title}\n </Heading>\n </div>\n </Card.Header>\n <Card.Body className=\"ds:relative ds:z-[1] ds:flex ds:flex-1 ds:flex-col ds:justify-center\">\n {/* The top margin keeps the heading clear of the links when the\n cards stack and this one is only as tall as its content. */}\n <div className=\"ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {links.map((option, index) => (\n <Button\n // Two options may share an address, so the place in the\n // list is part of the key.\n key={`${index}:${option.href}`}\n asChild\n intent=\"primary\"\n startIcon={option.icon}\n className=\"ds:min-h-[var(--min-target-size)] ds:w-full\"\n >\n <a href={option.href} data-action=\"dev-login\">\n {option.label}\n </a>\n </Button>\n ))}\n </div>\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\nLoginDevCard.displayName = 'LoginDevCard';\n"],"names":["LOGIN_FORM_FIELDS","loginFormVariants","cva","columnVariants","registerLinksVariants","linkTo","href","isSafeHref","hasMessage","errors","hasFieldMessage","field","focusTargetFor","messages","LoginForm","forwardRef","title","description","headingLevel","showLogo","logoMotion","children","initialValues","allowUsername","forgotPasswordHref","showRememberMe","registerDoctorHref","registerPatientHref","submitLabel","submitting","onSubmit","fieldNames","action","hiddenFields","devCard","className","rest","ref","t","useTranslation","titleId","useId","formMessageId","fieldIdBase","fieldId","native","email","setEmail","useState","password","setPassword","rememberMe","setRememberMe","rememberShown","rememberUnnamed","useEffect","isDevelopment","touched","setTouched","submitted","setSubmitted","serverErrors","setServerErrors","leave","previous","forget","emailInput","useRef","passwordInput","emailField","useStateBackedInput","emptyPassword","held","typedEmail","_a","writeInputValue","values","_b","emailRefused","value","text","isEmail","invalid","due","ownErrors","errorFor","openedWithFieldMessage","summary","useErrorSummary","focusRequest","setFocusRequest","target","submit","useRegistrationSubmit","answer","next","busy","formAction","useFormAction","forgotLink","doctorLink","patientLink","extraFields","useExtraFields","formError","formMessageAnnounce","useFormMessageAnnounce","jsxs","jsx","Card","AuthCardHeading","ErrorSummary","AuthFormMessage","FormField","TextInput","event","typed","EmailInput","PasswordInput","AuthTextLink","Checkbox","ExtraFields","Button","AuthFormStatus","loginDevCardVariants","LoginDevCard","options","Heading","links","option","MatrixRain","ErrorPageIllustration","index"],"mappings":";;;;;;;;;;;;;;;;;;;AA8DO,MAAMA,IAAoB,CAAC,SAAS,UAAU,GA8J/CC,KAAoBC;AAAA,EACxB;AACF,GAEMC,KAAiBD,EAAI,4BAA4B,GAIjDE,KAAwBF;AAAA,EAC5B;AACF,GAOMG,IAAS,CAACC,MACdA,KAAQC,GAAWD,CAAI,IAAIA,IAAO,QAE9BE,KAAa,CAACC,MAClB,OAAO,OAAOA,CAAM,EAAE,KAAK,OAAO,GAE9BC,KAAkB,CAACD,MACvBT,EAAkB,KAAK,CAACW,MAAU,EAAQF,EAAOE,CAAK,CAAE,GAOpDC,KAAiB,CACrBC,MAEAb,EAAkB,KAAK,CAACW,MAAUE,E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V,UAAA;AAAA,cAAA,gBAAAoE,EAAC,OAAA,EAAI,WAAU,0EACb,UAAA,gBAAAA;AAAA,gBAACsB;AAAA,gBAAA;AAAA,kBACC,QAAO;AAAA,kBACP,OAAM;AAAA,kBACN,MAAK;AAAA,kBACL,YAAW;AAAA,kBACX,WAAU;AAAA,gBAAA;AAAA,cAAA,GAEd;AAAA,cACA,gBAAAtB,EAACC,EAAK,QAAL,EAAY,WAAU,wBACrB,UAAA,gBAAAF,EAAC,OAAA,EAAI,WAAU,iFAGb,UAAA;AAAA,gBAAA,gBAAAC,EAAC,SAAI,WAAU,mBACb,4BAACuB,IAAA,EAAsB,MAAK,QAAO,EAAA,CACrC;AAAA,gBACA,gBAAAvB;AAAA,kBAACmB;AAAA,kBAAA;AAAA,oBACC,IAAIvF;AAAA,oBACJ,WAAU;AAAA,oBAET,UAAAxB;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACH,EAAA,CACF,EAAA,CACF;AAAA,cACA,gBAAA4F,EAACC,EAAK,MAAL,EAAU,WAAU,wEAGnB,UAAA,gBAAAD,EAAC,OAAA,EAAI,WAAU,4EACZ,UAAAoB,EAAM,IAAI,CAACC,GAAQG,MAClB,gBAAAxB;AAAA,gBAACc;AAAA,gBAAA;AAAA,kBAIC,SAAO;AAAA,kBACP,QAAO;AAAA,kBACP,WAAWO,EAAO;AAAA,kBAClB,WAAU;AAAA,kBAEV,UAAA,gBAAArB,EAAC,OAAE,MAAMqB,EAAO,MAAM,eAAY,aAC/B,YAAO,MAAA,CACV;AAAA,gBAAA;AAAA,gBARK,GAAGG,CAAK,IAAIH,EAAO,IAAI;AAAA,cAAA,CAU/B,GACH,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACAJ,GAAa,cAAc;"}
1
+ {"version":3,"file":"login-dev-card-B6-zCFq3.js","sources":["../../src/patterns/login-form/login-form.tsx","../../src/patterns/login-form/login-dev-card.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* LoginForm — the sign-in card. */\n/* */\n/* One export for the card: the mark, the heading, email and password, */\n/* the way to a new password, the button and the ways to register. The */\n/* host keeps the page around it and every server rule. The card checks */\n/* what a browser can check, then hands the values to `onSubmit` or */\n/* posts a real form to the host's own field names. */\n/* */\n/* By default the email must be an email address. A host whose server */\n/* also signs people in by a username sets `allowUsername`: the email */\n/* format is then checked only when the text contains an \"@\". */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\n// The validator EmailInput itself uses, so the two never disagree.\nimport isEmail from 'validator/lib/isEmail';\nimport { Button } from '../../components/button';\nimport { Checkbox } from '../../components/checkbox';\nimport { Card } from '../../components/card';\nimport { EmailInput } from '../../components/email-input';\nimport { TextInput } from '../../components/text-input';\nimport { ErrorSummary } from '../../components/error-summary';\nimport { FormField } from '../../components/form-field';\nimport { PasswordInput } from '../../components/password-input';\nimport { isDevelopment } from '../../components/_shared/is-development';\nimport { isSafeHref } from '../../components/_shared/safe-href';\nimport {\n useStateBackedInput,\n writeInputValue,\n} from '../../components/_shared/use-state-backed-input';\nimport {\n AuthCardHeading,\n AuthFormMessage,\n AuthFormStatus,\n AuthTextLink,\n ExtraFields,\n useExtraFields,\n useFormAction,\n} from '../_shared/auth-form-parts';\nimport type { BrandMarkMotion } from '../_shared/brand-mark';\nimport {\n useErrorSummary,\n useFormMessageAnnounce,\n} from '../_shared/use-error-summary';\nimport { useRegistrationSubmit } from '../registration-form/use-registration-submit';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\n/** The fields of the form, in the order they appear. */\nexport const LOGIN_FORM_FIELDS = ['email', 'password'] as const;\n\nexport type LoginFormField = (typeof LOGIN_FORM_FIELDS)[number];\n\n/** What `onSubmit` receives once both checks have passed. */\nexport interface LoginFormValues {\n email: string;\n password: string;\n /** True when the \"Remember me\" box is ticked. Always false when the\n * box is not shown. */\n rememberMe: boolean;\n}\n\n/** Values to show when the form opens. There is no password here, on\n * purpose: a password is never sent back to the browser. */\nexport type LoginFormInitialValues = Partial<\n Pick<LoginFormValues, 'email' | 'rememberMe'>\n>;\n\n/** Messages from the server, already translated: one per field, plus\n * `form` for a message about the whole form, such as \"the email or\n * password is incorrect\". */\nexport type LoginFormErrors = Partial<Record<LoginFormField | 'form', string>>;\n\n/** The host's own form field names, for a native form post. `email` and\n * `password` are needed: a field without a name is not posted.\n * `rememberMe` is optional and also turns the \"Remember me\" box on. */\nexport type LoginFormFieldNames = Record<LoginFormField, string> & {\n rememberMe?: string;\n};\n\nexport interface LoginFormProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'onSubmit'\n> {\n /** Replaces the heading \"Sign in to Alfadocs\". Pass it translated. */\n title?: string;\n /** A line under the heading. Pass it translated. */\n description?: string;\n /**\n * The heading's level. Default 1: a sign-in page usually has no other\n * heading. Pass 2 on a page that has its own `h1`.\n */\n headingLevel?: 1 | 2 | 3;\n /**\n * Shows the Alfadocs mark above the heading, with the heading and its\n * line centred under it. Default true. With `false` the heading sits\n * at the start edge, for a host that shows its own logo.\n */\n showLogo?: boolean;\n /**\n * How the mark arrives when the card opens: its pieces come together\n * (`assemble`, the default), it turns once (`spin`), it beats\n * (`pulse`), or it is still (`none`). It plays once and rests, and\n * holds still under reduced motion and in the accessible themes.\n */\n logoMotion?: BrandMarkMotion;\n /**\n * Host content between the heading and the fields, such as a notice\n * (\"You have been signed out\"). It sits outside the form, so nothing in\n * it is posted. Keep any heading inside it below the card's own level.\n */\n children?: ReactNode;\n /**\n * For hosts whose server also signs people in by a username. The first\n * field is still labelled \"Email\", but text without an \"@\" is accepted as\n * a username: it only has to be filled in. Text with an \"@\" must be a\n * valid email address, as when this is off. Default false.\n */\n allowUsername?: boolean;\n /** The email to show when the form opens, such as the one last used,\n * and whether \"Remember me\" starts ticked (default false). Read once.\n * There is never an initial password. */\n initialValues?: LoginFormInitialValues;\n /**\n * Messages from the server, already translated. A field's message\n * shows on that field until the user changes it; `form` shows above\n * the fields.\n *\n * When messages arrive, the password is emptied and focus moves: to\n * the error summary at the top of the form, which lists each field\n * with a message, or, when only `form` says something, to the\n * password, which is then described by that message. The same happens\n * for messages present when the form opens (a page the server rendered\n * after a failed post).\n *\n * Never say which of the two values was wrong: one message for both.\n * Set `submitting` while you send, so the form also notices an answer\n * that says the same as the last one.\n */\n errors?: LoginFormErrors;\n /**\n * Adds \"Forgot password?\" under the password. A path on the same site,\n * or an address written in full (`https://…`). Anything else shows no\n * link. The same rule holds for the two addresses below.\n */\n forgotPasswordHref?: string;\n /**\n * Adds a \"Remember me on this computer\" box under the password, unticked\n * by default. Off unless you set this or name the box in\n * `fieldNames.rememberMe`. What \"remember\" means is the server's: the\n * kit only reports the box (`rememberMe` in `onSubmit`, or the posted\n * field).\n */\n showRememberMe?: boolean;\n /** Adds \"Register as a doctor\" under the button. */\n registerDoctorHref?: string;\n /** Adds \"Register as a patient\" under the button. */\n registerPatientHref?: string;\n /** Replaces the button's \"Sign in\". Pass it translated. */\n submitLabel?: string;\n /**\n * True while the host sends the values: the button shows a spinner and\n * a second submit is ignored. Set it inside `onSubmit`, before anything\n * is awaited: until it is true, a second press sends a second sign-in.\n */\n submitting?: boolean;\n /** For React hosts: called with the values once both checks have\n * passed. Not called when `fieldNames` is set. */\n onSubmit?: (values: LoginFormValues) => void;\n /**\n * For a native form post: the host's own field names, both of them,\n * e.g. `{ email: 'email', password: 'password' }`. When set, the inputs\n * carry these names and the browser posts the form. Add `rememberMe`\n * (e.g. `'_remember_me'`) to show the \"Remember me\" box: ticked, it posts\n * `<name>=on`; unticked, it posts nothing.\n */\n fieldNames?: LoginFormFieldNames;\n /**\n * Where a native form post goes. Default: the current address. Only a\n * path, or an address on the page's own origin, is accepted: another\n * origin is never sent what the user typed, and the post then goes to\n * the current address. Does nothing without `fieldNames`.\n */\n action?: string;\n /**\n * Extra hidden inputs posted with a native form, by name: a CSRF token,\n * a return address. Not used with `onSubmit`. A name that is also one\n * of `fieldNames` is left out: the form's own field wins. The server\n * must check a return address itself: anyone can change a hidden input.\n */\n hiddenFields?: Readonly<Record<string, string>>;\n /**\n * A second card beside the sign-in, the same height: the development\n * quick sign-in (`LoginDevCard`). Pass it only when the server says\n * this is a development environment: the kit never decides that\n * itself. The two sit side by side where there is room and stack on a\n * phone.\n */\n devCard?: ReactNode;\n}\n\n/* -------------------------------------------------------------------- */\n/* Styles */\n/* -------------------------------------------------------------------- */\n\n// The card is 400px wide at most, written in px: a host whose root font\n// size is not 16px would stretch or squeeze a width in rem.\nconst loginFormVariants = cva(\n 'ds:flex ds:w-full ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-lg)] ds:text-start ds:text-[var(--foreground)] ds:lg:flex-row ds:lg:items-stretch',\n);\n\nconst columnVariants = cva('ds:w-full ds:max-w-[400px]');\n\n// The two ways to register, side by side where they fit. The row gap\n// keeps the links' 44px touch targets apart when they wrap.\nconst registerLinksVariants = cva(\n 'ds:flex ds:flex-wrap ds:justify-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-lg)]',\n);\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** An address a link may use, or nothing. */\nconst linkTo = (href: string | undefined): string | undefined =>\n href && isSafeHref(href) ? href : undefined;\n\nconst hasMessage = (errors: LoginFormErrors): boolean =>\n Object.values(errors).some(Boolean);\n\nconst hasFieldMessage = (errors: LoginFormErrors): boolean =>\n LOGIN_FORM_FIELDS.some((field) => Boolean(errors[field]));\n\n/**\n * Where to send the user for a set of server messages: the first field\n * that has one. A message about the whole form sends them to the\n * password, the field they will have to type again.\n */\nconst focusTargetFor = (\n messages: LoginFormErrors,\n): LoginFormField | undefined =>\n LOGIN_FORM_FIELDS.find((field) => messages[field]) ??\n (messages.form ? 'password' : undefined);\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\n/**\n * The sign-in card. Mount it on the login page, inside `SignedOutFrame`\n * or the host's own chrome.\n */\nexport const LoginForm = forwardRef<HTMLDivElement, LoginFormProps>(\n (\n {\n title,\n description,\n headingLevel = 1,\n showLogo = true,\n logoMotion = 'assemble',\n children,\n initialValues,\n allowUsername = false,\n errors,\n forgotPasswordHref,\n showRememberMe = false,\n registerDoctorHref,\n registerPatientHref,\n submitLabel,\n submitting = false,\n onSubmit,\n fieldNames,\n action,\n hiddenFields,\n devCard,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const titleId = useId();\n const formMessageId = useId();\n const fieldIdBase = useId();\n /** The id of a field's wrapper: where the summary's link leads. */\n const fieldId = (field: LoginFormField) => `${fieldIdBase}-${field}`;\n const native = fieldNames !== undefined;\n\n /* ------------------------------ State ----------------------------- */\n\n // Read once. The password always starts empty.\n const [email, setEmail] = useState(() => initialValues?.email ?? '');\n const [password, setPassword] = useState('');\n const [rememberMe, setRememberMe] = useState(\n () => initialValues?.rememberMe === true,\n );\n const rememberShown = showRememberMe || Boolean(fieldNames?.rememberMe);\n const rememberUnnamed = native && rememberShown && !fieldNames?.rememberMe;\n useEffect(() => {\n if (rememberUnnamed && isDevelopment()) {\n console.warn(\n 'LoginForm: the remember-me box is shown but `fieldNames.rememberMe` is not set, so the server will not read it.',\n );\n }\n }, [rememberUnnamed]);\n // A field the user has filled in and left. An email that arrives\n // filled in counts: a bad one is then flagged at once, with its\n // message. An empty field is not flagged for being passed through: a\n // keyboard user on the way to \"Forgot password?\" has made no mistake.\n // Its message waits for a submit.\n const [touched, setTouched] = useState<\n Partial<Record<LoginFormField, boolean>>\n >(() => ({ email: Boolean(initialValues?.email) }));\n const [submitted, setSubmitted] = useState(false);\n const [serverErrors, setServerErrors] = useState<LoginFormErrors>(\n () => errors ?? {},\n );\n\n const leave = (field: LoginFormField) =>\n setTouched((previous) =>\n previous[field] ? previous : { ...previous, [field]: true },\n );\n // The server's message was about the old value.\n const forget = (field: LoginFormField) =>\n setServerErrors((previous) =>\n previous[field] ? { ...previous, [field]: undefined } : previous,\n );\n\n const emailInput = useRef<HTMLInputElement>(null);\n const passwordInput = useRef<HTMLInputElement>(null);\n // The address stays out of the input's `value` attribute, where a\n // copied outerHTML or a session replay could read it.\n const emailField = useStateBackedInput(email, emailInput);\n\n const emptyPassword = () => {\n setPassword('');\n setTouched((previous) => ({ ...previous, password: false }));\n };\n /**\n * What the two inputs hold now. Read from the inputs, not from state:\n * a browser or a password manager can fill a field without telling\n * React, and the form must not refuse a field that is visibly filled.\n */\n const held = (): LoginFormValues => {\n // Outer spaces are never sent: a server that compares the address or\n // the username exactly would refuse them. Written back into the field\n // so a native post sends the same text. The password is left as typed.\n const typedEmail = emailInput.current?.value ?? email;\n if (typedEmail.trim() !== typedEmail) {\n writeInputValue(emailInput.current, typedEmail.trim());\n }\n const values: LoginFormValues = {\n email: typedEmail.trim(),\n password: passwordInput.current?.value ?? password,\n rememberMe: rememberShown && rememberMe,\n };\n if (values.email !== email) setEmail(values.email);\n if (values.password !== password) setPassword(values.password);\n return values;\n };\n\n /* ---------------------------- Validation -------------------------- */\n\n // One rule for the message, the red mark and the submit: with\n // `allowUsername`, text without an \"@\" only has to be there.\n // Checked without outer spaces, as a type=\"email\" field does.\n const emailRefused = (value: string) => {\n const text = value.trim();\n return (\n text === '' ||\n ((!allowUsername || /[@\\uFF20\\uFE6B]/.test(text)) && !isEmail(text))\n );\n };\n /** What stops a submit, whether or not the message shows yet. The\n * password only has to be there: its rules are for a new password. */\n const invalid: Record<LoginFormField, boolean> = {\n email: emailRefused(email),\n password: password === '',\n };\n // A message shows once the user has filled in and left the field, or\n // tried to submit.\n const due = (field: LoginFormField) => submitted || touched[field] === true;\n const ownErrors: Record<LoginFormField, string | undefined> = {\n email:\n due('email') && invalid.email\n ? email.trim() === ''\n ? t('loginForm.emailRequired')\n : t('inputs.email.invalid')\n : undefined,\n password:\n due('password') && invalid.password\n ? t('loginForm.passwordRequired')\n : undefined,\n };\n const errorFor = (field: LoginFormField) =>\n serverErrors[field] ?? ownErrors[field];\n\n /* ------------------------------ Focus ----------------------------- */\n\n // Every field with a message after a refused submit, or after a server\n // answer, is listed at the top of the form, and focus goes there. A\n // page the server rendered after a failed post opens that way too: it\n // announces nothing itself.\n const [openedWithFieldMessage] = useState(() =>\n hasFieldMessage(errors ?? {}),\n );\n const summary = useErrorSummary(\n LOGIN_FORM_FIELDS,\n errorFor,\n openedWithFieldMessage,\n );\n\n // Any other place focus goes: the password, when only the message\n // about the whole form says something. A new object for each request,\n // so asking twice for the same place moves focus twice. The effect runs\n // after the messages are drawn, so a screen reader lands on something\n // that already says what is wrong.\n const [focusRequest, setFocusRequest] = useState<{\n target: LoginFormField;\n } | null>(() => {\n const target = openedWithFieldMessage\n ? undefined\n : focusTargetFor(errors ?? {});\n return target ? { target } : null;\n });\n useEffect(() => {\n if (!focusRequest) return;\n (focusRequest.target === 'email'\n ? emailInput\n : passwordInput\n ).current?.focus();\n }, [focusRequest]);\n\n /* ------------------------------ Submit ---------------------------- */\n\n const submit = useRegistrationSubmit<LoginFormField>({\n errors,\n submitting,\n native,\n captcha: false,\n firstProblem: () => {\n const values = held();\n if (emailRefused(values.email)) return 'email';\n return values.password === '' ? 'password' : undefined;\n },\n onRefused: (field) => {\n // Both messages now show, listed in the summary, which takes focus.\n setSubmitted(true);\n summary.open(() => setFocusRequest({ target: field }));\n },\n // Only a React host gets here: a native post is the browser's own.\n deliver: () => onSubmit?.(held()),\n onAnswer: (answer) => {\n const next: LoginFormErrors = answer;\n setServerErrors(next);\n if (!hasMessage(next)) return;\n // Never keep a password the server did not accept.\n emptyPassword();\n setSubmitted(false);\n // The summary when a field has a message, else the password.\n summary.open(() => {\n const target = focusTargetFor(next);\n if (target) setFocusRequest({ target });\n });\n },\n // The page came back from the browser's cache as it was left: the\n // password must not come back with it.\n onRestore: emptyPassword,\n });\n const { busy } = submit;\n\n /* ------------------------------ Render ---------------------------- */\n\n const formAction = useFormAction('LoginForm', native, action);\n const forgotLink = linkTo(forgotPasswordHref);\n const doctorLink = linkTo(registerDoctorHref);\n const patientLink = linkTo(registerPatientHref);\n const extraFields = useExtraFields(\n 'LoginForm',\n native,\n fieldNames,\n hiddenFields,\n );\n const formError = serverErrors.form;\n // Quiet while the summary lists a field: the summary reads it then.\n const formMessageAnnounce = useFormMessageAnnounce(\n formError,\n summary.listed.length > 0,\n );\n\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"login-form\"\n className={loginFormVariants({ className })}\n >\n <div className={columnVariants()}>\n <Card variant=\"elevated\" className=\"ds:h-full\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]\">\n <AuthCardHeading\n id={titleId}\n title={title ?? t('loginForm.title')}\n description={description}\n level={headingLevel}\n showLogo={showLogo}\n logoMotion={logoMotion}\n />\n\n {children ? (\n <div\n data-slot=\"host-content\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n {children}\n </div>\n ) : null}\n\n {/* Always POST, in both modes: should the script ever fail to\n run, the browser must not put a password in the address. */}\n <form\n noValidate\n method=\"post\"\n action={formAction}\n aria-labelledby={titleId}\n aria-busy={busy || undefined}\n onSubmit={submit.handleSubmit}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n >\n <ErrorSummary\n ref={summary.ref}\n headingLevel={(headingLevel + 1) as 2 | 3 | 4}\n // The message about the whole form is read with it.\n aria-describedby={formError ? formMessageId : undefined}\n errors={summary.listed.map((field) => ({\n field,\n message: errorFor(field) ?? '',\n targetId: fieldId(field),\n }))}\n />\n\n {formError && (\n <AuthFormMessage\n id={formMessageId}\n announce={formMessageAnnounce}\n >\n {formError}\n </AuthFormMessage>\n )}\n\n <FormField\n id={fieldId('email')}\n label={t('loginForm.email')}\n required\n error={errorFor('email')}\n // Quiet while the summary lists it: the summary reads it.\n announceError={!summary.lists('email')}\n data-field=\"email\"\n >\n {/* One check, above, drives the message, the red mark and\n aria-invalid through FormField. EmailInput's own check\n is off so the two cannot disagree. `username` is the\n name browsers and password managers give the field\n that goes with `current-password`. */}\n {allowUsername ? (\n // A plain text field: a type=\"email\" field holding a\n // username is \"invalid\" to a screen reader, whatever\n // `noValidate` says.\n <TextInput\n ref={emailField.ref}\n name={native ? fieldNames.email : 'email'}\n type=\"text\"\n inputMode=\"email\"\n autoComplete=\"username\"\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n spellCheck={false}\n onChange={emailField.quiet((event) => {\n setEmail(event.target.value);\n forget('email');\n })}\n onBlur={(event) => {\n const typed = event.target.value.trim();\n setEmail(typed);\n if (typed !== '') leave('email');\n }}\n />\n ) : (\n <EmailInput\n ref={emailField.ref}\n name={native ? fieldNames.email : 'email'}\n autoComplete=\"username\"\n disableBuiltInValidation\n onChange={emailField.quiet((event) => {\n setEmail(event.target.value);\n forget('email');\n })}\n onBlur={(event) => {\n // Whatever a browser filled in without saying so,\n // without outer spaces.\n const typed = event.target.value.trim();\n setEmail(typed);\n if (typed !== '') leave('email');\n }}\n />\n )}\n </FormField>\n\n <FormField\n id={fieldId('password')}\n label={t('loginForm.password')}\n required\n error={errorFor('password')}\n announceError={!summary.lists('password')}\n data-field=\"password\"\n >\n {/* Described by the message above the fields when there is\n one: focus lands here after a refused sign-in, and a\n screen reader then reads why. */}\n <PasswordInput\n ref={passwordInput}\n name={native ? fieldNames.password : 'password'}\n autoComplete=\"current-password\"\n aria-describedby={formError ? formMessageId : undefined}\n value={password}\n onChange={(event) => {\n setPassword(event.target.value);\n forget('password');\n }}\n onBlur={(event) => {\n setPassword(event.target.value);\n if (event.target.value !== '') leave('password');\n }}\n />\n </FormField>\n\n {forgotLink && (\n <AuthTextLink\n href={forgotLink}\n action=\"forgot-password\"\n align=\"end\"\n >\n {t('loginForm.forgot')}\n </AuthTextLink>\n )}\n\n {rememberShown && (\n <div data-field=\"remember-me\">\n {/* No `value`: a ticked box posts `on`, which is what\n a server's remember-me reads. */}\n <Checkbox\n name={\n native\n ? fieldNames.rememberMe || 'rememberMe'\n : 'rememberMe'\n }\n checked={rememberMe}\n onCheckedChange={(next) => setRememberMe(next === true)}\n label={t('loginForm.rememberMe')}\n />\n </div>\n )}\n\n <ExtraFields fields={extraFields} />\n\n <Button\n type=\"submit\"\n intent=\"primary\"\n size=\"lg\"\n loading={busy}\n className=\"ds:w-full\"\n data-action=\"submit\"\n >\n {submitLabel ?? t('loginForm.submit')}\n </Button>\n </form>\n\n {/* Outside the form: they lead to other pages and post\n nothing. The header's own labels, already translated. */}\n {(doctorLink || patientLink) && (\n <div\n data-slot=\"register-links\"\n className={registerLinksVariants()}\n >\n {doctorLink && (\n <AuthTextLink href={doctorLink} action=\"register-doctor\">\n {t('signedOutHeader.registerDoctor')}\n </AuthTextLink>\n )}\n {patientLink && (\n <AuthTextLink href={patientLink} action=\"register-patient\">\n {t('signedOutHeader.registerPatient')}\n </AuthTextLink>\n )}\n </div>\n )}\n {/* Outside the form: a screen reader may hold back what\n changes inside a busy region. */}\n <AuthFormStatus busy={busy} />\n </Card.Body>\n </Card>\n </div>\n {devCard ? <div className={columnVariants()}>{devCard}</div> : null}\n </div>\n );\n },\n);\nLoginForm.displayName = 'LoginForm';\n","/* -------------------------------------------------------------------- */\n/* LoginDevCard — the development quick sign-in card. */\n/* */\n/* A second card beside the login, for developers: one link per test */\n/* account the host's server can sign in. The kit only draws it. The */\n/* host decides whether it is rendered, supplies every word on it, and */\n/* its server must refuse the routes outside development. */\n/* -------------------------------------------------------------------- */\n\nimport { forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { Button } from '../../components/button';\nimport { Card } from '../../components/card';\nimport { MatrixRain } from '../../components/matrix-rain';\nimport { isSafeHref } from '../../components/_shared/safe-href';\nimport { ErrorPageIllustration } from '../error-page/error-page-illustration';\n\nexport interface LoginDevOption {\n /** The link's text, e.g. \"Sign in as admin\". The host supplies it, so\n * the kit ships no text for a card that users never see. */\n label: string;\n /** The development-only route that signs the test account in. A path\n * on the same site, or an address written in full. */\n href: string;\n /** A Lucide icon for the link, passed bare: `<ShieldUser />`. */\n icon?: ReactNode;\n}\n\nexport interface LoginDevCardProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /** The card's heading, e.g. \"Developer quick login\". */\n title: string;\n /** One link per test account. An option with an unsafe address is\n * left out. */\n options: readonly LoginDevOption[];\n /** The heading's level. Default 2, under the login's own heading. */\n headingLevel?: 2 | 3;\n}\n\n// As tall as the login beside it, so the two cards read as a pair.\nconst loginDevCardVariants = cva('ds:h-full ds:w-full');\n\n/**\n * The development quick sign-in card. Render it only when the server\n * says this is a development environment: it never checks the\n * environment itself. Pass it to `LoginForm` as `devCard`.\n */\nexport const LoginDevCard = forwardRef<HTMLDivElement, LoginDevCardProps>(\n ({ title, options, headingLevel = 2, className, ...rest }, ref) => {\n const titleId = useId();\n const Heading = `h${headingLevel}` as const;\n const links = options.filter((option) => isSafeHref(option.href));\n return (\n <div\n ref={ref}\n {...rest}\n data-component=\"login-dev-card\"\n className={loginDevCardVariants({ className })}\n >\n <Card\n variant=\"elevated\"\n aria-labelledby={titleId}\n className=\"ds:relative ds:isolate ds:flex ds:h-full ds:flex-col ds:overflow-hidden\"\n >\n {/* Code rain round the edges, clear in the middle so it never runs\n behind the links. MatrixRain holds still under reduced motion by\n itself; it does not know the accessible themes, so the rain is\n taken out there, like the kit's other decorative motion. */}\n <div className=\"ds:absolute ds:inset-0 ds:z-0 ds:[display:var(--accessible-off,block)]\">\n <MatrixRain\n glyphs=\"hex\"\n decay=\"fast\"\n mask=\"center\"\n maskRadius=\"xl\"\n className=\"ds:size-full\"\n />\n </div>\n <Card.Header className=\"ds:relative ds:z-[1]\">\n <div className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)] ds:text-center\">\n {/* The melting mark from the error pages, at half its size\n there. */}\n <div className=\"ds:[&>div]:w-24\">\n <ErrorPageIllustration mood=\"melt\" />\n </div>\n <Heading\n id={titleId}\n className=\"type-title-card ds:text-[var(--foreground)]\"\n >\n {title}\n </Heading>\n </div>\n </Card.Header>\n <Card.Body className=\"ds:relative ds:z-[1] ds:flex ds:flex-1 ds:flex-col ds:justify-center\">\n {/* The top margin keeps the heading clear of the links when the\n cards stack and this one is only as tall as its content. */}\n <div className=\"ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {links.map((option, index) => (\n <Button\n // Two options may share an address, so the place in the\n // list is part of the key.\n key={`${index}:${option.href}`}\n asChild\n intent=\"primary\"\n startIcon={option.icon}\n className=\"ds:min-h-[var(--min-target-size)] ds:w-full\"\n >\n <a href={option.href} data-action=\"dev-login\">\n {option.label}\n </a>\n </Button>\n ))}\n </div>\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\nLoginDevCard.displayName = 'LoginDevCard';\n"],"names":["LOGIN_FORM_FIELDS","loginFormVariants","cva","columnVariants","registerLinksVariants","linkTo","href","isSafeHref","hasMessage","errors","hasFieldMessage","field","focusTargetFor","messages","LoginForm","forwardRef","title","description","headingLevel","showLogo","logoMotion","children","initialValues","allowUsername","forgotPasswordHref","showRememberMe","registerDoctorHref","registerPatientHref","submitLabel","submitting","onSubmit","fieldNames","action","hiddenFields","devCard","className","rest","ref","t","useTranslation","titleId","useId","formMessageId","fieldIdBase","fieldId","native","email","setEmail","useState","password","setPassword","rememberMe","setRememberMe","rememberShown","rememberUnnamed","useEffect","isDevelopment","touched","setTouched","submitted","setSubmitted","serverErrors","setServerErrors","leave","previous","forget","emailInput","useRef","passwordInput","emailField","useStateBackedInput","emptyPassword","held","typedEmail","_a","writeInputValue","values","_b","emailRefused","value","text","isEmail","invalid","due","ownErrors","errorFor","openedWithFieldMessage","summary","useErrorSummary","focusRequest","setFocusRequest","target","submit","useRegistrationSubmit","answer","next","busy","formAction","useFormAction","forgotLink","doctorLink","patientLink","extraFields","useExtraFields","formError","formMessageAnnounce","useFormMessageAnnounce","jsxs","jsx","Card","AuthCardHeading","ErrorSummary","AuthFormMessage","FormField","TextInput","event","typed","EmailInput","PasswordInput","AuthTextLink","Checkbox","ExtraFields","Button","AuthFormStatus","loginDevCardVariants","LoginDevCard","options","Heading","links","option","MatrixRain","ErrorPageIllustration","index"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8DO,MAAMA,IAAoB,CAAC,SAAS,UAAU,GA8J/CC,KAAoBC;AAAA,EACxB;AACF,GAEMC,KAAiBD,EAAI,4BAA4B,GAIjDE,KAAwBF;AAAA,EAC5B;AACF,GAOMG,IAAS,CAACC,MACdA,KAAQC,GAAWD,CAAI,IAAIA,IAAO,QAE9BE,KAAa,CAACC,MAClB,OAAO,OAAOA,CAAM,EAAE,KAAK,OAAO,GAE9BC,KAAkB,CAACD,MACvBT,EAAkB,KAAK,CAACW,MAAU,EAAQF,EAAOE,CAAK,CAAE,GAOpDC,KAAiB,CACrBC,MAEAb,EAAkB,KAAK,CAACW,MAAUE,EAASF,CAAK,CAAC,MAChDE,EAAS,OAAO,aAAa,SAUnBC,KAAYC;AAAA,EACvB,CACE;AAAA,IACE,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,UAAAC,IAAW;AAAA,IACX,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,QAAAd;AAAA,IACA,oBAAAe;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,oBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC,KAAa;AAAA,IACb,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,OACG;AACH,UAAM,EAAE,GAAAC,EAAA,IAAMC,GAAe,IAAI,GAC3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AAA,cACA,gBAAA4F,EAACC,EAAK,MAAL,EAAU,WAAU,wEAGnB,UAAA,gBAAAD,EAAC,OAAA,EAAI,WAAU,4EACZ,UAAAoB,EAAM,IAAI,CAACC,GAAQG,MAClB,gBAAAxB;AAAA,gBAACc;AAAA,gBAAA;AAAA,kBAIC,SAAO;AAAA,kBACP,QAAO;AAAA,kBACP,WAAWO,EAAO;AAAA,kBAClB,WAAU;AAAA,kBAEV,UAAA,gBAAArB,EAAC,OAAE,MAAMqB,EAAO,MAAM,eAAY,aAC/B,YAAO,MAAA,CACV;AAAA,gBAAA;AAAA,gBARK,GAAGG,CAAK,IAAIH,EAAO,IAAI;AAAA,cAAA,CAU/B,GACH,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACAJ,GAAa,cAAc;"}
@@ -8,7 +8,7 @@ import { C as ie, b as te, a as se } from "./collapsible-DVPM46bq.js";
8
8
  import { D as ae } from "./description-list-BxzDN9o2.js";
9
9
  import { P as de } from "./panel-header-CbtlTe85.js";
10
10
  import { u as re } from "./registry-DvAUVLHh.js";
11
- import { u as ne, F as le, r as oe, P as ce } from "./patient-field-row-CBba7w9V.js";
11
+ import { u as ne, F as le, r as oe, P as ce } from "./patient-field-row-D9rb-QJH.js";
12
12
  import { C as pe } from "./clipboard-list-rSzfIYZB.js";
13
13
  const me = {
14
14
  id: "patient-details",
@@ -368,4 +368,4 @@ export {
368
368
  ue as P,
369
369
  me as p
370
370
  };
371
- //# sourceMappingURL=patient-details-BwkDIm4D.js.map
371
+ //# sourceMappingURL=patient-details-RsT3SaYh.js.map