@fluixi/dom 1.0.0-alpha.60 → 1.0.0-alpha.62
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/dom/hydration.cjs +1 -1
- package/dist/lib/dom/hydration.mjs +1 -1
- package/dist/lib/dom/index.cjs +1 -1
- package/dist/lib/dom/index.mjs +1 -1
- package/dist/lib/dom/island.cjs +1 -1
- package/dist/lib/dom/island.mjs +1 -1
- package/dist/lib/dom/runtime.cjs +1 -1
- package/dist/lib/dom/runtime.d.ts.map +1 -1
- package/dist/lib/dom/runtime.js +59 -9
- package/dist/lib/dom/runtime.mjs +1 -1
- package/dist/lib/flow/index.cjs +1 -1
- package/dist/lib/flow/index.mjs +1 -1
- package/dist/lib/flow/portal.cjs +1 -1
- package/dist/lib/flow/portal.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/lib/dom/runtime.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSignal as y}from"@fluixi/reactive/signal";var H="http://www.w3.org/2000/svg";function re(e){return e.localName.includes("-")}function $(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(re(e)){e[t]=n;return}w(e,t,n,o)}var _=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function w(e,t,n,o=!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))}var me=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Y,createEffect as S,createRenderEffect as g,createRoot as fe,onCleanup as T,readChildren as le}from"@fluixi/reactive/signal";var v=typeof document>"u";var D=Symbol.for("fluixi.server-node"),q=null;function F(){if(!q)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return q}function A(e){return e!=null&&e[D]===!0?!0:typeof Node<"u"&&e instanceof Node}function G(e){return e!=null&&e[D]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function X(e){return e!=null&&e[D]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var x={active:!1,cursor:null,parents:[]},se=null;function W(){return se}function I(e,t){return x.active&&t.parentNode===e}function J(e){let t=x.parents.lastIndexOf(e);t!==-1&&(x.parents.length=t),x.cursor=e.nextSibling}function ae(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 o=0,f=e;for(;f=f.previousElementSibling;)f.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function ue(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 Me(e){return ue(ae(e))}var Oe=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),ce={};var z=new Map,C=new Set,R=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Z(e){if(!v)for(let t of e)C.has(t)||R.has(t)||(C.add(t),document.addEventListener(t,de))}function de(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function pe(e,t,n){if(e[`$$${t}`]=n,R.has(t)){let o=`__fx_${t}`;if(!e[o]){let f=l=>{e[`$$${t}`]?.(l)};e.addEventListener(t,f),e[o]=f}return}C.has(t)||Z([t])}function U(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Re(e){return!R.has(e)}function je(e){return typeof e=="function"}function b(e,t=!1){if(v)return F().createText(e);if(x.active&&!t){let n=W()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function He(e,t=!1){if(v)return F().createElement(e,t);if(x.active){let n=W()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(H,e):document.createElement(e)}function $e(e,t=!1){let n=z.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,z.set(e,o),o}function _e(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function ye(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?ye(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function De(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Fe(e){if(y(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!y(t)&&!h(t);)t=t();return t}var E=0,ge=200;function he(e,t,n,o,f){let l=o,s=new Map;return g(()=>{let i;if(h(e)&&!y(e)){if(!s.has(e)){E++;try{let r=e();s.set(e,r)}finally{E--}}for(i=s.get(e);typeof i=="function"&&y(i);)i=i()}else for(i=e();typeof i=="function"&&y(i);)i=i();{let r=0;for(;typeof i=="function"&&r++<50;)if(h(i)){if(!s.has(i)){let a=i;E++;try{let u=a();s.set(a,u)}finally{E--}}i=s.get(i)}else if(y(i))i=i();else if(i=i(),typeof i!="function"||!y(i)&&!h(i))break}E++;try{l=P(t,i,n,l,s),f(l)}finally{E--}})}function Q(e,t,n,o){if(E>ge)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=b("",!0),e.appendChild(n));let f=o??null;if(typeof t!="function"){E++;try{f=P(e,t,n,null)}finally{E--}return()=>f}let l=he(t,e,n,f,s=>{f=s});return()=>(l?.(),f)}function P(e,t,n,o,f){if(t==null||typeof t=="boolean")return N(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return N(e,o,n);if(L(t)){let s=b("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),N(e,o.slice(1),n)):p(e,s,n):o?e.replaceChild(s,o):p(e,s,n),t.then(i=>{s.parentNode===e&&P(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let l=typeof t;if(l==="string"||l==="number"){if(l==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=b(t);return p(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=N(e,o,n)}if(o&&X(o))return o.data=t,o;let s=b(t);return o&&o.parentNode===e?e.replaceChild(s,o):I(e,s)||p(e,s,n),s}if(A(t))return I(e,t)?(J(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),N(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],r=[];m(t,s,e,n,!0,f,r);let a=xe(e,i,s,n);for(let u of r){let c=Q(e,u.sig,u.marker);T(()=>{N(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return a}if(l==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let r=i.type(i.props||{});return P(e,r,n,o)}}}return N(e,o,n)}function m(e,t,n,o,f=!0,l,s){for(let i=0;i<e.length;i++){let r=e[i];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!L(r)&&!y(r)&&!h(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let a;for(h(r)&&!y(r)?(l||(l=new Map),l.has(r)||l.set(r,r()),a=l.get(r)):a=r();typeof a=="function"&&!L(a)&&!y(a)&&!h(a);)l||(l=new Map),l.has(a)||l.set(a,a()),a=l.get(a);if(a==null||typeof a=="boolean")continue;if(typeof a=="function"){if(y(a)){if(s){let c=b("",!0);t.push(c),s.push({marker:c,sig:a});continue}let u=a();for(;typeof u=="function"&&y(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?m(u,t,n,o,f,l):m([u],t,n,o,f,l);continue}continue}Array.isArray(a)?m(a,t,n,o,f,l,s):m([a],t,n,o,f,l,s);continue}if(L(r)){let a=b("",!0);t.push(a),r.then(u=>{if(a.parentNode){let c=[];if(m([u],c,a.parentNode,void 0,!1,l),c.length>0){a.parentNode.replaceChild(c[0],a);for(let d=1;d<c.length;d++)a.parentNode?.insertBefore(c[d],c[d-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(r)){m(r,t,n,o,f,l,s);continue}if(A(r)){t.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let a=r;if(typeof a.type=="function"){let u=a.type(a.props||{});Array.isArray(u)?m(u,t,n,o,!1,l):m([u],t,n,o,!1,l);continue}}if(typeof r=="string"||typeof r=="number"){let a=String(r);if(a.trim()===""&&a!==" ")continue;t.push(b(a));continue}t.push(b(String(r)))}}}}function xe(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let f=n.length,l=t.length,s=f,i=0,r=0,a=l>0?t[l-1].nextSibling??void 0:o,u=null;for(;i<l||r<s;){if(t[i]===n[r]){i++,r++;continue}for(;l>i&&s>r&&t[l-1]===n[s-1];)l--,s--;if(l===i){let c=s<f?r?n[r-1].nextSibling??void 0:n[s-r]:a;for(;r<s;)p(e,n[r++],c)}else if(s===r)for(;i<l;)(!u||!u.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[r]===t[l-1]){let c=t[--l].nextSibling;p(e,n[r++],t[i++].nextSibling),p(e,n[--s],c),t[l]=t[i-1]}else{if(!u){u=new Map;let d=r;for(;d<s;)u.set(n[d],d++)}let c=u.get(t[i]);if(c!=null)if(r<c&&c<s){let d=i,j=1;for(;++d<l&&d<s&&!(!u.has(t[d])||u.get(t[d])!==c+j);)j++;if(j>c-r){let ie=t[i];for(;r<c;)p(e,n[r++],ie)}else t[i].parentNode===e?e.replaceChild(n[r++],t[i++]):(p(e,n[r++],a),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function N(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function p(e,t,n){x.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function k(e,t,n){n==null?delete e[t]:e[t]=n}function ee(e,t,n){let o=n,f;return Array.isArray(n)&&(o=n[0],f=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,f),()=>e.removeEventListener(t,o,f))}function te(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function V(e,t,n,o=!1){return typeof n!="function"?(w(e,t,n,o),()=>{}):g(()=>{let f=typeof n=="function"?n():n;w(e,t,f,o)})}function K(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):g(()=>{let o=typeof n=="function"?n():n;k(e,t,o)})}function ne(e,t,n){return typeof n!="function"?(w(e,t,!!n),()=>{}):g(()=>{let o=n();w(e,t,!!o)})}function M(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){S(()=>{M(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(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function O(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],l=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push(g(()=>{let s=!!f();for(let i of l)e.classList.toggle(i,s)}));else{let s=!!(typeof f=="function"?f():f);for(let i of l)e.classList.toggle(i,s)}}}function B(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 o in n){let f=n[o];f==null?e.style[o]="":e.style[o]=f}}function We(e){let{element:t,props:n,prevProps:o=ce,isSVG:f=!1,skipChildren:l=!1}=e;if(!t||!G(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=f||t.namespaceURI===H,i=[];for(let r in n){if(l&&r==="children")continue;let a=n[r],u=o[r];if(a!==u){if(r==="ref"){oe(a,t);continue}if(r==="use"){te(t,a);continue}if(r.startsWith("on:")){i.push(ee(t,r.slice(3),a));continue}if(r.startsWith("prop:")){i.push(K(t,r.slice(5),a));continue}if(r.startsWith("attr:")){i.push(V(t,r.slice(5),a,s));continue}if(r.startsWith("bool:")){i.push(ne(t,r.slice(5),a));continue}if(r==="class"||r==="className"){typeof a=="function"?i.push(g(()=>M(t,a()))):M(t,a);continue}if(r==="classList"){typeof a=="function"?i.push(g(()=>O(t,a()))):O(t,a,i);continue}if(r==="style"){typeof a=="function"?i.push(g(()=>B(t,a()))):B(t,a);continue}if(r.startsWith("on")){let c=r.slice(2).toLowerCase();u&&U(t,c),a&&pe(t,c,a);continue}_.has(r)||!s&&r in t?i.push(K(t,r,a)):i.push(V(t,r,a,s))}}for(let r in o)if(!(r in n))if(r.startsWith("on")){let a=r.slice(2).toLowerCase();U(t,a)}else _.has(r)?k(t,r,null):t.removeAttribute(r);return()=>{i.forEach(r=>r())}}function Ie(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){oe(f,e);continue}if(o!=="children"){if(o==="use"){te(e,f);continue}if(o.startsWith("on:")){ee(e,o.slice(3),f);continue}if(o.startsWith("prop:")){K(e,o.slice(5),f);continue}if(o.startsWith("attr:")){V(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){ne(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let l=o.slice(2).toLowerCase();if(typeof f=="function")if(R.has(l)){e[`$$${l}`]=f;let s=`__fx_${l}`;if(!e[s]){let i=r=>{e[`$$${l}`]?.(r)};e.addEventListener(l,i),e[s]=i}}else e[`$$${l}`]=f,C.has(l)||Z([l]);continue}if(o==="class"||o==="className"){M(e,f);continue}if(o==="classList"){typeof f=="function"?g(()=>O(e,f())):O(e,f);continue}if(o==="style"){B(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let l=S(()=>{let s=f();for(;typeof s=="function";)s=s();e.innerHTML=s});T(()=>l())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let l=S(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});T(()=>{l()})}else e.value=f??"";continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let l=S(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});T(()=>{l()})}else e.checked=f??"";continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let l=!0,s=S(()=>{let i=f();for(;typeof i=="function"&&i.length===0;)i=i();l?(l=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});T(()=>{s()})}else queueMicrotask(()=>{e.value=f??""});continue}if(typeof f=="function"){let l=S(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();$(e,o,s,n)});T(()=>{l()})}else $(e,o,f,n)}}}function ke(...e){let t=o=>{for(let f=e.length-1;f>=0;f--){let l=e[f];if(l&&o in l&&l[o]!==void 0)return l[o]}},n=o=>{for(let f of e)if(f&&o in f)return!0;return!1};return new Proxy({},{get:(o,f)=>t(f),has:(o,f)=>n(f),ownKeys:()=>{let o=new Set;for(let f of e)if(f)for(let l of Reflect.ownKeys(f))o.add(l);return[...o]},getOwnPropertyDescriptor:(o,f)=>n(f)?{enumerable:!0,configurable:!0,get:()=>t(f)}:void 0})}function Ve(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),f=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(r,a)=>i.has(a)?e[a]:void 0,has:(r,a)=>i.has(a)&&a in e,ownKeys:()=>Array.from(i).filter(r=>r in e),getOwnPropertyDescriptor:(r,a)=>i.has(a)&&a in e?o(a):void 0})}),l=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...f,l]}function oe(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Ke(e,t,n){let o=t||document.body,f=le(()=>e),l=[];return Y(()=>{let s=g(()=>{let i=f();Array.isArray(i)?(i.forEach(r=>o.appendChild(r)),l.push(()=>{i.forEach(r=>{r.parentNode===o&&o.removeChild(r)})})):A(i)&&(o.appendChild(i),l.push(()=>{i.parentNode===o&&o.removeChild(i)}))});l.push(s),T(()=>{l.forEach(i=>i())})}),null}function Be(e){return typeof e=="string"&&e.toLowerCase()===e}function qe(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 Ge(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Xe(e){return typeof e=="function"&&e.length===0&&y(e)}function Je(e,t,n){if(!t)throw new Error("Container element is required");let o,f,l=[];return fe(s=>{Y(()=>{x.active||(t.textContent=""),Q(t,e)}),f=s}),()=>{f?.(),o?.(),l.forEach(s=>s()),t.textContent=""}}export{pe as addDelegatedEventListener,ee as addNativeEventListener,Ie as applyProps,te as applyUse,N as cleanChildren,_e as cloneTemplate,He as createNativeElement,Ke as createPortal,$e as createTemplate,Z as delegateEvents,Ge as escapeHTML,De as fnName,Oe as generateID,Me as getStableElementId,oe as handleRef,Q as insert,P as insertExpression,Xe as isAccessor,Re as isDelegatedEvent,je as isFunction,Be as isNativeElement,L as isPromise,qe as isSVGElement,Fe as iterateFn,ye as makeArrayFlat,ke as mergeProps,U as removeDelegatedEventListener,Je as render,O as setClassList,M as setClassName,V as setDynamicAttribute,ne as setDynamicBoolAttribute,K as setDynamicProperty,k as setProperty,B as setStyle,Ve as splitProps,We as spread};
|
|
1
|
+
import{isSignal as g}from"@fluixi/reactive/signal";var $="http://www.w3.org/2000/svg";function re(e){return e.localName.includes("-")}function _(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(re(e)){e[t]=n;return}N(e,t,n,o)}var D=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function N(e,t,n,o=!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))}var me=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Y,createEffect as S,createRenderEffect as y,createRoot as fe,onCleanup as w,readChildren as ae}from"@fluixi/reactive/signal";var v=typeof document>"u";var F=Symbol.for("fluixi.server-node"),q=null;function W(){if(!q)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return q}function A(e){return e!=null&&e[F]===!0?!0:typeof Node<"u"&&e instanceof Node}function G(e){return e!=null&&e[F]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function X(e){return e!=null&&e[F]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var x={active:!1,cursor:null,parents:[]},se=null;function I(){return se}function k(e,t){return x.active&&t.parentNode===e}function z(e){let t=x.parents.lastIndexOf(e);t!==-1&&(x.parents.length=t),x.cursor=e.nextSibling}function le(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 o=0,f=e;for(;f=f.previousElementSibling;)f.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function ue(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 Me(e){return ue(le(e))}var Re=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),ce={};var J=new Map,C=new Set,H=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Z(e){if(!v)for(let t of e)C.has(t)||H.has(t)||(C.add(t),document.addEventListener(t,de))}function de(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function ye(e,t,n){if(e[`$$${t}`]=n,H.has(t)){let o=`__fx_${t}`;if(!e[o]){let f=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,f),e[o]=f}return}C.has(t)||Z([t])}function U(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Oe(e){return!H.has(e)}function He(e){return typeof e=="function"}function b(e,t=!1){if(v)return W().createText(e);if(x.active&&!t){let n=I()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function je(e,t=!1){if(v)return W().createElement(e,t);if(x.active){let n=I()?.hydrateElement(e);if(n)return n}return t?document.createElementNS($,e):document.createElement(e)}function $e(e,t=!1){let n=J.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,J.set(e,o),o}function _e(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function pe(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?pe(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function De(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Fe(e){if(g(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!h(t);)t=t();return t}var E=0,ge=200;function he(e,t,n,o,f){let a=o,s=new Map;return y(()=>{let r;if(h(e)&&!g(e)){if(!s.has(e)){E++;try{let i=e();s.set(e,i)}finally{E--}}for(r=s.get(e);typeof r=="function"&&g(r);)r=r()}else for(r=e();typeof r=="function"&&g(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(h(r)){if(!s.has(r)){let l=r;E++;try{let u=l();s.set(l,u)}finally{E--}}r=s.get(r)}else if(g(r))r=r();else if(r=r(),typeof r!="function"||!g(r)&&!h(r))break}E++;try{a=P(t,r,n,a,s),f(a)}finally{E--}})}function Q(e,t,n,o){if(E>ge)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=b("",!0),e.appendChild(n));let f=o??null,a=i=>Array.isArray(i)&&i.some(l=>typeof l=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){E++;try{f=P(e,t,n,null)}finally{E--}return()=>f}let r=he(s(t),e,n,f,i=>{f=i});return()=>(r?.(),f)}function P(e,t,n,o,f){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(L(t)){let s=b("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),T(e,o.slice(1),n)):p(e,s,n):o?e.replaceChild(s,o):p(e,s,n),t.then(r=>{s.parentNode===e&&P(e,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=b(t);return p(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&X(o))return o.data=t,o;let s=b(t);return o&&o.parentNode===e?e.replaceChild(s,o):k(e,s)||p(e,s,n),s}if(A(t))return k(e,t)?(z(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];m(t,s,e,n,!0,f,i);let l=xe(e,r,s,n);for(let u of i){let c=Q(e,u.sig,u.marker);w(()=>{T(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return P(e,i,n,o)}}}return T(e,o,n)}function m(e,t,n,o,f=!0,a,s){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!L(i)&&!g(i)&&!h(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let l;for(h(i)&&!g(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),l=a.get(i)):l=i();typeof l=="function"&&!L(l)&&!g(l)&&!h(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(g(l)){if(s){let c=b("",!0);t.push(c),s.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&g(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?m(u,t,n,o,f,a):m([u],t,n,o,f,a);continue}continue}Array.isArray(l)?m(l,t,n,o,f,a,s):m([l],t,n,o,f,a,s);continue}if(L(i)){let l=b("",!0);t.push(l),i.then(u=>{if(l.parentNode){let c=[];if(m([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let d=1;d<c.length;d++)l.parentNode?.insertBefore(c[d],c[d-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(i)){m(i,t,n,o,f,a,s);continue}if(A(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let l=i;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?m(u,t,n,o,!1,a):m([u],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let l=String(i);if(l.trim()===""&&l!==" ")continue;t.push(b(l));continue}t.push(b(String(i)))}}}}function xe(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let f=n.length,a=t.length,s=f,r=0,i=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;r<a||i<s;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&t[a-1]===n[s-1];)a--,s--;if(a===r){let c=s<f?i?n[i-1].nextSibling??void 0:n[s-i]:l;for(;i<s;)p(e,n[i++],c)}else if(s===i)for(;r<a;)(!u||!u.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[s-1]&&n[i]===t[a-1]){let c=t[--a].nextSibling;p(e,n[i++],t[r++].nextSibling),p(e,n[--s],c),t[a]=t[r-1]}else{if(!u){u=new Map;let d=i;for(;d<s;)u.set(n[d],d++)}let c=u.get(t[r]);if(c!=null)if(i<c&&c<s){let d=r,j=1;for(;++d<a&&d<s&&!(!u.has(t[d])||u.get(t[d])!==c+j);)j++;if(j>c-i){let ie=t[r];for(;i<c;)p(e,n[i++],ie)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(p(e,n[i++],l),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function p(e,t,n){x.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function M(e,t,n){n==null?delete e[t]:e[t]=n}function ee(e,t,n){let o=n,f;return Array.isArray(n)&&(o=n[0],f=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,f),()=>e.removeEventListener(t,o,f))}function te(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function V(e,t,n,o=!1){return typeof n!="function"?(N(e,t,n,o),()=>{}):y(()=>{let f=typeof n=="function"?n():n;N(e,t,f,o)})}function K(e,t,n){return typeof n!="function"?(M(e,t,n),()=>{}):y(()=>{let o=typeof n=="function"?n():n;M(e,t,o)})}function ne(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):y(()=>{let o=n();N(e,t,!!o)})}function R(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){S(()=>{R(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(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function O(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push(y(()=>{let s=!!f();for(let r of a)e.classList.toggle(r,s)}));else{let s=!!(typeof f=="function"?f():f);for(let r of a)e.classList.toggle(r,s)}}}function B(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 o in n){let f=n[o];f==null?e.style[o]="":e.style[o]=f}}function We(e){let{element:t,props:n,prevProps:o=ce,isSVG:f=!1,skipChildren:a=!1}=e;if(!t||!G(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=f||t.namespaceURI===$,r=[];for(let i in n){if(a&&i==="children")continue;let l=n[i],u=o[i];if(l===u)continue;if(i==="ref"){oe(l,t);continue}if(i==="use"){te(t,l);continue}if(i.startsWith("on:")){r.push(ee(t,i.slice(3),l));continue}if(i.startsWith("prop:")){r.push(K(t,i.slice(5),l));continue}if(i.startsWith("attr:")){r.push(V(t,i.slice(5),l,s));continue}if(i.startsWith("bool:")){r.push(ne(t,i.slice(5),l));continue}if(i==="class"||i==="className"){typeof l=="function"?r.push(y(()=>R(t,l()))):R(t,l);continue}if(i==="classList"){typeof l=="function"?r.push(y(()=>O(t,l()))):O(t,l,r);continue}if(i==="style"){typeof l=="function"?r.push(y(()=>B(t,l()))):B(t,l);continue}if(i.startsWith("on")){let d=i.slice(2).toLowerCase();u&&U(t,d),l&&ye(t,d,l);continue}let c=D.has(i)||!s&&i in t;typeof l=="function"?r.push(c?K(t,i,l):V(t,i,l,s)):r.push(y(()=>c?M(t,i,n[i]):N(t,i,n[i],s)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let l=i.slice(2).toLowerCase();U(t,l)}else D.has(i)?M(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function Ie(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){oe(f,e);continue}if(o!=="children"){if(o==="use"){te(e,f);continue}if(o.startsWith("on:")){ee(e,o.slice(3),f);continue}if(o.startsWith("prop:")){K(e,o.slice(5),f);continue}if(o.startsWith("attr:")){V(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){ne(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(H.has(a)){e[`$$${a}`]=f;let s=`__fx_${a}`;if(!e[s]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[s]=r}}else e[`$$${a}`]=f,C.has(a)||Z([a]);continue}if(o==="class"||o==="className"){R(e,f);continue}if(o==="classList"){typeof f=="function"?y(()=>O(e,f())):O(e,f);continue}if(o==="style"){B(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let a=S(()=>{let s=f();for(;typeof s=="function";)s=s();e.innerHTML=s});w(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=S(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});w(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=S(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});w(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let a=!0,s=S(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});w(()=>{s()})}else{let a=!0;y(()=>{let s=t[o];a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof f=="function"){let a=S(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();_(e,o,s,n)});w(()=>{a()})}else y(()=>_(e,o,t[o],n))}}}function ke(...e){let t=o=>{for(let f=e.length-1;f>=0;f--){let a=e[f];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let f of e)if(f&&o in f)return!0;return!1};return new Proxy({},{get:(o,f)=>t(f),has:(o,f)=>n(f),ownKeys:()=>{let o=new Set;for(let f of e)if(f)for(let a of Reflect.ownKeys(f))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,f)=>n(f)?{enumerable:!0,configurable:!0,get:()=>t(f)}:void 0})}function Ve(e,...t){let n=new Set;for(let s of t)for(let r of s)n.add(r);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),f=t.map(s=>{let r=new Set(s);return new Proxy({},{get:(i,l)=>r.has(l)?e[l]:void 0,has:(i,l)=>r.has(l)&&l in e,ownKeys:()=>Array.from(r).filter(i=>i in e),getOwnPropertyDescriptor:(i,l)=>r.has(l)&&l in e?o(l):void 0})}),a=new Proxy({},{get:(s,r)=>n.has(r)?void 0:e[r],has:(s,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,r)=>!n.has(r)&&r in e?o(r):void 0});return[...f,a]}function oe(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Ke(e,t,n){let o=t||document.body,f=ae(()=>e),a=[];return Y(()=>{let s=y(()=>{let r=f();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):A(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(s),w(()=>{a.forEach(r=>r())})}),null}function Be(e){return typeof e=="string"&&e.toLowerCase()===e}function qe(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 Ge(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Xe(e){return typeof e=="function"&&e.length===0&&g(e)}function ze(e,t,n){if(!t)throw new Error("Container element is required");let o,f,a=[];return fe(s=>{Y(()=>{x.active||(t.textContent=""),Q(t,e)}),f=s}),()=>{f?.(),o?.(),a.forEach(s=>s()),t.textContent=""}}export{ye as addDelegatedEventListener,ee as addNativeEventListener,Ie as applyProps,te as applyUse,T as cleanChildren,_e as cloneTemplate,je as createNativeElement,Ke as createPortal,$e as createTemplate,Z as delegateEvents,Ge as escapeHTML,De as fnName,Re as generateID,Me as getStableElementId,oe as handleRef,Q as insert,P as insertExpression,Xe as isAccessor,Oe as isDelegatedEvent,He as isFunction,Be as isNativeElement,L as isPromise,qe as isSVGElement,Fe as iterateFn,pe as makeArrayFlat,ke as mergeProps,U as removeDelegatedEventListener,ze as render,O as setClassList,R as setClassName,V as setDynamicAttribute,ne as setDynamicBoolAttribute,K as setDynamicProperty,M as setProperty,B as setStyle,Ve as splitProps,We as spread};
|
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 de=Object.prototype.hasOwnProperty;var ye=(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))!de.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={};ye(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 U(e){return typeof e=="function"?e:(()=>e)}function x(e){return()=>{let n=e();return typeof n=="function"?n():n}}function H(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,r=Array.isArray(f)?f.map(i=>typeof i=="function"?i(a,s):i):typeof f=="function"?f(a,s):f;return P(r),r};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(H(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=U(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 T=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 b(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,T.createRenderEffect)(()=>{let r;if(A(e)&&!(0,p.isSignal)(e)){if(!f.has(e)){m++;try{let i=e();f.set(e,i)}finally{m--}}for(r=f.get(e);typeof r=="function"&&(0,p.isSignal)(r);)r=r()}else for(r=e();typeof r=="function"&&(0,p.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(A(r)){if(!f.has(r)){let c=r;m++;try{let l=c();f.set(c,l)}finally{m--}}r=f.get(r)}else if((0,p.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,p.isSignal)(r)&&!A(r))break}m++;try{s=C(n,r,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=b("",!0),e.appendChild(t));let a=o??null;if(typeof n!="function"){m++;try{a=C(e,n,t,null)}finally{m--}return()=>a}let s=ge(n,e,t,a,f=>{a=f});return()=>(s?.(),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=b("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),E(e,o.slice(1),t)):y(e,f,t):o?e.replaceChild(f,o):y(e,f,t),n.then(r=>{f.parentNode===e&&C(e,r,f.nextSibling,f)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),f}let s=typeof n;if(s==="string"||s==="number"){if(s==="number"&&(n=String(n)),Array.isArray(o)){if(o.length===0){let r=b(n);return y(e,r,t),r}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=b(n);return o&&o.parentNode===e?e.replaceChild(f,o):F(e,f)||y(e,f,t),f}if(v(n))return F(e,n)?(_(n),n):Array.isArray(o)?(o.length===0?y(e,n,t):o[0].parentNode===e?(e.replaceChild(n,o[0]),E(e,o.slice(1),t)):y(e,n,t),n):(o?o!==n&&(o.parentNode===e?e.replaceChild(n,o):y(e,n,t)):y(e,n,t),n);if(Array.isArray(n)){let f=[],r=Array.isArray(o)?o:o?[o]:[],i=[];h(n,f,e,t,!0,a,i);let c=be(e,r,f,t);for(let l of i){let u=D(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 r=f;if(typeof r.type=="function"){let i=r.type(r.props||{});return C(e,i,t,o)}}}return E(e,o,t)}function h(e,n,t,o,a=!0,s,f){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!M(i)&&!(0,p.isSignal)(i)&&!A(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let c;for(A(i)&&!(0,p.isSignal)(i)?(s||(s=new Map),s.has(i)||s.set(i,i()),c=s.get(i)):c=i();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)?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(i)){let c=b("",!0);n.push(c),i.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 d=1;d<u.length;d++)c.parentNode?.insertBefore(u[d],u[d-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(i)){h(i,n,t,o,a,s,f);continue}if(v(i)){n.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let c=i;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 i=="string"||typeof i=="number"){let c=String(i);if(c.trim()===""&&c!==" ")continue;n.push(b(c));continue}n.push(b(String(i)))}}}}function be(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,r=0,i=0,c=s>0?n[s-1].nextSibling??void 0:o,l=null;for(;r<s||i<f;){if(n[r]===t[i]){r++,i++;continue}for(;s>r&&f>i&&n[s-1]===t[f-1];)s--,f--;if(s===r){let u=f<a?i?t[i-1].nextSibling??void 0:t[f-i]:c;for(;i<f;)y(e,t[i++],u)}else if(f===i)for(;r<s;)(!l||!l.has(n[r]))&&n[r].parentNode===e&&e.removeChild(n[r]),r++;else if(n[r]===t[f-1]&&t[i]===n[s-1]){let u=n[--s].nextSibling;y(e,t[i++],n[r++].nextSibling),y(e,t[--f],u),n[s]=n[r-1]}else{if(!l){l=new Map;let d=i;for(;d<f;)l.set(t[d],d++)}let u=l.get(n[r]);if(u!=null)if(i<u&&u<f){let d=r,L=1;for(;++d<s&&d<f&&!(!l.has(n[d])||l.get(n[d])!==u+L);)L++;if(L>u-i){let ce=n[r];for(;i<u;)y(e,t[i++],ce)}else n[r].parentNode===e?e.replaceChild(t[i++],n[r++]):(y(e,t[i++],c),r++)}else r++;else n[r].parentNode===e&&e.removeChild(n[r]),r++}}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 y(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 Te(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(`${Te(o)}: ${s}`)}return t.join("; ")})}
|
|
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 U(e){return typeof e=="function"?e:(()=>e)}function x(e){return()=>{let n=e();return typeof n=="function"?n():n}}function H(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(H(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=U(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 T=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 b(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,T.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=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)){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=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&&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=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&&ne(o))return o.data=n,o;let f=b(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=be(e,i,f,t);for(let l of r){let u=D(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 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=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)?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=b("",!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(b(c));continue}n.push(b(String(r)))}}}}function be(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 Te(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(`${Te(o)}: ${s}`)}return t.join("; ")})}
|
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,
|
|
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 T(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 U=typeof document>"u";var H=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[H]===!0?!0:typeof Node<"u"&&e instanceof Node}function I(e){return e!=null&&e[H]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}function b(e,n=!1){if(U)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(T(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(T(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)&&!T(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=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)){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=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&&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=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(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)&&!T(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let c;for(T(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)&&!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(p(c)){if(f){let u=b("",!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=b("",!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(b(c));continue}n.push(b(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};
|
package/dist/lib/flow/portal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var P=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var K=(e,n)=>{for(var t in n)P(e,t,{get:n[t],enumerable:!0})},B=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of W(n))!I.call(e,c)&&c!==t&&P(e,c,{get:()=>n[c],enumerable:!(i=O(n,c))||i.enumerable});return e};var V=e=>B(P({},"__esModule",{value:!0}),e);var J={};K(J,{Portal:()=>z});module.exports=V(J);var w=require("@fluixi/reactive/signal");var p=require("@fluixi/reactive/signal");function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var m=require("@fluixi/reactive/signal");var R=typeof document>"u";var _=Symbol.for("fluixi.server-node"),M=null;function H(){if(!M)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return M}function T(e){return e!=null&&e[_]===!0?!0:typeof Node<"u"&&e instanceof Node}function D(e){return e!=null&&e[_]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var E={active:!1,cursor:null,parents:[]},q=null;function $(){return q}function C(e,n){return E.active&&n.parentNode===e}function j(e){let n=E.parents.lastIndexOf(e);n!==-1&&(E.parents.length=n),E.cursor=e.nextSibling}function g(e,n=!1){if(R)return H().createText(e);if(E.active&&!n){let t=$()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}var x=0,U=200;function G(e,n,t,i,c){let u=i,s=new Map;return(0,m.createRenderEffect)(()=>{let r;if(N(e)&&!(0,p.isSignal)(e)){if(!s.has(e)){x++;try{let o=e();s.set(e,o)}finally{x--}}for(r=s.get(e);typeof r=="function"&&(0,p.isSignal)(r);)r=r()}else for(r=e();typeof r=="function"&&(0,p.isSignal)(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(N(r)){if(!s.has(r)){let f=r;x++;try{let a=f();s.set(f,a)}finally{x--}}r=s.get(r)}else if((0,p.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,p.isSignal)(r)&&!N(r))break}x++;try{u=S(n,r,t,u,s),c(u)}finally{x--}})}function L(e,n,t,i){if(x>U)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=g("",!0),e.appendChild(t));let c=i??null,u=o=>Array.isArray(o)&&o.some(f=>typeof f=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof n!="function"&&!u(n)){x++;try{c=S(e,n,t,null)}finally{x--}return()=>c}let r=G(s(n),e,t,c,o=>{c=o});return()=>(r?.(),c)}function S(e,n,t,i,c){if(n==null||typeof n=="boolean")return b(e,i,t);if(typeof n=="function")for(;typeof n=="function";)n=n();if(n==null||typeof n=="boolean")return b(e,i,t);if(A(n)){let s=g("",!0);return Array.isArray(i)?i.length>0?(e.replaceChild(s,i[0]),b(e,i.slice(1),t)):y(e,s,t):i?e.replaceChild(s,i):y(e,s,t),n.then(r=>{s.parentNode===e&&S(e,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let u=typeof n;if(u==="string"||u==="number"){if(u==="number"&&(n=String(n)),Array.isArray(i)){if(i.length===0){let r=g(n);return y(e,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=n,i;i=b(e,i,t)}if(i&&D(i))return i.data=n,i;let s=g(n);return i&&i.parentNode===e?e.replaceChild(s,i):C(e,s)||y(e,s,t),s}if(T(n))return C(e,n)?(j(n),n):Array.isArray(i)?(i.length===0?y(e,n,t):i[0].parentNode===e?(e.replaceChild(n,i[0]),b(e,i.slice(1),t)):y(e,n,t),n):(i?i!==n&&(i.parentNode===e?e.replaceChild(n,i):y(e,n,t)):y(e,n,t),n);if(Array.isArray(n)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];h(n,s,e,t,!0,c,o);let f=X(e,r,s,t);for(let a of o){let l=L(e,a.sig,a.marker);(0,m.onCleanup)(()=>{b(e,l()),a.marker.parentNode===e&&e.removeChild(a.marker)})}return f}if(u==="object"&&n!==null&&typeof n=="object"){let s=n;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return S(e,o,t,i)}}}return b(e,i,t)}function h(e,n,t,i,c=!0,u,s){for(let r=0;r<e.length;r++){let o=e[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!A(o)&&!(0,p.isSignal)(o)&&!N(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let f;for(N(o)&&!(0,p.isSignal)(o)?(u||(u=new Map),u.has(o)||u.set(o,o()),f=u.get(o)):f=o();typeof f=="function"&&!A(f)&&!(0,p.isSignal)(f)&&!N(f);)u||(u=new Map),u.has(f)||u.set(f,f()),f=u.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if((0,p.isSignal)(f)){if(s){let l=g("",!0);n.push(l),s.push({marker:l,sig:f});continue}let a=f();for(;typeof a=="function"&&(0,p.isSignal)(a);)a=a();if(a==null||typeof a=="boolean")continue;Array.isArray(a)?h(a,n,t,i,c,u):h([a],n,t,i,c,u);continue}continue}Array.isArray(f)?h(f,n,t,i,c,u,s):h([f],n,t,i,c,u,s);continue}if(A(o)){let f=g("",!0);n.push(f),o.then(a=>{if(f.parentNode){let l=[];if(h([a],l,f.parentNode,void 0,!1,u),l.length>0){f.parentNode.replaceChild(l[0],f);for(let d=1;d<l.length;d++)f.parentNode?.insertBefore(l[d],l[d-1].nextSibling)}}}).catch(a=>console.error("Error resolving promise in array:",a));continue}if(Array.isArray(o)){h(o,n,t,i,c,u,s);continue}if(T(o)){n.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let f=o;if(typeof f.type=="function"){let a=f.type(f.props||{});Array.isArray(a)?h(a,n,t,i,!1,u):h([a],n,t,i,!1,u);continue}}if(typeof o=="string"||typeof o=="number"){let f=String(o);if(f.trim()===""&&f!==" ")continue;n.push(g(f));continue}n.push(g(String(o)))}}}}function X(e,n,t,i){for(let l=0;l<t.length;l++)t[l].parentNode!==null&&t[l].parentNode!==e&&(t=t.slice(),t[l]=t[l].cloneNode(!0));let c=t.length,u=n.length,s=c,r=0,o=0,f=u>0?n[u-1].nextSibling??void 0:i,a=null;for(;r<u||o<s;){if(n[r]===t[o]){r++,o++;continue}for(;u>r&&s>o&&n[u-1]===t[s-1];)u--,s--;if(u===r){let l=s<c?o?t[o-1].nextSibling??void 0:t[s-o]:f;for(;o<s;)y(e,t[o++],l)}else if(s===o)for(;r<u;)(!a||!a.has(n[r]))&&n[r].parentNode===e&&e.removeChild(n[r]),r++;else if(n[r]===t[s-1]&&t[o]===n[u-1]){let l=n[--u].nextSibling;y(e,t[o++],n[r++].nextSibling),y(e,t[--s],l),n[u]=n[r-1]}else{if(!a){a=new Map;let d=o;for(;d<s;)a.set(t[d],d++)}let l=a.get(n[r]);if(l!=null)if(o<l&&l<s){let d=r,v=1;for(;++d<u&&d<s&&!(!a.has(n[d])||a.get(n[d])!==l+v);)v++;if(v>l-o){let F=n[r];for(;o<l;)y(e,t[o++],F)}else n[r].parentNode===e?e.replaceChild(t[o++],n[r++]):(y(e,t[o++],f),r++)}else r++;else n[r].parentNode===e&&e.removeChild(n[r]),r++}}return t}function b(e,n,t){if(n)if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i].parentNode===e&&e.removeChild(n[i]);else n.parentNode===e&&e.removeChild(n);return null}function y(e,n,t){E.active&&n.parentNode===e||(t&&t.parentNode===e?e.insertBefore(n,t):e.appendChild(n))}function k(e,n){if(e){if(T(e)){let t=n,i=e;if(!t)return;typeof t=="function"?t(i):typeof t=="object"&&"current"in t&&(t.current=i);return}typeof e=="function"?e(n):typeof e=="object"&&"current"in e&&(e.current=n)}}function A(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function z(e){let n=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,t,i;return(0,w.createRoot)(c=>{t=c,i=document.createElement("div"),i.style.display="contents",n().appendChild(i),L(i,e.children)&&k(e.ref,i)}),(0,w.onCleanup)(()=>{t(),i.remove()}),null}
|
package/dist/lib/flow/portal.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRoot as K,onCleanup as B}from"@fluixi/reactive/signal";import{isSignal as p}from"@fluixi/reactive/signal";function
|
|
1
|
+
import{createRoot as K,onCleanup as B}from"@fluixi/reactive/signal";import{isSignal as p}from"@fluixi/reactive/signal";function m(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Y,createEffect as Q,createRenderEffect as k,createRoot as Z,onCleanup as F,readChildren as ee}from"@fluixi/reactive/signal";var C=typeof document>"u";var L=Symbol.for("fluixi.server-node"),P=null;function M(){if(!P)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return P}function b(e){return e!=null&&e[L]===!0?!0:typeof Node<"u"&&e instanceof Node}function R(e){return e!=null&&e[L]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var N={active:!1,cursor:null,parents:[]},j=null;function _(){return j}function w(e,n){return N.active&&n.parentNode===e}function H(e){let n=N.parents.lastIndexOf(e);n!==-1&&(N.parents.length=n),N.cursor=e.nextSibling}function g(e,n=!1){if(C)return M().createText(e);if(N.active&&!n){let t=_()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}var x=0,O=200;function W(e,n,t,r,c){let u=r,s=new Map;return k(()=>{let i;if(m(e)&&!p(e)){if(!s.has(e)){x++;try{let o=e();s.set(e,o)}finally{x--}}for(i=s.get(e);typeof i=="function"&&p(i);)i=i()}else for(i=e();typeof i=="function"&&p(i);)i=i();{let o=0;for(;typeof i=="function"&&o++<50;)if(m(i)){if(!s.has(i)){let f=i;x++;try{let a=f();s.set(f,a)}finally{x--}}i=s.get(i)}else if(p(i))i=i();else if(i=i(),typeof i!="function"||!p(i)&&!m(i))break}x++;try{u=A(n,i,t,u,s),c(u)}finally{x--}})}function v(e,n,t,r){if(x>O)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=g("",!0),e.appendChild(t));let c=r??null,u=o=>Array.isArray(o)&&o.some(f=>typeof f=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof n!="function"&&!u(n)){x++;try{c=A(e,n,t,null)}finally{x--}return()=>c}let i=W(s(n),e,t,c,o=>{c=o});return()=>(i?.(),c)}function A(e,n,t,r,c){if(n==null||typeof n=="boolean")return E(e,r,t);if(typeof n=="function")for(;typeof n=="function";)n=n();if(n==null||typeof n=="boolean")return E(e,r,t);if(T(n)){let s=g("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),E(e,r.slice(1),t)):y(e,s,t):r?e.replaceChild(s,r):y(e,s,t),n.then(i=>{s.parentNode===e&&A(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let u=typeof n;if(u==="string"||u==="number"){if(u==="number"&&(n=String(n)),Array.isArray(r)){if(r.length===0){let i=g(n);return y(e,i,t),i}if(r.length===1&&r[0].nodeType===3)return r[0].data=n,r;r=E(e,r,t)}if(r&&R(r))return r.data=n,r;let s=g(n);return r&&r.parentNode===e?e.replaceChild(s,r):w(e,s)||y(e,s,t),s}if(b(n))return w(e,n)?(H(n),n):Array.isArray(r)?(r.length===0?y(e,n,t):r[0].parentNode===e?(e.replaceChild(n,r[0]),E(e,r.slice(1),t)):y(e,n,t),n):(r?r!==n&&(r.parentNode===e?e.replaceChild(n,r):y(e,n,t)):y(e,n,t),n);if(Array.isArray(n)){let s=[],i=Array.isArray(r)?r:r?[r]:[],o=[];h(n,s,e,t,!0,c,o);let f=I(e,i,s,t);for(let a of o){let l=v(e,a.sig,a.marker);F(()=>{E(e,l()),a.marker.parentNode===e&&e.removeChild(a.marker)})}return f}if(u==="object"&&n!==null&&typeof n=="object"){let s=n;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let o=i.type(i.props||{});return A(e,o,t,r)}}}return E(e,r,t)}function h(e,n,t,r,c=!0,u,s){for(let i=0;i<e.length;i++){let o=e[i];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!T(o)&&!p(o)&&!m(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let f;for(m(o)&&!p(o)?(u||(u=new Map),u.has(o)||u.set(o,o()),f=u.get(o)):f=o();typeof f=="function"&&!T(f)&&!p(f)&&!m(f);)u||(u=new Map),u.has(f)||u.set(f,f()),f=u.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if(p(f)){if(s){let l=g("",!0);n.push(l),s.push({marker:l,sig:f});continue}let a=f();for(;typeof a=="function"&&p(a);)a=a();if(a==null||typeof a=="boolean")continue;Array.isArray(a)?h(a,n,t,r,c,u):h([a],n,t,r,c,u);continue}continue}Array.isArray(f)?h(f,n,t,r,c,u,s):h([f],n,t,r,c,u,s);continue}if(T(o)){let f=g("",!0);n.push(f),o.then(a=>{if(f.parentNode){let l=[];if(h([a],l,f.parentNode,void 0,!1,u),l.length>0){f.parentNode.replaceChild(l[0],f);for(let d=1;d<l.length;d++)f.parentNode?.insertBefore(l[d],l[d-1].nextSibling)}}}).catch(a=>console.error("Error resolving promise in array:",a));continue}if(Array.isArray(o)){h(o,n,t,r,c,u,s);continue}if(b(o)){n.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let f=o;if(typeof f.type=="function"){let a=f.type(f.props||{});Array.isArray(a)?h(a,n,t,r,!1,u):h([a],n,t,r,!1,u);continue}}if(typeof o=="string"||typeof o=="number"){let f=String(o);if(f.trim()===""&&f!==" ")continue;n.push(g(f));continue}n.push(g(String(o)))}}}}function I(e,n,t,r){for(let l=0;l<t.length;l++)t[l].parentNode!==null&&t[l].parentNode!==e&&(t=t.slice(),t[l]=t[l].cloneNode(!0));let c=t.length,u=n.length,s=c,i=0,o=0,f=u>0?n[u-1].nextSibling??void 0:r,a=null;for(;i<u||o<s;){if(n[i]===t[o]){i++,o++;continue}for(;u>i&&s>o&&n[u-1]===t[s-1];)u--,s--;if(u===i){let l=s<c?o?t[o-1].nextSibling??void 0:t[s-o]:f;for(;o<s;)y(e,t[o++],l)}else if(s===o)for(;i<u;)(!a||!a.has(n[i]))&&n[i].parentNode===e&&e.removeChild(n[i]),i++;else if(n[i]===t[s-1]&&t[o]===n[u-1]){let l=n[--u].nextSibling;y(e,t[o++],n[i++].nextSibling),y(e,t[--s],l),n[u]=n[i-1]}else{if(!a){a=new Map;let d=o;for(;d<s;)a.set(t[d],d++)}let l=a.get(n[i]);if(l!=null)if(o<l&&l<s){let d=i,S=1;for(;++d<u&&d<s&&!(!a.has(n[d])||a.get(n[d])!==l+S);)S++;if(S>l-o){let $=n[i];for(;o<l;)y(e,t[o++],$)}else n[i].parentNode===e?e.replaceChild(t[o++],n[i++]):(y(e,t[o++],f),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 r=0;r<n.length;r++)n[r].parentNode===e&&e.removeChild(n[r]);else n.parentNode===e&&e.removeChild(n);return null}function y(e,n,t){N.active&&n.parentNode===e||(t&&t.parentNode===e?e.insertBefore(n,t):e.appendChild(n))}function D(e,n){if(e){if(b(e)){let t=n,r=e;if(!t)return;typeof t=="function"?t(r):typeof t=="object"&&"current"in t&&(t.current=r);return}typeof e=="function"?e(n):typeof e=="object"&&"current"in e&&(e.current=n)}}function T(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function fe(e){let n=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,t,r;return K(c=>{t=c,r=document.createElement("div"),r.style.display="contents",n().appendChild(r),v(r,e.children)&&D(e.ref,r)}),B(()=>{t(),r.remove()}),null}export{fe as Portal};
|
package/dist/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ge=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Jt=Object.getOwnPropertyNames;var Yt=Object.prototype.hasOwnProperty;var Zt=(e,t)=>{for(var n in t)ge(e,n,{get:t[n],enumerable:!0})},Qt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Jt(t))!Yt.call(e,o)&&o!==n&&ge(e,o,{get:()=>t[o],enumerable:!(r=Gt(t,o))||r.enumerable});return e};var en=e=>Qt(ge({},"__esModule",{value:!0}),e);var $r={};Zt($r,{Dynamic:()=>Ot,ErrorBoundary:()=>It,FX_DATA_ID:()=>$,For:()=>Ct,Index:()=>Pt,Island:()=>Tt,JSX_PROPERTIES:()=>J,Match:()=>kt,Portal:()=>$t,SVG_ELEMENTS:()=>an,SVG_NAMESPACE:()=>X,Show:()=>Rt,Switch:()=>_t,VOID_ELEMENTS:()=>sn,addClass:()=>un,addDelegatedEventListener:()=>yt,addNativeEventListener:()=>Re,appendChildren:()=>bn,applyElementProp:()=>G,applyProps:()=>ir,applyUse:()=>Ce,asComponent:()=>Fn,asContext:()=>jn,asOutlet:()=>In,asProvider:()=>qn,asRoute:()=>$n,asRouter:()=>Dn,asRoutes:()=>On,asSuspense:()=>Hn,captureHydrationCursor:()=>ut,checkRenderType:()=>Vn,classMap:()=>jt,cleanChildren:()=>w,cloneTemplate:()=>Zn,closest:()=>cn,createComponent:()=>hr,createElement:()=>gn,createNativeElement:()=>Ae,createPortal:()=>lr,createRequestContext:()=>D,createTemplate:()=>Yn,delegate:()=>Sn,delegateEvents:()=>we,escapeFxJson:()=>W,escapeHTML:()=>fr,fnName:()=>Qn,generateID:()=>zn,getAttribute:()=>yn,getGlobal:()=>_n,getLitEventName:()=>rn,getLocals:()=>_e,getOffset:()=>En,getRequestContext:()=>E,getRequestEvent:()=>se,getRequestLocals:()=>ae,getServerData:()=>K,getStableElementId:()=>Kn,getStyle:()=>hn,handleRef:()=>U,hasClass:()=>pn,html:()=>Et,hydrate:()=>ce,hydrateAdvancePast:()=>_,hydrateIslands:()=>Nt,indexArray:()=>I.indexArray,initializeIntegration:()=>mr,insert:()=>R,insertExpression:()=>F,intergartionInitialized:()=>gr,isAccessor:()=>dr,isComponent:()=>T,isContext:()=>it,isCustomElement:()=>Ye,isDOMNode:()=>Ln,isDelegatedEvent:()=>Gn,isDomElement:()=>Y,isDomNode:()=>P,isDomText:()=>Z,isEventHandler:()=>nn,isFunction:()=>Jn,isIntegrationInitialized:()=>xr,isJSXTemplate:()=>Pn,isLitTemplateResult:()=>Qe,isNativeElement:()=>cr,isOutlet:()=>rt,isPromise:()=>j,isProvider:()=>ot,isReactElement:()=>Cn,isRoute:()=>nt,isRouter:()=>et,isRoutes:()=>tt,isSVGElement:()=>ur,isServer:()=>x,isSuspense:()=>st,isTemplateFactory:()=>Mn,isVisible:()=>Tn,iterateFn:()=>er,keyArray:()=>I.keyArray,makeArrayFlat:()=>mt,mapArray:()=>I.mapArray,mergeProps:()=>sr,observeIntersection:()=>wn,observeResize:()=>An,query:()=>xe,queryAll:()=>ln,registerCreateComponent:()=>yr,registerGlobal:()=>kn,removeAttribute:()=>mn,removeChildren:()=>xn,removeClass:()=>fn,removeDelegatedEventListener:()=>ve,render:()=>Pe,renderToString:()=>Xe,renderToStringAsync:()=>Je,resetIntegration:()=>br,runHydrationAt:()=>ft,runWithRequestContext:()=>O,runWithoutHydration:()=>dt,scrollIntoView:()=>Nn,serializeNode:()=>N,serializeResourceData:()=>me,setAttribute:()=>b,setClassList:()=>V,setClassName:()=>H,setDataRedactor:()=>Ge,setDynamicAttribute:()=>te,setDynamicBoolAttribute:()=>Me,setDynamicProperty:()=>ne,setProperty:()=>ee,setRequestStore:()=>ke,setServerMode:()=>M,setStyle:()=>re,setStyles:()=>Ze,shouldSetAsProperty:()=>on,splitProps:()=>ar,spread:()=>or,styleMap:()=>Ht,svg:()=>St,toAttributeName:()=>tn,toggleClass:()=>dn,waitForElement:()=>vn});module.exports=en($r);function tn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function nn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function rn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function on(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 sn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),an=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"]),X="http://www.w3.org/2000/svg";function Ye(e){return e.localName.includes("-")}function G(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Ye(e)){e[t]=n;return}b(e,t,n,r)}var J=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function xe(e,t=document){return t.querySelector(e)}function ln(e,t=document){return Array.from(t.querySelectorAll(e))}function cn(e,t){return e.closest(t)}function un(e,...t){e.classList.add(...t)}function fn(e,...t){e.classList.remove(...t)}function dn(e,...t){t.forEach(n=>e.classList.toggle(n))}function pn(e,t){return e.classList.contains(t)}function b(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 yn(e,t){return e.getAttribute(t)}function mn(e,t){e.removeAttribute(t)}function Ze(e,t){Object.assign(e.style,t)}function hn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function gn(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")Ze(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else b(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function xn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function bn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Tn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Nn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function En(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Sn(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 vn(e,t=5e3){return new Promise((n,r)=>{let o=xe(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=xe(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 wn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function An(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Rn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Cn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rn}function Qe(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Mn(e){if(typeof e!="function")return!1;try{let t=e();return Qe(t)}catch{return!1}}function Pn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Ln(e){return e instanceof Node}function kn(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function _n(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var y=require("@fluixi/reactive/signal");function Dn(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function On(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function $n(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function In(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function qn(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function jn(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Fn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Hn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function et(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function rt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function ot(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function it(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function T(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function st(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Vn(e){return et(e)?{type:"router",value:e}:nt(e)?{type:"route",value:e}:tt(e)?{type:"routes",value:e}:rt(e)?{type:"outlet",value:e}:T(e)?{type:"component",value:e}:st(e)?{type:"suspense",value:e}:ot(e)?{type:"provider",value:e}:it(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var x=typeof document>"u";function M(e){x=e}var q=Symbol.for("fluixi.server-node"),be=null;function at(e){be=e}function Te(){if(!be)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return be}function P(e){return e!=null&&e[q]===!0?!0:typeof Node<"u"&&e instanceof Node}function Y(e){return e!=null&&e[q]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Z(e){return e!=null&&e[q]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},lt=null;function ct(e){lt=e}function Ne(){return lt}function Ee(e,t){return u.active&&t.parentNode===e}function Se(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 ft(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 dt(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 _(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Se(t)}function Un(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 Wn(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 Kn(e){return Wn(Un(e))}var zn=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Bn={};var pt=new Map,Q=new Set,oe=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function we(e){if(!x)for(let t of e)Q.has(t)||oe.has(t)||(Q.add(t),document.addEventListener(t,Xn))}function Xn(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 yt(e,t,n){if(e[`$$${t}`]=n,oe.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}Q.has(t)||we([t])}function ve(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Gn(e){return!oe.has(e)}function Jn(e){return typeof e=="function"}function A(e,t=!1){if(x)return Te().createText(e);if(u.active&&!t){let n=Ne()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ae(e,t=!1){if(x)return Te().createElement(e,t);if(u.active){let n=Ne()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(X,e):document.createElement(e)}function Yn(e,t=!1){let n=pt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,pt.set(e,r),r}function Zn(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function mt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?mt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Qn(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function er(e){if((0,y.isSignal)(e)||T(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,y.isSignal)(t)&&!T(t);)t=t();return t}var v=0,tr=200;function nr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(T(e)&&!(0,y.isSignal)(e)){if(!s.has(e)){v++;try{let l=e();s.set(e,l)}finally{v--}}for(a=s.get(e);typeof a=="function"&&(0,y.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,y.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(T(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((0,y.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,y.isSignal)(a)&&!T(a))break}v++;try{i=F(t,a,n,i,s),o(i)}finally{v--}})}function R(e,t,n,r){if(v>tr)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;if(typeof t!="function"){v++;try{o=F(e,t,n,null)}finally{v--}return()=>o}let i=nr(t,e,n,o,s=>{o=s});return()=>(i?.(),o)}function F(e,t,n,r,o){if(t==null||typeof t=="boolean")return w(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,r,n);if(j(t)){let s=A("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),w(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&F(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=w(e,r,n)}if(r&&Z(r))return r.data=t,r;let s=A(t);return r&&r.parentNode===e?e.replaceChild(s,r):Ee(e,s)||h(e,s,n),s}if(P(t))return Ee(e,t)?(Se(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),w(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=[];S(t,s,e,n,!0,o,l);let c=rr(e,a,s,n);for(let f of l){let p=R(e,f.sig,f.marker);(0,d.onCleanup)(()=>{w(e,p()),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 F(e,l,n,r)}}}return w(e,r,n)}function S(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"&&!j(l)&&!(0,y.isSignal)(l)&&!T(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(T(l)&&!(0,y.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!j(c)&&!(0,y.isSignal)(c)&&!T(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((0,y.isSignal)(c)){if(s){let p=A("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,y.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?S(f,t,n,r,o,i):S([f],t,n,r,o,i);continue}continue}Array.isArray(c)?S(c,t,n,r,o,i,s):S([c],t,n,r,o,i,s);continue}if(j(l)){let c=A("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(S([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let m=1;m<p.length;m++)c.parentNode?.insertBefore(p[m],p[m-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){S(l,t,n,r,o,i,s);continue}if(P(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)?S(f,t,n,r,!1,i):S([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 rr(e,t,n,r){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].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 p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)h(e,n[l++],p)}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 p=t[--i].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let m=l;for(;m<s;)f.set(n[m],m++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let m=a,he=1;for(;++m<i&&m<s&&!(!f.has(t[m])||f.get(t[m])!==p+he);)he++;if(he>p-l){let Xt=t[a];for(;l<p;)h(e,n[l++],Xt)}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 w(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 ee(e,t,n){n==null?delete e[t]:e[t]=n}function Re(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 Ce(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 te(e,t,n,r=!1){return typeof n!="function"?(b(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;b(e,t,o,r)})}function ne(e,t,n){return typeof n!="function"?(ee(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;ee(e,t,r)})}function Me(e,t,n){return typeof n!="function"?(b(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();b(e,t,!!r)})}function H(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createEffect)(()=>{H(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 V(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((0,d.createRenderEffect)(()=>{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 re(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 or(e){let{element:t,props:n,prevProps:r=Bn,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!Y(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===X,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c!==f){if(l==="ref"){U(c,t);continue}if(l==="use"){Ce(t,c);continue}if(l.startsWith("on:")){a.push(Re(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(ne(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(te(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Me(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>H(t,c()))):H(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>V(t,c()))):V(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>re(t,c()))):re(t,c);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();f&&ve(t,p),c&&yt(t,p,c);continue}J.has(l)||!s&&l in t?a.push(ne(t,l,c)):a.push(te(t,l,c,s))}}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();ve(t,c)}else J.has(l)?ee(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function ir(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){U(o,e);continue}if(r!=="children"){if(r==="use"){Ce(e,o);continue}if(r.startsWith("on:")){Re(e,r.slice(3),o);continue}if(r.startsWith("prop:")){ne(e,r.slice(5),o);continue}if(r.startsWith("attr:")){te(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Me(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(oe.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,Q.has(i)||we([i]);continue}if(r==="class"||r==="className"){H(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>V(e,o())):V(e,o);continue}if(r==="style"){re(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{i()})}else e.value=o??"";continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{i()})}else e.checked=o??"";continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{s()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();G(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else G(e,r,o,n)}}}function sr(...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 ar(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 U(e,t){if(e){if(P(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 lr(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):P(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function cr(e){return typeof e=="string"&&e.toLowerCase()===e}function ur(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 fr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function j(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function dr(e){return typeof e=="function"&&e.length===0&&(0,y.isSignal)(e)}function Pe(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),R(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var pr="__fx_dom_create_component__",L=globalThis[pr]??={fn:null};function yr(e){L.fn=e}function mr(e={}){let t=e.signalSystem?.createComponent;t&&(L.fn=t)}function hr(e,t){return L.fn?L.fn(e,t):(()=>e(t))}var gr=()=>L.fn!==null,xr=()=>L.fn!==null;function br(){L.fn=null}var ie,gt={getStore:()=>ie,run(e,t){let n=ie;ie=e;try{return t()}finally{ie=n}}},Le=gt;function ke(e){Le=e??gt}function D(e={}){e.locals||(e.locals=e.request?ae(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 O(e,t){return Le.run(e,t)}function E(){return Le.getStore()}function se(){return E()?.event}function _e(){let e=se();return e?(e.locals||(e.locals={}),e.locals):{}}var ht=new WeakMap;function ae(e){let t=ht.get(e);return t||(t={},ht.set(e,t)),t}var le=require("@fluixi/reactive/signal");var $="__FX_DATA__";function W(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var De;function K(){let e=globalThis.__FX_DATA__;if(e)return e;if(De!==void 0)return De;let t=null;if(typeof document<"u"){let n=document.getElementById($)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return De=t}function Oe(){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 Tr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),$e=typeof process<"u"&&process.env&&!1;function Ie(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 Nr(e){Oe();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Tr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):($e&&t&&Ie(`<${e}>`,t),null)}function Er(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Oe();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):($e&&t&&Ie(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Sr(e){Oe();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):($e&&t&&Ie(`marker <!--${e.slice(0,24)}-->`,t),null)}var xt=!1;function vr(){xt||(xt=!0,ct({hydrateElement:Nr,hydrateText:Er,hydrateMarker:Sr}))}function ce(e,t,n){vr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=K(),o=n?.resourceNamespace,i=0;(0,le.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,le.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return Pe(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var qe="fluixi-island";function Tt(e){let{component:t,props:n={},name:r}=e,o=Ae(qe),i=r??t.name??"Island";b(o,"name",i),b(o,"props",JSON.stringify(n??{}));let s=x?E():void 0;if(s){let a=s.nextIslandNamespace(i);R(o,()=>s.withResourceScope(a,()=>t(n)))}else R(o,()=>t(n));return o}var bt=!1;function wr(){if(bt||typeof document>"u")return;bt=!0;let e=document.createElement("style");e.textContent=`${qe}{display:contents}`,document.head.appendChild(e)}function Nt(e){if(typeof document>"u")return;wr();let t=document.querySelectorAll(qe),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{}ce(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Et(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function St(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var k=require("@fluixi/reactive/signal");function vt(e){return typeof e=="function"?e:(()=>e)}function C(e){return()=>{let t=e();return typeof t=="function"?t():t}}function wt(e){return e!=null&&e!==!1}function At(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Rt(e){let t=C(()=>e.when),n=(0,k.createMemo)(t,void 0),r=(0,k.createMemo)(n,void 0);return(0,k.createMemo)(()=>{if(r()){let i=e.children;return typeof i=="function"&&!At(i)?typeof n=="function"?(0,k.untrack)(()=>(0,k.untrack)(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}var ue=require("@fluixi/reactive/signal");function Ct(e){let t=C(()=>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 _(a),a};return e.by?(0,ue.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,ue.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Mt=require("@fluixi/reactive/signal");function Pt(e){let t=C(()=>e.each);return(0,Mt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return _(o),o},{fallback:()=>e.fallback??null})}var I=require("@fluixi/reactive/signal");var Lt=require("@fluixi/reactive/signal");var je=Symbol("match");function kt(e){return{[je]:!0,when:C(()=>e.when),children:e.children}}function _t(e){let t=Array.isArray(e.children)?e.children:[e.children];return(0,Lt.createMemo)(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[je]&&o++<10;)r=r();if(!r||typeof r!="object"||r[je]!==!0)continue;let i=r.when();if(wt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}var Dt=require("@fluixi/reactive/signal");function Ot(e){let t=vt(e.component),{component:n,...r}=e;return(0,Dt.createMemo)(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}var fe=require("@fluixi/reactive/signal");function $t(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,fe.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),R(r,e.children)&&U(e.ref,r)}),(0,fe.onCleanup)(()=>{n(),r.remove()}),null}var de=require("@fluixi/reactive/signal");function It(e){let[t,n]=(0,de.createSignal)(null),r=()=>n(null);return(0,de.createMemo)(()=>{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}})}var qt=require("@fluixi/reactive/signal");function jt(e){return(0,qt.createMemo)(()=>{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(" ")})}var Ft=require("@fluixi/reactive/signal");function Ar(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Ht(e){return(0,Ft.createMemo)(()=>{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(`${Ar(r)}: ${i}`)}return n.join("; ")})}var Ve=1,Ue=3,We=8,Vt;Vt=q;var z=class{constructor(){this[Vt]=!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(){}},B=class e extends z{constructor(n){super();this.nodeType=Ue;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)}},pe=class e extends z{constructor(n){super();this.nodeType=We;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Fe=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},He=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}},ye=class e extends z{constructor(n,r=!1){super();this.nodeType=Ve;this.attributes=new Map;this.style=new Fe;this.classList=new He(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 B(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 Rr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Wt=/&/g,Cr=/</g,Mr=/>/g,Pr=/"/g;function Ke(e){return e.replace(Wt,"&").replace(Cr,"<").replace(Mr,">")}function Ut(e){return e.replace(Wt,"&").replace(Pr,""")}function Lr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function kr(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(`${Lr(n)}: ${r}`)}return t.join("; ")}function _r(e){let t="",n=kr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Ut(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Ut(o)}"`}return t}function N(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Ke(e);if(typeof e=="number")return Ke(String(e));if(typeof e=="function")return N(e());if(Array.isArray(e))return e.map(N).join("");switch(e.nodeType){case Ue:return Ke(e.data??"");case We:return`<!--${e.data??""}-->`;case Ve:{let t=e.localName,n=`<${t}${_r(e)}>`;if(Rr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(N).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(N).join(""):""}var Be=require("@fluixi/reactive/signal"),g=require("@fluixi/reactive/signal");var Kt=!1;function Bt(){Kt||(Kt=!0,at({createElement:(e,t)=>new ye(e,t),createText:e=>new B(e),createComment:e=>new pe(e)}))}function Xe(e,t={}){let n=x;Bt(),M(!0);let r=D(t.event);try{return O(r,()=>(0,Be.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return N(i)}finally{o()}}))}finally{M(n)}}var zt=!1;function Dr(){zt||(zt=!0,(0,g.setResourceTracker)(e=>{E()?.pending.add(e)}),(0,g.setResourceIdSource)(()=>E()?.nextResourceId()??""),(0,g.setResourceDataSink)((e,t)=>{e&&E()?.data.set(e,t)}))}var ze=null;function Ge(e){ze=e}function me(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(ze)try{i=ze(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=W(JSON.stringify(t));return`<script type="application/json" id="${$}">${n}<\/script>`}var Or=50;async function Je(e,t={}){let n=x;Bt(),M(!0),Dr();let r=D(t.event);try{return await O(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,Be.createRoot)(f=>{s=f,i=(0,g.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,g.runWithOwner)(i,()=>N(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Or;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,g.flush)(),a()}let c=(0,g.runWithOwner)(i,()=>N(o))+me(r);return s(),c})}finally{M(n)}}
|
|
1
|
+
"use strict";var ge=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Jt=Object.getOwnPropertyNames;var Yt=Object.prototype.hasOwnProperty;var Zt=(e,t)=>{for(var n in t)ge(e,n,{get:t[n],enumerable:!0})},Qt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Jt(t))!Yt.call(e,o)&&o!==n&&ge(e,o,{get:()=>t[o],enumerable:!(r=Gt(t,o))||r.enumerable});return e};var en=e=>Qt(ge({},"__esModule",{value:!0}),e);var $r={};Zt($r,{Dynamic:()=>Ot,ErrorBoundary:()=>It,FX_DATA_ID:()=>$,For:()=>Ct,Index:()=>Pt,Island:()=>Tt,JSX_PROPERTIES:()=>Y,Match:()=>kt,Portal:()=>$t,SVG_ELEMENTS:()=>an,SVG_NAMESPACE:()=>G,Show:()=>Rt,Switch:()=>_t,VOID_ELEMENTS:()=>sn,addClass:()=>un,addDelegatedEventListener:()=>yt,addNativeEventListener:()=>Re,appendChildren:()=>bn,applyElementProp:()=>J,applyProps:()=>ir,applyUse:()=>Ce,asComponent:()=>Fn,asContext:()=>jn,asOutlet:()=>In,asProvider:()=>qn,asRoute:()=>$n,asRouter:()=>Dn,asRoutes:()=>On,asSuspense:()=>Hn,captureHydrationCursor:()=>ut,checkRenderType:()=>Vn,classMap:()=>jt,cleanChildren:()=>w,cloneTemplate:()=>Zn,closest:()=>cn,createComponent:()=>hr,createElement:()=>gn,createNativeElement:()=>Ae,createPortal:()=>lr,createRequestContext:()=>D,createTemplate:()=>Yn,delegate:()=>Sn,delegateEvents:()=>we,escapeFxJson:()=>K,escapeHTML:()=>fr,fnName:()=>Qn,generateID:()=>zn,getAttribute:()=>yn,getGlobal:()=>_n,getLitEventName:()=>rn,getLocals:()=>_e,getOffset:()=>En,getRequestContext:()=>E,getRequestEvent:()=>se,getRequestLocals:()=>ae,getServerData:()=>z,getStableElementId:()=>Kn,getStyle:()=>hn,handleRef:()=>W,hasClass:()=>pn,html:()=>Et,hydrate:()=>ce,hydrateAdvancePast:()=>_,hydrateIslands:()=>Nt,indexArray:()=>I.indexArray,initializeIntegration:()=>mr,insert:()=>R,insertExpression:()=>F,intergartionInitialized:()=>gr,isAccessor:()=>dr,isComponent:()=>T,isContext:()=>it,isCustomElement:()=>Ye,isDOMNode:()=>Ln,isDelegatedEvent:()=>Gn,isDomElement:()=>Z,isDomNode:()=>P,isDomText:()=>Q,isEventHandler:()=>nn,isFunction:()=>Jn,isIntegrationInitialized:()=>xr,isJSXTemplate:()=>Pn,isLitTemplateResult:()=>Qe,isNativeElement:()=>cr,isOutlet:()=>rt,isPromise:()=>j,isProvider:()=>ot,isReactElement:()=>Cn,isRoute:()=>nt,isRouter:()=>et,isRoutes:()=>tt,isSVGElement:()=>ur,isServer:()=>b,isSuspense:()=>st,isTemplateFactory:()=>Mn,isVisible:()=>Tn,iterateFn:()=>er,keyArray:()=>I.keyArray,makeArrayFlat:()=>mt,mapArray:()=>I.mapArray,mergeProps:()=>sr,observeIntersection:()=>wn,observeResize:()=>An,query:()=>xe,queryAll:()=>ln,registerCreateComponent:()=>yr,registerGlobal:()=>kn,removeAttribute:()=>mn,removeChildren:()=>xn,removeClass:()=>fn,removeDelegatedEventListener:()=>ve,render:()=>Pe,renderToString:()=>Xe,renderToStringAsync:()=>Je,resetIntegration:()=>br,runHydrationAt:()=>ft,runWithRequestContext:()=>O,runWithoutHydration:()=>dt,scrollIntoView:()=>Nn,serializeNode:()=>N,serializeResourceData:()=>me,setAttribute:()=>x,setClassList:()=>U,setClassName:()=>V,setDataRedactor:()=>Ge,setDynamicAttribute:()=>te,setDynamicBoolAttribute:()=>Me,setDynamicProperty:()=>ne,setProperty:()=>H,setRequestStore:()=>ke,setServerMode:()=>M,setStyle:()=>re,setStyles:()=>Ze,shouldSetAsProperty:()=>on,splitProps:()=>ar,spread:()=>or,styleMap:()=>Ht,svg:()=>St,toAttributeName:()=>tn,toggleClass:()=>dn,waitForElement:()=>vn});module.exports=en($r);function tn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function nn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function rn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function on(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 sn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),an=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"]),G="http://www.w3.org/2000/svg";function Ye(e){return e.localName.includes("-")}function J(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Ye(e)){e[t]=n;return}x(e,t,n,r)}var Y=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function xe(e,t=document){return t.querySelector(e)}function ln(e,t=document){return Array.from(t.querySelectorAll(e))}function cn(e,t){return e.closest(t)}function un(e,...t){e.classList.add(...t)}function fn(e,...t){e.classList.remove(...t)}function dn(e,...t){t.forEach(n=>e.classList.toggle(n))}function pn(e,t){return e.classList.contains(t)}function x(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 yn(e,t){return e.getAttribute(t)}function mn(e,t){e.removeAttribute(t)}function Ze(e,t){Object.assign(e.style,t)}function hn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function gn(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")Ze(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else x(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function xn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function bn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Tn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Nn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function En(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Sn(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 vn(e,t=5e3){return new Promise((n,r)=>{let o=xe(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=xe(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 wn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function An(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Rn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Cn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rn}function Qe(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Mn(e){if(typeof e!="function")return!1;try{let t=e();return Qe(t)}catch{return!1}}function Pn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Ln(e){return e instanceof Node}function kn(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function _n(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var m=require("@fluixi/reactive/signal");function Dn(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function On(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function $n(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function In(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function qn(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function jn(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Fn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Hn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function et(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function rt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function ot(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function it(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function T(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function st(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Vn(e){return et(e)?{type:"router",value:e}:nt(e)?{type:"route",value:e}:tt(e)?{type:"routes",value:e}:rt(e)?{type:"outlet",value:e}:T(e)?{type:"component",value:e}:st(e)?{type:"suspense",value:e}:ot(e)?{type:"provider",value:e}:it(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var b=typeof document>"u";function M(e){b=e}var q=Symbol.for("fluixi.server-node"),be=null;function at(e){be=e}function Te(){if(!be)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return be}function P(e){return e!=null&&e[q]===!0?!0:typeof Node<"u"&&e instanceof Node}function Z(e){return e!=null&&e[q]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Q(e){return e!=null&&e[q]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},lt=null;function ct(e){lt=e}function Ne(){return lt}function Ee(e,t){return u.active&&t.parentNode===e}function Se(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 ft(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 dt(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 _(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Se(t)}function Un(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 Wn(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 Kn(e){return Wn(Un(e))}var zn=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Bn={};var pt=new Map,ee=new Set,oe=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function we(e){if(!b)for(let t of e)ee.has(t)||oe.has(t)||(ee.add(t),document.addEventListener(t,Xn))}function Xn(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 yt(e,t,n){if(e[`$$${t}`]=n,oe.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}ee.has(t)||we([t])}function ve(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Gn(e){return!oe.has(e)}function Jn(e){return typeof e=="function"}function A(e,t=!1){if(b)return Te().createText(e);if(u.active&&!t){let n=Ne()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ae(e,t=!1){if(b)return Te().createElement(e,t);if(u.active){let n=Ne()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(G,e):document.createElement(e)}function Yn(e,t=!1){let n=pt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,pt.set(e,r),r}function Zn(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function mt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?mt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Qn(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function er(e){if((0,m.isSignal)(e)||T(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,m.isSignal)(t)&&!T(t);)t=t();return t}var v=0,tr=200;function nr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(T(e)&&!(0,m.isSignal)(e)){if(!s.has(e)){v++;try{let l=e();s.set(e,l)}finally{v--}}for(a=s.get(e);typeof a=="function"&&(0,m.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,m.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(T(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((0,m.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,m.isSignal)(a)&&!T(a))break}v++;try{i=F(t,a,n,i,s),o(i)}finally{v--}})}function R(e,t,n,r){if(v>tr)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=F(e,t,n,null)}finally{v--}return()=>o}let a=nr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function F(e,t,n,r,o){if(t==null||typeof t=="boolean")return w(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,r,n);if(j(t)){let s=A("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),w(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&F(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=w(e,r,n)}if(r&&Q(r))return r.data=t,r;let s=A(t);return r&&r.parentNode===e?e.replaceChild(s,r):Ee(e,s)||h(e,s,n),s}if(P(t))return Ee(e,t)?(Se(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),w(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=[];S(t,s,e,n,!0,o,l);let c=rr(e,a,s,n);for(let f of l){let p=R(e,f.sig,f.marker);(0,d.onCleanup)(()=>{w(e,p()),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 F(e,l,n,r)}}}return w(e,r,n)}function S(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"&&!j(l)&&!(0,m.isSignal)(l)&&!T(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(T(l)&&!(0,m.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!j(c)&&!(0,m.isSignal)(c)&&!T(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((0,m.isSignal)(c)){if(s){let p=A("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,m.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?S(f,t,n,r,o,i):S([f],t,n,r,o,i);continue}continue}Array.isArray(c)?S(c,t,n,r,o,i,s):S([c],t,n,r,o,i,s);continue}if(j(l)){let c=A("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(S([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){S(l,t,n,r,o,i,s);continue}if(P(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)?S(f,t,n,r,!1,i):S([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 rr(e,t,n,r){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].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 p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)h(e,n[l++],p)}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 p=t[--i].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,he=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==p+he);)he++;if(he>p-l){let Xt=t[a];for(;l<p;)h(e,n[l++],Xt)}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 w(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 H(e,t,n){n==null?delete e[t]:e[t]=n}function Re(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 Ce(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 te(e,t,n,r=!1){return typeof n!="function"?(x(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;x(e,t,o,r)})}function ne(e,t,n){return typeof n!="function"?(H(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;H(e,t,r)})}function Me(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();x(e,t,!!r)})}function V(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createEffect)(()=>{V(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 U(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((0,d.createRenderEffect)(()=>{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 re(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 or(e){let{element:t,props:n,prevProps:r=Bn,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!Z(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===G,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"){W(c,t);continue}if(l==="use"){Ce(t,c);continue}if(l.startsWith("on:")){a.push(Re(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(ne(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(te(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Me(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>V(t,c()))):V(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>U(t,c()))):U(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>re(t,c()))):re(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&ve(t,y),c&&yt(t,y,c);continue}let p=Y.has(l)||!s&&l in t;typeof c=="function"?a.push(p?ne(t,l,c):te(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?H(t,l,n[l]):x(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();ve(t,c)}else Y.has(l)?H(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function ir(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){W(o,e);continue}if(r!=="children"){if(r==="use"){Ce(e,o);continue}if(r.startsWith("on:")){Re(e,r.slice(3),o);continue}if(r.startsWith("prop:")){ne(e,r.slice(5),o);continue}if(r.startsWith("attr:")){te(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Me(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(oe.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,ee.has(i)||we([i]);continue}if(r==="class"||r==="className"){V(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>U(e,o())):U(e,o);continue}if(r==="style"){re(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{s()})}else{let i=!0;(0,d.createRenderEffect)(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();J(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>J(e,r,t[r],n))}}}function sr(...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 ar(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 W(e,t){if(e){if(P(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 lr(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):P(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function cr(e){return typeof e=="string"&&e.toLowerCase()===e}function ur(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 fr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function j(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function dr(e){return typeof e=="function"&&e.length===0&&(0,m.isSignal)(e)}function Pe(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),R(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var pr="__fx_dom_create_component__",L=globalThis[pr]??={fn:null};function yr(e){L.fn=e}function mr(e={}){let t=e.signalSystem?.createComponent;t&&(L.fn=t)}function hr(e,t){return L.fn?L.fn(e,t):(()=>e(t))}var gr=()=>L.fn!==null,xr=()=>L.fn!==null;function br(){L.fn=null}var ie,gt={getStore:()=>ie,run(e,t){let n=ie;ie=e;try{return t()}finally{ie=n}}},Le=gt;function ke(e){Le=e??gt}function D(e={}){e.locals||(e.locals=e.request?ae(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 O(e,t){return Le.run(e,t)}function E(){return Le.getStore()}function se(){return E()?.event}function _e(){let e=se();return e?(e.locals||(e.locals={}),e.locals):{}}var ht=new WeakMap;function ae(e){let t=ht.get(e);return t||(t={},ht.set(e,t)),t}var le=require("@fluixi/reactive/signal");var $="__FX_DATA__";function K(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var De;function z(){let e=globalThis.__FX_DATA__;if(e)return e;if(De!==void 0)return De;let t=null;if(typeof document<"u"){let n=document.getElementById($)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return De=t}function Oe(){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 Tr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),$e=typeof process<"u"&&process.env&&!1;function Ie(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 Nr(e){Oe();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Tr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):($e&&t&&Ie(`<${e}>`,t),null)}function Er(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Oe();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):($e&&t&&Ie(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Sr(e){Oe();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):($e&&t&&Ie(`marker <!--${e.slice(0,24)}-->`,t),null)}var xt=!1;function vr(){xt||(xt=!0,ct({hydrateElement:Nr,hydrateText:Er,hydrateMarker:Sr}))}function ce(e,t,n){vr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=z(),o=n?.resourceNamespace,i=0;(0,le.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,le.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return Pe(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var qe="fluixi-island";function Tt(e){let{component:t,props:n={},name:r}=e,o=Ae(qe),i=r??t.name??"Island";x(o,"name",i),x(o,"props",JSON.stringify(n??{}));let s=b?E():void 0;if(s){let a=s.nextIslandNamespace(i);R(o,()=>s.withResourceScope(a,()=>t(n)))}else R(o,()=>t(n));return o}var bt=!1;function wr(){if(bt||typeof document>"u")return;bt=!0;let e=document.createElement("style");e.textContent=`${qe}{display:contents}`,document.head.appendChild(e)}function Nt(e){if(typeof document>"u")return;wr();let t=document.querySelectorAll(qe),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{}ce(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Et(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function St(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var k=require("@fluixi/reactive/signal");function vt(e){return typeof e=="function"?e:(()=>e)}function C(e){return()=>{let t=e();return typeof t=="function"?t():t}}function wt(e){return e!=null&&e!==!1}function At(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Rt(e){let t=C(()=>e.when),n=(0,k.createMemo)(t,void 0),r=(0,k.createMemo)(n,void 0);return(0,k.createMemo)(()=>{if(r()){let i=e.children;return typeof i=="function"&&!At(i)?typeof n=="function"?(0,k.untrack)(()=>(0,k.untrack)(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}var ue=require("@fluixi/reactive/signal");function Ct(e){let t=C(()=>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 _(a),a};return e.by?(0,ue.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,ue.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Mt=require("@fluixi/reactive/signal");function Pt(e){let t=C(()=>e.each);return(0,Mt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return _(o),o},{fallback:()=>e.fallback??null})}var I=require("@fluixi/reactive/signal");var Lt=require("@fluixi/reactive/signal");var je=Symbol("match");function kt(e){return{[je]:!0,when:C(()=>e.when),children:e.children}}function _t(e){let t=Array.isArray(e.children)?e.children:[e.children];return(0,Lt.createMemo)(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[je]&&o++<10;)r=r();if(!r||typeof r!="object"||r[je]!==!0)continue;let i=r.when();if(wt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}var Dt=require("@fluixi/reactive/signal");function Ot(e){let t=vt(e.component),{component:n,...r}=e;return(0,Dt.createMemo)(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}var fe=require("@fluixi/reactive/signal");function $t(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,fe.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),R(r,e.children)&&W(e.ref,r)}),(0,fe.onCleanup)(()=>{n(),r.remove()}),null}var de=require("@fluixi/reactive/signal");function It(e){let[t,n]=(0,de.createSignal)(null),r=()=>n(null);return(0,de.createMemo)(()=>{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}})}var qt=require("@fluixi/reactive/signal");function jt(e){return(0,qt.createMemo)(()=>{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(" ")})}var Ft=require("@fluixi/reactive/signal");function Ar(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Ht(e){return(0,Ft.createMemo)(()=>{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(`${Ar(r)}: ${i}`)}return n.join("; ")})}var Ve=1,Ue=3,We=8,Vt;Vt=q;var B=class{constructor(){this[Vt]=!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(){}},X=class e extends B{constructor(n){super();this.nodeType=Ue;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)}},pe=class e extends B{constructor(n){super();this.nodeType=We;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Fe=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},He=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}},ye=class e extends B{constructor(n,r=!1){super();this.nodeType=Ve;this.attributes=new Map;this.style=new Fe;this.classList=new He(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 X(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 Rr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Wt=/&/g,Cr=/</g,Mr=/>/g,Pr=/"/g;function Ke(e){return e.replace(Wt,"&").replace(Cr,"<").replace(Mr,">")}function Ut(e){return e.replace(Wt,"&").replace(Pr,""")}function Lr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function kr(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(`${Lr(n)}: ${r}`)}return t.join("; ")}function _r(e){let t="",n=kr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Ut(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Ut(o)}"`}return t}function N(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Ke(e);if(typeof e=="number")return Ke(String(e));if(typeof e=="function")return N(e());if(Array.isArray(e))return e.map(N).join("");switch(e.nodeType){case Ue:return Ke(e.data??"");case We:return`<!--${e.data??""}-->`;case Ve:{let t=e.localName,n=`<${t}${_r(e)}>`;if(Rr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(N).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(N).join(""):""}var Be=require("@fluixi/reactive/signal"),g=require("@fluixi/reactive/signal");var Kt=!1;function Bt(){Kt||(Kt=!0,at({createElement:(e,t)=>new ye(e,t),createText:e=>new X(e),createComment:e=>new pe(e)}))}function Xe(e,t={}){let n=b;Bt(),M(!0);let r=D(t.event);try{return O(r,()=>(0,Be.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return N(i)}finally{o()}}))}finally{M(n)}}var zt=!1;function Dr(){zt||(zt=!0,(0,g.setResourceTracker)(e=>{E()?.pending.add(e)}),(0,g.setResourceIdSource)(()=>E()?.nextResourceId()??""),(0,g.setResourceDataSink)((e,t)=>{e&&E()?.data.set(e,t)}))}var ze=null;function Ge(e){ze=e}function me(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(ze)try{i=ze(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=K(JSON.stringify(t));return`<script type="application/json" id="${$}">${n}<\/script>`}var Or=50;async function Je(e,t={}){let n=b;Bt(),M(!0),Dr();let r=D(t.event);try{return await O(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,Be.createRoot)(f=>{s=f,i=(0,g.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,g.runWithOwner)(i,()=>N(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Or;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,g.flush)(),a()}let c=(0,g.runWithOwner)(i,()=>N(o))+me(r);return s(),c})}finally{M(n)}}
|