@fluixi/dom 1.0.0-alpha.66 → 1.0.0-alpha.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/dom.cjs +1 -1
- package/dist/cdn/dom.global.js +1 -1
- package/dist/cdn/dom.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/flow/client-only.cjs +1 -0
- package/dist/lib/flow/client-only.d.ts +44 -0
- package/dist/lib/flow/client-only.d.ts.map +1 -0
- package/dist/lib/flow/client-only.js +46 -0
- package/dist/lib/flow/client-only.mjs +1 -0
- package/dist/lib/flow/index.cjs +1 -1
- package/dist/lib/flow/index.d.ts +2 -0
- package/dist/lib/flow/index.d.ts.map +1 -1
- package/dist/lib/flow/index.js +1 -0
- package/dist/lib/flow/index.mjs +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function tr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function nr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function rr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function or(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var ir=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),sr=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),O="http://www.w3.org/2000/svg";function kt(e){return e.localName.includes("-")}function de(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(kt(e)){e[t]=n;return}m(e,t,n,r)}var pe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Fe(e,t=document){return t.querySelector(e)}function ar(e,t=document){return Array.from(t.querySelectorAll(e))}function lr(e,t){return e.closest(t)}function He(e,...t){e.classList.add(...t)}function Ve(e,...t){e.classList.remove(...t)}function Ue(e,...t){t.forEach(n=>e.classList.toggle(n))}function cr(e,t){return e.classList.contains(t)}function m(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function We(e,t){return e.getAttribute(t)}function Ke(e,t){e.removeAttribute(t)}function ye(e,t){Object.assign(e.style,t)}function ur(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Be(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")ye(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else m(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function ze(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Ge(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function fr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function dr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function pr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function yr(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function mr(e,t=5e3){return new Promise((n,r)=>{let o=Fe(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Fe(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function gr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function hr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var _t=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function xr(e){return typeof e=="object"&&e!==null&&e.$$typeof===_t}function Ot(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Tr(e){if(typeof e!="function")return!1;try{let t=e();return Ot(t)}catch{return!1}}function br(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Er(e){return e instanceof Node}function Nr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function vr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as x}from"@fluixi/reactive/signal";function Ar(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function wr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Rr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Cr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Mr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Pr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Lr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Dr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function It(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function $t(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function kr(e){return It(e)?{type:"router",value:e}:qt(e)?{type:"route",value:e}:$t(e)?{type:"routes",value:e}:jt(e)?{type:"outlet",value:e}:b(e)?{type:"component",value:e}:Vt(e)?{type:"suspense",value:e}:Ft(e)?{type:"provider",value:e}:Ht(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Qe,createEffect as j,createRenderEffect as p,createRoot as Bt,onCleanup as C,readChildren as zt}from"@fluixi/reactive/signal";var g=typeof document>"u";function P(e){g=e}var I=Symbol.for("fluixi.server-node"),me=null;function Xe(e){me=e}function $(){if(!me)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return me}function L(e){return e!=null&&e[I]===!0?!0:typeof Node<"u"&&e instanceof Node}function ge(e){return e!=null&&e[I]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function he(e){return e!=null&&e[I]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Je=null;function Ye(e){Je=e}function xe(){return Je}function Te(e,t){return u.active&&t.parentNode===e}function be(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Ut(){return u.active?u.cursor:null}function Wt(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function Kt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function q(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&be(t)}function Gt(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Xt(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Wr(e){return Xt(Gt(e))}var Kr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Jt={};var Ze=new Map,X=new Set,ee=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function te(e){if(!g)for(let t of e)X.has(t)||ee.has(t)||(X.add(t),document.addEventListener(t,Yt))}function Yt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Ee(e,t,n){if(e[`$$${t}`]=n,ee.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}X.has(t)||te([t])}function J(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Br(e){return!ee.has(e)}function zr(e){return typeof e=="function"}function A(e,t=!1){if(g)return $().createText(e);if(u.active&&!t){let n=xe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ne(e,t=!1){if(g)return $().createElement(e,t);if(u.active){let n=xe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(O,e):document.createElement(e)}function et(e,t=!1){let n=Ze.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Ze.set(e,r),r}function tt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Zt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Zt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Gr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Xr(e){if(x(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!x(t)&&!b(t);)t=t();return t}var v=0,Qt=200;function en(e,t,n,r,o){let i=r,s=new Map;return p(()=>{let a;if(b(e)&&!x(e)){if(!s.has(e)){v++;try{let l=e();s.set(e,l)}finally{v--}}for(a=s.get(e);typeof a=="function"&&x(a);)a=a()}else for(a=e();typeof a=="function"&&x(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(b(a)){if(!s.has(a)){let c=a;v++;try{let f=c();s.set(c,f)}finally{v--}}a=s.get(a)}else if(x(a))a=a();else if(a=a(),typeof a!="function"||!x(a)&&!b(a))break}v++;try{i=Y(t,a,n,i,s),o(i)}finally{v--}})}function T(e,t,n,r){if(v>Qt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=A("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){v++;try{o=Y(e,t,n,null)}finally{v--}return()=>o}let a=en(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Y(e,t,n,r,o){if(t==null||typeof t=="boolean")return R(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return R(e,r,n);if(G(t)){let s=A("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),R(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&Y(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=A(t);return h(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=R(e,r,n)}if(r&&he(r))return r.data=t,r;let s=A(t);return r&&r.parentNode===e?e.replaceChild(s,r):Te(e,s)||h(e,s,n),s}if(L(t))return Te(e,t)?(be(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),R(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];N(t,s,e,n,!0,o,l);let c=tn(e,a,s,n);for(let f of l){let d=T(e,f.sig,f.marker);C(()=>{R(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return Y(e,l,n,r)}}}return R(e,r,n)}function N(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!G(l)&&!x(l)&&!b(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(b(l)&&!x(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!G(c)&&!x(c)&&!b(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(x(c)){if(s){let d=A("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&x(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?N(f,t,n,r,o,i):N([f],t,n,r,o,i);continue}continue}Array.isArray(c)?N(c,t,n,r,o,i,s):N([c],t,n,r,o,i,s);continue}if(G(l)){let c=A("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(N([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let y=1;y<d.length;y++)c.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){N(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?N(f,t,n,r,!1,i):N([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(A(c));continue}t.push(A(String(l)))}}}}function tn(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)h(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let y=a,fe=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==d+fe);)fe++;if(fe>d-l){let Dt=t[a];for(;l<d;)h(e,n[l++],Dt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(h(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function R(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function h(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function D(e,t,n){n==null?delete e[t]:e[t]=n}function nt(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function rt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function F(e,t,n,r=!1){return typeof n!="function"?(m(e,t,n,r),()=>{}):p(()=>{let o=typeof n=="function"?n():n;m(e,t,o,r)})}function H(e,t,n){return typeof n!="function"?(D(e,t,n),()=>{}):p(()=>{let r=typeof n=="function"?n():n;D(e,t,r)})}function ot(e,t,n){return typeof n!="function"?(m(e,t,!!n),()=>{}):p(()=>{let r=n();m(e,t,!!r)})}function k(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>k(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 n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function Z(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(p(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function Q(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function it(e){let{element:t,props:n,prevProps:r=Jt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ge(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===O,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){_(c,t);continue}if(l==="use"){rt(t,c);continue}if(l.startsWith("on:")){a.push(nt(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(H(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(F(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(ot(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(p(()=>k(t,c()))):k(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(p(()=>Z(t,c()))):Z(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(p(()=>Q(t,c()))):Q(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&J(t,y),c&&Ee(t,y,c);continue}let d=pe.has(l)||!s&&l in t;typeof c=="function"?a.push(d?H(t,l,c):F(t,l,c,s)):a.push(p(()=>d?D(t,l,n[l]):m(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();J(t,c)}else pe.has(l)?D(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function re(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){_(o,e);continue}if(r!=="children"){if(r==="use"){rt(e,o);continue}if(r.startsWith("on:")){nt(e,r.slice(3),o);continue}if(r.startsWith("prop:")){H(e,r.slice(5),o);continue}if(r.startsWith("attr:")){F(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){ot(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(ee.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,X.has(i)||te([i]);continue}if(r==="class"||r==="className"){k(e,o);continue}if(r==="classList"){typeof o=="function"?p(()=>Z(e,o())):Z(e,o);continue}if(r==="style"){typeof o=="function"?p(()=>Q(e,o())):Q(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});C(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});C(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});C(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=j(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});C(()=>{s()})}else{let i=!0;p(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();de(e,r,s,n)});C(()=>{i()})}else p(()=>de(e,r,t[r],n))}}}function st(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Jr(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function _(e,t){if(e){if(L(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function at(e,t,n){let r=t||document.body,o=zt(()=>e),i=[];return Qe(()=>{let s=p(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),C(()=>{i.forEach(a=>a())})}),null}function Yr(e){return typeof e=="string"&&e.toLowerCase()===e}function lt(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 Zr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function G(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Qr(e){return typeof e=="function"&&e.length===0&&x(e)}function oe(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return Bt(s=>{Qe(()=>{u.active||(t.textContent=""),T(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var nn="__fx_dom_create_component__",M=globalThis[nn]??={fn:null};function to(e){M.fn=e}function no(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function ie(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var ro=()=>M.fn!==null,ct=()=>M.fn!==null;function ut(){M.fn=null}var se,dt={getStore:()=>se,run(e,t){let n=se;se=e;try{return t()}finally{se=n}}},Ne=dt;function pt(e){Ne=e??dt}function V(e={}){e.locals||(e.locals=e.request?Se(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function U(e,t){return Ne.run(e,t)}function S(){return Ne.getStore()}function ve(){return S()?.event}function yt(){let e=ve();return e?(e.locals||(e.locals={}),e.locals):{}}var ft=new WeakMap;function Se(e){let t=ft.get(e);return t||(t={},ft.set(e,t)),t}import{setResourceIdSource as rn,setServerDataGetter as on}from"@fluixi/reactive/signal";var W="__FX_DATA__";function ae(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ae;function le(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ae!==void 0)return Ae;let t=null;if(typeof document<"u"){let n=document.getElementById(W)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ae=t}function we(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var sn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Re=typeof process<"u"&&process.env&&!1;function Ce(e,t){let n=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 ${n}. 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 an(e){we();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(sn.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Re&&t&&Ce(`<${e}>`,t),null)}function ln(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}we();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Re&&t&&Ce(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function cn(e){we();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Re&&t&&Ce(`marker <!--${e.slice(0,24)}-->`,t),null)}var mt=!1;function un(){mt||(mt=!0,Ye({hydrateElement:an,hydrateText:ln,hydrateMarker:cn}))}function K(e,t,n){un(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=le(),o=n?.resourceNamespace,i=0;rn(()=>o?`${o}:r${i++}`:`r${i++}`),on(r?s=>s in r?{value:r[s]}:void 0:null);try{return oe(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Me="fluixi-island";function fn(e){let{component:t,props:n={},name:r}=e,o=ne(Me),i=r??t.name??"Island";m(o,"name",i),m(o,"props",JSON.stringify(n??{}));let s=g?S():void 0;if(s){let a=s.nextIslandNamespace(i);T(o,()=>s.withResourceScope(a,()=>t(n)))}else T(o,()=>t(n));return o}var gt=!1;function dn(){if(gt||typeof document>"u")return;gt=!0;let e=document.createElement("style");e.textContent=`${Me}{display:contents}`,document.head.appendChild(e)}function pn(e){if(typeof document>"u")return;dn();let t=document.querySelectorAll(Me),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}K(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function yn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function mn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as gn}from"@fluixi/reactive/signal";function ko(e,t={}){if(typeof e=="function")return ie(e,t);if(typeof e!="string"||e.length===0)return null;let n=lt(e);if(g)return $().createElement(e,n);let r=n?document.createElementNS(O,e):document.createElement(e);return re(r,t,n),hn(r,t),r}function hn(e,t){if(!t||t.children===void 0)return;let n=gn(()=>t.children),r=o=>{T(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createMemo as Pe,untrack as bt}from"@fluixi/reactive/signal";function ht(e){return typeof e=="function"?e:(()=>e)}function w(e){return()=>{let t=e();return typeof t=="function"?t():t}}function xt(e){return e!=null&&e!==!1}function Tt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function xn(e){let t=w(()=>e.when),n=Pe(t,void 0),r=Pe(n,void 0);return Pe(()=>{if(r()){let i=e.children;return typeof i=="function"&&!Tt(i)?typeof n=="function"?bt(()=>bt(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as Tn,keyArray as bn}from"@fluixi/reactive/signal";function En(e){let t=w(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return q(a),a};return e.by?bn(t,e.by,(o,i)=>r(o,i),{fallback:n}):Tn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Nn}from"@fluixi/reactive/signal";function vn(e){let t=w(()=>e.each);return Nn(t,(n,r)=>{let o=e.children(n,r);return q(o),o},{fallback:()=>e.fallback??null})}import{mapArray as Ai,keyArray as wi,indexArray as Ri}from"@fluixi/reactive/signal";import{createMemo as Sn}from"@fluixi/reactive/signal";var Le=Symbol("match");function An(e){return{[Le]:!0,when:w(()=>e.when),children:e.children}}function wn(e){let t=Array.isArray(e.children)?e.children:[e.children];return Sn(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Le]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Le]!==!0)continue;let i=r.when();if(xt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as Rn}from"@fluixi/reactive/signal";function Cn(e){let t=ht(e.component),{component:n,...r}=e;return Rn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as Mn,onCleanup as Pn}from"@fluixi/reactive/signal";function Ln(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Mn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),T(r,e.children)&&_(e.ref,r)}),Pn(()=>{n(),r.remove()}),null}import{createMemo as Dn,createSignal as kn}from"@fluixi/reactive/signal";function _n(e){let[t,n]=kn(null),r=()=>n(null);return Dn(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}import{createMemo as On}from"@fluixi/reactive/signal";function In(e){return On(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}import{createMemo as $n}from"@fluixi/reactive/signal";function qn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function jn(e){return $n(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${qn(r)}: ${i}`)}return n.join("; ")})}var _e=1,Oe=3,Ie=8,Et;Et=I;var B=class{constructor(){this[Et]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},z=class e extends B{constructor(n){super();this.nodeType=Oe;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ce=class e extends B{constructor(n){super();this.nodeType=Ie;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},De=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},ke=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},ue=class e extends B{constructor(n,r=!1){super();this.nodeType=_e;this.attributes=new Map;this.style=new De;this.classList=new ke(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new z(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var Fn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),vt=/&/g,Hn=/</g,Vn=/>/g,Un=/"/g;function $e(e){return e.replace(vt,"&").replace(Hn,"<").replace(Vn,">")}function Nt(e){return e.replace(vt,"&").replace(Un,""")}function Wn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Kn(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${Wn(n)}: ${r}`)}return t.join("; ")}function Bn(e){let t="",n=Kn(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Nt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Nt(o)}"`}return t}function E(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return $e(e);if(typeof e=="number")return $e(String(e));if(typeof e=="function")return E(e());if(Array.isArray(e))return e.map(E).join("");switch(e.nodeType){case Oe:return $e(e.data??"");case Ie:return`<!--${e.data??""}-->`;case _e:{let t=e.localName,n=`<${t}${Bn(e)}>`;if(Fn.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(E).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(E).join(""):""}import{createRoot as Rt}from"@fluixi/reactive/signal";import{setResourceTracker as zn,setResourceIdSource as Gn,setResourceDataSink as Xn,getOwner as Jn,runWithOwner as St,flush as Yn}from"@fluixi/reactive/signal";var At=!1;function Ct(){At||(At=!0,Xe({createElement:(e,t)=>new ue(e,t),createText:e=>new z(e),createComment:e=>new ce(e)}))}function Mt(e,t={}){let n=g;Ct(),P(!0);let r=V(t.event);try{return U(r,()=>Rt(o=>{try{let i=typeof e=="function"?e():e;return E(i)}finally{o()}}))}finally{P(n)}}var wt=!1;function Zn(){wt||(wt=!0,zn(e=>{S()?.pending.add(e)}),Gn(()=>S()?.nextResourceId()??""),Xn((e,t)=>{e&&S()?.data.set(e,t)}))}var qe=null;function Pt(e){qe=e}function je(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(qe)try{i=qe(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=ae(JSON.stringify(t));return`<script type="application/json" id="${W}">${n}<\/script>`}var Qn=50;async function Lt(e,t={}){let n=g;Ct(),P(!0),Zn();let r=V(t.event);try{return await U(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};Rt(f=>{s=f,i=Jn(),o=typeof e=="function"?e():e});let a=()=>{try{St(i,()=>E(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Qn;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Yn(),a()}let c=St(i,()=>E(o))+je(r);return s(),c})}finally{P(n)}}var er={createComponent:ie,createElement:Be,createNativeElement:ne,createTemplate:et,cloneTemplate:tt,createPortal:at,render:oe,hydrate:K,insert:T,appendChildren:Ge,removeChildren:ze,spread:it,applyProps:re,mergeProps:st,setProperty:D,setDynamicProperty:H,setAttribute:m,setDynamicAttribute:F,removeAttribute:Ke,getAttribute:We,setClassName:k,addClass:He,removeClass:Ve,toggleClass:Ue,setStyles:ye,delegateEvents:te,addDelegatedEventListener:Ee,removeDelegatedEventListener:J,handleRef:_,resetIntegration:ut,isIntegrationInitialized:ct},ls=er;export{Cn as Dynamic,_n as ErrorBoundary,W as FX_DATA_ID,En as For,vn as Index,fn as Island,pe as JSX_PROPERTIES,An as Match,Ln as Portal,sr as SVG_ELEMENTS,O as SVG_NAMESPACE,xn as Show,wn as Switch,ir as VOID_ELEMENTS,He as addClass,Ee as addDelegatedEventListener,nt as addNativeEventListener,Ge as appendChildren,de as applyElementProp,re as applyProps,rt as applyUse,Lr as asComponent,Pr as asContext,Cr as asOutlet,Mr as asProvider,Rr as asRoute,Ar as asRouter,wr as asRoutes,Dr as asSuspense,Ut as captureHydrationCursor,kr as checkRenderType,In as classMap,R as cleanChildren,tt as cloneTemplate,lr as closest,ie as createComponent,ko as createDynamicElement,Be as createElement,ne as createNativeElement,at as createPortal,V as createRequestContext,et as createTemplate,ls as default,yr as delegate,te as delegateEvents,ae as escapeFxJson,Zr as escapeHTML,Gr as fnName,Kr as generateID,We as getAttribute,vr as getGlobal,rr as getLitEventName,yt as getLocals,pr as getOffset,S as getRequestContext,ve as getRequestEvent,Se as getRequestLocals,le as getServerData,Wr as getStableElementId,ur as getStyle,_ as handleRef,cr as hasClass,yn as html,K as hydrate,q as hydrateAdvancePast,pn as hydrateIslands,Ri as indexArray,no as initializeIntegration,T as insert,Y as insertExpression,ro as intergartionInitialized,Qr as isAccessor,b as isComponent,Ht as isContext,kt as isCustomElement,Er as isDOMNode,Br as isDelegatedEvent,ge as isDomElement,L as isDomNode,he as isDomText,nr as isEventHandler,zr as isFunction,ct as isIntegrationInitialized,br as isJSXTemplate,Ot as isLitTemplateResult,Yr as isNativeElement,jt as isOutlet,G as isPromise,Ft as isProvider,xr as isReactElement,qt as isRoute,It as isRouter,$t as isRoutes,lt as isSVGElement,g as isServer,Vt as isSuspense,Tr as isTemplateFactory,fr as isVisible,Xr as iterateFn,wi as keyArray,Zt as makeArrayFlat,Ai as mapArray,st as mergeProps,gr as observeIntersection,hr as observeResize,Fe as query,ar as queryAll,to as registerCreateComponent,Nr as registerGlobal,Ke as removeAttribute,ze as removeChildren,Ve as removeClass,J as removeDelegatedEventListener,oe as render,Mt as renderToString,Lt as renderToStringAsync,ut as resetIntegration,Wt as runHydrationAt,U as runWithRequestContext,Kt as runWithoutHydration,dr as scrollIntoView,E as serializeNode,je as serializeResourceData,m as setAttribute,Z as setClassList,k as setClassName,Pt as setDataRedactor,F as setDynamicAttribute,ot as setDynamicBoolAttribute,H as setDynamicProperty,D as setProperty,pt as setRequestStore,P as setServerMode,Q as setStyle,ye as setStyles,or as shouldSetAsProperty,Jr as splitProps,it as spread,jn as styleMap,mn as svg,tr as toAttributeName,Ue as toggleClass,mr as waitForElement};
|
|
1
|
+
function ir(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function sr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function ar(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function lr(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var cr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ur=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),O="http://www.w3.org/2000/svg";function _t(e){return e.localName.includes("-")}function de(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(_t(e)){e[t]=n;return}h(e,t,n,r)}var pe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Fe(e,t=document){return t.querySelector(e)}function fr(e,t=document){return Array.from(t.querySelectorAll(e))}function dr(e,t){return e.closest(t)}function He(e,...t){e.classList.add(...t)}function Ve(e,...t){e.classList.remove(...t)}function Ue(e,...t){t.forEach(n=>e.classList.toggle(n))}function pr(e,t){return e.classList.contains(t)}function h(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function We(e,t){return e.getAttribute(t)}function Ke(e,t){e.removeAttribute(t)}function ye(e,t){Object.assign(e.style,t)}function yr(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Be(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")ye(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else h(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function ze(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Ge(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function mr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function hr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function gr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function xr(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Tr(e,t=5e3){return new Promise((n,r)=>{let o=Fe(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Fe(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function br(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Er(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Ot=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Nr(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ot}function It(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Sr(e){if(typeof e!="function")return!1;try{let t=e();return It(t)}catch{return!1}}function vr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Ar(e){return e instanceof Node}function wr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Cr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as x}from"@fluixi/reactive/signal";function Mr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Pr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Lr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Dr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function kr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function _r(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Or(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Ir(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function $t(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ut(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function $r(e){return $t(e)?{type:"router",value:e}:jt(e)?{type:"route",value:e}:qt(e)?{type:"routes",value:e}:Ft(e)?{type:"outlet",value:e}:b(e)?{type:"component",value:e}:Ut(e)?{type:"suspense",value:e}:Ht(e)?{type:"provider",value:e}:Vt(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Qe,createEffect as j,createRenderEffect as p,createRoot as zt,onCleanup as R,readChildren as Gt}from"@fluixi/reactive/signal";var m=typeof document>"u";function P(e){m=e}var I=Symbol.for("fluixi.server-node"),me=null;function Xe(e){me=e}function $(){if(!me)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return me}function L(e){return e!=null&&e[I]===!0?!0:typeof Node<"u"&&e instanceof Node}function he(e){return e!=null&&e[I]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ge(e){return e!=null&&e[I]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Je=null;function Ye(e){Je=e}function xe(){return Je}function Te(e,t){return u.active&&t.parentNode===e}function be(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Wt(){return u.active?u.cursor:null}function Kt(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function Bt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function q(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&be(t)}function Xt(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Jt(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Gr(e){return Jt(Xt(e))}var Xr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Yt={};var Ze=new Map,X=new Set,ee=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function te(e){if(!m)for(let t of e)X.has(t)||ee.has(t)||(X.add(t),document.addEventListener(t,Zt))}function Zt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Ee(e,t,n){if(e[`$$${t}`]=n,ee.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}X.has(t)||te([t])}function J(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Jr(e){return!ee.has(e)}function Yr(e){return typeof e=="function"}function A(e,t=!1){if(m)return $().createText(e);if(u.active&&!t){let n=xe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ne(e,t=!1){if(m)return $().createElement(e,t);if(u.active){let n=xe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(O,e):document.createElement(e)}function et(e,t=!1){let n=Ze.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Ze.set(e,r),r}function tt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Qt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Qt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Zr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Qr(e){if(x(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!x(t)&&!b(t);)t=t();return t}var S=0,en=200;function tn(e,t,n,r,o){let i=r,s=new Map;return p(()=>{let a;if(b(e)&&!x(e)){if(!s.has(e)){S++;try{let l=e();s.set(e,l)}finally{S--}}for(a=s.get(e);typeof a=="function"&&x(a);)a=a()}else for(a=e();typeof a=="function"&&x(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(b(a)){if(!s.has(a)){let c=a;S++;try{let f=c();s.set(c,f)}finally{S--}}a=s.get(a)}else if(x(a))a=a();else if(a=a(),typeof a!="function"||!x(a)&&!b(a))break}S++;try{i=Y(t,a,n,i,s),o(i)}finally{S--}})}function T(e,t,n,r){if(S>en)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=A("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){S++;try{o=Y(e,t,n,null)}finally{S--}return()=>o}let a=tn(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Y(e,t,n,r,o){if(t==null||typeof t=="boolean")return C(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return C(e,r,n);if(G(t)){let s=A("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),C(e,r.slice(1),n)):g(e,s,n):r?e.replaceChild(s,r):g(e,s,n),t.then(a=>{s.parentNode===e&&Y(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=A(t);return g(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=C(e,r,n)}if(r&&ge(r))return r.data=t,r;let s=A(t);return r&&r.parentNode===e?e.replaceChild(s,r):Te(e,s)||g(e,s,n),s}if(L(t))return Te(e,t)?(be(t),t):Array.isArray(r)?(r.length===0?g(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),C(e,r.slice(1),n)):g(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];N(t,s,e,n,!0,o,l);let c=nn(e,a,s,n);for(let f of l){let d=T(e,f.sig,f.marker);R(()=>{C(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return Y(e,l,n,r)}}}return C(e,r,n)}function N(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!G(l)&&!x(l)&&!b(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(b(l)&&!x(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!G(c)&&!x(c)&&!b(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(x(c)){if(s){let d=A("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&x(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?N(f,t,n,r,o,i):N([f],t,n,r,o,i);continue}continue}Array.isArray(c)?N(c,t,n,r,o,i,s):N([c],t,n,r,o,i,s);continue}if(G(l)){let c=A("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(N([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let y=1;y<d.length;y++)c.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){N(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?N(f,t,n,r,!1,i):N([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(A(c));continue}t.push(A(String(l)))}}}}function nn(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)g(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;g(e,n[l++],t[a++].nextSibling),g(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let y=a,fe=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==d+fe);)fe++;if(fe>d-l){let kt=t[a];for(;l<d;)g(e,n[l++],kt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(g(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function C(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function D(e,t,n){n==null?delete e[t]:e[t]=n}function nt(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function rt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function F(e,t,n,r=!1){return typeof n!="function"?(h(e,t,n,r),()=>{}):p(()=>{let o=typeof n=="function"?n():n;h(e,t,o,r)})}function H(e,t,n){return typeof n!="function"?(D(e,t,n),()=>{}):p(()=>{let r=typeof n=="function"?n():n;D(e,t,r)})}function ot(e,t,n){return typeof n!="function"?(h(e,t,!!n),()=>{}):p(()=>{let r=n();h(e,t,!!r)})}function k(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>k(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 n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function Z(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(p(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function Q(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function it(e){let{element:t,props:n,prevProps:r=Yt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!he(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===O,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){_(c,t);continue}if(l==="use"){rt(t,c);continue}if(l.startsWith("on:")){a.push(nt(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(H(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(F(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(ot(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(p(()=>k(t,c()))):k(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(p(()=>Z(t,c()))):Z(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(p(()=>Q(t,c()))):Q(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&J(t,y),c&&Ee(t,y,c);continue}let d=pe.has(l)||!s&&l in t;typeof c=="function"?a.push(d?H(t,l,c):F(t,l,c,s)):a.push(p(()=>d?D(t,l,n[l]):h(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();J(t,c)}else pe.has(l)?D(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function re(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){_(o,e);continue}if(r!=="children"){if(r==="use"){rt(e,o);continue}if(r.startsWith("on:")){nt(e,r.slice(3),o);continue}if(r.startsWith("prop:")){H(e,r.slice(5),o);continue}if(r.startsWith("attr:")){F(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){ot(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(ee.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,X.has(i)||te([i]);continue}if(r==="class"||r==="className"){k(e,o);continue}if(r==="classList"){typeof o=="function"?p(()=>Z(e,o())):Z(e,o);continue}if(r==="style"){typeof o=="function"?p(()=>Q(e,o())):Q(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});R(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});R(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});R(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=j(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});R(()=>{s()})}else{let i=!0;p(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();de(e,r,s,n)});R(()=>{i()})}else p(()=>de(e,r,t[r],n))}}}function st(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function eo(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function _(e,t){if(e){if(L(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function at(e,t,n){let r=t||document.body,o=Gt(()=>e),i=[];return Qe(()=>{let s=p(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),R(()=>{i.forEach(a=>a())})}),null}function to(e){return typeof e=="string"&&e.toLowerCase()===e}function lt(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 no(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function G(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ro(e){return typeof e=="function"&&e.length===0&&x(e)}function oe(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return zt(s=>{Qe(()=>{u.active||(t.textContent=""),T(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var rn="__fx_dom_create_component__",M=globalThis[rn]??={fn:null};function io(e){M.fn=e}function so(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function ie(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var ao=()=>M.fn!==null,ct=()=>M.fn!==null;function ut(){M.fn=null}var se,dt={getStore:()=>se,run(e,t){let n=se;se=e;try{return t()}finally{se=n}}},Ne=dt;function pt(e){Ne=e??dt}function V(e={}){e.locals||(e.locals=e.request?ve(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function U(e,t){return Ne.run(e,t)}function v(){return Ne.getStore()}function Se(){return v()?.event}function yt(){let e=Se();return e?(e.locals||(e.locals={}),e.locals):{}}var ft=new WeakMap;function ve(e){let t=ft.get(e);return t||(t={},ft.set(e,t)),t}import{setResourceIdSource as on,setServerDataGetter as sn}from"@fluixi/reactive/signal";var W="__FX_DATA__";function ae(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ae;function le(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ae!==void 0)return Ae;let t=null;if(typeof document<"u"){let n=document.getElementById(W)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ae=t}function we(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var an=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ce=typeof process<"u"&&process.env&&!1;function Re(e,t){let n=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 ${n}. 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 ln(e){we();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(an.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Ce&&t&&Re(`<${e}>`,t),null)}function cn(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}we();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ce&&t&&Re(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function un(e){we();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ce&&t&&Re(`marker <!--${e.slice(0,24)}-->`,t),null)}var mt=!1;function fn(){mt||(mt=!0,Ye({hydrateElement:ln,hydrateText:cn,hydrateMarker:un}))}function K(e,t,n){fn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=le(),o=n?.resourceNamespace,i=0;on(()=>o?`${o}:r${i++}`:`r${i++}`),sn(r?s=>s in r?{value:r[s]}:void 0:null);try{return oe(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Me="fluixi-island";function dn(e){let{component:t,props:n={},name:r}=e,o=ne(Me),i=r??t.name??"Island";h(o,"name",i),h(o,"props",JSON.stringify(n??{}));let s=m?v():void 0;if(s){let a=s.nextIslandNamespace(i);T(o,()=>s.withResourceScope(a,()=>t(n)))}else T(o,()=>t(n));return o}var ht=!1;function pn(){if(ht||typeof document>"u")return;ht=!0;let e=document.createElement("style");e.textContent=`${Me}{display:contents}`,document.head.appendChild(e)}function yn(e){if(typeof document>"u")return;pn();let t=document.querySelectorAll(Me),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}K(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function mn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function hn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as gn}from"@fluixi/reactive/signal";function $o(e,t={}){if(typeof e=="function")return ie(e,t);if(typeof e!="string"||e.length===0)return null;let n=lt(e);if(m)return $().createElement(e,n);let r=n?document.createElementNS(O,e):document.createElement(e);return re(r,t,n),xn(r,t),r}function xn(e,t){if(!t||t.children===void 0)return;let n=gn(()=>t.children),r=o=>{T(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createMemo as Pe,untrack as bt}from"@fluixi/reactive/signal";function gt(e){return typeof e=="function"?e:(()=>e)}function w(e){return()=>{let t=e();return typeof t=="function"?t():t}}function xt(e){return e!=null&&e!==!1}function Tt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Tn(e){let t=w(()=>e.when),n=Pe(t,void 0),r=Pe(n,void 0);return Pe(()=>{if(r()){let i=e.children;return typeof i=="function"&&!Tt(i)?typeof n=="function"?bt(()=>bt(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as bn,keyArray as En}from"@fluixi/reactive/signal";function Nn(e){let t=w(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return q(a),a};return e.by?En(t,e.by,(o,i)=>r(o,i),{fallback:n}):bn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Sn}from"@fluixi/reactive/signal";function vn(e){let t=w(()=>e.each);return Sn(t,(n,r)=>{let o=e.children(n,r);return q(o),o},{fallback:()=>e.fallback??null})}import{mapArray as ki,keyArray as _i,indexArray as Oi}from"@fluixi/reactive/signal";import{createMemo as An}from"@fluixi/reactive/signal";var Le=Symbol("match");function wn(e){return{[Le]:!0,when:w(()=>e.when),children:e.children}}function Cn(e){let t=Array.isArray(e.children)?e.children:[e.children];return An(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Le]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Le]!==!0)continue;let i=r.when();if(xt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as Rn}from"@fluixi/reactive/signal";function Mn(e){let t=gt(e.component),{component:n,...r}=e;return Rn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as Pn,onCleanup as Ln}from"@fluixi/reactive/signal";function Dn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Pn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),T(r,e.children)&&_(e.ref,r)}),Ln(()=>{n(),r.remove()}),null}import{createMemo as kn,createSignal as _n}from"@fluixi/reactive/signal";function Et(e){if(m)return e.fallback??null;let t=u.active,[n,r]=_n(!t);return t&&queueMicrotask(()=>r(!0)),kn(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var On=Et;import{createMemo as In,createSignal as $n}from"@fluixi/reactive/signal";function qn(e){let[t,n]=$n(null),r=()=>n(null);return In(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}import{createMemo as jn}from"@fluixi/reactive/signal";function Fn(e){return jn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}import{createMemo as Hn}from"@fluixi/reactive/signal";function Vn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Un(e){return Hn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${Vn(r)}: ${i}`)}return n.join("; ")})}var _e=1,Oe=3,Ie=8,Nt;Nt=I;var B=class{constructor(){this[Nt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},z=class e extends B{constructor(n){super();this.nodeType=Oe;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ce=class e extends B{constructor(n){super();this.nodeType=Ie;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},De=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},ke=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},ue=class e extends B{constructor(n,r=!1){super();this.nodeType=_e;this.attributes=new Map;this.style=new De;this.classList=new ke(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new z(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var Wn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),vt=/&/g,Kn=/</g,Bn=/>/g,zn=/"/g;function $e(e){return e.replace(vt,"&").replace(Kn,"<").replace(Bn,">")}function St(e){return e.replace(vt,"&").replace(zn,""")}function Gn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Xn(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${Gn(n)}: ${r}`)}return t.join("; ")}function Jn(e){let t="",n=Xn(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${St(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${St(o)}"`}return t}function E(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return $e(e);if(typeof e=="number")return $e(String(e));if(typeof e=="function")return E(e());if(Array.isArray(e))return e.map(E).join("");switch(e.nodeType){case Oe:return $e(e.data??"");case Ie:return`<!--${e.data??""}-->`;case _e:{let t=e.localName,n=`<${t}${Jn(e)}>`;if(Wn.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(E).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(E).join(""):""}import{createRoot as Rt}from"@fluixi/reactive/signal";import{setResourceTracker as Yn,setResourceIdSource as Zn,setResourceDataSink as Qn,getOwner as er,runWithOwner as At,flush as tr}from"@fluixi/reactive/signal";var wt=!1;function Mt(){wt||(wt=!0,Xe({createElement:(e,t)=>new ue(e,t),createText:e=>new z(e),createComment:e=>new ce(e)}))}function Pt(e,t={}){let n=m;Mt(),P(!0);let r=V(t.event);try{return U(r,()=>Rt(o=>{try{let i=typeof e=="function"?e():e;return E(i)}finally{o()}}))}finally{P(n)}}var Ct=!1;function nr(){Ct||(Ct=!0,Yn(e=>{v()?.pending.add(e)}),Zn(()=>v()?.nextResourceId()??""),Qn((e,t)=>{e&&v()?.data.set(e,t)}))}var qe=null;function Lt(e){qe=e}function je(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(qe)try{i=qe(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=ae(JSON.stringify(t));return`<script type="application/json" id="${W}">${n}<\/script>`}var rr=50;async function Dt(e,t={}){let n=m;Mt(),P(!0),nr();let r=V(t.event);try{return await U(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};Rt(f=>{s=f,i=er(),o=typeof e=="function"?e():e});let a=()=>{try{At(i,()=>E(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<rr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await tr(),a()}let c=At(i,()=>E(o))+je(r);return s(),c})}finally{P(n)}}var or={createComponent:ie,createElement:Be,createNativeElement:ne,createTemplate:et,cloneTemplate:tt,createPortal:at,render:oe,hydrate:K,insert:T,appendChildren:Ge,removeChildren:ze,spread:it,applyProps:re,mergeProps:st,setProperty:D,setDynamicProperty:H,setAttribute:h,setDynamicAttribute:F,removeAttribute:Ke,getAttribute:We,setClassName:k,addClass:He,removeClass:Ve,toggleClass:Ue,setStyles:ye,delegateEvents:te,addDelegatedEventListener:Ee,removeDelegatedEventListener:J,handleRef:_,resetIntegration:ut,isIntegrationInitialized:ct},gs=or;export{Et as ClientOnly,Mn as Dynamic,qn as ErrorBoundary,W as FX_DATA_ID,Nn as For,vn as Index,dn as Island,pe as JSX_PROPERTIES,wn as Match,On as NoSsr,Dn as Portal,ur as SVG_ELEMENTS,O as SVG_NAMESPACE,Tn as Show,Cn as Switch,cr as VOID_ELEMENTS,He as addClass,Ee as addDelegatedEventListener,nt as addNativeEventListener,Ge as appendChildren,de as applyElementProp,re as applyProps,rt as applyUse,Or as asComponent,_r as asContext,Dr as asOutlet,kr as asProvider,Lr as asRoute,Mr as asRouter,Pr as asRoutes,Ir as asSuspense,Wt as captureHydrationCursor,$r as checkRenderType,Fn as classMap,C as cleanChildren,tt as cloneTemplate,dr as closest,ie as createComponent,$o as createDynamicElement,Be as createElement,ne as createNativeElement,at as createPortal,V as createRequestContext,et as createTemplate,gs as default,xr as delegate,te as delegateEvents,ae as escapeFxJson,no as escapeHTML,Zr as fnName,Xr as generateID,We as getAttribute,Cr as getGlobal,ar as getLitEventName,yt as getLocals,gr as getOffset,v as getRequestContext,Se as getRequestEvent,ve as getRequestLocals,le as getServerData,Gr as getStableElementId,yr as getStyle,_ as handleRef,pr as hasClass,mn as html,K as hydrate,q as hydrateAdvancePast,yn as hydrateIslands,Oi as indexArray,so as initializeIntegration,T as insert,Y as insertExpression,ao as intergartionInitialized,ro as isAccessor,b as isComponent,Vt as isContext,_t as isCustomElement,Ar as isDOMNode,Jr as isDelegatedEvent,he as isDomElement,L as isDomNode,ge as isDomText,sr as isEventHandler,Yr as isFunction,ct as isIntegrationInitialized,vr as isJSXTemplate,It as isLitTemplateResult,to as isNativeElement,Ft as isOutlet,G as isPromise,Ht as isProvider,Nr as isReactElement,jt as isRoute,$t as isRouter,qt as isRoutes,lt as isSVGElement,m as isServer,Ut as isSuspense,Sr as isTemplateFactory,mr as isVisible,Qr as iterateFn,_i as keyArray,Qt as makeArrayFlat,ki as mapArray,st as mergeProps,br as observeIntersection,Er as observeResize,Fe as query,fr as queryAll,io as registerCreateComponent,wr as registerGlobal,Ke as removeAttribute,ze as removeChildren,Ve as removeClass,J as removeDelegatedEventListener,oe as render,Pt as renderToString,Dt as renderToStringAsync,ut as resetIntegration,Kt as runHydrationAt,U as runWithRequestContext,Bt as runWithoutHydration,hr as scrollIntoView,E as serializeNode,je as serializeResourceData,h as setAttribute,Z as setClassList,k as setClassName,Lt as setDataRedactor,F as setDynamicAttribute,ot as setDynamicBoolAttribute,H as setDynamicProperty,D as setProperty,pt as setRequestStore,P as setServerMode,Q as setStyle,ye as setStyles,lr as shouldSetAsProperty,eo as splitProps,it as spread,Un as styleMap,hn as svg,ir as toAttributeName,Ue as toggleClass,Tr as waitForElement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var f=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},y=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of d(e))!p.call(t,n)&&n!==r&&a(t,n,{get:()=>e[n],enumerable:!(o=c(e,n))||o.enumerable});return t};var v=t=>y(a({},"__esModule",{value:!0}),t);var x={};f(x,{ClientOnly:()=>s,NoSsr:()=>m});module.exports=v(x);var i=require("@fluixi/reactive/signal");var l=typeof document>"u";var u={active:!1,cursor:null,parents:[]};function s(t){if(l)return t.fallback??null;let e=u.active,[r,o]=(0,i.createSignal)(!e);return e&&queueMicrotask(()=>o(!0)),(0,i.createMemo)(()=>r()?t.children:t.fallback??null,void 0,{name:"client-only"})}var m=s;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ComponentChild } from '../shared/types.js';
|
|
2
|
+
export interface ClientOnlyProps {
|
|
3
|
+
/**
|
|
4
|
+
* Rendered instead of `children` on the server, and during hydration.
|
|
5
|
+
*
|
|
6
|
+
* When hydrating, this must produce the same markup the server emitted —
|
|
7
|
+
* that is the whole point: the fallback is what both sides agree on.
|
|
8
|
+
*/
|
|
9
|
+
fallback?: ComponentChild;
|
|
10
|
+
/** Content rendered only in the browser. */
|
|
11
|
+
children?: ComponentChild;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Renders `children` only in the browser.
|
|
15
|
+
*
|
|
16
|
+
* For subtrees that cannot render on the server — they read `window`,
|
|
17
|
+
* `localStorage`, a canvas, or produce time/locale-dependent output that would
|
|
18
|
+
* differ between the two passes and corrupt hydration.
|
|
19
|
+
*
|
|
20
|
+
* The swap is deferred to a microtask rather than done immediately, because
|
|
21
|
+
* rendering `children` mid-hydration would desync the hydration cursor from the
|
|
22
|
+
* server markup — the exact bug this component exists to prevent. `hydrate()`
|
|
23
|
+
* runs synchronously and clears its flag in a `finally`, so a microtask is the
|
|
24
|
+
* first moment the pass is guaranteed to be over.
|
|
25
|
+
*
|
|
26
|
+
* Outside hydration (a plain client render) there is nothing to match, so
|
|
27
|
+
* `children` render straight away and `fallback` is never shown.
|
|
28
|
+
*
|
|
29
|
+
* @example JSX
|
|
30
|
+
* <ClientOnly fallback={<Skeleton />}>
|
|
31
|
+
* <Chart data={points()} />
|
|
32
|
+
* </ClientOnly>
|
|
33
|
+
*
|
|
34
|
+
* @example html``
|
|
35
|
+
* ClientOnly({ fallback: html`<div class="skeleton"></div>`, children: () => html`<x-chart></x-chart>` })
|
|
36
|
+
*/
|
|
37
|
+
export declare function ClientOnly(props: ClientOnlyProps): ComponentChild;
|
|
38
|
+
/**
|
|
39
|
+
* `NoSsr` is {@link ClientOnly} — the same component under the name used by
|
|
40
|
+
* other libraries, so the concept is findable either way.
|
|
41
|
+
*/
|
|
42
|
+
export declare const NoSsr: typeof ClientOnly;
|
|
43
|
+
export type NoSsrProps = ClientOnlyProps;
|
|
44
|
+
//# sourceMappingURL=client-only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-only.d.ts","sourceRoot":"","sources":["../../../src/lib/flow/client-only.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,cAAc,CAcjE;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,mBAAa,CAAC;AAChC,MAAM,MAAM,UAAU,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createMemo, createSignal } from '@fluixi/reactive/signal';
|
|
2
|
+
import { isServer } from '../dom/server/host.js';
|
|
3
|
+
import { hydration } from '../dom/hydration-state.js';
|
|
4
|
+
/**
|
|
5
|
+
* Renders `children` only in the browser.
|
|
6
|
+
*
|
|
7
|
+
* For subtrees that cannot render on the server — they read `window`,
|
|
8
|
+
* `localStorage`, a canvas, or produce time/locale-dependent output that would
|
|
9
|
+
* differ between the two passes and corrupt hydration.
|
|
10
|
+
*
|
|
11
|
+
* The swap is deferred to a microtask rather than done immediately, because
|
|
12
|
+
* rendering `children` mid-hydration would desync the hydration cursor from the
|
|
13
|
+
* server markup — the exact bug this component exists to prevent. `hydrate()`
|
|
14
|
+
* runs synchronously and clears its flag in a `finally`, so a microtask is the
|
|
15
|
+
* first moment the pass is guaranteed to be over.
|
|
16
|
+
*
|
|
17
|
+
* Outside hydration (a plain client render) there is nothing to match, so
|
|
18
|
+
* `children` render straight away and `fallback` is never shown.
|
|
19
|
+
*
|
|
20
|
+
* @example JSX
|
|
21
|
+
* <ClientOnly fallback={<Skeleton />}>
|
|
22
|
+
* <Chart data={points()} />
|
|
23
|
+
* </ClientOnly>
|
|
24
|
+
*
|
|
25
|
+
* @example html``
|
|
26
|
+
* ClientOnly({ fallback: html`<div class="skeleton"></div>`, children: () => html`<x-chart></x-chart>` })
|
|
27
|
+
*/
|
|
28
|
+
export function ClientOnly(props) {
|
|
29
|
+
if (isServer)
|
|
30
|
+
return props.fallback ?? null;
|
|
31
|
+
// Captured now, not read inside the memo: `hydration.active` is a global that
|
|
32
|
+
// flips when the pass ends, and this subtree's behaviour is decided by whether
|
|
33
|
+
// it was created during hydration.
|
|
34
|
+
const hydrating = hydration.active;
|
|
35
|
+
const [ready, setReady] = createSignal(!hydrating);
|
|
36
|
+
if (hydrating)
|
|
37
|
+
queueMicrotask(() => setReady(true));
|
|
38
|
+
return createMemo(() => (ready() ? props.children : (props.fallback ?? null)), undefined, {
|
|
39
|
+
name: 'client-only',
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* `NoSsr` is {@link ClientOnly} — the same component under the name used by
|
|
44
|
+
* other libraries, so the concept is findable either way.
|
|
45
|
+
*/
|
|
46
|
+
export const NoSsr = ClientOnly;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createMemo as a,createSignal as l}from"@fluixi/reactive/signal";var r=typeof document>"u";var n={active:!1,cursor:null,parents:[]};function u(e){if(r)return e.fallback??null;let t=n.active,[o,i]=l(!t);return t&&queueMicrotask(()=>i(!0)),a(()=>o()?e.children:e.fallback??null,void 0,{name:"client-only"})}var y=u;export{u as ClientOnly,y as NoSsr};
|
package/dist/lib/flow/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var j=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var de=(e,n)=>{for(var t in n)j(e,t,{get:n[t],enumerable:!0})},pe=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of ue(n))!ye.call(e,a)&&a!==t&&j(e,a,{get:()=>n[a],enumerable:!(o=le(n,a))||o.enumerable});return e};var he=e=>pe(j({},"__esModule",{value:!0}),e);var Ne={};de(Ne,{Dynamic:()=>J,ErrorBoundary:()=>re,For:()=>K,Index:()=>B,Match:()=>z,Portal:()=>oe,Show:()=>I,Switch:()=>G,classMap:()=>se,indexArray:()=>w.indexArray,keyArray:()=>w.keyArray,mapArray:()=>w.mapArray,styleMap:()=>ae});module.exports=he(Ne);var N=require("@fluixi/reactive/signal");function H(e){return typeof e=="function"?e:(()=>e)}function x(e){return()=>{let n=e();return typeof n=="function"?n():n}}function U(e){return e!=null&&e!==!1}function O(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function I(e){let n=x(()=>e.when),t=(0,N.createMemo)(n,void 0),o=(0,N.createMemo)(t,void 0);return(0,N.createMemo)(()=>{if(o()){let s=e.children;return typeof s=="function"&&!O(s)?typeof t=="function"?(0,N.untrack)(()=>(0,N.untrack)(t)?s(t()):e.fallback):s(t):s}return e.fallback},void 0,{name:"show"})}var S=require("@fluixi/reactive/signal");var g={active:!1,cursor:null,parents:[]},me=null;function W(){return me}function F(e,n){return g.active&&n.parentNode===e}function _(e){let n=g.parents.lastIndexOf(e);n!==-1&&(g.parents.length=n),g.cursor=e.nextSibling}function P(e){if(!g.active||e==null)return;let n=Array.isArray(e)?e[e.length-1]:e;n&&typeof n.nodeType=="number"&&_(n)}function K(e){let n=x(()=>e.each),t=()=>e.fallback??null,o=(a,s)=>{let f=e.children,i=Array.isArray(f)?f.map(r=>typeof r=="function"?r(a,s):r):typeof f=="function"?f(a,s):f;return P(i),i};return e.by?(0,S.keyArray)(n,e.by,(a,s)=>o(a,s),{fallback:t}):(0,S.mapArray)(n,(a,s)=>o(a,s),{fallback:t})}var V=require("@fluixi/reactive/signal");function B(e){let n=x(()=>e.each);return(0,V.indexArray)(n,(t,o)=>{let a=e.children(t,o);return P(a),a},{fallback:()=>e.fallback??null})}var w=require("@fluixi/reactive/signal");var q=require("@fluixi/reactive/signal");var $=Symbol("match");function z(e){return{[$]:!0,when:x(()=>e.when),children:e.children}}function G(e){let n=Array.isArray(e.children)?e.children:[e.children];return(0,q.createMemo)(()=>{for(let t of n){let o=t,a=0;for(;typeof o=="function"&&!o[$]&&a++<10;)o=o();if(!o||typeof o!="object"||o[$]!==!0)continue;let s=o.when();if(U(s))return typeof o.children=="function"?o.children(s):o.children}return e.fallback??null})}var X=require("@fluixi/reactive/signal");function J(e){let n=H(e.component),{component:t,...o}=e;return(0,X.createMemo)(()=>{let a=n();return a==null?null:typeof a=="string"?{tag:a,props:o}:a(o)})}var R=require("@fluixi/reactive/signal");var p=require("@fluixi/reactive/signal");function A(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var b=require("@fluixi/reactive/signal");var Z=typeof document>"u";var Q=Symbol.for("fluixi.server-node"),Y=null;function ee(){if(!Y)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Y}function v(e){return e!=null&&e[Q]===!0?!0:typeof Node<"u"&&e instanceof Node}function ne(e){return e!=null&&e[Q]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}function T(e,n=!1){if(Z)return ee().createText(e);if(g.active&&!n){let t=W()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}var m=0,xe=200;function ge(e,n,t,o,a){let s=o,f=new Map;return(0,b.createRenderEffect)(()=>{let i;if(A(e)&&!(0,p.isSignal)(e)){if(!f.has(e)){m++;try{let r=e();f.set(e,r)}finally{m--}}for(i=f.get(e);typeof i=="function"&&(0,p.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,p.isSignal)(i);)i=i();{let r=0;for(;typeof i=="function"&&r++<50;)if(A(i)){if(!f.has(i)){let c=i;m++;try{let l=c();f.set(c,l)}finally{m--}}i=f.get(i)}else if((0,p.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,p.isSignal)(i)&&!A(i))break}m++;try{s=C(n,i,t,s,f),a(s)}finally{m--}})}function D(e,n,t,o){if(m>xe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=T("",!0),e.appendChild(t));let a=o??null,s=r=>Array.isArray(r)&&r.some(c=>typeof c=="function"),f=r=>typeof r=="function"?r:()=>r;if(typeof n!="function"&&!s(n)){m++;try{a=C(e,n,t,null)}finally{m--}return()=>a}let i=ge(f(n),e,t,a,r=>{a=r});return()=>(i?.(),a)}function C(e,n,t,o,a){if(n==null||typeof n=="boolean")return E(e,o,t);if(typeof n=="function")for(;typeof n=="function";)n=n();if(n==null||typeof n=="boolean")return E(e,o,t);if(M(n)){let f=T("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),E(e,o.slice(1),t)):d(e,f,t):o?e.replaceChild(f,o):d(e,f,t),n.then(i=>{f.parentNode===e&&C(e,i,f.nextSibling,f)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),f}let s=typeof n;if(s==="string"||s==="number"){if(s==="number"&&(n=String(n)),Array.isArray(o)){if(o.length===0){let i=T(n);return d(e,i,t),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=n,o;o=E(e,o,t)}if(o&&ne(o))return o.data=n,o;let f=T(n);return o&&o.parentNode===e?e.replaceChild(f,o):F(e,f)||d(e,f,t),f}if(v(n))return F(e,n)?(_(n),n):Array.isArray(o)?(o.length===0?d(e,n,t):o[0].parentNode===e?(e.replaceChild(n,o[0]),E(e,o.slice(1),t)):d(e,n,t),n):(o?o!==n&&(o.parentNode===e?e.replaceChild(n,o):d(e,n,t)):d(e,n,t),n);if(Array.isArray(n)){let f=[],i=Array.isArray(o)?o:o?[o]:[],r=[];h(n,f,e,t,!0,a,r);let c=Te(e,i,f,t);for(let l of r){let u=D(e,l.sig,l.marker);(0,b.onCleanup)(()=>{E(e,u()),l.marker.parentNode===e&&e.removeChild(l.marker)})}return c}if(s==="object"&&n!==null&&typeof n=="object"){let f=n;if("type"in f&&"props"in f){let i=f;if(typeof i.type=="function"){let r=i.type(i.props||{});return C(e,r,t,o)}}}return E(e,o,t)}function h(e,n,t,o,a=!0,s,f){for(let i=0;i<e.length;i++){let r=e[i];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!M(r)&&!(0,p.isSignal)(r)&&!A(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let c;for(A(r)&&!(0,p.isSignal)(r)?(s||(s=new Map),s.has(r)||s.set(r,r()),c=s.get(r)):c=r();typeof c=="function"&&!M(c)&&!(0,p.isSignal)(c)&&!A(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,p.isSignal)(c)){if(f){let u=T("",!0);n.push(u),f.push({marker:u,sig:c});continue}let l=c();for(;typeof l=="function"&&(0,p.isSignal)(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?h(l,n,t,o,a,s):h([l],n,t,o,a,s);continue}continue}Array.isArray(c)?h(c,n,t,o,a,s,f):h([c],n,t,o,a,s,f);continue}if(M(r)){let c=T("",!0);n.push(c),r.then(l=>{if(c.parentNode){let u=[];if(h([l],u,c.parentNode,void 0,!1,s),u.length>0){c.parentNode.replaceChild(u[0],c);for(let y=1;y<u.length;y++)c.parentNode?.insertBefore(u[y],u[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(r)){h(r,n,t,o,a,s,f);continue}if(v(r)){n.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let c=r;if(typeof c.type=="function"){let l=c.type(c.props||{});Array.isArray(l)?h(l,n,t,o,!1,s):h([l],n,t,o,!1,s);continue}}if(typeof r=="string"||typeof r=="number"){let c=String(r);if(c.trim()===""&&c!==" ")continue;n.push(T(c));continue}n.push(T(String(r)))}}}}function Te(e,n,t,o){for(let u=0;u<t.length;u++)t[u].parentNode!==null&&t[u].parentNode!==e&&(t=t.slice(),t[u]=t[u].cloneNode(!0));let a=t.length,s=n.length,f=a,i=0,r=0,c=s>0?n[s-1].nextSibling??void 0:o,l=null;for(;i<s||r<f;){if(n[i]===t[r]){i++,r++;continue}for(;s>i&&f>r&&n[s-1]===t[f-1];)s--,f--;if(s===i){let u=f<a?r?t[r-1].nextSibling??void 0:t[f-r]:c;for(;r<f;)d(e,t[r++],u)}else if(f===r)for(;i<s;)(!l||!l.has(n[i]))&&n[i].parentNode===e&&e.removeChild(n[i]),i++;else if(n[i]===t[f-1]&&t[r]===n[s-1]){let u=n[--s].nextSibling;d(e,t[r++],n[i++].nextSibling),d(e,t[--f],u),n[s]=n[i-1]}else{if(!l){l=new Map;let y=r;for(;y<f;)l.set(t[y],y++)}let u=l.get(n[i]);if(u!=null)if(r<u&&u<f){let y=i,L=1;for(;++y<s&&y<f&&!(!l.has(n[y])||l.get(n[y])!==u+L);)L++;if(L>u-r){let ce=n[i];for(;r<u;)d(e,t[r++],ce)}else n[i].parentNode===e?e.replaceChild(t[r++],n[i++]):(d(e,t[r++],c),i++)}else i++;else n[i].parentNode===e&&e.removeChild(n[i]),i++}}return t}function E(e,n,t){if(n)if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o].parentNode===e&&e.removeChild(n[o]);else n.parentNode===e&&e.removeChild(n);return null}function d(e,n,t){g.active&&n.parentNode===e||(t&&t.parentNode===e?e.insertBefore(n,t):e.appendChild(n))}function te(e,n){if(e){if(v(e)){let t=n,o=e;if(!t)return;typeof t=="function"?t(o):typeof t=="object"&&"current"in t&&(t.current=o);return}typeof e=="function"?e(n):typeof e=="object"&&"current"in e&&(e.current=n)}}function M(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function oe(e){let n=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,t,o;return(0,R.createRoot)(a=>{t=a,o=document.createElement("div"),o.style.display="contents",n().appendChild(o),D(o,e.children)&&te(e.ref,o)}),(0,R.onCleanup)(()=>{t(),o.remove()}),null}var k=require("@fluixi/reactive/signal");function re(e){let[n,t]=(0,k.createSignal)(null),o=()=>t(null);return(0,k.createMemo)(()=>{let a=n();if(a!==null)return typeof e.fallback=="function"?e.fallback(a,o):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return t(s),typeof e.fallback=="function"?e.fallback(s,o):e.fallback}})}var ie=require("@fluixi/reactive/signal");function se(e){return(0,ie.createMemo)(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,a]of Object.entries(n)){if(!o)continue;(typeof a=="function"?a():a)&&t.push(o)}return t.join(" ")})}var fe=require("@fluixi/reactive/signal");function be(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function ae(e){return(0,fe.createMemo)(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,a]of Object.entries(n)){if(!o)continue;let s=typeof a=="function"?a():a;s!=null&&t.push(`${be(o)}: ${s}`)}return t.join("; ")})}
|
|
1
|
+
"use strict";var _=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var he=Object.prototype.hasOwnProperty;var me=(e,n)=>{for(var t in n)_(e,t,{get:n[t],enumerable:!0})},xe=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of pe(n))!he.call(e,a)&&a!==t&&_(e,a,{get:()=>n[a],enumerable:!(o=de(n,a))||o.enumerable});return e};var ge=e=>xe(_({},"__esModule",{value:!0}),e);var Pe={};me(Pe,{ClientOnly:()=>O,Dynamic:()=>Q,ErrorBoundary:()=>fe,For:()=>q,Index:()=>G,Match:()=>J,NoSsr:()=>se,Portal:()=>ie,Show:()=>V,Switch:()=>Y,classMap:()=>ce,indexArray:()=>P.indexArray,keyArray:()=>P.keyArray,mapArray:()=>P.mapArray,styleMap:()=>ue});module.exports=ge(Pe);var N=require("@fluixi/reactive/signal");function I(e){return typeof e=="function"?e:(()=>e)}function g(e){return()=>{let n=e();return typeof n=="function"?n():n}}function W(e){return e!=null&&e!==!1}function K(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function V(e){let n=g(()=>e.when),t=(0,N.createMemo)(n,void 0),o=(0,N.createMemo)(t,void 0);return(0,N.createMemo)(()=>{if(o()){let s=e.children;return typeof s=="function"&&!K(s)?typeof t=="function"?(0,N.untrack)(()=>(0,N.untrack)(t)?s(t()):e.fallback):s(t):s}return e.fallback},void 0,{name:"show"})}var w=require("@fluixi/reactive/signal");var h={active:!1,cursor:null,parents:[]},be=null;function B(){return be}function $(e,n){return h.active&&n.parentNode===e}function D(e){let n=h.parents.lastIndexOf(e);n!==-1&&(h.parents.length=n),h.cursor=e.nextSibling}function S(e){if(!h.active||e==null)return;let n=Array.isArray(e)?e[e.length-1]:e;n&&typeof n.nodeType=="number"&&D(n)}function q(e){let n=g(()=>e.each),t=()=>e.fallback??null,o=(a,s)=>{let f=e.children,i=Array.isArray(f)?f.map(r=>typeof r=="function"?r(a,s):r):typeof f=="function"?f(a,s):f;return S(i),i};return e.by?(0,w.keyArray)(n,e.by,(a,s)=>o(a,s),{fallback:t}):(0,w.mapArray)(n,(a,s)=>o(a,s),{fallback:t})}var z=require("@fluixi/reactive/signal");function G(e){let n=g(()=>e.each);return(0,z.indexArray)(n,(t,o)=>{let a=e.children(t,o);return S(a),a},{fallback:()=>e.fallback??null})}var P=require("@fluixi/reactive/signal");var X=require("@fluixi/reactive/signal");var H=Symbol("match");function J(e){return{[H]:!0,when:g(()=>e.when),children:e.children}}function Y(e){let n=Array.isArray(e.children)?e.children:[e.children];return(0,X.createMemo)(()=>{for(let t of n){let o=t,a=0;for(;typeof o=="function"&&!o[H]&&a++<10;)o=o();if(!o||typeof o!="object"||o[H]!==!0)continue;let s=o.when();if(W(s))return typeof o.children=="function"?o.children(s):o.children}return e.fallback??null})}var Z=require("@fluixi/reactive/signal");function Q(e){let n=I(e.component),{component:t,...o}=e;return(0,Z.createMemo)(()=>{let a=n();return a==null?null:typeof a=="string"?{tag:a,props:o}:a(o)})}var k=require("@fluixi/reactive/signal");var p=require("@fluixi/reactive/signal");function A(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var T=require("@fluixi/reactive/signal");var C=typeof document>"u";var ne=Symbol.for("fluixi.server-node"),ee=null;function te(){if(!ee)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ee}function v(e){return e!=null&&e[ne]===!0?!0:typeof Node<"u"&&e instanceof Node}function oe(e){return e!=null&&e[ne]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}function b(e,n=!1){if(C)return te().createText(e);if(h.active&&!n){let t=B()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}var x=0,Te=200;function Ne(e,n,t,o,a){let s=o,f=new Map;return(0,T.createRenderEffect)(()=>{let i;if(A(e)&&!(0,p.isSignal)(e)){if(!f.has(e)){x++;try{let r=e();f.set(e,r)}finally{x--}}for(i=f.get(e);typeof i=="function"&&(0,p.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,p.isSignal)(i);)i=i();{let r=0;for(;typeof i=="function"&&r++<50;)if(A(i)){if(!f.has(i)){let c=i;x++;try{let l=c();f.set(c,l)}finally{x--}}i=f.get(i)}else if((0,p.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,p.isSignal)(i)&&!A(i))break}x++;try{s=R(n,i,t,s,f),a(s)}finally{x--}})}function U(e,n,t,o){if(x>Te)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=b("",!0),e.appendChild(t));let a=o??null,s=r=>Array.isArray(r)&&r.some(c=>typeof c=="function"),f=r=>typeof r=="function"?r:()=>r;if(typeof n!="function"&&!s(n)){x++;try{a=R(e,n,t,null)}finally{x--}return()=>a}let i=Ne(f(n),e,t,a,r=>{a=r});return()=>(i?.(),a)}function R(e,n,t,o,a){if(n==null||typeof n=="boolean")return E(e,o,t);if(typeof n=="function")for(;typeof n=="function";)n=n();if(n==null||typeof n=="boolean")return E(e,o,t);if(M(n)){let f=b("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),E(e,o.slice(1),t)):d(e,f,t):o?e.replaceChild(f,o):d(e,f,t),n.then(i=>{f.parentNode===e&&R(e,i,f.nextSibling,f)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),f}let s=typeof n;if(s==="string"||s==="number"){if(s==="number"&&(n=String(n)),Array.isArray(o)){if(o.length===0){let i=b(n);return d(e,i,t),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=n,o;o=E(e,o,t)}if(o&&oe(o))return o.data=n,o;let f=b(n);return o&&o.parentNode===e?e.replaceChild(f,o):$(e,f)||d(e,f,t),f}if(v(n))return $(e,n)?(D(n),n):Array.isArray(o)?(o.length===0?d(e,n,t):o[0].parentNode===e?(e.replaceChild(n,o[0]),E(e,o.slice(1),t)):d(e,n,t),n):(o?o!==n&&(o.parentNode===e?e.replaceChild(n,o):d(e,n,t)):d(e,n,t),n);if(Array.isArray(n)){let f=[],i=Array.isArray(o)?o:o?[o]:[],r=[];m(n,f,e,t,!0,a,r);let c=Ae(e,i,f,t);for(let l of r){let u=U(e,l.sig,l.marker);(0,T.onCleanup)(()=>{E(e,u()),l.marker.parentNode===e&&e.removeChild(l.marker)})}return c}if(s==="object"&&n!==null&&typeof n=="object"){let f=n;if("type"in f&&"props"in f){let i=f;if(typeof i.type=="function"){let r=i.type(i.props||{});return R(e,r,t,o)}}}return E(e,o,t)}function m(e,n,t,o,a=!0,s,f){for(let i=0;i<e.length;i++){let r=e[i];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!M(r)&&!(0,p.isSignal)(r)&&!A(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let c;for(A(r)&&!(0,p.isSignal)(r)?(s||(s=new Map),s.has(r)||s.set(r,r()),c=s.get(r)):c=r();typeof c=="function"&&!M(c)&&!(0,p.isSignal)(c)&&!A(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,p.isSignal)(c)){if(f){let u=b("",!0);n.push(u),f.push({marker:u,sig:c});continue}let l=c();for(;typeof l=="function"&&(0,p.isSignal)(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?m(l,n,t,o,a,s):m([l],n,t,o,a,s);continue}continue}Array.isArray(c)?m(c,n,t,o,a,s,f):m([c],n,t,o,a,s,f);continue}if(M(r)){let c=b("",!0);n.push(c),r.then(l=>{if(c.parentNode){let u=[];if(m([l],u,c.parentNode,void 0,!1,s),u.length>0){c.parentNode.replaceChild(u[0],c);for(let y=1;y<u.length;y++)c.parentNode?.insertBefore(u[y],u[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(r)){m(r,n,t,o,a,s,f);continue}if(v(r)){n.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let c=r;if(typeof c.type=="function"){let l=c.type(c.props||{});Array.isArray(l)?m(l,n,t,o,!1,s):m([l],n,t,o,!1,s);continue}}if(typeof r=="string"||typeof r=="number"){let c=String(r);if(c.trim()===""&&c!==" ")continue;n.push(b(c));continue}n.push(b(String(r)))}}}}function Ae(e,n,t,o){for(let u=0;u<t.length;u++)t[u].parentNode!==null&&t[u].parentNode!==e&&(t=t.slice(),t[u]=t[u].cloneNode(!0));let a=t.length,s=n.length,f=a,i=0,r=0,c=s>0?n[s-1].nextSibling??void 0:o,l=null;for(;i<s||r<f;){if(n[i]===t[r]){i++,r++;continue}for(;s>i&&f>r&&n[s-1]===t[f-1];)s--,f--;if(s===i){let u=f<a?r?t[r-1].nextSibling??void 0:t[f-r]:c;for(;r<f;)d(e,t[r++],u)}else if(f===r)for(;i<s;)(!l||!l.has(n[i]))&&n[i].parentNode===e&&e.removeChild(n[i]),i++;else if(n[i]===t[f-1]&&t[r]===n[s-1]){let u=n[--s].nextSibling;d(e,t[r++],n[i++].nextSibling),d(e,t[--f],u),n[s]=n[i-1]}else{if(!l){l=new Map;let y=r;for(;y<f;)l.set(t[y],y++)}let u=l.get(n[i]);if(u!=null)if(r<u&&u<f){let y=i,F=1;for(;++y<s&&y<f&&!(!l.has(n[y])||l.get(n[y])!==u+F);)F++;if(F>u-r){let ye=n[i];for(;r<u;)d(e,t[r++],ye)}else n[i].parentNode===e?e.replaceChild(t[r++],n[i++]):(d(e,t[r++],c),i++)}else i++;else n[i].parentNode===e&&e.removeChild(n[i]),i++}}return t}function E(e,n,t){if(n)if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o].parentNode===e&&e.removeChild(n[o]);else n.parentNode===e&&e.removeChild(n);return null}function d(e,n,t){h.active&&n.parentNode===e||(t&&t.parentNode===e?e.insertBefore(n,t):e.appendChild(n))}function re(e,n){if(e){if(v(e)){let t=n,o=e;if(!t)return;typeof t=="function"?t(o):typeof t=="object"&&"current"in t&&(t.current=o);return}typeof e=="function"?e(n):typeof e=="object"&&"current"in e&&(e.current=n)}}function M(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ie(e){let n=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,t,o;return(0,k.createRoot)(a=>{t=a,o=document.createElement("div"),o.style.display="contents",n().appendChild(o),U(o,e.children)&&re(e.ref,o)}),(0,k.onCleanup)(()=>{t(),o.remove()}),null}var L=require("@fluixi/reactive/signal");function O(e){if(C)return e.fallback??null;let n=h.active,[t,o]=(0,L.createSignal)(!n);return n&&queueMicrotask(()=>o(!0)),(0,L.createMemo)(()=>t()?e.children:e.fallback??null,void 0,{name:"client-only"})}var se=O;var j=require("@fluixi/reactive/signal");function fe(e){let[n,t]=(0,j.createSignal)(null),o=()=>t(null);return(0,j.createMemo)(()=>{let a=n();if(a!==null)return typeof e.fallback=="function"?e.fallback(a,o):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return t(s),typeof e.fallback=="function"?e.fallback(s,o):e.fallback}})}var ae=require("@fluixi/reactive/signal");function ce(e){return(0,ae.createMemo)(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,a]of Object.entries(n)){if(!o)continue;(typeof a=="function"?a():a)&&t.push(o)}return t.join(" ")})}var le=require("@fluixi/reactive/signal");function Ee(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function ue(e){return(0,le.createMemo)(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,a]of Object.entries(n)){if(!o)continue;let s=typeof a=="function"?a():a;s!=null&&t.push(`${Ee(o)}: ${s}`)}return t.join("; ")})}
|
package/dist/lib/flow/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export { Dynamic } from './dynamic.js';
|
|
|
11
11
|
export type { DynamicProps } from './dynamic.js';
|
|
12
12
|
export { Portal } from './portal.js';
|
|
13
13
|
export type { PortalProps } from './portal.js';
|
|
14
|
+
export { ClientOnly, NoSsr } from './client-only.js';
|
|
15
|
+
export type { ClientOnlyProps, NoSsrProps } from './client-only.js';
|
|
14
16
|
export { ErrorBoundary } from './error-boundary.js';
|
|
15
17
|
export type { ErrorBoundaryProps } from './error-boundary.js';
|
|
16
18
|
export { classMap } from './class-map.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/flow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/flow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/lib/flow/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { mapArray, keyArray, indexArray } from '@fluixi/reactive/signal';
|
|
|
6
6
|
export { Switch, Match } from './switch.js';
|
|
7
7
|
export { Dynamic } from './dynamic.js';
|
|
8
8
|
export { Portal } from './portal.js';
|
|
9
|
+
export { ClientOnly, NoSsr } from './client-only.js';
|
|
9
10
|
export { ErrorBoundary } from './error-boundary.js';
|
|
10
11
|
export { classMap } from './class-map.js';
|
|
11
12
|
export { styleMap } from './style-map.js';
|
package/dist/lib/flow/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createMemo as v,untrack as _}from"@fluixi/reactive/signal";function L(e){return typeof e=="function"?e:(()=>e)}function x(e){return()=>{let n=e();return typeof n=="function"?n():n}}function j(e){return e!=null&&e!==!1}function F(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function V(e){let n=x(()=>e.when),t=v(n,void 0),o=v(t,void 0);return v(()=>{if(o()){let s=e.children;return typeof s=="function"&&!F(s)?typeof t=="function"?_(()=>_(t)?s(t()):e.fallback):s(t):s}return e.fallback},void 0,{name:"show"})}import{mapArray as q,keyArray as z}from"@fluixi/reactive/signal";var g={active:!1,cursor:null,parents:[]},B=null;function $(){return B}function M(e,n){return g.active&&n.parentNode===e}function C(e){let n=g.parents.lastIndexOf(e);n!==-1&&(g.parents.length=n),g.cursor=e.nextSibling}function A(e){if(!g.active||e==null)return;let n=Array.isArray(e)?e[e.length-1]:e;n&&typeof n.nodeType=="number"&&C(n)}function G(e){let n=x(()=>e.each),t=()=>e.fallback??null,o=(a,s)=>{let f=e.children,i=Array.isArray(f)?f.map(r=>typeof r=="function"?r(a,s):r):typeof f=="function"?f(a,s):f;return A(i),i};return e.by?z(n,e.by,(a,s)=>o(a,s),{fallback:t}):q(n,(a,s)=>o(a,s),{fallback:t})}import{indexArray as X}from"@fluixi/reactive/signal";function J(e){let n=x(()=>e.each);return X(n,(t,o)=>{let a=e.children(t,o);return A(a),a},{fallback:()=>e.fallback??null})}import{mapArray as wn,keyArray as Pn,indexArray as Sn}from"@fluixi/reactive/signal";import{createMemo as Y}from"@fluixi/reactive/signal";var R=Symbol("match");function Z(e){return{[R]:!0,when:x(()=>e.when),children:e.children}}function Q(e){let n=Array.isArray(e.children)?e.children:[e.children];return Y(()=>{for(let t of n){let o=t,a=0;for(;typeof o=="function"&&!o[R]&&a++<10;)o=o();if(!o||typeof o!="object"||o[R]!==!0)continue;let s=o.when();if(j(s))return typeof o.children=="function"?o.children(s):o.children}return e.fallback??null})}import{createMemo as ee}from"@fluixi/reactive/signal";function ne(e){let n=L(e.component),{component:t,...o}=e;return ee(()=>{let a=n();return a==null?null:typeof a=="string"?{tag:a,props:o}:a(o)})}import{createRoot as fe,onCleanup as ae}from"@fluixi/reactive/signal";import{isSignal as p}from"@fluixi/reactive/signal";function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Je,createEffect as Ye,createRenderEffect as te,createRoot as Ze,onCleanup as oe,readChildren as Qe}from"@fluixi/reactive/signal";var H=typeof document>"u";var U=Symbol.for("fluixi.server-node"),D=null;function O(){if(!D)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return D}function E(e){return e!=null&&e[U]===!0?!0:typeof Node<"u"&&e instanceof Node}function I(e){return e!=null&&e[U]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}function T(e,n=!1){if(H)return O().createText(e);if(g.active&&!n){let t=$()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}var m=0,re=200;function ie(e,n,t,o,a){let s=o,f=new Map;return te(()=>{let i;if(b(e)&&!p(e)){if(!f.has(e)){m++;try{let r=e();f.set(e,r)}finally{m--}}for(i=f.get(e);typeof i=="function"&&p(i);)i=i()}else for(i=e();typeof i=="function"&&p(i);)i=i();{let r=0;for(;typeof i=="function"&&r++<50;)if(b(i)){if(!f.has(i)){let c=i;m++;try{let l=c();f.set(c,l)}finally{m--}}i=f.get(i)}else if(p(i))i=i();else if(i=i(),typeof i!="function"||!p(i)&&!b(i))break}m++;try{s=P(n,i,t,s,f),a(s)}finally{m--}})}function k(e,n,t,o){if(m>re)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=T("",!0),e.appendChild(t));let a=o??null,s=r=>Array.isArray(r)&&r.some(c=>typeof c=="function"),f=r=>typeof r=="function"?r:()=>r;if(typeof n!="function"&&!s(n)){m++;try{a=P(e,n,t,null)}finally{m--}return()=>a}let i=ie(f(n),e,t,a,r=>{a=r});return()=>(i?.(),a)}function P(e,n,t,o,a){if(n==null||typeof n=="boolean")return N(e,o,t);if(typeof n=="function")for(;typeof n=="function";)n=n();if(n==null||typeof n=="boolean")return N(e,o,t);if(w(n)){let f=T("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),N(e,o.slice(1),t)):d(e,f,t):o?e.replaceChild(f,o):d(e,f,t),n.then(i=>{f.parentNode===e&&P(e,i,f.nextSibling,f)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),f}let s=typeof n;if(s==="string"||s==="number"){if(s==="number"&&(n=String(n)),Array.isArray(o)){if(o.length===0){let i=T(n);return d(e,i,t),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=n,o;o=N(e,o,t)}if(o&&I(o))return o.data=n,o;let f=T(n);return o&&o.parentNode===e?e.replaceChild(f,o):M(e,f)||d(e,f,t),f}if(E(n))return M(e,n)?(C(n),n):Array.isArray(o)?(o.length===0?d(e,n,t):o[0].parentNode===e?(e.replaceChild(n,o[0]),N(e,o.slice(1),t)):d(e,n,t),n):(o?o!==n&&(o.parentNode===e?e.replaceChild(n,o):d(e,n,t)):d(e,n,t),n);if(Array.isArray(n)){let f=[],i=Array.isArray(o)?o:o?[o]:[],r=[];h(n,f,e,t,!0,a,r);let c=se(e,i,f,t);for(let l of r){let u=k(e,l.sig,l.marker);oe(()=>{N(e,u()),l.marker.parentNode===e&&e.removeChild(l.marker)})}return c}if(s==="object"&&n!==null&&typeof n=="object"){let f=n;if("type"in f&&"props"in f){let i=f;if(typeof i.type=="function"){let r=i.type(i.props||{});return P(e,r,t,o)}}}return N(e,o,t)}function h(e,n,t,o,a=!0,s,f){for(let i=0;i<e.length;i++){let r=e[i];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!w(r)&&!p(r)&&!b(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let c;for(b(r)&&!p(r)?(s||(s=new Map),s.has(r)||s.set(r,r()),c=s.get(r)):c=r();typeof c=="function"&&!w(c)&&!p(c)&&!b(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(p(c)){if(f){let u=T("",!0);n.push(u),f.push({marker:u,sig:c});continue}let l=c();for(;typeof l=="function"&&p(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?h(l,n,t,o,a,s):h([l],n,t,o,a,s);continue}continue}Array.isArray(c)?h(c,n,t,o,a,s,f):h([c],n,t,o,a,s,f);continue}if(w(r)){let c=T("",!0);n.push(c),r.then(l=>{if(c.parentNode){let u=[];if(h([l],u,c.parentNode,void 0,!1,s),u.length>0){c.parentNode.replaceChild(u[0],c);for(let y=1;y<u.length;y++)c.parentNode?.insertBefore(u[y],u[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(r)){h(r,n,t,o,a,s,f);continue}if(E(r)){n.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let c=r;if(typeof c.type=="function"){let l=c.type(c.props||{});Array.isArray(l)?h(l,n,t,o,!1,s):h([l],n,t,o,!1,s);continue}}if(typeof r=="string"||typeof r=="number"){let c=String(r);if(c.trim()===""&&c!==" ")continue;n.push(T(c));continue}n.push(T(String(r)))}}}}function se(e,n,t,o){for(let u=0;u<t.length;u++)t[u].parentNode!==null&&t[u].parentNode!==e&&(t=t.slice(),t[u]=t[u].cloneNode(!0));let a=t.length,s=n.length,f=a,i=0,r=0,c=s>0?n[s-1].nextSibling??void 0:o,l=null;for(;i<s||r<f;){if(n[i]===t[r]){i++,r++;continue}for(;s>i&&f>r&&n[s-1]===t[f-1];)s--,f--;if(s===i){let u=f<a?r?t[r-1].nextSibling??void 0:t[f-r]:c;for(;r<f;)d(e,t[r++],u)}else if(f===r)for(;i<s;)(!l||!l.has(n[i]))&&n[i].parentNode===e&&e.removeChild(n[i]),i++;else if(n[i]===t[f-1]&&t[r]===n[s-1]){let u=n[--s].nextSibling;d(e,t[r++],n[i++].nextSibling),d(e,t[--f],u),n[s]=n[i-1]}else{if(!l){l=new Map;let y=r;for(;y<f;)l.set(t[y],y++)}let u=l.get(n[i]);if(u!=null)if(r<u&&u<f){let y=i,S=1;for(;++y<s&&y<f&&!(!l.has(n[y])||l.get(n[y])!==u+S);)S++;if(S>u-r){let K=n[i];for(;r<u;)d(e,t[r++],K)}else n[i].parentNode===e?e.replaceChild(t[r++],n[i++]):(d(e,t[r++],c),i++)}else i++;else n[i].parentNode===e&&e.removeChild(n[i]),i++}}return t}function N(e,n,t){if(n)if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o].parentNode===e&&e.removeChild(n[o]);else n.parentNode===e&&e.removeChild(n);return null}function d(e,n,t){g.active&&n.parentNode===e||(t&&t.parentNode===e?e.insertBefore(n,t):e.appendChild(n))}function W(e,n){if(e){if(E(e)){let t=n,o=e;if(!t)return;typeof t=="function"?t(o):typeof t=="object"&&"current"in t&&(t.current=o);return}typeof e=="function"?e(n):typeof e=="object"&&"current"in e&&(e.current=n)}}function w(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ce(e){let n=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,t,o;return fe(a=>{t=a,o=document.createElement("div"),o.style.display="contents",n().appendChild(o),k(o,e.children)&&W(e.ref,o)}),ae(()=>{t(),o.remove()}),null}import{createMemo as le,createSignal as ue}from"@fluixi/reactive/signal";function ye(e){let[n,t]=ue(null),o=()=>t(null);return le(()=>{let a=n();if(a!==null)return typeof e.fallback=="function"?e.fallback(a,o):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return t(s),typeof e.fallback=="function"?e.fallback(s,o):e.fallback}})}import{createMemo as de}from"@fluixi/reactive/signal";function pe(e){return de(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,a]of Object.entries(n)){if(!o)continue;(typeof a=="function"?a():a)&&t.push(o)}return t.join(" ")})}import{createMemo as he}from"@fluixi/reactive/signal";function me(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function xe(e){return he(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,a]of Object.entries(n)){if(!o)continue;let s=typeof a=="function"?a():a;s!=null&&t.push(`${me(o)}: ${s}`)}return t.join("; ")})}export{ne as Dynamic,ye as ErrorBoundary,G as For,J as Index,Z as Match,ce as Portal,V as Show,Q as Switch,pe as classMap,Sn as indexArray,Pn as keyArray,wn as mapArray,xe as styleMap};
|
|
1
|
+
import{createMemo as v,untrack as $}from"@fluixi/reactive/signal";function j(e){return typeof e=="function"?e:(()=>e)}function g(e){return()=>{let n=e();return typeof n=="function"?n():n}}function F(e){return e!=null&&e!==!1}function _(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function B(e){let n=g(()=>e.when),t=v(n,void 0),o=v(t,void 0);return v(()=>{if(o()){let s=e.children;return typeof s=="function"&&!_(s)?typeof t=="function"?$(()=>$(t)?s(t()):e.fallback):s(t):s}return e.fallback},void 0,{name:"show"})}import{mapArray as z,keyArray as G}from"@fluixi/reactive/signal";var p={active:!1,cursor:null,parents:[]},q=null;function D(){return q}function M(e,n){return p.active&&n.parentNode===e}function R(e){let n=p.parents.lastIndexOf(e);n!==-1&&(p.parents.length=n),p.cursor=e.nextSibling}function A(e){if(!p.active||e==null)return;let n=Array.isArray(e)?e[e.length-1]:e;n&&typeof n.nodeType=="number"&&R(n)}function X(e){let n=g(()=>e.each),t=()=>e.fallback??null,o=(a,s)=>{let f=e.children,i=Array.isArray(f)?f.map(r=>typeof r=="function"?r(a,s):r):typeof f=="function"?f(a,s):f;return A(i),i};return e.by?G(n,e.by,(a,s)=>o(a,s),{fallback:t}):z(n,(a,s)=>o(a,s),{fallback:t})}import{indexArray as J}from"@fluixi/reactive/signal";function Y(e){let n=g(()=>e.each);return J(n,(t,o)=>{let a=e.children(t,o);return A(a),a},{fallback:()=>e.fallback??null})}import{mapArray as Ln,keyArray as jn,indexArray as Fn}from"@fluixi/reactive/signal";import{createMemo as Z}from"@fluixi/reactive/signal";var k=Symbol("match");function Q(e){return{[k]:!0,when:g(()=>e.when),children:e.children}}function ee(e){let n=Array.isArray(e.children)?e.children:[e.children];return Z(()=>{for(let t of n){let o=t,a=0;for(;typeof o=="function"&&!o[k]&&a++<10;)o=o();if(!o||typeof o!="object"||o[k]!==!0)continue;let s=o.when();if(F(s))return typeof o.children=="function"?o.children(s):o.children}return e.fallback??null})}import{createMemo as ne}from"@fluixi/reactive/signal";function te(e){let n=j(e.component),{component:t,...o}=e;return ne(()=>{let a=n();return a==null?null:typeof a=="string"?{tag:a,props:o}:a(o)})}import{createRoot as ae,onCleanup as ce}from"@fluixi/reactive/signal";import{isSignal as h}from"@fluixi/reactive/signal";function T(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as en,createEffect as nn,createRenderEffect as oe,createRoot as tn,onCleanup as re,readChildren as on}from"@fluixi/reactive/signal";var E=typeof document>"u";var U=Symbol.for("fluixi.server-node"),H=null;function O(){if(!H)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return H}function P(e){return e!=null&&e[U]===!0?!0:typeof Node<"u"&&e instanceof Node}function I(e){return e!=null&&e[U]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}function b(e,n=!1){if(E)return O().createText(e);if(p.active&&!n){let t=D()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}var x=0,ie=200;function se(e,n,t,o,a){let s=o,f=new Map;return oe(()=>{let i;if(T(e)&&!h(e)){if(!f.has(e)){x++;try{let r=e();f.set(e,r)}finally{x--}}for(i=f.get(e);typeof i=="function"&&h(i);)i=i()}else for(i=e();typeof i=="function"&&h(i);)i=i();{let r=0;for(;typeof i=="function"&&r++<50;)if(T(i)){if(!f.has(i)){let c=i;x++;try{let l=c();f.set(c,l)}finally{x--}}i=f.get(i)}else if(h(i))i=i();else if(i=i(),typeof i!="function"||!h(i)&&!T(i))break}x++;try{s=w(n,i,t,s,f),a(s)}finally{x--}})}function L(e,n,t,o){if(x>ie)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=b("",!0),e.appendChild(t));let a=o??null,s=r=>Array.isArray(r)&&r.some(c=>typeof c=="function"),f=r=>typeof r=="function"?r:()=>r;if(typeof n!="function"&&!s(n)){x++;try{a=w(e,n,t,null)}finally{x--}return()=>a}let i=se(f(n),e,t,a,r=>{a=r});return()=>(i?.(),a)}function w(e,n,t,o,a){if(n==null||typeof n=="boolean")return N(e,o,t);if(typeof n=="function")for(;typeof n=="function";)n=n();if(n==null||typeof n=="boolean")return N(e,o,t);if(S(n)){let f=b("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),N(e,o.slice(1),t)):d(e,f,t):o?e.replaceChild(f,o):d(e,f,t),n.then(i=>{f.parentNode===e&&w(e,i,f.nextSibling,f)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),f}let s=typeof n;if(s==="string"||s==="number"){if(s==="number"&&(n=String(n)),Array.isArray(o)){if(o.length===0){let i=b(n);return d(e,i,t),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=n,o;o=N(e,o,t)}if(o&&I(o))return o.data=n,o;let f=b(n);return o&&o.parentNode===e?e.replaceChild(f,o):M(e,f)||d(e,f,t),f}if(P(n))return M(e,n)?(R(n),n):Array.isArray(o)?(o.length===0?d(e,n,t):o[0].parentNode===e?(e.replaceChild(n,o[0]),N(e,o.slice(1),t)):d(e,n,t),n):(o?o!==n&&(o.parentNode===e?e.replaceChild(n,o):d(e,n,t)):d(e,n,t),n);if(Array.isArray(n)){let f=[],i=Array.isArray(o)?o:o?[o]:[],r=[];m(n,f,e,t,!0,a,r);let c=fe(e,i,f,t);for(let l of r){let u=L(e,l.sig,l.marker);re(()=>{N(e,u()),l.marker.parentNode===e&&e.removeChild(l.marker)})}return c}if(s==="object"&&n!==null&&typeof n=="object"){let f=n;if("type"in f&&"props"in f){let i=f;if(typeof i.type=="function"){let r=i.type(i.props||{});return w(e,r,t,o)}}}return N(e,o,t)}function m(e,n,t,o,a=!0,s,f){for(let i=0;i<e.length;i++){let r=e[i];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!S(r)&&!h(r)&&!T(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let c;for(T(r)&&!h(r)?(s||(s=new Map),s.has(r)||s.set(r,r()),c=s.get(r)):c=r();typeof c=="function"&&!S(c)&&!h(c)&&!T(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(h(c)){if(f){let u=b("",!0);n.push(u),f.push({marker:u,sig:c});continue}let l=c();for(;typeof l=="function"&&h(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?m(l,n,t,o,a,s):m([l],n,t,o,a,s);continue}continue}Array.isArray(c)?m(c,n,t,o,a,s,f):m([c],n,t,o,a,s,f);continue}if(S(r)){let c=b("",!0);n.push(c),r.then(l=>{if(c.parentNode){let u=[];if(m([l],u,c.parentNode,void 0,!1,s),u.length>0){c.parentNode.replaceChild(u[0],c);for(let y=1;y<u.length;y++)c.parentNode?.insertBefore(u[y],u[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(r)){m(r,n,t,o,a,s,f);continue}if(P(r)){n.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let c=r;if(typeof c.type=="function"){let l=c.type(c.props||{});Array.isArray(l)?m(l,n,t,o,!1,s):m([l],n,t,o,!1,s);continue}}if(typeof r=="string"||typeof r=="number"){let c=String(r);if(c.trim()===""&&c!==" ")continue;n.push(b(c));continue}n.push(b(String(r)))}}}}function fe(e,n,t,o){for(let u=0;u<t.length;u++)t[u].parentNode!==null&&t[u].parentNode!==e&&(t=t.slice(),t[u]=t[u].cloneNode(!0));let a=t.length,s=n.length,f=a,i=0,r=0,c=s>0?n[s-1].nextSibling??void 0:o,l=null;for(;i<s||r<f;){if(n[i]===t[r]){i++,r++;continue}for(;s>i&&f>r&&n[s-1]===t[f-1];)s--,f--;if(s===i){let u=f<a?r?t[r-1].nextSibling??void 0:t[f-r]:c;for(;r<f;)d(e,t[r++],u)}else if(f===r)for(;i<s;)(!l||!l.has(n[i]))&&n[i].parentNode===e&&e.removeChild(n[i]),i++;else if(n[i]===t[f-1]&&t[r]===n[s-1]){let u=n[--s].nextSibling;d(e,t[r++],n[i++].nextSibling),d(e,t[--f],u),n[s]=n[i-1]}else{if(!l){l=new Map;let y=r;for(;y<f;)l.set(t[y],y++)}let u=l.get(n[i]);if(u!=null)if(r<u&&u<f){let y=i,C=1;for(;++y<s&&y<f&&!(!l.has(n[y])||l.get(n[y])!==u+C);)C++;if(C>u-r){let V=n[i];for(;r<u;)d(e,t[r++],V)}else n[i].parentNode===e?e.replaceChild(t[r++],n[i++]):(d(e,t[r++],c),i++)}else i++;else n[i].parentNode===e&&e.removeChild(n[i]),i++}}return t}function N(e,n,t){if(n)if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o].parentNode===e&&e.removeChild(n[o]);else n.parentNode===e&&e.removeChild(n);return null}function d(e,n,t){p.active&&n.parentNode===e||(t&&t.parentNode===e?e.insertBefore(n,t):e.appendChild(n))}function W(e,n){if(e){if(P(e)){let t=n,o=e;if(!t)return;typeof t=="function"?t(o):typeof t=="object"&&"current"in t&&(t.current=o);return}typeof e=="function"?e(n):typeof e=="object"&&"current"in e&&(e.current=n)}}function S(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function le(e){let n=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,t,o;return ae(a=>{t=a,o=document.createElement("div"),o.style.display="contents",n().appendChild(o),L(o,e.children)&&W(e.ref,o)}),ce(()=>{t(),o.remove()}),null}import{createMemo as ue,createSignal as ye}from"@fluixi/reactive/signal";function K(e){if(E)return e.fallback??null;let n=p.active,[t,o]=ye(!n);return n&&queueMicrotask(()=>o(!0)),ue(()=>t()?e.children:e.fallback??null,void 0,{name:"client-only"})}var de=K;import{createMemo as pe,createSignal as he}from"@fluixi/reactive/signal";function me(e){let[n,t]=he(null),o=()=>t(null);return pe(()=>{let a=n();if(a!==null)return typeof e.fallback=="function"?e.fallback(a,o):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return t(s),typeof e.fallback=="function"?e.fallback(s,o):e.fallback}})}import{createMemo as xe}from"@fluixi/reactive/signal";function ge(e){return xe(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,a]of Object.entries(n)){if(!o)continue;(typeof a=="function"?a():a)&&t.push(o)}return t.join(" ")})}import{createMemo as be}from"@fluixi/reactive/signal";function Te(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function Ne(e){return be(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,a]of Object.entries(n)){if(!o)continue;let s=typeof a=="function"?a():a;s!=null&&t.push(`${Te(o)}: ${s}`)}return t.join("; ")})}export{K as ClientOnly,te as Dynamic,me as ErrorBoundary,X as For,Y as Index,Q as Match,de as NoSsr,le as Portal,B as Show,ee as Switch,ge as classMap,Fn as indexArray,jn as keyArray,Ln as mapArray,Ne as styleMap};
|