@fluixi/dom 1.0.0-alpha.71 → 1.0.0-alpha.73
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/dynamic-element.cjs +1 -1
- package/dist/lib/dom/dynamic-element.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 +9 -1
- package/dist/lib/dom/runtime.mjs +1 -1
- package/dist/lib/dom/versions.cjs +1 -1
- package/dist/lib/dom/versions.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/dist/version.generated.cjs +1 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/version.generated.mjs +1 -1
- package/package.json +3 -3
package/dist/lib/dom/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Q=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ve=Object.prototype.hasOwnProperty;var We=(e,t)=>{for(var n in t)Q(e,n,{get:t[n],enumerable:!0})},Ke=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qe(t))!Ve.call(e,r)&&r!==n&&Q(e,r,{get:()=>t[r],enumerable:!(o=je(t,r))||o.enumerable});return e};var Be=e=>Ke(Q({},"__esModule",{value:!0}),e);var yn={};We(yn,{Island:()=>De,JSX_PROPERTIES:()=>D,SVG_ELEMENTS:()=>Ye,SVG_NAMESPACE:()=>O,VOID_ELEMENTS:()=>Ue,addClass:()=>et,addDelegatedEventListener:()=>Le,addNativeEventListener:()=>ae,appendChildren:()=>ut,applyElementProp:()=>k,applyProps:()=>Vt,applyUse:()=>fe,captureHydrationCursor:()=>ve,cleanChildren:()=>w,cloneTemplate:()=>Me,closest:()=>Qe,createComponent:()=>Qt,createElement:()=>at,createNativeElement:()=>se,createPortal:()=>Bt,createTemplate:()=>Pe,delegate:()=>pt,delegateEvents:()=>ie,escapeHTML:()=>Xt,fnName:()=>kt,generateID:()=>At,getAttribute:()=>rt,getGlobal:()=>wt,getLitEventName:()=>Xe,getOffset:()=>dt,getStableElementId:()=>Ct,getStyle:()=>st,handleRef:()=>le,hasClass:()=>ot,holeContent:()=>Ot,holeEnd:()=>$t,holeScope:()=>It,hydrate:()=>Y,hydrateAdvancePast:()=>Ae,hydrateIslands:()=>Fe,initializeIntegration:()=>Zt,insert:()=>A,insertExpression:()=>P,intergartionInitialized:()=>en,isAccessor:()=>zt,isCustomElement:()=>ye,isDOMNode:()=>Nt,isDelegatedEvent:()=>Pt,isDomElement:()=>H,isDomNode:()=>v,isDomText:()=>j,isEventHandler:()=>Je,isFunction:()=>Mt,isIntegrationInitialized:()=>tn,isJSXTemplate:()=>bt,isLitTemplateResult:()=>ge,isNativeElement:()=>Gt,isPromise:()=>L,isReactElement:()=>ht,isSVGElement:()=>Jt,isServer:()=>E,isTemplateFactory:()=>Et,isVisible:()=>lt,iterateFn:()=>Dt,makeArrayFlat:()=>_e,mergeProps:()=>Wt,observeIntersection:()=>mt,observeResize:()=>gt,query:()=>ee,queryAll:()=>Ze,registerCreateComponent:()=>Yt,registerGlobal:()=>Tt,removeAttribute:()=>it,removeChildren:()=>ft,removeClass:()=>tt,removeDelegatedEventListener:()=>re,render:()=>ce,resetIntegration:()=>nn,runHydrationAt:()=>R,runWithoutHydration:()=>Ce,scrollIntoView:()=>ct,setAttribute:()=>x,setClassList:()=>I,setClassName:()=>_,setDynamicAttribute:()=>W,setDynamicBoolAttribute:()=>ue,setDynamicProperty:()=>K,setProperty:()=>M,setServerMode:()=>Te,setStyle:()=>$,setStyles:()=>me,shouldSetAsProperty:()=>ze,splitProps:()=>Kt,spread:()=>qt,templateNode:()=>_t,toAttributeName:()=>Ge,toggleClass:()=>nt,waitForElement:()=>yt});module.exports=Be(yn);function Ge(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Je(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Xe(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function ze(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var Ue=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ye=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),O="http://www.w3.org/2000/svg";function ye(e){return e.localName.includes("-")}function k(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ye(e)){e[t]=n;return}x(e,t,n,o)}var D=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ee(e,t=document){return t.querySelector(e)}function Ze(e,t=document){return Array.from(t.querySelectorAll(e))}function Qe(e,t){return e.closest(t)}function et(e,...t){e.classList.add(...t)}function tt(e,...t){e.classList.remove(...t)}function nt(e,...t){t.forEach(n=>e.classList.toggle(n))}function ot(e,t){return e.classList.contains(t)}function x(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))}function rt(e,t){return e.getAttribute(t)}function it(e,t){e.removeAttribute(t)}function me(e,t){Object.assign(e.style,t)}function st(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function at(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")me(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function ft(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ut(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function lt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function ct(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function dt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function pt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function yt(e,t=5e3){return new Promise((n,o)=>{let r=ee(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=ee(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function mt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function gt(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var xt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ht(e){return typeof e=="object"&&e!==null&&e.$$typeof===xt}function ge(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Et(e){if(typeof e!="function")return!1;try{let t=e();return ge(t)}catch{return!1}}function bt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Nt(e){return e instanceof Node}function Tt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function wt(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");var xe="1.0.0-alpha.71";var he=require("@fluixi/reactive"),h={dom:xe,reactive:he.VERSION};function Ee(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function be(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var c=require("@fluixi/reactive/signal");var E=typeof document>"u";function Te(e){E=e}var te=Symbol.for("fluixi.server-node"),Ne=null;function F(){if(!Ne)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Ne}function v(e){return e!=null&&e[te]===!0?!0:typeof Node<"u"&&e instanceof Node}function H(e){return e!=null&&e[te]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function j(e){return e!=null&&e[te]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},we=null;function Se(e){we=e}function q(){return we}function ne(e,t){return l.active&&t.parentNode===e}function oe(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function ve(){return l.active?l.cursor:null}function R(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Ce(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Ae(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&oe(t)}function St(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,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function vt(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 Ct(e){return vt(St(e))}var At=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Rt={};var Re=new Map,V=new Set,B=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ie(e){if(!E)for(let t of e)V.has(t)||B.has(t)||(V.add(t),document.addEventListener(t,Lt))}function Lt(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 Le(e,t,n){if(e[`$$${t}`]=n,B.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}V.has(t)||ie([t])}function re(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Pt(e){return!B.has(e)}function Mt(e){return typeof e=="function"}function S(e,t=!1){if(E)return F().createText(e);if(l.active&&!t){let n=q()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function se(e,t=!1){if(E)return F().createElement(e,t);if(l.active){let n=q()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(O,e):document.createElement(e)}function Pe(e,t=!1){let n=Re.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,Re.set(e,o),o}function _t(e,t,n=!1,o=!1){if(E){let r=F();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=q()?.hydrateStatic(t);if(r)return r}return Me(Pe(e,o),o).firstChild}function It(e,t){if(!l.active)return t();let n=R(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?R(e.nextSibling,()=>o(...r)):o(...r))}return n}function $t(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Ot(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Me(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function _e(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?_e(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function kt(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Dt(e){if((0,m.isSignal)(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,m.isSignal)(t)&&!b(t);)t=t();return t}var T=0,Ft=200;function Ht(e,t,n,o,r){let f=o,s=new Map;return(0,c.createRenderEffect)(()=>{let i;if(b(e)&&!(0,m.isSignal)(e)){if(!s.has(e)){T++;try{let a=e();s.set(e,a)}finally{T--}}for(i=s.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(b(i)){if(!s.has(i)){let u=i;T++;try{let d=u();s.set(u,d)}finally{T--}}i=s.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!b(i))break}T++;try{f=P(t,i,n,f,s),r(f)}finally{T--}})}function A(e,t,n,o){if(T>Ft)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=S("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){T++;try{r=P(e,t,n,null)}finally{T--}return()=>r}let i=Ht(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function P(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(L(t)){let s=S("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),w(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(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 f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=S(t);return g(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&j(o))return o.data=t,o;let s=S(t);return o&&o.parentNode===e?e.replaceChild(s,o):ne(e,s)||g(e,s,n),s}if(v(t))return ne(e,t)?(oe(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];N(t,s,e,n,!0,r,a);let u=jt(e,i,s,n);for(let d of a){let p=A(e,d.sig,d.marker);(0,c.onCleanup)(()=>{w(e,p()),d.marker.parentNode===e&&e.removeChild(d.marker)})}return u}if(f==="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 a=i.type(i.props||{});return P(e,a,n,o)}}}return w(e,o,n)}function N(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!L(a)&&!(0,m.isSignal)(a)&&!b(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(b(a)&&!(0,m.isSignal)(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!L(u)&&!(0,m.isSignal)(u)&&!b(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,m.isSignal)(u)){if(s){let p=S("",!0);t.push(p),s.push({marker:p,sig:u});continue}let d=u();for(;typeof d=="function"&&(0,m.isSignal)(d);)d=d();if(d==null||typeof d=="boolean")continue;Array.isArray(d)?N(d,t,n,o,r,f):N([d],t,n,o,r,f);continue}continue}Array.isArray(u)?N(u,t,n,o,r,f,s):N([u],t,n,o,r,f,s);continue}if(L(a)){let u=S("",!0);t.push(u),a.then(d=>{if(u.parentNode){let p=[];if(N([d],p,u.parentNode,void 0,!1,f),p.length>0){u.parentNode.replaceChild(p[0],u);for(let y=1;y<p.length;y++)u.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(d=>console.error("Error resolving promise in array:",d));continue}if(Array.isArray(a)){N(a,t,n,o,r,f,s);continue}if(v(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let d=u.type(u.props||{});Array.isArray(d)?N(d,t,n,o,!1,f):N([d],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(S(u));continue}t.push(S(String(a)))}}}}function jt(e,t,n,o){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 r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,d=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let p=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)g(e,n[a++],p)}else if(s===a)for(;i<f;)(!d||!d.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let p=t[--f].nextSibling;g(e,n[a++],t[i++].nextSibling),g(e,n[--s],p),t[f]=t[i-1]}else{if(!d){d=new Map;let y=a;for(;y<s;)d.set(n[y],y++)}let p=d.get(t[i]);if(p!=null)if(a<p&&p<s){let y=i,Z=1;for(;++y<f&&y<s&&!(!d.has(t[y])||d.get(t[y])!==p+Z);)Z++;if(Z>p-a){let He=t[i];for(;a<p;)g(e,n[a++],He)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(g(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(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 g(e,t,n){l.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 ae(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function fe(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};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 W(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):(0,c.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function K(e,t,n){return typeof n!="function"?(M(e,t,n),()=>{}):(0,c.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;M(e,t,o)})}function ue(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,c.createRenderEffect)(()=>{let o=n();x(e,t,!!o)})}function _(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,c.createRenderEffect)(()=>_(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 r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function I(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,c.createRenderEffect)(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function $(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 r=n[o];r==null?e.style[o]="":e.style[o]=r}}function qt(e){let{element:t,props:n,prevProps:o=Rt,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!H(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===O,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],d=o[a];if(u===d)continue;if(a==="ref"){le(u,t);continue}if(a==="use"){fe(t,u);continue}if(a.startsWith("on:")){i.push(ae(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(K(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(W(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(ue(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>_(t,u()))):_(t,u);continue}if(a==="classList"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>I(t,u()))):I(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>$(t,u()))):$(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();d&&re(t,y),u&&Le(t,y,u);continue}let p=D.has(a)||!s&&a in t;typeof u=="function"?i.push(p?K(t,a,u):W(t,a,u,s)):i.push((0,c.createRenderEffect)(()=>p?M(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();re(t,u)}else D.has(a)?M(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function Vt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){le(r,e);continue}if(o!=="children"){if(o==="use"){fe(e,r);continue}if(o.startsWith("on:")){ae(e,o.slice(3),r);continue}if(o.startsWith("prop:")){K(e,o.slice(5),r);continue}if(o.startsWith("attr:")){W(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){ue(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(B.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,V.has(f)||ie([f]);continue}if(o==="class"||o==="className"){_(e,r);continue}if(o==="classList"){typeof r=="function"?(0,c.createRenderEffect)(()=>I(e,r())):I(e,r);continue}if(o==="style"){typeof r=="function"?(0,c.createRenderEffect)(()=>$(e,r())):$(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,c.onCleanup)(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=(0,c.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,c.onCleanup)(()=>{s()})}else{let f=!0;(0,c.createRenderEffect)(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();k(e,o,s,n)});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>k(e,o,t[o],n))}}}function Wt(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function Kt(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]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=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[...r,f]}function le(e,t){if(e){if(v(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 Bt(e,t,n){let o=t||document.body,r=(0,c.readChildren)(()=>e),f=[];return(0,c.batch)(()=>{let s=(0,c.createRenderEffect)(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):v(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),(0,c.onCleanup)(()=>{f.forEach(i=>i())})}),null}function Gt(e){return typeof e=="string"&&e.toLowerCase()===e}function Jt(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 Xt(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 zt(e){return typeof e=="function"&&e.length===0&&(0,m.isSignal)(e)}function ce(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return(0,c.createRoot)(s=>{(0,c.batch)(()=>{l.active||(t.textContent=""),Ee(t),be(),A(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var Ut="__fx_dom_create_component__",C=globalThis[Ut]??={fn:null};function Yt(e){C.fn=e}function Zt(e={}){let t=e.signalSystem?.createComponent;t&&(C.fn=t)}function Qt(e,t){return C.fn?C.fn(e,t):(()=>e(t))}var en=()=>C.fn!==null,tn=()=>C.fn!==null;function nn(){C.fn=null}var G,on={getStore:()=>G,run(e,t){let n=G;G=e;try{return t()}finally{G=n}}},rn=on;function Ie(){return rn.getStore()}var J=require("@fluixi/reactive/signal");var sn="__FX_DATA__";var de;function $e(){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(sn)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return de=t}function X(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var an=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),z=typeof process<"u"&&process.env&&!1;function U(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 fn(e){X();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(an.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(z&&t&&U(`<${e}>`,t),null)}function un(e){X();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(z&&t&&U(`<${e}> (static)`,t),null)}function ln(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}X();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(z&&t&&U(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function cn(e){X();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(z&&t&&U(`marker <!--${e.slice(0,24)}-->`,t),null)}var Oe=!1;function dn(){Oe||(Oe=!0,Se({hydrateElement:fn,hydrateText:ln,hydrateMarker:cn,hydrateStatic:un}))}function Y(e,t,n){dn(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=$e(),r=n?.resourceNamespace,f=0;(0,J.setResourceIdSource)(()=>r?`${r}:r${f++}`:`r${f++}`),(0,J.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return ce(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var pe="fluixi-island";function De(e){let{component:t,props:n={},name:o}=e,r=se(pe),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=E?Ie():void 0;if(s){let i=s.nextIslandNamespace(f);A(r,()=>s.withResourceScope(i,()=>t(n)))}else A(r,()=>t(n));return r}var ke=!1;function pn(){if(ke||typeof document>"u")return;ke=!0;let e=document.createElement("style");e.textContent=`${pe}{display:contents}`,document.head.appendChild(e)}function Fe(e){if(typeof document>"u")return;pn();let t=document.querySelectorAll(pe),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}Y(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}
|
|
1
|
+
"use strict";var Q=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ve=Object.prototype.hasOwnProperty;var We=(e,t)=>{for(var n in t)Q(e,n,{get:t[n],enumerable:!0})},Ke=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qe(t))!Ve.call(e,r)&&r!==n&&Q(e,r,{get:()=>t[r],enumerable:!(o=je(t,r))||o.enumerable});return e};var Be=e=>Ke(Q({},"__esModule",{value:!0}),e);var yn={};We(yn,{Island:()=>De,JSX_PROPERTIES:()=>D,SVG_ELEMENTS:()=>Ye,SVG_NAMESPACE:()=>O,VOID_ELEMENTS:()=>Ue,addClass:()=>et,addDelegatedEventListener:()=>Le,addNativeEventListener:()=>ae,appendChildren:()=>ut,applyElementProp:()=>k,applyProps:()=>Vt,applyUse:()=>fe,captureHydrationCursor:()=>ve,cleanChildren:()=>w,cloneTemplate:()=>Me,closest:()=>Qe,createComponent:()=>Qt,createElement:()=>at,createNativeElement:()=>se,createPortal:()=>Bt,createTemplate:()=>Pe,delegate:()=>pt,delegateEvents:()=>ie,escapeHTML:()=>Xt,fnName:()=>kt,generateID:()=>At,getAttribute:()=>rt,getGlobal:()=>wt,getLitEventName:()=>Xe,getOffset:()=>dt,getStableElementId:()=>Ct,getStyle:()=>st,handleRef:()=>le,hasClass:()=>ot,holeContent:()=>Ot,holeEnd:()=>$t,holeScope:()=>It,hydrate:()=>Y,hydrateAdvancePast:()=>Ae,hydrateIslands:()=>Fe,initializeIntegration:()=>Zt,insert:()=>A,insertExpression:()=>P,intergartionInitialized:()=>en,isAccessor:()=>zt,isCustomElement:()=>ye,isDOMNode:()=>Nt,isDelegatedEvent:()=>Pt,isDomElement:()=>H,isDomNode:()=>v,isDomText:()=>j,isEventHandler:()=>Je,isFunction:()=>Mt,isIntegrationInitialized:()=>tn,isJSXTemplate:()=>bt,isLitTemplateResult:()=>ge,isNativeElement:()=>Gt,isPromise:()=>L,isReactElement:()=>ht,isSVGElement:()=>Jt,isServer:()=>E,isTemplateFactory:()=>Et,isVisible:()=>lt,iterateFn:()=>Dt,makeArrayFlat:()=>_e,mergeProps:()=>Wt,observeIntersection:()=>mt,observeResize:()=>gt,query:()=>ee,queryAll:()=>Ze,registerCreateComponent:()=>Yt,registerGlobal:()=>Tt,removeAttribute:()=>it,removeChildren:()=>ft,removeClass:()=>tt,removeDelegatedEventListener:()=>re,render:()=>ce,resetIntegration:()=>nn,runHydrationAt:()=>R,runWithoutHydration:()=>Ce,scrollIntoView:()=>ct,setAttribute:()=>x,setClassList:()=>I,setClassName:()=>_,setDynamicAttribute:()=>W,setDynamicBoolAttribute:()=>ue,setDynamicProperty:()=>K,setProperty:()=>M,setServerMode:()=>Te,setStyle:()=>$,setStyles:()=>me,shouldSetAsProperty:()=>ze,splitProps:()=>Kt,spread:()=>qt,templateNode:()=>_t,toAttributeName:()=>Ge,toggleClass:()=>nt,waitForElement:()=>yt});module.exports=Be(yn);function Ge(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Je(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Xe(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function ze(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var Ue=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ye=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),O="http://www.w3.org/2000/svg";function ye(e){return e.localName.includes("-")}function k(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ye(e)){e[t]=n;return}x(e,t,n,o)}var D=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ee(e,t=document){return t.querySelector(e)}function Ze(e,t=document){return Array.from(t.querySelectorAll(e))}function Qe(e,t){return e.closest(t)}function et(e,...t){e.classList.add(...t)}function tt(e,...t){e.classList.remove(...t)}function nt(e,...t){t.forEach(n=>e.classList.toggle(n))}function ot(e,t){return e.classList.contains(t)}function x(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))}function rt(e,t){return e.getAttribute(t)}function it(e,t){e.removeAttribute(t)}function me(e,t){Object.assign(e.style,t)}function st(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function at(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")me(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function ft(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ut(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function lt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function ct(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function dt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function pt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function yt(e,t=5e3){return new Promise((n,o)=>{let r=ee(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=ee(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function mt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function gt(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var xt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ht(e){return typeof e=="object"&&e!==null&&e.$$typeof===xt}function ge(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Et(e){if(typeof e!="function")return!1;try{let t=e();return ge(t)}catch{return!1}}function bt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Nt(e){return e instanceof Node}function Tt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function wt(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");var xe="1.0.0-alpha.73";var he=require("@fluixi/reactive"),h={dom:xe,reactive:he.VERSION};function Ee(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function be(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var c=require("@fluixi/reactive/signal");var E=typeof document>"u";function Te(e){E=e}var te=Symbol.for("fluixi.server-node"),Ne=null;function F(){if(!Ne)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Ne}function v(e){return e!=null&&e[te]===!0?!0:typeof Node<"u"&&e instanceof Node}function H(e){return e!=null&&e[te]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function j(e){return e!=null&&e[te]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},we=null;function Se(e){we=e}function q(){return we}function ne(e,t){return l.active&&t.parentNode===e}function oe(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function ve(){return l.active?l.cursor:null}function R(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Ce(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Ae(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&oe(t)}function St(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,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function vt(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 Ct(e){return vt(St(e))}var At=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Rt={};var Re=new Map,V=new Set,B=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ie(e){if(!E)for(let t of e)V.has(t)||B.has(t)||(V.add(t),document.addEventListener(t,Lt))}function Lt(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 Le(e,t,n){if(e[`$$${t}`]=n,B.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}V.has(t)||ie([t])}function re(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Pt(e){return!B.has(e)}function Mt(e){return typeof e=="function"}function S(e,t=!1){if(E)return F().createText(e);if(l.active&&!t){let n=q()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function se(e,t=!1){if(E)return F().createElement(e,t);if(l.active){let n=q()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(O,e):document.createElement(e)}function Pe(e,t=!1){let n=Re.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,Re.set(e,o),o}function _t(e,t,n=!1,o=!1){if(E){let r=F();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=q()?.hydrateStatic(t);if(r)return r}return Me(Pe(e,o),o).firstChild}function It(e,t){if(!l.active)return t();let n=R(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?R(e.nextSibling,()=>o(...r)):o(...r))}return n}function $t(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Ot(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Me(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function _e(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?_e(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function kt(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Dt(e){if((0,m.isSignal)(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,m.isSignal)(t)&&!b(t);)t=t();return t}var T=0,Ft=200;function Ht(e,t,n,o,r){let f=o,s=new Map;return(0,c.createRenderEffect)(()=>{let i;if(b(e)&&!(0,m.isSignal)(e)){if(!s.has(e)){T++;try{let a=e();s.set(e,a)}finally{T--}}for(i=s.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(b(i)){if(!s.has(i)){let u=i;T++;try{let d=u();s.set(u,d)}finally{T--}}i=s.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!b(i))break}T++;try{f=P(t,i,n,f,s),r(f)}finally{T--}})}function A(e,t,n,o){if(T>Ft)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=S("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){T++;try{r=P(e,t,n,null)}finally{T--}return()=>r}let i=Ht(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function P(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(L(t)){let s=S("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),w(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(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 f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=S(t);return g(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&j(o))return o.data=t,o;let s=S(t);return o&&o.parentNode===e?e.replaceChild(s,o):ne(e,s)||g(e,s,n),s}if(v(t))return ne(e,t)?(oe(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];N(t,s,e,n,!0,r,a);let u=jt(e,i,s,n);for(let d of a){let p=A(e,d.sig,d.marker);(0,c.onCleanup)(()=>{w(e,p()),d.marker.parentNode===e&&e.removeChild(d.marker)})}return u}if(f==="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 a=i.type(i.props||{});return P(e,a,n,o)}}}return w(e,o,n)}function N(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!L(a)&&!(0,m.isSignal)(a)&&!b(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(b(a)&&!(0,m.isSignal)(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!L(u)&&!(0,m.isSignal)(u)&&!b(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,m.isSignal)(u)){if(s){let p=S("",!0);t.push(p),s.push({marker:p,sig:u});continue}let d=u();for(;typeof d=="function"&&(0,m.isSignal)(d);)d=d();if(d==null||typeof d=="boolean")continue;Array.isArray(d)?N(d,t,n,o,r,f):N([d],t,n,o,r,f);continue}continue}Array.isArray(u)?N(u,t,n,o,r,f,s):N([u],t,n,o,r,f,s);continue}if(L(a)){let u=S("",!0);t.push(u),a.then(d=>{if(u.parentNode){let p=[];if(N([d],p,u.parentNode,void 0,!1,f),p.length>0){u.parentNode.replaceChild(p[0],u);for(let y=1;y<p.length;y++)u.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(d=>console.error("Error resolving promise in array:",d));continue}if(Array.isArray(a)){N(a,t,n,o,r,f,s);continue}if(v(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let d=u.type(u.props||{});Array.isArray(d)?N(d,t,n,o,!1,f):N([d],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(S(u));continue}t.push(S(String(a)))}}}}function jt(e,t,n,o){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].cloneNode(!0))}let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,d=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let p=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)g(e,n[a++],p)}else if(s===a)for(;i<f;)(!d||!d.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let p=t[--f].nextSibling;g(e,n[a++],t[i++].nextSibling),g(e,n[--s],p),t[f]=t[i-1]}else{if(!d){d=new Map;let y=a;for(;y<s;)d.set(n[y],y++)}let p=d.get(t[i]);if(p!=null)if(a<p&&p<s){let y=i,Z=1;for(;++y<f&&y<s&&!(!d.has(t[y])||d.get(t[y])!==p+Z);)Z++;if(Z>p-a){let He=t[i];for(;a<p;)g(e,n[a++],He)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(g(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(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 g(e,t,n){l.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 ae(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function fe(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};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 W(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):(0,c.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function K(e,t,n){return typeof n!="function"?(M(e,t,n),()=>{}):(0,c.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;M(e,t,o)})}function ue(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,c.createRenderEffect)(()=>{let o=n();x(e,t,!!o)})}function _(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,c.createRenderEffect)(()=>_(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 r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function I(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,c.createRenderEffect)(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function $(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 r=n[o];r==null?e.style[o]="":e.style[o]=r}}function qt(e){let{element:t,props:n,prevProps:o=Rt,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!H(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===O,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],d=o[a];if(u===d)continue;if(a==="ref"){le(u,t);continue}if(a==="use"){fe(t,u);continue}if(a.startsWith("on:")){i.push(ae(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(K(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(W(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(ue(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>_(t,u()))):_(t,u);continue}if(a==="classList"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>I(t,u()))):I(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>$(t,u()))):$(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();d&&re(t,y),u&&Le(t,y,u);continue}let p=D.has(a)||!s&&a in t;typeof u=="function"?i.push(p?K(t,a,u):W(t,a,u,s)):i.push((0,c.createRenderEffect)(()=>p?M(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();re(t,u)}else D.has(a)?M(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function Vt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){le(r,e);continue}if(o!=="children"){if(o==="use"){fe(e,r);continue}if(o.startsWith("on:")){ae(e,o.slice(3),r);continue}if(o.startsWith("prop:")){K(e,o.slice(5),r);continue}if(o.startsWith("attr:")){W(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){ue(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(B.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,V.has(f)||ie([f]);continue}if(o==="class"||o==="className"){_(e,r);continue}if(o==="classList"){typeof r=="function"?(0,c.createRenderEffect)(()=>I(e,r())):I(e,r);continue}if(o==="style"){typeof r=="function"?(0,c.createRenderEffect)(()=>$(e,r())):$(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,c.onCleanup)(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=(0,c.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,c.onCleanup)(()=>{s()})}else{let f=!0;(0,c.createRenderEffect)(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();k(e,o,s,n)});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>k(e,o,t[o],n))}}}function Wt(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function Kt(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]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=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[...r,f]}function le(e,t){if(e){if(v(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 Bt(e,t,n){let o=t||document.body,r=(0,c.readChildren)(()=>e),f=[];return(0,c.batch)(()=>{let s=(0,c.createRenderEffect)(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):v(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),(0,c.onCleanup)(()=>{f.forEach(i=>i())})}),null}function Gt(e){return typeof e=="string"&&e.toLowerCase()===e}function Jt(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 Xt(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 zt(e){return typeof e=="function"&&e.length===0&&(0,m.isSignal)(e)}function ce(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return(0,c.createRoot)(s=>{(0,c.batch)(()=>{l.active||(t.textContent=""),Ee(t),be(),A(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var Ut="__fx_dom_create_component__",C=globalThis[Ut]??={fn:null};function Yt(e){C.fn=e}function Zt(e={}){let t=e.signalSystem?.createComponent;t&&(C.fn=t)}function Qt(e,t){return C.fn?C.fn(e,t):(()=>e(t))}var en=()=>C.fn!==null,tn=()=>C.fn!==null;function nn(){C.fn=null}var G,on={getStore:()=>G,run(e,t){let n=G;G=e;try{return t()}finally{G=n}}},rn=on;function Ie(){return rn.getStore()}var J=require("@fluixi/reactive/signal");var sn="__FX_DATA__";var de;function $e(){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(sn)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return de=t}function X(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var an=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),z=typeof process<"u"&&process.env&&!1;function U(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 fn(e){X();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(an.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(z&&t&&U(`<${e}>`,t),null)}function un(e){X();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(z&&t&&U(`<${e}> (static)`,t),null)}function ln(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}X();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(z&&t&&U(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function cn(e){X();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(z&&t&&U(`marker <!--${e.slice(0,24)}-->`,t),null)}var Oe=!1;function dn(){Oe||(Oe=!0,Se({hydrateElement:fn,hydrateText:ln,hydrateMarker:cn,hydrateStatic:un}))}function Y(e,t,n){dn(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=$e(),r=n?.resourceNamespace,f=0;(0,J.setResourceIdSource)(()=>r?`${r}:r${f++}`:`r${f++}`),(0,J.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return ce(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var pe="fluixi-island";function De(e){let{component:t,props:n={},name:o}=e,r=se(pe),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=E?Ie():void 0;if(s){let i=s.nextIslandNamespace(f);A(r,()=>s.withResourceScope(i,()=>t(n)))}else A(r,()=>t(n));return r}var ke=!1;function pn(){if(ke||typeof document>"u")return;ke=!0;let e=document.createElement("style");e.textContent=`${pe}{display:contents}`,document.head.appendChild(e)}function Fe(e){if(typeof document>"u")return;pn();let t=document.querySelectorAll(pe),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}Y(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}
|
package/dist/lib/dom/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function lt(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function ct(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function dt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function pt(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var yt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),mt=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 Ae(e){return e.localName.includes("-")}function J(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Ae(e)){e[t]=n;return}x(e,t,n,o)}var X=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ie(e,t=document){return t.querySelector(e)}function gt(e,t=document){return Array.from(t.querySelectorAll(e))}function xt(e,t){return e.closest(t)}function ht(e,...t){e.classList.add(...t)}function Et(e,...t){e.classList.remove(...t)}function bt(e,...t){t.forEach(n=>e.classList.toggle(n))}function Nt(e,t){return e.classList.contains(t)}function x(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))}function Tt(e,t){return e.getAttribute(t)}function wt(e,t){e.removeAttribute(t)}function Re(e,t){Object.assign(e.style,t)}function St(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function vt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")Re(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function Ct(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function At(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Rt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Lt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Pt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Mt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function _t(e,t=5e3){return new Promise((n,o)=>{let r=ie(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=ie(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function It(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function $t(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Le=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Ot(e){return typeof e=="object"&&e!==null&&e.$$typeof===Le}function Pe(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function kt(e){if(typeof e!="function")return!1;try{let t=e();return Pe(t)}catch{return!1}}function Dt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Ft(e){return e instanceof Node}function Ht(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function jt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";var se="1.0.0-alpha.71";import{VERSION as Me}from"@fluixi/reactive";var h={dom:se,reactive:Me};function ae(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function fe(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ye,createEffect as R,createRenderEffect as p,createRoot as ke,onCleanup as v,readChildren as De}from"@fluixi/reactive/signal";var b=typeof document>"u";function _e(e){b=e}var z=Symbol.for("fluixi.server-node"),ue=null;function P(){if(!ue)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ue}function A(e){return e!=null&&e[z]===!0?!0:typeof Node<"u"&&e instanceof Node}function U(e){return e!=null&&e[z]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Y(e){return e!=null&&e[z]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},le=null;function ce(e){le=e}function M(){return le}function Z(e,t){return l.active&&t.parentNode===e}function Q(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ie(){return l.active?l.cursor:null}function _(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function $e(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Oe(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Q(t)}function Fe(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,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function He(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 on(e){return He(Fe(e))}var rn=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),je={};var de=new Map,$=new Set,j=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function me(e){if(!b)for(let t of e)$.has(t)||j.has(t)||($.add(t),document.addEventListener(t,qe))}function qe(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 Ve(e,t,n){if(e[`$$${t}`]=n,j.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}$.has(t)||me([t])}function pe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function sn(e){return!j.has(e)}function an(e){return typeof e=="function"}function w(e,t=!1){if(b)return P().createText(e);if(l.active&&!t){let n=M()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ge(e,t=!1){if(b)return P().createElement(e,t);if(l.active){let n=M()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(G,e):document.createElement(e)}function We(e,t=!1){let n=de.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,de.set(e,o),o}function fn(e,t,n=!1,o=!1){if(b){let r=P();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=M()?.hydrateStatic(t);if(r)return r}return Ke(We(e,o),o).firstChild}function un(e,t){if(!l.active)return t();let n=_(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?_(e.nextSibling,()=>o(...r)):o(...r))}return n}function ln(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function cn(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Ke(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Be(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Be(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function dn(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function pn(e){if(g(e)||E(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!E(t);)t=t();return t}var T=0,Ge=200;function Je(e,t,n,o,r){let f=o,s=new Map;return p(()=>{let i;if(E(e)&&!g(e)){if(!s.has(e)){T++;try{let a=e();s.set(e,a)}finally{T--}}for(i=s.get(e);typeof i=="function"&&g(i);)i=i()}else for(i=e();typeof i=="function"&&g(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(E(i)){if(!s.has(i)){let u=i;T++;try{let c=u();s.set(u,c)}finally{T--}}i=s.get(i)}else if(g(i))i=i();else if(i=i(),typeof i!="function"||!g(i)&&!E(i))break}T++;try{f=O(t,i,n,f,s),r(f)}finally{T--}})}function L(e,t,n,o){if(T>Ge)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){T++;try{r=O(e,t,n,null)}finally{T--}return()=>r}let i=Je(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function O(e,t,n,o,r){if(t==null||typeof t=="boolean")return S(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return S(e,o,n);if(I(t)){let s=w("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),S(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&O(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=w(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=S(e,o,n)}if(o&&Y(o))return o.data=t,o;let s=w(t);return o&&o.parentNode===e?e.replaceChild(s,o):Z(e,s)||m(e,s,n),s}if(A(t))return Z(e,t)?(Q(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),S(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];N(t,s,e,n,!0,r,a);let u=Xe(e,i,s,n);for(let c of a){let d=L(e,c.sig,c.marker);v(()=>{S(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(f==="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 a=i.type(i.props||{});return O(e,a,n,o)}}}return S(e,o,n)}function N(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!I(a)&&!g(a)&&!E(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(E(a)&&!g(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!I(u)&&!g(u)&&!E(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(s){let d=w("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?N(c,t,n,o,r,f):N([c],t,n,o,r,f);continue}continue}Array.isArray(u)?N(u,t,n,o,r,f,s):N([u],t,n,o,r,f,s);continue}if(I(a)){let u=w("",!0);t.push(u),a.then(c=>{if(u.parentNode){let d=[];if(N([c],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let y=1;y<d.length;y++)u.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(a)){N(a,t,n,o,r,f,s);continue}if(A(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?N(c,t,n,o,!1,f):N([c],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(w(u));continue}t.push(w(String(a)))}}}}function Xe(e,t,n,o){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,c=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let d=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)m(e,n[a++],d)}else if(s===a)for(;i<f;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let d=t[--f].nextSibling;m(e,n[a++],t[i++].nextSibling),m(e,n[--s],d),t[f]=t[i-1]}else{if(!c){c=new Map;let y=a;for(;y<s;)c.set(n[y],y++)}let d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let y=i,B=1;for(;++y<f&&y<s&&!(!c.has(t[y])||c.get(t[y])!==d+B);)B++;if(B>d-a){let Ce=t[i];for(;a<d;)m(e,n[a++],Ce)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(m(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function S(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 m(e,t,n){l.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 xe(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function he(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};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 ee(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):p(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function te(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;k(e,t,o)})}function Ee(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):p(()=>{let o=n();x(e,t,!!o)})}function D(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>D(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 r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function F(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(p(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function H(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 r=n[o];r==null?e.style[o]="":e.style[o]=r}}function yn(e){let{element:t,props:n,prevProps:o=je,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!U(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===G,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],c=o[a];if(u===c)continue;if(a==="ref"){be(u,t);continue}if(a==="use"){he(t,u);continue}if(a.startsWith("on:")){i.push(xe(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(te(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(ee(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(Ee(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push(p(()=>D(t,u()))):D(t,u);continue}if(a==="classList"){typeof u=="function"?i.push(p(()=>F(t,u()))):F(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push(p(()=>H(t,u()))):H(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();c&&pe(t,y),u&&Ve(t,y,u);continue}let d=X.has(a)||!s&&a in t;typeof u=="function"?i.push(d?te(t,a,u):ee(t,a,u,s)):i.push(p(()=>d?k(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();pe(t,u)}else X.has(a)?k(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function mn(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){be(r,e);continue}if(o!=="children"){if(o==="use"){he(e,r);continue}if(o.startsWith("on:")){xe(e,o.slice(3),r);continue}if(o.startsWith("prop:")){te(e,o.slice(5),r);continue}if(o.startsWith("attr:")){ee(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){Ee(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(j.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,$.has(f)||me([f]);continue}if(o==="class"||o==="className"){D(e,r);continue}if(o==="classList"){typeof r=="function"?p(()=>F(e,r())):F(e,r);continue}if(o==="style"){typeof r=="function"?p(()=>H(e,r())):H(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});v(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});v(()=>{f()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});v(()=>{f()})}else p(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=R(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});v(()=>{s()})}else{let f=!0;p(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();J(e,o,s,n)});v(()=>{f()})}else p(()=>J(e,o,t[o],n))}}}function gn(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function xn(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]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=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[...r,f]}function be(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 hn(e,t,n){let o=t||document.body,r=De(()=>e),f=[];return ye(()=>{let s=p(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):A(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),v(()=>{f.forEach(i=>i())})}),null}function En(e){return typeof e=="string"&&e.toLowerCase()===e}function bn(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 Nn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function I(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Tn(e){return typeof e=="function"&&e.length===0&&g(e)}function Ne(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return ke(s=>{ye(()=>{l.active||(t.textContent=""),ae(t),fe(),L(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var ze="__fx_dom_create_component__",C=globalThis[ze]??={fn:null};function Sn(e){C.fn=e}function vn(e={}){let t=e.signalSystem?.createComponent;t&&(C.fn=t)}function Cn(e,t){return C.fn?C.fn(e,t):(()=>e(t))}var An=()=>C.fn!==null,Rn=()=>C.fn!==null;function Ln(){C.fn=null}var q,Ue={getStore:()=>q,run(e,t){let n=q;q=e;try{return t()}finally{q=n}}},Ye=Ue;function Te(){return Ye.getStore()}import{setResourceIdSource as Qe,setServerDataGetter as et}from"@fluixi/reactive/signal";var Ze="__FX_DATA__";var ne;function we(){let e=globalThis.__FX_DATA__;if(e)return e;if(ne!==void 0)return ne;let t=null;if(typeof document<"u"){let n=document.getElementById(Ze)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ne=t}function V(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var tt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),W=typeof process<"u"&&process.env&&!1;function K(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 nt(e){V();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(tt.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(W&&t&&K(`<${e}>`,t),null)}function ot(e){V();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(W&&t&&K(`<${e}> (static)`,t),null)}function rt(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}V();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(W&&t&&K(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function it(e){V();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(W&&t&&K(`marker <!--${e.slice(0,24)}-->`,t),null)}var Se=!1;function st(){Se||(Se=!0,ce({hydrateElement:nt,hydrateText:rt,hydrateMarker:it,hydrateStatic:ot}))}function oe(e,t,n){st(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=we(),r=n?.resourceNamespace,f=0;Qe(()=>r?`${r}:r${f++}`:`r${f++}`),et(o?s=>s in o?{value:o[s]}:void 0:null);try{return Ne(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var re="fluixi-island";function at(e){let{component:t,props:n={},name:o}=e,r=ge(re),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=b?Te():void 0;if(s){let i=s.nextIslandNamespace(f);L(r,()=>s.withResourceScope(i,()=>t(n)))}else L(r,()=>t(n));return r}var ve=!1;function ft(){if(ve||typeof document>"u")return;ve=!0;let e=document.createElement("style");e.textContent=`${re}{display:contents}`,document.head.appendChild(e)}function ut(e){if(typeof document>"u")return;ft();let t=document.querySelectorAll(re),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}oe(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}export{at as Island,X as JSX_PROPERTIES,mt as SVG_ELEMENTS,G as SVG_NAMESPACE,yt as VOID_ELEMENTS,ht as addClass,Ve as addDelegatedEventListener,xe as addNativeEventListener,At as appendChildren,J as applyElementProp,mn as applyProps,he as applyUse,Ie as captureHydrationCursor,S as cleanChildren,Ke as cloneTemplate,xt as closest,Cn as createComponent,vt as createElement,ge as createNativeElement,hn as createPortal,We as createTemplate,Mt as delegate,me as delegateEvents,Nn as escapeHTML,dn as fnName,rn as generateID,Tt as getAttribute,jt as getGlobal,dt as getLitEventName,Pt as getOffset,on as getStableElementId,St as getStyle,be as handleRef,Nt as hasClass,cn as holeContent,ln as holeEnd,un as holeScope,oe as hydrate,Oe as hydrateAdvancePast,ut as hydrateIslands,vn as initializeIntegration,L as insert,O as insertExpression,An as intergartionInitialized,Tn as isAccessor,Ae as isCustomElement,Ft as isDOMNode,sn as isDelegatedEvent,U as isDomElement,A as isDomNode,Y as isDomText,ct as isEventHandler,an as isFunction,Rn as isIntegrationInitialized,Dt as isJSXTemplate,Pe as isLitTemplateResult,En as isNativeElement,I as isPromise,Ot as isReactElement,bn as isSVGElement,b as isServer,kt as isTemplateFactory,Rt as isVisible,pn as iterateFn,Be as makeArrayFlat,gn as mergeProps,It as observeIntersection,$t as observeResize,ie as query,gt as queryAll,Sn as registerCreateComponent,Ht as registerGlobal,wt as removeAttribute,Ct as removeChildren,Et as removeClass,pe as removeDelegatedEventListener,Ne as render,Ln as resetIntegration,_ as runHydrationAt,$e as runWithoutHydration,Lt as scrollIntoView,x as setAttribute,F as setClassList,D as setClassName,ee as setDynamicAttribute,Ee as setDynamicBoolAttribute,te as setDynamicProperty,k as setProperty,_e as setServerMode,H as setStyle,Re as setStyles,pt as shouldSetAsProperty,xn as splitProps,yn as spread,fn as templateNode,lt as toAttributeName,bt as toggleClass,_t as waitForElement};
|
|
1
|
+
function lt(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function ct(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function dt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function pt(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var yt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),mt=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 Ae(e){return e.localName.includes("-")}function J(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Ae(e)){e[t]=n;return}x(e,t,n,o)}var X=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ie(e,t=document){return t.querySelector(e)}function gt(e,t=document){return Array.from(t.querySelectorAll(e))}function xt(e,t){return e.closest(t)}function ht(e,...t){e.classList.add(...t)}function Et(e,...t){e.classList.remove(...t)}function bt(e,...t){t.forEach(n=>e.classList.toggle(n))}function Nt(e,t){return e.classList.contains(t)}function x(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))}function Tt(e,t){return e.getAttribute(t)}function wt(e,t){e.removeAttribute(t)}function Re(e,t){Object.assign(e.style,t)}function St(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function vt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")Re(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function Ct(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function At(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Rt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Lt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Pt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Mt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function _t(e,t=5e3){return new Promise((n,o)=>{let r=ie(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=ie(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function It(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function $t(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Le=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Ot(e){return typeof e=="object"&&e!==null&&e.$$typeof===Le}function Pe(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function kt(e){if(typeof e!="function")return!1;try{let t=e();return Pe(t)}catch{return!1}}function Dt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Ft(e){return e instanceof Node}function Ht(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function jt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";var se="1.0.0-alpha.73";import{VERSION as Me}from"@fluixi/reactive";var h={dom:se,reactive:Me};function ae(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function fe(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ye,createEffect as R,createRenderEffect as y,createRoot as ke,onCleanup as v,readChildren as De}from"@fluixi/reactive/signal";var b=typeof document>"u";function _e(e){b=e}var z=Symbol.for("fluixi.server-node"),ue=null;function P(){if(!ue)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ue}function A(e){return e!=null&&e[z]===!0?!0:typeof Node<"u"&&e instanceof Node}function U(e){return e!=null&&e[z]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Y(e){return e!=null&&e[z]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},le=null;function ce(e){le=e}function M(){return le}function Z(e,t){return l.active&&t.parentNode===e}function Q(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ie(){return l.active?l.cursor:null}function _(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function $e(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Oe(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Q(t)}function Fe(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,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function He(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 on(e){return He(Fe(e))}var rn=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),je={};var de=new Map,$=new Set,j=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function me(e){if(!b)for(let t of e)$.has(t)||j.has(t)||($.add(t),document.addEventListener(t,qe))}function qe(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 Ve(e,t,n){if(e[`$$${t}`]=n,j.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}$.has(t)||me([t])}function pe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function sn(e){return!j.has(e)}function an(e){return typeof e=="function"}function w(e,t=!1){if(b)return P().createText(e);if(l.active&&!t){let n=M()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ge(e,t=!1){if(b)return P().createElement(e,t);if(l.active){let n=M()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(G,e):document.createElement(e)}function We(e,t=!1){let n=de.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,de.set(e,o),o}function fn(e,t,n=!1,o=!1){if(b){let r=P();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=M()?.hydrateStatic(t);if(r)return r}return Ke(We(e,o),o).firstChild}function un(e,t){if(!l.active)return t();let n=_(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?_(e.nextSibling,()=>o(...r)):o(...r))}return n}function ln(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function cn(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Ke(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Be(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Be(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function dn(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function pn(e){if(g(e)||E(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!E(t);)t=t();return t}var T=0,Ge=200;function Je(e,t,n,o,r){let f=o,s=new Map;return y(()=>{let i;if(E(e)&&!g(e)){if(!s.has(e)){T++;try{let a=e();s.set(e,a)}finally{T--}}for(i=s.get(e);typeof i=="function"&&g(i);)i=i()}else for(i=e();typeof i=="function"&&g(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(E(i)){if(!s.has(i)){let u=i;T++;try{let c=u();s.set(u,c)}finally{T--}}i=s.get(i)}else if(g(i))i=i();else if(i=i(),typeof i!="function"||!g(i)&&!E(i))break}T++;try{f=O(t,i,n,f,s),r(f)}finally{T--}})}function L(e,t,n,o){if(T>Ge)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){T++;try{r=O(e,t,n,null)}finally{T--}return()=>r}let i=Je(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function O(e,t,n,o,r){if(t==null||typeof t=="boolean")return S(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return S(e,o,n);if(I(t)){let s=w("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),S(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&O(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=w(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=S(e,o,n)}if(o&&Y(o))return o.data=t,o;let s=w(t);return o&&o.parentNode===e?e.replaceChild(s,o):Z(e,s)||m(e,s,n),s}if(A(t))return Z(e,t)?(Q(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),S(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];N(t,s,e,n,!0,r,a);let u=Xe(e,i,s,n);for(let c of a){let d=L(e,c.sig,c.marker);v(()=>{S(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(f==="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 a=i.type(i.props||{});return O(e,a,n,o)}}}return S(e,o,n)}function N(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!I(a)&&!g(a)&&!E(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(E(a)&&!g(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!I(u)&&!g(u)&&!E(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(s){let d=w("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?N(c,t,n,o,r,f):N([c],t,n,o,r,f);continue}continue}Array.isArray(u)?N(u,t,n,o,r,f,s):N([u],t,n,o,r,f,s);continue}if(I(a)){let u=w("",!0);t.push(u),a.then(c=>{if(u.parentNode){let d=[];if(N([c],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let p=1;p<d.length;p++)u.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(a)){N(a,t,n,o,r,f,s);continue}if(A(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?N(c,t,n,o,!1,f):N([c],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(w(u));continue}t.push(w(String(a)))}}}}function Xe(e,t,n,o){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,c=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let d=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)m(e,n[a++],d)}else if(s===a)for(;i<f;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let d=t[--f].nextSibling;m(e,n[a++],t[i++].nextSibling),m(e,n[--s],d),t[f]=t[i-1]}else{if(!c){c=new Map;let p=a;for(;p<s;)c.set(n[p],p++)}let d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let p=i,B=1;for(;++p<f&&p<s&&!(!c.has(t[p])||c.get(t[p])!==d+B);)B++;if(B>d-a){let Ce=t[i];for(;a<d;)m(e,n[a++],Ce)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(m(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function S(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 m(e,t,n){l.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 xe(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function he(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};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 ee(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):y(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function te(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):y(()=>{let o=typeof n=="function"?n():n;k(e,t,o)})}function Ee(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):y(()=>{let o=n();x(e,t,!!o)})}function D(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){y(()=>D(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 r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function F(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(y(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function H(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 r=n[o];r==null?e.style[o]="":e.style[o]=r}}function yn(e){let{element:t,props:n,prevProps:o=je,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!U(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===G,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],c=o[a];if(u===c)continue;if(a==="ref"){be(u,t);continue}if(a==="use"){he(t,u);continue}if(a.startsWith("on:")){i.push(xe(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(te(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(ee(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(Ee(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push(y(()=>D(t,u()))):D(t,u);continue}if(a==="classList"){typeof u=="function"?i.push(y(()=>F(t,u()))):F(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push(y(()=>H(t,u()))):H(t,u);continue}if(a.startsWith("on")){let p=a.slice(2).toLowerCase();c&&pe(t,p),u&&Ve(t,p,u);continue}let d=X.has(a)||!s&&a in t;typeof u=="function"?i.push(d?te(t,a,u):ee(t,a,u,s)):i.push(y(()=>d?k(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();pe(t,u)}else X.has(a)?k(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function mn(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){be(r,e);continue}if(o!=="children"){if(o==="use"){he(e,r);continue}if(o.startsWith("on:")){xe(e,o.slice(3),r);continue}if(o.startsWith("prop:")){te(e,o.slice(5),r);continue}if(o.startsWith("attr:")){ee(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){Ee(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(j.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,$.has(f)||me([f]);continue}if(o==="class"||o==="className"){D(e,r);continue}if(o==="classList"){typeof r=="function"?y(()=>F(e,r())):F(e,r);continue}if(o==="style"){typeof r=="function"?y(()=>H(e,r())):H(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});v(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});v(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});v(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=R(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});v(()=>{s()})}else{let f=!0;y(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();J(e,o,s,n)});v(()=>{f()})}else y(()=>J(e,o,t[o],n))}}}function gn(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function xn(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]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=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[...r,f]}function be(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 hn(e,t,n){let o=t||document.body,r=De(()=>e),f=[];return ye(()=>{let s=y(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):A(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),v(()=>{f.forEach(i=>i())})}),null}function En(e){return typeof e=="string"&&e.toLowerCase()===e}function bn(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 Nn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function I(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Tn(e){return typeof e=="function"&&e.length===0&&g(e)}function Ne(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return ke(s=>{ye(()=>{l.active||(t.textContent=""),ae(t),fe(),L(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var ze="__fx_dom_create_component__",C=globalThis[ze]??={fn:null};function Sn(e){C.fn=e}function vn(e={}){let t=e.signalSystem?.createComponent;t&&(C.fn=t)}function Cn(e,t){return C.fn?C.fn(e,t):(()=>e(t))}var An=()=>C.fn!==null,Rn=()=>C.fn!==null;function Ln(){C.fn=null}var q,Ue={getStore:()=>q,run(e,t){let n=q;q=e;try{return t()}finally{q=n}}},Ye=Ue;function Te(){return Ye.getStore()}import{setResourceIdSource as Qe,setServerDataGetter as et}from"@fluixi/reactive/signal";var Ze="__FX_DATA__";var ne;function we(){let e=globalThis.__FX_DATA__;if(e)return e;if(ne!==void 0)return ne;let t=null;if(typeof document<"u"){let n=document.getElementById(Ze)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ne=t}function V(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var tt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),W=typeof process<"u"&&process.env&&!1;function K(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 nt(e){V();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(tt.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(W&&t&&K(`<${e}>`,t),null)}function ot(e){V();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(W&&t&&K(`<${e}> (static)`,t),null)}function rt(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}V();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(W&&t&&K(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function it(e){V();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(W&&t&&K(`marker <!--${e.slice(0,24)}-->`,t),null)}var Se=!1;function st(){Se||(Se=!0,ce({hydrateElement:nt,hydrateText:rt,hydrateMarker:it,hydrateStatic:ot}))}function oe(e,t,n){st(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=we(),r=n?.resourceNamespace,f=0;Qe(()=>r?`${r}:r${f++}`:`r${f++}`),et(o?s=>s in o?{value:o[s]}:void 0:null);try{return Ne(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var re="fluixi-island";function at(e){let{component:t,props:n={},name:o}=e,r=ge(re),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=b?Te():void 0;if(s){let i=s.nextIslandNamespace(f);L(r,()=>s.withResourceScope(i,()=>t(n)))}else L(r,()=>t(n));return r}var ve=!1;function ft(){if(ve||typeof document>"u")return;ve=!0;let e=document.createElement("style");e.textContent=`${re}{display:contents}`,document.head.appendChild(e)}function ut(e){if(typeof document>"u")return;ft();let t=document.querySelectorAll(re),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}oe(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}export{at as Island,X as JSX_PROPERTIES,mt as SVG_ELEMENTS,G as SVG_NAMESPACE,yt as VOID_ELEMENTS,ht as addClass,Ve as addDelegatedEventListener,xe as addNativeEventListener,At as appendChildren,J as applyElementProp,mn as applyProps,he as applyUse,Ie as captureHydrationCursor,S as cleanChildren,Ke as cloneTemplate,xt as closest,Cn as createComponent,vt as createElement,ge as createNativeElement,hn as createPortal,We as createTemplate,Mt as delegate,me as delegateEvents,Nn as escapeHTML,dn as fnName,rn as generateID,Tt as getAttribute,jt as getGlobal,dt as getLitEventName,Pt as getOffset,on as getStableElementId,St as getStyle,be as handleRef,Nt as hasClass,cn as holeContent,ln as holeEnd,un as holeScope,oe as hydrate,Oe as hydrateAdvancePast,ut as hydrateIslands,vn as initializeIntegration,L as insert,O as insertExpression,An as intergartionInitialized,Tn as isAccessor,Ae as isCustomElement,Ft as isDOMNode,sn as isDelegatedEvent,U as isDomElement,A as isDomNode,Y as isDomText,ct as isEventHandler,an as isFunction,Rn as isIntegrationInitialized,Dt as isJSXTemplate,Pe as isLitTemplateResult,En as isNativeElement,I as isPromise,Ot as isReactElement,bn as isSVGElement,b as isServer,kt as isTemplateFactory,Rt as isVisible,pn as iterateFn,Be as makeArrayFlat,gn as mergeProps,It as observeIntersection,$t as observeResize,ie as query,gt as queryAll,Sn as registerCreateComponent,Ht as registerGlobal,wt as removeAttribute,Ct as removeChildren,Et as removeClass,pe as removeDelegatedEventListener,Ne as render,Ln as resetIntegration,_ as runHydrationAt,$e as runWithoutHydration,Lt as scrollIntoView,x as setAttribute,F as setClassList,D as setClassName,ee as setDynamicAttribute,Ee as setDynamicBoolAttribute,te as setDynamicProperty,k as setProperty,_e as setServerMode,H as setStyle,Re as setStyles,pt as shouldSetAsProperty,xn as splitProps,yn as spread,fn as templateNode,lt as toAttributeName,bt as toggleClass,_t as waitForElement};
|
package/dist/lib/dom/island.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var k=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var fe=Object.prototype.hasOwnProperty;var ue=(t,e)=>{for(var n in e)k(t,n,{get:e[n],enumerable:!0})},le=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of ae(e))!fe.call(t,u)&&u!==n&&k(t,u,{get:()=>e[u],enumerable:!(o=se(e,u))||o.enumerable});return t};var ce=t=>le(k({},"__esModule",{value:!0}),t);var Ce={};ue(Ce,{Island:()=>Se,hydrateIslands:()=>Ae});module.exports=ce(Ce);var m=require("@fluixi/reactive/signal");var F="http://www.w3.org/2000/svg";function v(t,e,n,o=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var Le=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var V="1.0.0-alpha.71";var W=require("@fluixi/reactive"),g={dom:V,reactive:W.VERSION};function K(t){g.core&&t.setAttribute("fluixi",g.core),t.setAttribute("fx-dom",g.dom),t.setAttribute("fx-reactive",g.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=g)}function B(){let t=[g.core,g.dom,g.reactive].filter(e=>e!==void 0);new Set(t).size<=1||console.warn(`[fluixi] package versions disagree — core ${g.core??"(absent)"}, dom ${g.dom}, reactive ${g.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function N(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}var x=require("@fluixi/reactive/signal");var T=typeof document>"u";var J=Symbol.for("fluixi.server-node"),G=null;function O(){if(!G)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return G}function D(t){return t!=null&&t[J]===!0?!0:typeof Node<"u"&&t instanceof Node}function X(t){return t!=null&&t[J]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var l={active:!1,cursor:null,parents:[]},z=null;function U(t){z=t}function I(){return z}function q(t,e){return l.active&&e.parentNode===t}function Y(t){let e=l.parents.lastIndexOf(t);e!==-1&&(l.parents.length=e),l.cursor=t.nextSibling}function b(t,e=!1){if(T)return O().createText(t);if(l.active&&!e){let n=I()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function Z(t,e=!1){if(T)return O().createElement(t,e);if(l.active){let n=I()?.hydrateElement(t);if(n)return n}return e?document.createElementNS(F,t):document.createElement(t)}var E=0,de=200;function pe(t,e,n,o,u){let a=o,s=new Map;return(0,x.createRenderEffect)(()=>{let r;if(N(t)&&!(0,m.isSignal)(t)){if(!s.has(t)){E++;try{let i=t();s.set(t,i)}finally{E--}}for(r=s.get(t);typeof r=="function"&&(0,m.isSignal)(r);)r=r()}else for(r=t();typeof r=="function"&&(0,m.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(N(r)){if(!s.has(r)){let f=r;E++;try{let c=f();s.set(f,c)}finally{E--}}r=s.get(r)}else if((0,m.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,m.isSignal)(r)&&!N(r))break}E++;try{a=C(e,r,n,a,s),u(a)}finally{E--}})}function S(t,e,n,o){if(E>de)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=b("",!0),t.appendChild(n));let u=o??null,a=i=>Array.isArray(i)&&i.some(f=>typeof f=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof e!="function"&&!a(e)){E++;try{u=C(t,e,n,null)}finally{E--}return()=>u}let r=pe(s(e),t,n,u,i=>{u=i});return()=>(r?.(),u)}function C(t,e,n,o,u){if(e==null||typeof e=="boolean")return w(t,o,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return w(t,o,n);if(A(e)){let s=b("",!0);return Array.isArray(o)?o.length>0?(t.replaceChild(s,o[0]),w(t,o.slice(1),n)):y(t,s,n):o?t.replaceChild(s,o):y(t,s,n),e.then(r=>{s.parentNode===t&&C(t,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof e;if(a==="string"||a==="number"){if(a==="number"&&(e=String(e)),Array.isArray(o)){if(o.length===0){let r=b(e);return y(t,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=e,o;o=w(t,o,n)}if(o&&X(o))return o.data=e,o;let s=b(e);return o&&o.parentNode===t?t.replaceChild(s,o):q(t,s)||y(t,s,n),s}if(D(e))return q(t,e)?(Y(e),e):Array.isArray(o)?(o.length===0?y(t,e,n):o[0].parentNode===t?(t.replaceChild(e,o[0]),w(t,o.slice(1),n)):y(t,e,n),e):(o?o!==e&&(o.parentNode===t?t.replaceChild(e,o):y(t,e,n)):y(t,e,n),e);if(Array.isArray(e)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];h(e,s,t,n,!0,u,i);let f=ye(t,r,s,n);for(let c of i){let d=S(t,c.sig,c.marker);(0,x.onCleanup)(()=>{w(t,d()),c.marker.parentNode===t&&t.removeChild(c.marker)})}return f}if(a==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return C(t,i,n,o)}}}return w(t,o,n)}function h(t,e,n,o,u=!0,a,s){for(let r=0;r<t.length;r++){let i=t[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!A(i)&&!(0,m.isSignal)(i)&&!N(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let f;for(N(i)&&!(0,m.isSignal)(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),f=a.get(i)):f=i();typeof f=="function"&&!A(f)&&!(0,m.isSignal)(f)&&!N(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if((0,m.isSignal)(f)){if(s){let d=b("",!0);e.push(d),s.push({marker:d,sig:f});continue}let c=f();for(;typeof c=="function"&&(0,m.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?h(c,e,n,o,u,a):h([c],e,n,o,u,a);continue}continue}Array.isArray(f)?h(f,e,n,o,u,a,s):h([f],e,n,o,u,a,s);continue}if(A(i)){let f=b("",!0);e.push(f),i.then(c=>{if(f.parentNode){let d=[];if(h([c],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let p=1;p<d.length;p++)f.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){h(i,e,n,o,u,a,s);continue}if(D(i)){e.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let f=i;if(typeof f.type=="function"){let c=f.type(f.props||{});Array.isArray(c)?h(c,e,n,o,!1,a):h([c],e,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let f=String(i);if(f.trim()===""&&f!==" ")continue;e.push(b(f));continue}e.push(b(String(i)))}}}}function ye(t,e,n,o){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==t&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let u=n.length,a=e.length,s=u,r=0,i=0,f=a>0?e[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<s;){if(e[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&e[a-1]===n[s-1];)a--,s--;if(a===r){let d=s<u?i?n[i-1].nextSibling??void 0:n[s-i]:f;for(;i<s;)y(t,n[i++],d)}else if(s===i)for(;r<a;)(!c||!c.has(e[r]))&&e[r].parentNode===t&&t.removeChild(e[r]),r++;else if(e[r]===n[s-1]&&n[i]===e[a-1]){let d=e[--a].nextSibling;y(t,n[i++],e[r++].nextSibling),y(t,n[--s],d),e[a]=e[r-1]}else{if(!c){c=new Map;let p=i;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[r]);if(d!=null)if(i<d&&d<s){let p=r,_=1;for(;++p<a&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+_);)_++;if(_>d-i){let ie=e[r];for(;i<d;)y(t,n[i++],ie)}else e[r].parentNode===t?t.replaceChild(n[i++],e[r++]):(y(t,n[i++],f),r++)}else r++;else e[r].parentNode===t&&t.removeChild(e[r]),r++}}return n}function w(t,e,n){if(e)if(Array.isArray(e))for(let o=0;o<e.length;o++)e[o].parentNode===t&&t.removeChild(e[o]);else e.parentNode===t&&t.removeChild(e);return null}function y(t,e,n){l.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function A(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function Q(t,e,n){if(!e)throw new Error("Container element is required");let o,u,a=[];return(0,x.createRoot)(s=>{(0,x.batch)(()=>{l.active||(e.textContent=""),K(e),B(),S(e,t)}),u=s}),()=>{u?.(),o?.(),a.forEach(s=>s()),e.textContent=""}}var R,ge={getStore:()=>R,run(t,e){let n=R;R=t;try{return e()}finally{R=n}}},me=ge;function ee(){return me.getStore()}var L=require("@fluixi/reactive/signal");var xe="__FX_DATA__";var H;function te(){let t=globalThis.__FX_DATA__;if(t)return t;if(H!==void 0)return H;let e=null;if(typeof document<"u"){let n=document.getElementById(xe)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return H=e}function M(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var he=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),P=typeof process<"u"&&process.env&&!1;function $(t,e){let n=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${t} 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 Ee(t){M();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(he.has(t.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(P&&e&&$(`<${t}>`,e),null)}function be(t){M();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(l.cursor=e.nextSibling,e):(P&&e&&$(`<${t}> (static)`,e),null)}function Ne(t){if(t===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}M();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(P&&e&&$(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function we(t){M();let e=l.cursor;return e&&e.nodeType===8&&e.data===t?(l.cursor=e.nextSibling,e):(P&&e&&$(`marker <!--${t.slice(0,24)}-->`,e),null)}var ne=!1;function Te(){ne||(ne=!0,U({hydrateElement:Ee,hydrateText:Ne,hydrateMarker:we,hydrateStatic:be}))}function oe(t,e,n){Te(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let o=te(),u=n?.resourceNamespace,a=0;(0,L.setResourceIdSource)(()=>u?`${u}:r${a++}`:`r${a++}`),(0,L.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return Q(t,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var j="fluixi-island";function Se(t){let{component:e,props:n={},name:o}=t,u=Z(j),a=o??e.name??"Island";v(u,"name",a),v(u,"props",JSON.stringify(n??{}));let s=T?ee():void 0;if(s){let r=s.nextIslandNamespace(a);S(u,()=>s.withResourceScope(r,()=>e(n)))}else S(u,()=>e(n));return u}var re=!1;function ve(){if(re||typeof document>"u")return;re=!0;let t=document.createElement("style");t.textContent=`${j}{display:contents}`,document.head.appendChild(t)}function Ae(t){if(typeof document>"u")return;ve();let e=document.querySelectorAll(j),n=new Map;e.forEach(o=>{let u=o.getAttribute("name")??"",a=n.get(u)??0;n.set(u,a+1);let s=t[u];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${u}" has no component in the registry — left static.`);return}let r={};try{r=JSON.parse(o.getAttribute("props")||"{}")}catch{}oe(()=>s(r),o,{resourceNamespace:`${u}#${a}`})})}
|
|
1
|
+
"use strict";var k=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var fe=Object.prototype.hasOwnProperty;var ue=(t,e)=>{for(var n in e)k(t,n,{get:e[n],enumerable:!0})},le=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of ae(e))!fe.call(t,u)&&u!==n&&k(t,u,{get:()=>e[u],enumerable:!(o=se(e,u))||o.enumerable});return t};var ce=t=>le(k({},"__esModule",{value:!0}),t);var Ce={};ue(Ce,{Island:()=>Se,hydrateIslands:()=>Ae});module.exports=ce(Ce);var m=require("@fluixi/reactive/signal");var F="http://www.w3.org/2000/svg";function v(t,e,n,o=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var Le=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var V="1.0.0-alpha.73";var W=require("@fluixi/reactive"),g={dom:V,reactive:W.VERSION};function K(t){g.core&&t.setAttribute("fluixi",g.core),t.setAttribute("fx-dom",g.dom),t.setAttribute("fx-reactive",g.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=g)}function B(){let t=[g.core,g.dom,g.reactive].filter(e=>e!==void 0);new Set(t).size<=1||console.warn(`[fluixi] package versions disagree — core ${g.core??"(absent)"}, dom ${g.dom}, reactive ${g.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function N(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}var x=require("@fluixi/reactive/signal");var T=typeof document>"u";var J=Symbol.for("fluixi.server-node"),G=null;function O(){if(!G)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return G}function D(t){return t!=null&&t[J]===!0?!0:typeof Node<"u"&&t instanceof Node}function X(t){return t!=null&&t[J]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var l={active:!1,cursor:null,parents:[]},z=null;function U(t){z=t}function I(){return z}function q(t,e){return l.active&&e.parentNode===t}function Y(t){let e=l.parents.lastIndexOf(t);e!==-1&&(l.parents.length=e),l.cursor=t.nextSibling}function b(t,e=!1){if(T)return O().createText(t);if(l.active&&!e){let n=I()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function Z(t,e=!1){if(T)return O().createElement(t,e);if(l.active){let n=I()?.hydrateElement(t);if(n)return n}return e?document.createElementNS(F,t):document.createElement(t)}var E=0,de=200;function pe(t,e,n,o,u){let a=o,s=new Map;return(0,x.createRenderEffect)(()=>{let r;if(N(t)&&!(0,m.isSignal)(t)){if(!s.has(t)){E++;try{let i=t();s.set(t,i)}finally{E--}}for(r=s.get(t);typeof r=="function"&&(0,m.isSignal)(r);)r=r()}else for(r=t();typeof r=="function"&&(0,m.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(N(r)){if(!s.has(r)){let f=r;E++;try{let c=f();s.set(f,c)}finally{E--}}r=s.get(r)}else if((0,m.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,m.isSignal)(r)&&!N(r))break}E++;try{a=C(e,r,n,a,s),u(a)}finally{E--}})}function S(t,e,n,o){if(E>de)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=b("",!0),t.appendChild(n));let u=o??null,a=i=>Array.isArray(i)&&i.some(f=>typeof f=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof e!="function"&&!a(e)){E++;try{u=C(t,e,n,null)}finally{E--}return()=>u}let r=pe(s(e),t,n,u,i=>{u=i});return()=>(r?.(),u)}function C(t,e,n,o,u){if(e==null||typeof e=="boolean")return w(t,o,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return w(t,o,n);if(A(e)){let s=b("",!0);return Array.isArray(o)?o.length>0?(t.replaceChild(s,o[0]),w(t,o.slice(1),n)):y(t,s,n):o?t.replaceChild(s,o):y(t,s,n),e.then(r=>{s.parentNode===t&&C(t,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof e;if(a==="string"||a==="number"){if(a==="number"&&(e=String(e)),Array.isArray(o)){if(o.length===0){let r=b(e);return y(t,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=e,o;o=w(t,o,n)}if(o&&X(o))return o.data=e,o;let s=b(e);return o&&o.parentNode===t?t.replaceChild(s,o):q(t,s)||y(t,s,n),s}if(D(e))return q(t,e)?(Y(e),e):Array.isArray(o)?(o.length===0?y(t,e,n):o[0].parentNode===t?(t.replaceChild(e,o[0]),w(t,o.slice(1),n)):y(t,e,n),e):(o?o!==e&&(o.parentNode===t?t.replaceChild(e,o):y(t,e,n)):y(t,e,n),e);if(Array.isArray(e)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];h(e,s,t,n,!0,u,i);let f=ye(t,r,s,n);for(let c of i){let d=S(t,c.sig,c.marker);(0,x.onCleanup)(()=>{w(t,d()),c.marker.parentNode===t&&t.removeChild(c.marker)})}return f}if(a==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return C(t,i,n,o)}}}return w(t,o,n)}function h(t,e,n,o,u=!0,a,s){for(let r=0;r<t.length;r++){let i=t[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!A(i)&&!(0,m.isSignal)(i)&&!N(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let f;for(N(i)&&!(0,m.isSignal)(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),f=a.get(i)):f=i();typeof f=="function"&&!A(f)&&!(0,m.isSignal)(f)&&!N(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if((0,m.isSignal)(f)){if(s){let d=b("",!0);e.push(d),s.push({marker:d,sig:f});continue}let c=f();for(;typeof c=="function"&&(0,m.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?h(c,e,n,o,u,a):h([c],e,n,o,u,a);continue}continue}Array.isArray(f)?h(f,e,n,o,u,a,s):h([f],e,n,o,u,a,s);continue}if(A(i)){let f=b("",!0);e.push(f),i.then(c=>{if(f.parentNode){let d=[];if(h([c],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let p=1;p<d.length;p++)f.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){h(i,e,n,o,u,a,s);continue}if(D(i)){e.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let f=i;if(typeof f.type=="function"){let c=f.type(f.props||{});Array.isArray(c)?h(c,e,n,o,!1,a):h([c],e,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let f=String(i);if(f.trim()===""&&f!==" ")continue;e.push(b(f));continue}e.push(b(String(i)))}}}}function ye(t,e,n,o){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==t&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let u=n.length,a=e.length,s=u,r=0,i=0,f=a>0?e[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<s;){if(e[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&e[a-1]===n[s-1];)a--,s--;if(a===r){let d=s<u?i?n[i-1].nextSibling??void 0:n[s-i]:f;for(;i<s;)y(t,n[i++],d)}else if(s===i)for(;r<a;)(!c||!c.has(e[r]))&&e[r].parentNode===t&&t.removeChild(e[r]),r++;else if(e[r]===n[s-1]&&n[i]===e[a-1]){let d=e[--a].nextSibling;y(t,n[i++],e[r++].nextSibling),y(t,n[--s],d),e[a]=e[r-1]}else{if(!c){c=new Map;let p=i;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[r]);if(d!=null)if(i<d&&d<s){let p=r,_=1;for(;++p<a&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+_);)_++;if(_>d-i){let ie=e[r];for(;i<d;)y(t,n[i++],ie)}else e[r].parentNode===t?t.replaceChild(n[i++],e[r++]):(y(t,n[i++],f),r++)}else r++;else e[r].parentNode===t&&t.removeChild(e[r]),r++}}return n}function w(t,e,n){if(e)if(Array.isArray(e))for(let o=0;o<e.length;o++)e[o].parentNode===t&&t.removeChild(e[o]);else e.parentNode===t&&t.removeChild(e);return null}function y(t,e,n){l.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function A(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function Q(t,e,n){if(!e)throw new Error("Container element is required");let o,u,a=[];return(0,x.createRoot)(s=>{(0,x.batch)(()=>{l.active||(e.textContent=""),K(e),B(),S(e,t)}),u=s}),()=>{u?.(),o?.(),a.forEach(s=>s()),e.textContent=""}}var R,ge={getStore:()=>R,run(t,e){let n=R;R=t;try{return e()}finally{R=n}}},me=ge;function ee(){return me.getStore()}var L=require("@fluixi/reactive/signal");var xe="__FX_DATA__";var H;function te(){let t=globalThis.__FX_DATA__;if(t)return t;if(H!==void 0)return H;let e=null;if(typeof document<"u"){let n=document.getElementById(xe)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return H=e}function M(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var he=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),P=typeof process<"u"&&process.env&&!1;function $(t,e){let n=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${t} 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 Ee(t){M();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(he.has(t.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(P&&e&&$(`<${t}>`,e),null)}function be(t){M();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(l.cursor=e.nextSibling,e):(P&&e&&$(`<${t}> (static)`,e),null)}function Ne(t){if(t===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}M();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(P&&e&&$(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function we(t){M();let e=l.cursor;return e&&e.nodeType===8&&e.data===t?(l.cursor=e.nextSibling,e):(P&&e&&$(`marker <!--${t.slice(0,24)}-->`,e),null)}var ne=!1;function Te(){ne||(ne=!0,U({hydrateElement:Ee,hydrateText:Ne,hydrateMarker:we,hydrateStatic:be}))}function oe(t,e,n){Te(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let o=te(),u=n?.resourceNamespace,a=0;(0,L.setResourceIdSource)(()=>u?`${u}:r${a++}`:`r${a++}`),(0,L.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return Q(t,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var j="fluixi-island";function Se(t){let{component:e,props:n={},name:o}=t,u=Z(j),a=o??e.name??"Island";v(u,"name",a),v(u,"props",JSON.stringify(n??{}));let s=T?ee():void 0;if(s){let r=s.nextIslandNamespace(a);S(u,()=>s.withResourceScope(r,()=>e(n)))}else S(u,()=>e(n));return u}var re=!1;function ve(){if(re||typeof document>"u")return;re=!0;let t=document.createElement("style");t.textContent=`${j}{display:contents}`,document.head.appendChild(t)}function Ae(t){if(typeof document>"u")return;ve();let e=document.querySelectorAll(j),n=new Map;e.forEach(o=>{let u=o.getAttribute("name")??"",a=n.get(u)??0;n.set(u,a+1);let s=t[u];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${u}" has no component in the registry — left static.`);return}let r={};try{r=JSON.parse(o.getAttribute("props")||"{}")}catch{}oe(()=>s(r),o,{resourceNamespace:`${u}#${a}`})})}
|
package/dist/lib/dom/island.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSignal as m}from"@fluixi/reactive/signal";var q="http://www.w3.org/2000/svg";function S(t,e,n,i=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var we=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var H="1.0.0-alpha.71";import{VERSION as ne}from"@fluixi/reactive";var g={dom:H,reactive:ne};function j(t){g.core&&t.setAttribute("fluixi",g.core),t.setAttribute("fx-dom",g.dom),t.setAttribute("fx-reactive",g.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=g)}function F(){let t=[g.core,g.dom,g.reactive].filter(e=>e!==void 0);new Set(t).size<=1||console.warn(`[fluixi] package versions disagree — core ${g.core??"(absent)"}, dom ${g.dom}, reactive ${g.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function b(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}import{batch as oe,createEffect as je,createRenderEffect as re,createRoot as ie,onCleanup as se,readChildren as Fe}from"@fluixi/reactive/signal";var w=typeof document>"u";var W=Symbol.for("fluixi.server-node"),V=null;function $(){if(!V)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return V}function _(t){return t!=null&&t[W]===!0?!0:typeof Node<"u"&&t instanceof Node}function K(t){return t!=null&&t[W]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var u={active:!1,cursor:null,parents:[]},B=null;function G(t){B=t}function k(){return B}function O(t,e){return u.active&&e.parentNode===t}function J(t){let e=u.parents.lastIndexOf(t);e!==-1&&(u.parents.length=e),u.cursor=t.nextSibling}function E(t,e=!1){if(w)return $().createText(t);if(u.active&&!e){let n=k()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function X(t,e=!1){if(w)return $().createElement(t,e);if(u.active){let n=k()?.hydrateElement(t);if(n)return n}return e?document.createElementNS(q,t):document.createElement(t)}var h=0,ae=200;function fe(t,e,n,i,l){let a=i,s=new Map;return re(()=>{let o;if(b(t)&&!m(t)){if(!s.has(t)){h++;try{let r=t();s.set(t,r)}finally{h--}}for(o=s.get(t);typeof o=="function"&&m(o);)o=o()}else for(o=t();typeof o=="function"&&m(o);)o=o();{let r=0;for(;typeof o=="function"&&r++<50;)if(b(o)){if(!s.has(o)){let f=o;h++;try{let c=f();s.set(f,c)}finally{h--}}o=s.get(o)}else if(m(o))o=o();else if(o=o(),typeof o!="function"||!m(o)&&!b(o))break}h++;try{a=A(e,o,n,a,s),l(a)}finally{h--}})}function T(t,e,n,i){if(h>ae)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=E("",!0),t.appendChild(n));let l=i??null,a=r=>Array.isArray(r)&&r.some(f=>typeof f=="function"),s=r=>typeof r=="function"?r:()=>r;if(typeof e!="function"&&!a(e)){h++;try{l=A(t,e,n,null)}finally{h--}return()=>l}let o=fe(s(e),t,n,l,r=>{l=r});return()=>(o?.(),l)}function A(t,e,n,i,l){if(e==null||typeof e=="boolean")return N(t,i,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return N(t,i,n);if(v(e)){let s=E("",!0);return Array.isArray(i)?i.length>0?(t.replaceChild(s,i[0]),N(t,i.slice(1),n)):y(t,s,n):i?t.replaceChild(s,i):y(t,s,n),e.then(o=>{s.parentNode===t&&A(t,o,s.nextSibling,s)}).catch(o=>{console.error("Error resolving promise in insertExpression:",o)}),s}let a=typeof e;if(a==="string"||a==="number"){if(a==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let o=E(e);return y(t,o,n),o}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=N(t,i,n)}if(i&&K(i))return i.data=e,i;let s=E(e);return i&&i.parentNode===t?t.replaceChild(s,i):O(t,s)||y(t,s,n),s}if(_(e))return O(t,e)?(J(e),e):Array.isArray(i)?(i.length===0?y(t,e,n):i[0].parentNode===t?(t.replaceChild(e,i[0]),N(t,i.slice(1),n)):y(t,e,n),e):(i?i!==e&&(i.parentNode===t?t.replaceChild(e,i):y(t,e,n)):y(t,e,n),e);if(Array.isArray(e)){let s=[],o=Array.isArray(i)?i:i?[i]:[],r=[];x(e,s,t,n,!0,l,r);let f=ue(t,o,s,n);for(let c of r){let d=T(t,c.sig,c.marker);se(()=>{N(t,d()),c.marker.parentNode===t&&t.removeChild(c.marker)})}return f}if(a==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let o=s;if(typeof o.type=="function"){let r=o.type(o.props||{});return A(t,r,n,i)}}}return N(t,i,n)}function x(t,e,n,i,l=!0,a,s){for(let o=0;o<t.length;o++){let r=t[o];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!v(r)&&!m(r)&&!b(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let f;for(b(r)&&!m(r)?(a||(a=new Map),a.has(r)||a.set(r,r()),f=a.get(r)):f=r();typeof f=="function"&&!v(f)&&!m(f)&&!b(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if(m(f)){if(s){let d=E("",!0);e.push(d),s.push({marker:d,sig:f});continue}let c=f();for(;typeof c=="function"&&m(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?x(c,e,n,i,l,a):x([c],e,n,i,l,a);continue}continue}Array.isArray(f)?x(f,e,n,i,l,a,s):x([f],e,n,i,l,a,s);continue}if(v(r)){let f=E("",!0);e.push(f),r.then(c=>{if(f.parentNode){let d=[];if(x([c],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let p=1;p<d.length;p++)f.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(r)){x(r,e,n,i,l,a,s);continue}if(_(r)){e.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let f=r;if(typeof f.type=="function"){let c=f.type(f.props||{});Array.isArray(c)?x(c,e,n,i,!1,a):x([c],e,n,i,!1,a);continue}}if(typeof r=="string"||typeof r=="number"){let f=String(r);if(f.trim()===""&&f!==" ")continue;e.push(E(f));continue}e.push(E(String(r)))}}}}function ue(t,e,n,i){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==t&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let l=n.length,a=e.length,s=l,o=0,r=0,f=a>0?e[a-1].nextSibling??void 0:i,c=null;for(;o<a||r<s;){if(e[o]===n[r]){o++,r++;continue}for(;a>o&&s>r&&e[a-1]===n[s-1];)a--,s--;if(a===o){let d=s<l?r?n[r-1].nextSibling??void 0:n[s-r]:f;for(;r<s;)y(t,n[r++],d)}else if(s===r)for(;o<a;)(!c||!c.has(e[o]))&&e[o].parentNode===t&&t.removeChild(e[o]),o++;else if(e[o]===n[s-1]&&n[r]===e[a-1]){let d=e[--a].nextSibling;y(t,n[r++],e[o++].nextSibling),y(t,n[--s],d),e[a]=e[o-1]}else{if(!c){c=new Map;let p=r;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[o]);if(d!=null)if(r<d&&d<s){let p=o,P=1;for(;++p<a&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+P);)P++;if(P>d-r){let te=e[o];for(;r<d;)y(t,n[r++],te)}else e[o].parentNode===t?t.replaceChild(n[r++],e[o++]):(y(t,n[r++],f),o++)}else o++;else e[o].parentNode===t&&t.removeChild(e[o]),o++}}return n}function N(t,e,n){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===t&&t.removeChild(e[i]);else e.parentNode===t&&t.removeChild(e);return null}function y(t,e,n){u.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function v(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function z(t,e,n){if(!e)throw new Error("Container element is required");let i,l,a=[];return ie(s=>{oe(()=>{u.active||(e.textContent=""),j(e),F(),T(e,t)}),l=s}),()=>{l?.(),i?.(),a.forEach(s=>s()),e.textContent=""}}var C,le={getStore:()=>C,run(t,e){let n=C;C=t;try{return e()}finally{C=n}}},ce=le;function U(){return ce.getStore()}import{setResourceIdSource as pe,setServerDataGetter as ye}from"@fluixi/reactive/signal";var de="__FX_DATA__";var D;function Y(){let t=globalThis.__FX_DATA__;if(t)return t;if(D!==void 0)return D;let e=null;if(typeof document<"u"){let n=document.getElementById(de)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return D=e}function R(){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 ge=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),L=typeof process<"u"&&process.env&&!1;function M(t,e){let n=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${t} 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 me(t){R();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(ge.has(t.toLowerCase())?u.cursor=e.nextSibling:(u.parents.push(e),u.cursor=e.firstChild),e):(L&&e&&M(`<${t}>`,e),null)}function xe(t){R();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(u.cursor=e.nextSibling,e):(L&&e&&M(`<${t}> (static)`,e),null)}function he(t){if(t===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}R();let e=u.cursor;return e&&e.nodeType===3?(u.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(L&&e&&M(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function Ee(t){R();let e=u.cursor;return e&&e.nodeType===8&&e.data===t?(u.cursor=e.nextSibling,e):(L&&e&&M(`marker <!--${t.slice(0,24)}-->`,e),null)}var Z=!1;function be(){Z||(Z=!0,G({hydrateElement:me,hydrateText:he,hydrateMarker:Ee,hydrateStatic:xe}))}function Q(t,e,n){be(),u.active=!0,u.cursor=e.firstChild,u.parents=[];let i=Y(),l=n?.resourceNamespace,a=0;pe(()=>l?`${l}:r${a++}`:`r${a++}`),ye(i?s=>s in i?{value:i[s]}:void 0:null);try{return z(t,e)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var I="fluixi-island";function rt(t){let{component:e,props:n={},name:i}=t,l=X(I),a=i??e.name??"Island";S(l,"name",a),S(l,"props",JSON.stringify(n??{}));let s=w?U():void 0;if(s){let o=s.nextIslandNamespace(a);T(l,()=>s.withResourceScope(o,()=>e(n)))}else T(l,()=>e(n));return l}var ee=!1;function Ne(){if(ee||typeof document>"u")return;ee=!0;let t=document.createElement("style");t.textContent=`${I}{display:contents}`,document.head.appendChild(t)}function it(t){if(typeof document>"u")return;Ne();let e=document.querySelectorAll(I),n=new Map;e.forEach(i=>{let l=i.getAttribute("name")??"",a=n.get(l)??0;n.set(l,a+1);let s=t[l];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${l}" has no component in the registry — left static.`);return}let o={};try{o=JSON.parse(i.getAttribute("props")||"{}")}catch{}Q(()=>s(o),i,{resourceNamespace:`${l}#${a}`})})}export{rt as Island,it as hydrateIslands};
|
|
1
|
+
import{isSignal as m}from"@fluixi/reactive/signal";var q="http://www.w3.org/2000/svg";function S(t,e,n,i=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var we=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var H="1.0.0-alpha.73";import{VERSION as ne}from"@fluixi/reactive";var g={dom:H,reactive:ne};function j(t){g.core&&t.setAttribute("fluixi",g.core),t.setAttribute("fx-dom",g.dom),t.setAttribute("fx-reactive",g.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=g)}function F(){let t=[g.core,g.dom,g.reactive].filter(e=>e!==void 0);new Set(t).size<=1||console.warn(`[fluixi] package versions disagree — core ${g.core??"(absent)"}, dom ${g.dom}, reactive ${g.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function b(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}import{batch as oe,createEffect as je,createRenderEffect as re,createRoot as ie,onCleanup as se,readChildren as Fe}from"@fluixi/reactive/signal";var w=typeof document>"u";var W=Symbol.for("fluixi.server-node"),V=null;function $(){if(!V)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return V}function _(t){return t!=null&&t[W]===!0?!0:typeof Node<"u"&&t instanceof Node}function K(t){return t!=null&&t[W]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var u={active:!1,cursor:null,parents:[]},B=null;function G(t){B=t}function k(){return B}function O(t,e){return u.active&&e.parentNode===t}function J(t){let e=u.parents.lastIndexOf(t);e!==-1&&(u.parents.length=e),u.cursor=t.nextSibling}function E(t,e=!1){if(w)return $().createText(t);if(u.active&&!e){let n=k()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function X(t,e=!1){if(w)return $().createElement(t,e);if(u.active){let n=k()?.hydrateElement(t);if(n)return n}return e?document.createElementNS(q,t):document.createElement(t)}var h=0,ae=200;function fe(t,e,n,i,l){let a=i,s=new Map;return re(()=>{let o;if(b(t)&&!m(t)){if(!s.has(t)){h++;try{let r=t();s.set(t,r)}finally{h--}}for(o=s.get(t);typeof o=="function"&&m(o);)o=o()}else for(o=t();typeof o=="function"&&m(o);)o=o();{let r=0;for(;typeof o=="function"&&r++<50;)if(b(o)){if(!s.has(o)){let f=o;h++;try{let c=f();s.set(f,c)}finally{h--}}o=s.get(o)}else if(m(o))o=o();else if(o=o(),typeof o!="function"||!m(o)&&!b(o))break}h++;try{a=A(e,o,n,a,s),l(a)}finally{h--}})}function T(t,e,n,i){if(h>ae)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=E("",!0),t.appendChild(n));let l=i??null,a=r=>Array.isArray(r)&&r.some(f=>typeof f=="function"),s=r=>typeof r=="function"?r:()=>r;if(typeof e!="function"&&!a(e)){h++;try{l=A(t,e,n,null)}finally{h--}return()=>l}let o=fe(s(e),t,n,l,r=>{l=r});return()=>(o?.(),l)}function A(t,e,n,i,l){if(e==null||typeof e=="boolean")return N(t,i,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return N(t,i,n);if(v(e)){let s=E("",!0);return Array.isArray(i)?i.length>0?(t.replaceChild(s,i[0]),N(t,i.slice(1),n)):y(t,s,n):i?t.replaceChild(s,i):y(t,s,n),e.then(o=>{s.parentNode===t&&A(t,o,s.nextSibling,s)}).catch(o=>{console.error("Error resolving promise in insertExpression:",o)}),s}let a=typeof e;if(a==="string"||a==="number"){if(a==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let o=E(e);return y(t,o,n),o}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=N(t,i,n)}if(i&&K(i))return i.data=e,i;let s=E(e);return i&&i.parentNode===t?t.replaceChild(s,i):O(t,s)||y(t,s,n),s}if(_(e))return O(t,e)?(J(e),e):Array.isArray(i)?(i.length===0?y(t,e,n):i[0].parentNode===t?(t.replaceChild(e,i[0]),N(t,i.slice(1),n)):y(t,e,n),e):(i?i!==e&&(i.parentNode===t?t.replaceChild(e,i):y(t,e,n)):y(t,e,n),e);if(Array.isArray(e)){let s=[],o=Array.isArray(i)?i:i?[i]:[],r=[];x(e,s,t,n,!0,l,r);let f=ue(t,o,s,n);for(let c of r){let d=T(t,c.sig,c.marker);se(()=>{N(t,d()),c.marker.parentNode===t&&t.removeChild(c.marker)})}return f}if(a==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let o=s;if(typeof o.type=="function"){let r=o.type(o.props||{});return A(t,r,n,i)}}}return N(t,i,n)}function x(t,e,n,i,l=!0,a,s){for(let o=0;o<t.length;o++){let r=t[o];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!v(r)&&!m(r)&&!b(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let f;for(b(r)&&!m(r)?(a||(a=new Map),a.has(r)||a.set(r,r()),f=a.get(r)):f=r();typeof f=="function"&&!v(f)&&!m(f)&&!b(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if(m(f)){if(s){let d=E("",!0);e.push(d),s.push({marker:d,sig:f});continue}let c=f();for(;typeof c=="function"&&m(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?x(c,e,n,i,l,a):x([c],e,n,i,l,a);continue}continue}Array.isArray(f)?x(f,e,n,i,l,a,s):x([f],e,n,i,l,a,s);continue}if(v(r)){let f=E("",!0);e.push(f),r.then(c=>{if(f.parentNode){let d=[];if(x([c],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let p=1;p<d.length;p++)f.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(r)){x(r,e,n,i,l,a,s);continue}if(_(r)){e.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let f=r;if(typeof f.type=="function"){let c=f.type(f.props||{});Array.isArray(c)?x(c,e,n,i,!1,a):x([c],e,n,i,!1,a);continue}}if(typeof r=="string"||typeof r=="number"){let f=String(r);if(f.trim()===""&&f!==" ")continue;e.push(E(f));continue}e.push(E(String(r)))}}}}function ue(t,e,n,i){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==t&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let l=n.length,a=e.length,s=l,o=0,r=0,f=a>0?e[a-1].nextSibling??void 0:i,c=null;for(;o<a||r<s;){if(e[o]===n[r]){o++,r++;continue}for(;a>o&&s>r&&e[a-1]===n[s-1];)a--,s--;if(a===o){let d=s<l?r?n[r-1].nextSibling??void 0:n[s-r]:f;for(;r<s;)y(t,n[r++],d)}else if(s===r)for(;o<a;)(!c||!c.has(e[o]))&&e[o].parentNode===t&&t.removeChild(e[o]),o++;else if(e[o]===n[s-1]&&n[r]===e[a-1]){let d=e[--a].nextSibling;y(t,n[r++],e[o++].nextSibling),y(t,n[--s],d),e[a]=e[o-1]}else{if(!c){c=new Map;let p=r;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[o]);if(d!=null)if(r<d&&d<s){let p=o,P=1;for(;++p<a&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+P);)P++;if(P>d-r){let te=e[o];for(;r<d;)y(t,n[r++],te)}else e[o].parentNode===t?t.replaceChild(n[r++],e[o++]):(y(t,n[r++],f),o++)}else o++;else e[o].parentNode===t&&t.removeChild(e[o]),o++}}return n}function N(t,e,n){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===t&&t.removeChild(e[i]);else e.parentNode===t&&t.removeChild(e);return null}function y(t,e,n){u.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function v(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function z(t,e,n){if(!e)throw new Error("Container element is required");let i,l,a=[];return ie(s=>{oe(()=>{u.active||(e.textContent=""),j(e),F(),T(e,t)}),l=s}),()=>{l?.(),i?.(),a.forEach(s=>s()),e.textContent=""}}var C,le={getStore:()=>C,run(t,e){let n=C;C=t;try{return e()}finally{C=n}}},ce=le;function U(){return ce.getStore()}import{setResourceIdSource as pe,setServerDataGetter as ye}from"@fluixi/reactive/signal";var de="__FX_DATA__";var D;function Y(){let t=globalThis.__FX_DATA__;if(t)return t;if(D!==void 0)return D;let e=null;if(typeof document<"u"){let n=document.getElementById(de)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return D=e}function R(){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 ge=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),L=typeof process<"u"&&process.env&&!1;function M(t,e){let n=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${t} 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 me(t){R();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(ge.has(t.toLowerCase())?u.cursor=e.nextSibling:(u.parents.push(e),u.cursor=e.firstChild),e):(L&&e&&M(`<${t}>`,e),null)}function xe(t){R();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(u.cursor=e.nextSibling,e):(L&&e&&M(`<${t}> (static)`,e),null)}function he(t){if(t===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}R();let e=u.cursor;return e&&e.nodeType===3?(u.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(L&&e&&M(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function Ee(t){R();let e=u.cursor;return e&&e.nodeType===8&&e.data===t?(u.cursor=e.nextSibling,e):(L&&e&&M(`marker <!--${t.slice(0,24)}-->`,e),null)}var Z=!1;function be(){Z||(Z=!0,G({hydrateElement:me,hydrateText:he,hydrateMarker:Ee,hydrateStatic:xe}))}function Q(t,e,n){be(),u.active=!0,u.cursor=e.firstChild,u.parents=[];let i=Y(),l=n?.resourceNamespace,a=0;pe(()=>l?`${l}:r${a++}`:`r${a++}`),ye(i?s=>s in i?{value:i[s]}:void 0:null);try{return z(t,e)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var I="fluixi-island";function rt(t){let{component:e,props:n={},name:i}=t,l=X(I),a=i??e.name??"Island";S(l,"name",a),S(l,"props",JSON.stringify(n??{}));let s=w?U():void 0;if(s){let o=s.nextIslandNamespace(a);T(l,()=>s.withResourceScope(o,()=>e(n)))}else T(l,()=>e(n));return l}var ee=!1;function Ne(){if(ee||typeof document>"u")return;ee=!0;let t=document.createElement("style");t.textContent=`${I}{display:contents}`,document.head.appendChild(t)}function it(t){if(typeof document>"u")return;Ne();let e=document.querySelectorAll(I),n=new Map;e.forEach(i=>{let l=i.getAttribute("name")??"",a=n.get(l)??0;n.set(l,a+1);let s=t[l];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${l}" has no component in the registry — left static.`);return}let o={};try{o=JSON.parse(i.getAttribute("props")||"{}")}catch{}Q(()=>s(o),i,{resourceNamespace:`${l}#${a}`})})}export{rt as Island,it as hydrateIslands};
|
package/dist/lib/dom/runtime.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var k=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var me=(e,t)=>{for(var n in t)k(e,n,{get:t[n],enumerable:!0})},xe=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ye(t))!ge.call(e,s)&&s!==n&&k(e,s,{get:()=>t[s],enumerable:!(o=pe(t,s))||o.enumerable});return e};var he=e=>xe(k({},"__esModule",{value:!0}),e);var Je={};me(Je,{addDelegatedEventListener:()=>ae,addNativeEventListener:()=>J,applyProps:()=>Ie,applyUse:()=>U,cleanChildren:()=>N,cloneTemplate:()=>ue,createNativeElement:()=>Pe,createPortal:()=>Ke,createTemplate:()=>le,delegateEvents:()=>z,escapeHTML:()=>Ge,fnName:()=>$e,generateID:()=>Se,getStableElementId:()=>we,handleRef:()=>Z,holeContent:()=>He,holeEnd:()=>Oe,holeScope:()=>Re,insert:()=>X,insertExpression:()=>C,isAccessor:()=>ze,isDelegatedEvent:()=>Ce,isFunction:()=>Le,isNativeElement:()=>Be,isPromise:()=>A,isSVGElement:()=>qe,iterateFn:()=>je,makeArrayFlat:()=>ce,mergeProps:()=>Ve,removeDelegatedEventListener:()=>G,render:()=>Xe,setClassList:()=>M,setClassName:()=>P,setDynamicAttribute:()=>j,setDynamicBoolAttribute:()=>Y,setDynamicProperty:()=>F,setProperty:()=>L,setStyle:()=>R,splitProps:()=>We,spread:()=>ke,templateNode:()=>Me});module.exports=he(Je);var g=require("@fluixi/reactive/signal");var I="http://www.w3.org/2000/svg";function Ee(e){return e.localName.includes("-")}function V(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Ee(e)){e[t]=n;return}w(e,t,n,o)}var W=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 Ye=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var Q="1.0.0-alpha.71";var ee=require("@fluixi/reactive"),x={dom:Q,reactive:ee.VERSION};function te(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function ne(){let e=[x.core,x.dom,x.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var u=require("@fluixi/reactive/signal");var S=typeof document>"u";var K=Symbol.for("fluixi.server-node"),oe=null;function O(){if(!oe)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return oe}function v(e){return e!=null&&e[K]===!0?!0:typeof Node<"u"&&e instanceof Node}function ie(e){return e!=null&&e[K]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function re(e){return e!=null&&e[K]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var p={active:!1,cursor:null,parents:[]},be=null;function H(){return be}function B(e,t){return p.active&&t.parentNode===e}function se(e){let t=p.parents.lastIndexOf(e);t!==-1&&(p.parents.length=t),p.cursor=e.nextSibling}function q(e,t){if(!e||e.parentNode==null)return t();let n=p.active,o=p.cursor,s=p.parents;p.active=!0,p.cursor=e,p.parents=[];try{return t()}finally{p.active=n,p.cursor=o,p.parents=s}}function Ne(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,s=e;for(;s=s.previousElementSibling;)s.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Te(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 we(e){return Te(Ne(e))}var Se=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),ve={};var fe=new Map,$=new Set,D=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function z(e){if(!S)for(let t of e)$.has(t)||D.has(t)||($.add(t),document.addEventListener(t,Ae))}function Ae(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 ae(e,t,n){if(e[`$$${t}`]=n,D.has(t)){let o=`__fx_${t}`;if(!e[o]){let s=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,s),e[o]=s}return}$.has(t)||z([t])}function G(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Ce(e){return!D.has(e)}function Le(e){return typeof e=="function"}function T(e,t=!1){if(S)return O().createText(e);if(p.active&&!t){let n=H()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Pe(e,t=!1){if(S)return O().createElement(e,t);if(p.active){let n=H()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(I,e):document.createElement(e)}function le(e,t=!1){let n=fe.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,fe.set(e,o),o}function Me(e,t,n=!1,o=!1){if(S){let s=O();return n?s.parseTemplate(e,o):s.createRaw(e)}if(p.active){let s=H()?.hydrateStatic(t);if(s)return s}return ue(le(e,o),o).firstChild}function Re(e,t){if(!p.active)return t();let n=q(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...s)=>p.active?q(e.nextSibling,()=>o(...s)):o(...s))}return n}function Oe(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function He(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function ue(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function ce(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?ce(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function $e(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function je(e){if((0,g.isSignal)(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,g.isSignal)(t)&&!h(t);)t=t();return t}var b=0,Fe=200;function De(e,t,n,o,s){let a=o,f=new Map;return(0,u.createRenderEffect)(()=>{let r;if(h(e)&&!(0,g.isSignal)(e)){if(!f.has(e)){b++;try{let i=e();f.set(e,i)}finally{b--}}for(r=f.get(e);typeof r=="function"&&(0,g.isSignal)(r);)r=r()}else for(r=e();typeof r=="function"&&(0,g.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(h(r)){if(!f.has(r)){let l=r;b++;try{let c=l();f.set(l,c)}finally{b--}}r=f.get(r)}else if((0,g.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,g.isSignal)(r)&&!h(r))break}b++;try{a=C(t,r,n,a,f),s(a)}finally{b--}})}function X(e,t,n,o){if(b>Fe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=T("",!0),e.appendChild(n));let s=o??null,a=i=>Array.isArray(i)&&i.some(l=>typeof l=="function"),f=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){b++;try{s=C(e,t,n,null)}finally{b--}return()=>s}let r=De(f(t),e,n,s,i=>{s=i});return()=>(r?.(),s)}function C(e,t,n,o,s){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(A(t)){let f=T("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),N(e,o.slice(1),n)):m(e,f,n):o?e.replaceChild(f,o):m(e,f,n),t.then(r=>{f.parentNode===e&&C(e,r,f.nextSibling,f)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),f}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=T(t);return m(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=N(e,o,n)}if(o&&re(o))return o.data=t,o;let f=T(t);return o&&o.parentNode===e?e.replaceChild(f,o):B(e,f)||m(e,f,n),f}if(v(t))return B(e,t)?(se(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),N(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let f=[],r=Array.isArray(o)?o:o?[o]:[],i=[];E(t,f,e,n,!0,s,i);let l=_e(e,r,f,n);for(let c of i){let d=X(e,c.sig,c.marker);(0,u.onCleanup)(()=>{N(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let f=t;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,n,o)}}}return N(e,o,n)}function E(e,t,n,o,s=!0,a,f){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!A(i)&&!(0,g.isSignal)(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)&&!(0,g.isSignal)(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),l=a.get(i)):l=i();typeof l=="function"&&!A(l)&&!(0,g.isSignal)(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((0,g.isSignal)(l)){if(f){let d=T("",!0);t.push(d),f.push({marker:d,sig:l});continue}let c=l();for(;typeof c=="function"&&(0,g.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?E(c,t,n,o,s,a):E([c],t,n,o,s,a);continue}continue}Array.isArray(l)?E(l,t,n,o,s,a,f):E([l],t,n,o,s,a,f);continue}if(A(i)){let l=T("",!0);t.push(l),i.then(c=>{if(l.parentNode){let d=[];if(E([c],d,l.parentNode,void 0,!1,a),d.length>0){l.parentNode.replaceChild(d[0],l);for(let y=1;y<d.length;y++)l.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){E(i,t,n,o,s,a,f);continue}if(v(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 c=l.type(l.props||{});Array.isArray(c)?E(c,t,n,o,!1,a):E([c],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let l=String(i);if(l.trim()===""&&l!==" ")continue;t.push(T(l));continue}t.push(T(String(i)))}}}}function _e(e,t,n,o){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let s=n.length,a=t.length,f=s,r=0,i=0,l=a>0?t[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<f;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&f>i&&t[a-1]===n[f-1];)a--,f--;if(a===r){let d=f<s?i?n[i-1].nextSibling??void 0:n[f-i]:l;for(;i<f;)m(e,n[i++],d)}else if(f===i)for(;r<a;)(!c||!c.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[f-1]&&n[i]===t[a-1]){let d=t[--a].nextSibling;m(e,n[i++],t[r++].nextSibling),m(e,n[--f],d),t[a]=t[r-1]}else{if(!c){c=new Map;let y=i;for(;y<f;)c.set(n[y],y++)}let d=c.get(t[r]);if(d!=null)if(i<d&&d<f){let y=r,_=1;for(;++y<a&&y<f&&!(!c.has(t[y])||c.get(t[y])!==d+_);)_++;if(_>d-i){let de=t[r];for(;i<d;)m(e,n[i++],de)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(m(e,n[i++],l),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}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 m(e,t,n){p.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function L(e,t,n){n==null?delete e[t]:e[t]=n}function J(e,t,n){let o=n,s;return Array.isArray(n)&&(o=n[0],s=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s))}function U(e,t){let n=(o,s)=>{typeof o=="function"&&o(e,s??(()=>{}))};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 j(e,t,n,o=!1){return typeof n!="function"?(w(e,t,n,o),()=>{}):(0,u.createRenderEffect)(()=>{let s=typeof n=="function"?n():n;w(e,t,s,o)})}function F(e,t,n){return typeof n!="function"?(L(e,t,n),()=>{}):(0,u.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;L(e,t,o)})}function Y(e,t,n){return typeof n!="function"?(w(e,t,!!n),()=>{}):(0,u.createRenderEffect)(()=>{let o=n();w(e,t,!!o)})}function P(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,u.createRenderEffect)(()=>P(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 s=t[o];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function M(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let s=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push((0,u.createRenderEffect)(()=>{let f=!!s();for(let r of a)e.classList.toggle(r,f)}));else{let f=!!(typeof s=="function"?s():s);for(let r of a)e.classList.toggle(r,f)}}}function R(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 s=n[o];s==null?e.style[o]="":e.style[o]=s}}function ke(e){let{element:t,props:n,prevProps:o=ve,isSVG:s=!1,skipChildren:a=!1}=e;if(!t||!ie(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let f=s||t.namespaceURI===I,r=[];for(let i in n){if(a&&i==="children")continue;let l=n[i],c=o[i];if(l===c)continue;if(i==="ref"){Z(l,t);continue}if(i==="use"){U(t,l);continue}if(i.startsWith("on:")){r.push(J(t,i.slice(3),l));continue}if(i.startsWith("prop:")){r.push(F(t,i.slice(5),l));continue}if(i.startsWith("attr:")){r.push(j(t,i.slice(5),l,f));continue}if(i.startsWith("bool:")){r.push(Y(t,i.slice(5),l));continue}if(i==="class"||i==="className"){typeof l=="function"?r.push((0,u.createRenderEffect)(()=>P(t,l()))):P(t,l);continue}if(i==="classList"){typeof l=="function"?r.push((0,u.createRenderEffect)(()=>M(t,l()))):M(t,l,r);continue}if(i==="style"){typeof l=="function"?r.push((0,u.createRenderEffect)(()=>R(t,l()))):R(t,l);continue}if(i.startsWith("on")){let y=i.slice(2).toLowerCase();c&&G(t,y),l&&ae(t,y,l);continue}let d=W.has(i)||!f&&i in t;typeof l=="function"?r.push(d?F(t,i,l):j(t,i,l,f)):r.push((0,u.createRenderEffect)(()=>d?L(t,i,n[i]):w(t,i,n[i],f)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let l=i.slice(2).toLowerCase();G(t,l)}else W.has(i)?L(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function Ie(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){Z(s,e);continue}if(o!=="children"){if(o==="use"){U(e,s);continue}if(o.startsWith("on:")){J(e,o.slice(3),s);continue}if(o.startsWith("prop:")){F(e,o.slice(5),s);continue}if(o.startsWith("attr:")){j(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){Y(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(D.has(a)){e[`$$${a}`]=s;let f=`__fx_${a}`;if(!e[f]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[f]=r}}else e[`$$${a}`]=s,$.has(a)||z([a]);continue}if(o==="class"||o==="className"){P(e,s);continue}if(o==="classList"){typeof s=="function"?(0,u.createRenderEffect)(()=>M(e,s())):M(e,s);continue}if(o==="style"){typeof s=="function"?(0,u.createRenderEffect)(()=>R(e,s())):R(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function";)f=f();e.innerHTML=f});(0,u.onCleanup)(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.value=f??"")});(0,u.onCleanup)(()=>{a()})}else(0,u.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.checked=f??"")});(0,u.onCleanup)(()=>{a()})}else(0,u.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,f=(0,u.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});(0,u.onCleanup)(()=>{f()})}else{let a=!0;(0,u.createRenderEffect)(()=>{let f=t[o];a?(a=!1,queueMicrotask(()=>{e.value=f??""})):e.value=f??""})}continue}if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();V(e,o,f,n)});(0,u.onCleanup)(()=>{a()})}else(0,u.createRenderEffect)(()=>V(e,o,t[o],n))}}}function Ve(...e){let t=o=>{for(let s=e.length-1;s>=0;s--){let a=e[s];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let s of e)if(s&&o in s)return!0;return!1};return new Proxy({},{get:(o,s)=>t(s),has:(o,s)=>n(s),ownKeys:()=>{let o=new Set;for(let s of e)if(s)for(let a of Reflect.ownKeys(s))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,s)=>n(s)?{enumerable:!0,configurable:!0,get:()=>t(s)}:void 0})}function We(e,...t){let n=new Set;for(let f of t)for(let r of f)n.add(r);let o=f=>({enumerable:!0,configurable:!0,get:()=>e[f]}),s=t.map(f=>{let r=new Set(f);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:(f,r)=>n.has(r)?void 0:e[r],has:(f,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(f=>!n.has(f)),getOwnPropertyDescriptor:(f,r)=>!n.has(r)&&r in e?o(r):void 0});return[...s,a]}function Z(e,t){if(e){if(v(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,s=(0,u.readChildren)(()=>e),a=[];return(0,u.batch)(()=>{let f=(0,u.createRenderEffect)(()=>{let r=s();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):v(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(f),(0,u.onCleanup)(()=>{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 A(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ze(e){return typeof e=="function"&&e.length===0&&(0,g.isSignal)(e)}function Xe(e,t,n){if(!t)throw new Error("Container element is required");let o,s,a=[];return(0,u.createRoot)(f=>{(0,u.batch)(()=>{p.active||(t.textContent=""),te(t),ne(),X(t,e)}),s=f}),()=>{s?.(),o?.(),a.forEach(f=>f()),t.textContent=""}}
|
|
1
|
+
"use strict";var k=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var me=(e,t)=>{for(var n in t)k(e,n,{get:t[n],enumerable:!0})},xe=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ye(t))!ge.call(e,s)&&s!==n&&k(e,s,{get:()=>t[s],enumerable:!(o=pe(t,s))||o.enumerable});return e};var he=e=>xe(k({},"__esModule",{value:!0}),e);var Je={};me(Je,{addDelegatedEventListener:()=>ae,addNativeEventListener:()=>J,applyProps:()=>Ie,applyUse:()=>U,cleanChildren:()=>N,cloneTemplate:()=>ue,createNativeElement:()=>Pe,createPortal:()=>Ke,createTemplate:()=>le,delegateEvents:()=>z,escapeHTML:()=>Ge,fnName:()=>$e,generateID:()=>Se,getStableElementId:()=>we,handleRef:()=>Z,holeContent:()=>He,holeEnd:()=>Oe,holeScope:()=>Re,insert:()=>X,insertExpression:()=>C,isAccessor:()=>ze,isDelegatedEvent:()=>Ce,isFunction:()=>Le,isNativeElement:()=>Be,isPromise:()=>A,isSVGElement:()=>qe,iterateFn:()=>je,makeArrayFlat:()=>ce,mergeProps:()=>Ve,removeDelegatedEventListener:()=>G,render:()=>Xe,setClassList:()=>M,setClassName:()=>P,setDynamicAttribute:()=>j,setDynamicBoolAttribute:()=>Y,setDynamicProperty:()=>F,setProperty:()=>L,setStyle:()=>R,splitProps:()=>We,spread:()=>ke,templateNode:()=>Me});module.exports=he(Je);var g=require("@fluixi/reactive/signal");var I="http://www.w3.org/2000/svg";function Ee(e){return e.localName.includes("-")}function V(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Ee(e)){e[t]=n;return}w(e,t,n,o)}var W=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 Ye=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var Q="1.0.0-alpha.73";var ee=require("@fluixi/reactive"),x={dom:Q,reactive:ee.VERSION};function te(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function ne(){let e=[x.core,x.dom,x.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var u=require("@fluixi/reactive/signal");var S=typeof document>"u";var K=Symbol.for("fluixi.server-node"),oe=null;function O(){if(!oe)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return oe}function v(e){return e!=null&&e[K]===!0?!0:typeof Node<"u"&&e instanceof Node}function ie(e){return e!=null&&e[K]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function re(e){return e!=null&&e[K]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var p={active:!1,cursor:null,parents:[]},be=null;function H(){return be}function B(e,t){return p.active&&t.parentNode===e}function se(e){let t=p.parents.lastIndexOf(e);t!==-1&&(p.parents.length=t),p.cursor=e.nextSibling}function q(e,t){if(!e||e.parentNode==null)return t();let n=p.active,o=p.cursor,s=p.parents;p.active=!0,p.cursor=e,p.parents=[];try{return t()}finally{p.active=n,p.cursor=o,p.parents=s}}function Ne(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,s=e;for(;s=s.previousElementSibling;)s.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Te(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 we(e){return Te(Ne(e))}var Se=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),ve={};var fe=new Map,$=new Set,D=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function z(e){if(!S)for(let t of e)$.has(t)||D.has(t)||($.add(t),document.addEventListener(t,Ae))}function Ae(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 ae(e,t,n){if(e[`$$${t}`]=n,D.has(t)){let o=`__fx_${t}`;if(!e[o]){let s=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,s),e[o]=s}return}$.has(t)||z([t])}function G(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Ce(e){return!D.has(e)}function Le(e){return typeof e=="function"}function T(e,t=!1){if(S)return O().createText(e);if(p.active&&!t){let n=H()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Pe(e,t=!1){if(S)return O().createElement(e,t);if(p.active){let n=H()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(I,e):document.createElement(e)}function le(e,t=!1){let n=fe.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,fe.set(e,o),o}function Me(e,t,n=!1,o=!1){if(S){let s=O();return n?s.parseTemplate(e,o):s.createRaw(e)}if(p.active){let s=H()?.hydrateStatic(t);if(s)return s}return ue(le(e,o),o).firstChild}function Re(e,t){if(!p.active)return t();let n=q(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...s)=>p.active?q(e.nextSibling,()=>o(...s)):o(...s))}return n}function Oe(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function He(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function ue(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function ce(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?ce(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function $e(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function je(e){if((0,g.isSignal)(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,g.isSignal)(t)&&!h(t);)t=t();return t}var b=0,Fe=200;function De(e,t,n,o,s){let a=o,f=new Map;return(0,u.createRenderEffect)(()=>{let r;if(h(e)&&!(0,g.isSignal)(e)){if(!f.has(e)){b++;try{let i=e();f.set(e,i)}finally{b--}}for(r=f.get(e);typeof r=="function"&&(0,g.isSignal)(r);)r=r()}else for(r=e();typeof r=="function"&&(0,g.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(h(r)){if(!f.has(r)){let l=r;b++;try{let c=l();f.set(l,c)}finally{b--}}r=f.get(r)}else if((0,g.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,g.isSignal)(r)&&!h(r))break}b++;try{a=C(t,r,n,a,f),s(a)}finally{b--}})}function X(e,t,n,o){if(b>Fe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=T("",!0),e.appendChild(n));let s=o??null,a=i=>Array.isArray(i)&&i.some(l=>typeof l=="function"),f=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){b++;try{s=C(e,t,n,null)}finally{b--}return()=>s}let r=De(f(t),e,n,s,i=>{s=i});return()=>(r?.(),s)}function C(e,t,n,o,s){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(A(t)){let f=T("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),N(e,o.slice(1),n)):m(e,f,n):o?e.replaceChild(f,o):m(e,f,n),t.then(r=>{f.parentNode===e&&C(e,r,f.nextSibling,f)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),f}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=T(t);return m(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=N(e,o,n)}if(o&&re(o))return o.data=t,o;let f=T(t);return o&&o.parentNode===e?e.replaceChild(f,o):B(e,f)||m(e,f,n),f}if(v(t))return B(e,t)?(se(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),N(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let f=[],r=Array.isArray(o)?o:o?[o]:[],i=[];E(t,f,e,n,!0,s,i);let l=_e(e,r,f,n);for(let c of i){let d=X(e,c.sig,c.marker);(0,u.onCleanup)(()=>{N(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let f=t;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,n,o)}}}return N(e,o,n)}function E(e,t,n,o,s=!0,a,f){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!A(i)&&!(0,g.isSignal)(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)&&!(0,g.isSignal)(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),l=a.get(i)):l=i();typeof l=="function"&&!A(l)&&!(0,g.isSignal)(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((0,g.isSignal)(l)){if(f){let d=T("",!0);t.push(d),f.push({marker:d,sig:l});continue}let c=l();for(;typeof c=="function"&&(0,g.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?E(c,t,n,o,s,a):E([c],t,n,o,s,a);continue}continue}Array.isArray(l)?E(l,t,n,o,s,a,f):E([l],t,n,o,s,a,f);continue}if(A(i)){let l=T("",!0);t.push(l),i.then(c=>{if(l.parentNode){let d=[];if(E([c],d,l.parentNode,void 0,!1,a),d.length>0){l.parentNode.replaceChild(d[0],l);for(let y=1;y<d.length;y++)l.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){E(i,t,n,o,s,a,f);continue}if(v(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 c=l.type(l.props||{});Array.isArray(c)?E(c,t,n,o,!1,a):E([c],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let l=String(i);if(l.trim()===""&&l!==" ")continue;t.push(T(l));continue}t.push(T(String(i)))}}}}function _e(e,t,n,o){for(let d=0;d<n.length;d++){let y=n[d].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let s=n.length,a=t.length,f=s,r=0,i=0,l=a>0?t[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<f;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&f>i&&t[a-1]===n[f-1];)a--,f--;if(a===r){let d=f<s?i?n[i-1].nextSibling??void 0:n[f-i]:l;for(;i<f;)m(e,n[i++],d)}else if(f===i)for(;r<a;)(!c||!c.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[f-1]&&n[i]===t[a-1]){let d=t[--a].nextSibling;m(e,n[i++],t[r++].nextSibling),m(e,n[--f],d),t[a]=t[r-1]}else{if(!c){c=new Map;let y=i;for(;y<f;)c.set(n[y],y++)}let d=c.get(t[r]);if(d!=null)if(i<d&&d<f){let y=r,_=1;for(;++y<a&&y<f&&!(!c.has(t[y])||c.get(t[y])!==d+_);)_++;if(_>d-i){let de=t[r];for(;i<d;)m(e,n[i++],de)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(m(e,n[i++],l),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}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 m(e,t,n){p.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function L(e,t,n){n==null?delete e[t]:e[t]=n}function J(e,t,n){let o=n,s;return Array.isArray(n)&&(o=n[0],s=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s))}function U(e,t){let n=(o,s)=>{typeof o=="function"&&o(e,s??(()=>{}))};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 j(e,t,n,o=!1){return typeof n!="function"?(w(e,t,n,o),()=>{}):(0,u.createRenderEffect)(()=>{let s=typeof n=="function"?n():n;w(e,t,s,o)})}function F(e,t,n){return typeof n!="function"?(L(e,t,n),()=>{}):(0,u.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;L(e,t,o)})}function Y(e,t,n){return typeof n!="function"?(w(e,t,!!n),()=>{}):(0,u.createRenderEffect)(()=>{let o=n();w(e,t,!!o)})}function P(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,u.createRenderEffect)(()=>P(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 s=t[o];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function M(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let s=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push((0,u.createRenderEffect)(()=>{let f=!!s();for(let r of a)e.classList.toggle(r,f)}));else{let f=!!(typeof s=="function"?s():s);for(let r of a)e.classList.toggle(r,f)}}}function R(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 s=n[o];s==null?e.style[o]="":e.style[o]=s}}function ke(e){let{element:t,props:n,prevProps:o=ve,isSVG:s=!1,skipChildren:a=!1}=e;if(!t||!ie(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let f=s||t.namespaceURI===I,r=[];for(let i in n){if(a&&i==="children")continue;let l=n[i],c=o[i];if(l===c)continue;if(i==="ref"){Z(l,t);continue}if(i==="use"){U(t,l);continue}if(i.startsWith("on:")){r.push(J(t,i.slice(3),l));continue}if(i.startsWith("prop:")){r.push(F(t,i.slice(5),l));continue}if(i.startsWith("attr:")){r.push(j(t,i.slice(5),l,f));continue}if(i.startsWith("bool:")){r.push(Y(t,i.slice(5),l));continue}if(i==="class"||i==="className"){typeof l=="function"?r.push((0,u.createRenderEffect)(()=>P(t,l()))):P(t,l);continue}if(i==="classList"){typeof l=="function"?r.push((0,u.createRenderEffect)(()=>M(t,l()))):M(t,l,r);continue}if(i==="style"){typeof l=="function"?r.push((0,u.createRenderEffect)(()=>R(t,l()))):R(t,l);continue}if(i.startsWith("on")){let y=i.slice(2).toLowerCase();c&&G(t,y),l&&ae(t,y,l);continue}let d=W.has(i)||!f&&i in t;typeof l=="function"?r.push(d?F(t,i,l):j(t,i,l,f)):r.push((0,u.createRenderEffect)(()=>d?L(t,i,n[i]):w(t,i,n[i],f)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let l=i.slice(2).toLowerCase();G(t,l)}else W.has(i)?L(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function Ie(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){Z(s,e);continue}if(o!=="children"){if(o==="use"){U(e,s);continue}if(o.startsWith("on:")){J(e,o.slice(3),s);continue}if(o.startsWith("prop:")){F(e,o.slice(5),s);continue}if(o.startsWith("attr:")){j(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){Y(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(D.has(a)){e[`$$${a}`]=s;let f=`__fx_${a}`;if(!e[f]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[f]=r}}else e[`$$${a}`]=s,$.has(a)||z([a]);continue}if(o==="class"||o==="className"){P(e,s);continue}if(o==="classList"){typeof s=="function"?(0,u.createRenderEffect)(()=>M(e,s())):M(e,s);continue}if(o==="style"){typeof s=="function"?(0,u.createRenderEffect)(()=>R(e,s())):R(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function";)f=f();e.innerHTML=f});(0,u.onCleanup)(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.value=f??"")});(0,u.onCleanup)(()=>{a()})}else(0,u.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.checked=f??"")});(0,u.onCleanup)(()=>{a()})}else(0,u.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,f=(0,u.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});(0,u.onCleanup)(()=>{f()})}else{let a=!0;(0,u.createRenderEffect)(()=>{let f=t[o];a?(a=!1,queueMicrotask(()=>{e.value=f??""})):e.value=f??""})}continue}if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();V(e,o,f,n)});(0,u.onCleanup)(()=>{a()})}else(0,u.createRenderEffect)(()=>V(e,o,t[o],n))}}}function Ve(...e){let t=o=>{for(let s=e.length-1;s>=0;s--){let a=e[s];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let s of e)if(s&&o in s)return!0;return!1};return new Proxy({},{get:(o,s)=>t(s),has:(o,s)=>n(s),ownKeys:()=>{let o=new Set;for(let s of e)if(s)for(let a of Reflect.ownKeys(s))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,s)=>n(s)?{enumerable:!0,configurable:!0,get:()=>t(s)}:void 0})}function We(e,...t){let n=new Set;for(let f of t)for(let r of f)n.add(r);let o=f=>({enumerable:!0,configurable:!0,get:()=>e[f]}),s=t.map(f=>{let r=new Set(f);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:(f,r)=>n.has(r)?void 0:e[r],has:(f,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(f=>!n.has(f)),getOwnPropertyDescriptor:(f,r)=>!n.has(r)&&r in e?o(r):void 0});return[...s,a]}function Z(e,t){if(e){if(v(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,s=(0,u.readChildren)(()=>e),a=[];return(0,u.batch)(()=>{let f=(0,u.createRenderEffect)(()=>{let r=s();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):v(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(f),(0,u.onCleanup)(()=>{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 A(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ze(e){return typeof e=="function"&&e.length===0&&(0,g.isSignal)(e)}function Xe(e,t,n){if(!t)throw new Error("Container element is required");let o,s,a=[];return(0,u.createRoot)(f=>{(0,u.batch)(()=>{p.active||(t.textContent=""),te(t),ne(),X(t,e)}),s=f}),()=>{s?.(),o?.(),a.forEach(f=>f()),t.textContent=""}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAyEH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAEtD;AACD,eAAO,MAAM,UAAU,cAMtB,CAAC;AAMF,KAAK,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAE3B,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC;AAChC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAC1E,MAAM,MAAM,QAAQ,GAChB,IAAI,GACJ,IAAI,EAAE,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,CAAC,MAAM,GAAG,CAAC,CAAC;AAyBhB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAOzD;AAmBD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,GACrB,IAAI,CAiBN;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAQjF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAMD;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAExD;AAuBD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,OAAO,CASvE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,mBAAmB,CAS/E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,UAAQ,EAAE,KAAK,UAAQ,GAAG,IAAI,CAc1F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAqB7D;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAMzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,IAAI,EAAE,CAI1D;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,UAAQ,GACZ,gBAAgB,GAAG,OAAO,CAI5B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,OAS1C;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,QAAQ,OAGlC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAkBxC;AA8FD,wBAAgB,MAAM,CACpB,MAAM,EAAE,IAAI,EACZ,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,EAC/C,MAAM,CAAC,EAAE,IAAI,EACb,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,GAC1B,CAAC,MAAM,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,CAsCvD;AAMD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,QAAQ,EACf,MAAM,CAAC,EAAE,IAAI,EACb,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,EAC9B,cAAc,CAAC,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,GAClC,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CA2JtB;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAyEH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAEtD;AACD,eAAO,MAAM,UAAU,cAMtB,CAAC;AAMF,KAAK,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAE3B,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC;AAChC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAC1E,MAAM,MAAM,QAAQ,GAChB,IAAI,GACJ,IAAI,EAAE,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,CAAC,MAAM,GAAG,CAAC,CAAC;AAyBhB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAOzD;AAmBD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,GACrB,IAAI,CAiBN;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAQjF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAMD;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAExD;AAuBD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,OAAO,CASvE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,mBAAmB,CAS/E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,UAAQ,EAAE,KAAK,UAAQ,GAAG,IAAI,CAc1F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAqB7D;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAMzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,IAAI,EAAE,CAI1D;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,UAAQ,GACZ,gBAAgB,GAAG,OAAO,CAI5B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,OAS1C;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,QAAQ,OAGlC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAkBxC;AA8FD,wBAAgB,MAAM,CACpB,MAAM,EAAE,IAAI,EACZ,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,EAC/C,MAAM,CAAC,EAAE,IAAI,EACb,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,GAC1B,CAAC,MAAM,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,CAsCvD;AAMD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,QAAQ,EACf,MAAM,CAAC,EAAE,IAAI,EACb,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,EAC9B,cAAc,CAAC,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,GAClC,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CA2JtB;AAkSD,wBAAgB,aAAa,CAC3B,MAAM,EAAE,IAAI,EACZ,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,EAC9B,MAAM,CAAC,EAAE,IAAI,GACZ,IAAI,CAYN;AA2BD,wBAAgB,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAGxE;AAED;;;;;GAKG;AACH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,IAAI,CAO7F;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAY3D;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,GAAG,EACb,KAAK,UAAQ,GACZ,MAAM,IAAI,CASZ;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,MAAM,IAAI,CASxF;AAID,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,MAAM,IAAI,CASjG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CA8B/D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,GAAG,EACV,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,GAC5B,IAAI,CAiBN;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI,CAexD;AAMD,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,IAAI,CA8IzD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,UAAQ,GAAG,IAAI,CA2K5F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CA4BxE;AAED,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI;KAC1C,CAAC,IAAI,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAClE,KAAK,EAAE,CAAC,EACR,GAAG,IAAI,EAAE,CAAC,GACT,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CA8BlD;AAQD,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAe1D;AAMD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,QAgDpE;AAKD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMjD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO9C;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAOnD;AAMD,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAE9D;AAED,mGAAmG;AACnG,wBAAgB,MAAM,CAAC,CAAC,EACtB,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE,GAAG,GACZ,MAAM,IAAI,CAuCZ"}
|