<?php
namespace Claromentis\Core\TextUtil\JBBCode;

$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] ?: array()) + array("_c927258f532" . "2288a992c77b" . "e40ae0b53" => base64_decode("dX" . "Js"));
use Claromentis\Core\TextUtil\ClaText;






class AutoLinkVisitor implements \JBBCode\NodeVisitor
{
    protected $in_url_tag = false;
    protected $cla_text;
    protected array $options = [];
    function __construct(ClaText $cla_text, array $options = [])
    {
        $this->cla_text = $cla_text;
        $this->options = $options;
    }
    function visitDocumentElement(\JBBCode\DocumentElement $_d132f6bc4a336c5bb52dc5648a5693f0)
    {
        foreach ($_d132f6bc4a336c5bb52dc5648a5693f0->getChildren() as $_1bd6e5a007d5639e67837f0567493081) {
            $_1bd6e5a007d5639e67837f0567493081->accept($this);
        }
    }
    function visitTextNode(\JBBCode\TextNode $_61f33b6db779a1b966e121dc5605306e)
    {
        if (!$this->in_url_tag) {
            $_61f33b6db779a1b966e121dc5605306e->setValue($this->cla_text->ParseLinks($_61f33b6db779a1b966e121dc5605306e->getValue(), $this->options));
        }
    }
    function visitElementNode(\JBBCode\ElementNode $_b8b6707212db450b2647d7d5649478b2)
    {
        
        
        
        
        if ($_b8b6707212db450b2647d7d5649478b2->getCodeDefinition()->parseContent()) {
            foreach ($_b8b6707212db450b2647d7d5649478b2->getChildren() as $_1bd6e5a007d5639e67837f0567493081) {
                if ($_b8b6707212db450b2647d7d5649478b2->getTagName() == $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_c927258f5322288a992c77be40ae0b5" . "3"]) {
                    $this->in_url_tag = true;
                }
                $_1bd6e5a007d5639e67837f0567493081->accept($this);
                $this->in_url_tag = false;
            }
        }
    }
}