{"version":3,"sources":["../src/match/phone-match.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAe,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;GASG;AACH;IAAgC,8BAAK;IAwBpC;;;;OAIG;IACH,oBAAa,GAAqB;QAAlC,YACC,kBAAO,GAAG,CAAE,SAIZ;QAhCD;;;;;;;WAOG;QACc,YAAM,GAAW,EAAE,CAAC,CAAE,gGAAgG;QAEvI;;;;;;;;WAQG;QACc,cAAQ,GAAY,KAAK,CAAC,CAAE,gGAAgG;QAW5I,KAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QACzB,KAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;;IAC9B,CAAC;IAGD;;;;;OAKG;IACH,4BAAO,GAAP;QACC,OAAO,OAAO,CAAC;IAChB,CAAC;IAGD;;;;;;;OAOG;IACH,mCAAc,GAAd;QACC,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAGD;;;;;;;OAOG;IACH,8BAAS,GAAT;QACC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;IAC9B,CAAC;IAGD;;;;OAIG;IACH,kCAAa,GAAb;QACC,OAAO,MAAM,GAAG,CAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAE,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5D,CAAC;IAGD;;;;OAIG;IACH,kCAAa,GAAb;QACC,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAEF,iBAAC;AAAD,CA7FA,AA6FC,CA7F+B,KAAK,GA6FpC","file":"phone-match.js","sourcesContent":["import { Match, MatchConfig } from \"./match\";\n\n/**\n * @class Autolinker.match.Phone\n * @extends Autolinker.match.Match\n *\n * Represents a Phone number match found in an input string which should be\n * Autolinked.\n *\n * See this class's superclass ({@link Autolinker.match.Match}) for more\n * details.\n */\nexport class PhoneMatch extends Match {\n\n\t/**\n\t * @protected\n\t * @property {String} number (required)\n\t *\n\t * The phone number that was matched, without any delimiter characters.\n\t *\n\t * Note: This is a string to allow for prefixed 0's.\n\t */\n\tprivate readonly number: string = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @protected\n\t * @property {Boolean} plusSign (required)\n\t *\n\t * `true` if the matched phone number started with a '+' sign. We'll include\n\t * it in the `tel:` URL if so, as this is needed for international numbers.\n\t *\n\t * Ex: '+1 (123) 456 7879'\n\t */\n\tprivate readonly plusSign: boolean = false; // 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 properties for the Match\n\t * instance, specified in an Object (map).\n\t */\n\tconstructor( cfg: PhoneMatchConfig ) {\n\t\tsuper( cfg );\n\n\t\tthis.number = cfg.number;\n\t\tthis.plusSign = cfg.plusSign;\n\t}\n\n\n\t/**\n\t * Returns a string name for the type of match that this class represents.\n\t * For the case of PhoneMatch, returns 'phone'.\n\t *\n\t * @return {String}\n\t */\n\tgetType() {\n\t\treturn 'phone';\n\t}\n\n\n\t/**\n\t * Returns the phone number that was matched as a string, without any \n\t * delimiter characters. \n\t *\n\t * Note: This is a string to allow for prefixed 0's.\n\t *\n\t * @return {String}\n\t */\n\tgetPhoneNumber() {\n\t\treturn this.number;\n\t}\n\n\n\t/**\n\t * Alias of {@link #getPhoneNumber}, returns the phone number that was \n\t * matched as a string, without any delimiter characters.\n\t *\n\t * Note: This is a string to allow for prefixed 0's.\n\t *\n\t * @return {String}\n\t */\n\tgetNumber() {\n\t\treturn this.getPhoneNumber();\n\t}\n\n\n\t/**\n\t * Returns the anchor href that should be generated for the match.\n\t *\n\t * @return {String}\n\t */\n\tgetAnchorHref() {\n\t\treturn 'tel:' + ( this.plusSign ? '+' : '' ) + this.number;\n\t}\n\n\n\t/**\n\t * Returns the anchor text that should be generated for the match.\n\t *\n\t * @return {String}\n\t */\n\tgetAnchorText() {\n\t\treturn this.matchedText;\n\t}\n\n}\n\n\nexport interface PhoneMatchConfig extends MatchConfig {\n\tnumber: string;\n\tplusSign: boolean;\n}"]}