
    IiU                        S SK r S SKrS SKJrJrJrJrJrJrJ	r	J
r
Jr  S SKrSSKJr  SSSSSSSSSS.	S\S\\   S	SS
\\\\\4   /\4      S\\\/\4      S\\\/\4      S\\\/\4      S\S\\\\
\\4      /\4      S\S\4S jjrSSSSSSSSSS.	S\S\\   S	SS
\\\\\4   /\4      S\\\/\4      S\\\/\4      S\\\/\4      S\S\\\\
\\4      /\4      S\4S jjrS rS\\\
\\4      /\4   4S jrSSSSSSSSSSSSS.S\S\S\S\S\S\S	SS\\\\4      S \\
\\4      S!\\\/\4      S"\S#\S$\S\4S% jjrSSSSSSSSSSSSS.S\S\S\S\S\S	SS\\\\4      S \\
\\4      S!\\\/\4      S"\S#\S$\S\4S& jjrS'\\	\      S(\S)\4S* jrS+ rS, rS- rS. rS/ rS0 rSqS1 r S2 r!g)3    N)	AnyCallableIOIterableMappingOptionalSetTupleUnion   )ParserT	encodingclsobject_hookparse_float	parse_intparse_constantstrictobject_pairs_hookallow_duplicate_keysfpr   r   r   r   r   r   r   r   r   returnc       	         F    U R                  5       n
[        U
UUUUUUUUU	S9
$ )a  Deserialize ``fp`` (a ``.read()``-supporting file-like object
containing a JSON document) to a Python object.

Supports almost the same arguments as ``json.load()`` except that:
    - the `cls` keyword is ignored.
    - an extra `allow_duplicate_keys` parameter supports checking for
      duplicate keys in a object; by default, this is True for
      compatibility with ``json.load()``, but if set to False and
      the object contains duplicate keys, a ValueError will be raised.
