lithent 1.0.2 → 1.0.4
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/README.md +7 -8
- package/dist/lithent.mjs +363 -796
- package/dist/lithent.mjs.map +1 -1
- package/dist/lithent.umd.js +1 -1
- package/dist/lithent.umd.js.map +1 -1
- package/dist/utils/predicator.d.ts +0 -1
- package/examples/dist/assets/index.f6f52820.js +2 -0
- package/examples/dist/assets/index.f6f52820.js.map +1 -0
- package/examples/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/diff.ts +12 -26
- package/src/render.ts +33 -14
- package/src/tests/renew.tsx +3 -2
- package/src/utils/predicator.ts +0 -5
- package/src/wDom.ts +3 -7
- package/examples/dist/assets/index.1e9792b7.js +0 -2
- package/examples/dist/assets/index.1e9792b7.js.map +0 -1
package/src/tests/renew.tsx
CHANGED
|
@@ -27,6 +27,7 @@ const Renew = mount((renew, _props) => {
|
|
|
27
27
|
<button ref={el} onClick={change}>
|
|
28
28
|
change
|
|
29
29
|
</button>
|
|
30
|
+
<button disabled={count1 % 2 === 0}>change</button>
|
|
30
31
|
</Fragment>
|
|
31
32
|
);
|
|
32
33
|
});
|
|
@@ -40,7 +41,7 @@ if (import.meta.vitest) {
|
|
|
40
41
|
const { it, expect } = import.meta.vitest;
|
|
41
42
|
it('Is renew working properly?', () => {
|
|
42
43
|
expect(testWrap.outerHTML).toBe(
|
|
43
|
-
'<div><li>count1: 0</li><li>count2: 0</li><li>count3: 0</li><li>count4: 0</li><button>change</button></div>'
|
|
44
|
+
'<div><li>count1: 0</li><li>count2: 0</li><li>count3: 0</li><li>count4: 0</li><button>change</button><button disabled="">change</button></div>'
|
|
44
45
|
);
|
|
45
46
|
if (testChangeRef.value) {
|
|
46
47
|
testChangeRef.value();
|
|
@@ -49,7 +50,7 @@ if (import.meta.vitest) {
|
|
|
49
50
|
}
|
|
50
51
|
nextTick().then(() => {
|
|
51
52
|
expect(testWrap.outerHTML).toBe(
|
|
52
|
-
'<div><li>count1: 3</li><li>count2: 6</li><li>count3: 9</li><li>count4: -3</li><button>change</button></div>'
|
|
53
|
+
'<div><li>count1: 3</li><li>count2: 6</li><li>count3: 9</li><li>count4: -3</li><button>change</button><button>change</button></div>'
|
|
53
54
|
);
|
|
54
55
|
});
|
|
55
56
|
});
|
package/src/utils/predicator.ts
CHANGED
|
@@ -105,11 +105,6 @@ export const checkTextareaElement = (element: any): element is HTMLElement =>
|
|
|
105
105
|
export const checkCheckableElement = (element: any): element is HTMLElement =>
|
|
106
106
|
element.nodeType === 1 && ['radio', 'checkbox'].includes(element.type);
|
|
107
107
|
|
|
108
|
-
export const checkNormalAttribute = (
|
|
109
|
-
dataValue: unknown
|
|
110
|
-
): dataValue is number | string =>
|
|
111
|
-
typeof dataValue === 'number' || typeof dataValue === 'string';
|
|
112
|
-
|
|
113
108
|
export const getWDomType = (
|
|
114
109
|
wDom: WDom | TagFunction | TagFunctionResolver
|
|
115
110
|
): WDomType => {
|
package/src/wDom.ts
CHANGED
|
@@ -216,13 +216,9 @@ const remakeChildren = (
|
|
|
216
216
|
nodeParentPointer: NodePointer,
|
|
217
217
|
children: MiddleStateWDomChildren
|
|
218
218
|
): WDom[] =>
|
|
219
|
-
children.map((item: MiddleStateWDom) =>
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
childItem.getParent = () => nodeParentPointer.value;
|
|
223
|
-
|
|
224
|
-
return childItem;
|
|
225
|
-
});
|
|
219
|
+
children.map((item: MiddleStateWDom) =>
|
|
220
|
+
assign(makeChildrenItem(item), { getParent: () => nodeParentPointer.value })
|
|
221
|
+
);
|
|
226
222
|
|
|
227
223
|
const makeChildrenItem = (item: MiddleStateWDom): WDom => {
|
|
228
224
|
if (item === null || item === undefined || item === false) {
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const l of c)if(l.type==="childList")for(const r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(c){const l={};return c.integrity&&(l.integrity=c.integrity),c.referrerpolicy&&(l.referrerPolicy=c.referrerpolicy),c.crossorigin==="use-credentials"?l.credentials="include":c.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(c){if(c.ep)return;c.ep=!0;const l=n(c);fetch(c.href,l)}})();const k=e=>typeof e=="object"&&!("resolve"in e),m=(e,t)=>k(e)&&e.type===t,ge=(e,t)=>"ctor"in e?e.ctor===(t==null?void 0:t.ctor):e===(t==null?void 0:t.ctor),Re=(e,t)=>{var n,o;return k(e)&&(t==null?void 0:t.type)==="fragment"&&((n=t==null?void 0:t.children)==null?void 0:n.length)===((o=e==null?void 0:e.children)==null?void 0:o.length)},Ee=(e,t)=>{var n,o;return k(e)&&(t==null?void 0:t.type)==="element"&&(t==null?void 0:t.tag)===e.tag&&((n=t==null?void 0:t.children)==null?void 0:n.length)===((o=e==null?void 0:e.children)==null?void 0:o.length)},A=(e,t)=>{var n,o;return k(e)&&(t==null?void 0:t.type)===e.type&&(((n=t==null?void 0:t.children)==null?void 0:n.length)===((o=e==null?void 0:e.children)==null?void 0:o.length)||e.type==="loop"&&y(v((e.children||[])[0]))&&y(v((t.children||[])[0])))},v=e=>{var t,n,o;return(o=(t=e==null?void 0:e.compProps)==null?void 0:t.key)!=null?o:(n=e==null?void 0:e.props)==null?void 0:n.key},b=e=>e&&["fragment","loop"].includes(e),N=e=>typeof e=="function"&&!X(e)||typeof e=="object"&&"resolve"in e,X=e=>typeof e=="function"&&e===F,H=e=>k(e)&&!e.type,y=e=>e!=null,z=(e,t)=>e==="style"&&typeof t=="object",me=(e,t)=>e==="ref"&&typeof t=="object",Pe=e=>e.nodeType===1&&e.tagName==="OPTION",xe=e=>e.nodeType===1&&e.tagName==="TEXTAREA",be=e=>e.nodeType===1&&["radio","checkbox"].includes(e.type),Ne=e=>typeof e=="number"||typeof e=="string",Se=e=>{let t="et";return N(e)?t="c":m(e,"fragment")?t="f":m(e,"element")?t="e":m(e,"loop")?t="l":m(e,"text")?t="t":H(e)&&(t="et"),t},Te={c:ge,l:A,t:A,e:Ee,f:Re,et:A},p=e=>e.getParent&&e.getParent(),Ue=(e,t)=>{const{compProps:n,compChild:o}=e,{props:c,children:l}=t;return n&&_e(n,c),o&&Oe(o,l),e.reRender&&e.reRender()},Z=e=>e.replace(/^on(.*)/,(t,n)=>n.toLowerCase()),G=e=>e==="className"?"class":e,C=Object.entries,K=Object.keys,Fe=Object.assign,_e=(e,t)=>{e&&t!==e&&(K(e).forEach(n=>delete e[n]),C(t||{}).forEach(([n,o])=>e[n]=o))},Oe=(e,t)=>{e&&t!==e&&(e.splice(0,e.length),t&&t.forEach(n=>e.push(n)))};let P=[],I=!1;const h={value:""},g={value:{}},L={value:!1},u=new WeakMap,Ae=e=>()=>{var t;const n=(t=u.get(e))==null?void 0:t.up;let o=!1;return n&&(n(),o=!0),o},Ie=e=>{u.set(e,{vd:{value:null},up:()=>{},upR:[],upS:{value:0},upD:[],upCB:[],mts:[],umts:[]})},R=()=>g.value,w=(e,t)=>u.get(e)[t],D=(e,t)=>{u.get(e).up=()=>{P.push({compKey:e,exec:t}),I||(I=!0,queueMicrotask(Ve))}},Le=e=>g.value=e,Me=e=>{g.value=e,Ie(e)},W=(e,t)=>{(e.children||[]).forEach(n=>{const o=n.compKey;o&&t.push(o),W(n,t)})},Ve=()=>{let e=[];P.forEach(o=>{var c,l;const r=(l=(c=u.get(o.compKey))==null?void 0:c.vd)==null?void 0:l.value;r&&W(r,e)});const t=[],n=P.reduce((o,c)=>{const{compKey:l}=c;return e.includes(l)||t.includes(l)||(t.push(l),o.push(c)),o},[]);for(;n.length;){const o=n.shift();o&&o.exec()}P=[],I=!1},Qe=e=>{u.get(R()).umts.push(e)},q=e=>{const{compKey:t}=e;t&&qe(t),ee(e)},ee=e=>{(e.children||[]).forEach(t=>{t.compKey?q(t):ee(t)})},qe=e=>{const t=u.get(e);t&&(t.umts.forEach(n=>n()),t.umts=[],u.delete(e))};let M=[];const B=()=>{M.forEach(e=>je(e)),M=[]},Be=e=>{e.compKey&&M.push(e)},te=e=>u.get(R()).mts.push(e),je=e=>{const{compKey:t}=e;if(t){const n=u.get(t),o=n==null?void 0:n.mts,c=n==null?void 0:n.upS;g.value=t,c&&(c.value=0),o&&(n.mts=[],o.forEach(l=>{const r=l();r&&Qe(r)}))}},J=(e,t=()=>[])=>{const n=u.get(R()),{upD:o,upS:c}=n,l=o[c.value];if(l&&$e(l,t())){const r=e();r&&n.upCB.push(r)}o[c.value]=t(),c.value+=1},Ye=e=>{const{compKey:t}=e;if(t){const n=u.get(t),o=n==null?void 0:n.upCB,c=n==null?void 0:n.upS;g.value=t,c&&(c.value=0),e.ctor&&o&&(n.upCB=[],o.forEach(l=>l()))}},$e=(e,t)=>!e.length&&!e.length?!0:e.some((n,o)=>n!==t[o]),ze=(e,t,n)=>{t!=null||(t=document.body),e.isRoot=!0,e.wrapElement=t;const o=S(e);return n?(e.afterElement=n,t.insertBefore(o,n)):t.appendChild(o),B(),()=>{var c;const l=(c=u.get(e.compProps||{}))==null?void 0:c.vd.value;l&&(q(l),j(l),Ge(l))}},ne=e=>{const{needRerender:t}=e;t&&t!=="N"&&{A:$,D:Y,R:Xe,U:He,SR:le,SU:Je}[t](e)},j=e=>{e.props&&e.el&&se(e.props,e.el),(e.children||[]).forEach(t=>{j(t)})},Ge=e=>{oe(e,e.wrapElement)},Y=e=>{e.oldProps&&e.el&&se(e.oldProps,e.el),oe(e,T(p(e)))},oe=(e,t)=>{var n,o;t&&e.el&&(((n=e.el)==null?void 0:n.nodeType)===1?t.removeChild(e.el):((o=e.el)==null?void 0:o.nodeType)===11&&ce(e,t),delete e.el)},ce=(e,t)=>{((e==null?void 0:e.oldChildren)||(e==null?void 0:e.children)||[]).forEach(n=>{var o,c;((o=n.el)==null?void 0:o.nodeType)===1?t.removeChild(n==null?void 0:n.el):((c=n.el)==null?void 0:c.nodeType)===11&&ce(n,t)})},le=e=>{Y(e),$(e)},Je=e=>{Y(e),$(e,e.el)},$=(e,t)=>{t||(t=S(e));const n=p(e);if(n.type){const o=T(n),l=n.type==="loop"?V(n,p(n)):V(e,n);t&&o&&(l?o.insertBefore(t,l):o.appendChild(t),B())}},V=(e,t)=>{const n=t.children||[],c=n.indexOf(e)+1,l=n.slice(c),r=re(l),i=t.type||"";if(r)return r;if(!t.isRoot&&b(i))return V(t,p(t));if(t.isRoot&&t.afterElement)return t.afterElement},re=e=>e.reduce((t,n)=>{const o=n.type,c=n.el,l=o&&b(o);return t||(l?re(n.children||[]):c&&c.nodeType!==11?c:t)},void 0),Xe=e=>{const t=p(e),n=e.el;if(t.type&&n)if(n.nodeType===11)le(e);else{const o=T(t),c=S(e);o&&o.replaceChild(c,n),B()}},se=(e,t)=>{C(e||{}).forEach(([n,o])=>{n.match(/^on/)&&t.removeEventListener(Z(n),o)})},He=e=>{var t;const n=e.el;if(e.type==="text"){Ze(e);return}if(n){const{oldProps:o,props:c}=e;ue(c,n,o),delete e.oldProps,e.tag==="input"&&(n.value=String(((t=e==null?void 0:e.props)==null?void 0:t.value)||""))}(e.children||[]).forEach(o=>ne(o)),Ye(e)},Ze=e=>{const t=e.el;t&&(t.nodeValue=String(e.text))},ue=(e,t,n)=>{const o={...n};C(e||{}).forEach(([c,l])=>{c==="key"||(c==="innerHTML"&&typeof l=="string"?t.innerHTML=l:z(c,l)?De(l,z(c,o.style)?o.style:{},t):me(c,l)?l.value=t:c.match(/^on/)?we(t,c,l,o[c]):be(t)&&c==="checked"?t.checked=!!l:xe(t)&&c==="value"?t.value=l:Pe(t)&&c==="selected"?t.selected=!!l:Ne(l)&&(h.value&&c!=="xmlns"?t.setAttributeNS(null,G(c),String(l)):t.setAttribute(G(c),String(l)))),delete o[c]}),K(o).forEach(c=>t.removeAttribute(c))},S=e=>{let t;const{type:n,tag:o,text:c,props:l,children:r=[]}=e,i=b(n);return o==="svg"&&(h.value=String(l==null?void 0:l.xmlns)),i?t=new DocumentFragment:n==="element"&&o?t=h.value?document.createElementNS(h.value,o):document.createElement(o):n==="text"&&y(c)?t=document.createTextNode(String(c)):t=document.createElement("e"),Ke(r,t),ue(l,t),e.el=t,Be(e),o==="svg"&&(h.value=""),t},Ke=(e,t)=>{const n=e.reduce((o,c)=>(c.type&&o.appendChild(S(c)),o),new DocumentFragment);t&&n.hasChildNodes()&&t.appendChild(n)},we=(e,t,n,o)=>{const c=Z(t);o!==n&&(o&&e.removeEventListener(c,o),n&&e.addEventListener(c,n))},De=(e,t,n)=>{const o={...t},c=n==null?void 0:n.style;c&&(C(e).forEach(([l,r])=>{c[l]=r,delete o[l]}),C(o).forEach(([l])=>c[l]=""))},T=e=>{const t=b(e.type);return e.isRoot&&t?e.wrapElement:t?T(p(e)):e.el},U=(e,t)=>We(e,Te[Se(e)](e,t),t),We=(e,t,n)=>{const o=nt(e,t,n),c=[o,t,n],l=tt(...c);return o.children=ot(...c),o.needRerender=l,et(o,n,l),o},et=(e,t,n)=>{n!=="A"&&t&&(e.el=t.el),n&&["D","R","SR"].includes(n)&&(t!=null&&t.compKey&&(q(t),j(t)),e.oldChildren=t==null?void 0:t.children),e.oldProps=t==null?void 0:t.props},tt=(e,t,n)=>{const o=n&&n.type,c=H(e),r=!!e.getParent&&p(e).type,i=v(e),d=r==="loop"&&y(i),f=e.type==="text"&&t&&e.text===(n==null?void 0:n.text);let a;return c?a="D":f?a="N":o?t?a=d?"SU":"U":a=d?"SR":"R":a="A",a},nt=(e,t,n)=>N(e)?t&&n?Ue(n,e):e.resolve():e,ot=(e,t,n)=>t&&n?lt(e,n):ct(e),ct=e=>(e.children||[]).map(t=>{const n=U(t);return n.getParent=()=>e,n}),lt=(e,t)=>e.type==="loop"&&y(v((e.children||[])[0]))?rt(e,t):(e.children||[]).map((n,o)=>{const c=U(n,(t.children||[])[o]);return c.getParent=()=>e,c}),rt=(e,t)=>{const[n,o]=st(e,t);return o.map(c=>{const l=c.el;l!=null&&l.parentNode&&l.parentNode.removeChild(l)}),n},st=(e,t)=>{const n=[...e.children||[]],o=[...t.children||[]];return[n.map(l=>{const r=ut(l,o),i=U(l,r);return r&&o.splice(o.indexOf(r),1),i.getParent=()=>e,i}),o]},ut=(e,t)=>t.find(n=>v(n)===v(e)),ie=(e,t=()=>[])=>{u.get(R()).upR.push(()=>J(e,t)),J(e,t)},it=()=>{var e;const t=(e=u.get(R()))==null?void 0:e.upR;t!=null&&t.length&&t.forEach(n=>n())},F=(e,...t)=>({type:"fragment",children:t}),s=(e,t,...n)=>{const o={value:void 0},c=t||{},l=ve(o,n),r=pt(e,c,l);return N(r)||(o.value=r),r},de=e=>(t,n)=>e,ae=(e,t,n,o)=>{var c;L.value=!0;const l=fe(e,t,n),r=U(l,o),{isRoot:i,getParent:d,wrapElement:f,afterElement:a}=o;if(r.getParent=d,!i&&d){const E=((c=d())==null?void 0:c.children)||[],_=E.indexOf(o);E.splice(_,1,r)}else r.isRoot=!0,r.wrapElement=f,r.afterElement=a;L.value=!1,ne(r)},fe=(e,t,n)=>({tagName:e.name,ctor:e,props:t,children:n,resolve:(r=t)=>{Me(r);const d=e(t,n)(Ae(r),t,n),f=dt(d,r,e,t,n),a=f;return D(r,()=>ae(e,t,n,a)),w(r,"vd").value=f,f}}),dt=(e,t,n,o,c)=>{const l=e(o);return pe(l,t,n,o,c,at(e,t,n,o,c)),l},at=(e,t,n,o,c)=>{const l=()=>ft(e,t,n,o,c,l);return l},ft=(e,t,n,o,c,l)=>{Le(t),it();const r=e(o);return D(t,()=>ae(n,o,c,r)),pe(r,t,n,o,c,l),w(t,"vd").value=r,r},pe=(e,t,n,o,c,l)=>{Fe(e,{compProps:o,compChild:c,ctor:n,tagName:n.name,compKey:t,reRender:l})},pt=(e,t,n)=>{if(X(e))return F(t,...n);if(N(e)){const o=fe(e,t,n);return L.value?o:o.resolve()}return{type:"element",tag:e,props:t,children:n}},ve=(e,t)=>t.map(n=>{const o=vt(n);return o.getParent=()=>e.value,o}),vt=e=>{if(e==null||e===!1)return{type:null};if(Array.isArray(e)){const t={value:void 0},o={type:"loop",children:ve(t,e)};return t.value=o,o}else if(typeof e=="string"||typeof e=="number")return{type:"text",text:e};return e},ht=e=>({value:e}),Q=(e,t)=>{let n=e;return{get value(){return n},get v(){return n},set value(o){n=o,t()},set v(o){n=o,t()}}},yt=e=>{let t=e;return{get value(){return t()},get v(){return t()},set value(n){throw new Error("You can't change 'computed'")},set v(n){throw new Error("You can't change 'computed'")}}},Ct=(e,t=()=>{},n=()=>[])=>{te(()=>(e(),t)),ie(()=>(t&&t(),e),n)},he=new Map,x={},kt=e=>{const t=Symbol();return he.set(t,e),n=>(x[t]!=null||(x[t]=[]),x[t].push(n),gt(t))},gt=e=>new Proxy(he.get(e),{get(t,n){return t[n]},set(t,n,o){t[n]=o;const c=x[e],l=[];return c.forEach(r=>{r()||l.push(r)}),l.forEach(r=>c.splice(c.indexOf(r),1)),!0}}),Rt=de((e,t,n)=>{const o=Q(1,e),c=Q('"destructuring" the "props" value directly from the mount function will cause referencing issues, so if you want to use it, you need to "destructuring" it from the internal function (updater).',e),l=()=>t.parentValue,r=t.parentValue,i=yt(()=>o.v+f+t.parentValue),d=kt({text:"s",count:0})(e);let f=t.parentValue;const a=ht(null),E=()=>{o.v=o.v+1,f+=1},_=O=>{c.v=O.target.value},ye=()=>{d.count+=1,d.text+="1"},Ce=()=>(console.log("MOUNTED",a),()=>console.log("UNMOUNT")),ke=()=>(console.log("UPDATE - parentValue"),()=>console.log("UPDATED"));return te(Ce),ie(ke,()=>[t.parentValue]),Ct(()=>console.log("INJECT"),()=>console.log("CLEAN_UP"),()=>[o.v]),({parentValue:O})=>s(F,null,s("div",null,s("textarea",{value:c.v,onInput:_,style:{width:"300px",height:"100px"}})),s("div",null,c.v),s("div",null,s("div",{style:{color:"blue"}},"parentValueFromRef: ",t.parentValue," (working)"),s("div",{style:{color:"blue"}},"parentValueFromFunction: ",l()," (working)"),s("div",{style:{color:"blue"}},"parentValueFromUpdaterDestructuring: ",O," (working)"),s("div",{style:{color:"red"}},"parentValueFromMounterDestructuring: ",r," (not working)")),s("div",null,s("div",{ref:a},"count: ",o.v),s("div",null,"sum: ",o.v+f+t.parentValue),s("div",null,"sum(computed): ",i.v),s("div",null,"notRefValue: ",f),s("div",null,"localStore(text): ",d.text),s("div",null,"localStore(count): ",d.count)),s("button",{onClick:E},"Increase"),s("button",{onClick:ye},"localStoreUpdate"),n)}),Et=de(e=>{const t=Q(7,e),n=()=>{t.v=t.v+1},o=()=>{t.v=t.v-1};return()=>s(F,null,s(Rt,{parentValue:t.v},s("button",{onClick:n},"Increase - Parent")),s("button",{onClick:o},"Decrease - Parent"))}),mt=s(Et,null);ze(mt,document.getElementById("root"));
|
|
2
|
-
//# sourceMappingURL=index.1e9792b7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.1e9792b7.js","sources":["../../vite/modulepreload-polyfill","../../../dist/lithent.mjs","../../../helper/dist/lithentHelper.mjs","../../src/index.tsx"],"sourcesContent":["__VITE_IS_MODERN__&&(function polyfill() {\n const relList = document.createElement('link').relList;\n if (relList && relList.supports && relList.supports('modulepreload')) {\n return;\n }\n for (const link of document.querySelectorAll('link[rel=\"modulepreload\"]')) {\n processPreload(link);\n }\n new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type !== 'childList') {\n continue;\n }\n for (const node of mutation.addedNodes) {\n if (node.tagName === 'LINK' && node.rel === 'modulepreload')\n processPreload(node);\n }\n }\n }).observe(document, { childList: true, subtree: true });\n function getFetchOpts(script) {\n const fetchOpts = {};\n if (script.integrity)\n fetchOpts.integrity = script.integrity;\n if (script.referrerpolicy)\n fetchOpts.referrerPolicy = script.referrerpolicy;\n if (script.crossorigin === 'use-credentials')\n fetchOpts.credentials = 'include';\n else if (script.crossorigin === 'anonymous')\n fetchOpts.credentials = 'omit';\n else\n fetchOpts.credentials = 'same-origin';\n return fetchOpts;\n }\n function processPreload(link) {\n if (link.ep)\n // ep marker = processed\n return;\n link.ep = true;\n // prepopulate the load record\n const fetchOpts = getFetchOpts(link);\n fetch(link.href, fetchOpts);\n }\n}());","const checkPlainWDomType = (wDom) => typeof wDom === \"object\" && !(\"resolve\" in wDom);\nconst checkPlainType = (wDom, typeName) => checkPlainWDomType(wDom) && wDom.type === typeName;\nconst checkSameCustomComponent = (newWDom, originalWDom) => \"ctor\" in newWDom ? newWDom.ctor === (originalWDom == null ? void 0 : originalWDom.ctor) : newWDom === (originalWDom == null ? void 0 : originalWDom.ctor);\nconst checkSameFragment = (newWDom, originalWDom) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === \"fragment\" && ((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length);\n};\nconst checkSameTagElement = (newWDom, originalWDom) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === \"element\" && (originalWDom == null ? void 0 : originalWDom.tag) === newWDom.tag && ((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length);\n};\nconst checkNormalTypeElement = (newWDom, originalWDom) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === newWDom.type && (((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length) || newWDom.type === \"loop\" && checkExisty(getKey((newWDom.children || [])[0])) && checkExisty(getKey((originalWDom.children || [])[0])));\n};\nconst getKey = (target) => {\n var _a, _b, _c;\n return (_c = (_a = target == null ? void 0 : target.compProps) == null ? void 0 : _a.key) != null ? _c : (_b = target == null ? void 0 : target.props) == null ? void 0 : _b.key;\n};\nconst checkVirtualType = (type) => type && [\"fragment\", \"loop\"].includes(type);\nconst checkCustemComponentFunction = (target) => typeof target === \"function\" && !checkFragmentFunction(target) || typeof target === \"object\" && \"resolve\" in target;\nconst checkFragmentFunction = (target) => typeof target === \"function\" && target === Fragment;\nconst checkEmptyElement = (wDom) => checkPlainWDomType(wDom) && !wDom.type;\nconst checkExisty = (value) => value !== null && value !== void 0;\nconst checkStyleData = (dataKey, dataValue) => dataKey === \"style\" && typeof dataValue === \"object\";\nconst checkRefData = (dataKey, dataValue) => dataKey === \"ref\" && typeof dataValue === \"object\";\nconst checkOptionElement = (element) => element.nodeType === 1 && element.tagName === \"OPTION\";\nconst checkTextareaElement = (element) => element.nodeType === 1 && element.tagName === \"TEXTAREA\";\nconst checkCheckableElement = (element) => element.nodeType === 1 && [\"radio\", \"checkbox\"].includes(element.type);\nconst checkNormalAttribute = (dataValue) => typeof dataValue === \"number\" || typeof dataValue === \"string\";\nconst getWDomType = (wDom) => {\n let result = \"et\";\n if (checkCustemComponentFunction(wDom)) {\n result = \"c\";\n } else if (checkPlainType(wDom, \"fragment\")) {\n result = \"f\";\n } else if (checkPlainType(wDom, \"element\")) {\n result = \"e\";\n } else if (checkPlainType(wDom, \"loop\")) {\n result = \"l\";\n } else if (checkPlainType(wDom, \"text\")) {\n result = \"t\";\n } else if (checkEmptyElement(wDom)) {\n result = \"et\";\n }\n return result;\n};\nconst checkSameWDomWithOriginal = {\n c: checkSameCustomComponent,\n l: checkNormalTypeElement,\n t: checkNormalTypeElement,\n e: checkSameTagElement,\n f: checkSameFragment,\n et: checkNormalTypeElement\n};\nconst getParent = (vDom) => {\n const parentVDom = vDom.getParent && vDom.getParent();\n return parentVDom;\n};\nconst reRender = (vDom, infoVdom) => {\n const { compProps: props, compChild: children } = vDom;\n const { props: infoProps, children: infoChidren } = infoVdom;\n if (props) {\n updateProps$1(props, infoProps);\n }\n if (children) {\n updateChildren(children, infoChidren);\n }\n const newVDom = vDom.reRender && vDom.reRender();\n return newVDom;\n};\nconst getEventName = (eventKey) => eventKey.replace(/^on(.*)/, (_match, p1) => p1.toLowerCase());\nconst getAttrKey = (keyName) => keyName === \"className\" ? \"class\" : keyName;\nconst entries = Object.entries;\nconst keys = Object.keys;\nconst assign = Object.assign;\nconst updateProps$1 = (props, infoProps) => {\n if (props && infoProps !== props) {\n keys(props).forEach((key) => delete props[key]);\n entries(infoProps || {}).forEach(([key, value]) => props[key] = value);\n }\n};\nconst updateChildren = (children, infoChidren) => {\n if (children && infoChidren !== children) {\n children.splice(0, children.length);\n if (infoChidren) {\n infoChidren.forEach((childrenItem) => children.push(childrenItem));\n }\n }\n};\nlet redrawQueue = [];\nlet redrawQueueTimeout = false;\nconst xmlnsRef = { value: \"\" };\nconst compKeyRef = { value: {} };\nconst needDiffRef = { value: false };\nconst componentRef = /* @__PURE__ */ new WeakMap();\nconst componentRender = (compKey) => () => {\n var _a;\n const up = (_a = componentRef.get(compKey)) == null ? void 0 : _a.up;\n let result = false;\n if (up) {\n up();\n result = true;\n }\n return result;\n};\nconst setComponetRef = (compKey) => {\n componentRef.set(compKey, {\n vd: { value: null },\n up: () => {\n },\n upR: [],\n upS: { value: 0 },\n upD: [],\n upCB: [],\n mts: [],\n umts: []\n });\n};\nconst getComponentKey = () => compKeyRef.value;\nconst getComponentSubInfo = (compKey, subKey) => componentRef.get(compKey)[subKey];\nconst setRedrawAction = (compKey, exec) => {\n componentRef.get(compKey).up = () => {\n redrawQueue.push({\n compKey,\n exec\n });\n if (!redrawQueueTimeout) {\n redrawQueueTimeout = true;\n queueMicrotask(execRedrawQueue);\n }\n };\n};\nconst initUpdateHookState = (compKey) => compKeyRef.value = compKey;\nconst initMountHookState = (compKey) => {\n compKeyRef.value = compKey;\n setComponetRef(compKey);\n};\nconst recursiveGetChildKeys = (wDom, result) => {\n (wDom.children || []).forEach((item) => {\n const childComKey = item.compKey;\n if (childComKey) {\n result.push(childComKey);\n }\n recursiveGetChildKeys(item, result);\n });\n};\nconst execRedrawQueue = () => {\n let childItemList = [];\n redrawQueue.forEach((item) => {\n var _a, _b;\n const childVd = (_b = (_a = componentRef.get(item.compKey)) == null ? void 0 : _a.vd) == null ? void 0 : _b.value;\n if (childVd) {\n recursiveGetChildKeys(childVd, childItemList);\n }\n });\n const addedKey = [];\n const result = redrawQueue.reduce((acc, item) => {\n const { compKey } = item;\n if (childItemList.includes(compKey) || addedKey.includes(compKey)) {\n return acc;\n }\n addedKey.push(compKey);\n acc.push(item);\n return acc;\n }, []);\n while (result.length) {\n const action = result.shift();\n if (action) {\n action.exec();\n }\n }\n redrawQueue = [];\n redrawQueueTimeout = false;\n};\nconst unmount = (effectAction) => {\n componentRef.get(getComponentKey()).umts.push(effectAction);\n};\nconst runUnmountQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n removeItem(compKey);\n }\n recursiveRunUnmount(newWDom);\n};\nconst recursiveRunUnmount = (wDom) => {\n (wDom.children || []).forEach((item) => {\n const childComKey = item.compKey;\n if (childComKey) {\n runUnmountQueueFromWDom(item);\n } else {\n recursiveRunUnmount(item);\n }\n });\n};\nconst removeItem = (compKey) => {\n const subInfo = componentRef.get(compKey);\n if (subInfo) {\n subInfo.umts.forEach((effect) => effect());\n subInfo.umts = [];\n componentRef.delete(compKey);\n }\n};\nlet mountedQueue = [];\nconst execMountedQueue = () => {\n mountedQueue.forEach((item) => runMountedQueueFromWDom(item));\n mountedQueue = [];\n};\nconst addMountedQueue = (wDom) => {\n if (wDom.compKey) {\n mountedQueue.push(wDom);\n }\n};\nconst mountCallback = (effectAction) => componentRef.get(getComponentKey()).mts.push(effectAction);\nconst runMountedQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component == null ? void 0 : component.mts;\n const sequence = component == null ? void 0 : component.upS;\n compKeyRef.value = compKey;\n if (sequence) {\n sequence.value = 0;\n }\n if (queue) {\n component.mts = [];\n queue.forEach((effect) => {\n const callback = effect();\n if (callback) {\n unmount(callback);\n }\n });\n }\n }\n};\nconst useUpdated = (effectAction, dependencies = () => []) => {\n const component = componentRef.get(getComponentKey());\n const { upD, upS } = component;\n const def = upD[upS.value];\n if (def && checkNeedPushQueue(def, dependencies())) {\n const callback = effectAction();\n if (callback) {\n component.upCB.push(callback);\n }\n }\n upD[upS.value] = dependencies();\n upS.value += 1;\n};\nconst runUpdatedQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component == null ? void 0 : component.upCB;\n const sequence = component == null ? void 0 : component.upS;\n compKeyRef.value = compKey;\n if (sequence) {\n sequence.value = 0;\n }\n if (newWDom.ctor && queue) {\n component.upCB = [];\n queue.forEach((effect) => effect());\n }\n }\n};\nconst checkNeedPushQueue = (originalDefs, newDefs) => !originalDefs.length && !originalDefs.length ? true : originalDefs.some((def, index) => def !== newDefs[index]);\nconst render = (wDom, wrapElement, afterElement) => {\n wrapElement != null ? wrapElement : wrapElement = document.body;\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n const Dom = wDomToDom(wDom);\n if (afterElement) {\n wDom.afterElement = afterElement;\n wrapElement.insertBefore(Dom, afterElement);\n } else {\n wrapElement.appendChild(Dom);\n }\n execMountedQueue();\n return () => {\n var _a;\n const component = (_a = componentRef.get(wDom.compProps || {})) == null ? void 0 : _a.vd.value;\n if (component) {\n runUnmountQueueFromWDom(component);\n recursiveRemoveEvent(component);\n rootDelete(component);\n }\n };\n};\nconst wDomUpdate = (newWDomTree) => {\n const { needRerender } = newWDomTree;\n if (needRerender && needRerender !== \"N\") {\n ({\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate\n })[needRerender](newWDomTree);\n }\n};\nconst recursiveRemoveEvent = (originalWDom) => {\n if (originalWDom.props && originalWDom.el) {\n removeEvent(originalWDom.props, originalWDom.el);\n }\n (originalWDom.children || []).forEach((childItem) => {\n recursiveRemoveEvent(childItem);\n });\n};\nconst rootDelete = (newWDom) => {\n deleteRealDom(newWDom, newWDom.wrapElement);\n};\nconst typeDelete = (newWDom) => {\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n deleteRealDom(\n newWDom,\n findRealParentElement(getParent(newWDom))\n );\n};\nconst deleteRealDom = (newWDom, parent) => {\n var _a, _b;\n if (parent && newWDom.el) {\n if (((_a = newWDom.el) == null ? void 0 : _a.nodeType) === 1) {\n parent.removeChild(newWDom.el);\n } else if (((_b = newWDom.el) == null ? void 0 : _b.nodeType) === 11) {\n findChildWithRemoveElement(newWDom, parent);\n }\n delete newWDom.el;\n }\n};\nconst findChildWithRemoveElement = (newWDom, parent) => {\n ((newWDom == null ? void 0 : newWDom.oldChildren) || (newWDom == null ? void 0 : newWDom.children) || []).forEach((item) => {\n var _a, _b;\n if (((_a = item.el) == null ? void 0 : _a.nodeType) === 1) {\n parent.removeChild(item == null ? void 0 : item.el);\n } else if (((_b = item.el) == null ? void 0 : _b.nodeType) === 11) {\n findChildWithRemoveElement(item, parent);\n }\n });\n};\nconst typeSortedReplace = (newWDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom);\n};\nconst typeSortedUpdate = (newWDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom, newWDom.el);\n};\nconst typeAdd = (newWDom, newElement) => {\n if (!newElement) {\n newElement = wDomToDom(newWDom);\n }\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const isLoop = parentWDom.type === \"loop\";\n const nextEl = isLoop ? startFindNextBrotherElement(parentWDom, getParent(parentWDom)) : startFindNextBrotherElement(newWDom, parentWDom);\n if (newElement && parentEl) {\n if (nextEl) {\n parentEl.insertBefore(newElement, nextEl);\n } else {\n parentEl.appendChild(newElement);\n }\n execMountedQueue();\n }\n }\n};\nconst startFindNextBrotherElement = (wDom, parentWDom) => {\n const brothers = parentWDom.children || [];\n const index = brothers.indexOf(wDom);\n const nextIndex = index + 1;\n const candidiateBrothers = brothers.slice(nextIndex);\n const finedNextEl = findChildFragmentNextElement(candidiateBrothers);\n const parentType = parentWDom.type || \"\";\n if (finedNextEl) {\n return finedNextEl;\n }\n if (!parentWDom.isRoot && checkVirtualType(parentType)) {\n return startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else if (parentWDom.isRoot && parentWDom.afterElement) {\n return parentWDom.afterElement;\n }\n return void 0;\n};\nconst findChildFragmentNextElement = (candidiateBrothers) => candidiateBrothers.reduce(\n (targetEl, bItem) => {\n const type = bItem.type;\n const el = bItem.el;\n const isFragment = type && checkVirtualType(type);\n if (targetEl) {\n return targetEl;\n } else if (isFragment) {\n return findChildFragmentNextElement(bItem.children || []);\n } else if (el && el.nodeType !== 11) {\n return el;\n }\n return targetEl;\n },\n void 0\n);\nconst typeReplace = (newWDom) => {\n const parentWDom = getParent(newWDom);\n const orignalElement = newWDom.el;\n if (parentWDom.type && orignalElement) {\n if (orignalElement.nodeType === 11) {\n typeSortedReplace(newWDom);\n } else {\n const parentElement = findRealParentElement(parentWDom);\n const newElement = wDomToDom(newWDom);\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n execMountedQueue();\n }\n }\n};\nconst removeEvent = (oldProps, element) => {\n entries(oldProps || {}).forEach(([dataKey, dataValue]) => {\n if (dataKey.match(/^on/)) {\n element.removeEventListener(\n getEventName(dataKey),\n dataValue\n );\n }\n });\n};\nconst typeUpdate = (newWDom) => {\n var _a;\n const element = newWDom.el;\n if (newWDom.type === \"text\") {\n updateText(newWDom);\n return;\n }\n if (element) {\n const { oldProps, props } = newWDom;\n updateProps(props, element, oldProps);\n delete newWDom.oldProps;\n if (newWDom.tag === \"input\") {\n element.value = String(((_a = newWDom == null ? void 0 : newWDom.props) == null ? void 0 : _a.value) || \"\");\n }\n }\n (newWDom.children || []).forEach((childItem) => wDomUpdate(childItem));\n runUpdatedQueueFromWDom(newWDom);\n};\nconst updateText = (newWDom) => {\n const element = newWDom.el;\n if (element) {\n element.nodeValue = String(newWDom.text);\n }\n};\nconst updateProps = (props, element, oldProps) => {\n const originalProps = { ...oldProps };\n entries(props || {}).forEach(([dataKey, dataValue]) => {\n if (dataKey === \"key\")\n ;\n else if (dataKey === \"innerHTML\" && typeof dataValue === \"string\") {\n element.innerHTML = dataValue;\n } else if (checkStyleData(dataKey, dataValue)) {\n updateStyle(\n dataValue,\n checkStyleData(dataKey, originalProps.style) ? originalProps.style : {},\n element\n );\n } else if (checkRefData(dataKey, dataValue)) {\n dataValue.value = element;\n } else if (dataKey.match(/^on/)) {\n updateEvent(\n element,\n dataKey,\n dataValue,\n originalProps[dataKey]\n );\n } else if (checkCheckableElement(element) && dataKey === \"checked\") {\n element.checked = !!dataValue;\n } else if (checkTextareaElement(element) && dataKey === \"value\") {\n element.value = dataValue;\n } else if (checkOptionElement(element) && dataKey === \"selected\") {\n element.selected = !!dataValue;\n } else if (checkNormalAttribute(dataValue)) {\n if (xmlnsRef.value && dataKey !== \"xmlns\") {\n element.setAttributeNS(\n null,\n getAttrKey(dataKey),\n String(dataValue)\n );\n } else {\n element.setAttribute(\n getAttrKey(dataKey),\n String(dataValue)\n );\n }\n }\n delete originalProps[dataKey];\n });\n keys(originalProps).forEach(\n (dataKey) => element.removeAttribute(dataKey)\n );\n};\nconst wDomToDom = (wDom) => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = checkVirtualType(type);\n if (tag === \"svg\") {\n xmlnsRef.value = String(props == null ? void 0 : props.xmlns);\n }\n if (isVirtualType) {\n element = new DocumentFragment();\n } else if (type === \"element\" && tag) {\n element = xmlnsRef.value ? document.createElementNS(xmlnsRef.value, tag) : document.createElement(tag);\n } else if (type === \"text\" && checkExisty(text)) {\n element = document.createTextNode(String(text));\n } else {\n element = document.createElement(\"e\");\n }\n wDomChildrenToDom(children, element);\n updateProps(props, element);\n wDom.el = element;\n addMountedQueue(wDom);\n if (tag === \"svg\") {\n xmlnsRef.value = \"\";\n }\n return element;\n};\nconst wDomChildrenToDom = (children, parentElement) => {\n const elementChildren = children.reduce(\n (acc, childItem) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem));\n }\n return acc;\n },\n new DocumentFragment()\n );\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\n }\n};\nconst updateEvent = (element, eventKey, newEventHandler, oldEventHandler) => {\n const eventName = getEventName(eventKey);\n if (oldEventHandler !== newEventHandler) {\n if (oldEventHandler) {\n element.removeEventListener(eventName, oldEventHandler);\n }\n if (newEventHandler) {\n element.addEventListener(eventName, newEventHandler);\n }\n }\n};\nconst updateStyle = (style, oldStyle, element) => {\n const originalStyle = { ...oldStyle };\n const elementStyle = element == null ? void 0 : element.style;\n if (elementStyle) {\n entries(style).forEach(([styleKey, dataValue]) => {\n elementStyle[styleKey] = dataValue;\n delete originalStyle[styleKey];\n });\n entries(originalStyle).forEach(\n ([styleKey]) => elementStyle[styleKey] = \"\"\n );\n }\n};\nconst findRealParentElement = (vDom) => {\n const isVirtualType = checkVirtualType(vDom.type);\n if (vDom.isRoot && isVirtualType) {\n return vDom.wrapElement;\n }\n if (!isVirtualType) {\n return vDom.el;\n }\n return findRealParentElement(getParent(vDom));\n};\nconst makeNewWDomTree = (newWDom, originalWDom) => remakeNewWDom(\n newWDom,\n checkSameWDomWithOriginal[getWDomType(newWDom)](newWDom, originalWDom),\n originalWDom\n);\nconst remakeNewWDom = (newWDom, isSameType, originalWDom) => {\n const remakeWDom = generalize(newWDom, isSameType, originalWDom);\n const param = [\n remakeWDom,\n isSameType,\n originalWDom\n ];\n const needRerender = addReRenderTypeProperty(...param);\n remakeWDom.children = remakeChildrenForDiff(...param);\n remakeWDom.needRerender = needRerender;\n inheritPropForRender(remakeWDom, originalWDom, needRerender);\n return remakeWDom;\n};\nconst inheritPropForRender = (remakeWDom, originalWDom, needRerender) => {\n if (needRerender !== \"A\" && originalWDom) {\n remakeWDom.el = originalWDom.el;\n }\n if (needRerender && [\"D\", \"R\", \"SR\"].includes(needRerender)) {\n if (originalWDom == null ? void 0 : originalWDom.compKey) {\n runUnmountQueueFromWDom(originalWDom);\n recursiveRemoveEvent(originalWDom);\n }\n remakeWDom.oldChildren = originalWDom == null ? void 0 : originalWDom.children;\n }\n remakeWDom.oldProps = originalWDom == null ? void 0 : originalWDom.props;\n};\nconst addReRenderTypeProperty = (newWDom, isSameType, originalWDom) => {\n const existOriginalWDom = originalWDom && originalWDom.type;\n const isEmptyElement = checkEmptyElement(newWDom);\n const isRoot = !newWDom.getParent;\n const parentType = !isRoot && getParent(newWDom).type;\n const key = getKey(newWDom);\n const isKeyCheckedWDom = parentType === \"loop\" && checkExisty(key);\n const isSameText = newWDom.type === \"text\" && isSameType && newWDom.text === (originalWDom == null ? void 0 : originalWDom.text);\n let result;\n if (isEmptyElement) {\n result = \"D\";\n } else if (isSameText) {\n result = \"N\";\n } else if (!existOriginalWDom) {\n result = \"A\";\n } else if (isSameType) {\n result = isKeyCheckedWDom ? \"SU\" : \"U\";\n } else {\n result = isKeyCheckedWDom ? \"SR\" : \"R\";\n }\n return result;\n};\nconst generalize = (newWDom, isSameType, originalWDom) => {\n if (checkCustemComponentFunction(newWDom)) {\n return isSameType && originalWDom ? reRender(originalWDom, newWDom) : newWDom.resolve();\n }\n return newWDom;\n};\nconst remakeChildrenForDiff = (newWDom, isSameType, originalWDom) => isSameType && originalWDom ? remakeChildrenForUpdate(newWDom, originalWDom) : remakeChildrenForAdd(newWDom);\nconst remakeChildrenForAdd = (newWDom) => (newWDom.children || []).map((item) => {\n const childItem = makeNewWDomTree(item);\n childItem.getParent = () => newWDom;\n return childItem;\n});\nconst remakeChildrenForUpdate = (newWDom, originalWDom) => {\n if (newWDom.type === \"loop\" && checkExisty(getKey((newWDom.children || [])[0]))) {\n return remakeChildrenForLoopUpdate(newWDom, originalWDom);\n }\n return (newWDom.children || []).map((item, index) => {\n const childItem = makeNewWDomTree(\n item,\n (originalWDom.children || [])[index]\n );\n childItem.getParent = () => newWDom;\n return childItem;\n });\n};\nconst remakeChildrenForLoopUpdate = (newWDom, originalWDom) => {\n const [remakedChildren, unUsedChildren] = diffLoopChildren(\n newWDom,\n originalWDom\n );\n unUsedChildren.map((unusedItem) => {\n const el = unusedItem.el;\n if (el == null ? void 0 : el.parentNode) {\n el.parentNode.removeChild(el);\n }\n });\n return remakedChildren;\n};\nconst diffLoopChildren = (newWDom, originalWDom) => {\n const newChildren = [...newWDom.children || []];\n const originalChildren = [...originalWDom.children || []];\n const remakedChildren = newChildren.map((item) => {\n const originalItem = findSameKeyOriginalItem(item, originalChildren);\n const childItem = makeNewWDomTree(item, originalItem);\n if (originalItem) {\n originalChildren.splice(originalChildren.indexOf(originalItem), 1);\n }\n childItem.getParent = () => newWDom;\n return childItem;\n });\n return [remakedChildren, originalChildren];\n};\nconst findSameKeyOriginalItem = (item, originalChildren) => originalChildren.find(\n (orignalChildItem) => getKey(orignalChildItem) === getKey(item)\n);\nconst updateCallback = (effectAction, dependencies = () => []) => {\n const updateReqs = componentRef.get(getComponentKey()).upR;\n updateReqs.push(() => useUpdated(effectAction, dependencies));\n useUpdated(effectAction, dependencies);\n};\nconst runUpdateCallback = () => {\n var _a;\n const updateReqs = (_a = componentRef.get(getComponentKey())) == null ? void 0 : _a.upR;\n if (updateReqs == null ? void 0 : updateReqs.length) {\n updateReqs.forEach((callback) => callback());\n }\n};\nconst Fragment = (_props, ...children) => ({\n type: \"fragment\",\n children\n});\nconst h = (tag, props, ...children) => {\n const nodeParentPointer = { value: void 0 };\n const newProps = props || {};\n const newChildren = remakeChildren(nodeParentPointer, children);\n const node = makeNode(tag, newProps, newChildren);\n if (!checkCustemComponentFunction(node)) {\n nodeParentPointer.value = node;\n }\n return node;\n};\nconst mount = (component) => (_props, _children) => component;\nconst reRenderCustomComponent = (tag, props, children, originalWDom) => {\n var _a;\n needDiffRef.value = true;\n const newWDom = makeWDomResolver(tag, props, children);\n const newWDomTree = makeNewWDomTree(newWDom, originalWDom);\n const { isRoot, getParent: getParent2, wrapElement, afterElement } = originalWDom;\n newWDomTree.getParent = getParent2;\n if (!isRoot && getParent2) {\n const brothers = ((_a = getParent2()) == null ? void 0 : _a.children) || [];\n const index = brothers.indexOf(originalWDom);\n brothers.splice(index, 1, newWDomTree);\n } else {\n newWDomTree.isRoot = true;\n newWDomTree.wrapElement = wrapElement;\n newWDomTree.afterElement = afterElement;\n }\n needDiffRef.value = false;\n wDomUpdate(newWDomTree);\n};\nconst makeWDomResolver = (tag, props, children) => {\n const tagName = tag.name;\n const ctor = tag;\n const resolve = (compKey = props) => {\n initMountHookState(compKey);\n const component = tag(props, children);\n const componentMaker = component(componentRender(compKey), props, children);\n const customNode = makeCustomNode(\n componentMaker,\n compKey,\n tag,\n props,\n children\n );\n const originalWDom = customNode;\n setRedrawAction(\n compKey,\n () => reRenderCustomComponent(tag, props, children, originalWDom)\n );\n getComponentSubInfo(compKey, \"vd\").value = customNode;\n return customNode;\n };\n return { tagName, ctor, props, children, resolve };\n};\nconst makeCustomNode = (componentMaker, compKey, tag, props, children) => {\n const customNode = componentMaker(props);\n addComponentProps(\n customNode,\n compKey,\n tag,\n props,\n children,\n makeReRender(componentMaker, compKey, tag, props, children)\n );\n return customNode;\n};\nconst makeReRender = (componentMaker, compKey, tag, props, children) => {\n const reRender2 = () => wDomMaker(componentMaker, compKey, tag, props, children, reRender2);\n return reRender2;\n};\nconst wDomMaker = (componentMaker, compKey, tag, props, children, reRender2) => {\n initUpdateHookState(compKey);\n runUpdateCallback();\n const originalWDom = componentMaker(props);\n setRedrawAction(\n compKey,\n () => reRenderCustomComponent(tag, props, children, originalWDom)\n );\n addComponentProps(originalWDom, compKey, tag, props, children, reRender2);\n getComponentSubInfo(compKey, \"vd\").value = originalWDom;\n return originalWDom;\n};\nconst addComponentProps = (wDom, compKey, tag, props, children, reRender2) => {\n assign(wDom, {\n compProps: props,\n compChild: children,\n ctor: tag,\n tagName: tag.name,\n compKey,\n reRender: reRender2\n });\n};\nconst makeNode = (tag, props, children) => {\n if (checkFragmentFunction(tag)) {\n return Fragment(props, ...children);\n } else if (checkCustemComponentFunction(tag)) {\n const componetMakeResolver = makeWDomResolver(tag, props, children);\n return needDiffRef.value ? componetMakeResolver : componetMakeResolver.resolve();\n }\n return {\n type: \"element\",\n tag,\n props,\n children\n };\n};\nconst remakeChildren = (nodeParentPointer, children) => children.map((item) => {\n const childItem = makeChildrenItem(item);\n childItem.getParent = () => nodeParentPointer.value;\n return childItem;\n});\nconst makeChildrenItem = (item) => {\n if (item === null || item === void 0 || item === false) {\n return { type: null };\n } else if (Array.isArray(item)) {\n const nodeParentPointer = { value: void 0 };\n const children = remakeChildren(nodeParentPointer, item);\n const node = {\n type: \"loop\",\n children\n };\n nodeParentPointer.value = node;\n return node;\n } else if (typeof item === \"string\" || typeof item === \"number\") {\n return { type: \"text\", text: item };\n }\n return item;\n};\nconst ref = (initValue) => ({ value: initValue });\nconst nextTick = () => Promise.resolve();\nexport {\n Fragment,\n h,\n mount,\n mountCallback,\n nextTick,\n ref,\n render,\n updateCallback\n};\n//# sourceMappingURL=lithent.mjs.map\n","import { mountCallback as a, updateCallback as p } from \"lithent\";\nconst v = (r, t) => {\n let e = r;\n return {\n get value() {\n return e;\n },\n get v() {\n return e;\n },\n set value(n) {\n e = n, t();\n },\n set v(n) {\n e = n, t();\n }\n };\n}, f = (r) => {\n let t = r;\n return {\n get value() {\n return t();\n },\n get v() {\n return t();\n },\n set value(e) {\n throw new Error(\"You can't change 'computed'\");\n },\n set v(e) {\n throw new Error(\"You can't change 'computed'\");\n }\n };\n}, m = (r, t = () => {\n}, e = () => []) => {\n a(() => (r(), t)), p(() => (t && t(), r), e);\n}, l = /* @__PURE__ */ new Map(), u = {}, i = (r) => {\n const t = Symbol();\n return l.set(t, r), (e) => {\n var n;\n return (n = u[t]) != null || (u[t] = []), u[t].push(e), h(t);\n };\n}, h = (r) => new Proxy(l.get(r), {\n get(t, e) {\n return t[e];\n },\n set(t, e, n) {\n t[e] = n;\n const s = u[r], c = [];\n return s.forEach((o) => {\n o() || c.push(o);\n }), c.forEach(\n (o) => s.splice(s.indexOf(o), 1)\n ), !0;\n }\n});\nexport {\n f as computed,\n m as effect,\n v as state,\n i as store\n};\n//# sourceMappingURL=lithentHelper.mjs.map\n","// example.jsx\nimport {\n h,\n Fragment,\n render,\n ref,\n mountCallback,\n updateCallback,\n mount,\n} from 'lithent';\nimport { state, computed, effect, store } from 'lithent/helper';\n\n// This is the \"mount\" function.\n// This function is only executed on mount, and on update, only updates `props` and then executes the internal return function.\n// childen is passed as the second argument.\nconst ChildComponent = mount<{ parentValue: number }>(\n (renew, props, children) => {\n // The value is used as a \"getter\" to make it easy to get and write to in the higher-order functions it returns\n const count = state<number>(1, renew);\n const text = state<string>(\n '\"destructuring\" the \"props\" value directly from the mount function will cause referencing issues, so if you want to use it, you need to \"destructuring\" it from the internal function (updater).',\n renew\n );\n const getParentValue = () => props.parentValue;\n const parentValueFromMount = props.parentValue;\n const summ = computed<number>(\n () => count.v + notRefValue + props.parentValue\n );\n\n const localStore = store<{ text: string; count: number }>({\n text: 's',\n count: 0,\n })(renew);\n /*\n // To share a store, make it externally and use `asign`.\n const asignStore = store<{ text: string; count: number }>({ text: 's', count: 0 });\n\n const sharedStore = asignStore(nenew);\n */\n\n // Even if you don't use a ref, the private value is always maintained as a regular variable.\n let notRefValue = props.parentValue;\n\n // Ref is only used to reference the DOM.\n const domRef = ref(null);\n\n const increase = () => {\n count.v = count.v + 1;\n notRefValue += 1;\n };\n\n const handleInputChane = (event: InputEvent) => {\n text.v = (event.target as HTMLInputElement).value;\n };\n\n const localStoreUpdate = () => {\n localStore.count += 1;\n localStore.text += '1';\n };\n\n const handleMounted = () => {\n console.log('MOUNTED', domRef);\n\n return () => console.log('UNMOUNT');\n };\n const handleUpdated = () => {\n console.log('UPDATE - parentValue');\n\n return () => console.log('UPDATED');\n };\n\n mountCallback(handleMounted);\n updateCallback(handleUpdated, () => [props.parentValue]); // Only Defs Updated (using a closure to update a value)\n\n // Behaves like `react`'s `useEffect`\n effect(\n () => console.log('INJECT'),\n () => console.log('CLEAN_UP'),\n () => [count.v]\n );\n\n // Wrap in a function and return (using a closure to hold the value)\n // This is the \"update\" function.\n return ({ parentValue }) => (\n <Fragment>\n {/* Note that the event is onInput (we use the native event name to avoid confusion). */}\n <div>\n <textarea\n value={text.v}\n onInput={handleInputChane}\n style={{ width: '300px', height: '100px' }}\n />\n </div>\n <div>{text.v}</div>\n <div>\n <div style={{ color: 'blue' }}>\n parentValueFromRef: {props.parentValue} (working)\n </div>\n <div style={{ color: 'blue' }}>\n parentValueFromFunction: {getParentValue()} (working)\n </div>\n <div style={{ color: 'blue' }}>\n parentValueFromUpdaterDestructuring: {parentValue} (working)\n </div>\n <div style={{ color: 'red' }}>\n parentValueFromMounterDestructuring: {parentValueFromMount} (not\n working)\n </div>\n </div>\n <div>\n <div ref={domRef}>count: {count.v}</div>\n <div>sum: {count.v + notRefValue + props.parentValue}</div>\n <div>sum(computed): {summ.v}</div>\n {/* It doesn't pull it out from under the reference, it uses the value directly, so you can just use it. */}\n <div>notRefValue: {notRefValue}</div>\n <div>localStore(text): {localStore.text}</div>\n <div>localStore(count): {localStore.count}</div>\n </div>\n <button onClick={increase}>Increase</button>\n <button onClick={localStoreUpdate}>localStoreUpdate</button>\n {children}\n </Fragment>\n );\n }\n);\n\nconst Root = mount(renew => {\n const parentNumber = state<number>(7, renew);\n\n const increaseParent = () => {\n parentNumber.v = parentNumber.v + 1;\n };\n\n const decreaseParent = () => {\n parentNumber.v = parentNumber.v - 1;\n };\n\n return () => (\n <Fragment>\n <ChildComponent parentValue={parentNumber.v}>\n <button onClick={increaseParent}>Increase - Parent</button>\n </ChildComponent>\n <button onClick={decreaseParent}>Decrease - Parent</button>\n </Fragment>\n );\n});\nconst root = <Root />;\n\nrender(root, document.getElementById('root'));\n"],"names":["relList","link","processPreload","mutations","mutation","node","getFetchOpts","script","fetchOpts","checkPlainWDomType","wDom","checkPlainType","typeName","checkSameCustomComponent","newWDom","originalWDom","checkSameFragment","_a","_b","checkSameTagElement","checkNormalTypeElement","checkExisty","getKey","target","_c","checkVirtualType","type","checkCustemComponentFunction","checkFragmentFunction","Fragment","checkEmptyElement","value","checkStyleData","dataKey","dataValue","checkRefData","checkOptionElement","element","checkTextareaElement","checkCheckableElement","checkNormalAttribute","getWDomType","result","checkSameWDomWithOriginal","getParent","vDom","reRender","infoVdom","props","children","infoProps","infoChidren","updateProps$1","updateChildren","getEventName","eventKey","_match","p1","getAttrKey","keyName","entries","keys","assign","key","childrenItem","redrawQueue","redrawQueueTimeout","xmlnsRef","compKeyRef","needDiffRef","componentRef","componentRender","compKey","up","setComponetRef","getComponentKey","getComponentSubInfo","subKey","setRedrawAction","exec","execRedrawQueue","initUpdateHookState","initMountHookState","recursiveGetChildKeys","item","childComKey","childItemList","childVd","addedKey","acc","action","unmount","effectAction","runUnmountQueueFromWDom","removeItem","recursiveRunUnmount","subInfo","effect","mountedQueue","execMountedQueue","runMountedQueueFromWDom","addMountedQueue","mountCallback","component","queue","sequence","callback","useUpdated","dependencies","upD","upS","def","checkNeedPushQueue","runUpdatedQueueFromWDom","originalDefs","newDefs","index","render","wrapElement","afterElement","Dom","wDomToDom","recursiveRemoveEvent","rootDelete","wDomUpdate","newWDomTree","needRerender","typeAdd","typeDelete","typeReplace","typeUpdate","typeSortedReplace","typeSortedUpdate","removeEvent","childItem","deleteRealDom","findRealParentElement","parent","findChildWithRemoveElement","newElement","parentWDom","parentEl","nextEl","startFindNextBrotherElement","brothers","nextIndex","candidiateBrothers","finedNextEl","findChildFragmentNextElement","parentType","targetEl","bItem","el","isFragment","orignalElement","parentElement","oldProps","updateText","updateProps","originalProps","updateStyle","updateEvent","tag","text","isVirtualType","wDomChildrenToDom","elementChildren","newEventHandler","oldEventHandler","eventName","style","oldStyle","originalStyle","elementStyle","styleKey","makeNewWDomTree","remakeNewWDom","isSameType","remakeWDom","generalize","param","addReRenderTypeProperty","remakeChildrenForDiff","inheritPropForRender","existOriginalWDom","isEmptyElement","isKeyCheckedWDom","isSameText","remakeChildrenForUpdate","remakeChildrenForAdd","remakeChildrenForLoopUpdate","remakedChildren","unUsedChildren","diffLoopChildren","unusedItem","newChildren","originalChildren","originalItem","findSameKeyOriginalItem","orignalChildItem","updateCallback","runUpdateCallback","updateReqs","_props","h","nodeParentPointer","newProps","remakeChildren","makeNode","mount","_children","reRenderCustomComponent","makeWDomResolver","isRoot","getParent2","componentMaker","customNode","makeCustomNode","addComponentProps","makeReRender","reRender2","wDomMaker","componetMakeResolver","makeChildrenItem","ref","initValue","v","r","e","n","f","m","a","p","l","u","i","s","c","o","ChildComponent","renew","count","state","getParentValue","parentValueFromMount","summ","computed","notRefValue","localStore","store","domRef","increase","handleInputChane","event","localStoreUpdate","handleMounted","handleUpdated","parentValue","Root","parentNumber","increaseParent","decreaseParent","root"],"mappings":"CAAqB,UAAoB,CACrC,MAAMA,EAAU,SAAS,cAAc,MAAM,EAAE,QAC/C,GAAIA,GAAWA,EAAQ,UAAYA,EAAQ,SAAS,eAAe,EAC/D,OAEJ,UAAWC,KAAQ,SAAS,iBAAiB,2BAA2B,EACpEC,EAAeD,CAAI,EAEvB,IAAI,iBAAkBE,GAAc,CAChC,UAAWC,KAAYD,EACnB,GAAIC,EAAS,OAAS,YAGtB,UAAWC,KAAQD,EAAS,WACpBC,EAAK,UAAY,QAAUA,EAAK,MAAQ,iBACxCH,EAAeG,CAAI,CAGvC,CAAK,EAAE,QAAQ,SAAU,CAAE,UAAW,GAAM,QAAS,EAAI,CAAE,EACvD,SAASC,EAAaC,EAAQ,CAC1B,MAAMC,EAAY,CAAA,EAClB,OAAID,EAAO,YACPC,EAAU,UAAYD,EAAO,WAC7BA,EAAO,iBACPC,EAAU,eAAiBD,EAAO,gBAClCA,EAAO,cAAgB,kBACvBC,EAAU,YAAc,UACnBD,EAAO,cAAgB,YAC5BC,EAAU,YAAc,OAExBA,EAAU,YAAc,cACrBA,CACV,CACD,S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