/*! * Autolinker.js * 3.14.2 * * Copyright(c) 2020 Gregory Jacobs * MIT License * * https://github.com/gregjacobs/Autolinker.js */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Autolinker=t()}(this,function(){"use strict";function s(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var u=0,r=e.length;u",this.getInnerHtml(),""].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var u in e)e.hasOwnProperty(u)&&t.push(u+'="'+e[u]+'"');return t.join(" ")},e);function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}function c(e,t,i){function u(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function r(e,t){var u=t/2,r=Math.ceil(u),n=-1*Math.floor(u),a="";return n<0&&(a=e.substr(n)),e.substr(0,r)+i+a}var n,a=null==i?(i="…",n=3,8):(n=i.length,i.length);if(e.length<=t)return e;var s,o,c,h,l=t-n,p=(s={},(c=(o=e).match(/^([a-z]+):\/\//i))&&(s.scheme=c[1],o=o.substr(c[0].length)),(c=o.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(s.host=c[1],o=o.substr(c[0].length)),(c=o.match(/^\/(.*?)(?=(\?|#|$))/i))&&(s.path=c[1],o=o.substr(c[0].length)),(c=o.match(/^\?(.*?)(?=(#|$))/i))&&(s.query=c[1],o=o.substr(c[0].length)),(c=o.match(/^#(.*?)$/i))&&(s.fragment=c[1]),s);if(!p.query||(h=p.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i))&&(p.query=p.query.substr(0,h[1].length),e=u(p)),e.length<=t)return e;if(p.host&&(p.host=p.host.replace(/^www\./,""),e=u(p)),e.length<=t)return e;var g="";if(p.host&&(g+=p.host),g.length>=l)return p.host.length==t?(p.host.substr(0,t-n)+i).substr(0,l+a):r(g,l).substr(0,l+a);var d="";if(p.path&&(d+="/"+p.path),p.query&&(d+="?"+p.query),d){if(l<=(g+d).length)return(g+d).length==t?(g+d).substr(0,t):(g+r(d,l-g.length)).substr(0,l+a);g+=d}if(p.fragment){var f="#"+p.fragment;if(l<=(g+f).length)return(g+f).length==t?(g+f).substr(0,t):(g+r(f,l-g.length)).substr(0,l+a);else g+=f}if(p.scheme&&p.host){var m=p.scheme+"://";if((g+m).lengthn&&(i=null==a?(a="…",3):a.length,r=r.substring(0,n-i)+a),r)},n);function n(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}var a=(i.prototype.getMatchedText=function(){return this.matchedText},i.prototype.setOffset=function(e){this.offset=e},i.prototype.getOffset=function(){return this.offset},i.prototype.getCssClassSuffixes=function(){return[this.getType()]},i.prototype.buildTag=function(){return this.tagBuilder.build(this)},i); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */function i(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var u in t)t.hasOwnProperty(u)&&(e[u]=t[u])})(e,t)};function h(e,t){function u(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(u.prototype=t.prototype,new u)}var l,R=function(){return(R=Object.assign||function(e){for(var t,u=1,r=arguments.length;u"!==(d=k)&&q.test(d)?C=3:T();break;case 3:g=k,S.test(g)?(E=new we(R({},E,{name:j()})),C=4):"<"===g?M():"/"===g?(E=new we(R({},E,{name:j()})),C=12):">"===g?(E=new we(R({},E,{name:j()})),P()):q.test(g)||N.test(g)||":"===g||T();break;case 4:p=k,S.test(p)||("/"===p?C=12:">"===p?P():"<"===p?M():"="===p||O.test(p)||H.test(p)?T():C=5);break;case 5:l=k,S.test(l)?C=6:"/"===l?C=12:"="===l?C=7:">"===l?P():"<"===l?M():O.test(l)&&T();break;case 6:h=k,S.test(h)||("/"===h?C=12:"="===h?C=7:">"===h?P():"<"===h?M():O.test(h)?T():C=5);break;case 7:c=k,S.test(c)||('"'===c?C=8:"'"===c?C=9:/[>=`]/.test(c)?T():"<"===c?M():C=10);break;case 8:'"'===k&&(C=11);break;case 9:"'"===k&&(C=11);break;case 10:o=k,S.test(o)?C=4:">"===o?P():"<"===o&&M();break;case 11:s=k,S.test(s)?C=4:"/"===s?C=12:">"===s?P():"<"===s?M():(C=4,w--);break;case 12:">"===k?(E=new we(R({},E,{isClosing:!0})),P()):C=4;break;case 13:"--"===t.substr(w,2)?(w+=2,E=new we(R({},E,{type:"comment"})),C=14):"DOCTYPE"===t.substr(w,7).toUpperCase()?(w+=7,E=new we(R({},E,{type:"doctype"})),C=20):T();break;case 14:"-"===(i=k)?C=15:">"===i?T():C=16;break;case 15:"-"===(a=k)?C=18:">"===a?T():C=16;break;case 16:"-"===k&&(C=17);break;case 17:C="-"===k?18:16;break;case 18:">"===(n=k)?P():"!"===n?C=19:"-"===n||(C=16);break;case 19:"-"===(r=k)?C=17:">"===r?P():C=16;break;case 20:">"===(u=k)?P():"<"===u&&M();break;default:z(C)}w++}function T(){C=0,E=v}function M(){C=1,E=new we({idx:w})}function P(){var e=t.slice(D,E.idx);e&&x(e,D),"comment"===E.type?y(E.idx):"doctype"===E.type?F(E.idx):(E.isOpening&&A(E.name,E.idx),E.isClosing&&b(E.name,E.idx)),T(),D=w+1}function j(){var e=E.idx+(E.isClosing?2:1);return t.slice(e,w).toLowerCase()}Dn?t:t+1;e.splice(i,1);continue}e[t+1].getOffset()/g,">"));for(var t=this.parse(e),u=[],r=0,n=0,a=t.length;n