r   )readloads)r   r   r   r   r   r   r   r   r   r   ss              //venv/lib/python3.13/site-packages/json5/lib.pyloadr   !   s:    4 		A	%+1     r   c       	           ^^ Ub   S5       e[        U [        5      (       a  U=(       d    SnU R                  U5      n U (       d  [        S5      e[	        U S5      n
U
R                  SU0S9u  pnU(       a  [        U5      eS nU(       a  UnOT(       a  U4S jnO[        nU	(       d  UmU4S	 jnU=(       d    [        nU=(       d    [        nU=(       d    Un[        XXEU5      $ )
a  Deserialize ``s`` (a string containing a JSON5 document) to a Python
object.

Supports the same arguments as ``json.load()`` except that:
    - the `cls` keyword is ignored.
    - an extra `allow_duplicate_keys` parameter supports checking for
      duplicate keys in a object; by default, this is True for
      compatibility with ``json.load()``, but if set to False and
      the object contains duplicate keys, a ValueError will be raised.
z!Custom decoders are not supportedzutf-8z!Empty strings are not legal JSON5z<string>_strict)global_varsc                 X    [        U R                  SS5      R                  SS5      5      $ )NInfinityinfNaNnan)floatreplace)r   s    r   _fp_constant_parser"loads.<locals>._fp_constant_parserq   s%    QYYz5199%GHHr    c                 &   > T" [        U 5      5      $ N)dict)pairsr   s    r   dictifyloads.<locals>.dictifyx   s    tE{++r    c                    > [        U T5      $ r.   )_reject_duplicate_keys)r0   _orig_dictifys    r   r1   r2      s    )%??r    )

isinstancebytesdecode
ValueErrorr   parser/   r)   int	_walk_ast)r   r   r   r   r   r   r   r   r   r   parserasterr_r+   r1   r5   s      `            @r   r   r   J   s    4 ;;;;;!U&wHHX<==Az"F,,Iv+>,?KCa
oI #		, 	@ &K SI#:':NS;>JJr    c                     [        5       nU  H*  u  p4X2;   a  [        SU S35      eUR                  U5        M,     U" U 5      $ )NzDuplicate key "z" found in object)setr9   add)r0   r1   keyskeyr@   s        r   r4   r4      sF    5D;se3DEFF  5>r    r1   c           
         U S:X  a  g U S:X  a  gU S:X  a  gU u  pVUS:X  ai  UR                  S5      (       d  UR                  S5      (       a  U" US	S
9$ SU;   d  SU;   d  SU;   a  U" U5      $ SU;   d  SU;   a  U" U5      $ U" U5      $ US:X  a  U$ US:X  a4  / nU H$  u  p[        XX#U5      n
UR                  X45        M&     U" U5      $ US:X  a  U V s/ s H  n [        XX#U5      PM     sn $ [        SU -   5      es  sn f )NNoneTrueTFalseFnumber0x0X   )base.eEr%   r'   stringobjectarrayzunknown el: )
startswithr<   appendr9   )elr1   r   r   r   tyvr0   rE   val_exprvals              r   r<   r<      s3    
V|	V|	W}EB	X~<<d!3!3QR((!8sax3!8q>!?eqj!!$$|	X~	X~MC;>C LL#$	 
 u~	W} 
 b;>J
 	
 ^b(
))	
s   C=F)skipkeysensure_asciicheck_circular	allow_nanr   indent
separatorsdefault	sort_keys
quote_keystrailing_commasr   objr\   r]   r^   r_   r`   ra   rb   rc   rd   re   c                N    AUR                  [        U UUUUUUUU	U
UUUS95        g)a  Serialize ``obj`` to a JSON5-formatted stream to ``fp``,
a ``.write()``-supporting file-like object.

Supports the same arguments as ``json.dump()``, except that:

- The ``cls`` keyword is not supported.
- The ``encoding`` keyword is ignored; Unicode strings are always
  written.
- By default, object keys that are legal identifiers are not quoted;
  if you pass ``quote_keys=True``, they will be.
- By default, if lists and objects span multiple lines of output (i.e.,
  when ``indent`` >=0), the last item will have a trailing comma
  after it. If you pass ``trailing_commas=False``, it will not.
- If you use a number, a boolean, or ``None`` as a key value in a dict,
  it will be converted to the corresponding JSON string value, e.g.
  "1", "true", or "null". By default, ``dump()`` will match the `json`
  modules behavior and produce malformed JSON if you mix keys of
  different types that have the same converted value; e.g.,
  ``{1: "foo", "1": "bar"}`` produces '{"1": "foo", "1": "bar"}', an
  object with duplicated keys. If you pass
  ``allow_duplicate_keys=False``, an exception will be raised instead.
- If `quote_keys` is true, then keys of objects will be enclosed in
  quotes, as in regular JSON. Otherwise, keys will not be enclosed in
  quotes unless they contain whitespace.
- If `trailing_commas` is false, then commas will not be inserted after
  the final elements of objects and arrays, as in regular JSON.
  Otherwise, such commas will be inserted.
- If `allow_duplicate_keys` is false, then only the last entry with a
  given key will be written. Otherwise, all entries with the same key
  will be written.

Calling ``dump(obj, fp, quote_keys=True, trailing_commas=False,                    allow_duplicate_keys=True)``
should produce exactly the same output as ``json.dump(obj, fp).``
)rf   r\   r]   r^   r_   r   r`   ra   rb   rc   rd   re   r   N)writedumps)rf   r   r\   r]   r^   r_   r   r`   ra   rb   rc   rd   re   r   kwargss                  r   dumprk      sC    l 	HH%)!!+!5	
r    c                    UR                  SS5      b   S5       eAUc  Uc  SnOSnU=(       d    [        nU(       a  [        5       nOSnSnSn[        U UUUUUUUU	U
UUUUU5      u  nnU$ )a  Serialize ``obj`` to a JSON5-formatted string.

Supports the same arguments as ``json.dumps()``, except that:

- The ``cls`` keyword is not supported.
- The ``encoding`` keyword is ignored; Unicode strings are always
  written.
- By default, object keys that are legal identifiers are not quoted;
  if you pass ``quote_keys=True``, they will be.
- By default, if lists and objects span multiple lines of output (i.e.,
  when ``indent`` >=0), the last item will have a trailing comma
  after it. If you pass ``trailing_commas=False``, it will not.
- If you use a number, a boolean, or ``None`` as a key value in a dict,
  it will be converted to the corresponding JSON string value, e.g.
  "1", "true", or "null". By default, ``dump()`` will match the `json`
  modules behavior and produce malformed JSON if you mix keys of
  different types that have the same converted value; e.g.,
  ``{1: "foo", "1": "bar"}`` produces '{"1": "foo", "1": "bar"}', an
  object with duplicated keys. If you pass
  ``allow_duplicate_keys=False``, an exception will be raised instead.
- If `quote_keys` is true, then keys of objects will be enclosed
  in quotes, as in regular JSON. Otheriwse, keys will not be enclosed
  in quotes unless they contain whitespace.
- If `trailing_commas` is false, then commas will not be inserted after
  the final elements of objects and arrays, as in regular JSON.
  Otherwise, such commas will be inserted.
- If `allow_duplicate_keys` is false, then only the last entry with a
  given key will be written. Otherwise, all entries with the same key
  will be written.

Calling ``dumps(obj, quote_keys=True, trailing_commas=False,                     allow_duplicate_keys=True)``
should produce exactly the same output as ``json.dumps(obj).``
r   Nz!Custom encoders are not supported)z, : ),rm   r   F)get_raise_type_errorrB   _dumps)rf   r\   r]   r^   r_   r   r`   ra   rb   rc   rd   re   r   rj   seenlevelis_keyr@   rY   s                      r   ri   ri     s    h ::eT"*O,OO*>%J$J**G#&5EFDAq" Hr    rr   rs   rt   c                    U SL a  SnGOGU SL a  SnGO>U c  SnGO7U [        S5      :X  a  U(       a  SnGO[        5       eU [        S5      :X  a  U(       a  S	nO[        5       e[        U [         5      (       a/  [        R                  " U 5      (       a  U(       a  S
nO[        5       e[        U [
        5      (       a?  U(       a+  [        U 5      (       a  U	(       d  [        U 5      (       d  SU 4$ S[        X5      4$ [        U [        5      (       a  [        R                  U 5      nO-[        U [         5      (       a  [         R                  U 5      nOS nU(       a*  Ub  SSU S34$ U(       a  g[        S[        U 5       35      eUb  SU4$ Ub`  SnU
