@arsedizioni/ars-utils 22.5.15 → 22.5.17

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 (25) hide show
  1. package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +82 -23
  2. package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
  3. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +47 -0
  4. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
  5. package/fesm2022/arsedizioni-ars-utils-core.validators.mjs +115 -1
  6. package/fesm2022/arsedizioni-ars-utils-core.validators.mjs.map +1 -1
  7. package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +77 -22
  8. package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs.map +1 -1
  9. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +116 -49
  10. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs.map +1 -1
  11. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs +34 -13
  12. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs.map +1 -1
  13. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +149 -48
  14. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs.map +1 -1
  15. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +58 -44
  16. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/types/arsedizioni-ars-utils-clipper.common.d.ts +42 -10
  19. package/types/arsedizioni-ars-utils-clipper.ui.d.ts +32 -0
  20. package/types/arsedizioni-ars-utils-core.validators.d.ts +52 -1
  21. package/types/arsedizioni-ars-utils-evolution.common.d.ts +39 -11
  22. package/types/arsedizioni-ars-utils-ui.dialogs.auth.d.ts +37 -9
  23. package/types/arsedizioni-ars-utils-ui.dialogs.d.ts +29 -21
  24. package/types/arsedizioni-ars-utils-ui.dialogs.prompt.d.ts +56 -7
  25. package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts +13 -4
@@ -3,6 +3,7 @@ import { input, Directive, forwardRef, effect, inject, DestroyRef } from '@angul
3
3
  import { NG_VALIDATORS } from '@angular/forms';
4
4
  import { SystemUtils } from '@arsedizioni/ars-utils/core';
5
5
  import { endOfDay } from 'date-fns';
6
+ import { validate } from '@angular/forms/signals';
6
7
 
7
8
  /**
8
9
  * Directive that delegates validation to an externally provided validator function.
@@ -700,6 +701,119 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
700
701
  }]
701
702
  }] });
702
703
 
704
+ /**
705
+ * Signal-forms counterparts of the classic validator directives in this entry point.
706
+ *
707
+ * The `[formField]` directive only honours `NG_VALIDATORS` providers on ControlValueAccessor
708
+ * hosts (custom controls); on native inputs the attribute directives (`password`, `emails`,
709
+ * `time`, `equals`) are ignored. Schemas built with `form()` must therefore use these
710
+ * functions instead. Error kinds and messages match the directive versions one to one.
711
+ */
712
+ /**
713
+ * Binds a validator requiring the value to be a semicolon-separated list of valid
714
+ * email addresses. An empty value is considered valid (pair with `required` if needed).
715
+ * Signal-forms counterpart of `EmailsValidatorDirective`.
716
+ * @param path - Path of the string field to validate.
717
+ */
718
+ function emailsValidator(path) {
719
+ validate(path, ({ value }) => {
720
+ const input = value();
721
+ if (!input || input.length === 0)
722
+ return undefined;
723
+ const parts = input.replaceAll(/\r\n/g, '').split(';');
724
+ const isValid = parts.every(part => part.length === 0 || !!SystemUtils.parseEmail(part));
725
+ return isValid ? undefined : { kind: 'emails', message: 'Elenco non valido.' };
726
+ });
727
+ }
728
+ /**
729
+ * Binds a validator requiring the value to meet the minimum password-strength
730
+ * requirements (see `SystemUtils.calculatePasswordStrength`). An empty value is
731
+ * INVALID, exactly like the classic directive.
732
+ * Signal-forms counterpart of `PasswordValidatorDirective`.
733
+ * @param path - Path of the string field to validate.
734
+ */
735
+ function passwordValidator(path) {
736
+ validate(path, ({ value }) => {
737
+ const strength = SystemUtils.calculatePasswordStrength(value() ?? '');
738
+ return strength.isValid ? undefined : { kind: 'password', message: 'Non valido.' };
739
+ });
740
+ }
741
+ /**
742
+ * Binds a validator requiring the value to be a valid `"HH:MM"` time string and,
743
+ * when slots are provided, to fall within at least one of the allowed ranges.
744
+ * An empty value is considered valid (pair with `required` if needed).
745
+ * Signal-forms counterpart of `TimeValidatorDirective`.
746
+ * @param path - Path of the string field to validate.
747
+ * @param slots - Optional reactive function returning the pipe-separated allowed
748
+ * ranges (e.g. `"08:00-12:00|14:00-18:00"`), or `undefined` for none.
749
+ */
750
+ function timeValidator(path, slots) {
751
+ /**
752
+ * Parses a `"HH:MM"` time string into a comparable integer (e.g. `"09:30"` -> `930`).
753
+ * Returns `-1` when the string is not a valid time.
754
+ * @param value - The time string to parse.
755
+ * @returns The comparable integer, or `-1` when invalid.
756
+ */
757
+ const getTime = (value) => {
758
+ const p = value.split(':');
759
+ if (p.length !== 2)
760
+ return -1;
761
+ const hh = parseInt(p[0], 10);
762
+ if (isNaN(hh) || hh < 0 || hh > 23)
763
+ return -1;
764
+ const mm = parseInt(p[1], 10);
765
+ if (isNaN(mm) || mm < 0 || mm > 59)
766
+ return -1;
767
+ return hh * 100 + mm;
768
+ };
769
+ validate(path, ({ value }) => {
770
+ const input = value();
771
+ if (!input || input.length === 0)
772
+ return undefined;
773
+ const t = getTime(input);
774
+ if (t === -1)
775
+ return { kind: 'time', message: 'Non valido.' };
776
+ const slotsValue = slots?.();
777
+ if (slotsValue) {
778
+ const isValid = slotsValue.split('|').some(s => {
779
+ const t1 = getTime(s.substring(0, 5));
780
+ const t2 = getTime(s.substring(6));
781
+ return t1 !== -1 && t2 !== -1 && t1 <= t && t2 >= t;
782
+ });
783
+ if (!isValid)
784
+ return { kind: 'time', message: 'Non valido.' };
785
+ }
786
+ return undefined;
787
+ });
788
+ }
789
+ /**
790
+ * Binds a validator requiring the value to strictly equal the value of another field
791
+ * of the same form. Reactive on both fields, so the host field re-validates when the
792
+ * other field changes (this replaces the `valueChanges` subscription of the directive).
793
+ * Signal-forms counterpart of `EqualsValidatorDirective`.
794
+ * @param path - Path of the field to validate.
795
+ * @param other - Path of the field whose value must match.
796
+ */
797
+ function equalsValidator(path, other) {
798
+ validate(path, ctx => ctx.valueOf(other) === ctx.value()
799
+ ? undefined
800
+ : { kind: 'equals', message: 'Non valido.' });
801
+ }
802
+ /**
803
+ * Binds a validator requiring the value to be either empty or a complete 6-digit
804
+ * OTP code. A partial code (e.g. `"12"`) is invalid; emptiness is left to `required`.
805
+ * Schema-level counterpart of the `OtpInputComponent` internal validator.
806
+ * @param path - Path of the string field to validate.
807
+ */
808
+ function otpValidator(path) {
809
+ validate(path, ({ value }) => {
810
+ const input = value() ?? '';
811
+ if (input.length === 0)
812
+ return undefined;
813
+ return /^\d{6}$/.test(input) ? undefined : { kind: 'otp', message: 'Non valido.' };
814
+ });
815
+ }
816
+
703
817
  /*
704
818
  * Public API Surface of @arsedizioni/ars-utils/core.validators
705
819
  *
@@ -713,5 +827,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
713
827
  * Generated bundle index. Do not edit.
714
828
  */
