{"version":3,"file":"eui-components-validators.mjs","sources":["../../validators/max-length-bytes.validator.ts","../../validators/eui-components-validators.ts"],"sourcesContent":["import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\n/**\n * @description\n * Validator function that checks if a form control value exceeds a specified byte length.\n * Measures actual byte size using UTF-8 encoding rather than character count.\n * Useful for validating input against database column byte limits or API payload size restrictions.\n * Returns validation error when encoded byte length exceeds the specified limit.\n * @param bytes - Maximum allowed byte length for the control value\n * @returns ValidatorFn that returns null if valid, or ValidationErrors object with maxLengthBytes error containing required and actual byte counts\n */\nexport const maxLengthBytes = (bytes: number): ValidatorFn => {\n    return (control: AbstractControl): ValidationErrors | null => {\n        const length: number = new TextEncoder().encode(control.value).length;\n        if (length > bytes) {\n            return {\n                maxLengthBytes: {\n                    required: bytes,\n                    actual: length,\n                },\n            };\n        }\n        return null;\n    };\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAEA;;;;;;;;AAQG;AACI,MAAM,cAAc,GAAG,CAAC,KAAa,KAAiB;IACzD,OAAO,CAAC,OAAwB,KAA6B;AACzD,QAAA,MAAM,MAAM,GAAW,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM;AACrE,QAAA,IAAI,MAAM,GAAG,KAAK,EAAE;YAChB,OAAO;AACH,gBAAA,cAAc,EAAE;AACZ,oBAAA,QAAQ,EAAE,KAAK;AACf,oBAAA,MAAM,EAAE,MAAM;AACjB,iBAAA;aACJ;QACL;AACA,QAAA,OAAO,IAAI;AACf,IAAA,CAAC;AACL;;ACxBA;;AAEG;;;;"}