<?php
namespace Claromentis\Infocapture\ExpressionLanguage;

$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"] = (@$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"] ?: array()) + array("_c8b38c7133c2e8460c1cca" . "42230ac6c2" => base64_decode("dGltZQ=" . "="), "_89ce61ea24153a7f65ebde6cdec" . "848e6" => base64_decode("VW5hcnkgd2l0aG91dCBjb2" . "1wbGVtZW50"), "_e608e5b5c4c34a67ba9" . "7ef84c1e16199" => base64_decode("Jw=" . "="), "_31767d7ad58e706" . "dbf47b7a51a0fe6c" . "4" => base64_decode("Y291b" . "nQ="), "_2607b52e0c7c" . "be84feb899b9f" . "9dc808b" => base64_decode("IGlzI" . "G5vdC" . "BhbGx" . "vd2Vk"), "_0df12b99a72ed4731f0f9" . "2e58bf0be9f" => base64_decode("VmFyaWFibGUgYWNjZXNzZWQgd2l0aG91d" . "CBAIG9yICQgb3BlcmF0b3Jz"), "_a9ee374afc05" . "581e71d9c7d34" . "c1347b6" => base64_decode("ZmllbGRzX" . "3VzZWQ="), "_822680520327e9387ae2d5c0" . "65ea52e1" => base64_decode("YXJyYXlfZmx" . "pcA=="), "_83dcb96e649" . "7727bea94783" . "c6ee8feb5" => base64_decode("ZGF" . "5"), "_24e0e36600d6" . "af77406a44bb6" . "18a6253" => base64_decode("dXNl" . "cg=="), "_e88a85951f3f8fa98206" . "de98132368fb" => base64_decode("IHdhcyBjYWxsZWQgd2l0" . "aCA="), "_f84c67b9049a39bce648be393e" . "1a75aa" => base64_decode("Q2Fubm90IGdldCBsYWJlbCBvZiBwc2V1ZG8tZmllbGQgKHN0YXR1cywgYXNzaWduZWQgdXN" . "lciwgY3VycmVudCBkYXRlKQ=="), "_5a10d346e32d755afd0d9f8e797f60" . "7f" => base64_decode("Q2FsbGluZyBmdW5jdGlvbiA" . "="), "_88844a7" . "05fb02fb" . "961f5b54" . "3f0ec6ed" . "b" => base64_decode("IGFyZ3VtZW50cyw" . "g"), "_591d75e5d2c1184cea962bea7f04ba" . "f8" => base64_decode("RnVuY3" . "Rpb24g"), "_6089b5763e680dcd44d523a1df131" . "ea2" => base64_decode("VW5rbm93biBzdGF0ZW1lbnQ" . "gdHlwZTog"), "_beda51f1fa" . "c032f72e660" . "5fb5aebbd72" => base64_decode("IHJlZmVyZW5jZWQgaW4gdGhlIGZvcm11bGEgZG9lcyBub3QgZXhp" . "c3Q="), "_e2ecb80cd1b605a951a" . "d84d608101ac4" => base64_decode("bW9u" . "dGg="), "_75c841c00792f22973eadb02555b26" . "40" => base64_decode("U29tZW9uZSBhZGRlZCBhIHBzZXVkby1maWVsZCBhbmQ" . "gZGlkIG5vdCBhZGQgSlMgY29kZSB0byBtYWtlIGl0IH" . "dvcms="), "_d230962d9a57dc6b" . "a2b774d9ba3bb81e" => base64_decode("bm" . "93"), "_98008a2489431a7d770a" . "34a809f7c0ab" => base64_decode("VW5rbm93biBpZGVudGlmaWVy" . "OiA="), "_d9daa82dd85b469" . "4a7537fc8e7b23ac" . "1" => base64_decode("VW5rbm93biBpZGVudGlmaWVyIG5h" . "bWVzcGFjZSB1c2VkOiA="), "_eb37e59c5c01d46b6f6" . "a830290ee33be" => base64_decode("IGV4cGVjdGV" . "k"), "_4d707fab93bebb00bbe69e81596" . "97c90" => base64_decode(""), "_f76d5c073dc763f7e10d3c701c11" . "9129" => base64_decode("RmllbG" . "Qg"), "_950c864c3fc" . "8d7c4db561ee" . "a71d4aca9" => base64_decode("eW" . "Vh" . "cg" . "=="), "_9a4aa8b0fc0352766c125" . "0a732a693ac" => base64_decode("VW5rbm93biB0aW1lIGVsZW1" . "lbnQgJw=="));
use Claromentis\Infocapture\ExpressionLanguage\Exception\EvaluationError;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\ArithmeticNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\EncapsulatedStringNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\FieldNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\IdentifierNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\StatementNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\UnaryNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\ValueNode;
use Claromentis\Infocapture\ExpressionLanguage\Nodes\NameNode;
class ValidatorVisitor extends AbstractVisitor
{
    const ALLOWED_FUNCTIONS = ['parseFloat' => 1, 'parseInt' => 1, 'parseString' => 1, 'round' => -1, 'concat' => -1];
    protected $field_set;
    protected $referenced_fields;
    public function __construct(\FBForm $_7392cbdbf5bdf4880fc8e5fbb070663d)
    {
        $_40283465f00ffd3ab92ea5af2f2b3559 = $_7392cbdbf5bdf4880fc8e5fbb070663d->GetAllFieldsSymnames();
        $this->field_set = $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_822680520327e938" . "7ae2d5c065ea52e1"]($_40283465f00ffd3ab92ea5af2f2b3559);
        $this->referenced_fields = [];
    }
    protected function GenerateIdent(IdentifierNode $_5c59c380aa5c5e5f18f039ad7757fe97, array $values)
    {
        $_024d8abd4af839286d8b693334fe2888 = $_5c59c380aa5c5e5f18f039ad7757fe97->Ident();
        switch ($_5c59c380aa5c5e5f18f039ad7757fe97->NS()) {
            case $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_24e0e36600d6af77406a4" . "4bb618a6253"]:
                return;
            case $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_d230962d9" . "a57dc6ba2b" . "774d9ba3bb" . "81e"]:
                
                
                switch ($_024d8abd4af839286d8b693334fe2888) {
                    case $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_83dcb96e6497727bea94783" . "c6ee8feb5"]:
                    case $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_e2ecb80cd1b6" . "05a951ad84d60" . "8101ac4"]:
                    case $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_950c864c3fc8d7c4db561eea" . "71d4aca9"]:
                    case $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_c8b38c7133c2e8460c1cca4" . "2230ac6c2"]:
                        return;
                    default:
                        throw new EvaluationError($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_9a4aa8b0fc0352766c" . "1250a732a693ac"] . $_024d8abd4af839286d8b693334fe2888 . $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_e608e5b5c4c34a67ba9" . "7ef84c1e16199"]);
                }
            case $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_4d707fab93bebb00bbe69e8159697c" . "90"]:
                if ($_024d8abd4af839286d8b693334fe2888 !== $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_d230962d9" . "a57dc6ba2b" . "774d9ba3bb" . "81e"]) {
                    throw new EvaluationError($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_98008a2489431a7d770a34a809f7c" . "0ab"] . $_024d8abd4af839286d8b693334fe2888);
                }
                break;
            default:
                throw new EvaluationError($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_d9daa82dd85b4" . "694a7537fc8e7b" . "23ac1"] . $_5c59c380aa5c5e5f18f039ad7757fe97->NS());
        }
    }
    protected function GeneratePseudoField(FieldNode $_5c59c380aa5c5e5f18f039ad7757fe97, string $_84a47bf606a9998bf4bc4a92343f6543)
    {
        if ($_5c59c380aa5c5e5f18f039ad7757fe97->Type() !== FieldNode::TYPE_VALUE) {
            throw new EvaluationError($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_f84c67b9049a39b" . "ce648be393e1a75a" . "a"]);
        }
        if (!isset(self::SPECIAL_FIELDS_SET[$_84a47bf606a9998bf4bc4a92343f6543])) {
            throw new \LogicException($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_75c841c00" . "792f22973e" . "adb02555b2" . "640"]);
        }
    }
    protected function GenerateField(FieldNode $_5c59c380aa5c5e5f18f039ad7757fe97, string $_84a47bf606a9998bf4bc4a92343f6543)
    {
        if ($_5c59c380aa5c5e5f18f039ad7757fe97->Type() !== FieldNode::TYPE_VALUE && $_5c59c380aa5c5e5f18f039ad7757fe97->Type() !== FieldNode::TYPE_LABEL) {
            throw new EvaluationError($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_0df12b99a72ed4731f" . "0f92e58bf0be9f"]);
        }
    }
    protected function GenerateFunctionCall($_9941c765fe74bedc7526c5d099b855b8, $values)
    {
        $_b4efa4b6cada59fab3ea38d2e3950eed = self::ALLOWED_FUNCTIONS[$_9941c765fe74bedc7526c5d099b855b8] ?? null;
        if (!isset($_b4efa4b6cada59fab3ea38d2e3950eed)) {
            throw new EvaluationError($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_5a10d346e32d755afd0d9f8e79" . "7f607f"] . $_9941c765fe74bedc7526c5d099b855b8 . $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_2607b52e0c7cbe84feb89" . "9b9f9dc808b"]);
        }
        if ($_b4efa4b6cada59fab3ea38d2e3950eed >= 0 && $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_31767d7ad58e706dbf47b7" . "a51a0fe6c4"]($values) != $_b4efa4b6cada59fab3ea38d2e3950eed) {
            throw new EvaluationError($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_591d75e5d2c1184cea962bea7f04ba" . "f8"] . $_9941c765fe74bedc7526c5d099b855b8 . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_e88a85951f3f8fa98206de981" . "32368fb"] . $_b4efa4b6cada59fab3ea38d2e3950eed . $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_88844a705fb02fb961" . "f5b543f0ec6edb"] . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_31767d7ad58e706dbf47b7a51" . "a0fe6c4"]($values) . $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_eb37e59c5c01d46b6f6a830290ee33b" . "e"]);
        }
        return $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_4d707fab93bebb00bbe69e815" . "9697c90"];
    }
    protected function GenerateName(NameNode $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        $var_name = $_5c59c380aa5c5e5f18f039ad7757fe97->VariableName();
        if (!isset($this->field_set[$var_name]) && !isset(self::SPECIAL_FIELDS_SET[$var_name])) {
            throw new EvaluationError($GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_f76d5c0" . "73dc763f" . "7e10d3c7" . "01c11912" . "9"] . $var_name . $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_beda51f1fac032f72e" . "6605fb5aebbd72"]);
        }
        $this->referenced_fields[$var_name] = true;
        return $var_name;
    }
    protected function GenerateArithmetic(ArithmeticNode $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        return $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_4d707fab93bebb00bbe69e8" . "159697c90"];
    }
    protected function GenerateValue(ValueNode $_5c59c380aa5c5e5f18f039ad7757fe97)
    {
        return $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_4d707fab93bebb00bbe" . "69e8159697c90"];
    }
    protected function GenerateUnary(UnaryNode $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        if ($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_31767d7ad58e706dbf47b7a51a0fe6" . "c4"]($values) != 1) {
            throw new EvaluationError($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_89ce61ea24153a7f65e" . "bde6cdec848e6"]);
        }
        return $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_4d707fab93bebb" . "00bbe69e8159697" . "c90"];
    }
    protected function GenerateStatement(StatementNode $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        return $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_4d707fab93bebb00bbe69e815969" . "7c90"];
    }
    protected function GenerateEncapsulatedString(EncapsulatedStringNode $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        return $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_4d707fab93bebb00bbe69e815" . "9697c90"];
    }
    protected function GenerateUnknown(Nodes\Node $_5c59c380aa5c5e5f18f039ad7757fe97, $values)
    {
        throw new EvaluationError($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_6089b5763e68" . "0dcd44d523a1d" . "f131ea2"] . $_5c59c380aa5c5e5f18f039ad7757fe97->Name());
    }
    protected function AssembleFinalState($values)
    {
        return [$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_a9ee374afc05581e71d9c7d3" . "4c1347b6"] => $this->referenced_fields];
    }
}