-var e={},t=[],n=[];function r(r,o){var i,a,l,p,s=n;for(p=arguments.length;p-- >2;)t.push(arguments[p]);for(o&&null!=o.children&&(t.length||t.push(o.children),delete o.children);t.length;)if((a=t.pop())&&void 0!==a.pop)for(p=a.length;p--;)t.push(a[p]);else"boolean"==typeof a&&(a=null),(l="function"!=typeof r)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(l=!1)),l&&i?s[s.length-1]+=a:s===n?s=[a]:s.push(a),i=l;var c=new function(){};return c.nodeName=r,c.children=s,c.attributes=null==o?void 0:o,c.key=null==o?void 0:o.key,void 0!==e.vnode&&e.vnode(c),c}function o(e,t){for(var n in t)e[n]=t[n];return e}var i="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,a=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,l=[];function p(t){!t._dirty&&(t._dirty=!0)&&1==l.push(t)&&(e.debounceRendering||i)(s)}function s(){var e,t=l;for(l=[];e=t.pop();)e._dirty&&U(e)}function c(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function u(e){var t=o({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function d(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===a.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var l=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,v,l):e.removeEventListener(t,v,l),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(e){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var p=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?p?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(p?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function v(t){return this._listeners[t.type](e.event&&e.event(t)||t)}var _=[],m=0,h=!1,b=!1;function y(){for(var t;t=_.pop();)e.afterMount&&e.afterMount(t),t.componentDidMount&&t.componentDidMount()}function g(e,t,n,r,o,i){m++||(h=null!=o&&void 0!==o.ownerSVGElement,b=null!=e&&!("__preactattr_"in e));var a=C(e,t,n,r,i);return o&&a.parentNode!==o&&o.appendChild(a),--m||(b=!1,i||y()),a}function C(e,t,n,r,o){var i=e,a=h;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||o)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),x(e,!0))),i.__preactattr_=!0,i;var l,p,s=t.nodeName;if("function"==typeof s)return function(e,t,n,r){var o=e&&e._component,i=o,a=e,l=o&&e._componentConstructor===t.nodeName,p=l,s=u(t);for(;o&&!p&&(o=o._parentComponent);)p=o.constructor===t.nodeName;o&&p&&(!r||o._component)?(T(o,s,3,n,r),e=o.base):(i&&!l&&($(i),e=a=null),o=k(t.nodeName,s,n),e&&!o.nextBase&&(o.nextBase=e,a=null),T(o,s,1,n,r),e=o.base,a&&e!==a&&(a._component=null,x(a,!1)));return e}(e,t,n,r);if(h="svg"===s||"foreignObject"!==s&&h,s=String(s),(!e||!c(e,s))&&(l=s,(p=h?document.createElementNS("http://www.w3.org/2000/svg",l):document.createElement(l)).normalizedNodeName=l,i=p,e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),x(e,!0)}var v=i.firstChild,_=i.__preactattr_,m=t.children;if(null==_){_=i.__preactattr_={};for(var y=i.attributes,g=y.length;g--;)_[y[g].name]=y[g].value}return!b&&m&&1===m.length&&"string"==typeof m[0]&&null!=v&&void 0!==v.splitText&&null==v.nextSibling?v.nodeValue!=m[0]&&(v.nodeValue=m[0]):(m&&m.length||null!=v)&&function(e,t,n,r,o){var i,a,l,p,s,u=e.childNodes,d=[],v={},_=0,m=0,h=u.length,b=0,y=t?t.length:0;if(0!==h)for(var g=0;g<h;g++){var N=u[g],w=N.__preactattr_,k=y&&w?N._component?N._component.__key:w.key:null;null!=k?(_++,v[k]=N):(w||(void 0!==N.splitText?!o||N.nodeValue.trim():o))&&(d[b++]=N)}if(0!==y)for(var g=0;g<y;g++){s=null;var k=(p=t[g]).key;if(null!=k)_&&void 0!==v[k]&&(s=v[k],v[k]=void 0,_--);else if(!s&&m<b)for(i=m;i<b;i++)if(void 0!==d[i]&&(S=a=d[i],U=o,"string"==typeof(T=p)||"number"==typeof T?void 0!==S.splitText:"string"==typeof T.nodeName?!S._componentConstructor&&c(S,T.nodeName):U||S._componentConstructor===T.nodeName)){s=a,d[i]=void 0,i===b-1&&b--,i===m&&m++;break}s=C(s,p,n,r),l=u[g],s&&s!==e&&s!==l&&(null==l?e.appendChild(s):s===l.nextSibling?f(l):e.insertBefore(s,l))}var S,T,U;if(_)for(var g in v)void 0!==v[g]&&x(v[g],!1);for(;m<=b;)void 0!==(s=d[b--])&&x(s,!1)}(i,m,n,r,b||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||d(e,r,n[r],n[r]=void 0,h);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||d(e,r,n[r],n[r]=t[r],h)}(i,t.attributes,_),h=a,i}function x(e,t){var n=e._component;n?$(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||f(e),N(e))}function N(e){for(e=e.lastChild;e;){var t=e.previousSibling;x(e,!0),e=t}}var w={};function k(e,t,n){var r,o=w[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),L.call(r,t,n)):((r=new L(t,n)).constructor=e,r.render=S),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.nextBase=o[i].nextBase,o.splice(i,1);break}return r}function S(e,t,n){return this.constructor(e,n)}function T(t,n,r,o,i){t._disable||(t._disable=!0,(t.__ref=n.ref)&&delete n.ref,(t.__key=n.key)&&delete n.key,!t.base||i?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(n,o),o&&o!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=o),t.prevProps||(t.prevProps=t.props),t.props=n,t._disable=!1,0!==r&&(1!==r&&!1===e.syncComponentUpdates&&t.base?p(t):U(t,1,i)),t.__ref&&t.__ref(t))}function U(t,n,r,i){if(!t._disable){var a,l,p,s=t.props,c=t.state,f=t.context,d=t.prevProps||s,v=t.prevState||c,h=t.prevContext||f,b=t.base,C=t.nextBase,N=b||C,w=t._component,S=!1;if(b&&(t.props=d,t.state=v,t.context=h,2!==n&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(s,c,f)?S=!0:t.componentWillUpdate&&t.componentWillUpdate(s,c,f),t.props=s,t.state=c,t.context=f),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!S){a=t.render(s,c,f),t.getChildContext&&(f=o(o({},f),t.getChildContext()));var L,M,B=a&&a.nodeName;if("function"==typeof B){var P=u(a);(l=w)&&l.constructor===B&&P.key==l.__key?T(l,P,1,f,!1):(L=l,t._component=l=k(B,P,f),l.nextBase=l.nextBase||C,l._parentComponent=t,T(l,P,0,f,!1),U(l,1,r,!0)),M=l.base}else p=N,(L=w)&&(p=t._component=null),(N||1===n)&&(p&&(p._component=null),M=g(p,a,f,r||!b,N&&N.parentNode,!0));if(N&&M!==N&&l!==w){var W=N.parentNode;W&&M!==W&&(W.replaceChild(M,N),L||(N._component=null,x(N,!1)))}if(L&&$(L),t.base=M,M&&!i){for(var A=t,E=t;E=E._parentComponent;)(A=E).base=M;M._component=A,M._componentConstructor=A.constructor}}if(!b||r?_.unshift(t):S||(t.componentDidUpdate&&t.componentDidUpdate(d,v,h),e.afterUpdate&&e.afterUpdate(t)),null!=t._renderCallbacks)for(;t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);m||i||y()}}function $(t){e.beforeUnmount&&e.beforeUnmount(t);var n=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var r=t._component;r?$(r):n&&(n.__preactattr_&&n.__preactattr_.ref&&n.__preactattr_.ref(null),t.nextBase=n,f(n),function(e){var t=e.constructor.name;(w[t]||(w[t]=[])).push(e)}(t),N(n)),t.__ref&&t.__ref(null)}function L(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{}}o(L.prototype,{setState:function(e,t){var n=this.state;this.prevState||(this.prevState=o({},n)),o(n,"function"==typeof e?e(n,this.props):e),t&&(this._renderCallbacks=this._renderCallbacks||[]).push(t),p(this)},forceUpdate:function(e){e&&(this._renderCallbacks=this._renderCallbacks||[]).push(e),U(this,2)},render:function(){}});var M=new Map,B=document.createElement("template"),P=/(\$_h\[\d+\])/g;function W(e,t){var n=t.$_h;t.$_h=function(e,t,n){return g(n,e,{},!1,t,!1)}(e,t,n&&n._component&&n._component.base||n||t.firstChild)}function A(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];var o=M.get(e);return null==o&&M.set(e,o=function(e){var t="",n=0;for(;n<e.length;)0!==n&&(t+="$_h["+(n-1)+"]"),t+=e[n++];return B.innerHTML=t.replace(/<(\$_h\[\d+\])/g,"<c@ c@=$1").replace(/<\/\$_h\[\d+\]/g,"</c@").replace(/<([a-z0-9:@-]+)(\s.*?)?\/>/gi,"<$1$2></$1>").trim(),new Function("$_h","h","return "+function e(t){if(1!==t.nodeType)return 3===t.nodeType&&t.data?E(t.data.trim(),","):"null";for(var n,r,o="h("+(t.getAttribute("c@")||'"'+t.localName+'"')+",",i=0;i<t.attributes.length;i++)"c@"!=(r=t.attributes[i].name)&&(o+=void 0===n?"{":",",n=t.attributes[i].value,o+='"'+r.replace(/^on-/,"on")+'":'+(n?E(n,"+"):"true"));o+=void 0===n?"null":"}";for(var a=t.firstChild;a;)o+=","+e(a),a=a.nextSibling;return o+")"}((B.content||B).firstChild))}(e)),o(t,r)}function E(e,t){var n=e.match(P),r=JSON.stringify(e);if(null!=n){if(n[0]===e)return e;r=r.replace(P,'"'+t+"$1"+t+'"').replace(/"[+,]"/g,""),","===t&&(r="["+r+"]")}return r}export{W as render,r as h,L as Component,A as html};
0 commit comments