import{Signal as r}from"@preact/signals-core";import{useSignal}from"@preact/signals-react";import{useSignals as n}from"@preact/signals-react/runtime";import{createElement as t,useMemo as e,Fragment as i}from"react";var o=function(r){n();return"function"==typeof r.children?r.children(r.v,r.i):r.children};o.displayName="Item";function u(r){n();var e="function"==typeof r.when?r.when():r.when.value;if(!e)return r.fallback||null;else return t(o,{v:e,children:r.children})}u.displayName="Show";function c(u){n();var c=e(function(){return new Map},[]),f="function"==typeof u.each?u.each():u.each,a=f instanceof r?f.value:f;if(!a.length)return u.fallback||null;var l=new Set(c.keys()),p=a.map(function(r,n){l.delete(r);if(!c.has(r)){var e=u.getKey?u.getKey(r,n):n,i=t(o,{v:r,key:e,i:n,children:u.children});c.set(r,i);return i}return c.get(r)});l.forEach(function(r){c.delete(r)});return t(i,{children:p})}c.displayName="For";function f(r){var n=useSignal(r);if(n.peek()!==r)n.value=r;return n}function a(r){var n=useSignal(r);if(!("current"in n))Object.defineProperty(n,"current",l);return n}var l={configurable:!0,get:function(){return this.value},set:function(r){this.value=r}};export{c as For,u as Show,f as useLiveSignal,a as useSignalRef};//# sourceMappingURL=utils.module.js.map
