o
    .j                      @  s^  d Z ddlmZ ddlZddlmZ ddlmZmZmZm	Z	m
Z
 ddlmZ ddlmZmZmZmZmZ ddlmZmZmZmZmZmZmZmZmZmZ dd	lmZ dd
l m!Z! ddl"m#Z#m$Z$ ddl%m&Z&m'Z'm(Z(m)Z)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7 erddl8m9Z9 ddl:m;Z; g Z<G dd de!Z=dgZ>dS )z$The base for :rfc:`5545` components.    )annotationsN)deepcopy)datedatetimetime	timedeltatimezone)Path)TYPE_CHECKINGAnyClassVarLiteraloverload)
CONCEPTS_TYPE_SETTERLINKS_TYPE_SETTERRELATED_TO_TYPE_SETTERcomments_propertyconcepts_propertylinks_propertyrefids_propertyrelated_to_propertysingle_utc_propertyuid_property)ComponentFactory)CaselessDict)InvalidCalendarJCalParsingError)ContentlineContentlines
Parametersq_joinq_split)ComponentIcalParser)DEFAULT_ENCODING)	VPROPERTYTypesFactory	vDDDListsvText)tzpis_date)Iterable)Selfc                      s>  e Zd ZU dZdZded< 	 dZded< 	 dZded< 	 dZded	< 	 dZ	ded
< 	 dZ
ded< 	 dZded< 	 e Zded< dZded< ded< 	 edddZedddZedd d!Zedd%d&Z fd'd(Zd)d* Z fd+d,Zdd-d.Zd/d0 Zedd2d3Z		4ddd9d:Zdd<d=Zefdd@dAZddBdCZ ddDdEZ!ddGdHZ"ddKdLZ#ddMdN fddOdPZ$ddRdSZ%	4	4dddWdXZ&e'e	ddd\d]Z(e'edd_d]Z(eddadbZ)e	ddded]Z(eddgdhZ*dddidjZ+dddkdlZ,dddmdnZ-dodp Z. fdqdrZ/e0dsdt Z1Z2e0dudvZ3e4ddxdyZ5e5j6dzdy Z5e5j7d{dy Z5e4dd|d}Z8e8j6d~d} Z8e8j7dd} Z8dddZ9edd Z:e;Z<e=Z>e?Z@eAZBeCZDeEZFe0ddZGd4ZHedd ZIe									ddddZJdddZKdddZLedddZMddǇ fddZNdddZOdddZP  ZQS )	ComponentzBase class for calendar components.

    Component is the base object for calendar, Event and the other
    components defined in :rfc:`5545`. Normally you will not use this class
    directly, but rather one of the subclasses.
    NzClassVar[str | None]name zClassVar[tuple[()]]required
singletonsmultiple	exclusivez-ClassVar[tuple[str] | tuple[tuple[str, str]]]	inclusiveFzClassVar[bool]ignore_exceptionszClassVar[TypesFactory]types_factoryz!ClassVar[ComponentFactory | None]_components_factorylist[Component]subcomponentsreturnr   c                 C  s   | j du r	t | _ | j S )zGet the component factory.N)r7   r   )clsr/   r/   L/home/thesage/.local/lib/python3.10/site-packages/icalendar/cal/component.py_get_component_factorym   s   
z Component._get_component_factorystrtype[Component]c                 C  s   |   |S )z|Return a component with this name.

        Parameters:
            name: Name of the component, i.e. ``VCALENDAR``
        )r=   get_component_class)r;   r.   r/   r/   r<   r@   t   s   zComponent.get_component_classcomponent_classNonec                 C  sj   t |dr
|jdu rt| d|  }||j}|dur.||ur.td|j d| || dS )a  Register a custom component class.

        Parameters:
            component_class: Component subclass to register.
                Must have a ``name`` attribute.

        Raises:
            ValueError: If ``component_class`` has no ``name`` attribute.
            ValueError: If a component with this name is already registered.

        Examples:
            Create a custom icalendar component with the name ``X-EXAMPLE``:

            .. code-block:: pycon

                >>> from icalendar import Component
                >>> class XExample(Component):
                ...     name = "X-EXAMPLE"
                ...     def custom_method(self):
                ...         return "custom"
                >>> Component.register(XExample)
        r.   Nz must have a 'name' attributezComponent 'z' is already registered as )hasattrr.   
