Ë
    œ…j4¹  ã                  óP  — d Z ddlmZ ddlZddlZddlmZmZmZm	Z	m
Z
mZ ddlmZ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 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+ ddl,m-Z-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8 ddl9m:Z: ddl;m<Z<m=Z= erLddl>m?Z? ddl@mAZA ddlBmCZC ddlmDZDmEZE ddlFmGZG ddlHmIZI ddlJmKZK ddlLmMZM ddlNmOZO dd lPmQZQmRZR dd!lSmTZT dd"l;mUZU  G d#„ d$e:«      ZV G d%„ d&eV«      ZW G d'„ d(eW«      ZX G d)„ d*eW«      ZY G d+„ d,eV«      ZZ G d-„ d.eV«      Z[ G d/„ d0eV«      Z\ G d1„ d2eV«      Z] G d3„ d4e]«      Z^ G d5„ d6e]«      Z_ G d7„ d8e_«      Z` G d9„ d:e:«      ZadEd;„ZbdEd<„ZcdEd=„ZddEd>„ZedFd?„ZfdEd@„Zg G dA„ dBeh«      Zi G dC„ dDeh«      Zjy)Gz:The shape tree, the structure that holds a slide's shapes.é    )ÚannotationsN)ÚIOÚTYPE_CHECKINGÚCallableÚIterableÚIteratorÚcast)ÚPP_PLACEHOLDERÚPROG_ID)ÚSPEAKER_IMAGE_BYTESÚVideo)ÚCONTENT_TYPE)Úqn)ÚCT_Shape)ÚCT_GraphicalObjectFrame)Ú
CT_Picture)ÚST_Direction)ÚAutoShapeTypeÚShape)Ú	BaseShape)Ú	Connector)ÚFreeformBuilder)ÚGraphicFrame)Ú
GroupShape)ÚMovieÚPicture)	ÚChartPlaceholderÚLayoutPlaceholderÚMasterPlaceholderÚNotesSlidePlaceholderÚPicturePlaceholderÚPlaceholderGraphicFrameÚPlaceholderPictureÚSlidePlaceholderÚTablePlaceholder)ÚParentedElementProxy)ÚEmuÚlazyproperty)ÚChart)Ú	ChartData)ÚXL_CHART_TYPE)ÚMSO_CONNECTOR_TYPEÚ	MSO_SHAPE)ÚShapeElement)ÚCT_Connector)ÚCT_GroupShape)Ú	ImagePart)Ú	SlidePart)ÚSlideÚSlideLayout)ÚProvidesPart)ÚLengthc                  óÀ   ‡ — e Zd ZdZdˆ fd„Zdd„Zdd„Zdd„Zdd„Zdd„Z	e
dd„«       Zej                  dd	„«       Zedd
„«       Zdd„Zdd„Ze
dd„«       Zdd„Zˆ xZS )Ú_BaseShapeszžBase class for a shape collection appearing in a slide-type object.

    Subclasses include Slide, SlideLayout, and SlideMaster. Provides common methods.
    c                óJ   •— t         t        | �  ||«       || _        d | _        y ©N)Úsuperr8   Ú__init__Ú_spTreeÚ_cached_max_shape_id)ÚselfÚspTreeÚparentÚ	__class__s      €úV/root/aria/tools/markitdown-venv/lib/python3.12/site-packages/pptx/shapes/shapetree.pyr<   z_BaseShapes.__init__S   s#   ø€ ÜŒk˜4Ñ)¨&°&Ô9ØˆŒØ$(ˆÕ!ó    c                ó’   — t        | j                  «       «      }	 ||   }| j                  |«      S # t        $ r t        d«      ‚w xY w)z4Return shape at `idx` in sequence, e.g. `shapes[2]`.zshape index out of range)ÚlistÚ_iter_member_elmsÚ
IndexErrorÚ_shape_factory)r?   ÚidxÚ
shape_elmsÚ	shape_elms       rC   Ú__getitem__z_BaseShapes.__getitem__X   sS   € ä˜$×0Ñ0Ó2Ó3ˆ
ð	9Ø" 3™ˆIð ×"Ñ" 9Ó-Ð-øô ò 	9ÜÐ7Ó8Ð8ð	9ús	   ›1 ±Ac              #  ó\   K  — | j                  «       D ]  }| j                  |«      –— Œ y­w)zBGenerate a reference to each shape in the collection, in sequence.N)rG   rI   ©r?   rL   s     rC   Ú__iter__z_BaseShapes.__iter__a   s/   è ø€ à×/Ñ/Ó1ò 	1ˆIØ×%Ñ% iÓ0Ó0ñ	1ùs   ‚*,c                óJ   — t        | j                  «       «      }t        |«      S )z­Return count of shapes in this shape tree.

        A group shape contributes 1 to the total, without regard to the number of shapes contained
        in the group.
        )rF   rG   Úlen)r?   rK   s     rC   Ú__len__z_BaseShapes.__len__f   s!   € ô ˜$×0Ñ0Ó2Ó3ˆ
Ü�:‹ÐrD   c                ó   — |j                   }|j                  |j                  |j                  |j                  f\  }}}}| j
                  }| j                  |||«      }| j                  j                  ||||||«       y)z3Add a new placeholder shape based on `placeholder`.N)	ÚelementÚph_typeÚ	ph_orientÚph_szÚph_idxÚ_next_shape_idÚ_next_ph_namer=   Úadd_placeholder)	r?   ÚplaceholderÚsprV   ÚorientÚszrJ   Úid_Únames	            rC   Úclone_placeholderz_BaseShapes.clone_placeholdero   so   € à× Ñ ˆØ$&§J¡J°·±¸b¿h¹hÈÏ	É	Ð#RÑ ˆ�˜˜SØ×!Ñ!ˆØ×!Ñ! '¨3°Ó7ˆØ�‰×$Ñ$ S¨$°¸ÀÀSÕIrD   c                óì  — t         j                  dt         j                  dt         j                  dt         j                  dt         j
                  dt         j                  dt         j                  dt         j                  dt         j                  d	t         j                  d
t         j                  dt         j                  dt         j                  dt         j                  dt         j                  di|   S )a  Return the base name for a placeholder of `ph_type` in this shape collection.

        There is some variance between slide types, for example a notes slide uses a different
        name for the body placeholder, so this method can be overriden by subclasses.
        zClipArt PlaceholderzText PlaceholderÚTitlezChart PlaceholderúDate PlaceholderúFooter PlaceholderúHeader PlaceholderzMedia PlaceholderzContent PlaceholderzSmartArt PlaceholderzPicture PlaceholderúSlide Number PlaceholderÚSubtitlezTable Placeholder)r
   ÚBITMAPÚBODYÚCENTER_TITLEÚCHARTÚDATEÚFOOTERÚHEADERÚ
