Re2TddlmZddlZddlZddlZddlmZmZddlm Z dZ dZ ej dZ Gd d eZGd d eZGd deZGddeZdZdZdZdZdZdZd%dZdZdZdZdZd%dZdZdZ d Z!d&d"Z"d'd#Z#d(d$Z$dS)))idnadataN)UnionOptional)intranges_contain sxn--u [.。.。]ceZdZdZdS) IDNAErrorz7 Base exception for all IDNA-encoding related problems N__name__ __module__ __qualname____doc__/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/idna/core.pyr r sAADrr ceZdZdZdS) IDNABidiErrorz= Exception when bidirectional requirements are not satisfied Nr rrrrrsGGDrrceZdZdZdS)InvalidCodepointz> Exception when a disallowed or unallocated codepoint is used Nr rrrrrsHHDrrceZdZdZdS)InvalidCodepointContextzE Exception when the codepoint is not valid in the context it is used Nr rrrrrsOODrrctjt|}|dkr0tjt|st d|S)Nrz Unknown character in unicodedata) unicodedata combiningchrname ValueError)cpvs r_combining_classr! sOc"gg&&AAvvB(( A?@@ @ Hrc\tt|tj|S)N)rordrscripts)rscripts r _is_scriptr&(s SWWh&6v&> ? ??rc,|dS)Npunycode)encodess r _punycoder,,s 88J  rc,d|S)NzU+{:04X})formatr*s r_unotr/0s   Q  rc0t|dkrdSdS)N?FTlenlabels rvalid_label_lengthr65s 5zzBu 4rc8t||rdndkrdSdS)NFTr2)r5 trailing_dots rvalid_string_lengthr;<s& 5zzL1SSc22u 4rFc(d}t|dD]U\}}tj|}|dkr0tdt |||dvrd}V|s|sdStj|d}|dvrd}n8|d krd}n/td t |d}d}t|dD]\}}tj|}|rT|d vr"td ||d vrd}n|dkrd}|dvr|s|}Y||krtdo|dvr"td||dvrd}|dkrd}|stddS)NFrz1Unknown directionality in label {} at position {})RALANTr)r>r?Lz=First codepoint in label {} must be directionality L, R or AL) r>r?r@ENESCSETONBNNSMzGInvalid direction for codepoint at position {} in a right-to-left label)r>r?rBr@rH)r@rBz2Can not mix numeral types in a right-to-left label)rArBrCrDrErFrGrHzGInvalid direction for codepoint at position {} in a left-to-right label)rArBz0Label ends with illegal codepoint directionality) enumerater bidirectionalrr.repr) r5 check_ltr bidi_labelidxr directionrtl valid_ending number_types r check_bidirSCsJua(( b-b11 ?? S Z Z[_`e[f[fhk l lmm m ) ) )J it)%(33IK c  [bbcghmcncnoopppLKua((%% b-b11  % \\\#$m$t$tux$y$yzzz333# e##$ L(("b"+KK"i//+,`aaa PPP#$m$t$tux$y$yzzzK''# e##$ PNOOO 4rcltj|dddkrtddS)NrMz0Label begins with an illegal combining characterT)rcategoryr r4s rcheck_initial_combinerrWs5E!H%%a(C//JKKK 4rc|dddkrtd|ddks |ddkrtdd S) Nz--z4Label has disallowed hyphens in 3rd and 4th positionr-z)Label must not start or end with a hyphenT)r r4s rcheck_hyphen_okr]sS QqSzTNOOO Qx3%)s**CDDD 4rcVtjd||krtddS)NNFCz%Label must be in Normalization Form C)r normalizer r4s r check_nfcras1UE**e33?@@@43rcVt||}|dkrN|dkr0tt||dz tkrdSd}t|dz ddD]l}tjt||}|tdkrH|tdtd fvrd}nm|sdSd}t|dzt|D]l}tjt||}|tdkrH|td td fvrd}nm|S|d kr8|dkr0tt||dz tkrdSdSdS) Ni rrTFr\TrADr>i )r#r!_virama_combining_classranger joining_typesgetr3)r5poscp_valueoki joining_types rvalid_contextjrns5:H6 77E#'N 3 3448OOOt s1ub"%%  A#155c%(mmDDLs3xx''C#c((3334 5 s1uc%jj))  A#155c%(mmDDLs3xx''C#c((3334 6 77E#'N 3 3448OOOtuurcLt||}|dkr\d|cxkrt|dz kr=nn:t||dz dkrt||dzdkrdSdS|dkrD|t|dz kr,t|dkrt||dzdSdS|d ks|d kr!|dkrt||dz d SdS|d krA|D]<}|d kr t|ds t|dst|drdS=dSd|cxkrdkr*nn'|D]"}dt|cxkrdkrndS#dSd|cxkrdkr*nn'|D]"}dt|cxkrdkrndS#dSdS)NrrlTFiuGreekiiHebrewi0u・HiraganaKatakanaHani`iiii)r#r3r&)r5ri exceptionrjrs rvalid_contextorxsS5:H6 s ! ! ! !SZZ\ ! ! ! ! !5q>""f,,U37^1D1D1N1Ntu V   UA  #e**q..eC!Gng66 6u V  x611 77eC!Gnh77 7u V    BX~~"j)) ZJ-G-G :VXZ_K`K` tt u ( # # # #e # # # # #  BB))))6)))))uu*t ( # # # #e # # # # #  BB))))6)))))uu*t 5rc t|ttfr|d}t |dkrt dt |t|t|t|D]\}}t|}t|tj dr6t|tj dr t||sAtdt#||dzt%|#t&$rBt dt#||dzt%|wxYwt|tj d rSt)||sAtd t#||dzt%|kt+d t#||dzt%|t-|dS) Nzutf-8rz Empty LabelPVALIDCONTEXTJz*Joiner {} not allowed at position {} in {}rz12^2e2ehQU 3=3=>>>> : : : ^ e e(OOSUDKK!9!9::: :x)CJ)O P P @!%-- K-.].d.dejksetetvyz{v{~BCH~I~I/J/JKKK K##R#Y#YZ_`hZiZiknopkprvw|r}r}#~#~ us'AD99A Fc| |d}t|t|std|S#t$rYnwxYw|stdt |}t |t|}t|z}t|std|S)NasciizLabel too longzNo Input) r)ulabelr6r UnicodeEncodeErrorstrrr,_alabel_prefixr5 label_bytess ralabelr s ll7++ {!+.. .,-- -       $ ### JJEE""K ;.K k * **())) sAA AAcVt|ttfs8 |d}n##t$rt ||cYSwxYw|}|}|tr\|ttd}|std| dddkrtdn$t || dS| d}t ||S)Nrz5Malformed A-label, no Punycode eligible content foundr\r[z"A-label must not end with a hyphenr() r~rrr)rrlower startswithrr3r rrs rrr%s= eeY/ 0 0 ,,w//KK!       LLL  ##%%Kn--+!#n"5"5"6"67  USTT T   g & &r *c 1 1@AA A 2 K   !!'***   z * *E Ls4AATc `ddlm}d}t|D]\}}t|} ||dkr|ntj||dfdz }|d} d} t |dkr|d} | d ks| d kr|r | d kr |s| ||z }n2| | d ks| d kr|r| d kr|r|| z }n| d krt #t $rBtdt||dzt|wxYwtj d|S)zBRe-map the characters in the string according to UTS46 processing.r) uts46datar=ZNrYVrd3rUIr}r_) rrIr#bisect bisect_leftr3 IndexErrorrr.r/rKrr`) domain std3_rules transitionalroutputrichar code_pointuts46rowstatus replacements r uts46_remapr@s%$$$$$ Fv&&;; TYY  ; zC/?/?"9z3.?@@1DFHa[FK8}}!!&qk # s]]<]s]]:]+:M$(fmms]]:]s]]|]+%3 ll" ; ; ;"?FFj!!37DLL::;; ; ;   / //s BC  A DcVt|ttfr|d}|rt |||}d}g}|r|d}nt |}|r|dgkrtd|ddkr|d=d}|D]7}t|}|r| |)td|r| d d |}t||std |S) NrF.r= Empty domainr\T Empty labelr.zDomain too long) r~rrrrsplit_unicode_dots_rer rappendjoinr;) r+strictuts46rrr:resultlabelsr5s rr)r)asJ!eY'(( HHW   5 :| 4 4L F +!''** (Vt^^''' bzR 2J ++ 5MM  + MM!    M** * c &A q, / /+)*** Hrc t|ttfr|d}|rt ||d}d}g}|st |}n|d}|r|dgkrtd|ds|d=d}|D]7}t|}|r| |)td|r| dd |S) NrFrr=rr\Tr) r~rrrrrrr rrr)r+rrrr:rrr5s rrrs"!eY'(( HHW   . :u - -L F !''** (Vt^^''' ": 2J ++ 5MM  + MM!    M** * b 88F  r)F)TF)FFFF)FFF)%r=rrrretypingrr intrangesrrercompiler UnicodeErrorr rrrr!r&r,r/r6r;rSrWr]rarnrxrrrrr)rrrrrsa  """"""""((((((2::;;             I        y        i      @@@      9999xAAA )))X((((V@260000B    >r