ValueErrorr=   getadd_component_class)r;   rA   component_factoryexistingr/   r/   r<   register}   s   
zComponent.registervalue1date | datetime | timedelta | time | tuple | list
str | Nonec                 C  s`   t | tr!| s	dS tdd | D rdS tdd | D rdS dS t| r'dS t | tr.dS dS )a  Infer the ``VALUE`` parameter from a Python type.

        Parameters:
            value: Python native type, one of :class:`datetime.date`, :class:`datetime.datetime`,
                :class:`datetime.timedelta`, :class:`datetime.time`, :class:`tuple`,
                or :class:`list`.

        Returns:
            str or None: The ``VALUE`` parameter string, for example, "DATE",
                "TIME", or other string, or ``None``
                if no specific ``VALUE`` is needed.
        Nc                 s  s    | ]}t |V  qd S Nr)   .0itemr/   r/   r<   	<genexpr>   s    z.Component._infer_value_type.<locals>.<genexpr>DATEc                 s  s    | ]}t |tV  qd S rM   )
isinstancer   rN   r/   r/   r<   rQ          TIME)rS   listallr*   r   rJ   r/   r/   r<   _infer_value_type   s   

zComponent._infer_value_typec                   s"   t  j|i | g | _g | _dS )z#Set keys to upper for initial dict.N)super__init__r9   errors)selfargskwargs	__class__r/   r<   r[      s   
zComponent.__init__c                 C     dS )zAReturns True, CaselessDict would return False if it had no items.Tr/   r]   r/   r/   r<   __bool__      zComponent.__bool__c                   s   t  |S )z1Get property value from the component dictionary.)rZ   __getitem__)r]   keyr`   r/   r<   rf      s   zComponent.__getitem__c                 C  s"   z| | W S  t y   | Y S w )z Get property value with default.)KeyError)r]   rg   defaultr/   r/   r<   rE      s
   
zComponent.getc                 C  s   t t|  | j  S )zDReturns True if Component has no items or subcomponents, else False.)boolrV   valuesr9   rc   r/   r/   r<   is_empty   s   zComponent.is_empty   c                 C  s   |s|S t || jjr|}n6d}|rd|v r|d }nt || jjs9| |}|r9|}|du r1i }d|vr9||d< | j||}||}|rkt|dsOt |_| D ]\}	}
|
du re|	|jv rd|j|	= qS|
|j|	< qS|S )a  Encode values to icalendar property values.

        :param name: Name of the property.
        :type name: string

        :param value: Value of the property. Either of a basic Python type of
                      any of the icalendar's own property types.
        :type value: Python native type or icalendar property type.

        :param parameters: Property parameter dictionary for the value. Only
                           available, if encode is set to True.
        :type parameters: Dictionary

        :param encode: True, if the value should be encoded to one of
                       icalendar's own property types (Fallback is "vText")
                       or False, if not.
        :type encode: Boolean

        :returns: icalendar property value
        NVALUEparams)	rS   r6   	all_typesrY   for_propertyrC   r   ro   items)r;   r.   rJ   
parametersencodeobjvalue_paraminferredklassrg   rP   r/   r/   r<   _encode   s6   



zComponent._encodeTrs   dict[str, str] | Parametersrt   rj   c                   s   t |tr dv rt|} r*t |tr* dvr* fdd|D }n| }v rU }t |trQt |trI|| }n|| |}n||g}|< dS )a  Add a property.

        :param name: Name of the property.
        :type name: string

        :param value: Value of the property. Either of a basic Python type of
                      any of the icalendar's own property types.
        :type value: Python native type or icalendar property type.

        :param parameters: Property parameter dictionary for the value. Only
                           available, if encode is set to True.
        :type parameters: Dictionary

        :param encode: True, if the value should be encoded to one of
                       icalendar's own property types (Fallback is "vText")
                       or False, if not.
        :type encode: Boolean

        :returns: None
        )dtstampcreatedzlast-modified)rdateexdate
