transformers-regressions / dana /third_party /linkify /linkify-element.amd.min.js
Félix Marty
add dana
3f268e5
define("linkify-element",["module","exports","./linkify"],function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function a(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 i(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),u=f.formatted,d=f.formattedHref,c=f.tagName,h=f.className,v=f.target,m=f.events,p=f.attributes,g=n.createElement(c);if(g.setAttribute("href",d),h&&g.setAttribute("class",h),v&&g.setAttribute("target",v),p)for(var b in p)g.setAttribute(b,p[b]);if(m)for(var y in m)g.addEventListener?g.addEventListener(y,m[y]):g.attachEvent&&g.attachEvent("on"+y,m[y]);g.appendChild(n.createTextNode(u)),r.push(g)}else r.push(n.createTextNode(s.toString()))}return r}function o(e,t,n){if(!e||e.nodeType!==v)throw new Error("Cannot linkify "+e+" - Invalid DOM Node type");var r=t.ignoreTags;if("A"===e.tagName||d.contains(r,e.tagName))return e;for(var l=e.firstChild;l;){switch(l.nodeType){case v:o(l,t,n);break;case m:var s=l.nodeValue,f=u(s);if(0===f.length||1===f.length&&f[0]instanceof h)break;var c=i(f,t,n);a(e,l,c),l=c[c.length-1]}l=l.nextSibling}return e}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{n=n||document||window&&window.document||global&&global.document}catch(r){}if(!n)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 t=new c(t),o(e,t,n)}try{try{Object.defineProperty(t,"__esModule",{value:!0})}catch(s){t.__esModule=!0}}catch(s){t.__esModule=!0}var f=r(n),u=f.tokenize,d=f.options,c=d.Options,h=f.parser.TOKENS.TEXT,v=1,m=3;l.helper=o,l.normalize=function(e){return new c(e)},t["default"]=l,e.exports=t["default"]});