mirror of
https://github.com/cesanta/mongoose.git
synced 2025-07-27 15:46:14 +08:00
1 line
28 KiB
JavaScript
1 line
28 KiB
JavaScript
var t,n,e,i,o,r,_,u,l,f,s,c,a,h={},p=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function y(t,n){for(var e in n)t[e]=n[e];return t}function m(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function g(n,e,i){var o,r,_,u={};for(_ in e)"key"==_?o=e[_]:"ref"==_?r=e[_]:u[_]=e[_];if(arguments.length>2&&(u.children=arguments.length>3?t.call(arguments,2):i),"function"==typeof n&&null!=n.defaultProps)for(_ in n.defaultProps)void 0===u[_]&&(u[_]=n.defaultProps[_]);return b(n,u,o,r,null)}function b(t,i,o,r,_){var u={type:t,props:i,key:o,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==_?++e:_,__i:-1,__u:0};return null==_&&null!=n.vnode&&n.vnode(u),u}function k(){return{current:null}}function w(t){return t.children}function x(t,n){this.props=t,this.context=n}function S(t,n){if(null==n)return t.__?S(t.__,t.__i+1):null;for(var e;n<t.__k.length;n++)if(null!=(e=t.__k[n])&&null!=e.__e)return e.__e;return"function"==typeof t.type?S(t):null}function C(t){var n,e;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,n=0;n<t.__k.length;n++)if(null!=(e=t.__k[n])&&null!=e.__e){t.__e=t.__c.base=e.__e;break}return C(t)}}function U(t){(!t.__d&&(t.__d=!0)&&o.push(t)&&!E.__r++||r!=n.debounceRendering)&&((r=n.debounceRendering)||_)(E)}function E(){for(var t,e,i,r,_,l,f,s=1;o.length;)o.length>s&&o.sort(u),t=o.shift(),s=o.length,t.__d&&(i=void 0,_=(r=(e=t).__v).__e,l=[],f=[],e.__P&&((i=y({},r)).__v=r.__v+1,n.vnode&&n.vnode(i),F(e.__P,i,r,e.__n,e.__P.namespaceURI,32&r.__u?[_]:null,l,null==_?S(r):_,!!(32&r.__u),f),i.__v=r.__v,i.__.__k[i.__i]=i,R(l,i,f),i.__e!=_&&C(i)));E.__r=0}function P(t,n,e,i,o,r,_,u,l,f,s){var c,a,d,v,y,m,g=i&&i.__k||p,b=n.length;for(l=A(e,n,g,l,b),c=0;c<b;c++)null!=(d=e.__k[c])&&(a=-1==d.__i?h:g[d.__i]||h,d.__i=c,m=F(t,d,a,o,r,_,u,l,f,s),v=d.__e,d.ref&&a.ref!=d.ref&&(a.ref&&L(a.ref,null,d),s.push(d.ref,d.__c||v,d)),null==y&&null!=v&&(y=v),4&d.__u||a.__k===d.__k?l=N(d,l,t):"function"==typeof d.type&&void 0!==m?l=m:v&&(l=v.nextSibling),d.__u&=-7);return e.__e=y,l}function A(t,n,e,i,o){var r,_,u,l,f,s=e.length,c=s,a=0;for(t.__k=new Array(o),r=0;r<o;r++)null!=(_=n[r])&&"boolean"!=typeof _&&"function"!=typeof _?(l=r+a,(_=t.__k[r]="string"==typeof _||"number"==typeof _||"bigint"==typeof _||_.constructor==String?b(null,_,null,null,null):v(_)?b(w,{children:_},null,null,null):null==_.constructor&&_.__b>0?b(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_).__=t,_.__b=t.__b+1,u=null,-1!=(f=_.__i=$(_,e,l,c))&&(c--,(u=e[f])&&(u.__u|=2)),null==u||null==u.__v?(-1==f&&(o>s?a--:o<s&&a++),"function"!=typeof _.type&&(_.__u|=4)):f!=l&&(f==l-1?a--:f==l+1?a++:(f>l?a--:a++,_.__u|=4))):t.__k[r]=null;if(c)for(r=0;r<s;r++)null!=(u=e[r])&&0==(2&u.__u)&&(u.__e==i&&(i=S(u)),I(u,u));return i}function N(t,n,e){var i,o;if("function"==typeof t.type){for(i=t.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=t,n=N(i[o],n,e));return n}t.__e!=n&&(n&&t.type&&!e.contains(n)&&(n=S(t)),e.insertBefore(t.__e,n||null),n=t.__e);do{n=n&&n.nextSibling}while(null!=n&&8==n.nodeType);return n}function H(t,n){return n=n||[],null==t||"boolean"==typeof t||(v(t)?t.some((function(t){H(t,n)})):n.push(t)),n}function $(t,n,e,i){var o,r,_=t.key,u=t.type,l=n[e];if(null===l&&null==t.key||l&&_==l.key&&u==l.type&&0==(2&l.__u))return e;if(i>(null!=l&&0==(2&l.__u)?1:0))for(o=e-1,r=e+1;o>=0||r<n.length;){if(o>=0){if((l=n[o])&&0==(2&l.__u)&&_==l.key&&u==l.type)return o;o--}if(r<n.length){if((l=n[r])&&0==(2&l.__u)&&_==l.key&&u==l.type)return r;r++}}return-1}function T(t,n,e){"-"==n[0]?t.setProperty(n,null==e?"":e):t[n]=null==e?"":"number"!=typeof e||d.test(n)?e:e+"px"}function D(t,n,e,i,o){var r,_;t:if("style"==n)if("string"==typeof e)t.style.cssText=e;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(n in i)e&&n in e||T(t.style,n,"");if(e)for(n in e)i&&e[n]==i[n]||T(t.style,n,e[n])}else if("o"==n[0]&&"n"==n[1])r=n!=(n=n.replace(l,"$1")),_=n.toLowerCase(),n=_ in t||"onFocusOut"==n||"onFocusIn"==n?_.slice(2):n.slice(2),t.l||(t.l={}),t.l[n+r]=e,e?i?e.u=i.u:(e.u=f,t.addEventListener(n,r?c:s,r)):t.removeEventListener(n,r?c:s,r);else{if("http://www.w3.org/2000/svg"==o)n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=n&&"height"!=n&&"href"!=n&&"list"!=n&&"form"!=n&&"tabIndex"!=n&&"download"!=n&&"rowSpan"!=n&&"colSpan"!=n&&"role"!=n&&"popover"!=n&&n in t)try{t[n]=null==e?"":e;break t}catch(t){}"function"==typeof e||(null==e||!1===e&&"-"!=n[4]?t.removeAttribute(n):t.setAttribute(n,"popover"==n&&1==e?"":e))}}function M(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e.t)e.t=f++;else if(e.t<i.u)return;return i(n.event?n.event(e):e)}}}function F(t,e,i,o,r,_,u,l,f,s){var c,a,h,p,d,g,b,k,S,C,U,E,A,N,H,$,T,D=e.type;if(null!=e.constructor)return null;128&i.__u&&(f=!!(32&i.__u),_=[l=e.__e=i.__e]),(c=n.__b)&&c(e);t:if("function"==typeof D)try{if(k=e.props,S="prototype"in D&&D.prototype.render,C=(c=D.contextType)&&o[c.__c],U=c?C?C.props.value:c.__:o,i.__c?b=(a=e.__c=i.__c).__=a.__E:(S?e.__c=a=new D(k,U):(e.__c=a=new x(k,U),a.constructor=D,a.render=q),C&&C.sub(a),a.props=k,a.state||(a.state={}),a.context=U,a.__n=o,h=a.__d=!0,a.__h=[],a._sb=[]),S&&null==a.__s&&(a.__s=a.state),S&&null!=D.getDerivedStateFromProps&&(a.__s==a.state&&(a.__s=y({},a.__s)),y(a.__s,D.getDerivedStateFromProps(k,a.__s))),p=a.props,d=a.state,a.__v=e,h)S&&null==D.getDerivedStateFromProps&&null!=a.componentWillMount&&a.componentWillMount(),S&&null!=a.componentDidMount&&a.__h.push(a.componentDidMount);else{if(S&&null==D.getDerivedStateFromProps&&k!==p&&null!=a.componentWillReceiveProps&&a.componentWillReceiveProps(k,U),!a.__e&&null!=a.shouldComponentUpdate&&!1===a.shouldComponentUpdate(k,a.__s,U)||e.__v==i.__v){for(e.__v!=i.__v&&(a.props=k,a.state=a.__s,a.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some((function(t){t&&(t.__=e)})),E=0;E<a._sb.length;E++)a.__h.push(a._sb[E]);a._sb=[],a.__h.length&&u.push(a);break t}null!=a.componentWillUpdate&&a.componentWillUpdate(k,a.__s,U),S&&null!=a.componentDidUpdate&&a.__h.push((function(){a.componentDidUpdate(p,d,g)}))}if(a.context=U,a.props=k,a.__P=t,a.__e=!1,A=n.__r,N=0,S){for(a.state=a.__s,a.__d=!1,A&&A(e),c=a.render(a.props,a.state,a.context),H=0;H<a._sb.length;H++)a.__h.push(a._sb[H]);a._sb=[]}else do{a.__d=!1,A&&A(e),c=a.render(a.props,a.state,a.context),a.state=a.__s}while(a.__d&&++N<25);a.state=a.__s,null!=a.getChildContext&&(o=y(y({},o),a.getChildContext())),S&&!h&&null!=a.getSnapshotBeforeUpdate&&(g=a.getSnapshotBeforeUpdate(p,d)),$=c,null!=c&&c.type===w&&null==c.key&&($=W(c.props.children)),l=P(t,v($)?$:[$],e,i,o,r,_,u,l,f,s),a.base=e.__e,e.__u&=-161,a.__h.length&&u.push(a),b&&(a.__E=a.__=null)}catch(t){if(e.__v=null,f||null!=_)if(t.then){for(e.__u|=f?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;_[_.indexOf(l)]=null,e.__e=l}else for(T=_.length;T--;)m(_[T]);else e.__e=i.__e,e.__k=i.__k;n.__e(t,e,i)}else null==_&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):l=e.__e=O(i.__e,e,i,o,r,_,u,f,s);return(c=n.diffed)&&c(e),128&e.__u?void 0:l}function R(t,e,i){for(var o=0;o<i.length;o++)L(i[o],i[++o],i[++o]);n.__c&&n.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){n.__e(t,e.__v)}}))}function W(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:v(t)?t.map(W):y({},t)}function O(e,i,o,r,_,u,l,f,s){var c,a,p,d,y,g,b,k=o.props,w=i.props,x=i.type;if("svg"==x?_="http://www.w3.org/2000/svg":"math"==x?_="http://www.w3.org/1998/Math/MathML":_||(_="http://www.w3.org/1999/xhtml"),null!=u)for(c=0;c<u.length;c++)if((y=u[c])&&"setAttribute"in y==!!x&&(x?y.localName==x:3==y.nodeType)){e=y,u[c]=null;break}if(null==e){if(null==x)return document.createTextNode(w);e=document.createElementNS(_,x,w.is&&w),f&&(n.__m&&n.__m(i,u),f=!1),u=null}if(null==x)k===w||f&&e.data==w||(e.data=w);else{if(u=u&&t.call(e.childNodes),k=o.props||h,!f&&null!=u)for(k={},c=0;c<e.attributes.length;c++)k[(y=e.attributes[c]).name]=y.value;for(c in k)if(y=k[c],"children"==c);else if("dangerouslySetInnerHTML"==c)p=y;else if(!(c in w)){if("value"==c&&"defaultValue"in w||"checked"==c&&"defaultChecked"in w)continue;D(e,c,null,y,_)}for(c in w)y=w[c],"children"==c?d=y:"dangerouslySetInnerHTML"==c?a=y:"value"==c?g=y:"checked"==c?b=y:f&&"function"!=typeof y||k[c]===y||D(e,c,y,k[c],_);if(a)f||p&&(a.__html==p.__html||a.__html==e.innerHTML)||(e.innerHTML=a.__html),i.__k=[];else if(p&&(e.innerHTML=""),P("template"==i.type?e.content:e,v(d)?d:[d],i,o,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":_,u,l,u?u[0]:o.__k&&S(o,0),f,s),null!=u)for(c=u.length;c--;)m(u[c]);f||(c="value","progress"==x&&null==g?e.removeAttribute("value"):null!=g&&(g!==e[c]||"progress"==x&&!g||"option"==x&&g!=k[c])&&D(e,c,g,k[c],_),c="checked",null!=b&&b!=e[c]&&D(e,c,b,k[c],_))}return e}function L(t,e,i){try{if("function"==typeof t){var o="function"==typeof t.__u;o&&t.__u(),o&&null==e||(t.__u=t(e))}else t.current=e}catch(t){n.__e(t,i)}}function I(t,e,i){var o,r;if(n.unmount&&n.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||L(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){n.__e(t,e)}o.base=o.__P=null}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&I(o[r],e,i||"function"!=typeof t.type);i||m(t.__e),t.__c=t.__=t.__e=void 0}function q(t,n,e){return this.constructor(t,e)}function j(e,i,o){var r,_,u,l;i==document&&(i=document.documentElement),n.__&&n.__(e,i),_=(r="function"==typeof o)?null:o&&o.__k||i.__k,u=[],l=[],F(i,e=(!r&&o||i).__k=g(w,null,[e]),_||h,h,i.namespaceURI,!r&&o?[o]:_?null:i.firstChild?t.call(i.childNodes):null,u,!r&&o?o:_?_.__e:i.firstChild,r,l),R(u,e,l)}function V(t,n){j(t,n,V)}function B(n,e,i){var o,r,_,u,l=y({},n.props);for(_ in n.type&&n.type.defaultProps&&(u=n.type.defaultProps),e)"key"==_?o=e[_]:"ref"==_?r=e[_]:l[_]=void 0===e[_]&&null!=u?u[_]:e[_];return arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):i),b(n.type,l,o||n.key,r||n.ref,null)}function K(t){function n(t){var e,i;return this.getChildContext||(e=new Set,(i={})[n.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){e=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&e.forEach((function(t){t.__e=!0,U(t)}))},this.sub=function(t){e.add(t);var n=t.componentWillUnmount;t.componentWillUnmount=function(){e&&e.delete(t),n&&n.call(t)}}),t.children}return n.__c="__cC"+a++,n.__=t,n.Provider=n.__l=(n.Consumer=function(t,n){return t.children(n)}).contextType=n,n}t=p.slice,n={__e:function(t,n,e,i){for(var o,r,_;n=n.__;)if((o=n.__c)&&!o.__)try{if((r=o.constructor)&&null!=r.getDerivedStateFromError&&(o.setState(r.getDerivedStateFromError(t)),_=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,i||{}),_=o.__d),_)return o.__E=o}catch(n){t=n}throw t}},e=0,i=function(t){return null!=t&&null==t.constructor},x.prototype.setState=function(t,n){var e;e=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=y({},this.state),"function"==typeof t&&(t=t(y({},e),this.props)),t&&y(e,t),null!=t&&this.__v&&(n&&this._sb.push(n),U(this))},x.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),U(this))},x.prototype.render=w,o=[],_="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(t,n){return t.__v.__b-n.__v.__b},E.__r=0,l=/(PointerCapture)$|Capture$/i,f=0,s=M(!1),c=M(!0),a=0;var Z,z,G,J,Q=0,X=[],Y=n,tt=Y.__b,nt=Y.__r,et=Y.diffed,it=Y.__c,ot=Y.unmount,rt=Y.__;function _t(t,n){Y.__h&&Y.__h(z,t,Q||n),Q=0;var e=z.__H||(z.__H={__:[],__h:[]});return t>=e.__.length&&e.__.push({}),e.__[t]}function ut(t){return Q=1,lt(Ct,t)}function lt(t,n,e){var i=_t(Z++,2);if(i.t=t,!i.__c&&(i.__=[e?e(n):Ct(void 0,n),function(t){var n=i.__N?i.__N[0]:i.__[0],e=i.t(n,t);n!==e&&(i.__N=[e,i.__[1]],i.__c.setState({}))}],i.__c=z,!z.__f)){var o=function(t,n,e){if(!i.__c.__H)return!0;var o=i.__c.__H.__.filter((function(t){return!!t.__c}));if(o.every((function(t){return!t.__N})))return!r||r.call(this,t,n,e);var _=i.__c.props!==t;return o.forEach((function(t){if(t.__N){var n=t.__[0];t.__=t.__N,t.__N=void 0,n!==t.__[0]&&(_=!0)}})),r&&r.call(this,t,n,e)||_};z.__f=!0;var r=z.shouldComponentUpdate,_=z.componentWillUpdate;z.componentWillUpdate=function(t,n,e){if(this.__e){var i=r;r=void 0,o(t,n,e),r=i}_&&_.call(this,t,n,e)},z.shouldComponentUpdate=o}return i.__N||i.__}function ft(t,n){var e=_t(Z++,3);!Y.__s&&St(e.__H,n)&&(e.__=t,e.u=n,z.__H.__h.push(e))}function st(t,n){var e=_t(Z++,4);!Y.__s&&St(e.__H,n)&&(e.__=t,e.u=n,z.__h.push(e))}function ct(t){return Q=5,ht((function(){return{current:t}}),[])}function at(t,n,e){Q=6,st((function(){if("function"==typeof t){var e=t(n());return function(){t(null),e&&"function"==typeof e&&e()}}if(t)return t.current=n(),function(){return t.current=null}}),null==e?e:e.concat(t))}function ht(t,n){var e=_t(Z++,7);return St(e.__H,n)&&(e.__=t(),e.__H=n,e.__h=t),e.__}function pt(t,n){return Q=8,ht((function(){return t}),n)}function dt(t){var n=z.context[t.__c],e=_t(Z++,9);return e.c=t,n?(null==e.__&&(e.__=!0,n.sub(z)),n.props.value):t.__}function vt(t,n){Y.useDebugValue&&Y.useDebugValue(n?n(t):t)}function yt(t){var n=_t(Z++,10),e=ut();return n.__=t,z.componentDidCatch||(z.componentDidCatch=function(t,i){n.__&&n.__(t,i),e[1](t)}),[e[0],function(){e[1](void 0)}]}function mt(){var t=_t(Z++,11);if(!t.__){for(var n=z.__v;null!==n&&!n.__m&&null!==n.__;)n=n.__;var e=n.__m||(n.__m=[0,0]);t.__="P"+e[0]+"-"+e[1]++}return t.__}function gt(){for(var t;t=X.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(wt),t.__H.__h.forEach(xt),t.__H.__h=[]}catch(i){t.__H.__h=[],Y.__e(i,t.__v)}}Y.__b=function(t){z=null,tt&&tt(t)},Y.__=function(t,n){t&&n.__k&&n.__k.__m&&(t.__m=n.__k.__m),rt&&rt(t,n)},Y.__r=function(t){nt&&nt(t),Z=0;var n=(z=t.__c).__H;n&&(G===z?(n.__h=[],z.__h=[],n.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(n.__h.forEach(wt),n.__h.forEach(xt),n.__h=[],Z=0)),G=z},Y.diffed=function(t){et&&et(t);var n=t.__c;n&&n.__H&&(n.__H.__h.length&&(1!==X.push(n)&&J===Y.requestAnimationFrame||((J=Y.requestAnimationFrame)||kt)(gt)),n.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),G=z=null},Y.__c=function(t,n){n.some((function(t){try{t.__h.forEach(wt),t.__h=t.__h.filter((function(t){return!t.__||xt(t)}))}catch(r){n.some((function(t){t.__h&&(t.__h=[])})),n=[],Y.__e(r,t.__v)}})),it&&it(t,n)},Y.unmount=function(t){ot&&ot(t);var n,e=t.__c;e&&e.__H&&(e.__H.__.forEach((function(t){try{wt(t)}catch(t){n=t}})),e.__H=void 0,n&&Y.__e(n,e.__v))};var bt="function"==typeof requestAnimationFrame;function kt(t){var n,e=function(){clearTimeout(i),bt&&cancelAnimationFrame(n),setTimeout(t)},i=setTimeout(e,35);bt&&(n=requestAnimationFrame(e))}function wt(t){var n=z,e=t.__c;"function"==typeof e&&(t.__c=void 0,e()),z=n}function xt(t){var n=z;t.__c=t.__(),z=n}function St(t,n){return!t||t.length!==n.length||n.some((function(n,e){return n!==t[e]}))}function Ct(t,n){return"function"==typeof n?n(t):n}var Ut=function(t,n,e,i){var o;n[0]=0;for(var r=1;r<n.length;r++){var _=n[r++],u=n[r]?(n[0]|=_?1:2,e[n[r++]]):n[++r];3===_?i[0]=u:4===_?i[1]=Object.assign(i[1]||{},u):5===_?(i[1]=i[1]||{})[n[++r]]=u:6===_?i[1][n[++r]]+=u+"":_?(o=t.apply(u,Ut(t,u,e,["",null])),i.push(o),u[0]?n[0]|=2:(n[r-2]=0,n[r]=o)):i.push(u)}return i},Et=new Map;function Pt(t){var n=Et.get(this);return n||(n=new Map,Et.set(this,n)),(n=Ut(this,n.get(t)||(n.set(t,n=function(t){for(var n,e,i=1,o="",r="",_=[0],u=function(t){1===i&&(t||(o=o.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?_.push(0,t,o):3===i&&(t||o)?(_.push(3,t,o),i=2):2===i&&"..."===o&&t?_.push(4,t,0):2===i&&o&&!t?_.push(5,0,!0,o):i>=5&&((o||!t&&5===i)&&(_.push(i,0,o,e),i=6),t&&(_.push(i,t,0,e),i=6)),o=""},l=0;l<t.length;l++){l&&(1===i&&u(),u(l));for(var f=0;f<t[l].length;f++)n=t[l][f],1===i?"<"===n?(u(),_=[_],i=3):o+=n:4===i?"--"===o&&">"===n?(i=1,o=""):o=n+o[0]:r?n===r?r="":o+=n:'"'===n||"'"===n?r=n:">"===n?(u(),i=1):i&&("="===n?(i=5,e=o,o=""):"/"===n&&(i<5||">"===t[l][f+1])?(u(),3===i&&(_=_[0]),i=_,(_=_[0]).push(2,0,i),i=0):" "===n||"\t"===n||"\n"===n||"\r"===n?(u(),i=2):o+=n),3===i&&"!--"===o&&(i=4,_=_[0])}return u(),_}(t)),n),arguments,[])).length>1?n:n[0]}var At=Pt.bind(g);var Nt={};function Ht(t,n){for(var e in n)t[e]=n[e];return t}function $t(t,n,e){var i,o=/(?:\?([^#]*))?(#.*)?$/,r=t.match(o),_={};if(r&&r[1])for(var u=r[1].split("&"),l=0;l<u.length;l++){var f=u[l].split("=");_[decodeURIComponent(f[0])]=decodeURIComponent(f.slice(1).join("="))}t=Mt(t.replace(o,"")),n=Mt(n||"");for(var s=Math.max(t.length,n.length),c=0;c<s;c++)if(n[c]&&":"===n[c].charAt(0)){var a=n[c].replace(/(^:|[+*?]+$)/g,""),h=(n[c].match(/[+*?]+$/)||Nt)[0]||"",p=~h.indexOf("+"),d=~h.indexOf("*"),v=t[c]||"";if(!v&&!d&&(h.indexOf("?")<0||p)){i=!1;break}if(_[a]=decodeURIComponent(v),p||d){_[a]=t.slice(c).map(decodeURIComponent).join("/");break}}else if(n[c]!==t[c]){i=!1;break}return(!0===e.default||!1!==i)&&_}function Tt(t,n){return t.rank<n.rank?1:t.rank>n.rank?-1:t.index-n.index}function Dt(t,n){return t.index=n,t.rank=function(t){return t.props.default?0:Mt(t.props.path).map(Ft).join("")}(t),t.props}function Mt(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}function Ft(t){return":"==t.charAt(0)?1+"*+?".indexOf(t.charAt(t.length-1))||4:5}var Rt={},Wt=[],Ot=[],Lt=null,It={url:Vt()},qt=K(It);function jt(){var t=dt(qt);if(t===It){var n=ut()[1];ft((function(){return Ot.push(n),function(){return Ot.splice(Ot.indexOf(n),1)}}),[])}return[t,Bt]}function Vt(){var t;return""+((t=Lt&&Lt.location?Lt.location:Lt&&Lt.getCurrentLocation?Lt.getCurrentLocation():"undefined"!=typeof location?location:Rt).pathname||"")+(t.search||"")}function Bt(t,n){return void 0===n&&(n=!1),"string"!=typeof t&&t.url&&(n=t.replace,t=t.url),function(t){for(var n=Wt.length;n--;)if(Wt[n].canRoute(t))return!0;return!1}(t)&&function(t,n){void 0===n&&(n="push"),Lt&&Lt[n]?Lt[n](t):"undefined"!=typeof history&&history[n+"State"]&&history[n+"State"](null,null,t)}(t,n?"replace":"push"),Kt(t)}function Kt(t){for(var n=!1,e=0;e<Wt.length;e++)Wt[e].routeTo(t)&&(n=!0);return n}function Zt(t){if(t&&t.getAttribute){var n=t.getAttribute("href"),e=t.getAttribute("target");if(n&&n.match(/^\//g)&&(!e||e.match(/^_?self$/i)))return Bt(n)}}function zt(t){return t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation(),t.preventDefault(),!1}function Gt(t){if(!(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button)){var n=t.target;do{if("a"===n.localName&&n.getAttribute("href")){if(n.hasAttribute("data-native")||n.hasAttribute("native"))return;if(Zt(n))return zt(t)}}while(n=n.parentNode)}}var Jt=!1;function Qt(t){t.history&&(Lt=t.history),this.state={url:t.url||Vt()}}Ht(Qt.prototype=new x,{shouldComponentUpdate:function(t){return!0!==t.static||t.url!==this.props.url||t.onChange!==this.props.onChange},canRoute:function(t){var n=H(this.props.children);return void 0!==this.g(n,t)},routeTo:function(t){this.setState({url:t});var n=this.canRoute(t);return this.p||this.forceUpdate(),n},componentWillMount:function(){this.p=!0},componentDidMount:function(){var t=this;Jt||(Jt=!0,Lt||addEventListener("popstate",(function(){Kt(Vt())})),addEventListener("click",Gt)),Wt.push(this),Lt&&(this.u=Lt.listen((function(n){var e=n.location||n;t.routeTo(""+(e.pathname||"")+(e.search||""))}))),this.p=!1},componentWillUnmount:function(){"function"==typeof this.u&&this.u(),Wt.splice(Wt.indexOf(this),1)},componentWillUpdate:function(){this.p=!0},componentDidUpdate:function(){this.p=!1},g:function(t,n){t=t.filter(Dt).sort(Tt);for(var e=0;e<t.length;e++){var i=t[e],o=$t(n,i.props.path,i.props);if(o)return[i,o]}},render:function(t,n){var e,i,o=t.onChange,r=n.url,_=this.c,u=this.g(H(t.children),r);if(u&&(i=B(u[0],Ht(Ht({url:r,matches:e=u[1]},e),{key:void 0,ref:void 0}))),r!==(_&&_.url)){Ht(It,_=this.c={url:r,previous:_&&_.url,current:i,path:i?i.props.path:null,matches:e}),_.router=this,_.active=i?[i]:[];for(var l=Ot.length;l--;)Ot[l]({});"function"==typeof o&&o(_)}return g(qt.Provider,{value:_},i)}});var Xt=function(t){return g("a",Ht({onClick:Gt},t))},Yt=function(t){return g(t.component,t)};const tn=Symbol.for("preact-signals");function nn(){if(un>1){un--;return}let t,n=!1;while(void 0!==rn){let e=rn;rn=void 0;ln++;while(void 0!==e){const i=e.o;e.o=void 0;e.f&=-3;if(!(8&e.f)&&hn(e))try{e.c()}catch(_){if(!n){t=_;n=!0}}e=i}}ln=0;un--;if(n)throw t}function en(t){if(un>0)return t();un++;try{return t()}finally{nn()}}let on,rn;function _n(t){const n=on;on=void 0;try{return t()}finally{on=n}}let un=0,ln=0,fn=0;function sn(t){if(void 0===on)return;let n=t.n;if(void 0===n||n.t!==on){n={i:0,S:t,p:on.s,n:void 0,t:on,e:void 0,x:void 0,r:n};if(void 0!==on.s)on.s.n=n;on.s=n;t.n=n;if(32&on.f)t.S(n);return n}else if(-1===n.i){n.i=0;if(void 0!==n.n){n.n.p=n.p;if(void 0!==n.p)n.p.n=n.n;n.p=on.s;n.n=void 0;on.s.n=n;on.s=n}return n}}function cn(t,n){this.v=t;this.i=0;this.n=void 0;this.t=void 0;this.W=null==n?void 0:n.watched;this.Z=null==n?void 0:n.unwatched}cn.prototype.brand=tn;cn.prototype.h=function(){return!0};cn.prototype.S=function(t){const n=this.t;if(n!==t&&void 0===t.e){t.x=n;this.t=t;if(void 0!==n)n.e=t;else _n(()=>{var t;null==(t=this.W)||t.call(this)})}};cn.prototype.U=function(t){if(void 0!==this.t){const n=t.e,e=t.x;if(void 0!==n){n.x=e;t.e=void 0}if(void 0!==e){e.e=n;t.x=void 0}if(t===this.t){this.t=e;if(void 0===e)_n(()=>{var t;null==(t=this.Z)||t.call(this)})}}};cn.prototype.subscribe=function(t){return wn(()=>{const n=this.value,e=on;on=void 0;try{t(n)}finally{on=e}})};cn.prototype.valueOf=function(){return this.value};cn.prototype.toString=function(){return this.value+""};cn.prototype.toJSON=function(){return this.value};cn.prototype.peek=function(){const t=on;on=void 0;try{return this.value}finally{on=t}};Object.defineProperty(cn.prototype,"value",{get(){const t=sn(this);if(void 0!==t)t.i=this.i;return this.v},set(t){if(t!==this.v){if(ln>100)throw new Error("Cycle detected");this.v=t;this.i++;fn++;un++;try{for(let t=this.t;void 0!==t;t=t.x)t.t.N()}finally{nn()}}}});function an(t,n){return new cn(t,n)}function hn(t){for(let n=t.s;void 0!==n;n=n.n)if(n.S.i!==n.i||!n.S.h()||n.S.i!==n.i)return!0;return!1}function pn(t){for(let n=t.s;void 0!==n;n=n.n){const e=n.S.n;if(void 0!==e)n.r=e;n.S.n=n;n.i=-1;if(void 0===n.n){t.s=n;break}}}function dn(t){let n,e=t.s;while(void 0!==e){const t=e.p;if(-1===e.i){e.S.U(e);if(void 0!==t)t.n=e.n;if(void 0!==e.n)e.n.p=t}else n=e;e.S.n=e.r;if(void 0!==e.r)e.r=void 0;e=t}t.s=n}function vn(t,n){cn.call(this,void 0);this.x=t;this.s=void 0;this.g=fn-1;this.f=4;this.W=null==n?void 0:n.watched;this.Z=null==n?void 0:n.unwatched}vn.prototype=new cn;vn.prototype.h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===fn)return!0;this.g=fn;this.f|=1;if(this.i>0&&!hn(this)){this.f&=-2;return!0}const t=on;try{pn(this);on=this;const t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(t){this.v=t;this.f|=16;this.i++}on=t;dn(this);this.f&=-2;return!0};vn.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(let t=this.s;void 0!==t;t=t.n)t.S.S(t)}cn.prototype.S.call(this,t)};vn.prototype.U=function(t){if(void 0!==this.t){cn.prototype.U.call(this,t);if(void 0===this.t){this.f&=-33;for(let t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};vn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let t=this.t;void 0!==t;t=t.x)t.t.N()}};Object.defineProperty(vn.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const t=sn(this);this.h();if(void 0!==t)t.i=this.i;if(16&this.f)throw this.v;return this.v}});function yn(t,n){return new vn(t,n)}function mn(t){const n=t.u;t.u=void 0;if("function"==typeof n){un++;const e=on;on=void 0;try{n()}catch(i){t.f&=-2;t.f|=8;gn(t);throw i}finally{on=e;nn()}}}function gn(t){for(let n=t.s;void 0!==n;n=n.n)n.S.U(n);t.x=void 0;t.s=void 0;mn(t)}function bn(t){if(on!==this)throw new Error("Out-of-order effect");dn(this);on=t;this.f&=-2;if(8&this.f)gn(this);nn()}function kn(t){this.x=t;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}kn.prototype.c=function(){const t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const n=this.x();if("function"==typeof n)this.u=n}finally{t()}};kn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;mn(this);pn(this);un++;const t=on;on=this;return bn.bind(this,t)};kn.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=rn;rn=this}};kn.prototype.d=function(){this.f|=8;if(!(1&this.f))gn(this)};kn.prototype.dispose=function(){this.d()};function wn(t){const n=new kn(t);try{n.c()}catch(t){n.d();throw t}return n.d.bind(n)}let xn,Sn,Cn,Un=[],En=[];wn((function(){xn=this.N}))();function Pn(t,e){n[t]=e.bind(null,n[t]||(()=>{}))}function An(t){if(Cn)Cn();Cn=t&&t.S()}function Nn({data:t}){const n=$n(t);n.value=t;const[e,o]=ht(()=>{let t=this,e=this.__v;while(e=e.__)if(e.__c){e.__c.__$f|=4;break}const o=yn(()=>{let t=n.value.value;return 0===t?0:!0===t?"":t||""}),r=yn(()=>!Array.isArray(o.value)&&!i(o.value)),_=wn((function(){this.N=On;if(r.value){const n=o.value;if(t.__v&&t.__v.__e&&3===t.__v.__e.nodeType)t.__v.__e.data=n}})),u=this.__$u.d;this.__$u.d=function(){_();u.call(this)};return[r,o]},[]);return e.value?o.peek():o.value}Nn.displayName="_st";Object.defineProperties(cn.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Nn},props:{configurable:!0,get(){return{data:this}}},__b:{configurable:!0,value:1}});Pn("__b",(t,n)=>{if("string"==typeof n.type){let t,e=n.props;for(let i in e){if("children"===i)continue;let o=e[i];if(o instanceof cn){if(!t)n.__np=t={};t[i]=o;e[i]=o.peek()}}}t(n)});Pn("__r",(t,n)=>{if(n.type!==w){An();let t,e=n.__c;if(e){e.__$f&=-2;t=e.__$u;if(void 0===t)e.__$u=t=function(t){let n;wn((function(){n=this}));n.c=()=>{e.__$f|=1;e.setState({})};return n}()}Sn=e;An(t)}t(n)});Pn("__e",(t,n,e,i)=>{An();Sn=void 0;t(n,e,i)});Pn("diffed",(t,n)=>{An();Sn=void 0;let e;if("string"==typeof n.type&&(e=n.__e)){let t=n.__np,i=n.props;if(t){let n=e.U;if(n)for(let e in n){let i=n[e];if(void 0!==i&&!(e in t)){i.d();n[e]=void 0}}else{n={};e.U=n}for(let o in t){let r=n[o],_=t[o];if(void 0===r){r=Hn(e,o,_,i);n[o]=r}else r.o(_,i)}}}t(n)});function Hn(t,n,e,i){const o=n in t&&void 0===t.ownerSVGElement,r=an(e);return{o:(t,n)=>{r.value=t;i=n},d:wn((function(){this.N=On;const e=r.value.value;if(i[n]!==e){i[n]=e;if(o)t[n]=e;else if(e)t.setAttribute(n,e);else t.removeAttribute(n)}}))}}Pn("unmount",(t,n)=>{if("string"==typeof n.type){let t=n.__e;if(t){const n=t.U;if(n){t.U=void 0;for(let t in n){let e=n[t];if(e)e.d()}}}}else{let t=n.__c;if(t){const n=t.__$u;if(n){t.__$u=void 0;n.d()}}}t(n)});Pn("__h",(t,n,e,i)=>{if(i<3||9===i)n.__$f|=2;t(n,e,i)});x.prototype.shouldComponentUpdate=function(t,n){const e=this.__$u,i=e&&void 0!==e.s;for(let o in n)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){const t=2&this.__$f;if(!(i||t||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(i||4&this.__$f))return!0;if(3&this.__$f)return!0}for(let o in t)if("__source"!==o&&t[o]!==this.props[o])return!0;for(let o in this.props)if(!(o in t))return!0;return!1};function $n(t,n){return ht(()=>an(t,n),[])}function Tn(t,n){const e=ct(t);e.current=t;Sn.__$f|=4;return ht(()=>yn(()=>e.current(),n),[])}const Dn="undefined"==typeof requestAnimationFrame?setTimeout:function(t){const n=()=>{clearTimeout(e);cancelAnimationFrame(i);t()},e=setTimeout(n,35),i=requestAnimationFrame(n)},Mn=t=>{queueMicrotask(()=>{queueMicrotask(t)})};function Fn(){en(()=>{let t;while(t=Un.shift())xn.call(t)})}function Rn(){if(1===Un.push(this))(n.requestAnimationFrame||Dn)(Fn)}function Wn(){en(()=>{let t;while(t=En.shift())xn.call(t)})}function On(){if(1===En.push(this))(n.requestAnimationFrame||Mn)(Wn)}function Ln(t){const n=ct(t);n.current=t;ft(()=>wn((function(){this.N=Rn;return n.current()})),[])}export{x as Component,w as Fragment,Xt as Link,Yt as Route,Qt as Router,cn as Signal,en as batch,B as cloneElement,yn as computed,K as createContext,g as createElement,k as createRef,wn as effect,$t as exec,Vt as getCurrentUrl,g as h,At as html,V as hydrate,i as isValidElement,n as options,j as render,Bt as route,an as signal,H as toChildArray,_n as untracked,pt as useCallback,Tn as useComputed,dt as useContext,vt as useDebugValue,ft as useEffect,yt as useErrorBoundary,mt as useId,at as useImperativeHandle,st as useLayoutEffect,ht as useMemo,lt as useReducer,ct as useRef,jt as useRouter,$n as useSignal,Ln as useSignalEffect,ut as useState}; |