;ELC   
;;; Compiled
;;; in Emacs version 29.4
;;; with all optimizations.



(byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\300\307!\207" [require cl-lib uni-confusable ucs-normalize idna-mapping puny mail-parse url] 2)
(defvar textsec--char-scripts nil)#@57 Create the textsec--char-scripts char table.

(fn DATA)
(defalias 'textsec--create-script-table #[257 "\301\302!\211\211\205* \211@\211A@\211\203\" \211@\303@#\210A\266\202\202 \210A\266\202\202 \207" [textsec--char-scripts make-char-table nil set-char-table-range] 9 (#$ . 305)])
(require 'uni-scripts)#@187 Return a list of Unicode scripts used in STRING.
The scripts returned by this function use the Unicode Script property
as defined by the Unicode Standard Annex 24 (UAX#24).

(fn STRING)
(defalias 'textsec-scripts #[257 "\300\301\"\207" [seq-map #[257 "\234\207" [textsec--char-scripts] 3 "\n\n(fn CHAR)"]] 4 (#$ . 623)])#@370 Return non-nil if STRING is all in a single Unicode script.

Note that the concept of "single script" used by this function
isn't obvious -- some mixtures of scripts count as a "single
script".  See

  https://www.unicode.org/reports/tr39/#Mixed_Script_Detection

for details.  The Unicode scripts are as defined by the
Unicode Standard Annex 24 (UAX#24).

(fn STRING)
(defalias 'textsec-single-script-p #[257 "\300\301\302!\"\3032X \211\304:\203T @\262\304:\203K @\262\305>\204D \305>\204D \306>\204D \306>\204D \307\"\204D \310\303\304\"\210A\262\202 \266A\262\202\f \266\3110\207" [mapcar #[257 "\300\301\302\"\"\207" [append mapcan #[257 "\300\301!!\207" [copy-sequence textsec--augment-script] 4 "\n\n(fn SCRIPT)"]] 6 "\n\n(fn S)"] textsec-scripts empty nil common inherited seq-intersection throw t] 9 (#$ . 953)])#@15 

(fn SCRIPT)
(defalias 'textsec--augment-script #[257 "\211\300=\203 \301\207\211\302=\204 \211\303=\203 \304\207\211\305=\204\" \211\306=\205# \307\207" [han (hangul japan korea) hiragana katakana (japan) hangul bopomofo (korea)] 3 (#$ . 1803)])#@199 Return a minimal list of scripts used in STRING.
Note that a string may have several different minimal cover sets.
The scripts are as defined by the Unicode Standard Annex 24 (UAX#24).

(fn STRING)
(defalias 'textsec-covering-scripts #[257 "\300!\211@\211\203 \211@\301\302\"\"\262A\266\202\202 \210\303\304\305\304\306\"\"\307\"\207" [textsec-scripts seq-union seq-difference sort delq common inherited string<] 10 (#$ . 2060)])#@238 Say what restriction level STRING qualifies for.
Levels are (in decreasing order of restrictiveness) `ascii-only',
`single-script', `highly-restrictive', `moderately-restrictive',
`minimally-restrictive' and `unrestricted'.

(fn STRING)
(defalias 'textsec-restriction-level #[257 "\300!\301\302\"\203\f \303\207\304!\203 \305\207\306\307\"\203) \306\310\"\203) \306\311\"\204+ \312\207\211G\313U\203A \314>\203A \315\316\"\203A \317\207\320\207" [textsec-covering-scripts string-match "\\`[[:ascii:]]+\\'" ascii-only textsec-single-script-p single-script seq-difference (latin han hiragana katakana) (latin han bopomofo) (latin han hangul) highly-restrictive 2 latin seq-intersection (arabic armenian bengali bopomofo devanagari ethiopic georgian gujarati gurmukhi hangul han hebrew hiragana katakana kannada khmer lao malayalam myanmar oriya sinhala tamil telugu thaana thai tibetan) moderately-restrictive unrestricted] 5 (#$ . 2507)])#@88 Return non-nil if STRING includes numbers from different decimal systems.

(fn STRING)
(defalias 'textsec-mixed-numbers-p #[257 "\300\301\302\303\304\"\"!G\305V\207" [seq-uniq mapcar #[257 "\211\300\301\"Z\207" [get-char-code-property numeric-value] 5 "\n\n(fn CHAR)"] seq-filter #[257 "\300\301\"\302=\207" [get-char-code-property general-category Nd] 4 "\n\n(fn CHAR)"] 1] 7 (#$ . 3459)])#@88 Return non-nil if non-ASCII STRING can be confused with ASCII on display.

(fn STRING)
(defalias 'textsec-ascii-confusable-p #[257 "\300!\301=?\205 \300\302!!\301=\207" [textsec-restriction-level ascii-only textsec-unconfuse-string] 4 (#$ . 3858)])#@148 Return a de-confused version of STRING.
This algorithm is described in:

  https://www.unicode.org/reports/tr39/#Confusable_Detection

(fn STRING)
(defalias 'textsec-unconfuse-string #[257 "\300\301\302\303\304\300!\"\"!\207" [ucs-normalize-NFD-string apply concat seq-map #[257 "\301\"\206\n \302!\207" [uni-confusable-table gethash string] 4 "\n\n(fn CHAR)"]] 8 (#$ . 4116)])#@230 Return the resolved script set for STRING.
This is the minimal covering script set for STRING, but is nil is
STRING isn't a single script string.
The scripts are as defined by the Unicode Standard Annex 24 (UAX#24).

(fn STRING)
(defalias 'textsec-resolved-script-set #[257 "\300!\205	 \301!\207" [textsec-single-script-p textsec-covering-scripts] 3 (#$ . 4505)])#@156 Say whether STRING1 and STRING2 are single-script confusables.
The scripts are as defined by the Unicode Standard Annex 24 (UAX#24).

(fn STRING1 STRING2)
(defalias 'textsec-single-script-confusable-p #[514 "\300!\300!\232\205 \301\302!\302!\"\207" [textsec-unconfuse-string seq-intersection textsec-resolved-script-set] 6 (#$ . 4877)])#@155 Say whether STRING1 and STRING2 are mixed-script confusables.
The scripts are as defined by the Unicode Standard Annex 24 (UAX#24).

(fn STRING1 STRING2)
(defalias 'textsec-mixed-script-confusable-p #[514 "\300!\300!\232\205 \301\302!\302!\"?\207" [textsec-unconfuse-string seq-intersection textsec-resolved-script-set] 6 (#$ . 5225)])#@155 Say whether STRING1 and STRING2 are whole-script confusables.
The scripts are as defined by the Unicode Standard Annex 24 (UAX#24).

(fn STRING1 STRING2)
(defalias 'textsec-whole-script-confusable-p #[514 "\300\"\205 \301!\205 \301!\207" [textsec-mixed-script-confusable-p textsec-single-script-p] 5 (#$ . 5572)])#@67 Return non-nil if DOMAIN is an ipv4 or ipv6 address.

(fn DOMAIN)
(defalias 'textsec--ipvx-address-p #[257 "\301\302\303\304\301$\266\203)\207" [case-fold-search t "\\`\\(?:\\(?:[0-9]\\{1,3\\}\\.?\\)\\{1,4\\}\\|\\(?:[0-9a-f]\\{0,4\\}:\\)\\{1,7\\}[0-9a-f]\\{0,4\\}\\(?::\\(?:[0-9]\\{1,3\\}\\.?\\)\\{1,4\\}\\)?\\|\\[\\(?:[0-9a-f]\\{0,4\\}:\\)\\{1,7\\}[0-9a-f]\\{0,4\\}\\(?::\\(?:[0-9]\\{1,3\\}\\.?\\)\\{1,4\\}\\)?]\\)\\'" nil string-match] 9 (#$ . 5897)])#@394 Say whether DOMAIN's name looks suspicious.
Return nil if it isn't suspicious.  If it is, return a string explaining
the potential problem.

Domain names are considered suspicious if they use characters
that can look similar to other characters when displayed, or
use characters that are not allowed by Unicode's IDNA mapping,
or use certain other unusual mixtures of characters.

(fn DOMAIN)
(defalias 'textsec-domain-suspicious-p #[257 "\3002D \301!\203 \302\300\303\"\210\304\305\"\210\306!\204\" \302\300\307\310\"\"\210\311\312\"\211\203A \211@\313!\203: \302\300\307\314\"\"\210A\266\202\202& \210\3030\207" [found textsec--ipvx-address-p throw nil seq-do #[257 "\234\301=\205' \302\303\304\305\306\307\"\310=\203 \311\202 \312\313!P\306\314\"$\"\207" [idna-mapping-table t throw found format "Disallowed character%s (#x%x, %s)" get-char-code-property general-category Cf "" ": " string name] 10 "\n\n(fn CHAR)"] puny-highly-restrictive-domain-p format "`%s' mixes characters from different scripts in suspicious ways" split-string "\\." textsec-ascii-confusable-p "`%s' is confusable with ASCII"] 8 (#$ . 6362)])#@398 Say whether LOCAL part of an email address looks suspicious.
LOCAL is the bit before "@" in an email address.

If it isn't suspicious, return nil.  If it is, return a string explaining
the potential problem.

Email addresses are considered suspicious if they use characters
that can look similar to other characters when displayed, or use
certain other unusual mixtures of characters.

(fn LOCAL)
(defalias 'textsec-local-address-suspicious-p #[257 "\211\300!\232\204 \301\302\300!#\207\303!\203 \301\304\"\207\305!\306=\203( \301\307\"\207\310\311\312\313$\266\203\205: \301\314\"\207" [ucs-normalize-NFKC-string format "`%s' is not in normalized format `%s'" textsec-mixed-numbers-p "`%s' contains numbers from different number systems" textsec-restriction-level unrestricted "`%s' isn't restrictive enough" "\\`\\.\\|\\.\\'\\|\\.\\." nil string-match t "`%s' contains invalid dots"] 9 (#$ . 7507)])#@443 Return non-nil of STRING uses bidi controls in suspicious ways.
If STRING doesn't include any suspicious uses of bidirectional
formatting control characters, return nil.  Otherwise, return the
index of the first character in STRING affected by such suspicious
use of bidi controls.  If the returned value is beyond the length
of STRING, it means any text following STRING on display might be
affected by bidi controls in STRING.

(fn STRING)
(defalias 'textsec-bidi-controls-suspicious-p #[257 "\300\301\302\"r\211q\210\303\304\"\216\305\261\210\306\307d\310#\311!\205 \211S*\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] "a1א:!" bidi-find-overridden-directionality 1 nil fixnump] 6 (#$ . 8429)])#@388 Say whether NAME looks suspicious.
NAME is (for instance) the free-text display name part of an
email address.

If it isn't suspicious, return nil.  If it is, return a string
explaining the potential problem.

Names are considered suspicious if they use characters that can
look similar to other characters when displayed, or use certain
other unusual mixtures of characters.

(fn NAME)
(defalias 'textsec-name-suspicious-p #[257 "\211\300!\232\204 \301\302\300!#\207\303\304\"\203$ \305\306!!\203$ \301\307\"\207\310!\207" [ucs-normalize-NFC-string format "`%s' is not in normalized format `%s'" seq-find #[257 "\211\235\205\n \211\301>?\207" [bidi-control-characters (8206 8207 1564)] 3 "\n\n(fn CHAR)"] fixnump textsec-bidi-controls-suspicious-p "`%s' contains suspicious uses of bidirectional control characters" textsec-suspicious-nonspacing-p] 6 (#$ . 9210)])#@342 Say whether STRING uses nonspacing characters in suspicious ways.
If it doesn't, return nil.  If it does, return a string explaining
the potential problem.

Use of nonspacing characters is considered suspicious if there are
two or more consecutive identical nonspacing characters, or too many
consecutive nonspacing characters.

(fn STRING)
(defalias 'textsec-suspicious-nonspacing-p #[257 "\300C\301C\3022 \303\304\305#\"\210\3000\207" [nil 0 found seq-do make-closure #[257 "\302\303\"\304>\211\203 \301\242\232\203 \305\306\307\"\210\300\203! \300\242T\202\" \310\240\210\300\242\311V\2030 \305\306\312\"\210\301\240\207" [V0 V1 get-char-code-property general-category (Mn Me) throw found "Two identical consecutive nonspacing characters" 0 4 "Too many consecutive nonspacing characters"] 5 "\n\n(fn CHAR)"]] 8 (#$ . 10091)])#@375 Say whether EMAIL address looks suspicious.
If it isn't, return nil.  If it is, return a string explaining the
potential problem.

An email address is considered suspicious if either of its two
parts -- the local address name or the domain -- are found to be
suspicious by, respectively, `textsec-local-address-suspicious-p'
and `textsec-domain-suspicious-p'.

(fn ADDRESS)
(defalias 'textsec-email-address-suspicious-p #[257 "\300\301\"\211\242\243\211\242\243\302!\206 \303!\207" [split-string "@" textsec-domain-suspicious-p textsec-local-address-suspicious-p] 8 (#$ . 10936)])#@498 Say whether EMAIL looks suspicious.
If it isn't, return nil.  If it is, return a string explaining the
potential problem.

Note that EMAIL has to be a valid email specification according
to RFC2047bis -- strings that can't be parsed will be flagged as
suspicious.

An email specification is considered suspicious if either of its
two parts -- the address or the name -- are found to be
suspicious by, respectively, `textsec-email-address-suspicious-p'
and `textsec-name-suspicious-p'.

(fn EMAIL)
(defalias 'textsec-email-address-header-suspicious-p #[257 "\3002+ \3011 \302\303\"0\202 \210\304\300\305\"\211\242\243\306!\206& \211\205& \307!\266\202\2620\207" [end (error) mail-header-parse-address t throw "Email address can't be parsed." textsec-email-address-suspicious-p textsec-name-suspicious-p] 6 (#$ . 11529)])#@131 Say whether URL looks suspicious.
If it isn't, return nil.  If it is, return a string explaining the
potential problem.

(fn URL)
(defalias 'textsec-url-suspicious-p #[257 "\301!\302!>\204 \303\304\305D\"\210\211\306H\205, \307\302!>\204( \303\304\305D\"\210\306H!\207" [cl-struct-url-tags url-generic-parse-url type-of signal wrong-type-argument url 4 textsec-domain-suspicious-p] 7 (#$ . 12362)])#@369 Say whether LINK is suspicious.
LINK should be a cons cell where the first element is the URL,
and the second element is the link text.

This function will return non-nil if it seems like the link text
is misleading about where the URL takes you.  This is typical
when the link text looks like an URL itself, but doesn't lead to
the same domain as the URL.

(fn LINK)
(defalias 'textsec-link-suspicious-p #[257 "\211@\301A!\3022\205 \303!\304!>\204 \305\306\307D\"\210\211\310H\262\303!\304!>\2043 \305\306\307D\"\210\211\310H\262\203o \211\203o \232\204o \311\"\203S \312!\204o \311\"\203` \312!\204o \313\302\314\315#\"\266\202\202\204 \211\205\202 \316!\205\202 \313\302\314\317\320!\"\"\266\2020\207" [cl-struct-url-tags string-trim found url-generic-parse-url type-of signal wrong-type-argument url 4 string-suffix-p url-domsuf-cookie-allowed-p throw format "Text `%s' doesn't point to link URL `%s'" textsec-domain-suspicious-p "Domain `%s' in the link text is suspicious" bidi-string-strip-control-characters] 11 (#$ . 12776)])
(provide 'textsec)
