Ë
    W¼Sfø$  ã                   óÆ  — d Z ddlZddlZddlZddlZddlmZ i ej                  ej                  “ej                  ej                  “ej                  ej                  “ej                  ej                  “ej                  ej                   “ej"                  ej$                  “ej&                  ej(                  “ej*                  ej,                  “ej.                  ej0                  “ej2                  ej4                  “ej6                  ej8                  “ej:                  ej<                  “ej>                  ej@                  “ejB                  ejD                  “ejF                  ejH                  “ejJ                  ejL                  “Z'ej                  ej                  ej                  ej"                  ej.                  ej                  ej2                  ejB                  ejF                  dœ	Z(ej6                  ej>                  ej                  ejJ                  ej"                  ej*                  ej                  ej2                  ej                  ej&                  ej                  ejB                  ejF                  ej:                  ej                  dœZ)d„ Z*d„ Z+dd„Z,d	„ Z-d
„ Z.dd„Z/d„ Z0d„ Z1d„ Z2d„ Z3 G d„ dejh                  jj                  jl                  «      Z7y)z)Internal utilities common to all modules.é    N)Ú
exceptions)	i�  i‘  i“  i”  i™  iœ  i­  iô  i÷  )é   é   é   é   é   é   é   é   é	   é
   é   é   é   é   é   c                 ó  — | €t        j                  «       S t        | t         j                  «      r0t        j                  | j                  «      }| |urt        d«      ‚| S t        dj                  t        | «      «      «      ‚)z3Returns a reference to an initialized App instance.zKIllegal app argument. App instance not initialized via the firebase module.zTIllegal app argument. Argument must be of type  firebase_admin.App, but given "{0}".)Úfirebase_adminÚget_appÚ
isinstanceÚAppÚnameÚ
ValueErrorÚformatÚtype)ÚappÚinitialized_apps     úTC:\Users\user\Documents\project_loop\venv\Lib\site-packages\firebase_admin/_utils.pyÚ_get_initialized_appr   O   s~   € à
€{Ü×%Ñ%Ó'Ð'ä�#”~×)Ñ)Ô*Ü(×0Ñ0°·±Ó:ˆØ�oÑ%Üð Dó Eð Eàˆ
ä
ð =ß=C¹VÄDÈÃIÓ=NóPð Pó    c                 ó<   — t        | «      } | j                  ||«      S ©N)r   Ú_get_service)r   r   Úinitializers      r   Úget_app_servicer%   `   s   € Ü
˜sÓ
#€CØ×Ñ˜D +Ó.Ð.r    c                 óð   — | j                   €t        | «      S | j                   }|j                  j                  «       }|j                  }t        ||«      \  }}d}|r
 || ||«      }|r|S t        | ||«      S )ag  Constructs a ``FirebaseError`` from the given requests error.

    This can be used to handle errors returned by Google Cloud Platform (GCP) APIs.

    Args:
        error: An error raised by the requests module while making an HTTP call to a GCP API.
        handle_func: A function that can be used to handle platform errors in a custom way. When
            specified, this function will be called with three arguments. It has the same
            signature as ```_handle_func_requests``, but may return ``None``.

    Returns:
        FirebaseError: A ``FirebaseError`` that can be raised to the user code.
    N)ÚresponseÚhandle_requests_errorÚcontentÚdecodeÚstatus_codeÚ_parse_platform_errorÚ_handle_func_requests)ÚerrorÚhandle_funcr'   r)   r+   Ú
error_dictÚmessageÚexcs           r   Ú#handle_platform_error_from_requestsr3   e   s   € ð ‡~�~ÐÜ$ UÓ+Ð+à�~‰~€HØ×Ñ×%Ñ%Ó'€GØ×&Ñ&€KÜ/°¸ÓEÑ€J�Ø
€CÙÙ˜% ¨*Ó5ˆáˆ3ÐLÔ0°¸ÀÓLÐLr    c                 óð   — t        | t        «      s&t        j                  dj	                  | «      | ¬«      S | j                  d«      }| j                  d«      }t        |«      }t        |«      } ||¬«      S )zêConstructs a ``FirebaseError`` from the given operation error.

    Args:
        error: An error returned by a long running operation.

    Returns:
        FirebaseError: A ``FirebaseError`` that can be raised to the user code.
    ú5Unknown error while making a remote service call: {0}©r1   ÚcauseÚcoder1   )r1   )r   Údictr   ÚUnknownErrorr   ÚgetÚ_rpc_code_to_error_codeÚ_error_code_to_exception_type)r.   Úrpc_coder1   Ú
