@reactive-web-components/rwc 2.60.1 → 2.60.3

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/main.d.ts CHANGED
@@ -6,3 +6,8 @@ export declare class TestComponent extends BaseElement {
6
6
  connectedCallback(): void;
7
7
  render(): ComponentConfig<HTMLDivElement>;
8
8
  }
9
+ export declare const debounce: <T>(fn: (...args: T[]) => void, delay: number) => {
10
+ (...args: T[]): void;
11
+ cancel(): void;
12
+ };
13
+ export declare function throttle<T extends unknown[]>(func: (...args: T) => void, delay: number): (...args: T) => void;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@reactive-web-components/rwc",
3
- "version": "2.60.1",
3
+ "version": "2.60.3",
4
4
  "type": "module",
5
5
  "types": "./shared/index.d.ts",
6
6
  "exports": {
7
7
  ".": {
8
8
  "types": "./shared/index.d.ts",
9
- "import": "./reactive-web-component.CROWiiEy.js",
10
- "require": "./reactive-web-component.B_LM0pVV.umd.cjs"
9
+ "import": "./reactive-web-component.DiO79eYt.js",
10
+ "require": "./reactive-web-component.Dgp6Cnfz.umd.cjs"
11
11
  }
12
12
  },
13
13
  "author": "tamazyanarsen",
@@ -34,6 +34,6 @@
34
34
  "ui",
35
35
  "frontend"
36
36
  ],
37
- "module": "./reactive-web-component.CROWiiEy.js",
38
- "main": "./reactive-web-component.B_LM0pVV.umd.cjs"
37
+ "module": "./reactive-web-component.DiO79eYt.js",
38
+ "main": "./reactive-web-component.Dgp6Cnfz.umd.cjs"
39
39
  }