categoriesc                   s   g | ]
} | qS r/   ry   rO   vrt   r.   rs   r]   r/   r<   
<listcomp>E      z!Component.add.<locals>.<listcomp>N)rS   r   lowerr(   localize_utcrV   ry   append)r]   r.   rJ   rs   rt   oldvalr/   r   r<   add  s$   




zComponent.addr$   c                 C  sD   t |dr|jS t|tr|S | j||}t|tr |t}|S )z&Internal for decoding property values.
ical_value)	rC   r   rS   r&   r6   	from_icalr'   rt   r#   )r]   r.   rJ   decodedr/   r/   r<   _decodeW  s   



zComponent._decoderi   r   c                   sN    v r  }t |tr fdd|D S  |S |tu r%t |S )zReturns decoded value of property.

        A component maps keys to icalendar property value types.
        This function returns values compatible to native Python types.
        c                      g | ]}  |qS r/   r   r   r.   r]   r/   r<   r   s      z%Component.decoded.<locals>.<listcomp>)rS   rV   r   _markerrh   )r]   r.   ri   rJ   r/   r   r<   r   j  s   
zComponent.decodedc                   s2   dd t   D }|r fdd|D S |S )z*Returns a list of values (split on comma).c                 S  s   g | ]}| d qS )z" )stripr   r/   r/   r<   r     s    z(Component.get_inline.<locals>.<listcomp>c                   r   r/   r   )rO   valr   r/   r<   r     r   )r!   )r]   r.   decodevalsr/   r   r<   
get_inline}  s   zComponent.get_inlinec                   s2   |r fdd|D }j d t| < dS )z^Converts a list of values into comma separated string and sets value
        to that.
        c                   s   g | ]
}j  |d dqS )rm   )rt   r   )rO   rJ   r   r/   r<   r     r   z(Component.set_inline.<locals>.<listcomp>inlineN)r6   r    )r]   r.   rk   rt   r/   r   r<   
set_inline  s   zComponent.set_inline	componentc                 C  s   | j | dS )z%Add a subcomponent to this component.N)r9   r   )r]   r   r/   r/   r<   add_component  s   zComponent.add_componentselectcallable[[Component], bool]c                 C  sR   g }| g}|r'|  }|du s|j|kr||r|| |t|j |s|S )zWalk to given component.N)popr.   r   extendreversedr9   )r]   r.   r   resultstackr   r/   r/   r<   _walk  s   
zComponent._walkc                 C  rb   NTr/   )_r/   r/   r<   <lambda>  s    zComponent.<lambda>c                 C  s   |dur|  }| ||S )a  Recursively traverses component and subcomponents. Returns sequence
        of same. If name is passed, only components with name will be returned.

        :param name: The name of the component or None such as ``VEVENT``.
        :param select: A function that takes the component as first argument
          and returns True/False.
        :returns: A list of components that match.
        :rtype: list[Component]
        N)upperr   )r]   r.   r   r/   r/   r<   walk  s   zComponent.walkuidc                   s   | j  fdddS )zReturn a list of components with the given UID.

        Parameters:
            uid: The UID of the component.

        Returns:
            list[Component]: List of components with the given UID.
        c                   s
   | j  kS rM   r   )cr   r/   r<   r     s   
 z$Component.with_uid.<locals>.<lambda>)r   )r   )r]   r   r/   r   r<   with_uid  s   	zComponent.with_uid	recursivesortedlist[tuple[str, object]]c                 C  s   g }| j d }| dfg}|ru| \}}|r#|d||j f nP|d||j f |r5| n| }|D ]}	||	 }
