"use strict";!function(e,t){var n=function(t){function n(e,t,n){var r=n[n.length-1];e.replaceChild(r,t);for(var a=n.length-2;a>=0;a--)e.insertBefore(n[a],r),r=n[a]}function r(e,t,n){for(var r=[],a=e,i=Array.isArray(a),o=0,a=i?a:a[Symbol.iterator]();;){var l;if(i){if(o>=a.length)break;l=a[o++]}else{if(o=a.next(),o.done)break;l=o.value}var s=l;if("nl"===s.type&&t.nl2br)r.push(n.createElement("br"));else if(s.isLink&&t.check(s)){var f=t.resolve(s),c=f.formatted,u=f.formattedHref,d=f.tagName,h=f.className,v=f.target,m=f.events,g=f.attributes,p=n.createElement(d);if(p.setAttribute("href",u),h&&p.setAttribute("class",h),v&&p.setAttribute("target",v),g)for(var b in g)p.setAttribute(b,g[b]);if(m)for(var y in m)p.addEventListener?p.addEventListener(y,m[y]):p.attachEvent&&p.attachEvent("on"+y,m[y]);p.appendChild(n.createTextNode(c)),r.push(p)}else r.push(n.createTextNode(s.toString()))}return r}function a(e,t,i){if(!e||e.nodeType!==c)throw new Error("Cannot linkify "+e+" - Invalid DOM Node type");var s=t.ignoreTags;if("A"===e.tagName||l.contains(s,e.tagName))return e;for(var d=e.firstChild;d;){switch(d.nodeType){case c:a(d,t,i);break;case u:var h=d.nodeValue,v=o(h);if(0===v.length||1===v.length&&v[0]instanceof f)break;var m=r(v,t,i);n(e,d,m),d=m[m.length-1]}d=d.nextSibling}return e}function i(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{r=r||document||e&&e.document||global&&global.document}catch(i){}if(!r)throw new Error("Cannot find document implementation. If you are in a non-browser environment like Node.js, pass the document implementation as the third argument to linkifyElement.");return n=new s(n),a(t,n,r)}var o=t.tokenize,l=t.options,s=l.Options,f=t.parser.TOKENS.TEXT,c=1,u=3;return i.helper=a,i.normalize=function(e){return new s(e)},i}(t);e.linkifyElement=n}(window,linkify);