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AAC,UAAU,CAAC;QAEjC,IAAI,CAAC,UAAU,EAAG;YACjB,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,qCAAgB,CAAE;gBACpD,SAAS,EAAK,IAAI,CAAC,SAAS;gBAC5B,QAAQ,EAAM,IAAI,CAAC,QAAQ;gBAC3B,SAAS,EAAK,IAAI,CAAC,SAAS;aAC5B,CAAE,CAAC;SACJ;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IA51BD;;;;;;;OAOG;IACa,kBAAO,GAAG,QAAQ,CAAC;IAEnC;;;OAGG;IACa,2BAAgB,GAAG,qCAAgB,CAAC;IAEpD;;;OAGG;IACa,kBAAO,GAAG,kBAAO,CAAC;IAElC;;;OAGG;IACa,kBAAO,GAAG;QACzB,KAAK,EAAE,4BAAY;QACnB,OAAO,EAAE,gCAAc;QACvB,OAAO,EAAE,iBAAO;QAChB,OAAO,EAAE,gCAAc;QACvB,KAAK,EAAE,4BAAY;QACnB,GAAG,EAAE,wBAAU;KACf,CAAC;IAEF;;;OAGG;IACa,gBAAK,GAAG;QACvB,KAAK,EAAE,wBAAU;QACjB,OAAO,EAAE,4BAAY;QACrB,KAAK,EAAE,aAAK;QACZ,OAAO,EAAE,4BAAY;QACrB,KAAK,EAAE,wBAAU;QACjB,GAAG,EAAE,oBAAQ;KACb,CAAC;IAgzBH,iBAAC;CAh2BD,AAg2BC,IAAA;kBAh2BoB,UAAU","file":"autolinker.js","sourcesContent":["import { defaults, remove, splitAndCapture } from \"./utils\";\nimport { AnchorTagBuilder } from \"./anchor-tag-builder\";\nimport { Match } from \"./match/match\";\nimport { EmailMatch } from \"./match/email-match\";\nimport { HashtagMatch } from \"./match/hashtag-match\";\nimport { MentionMatch } from \"./match/mention-match\";\nimport { PhoneMatch } from \"./match/phone-match\";\nimport { UrlMatch } from \"./match/url-match\";\nimport { Matcher } from \"./matcher/matcher\";\nimport { HtmlTag } from \"./html-tag\";\nimport { EmailMatcher } from \"./matcher/email-matcher\";\nimport { UrlMatcher } from \"./matcher/url-matcher\";\nimport { HashtagMatcher } from \"./matcher/hashtag-matcher\";\nimport { PhoneMatcher } from \"./matcher/phone-matcher\";\nimport { MentionMatcher } from \"./matcher/mention-matcher\";\nimport { parseHtml } from './htmlParser/parse-html';\n\n/**\n * @class Autolinker\n * @extends Object\n *\n * Utility class used to process a given string of text, and wrap the matches in\n * the appropriate anchor (&lt;a&gt;) tags to turn them into links.\n *\n * Any of the configuration options may be provided in an Object provided\n * to the Autolinker constructor, which will configure how the {@link #link link()}\n * method will process the links.\n *\n * For example:\n *\n * var autolinker = new Autolinker( {\n * newWindow : false,\n * truncate : 30\n * } );\n *\n * var html = autolinker.link( \"Joe went to www.yahoo.com\" );\n * // produces: 'Joe went to <a href=\"http://www.yahoo.com\">yahoo.com</a>'\n *\n *\n * The {@link #static-link static link()} method may also be used to inline\n * options into a single call, which may be more convenient for one-off uses.\n * For example:\n *\n * var html = Autolinker.link( \"Joe went to www.yahoo.com\", {\n * newWindow : false,\n * truncate : 30\n * } );\n * // produces: 'Joe went to <a href=\"http://www.yahoo.com\">yahoo.com</a>'\n *\n *\n * ## Custom Replacements of Links\n *\n * If the configuration options do not provide enough flexibility, a {@link #replaceFn}\n * may be provided to fully customize the output of Autolinker. This function is\n * called once for each URL/Email/Phone#/Hashtag/Mention (Twitter, Instagram, Soundcloud)\n * match that is encountered.\n *\n * For example:\n *\n * var input = \"...\"; // string with URLs, Email Addresses, Phone #s, Hashtags, and Mentions (Twitter, Instagram, Soundcloud)\n *\n * var linkedText = Autolinker.link( input, {\n * replaceFn : function( match ) {\n * console.log( \"href = \", match.getAnchorHref() );\n * console.log( \"text = \", match.getAnchorText() );\n *\n * switch( match.getType() ) {\n * case 'url' :\n * console.log( \"url: \", match.getUrl() );\n *\n * if( match.getUrl().indexOf( 'mysite.com' ) === -1 ) {\n * var tag = match.buildTag(); // returns an `Autolinker.HtmlTag` instance, which provides mutator methods for easy changes\n * tag.setAttr( 'rel', 'nofollow' );\n * tag.addClass( 'external-link' );\n *\n * return tag;\n *\n * } else {\n * return true; // let Autolinker perform its normal anchor tag replacement\n * }\n *\n * case 'email' :\n * var email = match.getEmail();\n * console.log( \"email: \", email );\n *\n * if( email === \"my@own.address\" ) {\n * return false; // don't auto-link this particular email address; leave as-is\n * } else {\n * return; // no return value will have Autolinker perform its normal anchor tag replacement (same as returning `true`)\n * }\n *\n * case 'phone' :\n * var phoneNumber = match.getPhoneNumber();\n * console.log( phoneNumber );\n *\n * return '<a href=\"http://newplace.to.link.phone.numbers.to/\">' + phoneNumber + '</a>';\n *\n * case 'hashtag' :\n * var hashtag = match.getHashtag();\n * console.log( hashtag );\n *\n * return '<a href=\"http://newplace.to.link.hashtag.handles.to/\">' + hashtag + '</a>';\n *\n * case 'mention' :\n * var mention = match.getMention();\n * console.log( mention );\n *\n * return '<a href=\"http://newplace.to.link.mention.to/\">' + mention + '</a>';\n * }\n * }\n * } );\n *\n *\n * The function may return the following values:\n *\n * - `true` (Boolean): Allow Autolinker to replace the match as it normally\n * would.\n * - `false` (Boolean): Do not replace the current match at all - leave as-is.\n * - Any String: If a string is returned from the function, the string will be\n * used directly as the replacement HTML for the match.\n * - An {@link Autolinker.HtmlTag} instance, which can be used to build/modify\n * an HTML tag before writing out its HTML text.\n */\nexport default class Autolinker { // NOTE: must be 'export default' here for UMD module\n\n\t/**\n\t * @static\n\t * @property {String} version\n\t * \n\t * The Autolinker version number in the form major.minor.patch\n\t *\n\t * Ex: 0.25.1\n\t */\n\tstatic readonly version = '3.14.3';\n\n\t/**\n\t * For backwards compatibility with Autolinker 1.x, the AnchorTagBuilder \n\t * class is provided as a static on the Autolinker class.\n\t */\n\tstatic readonly AnchorTagBuilder = AnchorTagBuilder;\n\n\t/**\n\t * For backwards compatibility with Autolinker 1.x, the HtmlTag class is\n\t * provided as a static on the Autolinker class.\n\t */\n\tstatic readonly HtmlTag = HtmlTag;\n\n\t/**\n\t * For backwards compatibility with Autolinker 1.x, the Matcher classes are \n\t * provided as statics on the Autolinker class.\n\t */\n\tstatic readonly matcher = {\n\t\tEmail: EmailMatcher,\n\t\tHashtag: HashtagMatcher,\n\t\tMatcher: Matcher,\n\t\tMention: MentionMatcher,\n\t\tPhone: PhoneMatcher,\n\t\tUrl: UrlMatcher\n\t};\n\n\t/**\n\t * For backwards compatibility with Autolinker 1.x, the Match classes are \n\t * provided as statics on the Autolinker class.\n\t */\n\tstatic readonly match = {\n\t\tEmail: EmailMatch,\n\t\tHashtag: HashtagMatch,\n\t\tMatch: Match,\n\t\tMention: MentionMatch,\n\t\tPhone: PhoneMatch,\n\t\tUrl: UrlMatch\n\t};\n\n\t/**\n\t * Automatically links URLs, Email addresses, Phone Numbers, Twitter handles,\n\t * Hashtags, and Mentions found in the given chunk of HTML. Does not link URLs\n\t * found within HTML tags.\n\t *\n\t * For instance, if given the text: `You should go to http://www.yahoo.com`,\n\t * then the result will be `You should go to &lt;a href=\"http://www.yahoo.com\"&gt;http://www.yahoo.com&lt;/a&gt;`\n\t *\n\t * Example:\n\t *\n\t * var linkedText = Autolinker.link( \"Go to google.com\", { newWindow: false } );\n\t * // Produces: \"Go to <a href=\"http://google.com\">google.com</a>\"\n\t *\n\t * @static\n\t * @param {String} textOrHtml The HTML or text to find matches within (depending\n\t * on if the {@link #urls}, {@link #email}, {@link #phone}, {@link #mention},\n\t * {@link #hashtag}, and {@link #mention} options are enabled).\n\t * @param {Object} [options] Any of the configuration options for the Autolinker\n\t * class, specified in an Object (map). See the class description for an\n\t * example call.\n\t * @return {String} The HTML text, with matches automatically linked.\n\t */\n\tstatic link( textOrHtml: string, options?: AutolinkerConfig ) {\n\t\tconst autolinker = new Autolinker( options );\n\t\treturn autolinker.link( textOrHtml );\n\t}\n\n\t/**\n\t * Parses the input `textOrHtml` looking for URLs, email addresses, phone\n\t * numbers, username handles, and hashtags (depending on the configuration\n\t * of the Autolinker instance), and returns an array of {@link Autolinker.match.Match}\n\t * objects describing those matches (without making any replacements).\n\t *\n\t * Note that if parsing multiple pieces of text, it is slightly more efficient\n\t * to create an Autolinker instance, and use the instance-level {@link #parse}\n\t * method.\n\t *\n\t * Example:\n\t *\n\t * var matches = Autolinker.parse( \"Hello google.com, I am asdf@asdf.com\", {\n\t * urls: true,\n\t * email: true\n\t * } );\n\t *\n\t * console.log( matches.length ); // 2\n\t * console.log( matches[ 0 ].getType() ); // 'url'\n\t * console.log( matches[ 0 ].getUrl() ); // 'google.com'\n\t * console.log( matches[ 1 ].getType() ); // 'email'\n\t * console.log( matches[ 1 ].getEmail() ); // 'asdf@asdf.com'\n\t *\n\t * @static\n\t * @param {String} textOrHtml The HTML or text to find matches within\n\t * (depending on if the {@link #urls}, {@link #email}, {@link #phone},\n\t * {@link #hashtag}, and {@link #mention} options are enabled).\n\t * @param {Object} [options] Any of the configuration options for the Autolinker\n\t * class, specified in an Object (map). See the class description for an\n\t * example call.\n\t * @return {Autolinker.match.Match[]} The array of Matches found in the\n\t * given input `textOrHtml`.\n\t */\n\tstatic parse( textOrHtml: string, options: AutolinkerConfig ) {\n\t\tconst autolinker = new Autolinker( options );\n\t\treturn autolinker.parse( textOrHtml );\n\t}\n\n\n\t/**\n\t * The Autolinker version number exposed on the instance itself.\n\t *\n\t * Ex: 0.25.1\n\t */\n\treadonly version = Autolinker.version;\n\n\n\t/**\n\t * @cfg {Boolean/Object} [urls]\n\t *\n\t * `true` if URLs should be automatically linked, `false` if they should not\n\t * be. Defaults to `true`.\n\t *\n\t * Examples:\n\t *\n\t * urls: true\n\t *\n\t * // or\n\t *\n\t * urls: {\n\t * schemeMatches : true,\n\t * wwwMatches : true,\n\t * tldMatches : true\n\t * }\n\t *\n\t * As shown above, this option also accepts an Object form with 3 properties\n\t * to allow for more customization of what exactly gets linked. All default\n\t * to `true`:\n\t *\n\t * @cfg {Boolean} [urls.schemeMatches] `true` to match URLs found prefixed\n\t * with a scheme, i.e. `http://google.com`, or `other+scheme://google.com`,\n\t * `false` to prevent these types of matches.\n\t * @cfg {Boolean} [urls.wwwMatches] `true` to match urls found prefixed with\n\t * `'www.'`, i.e. `www.google.com`. `false` to prevent these types of\n\t * matches. Note that if the URL had a prefixed scheme, and\n\t * `schemeMatches` is true, it will still be linked.\n\t * @cfg {Boolean} [urls.tldMatches] `true` to match URLs with known top\n\t * level domains (.com, .net, etc.) that are not prefixed with a scheme or\n\t * `'www.'`. This option attempts to match anything that looks like a URL\n\t * in the given text. Ex: `google.com`, `asdf.org/?page=1`, etc. `false`\n\t * to prevent these types of matches.\n\t */\n\tprivate readonly urls: UrlsConfigObj = {}; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Boolean} [email=true]\n\t *\n\t * `true` if email addresses should be automatically linked, `false` if they\n\t * should not be.\n\t */\n\tprivate readonly email: boolean = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Boolean} [phone=true]\n\t *\n\t * `true` if Phone numbers (\"(555)555-5555\") should be automatically linked,\n\t * `false` if they should not be.\n\t */\n\tprivate readonly phone: boolean = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Boolean/String} [hashtag=false]\n\t *\n\t * A string for the service name to have hashtags (ex: \"#myHashtag\")\n\t * auto-linked to. The currently-supported values are:\n\t *\n\t * - 'twitter'\n\t * - 'facebook'\n\t * - 'instagram'\n\t *\n\t * Pass `false` to skip auto-linking of hashtags.\n\t */\n\tprivate readonly hashtag: HashtagConfig = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {String/Boolean} [mention=false]\n\t *\n\t * A string for the service name to have mentions (ex: \"@myuser\")\n\t * auto-linked to. The currently supported values are:\n\t *\n\t * - 'twitter'\n\t * - 'instagram'\n\t * - 'soundcloud'\n\t *\n\t * Defaults to `false` to skip auto-linking of mentions.\n\t */\n\tprivate readonly mention: MentionConfig = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Boolean} [newWindow=true]\n\t *\n\t * `true` if the links should open in a new window, `false` otherwise.\n\t */\n\tprivate readonly newWindow: boolean = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Boolean/Object} [stripPrefix=true]\n\t *\n\t * `true` if 'http://' (or 'https://') and/or the 'www.' should be stripped\n\t * from the beginning of URL links' text, `false` otherwise. Defaults to\n\t * `true`.\n\t *\n\t * Examples:\n\t *\n\t * stripPrefix: true\n\t *\n\t * // or\n\t *\n\t * stripPrefix: {\n\t * scheme : true,\n\t * www : true\n\t * }\n\t *\n\t * As shown above, this option also accepts an Object form with 2 properties\n\t * to allow for more customization of what exactly is prevented from being\n\t * displayed. Both default to `true`:\n\t *\n\t * @cfg {Boolean} [stripPrefix.scheme] `true` to prevent the scheme part of\n\t * a URL match from being displayed to the user. Example:\n\t * `'http://google.com'` will be displayed as `'google.com'`. `false` to\n\t * not strip the scheme. NOTE: Only an `'http://'` or `'https://'` scheme\n\t * will be removed, so as not to remove a potentially dangerous scheme\n\t * (such as `'file://'` or `'javascript:'`)\n\t * @cfg {Boolean} [stripPrefix.www] www (Boolean): `true` to prevent the\n\t * `'www.'` part of a URL match from being displayed to the user. Ex:\n\t * `'www.google.com'` will be displayed as `'google.com'`. `false` to not\n\t * strip the `'www'`.\n\t */\n\tprivate readonly stripPrefix: Required<StripPrefixConfigObj> = { scheme: true, www: true }; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Boolean} [stripTrailingSlash=true]\n\t *\n\t * `true` to remove the trailing slash from URL matches, `false` to keep\n\t * the trailing slash.\n\t *\n\t * Example when `true`: `http://google.com/` will be displayed as\n\t * `http://google.com`.\n\t */\n\tprivate readonly stripTrailingSlash: boolean = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Boolean} [decodePercentEncoding=true]\n\t *\n\t * `true` to decode percent-encoded characters in URL matches, `false` to keep\n\t * the percent-encoded characters.\n\t *\n\t * Example when `true`: `https://en.wikipedia.org/wiki/San_Jos%C3%A9` will\n\t * be displayed as `https://en.wikipedia.org/wiki/San_José`.\n\t */\n private readonly decodePercentEncoding: boolean = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Number/Object} [truncate=0]\n\t *\n\t * ## Number Form\n\t *\n\t * A number for how many characters matched text should be truncated to\n\t * inside the text of a link. If the matched text is over this number of\n\t * characters, it will be truncated to this length by adding a two period\n\t * ellipsis ('..') to the end of the string.\n\t *\n\t * For example: A url like 'http://www.yahoo.com/some/long/path/to/a/file'\n\t * truncated to 25 characters might look something like this:\n\t * 'yahoo.com/some/long/pat..'\n\t *\n\t * Example Usage:\n\t *\n\t * truncate: 25\n\t *\n\t *\n\t * Defaults to `0` for \"no truncation.\"\n\t *\n\t *\n\t * ## Object Form\n\t *\n\t * An Object may also be provided with two properties: `length` (Number) and\n\t * `location` (String). `location` may be one of the following: 'end'\n\t * (default), 'middle', or 'smart'.\n\t *\n\t * Example Usage:\n\t *\n\t * truncate: { length: 25, location: 'middle' }\n\t *\n\t * @cfg {Number} [truncate.length=0] How many characters to allow before\n\t * truncation will occur. Defaults to `0` for \"no truncation.\"\n\t * @cfg {\"end\"/\"middle\"/\"smart\"} [truncate.location=\"end\"]\n\t *\n\t * - 'end' (default): will truncate up to the number of characters, and then\n\t * add an ellipsis at the end. Ex: 'yahoo.com/some/long/pat..'\n\t * - 'middle': will truncate and add the ellipsis in the middle. Ex:\n\t * 'yahoo.com/s..th/to/a/file'\n\t * - 'smart': for URLs where the algorithm attempts to strip out unnecessary\n\t * parts first (such as the 'www.', then URL scheme, hash, etc.),\n\t * attempting to make the URL human-readable before looking for a good\n\t * point to insert the ellipsis if it is still too long. Ex:\n\t * 'yahoo.com/some..to/a/file'. For more details, see\n\t * {@link Autolinker.truncate.TruncateSmart}.\n\t */\n\tprivate readonly truncate: Required<TruncateConfigObj> = { length: 0, location : 'end' }; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {String} className\n\t *\n\t * A CSS class name to add to the generated links. This class will be added\n\t * to all links, as well as this class plus match suffixes for styling\n\t * url/email/phone/hashtag/mention links differently.\n\t *\n\t * For example, if this config is provided as \"myLink\", then:\n\t *\n\t * - URL links will have the CSS classes: \"myLink myLink-url\"\n\t * - Email links will have the CSS classes: \"myLink myLink-email\", and\n\t * - Phone links will have the CSS classes: \"myLink myLink-phone\"\n\t * - Hashtag links will have the CSS classes: \"myLink myLink-hashtag\"\n\t * - Mention links will have the CSS classes: \"myLink myLink-mention myLink-[type]\"\n\t * where [type] is either \"instagram\", \"twitter\" or \"soundcloud\"\n\t */\n\tprivate readonly className: string = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Function} replaceFn\n\t *\n\t * A function to individually process each match found in the input string.\n\t *\n\t * See the class's description for usage.\n\t *\n\t * The `replaceFn` can be called with a different context object (`this`\n\t * reference) using the {@link #context} cfg.\n\t *\n\t * This function is called with the following parameter:\n\t *\n\t * @cfg {Autolinker.match.Match} replaceFn.match The Match instance which\n\t * can be used to retrieve information about the match that the `replaceFn`\n\t * is currently processing. See {@link Autolinker.match.Match} subclasses\n\t * for details.\n\t */\n\tprivate readonly replaceFn: ReplaceFn | null = null; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Object} context\n\t *\n\t * The context object (`this` reference) to call the `replaceFn` with.\n\t *\n\t * Defaults to this Autolinker instance.\n\t */\n\tprivate readonly context: any = undefined; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Boolean} [sanitizeHtml=false]\n\t * \n\t * `true` to HTML-encode the start and end brackets of existing HTML tags found \n \t * in the input string. This will escape `<` and `>` characters to `&lt;` and \n\t * `&gt;`, respectively.\n\t * \n\t * Setting this to `true` will prevent XSS (Cross-site Scripting) attacks, \n\t * but will remove the significance of existing HTML tags in the input string. If \n\t * you would like to maintain the significance of existing HTML tags while also \n\t * making the output HTML string safe, leave this option as `false` and use a \n\t * tool like https://github.com/cure53/DOMPurify (or others) on the input string \n\t * before running Autolinker.\n\t */\n\tprivate readonly sanitizeHtml: boolean = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n\t\n\t/**\n\t * @private\n\t * @property {Autolinker.matcher.Matcher[]} matchers\n\t *\n\t * The {@link Autolinker.matcher.Matcher} instances for this Autolinker\n\t * instance.\n\t *\n\t * This is lazily created in {@link #getMatchers}.\n\t */\n\tprivate matchers: Matcher[] | null = null;\n\n\t/**\n\t * @private\n\t * @property {Autolinker.AnchorTagBuilder} tagBuilder\n\t *\n\t * The AnchorTagBuilder instance used to build match replacement anchor tags.\n\t * Note: this is lazily instantiated in the {@link #getTagBuilder} method.\n\t */\n\tprivate tagBuilder: AnchorTagBuilder | null = null;\n\n\n\t/**\n\t * @method constructor\n\t * @param {Object} [cfg] The configuration options for the Autolinker instance,\n\t * specified in an Object (map).\n\t */\n\tconstructor( cfg: AutolinkerConfig = {} ) {\n\t\t// Note: when `this.something` is used in the rhs of these assignments,\n\t\t// it refers to the default values set above the constructor\n\t\tthis.urls = this.normalizeUrlsCfg( cfg.urls );\n\t\tthis.email = typeof cfg.email === 'boolean' ? cfg.email : this.email;\n\t\tthis.phone = typeof cfg.phone === 'boolean' ? cfg.phone : this.phone;\n\t\tthis.hashtag = cfg.hashtag || this.hashtag;\n\t\tthis.mention = cfg.mention || this.mention;\n\t\tthis.newWindow = typeof cfg.newWindow === 'boolean' ? cfg.newWindow : this.newWindow;\n\t\tthis.stripPrefix = this.normalizeStripPrefixCfg( cfg.stripPrefix );\n\t\tthis.stripTrailingSlash = typeof cfg.stripTrailingSlash === 'boolean' ? cfg.stripTrailingSlash : this.stripTrailingSlash;\n\t\tthis.decodePercentEncoding = typeof cfg.decodePercentEncoding === 'boolean' ? cfg.decodePercentEncoding : this.decodePercentEncoding;\n\t\tthis.sanitizeHtml = cfg.sanitizeHtml || false;\n\n\t\t// Validate the value of the `mention` cfg\n\t\tconst mention = this.mention;\n\t\tif( mention !== false && mention !== 'twitter' && mention !== 'instagram' && mention !== 'soundcloud' ) {\n\t\t\tthrow new Error( \"invalid `mention` cfg - see docs\" );\n\t\t}\n\n\t\t// Validate the value of the `hashtag` cfg\n\t\tconst hashtag = this.hashtag;\n\t\tif( hashtag !== false && hashtag !== 'twitter' && hashtag !== 'facebook' && hashtag !== 'instagram' ) {\n\t\t\tthrow new Error( \"invalid `hashtag` cfg - see docs\" );\n\t\t}\n\n\t\tthis.truncate = this.normalizeTruncateCfg( cfg.truncate );\n\t\tthis.className = cfg.className || this.className;\n\t\tthis.replaceFn = cfg.replaceFn || this.replaceFn;\n\t\tthis.context = cfg.context || this;\n\t}\n\n\n\t/**\n\t * Normalizes the {@link #urls} config into an Object with 3 properties:\n\t * `schemeMatches`, `wwwMatches`, and `tldMatches`, all Booleans.\n\t *\n\t * See {@link #urls} config for details.\n\t *\n\t * @private\n\t * @param {Boolean/Object} urls\n\t * @return {Object}\n\t */\n\tprivate normalizeUrlsCfg( \n\t\turls: UrlsConfig | undefined \n\t): Required<UrlsConfigObj> {\n\t\tif( urls == null ) urls = true; // default to `true`\n\n\t\tif( typeof urls === 'boolean' ) {\n\t\t\treturn { schemeMatches: urls, wwwMatches: urls, tldMatches: urls };\n\n\t\t} else { // object form\n\t\t\treturn {\n\t\t\t\tschemeMatches : typeof urls.schemeMatches === 'boolean' ? urls.schemeMatches : true,\n\t\t\t\twwwMatches : typeof urls.wwwMatches === 'boolean' ? urls.wwwMatches : true,\n\t\t\t\ttldMatches : typeof urls.tldMatches === 'boolean' ? urls.tldMatches : true\n\t\t\t};\n\t\t}\n\t}\n\n\n\t/**\n\t * Normalizes the {@link #stripPrefix} config into an Object with 2\n\t * properties: `scheme`, and `www` - both Booleans.\n\t *\n\t * See {@link #stripPrefix} config for details.\n\t *\n\t * @private\n\t * @param {Boolean/Object} stripPrefix\n\t * @return {Object}\n\t */\n\tprivate normalizeStripPrefixCfg( \n\t\tstripPrefix: StripPrefixConfig | undefined \n\t): Required<StripPrefixConfigObj> {\n\t\tif( stripPrefix == null ) stripPrefix = true; // default to `true`\n\n\t\tif( typeof stripPrefix === 'boolean' ) {\n\t\t\treturn { scheme: stripPrefix, www: stripPrefix };\n\n\t\t} else { // object form\n\t\t\treturn {\n\t\t\t\tscheme : typeof stripPrefix.scheme === 'boolean' ? stripPrefix.scheme : true,\n\t\t\t\twww : typeof stripPrefix.www === 'boolean' ? stripPrefix.www : true\n\t\t\t};\n\t\t}\n\t}\n\n\n\t/**\n\t * Normalizes the {@link #truncate} config into an Object with 2 properties:\n\t * `length` (Number), and `location` (String).\n\t *\n\t * See {@link #truncate} config for details.\n\t *\n\t * @private\n\t * @param {Number/Object} truncate\n\t * @return {Object}\n\t */\n\tprivate normalizeTruncateCfg( \n\t\ttruncate: TruncateConfig | undefined \n\t): Required<TruncateConfigObj> {\n\t\tif( typeof truncate === 'number' ) {\n\t\t\treturn { length: truncate, location: 'end' };\n\n\t\t} else { // object, or undefined/null\n\t\t\treturn defaults( truncate || {}, {\n\t\t\t\tlength : Number.POSITIVE_INFINITY,\n\t\t\t\tlocation : 'end'\n\t\t\t} );\n\t\t}\n\t}\n\n\n\t/**\n\t * Parses the input `textOrHtml` looking for URLs, email addresses, phone\n\t * numbers, username handles, and hashtags (depending on the configuration\n\t * of the Autolinker instance), and returns an array of {@link Autolinker.match.Match}\n\t * objects describing those matches (without making any replacements).\n\t *\n\t * This method is used by the {@link #link} method, but can also be used to\n\t * simply do parsing of the input in order to discover what kinds of links\n\t * there are and how many.\n\t *\n\t * Example usage:\n\t *\n\t * var autolinker = new Autolinker( {\n\t * urls: true,\n\t * email: true\n\t * } );\n\t *\n\t * var matches = autolinker.parse( \"Hello google.com, I am asdf@asdf.com\" );\n\t *\n\t * console.log( matches.length ); // 2\n\t * console.log( matches[ 0 ].getType() ); // 'url'\n\t * console.log( matches[ 0 ].getUrl() ); // 'google.com'\n\t * console.log( matches[ 1 ].getType() ); // 'email'\n\t * console.log( matches[ 1 ].getEmail() ); // 'asdf@asdf.com'\n\t *\n\t * @param {String} textOrHtml The HTML or text to find matches within\n\t * (depending on if the {@link #urls}, {@link #email}, {@link #phone},\n\t * {@link #hashtag}, and {@link #mention} options are enabled).\n\t * @return {Autolinker.match.Match[]} The array of Matches found in the\n\t * given input `textOrHtml`.\n\t */\n\tparse( textOrHtml: string ) {\n\t\tlet skipTagNames = [ 'a', 'style', 'script' ],\n\t\t skipTagsStackCount = 0, // used to only Autolink text outside of anchor/script/style tags. We don't want to autolink something that is already linked inside of an <a> tag, for instance\n\t\t\tmatches: Match[] = [];\n\t\t\t\n\t\t// Find all matches within the `textOrHtml` (but not matches that are\n\t\t// already nested within <a>, <style> and <script> tags)\n\t\tparseHtml( textOrHtml, {\n\t\t\tonOpenTag: ( tagName: string ) => {\n\t\t\t\tif( skipTagNames.indexOf( tagName ) >= 0 ) {\n\t\t\t\t\tskipTagsStackCount++;\n\t\t\t\t}\n\t\t\t},\n\t\t\tonText: ( text: string, offset: number ) => {\n\t\t\t\t// Only process text nodes that are not within an <a>, <style> or <script> tag\n\t\t\t\tif( skipTagsStackCount === 0 ) {\n\t\t\t\t\t// \"Walk around\" common HTML entities. An '&nbsp;' (for example)\n\t\t\t\t\t// could be at the end of a URL, but we don't want to \n\t\t\t\t\t// include the trailing '&' in the URL. See issue #76\n\t\t\t\t\t// TODO: Handle HTML entities separately in parseHtml() and\n\t\t\t\t\t// don't emit them as \"text\" except for &amp; entities\n\t\t\t\t\tconst htmlCharacterEntitiesRegex = /(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi;\n\t\t\t\t\tconst textSplit = splitAndCapture( text, htmlCharacterEntitiesRegex );\n\n\t\t\t\t\tlet currentOffset = offset;\n\t\t\t\t\ttextSplit.forEach( ( splitText, i ) => {\n\t\t\t\t\t\t// even number matches are text, odd numbers are html entities\n\t\t\t\t\t\tif( i % 2 === 0 ) {\n\t\t\t\t\t\t\tlet textNodeMatches = this.parseText( splitText, currentOffset );\n\t\t\t\t\t\t\tmatches.push.apply( matches, textNodeMatches );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentOffset += splitText.length;\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t},\n\t\t\tonCloseTag: ( tagName: string ) => {\n\t\t\t\tif( skipTagNames.indexOf( tagName ) >= 0 ) {\n\t\t\t\t\tskipTagsStackCount = Math.max( skipTagsStackCount - 1, 0 ); // attempt to handle extraneous </a> tags by making sure the stack count never goes below 0\n\t\t\t\t}\n\t\t\t},\n\t\t\tonComment: ( offset: number ) => {}, // no need to process comment nodes\n\t\t\tonDoctype: ( offset: number ) => {}, // no need to process doctype nodes\n\t\t} );\n\n\n\t\t// After we have found all matches, remove subsequent matches that\n\t\t// overlap with a previous match. This can happen for instance with URLs,\n\t\t// where the url 'google.com/#link' would match '#link' as a hashtag.\n\t\tmatches = this.compactMatches( matches );\n\n\t\t// And finally, remove matches for match types that have been turned\n\t\t// off. We needed to have all match types turned on initially so that\n\t\t// things like hashtags could be filtered out if they were really just\n\t\t// part of a URL match (for instance, as a named anchor).\n\t\tmatches = this.removeUnwantedMatches( matches );\n\n\t\treturn matches;\n\t}\n\n\n\t/**\n\t * After we have found all matches, we need to remove matches that overlap \n\t * with a previous match. This can happen for instance with URLs, where the\n\t * url 'google.com/#link' would match '#link' as a hashtag. Because the \n\t * '#link' part is contained in a larger match that comes before the HashTag\n\t * match, we'll remove the HashTag match.\n\t *\n\t * @private\n\t * @param {Autolinker.match.Match[]} matches\n\t * @return {Autolinker.match.Match[]}\n\t */\n\tprivate compactMatches( matches: Match[] ) {\n\t\t// First, the matches need to be sorted in order of offset\n\t\tmatches.sort( function( a, b ) { return a.getOffset() - b.getOffset(); } );\n\n\t\tfor( let i = 0; i < matches.length - 1; i++ ) {\n\t\t\tlet match = matches[ i ],\n\t\t\t\t\toffset = match.getOffset(),\n\t\t\t\t\tmatchedTextLength = match.getMatchedText().length,\n\t\t\t endIdx = offset + matchedTextLength;\n\n\t\t\tif( i + 1 < matches.length ) {\n\t\t\t\t// Remove subsequent matches that equal offset with current match\n\t\t\t\tif( matches[ i + 1 ].getOffset() === offset ) {\n\t\t\t\t\tlet removeIdx = matches[ i + 1 ].getMatchedText().length > matchedTextLength ? i : i + 1;\n\t\t\t\t\tmatches.splice( removeIdx, 1 );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Remove subsequent matches that overlap with the current match\n\t\t\t\tif( matches[ i + 1 ].getOffset() < endIdx ) {\n\t\t\t\t\tmatches.splice( i + 1, 1 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t}\n\n\n\t/**\n\t * Removes matches for matchers that were turned off in the options. For\n\t * example, if {@link #hashtag hashtags} were not to be matched, we'll\n\t * remove them from the `matches` array here.\n\t * \n\t * Note: we *must* use all Matchers on the input string, and then filter \n\t * them out later. For example, if the options were `{ url: false, hashtag: true }`,\n\t * we wouldn't want to match the text '#link' as a HashTag inside of the text \n\t * 'google.com/#link'. The way the algorithm works is that we match the full \n\t * URL first (which prevents the accidental HashTag match), and then we'll \n\t * simply throw away the URL match.\n\t *\n\t * @private\n\t * @param {Autolinker.match.Match[]} matches The array of matches to remove\n\t * the unwanted matches from. Note: this array is mutated for the\n\t * removals.\n\t * @return {Autolinker.match.Match[]} The mutated input `matches` array.\n\t */\n\tprivate removeUnwantedMatches( matches: Match[] ) {\n\t\tif( !this.hashtag ) remove( matches, ( match: Match ) => { return match.getType() === 'hashtag'; } );\n\t\tif( !this.email ) remove( matches, ( match: Match ) => { return match.getType() === 'email'; } );\n\t\tif( !this.phone ) remove( matches, ( match: Match ) => { return match.getType() === 'phone'; } );\n\t\tif( !this.mention ) remove( matches, ( match: Match ) => { return match.getType() === 'mention'; } );\n\t\tif( !this.urls.schemeMatches ) {\n\t\t\tremove( matches, ( m: Match ) => m.getType() === 'url' && ( m as UrlMatch ).getUrlMatchType() === 'scheme' );\n\t\t}\n\t\tif( !this.urls.wwwMatches ) {\n\t\t\tremove( matches, ( m: Match ) => m.getType() === 'url' && ( m as UrlMatch ).getUrlMatchType() === 'www' );\n\t\t}\n\t\tif( !this.urls.tldMatches ) {\n\t\t\tremove( matches, ( m: Match ) => m.getType() === 'url' && ( m as UrlMatch ).getUrlMatchType() === 'tld' );\n\t\t}\n\n\t\treturn matches;\n\t}\n\n\n\t/**\n\t * Parses the input `text` looking for URLs, email addresses, phone\n\t * numbers, username handles, and hashtags (depending on the configuration\n\t * of the Autolinker instance), and returns an array of {@link Autolinker.match.Match}\n\t * objects describing those matches.\n\t *\n\t * This method processes a **non-HTML string**, and is used to parse and\n\t * match within the text nodes of an HTML string. This method is used\n\t * internally by {@link #parse}.\n\t *\n\t * @private\n\t * @param {String} text The text to find matches within (depending on if the\n\t * {@link #urls}, {@link #email}, {@link #phone},\n\t * {@link #hashtag}, and {@link #mention} options are enabled). This must be a non-HTML string.\n\t * @param {Number} [offset=0] The offset of the text node within the\n\t * original string. This is used when parsing with the {@link #parse}\n\t * method to generate correct offsets within the {@link Autolinker.match.Match}\n\t * instances, but may be omitted if calling this method publicly.\n\t * @return {Autolinker.match.Match[]} The array of Matches found in the\n\t * given input `text`.\n\t */\n\tprivate parseText( text: string, offset = 0 ) {\n\t\toffset = offset || 0;\n\t\tlet matchers = this.getMatchers(),\n\t\t matches: Match[] = [];\n\n\t\tfor( let i = 0, numMatchers = matchers.length; i < numMatchers; i++ ) {\n\t\t\tlet textMatches = matchers[ i ].parseMatches( text );\n\n\t\t\t// Correct the offset of each of the matches. They are originally\n\t\t\t// the offset of the match within the provided text node, but we\n\t\t\t// need to correct them to be relative to the original HTML input\n\t\t\t// string (i.e. the one provided to #parse).\n\t\t\tfor( let j = 0, numTextMatches = textMatches.length; j < numTextMatches; j++ ) {\n\t\t\t\ttextMatches[ j ].setOffset( offset + textMatches[ j ].getOffset() );\n\t\t\t}\n\n\t\t\tmatches.push.apply( matches, textMatches );\n\t\t}\n\t\treturn matches;\n\t}\n\n\n\t/**\n\t * Automatically links URLs, Email addresses, Phone numbers, Hashtags,\n\t * and Mentions (Twitter, Instagram, Soundcloud) found in the given chunk of HTML. Does not link\n\t * URLs found within HTML tags.\n\t *\n\t * For instance, if given the text: `You should go to http://www.yahoo.com`,\n\t * then the result will be `You should go to\n\t * &lt;a href=\"http://www.yahoo.com\"&gt;http://www.yahoo.com&lt;/a&gt;`\n\t *\n\t * This method finds the text around any HTML elements in the input\n\t * `textOrHtml`, which will be the text that is processed. Any original HTML\n\t * elements will be left as-is, as well as the text that is already wrapped\n\t * in anchor (&lt;a&gt;) tags.\n\t *\n\t * @param {String} textOrHtml The HTML or text to autolink matches within\n\t * (depending on if the {@link #urls}, {@link #email}, {@link #phone}, {@link #hashtag}, and {@link #mention} options are enabled).\n\t * @return {String} The HTML, with matches automatically linked.\n\t */\n\tlink( textOrHtml: string ) {\n\t\tif( !textOrHtml ) { return \"\"; } // handle `null` and `undefined` (for JavaScript users that don't have TypeScript support)\n\t\t\n\t\t/* We would want to sanitize the start and end characters of a tag \n\t\t * before processing the string in order to avoid an XSS scenario.\n\t\t * This behaviour can be changed by toggling the sanitizeHtml option.\n\t\t */\n\t\tif( this.sanitizeHtml ) {\n\t\t\ttextOrHtml = textOrHtml\n\t\t\t\t.replace( /</g, '&lt;' )\n\t\t\t\t.replace( />/g, '&gt;' );\n\t\t}\n\n\t\tlet matches = this.parse( textOrHtml ),\n\t\t\tnewHtml: string[] = [],\n\t\t\tlastIndex = 0;\n\n\t\tfor( let i = 0, len = matches.length; i < len; i++ ) {\n\t\t\tlet match = matches[ i ];\n\n\t\t\tnewHtml.push( textOrHtml.substring( lastIndex, match.getOffset() ) );\n\t\t\tnewHtml.push( this.createMatchReturnVal( match ) );\n\n\t\t\tlastIndex = match.getOffset() + match.getMatchedText().length;\n\t\t}\n\t\tnewHtml.push( textOrHtml.substring( lastIndex ) ); // handle the text after the last match\n\n\t\treturn newHtml.join( '' );\n\t}\n\n\n\t/**\n\t * Creates the return string value for a given match in the input string.\n\t *\n\t * This method handles the {@link #replaceFn}, if one was provided.\n\t *\n\t * @private\n\t * @param {Autolinker.match.Match} match The Match object that represents\n\t * the match.\n\t * @return {String} The string that the `match` should be replaced with.\n\t * This is usually the anchor tag string, but may be the `matchStr` itself\n\t * if the match is not to be replaced.\n\t */\n\tprivate createMatchReturnVal( match: Match ): string {\n\t\t// Handle a custom `replaceFn` being provided\n\t\tlet replaceFnResult: ReplaceFnReturn;\n\t\tif( this.replaceFn ) {\n\t\t\treplaceFnResult = this.replaceFn.call( this.context, match ); // Autolinker instance is the context\n\t\t}\n\n\t\tif( typeof replaceFnResult === 'string' ) {\n\t\t\treturn replaceFnResult; // `replaceFn` returned a string, use that\n\n\t\t} else if( replaceFnResult === false ) {\n\t\t\treturn match.getMatchedText(); // no replacement for the match\n\n\t\t} else if( replaceFnResult instanceof HtmlTag ) {\n\t\t\treturn replaceFnResult.toAnchorString();\n\n\t\t} else { // replaceFnResult === true, or no/unknown return value from function\n\t\t\t// Perform Autolinker's default anchor tag generation\n\t\t\tlet anchorTag = match.buildTag(); // returns an Autolinker.HtmlTag instance\n\n\t\t\treturn anchorTag.toAnchorString();\n\t\t}\n\t}\n\n\n\t/**\n\t * Lazily instantiates and returns the {@link Autolinker.matcher.Matcher}\n\t * instances for this Autolinker instance.\n\t *\n\t * @private\n\t * @return {Autolinker.matcher.Matcher[]}\n\t */\n\tprivate getMatchers() {\n\t\tif( !this.matchers ) {\n\t\t\tlet tagBuilder = this.getTagBuilder();\n\n\t\t\tlet matchers = [\n\t\t\t\tnew HashtagMatcher( { tagBuilder, serviceName: this.hashtag as HashtagServices } ),\n\t\t\t\tnew EmailMatcher( { tagBuilder } ),\n\t\t\t\tnew PhoneMatcher( { tagBuilder } ),\n\t\t\t\tnew MentionMatcher( { tagBuilder, serviceName: this.mention as MentionServices } ),\n\t\t\t\tnew UrlMatcher( { tagBuilder, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding } )\n\t\t\t];\n\n\t\t\treturn ( this.matchers = matchers );\n\n\t\t} else {\n\t\t\treturn this.matchers;\n\t\t}\n\t}\n\n\n\t/**\n\t * Returns the {@link #tagBuilder} instance for this Autolinker instance, \n\t * lazily instantiating it if it does not yet exist.\n\t * \n\t * @private\n\t * @return {Autolinker.AnchorTagBuilder}\n\t */\n\tprivate getTagBuilder() {\n\t\tlet tagBuilder = this.tagBuilder;\n\n\t\tif( !tagBuilder ) {\n\t\t\ttagBuilder = this.tagBuilder = new AnchorTagBuilder( {\n\t\t\t\tnewWindow : this.newWindow,\n\t\t\t\ttruncate : this.truncate,\n\t\t\t\tclassName : this.className\n\t\t\t} );\n\t\t}\n\n\t\treturn tagBuilder;\n\t}\n\n}\n\nexport interface AutolinkerConfig {\n\turls?: UrlsConfig;\n\temail?: boolean;\n\tphone?: boolean;\n\thashtag?: HashtagConfig;\n\tmention?: MentionConfig;\n\tnewWindow?: boolean;\n\tstripPrefix?: StripPrefixConfig;\n\tstripTrailingSlash?: boolean;\n\ttruncate?: TruncateConfig;\n\tclassName?: string;\n\treplaceFn?: ReplaceFn | null;\n\tcontext?: any;\n\tsanitizeHtml?: boolean;\n\tdecodePercentEncoding?: boolean;\n}\n\nexport type UrlsConfig = boolean | UrlsConfigObj;\nexport interface UrlsConfigObj {\n\tschemeMatches?: boolean;\n\twwwMatches?: boolean;\n\ttldMatches?: boolean;\n}\n\nexport type UrlMatchTypeOptions = 'scheme' | 'www' | 'tld';\n\nexport type StripPrefixConfig = boolean | StripPrefixConfigObj;\nexport interface StripPrefixConfigObj {\n\tscheme? : boolean;\n\twww? : boolean;\n}\n\nexport type TruncateConfig = number | TruncateConfigObj;\nexport interface TruncateConfigObj {\n\tlength?: number;\n\tlocation?: \"end\" | \"middle\" | \"smart\";\n}\n\nexport type HashtagConfig = false | HashtagServices;\nexport type HashtagServices = 'twitter' | 'facebook' | 'instagram';\n\nexport type MentionConfig = false | MentionServices;\nexport type MentionServices = 'twitter' | 'instagram' | 'soundcloud';\n\nexport type ReplaceFn = ( match: Match ) => ReplaceFnReturn;\nexport type ReplaceFnReturn = boolean | string | HtmlTag | null | undefined | void;"]}
\No newline at end of file