§
   ìˆQŸ+áºöã                   óz   — d Z ddlZddlZddlZddlmZ dZdZdZej	        fd„Z
d„ Zdd
„Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )a0  Start the first-run guide, from the service at Kodi's start or from the addon opened while it is due.

Every skin load closes all windows, so the guide opens only once the skin is in place: our skin, all its defaults and
its palette, one setup that the skin covers with its own screen (Home.xml, state.cover). Until the guide ends, the
service starts nothing else: no rows, no Pro tebe, no TMDb call (D4, D19). While Kodi runs, the guide also opens
whenever it becomes due (when_due: a sign-out, a sign-in from the menu to an account with an open guide, D32).
é    N)Ústatezplugin.video.milionarzmilionar.onboarding.openz<RunPlugin(plugin://plugin.video.milionar/?action=onboarding)c                 ó6   — t          j        d| z   |¦  «         d S )Nu   [MilionÃ¡Å™ Onboarding] )ÚxbmcÚlog)ÚmessageÚlevels     úc/Users/chudy/Library/Application Support/Kodi/addons/plugin.video.milionar/wcs/onboarding/launch.pyÚ_logr
      s    € Ý„HÐ'¨'Ñ1°5Ñ9Ô9Ð9Ð9Ð9ó    c                  ó¢  — ddl m} m} t          j        t
          ¦  «        }t          j        ¦   «         | j        k    r| 	                    |j
        d¦  «         |                     ¦   «         sdS t          j        ¦   «         | j        k    rdS ddl m} t          j        ¦   «         r)|                     ¦   «         rt          j        dd¦  «         dS )znOur skin with its defaults and palette (wcs/skin/transition.py, defaults.first_setup); True when it is active.r   )Ú	installerÚ
