From 1ecc3fc5bd9188b06a6fdd71c4dc058eb4e4c024 Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Wed, 15 May 2024 09:19:10 -0400 Subject: [PATCH] add preact items back in --- bundled/preact/compat.js | 19 +------------------ bundled/preact/hooks.js | 6 ------ bundled/preact/preact.js | 3 --- bundled/preact/signals.js | 15 ++++++++++++--- bundled/preact/{to-string.js => ssr.mjs} | 5 ++++- deno.jsonc | 8 +++----- run-browser.tsx | 3 ++- run-local.tsx | 2 +- run-serve.tsx | 6 +++--- 9 files changed, 26 insertions(+), 41 deletions(-) delete mode 100644 bundled/preact/hooks.js delete mode 100644 bundled/preact/preact.js rename bundled/preact/{to-string.js => ssr.mjs} (97%) diff --git a/bundled/preact/compat.js b/bundled/preact/compat.js index 16afcb6..a17e299 100644 --- a/bundled/preact/compat.js +++ b/bundled/preact/compat.js @@ -1,19 +1,2 @@ /// -/* esm.sh - esbuild bundle(preact@10.20.2/compat) es2022 production */ -import{Component as f,createElement as c,options as i,toChildArray as _,Fragment as d,render as m,hydrate as W,createContext as $,createRef as H,cloneElement as z} -from"./preact.js"; - -export {createElement as jsx, createElement as jsxs, createElement as h} from "./preact.js"; - -import{Component as Ve,Fragment as We,createContext as $e,createElement as He,createRef as ze} -from"./preact.js"; - -import{useState as D,useId as B,useReducer as j,useEffect as I,useLayoutEffect as E,useRef as Y,useImperativeHandle as Z,useMemo as q,useCallback as G,useContext as J,useDebugValue as K} -from"./hooks.js"; - -export*from -"./hooks.js"; - -function L(e,t){for(var n in t)e[n]=t[n];return e}function b(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function C(e,t){this.props=e,this.context=t}function Q(e,t){function n(o){var a=this.props.ref,u=a==o.ref;return!u&&a&&(a.call?a(null):a.current=null),t?!t(this.props,o)||!u:b(this.props,o)}function r(o){return this.shouldComponentUpdate=n,c(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(C.prototype=new f).isPureReactComponent=!0,C.prototype.shouldComponentUpdate=function(e,t){return b(this.props,e)||b(this.state,t)};var N=i.__b;i.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),N&&N(e)};var X=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ee(e){function t(n){var r=L({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=X,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var R=function(e,t){return e==null?null:_(_(e).map(t))},te={map:R,forEach:R,count:function(e){return e?_(e).length:0},only:function(e){var t=_(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:_},ne=i.__e;i.__e=function(e,t,n,r){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}ne(e,t,n,r)};var x=i.unmount;function T(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=L({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return T(r,t,n)})),e}function M(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return M(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function h(){this.__u=0,this.t=null,this.__b=null}function A(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function re(e){var t,n,r;function o(a){if(t||(t=e()).then(function(u){n=u.default||u},function(u){r=u}),r)throw r;if(!n)throw t;return c(n,a)}return o.displayName="Lazy",o.__f=!0,o}function p(){this.u=null,this.o=null}i.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),x&&x(e)},(h.prototype=new f).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=A(r.__v),a=!1,u=function(){a||(a=!0,n.__R=null,o?o(l):l())};n.__R=u;var l=function(){if(!--r.__u){if(r.state.__a){var s=r.state.__a;r.__v.__k[0]=M(s,s.__c.__P,s.__c.__O)}var g;for(r.setState({__a:r.__b=null});g=r.t.pop();)g.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(u,u)},h.prototype.componentWillUnmount=function(){this.t=[]},h.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=T(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&c(d,null,e.fallback);return o&&(o.__u&=-33),[c(d,null,t.__a?null:e.children),o]};var k=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(r)}}),m(c(oe,{context:t.context},e.__v),t.l)}function ue(e,t){var n=c(ae,{__v:e,i:t});return n.containerInfo=t,n}(p.prototype=new f).__a=function(e){var t=this,n=A(t.__v),r=t.o.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),k(t,e,r)):o()};n?n(a):a()}},p.prototype.render=function(e){this.u=null,this.o=new Map;var t=_(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},p.prototype.componentDidUpdate=p.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){k(e,n,t)})};var F=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,ie=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,le=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,se=/[A-Z0-9]/g,_e=typeof document<"u",ce=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function fe(e,t,n){return t.__k==null&&(t.textContent=""),m(e,t),typeof n=="function"&&n(),e?e.__c:null}function pe(e,t,n){return W(e,t),typeof n=="function"&&n(),e?e.__c:null}f.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(f.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var O=i.event;function de(){}function he(){return this.cancelBubble}function me(){return this.defaultPrevented}i.event=function(e){return O&&(e=O(e)),e.persist=de,e.isPropagationStopped=he,e.isDefaultPrevented=me,e.nativeEvent=e};var S,ve={enumerable:!1,configurable:!0,get:function(){return this.class}},P=i.vnode;i.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var a in n){var u=n[a];if(!(a==="value"&&"defaultValue"in n&&u==null||_e&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&u===!0?u="":l==="translate"&&u==="no"?u=!1:l==="ondoubleclick"?a="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||ce(n.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":le.test(a)?a=l:r.indexOf("-")===-1&&ie.test(a)?a=a.replace(se,"-$&").toLowerCase():u===null&&(u=void 0):l=a="oninput",l==="oninput"&&o[a=l]&&(a="oninputCapture"),o[a]=u}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=_(n.children).forEach(function(s){s.props.selected=o.value.indexOf(s.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=_(n.children).forEach(function(s){s.props.selected=o.multiple?o.defaultValue.indexOf(s.props.value)!=-1:o.defaultValue==s.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",ve)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=F,P&&P(e)};var w=i.__r;i.__r=function(e){w&&w(e),S=e.__c};var U=i.diffed;i.diffed=function(e){U&&U(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),S=null};var ye={ReactCurrentDispatcher:{current:{readContext:function(e){return S.__n[e.__c].props.value}}}},Te="17.0.2";function be(e){return c.bind(null,e)}function v(e){return!!e&&e.$$typeof===F}function Ce(e){return v(e)&&e.type===d}function Ee(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Se(e){return v(e)?z.apply(null,arguments):e}function ge(e){return!!e.__k&&(m(null,e),!0)}function Ne(e){return e&&(e.base||e.nodeType===1&&e)||null}var Re=function(e,t){return e(t)},xe=function(e,t){return e(t)},ke=d;function V(e){e()}function Oe(e){return e}function Pe(){return[!1,V]}var we=E,Ue=v;function De(e,t){var n=t(),r=D({h:{__:n,v:t}}),o=r[0].h,a=r[1];return E(function(){o.__=n,o.v=t,y(o)&&a({h:o})},[e,n,t]),I(function(){return y(o)&&a({h:o}),e(function(){y(o)&&a({h:o})})},[e]),n}function y(e){var t,n,r=e.v,o=e.__;try{var a=r();return!((t=o)===(n=a)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}var Me={useState:D,useId:B,useReducer:j,useEffect:I,useLayoutEffect:E,useInsertionEffect:we,useTransition:Pe,useDeferredValue:Oe,useSyncExternalStore:De,startTransition:V,useRef:Y,useImperativeHandle:Z,useMemo:q,useCallback:G,useContext:J,useDebugValue:K,version:"17.0.2",Children:te,render:fe,hydrate:pe,unmountComponentAtNode:ge,createPortal:ue,createElement:c,createContext:$,createFactory:be,cloneElement:Se,createRef:H,Fragment:d,isValidElement:v,isElement:Ue,isFragment:Ce,isMemo:Ee,findDOMNode:Ne,Component:f,PureComponent:C,memo:Q,forwardRef:ee,flushSync:xe,unstable_batchedUpdates:Re,StrictMode:ke,Suspense:h,SuspenseList:p,lazy:re,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ye}; - -export{te as Children,Ve as Component,We as Fragment,C as PureComponent,ke as StrictMode,h as Suspense,p as SuspenseList,ye as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Se as cloneElement,$e as createContext,He as createElement,be as createFactory,ue as createPortal,ze as createRef,Me as default,Ne as findDOMNode,xe as flushSync,ee as forwardRef,pe as hydrate,Ue as isElement,Ce as isFragment,Ee as isMemo,v as isValidElement,re as lazy,Q as memo,fe as render,V as startTransition,ge as unmountComponentAtNode,Re as unstable_batchedUpdates,Oe as useDeferredValue,we as useInsertionEffect,De as useSyncExternalStore,Pe as useTransition,Te as version}; \ No newline at end of file +var T,d,Q,x,q,X,I,G,$,O,Y,E={},Z=[],ie=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,A=Array.isArray;function b(_,e){for(var t in e)_[t]=e[t];return _}function ee(_){var e=_.parentNode;e&&e.removeChild(_)}function le(_,e,t){var i,o2,r2,l2={};for(r2 in e)r2=="key"?i=e[r2]:r2=="ref"?o2=e[r2]:l2[r2]=e[r2];if(arguments.length>2&&(l2.children=arguments.length>3?T.call(arguments,2):t),typeof _=="function"&&_.defaultProps!=null)for(r2 in _.defaultProps)l2[r2]===void 0&&(l2[r2]=_.defaultProps[r2]);return w(_,l2,i,o2,null)}function w(_,e,t,i,o2){var r2={type:_,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o2??++Q,__i:-1,__u:0};return o2==null&&d.vnode!=null&&d.vnode(r2),r2}function he(){return{current:null}}function H(_){return _.children}function M(_,e){this.props=_,this.context=e}function P(_,e){if(e==null)return _.__?P(_.__,_.__i+1):null;for(var t;e<_.__k.length;e++)if((t=_.__k[e])!=null&&t.__e!=null)return t.__e;return typeof _.type=="function"?P(_):null}function _e(_){var e,t;if((_=_.__)!=null&&_.__c!=null){for(_.__e=_.__c.base=null,e=0;e<_.__k.length;e++)if((t=_.__k[e])!=null&&t.__e!=null){_.__e=_.__c.base=t.__e;break}return _e(_)}}function R(_){(!_.__d&&(_.__d=true)&&x.push(_)&&!W.__r++||q!==d.debounceRendering)&&((q=d.debounceRendering)||X)(W)}function W(){var _,e,t,i,o2,r2,l2,s;for(x.sort(I);_=x.shift();)_.__d&&(e=x.length,i=void 0,r2=(o2=(t=_).__v).__e,l2=[],s=[],t.__P&&((i=b({},o2)).__v=o2.__v+1,d.vnode&&d.vnode(i),V(t.__P,i,o2,t.__n,t.__P.ownerSVGElement!==void 0,32&o2.__u?[r2]:null,l2,r2??P(o2),!!(32&o2.__u),s),i.__v=o2.__v,i.__.__k[i.__i]=i,oe(l2,i,s),i.__e!=r2&&_e(i)),x.length>e&&x.sort(I));W.__r=0}function te(_,e,t,i,o2,r2,l2,s,f,u,p2){var n,m,c2,h2,k2,v2=i&&i.__k||Z,a=e.length;for(t.__d=f,se(t,e,v2),f=t.__d,n=0;n0?w(o2.type,o2.props,o2.key,o2.ref?o2.ref:null,o2.__v):o2)!=null?(o2.__=_,o2.__b=_.__b+1,s=ce(o2,t,l2,p2),o2.__i=s,r2=null,s!==-1&&(p2--,(r2=t[s])&&(r2.__u|=131072)),r2==null||r2.__v===null?(s==-1&&n--,typeof o2.type!="function"&&(o2.__u|=65536)):s!==l2&&(s===l2+1?n++:s>l2?p2>f-l2?n+=s-l2:n--:s(f!=null&&!(131072&f.__u)?1:0))for(;l2>=0||s=0){if((f=e[l2])&&!(131072&f.__u)&&o2==f.key&&r2===f.type)return l2;l2--}if(s2&&(s.children=arguments.length>3?T.call(arguments,2):t),w(_.type,s,i||_.key,o2||_.ref,null)}function ye(_,e){var t={__c:e="__cC"+Y++,__:_,Consumer:function(i,o2){return i.children(o2)},Provider:function(i){var o2,r2;return this.getChildContext||(o2=[],(r2={})[e]=this,this.getChildContext=function(){return r2},this.shouldComponentUpdate=function(l2){this.props.value!==l2.value&&o2.some(function(s){s.__e=true,R(s)})},this.sub=function(l2){o2.push(l2);var s=l2.componentWillUnmount;l2.componentWillUnmount=function(){o2.splice(o2.indexOf(l2),1),s&&s.call(l2)}}),i.children}};return t.Provider.__=t.Consumer.contextType=t}T=Z.slice,d={__e:function(_,e,t,i){for(var o2,r2,l2;e=e.__;)if((o2=e.__c)&&!o2.__)try{if((r2=o2.constructor)&&r2.getDerivedStateFromError!=null&&(o2.setState(r2.getDerivedStateFromError(_)),l2=o2.__d),o2.componentDidCatch!=null&&(o2.componentDidCatch(_,i||{}),l2=o2.__d),l2)return o2.__E=o2}catch(s){_=s}throw _}},Q=0,M.prototype.setState=function(_,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=b({},this.state),typeof _=="function"&&(_=_(b({},t),this.props)),_&&b(t,_),_!=null&&this.__v&&(e&&this._sb.push(e),R(this))},M.prototype.forceUpdate=function(_){this.__v&&(this.__e=true,_&&this.__h.push(_),R(this))},M.prototype.render=H,x=[],X=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,I=function(_,e){return _.__v.__b-e.__v.__b},W.__r=0,G=0,$=K(false),O=K(true),Y=0;var c,r,H1,b1,v=0,x1=[],p=[],o=d,g=o.__b,C=o.__r,A1=o.diffed,D=o.__c,F=o.unmount,k=o.__;function l(t,_){o.__h&&o.__h(r,t,v||_),v=0;var u=r.__H||(r.__H={__:[],__h:[]});return t>=u.__.length&&u.__.push({__V:p}),u.__[t]}function I1(t){return v=1,R1(U,t)}function R1(t,_,u){var n=l(c++,2);if(n.t=t,!n.__c&&(n.__=[u?u(_):U(void 0,_),function(a){var f=n.__N?n.__N[0]:n.__[0],s=n.t(f,a);f!==s&&(n.__N=[s,n.__[1]],n.__c.setState({}))}],n.__c=r,!r.u)){var i=function(a,f,s){if(!n.__c.__H)return true;var m=n.__c.__H.__.filter(function(e){return!!e.__c});if(m.every(function(e){return!e.__N}))return!h2||h2.call(this,a,f,s);var V2=false;return m.forEach(function(e){if(e.__N){var P2=e.__[0];e.__=e.__N,e.__N=void 0,P2!==e.__[0]&&(V2=true)}}),!(!V2&&n.__c.props===a)&&(!h2||h2.call(this,a,f,s))};r.u=true;var h2=r.shouldComponentUpdate,N2=r.componentWillUpdate;r.componentWillUpdate=function(a,f,s){if(this.__e){var m=h2;h2=void 0,i(a,f,s),h2=m}N2&&N2.call(this,a,f,s)},r.shouldComponentUpdate=i}return n.__N||n.__}function z(t,_){var u=l(c++,3);!o.__s&&y(u.__H,_)&&(u.__=t,u.i=_,r.__H.__h.push(u))}function S(t,_){var u=l(c++,4);!o.__s&&y(u.__H,_)&&(u.__=t,u.i=_,r.__h.push(u))}function L1(t){return v=5,T1(function(){return{current:t}},[])}function M1(t,_,u){v=6,S(function(){return typeof t=="function"?(t(_()),function(){return t(null)}):t?(t.current=_(),function(){return t.current=null}):void 0},u==null?u:u.concat(t))}function T1(t,_){var u=l(c++,7);return y(u.__H,_)?(u.__V=t(),u.i=_,u.__h=t,u.__V):u.__}function G1(t,_){return v=8,T1(function(){return t},_)}function J1(t){var _=r.context[t.__c],u=l(c++,9);return u.c=t,_?(u.__==null&&(u.__=true,_.sub(r)),_.props.value):t.__}function K1(t,_){o.useDebugValue&&o.useDebugValue(_?_(t):t)}function O1(t){var _=l(c++,10),u=I1();return _.__=t,r.componentDidCatch||(r.componentDidCatch=function(n,i){_.__&&_.__(n,i),u[1](n)}),[u[0],function(){u[1](void 0)}]}function Q1(){var t=l(c++,11);if(!t.__){for(var _=r.__v;_!==null&&!_.__m&&_.__!==null;)_=_.__;var u=_.__m||(_.__m=[0,0]);t.__="P"+u[0]+"-"+u[1]++}return t.__}function W1(){for(var t;t=x1.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(d1),t.__H.__h.forEach(E1),t.__H.__h=[]}catch(_){t.__H.__h=[],o.__e(_,t.__v)}}o.__b=function(t){r=null,g&&g(t)},o.__=function(t,_){t&&_.__k&&_.__k.__m&&(t.__m=_.__k.__m),k&&k(t,_)},o.__r=function(t){C&&C(t),c=0;var _=(r=t.__c).__H;_&&(H1===r?(_.__h=[],r.__h=[],_.__.forEach(function(u){u.__N&&(u.__=u.__N),u.__V=p,u.__N=u.i=void 0})):(_.__h.forEach(d1),_.__h.forEach(E1),_.__h=[],c=0)),H1=r},o.diffed=function(t){A1&&A1(t);var _=t.__c;_&&_.__H&&(_.__H.__h.length&&(x1.push(_)!==1&&b1===o.requestAnimationFrame||((b1=o.requestAnimationFrame)||j1)(W1)),_.__H.__.forEach(function(u){u.i&&(u.__H=u.i),u.__V!==p&&(u.__=u.__V),u.i=void 0,u.__V=p})),H1=r=null},o.__c=function(t,_){_.some(function(u){try{u.__h.forEach(d1),u.__h=u.__h.filter(function(n){return!n.__||E1(n)})}catch(n){_.some(function(i){i.__h&&(i.__h=[])}),_=[],o.__e(n,u.__v)}}),D&&D(t,_)},o.unmount=function(t){F&&F(t);var _,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{d1(n)}catch(i){_=i}}),u.__H=void 0,_&&o.__e(_,u.__v))};var q1=typeof requestAnimationFrame=="function";function j1(t){var _,u=function(){clearTimeout(n),q1&&cancelAnimationFrame(_),setTimeout(t)},n=setTimeout(u,100);q1&&(_=requestAnimationFrame(u))}function d1(t){var _=r,u=t.__c;typeof u=="function"&&(t.__c=void 0,u()),r=_}function E1(t){var _=r;t.__c=t.__(),r=_}function y(t,_){return!t||t.length!==_.length||_.some(function(u,n){return u!==t[n]})}function U(t,_){return typeof _=="function"?_(t):_}export{G1 as useCallback,J1 as useContext,K1 as useDebugValue,z as useEffect,O1 as useErrorBoundary,Q1 as useId,M1 as useImperativeHandle,S as useLayoutEffect,T1 as useMemo,R1 as useReducer,L1 as useRef,I1 as useState};export{le as jsx,le as jsxs,le as h,d as options};function L2(e,t){for(var n in t)e[n]=t[n];return e}function b2(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return true;for(var r2 in t)if(r2!=="__source"&&e[r2]!==t[r2])return true;return false}function C1(e,t){this.props=e,this.context=t}function Q2(e,t){function n(o2){var a=this.props.ref,u=a==o2.ref;return!u&&a&&(a.call?a(null):a.current=null),t?!t(this.props,o2)||!u:b2(this.props,o2)}function r2(o2){return this.shouldComponentUpdate=n,le(e,o2)}return r2.displayName="Memo("+(e.displayName||e.name)+")",r2.prototype.isReactComponent=true,r2.__f=true,r2}(C1.prototype=new M).isPureReactComponent=true,C1.prototype.shouldComponentUpdate=function(e,t){return b2(this.props,e)||b2(this.state,t)};var N=d.__b;d.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),N&&N(e)};var X1=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ee1(e){function t(n){var r2=L2({},n);return delete r2.ref,e(r2,n.ref||null)}return t.$$typeof=X1,t.render=t,t.prototype.isReactComponent=t.__f=true,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var R2=function(e,t){return e==null?null:ue(ue(e).map(t))},te1={map:R2,forEach:R2,count:function(e){return e?ue(e).length:0},only:function(e){var t=ue(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ue},ne1=d.__e;d.__e=function(e,t,n,r2){if(e.then){for(var o2,a=t;a=a.__;)if((o2=a.__c)&&o2.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o2.__c(e,t)}ne1(e,t,n,r2)};var x2=d.unmount;function T2(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r2){typeof r2.__c=="function"&&r2.__c()}),e.__c.__H=null),(e=L2({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r2){return T2(r2,t,n)})),e}function M2(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r2){return M2(r2,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=true,e.__c.__P=n)),e}function h(){this.__u=0,this.t=null,this.__b=null}function A2(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function re(e){var t,n,r2;function o2(a){if(t||(t=e()).then(function(u){n=u.default||u},function(u){r2=u}),r2)throw r2;if(!n)throw t;return le(n,a)}return o2.displayName="Lazy",o2.__f=true,o2}function p1(){this.u=null,this.o=null}d.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),x2&&x2(e)},(h.prototype=new M).__c=function(e,t){var n=t.__c,r2=this;r2.t==null&&(r2.t=[]),r2.t.push(n);var o2=A2(r2.__v),a=false,u=function(){a||(a=true,n.__R=null,o2?o2(l2):l2())};n.__R=u;var l2=function(){if(!--r2.__u){if(r2.state.__a){var s=r2.state.__a;r2.__v.__k[0]=M2(s,s.__c.__P,s.__c.__O)}var g2;for(r2.setState({__a:r2.__b=null});g2=r2.t.pop();)g2.forceUpdate()}};r2.__u++||32&t.__u||r2.setState({__a:r2.__b=r2.__v.__k[0]}),e.then(u,u)},h.prototype.componentWillUnmount=function(){this.t=[]},h.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r2=this.__v.__k[0].__c;this.__v.__k[0]=T2(this.__b,n,r2.__O=r2.__P)}this.__b=null}var o2=t.__a&&le(H,null,e.fallback);return o2&&(o2.__u&=-33),[le(H,null,t.__a?null:e.children),o2]};var k1=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(r2)}}),ae(le(oe1,{context:t.context},e.__v),t.l)}function ue1(e,t){var n=le(ae1,{__v:e,i:t});return n.containerInfo=t,n}(p1.prototype=new M).__a=function(e){var t=this,n=A2(t.__v),r2=t.o.get(e);return r2[0]++,function(o2){var a=function(){t.props.revealOrder?(r2.push(o2),k1(t,e,r2)):o2()};n?n(a):a()}},p1.prototype.render=function(e){this.u=null,this.o=new Map;var t=ue(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},p1.prototype.componentDidUpdate=p1.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){k1(e,n,t)})};var F1=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,ie1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,le1=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,se1=/[A-Z0-9]/g,_e1=typeof document<"u",ce1=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function fe1(e,t,n){return t.__k==null&&(t.textContent=""),ae(e,t),typeof n=="function"&&n(),e?e.__c:null}function pe1(e,t,n){return de(e,t),typeof n=="function"&&n(),e?e.__c:null}M.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(M.prototype,e,{configurable:true,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:true,writable:true,value:t})}})});var O2=d.event;function de1(){}function he1(){return this.cancelBubble}function me(){return this.defaultPrevented}d.event=function(e){return O2&&(e=O2(e)),e.persist=de1,e.isPropagationStopped=he1,e.isDefaultPrevented=me,e.nativeEvent=e};var S1,ve1={enumerable:false,configurable:true,get:function(){return this.class}},P1=d.vnode;d.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r2=t.type,o2={};for(var a in n){var u=n[a];if(!(a==="value"&&"defaultValue"in n&&u==null||_e1&&a==="children"&&r2==="noscript"||a==="class"||a==="className")){var l2=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&u===true?u="":l2==="translate"&&u==="no"?u=false:l2==="ondoubleclick"?a="ondblclick":l2!=="onchange"||r2!=="input"&&r2!=="textarea"||ce1(n.type)?l2==="onfocus"?a="onfocusin":l2==="onblur"?a="onfocusout":le1.test(a)?a=l2:r2.indexOf("-")===-1&&ie1.test(a)?a=a.replace(se1,"-$&").toLowerCase():u===null&&(u=void 0):l2=a="oninput",l2==="oninput"&&o2[a=l2]&&(a="oninputCapture"),o2[a]=u}}r2=="select"&&o2.multiple&&Array.isArray(o2.value)&&(o2.value=ue(n.children).forEach(function(s){s.props.selected=o2.value.indexOf(s.props.value)!=-1})),r2=="select"&&o2.defaultValue!=null&&(o2.value=ue(n.children).forEach(function(s){s.props.selected=o2.multiple?o2.defaultValue.indexOf(s.props.value)!=-1:o2.defaultValue==s.props.value})),n.class&&!n.className?(o2.class=n.class,Object.defineProperty(o2,"className",ve1)):(n.className&&!n.class||n.class&&n.className)&&(o2.class=o2.className=n.className),t.props=o2}(e),e.$$typeof=F1,P1&&P1(e)};var w1=d.__r;d.__r=function(e){w1&&w1(e),S1=e.__c};var U1=d.diffed;d.diffed=function(e){U1&&U1(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),S1=null};var ye1={ReactCurrentDispatcher:{current:{readContext:function(e){return S1.__n[e.__c].props.value}}}},Te="17.0.2";function be(e){return le.bind(null,e)}function v1(e){return!!e&&e.$$typeof===F1}function Ce(e){return v1(e)&&e.type===H}function Ee(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Se(e){return v1(e)?ve.apply(null,arguments):e}function ge(e){return!!e.__k&&(ae(null,e),true)}function Ne(e){return e&&(e.base||e.nodeType===1&&e)||null}var Re=function(e,t){return e(t)},xe=function(e,t){return e(t)},ke=H;function V1(e){e()}function Oe(e){return e}function Pe(){return[false,V1]}var we=S,Ue=v1;function De(e,t){var n=t(),r2=I1({h:{__:n,v:t}}),o2=r2[0].h,a=r2[1];return S(function(){o2.__=n,o2.v=t,y1(o2)&&a({h:o2})},[e,n,t]),z(function(){return y1(o2)&&a({h:o2}),e(function(){y1(o2)&&a({h:o2})})},[e]),n}function y1(e){var t,n,r2=e.v,o2=e.__;try{var a=r2();return!((t=o2)===(n=a)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return true}}var Me={useState:I1,useId:Q1,useReducer:R1,useEffect:z,useLayoutEffect:S,useInsertionEffect:we,useTransition:Pe,useDeferredValue:Oe,useSyncExternalStore:De,startTransition:V1,useRef:L1,useImperativeHandle:M1,useMemo:T1,useCallback:G1,useContext:J1,useDebugValue:K1,version:"17.0.2",Children:te1,render:fe1,hydrate:pe1,unmountComponentAtNode:ge,createPortal:ue1,createElement:le,createContext:ye,createFactory:be,cloneElement:Se,createRef:he,Fragment:H,isValidElement:v1,isElement:Ue,isFragment:Ce,isMemo:Ee,findDOMNode:Ne,Component:M,PureComponent:C1,memo:Q2,forwardRef:ee1,flushSync:xe,unstable_batchedUpdates:Re,StrictMode:ke,Suspense:h,SuspenseList:p1,lazy:re,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ye1};export{te1 as Children,M as Component,H as Fragment,C1 as PureComponent,ke as StrictMode,h as Suspense,p1 as SuspenseList,ye1 as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Se as cloneElement,ye as createContext,le as createElement,be as createFactory,ue1 as createPortal,he as createRef,Me as default,Ne as findDOMNode,xe as flushSync,ee1 as forwardRef,pe1 as hydrate,Ue as isElement,Ce as isFragment,Ee as isMemo,v1 as isValidElement,re as lazy,Q2 as memo,fe1 as render,V1 as startTransition,ge as unmountComponentAtNode,Re as unstable_batchedUpdates,Oe as useDeferredValue,we as useInsertionEffect,De as useSyncExternalStore,Pe as useTransition,Te as version}; diff --git a/bundled/preact/hooks.js b/bundled/preact/hooks.js deleted file mode 100644 index 5c589c4..0000000 --- a/bundled/preact/hooks.js +++ /dev/null @@ -1,6 +0,0 @@ -/* esm.sh - esbuild bundle(preact@10.20.2/hooks) es2022 production */ -import{options as B}from"./preact.js"; -var c,r,H,b,v=0,x=[],p=[],o=B,g=o.__b,C=o.__r,A=o.diffed,D=o.__c,F=o.unmount,k=o.__;function l(t,_){o.__h&&o.__h(r,t,v||_),v=0;var u=r.__H||(r.__H={__:[],__h:[]});return t>=u.__.length&&u.__.push({__V:p}),u.__[t]}function I(t){return v=1,R(U,t)}function R(t,_,u){var n=l(c++,2);if(n.t=t,!n.__c&&(n.__=[u?u(_):U(void 0,_),function(a){var f=n.__N?n.__N[0]:n.__[0],s=n.t(f,a);f!==s&&(n.__N=[s,n.__[1]],n.__c.setState({}))}],n.__c=r,!r.u)){var i=function(a,f,s){if(!n.__c.__H)return!0;var m=n.__c.__H.__.filter(function(e){return!!e.__c});if(m.every(function(e){return!e.__N}))return!h||h.call(this,a,f,s);var V=!1;return m.forEach(function(e){if(e.__N){var P=e.__[0];e.__=e.__N,e.__N=void 0,P!==e.__[0]&&(V=!0)}}),!(!V&&n.__c.props===a)&&(!h||h.call(this,a,f,s))};r.u=!0;var h=r.shouldComponentUpdate,N=r.componentWillUpdate;r.componentWillUpdate=function(a,f,s){if(this.__e){var m=h;h=void 0,i(a,f,s),h=m}N&&N.call(this,a,f,s)},r.shouldComponentUpdate=i}return n.__N||n.__}function z(t,_){var u=l(c++,3);!o.__s&&y(u.__H,_)&&(u.__=t,u.i=_,r.__H.__h.push(u))}function S(t,_){var u=l(c++,4);!o.__s&&y(u.__H,_)&&(u.__=t,u.i=_,r.__h.push(u))}function L(t){return v=5,T(function(){return{current:t}},[])}function M(t,_,u){v=6,S(function(){return typeof t=="function"?(t(_()),function(){return t(null)}):t?(t.current=_(),function(){return t.current=null}):void 0},u==null?u:u.concat(t))}function T(t,_){var u=l(c++,7);return y(u.__H,_)?(u.__V=t(),u.i=_,u.__h=t,u.__V):u.__}function G(t,_){return v=8,T(function(){return t},_)}function J(t){var _=r.context[t.__c],u=l(c++,9);return u.c=t,_?(u.__==null&&(u.__=!0,_.sub(r)),_.props.value):t.__}function K(t,_){o.useDebugValue&&o.useDebugValue(_?_(t):t)}function O(t){var _=l(c++,10),u=I();return _.__=t,r.componentDidCatch||(r.componentDidCatch=function(n,i){_.__&&_.__(n,i),u[1](n)}),[u[0],function(){u[1](void 0)}]}function Q(){var t=l(c++,11);if(!t.__){for(var _=r.__v;_!==null&&!_.__m&&_.__!==null;)_=_.__;var u=_.__m||(_.__m=[0,0]);t.__="P"+u[0]+"-"+u[1]++}return t.__}function W(){for(var t;t=x.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(d),t.__H.__h.forEach(E),t.__H.__h=[]}catch(_){t.__H.__h=[],o.__e(_,t.__v)}}o.__b=function(t){r=null,g&&g(t)},o.__=function(t,_){t&&_.__k&&_.__k.__m&&(t.__m=_.__k.__m),k&&k(t,_)},o.__r=function(t){C&&C(t),c=0;var _=(r=t.__c).__H;_&&(H===r?(_.__h=[],r.__h=[],_.__.forEach(function(u){u.__N&&(u.__=u.__N),u.__V=p,u.__N=u.i=void 0})):(_.__h.forEach(d),_.__h.forEach(E),_.__h=[],c=0)),H=r},o.diffed=function(t){A&&A(t);var _=t.__c;_&&_.__H&&(_.__H.__h.length&&(x.push(_)!==1&&b===o.requestAnimationFrame||((b=o.requestAnimationFrame)||j)(W)),_.__H.__.forEach(function(u){u.i&&(u.__H=u.i),u.__V!==p&&(u.__=u.__V),u.i=void 0,u.__V=p})),H=r=null},o.__c=function(t,_){_.some(function(u){try{u.__h.forEach(d),u.__h=u.__h.filter(function(n){return!n.__||E(n)})}catch(n){_.some(function(i){i.__h&&(i.__h=[])}),_=[],o.__e(n,u.__v)}}),D&&D(t,_)},o.unmount=function(t){F&&F(t);var _,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{d(n)}catch(i){_=i}}),u.__H=void 0,_&&o.__e(_,u.__v))};var q=typeof requestAnimationFrame=="function";function j(t){var _,u=function(){clearTimeout(n),q&&cancelAnimationFrame(_),setTimeout(t)},n=setTimeout(u,100);q&&(_=requestAnimationFrame(u))}function d(t){var _=r,u=t.__c;typeof u=="function"&&(t.__c=void 0,u()),r=_}function E(t){var _=r;t.__c=t.__(),r=_}function y(t,_){return!t||t.length!==_.length||_.some(function(u,n){return u!==t[n]})}function U(t,_){return typeof _=="function"?_(t):_} - -export{G as useCallback,J as useContext,K as useDebugValue,z as useEffect,O as useErrorBoundary,Q as useId,M as useImperativeHandle,S as useLayoutEffect,T as useMemo,R as useReducer,L as useRef,I as useState}; -//# sourceMappingURL=hooks.js.map \ No newline at end of file diff --git a/bundled/preact/preact.js b/bundled/preact/preact.js deleted file mode 100644 index eba4718..0000000 --- a/bundled/preact/preact.js +++ /dev/null @@ -1,3 +0,0 @@ -/* esm.sh - esbuild bundle(preact@10.20.2) es2022 production */ -var T,d,Q,re,x,q,X,I,G,$,O,Y,E={},Z=[],ie=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,A=Array.isArray;function b(_,e){for(var t in e)_[t]=e[t];return _}function ee(_){var e=_.parentNode;e&&e.removeChild(_)}function le(_,e,t){var i,o,r,l={};for(r in e)r=="key"?i=e[r]:r=="ref"?o=e[r]:l[r]=e[r];if(arguments.length>2&&(l.children=arguments.length>3?T.call(arguments,2):t),typeof _=="function"&&_.defaultProps!=null)for(r in _.defaultProps)l[r]===void 0&&(l[r]=_.defaultProps[r]);return w(_,l,i,o,null)}function w(_,e,t,i,o){var r={type:_,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++Q,__i:-1,__u:0};return o==null&&d.vnode!=null&&d.vnode(r),r}function he(){return{current:null}}function H(_){return _.children}function M(_,e){this.props=_,this.context=e}function P(_,e){if(e==null)return _.__?P(_.__,_.__i+1):null;for(var t;e<_.__k.length;e++)if((t=_.__k[e])!=null&&t.__e!=null)return t.__e;return typeof _.type=="function"?P(_):null}function _e(_){var e,t;if((_=_.__)!=null&&_.__c!=null){for(_.__e=_.__c.base=null,e=0;e<_.__k.length;e++)if((t=_.__k[e])!=null&&t.__e!=null){_.__e=_.__c.base=t.__e;break}return _e(_)}}function R(_){(!_.__d&&(_.__d=!0)&&x.push(_)&&!W.__r++||q!==d.debounceRendering)&&((q=d.debounceRendering)||X)(W)}function W(){var _,e,t,i,o,r,l,s;for(x.sort(I);_=x.shift();)_.__d&&(e=x.length,i=void 0,r=(o=(t=_).__v).__e,l=[],s=[],t.__P&&((i=b({},o)).__v=o.__v+1,d.vnode&&d.vnode(i),V(t.__P,i,o,t.__n,t.__P.ownerSVGElement!==void 0,32&o.__u?[r]:null,l,r??P(o),!!(32&o.__u),s),i.__v=o.__v,i.__.__k[i.__i]=i,oe(l,i,s),i.__e!=r&&_e(i)),x.length>e&&x.sort(I));W.__r=0}function te(_,e,t,i,o,r,l,s,f,u,p){var n,m,c,h,k,v=i&&i.__k||Z,a=e.length;for(t.__d=f,se(t,e,v),f=t.__d,n=0;n0?w(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=_,o.__b=_.__b+1,s=ce(o,t,l,p),o.__i=s,r=null,s!==-1&&(p--,(r=t[s])&&(r.__u|=131072)),r==null||r.__v===null?(s==-1&&n--,typeof o.type!="function"&&(o.__u|=65536)):s!==l&&(s===l+1?n++:s>l?p>f-l?n+=s-l:n--:s(f!=null&&!(131072&f.__u)?1:0))for(;l>=0||s=0){if((f=e[l])&&!(131072&f.__u)&&o==f.key&&r===f.type)return l;l--}if(s2&&(s.children=arguments.length>3?T.call(arguments,2):t),w(_.type,s,i||_.key,o||_.ref,null)}function ye(_,e){var t={__c:e="__cC"+Y++,__:_,Consumer:function(i,o){return i.children(o)},Provider:function(i){var o,r;return this.getChildContext||(o=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(l){this.props.value!==l.value&&o.some(function(s){s.__e=!0,R(s)})},this.sub=function(l){o.push(l);var s=l.componentWillUnmount;l.componentWillUnmount=function(){o.splice(o.indexOf(l),1),s&&s.call(l)}}),i.children}};return t.Provider.__=t.Consumer.contextType=t}T=Z.slice,d={__e:function(_,e,t,i){for(var o,r,l;e=e.__;)if((o=e.__c)&&!o.__)try{if((r=o.constructor)&&r.getDerivedStateFromError!=null&&(o.setState(r.getDerivedStateFromError(_)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(_,i||{}),l=o.__d),l)return o.__E=o}catch(s){_=s}throw _}},Q=0,re=function(_){return _!=null&&_.constructor==null},M.prototype.setState=function(_,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=b({},this.state),typeof _=="function"&&(_=_(b({},t),this.props)),_&&b(t,_),_!=null&&this.__v&&(e&&this._sb.push(e),R(this))},M.prototype.forceUpdate=function(_){this.__v&&(this.__e=!0,_&&this.__h.push(_),R(this))},M.prototype.render=H,x=[],X=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,I=function(_,e){return _.__v.__b-e.__v.__b},W.__r=0,G=0,$=K(!1),O=K(!0),Y=0;export{M as Component,H as Fragment,ve as cloneElement,ye as createContext,le as createElement,he as createRef,le as h,de as hydrate,re as isValidElement,d as options,ae as render,ue as toChildArray}; -//# sourceMappingURL=preact.mjs.map \ No newline at end of file diff --git a/bundled/preact/signals.js b/bundled/preact/signals.js index 5a45e5a..0bff467 100644 --- a/bundled/preact/signals.js +++ b/bundled/preact/signals.js @@ -1,7 +1,16 @@ /// + /* esm.sh - esbuild bundle(@preact/signals@1.2.3) es2022 production */ -import{Component as z,options as V,isValidElement as B}from"react"; -import{useMemo as k,useRef as G,useEffect as D}from"react"; +import +{Component as z,options as V,isValidElement as B} +from"./compat.js"; + +import +{useMemo as k,useRef as G,useEffect as D} +from"./compat.js"; + var M=Symbol.for("preact-signals");function b(){if(v>1)v--;else{for(var t,i=!1;p!==void 0;){var n=p;for(p=void 0,$++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&O(n))try{n.c()}catch(e){i||(t=e,i=!0)}n=r}}if($=0,v--,i)throw t}}function R(t){if(v>0)return t();v++;try{return t()}finally{b()}}var o=void 0;function T(t){var i=o;o=void 0;try{return t()}finally{o=i}}var p=void 0,v=0,$=0,S=0;function N(t){if(o!==void 0){var i=t.n;if(i===void 0||i.t!==o)return i={i:0,S:t,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:i},o.s!==void 0&&(o.s.n=i),o.s=i,t.n=i,32&o.f&&t.S(i),i;if(i.i===-1)return i.i=0,i.n!==void 0&&(i.n.p=i.p,i.p!==void 0&&(i.p.n=i.n),i.p=o.s,i.n=void 0,o.s.n=i,o.s=i),i}}function u(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}u.prototype.brand=M;u.prototype.h=function(){return!0};u.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t)};u.prototype.U=function(t){if(this.t!==void 0){var i=t.e,n=t.x;i!==void 0&&(i.x=n,t.e=void 0),n!==void 0&&(n.e=i,t.x=void 0),t===this.t&&(this.t=n)}};u.prototype.subscribe=function(t){var i=this;return c(function(){var n=i.value,r=o;o=void 0;try{t(n)}finally{o=r}})};u.prototype.valueOf=function(){return this.value};u.prototype.toString=function(){return this.value+""};u.prototype.toJSON=function(){return this.value};u.prototype.peek=function(){var t=o;o=void 0;try{return this.value}finally{o=t}};Object.defineProperty(u.prototype,"value",{get:function(){var t=N(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if($>100)throw new Error("Cycle detected");this.v=t,this.i++,S++,v++;try{for(var i=this.t;i!==void 0;i=i.x)i.t.N()}finally{b()}}}});function g(t){return new u(t)}function O(t){for(var i=t.s;i!==void 0;i=i.n)if(i.S.i!==i.i||!i.S.h()||i.S.i!==i.i)return!0;return!1}function j(t){for(var i=t.s;i!==void 0;i=i.n){var n=i.S.n;if(n!==void 0&&(i.r=n),i.S.n=i,i.i=-1,i.n===void 0){t.s=i;break}}}function P(t){for(var i=t.s,n=void 0;i!==void 0;){var r=i.p;i.i===-1?(i.S.U(i),r!==void 0&&(r.n=i.n),i.n!==void 0&&(i.n.p=r)):n=i,i.S.n=i.r,i.r!==void 0&&(i.r=void 0),i=r}t.s=n}function h(t){u.call(this,void 0),this.x=t,this.s=void 0,this.g=S-1,this.f=4}(h.prototype=new u).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===S))return!0;if(this.g=S,this.f|=1,this.i>0&&!O(this))return this.f&=-2,!0;var t=o;try{j(this),o=this;var i=this.x();(16&this.f||this.v!==i||this.i===0)&&(this.v=i,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return o=t,P(this),this.f&=-2,!0};h.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var i=this.s;i!==void 0;i=i.n)i.S.S(i)}u.prototype.S.call(this,t)};h.prototype.U=function(t){if(this.t!==void 0&&(u.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var i=this.s;i!==void 0;i=i.n)i.S.U(i)}};h.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(h.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=N(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function w(t){return new h(t)}function A(t){var i=t.u;if(t.u=void 0,typeof i=="function"){v++;var n=o;o=void 0;try{i()}catch(r){throw t.f&=-2,t.f|=8,U(t),r}finally{o=n,b()}}}function U(t){for(var i=t.s;i!==void 0;i=i.n)i.S.U(i);t.x=void 0,t.s=void 0,A(t)}function q(t){if(o!==this)throw new Error("Out-of-order effect");P(this),o=t,this.f&=-2,8&this.f&&U(this),b()}function l(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}l.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var i=this.x();typeof i=="function"&&(this.u=i)}finally{t()}};l.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,A(this),j(this),v++;var t=o;return o=this,q.bind(this,t)};l.prototype.N=function(){2&this.f||(this.f|=2,this.o=p,p=this)};l.prototype.d=function(){this.f|=8,1&this.f||U(this)};function c(t){var i=new l(t);try{i.c()}catch(n){throw i.d(),n}return i.d.bind(i)}var x,E;function d(t,i){V[t]=i.bind(null,V[t]||function(){})}function m(t){E&&E(),E=t&&t.S()}function J(t){var i=this,n=t.data,r=H(n);r.value=n;var e=k(function(){for(var f=i.__v;f=f.__;)if(f.__c){f.__c.__$f|=4;break}return i.__$u.c=function(){var s;!B(e.peek())&&((s=i.base)==null?void 0:s.nodeType)===3?i.base.data=e.peek():(i.__$f|=1,i.setState({}))},w(function(){var s=r.value.value;return s===0?0:s===!0?"":s||""})},[]);return e.value}J.displayName="_st";Object.defineProperties(u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:J},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});d("__b",function(t,i){if(typeof i.type=="string"){var n,r=i.props;for(var e in r)if(e!=="children"){var f=r[e];f instanceof u&&(n||(i.__np=n={}),n[e]=f,r[e]=f.peek())}}t(i)});d("__r",function(t,i){m();var n,r=i.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(e){var f;return c(function(){f=this}),f.c=function(){r.__$f|=1,r.setState({})},f}())),x=r,m(n),t(i)});d("__e",function(t,i,n,r){m(),x=void 0,t(i,n,r)});d("diffed",function(t,i){m(),x=void 0;var n;if(typeof i.type=="string"&&(n=i.__e)){var r=i.__np,e=i.props;if(r){var f=n.U;if(f)for(var s in f){var a=f[s];a!==void 0&&!(s in r)&&(a.d(),f[s]=void 0)}else n.U=f={};for(var _ in r){var y=f[_],C=r[_];y===void 0?(y=F(n,_,C,e),f[_]=y):y.o(C,e)}}}t(i)});function F(t,i,n,r){var e=i in t&&t.ownerSVGElement===void 0,f=g(n);return{o:function(s,a){f.value=s,r=a},d:c(function(){var s=f.value.value;r[i]!==s&&(r[i]=s,e?t[i]=s:s?t.setAttribute(i,s):t.removeAttribute(i))})}}d("unmount",function(t,i){if(typeof i.type=="string"){var n=i.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var e in r){var f=r[e];f&&f.d()}}}}else{var s=i.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}t(i)});d("__h",function(t,i,n,r){(r<3||r===9)&&(i.__$f|=2),t(i,n,r)});z.prototype.shouldComponentUpdate=function(t,i){var n=this.__$u;if(!(n&&n.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var r in i)return!0;for(var e in t)if(e!=="__source"&&t[e]!==this.props[e])return!0;for(var f in this.props)if(!(f in t))return!0;return!1};function H(t){return k(function(){return g(t)},[])}function W(t){var i=G(t);return i.current=t,x.__$f|=4,k(function(){return w(function(){return i.current()})},[])}function X(t){var i=G(t);i.current=t,D(function(){return c(function(){return i.current()})},[])} -export{u as Signal,R as batch,w as computed,c as effect,g as signal,T as untracked,W as useComputed,H as useSignal,X as useSignalEffect}; + +export +{u as Signal,R as batch,w as computed,c as effect,g as signal,T as untracked,W as useComputed,H as useSignal,X as useSignalEffect}; //# sourceMappingURL=signals.bundle.mjs.map \ No newline at end of file diff --git a/bundled/preact/to-string.js b/bundled/preact/ssr.mjs similarity index 97% rename from bundled/preact/to-string.js rename to bundled/preact/ssr.mjs index a32bfc3..498dc17 100644 --- a/bundled/preact/to-string.js +++ b/bundled/preact/ssr.mjs @@ -1,5 +1,8 @@ +/// /* esm.sh - esbuild bundle(preact-render-to-string@6.4.2) denonext production */ -import{options as u,h as V,Fragment as E}from"./preact.js"; +import +{options as u,h as V,Fragment as E} +from"./compat.js"; var J=/[\s\n\\/='"\0<>]/,M=/^(xlink|xmlns|xml)([A-Z])/,oe=/^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]/,ae=/^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/,ie=/["&<]/;function H(e){if(e.length===0||ie.test(e)===!1)return e;for(var n=0,t=0,r="",a="";t";s=h.children}else{if((S=f.contextType)!=null){var G=n[S.__c];j=G?G.props.value:S.__}if(f.prototype&&typeof f.prototype.render=="function")s=K(e,j),d=e.__c;else{e.__c=d={__v:e,props:h,context:j,setState:Y,forceUpdate:Y,__d:!0,__h:[]};for(var ee=0;d.__d&&ee++<25;)d.__d=!1,P&&P(e),s=f.call(d,h,j);d.__d=!0}if(d.getChildContext!=null&&(n=R({},n,d.getChildContext())),(f.getDerivedStateFromError||d.componentDidCatch)&&u.errorBoundaries){var z="";s=s!=null&&s.type===E&&s.key==null?s.props.children:s;try{return z=k(s,n,t,r,e,o)}catch(w){return f.getDerivedStateFromError&&(d.__s=f.getDerivedStateFromError(w)),d.componentDidCatch&&d.componentDidCatch(w,{}),d.__d&&(s=K(e,n),(d=e.__c).getChildContext!=null&&(n=R({},n,d.getChildContext())),z=k(s=s!=null&&s.type===E&&s.key==null?s.props.children:s,n,t,r,e,o)),z}finally{A&&A(e),e.__=null,C&&C(e)}}}s=s!=null&&s.type===E&&s.key==null&&s.props.tpl==null?s.props.children:s;try{var te=k(s,n,t,r,e,o);return A&&A(e),e.__=null,C&&C(e),te}catch(w){if(!o||!w||typeof w.then!="function")throw w;var ne=function re(){try{return k(s,n,t,r,e,o)}catch(Z){if(!Z||typeof Z.then!="function")throw Z;return Z.then(function(){return k(s,n,t,r,e,o)},function(){return re()})}};return w.then(function(){return ne()})}}var x,L="<"+f,b="";for(var c in h){var p=h[c];switch(c){case"children":x=p;continue;case"key":case"ref":case"__self":case"__source":continue;case"htmlFor":if("for"in h)continue;c="for";break;case"className":if("class"in h)continue;c="class";break;case"defaultChecked":c="checked";break;case"defaultSelected":c="selected";break;case"defaultValue":case"value":switch(c="value",f){case"textarea":x=p;continue;case"select":r=p;continue;case"option":r!=p||"selected"in h||(L+=" selected")}break;case"dangerouslySetInnerHTML":b=p&&p.__html;continue;case"style":typeof p=="object"&&(p=le(p));break;case"acceptCharset":c="accept-charset";break;case"httpEquiv":c="http-equiv";break;default:if(M.test(c))c=c.replace(M,"$1:$2").toLowerCase();else{if(J.test(c))continue;c[4]!=="-"&&c!=="draggable"||p==null?t?ae.test(c)&&(c=c==="panose1"?"panose-1":c.replace(/([A-Z])/g,"-$1").toLowerCase()):oe.test(c)&&(c=c.toLowerCase()):p+=""}}p!=null&&p!==!1&&typeof p!="function"&&(L=p===!0||p===""?L+" "+c:L+" "+c+'="'+H(p+"")+'"')}if(J.test(f))throw new Error(f+" is not a valid HTML tag name in "+L+">");if(b||(typeof x=="string"?b=H(x):x!=null&&x!==!1&&x!==!0&&(b=k(x,n,f==="svg"||f!=="foreignObject"&&t,r,e,o))),A&&A(e),e.__=null,C&&C(e),!b&&pe.has(f))return L+"/>";var B="",I=L+">";return Array.isArray(b)?[I].concat(b,[B]):typeof b!="string"?[I,b,B]:I+b+B}var pe=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),_e=$,ve=$,me=$; diff --git a/deno.jsonc b/deno.jsonc index edc7bb0..c605bb4 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -1,10 +1,8 @@ { "imports": { - "react": "https://esm.sh/preact@10.20.2/compat", - "react/jsx-runtime": "https://esm.sh/stable/preact@10.20.2/es2022/jsx-runtime.js", - "react-original": "https://esm.sh/preact@10.20.2/compat", - "@preact/signals": "https://esm.sh/@preact/signals@1.2.3?deps=preact@10.20.2", - "signals-original": "https://esm.sh/@preact/signals@1.2.3?deps=preact@10.20.2", + "react": "./bundled/preact/compat.js", + "react/jsx-runtime": "./bundled/preact/compat.js", + "@preact/signals": "./bundled/preact/signals.js", "@twind/core": "https://esm.sh/@twind/core@1.1.3", ">able/": "./", diff --git a/run-browser.tsx b/run-browser.tsx index 9d86858..bd33596 100644 --- a/run-browser.tsx +++ b/run-browser.tsx @@ -35,7 +35,7 @@ const Shadow =(inElement:HTMLElement)=> return ShadowDiv; }; -export default async(inSelector:string, inShadow=false):Promise<(()=>void)|false>=> +export default async(inSelector:string, inShadow?:boolean):Promise<(()=>void)|false>=> { let dom = document.querySelector(inSelector); @@ -47,6 +47,7 @@ export default async(inSelector:string, inShadow=false):Promise<(()=>void)|false if(inShadow) { + console.log("init shadow root!", inShadow); dom = Shadow(dom as HTMLElement); } else diff --git a/run-local.tsx b/run-local.tsx index 4c3f8c6..1a2dacb 100644 --- a/run-local.tsx +++ b/run-local.tsx @@ -37,7 +37,7 @@ Configure({ }, async Extra(inReq, inURL, inExt, inMap, inConfig) { - if(!inURL.pathname.startsWith(encodeURI("/>"))) + if(!inURL.pathname.startsWith(encodeURI("/>")) && !inURL.pathname.startsWith("/bundled/") ) { if(Transpile.Check(inExt) && !inURL.searchParams.get("reload")) { diff --git a/run-serve.tsx b/run-serve.tsx index 111edb9..314e5a5 100644 --- a/run-serve.tsx +++ b/run-serve.tsx @@ -1,6 +1,6 @@ import * as MIME from "https://deno.land/std@0.180.0/media_types/mod.ts"; import * as SWCW from "https://esm.sh/@swc/wasm-web@1.3.62"; -import SSR from "https://esm.sh/preact-render-to-string@6.4.2?deps=preact@10.20.2"; +import SSR from "./bundled/preact/ssr.mjs"; import { HuntConfig, Root } from "./checker.tsx"; import CustomServe from ">able/api.tsx"; @@ -177,7 +177,7 @@ export default async()=> } // transpileable files - if(Transpile.Check(ext)) + if(Transpile.Check(ext) && !url.pathname.startsWith("/bundled/")) { const code = await Transpile.Fetch(proxy, url.pathname); if(code) @@ -217,7 +217,7 @@ export default async()=> `, {status:200, headers:{"content-type":"text/html"}});