8fw1 ddlmZddlZddlZddlZddlmZmZddlm Z dZ dZ ej dZ Gd d eZGd d eZGd deZGddeZdedefdZdededefdZdedefdZdedefdZdeeefdefdZdeeefdedefdZd3dededefdZdedefd Zdedefd!Zdeddfd"Z ded#edefd$Z!d3ded#ed%edefd&Z"deeee#fddfd'Z$dedefd(Z%deeee#fdefd)Z&d4d+ed,ed-edefd.Z'd5deeee#fd/ed0ed,ed-edef d1Z(d6deeee#fd/ed0ed,edef d2Z)dS)7)idnadataN)UnionOptional)intranges_contain sxn--u [.。.。]ceZdZdZdS) IDNAErrorz7 Base exception for all IDNA-encoding related problems N__name__ __module__ __qualname____doc__u/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/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 rrrrrsOODrrcpreturnctjt|}|dkr0tjt|st d|S)Nrz Unknown character in unicodedata) unicodedata combiningchrname ValueError)rvs r_combining_classr" sOc"gg&&AAvvB(( A?@@ @ Hrscriptc\tt|tj|S)N)rordrscripts)rr#s r _is_scriptr''s SWWh&6v&> ? ??rsc,|dS)Npunycode)encoder(s r _punycoder-*s 88J  rc,d|S)NzU+{:04X})formatr,s r_unotr0-s   Q  rlabelc0t|dkrdSdS)N?FTlenr1s rvalid_label_lengthr71s 5zzBu 4r trailing_dotc8t||rdndkrdSdS)NFTr4)r1r8s rvalid_string_lengthr<7s& 5zzL1SSc22u 4rF check_ltrc(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@rALz=First codepoint in label {} must be directionality L, R or AL) r@rArBENESCSETONBNNSMzGInvalid direction for codepoint at position {} in a right-to-left label)r@rArDrBrJ)rBrDz2Can not mix numeral types in a right-to-left label)rCrDrErFrGrHrIrJzGInvalid direction for codepoint at position {} in a left-to-right label)rCrDz0Label ends with illegal codepoint directionality) enumerater bidirectionalrr/repr) r1r= bidi_labelidxr directionrtl valid_ending number_types r check_bidirT=sJua(( 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 r6s rcheck_initial_combinerrXxs5E!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 r6s rcheck_hyphen_okr^~sS QqSzTNOOO Qx3%)s**CDDD 4rcVtjd||krtddS)NNFCz%Label must be in Normalization Form C)r normalizer r6s r check_nfcrbs1UE**e33?@@@43rposcVt||}|dkrN|dkr0tt||dz tkrdSd}t|dz ddD]l}tjt||}|tdkrH|tdtd fvrd}n|sdSd}t|dzt|D]l}tjt||}|tdkrH|td td fvrd}n|S|d kr8|dkr0tt||dz tkrdSdSdS) Ni rrTFr]TrCDr@i )r%r"_virama_combining_classranger joining_typesgetr5)r1rccp_valueoki joining_types rvalid_contextjros5:H6 77E#'N 3 3448OOOt s1ub"%%  A#155c%(mmDDLs3xx''#c((CHH!555 5 s1uc%jj))  A#155c%(mmDDLs3xx''#c((CHH!555 6 77E#'N 3 3448OOOtuur exceptioncLt||}|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%r5r')r1rcrprkrs rvalid_contextorysS5: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]Z\}}t|}t|tj dr6t|tj drRt||sAtdt#||dzt%|t|tj drSt'||sAtd t#||dzt%|t)d t#||dzt%|t+|dS) Nzutf-8rz Empty LabelPVALIDCONTEXTJz*Joiner {} not allowed at position {} in {}rCONTEXTO-Codepoint {} not allowed at position {} in {}z-Codepoint {} at position {} of {} not allowed) isinstancebytes bytearraydecoder5r rbr^rXrKr%rrcodepoint_classesrorr/r0rMryrrT)r1rcrrks r check_labelrs%%+,,& W%% 5zzQ &&& eE5!!!u%% @ @ br77 Xx'A('K L L @  x)CJ)O P P @!%-- :-.Z.a.a(OOSUDKK/9/9::: :x)CJ)O P P @!%-- K-.].d.dejksetetvyz{v{~BCH~I~I/J/JKKK K##R#Y#YZ_`hZiZiknopkprvw|r}r}#~#~ urc8 |d}t|t|std|S#t$rYnwxYwt |t t|z}t|std|S)NasciizLabel too long)r+ulabelr7r UnicodeEncodeErrorr_alabel_prefixr-r1 label_bytess ralabelrs ll7++ {!+.. .,-- -       9U#3#33K k * **())) sAA AAct|ttfs8 |d}n##t$rt ||cYSwxYw|}|}|tr\|ttd}|std| dddkrtdn$t || dS | d}n#t$rtdwxYwt ||S)Nrz5Malformed A-label, no Punycode eligible content foundr]r\z"A-label must not end with a hyphenr*zInvalid A-label) rrrr+rrlower startswithrr5r r UnicodeErrorrs rrrsn eeY/ 0 0 ,,w//KK!       LLL  ##%%Kn--+!#n"5"5"6"67  USTT T   g & &r *c 1 1@AA A 2 K   !!'***+"":.. +++)***+ Ls4AADD6Tdomain std3_rules transitionalc `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?ZNrZVrf3rVIr~r`) rrKr%bisect bisect_leftr5 IndexErrorrr/r0rMrra) rrrroutputrcchar 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 Dstrictuts46c|t|ts/ t|d}n#t$rtdwxYw|rt |||}d}g}|r|d}nt |}|r|dgkrtd|ddkr|d=d}|D]7}t|}|r||)td |r|d d |}t||std |S) NrzGshould pass a unicode string to the function rather than a byte string.F.r? Empty domainr]T Empty labelr.zDomain too long) rstrUnicodeDecodeErrorr rsplit_unicode_dots_rerappendjoinr<) r(rrrrr8resultlabelsr1s rr+r+Osx a  g gAwAA! g g geff f g 5 :| 4 4L F +!''** (Vt^^''' bzR 2J ++ 5MM  + MM!    M** * c &A q, / /+)*** Hs (Ac2 t|tst|d}n#t$rtdwxYw|rt ||d}d}g}|st |}n|d}|r|dgkrtd|ds|d=d}|D]7}t|}|r||)td |r|dd |S) NrzInvalid ASCII in A-labelFrr?rr]Tr) rrrr rrrrrr)r(rrrr8rrr1s rrrpsI4!S!! AwA 44423334 . :u - -L F !''** (Vt^^''' ": 2J ++ 5MM  + MM!    M** * b 88F  s %(A)F)TF)FFFF)FFF)*r?rrrretypingrr intrangesrrgrcompilerrr rrrintr"rboolr'rr-r0r7r<rTrXr^rbroryrrrrrr+rrrrrsw  """"""""((((((2::;;             I        y        i         @3@@@@@@       S S    eE3J/D uUCZ0 88c8d8t8888v#$ 34ASATAAAA ,#,C,D,,,,^''#'C'D'T''''TuS%236#%&%UI-.3:0000D0UX0000@  eC )* D  cg @D QV    BeC )*Dcgtwr