
    i                     `    d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	  G d de	          Z
dgZdS )	z&XML-REFERENCE values from :rfc:`9253`.    )ClassVar)unquoteurlparse)Self)vUric                       e Zd ZU dZdZee         ed<   edefd            Z	ededz  fd            Z
edee         fd            ZdS )	vXmlReferencezAn XML-REFERENCE.

    The associated value references an associated XML artifact and
    is a URI with an XPointer anchor value.

    This is defined in :rfc:`9253`, Section 7.
    zXML-REFERENCEdefault_valuereturnc                     | j         S )z'The XML reference URI of this property.)uri)selfs    W/root/projects/butler/venv/lib/python3.11/site-packages/icalendar/prop/xml_reference.pyxml_referencezvXmlReference.xml_reference   s     x    Nc                     t          | j                  }t          |j                  }|                    d          r|                    d          sdS |dd         S )a  The XPointer of the URI.

        The XPointer is defined in `W3C.WD-xptr-xpointer-20021219
        <https://www.rfc-editor.org/rfc/rfc9253.html#W3C.WD-xptr-xpointer-20021219>`_,
        and its use as an anchor is defined in `W3C.REC-xptr-framework-20030325
        <https://www.rfc-editor.org/rfc/rfc9253.html#W3C.REC-xptr-framework-20030325>`_.

        Returns:
            The decoded x-pointer or ``None`` if no valid x-pointer is found.
        z	xpointer()N	   )r   r   r   fragment
startswithendswith)r   parsedr   s      r   	x_pointerzvXmlReference.x_pointer   sa     $,--6?++"";// 	x7H7H7M7M 	4"~r   c                      | d          gS )zExamples of vXmlReference.z1http://example.com/doc.xml#xpointer(/doc/element) )clss    r   exampleszvXmlReference.examples,   s     GHHIIr   )__name__
__module____qualname____doc__r
   r   str__annotations__propertyr   r   classmethodlistr   r   r   r   r   r	   r	   
   s           $3M8C=222s    X 3:    X" Jd J J J [J J Jr   r	   N)r"   typingr   urllib.parser   r   icalendar.compatibilityr   icalendar.prop.urir   r	   __all__r   r   r   <module>r-      s    , ,       * * * * * * * * ( ( ( ( ( ( # # # # # #%J %J %J %J %JD %J %J %JP 
r   