MEDIA_CLIPÚOBJECTÚ	ORG_CHARTÚPICTUREÚSLIDE_NUMBERÚSUBTITLEÚTABLEÚTITLE©r?   rV   s     rC   Úph_basenamez_BaseShapes.ph_basenamew   sÉ   € ô ×!Ñ!Ð#8Ü×ÑÐ!3Ü×'Ñ'¨Ü× Ñ Ð"5Ü×ÑÐ!3Ü×!Ñ!Ð#7Ü×!Ñ!Ð#7Ü×%Ñ%Ð':Ü×!Ñ!Ð#8Ü×$Ñ$Ð&<Ü×"Ñ"Ð$9Ü×'Ñ'Ð)CÜ×#Ñ# ZÜ× Ñ Ð"5Ü× Ñ  'ð
ð  ñ!ð 	rD   c                ó   — | j                   duS )a  True if "turbo-add" mode is enabled. Read/Write.

        EXPERIMENTAL: This feature can radically improve performance when adding large numbers
        (hundreds of shapes) to a slide. It works by caching the last shape ID used and
        incrementing that value to assign the next shape id. This avoids repeatedly searching all
        shape ids in the slide each time a new ID is required.

        Performance is not noticeably improved for a slide with a relatively small number of
        shapes, but because the search time rises with the square of the shape count, this option
        can be useful for optimizing generation of a slide composed of many shapes.

        Shape-id collisions can occur (causing a repair error on load) if more than one |Slide|
        object is used to interact with the same slide in the presentation. Note that the |Slides|
        collection creates a new |Slide| object each time a slide is accessed (e.g. `slide =
        prs.slides[0]`, so you must be careful to limit use to a single |Slide| object.
        N)r>   ©r?   s    rC   Úturbo_add_enabledz_BaseShapes.turbo_add_enabled�   s   € ð$ ×(Ñ(°Ð4Ð4rD   c                ód   — t        |«      }|r| j                  j                  | _        y d | _        y r:   )Úboolr=   Úmax_shape_idr>   )r?   ÚvalueÚenables      rC   r~   z_BaseShapes.turbo_add_enabled£   s&   € ä�e“ˆÙAG D§L¡L×$=Ñ$=ˆÕ!ÈTˆÕ!rD   c                 ó   — y)zSReturn true if `shape_elm` represents a member of this collection, False otherwise.T© ©rL   s    rC   Ú_is_member_elmz_BaseShapes._is_member_elm¨   s   € ð rD   c              #  óv   K  — | j                   j                  «       D ]  }| j                  |«      sŒ|–— Œ y­w)z€Generate each child of the `p:spTree` element that corresponds to a shape.

        Items appear in XML document order.
        N)r=   Úiter_shape_elmsr‡   rO   s     rC   rG   z_BaseShapes._iter_member_elms­   s7   è ø€ ð
 Ÿ™×5Ñ5Ó7ò 	 ˆIØ×"Ñ" 9Õ-Ø“ñ	 ùs   ‚/9²9c                ó¾   — | j                  |«      }|t        j                  k(  rd|z  }|dz
  }| j                  j	                  d«      }	 d||fz  }||vr	 |S |dz  }Œ)a§  Next unique placeholder name for placeholder shape of type `ph_type`.

        Usually will be standard placeholder root name suffixed with id-1, e.g.
        _next_ph_name(ST_PlaceholderType.TBL, 4, 'horz') ==> 'Table Placeholder 3'. The number is
        incremented as necessary to make the name unique within the collection. If `orient` is
        `'vert'`, the placeholder name is prefixed with `'Vertical '`.
        zVertical %sé   z//p:cNvPr/@nameú%s %d)r{   r   ÚVERTr=   Úxpath)r?   rV   Úidr_   ÚbasenameÚnumpartÚnamesrb   s           rC   r[   z_BaseShapes._next_ph_name¶   s‚   € ð ×#Ñ# GÓ,ˆð ”\×&Ñ&Ò&Ø$ xÑ/ˆHð �q‘&ˆØ—‘×"Ñ"Ð#4Ó5ˆØØ˜h¨Ð0Ñ0ˆDØ˜5Ñ Øð ˆð �q‰LˆGð	 rD   c                óŽ   — | j                   �!| xj                   dz  c_         | j                   S | j                  j                  dz   S )zðReturn a unique shape id suitable for use with a new shape.

        The returned id is 1 greater than the maximum shape id used so far. In practice, the
        minimum id is 2 because the spTree element is always assigned id="1".
        r‹   )r>   r=   r�   r}   s    rC   rZ   z_BaseShapes._next_shape_idÏ   sB   € ð ×$Ñ$Ð0Ø×%Ò%¨Ñ*Õ%Ø×,Ñ,Ð,à�|‰|×(Ñ(¨1Ñ,Ð,rD   c                ó   — t        || «      S ©úHReturn an instance of the appropriate shape proxy class for `shape_elm`.)ÚBaseShapeFactoryrO   s     rC   rI   z_BaseShapes._shape_factoryÝ   s   € ä 	¨4Ó0Ð0rD   )r@   r0   rA   r5   )rJ   ÚintÚreturnr   )r™   zIterator[BaseShape]©r™   r˜   )r]   r   r™   ÚNone©rV   r
   r™   Ústr)r™   r€   )r‚   r€   ©rL   r.   r™   r€   )r™   zIterator[ShapeElement])rV   r
   r�   r˜   r_   r�   r™   r�   ©rL   r.   r™   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r<   rM   rP   rS   rc   r{   Úpropertyr~   ÚsetterÚstaticmethodr‡   rG   r[   rZ   rI   Ú__classcell__©rB   s   @rC   r8   r8   M   sŽ   ø„ ñõ
)ó
.ó1ó
óJóð0 ò5ó ð5ð& ×ÑòRó ðRð òó ðó óð2 ò-ó ð-÷1rD   r8   c                  óÄ  ‡ — e Zd ZU dZded<   ded<   dˆ fd„Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z	 	 	 	 	 	 	 	 	 	 	 	 dd„Zddd	„Z	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
„Z		 	 d	 	 	 	 	 	 	 	 	 	 	 dd„Z
	 	 	 	 	 	 	 	 	 	 	 	 dd„Zd d„Z	 d!	 	 	 	 	 	 	 d"d„Zd#d„Z	 	 	 	 	 	 	 	 	 	 	 	 d$d„Z	 	 	 	 	 	 	 	 	 	 	 	 d%d„Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 d&d„Z	 	 	 	 	 	 	 	 	 	 	 	 d'd„Zd(d„Zd)d„Zˆ xZS )*Ú_BaseGroupShapesz/Base class for shape-trees that can add shapes.r2   Úpartr0   Ú_elementc                ó<   •— t         t        | �  ||«       || _        y r:   )r;   rª   r<   Ú_grpSp)r?   ÚgrpSprA   rB   s      €rC   r<   z_BaseGroupShapes.__init__è   s   ø€ ÜÔ Ñ.¨u°fÔ=Øˆ�rD   c                óº   — | j                   j                  ||«      }| j                  |||||«      }| j                  «        t	        d| j                  |«      «      S )aB  Add a new chart of `chart_type` to the slide.

        The chart is positioned at (`x`, `y`), has size (`cx`, `cy`), and depicts `chart_data`.
        `chart_type` is one of the :ref:`XlChartType` enumeration values. `chart_data` is a
        |ChartData| object populated with the categories and series values for the chart.

        Note that a |GraphicFrame| shape object is returned, not the |Chart| object contained in
        that graphic frame shape. The chart object may be accessed using the :attr:`chart`
        property of the returned |GraphicFrame| object.
        r)   )r«   Úadd_chart_partÚ_add_chart_graphicFrameÚ_recalculate_extentsr	   rI   )	r?   Ú
chart_typeÚxÚyÚcxÚcyÚ
chart_dataÚrIdÚgraphicFrames	            rC   Ú	add_chartz_BaseGroupShapes.add_chartì   sV   € ð& �i‰i×&Ñ& z°:Ó>ˆØ×3Ñ3°C¸¸A¸rÀ2ÓFˆØ×!Ñ!Ô#Ü�G˜T×0Ñ0°Ó>Ó?Ð?rD   c                óŠ   — | j                  |||||«      }| j                  «        t        t        | j	                  |«      «      S )a@  Add a newly created connector shape to the end of this shape tree.

        `connector_type` is a member of the :ref:`MsoConnectorType` enumeration and the end-point
        values are specified as EMU values. The returned connector is of type `connector_type` and
        has begin and end points as specified.
        )Ú
_add_cxnSpr³   r	   r   rI   )r?   Úconnector_typeÚbegin_xÚbegin_yÚend_xÚend_yÚcxnSps          rC   Úadd_connectorz_BaseGroupShapes.add_connector  s>   € ð —‘ °¸À%ÈÓOˆØ×!Ñ!Ô#Ü”I˜t×2Ñ2°5Ó9Ó:Ð:rD   c                óô   — t        |«      }| j                  j                  «       }|D ]  }|j                  |j                  d«       Œ  |r|j	                  «        t        t        | j                  |«      «      S )aŒ  Return a |GroupShape| object newly appended to this shape tree.

        The group shape is empty and must be populated with shapes using methods on its shape
        tree, available on its `.shapes` property. The position and extents of the group shape are
        determined by the shapes it contains; its position and extents are recalculated each time
        a shape is added to it.
        zp:extLst)Útupler¬   Ú	add_grpSpÚinsert_element_beforeÚrecalculate_extentsr	   r   rI   )r?   Úshapesr¯   Úshapes       rC   Úadd_group_shapez _BaseGroupShapes.add_group_shape  sn   € ô �v“ˆØ—‘×'Ñ'Ó)ˆØò 	ˆEØ×'Ñ'Ø—‘ 
õð	ñ Ø×%Ñ%Ô'Ü”J × 3Ñ 3°EÓ :Ó;Ð;rD   c
                óè   — t         j                  | | j                  |||||||||	«      }
