bewcloud/public/js/preact@10.28.4/denonext/hooks.mjs

3 lines
3.6 KiB
JavaScript
Raw Permalink Normal View History

/* esm.sh - preact@10.28.4/hooks */
import{options as V}from"./preact.mjs";var c,e,d,g,v=0,T=[],o=V,C=o.__b,A=o.__r,D=o.diffed,F=o.__c,k=o.unmount,q=o.__;function m(t,_){o.__h&&o.__h(e,t,v||_),v=0;var u=e.__H||(e.__H={__:[],__h:[]});return t>=u.__.length&&u.__.push({}),u.__[t]}function B(t){return v=1,I(E,t)}function I(t,_,u){var n=m(c++,2);if(n.t=t,!n.__c&&(n.__=[u?u(_):E(void 0,_),function(f){var a=n.__N?n.__N[0]:n.__[0],s=n.t(a,f);a!==s&&(n.__N=[s,n.__[1]],n.__c.setState({}))}],n.__c=e,!e.__f)){var i=function(f,a,s){if(!n.__c.__H)return!0;var h=n.__c.__H.__.filter(function(r){return r.__c});if(h.every(function(r){return!r.__N}))return!l||l.call(this,f,a,s);var b=n.__c.props!==f;return h.some(function(r){if(r.__N){var P=r.__[0];r.__=r.__N,r.__N=void 0,P!==r.__[0]&&(b=!0)}}),l&&l.call(this,f,a,s)||b};e.__f=!0;var l=e.shouldComponentUpdate,N=e.componentWillUpdate;e.componentWillUpdate=function(f,a,s){if(this.__e){var h=l;l=void 0,i(f,a,s),l=h}N&&N.call(this,f,a,s)},e.shouldComponentUpdate=i}return n.__N||n.__}function w(t,_){var u=m(c++,3);!o.__s&&y(u.__H,_)&&(u.__=t,u.u=_,e.__H.__h.push(u))}function R(t,_){var u=m(c++,4);!o.__s&&y(u.__H,_)&&(u.__=t,u.u=_,e.__h.push(u))}function z(t){return v=5,U(function(){return{current:t}},[])}function L(t,_,u){v=6,R(function(){if(typeof t=="function"){var n=t(_());return function(){t(null),n&&typeof n=="function"&&n()}}if(t)return t.current=_(),function(){return t.current=null}},u==null?u:u.concat(t))}function U(t,_){var u=m(c++,7);return y(u.__H,_)&&(u.__=t(),u.__H=_,u.__h=t),u.__}function M(t,_){return v=8,U(function(){return t},_)}function G(t){var _=e.context[t.__c],u=m(c++,9);return u.c=t,_?(u.__==null&&(u.__=!0,_.sub(e)),_.props.value):t.__}function J(t,_){o.useDebugValue&&o.useDebugValue(_?_(t):t)}function K(t){var _=m(c++,10),u=B();return _.__=t,e.componentDidCatch||(e.componentDidCatch=function(n,i){_.__&&_.__(n,i),u[1](n)}),[u[0],function(){u[1](void 0)}]}function O(){var t=m(c++,11);if(!t.__){for(var _=e.__v;_!==null&&!_.__m&&_.__!==null;)_=_.__;var u=_.__m||(_.__m=[0,0]);t.__="P"+u[0]+"-"+u[1]++}return t.__}function S(){for(var t;t=T.shift();){var _=t.__H;if(t.__P&&_)try{_.__h.some(p),_.__h.some(H),_.__h=[]}catch(u){_.__h=[],o.__e(u,t.__v)}}}o.__b=function(t){e=null,C&&C(t)},o.__=function(t,_){t&&_.__k&&_.__k.__m&&(t.__m=_.__k.__m),q&&q(t,_)},o.__r=function(t){A&&A(t),c=0;var _=(e=t.__c).__H;_&&(d===e?(_.__h=[],e.__h=[],_.__.some(function(u){u.__N&&(u.__=u.__N),u.u=u.__N=void 0})):(_.__h.some(p),_.__h.some(H),_.__h=[],c=0)),d=e},o.diffed=function(t){D&&D(t);var _=t.__c;_&&_.__H&&(_.__H.__h.length&&(T.push(_)!==1&&g===o.requestAnimationFrame||((g=o.requestAnimationFrame)||W)(S)),_.__H.__.some(function(u){u.u&&(u.__H=u.u),u.u=void 0})),d=e=null},o.__c=function(t,_){_.some(function(u){try{u.__h.some(p),u.__h=u.__h.filter(function(n){return!n.__||H(n)})}catch(n){_.some(function(i){i.__h&&(i.__h=[])}),_=[],o.__e(n,u.__v)}}),F&&F(t,_)},o.unmount=function(t){k&&k(t);var _,u=t.__c;u&&u.__H&&(u.__H.__.some(function(n){try{p(n)}catch(i){_=i}}),u.__H=void 0,_&&o.__e(_,u.__v))};var x=typeof requestAnimationFrame=="function";function W(t){var _,u=function(){clearTimeout(n),x&&cancelAnimationFrame(_),setTimeout(t)},n=setTimeout(u,35);x&&(_=requestAnimationFrame(u))}function p(t){var _=e,u=t.__c;typeof u=="function"&&(t.__c=void 0,u()),e=_}function H(t){var _=e;t.__c=t.__(),e=_}function y(t,_){return!t||t.length!==_.length||_.some(function(u,n){return u!==t[n]})}function E(t,_){return typeof _=="function"?_(t):_}export{M as useCallback,G as useContext,J as useDebugValue,w as useEffect,K as useErrorBoundary,O as useId,L as useImperativeHandle,R as useLayoutEffect,U as useMemo,I as useReducer,z as useRef,B as useState};
//hooks.mjs.map