
    H.d                         d dl 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mZmZ e j                            e          Z eed          Zd	Zd
Zd Zd ZdS )    Njoin)native_path_to_unix)COMPATIBLE_SHELLS)context)on_macon_win)
initializeinitialize_devmake_initialize_planshell_templateszF
if [ -f "{mamba_source_path}" ]; then
    . "{mamba_source_path}"
fi
zG
if test -f "{mamba_source_path}"
    source "{mamba_source_path}"
end
c           	         d }t          | d          5 }|                                }d d d            n# 1 swxY w Y   |                     d          r(t          }t	          t          |dddd                    }n&t          }t	          t          |ddd	                    }g }t          |          D ]r\  }}	|	                    d
          rC |||t	          |                    r)|	                    |
                    |                     |	                    |	           st          | d          5 }
|
                    d                    |                     d d d            n# 1 swxY w Y   t          d|             dS )Nc                     |}|dk    rd| |         v rn|dz  }|dk    | ||         }|d                     |          v S )Nr   z>>> conda initialize >>>    r   )linesstart_iprefixixs        6lib/python3.11/site-packages/mamba/mamba_shell_init.pycheck_init_blockz-add_mamba_to_rcfile.<locals>.check_init_block   s[    1ff)U1X55FA 1ff !G)##    rz.fishetcfishzconf.dz
mamba.fishz	profile.dzmamba.shz# <<< conda initialize <<<)mamba_source_pathwr   zAdded mamba to T)open	readlinesendswithMAMBA_SNIPPET_FISHr   r   MAMBA_SNIPPET_SH	enumerate
startswithappendformatwriteprint)fileconda_prefixr   ficurrent_contentsnippetr   new_contentr   linefos              r   add_mamba_to_rcfiler2      s   $ $ $ 
dC )B,,..) ) ) ) ) ) ) ) ) ) ) ) ) ) ) }}W 	
$/ufhEE
 
 #/uk:>>
 
 K_-- ! !4??788 	X4G4U4UVV X""7>>DU>#V#VWWW4    	dC 'B
%%&&&' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 

"D
"
"###4s   5997)E,,E03E0c                    | j         rt          }nt          | j                  }|st          rd}t
          rd}nd}| j        r4t          |          dk    s
J d            |d         }t          |          S t          | d          r(| j
        }| j        r| j
        r| j        sd}| j        rd	}n| j
        o| j         }t          o| j        }t          t           j        ||| j        || j                  }d	}|s| j        s{t'          t           j        ||| j        || j                  }|D ]P}|                    d
          dv r7|                    d          } | d         }	| d         }
t+          |	|
           d}Q|rt-          d           |S )N)zcmd.exe
powershell)bashzsh)r5   r   z3--dev can only handle one shell at a time right nowr   no_userTFfunction)init_sh_userinit_sh_systeminit_fish_userkwargstarget_pathr+   zK
==> For changes to take effect, close and re-open your current shell. <==
)allr   tupleshellsr	   r   devlenr   hasattruserinstallsystemr7   anaconda_promptr
   r   r+   reverser   getr2   r)   )argsselected_shellsshellfor_userrG   	exit_codechangedplanelr=   r+   s              r   
shell_initrR   >   s   x -+,, ( 	87O 	(-OO'Ox 
  A%%%@ &%%"e$$$ 4## 	5
 yHL  TY  4;  | ! y4_H 9T%9 KL
 
	 G T\ # KL
 
  
	 
	Bvvj!! &  
 vvh''"=1#N3#K>>> 
4	
 	
 	
 r   )osos.pathr   conda.activater   conda.base.constantsr   conda.base.contextr   conda.common.compatr   r	   conda.core.initializer
   r   r   pathdirname__file__HERESHELL_TEMPLATESr#   r"   r2   rR    r   r   <module>r`      s    				       . . . . . . 2 2 2 2 2 2 & & & & & & . . . . . . . . R R R R R R R R R R	wx  $t.// 
 " " "JG G G G Gr   