t|
trS|
D ]	}||	|f qHq;||	|
f q;||df |rst	|j
D ]	}||df qi|s|S )z`Returns properties in this component and subcomponents as:
        [(name, value), ...]
        textFENDBEGINT)r6   r   r   r.   to_icalsorted_keyskeysrS   rV   r   r9   )r]   r   r   r   v_textr   compis_endproperty_namesr.   rk   rJ   subcomponentr/   r/   r<   property_items  s,   	


zComponent.property_itemsststr | bytesLiteral[False]c                 C     d S rM   r/   r;   r   r2   r/   r/   r<   r     s   zComponent.from_icalLiteral[True]c                 C  r   rM   r/   r   r/   r/   r<   r     re   r"   c                 C  s   t ||  | jS )z/Get the iCal parser for the given input string.)r"   r=   r6   )r;   r   r/   r/   r<   _get_ical_parser  s   zComponent._get_ical_parserstr | bytes | PathComponent | list[Component]c                 C  s   t |tr
| }n)t |tr3d|vr3d|vr3t|}z| }W n ty,   d}Y nw |r3| }| |}| }|r@|S t|dkrNt	| 
d|t|dk r\t	| 
d||d S )a  Parse iCalendar data into component instances.

        Handles standard and custom components (``X-*``, IANA-registered).

        Parameters:
            st: iCalendar data as bytes or string, or a path to an iCalendar file as
                :class:`pathlib.Path` or string.
            multiple: If ``True``, returns list. If ``False``, returns single component.

        Returns:
            Component or list of components

        See Also:
            :doc:`/how-to/custom-components` for examples of parsing custom components
        
Frm   z3Found multiple components where only one is allowedz1Found no components where exactly one is requiredr   )rS   r	   
read_bytesr>   is_fileOSErrorr   parselenrD   _format_error)r;   r   r2   pathr   parser
componentsr/   r/   r<   r     s8   


[...]c                 C  s^   d}t | t | t | |kr(|t |  t | }|  d|d |  d| S |  d| S )Na   z:  )r   )error_description	bad_inputelipsismax_error_lengthtruncate_tor/   r/   r<   r   (  s
   zComponent._format_errorc                 C  s    t |dt }tj||||dS )z!Returns property as content line.ro   r   )getattrr   r   
from_parts)r]   r.   rJ   r   ro   r/   r/   r<   content_line1  s   zComponent.content_linec                 C  sD   t  }| j|dD ]\}}| j|||d}|| q	|d |S )z<Converts the Component and subcomponents into content lines.r    )r   r   r   r   )r]   r   contentlinesr.   rJ   clr/   r/   r<   content_lines6  s   
zComponent.content_linesc                 C  s   | j |d}| S )z}
        :param sorted: Whether parameters and properties should be
                       lexicographically sorted.
        r   )r   r   )r]   r   r   r/   r/   r<   r   ?  s   zComponent.to_icalc                 C  s   g }d| fg}|rm|  }|d }|dkr|d nP|dkr%|d nF|d }t|trd||jp7t|j dt|  |j}|r^|d	 t	|D ]}|d|f |d
 qNn|d n|t
| |s	d|S )a  String representation of class with all of its subcomponents.

        Implemented iteratively rather than recursively so that calendars
        with deeply nested subcomponents do not raise ``RecursionError``.
        A pathological ``.ics`` payload of only ~13 KB can otherwise nest
        ``BEGIN:VEVENT`` ~500 levels and crash any caller that performs
        ``repr()``/``str()``/``f"{cal}"`` on the parsed calendar
        (e.g. logging, error reporting, debug pages).
        openr   commaz, close)rm   ()r   )r   r   )r   r   rS   r-   r.   type__name__dictr9   r   r>   join)r]   outr   framekindnodesubssubr/   r/   r<   __repr__H  s.   

$

zComponent.__repr__c                   sh   t | jt |jkrdS t |}|sdS | jD ]
}||jvr# dS q|jD ]
}|| jvr1 dS q'dS )NFT)r   r9   rZ   __eq__)r]   otherproperties_equalr   r`   r/   r<   r   u  s   