error_codeÚerr_types        r   Úhandle_operation_errorrA   �   sp   € ô �eœTÔ"Ü×&Ñ&ØK×RÑRÐSXÓYØôð 	ð �y‰y˜Ó €HØ�i‰i˜	Ó"€GÜ(¨Ó2€JÜ,¨ZÓ8€HÙ˜GÔ$Ð$r    c                 ó>   — |j                  d«      }t        | ||«      S )a|  Constructs a ``FirebaseError`` from the given GCP error.

    Args:
        error: An error raised by the requests module while making an HTTP call.
        message: A message to be included in the resulting ``FirebaseError``.
        error_dict: Parsed GCP error response.

    Returns:
        FirebaseError: A ``FirebaseError`` that can be raised to the user code or None.
    Ústatus)r;   r(   )r.   r1   r0   r8   s       r   r-   r-   –   s!   € ð �>‰>˜(Ó#€DÜ  ¨°Ó6Ð6r    c                 ó*  — t        | t        j                  j                  «      r&t        j                  dj                  | «      | ¬«      S t        | t        j                  j                  «      r&t        j                  dj                  | «      | ¬«      S | j                  €&t        j                  dj                  | «      | ¬«      S |st        | j                  j                  «      }|st        | «      }t        |«      } ||| | j                  ¬«      S )ao  Constructs a ``FirebaseError`` from the given requests error.

    This method is agnostic of the remote service that produced the error, whether it is a GCP
    service or otherwise. Therefore, this method does not attempt to parse the error response in
    any way.

    Args:
        error: An error raised by the requests module while making an HTTP call.
        message: A message to be included in the resulting ``FirebaseError`` (optional). If not
            specified the string representation of the ``error`` argument is used as the message.
        code: A GCP error code that will be used to determine the resulting error type (optional).
            If not specified the HTTP status code on the error response is used to determine a
            suitable error code.

    Returns:
        FirebaseError: A ``FirebaseError`` that can be raised to the user code.
    z'Timed out while making an API call: {0}r6   z%Failed to establish a connection: {0}r5   )r1   r7   Úhttp_response)r   Úrequestsr   ÚTimeoutÚDeadlineExceededErrorr   ÚConnectionErrorÚUnavailableErrorr'   r:   Ú_http_status_to_error_coder+   Ústrr=   )r.   r1   r8   r@   s       r   r(   r(   ¥   sí   € ô$ �%œ×,Ñ,×4Ñ4Ô5Ü×/Ñ/Ø=×DÑDÀUÓKØôð 	ô �%œ×,Ñ,×<Ñ<Ô=Ü×*Ñ*Ø;×BÑBÀ5ÓIØôð 	ð ‡~�~ÐÜ×&Ñ&ØK×RÑRÐSXÓYØôð 	ñ Ü)¨%¯.©.×*DÑ*DÓEˆÙÜ�e“*ˆä,¨TÓ2€HÙ˜G¨5ÀÇÁÔOÐOr    c                 óJ   — t         j                  | t        j                  «      S )z-Maps an HTTP status to a platform error code.)Ú_HTTP_STATUS_TO_ERROR_CODEr;   r   ÚUNKNOWN)rC   s    r   rK   rK   Í   s   € ä%×)Ñ)¨&´*×2DÑ2DÓEÐEr    c                 óJ   — t         j                  | t        j                  «      S )z*Maps an RPC code to a platform error code.)Ú_RPC_CODE_TO_ERROR_CODEr;   r   rO   )r>   s    r   r<   r<   Ñ   s   € ä"×&Ñ& x´×1CÑ1CÓDÐDr    c                 óJ   — t         j                  | t        j                  «      S )z0Maps a platform error code to an exception type.)Ú_ERROR_CODE_TO_EXCEPTION_TYPEr;   r   r:   )r8   s    r   r=   r=   Õ   s   € ä(×,Ñ,¨T´:×3JÑ3JÓKÐKr    c                 óê   — i }	 t        j                  | «      }t        |t        «      r|}|j                  di «      }|j                  d«      }|sdj                  || «      }||fS # t        $ r Y ŒFw xY w)a(  Parses an HTTP error response from a Google Cloud Platform API and extracts the error code
    and message fields.

    Args:
        content: Decoded content of the response body.
        status_code: HTTP status code.

    Returns:
        tuple: A tuple containing error code and message.
    r.   r1   z4Unexpected HTTP response with status: {0}; body: {1})ÚjsonÚloadsr   r9   r   r;   r   )r)   r+   ÚdataÚparsed_bodyr0   Úmsgs         r   r,   r,   Ú   s   € ð €DðÜ—j‘j Ó)ˆÜ�k¤4Ô(ØˆDð —‘˜' 2Ó&€JØ
�.‰.˜Ó
#€CÙØD×KÑKÈKÐY`ÓaˆØ�sˆ?Ðøô ò Ùðús   „'A& Á&	A2Á1A2c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚEmulatorAdminCredentialsz¾ Credentials for use with the firebase local emulator.

    This is used instead of user-supplied credentials or ADC.  It will silently do nothing when
    asked to refresh credentials.
    c                 óx   — t         j                  j                  j                  j	                  | «       d| _        y )NÚowner)ÚgoogleÚauthÚcredentialsÚCredentialsÚ__init__Útoken)Úselfs    r   rb   z!EmulatorAdminCredentials.__init__ý   s'   € Ü�‰×Ñ×+Ñ+×4Ñ4°TÔ:Øˆ�
