@fluixi/reactive 1.0.0-alpha.77 → 1.0.0-alpha.79
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/dist/cdn/reactive.cjs +1 -1
- package/dist/cdn/reactive.global.js +1 -1
- package/dist/cdn/reactive.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +6 -0
- package/dist/lib/index.mjs +1 -1
- package/dist/lib/observable/index.cjs +1 -1
- package/dist/lib/observable/index.mjs +1 -1
- package/dist/lib/observable/observable.cjs +1 -1
- package/dist/lib/observable/observable.mjs +1 -1
- package/dist/lib/observable/subscription.cjs +1 -1
- package/dist/lib/observable/subscription.d.ts.map +1 -1
- package/dist/lib/observable/subscription.js +1 -2
- package/dist/lib/observable/subscription.mjs +1 -1
- package/dist/lib/predicates.cjs +1 -0
- package/dist/lib/predicates.d.ts +37 -0
- package/dist/lib/predicates.d.ts.map +1 -0
- package/dist/lib/predicates.js +62 -0
- package/dist/lib/predicates.mjs +1 -0
- package/dist/lib/signal/cached-resource.cjs +1 -1
- package/dist/lib/signal/cached-resource.mjs +1 -1
- package/dist/lib/signal/graph/signal-next.d.ts +6 -6
- package/dist/lib/signal/index-legacy.cjs +1 -1
- package/dist/lib/signal/index-legacy.mjs +1 -1
- package/dist/lib/signal/signal.cjs +1 -1
- package/dist/lib/signal/signal.d.ts.map +1 -1
- package/dist/lib/signal/signal.js +16 -1
- package/dist/lib/signal/signal.mjs +1 -1
- package/dist/lib/signal/utilities.cjs +1 -1
- package/dist/lib/signal/utilities.mjs +1 -1
- package/dist/lib/store/setter.types.d.ts +1 -1
- package/dist/lib/store/setter.types.d.ts.map +1 -1
- package/dist/lib/subject.cjs +1 -1
- package/dist/lib/subject.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/version.generated.cjs +1 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/version.generated.mjs +1 -1
- package/package.json +16 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Me=Object.defineProperty;var $n=Object.getOwnPropertyDescriptor;var Wn=Object.getOwnPropertyNames;var zn=Object.prototype.hasOwnProperty;var Hn=(e,n)=>{for(var t in n)Me(e,t,{get:n[t],enumerable:!0})},Yn=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Wn(n))!zn.call(e,r)&&r!==t&&Me(e,r,{get:()=>n[r],enumerable:!(o=$n(n,r))||o.enumerable});return e};var Jn=e=>Yn(Me({},"__esModule",{value:!0}),e);var or={};Hn(or,{$MEMO:()=>Fn,$PROXY:()=>Ze,$RESOURCE:()=>Un,$SIGNAL:()=>De,__DEV__:()=>de,batch:()=>k,clearAllCachedResources:()=>er,clearCachedResourceNamespace:()=>Zt,combineSignal:()=>It,combineSignals:()=>Nt,createCachedResource:()=>Qt,createComputed:()=>gt,createContext:()=>on,createDebounce:()=>Rn,createDeferred:()=>On,createEffect:()=>ne,createMemo:()=>ht,createProvider:()=>Bn,createRenderEffect:()=>jn,createResource:()=>yt,createRoot:()=>vt,createSelector:()=>gn,createSignal:()=>U,debounceSignal:()=>Wt,distinctSignal:()=>Mt,everySignal:()=>Dt,filterSignal:()=>kt,findSignal:()=>Ft,flush:()=>xt,getOwner:()=>bt,getServerData:()=>Ye,getSharedConfig:()=>dt,getSuspenseContext:()=>sn,getSuspenseListContext:()=>Ot,guardSignal:()=>$t,indexArray:()=>rr,isComponent:()=>fn,isMemo:()=>cn,isProvider:()=>pn,isResource:()=>ln,isSignal:()=>ge,isSuspense:()=>dn,keyArray:()=>tr,makeArrayFlat:()=>Le,mapArray:()=>nr,mapSignal:()=>Et,mergeSignal:()=>Lt,nextResourceId:()=>Je,omitSignal:()=>Gt,on:()=>wt,onCleanup:()=>be,onResolve:()=>At,pickSignal:()=>jt,readChildren:()=>Ke,readSignal:()=>Ht,reduceSignal:()=>Pt,reportResourceData:()=>Xe,resumeEffects:()=>Rt,runWithOwner:()=>mt,selectSignal:()=>Vt,setOwner:()=>ft,setResourceDataSink:()=>En,setResourceIdSource:()=>_n,setResourceTracker:()=>An,setScheduler:()=>Ct,setServerDataGetter:()=>Cn,sharedConfig:()=>Ue,someSignal:()=>Ut,sortSignal:()=>qt,startTransition:()=>Vn,throttleSignal:()=>zt,trackPromise:()=>_t,trackResourcePromise:()=>ve,untrack:()=>L,useContext:()=>I,useTransition:()=>St,whenSignal:()=>Kt,zipSignal:()=>Bt});module.exports=Jn(or);var an=require("@fluixi/utils/object"),Ie=require("@fluixi/utils/functions"),fe=class e{constructor(n){this._closed=!1;this._parentOrParents=null;this._subscriptions=null;n&&(this._subscriptions=[n])}get closed(){return this._closed}unsubscribe(){if(this._closed)return;this._closed=!0;let{_parentOrParents:n,_subscriptions:t}=this;if(n instanceof e)n.remove(this);else if(n!==null)for(let o of n)o.remove(this);if(t){for(let o of t)if((0,Ie.isFunction)(o)&&!(o instanceof e))try{o()}catch(r){console.error("Error in unsubscribe function:",r)}else if((0,an.isObject)(o)&&typeof o.unsubscribe=="function")try{o.unsubscribe()}catch(r){console.error("Error unsubscribing child:",r)}this._subscriptions=null}}add(n){if(!n||n===this)return this;if(n.closed)return this;let{_closed:t,_subscriptions:o}=this;if(t){if((0,Ie.isFunction)(n))try{n()}catch(r){console.error("Error in unsubscribe function:",r)}else if(n.unsubscribe)try{n.unsubscribe()}catch(r){console.error("Error unsubscribing:",r)}return this}return o||(this._subscriptions=[]),this._subscriptions.push(n),n instanceof e&&n._addParent(this),this}remove(n){let{_subscriptions:t}=this;if(!t)return;let o=t.indexOf(n);o!==-1&&(t.splice(o,1),n._removeParent(this))}_addParent(n){let{_parentOrParents:t}=this;t?Array.isArray(t)?t.push(n):this._parentOrParents=[t,n]:this._parentOrParents=n}_removeParent(n){let{_parentOrParents:t}=this;if(t===n)this._parentOrParents=null;else if(Array.isArray(t)){let o=t.indexOf(n);o!==-1&&(t.splice(o,1),t.length===1&&(this._parentOrParents=t[0]))}}};var we=class extends fe{constructor(t,o,r){super();this.isStopped=!1;let s;t?typeof t=="object"?s=t:s={next:t,error:o,complete:r}:s={},this.destination=s}next(t){if(!this.isStopped&&this.destination.next)try{this.destination.next(t)}catch(o){this.error(o)}}error(t){if(!this.isStopped){if(this.isStopped=!0,this.destination.error)try{this.destination.error(t)}catch(o){throw o}else throw t;this.unsubscribe()}}complete(){if(!this.isStopped){if(this.isStopped=!0,this.destination.complete)try{this.destination.complete()}catch(t){this.error(t);return}this.unsubscribe()}}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}},Ne=class extends we{constructor(t,o,r,s){super(t,o,r);this._isUnsubscribing=!1;this._parentSubscriber=null;this._parentSubscriber=s||null}next(t){if(!this.isStopped&&!this._isUnsubscribing)try{super.next(t)}catch(o){this.error(o)}}error(t){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.error(t)}finally{this._isUnsubscribing=!1}}}complete(){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.complete()}finally{this._isUnsubscribing=!1}}}unsubscribe(){this.closed||(this._isUnsubscribing=!0,super.unsubscribe(),this._isUnsubscribing=!1)}};var Z=class extends fe{constructor(n){if(super(),n)this._subscribe=n;else throw new TypeError("Observable constructor requires a subscribe function")}subscribe(n,t,o){let r;n instanceof we?r=n:r=new Ne(n,t,o);let{_subscribe:s}=this;try{let u=s.call(this,r);u&&(typeof u=="function"||typeof u.unsubscribe=="function")&&r.add(u)}catch(u){r.error(u)}return r}pipe(...n){return n.length===0?this:n.reduce((t,o)=>o(t),this)}toPromise(){return new Promise((n,t)=>{let o;this.subscribe({next:r=>o=r,error:t,complete:()=>n(o)})})}};var me=require("@fluixi/utils");var de=!1,Xn=Symbol.for("signal"),Qn=Symbol.for("memo"),Zn=Symbol.for("resource");function ge(e){return typeof e=="function"&&e[Xn]===!0}function cn(e){return typeof e=="function"&&e[Qn]===!0}function ln(e){return typeof e=="function"&&e[Zn]===!0}function fn(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function dn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function pn(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Le(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Le(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}var et="__fluixi_signal_next_state__",nt=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},c=globalThis[et]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:nt,onSuspend:null,onError:null};var Tn=0,hn=1,pe=2,Oe=class{constructor(){this.observers=null;this.watchers=null;this.version=0}updateIfNecessary(){}track(){if(c.untracked)return;let n=c.consumer;n&&((this.observers??=new Set).add(n),(n.sources??=new Set).add(this))}},Re=class extends Oe{constructor(n,t){super(),this._value=n,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(n){if(!this._equals(this._value,n)){if(this._value=n,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(pe);Be(this)}}peek(){return this._value}},ue=class extends Oe{constructor(t,o){super();this._threw=!1;this._initialized=!1;this.state=pe;this.sources=null;this._fn=t,this._equals=o?.equals===!1?()=>!1:o?.equals??Object.is}get(){if(c.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===hn&&this.sources){for(let t of this.sources)if(t.updateIfNecessary(),this.state===pe)break}(this.state===pe||!this._initialized)&&this.recompute(),this.state=Tn}recompute(){if(this.sources){for(let i of this.sources)i.observers?.delete(this);this.sources.clear()}let t=c.consumer,o=c.untracked;c.consumer=this,c.untracked=!1;let r,s=!1,u;try{r=this._fn()}catch(i){s=!0,u=i,r=this._value}finally{c.consumer=t,c.untracked=o}let a=!this._initialized||this._threw!==s||(s?u!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=s,this._error=u,this._value=r,a){if(this.version++,this.observers)for(let i of[...this.observers])i.markDirty(pe);Be(this)}}markDirty(t){if(this.state>=t)return;let o=this.state===Tn;if(this.state=t,o){if(this.observers)for(let r of[...this.observers])r.markDirty(hn);Be(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Be(e){if(e.watchers)for(let n of[...e.watchers])n._notify(e)}var Ae=class{constructor(n){this._watched=new Set;this._pending=new Set;this._notifyFn=n}watch(...n){for(let t of n)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...n){for(let t of n)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let n=[...this._pending];return this._pending.clear(),n}_notify(n){if(!this._watched.has(n)||this._pending.has(n))return;let t=this._pending.size===0;this._pending.add(n),t&&this._notifyFn()}};function vn(e){if(c.untracked)return e();c.untracked=!0;try{return e()}finally{c.untracked=!1}}function yn(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function bn(e){return c.onSuspend?(c.onSuspend(e,c.owner),!0):!1}function je(){return c.owner}function _e(e,n){let t=c.owner;c.owner=e;try{return n()}finally{c.owner=t}}function ee(e){if(c.owner){if(c.owner.disposed){e();return}(c.owner.cleanups??=[]).push(e)}}function Ce(e,n=!0){if(!e.disposed){if(e.owned){for(let t=e.owned.length-1;t>=0;t--)Ce(e.owned[t]);e.owned=null}if(e.cleanups){for(let t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}n&&(e.disposed=!0)}}function Te(e){let n=yn(c.owner);c.owner&&(c.owner.owned??=[]).push(n);let t=c.owner;c.owner=n;try{return e(()=>Ce(n))}finally{c.owner=t}}function mn(e){c.hostSchedule=e??(n=>{Promise.resolve().then(n)})}function tt(e){e.queued||(e.queued=!0,c.queue.push(e),!c.scheduled&&c.batchDepth===0&&(c.scheduled=!0,c.hostSchedule(Ge)))}function Ge(){if(c.scheduled=!1,c.flushing)return;c.flushing=!0;let e=0;try{for(;c.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let n=c.queue;c.queue=[];for(let t of n)t.queued=!1,t.disposed||t.run()}}finally{c.flushing=!1}}function xn(){c.batchDepth===0&&Ge()}var Ve=class{constructor(n){this.queued=!1;this.disposed=!1;this.owner=yn(c.owner),c.owner&&(c.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new ue(()=>{Ce(this.owner,!1),_e(this.owner,()=>{let t=n();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new Ae(()=>tt(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(n){if(n&&typeof n.then=="function"&&c.onSuspend){c.onSuspend(n,this.owner);return}if(c.onError&&c.onError(n,this.owner))return;throw n}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),Ce(this.owner))}};function Sn(e){let n=new Ve(e);return()=>n.dispose()}function rt(e){return!!e&&typeof e.then=="function"}mn(()=>{});var wn=Symbol.for("signal"),ot=Symbol.for("memo"),st=Symbol.for("signal-node");function N(e,n){let t=new Re(e,{equals:n?.equals}),o=(()=>t.get()),r=(s=>{let u=typeof s=="function"?s(t.peek()):s;return t.set(u),xn(),u});return Object.defineProperty(o,wn,{value:!0,enumerable:!0}),Object.defineProperty(o,st,{value:{get value(){return t.peek()},get version(){return t.version}},enumerable:!1}),[o,r]}function x(e,n,t){let o=n,r=je(),s=new ue(()=>_e(r,()=>{try{return o=e(o)}catch(a){if(rt(a))return bn(a),o;throw a}}),{equals:t?.equals}),u=(()=>s.get());return Object.defineProperty(u,wn,{value:!0,enumerable:!0}),Object.defineProperty(u,ot,{value:!0,enumerable:!0}),u}function he(e,n){let t=n;return Sn(()=>{t=e(t)})}function Ee(e){return vn(e)}function gn(e,n=(t,o)=>t===o){let t=new Map;return he(()=>{let o=e();for(let[r,s]of t){let[u,a]=s,i=n(r,o);u()!==i&&a(i)}}),o=>{let r=t.get(o);if(!r){let[s,u]=N(!1);r=[s,u],t.set(o,r);let a=e();u(n(o,a))}return r[0]()}}function On(e,n){let[t,o]=N(e(),n);return he(()=>{let r=e();n?.timeoutMs?setTimeout(()=>o(()=>r),n.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>o(()=>r)):Promise.resolve().then(()=>o(()=>r))}),t}function Rn(e,n){let t,o=(...r)=>{t!==void 0&&clearTimeout(t),t=setTimeout(()=>{t=void 0,e(...r)},n)};return ee(()=>{t!==void 0&&clearTimeout(t)}),o}function ke(e){if(typeof e=="function"&&!e.length){let n=e();return ge(n)?n:ke(n)}if(Array.isArray(e)){let n=[];for(let t=0;t<e.length;t++){let o=ke(e[t]);Array.isArray(o)?n.push.apply(n,o):n.push(o)}return n}return e}function Ke(e){let n=x(e);return x(()=>ke(n()))}var $e=null;function An(e){$e=e}function ve(e){$e&&$e(e)}var We=null;function Cn(e){We=e}function Ye(e){return We?We(e):void 0}var ze=null;function _n(e){ze=e}function Je(){return ze?ze():void 0}var He=null;function En(e){He=e}function Xe(e,n){He&&He(e,n)}var De=Symbol.for("signal"),Fn=Symbol.for("memo"),Un=Symbol.for("resource"),Ze=Symbol("fluixi-proxy"),Dn=Symbol.for("signal-node"),K=0,ye=1,W=2,$=3,f=null,v=null,l=null,Pe=null,Fe=0,it=!1,Qe=!1,ae=0,ut=1e6,F=new WeakMap,M=null;var at=null,ct=new Map,lt=0,Ue={context:null,owner:null,routeData:new Map,matchedRoute:new Map};function ft(e){f=e,Ue.owner=e,Ue.context=e}function dt(){return Ue}function pt(){return`node_${++lt}_${Date.now()}`}function Tt(e){!1}function qn(e,n,t){let o={id:pt(),type:e,value:n,version:0,equals:t?.equals,name:t?.name,created:Date.now(),updated:Date.now()};return Tt(o),o}function Mn(e,n){return e===n}function tn(e){throw typeof console<"u"&&console.error("Reactive error:",e),e}var en=null,nn=null;function In(){if(!en){let[e,n]=U(!1);en=e,nn=n}}function Nn(e){if(l)l.indexOf(e)===-1&&l.push(e);else if(M&&M.running&&!e.pure)M.effects.indexOf(e)===-1&&M.effects.push(e);else if(!e.pure||e.computed)xe(e);else if(e.pure&&!e.computed&&e.accessor){let n=v,t=l;v=null,l=[],e.accessor(),v=n;let o=l;if(l=t,o.length>0){let r=l;qe(o),l=r}}}function kn(e,n){for(let t=0;t<e.length;t++)n(e[t])}function U(e,n){let t=e;typeof t=="object"&&t&&Ze in t&&delete t[Ze];let o=qn("signal",t,{equals:n?.equals===!1?void 0:n?.equals,name:n?.name}),r=[u,a];F.set(r,new Set);let s;function u(){let i=v;if(i){i.sources?i.sources.indexOf(r)===-1&&i.sources.push(r):i.sources=[r];let d=F.get(r);d&&!d.has(i)&&d.add(i)}return t}function a(i){let d=typeof i=="function"?i(t):i,y=o.equals||Mn;if(n?.equals===!1||!y(t,d)){t=d,o.value=d,o.version++,o.updated=Date.now();let w=F.get(r);if(w&&w.size>0){let E=function(p,b=!1){let C=p.state;if(!(C===$&&p===v)){if(b&&!p.pure){C===K&&(p.state=ye,it&&(l!==null&&l.indexOf(p)===-1?l.push(p):g.push(p)));return}if(!m.has(p)&&(m.add(p),p.state=W,C===K||C===ye?g.push(p):!p.pure&&l!==null&&l.indexOf(p)===-1&&l.push(p),p.pure&&p.accessor)){let P=F.get(p.accessor);P&&kn(Array.from(P),_=>E(_,!0))}}};var T=E;let S=Array.from(w),g=[],m=new Set;kn(S,E);for(let p of g)Nn(p)}}}return u.toObservable=()=>new Z(i=>{let d=!0;return ne(()=>{let T=u();d?d=!1:i.next(T)})}),Object.defineProperty(u,De,{value:!0,enumerable:!0}),Object.defineProperty(u,Dn,{value:o,enumerable:!1}),r}function ne(e,n,t){let o={fn:e,state:W,sources:null,sourceSlots:null,owned:null,cleanups:null,owner:f,contexts:null,pure:!1,updatedAt:null};f&&(f.owned?f.owned.push(o):f.owned=[o]);let r=O&&I(O);return r&&(o.suspense=r),rn(o,n),()=>J(o)}function rn(e,n){if(e.sources){for(let r of e.sources){let s=F.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.owned){for(let r=0;r<e.owned.length;r++)J(e.owned[r]);e.owned=null}let t=v,o=f;if(v=e,f=e,Fe++,Fe>ut)throw Fe=0,v=t,f=o,new Error("Potential infinite loop detected. Exceeded maximum iterations.");try{e.state=$;let r=e.fn(n);typeof r=="function"&&(e.cleanups?e.cleanups.push(r):e.cleanups=[r]),e.state===$&&(e.state=K)}catch(r){if((0,me.isPromise)(r)){let s=O&&I(O);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}tn(r)}finally{v=t,f=o}}function xe(e){if(!(e.disposed||!e.fn||e.state===K)&&(e.state===W||e.state===ye||e.state===$)){if(e.cleanups){for(let n=0;n<e.cleanups.length;n++)e.cleanups[n]();e.cleanups=null}if(e.owned){for(let n=0;n<e.owned.length;n++)J(e.owned[n]);e.owned=null}e.renderEffect?Gn(e):rn(e,e.value)}}function J(e){if(e.disposed=!0,e.sources)for(let n of e.sources){let t=F.get(n);t&&t.delete(e)}if(e.cleanups)for(let n=0;n<e.cleanups.length;n++)e.cleanups[n]();if(e.owned)for(let n=0;n<e.owned.length;n++)J(e.owned[n]);if(e.owner&&e.owner.owned){let n=e.owner.owned.indexOf(e);n!==-1&&e.owner.owned.splice(n,1)}}function ht(e,n,t){let o=qn("memo",n,{equals:t?.equals===!1?void 0:t?.equals,name:t?.name}),r={fn:e,state:W,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!0,updatedAt:null,node:o,accessor:void 0};f&&(f.owned?f.owned.push(r):f.owned=[r]);let s=()=>{if(v&&v!==r){v.sources?v.sources.indexOf(s)===-1&&v.sources.push(s):v.sources=[s];let a=s;F.has(a)||F.set(a,new Set);let i=F.get(a);i&&i.add(v)}if(r.state!==K){if(r.sources){for(let d of r.sources){let y=F.get(d);y&&y.delete(r)}r.sources=null,r.sourceSlots=null}if(r.cleanups){for(let d=0;d<r.cleanups.length;d++)r.cleanups[d]();r.cleanups=null}if(r.owned){for(let d=0;d<r.owned.length;d++)J(r.owned[d]);r.owned=null}let a=v,i=f;v=r,f=r,r.state=$;try{let d=r.fn(r.value),y=o.equals||Mn;if(t?.equals===!1||!y(r.value,d)){r.value=d,o.value=d,o.version++,o.updated=Date.now();let w=s,S=F.get(w);if(S&&S.size>0){let p=function(b,C=!1){if(b===r)return;let P=b.state;if(P!==$){if(C&&!b.pure){P===K&&(b.state=ye,l!==null&&l.indexOf(b)===-1?l.push(b):m.push(b));return}if(!E.has(b)&&(E.add(b),b.state=W,P===K||P===ye?m.push(b):!b.pure&&l!==null&&l.indexOf(b)===-1&&l.push(b),b.pure&&b.accessor)){let _=F.get(b.accessor);if(_&&_.size>0)for(let z of Array.from(_))p(z,!0)}}};var u=p;let g=Array.from(S),m=[],E=new Set;for(let b=0;b<g.length;b++)p(g[b]);for(let b of m)Nn(b)}}r.state===$&&(r.state=K)}catch(d){if((0,me.isPromise)(d)){let y=O&&I(O);if(!y&&O){let T=i;for(;T;){if(T.contexts?.has(O.id)){y=T.contexts.get(O.id);break}T=T.owner}}return y&&(y.increment(),d.finally(()=>y.decrement())),r.value}tn(d)}finally{v=a,f=i}}return r.value};return r.accessor=s,F.set(s,new Set),s.toObservable=()=>new Z(u=>{let a=!0;return ne(()=>{let d=s();a?a=!1:u.next(d)})}),Object.defineProperty(s,De,{value:!0,enumerable:!0}),Object.defineProperty(s,Fn,{value:!0,enumerable:!0}),Object.defineProperty(s,Dn,{value:o,enumerable:!1}),s}function qe(e){let n=[],t=[];for(let r of e)r.pure&&!r.computed&&r.accessor?n.indexOf(r)===-1&&n.push(r):(r.computed||!r.pure)&&t.indexOf(r)===-1&&t.push(r);l=[];let o=0;for(;o<n.length;){let r=n[o++],s=F.get(r.accessor);if(s&&s.size>0){let a=v;v=null,r.accessor(),v=a}let u=l.splice(0);for(let a of u)a.pure&&!a.computed&&a.accessor?n.indexOf(a)===-1&&n.push(a):(a.computed||!a.pure)&&t.indexOf(a)===-1&&t.push(a)}l=null;for(let r of t)(r.computed||!r.pure)&&xe(r)}function k(e){if(l&&ae>0)return e();if(l&&ae===0){let n=l,t=[];l=t,ae++;let o;try{o=e()}finally{ae--,l=n}let r=l;return qe(t),l=r,o}ae++,l=[],Pe=[];try{return e()}finally{ae--,Ln()}}function Ln(){if(!Qe){Qe=!0,Fe=0;try{for(;l&&l.length>0;){let e=l;l=null,qe(e)}if(l=null,Pe){let e=Pe;Pe=null;for(let n=0;n<e.length;n++)xe(e[n])}}finally{Qe=!1}}}function vt(e){let n={owned:null,cleanups:null,contexts:null,owner:f},t=v;v=null;let o=f;f=n;try{return e(()=>{if(n.owned)for(let r=0;r<n.owned.length;r++)J(n.owned[r]);if(n.cleanups)for(let r=0;r<n.cleanups.length;r++)n.cleanups[r]()})}finally{f=o,v=t}}function L(e){let n=v;v=null;try{return e()}finally{v=n}}function be(e){f&&(f.cleanups?f.cleanups.push(e):f.cleanups=[e])}function yt(e,n,t={}){let o,r;typeof n=="function"?(o=typeof e=="function"?e:()=>e,r=n):(o=()=>!0,r=e,n&&typeof n=="object"&&(t=n));let{initialValue:s,name:u}=t,a=t.transport===!1?void 0:Je(),i=a!==void 0?Ye(a):void 0,d=i!==void 0,[y,T]=U(i!==void 0?i.value:t.initialValue,{equals:!1}),[w,S]=U(void 0,{equals:!1}),[g,m]=U(i!==void 0||t.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[E,p]=U(void 0,{equals:!1}),[b,C]=U(void 0,{equals:!1}),P=Symbol(),_=P,z=!1,H=A=>{if(!(typeof localStorage>"u"))try{A&&localStorage.setItem("storage",JSON.stringify({data:A,timestamp:Date.now()}))}catch(B){console.error(`Failed to save resource to cache (${u}):`,B)}},ce=ne(()=>{let A=o?o():e;if(b(),A===!1||A===null||A===void 0){_=P,k(()=>{m("unresolved"),p(void 0),S(void 0)});return}let B=z;if(z=!1,_!==P&&A===_&&!B)return;if(_=A,d){d=!1;return}let V=!1;be(()=>V=!0);let le=L(g),oe=L(y),Q=le==="ready"||le==="refreshing";k(()=>{m(Q?"refreshing":"pending"),S(void 0)});try{let j=r(A,{value:oe,refetching:Q});if((0,me.isPromise)(j)){p(j),ve(j),j.then(h=>{V||(a!==void 0&&Xe(a,h),k(()=>{T(()=>h),H(h),m("ready"),p(void 0)}))},h=>{V||k(()=>{S(h),m("errored"),p(void 0)})}).catch(h=>{V||k(()=>{S(h),m("errored"),p(void 0)})});let Se=O&&I(O);Se&&(Se.increment(),j.finally(()=>Se.decrement()))}else{if(V)return;k(()=>{T(()=>j),m("ready"),p(void 0)})}}catch(j){if(V)return;k(()=>{S(j),m("errored"),p(void 0)})}});be(ce);let X=()=>{let A=g();return A==="pending"||A==="refreshing"},Y=(()=>{let A=w();if(A)throw A;if(X()){let B=E();if(B)throw B}return y()});return Object.defineProperty(Y,Un,{value:!0,enumerable:!0}),Object.defineProperty(Y,De,{value:!0,enumerable:!0}),Object.defineProperties(Y,{state:{get:g},loading:{get:()=>X()},error:{get:w},latest:{get:y}}),[Y,{mutate:T,refetch:()=>{z=!0,C(void 0)}}]}function bt(){return f}function mt(e,n){let t=f,o=v;f=e,v=null;try{return n()}finally{f=t,v=o}}function on(e){let n=Symbol("context"),t=Bn(n);return{id:n,Provider:t,defaultValue:e}}function Bn(e){return n=>{let t=f;for(;t;)t.contexts||(t.contexts=new Map),t.contexts.has(e)||t.contexts.set(e,n.value),t=t.owner;let o;return jn(()=>{o=L(()=>{let r=f;return r&&(r.contexts||(r.contexts=new Map),r.contexts.set(e,n.value)),Ke(()=>n.children)})}),o}}function I(e){let n=f;for(;n;){if(n.contexts&&n.contexts.has(e.id))return n.contexts.get(e.id);n=n.owner}if(e)return e.defaultValue}function xt(){return new Promise(e=>{queueMicrotask(()=>{Ln(),e()})})}function Vn(e){if(M&&M.running)return e(),M.done;In();let n,t=new Promise(r=>n=r),o={running:!0,effects:[],resolve:n,done:t};M=o;try{e()}finally{o.running=!1}return o.effects.length?(nn(!0),Promise.resolve().then(()=>{let r=o.effects.splice(0);M=null,nn(!1),r.length&&k(()=>{for(let s of r)s.state=W,xe(s)}),n()}),t):(M=null,n(),t)}function St(){return In(),[en,Vn]}function wt(e,n,t){let o=t?.defer??!1,r=!0;return s=>{let u=e();return o&&r?(r=!1,s):L(()=>n(u,s))}}function jn(e,n,t){let o={fn:e,state:W,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!1,updatedAt:null,renderEffect:!0};f&&(f.owned?f.owned.push(o):f.owned=[o]);let r=O&&I(O);return r&&(o.suspense=r),Gn(o),()=>J(o)}function Gn(e){if(e.sources){for(let r of e.sources){let s=F.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.cleanups){for(let r=0;r<e.cleanups.length;r++)e.cleanups[r]();e.cleanups=null}if(e.owned){for(let r=0;r<e.owned.length;r++)J(e.owned[r]);e.owned=null}let n=v,t=f,o=l;v=e,f=e,l===null&&(l=[]),e.state=$;try{let r=e.fn(e.value);typeof r=="function"&&(e.cleanups||(e.cleanups=[]),e.cleanups.push(r)),e.value=r,e.state===$&&(e.state=K)}catch(r){if((0,me.isPromise)(r)){let s=O&&I(O);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}tn(r)}finally{v=n,f=t;let r=l;if(l=o,r!==o&&r&&r.length>0){let s=l;qe(r),l=s}}}function gt(e,n,t){let o={fn:e,state:W,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!0,computed:!0,updatedAt:null};f&&(f.owned?f.owned.push(o):f.owned=[o]),M&&M.running?(l||(l=[]),l.indexOf(o)===-1&&l.push(o)):l?l.indexOf(o)===-1&&l.push(o):rn(o,n)}var O;function sn(){return O||(O=on())}var Pn;function Ot(){return Pn||(Pn=on())}function Rt(e){if(!e.length)return;let n=e.slice();e.length=0;for(let t of n)t.state=W,xe(t)}function At(e){let n=O&&I(O);n&&n.inFallback()?ne(()=>{n.inFallback()||e()}):e()}function Ct(e){at=e}function _t(e){let n=O&&I(O);return n&&(n.increment(),e.finally(()=>n.decrement())),e}function Et(e,n,t){return x(()=>n(e()),void 0,t)}function kt(e,n,t){return x(()=>e().filter(n),void 0,t)}function Pt(e,n,t,o){return x(()=>e().reduce(n,t),void 0,o)}function Ft(e,n,t){return x(()=>e().find(n),void 0,t)}function Ut(e,n,t){return x(()=>e().some(n),void 0,t)}function Dt(e,n,t){return x(()=>e().every(n),void 0,t)}function qt(e,n,t){return x(()=>[...e()].sort(n),void 0,t)}function Mt(e,n){return x(()=>[...new Set(e())],void 0,n)}function It(e,n,t){return x(()=>{let o=e.map(r=>r());return n(o)},void 0,t)}function Nt(...e){return new Z(n=>{let t=()=>e.map(r=>typeof r=="function"?r():r.get()),o=e.map(r=>typeof r=="function"&&r.subscribe?r.subscribe(()=>{n.next(t())}):typeof r!="function"?r.subscribe(()=>{n.next(t())}):he(()=>{n.next(t())}));return()=>{o.forEach(r=>{typeof r=="function"?r():r&&typeof r.unsubscribe=="function"&&r.unsubscribe()})}})}function Lt(e,n,t){return x(()=>e()||n(),void 0,t)}function Bt(e,n,t,o){return x(()=>t(e(),n()),void 0,o)}function Vt(e,n,t){return x(()=>n(e()),void 0,{equals:t,internal:!0})}function jt(e,n,t){return x(()=>{let o=e(),r={};for(let s of n)r[s]=o[s];return r},void 0,t)}function Gt(e,n,t){return x(()=>{let r={...e()};for(let s of n)delete r[s];return r},void 0,t)}function Kt(e,n,t,o){return x(()=>e()?n():t(),void 0,o)}function $t(e,n,t){return x(()=>e()?n():void 0,void 0,t)}function Wt(e,n,t){let[o,r]=N(e()),s;return x(()=>{let u=e();clearTimeout(s),s=setTimeout(()=>r(()=>u),n)}),o}function zt(e,n,t){let[o,r]=N(e()),s=0,u;return x(()=>{let a=e(),i=Date.now();i-s>=n?(s=i,r(()=>a)):(clearTimeout(u),u=setTimeout(()=>{s=Date.now(),r(()=>a)},n-(i-s)))}),o}function Ht(e){let n=e;for(;typeof n=="function";)n=n();return n}var re=new Map,te=new Map,Yt=0,Jt=Symbol.for("signal"),Xt=Symbol.for("resource");function Qt(e,n,t={}){let o,r,s;typeof n=="function"?(o=e,r=n,s=t):(o=()=>!0,r=e,s=n??t);let{ttl:u=1/0,name:a=`_auto_${Yt++}`,staleWhileRevalidate:i=!0}=s,d=a,y=h=>`${d}:${JSON.stringify(h)}`,T=h=>u===1/0||Date.now()-h.timestamp<=u,[w,S]=U(void 0,{equals:!1}),[g,m]=U("unresolved",{equals:!1}),[E,p]=U(void 0,{equals:!1}),[b,C]=U(void 0,{equals:!1}),[P,_]=U(!1),[z,H]=U(0,{equals:!1}),ce=Symbol("unset"),X=ce,Y=!1,A=!1;function B(h,D,q,G){if(te.has(D)){te.get(D).then(R=>{G()||V(R,q)},R=>{!G()&&!q&&le(R)}),q||C(te.get(D));return}let se=Promise.resolve(r(h)).then(R=>(re.set(D,{value:R,timestamp:Date.now()}),te.delete(D),R),R=>{throw te.delete(D),R});if(te.set(D,se),!q){ve(se),C(se);let R=oe&&I(oe);R&&(R.increment(),se.finally(()=>R.decrement()))}se.then(R=>{G()||V(R,q)},R=>{!G()&&!q&&le(R)})}function V(h,D){k(()=>{S(()=>h),m("ready"),_(!1),C(void 0),p(void 0)})}function le(h){k(()=>{p(h),m("errored"),C(void 0)})}let oe;ne(()=>{oe===void 0&&(oe=sn());let h=o();if(z(),h===!1||h===null||h===void 0){X=ce,k(()=>{m("unresolved"),C(void 0),p(void 0)});return}let D=Y,q=A;Y=!1,A=!1;let G=y(h);q&&re.delete(G);let se=X===ce||h!==X;X=h;let R=!1;be(()=>{R=!0});let ie=re.get(G);if(ie&&T(ie)&&!D&&!q){(L(g)!=="ready"||L(w)!==ie.value)&&k(()=>{S(()=>ie.value),m("ready"),_(!1),p(void 0)});return}if(ie&&i&&!q){k(()=>{S(()=>ie.value),m("ready"),_(!0),p(void 0),C(void 0)}),B(h,G,!0,()=>R);return}let un=L(g),Kn=un==="ready"||un==="refreshing";k(()=>{m(Kn?"refreshing":"pending"),p(void 0),_(!1)}),B(h,G,!1,()=>R)});let Q=(()=>{let h=E();if(h)throw h;if(g()==="pending"){let q=b();if(q)throw q}return w()});return Object.defineProperty(Q,Xt,{value:!0,enumerable:!0}),Object.defineProperty(Q,Jt,{value:!0,enumerable:!0}),Object.defineProperties(Q,{state:{get:g},loading:{get:()=>{let h=g();return h==="pending"||h==="refreshing"}},error:{get:E},latest:{get:w},stale:{get:P}}),[Q,{mutate:S,refetch:()=>{Y=!0,H(h=>h+1)},invalidate:()=>{let h=L(o);h!=null&&h!==!1&&re.delete(y(h)),A=!0,H(D=>D+1)}}]}function Zt(e){let n=`${e}:`;for(let t of re.keys())t.startsWith(n)&&re.delete(t)}function er(){re.clear(),te.clear()}function nr(e,n,t){let o=[];return ee(()=>{for(let r of o)r.dispose();o=[]}),x(()=>{let r=e()||[];return Ee(()=>{if(r.length===0){for(let i of o)i.dispose();return o=[],t?.fallback?t.fallback():[]}let s=new Map;for(let i of o)s.has(i.item)||s.set(i.item,i);let u=[],a=new Set;for(let i=0;i<r.length;i++){let d=r[i],y=s.get(d);if(y&&!a.has(y))y.setIndex(i),u.push(y),a.add(y);else{let T,w,S;Te(m=>{S=m;let[E,p]=N(i);w=p,T=n(d,E)});let g={item:d,rendered:T,dispose:S,setIndex:w};u.push(g),a.add(g)}}for(let i of o)a.has(i)||i.dispose();return o=u,u.map(i=>i.rendered)})})}function tr(e,n,t,o){let r=[],s=[];return ee(()=>{for(let u of s)u.dispose();r=[],s=[]}),x(()=>{let u=e()||[];return Ee(()=>{if(u.length===0){for(let T of s)T.dispose();return r=[],s=[],o?.fallback?o.fallback():[]}let a=new Map;for(let T=0;T<r.length;T++)a.set(r[T],s[T]);let i=[],d=[],y=new Set;for(let T=0;T<u.length;T++){let w=n(u[T]),S=a.get(w);if(S&&!y.has(w))S.setIndex(T),i.push(S);else{let g,m,E;Te(p=>{E=p;let[b,C]=N(T);m=C;let P=x(_=>{let H=(e()||[])[b()];return H??_},u[T]);g=t(P,b)}),i.push({rendered:g,dispose:E,setIndex:m})}d.push(w),y.add(w)}for(let[T,w]of a)y.has(T)||w.dispose();return r=d,s=i,i.map(T=>T.rendered)})})}function rr(e,n,t){let o=[];return ee(()=>{for(let r of o)r.dispose();o=[]}),x(()=>{let r=e()||[];return Ee(()=>{if(r.length===0){for(let i of o)i.dispose();return o=[],t?.fallback?t.fallback():[]}let s=o.length,u=r.length;for(let i=s;i<u;i++){let d,y,T,w=r[i];Te(S=>{T=S;let[g,m]=N(w);y=m,d=n(g,i)}),o.push({rendered:d,setItem:y,dispose:T})}for(let i=u;i<s;i++)o[i].dispose();u<s&&(o=o.slice(0,u));let a=Math.min(s,u);for(let i=0;i<a;i++)o[i].setItem(r[i]);return o.map(i=>i.rendered)})})}
|
|
1
|
+
"use strict";var Me=Object.defineProperty;var $n=Object.getOwnPropertyDescriptor;var Wn=Object.getOwnPropertyNames;var zn=Object.prototype.hasOwnProperty;var Hn=(e,n)=>{for(var t in n)Me(e,t,{get:n[t],enumerable:!0})},Yn=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Wn(n))!zn.call(e,r)&&r!==t&&Me(e,r,{get:()=>n[r],enumerable:!(o=$n(n,r))||o.enumerable});return e};var Jn=e=>Yn(Me({},"__esModule",{value:!0}),e);var or={};Hn(or,{$MEMO:()=>Fn,$PROXY:()=>Ze,$RESOURCE:()=>Un,$SIGNAL:()=>De,__DEV__:()=>pe,batch:()=>k,clearAllCachedResources:()=>er,clearCachedResourceNamespace:()=>Zt,combineSignal:()=>It,combineSignals:()=>Nt,createCachedResource:()=>Qt,createComputed:()=>gt,createContext:()=>on,createDebounce:()=>Rn,createDeferred:()=>On,createEffect:()=>ne,createMemo:()=>ht,createProvider:()=>Bn,createRenderEffect:()=>Vn,createResource:()=>yt,createRoot:()=>vt,createSelector:()=>gn,createSignal:()=>U,debounceSignal:()=>Wt,distinctSignal:()=>Mt,everySignal:()=>Dt,filterSignal:()=>kt,findSignal:()=>Ft,flush:()=>xt,getOwner:()=>bt,getServerData:()=>Ye,getSharedConfig:()=>dt,getSuspenseContext:()=>sn,getSuspenseListContext:()=>Ot,guardSignal:()=>$t,indexArray:()=>rr,isComponent:()=>fn,isMemo:()=>cn,isProvider:()=>pn,isResource:()=>ln,isSignal:()=>ge,isSuspense:()=>dn,keyArray:()=>tr,makeArrayFlat:()=>Le,mapArray:()=>nr,mapSignal:()=>Et,mergeSignal:()=>Lt,nextResourceId:()=>Je,omitSignal:()=>Gt,on:()=>wt,onCleanup:()=>me,onResolve:()=>At,pickSignal:()=>Vt,readChildren:()=>Ke,readSignal:()=>Ht,reduceSignal:()=>Pt,reportResourceData:()=>Xe,resumeEffects:()=>Rt,runWithOwner:()=>mt,selectSignal:()=>jt,setOwner:()=>ft,setResourceDataSink:()=>En,setResourceIdSource:()=>_n,setResourceTracker:()=>An,setScheduler:()=>Ct,setServerDataGetter:()=>Cn,sharedConfig:()=>Ue,someSignal:()=>Ut,sortSignal:()=>qt,startTransition:()=>jn,throttleSignal:()=>zt,trackPromise:()=>_t,trackResourcePromise:()=>ye,untrack:()=>L,useContext:()=>I,useTransition:()=>St,whenSignal:()=>Kt,zipSignal:()=>Bt});module.exports=Jn(or);function Ie(e){return typeof e=="function"&&!/^class\s/.test(Function.prototype.toString.call(e))}function an(e){return e==null||Array.isArray(e)||typeof e=="function"||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error?!1:typeof e=="object"}function fe(e){return e instanceof Promise||!!e&&(typeof e=="object"||typeof e=="function")&&"then"in e}var de=class e{constructor(n){this._closed=!1;this._parentOrParents=null;this._subscriptions=null;n&&(this._subscriptions=[n])}get closed(){return this._closed}unsubscribe(){if(this._closed)return;this._closed=!0;let{_parentOrParents:n,_subscriptions:t}=this;if(n instanceof e)n.remove(this);else if(n!==null)for(let o of n)o.remove(this);if(t){for(let o of t)if(Ie(o)&&!(o instanceof e))try{o()}catch(r){console.error("Error in unsubscribe function:",r)}else if(an(o)&&typeof o.unsubscribe=="function")try{o.unsubscribe()}catch(r){console.error("Error unsubscribing child:",r)}this._subscriptions=null}}add(n){if(!n||n===this)return this;if(n.closed)return this;let{_closed:t,_subscriptions:o}=this;if(t){if(Ie(n))try{n()}catch(r){console.error("Error in unsubscribe function:",r)}else if(n.unsubscribe)try{n.unsubscribe()}catch(r){console.error("Error unsubscribing:",r)}return this}return o||(this._subscriptions=[]),this._subscriptions.push(n),n instanceof e&&n._addParent(this),this}remove(n){let{_subscriptions:t}=this;if(!t)return;let o=t.indexOf(n);o!==-1&&(t.splice(o,1),n._removeParent(this))}_addParent(n){let{_parentOrParents:t}=this;t?Array.isArray(t)?t.push(n):this._parentOrParents=[t,n]:this._parentOrParents=n}_removeParent(n){let{_parentOrParents:t}=this;if(t===n)this._parentOrParents=null;else if(Array.isArray(t)){let o=t.indexOf(n);o!==-1&&(t.splice(o,1),t.length===1&&(this._parentOrParents=t[0]))}}};var we=class extends de{constructor(t,o,r){super();this.isStopped=!1;let s;t?typeof t=="object"?s=t:s={next:t,error:o,complete:r}:s={},this.destination=s}next(t){if(!this.isStopped&&this.destination.next)try{this.destination.next(t)}catch(o){this.error(o)}}error(t){if(!this.isStopped){if(this.isStopped=!0,this.destination.error)try{this.destination.error(t)}catch(o){throw o}else throw t;this.unsubscribe()}}complete(){if(!this.isStopped){if(this.isStopped=!0,this.destination.complete)try{this.destination.complete()}catch(t){this.error(t);return}this.unsubscribe()}}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}},Ne=class extends we{constructor(t,o,r,s){super(t,o,r);this._isUnsubscribing=!1;this._parentSubscriber=null;this._parentSubscriber=s||null}next(t){if(!this.isStopped&&!this._isUnsubscribing)try{super.next(t)}catch(o){this.error(o)}}error(t){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.error(t)}finally{this._isUnsubscribing=!1}}}complete(){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.complete()}finally{this._isUnsubscribing=!1}}}unsubscribe(){this.closed||(this._isUnsubscribing=!0,super.unsubscribe(),this._isUnsubscribing=!1)}};var Z=class extends de{constructor(n){if(super(),n)this._subscribe=n;else throw new TypeError("Observable constructor requires a subscribe function")}subscribe(n,t,o){let r;n instanceof we?r=n:r=new Ne(n,t,o);let{_subscribe:s}=this;try{let u=s.call(this,r);u&&(typeof u=="function"||typeof u.unsubscribe=="function")&&r.add(u)}catch(u){r.error(u)}return r}pipe(...n){return n.length===0?this:n.reduce((t,o)=>o(t),this)}toPromise(){return new Promise((n,t)=>{let o;this.subscribe({next:r=>o=r,error:t,complete:()=>n(o)})})}};var pe=!1,Xn=Symbol.for("signal"),Qn=Symbol.for("memo"),Zn=Symbol.for("resource");function ge(e){return typeof e=="function"&&e[Xn]===!0}function cn(e){return typeof e=="function"&&e[Qn]===!0}function ln(e){return typeof e=="function"&&e[Zn]===!0}function fn(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function dn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function pn(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Le(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Le(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}var et="__fluixi_signal_next_state__",nt=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},c=globalThis[et]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:nt,onSuspend:null,onError:null};var Tn=0,hn=1,Te=2,Oe=class{constructor(){this.observers=null;this.watchers=null;this.version=0}updateIfNecessary(){}track(){if(c.untracked)return;let n=c.consumer;n&&((this.observers??=new Set).add(n),(n.sources??=new Set).add(this))}},Re=class extends Oe{constructor(n,t){super(),this._value=n,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(n){if(!this._equals(this._value,n)){if(this._value=n,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(Te);Be(this)}}peek(){return this._value}},ue=class extends Oe{constructor(t,o){super();this._threw=!1;this._initialized=!1;this.state=Te;this.sources=null;this._fn=t,this._equals=o?.equals===!1?()=>!1:o?.equals??Object.is}get(){if(c.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===hn&&this.sources){for(let t of this.sources)if(t.updateIfNecessary(),this.state===Te)break}(this.state===Te||!this._initialized)&&this.recompute(),this.state=Tn}recompute(){if(this.sources){for(let i of this.sources)i.observers?.delete(this);this.sources.clear()}let t=c.consumer,o=c.untracked;c.consumer=this,c.untracked=!1;let r,s=!1,u;try{r=this._fn()}catch(i){s=!0,u=i,r=this._value}finally{c.consumer=t,c.untracked=o}let a=!this._initialized||this._threw!==s||(s?u!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=s,this._error=u,this._value=r,a){if(this.version++,this.observers)for(let i of[...this.observers])i.markDirty(Te);Be(this)}}markDirty(t){if(this.state>=t)return;let o=this.state===Tn;if(this.state=t,o){if(this.observers)for(let r of[...this.observers])r.markDirty(hn);Be(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Be(e){if(e.watchers)for(let n of[...e.watchers])n._notify(e)}var Ae=class{constructor(n){this._watched=new Set;this._pending=new Set;this._notifyFn=n}watch(...n){for(let t of n)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...n){for(let t of n)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let n=[...this._pending];return this._pending.clear(),n}_notify(n){if(!this._watched.has(n)||this._pending.has(n))return;let t=this._pending.size===0;this._pending.add(n),t&&this._notifyFn()}};function vn(e){if(c.untracked)return e();c.untracked=!0;try{return e()}finally{c.untracked=!1}}function yn(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function bn(e){return c.onSuspend?(c.onSuspend(e,c.owner),!0):!1}function Ve(){return c.owner}function _e(e,n){let t=c.owner;c.owner=e;try{return n()}finally{c.owner=t}}function ee(e){if(c.owner){if(c.owner.disposed){e();return}(c.owner.cleanups??=[]).push(e)}}function Ce(e,n=!0){if(!e.disposed){if(e.owned){for(let t=e.owned.length-1;t>=0;t--)Ce(e.owned[t]);e.owned=null}if(e.cleanups){for(let t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}n&&(e.disposed=!0)}}function he(e){let n=yn(c.owner);c.owner&&(c.owner.owned??=[]).push(n);let t=c.owner;c.owner=n;try{return e(()=>Ce(n))}finally{c.owner=t}}function mn(e){c.hostSchedule=e??(n=>{Promise.resolve().then(n)})}function tt(e){e.queued||(e.queued=!0,c.queue.push(e),!c.scheduled&&c.batchDepth===0&&(c.scheduled=!0,c.hostSchedule(Ge)))}function Ge(){if(c.scheduled=!1,c.flushing)return;c.flushing=!0;let e=0;try{for(;c.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let n=c.queue;c.queue=[];for(let t of n)t.queued=!1,t.disposed||t.run()}}finally{c.flushing=!1}}function xn(){c.batchDepth===0&&Ge()}var je=class{constructor(n){this.queued=!1;this.disposed=!1;this.owner=yn(c.owner),c.owner&&(c.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new ue(()=>{Ce(this.owner,!1),_e(this.owner,()=>{let t=n();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new Ae(()=>tt(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(n){if(n&&typeof n.then=="function"&&c.onSuspend){c.onSuspend(n,this.owner);return}if(c.onError&&c.onError(n,this.owner))return;throw n}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),Ce(this.owner))}};function Sn(e){let n=new je(e);return()=>n.dispose()}function rt(e){return!!e&&typeof e.then=="function"}mn(()=>{});var wn=Symbol.for("signal"),ot=Symbol.for("memo"),st=Symbol.for("signal-node");function N(e,n){let t=new Re(e,{equals:n?.equals}),o=(()=>t.get()),r=(s=>{let u=typeof s=="function"?s(t.peek()):s;return t.set(u),xn(),u});return Object.defineProperty(o,wn,{value:!0,enumerable:!0}),Object.defineProperty(o,st,{value:{get value(){return t.peek()},get version(){return t.version}},enumerable:!1}),[o,r]}function x(e,n,t){let o=n,r=Ve(),s=new ue(()=>_e(r,()=>{try{return o=e(o)}catch(a){if(rt(a))return bn(a),o;throw a}}),{equals:t?.equals}),u=(()=>s.get());return Object.defineProperty(u,wn,{value:!0,enumerable:!0}),Object.defineProperty(u,ot,{value:!0,enumerable:!0}),u}function ve(e,n){let t=n;return Sn(()=>{t=e(t)})}function Ee(e){return vn(e)}function gn(e,n=(t,o)=>t===o){let t=new Map;return ve(()=>{let o=e();for(let[r,s]of t){let[u,a]=s,i=n(r,o);u()!==i&&a(i)}}),o=>{let r=t.get(o);if(!r){let[s,u]=N(!1);r=[s,u],t.set(o,r);let a=e();u(n(o,a))}return r[0]()}}function On(e,n){let[t,o]=N(e(),n);return ve(()=>{let r=e();n?.timeoutMs?setTimeout(()=>o(()=>r),n.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>o(()=>r)):Promise.resolve().then(()=>o(()=>r))}),t}function Rn(e,n){let t,o=(...r)=>{t!==void 0&&clearTimeout(t),t=setTimeout(()=>{t=void 0,e(...r)},n)};return ee(()=>{t!==void 0&&clearTimeout(t)}),o}function ke(e){if(typeof e=="function"&&!e.length){let n=e();return ge(n)?n:ke(n)}if(Array.isArray(e)){let n=[];for(let t=0;t<e.length;t++){let o=ke(e[t]);Array.isArray(o)?n.push.apply(n,o):n.push(o)}return n}return e}function Ke(e){let n=x(e);return x(()=>ke(n()))}var $e=null;function An(e){$e=e}function ye(e){$e&&$e(e)}var We=null;function Cn(e){We=e}function Ye(e){return We?We(e):void 0}var ze=null;function _n(e){ze=e}function Je(){return ze?ze():void 0}var He=null;function En(e){He=e}function Xe(e,n){He&&He(e,n)}var De=Symbol.for("signal"),Fn=Symbol.for("memo"),Un=Symbol.for("resource"),Ze=Symbol("fluixi-proxy"),Dn=Symbol.for("signal-node"),K=0,be=1,W=2,$=3,f=null,v=null,l=null,Pe=null,Fe=0,it=!1,Qe=!1,ae=0,ut=1e6,F=new WeakMap,M=null;var at=null,ct=new Map,lt=0,Ue={context:null,owner:null,routeData:new Map,matchedRoute:new Map};function ft(e){f=e,Ue.owner=e,Ue.context=e}function dt(){return Ue}function pt(){return`node_${++lt}_${Date.now()}`}function Tt(e){!1}function qn(e,n,t){let o={id:pt(),type:e,value:n,version:0,equals:t?.equals,name:t?.name,created:Date.now(),updated:Date.now()};return Tt(o),o}function Mn(e,n){return e===n}function tn(e){throw typeof console<"u"&&console.error("Reactive error:",e),e}var en=null,nn=null;function In(){if(!en){let[e,n]=U(!1);en=e,nn=n}}function Nn(e){if(l)l.indexOf(e)===-1&&l.push(e);else if(M&&M.running&&!e.pure)M.effects.indexOf(e)===-1&&M.effects.push(e);else if(!e.pure||e.computed)xe(e);else if(e.pure&&!e.computed&&e.accessor){let n=v,t=l;v=null,l=[],e.accessor(),v=n;let o=l;if(l=t,o.length>0){let r=l;qe(o),l=r}}}function kn(e,n){for(let t=0;t<e.length;t++)n(e[t])}function U(e,n){let t=e;typeof t=="object"&&t&&Ze in t&&delete t[Ze];let o=qn("signal",t,{equals:n?.equals===!1?void 0:n?.equals,name:n?.name}),r=[u,a];F.set(r,new Set);let s;function u(){let i=v;if(i){i.sources?i.sources.indexOf(r)===-1&&i.sources.push(r):i.sources=[r];let d=F.get(r);d&&!d.has(i)&&d.add(i)}return t}function a(i){let d=typeof i=="function"?i(t):i,y=o.equals||Mn;if(n?.equals===!1||!y(t,d)){t=d,o.value=d,o.version++,o.updated=Date.now();let w=F.get(r);if(w&&w.size>0){let E=function(p,b=!1){let C=p.state;if(!(C===$&&p===v)){if(b&&!p.pure){C===K&&(p.state=be,it&&(l!==null&&l.indexOf(p)===-1?l.push(p):g.push(p)));return}if(!m.has(p)&&(m.add(p),p.state=W,C===K||C===be?g.push(p):!p.pure&&l!==null&&l.indexOf(p)===-1&&l.push(p),p.pure&&p.accessor)){let P=F.get(p.accessor);P&&kn(Array.from(P),_=>E(_,!0))}}};var T=E;let S=Array.from(w),g=[],m=new Set;kn(S,E);for(let p of g)Nn(p)}}}return u.toObservable=()=>new Z(i=>{let d=!0;return ne(()=>{let T=u();d?d=!1:i.next(T)})}),Object.defineProperty(u,De,{value:!0,enumerable:!0}),Object.defineProperty(u,Dn,{value:o,enumerable:!1}),r}function ne(e,n,t){let o={fn:e,state:W,sources:null,sourceSlots:null,owned:null,cleanups:null,owner:f,contexts:null,pure:!1,updatedAt:null};f&&(f.owned?f.owned.push(o):f.owned=[o]);let r=O&&I(O);return r&&(o.suspense=r),rn(o,n),()=>J(o)}function rn(e,n){if(e.sources){for(let r of e.sources){let s=F.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.owned){for(let r=0;r<e.owned.length;r++)J(e.owned[r]);e.owned=null}let t=v,o=f;if(v=e,f=e,Fe++,Fe>ut)throw Fe=0,v=t,f=o,new Error("Potential infinite loop detected. Exceeded maximum iterations.");try{e.state=$;let r=e.fn(n);typeof r=="function"&&(e.cleanups?e.cleanups.push(r):e.cleanups=[r]),e.state===$&&(e.state=K)}catch(r){if(fe(r)){let s=O&&I(O);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}tn(r)}finally{v=t,f=o}}function xe(e){if(!(e.disposed||!e.fn||e.state===K)&&(e.state===W||e.state===be||e.state===$)){if(e.cleanups){for(let n=0;n<e.cleanups.length;n++)e.cleanups[n]();e.cleanups=null}if(e.owned){for(let n=0;n<e.owned.length;n++)J(e.owned[n]);e.owned=null}e.renderEffect?Gn(e):rn(e,e.value)}}function J(e){if(e.disposed=!0,e.sources)for(let n of e.sources){let t=F.get(n);t&&t.delete(e)}if(e.cleanups)for(let n=0;n<e.cleanups.length;n++)e.cleanups[n]();if(e.owned)for(let n=0;n<e.owned.length;n++)J(e.owned[n]);if(e.owner&&e.owner.owned){let n=e.owner.owned.indexOf(e);n!==-1&&e.owner.owned.splice(n,1)}}function ht(e,n,t){let o=qn("memo",n,{equals:t?.equals===!1?void 0:t?.equals,name:t?.name}),r={fn:e,state:W,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!0,updatedAt:null,node:o,accessor:void 0};f&&(f.owned?f.owned.push(r):f.owned=[r]);let s=()=>{if(v&&v!==r){v.sources?v.sources.indexOf(s)===-1&&v.sources.push(s):v.sources=[s];let a=s;F.has(a)||F.set(a,new Set);let i=F.get(a);i&&i.add(v)}if(r.state!==K){if(r.sources){for(let d of r.sources){let y=F.get(d);y&&y.delete(r)}r.sources=null,r.sourceSlots=null}if(r.cleanups){for(let d=0;d<r.cleanups.length;d++)r.cleanups[d]();r.cleanups=null}if(r.owned){for(let d=0;d<r.owned.length;d++)J(r.owned[d]);r.owned=null}let a=v,i=f;v=r,f=r,r.state=$;try{let d=r.fn(r.value),y=o.equals||Mn;if(t?.equals===!1||!y(r.value,d)){r.value=d,o.value=d,o.version++,o.updated=Date.now();let w=s,S=F.get(w);if(S&&S.size>0){let p=function(b,C=!1){if(b===r)return;let P=b.state;if(P!==$){if(C&&!b.pure){P===K&&(b.state=be,l!==null&&l.indexOf(b)===-1?l.push(b):m.push(b));return}if(!E.has(b)&&(E.add(b),b.state=W,P===K||P===be?m.push(b):!b.pure&&l!==null&&l.indexOf(b)===-1&&l.push(b),b.pure&&b.accessor)){let _=F.get(b.accessor);if(_&&_.size>0)for(let z of Array.from(_))p(z,!0)}}};var u=p;let g=Array.from(S),m=[],E=new Set;for(let b=0;b<g.length;b++)p(g[b]);for(let b of m)Nn(b)}}r.state===$&&(r.state=K)}catch(d){if(fe(d)){let y=O&&I(O);if(!y&&O){let T=i;for(;T;){if(T.contexts?.has(O.id)){y=T.contexts.get(O.id);break}T=T.owner}}return y&&(y.increment(),d.finally(()=>y.decrement())),r.value}tn(d)}finally{v=a,f=i}}return r.value};return r.accessor=s,F.set(s,new Set),s.toObservable=()=>new Z(u=>{let a=!0;return ne(()=>{let d=s();a?a=!1:u.next(d)})}),Object.defineProperty(s,De,{value:!0,enumerable:!0}),Object.defineProperty(s,Fn,{value:!0,enumerable:!0}),Object.defineProperty(s,Dn,{value:o,enumerable:!1}),s}function qe(e){let n=[],t=[];for(let r of e)r.pure&&!r.computed&&r.accessor?n.indexOf(r)===-1&&n.push(r):(r.computed||!r.pure)&&t.indexOf(r)===-1&&t.push(r);l=[];let o=0;for(;o<n.length;){let r=n[o++],s=F.get(r.accessor);if(s&&s.size>0){let a=v;v=null,r.accessor(),v=a}let u=l.splice(0);for(let a of u)a.pure&&!a.computed&&a.accessor?n.indexOf(a)===-1&&n.push(a):(a.computed||!a.pure)&&t.indexOf(a)===-1&&t.push(a)}l=null;for(let r of t)(r.computed||!r.pure)&&xe(r)}function k(e){if(l&&ae>0)return e();if(l&&ae===0){let n=l,t=[];l=t,ae++;let o;try{o=e()}finally{ae--,l=n}let r=l;return qe(t),l=r,o}ae++,l=[],Pe=[];try{return e()}finally{ae--,Ln()}}function Ln(){if(!Qe){Qe=!0,Fe=0;try{for(;l&&l.length>0;){let e=l;l=null,qe(e)}if(l=null,Pe){let e=Pe;Pe=null;for(let n=0;n<e.length;n++)xe(e[n])}}finally{Qe=!1}}}function vt(e){let n={owned:null,cleanups:null,contexts:null,owner:f},t=v;v=null;let o=f;f=n;try{return e(()=>{if(n.owned)for(let r=0;r<n.owned.length;r++)J(n.owned[r]);if(n.cleanups)for(let r=0;r<n.cleanups.length;r++)n.cleanups[r]()})}finally{f=o,v=t}}function L(e){let n=v;v=null;try{return e()}finally{v=n}}function me(e){f&&(f.cleanups?f.cleanups.push(e):f.cleanups=[e])}function yt(e,n,t={}){let o,r;typeof n=="function"?(o=typeof e=="function"?e:()=>e,r=n):(o=()=>!0,r=e,n&&typeof n=="object"&&(t=n));let{initialValue:s,name:u}=t,a=t.transport===!1?void 0:Je(),i=a!==void 0?Ye(a):void 0,d=i!==void 0,[y,T]=U(i!==void 0?i.value:t.initialValue,{equals:!1}),[w,S]=U(void 0,{equals:!1}),[g,m]=U(i!==void 0||t.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[E,p]=U(void 0,{equals:!1}),[b,C]=U(void 0,{equals:!1}),P=Symbol(),_=P,z=!1,H=A=>{if(!(typeof localStorage>"u"))try{A&&localStorage.setItem("storage",JSON.stringify({data:A,timestamp:Date.now()}))}catch(B){console.error(`Failed to save resource to cache (${u}):`,B)}},ce=ne(()=>{let A=o?o():e;if(b(),A===!1||A===null||A===void 0){_=P,k(()=>{m("unresolved"),p(void 0),S(void 0)});return}let B=z;if(z=!1,_!==P&&A===_&&!B)return;if(_=A,d){d=!1;return}let j=!1;me(()=>j=!0);let le=L(g),oe=L(y),Q=le==="ready"||le==="refreshing";k(()=>{m(Q?"refreshing":"pending"),S(void 0)});try{let V=r(A,{value:oe,refetching:Q});if(fe(V)){p(V),ye(V),V.then(h=>{j||(a!==void 0&&Xe(a,h),k(()=>{T(()=>h),H(h),m("ready"),p(void 0)}))},h=>{j||k(()=>{S(h),m("errored"),p(void 0)})}).catch(h=>{j||k(()=>{S(h),m("errored"),p(void 0)})});let Se=O&&I(O);Se&&(Se.increment(),V.finally(()=>Se.decrement()))}else{if(j)return;k(()=>{T(()=>V),m("ready"),p(void 0)})}}catch(V){if(j)return;k(()=>{S(V),m("errored"),p(void 0)})}});me(ce);let X=()=>{let A=g();return A==="pending"||A==="refreshing"},Y=(()=>{let A=w();if(A)throw A;if(X()){let B=E();if(B)throw B}return y()});return Object.defineProperty(Y,Un,{value:!0,enumerable:!0}),Object.defineProperty(Y,De,{value:!0,enumerable:!0}),Object.defineProperties(Y,{state:{get:g},loading:{get:()=>X()},error:{get:w},latest:{get:y}}),[Y,{mutate:T,refetch:()=>{z=!0,C(void 0)}}]}function bt(){return f}function mt(e,n){let t=f,o=v;f=e,v=null;try{return n()}finally{f=t,v=o}}function on(e){let n=Symbol("context"),t=Bn(n);return{id:n,Provider:t,defaultValue:e}}function Bn(e){return n=>{let t=f;for(;t;)t.contexts||(t.contexts=new Map),t.contexts.has(e)||t.contexts.set(e,n.value),t=t.owner;let o;return Vn(()=>{o=L(()=>{let r=f;return r&&(r.contexts||(r.contexts=new Map),r.contexts.set(e,n.value)),Ke(()=>n.children)})}),o}}function I(e){let n=f;for(;n;){if(n.contexts&&n.contexts.has(e.id))return n.contexts.get(e.id);n=n.owner}if(e)return e.defaultValue}function xt(){return new Promise(e=>{queueMicrotask(()=>{Ln(),e()})})}function jn(e){if(M&&M.running)return e(),M.done;In();let n,t=new Promise(r=>n=r),o={running:!0,effects:[],resolve:n,done:t};M=o;try{e()}finally{o.running=!1}return o.effects.length?(nn(!0),Promise.resolve().then(()=>{let r=o.effects.splice(0);M=null,nn(!1),r.length&&k(()=>{for(let s of r)s.state=W,xe(s)}),n()}),t):(M=null,n(),t)}function St(){return In(),[en,jn]}function wt(e,n,t){let o=t?.defer??!1,r=!0;return s=>{let u=e();return o&&r?(r=!1,s):L(()=>n(u,s))}}function Vn(e,n,t){let o={fn:e,state:W,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!1,updatedAt:null,renderEffect:!0};f&&(f.owned?f.owned.push(o):f.owned=[o]);let r=O&&I(O);return r&&(o.suspense=r),Gn(o),()=>J(o)}function Gn(e){if(e.sources){for(let r of e.sources){let s=F.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.cleanups){for(let r=0;r<e.cleanups.length;r++)e.cleanups[r]();e.cleanups=null}if(e.owned){for(let r=0;r<e.owned.length;r++)J(e.owned[r]);e.owned=null}let n=v,t=f,o=l;v=e,f=e,l===null&&(l=[]),e.state=$;try{let r=e.fn(e.value);typeof r=="function"&&(e.cleanups||(e.cleanups=[]),e.cleanups.push(r)),e.value=r,e.state===$&&(e.state=K)}catch(r){if(fe(r)){let s=O&&I(O);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}tn(r)}finally{v=n,f=t;let r=l;if(l=o,r!==o&&r&&r.length>0){let s=l;qe(r),l=s}}}function gt(e,n,t){let o={fn:e,state:W,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!0,computed:!0,updatedAt:null};f&&(f.owned?f.owned.push(o):f.owned=[o]),M&&M.running?(l||(l=[]),l.indexOf(o)===-1&&l.push(o)):l?l.indexOf(o)===-1&&l.push(o):rn(o,n)}var O;function sn(){return O||(O=on())}var Pn;function Ot(){return Pn||(Pn=on())}function Rt(e){if(!e.length)return;let n=e.slice();e.length=0;for(let t of n)t.state=W,xe(t)}function At(e){let n=O&&I(O);n&&n.inFallback()?ne(()=>{n.inFallback()||e()}):e()}function Ct(e){at=e}function _t(e){let n=O&&I(O);return n&&(n.increment(),e.finally(()=>n.decrement())),e}function Et(e,n,t){return x(()=>n(e()),void 0,t)}function kt(e,n,t){return x(()=>e().filter(n),void 0,t)}function Pt(e,n,t,o){return x(()=>e().reduce(n,t),void 0,o)}function Ft(e,n,t){return x(()=>e().find(n),void 0,t)}function Ut(e,n,t){return x(()=>e().some(n),void 0,t)}function Dt(e,n,t){return x(()=>e().every(n),void 0,t)}function qt(e,n,t){return x(()=>[...e()].sort(n),void 0,t)}function Mt(e,n){return x(()=>[...new Set(e())],void 0,n)}function It(e,n,t){return x(()=>{let o=e.map(r=>r());return n(o)},void 0,t)}function Nt(...e){return new Z(n=>{let t=()=>e.map(r=>typeof r=="function"?r():r.get()),o=e.map(r=>typeof r=="function"&&r.subscribe?r.subscribe(()=>{n.next(t())}):typeof r!="function"?r.subscribe(()=>{n.next(t())}):ve(()=>{n.next(t())}));return()=>{o.forEach(r=>{typeof r=="function"?r():r&&typeof r.unsubscribe=="function"&&r.unsubscribe()})}})}function Lt(e,n,t){return x(()=>e()||n(),void 0,t)}function Bt(e,n,t,o){return x(()=>t(e(),n()),void 0,o)}function jt(e,n,t){return x(()=>n(e()),void 0,{equals:t,internal:!0})}function Vt(e,n,t){return x(()=>{let o=e(),r={};for(let s of n)r[s]=o[s];return r},void 0,t)}function Gt(e,n,t){return x(()=>{let r={...e()};for(let s of n)delete r[s];return r},void 0,t)}function Kt(e,n,t,o){return x(()=>e()?n():t(),void 0,o)}function $t(e,n,t){return x(()=>e()?n():void 0,void 0,t)}function Wt(e,n,t){let[o,r]=N(e()),s;return x(()=>{let u=e();clearTimeout(s),s=setTimeout(()=>r(()=>u),n)}),o}function zt(e,n,t){let[o,r]=N(e()),s=0,u;return x(()=>{let a=e(),i=Date.now();i-s>=n?(s=i,r(()=>a)):(clearTimeout(u),u=setTimeout(()=>{s=Date.now(),r(()=>a)},n-(i-s)))}),o}function Ht(e){let n=e;for(;typeof n=="function";)n=n();return n}var re=new Map,te=new Map,Yt=0,Jt=Symbol.for("signal"),Xt=Symbol.for("resource");function Qt(e,n,t={}){let o,r,s;typeof n=="function"?(o=e,r=n,s=t):(o=()=>!0,r=e,s=n??t);let{ttl:u=1/0,name:a=`_auto_${Yt++}`,staleWhileRevalidate:i=!0}=s,d=a,y=h=>`${d}:${JSON.stringify(h)}`,T=h=>u===1/0||Date.now()-h.timestamp<=u,[w,S]=U(void 0,{equals:!1}),[g,m]=U("unresolved",{equals:!1}),[E,p]=U(void 0,{equals:!1}),[b,C]=U(void 0,{equals:!1}),[P,_]=U(!1),[z,H]=U(0,{equals:!1}),ce=Symbol("unset"),X=ce,Y=!1,A=!1;function B(h,D,q,G){if(te.has(D)){te.get(D).then(R=>{G()||j(R,q)},R=>{!G()&&!q&&le(R)}),q||C(te.get(D));return}let se=Promise.resolve(r(h)).then(R=>(re.set(D,{value:R,timestamp:Date.now()}),te.delete(D),R),R=>{throw te.delete(D),R});if(te.set(D,se),!q){ye(se),C(se);let R=oe&&I(oe);R&&(R.increment(),se.finally(()=>R.decrement()))}se.then(R=>{G()||j(R,q)},R=>{!G()&&!q&&le(R)})}function j(h,D){k(()=>{S(()=>h),m("ready"),_(!1),C(void 0),p(void 0)})}function le(h){k(()=>{p(h),m("errored"),C(void 0)})}let oe;ne(()=>{oe===void 0&&(oe=sn());let h=o();if(z(),h===!1||h===null||h===void 0){X=ce,k(()=>{m("unresolved"),C(void 0),p(void 0)});return}let D=Y,q=A;Y=!1,A=!1;let G=y(h);q&&re.delete(G);let se=X===ce||h!==X;X=h;let R=!1;me(()=>{R=!0});let ie=re.get(G);if(ie&&T(ie)&&!D&&!q){(L(g)!=="ready"||L(w)!==ie.value)&&k(()=>{S(()=>ie.value),m("ready"),_(!1),p(void 0)});return}if(ie&&i&&!q){k(()=>{S(()=>ie.value),m("ready"),_(!0),p(void 0),C(void 0)}),B(h,G,!0,()=>R);return}let un=L(g),Kn=un==="ready"||un==="refreshing";k(()=>{m(Kn?"refreshing":"pending"),p(void 0),_(!1)}),B(h,G,!1,()=>R)});let Q=(()=>{let h=E();if(h)throw h;if(g()==="pending"){let q=b();if(q)throw q}return w()});return Object.defineProperty(Q,Xt,{value:!0,enumerable:!0}),Object.defineProperty(Q,Jt,{value:!0,enumerable:!0}),Object.defineProperties(Q,{state:{get:g},loading:{get:()=>{let h=g();return h==="pending"||h==="refreshing"}},error:{get:E},latest:{get:w},stale:{get:P}}),[Q,{mutate:S,refetch:()=>{Y=!0,H(h=>h+1)},invalidate:()=>{let h=L(o);h!=null&&h!==!1&&re.delete(y(h)),A=!0,H(D=>D+1)}}]}function Zt(e){let n=`${e}:`;for(let t of re.keys())t.startsWith(n)&&re.delete(t)}function er(){re.clear(),te.clear()}function nr(e,n,t){let o=[];return ee(()=>{for(let r of o)r.dispose();o=[]}),x(()=>{let r=e()||[];return Ee(()=>{if(r.length===0){for(let i of o)i.dispose();return o=[],t?.fallback?t.fallback():[]}let s=new Map;for(let i of o)s.has(i.item)||s.set(i.item,i);let u=[],a=new Set;for(let i=0;i<r.length;i++){let d=r[i],y=s.get(d);if(y&&!a.has(y))y.setIndex(i),u.push(y),a.add(y);else{let T,w,S;he(m=>{S=m;let[E,p]=N(i);w=p,T=n(d,E)});let g={item:d,rendered:T,dispose:S,setIndex:w};u.push(g),a.add(g)}}for(let i of o)a.has(i)||i.dispose();return o=u,u.map(i=>i.rendered)})})}function tr(e,n,t,o){let r=[],s=[];return ee(()=>{for(let u of s)u.dispose();r=[],s=[]}),x(()=>{let u=e()||[];return Ee(()=>{if(u.length===0){for(let T of s)T.dispose();return r=[],s=[],o?.fallback?o.fallback():[]}let a=new Map;for(let T=0;T<r.length;T++)a.set(r[T],s[T]);let i=[],d=[],y=new Set;for(let T=0;T<u.length;T++){let w=n(u[T]),S=a.get(w);if(S&&!y.has(w))S.setIndex(T),i.push(S);else{let g,m,E;he(p=>{E=p;let[b,C]=N(T);m=C;let P=x(_=>{let H=(e()||[])[b()];return H??_},u[T]);g=t(P,b)}),i.push({rendered:g,dispose:E,setIndex:m})}d.push(w),y.add(w)}for(let[T,w]of a)y.has(T)||w.dispose();return r=d,s=i,i.map(T=>T.rendered)})})}function rr(e,n,t){let o=[];return ee(()=>{for(let r of o)r.dispose();o=[]}),x(()=>{let r=e()||[];return Ee(()=>{if(r.length===0){for(let i of o)i.dispose();return o=[],t?.fallback?t.fallback():[]}let s=o.length,u=r.length;for(let i=s;i<u;i++){let d,y,T,w=r[i];he(S=>{T=S;let[g,m]=N(w);y=m,d=n(g,i)}),o.push({rendered:d,setItem:y,dispose:T})}for(let i=u;i<s;i++)o[i].dispose();u<s&&(o=o.slice(0,u));let a=Math.min(s,u);for(let i=0;i<a;i++)o[i].setItem(r[i]);return o.map(i=>i.rendered)})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject as An}from"@fluixi/utils/object";import{isFunction as Xe}from"@fluixi/utils/functions";var fe=class e{constructor(n){this._closed=!1;this._parentOrParents=null;this._subscriptions=null;n&&(this._subscriptions=[n])}get closed(){return this._closed}unsubscribe(){if(this._closed)return;this._closed=!0;let{_parentOrParents:n,_subscriptions:t}=this;if(n instanceof e)n.remove(this);else if(n!==null)for(let o of n)o.remove(this);if(t){for(let o of t)if(Xe(o)&&!(o instanceof e))try{o()}catch(r){console.error("Error in unsubscribe function:",r)}else if(An(o)&&typeof o.unsubscribe=="function")try{o.unsubscribe()}catch(r){console.error("Error unsubscribing child:",r)}this._subscriptions=null}}add(n){if(!n||n===this)return this;if(n.closed)return this;let{_closed:t,_subscriptions:o}=this;if(t){if(Xe(n))try{n()}catch(r){console.error("Error in unsubscribe function:",r)}else if(n.unsubscribe)try{n.unsubscribe()}catch(r){console.error("Error unsubscribing:",r)}return this}return o||(this._subscriptions=[]),this._subscriptions.push(n),n instanceof e&&n._addParent(this),this}remove(n){let{_subscriptions:t}=this;if(!t)return;let o=t.indexOf(n);o!==-1&&(t.splice(o,1),n._removeParent(this))}_addParent(n){let{_parentOrParents:t}=this;t?Array.isArray(t)?t.push(n):this._parentOrParents=[t,n]:this._parentOrParents=n}_removeParent(n){let{_parentOrParents:t}=this;if(t===n)this._parentOrParents=null;else if(Array.isArray(t)){let o=t.indexOf(n);o!==-1&&(t.splice(o,1),t.length===1&&(this._parentOrParents=t[0]))}}};var be=class extends fe{constructor(t,o,r){super();this.isStopped=!1;let s;t?typeof t=="object"?s=t:s={next:t,error:o,complete:r}:s={},this.destination=s}next(t){if(!this.isStopped&&this.destination.next)try{this.destination.next(t)}catch(o){this.error(o)}}error(t){if(!this.isStopped){if(this.isStopped=!0,this.destination.error)try{this.destination.error(t)}catch(o){throw o}else throw t;this.unsubscribe()}}complete(){if(!this.isStopped){if(this.isStopped=!0,this.destination.complete)try{this.destination.complete()}catch(t){this.error(t);return}this.unsubscribe()}}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}},Ue=class extends be{constructor(t,o,r,s){super(t,o,r);this._isUnsubscribing=!1;this._parentSubscriber=null;this._parentSubscriber=s||null}next(t){if(!this.isStopped&&!this._isUnsubscribing)try{super.next(t)}catch(o){this.error(o)}}error(t){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.error(t)}finally{this._isUnsubscribing=!1}}}complete(){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.complete()}finally{this._isUnsubscribing=!1}}}unsubscribe(){this.closed||(this._isUnsubscribing=!0,super.unsubscribe(),this._isUnsubscribing=!1)}};var Z=class extends fe{constructor(n){if(super(),n)this._subscribe=n;else throw new TypeError("Observable constructor requires a subscribe function")}subscribe(n,t,o){let r;n instanceof be?r=n:r=new Ue(n,t,o);let{_subscribe:s}=this;try{let u=s.call(this,r);u&&(typeof u=="function"||typeof u.unsubscribe=="function")&&r.add(u)}catch(u){r.error(u)}return r}pipe(...n){return n.length===0?this:n.reduce((t,o)=>o(t),this)}toPromise(){return new Promise((n,t)=>{let o;this.subscribe({next:r=>o=r,error:t,complete:()=>n(o)})})}};import{isPromise as Pe}from"@fluixi/utils";var me=!1,Cn=Symbol.for("signal"),_n=Symbol.for("memo"),En=Symbol.for("resource");function De(e){return typeof e=="function"&&e[Cn]===!0}function kn(e){return typeof e=="function"&&e[_n]===!0}function Pn(e){return typeof e=="function"&&e[En]===!0}function Fn(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Un(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Dn(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Qe(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Qe(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}var qn="__fluixi_signal_next_state__",Mn=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},c=globalThis[qn]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Mn,onSuspend:null,onError:null};var Ze=0,en=1,de=2,xe=class{constructor(){this.observers=null;this.watchers=null;this.version=0}updateIfNecessary(){}track(){if(c.untracked)return;let n=c.consumer;n&&((this.observers??=new Set).add(n),(n.sources??=new Set).add(this))}},Se=class extends xe{constructor(n,t){super(),this._value=n,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(n){if(!this._equals(this._value,n)){if(this._value=n,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(de);qe(this)}}peek(){return this._value}},ie=class extends xe{constructor(t,o){super();this._threw=!1;this._initialized=!1;this.state=de;this.sources=null;this._fn=t,this._equals=o?.equals===!1?()=>!1:o?.equals??Object.is}get(){if(c.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===en&&this.sources){for(let t of this.sources)if(t.updateIfNecessary(),this.state===de)break}(this.state===de||!this._initialized)&&this.recompute(),this.state=Ze}recompute(){if(this.sources){for(let i of this.sources)i.observers?.delete(this);this.sources.clear()}let t=c.consumer,o=c.untracked;c.consumer=this,c.untracked=!1;let r,s=!1,u;try{r=this._fn()}catch(i){s=!0,u=i,r=this._value}finally{c.consumer=t,c.untracked=o}let a=!this._initialized||this._threw!==s||(s?u!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=s,this._error=u,this._value=r,a){if(this.version++,this.observers)for(let i of[...this.observers])i.markDirty(de);qe(this)}}markDirty(t){if(this.state>=t)return;let o=this.state===Ze;if(this.state=t,o){if(this.observers)for(let r of[...this.observers])r.markDirty(en);qe(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function qe(e){if(e.watchers)for(let n of[...e.watchers])n._notify(e)}var we=class{constructor(n){this._watched=new Set;this._pending=new Set;this._notifyFn=n}watch(...n){for(let t of n)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...n){for(let t of n)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let n=[...this._pending];return this._pending.clear(),n}_notify(n){if(!this._watched.has(n)||this._pending.has(n))return;let t=this._pending.size===0;this._pending.add(n),t&&this._notifyFn()}};function nn(e){if(c.untracked)return e();c.untracked=!0;try{return e()}finally{c.untracked=!1}}function tn(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function rn(e){return c.onSuspend?(c.onSuspend(e,c.owner),!0):!1}function Ie(){return c.owner}function Oe(e,n){let t=c.owner;c.owner=e;try{return n()}finally{c.owner=t}}function ee(e){if(c.owner){if(c.owner.disposed){e();return}(c.owner.cleanups??=[]).push(e)}}function ge(e,n=!0){if(!e.disposed){if(e.owned){for(let t=e.owned.length-1;t>=0;t--)ge(e.owned[t]);e.owned=null}if(e.cleanups){for(let t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}n&&(e.disposed=!0)}}function pe(e){let n=tn(c.owner);c.owner&&(c.owner.owned??=[]).push(n);let t=c.owner;c.owner=n;try{return e(()=>ge(n))}finally{c.owner=t}}function on(e){c.hostSchedule=e??(n=>{Promise.resolve().then(n)})}function In(e){e.queued||(e.queued=!0,c.queue.push(e),!c.scheduled&&c.batchDepth===0&&(c.scheduled=!0,c.hostSchedule(Ne)))}function Ne(){if(c.scheduled=!1,c.flushing)return;c.flushing=!0;let e=0;try{for(;c.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let n=c.queue;c.queue=[];for(let t of n)t.queued=!1,t.disposed||t.run()}}finally{c.flushing=!1}}function sn(){c.batchDepth===0&&Ne()}var Me=class{constructor(n){this.queued=!1;this.disposed=!1;this.owner=tn(c.owner),c.owner&&(c.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new ie(()=>{ge(this.owner,!1),Oe(this.owner,()=>{let t=n();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new we(()=>In(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(n){if(n&&typeof n.then=="function"&&c.onSuspend){c.onSuspend(n,this.owner);return}if(c.onError&&c.onError(n,this.owner))return;throw n}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),ge(this.owner))}};function un(e){let n=new Me(e);return()=>n.dispose()}function Nn(e){return!!e&&typeof e.then=="function"}on(()=>{});var an=Symbol.for("signal"),Ln=Symbol.for("memo"),Bn=Symbol.for("signal-node");function I(e,n){let t=new Se(e,{equals:n?.equals}),o=(()=>t.get()),r=(s=>{let u=typeof s=="function"?s(t.peek()):s;return t.set(u),sn(),u});return Object.defineProperty(o,an,{value:!0,enumerable:!0}),Object.defineProperty(o,Bn,{value:{get value(){return t.peek()},get version(){return t.version}},enumerable:!1}),[o,r]}function x(e,n,t){let o=n,r=Ie(),s=new ie(()=>Oe(r,()=>{try{return o=e(o)}catch(a){if(Nn(a))return rn(a),o;throw a}}),{equals:t?.equals}),u=(()=>s.get());return Object.defineProperty(u,an,{value:!0,enumerable:!0}),Object.defineProperty(u,Ln,{value:!0,enumerable:!0}),u}function Te(e,n){let t=n;return un(()=>{t=e(t)})}function Re(e){return nn(e)}function Vn(e,n=(t,o)=>t===o){let t=new Map;return Te(()=>{let o=e();for(let[r,s]of t){let[u,a]=s,i=n(r,o);u()!==i&&a(i)}}),o=>{let r=t.get(o);if(!r){let[s,u]=I(!1);r=[s,u],t.set(o,r);let a=e();u(n(o,a))}return r[0]()}}function jn(e,n){let[t,o]=I(e(),n);return Te(()=>{let r=e();n?.timeoutMs?setTimeout(()=>o(()=>r),n.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>o(()=>r)):Promise.resolve().then(()=>o(()=>r))}),t}function Gn(e,n){let t,o=(...r)=>{t!==void 0&&clearTimeout(t),t=setTimeout(()=>{t=void 0,e(...r)},n)};return ee(()=>{t!==void 0&&clearTimeout(t)}),o}function Ae(e){if(typeof e=="function"&&!e.length){let n=e();return De(n)?n:Ae(n)}if(Array.isArray(e)){let n=[];for(let t=0;t<e.length;t++){let o=Ae(e[t]);Array.isArray(o)?n.push.apply(n,o):n.push(o)}return n}return e}function cn(e){let n=x(e);return x(()=>Ae(n()))}var Le=null;function Kn(e){Le=e}function Ce(e){Le&&Le(e)}var Be=null;function $n(e){Be=e}function ln(e){return Be?Be(e):void 0}var Ve=null;function Wn(e){Ve=e}function fn(){return Ve?Ve():void 0}var je=null;function zn(e){je=e}function dn(e,n){je&&je(e,n)}var ze=Symbol.for("signal"),Hn=Symbol.for("memo"),Yn=Symbol.for("resource"),pn=Symbol("fluixi-proxy"),vn=Symbol.for("signal-node"),G=0,he=1,$=2,K=3,f=null,v=null,l=null,_e=null,Ee=0,Jn=!1,Ge=!1,ue=0,Xn=1e6,P=new WeakMap,M=null;var Qn=null,Zn=new Map,et=0,Ke={context:null,owner:null,routeData:new Map,matchedRoute:new Map};function Lt(e){f=e,Ke.owner=e,Ke.context=e}function Bt(){return Ke}function nt(){return`node_${++et}_${Date.now()}`}function tt(e){!1}function yn(e,n,t){let o={id:nt(),type:e,value:n,version:0,equals:t?.equals,name:t?.name,created:Date.now(),updated:Date.now()};return tt(o),o}function bn(e,n){return e===n}function He(e){throw typeof console<"u"&&console.error("Reactive error:",e),e}var $e=null,We=null;function mn(){if(!$e){let[e,n]=q(!1);$e=e,We=n}}function xn(e){if(l)l.indexOf(e)===-1&&l.push(e);else if(M&&M.running&&!e.pure)M.effects.indexOf(e)===-1&&M.effects.push(e);else if(!e.pure||e.computed)ve(e);else if(e.pure&&!e.computed&&e.accessor){let n=v,t=l;v=null,l=[],e.accessor(),v=n;let o=l;if(l=t,o.length>0){let r=l;Fe(o),l=r}}}function Tn(e,n){for(let t=0;t<e.length;t++)n(e[t])}function q(e,n){let t=e;typeof t=="object"&&t&&pn in t&&delete t[pn];let o=yn("signal",t,{equals:n?.equals===!1?void 0:n?.equals,name:n?.name}),r=[u,a];P.set(r,new Set);let s;function u(){let i=v;if(i){i.sources?i.sources.indexOf(r)===-1&&i.sources.push(r):i.sources=[r];let d=P.get(r);d&&!d.has(i)&&d.add(i)}return t}function a(i){let d=typeof i=="function"?i(t):i,y=o.equals||bn;if(n?.equals===!1||!y(t,d)){t=d,o.value=d,o.version++,o.updated=Date.now();let w=P.get(r);if(w&&w.size>0){let E=function(p,b=!1){let C=p.state;if(!(C===K&&p===v)){if(b&&!p.pure){C===G&&(p.state=he,Jn&&(l!==null&&l.indexOf(p)===-1?l.push(p):g.push(p)));return}if(!m.has(p)&&(m.add(p),p.state=$,C===G||C===he?g.push(p):!p.pure&&l!==null&&l.indexOf(p)===-1&&l.push(p),p.pure&&p.accessor)){let k=P.get(p.accessor);k&&Tn(Array.from(k),_=>E(_,!0))}}};var T=E;let S=Array.from(w),g=[],m=new Set;Tn(S,E);for(let p of g)xn(p)}}}return u.toObservable=()=>new Z(i=>{let d=!0;return ae(()=>{let T=u();d?d=!1:i.next(T)})}),Object.defineProperty(u,ze,{value:!0,enumerable:!0}),Object.defineProperty(u,vn,{value:o,enumerable:!1}),r}function ae(e,n,t){let o={fn:e,state:$,sources:null,sourceSlots:null,owned:null,cleanups:null,owner:f,contexts:null,pure:!1,updatedAt:null};f&&(f.owned?f.owned.push(o):f.owned=[o]);let r=O&&N(O);return r&&(o.suspense=r),Ye(o,n),()=>J(o)}function Ye(e,n){if(e.sources){for(let r of e.sources){let s=P.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.owned){for(let r=0;r<e.owned.length;r++)J(e.owned[r]);e.owned=null}let t=v,o=f;if(v=e,f=e,Ee++,Ee>Xn)throw Ee=0,v=t,f=o,new Error("Potential infinite loop detected. Exceeded maximum iterations.");try{e.state=K;let r=e.fn(n);typeof r=="function"&&(e.cleanups?e.cleanups.push(r):e.cleanups=[r]),e.state===K&&(e.state=G)}catch(r){if(Pe(r)){let s=O&&N(O);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}He(r)}finally{v=t,f=o}}function ve(e){if(!(e.disposed||!e.fn||e.state===G)&&(e.state===$||e.state===he||e.state===K)){if(e.cleanups){for(let n=0;n<e.cleanups.length;n++)e.cleanups[n]();e.cleanups=null}if(e.owned){for(let n=0;n<e.owned.length;n++)J(e.owned[n]);e.owned=null}e.renderEffect?gn(e):Ye(e,e.value)}}function J(e){if(e.disposed=!0,e.sources)for(let n of e.sources){let t=P.get(n);t&&t.delete(e)}if(e.cleanups)for(let n=0;n<e.cleanups.length;n++)e.cleanups[n]();if(e.owned)for(let n=0;n<e.owned.length;n++)J(e.owned[n]);if(e.owner&&e.owner.owned){let n=e.owner.owned.indexOf(e);n!==-1&&e.owner.owned.splice(n,1)}}function jt(e,n,t){let o=yn("memo",n,{equals:t?.equals===!1?void 0:t?.equals,name:t?.name}),r={fn:e,state:$,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!0,updatedAt:null,node:o,accessor:void 0};f&&(f.owned?f.owned.push(r):f.owned=[r]);let s=()=>{if(v&&v!==r){v.sources?v.sources.indexOf(s)===-1&&v.sources.push(s):v.sources=[s];let a=s;P.has(a)||P.set(a,new Set);let i=P.get(a);i&&i.add(v)}if(r.state!==G){if(r.sources){for(let d of r.sources){let y=P.get(d);y&&y.delete(r)}r.sources=null,r.sourceSlots=null}if(r.cleanups){for(let d=0;d<r.cleanups.length;d++)r.cleanups[d]();r.cleanups=null}if(r.owned){for(let d=0;d<r.owned.length;d++)J(r.owned[d]);r.owned=null}let a=v,i=f;v=r,f=r,r.state=K;try{let d=r.fn(r.value),y=o.equals||bn;if(t?.equals===!1||!y(r.value,d)){r.value=d,o.value=d,o.version++,o.updated=Date.now();let w=s,S=P.get(w);if(S&&S.size>0){let p=function(b,C=!1){if(b===r)return;let k=b.state;if(k!==K){if(C&&!b.pure){k===G&&(b.state=he,l!==null&&l.indexOf(b)===-1?l.push(b):m.push(b));return}if(!E.has(b)&&(E.add(b),b.state=$,k===G||k===he?m.push(b):!b.pure&&l!==null&&l.indexOf(b)===-1&&l.push(b),b.pure&&b.accessor)){let _=P.get(b.accessor);if(_&&_.size>0)for(let z of Array.from(_))p(z,!0)}}};var u=p;let g=Array.from(S),m=[],E=new Set;for(let b=0;b<g.length;b++)p(g[b]);for(let b of m)xn(b)}}r.state===K&&(r.state=G)}catch(d){if(Pe(d)){let y=O&&N(O);if(!y&&O){let T=i;for(;T;){if(T.contexts?.has(O.id)){y=T.contexts.get(O.id);break}T=T.owner}}return y&&(y.increment(),d.finally(()=>y.decrement())),r.value}He(d)}finally{v=a,f=i}}return r.value};return r.accessor=s,P.set(s,new Set),s.toObservable=()=>new Z(u=>{let a=!0;return ae(()=>{let d=s();a?a=!1:u.next(d)})}),Object.defineProperty(s,ze,{value:!0,enumerable:!0}),Object.defineProperty(s,Hn,{value:!0,enumerable:!0}),Object.defineProperty(s,vn,{value:o,enumerable:!1}),s}function Fe(e){let n=[],t=[];for(let r of e)r.pure&&!r.computed&&r.accessor?n.indexOf(r)===-1&&n.push(r):(r.computed||!r.pure)&&t.indexOf(r)===-1&&t.push(r);l=[];let o=0;for(;o<n.length;){let r=n[o++],s=P.get(r.accessor);if(s&&s.size>0){let a=v;v=null,r.accessor(),v=a}let u=l.splice(0);for(let a of u)a.pure&&!a.computed&&a.accessor?n.indexOf(a)===-1&&n.push(a):(a.computed||!a.pure)&&t.indexOf(a)===-1&&t.push(a)}l=null;for(let r of t)(r.computed||!r.pure)&&ve(r)}function F(e){if(l&&ue>0)return e();if(l&&ue===0){let n=l,t=[];l=t,ue++;let o;try{o=e()}finally{ue--,l=n}let r=l;return Fe(t),l=r,o}ue++,l=[],_e=[];try{return e()}finally{ue--,Sn()}}function Sn(){if(!Ge){Ge=!0,Ee=0;try{for(;l&&l.length>0;){let e=l;l=null,Fe(e)}if(l=null,_e){let e=_e;_e=null;for(let n=0;n<e.length;n++)ve(e[n])}}finally{Ge=!1}}}function Gt(e){let n={owned:null,cleanups:null,contexts:null,owner:f},t=v;v=null;let o=f;f=n;try{return e(()=>{if(n.owned)for(let r=0;r<n.owned.length;r++)J(n.owned[r]);if(n.cleanups)for(let r=0;r<n.cleanups.length;r++)n.cleanups[r]()})}finally{f=o,v=t}}function W(e){let n=v;v=null;try{return e()}finally{v=n}}function ke(e){f&&(f.cleanups?f.cleanups.push(e):f.cleanups=[e])}function Kt(e,n,t={}){let o,r;typeof n=="function"?(o=typeof e=="function"?e:()=>e,r=n):(o=()=>!0,r=e,n&&typeof n=="object"&&(t=n));let{initialValue:s,name:u}=t,a=t.transport===!1?void 0:fn(),i=a!==void 0?ln(a):void 0,d=i!==void 0,[y,T]=q(i!==void 0?i.value:t.initialValue,{equals:!1}),[w,S]=q(void 0,{equals:!1}),[g,m]=q(i!==void 0||t.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[E,p]=q(void 0,{equals:!1}),[b,C]=q(void 0,{equals:!1}),k=Symbol(),_=k,z=!1,H=A=>{if(!(typeof localStorage>"u"))try{A&&localStorage.setItem("storage",JSON.stringify({data:A,timestamp:Date.now()}))}catch(L){console.error(`Failed to save resource to cache (${u}):`,L)}},ce=ae(()=>{let A=o?o():e;if(b(),A===!1||A===null||A===void 0){_=k,F(()=>{m("unresolved"),p(void 0),S(void 0)});return}let L=z;if(z=!1,_!==k&&A===_&&!L)return;if(_=A,d){d=!1;return}let B=!1;ke(()=>B=!0);let le=W(g),re=W(y),Q=le==="ready"||le==="refreshing";F(()=>{m(Q?"refreshing":"pending"),S(void 0)});try{let V=r(A,{value:re,refetching:Q});if(Pe(V)){p(V),Ce(V),V.then(h=>{B||(a!==void 0&&dn(a,h),F(()=>{T(()=>h),H(h),m("ready"),p(void 0)}))},h=>{B||F(()=>{S(h),m("errored"),p(void 0)})}).catch(h=>{B||F(()=>{S(h),m("errored"),p(void 0)})});let ye=O&&N(O);ye&&(ye.increment(),V.finally(()=>ye.decrement()))}else{if(B)return;F(()=>{T(()=>V),m("ready"),p(void 0)})}}catch(V){if(B)return;F(()=>{S(V),m("errored"),p(void 0)})}});ke(ce);let X=()=>{let A=g();return A==="pending"||A==="refreshing"},Y=(()=>{let A=w();if(A)throw A;if(X()){let L=E();if(L)throw L}return y()});return Object.defineProperty(Y,Yn,{value:!0,enumerable:!0}),Object.defineProperty(Y,ze,{value:!0,enumerable:!0}),Object.defineProperties(Y,{state:{get:g},loading:{get:()=>X()},error:{get:w},latest:{get:y}}),[Y,{mutate:T,refetch:()=>{z=!0,C(void 0)}}]}function $t(){return f}function Wt(e,n){let t=f,o=v;f=e,v=null;try{return n()}finally{f=t,v=o}}function wn(e){let n=Symbol("context"),t=rt(n);return{id:n,Provider:t,defaultValue:e}}function rt(e){return n=>{let t=f;for(;t;)t.contexts||(t.contexts=new Map),t.contexts.has(e)||t.contexts.set(e,n.value),t=t.owner;let o;return st(()=>{o=W(()=>{let r=f;return r&&(r.contexts||(r.contexts=new Map),r.contexts.set(e,n.value)),cn(()=>n.children)})}),o}}function N(e){let n=f;for(;n;){if(n.contexts&&n.contexts.has(e.id))return n.contexts.get(e.id);n=n.owner}if(e)return e.defaultValue}function zt(){return new Promise(e=>{queueMicrotask(()=>{Sn(),e()})})}function ot(e){if(M&&M.running)return e(),M.done;mn();let n,t=new Promise(r=>n=r),o={running:!0,effects:[],resolve:n,done:t};M=o;try{e()}finally{o.running=!1}return o.effects.length?(We(!0),Promise.resolve().then(()=>{let r=o.effects.splice(0);M=null,We(!1),r.length&&F(()=>{for(let s of r)s.state=$,ve(s)}),n()}),t):(M=null,n(),t)}function Ht(){return mn(),[$e,ot]}function Yt(e,n,t){let o=t?.defer??!1,r=!0;return s=>{let u=e();return o&&r?(r=!1,s):W(()=>n(u,s))}}function st(e,n,t){let o={fn:e,state:$,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!1,updatedAt:null,renderEffect:!0};f&&(f.owned?f.owned.push(o):f.owned=[o]);let r=O&&N(O);return r&&(o.suspense=r),gn(o),()=>J(o)}function gn(e){if(e.sources){for(let r of e.sources){let s=P.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.cleanups){for(let r=0;r<e.cleanups.length;r++)e.cleanups[r]();e.cleanups=null}if(e.owned){for(let r=0;r<e.owned.length;r++)J(e.owned[r]);e.owned=null}let n=v,t=f,o=l;v=e,f=e,l===null&&(l=[]),e.state=K;try{let r=e.fn(e.value);typeof r=="function"&&(e.cleanups||(e.cleanups=[]),e.cleanups.push(r)),e.value=r,e.state===K&&(e.state=G)}catch(r){if(Pe(r)){let s=O&&N(O);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}He(r)}finally{v=n,f=t;let r=l;if(l=o,r!==o&&r&&r.length>0){let s=l;Fe(r),l=s}}}function Jt(e,n,t){let o={fn:e,state:$,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!0,computed:!0,updatedAt:null};f&&(f.owned?f.owned.push(o):f.owned=[o]),M&&M.running?(l||(l=[]),l.indexOf(o)===-1&&l.push(o)):l?l.indexOf(o)===-1&&l.push(o):Ye(o,n)}var O;function On(){return O||(O=wn())}var hn;function Xt(){return hn||(hn=wn())}function Qt(e){if(!e.length)return;let n=e.slice();e.length=0;for(let t of n)t.state=$,ve(t)}function Zt(e){let n=O&&N(O);n&&n.inFallback()?ae(()=>{n.inFallback()||e()}):e()}function er(e){Qn=e}function nr(e){let n=O&&N(O);return n&&(n.increment(),e.finally(()=>n.decrement())),e}function sr(e,n,t){return x(()=>n(e()),void 0,t)}function ir(e,n,t){return x(()=>e().filter(n),void 0,t)}function ur(e,n,t,o){return x(()=>e().reduce(n,t),void 0,o)}function ar(e,n,t){return x(()=>e().find(n),void 0,t)}function cr(e,n,t){return x(()=>e().some(n),void 0,t)}function lr(e,n,t){return x(()=>e().every(n),void 0,t)}function fr(e,n,t){return x(()=>[...e()].sort(n),void 0,t)}function dr(e,n){return x(()=>[...new Set(e())],void 0,n)}function pr(e,n,t){return x(()=>{let o=e.map(r=>r());return n(o)},void 0,t)}function Tr(...e){return new Z(n=>{let t=()=>e.map(r=>typeof r=="function"?r():r.get()),o=e.map(r=>typeof r=="function"&&r.subscribe?r.subscribe(()=>{n.next(t())}):typeof r!="function"?r.subscribe(()=>{n.next(t())}):Te(()=>{n.next(t())}));return()=>{o.forEach(r=>{typeof r=="function"?r():r&&typeof r.unsubscribe=="function"&&r.unsubscribe()})}})}function hr(e,n,t){return x(()=>e()||n(),void 0,t)}function vr(e,n,t,o){return x(()=>t(e(),n()),void 0,o)}function yr(e,n,t){return x(()=>n(e()),void 0,{equals:t,internal:!0})}function br(e,n,t){return x(()=>{let o=e(),r={};for(let s of n)r[s]=o[s];return r},void 0,t)}function mr(e,n,t){return x(()=>{let r={...e()};for(let s of n)delete r[s];return r},void 0,t)}function xr(e,n,t,o){return x(()=>e()?n():t(),void 0,o)}function Sr(e,n,t){return x(()=>e()?n():void 0,void 0,t)}function wr(e,n,t){let[o,r]=I(e()),s;return x(()=>{let u=e();clearTimeout(s),s=setTimeout(()=>r(()=>u),n)}),o}function gr(e,n,t){let[o,r]=I(e()),s=0,u;return x(()=>{let a=e(),i=Date.now();i-s>=n?(s=i,r(()=>a)):(clearTimeout(u),u=setTimeout(()=>{s=Date.now(),r(()=>a)},n-(i-s)))}),o}function Or(e){let n=e;for(;typeof n=="function";)n=n();return n}var te=new Map,ne=new Map,it=0,ut=Symbol.for("signal"),at=Symbol.for("resource");function Cr(e,n,t={}){let o,r,s;typeof n=="function"?(o=e,r=n,s=t):(o=()=>!0,r=e,s=n??t);let{ttl:u=1/0,name:a=`_auto_${it++}`,staleWhileRevalidate:i=!0}=s,d=a,y=h=>`${d}:${JSON.stringify(h)}`,T=h=>u===1/0||Date.now()-h.timestamp<=u,[w,S]=q(void 0,{equals:!1}),[g,m]=q("unresolved",{equals:!1}),[E,p]=q(void 0,{equals:!1}),[b,C]=q(void 0,{equals:!1}),[k,_]=q(!1),[z,H]=q(0,{equals:!1}),ce=Symbol("unset"),X=ce,Y=!1,A=!1;function L(h,U,D,j){if(ne.has(U)){ne.get(U).then(R=>{j()||B(R,D)},R=>{!j()&&!D&&le(R)}),D||C(ne.get(U));return}let oe=Promise.resolve(r(h)).then(R=>(te.set(U,{value:R,timestamp:Date.now()}),ne.delete(U),R),R=>{throw ne.delete(U),R});if(ne.set(U,oe),!D){Ce(oe),C(oe);let R=re&&N(re);R&&(R.increment(),oe.finally(()=>R.decrement()))}oe.then(R=>{j()||B(R,D)},R=>{!j()&&!D&&le(R)})}function B(h,U){F(()=>{S(()=>h),m("ready"),_(!1),C(void 0),p(void 0)})}function le(h){F(()=>{p(h),m("errored"),C(void 0)})}let re;ae(()=>{re===void 0&&(re=On());let h=o();if(z(),h===!1||h===null||h===void 0){X=ce,F(()=>{m("unresolved"),C(void 0),p(void 0)});return}let U=Y,D=A;Y=!1,A=!1;let j=y(h);D&&te.delete(j);let oe=X===ce||h!==X;X=h;let R=!1;ke(()=>{R=!0});let se=te.get(j);if(se&&T(se)&&!U&&!D){(W(g)!=="ready"||W(w)!==se.value)&&F(()=>{S(()=>se.value),m("ready"),_(!1),p(void 0)});return}if(se&&i&&!D){F(()=>{S(()=>se.value),m("ready"),_(!0),p(void 0),C(void 0)}),L(h,j,!0,()=>R);return}let Je=W(g),Rn=Je==="ready"||Je==="refreshing";F(()=>{m(Rn?"refreshing":"pending"),p(void 0),_(!1)}),L(h,j,!1,()=>R)});let Q=(()=>{let h=E();if(h)throw h;if(g()==="pending"){let D=b();if(D)throw D}return w()});return Object.defineProperty(Q,at,{value:!0,enumerable:!0}),Object.defineProperty(Q,ut,{value:!0,enumerable:!0}),Object.defineProperties(Q,{state:{get:g},loading:{get:()=>{let h=g();return h==="pending"||h==="refreshing"}},error:{get:E},latest:{get:w},stale:{get:k}}),[Q,{mutate:S,refetch:()=>{Y=!0,H(h=>h+1)},invalidate:()=>{let h=W(o);h!=null&&h!==!1&&te.delete(y(h)),A=!0,H(U=>U+1)}}]}function _r(e){let n=`${e}:`;for(let t of te.keys())t.startsWith(n)&&te.delete(t)}function Er(){te.clear(),ne.clear()}function Fr(e,n,t){let o=[];return ee(()=>{for(let r of o)r.dispose();o=[]}),x(()=>{let r=e()||[];return Re(()=>{if(r.length===0){for(let i of o)i.dispose();return o=[],t?.fallback?t.fallback():[]}let s=new Map;for(let i of o)s.has(i.item)||s.set(i.item,i);let u=[],a=new Set;for(let i=0;i<r.length;i++){let d=r[i],y=s.get(d);if(y&&!a.has(y))y.setIndex(i),u.push(y),a.add(y);else{let T,w,S;pe(m=>{S=m;let[E,p]=I(i);w=p,T=n(d,E)});let g={item:d,rendered:T,dispose:S,setIndex:w};u.push(g),a.add(g)}}for(let i of o)a.has(i)||i.dispose();return o=u,u.map(i=>i.rendered)})})}function Ur(e,n,t,o){let r=[],s=[];return ee(()=>{for(let u of s)u.dispose();r=[],s=[]}),x(()=>{let u=e()||[];return Re(()=>{if(u.length===0){for(let T of s)T.dispose();return r=[],s=[],o?.fallback?o.fallback():[]}let a=new Map;for(let T=0;T<r.length;T++)a.set(r[T],s[T]);let i=[],d=[],y=new Set;for(let T=0;T<u.length;T++){let w=n(u[T]),S=a.get(w);if(S&&!y.has(w))S.setIndex(T),i.push(S);else{let g,m,E;pe(p=>{E=p;let[b,C]=I(T);m=C;let k=x(_=>{let H=(e()||[])[b()];return H??_},u[T]);g=t(k,b)}),i.push({rendered:g,dispose:E,setIndex:m})}d.push(w),y.add(w)}for(let[T,w]of a)y.has(T)||w.dispose();return r=d,s=i,i.map(T=>T.rendered)})})}function Dr(e,n,t){let o=[];return ee(()=>{for(let r of o)r.dispose();o=[]}),x(()=>{let r=e()||[];return Re(()=>{if(r.length===0){for(let i of o)i.dispose();return o=[],t?.fallback?t.fallback():[]}let s=o.length,u=r.length;for(let i=s;i<u;i++){let d,y,T,w=r[i];pe(S=>{T=S;let[g,m]=I(w);y=m,d=n(g,i)}),o.push({rendered:d,setItem:y,dispose:T})}for(let i=u;i<s;i++)o[i].dispose();u<s&&(o=o.slice(0,u));let a=Math.min(s,u);for(let i=0;i<a;i++)o[i].setItem(r[i]);return o.map(i=>i.rendered)})})}export{Hn as $MEMO,pn as $PROXY,Yn as $RESOURCE,ze as $SIGNAL,me as __DEV__,F as batch,Er as clearAllCachedResources,_r as clearCachedResourceNamespace,pr as combineSignal,Tr as combineSignals,Cr as createCachedResource,Jt as createComputed,wn as createContext,Gn as createDebounce,jn as createDeferred,ae as createEffect,jt as createMemo,rt as createProvider,st as createRenderEffect,Kt as createResource,Gt as createRoot,Vn as createSelector,q as createSignal,wr as debounceSignal,dr as distinctSignal,lr as everySignal,ir as filterSignal,ar as findSignal,zt as flush,$t as getOwner,ln as getServerData,Bt as getSharedConfig,On as getSuspenseContext,Xt as getSuspenseListContext,Sr as guardSignal,Dr as indexArray,Fn as isComponent,kn as isMemo,Dn as isProvider,Pn as isResource,De as isSignal,Un as isSuspense,Ur as keyArray,Qe as makeArrayFlat,Fr as mapArray,sr as mapSignal,hr as mergeSignal,fn as nextResourceId,mr as omitSignal,Yt as on,ke as onCleanup,Zt as onResolve,br as pickSignal,cn as readChildren,Or as readSignal,ur as reduceSignal,dn as reportResourceData,Qt as resumeEffects,Wt as runWithOwner,yr as selectSignal,Lt as setOwner,zn as setResourceDataSink,Wn as setResourceIdSource,Kn as setResourceTracker,er as setScheduler,$n as setServerDataGetter,Ke as sharedConfig,cr as someSignal,fr as sortSignal,ot as startTransition,gr as throttleSignal,nr as trackPromise,Ce as trackResourcePromise,W as untrack,N as useContext,Ht as useTransition,xr as whenSignal,vr as zipSignal};
|
|
1
|
+
function Ue(e){return typeof e=="function"&&!/^class\s/.test(Function.prototype.toString.call(e))}function Qe(e){return e==null||Array.isArray(e)||typeof e=="function"||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error?!1:typeof e=="object"}function fe(e){return e instanceof Promise||!!e&&(typeof e=="object"||typeof e=="function")&&"then"in e}var de=class e{constructor(n){this._closed=!1;this._parentOrParents=null;this._subscriptions=null;n&&(this._subscriptions=[n])}get closed(){return this._closed}unsubscribe(){if(this._closed)return;this._closed=!0;let{_parentOrParents:n,_subscriptions:t}=this;if(n instanceof e)n.remove(this);else if(n!==null)for(let o of n)o.remove(this);if(t){for(let o of t)if(Ue(o)&&!(o instanceof e))try{o()}catch(r){console.error("Error in unsubscribe function:",r)}else if(Qe(o)&&typeof o.unsubscribe=="function")try{o.unsubscribe()}catch(r){console.error("Error unsubscribing child:",r)}this._subscriptions=null}}add(n){if(!n||n===this)return this;if(n.closed)return this;let{_closed:t,_subscriptions:o}=this;if(t){if(Ue(n))try{n()}catch(r){console.error("Error in unsubscribe function:",r)}else if(n.unsubscribe)try{n.unsubscribe()}catch(r){console.error("Error unsubscribing:",r)}return this}return o||(this._subscriptions=[]),this._subscriptions.push(n),n instanceof e&&n._addParent(this),this}remove(n){let{_subscriptions:t}=this;if(!t)return;let o=t.indexOf(n);o!==-1&&(t.splice(o,1),n._removeParent(this))}_addParent(n){let{_parentOrParents:t}=this;t?Array.isArray(t)?t.push(n):this._parentOrParents=[t,n]:this._parentOrParents=n}_removeParent(n){let{_parentOrParents:t}=this;if(t===n)this._parentOrParents=null;else if(Array.isArray(t)){let o=t.indexOf(n);o!==-1&&(t.splice(o,1),t.length===1&&(this._parentOrParents=t[0]))}}};var me=class extends de{constructor(t,o,r){super();this.isStopped=!1;let s;t?typeof t=="object"?s=t:s={next:t,error:o,complete:r}:s={},this.destination=s}next(t){if(!this.isStopped&&this.destination.next)try{this.destination.next(t)}catch(o){this.error(o)}}error(t){if(!this.isStopped){if(this.isStopped=!0,this.destination.error)try{this.destination.error(t)}catch(o){throw o}else throw t;this.unsubscribe()}}complete(){if(!this.isStopped){if(this.isStopped=!0,this.destination.complete)try{this.destination.complete()}catch(t){this.error(t);return}this.unsubscribe()}}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}},De=class extends me{constructor(t,o,r,s){super(t,o,r);this._isUnsubscribing=!1;this._parentSubscriber=null;this._parentSubscriber=s||null}next(t){if(!this.isStopped&&!this._isUnsubscribing)try{super.next(t)}catch(o){this.error(o)}}error(t){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.error(t)}finally{this._isUnsubscribing=!1}}}complete(){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.complete()}finally{this._isUnsubscribing=!1}}}unsubscribe(){this.closed||(this._isUnsubscribing=!0,super.unsubscribe(),this._isUnsubscribing=!1)}};var Z=class extends de{constructor(n){if(super(),n)this._subscribe=n;else throw new TypeError("Observable constructor requires a subscribe function")}subscribe(n,t,o){let r;n instanceof me?r=n:r=new De(n,t,o);let{_subscribe:s}=this;try{let u=s.call(this,r);u&&(typeof u=="function"||typeof u.unsubscribe=="function")&&r.add(u)}catch(u){r.error(u)}return r}pipe(...n){return n.length===0?this:n.reduce((t,o)=>o(t),this)}toPromise(){return new Promise((n,t)=>{let o;this.subscribe({next:r=>o=r,error:t,complete:()=>n(o)})})}};var xe=!1,Cn=Symbol.for("signal"),_n=Symbol.for("memo"),En=Symbol.for("resource");function qe(e){return typeof e=="function"&&e[Cn]===!0}function kn(e){return typeof e=="function"&&e[_n]===!0}function Pn(e){return typeof e=="function"&&e[En]===!0}function Fn(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Un(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Dn(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Ze(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Ze(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}var qn="__fluixi_signal_next_state__",Mn=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},c=globalThis[qn]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Mn,onSuspend:null,onError:null};var en=0,nn=1,pe=2,Se=class{constructor(){this.observers=null;this.watchers=null;this.version=0}updateIfNecessary(){}track(){if(c.untracked)return;let n=c.consumer;n&&((this.observers??=new Set).add(n),(n.sources??=new Set).add(this))}},we=class extends Se{constructor(n,t){super(),this._value=n,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(n){if(!this._equals(this._value,n)){if(this._value=n,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(pe);Me(this)}}peek(){return this._value}},ie=class extends Se{constructor(t,o){super();this._threw=!1;this._initialized=!1;this.state=pe;this.sources=null;this._fn=t,this._equals=o?.equals===!1?()=>!1:o?.equals??Object.is}get(){if(c.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===nn&&this.sources){for(let t of this.sources)if(t.updateIfNecessary(),this.state===pe)break}(this.state===pe||!this._initialized)&&this.recompute(),this.state=en}recompute(){if(this.sources){for(let i of this.sources)i.observers?.delete(this);this.sources.clear()}let t=c.consumer,o=c.untracked;c.consumer=this,c.untracked=!1;let r,s=!1,u;try{r=this._fn()}catch(i){s=!0,u=i,r=this._value}finally{c.consumer=t,c.untracked=o}let a=!this._initialized||this._threw!==s||(s?u!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=s,this._error=u,this._value=r,a){if(this.version++,this.observers)for(let i of[...this.observers])i.markDirty(pe);Me(this)}}markDirty(t){if(this.state>=t)return;let o=this.state===en;if(this.state=t,o){if(this.observers)for(let r of[...this.observers])r.markDirty(nn);Me(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Me(e){if(e.watchers)for(let n of[...e.watchers])n._notify(e)}var ge=class{constructor(n){this._watched=new Set;this._pending=new Set;this._notifyFn=n}watch(...n){for(let t of n)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...n){for(let t of n)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let n=[...this._pending];return this._pending.clear(),n}_notify(n){if(!this._watched.has(n)||this._pending.has(n))return;let t=this._pending.size===0;this._pending.add(n),t&&this._notifyFn()}};function tn(e){if(c.untracked)return e();c.untracked=!0;try{return e()}finally{c.untracked=!1}}function rn(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function on(e){return c.onSuspend?(c.onSuspend(e,c.owner),!0):!1}function Ne(){return c.owner}function Re(e,n){let t=c.owner;c.owner=e;try{return n()}finally{c.owner=t}}function ee(e){if(c.owner){if(c.owner.disposed){e();return}(c.owner.cleanups??=[]).push(e)}}function Oe(e,n=!0){if(!e.disposed){if(e.owned){for(let t=e.owned.length-1;t>=0;t--)Oe(e.owned[t]);e.owned=null}if(e.cleanups){for(let t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}n&&(e.disposed=!0)}}function Te(e){let n=rn(c.owner);c.owner&&(c.owner.owned??=[]).push(n);let t=c.owner;c.owner=n;try{return e(()=>Oe(n))}finally{c.owner=t}}function sn(e){c.hostSchedule=e??(n=>{Promise.resolve().then(n)})}function In(e){e.queued||(e.queued=!0,c.queue.push(e),!c.scheduled&&c.batchDepth===0&&(c.scheduled=!0,c.hostSchedule(Le)))}function Le(){if(c.scheduled=!1,c.flushing)return;c.flushing=!0;let e=0;try{for(;c.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let n=c.queue;c.queue=[];for(let t of n)t.queued=!1,t.disposed||t.run()}}finally{c.flushing=!1}}function un(){c.batchDepth===0&&Le()}var Ie=class{constructor(n){this.queued=!1;this.disposed=!1;this.owner=rn(c.owner),c.owner&&(c.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new ie(()=>{Oe(this.owner,!1),Re(this.owner,()=>{let t=n();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new ge(()=>In(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(n){if(n&&typeof n.then=="function"&&c.onSuspend){c.onSuspend(n,this.owner);return}if(c.onError&&c.onError(n,this.owner))return;throw n}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),Oe(this.owner))}};function an(e){let n=new Ie(e);return()=>n.dispose()}function Nn(e){return!!e&&typeof e.then=="function"}sn(()=>{});var cn=Symbol.for("signal"),Ln=Symbol.for("memo"),Bn=Symbol.for("signal-node");function I(e,n){let t=new we(e,{equals:n?.equals}),o=(()=>t.get()),r=(s=>{let u=typeof s=="function"?s(t.peek()):s;return t.set(u),un(),u});return Object.defineProperty(o,cn,{value:!0,enumerable:!0}),Object.defineProperty(o,Bn,{value:{get value(){return t.peek()},get version(){return t.version}},enumerable:!1}),[o,r]}function x(e,n,t){let o=n,r=Ne(),s=new ie(()=>Re(r,()=>{try{return o=e(o)}catch(a){if(Nn(a))return on(a),o;throw a}}),{equals:t?.equals}),u=(()=>s.get());return Object.defineProperty(u,cn,{value:!0,enumerable:!0}),Object.defineProperty(u,Ln,{value:!0,enumerable:!0}),u}function he(e,n){let t=n;return an(()=>{t=e(t)})}function Ae(e){return tn(e)}function jn(e,n=(t,o)=>t===o){let t=new Map;return he(()=>{let o=e();for(let[r,s]of t){let[u,a]=s,i=n(r,o);u()!==i&&a(i)}}),o=>{let r=t.get(o);if(!r){let[s,u]=I(!1);r=[s,u],t.set(o,r);let a=e();u(n(o,a))}return r[0]()}}function Vn(e,n){let[t,o]=I(e(),n);return he(()=>{let r=e();n?.timeoutMs?setTimeout(()=>o(()=>r),n.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>o(()=>r)):Promise.resolve().then(()=>o(()=>r))}),t}function Gn(e,n){let t,o=(...r)=>{t!==void 0&&clearTimeout(t),t=setTimeout(()=>{t=void 0,e(...r)},n)};return ee(()=>{t!==void 0&&clearTimeout(t)}),o}function Ce(e){if(typeof e=="function"&&!e.length){let n=e();return qe(n)?n:Ce(n)}if(Array.isArray(e)){let n=[];for(let t=0;t<e.length;t++){let o=Ce(e[t]);Array.isArray(o)?n.push.apply(n,o):n.push(o)}return n}return e}function ln(e){let n=x(e);return x(()=>Ce(n()))}var Be=null;function Kn(e){Be=e}function _e(e){Be&&Be(e)}var je=null;function $n(e){je=e}function fn(e){return je?je(e):void 0}var Ve=null;function Wn(e){Ve=e}function dn(){return Ve?Ve():void 0}var Ge=null;function zn(e){Ge=e}function pn(e,n){Ge&&Ge(e,n)}var He=Symbol.for("signal"),Hn=Symbol.for("memo"),Yn=Symbol.for("resource"),Tn=Symbol("fluixi-proxy"),yn=Symbol.for("signal-node"),G=0,ve=1,$=2,K=3,f=null,v=null,l=null,Ee=null,ke=0,Jn=!1,Ke=!1,ue=0,Xn=1e6,P=new WeakMap,M=null;var Qn=null,Zn=new Map,et=0,$e={context:null,owner:null,routeData:new Map,matchedRoute:new Map};function Bt(e){f=e,$e.owner=e,$e.context=e}function jt(){return $e}function nt(){return`node_${++et}_${Date.now()}`}function tt(e){!1}function bn(e,n,t){let o={id:nt(),type:e,value:n,version:0,equals:t?.equals,name:t?.name,created:Date.now(),updated:Date.now()};return tt(o),o}function mn(e,n){return e===n}function Ye(e){throw typeof console<"u"&&console.error("Reactive error:",e),e}var We=null,ze=null;function xn(){if(!We){let[e,n]=q(!1);We=e,ze=n}}function Sn(e){if(l)l.indexOf(e)===-1&&l.push(e);else if(M&&M.running&&!e.pure)M.effects.indexOf(e)===-1&&M.effects.push(e);else if(!e.pure||e.computed)ye(e);else if(e.pure&&!e.computed&&e.accessor){let n=v,t=l;v=null,l=[],e.accessor(),v=n;let o=l;if(l=t,o.length>0){let r=l;Fe(o),l=r}}}function hn(e,n){for(let t=0;t<e.length;t++)n(e[t])}function q(e,n){let t=e;typeof t=="object"&&t&&Tn in t&&delete t[Tn];let o=bn("signal",t,{equals:n?.equals===!1?void 0:n?.equals,name:n?.name}),r=[u,a];P.set(r,new Set);let s;function u(){let i=v;if(i){i.sources?i.sources.indexOf(r)===-1&&i.sources.push(r):i.sources=[r];let d=P.get(r);d&&!d.has(i)&&d.add(i)}return t}function a(i){let d=typeof i=="function"?i(t):i,y=o.equals||mn;if(n?.equals===!1||!y(t,d)){t=d,o.value=d,o.version++,o.updated=Date.now();let w=P.get(r);if(w&&w.size>0){let E=function(p,b=!1){let C=p.state;if(!(C===K&&p===v)){if(b&&!p.pure){C===G&&(p.state=ve,Jn&&(l!==null&&l.indexOf(p)===-1?l.push(p):g.push(p)));return}if(!m.has(p)&&(m.add(p),p.state=$,C===G||C===ve?g.push(p):!p.pure&&l!==null&&l.indexOf(p)===-1&&l.push(p),p.pure&&p.accessor)){let k=P.get(p.accessor);k&&hn(Array.from(k),_=>E(_,!0))}}};var T=E;let S=Array.from(w),g=[],m=new Set;hn(S,E);for(let p of g)Sn(p)}}}return u.toObservable=()=>new Z(i=>{let d=!0;return ae(()=>{let T=u();d?d=!1:i.next(T)})}),Object.defineProperty(u,He,{value:!0,enumerable:!0}),Object.defineProperty(u,yn,{value:o,enumerable:!1}),r}function ae(e,n,t){let o={fn:e,state:$,sources:null,sourceSlots:null,owned:null,cleanups:null,owner:f,contexts:null,pure:!1,updatedAt:null};f&&(f.owned?f.owned.push(o):f.owned=[o]);let r=O&&N(O);return r&&(o.suspense=r),Je(o,n),()=>J(o)}function Je(e,n){if(e.sources){for(let r of e.sources){let s=P.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.owned){for(let r=0;r<e.owned.length;r++)J(e.owned[r]);e.owned=null}let t=v,o=f;if(v=e,f=e,ke++,ke>Xn)throw ke=0,v=t,f=o,new Error("Potential infinite loop detected. Exceeded maximum iterations.");try{e.state=K;let r=e.fn(n);typeof r=="function"&&(e.cleanups?e.cleanups.push(r):e.cleanups=[r]),e.state===K&&(e.state=G)}catch(r){if(fe(r)){let s=O&&N(O);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}Ye(r)}finally{v=t,f=o}}function ye(e){if(!(e.disposed||!e.fn||e.state===G)&&(e.state===$||e.state===ve||e.state===K)){if(e.cleanups){for(let n=0;n<e.cleanups.length;n++)e.cleanups[n]();e.cleanups=null}if(e.owned){for(let n=0;n<e.owned.length;n++)J(e.owned[n]);e.owned=null}e.renderEffect?On(e):Je(e,e.value)}}function J(e){if(e.disposed=!0,e.sources)for(let n of e.sources){let t=P.get(n);t&&t.delete(e)}if(e.cleanups)for(let n=0;n<e.cleanups.length;n++)e.cleanups[n]();if(e.owned)for(let n=0;n<e.owned.length;n++)J(e.owned[n]);if(e.owner&&e.owner.owned){let n=e.owner.owned.indexOf(e);n!==-1&&e.owner.owned.splice(n,1)}}function Gt(e,n,t){let o=bn("memo",n,{equals:t?.equals===!1?void 0:t?.equals,name:t?.name}),r={fn:e,state:$,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!0,updatedAt:null,node:o,accessor:void 0};f&&(f.owned?f.owned.push(r):f.owned=[r]);let s=()=>{if(v&&v!==r){v.sources?v.sources.indexOf(s)===-1&&v.sources.push(s):v.sources=[s];let a=s;P.has(a)||P.set(a,new Set);let i=P.get(a);i&&i.add(v)}if(r.state!==G){if(r.sources){for(let d of r.sources){let y=P.get(d);y&&y.delete(r)}r.sources=null,r.sourceSlots=null}if(r.cleanups){for(let d=0;d<r.cleanups.length;d++)r.cleanups[d]();r.cleanups=null}if(r.owned){for(let d=0;d<r.owned.length;d++)J(r.owned[d]);r.owned=null}let a=v,i=f;v=r,f=r,r.state=K;try{let d=r.fn(r.value),y=o.equals||mn;if(t?.equals===!1||!y(r.value,d)){r.value=d,o.value=d,o.version++,o.updated=Date.now();let w=s,S=P.get(w);if(S&&S.size>0){let p=function(b,C=!1){if(b===r)return;let k=b.state;if(k!==K){if(C&&!b.pure){k===G&&(b.state=ve,l!==null&&l.indexOf(b)===-1?l.push(b):m.push(b));return}if(!E.has(b)&&(E.add(b),b.state=$,k===G||k===ve?m.push(b):!b.pure&&l!==null&&l.indexOf(b)===-1&&l.push(b),b.pure&&b.accessor)){let _=P.get(b.accessor);if(_&&_.size>0)for(let z of Array.from(_))p(z,!0)}}};var u=p;let g=Array.from(S),m=[],E=new Set;for(let b=0;b<g.length;b++)p(g[b]);for(let b of m)Sn(b)}}r.state===K&&(r.state=G)}catch(d){if(fe(d)){let y=O&&N(O);if(!y&&O){let T=i;for(;T;){if(T.contexts?.has(O.id)){y=T.contexts.get(O.id);break}T=T.owner}}return y&&(y.increment(),d.finally(()=>y.decrement())),r.value}Ye(d)}finally{v=a,f=i}}return r.value};return r.accessor=s,P.set(s,new Set),s.toObservable=()=>new Z(u=>{let a=!0;return ae(()=>{let d=s();a?a=!1:u.next(d)})}),Object.defineProperty(s,He,{value:!0,enumerable:!0}),Object.defineProperty(s,Hn,{value:!0,enumerable:!0}),Object.defineProperty(s,yn,{value:o,enumerable:!1}),s}function Fe(e){let n=[],t=[];for(let r of e)r.pure&&!r.computed&&r.accessor?n.indexOf(r)===-1&&n.push(r):(r.computed||!r.pure)&&t.indexOf(r)===-1&&t.push(r);l=[];let o=0;for(;o<n.length;){let r=n[o++],s=P.get(r.accessor);if(s&&s.size>0){let a=v;v=null,r.accessor(),v=a}let u=l.splice(0);for(let a of u)a.pure&&!a.computed&&a.accessor?n.indexOf(a)===-1&&n.push(a):(a.computed||!a.pure)&&t.indexOf(a)===-1&&t.push(a)}l=null;for(let r of t)(r.computed||!r.pure)&&ye(r)}function F(e){if(l&&ue>0)return e();if(l&&ue===0){let n=l,t=[];l=t,ue++;let o;try{o=e()}finally{ue--,l=n}let r=l;return Fe(t),l=r,o}ue++,l=[],Ee=[];try{return e()}finally{ue--,wn()}}function wn(){if(!Ke){Ke=!0,ke=0;try{for(;l&&l.length>0;){let e=l;l=null,Fe(e)}if(l=null,Ee){let e=Ee;Ee=null;for(let n=0;n<e.length;n++)ye(e[n])}}finally{Ke=!1}}}function Kt(e){let n={owned:null,cleanups:null,contexts:null,owner:f},t=v;v=null;let o=f;f=n;try{return e(()=>{if(n.owned)for(let r=0;r<n.owned.length;r++)J(n.owned[r]);if(n.cleanups)for(let r=0;r<n.cleanups.length;r++)n.cleanups[r]()})}finally{f=o,v=t}}function W(e){let n=v;v=null;try{return e()}finally{v=n}}function Pe(e){f&&(f.cleanups?f.cleanups.push(e):f.cleanups=[e])}function $t(e,n,t={}){let o,r;typeof n=="function"?(o=typeof e=="function"?e:()=>e,r=n):(o=()=>!0,r=e,n&&typeof n=="object"&&(t=n));let{initialValue:s,name:u}=t,a=t.transport===!1?void 0:dn(),i=a!==void 0?fn(a):void 0,d=i!==void 0,[y,T]=q(i!==void 0?i.value:t.initialValue,{equals:!1}),[w,S]=q(void 0,{equals:!1}),[g,m]=q(i!==void 0||t.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[E,p]=q(void 0,{equals:!1}),[b,C]=q(void 0,{equals:!1}),k=Symbol(),_=k,z=!1,H=A=>{if(!(typeof localStorage>"u"))try{A&&localStorage.setItem("storage",JSON.stringify({data:A,timestamp:Date.now()}))}catch(L){console.error(`Failed to save resource to cache (${u}):`,L)}},ce=ae(()=>{let A=o?o():e;if(b(),A===!1||A===null||A===void 0){_=k,F(()=>{m("unresolved"),p(void 0),S(void 0)});return}let L=z;if(z=!1,_!==k&&A===_&&!L)return;if(_=A,d){d=!1;return}let B=!1;Pe(()=>B=!0);let le=W(g),re=W(y),Q=le==="ready"||le==="refreshing";F(()=>{m(Q?"refreshing":"pending"),S(void 0)});try{let j=r(A,{value:re,refetching:Q});if(fe(j)){p(j),_e(j),j.then(h=>{B||(a!==void 0&&pn(a,h),F(()=>{T(()=>h),H(h),m("ready"),p(void 0)}))},h=>{B||F(()=>{S(h),m("errored"),p(void 0)})}).catch(h=>{B||F(()=>{S(h),m("errored"),p(void 0)})});let be=O&&N(O);be&&(be.increment(),j.finally(()=>be.decrement()))}else{if(B)return;F(()=>{T(()=>j),m("ready"),p(void 0)})}}catch(j){if(B)return;F(()=>{S(j),m("errored"),p(void 0)})}});Pe(ce);let X=()=>{let A=g();return A==="pending"||A==="refreshing"},Y=(()=>{let A=w();if(A)throw A;if(X()){let L=E();if(L)throw L}return y()});return Object.defineProperty(Y,Yn,{value:!0,enumerable:!0}),Object.defineProperty(Y,He,{value:!0,enumerable:!0}),Object.defineProperties(Y,{state:{get:g},loading:{get:()=>X()},error:{get:w},latest:{get:y}}),[Y,{mutate:T,refetch:()=>{z=!0,C(void 0)}}]}function Wt(){return f}function zt(e,n){let t=f,o=v;f=e,v=null;try{return n()}finally{f=t,v=o}}function gn(e){let n=Symbol("context"),t=rt(n);return{id:n,Provider:t,defaultValue:e}}function rt(e){return n=>{let t=f;for(;t;)t.contexts||(t.contexts=new Map),t.contexts.has(e)||t.contexts.set(e,n.value),t=t.owner;let o;return st(()=>{o=W(()=>{let r=f;return r&&(r.contexts||(r.contexts=new Map),r.contexts.set(e,n.value)),ln(()=>n.children)})}),o}}function N(e){let n=f;for(;n;){if(n.contexts&&n.contexts.has(e.id))return n.contexts.get(e.id);n=n.owner}if(e)return e.defaultValue}function Ht(){return new Promise(e=>{queueMicrotask(()=>{wn(),e()})})}function ot(e){if(M&&M.running)return e(),M.done;xn();let n,t=new Promise(r=>n=r),o={running:!0,effects:[],resolve:n,done:t};M=o;try{e()}finally{o.running=!1}return o.effects.length?(ze(!0),Promise.resolve().then(()=>{let r=o.effects.splice(0);M=null,ze(!1),r.length&&F(()=>{for(let s of r)s.state=$,ye(s)}),n()}),t):(M=null,n(),t)}function Yt(){return xn(),[We,ot]}function Jt(e,n,t){let o=t?.defer??!1,r=!0;return s=>{let u=e();return o&&r?(r=!1,s):W(()=>n(u,s))}}function st(e,n,t){let o={fn:e,state:$,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!1,updatedAt:null,renderEffect:!0};f&&(f.owned?f.owned.push(o):f.owned=[o]);let r=O&&N(O);return r&&(o.suspense=r),On(o),()=>J(o)}function On(e){if(e.sources){for(let r of e.sources){let s=P.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.cleanups){for(let r=0;r<e.cleanups.length;r++)e.cleanups[r]();e.cleanups=null}if(e.owned){for(let r=0;r<e.owned.length;r++)J(e.owned[r]);e.owned=null}let n=v,t=f,o=l;v=e,f=e,l===null&&(l=[]),e.state=K;try{let r=e.fn(e.value);typeof r=="function"&&(e.cleanups||(e.cleanups=[]),e.cleanups.push(r)),e.value=r,e.state===K&&(e.state=G)}catch(r){if(fe(r)){let s=O&&N(O);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}Ye(r)}finally{v=n,f=t;let r=l;if(l=o,r!==o&&r&&r.length>0){let s=l;Fe(r),l=s}}}function Xt(e,n,t){let o={fn:e,state:$,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:f,contexts:null,pure:!0,computed:!0,updatedAt:null};f&&(f.owned?f.owned.push(o):f.owned=[o]),M&&M.running?(l||(l=[]),l.indexOf(o)===-1&&l.push(o)):l?l.indexOf(o)===-1&&l.push(o):Je(o,n)}var O;function Rn(){return O||(O=gn())}var vn;function Qt(){return vn||(vn=gn())}function Zt(e){if(!e.length)return;let n=e.slice();e.length=0;for(let t of n)t.state=$,ye(t)}function er(e){let n=O&&N(O);n&&n.inFallback()?ae(()=>{n.inFallback()||e()}):e()}function nr(e){Qn=e}function tr(e){let n=O&&N(O);return n&&(n.increment(),e.finally(()=>n.decrement())),e}function ir(e,n,t){return x(()=>n(e()),void 0,t)}function ur(e,n,t){return x(()=>e().filter(n),void 0,t)}function ar(e,n,t,o){return x(()=>e().reduce(n,t),void 0,o)}function cr(e,n,t){return x(()=>e().find(n),void 0,t)}function lr(e,n,t){return x(()=>e().some(n),void 0,t)}function fr(e,n,t){return x(()=>e().every(n),void 0,t)}function dr(e,n,t){return x(()=>[...e()].sort(n),void 0,t)}function pr(e,n){return x(()=>[...new Set(e())],void 0,n)}function Tr(e,n,t){return x(()=>{let o=e.map(r=>r());return n(o)},void 0,t)}function hr(...e){return new Z(n=>{let t=()=>e.map(r=>typeof r=="function"?r():r.get()),o=e.map(r=>typeof r=="function"&&r.subscribe?r.subscribe(()=>{n.next(t())}):typeof r!="function"?r.subscribe(()=>{n.next(t())}):he(()=>{n.next(t())}));return()=>{o.forEach(r=>{typeof r=="function"?r():r&&typeof r.unsubscribe=="function"&&r.unsubscribe()})}})}function vr(e,n,t){return x(()=>e()||n(),void 0,t)}function yr(e,n,t,o){return x(()=>t(e(),n()),void 0,o)}function br(e,n,t){return x(()=>n(e()),void 0,{equals:t,internal:!0})}function mr(e,n,t){return x(()=>{let o=e(),r={};for(let s of n)r[s]=o[s];return r},void 0,t)}function xr(e,n,t){return x(()=>{let r={...e()};for(let s of n)delete r[s];return r},void 0,t)}function Sr(e,n,t,o){return x(()=>e()?n():t(),void 0,o)}function wr(e,n,t){return x(()=>e()?n():void 0,void 0,t)}function gr(e,n,t){let[o,r]=I(e()),s;return x(()=>{let u=e();clearTimeout(s),s=setTimeout(()=>r(()=>u),n)}),o}function Or(e,n,t){let[o,r]=I(e()),s=0,u;return x(()=>{let a=e(),i=Date.now();i-s>=n?(s=i,r(()=>a)):(clearTimeout(u),u=setTimeout(()=>{s=Date.now(),r(()=>a)},n-(i-s)))}),o}function Rr(e){let n=e;for(;typeof n=="function";)n=n();return n}var te=new Map,ne=new Map,it=0,ut=Symbol.for("signal"),at=Symbol.for("resource");function _r(e,n,t={}){let o,r,s;typeof n=="function"?(o=e,r=n,s=t):(o=()=>!0,r=e,s=n??t);let{ttl:u=1/0,name:a=`_auto_${it++}`,staleWhileRevalidate:i=!0}=s,d=a,y=h=>`${d}:${JSON.stringify(h)}`,T=h=>u===1/0||Date.now()-h.timestamp<=u,[w,S]=q(void 0,{equals:!1}),[g,m]=q("unresolved",{equals:!1}),[E,p]=q(void 0,{equals:!1}),[b,C]=q(void 0,{equals:!1}),[k,_]=q(!1),[z,H]=q(0,{equals:!1}),ce=Symbol("unset"),X=ce,Y=!1,A=!1;function L(h,U,D,V){if(ne.has(U)){ne.get(U).then(R=>{V()||B(R,D)},R=>{!V()&&!D&&le(R)}),D||C(ne.get(U));return}let oe=Promise.resolve(r(h)).then(R=>(te.set(U,{value:R,timestamp:Date.now()}),ne.delete(U),R),R=>{throw ne.delete(U),R});if(ne.set(U,oe),!D){_e(oe),C(oe);let R=re&&N(re);R&&(R.increment(),oe.finally(()=>R.decrement()))}oe.then(R=>{V()||B(R,D)},R=>{!V()&&!D&&le(R)})}function B(h,U){F(()=>{S(()=>h),m("ready"),_(!1),C(void 0),p(void 0)})}function le(h){F(()=>{p(h),m("errored"),C(void 0)})}let re;ae(()=>{re===void 0&&(re=Rn());let h=o();if(z(),h===!1||h===null||h===void 0){X=ce,F(()=>{m("unresolved"),C(void 0),p(void 0)});return}let U=Y,D=A;Y=!1,A=!1;let V=y(h);D&&te.delete(V);let oe=X===ce||h!==X;X=h;let R=!1;Pe(()=>{R=!0});let se=te.get(V);if(se&&T(se)&&!U&&!D){(W(g)!=="ready"||W(w)!==se.value)&&F(()=>{S(()=>se.value),m("ready"),_(!1),p(void 0)});return}if(se&&i&&!D){F(()=>{S(()=>se.value),m("ready"),_(!0),p(void 0),C(void 0)}),L(h,V,!0,()=>R);return}let Xe=W(g),An=Xe==="ready"||Xe==="refreshing";F(()=>{m(An?"refreshing":"pending"),p(void 0),_(!1)}),L(h,V,!1,()=>R)});let Q=(()=>{let h=E();if(h)throw h;if(g()==="pending"){let D=b();if(D)throw D}return w()});return Object.defineProperty(Q,at,{value:!0,enumerable:!0}),Object.defineProperty(Q,ut,{value:!0,enumerable:!0}),Object.defineProperties(Q,{state:{get:g},loading:{get:()=>{let h=g();return h==="pending"||h==="refreshing"}},error:{get:E},latest:{get:w},stale:{get:k}}),[Q,{mutate:S,refetch:()=>{Y=!0,H(h=>h+1)},invalidate:()=>{let h=W(o);h!=null&&h!==!1&&te.delete(y(h)),A=!0,H(U=>U+1)}}]}function Er(e){let n=`${e}:`;for(let t of te.keys())t.startsWith(n)&&te.delete(t)}function kr(){te.clear(),ne.clear()}function Ur(e,n,t){let o=[];return ee(()=>{for(let r of o)r.dispose();o=[]}),x(()=>{let r=e()||[];return Ae(()=>{if(r.length===0){for(let i of o)i.dispose();return o=[],t?.fallback?t.fallback():[]}let s=new Map;for(let i of o)s.has(i.item)||s.set(i.item,i);let u=[],a=new Set;for(let i=0;i<r.length;i++){let d=r[i],y=s.get(d);if(y&&!a.has(y))y.setIndex(i),u.push(y),a.add(y);else{let T,w,S;Te(m=>{S=m;let[E,p]=I(i);w=p,T=n(d,E)});let g={item:d,rendered:T,dispose:S,setIndex:w};u.push(g),a.add(g)}}for(let i of o)a.has(i)||i.dispose();return o=u,u.map(i=>i.rendered)})})}function Dr(e,n,t,o){let r=[],s=[];return ee(()=>{for(let u of s)u.dispose();r=[],s=[]}),x(()=>{let u=e()||[];return Ae(()=>{if(u.length===0){for(let T of s)T.dispose();return r=[],s=[],o?.fallback?o.fallback():[]}let a=new Map;for(let T=0;T<r.length;T++)a.set(r[T],s[T]);let i=[],d=[],y=new Set;for(let T=0;T<u.length;T++){let w=n(u[T]),S=a.get(w);if(S&&!y.has(w))S.setIndex(T),i.push(S);else{let g,m,E;Te(p=>{E=p;let[b,C]=I(T);m=C;let k=x(_=>{let H=(e()||[])[b()];return H??_},u[T]);g=t(k,b)}),i.push({rendered:g,dispose:E,setIndex:m})}d.push(w),y.add(w)}for(let[T,w]of a)y.has(T)||w.dispose();return r=d,s=i,i.map(T=>T.rendered)})})}function qr(e,n,t){let o=[];return ee(()=>{for(let r of o)r.dispose();o=[]}),x(()=>{let r=e()||[];return Ae(()=>{if(r.length===0){for(let i of o)i.dispose();return o=[],t?.fallback?t.fallback():[]}let s=o.length,u=r.length;for(let i=s;i<u;i++){let d,y,T,w=r[i];Te(S=>{T=S;let[g,m]=I(w);y=m,d=n(g,i)}),o.push({rendered:d,setItem:y,dispose:T})}for(let i=u;i<s;i++)o[i].dispose();u<s&&(o=o.slice(0,u));let a=Math.min(s,u);for(let i=0;i<a;i++)o[i].setItem(r[i]);return o.map(i=>i.rendered)})})}export{Hn as $MEMO,Tn as $PROXY,Yn as $RESOURCE,He as $SIGNAL,xe as __DEV__,F as batch,kr as clearAllCachedResources,Er as clearCachedResourceNamespace,Tr as combineSignal,hr as combineSignals,_r as createCachedResource,Xt as createComputed,gn as createContext,Gn as createDebounce,Vn as createDeferred,ae as createEffect,Gt as createMemo,rt as createProvider,st as createRenderEffect,$t as createResource,Kt as createRoot,jn as createSelector,q as createSignal,gr as debounceSignal,pr as distinctSignal,fr as everySignal,ur as filterSignal,cr as findSignal,Ht as flush,Wt as getOwner,fn as getServerData,jt as getSharedConfig,Rn as getSuspenseContext,Qt as getSuspenseListContext,wr as guardSignal,qr as indexArray,Fn as isComponent,kn as isMemo,Dn as isProvider,Pn as isResource,qe as isSignal,Un as isSuspense,Dr as keyArray,Ze as makeArrayFlat,Ur as mapArray,ir as mapSignal,vr as mergeSignal,dn as nextResourceId,xr as omitSignal,Jt as on,Pe as onCleanup,er as onResolve,mr as pickSignal,ln as readChildren,Rr as readSignal,ar as reduceSignal,pn as reportResourceData,Zt as resumeEffects,zt as runWithOwner,br as selectSignal,Bt as setOwner,zn as setResourceDataSink,Wn as setResourceIdSource,Kn as setResourceTracker,nr as setScheduler,$n as setServerDataGetter,$e as sharedConfig,lr as someSignal,dr as sortSignal,ot as startTransition,Or as throttleSignal,tr as trackPromise,_e as trackResourcePromise,W as untrack,N as useContext,Yt as useTransition,Sr as whenSignal,yr as zipSignal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Te=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var zt=Object.prototype.hasOwnProperty;var Ht=(e,t)=>{for(var n in t)Te(e,n,{get:t[n],enumerable:!0})},Yt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Wt(t))!zt.call(e,r)&&r!==n&&Te(e,r,{get:()=>t[r],enumerable:!(o=$t(t,r))||o.enumerable});return e};var Kt=e=>Yt(Te({},"__esModule",{value:!0}),e);var bn={};Ht(bn,{$MEMO:()=>Tt,$PROXY:()=>Le,$RESOURCE:()=>bt,$SIGNAL:()=>de,__DEV__:()=>Y,batch:()=>_,createComputed:()=>qt,createContext:()=>ve,createDebounce:()=>lt,createDeferred:()=>at,createEffect:()=>$,createMemo:()=>St,createProvider:()=>Ft,createRenderEffect:()=>We,createResource:()=>Rt,createRoot:()=>Ct,createSelector:()=>Ae,createSignal:()=>U,default:()=>Tn,flush:()=>Et,getOwner:()=>_t,getServerData:()=>Ne,getSharedConfig:()=>pn,getSuspenseContext:()=>Nt,getSuspenseListContext:()=>Ut,isComponent:()=>Qe,isMemo:()=>Xe,isProvider:()=>et,isResource:()=>Je,isSignal:()=>K,isSuspense:()=>Ze,makeArrayFlat:()=>me,nextResourceId:()=>Ue,on:()=>kt,onCleanup:()=>fe,onResolve:()=>Mt,readChildren:()=>Fe,reportResourceData:()=>Ie,resumeEffects:()=>It,runWithOwner:()=>At,setOwner:()=>dn,setResourceDataSink:()=>pt,setResourceIdSource:()=>dt,setResourceTracker:()=>ct,setScheduler:()=>Lt,setServerDataGetter:()=>ft,sharedConfig:()=>ce,startTransition:()=>$e,trackPromise:()=>Bt,trackResourcePromise:()=>qe,untrack:()=>j,useContext:()=>A,useTransition:()=>Pt});module.exports=Kt(bn);var Ke=require("@fluixi/utils/object"),be=require("@fluixi/utils/functions"),z=class e{constructor(t){this._closed=!1;this._parentOrParents=null;this._subscriptions=null;t&&(this._subscriptions=[t])}get closed(){return this._closed}unsubscribe(){if(this._closed)return;this._closed=!0;let{_parentOrParents:t,_subscriptions:n}=this;if(t instanceof e)t.remove(this);else if(t!==null)for(let o of t)o.remove(this);if(n){for(let o of n)if((0,be.isFunction)(o)&&!(o instanceof e))try{o()}catch(r){console.error("Error in unsubscribe function:",r)}else if((0,Ke.isObject)(o)&&typeof o.unsubscribe=="function")try{o.unsubscribe()}catch(r){console.error("Error unsubscribing child:",r)}this._subscriptions=null}}add(t){if(!t||t===this)return this;if(t.closed)return this;let{_closed:n,_subscriptions:o}=this;if(n){if((0,be.isFunction)(t))try{t()}catch(r){console.error("Error in unsubscribe function:",r)}else if(t.unsubscribe)try{t.unsubscribe()}catch(r){console.error("Error unsubscribing:",r)}return this}return o||(this._subscriptions=[]),this._subscriptions.push(t),t instanceof e&&t._addParent(this),this}remove(t){let{_subscriptions:n}=this;if(!n)return;let o=n.indexOf(t);o!==-1&&(n.splice(o,1),t._removeParent(this))}_addParent(t){let{_parentOrParents:n}=this;n?Array.isArray(n)?n.push(t):this._parentOrParents=[n,t]:this._parentOrParents=t}_removeParent(t){let{_parentOrParents:n}=this;if(n===t)this._parentOrParents=null;else if(Array.isArray(n)){let o=n.indexOf(t);o!==-1&&(n.splice(o,1),n.length===1&&(this._parentOrParents=n[0]))}}};var te=class extends z{constructor(n,o,r){super();this.isStopped=!1;let s;n?typeof n=="object"?s=n:s={next:n,error:o,complete:r}:s={},this.destination=s}next(n){if(!this.isStopped&&this.destination.next)try{this.destination.next(n)}catch(o){this.error(o)}}error(n){if(!this.isStopped){if(this.isStopped=!0,this.destination.error)try{this.destination.error(n)}catch(o){throw o}else throw n;this.unsubscribe()}}complete(){if(!this.isStopped){if(this.isStopped=!0,this.destination.complete)try{this.destination.complete()}catch(n){this.error(n);return}this.unsubscribe()}}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}},ye=class extends te{constructor(n,o,r,s){super(n,o,r);this._isUnsubscribing=!1;this._parentSubscriber=null;this._parentSubscriber=s||null}next(n){if(!this.isStopped&&!this._isUnsubscribing)try{super.next(n)}catch(o){this.error(o)}}error(n){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.error(n)}finally{this._isUnsubscribing=!1}}}complete(){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.complete()}finally{this._isUnsubscribing=!1}}}unsubscribe(){this.closed||(this._isUnsubscribing=!0,super.unsubscribe(),this._isUnsubscribing=!1)}};var H=class extends z{constructor(t){if(super(),t)this._subscribe=t;else throw new TypeError("Observable constructor requires a subscribe function")}subscribe(t,n,o){let r;t instanceof te?r=t:r=new ye(t,n,o);let{_subscribe:s}=this;try{let l=s.call(this,r);l&&(typeof l=="function"||typeof l.unsubscribe=="function")&&r.add(l)}catch(l){r.error(l)}return r}pipe(...t){return t.length===0?this:t.reduce((n,o)=>o(n),this)}toPromise(){return new Promise((t,n)=>{let o;this.subscribe({next:r=>o=r,error:n,complete:()=>t(o)})})}};var Q=require("@fluixi/utils");var Y=!1,Xt=Symbol.for("signal"),Jt=Symbol.for("memo"),Qt=Symbol.for("resource");function K(e){return typeof e=="function"&&e[Xt]===!0}function Xe(e){return typeof e=="function"&&e[Jt]===!0}function Je(e){return typeof e=="function"&&e[Qt]===!0}function Qe(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ze(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function et(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function me(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?me(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}var Zt="__fluixi_signal_next_state__",en=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},a=globalThis[Zt]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:en,onSuspend:null,onError:null};var tt=0,nt=1,X=2,ne=class{constructor(){this.observers=null;this.watchers=null;this.version=0}updateIfNecessary(){}track(){if(a.untracked)return;let t=a.consumer;t&&((this.observers??=new Set).add(t),(t.sources??=new Set).add(this))}},re=class extends ne{constructor(t,n){super(),this._value=t,this._equals=n?.equals===!1?()=>!1:n?.equals??Object.is}get(){return this.track(),this._value}set(t){if(!this._equals(this._value,t)){if(this._value=t,this.version++,this.observers)for(let n of[...this.observers])n.markDirty(X);we(this)}}peek(){return this._value}},G=class extends ne{constructor(n,o){super();this._threw=!1;this._initialized=!1;this.state=X;this.sources=null;this._fn=n,this._equals=o?.equals===!1?()=>!1:o?.equals??Object.is}get(){if(a.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===nt&&this.sources){for(let n of this.sources)if(n.updateIfNecessary(),this.state===X)break}(this.state===X||!this._initialized)&&this.recompute(),this.state=tt}recompute(){if(this.sources){for(let f of this.sources)f.observers?.delete(this);this.sources.clear()}let n=a.consumer,o=a.untracked;a.consumer=this,a.untracked=!1;let r,s=!1,l;try{r=this._fn()}catch(f){s=!0,l=f,r=this._value}finally{a.consumer=n,a.untracked=o}let c=!this._initialized||this._threw!==s||(s?l!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=s,this._error=l,this._value=r,c){if(this.version++,this.observers)for(let f of[...this.observers])f.markDirty(X);we(this)}}markDirty(n){if(this.state>=n)return;let o=this.state===tt;if(this.state=n,o){if(this.observers)for(let r of[...this.observers])r.markDirty(nt);we(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function we(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var oe=class{constructor(t){this._watched=new Set;this._pending=new Set;this._notifyFn=t}watch(...t){for(let n of t)this._watched.add(n),(n.watchers??=new Set).add(this)}unwatch(...t){for(let n of t)this._watched.delete(n),n.watchers?.delete(this),this._pending.delete(n)}getPending(){let t=[...this._pending];return this._pending.clear(),t}_notify(t){if(!this._watched.has(t)||this._pending.has(t))return;let n=this._pending.size===0;this._pending.add(t),n&&this._notifyFn()}};function tn(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function rt(e){return a.onSuspend?(a.onSuspend(e,a.owner),!0):!1}function Se(){return a.owner}function se(e,t){let n=a.owner;a.owner=e;try{return t()}finally{a.owner=n}}function Oe(e){if(a.owner){if(a.owner.disposed){e();return}(a.owner.cleanups??=[]).push(e)}}function xe(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)xe(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function ot(e){a.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function nn(e){e.queued||(e.queued=!0,a.queue.push(e),!a.scheduled&&a.batchDepth===0&&(a.scheduled=!0,a.hostSchedule(Ce)))}function Ce(){if(a.scheduled=!1,a.flushing)return;a.flushing=!0;let e=0;try{for(;a.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=a.queue;a.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{a.flushing=!1}}function st(){a.batchDepth===0&&Ce()}var ge=class{constructor(t){this.queued=!1;this.disposed=!1;this.owner=tn(a.owner),a.owner&&(a.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new G(()=>{xe(this.owner,!1),se(this.owner,()=>{let n=t();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),this.watcher=new oe(()=>nn(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(t){if(t&&typeof t.then=="function"&&a.onSuspend){a.onSuspend(t,this.owner);return}if(a.onError&&a.onError(t,this.owner))return;throw t}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),xe(this.owner))}};function it(e){let t=new ge(e);return()=>t.dispose()}function rn(e){return!!e&&typeof e.then=="function"}ot(()=>{});var ut=Symbol.for("signal"),on=Symbol.for("memo"),sn=Symbol.for("signal-node");function Re(e,t){let n=new re(e,{equals:t?.equals}),o=(()=>n.get()),r=(s=>{let l=typeof s=="function"?s(n.peek()):s;return n.set(l),st(),l});return Object.defineProperty(o,ut,{value:!0,enumerable:!0}),Object.defineProperty(o,sn,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),[o,r]}function ie(e,t,n){let o=t,r=Se(),s=new G(()=>se(r,()=>{try{return o=e(o)}catch(c){if(rn(c))return rt(c),o;throw c}}),{equals:n?.equals}),l=(()=>s.get());return Object.defineProperty(l,ut,{value:!0,enumerable:!0}),Object.defineProperty(l,on,{value:!0,enumerable:!0}),l}function _e(e,t){let n=t;return it(()=>{n=e(n)})}function Ae(e,t=(n,o)=>n===o){let n=new Map;return _e(()=>{let o=e();for(let[r,s]of n){let[l,c]=s,f=t(r,o);l()!==f&&c(f)}}),o=>{let r=n.get(o);if(!r){let[s,l]=Re(!1);r=[s,l],n.set(o,r);let c=e();l(t(o,c))}return r[0]()}}function at(e,t){let[n,o]=Re(e(),t);return _e(()=>{let r=e();t?.timeoutMs?setTimeout(()=>o(()=>r),t.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>o(()=>r)):Promise.resolve().then(()=>o(()=>r))}),n}function lt(e,t){let n,o=(...r)=>{n!==void 0&&clearTimeout(n),n=setTimeout(()=>{n=void 0,e(...r)},t)};return Oe(()=>{n!==void 0&&clearTimeout(n)}),o}function ue(e){if(typeof e=="function"&&!e.length){let t=e();return K(t)?t:ue(t)}if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let o=ue(e[n]);Array.isArray(o)?t.push.apply(t,o):t.push(o)}return t}return e}function Fe(e){let t=ie(e);return ie(()=>ue(t()))}var Ee=null;function ct(e){Ee=e}function qe(e){Ee&&Ee(e)}var Pe=null;function ft(e){Pe=e}function Ne(e){return Pe?Pe(e):void 0}var ke=null;function dt(e){ke=e}function Ue(){return ke?ke():void 0}var De=null;function pt(e){De=e}function Ie(e,t){De&&De(e,t)}var de=Symbol.for("signal"),Tt=Symbol.for("memo"),bt=Symbol.for("resource"),Le=Symbol("fluixi-proxy"),yt=Symbol.for("signal-node"),F=0,J=1,P=2,E=3,u=null,d=null,i=null,ae=null,le=0,un=!1,Me=!1,V=0,an=1e6,m=new WeakMap,g=null;var ln=null,cn=new Map,fn=0,ce={context:null,owner:null,routeData:new Map,matchedRoute:new Map};function dn(e){u=e,ce.owner=e,ce.context=e}function pn(){return ce}function vn(){return`node_${++fn}_${Date.now()}`}function hn(e){!1}function mt(e,t,n){let o={id:vn(),type:e,value:t,version:0,equals:n?.equals,name:n?.name,created:Date.now(),updated:Date.now()};return hn(o),o}function wt(e,t){return e===t}function Ve(e){throw typeof console<"u"&&console.error("Reactive error:",e),e}var Be=null,Ge=null;function xt(){if(!Be){let[e,t]=U(!1);Be=e,Ge=t}}function gt(e){if(i)i.indexOf(e)===-1&&i.push(e);else if(g&&g.running&&!e.pure)g.effects.indexOf(e)===-1&&g.effects.push(e);else if(!e.pure||e.computed)Z(e);else if(e.pure&&!e.computed&&e.accessor){let t=d,n=i;d=null,i=[],e.accessor(),d=t;let o=i;if(i=n,o.length>0){let r=i;pe(o),i=r}}}function vt(e,t){for(let n=0;n<e.length;n++)t(e[n])}function U(e,t){let n=e;typeof n=="object"&&n&&Le in n&&delete n[Le];let o=mt("signal",n,{equals:t?.equals===!1?void 0:t?.equals,name:t?.name}),r=[l,c];m.set(r,new Set);let s;function l(){let f=d;if(f){f.sources?f.sources.indexOf(r)===-1&&f.sources.push(r):f.sources=[r];let p=m.get(r);p&&!p.has(f)&&p.add(f)}return n}function c(f){let p=typeof f=="function"?f(n):f,b=o.equals||wt;if(t?.equals===!1||!b(n,p)){n=p,o.value=p,o.version++,o.updated=Date.now();let k=m.get(r);if(k&&k.size>0){let D=function(v,h=!1){let q=v.state;if(!(q===E&&v===d)){if(h&&!v.pure){q===F&&(v.state=J,un&&(i!==null&&i.indexOf(v)===-1?i.push(v):C.push(v)));return}if(!w.has(v)&&(w.add(v),v.state=P,q===F||q===J?C.push(v):!v.pure&&i!==null&&i.indexOf(v)===-1&&i.push(v),v.pure&&v.accessor)){let O=m.get(v.accessor);O&&vt(Array.from(O),R=>D(R,!0))}}};var x=D;let S=Array.from(k),C=[],w=new Set;vt(S,D);for(let v of C)gt(v)}}}return l.toObservable=()=>new H(f=>{let p=!0;return $(()=>{let x=l();p?p=!1:f.next(x)})}),Object.defineProperty(l,de,{value:!0,enumerable:!0}),Object.defineProperty(l,yt,{value:o,enumerable:!1}),r}function $(e,t,n){let o={fn:e,state:P,sources:null,sourceSlots:null,owned:null,cleanups:null,owner:u,contexts:null,pure:!1,updatedAt:null};u&&(u.owned?u.owned.push(o):u.owned=[o]);let r=T&&A(T);return r&&(o.suspense=r),je(o,t),()=>I(o)}function je(e,t){if(e.sources){for(let r of e.sources){let s=m.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.owned){for(let r=0;r<e.owned.length;r++)I(e.owned[r]);e.owned=null}let n=d,o=u;if(d=e,u=e,le++,le>an)throw le=0,d=n,u=o,new Error("Potential infinite loop detected. Exceeded maximum iterations.");try{e.state=E;let r=e.fn(t);typeof r=="function"&&(e.cleanups?e.cleanups.push(r):e.cleanups=[r]),e.state===E&&(e.state=F)}catch(r){if((0,Q.isPromise)(r)){let s=T&&A(T);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}Ve(r)}finally{d=n,u=o}}function Z(e){if(!(e.disposed||!e.fn||e.state===F)&&(e.state===P||e.state===J||e.state===E)){if(e.cleanups){for(let t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}if(e.owned){for(let t=0;t<e.owned.length;t++)I(e.owned[t]);e.owned=null}e.renderEffect?Dt(e):je(e,e.value)}}function I(e){if(e.disposed=!0,e.sources)for(let t of e.sources){let n=m.get(t);n&&n.delete(e)}if(e.cleanups)for(let t=0;t<e.cleanups.length;t++)e.cleanups[t]();if(e.owned)for(let t=0;t<e.owned.length;t++)I(e.owned[t]);if(e.owner&&e.owner.owned){let t=e.owner.owned.indexOf(e);t!==-1&&e.owner.owned.splice(t,1)}}function St(e,t,n){let o=mt("memo",t,{equals:n?.equals===!1?void 0:n?.equals,name:n?.name}),r={fn:e,state:P,sources:null,sourceSlots:null,value:t,owned:null,cleanups:null,owner:u,contexts:null,pure:!0,updatedAt:null,node:o,accessor:void 0};u&&(u.owned?u.owned.push(r):u.owned=[r]);let s=()=>{if(d&&d!==r){d.sources?d.sources.indexOf(s)===-1&&d.sources.push(s):d.sources=[s];let c=s;m.has(c)||m.set(c,new Set);let f=m.get(c);f&&f.add(d)}if(r.state!==F){if(r.sources){for(let p of r.sources){let b=m.get(p);b&&b.delete(r)}r.sources=null,r.sourceSlots=null}if(r.cleanups){for(let p=0;p<r.cleanups.length;p++)r.cleanups[p]();r.cleanups=null}if(r.owned){for(let p=0;p<r.owned.length;p++)I(r.owned[p]);r.owned=null}let c=d,f=u;d=r,u=r,r.state=E;try{let p=r.fn(r.value),b=o.equals||wt;if(n?.equals===!1||!b(r.value,p)){r.value=p,o.value=p,o.version++,o.updated=Date.now();let k=s,S=m.get(k);if(S&&S.size>0){let v=function(h,q=!1){if(h===r)return;let O=h.state;if(O!==E){if(q&&!h.pure){O===F&&(h.state=J,i!==null&&i.indexOf(h)===-1?i.push(h):w.push(h));return}if(!D.has(h)&&(D.add(h),h.state=P,O===F||O===J?w.push(h):!h.pure&&i!==null&&i.indexOf(h)===-1&&i.push(h),h.pure&&h.accessor)){let R=m.get(h.accessor);if(R&&R.size>0)for(let W of Array.from(R))v(W,!0)}}};var l=v;let C=Array.from(S),w=[],D=new Set;for(let h=0;h<C.length;h++)v(C[h]);for(let h of w)gt(h)}}r.state===E&&(r.state=F)}catch(p){if((0,Q.isPromise)(p)){let b=T&&A(T);if(!b&&T){let x=f;for(;x;){if(x.contexts?.has(T.id)){b=x.contexts.get(T.id);break}x=x.owner}}return b&&(b.increment(),p.finally(()=>b.decrement())),r.value}Ve(p)}finally{d=c,u=f}}return r.value};return r.accessor=s,m.set(s,new Set),s.toObservable=()=>new H(l=>{let c=!0;return $(()=>{let p=s();c?c=!1:l.next(p)})}),Object.defineProperty(s,de,{value:!0,enumerable:!0}),Object.defineProperty(s,Tt,{value:!0,enumerable:!0}),Object.defineProperty(s,yt,{value:o,enumerable:!1}),s}function pe(e){let t=[],n=[];for(let r of e)r.pure&&!r.computed&&r.accessor?t.indexOf(r)===-1&&t.push(r):(r.computed||!r.pure)&&n.indexOf(r)===-1&&n.push(r);i=[];let o=0;for(;o<t.length;){let r=t[o++],s=m.get(r.accessor);if(s&&s.size>0){let c=d;d=null,r.accessor(),d=c}let l=i.splice(0);for(let c of l)c.pure&&!c.computed&&c.accessor?t.indexOf(c)===-1&&t.push(c):(c.computed||!c.pure)&&n.indexOf(c)===-1&&n.push(c)}i=null;for(let r of n)(r.computed||!r.pure)&&Z(r)}function _(e){if(i&&V>0)return e();if(i&&V===0){let t=i,n=[];i=n,V++;let o;try{o=e()}finally{V--,i=t}let r=i;return pe(n),i=r,o}V++,i=[],ae=[];try{return e()}finally{V--,Ot()}}function Ot(){if(!Me){Me=!0,le=0;try{for(;i&&i.length>0;){let e=i;i=null,pe(e)}if(i=null,ae){let e=ae;ae=null;for(let t=0;t<e.length;t++)Z(e[t])}}finally{Me=!1}}}function Ct(e){let t={owned:null,cleanups:null,contexts:null,owner:u},n=d;d=null;let o=u;u=t;try{return e(()=>{if(t.owned)for(let r=0;r<t.owned.length;r++)I(t.owned[r]);if(t.cleanups)for(let r=0;r<t.cleanups.length;r++)t.cleanups[r]()})}finally{u=o,d=n}}function j(e){let t=d;d=null;try{return e()}finally{d=t}}function fe(e){u&&(u.cleanups?u.cleanups.push(e):u.cleanups=[e])}function Rt(e,t,n={}){let o,r;typeof t=="function"?(o=typeof e=="function"?e:()=>e,r=t):(o=()=>!0,r=e,t&&typeof t=="object"&&(n=t));let{initialValue:s,name:l}=n,c=n.transport===!1?void 0:Ue(),f=c!==void 0?Ne(c):void 0,p=f!==void 0,[b,x]=U(f!==void 0?f.value:n.initialValue,{equals:!1}),[k,S]=U(void 0,{equals:!1}),[C,w]=U(f!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[D,v]=U(void 0,{equals:!1}),[h,q]=U(void 0,{equals:!1}),O=Symbol(),R=O,W=!1,Gt=y=>{if(!(typeof localStorage>"u"))try{y&&localStorage.setItem("storage",JSON.stringify({data:y,timestamp:Date.now()}))}catch(L){console.error(`Failed to save resource to cache (${l}):`,L)}},Vt=$(()=>{let y=o?o():e;if(h(),y===!1||y===null||y===void 0){R=O,_(()=>{w("unresolved"),v(void 0),S(void 0)});return}let L=W;if(W=!1,R!==O&&y===R&&!L)return;if(R=y,p){p=!1;return}let B=!1;fe(()=>B=!0);let He=j(C),jt=j(b),Ye=He==="ready"||He==="refreshing";_(()=>{w(Ye?"refreshing":"pending"),S(void 0)});try{let N=r(y,{value:jt,refetching:Ye});if((0,Q.isPromise)(N)){v(N),qe(N),N.then(M=>{B||(c!==void 0&&Ie(c,M),_(()=>{x(()=>M),Gt(M),w("ready"),v(void 0)}))},M=>{B||_(()=>{S(M),w("errored"),v(void 0)})}).catch(M=>{B||_(()=>{S(M),w("errored"),v(void 0)})});let he=T&&A(T);he&&(he.increment(),N.finally(()=>he.decrement()))}else{if(B)return;_(()=>{x(()=>N),w("ready"),v(void 0)})}}catch(N){if(B)return;_(()=>{S(N),w("errored"),v(void 0)})}});fe(Vt);let ze=()=>{let y=C();return y==="pending"||y==="refreshing"},ee=(()=>{let y=k();if(y)throw y;if(ze()){let L=D();if(L)throw L}return b()});return Object.defineProperty(ee,bt,{value:!0,enumerable:!0}),Object.defineProperty(ee,de,{value:!0,enumerable:!0}),Object.defineProperties(ee,{state:{get:C},loading:{get:()=>ze()},error:{get:k},latest:{get:b}}),[ee,{mutate:x,refetch:()=>{W=!0,q(void 0)}}]}function _t(){return u}function At(e,t){let n=u,o=d;u=e,d=null;try{return t()}finally{u=n,d=o}}function ve(e){let t=Symbol("context"),n=Ft(t);return{id:t,Provider:n,defaultValue:e}}function Ft(e){return t=>{let n=u;for(;n;)n.contexts||(n.contexts=new Map),n.contexts.has(e)||n.contexts.set(e,t.value),n=n.owner;let o;return We(()=>{o=j(()=>{let r=u;return r&&(r.contexts||(r.contexts=new Map),r.contexts.set(e,t.value)),Fe(()=>t.children)})}),o}}function A(e){let t=u;for(;t;){if(t.contexts&&t.contexts.has(e.id))return t.contexts.get(e.id);t=t.owner}if(e)return e.defaultValue}function Et(){return new Promise(e=>{queueMicrotask(()=>{Ot(),e()})})}function $e(e){if(g&&g.running)return e(),g.done;xt();let t,n=new Promise(r=>t=r),o={running:!0,effects:[],resolve:t,done:n};g=o;try{e()}finally{o.running=!1}return o.effects.length?(Ge(!0),Promise.resolve().then(()=>{let r=o.effects.splice(0);g=null,Ge(!1),r.length&&_(()=>{for(let s of r)s.state=P,Z(s)}),t()}),n):(g=null,t(),n)}function Pt(){return xt(),[Be,$e]}function kt(e,t,n){let o=n?.defer??!1,r=!0;return s=>{let l=e();return o&&r?(r=!1,s):j(()=>t(l,s))}}function We(e,t,n){let o={fn:e,state:P,sources:null,sourceSlots:null,value:t,owned:null,cleanups:null,owner:u,contexts:null,pure:!1,updatedAt:null,renderEffect:!0};u&&(u.owned?u.owned.push(o):u.owned=[o]);let r=T&&A(T);return r&&(o.suspense=r),Dt(o),()=>I(o)}function Dt(e){if(e.sources){for(let r of e.sources){let s=m.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.cleanups){for(let r=0;r<e.cleanups.length;r++)e.cleanups[r]();e.cleanups=null}if(e.owned){for(let r=0;r<e.owned.length;r++)I(e.owned[r]);e.owned=null}let t=d,n=u,o=i;d=e,u=e,i===null&&(i=[]),e.state=E;try{let r=e.fn(e.value);typeof r=="function"&&(e.cleanups||(e.cleanups=[]),e.cleanups.push(r)),e.value=r,e.state===E&&(e.state=F)}catch(r){if((0,Q.isPromise)(r)){let s=T&&A(T);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}Ve(r)}finally{d=t,u=n;let r=i;if(i=o,r!==o&&r&&r.length>0){let s=i;pe(r),i=s}}}function qt(e,t,n){let o={fn:e,state:P,sources:null,sourceSlots:null,value:t,owned:null,cleanups:null,owner:u,contexts:null,pure:!0,computed:!0,updatedAt:null};u&&(u.owned?u.owned.push(o):u.owned=[o]),g&&g.running?(i||(i=[]),i.indexOf(o)===-1&&i.push(o)):i?i.indexOf(o)===-1&&i.push(o):je(o,t)}var T;function Nt(){return T||(T=ve())}var ht;function Ut(){return ht||(ht=ve())}function It(e){if(!e.length)return;let t=e.slice();e.length=0;for(let n of t)n.state=P,Z(n)}function Mt(e){let t=T&&A(T);t&&t.inFallback()?$(()=>{t.inFallback()||e()}):e()}function Lt(e){ln=e}function Bt(e){let t=T&&A(T);return t&&(t.increment(),e.finally(()=>t.decrement())),e}var Tn={createSignal:U,createEffect:$,createMemo:St,createComputed:qt,createRoot:Ct,createSelector:Ae,createResource:Rt,batch:_,untrack:j,onCleanup:fe,getOwner:_t,runWithOwner:At,createContext:ve,useContext:A,flush:Et,startTransition:$e,useTransition:Pt,isSignal:K,on:kt,createRenderEffect:We,getSuspenseContext:Nt,getSuspenseListContext:Ut,resumeEffects:It,onResolve:Mt,setScheduler:Lt,trackPromise:Bt};
|
|
1
|
+
"use strict";var Te=Object.defineProperty;var Wn=Object.getOwnPropertyDescriptor;var zn=Object.getOwnPropertyNames;var Hn=Object.prototype.hasOwnProperty;var Yn=(e,n)=>{for(var t in n)Te(e,t,{get:n[t],enumerable:!0})},Kn=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of zn(n))!Hn.call(e,r)&&r!==t&&Te(e,r,{get:()=>n[r],enumerable:!(o=Wn(n,r))||o.enumerable});return e};var Xn=e=>Kn(Te({},"__esModule",{value:!0}),e);var bt={};Yn(bt,{$MEMO:()=>bn,$PROXY:()=>Le,$RESOURCE:()=>yn,$SIGNAL:()=>de,__DEV__:()=>K,batch:()=>_,createComputed:()=>Nn,createContext:()=>he,createDebounce:()=>cn,createDeferred:()=>ln,createEffect:()=>$,createMemo:()=>On,createProvider:()=>En,createRenderEffect:()=>We,createResource:()=>_n,createRoot:()=>Rn,createSelector:()=>Ae,createSignal:()=>U,default:()=>Tt,flush:()=>kn,getOwner:()=>An,getServerData:()=>Ne,getSharedConfig:()=>pt,getSuspenseContext:()=>Un,getSuspenseListContext:()=>In,isComponent:()=>Qe,isMemo:()=>Xe,isProvider:()=>en,isResource:()=>Je,isSignal:()=>X,isSuspense:()=>Ze,makeArrayFlat:()=>me,nextResourceId:()=>Ue,on:()=>Dn,onCleanup:()=>fe,onResolve:()=>Ln,readChildren:()=>Fe,reportResourceData:()=>Ie,resumeEffects:()=>Mn,runWithOwner:()=>Fn,setOwner:()=>dt,setResourceDataSink:()=>hn,setResourceIdSource:()=>pn,setResourceTracker:()=>fn,setScheduler:()=>Bn,setServerDataGetter:()=>dn,sharedConfig:()=>ce,startTransition:()=>$e,trackPromise:()=>jn,trackResourcePromise:()=>qe,untrack:()=>V,useContext:()=>A,useTransition:()=>Pn});module.exports=Xn(bt);function be(e){return typeof e=="function"&&!/^class\s/.test(Function.prototype.toString.call(e))}function Ke(e){return e==null||Array.isArray(e)||typeof e=="function"||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error?!1:typeof e=="object"}function z(e){return e instanceof Promise||!!e&&(typeof e=="object"||typeof e=="function")&&"then"in e}var H=class e{constructor(n){this._closed=!1;this._parentOrParents=null;this._subscriptions=null;n&&(this._subscriptions=[n])}get closed(){return this._closed}unsubscribe(){if(this._closed)return;this._closed=!0;let{_parentOrParents:n,_subscriptions:t}=this;if(n instanceof e)n.remove(this);else if(n!==null)for(let o of n)o.remove(this);if(t){for(let o of t)if(be(o)&&!(o instanceof e))try{o()}catch(r){console.error("Error in unsubscribe function:",r)}else if(Ke(o)&&typeof o.unsubscribe=="function")try{o.unsubscribe()}catch(r){console.error("Error unsubscribing child:",r)}this._subscriptions=null}}add(n){if(!n||n===this)return this;if(n.closed)return this;let{_closed:t,_subscriptions:o}=this;if(t){if(be(n))try{n()}catch(r){console.error("Error in unsubscribe function:",r)}else if(n.unsubscribe)try{n.unsubscribe()}catch(r){console.error("Error unsubscribing:",r)}return this}return o||(this._subscriptions=[]),this._subscriptions.push(n),n instanceof e&&n._addParent(this),this}remove(n){let{_subscriptions:t}=this;if(!t)return;let o=t.indexOf(n);o!==-1&&(t.splice(o,1),n._removeParent(this))}_addParent(n){let{_parentOrParents:t}=this;t?Array.isArray(t)?t.push(n):this._parentOrParents=[t,n]:this._parentOrParents=n}_removeParent(n){let{_parentOrParents:t}=this;if(t===n)this._parentOrParents=null;else if(Array.isArray(t)){let o=t.indexOf(n);o!==-1&&(t.splice(o,1),t.length===1&&(this._parentOrParents=t[0]))}}};var ne=class extends H{constructor(t,o,r){super();this.isStopped=!1;let s;t?typeof t=="object"?s=t:s={next:t,error:o,complete:r}:s={},this.destination=s}next(t){if(!this.isStopped&&this.destination.next)try{this.destination.next(t)}catch(o){this.error(o)}}error(t){if(!this.isStopped){if(this.isStopped=!0,this.destination.error)try{this.destination.error(t)}catch(o){throw o}else throw t;this.unsubscribe()}}complete(){if(!this.isStopped){if(this.isStopped=!0,this.destination.complete)try{this.destination.complete()}catch(t){this.error(t);return}this.unsubscribe()}}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}},ye=class extends ne{constructor(t,o,r,s){super(t,o,r);this._isUnsubscribing=!1;this._parentSubscriber=null;this._parentSubscriber=s||null}next(t){if(!this.isStopped&&!this._isUnsubscribing)try{super.next(t)}catch(o){this.error(o)}}error(t){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.error(t)}finally{this._isUnsubscribing=!1}}}complete(){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.complete()}finally{this._isUnsubscribing=!1}}}unsubscribe(){this.closed||(this._isUnsubscribing=!0,super.unsubscribe(),this._isUnsubscribing=!1)}};var Y=class extends H{constructor(n){if(super(),n)this._subscribe=n;else throw new TypeError("Observable constructor requires a subscribe function")}subscribe(n,t,o){let r;n instanceof ne?r=n:r=new ye(n,t,o);let{_subscribe:s}=this;try{let l=s.call(this,r);l&&(typeof l=="function"||typeof l.unsubscribe=="function")&&r.add(l)}catch(l){r.error(l)}return r}pipe(...n){return n.length===0?this:n.reduce((t,o)=>o(t),this)}toPromise(){return new Promise((n,t)=>{let o;this.subscribe({next:r=>o=r,error:t,complete:()=>n(o)})})}};var K=!1,Jn=Symbol.for("signal"),Qn=Symbol.for("memo"),Zn=Symbol.for("resource");function X(e){return typeof e=="function"&&e[Jn]===!0}function Xe(e){return typeof e=="function"&&e[Qn]===!0}function Je(e){return typeof e=="function"&&e[Zn]===!0}function Qe(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ze(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function en(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function me(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?me(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}var et="__fluixi_signal_next_state__",nt=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},a=globalThis[et]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:nt,onSuspend:null,onError:null};var nn=0,tn=1,J=2,te=class{constructor(){this.observers=null;this.watchers=null;this.version=0}updateIfNecessary(){}track(){if(a.untracked)return;let n=a.consumer;n&&((this.observers??=new Set).add(n),(n.sources??=new Set).add(this))}},re=class extends te{constructor(n,t){super(),this._value=n,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(n){if(!this._equals(this._value,n)){if(this._value=n,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(J);we(this)}}peek(){return this._value}},j=class extends te{constructor(t,o){super();this._threw=!1;this._initialized=!1;this.state=J;this.sources=null;this._fn=t,this._equals=o?.equals===!1?()=>!1:o?.equals??Object.is}get(){if(a.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===tn&&this.sources){for(let t of this.sources)if(t.updateIfNecessary(),this.state===J)break}(this.state===J||!this._initialized)&&this.recompute(),this.state=nn}recompute(){if(this.sources){for(let f of this.sources)f.observers?.delete(this);this.sources.clear()}let t=a.consumer,o=a.untracked;a.consumer=this,a.untracked=!1;let r,s=!1,l;try{r=this._fn()}catch(f){s=!0,l=f,r=this._value}finally{a.consumer=t,a.untracked=o}let c=!this._initialized||this._threw!==s||(s?l!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=s,this._error=l,this._value=r,c){if(this.version++,this.observers)for(let f of[...this.observers])f.markDirty(J);we(this)}}markDirty(t){if(this.state>=t)return;let o=this.state===nn;if(this.state=t,o){if(this.observers)for(let r of[...this.observers])r.markDirty(tn);we(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function we(e){if(e.watchers)for(let n of[...e.watchers])n._notify(e)}var oe=class{constructor(n){this._watched=new Set;this._pending=new Set;this._notifyFn=n}watch(...n){for(let t of n)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...n){for(let t of n)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let n=[...this._pending];return this._pending.clear(),n}_notify(n){if(!this._watched.has(n)||this._pending.has(n))return;let t=this._pending.size===0;this._pending.add(n),t&&this._notifyFn()}};function tt(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function rn(e){return a.onSuspend?(a.onSuspend(e,a.owner),!0):!1}function Se(){return a.owner}function se(e,n){let t=a.owner;a.owner=e;try{return n()}finally{a.owner=t}}function Oe(e){if(a.owner){if(a.owner.disposed){e();return}(a.owner.cleanups??=[]).push(e)}}function xe(e,n=!0){if(!e.disposed){if(e.owned){for(let t=e.owned.length-1;t>=0;t--)xe(e.owned[t]);e.owned=null}if(e.cleanups){for(let t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}n&&(e.disposed=!0)}}function on(e){a.hostSchedule=e??(n=>{Promise.resolve().then(n)})}function rt(e){e.queued||(e.queued=!0,a.queue.push(e),!a.scheduled&&a.batchDepth===0&&(a.scheduled=!0,a.hostSchedule(Ce)))}function Ce(){if(a.scheduled=!1,a.flushing)return;a.flushing=!0;let e=0;try{for(;a.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let n=a.queue;a.queue=[];for(let t of n)t.queued=!1,t.disposed||t.run()}}finally{a.flushing=!1}}function sn(){a.batchDepth===0&&Ce()}var ge=class{constructor(n){this.queued=!1;this.disposed=!1;this.owner=tt(a.owner),a.owner&&(a.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new j(()=>{xe(this.owner,!1),se(this.owner,()=>{let t=n();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new oe(()=>rt(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(n){if(n&&typeof n.then=="function"&&a.onSuspend){a.onSuspend(n,this.owner);return}if(a.onError&&a.onError(n,this.owner))return;throw n}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),xe(this.owner))}};function un(e){let n=new ge(e);return()=>n.dispose()}function ot(e){return!!e&&typeof e.then=="function"}on(()=>{});var an=Symbol.for("signal"),st=Symbol.for("memo"),it=Symbol.for("signal-node");function Re(e,n){let t=new re(e,{equals:n?.equals}),o=(()=>t.get()),r=(s=>{let l=typeof s=="function"?s(t.peek()):s;return t.set(l),sn(),l});return Object.defineProperty(o,an,{value:!0,enumerable:!0}),Object.defineProperty(o,it,{value:{get value(){return t.peek()},get version(){return t.version}},enumerable:!1}),[o,r]}function ie(e,n,t){let o=n,r=Se(),s=new j(()=>se(r,()=>{try{return o=e(o)}catch(c){if(ot(c))return rn(c),o;throw c}}),{equals:t?.equals}),l=(()=>s.get());return Object.defineProperty(l,an,{value:!0,enumerable:!0}),Object.defineProperty(l,st,{value:!0,enumerable:!0}),l}function _e(e,n){let t=n;return un(()=>{t=e(t)})}function Ae(e,n=(t,o)=>t===o){let t=new Map;return _e(()=>{let o=e();for(let[r,s]of t){let[l,c]=s,f=n(r,o);l()!==f&&c(f)}}),o=>{let r=t.get(o);if(!r){let[s,l]=Re(!1);r=[s,l],t.set(o,r);let c=e();l(n(o,c))}return r[0]()}}function ln(e,n){let[t,o]=Re(e(),n);return _e(()=>{let r=e();n?.timeoutMs?setTimeout(()=>o(()=>r),n.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>o(()=>r)):Promise.resolve().then(()=>o(()=>r))}),t}function cn(e,n){let t,o=(...r)=>{t!==void 0&&clearTimeout(t),t=setTimeout(()=>{t=void 0,e(...r)},n)};return Oe(()=>{t!==void 0&&clearTimeout(t)}),o}function ue(e){if(typeof e=="function"&&!e.length){let n=e();return X(n)?n:ue(n)}if(Array.isArray(e)){let n=[];for(let t=0;t<e.length;t++){let o=ue(e[t]);Array.isArray(o)?n.push.apply(n,o):n.push(o)}return n}return e}function Fe(e){let n=ie(e);return ie(()=>ue(n()))}var Ee=null;function fn(e){Ee=e}function qe(e){Ee&&Ee(e)}var ke=null;function dn(e){ke=e}function Ne(e){return ke?ke(e):void 0}var Pe=null;function pn(e){Pe=e}function Ue(){return Pe?Pe():void 0}var De=null;function hn(e){De=e}function Ie(e,n){De&&De(e,n)}var de=Symbol.for("signal"),bn=Symbol.for("memo"),yn=Symbol.for("resource"),Le=Symbol("fluixi-proxy"),mn=Symbol.for("signal-node"),F=0,Q=1,k=2,E=3,u=null,d=null,i=null,ae=null,le=0,ut=!1,Me=!1,G=0,at=1e6,m=new WeakMap,g=null;var lt=null,ct=new Map,ft=0,ce={context:null,owner:null,routeData:new Map,matchedRoute:new Map};function dt(e){u=e,ce.owner=e,ce.context=e}function pt(){return ce}function ht(){return`node_${++ft}_${Date.now()}`}function vt(e){!1}function wn(e,n,t){let o={id:ht(),type:e,value:n,version:0,equals:t?.equals,name:t?.name,created:Date.now(),updated:Date.now()};return vt(o),o}function xn(e,n){return e===n}function Ge(e){throw typeof console<"u"&&console.error("Reactive error:",e),e}var Be=null,je=null;function gn(){if(!Be){let[e,n]=U(!1);Be=e,je=n}}function Sn(e){if(i)i.indexOf(e)===-1&&i.push(e);else if(g&&g.running&&!e.pure)g.effects.indexOf(e)===-1&&g.effects.push(e);else if(!e.pure||e.computed)Z(e);else if(e.pure&&!e.computed&&e.accessor){let n=d,t=i;d=null,i=[],e.accessor(),d=n;let o=i;if(i=t,o.length>0){let r=i;pe(o),i=r}}}function vn(e,n){for(let t=0;t<e.length;t++)n(e[t])}function U(e,n){let t=e;typeof t=="object"&&t&&Le in t&&delete t[Le];let o=wn("signal",t,{equals:n?.equals===!1?void 0:n?.equals,name:n?.name}),r=[l,c];m.set(r,new Set);let s;function l(){let f=d;if(f){f.sources?f.sources.indexOf(r)===-1&&f.sources.push(r):f.sources=[r];let p=m.get(r);p&&!p.has(f)&&p.add(f)}return t}function c(f){let p=typeof f=="function"?f(t):f,b=o.equals||xn;if(n?.equals===!1||!b(t,p)){t=p,o.value=p,o.version++,o.updated=Date.now();let P=m.get(r);if(P&&P.size>0){let D=function(h,v=!1){let q=h.state;if(!(q===E&&h===d)){if(v&&!h.pure){q===F&&(h.state=Q,ut&&(i!==null&&i.indexOf(h)===-1?i.push(h):C.push(h)));return}if(!w.has(h)&&(w.add(h),h.state=k,q===F||q===Q?C.push(h):!h.pure&&i!==null&&i.indexOf(h)===-1&&i.push(h),h.pure&&h.accessor)){let O=m.get(h.accessor);O&&vn(Array.from(O),R=>D(R,!0))}}};var x=D;let S=Array.from(P),C=[],w=new Set;vn(S,D);for(let h of C)Sn(h)}}}return l.toObservable=()=>new Y(f=>{let p=!0;return $(()=>{let x=l();p?p=!1:f.next(x)})}),Object.defineProperty(l,de,{value:!0,enumerable:!0}),Object.defineProperty(l,mn,{value:o,enumerable:!1}),r}function $(e,n,t){let o={fn:e,state:k,sources:null,sourceSlots:null,owned:null,cleanups:null,owner:u,contexts:null,pure:!1,updatedAt:null};u&&(u.owned?u.owned.push(o):u.owned=[o]);let r=T&&A(T);return r&&(o.suspense=r),Ve(o,n),()=>I(o)}function Ve(e,n){if(e.sources){for(let r of e.sources){let s=m.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.owned){for(let r=0;r<e.owned.length;r++)I(e.owned[r]);e.owned=null}let t=d,o=u;if(d=e,u=e,le++,le>at)throw le=0,d=t,u=o,new Error("Potential infinite loop detected. Exceeded maximum iterations.");try{e.state=E;let r=e.fn(n);typeof r=="function"&&(e.cleanups?e.cleanups.push(r):e.cleanups=[r]),e.state===E&&(e.state=F)}catch(r){if(z(r)){let s=T&&A(T);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}Ge(r)}finally{d=t,u=o}}function Z(e){if(!(e.disposed||!e.fn||e.state===F)&&(e.state===k||e.state===Q||e.state===E)){if(e.cleanups){for(let n=0;n<e.cleanups.length;n++)e.cleanups[n]();e.cleanups=null}if(e.owned){for(let n=0;n<e.owned.length;n++)I(e.owned[n]);e.owned=null}e.renderEffect?qn(e):Ve(e,e.value)}}function I(e){if(e.disposed=!0,e.sources)for(let n of e.sources){let t=m.get(n);t&&t.delete(e)}if(e.cleanups)for(let n=0;n<e.cleanups.length;n++)e.cleanups[n]();if(e.owned)for(let n=0;n<e.owned.length;n++)I(e.owned[n]);if(e.owner&&e.owner.owned){let n=e.owner.owned.indexOf(e);n!==-1&&e.owner.owned.splice(n,1)}}function On(e,n,t){let o=wn("memo",n,{equals:t?.equals===!1?void 0:t?.equals,name:t?.name}),r={fn:e,state:k,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:u,contexts:null,pure:!0,updatedAt:null,node:o,accessor:void 0};u&&(u.owned?u.owned.push(r):u.owned=[r]);let s=()=>{if(d&&d!==r){d.sources?d.sources.indexOf(s)===-1&&d.sources.push(s):d.sources=[s];let c=s;m.has(c)||m.set(c,new Set);let f=m.get(c);f&&f.add(d)}if(r.state!==F){if(r.sources){for(let p of r.sources){let b=m.get(p);b&&b.delete(r)}r.sources=null,r.sourceSlots=null}if(r.cleanups){for(let p=0;p<r.cleanups.length;p++)r.cleanups[p]();r.cleanups=null}if(r.owned){for(let p=0;p<r.owned.length;p++)I(r.owned[p]);r.owned=null}let c=d,f=u;d=r,u=r,r.state=E;try{let p=r.fn(r.value),b=o.equals||xn;if(t?.equals===!1||!b(r.value,p)){r.value=p,o.value=p,o.version++,o.updated=Date.now();let P=s,S=m.get(P);if(S&&S.size>0){let h=function(v,q=!1){if(v===r)return;let O=v.state;if(O!==E){if(q&&!v.pure){O===F&&(v.state=Q,i!==null&&i.indexOf(v)===-1?i.push(v):w.push(v));return}if(!D.has(v)&&(D.add(v),v.state=k,O===F||O===Q?w.push(v):!v.pure&&i!==null&&i.indexOf(v)===-1&&i.push(v),v.pure&&v.accessor)){let R=m.get(v.accessor);if(R&&R.size>0)for(let W of Array.from(R))h(W,!0)}}};var l=h;let C=Array.from(S),w=[],D=new Set;for(let v=0;v<C.length;v++)h(C[v]);for(let v of w)Sn(v)}}r.state===E&&(r.state=F)}catch(p){if(z(p)){let b=T&&A(T);if(!b&&T){let x=f;for(;x;){if(x.contexts?.has(T.id)){b=x.contexts.get(T.id);break}x=x.owner}}return b&&(b.increment(),p.finally(()=>b.decrement())),r.value}Ge(p)}finally{d=c,u=f}}return r.value};return r.accessor=s,m.set(s,new Set),s.toObservable=()=>new Y(l=>{let c=!0;return $(()=>{let p=s();c?c=!1:l.next(p)})}),Object.defineProperty(s,de,{value:!0,enumerable:!0}),Object.defineProperty(s,bn,{value:!0,enumerable:!0}),Object.defineProperty(s,mn,{value:o,enumerable:!1}),s}function pe(e){let n=[],t=[];for(let r of e)r.pure&&!r.computed&&r.accessor?n.indexOf(r)===-1&&n.push(r):(r.computed||!r.pure)&&t.indexOf(r)===-1&&t.push(r);i=[];let o=0;for(;o<n.length;){let r=n[o++],s=m.get(r.accessor);if(s&&s.size>0){let c=d;d=null,r.accessor(),d=c}let l=i.splice(0);for(let c of l)c.pure&&!c.computed&&c.accessor?n.indexOf(c)===-1&&n.push(c):(c.computed||!c.pure)&&t.indexOf(c)===-1&&t.push(c)}i=null;for(let r of t)(r.computed||!r.pure)&&Z(r)}function _(e){if(i&&G>0)return e();if(i&&G===0){let n=i,t=[];i=t,G++;let o;try{o=e()}finally{G--,i=n}let r=i;return pe(t),i=r,o}G++,i=[],ae=[];try{return e()}finally{G--,Cn()}}function Cn(){if(!Me){Me=!0,le=0;try{for(;i&&i.length>0;){let e=i;i=null,pe(e)}if(i=null,ae){let e=ae;ae=null;for(let n=0;n<e.length;n++)Z(e[n])}}finally{Me=!1}}}function Rn(e){let n={owned:null,cleanups:null,contexts:null,owner:u},t=d;d=null;let o=u;u=n;try{return e(()=>{if(n.owned)for(let r=0;r<n.owned.length;r++)I(n.owned[r]);if(n.cleanups)for(let r=0;r<n.cleanups.length;r++)n.cleanups[r]()})}finally{u=o,d=t}}function V(e){let n=d;d=null;try{return e()}finally{d=n}}function fe(e){u&&(u.cleanups?u.cleanups.push(e):u.cleanups=[e])}function _n(e,n,t={}){let o,r;typeof n=="function"?(o=typeof e=="function"?e:()=>e,r=n):(o=()=>!0,r=e,n&&typeof n=="object"&&(t=n));let{initialValue:s,name:l}=t,c=t.transport===!1?void 0:Ue(),f=c!==void 0?Ne(c):void 0,p=f!==void 0,[b,x]=U(f!==void 0?f.value:t.initialValue,{equals:!1}),[P,S]=U(void 0,{equals:!1}),[C,w]=U(f!==void 0||t.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[D,h]=U(void 0,{equals:!1}),[v,q]=U(void 0,{equals:!1}),O=Symbol(),R=O,W=!1,Gn=y=>{if(!(typeof localStorage>"u"))try{y&&localStorage.setItem("storage",JSON.stringify({data:y,timestamp:Date.now()}))}catch(L){console.error(`Failed to save resource to cache (${l}):`,L)}},Vn=$(()=>{let y=o?o():e;if(v(),y===!1||y===null||y===void 0){R=O,_(()=>{w("unresolved"),h(void 0),S(void 0)});return}let L=W;if(W=!1,R!==O&&y===R&&!L)return;if(R=y,p){p=!1;return}let B=!1;fe(()=>B=!0);let He=V(C),$n=V(b),Ye=He==="ready"||He==="refreshing";_(()=>{w(Ye?"refreshing":"pending"),S(void 0)});try{let N=r(y,{value:$n,refetching:Ye});if(z(N)){h(N),qe(N),N.then(M=>{B||(c!==void 0&&Ie(c,M),_(()=>{x(()=>M),Gn(M),w("ready"),h(void 0)}))},M=>{B||_(()=>{S(M),w("errored"),h(void 0)})}).catch(M=>{B||_(()=>{S(M),w("errored"),h(void 0)})});let ve=T&&A(T);ve&&(ve.increment(),N.finally(()=>ve.decrement()))}else{if(B)return;_(()=>{x(()=>N),w("ready"),h(void 0)})}}catch(N){if(B)return;_(()=>{S(N),w("errored"),h(void 0)})}});fe(Vn);let ze=()=>{let y=C();return y==="pending"||y==="refreshing"},ee=(()=>{let y=P();if(y)throw y;if(ze()){let L=D();if(L)throw L}return b()});return Object.defineProperty(ee,yn,{value:!0,enumerable:!0}),Object.defineProperty(ee,de,{value:!0,enumerable:!0}),Object.defineProperties(ee,{state:{get:C},loading:{get:()=>ze()},error:{get:P},latest:{get:b}}),[ee,{mutate:x,refetch:()=>{W=!0,q(void 0)}}]}function An(){return u}function Fn(e,n){let t=u,o=d;u=e,d=null;try{return n()}finally{u=t,d=o}}function he(e){let n=Symbol("context"),t=En(n);return{id:n,Provider:t,defaultValue:e}}function En(e){return n=>{let t=u;for(;t;)t.contexts||(t.contexts=new Map),t.contexts.has(e)||t.contexts.set(e,n.value),t=t.owner;let o;return We(()=>{o=V(()=>{let r=u;return r&&(r.contexts||(r.contexts=new Map),r.contexts.set(e,n.value)),Fe(()=>n.children)})}),o}}function A(e){let n=u;for(;n;){if(n.contexts&&n.contexts.has(e.id))return n.contexts.get(e.id);n=n.owner}if(e)return e.defaultValue}function kn(){return new Promise(e=>{queueMicrotask(()=>{Cn(),e()})})}function $e(e){if(g&&g.running)return e(),g.done;gn();let n,t=new Promise(r=>n=r),o={running:!0,effects:[],resolve:n,done:t};g=o;try{e()}finally{o.running=!1}return o.effects.length?(je(!0),Promise.resolve().then(()=>{let r=o.effects.splice(0);g=null,je(!1),r.length&&_(()=>{for(let s of r)s.state=k,Z(s)}),n()}),t):(g=null,n(),t)}function Pn(){return gn(),[Be,$e]}function Dn(e,n,t){let o=t?.defer??!1,r=!0;return s=>{let l=e();return o&&r?(r=!1,s):V(()=>n(l,s))}}function We(e,n,t){let o={fn:e,state:k,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:u,contexts:null,pure:!1,updatedAt:null,renderEffect:!0};u&&(u.owned?u.owned.push(o):u.owned=[o]);let r=T&&A(T);return r&&(o.suspense=r),qn(o),()=>I(o)}function qn(e){if(e.sources){for(let r of e.sources){let s=m.get(r);s&&s.delete(e)}e.sources=null,e.sourceSlots=null}if(e.cleanups){for(let r=0;r<e.cleanups.length;r++)e.cleanups[r]();e.cleanups=null}if(e.owned){for(let r=0;r<e.owned.length;r++)I(e.owned[r]);e.owned=null}let n=d,t=u,o=i;d=e,u=e,i===null&&(i=[]),e.state=E;try{let r=e.fn(e.value);typeof r=="function"&&(e.cleanups||(e.cleanups=[]),e.cleanups.push(r)),e.value=r,e.state===E&&(e.state=F)}catch(r){if(z(r)){let s=T&&A(T);s&&(s.increment(),r.finally(()=>s.decrement()),e.suspense&&s.effects.push(e));return}Ge(r)}finally{d=n,u=t;let r=i;if(i=o,r!==o&&r&&r.length>0){let s=i;pe(r),i=s}}}function Nn(e,n,t){let o={fn:e,state:k,sources:null,sourceSlots:null,value:n,owned:null,cleanups:null,owner:u,contexts:null,pure:!0,computed:!0,updatedAt:null};u&&(u.owned?u.owned.push(o):u.owned=[o]),g&&g.running?(i||(i=[]),i.indexOf(o)===-1&&i.push(o)):i?i.indexOf(o)===-1&&i.push(o):Ve(o,n)}var T;function Un(){return T||(T=he())}var Tn;function In(){return Tn||(Tn=he())}function Mn(e){if(!e.length)return;let n=e.slice();e.length=0;for(let t of n)t.state=k,Z(t)}function Ln(e){let n=T&&A(T);n&&n.inFallback()?$(()=>{n.inFallback()||e()}):e()}function Bn(e){lt=e}function jn(e){let n=T&&A(T);return n&&(n.increment(),e.finally(()=>n.decrement())),e}var Tt={createSignal:U,createEffect:$,createMemo:On,createComputed:Nn,createRoot:Rn,createSelector:Ae,createResource:_n,batch:_,untrack:V,onCleanup:fe,getOwner:An,runWithOwner:Fn,createContext:he,useContext:A,flush:kn,startTransition:$e,useTransition:Pn,isSignal:X,on:Dn,createRenderEffect:We,getSuspenseContext:Un,getSuspenseListContext:In,resumeEffects:Mn,onResolve:Ln,setScheduler:Bn,trackPromise:jn};
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I,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAK7E;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAC/C,uBAAuB,GAAG,SAAS,CACpC,CAOA;AACD,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAQ1D;AACD,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAO9C;AACD,wBAAgB,YAAY,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,GAAG,IAAI,CAEtE;AACD,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAM/D;AACD,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,QAAQ,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG,CAAC;IACvE,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACF,wBA2BE"}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fine-grained reactive signal system
|
|
3
|
+
* @description Reactive primitives for signals, effects, memos, resources,
|
|
4
|
+
* scheduling, ownership, and dependency tracking.
|
|
5
|
+
*
|
|
6
|
+
* Inspired by:
|
|
7
|
+
* - S.js by Adam Haile (https://github.com/adamhaile/S)
|
|
8
|
+
* - SolidJS by Ryan Carniato (https://github.com/solidjs/solid)
|
|
9
|
+
*
|
|
10
|
+
* This implementation was independently designed and written by
|
|
11
|
+
* Ibrahima Touré.
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2026 Ibrahima Touré
|
|
14
|
+
* Licensed under MIT.
|
|
15
|
+
*/
|
|
16
|
+
import { isPromise } from '../predicates.js';
|
|
1
17
|
import { Observable } from '../observable/observable.js';
|
|
2
|
-
import { isPromise } from '@fluixi/utils';
|
|
3
18
|
// Detection guards + helpers now live in the TC39-owned ./graph/detect.js
|
|
4
19
|
// (graph-agnostic). Imported for internal use, re-exported below for the surface.
|
|
5
20
|
import { __DEV__, isSignal, isMemo, isResource, isComponent, isSuspense, isProvider, makeArrayFlat, } from './graph/detect.js';
|