| j                  j	                  |
«       | j                  «        t        t        | j                  |
«      «      S )aq  Return newly-created GraphicFrame shape embedding `object_file`.

        The returned graphic-frame shape contains `object_file` as an embedded OLE object. It is
        displayed as an icon at `left`, `top` with size `width`, `height`. `width` and `height`
        may be omitted when `prog_id` is a member of `PROG_ID`, in which case the default icon
        size is used. This is advised for best appearance where applicable because it avoids an
        icon with a "stretched" appearance.

        `object_file` may either be a str path to a file or file-like object (such as
        `io.BytesIO`) containing the bytes of the object to be embedded (such as an Excel file).

        `prog_id` can be either a member of `pptx.enum.shapes.PROG_ID` or a str value like
        `"Adobe.Exchange.7"` determined by inspecting the XML generated by PowerPoint for an
        object of the desired type.

        `icon_file` may either be a str path to an image file or a file-like object containing the
        image. The image provided will be displayed in lieu of the OLE object; double-clicking on
        the image opens the object (subject to operating-system limitations). The image file can
        be any supported image file. Those produced by PowerPoint itself are generally EMF and can
        be harvested from a PPTX package that embeds such an object. PNG and JPG also work fine.

        `icon_width` and `icon_height` are `Length` values (e.g. Emu() or Inches()) that describe
        the size of the icon image within the shape. These should be omitted unless a custom
        `icon_file` is provided. The dimensions must be discovered by inspecting the XML.
        Automatic resizing of the OLE-object shape can occur when the icon is double-clicked if
        these values are not as set by PowerPoint. This behavior may only manifest in the Windows
        version of PowerPoint.
        )	Ú_OleObjectElementCreatorr»   rZ   r=   Úappendr³   r	   r   rI   )r?   Úobject_fileÚprog_idÚleftÚtopÚwidthÚheightÚ	icon_fileÚ
icon_widthÚicon_heightr»   s              rC   Úadd_ole_objectz_BaseGroupShapes.add_ole_object(  st   € ôP 0×<Ñ<ØØ×ÑØØØØØØØØØó
ˆð 	�‰×Ñ˜LÔ)Ø×!Ñ!Ô#Ü”L $×"5Ñ"5°lÓ"CÓDÐDrD   c                óÈ   — | j                   j                  |«      \  }}| j                  ||||||«      }| j                  «        t	        t
        | j                  |«      «      S )a3  Add picture shape displaying image in `image_file`.

        `image_file` can be either a path to a file (a string) or a file-like object. The picture
        is positioned with its top-left corner at (`top`, `left`). If `width` and `height` are
        both |None|, the native size of the image is used. If only one of `width` or `height` is
        used, the unspecified dimension is calculated to preserve the aspect ratio of the image.
        If both are specified, the picture is stretched to fit, without regard to its native
        aspect ratio.
        )r«   Úget_or_add_image_partÚ_add_pic_from_image_partr³   r	   r   rI   )	r?   Ú
image_filerÓ   rÔ   rÕ   rÖ   Ú
image_partrº   Úpics	            rC   Úadd_picturez_BaseGroupShapes.add_picturea  sZ   € ð" Ÿ)™)×9Ñ9¸*ÓE‰ˆ
�CØ×+Ñ+¨J¸¸TÀ3ÈÈvÓVˆØ×!Ñ!Ô#Ü”G˜T×0Ñ0°Ó5Ó6Ð6rD   c                ó    — t        |«      }| j                  |||||«      }| j                  «        t        t        | j                  |«      «      S )a  Return new |Shape| object appended to this shape tree.

        `autoshape_type_id` is a member of :ref:`MsoAutoShapeType` e.g. `MSO_SHAPE.RECTANGLE`
        specifying the type of shape to be added. The remaining arguments specify the new shape's
        position and size.
        )r   Ú_add_spr³   r	   r   rI   )r?   Úautoshape_type_idrÓ   rÔ   rÕ   rÖ   Úautoshape_typer^   s           rC   Ú	add_shapez_BaseGroupShapes.add_shapew  sI   € ô 'Ð'8Ó9ˆØ�\‰\˜.¨$°°U¸FÓCˆØ×!Ñ!Ô#Ü”E˜4×.Ñ.¨rÓ2Ó3Ð3rD   c                óˆ   — | j                  ||||«      }| j                  «        t        t        | j	                  |«      «      S )z§Return newly added text box shape appended to this shape tree.

        The text box is of the specified size, located at the specified position on the slide.
        )Ú_add_textbox_spr³   r	   r   rI   )r?   rÓ   rÔ   rÕ   rÖ   r^   s         rC   Úadd_textboxz_BaseGroupShapes.add_textbox…  s>   € ð
 ×!Ñ! $¨¨U°FÓ;ˆØ×!Ñ!Ô#Ü”E˜4×.Ñ.¨rÓ2Ó3Ð3rD   c                óf   — t        |t        «      r|n||f\  }}t        j                  | ||||«      S )a¶  Return |FreeformBuilder| object to specify a freeform shape.

        The optional `start_x` and `start_y` arguments specify the starting pen position in local
        coordinates. They will be rounded to the nearest integer before use and each default to
        zero.

        The optional `scale` argument specifies the size of local coordinates proportional to
        slide coordinates (EMU). If the vertical scale is different than the horizontal scale
        (local coordinate units are "rectangular"), a pair of numeric values can be provided as
        the `scale` argument, e.g. `scale=(1.0, 2.0)`. In this case the first number is
        interpreted as the horizontal (X) scale and the second as the vertical (Y) scale.

        A convenient method for calculating scale is to divide a |Length| object by an equivalent
        count of local coordinate units, e.g. `scale = Inches(1)/1000` for 1000 local units per
        inch.
        )Ú
isinstancerÇ   r   Únew)r?   Ústart_xÚstart_yÚscaleÚx_scaleÚy_scales         rC   Úbuild_freeformz_BaseGroupShapes.build_freeformŽ  s6   € ô& %/¨u´eÔ$<™5À5È%À.Ñˆ�ä×"Ñ" 4¨°'¸7ÀGÓLÐLrD   c                ó~   — t        | j                  j                  «       «      }|j                  |j                  «      S )zxReturn the index of `shape` in this sequence.

        Raises |ValueError| if `shape` is not in the collection.
        )rF   r¬   r‰   ÚindexrU   )r?   rÌ   rK   s      rC   rô   z_BaseGroupShapes.index¥  s0   € ô
 ˜$Ÿ-™-×7Ñ7Ó9Ó:ˆ
Ø×Ñ §¡Ó.Ð.rD   c           	     óš   — | j                   }d|dz
  z  }t        j                  |||||||«      }| j                  j	                  |«       |S )zÍReturn new `p:graphicFrame` element appended to this shape tree.

        The `p:graphicFrame` element has the specified position and size and refers to the chart
        part identified by `rId`.
        zChart %dr‹   )rZ   r   Únew_chart_graphicFramer=   rÐ   )	r?   rº   rµ   r¶   r·   r¸   Úshape_idrb   r»   s	            rC   r²   z(_BaseGroupShapes._add_chart_graphicFrame­  sV   € ð ×&Ñ&ˆØ˜X¨™\Ñ*ˆÜ.×EÑEØ�d˜C  A r¨2ó
ˆð 	�‰×Ñ˜LÔ)ØÐrD   c                óì   — | j                   }d|dz
  z  }||kD  ||kD  }	}t        ||«      t        ||«      }}
t        ||z
  «      t        ||z
  «      }}| j                  j	                  ||||
|||||	«	      S )zÔReturn a newly-added `p:cxnSp` element as specified.

        The `p:cxnSp` element is for a connector of `connector_type` beginning at (`begin_x`,
        `begin_y`) and extending to (`end_x`, `end_y`).
        zConnector %dr‹   )rZ   ÚminÚabsr¬   Ú	add_cxnSp)r?   r¿   rÀ   rÁ   rÂ   rÃ   ra   rb   ÚflipHÚflipVrµ   r¶   r·   r¸   s                 rC   r¾   z_BaseGroupShapes._add_cxnSp½  s‡   € ð ×!Ñ!ˆØ  q¡Ñ)ˆà ‘¨°%©ˆuˆÜ�7˜EÓ"¤C¨°Ó$7ˆ1ˆÜ�U˜W‘_Ó%¤s¨5°7©?Ó';ˆBˆà�}‰}×&Ñ& s¨D°.À!ÀQÈÈBÐPUÐW\Ó]Ð]rD   c           
     ó´   — | j                   }|j                  ||«      \  }}	d|dz
  z  }
|j                  }| j                  j	                  ||
||||||	«      }|S )a1  Return a newly appended `p:pic` element as specified.

        The `p:pic` element displays the image in `image_part` with size and position specified by
        `x`, `y`, `cx`, and `cy`. The element is appended to the shape tree, causing it to be
        displayed first in z-order on the slide.
        z
