!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("preact")):"function"==typeof define&&define.amd?define(["preact"],t):e.preactMarkup=t(e.preact)}(this,function(e){"use strict";function t(e,t){var n=void 0,o="html"===t?"text/html":"application/xml",i=void 0,a=void 0,p=void 0;"html"===t?(p="body",a="\n"+e+""):(p="xml",a='\n'+e+"");try{n=(new DOMParser).parseFromString(a,o)}catch(e){i=e}if(n||"html"!==t||(n=s||(s=r()),n.open(),n.write(a),n.close()),n){var l=n.getElementsByTagName(p)[0],u=l.firstChild;return e&&!u&&(l.error="Document parse failed."),u&&"parsererror"===String(u.nodeName).toLowerCase()&&(u.removeChild(u.firstChild),u.removeChild(u.lastChild),l.error=u.textContent||u.nodeValue||i||"Unknown error",l.removeChild(u)),l}}function r(){if(document.implementation&&document.implementation.createHTMLDocument)return document.implementation.createHTMLDocument("");var e=document.createElement("iframe");return e.style.cssText="position:absolute; left:0; top:-999em; width:1px; height:1px; overflow:hidden;",e.setAttribute("sandbox","allow-forms"),document.body.appendChild(e),e.contentWindow.document}function n(e,t,r,n){return o.visitor=t,o.h=r,o.options=n||c,o(e)}function o(e,t,r){if(3===e.nodeType){var n="textContent"in e?e.textContent:e.nodeValue||"";if(o.options.trim!==!1){var p=0===t||t===r.length-1;if(n=n.match(/^[\s\n]+$/g)&&"all"!==o.options.trim?" ":n.replace(/(^[\s\n]+|[\s\n]+$)/g,"all"===o.options.trim||p?"":" "),(!n||" "===n)&&r.length>1&&p)return null}return n}if(1!==e.nodeType)return null;var l=String(e.nodeName).toLowerCase();if("script"===l&&!o.options.allowScripts)return null;var u=o.h(l,i(e.attributes),a(e.childNodes));return o.visitor&&o.visitor(u),u}function i(e){var t=e&&e.length;if(!t)return null;for(var r={},n=0;n=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},y=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},w=void 0,b=function(t){function r(){return d(this,r),y(this,t.apply(this,arguments))}return v(r,t),r.setReviver=function(e){w=e},r.prototype.shouldComponentUpdate=function(e){var t=e.wrap,r=e.type,n=e.markup,o=this.props;return t!==o.wrap||r!==o.type||n!==o.markup},r.prototype.setComponents=function(e){if(this.map={},e)for(var t in e)if(e.hasOwnProperty(t)){var r=t.replace(/([A-Z]+)([A-Z][a-z0-9])|([a-z0-9]+)([A-Z])/g,"$1$3-$2$4").toLowerCase();this.map[r]=e[t]}},r.prototype.render=function(t){var r=t.wrap,n=void 0===r||r,o=t.type,i=t.markup,a=t.components,l=t.reviver,u=t.onError,s=t["allow-scripts"],c=t["allow-events"],m=t.trim,f=h(t,["wrap","type","markup","components","reviver","onError","allow-scripts","allow-events","trim"]),d=l||this.reviver||this.constructor.prototype.reviver||w||e.h,v=void 0;this.setComponents(a);var y={allowScripts:s,allowEvents:c,trim:m};try{v=p(i,o,d,this.map,y)}catch(e){u?u({error:e}):"undefined"!=typeof console&&console.error&&console.error("preact-markup: "+e)}if(n===!1)return v&&v[0]||null;var b=f.hasOwnProperty("className")?"className":"class",C=f[b];return C?C.splice?C.splice(0,0,"markup"):"string"==typeof C?f[b]+=" markup":"object"==typeof C&&(C.markup=!0):f[b]="markup",d("div",f,v||null)},r}(e.Component);return b}); //# sourceMappingURL=preact-markup.min.js.map