UNPKG

vue-files-preview-inno

Version:

A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.

1 lines 27.1 kB
{"version":3,"file":"index.mjs","sources":["../../../../node_modules/linkify-it/index.mjs"],"sourcesContent":["import reFactory from './lib/re.mjs'\n\n//\n// Helpers\n//\n\n// Merge objects\n//\nfunction assign (obj /* from1, from2, from3, ... */) {\n const sources = Array.prototype.slice.call(arguments, 1)\n\n sources.forEach(function (source) {\n if (!source) { return }\n\n Object.keys(source).forEach(function (key) {\n obj[key] = source[key]\n })\n })\n\n return obj\n}\n\nfunction _class (obj) { return Object.prototype.toString.call(obj) }\nfunction isString (obj) { return _class(obj) === '[object String]' }\nfunction isObject (obj) { return _class(obj) === '[object Object]' }\nfunction isRegExp (obj) { return _class(obj) === '[object RegExp]' }\nfunction isFunction (obj) { return _class(obj) === '[object Function]' }\n\nfunction escapeRE (str) { return str.replace(/[.?*+^$[\\]\\\\(){}|-]/g, '\\\\$&') }\n\n//\n\nconst defaultOptions = {\n fuzzyLink: true,\n fuzzyEmail: true,\n fuzzyIP: false\n}\n\nfunction isOptionsObj (obj) {\n return Object.keys(obj || {}).reduce(function (acc, k) {\n /* eslint-disable-next-line no-prototype-builtins */\n return acc || defaultOptions.hasOwnProperty(k)\n }, false)\n}\n\nconst defaultSchemas = {\n 'http:': {\n validate: function (text, pos, self) {\n const tail = text.slice(pos)\n\n if (!self.re.http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.http = new RegExp(\n '^\\\\/\\\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'\n )\n }\n if (self.re.http.test(tail)) {\n return tail.match(self.re.http)[0].length\n }\n return 0\n }\n },\n 'https:': 'http:',\n 'ftp:': 'http:',\n '//': {\n validate: function (text, pos, self) {\n const tail = text.slice(pos)\n\n if (!self.re.no_http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.no_http = new RegExp(\n '^' +\n self.re.src_auth +\n // Don't allow single-level domains, because of false positives like '//test'\n // with code comments\n '(?:localhost|(?:(?:' + self.re.src_domain + ')\\\\.)+' + self.re.src_domain_root + ')' +\n self.re.src_port +\n self.re.src_host_terminator +\n self.re.src_path,\n\n 'i'\n )\n }\n\n if (self.re.no_http.test(tail)) {\n // should not be `://` & `///`, that protects from errors in protocol name\n if (pos >= 3 && text[pos - 3] === ':') { return 0 }\n if (pos >= 3 && text[pos - 3] === '/') { return 0 }\n return tail.match(self.re.no_http)[0].length\n }\n return 0\n }\n },\n 'mailto:': {\n validate: function (text, pos, self) {\n const tail = text.slice(pos)\n\n if (!self.re.mailto) {\n self.re.mailto = new RegExp(\n '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'\n )\n }\n if (self.re.mailto.test(tail)) {\n return tail.match(self.re.mailto)[0].length\n }\n return 0\n }\n }\n}\n\n// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)\n/* eslint-disable-next-line max-len */\nconst tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'\n\n// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead\nconst tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|')\n\nfunction resetScanCache (self) {\n self.__index__ = -1\n self.__text_cache__ = ''\n}\n\nfunction createValidator (re) {\n return function (text, pos) {\n const tail = text.slice(pos)\n\n if (re.test(tail)) {\n return tail.match(re)[0].length\n }\n return 0\n }\n}\n\nfunction createNormalizer () {\n return function (match, self) {\n self.normalize(match)\n }\n}\n\n// Schemas compiler. Build regexps.\n//\nfunction compile (self) {\n // Load & clone RE patterns.\n const re = self.re = reFactory(self.__opts__)\n\n // Define dynamic patterns\n const tlds = self.__tlds__.slice()\n\n self.onCompile()\n\n if (!self.__tlds_replaced__) {\n tlds.push(tlds_2ch_src_re)\n }\n tlds.push(re.src_xn)\n\n re.src_tlds = tlds.join('|')\n\n function untpl (tpl) { return tpl.replace('%TLDS%', re.src_tlds) }\n\n re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i')\n re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i')\n re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i')\n re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i')\n\n //\n // Compile each schema\n //\n\n const aliases = []\n\n self.__compiled__ = {} // Reset compiled data\n\n function schemaError (name, val) {\n throw new Error('(LinkifyIt) Invalid schema \"' + name + '\": ' + val)\n }\n\n Object.keys(self.__schemas__).forEach(function (name) {\n const val = self.__schemas__[name]\n\n // skip disabled methods\n if (val === null) { return }\n\n const compiled = { validate: null, link: null }\n\n self.__compiled__[name] = compiled\n\n if (isObject(val)) {\n if (isRegExp(val.validate)) {\n compiled.validate = createValidator(val.validate)\n } else if (isFunction(val.validate)) {\n compiled.validate = val.validate\n } else {\n schemaError(name, val)\n }\n\n if (isFunction(val.normalize)) {\n compiled.normalize = val.normalize\n } else if (!val.normalize) {\n compiled.normalize = createNormalizer()\n } else {\n schemaError(name, val)\n }\n\n return\n }\n\n if (isString(val)) {\n aliases.push(name)\n return\n }\n\n schemaError(name, val)\n })\n\n //\n // Compile postponed aliases\n //\n\n aliases.forEach(function (alias) {\n if (!self.__compiled__[self.__schemas__[alias]]) {\n // Silently fail on missed schemas to avoid errons on disable.\n // schemaError(alias, self.__schemas__[alias]);\n return\n }\n\n self.__compiled__[alias].validate =\n self.__compiled__[self.__schemas__[alias]].validate\n self.__compiled__[alias].normalize =\n self.__compiled__[self.__schemas__[alias]].normalize\n })\n\n //\n // Fake record for guessed links\n //\n self.__compiled__[''] = { validate: null, normalize: createNormalizer() }\n\n //\n // Build schema condition\n //\n const slist = Object.keys(self.__compiled__)\n .filter(function (name) {\n // Filter disabled & fake schemas\n return name.length > 0 && self.__compiled__[name]\n })\n .map(escapeRE)\n .join('|')\n // (?!_) cause 1.5x slowdown\n self.re.schema_test = RegExp('(^|(?!_)(?:[><\\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i')\n self.re.schema_search = RegExp('(^|(?!_)(?:[><\\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig')\n self.re.schema_at_start = RegExp('^' + self.re.schema_search.source, 'i')\n\n self.re.pretest = RegExp(\n '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@',\n 'i'\n )\n\n //\n // Cleanup\n //\n\n resetScanCache(self)\n}\n\n/**\n * class Match\n *\n * Match result. Single element of array, returned by [[LinkifyIt#match]]\n **/\nfunction Match (self, shift) {\n const start = self.__index__\n const end = self.__last_index__\n const text = self.__text_cache__.slice(start, end)\n\n /**\n * Match#schema -> String\n *\n * Prefix (protocol) for matched string.\n **/\n this.schema = self.__schema__.toLowerCase()\n /**\n * Match#index -> Number\n *\n * First position of matched string.\n **/\n this.index = start + shift\n /**\n * Match#lastIndex -> Number\n *\n * Next position after matched string.\n **/\n this.lastIndex = end + shift\n /**\n * Match#raw -> String\n *\n * Matched string.\n **/\n this.raw = text\n /**\n * Match#text -> String\n *\n * Notmalized text of matched string.\n **/\n this.text = text\n /**\n * Match#url -> String\n *\n * Normalized url of matched string.\n **/\n this.url = text\n}\n\nfunction createMatch (self, shift) {\n const match = new Match(self, shift)\n\n self.__compiled__[match.schema].normalize(match, self)\n\n return match\n}\n\n/**\n * class LinkifyIt\n **/\n\n/**\n * new LinkifyIt(schemas, options)\n * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Creates new linkifier instance with optional additional schemas.\n * Can be called without `new` keyword for convenience.\n *\n * By default understands:\n *\n * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links\n * - \"fuzzy\" links and emails (example.com, foo@bar.com).\n *\n * `schemas` is an object, where each key/value describes protocol/rule:\n *\n * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`\n * for example). `linkify-it` makes shure that prefix is not preceeded with\n * alphanumeric char and symbols. Only whitespaces and punctuation allowed.\n * - __value__ - rule to check tail after link prefix\n * - _String_ - just alias to existing rule\n * - _Object_\n * - _validate_ - validator function (should return matched length on success),\n * or `RegExp`.\n * - _normalize_ - optional function to normalize text & url of matched result\n * (for example, for @twitter mentions).\n *\n * `options`:\n *\n * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.\n * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts\n * like version numbers. Default `false`.\n * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.\n *\n **/\nfunction LinkifyIt (schemas, options) {\n if (!(this instanceof LinkifyIt)) {\n return new LinkifyIt(schemas, options)\n }\n\n if (!options) {\n if (isOptionsObj(schemas)) {\n options = schemas\n schemas = {}\n }\n }\n\n this.__opts__ = assign({}, defaultOptions, options)\n\n // Cache last tested result. Used to skip repeating steps on next `match` call.\n this.__index__ = -1\n this.__last_index__ = -1 // Next scan position\n this.__schema__ = ''\n this.__text_cache__ = ''\n\n this.__schemas__ = assign({}, defaultSchemas, schemas)\n this.__compiled__ = {}\n\n this.__tlds__ = tlds_default\n this.__tlds_replaced__ = false\n\n this.re = {}\n\n compile(this)\n}\n\n/** chainable\n * LinkifyIt#add(schema, definition)\n * - schema (String): rule name (fixed pattern prefix)\n * - definition (String|RegExp|Object): schema definition\n *\n * Add new rule definition. See constructor description for details.\n **/\nLinkifyIt.prototype.add = function add (schema, definition) {\n this.__schemas__[schema] = definition\n compile(this)\n return this\n}\n\n/** chainable\n * LinkifyIt#set(options)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Set recognition options for links without schema.\n **/\nLinkifyIt.prototype.set = function set (options) {\n this.__opts__ = assign(this.__opts__, options)\n return this\n}\n\n/**\n * LinkifyIt#test(text) -> Boolean\n *\n * Searches linkifiable pattern and returns `true` on success or `false` on fail.\n **/\nLinkifyIt.prototype.test = function test (text) {\n // Reset scan cache\n this.__text_cache__ = text\n this.__index__ = -1\n\n if (!text.length) { return false }\n\n let m, ml, me, len, shift, next, re, tld_pos, at_pos\n\n // try to scan for link with schema - that's the most simple rule\n if (this.re.schema_test.test(text)) {\n re = this.re.schema_search\n re.lastIndex = 0\n while ((m = re.exec(text)) !== null) {\n len = this.testSchemaAt(text, m[2], re.lastIndex)\n if (len) {\n this.__schema__ = m[2]\n this.__index__ = m.index + m[1].length\n this.__last_index__ = m.index + m[0].length + len\n break\n }\n }\n }\n\n if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {\n // guess schemaless links\n tld_pos = text.search(this.re.host_fuzzy_test)\n if (tld_pos >= 0) {\n // if tld is located after found link - no need to check fuzzy pattern\n if (this.__index__ < 0 || tld_pos < this.__index__) {\n if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {\n shift = ml.index + ml[1].length\n\n if (this.__index__ < 0 || shift < this.__index__) {\n this.__schema__ = ''\n this.__index__ = shift\n this.__last_index__ = ml.index + ml[0].length\n }\n }\n }\n }\n }\n\n if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {\n // guess schemaless emails\n at_pos = text.indexOf('@')\n if (at_pos >= 0) {\n // We can't skip this check, because this cases are possible:\n // 192.168.1.1@gmail.com, my.in@example.com\n if ((me = text.match(this.re.email_fuzzy)) !== null) {\n shift = me.index + me[1].length\n next = me.index + me[0].length\n\n if (this.__index__ < 0 || shift < this.__index__ ||\n (shift === this.__index__ && next > this.__last_index__)) {\n this.__schema__ = 'mailto:'\n this.__index__ = shift\n this.__last_index__ = next\n }\n }\n }\n }\n\n return this.__index__ >= 0\n}\n\n/**\n * LinkifyIt#pretest(text) -> Boolean\n *\n * Very quick check, that can give false positives. Returns true if link MAY BE\n * can exists. Can be used for speed optimization, when you need to check that\n * link NOT exists.\n **/\nLinkifyIt.prototype.pretest = function pretest (text) {\n return this.re.pretest.test(text)\n}\n\n/**\n * LinkifyIt#testSchemaAt(text, name, position) -> Number\n * - text (String): text to scan\n * - name (String): rule (schema) name\n * - position (Number): text offset to check from\n *\n * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly\n * at given position. Returns length of found pattern (0 on fail).\n **/\nLinkifyIt.prototype.testSchemaAt = function testSchemaAt (text, schema, pos) {\n // If not supported schema check requested - terminate\n if (!this.__compiled__[schema.toLowerCase()]) {\n return 0\n }\n return this.__compiled__[schema.toLowerCase()].validate(text, pos, this)\n}\n\n/**\n * LinkifyIt#match(text) -> Array|null\n *\n * Returns array of found link descriptions or `null` on fail. We strongly\n * recommend to use [[LinkifyIt#test]] first, for best speed.\n *\n * ##### Result match description\n *\n * - __schema__ - link schema, can be empty for fuzzy links, or `//` for\n * protocol-neutral links.\n * - __index__ - offset of matched text\n * - __lastIndex__ - index of next char after mathch end\n * - __raw__ - matched text\n * - __text__ - normalized text\n * - __url__ - link, generated from matched text\n **/\nLinkifyIt.prototype.match = function match (text) {\n const result = []\n let shift = 0\n\n // Try to take previous element from cache, if .test() called before\n if (this.__index__ >= 0 && this.__text_cache__ === text) {\n result.push(createMatch(this, shift))\n shift = this.__last_index__\n }\n\n // Cut head if cache was used\n let tail = shift ? text.slice(shift) : text\n\n // Scan string until end reached\n while (this.test(tail)) {\n result.push(createMatch(this, shift))\n\n tail = tail.slice(this.__last_index__)\n shift += this.__last_index__\n }\n\n if (result.length) {\n return result\n }\n\n return null\n}\n\n/**\n * LinkifyIt#matchAtStart(text) -> Match|null\n *\n * Returns fully-formed (not fuzzy) link if it starts at the beginning\n * of the string, and null otherwise.\n **/\nLinkifyIt.prototype.matchAtStart = function matchAtStart (text) {\n // Reset scan cache\n this.__text_cache__ = text\n this.__index__ = -1\n\n if (!text.length) return null\n\n const m = this.re.schema_at_start.exec(text)\n if (!m) return null\n\n const len = this.testSchemaAt(text, m[2], m[0].length)\n if (!len) return null\n\n this.__schema__ = m[2]\n this.__index__ = m.index + m[1].length\n this.__last_index__ = m.index + m[0].length + len\n\n return createMatch(this, 0)\n}\n\n/** chainable\n * LinkifyIt#tlds(list [, keepOld]) -> this\n * - list (Array): list of tlds\n * - keepOld (Boolean): merge with current list if `true` (`false` by default)\n *\n * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)\n * to avoid false positives. By default this algorythm used:\n *\n * - hostname with any 2-letter root zones are ok.\n * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф\n * are ok.\n * - encoded (`xn--...`) root zones are ok.\n *\n * If list is replaced, then exact match for 2-chars root zones will be checked.\n **/\nLinkifyIt.prototype.tlds = function tlds (list, keepOld) {\n list = Array.isArray(list) ? list : [list]\n\n if (!keepOld) {\n this.__tlds__ = list.slice()\n this.__tlds_replaced__ = true\n compile(this)\n return this\n }\n\n this.__tlds__ = this.__tlds__.concat(list)\n .sort()\n .filter(function (el, idx, arr) {\n return el !== arr[idx - 1]\n })\n .reverse()\n\n compile(this)\n return this\n}\n\n/**\n * LinkifyIt#normalize(match)\n *\n * Default normalizer (if schema does not define it's own).\n **/\nLinkifyIt.prototype.normalize = function normalize (match) {\n // Do minimal possible changes by default. Need to collect feedback prior\n // to move forward https://github.com/markdown-it/linkify-it/issues/1\n\n if (!match.schema) { match.url = 'http://' + match.url }\n\n if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {\n match.url = 'mailto:' + match.url\n }\n}\n\n/**\n * LinkifyIt#onCompile()\n *\n * Override to modify basic RegExp-s.\n **/\nLinkifyIt.prototype.onCompile = function onCompile () {\n}\n\nexport default LinkifyIt\n"],"names":["assign","obj","source","key","_class","isString","isObject","isRegExp","isFunction","escapeRE","str","defaultOptions","isOptionsObj","acc","k","defaultSchemas","text","pos","self","tail","tlds_2ch_src_re","tlds_default","resetScanCache","createValidator","re","createNormalizer","match","compile","reFactory","tlds","untpl","tpl","aliases","schemaError","name","val","compiled","alias","slist","Match","shift","start","end","createMatch","LinkifyIt","schemas","options","schema","definition","m","ml","me","len","next","tld_pos","at_pos","result","list","keepOld","el","idx","arr"],"mappings":";AAQA,SAASA,EAAQC,GAAoC;AAGnD,SAFgB,MAAM,UAAU,MAAM,KAAK,WAAW,CAAC,EAE/C,QAAQ,SAAUC,GAAQ;AAChC,IAAKA,KAEL,OAAO,KAAKA,CAAM,EAAE,QAAQ,SAAUC,GAAK;AACzC,MAAAF,EAAIE,CAAG,IAAID,EAAOC,CAAG;AAAA,IACvB,CAAC;AAAA,EACH,CAAC,GAEMF;AACT;AAEA,SAASG,EAAQH,GAAK;AAAE,SAAO,OAAO,UAAU,SAAS,KAAKA,CAAG;AAAE;AACnE,SAASI,EAAUJ,GAAK;AAAE,SAAOG,EAAOH,CAAG,MAAM;AAAkB;AACnE,SAASK,EAAUL,GAAK;AAAE,SAAOG,EAAOH,CAAG,MAAM;AAAkB;AACnE,SAASM,EAAUN,GAAK;AAAE,SAAOG,EAAOH,CAAG,MAAM;AAAkB;AACnE,SAASO,EAAYP,GAAK;AAAE,SAAOG,EAAOH,CAAG,MAAM;AAAoB;AAEvE,SAASQ,EAAUC,GAAK;AAAE,SAAOA,EAAI,QAAQ,wBAAwB,MAAM;AAAE;AAI7E,MAAMC,IAAiB;AAAA,EACrB,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AACX;AAEA,SAASC,EAAcX,GAAK;AAC1B,SAAO,OAAO,KAAKA,KAAO,CAAA,CAAE,EAAE,OAAO,SAAUY,GAAKC,GAAG;AAErD,WAAOD,KAAOF,EAAe,eAAeG,CAAC;AAAA,EAC/C,GAAG,EAAK;AACV;AAEA,M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