transitionÚ F)ÚdefaultszReloadSkin()T)Úwcs.skinr   r   Ú	xbmcaddonÚAddonÚADDON_IDr   Ú
getSkinDirÚSKIN_IDÚ
setSettingÚ	COMPLETEDÚrunr   r   ÚcoveredÚfirst_setupÚexecutebuiltin)r   r   Úaddonr   s       r	   Úprepare_skinr      s×   € à.Ð.Ð.Ð.Ð.Ð.Ð.Ð.ÝŒO�HÑ%Ô%€EÝ„ÑÔ˜IÔ-Ò-Ð-Ø×Ò˜Ô-¨rÑ2Ô2Ð2Ø�>Š>ÑÔð ØˆuÝ„ÑÔ˜IÔ-Ò-Ð-Øˆuð "Ð!Ð!Ð!Ð!Ð!Ý„}�„ð 2˜8×/Ò/Ñ1Ô1ð 2ÝÔ˜N¨DÑ1Ô1Ð1Øˆ4r   ç333333ã?c                 óÀ   — d„ }t          d¦  «        D ]J} |¦   «         r&|                      |¦  «        r dS  |¦   «         r dS Œ2|                      d¦  «        r dS ŒKdS )zGThe skin's last load is over: Home is up without a dialog for a moment.c                  óT   — t          j        d¦  «        ot          j        d¦  «         S )NzWindow.IsActive(home)zSystem.HasActiveModalDialog)r   ÚgetCondVisibility© r   r	   ú<lambda>z_settled.<locals>.<lambda>,   s-   € •TÔ+Ð,CÑDÔDð OÝÔ/Ð0MÑNÔNÐNð r   i,  FTçš™™™™™¹?)ÚrangeÚwaitForAbort)ÚmonitorÚsecondsÚquietÚ_s       r	   Ú_settledr,   *   s‘   € ðPð P€Eå�3‰ZŒZð ð ˆØˆ5‰7Œ7ð 	Ø×#Ò# GÑ,Ô,ð Ø�u�uØˆu‰wŒwð Ø�t�tðà×!Ò! #Ñ&Ô&ð 	Ø�5�5ð	àˆ4r   c                  ó”   — t          j        d¦  «                             t          ¦  «        st	          j        t          ¦  «         d S d S )Né'  )ÚxbmcguiÚWindowÚgetPropertyÚOPENr   r   ÚGUIDEr#   r   r	   Ú
open_guider4   9   sC   € ÝŒ>˜%Ñ Ô ×,Ò,­TÑ2Ô2ð #ÝÔ�EÑ"Ô"Ð"Ð"Ð"ð#ð #r   c                 óF  — t          j        d¦  «        }t          j        ¦   «          t          j        d¦  «         |                     d¦  «        r,|                      d¦  «        rdS |                     d¦  «        °,t          d¦  «        D ]Z}t          ¦   «         r nIt          d 
                    |dz   ¦  «        t          j        ¦  «         |                      d	¦  «        r dS Œ[t          | ¦  «        sdS t          ¦   «          |                     t          j        ¦  «        s6|                      d
¦  «        rdS |                     t          j        ¦  «        ¯6|                     t          j        ¦  «         t          d¦  «          |¦   «          t#          ¦   «          dS )z[Service, while the guide is due: skin, guide, and everything else once the guide has ended.r.   Tzmilionar.skin.installinggš™™™™™É?Né   zskin setup deferred ({})é   é   ç333333Ó?z"guide finished: the service starts)r/   r0   r   Ú
mark_freshÚcoverr1   r'   r&   r   r
   Úformatr   Ú
LOGWARNINGr,   r4   ÚFINISHEDÚclearPropertyÚaccount_home)r(   Ú
start_restÚhomeÚattempts       r	   Ú
coordinaterD   >   s”  € åŒ>˜%Ñ Ô €DÝ	ÔÑÔÐÝ	„K�ÑÔÐØ
×
Ò
Ð5Ñ
6Ô
6ð Ø×Ò Ñ$Ô$ð 	ØˆFð ×
Ò
Ð5Ñ
6Ô
6ð õ ˜‘8”8ð ð ˆÝ‰>Œ>ð 	ØˆEÝÐ'×.Ò.¨w¸©{Ñ;Ô;½T¼_ÑMÔMÐMØ×Ò Ñ"Ô"ð 	ØˆFˆFð	å�GÑÔð ØˆÝ�L„L€LØ×Ò�uœ~Ñ.Ô.ð Ø×Ò Ñ$Ô$ð 	ØˆFð ×Ò�uœ~Ñ.Ô.ð ð 	×Ò•u”~Ñ&Ô&Ð&ÝÐ	-Ñ.Ô.Ð.Ø€J�L„L€LÝ�N„N€N€N€Nr   c                  óD  — 	 ddl m} m} |                     ¦   «          |                     ¦   «         r|                      ¦   «          dS dS # t          $ rK}t          d                     t          |¦  «        j
        |¦  «        t          j        ¦  «         Y d}~dS d}~ww xY w)zÚSigned in during the guide: its cover hid Kodi's bar of the account (wcs/account/progress.py), and Home still
    fills (titles' data, Pro tebe of the account). The bar shows now and lasts until nothing comes any more.r   )Úprogressr   z(account progress after the guide: {}: {}N)Úwcs.accountrF   r   Ú
invalidateÚ	signed_inÚbegin_signinÚ	Exceptionr
   r<   ÚtypeÚ__name__r   r=   )rF   Úaccount_stateÚexcs      r	   r@   r@   X   sÌ   € ðjØ@Ð@Ð@Ð@Ð@Ð@Ð@Ð@Ø× Ò Ñ"Ô"Ð"Ø×"Ò"Ñ$Ô$ð 	$Ø×!Ò!Ñ#Ô#Ð#Ð#Ð#ð	$ð 	$øåð jð jð jÝÐ7×>Ò>½tÀC¹y¼yÔ?QÐSVÑWÔWÕY]ÔYhÑiÔiÐiÐiÐiÐiÐiÐiÐiøøøøðjøøøs   ‚AA
 Á

BÁA BÂBc                  óÊ  — t          j        ¦   «          t          j        d¦  «         t          ¦   «         sst          j        d¦  «         t	          j        ¦   «                              dt          j        t          ¦  «         
                    d¦  «        t          j        d¦  «         dS t          t          j        ¦   «         ¦  «         ddlm}  |                      ¦   «          dS )	zXThe addon opened while the guide is due: the same setup, then the guide in this process.TFu
   MilionÃ¡Å™ià‹  iˆ  Nr   ©Úwizard)r   r:   r;   r   r/   ÚDialogÚnotificationr   r   r   ÚgetLocalizedStringÚNOTIFICATION_ERRORr,   r   ÚMonitorÚwcs.onboardingrR   r   rQ   s    r	   Ú