Picture %dr‹   )rZ   rï   Údescr®   Úadd_pic)r?   rß   rº   rµ   r¶   r·   r¸   ra   Ú	scaled_cxÚ	scaled_cyrb   rÿ   rà   s                rC   rÝ   z)_BaseGroupShapes._add_pic_from_image_partÓ  sd   € ð ×!Ñ!ˆØ)×/Ñ/°°BÓ7Ñˆ	�9Ø˜s Q™wÑ'ˆØ�‰ˆØ�k‰k×!Ñ! # t¨T°3¸¸1¸iÈÓSˆØˆ
rD   c           	     óœ   — | j                   }d|j                  |dz
  fz  }| j                  j                  |||j                  ||||«      }|S )z˜Return newly-added `p:sp` element as specified.

        `p:sp` element is of `autoshape_type` at position (`x`, `y`) and of size (`cx`, `cy`).
        rŒ   r‹   )rZ   r�   r®   Úadd_autoshapeÚprst)	r?   rå   rµ   r¶   r·   r¸   ra   rb   r^   s	            rC   rã   z_BaseGroupShapes._add_spé  sT   € ð ×!Ñ!ˆØ˜.×1Ñ1°3¸±7Ð;Ñ;ˆØ�[‰[×&Ñ& s¨D°.×2EÑ2EÀqÈ!ÈRÐQSÓTˆØˆ	rD   c                ón   — | j                   }d|dz
  z  }| j                  j                  ||||||«      }|S )zvReturn newly-appended textbox `p:sp` element.

        Element has position (`x`, `y`) and size (`cx`, `cy`).
        z
TextBox %dr‹   )rZ   r=   ré   )r?   rµ   r¶   r·   r¸   ra   rb   r^   s           rC   rè   z _BaseGroupShapes._add_textbox_spõ  s@   € ð
 ×!Ñ!ˆØ˜s Q™wÑ'ˆØ�\‰\×%Ñ% c¨4°°A°r¸2Ó>ˆØˆ	rD   c                 ó   — y©zÁAdjust position and size to incorporate all contained shapes.

        This would typically be called when a contained shape is added, removed, or its position
        or size updated.
        Nr…   r}   s    rC   r³   z%_BaseGroupShapes._recalculate_extentsÿ  s   € ð 	rD   )r¯   r0   rA   r5   )r´   r+   rµ   r6   r¶   r6   r·   r6   r¸   r6   r¹   r*   r™   r)   )r¿   r,   rÀ   r6   rÁ   r6   rÂ   r6   rÃ   r6   r™   r   )r…   )rË   zIterable[BaseShape]r™   r   )NNNNN)rÑ   ústr | IO[bytes]rÒ   r�   rÓ   r6   rÔ   r6   rÕ   úLength | NonerÖ   r
  r×   ústr | IO[bytes] | NonerØ   r
  rÙ   r
  r™   r   )NN)rÞ   r	  rÓ   r6   rÔ   r6   rÕ   r
  rÖ   r
  r™   r   )rä   r-   rÓ   r6   rÔ   r6   rÕ   r6   rÖ   r6   r™   r   )
rÓ   r6   rÔ   r6   rÕ   r6   rÖ   r6   r™   r   )r   r   g      ð?)rí   Úfloatrî   r  rï   ztuple[float, float] | floatr™   r   )rÌ   r   r™   r˜   )rº   r�   rµ   r6   r¶   r6   r·   r6   r¸   r6   r™   r   )r¿   r,   rÀ   r6   rÁ   r6   rÂ   r6   rÃ   r6   r™   r/   )rß   r1   rº   r�   rµ   r6   r¶   r6   r·   r
  r¸   r
  r™   r   )rå   r   rµ   r6   r¶   r6   r·   r6   r¸   r6   r™   r   )
rµ   r6   r¶   r6   r·   r6   r¸   r6   r™   r   ©r™   r›   )r    r¡   r¢   r£   Ú__annotations__r<   r¼   rÅ   rÍ   rÚ   rá   ræ   ré   rò   rô   r²   r¾   rÝ   rã   rè   r³   r§   r¨   s   @rC   rª   rª   â   sé  ø… Ù9à
ƒOØÓõð@à!ð@ð ð@ð ð	@ð
 ð@ð ð@ð ð@ð 
ó@ð0;à*ð;ð ð;ð ð	;ð
 ð;ð ð;ð 
ó;ô$<ð0  $Ø $Ø,0Ø$(Ø%)ð7Eà$ð7Eð ð7Eð ð	7Eð
 ð7Eð ð7Eð ð7Eð *ð7Eð "ð7Eð #ð7Eð 
ó7Eð|  $Ø $ð7à#ð7ð ð7ð ð	7ð
 ð7ð ð7ð 
ó7ð,4Ø!*ð4Ø28ð4Ø?Eð4ØNTð4Ø^dð4à	ó4ó4ð \_ðMØðMØ+0ðMØ=XðMà	óMó./ðØðØ!ðØ&,ðØ28ðØ>Dðà	 óð ^à*ð^ð ð^ð ð	^ð
 ð^ð ð^ð 
ó^ð,àðð ðð ð	ð
 ðð ðð ðð 
óð,
Ø+ð
Ø06ð
Ø;Að
ØGMð
ØSYð
à	ó
ó÷rD   rª   c                  ó   — e Zd ZdZdd„Zy)ÚGroupShapeszÈThe sequence of child shapes belonging to a group shape.

    Note that this collection can itself contain a group shape, making this part of a recursive,
    tree data structure (acyclic graph).
    c                ó8   — | j                   j                  «        yr  )r®   rÊ   r}   s    rC   r³   z GroupShapes._recalculate_extents  s   € ð 	�‰×'Ñ'Õ)rD   Nr  )r    r¡   r¢   r£   r³   r…   rD   rC   r  r  
  s   „ ñô*rD   r  c                  óà   — e Zd ZU dZded<   dej                  f	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdd„Z	e
dd„«       Ze
dd	„«       Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
„Zdd„Zdd„Zy)ÚSlideShapeszÈSequence of shapes appearing on a slide.

    The first shape in the sequence is the backmost in z-order and the last shape is topmost.
    Supports indexed access, len(), index(), and iteration.
    r3   rA   Nc                óæ   — t         j                  | | j                  |||||||«	      }| j                  j	                  |«       | j                  |«       t        t        | j                  |«      «      S )aÜ  Return newly added movie shape displaying video in `movie_file`.

        **EXPERIMENTAL.** This method has important limitations:

        * The size must be specified; no auto-scaling such as that provided by :meth:`add_picture`
          is performed.
        * The MIME type of the video file should be specified, e.g. 'video/mp4'. The provided
          video file is not interrogated for its type. The MIME type `video/unknown` is used by
          default (and works fine in tests as of this writing).
        * A poster frame image must be provided, it cannot be automatically extracted from the
          video file. If no poster frame is provided, the default "media loudspeaker" image will
          be used.

        Return a newly added movie shape to the slide, positioned at (`left`, `top`), having size
        (`width`, `height`), and containing `movie_file`. Before the video is started,
        `poster_frame_image` is displayed as a placeholder for the video.
        )	Ú_MoviePicElementCreatorÚnew_movie_picrZ   r=   rÐ   Ú_add_video_timingr	   r   rI   )	r?   Ú
movie_filerÓ   rÔ   rÕ   rÖ   Úposter_frame_imageÚ	mime_typeÚ	movie_pics	            rC   Ú	add_moviezSlideShapes.add_movie#  so   € ô6 ,×9Ñ9ØØ×ÑØØØØØØØó

