{"version":3,"file":"ParseError.mjs","names":[],"sources":["../../esm/ParseError/ParseError.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/base/data/Equatable/definition\";\nfunction hasTag(u, tag) {\n    return typeof u === \"object\" && u !== null && \"_tag\" in u && u._tag === tag;\n}\n/**\n * @tsplus companion fncts.schema.ParseError.DeclarationError\n */\nexport class DeclarationError {\n    ast;\n    actual;\n    error;\n    _tag = 0 /* ParseErrorTag.Declaration */;\n    constructor(ast, actual, error) {\n        this.ast = ast;\n        this.actual = actual;\n        this.error = error;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return (hasTag(that, 0 /* ParseErrorTag.Declaration */) &&\n            context.comparator(this.ast, that.ast) &&\n            context.comparator(this.actual, that.actual) &&\n            context.comparator(this.error, that.error));\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.DeclarationError __call\n * @tsplus static fncts.schema.ParseErrorOps DeclarationError\n */\nexport function declarationError(ast, actual, error) {\n    return new DeclarationError(ast, actual, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.TypeError\n */\nexport class TypeError {\n    ast;\n    actual;\n    _tag = 1 /* ParseErrorTag.Type */;\n    constructor(ast, actual) {\n        this.ast = ast;\n        this.actual = actual;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return (hasTag(that, 1 /* ParseErrorTag.Type */) &&\n            context.comparator(this.ast, that.ast) &&\n            context.comparator(this.actual, that.actual));\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.TypeError __call\n * @tsplus static fncts.schema.ParseErrorOps TypeError\n */\nexport function typeError(expected, actual) {\n    return new TypeError(expected, actual);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.TypeLiteralError\n */\nexport class TypeLiteralError {\n    ast;\n    actual;\n    errors;\n    output;\n    _tag = 9 /* ParseErrorTag.TypeLiteral */;\n    constructor(ast, actual, errors, output = {}) {\n        this.ast = ast;\n        this.actual = actual;\n        this.errors = errors;\n        this.output = output;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return (hasTag(that, 9 /* ParseErrorTag.TypeLiteral */) &&\n            context.comparator(this.ast, that.ast) &&\n            context.comparator(this.actual, that.actual) &&\n            context.comparator(this.errors, that.errors) &&\n            context.comparator(this.output, that.output));\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.TypeLiteralError __call\n * @tsplus static fncts.schema.ParseErrorOps TypeLiteralError\n */\nexport function typeLiteralError(ast, actual, errors, output = {}) {\n    return new TypeLiteralError(ast, actual, errors, output);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.TupleError\n */\nexport class TupleError {\n    ast;\n    actual;\n    errors;\n    output;\n    _tag = 10 /* ParseErrorTag.Tuple */;\n    constructor(ast, actual, errors, output = []) {\n        this.ast = ast;\n        this.actual = actual;\n        this.errors = errors;\n        this.output = output;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return (hasTag(that, 10 /* ParseErrorTag.Tuple */) &&\n            context.comparator(this.ast, that.ast) &&\n            context.comparator(this.actual, that.actual) &&\n            context.comparator(this.errors, that.errors) &&\n            context.comparator(this.output, that.output));\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.TupleError __call\n * @tsplus static fncts.schema.ParseErrorOps TupleError\n */\nexport function tupleError(ast, actual, errors, output = []) {\n    return new TupleError(ast, actual, errors, output);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.IndexError\n */\nexport class IndexError {\n    index;\n    error;\n    _tag = 2 /* ParseErrorTag.Index */;\n    constructor(index, error) {\n        this.index = index;\n        this.error = error;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return (hasTag(that, 2 /* ParseErrorTag.Index */) &&\n            context.comparator(this.index, that.index) &&\n            context.comparator(this.error, that.error));\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.IndexError __call\n * @tsplus static fncts.schema.ParseErrorOps IndexError\n */\nexport function indexError(index, error) {\n    return new IndexError(index, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.KeyError\n */\nexport class KeyError {\n    keyAST;\n    key;\n    error;\n    _tag = 3 /* ParseErrorTag.Key */;\n    constructor(keyAST, key, error) {\n        this.keyAST = keyAST;\n        this.key = key;\n        this.error = error;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return (hasTag(that, 3 /* ParseErrorTag.Key */) &&\n            context.comparator(this.keyAST, that.keyAST) &&\n            context.comparator(this.key, that.key) &&\n            context.comparator(this.error, that.error));\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.KeyError __call\n * @tsplus static fncts.schema.ParseErrorOps KeyError\n */\nexport function keyError(keyAST, key, error) {\n    return new KeyError(keyAST, key, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.MissingError\n */\nexport class MissingError {\n    _tag = 4 /* ParseErrorTag.Missing */;\n    [tsplus_module_1.equalsSymbol](that) {\n        return hasTag(that, 4 /* ParseErrorTag.Missing */);\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseErrorOps MissingError\n */\nexport const missingError = new MissingError();\n/**\n * @tsplus companion fncts.schema.ParseError.UnexpectedError\n */\nexport class UnexpectedError {\n    actual;\n    _tag = 5 /* ParseErrorTag.Unexpected */;\n    constructor(actual) {\n        this.actual = actual;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return hasTag(that, 5 /* ParseErrorTag.Unexpected */) && context.comparator(this.actual, that.actual);\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.UnexpectedError __call\n * @tsplus static fncts.schema.ParseErrorOps UnexpectedError\n */\nexport function unexpectedError(actual) {\n    return new UnexpectedError(actual);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.UnionError\n */\nexport class UnionError {\n    ast;\n    actual;\n    errors;\n    _tag = 11 /* ParseErrorTag.Union */;\n    constructor(ast, actual, errors) {\n        this.ast = ast;\n        this.actual = actual;\n        this.errors = errors;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return (hasTag(that, 11 /* ParseErrorTag.Union */) &&\n            context.comparator(this.ast, that.ast) &&\n            context.comparator(this.actual, that.actual) &&\n            context.comparator(this.errors, that.errors));\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.UnionError __call\n * @tsplus static fncts.schema.ParseErrorOps UnionError\n */\nexport function unionError(ast, actual, errors) {\n    return new UnionError(ast, actual, errors);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.UnionMemberError\n */\nexport class UnionMemberError {\n    ast;\n    error;\n    _tag = 6 /* ParseErrorTag.UnionMember */;\n    constructor(ast, error) {\n        this.ast = ast;\n        this.error = error;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return (hasTag(that, 6 /* ParseErrorTag.UnionMember */) &&\n            context.comparator(this.ast, that.ast) &&\n            context.comparator(this.error, that.error));\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.UnionMemberError __call\n * @tsplus static fncts.schema.ParseErrorOps UnionMemberError\n */\nexport function unionMemberError(ast, error) {\n    return new UnionMemberError(ast, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.RefinementError\n */\nexport class RefinementError {\n    ast;\n    actual;\n    kind;\n    error;\n    _tag = 7 /* ParseErrorTag.Refinement */;\n    constructor(ast, actual, kind, error) {\n        this.ast = ast;\n        this.actual = actual;\n        this.kind = kind;\n        this.error = error;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return (hasTag(that, 7 /* ParseErrorTag.Refinement */) &&\n            context.comparator(this.ast, that.ast) &&\n            context.comparator(this.actual, that.actual) &&\n            context.comparator(this.kind, that.kind) &&\n            context.comparator(this.error, that.error));\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.RefinementError __call\n * @tsplus static fncts.schema.ParseErrorOps RefinementError\n */\nexport function refinementError(ast, actual, kind, error) {\n    return new RefinementError(ast, actual, kind, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.TransformationError\n */\nexport class TransformationError {\n    ast;\n    actual;\n    kind;\n    error;\n    _tag = 8 /* ParseErrorTag.Transformation */;\n    constructor(ast, actual, kind, error) {\n        this.ast = ast;\n        this.actual = actual;\n        this.kind = kind;\n        this.error = error;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return (hasTag(that, 8 /* ParseErrorTag.Transformation */) &&\n            context.comparator(this.ast, that.ast) &&\n            context.comparator(this.actual, that.actual) &&\n            context.comparator(this.kind, that.kind) &&\n            context.comparator(this.error, that.error));\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.TransformationError __call\n * @tsplus static fncts.schema.ParseErrorOps TransformationError\n */\nexport function transformationError(ast, actual, kind, error) {\n    return new TransformationError(ast, actual, kind, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.IterableError\n */\nexport class IterableError {\n    ast;\n    actual;\n    errors;\n    _tag = 12 /* ParseErrorTag.Iterable */;\n    constructor(ast, actual, errors) {\n        this.ast = ast;\n        this.actual = actual;\n        this.errors = errors;\n    }\n    [tsplus_module_1.equalsSymbol](that, context) {\n        return (hasTag(that, 12 /* ParseErrorTag.Iterable */) &&\n            context.comparator(this.ast, that.ast) &&\n            context.comparator(this.actual, that.actual) &&\n            context.comparator(this.errors, that.errors));\n    }\n}\n/**\n * @tsplus static fncts.schema.ParseError.IterableError __call\n * @tsplus static fncts.schema.ParseErrorOps IterableError\n */\nexport function iterableError(ast, actual, errors) {\n    return new IterableError(ast, actual, errors);\n}\n//# sourceMappingURL=ParseError.js.map"],"mappings":";;AACA,SAAS,OAAO,GAAG,KAAK;AACpB,QAAO,OAAO,MAAM,YAAY,MAAM,QAAQ,UAAU,KAAK,EAAE,SAAS;;;;;AAK5E,IAAa,mBAAb,MAA8B;CAC1B;CACA;CACA;CACA,OAAO;CACP,YAAY,KAAK,QAAQ,OAAO;AAC5B,OAAK,MAAM;AACX,OAAK,SAAS;AACd,OAAK,QAAQ;;CAEjB,CAAC,gBAAgB,cAAc,MAAM,SAAS;AAC1C,SAAQ,OAAO,MAAM,EAAkC,IACnD,QAAQ,WAAW,KAAK,KAAK,KAAK,IAAI,IACtC,QAAQ,WAAW,KA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