from_addonrY   d   sÁ   € å	ÔÑÔÐÝ	„K�ÑÔÐÝ‰>Œ>ð ÝŒ�EÑÔÐÝŒÑÔ×%Ò% lµI´OÅHÑ4MÔ4M×4`Ò4`ÐafÑ4gÔ4gÝ&-Ô&@À$ñ	Hô 	Hð 	HàˆÝ�TŒ\‰^Œ^ÑÔÐØ%Ð%Ð%Ð%Ð%Ð%Ø
‡J‚J�L„L€L€L€Lr   c                 ó  — ddl m} ddlm} t	          j        d¦  «        }|                     |j        ¦  «        r1|                      d¦  «        rdS |                     |j        ¦  «        °1|                     t          ¦  «        s/t          j
        ¦   «         rt          j        ¦   «         |j        k    rdS t          d¦  «         t          j        d¦  «         |                     t          j        ¦  «         t%          ¦   «          t'          d	¦  «        D ]3}|                     t          ¦  «        s|                      d
¦  «        r nŒ4|                     t          ¦  «        r1|                      d¦  «        rdS |                     t          ¦  «        °1|                     t          j        ¦  «        r>|                     t          j        ¦  «         t          d¦  «         t)          ¦   «          dS t          j        d¦  «         dS )aW  Service, while Kodi runs (D32): the guide now if it has become due (a sign-out left this device without a finished
    guide, a sign-in from the menu brought an account whose guide is open). Home stays covered until it ends; the rows
    keep running underneath. Only in our skin: otherwise the next start of the addon sets it up (from_addon).r   )Úui)r   r.   r9   Nzthe guide is due: opening itTéd   r%   zguide finishedF)rG   r[   r   r   r/   r0   r1   r2   r'   r   Úpendingr   r   r   r
   r;   r?   r>   r4   r&   r@   )r(   Ú
account_uir   rB   r+   s        r	   Úwhen_duer_   r   sö  € ð -Ð,Ð,Ð,Ð,Ð,Ø"Ð"Ð"Ð"Ð"Ð"ÝŒ>˜%Ñ Ô €DØ
×
Ò
˜:œ?Ñ
+Ô
+ð Ø×Ò Ñ$Ô$ð 	ØˆFð ×
Ò
˜:œ?Ñ
+Ô
+ð ð ×Ò�ÑÔð ¥U¤]¡_¤_ð ½¼Ñ8IÔ8IÈYÔM^Ò8^Ð8^ØˆÝÐ	'Ñ(Ô(Ð(Ý	„K�ÑÔÐØ×Ò•u”~Ñ&Ô&Ð&Ý�L„L€LÝ�3‰ZŒZð ð ˆØ×Ò�DÑ!Ô!ð 	 W×%9Ò%9¸#Ñ%>Ô%>ð 	ØˆEð	à
×
Ò
�4Ñ
 Ô
 ð Ø×Ò Ñ$Ô$ð 	ØˆFð ×
Ò
�4Ñ
 Ô
 ð ð ×Ò�œÑ'Ô'ð Ø×Ò�5œ>Ñ*Ô*Ð*ÝÐÑÔÐÝ‰ŒˆˆˆåŒ�EÑÔÐÐÐr   )r   )Ú__doc__r   r   r/   rX   r   r   r2   r3   ÚLOGINFOr
   r   r,   r4   rD   r@   rY   r_   r#   r   r	   ú<module>rb      sæ   ððð ð €€€Ø Ð Ð Ð Ø €€€à  Ð  Ð  Ð  Ð  Ð  à"€Ø!€ØF€ð œð :ð :ð :ð :ðð ð ð$ð ð ð ð#ð #ð #ð
ð ð ð4	jð 	jð 	jðð ð ðð ð ð ð r   