ˆ	ð 	�‰×Ñ˜IÔ&Ø×Ñ˜yÔ)Ü”L $×"5Ñ"5°iÓ"@ÓAÐArD   c                ól   — | j                  ||||||«      }t        t        | j                  |«      «      S )a®  Add a |GraphicFrame| object containing a table.

        The table has the specified number of `rows` and `cols` and the specified position and
        size. `width` is evenly distributed between the columns of the new table. Likewise,
        `height` is evenly distributed between the rows. Note that the `.table` property on the
        returned |GraphicFrame| shape must be used to access the enclosed |Table| object.
        )Ú"_add_graphicFrame_containing_tabler	   r   rI   )r?   ÚrowsÚcolsrÓ   rÔ   rÕ   rÖ   r»   s           rC   Ú	add_tablezSlideShapes.add_tableM  s9   € ð ×>Ñ>¸tÀTÈ4ÐQTÐV[Ð]cÓdˆÜ”L $×"5Ñ"5°lÓ"CÓDÐDrD   c                óP   — |j                  «       D ]  }| j                  |«       Œ y)z½Add placeholder shapes based on those in `slide_layout`.

        Z-order of placeholders is preserved. Latent placeholders (date, slide number, and footer)
        are not cloned.
        N)Úiter_cloneable_placeholdersrc   )r?   Úslide_layoutr]   s      rC   Úclone_layout_placeholdersz%SlideShapes.clone_layout_placeholdersZ  s*   € ð (×CÑCÓEò 	0ˆKØ×"Ñ" ;Õ/ñ	0rD   c                ó.   — | j                   j                  S )z-Sequence of placeholder shapes in this slide.)rA   Úplaceholdersr}   s    rC   r'  zSlideShapes.placeholdersc  s   € ð �{‰{×'Ñ'Ð'rD   c                ó¢   — | j                   j                  «       D ]2  }|j                  dk(  sŒt        t        | j                  |«      «      c S  y)ziThe title placeholder shape on the slide.

        |None| if the slide has no title placeholder.
        r   N)r=   Úiter_ph_elmsrY   r	   r   rI   )r?   Úelms     rC   ÚtitlezSlideShapes.titleh  sH   € ð —<‘<×,Ñ,Ó.ò 	=ˆCØ�z‰z˜Q‹ÜœE 4×#6Ñ#6°sÓ#;Ó<Ò<ð	=ð rD   c           
     ór   — | j                   }d|dz
  z  }| j                  j                  ||||||||«      }	|	S )zNReturn a newly added `p:graphicFrame` element containing a table as specified.zTable %dr‹   )rZ   r=   r!  )
r?   r  r   rµ   r¶   r·   r¸   Ú_idrb   r»   s
             rC   r  z.SlideShapes._add_graphicFrame_containing_tables  sE   € ð ×!Ñ!ˆØ˜S 1™WÑ%ˆØ—|‘|×-Ñ-¨c°4¸¸tÀQÈÈ2ÈrÓRˆØÐrD   c                ó–   — | j                   j                  d«      d   }|j                  «       }|j                  |j                  «       y)zÌAdd a `p:video` element under `p:sld/p:timing`.

        The element will refer to the specified `pic` element by its shape id, and cause the video
        play controls to appear for that video.
        z/p:sldr   N)r=   rŽ   Úget_or_add_childTnLstÚ	add_videor÷   )r?   rà   ÚsldÚ
