diff --git a/src/components/Button.tsx b/src/components/Button.tsx index fa6569f3..714f58ba 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -11,7 +11,7 @@ import { View, ViewStyle } from 'react-native' -import { Chase } from 'react-native-animated-spinkit' +import { Flow } from 'react-native-animated-spinkit' export interface Props { style?: StyleProp @@ -62,7 +62,7 @@ const Button: React.FC = ({ const loadingSpinkit = useMemo( () => ( - + ), [mode] diff --git a/src/components/Header/Right.tsx b/src/components/Header/Right.tsx index be302bf1..81438a6e 100644 --- a/src/components/Header/Right.tsx +++ b/src/components/Header/Right.tsx @@ -1,10 +1,9 @@ import Icon from '@components/Icon' import { StyleConstants } from '@utils/styles/constants' -import layoutAnimation from '@utils/styles/layoutAnimation' import { useTheme } from '@utils/styles/ThemeManager' -import React, { useEffect, useMemo, useRef } from 'react' +import React, { useMemo } from 'react' import { Pressable, StyleSheet, Text, View } from 'react-native' -import { Chase } from 'react-native-animated-spinkit' +import { Flow } from 'react-native-animated-spinkit' export interface Props { type?: 'icon' | 'text' @@ -27,19 +26,10 @@ const HeaderRight: React.FC = ({ }) => { const { theme } = useTheme() - const mounted = useRef(false) - // useEffect(() => { - // if (mounted.current) { - // layoutAnimation() - // } else { - // mounted.current = true - // } - // }, [content, loading, disabled]) - const loadingSpinkit = useMemo( () => ( - diff --git a/src/components/Menu/Row.tsx b/src/components/Menu/Row.tsx index 41f08511..a5c1c2b2 100644 --- a/src/components/Menu/Row.tsx +++ b/src/components/Menu/Row.tsx @@ -4,7 +4,7 @@ import { useTheme } from '@utils/styles/ThemeManager' import { ColorDefinitions } from '@utils/styles/themes' import React, { useMemo } from 'react' import { StyleSheet, Switch, Text, View } from 'react-native' -import { Chase } from 'react-native-animated-spinkit' +import { Flow } from 'react-native-animated-spinkit' import { State, TapGestureHandler } from 'react-native-gesture-handler' export interface Props { @@ -45,7 +45,7 @@ const MenuRow: React.FC = ({ const loadingSpinkit = useMemo( () => ( - diff --git a/src/components/Timelines/Timeline.tsx b/src/components/Timeline.tsx similarity index 100% rename from src/components/Timelines/Timeline.tsx rename to src/components/Timeline.tsx diff --git a/src/components/Timelines/Timeline/Conversation.tsx b/src/components/Timeline/Conversation.tsx similarity index 99% rename from src/components/Timelines/Timeline/Conversation.tsx rename to src/components/Timeline/Conversation.tsx index e33114a7..646d5bcc 100644 --- a/src/components/Timelines/Timeline/Conversation.tsx +++ b/src/components/Timeline/Conversation.tsx @@ -92,6 +92,7 @@ const TimelineConversation: React.FC = ({ = ({ disableDetails = false, disableOnPress = false }) => { + const { theme } = useTheme() const localAccount = useSelector(getLocalAccount) const navigation = useNavigation< StackNavigationProp @@ -57,6 +59,7 @@ const TimelineDefault: React.FC = ({ style={[ styles.statusView, { + backgroundColor: theme.background, paddingBottom: disableDetails && disableOnPress ? StyleConstants.Spacing.Global.PagePadding @@ -90,13 +93,14 @@ const TimelineDefault: React.FC = ({ : StyleConstants.Avatar.M + StyleConstants.Spacing.S }} > - {actualStatus.content.length > 0 && ( - - )} + {typeof actualStatus.content === 'string' && + actualStatus.content.length > 0 && ( + + )} {queryKey && actualStatus.poll ? ( = ({ status, refetch }) => { switch (status) { case 'loading': return ( - + ) case 'error': return ( @@ -60,7 +60,12 @@ const TimelineEmpty: React.FC = ({ status, refetch }) => { ) } }, [mode, i18n.language, status]) - return + return ( + + ) } const styles = StyleSheet.create({ diff --git a/src/components/Timelines/Timeline/End.tsx b/src/components/Timeline/End.tsx similarity index 89% rename from src/components/Timelines/Timeline/End.tsx rename to src/components/Timeline/End.tsx index 1266667f..6b9684d6 100644 --- a/src/components/Timelines/Timeline/End.tsx +++ b/src/components/Timeline/End.tsx @@ -4,7 +4,7 @@ import { useTheme } from '@utils/styles/ThemeManager' import React from 'react' import { Trans } from 'react-i18next' import { StyleSheet, Text, View } from 'react-native' -import { Chase } from 'react-native-animated-spinkit' +import { Circle } from 'react-native-animated-spinkit' export interface Props { hasNextPage?: boolean @@ -16,7 +16,7 @@ const TimelineEnd: React.FC = ({ hasNextPage }) => { return ( {hasNextPage ? ( - + ) : ( = ({ queryKey, highlighted = false }) => { + const { theme } = useTheme() const localAccount = useSelector(getLocalAccount) const navigation = useNavigation< StackNavigationProp @@ -44,12 +46,17 @@ const TimelineNotifications: React.FC = ({ }, []) return ( - - + + {notification.type !== 'mention' ? ( + + ) : null} = ({ isLoading, disable = false }) => { + const { theme } = useTheme() + return !isLoading && !disable ? ( + + } + /> + ) : null +} + +const styles = StyleSheet.create({ + base: { + position: 'absolute', + top: 0, + left: 0, + right: 0, + height: StyleConstants.Spacing.XL, + justifyContent: 'center', + alignItems: 'center' + } +}) + +export default TimelineRefresh diff --git a/src/components/Timelines/Timeline/Shared/Actioned.tsx b/src/components/Timeline/Shared/Actioned.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/Actioned.tsx rename to src/components/Timeline/Shared/Actioned.tsx diff --git a/src/components/Timelines/Timeline/Shared/Actions.tsx b/src/components/Timeline/Shared/Actions.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/Actions.tsx rename to src/components/Timeline/Shared/Actions.tsx diff --git a/src/components/Timelines/Timeline/Shared/Attachment.tsx b/src/components/Timeline/Shared/Attachment.tsx similarity index 91% rename from src/components/Timelines/Timeline/Shared/Attachment.tsx rename to src/components/Timeline/Shared/Attachment.tsx index d7a2fcce..8f034904 100644 --- a/src/components/Timelines/Timeline/Shared/Attachment.tsx +++ b/src/components/Timeline/Shared/Attachment.tsx @@ -1,17 +1,16 @@ import analytics from '@components/analytics' import Button from '@components/Button' import haptics from '@components/haptics' -import AttachmentAudio from '@components/Timelines/Timeline/Shared/Attachment/Audio' -import AttachmentImage from '@components/Timelines/Timeline/Shared/Attachment/Image' -import AttachmentUnsupported from '@components/Timelines/Timeline/Shared/Attachment/Unsupported' -import AttachmentVideo from '@components/Timelines/Timeline/Shared/Attachment/Video' +import AttachmentAudio from '@components/Timeline/Shared/Attachment/Audio' +import AttachmentImage from '@components/Timeline/Shared/Attachment/Image' +import AttachmentUnsupported from '@components/Timeline/Shared/Attachment/Unsupported' +import AttachmentVideo from '@components/Timeline/Shared/Attachment/Video' import { useNavigation } from '@react-navigation/native' import { StyleConstants } from '@utils/styles/constants' import layoutAnimation from '@utils/styles/layoutAnimation' import React, { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { Pressable, StyleSheet, View } from 'react-native' -import { IImageInfo } from 'react-native-image-zoom-viewer/built/image-viewer.type' export interface Props { status: Pick diff --git a/src/components/Timelines/Timeline/Shared/Attachment/Audio.tsx b/src/components/Timeline/Shared/Attachment/Audio.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/Attachment/Audio.tsx rename to src/components/Timeline/Shared/Attachment/Audio.tsx diff --git a/src/components/Timelines/Timeline/Shared/Attachment/Image.tsx b/src/components/Timeline/Shared/Attachment/Image.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/Attachment/Image.tsx rename to src/components/Timeline/Shared/Attachment/Image.tsx diff --git a/src/components/Timelines/Timeline/Shared/Attachment/Unsupported.tsx b/src/components/Timeline/Shared/Attachment/Unsupported.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/Attachment/Unsupported.tsx rename to src/components/Timeline/Shared/Attachment/Unsupported.tsx diff --git a/src/components/Timelines/Timeline/Shared/Attachment/Video.tsx b/src/components/Timeline/Shared/Attachment/Video.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/Attachment/Video.tsx rename to src/components/Timeline/Shared/Attachment/Video.tsx diff --git a/src/components/Timelines/Timeline/Shared/Attachment/aspectRatio.ts b/src/components/Timeline/Shared/Attachment/aspectRatio.ts similarity index 100% rename from src/components/Timelines/Timeline/Shared/Attachment/aspectRatio.ts rename to src/components/Timeline/Shared/Attachment/aspectRatio.ts diff --git a/src/components/Timelines/Timeline/Shared/Avatar.tsx b/src/components/Timeline/Shared/Avatar.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/Avatar.tsx rename to src/components/Timeline/Shared/Avatar.tsx diff --git a/src/components/Timelines/Timeline/Shared/Card.tsx b/src/components/Timeline/Shared/Card.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/Card.tsx rename to src/components/Timeline/Shared/Card.tsx diff --git a/src/components/Timelines/Timeline/Shared/Content.tsx b/src/components/Timeline/Shared/Content.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/Content.tsx rename to src/components/Timeline/Shared/Content.tsx diff --git a/src/components/Timelines/Timeline/Shared/HeaderConversation.tsx b/src/components/Timeline/Shared/HeaderConversation.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/HeaderConversation.tsx rename to src/components/Timeline/Shared/HeaderConversation.tsx diff --git a/src/components/Timelines/Timeline/Shared/HeaderDefault.tsx b/src/components/Timeline/Shared/HeaderDefault.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/HeaderDefault.tsx rename to src/components/Timeline/Shared/HeaderDefault.tsx diff --git a/src/components/Timelines/Timeline/Shared/HeaderNotification.tsx b/src/components/Timeline/Shared/HeaderNotification.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/HeaderNotification.tsx rename to src/components/Timeline/Shared/HeaderNotification.tsx diff --git a/src/components/Timelines/Timeline/Shared/HeaderShared/Account.tsx b/src/components/Timeline/Shared/HeaderShared/Account.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/HeaderShared/Account.tsx rename to src/components/Timeline/Shared/HeaderShared/Account.tsx diff --git a/src/components/Timelines/Timeline/Shared/HeaderShared/Application.tsx b/src/components/Timeline/Shared/HeaderShared/Application.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/HeaderShared/Application.tsx rename to src/components/Timeline/Shared/HeaderShared/Application.tsx diff --git a/src/components/Timelines/Timeline/Shared/HeaderShared/Created.tsx b/src/components/Timeline/Shared/HeaderShared/Created.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/HeaderShared/Created.tsx rename to src/components/Timeline/Shared/HeaderShared/Created.tsx diff --git a/src/components/Timelines/Timeline/Shared/HeaderShared/Muted.tsx b/src/components/Timeline/Shared/HeaderShared/Muted.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/HeaderShared/Muted.tsx rename to src/components/Timeline/Shared/HeaderShared/Muted.tsx diff --git a/src/components/Timelines/Timeline/Shared/HeaderShared/Visibility.tsx b/src/components/Timeline/Shared/HeaderShared/Visibility.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/HeaderShared/Visibility.tsx rename to src/components/Timeline/Shared/HeaderShared/Visibility.tsx diff --git a/src/components/Timelines/Timeline/Shared/Poll.tsx b/src/components/Timeline/Shared/Poll.tsx similarity index 100% rename from src/components/Timelines/Timeline/Shared/Poll.tsx rename to src/components/Timeline/Shared/Poll.tsx diff --git a/src/modules/autolinker/anchor-tag-builder.js.map b/src/modules/autolinker/anchor-tag-builder.js.map deleted file mode 100644 index 45b7327f..00000000 --- a/src/modules/autolinker/anchor-tag-builder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/anchor-tag-builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;IAqBC;;;OAGG;IACH,0BAAa,GAA6B;QAA7B,oBAAA,EAAA,QAA6B;QAvB1C;;;WAGG;QACc,cAAS,GAAY,KAAK,CAAC,CAAE,gGAAgG;QAE9I;;;WAGG;QACc,aAAQ,GAAsB,EAAE,CAAC,CAAE,gGAAgG;QAEpJ;;;WAGG;QACc,cAAS,GAAW,EAAE,CAAC,CAAE,gGAAgG;QAQzI,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,IAAI,KAAK,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,EA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./html-tag\";\nimport { TruncateConfigObj } from \"./autolinker\";\nimport { truncateSmart } from \"./truncate/truncate-smart\";\nimport { truncateMiddle } from \"./truncate/truncate-middle\";\nimport { truncateEnd } from \"./truncate/truncate-end\";\n\n/**\n * @protected\n * @class Autolinker.AnchorTagBuilder\n * @extends Object\n *\n * Builds anchor (<a>) tags for the Autolinker utility when a match is\n * found.\n *\n * Normally this class is instantiated, configured, and used internally by an\n * {@link Autolinker} instance, but may actually be used indirectly in a\n * {@link Autolinker#replaceFn replaceFn} to create {@link Autolinker.HtmlTag HtmlTag}\n * instances which may be modified before returning from the\n * {@link Autolinker#replaceFn replaceFn}. For example:\n *\n * var html = Autolinker.link( \"Test google.com\", {\n * replaceFn : function( match ) {\n * var tag = match.buildTag(); // returns an {@link Autolinker.HtmlTag} instance\n * tag.setAttr( 'rel', 'nofollow' );\n *\n * return tag;\n * }\n * } );\n *\n * // generated html:\n * // Test google.com\n */\nexport class AnchorTagBuilder {\n\n\t/**\n\t * @cfg {Boolean} newWindow\n\t * @inheritdoc Autolinker#newWindow\n\t */\n\tprivate readonly newWindow: boolean = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {Object} truncate\n\t * @inheritdoc Autolinker#truncate\n\t */\n\tprivate readonly truncate: TruncateConfigObj = {}; // 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 * @inheritdoc Autolinker#className\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\n\t/**\n\t * @method constructor\n\t * @param {Object} [cfg] The configuration options for the AnchorTagBuilder instance, specified in an Object (map).\n\t */\n\tconstructor( cfg: AnchorTagBuilderCfg = {} ) {\n\t\tthis.newWindow = cfg.newWindow || false;\n\t\tthis.truncate = cfg.truncate || {};\n\t\tthis.className = cfg.className || '';\n\t}\n\n\n\t/**\n\t * Generates the actual anchor (<a>) tag to use in place of the\n\t * matched text, via its `match` object.\n\t *\n\t * @param {Autolinker.match.Match} match The Match instance to generate an\n\t * anchor tag from.\n\t * @return {Autolinker.HtmlTag} The HtmlTag instance for the anchor tag.\n\t */\n\tbuild( match: Match ) {\n\t\treturn new HtmlTag( {\n\t\t\ttagName : 'a',\n\t\t\tattrs : this.createAttrs( match ),\n\t\t\tinnerHtml : this.processAnchorText( match.getAnchorText() )\n\t\t} );\n\t}\n\n\n\t/**\n\t * Creates the Object (map) of the HTML attributes for the anchor (<a>)\n\t * tag being generated.\n\t *\n\t * @protected\n\t * @param {Autolinker.match.Match} match The Match instance to generate an\n\t * anchor tag from.\n\t * @return {Object} A key/value Object (map) of the anchor tag's attributes.\n\t */\n\tprotected createAttrs( match: Match ) {\n\t\tlet attrs: {[attrName: string]: string} = {\n\t\t\t'href' : match.getAnchorHref() // we'll always have the `href` attribute\n\t\t};\n\n\t\tlet cssClass = this.createCssClass( match );\n\t\tif( cssClass ) {\n\t\t\tattrs[ 'class' ] = cssClass;\n\t\t}\n\t\tif( this.newWindow ) {\n\t\t\tattrs[ 'target' ] = \"_blank\";\n\t\t\tattrs[ 'rel' ] = \"noopener noreferrer\"; // Issue #149. See https://mathiasbynens.github.io/rel-noopener/\n\t\t}\n\n\t\tif( this.truncate ) {\n\t\t\tif( this.truncate.length && this.truncate.length < match.getAnchorText().length ) {\n\t\t\t\tattrs[ 'title' ] = match.getAnchorHref();\n\t\t\t}\n\t\t}\n\n\t\treturn attrs;\n\t}\n\n\n\t/**\n\t * Creates the CSS class that will be used for a given anchor tag, based on\n\t * the `matchType` and the {@link #className} config.\n\t *\n\t * Example returns:\n\t *\n\t * - \"\" // no {@link #className}\n\t * - \"myLink myLink-url\" // url match\n\t * - \"myLink myLink-email\" // email match\n\t * - \"myLink myLink-phone\" // phone match\n\t * - \"myLink myLink-hashtag\" // hashtag match\n\t * - \"myLink myLink-mention myLink-twitter\" // mention match with Twitter service\n\t *\n\t * @protected\n\t * @param {Autolinker.match.Match} match The Match instance to generate an\n\t * anchor tag from.\n\t * @return {String} The CSS class string for the link. Example return:\n\t * \"myLink myLink-url\". If no {@link #className} was configured, returns\n\t * an empty string.\n\t */\n\tprotected createCssClass( match: Match ) {\n\t\tlet className = this.className;\n\n\t\tif( !className ) {\n\t\t\treturn \"\";\n\n\t\t} else {\n\t\t\tlet returnClasses = [ className ],\n\t\t\t\tcssClassSuffixes = match.getCssClassSuffixes();\n\n\t\t\tfor( let i = 0, len = cssClassSuffixes.length; i < len; i++ ) {\n\t\t\t\treturnClasses.push( className + '-' + cssClassSuffixes[ i ] );\n\t\t\t}\n\t\t\treturn returnClasses.join( ' ' );\n\t\t}\n\t}\n\n\n\t/**\n\t * Processes the `anchorText` by truncating the text according to the\n\t * {@link #truncate} config.\n\t *\n\t * @private\n\t * @param {String} anchorText The anchor tag's text (i.e. what will be\n\t * displayed).\n\t * @return {String} The processed `anchorText`.\n\t */\n\tprivate processAnchorText( anchorText: string ) {\n\t\tanchorText = this.doTruncate( anchorText );\n\n\t\treturn anchorText;\n\t}\n\n\n\t/**\n\t * Performs the truncation of the `anchorText` based on the {@link #truncate}\n\t * option. If the `anchorText` is longer than the length specified by the\n\t * {@link #truncate} option, the truncation is performed based on the\n\t * `location` property. See {@link #truncate} for details.\n\t *\n\t * @private\n\t * @param {String} anchorText The anchor tag's text (i.e. what will be\n\t * displayed).\n\t * @return {String} The truncated anchor text.\n\t */\n\tprivate doTruncate( anchorText: string ) {\n\t\tlet truncate = this.truncate;\n\t\tif( !truncate || !truncate.length ) return anchorText;\n\n\t\tlet truncateLength = truncate.length,\n\t\t\ttruncateLocation = truncate.location;\n\n\t\tif( truncateLocation === 'smart' ) {\n\t\t\treturn truncateSmart( anchorText, truncateLength );\n\n\t\t} else if( truncateLocation === 'middle' ) {\n\t\t\treturn truncateMiddle( anchorText, truncateLength );\n\n\t\t} else {\n\t\t\treturn truncateEnd( anchorText, truncateLength );\n\t\t}\n\t}\n}\n\n\nexport interface AnchorTagBuilderCfg {\n\tnewWindow?: boolean;\n\ttruncate?: TruncateConfigObj;\n\tclassName?: string\n}"]} \ No newline at end of file diff --git a/src/modules/autolinker/autolinker.js.map b/src/modules/autolinker/autolinker.js.map deleted file mode 100644 index e86ebfb7..00000000 --- a/src/modules/autolinker/autolinker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/autolinker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGG;AACH;IAiZC;;;;OAIG;IACH,oBAAa,GAA0B;QAA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OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,cAAc;QACvB,KAAK,EAAE,YAAY;QACnB,GAAG,EAAE,UAAU;KACf,CAAC;IAEF;;;OAGG;IACa,gBAAK,GAAG;QACvB,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,YAAY;QACrB,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;QACrB,KAAK,EAAE,UAAU;QACjB,GAAG,EAAE,QAAQ;KACb,CAAC;IAgzBH,iBAAC;CAh2BD,AAg2BC,IAAA;eAh2BoB,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 (<a>) 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 yahoo.com'\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 yahoo.com'\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 '' + phoneNumber + '';\n *\n * case 'hashtag' :\n * var hashtag = match.getHashtag();\n * console.log( hashtag );\n *\n * return '' + hashtag + '';\n *\n * case 'mention' :\n * var mention = match.getMention();\n * console.log( mention );\n *\n * return '' + mention + '';\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 {\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.1';\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 <a href=\"http://www.yahoo.com\">http://www.yahoo.com</a>`\n\t *\n\t * Example:\n\t *\n\t * var linkedText = Autolinker.link( \"Go to google.com\", { newWindow: false } );\n\t * // Produces: \"Go to google.com\"\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 = { 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 = { 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 `<` and \n\t * `>`, 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 !== 'mastodon' && 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 {\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 {\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 {\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 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 ,