zComponent.__eq__DTSTAMPa@  RFC 5545:

        Conformance:  This property MUST be included in the "VEVENT",
        "VTODO", "VJOURNAL", or "VFREEBUSY" calendar components.

        Description: In the case of an iCalendar object that specifies a
        "METHOD" property, this property specifies the date and time that
        the instance of the iCalendar object was created.  In the case of
        an iCalendar object that doesn't specify a "METHOD" property, this
        property specifies the date and time that the information
        associated with the calendar component was last revised in the
        calendar store.

        The value MUST be specified in the UTC time format.

        In the case of an iCalendar object that doesn't specify a "METHOD"
        property, this property is equivalent to the "LAST-MODIFIED"
        property.
    zLAST-MODIFIEDa  RFC 5545:

        Purpose:  This property specifies the date and time that the
        information associated with the calendar component was last
        revised in the calendar store.

        Note: This is analogous to the modification date and time for a
        file in the file system.

        Conformance:  This property can be specified in the "VEVENT",
        "VTODO", "VJOURNAL", or "VTIMEZONE" calendar components.
    r   c                 C     | j p| jS )zDatetime when the information associated with the component was last revised.

        Since :attr:`LAST_MODIFIED` is an optional property,
        this returns :attr:`DTSTAMP` if :attr:`LAST_MODIFIED` is not set.
        )LAST_MODIFIEDr   rc   r/   r/   r<   last_modified     zComponent.last_modifiedc                 C  
   || _ d S rM   r   r]   rJ   r/   r/   r<   r        
c                 C     | ` d S rM   r   rc   r/   r/   r<   r        c                 C  r   )zDatetime when the information associated with the component was created.

        Since :attr:`CREATED` is an optional property,
        this returns :attr:`DTSTAMP` if :attr:`CREATED` is not set.
        )CREATEDr   rc   r/   r/   r<   r|     r   zComponent.createdc                 C  r   rM   r   r   r/   r/   r<   r|     r   c                 C  r   rM   r   rc   r/   r/   r<   r|     r   c                 C  s   t dd |  D S )zXWhether this component has attributes that indicate that Mozilla Thunderbird created it.c                 s  s    | ]}| d V  qdS )zX-MOZ-N)
startswith)rO   attrr/   r/   r<   rQ     rT   z+Component.is_thunderbird.<locals>.<genexpr>)anyr   rc   r/   r/   r<   is_thunderbird  s   zComponent.is_thunderbirdc                   C  s   t tjS )zReturn now as UTC value.)r   nowr   utcr/   r/   r/   r<   _utc_now  s   zComponent._utc_nowr   an  
        CREATED specifies the date and time that the calendar
        information was created by the calendar user agent in the calendar
        store.

        Conformance:
            The property can be specified once in "VEVENT",
            "VTODO", or "VJOURNAL" calendar components.  The value MUST be
            specified as a date with UTC time.

        c                 C  s(   | du s|du r
dS | |krt ddS )z{This validates start and end.

        Raises:
            ~error.InvalidCalendar: If the information is not valid
        Nzend must be after start)r   )startendr/   r/   r<   _validate_start_and_end  s
   z!Component._validate_start_and_endr|   date | Nonecommentslist[str] | str | Noneconceptsr   r   linksr   refids
related_tor   stampIterable[Component] | Nonec
                 C  sZ   |  }
||
_ ||
_||
_||
_||
_||
_||
_||
_|	dur+t|	t	r&|	nt	|	|
_
|
S )a  Create a new component.

        Parameters:
            comments: The :attr:`comments` of the component.
            concepts: The :attr:`concepts` of the component.
            created: The :attr:`created` of the component.
            last_modified: The :attr:`last_modified` of the component.
            links: The :attr:`links` of the component.
            related_to: The :attr:`related_to` of the component.
            stamp: The :attr:`DTSTAMP` of the component.
            subcomponents: The subcomponents of the component.

        Raises:
            ~error.InvalidCalendar: If the content is not valid
                according to :rfc:`5545`.

        .. warning:: As time progresses, we will be stricter with the
            validation.
        N)r   r|   r   r  r  r  r  r  rS   rV   r9   )r;   r|   r  r  r   r  r  r  r  r9   r   r/   r/   r<   new  s    zComponent.newrV   c                 C  s`   g }|   D ]\}}t|tr|n|gD ]}|||  qq| j |dd | jD gS )a  Convert this component to a jCal object.

        Returns:
            jCal object

        See also :attr:`to_json`.

        In this example, we create a simple VEVENT component and convert it to jCal:

        .. code-block:: pycon

            >>> from icalendar import Event
            >>> from datetime import date
            >>> from pprint import pprint
            >>> event = Event.new(summary="My Event", start=date(2025, 11, 22))
            >>> pprint(event.to_jcal())
            ['vevent',
             [['dtstamp', {}, 'date-time', '2025-05-17T08:06:12Z'],
              ['summary', {}, 'text', 'My Event'],
              ['uid', {}, 'text', 'd755cef5-2311-46ed-a0e1-6733c9e15c63'],
              ['dtstart', {}, 'date', '2025-11-22']],
             []]
        c                 S  s   g | ]}|  qS r/   )to_jcal)rO   r   r/   r/   r<   r   S  s    z%Component.to_jcal.<locals>.<listcomp>)rr   rS   rV   r   r  r   r.   r9   )r]   
