@fluixi/core 1.0.0-alpha.65 → 1.0.0-alpha.66

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.
@@ -1 +1 @@
1
- "use strict";var Fluixi=(()=>{var mt=Object.defineProperty;var zo=Object.getOwnPropertyDescriptor;var Vo=Object.getOwnPropertyNames;var Uo=Object.prototype.hasOwnProperty;var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var _r=(e,t)=>{for(var r in t)mt(e,r,{get:t[r],enumerable:!0})},Bo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vo(t))!Uo.call(e,o)&&o!==r&&mt(e,o,{get:()=>t[o],enumerable:!(n=zo(t,o))||n.enumerable});return e};var Ko=e=>Bo(mt({},"__esModule",{value:!0}),e);function vt(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function Zo(e){if(m.untracked)return e();m.untracked=!0;try{return e()}finally{m.untracked=!1}}function Ir(e){return!!e&&e.disposed===!0}function Me(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function q(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:r=>{let n=m.owner,o=Me(n);(o.contexts=new Map).set(t,r.value),n&&(n.owned??=[]).push(o),m.owner=o;try{return r.children}finally{m.owner=n}}}}function H(e){let t=m.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id))return t.contexts.get(e.id);t=t.parent}return e.defaultValue}function qr(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function Qo(e,t,r){let n=Me(m.owner);(n.contexts=new Map).set(e.id,t),m.owner&&(m.owner.owned??=[]).push(n);let o=m.owner;m.owner=n;try{return r()}finally{m.owner=o}}function ei(e){m.onSuspend=e}function ti(e){return m.onSuspend?(m.onSuspend(e,m.owner),!0):!1}function ri(e){m.onError=e}function F(){return m.owner}function Hr(e){let t=m.owner;return m.owner=e,t}function W(e,t){let r=m.owner;m.owner=e;try{return t()}finally{m.owner=r}}function A(e){if(m.owner){if(m.owner.disposed){e();return}(m.owner.cleanups??=[]).push(e)}}function Ne(e,t=!0){if(!e.disposed){if(e.owned){for(let r=e.owned.length-1;r>=0;r--)Ne(e.owned[r]);e.owned=null}if(e.cleanups){for(let r=e.cleanups.length-1;r>=0;r--)e.cleanups[r]();e.cleanups=null}t&&(e.disposed=!0)}}function N(e){let t=Me(m.owner);m.owner&&(m.owner.owned??=[]).push(t);let r=m.owner;m.owner=t;try{return e(()=>Ne(t))}finally{m.owner=r}}function ni(e){m.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function oi(e){e.queued||(e.queued=!0,m.queue.push(e),!m.scheduled&&m.batchDepth===0&&(m.scheduled=!0,m.hostSchedule(xt)))}function xt(){if(m.scheduled=!1,m.flushing)return;m.flushing=!0;let e=0;try{for(;m.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=m.queue;m.queue=[];for(let r of t)r.queued=!1,r.disposed||r.run()}}finally{m.flushing=!1}}function ii(){m.batchDepth===0&&xt()}function si(e){m.batchDepth++;try{return e()}finally{--m.batchDepth===0&&xt()}}function St(e){let t=new ai(e);return()=>t.dispose()}function li(e){return!!e&&typeof e.then=="function"}function w(e,t){let r=new Go(e,{equals:t?.equals}),n=(()=>r.get()),o=(a=>{let s=typeof a=="function"?a(r.peek()):a;return r.set(s),ii(),s});return Object.defineProperty(n,Fr,{value:!0,enumerable:!0}),Object.defineProperty(n,ci,{value:{get value(){return r.peek()},get version(){return r.version}},enumerable:!1}),[n,o]}function g(e,t,r){let n=t,o=F(),a=new Dr(()=>W(o,()=>{try{return n=e(n)}catch(i){if(li(i))return ti(i),n;throw i}}),{equals:r?.equals}),s=(()=>a.get());return Object.defineProperty(s,Fr,{value:!0,enumerable:!0}),Object.defineProperty(s,ui,{value:!0,enumerable:!0}),s}function S(e,t){let r=t;return St(()=>{r=e(r)})}function Wr(e,t){let r=t;St(()=>{r=e(r)})}function O(e,t){let r=t;return St(()=>{r=e(r)})}function _(e){return si(e)}function k(e){return Zo(e)}function zr(e,t,r){let n=[];return A(()=>{for(let o of n)o.dispose();n=[]}),g(()=>{let o=e()||[];return k(()=>{if(o.length===0){for(let l of n)l.dispose();return n=[],r?.fallback?r.fallback():[]}let a=new Map;for(let l of n)a.has(l.item)||a.set(l.item,l);let s=[],i=new Set;for(let l=0;l<o.length;l++){let u=o[l],c=a.get(u);if(c&&!i.has(c))c.setIndex(l),s.push(c),i.add(c);else{let f,p,y;N(h=>{y=h;let[b,T]=w(l);p=T,f=t(u,b)});let d={item:u,rendered:f,dispose:y,setIndex:p};s.push(d),i.add(d)}}for(let l of n)i.has(l)||l.dispose();return n=s,s.map(l=>l.rendered)})})}function Vr(e,t,r,n){let o=[],a=[];return A(()=>{for(let s of a)s.dispose();o=[],a=[]}),g(()=>{let s=e()||[];return k(()=>{if(s.length===0){for(let f of a)f.dispose();return o=[],a=[],n?.fallback?n.fallback():[]}let i=new Map;for(let f=0;f<o.length;f++)i.set(o[f],a[f]);let l=[],u=[],c=new Set;for(let f=0;f<s.length;f++){let p=t(s[f]),y=i.get(p);if(y&&!c.has(p))y.setIndex(f),l.push(y);else{let d,h,b;N(T=>{b=T;let[$,ye]=w(f);h=ye;let $e=g(oe=>(e()||[])[$()]??oe,s[f]);d=r($e,$)}),l.push({rendered:d,dispose:b,setIndex:h})}u.push(p),c.add(p)}for(let[f,p]of i)c.has(f)||p.dispose();return o=u,a=l,l.map(f=>f.rendered)})})}function Ur(e,t,r){let n=[];return A(()=>{for(let o of n)o.dispose();n=[]}),g(()=>{let o=e()||[];return k(()=>{if(o.length===0){for(let l of n)l.dispose();return n=[],r?.fallback?r.fallback():[]}let a=n.length,s=o.length;for(let l=a;l<s;l++){let u,c,f,p=o[l];N(y=>{f=y;let[d,h]=w(p);c=h,u=t(d,l)}),n.push({rendered:u,setItem:c,dispose:f})}for(let l=s;l<a;l++)n[l].dispose();s<a&&(n=n.slice(0,s));let i=Math.min(a,s);for(let l=0;l<i;l++)n[l].setItem(o[l]);return n.map(l=>l.rendered)})})}function P(e){return typeof e=="function"&&e[fi]===!0}function pi(e){Nr&&Nr(e)}function Br(e){bt=e}function di(e){return bt?bt(e):void 0}function Kr(e){wt=e}function yi(){return wt?wt():void 0}function hi(e,t){Mr&&Mr(e,t)}function Jr(e,t=(r,n)=>r===n){let r=new Map;return S(()=>{let n=e();for(let[o,a]of r){let[s,i]=a,l=t(o,n);s()!==l&&i(l)}}),n=>{let o=r.get(n);if(!o){let[a,s]=w(!1);o=[a,s],r.set(n,o);let i=e();s(t(n,i))}return o[0]()}}function Xr(e,t){let[r,n]=w(e(),t);return S(()=>{let o=e();t?.timeoutMs?setTimeout(()=>n(()=>o),t.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>n(()=>o)):Promise.resolve().then(()=>n(()=>o))}),r}function Gr(e,t){let r,n=(...o)=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,e(...o)},t)};return A(()=>{r!==void 0&&clearTimeout(r)}),n}function mi(e){return!!e&&typeof e.then=="function"}function K(e,t,r={}){let n,o;typeof t=="function"?(n=typeof e=="function"?e:()=>e,o=t):(n=()=>!0,o=e,t&&typeof t=="object"&&(r=t));let a=yi(),s=a!==void 0?di(a):void 0,i=s!==void 0,[l,u]=w(s!==void 0?s.value:r.initialValue,{equals:!1}),[c,f]=w(void 0,{equals:!1}),[p,y]=w(s!==void 0||r.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[d,h]=w(void 0,{equals:!1}),[b,T]=w(void 0,{equals:!1}),$=gt,ye=!1;S(()=>{let R=n();if(b(),R===!1||R===null||R===void 0){$=gt,_(()=>{y("unresolved"),h(void 0),f(void 0)});return}let _e=ye;if(ye=!1,$!==gt&&R===$&&!_e)return;if($=R,i){i=!1;return}let je=!1;A(()=>je=!0);let Er=k(p),Wo=k(l),$r=Er==="ready"||Er==="refreshing";_(()=>{y($r?"refreshing":"pending"),f(void 0)});try{let Y=o(R,{value:Wo,refetching:$r});mi(Y)?(h(Y),pi(Y),Y.then(Re=>{je||(a!==void 0&&hi(a,Re),_(()=>{u(()=>Re),y("ready"),h(void 0)}))},Re=>{je||_(()=>{f(Re),y("errored"),h(void 0)})})):_(()=>{u(()=>Y),y("ready"),h(void 0)})}catch(Y){if(je)return;_(()=>{f(Y),y("errored"),h(void 0)})}});let $e=()=>{let R=p();return R==="pending"||R==="refreshing"},oe=(()=>{let R=c();if(R)throw R;if($e()){let _e=d();if(_e)throw _e}return l()});return Object.defineProperties(oe,{state:{get:p},loading:{get:$e},error:{get:c},latest:{get:l}}),Object.defineProperty(oe,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(oe,Symbol.for("signal"),{value:!0,enumerable:!0}),[oe,{mutate:u,refetch:()=>{ye=!0,T(void 0)}}]}function At(e){if(typeof e=="function"&&!e.length){let t=e();return P(t)?t:At(t)}if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=At(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function me(e){let t=g(e);return g(()=>At(t()))}function Zr(){let[e,t]=w(0),r=0;return{increment:()=>t(r+=1),decrement:()=>t(r-=1),inFallback:()=>e()>0}}function Tt(e,t){return Qo(Yr,e,t)}var Jo,Xo,m,jr,Rr,he,Lr,Go,Dr,Yo,ai,Fr,ui,ci,fi,Nr,bt,wt,Mr,gt,Yr,gi,kt,x=j(()=>{"use strict";Jo="__fluixi_signal_next_state__",Xo=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},m=globalThis[Jo]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Xo,onSuspend:null,onError:null},jr=0,Rr=1,he=2,Lr=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(m.untracked)return;let e=m.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Go=class extends Lr{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(he);vt(this)}}peek(){return this._value}},Dr=class extends Lr{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=he,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(m.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===Rr&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===he)break}(this.state===he||!this._initialized)&&this.recompute(),this.state=jr}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=m.consumer,t=m.untracked;m.consumer=this,m.untracked=!1;let r,n=!1,o;try{r=this._fn()}catch(s){n=!0,o=s,r=this._value}finally{m.consumer=e,m.untracked=t}let a=!this._initialized||this._threw!==n||(n?o!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=n,this._error=o,this._value=r,a){if(this.version++,this.observers)for(let s of[...this.observers])s.markDirty(he);vt(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===jr;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(Rr);vt(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};Yo=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};ai=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=Me(m.owner),m.owner&&(m.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Dr(()=>{Ne(this.owner,!1),W(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new Yo(()=>oi(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&m.onSuspend){m.onSuspend(e,this.owner);return}if(m.onError&&m.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),Ne(this.owner))}};ni(()=>{});Fr=Symbol.for("signal"),ui=Symbol.for("memo"),ci=Symbol.for("signal-node");fi=Symbol.for("signal");Nr=null;bt=null;wt=null;Mr=null;gt=Symbol();Yr=q();ei((e,t)=>{let r=qr(t,Yr);r&&(r.increment(),e.finally(()=>r.decrement()))});gi=q();ri((e,t)=>{let r=qr(t,gi);return r?(r.setError(e),!0):!1});kt=Symbol.for("fluixi-proxy")});function Le(e,t,r={}){let{preserveStructure:n,multiple:o,throwOnError:a=!1,defaultValue:s,maxDepth:i=20}=r;if(!e||typeof e!="object")return s;if(!t)return e;if(Array.isArray(t))if(n){let c={};for(let f of t){let p=Le(e,f,{...r,preserveStructure:!1});p!==void 0&&bi(c,f,p)}return c}else return t.map(c=>Le(e,c,{...r,preserveStructure:!1}));let l=Ct(t,{...r,throwOnError:a});if(l.length===0)return e;if(typeof n>"u"||n===!1){let c=wi(e,t);return o===!1&&Array.isArray(c)?c[0]:c===void 0&&s!==void 0?s:c}let u=I(e,l,0,i);return u===void 0&&s!==void 0?s:u}function wi(e,t,r={}){let{createMissing:n=!1,add:o=!1,debug:a=!1}=r,s=Ct(t),i=e,l=!1,u="",c=t;if(typeof i=="object"&&!Array.isArray(i)&&c.length>0&&i[c])return i=i[c],i;for(let f=0;f<s.length;f++){let p=s[f],y=s.length>1?f===s.length-1:!1;if(i===null&&!n)return;let d=s[f+1];switch(p.type){case"property":if(i&&typeof i=="object")if(Array.isArray(i)){if(typeof p.value=="number"){let h=p.value;if(n&&h>=i.length)for(let b=i.length;b<=h;b++)i.push(void 0);if(n&&(i[h]===null||i[h]===void 0)&&(!y||l)&&(d?i[h]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{}:i[h]=null,l=!1),i=i[h],d){l=!0;continue}}else o?i.push({[String(p.value)]:null}):i=i.map(h=>h[String(p.value)]);if(d)continue;return Qr(i)}else{if(i[u]&&u.split(".").length>=2){i=i[u];continue}if(n&&(i[String(p.value)]===null||i[String(p.value)]===void 0)&&(!y||l)&&(d?i[String(p.value)]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{}:i[String(p.value)]=null,l=!1,i=i[String(p.value)],d)){l=!0;continue}if(i?(!i[String(p.value)]&&n&&(i[String(p.value)]=null),i=i[String(p.value)]):i={[String(p.value)]:null},d)continue}else if(n)i={},i[String(p.value)]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"||r.type==="array"?[]:{},i=i[String(p.value)];else return;break;case"index":case"wildcard":if(Array.isArray(i)){if(p.type==="index"){let h=p.value;if(h<0){i=i[i.length-Math.abs(h)];continue}if(n&&(h>=i.length||i[h]==null||i[h]==null)&&!y){for(let b=i.length;b<=h;b++)i.push(void 0);d&&(i[h]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{})}i=i[h]}else if(!y)continue}else if(n){let h=s[f+1];i=[];let b=p.value;for(let T=0;T<=b;T++)i.push(void 0);i[b]=h.type==="index"||h.type==="slice"||h.type==="union"||h.type==="wildcard"||r.type==="array"?[]:{},i=i[b]}else{if(p.type==="index"&&typeof i=="object"&&i&&i[String(p.value)]!==void 0){i=i[String(p.value)];continue}if(typeof i=="object"){i=Object.values(i);continue}return}break;default:return}}return Qr(i)}function Qr(e){return Array.isArray(e)?e.filter(t=>typeof t<"u"):e}var De,I,Ct,vi,bi,Ot=j(()=>{"use strict";De=e=>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",I=(e,t,r,n)=>{if(r>n)return;if(t.length===0)return e;let o=t[0],a=t.slice(1);if(o.type==="descendant"){let s=I(e,a,r+1,n);if(s!==void 0)return s;if(e&&typeof e=="object")if(Array.isArray(e)){let i=[];for(let l=0;l<e.length;l++){let u=I(e[l],t,r+1,n);u!==void 0&&(i[l]=u)}return i.length>0?i:void 0}else{let i={};for(let l in e)if(e.hasOwnProperty(l)){let u=I(e[l],t,r+1,n);u!==void 0&&(i[l]=u)}return Object.keys(i).length>0?i:void 0}return}switch(o.type){case"property":if(De(e)&&o.value&&String(o.value)in e){let s=e[String(o.value)],i=I(s,a,r+1,n);if(i!==void 0)return{[String(o.value)]:i}}break;case"index":if(Array.isArray(e)){let s=o.value;if(s>=0&&s<e.length){let i=I(e[s],a,r+1,n);if(i!==void 0){let l=new Array(e.length).filter(u=>u!==void 0);return l[s]=i,l}}}else if(e&&typeof e=="object"){let s=String(o.value);if(s in e){let i=I(e[s],a,r+1,n);if(i!==void 0)return{[s]:i}}}break;case"wildcard":if(e&&typeof e=="object")if(Array.isArray(e)){let s=[],i=!1;for(let l=0;l<e.length;l++){let u=I(e[l],a,r+1,n);u!==void 0&&(s[l]=u,i=!0)}return i?s:void 0}else{let s={},i=!1;for(let l in e)if(e.hasOwnProperty(l)){let u=I(e[l],a,r+1,n);u!==void 0&&(s[l]=u,i=!0)}return i?s:void 0}break;case"slice":if(Array.isArray(e)){let[s,i]=o.value,l=Math.max(0,s),u=Math.min(e.length,i===1/0?e.length:i),c=[],f=!1;for(let p=l;p<u;p++){let y=I(e[p],a,r+1,n);y!==void 0&&(c[p]=y,f=!0)}return f?c:void 0}break;case"union":if(Array.isArray(e)){let s=o.value,i=[],l=!1;for(let u of s)if(u>=0&&u<e.length){let c=I(e[u],a,r+1,n);c!==void 0&&(i[u]=c,l=!0)}return l?i:void 0}break;case"filter":if(Array.isArray(e)){let s=o.value,i=[],l=!1;for(let u=0;u<e.length;u++)if(s(e[u])){let c=I(e[u],a,r+1,n);c!==void 0&&(i[u]=c,l=!0)}return l?i:void 0}break}},Ct=(e,t={})=>{let{type:r="auto",throwOnError:n=!1}=t;if(!e||typeof e!="string")return[];let o=[],a="",s=!1,i=!1,l="",u="",c=0,f=r==="auto"?(y=>y.includes("..")?"descendant":y.includes("[?(")?"filter":y.includes("[:")||y.includes("[0:")?"slice":y.includes("[,")||y.includes("[0,1]")?"union":y.includes("[*]")||y.includes(".*.")?"wildcard":y.includes("[]")?"array-wildcard":y.includes("[")&&y.includes("]")?"bracket":"dot")(e):r,p=y=>{let d=y.trim();if(d==="*"||d==="")return{type:"wildcard",value:d===""?"[]":"*",raw:d===""?"[]":y};if(d==="[]")return{type:"wildcard",value:"[]",raw:y};if(/^-?\d+$/.test(d))return{type:"index",value:parseInt(d,10),raw:y};if(d.includes(":")){let h=d.split(":").map($=>$.trim()),b=h[0]===""?0:parseInt(h[0],10),T=h[1]===""?1/0:parseInt(h[1],10);if(isNaN(b)||isNaN(T)){if(n)throw new Error(`Invalid slice notation: ${y}`);return{type:"wildcard",value:"*",raw:y}}return{type:"slice",value:[b,T],raw:y}}if(d.includes(",")){let h=d.split(",").map(b=>{let T=parseInt(b.trim(),10);return isNaN(T)?-1:T}).filter(b=>b>=0);if(h.length===0){if(n)throw new Error(`Invalid union notation: ${y}`);return{type:"wildcard",value:"*",raw:y}}return{type:"union",value:h,raw:y}}if(d.startsWith("?(")&&d.endsWith(")")){let h=d.slice(2,-1);try{return{type:"filter",value:vi(h),raw:y}}catch(b){if(n)throw b;return{type:"wildcard",value:"*",raw:y}}}return d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'")?{type:"property",value:d.slice(1,-1),raw:y}:{type:"property",value:d,raw:y}};for(let y=0;y<e.length;y++){let d=e[y],h=e[y+1];if((d==='"'||d==="'")&&!i){i=!0,l=d;continue}else if(d===l&&i){i=!1,l="",d==='"'||d==="'"||(s?u+=d:a+=d);continue}if(i){s?u+=d:a+=d;continue}if(d==="["&&!s){a&&(o.push({type:"property",value:a,raw:a}),a=""),s=!0,u="";continue}if(d==="]"&&s&&!i){s=!1;let T=p(u);o.push(T);continue}let b=o.length>0?o[o.length-1]:null;if(d==="."&&!s&&!i){if(h==="."){let T=e.split("..")[0];o.push({type:"property",value:T,raw:T}),o.push({type:"descendant",value:"..",raw:".."}),y++}else a&&(a==="*"?o.push({type:"wildcard",value:a,raw:a}):o.push({type:"property",value:a,raw:a}),a="");continue}if(s)u+=d;else if(b&&b.type!=="descendant")a+=d;else{let T=e.split(b?.raw)[1];T!==void 0?a=T:a+=d}}return a&&o.push({type:"property",value:a,raw:a}),o.map(y=>{if(y.type==="property"&&typeof y.value=="string"&&/^-?\d+$/.test(y.value)){let d=parseInt(y.value,10);if(!isNaN(d))return{...y,type:"index",value:d}}return y})},vi=e=>{let t=e.replace(/@\.([a-zA-Z_$][\w$]*)/g,(r,n)=>`item.${n}`).replace(/@/g,"item");try{return new Function("item",`return ${t}`)}catch{throw new Error(`Invalid filter expression: ${e}`)}},bi=(e,t,r)=>{let n=Ct(t),o=e;for(let a=0;a<n.length;a++){let s=n[a],i=a===n.length-1;switch(s.type){case"property":if(i)o[String(s.value)]=r;else{if(!o[String(s.value)]){let u=n[a+1];o[String(s.value)]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{}}o=o[String(s.value)]}break;case"index":Array.isArray(o)||(o=[]);let l=s.value;if(i){if(l>=o.length)for(let u=o.length;u<=l;u++)o.push(void 0);o[l]=r}else{if(!o[l]){let u=n[a+1];o[l]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{}}o=o[l]}break;case"wildcard":if(Array.isArray(o))if(i)for(let u=0;u<o.length;u++)o[u]=r;else{let u=n[a+1];for(let c=0;c<o.length;c++)o[c]||(o[c]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{});o.length>0&&(o=o[0])}break}}}});function Ii(e){return e.localName.includes("-")}function bn(e,t,r,n=!1){if(r==null){e.removeAttribute(t);return}if(Ii(e)){e[t]=r;return}C(e,t,r,n)}function kn(e,...t){e.classList.add(...t)}function Cn(e,...t){e.classList.remove(...t)}function On(e,...t){t.forEach(r=>e.classList.toggle(r))}function C(e,t,r,n=!1){if(r==null||r===!1){e.removeAttribute(t);return}if(r===!0){e.setAttribute(t,"");return}if(typeof r=="object"){e.setAttribute(t,JSON.stringify(r));return}e.setAttribute(t,String(r))}function Pn(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Xe(e){return e instanceof Node}function En(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Ge(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function $n(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function qi(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Hi(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Fi(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Wi(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function zi(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Vi(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function U(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ui(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function _n(e){return qi(e)?{type:"router",value:e}:Fi(e)?{type:"route",value:e}:Hi(e)?{type:"routes",value:e}:Wi(e)?{type:"outlet",value:e}:U(e)?{type:"component",value:e}:Ui(e)?{type:"suspense",value:e}:zi(e)?{type:"provider",value:e}:Vi(e)?{type:"context",value:e}:{type:"none",value:e}}function Ft(){if(!An)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return An}function Wt(e){return e!=null&&e[Ze]===!0?!0:typeof Node<"u"&&e instanceof Node}function Bi(e){return e!=null&&e[Ze]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Ki(e){return e!=null&&e[Ze]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}function Ji(e){jn=e}function Rn(){return jn}function xn(e,t){return v.active&&t.parentNode===e}function Nn(e){let t=v.parents.lastIndexOf(e);t!==-1&&(v.parents.length=t),v.cursor=e.nextSibling}function Mn(e){if(!v.active)return e();let t=v.cursor,r=v.parents;v.active=!1,v.parents=[];try{return e()}finally{v.active=!0,v.cursor=t,v.parents=r}}function Ln(e){if(!v.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Nn(t)}function Q(e){if(!Ye)for(let t of e)Ve.has(t)||zt.has(t)||(Ve.add(t),document.addEventListener(t,Gi))}function Gi(e){let t=`$$${e.type}`,r=e.composedPath&&e.composedPath()[0]||e.target;for(;r;){let n=r[t];if(n&&!r.disabled&&(n(e),e.cancelBubble))return;r=r.host&&r.host!==r&&r.host instanceof Element?r.host:r.parentNode}}function Yi(e,t,r){if(e[`$$${t}`]=r,zt.has(t)){let n=`__fx_${t}`;if(!e[n]){let o=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,o),e[n]=o}return}Ve.has(t)||Q([t])}function Sn(e,t){delete e[`$$${t}`];let r=`__fx_${t}`,n=e[r];n&&(e.removeEventListener(t,n),delete e[r])}function J(e,t=!1){if(Ye)return Ft().createText(e);if(v.active&&!t){let r=Rn()?.hydrateText(e);if(r)return r}return document.createTextNode(e)}function ae(e,t=!1){if(Ye)return Ft().createElement(e,t);if(v.active){let r=Rn()?.hydrateElement(e);if(r)return r}return t?document.createElementNS(Ht,e):document.createElement(e)}function Qi(e,t,r,n,o){let a=n,s=new Map;return O(()=>{let i;if(U(e)&&!P(e)){if(!s.has(e)){V++;try{let l=e();s.set(e,l)}finally{V--}}for(i=s.get(e);typeof i=="function"&&P(i);)i=i()}else for(i=e();typeof i=="function"&&P(i);)i=i();{let l=0;for(;typeof i=="function"&&l++<50;)if(U(i)){if(!s.has(i)){let u=i;V++;try{let c=u();s.set(u,c)}finally{V--}}i=s.get(i)}else if(P(i))i=i();else if(i=i(),typeof i!="function"||!P(i)&&!U(i))break}V++;try{a=Ue(t,i,r,a,s),o(a)}finally{V--}})}function L(e,t,r,n){if(V>Zi)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;r!==void 0&&!r&&(r=J("",!0),e.appendChild(r));let o=n??null,a=l=>Array.isArray(l)&&l.some(u=>typeof u=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!a(t)){V++;try{o=Ue(e,t,r,null)}finally{V--}return()=>o}let i=Qi(s(t),e,r,o,l=>{o=l});return()=>(i?.(),o)}function Ue(e,t,r,n,o){if(t==null||typeof t=="boolean")return Z(e,n,r);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return Z(e,n,r);if(ze(t)){let s=J("",!0);return Array.isArray(n)?n.length>0?(e.replaceChild(s,n[0]),Z(e,n.slice(1),r)):M(e,s,r):n?e.replaceChild(s,n):M(e,s,r),t.then(i=>{s.parentNode===e&&Ue(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(n)){if(n.length===0){let i=J(t);return M(e,i,r),i}if(n.length===1&&n[0].nodeType===3)return n[0].data=t,n;n=Z(e,n,r)}if(n&&Ki(n))return n.data=t,n;let s=J(t);return n&&n.parentNode===e?e.replaceChild(s,n):xn(e,s)||M(e,s,r),s}if(Wt(t))return xn(e,t)?(Nn(t),t):Array.isArray(n)?(n.length===0?M(e,t,r):n[0].parentNode===e?(e.replaceChild(t,n[0]),Z(e,n.slice(1),r)):M(e,t,r),t):(n?n!==t&&(n.parentNode===e?e.replaceChild(t,n):M(e,t,r)):M(e,t,r),t);if(Array.isArray(t)){let s=[],i=Array.isArray(n)?n:n?[n]:[],l=[];z(t,s,e,r,!0,o,l);let u=es(e,i,s,r);for(let c of l){let f=L(e,c.sig,c.marker);A(()=>{Z(e,f()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(a==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let l=i.type(i.props||{});return Ue(e,l,r,n)}}}return Z(e,n,r)}function z(e,t,r,n,o=!0,a,s){for(let i=0;i<e.length;i++){let l=e[i];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!ze(l)&&!P(l)&&!U(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let u;for(U(l)&&!P(l)?(a||(a=new Map),a.has(l)||a.set(l,l()),u=a.get(l)):u=l();typeof u=="function"&&!ze(u)&&!P(u)&&!U(u);)a||(a=new Map),a.has(u)||a.set(u,u()),u=a.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(P(u)){if(s){let f=J("",!0);t.push(f),s.push({marker:f,sig:u});continue}let c=u();for(;typeof c=="function"&&P(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?z(c,t,r,n,o,a):z([c],t,r,n,o,a);continue}continue}Array.isArray(u)?z(u,t,r,n,o,a,s):z([u],t,r,n,o,a,s);continue}if(ze(l)){let u=J("",!0);t.push(u),l.then(c=>{if(u.parentNode){let f=[];if(z([c],f,u.parentNode,void 0,!1,a),f.length>0){u.parentNode.replaceChild(f[0],u);for(let p=1;p<f.length;p++)u.parentNode?.insertBefore(f[p],f[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(l)){z(l,t,r,n,o,a,s);continue}if(Wt(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let u=l;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?z(c,t,r,n,!1,a):z([c],t,r,n,!1,a);continue}}if(typeof l=="string"||typeof l=="number"){let u=String(l);if(u.trim()===""&&u!==" ")continue;t.push(J(u));continue}t.push(J(String(l)))}}}}function es(e,t,r,n){for(let f=0;f<r.length;f++)r[f].parentNode!==null&&r[f].parentNode!==e&&(r=r.slice(),r[f]=r[f].cloneNode(!0));let o=r.length,a=t.length,s=o,i=0,l=0,u=a>0?t[a-1].nextSibling??void 0:n,c=null;for(;i<a||l<s;){if(t[i]===r[l]){i++,l++;continue}for(;a>i&&s>l&&t[a-1]===r[s-1];)a--,s--;if(a===i){let f=s<o?l?r[l-1].nextSibling??void 0:r[s-l]:u;for(;l<s;)M(e,r[l++],f)}else if(s===l)for(;i<a;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===r[s-1]&&r[l]===t[a-1]){let f=t[--a].nextSibling;M(e,r[l++],t[i++].nextSibling),M(e,r[--s],f),t[a]=t[i-1]}else{if(!c){c=new Map;let p=l;for(;p<s;)c.set(r[p],p++)}let f=c.get(t[i]);if(f!=null)if(l<f&&f<s){let p=i,y=1;for(;++p<a&&p<s&&!(!c.has(t[p])||c.get(t[p])!==f+y);)y++;if(y>f-l){let d=t[i];for(;l<f;)M(e,r[l++],d)}else t[i].parentNode===e?e.replaceChild(r[l++],t[i++]):(M(e,r[l++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return r}function Z(e,t,r){if(t)if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n].parentNode===e&&e.removeChild(t[n]);else t.parentNode===e&&e.removeChild(t);return null}function M(e,t,r){v.active&&t.parentNode===e||(r&&r.parentNode===e?e.insertBefore(t,r):e.appendChild(t))}function se(e,t,r){r==null?delete e[t]:e[t]=r}function Dn(e,t,r){let n=r,o;return Array.isArray(r)&&(n=r[0],o=r[1]),typeof n!="function"?()=>{}:(e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o))}function In(e,t){let r=(n,o)=>{typeof n=="function"&&n(e,o??(()=>{}))};if(typeof t=="function"){r(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){r(t[0],t[1]);return}for(let n of t)Array.isArray(n)?r(n[0],n[1]):r(n)}}function Lt(e,t,r,n=!1){return typeof r!="function"?(C(e,t,r,n),()=>{}):O(()=>{let o=typeof r=="function"?r():r;C(e,t,o,n)})}function Dt(e,t,r){return typeof r!="function"?(se(e,t,r),()=>{}):O(()=>{let n=typeof r=="function"?r():r;se(e,t,n)})}function qn(e,t,r){return typeof r!="function"?(C(e,t,!!r),()=>{}):O(()=>{let n=r();C(e,t,!!n)})}function Be(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){O(()=>Be(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let r=Object.keys(t).filter(n=>{let o=t[n];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",r);return}e.setAttribute("class",String(t))}function Ke(e,t,r){if(!(!t||typeof t!="object"))for(let n in t){let o=t[n],a=n.split(/\s+/).filter(Boolean);if(typeof o=="function"&&r)r.push(O(()=>{let s=!!o();for(let i of a)e.classList.toggle(i,s)}));else{let s=!!(typeof o=="function"?o():o);for(let i of a)e.classList.toggle(i,s)}}}function Je(e,t){let r=t;for(;typeof r=="function";)r=r();if(r==null){e.removeAttribute("style");return}if(typeof r=="string"){e.style.cssText=r;return}if(typeof r=="object")for(let n in r){let o=r[n];o==null?e.style[n]="":e.style[n]=o}}function Hn(e){let{element:t,props:r,prevProps:n=Xi,isSVG:o=!1,skipChildren:a=!1}=e;if(!t||!Bi(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!r)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===Ht,i=[];for(let l in r){if(a&&l==="children")continue;let u=r[l],c=n[l];if(u===c)continue;if(l==="ref"){Vt(u,t);continue}if(l==="use"){In(t,u);continue}if(l.startsWith("on:")){i.push(Dn(t,l.slice(3),u));continue}if(l.startsWith("prop:")){i.push(Dt(t,l.slice(5),u));continue}if(l.startsWith("attr:")){i.push(Lt(t,l.slice(5),u,s));continue}if(l.startsWith("bool:")){i.push(qn(t,l.slice(5),u));continue}if(l==="class"||l==="className"){typeof u=="function"?i.push(O(()=>Be(t,u()))):Be(t,u);continue}if(l==="classList"){typeof u=="function"?i.push(O(()=>Ke(t,u()))):Ke(t,u,i);continue}if(l==="style"){typeof u=="function"?i.push(O(()=>Je(t,u()))):Je(t,u);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();c&&Sn(t,p),u&&Yi(t,p,u);continue}let f=wn.has(l)||!s&&l in t;typeof u=="function"?i.push(f?Dt(t,l,u):Lt(t,l,u,s)):i.push(O(()=>f?se(t,l,r[l]):C(t,l,r[l],s)))}for(let l in n)if(!(l in r))if(l.startsWith("on")){let u=l.slice(2).toLowerCase();Sn(t,u)}else wn.has(l)?se(t,l,null):t.removeAttribute(l);return()=>{i.forEach(l=>l())}}function ts(e,t,r=!1){for(let n in t){let o=t[n];if(n==="ref"){Vt(o,e);continue}if(n!=="children"){if(n==="use"){In(e,o);continue}if(n.startsWith("on:")){Dn(e,n.slice(3),o);continue}if(n.startsWith("prop:")){Dt(e,n.slice(5),o);continue}if(n.startsWith("attr:")){Lt(e,n.slice(5),o,r);continue}if(n.startsWith("bool:")){qn(e,n.slice(5),o);continue}if(n.startsWith("on")&&n.length>2){let a=n.slice(2).toLowerCase();if(typeof o=="function")if(zt.has(a)){e[`$$${a}`]=o;let s=`__fx_${a}`;if(!e[s]){let i=l=>{e[`$$${a}`]?.(l)};e.addEventListener(a,i),e[s]=i}}else e[`$$${a}`]=o,Ve.has(a)||Q([a]);continue}if(n==="class"||n==="className"){Be(e,o);continue}if(n==="classList"){typeof o=="function"?O(()=>Ke(e,o())):Ke(e,o);continue}if(n==="style"){typeof o=="function"?O(()=>Je(e,o())):Je(e,o);continue}if(n==="innerHTML"){if(typeof o=="function"){let a=S(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});A(()=>a())}else e.innerHTML=o;continue}if(n==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let a=S(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});A(()=>{a()})}else O(()=>{document.activeElement!==e&&(e.value=t[n]??"")});continue}if(n==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let a=S(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});A(()=>{a()})}else O(()=>{document.activeElement!==e&&(e.checked=t[n]??"")});continue}if(n==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let a=!0,s=S(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});A(()=>{s()})}else{let a=!0;O(()=>{let s=t[n];a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let a=S(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();bn(e,n,s,r)});A(()=>{a()})}else O(()=>bn(e,n,t[n],r))}}}function Vt(e,t){if(e){if(Wt(e)){let r=t,n=e;if(!r)return;typeof r=="function"?r(n):typeof r=="object"&&"current"in r&&(r.current=n);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function rs(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function ze(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Ut(e,t,r){if(!t)throw new Error("Container element is required");let n,o,a=[];return N(s=>{_(()=>{v.active||(t.textContent=""),L(t,e)}),o=s}),()=>{o?.(),n?.(),a.forEach(s=>s()),t.textContent=""}}function Fn(e){It.fn=e}function X(e,t){return It.fn?It.fn(e,t):(()=>e(t))}function Bt(){let e=globalThis.__FX_DATA__;if(e)return e;if(Mt!==void 0)return Mt;let t=null;if(typeof document<"u"){let r=document.getElementById(os)?.textContent;if(r)try{t=JSON.parse(r)}catch{t=null}}return Mt=t}function Kt(){for(;;){for(;v.cursor&&v.cursor.nodeType===3&&v.cursor.data==="";)v.cursor=v.cursor.nextSibling;if(v.cursor!=null||!v.parents.length)return;v.cursor=v.parents.pop().nextSibling}}function Xt(e,t){let r=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${r}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function ss(e){Kt();let t=v.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(is.has(e.toLowerCase())?v.cursor=t.nextSibling:(v.parents.push(t),v.cursor=t.firstChild),t):(Jt&&t&&Xt(`<${e}>`,t),null)}function as(e){if(e===""){let r=v.cursor;return r&&r.nodeType===3&&r.data!==""?(v.cursor=r.nextSibling,r.data="",r):null}Kt();let t=v.cursor;return t&&t.nodeType===3?(v.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Jt&&t&&Xt(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function ls(e){Kt();let t=v.cursor;return t&&t.nodeType===8&&t.data===e?(v.cursor=t.nextSibling,t):(Jt&&t&&Xt(`marker <!--${e.slice(0,24)}-->`,t),null)}function us(){Tn||(Tn=!0,Ji({hydrateElement:ss,hydrateText:as,hydrateMarker:ls}))}function Qe(e,t,r){us(),v.active=!0,v.cursor=t.firstChild,v.parents=[];let n=Bt(),o=r?.resourceNamespace,a=0;Kr(()=>o?`${o}:r${a++}`:`r${a++}`),Br(n?s=>s in n?{value:n[s]}:void 0:null);try{return Ut(e,t)}finally{v.active=!1,v.cursor=null,v.parents=[]}}function Wn(e,t={}){if(typeof e=="function")return X(e,t);if(typeof e!="string"||e.length===0)return null;let r=rs(e);if(Ye)return Ft().createElement(e,r);let n=r?document.createElementNS(Ht,e):document.createElement(e);return ts(n,t,r),cs(n,t),n}function cs(e,t){if(!t||t.children===void 0)return;let r=me(()=>t.children),n=o=>{L(e,o,typeof o=="function"?null:void 0)};Array.isArray(r)?r.forEach(n):n(r)}function fs(e){return typeof e=="function"?e:(()=>e)}function et(e){return()=>{let t=e();return typeof t=="function"?t():t}}function ps(e){return e!=null&&e!==!1}function ds(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function zn(e){let t=et(()=>e.when),r=g(t,void 0),n=g(r,void 0);return g(()=>{if(n()){let o=e.children;return typeof o=="function"&&!ds(o)?typeof r=="function"?k(()=>k(r)?o(r()):e.fallback):o(r):o}return e.fallback},void 0,{name:"show"})}function Vn(e){let t=et(()=>e.each),r=()=>e.fallback??null,n=(o,a)=>{let s=e.children,i=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,a):l):typeof s=="function"?s(o,a):s;return Ln(i),i};return e.by?Vr(t,e.by,(o,a)=>n(o,a),{fallback:r}):zr(t,(o,a)=>n(o,a),{fallback:r})}function Un(e){let t=et(()=>e.each);return Ur(t,(r,n)=>{let o=e.children(r,n);return Ln(o),o},{fallback:()=>e.fallback??null})}function Bn(e){return{[qt]:!0,when:et(()=>e.when),children:e.children}}function Kn(e){let t=Array.isArray(e.children)?e.children:[e.children];return g(()=>{for(let r of t){let n=r,o=0;for(;typeof n=="function"&&!n[qt]&&o++<10;)n=n();if(!n||typeof n!="object"||n[qt]!==!0)continue;let a=n.when();if(ps(a))return typeof n.children=="function"?n.children(a):n.children}return e.fallback??null})}function Jn(e){let t=fs(e.component),{component:r,...n}=e;return g(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:n}:o(n)})}function Xn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,r,n;return N(o=>{r=o,n=document.createElement("div"),n.style.display="contents",t().appendChild(n),L(n,e.children)&&Vt(e.ref,n)}),A(()=>{r(),n.remove()}),null}function Gn(e){let[t,r]=w(null),n=()=>r(null);return g(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,n):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(a){return r(a),typeof e.fallback=="function"?e.fallback(a,n):e.fallback}})}function Yn(e){return g(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t))n&&(typeof o=="function"?o():o)&&r.push(n);return r.join(" ")})}function ys(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Zn(e){return g(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t)){if(!n)continue;let a=typeof o=="function"?o():o;a!=null&&r.push(`${ys(n)}: ${a}`)}return r.join("; ")})}var Ht,wn,Ta,Ye,Ze,An,v,jn,Xi,Ve,zt,V,Zi,ns,It,os,Mt,is,Jt,Tn,qt,hs,D=j(()=>{"use strict";x();x();x();x();x();x();x();x();x();x();x();x();x();Ht="http://www.w3.org/2000/svg";wn=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);Ta=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;Ye=typeof document>"u",Ze=Symbol.for("fluixi.server-node"),An=null;v={active:!1,cursor:null,parents:[]},jn=null;Xi={},Ve=new Set,zt=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);V=0,Zi=200;ns="__fx_dom_create_component__",It=globalThis[ns]??={fn:null};os="__FX_DATA__";is=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Jt=typeof process<"u"&&process.env&&!1;Tn=!1;qt=Symbol("match");hs=Ze});function Yt(){return ms}function Qn(){let e=F();if(!e)return null;if(!e[Gt]){let t={mounts:[],effects:[],scheduled:!1};e[Gt]=t}return e[Gt]}function eo(e){if(e.scheduled)return;e.scheduled=!0;let t=F();queueMicrotask(()=>{if(Ir(t)){e.mounts=[],e.effects=[];return}W(t,()=>{for(let r of e.mounts)try{let n=r();typeof n=="function"&&A(n)}catch(n){console.error("Error in onMount callback:",n)}for(let r of e.effects){let n;S(()=>{n&&n(),n=r()}),A(()=>{n&&n()})}e.mounts=[],e.effects=[]})})}function G(e){Fn(be)}function be(e,t){return tt(e,t)}function tt(e,t){let r=typeof e=="function"?k(()=>e(t)):e;if(r!=null&&(typeof r=="function"||typeof r=="object")&&!P(r)){try{r.$name=e.name}catch{}return Ge(r)}return r}function rt(e,t=!0){let r=Qn();if(r){if(!t){r.scheduled||e();return}r.mounts.push(e),eo(r)}else{if(!t){e();return}S(()=>{let n=k(e);typeof n=="function"&&A(n)})}}function nt(e){A(e)}function we(e){let t=Qn();if(t)t.effects.push(e),eo(t);else{let r;S(()=>{r&&r(),r=e()}),A(()=>{r&&r()})}}function ot(e){return g(e)}function it(e){let t={current:e};return A(()=>{t.current=null}),t}function st(e,t){let[r,n]=w(t);return[r,a=>{n(e(r(),a))}]}function at(e,t,r,n){we(()=>{let o=e&&"current"in e?e.current:e;if(o)return o.addEventListener(t,r,n),()=>{o.removeEventListener(t,r,n)}})}function lt(e){return e}function Zt(){return ve}function Qt(e){ve&&e()}var ms,ve,Gt,le=j(()=>{"use strict";D();x();ms={context:null,owner:null};ve=typeof process<"u"&&!1,Gt=Symbol.for("fluixi-lifecycle")});function xe(e,t){let r,n,o;function a(){return n||(n=e().then(i=>r=i.default)),n}t?.preload&&a();let s=(i=>{if(r){let l=r;return k(()=>l(i))}if(!o){let[l]=K(()=>a());if(o=l,l.error)throw l.error}return g(()=>{let l=o();return l?k(()=>l(i)):void 0},void 0,{name:"lazy"})});return s.preload=()=>a().then(()=>{}),s.$lazy=!0,s.loader=e,s}var er=j(()=>{"use strict";x()});function ws(){so||(so=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function ut(e,t,r){let n=!!e?.Provider,o=n?e:e.context,a=n?t:e.value,s=n?!1:e.debug??!1;n||ws();let i=typeof a=="function"?a():a,l=n?r:e;return o.Provider({value:i,get children(){return l?.children},debug:s})}function ao(e){let t=ce(e);return[t,n=>ut(t,n.value,n)]}function rr(e,t){if(e.length===0)return me(()=>t);let[r,n]=e[0],o=e.slice(1);return ut(r,n,{get children(){return rr(o,t)}})}function lo(e){return t=>{let r=fe(e);return t.children(r)}}function uo(e,t){let r=fe(e);return r===e.defaultValue?t():r}function ce(e){let t=q(e),r=n=>(n.debug,t.Provider({value:n.value,get children(){return n.children},debug:n.debug}));return typeof Symbol<"u"&&Symbol.for&&(r.$$typeof=Symbol.for("react.provider")),r.$$typeof=Symbol.for("react.provider"),{id:t.id,Provider:En(r),defaultValue:e}}function fe(e){let t=H(e);return t!==void 0?t:e.defaultValue}var so,nr=j(()=>{"use strict";D();x();x();le();G("index");so=!1});function vo(){return go}function sr(e){go=e}function bo(e,t){ct.set(e,t)}function wo(e){return ct.get(e)}function Os(){ct.clear()}function Ao(){if(typeof window>"u")return!1;let e=document.getElementById("__FLUIXI_HYDRATION__");if(!e||e.getAttribute("type")!=="application/json")return!1;try{let t=e.textContent||"{}",r=JSON.parse(t);for(let[n,o]of Object.entries(r))ct.set(n,o);return!0}catch(t){return console.error("Failed to deserialize hydration data:",t),!1}}function ar(){if(typeof window>"u")return;let e=document.getElementById("__FLUIXI_HYDRATION__");e&&e.remove();let t=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),r=[],n;for(;n=t.nextNode();){let o=n,a=o.nodeValue||"";(a.startsWith("#")||a.startsWith("/"))&&r.push(o)}r.forEach(o=>o.remove()),Os()}function xo(){return typeof window>"u"}var go,ct,lr=j(()=>{"use strict";go=!1,ct=new Map;typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(ar,100)})});function Fs(e,t,r){let n=new Uint8Array(t.length);e:for(let o=0;o<e.length;o++){for(let a=0;a<t.length;a++)if(!n[a]&&te(e[o],t[a],r)){n[a]=1;continue e}return!1}return!0}var te,To=j(()=>{"use strict";Ot();te=(e,t,r={})=>{if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;let n=Array.isArray(e),o=Array.isArray(t);if(n!==o)return!1;if(n&&o)return e.length!==t.length?!1:r.unordered?Fs(e,t,r):e.every((h,b)=>te(h,t[b],r));if(typeof e!="object")return e===t;let a=e instanceof Date,s=t instanceof Date;if(a!==s)return!1;if(a)return e.getTime()===t.getTime();let i=e instanceof RegExp,l=t instanceof RegExp;if(i!==l)return!1;if(i)return e.toString()===t.toString();let u=e instanceof Map,c=t instanceof Map;if(u!==c)return!1;if(u){if(e.size!==t.size)return!1;for(let[h,b]of e)if(!t.has(h)||!te(b,t.get(h),r))return!1;return!0}let f=e instanceof Set,p=t instanceof Set;if(f!==p)return!1;if(f){if(e.size!==t.size)return!1;let h=[...t],b=new Uint8Array(h.length);e:for(let T of e){for(let $=0;$<h.length;$++)if(!b[$]&&te(T,h[$],r)){b[$]=1;continue e}return!1}return!0}if(!De(e)||!De(t))return!1;let y=Object.keys(e),d=Object.keys(t);if(y.length!==d.length)return!1;for(let h of y)if(!Object.prototype.hasOwnProperty.call(t,h)||!te(e[h],t[h],r))return!1;return!0}});function Ws(e){return e.startsWith("//")?e.replace(/^\/+/,"/"):e}function pe(e,t,r=!1){let n=[];if(e===t)return{params:{},path:t};if(!r&&e==="/"&&t.startsWith("/"))return{params:{},path:"/"};let o=e.replace(/:([a-zA-Z0-9_]+)/g,(l,u)=>(n.push(u),"([^/]+)")).replace(/\*([a-zA-Z0-9_]*)/g,(l,u)=>(u&&n.push(u),"(.*)"));o.startsWith("/")||(o="/"+o),o===""&&(o="/");let a=new RegExp(`^${o}${r?"$":"(?=/|$)"}`),s=t.match(a);if(!s)return null;let i={};return n.forEach((l,u)=>{i[l]=s[u+1]}),{params:i,path:s[0]}}function dr(e){let t=e.path.split("/").filter(Boolean);if(t.length===0)return 5;let r=0;for(let n of t)n.startsWith("*")?r+=1:n.startsWith(":")?r+=10:r+=100;return r}function ko(e){return[...e].sort((t,r)=>dr(r)-dr(t))}function re(e,t){let r=t.length>1?t.replace(/\/+$/,"")||"/":t,n=Co(e,r);if(!n)return null;let o=[],a="",s={};for(let i of n.layers){a=Ws(zs(a,i.consumed));let l={};for(let[u,c]of Object.entries(i.params))u in s||(l[u]=c),s[u]=c;o.push({route:i.route,component:i.route.component,params:l,pathname:a||"/"})}return{matched:o,params:s,pathname:t}}function Co(e,t){if(!e||e.length===0)return null;let r=ko(e);for(let n of r){let o=!!n.children&&n.children.length>0,a=pe(n.path,t,!o);if(a){if(o){let s=Co(n.children,t);if(s)return{layers:[{route:n,params:a.params,consumed:a.path},...s.layers]};continue}return{layers:[{route:n,params:a.params,consumed:a.path}]}}}return null}function zs(e,t){if(!e)return t;if(t===e)return e;if(t.startsWith(e))return t;let r=e.replace(/\/$/,""),n=t.replace(/^\//,"");return`${r}/${n}`}var yr=j(()=>{"use strict"});function hr(e){let t=e,r="",n=t.indexOf("#");n!==-1&&(r=t.slice(n),t=t.slice(0,n));let o="",a=t.indexOf("?");return a!==-1&&(o=t.slice(a),t=t.slice(0,a)),{pathname:t||"/",search:o,hash:r}}function ke(e="/"){let t=[{path:e,state:null}],r=0,n=new Set,o=()=>n.forEach(a=>a());return{get(){let{path:a,state:s}=t[r];return{...hr(a),state:s}},push(a,s=null){t=t.slice(0,r+1),t.push({path:a,state:s}),r=t.length-1,o()},replace(a,s=null){t[r]={path:a,state:s},o()},subscribe(a){return n.add(a),()=>n.delete(a)}}}function ne(){let e=typeof window<"u"?window:void 0,t=new Set,r=()=>t.forEach(n=>n());return e&&e.addEventListener("popstate",r),{get(){if(!e)return{pathname:"/",search:"",hash:"",state:null};let{pathname:n,search:o,hash:a}=e.location;return{pathname:n,search:o,hash:a,state:e.history.state??null}},push(n,o=null){e?.history.pushState(o,"",n),r()},replace(n,o=null){e?.history.replaceState(o,"",n),r()},subscribe(n){return t.add(n),()=>t.delete(n)}}}var mr=j(()=>{"use strict"});function Vs(e){let t={};return e&&new URLSearchParams(e.startsWith("?")?e.slice(1):e).forEach((n,o)=>t[o]=n),t}function Us(e,t){if(!t)return e||"/";let r=t.replace(/\/$/,"");return e===r?"/":e.startsWith(r+"/")?e.slice(r.length)||"/":e||"/"}function Bs(e,t){return!t||/^https?:\/\//.test(e)?e:`${t.replace(/\/$/,"")}${e.startsWith("/")?e:"/"+e}`}function gr(e){let{routes:t,history:r,base:n}=e,o=new Set,a=()=>{let c=r.get();return{pathname:c.pathname,search:c.search,hash:c.hash,state:c.state,query:Vs(c.search)}},s=c=>re(t,Us(c,n)),i=(()=>{let c=a();return{location:c,match:s(c.pathname)}})(),l=()=>{let c=a();i={location:c,match:s(c.pathname)},o.forEach(f=>f(i))},u=r.subscribe(l);return{state(){return i},subscribe(c){return o.add(c),()=>o.delete(c)},navigate(c,f={}){let p=Bs(c,n);f.replace?r.replace(p,f.state??null):r.push(p,f.state??null)},match(c){return s(c)},destroy(){u(),o.clear()}}}var Oo=j(()=>{"use strict";yr();mr()});var vr=j(()=>{"use strict";yr();mr();Oo()});function Po(e,t){return async(...r)=>{let n=t+":"+JSON.stringify(r);if(vo()||typeof window<"u"){let a=wo(n);if(a!==void 0)return a}if(Oe.has(n))return Oe.get(n);if(Ce.has(n))return Ce.get(n);let o=Promise.resolve(e(...r)).then(a=>(Oe.set(n,a),Ce.delete(n),xo()&&bo(n,a),a),a=>{throw Ce.delete(n),a});return Ce.set(n,o),o}}function Eo(e){let t=typeof e=="string"?r=>r.startsWith(e):e;for(let r of Oe.keys())t(r)&&(Oe.delete(r),Js.add(r));Ks(r=>r+1)}function $o(e,t){let[r]=K(t||(()=>!0),e);return r}function _o(e){return br.has(e)||br.set(e,w(void 0)),br.get(e)}function wr(e,t){let r=t||e.name||"action",n=async o=>{let[,a]=_o(r),s=()=>a(void 0),i=()=>n(o);a({input:o,pending:!0,clear:s,retry:i});try{let l=await e(o);return a({input:o,result:l,pending:!1,clear:s,retry:i}),l}catch(l){throw a({input:o,error:l,pending:!1,clear:s,retry:i}),l}};return n.url=r,n.with=o=>wr((...a)=>e(o,...a),t),n}function jo(e){let[t]=_o(e.url);return t}function Ro(e){return e}var Oe,Ce,Zu,Ks,Js,br,Xs,Qu,No=j(()=>{"use strict";x();lr();nr();Oe=new Map,Ce=new Map;[Zu,Ks]=w(0),Js=new Set;br=new Map;Xs=ce(),Qu=Xs.Provider});var qo={};_r(qo,{A:()=>Or,Form:()=>ia,Link:()=>ht,Outlet:()=>xr,Redirect:()=>Sr,Router:()=>Ar,action:()=>wr,cache:()=>Po,createAsync:()=>$o,createBrowserHistory:()=>ne,createMemoryHistory:()=>ke,lazy:()=>xe,matchPath:()=>pe,matchRoutes:()=>re,preloadRoutes:()=>sa,revalidate:()=>Eo,runWithOwner:()=>W,select:()=>ra,useAction:()=>Ro,useLevelParams:()=>ea,useLocation:()=>Ee,useMatch:()=>kr,useNavigate:()=>yt,useParam:()=>Tr,useParamSelector:()=>ta,useParams:()=>Pe,useRouteData:()=>na,useRouter:()=>de,useSearchParams:()=>Cr,useSubmission:()=>jo});function Gs(e,t,r){let n,o=e.route.data;if(typeof o=="function"){let c=!1;A(()=>{c=!0});let f=F(),[p]=K(()=>o({params:r.params,location:r.location},f,()=>c));n=p}let a=()=>Do.Provider({value:n,get children(){return Lo.Provider({value:e.params,get children(){return Mo.Provider({value:{depth:t,...r},get children(){return X(e.component,{})}})}})}});if(!n)return a();let s=n,i=()=>s.loading,[l,u]=w(k(()=>!i()));return S(()=>u(!i())),g(()=>l()?a():null)}function Io(e){let t=e.depth+1,[r,n]=w(k(()=>e.matched()[t]?.component));return S(()=>{let o=e.matched()[t]?.component;n(()=>o)}),g(()=>{if(!r())return e.notFound?e.notFound():null;let a=k(()=>e.matched())[t];return Gs(a,t,{matched:e.matched,params:e.params,location:e.location})})}function Ys(e){return e==null?Zs():typeof e=="function"?X(e,{}):e}function Zs(){let e=ae("div");C(e,"class","fx-not-found"),C(e,"role","main"),C(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let t=ae("h1");C(t,"style","margin:0;font-size:2.5rem;font-weight:700"),L(t,"404");let r=ae("p");return C(r,"style","margin:0;opacity:.7"),L(r,"This page could not be found."),e.appendChild(t),e.appendChild(r),e}function Ar(e){let t=e.history??ne(),r=gr({routes:e.routes,base:e.base,history:t}),[n,o]=w(r.state()),a=r.subscribe(o);A(()=>{a(),r.destroy()});let s=g(()=>(n().match?.matched??[]).filter(c=>c.component)),i={router:r,location:g(()=>n().location),params:g(()=>n().match?.params??{})},l={depth:-1,matched:s,params:i.params,location:i.location,notFound:()=>Ys(e.notFound)},u;return dt.Provider({value:i,get children(){return u??=Io(l)}})}function xr(){let e=H(Mo);return e?Io(e):null}function Sr(e){let t=H(dt);if(!t||typeof window>"u")return null;let r=!1;return A(()=>r=!0),queueMicrotask(()=>{r||t.router.navigate(e.to,{replace:e.replace!==!1})}),null}function de(){let e=H(dt);if(e)return e;if(typeof window>"u")return Qs;throw new Error("[router-next] useRouter must be used within <Router>")}function Pe(){let e=de().params;return g(()=>e(),{},{equals:(t,r)=>JSON.stringify(t)===JSON.stringify(r)})}function ea(){return H(Lo)??{}}function Tr(e){let t=Pe();return g(()=>t()[e])}function ta(e,t){let r=Pe();return g(()=>e(r()),void 0,t?{equals:t}:void 0)}function kr(e){let t=Ee();return g(()=>pe(typeof e=="function"?e():e,t.pathname))}function Cr(){let e=Ee(),t=yt();return[g(()=>e.query),(o,a)=>{let s=new URLSearchParams(e.search);for(let[l,u]of Object.entries(o))u===null?s.delete(l):s.set(l,u);let i=s.toString();t(e.pathname+(i?`?${i}`:""),a)}]}function ra(e,t){let r=(n,o)=>te(n,o);return t!==void 0?g(()=>Le(e(),t),void 0,{equals:r}):g(e,void 0,{equals:r})}function Ee(){let{location:e}=de();return new Proxy({},{get:(t,r)=>e()[r],has:(t,r)=>r in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(t,r)=>Object.getOwnPropertyDescriptor(e(),r)})}function yt(){let{router:e}=de();return(t,r)=>e.navigate(t,r)}function na(){return H(Do)??(()=>{})}function ht(e){let t=H(dt),r=typeof document>"u",n=()=>t?.router.navigate(B(e.href)??"",{replace:B(e.replace)}),o=ae("a");C(o,"href",B(e.href)??""),e.slot&&C(o,"slot",B(e.slot));for(let[s,i]of Object.entries(e))oa.has(s)||i!=null&&typeof i!="function"&&C(o,s,String(i));if(typeof o.addEventListener=="function")o.addEventListener("click",s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),n())});else{let s=B(e.className??e.class)??"";s&&C(o,"class",s)}typeof o.addEventListener=="function"&&S(()=>{let s=B(e.href)??"";o.setAttribute("href",s);let i=B(e.className??e.class)??"",l=B(e.activeClass)??"",u=B(e.active)??t?.location().pathname===s;o.className=[i,u?l:""].filter(Boolean).join(" ")});let a=e.children;return a!=null&&L(o,a),o}function ia(e){let t=e.action,r=e.className??e.class,n=t.url??"",o=ae("form");C(o,"method","post"),n&&C(o,"action",n),r&&C(o,"class",r);for(let[s,i]of Object.entries(e))s==="action"||s==="children"||s==="class"||s==="className"||i!=null&&typeof i!="function"&&C(o,s,String(i));typeof o.addEventListener=="function"&&o.addEventListener("submit",s=>{s.preventDefault();let i={};new FormData(o).forEach((l,u)=>{i[u]=l}),Promise.resolve(t(i)).catch(()=>{})});let a=e.children;return a!=null&&L(o,a),o}async function sa(e,t){let r=re(e,t);if(!r)return;let n=[];for(let o of r.matched){let a=o.component;a&&typeof a.preload=="function"&&n.push(a.preload())}await Promise.all(n)}var dt,Mo,Lo,Do,Qs,B,oa,Or,Pr=j(()=>{"use strict";x();D();x();Ot();To();vr();vr();No();er();x();dt=q(),Mo=q(),Lo=q(),Do=q();Qs={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};B=e=>typeof e=="function"?e():e,oa=new Set(["href","slot","class","className","active","activeClass","replace","children"]);Or=ht});var la={};_r(la,{$component:()=>tt,A:()=>Or,DEV:()=>ve,Dynamic:()=>Jn,ErrorBoundary:()=>Gn,FRAMEWORK_NAME:()=>mo,For:()=>Vn,Fragment:()=>or,Index:()=>Un,Link:()=>ht,Match:()=>Bn,Outlet:()=>xr,Portal:()=>Xn,Redirect:()=>Sr,Router:()=>Ar,Show:()=>zn,Store:()=>We,Suspense:()=>Ae,Switch:()=>Kn,VERSION:()=>ho,addClass:()=>kn,batch:()=>_,classMap:()=>Yn,cleanupDelegation:()=>io,composeProviders:()=>rr,createBrowserHistory:()=>ne,createComponent:()=>be,createComputed:()=>Wr,createConsumer:()=>lo,createContext:()=>ce,createContextWithProvider:()=>ao,createDebounce:()=>Gr,createDeferred:()=>Xr,createEffect:()=>S,createIsomorphicState:()=>co,createMemo:()=>g,createMemoryHistory:()=>ke,createProvider:()=>ut,createRenderEffect:()=>O,createResource:()=>K,createRoot:()=>N,createSelector:()=>Jr,createSignal:()=>w,createStore:()=>Rt,delegateEvents:()=>Q,devOnly:()=>Qt,getFrameworkInfo:()=>Cs,getOwner:()=>F,getSharedConfig:()=>Yt,hydrate:()=>Qe,initDelegation:()=>oo,insert:()=>L,isDOMNode:()=>Xe,isDev:()=>Zt,isLitTemplateResult:()=>Pn,isRenderable:()=>no,jsx:()=>ir,jsxs:()=>yo,lazy:()=>xe,mount:()=>Ho,onCleanup:()=>A,onMount:()=>rt,onUnmount:()=>nt,portal:()=>ro,read:()=>on,reduce:()=>nn,removeClass:()=>Cn,render:()=>ue,runWithOwner:()=>W,setAttribute:()=>C,setOwner:()=>Hr,setProperty:()=>se,spread:()=>Hn,startClient:()=>Fo,styleMap:()=>Zn,toggleClass:()=>On,untrack:()=>k,untrackStore:()=>Nt,useCallback:()=>lt,useContext:()=>fe,useEffect:()=>we,useEventListener:()=>at,useLocation:()=>Ee,useMatch:()=>kr,useMemo:()=>ot,useNavigate:()=>yt,useParam:()=>Tr,useParams:()=>Pe,useProvide:()=>uo,useReducer:()=>st,useRef:()=>it,useRouter:()=>de,useSearchParams:()=>Cr});x();x();var Ai="__fluixi_signal_next_state__",xi=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},E=globalThis[Ai]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:xi,onSuspend:null,onError:null},en=0,tn=1,Ie=2,Si=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(E.untracked)return;let e=E.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}};var Ti=class extends Si{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=Ie,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(E.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 e of this.sources)if(e.updateIfNecessary(),this.state===Ie)break}(this.state===Ie||!this._initialized)&&this.recompute(),this.state=en}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=E.consumer,t=E.untracked;E.consumer=this,E.untracked=!1;let r,n=!1,o;try{r=this._fn()}catch(s){n=!0,o=s,r=this._value}finally{E.consumer=e,E.untracked=t}let a=!this._initialized||this._threw!==n||(n?o!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=n,this._error=o,this._value=r,a){if(this.version++,this.observers)for(let s of[...this.observers])s.markDirty(Ie);rn(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===en;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(tn);rn(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function rn(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function ki(e){return E.onSuspend?(E.onSuspend(e,E.owner),!0):!1}function Ci(){return E.owner}function Oi(e,t){let r=E.owner;E.owner=e;try{return t()}finally{E.owner=r}}function Pi(e){E.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Ei(e){return!!e&&typeof e.then=="function"}Pi(()=>{});var $i=Symbol.for("signal"),_i=Symbol.for("memo");function ji(e,t,r){let n=t,o=Ci(),a=new Ti(()=>Oi(o,()=>{try{return n=e(n)}catch(i){if(Ei(i))return ki(i),n;throw i}}),{equals:r?.equals}),s=(()=>a.get());return Object.defineProperty(s,$i,{value:!0,enumerable:!0}),Object.defineProperty(s,_i,{value:!0,enumerable:!0}),s}function nn(e,t,r,n){return ji(()=>e().reduce(t,r),void 0,n)}function on(e){let t=e;for(;typeof t=="function";)t=t();return t}x();var Et=Symbol("store-raw"),sn=Symbol("store-node"),an=Symbol("store-has"),ln=Symbol("store-self"),un=Symbol("store-track");var cn=new WeakMap,fn=new WeakMap;function mn(e){let[t,r]=w(e),n=t;return n.$=r,n}function He(e){let t=cn.get(e);return t||cn.set(e,t={keys:new Map}),t}function pn(e,t,r){let n=e.keys.get(t);return n||e.keys.set(t,n=mn(r)),n}function dn(e){let t=He(e);(t.all||(t.all=mn()))()}function yn(e,t){e.$(typeof t=="function"?()=>t:t)}function gn(e){if(e==null||typeof e!="object")return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function qe(e){if(!gn(e))return e;let t=fn.get(e);if(t)return t;let r=new Proxy(e,Ri);return fn.set(e,r),r}var Ri={get(e,t,r){if(t===Et||t===sn)return e;if(t===kt)return r;if(t===an)return s=>s in e;if(t==="__proxy")return!0;if(t===un||t===ln)return dn(e),r;let n=e[t];if(typeof n=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return n;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(r);let a=pn(He(e),t,n)();return gn(a)?qe(a):a},set(){return!0},deleteProperty(e,t){return t in e&&ge(e,t,void 0),!0},has(e,t){return t===Et||t===kt||t===sn||t===an||t===ln||t===un?!0:(pn(He(e),t,e[t])(),t in e)},ownKeys(e){return dn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function ge(e,t,r){if(e[t]===r&&(r!==void 0||t in e))return;let n=Array.isArray(e),o=n?e.length:0;r===void 0?delete e[t]:e[t]=r;let a=He(e),s=a.keys.get(t);if(s&&yn(s,r),n&&e.length!==o){let i=a.keys.get("length");i&&yn(i,e.length)}a.all&&a.all.$(void 0)}function hn(e,t){return typeof e=="function"?e(t):e}function $t(e,t){for(let r of Object.keys(t)){let n=t[r],o=e[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?$t(o,n):ge(e,r,n)}}function jt(e){let t=[],r=e.replace(/\[([^\]]*)\]/g,".$1");for(let n of r.split("."))n.length&&t.push(n);return t}function vn(e,t,r){let n=t.length-1;for(let a=0;a<n;a++){let s=t[a];if(s==="*"){let l=t.slice(a+1);if(Array.isArray(e))for(let u=0;u<e.length;u++)vn(e[u],l,r);return}let i=e[s];(i==null||typeof i!="object")&&(i=/^\d+$/.test(t[a+1])?[]:{},ge(e,s,i)),e=i}let o=t[n];if(o==="*"){if(Array.isArray(e))for(let a=0;a<e.length;a++)ge(e,a,hn(r,e[a]));return}ge(e,o,hn(r,e[o]))}function Pt(e,t,r){vn(e,jt(t),r)}function Ni(e,t){let r=t[0];if(typeof r=="function"&&t.length===1){let n=r(e);n&&n!==e&&$t(e,n);return}if(Array.isArray(r)&&t.length===1){for(let n of r)Array.isArray(n)&&Pt(e,n[0],n[1]);return}if(r&&typeof r=="object"&&!Array.isArray(r)&&t.length===1){$t(e,r);return}if(Array.isArray(t[1])&&t.length>=3){Pt(e,`${r}.${t[1].join(".")}`,t[2]);return}Pt(e,String(r),t[1])}function _t(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(_t);let t={};for(let r of Object.keys(e))t[r]=_t(e[r]);return t}function ie(e,t){let r=e;for(let n of jt(t)){if(r==null)return;r=r[n]}return r}var We=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...r)=>_(()=>Ni(this.root,r)))}get state(){return qe(this.root)}get proxy(){return qe(this.root)}get accessor(){return(()=>qe(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return Fe(this.state);let t=this.state;for(let r of jt(e)){if(t==null)return;t=t[r]}return Fe(t)}select(e){return g(()=>e(this.state))}subscribe(e){return S(()=>e(this.state))}watch(e,t){let r;return S(()=>{let n=e(this.state);Object.is(n,r)||(t(n,r),r=n)})}reactive(e){return g(()=>this.state[e])}produce(e){this.set((t=>{let r=_t(t);return e(r),r}))}reconcile(e,t={}){this.set(e)}push(e,...t){let r=ie(this.root,e);this.set(e,r.concat(t))}pop(e){let t=ie(this.root,e).slice(),r=t.pop();return this.set(e,t),r}shift(e){let t=ie(this.root,e).slice(),r=t.shift();return this.set(e,t),r}splice(e,t,r,...n){let o=ie(this.root,e).slice(),a=o.splice(t,r,...n);return this.set(e,o),a}insert(e,t,r){let n=ie(this.root,e).slice();n.splice(t,0,r),this.set(e,n)}removeAt(e,t){let r=ie(this.root,e).slice(),n=r.splice(t,1);return this.set(e,r),n}toObservable(){let[e]=w(this.state);return e.toObservable()}dispose(){}},Mi=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Li(e,t){for(let r of Mi)e[r]=t[r].bind(t);e.$=t.reactive.bind(t)}function Rt(e,t={immutable:!0}){let r=new We(e,t);return Li(r.set,r),[r.proxy,r.set]}function Di(e,t={}){return new We(e,{...t,immutable:!1})}function Fe(e){if(e==null||typeof e!="object")return e;let t=e[Et];return t!==void 0?t:e}function Nt(e){return k(()=>Fe(e))}var Aa=Object.freeze({createStore:Rt,createMutableStore:Di,batch:_,unwrap:Fe,untrackStore:Nt});x();D();le();le();x();D();function to(e){return!!(e&&typeof e=="object"&&typeof e.then=="function"||e instanceof Promise)}var gs=q();function Ae(e){return X(vs,e)}function vs(e){let t=Zr(),r=H(gs),n=r?r.register(t.inFallback):void 0;function o(c){return c==null||typeof c=="boolean"?null:typeof c=="function"&&U(c)&&!P(c)?c():c}let a=Mn(()=>o(e.fallback??null)),s=Tt(t,()=>e.children);Tt(t,()=>{O(()=>{let c=s;if(Array.isArray(c))for(let f of c)typeof f=="function"&&P(f)&&f();else typeof c=="function"&&P(c)&&c()})});let[i,l]=w(void 0),u=to(s);return u&&(t.increment(),s.then(c=>{l(()=>c),t.decrement()},()=>t.decrement())),g(()=>(n?n.showFallback():t.inFallback())?a:u?i():s)}$n(Ae);Object.defineProperty(Ae,"__suspense",{value:!0,enumerable:!0});er();var tr=typeof window>"u";function ue(e,t,r={}){if(G("render"),Q(["click","input","change","submit"]),tr)throw new Error("render() is for client-side only. Use renderToString() on server.");if(!t)throw new Error("Container element is required");let n;return N(o=>{n=o;let a=typeof e=="function"?e():e;t.textContent="",t.setAttribute("fluixi-js","v1"),L(t,()=>a)}),()=>{n&&(n(),n=void 0)}}function bs(e){return e&&typeof e=="object"&&(e._$litType$!==void 0||e._$litDirective$!==void 0)}function ro(e,t,r={}){let n=document.createElement("div");n.setAttribute("data-portal","true"),t.appendChild(n);let o=ue(e,n,r);return()=>{o(),t.contains(n)&&t.removeChild(n)}}function no(e){return!!(e==null||typeof e=="function"||Xe(e)||bs(e)||Array.isArray(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean")}function oo(){tr||Q(["click","input","change","submit"])}function io(){}nr();x();D();var As="__fluixi_iso_states__",xs="__iso:";function Ss(){return globalThis[As]??=new Map}function Ts(e){if(typeof window>"u")return;let t=Bt();return t?t[xs+e]:void 0}function co(e,t){let r=Ts(e),n=r!==void 0?r:typeof window<"u"&&t.client?t.client():t.fallback,[o,a]=w(n);return Ss().set(e,{server:t.server,set:a}),{value:o,set:a,key:e}}D();D();D();D();D();x();var or=Symbol.for("fluixi.fragment"),fo=typeof window>"u";function po(e){return e==null||e===!1?null:Array.isArray(e)?e.map(po).flat():e}function ir(e,t,r){if(e==null)return null;let n=t||{};if(r!==void 0&&(n.key=r),e===or)return g(()=>Ge(po(n.children)));if(typeof e=="function"){let{type:o}=_n(e);return e.$$typeof===Symbol.for("react.provider")||o==="provider"?e(n):fo?{type:e,props:n}:g(()=>X(e,n),void 0,{name:"jsx component"})}return typeof e=="string"&&e.trim().length>0?ks(e,n):null}var yo=ir;function ks(e,t){return fo?{type:e,props:t||{}}:Wn(e,t)}le();var ho="0.0.1",mo="Fluixi";function Cs(){return{name:mo,version:ho,features:{ssr:!0,hydration:!0,jsx:!0,litHtml:!0,signals:!0,fineGrained:!0,lazy:!0,hooks:!0,devMode:!0}}}G("index");D();lr();le();x();function ee(e){return typeof e=="function"?e():e}function Ps(e){if(typeof e=="string")return e;let t=[];return t.push(e.index===!1?"noindex":"index"),t.push(e.follow===!1?"nofollow":"follow"),e.noarchive&&t.push("noarchive"),e.nosnippet&&t.push("nosnippet"),e.noimageindex&&t.push("noimageindex"),e.maxSnippet!=null&&t.push(`max-snippet:${e.maxSnippet}`),e.maxImagePreview&&t.push(`max-image-preview:${e.maxImagePreview}`),e.maxVideoPreview!=null&&t.push(`max-video-preview:${e.maxVideoPreview}`),t.join(", ")}function ur(){let e=[],[t,r]=w(0);return{sources:e,version:t,push(n){return e.push(n),r(o=>o+1),()=>{let o=e.indexOf(n);o!==-1&&(e.splice(o,1),r(a=>a+1))}}}}var Es=null;function cr(e){Es=e}function ft(e){let t=5381;for(let r=0;r<e.length;r++)t=t*33^e.charCodeAt(r);return(t>>>0).toString(36)}function $s(e){return e.charset!=null?"meta:charset":e.property?"meta:property:"+e.property:e.name?"meta:name:"+e.name:e["http-equiv"]?"meta:http-equiv:"+e["http-equiv"]:"meta:"+ft(JSON.stringify(e))}function _s(e,t){let r=typeof t=="string"?{url:t}:t;e.push({tag:"meta",key:"meta:property:og:image:"+r.url,attrs:{property:"og:image",content:r.url}}),r.secureUrl&&e.push({tag:"meta",key:"meta:property:og:image:secure:"+r.url,attrs:{property:"og:image:secure_url",content:r.secureUrl}}),r.type&&e.push({tag:"meta",key:"meta:property:og:image:type:"+r.url,attrs:{property:"og:image:type",content:r.type}}),r.width!=null&&e.push({tag:"meta",key:"meta:property:og:image:width:"+r.url,attrs:{property:"og:image:width",content:String(r.width)}}),r.height!=null&&e.push({tag:"meta",key:"meta:property:og:image:height:"+r.url,attrs:{property:"og:image:height",content:String(r.height)}}),r.alt&&e.push({tag:"meta",key:"meta:property:og:image:alt:"+r.url,attrs:{property:"og:image:alt",content:r.alt}})}function js(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:property:og:"+n,attrs:{property:"og:"+n,content:o}})};r("title",e.title),r("description",e.description),r("type",e.type),r("url",e.url),r("site_name",e.siteName),r("locale",e.locale);for(let n of e.localeAlternate??[])t.push({tag:"meta",key:"meta:property:og:locale:alt:"+n,attrs:{property:"og:locale:alternate",content:n}});if(e.image!=null){let n=Array.isArray(e.image)?e.image:[e.image];for(let o of n)_s(t,o)}if(e.video){let n=typeof e.video=="string"?{url:e.video}:e.video;r("video",n.url),"type"in n&&n.type&&r("video:type",n.type),"width"in n&&n.width!=null&&r("video:width",String(n.width)),"height"in n&&n.height!=null&&r("video:height",String(n.height))}if(e.audio){let n=typeof e.audio=="string"?{url:e.audio}:e.audio;r("audio",n.url),"type"in n&&n.type&&r("audio:type",n.type)}if(e.article){let n=e.article;r("article:published_time",n.publishedTime),r("article:modified_time",n.modifiedTime),r("article:expiration_time",n.expirationTime),r("article:section",n.section);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:article:author:"+o,attrs:{property:"article:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:article:tag:"+o,attrs:{property:"article:tag",content:o}})}if(e.book){let n=e.book;r("book:isbn",n.isbn),r("book:release_date",n.releaseDate);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:book:author:"+o,attrs:{property:"book:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:book:tag:"+o,attrs:{property:"book:tag",content:o}})}if(e.profile){let n=e.profile;r("profile:first_name",n.firstName),r("profile:last_name",n.lastName),r("profile:username",n.username),r("profile:gender",n.gender)}}function Rs(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:name:twitter:"+n,attrs:{name:"twitter:"+n,content:o}})};r("card",e.card),r("site",e.site),r("creator",e.creator),r("title",e.title),r("description",e.description),r("image",e.image),r("image:alt",e.imageAlt),r("player",e.player),e.playerWidth!=null&&r("player:width",String(e.playerWidth)),e.playerHeight!=null&&r("player:height",String(e.playerHeight)),e.app&&(r("app:name:iphone",e.app.name),r("app:id:iphone",e.app.idIphone),r("app:id:ipad",e.app.idIpad),r("app:id:googleplay",e.app.idGooglePlay))}function Ns(e,t){let r=(n,o)=>t.push({tag:"link",key:n,attrs:o});if(e.icon!=null){let n=typeof e.icon=="string"?[{url:e.icon}]:e.icon;for(let o of n)r("link:icon:"+o.url,{rel:"icon",href:o.url,...o.type?{type:o.type}:{},...o.sizes?{sizes:o.sizes}:{}})}if(e.apple!=null){let n=typeof e.apple=="string"?[{url:e.apple}]:e.apple;for(let o of n)r("link:apple-touch-icon:"+o.url,{rel:"apple-touch-icon",href:o.url,...o.sizes?{sizes:o.sizes}:{}})}e.mask&&r("link:mask-icon",{rel:"mask-icon",href:e.mask.url,...e.mask.color?{color:e.mask.color}:{}}),e.shortcut&&r("link:shortcut",{rel:"shortcut icon",href:e.shortcut}),e.msTileImage&&t.push({tag:"meta",key:"meta:name:msapplication-TileImage",attrs:{name:"msapplication-TileImage",content:e.msTileImage}}),e.msTileColor&&t.push({tag:"meta",key:"meta:name:msapplication-TileColor",attrs:{name:"msapplication-TileColor",content:e.msTileColor}})}function Ms(e,t,r){let n=(f,p)=>t.push({tag:"meta",key:f,attrs:p}),o=ee(e.title);o!==void 0&&(r.title=o),e.titleTemplate!==void 0&&(r.template=e.titleTemplate);let a=ee(e.lang);a!==void 0&&t.push({tag:"htmlAttr",key:"html:lang",name:"lang",value:a}),e.charset!==void 0&&n("meta:charset",{charset:e.charset}),e.viewport!==void 0&&n("meta:name:viewport",{name:"viewport",content:e.viewport});let s=ee(e.description);s!==void 0&&n("meta:name:description",{name:"description",content:s});let i=ee(e.keywords);i!==void 0&&n("meta:name:keywords",{name:"keywords",content:Array.isArray(i)?i.join(", "):i}),e.author!==void 0&&n("meta:name:author",{name:"author",content:e.author}),e.robots!==void 0&&n("meta:name:robots",{name:"robots",content:Ps(e.robots)}),e.generator!==void 0&&n("meta:name:generator",{name:"generator",content:e.generator}),e.applicationName!==void 0&&n("meta:name:application-name",{name:"application-name",content:e.applicationName}),e.referrer!==void 0&&n("meta:name:referrer",{name:"referrer",content:e.referrer}),e.colorScheme!==void 0&&n("meta:name:color-scheme",{name:"color-scheme",content:e.colorScheme});let l=ee(e.themeColor);l!==void 0&&n("meta:name:theme-color",{name:"theme-color",content:l});let u=ee(e.canonical);if(u!==void 0&&t.push({tag:"link",key:"link:rel:canonical",attrs:{rel:"canonical",href:u}}),e.manifest!==void 0&&t.push({tag:"link",key:"link:rel:manifest",attrs:{rel:"manifest",href:e.manifest}}),e.base!==void 0&&t.push({tag:"base",key:"base",attrs:{href:e.base}}),e.verification){let f={google:"google-site-verification",bing:"msvalidate.01",yandex:"yandex-verification",pinterest:"p:domain_verify"};for(let[p,y]of Object.entries(e.verification)){if(y==null)continue;let d=f[p]??p;n("meta:name:"+d,{name:d,content:y})}}for(let f of e.alternates??[])t.push({tag:"link",key:"link:alternate:hreflang:"+f.hreflang,attrs:{rel:"alternate",hreflang:f.hreflang,href:f.href}});for(let f of e.feeds??[])t.push({tag:"link",key:"link:alternate:feed:"+f.href,attrs:{rel:"alternate",type:f.type??"application/rss+xml",href:f.href,...f.title?{title:f.title}:{}}});e.og&&js(e.og,t),e.twitter&&Rs(e.twitter,t),e.icons&&Ns(e.icons,t);let c=ee(e.jsonLd);if(c!==void 0){let f=Array.isArray(c)?c:[c];for(let p of f){let y=JSON.stringify(p);t.push({tag:"script",key:"script:ldjson:"+ft(y),attrs:{type:"application/ld+json"},children:y})}}for(let f of e.meta??[]){let p={};for(let[y,d]of Object.entries(f))d!=null&&(p[y==="httpEquiv"?"http-equiv":y]=d);t.push({tag:"meta",key:$s(p),attrs:p})}for(let f of e.link??[]){let p={};for(let[y,d]of Object.entries(f))d!=null&&(p[y]=d);t.push({tag:"link",key:"link:"+(p.rel??"")+":"+(p.href??ft(JSON.stringify(p))),attrs:p})}for(let f of e.script??[]){let p={},y;for(let[d,h]of Object.entries(f))h!=null&&(d==="children"?y=h:p[d]=h);t.push({tag:"script",key:"script:"+(p.src??ft((y??"")+JSON.stringify(p))),attrs:p,children:y})}}function Ls(e,t){return typeof e=="function"?e(t):e.includes("%s")?e.replace("%s",t):e}function pt(e){let t=[],r={};for(let a of e.sources){let s=typeof a=="function"?a():a;Ms(s,t,r)}r.title!==void 0&&t.push({tag:"title",key:"title",children:r.template?Ls(r.template,r.title):r.title});let n=new Map,o={};for(let a of t){if(a.tag==="htmlAttr"){o[a.name]=a.value;continue}n.set(a.key,a)}return{tags:[...n.values()],htmlAttrs:o}}var Se="data-fh",Te="data-fh-key";function fr(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===8&&t.data.startsWith("fh:")){t.parentNode?.removeChild(t);return}}x();function So(e,t){for(let r of Array.from(e.attributes))r.name===Se||r.name===Te||r.name in t||e.removeAttribute(r.name);for(let[r,n]of Object.entries(t))e.getAttribute(r)!==n&&e.setAttribute(r,n)}function Ds(e){let t=document.createElement(e.tag);return So(t,e.attrs),t.setAttribute(Se,""),t.setAttribute(Te,e.key),e.tag==="script"&&e.children!=null&&(t.textContent=e.children),t}function Is(e,t){let r=document.head,n=new Map;for(let s of Array.from(r.querySelectorAll(`[${Se}]`))){let i=s.getAttribute(Te);s.tagName!=="TITLE"&&i&&n.set(i,s)}let o=null,a=new Set;for(let s of e){if(s.tag==="title"){o=s.children;continue}if(s.tag==="htmlAttr")continue;a.add(s.key);let i=n.get(s.key);i&&i.tagName===s.tag.toUpperCase()?(So(i,s.attrs),s.tag==="script"&&(i.textContent??"")!==(s.children??"")&&(i.textContent=s.children??"")):(i&&i.remove(),r.appendChild(Ds(s)))}for(let[s,i]of n)a.has(s)||i.remove();o!=null&&document.title!==o&&(document.title=o);for(let[s,i]of Object.entries(t))document.documentElement.getAttribute(s)!==i&&document.documentElement.setAttribute(s,i)}function pr(e){return N(t=>(S(()=>{e.version();let{tags:r,htmlAttrs:n}=pt(e);Is(r,n)}),A(()=>{}),t))}G("client index");function Ho(e,t){if(!t)throw new Error("Container element not found for mount()");Ut(()=>e(),t)}async function Fo(e,t={}){let r=typeof t.root=="string"?document.querySelector(t.root):t.root??document.querySelector("#app");if(!r)throw new Error(`[Fluixi] Mount container not found: ${t.root??"#app"}`);let n=!!document.getElementById("__FLUIXI_HYDRATION__")||!!t.routes&&r.firstElementChild!=null,o=t.hydrate??n,a=ur();if(cr(a),fr(r),o){if(t.routes&&t.routes.length){let{preloadRoutes:s}=await Promise.resolve().then(()=>(Pr(),qo));await s(t.routes,window.location.pathname)}Ao(),sr(!0),Qe(()=>e(),r),aa(),setTimeout(()=>{sr(!1),ar()},100)}else ue(()=>e(),r);pr(a)}function aa(){if(typeof window>"u")return;let e=window;typeof e.__FX_REPLAY_STOP__=="function"&&e.__FX_REPLAY_STOP__();let t=e.__FX_REPLAY__;if(e.__FX_REPLAY__=void 0,e.__FX_REPLAY_STOP__=void 0,!(!Array.isArray(t)||t.length===0))for(let r of t){let n=r&&r.target;if(!n||n.isConnected===!1||typeof n.dispatchEvent!="function")continue;let o=r.type,a=o==="click"?new MouseEvent(o,{bubbles:!0,cancelable:!0}):new Event(o,{bubbles:!0,cancelable:!0});n.dispatchEvent(a)}}Pr();return Ko(la);})();
1
+ "use strict";var Fluixi=(()=>{var mt=Object.defineProperty;var zo=Object.getOwnPropertyDescriptor;var Vo=Object.getOwnPropertyNames;var Uo=Object.prototype.hasOwnProperty;var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var _r=(e,t)=>{for(var r in t)mt(e,r,{get:t[r],enumerable:!0})},Bo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vo(t))!Uo.call(e,o)&&o!==r&&mt(e,o,{get:()=>t[o],enumerable:!(n=zo(t,o))||n.enumerable});return e};var Ko=e=>Bo(mt({},"__esModule",{value:!0}),e);function vt(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function Zo(e){if(m.untracked)return e();m.untracked=!0;try{return e()}finally{m.untracked=!1}}function Ir(e){return!!e&&e.disposed===!0}function Me(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function q(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:r=>{let n=m.owner,o=Me(n);(o.contexts=new Map).set(t,r.value),n&&(n.owned??=[]).push(o),m.owner=o;try{return r.children}finally{m.owner=n}}}}function H(e){let t=m.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id))return t.contexts.get(e.id);t=t.parent}return e.defaultValue}function qr(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function Qo(e,t,r){let n=Me(m.owner);(n.contexts=new Map).set(e.id,t),m.owner&&(m.owner.owned??=[]).push(n);let o=m.owner;m.owner=n;try{return r()}finally{m.owner=o}}function ei(e){m.onSuspend=e}function ti(e){return m.onSuspend?(m.onSuspend(e,m.owner),!0):!1}function ri(e){m.onError=e}function F(){return m.owner}function Hr(e){let t=m.owner;return m.owner=e,t}function W(e,t){let r=m.owner;m.owner=e;try{return t()}finally{m.owner=r}}function A(e){if(m.owner){if(m.owner.disposed){e();return}(m.owner.cleanups??=[]).push(e)}}function Ne(e,t=!0){if(!e.disposed){if(e.owned){for(let r=e.owned.length-1;r>=0;r--)Ne(e.owned[r]);e.owned=null}if(e.cleanups){for(let r=e.cleanups.length-1;r>=0;r--)e.cleanups[r]();e.cleanups=null}t&&(e.disposed=!0)}}function N(e){let t=Me(m.owner);m.owner&&(m.owner.owned??=[]).push(t);let r=m.owner;m.owner=t;try{return e(()=>Ne(t))}finally{m.owner=r}}function ni(e){m.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function oi(e){e.queued||(e.queued=!0,m.queue.push(e),!m.scheduled&&m.batchDepth===0&&(m.scheduled=!0,m.hostSchedule(xt)))}function xt(){if(m.scheduled=!1,m.flushing)return;m.flushing=!0;let e=0;try{for(;m.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=m.queue;m.queue=[];for(let r of t)r.queued=!1,r.disposed||r.run()}}finally{m.flushing=!1}}function ii(){m.batchDepth===0&&xt()}function si(e){m.batchDepth++;try{return e()}finally{--m.batchDepth===0&&xt()}}function St(e){let t=new ai(e);return()=>t.dispose()}function li(e){return!!e&&typeof e.then=="function"}function w(e,t){let r=new Go(e,{equals:t?.equals}),n=(()=>r.get()),o=(a=>{let s=typeof a=="function"?a(r.peek()):a;return r.set(s),ii(),s});return Object.defineProperty(n,Fr,{value:!0,enumerable:!0}),Object.defineProperty(n,ci,{value:{get value(){return r.peek()},get version(){return r.version}},enumerable:!1}),[n,o]}function g(e,t,r){let n=t,o=F(),a=new Dr(()=>W(o,()=>{try{return n=e(n)}catch(i){if(li(i))return ti(i),n;throw i}}),{equals:r?.equals}),s=(()=>a.get());return Object.defineProperty(s,Fr,{value:!0,enumerable:!0}),Object.defineProperty(s,ui,{value:!0,enumerable:!0}),s}function S(e,t){let r=t;return St(()=>{r=e(r)})}function Wr(e,t){let r=t;St(()=>{r=e(r)})}function O(e,t){let r=t;return St(()=>{r=e(r)})}function _(e){return si(e)}function C(e){return Zo(e)}function zr(e,t,r){let n=[];return A(()=>{for(let o of n)o.dispose();n=[]}),g(()=>{let o=e()||[];return C(()=>{if(o.length===0){for(let l of n)l.dispose();return n=[],r?.fallback?r.fallback():[]}let a=new Map;for(let l of n)a.has(l.item)||a.set(l.item,l);let s=[],i=new Set;for(let l=0;l<o.length;l++){let u=o[l],c=a.get(u);if(c&&!i.has(c))c.setIndex(l),s.push(c),i.add(c);else{let f,p,y;N(h=>{y=h;let[b,T]=w(l);p=T,f=t(u,b)});let d={item:u,rendered:f,dispose:y,setIndex:p};s.push(d),i.add(d)}}for(let l of n)i.has(l)||l.dispose();return n=s,s.map(l=>l.rendered)})})}function Vr(e,t,r,n){let o=[],a=[];return A(()=>{for(let s of a)s.dispose();o=[],a=[]}),g(()=>{let s=e()||[];return C(()=>{if(s.length===0){for(let f of a)f.dispose();return o=[],a=[],n?.fallback?n.fallback():[]}let i=new Map;for(let f=0;f<o.length;f++)i.set(o[f],a[f]);let l=[],u=[],c=new Set;for(let f=0;f<s.length;f++){let p=t(s[f]),y=i.get(p);if(y&&!c.has(p))y.setIndex(f),l.push(y);else{let d,h,b;N(T=>{b=T;let[$,ye]=w(f);h=ye;let $e=g(oe=>(e()||[])[$()]??oe,s[f]);d=r($e,$)}),l.push({rendered:d,dispose:b,setIndex:h})}u.push(p),c.add(p)}for(let[f,p]of i)c.has(f)||p.dispose();return o=u,a=l,l.map(f=>f.rendered)})})}function Ur(e,t,r){let n=[];return A(()=>{for(let o of n)o.dispose();n=[]}),g(()=>{let o=e()||[];return C(()=>{if(o.length===0){for(let l of n)l.dispose();return n=[],r?.fallback?r.fallback():[]}let a=n.length,s=o.length;for(let l=a;l<s;l++){let u,c,f,p=o[l];N(y=>{f=y;let[d,h]=w(p);c=h,u=t(d,l)}),n.push({rendered:u,setItem:c,dispose:f})}for(let l=s;l<a;l++)n[l].dispose();s<a&&(n=n.slice(0,s));let i=Math.min(a,s);for(let l=0;l<i;l++)n[l].setItem(o[l]);return n.map(l=>l.rendered)})})}function P(e){return typeof e=="function"&&e[fi]===!0}function pi(e){Nr&&Nr(e)}function Br(e){bt=e}function di(e){return bt?bt(e):void 0}function Kr(e){wt=e}function yi(){return wt?wt():void 0}function hi(e,t){Mr&&Mr(e,t)}function Jr(e,t=(r,n)=>r===n){let r=new Map;return S(()=>{let n=e();for(let[o,a]of r){let[s,i]=a,l=t(o,n);s()!==l&&i(l)}}),n=>{let o=r.get(n);if(!o){let[a,s]=w(!1);o=[a,s],r.set(n,o);let i=e();s(t(n,i))}return o[0]()}}function Xr(e,t){let[r,n]=w(e(),t);return S(()=>{let o=e();t?.timeoutMs?setTimeout(()=>n(()=>o),t.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>n(()=>o)):Promise.resolve().then(()=>n(()=>o))}),r}function Gr(e,t){let r,n=(...o)=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,e(...o)},t)};return A(()=>{r!==void 0&&clearTimeout(r)}),n}function mi(e){return!!e&&typeof e.then=="function"}function K(e,t,r={}){let n,o;typeof t=="function"?(n=typeof e=="function"?e:()=>e,o=t):(n=()=>!0,o=e,t&&typeof t=="object"&&(r=t));let a=yi(),s=a!==void 0?di(a):void 0,i=s!==void 0,[l,u]=w(s!==void 0?s.value:r.initialValue,{equals:!1}),[c,f]=w(void 0,{equals:!1}),[p,y]=w(s!==void 0||r.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[d,h]=w(void 0,{equals:!1}),[b,T]=w(void 0,{equals:!1}),$=gt,ye=!1;S(()=>{let R=n();if(b(),R===!1||R===null||R===void 0){$=gt,_(()=>{y("unresolved"),h(void 0),f(void 0)});return}let _e=ye;if(ye=!1,$!==gt&&R===$&&!_e)return;if($=R,i){i=!1;return}let je=!1;A(()=>je=!0);let Er=C(p),Wo=C(l),$r=Er==="ready"||Er==="refreshing";_(()=>{y($r?"refreshing":"pending"),f(void 0)});try{let Y=o(R,{value:Wo,refetching:$r});mi(Y)?(h(Y),pi(Y),Y.then(Re=>{je||(a!==void 0&&hi(a,Re),_(()=>{u(()=>Re),y("ready"),h(void 0)}))},Re=>{je||_(()=>{f(Re),y("errored"),h(void 0)})})):_(()=>{u(()=>Y),y("ready"),h(void 0)})}catch(Y){if(je)return;_(()=>{f(Y),y("errored"),h(void 0)})}});let $e=()=>{let R=p();return R==="pending"||R==="refreshing"},oe=(()=>{let R=c();if(R)throw R;if($e()){let _e=d();if(_e)throw _e}return l()});return Object.defineProperties(oe,{state:{get:p},loading:{get:$e},error:{get:c},latest:{get:l}}),Object.defineProperty(oe,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(oe,Symbol.for("signal"),{value:!0,enumerable:!0}),[oe,{mutate:u,refetch:()=>{ye=!0,T(void 0)}}]}function At(e){if(typeof e=="function"&&!e.length){let t=e();return P(t)?t:At(t)}if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=At(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function me(e){let t=g(e);return g(()=>At(t()))}function Zr(){let[e,t]=w(0),r=0;return{increment:()=>t(r+=1),decrement:()=>t(r-=1),inFallback:()=>e()>0}}function Tt(e,t){return Qo(Yr,e,t)}var Jo,Xo,m,jr,Rr,he,Lr,Go,Dr,Yo,ai,Fr,ui,ci,fi,Nr,bt,wt,Mr,gt,Yr,gi,Ct,x=j(()=>{"use strict";Jo="__fluixi_signal_next_state__",Xo=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},m=globalThis[Jo]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Xo,onSuspend:null,onError:null},jr=0,Rr=1,he=2,Lr=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(m.untracked)return;let e=m.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Go=class extends Lr{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(he);vt(this)}}peek(){return this._value}},Dr=class extends Lr{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=he,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(m.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===Rr&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===he)break}(this.state===he||!this._initialized)&&this.recompute(),this.state=jr}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=m.consumer,t=m.untracked;m.consumer=this,m.untracked=!1;let r,n=!1,o;try{r=this._fn()}catch(s){n=!0,o=s,r=this._value}finally{m.consumer=e,m.untracked=t}let a=!this._initialized||this._threw!==n||(n?o!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=n,this._error=o,this._value=r,a){if(this.version++,this.observers)for(let s of[...this.observers])s.markDirty(he);vt(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===jr;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(Rr);vt(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};Yo=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};ai=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=Me(m.owner),m.owner&&(m.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Dr(()=>{Ne(this.owner,!1),W(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new Yo(()=>oi(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&m.onSuspend){m.onSuspend(e,this.owner);return}if(m.onError&&m.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),Ne(this.owner))}};ni(()=>{});Fr=Symbol.for("signal"),ui=Symbol.for("memo"),ci=Symbol.for("signal-node");fi=Symbol.for("signal");Nr=null;bt=null;wt=null;Mr=null;gt=Symbol();Yr=q();ei((e,t)=>{let r=qr(t,Yr);r&&(r.increment(),e.finally(()=>r.decrement()))});gi=q();ri((e,t)=>{let r=qr(t,gi);return r?(r.setError(e),!0):!1});Ct=Symbol.for("fluixi-proxy")});function Le(e,t,r={}){let{preserveStructure:n,multiple:o,throwOnError:a=!1,defaultValue:s,maxDepth:i=20}=r;if(!e||typeof e!="object")return s;if(!t)return e;if(Array.isArray(t))if(n){let c={};for(let f of t){let p=Le(e,f,{...r,preserveStructure:!1});p!==void 0&&bi(c,f,p)}return c}else return t.map(c=>Le(e,c,{...r,preserveStructure:!1}));let l=kt(t,{...r,throwOnError:a});if(l.length===0)return e;if(typeof n>"u"||n===!1){let c=wi(e,t);return o===!1&&Array.isArray(c)?c[0]:c===void 0&&s!==void 0?s:c}let u=I(e,l,0,i);return u===void 0&&s!==void 0?s:u}function wi(e,t,r={}){let{createMissing:n=!1,add:o=!1,debug:a=!1}=r,s=kt(t),i=e,l=!1,u="",c=t;if(typeof i=="object"&&!Array.isArray(i)&&c.length>0&&i[c])return i=i[c],i;for(let f=0;f<s.length;f++){let p=s[f],y=s.length>1?f===s.length-1:!1;if(i===null&&!n)return;let d=s[f+1];switch(p.type){case"property":if(i&&typeof i=="object")if(Array.isArray(i)){if(typeof p.value=="number"){let h=p.value;if(n&&h>=i.length)for(let b=i.length;b<=h;b++)i.push(void 0);if(n&&(i[h]===null||i[h]===void 0)&&(!y||l)&&(d?i[h]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{}:i[h]=null,l=!1),i=i[h],d){l=!0;continue}}else o?i.push({[String(p.value)]:null}):i=i.map(h=>h[String(p.value)]);if(d)continue;return Qr(i)}else{if(i[u]&&u.split(".").length>=2){i=i[u];continue}if(n&&(i[String(p.value)]===null||i[String(p.value)]===void 0)&&(!y||l)&&(d?i[String(p.value)]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{}:i[String(p.value)]=null,l=!1,i=i[String(p.value)],d)){l=!0;continue}if(i?(!i[String(p.value)]&&n&&(i[String(p.value)]=null),i=i[String(p.value)]):i={[String(p.value)]:null},d)continue}else if(n)i={},i[String(p.value)]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"||r.type==="array"?[]:{},i=i[String(p.value)];else return;break;case"index":case"wildcard":if(Array.isArray(i)){if(p.type==="index"){let h=p.value;if(h<0){i=i[i.length-Math.abs(h)];continue}if(n&&(h>=i.length||i[h]==null||i[h]==null)&&!y){for(let b=i.length;b<=h;b++)i.push(void 0);d&&(i[h]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{})}i=i[h]}else if(!y)continue}else if(n){let h=s[f+1];i=[];let b=p.value;for(let T=0;T<=b;T++)i.push(void 0);i[b]=h.type==="index"||h.type==="slice"||h.type==="union"||h.type==="wildcard"||r.type==="array"?[]:{},i=i[b]}else{if(p.type==="index"&&typeof i=="object"&&i&&i[String(p.value)]!==void 0){i=i[String(p.value)];continue}if(typeof i=="object"){i=Object.values(i);continue}return}break;default:return}}return Qr(i)}function Qr(e){return Array.isArray(e)?e.filter(t=>typeof t<"u"):e}var De,I,kt,vi,bi,Ot=j(()=>{"use strict";De=e=>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",I=(e,t,r,n)=>{if(r>n)return;if(t.length===0)return e;let o=t[0],a=t.slice(1);if(o.type==="descendant"){let s=I(e,a,r+1,n);if(s!==void 0)return s;if(e&&typeof e=="object")if(Array.isArray(e)){let i=[];for(let l=0;l<e.length;l++){let u=I(e[l],t,r+1,n);u!==void 0&&(i[l]=u)}return i.length>0?i:void 0}else{let i={};for(let l in e)if(e.hasOwnProperty(l)){let u=I(e[l],t,r+1,n);u!==void 0&&(i[l]=u)}return Object.keys(i).length>0?i:void 0}return}switch(o.type){case"property":if(De(e)&&o.value&&String(o.value)in e){let s=e[String(o.value)],i=I(s,a,r+1,n);if(i!==void 0)return{[String(o.value)]:i}}break;case"index":if(Array.isArray(e)){let s=o.value;if(s>=0&&s<e.length){let i=I(e[s],a,r+1,n);if(i!==void 0){let l=new Array(e.length).filter(u=>u!==void 0);return l[s]=i,l}}}else if(e&&typeof e=="object"){let s=String(o.value);if(s in e){let i=I(e[s],a,r+1,n);if(i!==void 0)return{[s]:i}}}break;case"wildcard":if(e&&typeof e=="object")if(Array.isArray(e)){let s=[],i=!1;for(let l=0;l<e.length;l++){let u=I(e[l],a,r+1,n);u!==void 0&&(s[l]=u,i=!0)}return i?s:void 0}else{let s={},i=!1;for(let l in e)if(e.hasOwnProperty(l)){let u=I(e[l],a,r+1,n);u!==void 0&&(s[l]=u,i=!0)}return i?s:void 0}break;case"slice":if(Array.isArray(e)){let[s,i]=o.value,l=Math.max(0,s),u=Math.min(e.length,i===1/0?e.length:i),c=[],f=!1;for(let p=l;p<u;p++){let y=I(e[p],a,r+1,n);y!==void 0&&(c[p]=y,f=!0)}return f?c:void 0}break;case"union":if(Array.isArray(e)){let s=o.value,i=[],l=!1;for(let u of s)if(u>=0&&u<e.length){let c=I(e[u],a,r+1,n);c!==void 0&&(i[u]=c,l=!0)}return l?i:void 0}break;case"filter":if(Array.isArray(e)){let s=o.value,i=[],l=!1;for(let u=0;u<e.length;u++)if(s(e[u])){let c=I(e[u],a,r+1,n);c!==void 0&&(i[u]=c,l=!0)}return l?i:void 0}break}},kt=(e,t={})=>{let{type:r="auto",throwOnError:n=!1}=t;if(!e||typeof e!="string")return[];let o=[],a="",s=!1,i=!1,l="",u="",c=0,f=r==="auto"?(y=>y.includes("..")?"descendant":y.includes("[?(")?"filter":y.includes("[:")||y.includes("[0:")?"slice":y.includes("[,")||y.includes("[0,1]")?"union":y.includes("[*]")||y.includes(".*.")?"wildcard":y.includes("[]")?"array-wildcard":y.includes("[")&&y.includes("]")?"bracket":"dot")(e):r,p=y=>{let d=y.trim();if(d==="*"||d==="")return{type:"wildcard",value:d===""?"[]":"*",raw:d===""?"[]":y};if(d==="[]")return{type:"wildcard",value:"[]",raw:y};if(/^-?\d+$/.test(d))return{type:"index",value:parseInt(d,10),raw:y};if(d.includes(":")){let h=d.split(":").map($=>$.trim()),b=h[0]===""?0:parseInt(h[0],10),T=h[1]===""?1/0:parseInt(h[1],10);if(isNaN(b)||isNaN(T)){if(n)throw new Error(`Invalid slice notation: ${y}`);return{type:"wildcard",value:"*",raw:y}}return{type:"slice",value:[b,T],raw:y}}if(d.includes(",")){let h=d.split(",").map(b=>{let T=parseInt(b.trim(),10);return isNaN(T)?-1:T}).filter(b=>b>=0);if(h.length===0){if(n)throw new Error(`Invalid union notation: ${y}`);return{type:"wildcard",value:"*",raw:y}}return{type:"union",value:h,raw:y}}if(d.startsWith("?(")&&d.endsWith(")")){let h=d.slice(2,-1);try{return{type:"filter",value:vi(h),raw:y}}catch(b){if(n)throw b;return{type:"wildcard",value:"*",raw:y}}}return d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'")?{type:"property",value:d.slice(1,-1),raw:y}:{type:"property",value:d,raw:y}};for(let y=0;y<e.length;y++){let d=e[y],h=e[y+1];if((d==='"'||d==="'")&&!i){i=!0,l=d;continue}else if(d===l&&i){i=!1,l="",d==='"'||d==="'"||(s?u+=d:a+=d);continue}if(i){s?u+=d:a+=d;continue}if(d==="["&&!s){a&&(o.push({type:"property",value:a,raw:a}),a=""),s=!0,u="";continue}if(d==="]"&&s&&!i){s=!1;let T=p(u);o.push(T);continue}let b=o.length>0?o[o.length-1]:null;if(d==="."&&!s&&!i){if(h==="."){let T=e.split("..")[0];o.push({type:"property",value:T,raw:T}),o.push({type:"descendant",value:"..",raw:".."}),y++}else a&&(a==="*"?o.push({type:"wildcard",value:a,raw:a}):o.push({type:"property",value:a,raw:a}),a="");continue}if(s)u+=d;else if(b&&b.type!=="descendant")a+=d;else{let T=e.split(b?.raw)[1];T!==void 0?a=T:a+=d}}return a&&o.push({type:"property",value:a,raw:a}),o.map(y=>{if(y.type==="property"&&typeof y.value=="string"&&/^-?\d+$/.test(y.value)){let d=parseInt(y.value,10);if(!isNaN(d))return{...y,type:"index",value:d}}return y})},vi=e=>{let t=e.replace(/@\.([a-zA-Z_$][\w$]*)/g,(r,n)=>`item.${n}`).replace(/@/g,"item");try{return new Function("item",`return ${t}`)}catch{throw new Error(`Invalid filter expression: ${e}`)}},bi=(e,t,r)=>{let n=kt(t),o=e;for(let a=0;a<n.length;a++){let s=n[a],i=a===n.length-1;switch(s.type){case"property":if(i)o[String(s.value)]=r;else{if(!o[String(s.value)]){let u=n[a+1];o[String(s.value)]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{}}o=o[String(s.value)]}break;case"index":Array.isArray(o)||(o=[]);let l=s.value;if(i){if(l>=o.length)for(let u=o.length;u<=l;u++)o.push(void 0);o[l]=r}else{if(!o[l]){let u=n[a+1];o[l]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{}}o=o[l]}break;case"wildcard":if(Array.isArray(o))if(i)for(let u=0;u<o.length;u++)o[u]=r;else{let u=n[a+1];for(let c=0;c<o.length;c++)o[c]||(o[c]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{});o.length>0&&(o=o[0])}break}}}});function Ii(e){return e.localName.includes("-")}function bn(e,t,r,n=!1){if(r==null){e.removeAttribute(t);return}if(Ii(e)){e[t]=r;return}k(e,t,r,n)}function Cn(e,...t){e.classList.add(...t)}function kn(e,...t){e.classList.remove(...t)}function On(e,...t){t.forEach(r=>e.classList.toggle(r))}function k(e,t,r,n=!1){if(r==null||r===!1){e.removeAttribute(t);return}if(r===!0){e.setAttribute(t,"");return}if(typeof r=="object"){e.setAttribute(t,JSON.stringify(r));return}e.setAttribute(t,String(r))}function Pn(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Xe(e){return e instanceof Node}function En(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Ge(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function $n(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function qi(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Hi(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Fi(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Wi(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function zi(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Vi(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function U(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ui(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function _n(e){return qi(e)?{type:"router",value:e}:Fi(e)?{type:"route",value:e}:Hi(e)?{type:"routes",value:e}:Wi(e)?{type:"outlet",value:e}:U(e)?{type:"component",value:e}:Ui(e)?{type:"suspense",value:e}:zi(e)?{type:"provider",value:e}:Vi(e)?{type:"context",value:e}:{type:"none",value:e}}function Ft(){if(!An)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return An}function Wt(e){return e!=null&&e[Ze]===!0?!0:typeof Node<"u"&&e instanceof Node}function Bi(e){return e!=null&&e[Ze]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Ki(e){return e!=null&&e[Ze]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}function Ji(e){jn=e}function Rn(){return jn}function xn(e,t){return v.active&&t.parentNode===e}function Nn(e){let t=v.parents.lastIndexOf(e);t!==-1&&(v.parents.length=t),v.cursor=e.nextSibling}function Mn(e){if(!v.active)return e();let t=v.cursor,r=v.parents;v.active=!1,v.parents=[];try{return e()}finally{v.active=!0,v.cursor=t,v.parents=r}}function Ln(e){if(!v.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Nn(t)}function Q(e){if(!Ye)for(let t of e)Ve.has(t)||zt.has(t)||(Ve.add(t),document.addEventListener(t,Gi))}function Gi(e){let t=`$$${e.type}`,r=e.composedPath&&e.composedPath()[0]||e.target;for(;r;){let n=r[t];if(n&&!r.disabled&&(n(e),e.cancelBubble))return;r=r.host&&r.host!==r&&r.host instanceof Element?r.host:r.parentNode}}function Yi(e,t,r){if(e[`$$${t}`]=r,zt.has(t)){let n=`__fx_${t}`;if(!e[n]){let o=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,o),e[n]=o}return}Ve.has(t)||Q([t])}function Sn(e,t){delete e[`$$${t}`];let r=`__fx_${t}`,n=e[r];n&&(e.removeEventListener(t,n),delete e[r])}function J(e,t=!1){if(Ye)return Ft().createText(e);if(v.active&&!t){let r=Rn()?.hydrateText(e);if(r)return r}return document.createTextNode(e)}function ae(e,t=!1){if(Ye)return Ft().createElement(e,t);if(v.active){let r=Rn()?.hydrateElement(e);if(r)return r}return t?document.createElementNS(Ht,e):document.createElement(e)}function Qi(e,t,r,n,o){let a=n,s=new Map;return O(()=>{let i;if(U(e)&&!P(e)){if(!s.has(e)){V++;try{let l=e();s.set(e,l)}finally{V--}}for(i=s.get(e);typeof i=="function"&&P(i);)i=i()}else for(i=e();typeof i=="function"&&P(i);)i=i();{let l=0;for(;typeof i=="function"&&l++<50;)if(U(i)){if(!s.has(i)){let u=i;V++;try{let c=u();s.set(u,c)}finally{V--}}i=s.get(i)}else if(P(i))i=i();else if(i=i(),typeof i!="function"||!P(i)&&!U(i))break}V++;try{a=Ue(t,i,r,a,s),o(a)}finally{V--}})}function L(e,t,r,n){if(V>Zi)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;r!==void 0&&!r&&(r=J("",!0),e.appendChild(r));let o=n??null,a=l=>Array.isArray(l)&&l.some(u=>typeof u=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!a(t)){V++;try{o=Ue(e,t,r,null)}finally{V--}return()=>o}let i=Qi(s(t),e,r,o,l=>{o=l});return()=>(i?.(),o)}function Ue(e,t,r,n,o){if(t==null||typeof t=="boolean")return Z(e,n,r);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return Z(e,n,r);if(ze(t)){let s=J("",!0);return Array.isArray(n)?n.length>0?(e.replaceChild(s,n[0]),Z(e,n.slice(1),r)):M(e,s,r):n?e.replaceChild(s,n):M(e,s,r),t.then(i=>{s.parentNode===e&&Ue(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(n)){if(n.length===0){let i=J(t);return M(e,i,r),i}if(n.length===1&&n[0].nodeType===3)return n[0].data=t,n;n=Z(e,n,r)}if(n&&Ki(n))return n.data=t,n;let s=J(t);return n&&n.parentNode===e?e.replaceChild(s,n):xn(e,s)||M(e,s,r),s}if(Wt(t))return xn(e,t)?(Nn(t),t):Array.isArray(n)?(n.length===0?M(e,t,r):n[0].parentNode===e?(e.replaceChild(t,n[0]),Z(e,n.slice(1),r)):M(e,t,r),t):(n?n!==t&&(n.parentNode===e?e.replaceChild(t,n):M(e,t,r)):M(e,t,r),t);if(Array.isArray(t)){let s=[],i=Array.isArray(n)?n:n?[n]:[],l=[];z(t,s,e,r,!0,o,l);let u=es(e,i,s,r);for(let c of l){let f=L(e,c.sig,c.marker);A(()=>{Z(e,f()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(a==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let l=i.type(i.props||{});return Ue(e,l,r,n)}}}return Z(e,n,r)}function z(e,t,r,n,o=!0,a,s){for(let i=0;i<e.length;i++){let l=e[i];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!ze(l)&&!P(l)&&!U(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let u;for(U(l)&&!P(l)?(a||(a=new Map),a.has(l)||a.set(l,l()),u=a.get(l)):u=l();typeof u=="function"&&!ze(u)&&!P(u)&&!U(u);)a||(a=new Map),a.has(u)||a.set(u,u()),u=a.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(P(u)){if(s){let f=J("",!0);t.push(f),s.push({marker:f,sig:u});continue}let c=u();for(;typeof c=="function"&&P(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?z(c,t,r,n,o,a):z([c],t,r,n,o,a);continue}continue}Array.isArray(u)?z(u,t,r,n,o,a,s):z([u],t,r,n,o,a,s);continue}if(ze(l)){let u=J("",!0);t.push(u),l.then(c=>{if(u.parentNode){let f=[];if(z([c],f,u.parentNode,void 0,!1,a),f.length>0){u.parentNode.replaceChild(f[0],u);for(let p=1;p<f.length;p++)u.parentNode?.insertBefore(f[p],f[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(l)){z(l,t,r,n,o,a,s);continue}if(Wt(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let u=l;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?z(c,t,r,n,!1,a):z([c],t,r,n,!1,a);continue}}if(typeof l=="string"||typeof l=="number"){let u=String(l);if(u.trim()===""&&u!==" ")continue;t.push(J(u));continue}t.push(J(String(l)))}}}}function es(e,t,r,n){for(let f=0;f<r.length;f++)r[f].parentNode!==null&&r[f].parentNode!==e&&(r=r.slice(),r[f]=r[f].cloneNode(!0));let o=r.length,a=t.length,s=o,i=0,l=0,u=a>0?t[a-1].nextSibling??void 0:n,c=null;for(;i<a||l<s;){if(t[i]===r[l]){i++,l++;continue}for(;a>i&&s>l&&t[a-1]===r[s-1];)a--,s--;if(a===i){let f=s<o?l?r[l-1].nextSibling??void 0:r[s-l]:u;for(;l<s;)M(e,r[l++],f)}else if(s===l)for(;i<a;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===r[s-1]&&r[l]===t[a-1]){let f=t[--a].nextSibling;M(e,r[l++],t[i++].nextSibling),M(e,r[--s],f),t[a]=t[i-1]}else{if(!c){c=new Map;let p=l;for(;p<s;)c.set(r[p],p++)}let f=c.get(t[i]);if(f!=null)if(l<f&&f<s){let p=i,y=1;for(;++p<a&&p<s&&!(!c.has(t[p])||c.get(t[p])!==f+y);)y++;if(y>f-l){let d=t[i];for(;l<f;)M(e,r[l++],d)}else t[i].parentNode===e?e.replaceChild(r[l++],t[i++]):(M(e,r[l++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return r}function Z(e,t,r){if(t)if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n].parentNode===e&&e.removeChild(t[n]);else t.parentNode===e&&e.removeChild(t);return null}function M(e,t,r){v.active&&t.parentNode===e||(r&&r.parentNode===e?e.insertBefore(t,r):e.appendChild(t))}function se(e,t,r){r==null?delete e[t]:e[t]=r}function Dn(e,t,r){let n=r,o;return Array.isArray(r)&&(n=r[0],o=r[1]),typeof n!="function"?()=>{}:(e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o))}function In(e,t){let r=(n,o)=>{typeof n=="function"&&n(e,o??(()=>{}))};if(typeof t=="function"){r(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){r(t[0],t[1]);return}for(let n of t)Array.isArray(n)?r(n[0],n[1]):r(n)}}function Lt(e,t,r,n=!1){return typeof r!="function"?(k(e,t,r,n),()=>{}):O(()=>{let o=typeof r=="function"?r():r;k(e,t,o,n)})}function Dt(e,t,r){return typeof r!="function"?(se(e,t,r),()=>{}):O(()=>{let n=typeof r=="function"?r():r;se(e,t,n)})}function qn(e,t,r){return typeof r!="function"?(k(e,t,!!r),()=>{}):O(()=>{let n=r();k(e,t,!!n)})}function Be(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){O(()=>Be(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let r=Object.keys(t).filter(n=>{let o=t[n];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",r);return}e.setAttribute("class",String(t))}function Ke(e,t,r){if(!(!t||typeof t!="object"))for(let n in t){let o=t[n],a=n.split(/\s+/).filter(Boolean);if(typeof o=="function"&&r)r.push(O(()=>{let s=!!o();for(let i of a)e.classList.toggle(i,s)}));else{let s=!!(typeof o=="function"?o():o);for(let i of a)e.classList.toggle(i,s)}}}function Je(e,t){let r=t;for(;typeof r=="function";)r=r();if(r==null){e.removeAttribute("style");return}if(typeof r=="string"){e.style.cssText=r;return}if(typeof r=="object")for(let n in r){let o=r[n];o==null?e.style[n]="":e.style[n]=o}}function Hn(e){let{element:t,props:r,prevProps:n=Xi,isSVG:o=!1,skipChildren:a=!1}=e;if(!t||!Bi(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!r)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===Ht,i=[];for(let l in r){if(a&&l==="children")continue;let u=r[l],c=n[l];if(u===c)continue;if(l==="ref"){Vt(u,t);continue}if(l==="use"){In(t,u);continue}if(l.startsWith("on:")){i.push(Dn(t,l.slice(3),u));continue}if(l.startsWith("prop:")){i.push(Dt(t,l.slice(5),u));continue}if(l.startsWith("attr:")){i.push(Lt(t,l.slice(5),u,s));continue}if(l.startsWith("bool:")){i.push(qn(t,l.slice(5),u));continue}if(l==="class"||l==="className"){typeof u=="function"?i.push(O(()=>Be(t,u()))):Be(t,u);continue}if(l==="classList"){typeof u=="function"?i.push(O(()=>Ke(t,u()))):Ke(t,u,i);continue}if(l==="style"){typeof u=="function"?i.push(O(()=>Je(t,u()))):Je(t,u);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();c&&Sn(t,p),u&&Yi(t,p,u);continue}let f=wn.has(l)||!s&&l in t;typeof u=="function"?i.push(f?Dt(t,l,u):Lt(t,l,u,s)):i.push(O(()=>f?se(t,l,r[l]):k(t,l,r[l],s)))}for(let l in n)if(!(l in r))if(l.startsWith("on")){let u=l.slice(2).toLowerCase();Sn(t,u)}else wn.has(l)?se(t,l,null):t.removeAttribute(l);return()=>{i.forEach(l=>l())}}function ts(e,t,r=!1){for(let n in t){let o=t[n];if(n==="ref"){Vt(o,e);continue}if(n!=="children"){if(n==="use"){In(e,o);continue}if(n.startsWith("on:")){Dn(e,n.slice(3),o);continue}if(n.startsWith("prop:")){Dt(e,n.slice(5),o);continue}if(n.startsWith("attr:")){Lt(e,n.slice(5),o,r);continue}if(n.startsWith("bool:")){qn(e,n.slice(5),o);continue}if(n.startsWith("on")&&n.length>2){let a=n.slice(2).toLowerCase();if(typeof o=="function")if(zt.has(a)){e[`$$${a}`]=o;let s=`__fx_${a}`;if(!e[s]){let i=l=>{e[`$$${a}`]?.(l)};e.addEventListener(a,i),e[s]=i}}else e[`$$${a}`]=o,Ve.has(a)||Q([a]);continue}if(n==="class"||n==="className"){Be(e,o);continue}if(n==="classList"){typeof o=="function"?O(()=>Ke(e,o())):Ke(e,o);continue}if(n==="style"){typeof o=="function"?O(()=>Je(e,o())):Je(e,o);continue}if(n==="innerHTML"){if(typeof o=="function"){let a=S(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});A(()=>a())}else e.innerHTML=o;continue}if(n==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let a=S(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});A(()=>{a()})}else O(()=>{document.activeElement!==e&&(e.value=t[n]??"")});continue}if(n==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let a=S(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});A(()=>{a()})}else O(()=>{document.activeElement!==e&&(e.checked=t[n]??"")});continue}if(n==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let a=!0,s=S(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});A(()=>{s()})}else{let a=!0;O(()=>{let s=t[n];a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let a=S(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();bn(e,n,s,r)});A(()=>{a()})}else O(()=>bn(e,n,t[n],r))}}}function Vt(e,t){if(e){if(Wt(e)){let r=t,n=e;if(!r)return;typeof r=="function"?r(n):typeof r=="object"&&"current"in r&&(r.current=n);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function rs(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function ze(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Ut(e,t,r){if(!t)throw new Error("Container element is required");let n,o,a=[];return N(s=>{_(()=>{v.active||(t.textContent=""),L(t,e)}),o=s}),()=>{o?.(),n?.(),a.forEach(s=>s()),t.textContent=""}}function Fn(e){It.fn=e}function X(e,t){return It.fn?It.fn(e,t):(()=>e(t))}function Bt(){let e=globalThis.__FX_DATA__;if(e)return e;if(Mt!==void 0)return Mt;let t=null;if(typeof document<"u"){let r=document.getElementById(os)?.textContent;if(r)try{t=JSON.parse(r)}catch{t=null}}return Mt=t}function Kt(){for(;;){for(;v.cursor&&v.cursor.nodeType===3&&v.cursor.data==="";)v.cursor=v.cursor.nextSibling;if(v.cursor!=null||!v.parents.length)return;v.cursor=v.parents.pop().nextSibling}}function Xt(e,t){let r=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${r}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function ss(e){Kt();let t=v.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(is.has(e.toLowerCase())?v.cursor=t.nextSibling:(v.parents.push(t),v.cursor=t.firstChild),t):(Jt&&t&&Xt(`<${e}>`,t),null)}function as(e){if(e===""){let r=v.cursor;return r&&r.nodeType===3&&r.data!==""?(v.cursor=r.nextSibling,r.data="",r):null}Kt();let t=v.cursor;return t&&t.nodeType===3?(v.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Jt&&t&&Xt(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function ls(e){Kt();let t=v.cursor;return t&&t.nodeType===8&&t.data===e?(v.cursor=t.nextSibling,t):(Jt&&t&&Xt(`marker <!--${e.slice(0,24)}-->`,t),null)}function us(){Tn||(Tn=!0,Ji({hydrateElement:ss,hydrateText:as,hydrateMarker:ls}))}function Qe(e,t,r){us(),v.active=!0,v.cursor=t.firstChild,v.parents=[];let n=Bt(),o=r?.resourceNamespace,a=0;Kr(()=>o?`${o}:r${a++}`:`r${a++}`),Br(n?s=>s in n?{value:n[s]}:void 0:null);try{return Ut(e,t)}finally{v.active=!1,v.cursor=null,v.parents=[]}}function Wn(e,t={}){if(typeof e=="function")return X(e,t);if(typeof e!="string"||e.length===0)return null;let r=rs(e);if(Ye)return Ft().createElement(e,r);let n=r?document.createElementNS(Ht,e):document.createElement(e);return ts(n,t,r),cs(n,t),n}function cs(e,t){if(!t||t.children===void 0)return;let r=me(()=>t.children),n=o=>{L(e,o,typeof o=="function"?null:void 0)};Array.isArray(r)?r.forEach(n):n(r)}function fs(e){return typeof e=="function"?e:(()=>e)}function et(e){return()=>{let t=e();return typeof t=="function"?t():t}}function ps(e){return e!=null&&e!==!1}function ds(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function zn(e){let t=et(()=>e.when),r=g(t,void 0),n=g(r,void 0);return g(()=>{if(n()){let o=e.children;return typeof o=="function"&&!ds(o)?typeof r=="function"?C(()=>C(r)?o(r()):e.fallback):o(r):o}return e.fallback},void 0,{name:"show"})}function Vn(e){let t=et(()=>e.each),r=()=>e.fallback??null,n=(o,a)=>{let s=e.children,i=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,a):l):typeof s=="function"?s(o,a):s;return Ln(i),i};return e.by?Vr(t,e.by,(o,a)=>n(o,a),{fallback:r}):zr(t,(o,a)=>n(o,a),{fallback:r})}function Un(e){let t=et(()=>e.each);return Ur(t,(r,n)=>{let o=e.children(r,n);return Ln(o),o},{fallback:()=>e.fallback??null})}function Bn(e){return{[qt]:!0,when:et(()=>e.when),children:e.children}}function Kn(e){let t=Array.isArray(e.children)?e.children:[e.children];return g(()=>{for(let r of t){let n=r,o=0;for(;typeof n=="function"&&!n[qt]&&o++<10;)n=n();if(!n||typeof n!="object"||n[qt]!==!0)continue;let a=n.when();if(ps(a))return typeof n.children=="function"?n.children(a):n.children}return e.fallback??null})}function Jn(e){let t=fs(e.component),{component:r,...n}=e;return g(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:n}:o(n)})}function Xn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,r,n;return N(o=>{r=o,n=document.createElement("div"),n.style.display="contents",t().appendChild(n),L(n,e.children)&&Vt(e.ref,n)}),A(()=>{r(),n.remove()}),null}function Gn(e){let[t,r]=w(null),n=()=>r(null);return g(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,n):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(a){return r(a),typeof e.fallback=="function"?e.fallback(a,n):e.fallback}})}function Yn(e){return g(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t))n&&(typeof o=="function"?o():o)&&r.push(n);return r.join(" ")})}function ys(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Zn(e){return g(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t)){if(!n)continue;let a=typeof o=="function"?o():o;a!=null&&r.push(`${ys(n)}: ${a}`)}return r.join("; ")})}var Ht,wn,Ta,Ye,Ze,An,v,jn,Xi,Ve,zt,V,Zi,ns,It,os,Mt,is,Jt,Tn,qt,hs,D=j(()=>{"use strict";x();x();x();x();x();x();x();x();x();x();x();x();x();Ht="http://www.w3.org/2000/svg";wn=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);Ta=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;Ye=typeof document>"u",Ze=Symbol.for("fluixi.server-node"),An=null;v={active:!1,cursor:null,parents:[]},jn=null;Xi={},Ve=new Set,zt=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);V=0,Zi=200;ns="__fx_dom_create_component__",It=globalThis[ns]??={fn:null};os="__FX_DATA__";is=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Jt=typeof process<"u"&&process.env&&!1;Tn=!1;qt=Symbol("match");hs=Ze});function Yt(){return ms}function Qn(){let e=F();if(!e)return null;if(!e[Gt]){let t={mounts:[],effects:[],scheduled:!1};e[Gt]=t}return e[Gt]}function eo(e){if(e.scheduled)return;e.scheduled=!0;let t=F();queueMicrotask(()=>{if(Ir(t)){e.mounts=[],e.effects=[];return}W(t,()=>{for(let r of e.mounts)try{let n=r();typeof n=="function"&&A(n)}catch(n){console.error("Error in onMount callback:",n)}for(let r of e.effects){let n;S(()=>{n&&n(),n=r()}),A(()=>{n&&n()})}e.mounts=[],e.effects=[]})})}function G(e){Fn(be)}function be(e,t){return tt(e,t)}function tt(e,t){let r=typeof e=="function"?C(()=>e(t)):e;if(r!=null&&(typeof r=="function"||typeof r=="object")&&!P(r)){try{r.$name=e.name}catch{}return Ge(r)}return r}function rt(e,t=!0){let r=Qn();if(r){if(!t){r.scheduled||e();return}r.mounts.push(e),eo(r)}else{if(!t){e();return}S(()=>{let n=C(e);typeof n=="function"&&A(n)})}}function nt(e){A(e)}function we(e){let t=Qn();if(t)t.effects.push(e),eo(t);else{let r;S(()=>{r&&r(),r=e()}),A(()=>{r&&r()})}}function ot(e){return g(e)}function it(e){let t={current:e};return A(()=>{t.current=null}),t}function st(e,t){let[r,n]=w(t);return[r,a=>{n(e(r(),a))}]}function at(e,t,r,n){we(()=>{let o=e&&"current"in e?e.current:e;if(o)return o.addEventListener(t,r,n),()=>{o.removeEventListener(t,r,n)}})}function lt(e){return e}function Zt(){return ve}function Qt(e){ve&&e()}var ms,ve,Gt,le=j(()=>{"use strict";D();x();ms={context:null,owner:null};ve=typeof process<"u"&&!1,Gt=Symbol.for("fluixi-lifecycle")});function xe(e,t){let r,n,o;function a(){return n||(n=e().then(i=>r=i.default)),n}t?.preload&&a();let s=(i=>{if(r){let l=r;return C(()=>l(i))}if(!o){let[l]=K(()=>a());if(o=l,l.error)throw l.error}return g(()=>{let l=o();return l?C(()=>l(i)):void 0},void 0,{name:"lazy"})});return s.preload=()=>a().then(()=>{}),s.$lazy=!0,s.loader=e,s}var er=j(()=>{"use strict";x()});function ws(){so||(so=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function ut(e,t,r){let n=!!e?.Provider,o=n?e:e.context,a=n?t:e.value,s=n?!1:e.debug??!1;n||ws();let i=typeof a=="function"?a():a,l=n?r:e;return o.Provider({value:i,get children(){return l?.children},debug:s})}function ao(e){let t=ce(e);return[t,n=>ut(t,n.value,n)]}function rr(e,t){if(e.length===0)return me(()=>t);let[r,n]=e[0],o=e.slice(1);return ut(r,n,{get children(){return rr(o,t)}})}function lo(e){return t=>{let r=fe(e);return t.children(r)}}function uo(e,t){let r=fe(e);return r===e.defaultValue?t():r}function ce(e){let t=q(e),r=n=>(n.debug,t.Provider({value:n.value,get children(){return n.children},debug:n.debug}));return typeof Symbol<"u"&&Symbol.for&&(r.$$typeof=Symbol.for("react.provider")),r.$$typeof=Symbol.for("react.provider"),{id:t.id,Provider:En(r),defaultValue:e}}function fe(e){let t=H(e);return t!==void 0?t:e.defaultValue}var so,nr=j(()=>{"use strict";D();x();x();le();G("index");so=!1});function vo(){return go}function sr(e){go=e}function bo(e,t){ct.set(e,t)}function wo(e){return ct.get(e)}function Os(){ct.clear()}function Ao(){if(typeof window>"u")return!1;let e=document.getElementById("__FLUIXI_HYDRATION__");if(!e||e.getAttribute("type")!=="application/json")return!1;try{let t=e.textContent||"{}",r=JSON.parse(t);for(let[n,o]of Object.entries(r))ct.set(n,o);return!0}catch(t){return console.error("Failed to deserialize hydration data:",t),!1}}function ar(){if(typeof window>"u")return;let e=document.getElementById("__FLUIXI_HYDRATION__");e&&e.remove();let t=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),r=[],n;for(;n=t.nextNode();){let o=n,a=o.nodeValue||"";(a.startsWith("#")||a.startsWith("/"))&&r.push(o)}r.forEach(o=>o.remove()),Os()}function xo(){return typeof window>"u"}var go,ct,lr=j(()=>{"use strict";go=!1,ct=new Map;typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(ar,100)})});function Fs(e,t,r){let n=new Uint8Array(t.length);e:for(let o=0;o<e.length;o++){for(let a=0;a<t.length;a++)if(!n[a]&&te(e[o],t[a],r)){n[a]=1;continue e}return!1}return!0}var te,To=j(()=>{"use strict";Ot();te=(e,t,r={})=>{if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;let n=Array.isArray(e),o=Array.isArray(t);if(n!==o)return!1;if(n&&o)return e.length!==t.length?!1:r.unordered?Fs(e,t,r):e.every((h,b)=>te(h,t[b],r));if(typeof e!="object")return e===t;let a=e instanceof Date,s=t instanceof Date;if(a!==s)return!1;if(a)return e.getTime()===t.getTime();let i=e instanceof RegExp,l=t instanceof RegExp;if(i!==l)return!1;if(i)return e.toString()===t.toString();let u=e instanceof Map,c=t instanceof Map;if(u!==c)return!1;if(u){if(e.size!==t.size)return!1;for(let[h,b]of e)if(!t.has(h)||!te(b,t.get(h),r))return!1;return!0}let f=e instanceof Set,p=t instanceof Set;if(f!==p)return!1;if(f){if(e.size!==t.size)return!1;let h=[...t],b=new Uint8Array(h.length);e:for(let T of e){for(let $=0;$<h.length;$++)if(!b[$]&&te(T,h[$],r)){b[$]=1;continue e}return!1}return!0}if(!De(e)||!De(t))return!1;let y=Object.keys(e),d=Object.keys(t);if(y.length!==d.length)return!1;for(let h of y)if(!Object.prototype.hasOwnProperty.call(t,h)||!te(e[h],t[h],r))return!1;return!0}});function Ws(e){return e.startsWith("//")?e.replace(/^\/+/,"/"):e}function pe(e,t,r=!1){let n=[];if(e===t)return{params:{},path:t};if(!r&&e==="/"&&t.startsWith("/"))return{params:{},path:"/"};let o=e.replace(/:([a-zA-Z0-9_]+)/g,(l,u)=>(n.push(u),"([^/]+)")).replace(/\*([a-zA-Z0-9_]*)/g,(l,u)=>(u&&n.push(u),"(.*)"));o.startsWith("/")||(o="/"+o),o===""&&(o="/");let a=new RegExp(`^${o}${r?"$":"(?=/|$)"}`),s=t.match(a);if(!s)return null;let i={};return n.forEach((l,u)=>{i[l]=s[u+1]}),{params:i,path:s[0]}}function dr(e){let t=e.path.split("/").filter(Boolean);if(t.length===0)return 5;let r=0;for(let n of t)n.startsWith("*")?r+=1:n.startsWith(":")?r+=10:r+=100;return r}function Co(e){return[...e].sort((t,r)=>dr(r)-dr(t))}function re(e,t){let r=t.length>1?t.replace(/\/+$/,"")||"/":t,n=ko(e,r);if(!n)return null;let o=[],a="",s={};for(let i of n.layers){a=Ws(zs(a,i.consumed));let l={};for(let[u,c]of Object.entries(i.params))u in s||(l[u]=c),s[u]=c;o.push({route:i.route,component:i.route.component,params:l,pathname:a||"/"})}return{matched:o,params:s,pathname:t}}function ko(e,t){if(!e||e.length===0)return null;let r=Co(e);for(let n of r){let o=!!n.children&&n.children.length>0,a=pe(n.path,t,!o);if(a){if(o){let s=ko(n.children,t);if(s)return{layers:[{route:n,params:a.params,consumed:a.path},...s.layers]};continue}return{layers:[{route:n,params:a.params,consumed:a.path}]}}}return null}function zs(e,t){if(!e)return t;if(t===e)return e;if(t.startsWith(e))return t;let r=e.replace(/\/$/,""),n=t.replace(/^\//,"");return`${r}/${n}`}var yr=j(()=>{"use strict"});function hr(e){let t=e,r="",n=t.indexOf("#");n!==-1&&(r=t.slice(n),t=t.slice(0,n));let o="",a=t.indexOf("?");return a!==-1&&(o=t.slice(a),t=t.slice(0,a)),{pathname:t||"/",search:o,hash:r}}function Ce(e="/"){let t=[{path:e,state:null}],r=0,n=new Set,o=()=>n.forEach(a=>a());return{get(){let{path:a,state:s}=t[r];return{...hr(a),state:s}},push(a,s=null){t=t.slice(0,r+1),t.push({path:a,state:s}),r=t.length-1,o()},replace(a,s=null){t[r]={path:a,state:s},o()},subscribe(a){return n.add(a),()=>n.delete(a)}}}function ne(){let e=typeof window<"u"?window:void 0,t=new Set,r=()=>t.forEach(n=>n());return e&&e.addEventListener("popstate",r),{get(){if(!e)return{pathname:"/",search:"",hash:"",state:null};let{pathname:n,search:o,hash:a}=e.location;return{pathname:n,search:o,hash:a,state:e.history.state??null}},push(n,o=null){e?.history.pushState(o,"",n),r()},replace(n,o=null){e?.history.replaceState(o,"",n),r()},subscribe(n){return t.add(n),()=>t.delete(n)}}}var mr=j(()=>{"use strict"});function Vs(e){let t={};return e&&new URLSearchParams(e.startsWith("?")?e.slice(1):e).forEach((n,o)=>t[o]=n),t}function Us(e,t){if(!t)return e||"/";let r=t.replace(/\/$/,"");return e===r?"/":e.startsWith(r+"/")?e.slice(r.length)||"/":e||"/"}function Bs(e,t){return!t||/^https?:\/\//.test(e)?e:`${t.replace(/\/$/,"")}${e.startsWith("/")?e:"/"+e}`}function gr(e){let{routes:t,history:r,base:n}=e,o=new Set,a=()=>{let c=r.get();return{pathname:c.pathname,search:c.search,hash:c.hash,state:c.state,query:Vs(c.search)}},s=c=>re(t,Us(c,n)),i=(()=>{let c=a();return{location:c,match:s(c.pathname)}})(),l=()=>{let c=a();i={location:c,match:s(c.pathname)},o.forEach(f=>f(i))},u=r.subscribe(l);return{state(){return i},subscribe(c){return o.add(c),()=>o.delete(c)},navigate(c,f={}){let p=Bs(c,n);f.replace?r.replace(p,f.state??null):r.push(p,f.state??null)},match(c){return s(c)},destroy(){u(),o.clear()}}}var Oo=j(()=>{"use strict";yr();mr()});var vr=j(()=>{"use strict";yr();mr();Oo()});function Po(e,t){return async(...r)=>{let n=t+":"+JSON.stringify(r);if(vo()||typeof window<"u"){let a=wo(n);if(a!==void 0)return a}if(Oe.has(n))return Oe.get(n);if(ke.has(n))return ke.get(n);let o=Promise.resolve(e(...r)).then(a=>(Oe.set(n,a),ke.delete(n),xo()&&bo(n,a),a),a=>{throw ke.delete(n),a});return ke.set(n,o),o}}function Eo(e){let t=typeof e=="string"?r=>r.startsWith(e):e;for(let r of Oe.keys())t(r)&&(Oe.delete(r),Js.add(r));Ks(r=>r+1)}function $o(e,t){let[r]=K(t||(()=>!0),e);return r}function _o(e){return br.has(e)||br.set(e,w(void 0)),br.get(e)}function wr(e,t){let r=t||e.name||"action",n=async o=>{let[,a]=_o(r),s=()=>a(void 0),i=()=>n(o);a({input:o,pending:!0,clear:s,retry:i});try{let l=await e(o);return a({input:o,result:l,pending:!1,clear:s,retry:i}),l}catch(l){throw a({input:o,error:l,pending:!1,clear:s,retry:i}),l}};return n.url=r,n.with=o=>wr((...a)=>e(o,...a),t),n}function jo(e){let[t]=_o(e.url);return t}function Ro(e){return e}var Oe,ke,Zu,Ks,Js,br,Xs,Qu,No=j(()=>{"use strict";x();lr();nr();Oe=new Map,ke=new Map;[Zu,Ks]=w(0),Js=new Set;br=new Map;Xs=ce(),Qu=Xs.Provider});var qo={};_r(qo,{A:()=>Or,Form:()=>ia,Link:()=>ht,Outlet:()=>xr,Redirect:()=>Sr,Router:()=>Ar,action:()=>wr,cache:()=>Po,createAsync:()=>$o,createBrowserHistory:()=>ne,createMemoryHistory:()=>Ce,lazy:()=>xe,matchPath:()=>pe,matchRoutes:()=>re,preloadRoutes:()=>sa,revalidate:()=>Eo,runWithOwner:()=>W,select:()=>ra,useAction:()=>Ro,useLevelParams:()=>ea,useLocation:()=>Ee,useMatch:()=>Cr,useNavigate:()=>yt,useParam:()=>Tr,useParamSelector:()=>ta,useParams:()=>Pe,useRouteData:()=>na,useRouter:()=>de,useSearchParams:()=>kr,useSubmission:()=>jo});function Gs(e,t,r){let n,o=e.route.data;if(typeof o=="function"){let c=!1;A(()=>{c=!0});let f=F(),[p]=K(()=>o({params:r.params,location:r.location},f,()=>c));n=p}let a=()=>Do.Provider({value:n,get children(){return Lo.Provider({value:e.params,get children(){return Mo.Provider({value:{depth:t,...r},get children(){return X(e.component,{})}})}})}});if(!n)return a();let s=n,i=()=>s.loading,[l,u]=w(C(()=>!i()));return S(()=>u(!i())),g(()=>l()?a():null)}function Io(e){let t=e.depth+1,[r,n]=w(C(()=>e.matched()[t]?.component));return S(()=>{let o=e.matched()[t]?.component;n(()=>o)}),g(()=>{if(!r())return e.notFound?e.notFound():null;let a=C(()=>e.matched())[t];return Gs(a,t,{matched:e.matched,params:e.params,location:e.location})})}function Ys(e){return e==null?Zs():typeof e=="function"?X(e,{}):e}function Zs(){let e=ae("div");k(e,"class","fx-not-found"),k(e,"role","main"),k(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let t=ae("h1");k(t,"style","margin:0;font-size:2.5rem;font-weight:700"),L(t,"404");let r=ae("p");return k(r,"style","margin:0;opacity:.7"),L(r,"This page could not be found."),e.appendChild(t),e.appendChild(r),e}function Ar(e){let t=e.history??ne(),r=gr({routes:e.routes,base:e.base,history:t}),[n,o]=w(r.state()),a=r.subscribe(o);A(()=>{a(),r.destroy()});let s=g(()=>(n().match?.matched??[]).filter(c=>c.component)),i={router:r,location:g(()=>n().location),params:g(()=>n().match?.params??{})},l={depth:-1,matched:s,params:i.params,location:i.location,notFound:()=>Ys(e.notFound)},u;return dt.Provider({value:i,get children(){return u??=Io(l)}})}function xr(){let e=H(Mo);return e?Io(e):null}function Sr(e){let t=H(dt);if(!t||typeof window>"u")return null;let r=!1;return A(()=>r=!0),queueMicrotask(()=>{r||t.router.navigate(e.to,{replace:e.replace!==!1})}),null}function de(){let e=H(dt);if(e)return e;if(typeof window>"u")return Qs;throw new Error("[router-next] useRouter must be used within <Router>")}function Pe(){let e=de().params;return g(()=>e(),{},{equals:(t,r)=>JSON.stringify(t)===JSON.stringify(r)})}function ea(){return H(Lo)??{}}function Tr(e){let t=Pe();return g(()=>t()[e])}function ta(e,t){let r=Pe();return g(()=>e(r()),void 0,t?{equals:t}:void 0)}function Cr(e){let t=Ee();return g(()=>pe(typeof e=="function"?e():e,t.pathname))}function kr(){let e=Ee(),t=yt();return[g(()=>e.query),(o,a)=>{let s=new URLSearchParams(e.search);for(let[l,u]of Object.entries(o))u===null?s.delete(l):s.set(l,u);let i=s.toString();t(e.pathname+(i?`?${i}`:""),a)}]}function ra(e,t){let r=(n,o)=>te(n,o);return t!==void 0?g(()=>Le(e(),t),void 0,{equals:r}):g(e,void 0,{equals:r})}function Ee(){let{location:e}=de();return new Proxy({},{get:(t,r)=>e()[r],has:(t,r)=>r in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(t,r)=>Object.getOwnPropertyDescriptor(e(),r)})}function yt(){let{router:e}=de();return(t,r)=>e.navigate(t,r)}function na(){return H(Do)??(()=>{})}function ht(e){let t=H(dt),r=typeof document>"u",n=()=>t?.router.navigate(B(e.href)??"",{replace:B(e.replace)}),o=ae("a");k(o,"href",B(e.href)??""),e.slot&&k(o,"slot",B(e.slot));for(let[s,i]of Object.entries(e))oa.has(s)||i!=null&&typeof i!="function"&&k(o,s,String(i));if(typeof o.addEventListener=="function")o.addEventListener("click",s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),n())});else{let s=B(e.className??e.class)??"";s&&k(o,"class",s)}typeof o.addEventListener=="function"&&S(()=>{let s=B(e.href)??"";o.setAttribute("href",s);let i=B(e.className??e.class)??"",l=B(e.activeClass)??"",u=B(e.active)??t?.location().pathname===s;o.className=[i,u?l:""].filter(Boolean).join(" ")});let a=e.children;return a!=null&&L(o,a),o}function ia(e){let t=e.action,r=e.className??e.class,n=t.url??"",o=ae("form");k(o,"method","post"),n&&k(o,"action",n),r&&k(o,"class",r);for(let[s,i]of Object.entries(e))s==="action"||s==="children"||s==="class"||s==="className"||i!=null&&typeof i!="function"&&k(o,s,String(i));typeof o.addEventListener=="function"&&o.addEventListener("submit",s=>{s.preventDefault();let i={};new FormData(o).forEach((l,u)=>{i[u]=l}),Promise.resolve(t(i)).catch(()=>{})});let a=e.children;return a!=null&&L(o,a),o}async function sa(e,t){let r=re(e,t);if(!r)return;let n=[];for(let o of r.matched){let a=o.component;a&&typeof a.preload=="function"&&n.push(a.preload())}await Promise.all(n)}var dt,Mo,Lo,Do,Qs,B,oa,Or,Pr=j(()=>{"use strict";x();D();x();Ot();To();vr();vr();No();er();x();dt=q(),Mo=q(),Lo=q(),Do=q();Qs={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};B=e=>typeof e=="function"?e():e,oa=new Set(["href","slot","class","className","active","activeClass","replace","children"]);Or=ht});var la={};_r(la,{$component:()=>tt,A:()=>Or,DEV:()=>ve,Dynamic:()=>Jn,ErrorBoundary:()=>Gn,FRAMEWORK_NAME:()=>mo,For:()=>Vn,Fragment:()=>or,Index:()=>Un,Link:()=>ht,Match:()=>Bn,Outlet:()=>xr,Portal:()=>Xn,Redirect:()=>Sr,Router:()=>Ar,Show:()=>zn,Store:()=>We,Suspense:()=>Ae,Switch:()=>Kn,VERSION:()=>ho,addClass:()=>Cn,batch:()=>_,classMap:()=>Yn,cleanupDelegation:()=>io,composeProviders:()=>rr,createBrowserHistory:()=>ne,createComponent:()=>be,createComputed:()=>Wr,createConsumer:()=>lo,createContext:()=>ce,createContextWithProvider:()=>ao,createDebounce:()=>Gr,createDeferred:()=>Xr,createEffect:()=>S,createIsomorphicState:()=>co,createMemo:()=>g,createMemoryHistory:()=>Ce,createProvider:()=>ut,createRenderEffect:()=>O,createResource:()=>K,createRoot:()=>N,createSelector:()=>Jr,createSignal:()=>w,createStore:()=>Rt,delegateEvents:()=>Q,devOnly:()=>Qt,getFrameworkInfo:()=>ks,getOwner:()=>F,getSharedConfig:()=>Yt,hydrate:()=>Qe,initDelegation:()=>oo,insert:()=>L,isDOMNode:()=>Xe,isDev:()=>Zt,isLitTemplateResult:()=>Pn,isRenderable:()=>no,jsx:()=>ir,jsxs:()=>yo,lazy:()=>xe,mount:()=>Ho,onCleanup:()=>A,onMount:()=>rt,onUnmount:()=>nt,portal:()=>ro,read:()=>on,reduce:()=>nn,removeClass:()=>kn,render:()=>ue,runWithOwner:()=>W,setAttribute:()=>k,setOwner:()=>Hr,setProperty:()=>se,spread:()=>Hn,startClient:()=>Fo,styleMap:()=>Zn,toggleClass:()=>On,untrack:()=>C,untrackStore:()=>Nt,useCallback:()=>lt,useContext:()=>fe,useEffect:()=>we,useEventListener:()=>at,useLocation:()=>Ee,useMatch:()=>Cr,useMemo:()=>ot,useNavigate:()=>yt,useParam:()=>Tr,useParams:()=>Pe,useProvide:()=>uo,useReducer:()=>st,useRef:()=>it,useRouter:()=>de,useSearchParams:()=>kr});x();x();var Ai="__fluixi_signal_next_state__",xi=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},E=globalThis[Ai]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:xi,onSuspend:null,onError:null},en=0,tn=1,Ie=2,Si=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(E.untracked)return;let e=E.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}};var Ti=class extends Si{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=Ie,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(E.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 e of this.sources)if(e.updateIfNecessary(),this.state===Ie)break}(this.state===Ie||!this._initialized)&&this.recompute(),this.state=en}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=E.consumer,t=E.untracked;E.consumer=this,E.untracked=!1;let r,n=!1,o;try{r=this._fn()}catch(s){n=!0,o=s,r=this._value}finally{E.consumer=e,E.untracked=t}let a=!this._initialized||this._threw!==n||(n?o!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=n,this._error=o,this._value=r,a){if(this.version++,this.observers)for(let s of[...this.observers])s.markDirty(Ie);rn(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===en;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(tn);rn(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function rn(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function Ci(e){return E.onSuspend?(E.onSuspend(e,E.owner),!0):!1}function ki(){return E.owner}function Oi(e,t){let r=E.owner;E.owner=e;try{return t()}finally{E.owner=r}}function Pi(e){E.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Ei(e){return!!e&&typeof e.then=="function"}Pi(()=>{});var $i=Symbol.for("signal"),_i=Symbol.for("memo");function ji(e,t,r){let n=t,o=ki(),a=new Ti(()=>Oi(o,()=>{try{return n=e(n)}catch(i){if(Ei(i))return Ci(i),n;throw i}}),{equals:r?.equals}),s=(()=>a.get());return Object.defineProperty(s,$i,{value:!0,enumerable:!0}),Object.defineProperty(s,_i,{value:!0,enumerable:!0}),s}function nn(e,t,r,n){return ji(()=>e().reduce(t,r),void 0,n)}function on(e){let t=e;for(;typeof t=="function";)t=t();return t}x();var Et=Symbol("store-raw"),sn=Symbol("store-node"),an=Symbol("store-has"),ln=Symbol("store-self"),un=Symbol("store-track");var cn=new WeakMap,fn=new WeakMap;function mn(e){let[t,r]=w(e),n=t;return n.$=r,n}function He(e){let t=cn.get(e);return t||cn.set(e,t={keys:new Map}),t}function pn(e,t,r){let n=e.keys.get(t);return n||e.keys.set(t,n=mn(r)),n}function dn(e){let t=He(e);(t.all||(t.all=mn()))()}function yn(e,t){e.$(typeof t=="function"?()=>t:t)}function gn(e){if(e==null||typeof e!="object")return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function qe(e){if(!gn(e))return e;let t=fn.get(e);if(t)return t;let r=new Proxy(e,Ri);return fn.set(e,r),r}var Ri={get(e,t,r){if(t===Et||t===sn)return e;if(t===Ct)return r;if(t===an)return s=>s in e;if(t==="__proxy")return!0;if(t===un||t===ln)return dn(e),r;let n=e[t];if(typeof n=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return n;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(r);let a=pn(He(e),t,n)();return gn(a)?qe(a):a},set(){return!0},deleteProperty(e,t){return t in e&&ge(e,t,void 0),!0},has(e,t){return t===Et||t===Ct||t===sn||t===an||t===ln||t===un?!0:(pn(He(e),t,e[t])(),t in e)},ownKeys(e){return dn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function ge(e,t,r){if(e[t]===r&&(r!==void 0||t in e))return;let n=Array.isArray(e),o=n?e.length:0;r===void 0?delete e[t]:e[t]=r;let a=He(e),s=a.keys.get(t);if(s&&yn(s,r),n&&e.length!==o){let i=a.keys.get("length");i&&yn(i,e.length)}a.all&&a.all.$(void 0)}function hn(e,t){return typeof e=="function"?e(t):e}function $t(e,t){for(let r of Object.keys(t)){let n=t[r],o=e[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?$t(o,n):ge(e,r,n)}}function jt(e){let t=[],r=e.replace(/\[([^\]]*)\]/g,".$1");for(let n of r.split("."))n.length&&t.push(n);return t}function vn(e,t,r){let n=t.length-1;for(let a=0;a<n;a++){let s=t[a];if(s==="*"){let l=t.slice(a+1);if(Array.isArray(e))for(let u=0;u<e.length;u++)vn(e[u],l,r);return}let i=e[s];(i==null||typeof i!="object")&&(i=/^\d+$/.test(t[a+1])?[]:{},ge(e,s,i)),e=i}let o=t[n];if(o==="*"){if(Array.isArray(e))for(let a=0;a<e.length;a++)ge(e,a,hn(r,e[a]));return}ge(e,o,hn(r,e[o]))}function Pt(e,t,r){vn(e,jt(t),r)}function Ni(e,t){let r=t[0];if(typeof r=="function"&&t.length===1){let n=r(e);n&&n!==e&&$t(e,n);return}if(Array.isArray(r)&&t.length===1){for(let n of r)Array.isArray(n)&&Pt(e,n[0],n[1]);return}if(r&&typeof r=="object"&&!Array.isArray(r)&&t.length===1){$t(e,r);return}if(Array.isArray(t[1])&&t.length>=3){Pt(e,`${r}.${t[1].join(".")}`,t[2]);return}Pt(e,String(r),t[1])}function _t(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(_t);let t={};for(let r of Object.keys(e))t[r]=_t(e[r]);return t}function ie(e,t){let r=e;for(let n of jt(t)){if(r==null)return;r=r[n]}return r}var We=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...r)=>_(()=>Ni(this.root,r)))}get state(){return qe(this.root)}get proxy(){return qe(this.root)}get accessor(){return(()=>qe(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return Fe(this.state);let t=this.state;for(let r of jt(e)){if(t==null)return;t=t[r]}return Fe(t)}select(e){return g(()=>e(this.state))}subscribe(e){return S(()=>e(this.state))}watch(e,t){let r;return S(()=>{let n=e(this.state);Object.is(n,r)||(t(n,r),r=n)})}reactive(e){return g(()=>this.state[e])}produce(e){this.set((t=>{let r=_t(t);return e(r),r}))}reconcile(e,t={}){this.set(e)}push(e,...t){let r=ie(this.root,e);this.set(e,r.concat(t))}pop(e){let t=ie(this.root,e).slice(),r=t.pop();return this.set(e,t),r}shift(e){let t=ie(this.root,e).slice(),r=t.shift();return this.set(e,t),r}splice(e,t,r,...n){let o=ie(this.root,e).slice(),a=o.splice(t,r,...n);return this.set(e,o),a}insert(e,t,r){let n=ie(this.root,e).slice();n.splice(t,0,r),this.set(e,n)}removeAt(e,t){let r=ie(this.root,e).slice(),n=r.splice(t,1);return this.set(e,r),n}toObservable(){let[e]=w(this.state);return e.toObservable()}dispose(){}},Mi=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Li(e,t){for(let r of Mi)e[r]=t[r].bind(t);e.$=t.reactive.bind(t)}function Rt(e,t={immutable:!0}){let r=new We(e,t);return Li(r.set,r),[r.proxy,r.set]}function Di(e,t={}){return new We(e,{...t,immutable:!1})}function Fe(e){if(e==null||typeof e!="object")return e;let t=e[Et];return t!==void 0?t:e}function Nt(e){return C(()=>Fe(e))}var Aa=Object.freeze({createStore:Rt,createMutableStore:Di,batch:_,unwrap:Fe,untrackStore:Nt});x();D();le();le();x();D();function to(e){return!!(e&&typeof e=="object"&&typeof e.then=="function"||e instanceof Promise)}var gs=q();function Ae(e){return X(vs,e)}function vs(e){let t=Zr(),r=H(gs),n=r?r.register(t.inFallback):void 0;function o(c){return c==null||typeof c=="boolean"?null:typeof c=="function"&&U(c)&&!P(c)?c():c}let a=Mn(()=>o(e.fallback??null)),s=Tt(t,()=>e.children);Tt(t,()=>{O(()=>{let c=s;if(Array.isArray(c))for(let f of c)typeof f=="function"&&P(f)&&f();else typeof c=="function"&&P(c)&&c()})});let[i,l]=w(void 0),u=to(s);return u&&(t.increment(),s.then(c=>{l(()=>c),t.decrement()},()=>t.decrement())),g(()=>(n?n.showFallback():t.inFallback())?a:u?i():s)}$n(Ae);Object.defineProperty(Ae,"__suspense",{value:!0,enumerable:!0});er();var tr=typeof window>"u";function ue(e,t,r={}){if(G("render"),Q(["click","input","change","submit"]),tr)throw new Error("render() is for client-side only. Use renderToString() on server.");if(!t)throw new Error("Container element is required");let n;return N(o=>{n=o;let a=typeof e=="function"?e():e;t.textContent="",t.setAttribute("fluixi-js","v1"),L(t,()=>a)}),()=>{n&&(n(),n=void 0)}}function bs(e){return e&&typeof e=="object"&&(e._$litType$!==void 0||e._$litDirective$!==void 0)}function ro(e,t,r={}){let n=document.createElement("div");n.setAttribute("data-portal","true"),t.appendChild(n);let o=ue(e,n,r);return()=>{o(),t.contains(n)&&t.removeChild(n)}}function no(e){return!!(e==null||typeof e=="function"||Xe(e)||bs(e)||Array.isArray(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean")}function oo(){tr||Q(["click","input","change","submit"])}function io(){}nr();x();D();var As="__fluixi_iso_states__",xs="__iso:";function Ss(){return globalThis[As]??=new Map}function Ts(e){if(typeof window>"u")return;let t=Bt();return t?t[xs+e]:void 0}function co(e,t){let r=Ts(e),n=r!==void 0?r:typeof window<"u"&&t.client?t.client():t.fallback,[o,a]=w(n);return Ss().set(e,{server:t.server,set:a}),{value:o,set:a,key:e}}D();D();D();D();D();x();var or=Symbol.for("fluixi.fragment"),fo=typeof window>"u";function po(e){return e==null||e===!1?null:Array.isArray(e)?e.map(po).flat():e}function ir(e,t,r){if(e==null)return null;let n=t||{};if(r!==void 0&&(n.key=r),e===or)return g(()=>Ge(po(n.children)));if(typeof e=="function"){let{type:o}=_n(e);return e.$$typeof===Symbol.for("react.provider")||o==="provider"?e(n):fo?{type:e,props:n}:g(()=>X(e,n),void 0,{name:"jsx component"})}return typeof e=="string"&&e.trim().length>0?Cs(e,n):null}var yo=ir;function Cs(e,t){return fo?{type:e,props:t||{}}:Wn(e,t)}le();var ho="0.0.1",mo="Fluixi";function ks(){return{name:mo,version:ho,features:{ssr:!0,hydration:!0,jsx:!0,litHtml:!0,signals:!0,fineGrained:!0,lazy:!0,hooks:!0,devMode:!0}}}G("index");D();lr();le();x();function ee(e){return typeof e=="function"?e():e}function Ps(e){if(typeof e=="string")return e;let t=[];return t.push(e.index===!1?"noindex":"index"),t.push(e.follow===!1?"nofollow":"follow"),e.noarchive&&t.push("noarchive"),e.nosnippet&&t.push("nosnippet"),e.noimageindex&&t.push("noimageindex"),e.maxSnippet!=null&&t.push(`max-snippet:${e.maxSnippet}`),e.maxImagePreview&&t.push(`max-image-preview:${e.maxImagePreview}`),e.maxVideoPreview!=null&&t.push(`max-video-preview:${e.maxVideoPreview}`),t.join(", ")}function ur(){let e=[],[t,r]=w(0);return{sources:e,version:t,push(n){return e.push(n),r(o=>o+1),()=>{let o=e.indexOf(n);o!==-1&&(e.splice(o,1),r(a=>a+1))}}}}var Es=null;function cr(e){Es=e}function ft(e){let t=5381;for(let r=0;r<e.length;r++)t=t*33^e.charCodeAt(r);return(t>>>0).toString(36)}function $s(e){return e.charset!=null?"meta:charset":e.property?"meta:property:"+e.property:e.name?"meta:name:"+e.name:e["http-equiv"]?"meta:http-equiv:"+e["http-equiv"]:"meta:"+ft(JSON.stringify(e))}function _s(e,t){let r=typeof t=="string"?{url:t}:t;e.push({tag:"meta",key:"meta:property:og:image:"+r.url,attrs:{property:"og:image",content:r.url}}),r.secureUrl&&e.push({tag:"meta",key:"meta:property:og:image:secure:"+r.url,attrs:{property:"og:image:secure_url",content:r.secureUrl}}),r.type&&e.push({tag:"meta",key:"meta:property:og:image:type:"+r.url,attrs:{property:"og:image:type",content:r.type}}),r.width!=null&&e.push({tag:"meta",key:"meta:property:og:image:width:"+r.url,attrs:{property:"og:image:width",content:String(r.width)}}),r.height!=null&&e.push({tag:"meta",key:"meta:property:og:image:height:"+r.url,attrs:{property:"og:image:height",content:String(r.height)}}),r.alt&&e.push({tag:"meta",key:"meta:property:og:image:alt:"+r.url,attrs:{property:"og:image:alt",content:r.alt}})}function js(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:property:og:"+n,attrs:{property:"og:"+n,content:o}})};r("title",e.title),r("description",e.description),r("type",e.type),r("url",e.url),r("site_name",e.siteName),r("locale",e.locale);for(let n of e.localeAlternate??[])t.push({tag:"meta",key:"meta:property:og:locale:alt:"+n,attrs:{property:"og:locale:alternate",content:n}});if(e.image!=null){let n=Array.isArray(e.image)?e.image:[e.image];for(let o of n)_s(t,o)}if(e.video){let n=typeof e.video=="string"?{url:e.video}:e.video;r("video",n.url),"type"in n&&n.type&&r("video:type",n.type),"width"in n&&n.width!=null&&r("video:width",String(n.width)),"height"in n&&n.height!=null&&r("video:height",String(n.height))}if(e.audio){let n=typeof e.audio=="string"?{url:e.audio}:e.audio;r("audio",n.url),"type"in n&&n.type&&r("audio:type",n.type)}if(e.article){let n=e.article;r("article:published_time",n.publishedTime),r("article:modified_time",n.modifiedTime),r("article:expiration_time",n.expirationTime),r("article:section",n.section);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:article:author:"+o,attrs:{property:"article:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:article:tag:"+o,attrs:{property:"article:tag",content:o}})}if(e.book){let n=e.book;r("book:isbn",n.isbn),r("book:release_date",n.releaseDate);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:book:author:"+o,attrs:{property:"book:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:book:tag:"+o,attrs:{property:"book:tag",content:o}})}if(e.profile){let n=e.profile;r("profile:first_name",n.firstName),r("profile:last_name",n.lastName),r("profile:username",n.username),r("profile:gender",n.gender)}}function Rs(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:name:twitter:"+n,attrs:{name:"twitter:"+n,content:o}})};r("card",e.card),r("site",e.site),r("creator",e.creator),r("title",e.title),r("description",e.description),r("image",e.image),r("image:alt",e.imageAlt),r("player",e.player),e.playerWidth!=null&&r("player:width",String(e.playerWidth)),e.playerHeight!=null&&r("player:height",String(e.playerHeight)),e.app&&(r("app:name:iphone",e.app.name),r("app:id:iphone",e.app.idIphone),r("app:id:ipad",e.app.idIpad),r("app:id:googleplay",e.app.idGooglePlay))}function Ns(e,t){let r=(n,o)=>t.push({tag:"link",key:n,attrs:o});if(e.icon!=null){let n=typeof e.icon=="string"?[{url:e.icon}]:e.icon;for(let o of n)r("link:icon:"+o.url,{rel:"icon",href:o.url,...o.type?{type:o.type}:{},...o.sizes?{sizes:o.sizes}:{}})}if(e.apple!=null){let n=typeof e.apple=="string"?[{url:e.apple}]:e.apple;for(let o of n)r("link:apple-touch-icon:"+o.url,{rel:"apple-touch-icon",href:o.url,...o.sizes?{sizes:o.sizes}:{}})}e.mask&&r("link:mask-icon",{rel:"mask-icon",href:e.mask.url,...e.mask.color?{color:e.mask.color}:{}}),e.shortcut&&r("link:shortcut",{rel:"shortcut icon",href:e.shortcut}),e.msTileImage&&t.push({tag:"meta",key:"meta:name:msapplication-TileImage",attrs:{name:"msapplication-TileImage",content:e.msTileImage}}),e.msTileColor&&t.push({tag:"meta",key:"meta:name:msapplication-TileColor",attrs:{name:"msapplication-TileColor",content:e.msTileColor}})}function Ms(e,t,r){let n=(f,p)=>t.push({tag:"meta",key:f,attrs:p}),o=ee(e.title);o!==void 0&&(r.title=o),e.titleTemplate!==void 0&&(r.template=e.titleTemplate);let a=ee(e.lang);a!==void 0&&t.push({tag:"htmlAttr",key:"html:lang",name:"lang",value:a}),e.charset!==void 0&&n("meta:charset",{charset:e.charset}),e.viewport!==void 0&&n("meta:name:viewport",{name:"viewport",content:e.viewport});let s=ee(e.description);s!==void 0&&n("meta:name:description",{name:"description",content:s});let i=ee(e.keywords);i!==void 0&&n("meta:name:keywords",{name:"keywords",content:Array.isArray(i)?i.join(", "):i}),e.author!==void 0&&n("meta:name:author",{name:"author",content:e.author}),e.robots!==void 0&&n("meta:name:robots",{name:"robots",content:Ps(e.robots)}),e.generator!==void 0&&n("meta:name:generator",{name:"generator",content:e.generator}),e.applicationName!==void 0&&n("meta:name:application-name",{name:"application-name",content:e.applicationName}),e.referrer!==void 0&&n("meta:name:referrer",{name:"referrer",content:e.referrer}),e.colorScheme!==void 0&&n("meta:name:color-scheme",{name:"color-scheme",content:e.colorScheme});let l=ee(e.themeColor);l!==void 0&&n("meta:name:theme-color",{name:"theme-color",content:l});let u=ee(e.canonical);if(u!==void 0&&t.push({tag:"link",key:"link:rel:canonical",attrs:{rel:"canonical",href:u}}),e.manifest!==void 0&&t.push({tag:"link",key:"link:rel:manifest",attrs:{rel:"manifest",href:e.manifest}}),e.base!==void 0&&t.push({tag:"base",key:"base",attrs:{href:e.base}}),e.verification){let f={google:"google-site-verification",bing:"msvalidate.01",yandex:"yandex-verification",pinterest:"p:domain_verify"};for(let[p,y]of Object.entries(e.verification)){if(y==null)continue;let d=f[p]??p;n("meta:name:"+d,{name:d,content:y})}}for(let f of e.alternates??[])t.push({tag:"link",key:"link:alternate:hreflang:"+f.hreflang,attrs:{rel:"alternate",hreflang:f.hreflang,href:f.href}});for(let f of e.feeds??[])t.push({tag:"link",key:"link:alternate:feed:"+f.href,attrs:{rel:"alternate",type:f.type??"application/rss+xml",href:f.href,...f.title?{title:f.title}:{}}});e.og&&js(e.og,t),e.twitter&&Rs(e.twitter,t),e.icons&&Ns(e.icons,t);let c=ee(e.jsonLd);if(c!==void 0){let f=Array.isArray(c)?c:[c];for(let p of f){let y=JSON.stringify(p);t.push({tag:"script",key:"script:ldjson:"+ft(y),attrs:{type:"application/ld+json"},children:y})}}for(let f of e.meta??[]){let p={};for(let[y,d]of Object.entries(f))d!=null&&(p[y==="httpEquiv"?"http-equiv":y]=d);t.push({tag:"meta",key:$s(p),attrs:p})}for(let f of e.link??[]){let p={};for(let[y,d]of Object.entries(f))d!=null&&(p[y]=d);t.push({tag:"link",key:"link:"+(p.rel??"")+":"+(p.href??ft(JSON.stringify(p))),attrs:p})}for(let f of e.script??[]){let p={},y;for(let[d,h]of Object.entries(f))h!=null&&(d==="children"?y=h:p[d]=h);t.push({tag:"script",key:"script:"+(p.src??ft((y??"")+JSON.stringify(p))),attrs:p,children:y})}}function Ls(e,t){return typeof e=="function"?e(t):e.includes("%s")?e.replace("%s",t):e}function pt(e){let t=[],r={};for(let a of e.sources){let s=typeof a=="function"?a():a;Ms(s,t,r)}r.title!==void 0&&t.push({tag:"title",key:"title",children:r.template?Ls(r.template,r.title):r.title});let n=new Map,o={};for(let a of t){if(a.tag==="htmlAttr"){o[a.name]=a.value;continue}n.set(a.key,a)}return{tags:[...n.values()],htmlAttrs:o}}var Se="data-fh",Te="data-fh-key";function fr(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===8&&t.data.startsWith("fh:")){t.parentNode?.removeChild(t);return}}x();function So(e,t){for(let r of Array.from(e.attributes))r.name===Se||r.name===Te||r.name in t||e.removeAttribute(r.name);for(let[r,n]of Object.entries(t))e.getAttribute(r)!==n&&e.setAttribute(r,n)}function Ds(e){let t=document.createElement(e.tag);return So(t,e.attrs),t.setAttribute(Se,""),t.setAttribute(Te,e.key),e.tag==="script"&&e.children!=null&&(t.textContent=e.children),t}function Is(e,t){let r=document.head,n=new Map;for(let s of Array.from(r.querySelectorAll(`[${Se}]`))){let i=s.getAttribute(Te);s.tagName!=="TITLE"&&i&&n.set(i,s)}let o=null,a=new Set;for(let s of e){if(s.tag==="title"){o=s.children;continue}if(s.tag==="htmlAttr")continue;a.add(s.key);let i=n.get(s.key);i&&i.tagName===s.tag.toUpperCase()?(So(i,s.attrs),s.tag==="script"&&(i.textContent??"")!==(s.children??"")&&(i.textContent=s.children??"")):(i&&i.remove(),r.appendChild(Ds(s)))}for(let[s,i]of n)a.has(s)||i.remove();o!=null&&document.title!==o&&(document.title=o);for(let[s,i]of Object.entries(t))document.documentElement.getAttribute(s)!==i&&document.documentElement.setAttribute(s,i)}function pr(e){return N(t=>(S(()=>{e.version();let{tags:r,htmlAttrs:n}=pt(e);Is(r,n)}),A(()=>{}),t))}G("client index");function Ho(e,t){if(!t)throw new Error("Container element not found for mount()");Ut(()=>e(),t)}async function Fo(e,t={}){let r=typeof t.root=="string"?document.querySelector(t.root):t.root??document.querySelector("#app");if(!r)throw new Error(`[Fluixi] Mount container not found: ${t.root??"#app"}`);let n=!!document.getElementById("__FLUIXI_HYDRATION__")||!!t.routes&&r.firstElementChild!=null,o=t.hydrate??n,a=ur();if(cr(a),fr(r),o){if(t.routes&&t.routes.length){let{preloadRoutes:s}=await Promise.resolve().then(()=>(Pr(),qo));await s(t.routes,window.location.pathname)}Ao(),sr(!0),Qe(()=>e(),r),aa(),setTimeout(()=>{sr(!1),ar()},100)}else ue(()=>e(),r);pr(a)}function aa(){if(typeof window>"u")return;let e=window;typeof e.__FX_REPLAY_STOP__=="function"&&e.__FX_REPLAY_STOP__();let t=e.__FX_REPLAY__;if(e.__FX_REPLAY__=void 0,e.__FX_REPLAY_STOP__=void 0,!(!Array.isArray(t)||t.length===0))for(let r of t){let n=r&&r.target;if(!n||n.isConnected===!1||typeof n.dispatchEvent!="function")continue;let o=r.type,a=o==="click"?new MouseEvent(o,{bubbles:!0,cancelable:!0}):new Event(o,{bubbles:!0,cancelable:!0});n.dispatchEvent(a)}}Pr();return Ko(la);})();
@@ -1 +1 @@
1
- import{b as f,e as y,f as m,h as c}from"./chunk-45GBRHE6.mjs";import{render as D,hydrate as $}from"@fluixi/dom";import{createRoot as O}from"@fluixi/reactive/signal";import{isDOMNode as Ce,delegateEvents as H,insert as M}from"@fluixi/dom";import{createSignal as E,createMemo as k,createEffect as B,createRenderEffect as P,isSignal as l,useContext as x,createContext as C,createSuspenseBoundary as g,provideSuspense as b}from"@fluixi/reactive/signal";import{asSuspense as L,isComponent as A,createComponent as T,runWithoutHydration as R}from"@fluixi/dom";function h(t){return!!(t&&typeof t=="object"&&typeof t.then=="function"||t instanceof Promise)}var F=C();function p(t){return T(v,t)}function v(t){let e=g(),r=x(F),o=r?r.register(e.inFallback):void 0;function s(n){return n==null||typeof n=="boolean"?null:typeof n=="function"&&A(n)&&!l(n)?n():n}let i=R(()=>s(t.fallback??null)),a=b(e,()=>t.children);b(e,()=>{P(()=>{let n=a;if(Array.isArray(n))for(let u of n)typeof u=="function"&&l(u)&&u();else typeof n=="function"&&l(n)&&n()})});let[S,_]=E(void 0),d=h(a);return d&&(e.increment(),a.then(n=>{_(()=>n),e.decrement()},()=>e.decrement())),k(()=>(o?o.showFallback():e.inFallback())?i:d?S():a)}L(p);Object.defineProperty(p,"__suspense",{value:!0,enumerable:!0});import{createResource as V}from"@fluixi/reactive/signal";var j=typeof window>"u";function w(t,e,r={}){if(c("render"),H(["click","input","change","submit"]),j)throw new Error("render() is for client-side only. Use renderToString() on server.");if(!e)throw new Error("Container element is required");let o;return O(s=>{o=s;let i=typeof t=="function"?t():t;e.textContent="",e.setAttribute("fluixi-js","v1"),M(e,()=>i)}),()=>{o&&(o(),o=void 0)}}import{createHead as I,setActiveHead as N,mountHead as X,stripHeadMarker as Y}from"@fluixi/head";import{hydrate as Xe}from"@fluixi/dom";c("client index");function De(t,e){if(!e)throw new Error("Container element not found for mount()");D(()=>t(),e)}async function $e(t,e={}){let r=typeof e.root=="string"?document.querySelector(e.root):e.root??document.querySelector("#app");if(!r)throw new Error(`[Fluixi] Mount container not found: ${e.root??"#app"}`);let o=!!document.getElementById("__FLUIXI_HYDRATION__")||!!e.routes&&r.firstElementChild!=null,s=e.hydrate??o,i=I();if(N(i),Y(r),s){if(e.routes&&e.routes.length){let{preloadRoutes:a}=await import("./router-next-DZMNYSCE.mjs");await a(e.routes,window.location.pathname)}y(),f(!0),$(()=>t(),r),z(),setTimeout(()=>{f(!1),m()},100)}else w(()=>t(),r);X(i)}function z(){if(typeof window>"u")return;let t=window;typeof t.__FX_REPLAY_STOP__=="function"&&t.__FX_REPLAY_STOP__();let e=t.__FX_REPLAY__;if(t.__FX_REPLAY__=void 0,t.__FX_REPLAY_STOP__=void 0,!(!Array.isArray(e)||e.length===0))for(let r of e){let o=r&&r.target;if(!o||o.isConnected===!1||typeof o.dispatchEvent!="function")continue;let s=r.type,i=s==="click"?new MouseEvent(s,{bubbles:!0,cancelable:!0}):new Event(s,{bubbles:!0,cancelable:!0});o.dispatchEvent(i)}}export{Xe as hydrate,De as mount,$e as startClient};
1
+ import{b as f,e as y,f as m,h as c}from"./chunk-45GBRHE6.mjs";import{render as D,hydrate as $}from"@fluixi/dom";import{createRoot as O}from"@fluixi/reactive/signal";import{isDOMNode as Ce,delegateEvents as H,insert as M}from"@fluixi/dom";import{createSignal as E,createMemo as k,createEffect as B,createRenderEffect as P,isSignal as l,useContext as x,createContext as C,createSuspenseBoundary as g,provideSuspense as b}from"@fluixi/reactive/signal";import{asSuspense as L,isComponent as A,createComponent as T,runWithoutHydration as R}from"@fluixi/dom";function h(t){return!!(t&&typeof t=="object"&&typeof t.then=="function"||t instanceof Promise)}var F=C();function p(t){return T(v,t)}function v(t){let e=g(),r=x(F),o=r?r.register(e.inFallback):void 0;function s(n){return n==null||typeof n=="boolean"?null:typeof n=="function"&&A(n)&&!l(n)?n():n}let i=R(()=>s(t.fallback??null)),a=b(e,()=>t.children);b(e,()=>{P(()=>{let n=a;if(Array.isArray(n))for(let u of n)typeof u=="function"&&l(u)&&u();else typeof n=="function"&&l(n)&&n()})});let[S,_]=E(void 0),d=h(a);return d&&(e.increment(),a.then(n=>{_(()=>n),e.decrement()},()=>e.decrement())),k(()=>(o?o.showFallback():e.inFallback())?i:d?S():a)}L(p);Object.defineProperty(p,"__suspense",{value:!0,enumerable:!0});import{createResource as V}from"@fluixi/reactive/signal";var j=typeof window>"u";function w(t,e,r={}){if(c("render"),H(["click","input","change","submit"]),j)throw new Error("render() is for client-side only. Use renderToString() on server.");if(!e)throw new Error("Container element is required");let o;return O(s=>{o=s;let i=typeof t=="function"?t():t;e.textContent="",e.setAttribute("fluixi-js","v1"),M(e,()=>i)}),()=>{o&&(o(),o=void 0)}}import{createHead as I,setActiveHead as N,mountHead as X,stripHeadMarker as Y}from"@fluixi/head";import{hydrate as Xe}from"@fluixi/dom";c("client index");function De(t,e){if(!e)throw new Error("Container element not found for mount()");D(()=>t(),e)}async function $e(t,e={}){let r=typeof e.root=="string"?document.querySelector(e.root):e.root??document.querySelector("#app");if(!r)throw new Error(`[Fluixi] Mount container not found: ${e.root??"#app"}`);let o=!!document.getElementById("__FLUIXI_HYDRATION__")||!!e.routes&&r.firstElementChild!=null,s=e.hydrate??o,i=I();if(N(i),Y(r),s){if(e.routes&&e.routes.length){let{preloadRoutes:a}=await import("./router-next-VUFOX54P.mjs");await a(e.routes,window.location.pathname)}y(),f(!0),$(()=>t(),r),z(),setTimeout(()=>{f(!1),m()},100)}else w(()=>t(),r);X(i)}function z(){if(typeof window>"u")return;let t=window;typeof t.__FX_REPLAY_STOP__=="function"&&t.__FX_REPLAY_STOP__();let e=t.__FX_REPLAY__;if(t.__FX_REPLAY__=void 0,t.__FX_REPLAY_STOP__=void 0,!(!Array.isArray(e)||e.length===0))for(let r of e){let o=r&&r.target;if(!o||o.isConnected===!1||typeof o.dispatchEvent!="function")continue;let s=r.type,i=s==="click"?new MouseEvent(s,{bubbles:!0,cancelable:!0}):new Event(s,{bubbles:!0,cancelable:!0});o.dispatchEvent(i)}}export{Xe as hydrate,De as mount,$e as startClient};
@@ -1 +1 @@
1
- import{a as w,c as O,d as L,g as D,h as k,i as z}from"./chunk-45GBRHE6.mjs";import{createSignal as P,createMemo as d,createResource as re,createEffect as A,getOwner as oe,onCleanup as b,untrack as R}from"@fluixi/reactive/signal";import{insert as x,createComponent as F,createNativeElement as g,setAttribute as u}from"@fluixi/dom";import{createContext as T,useContext as y}from"@fluixi/reactive/signal";import{get as ae}from"@fluixi/utils/object";import{deepEqual as se}from"@fluixi/utils/compare";import{createRouter as ie,createBrowserHistory as ce,matchRoutes as ue,matchPath as de}from"@fluixi/router";import{createMemoryHistory as nt,createBrowserHistory as rt,matchRoutes as ot,matchPath as at}from"@fluixi/router";import{createResource as W,createSignal as M}from"@fluixi/reactive/signal";import{asProvider as B}from"@fluixi/dom";import{createContext as J,useContext as ve}from"@fluixi/reactive/signal";import{readChildren as Ae}from"@fluixi/reactive/signal";k("index");function N(e){let n=J(e),t=o=>(o.debug,n.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(t.$$typeof=Symbol.for("react.provider")),t.$$typeof=Symbol.for("react.provider"),{id:n.id,Provider:B(t),defaultValue:e}}var m=new Map,p=new Map;function G(e,n){return async(...t)=>{let o=n+":"+JSON.stringify(t);if(w()||typeof window<"u"){let a=L(o);if(a!==void 0)return a}if(m.has(o))return m.get(o);if(p.has(o))return p.get(o);let r=Promise.resolve(e(...t)).then(a=>(m.set(o,a),p.delete(o),D()&&O(o,a),a),a=>{throw p.delete(o),a});return p.set(o,r),r}}var[Ne,X]=M(0),Q=new Set;function Y(e){let n=typeof e=="string"?t=>t.startsWith(e):e;for(let t of m.keys())n(t)&&(m.delete(t),Q.add(t));X(t=>t+1)}function Z(e,n){let[t]=W(n||(()=>!0),e);return t}var C=new Map;function V(e){return C.has(e)||C.set(e,M(void 0)),C.get(e)}function E(e,n){let t=n||e.name||"action",o=async r=>{let[,a]=V(t),s=()=>a(void 0),i=()=>o(r);a({input:r,pending:!0,clear:s,retry:i});try{let c=await e(r);return a({input:r,result:c,pending:!1,clear:s,retry:i}),c}catch(c){throw a({input:r,error:c,pending:!1,clear:s,retry:i}),c}};return o.url=t,o.with=r=>E((...a)=>e(r,...a),n),o}function ee(e){let[n]=V(e.url);return n}function te(e){return e}var ne=N(),Me=ne.Provider;import{runWithOwner as ut}from"@fluixi/reactive/signal";var v=T(),K=T(),U=T(),j=T();function le(e,n,t){let o,r=e.route.data;if(typeof r=="function"){let h=!1;b(()=>{h=!0});let I=oe(),[$]=re(()=>r({params:t.params,location:t.location},I,()=>h));o=$}let a=()=>j.Provider({value:o,get children(){return U.Provider({value:e.params,get children(){return K.Provider({value:{depth:n,...t},get children(){return F(e.component,{})}})}})}});if(!o)return a();let s=o,i=()=>s.loading,[c,l]=P(R(()=>!i()));return A(()=>l(!i())),d(()=>c()?a():null)}function H(e){let n=e.depth+1,[t,o]=P(R(()=>e.matched()[n]?.component));return A(()=>{let r=e.matched()[n]?.component;o(()=>r)}),d(()=>{if(!t())return e.notFound?e.notFound():null;let a=R(()=>e.matched())[n];return le(a,n,{matched:e.matched,params:e.params,location:e.location})})}function fe(e){return e==null?ye():typeof e=="function"?F(e,{}):e}function ye(){let e=g("div");u(e,"class","fx-not-found"),u(e,"role","main"),u(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let n=g("h1");u(n,"style","margin:0;font-size:2.5rem;font-weight:700"),x(n,"404");let t=g("p");return u(t,"style","margin:0;opacity:.7"),x(t,"This page could not be found."),e.appendChild(n),e.appendChild(t),e}function _e(e){let n=e.history??ce(),t=ie({routes:e.routes,base:e.base,history:n}),[o,r]=P(t.state()),a=t.subscribe(r);b(()=>{a(),t.destroy()});let s=d(()=>(o().match?.matched??[]).filter(h=>h.component)),i={router:t,location:d(()=>o().location),params:d(()=>o().match?.params??{})},c={depth:-1,matched:s,params:i.params,location:i.location,notFound:()=>fe(e.notFound)},l;return v.Provider({value:i,get children(){return l??=H(c)}})}function qe(){let e=y(K);return e?H(e):null}function Ie(e){let n=y(v);if(!n||typeof window>"u")return null;let t=!1;return b(()=>t=!0),queueMicrotask(()=>{t||n.router.navigate(e.to,{replace:e.replace!==!1})}),null}var pe={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};function S(){let e=y(v);if(e)return e;if(typeof window>"u")return pe;throw new Error("[router-next] useRouter must be used within <Router>")}function _(){let e=S().params;return d(()=>e(),{},{equals:(n,t)=>JSON.stringify(n)===JSON.stringify(t)})}function $e(){return y(U)??{}}function ze(e){let n=_();return d(()=>n()[e])}function Be(e,n){let t=_();return d(()=>e(t()),void 0,n?{equals:n}:void 0)}function Je(e){let n=q();return d(()=>de(typeof e=="function"?e():e,n.pathname))}function We(){let e=q(),n=me();return[d(()=>e.query),(r,a)=>{let s=new URLSearchParams(e.search);for(let[c,l]of Object.entries(r))l===null?s.delete(c):s.set(c,l);let i=s.toString();n(e.pathname+(i?`?${i}`:""),a)}]}function Ge(e,n){let t=(o,r)=>se(o,r);return n!==void 0?d(()=>ae(e(),n),void 0,{equals:t}):d(e,void 0,{equals:t})}function q(){let{location:e}=S();return new Proxy({},{get:(n,t)=>e()[t],has:(n,t)=>t in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(n,t)=>Object.getOwnPropertyDescriptor(e(),t)})}function me(){let{router:e}=S();return(n,t)=>e.navigate(n,t)}function Xe(){return y(j)??(()=>{})}var f=e=>typeof e=="function"?e():e,ge=new Set(["href","slot","class","className","active","activeClass","replace","children"]);function he(e){let n=y(v),t=typeof document>"u",o=()=>n?.router.navigate(f(e.href)??"",{replace:f(e.replace)}),r=g("a");u(r,"href",f(e.href)??""),e.slot&&u(r,"slot",f(e.slot));for(let[s,i]of Object.entries(e))ge.has(s)||i!=null&&typeof i!="function"&&u(r,s,String(i));if(typeof r.addEventListener=="function")r.addEventListener("click",s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),o())});else{let s=f(e.className??e.class)??"";s&&u(r,"class",s)}typeof r.addEventListener=="function"&&A(()=>{let s=f(e.href)??"";r.setAttribute("href",s);let i=f(e.className??e.class)??"",c=f(e.activeClass)??"",l=f(e.active)??n?.location().pathname===s;r.className=[i,l?c:""].filter(Boolean).join(" ")});let a=e.children;return a!=null&&x(r,a),r}var Qe=he;function Ye(e){let n=e.action,t=e.className??e.class,o=n.url??"",r=g("form");u(r,"method","post"),o&&u(r,"action",o),t&&u(r,"class",t);for(let[s,i]of Object.entries(e))s==="action"||s==="children"||s==="class"||s==="className"||i!=null&&typeof i!="function"&&u(r,s,String(i));typeof r.addEventListener=="function"&&r.addEventListener("submit",s=>{s.preventDefault();let i={};new FormData(r).forEach((c,l)=>{i[l]=c}),Promise.resolve(n(i)).catch(()=>{})});let a=e.children;return a!=null&&x(r,a),r}async function Ze(e,n){let t=ue(e,n);if(!t)return;let o=[];for(let r of t.matched){let a=r.component;a&&typeof a.preload=="function"&&o.push(a.preload())}await Promise.all(o)}export{Qe as A,Ye as Form,he as Link,qe as Outlet,Ie as Redirect,_e as Router,E as action,G as cache,Z as createAsync,rt as createBrowserHistory,nt as createMemoryHistory,z as lazy,at as matchPath,ot as matchRoutes,Ze as preloadRoutes,Y as revalidate,ut as runWithOwner,Ge as select,te as useAction,$e as useLevelParams,q as useLocation,Je as useMatch,me as useNavigate,ze as useParam,Be as useParamSelector,_ as useParams,Xe as useRouteData,S as useRouter,We as useSearchParams,ee as useSubmission};
1
+ import{a as w,c as O,d as L,g as D,h as k,i as z}from"./chunk-45GBRHE6.mjs";import{createSignal as P,createMemo as d,createResource as re,createEffect as A,getOwner as oe,onCleanup as b,untrack as R}from"@fluixi/reactive/signal";import{insert as x,createComponent as F,createNativeElement as g,setAttribute as u}from"@fluixi/dom";import{createContext as v,useContext as y}from"@fluixi/reactive/signal";import{get as ae}from"@fluixi/utils/object";import{deepEqual as se}from"@fluixi/utils/compare";import{createRouter as ie,createBrowserHistory as ce,matchRoutes as ue,matchPath as de}from"@fluixi/router";import{createMemoryHistory as nt,createBrowserHistory as rt,matchRoutes as ot,matchPath as at}from"@fluixi/router";import{createResource as W,createSignal as M}from"@fluixi/reactive/signal";import{asProvider as B}from"@fluixi/dom";import{createContext as J,useContext as Te}from"@fluixi/reactive/signal";import{readChildren as Ae}from"@fluixi/reactive/signal";k("index");function N(e){let n=J(e),t=o=>(o.debug,n.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(t.$$typeof=Symbol.for("react.provider")),t.$$typeof=Symbol.for("react.provider"),{id:n.id,Provider:B(t),defaultValue:e}}var m=new Map,p=new Map;function G(e,n){return async(...t)=>{let o=n+":"+JSON.stringify(t);if(w()||typeof window<"u"){let a=L(o);if(a!==void 0)return a}if(m.has(o))return m.get(o);if(p.has(o))return p.get(o);let r=Promise.resolve(e(...t)).then(a=>(m.set(o,a),p.delete(o),D()&&O(o,a),a),a=>{throw p.delete(o),a});return p.set(o,r),r}}var[Ne,X]=M(0),Q=new Set;function Y(e){let n=typeof e=="string"?t=>t.startsWith(e):e;for(let t of m.keys())n(t)&&(m.delete(t),Q.add(t));X(t=>t+1)}function Z(e,n){let[t]=W(n||(()=>!0),e);return t}var C=new Map;function V(e){return C.has(e)||C.set(e,M(void 0)),C.get(e)}function E(e,n){let t=n||e.name||"action",o=async r=>{let[,a]=V(t),s=()=>a(void 0),i=()=>o(r);a({input:r,pending:!0,clear:s,retry:i});try{let c=await e(r);return a({input:r,result:c,pending:!1,clear:s,retry:i}),c}catch(c){throw a({input:r,error:c,pending:!1,clear:s,retry:i}),c}};return o.url=t,o.with=r=>E((...a)=>e(r,...a),n),o}function ee(e){let[n]=V(e.url);return n}function te(e){return e}var ne=N(),Me=ne.Provider;import{runWithOwner as ut}from"@fluixi/reactive/signal";var T=v(),K=v(),U=v(),j=v();function le(e,n,t){let o,r=e.route.data;if(typeof r=="function"){let h=!1;b(()=>{h=!0});let I=oe(),[$]=re(()=>r({params:t.params,location:t.location},I,()=>h));o=$}let a=()=>j.Provider({value:o,get children(){return U.Provider({value:e.params,get children(){return K.Provider({value:{depth:n,...t},get children(){return F(e.component,{})}})}})}});if(!o)return a();let s=o,i=()=>s.loading,[c,l]=P(R(()=>!i()));return A(()=>l(!i())),d(()=>c()?a():null)}function H(e){let n=e.depth+1,[t,o]=P(R(()=>e.matched()[n]?.component));return A(()=>{let r=e.matched()[n]?.component;o(()=>r)}),d(()=>{if(!t())return e.notFound?e.notFound():null;let a=R(()=>e.matched())[n];return le(a,n,{matched:e.matched,params:e.params,location:e.location})})}function fe(e){return e==null?ye():typeof e=="function"?F(e,{}):e}function ye(){let e=g("div");u(e,"class","fx-not-found"),u(e,"role","main"),u(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let n=g("h1");u(n,"style","margin:0;font-size:2.5rem;font-weight:700"),x(n,"404");let t=g("p");return u(t,"style","margin:0;opacity:.7"),x(t,"This page could not be found."),e.appendChild(n),e.appendChild(t),e}function _e(e){let n=e.history??ce(),t=ie({routes:e.routes,base:e.base,history:n}),[o,r]=P(t.state()),a=t.subscribe(r);b(()=>{a(),t.destroy()});let s=d(()=>(o().match?.matched??[]).filter(h=>h.component)),i={router:t,location:d(()=>o().location),params:d(()=>o().match?.params??{})},c={depth:-1,matched:s,params:i.params,location:i.location,notFound:()=>fe(e.notFound)},l;return T.Provider({value:i,get children(){return l??=H(c)}})}function qe(){let e=y(K);return e?H(e):null}function Ie(e){let n=y(T);if(!n||typeof window>"u")return null;let t=!1;return b(()=>t=!0),queueMicrotask(()=>{t||n.router.navigate(e.to,{replace:e.replace!==!1})}),null}var pe={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};function S(){let e=y(T);if(e)return e;if(typeof window>"u")return pe;throw new Error("[router-next] useRouter must be used within <Router>")}function _(){let e=S().params;return d(()=>e(),{},{equals:(n,t)=>JSON.stringify(n)===JSON.stringify(t)})}function $e(){return y(U)??{}}function ze(e){let n=_();return d(()=>n()[e])}function Be(e,n){let t=_();return d(()=>e(t()),void 0,n?{equals:n}:void 0)}function Je(e){let n=q();return d(()=>de(typeof e=="function"?e():e,n.pathname))}function We(){let e=q(),n=me();return[d(()=>e.query),(r,a)=>{let s=new URLSearchParams(e.search);for(let[c,l]of Object.entries(r))l===null?s.delete(c):s.set(c,l);let i=s.toString();n(e.pathname+(i?`?${i}`:""),a)}]}function Ge(e,n){let t=(o,r)=>se(o,r);return n!==void 0?d(()=>ae(e(),n),void 0,{equals:t}):d(e,void 0,{equals:t})}function q(){let{location:e}=S();return new Proxy({},{get:(n,t)=>e()[t],has:(n,t)=>t in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(n,t)=>Object.getOwnPropertyDescriptor(e(),t)})}function me(){let{router:e}=S();return(n,t)=>e.navigate(n,t)}function Xe(){return y(j)??(()=>{})}var f=e=>typeof e=="function"?e():e,ge=new Set(["href","slot","class","className","active","activeClass","replace","children"]);function he(e){let n=y(T),t=typeof document>"u",o=()=>n?.router.navigate(f(e.href)??"",{replace:f(e.replace)}),r=g("a");u(r,"href",f(e.href)??""),e.slot&&u(r,"slot",f(e.slot));for(let[s,i]of Object.entries(e))ge.has(s)||i!=null&&typeof i!="function"&&u(r,s,String(i));if(typeof r.addEventListener=="function")r.addEventListener("click",s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),o())});else{let s=f(e.className??e.class)??"";s&&u(r,"class",s)}typeof r.addEventListener=="function"&&A(()=>{let s=f(e.href)??"";r.setAttribute("href",s);let i=f(e.className??e.class)??"",c=f(e.activeClass)??"",l=f(e.active)??n?.location().pathname===s;r.className=[i,l?c:""].filter(Boolean).join(" ")});let a=e.children;return a!=null&&x(r,a),r}var Qe=he;function Ye(e){let n=e.action,t=e.className??e.class,o=n.url??"",r=g("form");u(r,"method","post"),o&&u(r,"action",o),t&&u(r,"class",t);for(let[s,i]of Object.entries(e))s==="action"||s==="children"||s==="class"||s==="className"||i!=null&&typeof i!="function"&&u(r,s,String(i));typeof r.addEventListener=="function"&&r.addEventListener("submit",s=>{s.preventDefault();let i={};new FormData(r).forEach((c,l)=>{i[l]=c}),Promise.resolve(n(i)).catch(()=>{})});let a=e.children;return a!=null&&x(r,a),r}async function Ze(e,n){let t=ue(e,n);if(!t)return;let o=[];for(let r of t.matched){let a=r.component;a&&typeof a.preload=="function"&&o.push(a.preload())}await Promise.all(o)}export{Qe as A,Ye as Form,he as Link,qe as Outlet,Ie as Redirect,_e as Router,E as action,G as cache,Z as createAsync,rt as createBrowserHistory,nt as createMemoryHistory,z as lazy,at as matchPath,ot as matchRoutes,Ze as preloadRoutes,Y as revalidate,ut as runWithOwner,Ge as select,te as useAction,$e as useLevelParams,q as useLocation,Je as useMatch,me as useNavigate,ze as useParam,Be as useParamSelector,_ as useParams,Xe as useRouteData,S as useRouter,We as useSearchParams,ee as useSubmission};
@@ -1 +1 @@
1
- "use strict";var u=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var E=(e,n)=>{for(var t in n)u(e,t,{get:n[t],enumerable:!0})},S=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of b(n))!P.call(e,i)&&i!==t&&u(e,i,{get:()=>n[i],enumerable:!(o=g(n,i))||o.enumerable});return e};var O=e=>S(u({},"__esModule",{value:!0}),e);var V={};E(V,{composeProviders:()=>y,createConsumer:()=>k,createContext:()=>C,createContextWithProvider:()=>A,createProvider:()=>d,useContext:()=>l,useProvide:()=>U});module.exports=O(V);var v=require("@fluixi/dom"),a=require("@fluixi/reactive/signal"),x=require("@fluixi/reactive/signal");var c=require("@fluixi/dom"),r=require("@fluixi/reactive/signal");function f(e){(0,c.registerCreateComponent)(w)}function w(e,n){return R(e,n)}function R(e,n){let t=typeof e=="function"?(0,r.untrack)(()=>e(n)):e;if(t!=null&&(typeof t=="function"||typeof t=="object")&&!(0,r.isSignal)(t)){try{t.$name=e.name}catch{}return(0,c.asComponent)(t)}return t}f("index");var p=!1;function L(){p||(p=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function d(e,n,t){let o=!!e?.Provider,i=o?e:e.context,s=o?n:e.value,T=o?!1:e.debug??!1;o||L();let m=typeof s=="function"?s():s,h=o?t:e;return i.Provider({value:m,get children(){return h?.children},debug:T})}function A(e){let n=C(e);return[n,o=>d(n,o.value,o)]}function y(e,n){if(e.length===0)return(0,x.readChildren)(()=>n);let[t,o]=e[0],i=e.slice(1);return d(t,o,{get children(){return y(i,n)}})}function k(e){return n=>{let t=l(e);return n.children(t)}}function U(e,n){let t=l(e);return t===e.defaultValue?n():t}function C(e){let n=(0,a.createContext)(e),t=o=>(o.debug,n.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(t.$$typeof=Symbol.for("react.provider")),t.$$typeof=Symbol.for("react.provider"),{id:n.id,Provider:(0,v.asProvider)(t),defaultValue:e}}function l(e){let n=(0,a.useContext)(e);return n!==void 0?n:e.defaultValue}
1
+ "use strict";var d=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var E=(e,n)=>{for(var t in n)d(e,t,{get:n[t],enumerable:!0})},S=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of b(n))!P.call(e,i)&&i!==t&&d(e,i,{get:()=>n[i],enumerable:!(o=g(n,i))||o.enumerable});return e};var O=e=>S(d({},"__esModule",{value:!0}),e);var V={};E(V,{composeProviders:()=>C,createConsumer:()=>U,createContext:()=>y,createContextWithProvider:()=>A,createProvider:()=>u,useContext:()=>l,useProvide:()=>k});module.exports=O(V);var v=require("@fluixi/dom"),a=require("@fluixi/reactive/signal"),x=require("@fluixi/reactive/signal");var c=require("@fluixi/dom"),r=require("@fluixi/reactive/signal");function f(e){(0,c.registerCreateComponent)(w)}function w(e,n){return R(e,n)}function R(e,n){let t=typeof e=="function"?(0,r.untrack)(()=>e(n)):e;if(t!=null&&(typeof t=="function"||typeof t=="object")&&!(0,r.isSignal)(t)){try{t.$name=e.name}catch{}return(0,c.asComponent)(t)}return t}f("index");var p=!1;function L(){p||(p=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function u(e,n,t){let o=!!e?.Provider,i=o?e:e.context,s=o?n:e.value,T=o?!1:e.debug??!1;o||L();let m=typeof s=="function"?s():s,h=o?t:e;return i.Provider({value:m,get children(){return h?.children},debug:T})}function A(e){let n=y(e);return[n,o=>u(n,o.value,o)]}function C(e,n){if(e.length===0)return(0,x.readChildren)(()=>n);let[t,o]=e[0],i=e.slice(1);return u(t,o,{get children(){return C(i,n)}})}function U(e){return n=>{let t=l(e);return n.children(t)}}function k(e,n){let t=l(e);return t===e.defaultValue?n():t}function y(e){let n=(0,a.createContext)(e),t=o=>(o.debug,n.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(t.$$typeof=Symbol.for("react.provider")),t.$$typeof=Symbol.for("react.provider"),{id:n.id,Provider:(0,v.asProvider)(t),defaultValue:e}}function l(e){let n=(0,a.useContext)(e);return n!==void 0?n:e.defaultValue}
@@ -86,7 +86,7 @@ export declare function createProvider<T, S = Children>(props: ContextProvider<T
86
86
  * }
87
87
  * ```
88
88
  */
89
- export declare function createContextWithProvider<T, U>(defaultValue: T): [Context<T>, (props: Omit<ContextProvider<T, U>, 'context'>) => Component<T>];
89
+ export declare function createContextWithProvider<T, U>(defaultValue: T): [Context<T>, (props: Omit<ContextProvider<T, U>, 'context'>) => ComponentChild];
90
90
  /**
91
91
  * Creates multiple context providers in a nested structure
92
92
  *
@@ -124,7 +124,7 @@ export declare function createContextWithProvider<T, U>(defaultValue: T): [Conte
124
124
  * }
125
125
  * ```
126
126
  */
127
- export declare function composeProviders(contexts: Array<[Context<any>, any]>, children: Children): Component;
127
+ export declare function composeProviders(contexts: Array<[Context<any>, any]>, children: Children): ComponentChild;
128
128
  /**
129
129
  * Creates a context consumer component
130
130
  *
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/lib/context/context.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAE9E,OAAO,EACL,QAAQ,EACR,OAAO,EAER,MAAM,yBAAyB,CAAC;AA8GjC,KAAK,CAAC,GAAG,SAAS,GAAG,SAAS,EAAE,CAAC;AAEjC,UAAU,QAAQ;IAChB,IAAI,CAAC,CAAC;IACN,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACrB;AAOD,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,UAAU,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;AAC/G,MAAM,WAAW,eAAe,CAAC,CAAC,EAAE,CAAC;IACnC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;CACvE;AAED,MAAM,WAAW,aAAa,CAAC,KAAK;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;CACzE;AAgFD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EACtB,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GACxB,cAAc,CAAC;AAClB;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,cAAc,CAAC;AAyC9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAC5C,YAAY,EAAE,CAAC,GACd,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAU/E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,EACpC,QAAQ,EAAE,QAAQ,GACjB,SAAS,CAaX;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,SAAS,CAAA;CAAE,KAAK,SAAS,CAK7D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAUtE;AAED;;;;;;;;;;;;;;GAcG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG,CAAC;IACxE,YAAY,EAAE,CAAC,CAAC;CACjB,CAgCA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,CAAC,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,GAAG,CAAC,CAIJ;AAoBD,YAAY,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/lib/context/context.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAE9E,OAAO,EACL,QAAQ,EACR,OAAO,EAER,MAAM,yBAAyB,CAAC;AA8GjC,KAAK,CAAC,GAAG,SAAS,GAAG,SAAS,EAAE,CAAC;AAEjC,UAAU,QAAQ;IAChB,IAAI,CAAC,CAAC;IACN,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACrB;AAOD,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,UAAU,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;AAC/G,MAAM,WAAW,eAAe,CAAC,CAAC,EAAE,CAAC;IACnC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;CACvE;AAED,MAAM,WAAW,aAAa,CAAC,KAAK;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;CACzE;AAgFD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EACtB,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GACxB,cAAc,CAAC;AAClB;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,cAAc,CAAC;AAyC9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAC5C,YAAY,EAAE,CAAC,GACd,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,cAAc,CAAC,CAUjF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,EACpC,QAAQ,EAAE,QAAQ,GACjB,cAAc,CAahB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,SAAS,CAAA;CAAE,KAAK,SAAS,CAK7D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAUtE;AAED;;;;;;;;;;;;;;GAcG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG,CAAC;IACxE,YAAY,EAAE,CAAC,CAAC;CACjB,CAgCA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,CAAC,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,GAAG,CAAC,CAIJ;AAoBD,YAAY,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +1 @@
1
- import{asProvider as m}from"@fluixi/dom";import{createContext as h,useContext as g}from"@fluixi/reactive/signal";import{readChildren as b}from"@fluixi/reactive/signal";import{registerCreateComponent as p,asComponent as v}from"@fluixi/dom";import{untrack as x,onCleanup as L,getOwner as A,createEffect as k,createMemo as U,createSignal as V,isSignal as y,batch as j,runWithOwner as M,isOwnerDisposed as _}from"@fluixi/reactive/signal";function c(e){p(C)}function C(e,n){return T(e,n)}function T(e,n){let t=typeof e=="function"?x(()=>e(n)):e;if(t!=null&&(typeof t=="function"||typeof t=="object")&&!y(t)){try{t.$name=e.name}catch{}return v(t)}return t}c("index");var a=!1;function P(){a||(a=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function s(e,n,t){let o=!!e?.Provider,r=o?e:e.context,i=o?n:e.value,d=o?!1:e.debug??!1;o||P();let l=typeof i=="function"?i():i,f=o?t:e;return r.Provider({value:l,get children(){return f?.children},debug:d})}function Q(e){let n=S(e);return[n,o=>s(n,o.value,o)]}function E(e,n){if(e.length===0)return b(()=>n);let[t,o]=e[0],r=e.slice(1);return s(t,o,{get children(){return E(r,n)}})}function Z(e){return n=>{let t=u(e);return n.children(t)}}function ee(e,n){let t=u(e);return t===e.defaultValue?n():t}function S(e){let n=h(e),t=o=>(o.debug,n.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(t.$$typeof=Symbol.for("react.provider")),t.$$typeof=Symbol.for("react.provider"),{id:n.id,Provider:m(t),defaultValue:e}}function u(e){let n=g(e);return n!==void 0?n:e.defaultValue}export{E as composeProviders,Z as createConsumer,S as createContext,Q as createContextWithProvider,s as createProvider,u as useContext,ee as useProvide};
1
+ import{asProvider as m}from"@fluixi/dom";import{createContext as h,useContext as g}from"@fluixi/reactive/signal";import{readChildren as b}from"@fluixi/reactive/signal";import{registerCreateComponent as p,asComponent as v}from"@fluixi/dom";import{untrack as x,onCleanup as L,getOwner as A,createEffect as U,createMemo as k,createSignal as V,isSignal as C,batch as j,runWithOwner as M,isOwnerDisposed as _}from"@fluixi/reactive/signal";function c(e){p(y)}function y(e,n){return T(e,n)}function T(e,n){let t=typeof e=="function"?x(()=>e(n)):e;if(t!=null&&(typeof t=="function"||typeof t=="object")&&!C(t)){try{t.$name=e.name}catch{}return v(t)}return t}c("index");var a=!1;function P(){a||(a=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function s(e,n,t){let o=!!e?.Provider,r=o?e:e.context,i=o?n:e.value,u=o?!1:e.debug??!1;o||P();let l=typeof i=="function"?i():i,f=o?t:e;return r.Provider({value:l,get children(){return f?.children},debug:u})}function Q(e){let n=S(e);return[n,o=>s(n,o.value,o)]}function E(e,n){if(e.length===0)return b(()=>n);let[t,o]=e[0],r=e.slice(1);return s(t,o,{get children(){return E(r,n)}})}function Z(e){return n=>{let t=d(e);return n.children(t)}}function ee(e,n){let t=d(e);return t===e.defaultValue?n():t}function S(e){let n=h(e),t=o=>(o.debug,n.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(t.$$typeof=Symbol.for("react.provider")),t.$$typeof=Symbol.for("react.provider"),{id:n.id,Provider:m(t),defaultValue:e}}function d(e){let n=g(e);return n!==void 0?n:e.defaultValue}export{E as composeProviders,Z as createConsumer,S as createContext,Q as createContextWithProvider,s as createProvider,d as useContext,ee as useProvide};
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var w=(e,n)=>{for(var t in n)l(e,t,{get:n[t],enumerable:!0})},R=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of S(n))!O.call(e,i)&&i!==t&&l(e,i,{get:()=>n[i],enumerable:!(o=E(n,i))||o.enumerable});return e};var L=e=>R(l({},"__esModule",{value:!0}),e);var V={};w(V,{composeProviders:()=>f,createConsumer:()=>m,createContext:()=>p,createContextWithProvider:()=>T,createProvider:()=>s,useContext:()=>u,useProvide:()=>h});module.exports=L(V);var C=require("@fluixi/dom"),a=require("@fluixi/reactive/signal"),y=require("@fluixi/reactive/signal");var c=require("@fluixi/dom"),r=require("@fluixi/reactive/signal");function v(e){(0,c.registerCreateComponent)(A)}function A(e,n){return k(e,n)}function k(e,n){let t=typeof e=="function"?(0,r.untrack)(()=>e(n)):e;if(t!=null&&(typeof t=="function"||typeof t=="object")&&!(0,r.isSignal)(t)){try{t.$name=e.name}catch{}return(0,c.asComponent)(t)}return t}v("index");var x=!1;function U(){x||(x=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function s(e,n,t){let o=!!e?.Provider,i=o?e:e.context,d=o?n:e.value,g=o?!1:e.debug??!1;o||U();let P=typeof d=="function"?d():d,b=o?t:e;return i.Provider({value:P,get children(){return b?.children},debug:g})}function T(e){let n=p(e);return[n,o=>s(n,o.value,o)]}function f(e,n){if(e.length===0)return(0,y.readChildren)(()=>n);let[t,o]=e[0],i=e.slice(1);return s(t,o,{get children(){return f(i,n)}})}function m(e){return n=>{let t=u(e);return n.children(t)}}function h(e,n){let t=u(e);return t===e.defaultValue?n():t}function p(e){let n=(0,a.createContext)(e),t=o=>(o.debug,n.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(t.$$typeof=Symbol.for("react.provider")),t.$$typeof=Symbol.for("react.provider"),{id:n.id,Provider:(0,C.asProvider)(t),defaultValue:e}}function u(e){let n=(0,a.useContext)(e);return n!==void 0?n:e.defaultValue}
1
+ "use strict";var l=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var n in t)l(e,n,{get:t[n],enumerable:!0})},R=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of S(t))!O.call(e,i)&&i!==n&&l(e,i,{get:()=>t[i],enumerable:!(o=E(t,i))||o.enumerable});return e};var L=e=>R(l({},"__esModule",{value:!0}),e);var V={};w(V,{composeProviders:()=>f,createConsumer:()=>m,createContext:()=>p,createContextWithProvider:()=>T,createProvider:()=>s,useContext:()=>d,useProvide:()=>h});module.exports=L(V);var C=require("@fluixi/dom"),a=require("@fluixi/reactive/signal"),y=require("@fluixi/reactive/signal");var c=require("@fluixi/dom"),r=require("@fluixi/reactive/signal");function v(e){(0,c.registerCreateComponent)(A)}function A(e,t){return U(e,t)}function U(e,t){let n=typeof e=="function"?(0,r.untrack)(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,r.isSignal)(n)){try{n.$name=e.name}catch{}return(0,c.asComponent)(n)}return n}v("index");var x=!1;function k(){x||(x=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function s(e,t,n){let o=!!e?.Provider,i=o?e:e.context,u=o?t:e.value,g=o?!1:e.debug??!1;o||k();let P=typeof u=="function"?u():u,b=o?n:e;return i.Provider({value:P,get children(){return b?.children},debug:g})}function T(e){let t=p(e);return[t,o=>s(t,o.value,o)]}function f(e,t){if(e.length===0)return(0,y.readChildren)(()=>t);let[n,o]=e[0],i=e.slice(1);return s(n,o,{get children(){return f(i,t)}})}function m(e){return t=>{let n=d(e);return t.children(n)}}function h(e,t){let n=d(e);return n===e.defaultValue?t():n}function p(e){let t=(0,a.createContext)(e),n=o=>(o.debug,t.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(n.$$typeof=Symbol.for("react.provider")),n.$$typeof=Symbol.for("react.provider"),{id:t.id,Provider:(0,C.asProvider)(n),defaultValue:e}}function d(e){let t=(0,a.useContext)(e);return t!==void 0?t:e.defaultValue}