import{options as t,Fragment as e}from"preact";if("function"!=typeof Symbol){let t=0;Symbol=function(e){return`@@${e}${++t}`},Symbol.for=t=>`@@${t}`}const n=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,r=/[&<>"]/;function o(t){const e=String(t);return r.test(e)?e.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""):e}let i=(t,e)=>String(t).replace(/(\n+)/g,"$1"+(e||"\t")),l=(t,e,n)=>String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<");const c={};function u(t){let e="";for(let r in t){let o=t[r];null!=o&&""!==o&&(e&&(e+=" "),e+="-"==r[0]?r:c[r]||(c[r]=r.replace(/([A-Z])/g,"-$1").toLowerCase()),e+=": ",e+=o,"number"==typeof o&&!1===n.test(r)&&(e+="px"),e+=";")}return e||void 0}function s(t,e){for(let n in e)t[n]=e[n];return t}function a(t,e){return Array.isArray(e)?e.reduce(a,t):null!=e&&!1!==e&&t.push(e),t}const f={shallow:!0},p=[],y=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,g=/[\s\n\\/='"\0<>]/,b=()=>{};d.render=d;const m=[];function d(e,n,r){n=n||{},r=r||{};const o=t.__s;t.__s=!0;const i=_(e,n,r);return t.__c&&t.__c(e,m),m.length=0,t.__s=o,i}function _(n,r,c,f,m,d){if(null==n||"boolean"==typeof n)return"";if("object"!=typeof n)return o(n);let h=c.pretty,x=h&&"string"==typeof h?h:"\t";if(Array.isArray(n)){let t="";for(let e=0;e0&&(t+="\n"),t+=_(n[e],r,c,f,m,d);return t}let j=n.type,S=n.props,A=!1;if("function"==typeof j){if(A=!0,!c.shallow||!f&&!1!==c.renderRootComponent){if(j===e){const t=[];return a(t,n.props.children),_(t,r,c,!1!==c.shallowHighOrder,m,d)}{let e,o=n.__c={__v:n,context:r,props:n.props,setState:b,forceUpdate:b,__h:[]};if(t.__b&&t.__b(n),t.__r&&t.__r(n),j.prototype&&"function"==typeof j.prototype.render){let t=j.contextType,i=t&&r[t.__c],l=null!=t?i?i.props.value:t.__:r;o=n.__c=new j(S,l),o.__v=n,o._dirty=o.__d=!0,o.props=S,null==o.state&&(o.state={}),null==o._nextState&&null==o.__s&&(o._nextState=o.__s=o.state),o.context=l,j.getDerivedStateFromProps?o.state=s(s({},o.state),j.getDerivedStateFromProps(o.props,o.state)):o.componentWillMount&&(o.componentWillMount(),o.state=o._nextState!==o.state?o._nextState:o.__s!==o.state?o.__s:o.state),e=o.render(o.props,o.state,o.context)}else{let t=j.contextType,o=t&&r[t.__c];e=j.call(n.__c,S,null!=t?o?o.props.value:t.__:r)}return o.getChildContext&&(r=s(s({},r),o.getChildContext())),t.diffed&&t.diffed(n),_(e,r,c,!1!==c.shallowHighOrder,m,d)}}j=(O=j).displayName||O!==Function&&O.name||function(t){let e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){let n=-1;for(let e=p.length;e--;)if(p[e]===t){n=e;break}n<0&&(n=p.push(t)-1),e=`UnnamedComponent${n}`}return e}(O)}var O;let w,$,k="<"+j;if(S){let t=Object.keys(S);c&&!0===c.sortAttributes&&t.sort();for(let e=0;e",g.test(j))throw new Error(`${j} is not a valid HTML tag name in ${k}`);let v,F=y.test(j)||c.voidElements&&c.voidElements.test(j),E=[];if($)h&&l($)&&($="\n"+x+i($,x)),k+=$;else if(null!=w&&a(v=[],w).length){let t=h&&~k.indexOf("\n"),e=!1;for(let n=0;n0&&"<"!=n[0];e&&t?E[E.length-1]+=n:E.push(n),e=t}else E.push(n)}}if(h&&t)for(let t=E.length;t--;)E[t]="\n"+x+i(E[t],x)}if(E.length||$)k+=E.join("");else if(c&&c.xml)return k.substring(0,k.length-1)+" />";return!F||v||$?(h&&~k.indexOf("\n")&&(k+="\n"),k+=``):k=k.replace(/>$/," />"),k}d.shallowRender=(t,e)=>d(t,e,f);const h=/(\\|\"|\')/g,x=Object.prototype.toString,j=Date.prototype.toISOString,S=Error.prototype.toString,A=RegExp.prototype.toString,O=Symbol.prototype.toString,w=/^Symbol\((.*)\)(.*)$/,$=/\n/gi,k=Object.getOwnPropertySymbols||(t=>[]);function v(t){return"[object Array]"===t||"[object ArrayBuffer]"===t||"[object DataView]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object Int8Array]"===t||"[object Int16Array]"===t||"[object Int32Array]"===t||"[object Uint8Array]"===t||"[object Uint8ClampedArray]"===t||"[object Uint16Array]"===t||"[object Uint32Array]"===t}function F(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function E(t){return O.call(t).replace(w,"Symbol($1)")}function C(t){return"["+S.call(t)+"]"}function M(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";const e=typeof t;if("number"===e)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===e)return'"'+function(t){return t.replace(h,"\\$1")}(t)+'"';if("function"===e)return F(t);if("symbol"===e)return E(t);const n=x.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?F(t,min):"[object Symbol]"===n?E(t):"[object Date]"===n?j.call(t):"[object Error]"===n?C(t):"[object RegExp]"===n?A.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":v(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&C(t)}function N(t,e,n,r,o,i,l,c,u,s){let a="";if(t.length){a+=o;const f=n+e;for(let n=0;n-1)return"[Circular]";i.push(t);const a=++c>l;if(!a&&t.toJSON&&"function"==typeof t.toJSON)return I(t.toJSON(),e,n,r,o,i,l,c,u,s);const f=x.call(t);return"[object Arguments]"===f?a?"[Arguments]":function(t,e,n,r,o,i,l,c,u,s){return(s?"":"Arguments ")+N(t,e,n,r,o,i,l,c,u,s)}(t,e,n,r,o,i,l,c,u,s):v(f)?a?"[Array]":function(t,e,n,r,o,i,l,c,u,s){return(s?"":t.constructor.name+" ")+N(t,e,n,r,o,i,l,c,u,s)}(t,e,n,r,o,i,l,c,u,s):"[object Map]"===f?a?"[Map]":function(t,e,n,r,o,i,l,c,u,s){let a="Map {";const f=t.entries();let p=f.next();if(!p.done){a+=o;const t=n+e;for(;!p.done;)a+=t+I(p.value[0],e,t,r,o,i,l,c,u,s)+" => "+I(p.value[1],e,t,r,o,i,l,c,u,s),p=f.next(),p.done||(a+=","+r);a+=o+n}return a+"}"}(t,e,n,r,o,i,l,c,u,s):"[object Set]"===f?a?"[Set]":function(t,e,n,r,o,i,l,c,u,s){let a="Set {";const f=t.entries();let p=f.next();if(!p.done){a+=o;const t=n+e;for(;!p.done;)a+=t+I(p.value[1],e,t,r,o,i,l,c,u,s),p=f.next(),p.done||(a+=","+r);a+=o+n}return a+"}"}(t,e,n,r,o,i,l,c,u,s):"object"==typeof t?a?"[Object]":function(t,e,n,r,o,i,l,c,u,s){let a=(s?"":t.constructor?t.constructor.name+" ":"Object ")+"{",f=Object.keys(t).sort();const p=k(t);if(p.length&&(f=f.filter(t=>!("symbol"==typeof t||"[object Symbol]"===x.call(t))).concat(p)),f.length){a+=o;const p=n+e;for(let n=0;nt&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t,print:(t,e,n)=>d(t,L.context,L.opts)},P={plugins:[L]},T={attributeHook:function(t,e,n,r,l){let c=typeof e;if("dangerouslySetInnerHTML"===t)return!1;if(null==e||"function"===c&&!r.functions)return"";if(r.skipFalseAttributes&&!l&&(!1===e||("class"===t||"style"===t)&&""===e))return"";let u="string"==typeof r.pretty?r.pretty:"\t";return"string"!==c?("function"!==c||r.functionNames?(L.context=n,L.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!U.hasOwnProperty(t))throw new Error("prettyFormat: Invalid option: "+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error("prettyFormat: Cannot run with min option and indent")}(e),e=function(t){const e={};return Object.keys(U).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:U[n]),e.min&&(e.indent=0),e}(e)):e=U;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=W(e.indent),r=[];var l=H(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(l)return l}return M(t)||(n||(n=W(e.indent)),r||(r=[]),D(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,P)).indexOf("\n")&&(e=`${i("\n"+e,u)}\n`)):e="Function",i(`\n${t}={${e}}`,u)):`\n${u}${t}="${o(e)}"`},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function R(t,e,n,r){return d(t,e,n=s(s({},T),n||{}))}export default R;export{R as render}; //# sourceMappingURL=jsx.modern.js.map