\h7ddlmZddlZddlmZddlmZddlmZgdZ dZ ejd Z ejd Z ejd ejejzZd Zd Zdj'eeZeedZgdZdZddj1eDcgc]}|ez c}zdzZdezdzZdezdzezdzZdZejdZejdezdzZejdezdzZejdezdzZ ejdeddzdzZ!ejdezd zZ"d!ededed"Z#eje#ejejzZ$e%d#Z&e%d$Z'e&e'zd%hzZ(e(d&d'hzZ)e)d(hzxZ*Z+Gd)d*ed*e Z,d+Z-d3d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4ycc}w)4)absolute_importN) namedtuple)LocationParseError)sixschemeauthhostportpathqueryfragment)httphttpsNz%[a-fA-F0-9]{2}z^(?:[a-zA-Z][a-zA-Z0-9+-]*:|/)zS^(?:([a-zA-Z][a-zA-Z0-9+.-]*):)?(?://([^\\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$z(?:[0-9]{1,3}\.){3}[0-9]{1,3}z[0-9A-Fa-f]{1,4}z(?:{hex}:{hex}|{ipv4}))hexipv4)rls32) z(?:%(hex)s:){6}%(ls32)sz::(?:%(hex)s:){5}%(ls32)sz%(?:%(hex)s)?::(?:%(hex)s:){4}%(ls32)sz2(?:(?:%(hex)s:)?%(hex)s)?::(?:%(hex)s:){3}%(ls32)sz6(?:(?:%(hex)s:){0,2}%(hex)s)?::(?:%(hex)s:){2}%(ls32)sz/(?:(?:%(hex)s:){0,3}%(hex)s)?::%(hex)s:%(ls32)sz'(?:(?:%(hex)s:){0,4}%(hex)s)?::%(ls32)sz&(?:(?:%(hex)s:){0,5}%(hex)s)?::%(hex)sz(?:(?:%(hex)s:){0,6}%(hex)s)?::zCABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~z(?:|)z (?:%25|%)(?:[z]|%[a-fA-F0-9]{2})+z\[z)?\]z!(?:[^\[\]%:/?#]|%[a-fA-F0-9]{2})*z!^(/[^?#]*)(?:\?([^#]*))?(?:#.*)?$^$(z)\]$z^(z)(?::0*?(|0|[1-9][0-9]{0,4}))?$zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-~z !$&'()*+,;=:@/?c|eZdZdZdZ d fd ZedZedZedZ edZ dZ xZ S) Urlz Data structure for representing an HTTP URL. Used as a return value for :func:`parse_url`. Both the scheme and host are normalized as they are both case-insensitive according to RFC 3986. c |r|jdsd|z}||j}tt|||||||||S)Nr) startswithlowersuperr __new__) clsr r r r r rr __class__s _/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/url.pyr&z Url.__new__[sR ,:D  \\^FS#& tT4  c|jS)z@For backwards-compatibility with urlparse. We're nice like that.)r selfs r)hostnamez Url.hostnamemsyyr*cb|jxsd}|j|d|jzz }|S)z)Absolute path including the query string.rr)r r)r-uris r) request_urizUrl.request_urirs4ii3 :: ! 3# #C r*ch|jrd|j|jfzS|jS)z(Network location including host and portz%s:%d)r r r,s r)netlocz Url.netloc|s- 99dii33 3yyr*c|\}}}}}}}d}|||dzz }|||dzz }|||z }||dt|zz }|||z }||d|zz }||d|zz }|S)a Convert self into a url This function should more or less round-trip with :func:`.parse_url`. The returned url may not be exactly the same as the url inputted to :func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls with a blank port will have : removed). Example: :: >>> U = parse_url('http://google.com/mail/') >>> U.url 'http://google.com/mail/' >>> Url('http', 'username:password', 'host.com', 80, ... '/path', 'query', 'fragment').url 'http://username:password@host.com:80/path?query#fragment' z://rrr#)str) r-r r r r r rrurls r)r8zUrl.urls&;?7dD$x   6F? "C   4$; C   4KC   4#d)# #C   4KC   4%< C   4(? "C r*c|jSN)r8r,s r)__str__z Url.__str__s xxr*)NNNNNNN) __name__ __module__ __qualname____doc__ __slots__r&propertyr.r1r3r8r; __classcell__)r(s@r)r r Rs I     $ %%Nr*r cd}d}|D]%}|j|}|dkr|||ks"|}|}'||dkr|ddfS|d|||dzd|fS)a .. deprecated:: 1.25 Given a string and an iterable of delimiters, split on the first found delimiter. Return two split parts and the matched delimiter. If not found, then the first part is the full input string. Example:: >>> split_first('foo/bar?baz', '?/=') ('foo', 'bar?baz', '/') >>> split_first('foo/bar?baz', '123') ('foo/bar?baz', '', None) Scales linearly with number of delims. Not ideal for large number of delims. Nrr5)find)sdelimsmin_idx min_delimdidxs r) split_firstrLs$GI ffQi 7  ?cGmGI'A+"d{ Xg;'A+-() 33r*c"||Stj|}tjd|\}}|j dd}||j dk(}t }tdt|D]}|||dz}t|} |r|dk(s| dkr|j|vr||z }:|jdt| d dj jd jz|j|S) zfPercent-encodes a URI component without reapplying onto an already percent-encoded component. Nc@|jdjS)Nr)groupupper)matchs r)z'_encode_invalid_chars..sekk!n**,r*utf-8 surrogatepass%rrDr)r ensure_text PERCENT_REsubnencodecount bytearrayrangelenorddecodeextendrzfillrP) component allowed_charsencodingpercent_encodings uri_bytesis_percent_encodedencoded_componentibytebyte_ords r)_encode_invalid_charsrms *I $.??,i$ I   /:I*iood.CC!  1c)n % WQU#t9 44< sNt{{} =  %    Xqr):)A)A)C)I)I!)L)R)R)T!UV W  # #H --r*cP|jd}g}|D]2}|dk(r |dk7r|j| |s#|j4|jdr|r|dr|j dd|j dr|jddj |S)Nr.z..rr5)z/.z/..)splitappendpopr#insertendswithjoin)r segmentsoutputsegments r)_remove_path_dot_segmentsryszz#H F  c>  _ MM' " JJL  sVvay a }}]# b 88F r*c |r>t|tjrtj|}|tvrt j |}|rtj|}|ri|jd\}}|||}|jdr |dk7r|dd}n|dd}dt|tz}|d|j|z||dzS|jStj |sJtjdj|j!dDcgc] }t#|c}S|Scc}w)NrDz%25%.ro) isinstancer binary_type ensure_strNORMALIZABLE_SCHEMES IPV6_ADDRZ_RErQ ZONE_ID_REsearchspanr#rmUNRESERVED_CHARSr$IPV4_RErurp _idna_encode)r r is_ipv6rQstartendzone_idlabels r)_normalize_hostrs+ dCOO ,>>$'D ) )#))$/G#))$/!&AJE3"5oG))%0W5E")!"+")!"+!$9'CS$TTG<--/'9DJFF::<']]4(~~II 3Pu|E2PQ KQs%E c|rz_idna_encode..2s0aCFcM0sr)idnaz-Unable to parse URL without the 'idna' moduleT)strict std3_rulesz#Name '%s' is not a valid IDNA labelascii) any pip._vendorr ImportErrorr raise_fromrrZr$ IDNAError)namers r)rr1s 0400  (  ;;tzz|DT;J J ::<  w ''  NN"#RS  ~~  NN"#ID#PQSW  s"A!B (B B  1C?Cctj|j\}}t|t}t|t }||d|zz }|S)zHPercent-encodes a request target so that there are no invalid charactersr) TARGET_RErQgroupsrm PATH_CHARS QUERY_CHARS)targetr rs r)_encode_targetrCsN//&)002KD% "4 4F !% 5E #+ Mr*c <|s tS|}tj|sd|z} tj |j \}}}}}|duxs|j tv}|r|j }|r]|jd\}} } |xsd}tj | j \} } |r|rt|t}| dk(r d} nd\}} } | -t| } d| cxkrdkst|t|t| |} |r|rt|}t|t }|r|rt|t"}|r|rt|t$}|s ||d}nd}t/|t*j0rt*j2nt*j4fd} t| || || | | | || || | S#t&t(f$r"t+j,t|dcYSwxYw) a Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is performed to parse incomplete urls. Fields not provided will be None. This parser is RFC 3986 and RFC 6874 compliant. The parser logic and helper functions are based heavily on work done in the ``rfc3986`` module. :param str url: URL to parse into a :class:`.Url` namedtuple. Partly backwards-compatible with :mod:`urlparse`. Example:: >>> parse_url('http://google.com/mail/') Url(scheme='http', host='google.com', port=None, path='/mail/', ...) >>> parse_url('google.com:80') Url(scheme=None, host='google.com', port=80, path=None, ...) >>> parse_url('/foo?bar') Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...) z//Nrr5)NNNric||S|Sr:r!)r ensure_funcs r) ensure_typezparse_url..ensure_typesIq1;q>1r*r)r SCHEME_RErURI_RErQrr$r rpartition _HOST_PORT_RErmUSERINFO_CHARSintrrryrrFRAGMENT_CHARS ValueErrorAttributeErrorrrr~ text_typerWr)r8 source_urlr authorityr rr normalize_urir _ host_portr r rrs @r) parse_urlrMs, u J   C Sj"D39<<3D3K3K3M0 4$P&,,.>@JD$ ,T>Brz/ D$  t9D&&(--'(--tV, T,T2D(z:D U)%=E X,X~FH    4DD#s}}%oo nn 2 6"       % X& /  'D~~0G**.HHcft|}|jxsd|j|jfS)z4 Deprecated. Use :func:`parse_url` instead. r)rr r.r )r8ps r)get_hostrs+ #A 88 vqzz166 11r*)rS)5 __future__rre collectionsr exceptionsrpackagesr url_attrsrcompilerXrUNICODEDOTALLrIPV4_PATHEX_PATformatLS32_PAT_subs _variationsUNRESERVED_PATruIPV6_PAT ZONE_ID_PATIPV6_ADDRZ_PAT REG_NAME_PATrrIPV6_RErBRACELESS_IPV6_ADDRZ_REr_HOST_PORT_PATrsetrSUB_DELIM_CHARSrrrrr rLrmryrrrrr)rs0r)rsY& "+ K /RZZ* + BJJ8 9  JJ   ,  # * *wX * F* *X 388 <1QY<= = C.1FF !F*[87B3 BJJ; < "**S8^c) * "**S8^c) * 3/#56 $"**S>!B+?%?#%EF RZZk)G3 4    >2:: +AB Hm$!O3se; sCj ( )SE11 nZ*UI &Zz 4F.D<>($^B2q =s# G*