@reactive-web-components/rwc 2.55.3 → 2.56.0

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