site/node_modules/preact/compat/dist/compat.umd.js

3 lines
11 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("preact"),require("preact/hooks")):"function"==typeof define&&define.amd?define(["exports","preact","preact/hooks"],e):e((n||self).preactCompat={},n.preact,n.preactHooks)}(this,function(n,e,t){function r(n,e){for(var t in n)if("__source"!==t&&!(t in e))return!0;for(var r in e)if("__source"!==r&&n[r]!==e[r])return!0;return!1}function u(n,e){this.props=n,this.context=e}function o(n,t){function u(n){var e=this.props.ref,u=e==n.ref;return!u&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!u:r(this.props,n)}function o(t){return this.shouldComponentUpdate=u,e.createElement(n,t)}return o.displayName="Memo("+(n.displayName||n.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(u.prototype=new e.Component).isPureReactComponent=!0,u.prototype.shouldComponentUpdate=function(n,e){return r(this.props,n)||r(this.state,e)};var i=e.options.__b;e.options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),i&&i(n)};var c="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function f(n){function e(e){if(!("ref"in e))return n(e,null);var t=e.ref;delete e.ref;var r=n(e,t);return e.ref=t,r}return e.$$typeof=c,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(n.displayName||n.name)+")",e}var l=function(n,t){return null==n?null:e.toChildArray(e.toChildArray(n).map(t))},a={map:l,forEach:l,count:function(n){return n?e.toChildArray(n).length:0},only:function(n){var t=e.toChildArray(n);if(1!==t.length)throw"Children.only";return t[0]},toArray:e.toChildArray},s=e.options.__e;e.options.__e=function(n,e,t,r){if(n.then)for(var u,o=e;o=o.__;)if((u=o.__c)&&u.__c)return null==e.__e&&(e.__e=t.__e,e.__k=t.__k),u.__c(n,e);s(n,e,t,r)};var h=e.options.unmount;function d(n,e,t){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c()}),n.__c.__H=null),null!=(n=function(n,e){for(var t in e)n[t]=e[t];return n}({},n)).__c&&(n.__c.__P===t&&(n.__c.__P=e),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return d(n,e,t)})),n}function v(n,e,t){return n&&t&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return v(n,e,t)}),n.__c&&n.__c.__P===e&&(n.__e&&t.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=t)),n}function p(){this.__u=0,this.t=null,this.__b=null}function m(n){var e=n.__.__c;return e&&e.__a&&e.__a(n)}function b(n){var t,r,u;function o(o){if(t||(t=n()).then(function(n){r=n.default||n},function(n){u=n}),u)throw u;if(!r)throw t;return e.createElement(r,o)}return o.displayName="Lazy",o.__f=!0,o}function y(){this.u=null,this.o=null}e.options.unmount=function(n){var e=n.__c;e&&e.__R&&e.__R(),e&&32&n.__u&&(n.type=null),h&&h(n)},(p.prototype=new e.Component).__c=function(n,e){var t=e.__c,r=this;null==r.t&&(r.t=[]),r.t.push(t);var u=m(r.__v),o=!1,i=function(){o||(o=!0,t.__R=null,u?u(c):c())};t.__R=i;var c=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=v(n,n.__c.__P,n.__c.__O)}var e;for(r.setState({__a:r.__b=null});e=r.t.pop();)e.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i)},p.prototype.componentWillUnmount=function(){this.t=[]},p.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),u=this.__v.__k[0].__c;this.__v.__k[0]=d(this.__b,r,u.__O=u.__P)}this.__b=null}var o=t.__a&&e.createElement(e.Fragment,null,n.fallback);return o&&(o.__u&=-33),[e.createElement(e.Fragment,null,t.__a?null:n.children),o]};var _=function(n,e,t){if(++t[1]===t[0]&&n.o.delete(e),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(t=n.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;n.u=t=t[2]}};function g(n){return this.getChildContext=function(){return n.context},n.children}function S(n){var t=this,r=n.i;t.componentWillUnmount=function(){e.render(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],contains:function(){return!0},appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n)},insertBefore:
//# sourceMappingURL=compat.umd.js.map