@preact/signals-devtools-ui 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @preact/signals-devtools-ui
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#837](https://github.com/preactjs/signals/pull/837) [`0e0625d`](https://github.com/preactjs/signals/commit/0e0625d12f9a7a7770d2e24c63d5cff7cb422c25) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Ensure all component/effect dependencies are always visualized in the Graph
8
+
9
+ ### Patch Changes
10
+
11
+ - [#849](https://github.com/preactjs/signals/pull/849) [`3a490fe`](https://github.com/preactjs/signals/commit/3a490fe5d74dad9b2273323d118b930ee81ea730) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Improve sorting of nodes/links in the graph
12
+
13
+ - Updated dependencies [[`0e0625d`](https://github.com/preactjs/signals/commit/0e0625d12f9a7a7770d2e24c63d5cff7cb422c25)]:
14
+ - @preact/signals-devtools-adapter@0.3.0
15
+
16
+ ## 0.2.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [#828](https://github.com/preactjs/signals/pull/828) [`030e428`](https://github.com/preactjs/signals/commit/030e428cb0427b955c5dc38aea56550fda2c58bb) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Allow for disabling console.log debugging from devtools
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [[`030e428`](https://github.com/preactjs/signals/commit/030e428cb0427b955c5dc38aea56550fda2c58bb)]:
25
+ - @preact/signals-devtools-adapter@0.2.0
26
+
3
27
  ## 0.1.1
4
28
 
5
29
  ### Patch Changes
@@ -1 +1 @@
1
- function n(n,t){(null==t||t>n.length)&&(t=n.length);for(var i=0,e=Array(t);i<t;i++)e[i]=n[i];return e}function t(t,i){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,i){if(t){if("string"==typeof t)return n(t,i);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,i):void 0}}(t))||i&&t&&"number"==typeof t.length){e&&(t=e);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(){return i=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var e in i)({}).hasOwnProperty.call(i,e)&&(n[e]=i[e])}return n},i.apply(null,arguments)}var e,r,o,u,a,l,c,s,f,d,h,v,p={},m=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function b(n,t){for(var i in t)n[i]=t[i];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function N(n,t,i,e,u){var a={type:n,props:t,key:i,ref:e,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==u?++o:u,__i:-1,__u:0};return null==u&&null!=r.vnode&&r.vnode(a),a}function x(n){return n.children}function _(n,t){this.props=n,this.context=t}function k(n,t){if(null==t)return n.__?k(n.__,n.__i+1):null;for(var i;t<n.__k.length;t++)if(null!=(i=n.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof n.type?k(n):null}function C(n){var t,i;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,t=0;t<n.__k.length;t++)if(null!=(i=n.__k[t])&&null!=i.__e){n.__e=n.__c.base=i.__e;break}return C(n)}}function S(n){(!n.__d&&(n.__d=!0)&&a.push(n)&&!M.__r++||l!=r.debounceRendering)&&((l=r.debounceRendering)||c)(M)}function M(){for(var n,t,i,e,o,u,l,c=1;a.length;)a.length>c&&a.sort(s),n=a.shift(),c=a.length,n.__d&&(i=void 0,e=void 0,o=(e=(t=n).__v).__e,u=[],l=[],t.__P&&((i=b({},e)).__v=e.__v+1,r.vnode&&r.vnode(i),O(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[o]:null,u,null==o?k(e):o,!!(32&e.__u),l),i.__v=e.__v,i.__.__k[i.__i]=i,j(u,i,l),e.__e=e.__=null,i.__e!=o&&C(i)));M.__r=0}function A(n,t,i,e,r,o,u,a,l,c,s){var f,d,h,v,g,b,w,_=e&&e.__k||m,C=t.length;for(l=function(n,t,i,e,r){var o,u,a,l,c,s=i.length,f=s,d=0;for(n.__k=new Array(r),o=0;o<r;o++)null!=(u=t[o])&&"boolean"!=typeof u&&"function"!=typeof u?(l=o+d,(u=n.__k[o]="string"==typeof u||"number"==typeof u||"bigint"==typeof u||u.constructor==String?N(null,u,null,null,null):y(u)?N(x,{children:u},null,null,null):null==u.constructor&&u.__b>0?N(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):u).__=n,u.__b=n.__b+1,a=null,-1!=(c=u.__i=U(u,i,l,f))&&(f--,(a=i[c])&&(a.__u|=2)),null==a||null==a.__v?(-1==c&&(r>s?d--:r<s&&d++),"function"!=typeof u.type&&(u.__u|=4)):c!=l&&(c==l-1?d--:c==l+1?d++:(c>l?d--:d++,u.__u|=4))):n.__k[o]=null;if(f)for(o=0;o<s;o++)null!=(a=i[o])&&0==(2&a.__u)&&(a.__e==e&&(e=k(a)),q(a,a));return e}(i,t,_,l,C),f=0;f<C;f++)null!=(h=i.__k[f])&&(d=-1==h.__i?p:_[h.__i]||p,h.__i=f,b=O(n,h,d,r,o,u,a,l,c,s),v=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&$(d.ref,null,h),s.push(h.ref,h.__c||v,h)),null==g&&null!=v&&(g=v),(w=!!(4&h.__u))||d.__k===h.__k?l=P(h,l,n,w):"function"==typeof h.type&&void 0!==b?l=b:v&&(l=v.nextSibling),h.__u&=-7);return i.__e=g,l}function P(n,t,i,e){var r,o;if("function"==typeof n.type){for(r=n.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=n,t=P(r[o],t,i,e));return t}n.__e!=t&&(e&&(t&&n.type&&!t.parentNode&&(t=k(n)),i.insertBefore(n.__e,t||null)),t=n.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function U(n,t,i,e){var r,o,u,a=n.key,l=n.type,c=t[i],s=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||s&&a==c.key&&l==c.type)return i;if(e>(s?1:0))for(r=i-1,o=i+1;r>=0||o<t.length;)if(null!=(c=t[u=r>=0?r--:o++])&&0==(2&c.__u)&&a==c.key&&l==c.type)return u;return-1}function T(n,t,i){"-"==t[0]?n.setProperty(t,null==i?"":i):n[t]=null==i?"":"number"!=typeof i||g.test(t)?i:i+"px"}function D(n,t,i,e,r){var o,u;n:if("style"==t)if("string"==typeof i)n.style.cssText=i;else{if("string"==typeof e&&(n.style.cssText=e=""),e)for(t in e)i&&t in i||T(n.style,t,"");if(i)for(t in i)e&&i[t]==e[t]||T(n.style,t,i[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(f,"$1")),u=t.toLowerCase(),t=u in n||"onFocusOut"==t||"onFocusIn"==t?u.slice(2):t.slice(2),n.l||(n.l={}),n.l[t+o]=i,i?e?i.u=e.u:(i.u=d,n.addEventListener(t,o?v:h,o)):n.removeEventListener(t,o?v:h,o);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in n)try{n[t]=null==i?"":i;break n}catch(n){}"function"==typeof i||(null==i||!1===i&&"-"!=t[4]?n.removeAttribute(t):n.setAttribute(t,"popover"==t&&1==i?"":i))}}function I(n){return function(t){if(this.l){var i=this.l[t.type+n];if(null==t.t)t.t=d++;else if(t.t<i.u)return;return i(r.event?r.event(t):t)}}}function O(n,t,i,e,o,u,a,l,c,s){var f,d,h,v,p,m,g,N,k,C,S,M,P,U,T,D,I,O=t.type;if(null!=t.constructor)return null;128&i.__u&&(c=!!(32&i.__u),u=[l=t.__e=i.__e]),(f=r.__b)&&f(t);n:if("function"==typeof O)try{if(N=t.props,k="prototype"in O&&O.prototype.render,C=(f=O.contextType)&&e[f.__c],S=f?C?C.props.value:f.__:e,i.__c?g=(d=t.__c=i.__c).__=d.__E:(k?t.__c=d=new O(N,S):(t.__c=d=new _(N,S),d.constructor=O,d.render=L),C&&C.sub(d),d.props=N,d.state||(d.state={}),d.context=S,d.__n=e,h=d.__d=!0,d.__h=[],d.m=[]),k&&null==d.__s&&(d.__s=d.state),k&&null!=O.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=b({},d.__s)),b(d.__s,O.getDerivedStateFromProps(N,d.__s))),v=d.props,p=d.state,d.__v=t,h)k&&null==O.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),k&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(k&&null==O.getDerivedStateFromProps&&N!==v&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(N,S),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(N,d.__s,S)||t.__v==i.__v){for(t.__v!=i.__v&&(d.props=N,d.state=d.__s,d.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(n){n&&(n.__=t)}),M=0;M<d.m.length;M++)d.__h.push(d.m[M]);d.m=[],d.__h.length&&a.push(d);break n}null!=d.componentWillUpdate&&d.componentWillUpdate(N,d.__s,S),k&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(v,p,m)})}if(d.context=S,d.props=N,d.__P=n,d.__e=!1,P=r.__r,U=0,k){for(d.state=d.__s,d.__d=!1,P&&P(t),f=d.render(d.props,d.state,d.context),T=0;T<d.m.length;T++)d.__h.push(d.m[T]);d.m=[]}else do{d.__d=!1,P&&P(t),f=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++U<25);d.state=d.__s,null!=d.getChildContext&&(e=b(b({},e),d.getChildContext())),k&&!h&&null!=d.getSnapshotBeforeUpdate&&(m=d.getSnapshotBeforeUpdate(v,p)),D=f,null!=f&&f.type===x&&null==f.key&&(D=F(f.props.children)),l=A(n,y(D)?D:[D],t,i,e,o,u,a,l,c,s),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),g&&(d.__E=d.__=null)}catch(n){if(t.__v=null,c||null!=u)if(n.then){for(t.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;u[u.indexOf(l)]=null,t.__e=l}else{for(I=u.length;I--;)w(u[I]);E(t)}else t.__e=i.__e,t.__k=i.__k,n.then||E(t);r.__e(n,t,i)}else null==u&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):l=t.__e=R(i.__e,t,i,e,o,u,a,c,s);return(f=r.diffed)&&f(t),128&t.__u?void 0:l}function E(n){n&&n.__c&&(n.__c.__e=!0),n&&n.__k&&n.__k.forEach(E)}function j(n,t,i){for(var e=0;e<i.length;e++)$(i[e],i[++e],i[++e]);r.__c&&r.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){r.__e(n,t.__v)}})}function F(n){return"object"!=typeof n||null==n||n.__b&&n.__b>0?n:y(n)?n.map(F):b({},n)}function R(n,t,i,o,u,a,l,c,s){var f,d,h,v,m,g,b,N=i.props,x=t.props,_=t.type;if("svg"==_?u="http://www.w3.org/2000/svg":"math"==_?u="http://www.w3.org/1998/Math/MathML":u||(u="http://www.w3.org/1999/xhtml"),null!=a)for(f=0;f<a.length;f++)if((m=a[f])&&"setAttribute"in m==!!_&&(_?m.localName==_:3==m.nodeType)){n=m,a[f]=null;break}if(null==n){if(null==_)return document.createTextNode(x);n=document.createElementNS(u,_,x.is&&x),c&&(r.__m&&r.__m(t,a),c=!1),a=null}if(null==_)N===x||c&&n.data==x||(n.data=x);else{if(a=a&&e.call(n.childNodes),N=i.props||p,!c&&null!=a)for(N={},f=0;f<n.attributes.length;f++)N[(m=n.attributes[f]).name]=m.value;for(f in N)if(m=N[f],"children"==f);else if("dangerouslySetInnerHTML"==f)h=m;else if(!(f in x)){if("value"==f&&"defaultValue"in x||"checked"==f&&"defaultChecked"in x)continue;D(n,f,null,m,u)}for(f in x)m=x[f],"children"==f?v=m:"dangerouslySetInnerHTML"==f?d=m:"value"==f?g=m:"checked"==f?b=m:c&&"function"!=typeof m||N[f]===m||D(n,f,m,N[f],u);if(d)c||h&&(d.__html==h.__html||d.__html==n.innerHTML)||(n.innerHTML=d.__html),t.__k=[];else if(h&&(n.innerHTML=""),A("template"==t.type?n.content:n,y(v)?v:[v],t,i,o,"foreignObject"==_?"http://www.w3.org/1999/xhtml":u,a,l,a?a[0]:i.__k&&k(i,0),c,s),null!=a)for(f=a.length;f--;)w(a[f]);c||(f="value","progress"==_&&null==g?n.removeAttribute("value"):null!=g&&(g!==n[f]||"progress"==_&&!g||"option"==_&&g!=N[f])&&D(n,f,g,N[f],u),f="checked",null!=b&&b!=n[f]&&D(n,f,b,N[f],u))}return n}function $(n,t,i){try{if("function"==typeof n){var e="function"==typeof n.__u;e&&n.__u(),e&&null==t||(n.__u=n(t))}else n.current=t}catch(n){r.__e(n,i)}}function q(n,t,i){var e,o;if(r.unmount&&r.unmount(n),(e=n.ref)&&(e.current&&e.current!=n.__e||$(e,null,t)),null!=(e=n.__c)){if(e.componentWillUnmount)try{e.componentWillUnmount()}catch(n){r.__e(n,t)}e.base=e.__P=null}if(e=n.__k)for(o=0;o<e.length;o++)e[o]&&q(e[o],t,i||"function"!=typeof n.type);i||w(n.__e),n.__c=n.__=n.__e=void 0}function L(n,t,i){return this.constructor(n,i)}function z(n,t,i){var o,u,a,l;t==document&&(t=document.documentElement),r.__&&r.__(n,t),u=(o="function"==typeof i)?null:i&&i.__k||t.__k,a=[],l=[],O(t,n=(!o&&i||t).__k=function(n,t,i){var r,o,u,a={};for(u in t)"key"==u?r=t[u]:"ref"==u?o=t[u]:a[u]=t[u];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):i),"function"==typeof n&&null!=n.defaultProps)for(u in n.defaultProps)void 0===a[u]&&(a[u]=n.defaultProps[u]);return N(n,a,r,o,null)}(x,null,[n]),u||p,p,t.namespaceURI,!o&&i?[i]:u?null:t.firstChild?e.call(t.childNodes):null,a,!o&&i?i:u?u.__e:t.firstChild,o,l),j(a,n,l)}e=m.slice,r={__e:function(n,t,i,e){for(var r,o,u;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(n)),u=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(n,e||{}),u=r.__d),u)return r.__E=r}catch(t){n=t}throw n}},o=0,u=function(n){return null!=n&&null==n.constructor},_.prototype.setState=function(n,t){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=b({},this.state),"function"==typeof n&&(n=n(b({},i),this.props)),n&&b(i,n),null!=n&&this.__v&&(t&&this.m.push(t),S(this))},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),S(this))},_.prototype.render=x,a=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(n,t){return n.__v.__b-t.__v.__b},M.__r=0,f=/(PointerCapture)$|Capture$/i,d=0,h=I(!1),v=I(!0);var H=0;function G(n,t,i,e,o,u){t||(t={});var a,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?a=t[l]:c[l]=t[l];var s={type:n,props:c,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--H,__i:-1,__u:0,__source:o,__self:u};if("function"==typeof n&&(a=n.defaultProps))for(l in a)void 0===c[l]&&(c[l]=a[l]);return r.vnode&&r.vnode(s),s}var J,W,B,V,Z=0,X=[],Y=r,K=Y.__b,Q=Y.__r,nn=Y.diffed,tn=Y.__c,en=Y.unmount,rn=Y.__;function on(n,t){Y.__h&&Y.__h(W,n,Z||t),Z=0;var i=W.__H||(W.__H={__:[],__h:[]});return n>=i.__.length&&i.__.push({}),i.__[n]}function un(n,t){var i=on(J++,3);!Y.__s&&vn(i.__H,t)&&(i.__=n,i.u=t,W.__H.__h.push(i))}function an(n){return Z=5,ln(function(){return{current:n}},[])}function ln(n,t){var i=on(J++,7);return vn(i.__H,t)&&(i.__=n(),i.__H=t,i.__h=n),i.__}function cn(){for(var n;n=X.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(dn),n.__H.__h.forEach(hn),n.__H.__h=[]}catch(t){n.__H.__h=[],Y.__e(t,n.__v)}}Y.__b=function(n){W=null,K&&K(n)},Y.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),rn&&rn(n,t)},Y.__r=function(n){Q&&Q(n),J=0;var t=(W=n.__c).__H;t&&(B===W?(t.__h=[],W.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(dn),t.__h.forEach(hn),t.__h=[],J=0)),B=W},Y.diffed=function(n){nn&&nn(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==X.push(t)&&V===Y.requestAnimationFrame||((V=Y.requestAnimationFrame)||fn)(cn)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),B=W=null},Y.__c=function(n,t){t.some(function(n){try{n.__h.forEach(dn),n.__h=n.__h.filter(function(n){return!n.__||hn(n)})}catch(i){t.some(function(n){n.__h&&(n.__h=[])}),t=[],Y.__e(i,n.__v)}}),tn&&tn(n,t)},Y.unmount=function(n){en&&en(n);var t,i=n.__c;i&&i.__H&&(i.__H.__.forEach(function(n){try{dn(n)}catch(n){t=n}}),i.__H=void 0,t&&Y.__e(t,i.__v))};var sn="function"==typeof requestAnimationFrame;function fn(n){var t,i=function(){clearTimeout(e),sn&&cancelAnimationFrame(t),setTimeout(n)},e=setTimeout(i,35);sn&&(t=requestAnimationFrame(i))}function dn(n){var t=W,i=n.__c;"function"==typeof i&&(n.__c=void 0,i()),W=t}function hn(n){var t=W;n.__c=n.__(),W=t}function vn(n,t){return!n||n.length!==t.length||t.some(function(t,i){return t!==n[i]})}function pn(n,t){return"function"==typeof t?t(n):t}var mn=Symbol.for("preact-signals");function gn(){if(!(xn>1)){var n,t=!1;while(void 0!==Nn){var i=Nn;Nn=void 0;_n++;while(void 0!==i){var e=i.o;i.o=void 0;i.f&=-3;if(!(8&i.f)&&An(i))try{i.c()}catch(i){if(!t){n=i;t=!0}}i=e}}_n=0;xn--;if(t)throw n}else xn--}function yn(n){if(xn>0)return n();xn++;try{return n()}finally{gn()}}var bn=void 0;function wn(n){var t=bn;bn=void 0;try{return n()}finally{bn=t}}var Nn=void 0,xn=0,_n=0,kn=0;function Cn(n){if(void 0!==bn){var t=n.n;if(void 0===t||t.t!==bn){t={i:0,S:n,p:bn.s,n:void 0,t:bn,e:void 0,x:void 0,r:t};if(void 0!==bn.s)bn.s.n=t;bn.s=t;n.n=t;if(32&bn.f)n.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=bn.s;t.n=void 0;bn.s.n=t;bn.s=t}return t}}}function Sn(n,t){this.v=n;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}Sn.prototype.brand=mn;Sn.prototype.h=function(){return!0};Sn.prototype.S=function(n){var t=this,i=this.t;if(i!==n&&void 0===n.e){n.x=i;this.t=n;if(void 0!==i)i.e=n;else wn(function(){var n;null==(n=t.W)||n.call(t)})}};Sn.prototype.U=function(n){var t=this;if(void 0!==this.t){var i=n.e,e=n.x;if(void 0!==i){i.x=e;n.e=void 0}if(void 0!==e){e.e=i;n.x=void 0}if(n===this.t){this.t=e;if(void 0===e)wn(function(){var n;null==(n=t.Z)||n.call(t)})}}};Sn.prototype.subscribe=function(n){var t=this;return Fn(function(){var i=t.value,e=bn;bn=void 0;try{n(i)}finally{bn=e}},{name:"sub"})};Sn.prototype.valueOf=function(){return this.value};Sn.prototype.toString=function(){return this.value+""};Sn.prototype.toJSON=function(){return this.value};Sn.prototype.peek=function(){var n=bn;bn=void 0;try{return this.value}finally{bn=n}};Object.defineProperty(Sn.prototype,"value",{get:function(){var n=Cn(this);if(void 0!==n)n.i=this.i;return this.v},set:function(n){if(n!==this.v){if(_n>100)throw new Error("Cycle detected");this.v=n;this.i++;kn++;xn++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{gn()}}}});function Mn(n,t){return new Sn(n,t)}function An(n){for(var t=n.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Pn(n){for(var t=n.s;void 0!==t;t=t.n){var i=t.S.n;if(void 0!==i)t.r=i;t.S.n=t;t.i=-1;if(void 0===t.n){n.s=t;break}}}function Un(n){var t=n.s,i=void 0;while(void 0!==t){var e=t.p;if(-1===t.i){t.S.U(t);if(void 0!==e)e.n=t.n;if(void 0!==t.n)t.n.p=e}else i=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=e}n.s=i}function Tn(n,t){Sn.call(this,void 0);this.x=n;this.s=void 0;this.g=kn-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}Tn.prototype=new Sn;Tn.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===kn)return!0;this.g=kn;this.f|=1;if(this.i>0&&!An(this)){this.f&=-2;return!0}var n=bn;try{Pn(this);bn=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(n){this.v=n;this.f|=16;this.i++}bn=n;Un(this);this.f&=-2;return!0};Tn.prototype.S=function(n){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}Sn.prototype.S.call(this,n)};Tn.prototype.U=function(n){if(void 0!==this.t){Sn.prototype.U.call(this,n);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};Tn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var n=this.t;void 0!==n;n=n.x)n.t.N()}};Object.defineProperty(Tn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var n=Cn(this);this.h();if(void 0!==n)n.i=this.i;if(16&this.f)throw this.v;return this.v}});function Dn(n,t){return new Tn(n,t)}function In(n){var t=n.u;n.u=void 0;if("function"==typeof t){xn++;var i=bn;bn=void 0;try{t()}catch(t){n.f&=-2;n.f|=8;On(n);throw t}finally{bn=i;gn()}}}function On(n){for(var t=n.s;void 0!==t;t=t.n)t.S.U(t);n.x=void 0;n.s=void 0;In(n)}function En(n){if(bn!==this)throw new Error("Out-of-order effect");Un(this);bn=n;this.f&=-2;if(8&this.f)On(this);gn()}function jn(n,t){this.x=n;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;this.name=null==t?void 0:t.name}jn.prototype.c=function(){var n=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{n()}};jn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;In(this);Pn(this);xn++;var n=bn;bn=this;return En.bind(this,n)};jn.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=Nn;Nn=this}};jn.prototype.d=function(){this.f|=8;if(!(1&this.f))On(this)};jn.prototype.dispose=function(){this.d()};function Fn(n,t){var i=new jn(n,t);try{i.c()}catch(n){i.d();throw n}var e=i.d.bind(i);e[Symbol.dispose]=e;return e}var Rn,$n,qn,Ln="undefined"!=typeof window&&!!window.__PREACT_SIGNALS_DEVTOOLS__,zn=[],Hn=[];Fn(function(){Rn=this.N})();function Gn(n,t){r[n]=t.bind(null,r[n]||function(){})}function Jn(n){if(qn)qn();qn=n&&n.S()}function Wn(n){var t=this,i=n.data,e=useSignal(i);e.value=i;var r=ln(function(){var n=t,i=t.__v;while(i=i.__)if(i.__c){i.__c.__$f|=4;break}var r=Dn(function(){var n=e.value.value;return 0===n?0:!0===n?"":n||""}),o=Dn(function(){return!Array.isArray(r.value)&&!u(r.value)}),a=Fn(function(){this.N=Qn;if(o.value){var t=r.value;if(n.__v&&n.__v.__e&&3===n.__v.__e.nodeType)n.__v.__e.data=t}}),l=t.__$u.d;t.__$u.d=function(){a();l.call(this)};return[o,r]},[]),o=r[0],a=r[1];return o.value?a.peek():a.value}Wn.displayName="ReactiveTextNode";Object.defineProperties(Sn.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Wn},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Gn("__b",function(n,t){if("string"==typeof t.type){var i,e=t.props;for(var r in e)if("children"!==r){var o=e[r];if(o instanceof Sn){if(!i)t.__np=i={};i[r]=o;e[r]=o.peek()}}}n(t)});Gn("__r",function(n,t){if(t.type!==x){Jn();var i,e=t.__c;if(e){e.__$f&=-2;if(void 0===(i=e.__$u))e.__$u=i=function(n,t){var i;Fn(function(){i=this},{name:t});i.c=n;return i}(function(){var n;if(Ln)null==(n=i.y)||n.call(i);e.__$f|=1;e.setState({})},"function"==typeof t.type?t.type.displayName||t.type.name:"")}$n=e;Jn(i)}n(t)});Gn("__e",function(n,t,i,e){Jn();$n=void 0;n(t,i,e)});Gn("diffed",function(n,t){Jn();$n=void 0;var i;if("string"==typeof t.type&&(i=t.__e)){var e=t.__np,r=t.props;if(e){var o=i.U;if(o)for(var u in o){var a=o[u];if(void 0!==a&&!(u in e)){a.d();o[u]=void 0}}else{o={};i.U=o}for(var l in e){var c=o[l],s=e[l];if(void 0===c){c=Bn(i,l,s,r);o[l]=c}else c.o(s,r)}}}n(t)});function Bn(n,t,i,e){var r=t in n&&void 0===n.ownerSVGElement,o=Mn(i);return{o:function(n,t){o.value=n;e=t},d:Fn(function(){this.N=Qn;var i=o.value.value;if(e[t]!==i){e[t]=i;if(r)n[t]=i;else if(null!=i&&(!1!==i||"-"===t[4]))n.setAttribute(t,i);else n.removeAttribute(t)}})}}Gn("unmount",function(n,t){if("string"==typeof t.type){var i=t.__e;if(i){var e=i.U;if(e){i.U=void 0;for(var r in e){var o=e[r];if(o)o.d()}}}}else{var u=t.__c;if(u){var a=u.__$u;if(a){u.__$u=void 0;a.d()}}}n(t)});Gn("__h",function(n,t,i,e){if(e<3||9===e)t.__$f|=2;n(t,i,e)});_.prototype.shouldComponentUpdate=function(n,t){var i=this.__$u,e=i&&void 0!==i.s;for(var r in t)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){var o=2&this.__$f;if(!(e||o||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(e||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var u in n)if("__source"!==u&&n[u]!==this.props[u])return!0;for(var a in this.props)if(!(a in n))return!0;return!1};function useSignal(n,t){return function(n){return Z=1,function(n,t,i){var e=on(J++,2);if(e.t=n,!e.__c&&(e.__=[i?i(t):pn(void 0,t),function(n){var t=e.__N?e.__N[0]:e.__[0],i=e.t(t,n);t!==i&&(e.__N=[i,e.__[1]],e.__c.setState({}))}],e.__c=W,!W.__f)){var r=function(n,t,i){if(!e.__c.__H)return!0;var r=e.__c.__H.__.filter(function(n){return!!n.__c});if(r.every(function(n){return!n.__N}))return!o||o.call(this,n,t,i);var u=e.__c.props!==n;return r.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(u=!0)}}),o&&o.call(this,n,t,i)||u};W.__f=!0;var o=W.shouldComponentUpdate,u=W.componentWillUpdate;W.componentWillUpdate=function(n,t,i){if(this.__e){var e=o;o=void 0,r(n,t,i),o=e}u&&u.call(this,n,t,i)},W.shouldComponentUpdate=r}return e.__N||e.__}(pn,n)}(function(){return Mn(n,t)})[0]}var Vn="undefined"==typeof requestAnimationFrame?setTimeout:function(n){var t=function(){clearTimeout(i);cancelAnimationFrame(e);n()},i=setTimeout(t,35),e=requestAnimationFrame(t)},Zn=function(n){queueMicrotask(function(){queueMicrotask(n)})};function Xn(){yn(function(){var n;while(n=zn.shift())Rn.call(n)})}function Yn(){if(1===zn.push(this))(r.requestAnimationFrame||Vn)(Xn)}function Kn(){yn(function(){var n;while(n=Hn.shift())Rn.call(n)})}function Qn(){if(1===Hn.push(this))(r.requestAnimationFrame||Zn)(Kn)}function useSignalEffect(n,t){var i=an(n);i.current=n;un(function(){return Fn(function(){this.N=Yn;return i.current()},t)},[])}function nt(n){var t=n.onClick,i=n.className,e=void 0===i?"":i,r=n.disabled,o=void 0===r?!1:r,u=n.children,a=n.variant,l=void 0===a?"secondary":a,c=n.popovertarget,s=n.active;return G("button",{popovertarget:c,onClick:t,className:("btn "+("primary"===l?"btn-primary":"btn-secondary")+" "+((void 0===s?0:s)?"active":"")+" "+e).trim(),disabled:o,children:u})}function tt(n){var t=n.onRefresh,i=n.title,e=void 0===i?"No Signals Detected":i,r=n.description,o=void 0===r?"Make sure your application is using @preact/signals-debug package.":r,u=n.buttonText,a=void 0===u?"Refresh Detection":u;return G("div",{className:"empty-state",children:G("div",{className:"empty-state-content",children:[G("h2",{children:e}),G("p",{children:o}),G("div",{className:"empty-state-actions",children:G(nt,{onClick:t,variant:"primary",children:a})})]})})}function it(n){var t=n.status,i=n.message,e=n.showIndicator,r=void 0===e?!0:e,o=n.className;return G("div",{className:"connection-status "+t+" "+(void 0===o?"":o),children:[r&&G("span",{className:"status-indicator "+t}),G("span",{className:"status-text",children:i})]})}var et=null;function rt(){if(!et)throw new Error("DevTools context not initialized. Call initDevTools() first.");return et}function ot(n){var t=Mn("connecting"),i=Mn("Connecting..."),e=Mn(!1);n.on("connectionStatusChanged",function(n){t.value=n.status;i.value=n.message});n.on("signalsAvailable",function(n){e.value=n});return{get status(){return t.value},get message(){return i.value},get isConnected(){return e.value},refreshConnection:function(){t.value="connecting";i.value="Connecting...";n.requestState()}}}var ut=function(n,t){return n.update.signalId===t.update.signalId&&n.children.length===t.children.length&&n.children.every(function(n,i){return ut(n,t.children[i])})};function at(n,e){var r=Mn([]),o=Mn(!1),u=Mn(new Set),a=function(n){if(Array.isArray(n))n.forEach(function(n){if("divider"!==n.type)n.receivedAt=Date.now()});else if("update"===n.type)n.receivedAt=Date.now();r.value=[].concat(r.value,Array.isArray(n)?n:[n])},l=Dn(function(){return r.value.length>0}),c=Dn(function(){var n=new Map;r.value.forEach(function(t){if("divider"!==t.type){var i=t.signalName||"Unknown";n.set(i,(n.get(i)||0)+1)}});return n}),s=Dn(function(){return function(n){for(var t=[],i=[],e=n.slice(-100).reverse(),r=0;r<e.length;r++){var o=e[r];if("divider"!==o.type){var u=o,a=u.depth||0,l={type:"single",id:u.signalName+"-"+u.receivedAt+"-"+r,update:u,children:[],depth:a,hasChildren:!1};while(i.length>0&&i[i.length-1].depth>=a)i.pop();if(0===i.length)t.push(l);else{var c=i[i.length-1];c.children.push(l);c.hasChildren=!0}i.push(l)}}return t}(r.value)});n.on("signalUpdate",function(n){if(!o.value){var t=[].concat(n).reverse();t.push({type:"divider"});a(t)}});n.on("signalDisposed",function(n){if(!o.value)!function(n){for(var i,e=Array.isArray(n)?n:[n],r=new Set(u.value),o=t(e);!(i=o()).done;){var a=i.value;if(a.signalId)r.add(a.signalId)}u.value=r}(n)});var f=Dn(function(){var n=s.value;if(e.settings.grouped)return function(n){for(var e,r,o=[],u=t(n);!(r=u()).done;){var a=r.value;if(!e||!ut(e,a)){o.push(a);e=a}else if("group"!==e.type){o.pop();e=i({},e,{type:"group",count:2,firstUpdate:a.update,firstChildren:a.children});o.push(e)}else{e.count++;e.firstUpdate=a.update;e.firstChildren=a.children}}return o}(n);else return n});return{updates:r,updateTree:s,collapsedUpdateTree:f,totalUpdates:Dn(function(){return Object.keys(s.value).length}),signalCounts:c,disposedSignalIds:u,addUpdate:a,clearUpdates:function(){r.value=[];u.value=new Set},hasUpdates:l,isPaused:o}}function lt(n){var t=Mn({enabled:!0,grouped:!0,maxUpdatesPerSecond:60,filterPatterns:[]}),i=Mn(!1);n.on("configReceived",function(n){if(n.settings)t.value=n.settings});return{get settings(){return t.value},get showDisposedSignals(){return i.value},set settings(n){t.value=n},applySettings:function(i){t.value=i;n.sendConfig(i)},toggleShowDisposedSignals:function(){i.value=!i.value}}}function ct(n){var t=lt(n),i=at(n,t),e=ot(n);return et={adapter:n,connectionStore:e,updatesStore:i,settingsStore:t}}function st(){if(et){et.adapter.disconnect();et=null}}function ft(){var n=rt(),t=n.connectionStore,i=n.updatesStore,e=function(){i.isPaused.value=!i.isPaused.value},r=function(){i.clearUpdates()};return G("header",{className:"header",children:[G("div",{className:"header-title",children:[G("h1",{children:"Signals"}),G(it,{status:t.status,message:t.message})]}),G("div",{className:"header-controls",children:[r&&G(nt,{onClick:r,children:"Clear"}),e&&G(nt,{onClick:e,active:i.isPaused.value,children:i.isPaused.value?"Resume":"Pause"}),G(nt,{popovertarget:"settings-panel-popover",children:"Settings"})]})]})}function dt(){var n=rt().settingsStore,t=an(null),e=n.applySettings,r=useSignal(n.settings);useSignalEffect(function(){r.value=n.settings});return G("div",{ref:t,popover:"auto",id:"settings-panel-popover",className:"settings-panel",children:G("div",{className:"settings-content",children:[G("h3",{children:"Debug Configuration"}),G("div",{className:"setting-group",children:G("label",{children:[G("input",{type:"checkbox",checked:r.value.enabled,onChange:function(n){return r.value=i({},r.value,{enabled:n.target.checked})}}),"Enable debug updates"]})}),G("div",{className:"setting-group",children:G("label",{children:[G("input",{type:"checkbox",checked:r.value.grouped,onChange:function(n){return r.value=i({},r.value,{grouped:n.target.checked})}}),"Group related updates"]})}),G("div",{className:"setting-group",children:[G("label",{htmlFor:"maxUpdatesInput",children:"Max updates per second:"}),G("input",{type:"number",id:"maxUpdatesInput",value:r.value.maxUpdatesPerSecond,min:"1",max:"1000",onChange:function(n){return r.value=i({},r.value,{maxUpdatesPerSecond:parseInt(n.target.value)||60})}})]}),G("div",{className:"setting-group",children:[G("label",{htmlFor:"filterPatternsInput",children:"Filter patterns (one per line):"}),G("textarea",{id:"filterPatternsInput",placeholder:"user.*\n.*State$\nglobal",value:r.value.filterPatterns.join("\n"),onChange:function(n){return r.value=i({},r.value,{filterPatterns:n.target.value.split("\n").map(function(n){return n.trim()}).filter(function(n){return n.length>0})})}})]}),G("h3",{children:"Graph Settings"}),G("div",{className:"setting-group",children:[G("label",{children:[G("input",{type:"checkbox",checked:n.showDisposedSignals,onChange:function(){return n.toggleShowDisposedSignals()}}),"Show disposed signals in graph"]}),G("p",{className:"setting-description",children:"When enabled, signals and effects that have been disposed will still be shown in the graph view."})]}),G("div",{className:"settings-actions",children:[G(nt,{onClick:function(){e(r.value)},variant:"primary",children:"Apply"}),G(nt,{onClick:function(){var n;null==(n=t.current)||n.hide()},children:"Cancel"})]})]})})}var ht=function(n){var t=document.createElement("textarea");try{t.value=n;document.body.append(t);t.select();document.execCommand("copy")}finally{t.remove()}};function vt(){var n=rt(),i=n.updatesStore,e=n.settingsStore,r=i.updates,o=i.disposedSignalIds,u=an(null),a=an(null),l=an(null),c=useSignal({x:0,y:0}),s=useSignal(1),f=useSignal(!1),d=useSignal({x:0,y:0}),h=useSignal(!1),v=useSignal(),p=useSignal(null),m=useSignal({x:0,y:0});un(function(){var n=function(n){if(h.value&&l.current&&!l.current.contains(n.target))h.value=!1};document.addEventListener("mousedown",n);return function(){document.removeEventListener("mousedown",n)}},[]);var g=function(n,t){var i=an(n);i.current=n;$n.__$f|=4;return ln(function(){return Dn(function(){return i.current()},void 0)},[])}(function(){var n=r.value,i=o.value,u=e.showDisposedSignals;if(!n||0===n.length)return{nodes:[],links:[]};for(var a,l=new Map,c=new Map,s=n.filter(function(n){return"divider"!==n.type}),f=t(s);!(a=f()).done;){var d=a.value;if(d.signalId)if(u||!i.has(d.signalId)){var h=d.signalType,v=d.depth||0;if(!l.has(d.signalId))l.set(d.signalId,{id:d.signalId,name:d.signalName,type:h,x:0,y:0,depth:v});if(d.subscribedTo){if(!u&&i.has(d.subscribedTo))continue;var p=d.subscribedTo+"->"+d.signalId;if(!c.has(p))c.set(p,{source:d.subscribedTo,target:d.signalId})}}}var m=Array.from(l.values()),g=new Map;m.forEach(function(n){if(!g.has(n.depth))g.set(n.depth,[]);g.get(n.depth).push(n)});var y=Math.max.apply(Math,m.map(function(n){return n.depth}));g.forEach(function(n,t){var i=120*(n.length-1),e=80+100*y-i/2;n.forEach(function(n,i){n.x=100+250*t;n.y=e+120*i})});return{nodes:m,links:Array.from(c.values())}}),y=function(){f.value=!1},b=/[^a-zA-Z0-9]/g,w=function(n){return n.replace(b,"_")},N=function(n){var t=6.5*n.name.length+16;return Math.max(30,Math.min(t/2,70))},x=function(n){var t=a.current;if(t&&p.value){var i=t.getBoundingClientRect();m.value={x:n.clientX-i.left,y:n.clientY-i.top}}},_=function(){p.value=null},k=function(n){v.value=n;setTimeout(function(){v.value=void 0},2e3)};if(0===g.value.nodes.length)return G("div",{className:"graph-empty",children:G("div",{children:[G("h3",{children:"No Signal Dependencies"}),G("p",{children:"Create some signals with dependencies to see the graph visualization."})]})});var C=Math.max.apply(Math,[800].concat(g.value.nodes.map(function(n){return n.x+100}))),S=Math.max.apply(Math,[600].concat(g.value.nodes.map(function(n){return n.y+100})));return G("div",{className:"graph-container",children:G("div",{ref:a,className:"graph-content",onMouseDown:function(n){if(0===n.button){f.value=!0;d.value={x:n.clientX-c.value.x,y:n.clientY-c.value.y}}},onMouseMove:function(n){if(f.value)c.value={x:n.clientX-d.value.x,y:n.clientY-d.value.y}},onMouseUp:y,onMouseLeave:y,onWheel:function(n){n.preventDefault();var t=a.current;if(t){var i=t.getBoundingClientRect(),e=n.clientX-i.left,r=n.clientY-i.top,o=n.deltaY>0?.96:1.04,u=Math.min(Math.max(.1,s.value*o),5),l=u/s.value;c.value={x:e-(e-c.value.x)*l,y:r-(r-c.value.y)*l};s.value=u}},style:{cursor:f.value?"grabbing":"grab"},children:[G("svg",{ref:u,className:"graph-svg",width:C,height:S,viewBox:"0 0 "+C+" "+S,children:[G("defs",{children:G("marker",{id:"arrowhead",markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto",children:G("polygon",{points:"0 0, 8 3, 0 6",fill:"#94a3b8"})})}),G("g",{transform:"translate("+c.value.x+", "+c.value.y+") scale("+s.value+")",children:[G("g",{className:"links",children:g.value.links.map(function(n,t){var i=g.value.nodes.find(function(t){return t.id===n.source}),e=g.value.nodes.find(function(t){return t.id===n.target});if(!i||!e)return null;var r=N(i),o=N(e),u=i.x+r,a=i.y,l=e.x-o-8,c=e.y,s=u+.5*(l-u);return G("path",{className:"graph-link",d:"M "+u+" "+a+" C "+s+" "+a+", "+s+" "+c+", "+l+" "+c,fill:"none",markerEnd:"url(#arrowhead)"},"link-"+t)})}),G("g",{className:"nodes",children:g.value.nodes.map(function(n){var t,i=N(n),e=Math.floor((2*i-16)/6.5),r=n.name.length>e?n.name.slice(0,e-1)+"…":n.name;return G("g",{className:"graph-node-group "+((null==(t=p.value)?void 0:t.id)===n.id?"hovered":""),onMouseEnter:function(t){return function(n,t){p.value=n;var i=a.current;if(i){var e=i.getBoundingClientRect();m.value={x:t.clientX-e.left,y:t.clientY-e.top}}}(n,t)},onMouseMove:x,onMouseLeave:_,children:[G("circle",{className:"graph-node "+n.type,cx:n.x,cy:n.y,r:i}),G("text",{className:"graph-text",x:n.x,y:n.y,textAnchor:"middle",dominantBaseline:"central",children:r})]},n.id)})})]})]}),G("div",{className:"graph-controls",children:[G("button",{className:"graph-reset-button",onClick:function(){c.value={x:0,y:0};s.value=1},title:"Reset view",children:"⟲ Reset View"}),G("div",{ref:l,className:"graph-export-container",children:[G("button",{className:"graph-export-button",onClick:function(){h.value=!h.value},title:"Export graph",children:"↓ Export"}),h.value&&G("div",{className:"graph-export-menu",children:[G("button",{className:"graph-export-menu-item",onClick:function(){try{h.value=!1;var n=["graph LR"];g.value.nodes.forEach(function(t){var i=w(t.id),e=t.name;switch(t.type){case"signal":n.push(" "+i+"(("+e+"))");break;case"computed":n.push(" "+i+"("+e+")");break;case"effect":n.push(" "+i+"(["+e+"])")}});for(var i,e=t(g.value.links);!(i=e()).done;){var r=i.value,o=w(r.source),u=w(r.target);n.push(" "+o+" --\x3e "+u)}ht(n.join("\n"));k("Copied to clipboard!");return Promise.resolve()}catch(n){return Promise.reject(n)}},children:"Mermaid"}),G("button",{className:"graph-export-menu-item",onClick:function(){try{h.value=!1;var n=JSON.stringify(g.value,null,2);ht(n);k("Copied to clipboard!");return Promise.resolve()}catch(n){return Promise.reject(n)}},children:"JSON"})]})]}),G("div",{className:"graph-zoom-indicator",title:"Zoom level",children:[Math.round(100*s.value),"%"]})]}),v.value&&G("div",{className:"graph-toast",children:v.value}),p.value&&G("div",{className:"graph-tooltip",style:{left:m.value.x+12,top:m.value.y-8},children:[G("div",{className:"tooltip-header",children:G("span",{className:"tooltip-type "+p.value.type,children:p.value.type})}),G("div",{className:"tooltip-name",children:p.value.name}),G("div",{className:"tooltip-id",children:["ID: ",p.value.id]})]}),G("div",{className:"graph-legend",children:[G("div",{className:"legend-item",children:[G("div",{className:"legend-color",style:{backgroundColor:"#2196f3"}}),G("span",{children:"Signal"})]}),G("div",{className:"legend-item",children:[G("div",{className:"legend-color",style:{backgroundColor:"#ff9800"}}),G("span",{children:"Computed"})]}),G("div",{className:"legend-item",children:[G("div",{className:"legend-color",style:{backgroundColor:"#4caf50"}}),G("span",{children:"Effect"})]})]})]})})}function pt(n){var t=n.update,i=n.count,e=n.firstUpdate,r=new Date(t.timestamp||t.receivedAt).toLocaleTimeString(),o=function(n){if(null===n)return"null";if(void 0===n)return"undefined";if("string"==typeof n)return'"'+n+'"';if("function"==typeof n)return"function()";if("object"==typeof n)try{return JSON.stringify(n,null,0)}catch(n){return"[Object]"}return String(n)},u=i&&G("span",{class:"update-count",title:"Number of grouped identical updates",children:["x",i]});if("effect"===t.type)return G("div",{className:"update-item "+t.type,children:G("div",{className:"update-header",children:[G("span",{className:"signal-name",children:["↪️ ",t.signalName,u]}),G("span",{className:"update-time",children:r})]})});var a=o(t.prevValue),l=o(t.newValue),c=void 0!==e?o(e.prevValue):void 0;return G("div",{class:"update-item "+t.type,children:[G("div",{class:"update-header",children:[G("span",{class:"signal-name",children:[0===t.depth?"🎯":"↪️"," ",t.signalName,u]}),G("span",{class:"update-time",children:r})]}),G("div",{class:"value-change",children:[c&&c!==a&&G(x,{children:[G("span",{class:"value-prev",children:c}),G("span",{class:"value-arrow",children:"..."})]}),G("span",{class:"value-prev",children:a}),G("span",{class:"value-arrow",children:"→"}),G("span",{class:"value-new",children:l})]})]})}function mt(n){var t,e=n.node,r=useSignal(!1),o=e.children.length>0,u="group"===e.type?e.count:void 0,a="group"===e.type?e.firstUpdate:void 0;if("group"===e.type&&e.firstChildren)t=e.children.map(function(n,t){var r=e.firstChildren[t];return i({},n,{type:"group",firstUpdate:r.update,firstChildren:r.children,count:e.count})});else t=e.children;return G("div",{className:"tree-node",children:[G("div",{className:"tree-node-content",children:[o&&G("button",{className:"collapse-button",onClick:function(){r.value=!r.value},"aria-label":r.value?"Expand":"Collapse",children:r.value?"▶":"▼"}),!o&&G("div",{className:"collapse-spacer"}),G("div",{className:"update-content",children:G(pt,{update:e.update,count:u,firstUpdate:a})})]}),o&&!r.value&&G("div",{className:"tree-children",children:t.map(function(n){return G(mt,{node:n},n.id)})})]})}function gt(){var n=rt().updatesStore,t=an(null),i=n.collapsedUpdateTree.value;useSignalEffect(function(){if(t.current)t.current.scrollTop=0});return G("div",{className:"updates-container",children:[G("div",{className:"updates-header",children:G("div",{className:"updates-stats",children:[G("span",{children:["Updates: ",G("strong",{children:n.totalUpdates.value})]}),G("span",{children:["Signals: ",G("strong",{children:n.signalCounts.value.size})]})]})}),G("div",{className:"updates-list",ref:t,children:i.map(function(n){return G(mt,{node:n},n.id)})})]})}var yt=["adapter","container"];function bt(n){var t=void 0===n?{}:n,i=t.hideHeader,e=void 0===i?!1:i,r=t.initialTab,o=void 0===r?"updates":r,u=rt().connectionStore,a=useSignal(o);return G("div",{id:"app",className:"signals-devtools",children:[!e&&G(ft,{}),G(dt,{}),G("main",{className:"main-content",children:[G("div",{className:"tabs",children:[G("button",{className:"tab "+("updates"===a.value?"active":""),onClick:function(){return a.value="updates"},children:"Updates"}),G("button",{className:"tab "+("graph"===a.value?"active":""),onClick:function(){return a.value="graph"},children:"Dependency Graph"})]}),G("div",{className:"tab-content",children:!u.isConnected?G(tt,{onRefresh:u.refreshConnection}):G(x,{children:["updates"===a.value&&G(gt,{}),"graph"===a.value&&G(vt,{})]})})]})]})}exports.Button=nt;exports.DevToolsPanel=bt;exports.EmptyState=tt;exports.GraphVisualization=vt;exports.Header=ft;exports.SettingsPanel=dt;exports.StatusIndicator=it;exports.UpdateItem=pt;exports.UpdateTreeNodeComponent=mt;exports.UpdatesContainer=gt;exports.createConnectionStore=ot;exports.createSettingsStore=lt;exports.createUpdatesStore=at;exports.destroyDevTools=st;exports.getContext=rt;exports.initDevTools=ct;exports.mount=function(n){try{var t=n.adapter,e=n.container,r=function(n,t){if(null==n)return{};var i={};for(var e in n)if({}.hasOwnProperty.call(n,e)){if(-1!==t.indexOf(e))continue;i[e]=n[e]}return i}(n,yt);ct(t);return Promise.resolve(t.connect()).then(function(){e.innerHTML="";z(G(bt,i({},r)),e);return function(){z(null,e);st()}})}catch(n){return Promise.reject(n)}};//# sourceMappingURL=devtools-ui.js.map
1
+ function n(n,t){(null==t||t>n.length)&&(t=n.length);for(var i=0,e=Array(t);i<t;i++)e[i]=n[i];return e}function t(t,i){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,i){if(t){if("string"==typeof t)return n(t,i);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,i):void 0}}(t))||i&&t&&"number"==typeof t.length){e&&(t=e);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(){return i=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var e in i)({}).hasOwnProperty.call(i,e)&&(n[e]=i[e])}return n},i.apply(null,arguments)}var e,r,o,u,a,l,c,f,s,d,v,h,p={},g=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function b(n,t){for(var i in t)n[i]=t[i];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function N(n,t,i,e,u){var a={type:n,props:t,key:i,ref:e,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==u?++o:u,__i:-1,__u:0};return null==u&&null!=r.vnode&&r.vnode(a),a}function x(n){return n.children}function k(n,t){this.props=n,this.context=t}function _(n,t){if(null==t)return n.__?_(n.__,n.__i+1):null;for(var i;t<n.__k.length;t++)if(null!=(i=n.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof n.type?_(n):null}function C(n){var t,i;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,t=0;t<n.__k.length;t++)if(null!=(i=n.__k[t])&&null!=i.__e){n.__e=n.__c.base=i.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=!0)&&a.push(n)&&!S.__r++||l!=r.debounceRendering)&&((l=r.debounceRendering)||c)(S)}function S(){for(var n,t,i,e,o,u,l,c=1;a.length;)a.length>c&&a.sort(f),n=a.shift(),c=a.length,n.__d&&(i=void 0,e=void 0,o=(e=(t=n).__v).__e,u=[],l=[],t.__P&&((i=b({},e)).__v=e.__v+1,r.vnode&&r.vnode(i),I(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[o]:null,u,null==o?_(e):o,!!(32&e.__u),l),i.__v=e.__v,i.__.__k[i.__i]=i,j(u,i,l),e.__e=e.__=null,i.__e!=o&&C(i)));S.__r=0}function A(n,t,i,e,r,o,u,a,l,c,f){var s,d,v,h,m,b,w,k=e&&e.__k||g,C=t.length;for(l=function(n,t,i,e,r){var o,u,a,l,c,f=i.length,s=f,d=0;for(n.__k=new Array(r),o=0;o<r;o++)null!=(u=t[o])&&"boolean"!=typeof u&&"function"!=typeof u?(l=o+d,(u=n.__k[o]="string"==typeof u||"number"==typeof u||"bigint"==typeof u||u.constructor==String?N(null,u,null,null,null):y(u)?N(x,{children:u},null,null,null):null==u.constructor&&u.__b>0?N(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):u).__=n,u.__b=n.__b+1,a=null,-1!=(c=u.__i=U(u,i,l,s))&&(s--,(a=i[c])&&(a.__u|=2)),null==a||null==a.__v?(-1==c&&(r>f?d--:r<f&&d++),"function"!=typeof u.type&&(u.__u|=4)):c!=l&&(c==l-1?d--:c==l+1?d++:(c>l?d--:d++,u.__u|=4))):n.__k[o]=null;if(s)for(o=0;o<f;o++)null!=(a=i[o])&&0==(2&a.__u)&&(a.__e==e&&(e=_(a)),$(a,a));return e}(i,t,k,l,C),s=0;s<C;s++)null!=(v=i.__k[s])&&(d=-1==v.__i?p:k[v.__i]||p,v.__i=s,b=I(n,v,d,r,o,u,a,l,c,f),h=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&R(d.ref,null,v),f.push(v.ref,v.__c||h,v)),null==m&&null!=h&&(m=h),(w=!!(4&v.__u))||d.__k===v.__k?l=P(v,l,n,w):"function"==typeof v.type&&void 0!==b?l=b:h&&(l=h.nextSibling),v.__u&=-7);return i.__e=m,l}function P(n,t,i,e){var r,o;if("function"==typeof n.type){for(r=n.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=n,t=P(r[o],t,i,e));return t}n.__e!=t&&(e&&(t&&n.type&&!t.parentNode&&(t=_(n)),i.insertBefore(n.__e,t||null)),t=n.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function U(n,t,i,e){var r,o,u,a=n.key,l=n.type,c=t[i],f=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||f&&a==c.key&&l==c.type)return i;if(e>(f?1:0))for(r=i-1,o=i+1;r>=0||o<t.length;)if(null!=(c=t[u=r>=0?r--:o++])&&0==(2&c.__u)&&a==c.key&&l==c.type)return u;return-1}function T(n,t,i){"-"==t[0]?n.setProperty(t,null==i?"":i):n[t]=null==i?"":"number"!=typeof i||m.test(t)?i:i+"px"}function D(n,t,i,e,r){var o,u;n:if("style"==t)if("string"==typeof i)n.style.cssText=i;else{if("string"==typeof e&&(n.style.cssText=e=""),e)for(t in e)i&&t in i||T(n.style,t,"");if(i)for(t in i)e&&i[t]==e[t]||T(n.style,t,i[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(s,"$1")),u=t.toLowerCase(),t=u in n||"onFocusOut"==t||"onFocusIn"==t?u.slice(2):t.slice(2),n.l||(n.l={}),n.l[t+o]=i,i?e?i.u=e.u:(i.u=d,n.addEventListener(t,o?h:v,o)):n.removeEventListener(t,o?h:v,o);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in n)try{n[t]=null==i?"":i;break n}catch(n){}"function"==typeof i||(null==i||!1===i&&"-"!=t[4]?n.removeAttribute(t):n.setAttribute(t,"popover"==t&&1==i?"":i))}}function E(n){return function(t){if(this.l){var i=this.l[t.type+n];if(null==t.t)t.t=d++;else if(t.t<i.u)return;return i(r.event?r.event(t):t)}}}function I(n,t,i,e,o,u,a,l,c,f){var s,d,v,h,p,g,m,N,_,C,M,S,P,U,T,D,E,I=t.type;if(null!=t.constructor)return null;128&i.__u&&(c=!!(32&i.__u),u=[l=t.__e=i.__e]),(s=r.__b)&&s(t);n:if("function"==typeof I)try{if(N=t.props,_="prototype"in I&&I.prototype.render,C=(s=I.contextType)&&e[s.__c],M=s?C?C.props.value:s.__:e,i.__c?m=(d=t.__c=i.__c).__=d.__E:(_?t.__c=d=new I(N,M):(t.__c=d=new k(N,M),d.constructor=I,d.render=q),C&&C.sub(d),d.props=N,d.state||(d.state={}),d.context=M,d.__n=e,v=d.__d=!0,d.__h=[],d.m=[]),_&&null==d.__s&&(d.__s=d.state),_&&null!=I.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=b({},d.__s)),b(d.__s,I.getDerivedStateFromProps(N,d.__s))),h=d.props,p=d.state,d.__v=t,v)_&&null==I.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),_&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(_&&null==I.getDerivedStateFromProps&&N!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(N,M),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(N,d.__s,M)||t.__v==i.__v){for(t.__v!=i.__v&&(d.props=N,d.state=d.__s,d.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(n){n&&(n.__=t)}),S=0;S<d.m.length;S++)d.__h.push(d.m[S]);d.m=[],d.__h.length&&a.push(d);break n}null!=d.componentWillUpdate&&d.componentWillUpdate(N,d.__s,M),_&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(h,p,g)})}if(d.context=M,d.props=N,d.__P=n,d.__e=!1,P=r.__r,U=0,_){for(d.state=d.__s,d.__d=!1,P&&P(t),s=d.render(d.props,d.state,d.context),T=0;T<d.m.length;T++)d.__h.push(d.m[T]);d.m=[]}else do{d.__d=!1,P&&P(t),s=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++U<25);d.state=d.__s,null!=d.getChildContext&&(e=b(b({},e),d.getChildContext())),_&&!v&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(h,p)),D=s,null!=s&&s.type===x&&null==s.key&&(D=F(s.props.children)),l=A(n,y(D)?D:[D],t,i,e,o,u,a,l,c,f),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(n){if(t.__v=null,c||null!=u)if(n.then){for(t.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;u[u.indexOf(l)]=null,t.__e=l}else{for(E=u.length;E--;)w(u[E]);O(t)}else t.__e=i.__e,t.__k=i.__k,n.then||O(t);r.__e(n,t,i)}else null==u&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):l=t.__e=L(i.__e,t,i,e,o,u,a,c,f);return(s=r.diffed)&&s(t),128&t.__u?void 0:l}function O(n){n&&n.__c&&(n.__c.__e=!0),n&&n.__k&&n.__k.forEach(O)}function j(n,t,i){for(var e=0;e<i.length;e++)R(i[e],i[++e],i[++e]);r.__c&&r.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){r.__e(n,t.__v)}})}function F(n){return"object"!=typeof n||null==n||n.__b&&n.__b>0?n:y(n)?n.map(F):b({},n)}function L(n,t,i,o,u,a,l,c,f){var s,d,v,h,g,m,b,N=i.props,x=t.props,k=t.type;if("svg"==k?u="http://www.w3.org/2000/svg":"math"==k?u="http://www.w3.org/1998/Math/MathML":u||(u="http://www.w3.org/1999/xhtml"),null!=a)for(s=0;s<a.length;s++)if((g=a[s])&&"setAttribute"in g==!!k&&(k?g.localName==k:3==g.nodeType)){n=g,a[s]=null;break}if(null==n){if(null==k)return document.createTextNode(x);n=document.createElementNS(u,k,x.is&&x),c&&(r.__m&&r.__m(t,a),c=!1),a=null}if(null==k)N===x||c&&n.data==x||(n.data=x);else{if(a=a&&e.call(n.childNodes),N=i.props||p,!c&&null!=a)for(N={},s=0;s<n.attributes.length;s++)N[(g=n.attributes[s]).name]=g.value;for(s in N)if(g=N[s],"children"==s);else if("dangerouslySetInnerHTML"==s)v=g;else if(!(s in x)){if("value"==s&&"defaultValue"in x||"checked"==s&&"defaultChecked"in x)continue;D(n,s,null,g,u)}for(s in x)g=x[s],"children"==s?h=g:"dangerouslySetInnerHTML"==s?d=g:"value"==s?m=g:"checked"==s?b=g:c&&"function"!=typeof g||N[s]===g||D(n,s,g,N[s],u);if(d)c||v&&(d.__html==v.__html||d.__html==n.innerHTML)||(n.innerHTML=d.__html),t.__k=[];else if(v&&(n.innerHTML=""),A("template"==t.type?n.content:n,y(h)?h:[h],t,i,o,"foreignObject"==k?"http://www.w3.org/1999/xhtml":u,a,l,a?a[0]:i.__k&&_(i,0),c,f),null!=a)for(s=a.length;s--;)w(a[s]);c||(s="value","progress"==k&&null==m?n.removeAttribute("value"):null!=m&&(m!==n[s]||"progress"==k&&!m||"option"==k&&m!=N[s])&&D(n,s,m,N[s],u),s="checked",null!=b&&b!=n[s]&&D(n,s,b,N[s],u))}return n}function R(n,t,i){try{if("function"==typeof n){var e="function"==typeof n.__u;e&&n.__u(),e&&null==t||(n.__u=n(t))}else n.current=t}catch(n){r.__e(n,i)}}function $(n,t,i){var e,o;if(r.unmount&&r.unmount(n),(e=n.ref)&&(e.current&&e.current!=n.__e||R(e,null,t)),null!=(e=n.__c)){if(e.componentWillUnmount)try{e.componentWillUnmount()}catch(n){r.__e(n,t)}e.base=e.__P=null}if(e=n.__k)for(o=0;o<e.length;o++)e[o]&&$(e[o],t,i||"function"!=typeof n.type);i||w(n.__e),n.__c=n.__=n.__e=void 0}function q(n,t,i){return this.constructor(n,i)}function z(n,t,i){var o,u,a,l;t==document&&(t=document.documentElement),r.__&&r.__(n,t),u=(o="function"==typeof i)?null:i&&i.__k||t.__k,a=[],l=[],I(t,n=(!o&&i||t).__k=function(n,t,i){var r,o,u,a={};for(u in t)"key"==u?r=t[u]:"ref"==u?o=t[u]:a[u]=t[u];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):i),"function"==typeof n&&null!=n.defaultProps)for(u in n.defaultProps)void 0===a[u]&&(a[u]=n.defaultProps[u]);return N(n,a,r,o,null)}(x,null,[n]),u||p,p,t.namespaceURI,!o&&i?[i]:u?null:t.firstChild?e.call(t.childNodes):null,a,!o&&i?i:u?u.__e:t.firstChild,o,l),j(a,n,l)}e=g.slice,r={__e:function(n,t,i,e){for(var r,o,u;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(n)),u=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(n,e||{}),u=r.__d),u)return r.__E=r}catch(t){n=t}throw n}},o=0,u=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,t){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=b({},this.state),"function"==typeof n&&(n=n(b({},i),this.props)),n&&b(i,n),null!=n&&this.__v&&(t&&this.m.push(t),M(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},k.prototype.render=x,a=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,t){return n.__v.__b-t.__v.__b},S.__r=0,s=/(PointerCapture)$|Capture$/i,d=0,v=E(!1),h=E(!0);var H=0;function W(n,t,i,e,o,u){t||(t={});var a,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?a=t[l]:c[l]=t[l];var f={type:n,props:c,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--H,__i:-1,__u:0,__source:o,__self:u};if("function"==typeof n&&(a=n.defaultProps))for(l in a)void 0===c[l]&&(c[l]=a[l]);return r.vnode&&r.vnode(f),f}var G,J,B,V,Z=0,X=[],Y=r,K=Y.__b,Q=Y.__r,nn=Y.diffed,tn=Y.__c,en=Y.unmount,rn=Y.__;function on(n,t){Y.__h&&Y.__h(J,n,Z||t),Z=0;var i=J.__H||(J.__H={__:[],__h:[]});return n>=i.__.length&&i.__.push({}),i.__[n]}function un(n,t){var i=on(G++,3);!Y.__s&&hn(i.__H,t)&&(i.__=n,i.u=t,J.__H.__h.push(i))}function an(n){return Z=5,ln(function(){return{current:n}},[])}function ln(n,t){var i=on(G++,7);return hn(i.__H,t)&&(i.__=n(),i.__H=t,i.__h=n),i.__}function cn(){for(var n;n=X.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(dn),n.__H.__h.forEach(vn),n.__H.__h=[]}catch(t){n.__H.__h=[],Y.__e(t,n.__v)}}Y.__b=function(n){J=null,K&&K(n)},Y.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),rn&&rn(n,t)},Y.__r=function(n){Q&&Q(n),G=0;var t=(J=n.__c).__H;t&&(B===J?(t.__h=[],J.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(dn),t.__h.forEach(vn),t.__h=[],G=0)),B=J},Y.diffed=function(n){nn&&nn(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==X.push(t)&&V===Y.requestAnimationFrame||((V=Y.requestAnimationFrame)||sn)(cn)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),B=J=null},Y.__c=function(n,t){t.some(function(n){try{n.__h.forEach(dn),n.__h=n.__h.filter(function(n){return!n.__||vn(n)})}catch(i){t.some(function(n){n.__h&&(n.__h=[])}),t=[],Y.__e(i,n.__v)}}),tn&&tn(n,t)},Y.unmount=function(n){en&&en(n);var t,i=n.__c;i&&i.__H&&(i.__H.__.forEach(function(n){try{dn(n)}catch(n){t=n}}),i.__H=void 0,t&&Y.__e(t,i.__v))};var fn="function"==typeof requestAnimationFrame;function sn(n){var t,i=function(){clearTimeout(e),fn&&cancelAnimationFrame(t),setTimeout(n)},e=setTimeout(i,35);fn&&(t=requestAnimationFrame(i))}function dn(n){var t=J,i=n.__c;"function"==typeof i&&(n.__c=void 0,i()),J=t}function vn(n){var t=J;n.__c=n.__(),J=t}function hn(n,t){return!n||n.length!==t.length||t.some(function(t,i){return t!==n[i]})}function pn(n,t){return"function"==typeof t?t(n):t}var gn=Symbol.for("preact-signals");function mn(){if(!(xn>1)){var n,t=!1;while(void 0!==Nn){var i=Nn;Nn=void 0;kn++;while(void 0!==i){var e=i.o;i.o=void 0;i.f&=-3;if(!(8&i.f)&&An(i))try{i.c()}catch(i){if(!t){n=i;t=!0}}i=e}}kn=0;xn--;if(t)throw n}else xn--}function yn(n){if(xn>0)return n();xn++;try{return n()}finally{mn()}}var bn=void 0;function wn(n){var t=bn;bn=void 0;try{return n()}finally{bn=t}}var Nn=void 0,xn=0,kn=0,_n=0;function Cn(n){if(void 0!==bn){var t=n.n;if(void 0===t||t.t!==bn){t={i:0,S:n,p:bn.s,n:void 0,t:bn,e:void 0,x:void 0,r:t};if(void 0!==bn.s)bn.s.n=t;bn.s=t;n.n=t;if(32&bn.f)n.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=bn.s;t.n=void 0;bn.s.n=t;bn.s=t}return t}}}function Mn(n,t){this.v=n;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}Mn.prototype.brand=gn;Mn.prototype.h=function(){return!0};Mn.prototype.S=function(n){var t=this,i=this.t;if(i!==n&&void 0===n.e){n.x=i;this.t=n;if(void 0!==i)i.e=n;else wn(function(){var n;null==(n=t.W)||n.call(t)})}};Mn.prototype.U=function(n){var t=this;if(void 0!==this.t){var i=n.e,e=n.x;if(void 0!==i){i.x=e;n.e=void 0}if(void 0!==e){e.e=i;n.x=void 0}if(n===this.t){this.t=e;if(void 0===e)wn(function(){var n;null==(n=t.Z)||n.call(t)})}}};Mn.prototype.subscribe=function(n){var t=this;return Fn(function(){var i=t.value,e=bn;bn=void 0;try{n(i)}finally{bn=e}},{name:"sub"})};Mn.prototype.valueOf=function(){return this.value};Mn.prototype.toString=function(){return this.value+""};Mn.prototype.toJSON=function(){return this.value};Mn.prototype.peek=function(){var n=bn;bn=void 0;try{return this.value}finally{bn=n}};Object.defineProperty(Mn.prototype,"value",{get:function(){var n=Cn(this);if(void 0!==n)n.i=this.i;return this.v},set:function(n){if(n!==this.v){if(kn>100)throw new Error("Cycle detected");this.v=n;this.i++;_n++;xn++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{mn()}}}});function Sn(n,t){return new Mn(n,t)}function An(n){for(var t=n.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Pn(n){for(var t=n.s;void 0!==t;t=t.n){var i=t.S.n;if(void 0!==i)t.r=i;t.S.n=t;t.i=-1;if(void 0===t.n){n.s=t;break}}}function Un(n){var t=n.s,i=void 0;while(void 0!==t){var e=t.p;if(-1===t.i){t.S.U(t);if(void 0!==e)e.n=t.n;if(void 0!==t.n)t.n.p=e}else i=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=e}n.s=i}function Tn(n,t){Mn.call(this,void 0);this.x=n;this.s=void 0;this.g=_n-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}Tn.prototype=new Mn;Tn.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===_n)return!0;this.g=_n;this.f|=1;if(this.i>0&&!An(this)){this.f&=-2;return!0}var n=bn;try{Pn(this);bn=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(n){this.v=n;this.f|=16;this.i++}bn=n;Un(this);this.f&=-2;return!0};Tn.prototype.S=function(n){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}Mn.prototype.S.call(this,n)};Tn.prototype.U=function(n){if(void 0!==this.t){Mn.prototype.U.call(this,n);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};Tn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var n=this.t;void 0!==n;n=n.x)n.t.N()}};Object.defineProperty(Tn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var n=Cn(this);this.h();if(void 0!==n)n.i=this.i;if(16&this.f)throw this.v;return this.v}});function Dn(n,t){return new Tn(n,t)}function En(n){var t=n.u;n.u=void 0;if("function"==typeof t){xn++;var i=bn;bn=void 0;try{t()}catch(t){n.f&=-2;n.f|=8;In(n);throw t}finally{bn=i;mn()}}}function In(n){for(var t=n.s;void 0!==t;t=t.n)t.S.U(t);n.x=void 0;n.s=void 0;En(n)}function On(n){if(bn!==this)throw new Error("Out-of-order effect");Un(this);bn=n;this.f&=-2;if(8&this.f)In(this);mn()}function jn(n,t){this.x=n;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;this.name=null==t?void 0:t.name}jn.prototype.c=function(){var n=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{n()}};jn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;En(this);Pn(this);xn++;var n=bn;bn=this;return On.bind(this,n)};jn.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=Nn;Nn=this}};jn.prototype.d=function(){this.f|=8;if(!(1&this.f))In(this)};jn.prototype.dispose=function(){this.d()};function Fn(n,t){var i=new jn(n,t);try{i.c()}catch(n){i.d();throw n}var e=i.d.bind(i);e[Symbol.dispose]=e;return e}var Ln,Rn,$n,qn="undefined"!=typeof window&&!!window.__PREACT_SIGNALS_DEVTOOLS__,zn=[],Hn=[];Fn(function(){Ln=this.N})();function Wn(n,t){r[n]=t.bind(null,r[n]||function(){})}function Gn(n){if($n)$n();$n=n&&n.S()}function Jn(n){var t=this,i=n.data,e=useSignal(i);e.value=i;var r=ln(function(){var n=t,i=t.__v;while(i=i.__)if(i.__c){i.__c.__$f|=4;break}var r=Dn(function(){var n=e.value.value;return 0===n?0:!0===n?"":n||""}),o=Dn(function(){return!Array.isArray(r.value)&&!u(r.value)}),a=Fn(function(){this.N=Qn;if(o.value){var t=r.value;if(n.__v&&n.__v.__e&&3===n.__v.__e.nodeType)n.__v.__e.data=t}}),l=t.__$u.d;t.__$u.d=function(){a();l.call(this)};return[o,r]},[]),o=r[0],a=r[1];return o.value?a.peek():a.value}Jn.displayName="ReactiveTextNode";Object.defineProperties(Mn.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Jn},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Wn("__b",function(n,t){if("string"==typeof t.type){var i,e=t.props;for(var r in e)if("children"!==r){var o=e[r];if(o instanceof Mn){if(!i)t.__np=i={};i[r]=o;e[r]=o.peek()}}}n(t)});Wn("__r",function(n,t){if(t.type!==x){Gn();var i,e=t.__c;if(e){e.__$f&=-2;if(void 0===(i=e.__$u))e.__$u=i=function(n,t){var i;Fn(function(){i=this},{name:t});i.c=n;return i}(function(){var n;if(qn)null==(n=i.y)||n.call(i);e.__$f|=1;e.setState({})},"function"==typeof t.type?t.type.displayName||t.type.name:"")}Rn=e;Gn(i)}n(t)});Wn("__e",function(n,t,i,e){Gn();Rn=void 0;n(t,i,e)});Wn("diffed",function(n,t){Gn();Rn=void 0;var i;if("string"==typeof t.type&&(i=t.__e)){var e=t.__np,r=t.props;if(e){var o=i.U;if(o)for(var u in o){var a=o[u];if(void 0!==a&&!(u in e)){a.d();o[u]=void 0}}else{o={};i.U=o}for(var l in e){var c=o[l],f=e[l];if(void 0===c){c=Bn(i,l,f,r);o[l]=c}else c.o(f,r)}}}n(t)});function Bn(n,t,i,e){var r=t in n&&void 0===n.ownerSVGElement,o=Sn(i);return{o:function(n,t){o.value=n;e=t},d:Fn(function(){this.N=Qn;var i=o.value.value;if(e[t]!==i){e[t]=i;if(r)n[t]=i;else if(null!=i&&(!1!==i||"-"===t[4]))n.setAttribute(t,i);else n.removeAttribute(t)}})}}Wn("unmount",function(n,t){if("string"==typeof t.type){var i=t.__e;if(i){var e=i.U;if(e){i.U=void 0;for(var r in e){var o=e[r];if(o)o.d()}}}}else{var u=t.__c;if(u){var a=u.__$u;if(a){u.__$u=void 0;a.d()}}}n(t)});Wn("__h",function(n,t,i,e){if(e<3||9===e)t.__$f|=2;n(t,i,e)});k.prototype.shouldComponentUpdate=function(n,t){var i=this.__$u,e=i&&void 0!==i.s;for(var r in t)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){var o=2&this.__$f;if(!(e||o||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(e||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var u in n)if("__source"!==u&&n[u]!==this.props[u])return!0;for(var a in this.props)if(!(a in n))return!0;return!1};function useSignal(n,t){return function(n){return Z=1,function(n,t,i){var e=on(G++,2);if(e.t=n,!e.__c&&(e.__=[i?i(t):pn(void 0,t),function(n){var t=e.__N?e.__N[0]:e.__[0],i=e.t(t,n);t!==i&&(e.__N=[i,e.__[1]],e.__c.setState({}))}],e.__c=J,!J.__f)){var r=function(n,t,i){if(!e.__c.__H)return!0;var r=e.__c.__H.__.filter(function(n){return!!n.__c});if(r.every(function(n){return!n.__N}))return!o||o.call(this,n,t,i);var u=e.__c.props!==n;return r.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(u=!0)}}),o&&o.call(this,n,t,i)||u};J.__f=!0;var o=J.shouldComponentUpdate,u=J.componentWillUpdate;J.componentWillUpdate=function(n,t,i){if(this.__e){var e=o;o=void 0,r(n,t,i),o=e}u&&u.call(this,n,t,i)},J.shouldComponentUpdate=r}return e.__N||e.__}(pn,n)}(function(){return Sn(n,t)})[0]}var Vn="undefined"==typeof requestAnimationFrame?setTimeout:function(n){var t=function(){clearTimeout(i);cancelAnimationFrame(e);n()},i=setTimeout(t,35),e=requestAnimationFrame(t)},Zn=function(n){queueMicrotask(function(){queueMicrotask(n)})};function Xn(){yn(function(){var n;while(n=zn.shift())Ln.call(n)})}function Yn(){if(1===zn.push(this))(r.requestAnimationFrame||Vn)(Xn)}function Kn(){yn(function(){var n;while(n=Hn.shift())Ln.call(n)})}function Qn(){if(1===Hn.push(this))(r.requestAnimationFrame||Zn)(Kn)}function useSignalEffect(n,t){var i=an(n);i.current=n;un(function(){return Fn(function(){this.N=Yn;return i.current()},t)},[])}function nt(n){var t=n.onClick,i=n.className,e=void 0===i?"":i,r=n.disabled,o=void 0===r?!1:r,u=n.children,a=n.variant,l=void 0===a?"secondary":a,c=n.popovertarget,f=n.active;return W("button",{popovertarget:c,onClick:t,className:("btn "+("primary"===l?"btn-primary":"btn-secondary")+" "+((void 0===f?0:f)?"active":"")+" "+e).trim(),disabled:o,children:u})}function tt(n){var t=n.onRefresh,i=n.title,e=void 0===i?"No Signals Detected":i,r=n.description,o=void 0===r?"Make sure your application is using @preact/signals-debug package.":r,u=n.buttonText,a=void 0===u?"Refresh Detection":u;return W("div",{className:"empty-state",children:W("div",{className:"empty-state-content",children:[W("h2",{children:e}),W("p",{children:o}),W("div",{className:"empty-state-actions",children:W(nt,{onClick:t,variant:"primary",children:a})})]})})}function it(n){var t=n.status,i=n.message,e=n.showIndicator,r=void 0===e?!0:e,o=n.className;return W("div",{className:"connection-status "+t+" "+(void 0===o?"":o),children:[r&&W("span",{className:"status-indicator "+t}),W("span",{className:"status-text",children:i})]})}var et=null;function rt(){if(!et)throw new Error("DevTools context not initialized. Call initDevTools() first.");return et}function ot(n){var t=Sn("connecting"),i=Sn("Connecting..."),e=Sn(!1);n.on("connectionStatusChanged",function(n){t.value=n.status;i.value=n.message});n.on("signalsAvailable",function(n){e.value=n});return{get status(){return t.value},get message(){return i.value},get isConnected(){return e.value},refreshConnection:function(){t.value="connecting";i.value="Connecting...";n.requestState()}}}var ut=function(n,t){return n.update.signalId===t.update.signalId&&n.children.length===t.children.length&&n.children.every(function(n,i){return ut(n,t.children[i])})};function at(n,e){var r=Sn([]),o=Sn(!1),u=Sn(new Set),a=function(n){if(Array.isArray(n))n.forEach(function(n){if("divider"!==n.type)n.receivedAt=Date.now()});else if("update"===n.type)n.receivedAt=Date.now();r.value=[].concat(r.value,Array.isArray(n)?n:[n])},l=Dn(function(){return r.value.length>0}),c=Dn(function(){var n=new Map;r.value.forEach(function(t){if("divider"!==t.type){var i=t.signalName||"Unknown";n.set(i,(n.get(i)||0)+1)}});return n}),f=Dn(function(){return function(n){for(var t=[],i=[],e=n.slice(-100).reverse(),r=0;r<e.length;r++){var o=e[r];if("divider"!==o.type){var u=o,a=u.depth||0,l={type:"single",id:u.signalName+"-"+u.receivedAt+"-"+r,update:u,children:[],depth:a,hasChildren:!1};while(i.length>0&&i[i.length-1].depth>=a)i.pop();if(0===i.length)t.push(l);else{var c=i[i.length-1];c.children.push(l);c.hasChildren=!0}i.push(l)}}return t}(r.value)});n.on("signalUpdate",function(n){if(!o.value){var t=[].concat(n).reverse();t.push({type:"divider"});a(t)}});n.on("signalDisposed",function(n){if(!o.value)!function(n){for(var i,e=Array.isArray(n)?n:[n],r=new Set(u.value),o=t(e);!(i=o()).done;){var a=i.value;if(a.signalId)r.add(a.signalId)}u.value=r}(n)});var s=Dn(function(){var n=f.value;if(e.settings.grouped)return function(n){for(var e,r,o=[],u=t(n);!(r=u()).done;){var a=r.value;if(!e||!ut(e,a)){o.push(a);e=a}else if("group"!==e.type){o.pop();e=i({},e,{type:"group",count:2,firstUpdate:a.update,firstChildren:a.children});o.push(e)}else{e.count++;e.firstUpdate=a.update;e.firstChildren=a.children}}return o}(n);else return n});return{updates:r,updateTree:f,collapsedUpdateTree:s,totalUpdates:Dn(function(){return Object.keys(f.value).length}),signalCounts:c,disposedSignalIds:u,addUpdate:a,clearUpdates:function(){r.value=[];u.value=new Set},hasUpdates:l,isPaused:o}}function lt(n){var t=Sn({enabled:!0,grouped:!0,consoleLogging:!0,maxUpdatesPerSecond:60,filterPatterns:[]}),i=Sn(!1);n.on("configReceived",function(n){if(n.settings)t.value=n.settings});return{get settings(){return t.value},get showDisposedSignals(){return i.value},set settings(n){t.value=n},applySettings:function(i){t.value=i;n.sendConfig(i)},toggleShowDisposedSignals:function(){i.value=!i.value}}}function ct(n){var t=lt(n),i=at(n,t),e=ot(n);return et={adapter:n,connectionStore:e,updatesStore:i,settingsStore:t}}function ft(){if(et){et.adapter.disconnect();et=null}}function st(){var n=rt(),t=n.connectionStore,i=n.updatesStore,e=function(){i.isPaused.value=!i.isPaused.value},r=function(){i.clearUpdates()};return W("header",{className:"header",children:[W("div",{className:"header-title",children:[W("h1",{children:"Signals"}),W(it,{status:t.status,message:t.message})]}),W("div",{className:"header-controls",children:[r&&W(nt,{onClick:r,children:"Clear"}),e&&W(nt,{onClick:e,active:i.isPaused.value,children:i.isPaused.value?"Resume":"Pause"}),W(nt,{popovertarget:"settings-panel-popover",children:"Settings"})]})]})}function dt(){var n=rt().settingsStore,t=an(null),e=n.applySettings,r=useSignal(n.settings);useSignalEffect(function(){r.value=n.settings});return W("div",{ref:t,popover:"auto",id:"settings-panel-popover",className:"settings-panel",children:W("div",{className:"settings-content",children:[W("h3",{children:"Debug Configuration"}),W("div",{className:"setting-group",children:W("label",{children:[W("input",{type:"checkbox",checked:r.value.enabled,onChange:function(n){return r.value=i({},r.value,{enabled:n.target.checked})}}),"Enable debug updates"]})}),W("div",{className:"setting-group",children:W("label",{children:[W("input",{type:"checkbox",checked:r.value.grouped,onChange:function(n){return r.value=i({},r.value,{grouped:n.target.checked})}}),"Group related updates"]})}),W("div",{className:"setting-group",children:[W("label",{children:[W("input",{type:"checkbox",checked:r.value.consoleLogging,onChange:function(n){return r.value=i({},r.value,{consoleLogging:n.target.checked})}}),"Enable console logging"]}),W("p",{className:"setting-description",children:"When disabled, signal updates will not be logged to the browser console."})]}),W("div",{className:"setting-group",children:[W("label",{htmlFor:"maxUpdatesInput",children:"Max updates per second:"}),W("input",{type:"number",id:"maxUpdatesInput",value:r.value.maxUpdatesPerSecond,min:"1",max:"1000",onChange:function(n){return r.value=i({},r.value,{maxUpdatesPerSecond:parseInt(n.target.value)||60})}})]}),W("div",{className:"setting-group",children:[W("label",{htmlFor:"filterPatternsInput",children:"Filter patterns (one per line):"}),W("textarea",{id:"filterPatternsInput",placeholder:"user.*\n.*State$\nglobal",value:r.value.filterPatterns.join("\n"),onChange:function(n){return r.value=i({},r.value,{filterPatterns:n.target.value.split("\n").map(function(n){return n.trim()}).filter(function(n){return n.length>0})})}})]}),W("h3",{children:"Graph Settings"}),W("div",{className:"setting-group",children:[W("label",{children:[W("input",{type:"checkbox",checked:n.showDisposedSignals,onChange:function(){return n.toggleShowDisposedSignals()}}),"Show disposed signals in graph"]}),W("p",{className:"setting-description",children:"When enabled, signals and effects that have been disposed will still be shown in the graph view."})]}),W("div",{className:"settings-actions",children:[W(nt,{onClick:function(){e(r.value)},variant:"primary",children:"Apply"}),W(nt,{onClick:function(){var n;null==(n=t.current)||n.hide()},children:"Cancel"})]})]})})}var vt=function(n){var t=document.createElement("textarea");try{t.value=n;document.body.append(t);t.select();document.execCommand("copy")}finally{t.remove()}};function ht(){var n=rt(),i=n.updatesStore,e=n.settingsStore,r=i.updates,o=i.disposedSignalIds,u=an(null),a=an(null),l=an(null),c=useSignal({x:0,y:0}),f=useSignal(1),s=useSignal(!1),d=useSignal({x:0,y:0}),v=useSignal(!1),h=useSignal(),p=useSignal(null),g=useSignal({x:0,y:0});un(function(){var n=function(n){if(v.value&&l.current&&!l.current.contains(n.target))v.value=!1};document.addEventListener("mousedown",n);return function(){document.removeEventListener("mousedown",n)}},[]);var m=function(n,t){var i=an(n);i.current=n;Rn.__$f|=4;return ln(function(){return Dn(function(){return i.current()},void 0)},[])}(function(){var n=r.value,i=o.value,u=e.showDisposedSignals;if(!n||0===n.length)return{nodes:[],links:[]};for(var a,l=new Map,c=new Map,f=n.filter(function(n){return"divider"!==n.type}),s=t(f);!(a=s()).done;){var d=a.value;if(d.signalId)if(u||!i.has(d.signalId)){var v=d.signalType;if(!l.has(d.signalId))l.set(d.signalId,{id:d.signalId,name:d.signalName,type:v,x:0,y:0,depth:0});if(d.allDependencies&&d.allDependencies.length>0)for(var h,p=t(d.allDependencies);!(h=p()).done;){var g=h.value;if(u||!i.has(g.id)){if(!l.has(g.id))l.set(g.id,{id:g.id,name:g.name,type:g.type,x:0,y:0,depth:0});var m=g.id+"->"+d.signalId;if(!c.has(m))c.set(m,{source:g.id,target:d.signalId})}}else if(d.subscribedTo){if(!u&&i.has(d.subscribedTo))continue;var y=d.subscribedTo+"->"+d.signalId;if(!c.has(y))c.set(y,{source:d.subscribedTo,target:d.signalId})}}}var b=Array.from(c.values()),w=function(n,t){var i=new Map,e=new Map,r=new Map;n.forEach(function(n,t){e.set(t,new Set);r.set(t,0)});t.forEach(function(n){var t;null==(t=e.get(n.source))||t.add(n.target);r.set(n.target,(r.get(n.target)||0)+1)});var o=[];n.forEach(function(n,t){if(0===r.get(t)){o.push(t);i.set(t,0)}});var u=function(){var n,t=o.shift(),u=i.get(t);null==(n=e.get(t))||n.forEach(function(n){var t,e=null!=(t=i.get(n))?t:0;i.set(n,Math.max(e,u+1));var a=(r.get(n)||0)-1;r.set(n,a);if(0===a)o.push(n)})};while(o.length>0)u();return i}(l,b);l.forEach(function(n,t){var i;n.depth=null!=(i=w.get(t))?i:0});var N=new Map;l.forEach(function(n){if(!N.has(n.depth))N.set(n.depth,[]);N.get(n.depth).push(n)});!function(n,t){var i=Array.from(n.keys()).sort(function(n,t){return n-t}),e=new Map,r=new Map;t.forEach(function(n){if(!e.has(n.source))e.set(n.source,[]);if(!r.has(n.target))r.set(n.target,[]);e.get(n.source).push(n.target);r.get(n.target).push(n.source)});for(var o=new Map,u=0;u<4;u++){for(var a=function(){var t=i[l],e=n.get(t);e.forEach(function(n,t){o.set(n.id,t)});if(0===l)return 1;var u=e.map(function(n){var t=r.get(n.id)||[];if(0===t.length)return 0;else return t.reduce(function(n,t){var i;return n+(null!=(i=o.get(t))?i:0)},0)/t.length}),a=e.map(function(n,t){return{node:n,barycenter:u[t]}}).sort(function(n,t){return n.barycenter-t.barycenter}).map(function(n){return n.node});n.set(t,a)},l=0;l<i.length;l++)if(!a());for(var c=function(){var t=i[f],r=n.get(t);r.forEach(function(n,t){o.set(n.id,t)});if(f===i.length-1)return 1;var u=r.map(function(n){var t=e.get(n.id)||[];if(0===t.length)return 0;else return t.reduce(function(n,t){var i;return n+(null!=(i=o.get(t))?i:0)},0)/t.length}),a=r.map(function(n,t){return{node:n,barycenter:u[t]}}).sort(function(n,t){return n.barycenter-t.barycenter}).map(function(n){return n.node});n.set(t,a)},f=i.length-1;f>=0;f--)if(!c());}}(N,b);N.forEach(function(n,t){var i=80-120*(n.length-1)/2;n.forEach(function(n,e){n.x=100+250*t;n.y=i+120*e+50*N.size})});return{nodes:Array.from(l.values()),links:b}}),y=function(){s.value=!1},b=/[^a-zA-Z0-9]/g,w=function(n){return n.replace(b,"_")},N=function(n){var t=6.5*n.name.length+16;return Math.max(30,Math.min(t/2,70))},x=function(n){var t=a.current;if(t&&p.value){var i=t.getBoundingClientRect();g.value={x:n.clientX-i.left,y:n.clientY-i.top}}},k=function(){p.value=null},_=function(n){h.value=n;setTimeout(function(){h.value=void 0},2e3)};if(0===m.value.nodes.length)return W("div",{className:"graph-empty",children:W("div",{children:[W("h3",{children:"No Signal Dependencies"}),W("p",{children:"Create some signals with dependencies to see the graph visualization."})]})});var C=Math.max.apply(Math,[800].concat(m.value.nodes.map(function(n){return n.x+100}))),M=Math.max.apply(Math,[600].concat(m.value.nodes.map(function(n){return n.y+100})));return W("div",{className:"graph-container",children:W("div",{ref:a,className:"graph-content",onMouseDown:function(n){if(0===n.button){s.value=!0;d.value={x:n.clientX-c.value.x,y:n.clientY-c.value.y}}},onMouseMove:function(n){if(s.value)c.value={x:n.clientX-d.value.x,y:n.clientY-d.value.y}},onMouseUp:y,onMouseLeave:y,onWheel:function(n){n.preventDefault();var t=a.current;if(t){var i=t.getBoundingClientRect(),e=n.clientX-i.left,r=n.clientY-i.top,o=n.deltaY>0?.96:1.04,u=Math.min(Math.max(.1,f.value*o),5),l=u/f.value;c.value={x:e-(e-c.value.x)*l,y:r-(r-c.value.y)*l};f.value=u}},style:{cursor:s.value?"grabbing":"grab"},children:[W("svg",{ref:u,className:"graph-svg",width:C,height:M,viewBox:"0 0 "+C+" "+M,children:[W("defs",{children:W("marker",{id:"arrowhead",markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto",children:W("polygon",{points:"0 0, 8 3, 0 6",fill:"#94a3b8"})})}),W("g",{transform:"translate("+c.value.x+", "+c.value.y+") scale("+f.value+")",children:[W("g",{className:"links",children:m.value.links.map(function(n,t){var i=m.value.nodes.find(function(t){return t.id===n.source}),e=m.value.nodes.find(function(t){return t.id===n.target});if(!i||!e)return null;var r=N(i),o=N(e),u=i.x+r,a=i.y,l=e.x-o-8,c=e.y,f=u+.5*(l-u);return W("path",{className:"graph-link",d:"M "+u+" "+a+" C "+f+" "+a+", "+f+" "+c+", "+l+" "+c,fill:"none",markerEnd:"url(#arrowhead)"},"link-"+t)})}),W("g",{className:"nodes",children:m.value.nodes.map(function(n){var t,i=N(n),e=Math.floor((2*i-16)/6.5),r=n.name.length>e?n.name.slice(0,e-1)+"…":n.name;return W("g",{className:"graph-node-group "+((null==(t=p.value)?void 0:t.id)===n.id?"hovered":""),onMouseEnter:function(t){return function(n,t){p.value=n;var i=a.current;if(i){var e=i.getBoundingClientRect();g.value={x:t.clientX-e.left,y:t.clientY-e.top}}}(n,t)},onMouseMove:x,onMouseLeave:k,children:[W("circle",{className:"graph-node "+n.type,cx:n.x,cy:n.y,r:i}),W("text",{className:"graph-text",x:n.x,y:n.y,textAnchor:"middle",dominantBaseline:"central",children:r})]},n.id)})})]})]}),W("div",{className:"graph-controls",children:[W("button",{className:"graph-reset-button",onClick:function(){c.value={x:0,y:0};f.value=1},title:"Reset view",children:"⟲ Reset View"}),W("div",{ref:l,className:"graph-export-container",children:[W("button",{className:"graph-export-button",onClick:function(){v.value=!v.value},title:"Export graph",children:"↓ Export"}),v.value&&W("div",{className:"graph-export-menu",children:[W("button",{className:"graph-export-menu-item",onClick:function(){try{v.value=!1;var n=["graph LR"];m.value.nodes.forEach(function(t){var i=w(t.id),e=t.name;switch(t.type){case"signal":n.push(" "+i+"(("+e+"))");break;case"computed":n.push(" "+i+"("+e+")");break;case"effect":n.push(" "+i+"(["+e+"])")}});for(var i,e=t(m.value.links);!(i=e()).done;){var r=i.value,o=w(r.source),u=w(r.target);n.push(" "+o+" --\x3e "+u)}vt(n.join("\n"));_("Copied to clipboard!");return Promise.resolve()}catch(n){return Promise.reject(n)}},children:"Mermaid"}),W("button",{className:"graph-export-menu-item",onClick:function(){try{v.value=!1;var n=JSON.stringify(m.value,null,2);vt(n);_("Copied to clipboard!");return Promise.resolve()}catch(n){return Promise.reject(n)}},children:"JSON"})]})]}),W("div",{className:"graph-zoom-indicator",title:"Zoom level",children:[Math.round(100*f.value),"%"]})]}),h.value&&W("div",{className:"graph-toast",children:h.value}),p.value&&W("div",{className:"graph-tooltip",style:{left:g.value.x+12,top:g.value.y-8},children:[W("div",{className:"tooltip-header",children:W("span",{className:"tooltip-type "+p.value.type,children:p.value.type})}),W("div",{className:"tooltip-name",children:p.value.name}),W("div",{className:"tooltip-id",children:["ID: ",p.value.id]})]}),W("div",{className:"graph-legend",children:[W("div",{className:"legend-item",children:[W("div",{className:"legend-color",style:{backgroundColor:"#2196f3"}}),W("span",{children:"Signal"})]}),W("div",{className:"legend-item",children:[W("div",{className:"legend-color",style:{backgroundColor:"#ff9800"}}),W("span",{children:"Computed"})]}),W("div",{className:"legend-item",children:[W("div",{className:"legend-color",style:{backgroundColor:"#4caf50"}}),W("span",{children:"Effect"})]})]})]})})}function pt(n){var t=n.update,i=n.count,e=n.firstUpdate,r=new Date(t.timestamp||t.receivedAt).toLocaleTimeString(),o=function(n){if(null===n)return"null";if(void 0===n)return"undefined";if("string"==typeof n)return'"'+n+'"';if("function"==typeof n)return"function()";if("object"==typeof n)try{return JSON.stringify(n,null,0)}catch(n){return"[Object]"}return String(n)},u=i&&W("span",{class:"update-count",title:"Number of grouped identical updates",children:["x",i]});if("effect"===t.type)return W("div",{className:"update-item "+t.type,children:W("div",{className:"update-header",children:[W("span",{className:"signal-name",children:["↪️ ",t.signalName,u]}),W("span",{className:"update-time",children:r})]})});var a=o(t.prevValue),l=o(t.newValue),c=void 0!==e?o(e.prevValue):void 0;return W("div",{class:"update-item "+t.type,children:[W("div",{class:"update-header",children:[W("span",{class:"signal-name",children:[0===t.depth?"🎯":"↪️"," ",t.signalName,u]}),W("span",{class:"update-time",children:r})]}),W("div",{class:"value-change",children:[c&&c!==a&&W(x,{children:[W("span",{class:"value-prev",children:c}),W("span",{class:"value-arrow",children:"..."})]}),W("span",{class:"value-prev",children:a}),W("span",{class:"value-arrow",children:"→"}),W("span",{class:"value-new",children:l})]})]})}function gt(n){var t,e=n.node,r=useSignal(!1),o=e.children.length>0,u="group"===e.type?e.count:void 0,a="group"===e.type?e.firstUpdate:void 0;if("group"===e.type&&e.firstChildren)t=e.children.map(function(n,t){var r=e.firstChildren[t];return i({},n,{type:"group",firstUpdate:r.update,firstChildren:r.children,count:e.count})});else t=e.children;return W("div",{className:"tree-node",children:[W("div",{className:"tree-node-content",children:[o&&W("button",{className:"collapse-button",onClick:function(){r.value=!r.value},"aria-label":r.value?"Expand":"Collapse",children:r.value?"▶":"▼"}),!o&&W("div",{className:"collapse-spacer"}),W("div",{className:"update-content",children:W(pt,{update:e.update,count:u,firstUpdate:a})})]}),o&&!r.value&&W("div",{className:"tree-children",children:t.map(function(n){return W(gt,{node:n},n.id)})})]})}function mt(){var n=rt().updatesStore,t=an(null),i=n.collapsedUpdateTree.value;useSignalEffect(function(){if(t.current)t.current.scrollTop=0});return W("div",{className:"updates-container",children:[W("div",{className:"updates-header",children:W("div",{className:"updates-stats",children:[W("span",{children:["Updates: ",W("strong",{children:n.totalUpdates.value})]}),W("span",{children:["Signals: ",W("strong",{children:n.signalCounts.value.size})]})]})}),W("div",{className:"updates-list",ref:t,children:i.map(function(n){return W(gt,{node:n},n.id)})})]})}var yt=["adapter","container"];function bt(n){var t=void 0===n?{}:n,i=t.hideHeader,e=void 0===i?!1:i,r=t.initialTab,o=void 0===r?"updates":r,u=rt().connectionStore,a=useSignal(o);return W("div",{className:"signals-devtools",children:[!e&&W(st,{}),W(dt,{}),W("main",{className:"main-content",children:[W("div",{className:"tabs",children:[W("button",{className:"tab "+("updates"===a.value?"active":""),onClick:function(){return a.value="updates"},children:"Updates"}),W("button",{className:"tab "+("graph"===a.value?"active":""),onClick:function(){return a.value="graph"},children:"Dependency Graph"})]}),W("div",{className:"tab-content",children:!u.isConnected?W(tt,{onRefresh:u.refreshConnection}):W(x,{children:["updates"===a.value&&W(mt,{}),"graph"===a.value&&W(ht,{})]})})]})]})}exports.Button=nt;exports.DevToolsPanel=bt;exports.EmptyState=tt;exports.GraphVisualization=ht;exports.Header=st;exports.SettingsPanel=dt;exports.StatusIndicator=it;exports.UpdateItem=pt;exports.UpdateTreeNodeComponent=gt;exports.UpdatesContainer=mt;exports.createConnectionStore=ot;exports.createSettingsStore=lt;exports.createUpdatesStore=at;exports.destroyDevTools=ft;exports.getContext=rt;exports.initDevTools=ct;exports.mount=function(n){try{var t=n.adapter,e=n.container,r=function(n,t){if(null==n)return{};var i={};for(var e in n)if({}.hasOwnProperty.call(n,e)){if(-1!==t.indexOf(e))continue;i[e]=n[e]}return i}(n,yt);ct(t);return Promise.resolve(t.connect()).then(function(){e.innerHTML="";z(W(bt,i({},r)),e);return function(){z(null,e);ft()}})}catch(n){return Promise.reject(n)}};//# sourceMappingURL=devtools-ui.js.map