Ë
    ¼vëjå  ã                  óº   — d Z ddlmZ ddlmZmZmZmZmZ ddl	m
Z
mZmZ ed   Zed   Zed   Z G d„ d	e
«      Z G d
„ de
«      Z G d„ de
«      Z G d„ de
«      Zy)aJ  A content template as data: which blocks, in what order, with what style, and what each block needs.

A template owns the layout and nothing else. No words, no colour, no font, no logo: those are values, filled by
whoever knows them (see values.py). The same file serves every organisation and every piece of content of its kind.
é    )Úannotations)ÚAnyÚDictÚListÚLiteralÚOptional)Ú	BaseModelÚFieldÚmodel_validator)ÚemailÚsmsÚpushÚcardÚpost)ÚbrandÚjourneyÚaudienceÚ	behaviourÚidentityÚcopyÚmade)ÚtextÚimageÚurlÚmoneyÚlistÚcolourc                  óz   — e Zd ZU dZded<   ded<   dZded<   d	Zd
ed<   dZded<   dZded<   dZ	ded<   dZ
ded<   y)ÚValuez£One thing a block shows. `source` says who knows it; identity and behaviour values may be filled per person
    at send time, the rest when the content is written.ÚstrÚkeyÚSourceÚsourcer   ÚKindÚkindTÚboolÚrequiredNzOptional[int]Ú	max_wordsÚ	max_charsúOptional[str]ÚeventÚfallback)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r%   r'   r(   r)   r+   r,   © ó    ú]/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/galaxiq_utils/templates/spec.pyr   r      sM   … ñ;à	ƒHØƒNØ€Dˆ$ÓØ€HˆdÓØ#€Iˆ}Ó#Ø#€Iˆ}Ó#Ø€Eˆ=ÓØ"€HˆmÔ"r3   r   c                  ó^   — e Zd ZU ded<   dZded<    ee¬«      Zded<    ee¬«      Z	d	ed
<   y)ÚBlockr    ÚtypeNr*   Úname©Údefault_factoryúList[Value]ÚvalueszDict[str, str]Úoptions)
r-   r.   r/   r1   r8   r
   r   r<   Údictr=   r2   r3   r4   r6   r6      s/   … Ø
ƒIØ€Dˆ-ÓÙ°Ô5€FˆKÓ5Ù#°DÔ9€Gˆ^Ô9r3   r6   c                  óÈ   — e Zd ZU dZdZded<   dZded<   dZd	ed
<   dZded<   dZ	ded<   dZ
ded<   dZded<   dZded<   dZded<   dZded<   d Zd!ed"<   d#Zd$ed%<   d&Zd'ed(<   y))*ÚStylez`The composition. Every token is a word a renderer turns into layout; none is a colour or a font.ÚleftzLiteral['left', 'center']ÚalignÚtintedz+Literal['white', 'tinted', 'warm', 'brand']Úgroundr   zLiteral['card', 'flat']ÚframeÚsoftz Literal['none', 'soft', 'round']ÚradiusÚfilledz,Literal['filled', 'outline', 'pill', 'link']ÚbuttonÚlargez$Literal['small', 'large', 'display']ÚheadingÚairyz%Literal['airy', 'regular', 'compact']ÚdensityÚinsetz!Literal['none', 'inset', 'bleed']ÚheroÚnonez!Literal['none', 'thin', 'strong']ÚrulesÚonezLiteral['one', 'two']ÚcolumnsÚsanszLiteral['sans', 'serif']r7   r   zLiteral['brand', 'template']ÚfontsÚsmallzLiteral['small', 'large']ÚlogoN)r-   r.   r/   r0   rB   r1   rD   rE   rG   rI   rK   rM   rO   rQ   rS   r7   rU   rW   r2   r3   r4   r@   r@   %   s”   … ÙjØ'-€EÐ$Ó-Ø:B€FÐ7ÓBØ%+€EÐ"Ó+Ø/5€FÐ,Ó5Ø;C€FÐ8ÓCØ4;€GÐ1Ó;Ø5;€GÐ2Ó;Ø.5€DÐ
+Ó5Ø/5€EÐ,Ó5Ø%*€GÐ"Ó*Ø%+€DÐ
"Ó+Ø*1€EÐ'Ó1Ø&-€DÐ
#Ô-r3   r@   c                  óà   — e Zd ZU ded<   ded<   ded<   ded<    ee¬«      Zded	<    ee¬«      Zd
ed<   ded<    ee	¬«      Z
ded<   dZded<   dZded<    ed¬«      dd„«       Zdd„Zdd„Zy)ÚTemplater    r8   ÚChannelÚchannelr%   Údescriptionr9   ú	List[str]Úsuitsr@   ÚstylezList[Block]ÚblockszDict[str, Any]Úsampleé   ÚintÚversionÚgalaxiqz"Literal['galaxiq', 'organisation']ÚownerÚafter)Úmodec                ó’  — | j                   st        d«      ‚| j                   D ��cg c]?  }|j                  D ].  }|j                  dk(  sŒ|j                  dk7  sŒ#|j                  ‘Œ0 ŒA }}}t        |D �ch c]  }|j                  |«      dkD  sŒ|’Œ c}«      }|rt        ddj                  |«      › d�«      ‚| S c c}}w c c}w )Nz#a template holds at least one blockr   zcopy.cta_labelrb   za value is filled once; z, z. appear on two blocks: name the repeated block)r`   Ú
ValueErrorr<   r#   r!   ÚsortedÚcountÚjoin)ÚselfÚbÚvÚwordsÚkÚtwices         r4   Ú_one_of_each_requiredzTemplate._one_of_each_requiredB   s±   € à�{Š{ÜÐBÓCÐCð !%§¡×r˜1°Q·X±XÒr°ÀÇÁÈVÓASÐXY×X]ÑX]ÐaqÓXq�—“Ðr�ÐrˆÑrÜ 5Ö?˜a¨E¯K©K¸«N¸QÓ,>šÒ?Ó@ˆÙÜÐ7¸¿	¹	À%Ó8HÐ7IÐIwÐxÓyÐyØˆùó	 sùÚ?s   §#B>ÁB>ÁB>Á7CÂCc                óh   — | j                   D ��cg c]  }|j                  D ]  }|‘Œ Œ c}}S c c}}w )N)r`   r<   )rn   ro   rp   s      r4   r<   zTemplate.valuesN   s*   € ØŸ;™;×9�a°·±Ò9¨1’Ð9�Ó9Ð9ùÓ9s   �.c                ó\  — g }| j                  «       D ]ú  }|j                  r|j                  dv rŒ|j                  dk(  r,|j                  r |j	                  d|j                  › d�«       ŒY|j                  dk(  r|j	                  d«       Œzd|j
                  v r|j
                  j                  dd«      nd	|j
                  f\  }}|d
