"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 i=n.length-2;i>=0;i--)e.insertBefore(n[i],r),r=n[i]}function r(e,t,n){for(var r=[],i=0;i<e.length;i++){var o=e[i],a=o.isLink&&l.resolve(t.validate,o.toString(),o.type);if(o.isLink&&a){var s=o.toHref(t.defaultProtocol),f=l.resolve(t.format,o.toString(),o.type),v=l.resolve(t.formatHref,s,o.type),u=l.resolve(t.attributes,s,o.type),c=l.resolve(t.tagName,s,o.type),d=l.resolve(t.linkClass,s,o.type),p=l.resolve(t.target,s,o.type),h=l.resolve(t.events,s,o.type),m=n.createElement(c);if(m.setAttribute("href",v),m.setAttribute("class",d),p&&m.setAttribute("target",p),u)for(var g in u)m.setAttribute(g,u[g]);if(h)for(var y in h)m.addEventListener?m.addEventListener(y,h[y]):m.attachEvent&&m.attachEvent("on"+y,h[y]);m.appendChild(n.createTextNode(f)),r.push(m)}else"nl"===o.type&&t.nl2br?r.push(n.createElement("br")):r.push(n.createTextNode(o.toString()))}return r}function i(e,t,o){if(!e||e.nodeType!==s)throw new Error("Cannot linkify "+e+" - Invalid DOM Node type");var v=t.ignoreTags;if("A"===e.tagName||l.contains(v,e.tagName))return e;for(var u=e.firstChild;u;){switch(u.nodeType){case s:i(u,t,o);break;case f:var c=u.nodeValue,d=a(c),p=r(d,t,o);n(e,u,p),u=p[p.length-1]}u=u.nextSibling}return e}function o(t,n){var r=arguments.length<=2||void 0===arguments[2]?null:arguments[2];try{r=r||e&&e.document||global&&global.document}catch(o){}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=l.normalize(n),i(t,n,r)}var a=t.tokenize,l=t.options,s=1,f=3;return o.helper=i,o.normalize=l.normalize,o}(t);e.linkifyElement=n}(window,linkify);