@@ -0,0 +1,2 @@
1
+ (function(r,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(r=typeof globalThis<"u"?globalThis:r||self,y(r.ReactiveComponent={}))})(this,function(r){"use strict";var sn=Object.defineProperty;var on=(r,y,$)=>y in r?sn(r,y,{enumerable:!0,configurable:!0,writable:!0,value:$}):r[y]=$;var d=(r,y,$)=>on(r,typeof y!="symbol"?y+"":y,$);const y=n=>n&&typeof n=="object"&&("classList"in n||"attributes"in n||"customAttributes"in n||"reactiveClassList"in n||"listeners"in n||"customListeners"in n||"children"in n||"effects"in n||"style"in n||Object.keys(n).some(t=>t.startsWith(".")||t.startsWith("@")||t.startsWith("$")))&&!("hostElement"in n),$=n=>n&&typeof n=="object"&&"hostElement"in n&&"append"in n&&"set"in n&&"addStyle"in n&&"setAttribute"in n&&"addClass"in n&&"addEffect"in n&&"addReactiveContent"in n&&"setReactiveContent"in n&&"clear"in n,V=(n,t,...e)=>{t&&t.apply(n,e)};let J=!0;const p=(...n)=>{J&&console.debug(["[rwc]",...n].join(" | "),...Array.from(n.join("").matchAll(/%c/gm)).map((t,e)=>e%2===0?"color:red":"color:inherit"))},_=n=>n.replace(/([A-Z])/gm,t=>`-${t.toLowerCase()}`),tt=n=>n.replace(/-(\w)/gm,(t,e)=>e.toUpperCase()),B=(n,...t)=>{if(!J)return;const e={r:"color: #ff0000",g:"color: #00ff00",b:"color: #0000ff",y:"color: #ffff00",p:"color: #800080",c:"color: #00ffff",o:"color: #ffa500",w:"color: #808080"},s=n.match(/@[rgbpycow]/g)||[],o=s.map(c=>{const l=c.slice(1);return e[l]||"color: inherit"});let i=n;s.forEach(c=>{const l=new RegExp(`\\${c}([^\\s,]+)`,"g");i=i.replace(l,"%c$1")}),console.log(i,...o,...t)},Rt=()=>{J=!0},et=()=>{J=!1};et();const Lt=(n,t)=>{n.every(Boolean)&&t(n)},T=[],q=n=>{var t,e,s,o;(t=n.children)==null||t.forEach(i=>{var c;return(c=i.destroy)==null?void 0:c.call(i)}),(e=n.children)==null||e.clear(),(s=n.cleanupSet)==null||s.forEach(i=>i()),(o=n.cleanupSet)==null||o.clear()};function j(n,t){let e=(t==null?void 0:t.signalCompareFn)||(()=>!0);const s=new Set;function o(){var c;const i=T[T.length-1];return i&&!i.fake&&!s.has(i)&&i.status==="active"&&(s.add(i),(c=i.cleanupSet)==null||c.add(()=>s.delete(i))),!(t!=null&&t.name)&&(i!=null&&i.effectId)&&o.setName(i.effectId),n}return o.signalId=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`,o.setName=function(i){return o.signalId=`${i}_${Math.random().toString(36).substring(2,15)}`,o},o.setCompareFn=function(i){return e=i,o},o.clearSubscribers=function(){s.clear()},o.getSubscribers=function(){return s},o.peek=function(){return Object.freeze(n)},o.initValue=Object.freeze(n),o.forceSet=function(i){n=i,s.forEach(c=>{q(c),Promise.resolve().then(()=>{T.push(c),c(),T.pop()})})},o.set=function(i,c=e){n!==i&&c(n,i)&&o.forceSet(i)},o.update=function(i){o.set(i(n))},o.pipe=(i,c)=>{c!=null&&c.name&&o.setName(c.name);const l=j(null);return S(()=>{const u=o();S(()=>{const h=i(u);h instanceof Promise?h.then(R=>l.set(R)):L(h)?S(()=>l.set(h()),{name:"pipe_effect_inner"}):l.set(h)},{name:"pipe_effect"})},{name:(c==null?void 0:c.name)||`pipe_${o.signalId}`}),l},o}function S(n,t){var i;const e=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`;p("current effect",`%c${e}%c`);const s=n;s.status="active",s.children=new Set,s.effectId=e;const o=T[T.length-1];o&&((i=o.children)==null||i.add(s),s.parent=new WeakRef(o),s.destroy=()=>{var c;q(s),(c=o.children)==null||c.delete(s),s.destroy=void 0,s.status="inactive"}),s.cleanupSet=new Set,T.push(s),s(),T.pop()}const L=n=>!!n&&["object","function"].includes(typeof n)&&"set"in n&&"update"in n&&"forceSet"in n&&"signalId"in n;function gt(n,...t){const e=j("");return S(()=>{const s=t.map(i=>L(i)?String(i()):String(i)),o=[n[0]];s.forEach((i,c)=>{o.push(i,n[c+1])}),e.set(o.join(""))}),e}function It(n,t){const e=j(t??null),s=o=>e.set(o);return n instanceof Promise?n.then(s):typeof n=="function"&&S(()=>{const o=n();o instanceof Promise?o.then(s):L(o)?S(()=>s(o())):s(o)}),e}function Tt(n,t){let e=n(),s=t();S(()=>{const o=n(),i=t();o!==i&&(o!==e?t.set(o):i!==s&&n.set(i)),e=o,s=i})}function jt(...n){let t=n.map(s=>s());const e=j(t);return n.forEach((s,o)=>{S(()=>{const i=()=>t.filter(c=>c!==void 0).length;i()===n.length&&(t=Array.from(t).fill(void 0)),t[o]=s(),i()===n.length&&e.set([...t])})}),e}const Ot=(...n)=>{const t=j([]);return S(()=>{t.set(n.map(e=>e()))}),t},z="eventProps",G="EVENT_CONFIG",F="observedAttributes",kt=()=>(n,t)=>{Reflect.get(n,F)||Reflect.defineProperty(n,F,{value:[]}),Reflect.get(n,F).push(_(t))},$t=n=>(t,e)=>{Reflect.get(t,z)||Reflect.defineProperty(t,z,{value:[]}),Reflect.get(t,G)||Reflect.defineProperty(t,G,{value:{}}),Reflect.get(t,G)[e]={bubbles:(n==null?void 0:n.bubbles)??!1,composed:(n==null?void 0:n.composed)??!1},Reflect.get(t,z).push(e)},X=(n,t=!1)=>e=>{p(n,"start register static attr",e.prototype[F]);const s=[];if(e.styles){const i=e.styles,c=[];Array.isArray(i)?c.push(...i):c.push(i),c.forEach(l=>{const u=new CSSStyleSheet;u.replaceSync(l),s.push(u);const v=new CSSStyleSheet;v.replaceSync(l.slice(l.indexOf("@property"))),document.adoptedStyleSheets.push(v)})}class o extends e{constructor(...c){p("constructor",`%c${n}%c`),super(t,...c),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){return p("rwc: render from new class"),e.prototype.render.call(this)}attributeChangedCallback(c,l,u){p("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${l}, newValue: ${u}`,`%c${n}%c`);try{u=JSON.parse(u)}catch{}const v=tt(c);if(v in this&&L(this[v])){const h=this[v];h.setName(c),u===null?(h.set(h.initValue),this.removeAttribute(c)):h.set(u)}V(this,e.prototype.attributeChangedCallback,c,l,u)}connectedCallback(){const c=()=>{var u,v;p("rwc: connectedCallback"),p("connectedCallback",`%c${n}%c`,this),(u=this.init)==null||u.call(this),this.providers&&Object.keys(this.providers).length>0&&(p("WRAPPER for providers",n),Object.entries(this.providers).forEach(([h,C])=>{p("register provider",h,C()),this.addEventListener(h,R=>{var f;p("send provider",h,C());const E=R;((f=E.detail)==null?void 0:f.context)===h&&(E.stopPropagation(),E.detail.callback(C))})})),this.checkInjects(),(v=e.prototype[z])==null||v.forEach(h=>{this[h]=C=>{const R=e.prototype[G][h],{bubbles:E,composed:f}=R;L(C)?S(()=>{B("@oemit reactive value",C()),this.dispatchEvent(new CustomEvent(h,{detail:C(),bubbles:E,composed:f}))}):(B("@oemit value",C),this.dispatchEvent(new CustomEvent(h,{detail:C,bubbles:E,composed:f})))}}),p("start render",`%c${n}%c`,n);const l=()=>{p("rwc: insertRenderTemplate");const C=this.render().hostElement;C&&this.shadow.appendChild(C),V(this,e.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!e.styles){const h=E=>E instanceof Promise||Array.isArray(E)&&E.every(f=>f instanceof Promise),C=this.rootStyle,R=E=>{const f=new CSSStyleSheet;f.replaceSync(E),this.shadow.adoptedStyleSheets.push(f);const w=new CSSStyleSheet;w.replaceSync(E.slice(E.indexOf("@property"))),document.adoptedStyleSheets.push(w)};if(h(C)){const E=[];Array.isArray(C)?E.push(...C):E.push(C),Promise.all(E).then(f=>f.forEach(w=>R(w.default))).then(()=>l())}else{const E=[];Array.isArray(C)?E.push(...C):E.push(C),E.forEach(f=>R(f)),l()}}else l();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(h=>{p(this.slotContext,this.slotContext&&this.slotContext[h.name]),B("@bslot element",h,`name:${h.name};`,h.assignedElements()),h.assignedElements().forEach(C=>{const R=this.slotContext[h.name];this.slotContext&&L(R)&&(B("@oslot element",h,`name:${h.name};`,h.assignedElements()),S(()=>{C.dispatchEvent(new CustomEvent("handleSlotContext",{detail:R()}))}))})})};c.fake=!0,c.component=new WeakRef(this),this.effectSet.add(new WeakRef(c)),S(c,{name:"FAKE_wrapperEffect"})}disconnectedCallback(){this.allSlotContent=[],this.slotContent={},this.htmlSlotContent={},this.effectSet.forEach(c=>{var l,u;return(u=(l=c.deref())==null?void 0:l.destroy)==null?void 0:u.call(l)}),this.effectSet.clear(),this.shadow.replaceChildren(),this.replaceChildren(),V(this,e.prototype.disconnectedCallback)}}return d(o,"observedAttributes",e.prototype[F]??[]),d(o,"renderTagName",n),o.toString=()=>n,customElements.get(n)?console.error(`название тега ${n} повторяется, компонент ${e.name} не зарегистрирован`):customElements.define(n,o),e.renderTagName=n,e};class M extends HTMLElement{constructor(e=!1){super();d(this,"init");d(this,"isSlotLazyLoading",!1);d(this,"slotTemplate");d(this,"slotContext");d(this,"rootStyle");d(this,"modelValue");d(this,"providers");d(this,"effectSet",new Set);d(this,"appendAllSlotContent");d(this,"allSlotContent",[]);d(this,"slotContent",{});d(this,"htmlSlotContent",{});d(this,"shadow");d(this,"injects",{});this.shadow=this.attachShadow({mode:e?"closed":"open"})}appendChild(e,s=!0){var o;if(this.isSlotLazyLoading&&s){if(e instanceof HTMLElement){const i=e.slot||"default";this.htmlSlotContent[i]||(this.htmlSlotContent[i]=[]),(o=this.htmlSlotContent[i])==null||o.push(e)}}else return super.appendChild(e)}appendSlotContent(){var e;(e=this.appendAllSlotContent)==null||e.call(this)}inject(e){return p("%cinject%c",e),this.injects[e]||(this.injects[e]=j(null)),this.injects[e]}checkInjects(){Object.entries(this.injects).forEach(([e,s])=>{p("%cinject%c",`%c${e}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(e,{detail:{context:e,callback:o=>S(()=>{s.set(o())},{name:e})},bubbles:!0,composed:!0}))})}setReactiveValue(e){this.modelValue=e}}d(M,"observedAttributes",[]),d(M,"renderTagName",""),d(M,"styles");const Mt=n=>"render"in n&&"setReactiveValue"in n,Wt="handleSlotContext",nt="onConnected",st=n=>typeof n=="string"?n:JSON.stringify(n),Ht=n=>{const t=document.createElement("span");return t.textContent=st(n),t},ot=(n,t)=>(n.appendChild(Ht(t)),n),Pt=(n,t)=>(n.replaceChildren(),ot(n,t)),rt=n=>{const t=document.createElement("span");return S(()=>{const e=n();t.textContent=st(e)}),t};class it{constructor(t){d(this,"wrapper");d(this,"keyedEffects",new Map);d(this,"append",(...t)=>(t.forEach(e=>{var o;const s=e.hostElement;s&&((o=this.hostElement)==null||o.appendChild(s),nt in s&&setTimeout(()=>{var i;(i=s.onConnected)==null||i.call(s,e,s)}))}),this));d(this,"set",(...t)=>{var s;this.clear();const e=document.createDocumentFragment();return t.forEach(o=>{const i=o.hostElement;i&&e.appendChild(i)}),(s=this.hostElement)==null||s.appendChild(e),this});d(this,"removeChild",(...t)=>(t.forEach(e=>{var s,o;if(Array.from(((s=this.hostElement)==null?void 0:s.childNodes.values())||[]).some(i=>i===e.hostElement)){const i=e.hostElement;i&&((o=this.hostElement)==null||o.removeChild(i))}}),this));d(this,"addHtmlContent",t=>{const e=this.hostElement;return e?(ot(e,t),this):this});d(this,"setHtmlContent",t=>{const e=this.hostElement;return e?(Pt(e,t),this):this});d(this,"setAttribute",(t,e)=>{var i;const s=this.hostElement;if(!s)return this;let o;if(typeof e=="boolean"&&!(s instanceof M))if(e)o="";else{this.removeAttribute(t);const c=t.toLowerCase();return c in s&&(s[c]=null),this}else typeof e!="string"?o=JSON.stringify(e):o=e;if((i=this.hostElement)==null||i.setAttribute(_(t),o),!(s instanceof M)){const c=t.toLowerCase();c in s&&(s[c]=e)}return this});d(this,"setCustomAttribute",(t,e)=>{var o;let s;return typeof e!="string"?s=JSON.stringify(e):s=e,(o=this.hostElement)==null||o.setAttribute(_(t),s),this});d(this,"setReactiveAttribute",(t,e)=>(this.addEffect(s=>{s.setAttribute(t,e())},t),this));d(this,"setReactiveCustomAttribute",(t,e)=>(this.addEffect(s=>{s.setCustomAttribute(t,e())}),this));d(this,"removeAttribute",t=>{var e;return(e=this.hostElement)==null||e.removeAttribute(_(t)),this});d(this,"addStyle",t=>{const e=this.hostElement;return e?(Object.entries(t).forEach(([s,o])=>{const i=s.startsWith("--");typeof o=="function"?this.addEffect(()=>{if(i){const c=String(o()||"");e.style.setProperty(s,c)}else e.style[s]=o()}):typeof o=="string"&&(i?e.style.setProperty(s,o):e.style[s]=o)}),this):this});d(this,"onConnected",t=>this.hostElement?(Reflect.defineProperty(this.hostElement,nt,{get(){return t}}),this):this);d(this,"addClass",(...t)=>(t.forEach(e=>{var s;typeof e=="string"?(s=this.hostElement)==null||s.classList.add(...e.split(" ").flatMap(o=>o.split(`
2
+ `)).map(o=>o.trim()).filter(Boolean)):(()=>{let o=null;this.addEffect(()=>{const i=e();i.length>0&&(o?this.replaceClass(o,i):this.addClass(i),o=i)})})()}),this));d(this,"setClass",(...t)=>{var e,s,o;return(s=this.hostElement)==null||s.classList.remove(...((e=this.hostElement)==null?void 0:e.classList)||[]),(o=this.hostElement)==null||o.classList.add(...t),this});d(this,"addReactiveClass",t=>(Object.keys(t).forEach(e=>{this.addEffect(s=>{t[e]()?s.addClass(e):s.removeClass(e)})}),this));d(this,"removeClass",(...t)=>{var e;return(e=this.hostElement)==null||e.classList.remove(...t),this});d(this,"replaceClass",(t,e)=>{var s;return(s=this.hostElement)==null||s.classList.replace(t,e),this});d(this,"addEffect",(t,e)=>{var i,c;const s=this.hostElement;if(!s)return this;const o=()=>t(this,s);if(e){const l=(i=this.keyedEffects.get(e))==null?void 0:i.deref();l&&q(l)}return(c=s.effectSet)==null||c.add(new WeakRef(o)),o.component=this.wrapper,S(o,{name:(e==null?void 0:e.toString())||s.tagName}),this});d(this,"addReactiveContent",t=>{var e;return(e=this.hostElement)==null||e.appendChild(rt(t)),this});d(this,"setReactiveContent",t=>{var e;return this.clear(),(e=this.hostElement)==null||e.appendChild(rt(t)),this});d(this,"clear",()=>{var t;return(t=this.hostElement)==null||t.replaceChildren(),this});this.wrapper=t;const e=t.deref();e&&(e.effectSet=new Set)}get hostElement(){return this.wrapper.deref()}addEventlistener(t,e,s=!1){var o;return(o=this.hostElement)==null||o.addEventListener(t,i=>e(i,this,this.hostElement),s),this}}class _t extends it{constructor(){super(...arguments);d(this,"setReactiveValue",e=>(this.hostElement instanceof M&&this.hostElement.setReactiveValue(e),this));d(this,"setSlotTemplate",e=>{var o;const s=(o=this.hostElement)==null?void 0:o.slotTemplate;return s&&Object.entries(e).forEach(([i,c])=>{s[i]=c}),this})}}const Bt=()=>()=>{},ct=n=>new _t(new WeakRef(n)),at=n=>new it(new WeakRef(n)),lt=(n,...t)=>({classList:[...n.map(e=>e.trim()).filter(Boolean),...t]}),Ft=(n,...t)=>lt(n,...t),Z=(n,t)=>{if(!t||!n.deref())return;const e=Object.keys(t||{}).filter(o=>o.startsWith(".")||o.startsWith("@")||o.startsWith("$"));e.filter(o=>o.startsWith(".")).forEach(o=>{t!=null&&t.attributes||(t.attributes={}),t.attributes[o.slice(1)]=t[o]}),e.filter(o=>o.startsWith("@")).forEach(o=>{t!=null&&t.listeners||(t.listeners={});const i=o.slice(1);t.listeners[i]=t[o]}),e.filter(o=>o.startsWith("$")).forEach(o=>{t!=null&&t.effects||(t.effects=[]),t.effects.push(t[o])});const s=n.deref();if(s)return ut(s,t.classList),pt(s,t.style),Ct(s,t.attributes),mt(s,t.reactiveClassList),ft(s,t.customAttributes),ht(s,t.children),dt(s,t.effects),Q(s,t.listeners),Q(s,t.customListeners),s},Q=(n,t)=>{t&&Object.entries(t).forEach(([e,s])=>{typeof s=="function"&&n.addEventlistener(e,s)})},dt=(n,t)=>t==null?void 0:t.forEach(e=>n.addEffect(e)),ht=(n,t)=>N(new WeakRef(n),...t||[])??n,ft=(n,t)=>{const e=t;e&&Object.keys(e).forEach(s=>{L(e[s])?n.setReactiveCustomAttribute(s,e[s]):typeof e[s]=="function"?n.addEffect(()=>{n.setCustomAttribute(s,e[s]())}):n.setCustomAttribute(s,e[s])})},ut=(n,t)=>n.addClass(...t||[]),mt=(n,t)=>n.addReactiveClass(t||{}),pt=(n,t)=>n.addStyle(t||{}),Ct=(n,t)=>{const e=t,s=(o,i)=>{i&&(L(i)?n.setReactiveAttribute(o,i):typeof i=="function"?n.addEffect(()=>{n.setAttribute(o,i())}):n.setAttribute(o,i))};e&&Object.keys(e).forEach(o=>{s(o,e[o])})},N=(n,...t)=>{const e=n.deref();if(e)return t.forEach(s=>{typeof s=="string"?s.trim().length>0&&e.addHtmlContent(s):L(s)?e.addReactiveContent(s):e.append(s)}),e},H=(n,t)=>{const e=document.createElement(n),s=at(e);return Z(new WeakRef(s),t)??s},D=(n,t)=>{const[e,...s]=n.split(" ").map(i=>i.trim()),o=H(e,t);return s.length>0&&o.addClass(...s),(...i)=>N(new WeakRef(o),...i.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!L(c)?O(()=>c(o)):c))??o},O=n=>{const t=`getSignalContent_${Math.random().toString(36).substring(2,15)}`;return H("div").addStyle({display:"contents"}).addEffect(e=>{e.clear(),N(new WeakRef(e),...[n()].flat())},t)},Nt=(n,t,e)=>{const s=H("div").addStyle({display:"contents"}),o=new Map,i=new Map,c=new Map,l=new Map;let u=[];const v=new Set;let h=n.peek();const C=f=>{v.delete(f),o.delete(f),i.delete(f),c.delete(f),l.delete(f)},R=f=>{if(!l.has(f)){const w=u.indexOf(f);return l.set(f,w),w}return l.get(f)},E=(f,w,x)=>Array.from(x.children).indexOf(f)!==w;return S(()=>{const f=n(),w=f.map(t).map(m=>typeof m=="string"?m:m.toString()),x=new Set(w);l.clear(),w.forEach((m,b)=>{l.set(m,b)}),u=w;const U=s.hostElement;if(!U)return;p("containerChildren",Array.from(U.children),u);const wt=[];Array.from(U.children).forEach(m=>{const b=m.dataset.key;b&&!x.has(b)&&wt.push(m)}),wt.forEach(m=>{const b=m.dataset.key;p("remove element",b,m),m.remove(),C(b)}),w.forEach((m,b)=>{var A;const I=f[b],P=h[b];if(!o.has(m))p("create new element",m,I),o.set(m,j(Math.random().toString(36).substring(2,15))),i.set(m,()=>e(I,b,f).setCustomAttribute("data-key",m));else if(P&&JSON.stringify(I)!==JSON.stringify(P)){const g=c.get(m);(A=o.get(m))==null||A.set(Math.random().toString(36).substring(2,15)),i.set(m,()=>e(I,b,f).setCustomAttribute("data-key",m)),g&&g.parentNode&&p("mark element for update",m)}}),h=[...f.map(m=>({...m}))];const nn=()=>{o.forEach((m,b)=>{p("key from setTimeout foreach currItemSignalMap",b),v.has(b)||(v.add(b),S(()=>{var At;m();const I=R(b),P=(At=i.get(b))==null?void 0:At();if(!P||!P.hostElement)return;const A=s.hostElement,g=P.hostElement;if(!A)return;p("call effect from setTimeout",b,g);const k=c.get(b);if(k&&k.parentNode===A){if(E(k,I,A)){const W=A.children[I];W&&W!==k?A.insertBefore(k,W):W||A.appendChild(k)}g!==k&&(k.replaceWith(g),c.set(b,g))}else if(c.set(b,g),I<A.children.length){const W=A.children[I];W?A.insertBefore(g,W):A.appendChild(g)}else A.appendChild(g)}))})};Promise.resolve().then(()=>nn())}),s},Vt=n=>{let t=[H("div")],e=!1;return S(()=>{var i,c;const s=n();e=Array.isArray(s);const o=[];o.push(...[s].flat()),o.length===0&&o.push(H("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{p("newReactiveComponent.map",o.map(l=>{var u;return p("newReactiveComponent hostElement",l.hostElement),(u=l.hostElement)==null?void 0:u.id})),p("currComponent[0].hostElement?.id",(i=t[0].hostElement)==null?void 0:i.id,t),(c=t[0].hostElement)==null||c.replaceWith(...o.map(l=>l.hostElement).filter(Boolean)),t.slice(1).forEach(l=>{var u;return(u=l.hostElement)==null?void 0:u.remove()}),t=o}catch(l){console.error(l)}}),e?t:t[0]},Jt=n=>Wt in n,qt=n=>{const t=D("div")().addStyle({display:"contents"}),e=s=>{const o=t.hostElement;return o&&(o.innerHTML=s),t};return typeof n=="string"?e(n):t.addEffect(()=>{e(n())}),t},Y=(n,t,e)=>n?O(t):e?O(e):D("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),Et=(n,t,e)=>O(()=>Y(!!n(),t,e)),zt=(n,t,e)=>typeof n=="boolean"?Y(n,t,e):Et(n,t,e),K=(n,t)=>O(t).addEffect((e,s)=>{if(typeof n=="boolean")s.style.display=n?"block":"none";else{const o=n()?"block":"none";s.style.display=o}}),Gt=(n,t,e)=>{const s=[K(n,t)].flat();return e&&s.push(...[K(()=>typeof n=="boolean"?!n:!n(),e)].flat()),O(()=>s)},bt=(n,t)=>{p("createCustomElement",n);const e=document.createElement(n),s=ct(e);return e.init=()=>{Z(new WeakRef(s),t)},s},St=(n,t)=>{const e=n.split(" ").slice(1).map(o=>o.trim()),s=bt(n.split(" ")[0],t);return Array.isArray(e)&&e.length>0&&s.addClass(...e),(...o)=>{const i=o.filter(Boolean).flat().flatMap(l=>typeof l=="function"&&!L(l)?O(()=>l(s)):l),c=s.hostElement;return c&&(c.allSlotContent=i,c.slotContent=i.filter($).reduce((l,u)=>{var h;const v=((h=u.hostElement)==null?void 0:h.getAttribute("slot"))||"default";return l[v]||(l[v]=[]),l[v].push(u),l},{}),c.appendAllSlotContent=()=>{N(new WeakRef(s),...i)}),s}},yt=(n,t,e)=>St(`${n.renderTagName}${t&&typeof t=="string"?" "+t:""}`,y(t)?t:t&&typeof t=="string"?e:void 0),Dt=()=>{const n=()=>{};return n.oldValue=null,n},Ut=()=>({}),vt=(n,t,e)=>{const s=t?X(t,e)(n):n;return(o,...i)=>{const c=[...i];return o&&!y(o)&&c.unshift(o),yt(s,y(o)?o:{})(...c)}},Xt=n=>[vt(n),(t,e)=>{X(t,e)(n)}],a={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(n=>{a[n]=(t,...e)=>{let s=[...e];return t&&!y(t)&&(s=[t].concat(s)),D(n,y(t)?t:{})(...s)}});const Zt=a.div,Qt=a.span,Yt=a.section,Kt=a.input,xt=a.button,te=a.table,ee=a.tr,ne=a.td,se=a.th,oe=a.ul,re=a.li,ie=a.ol,ce=a.form,ae=a.label,le=a.select,de=a.option,he=a.textarea,fe=a.img,ue=a.a,me=a.p,pe=a.h1,Ce=a.h2,Ee=a.h3,be=a.h4,Se=a.h5,ye=a.h6,ve=a.br,we=a.hr,Ae=a.pre,Re=a.code,Le=a.nav,ge=a.header,Ie=a.footer,Te=a.main,je=a.aside,Oe=a.article,ke=a.figure,$e=a.figcaption,Me=a.blockquote,We=a.cite,He=a.small,Pe=a.strong,_e=a.em,Be=a.b,Fe=a.i,Ne=a.u,Ve=a.s,Je=a.sub,qe=a.sup,ze=a.mark,Ge=a.del,De=a.ins,Ue=a.details,Xe=a.summary,Ze=a.progress,Qe=a.meter,Ye=a.audio,Ke=a.video,xe=a.canvas,tn=a.slot,en=n=>t=>n(t).addClass(...t.classList??[]).addReactiveClass(t.reactiveClassList??{});r.BaseElement=M,r.a=ue,r.addAttributeList=Ct,r.addClassList=ut,r.addCustomAttributes=ft,r.addReactiveClassList=mt,r.addStyleList=pt,r.appendContentItem=N,r.article=Oe,r.aside=je,r.audio=Ye,r.b=Be,r.bindReactiveSignals=Tt,r.blockquote=Me,r.br=ve,r.button=xt,r.camelToKebab=_,r.canvas=xe,r.checkCall=V,r.checkRef=Lt,r.cite=We,r.classList=lt,r.cls=Ft,r.code=Re,r.colorLog=B,r.combineLatest=Ot,r.component=X,r.configCustomComponent=Xt,r.createComponent=en,r.createCustom=yt,r.createCustomEl=St,r.createCustomElement=bt,r.createEl=D,r.createElement=H,r.createSignal=It,r.customElementHelpers=ct,r.defineSlotTemplate=Ut,r.del=Ge,r.details=Ue,r.disableLogs=et,r.div=Zt,r.effect=S,r.elementHelpers=at,r.em=_e,r.enableLogs=Rt,r.event=$t,r.eventEmitter=Bt,r.figcaption=$e,r.figure=ke,r.footer=Ie,r.forkJoin=jt,r.form=ce,r.getList=Nt,r.getSignalContent=O,r.h1=pe,r.h2=Ce,r.h3=Ee,r.h4=be,r.h5=Se,r.h6=ye,r.header=ge,r.hr=we,r.i=Fe,r.img=fe,r.initComponent=Z,r.input=Kt,r.ins=De,r.isBaseElement=Mt,r.isComponentConfig=$,r.isComponentInitConfig=y,r.isReactiveSignal=L,r.isSlotTemplate=Jt,r.kebabToCamel=tt,r.label=ae,r.li=re,r.main=Te,r.mark=ze,r.meter=Qe,r.nav=Le,r.newEventEmitter=Dt,r.ol=ie,r.option=de,r.p=me,r.pre=Ae,r.progress=Ze,r.projectLog=p,r.property=kt,r.removeEffect=q,r.renderIf=Y,r.rs=gt,r.rxRenderIf=Et,r.s=Ve,r.section=Yt,r.select=le,r.setChildren=ht,r.setEffects=dt,r.setListeners=Q,r.show=Gt,r.showIf=K,r.signal=j,r.signalComponent=Vt,r.slot=tn,r.small=He,r.span=Qt,r.strong=Pe,r.sub=Je,r.summary=Xe,r.sup=qe,r.table=te,r.td=ne,r.textarea=he,r.th=se,r.tr=ee,r.u=Ne,r.ul=oe,r.unsafeHtml=qt,r.useCustomComponent=vt,r.video=Ke,r.when=zt,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});