propertiesrg   rJ   rP   r/   r/   r<   r  4  s   zComponent.to_jcalc                 C  s   t |  S )zReturn this component as a jCal JSON string.

        Returns:
            JSON string

        See also :attr:`to_jcal`.
        )jsondumpsr  rc   r/   r/   r<   to_jsonV  s   zComponent.to_jsonjcal
str | listc              	   C  s  t |tr
t|}t |trt|dkrtd| |d|\}}}t |ts/td| dg|d| | jkrB| 	| }|
|S |  }t |tsRtd| d|dt|D ]H\}}tj|| d|gd	 |d }	|d
 }
| j|	|
}td| |
|}W d   n1 sw   Y  || j|	kr|`||	| qVt |tstd| d
|dt|D ]#\}}td
| |j| 
| W d   n1 sw   Y  q|S )a  Create a component from a jCal list.

        Parameters:
            jcal: jCal list or JSON string according to :rfc:`7265`.

        Raises:
            ~error.JCalParsingError: If the jCal provided is invalid.
            ~json.JSONDecodeError: If the provided string is not valid JSON.

        This reverses :func:`to_json` and :func:`to_jcal`.

        The following code parses an example from :rfc:`7265`:

        .. code-block:: pycon

            >>> from icalendar import Component
            >>> jcal = ["vcalendar",
            ...   [
            ...     ["calscale", {}, "text", "GREGORIAN"],
            ...     ["prodid", {}, "text", "-//Example Inc.//Example Calendar//EN"],
            ...     ["version", {}, "text", "2.0"]
            ...   ],
            ...   [
            ...     ["vevent",
            ...       [
            ...         ["dtstamp", {}, "date-time", "2008-02-05T19:12:24Z"],
            ...         ["dtstart", {}, "date", "2008-10-06"],
            ...         ["summary", {}, "text", "Planning meeting"],
            ...         ["uid", {}, "text", "4088E990AD89CB3DBB484909"]
            ...       ],
            ...       []
            ...     ]
            ...   ]
            ... ]
            >>> calendar = Component.from_jcal(jcal)
            >>> print(calendar.name)
            VCALENDAR
            >>> print(calendar.prodid)
            -//Example Inc.//Example Calendar//EN
            >>> event = calendar.events[0]
            >>> print(event.summary)
            Planning meeting

           z(A component must be a list with 3 items.rX   zThe name must be a string.r   )r   rJ   zThe properties must be a list.rm   )r      Nz!The subcomponents must be a list.)rS   r>   r  loadsrV   r   r   r   r.   r@   	from_jcal	enumeratevalidate_propertyr6   rq   reraise_with_path_addedrn   r   r9   r   )r;   r  r.   r  r9   component_clsr   iprop	prop_name
prop_valueprop_clsv_propr   r/   r/   r<   r  `  sT   
.






