site/node_modules/preact-render-to-string/dist/jsx.umd.js

3 lines
11 KiB
JavaScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("preact")):"function"==typeof define&&define.amd?define(["exports","preact"],e):e((t||self).preactRenderToString={},t.preact)}(this,function(t,e){if("function"!=typeof Symbol){var n=0;Symbol=function(t){return"@@"+t+ ++n},Symbol.for=function(t){return"@@"+t}}var r=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,o=/[\s\n\\/='"\0<>]/,i=/^(xlink|xmlns|xml)([A-Z])/,a=/^accessK|^auto[A-Z]|^ch|^col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|readO|rowS|spellC|src[A-Z]|tabI|item[A-Z]/,c=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,s=/["&<]/;function l(t){if(0===t.length||!1===s.test(t))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 60:o="&lt;";break;default:continue}n!==e&&(r+=t.slice(e,n)),r+=o,e=n+1}return n!==e&&(r+=t.slice(e,n)),r}var u=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},f=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},p={},d=new Set(["animation-iteration-count","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","fill-opacity","flex","flex-grow","flex-negative","flex-order","flex-positive","flex-shrink","flood-opacity","font-weight","grid-column","grid-row","line-clamp","line-height","opacity","order","orphans","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","widows","z-index","zoom"]),g=/[A-Z]/g;function y(t){var e="";for(var n in t){var r=t[n];if(null!=r&&""!==r){var o="-"==n[0]?n:p[n]||(p[n]=n.replace(g,"-$&").toLowerCase()),i=";";"number"!=typeof r||o.startsWith("--")||d.has(o)||(i="px;"),e=e+o+":"+r+i}}return e||void 0}function b(t,e){return Array.isArray(e)?e.reduce(b,t):null!=e&&!1!==e&&t.push(e),t}function h(){this.__d=!0}function m(t,e){return{__v:t,context:e,props:t.props,setState:h,forceUpdate:h,__d:!0,__h:[]}}var v=[],_=[];function x(t,n,r,o){var i=e.options.__s;e.options.__s=!0;try{return j(t,n||{},r,o)}finally{e.options.__c&&e.options.__c(t,_),e.options.__s=i,_.length=0}}function j(t,n,s,p,d,g){if(null==t||"boolean"==typeof t)return"";if("object"!=typeof t)return"function"==typeof t?"":l(t+"");var h=s.pretty,v=h&&"string"==typeof h?h:"\t";if(Array.isArray(t)){for(var _="",x=0;x<t.length;x++)h&&x>0&&(_+="\n"),_+=j(t[x],n,s,p,d,g);return _}if(void 0!==t.constructor)return"";e.options.__b&&e.options.__b(t);var k,w=t.type,A=t.props,O=!1;if("function"==typeof w){if(O=!0,!s.shallow||!p&&!1!==s.renderRootComponent){if(w===e.Fragment){var C=[];return b(C,t.props.children),j(C,n,s,!1!==s.shallowHighOrder,d,g)}var F,E=t.__c=m(t,n),$=e.options.__r,H=n,L=w.contextType;if(null!=L){var M=n[L.__c];H=M?M.props.value:L.__}if(w.prototype&&"function"==typeof w.prototype.render)(E=t.__c=new w(A,H)).__v=t,E._dirty=E.__d=!0,E.props=A,null==E.state&&(E.state={}),null==E._nextState&&null==E.__s&&(E._nextState=E.__s=E.state),E.context=H,w.getDerivedStateFromProps?E.state=Object.assign({},E.state,w.getDerivedStateFromProps(E.props,E.state)):E.componentWillMount&&(E.componentWillMount(),E.state=E._nextState!==E.state?E._nextState:E.__s!==E.state?E.__s:E.state),$&&$(t),F=E.render(E.props,E.state,E.context);else for(var I=0;E.__d&&I++<25;)E.__d=!1,$&&$(t),F=w.call(t.__c,A,H);E.getChildContext&&(n=Object.assign({},n,E.getChildContext()));var N=j(F,n,s,!1!==s.shallowHighOrder,d,g);return e.options.diffed&&e.options.diffed(t),N}w=(k=w).displayName||k!==Function&&k.name||S(k)}var T,D,W="<"+w;if(A){var R=Object.keys(A);s&&!0===s.sortAttributes&&R.sort();for(var U=0;U<R.length;U++){var Z=R[U],P=A[Z];if("children"!==Z){if(!o.test(Z)&&(s&&s.allAttributes||"key"!==Z&&"ref"!=
//# sourceMappingURL=jsx.umd.js.map