r    c                  ó   — y r"   © )rd   Úrequests     r   Úrefreshz EmulatorAdminCredentials.refresh  s   € Ør    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rb   rh   rf   r    r   r[   r[   ÷   s   „ ñò
ór    r[   r"   )NN)8rl   rU   Úgoogle.authr^   rF   r   r   ÚINVALID_ARGUMENTÚInvalidArgumentErrorÚFAILED_PRECONDITIONÚFailedPreconditionErrorÚOUT_OF_RANGEÚOutOfRangeErrorÚUNAUTHENTICATEDÚUnauthenticatedErrorÚPERMISSION_DENIEDÚPermissionDeniedErrorÚ	NOT_FOUNDÚNotFoundErrorÚABORTEDÚAbortedErrorÚALREADY_EXISTSÚAlreadyExistsErrorÚCONFLICTÚConflictErrorÚRESOURCE_EXHAUSTEDÚResourceExhaustedErrorÚ	CANCELLEDÚCancelledErrorÚ	DATA_LOSSÚDataLossErrorrO   r:   ÚINTERNALÚInternalErrorÚUNAVAILABLErJ   ÚDEADLINE_EXCEEDEDrH   rS   rN   rQ   r   r%   r3   rA   r-   r(   rK   r<   r=   r,   r_   r`   ra   r[   rf   r    r   ú<module>rŠ      sÞ  ðñ 0ã ã Û ã Ý %ð!Ø×Ñ ×!@Ñ!@ð!à×"Ñ" J×$FÑ$Fð!ð ×Ñ˜Z×7Ñ7ð!ð ×Ñ 
× ?Ñ ?ð	!ð
 × Ñ  *×"BÑ"Bð!ð ×Ñ˜*×2Ñ2ð!ð ×Ñ˜
×/Ñ/ð!ð ×Ñ˜z×<Ñ<ð!ð ×Ñ˜×1Ñ1ð!ð ×!Ñ! :×#DÑ#Dð!ð ×Ñ˜*×3Ñ3ð!ð ×Ñ˜*×2Ñ2ð!ð ×Ñ˜
×/Ñ/ð!ð ×Ñ˜×1Ñ1ð!ð ×Ñ˜J×7Ñ7ð!ð  × Ñ  *×"BÑ"Bð!!Ð ð* 
×	$Ñ	$Ø	×	#Ñ	#Ø	×	%Ñ	%Ø	×	Ñ	Ø	×	Ñ	Ø	×	'Ñ	'Ø	×	&Ñ	&Ø	×	Ñ	Ø	×	Ñ	ñ
Ð ð ×ÑØ×ÑØ×"Ñ"Ø×#Ñ#Ø×ÑØ× Ñ Ø×#Ñ#Ø×$Ñ$Ø×%Ñ%Ø×ÑØ×ÑØ×ÑØ×ÑØ×ÑØ×"Ñ"ñÐ ò&Pò"/ó
Mò8%ò*7ó%PòPFòEòLò
ô:˜vŸ{™{×6Ñ6×BÑBõ r    