Ë
    Fü´jÿ�  ã            	      ó”  — d Z ddlmZ ddlZddlmZ ddlmZmZ ddl	m
Z
 ddlmZ ddlmZ dd	lmZmZ dd
lmZ ddlmZ ddl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! ddl"m#Z# ddl$m%Z% ddl&m'Z' erddl(m)Z) ddl*Z*ddl*m+Z+  ejX                  d«      Z-ddddœZ. G d„ deeeee«      Z/ G d„ d«      Z0 G d„ dee«      Z1e/e%_2        y) zProvide the Submission class.é    )ÚannotationsN)Údumps)ÚTYPE_CHECKINGÚAny)Úurljoin)ÚConflict)ÚAPI_PATH)ÚClientExceptionÚ
InvalidURL)ÚCommentForest)ÚListing)ÚSubmissionListingMixin)Ú
RedditBase)ÚCreatedMixinÚFullnameMixinÚModNoteMixinÚThingModerationMixinÚUserContentMixin)ÚPollData)ÚRedditor)Ú	Subreddit)Úcachedproperty)ÚIterator)Úmodelszn\n\n!?(\[.*?])?\(?((https://((preview|i)\.redd\.it|reddit.com/link).*?)|(?!https)([a-zA-Z0-9]+( \".*?\")?))\)?ÚgifÚimgÚvideo)ÚAnimatedImageÚImageÚRedditVideoc                  ór  ‡ — e Zd ZdZdZedd„«       Zedd„«       Zedd„«       Z	e
dd„«       Ze
d d„«       Ze
dd„«       Z	 	 	 d!	 	 	 	 	 	 	 	 	 d"ˆ fd
„Zd#ˆ fd„Z	 	 	 	 	 	 d$d„Zd	ddœ	 	 	 	 	 	 	 d%d„Zd&ˆ fd„Zd'd„Zd(d„Zd)d„Zd*d„Zd	d	dddd	dœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d+d„Zd	dœd,d„Zd&d„Zd	dœd,d„Zˆ xZS )-Ú
Submissionar  A class for submissions to Reddit.

    .. include:: ../../typical_attributes.rst

    ========================== =========================================================
    Attribute                  Description
    ========================== =========================================================
    ``author``                 Provides an instance of :class:`.Redditor`.
    ``author_flair_text``      The text content of the author's flair, or ``None`` if
                               not flaired.
    ``clicked``                Whether or not the submission has been clicked by the
                               client.
    ``comments``               Provides an instance of :class:`.CommentForest`.
    ``created_utc``            Time the submission was created, represented in `Unix
                               Time`_.
    ``distinguished``          Whether or not the submission is distinguished.
    ``edited``                 Whether or not the submission has been edited.
    ``id``                     ID of the submission.
    ``is_original_content``    Whether or not the submission has been set as original
                               content.
    ``is_self``                Whether or not the submission is a selfpost (text-only).
    ``likes``                  The user's current vote status on the submission:
                               ``True`` if upvoted, ``False`` if downvoted, and ``None``
                               if not voted or not logged in.
    ``link_flair_template_id`` The link flair's ID.
    ``link_flair_text``        The link flair's text content, or ``None`` if not
                               flaired.
    ``locked``                 Whether or not the submission has been locked.
    ``name``                   Fullname of the submission.
    ``num_comments``           The number of comments on the submission.
    ``over_18``                Whether or not the submission has been marked as NSFW.
    ``permalink``              A permalink for the submission.
    ``poll_data``              A :class:`.PollData` object representing the data of this
                               submission, if it is a poll submission.
    ``saved``                  Whether or not the submission is saved.
    ``score``                  The number of upvotes for the submission.
    ``selftext``               The submissions' selftext - an empty string if a link
                               post.
    ``spoiler``                Whether or not the submission has been marked as a
                               spoiler.
    ``stickied``               Whether or not the submission is stickied.
    ``subreddit``              Provides an instance of :class:`.Subreddit`.
    ``title``                  The title of the submission.
    ``upvote_ratio``           The percentage of upvotes from all votes on the
                               submission.
    ``url``                    The URL the submission links to, or the permalink if a
                               selfpost.
    ========================== =========================================================

    .. _unix time: https://en.wikipedia.org/wiki/Unix_time

    Úidc                ó2  — t        j                  | «      }d|vrd|vr|d   }d|v rUt        | d¬«      ‚d|v r||j                  d«      dz      }n,|d   dk(  rt        | d¬«      ‚||j                  d«      dz      }|j	                  «       st        | «      ‚|S )	aï  Return the ID contained within a submission URL.

        :param url: A url to a submission in one of the following formats (http urls
            will also work):

            - ``"https://redd.it/2gmzqe"``
            - ``"https://reddit.com/comments/2gmzqe/"``
            - ``"https://www.reddit.com/r/redditdev/comments/2gmzqe/praw_https/"``
            - ``"https://www.reddit.com/gallery/2gmzqe"``

        :raises: :class:`.InvalidURL` if ``url`` is not a valid submission URL.

        ÚcommentsÚgalleryéÿÿÿÿÚrz+Invalid URL (subreddit, not submission): {})Úmessageé   z+Invalid URL (submission ID not present): {})r   Ú