childTnLsts       rC   r  zSlideShapes._add_video_timing|  s=   € ð �l‰l× Ñ  Ó*¨1Ñ-ˆØ×.Ñ.Ó0ˆ
Ø×Ñ˜SŸ\™\Õ*rD   c                ó   — t        || «      S r•   ©ÚSlideShapeFactoryrO   s     rC   rI   zSlideShapes._shape_factory†  s   € ä  ¨DÓ1Ð1rD   )r  r	  rÓ   r6   rÔ   r6   rÕ   r6   rÖ   r6   r  r  r  r�   r™   r   )r  r˜   r   r˜   rÓ   r6   rÔ   r6   rÕ   r6   rÖ   r6   r™   r   )r$  r4   r™   r›   )r™   ÚSlidePlaceholders)r™   zShape | None)r  r˜   r   r˜   rµ   r6   r¶   r6   r·   r6   r¸   r6   r™   r   )rà   r   r™   r›   rŸ   )r    r¡   r¢   r£   r  ÚCTÚVIDEOr  r!  r%  r¤   r'  r+  r  r  rI   r…   rD   rC   r  r    s0  … ñð ƒMð 6:ØŸ™ð(Bà#ð(Bð ð(Bð ð	(Bð
 ð(Bð ð(Bð 3ð(Bð ð(Bð 
ó(BðTEØðEØ"ðEØ*0ðEØ7=ðEØFLðEØV\ðEà	óEó0ð ò(ó ð(ð òó ððØðØ"ðØ'-ðØ28ðØ>DðØJPðà	 óó+ô2rD   r  c                  ó   — e Zd ZdZdd„Zy)ÚLayoutShapeszÏSequence of shapes appearing on a slide layout.

    The first shape in the sequence is the backmost in z-order and the last shape is topmost.
    Supports indexed access, len(), index(), and iteration.
    c                ó   — t        || «      S r•   ©Ú_LayoutShapeFactoryrO   s     rC   rI   zLayoutShapes._shape_factory’  ó   € ä" 9¨dÓ3Ð3rD   NrŸ   ©r    r¡   r¢   r£   rI   r…   rD   rC   r:  r:  ‹  ó   „ ñô4rD   r:  c                  ó   — e Zd ZdZdd„Zy)ÚMasterShapeszÆSequence of shapes appearing on a slide master.

    The first shape in the sequence is the backmost in z-order and the last shape is topmost.
    Supports indexed access, len(), and iteration.
    c                ó   — t        || «      S r•   )Ú_MasterShapeFactoryrO   s     rC   rI   zMasterShapes._shape_factoryž  r>  rD   NrŸ   r?  r…   rD   rC   rB  rB  —  r@  rD   rB  c                  ó    — e Zd ZdZdd„Zdd„Zy)ÚNotesSlideShapeszÎSequence of shapes appearing on a notes slide.

    The first shape in the sequence is the backmost in z-order and the last shape is topmost.
    Supports indexed access, len(), index(), and iteration.
    c                óÌ   — t         j                  dt         j                  dt         j                  dt         j                  dt         j
                  dt         j                  di|   S )a  Return the base name for a placeholder of `ph_type` in this shape collection.

        A notes slide uses a different name for the body placeholder and has some unique
        placeholder types, so this method overrides the default in the base class.
        zNotes Placeholderrf   rg   rh   zSlide Image Placeholderri   )r
   rl   ro   rp   rq   ÚSLIDE_IMAGErv   rz   s     rC   r{   zNotesSlideShapes.ph_basenameª  s`   € ô ×ÑÐ!4Ü×ÑÐ!3Ü×!Ñ!Ð#7Ü×!Ñ!Ð#7Ü×&Ñ&Ð(AÜ×'Ñ'Ð)Cð
ð ñð 	rD   c                ó   — t        || «      S )zKReturn appropriate shape object for `shape_elm` appearing on a notes slide.)Ú_NotesSlideShapeFactoryrO   s     rC   rI   zNotesSlideShapes._shape_factory¹  s   € ä& y°$Ó7Ð7rD   Nrœ   rŸ   )r    r¡   r¢   r£   r{   rI   r…   rD   rC   rF  rF  £  s   „ ñóô8rD   rF  c                  ó"   — e Zd ZdZedd„«       Zy)ÚBasePlaceholdersa  Base class for placeholder collections.

    Subclasses differentiate behaviors for a master, layout, and slide. By default, placeholder
    shapes are constructed using |BaseShapeFactory|. Subclasses should override
    :method:`_shape_factory` to use custom placeholder classes.
    c                ó   — | j                   S )z<True if `shape_elm` is a placeholder shape, False otherwise.)Ú
has_ph_elmr†   s    rC   r‡   zBasePlaceholders._is_member_elmÆ  s   € ð ×#Ñ#Ð#rD   Nrž   )r    r¡   r¢   r£   r¦   r‡   r…   rD   rC   rL  rL  ¾  s   „ ñð ò$ó ñ$rD   rL  c                  ó.   — e Zd ZU dZded<   ddd„Zd	d„Zy)
ÚLayoutPlaceholderszVSequence of |LayoutPlaceholder| instance for each placeholder shape on a slide layout.z)Callable[[], Iterator[LayoutPlaceholder]]rP   Nc                óN   — | D ]  }|j                   j                  |k(  sŒ|c S  |S )zQThe first placeholder shape with matching `idx` value, or `default` if not found.)rU   rY   )r?   rJ   Údefaultr]   s       rC   ÚgetzLayoutPlaceholders.getÓ  s2   € àò 	#ˆKØ×"Ñ"×)Ñ)¨SÓ0Ø"Ò"ð	#ð ˆrD   c                ó   — t        || «      S r•   r<  rO   s     rC   rI   z!LayoutPlaceholders._shape_factoryÚ  r>  rD   r:   )rJ   r˜   rR  úLayoutPlaceholder | Noner™   rU  rŸ   ©r    r¡   r¢   r£   r  rS  rI   r…   rD   rC   rP  rP  Ì  s   … Ù`ðó ôô4rD   rP  c                  ó6   — e Zd ZU dZded<   ddd„Z	 	 	 	 d	d„Zy)
ÚMasterPlaceholderszTSequence of MasterPlaceholder representing the placeholder shapes on a slide master.z)Callable[[], Iterator[MasterPlaceholder]]rP   Nc                ó:   — | D ]  }|j                   |k(  sŒ|c S  |S )z¤Return the first placeholder shape with type `ph_type` (e.g. 'body').

        Returns `default` if no such placeholder shape is present in the collection.
        )rV   )r?   rV   rR  r]   s       rC   rS  zMasterPlaceholders.getæ  s.   € ð
  ò 	#ˆKØ×"Ñ" gÓ-Ø"Ò"ð	#ð ˆrD   c                ó6   — t        t        t        || «      «      S r•   )r	   r   rD  ©r?   Úplaceholder_elms     rC   rI   z!MasterPlaceholders._shape_factoryð  s   € ô Ô%Ô':¸?ÈDÓ'QÓRÐRrD   r:   )rV   r
   rR  zMasterPlaceholder | None)r\  r   r™   r   rV  r…   rD   rC   rX  rX  ß  s,   … Ù^ðó ôðSØ'ðSà	ôSrD   rX  c                  ó,   — e Zd ZU dZded<   	 	 	 	 dd„Zy)ÚNotesSlidePlaceholdersz0Sequence of placeholder shapes on a notes slide.z-Callable[[], Iterator[NotesSlidePlaceholder]]rP   c                ó6   — t        t        t        || «      «      S )zTReturn an instance of the appropriate placeholder proxy class for `placeholder_elm`.)r	   r    rJ  r[  s     rC   rI   z%NotesSlidePlaceholders._shape_factoryþ  s   € ô Ô)Ô+BÀ?ÐTXÓ+YÓZÐZrD   N)r\  r   r™   r    )r    r¡   r¢   r£   r  rI   r…   rD   rC   r^  r^  ÷  s'   … Ù:ðó ð[Ø'ð[à	ô[rD   r^  c                  ó2   — e Zd ZU dZded<   dd„Zd„ Zd	d„Zy)
r6  z«Collection of placeholder shapes on a slide.

    Supports iteration, :func:`len`, and dictionary-style lookup on the `idx` value of the
    placeholders it contains.
    r0   r¬   c                ó–   — | j                   j                  «       D ]  }|j                  |k(  sŒt        || «      c S  t	        d|z  «      ‚)zäAccess placeholder shape having `idx`.

        Note that while this looks like list access, idx is actually a dictionary key and will
        raise |KeyError| if no placeholder with that idx value is in the collection.
        z+no placeholder on this slide with idx == %d)r¬   r)  rY   r5  ÚKeyError)r?   rJ   Úes      rC   rM   zSlidePlaceholders.__getitem__  sK   € ð —‘×+Ñ+Ó-ò 	2ˆAØ�x‰x˜3‹Ü(¨¨DÓ1Ò1ð	2ô ÐDÀsÑJÓKÐKrD   c                óŒ   ‡ — t        ‰ j                  j                  «       D �cg c]  }|‘Œ c}d„ ¬«      }ˆ fd„|D «       S c c}w )z+Generate placeholder shapes in `idx` order.c                ó   — | j                   S r:   )rY   )rc  s    rC   ú<lambda>z,SlidePlaceholders.__iter__.<locals>.<lambda>  s   € ÐRS×RZÑRZ€ rD   )Úkeyc              3  ó6   •K  — | ]  }t        |‰«      –— Œ y ­wr:   r4  )Ú.0rc  r?   s     €rC   ú	<genexpr>z-SlidePlaceholders.__iter__.<locals>.<genexpr>  s   øè ø€ Ò<¨qÔ! ! T×*Ñ<ùs   ƒ)Úsortedr¬   r)  )r?   rc  Úph_elmss   `  rC   rP   zSlidePlaceholders.__iter__  s9   ø€ ä T§]¡]×%?Ñ%?Ó%AÖB š!ÒBÑHZÔ[ˆÛ<°GÔ<Ð<ùò Cs   £	Ac                óZ   — t        t        | j                  j                  «       «      «      S )z#Return count of placeholder shapes.)rR   rF   r¬   r)  r}   s    rC   rS   zSlidePlaceholders.__len__  s   € ä”4˜Ÿ™×2Ñ2Ó4Ó5Ó6Ð6rD   N)rJ   r˜   rš   )r    r¡   r¢   r£   r  rM   rP   rS   r…   rD   rC   r6  r6    s   … ñð Óó	Lò=ô
7rD   r6  c           	     óF  — | j                   }t        | t        «      r+| j                  d«      }|rt	        | |«      S t        | |«      S t        d«      t        t        d«      t        t        d«      t        t        d«      t        ij                  |t        «      } || |«      S )r–   z./p:nvPicPr/p:nvPr/a:videoFilezp:cxnSpzp:grpSpúp:spúp:graphicFrame)Útagrë   r   rŽ   r   r   r   r   r   r   r   rS  r   )rL   rA   rq  Ú
videoFilesÚ	shape_clss        rC   r—   r—   #  s�   € à
�-‰-€Cä�)œZÔ(Ø—_‘_Ð%EÓFˆ
ÙÜ˜ FÓ+Ð+Ü�y &Ó)Ð)ô 	ˆ9‹”yÜ
ˆ9‹”zÜ
ˆ6‹
”EÜ
ÐÓœlð	÷
 
�cˆ#ŒyÓð ñ �Y Ó'Ð'rD   c                ój   — t        | t        «      r| j                  rt        | |«      S t	        | |«      S )zBReturn appropriate shape object for `shape_elm` on a slide layout.)rë   r   rN  r   r—   ©rL   rA   s     rC   r=  r=  7  ó.   € ä�)œXÔ&¨9×+?Ò+?Ü  ¨FÓ3Ð3Ü˜I vÓ.Ð.rD   c                ój   — t        | t        «      r| j                  rt        | |«      S t	        | |«      S )zBReturn appropriate shape object for `shape_elm` on a slide master.)rë   r   rN  r   r—   ru  s     rC   rD  rD  >  rv  rD   c                ój   — t        | t        «      r| j                  rt        | |«      S t	        | |«      S )zAReturn appropriate shape object for `shape_elm` on a notes slide.)rë   r   rN  r    r—   ru  s     rC   rJ  rJ  E  s.   € ä�)œXÔ&¨9×+?Ò+?Ü$ Y°Ó7Ð7Ü˜I vÓ.Ð.rD   c                óŠ  — | j                   }|t        d«      k(  rqt        j                  t        t        j
                  t        t        j                  t        t        j                  t        ij                  | j                  t        «      }n0|t        d«      k(  rt        }n|t        d«      k(  rt        }nt        } || |«      S )zCReturn a placeholder shape of the appropriate type for `shape_elm`.ro  rp  zp:pic)rq  r   r
   rk   r!   rn   r   ru   rx   r%   rS  rV   r$   r"   r#   r—   )rL   rA   rq  ÚConstructors       rC   Ú_SlidePlaceholderFactoryr{  L  sž   € à
�-‰-€CØ
Œb�‹jÒä×!Ñ!Ô#5Ü× Ñ Ô"2Ü×"Ñ"Ô$6Ü× Ñ Ô"2ð	
÷
 ‰#ˆi×ÑÔ!1Ó
2ñ 	ð 
”Ð#Ó$Ò	$Ü-‰Ø	”�7“Ò	Ü(‰ä&ˆÙ�y &Ó)Ð)rD   c                óJ   — | j                   rt        | |«      S t        | |«      S )z;Return appropriate shape object for `shape_elm` on a slide.)rN  r{  r—   ru  s     rC   r5  r5  _  s%   € à×ÒÜ'¨	°6Ó:Ð:Ü˜I vÓ.Ð.rD   c                  ó$  ‡ — e Zd ZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dˆ f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edd	„«       Ze	dd
„«       Ze	dd„«       Zedd„«       Zˆ xZS )r  a²  Functional service object for creating a new movie p:pic element.

    It's entire external interface is its :meth:`new_movie_pic` class method that returns a new
    `p:pic` element containing the specified video. This class is not intended to be constructed
    or an instance of it retained by the caller; it is a "one-shot" object, really a function
    wrapped in a object such that its helper methods can be organized here.
    c
                ó®   •— t         t        | �  «        || _        || _        || _        ||||f\  | _        | _        | _        | _	        || _
        |	| _        y r:   )r;   r  r<   Ú_shapesÚ	_shape_idÚ_movie_fileÚ_xÚ_yÚ_cxÚ_cyÚ_poster_frame_fileÚ
_mime_type)r?   rË   r÷   r  rµ   r¶   r·   r¸   Úposter_frame_filer  rB   s             €rC   r<   z _MoviePicElementCreator.__init__o  sV   ø€ ô 	Ô% tÑ5Ô7ØˆŒØ!ˆŒØ%ˆÔØ/0°!°R¸¨|Ñ,ˆŒ�”˜$œ( D¤HØ"3ˆÔØ#ˆ�rD   c
                ó6   —  | |||||||||	«	      j                   S )zØReturn a new `p:pic` element containing video in `movie_file`.

        If `mime_type` is None, 'video/unknown' is used. If `poster_frame_file` is None, the
        default "media loudspeaker" image is used.
        )Ú_pic)
ÚclsrË   r÷   r  rµ   r¶   r·   r¸   r  r  s
             rC   r  z%_MoviePicElementCreator.new_movie_picƒ  s'   € ñ$ �6˜8 Z°°A°r¸2Ð?QÐS\Ó]×bÑbÐbrD   c                ó    — | j                   d   S )zËReturn the rId of RT.MEDIA relationship to video part.

        For historical reasons, there are two relationships to the same part; one is the video rId
        and the other is the media rId.
        r   ©Ú_video_part_rIdsr}   s    rC   Ú
_media_rIdz"_MoviePicElementCreator._media_rId—  ó   € ð ×$Ñ$ QÑ'Ð'rD   c                óð   — t        j                  | j                  | j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                  «	      S )z5Return the new `p:pic` element referencing the video.)r   Únew_video_picr€  Ú_shape_nameÚ
_video_rIdr�  Ú_poster_frame_rIdr‚  rƒ  r„  r…  r}   s    rC   rŠ  z_MoviePicElementCreator._pic   sZ   € ô ×'Ñ'Ø�N‰NØ×ÑØ�O‰OØ�O‰OØ×"Ñ"Ø�G‰GØ�G‰GØ�H‰HØ�H‰Hó

ð 
	
rD   c                óT   — | j                   }|€t        j                  t        «      S |S )z˜Return the image file for video placeholder image.

        If no poster frame file is provided, the default "media loudspeaker" image is used.
        )r†  ÚioÚBytesIOr   )r?   rˆ  s     rC   Ú_poster_frame_image_filez0_MoviePicElementCreator._poster_frame_image_file¯  s,   € ð !×3Ñ3ÐØÐ$Ü—:‘:Ô1Ó2Ð2Ø Ð rD   c                óV   — | j                   j                  | j                  «      \  }}|S )z•Return the rId of relationship to poster frame image.

        The poster frame is the image used to represent the video before it's played.
        )Ú_slide_partrÜ   r™  )r?   Ú_Úposter_frame_rIds      rC   r•  z)_MoviePicElementCreator._poster_frame_rIdº  s,   € ð #×.Ñ.×DÑDÀT×EbÑEbÓcÑˆÐØÐrD   c                ó.   — | j                   j                  S )z„Return the appropriate shape name for the p:pic shape.

        A movie shape is named with the base filename of the video.
        )Ú_videoÚfilenamer}   s    rC   r“  z#_MoviePicElementCreator._shape_nameÃ  s   € ð �{‰{×#Ñ#Ð#rD   c                ó.   — | j                   j                  S )z8Return SlidePart object for slide containing this movie.©r  r«   r}   s    rC   r›  z#_MoviePicElementCreator._slide_partË  ó   € ð �|‰|× Ñ Ð rD   c                óV   — t        j                  | j                  | j                  «      S )z2Return a |Video| object containing the movie file.)r   Úfrom_path_or_file_liker�  r‡  r}   s    rC   rŸ  z_MoviePicElementCreator._videoÐ  s!   € ô ×+Ñ+¨D×,<Ñ,<¸d¿o¹oÓNÐNrD   c                óZ   — | j                   j                  | j                  «      \  }}||fS )z¢Return the rIds for relationships to media part for video.

        This is where the media part and its relationships to the slide are actually created.
        )r›  Úget_or_add_video_media_partrŸ  )r?   Ú	media_rIdÚ	video_rIds      rC   rŽ  z(_MoviePicElementCreator._video_part_rIdsÕ  s.   € ð  $×/Ñ/×KÑKÈDÏKÉKÓXÑˆ	�9Ø˜)Ð#Ð#rD   c                ó    — | j                   d   S )zËReturn the rId of RT.VIDEO relationship to video part.

        For historical reasons, there are two relationships to the same part; one is the video rId
        and the other is the media rId.
        r‹   r�  r}   s    rC   r”  z"_MoviePicElementCreator._video_rIdÞ  r�  rD   )rË   r  r÷   r˜   r  r	  rµ   r6   r¶   r6   r·   r6   r¸   r6   rˆ  r  r  ú
str | None)rË   r  r÷   r˜   r  r	  rµ   r6   r¶   r6   r·   r6   r¸   r6   r  r  r  r«  r™   r   ©r™   r�   )r™   r   ©r™   r	  ©r™   r2   )r™   r   )r™   ztuple[str, str])r    r¡   r¢   r£   r<   Úclassmethodr  r¤   r�  r(   rŠ  r™  r•  r“  r›  rŸ  rŽ  r”  r§   r¨   s   @rC   r  r  f  s�  ø„ ñð$àð$ð ð$ð $ð	$ð
 ð$ð ð$ð ð$ð ð$ð 2ð$ð õ$ð( ðcàðcð ðcð $ð	cð
 ðcð ðcð ðcð ðcð 3ðcð ðcð 
òcó ðcð& ò(ó ð(ð ò
ó ð
ð ò!ó ð!ð ò ó ð ð ò$ó ð$ð ò!ó ð!ð òOó ðOð ò$ó ð$ð ò(ó ô(rD   r  c                  óL  — e Zd ZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d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edd	„«       Zedd
„«       Zedd„«       Zedd„«       Zedd„«       Zedd„«       Zy)rÏ   aà  Functional service object for creating a new OLE-object p:graphicFrame element.

    It's entire external interface is its :meth:`graphicFrame` class method that returns a new
    `p:graphicFrame` element containing the specified embedded OLE-object shape. This class is not
    intended to be constructed or an instance of it retained by the caller; it is a "one-shot"
    object, really a function wrapped in a object such that its helper methods can be organized
    here.
    c                óž   — || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        || _
        y r:   )r  r€  Ú_ole_object_fileÚ_prog_id_argr‚  rƒ  Ú_cx_argÚ_cy_argÚ_icon_file_argÚ_icon_width_argÚ_icon_height_arg)r?   rË   r÷   Úole_object_filerÒ   rµ   r¶   r·   r¸   r×   rØ   rÙ   s               rC   r<   z!_OleObjectElementCreator.__init__ò  sV   € ð ˆŒØ!ˆŒØ /ˆÔØ#ˆÔØˆŒØˆŒØˆŒØˆŒØ'ˆÔØ)ˆÔØ +ˆÕrD   c                ó:   —  | |||||||||	|
|«      j                   S )zJReturn new `p:graphicFrame` element containing embedded `ole_object_file`.)Ú_graphicFrame)r‹  rË   r÷   r¹  rÒ   rµ   r¶   r·   r¸   r×   rØ   rÙ   s               rC   r»   z%_OleObjectElementCreator.graphicFrame  s9   € ñ  ØØØØØØØØØØØó
÷ ‰-ð	rD   c                ó  — t        j                  | j                  | j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                  | j                  | j                  «      S )zGNewly-created `p:graphicFrame` element referencing embedded OLE-object.)r   Únew_ole_object_graphicFramer€  r“  Ú_ole_object_rIdÚ_progIdÚ	_icon_rIdr‚  rƒ  r„  r…  Ú_icon_widthÚ_icon_heightr}   s    rC   r»  z&_OleObjectElementCreator._graphicFrame*  sl   € ô '×BÑBØ�N‰NØ×ÑØ× Ñ Ø�L‰LØ�N‰NØ�G‰GØ�G‰GØ�H‰HØ�H‰HØ×ÑØ×Ñó
ð 	
rD   c                óº   — | j                   �| j                   S t        | j                  t        «      rt	        | j                  j
                  «      S t	        d«      S )zBEmu object specifying width of "show-as-icon" image for OLE shape.éPº )r´  rë   r³  r   r'   rÕ   r}   s    rC   r„  z_OleObjectElementCreator._cx;  sP   € ð �<‰<Ð#Ø—<‘<Ðô
 -7°t×7HÑ7HÌ'Ô,RŒC�×!Ñ!×'Ñ'Ó(ð	
ÜX[Ð\bÓXcð	
rD   c                óº   — | j                   �| j                   S t        | j                  t        «      rt	        | j                  j
                  «      S t	        d«      S )zCEmu object specifying height of "show-as-icon" image for OLE shape.é@M	 )rµ  rë   r³  r   r'   rÖ   r}   s    rC   r…  z_OleObjectElementCreator._cyH  sP   € ð �<‰<Ð#Ø—<‘<Ðô
 .8¸×8IÑ8IÌ7Ô-SŒC�×!Ñ!×(Ñ(Ó)ð	
ÜY\Ð]cÓYdð	
rD   c                óH   — | j                   �| j                   S t        d«      S )aµ  Vertical size of enclosed EMF icon within the OLE graphic-frame.

        This must be specified when a custom icon is used, to avoid stretching of the image and
        possible undesired resizing by PowerPoint when the OLE shape is double-clicked to open it.

        The correct size can be determined by creating an example PPTX using PowerPoint and then
        inspecting the XML of the OLE graphics-frame (p:oleObj.imgH).
        rÆ  )r¸  r'   r}   s    rC   rÂ  z%_OleObjectElementCreator._icon_heightU  s%   € ð )-×(=Ñ(=Ð(Iˆt×$Ñ$ÐZÌsÐSYË{ÐZrD   c                ó`  — | j                   �| j                   S t        | j                  t        «      r| j                  j                  nd}t
        j                  j                  t        «      d   }t
        j                  j                  t
        j                  j                  |dd|«      «      S )z¥Reference to image file containing icon to show in lieu of this object.

        This can be either a str path or a file-like object (io.BytesIO typically).
        zgeneric-icon.emfr   z..Ú	templates)r¶  rë   r³  r   Úicon_filenameÚosÚpathÚsplitÚ__file__ÚabspathÚjoin)r?   rÊ  Ú_thisdirs      rC   Ú_icon_image_filez)_OleObjectElementCreator._icon_image_filea  s†   € ð ×ÑÐ*Ø×&Ñ&Ð&ô ˜$×+Ñ+¬WÔ5ð ×Ñ×+Ò+à#ð 	ô —7‘7—=‘=¤Ó*¨1Ñ-ˆÜ�w‰w�‰œrŸw™wŸ|™|¨H°d¸KÈÓWÓXÐXrD   c                óV   — | j                   j                  | j                  «      \  }}|S )zHstr rId like "rId7" of rel to icon (image) representing OLE-object part.)r›  rÜ   rÒ  )r?   rœ  rº   s      rC   rÀ  z"_OleObjectElementCreator._icon_rIdv  s)   € ð ×!Ñ!×7Ñ7¸×8MÑ8MÓN‰ˆˆ3Øˆ
