diff --git a/dist/esm-with-signals.js b/dist/esm-with-signals.js
index de1d521..cd0148b 100644
--- a/dist/esm-with-signals.js
+++ b/dist/esm-with-signals.js
@@ -696,13 +696,10 @@ var queueSignalWrite = /* @__PURE__ */ (() => {
})();
// src/signals-lib/signals-lib.js
-var Signal = oCreate(null, {
+var SignalReadOnly = oCreate(null, {
get: { value() {
return read(this);
} },
- set: { value(...v) {
- return write(this, ...v);
- } },
toJSON: { value() {
return read(this);
} },
@@ -710,9 +707,9 @@ var Signal = oCreate(null, {
return this[mark] && this[mark].value;
} }
});
-var SignalReadOnly = oCreate(Signal, {
- set: { value() {
- return;
+var Signal = oCreate(SignalReadOnly, {
+ set: { value(...v) {
+ return write(this, ...v);
} }
});
function isSignal(candidate) {
@@ -906,7 +903,7 @@ var cleanUpRegistry = new FinalizationRegistry(function(s) {
});
function create(is_readonly, value, actions) {
const varS = oCreate(is_readonly ? SignalReadOnly : Signal);
- const SI = toSignal(varS, value, actions, is_readonly);
+ const SI = toSignal(varS, value, actions);
cleanUpRegistry.register(SI, SI[mark]);
return SI;
}
@@ -918,7 +915,7 @@ var protoSigal = oAssign(oCreate(), {
this.skip = true;
}
});
-function toSignal(s, value, actions, readonly = false) {
+function toSignal(s, value, actions) {
const onclear = [];
if (typeOf(actions) !== "[object Object]")
actions = {};
@@ -934,8 +931,7 @@ function toSignal(s, value, actions, readonly = false) {
actions,
onclear,
host,
- listeners: /* @__PURE__ */ new Set(),
- readonly
+ listeners: /* @__PURE__ */ new Set()
}),
enumerable: false,
writable: false,
diff --git a/dist/esm-with-signals.min.js b/dist/esm-with-signals.min.js
index 2ad3eca..35b5a68 100644
--- a/dist/esm-with-signals.min.js
+++ b/dist/esm-with-signals.min.js
@@ -1,3 +1,3 @@
-var W=(...t)=>Object.prototype.hasOwnProperty.call(...t);function A(t){return typeof t>"u"}function rt(t){let e=typeof t;return e!=="object"?e:t===null?"null":Object.prototype.toString.call(t)}function _(t,e){return t instanceof e}function ot(t,e){return Object.prototype.isPrototypeOf.call(e,t)}function S(t=null,e={}){return Object.create(t,e)}function b(...t){return Object.assign(...t)}function Z(t,e){if(!t||!_(t,AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function ct(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(r,o){return r[St(o)]=e(t,o),r},{})}function St(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function j(){return new Promise(function(t){(globalThis.requestIdleCallback||requestAnimationFrame)(t)})}var d={setDeleteAttr:wt,ssr:"",D:globalThis.document,N:globalThis.Node,F:globalThis.DocumentFragment,H:globalThis.HTMLElement,S:globalThis.SVGElement,M:globalThis.MutationObserver,q:t=>t||Promise.resolve()};function wt(t,e,n){if(Reflect.set(t,e,n),!!A(n)){if(Reflect.deleteProperty(t,e),_(t,d.H)&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var M="__dde_lifecyclesToEvents",C="dde:connected",R="dde:disconnected",F="dde:attributeChanged";var D=d.M?yt():new Proxy({},{get(){return()=>{}}});function yt(){let t=new Map,e=!1,n=s=>function(p){for(let f of p)if(f.type==="childList"){if(m(f.addedNodes,!0)){s();continue}h(f.removedNodes,!0)&&s()}},r=new d.M(n(u));return{observe(s){let p=new d.M(n(()=>{}));return p.observe(s,{childList:!0,subtree:!0}),()=>p.disconnect()},onConnected(s,p){i();let f=c(s);f.connected.has(p)||(f.connected.add(p),f.length_c+=1)},offConnected(s,p){if(!t.has(s))return;let f=t.get(s);f.connected.has(p)&&(f.connected.delete(p),f.length_c-=1,o(s,f))},onDisconnected(s,p){i();let f=c(s);f.disconnected.has(p)||(f.disconnected.add(p),f.length_d+=1)},offDisconnected(s,p){if(!t.has(s))return;let f=t.get(s);f.disconnected.delete(p),f.length_d-=1,o(s,f)}};function o(s,p){p.length_c||p.length_d||(t.delete(s),u())}function c(s){if(t.has(s))return t.get(s);let p={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(s,p),p}function i(){e||(e=!0,r.observe(d.D.body,{childList:!0,subtree:!0}))}function u(){!e||t.size||(e=!1,r.disconnect())}async function a(s){t.size>30&&await j();let p=[];if(!_(s,d.N))return p;for(let f of t.keys())f===s||!_(f,d.N)||s.contains(f)&&p.push(f);return p}function m(s,p){let f=!1;for(let w of s){if(p&&a(w).then(m),!t.has(w))continue;let P=t.get(w);P.length_c&&(w.dispatchEvent(new Event(C)),P.connected=new WeakSet,P.length_c=0,P.length_d||t.delete(w),f=!0)}return f}function h(s,p){let f=!1;for(let w of s)p&&a(w).then(h),!(!t.has(w)||!t.get(w).length_d)&&((globalThis.queueMicrotask||setTimeout)(v(w)),f=!0);return f}function v(s){return()=>{s.isConnected||(s.dispatchEvent(new Event(R)),t.delete(s))}}}function Ht(t,e,n){return typeof e=="function"&&(n=e,e=null),e||(e={}),function(o,...c){n&&(c.unshift(o),o=typeof n=="function"?n():n);let i=c.length?new CustomEvent(t,b({detail:c[0]},e)):new Event(t,e);return o.dispatchEvent(i)}}function y(t,e,n){return function(o){return o.addEventListener(t,e,n),o}}y.defer=t=>setTimeout.bind(null,t,0);var it=t=>b({},typeof t=="object"?t:null,{once:!0});y.connected=function(t,e){return e=it(e),function(r){return r.addEventListener(C,t,e),r[M]?r:r.isConnected?(r.dispatchEvent(new Event(C)),r):(Z(e.signal,()=>D.offConnected(r,t))&&D.onConnected(r,t),r)}};y.disconnected=function(t,e){return e=it(e),function(r){return r.addEventListener(R,t,e),r[M]||Z(e.signal,()=>D.offDisconnected(r,t))&&D.onDisconnected(r,t),r}};var O=[{get scope(){return d.D.body},host:t=>t?t(d.D.body):d.D.body,prevent:!0}],G=new WeakMap,x={get current(){return O[O.length-1]},get host(){return this.current.host},get signal(){let{host:t}=this;if(G.has(t))return G.get(t);let e=new AbortController;return G.set(t,e),t(y.disconnected(()=>e.abort())),e.signal},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...O]},push(t={}){return O.push(b({},this.current,{prevent:!1},t))},pushRoot(){return O.push(O[0])},pop(){if(O.length!==1)return O.pop()}};var k={isSignal(t){return!1},processReactiveAttribute(t,e,n,r){return n}};function V(t,e=!0){return e?b(k,t):(Object.setPrototypeOf(t,k),t)}function I(t){return ot(t,k)&&t!==k?t:k}function st(t,e,n,r){return t[(A(r)?"remove":"set")+e](n,r)}function ut(t,e,n,r,o=null){return t[(A(r)?"remove":"set")+e+"NS"](o,n,r)}function K(t,e,n){if(Reflect.set(t,e,n),!!A(n))return Reflect.deleteProperty(t,e)}function ft(t,e,n,r){return _(t,d.H)?t[e+"Attribute"](n,r):t[e+"AttributeNS"](null,n,r)}function ce(t){return d.q(t)}function at(...t){return this.appendOriginal(...t),this}function At(t){return t.append===at||(t.appendOriginal=t.append,t.append=at),t}var $;function q(t,e,...n){let r=I(this),o=0,c,i,u=typeof e;switch((u==="string"||u==="number"||r.isSignal(e))&&(e={textContent:e}),!0){case typeof t=="function":{o=1;let a=(...v)=>v.length?(o===1?n.unshift(...v):v.forEach(s=>s(i)),void 0):i;x.push({scope:t,host:a}),c=t(e||void 0);let m=_(c,d.F);if(c.nodeName==="#comment")break;let h=q.mark({type:"component",name:t.name,host:m?"this":"parentElement"});c.prepend(h),m&&(i=h);break}case t==="#text":c=U.call(this,d.D.createTextNode(""),e);break;case(t==="<>"||!t):c=U.call(this,d.D.createDocumentFragment(),e);break;case!!$:c=U.call(this,d.D.createElementNS($,t),e);break;case!c:c=U.call(this,d.D.createElement(t),e)}return At(c),i||(i=c),n.forEach(a=>a(i)),o&&x.pop(),o=2,c}q.mark=function(t,e=!1){t=Object.entries(t).map(([o,c])=>o+`="${c}"`).join(" ");let n=e?"":"/",r=d.D.createComment(``);return e&&(r.end=d.D.createComment("")),r};function se(t){let e=this;return function(...r){$=t;let o=q.call(e,...r);return $=void 0,o}}var z=new WeakMap,{setDeleteAttr:pt}=d;function U(t,...e){if(!e.length)return t;z.set(t,lt(t,this));for(let[n,r]of Object.entries(b({},...e)))dt.call(this,t,n,r);return z.delete(t),t}function dt(t,e,n){let{setRemoveAttr:r,s:o}=lt(t,this),c=this;n=o.processReactiveAttribute(t,e,n,(u,a)=>dt.call(c,t,u,a));let[i]=e;if(i==="=")return r(e.slice(1),n);if(i===".")return K(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return r(e,n,"http://www.w3.org/1999/xlink");case"textContent":return pt(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return Q(o,e,t,n,K.bind(null,t[e]));case"ariaset":return Q(o,e,t,n,(u,a)=>r("aria-"+u,a));case"classList":return Ct.call(c,t,n)}return Ot(t,e)?pt(t,e,n):r(e,n)}function lt(t,e){if(z.has(t))return z.get(t);let r=(_(t,d.S)?ut:st).bind(null,t,"Attribute"),o=I(e);return{setRemoveAttr:r,s:o}}function Ct(t,e){let n=I(this);return Q(n,"classList",t,e,(r,o)=>t.classList.toggle(r,o===-1?void 0:!!o)),t}function Ot(t,e){if(!(e in t))return!1;let n=ht(t,e);return!A(n.set)}function ht(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||ht(t,e)}function Q(t,e,n,r,o){let c=String;if(!(typeof r!="object"||r===null))return Object.entries(r).forEach(function([u,a]){u&&(u=new c(u),u.target=e,a=t.processReactiveAttribute(n,u,a,o),o(u,a))})}function me(t,e=t){let n="\xB9\u2070",r="\u2713",o=Object.fromEntries(Array.from(e.querySelectorAll("slot")).filter(c=>!c.name.endsWith(n)).map(c=>[c.name+=n,c]));if(t.append=new Proxy(t.append,{apply(c,i,u){if(u[0]===e)return c.apply(t,u);for(let a of u){let m=(a.slot||"")+n;try{ft(a,"remove","slot")}catch{}let h=o[m];if(!h)return;h.name.startsWith(r)||(h.childNodes.forEach(v=>v.remove()),h.name=r+m),h.append(a)}return t.append=c,t}}),t!==e){let c=Array.from(t.childNodes);t.append(...c)}return e}function ge(t,e,n={}){let r=t.host||t;x.push({scope:r,host:(...i)=>i.length?i.forEach(u=>u(r)):r}),typeof n=="function"&&(n=n.call(r,r));let o=r[M];o||Rt(r);let c=e.call(r,n);return o||r.dispatchEvent(new Event(C)),t.nodeType===11&&typeof t.mode=="string"&&r.addEventListener(R,D.observe(t),{once:!0}),x.pop(),t.append(c)}function Rt(t){return X(t.prototype,"connectedCallback",function(e,n,r){e.apply(n,r),n.dispatchEvent(new Event(C))}),X(t.prototype,"disconnectedCallback",function(e,n,r){e.apply(n,r),(globalThis.queueMicrotask||setTimeout)(()=>!n.isConnected&&n.dispatchEvent(new Event(R)))}),X(t.prototype,"attributeChangedCallback",function(e,n,r){let[o,,c]=r;n.dispatchEvent(new CustomEvent(F,{detail:[o,c]})),e.apply(n,r)}),t.prototype[M]=!0,t}function X(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}var mt="__dde_memo",H=[];function T(t,e){if(!H.length)return e(t);let n=typeof t=="object"?JSON.stringify(t):t,[{cache:r,after:o}]=H;return o(n,W(r,n)?r[n]:e(t))}T.isScope=function(t){return t[mt]};T.scope=function(e,{signal:n,onlyLast:r}={}){let o=S();function c(...i){if(n&&n.aborted)return e.apply(this,i);let u=r?o:S();H.unshift({cache:o,after(m,h){return u[m]=h}});let a=e.apply(this,i);return H.shift(),o=u,a}return c[mt]=!0,c.clear=()=>o=S(),n&&n.addEventListener("abort",c.clear),c};var l="__dde_signal",Y=(()=>{let t=new Map,e=!1;function n(){e=!1;let r=t;t=new Map;for(let[o,c]of r){let i=o[l];i&&i.listeners.forEach(u=>u(i.value,c))}}return function(r,o=!1){t.set(r,t.get(r)||o),!e&&(e=!0,queueMicrotask(n))}})();var et=S(null,{get:{value(){return vt(this)}},set:{value(...t){return _t(this,...t)}},toJSON:{value(){return vt(this)}},valueOf:{value(){return this[l]&&this[l].value}}}),Dt=S(et,{set:{value(){}}});function J(t){return t&&t[l]}var B=[],E=new WeakMap;function g(t,e){if(typeof t!="function")return gt(!1,t,e);if(J(t))return t;let n=gt(!0);function r(o,c){let[i,...u]=E.get(r);if(E.set(r,new Set([i])),B.push(r),_t(n,t(),c),B.pop(),!u.length)return;let a=E.get(r);for(let m of u)a.has(m)||N(m,r)}return E.set(n[l],r),E.set(r,new Set([n])),r(),n}g.action=function(t,e,...n){let r=t[l];if(!r)return;let{actions:o}=r;if(!o||!W(o,e))throw new Error(`Action "${e}" not defined. See ${l}.actions.`);if(o[e].apply(r,n),r.skip)return delete r.skip;Y(t,!0)};g.on=function t(e,n,r={}){let{signal:o}=r;if(!(o&&o.aborted)){if(Array.isArray(e))return e.forEach(c=>t(c,n,r));nt(e,n),o&&o.addEventListener("abort",()=>N(e,n))}};g.symbols={onclear:Symbol.for("Signal.onclear")};g.clear=function(...t){for(let n of t){let r=n[l];r&&(delete n.toJSON,r.onclear.forEach(o=>o.call(r)),e(n,r),delete n[l])}function e(n,r){r.listeners.forEach(o=>{if(r.listeners.delete(o),!E.has(o))return;let c=E.get(o);c.delete(n),!(c.size>1)&&(n.clear(...c),E.delete(o))})}};var L="__dde_reactive";g.el=function(t,e){let n=T.isScope(e)?e:T.scope(e,{onlyLast:!0}),{current:r}=x,{scope:o}=r,c=q.mark({type:"reactive",component:o&&o.name||""},!0),i=c.end,u=d.D.createDocumentFragment();u.append(c,i);let a=m=>{if(!c.parentNode||!i.parentNode)return N(t,a);x.push(r);let h=n(m);x.pop(),Array.isArray(h)||(h=[h]);let v=document.createComment("");h.push(v),c.after(...h);let s;for(;(s=v.nextSibling)&&s!==i;)s.remove();v.remove(),c.isConnected&&Lt(r.host())};return nt(t,a),xt(t,a,c,e),a(t.get()),r.host(y.disconnected(()=>n.clear())),u};function Lt(t){!t||!t[L]||j().then(function(){t[L]=t[L].filter(([e,n])=>n.isConnected?!0:(N(...e),!1))})}var Nt={_set(t){this.value=t}};function Mt(t){return function(e,n){let r=S(et,{set:{value(...c){return e.setAttribute(n,...c)}}}),o=Et(r,e.getAttribute(n),Nt);return t[n]=o,o}}var tt="__dde_attributes";g.observedAttributes=function(t){let e=t[tt]={},n=ct(t,Mt(e));return y(F,function({detail:o}){/*! This maps attributes to signals (`S.observedAttributes`).
+var W=(...t)=>Object.prototype.hasOwnProperty.call(...t);function A(t){return typeof t>"u"}function nt(t){let e=typeof t;return e!=="object"?e:t===null?"null":Object.prototype.toString.call(t)}function _(t,e){return t instanceof e}function rt(t,e){return Object.prototype.isPrototypeOf.call(e,t)}function S(t=null,e={}){return Object.create(t,e)}function b(...t){return Object.assign(...t)}function Z(t,e){if(!t||!_(t,AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function ot(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(r,o){return r[wt(o)]=e(t,o),r},{})}function wt(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function j(){return new Promise(function(t){(globalThis.requestIdleCallback||requestAnimationFrame)(t)})}var d={setDeleteAttr:yt,ssr:"",D:globalThis.document,N:globalThis.Node,F:globalThis.DocumentFragment,H:globalThis.HTMLElement,S:globalThis.SVGElement,M:globalThis.MutationObserver,q:t=>t||Promise.resolve()};function yt(t,e,n){if(Reflect.set(t,e,n),!!A(n)){if(Reflect.deleteProperty(t,e),_(t,d.H)&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var M="__dde_lifecyclesToEvents",C="dde:connected",R="dde:disconnected",F="dde:attributeChanged";var D=d.M?At():new Proxy({},{get(){return()=>{}}});function At(){let t=new Map,e=!1,n=s=>function(p){for(let f of p)if(f.type==="childList"){if(m(f.addedNodes,!0)){s();continue}h(f.removedNodes,!0)&&s()}},r=new d.M(n(u));return{observe(s){let p=new d.M(n(()=>{}));return p.observe(s,{childList:!0,subtree:!0}),()=>p.disconnect()},onConnected(s,p){i();let f=c(s);f.connected.has(p)||(f.connected.add(p),f.length_c+=1)},offConnected(s,p){if(!t.has(s))return;let f=t.get(s);f.connected.has(p)&&(f.connected.delete(p),f.length_c-=1,o(s,f))},onDisconnected(s,p){i();let f=c(s);f.disconnected.has(p)||(f.disconnected.add(p),f.length_d+=1)},offDisconnected(s,p){if(!t.has(s))return;let f=t.get(s);f.disconnected.delete(p),f.length_d-=1,o(s,f)}};function o(s,p){p.length_c||p.length_d||(t.delete(s),u())}function c(s){if(t.has(s))return t.get(s);let p={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(s,p),p}function i(){e||(e=!0,r.observe(d.D.body,{childList:!0,subtree:!0}))}function u(){!e||t.size||(e=!1,r.disconnect())}async function a(s){t.size>30&&await j();let p=[];if(!_(s,d.N))return p;for(let f of t.keys())f===s||!_(f,d.N)||s.contains(f)&&p.push(f);return p}function m(s,p){let f=!1;for(let w of s){if(p&&a(w).then(m),!t.has(w))continue;let P=t.get(w);P.length_c&&(w.dispatchEvent(new Event(C)),P.connected=new WeakSet,P.length_c=0,P.length_d||t.delete(w),f=!0)}return f}function h(s,p){let f=!1;for(let w of s)p&&a(w).then(h),!(!t.has(w)||!t.get(w).length_d)&&((globalThis.queueMicrotask||setTimeout)(v(w)),f=!0);return f}function v(s){return()=>{s.isConnected||(s.dispatchEvent(new Event(R)),t.delete(s))}}}function Ht(t,e,n){return typeof e=="function"&&(n=e,e=null),e||(e={}),function(o,...c){n&&(c.unshift(o),o=typeof n=="function"?n():n);let i=c.length?new CustomEvent(t,b({detail:c[0]},e)):new Event(t,e);return o.dispatchEvent(i)}}function y(t,e,n){return function(o){return o.addEventListener(t,e,n),o}}y.defer=t=>setTimeout.bind(null,t,0);var ct=t=>b({},typeof t=="object"?t:null,{once:!0});y.connected=function(t,e){return e=ct(e),function(r){return r.addEventListener(C,t,e),r[M]?r:r.isConnected?(r.dispatchEvent(new Event(C)),r):(Z(e.signal,()=>D.offConnected(r,t))&&D.onConnected(r,t),r)}};y.disconnected=function(t,e){return e=ct(e),function(r){return r.addEventListener(R,t,e),r[M]||Z(e.signal,()=>D.offDisconnected(r,t))&&D.onDisconnected(r,t),r}};var O=[{get scope(){return d.D.body},host:t=>t?t(d.D.body):d.D.body,prevent:!0}],G=new WeakMap,x={get current(){return O[O.length-1]},get host(){return this.current.host},get signal(){let{host:t}=this;if(G.has(t))return G.get(t);let e=new AbortController;return G.set(t,e),t(y.disconnected(()=>e.abort())),e.signal},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...O]},push(t={}){return O.push(b({},this.current,{prevent:!1},t))},pushRoot(){return O.push(O[0])},pop(){if(O.length!==1)return O.pop()}};var k={isSignal(t){return!1},processReactiveAttribute(t,e,n,r){return n}};function V(t,e=!0){return e?b(k,t):(Object.setPrototypeOf(t,k),t)}function I(t){return rt(t,k)&&t!==k?t:k}function it(t,e,n,r){return t[(A(r)?"remove":"set")+e](n,r)}function st(t,e,n,r,o=null){return t[(A(r)?"remove":"set")+e+"NS"](o,n,r)}function K(t,e,n){if(Reflect.set(t,e,n),!!A(n))return Reflect.deleteProperty(t,e)}function ut(t,e,n,r){return _(t,d.H)?t[e+"Attribute"](n,r):t[e+"AttributeNS"](null,n,r)}function ce(t){return d.q(t)}function ft(...t){return this.appendOriginal(...t),this}function Ct(t){return t.append===ft||(t.appendOriginal=t.append,t.append=ft),t}var $;function q(t,e,...n){let r=I(this),o=0,c,i,u=typeof e;switch((u==="string"||u==="number"||r.isSignal(e))&&(e={textContent:e}),!0){case typeof t=="function":{o=1;let a=(...v)=>v.length?(o===1?n.unshift(...v):v.forEach(s=>s(i)),void 0):i;x.push({scope:t,host:a}),c=t(e||void 0);let m=_(c,d.F);if(c.nodeName==="#comment")break;let h=q.mark({type:"component",name:t.name,host:m?"this":"parentElement"});c.prepend(h),m&&(i=h);break}case t==="#text":c=U.call(this,d.D.createTextNode(""),e);break;case(t==="<>"||!t):c=U.call(this,d.D.createDocumentFragment(),e);break;case!!$:c=U.call(this,d.D.createElementNS($,t),e);break;case!c:c=U.call(this,d.D.createElement(t),e)}return Ct(c),i||(i=c),n.forEach(a=>a(i)),o&&x.pop(),o=2,c}q.mark=function(t,e=!1){t=Object.entries(t).map(([o,c])=>o+`="${c}"`).join(" ");let n=e?"":"/",r=d.D.createComment(``);return e&&(r.end=d.D.createComment("")),r};function se(t){let e=this;return function(...r){$=t;let o=q.call(e,...r);return $=void 0,o}}var z=new WeakMap,{setDeleteAttr:at}=d;function U(t,...e){if(!e.length)return t;z.set(t,dt(t,this));for(let[n,r]of Object.entries(b({},...e)))pt.call(this,t,n,r);return z.delete(t),t}function pt(t,e,n){let{setRemoveAttr:r,s:o}=dt(t,this),c=this;n=o.processReactiveAttribute(t,e,n,(u,a)=>pt.call(c,t,u,a));let[i]=e;if(i==="=")return r(e.slice(1),n);if(i===".")return K(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return r(e,n,"http://www.w3.org/1999/xlink");case"textContent":return at(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return Q(o,e,t,n,K.bind(null,t[e]));case"ariaset":return Q(o,e,t,n,(u,a)=>r("aria-"+u,a));case"classList":return Ot.call(c,t,n)}return Rt(t,e)?at(t,e,n):r(e,n)}function dt(t,e){if(z.has(t))return z.get(t);let r=(_(t,d.S)?st:it).bind(null,t,"Attribute"),o=I(e);return{setRemoveAttr:r,s:o}}function Ot(t,e){let n=I(this);return Q(n,"classList",t,e,(r,o)=>t.classList.toggle(r,o===-1?void 0:!!o)),t}function Rt(t,e){if(!(e in t))return!1;let n=lt(t,e);return!A(n.set)}function lt(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||lt(t,e)}function Q(t,e,n,r,o){let c=String;if(!(typeof r!="object"||r===null))return Object.entries(r).forEach(function([u,a]){u&&(u=new c(u),u.target=e,a=t.processReactiveAttribute(n,u,a,o),o(u,a))})}function me(t,e=t){let n="\xB9\u2070",r="\u2713",o=Object.fromEntries(Array.from(e.querySelectorAll("slot")).filter(c=>!c.name.endsWith(n)).map(c=>[c.name+=n,c]));if(t.append=new Proxy(t.append,{apply(c,i,u){if(u[0]===e)return c.apply(t,u);for(let a of u){let m=(a.slot||"")+n;try{ut(a,"remove","slot")}catch{}let h=o[m];if(!h)return;h.name.startsWith(r)||(h.childNodes.forEach(v=>v.remove()),h.name=r+m),h.append(a)}return t.append=c,t}}),t!==e){let c=Array.from(t.childNodes);t.append(...c)}return e}function ge(t,e,n={}){let r=t.host||t;x.push({scope:r,host:(...i)=>i.length?i.forEach(u=>u(r)):r}),typeof n=="function"&&(n=n.call(r,r));let o=r[M];o||Dt(r);let c=e.call(r,n);return o||r.dispatchEvent(new Event(C)),t.nodeType===11&&typeof t.mode=="string"&&r.addEventListener(R,D.observe(t),{once:!0}),x.pop(),t.append(c)}function Dt(t){return X(t.prototype,"connectedCallback",function(e,n,r){e.apply(n,r),n.dispatchEvent(new Event(C))}),X(t.prototype,"disconnectedCallback",function(e,n,r){e.apply(n,r),(globalThis.queueMicrotask||setTimeout)(()=>!n.isConnected&&n.dispatchEvent(new Event(R)))}),X(t.prototype,"attributeChangedCallback",function(e,n,r){let[o,,c]=r;n.dispatchEvent(new CustomEvent(F,{detail:[o,c]})),e.apply(n,r)}),t.prototype[M]=!0,t}function X(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}var ht="__dde_memo",H=[];function T(t,e){if(!H.length)return e(t);let n=typeof t=="object"?JSON.stringify(t):t,[{cache:r,after:o}]=H;return o(n,W(r,n)?r[n]:e(t))}T.isScope=function(t){return t[ht]};T.scope=function(e,{signal:n,onlyLast:r}={}){let o=S();function c(...i){if(n&&n.aborted)return e.apply(this,i);let u=r?o:S();H.unshift({cache:o,after(m,h){return u[m]=h}});let a=e.apply(this,i);return H.shift(),o=u,a}return c[ht]=!0,c.clear=()=>o=S(),n&&n.addEventListener("abort",c.clear),c};var l="__dde_signal",Y=(()=>{let t=new Map,e=!1;function n(){e=!1;let r=t;t=new Map;for(let[o,c]of r){let i=o[l];i&&i.listeners.forEach(u=>u(i.value,c))}}return function(r,o=!1){t.set(r,t.get(r)||o),!e&&(e=!0,queueMicrotask(n))}})();var vt=S(null,{get:{value(){return gt(this)}},toJSON:{value(){return gt(this)}},valueOf:{value(){return this[l]&&this[l].value}}}),bt=S(vt,{set:{value(...t){return St(this,...t)}}});function J(t){return t&&t[l]}var B=[],E=new WeakMap;function g(t,e){if(typeof t!="function")return mt(!1,t,e);if(J(t))return t;let n=mt(!0);function r(o,c){let[i,...u]=E.get(r);if(E.set(r,new Set([i])),B.push(r),St(n,t(),c),B.pop(),!u.length)return;let a=E.get(r);for(let m of u)a.has(m)||N(m,r)}return E.set(n[l],r),E.set(r,new Set([n])),r(),n}g.action=function(t,e,...n){let r=t[l];if(!r)return;let{actions:o}=r;if(!o||!W(o,e))throw new Error(`Action "${e}" not defined. See ${l}.actions.`);if(o[e].apply(r,n),r.skip)return delete r.skip;Y(t,!0)};g.on=function t(e,n,r={}){let{signal:o}=r;if(!(o&&o.aborted)){if(Array.isArray(e))return e.forEach(c=>t(c,n,r));et(e,n),o&&o.addEventListener("abort",()=>N(e,n))}};g.symbols={onclear:Symbol.for("Signal.onclear")};g.clear=function(...t){for(let n of t){let r=n[l];r&&(delete n.toJSON,r.onclear.forEach(o=>o.call(r)),e(n,r),delete n[l])}function e(n,r){r.listeners.forEach(o=>{if(r.listeners.delete(o),!E.has(o))return;let c=E.get(o);c.delete(n),!(c.size>1)&&(n.clear(...c),E.delete(o))})}};var L="__dde_reactive";g.el=function(t,e){let n=T.isScope(e)?e:T.scope(e,{onlyLast:!0}),{current:r}=x,{scope:o}=r,c=q.mark({type:"reactive",component:o&&o.name||""},!0),i=c.end,u=d.D.createDocumentFragment();u.append(c,i);let a=m=>{if(!c.parentNode||!i.parentNode)return N(t,a);x.push(r);let h=n(m);x.pop(),Array.isArray(h)||(h=[h]);let v=document.createComment("");h.push(v),c.after(...h);let s;for(;(s=v.nextSibling)&&s!==i;)s.remove();v.remove(),c.isConnected&&Lt(r.host())};return et(t,a),Et(t,a,c,e),a(t.get()),r.host(y.disconnected(()=>n.clear())),u};function Lt(t){!t||!t[L]||j().then(function(){t[L]=t[L].filter(([e,n])=>n.isConnected?!0:(N(...e),!1))})}var Nt={_set(t){this.value=t}};function Mt(t){return function(e,n){let r=S(bt,{set:{value(...c){return e.setAttribute(n,...c)}}}),o=_t(r,e.getAttribute(n),Nt);return t[n]=o,o}}var tt="__dde_attributes";g.observedAttributes=function(t){let e=t[tt]={},n=ot(t,Mt(e));return y(F,function({detail:o}){/*! This maps attributes to signals (`S.observedAttributes`).
Investigate `__dde_attributes` key of the element. */let[c,i]=o,u=this[tt][c];if(u)return g.action(u,"_set",i)})(t),y.disconnected(function(){/*! This removes all signals mapped to attributes (`S.observedAttributes`).
- Investigate `__dde_attributes` key of the element. */g.clear(...Object.values(this[tt]))})(t),n};var bt={isSignal:J,processReactiveAttribute(t,e,n,r){if(!J(n))return n;let o=c=>{if(!t.isConnected)return N(n,o);r(e,c)};return nt(n,o),xt(n,o,t,e),n.get()}};function xt(t,e,...n){let{current:r}=x;r.host(function(o){o[L]||(o[L]=[]),o[L].push([[t,e],...n]),!r.prevent&&y.disconnected(()=>o[L].forEach(([[c,i]])=>N(c,i,c[l]&&c[l].host&&c[l].host()===o)))(o)})}var Tt=new FinalizationRegistry(function(t){g.clear({[l]:t})});function gt(t,e,n){let r=S(t?Dt:et),o=Et(r,e,n,t);return Tt.register(o,o[l]),o}var Pt=b(S(),{stopPropagation(){this.skip=!0}});function Et(t,e,n,r=!1){let o=[];rt(n)!=="[object Object]"&&(n={});let{onclear:c}=g.symbols;n[c]&&(o.push(n[c]),delete n[c]);let{host:i}=x;return Reflect.defineProperty(t,l,{value:b(S(Pt),{value:e,actions:n,onclear:o,host:i,listeners:new Set,readonly:r}),enumerable:!1,writable:!1,configurable:!0}),t}function kt(){return B[B.length-1]}function vt(t){if(!t[l])return;let{value:e,listeners:n}=t[l],r=kt();return r&&n.add(r),E.has(r)&&E.get(r).add(t),e}function _t(t,e,n){let r=t[l];if(!(!r||!n&&r.value===e))return r.value=e,Y(t,n),e}function nt(t,e){if(t[l])return t[l].listeners.add(e)}function N(t,e,n){let r=t[l];if(!r)return;let{listeners:o}=r,c=o.delete(e);if(!c||!n||o.size)return c;g.clear(t);let i=E.get(r);if(!i)return c;let u=E.get(i);if(!u)return c;for(let a of u)N(a,i,!0);return c}V(bt);export{g as S,U as assign,dt as assignAttribute,At as chainableAppend,Ct as classListDeclarative,q as createElement,se as createElementNS,ge as customElementRender,Rt as customElementWithDDE,Ht as dispatchEvent,q as el,se as elNS,J as isSignal,Rt as lifecyclesToEvents,T as memo,y as on,ce as queue,V as registerReactivity,x as scope,g as signal,me as simulateSlots};
+ Investigate `__dde_attributes` key of the element. */g.clear(...Object.values(this[tt]))})(t),n};var xt={isSignal:J,processReactiveAttribute(t,e,n,r){if(!J(n))return n;let o=c=>{if(!t.isConnected)return N(n,o);r(e,c)};return et(n,o),Et(n,o,t,e),n.get()}};function Et(t,e,...n){let{current:r}=x;r.host(function(o){o[L]||(o[L]=[]),o[L].push([[t,e],...n]),!r.prevent&&y.disconnected(()=>o[L].forEach(([[c,i]])=>N(c,i,c[l]&&c[l].host&&c[l].host()===o)))(o)})}var Tt=new FinalizationRegistry(function(t){g.clear({[l]:t})});function mt(t,e,n){let r=S(t?vt:bt),o=_t(r,e,n);return Tt.register(o,o[l]),o}var Pt=b(S(),{stopPropagation(){this.skip=!0}});function _t(t,e,n){let r=[];nt(n)!=="[object Object]"&&(n={});let{onclear:o}=g.symbols;n[o]&&(r.push(n[o]),delete n[o]);let{host:c}=x;return Reflect.defineProperty(t,l,{value:b(S(Pt),{value:e,actions:n,onclear:r,host:c,listeners:new Set}),enumerable:!1,writable:!1,configurable:!0}),t}function kt(){return B[B.length-1]}function gt(t){if(!t[l])return;let{value:e,listeners:n}=t[l],r=kt();return r&&n.add(r),E.has(r)&&E.get(r).add(t),e}function St(t,e,n){let r=t[l];if(!(!r||!n&&r.value===e))return r.value=e,Y(t,n),e}function et(t,e){if(t[l])return t[l].listeners.add(e)}function N(t,e,n){let r=t[l];if(!r)return;let{listeners:o}=r,c=o.delete(e);if(!c||!n||o.size)return c;g.clear(t);let i=E.get(r);if(!i)return c;let u=E.get(i);if(!u)return c;for(let a of u)N(a,i,!0);return c}V(xt);export{g as S,U as assign,pt as assignAttribute,Ct as chainableAppend,Ot as classListDeclarative,q as createElement,se as createElementNS,ge as customElementRender,Dt as customElementWithDDE,Ht as dispatchEvent,q as el,se as elNS,J as isSignal,Dt as lifecyclesToEvents,T as memo,y as on,ce as queue,V as registerReactivity,x as scope,g as signal,me as simulateSlots};
diff --git a/dist/iife-with-signals.js b/dist/iife-with-signals.js
index 8649444..ab26b28 100644
--- a/dist/iife-with-signals.js
+++ b/dist/iife-with-signals.js
@@ -741,13 +741,10 @@ var DDE = (() => {
})();
// src/signals-lib/signals-lib.js
- var Signal = oCreate(null, {
+ var SignalReadOnly = oCreate(null, {
get: { value() {
return read(this);
} },
- set: { value(...v) {
- return write(this, ...v);
- } },
toJSON: { value() {
return read(this);
} },
@@ -755,9 +752,9 @@ var DDE = (() => {
return this[mark] && this[mark].value;
} }
});
- var SignalReadOnly = oCreate(Signal, {
- set: { value() {
- return;
+ var Signal = oCreate(SignalReadOnly, {
+ set: { value(...v) {
+ return write(this, ...v);
} }
});
function isSignal(candidate) {
@@ -951,7 +948,7 @@ var DDE = (() => {
});
function create(is_readonly, value, actions) {
const varS = oCreate(is_readonly ? SignalReadOnly : Signal);
- const SI = toSignal(varS, value, actions, is_readonly);
+ const SI = toSignal(varS, value, actions);
cleanUpRegistry.register(SI, SI[mark]);
return SI;
}
@@ -963,7 +960,7 @@ var DDE = (() => {
this.skip = true;
}
});
- function toSignal(s, value, actions, readonly = false) {
+ function toSignal(s, value, actions) {
const onclear = [];
if (typeOf(actions) !== "[object Object]")
actions = {};
@@ -979,8 +976,7 @@ var DDE = (() => {
actions,
onclear,
host,
- listeners: /* @__PURE__ */ new Set(),
- readonly
+ listeners: /* @__PURE__ */ new Set()
}),
enumerable: false,
writable: false,
diff --git a/dist/iife-with-signals.min.js b/dist/iife-with-signals.min.js
index 7390cad..5c4bd12 100644
--- a/dist/iife-with-signals.min.js
+++ b/dist/iife-with-signals.min.js
@@ -1,3 +1,3 @@
-var DDE=(()=>{var G=Object.defineProperty;var Ct=Object.getOwnPropertyDescriptor;var Ot=Object.getOwnPropertyNames;var Rt=Object.prototype.hasOwnProperty;var Dt=(t,e)=>{for(var n in e)G(t,n,{get:e[n],enumerable:!0})},Lt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ot(e))!Rt.call(t,o)&&o!==n&&G(t,o,{get:()=>e[o],enumerable:!(r=Ct(e,o))||r.enumerable});return t};var Nt=t=>Lt(G({},"__esModule",{value:!0}),t);var Gt={};Dt(Gt,{S:()=>g,assign:()=>W,assignAttribute:()=>Y,chainableAppend:()=>ht,classListDeclarative:()=>gt,createElement:()=>P,createElementNS:()=>Wt,customElementRender:()=>It,customElementWithDDE:()=>bt,dispatchEvent:()=>kt,el:()=>P,elNS:()=>Wt,isSignal:()=>j,lifecyclesToEvents:()=>bt,memo:()=>L,on:()=>w,queue:()=>qt,registerReactivity:()=>$,scope:()=>v,signal:()=>g,simulateSlots:()=>Ft});var F=(...t)=>Object.prototype.hasOwnProperty.call(...t);function A(t){return typeof t>"u"}function ct(t){let e=typeof t;return e!=="object"?e:t===null?"null":Object.prototype.toString.call(t)}function _(t,e){return t instanceof e}function it(t,e){return Object.prototype.isPrototypeOf.call(e,t)}function S(t=null,e={}){return Object.create(t,e)}function x(...t){return Object.assign(...t)}function V(t,e){if(!t||!_(t,AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function st(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(r,o){return r[Mt(o)]=e(t,o),r},{})}function Mt(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function I(){return new Promise(function(t){(globalThis.requestIdleCallback||requestAnimationFrame)(t)})}var d={setDeleteAttr:Tt,ssr:"",D:globalThis.document,N:globalThis.Node,F:globalThis.DocumentFragment,H:globalThis.HTMLElement,S:globalThis.SVGElement,M:globalThis.MutationObserver,q:t=>t||Promise.resolve()};function Tt(t,e,n){if(Reflect.set(t,e,n),!!A(n)){if(Reflect.deleteProperty(t,e),_(t,d.H)&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var T="__dde_lifecyclesToEvents",C="dde:connected",R="dde:disconnected",U="dde:attributeChanged";var D=d.M?Pt():new Proxy({},{get(){return()=>{}}});function Pt(){let t=new Map,e=!1,n=s=>function(p){for(let f of p)if(f.type==="childList"){if(m(f.addedNodes,!0)){s();continue}h(f.removedNodes,!0)&&s()}},r=new d.M(n(u));return{observe(s){let p=new d.M(n(()=>{}));return p.observe(s,{childList:!0,subtree:!0}),()=>p.disconnect()},onConnected(s,p){i();let f=c(s);f.connected.has(p)||(f.connected.add(p),f.length_c+=1)},offConnected(s,p){if(!t.has(s))return;let f=t.get(s);f.connected.has(p)&&(f.connected.delete(p),f.length_c-=1,o(s,f))},onDisconnected(s,p){i();let f=c(s);f.disconnected.has(p)||(f.disconnected.add(p),f.length_d+=1)},offDisconnected(s,p){if(!t.has(s))return;let f=t.get(s);f.disconnected.delete(p),f.length_d-=1,o(s,f)}};function o(s,p){p.length_c||p.length_d||(t.delete(s),u())}function c(s){if(t.has(s))return t.get(s);let p={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(s,p),p}function i(){e||(e=!0,r.observe(d.D.body,{childList:!0,subtree:!0}))}function u(){!e||t.size||(e=!1,r.disconnect())}async function a(s){t.size>30&&await I();let p=[];if(!_(s,d.N))return p;for(let f of t.keys())f===s||!_(f,d.N)||s.contains(f)&&p.push(f);return p}function m(s,p){let f=!1;for(let y of s){if(p&&a(y).then(m),!t.has(y))continue;let k=t.get(y);k.length_c&&(y.dispatchEvent(new Event(C)),k.connected=new WeakSet,k.length_c=0,k.length_d||t.delete(y),f=!0)}return f}function h(s,p){let f=!1;for(let y of s)p&&a(y).then(h),!(!t.has(y)||!t.get(y).length_d)&&((globalThis.queueMicrotask||setTimeout)(b(y)),f=!0);return f}function b(s){return()=>{s.isConnected||(s.dispatchEvent(new Event(R)),t.delete(s))}}}function kt(t,e,n){return typeof e=="function"&&(n=e,e=null),e||(e={}),function(o,...c){n&&(c.unshift(o),o=typeof n=="function"?n():n);let i=c.length?new CustomEvent(t,x({detail:c[0]},e)):new Event(t,e);return o.dispatchEvent(i)}}function w(t,e,n){return function(o){return o.addEventListener(t,e,n),o}}w.defer=t=>setTimeout.bind(null,t,0);var ut=t=>x({},typeof t=="object"?t:null,{once:!0});w.connected=function(t,e){return e=ut(e),function(r){return r.addEventListener(C,t,e),r[T]?r:r.isConnected?(r.dispatchEvent(new Event(C)),r):(V(e.signal,()=>D.offConnected(r,t))&&D.onConnected(r,t),r)}};w.disconnected=function(t,e){return e=ut(e),function(r){return r.addEventListener(R,t,e),r[T]||V(e.signal,()=>D.offDisconnected(r,t))&&D.onDisconnected(r,t),r}};var O=[{get scope(){return d.D.body},host:t=>t?t(d.D.body):d.D.body,prevent:!0}],K=new WeakMap,v={get current(){return O[O.length-1]},get host(){return this.current.host},get signal(){let{host:t}=this;if(K.has(t))return K.get(t);let e=new AbortController;return K.set(t,e),t(w.disconnected(()=>e.abort())),e.signal},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...O]},push(t={}){return O.push(x({},this.current,{prevent:!1},t))},pushRoot(){return O.push(O[0])},pop(){if(O.length!==1)return O.pop()}};var q={isSignal(t){return!1},processReactiveAttribute(t,e,n,r){return n}};function $(t,e=!0){return e?x(q,t):(Object.setPrototypeOf(t,q),t)}function z(t){return it(t,q)&&t!==q?t:q}function ft(t,e,n,r){return t[(A(r)?"remove":"set")+e](n,r)}function at(t,e,n,r,o=null){return t[(A(r)?"remove":"set")+e+"NS"](o,n,r)}function Q(t,e,n){if(Reflect.set(t,e,n),!!A(n))return Reflect.deleteProperty(t,e)}function pt(t,e,n,r){return _(t,d.H)?t[e+"Attribute"](n,r):t[e+"AttributeNS"](null,n,r)}function qt(t){return d.q(t)}function dt(...t){return this.appendOriginal(...t),this}function ht(t){return t.append===dt||(t.appendOriginal=t.append,t.append=dt),t}var H;function P(t,e,...n){let r=z(this),o=0,c,i,u=typeof e;switch((u==="string"||u==="number"||r.isSignal(e))&&(e={textContent:e}),!0){case typeof t=="function":{o=1;let a=(...b)=>b.length?(o===1?n.unshift(...b):b.forEach(s=>s(i)),void 0):i;v.push({scope:t,host:a}),c=t(e||void 0);let m=_(c,d.F);if(c.nodeName==="#comment")break;let h=P.mark({type:"component",name:t.name,host:m?"this":"parentElement"});c.prepend(h),m&&(i=h);break}case t==="#text":c=W.call(this,d.D.createTextNode(""),e);break;case(t==="<>"||!t):c=W.call(this,d.D.createDocumentFragment(),e);break;case!!H:c=W.call(this,d.D.createElementNS(H,t),e);break;case!c:c=W.call(this,d.D.createElement(t),e)}return ht(c),i||(i=c),n.forEach(a=>a(i)),o&&v.pop(),o=2,c}P.mark=function(t,e=!1){t=Object.entries(t).map(([o,c])=>o+`="${c}"`).join(" ");let n=e?"":"/",r=d.D.createComment(``);return e&&(r.end=d.D.createComment("")),r};function Wt(t){let e=this;return function(...r){H=t;let o=P.call(e,...r);return H=void 0,o}}var J=new WeakMap,{setDeleteAttr:lt}=d;function W(t,...e){if(!e.length)return t;J.set(t,mt(t,this));for(let[n,r]of Object.entries(x({},...e)))Y.call(this,t,n,r);return J.delete(t),t}function Y(t,e,n){let{setRemoveAttr:r,s:o}=mt(t,this),c=this;n=o.processReactiveAttribute(t,e,n,(u,a)=>Y.call(c,t,u,a));let[i]=e;if(i==="=")return r(e.slice(1),n);if(i===".")return Q(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return r(e,n,"http://www.w3.org/1999/xlink");case"textContent":return lt(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return X(o,e,t,n,Q.bind(null,t[e]));case"ariaset":return X(o,e,t,n,(u,a)=>r("aria-"+u,a));case"classList":return gt.call(c,t,n)}return jt(t,e)?lt(t,e,n):r(e,n)}function mt(t,e){if(J.has(t))return J.get(t);let r=(_(t,d.S)?at:ft).bind(null,t,"Attribute"),o=z(e);return{setRemoveAttr:r,s:o}}function gt(t,e){let n=z(this);return X(n,"classList",t,e,(r,o)=>t.classList.toggle(r,o===-1?void 0:!!o)),t}function jt(t,e){if(!(e in t))return!1;let n=vt(t,e);return!A(n.set)}function vt(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||vt(t,e)}function X(t,e,n,r,o){let c=String;if(!(typeof r!="object"||r===null))return Object.entries(r).forEach(function([u,a]){u&&(u=new c(u),u.target=e,a=t.processReactiveAttribute(n,u,a,o),o(u,a))})}function Ft(t,e=t){let n="\xB9\u2070",r="\u2713",o=Object.fromEntries(Array.from(e.querySelectorAll("slot")).filter(c=>!c.name.endsWith(n)).map(c=>[c.name+=n,c]));if(t.append=new Proxy(t.append,{apply(c,i,u){if(u[0]===e)return c.apply(t,u);for(let a of u){let m=(a.slot||"")+n;try{pt(a,"remove","slot")}catch{}let h=o[m];if(!h)return;h.name.startsWith(r)||(h.childNodes.forEach(b=>b.remove()),h.name=r+m),h.append(a)}return t.append=c,t}}),t!==e){let c=Array.from(t.childNodes);t.append(...c)}return e}function It(t,e,n={}){let r=t.host||t;v.push({scope:r,host:(...i)=>i.length?i.forEach(u=>u(r)):r}),typeof n=="function"&&(n=n.call(r,r));let o=r[T];o||bt(r);let c=e.call(r,n);return o||r.dispatchEvent(new Event(C)),t.nodeType===11&&typeof t.mode=="string"&&r.addEventListener(R,D.observe(t),{once:!0}),v.pop(),t.append(c)}function bt(t){return tt(t.prototype,"connectedCallback",function(e,n,r){e.apply(n,r),n.dispatchEvent(new Event(C))}),tt(t.prototype,"disconnectedCallback",function(e,n,r){e.apply(n,r),(globalThis.queueMicrotask||setTimeout)(()=>!n.isConnected&&n.dispatchEvent(new Event(R)))}),tt(t.prototype,"attributeChangedCallback",function(e,n,r){let[o,,c]=r;n.dispatchEvent(new CustomEvent(U,{detail:[o,c]})),e.apply(n,r)}),t.prototype[T]=!0,t}function tt(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}var xt="__dde_memo",B=[];function L(t,e){if(!B.length)return e(t);let n=typeof t=="object"?JSON.stringify(t):t,[{cache:r,after:o}]=B;return o(n,F(r,n)?r[n]:e(t))}L.isScope=function(t){return t[xt]};L.scope=function(e,{signal:n,onlyLast:r}={}){let o=S();function c(...i){if(n&&n.aborted)return e.apply(this,i);let u=r?o:S();B.unshift({cache:o,after(m,h){return u[m]=h}});let a=e.apply(this,i);return B.shift(),o=u,a}return c[xt]=!0,c.clear=()=>o=S(),n&&n.addEventListener("abort",c.clear),c};var l="__dde_signal",et=(()=>{let t=new Map,e=!1;function n(){e=!1;let r=t;t=new Map;for(let[o,c]of r){let i=o[l];i&&i.listeners.forEach(u=>u(i.value,c))}}return function(r,o=!1){t.set(r,t.get(r)||o),!e&&(e=!0,queueMicrotask(n))}})();var rt=S(null,{get:{value(){return _t(this)}},set:{value(...t){return At(this,...t)}},toJSON:{value(){return _t(this)}},valueOf:{value(){return this[l]&&this[l].value}}}),Ut=S(rt,{set:{value(){}}});function j(t){return t&&t[l]}var Z=[],E=new WeakMap;function g(t,e){if(typeof t!="function")return Et(!1,t,e);if(j(t))return t;let n=Et(!0);function r(o,c){let[i,...u]=E.get(r);if(E.set(r,new Set([i])),Z.push(r),At(n,t(),c),Z.pop(),!u.length)return;let a=E.get(r);for(let m of u)a.has(m)||M(m,r)}return E.set(n[l],r),E.set(r,new Set([n])),r(),n}g.action=function(t,e,...n){let r=t[l];if(!r)return;let{actions:o}=r;if(!o||!F(o,e))throw new Error(`Action "${e}" not defined. See ${l}.actions.`);if(o[e].apply(r,n),r.skip)return delete r.skip;et(t,!0)};g.on=function t(e,n,r={}){let{signal:o}=r;if(!(o&&o.aborted)){if(Array.isArray(e))return e.forEach(c=>t(c,n,r));ot(e,n),o&&o.addEventListener("abort",()=>M(e,n))}};g.symbols={onclear:Symbol.for("Signal.onclear")};g.clear=function(...t){for(let n of t){let r=n[l];r&&(delete n.toJSON,r.onclear.forEach(o=>o.call(r)),e(n,r),delete n[l])}function e(n,r){r.listeners.forEach(o=>{if(r.listeners.delete(o),!E.has(o))return;let c=E.get(o);c.delete(n),!(c.size>1)&&(n.clear(...c),E.delete(o))})}};var N="__dde_reactive";g.el=function(t,e){let n=L.isScope(e)?e:L.scope(e,{onlyLast:!0}),{current:r}=v,{scope:o}=r,c=P.mark({type:"reactive",component:o&&o.name||""},!0),i=c.end,u=d.D.createDocumentFragment();u.append(c,i);let a=m=>{if(!c.parentNode||!i.parentNode)return M(t,a);v.push(r);let h=n(m);v.pop(),Array.isArray(h)||(h=[h]);let b=document.createComment("");h.push(b),c.after(...h);let s;for(;(s=b.nextSibling)&&s!==i;)s.remove();b.remove(),c.isConnected&&$t(r.host())};return ot(t,a),wt(t,a,c,e),a(t.get()),r.host(w.disconnected(()=>n.clear())),u};function $t(t){!t||!t[N]||I().then(function(){t[N]=t[N].filter(([e,n])=>n.isConnected?!0:(M(...e),!1))})}var zt={_set(t){this.value=t}};function Ht(t){return function(e,n){let r=S(rt,{set:{value(...c){return e.setAttribute(n,...c)}}}),o=yt(r,e.getAttribute(n),zt);return t[n]=o,o}}var nt="__dde_attributes";g.observedAttributes=function(t){let e=t[nt]={},n=st(t,Ht(e));return w(U,function({detail:o}){/*! This maps attributes to signals (`S.observedAttributes`).
+var DDE=(()=>{var G=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var Dt=Object.prototype.hasOwnProperty;var Lt=(t,e)=>{for(var n in e)G(t,n,{get:e[n],enumerable:!0})},Nt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Rt(e))!Dt.call(t,o)&&o!==n&&G(t,o,{get:()=>e[o],enumerable:!(r=Ot(e,o))||r.enumerable});return t};var Mt=t=>Nt(G({},"__esModule",{value:!0}),t);var Gt={};Lt(Gt,{S:()=>g,assign:()=>W,assignAttribute:()=>Y,chainableAppend:()=>lt,classListDeclarative:()=>mt,createElement:()=>P,createElementNS:()=>jt,customElementRender:()=>Ut,customElementWithDDE:()=>vt,dispatchEvent:()=>qt,el:()=>P,elNS:()=>jt,isSignal:()=>j,lifecyclesToEvents:()=>vt,memo:()=>L,on:()=>w,queue:()=>Wt,registerReactivity:()=>$,scope:()=>v,signal:()=>g,simulateSlots:()=>It});var F=(...t)=>Object.prototype.hasOwnProperty.call(...t);function A(t){return typeof t>"u"}function ot(t){let e=typeof t;return e!=="object"?e:t===null?"null":Object.prototype.toString.call(t)}function _(t,e){return t instanceof e}function ct(t,e){return Object.prototype.isPrototypeOf.call(e,t)}function S(t=null,e={}){return Object.create(t,e)}function x(...t){return Object.assign(...t)}function V(t,e){if(!t||!_(t,AbortSignal))return!0;if(!t.aborted)return t.addEventListener("abort",e),function(){t.removeEventListener("abort",e)}}function it(t,e){let{observedAttributes:n=[]}=t.constructor;return n.reduce(function(r,o){return r[Tt(o)]=e(t,o),r},{})}function Tt(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function I(){return new Promise(function(t){(globalThis.requestIdleCallback||requestAnimationFrame)(t)})}var d={setDeleteAttr:Pt,ssr:"",D:globalThis.document,N:globalThis.Node,F:globalThis.DocumentFragment,H:globalThis.HTMLElement,S:globalThis.SVGElement,M:globalThis.MutationObserver,q:t=>t||Promise.resolve()};function Pt(t,e,n){if(Reflect.set(t,e,n),!!A(n)){if(Reflect.deleteProperty(t,e),_(t,d.H)&&t.getAttribute(e)==="undefined")return t.removeAttribute(e);if(Reflect.get(t,e)==="undefined")return Reflect.set(t,e,"")}}var T="__dde_lifecyclesToEvents",C="dde:connected",R="dde:disconnected",U="dde:attributeChanged";var D=d.M?kt():new Proxy({},{get(){return()=>{}}});function kt(){let t=new Map,e=!1,n=s=>function(p){for(let f of p)if(f.type==="childList"){if(m(f.addedNodes,!0)){s();continue}h(f.removedNodes,!0)&&s()}},r=new d.M(n(u));return{observe(s){let p=new d.M(n(()=>{}));return p.observe(s,{childList:!0,subtree:!0}),()=>p.disconnect()},onConnected(s,p){i();let f=c(s);f.connected.has(p)||(f.connected.add(p),f.length_c+=1)},offConnected(s,p){if(!t.has(s))return;let f=t.get(s);f.connected.has(p)&&(f.connected.delete(p),f.length_c-=1,o(s,f))},onDisconnected(s,p){i();let f=c(s);f.disconnected.has(p)||(f.disconnected.add(p),f.length_d+=1)},offDisconnected(s,p){if(!t.has(s))return;let f=t.get(s);f.disconnected.delete(p),f.length_d-=1,o(s,f)}};function o(s,p){p.length_c||p.length_d||(t.delete(s),u())}function c(s){if(t.has(s))return t.get(s);let p={connected:new WeakSet,length_c:0,disconnected:new WeakSet,length_d:0};return t.set(s,p),p}function i(){e||(e=!0,r.observe(d.D.body,{childList:!0,subtree:!0}))}function u(){!e||t.size||(e=!1,r.disconnect())}async function a(s){t.size>30&&await I();let p=[];if(!_(s,d.N))return p;for(let f of t.keys())f===s||!_(f,d.N)||s.contains(f)&&p.push(f);return p}function m(s,p){let f=!1;for(let y of s){if(p&&a(y).then(m),!t.has(y))continue;let k=t.get(y);k.length_c&&(y.dispatchEvent(new Event(C)),k.connected=new WeakSet,k.length_c=0,k.length_d||t.delete(y),f=!0)}return f}function h(s,p){let f=!1;for(let y of s)p&&a(y).then(h),!(!t.has(y)||!t.get(y).length_d)&&((globalThis.queueMicrotask||setTimeout)(b(y)),f=!0);return f}function b(s){return()=>{s.isConnected||(s.dispatchEvent(new Event(R)),t.delete(s))}}}function qt(t,e,n){return typeof e=="function"&&(n=e,e=null),e||(e={}),function(o,...c){n&&(c.unshift(o),o=typeof n=="function"?n():n);let i=c.length?new CustomEvent(t,x({detail:c[0]},e)):new Event(t,e);return o.dispatchEvent(i)}}function w(t,e,n){return function(o){return o.addEventListener(t,e,n),o}}w.defer=t=>setTimeout.bind(null,t,0);var st=t=>x({},typeof t=="object"?t:null,{once:!0});w.connected=function(t,e){return e=st(e),function(r){return r.addEventListener(C,t,e),r[T]?r:r.isConnected?(r.dispatchEvent(new Event(C)),r):(V(e.signal,()=>D.offConnected(r,t))&&D.onConnected(r,t),r)}};w.disconnected=function(t,e){return e=st(e),function(r){return r.addEventListener(R,t,e),r[T]||V(e.signal,()=>D.offDisconnected(r,t))&&D.onDisconnected(r,t),r}};var O=[{get scope(){return d.D.body},host:t=>t?t(d.D.body):d.D.body,prevent:!0}],K=new WeakMap,v={get current(){return O[O.length-1]},get host(){return this.current.host},get signal(){let{host:t}=this;if(K.has(t))return K.get(t);let e=new AbortController;return K.set(t,e),t(w.disconnected(()=>e.abort())),e.signal},preventDefault(){let{current:t}=this;return t.prevent=!0,t},get state(){return[...O]},push(t={}){return O.push(x({},this.current,{prevent:!1},t))},pushRoot(){return O.push(O[0])},pop(){if(O.length!==1)return O.pop()}};var q={isSignal(t){return!1},processReactiveAttribute(t,e,n,r){return n}};function $(t,e=!0){return e?x(q,t):(Object.setPrototypeOf(t,q),t)}function z(t){return ct(t,q)&&t!==q?t:q}function ut(t,e,n,r){return t[(A(r)?"remove":"set")+e](n,r)}function ft(t,e,n,r,o=null){return t[(A(r)?"remove":"set")+e+"NS"](o,n,r)}function Q(t,e,n){if(Reflect.set(t,e,n),!!A(n))return Reflect.deleteProperty(t,e)}function at(t,e,n,r){return _(t,d.H)?t[e+"Attribute"](n,r):t[e+"AttributeNS"](null,n,r)}function Wt(t){return d.q(t)}function pt(...t){return this.appendOriginal(...t),this}function lt(t){return t.append===pt||(t.appendOriginal=t.append,t.append=pt),t}var H;function P(t,e,...n){let r=z(this),o=0,c,i,u=typeof e;switch((u==="string"||u==="number"||r.isSignal(e))&&(e={textContent:e}),!0){case typeof t=="function":{o=1;let a=(...b)=>b.length?(o===1?n.unshift(...b):b.forEach(s=>s(i)),void 0):i;v.push({scope:t,host:a}),c=t(e||void 0);let m=_(c,d.F);if(c.nodeName==="#comment")break;let h=P.mark({type:"component",name:t.name,host:m?"this":"parentElement"});c.prepend(h),m&&(i=h);break}case t==="#text":c=W.call(this,d.D.createTextNode(""),e);break;case(t==="<>"||!t):c=W.call(this,d.D.createDocumentFragment(),e);break;case!!H:c=W.call(this,d.D.createElementNS(H,t),e);break;case!c:c=W.call(this,d.D.createElement(t),e)}return lt(c),i||(i=c),n.forEach(a=>a(i)),o&&v.pop(),o=2,c}P.mark=function(t,e=!1){t=Object.entries(t).map(([o,c])=>o+`="${c}"`).join(" ");let n=e?"":"/",r=d.D.createComment(``);return e&&(r.end=d.D.createComment("")),r};function jt(t){let e=this;return function(...r){H=t;let o=P.call(e,...r);return H=void 0,o}}var J=new WeakMap,{setDeleteAttr:dt}=d;function W(t,...e){if(!e.length)return t;J.set(t,ht(t,this));for(let[n,r]of Object.entries(x({},...e)))Y.call(this,t,n,r);return J.delete(t),t}function Y(t,e,n){let{setRemoveAttr:r,s:o}=ht(t,this),c=this;n=o.processReactiveAttribute(t,e,n,(u,a)=>Y.call(c,t,u,a));let[i]=e;if(i==="=")return r(e.slice(1),n);if(i===".")return Q(t,e.slice(1),n);if(/(aria|data)([A-Z])/.test(e))return e=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r(e,n);switch(e==="className"&&(e="class"),e){case"xlink:href":return r(e,n,"http://www.w3.org/1999/xlink");case"textContent":return dt(t,e,n);case"style":if(typeof n!="object")break;case"dataset":return X(o,e,t,n,Q.bind(null,t[e]));case"ariaset":return X(o,e,t,n,(u,a)=>r("aria-"+u,a));case"classList":return mt.call(c,t,n)}return Ft(t,e)?dt(t,e,n):r(e,n)}function ht(t,e){if(J.has(t))return J.get(t);let r=(_(t,d.S)?ft:ut).bind(null,t,"Attribute"),o=z(e);return{setRemoveAttr:r,s:o}}function mt(t,e){let n=z(this);return X(n,"classList",t,e,(r,o)=>t.classList.toggle(r,o===-1?void 0:!!o)),t}function Ft(t,e){if(!(e in t))return!1;let n=gt(t,e);return!A(n.set)}function gt(t,e){if(t=Object.getPrototypeOf(t),!t)return{};let n=Object.getOwnPropertyDescriptor(t,e);return n||gt(t,e)}function X(t,e,n,r,o){let c=String;if(!(typeof r!="object"||r===null))return Object.entries(r).forEach(function([u,a]){u&&(u=new c(u),u.target=e,a=t.processReactiveAttribute(n,u,a,o),o(u,a))})}function It(t,e=t){let n="\xB9\u2070",r="\u2713",o=Object.fromEntries(Array.from(e.querySelectorAll("slot")).filter(c=>!c.name.endsWith(n)).map(c=>[c.name+=n,c]));if(t.append=new Proxy(t.append,{apply(c,i,u){if(u[0]===e)return c.apply(t,u);for(let a of u){let m=(a.slot||"")+n;try{at(a,"remove","slot")}catch{}let h=o[m];if(!h)return;h.name.startsWith(r)||(h.childNodes.forEach(b=>b.remove()),h.name=r+m),h.append(a)}return t.append=c,t}}),t!==e){let c=Array.from(t.childNodes);t.append(...c)}return e}function Ut(t,e,n={}){let r=t.host||t;v.push({scope:r,host:(...i)=>i.length?i.forEach(u=>u(r)):r}),typeof n=="function"&&(n=n.call(r,r));let o=r[T];o||vt(r);let c=e.call(r,n);return o||r.dispatchEvent(new Event(C)),t.nodeType===11&&typeof t.mode=="string"&&r.addEventListener(R,D.observe(t),{once:!0}),v.pop(),t.append(c)}function vt(t){return tt(t.prototype,"connectedCallback",function(e,n,r){e.apply(n,r),n.dispatchEvent(new Event(C))}),tt(t.prototype,"disconnectedCallback",function(e,n,r){e.apply(n,r),(globalThis.queueMicrotask||setTimeout)(()=>!n.isConnected&&n.dispatchEvent(new Event(R)))}),tt(t.prototype,"attributeChangedCallback",function(e,n,r){let[o,,c]=r;n.dispatchEvent(new CustomEvent(U,{detail:[o,c]})),e.apply(n,r)}),t.prototype[T]=!0,t}function tt(t,e,n){t[e]=new Proxy(t[e]||(()=>{}),{apply:n})}var bt="__dde_memo",B=[];function L(t,e){if(!B.length)return e(t);let n=typeof t=="object"?JSON.stringify(t):t,[{cache:r,after:o}]=B;return o(n,F(r,n)?r[n]:e(t))}L.isScope=function(t){return t[bt]};L.scope=function(e,{signal:n,onlyLast:r}={}){let o=S();function c(...i){if(n&&n.aborted)return e.apply(this,i);let u=r?o:S();B.unshift({cache:o,after(m,h){return u[m]=h}});let a=e.apply(this,i);return B.shift(),o=u,a}return c[bt]=!0,c.clear=()=>o=S(),n&&n.addEventListener("abort",c.clear),c};var l="__dde_signal",et=(()=>{let t=new Map,e=!1;function n(){e=!1;let r=t;t=new Map;for(let[o,c]of r){let i=o[l];i&&i.listeners.forEach(u=>u(i.value,c))}}return function(r,o=!1){t.set(r,t.get(r)||o),!e&&(e=!0,queueMicrotask(n))}})();var _t=S(null,{get:{value(){return Et(this)}},toJSON:{value(){return Et(this)}},valueOf:{value(){return this[l]&&this[l].value}}}),St=S(_t,{set:{value(...t){return Ct(this,...t)}}});function j(t){return t&&t[l]}var Z=[],E=new WeakMap;function g(t,e){if(typeof t!="function")return xt(!1,t,e);if(j(t))return t;let n=xt(!0);function r(o,c){let[i,...u]=E.get(r);if(E.set(r,new Set([i])),Z.push(r),Ct(n,t(),c),Z.pop(),!u.length)return;let a=E.get(r);for(let m of u)a.has(m)||M(m,r)}return E.set(n[l],r),E.set(r,new Set([n])),r(),n}g.action=function(t,e,...n){let r=t[l];if(!r)return;let{actions:o}=r;if(!o||!F(o,e))throw new Error(`Action "${e}" not defined. See ${l}.actions.`);if(o[e].apply(r,n),r.skip)return delete r.skip;et(t,!0)};g.on=function t(e,n,r={}){let{signal:o}=r;if(!(o&&o.aborted)){if(Array.isArray(e))return e.forEach(c=>t(c,n,r));rt(e,n),o&&o.addEventListener("abort",()=>M(e,n))}};g.symbols={onclear:Symbol.for("Signal.onclear")};g.clear=function(...t){for(let n of t){let r=n[l];r&&(delete n.toJSON,r.onclear.forEach(o=>o.call(r)),e(n,r),delete n[l])}function e(n,r){r.listeners.forEach(o=>{if(r.listeners.delete(o),!E.has(o))return;let c=E.get(o);c.delete(n),!(c.size>1)&&(n.clear(...c),E.delete(o))})}};var N="__dde_reactive";g.el=function(t,e){let n=L.isScope(e)?e:L.scope(e,{onlyLast:!0}),{current:r}=v,{scope:o}=r,c=P.mark({type:"reactive",component:o&&o.name||""},!0),i=c.end,u=d.D.createDocumentFragment();u.append(c,i);let a=m=>{if(!c.parentNode||!i.parentNode)return M(t,a);v.push(r);let h=n(m);v.pop(),Array.isArray(h)||(h=[h]);let b=document.createComment("");h.push(b),c.after(...h);let s;for(;(s=b.nextSibling)&&s!==i;)s.remove();b.remove(),c.isConnected&&$t(r.host())};return rt(t,a),yt(t,a,c,e),a(t.get()),r.host(w.disconnected(()=>n.clear())),u};function $t(t){!t||!t[N]||I().then(function(){t[N]=t[N].filter(([e,n])=>n.isConnected?!0:(M(...e),!1))})}var zt={_set(t){this.value=t}};function Ht(t){return function(e,n){let r=S(St,{set:{value(...c){return e.setAttribute(n,...c)}}}),o=At(r,e.getAttribute(n),zt);return t[n]=o,o}}var nt="__dde_attributes";g.observedAttributes=function(t){let e=t[nt]={},n=it(t,Ht(e));return w(U,function({detail:o}){/*! This maps attributes to signals (`S.observedAttributes`).
Investigate `__dde_attributes` key of the element. */let[c,i]=o,u=this[nt][c];if(u)return g.action(u,"_set",i)})(t),w.disconnected(function(){/*! This removes all signals mapped to attributes (`S.observedAttributes`).
- Investigate `__dde_attributes` key of the element. */g.clear(...Object.values(this[nt]))})(t),n};var St={isSignal:j,processReactiveAttribute(t,e,n,r){if(!j(n))return n;let o=c=>{if(!t.isConnected)return M(n,o);r(e,c)};return ot(n,o),wt(n,o,t,e),n.get()}};function wt(t,e,...n){let{current:r}=v;r.host(function(o){o[N]||(o[N]=[]),o[N].push([[t,e],...n]),!r.prevent&&w.disconnected(()=>o[N].forEach(([[c,i]])=>M(c,i,c[l]&&c[l].host&&c[l].host()===o)))(o)})}var Jt=new FinalizationRegistry(function(t){g.clear({[l]:t})});function Et(t,e,n){let r=S(t?Ut:rt),o=yt(r,e,n,t);return Jt.register(o,o[l]),o}var Bt=x(S(),{stopPropagation(){this.skip=!0}});function yt(t,e,n,r=!1){let o=[];ct(n)!=="[object Object]"&&(n={});let{onclear:c}=g.symbols;n[c]&&(o.push(n[c]),delete n[c]);let{host:i}=v;return Reflect.defineProperty(t,l,{value:x(S(Bt),{value:e,actions:n,onclear:o,host:i,listeners:new Set,readonly:r}),enumerable:!1,writable:!1,configurable:!0}),t}function Zt(){return Z[Z.length-1]}function _t(t){if(!t[l])return;let{value:e,listeners:n}=t[l],r=Zt();return r&&n.add(r),E.has(r)&&E.get(r).add(t),e}function At(t,e,n){let r=t[l];if(!(!r||!n&&r.value===e))return r.value=e,et(t,n),e}function ot(t,e){if(t[l])return t[l].listeners.add(e)}function M(t,e,n){let r=t[l];if(!r)return;let{listeners:o}=r,c=o.delete(e);if(!c||!n||o.size)return c;g.clear(t);let i=E.get(r);if(!i)return c;let u=E.get(i);if(!u)return c;for(let a of u)M(a,i,!0);return c}$(St);return Nt(Gt);})();
+ Investigate `__dde_attributes` key of the element. */g.clear(...Object.values(this[nt]))})(t),n};var wt={isSignal:j,processReactiveAttribute(t,e,n,r){if(!j(n))return n;let o=c=>{if(!t.isConnected)return M(n,o);r(e,c)};return rt(n,o),yt(n,o,t,e),n.get()}};function yt(t,e,...n){let{current:r}=v;r.host(function(o){o[N]||(o[N]=[]),o[N].push([[t,e],...n]),!r.prevent&&w.disconnected(()=>o[N].forEach(([[c,i]])=>M(c,i,c[l]&&c[l].host&&c[l].host()===o)))(o)})}var Jt=new FinalizationRegistry(function(t){g.clear({[l]:t})});function xt(t,e,n){let r=S(t?_t:St),o=At(r,e,n);return Jt.register(o,o[l]),o}var Bt=x(S(),{stopPropagation(){this.skip=!0}});function At(t,e,n){let r=[];ot(n)!=="[object Object]"&&(n={});let{onclear:o}=g.symbols;n[o]&&(r.push(n[o]),delete n[o]);let{host:c}=v;return Reflect.defineProperty(t,l,{value:x(S(Bt),{value:e,actions:n,onclear:r,host:c,listeners:new Set}),enumerable:!1,writable:!1,configurable:!0}),t}function Zt(){return Z[Z.length-1]}function Et(t){if(!t[l])return;let{value:e,listeners:n}=t[l],r=Zt();return r&&n.add(r),E.has(r)&&E.get(r).add(t),e}function Ct(t,e,n){let r=t[l];if(!(!r||!n&&r.value===e))return r.value=e,et(t,n),e}function rt(t,e){if(t[l])return t[l].listeners.add(e)}function M(t,e,n){let r=t[l];if(!r)return;let{listeners:o}=r,c=o.delete(e);if(!c||!n||o.size)return c;g.clear(t);let i=E.get(r);if(!i)return c;let u=E.get(i);if(!u)return c;for(let a of u)M(a,i,!0);return c}$(wt);return Mt(Gt);})();
diff --git a/docs/p07-debugging.html.js b/docs/p07-debugging.html.js
index 9344821..6d6559a 100644
--- a/docs/p07-debugging.html.js
+++ b/docs/p07-debugging.html.js
@@ -77,11 +77,11 @@ export function page({ pkg, info }){
signal objects. It contains the following information:
`),
el("ul").append(
+ // TODO: value?
el("li", t`listeners: A Set of functions called when the signal value changes`),
el("li", t`actions: Custom actions that can be performed on the signal`),
el("li", t`onclear: Functions to run when the signal is cleared`),
el("li", t`host: Reference to the host element/scope in which the signal was created`),
- el("li", t`readonly: Boolean flag indicating if the signal is read-only`)
),
el("p").append(T`
…to determine the current value of the signal, call ${el("code", "signal.valueOf()")}. Don’t hesitate to
diff --git a/src/signals-lib/signals-lib.js b/src/signals-lib/signals-lib.js
index 39ce82d..459a088 100644
--- a/src/signals-lib/signals-lib.js
+++ b/src/signals-lib/signals-lib.js
@@ -2,14 +2,13 @@ import { queueSignalWrite, mark } from "./helpers.js";
export { mark };
import { hasOwn, oCreate, oAssign, requestIdle } from "../helpers.js";
-const Signal = oCreate(null, {
+const SignalReadOnly= oCreate(null, {
get: { value(){ return read(this); } },
- set: { value(...v){ return write(this, ...v); } },
toJSON: { value(){ return read(this); } },
valueOf: { value(){ return this[mark] && this[mark].value; } }
});
-const SignalReadOnly= oCreate(Signal, {
- set: { value(){ return; } },
+const Signal = oCreate(SignalReadOnly, {
+ set: { value(...v){ return write(this, ...v); } },
});
/**
* Checks if a value is a signal
@@ -344,7 +343,7 @@ const cleanUpRegistry = new FinalizationRegistry(function(s){
*/
function create(is_readonly, value, actions){
const varS = oCreate(is_readonly ? SignalReadOnly : Signal);
- const SI= toSignal(varS, value, actions, is_readonly);
+ const SI= toSignal(varS, value, actions);
cleanUpRegistry.register(SI, SI[mark]);
return SI;
}
@@ -367,11 +366,10 @@ const protoSigal= oAssign(oCreate(), {
* @param {Object} s - Object to transform
* @param {any} value - Initial value
* @param {Object} actions - Custom actions
- * @param {boolean} [readonly=false] - Whether the signal is readonly
* @returns {Object} Signal object with get() and set() methods
* @private
*/
-function toSignal(s, value, actions, readonly= false){
+function toSignal(s, value, actions){
const onclear= [];
if(typeOf(actions)!=="[object Object]")
actions= {};
@@ -385,7 +383,6 @@ function toSignal(s, value, actions, readonly= false){
value: oAssign(oCreate(protoSigal), {
value, actions, onclear, host,
listeners: new Set(),
- readonly
}),
enumerable: false,
writable: false,