_url_partsr   ÚindexÚisalnum)ÚurlÚpartsÚsubmission_ids      ú[/root/workspace/ytshorts/venv/lib/python3.12/site-packages/praw/models/reddit/submission.pyÚid_from_urlzSubmission.id_from_urlf   s±   € ô ×%Ñ% cÓ*ˆØ˜UÑ" y¸Ñ'=Ø! "™IˆMØ�e‰|Ü  Ð.[Ô\Ð\à˜%ÑØ! %§+¡+¨iÓ"8¸1Ñ"<Ñ=‰Mà�2‰Y˜*Ò$Ü˜SÐ*WÔXÐXð " %§+¡+¨jÓ"9¸AÑ"=Ñ>ˆMà×$Ñ$Ô&Ü˜S“/Ð!ØÐó    c                ó   — t        | «      S )a\  Provide an instance of :class:`.SubmissionFlair`.

        This attribute is used to work with flair as a regular user of the subreddit the
        submission belongs to. Moderators can directly use :meth:`.flair`.

        For example, to select an arbitrary editable flair text (assuming there is one)
        and set a custom value try:

        .. code-block:: python

            choices = submission.flair.choices()
            template_id = next(x for x in choices if x["flair_text_editable"])["flair_template_id"]
            submission.flair.select(template_id, text="my custom value")

        )ÚSubmissionFlair©Úselfs    r1   ÚflairzSubmission.flairˆ   s   € ô" ˜tÓ$Ð$r3   c                ó   — t        | «      S )zÓProvide an instance of :class:`.SubmissionModeration`.

        Example usage:

        .. code-block:: python

            submission = reddit.submission("8dmv8z")
            submission.mod.approve()

        )ÚSubmissionModerationr6   s    r1   ÚmodzSubmission.mod›   s   € ô $ DÓ)Ð)r3   c                óH   — | j                   j                  j                  d   S )zThe class's kind.Ú
submission)Ú_redditÚconfigÚkindsr6   s    r1   Ú_kindzSubmission._kind©   s   € ð �|‰|×"Ñ"×(Ñ(¨Ñ6Ð6r3   c                ó   — | j                   S )a  Provide an instance of :class:`.CommentForest`.

        This attribute can be used, for example, to obtain a flat list of comments, with
        any :class:`.MoreComments` removed:

        .. code-block:: python

            submission.comments.replace_more(limit=0)
            comments = submission.comments.list()

        Sort order and comment limit can be set with the ``comment_sort`` and
        ``comment_limit`` attributes before comments are fetched, including any call to
        :meth:`.replace_more`. Setting either attribute after the comments have been
        fetched raises a :class:`.ClientException`:

        .. code-block:: python

            submission.comment_sort = "new"
            comments = submission.comments.list()

        .. note::

            The appropriate values for ``"comment_sort"`` include ``"confidence"``,
            ``"controversial"``, ``"new"``, ``"old"``, ``"q&a"``, and ``"top"``

        See :ref:`extracting_comments` for more on working with a
        :class:`.CommentForest`.

        )Ú	_commentsr6   s    r1   r%   zSubmission.comments®   s   € ð@ �~‰~Ðr3   c                ój   — t        | j                  j                  j                  | j                  «      S )z½A shortlink to the submission.

        For example, https://redd.it/eorhm is a shortlink for
        https://www.reddit.com/r/announcements/comments/eorhm/reddit_30_less_typing/.

        )r   r>   r?   Ú	short_urlr#   r6   s    r1   Ú	shortlinkzSubmission.shortlinkÐ   s%   € ô �t—|‘|×*Ñ*×4Ñ4°d·g±gÓ>Ð>r3   Nc                óî   •— t        d„ |||fD «       «      dk7  rd}t        |«      ‚d| _        d| _        |r|| _        n|r| j                  |«      | _        t        ‰| �  ||¬«       i | _        i | _	        y)a2  Initialize a :class:`.Submission` instance.

        :param reddit: An instance of :class:`.Reddit`.
        :param id: A reddit base36 submission ID, e.g., ``"2gmzqe"``.
        :param url: A URL supported by :meth:`.id_from_url`.

        Either ``id`` or ``url`` can be provided, but not both.

        c              3  ó&   K  — | ]	  }|€Œd–— Œ y ­w)Nr*   © )Ú.0Úvalues     r1   ú	<genexpr>z&Submission.__init__.<locals>.<genexpr>ê   s   è ø€ ÒD�U°%Ñ2CŒqÑDùs   ‚Šr*   z8Exactly one of 'id', 'url', or '_data' must be provided.i   Ú
