mirror of
https://github.com/bewcloud/bewcloud.git
synced 2026-03-11 08:54:49 +00:00
This implements a huge change, where Fresh is removed as a framework and serving files, allowing more control over importing, bundling, and serving files and components. The biggest challenge was to continue making sure that there weren't too many places to look into for import versions, and `PasswordlessPasskeyLogin.tsx` became a prototype in migrating a component to fully SSR, no need for frontend parsing (via Babel) or bundling (via a custom-script, downloading frontend dependencies from esm.sh). Still, there are too many components to migrate like that, and it's all working, so I likely won't even attempt it unless there's some bug, new feature, or security vulnerability to address that warrants a rewrite of those. This also updates all dependencies (except `@libs/xml` because that still causes some breaking in DAV endpoints), including Deno! All other advantages can be seen in the related issues, and the breaking change this (v4.0.0) introduces is related simply to `config.email.tlsMode` (which had a deprecation warning throughout v3), and because, while I tested many things exhaustively, it's not impossible something broke that I didn't see. Closes #141 Closes #132
3 lines
No EOL
11 KiB
JavaScript
3 lines
No EOL
11 KiB
JavaScript
/* esm.sh - preact@10.28.4 */
|
|
var E,d,X,se,C,J,Y,Z,ee,j,R,$,_e,A={},F=[],ce=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,M=Array.isArray;function b(_,e){for(var t in e)_[t]=e[t];return _}function V(_){_&&_.parentNode&&_.parentNode.removeChild(_)}function ue(_,e,t){var o,l,n,i={};for(n in e)n=="key"?o=e[n]:n=="ref"?l=e[n]:i[n]=e[n];if(arguments.length>2&&(i.children=arguments.length>3?E.call(arguments,2):t),typeof _=="function"&&_.defaultProps!=null)for(n in _.defaultProps)i[n]===void 0&&(i[n]=_.defaultProps[n]);return T(_,i,o,l,null)}function T(_,e,t,o,l){var n={type:_,props:e,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++X,__i:-1,__u:0};return l==null&&d.vnode!=null&&d.vnode(n),n}function ge(){return{current:null}}function H(_){return _.children}function W(_,e){this.props=_,this.context=e}function S(_,e){if(e==null)return _.__?S(_.__,_.__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"?S(_):null}function pe(_){if(_.__P&&_.__d){var e=_.__v,t=e.__e,o=[],l=[],n=b({},e);n.__v=e.__v+1,d.vnode&&d.vnode(n),z(_.__P,n,e,_.__n,_.__P.namespaceURI,32&e.__u?[t]:null,o,t??S(e),!!(32&e.__u),l),n.__v=e.__v,n.__.__k[n.__i]=n,oe(o,n,l),e.__e=e.__=null,n.__e!=t&&te(n)}}function te(_){if((_=_.__)!=null&&_.__c!=null)return _.__e=_.__c.base=null,_.__k.some(function(e){if(e!=null&&e.__e!=null)return _.__e=_.__c.base=e.__e}),te(_)}function B(_){(!_.__d&&(_.__d=!0)&&C.push(_)&&!N.__r++||J!=d.debounceRendering)&&((J=d.debounceRendering)||Y)(N)}function N(){for(var _,e=1;C.length;)C.length>e&&C.sort(Z),_=C.shift(),e=C.length,pe(_);N.__r=0}function ne(_,e,t,o,l,n,i,c,f,s,p){var r,v,u,m,g,y,h,a=o&&o.__k||F,w=e.length;for(f=fe(t,e,a,f,w),r=0;r<w;r++)(u=t.__k[r])!=null&&(v=u.__i!=-1&&a[u.__i]||A,u.__i=r,y=z(_,u,v,l,n,i,c,f,s,p),m=u.__e,u.ref&&v.ref!=u.ref&&(v.ref&&q(v.ref,null,u),p.push(u.ref,u.__c||m,u)),g==null&&m!=null&&(g=m),(h=!!(4&u.__u))||v.__k===u.__k?f=re(u,f,_,h):typeof u.type=="function"&&y!==void 0?f=y:m&&(f=m.nextSibling),u.__u&=-7);return t.__e=g,f}function fe(_,e,t,o,l){var n,i,c,f,s,p=t.length,r=p,v=0;for(_.__k=new Array(l),n=0;n<l;n++)(i=e[n])!=null&&typeof i!="boolean"&&typeof i!="function"?(typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?i=_.__k[n]=T(null,i,null,null,null):M(i)?i=_.__k[n]=T(H,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?i=_.__k[n]=T(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):_.__k[n]=i,f=n+v,i.__=_,i.__b=_.__b+1,c=null,(s=i.__i=he(i,t,f,r))!=-1&&(r--,(c=t[s])&&(c.__u|=2)),c==null||c.__v==null?(s==-1&&(l>p?v--:l<p&&v++),typeof i.type!="function"&&(i.__u|=4)):s!=f&&(s==f-1?v--:s==f+1?v++:(s>f?v--:v++,i.__u|=4))):_.__k[n]=null;if(r)for(n=0;n<p;n++)(c=t[n])!=null&&(2&c.__u)==0&&(c.__e==o&&(o=S(c)),ie(c,c));return o}function re(_,e,t,o){var l,n;if(typeof _.type=="function"){for(l=_.__k,n=0;l&&n<l.length;n++)l[n]&&(l[n].__=_,e=re(l[n],e,t,o));return e}_.__e!=e&&(o&&(e&&_.type&&!e.parentNode&&(e=S(_)),t.insertBefore(_.__e,e||null)),e=_.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ae(_,e){return e=e||[],_==null||typeof _=="boolean"||(M(_)?_.some(function(t){ae(t,e)}):e.push(_)),e}function he(_,e,t,o){var l,n,i,c=_.key,f=_.type,s=e[t],p=s!=null&&(2&s.__u)==0;if(s===null&&c==null||p&&c==s.key&&f==s.type)return t;if(o>(p?1:0)){for(l=t-1,n=t+1;l>=0||n<e.length;)if((s=e[i=l>=0?l--:n++])!=null&&(2&s.__u)==0&&c==s.key&&f==s.type)return i}return-1}function K(_,e,t){e[0]=="-"?_.setProperty(e,t??""):_[e]=t==null?"":typeof t!="number"||ce.test(e)?t:t+"px"}function L(_,e,t,o,l){var n,i;e:if(e=="style")if(typeof t=="string")_.style.cssText=t;else{if(typeof o=="string"&&(_.style.cssText=o=""),o)for(e in o)t&&e in t||K(_.style,e,"");if(t)for(e in t)o&&t[e]==o[e]||K(_.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(ee,"$1")),i=e.toLowerCase(),e=i in _||e=="onFocusOut"||e=="onFocusIn"?i.slice(2):e.slice(2),_.l||(_.l={}),_.l[e+n]=t,t?o?t.u=o.u:(t.u=j,_.addEventListener(e,n?$:R,n)):_.removeEventListener(e,n?$:R,n);else{if(l=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in _)try{_[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?_.removeAttribute(e):_.setAttribute(e,e=="popover"&&t==1?"":t))}}function Q(_){return function(e){if(this.l){var t=this.l[e.type+_];if(e.t==null)e.t=j++;else if(e.t<t.u)return;return t(d.event?d.event(e):e)}}}function z(_,e,t,o,l,n,i,c,f,s){var p,r,v,u,m,g,y,h,a,w,x,U,G,D,I,k=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(f=!!(32&t.__u),n=[c=e.__e=t.__e]),(p=d.__b)&&p(e);e:if(typeof k=="function")try{if(h=e.props,a="prototype"in k&&k.prototype.render,w=(p=k.contextType)&&o[p.__c],x=p?w?w.props.value:p.__:o,t.__c?y=(r=e.__c=t.__c).__=r.__E:(a?e.__c=r=new k(h,x):(e.__c=r=new W(h,x),r.constructor=k,r.render=ve),w&&w.sub(r),r.state||(r.state={}),r.__n=o,v=r.__d=!0,r.__h=[],r._sb=[]),a&&r.__s==null&&(r.__s=r.state),a&&k.getDerivedStateFromProps!=null&&(r.__s==r.state&&(r.__s=b({},r.__s)),b(r.__s,k.getDerivedStateFromProps(h,r.__s))),u=r.props,m=r.state,r.__v=e,v)a&&k.getDerivedStateFromProps==null&&r.componentWillMount!=null&&r.componentWillMount(),a&&r.componentDidMount!=null&&r.__h.push(r.componentDidMount);else{if(a&&k.getDerivedStateFromProps==null&&h!==u&&r.componentWillReceiveProps!=null&&r.componentWillReceiveProps(h,x),e.__v==t.__v||!r.__e&&r.shouldComponentUpdate!=null&&r.shouldComponentUpdate(h,r.__s,x)===!1){e.__v!=t.__v&&(r.props=h,r.state=r.__s,r.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(P){P&&(P.__=e)}),F.push.apply(r.__h,r._sb),r._sb=[],r.__h.length&&i.push(r);break e}r.componentWillUpdate!=null&&r.componentWillUpdate(h,r.__s,x),a&&r.componentDidUpdate!=null&&r.__h.push(function(){r.componentDidUpdate(u,m,g)})}if(r.context=x,r.props=h,r.__P=_,r.__e=!1,U=d.__r,G=0,a)r.state=r.__s,r.__d=!1,U&&U(e),p=r.render(r.props,r.state,r.context),F.push.apply(r.__h,r._sb),r._sb=[];else do r.__d=!1,U&&U(e),p=r.render(r.props,r.state,r.context),r.state=r.__s;while(r.__d&&++G<25);r.state=r.__s,r.getChildContext!=null&&(o=b(b({},o),r.getChildContext())),a&&!v&&r.getSnapshotBeforeUpdate!=null&&(g=r.getSnapshotBeforeUpdate(u,m)),D=p!=null&&p.type===H&&p.key==null?le(p.props.children):p,c=ne(_,M(D)?D:[D],e,t,o,l,n,i,c,f,s),r.base=e.__e,e.__u&=-161,r.__h.length&&i.push(r),y&&(r.__E=r.__=null)}catch(P){if(e.__v=null,f||n!=null)if(P.then){for(e.__u|=f?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;n[n.indexOf(c)]=null,e.__e=c}else{for(I=n.length;I--;)V(n[I]);O(e)}else e.__e=t.__e,e.__k=t.__k,P.then||O(e);d.__e(P,e,t)}else n==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):c=e.__e=de(t.__e,e,t,o,l,n,i,f,s);return(p=d.diffed)&&p(e),128&e.__u?void 0:c}function O(_){_&&(_.__c&&(_.__c.__e=!0),_.__k&&_.__k.some(O))}function oe(_,e,t){for(var o=0;o<t.length;o++)q(t[o],t[++o],t[++o]);d.__c&&d.__c(e,_),_.some(function(l){try{_=l.__h,l.__h=[],_.some(function(n){n.call(l)})}catch(n){d.__e(n,l.__v)}})}function le(_){return typeof _!="object"||_==null||_.__b>0?_:M(_)?_.map(le):b({},_)}function de(_,e,t,o,l,n,i,c,f){var s,p,r,v,u,m,g,y=t.props||A,h=e.props,a=e.type;if(a=="svg"?l="http://www.w3.org/2000/svg":a=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),n!=null){for(s=0;s<n.length;s++)if((u=n[s])&&"setAttribute"in u==!!a&&(a?u.localName==a:u.nodeType==3)){_=u,n[s]=null;break}}if(_==null){if(a==null)return document.createTextNode(h);_=document.createElementNS(l,a,h.is&&h),c&&(d.__m&&d.__m(e,n),c=!1),n=null}if(a==null)y===h||c&&_.data==h||(_.data=h);else{if(n=n&&E.call(_.childNodes),!c&&n!=null)for(y={},s=0;s<_.attributes.length;s++)y[(u=_.attributes[s]).name]=u.value;for(s in y)u=y[s],s=="dangerouslySetInnerHTML"?r=u:s=="children"||s in h||s=="value"&&"defaultValue"in h||s=="checked"&&"defaultChecked"in h||L(_,s,null,u,l);for(s in h)u=h[s],s=="children"?v=u:s=="dangerouslySetInnerHTML"?p=u:s=="value"?m=u:s=="checked"?g=u:c&&typeof u!="function"||y[s]===u||L(_,s,u,y[s],l);if(p)c||r&&(p.__html==r.__html||p.__html==_.innerHTML)||(_.innerHTML=p.__html),e.__k=[];else if(r&&(_.innerHTML=""),ne(e.type=="template"?_.content:_,M(v)?v:[v],e,t,o,a=="foreignObject"?"http://www.w3.org/1999/xhtml":l,n,i,n?n[0]:t.__k&&S(t,0),c,f),n!=null)for(s=n.length;s--;)V(n[s]);c||(s="value",a=="progress"&&m==null?_.removeAttribute("value"):m!=null&&(m!==_[s]||a=="progress"&&!m||a=="option"&&m!=y[s])&&L(_,s,m,y[s],l),s="checked",g!=null&&g!=_[s]&&L(_,s,g,y[s],l))}return _}function q(_,e,t){try{if(typeof _=="function"){var o=typeof _.__u=="function";o&&_.__u(),o&&e==null||(_.__u=_(e))}else _.current=e}catch(l){d.__e(l,t)}}function ie(_,e,t){var o,l;if(d.unmount&&d.unmount(_),(o=_.ref)&&(o.current&&o.current!=_.__e||q(o,null,e)),(o=_.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(n){d.__e(n,e)}o.base=o.__P=null}if(o=_.__k)for(l=0;l<o.length;l++)o[l]&&ie(o[l],e,t||typeof _.type!="function");t||V(_.__e),_.__c=_.__=_.__e=void 0}function ve(_,e,t){return this.constructor(_,t)}function me(_,e,t){var o,l,n,i;e==document&&(e=document.documentElement),d.__&&d.__(_,e),l=(o=typeof t=="function")?null:t&&t.__k||e.__k,n=[],i=[],z(e,_=(!o&&t||e).__k=ue(H,null,[_]),l||A,A,e.namespaceURI,!o&&t?[t]:l?null:e.firstChild?E.call(e.childNodes):null,n,!o&&t?t:l?l.__e:e.firstChild,o,i),oe(n,_,i)}function ye(_,e){me(_,e,ye)}function ke(_,e,t){var o,l,n,i,c=b({},_.props);for(n in _.type&&_.type.defaultProps&&(i=_.type.defaultProps),e)n=="key"?o=e[n]:n=="ref"?l=e[n]:c[n]=e[n]===void 0&&i!=null?i[n]:e[n];return arguments.length>2&&(c.children=arguments.length>3?E.call(arguments,2):t),T(_.type,c,o||_.key,l||_.ref,null)}function be(_){function e(t){var o,l;return this.getChildContext||(o=new Set,(l={})[e.__c]=this,this.getChildContext=function(){return l},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&o.forEach(function(i){i.__e=!0,B(i)})},this.sub=function(n){o.add(n);var i=n.componentWillUnmount;n.componentWillUnmount=function(){o&&o.delete(n),i&&i.call(n)}}),t.children}return e.__c="__cC"+_e++,e.__=_,e.Provider=e.__l=(e.Consumer=function(t,o){return t.children(o)}).contextType=e,e}E=F.slice,d={__e:function(_,e,t,o){for(var l,n,i;e=e.__;)if((l=e.__c)&&!l.__)try{if((n=l.constructor)&&n.getDerivedStateFromError!=null&&(l.setState(n.getDerivedStateFromError(_)),i=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(_,o||{}),i=l.__d),i)return l.__E=l}catch(c){_=c}throw _}},X=0,se=function(_){return _!=null&&_.constructor===void 0},W.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),B(this))},W.prototype.forceUpdate=function(_){this.__v&&(this.__e=!0,_&&this.__h.push(_),B(this))},W.prototype.render=H,C=[],Y=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Z=function(_,e){return _.__v.__b-e.__v.__b},N.__r=0,ee=/(PointerCapture)$|Capture$/i,j=0,R=Q(!1),$=Q(!0),_e=0;export{W as Component,H as Fragment,ke as cloneElement,be as createContext,ue as createElement,ge as createRef,ue as h,ye as hydrate,se as isValidElement,d as options,me as render,ae as toChildArray};
|
|
//preact.mjs.map
|