(       a  Sn[        U[        5      (       a+  US:  a  SSU-  U-  -   nUSSU-  US-
  -  -   -  nO!SnUS-  nOSX]-  -   nUSX]S-
  -  -   -  nOSnSnUu  nnUU-  nUb-  [        U 5      nUU;   a  [        S5      eUR                  U5        [        U S5      (       a1  [        U S5      (       a   [!        U UUUUUUUUU	U
UUUS-   UUUU5      nOc[        U S5      (       a0  [        U S5      (       a  [#        U UUUUUUUUU	U
UUUS-   UUU5      nO"[%        U" U 5      UUUUUUUUU	U
UUUU5      S   nUb  UR'                  W5        SU4$ )NTtrueFfalsenullr&   r%   z-infz	-Infinityr'   ")FNzinvalid key  rn   r   
 r   zCircular reference detected.rD   __getitem____iter__)r)   r9   r6   mathisnanstr	_is_ident_is_reserved_word	_dump_strr;   __repr__	TypeErrorrepridrC   hasattr
_dump_dict_dump_arrayrq   remove)rf   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   r   rr   rs   rt   r   end_str
indent_stritem_sepkv_sepis                        r   rq   rq   `  s8   $ d{			e	A,	f	A,	C		DJJsOOA,	C		#%c**9Ys111	C		 LL	C		NN3=1QCq>!,tCyk233}QwGfc""z!C&L5$88
4#,%!)"<<<!
4.Jtf	222G
!Hf
HsG9;<<
 sF] ; ; AI%
( 
m	$	$j)A)A AI#
( CL 
  !$ A!8Or    c                    U (       d  gU(       a  [        U R                  5       5      nOU R                  5       nSU-   nSn[        5       nU H  n[        UUUUUUUUUU	U
UUUSS9u  nnU(       a	  U(       d  M-  U(       d.  UU;   a  [	        S[        U5       35      eUR                  U5        U(       a  UU-  nUUU-   [        U U   UUUUUUUUU	U
UUUSS9S   -   -  nUS-  nM     UUS	-   -  nU$ )
Nz{}{r   T)rt   zduplicate key Fr   })sortedrD   rB   rq   r9   r   rC   )rf   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   r   rr   rs   r   r   r   r   rD   r   num_items_addednew_keysrE   	valid_keykey_strs                            r   r   r     sG   ( chhj!xxzjAOuH# 
	7$ I#(" >$s)!=>>LL!MA	C$  !	
* 	1g j 3AHr    c                     U (       d  gSU-   UR                  U  Vs/ s H  n[        UUUUUUUUUU	U
UUUS5      S   PM!     sn5      -   U-   S-   $ s  snf )Nz[][Fr   ])joinrq   )rf   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   r   rr   rs   r   r   r   rW   s                     r   r   r   _  s    & 
	
--& %$ B#  "#(  !" %
	
0 1	2 3	s   &A
c                    S/nU  GH  nUS:X  a  UR                  S5        M  US:X  a  UR                  S5        M6  US:X  a  UR                  S5        MO  US:X  a  UR                  S5        Mh  US	:X  a  UR                  S
5        M  US:X  a  UR                  S5        M  US:X  a  UR                  S5        M  US:X  a  UR                  S5        M  US:X  a  UR                  S5        M  US:X  a  UR                  S5        M  US:X  a  UR                  S5        GM  U(       d  UR                  U5        GM3  [        U5      nSUs=::  a  S:  a  O  OUR                  U5        GMb  US:  a  UR                  SUS 35        GM  US-
  nSUS-	  -   nSUS-  -   nUR                  SUS SUS 35        GM     S R                  U5      S-   $ )!Nry   \z\\z\"u    z\u2028u    z\u2029r{   z\nz\rz\bz\f	z\tz\v z\0       i   z\u04xi   
   i   i  rz   )rV   ordr   )rf   r]   retchor[   highlows           r   r   r     s   %C:JJv3YJJu8^JJy!8^JJy!4ZJJu4ZJJu4ZJJu4ZJJu4ZJJu4ZJJu4ZJJuJJrNBAQ}}

2U

S3=)'k+e,

Sc
#c#Y78G H 773<#r    c                     U (       a  [        U S   5      (       d
  U S   S;  a  gU SS   H  n[        U5      (       a  M  US;  d  M    g   g)Nr   )$r@   Fr   T)_is_id_start_is_id_continue)kr   s     r   r   r     sK    L1&&1Q4z+Aer""r';  r    c                 4    [         R                  " U 5      S;   $ )N)LuLlLiLtLmLoNlunicodedatacategoryr   s    r   r   r     s    # (  r    c                 4    [         R                  " U 5      S;   $ )N)r   r   r   r   r   r   r   NdMnMcPcr   r   s    r   r   r     s    # (  r    c                     [         c-  [        R                  " SSR                  / SQ5      -   S-   5      q [         R	                  U 5      S L$ )N(|)$breakcasecatchclassconstcontinuedebuggerrb   deletedoelseenumexportextendsrw   finallyforfunctionifimportin
instanceofnewrx   r   superswitchthisthrowrv   trytypeofvarvoidwhilewithz)$)_reserved_word_rerecompiler   match)r   s    r   r   r     sW      JJhh%'(R S)+
X ""1%T11r    c                 0    [        [        U 5       S35      e)Nz is not JSON5 serializable)r   r   )rf   s    r   rp   rp     s    
tCyk!;<
==r    )"r   r   typingr   r   r   r   r   r   r	   r
   r   r   r=   r   r   boolr   r   r4   r<   r;   rk   ri   rq   r   r   r   r   r   r   r   r   rp    r    r   <module>r      s    	
 
 
   #@D260459 	!%&
& sm& 
	&
 (GCH$5#6#;<=& (C5#:./& #,-& XseSj12& &  (5c?+,c12& & 	&X #@D260459 	!%=K
=K sm=K 
	=K
 (GCH$5#6#;<==K (C5#:./=K #,-=K XseSj12=K =K  (5c?+,c12=K =K@%*xc3h01367%*X (,,0.2 !%G	G
G 	G
 G G G 
G U38_%G sCx)G hucz*+G G G G GZ (,,0.2 !%X	X X 	X
 X X 
X U38_%X sCx)X hucz*+X X X X Xvc 3s8
c c cLVr0f&R	   12h>r    