confidence©Ú_dataN)
ÚsumÚ	TypeErrorÚcomment_limitÚcomment_sortr#   r2   ÚsuperÚ__init__Ú_additional_fetch_paramsÚ_comments_by_id)r7   Úredditr#   r.   rO   ÚmsgÚ	__class__s         €r1   rU   zSubmission.__init__Ú   s�   ø€ ô  ÑD˜r 3¨Ð.ÔDÓDÈÒIØLˆCÜ˜C“.Ð Ø!ˆÔð )ˆÔáØˆD�GÙØ×&Ñ& sÓ+ˆDŒGä‰Ñ˜ uÐÔ-à(*ˆÔ%Ø!ˆÕr3   c                ó&  •— |dk(  r!t        j                  | j                  |«      }nZ|dk(  rt        | j                  |«      }n>|dk(  rt	        | j                  |«      }n"|dv rt        | dd«      rd|›d�}t        |«      ‚t        ‰| �!  ||«       y	)
z6Objectify author, subreddit, and poll data attributes.ÚauthorÚ	subredditÚ	poll_data>   rS   rR   Ú_fetchedFzCannot update zD because the comments for this submission have already been fetched.N)	r   Ú	from_datar>   r   r   Úgetattrr
   rT   Ú__setattr__)r7   Ú	attributerK   rY   rZ   s       €r1   rb   zSubmission.__setattr__ü   s�   ø€ à˜Ò Ü×&Ñ& t§|¡|°UÓ;‰EØ˜+Ò%Ü˜dŸl™l¨EÓ2‰EØ˜+Ò%Ü˜TŸ\™\¨5Ó1‰EØÐ;Ñ;ÄÈÈjÐZ_Ô@`Ø" 9 -Ð/sÐtˆCÜ! #Ó&Ð&Ü‰Ñ˜I uÕ-r3   c             #  óÖ   K  — | j                   g}|r||D �cg c]  }|j                   ‘Œ c}z  }t        dt        |«      |«      D ]  }dj                  |||dz    «      –— Œ y c c}w ­w)Nr   ú,é2   )ÚfullnameÚrangeÚlenÚjoin)r7   Ú
chunk_sizeÚother_submissionsÚall_submissionsÚxÚpositions         r1   Ú_chunkzSubmission._chunk	  so   è ø€ ð  Ÿ=™=˜/ˆÙØÐ4EÖF¨q §
£
ÒFÑFˆOä˜a¤ _Ó!5°zÓBò 	FˆHØ—(‘(˜?¨8°hÀ±mÐDÓEÓEñ	Fùò  Gùs   ‚A)—A$ª?A)F)Úinline_mediaÚpreserve_inline_mediac               óÂ  — | j                   ddœ}d}t        j                  |«      r| j                  rd}|rO |j                  d
i |j                  «       D ��ci c]!  \  }}|| j                  j                  |«      “Œ# c}}¤Ž}d}|r=| j                  j                  |«      }|r| j                  |«       t        |«      |d<   n||d<   | j                  j                  t        d   |¬«      }	|sN|	d   }	d	D ]  }
|
|	j                  v sŒt        |	|
«       Œ | j                  j!                  |	j                  «       | S | j                  j!                  |	«       | S c c}}w )a«  Replace the body of the object with ``body``.

        :param body: The Markdown formatted content for the updated object.
        :param preserve_inline_media: Attempt to preserve inline media in ``body``.

            .. danger::

                This method is experimental. It is reliant on undocumented API endpoints
                and may result in existing inline media not displaying correctly and/or
                creating a malformed body. Use at your own risk. This method may be
                removed in the future without warning.

        :param inline_media: A dict of :class:`.InlineMedia` objects where the key is
            the placeholder name in ``body``.

        :returns: The current instance after updating its attributes.

        Example usage:

        .. code-block:: python

            from praw.models import InlineGif, InlineImage, InlineVideo

            submission = reddit.submission("5or86n")
            gif = InlineGif(path="path/to/image.gif", caption="optional caption")
            image = InlineImage(path="path/to/image.jpg", caption="optional caption")
            video = InlineVideo(path="path/to/video.mp4", caption="optional caption")
            body = "New body with a gif {gif1} an image {image1} and a video {video1} inline"
            media = {"gif1": gif, "image1": image, "video1": video}
            submission._edit_experimental(submission.selftext + body, inline_media=media)

        T)Úthing_idÚvalidate_on_submitFÚrichtext_jsonÚtextÚedit©Údatar   )r_   r>   Ú_submissionÚrepliesr]   rI   )rg   ÚINLINE_MEDIA_PATTERNÚsearchÚmedia_metadataÚformatÚitemsr]   Ú_upload_inline_mediaÚ_convert_to_fancypantsÚ_replace_richtext_linksr   r>   Úpostr	   Ú__dict__ÚdelattrÚupdate)r7   Úbodyrq   rr   rz   Úis_richtext_jsonÚplaceholderÚmediarv   Úupdatedrc   s              r1   Ú_edit_experimentalzSubmission._edit_experimental  sc  € ðP Ÿ™Ø"&ñ
ˆð !ÐÜ×&Ñ& tÔ,°×1DÒ1DØ#ÐÙØ�4—;‘;ñ Øbn×btÑbtÓbv÷"ÙL^ÈKÐY^�˜TŸ^™^×@Ñ@ÀÓGÑGó"ñ ˆDð  $ÐÙØ ŸN™N×AÑAÀ$ÓGˆMÙ$Ø×,Ñ,¨]Ô;Ü$)¨-Ó$8ˆD�Ò!àˆD�‰LØ—,‘,×#Ñ#¤H¨VÑ$4¸4Ð#Ó@ˆÙØ˜a‘jˆGðò 0�	ð  × 0Ñ 0Ò0Ü˜G YÕ/ð0ð �M‰M× Ñ  ×!1Ñ!1Ô2ð ˆð �M‰M× Ñ  Ô)Øˆùó5"s   Á&Ec                ó’  •— | j                  «       }|\  }}t        | j                  |d   ¬«      }|d   d   d   d   } t        | «      | j                  |¬«      }|`|`t        | «      |_        | j                  j                  |j                  «       | j                  j                  |j                  «       t        ‰| �9  «        y )Nrz   rN   Úchildrenr   )Ú_fetch_datar   r>   ÚtyperR   rS   r   rC   r†   rˆ   r%   Ú_updater�   rT   Ú_fetch)r7   rz   Úsubmission_listingÚcomment_listingÚsubmission_datar=   rZ   s         €r1   r”   zSubmission._fetcha  s³   ø€ Ø×ÑÓ!ˆØ.2Ñ+Ð˜OÜ! $§,¡,°oÀfÑ6MÔNˆà,¨VÑ4°ZÑ@ÀÑCÀFÑKˆØ”T˜$“Z §¡°OÔDˆ
ØÐ$ØÐ#Ü,¨TÓ2ˆ
Ôà�‰×Ñ˜Z×0Ñ0Ô1Ø�‰×Ñ˜o×6Ñ6Ô7Ü‰‰Õr3   c                óè   — | j                  «       \  }}}|j                  | j                  j                  «       «       t	        |   j
                  di |¤Ž}| j                  j                  d||¬«      S )NÚGET)ÚmethodÚparamsÚpathrI   )Ú_fetch_inforˆ   rV   Úcopyr	   r€   r>   Úrequest)r7   ÚnameÚfieldsr›   rœ   s        r1   r‘   zSubmission._fetch_datap  se   € Ø#×/Ñ/Ó1Ñˆˆf�fØ�‰�d×3Ñ3×8Ñ8Ó:Ô;Ü˜‰~×$Ñ$Ñ. vÑ.ˆØ�|‰|×#Ñ#¨5¸ÀdÐ#ÓKÐKr3   c                óR   — dd| j                   i| j                  | j                  dœfS )Nr=   r#   )ÚlimitÚsort)r#   rR   rS   r6   s    r1   r�   zSubmission._fetch_infov  s.   € àØ�4—7‘7ˆOØ×(Ñ(°$×2CÑ2CÑDð
ð 	
r3   c                óÐ  — | j                   j                  «       D ��ci c]  \  }}|t        |d      “Œ }}}t        |d   d d  «      D �]  \  }}|j	                  d«      }t        |t        «      r|j	                  d«      dv sJ d«       ‚ŒC|j	                  d«      D ]¾  }|j	                  d«      dk(  sŒt        |«      }	|d   j                  d«      d	   j                  d
«      d   }
|	j                  t        j                  d|
«      «      }|sŒt|j                  «       }||   |dœ}|j	                  d«      |j	                  d«      k7  r|d   |d<   ||d   |<   ŒÀ �Œ y c c}}w )NÚeÚdocumentÚc>   r   r   r   zDUnexpected richtext JSON schema. Please file a bug report with PRAW.ÚlinkÚuzhttps://r*   ú?r   z[./])r¦   r#   Út)r   r�   ÚMEDIA_TYPE_MAPPINGÚ	enumerateÚgetÚ
isinstanceÚstrÚsetÚsplitÚintersectionÚreÚpop)r7   rv   Úmedia_idrK   Úparsed_media_typesr,   ÚelementÚelement_itemsÚitemÚidsr.   Ú
matched_idÚcorrect_elements                r1   r„   z"Submission._replace_richtext_links}  sx  € àLP×L_ÑL_×LeÑLeÓLg÷
Ù9H¸À5ˆHÔ(¨¨s©Ñ4Ñ4ð
Ðñ 
ô (¨°jÑ(AÁ!Ð(DÓEó 	K‰NˆE�7Ø#ŸK™K¨Ó,ˆMÜ˜-¬Ô-Ø—{‘{ 3Ó'Ð+BÑBð ØZóÐBð ØŸ™ CÓ(ò K�Ø—8‘8˜C“= FÓ*ÜÐ0Ó1�Cà˜s™)Ÿ/™/¨*Ó5°aÑ8×>Ñ>¸sÓCÀAÑF�Cà!$×!1Ñ!1´"·(±(¸7ÀCÓ2HÓ!I�JÚ!Ø%/§^¡^Ó%5˜
à!3°JÑ!?Ø",ñ+˜ð  Ÿ8™8 C›=¨D¯H©H°S«MÒ9Ø37¸±9˜O¨CÑ0Ø;J˜ jÑ1°%Ò8òKñ	Kùó	
s   žE"c                ó¢   — t        | dd«      r3d| j                  j                  j                  «       › d�}t	        |«      ‚|| j
                  |<   y)aß  Add a parameter to be used for the next fetch.

        :param key: The key of the fetch parameter.
        :param value: The value of the fetch parameter.

        :raises ClientException: If the submission has already been fetched, since fetch
            parameters only affect the initial fetch and would otherwise have no effect.

        Fetch parameters must be added before the submission is fetched, i.e., before
        any of its attributes are accessed. For example, to fetch a submission with the
        ``rtjson`` attribute populated:

        .. code-block:: python

            submission = reddit.submission("mcqjl8")
            submission.add_fetch_param("rtj", "all")
            print(submission.rtjson)

        r_   Fz$Cannot add fetch parameters to this z% because it has already been fetched.N)ra   rZ   Ú__name__Úlowerr
   rV   )r7   ÚkeyrK   rY   s       r1   Úadd_fetch_paramzSubmission.add_fetch_paramš  sU   € ô( �4˜ UÔ+à6°t·~±~×7NÑ7N×7TÑ7TÓ7VÐ6WØ7ð8ð ô " #Ó&Ð&Ø-2ˆ×%Ñ% cÒ*r3   T)Úflair_idÚ
flair_textÚnsfwÚsend_repliesÚspoilerÚtitlec               ó>  — |€| j                   }| j                  dt        |«      t        |«      t        |«      t        |«      |dœ}|j	                  d|fd|ffD �	�
ci c]  \  }	}
|
€Œ	|	|
“Œ c}
}	«       | j
                  j                  t        d   |¬«      S c c}
}	w )a)  Crosspost the submission to a subreddit.

        .. note::

            Be aware you have to be subscribed to the target subreddit.

        :param subreddit: Name of the subreddit or :class:`.Subreddit` object to
            crosspost into.
        :param flair_id: The flair template to select (default: ``None``).
        :param flair_text: If the template's ``flair_text_editable`` value is ``True``,
            this value will set a custom text (default: ``None``).
        :param nsfw: Whether the submission should be marked NSFW (default: ``False``).
        :param send_replies: When ``True``, messages will be sent to the created
            submission's author when comments are made to the submission (default:
            ``True``).
        :param spoiler: Whether the submission should be marked as a spoiler (default:
            ``False``).
        :param title: Title of the submission. Will use this submission's title if
            ``None`` (default: ``None``).

        :returns: A :class:`.Submission` object for the newly created submission.

        Example usage:

        .. code-block:: python

            submission = reddit.submission("5or86n")
            cross_post = submission.crosspost("learnprogramming", send_replies=False)

        .. seealso::

            :meth:`.hide`

        Ú	crosspost)Úcrosspost_fullnameÚkindrÆ   ÚsendrepliesrÈ   ÚsrrÉ   rÄ   rÅ   Úsubmitry   )rÉ   rg   Úboolr±   rˆ   r>   r…   r	   )r7   r]   rÄ   rÅ   rÆ   rÇ   rÈ   rÉ   rz   rÂ   rK   s              r1   rË   zSubmission.crosspost¶  s«   € ðZ ˆ=Ø—J‘JˆEð #'§-¡-ØÜ˜“JÜ Ó-Ü˜G“}Ü�i“.Øñ
ˆð 	�‰Ø+5°xÐ*@À<ÐQ[ÐB\Ð)]÷
Ù%˜3 ÐafÑarˆC�‰Jó
ô 	ð �|‰|× Ñ ¤¨(Ñ!3¸$Ð Ó?Ð?ùó	
s   Á
B
Á(B
)rl   c               ó€   — | j                  d|¬«      D ](  }| j                  j                  t        d   d|i¬«       Œ* y)aœ  Hide :class:`.Submission`.

        :param other_submissions: When provided, additionally hide this list of
            :class:`.Submission` instances as part of a single request (default:
            ``None``).

        Example usage:

        .. code-block:: python

            submission = reddit.submission("5or86n")
            submission.hide()

        .. seealso::

            :meth:`.unhide`

        rf   ©rk   rl   Úhider#   ry   N©rp   r>   r…   r	   ©r7   rl   Úsubmissionss      r1   rÔ   zSubmission.hideõ  sD   € ð&  Ÿ;™;°"ÐHY˜;ÓZò 	JˆKØ�L‰L×Ñœh vÑ.°d¸KÐ5HÐÕIñ	Jr3   c                óh   — d| j                   i}| j                  j                  t        d   |¬«       y)zùMark submission as visited.

        This method requires a subscription to reddit premium.

        Example usage:

        .. code-block:: python

            submission = reddit.submission("5or86n")
            submission.mark_visited()

        ÚlinksÚstore_visitsry   N)rg   r>   r…   r	   ©r7   rz   s     r1   Úmark_visitedzSubmission.mark_visited  s.   € ð ˜Ÿ™Ð'ˆØ�‰×Ñœ( >Ñ2¸ÐÕ>r3   c               ó€   — | j                  d|¬«      D ](  }| j                  j                  t        d   d|i¬«       Œ* y)a   Unhide :class:`.Submission`.

        :param other_submissions: When provided, additionally unhide this list of
            :class:`.Submission` instances as part of a single request (default:
            ``None``).

        Example usage:

        .. code-block:: python

            submission = reddit.submission("5or86n")
            submission.unhide()

        .. seealso::

            :meth:`.hide`

        rf   rÓ   Úunhider#   ry   NrÕ   rÖ   s      r1   rÞ   zSubmission.unhide  sD   € ð&  Ÿ;™;°"ÐHY˜;ÓZò 	LˆKØ�L‰L×Ñœh xÑ0¸¸kÐ7JÐÕKñ	Lr3   )r.   r±   Úreturnr±   )rß   r5   )rß   r:   )rß   r±   )rß   r   )NNN)
rX   zpraw.Redditr#   ú
str | Noner.   rà   rO   zdict[str, Any] | Nonerß   ÚNone)rc   r±   rK   r   rß   rá   )rk   Úintrl   úlist[models.Submission] | Nonerß   zIterator[str])r‰   r±   rq   z$dict[str, models.InlineMedia] | Nonerr   rÑ   rß   úmodels.Submission©rß   rá   )rß   Údict)rß   z0tuple[str, dict[str, str], dict[str, int | str]])rv   ræ   rß   rá   )rÂ   r±   rK   r±   rß   rá   )r]   zmodels.SubredditrÄ   rà   rÅ   rà   rÆ   rÑ   rÇ   rÑ   rÈ   rÑ   rÉ   rà   rß   rä   )rl   rã   rß   rá   )rÀ   Ú
__module__Ú__qualname__Ú__doc__Ú	STR_FIELDÚstaticmethodr2   r   r8   r;   ÚpropertyrA   r%   rF   rU   rb   rp   rŽ   r”   r‘   r�   r„   rÃ   rË   rÔ   rÜ   rÞ   Ú__classcell__)rZ   s   @r1   r"   r"   .   sá  ø„ ñ3ðj €Iàòó ððB ò%ó ð%ð$ ò*ó ð*ð ò7ó ð7ð òó ððB ò?ó ð?ð ØØ'+ð "àð "ð ð "ð ð	 "ð
 %ð "ð 
õ "õD.ðFð ðFð :ð	Fð
 
óFð" >BØ&+ñIàðIð ;ð	Ið
  $ðIð 
óIõVóLó
óKó:3ð@  $Ø!%ØØ!ØØ ñ=@à#ð=@ð ð	=@ð
 ð=@ð ð=@ð ð=@ð ð=@ð ð=@ð 
ó=@ð~ KOõ Jó,?ð  MQ÷ Lñ Lr3   r"   c                  ó.   — e Zd ZdZdd„Zdd„Zddœd	d„Zy)
r5   zDProvide a set of functions pertaining to :class:`.Submission` flair.c                ó   — || _         y)z”Initialize a :class:`.SubmissionFlair` instance.

        :param submission: The :class:`.Submission` associated with the flair functions.

        N)r=   ©r7   r=   s     r1   rU   zSubmissionFlair.__init__5  s   € ð %ˆ�r3   c                óÜ   — t         d   j                  | j                  j                  ¬«      }| j                  j                  j                  |d| j                  j                  i¬«      d   S )zØReturn list of available flair choices.

        Choices are required in order to use :meth:`.select`.

        For example:

        .. code-block:: python

            choices = submission.flair.choices()

        Úflairselector©r]   r©   ry   Úchoices)r	   r€   r=   r]   r>   r…   rg   )r7   r.   s     r1   rô   zSubmissionFlair.choices=  s[   € ô �Ñ'×.Ñ.¸¿¹×9RÑ9RÐ.ÓSˆØ�‰×&Ñ&×+Ñ+¨C°v¸t¿¹×?WÑ?WÐ6XÐ+ÓYÐZcÑdÐdr3   N)rw   c               óà   — || j                   j                  |dœ}t        d   j                  | j                   j                  ¬«      }| j                   j
                  j                  ||¬«       y)aÄ  Select flair for submission.

        :param flair_template_id: The flair template to select. The possible values can
            be discovered through :meth:`.choices`.
        :param text: If the template's ``flair_text_editable`` value is ``True``, this
            value will set a custom text (default: ``None``).

        For example, to select an arbitrary editable flair text (assuming there is one)
        and set a custom value try:

        .. code-block:: python

            choices = submission.flair.choices()
            template_id = next(x for x in choices if x["flair_text_editable"])["flair_template_id"]
            submission.flair.select(template_id, text="my custom value")

        )Úflair_template_idr©   rw   Úselect_flairró   ry   N)r=   rg   r	   r€   r]   r>   r…   )r7   rö   rw   rz   r.   s        r1   ÚselectzSubmissionFlair.selectL  s_   € ð& "3Ø—O‘O×,Ñ,Øñ
ˆô
 �~Ñ&×-Ñ-¸¿¹×8QÑ8QÐ-ÓRˆØ�‰×Ñ×$Ñ$ S¨tÐ$Õ4r3   ©r=   rä   rß   rá   )rß   z"list[dict[str, bool | list | str]])rö   r±   rw   rà   rß   rá   )rÀ   rç   rè   ré   rU   rô   rø   rI   r3   r1   r5   r5   2  s   „ ÙNó%óeð DHö 5r3   r5   c                  ó°   — e Zd ZU dZdZerded<   dd„Zddœdd„Zd	d
d	dœ	 	 	 	 	 	 	 dd„Z	dd„Z
dd„Zdd„Zdd„Zdddœdd„Zddœdd„Zdd„Zdd„Zdd„Zy
) r:   zÒProvide a set of functions pertaining to :class:`.Submission` moderation.

    Example usage:

    .. code-block:: python

        submission = reddit.submission("8dmv8z")
        submission.mod.approve()

    Úremoval_link_messagez"models.Comment | models.SubmissionÚthingc                ó   — || _         y)zwInitialize a :class:`.SubmissionModeration` instance.

        :param submission: The submission to moderate.

        N)rü   rð   s     r1   rU   zSubmissionModeration.__init__x  s   € ð  ˆ�
r3   T)Ústatec               óŽ   — | j                   j                  j                  t        d   | j                   j                  |dœ¬«       y)a¼  Set contest mode for the comments of this submission.

        :param state: ``True`` enables contest mode and ``False`` disables (default:
            ``True``).

        Contest mode have the following effects:

        - The comment thread will default to being sorted randomly.
        - Replies to top-level comments will be hidden behind "[show replies]" buttons.
        - Scores will be hidden from non-moderators.
        - Scores accessed through the API (mobile apps, bots) will be obscured to "1"
          for non-moderators.

        Example usage:

        .. code-block:: python

            submission = reddit.submission("5or86n")
            submission.mod.contest_mode()

        Úcontest_mode©r#   rþ   ry   N©rü   r>   r…   r	   rg   )r7   rþ   s     r1   r   z!SubmissionModeration.contest_mode€  s6   € ð, 	�
‰
×Ñ×Ñ¤¨Ñ 8ÀdÇjÁj×FYÑFYÐdiÑ?jÐÕkr3   Ú N)Ú	css_classrö   rw   c               óH  — || j                   j                  |dœ}t        d   j                  | j                   j                  ¬«      }|�2||d<   t        d   j                  | j                   j                  ¬«      }| j                   j
                  j                  ||¬«       y)a|  Set flair for the submission.

        :param css_class: The css class to associate with the flair html (default:
            ``""``).
        :param flair_template_id: The flair template ID to use when flairing.
        :param text: The flair text to associate with the :class:`.Submission` (default:
            ``""``).

        This method can only be used by an authenticated user who is a moderator of the
        submission's :class:`.Subreddit`.

        Example usage:

        .. code-block:: python

            submission = reddit.submission("5or86n")
            submission.mod.flair(text="PRAW", css_class="bot")

        )r  r©   rw   r8   ró   Nrö   r÷   ry   )rü   rg   r	   r€   r]   r>   r…   )r7   r  rö   rw   rz   r.   s         r1   r8   zSubmissionModeration.flair˜  s’   € ð6 #Ø—J‘J×'Ñ'Øñ
ˆô
 �wÑ×&Ñ&°·±×1EÑ1EÐ&ÓFˆØÐ(Ø(9ˆDÐ$Ñ%Ü˜>Ñ*×1Ñ1¸D¿J¹J×<PÑ<PÐ1ÓQˆCØ�
‰
×Ñ×Ñ ¨$ÐÕ/r3   c                óŒ   — | j                   j                  j                  t        d   d| j                   j                  i¬«       y)a�  Mark as not safe for work.

        This method can be used both by the submission author and moderators of the
        subreddit that the submission belongs to.

        Example usage:

        .. code-block:: python

            submission = reddit.subreddit("test").submit("nsfw test", selftext="nsfw")
            submission.mod.nsfw()

        .. seealso::

            :meth:`.sfw`

        Úmarknsfwr#   ry   Nr  r6   s    r1   rÆ   zSubmissionModeration.nsfw½  s5   € ð$ 	�
‰
×Ñ×Ñ¤¨Ñ 4¸DÀ$Ç*Á*×BUÑBUÐ;VÐÕWr3   c                óè   — d| j                   j                  | j                   j                  | j                   j                  ddœ}| j                   j                  j                  t        d   |¬«       y)a  Mark as original content.

        This method can be used by moderators of the subreddit that the submission
        belongs to. If the subreddit has enabled the Original Content beta feature in
        settings, then the submission's author can use it as well.

        Example usage:

        .. code-block:: python

            submission = reddit.subreddit("test").submit("oc test", selftext="original")
            submission.mod.set_original_content()

        .. seealso::

            :meth:`.unset_original_content`

        FT©Úexecutedrg   r#   r(   Úshould_set_ocÚset_original_contentry   N©rü   rg   r#   r]   r>   r…   r	   rÛ   s     r1   r  z)SubmissionModeration.set_original_contentÑ  s[   € ð( ØŸ
™
×+Ñ+Ø—*‘*—-‘-Ø—‘×%Ñ%Ø!ñ
ˆð 	�
‰
×Ñ×Ñ¤Ð)?Ñ @ÀtÐÕLr3   c                óŒ   — | j                   j                  j                  t        d   d| j                   j                  i¬«       y)ag  Mark as safe for work.

        This method can be used both by the submission author and moderators of the
        subreddit that the submission belongs to.

        Example usage:

        .. code-block:: python

            submission = reddit.submission("5or86n")
            submission.mod.sfw()

        .. seealso::

            :meth:`.nsfw`

        Ú
unmarknsfwr#   ry   Nr  r6   s    r1   ÚsfwzSubmissionModeration.sfwí  s5   € ð$ 	�
‰
×Ñ×Ñ¤¨Ñ 6¸dÀDÇJÁJ×DWÑDWÐ=XÐÕYr3   c                óŒ   — | j                   j                  j                  t        d   d| j                   j                  i¬«       y)a‰  Indicate that the submission contains spoilers.

        This method can be used both by the submission author and moderators of the
        subreddit that the submission belongs to.

        Example usage:

        .. code-block:: python

            submission = reddit.submission("5or86n")
            submission.mod.spoiler()

        .. seealso::

            :meth:`.unspoiler`

        rÈ   r#   ry   Nr  r6   s    r1   rÈ   zSubmissionModeration.spoiler  s5   € ð$ 	�
‰
×Ñ×Ñ¤¨Ñ 3¸4ÀÇÁ×ATÑATÐ:UÐÕVr3   )Úbottomrþ   c               ó¾   — | j                   j                  |dœ}|sd|d<   	 | j                   j                  j                  t        d   |¬«      S # t
        $ r Y yw xY w)aŠ  Set the submission's sticky state in its subreddit.

        :param bottom: When ``True``, set the submission as the bottom sticky. If no top
            sticky exists, this submission will become the top sticky regardless
            (default: ``True``).
        :param state: ``True`` sets the sticky for the submission and ``False`` unsets
            (default: ``True``).

        :returns: The stickied submission object.

        .. note::

            When a submission is stickied two or more times, the Reddit API responds
            with a 409 error that is raised as a ``Conflict`` by prawcore. This method
            suppresses these ``Conflict`` errors.

        This submission will replace the second stickied submission if one exists.

        For example:

        .. code-block:: python

            submission = reddit.submission("5or86n")
            submission.mod.sticky()

        r  r*   ÚnumÚsticky_submissionry   N)rü   rg   r>   r…   r	   r   )r7   r  rþ   rz   s       r1   ÚstickyzSubmissionModeration.sticky  sa   € ð6 —j‘j×)Ñ)°EÑ:ˆÙØˆD�‰Kð	Ø—:‘:×%Ñ%×*Ñ*¬8Ð4GÑ+HÈtÐ*ÓTÐTøÜò 	Ùð	ús   ¢-A Á	AÁAÚblank)r¤   c               óŽ   — | j                   j                  j                  t        d   | j                   j                  |dœ¬«       y)a  Set the suggested sort for the comments of the submission.

        :param sort: Can be one of: ``"confidence"``, ``"top"``, ``"new"``,
            ``"controversial"``, ``"old"``, ``"random"``, ``"qa"``, or ``"blank"``
            (default: ``"blank"``).

        Úsuggested_sort)r#   r¤   ry   Nr  )r7   r¤   s     r1   r  z#SubmissionModeration.suggested_sort8  s7   € ð 	�
‰
×Ñ×Ñ¤Ð)9Ñ :ÈÏ
É
×H[ÑH[ÐeiÑAjÐÕkr3   c                óè   — d| j                   j                  | j                   j                  | j                   j                  ddœ}| j                   j                  j                  t        d   |¬«       y)a3  Indicate that the submission is not original content.

        This method can be used by moderators of the subreddit that the submission
        belongs to. If the subreddit has enabled the Original Content beta feature in
        settings, then the submission's author can use it as well.

        Example usage:

        .. code-block:: python

            submission = reddit.subreddit("test").submit("oc test", selftext="original")
            submission.mod.unset_original_content()

        .. seealso::

            :meth:`.set_original_content`

        Fr	  r  ry   Nr  rÛ   s     r1   Úunset_original_contentz+SubmissionModeration.unset_original_contentB  s[   € ð( ØŸ
™
×+Ñ+Ø—*‘*—-‘-Ø—‘×%Ñ%Ø"ñ
ˆð 	�
‰
×Ñ×Ñ¤Ð)?Ñ @ÀtÐÕLr3   c                óŒ   — | j                   j                  j                  t        d   d| j                   j                  i¬«       y)a¶  Indicate that the submission does not contain spoilers.

        This method can be used both by the submission author and moderators of the
        subreddit that the submission belongs to.

        For example:

        .. code-block:: python

            submission = reddit.subreddit("test").submit("not spoiler", selftext="spoiler")
            submission.mod.unspoiler()

        .. seealso::

            :meth:`.spoiler`

        Ú	unspoilerr#   ry   Nr  r6   s    r1   r  zSubmissionModeration.unspoiler^  s5   € ð$ 	�
‰
×Ñ×Ñ¤¨Ñ 5¸TÀ4Ç:Á:×CVÑCVÐ<WÐÕXr3   c                óŽ   — | j                   j                  j                  t        d   | j                   j                  |dœ¬«       y)aè  Change the Crowd Control level of the submission.

        :param level: An integer between 0 and 3.

        **Level Descriptions**

        ===== ======== ================================================================
        Level Name     Description
        ===== ======== ================================================================
        0     Off      Crowd Control will not action any of the submission's comments.
        1     Lenient  Comments from users who have negative karma in the subreddit are
                       automatically collapsed.
        2     Moderate Comments from new users and users with negative karma in the
                       subreddit are automatically collapsed.
        3     Strict   Comments from users who haven't joined the subreddit, new users,
                       and users with negative karma in the subreddit are automatically
                       collapsed.
        ===== ======== ================================================================

        Example usage:

        .. code-block:: python

            submission = reddit.submission("745ryj")
            submission.mod.update_crowd_control_level(2)

        .. seealso::

            :meth:`~.CommentModeration.show`

        Úupdate_crowd_control)r#   Úlevelry   Nr  )r7   r   s     r1   Úupdate_crowd_control_levelz/SubmissionModeration.update_crowd_control_levelr  s=   € ð@ 	�
‰
×Ñ×ÑÜÐ+Ñ,ØŸ
™
×+Ñ+°eÑ<ð 	 õ 	
r3   rù   )rþ   rÑ   rß   rá   )r  r±   rö   rà   rw   r±   rß   rá   rå   )r  rÑ   rþ   rÑ   rß   zmodels.Submission | None)r¤   r±   rß   rá   )r   râ   rß   rá   )rÀ   rç   rè   ré   ÚREMOVAL_MESSAGE_APIr   Ú__annotations__rU   r   r8   rÆ   r  r  rÈ   r  r  r  r  r!  rI   r3   r1   r:   r:   g  s¢   … ñ	ð 1ÐáØ1Ó1ó ð -1õ lð6 Ø(,Øñ#0ð ð#0ð &ð	#0ð
 ð#0ð 
ó#0óJXó(Mó8Zó(Wð( (,¸4õ !ðF -4õ lóMó8Yô(#
r3   r:   )3ré   Ú
__future__r   rµ   Újsonr   Útypingr   r   Úurllib.parser   Úprawcorer   Ú
praw.constr	   Úpraw.exceptionsr
   r   Úpraw.models.comment_forestr   Úpraw.models.listing.listingr   Úpraw.models.listing.mixinsr   Úpraw.models.reddit.baser   Úpraw.models.reddit.mixinsr   r   r   r   r   Úpraw.models.reddit.pollr   Úpraw.models.reddit.redditorr   Úpraw.models.reddit.subredditr   Ú	praw.utilr   Úcollections.abcr   Úprawr   Úcompiler}   r­   r"   r5   r:   Ú_submission_classrI   r3   r1   ú<module>r8     sº   ðÙ #å "ã 	Ý ß %Ý  å å ß 7Ý 4Ý /Ý =Ý .÷õ õ -Ý 0Ý 2Ý $áÝ(ãÝà!�r—z‘zØuóÐ ð ØØñÐ ôALÐ'Ð)9¸=È,ÐXbô AL÷H25ñ 25ôjn
Ð/°ô n
ðb	 )€	Õ r3   