k(  rdn|j                  dd«      }|dv r|n|› d|› �}|j	                  |d   dv rdnd› d|› d�«       Œü t        t        j                  |«      «      S )z¶What an organisation must have for this template, in words: the required values that are not copy and
        not the brand (every organisation has a name; a logo is never required).)r   r   r   r   zthe z event firingr   zpeople you know by nameú.rb   Ú r   ÚlinkÚ_ú )rx   Úctar   ÚaeiouÚanÚaz on the journey)r<   r'   r#   r+   Úappendr!   ÚsplitÚreplacer   r>   Úfromkeys)rn   Úsaidrp   ÚfirstÚlastÚthings         r4   ÚneedszTemplate.needsQ   s  € ð ˆØ—‘“ò 	^ˆAØ—:’: §¡Ð-FÑ!FØØ�x‰x˜;Ò&¨1¯7ª7Ø—‘˜d 1§7¡7 )¨=Ð9Õ:Ø—‘˜ZÒ'Ø—‘Ð5Õ6à58¸A¿E¹E±\˜aŸe™eŸk™k¨#¨qÔ1ÈÈAÏEÉEÀ{‘��tØ!%¨¢‘v°D·L±LÀÀcÓ4J�Ø %¨Ñ 4™¸U¸GÀ1ÀTÀFÐ:K�Ø—‘ u¨Q¡x°7Ñ':™tÀÐDÀAÀeÀWÈOÐ\Õ]ð	^ô ”D—M‘M $Ó'Ó(Ð(r3   N)Úreturnz
'Template')r‰   r;   )r‰   r]   )r-   r.   r/   r1   r
   r   r^   r@   r_   r>   ra   rd   rf   r   rt   r<   rˆ   r2   r3   r4   rY   rY   6   s�   … Ø
ƒIØÓØ
ƒIØÓÙ¨TÔ2€Eˆ9Ó2Ù¨Ô/€Eˆ5Ó/ØÓÙ"°4Ô8€FˆNÓ8Ø€GˆSÓØ09€EÐ-Ó9á˜'Ô"ò	ó #ð	ó:ô)r3   rY   N)r0   Ú
__future__r   Útypingr   r   r   r   r   Úpydanticr	   r
   r   rZ   r"   r$   r   r6   r@   rY   r2   r3   r4   ú<module>r�      sl   ðñõ
 #ç 5Õ 5ç 6Ñ 6à
Ð8Ñ
9€Ø	ÐXÑ	Y€ØÐ@ÑA€ô
#ˆIô 
#ô:ˆIô :ô.ˆIô .ô"+)ˆyõ +)r3   