linktree/node_modules/preact-render-to-string/dist/jsx/commonjs.js

3 lines
11 KiB
JavaScript
Raw Normal View History

2025-06-16 13:37:14 +02:00
var t=require("preact");if("function"!=typeof Symbol){var e=0;Symbol=function(t){return"@@"+t+ ++e},Symbol.for=function(t){return"@@"+t}}var n=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,r=/[\s\n\\/='"\0<>]/,o=/^(xlink|xmlns|xml)([A-Z])/,i=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,a=/^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/,c=/["&<]/;function l(t){if(0===t.length||!1===c.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 s=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},u=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},f={},p=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"]),d=/[A-Z]/g;function g(t){var e="";for(var n in t){var r=t[n];if(null!=r&&""!==r){var o="-"==n[0]?n:f[n]||(f[n]=n.replace(d,"-$&").toLowerCase()),i=";";"number"!=typeof r||o.startsWith("--")||p.has(o)||(i="px;"),e=e+o+":"+r+i}}return e||void 0}function y(t,e){return Array.isArray(e)?e.reduce(y,t):null!=e&&!1!==e&&t.push(e),t}function v(){this.__d=!0}function b(t,e){return{__v:t,context:e,props:t.props,setState:v,forceUpdate:v,__d:!0,__h:new Array(0)}}function m(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var h=[],_=[];function x(e,n,r,o){var i=t.options.__s;t.options.__s=!0;try{return j(e,n||{},r,o)}finally{t.options.__c&&t.options.__c(e,_),t.options.__s=i,_.length=0}}function j(e,c,f,p,d,v){if(null==e||"boolean"==typeof e)return"";if("object"!=typeof e)return"function"==typeof e?"":l(e+"");var h=f.pretty,_=h&&"string"==typeof h?h:"\t";if(Array.isArray(e)){for(var x="",k=0;k<e.length;k++)h&&k>0&&(x+="\n"),x+=j(e[k],c,f,p,d,v);return x}if(void 0!==e.constructor)return"";t.options.__b&&t.options.__b(e);var w,A=e.type,O=e.props,F=!1;if("function"==typeof A){if(F=!0,!f.shallow||!p&&!1!==f.renderRootComponent||A===t.Fragment){if(A===t.Fragment){var C=[];return y(C,e.props.children),j(C,c,f,!1!==f.shallowHighOrder,d,v)}var E,M=e.__c=b(e,c),$=t.options.__r;if(A.prototype&&"function"==typeof A.prototype.render){var H=m(A,c);(M=e.__c=new A(O,H)).__v=e,M._dirty=M.__d=!0,M.props=O,null==M.state&&(M.state={}),null==M._nextState&&null==M.__s&&(M._nextState=M.__s=M.state),M.context=H,A.getDerivedStateFromProps?M.state=Object.assign({},M.state,A.getDerivedStateFromProps(M.props,M.state)):M.componentWillMount&&(M.componentWillMount(),M.state=M._nextState!==M.state?M._nextState:M.__s!==M.state?M.__s:M.state),$&&$(e),E=M.render(M.props,M.state,M.context)}else for(var L=m(A,c),I=0;M.__d&&I++<25;)M.__d=!1,$&&$(e),E=A.call(e.__c,O,L);M.getChildContext&&(c=Object.assign({},c,M.getChildContext()));var N=j(E,c,f,!1!==f.shallowHighOrder,d,v);return t.options.diffed&&t.options.diffed(e),N}A=(w=A).displayName||w!==Function&&w.name||S(w)}var D,W,T="<"+A;if(O){var U=Object.keys(O);f&&!0===f.sortAttributes&&U.sort();for(var Z=0;Z<U.length;Z++){var P=U[Z],R=O[P];if("children"!==P){if(!r.test(P)&&(f&&f.allAttributes||"key"!==P&&"ref"!==P&&"__self"!==P&&"__source"!==P)){if("defaultValue"===P)P="value";else if("defaultChecked"===P)P="checked";else if("defaultSele
//# sourceMappingURL=index.js.map