{"version":3,"file":"present-methods.mjs","names":[],"sources":["../../../../../../../../@warlock.js/seal/src/validators/methods/present-methods.ts"],"sourcesContent":["import {\r\n  presentIfEmptyRule,\r\n  presentIfInRule,\r\n  presentIfNotEmptyRule,\r\n  presentIfNotInRule,\r\n  presentIfRule,\r\n} from \"../../rules/conditional/present-if-rules\";\r\nimport { presentUnlessRule } from \"../../rules/conditional/present-unless-rules\";\r\nimport {\r\n  presentWithAllRule,\r\n  presentWithAnyRule,\r\n  presentWithRule,\r\n} from \"../../rules/conditional/present-with-rules\";\r\nimport {\r\n  presentWithoutAllRule,\r\n  presentWithoutAnyRule,\r\n  presentWithoutRule,\r\n} from \"../../rules/conditional/present-without-rules\";\r\nimport { BaseValidator } from \"../base-validator\";\r\n\r\n/**\r\n * Marker re-exported by the validators barrel so the dts bundler keeps this\r\n * module (and its `declare module` augmentation) in the bundled `.d.ts`.\r\n */\r\nexport const presentMethodsApplied = true;\r\n\r\ndeclare module \"../base-validator\" {\r\n  interface BaseValidator {\r\n    /**\r\n     * Field must be present if another field exists\r\n     */\r\n    presentWith(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another sibling field exists\r\n     */\r\n    presentWithSibling(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another field is missing\r\n     */\r\n    presentWithout(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another sibling field is missing\r\n     */\r\n    presentWithoutSibling(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another field equals a specific value\r\n     */\r\n    presentIf(field: string, value: any, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another sibling field equals a specific value\r\n     */\r\n    presentIfSibling(field: string, value: any, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present unless another field equals a specific value\r\n     */\r\n    presentUnless(field: string, value: any, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present unless another sibling field equals a specific value\r\n     */\r\n    presentUnlessSibling(field: string, value: any, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another field is empty\r\n     */\r\n    presentIfEmpty(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another sibling field is empty\r\n     */\r\n    presentIfEmptySibling(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another field is not empty\r\n     */\r\n    presentIfNotEmpty(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another sibling field is not empty\r\n     */\r\n    presentIfNotEmptySibling(field: string, errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another field's value is in the given array\r\n     */\r\n    presentIfIn(field: string, values: any[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another sibling field's value is in the given array\r\n     */\r\n    presentIfInSibling(field: string, values: any[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another field's value is NOT in the given array\r\n     */\r\n    presentIfNotIn(field: string, values: any[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if another sibling field's value is NOT in the given array\r\n     */\r\n    presentIfNotInSibling(field: string, values: any[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if all specified fields exist\r\n     */\r\n    presentWithAll(fields: string[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if all specified sibling fields exist\r\n     */\r\n    presentWithAllSiblings(fields: string[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if all specified fields are missing\r\n     */\r\n    presentWithoutAll(fields: string[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if all specified sibling fields are missing\r\n     */\r\n    presentWithoutAllSiblings(fields: string[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if any of the specified fields exists\r\n     */\r\n    presentWithAny(fields: string[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if any of the specified sibling fields exists\r\n     */\r\n    presentWithAnySiblings(fields: string[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if any of the specified fields is missing\r\n     */\r\n    presentWithoutAny(fields: string[], errorMessage?: string): this;\r\n\r\n    /**\r\n     * Field must be present if any of the specified sibling fields is missing\r\n     */\r\n    presentWithoutAnySiblings(fields: string[], errorMessage?: string): this;\r\n  }\r\n}\r\n\r\n// ==================== PRESENT: BASED ON FIELD PRESENCE ====================\r\n\r\n/**\r\n * Field must be present if another field exists\r\n */\r\nBaseValidator.prototype.presentWith = function (field: string, errorMessage?: string) {\r\n  return this.addRule(presentWithRule, errorMessage, {\r\n    field,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field exists\r\n */\r\nBaseValidator.prototype.presentWithSibling = function (field: string, errorMessage?: string) {\r\n  return this.addRule(presentWithRule, errorMessage, {\r\n    field,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if another field is missing\r\n */\r\nBaseValidator.prototype.presentWithout = function (field: string, errorMessage?: string) {\r\n  return this.addRule(presentWithoutRule, errorMessage, {\r\n    field,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field is missing\r\n */\r\nBaseValidator.prototype.presentWithoutSibling = function (field: string, errorMessage?: string) {\r\n  return this.addRule(presentWithoutRule, errorMessage, {\r\n    field,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n// ==================== PRESENT: BASED ON FIELD VALUE ====================\r\n\r\n/**\r\n * Field must be present if another field equals a specific value\r\n */\r\nBaseValidator.prototype.presentIf = function (field: string, value: any, errorMessage?: string) {\r\n  return this.addRule(presentIfRule, errorMessage, {\r\n    field,\r\n    value,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field equals a specific value\r\n */\r\nBaseValidator.prototype.presentIfSibling = function (\r\n  field: string,\r\n  value: any,\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(presentIfRule, errorMessage, {\r\n    field,\r\n    value,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present unless another field equals a specific value\r\n */\r\nBaseValidator.prototype.presentUnless = function (\r\n  field: string,\r\n  value: any,\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(presentUnlessRule, errorMessage, {\r\n    field,\r\n    value,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present unless another sibling field equals a specific value\r\n */\r\nBaseValidator.prototype.presentUnlessSibling = function (\r\n  field: string,\r\n  value: any,\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(presentUnlessRule, errorMessage, {\r\n    field,\r\n    value,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n// ==================== PRESENT: BASED ON FIELD EMPTY STATE ====================\r\n\r\n/**\r\n * Field must be present if another field is empty\r\n */\r\nBaseValidator.prototype.presentIfEmpty = function (field: string, errorMessage?: string) {\r\n  return this.addRule(presentIfEmptyRule, errorMessage, {\r\n    field,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field is empty\r\n */\r\nBaseValidator.prototype.presentIfEmptySibling = function (field: string, errorMessage?: string) {\r\n  return this.addRule(presentIfEmptyRule, errorMessage, {\r\n    field,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if another field is not empty\r\n */\r\nBaseValidator.prototype.presentIfNotEmpty = function (field: string, errorMessage?: string) {\r\n  return this.addRule(presentIfNotEmptyRule, errorMessage, {\r\n    field,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field is not empty\r\n */\r\nBaseValidator.prototype.presentIfNotEmptySibling = function (field: string, errorMessage?: string) {\r\n  return this.addRule(presentIfNotEmptyRule, errorMessage, {\r\n    field,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if another field's value is in the given array\r\n */\r\nBaseValidator.prototype.presentIfIn = function (\r\n  field: string,\r\n  values: any[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(presentIfInRule, errorMessage, {\r\n    field,\r\n    values,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field's value is in the given array\r\n */\r\nBaseValidator.prototype.presentIfInSibling = function (\r\n  field: string,\r\n  values: any[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(presentIfInRule, errorMessage, {\r\n    field,\r\n    values,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if another field's value is NOT in the given array\r\n */\r\nBaseValidator.prototype.presentIfNotIn = function (\r\n  field: string,\r\n  values: any[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(presentIfNotInRule, errorMessage, {\r\n    field,\r\n    values,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if another sibling field's value is NOT in the given array\r\n */\r\nBaseValidator.prototype.presentIfNotInSibling = function (\r\n  field: string,\r\n  values: any[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(presentIfNotInRule, errorMessage, {\r\n    field,\r\n    values,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n// ==================== PRESENT: BASED ON MULTIPLE FIELDS (ALL) ====================\r\n\r\n/**\r\n * Field must be present if all specified fields exist\r\n */\r\nBaseValidator.prototype.presentWithAll = function (fields: string[], errorMessage?: string) {\r\n  return this.addRule(presentWithAllRule, errorMessage, {\r\n    fields,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if all specified sibling fields exist\r\n */\r\nBaseValidator.prototype.presentWithAllSiblings = function (\r\n  fields: string[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(presentWithAllRule, errorMessage, {\r\n    fields,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if all specified fields are missing\r\n */\r\nBaseValidator.prototype.presentWithoutAll = function (fields: string[], errorMessage?: string) {\r\n  return this.addRule(presentWithoutAllRule, errorMessage, {\r\n    fields,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if all specified sibling fields are missing\r\n */\r\nBaseValidator.prototype.presentWithoutAllSiblings = function (\r\n  fields: string[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(presentWithoutAllRule, errorMessage, {\r\n    fields,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n// ==================== PRESENT: BASED ON MULTIPLE FIELDS (ANY) ====================\r\n\r\n/**\r\n * Field must be present if any of the specified fields exists\r\n */\r\nBaseValidator.prototype.presentWithAny = function (fields: string[], errorMessage?: string) {\r\n  return this.addRule(presentWithAnyRule, errorMessage, {\r\n    fields,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if any of the specified sibling fields exists\r\n */\r\nBaseValidator.prototype.presentWithAnySiblings = function (\r\n  fields: string[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(presentWithAnyRule, errorMessage, {\r\n    fields,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if any of the specified fields is missing\r\n */\r\nBaseValidator.prototype.presentWithoutAny = function (fields: string[], errorMessage?: string) {\r\n  return this.addRule(presentWithoutAnyRule, errorMessage, {\r\n    fields,\r\n    scope: \"global\",\r\n  });\r\n};\r\n\r\n/**\r\n * Field must be present if any of the specified sibling fields is missing\r\n */\r\nBaseValidator.prototype.presentWithoutAnySiblings = function (\r\n  fields: string[],\r\n  errorMessage?: string,\r\n) {\r\n  return this.addRule(presentWithoutAnyRule, errorMessage, {\r\n    fields,\r\n    scope: \"sibling\",\r\n  });\r\n};\r\n"],"mappings":";;;;;;;;;;;AAwBA,MAAa,wBAAwB;;;;AAmIrC,cAAc,UAAU,cAAc,SAAU,OAAe,cAAuB;CACpF,OAAO,KAAK,QAAQ,iBAAiB,cAAc;EACjD;EACA,OAAO;CACT,CAAC;AACH;;;;AAKA,cAAc,UAAU,qBAAqB,SAAU,OAAe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