715
829
 
716
- export { EmailsValidatorDirective, EqualsValidatorDirective, FileSizeValidatorDirective, GuidValidatorDirective, MaxTermsValidatorDirective, NotEmptyValidatorDirective, NotEqualValidatorDirective, NotFutureValidatorDirective, PasswordValidatorDirective, SqlDateValidatorDirective, TimeValidatorDirective, UrlValidatorDirective, ValidIfDirective, ValidatorDirective };
830
+ export { EmailsValidatorDirective, EqualsValidatorDirective, FileSizeValidatorDirective, GuidValidatorDirective, MaxTermsValidatorDirective, NotEmptyValidatorDirective, NotEqualValidatorDirective, NotFutureValidatorDirective, PasswordValidatorDirective, SqlDateValidatorDirective, TimeValidatorDirective, UrlValidatorDirective, ValidIfDirective, ValidatorDirective, emailsValidator, equalsValidator, otpValidator, passwordValidator, timeValidator };
717
831
  //# sourceMappingURL=arsedizioni-ars-utils-core.validators.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"arsedizioni-ars-utils-core.validators.mjs","sources":["../../../projects/ars-utils/core.validators/validatorDirective.ts","../../../projects/ars-utils/core.validators/validIfDirective.ts","../../../projects/ars-utils/core.validators/equalsValidatorDirective.ts","../../../projects/ars-utils/core.validators/emailsValidatorDirective.ts","../../../projects/ars-utils/core.validators/notEqualValidatorDirective.ts","../../../projects/ars-utils/core.validators/guidValidatorDirective.ts","../../../projects/ars-utils/core.validators/sqlDateValidatorDirective.ts","../../../projects/ars-utils/core.validators/notFutureValidatorDirective.ts","../../../projects/ars-utils/core.validators/urlValidatorDirective.ts","../../../projects/ars-utils/core.validators/fileSizeValidatorDirective.ts","../../../projects/ars-utils/core.validators/maxTermsValidatorDirective.ts","../../../projects/ars-utils/core.validators/passwordValidatorDirective.ts","../../../projects/ars-utils/core.validators/timeValidatorDirective.ts","../../../projects/ars-utils/core.validators/notEmptyValidatorDirective.ts","../../../projects/ars-utils/core.validators/public_api.ts","../../../projects/ars-utils/core.validators/arsedizioni-ars-utils-core.validators.ts"],"sourcesContent":["import { Directive, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that delegates validation to an externally provided validator function.\r\n * Bind `[validator]=\"myFn\"` where `myFn` is `(c: AbstractControl) => ValidationErrors | null`.\r\n */\r\n@Directive({\r\n selector: '[validator]',\r\n providers: [{ provide: NG_VALIDATORS, useExisting: ValidatorDirective, multi: true }],\r\n standalone: true,\r\n})\r\nexport class ValidatorDirective implements Validator {\r\n\r\n /** The custom validator function to apply. */\r\n readonly validator = input<((control: AbstractControl) => ValidationErrors | null) | undefined>(undefined);\r\n\r\n /**\r\n * Invokes the provided validator function against the given control.\r\n * Returns `null` (valid) when no function is bound.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const fn = this.validator();\r\n return fn ? fn(control) : null;\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { Validated } from '@arsedizioni/ars-utils/core';\r\n\r\n/**\r\n * Directive that validates a control using the host object's `isValid()` method\r\n * or a boolean expression passed via `[validIf]`.\r\n */\r\n@Directive({\r\n selector: \"[validIf]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => ValidIfDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class ValidIfDirective implements Validator {\r\n\r\n /** When `true`, the control is considered valid regardless of the bound value. */\r\n readonly validIf = input<boolean>(false);\r\n\r\n /**\r\n * Validates the control value against a boolean flag or the value's own `isValid()` method.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n let isValid = false;\r\n const c = control.value ? (control.value as Validated) : null;\r\n if (!c) {\r\n isValid = this.validIf() === true;\r\n } else {\r\n try {\r\n isValid = c.isValid();\r\n } catch { }\r\n }\r\n return isValid ? null : { validIf: \"Non valido.\" };\r\n }\r\n}\r\n","import { DestroyRef, Directive, effect, forwardRef, inject, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { Subscription } from \"rxjs\";\n\n/**\n * Directive that validates that the host control's value equals the value of another control.\n * Bind `[equals]=\"otherControl\"`.\n *\n * The host control is re-validated whenever the OTHER control's value changes:\n * without this, typing a new password AFTER the confirmation field was filled\n * left the form incorrectly valid (the classic password/confirm bug).\n *\n * IMPORTANT (reciprocal-binding safety): the re-validation triggered from the\n * other control's `valueChanges` runs with `{ emitEvent: false }`. Calling\n * Angular's `onValidatorChange` instead would re-emit valueChanges, so a\n * reciprocal setup (A [equals]=B and B [equals]=A) would overflow the stack.\n */\n@Directive({\n selector: \"[equals]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => EqualsValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class EqualsValidatorDirective implements Validator {\n\n /** The control whose value must match the host control's value. */\n readonly equals = input<AbstractControl | undefined>(undefined);\n\n /** The host control, captured on the first validate() call. */\n private hostControl?: AbstractControl;\n\n /** Subscription to the other control's valueChanges. */\n private subscription?: Subscription;\n\n constructor() {\n // Re-subscribe whenever the [equals] binding points to a different control,\n // and re-validate the host on every change of the other control.\n effect(() => {\n const other = this.equals();\n this.subscription?.unsubscribe();\n this.subscription = other?.valueChanges.subscribe(() =>\n // emitEvent:false breaks the reciprocal valueChanges loop (see class doc).\n this.hostControl?.updateValueAndValidity({ emitEvent: false })\n );\n // Re-validate the host when the bound control itself is swapped.\n this.hostControl?.updateValueAndValidity({ emitEvent: false });\n });\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n }\n\n /**\n * Validates that the host control value equals the bound control's value.\n * Returns `null` (valid) when no control is bound.\n * @param control - The form control to validate.\n * @returns `null` when valid, `{ equals: ... }` otherwise.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n this.hostControl = control;\n const eq = this.equals();\n if (!eq) return null;\n return eq.value === control.value ? null : { equals: \"Non valido.\" };\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a semicolon-separated list of email addresses.\r\n * Apply `emails` to a text input containing one or more addresses separated by `;`.\r\n */\r\n@Directive({\r\n selector: \"[emails]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => EmailsValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class EmailsValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates each address in a semicolon-separated email list.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n const parts = input.replaceAll(/\\r\\n/g, '').split(';');\r\n const isValid = parts.every(part => part.length === 0 || !!SystemUtils.parseEmail(part));\r\n return isValid ? null : { emails: \"Elenco non valido.\" };\r\n }\r\n}\r\n","import { DestroyRef, Directive, effect, forwardRef, inject, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { Subscription } from \"rxjs\";\n\n/**\n * Directive that validates that the host control's value is different from another control's value.\n * Bind `[notEqual]=\"otherControl\"`.\n *\n * The host control is re-validated whenever the OTHER control's value changes,\n * so editing either field keeps both error states consistent.\n *\n * IMPORTANT (reciprocal-binding safety): the re-validation triggered from the\n * other control's `valueChanges` is run with `{ emitEvent: false }`. Using\n * Angular's `onValidatorChange` here instead would call `host.updateValueAndValidity()`\n * WITH events, so a reciprocal setup (A [notEqual]=B and B [notEqual]=A) would\n * ping-pong valueChanges between the two controls and overflow the stack.\n */\n@Directive({\n selector: \"[notEqual]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NotEqualValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class NotEqualValidatorDirective implements Validator {\n\n /** The control whose value must differ from the host control's value. */\n readonly notEqual = input<AbstractControl | undefined>(undefined);\n\n /** The host control, captured on the first validate() call. */\n private hostControl?: AbstractControl;\n\n /** Subscription to the other control's valueChanges. */\n private subscription?: Subscription;\n\n constructor() {\n effect(() => {\n const other = this.notEqual();\n this.subscription?.unsubscribe();\n this.subscription = other?.valueChanges.subscribe(() =>\n // Re-validate the host WITHOUT emitting valueChanges, otherwise a\n // reciprocal binding would loop forever (see class doc).\n this.hostControl?.updateValueAndValidity({ emitEvent: false })\n );\n // Re-validate the host when the bound control itself is swapped.\n this.hostControl?.updateValueAndValidity({ emitEvent: false });\n });\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n }\n\n /**\n * Validates that the host control value is not equal to the bound control's value.\n * Also clears the `notequal` error on the other control when the host becomes valid.\n * Returns `null` (valid) when no control is bound.\n * @param control - The form control to validate.\n * @returns `null` when valid, `{ notequal: true }` otherwise.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n this.hostControl = control;\n\n const notEqual = this.notEqual();\n if (!notEqual) return null;\n\n const isValid = (!notEqual.value && !control.value) || (notEqual.value !== control.value);\n const errors: ValidationErrors | null = isValid ? null : { notequal: true };\n\n if (errors) {\n control.markAsTouched();\n } else if (notEqual.hasError('notequal')) {\n const { notequal: _removed, ...rest } = notEqual.errors ?? {};\n // emitEvent:false on both: clearing the partner's error must not feed\n // back through valueChanges/statusChanges into this validator.\n notEqual.setErrors(Object.keys(rest).length > 0 ? rest : null, { emitEvent: false });\n notEqual.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n notEqual.markAsTouched();\n notEqual.markAsDirty();\n }\n return errors;\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a GUID / UUID string.\r\n * Apply `guid` to a text input that expects a valid UUID.\r\n */\r\n@Directive({\r\n selector: \"[guid]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => GuidValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class GuidValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value is a well-formed GUID / UUID.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n return SystemUtils.parseUUID(input) ? null : { guid: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { endOfDay } from 'date-fns';\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\n\n/**\n * Directive that validates a control value as a parseable SQL-compatible date string.\n * Apply `sqlDate` to a text input that expects a date after year 1750.\n */\n@Directive({\n selector: \"[sqlDate]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SqlDateValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class SqlDateValidatorDirective implements Validator {\n\n /**\n * Validates that the control value can be parsed as a date after 1750.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n const parsed = SystemUtils.parseDate(input);\n if (!parsed) return { sqlDate: \"Non valido.\" };\n const d = endOfDay(parsed);\n return d.getFullYear() > 1750 ? null : { sqlDate: \"Non valido.\" };\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { endOfDay } from 'date-fns';\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\n\n/**\n * Directive that validates that a control value is not a future date.\n * Apply `notFuture` to a text input that expects a date on or before today.\n */\n@Directive({\n selector: \"[notFuture]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NotFutureValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class NotFutureValidatorDirective implements Validator {\n\n /**\n * Validates that the control value represents a date that is not in the future.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n const parsed = SystemUtils.parseDate(input);\n if (!parsed) return { notFuture: \"Non valido.\" };\n const today = endOfDay(new Date());\n const d = endOfDay(parsed);\n return d <= today ? null : { notFuture: \"Non valido.\" };\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a well-formed URL.\r\n * Apply `url` to a text input that expects a URL.\r\n */\r\n@Directive({\r\n selector: \"[url]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => UrlValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class UrlValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value is a well-formed URL.\r\n * Returns `null` (valid) when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n return SystemUtils.parseUrl(input) ? null : { url: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that validates a file size against configurable minimum and maximum bounds.\r\n * Bind `[fileSize]` together with `[size]=\"fileSizeInMb\"`, `[maxSizeMb]`, and `[minSizeMb]`.\r\n */\r\n@Directive({\r\n selector: \"[fileSize]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => FileSizeValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class FileSizeValidatorDirective implements Validator {\r\n\r\n /** Maximum allowed file size in megabytes. Defaults to 5. */\r\n readonly maxSizeMb = input<number>(5);\r\n\r\n /** Minimum required file size in megabytes. Defaults to 0. */\r\n readonly minSizeMb = input<number>(0);\r\n\r\n /** The actual file size in megabytes to validate against the bounds. */\r\n readonly size = input<number | undefined>(undefined);\r\n\r\n /**\r\n * Validates that the bound file size falls within the configured min/max range.\r\n * Returns `null` when no control value is present.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input = control.value;\r\n if (!input) return null;\r\n const s = this.size() ?? 0;\r\n const isValid = s <= this.maxSizeMb() && s >= this.minSizeMb();\r\n return isValid ? null : { fileSize: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that validates that a control value does not exceed a maximum word count.\r\n * Bind `[maxTerms]=\"10\"` to allow at most 10 whitespace-separated terms.\r\n */\r\n@Directive({\r\n selector: \"[maxTerms]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => MaxTermsValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class MaxTermsValidatorDirective implements Validator {\r\n\r\n /** The maximum number of whitespace-separated terms allowed. */\r\n readonly maxTerms = input<number>(0);\r\n\r\n /**\r\n * Validates that the control value contains no more than the configured number of terms.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input) return null;\r\n const terms = input.match(/\\S+/g)?.length ?? 0;\r\n return terms <= this.maxTerms() ? null : { maxTerms: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a sufficiently strong password.\r\n * Apply `password` to a password input.\r\n */\r\n@Directive({\r\n selector: \"[password]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => PasswordValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class PasswordValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value meets the minimum password-strength requirements.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value ?? '';\r\n const strength = SystemUtils.calculatePasswordStrength(input);\r\n return strength.isValid ? null : { password: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\n\n/**\n * Directive that validates a time string against optional allowed time slot ranges.\n * Bind `[time]` and optionally `[slots]=\"'08:00-12:00|14:00-18:00'\"` (pipe-separated ranges).\n */\n@Directive({\n selector: \"[time]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => TimeValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class TimeValidatorDirective implements Validator {\n\n /** Optional pipe-separated list of allowed time ranges, e.g. `\"08:00-12:00|14:00-18:00\"`. */\n readonly slots = input<string | undefined>(undefined);\n\n /**\n * Parses a `\"HH:MM\"` time string into a comparable integer (e.g. `\"09:30\"` -> `930`).\n * Returns `-1` when the string is not a valid time.\n * @param value - The time string to parse.\n */\n private getTime(value: string): number {\n const p = value.split(':');\n if (p.length !== 2) return -1;\n const hh = parseInt(p[0], 10);\n if (isNaN(hh) || hh < 0 || hh > 23) return -1;\n const mm = parseInt(p[1], 10);\n if (isNaN(mm) || mm < 0 || mm > 59) return -1;\n return hh * 100 + mm;\n }\n\n /**\n * Validates that the control value is a valid time string and, when slots are configured,\n * that it falls within at least one of the allowed ranges.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n\n const t = this.getTime(input);\n if (t === -1) return { time: \"Non valido.\" };\n\n const slotsValue = this.slots();\n if (slotsValue) {\n const isValid = slotsValue.split('|').some(s => {\n const t1 = this.getTime(s.substring(0, 5));\n const t2 = this.getTime(s.substring(6));\n return t1 !== -1 && t2 !== -1 && t1 <= t && t2 >= t;\n });\n return isValid ? null : { time: \"Non valido.\" };\n }\n\n return null;\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that validates that a string control value is not blank (whitespace-only).\r\n * Apply `notEmpty` to a text input where non-blank content is required.\r\n */\r\n@Directive({\r\n selector: \"[notEmpty]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => NotEmptyValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class NotEmptyValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value is a non-blank string.\r\n * Returns `null` when the control is empty or not a string.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input = control?.value;\r\n if (!input || typeof input !== 'string' || input.length === 0) return null;\r\n return input.trim().length > 0 ? null : { notEmpty: true };\r\n }\r\n}\r\n","/*\n * Public API Surface of @arsedizioni/ars-utils/core.validators\n *\n * Template-driven form validators. Kept OUT of `core` on purpose: every one of them pulls in\n * `@angular/forms` (53 KB), and `core` is on the boot path of every application through\n * `ThemeService`, `BroadcastService` and friends. Importing a validator now costs `@angular/forms`\n * only to the lazy chunk that actually uses one.\n */\nexport * from './validators';\n","/**\n * Generated bundle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A,QAAA,EAAA,YAAA,EAAA,SAAA,EAT1B;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,aAAa;AACtB,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,0BAA0B,CAAC;AACzD,gBAAA,KAAK,EAAE,IAAI;AACZ,aAAA;AACF,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAGU,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAXtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,aAAa;AACtB,4BAAA,WAAW,EAAE,UAAU,CAAC,gCAAgC,CAAC;AACzD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA;AACD,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACtBD;;;;;;;AAOG;;ACPH;;AAEG;;;;"}