rD   c                óH   — | j                   �| j                   S t        d«      S )a  Width of enclosed EMF icon within the OLE graphic-frame.

        This must be specified when a custom icon is used, to avoid stretching of the image and
        possible undesired resizing by PowerPoint when the OLE shape is double-clicked to open it.
        rÄ  )r·  r'   r}   s    rC   rÁ  z$_OleObjectElementCreator._icon_width|  s%   € ð (,×';Ñ';Ð'Gˆt×#Ñ#ÐXÌSÐQWË[ÐXrD   c                ób   — | j                   j                  | j                  | j                  «      S )z¬str rId like "rId6" of relationship to embedded ole_object part.

        This is where the ole_object part and its relationship to the slide are actually created.
        )r›  Úadd_embedded_ole_object_partr³  r²  r}   s    rC   r¾  z(_OleObjectElementCreator._ole_object_rId…  s.   € ð ×Ñ×<Ñ<Ø×Ñ˜t×4Ñ4ó
ð 	
rD   c                óV   — | j                   }t        |t        «      r|j                  S |S )z«str like "Excel.Sheet.12" identifying program used to open object.

        This value appears in the `progId` attribute of the `p:oleObj` element for the object.
        )r³  rë   r   ÚprogId)r?   Úprog_id_args     rC   r¿  z _OleObjectElementCreator._progId�  s+   € ð ×'Ñ'ˆô &0°¼WÔ%Eˆ{×!Ñ!ÐVÈ;ÐVrD   c                ó&   — d| j                   dz
  z  S )z�str name like "Object 1" for the embedded ole_object shape.

        The name is formed from the prefix "Object " and the shape-id decremented by 1.
        z	Object %dr‹   )r€  r}   s    rC   r“  z$_OleObjectElementCreator._shape_name›  s   € ð ˜dŸn™n¨qÑ0Ñ1Ð1rD   c                ó.   — | j                   j                  S )z SlidePart object for this slide.r¢  r}   s    rC   r›  z$_OleObjectElementCreator._slide_part£  r£  rD   N)rË   rª   r÷   r˜   r¹  r	  rÒ   úPROG_ID | strrµ   r6   r¶   r6   r·   r
  r¸   r
  r×   r  rØ   r
  rÙ   r
  )rË   rª   r÷   r˜   r¹  r	  rÒ   rÜ  rµ   r6   r¶   r6   r·   r
  r¸   r
  r×   r  rØ   r
  rÙ   r
  r™   r   )r™   r   )r™   r6   r­  r¬  r®  )r    r¡   r¢   r£   r<   r¯  r»   r(   r»  r„  r…  rÂ  rÒ  rÀ  rÁ  r¾  r¿  r“  r›  r…   rD   rC   rÏ   rÏ   è  sæ  „ ñð,à ð,ð ð,ð )ð	,ð
 ð,ð ð,ð ð,ð ð,ð ð,ð *ð,ð "ð,ð #ó,ð4 ðà ðð ðð )ð	ð
 ðð ðð ðð ðð ðð *ðð "ðð #ðð 