zComponent.from_jcalr,   c                   s   |rt | S t  S )a  Copy the component.

        Parameters:
            recursive:
                If ``True``, this creates copies of the component, its subcomponents,
                and all its properties.
                If ``False``, this only creates a shallow copy of the component.

        Returns:
            A copy of the component.

        Examples:

            Create a shallow copy of a component:

            .. code-block:: pycon

                >>> from icalendar import Event
                >>> event = Event.new(description="Event to be copied")
                >>> event_copy = event.copy()
                >>> str(event_copy.description)
                'Event to be copied'

            Shallow copies lose their subcomponents:

            .. code-block:: pycon

                >>> from icalendar import Calendar
                >>> calendar = Calendar.example()
                >>> len(calendar.subcomponents)
                3
                >>> calendar_copy = calendar.copy()
                >>> len(calendar_copy.subcomponents)
                0

            A recursive copy also copies all the subcomponents:

            .. code-block:: pycon

                >>> full_calendar_copy = calendar.copy(recursive=True)
                >>> len(full_calendar_copy.subcomponents)
                3
                >>> full_calendar_copy.events[0] == calendar.events[0]
                True
                >>> full_calendar_copy.events[0] is calendar.events[0]
                False

        )r   rZ   copy)r]   r   r`   r/   r<   r*    s   1
zComponent.copyc                 C  rb   )zThis component is fully parsed.Fr/   rc   r/   r/   r<   is_lazy  re   zComponent.is_lazyc                 C  s   | S )zReturn the fully parsed component.

        For non-lazy components, this returns self.
        For lazy components, this parses the component and returns the result.
        r/   rc   r/   r/   r<   r     s   zComponent.parse)r:   r   )r.   r>   r:   r?   )rA   r?   r:   rB   )rJ   rK   r:   rL   rM   )Nrm   r   )r.   r>   rs   rz   rt   rj   )r.   r>   rJ   r$   )r.   r>   ri   r   r:   r   )rm   )r   r-   r:   rB   )r.   rL   r   r   r:   r8   )r   r>   r:   r8   )TT)r   rj   r   rj   r:   r   )F)r   r   r2   r   r:   r-   )r   r   r2   r   r:   r8   )r   r   r:   r"   )r   r   r2   rj   r:   r   )r   )T)r   rj   )r:   r   )r:   rj   )	NNNNNNNNN)r|   r  r  r  r  r   r   r  r  r   r  r  r  r   r  r  r9   r  r:   r-   )r:   rV   )r:   r>   )r  r  r:   r-   )r   rj   r:   r,   )r:   r,   )Rr   
__module____qualname____doc__r.   __annotations__r0   r1   r2   r3   r4   r5   r%   instancer6   r7   classmethodr=   r@   rI   staticmethodrY   r[   rd   rf   rE   rl   ry   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   propertyr   setterdeleterr|   r  r  r   r   r   r  r   r  r   r  r   r  r   r  r   _validate_newr
  r  r  r  r  r*  r+  r   __classcell__r/   r/   r`   r<   r-   /   s   
 %!
:
=




*.		-







0
"
X
5r-   )?r.  
__future__r   r  r*  r   r   r   r   r   r   pathlibr	   typingr
   r   r   r   r   icalendar.attrr   r   r   r   r   r   r   r   r   r   icalendar.cal.component_factoryr   icalendar.caselessdictr   icalendar.errorr   r   icalendar.parserr   r   r   r    r!   icalendar.parser.ical.componentr"   icalendar.parser_toolsr#   icalendar.propr$   r%   r&   r'   icalendar.timezoner(   icalendar.toolsr*   collections.abcr+   icalendar.compatibilityr,   r   r-   __all__r/   r/   r/   r<   <module>   s<    0       
S