1
+ {"version":3,"file":"arsedizioni-ars-utils-core.validators.mjs","sources":["../../../projects/ars-utils/core.validators/validatorDirective.ts","../../../projects/ars-utils/core.validators/validIfDirective.ts","../../../projects/ars-utils/core.validators/equalsValidatorDirective.ts","../../../projects/ars-utils/core.validators/emailsValidatorDirective.ts","../../../projects/ars-utils/core.validators/notEqualValidatorDirective.ts","../../../projects/ars-utils/core.validators/guidValidatorDirective.ts","../../../projects/ars-utils/core.validators/sqlDateValidatorDirective.ts","../../../projects/ars-utils/core.validators/notFutureValidatorDirective.ts","../../../projects/ars-utils/core.validators/urlValidatorDirective.ts","../../../projects/ars-utils/core.validators/fileSizeValidatorDirective.ts","../../../projects/ars-utils/core.validators/maxTermsValidatorDirective.ts","../../../projects/ars-utils/core.validators/passwordValidatorDirective.ts","../../../projects/ars-utils/core.validators/timeValidatorDirective.ts","../../../projects/ars-utils/core.validators/notEmptyValidatorDirective.ts","../../../projects/ars-utils/core.validators/signalValidators.ts","../../../projects/ars-utils/core.validators/public_api.ts","../../../projects/ars-utils/core.validators/arsedizioni-ars-utils-core.validators.ts"],"sourcesContent":["import { Directive, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that delegates validation to an externally provided validator function.\r\n * Bind `[validator]=\"myFn\"` where `myFn` is `(c: AbstractControl) => ValidationErrors | null`.\r\n */\r\n@Directive({\r\n selector: '[validator]',\r\n providers: [{ provide: NG_VALIDATORS, useExisting: ValidatorDirective, multi: true }],\r\n standalone: true,\r\n})\r\nexport class ValidatorDirective implements Validator {\r\n\r\n /** The custom validator function to apply. */\r\n readonly validator = input<((control: AbstractControl) => ValidationErrors | null) | undefined>(undefined);\r\n\r\n /**\r\n * Invokes the provided validator function against the given control.\r\n * Returns `null` (valid) when no function is bound.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const fn = this.validator();\r\n return fn ? fn(control) : null;\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { Validated } from '@arsedizioni/ars-utils/core';\r\n\r\n/**\r\n * Directive that validates a control using the host object's `isValid()` method\r\n * or a boolean expression passed via `[validIf]`.\r\n */\r\n@Directive({\r\n selector: \"[validIf]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => ValidIfDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class ValidIfDirective implements Validator {\r\n\r\n /** When `true`, the control is considered valid regardless of the bound value. */\r\n readonly validIf = input<boolean>(false);\r\n\r\n /**\r\n * Validates the control value against a boolean flag or the value's own `isValid()` method.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n let isValid = false;\r\n const c = control.value ? (control.value as Validated) : null;\r\n if (!c) {\r\n isValid = this.validIf() === true;\r\n } else {\r\n try {\r\n isValid = c.isValid();\r\n } catch { }\r\n }\r\n return isValid ? null : { validIf: \"Non valido.\" };\r\n }\r\n}\r\n","import { DestroyRef, Directive, effect, forwardRef, inject, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { Subscription } from \"rxjs\";\n\n/**\n * Directive that validates that the host control's value equals the value of another control.\n * Bind `[equals]=\"otherControl\"`.\n *\n * The host control is re-validated whenever the OTHER control's value changes:\n * without this, typing a new password AFTER the confirmation field was filled\n * left the form incorrectly valid (the classic password/confirm bug).\n *\n * IMPORTANT (reciprocal-binding safety): the re-validation triggered from the\n * other control's `valueChanges` runs with `{ emitEvent: false }`. Calling\n * Angular's `onValidatorChange` instead would re-emit valueChanges, so a\n * reciprocal setup (A [equals]=B and B [equals]=A) would overflow the stack.\n */\n@Directive({\n selector: \"[equals]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => EqualsValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class EqualsValidatorDirective implements Validator {\n\n /** The control whose value must match the host control's value. */\n readonly equals = input<AbstractControl | undefined>(undefined);\n\n /** The host control, captured on the first validate() call. */\n private hostControl?: AbstractControl;\n\n /** Subscription to the other control's valueChanges. */\n private subscription?: Subscription;\n\n constructor() {\n // Re-subscribe whenever the [equals] binding points to a different control,\n // and re-validate the host on every change of the other control.\n effect(() => {\n const other = this.equals();\n this.subscription?.unsubscribe();\n this.subscription = other?.valueChanges.subscribe(() =>\n // emitEvent:false breaks the reciprocal valueChanges loop (see class doc).\n this.hostControl?.updateValueAndValidity({ emitEvent: false })\n );\n // Re-validate the host when the bound control itself is swapped.\n this.hostControl?.updateValueAndValidity({ emitEvent: false });\n });\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n }\n\n /**\n * Validates that the host control value equals the bound control's value.\n * Returns `null` (valid) when no control is bound.\n * @param control - The form control to validate.\n * @returns `null` when valid, `{ equals: ... }` otherwise.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n this.hostControl = control;\n const eq = this.equals();\n if (!eq) return null;\n return eq.value === control.value ? null : { equals: \"Non valido.\" };\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a semicolon-separated list of email addresses.\r\n * Apply `emails` to a text input containing one or more addresses separated by `;`.\r\n */\r\n@Directive({\r\n selector: \"[emails]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => EmailsValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class EmailsValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates each address in a semicolon-separated email list.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n const parts = input.replaceAll(/\\r\\n/g, '').split(';');\r\n const isValid = parts.every(part => part.length === 0 || !!SystemUtils.parseEmail(part));\r\n return isValid ? null : { emails: \"Elenco non valido.\" };\r\n }\r\n}\r\n","import { DestroyRef, Directive, effect, forwardRef, inject, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { Subscription } from \"rxjs\";\n\n/**\n * Directive that validates that the host control's value is different from another control's value.\n * Bind `[notEqual]=\"otherControl\"`.\n *\n * The host control is re-validated whenever the OTHER control's value changes,\n * so editing either field keeps both error states consistent.\n *\n * IMPORTANT (reciprocal-binding safety): the re-validation triggered from the\n * other control's `valueChanges` is run with `{ emitEvent: false }`. Using\n * Angular's `onValidatorChange` here instead would call `host.updateValueAndValidity()`\n * WITH events, so a reciprocal setup (A [notEqual]=B and B [notEqual]=A) would\n * ping-pong valueChanges between the two controls and overflow the stack.\n */\n@Directive({\n selector: \"[notEqual]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NotEqualValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class NotEqualValidatorDirective implements Validator {\n\n /** The control whose value must differ from the host control's value. */\n readonly notEqual = input<AbstractControl | undefined>(undefined);\n\n /** The host control, captured on the first validate() call. */\n private hostControl?: AbstractControl;\n\n /** Subscription to the other control's valueChanges. */\n private subscription?: Subscription;\n\n constructor() {\n effect(() => {\n const other = this.notEqual();\n this.subscription?.unsubscribe();\n this.subscription = other?.valueChanges.subscribe(() =>\n // Re-validate the host WITHOUT emitting valueChanges, otherwise a\n // reciprocal binding would loop forever (see class doc).\n this.hostControl?.updateValueAndValidity({ emitEvent: false })\n );\n // Re-validate the host when the bound control itself is swapped.\n this.hostControl?.updateValueAndValidity({ emitEvent: false });\n });\n inject(DestroyRef).onDestroy(() => this.subscription?.unsubscribe());\n }\n\n /**\n * Validates that the host control value is not equal to the bound control's value.\n * Also clears the `notequal` error on the other control when the host becomes valid.\n * Returns `null` (valid) when no control is bound.\n * @param control - The form control to validate.\n * @returns `null` when valid, `{ notequal: true }` otherwise.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n this.hostControl = control;\n\n const notEqual = this.notEqual();\n if (!notEqual) return null;\n\n const isValid = (!notEqual.value && !control.value) || (notEqual.value !== control.value);\n const errors: ValidationErrors | null = isValid ? null : { notequal: true };\n\n if (errors) {\n control.markAsTouched();\n } else if (notEqual.hasError('notequal')) {\n const { notequal: _removed, ...rest } = notEqual.errors ?? {};\n // emitEvent:false on both: clearing the partner's error must not feed\n // back through valueChanges/statusChanges into this validator.\n notEqual.setErrors(Object.keys(rest).length > 0 ? rest : null, { emitEvent: false });\n notEqual.updateValueAndValidity({ onlySelf: true, emitEvent: false });\n notEqual.markAsTouched();\n notEqual.markAsDirty();\n }\n return errors;\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a GUID / UUID string.\r\n * Apply `guid` to a text input that expects a valid UUID.\r\n */\r\n@Directive({\r\n selector: \"[guid]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => GuidValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class GuidValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value is a well-formed GUID / UUID.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n return SystemUtils.parseUUID(input) ? null : { guid: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { endOfDay } from 'date-fns';\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\n\n/**\n * Directive that validates a control value as a parseable SQL-compatible date string.\n * Apply `sqlDate` to a text input that expects a date after year 1750.\n */\n@Directive({\n selector: \"[sqlDate]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SqlDateValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class SqlDateValidatorDirective implements Validator {\n\n /**\n * Validates that the control value can be parsed as a date after 1750.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n const parsed = SystemUtils.parseDate(input);\n if (!parsed) return { sqlDate: \"Non valido.\" };\n const d = endOfDay(parsed);\n return d.getFullYear() > 1750 ? null : { sqlDate: \"Non valido.\" };\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\nimport { endOfDay } from 'date-fns';\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\n\n/**\n * Directive that validates that a control value is not a future date.\n * Apply `notFuture` to a text input that expects a date on or before today.\n */\n@Directive({\n selector: \"[notFuture]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => NotFutureValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class NotFutureValidatorDirective implements Validator {\n\n /**\n * Validates that the control value represents a date that is not in the future.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n const parsed = SystemUtils.parseDate(input);\n if (!parsed) return { notFuture: \"Non valido.\" };\n const today = endOfDay(new Date());\n const d = endOfDay(parsed);\n return d <= today ? null : { notFuture: \"Non valido.\" };\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a well-formed URL.\r\n * Apply `url` to a text input that expects a URL.\r\n */\r\n@Directive({\r\n selector: \"[url]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => UrlValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class UrlValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value is a well-formed URL.\r\n * Returns `null` (valid) when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input || input.length === 0) return null;\r\n return SystemUtils.parseUrl(input) ? null : { url: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that validates a file size against configurable minimum and maximum bounds.\r\n * Bind `[fileSize]` together with `[size]=\"fileSizeInMb\"`, `[maxSizeMb]`, and `[minSizeMb]`.\r\n */\r\n@Directive({\r\n selector: \"[fileSize]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => FileSizeValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class FileSizeValidatorDirective implements Validator {\r\n\r\n /** Maximum allowed file size in megabytes. Defaults to 5. */\r\n readonly maxSizeMb = input<number>(5);\r\n\r\n /** Minimum required file size in megabytes. Defaults to 0. */\r\n readonly minSizeMb = input<number>(0);\r\n\r\n /** The actual file size in megabytes to validate against the bounds. */\r\n readonly size = input<number | undefined>(undefined);\r\n\r\n /**\r\n * Validates that the bound file size falls within the configured min/max range.\r\n * Returns `null` when no control value is present.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input = control.value;\r\n if (!input) return null;\r\n const s = this.size() ?? 0;\r\n const isValid = s <= this.maxSizeMb() && s >= this.minSizeMb();\r\n return isValid ? null : { fileSize: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that validates that a control value does not exceed a maximum word count.\r\n * Bind `[maxTerms]=\"10\"` to allow at most 10 whitespace-separated terms.\r\n */\r\n@Directive({\r\n selector: \"[maxTerms]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => MaxTermsValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class MaxTermsValidatorDirective implements Validator {\r\n\r\n /** The maximum number of whitespace-separated terms allowed. */\r\n readonly maxTerms = input<number>(0);\r\n\r\n /**\r\n * Validates that the control value contains no more than the configured number of terms.\r\n * Returns `null` when the control is empty.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value;\r\n if (!input) return null;\r\n const terms = input.match(/\\S+/g)?.length ?? 0;\r\n return terms <= this.maxTerms() ? null : { maxTerms: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\nimport { SystemUtils } from \"@arsedizioni/ars-utils/core\";\r\n\r\n/**\r\n * Directive that validates a control value as a sufficiently strong password.\r\n * Apply `password` to a password input.\r\n */\r\n@Directive({\r\n selector: \"[password]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => PasswordValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class PasswordValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value meets the minimum password-strength requirements.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input: string = control.value ?? '';\r\n const strength = SystemUtils.calculatePasswordStrength(input);\r\n return strength.isValid ? null : { password: \"Non valido.\" };\r\n }\r\n}\r\n","import { Directive, forwardRef, input } from \"@angular/core\";\nimport {\n AbstractControl,\n NG_VALIDATORS,\n ValidationErrors,\n Validator,\n} from \"@angular/forms\";\n\n/**\n * Directive that validates a time string against optional allowed time slot ranges.\n * Bind `[time]` and optionally `[slots]=\"'08:00-12:00|14:00-18:00'\"` (pipe-separated ranges).\n */\n@Directive({\n selector: \"[time]\",\n providers: [\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => TimeValidatorDirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class TimeValidatorDirective implements Validator {\n\n /** Optional pipe-separated list of allowed time ranges, e.g. `\"08:00-12:00|14:00-18:00\"`. */\n readonly slots = input<string | undefined>(undefined);\n\n /**\n * Parses a `\"HH:MM\"` time string into a comparable integer (e.g. `\"09:30\"` -> `930`).\n * Returns `-1` when the string is not a valid time.\n * @param value - The time string to parse.\n */\n private getTime(value: string): number {\n const p = value.split(':');\n if (p.length !== 2) return -1;\n const hh = parseInt(p[0], 10);\n if (isNaN(hh) || hh < 0 || hh > 23) return -1;\n const mm = parseInt(p[1], 10);\n if (isNaN(mm) || mm < 0 || mm > 59) return -1;\n return hh * 100 + mm;\n }\n\n /**\n * Validates that the control value is a valid time string and, when slots are configured,\n * that it falls within at least one of the allowed ranges.\n * Returns `null` when the control is empty.\n * @param control - The form control to validate.\n */\n validate(control: AbstractControl): ValidationErrors | null {\n const input: string = control.value;\n if (!input || input.length === 0) return null;\n\n const t = this.getTime(input);\n if (t === -1) return { time: \"Non valido.\" };\n\n const slotsValue = this.slots();\n if (slotsValue) {\n const isValid = slotsValue.split('|').some(s => {\n const t1 = this.getTime(s.substring(0, 5));\n const t2 = this.getTime(s.substring(6));\n return t1 !== -1 && t2 !== -1 && t1 <= t && t2 >= t;\n });\n return isValid ? null : { time: \"Non valido.\" };\n }\n\n return null;\n }\n}\n","import { Directive, forwardRef } from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n NG_VALIDATORS,\r\n ValidationErrors,\r\n Validator,\r\n} from \"@angular/forms\";\r\n\r\n/**\r\n * Directive that validates that a string control value is not blank (whitespace-only).\r\n * Apply `notEmpty` to a text input where non-blank content is required.\r\n */\r\n@Directive({\r\n selector: \"[notEmpty]\",\r\n providers: [\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => NotEmptyValidatorDirective),\r\n multi: true,\r\n },\r\n ],\r\n standalone: true,\r\n})\r\nexport class NotEmptyValidatorDirective implements Validator {\r\n\r\n /**\r\n * Validates that the control value is a non-blank string.\r\n * Returns `null` when the control is empty or not a string.\r\n * @param control - The form control to validate.\r\n */\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n const input = control?.value;\r\n if (!input || typeof input !== 'string' || input.length === 0) return null;\r\n return input.trim().length > 0 ? null : { notEmpty: true };\r\n }\r\n}\r\n","import { PathKind, SchemaPath, SchemaPathRules, validate } from '@angular/forms/signals';\nimport { SystemUtils } from '@arsedizioni/ars-utils/core';\n\n/**\n * Signal-forms counterparts of the classic validator directives in this entry point.\n *\n * The `[formField]` directive only honours `NG_VALIDATORS` providers on ControlValueAccessor\n * hosts (custom controls); on native inputs the attribute directives (`password`, `emails`,\n * `time`, `equals`) are ignored. Schemas built with `form()` must therefore use these\n * functions instead. Error kinds and messages match the directive versions one to one.\n */\n\n/**\n * Binds a validator requiring the value to be a semicolon-separated list of valid\n * email addresses. An empty value is considered valid (pair with `required` if needed).\n * Signal-forms counterpart of `EmailsValidatorDirective`.\n * @param path - Path of the string field to validate.\n */\nexport function emailsValidator<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>): void {\n validate(path, ({ value }) => {\n const input = value();\n if (!input || input.length === 0) return undefined;\n const parts = input.replaceAll(/\\r\\n/g, '').split(';');\n const isValid = parts.every(part => part.length === 0 || !!SystemUtils.parseEmail(part));\n return isValid ? undefined : { kind: 'emails', message: 'Elenco non valido.' };\n });\n}\n\n/**\n * Binds a validator requiring the value to meet the minimum password-strength\n * requirements (see `SystemUtils.calculatePasswordStrength`). An empty value is\n * INVALID, exactly like the classic directive.\n * Signal-forms counterpart of `PasswordValidatorDirective`.\n * @param path - Path of the string field to validate.\n */\nexport function passwordValidator<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>): void {\n validate(path, ({ value }) => {\n const strength = SystemUtils.calculatePasswordStrength(value() ?? '');\n return strength.isValid ? undefined : { kind: 'password', message: 'Non valido.' };\n });\n}\n\n/**\n * Binds a validator requiring the value to be a valid `\"HH:MM\"` time string and,\n * when slots are provided, to fall within at least one of the allowed ranges.\n * An empty value is considered valid (pair with `required` if needed).\n * Signal-forms counterpart of `TimeValidatorDirective`.\n * @param path - Path of the string field to validate.\n * @param slots - Optional reactive function returning the pipe-separated allowed\n * ranges (e.g. `\"08:00-12:00|14:00-18:00\"`), or `undefined` for none.\n */\nexport function timeValidator<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>,\n slots?: () => string | undefined): void {\n /**\n * Parses a `\"HH:MM\"` time string into a comparable integer (e.g. `\"09:30\"` -> `930`).\n * Returns `-1` when the string is not a valid time.\n * @param value - The time string to parse.\n * @returns The comparable integer, or `-1` when invalid.\n */\n const getTime = (value: string): number => {\n const p = value.split(':');\n if (p.length !== 2) return -1;\n const hh = parseInt(p[0], 10);\n if (isNaN(hh) || hh < 0 || hh > 23) return -1;\n const mm = parseInt(p[1], 10);\n if (isNaN(mm) || mm < 0 || mm > 59) return -1;\n return hh * 100 + mm;\n };\n validate(path, ({ value }) => {\n const input = value();\n if (!input || input.length === 0) return undefined;\n const t = getTime(input);\n if (t === -1) return { kind: 'time', message: 'Non valido.' };\n const slotsValue = slots?.();\n if (slotsValue) {\n const isValid = slotsValue.split('|').some(s => {\n const t1 = getTime(s.substring(0, 5));\n const t2 = getTime(s.substring(6));\n return t1 !== -1 && t2 !== -1 && t1 <= t && t2 >= t;\n });\n if (!isValid) return { kind: 'time', message: 'Non valido.' };\n }\n return undefined;\n });\n}\n\n/**\n * Binds a validator requiring the value to strictly equal the value of another field\n * of the same form. Reactive on both fields, so the host field re-validates when the\n * other field changes (this replaces the `valueChanges` subscription of the directive).\n * Signal-forms counterpart of `EqualsValidatorDirective`.\n * @param path - Path of the field to validate.\n * @param other - Path of the field whose value must match.\n */\nexport function equalsValidator<TValue, TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,\n other: SchemaPath<TValue, SchemaPathRules.Supported>): void {\n validate(path, ctx => ctx.valueOf(other) === ctx.value()\n ? undefined\n : { kind: 'equals', message: 'Non valido.' });\n}\n\n/**\n * Binds a validator requiring the value to be either empty or a complete 6-digit\n * OTP code. A partial code (e.g. `\"12\"`) is invalid; emptiness is left to `required`.\n * Schema-level counterpart of the `OtpInputComponent` internal validator.\n * @param path - Path of the string field to validate.\n */\nexport function otpValidator<TPathKind extends PathKind = PathKind.Root>(\n path: SchemaPath<string, SchemaPathRules.Supported, TPathKind>): void {\n validate(path, ({ value }) => {\n const input = value() ?? '';\n if (input.length === 0) return undefined;\n return /^\\d{6}$/.test(input) ? undefined : { kind: 'otp', message: 'Non valido.' };\n });\n}\n","/*\n * Public API Surface of @arsedizioni/ars-utils/core.validators\n *\n * Template-driven form validators. Kept OUT of `core` on purpose: every one of them pulls in\n * `@angular/forms` (53 KB), and `core` is on the boot path of every application through\n * `ThemeService`, `BroadcastService` and friends. Importing a validator now costs `@angular/forms`\n * only to the lazy chunk that actually uses one.\n */\nexport * from './validators';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAQA;;;AAGG;MAMU,kBAAkB,CAAA;AAL/B,IAAA,WAAA,GAAA;;QAQW,IAAA,CAAA,SAAS,GAAG,KAAK,CAAsE,SAAS;sFAAC;AAW3G,IAAA;AATC;;;;AAIG;AACH,IAAA,QAAQ,CAAC,OAAwB,EAAA;AAC/B,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE;AAC3B,QAAA,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI;IAChC;8GAbW,kBAAkB,EAAA,IAAA,EAAA,EAA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 * Returns whether the URL is the silent link probe, whose failures must never reach the user.
521
+ *
522
+ * `/session/status` runs unconditionally at every bootstrap, including for users who never linked
523
+ * Evolution at all. When the API is unreachable, reporting that failure would show "Evolution non è
524
+ * disponibile" to somebody who never asked Evolution for anything: the error is still rethrown for
525
+ * the caller to observe, but nothing is broadcast.
526
+ * @param url - The request URL.
527
+ * @returns True when the URL is the status probe.
528
+ */
529
+ function isStatusProbe(url) {
530
+ return url.includes('/session/status');
531
+ }
519
532
  /**
520
533
  * Resolves the user-facing message for a failed request.
521
534
  * @param error - The raw HTTP error object.
@@ -641,7 +654,11 @@ function evolutionAuthInterceptor(serviceUri, flags = EvolutionServiceFlags.None
641
654
  // at all. Everything that gets here is an Evolution request anyway: the others returned
642
655
  // before the pipe was built.
643
656
  const errorStatus = parseInt(error?.status ?? '0');
644
- if (errorStatus === 401 && !isAuthEndpoint(authenticatedRequest.url)) {
657
+ if (isStatusProbe(authenticatedRequest.url)) {
658
+ // The silent probe stays silent: its caller reads the outcome from the rethrown error,
659
+ // nobody else needs to hear about it.
660
+ }
661
+ else if (errorStatus === 401 && !isAuthEndpoint(authenticatedRequest.url)) {
645
662
  // Expired or invalidated session on an authenticated request. Notified once: several
646
663
  // in-flight requests failing together is how a single expiry becomes a wall of dialogs.
647
664
  if (!sessionExpiredNotified) {
@@ -930,8 +947,8 @@ class LoginService {
930
947
  clear() { this.core.clear(); }
931
948
  // ── Lifecycle ───────────────────────────────────────────────────────────────
932
949
  /**
933
- * Initialises the service with the back-end URI and optional feature flags, and revalidates a
934
- * session that survived a page refresh instead of assuming it is still there.
950
+ * Initialises the service with the back-end URI and optional feature flags, and asks the API — the
951
+ * only party that can read the HttpOnly cookie — whether this browser still holds a session.
935
952
  *
936
953
  * Must be called once during application bootstrap, before any other method. What it used to do
937
954
  * on a refresh was announce `LOGIN_COMPLETED` on the strength of a value in local storage; the
@@ -955,12 +972,13 @@ class LoginService {
955
972
  this.handleBroadcastMessage(message);
956
973
  });
957
974
  }
958
- // A stored context means this browser signed in at some point, never that the session is still
959
- // alive: the API is the only one that knows, and it is asked here.
960
- if (this.core.loggedIn()) {
961
- this.core.loggingIn.set(true);
962
- this.restoreSession();
963
- }
975
+ // The probe runs UNCONDITIONALLY, where it used to run only when a stored context existed. The
976
+ // stored context is just a hint -- "this browser signed in at some point" -- and the cookie can
977
+ // outlive it: local storage cleared while the month-long cookie stayed put made this library
978
+ // declare "no link" with a perfectly valid session in the browser. The API is the only one that
979
+ // knows, and it is asked every time.
980
+ this.core.loggingIn.set(true);
981
+ this.restoreSession();
964
982
  }
965
983
  /**
966
984
  * Dispatches an incoming broadcast message to the appropriate handler.
@@ -1051,6 +1069,18 @@ class LoginService {
1051
1069
  return r;
1052
1070
  }));
1053
1071
  }
1072
+ /**
1073
+ * Asks the API whether this browser holds a live session, without ever failing with a 401: the
1074
+ * route is anonymous and answers `connected: false` to a caller with no session. This is the one
1075
+ * honest way to know the link state -- the auth cookie is HttpOnly and belongs to the API's host,
1076
+ * so it cannot be read from here, and its presence would prove nothing anyway, since the session
1077
+ * also lives server-side and may have been revoked or evicted.
1078
+ * @returns An observable that emits the `ApiResult<EvolutionSessionStatus>`.
1079
+ */
1080
+ status() {
1081
+ return this.httpClient
1082
+ .get(this.core.serviceUri + '/session/status');
1083
+ }
1054
1084
  /**
1055
1085
  * Reads the current session from the server, which resolves it from the auth cookie's claims.
1056
1086
  * Used to restore the state after a page refresh instead of trusting what local storage holds.
@@ -1073,25 +1103,49 @@ class LoginService {
1073
1103
  }));
1074
1104
  }
1075
1105
  /**
1076
- * Asks `/session/me` whether the restored session is still alive, and announces the login when it
1077
- * is.
1106
+ * Asks `/session/status` whether this browser holds a live session, and hydrates the context
1107
+ * through {@link me} when it does.
1078
1108
  *
1079
- * Nothing is cleared on failure, and that is deliberate: a failure here is not proof of a dead
1080
- * session -- the API may be unreachable, the proxy may have answered 502, the device may be
1081
- * offline -- and clearing on any of those would sign the user out with a perfectly valid cookie.
1082
- * A genuine 401 is a different matter and the interceptor has already reported it.
1109
+ * The probe is silent by construction: `/session/status` never answers 401, so a visitor who
1110
+ * never signed in -- or a cookie whose session has died -- comes back as `connected: false` with
1111
+ * no error broadcast and no dialog. Only then is the stale stored context cleared, so the
1112
+ * `loggedIn` signal tells the truth at every bootstrap.
1113
+ *
1114
+ * Nothing is cleared on a transport failure, and that is deliberate: an unreachable API is not
1115
+ * proof of a dead session -- the proxy may have answered 502, the device may be offline -- and
1116
+ * clearing on any of those would sign the user out with a perfectly valid cookie.
1083
1117
  * @returns void
1084
1118
  */
1085
1119
  restoreSession() {
1086
- this.me()
1087
- .pipe(finalize(() => this.core.loggingIn.set(false)))
1120
+ // Whether the probe handed over to `/session/me`, which then owns lowering `loggingIn`.
1121
+ let restoring = false;
1122
+ this.status()
1123
+ .pipe(finalize(() => { if (!restoring) {
1124
+ this.core.loggingIn.set(false);
1125
+ } }))
1088
1126
  .subscribe({
1089
1127
  next: r => {
1090
- if (r?.success) {
1091
- this.broadcastService.sendMessage(EvolutionMessages.LOGIN_COMPLETED);
1128
+ if (r?.success && r.value?.connected) {
1129
+ restoring = true;
1130
+ this.me()
1131
+ .pipe(finalize(() => this.core.loggingIn.set(false)))
1132
+ .subscribe({
1133
+ next: m => {
1134
+ if (m?.success) {
1135
+ this.broadcastService.sendMessage(EvolutionMessages.LOGIN_COMPLETED);
1136
+ }
1137
+ },
1138
+ // Consumed so the rethrown error is not reported a second time as an unhandled one.
1139
+ error: () => { }
1140
+ });
1141
+ }
1142
+ else if (this.core.loggedIn()) {
1143
+ // The stored context outlived its session: drop it, or the next bootstrap would keep
1144
+ // claiming a session that is gone.
1145
+ this.core.clear();
1092
1146
  }
1093
1147
  },
1094
- // Consumed so the rethrown error is not reported a second time as an unhandled one.
1148
+ // Transport failure: keep the stored hint, the next bootstrap will ask again.
1095
1149
  error: () => { }
1096
1150
  });
1097
1151
  }
@@ -1384,8 +1438,9 @@ class EvolutionService {
1384
1438
  get user() { return this.core.user; }
1385
1439
  /**
1386
1440
  * `true` when this browser has a session the API has accepted. It starts from the stored context
1387
- * and is confirmed -- or left to the interceptor's 401 handling -- by the `/session/me` call
1388
- * {@link initialize} makes.
1441
+ * and is settled -- raised or cleared -- by the silent `/session/status` probe {@link initialize}
1442
+ * makes, which is the one honest way to read a state that lives in an HttpOnly cookie plus a
1443
+ * server-side lease. This signal IS the link state: bind it, do not poll it.
1389
1444
  */
1390
1445
  get loggedIn() { return this.core.loggedIn; }
1391
1446
  /** `true` while an authentication is in flight. */