!òó ðð: ò
ó ð
ð  ò

ó ð

ð ò

ó ð

ð ò	[ó ð	[ð òYó ðYð( òó ðð
 òYó ðYð ò
ó ð
ð ò	Wó ð	Wð ò2ó ð2ð ò!ó ñ!rD   rÏ   )rL   r.   rA   r5   r™   r   )rL   r.   rA   r5   )kr£   Ú
__future__r   r—  rË  Útypingr   r   r   r   r   r	   Úpptx.enum.shapesr
   r   Ú
pptx.mediar   r   Úpptx.opc.constantsr   r7  Úpptx.oxml.nsr   Úpptx.oxml.shapes.autoshaper   Úpptx.oxml.shapes.graphfrmr   Úpptx.oxml.shapes.picturer   Úpptx.oxml.simpletypesr   Úpptx.shapes.autoshaper   r   Úpptx.shapes.baser   Úpptx.shapes.connectorr   Úpptx.shapes.freeformr   Úpptx.shapes.graphfrmr   Úpptx.shapes.groupr   Úpptx.shapes.picturer   r   Úpptx.shapes.placeholderr   r   r   r    r!   r"   r#   r$   r%   Úpptx.sharedr&   Ú	pptx.utilr'   r(   Úpptx.chart.chartr)   Úpptx.chart.datar*   Úpptx.enum.chartr+   r,   r-   Úpptx.oxml.shapesr.   Úpptx.oxml.shapes.connectorr/   Úpptx.oxml.shapes.groupshaper0   Úpptx.parts.imager1   Úpptx.parts.slider2   Ú
pptx.slider3   r4   Ú
pptx.typesr5   r6   r8   rª   r  r  r:  rB  rF  rL  rP  rX  r^  r6  r—   r=  rD  rJ  r{  r5  Úobjectr  rÏ   r…   rD   rC   ú<module>rü     sa  ðÙ @å "ã 	Û 	ß H× Hç 4ß 1Ý 1Ý Ý /Ý =Ý /Ý .ß 6Ý &Ý +Ý 0Ý -Ý (ß .÷
÷ 
õ 
õ -ß 'áÝ&Ý)Ý-ß>Ý-Ý7Ý9Ý*Ý*ß-Ý'Ý ô6R1Ð&ô R1ôje�{ô eôP	*Ð"ô *ô n2Ð"ô n2ôb	4�;ô 	4ô	4�;ô 	4ô8�{ô 8ô6$�{ô $ô4Ð)ô 4ô&SÐ)ô Sô0[Ð/ô [ô7Ð,ô 7ó<(ó(/ó/ó/ó*ó&/ô(˜fô (ôD~!˜võ ~!rD   