@reactive-web-components/rwc 2.53.4 → 2.54.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
@@ -1,26 +0,0 @@
1
- import { CompFuncContent, ComponentConfig } from './shared/types';
2
- import { ReactiveSignal } from './shared/utils';
3
- export declare function newrenderIf<Content extends CompFuncContent, ElseContent extends CompFuncContent>(condition: boolean, content: Content, elseContent: ElseContent): ReturnType<Content> | ReturnType<ElseContent>;
4
- export declare function newrenderIf<Content extends CompFuncContent>(condition: boolean, content: Content): ReturnType<Content> | ComponentConfig<HTMLDivElement>;
5
- export declare function newrxRenderIf<Content extends CompFuncContent, ElseContent extends CompFuncContent>(condition: ReactiveSignal<any> | (() => boolean), content: Content, elseContent: ElseContent): ReturnType<Content> | ReturnType<ElseContent>;
6
- export declare function newrxRenderIf<Content extends CompFuncContent>(condition: ReactiveSignal<any> | (() => boolean), content: Content): ReturnType<Content> | ComponentConfig<HTMLDivElement>;
7
- /**
8
- *
9
- export const renderIf = (
10
- condition: boolean,
11
- content: CompFuncContent,
12
- elseContent?: CompFuncContent,
13
- ) =>
14
- condition
15
- ? getSignalContent(content)
16
- : elseContent
17
- ? getSignalContent(elseContent)
18
- : createEl('div')().setAttribute("id", "empty_div_renderIf").addStyle({ display: "none" });
19
-
20
- export const rxRenderIf = (
21
- condition: ReactiveSignal<any> | (() => boolean),
22
- content: CompFuncContent,
23
- elseContent?: CompFuncContent,
24
- ) =>
25
- getSignalContent(() => renderIf(Boolean(condition()), content, elseContent));
26
- */
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@reactive-web-components/rwc",
3
- "version": "2.53.4",
3
+ "version": "2.54.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.CpRR4jc5.js",
10
- "require": "./reactive-web-component.BPxD-Q4n.umd.cjs"
9
+ "import": "./reactive-web-component.T3Qg0HMS.js",
10
+ "require": "./reactive-web-component.BDKz51Vi.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.CpRR4jc5.js",
38
- "main": "./reactive-web-component.BPxD-Q4n.umd.cjs"
37
+ "module": "./reactive-web-component.T3Qg0HMS.js",
38
+ "main": "./reactive-web-component.BDKz51Vi.umd.cjs"
39
39
  }
@@ -1,2 +1,2 @@
1
- (function(o,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(o=typeof globalThis<"u"?globalThis:o||self,p(o.ReactiveComponent={}))})(this,function(o){"use strict";var Ge=Object.defineProperty;var Ne=(o,p,g)=>p in o?Ge(o,p,{enumerable:!0,configurable:!0,writable:!0,value:g}):o[p]=g;var E=(o,p,g)=>Ne(o,typeof p!="symbol"?p+"":p,g);const p=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),g=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,W=(t,e,...n)=>{e&&e.apply(t,n)};let _=!0;const f=(...t)=>{_&&console.debug(["[rwc]",...t].join(" | "),...Array.from(t.join("").matchAll(/%c/gm)).map((e,n)=>n%2===0?"color:red":"color:inherit"))},I=t=>t.replace(/([A-Z])/gm,e=>`-${e.toLowerCase()}`),Y=t=>t.replace(/-(\w)/gm,(e,n)=>n.toUpperCase()),L=(t,...e)=>{if(!_)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)||[],i=s.map(c=>{const d=c.slice(1);return n[d]||"color: inherit"});let l=t;s.forEach(c=>{const d=new RegExp(`\\${c}([^\\s,]+)`,"g");l=l.replace(d,"%c$1")}),console.log(l,...i,...e)},pt=()=>{_=!0},K=()=>{_=!1};K();const G=new Map,O=new WeakMap,B=[],w=[];function R(t,e){const n=new Set;let s=(e==null?void 0:e.signalCompareFn)||(()=>!0);function i(){var c;const l=B[B.length-1];if(l&&!("fake"in l&&l.fake)){const d=O.get(l),a=d==null?void 0:d.parent;if(a){const h=O.get(a);h==null||h.cleanupFns.add(()=>{n.delete(l)})}n.add(l),(c=G.get(l.effectId))==null||c.signals.push(i)}return t}return i.signalId=`${(e==null?void 0:e.name)||""}_${Math.random().toString(36).substring(2,15)}`,i.getSubscribers=()=>[...n],i.setCompareFn=function(l){return s=l,i},i.clearSubscribers=function(){n.clear()},i.peek=function(){return Object.freeze(t)},i.initValue=Object.freeze(t),i.oldValue=Object.freeze(t),i.forceSet=function(l){i.oldValue=Object.freeze(t),t=l,n.forEach(c=>Promise.resolve(c).then(d=>{const a=O.get(d);a&&a.cleanupFns.size>0&&(a.cleanupFns.forEach(h=>h()),a.cleanupFns.clear()),w.push(d),d(),w.pop()}))},i.set=function(l,c=s){t!==l&&c(t,l)&&i.forceSet(l)},i.update=function(l){i.set(l(t))},i.pipe=(l,c)=>{const d=R(null);return b(()=>{const a=i();b(()=>{const h=l(a);h instanceof Promise?h.then(m=>d.set(m)):v(h)?b(()=>d.set(h())):d.set(h)},c)}),d},i}function b(t,e){const n=`${(e==null?void 0:e.name)||""}_${Math.random().toString(36).substring(2,15)}`;f("current effect",`%c${n}%c`);const s=t;t=()=>(f("current effect callback",`%c${n}%c`),s()),"fake"in s&&s.fake&&(t.fake=!0),t.effectId=n;const i=w[w.length-1];G.set(n,{signals:[],parent:(i==null?void 0:i.effectId)||null}),O.has(t)||O.set(t,{cleanupFns:new Set});const l=O.get(t);i?l.parent=i:delete l.parent,w.push(t),B.push(t),t(),B.pop(),w.pop()}const v=t=>!!t&&["object","function"].includes(typeof t)&&"set"in t&&"oldValue"in t&&"update"in t&&"forceSet"in t;function Et(t,...e){const n=R("");return b(()=>{const s=e.map(l=>v(l)?String(l()):String(l)),i=[t[0]];s.forEach((l,c)=>{i.push(l,t[c+1])}),n.set(i.join(""))}),n}function yt(t,e){const n=R(e??null),s=i=>n.set(i);return t instanceof Promise?t.then(s):typeof t=="function"&&b(()=>{const i=t();i instanceof Promise?i.then(s):v(i)?b(()=>s(i())):s(i)}),n}function St(t,e){let n=t(),s=e();b(()=>{const i=t(),l=e();i!==l&&(i!==n?e.set(i):l!==s&&t.set(l)),n=i,s=l})}function vt(...t){let e=t.map(s=>s());const n=R(e);return t.forEach((s,i)=>{b(()=>{const l=()=>e.filter(c=>c!==void 0).length;l()===t.length&&(e=Array.from(e).fill(void 0)),e[i]=s(),l()===t.length&&n.set([...e])})}),n}class T extends HTMLElement{constructor(n=!1){super();E(this,"isSlotLazyLoading",!1);E(this,"slotTemplate");E(this,"slotContext");E(this,"rootStyle");E(this,"modelValue");E(this,"providers");E(this,"appendAllSlotContent");E(this,"allSlotContent",[]);E(this,"slotContent",{});E(this,"htmlSlotContent",{});E(this,"shadow");E(this,"injects",{});this.shadow=this.attachShadow({mode:n?"closed":"open"})}appendChild(n,s=!0){var i;if(this.isSlotLazyLoading&&s){if(n instanceof HTMLElement){const l=n.slot||"default";this.htmlSlotContent[l]||(this.htmlSlotContent[l]=[]),(i=this.htmlSlotContent[l])==null||i.push(n)}}else return super.appendChild(n)}appendSlotContent(){var n;(n=this.appendAllSlotContent)==null||n.call(this)}inject(n){return f("%cinject%c",n),this.injects[n]||(this.injects[n]=R(null)),this.injects[n]}checkInjects(){Object.entries(this.injects).forEach(([n,s])=>{f("%cinject%c",`%c${n}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(n,{detail:{context:n,callback:i=>b(()=>{s.set(i())})},bubbles:!0,composed:!0}))})}setReactiveValue(n){this.modelValue=n}}E(T,"observedAttributes",[]),E(T,"renderTagName",""),E(T,"styles");const At=t=>"render"in t&&"setReactiveValue"in t,gt="handleSlotContext",x="onConnected",Lt=()=>()=>{},N=t=>typeof t=="string"?t:JSON.stringify(t),V=t=>{const e=document.createElement("span");return e.textContent=N(t),e},D=(t,e)=>(t.appendChild(V(e)),t),tt=(t,e)=>(t.innerHTML="",D(t,e)),J=t=>{const e=document.createElement("span");return b(()=>{const n=t();e.textContent=N(n)}),e},M=t=>({append(...e){return e.forEach(n=>{t.appendChild(n.hostElement),x in n.hostElement&&setTimeout(()=>{var s,i;(i=(s=n.hostElement).onConnected)==null||i.call(s,n,n.hostElement)})}),this},set(...e){this.clear();const n=document.createDocumentFragment();return e.forEach(s=>{n.appendChild(s.hostElement)}),t.appendChild(n),this},removeChild(...e){return e.forEach(n=>{Array.from(t.childNodes.values()).some(s=>s===n.hostElement)&&t.removeChild(n.hostElement)}),this},addHtmlContent(e){return D(t,e),this},setHtmlContent(e){return tt(t,e),this},addEventlistener(e,n,s=!1){return t.addEventListener(e,i=>n(i,this,t),s),this},setAttribute(e,n){let s;if(typeof n=="boolean"&&!(t instanceof T))if(n)s="";else{this.removeAttribute(e);const i=e.toLowerCase();return i in t&&(t[i]=null),this}else typeof n!="string"?s=JSON.stringify(n):s=n;if(t.setAttribute(I(e),s),!(t instanceof T)){const i=e.toLowerCase();i in t&&(t[i]=n)}return this},setCustomAttribute(e,n){let s;return typeof n!="string"?s=JSON.stringify(n):s=n,t.setAttribute(I(e),s),this},setReactiveAttribute(e,n){return b(()=>this.setAttribute(e,n())),this},setReactiveCustomAttribute(e,n){return b(()=>this.setCustomAttribute(e,n())),this},removeAttribute(e){return t.removeAttribute(I(e)),this},addStyle(e){return Object.entries(e).forEach(([n,s])=>{const i=n.startsWith("--");typeof s=="function"?this.addEffect(()=>{if(i){const l=String(s()||"");t.style.setProperty(n,l)}else t.style[n]=s()}):typeof s=="string"&&(i?t.style.setProperty(n,s):t.style[n]=s)}),this},onConnected(e){return Reflect.defineProperty(t,x,{get(){return e}}),this},addClass(...e){return e.forEach(n=>{typeof n=="string"?t.classList.add(...n.split(" ").flatMap(s=>s.split(`
2
- `)).map(s=>s.trim()).filter(Boolean)):(()=>{let s=null;this.addEffect(()=>{const i=n();i.length>0&&(s?this.replaceClass(s,i):this.addClass(i),s=i)})})()}),this},setClass(...e){return t.classList.remove(...t.classList),t.classList.add(...e),this},addReactiveClass(e){return Object.keys(e).forEach(n=>{b(()=>{e[n]()?this.addClass(n):this.removeClass(n)})}),this},removeClass(...e){return t.classList.remove(...e),this},replaceClass(e,n){return t.classList.replace(e,n),this},addEffect(e){return b(()=>e(this,this.hostElement)),this},addReactiveContent(e){return t.appendChild(J(e)),this},setReactiveContent(e){return this.clear(),t.appendChild(J(e)),this},clear(){return t.innerHTML="",this},hostElement:t}),et=(t,...e)=>({classList:[...t.map(n=>n.trim()).filter(Boolean),...e]}),Rt=(t,...e)=>et(t,...e),U=(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 i=s.slice(1);e.listeners[i]=e[s]}),n.filter(s=>s.startsWith("$")).forEach(s=>{e!=null&&e.effects||(e.effects=[]),e.effects.push(e[s])}),it(t,e.classList),ct(t,e.style),rt(t,e.attributes),lt(t,e.reactiveClassList),ot(t,e.customAttributes),st(t,e.children),nt(t,e.effects),X(t,e.listeners),X(t,e.customListeners),t},X=(t,e)=>{e&&Object.entries(e).forEach(([n,s])=>{typeof s=="function"&&t.addEventlistener(n,s)})},nt=(t,e)=>e==null?void 0:e.forEach(n=>t.addEffect(n)),st=(t,e)=>$(t,...e||[]),ot=(t,e)=>{const n=e;n&&Object.keys(n).forEach(s=>{v(n[s])?t.setReactiveCustomAttribute(s,n[s]):typeof n[s]=="function"?t.addEffect(()=>{t.setCustomAttribute(s,n[s]())}):t.setCustomAttribute(s,n[s])})},it=(t,e)=>t.addClass(...e||[]),lt=(t,e)=>t.addReactiveClass(e||{}),ct=(t,e)=>t.addStyle(e||{}),rt=(t,e)=>{const n=e,s=(i,l)=>{l&&(v(l)?t.setReactiveAttribute(i,l):typeof l=="function"?t.addEffect(()=>{t.setAttribute(i,l())}):t.setAttribute(i,l))};n&&Object.keys(n).forEach(i=>{s(i,n[i])})},$=(t,...e)=>(e.forEach(n=>{typeof n=="string"?n.trim().length>0&&t.addHtmlContent(n):v(n)?t.addReactiveContent(n):t.append(n)}),t),k=(t,e)=>{const n=document.createElement(t),s={...M(n)};return U(s,e)},P=(t,e)=>{const[n,...s]=t.split(" ").map(l=>l.trim()),i=k(n,e);return s.length>0&&i.addClass(...s),(...l)=>$(i,...l.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?A(()=>c(i)):c))},A=t=>k("div").addStyle({display:"contents"}).addEffect(e=>{const n=t(),s=[];Array.isArray(n)?s.push(...n):s.push(n),e.clear(),$(e,...s)}),Tt=t=>{const e=s=>typeof s=="string"?s.trim().length>0?M(V(s)):P("div")():v(s)?M(J(s)):s;return at(()=>{const s=t();return s instanceof Array&&Array.isArray(s)?s.map(e):e(s)})},jt=(t,e,n)=>{const s=k("div").addStyle({display:"contents"}),i=new Map,l=new Map;let c=[];const d=new Set;let a=t.peek();const h=m=>{d.delete(m),i.delete(m),l.delete(m)};return b(()=>{const m=t();c=m.map(e).map(u=>typeof u=="string"?u:u.toString());const C=Array.from(s.hostElement.children);f("containerChildren",C,c),C.forEach(u=>{const S=u.dataset.key;c.includes(S)||(f("remove element",S,u),u.remove(),h(S))}),c.forEach(u=>{var H,j;const S=m[c.indexOf(u)];i.has(u)?JSON.stringify(S)!==JSON.stringify(a[c.indexOf(u)])&&((H=s.hostElement.querySelector(`[data-key="${u}"]`))==null||H.remove(),(j=i.get(u))==null||j.set(Math.random().toString(36).substring(2,15)),l.set(u,()=>n(S,c.indexOf(u),m).setCustomAttribute("data-key",u))):(f("create new element",u,S),i.set(u,R(Math.random().toString(36).substring(2,15))),l.set(u,()=>n(S,c.indexOf(u),m).setCustomAttribute("data-key",u)))}),a=m;const y=()=>{i.forEach((u,S)=>{f("key from setTimeout foreach currItemSignalMap",S),d.has(S)||(d.add(S),b(()=>{var bt;u();const H=c.indexOf(S),j=(bt=l.get(S))==null?void 0:bt();j&&(f("call effect from setTimeout",S,j.hostElement),H<=s.hostElement.children.length-1?s.hostElement.insertBefore(j.hostElement,s.hostElement.children[H]):s.hostElement.append(j.hostElement))}))})};Promise.resolve().then(()=>y())}),s},at=t=>{let e=[k("div")],n=!1;return b(()=>{var l,c;const s=t();n=Array.isArray(s);const i=[];i.push(...[s].flat()),i.length===0&&i.push(k("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{f("newReactiveComponent.map",i.map(d=>{var a;return f("newReactiveComponent hostElement",d.hostElement),(a=d.hostElement)==null?void 0:a.id})),f("currComponent[0].hostElement?.id",(l=e[0].hostElement)==null?void 0:l.id,e),(c=e[0].hostElement)==null||c.replaceWith(...i.map(d=>d.hostElement)),e.slice(1).forEach(d=>{var a;return(a=d.hostElement)==null?void 0:a.remove()}),e=i}catch(d){console.error(d)}}),n?e:e[0]},Ot=t=>gt in t,wt=t=>{const e=P("div")().addStyle({display:"contents"}),n=s=>(e.hostElement.innerHTML=s,e);return typeof t=="string"?n(t):e.addEffect(()=>{n(t())}),e},Z=(t,e,n)=>t?A(e):n?A(n):P("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),dt=(t,e,n)=>A(()=>Z(!!t(),e,n)),kt=(t,e,n)=>typeof t=="boolean"?Z(t,e,n):dt(t,e,n),Q=(t,e)=>{const n=A(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(i=>i.hostElement.style.display=s)}),n},It=(t,e,n)=>{const s=[Q(t,e)].flat();return n&&s.push(...[Q(()=>typeof t=="boolean"?!t:!t(),n)].flat()),A(()=>s)},ht=(t,e)=>{f("createCustomElement",t);const n=document.createElement(t),s={...M(n),setReactiveValue(i){return n instanceof T&&n.setReactiveValue(i),this},setSlotTemplate(i){const l=n.slotTemplate;return l&&Object.entries(i).forEach(([c,d])=>{l[c]=d}),this}};return U(s,e)},ut=(t,e)=>{const n=t.split(" ").slice(1).map(i=>i.trim()),s=ht(t.split(" ")[0],e);return Array.isArray(n)&&n.length>0&&s.addClass(...n),(...i)=>{L("@rcreateCustomEl content",t,i);const l=i.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?A(()=>c(s)):c);return s.hostElement.allSlotContent=l,s.hostElement.slotContent=l.filter(g).reduce((c,d)=>{const a=d.hostElement.getAttribute("slot")||"default";return c[a]||(c[a]=[]),c[a].push(d),c},{}),s.hostElement.appendAllSlotContent=()=>$(s,...l),s}},ft=(t,e,n)=>ut(`${t.renderTagName}${e&&typeof e=="string"?" "+e:""}`,p(e)?e:e&&typeof e=="string"?n:void 0),Mt=()=>{const t=()=>{};return t.oldValue=null,t},$t=()=>({}),Pt=(t,e,n)=>{const s=e?Ct(e,n)(t):t;return(i,...l)=>{const c=[...l];return i&&!p(i)&&c.unshift(i),ft(s,p(i)?i:{})(...c)}},r={};["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=>{r[t]=(e,...n)=>{let s=[...n];return e&&!p(e)&&(s=[e].concat(s)),P(t,p(e)?e:{})(...s)}});const mt=r.div,Ft=r.span,Ht=r.section,Wt=r.input,_t=r.button,Bt=r.table,Jt=r.tr,zt=r.td,qt=r.th,Gt=r.ul,Nt=r.li,Vt=r.ol,Dt=r.form,Ut=r.label,Xt=r.select,Zt=r.option,Qt=r.textarea,Yt=r.img,Kt=r.a,xt=r.p,te=r.h1,ee=r.h2,ne=r.h3,se=r.h4,oe=r.h5,ie=r.h6,le=r.br,ce=r.hr,re=r.pre,ae=r.code,de=r.nav,he=r.header,ue=r.footer,fe=r.main,me=r.aside,Ce=r.article,be=r.figure,pe=r.figcaption,Ee=r.blockquote,ye=r.cite,Se=r.small,ve=r.strong,Ae=r.em,ge=r.b,Le=r.i,Re=r.u,Te=r.s,je=r.sub,Oe=r.sup,we=r.mark,ke=r.del,Ie=r.ins,Me=r.details,$e=r.summary,Pe=r.progress,Fe=r.meter,He=r.audio,We=r.video,_e=r.canvas,Be=r.slot,Je=t=>e=>t(e).addClass(...e.classList??[]).addReactiveClass(e.reactiveClassList??{}),z="eventProps",q="EVENT_CONFIG",F="observedAttributes",ze=()=>(t,e)=>{Reflect.get(t,F)||Reflect.defineProperty(t,F,{value:[]}),Reflect.get(t,F).push(I(e))},qe=t=>(e,n)=>{Reflect.get(e,z)||Reflect.defineProperty(e,z,{value:[]}),Reflect.get(e,q)||Reflect.defineProperty(e,q,{value:{}}),Reflect.get(e,q)[n]={bubbles:(t==null?void 0:t.bubbles)??!1,composed:(t==null?void 0:t.composed)??!1},Reflect.get(e,z).push(n)},Ct=(t,e=!1)=>n=>{f(t,"start register static attr",n.prototype[F]);const s=[];if(n.styles){const l=n.styles,c=[];Array.isArray(l)?c.push(...l):c.push(l),c.forEach(d=>{const a=new CSSStyleSheet;a.replaceSync(d),s.push(a);const h=new CSSStyleSheet;h.replaceSync(d.slice(d.indexOf("@property"))),document.adoptedStyleSheets.push(h)})}class i extends n{constructor(...c){f("constructor",`%c${t}%c`),super(e,...c),L("@osheet",s),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){f("rwc: render from new class");let c=mt();const d=()=>{f("wrapperEffectCallback"),c=n.prototype.render.call(this)};return d.fake=!0,b(d),c}attributeChangedCallback(c,d,a){f("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${d}, newValue: ${a}`,`%c${t}%c`);try{a=JSON.parse(a)}catch{}const h=Y(c);if(h in this&&v(this[h])){const m=this[h];a===null?(m.set(m.initValue),this.removeAttribute(c)):m.set(a)}W(this,n.prototype.attributeChangedCallback,c,d,a)}connectedCallback(){var d;f("rwc: connectedCallback"),f("connectedCallback",`%c${t}%c`,this),this.providers&&Object.keys(this.providers).length>0&&(f("WRAPPER for providers",t),Object.entries(this.providers).forEach(([a,h])=>{f("register provider",a,h()),this.addEventListener(a,m=>{var y;f("send provider",a,h());const C=m;((y=C.detail)==null?void 0:y.context)===a&&(C.stopPropagation(),C.detail.callback(h))})})),this.checkInjects(),(d=n.prototype[z])==null||d.forEach(a=>{this[a]=h=>{const m=n.prototype[q][a],{bubbles:C,composed:y}=m;v(h)?b(()=>{L("@oemit reactive value",h()),this.dispatchEvent(new CustomEvent(a,{detail:h(),bubbles:C,composed:y}))}):(L("@oemit value",h),this.dispatchEvent(new CustomEvent(a,{detail:h,bubbles:C,composed:y})))}}),f("start render",`%c${t}%c`,t);const c=()=>{f("rwc: insertRenderTemplate");const a=this.render();this.shadow.appendChild(a.hostElement),W(this,n.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!n.styles){const a=C=>C instanceof Promise||Array.isArray(C)&&C.every(y=>y instanceof Promise),h=this.rootStyle,m=C=>{const y=new CSSStyleSheet;y.replaceSync(C),this.shadow.adoptedStyleSheets.push(y);const u=new CSSStyleSheet;u.replaceSync(C.slice(C.indexOf("@property"))),document.adoptedStyleSheets.push(u)};if(a(h)){const C=[];Array.isArray(h)?C.push(...h):C.push(h),Promise.all(C).then(y=>y.forEach(u=>m(u.default))).then(()=>c())}else{const C=[];Array.isArray(h)?C.push(...h):C.push(h),C.forEach(y=>m(y)),c()}}else c();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(a=>{f(this.slotContext,this.slotContext&&this.slotContext[a.name]),L("@bslot element",a,`name:${a.name};`,a.assignedElements()),a.assignedElements().forEach(h=>{const m=this.slotContext[a.name];this.slotContext&&v(m)&&(L("@oslot element",a,`name:${a.name};`,a.assignedElements()),b(()=>{h.dispatchEvent(new CustomEvent("handleSlotContext",{detail:m()}))}))})})}disconnectedCallback(){this.shadow.replaceChildren(),this.replaceChildren(),W(this,n.prototype.disconnectedCallback)}}return E(i,"observedAttributes",n.prototype[F]??[]),E(i,"renderTagName",t),i.toString=()=>t,customElements.get(t)?console.error(`название тега ${t} повторяется, компонент ${n.name} не зарегистрирован`):customElements.define(t,i),n.renderTagName=t,n};o.BaseElement=T,o.a=Kt,o.addAttributeList=rt,o.addClassList=it,o.addCustomAttributes=ot,o.addHtmlContent=D,o.addReactiveClassList=lt,o.addStyleList=ct,o.appendContentItem=$,o.article=Ce,o.aside=me,o.audio=He,o.b=ge,o.bindReactiveSignals=St,o.blockquote=Ee,o.br=le,o.button=_t,o.camelToKebab=I,o.canvas=_e,o.checkCall=W,o.cite=ye,o.classList=et,o.cls=Rt,o.code=ae,o.colorLog=L,o.component=Ct,o.createComponent=Je,o.createCustom=ft,o.createCustomEl=ut,o.createCustomElement=ht,o.createEl=P,o.createElement=k,o.createSignal=yt,o.defineSlotTemplate=$t,o.del=ke,o.details=Me,o.disableLogs=K,o.div=mt,o.effect=b,o.effectMap=G,o.elementHelpers=M,o.em=Ae,o.enableLogs=pt,o.event=qe,o.eventEmitter=Lt,o.figcaption=pe,o.figure=be,o.footer=ue,o.forkJoin=vt,o.form=Dt,o.getList=jt,o.getReactiveTemplate=Tt,o.getSignalContent=A,o.getTextContent=N,o.h1=te,o.h2=ee,o.h3=ne,o.h4=se,o.h5=oe,o.h6=ie,o.header=he,o.hr=ce,o.htmlEffectWrapper=J,o.i=Le,o.img=Yt,o.initComponent=U,o.input=Wt,o.ins=Ie,o.isBaseElement=At,o.isComponentConfig=g,o.isComponentInitConfig=p,o.isReactiveSignal=v,o.isSlotTemplate=Ot,o.kebabToCamel=Y,o.label=Ut,o.li=Nt,o.main=fe,o.mark=we,o.meter=Fe,o.nav=de,o.newEventEmitter=Mt,o.ol=Vt,o.option=Zt,o.p=xt,o.pre=re,o.progress=Pe,o.projectLog=f,o.property=ze,o.renderIf=Z,o.rs=Et,o.rxRenderIf=dt,o.s=Te,o.section=Ht,o.select=Xt,o.setChildren=st,o.setEffects=nt,o.setHtmlContent=tt,o.setListeners=X,o.show=It,o.showIf=Q,o.signal=R,o.signalComponent=at,o.slot=Be,o.small=Se,o.span=Ft,o.strong=ve,o.sub=je,o.summary=$e,o.sup=Oe,o.table=Bt,o.td=zt,o.textContentWrapper=V,o.textarea=Qt,o.th=qt,o.tr=Jt,o.u=Re,o.ul=Gt,o.unsafeHtml=wt,o.useCustomComponent=Pt,o.video=We,o.when=kt,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(o=typeof globalThis<"u"?globalThis:o||self,p(o.ReactiveComponent={}))})(this,function(o){"use strict";var Ne=Object.defineProperty;var Ve=(o,p,L)=>p in o?Ne(o,p,{enumerable:!0,configurable:!0,writable:!0,value:L}):o[p]=L;var E=(o,p,L)=>Ve(o,typeof p!="symbol"?p+"":p,L);const p=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),L=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,W=(t,e,...n)=>{e&&e.apply(t,n)};let _=!0;const f=(...t)=>{_&&console.debug(["[rwc]",...t].join(" | "),...Array.from(t.join("").matchAll(/%c/gm)).map((e,n)=>n%2===0?"color:red":"color:inherit"))},I=t=>t.replace(/([A-Z])/gm,e=>`-${e.toLowerCase()}`),Y=t=>t.replace(/-(\w)/gm,(e,n)=>n.toUpperCase()),R=(t,...e)=>{if(!_)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)||[],i=s.map(c=>{const d=c.slice(1);return n[d]||"color: inherit"});let l=t;s.forEach(c=>{const d=new RegExp(`\\${c}([^\\s,]+)`,"g");l=l.replace(d,"%c$1")}),console.log(l,...i,...e)},pt=()=>{_=!0},K=()=>{_=!1};K();const G=new Map,O=new WeakMap,B=[],w=[];function A(t,e){const n=new Set;let s=(e==null?void 0:e.signalCompareFn)||(()=>!0);function i(){var c;const l=B[B.length-1];if(l&&!("fake"in l&&l.fake)){const d=O.get(l),a=d==null?void 0:d.parent;if(a){const h=O.get(a);h==null||h.cleanupFns.add(()=>{n.delete(l)})}n.add(l),(c=G.get(l.effectId))==null||c.signals.push(i)}return t}return i.signalId=`${(e==null?void 0:e.name)||""}_${Math.random().toString(36).substring(2,15)}`,i.getSubscribers=()=>[...n],i.setCompareFn=function(l){return s=l,i},i.clearSubscribers=function(){n.clear()},i.peek=function(){return Object.freeze(t)},i.initValue=Object.freeze(t),i.oldValue=Object.freeze(t),i.forceSet=function(l){i.oldValue=Object.freeze(t),t=l,n.forEach(c=>Promise.resolve(c).then(d=>{const a=O.get(d);a&&a.cleanupFns.size>0&&(a.cleanupFns.forEach(h=>h()),a.cleanupFns.clear()),w.push(d),d(),w.pop()}))},i.set=function(l,c=s){t!==l&&c(t,l)&&i.forceSet(l)},i.update=function(l){i.set(l(t))},i.pipe=(l,c)=>{const d=A(null);return b(()=>{const a=i();b(()=>{const h=l(a);h instanceof Promise?h.then(m=>d.set(m)):v(h)?b(()=>d.set(h())):d.set(h)},c)}),d},i}function b(t,e){const n=`${(e==null?void 0:e.name)||""}_${Math.random().toString(36).substring(2,15)}`;f("current effect",`%c${n}%c`);const s=t;t=()=>(f("current effect callback",`%c${n}%c`),s()),"fake"in s&&s.fake&&(t.fake=!0),t.effectId=n;const i=w[w.length-1];G.set(n,{signals:[],parent:(i==null?void 0:i.effectId)||null}),O.has(t)||O.set(t,{cleanupFns:new Set});const l=O.get(t);i?l.parent=i:delete l.parent,w.push(t),B.push(t),t(),B.pop(),w.pop()}const v=t=>!!t&&["object","function"].includes(typeof t)&&"set"in t&&"oldValue"in t&&"update"in t&&"forceSet"in t;function Et(t,...e){const n=A("");return b(()=>{const s=e.map(l=>v(l)?String(l()):String(l)),i=[t[0]];s.forEach((l,c)=>{i.push(l,t[c+1])}),n.set(i.join(""))}),n}function yt(t,e){const n=A(e??null),s=i=>n.set(i);return t instanceof Promise?t.then(s):typeof t=="function"&&b(()=>{const i=t();i instanceof Promise?i.then(s):v(i)?b(()=>s(i())):s(i)}),n}function St(t,e){let n=t(),s=e();b(()=>{const i=t(),l=e();i!==l&&(i!==n?e.set(i):l!==s&&t.set(l)),n=i,s=l})}function vt(...t){let e=t.map(s=>s());const n=A(e);return t.forEach((s,i)=>{b(()=>{const l=()=>e.filter(c=>c!==void 0).length;l()===t.length&&(e=Array.from(e).fill(void 0)),e[i]=s(),l()===t.length&&n.set([...e])})}),n}const At=(...t)=>{const e=A([]);return b(()=>{e.set(t.map(n=>n()))}),e};class T extends HTMLElement{constructor(n=!1){super();E(this,"isSlotLazyLoading",!1);E(this,"slotTemplate");E(this,"slotContext");E(this,"rootStyle");E(this,"modelValue");E(this,"providers");E(this,"appendAllSlotContent");E(this,"allSlotContent",[]);E(this,"slotContent",{});E(this,"htmlSlotContent",{});E(this,"shadow");E(this,"injects",{});this.shadow=this.attachShadow({mode:n?"closed":"open"})}appendChild(n,s=!0){var i;if(this.isSlotLazyLoading&&s){if(n instanceof HTMLElement){const l=n.slot||"default";this.htmlSlotContent[l]||(this.htmlSlotContent[l]=[]),(i=this.htmlSlotContent[l])==null||i.push(n)}}else return super.appendChild(n)}appendSlotContent(){var n;(n=this.appendAllSlotContent)==null||n.call(this)}inject(n){return f("%cinject%c",n),this.injects[n]||(this.injects[n]=A(null)),this.injects[n]}checkInjects(){Object.entries(this.injects).forEach(([n,s])=>{f("%cinject%c",`%c${n}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(n,{detail:{context:n,callback:i=>b(()=>{s.set(i())})},bubbles:!0,composed:!0}))})}setReactiveValue(n){this.modelValue=n}}E(T,"observedAttributes",[]),E(T,"renderTagName",""),E(T,"styles");const gt=t=>"render"in t&&"setReactiveValue"in t,Lt="handleSlotContext",x="onConnected",Rt=()=>()=>{},N=t=>typeof t=="string"?t:JSON.stringify(t),V=t=>{const e=document.createElement("span");return e.textContent=N(t),e},D=(t,e)=>(t.appendChild(V(e)),t),tt=(t,e)=>(t.innerHTML="",D(t,e)),J=t=>{const e=document.createElement("span");return b(()=>{const n=t();e.textContent=N(n)}),e},M=t=>({append(...e){return e.forEach(n=>{t.appendChild(n.hostElement),x in n.hostElement&&setTimeout(()=>{var s,i;(i=(s=n.hostElement).onConnected)==null||i.call(s,n,n.hostElement)})}),this},set(...e){this.clear();const n=document.createDocumentFragment();return e.forEach(s=>{n.appendChild(s.hostElement)}),t.appendChild(n),this},removeChild(...e){return e.forEach(n=>{Array.from(t.childNodes.values()).some(s=>s===n.hostElement)&&t.removeChild(n.hostElement)}),this},addHtmlContent(e){return D(t,e),this},setHtmlContent(e){return tt(t,e),this},addEventlistener(e,n,s=!1){return t.addEventListener(e,i=>n(i,this,t),s),this},setAttribute(e,n){let s;if(typeof n=="boolean"&&!(t instanceof T))if(n)s="";else{this.removeAttribute(e);const i=e.toLowerCase();return i in t&&(t[i]=null),this}else typeof n!="string"?s=JSON.stringify(n):s=n;if(t.setAttribute(I(e),s),!(t instanceof T)){const i=e.toLowerCase();i in t&&(t[i]=n)}return this},setCustomAttribute(e,n){let s;return typeof n!="string"?s=JSON.stringify(n):s=n,t.setAttribute(I(e),s),this},setReactiveAttribute(e,n){return b(()=>this.setAttribute(e,n())),this},setReactiveCustomAttribute(e,n){return b(()=>this.setCustomAttribute(e,n())),this},removeAttribute(e){return t.removeAttribute(I(e)),this},addStyle(e){return Object.entries(e).forEach(([n,s])=>{const i=n.startsWith("--");typeof s=="function"?this.addEffect(()=>{if(i){const l=String(s()||"");t.style.setProperty(n,l)}else t.style[n]=s()}):typeof s=="string"&&(i?t.style.setProperty(n,s):t.style[n]=s)}),this},onConnected(e){return Reflect.defineProperty(t,x,{get(){return e}}),this},addClass(...e){return e.forEach(n=>{typeof n=="string"?t.classList.add(...n.split(" ").flatMap(s=>s.split(`
2
+ `)).map(s=>s.trim()).filter(Boolean)):(()=>{let s=null;this.addEffect(()=>{const i=n();i.length>0&&(s?this.replaceClass(s,i):this.addClass(i),s=i)})})()}),this},setClass(...e){return t.classList.remove(...t.classList),t.classList.add(...e),this},addReactiveClass(e){return Object.keys(e).forEach(n=>{b(()=>{e[n]()?this.addClass(n):this.removeClass(n)})}),this},removeClass(...e){return t.classList.remove(...e),this},replaceClass(e,n){return t.classList.replace(e,n),this},addEffect(e){return b(()=>e(this,this.hostElement)),this},addReactiveContent(e){return t.appendChild(J(e)),this},setReactiveContent(e){return this.clear(),t.appendChild(J(e)),this},clear(){return t.innerHTML="",this},hostElement:t}),et=(t,...e)=>({classList:[...t.map(n=>n.trim()).filter(Boolean),...e]}),Tt=(t,...e)=>et(t,...e),U=(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 i=s.slice(1);e.listeners[i]=e[s]}),n.filter(s=>s.startsWith("$")).forEach(s=>{e!=null&&e.effects||(e.effects=[]),e.effects.push(e[s])}),it(t,e.classList),ct(t,e.style),rt(t,e.attributes),lt(t,e.reactiveClassList),ot(t,e.customAttributes),st(t,e.children),nt(t,e.effects),X(t,e.listeners),X(t,e.customListeners),t},X=(t,e)=>{e&&Object.entries(e).forEach(([n,s])=>{typeof s=="function"&&t.addEventlistener(n,s)})},nt=(t,e)=>e==null?void 0:e.forEach(n=>t.addEffect(n)),st=(t,e)=>$(t,...e||[]),ot=(t,e)=>{const n=e;n&&Object.keys(n).forEach(s=>{v(n[s])?t.setReactiveCustomAttribute(s,n[s]):typeof n[s]=="function"?t.addEffect(()=>{t.setCustomAttribute(s,n[s]())}):t.setCustomAttribute(s,n[s])})},it=(t,e)=>t.addClass(...e||[]),lt=(t,e)=>t.addReactiveClass(e||{}),ct=(t,e)=>t.addStyle(e||{}),rt=(t,e)=>{const n=e,s=(i,l)=>{l&&(v(l)?t.setReactiveAttribute(i,l):typeof l=="function"?t.addEffect(()=>{t.setAttribute(i,l())}):t.setAttribute(i,l))};n&&Object.keys(n).forEach(i=>{s(i,n[i])})},$=(t,...e)=>(e.forEach(n=>{typeof n=="string"?n.trim().length>0&&t.addHtmlContent(n):v(n)?t.addReactiveContent(n):t.append(n)}),t),k=(t,e)=>{const n=document.createElement(t),s={...M(n)};return U(s,e)},P=(t,e)=>{const[n,...s]=t.split(" ").map(l=>l.trim()),i=k(n,e);return s.length>0&&i.addClass(...s),(...l)=>$(i,...l.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?g(()=>c(i)):c))},g=t=>k("div").addStyle({display:"contents"}).addEffect(e=>{const n=t(),s=[];Array.isArray(n)?s.push(...n):s.push(n),e.clear(),$(e,...s)}),jt=t=>{const e=s=>typeof s=="string"?s.trim().length>0?M(V(s)):P("div")():v(s)?M(J(s)):s;return at(()=>{const s=t();return s instanceof Array&&Array.isArray(s)?s.map(e):e(s)})},Ot=(t,e,n)=>{const s=k("div").addStyle({display:"contents"}),i=new Map,l=new Map;let c=[];const d=new Set;let a=t.peek();const h=m=>{d.delete(m),i.delete(m),l.delete(m)};return b(()=>{const m=t();c=m.map(e).map(u=>typeof u=="string"?u:u.toString());const C=Array.from(s.hostElement.children);f("containerChildren",C,c),C.forEach(u=>{const S=u.dataset.key;c.includes(S)||(f("remove element",S,u),u.remove(),h(S))}),c.forEach(u=>{var H,j;const S=m[c.indexOf(u)];i.has(u)?JSON.stringify(S)!==JSON.stringify(a[c.indexOf(u)])&&((H=s.hostElement.querySelector(`[data-key="${u}"]`))==null||H.remove(),(j=i.get(u))==null||j.set(Math.random().toString(36).substring(2,15)),l.set(u,()=>n(S,c.indexOf(u),m).setCustomAttribute("data-key",u))):(f("create new element",u,S),i.set(u,A(Math.random().toString(36).substring(2,15))),l.set(u,()=>n(S,c.indexOf(u),m).setCustomAttribute("data-key",u)))}),a=m;const y=()=>{i.forEach((u,S)=>{f("key from setTimeout foreach currItemSignalMap",S),d.has(S)||(d.add(S),b(()=>{var bt;u();const H=c.indexOf(S),j=(bt=l.get(S))==null?void 0:bt();j&&(f("call effect from setTimeout",S,j.hostElement),H<=s.hostElement.children.length-1?s.hostElement.insertBefore(j.hostElement,s.hostElement.children[H]):s.hostElement.append(j.hostElement))}))})};Promise.resolve().then(()=>y())}),s},at=t=>{let e=[k("div")],n=!1;return b(()=>{var l,c;const s=t();n=Array.isArray(s);const i=[];i.push(...[s].flat()),i.length===0&&i.push(k("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{f("newReactiveComponent.map",i.map(d=>{var a;return f("newReactiveComponent hostElement",d.hostElement),(a=d.hostElement)==null?void 0:a.id})),f("currComponent[0].hostElement?.id",(l=e[0].hostElement)==null?void 0:l.id,e),(c=e[0].hostElement)==null||c.replaceWith(...i.map(d=>d.hostElement)),e.slice(1).forEach(d=>{var a;return(a=d.hostElement)==null?void 0:a.remove()}),e=i}catch(d){console.error(d)}}),n?e:e[0]},wt=t=>Lt in t,kt=t=>{const e=P("div")().addStyle({display:"contents"}),n=s=>(e.hostElement.innerHTML=s,e);return typeof t=="string"?n(t):e.addEffect(()=>{n(t())}),e},Z=(t,e,n)=>t?g(e):n?g(n):P("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),dt=(t,e,n)=>g(()=>Z(!!t(),e,n)),It=(t,e,n)=>typeof t=="boolean"?Z(t,e,n):dt(t,e,n),Q=(t,e)=>{const n=g(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(i=>i.hostElement.style.display=s)}),n},Mt=(t,e,n)=>{const s=[Q(t,e)].flat();return n&&s.push(...[Q(()=>typeof t=="boolean"?!t:!t(),n)].flat()),g(()=>s)},ht=(t,e)=>{f("createCustomElement",t);const n=document.createElement(t),s={...M(n),setReactiveValue(i){return n instanceof T&&n.setReactiveValue(i),this},setSlotTemplate(i){const l=n.slotTemplate;return l&&Object.entries(i).forEach(([c,d])=>{l[c]=d}),this}};return U(s,e)},ut=(t,e)=>{const n=t.split(" ").slice(1).map(i=>i.trim()),s=ht(t.split(" ")[0],e);return Array.isArray(n)&&n.length>0&&s.addClass(...n),(...i)=>{R("@rcreateCustomEl content",t,i);const l=i.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!v(c)?g(()=>c(s)):c);return s.hostElement.allSlotContent=l,s.hostElement.slotContent=l.filter(L).reduce((c,d)=>{const a=d.hostElement.getAttribute("slot")||"default";return c[a]||(c[a]=[]),c[a].push(d),c},{}),s.hostElement.appendAllSlotContent=()=>$(s,...l),s}},ft=(t,e,n)=>ut(`${t.renderTagName}${e&&typeof e=="string"?" "+e:""}`,p(e)?e:e&&typeof e=="string"?n:void 0),$t=()=>{const t=()=>{};return t.oldValue=null,t},Pt=()=>({}),Ft=(t,e,n)=>{const s=e?Ct(e,n)(t):t;return(i,...l)=>{const c=[...l];return i&&!p(i)&&c.unshift(i),ft(s,p(i)?i:{})(...c)}},r={};["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=>{r[t]=(e,...n)=>{let s=[...n];return e&&!p(e)&&(s=[e].concat(s)),P(t,p(e)?e:{})(...s)}});const mt=r.div,Ht=r.span,Wt=r.section,_t=r.input,Bt=r.button,Jt=r.table,zt=r.tr,qt=r.td,Gt=r.th,Nt=r.ul,Vt=r.li,Dt=r.ol,Ut=r.form,Xt=r.label,Zt=r.select,Qt=r.option,Yt=r.textarea,Kt=r.img,xt=r.a,te=r.p,ee=r.h1,ne=r.h2,se=r.h3,oe=r.h4,ie=r.h5,le=r.h6,ce=r.br,re=r.hr,ae=r.pre,de=r.code,he=r.nav,ue=r.header,fe=r.footer,me=r.main,Ce=r.aside,be=r.article,pe=r.figure,Ee=r.figcaption,ye=r.blockquote,Se=r.cite,ve=r.small,Ae=r.strong,ge=r.em,Le=r.b,Re=r.i,Te=r.u,je=r.s,Oe=r.sub,we=r.sup,ke=r.mark,Ie=r.del,Me=r.ins,$e=r.details,Pe=r.summary,Fe=r.progress,He=r.meter,We=r.audio,_e=r.video,Be=r.canvas,Je=r.slot,ze=t=>e=>t(e).addClass(...e.classList??[]).addReactiveClass(e.reactiveClassList??{}),z="eventProps",q="EVENT_CONFIG",F="observedAttributes",qe=()=>(t,e)=>{Reflect.get(t,F)||Reflect.defineProperty(t,F,{value:[]}),Reflect.get(t,F).push(I(e))},Ge=t=>(e,n)=>{Reflect.get(e,z)||Reflect.defineProperty(e,z,{value:[]}),Reflect.get(e,q)||Reflect.defineProperty(e,q,{value:{}}),Reflect.get(e,q)[n]={bubbles:(t==null?void 0:t.bubbles)??!1,composed:(t==null?void 0:t.composed)??!1},Reflect.get(e,z).push(n)},Ct=(t,e=!1)=>n=>{f(t,"start register static attr",n.prototype[F]);const s=[];if(n.styles){const l=n.styles,c=[];Array.isArray(l)?c.push(...l):c.push(l),c.forEach(d=>{const a=new CSSStyleSheet;a.replaceSync(d),s.push(a);const h=new CSSStyleSheet;h.replaceSync(d.slice(d.indexOf("@property"))),document.adoptedStyleSheets.push(h)})}class i extends n{constructor(...c){f("constructor",`%c${t}%c`),super(e,...c),R("@osheet",s),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){f("rwc: render from new class");let c=mt();const d=()=>{f("wrapperEffectCallback"),c=n.prototype.render.call(this)};return d.fake=!0,b(d),c}attributeChangedCallback(c,d,a){f("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${d}, newValue: ${a}`,`%c${t}%c`);try{a=JSON.parse(a)}catch{}const h=Y(c);if(h in this&&v(this[h])){const m=this[h];a===null?(m.set(m.initValue),this.removeAttribute(c)):m.set(a)}W(this,n.prototype.attributeChangedCallback,c,d,a)}connectedCallback(){var d;f("rwc: connectedCallback"),f("connectedCallback",`%c${t}%c`,this),this.providers&&Object.keys(this.providers).length>0&&(f("WRAPPER for providers",t),Object.entries(this.providers).forEach(([a,h])=>{f("register provider",a,h()),this.addEventListener(a,m=>{var y;f("send provider",a,h());const C=m;((y=C.detail)==null?void 0:y.context)===a&&(C.stopPropagation(),C.detail.callback(h))})})),this.checkInjects(),(d=n.prototype[z])==null||d.forEach(a=>{this[a]=h=>{const m=n.prototype[q][a],{bubbles:C,composed:y}=m;v(h)?b(()=>{R("@oemit reactive value",h()),this.dispatchEvent(new CustomEvent(a,{detail:h(),bubbles:C,composed:y}))}):(R("@oemit value",h),this.dispatchEvent(new CustomEvent(a,{detail:h,bubbles:C,composed:y})))}}),f("start render",`%c${t}%c`,t);const c=()=>{f("rwc: insertRenderTemplate");const a=this.render();this.shadow.appendChild(a.hostElement),W(this,n.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!n.styles){const a=C=>C instanceof Promise||Array.isArray(C)&&C.every(y=>y instanceof Promise),h=this.rootStyle,m=C=>{const y=new CSSStyleSheet;y.replaceSync(C),this.shadow.adoptedStyleSheets.push(y);const u=new CSSStyleSheet;u.replaceSync(C.slice(C.indexOf("@property"))),document.adoptedStyleSheets.push(u)};if(a(h)){const C=[];Array.isArray(h)?C.push(...h):C.push(h),Promise.all(C).then(y=>y.forEach(u=>m(u.default))).then(()=>c())}else{const C=[];Array.isArray(h)?C.push(...h):C.push(h),C.forEach(y=>m(y)),c()}}else c();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(a=>{f(this.slotContext,this.slotContext&&this.slotContext[a.name]),R("@bslot element",a,`name:${a.name};`,a.assignedElements()),a.assignedElements().forEach(h=>{const m=this.slotContext[a.name];this.slotContext&&v(m)&&(R("@oslot element",a,`name:${a.name};`,a.assignedElements()),b(()=>{h.dispatchEvent(new CustomEvent("handleSlotContext",{detail:m()}))}))})})}disconnectedCallback(){this.shadow.replaceChildren(),this.replaceChildren(),W(this,n.prototype.disconnectedCallback)}}return E(i,"observedAttributes",n.prototype[F]??[]),E(i,"renderTagName",t),i.toString=()=>t,customElements.get(t)?console.error(`название тега ${t} повторяется, компонент ${n.name} не зарегистрирован`):customElements.define(t,i),n.renderTagName=t,n};o.BaseElement=T,o.a=xt,o.addAttributeList=rt,o.addClassList=it,o.addCustomAttributes=ot,o.addHtmlContent=D,o.addReactiveClassList=lt,o.addStyleList=ct,o.appendContentItem=$,o.article=be,o.aside=Ce,o.audio=We,o.b=Le,o.bindReactiveSignals=St,o.blockquote=ye,o.br=ce,o.button=Bt,o.camelToKebab=I,o.canvas=Be,o.checkCall=W,o.cite=Se,o.classList=et,o.cls=Tt,o.code=de,o.colorLog=R,o.combineLatest=At,o.component=Ct,o.createComponent=ze,o.createCustom=ft,o.createCustomEl=ut,o.createCustomElement=ht,o.createEl=P,o.createElement=k,o.createSignal=yt,o.defineSlotTemplate=Pt,o.del=Ie,o.details=$e,o.disableLogs=K,o.div=mt,o.effect=b,o.effectMap=G,o.elementHelpers=M,o.em=ge,o.enableLogs=pt,o.event=Ge,o.eventEmitter=Rt,o.figcaption=Ee,o.figure=pe,o.footer=fe,o.forkJoin=vt,o.form=Ut,o.getList=Ot,o.getReactiveTemplate=jt,o.getSignalContent=g,o.getTextContent=N,o.h1=ee,o.h2=ne,o.h3=se,o.h4=oe,o.h5=ie,o.h6=le,o.header=ue,o.hr=re,o.htmlEffectWrapper=J,o.i=Re,o.img=Kt,o.initComponent=U,o.input=_t,o.ins=Me,o.isBaseElement=gt,o.isComponentConfig=L,o.isComponentInitConfig=p,o.isReactiveSignal=v,o.isSlotTemplate=wt,o.kebabToCamel=Y,o.label=Xt,o.li=Vt,o.main=me,o.mark=ke,o.meter=He,o.nav=he,o.newEventEmitter=$t,o.ol=Dt,o.option=Qt,o.p=te,o.pre=ae,o.progress=Fe,o.projectLog=f,o.property=qe,o.renderIf=Z,o.rs=Et,o.rxRenderIf=dt,o.s=je,o.section=Wt,o.select=Zt,o.setChildren=st,o.setEffects=nt,o.setHtmlContent=tt,o.setListeners=X,o.show=Mt,o.showIf=Q,o.signal=A,o.signalComponent=at,o.slot=Je,o.small=ve,o.span=Ht,o.strong=Ae,o.sub=Oe,o.summary=Pe,o.sup=we,o.table=Jt,o.td=qt,o.textContentWrapper=V,o.textarea=Yt,o.th=Gt,o.tr=zt,o.u=Te,o.ul=Nt,o.unsafeHtml=kt,o.useCustomComponent=Ft,o.video=_e,o.when=It,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
@@ -12,7 +12,7 @@ const u = (...t) => {
12
12
  ["[rwc]", ...t].join(" | "),
13
13
  ...Array.from(t.join("").matchAll(/%c/gm)).map((e, s) => s % 2 === 0 ? "color:red" : "color:inherit")
14
14
  );
15
- }, $ = (t) => t.replace(/([A-Z])/gm, (e) => `-${e.toLowerCase()}`), tt = (t) => t.replace(/-(\w)/gm, (e, s) => s.toUpperCase()), A = (t, ...e) => {
15
+ }, $ = (t) => t.replace(/([A-Z])/gm, (e) => `-${e.toLowerCase()}`), tt = (t) => t.replace(/-(\w)/gm, (e, s) => s.toUpperCase()), L = (t, ...e) => {
16
16
  if (!F) return;
17
17
  const s = {
18
18
  r: "color: #ff0000",
@@ -31,13 +31,13 @@ const u = (...t) => {
31
31
  // orange
32
32
  w: "color: #808080"
33
33
  // gray (w for white/gray)
34
- }, n = t.match(/@[rgbpycow]/g) || [], o = n.map((l) => {
35
- const a = l.slice(1);
34
+ }, n = t.match(/@[rgbpycow]/g) || [], o = n.map((i) => {
35
+ const a = i.slice(1);
36
36
  return s[a] || "color: inherit";
37
37
  });
38
38
  let r = t;
39
- n.forEach((l) => {
40
- const a = new RegExp(`\\${l}([^\\s,]+)`, "g");
39
+ n.forEach((i) => {
40
+ const a = new RegExp(`\\${i}([^\\s,]+)`, "g");
41
41
  r = r.replace(a, "%c$1");
42
42
  }), console.log(r, ...o, ...e);
43
43
  }, vt = () => {
@@ -46,12 +46,12 @@ const u = (...t) => {
46
46
  F = !1;
47
47
  };
48
48
  et();
49
- const V = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new WeakMap(), I = [], L = [];
50
- function O(t, e) {
49
+ const V = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new WeakMap(), I = [], g = [];
50
+ function A(t, e) {
51
51
  const s = /* @__PURE__ */ new Set();
52
52
  let n = (e == null ? void 0 : e.signalCompareFn) || (() => !0);
53
53
  function o() {
54
- var l;
54
+ var i;
55
55
  const r = I[I.length - 1];
56
56
  if (r && !("fake" in r && r.fake)) {
57
57
  const a = R.get(r), c = a == null ? void 0 : a.parent;
@@ -61,7 +61,7 @@ function O(t, e) {
61
61
  s.delete(r);
62
62
  });
63
63
  }
64
- s.add(r), (l = V.get(r.effectId)) == null || l.signals.push(o);
64
+ s.add(r), (i = V.get(r.effectId)) == null || i.signals.push(o);
65
65
  }
66
66
  return t;
67
67
  }
@@ -72,22 +72,22 @@ function O(t, e) {
72
72
  }, o.peek = function() {
73
73
  return Object.freeze(t);
74
74
  }, o.initValue = Object.freeze(t), o.oldValue = Object.freeze(t), o.forceSet = function(r) {
75
- o.oldValue = Object.freeze(t), t = r, s.forEach((l) => Promise.resolve(l).then((a) => {
75
+ o.oldValue = Object.freeze(t), t = r, s.forEach((i) => Promise.resolve(i).then((a) => {
76
76
  const c = R.get(a);
77
- c && c.cleanupFns.size > 0 && (c.cleanupFns.forEach((d) => d()), c.cleanupFns.clear()), L.push(a), a(), L.pop();
77
+ c && c.cleanupFns.size > 0 && (c.cleanupFns.forEach((d) => d()), c.cleanupFns.clear()), g.push(a), a(), g.pop();
78
78
  }));
79
- }, o.set = function(r, l = n) {
80
- t !== r && l(t, r) && o.forceSet(r);
79
+ }, o.set = function(r, i = n) {
80
+ t !== r && i(t, r) && o.forceSet(r);
81
81
  }, o.update = function(r) {
82
82
  o.set(r(t));
83
- }, o.pipe = (r, l) => {
84
- const a = O(null);
83
+ }, o.pipe = (r, i) => {
84
+ const a = A(null);
85
85
  return m(() => {
86
86
  const c = o();
87
87
  m(() => {
88
88
  const d = r(c);
89
89
  d instanceof Promise ? d.then((f) => a.set(f)) : y(d) ? m(() => a.set(d())) : a.set(d);
90
- }, l);
90
+ }, i);
91
91
  }), a;
92
92
  }, o;
93
93
  }
@@ -96,48 +96,54 @@ function m(t, e) {
96
96
  u("current effect", `%c${s}%c`);
97
97
  const n = t;
98
98
  t = () => (u("current effect callback", `%c${s}%c`), n()), "fake" in n && n.fake && (t.fake = !0), t.effectId = s;
99
- const o = L[L.length - 1];
99
+ const o = g[g.length - 1];
100
100
  V.set(s, { signals: [], parent: (o == null ? void 0 : o.effectId) || null }), R.has(t) || R.set(t, { cleanupFns: /* @__PURE__ */ new Set() });
101
101
  const r = R.get(t);
102
- o ? r.parent = o : delete r.parent, L.push(t), I.push(t), t(), I.pop(), L.pop();
102
+ o ? r.parent = o : delete r.parent, g.push(t), I.push(t), t(), I.pop(), g.pop();
103
103
  }
104
104
  const y = (t) => !!t && ["object", "function"].includes(typeof t) && "set" in t && "oldValue" in t && "update" in t && "forceSet" in t;
105
105
  function At(t, ...e) {
106
- const s = O("");
106
+ const s = A("");
107
107
  return m(() => {
108
108
  const n = e.map(
109
109
  (r) => y(r) ? String(r()) : String(r)
110
110
  ), o = [t[0]];
111
- n.forEach((r, l) => {
112
- o.push(r, t[l + 1]);
111
+ n.forEach((r, i) => {
112
+ o.push(r, t[i + 1]);
113
113
  }), s.set(o.join(""));
114
114
  }), s;
115
115
  }
116
116
  function Lt(t, e) {
117
- const s = O(e ?? null), n = (o) => s.set(o);
117
+ const s = A(e ?? null), n = (o) => s.set(o);
118
118
  return t instanceof Promise ? t.then(n) : typeof t == "function" && m(() => {
119
119
  const o = t();
120
120
  o instanceof Promise ? o.then(n) : y(o) ? m(() => n(o())) : n(o);
121
121
  }), s;
122
122
  }
123
- function Rt(t, e) {
123
+ function gt(t, e) {
124
124
  let s = t(), n = e();
125
125
  m(() => {
126
126
  const o = t(), r = e();
127
127
  o !== r && (o !== s ? e.set(o) : r !== n && t.set(r)), s = o, n = r;
128
128
  });
129
129
  }
130
- function gt(...t) {
130
+ function Rt(...t) {
131
131
  let e = t.map((n) => n());
132
- const s = O(e);
132
+ const s = A(e);
133
133
  return t.forEach((n, o) => {
134
134
  m(() => {
135
- const r = () => e.filter((l) => l !== void 0).length;
135
+ const r = () => e.filter((i) => i !== void 0).length;
136
136
  r() === t.length && (e = Array.from(e).fill(void 0)), e[o] = n(), r() === t.length && s.set([...e]);
137
137
  });
138
138
  }), s;
139
139
  }
140
- class g extends HTMLElement {
140
+ const Ot = (...t) => {
141
+ const e = A([]);
142
+ return m(() => {
143
+ e.set(t.map((s) => s()));
144
+ }), e;
145
+ };
146
+ class O extends HTMLElement {
141
147
  constructor(s = !1) {
142
148
  super();
143
149
  C(this, "isSlotLazyLoading", !1);
@@ -169,7 +175,7 @@ class g extends HTMLElement {
169
175
  (s = this.appendAllSlotContent) == null || s.call(this);
170
176
  }
171
177
  inject(s) {
172
- return u("%cinject%c", s), this.injects[s] || (this.injects[s] = O(null)), this.injects[s];
178
+ return u("%cinject%c", s), this.injects[s] || (this.injects[s] = A(null)), this.injects[s];
173
179
  }
174
180
  checkInjects() {
175
181
  Object.entries(this.injects).forEach(([s, n]) => {
@@ -195,8 +201,8 @@ class g extends HTMLElement {
195
201
  this.modelValue = s;
196
202
  }
197
203
  }
198
- C(g, "observedAttributes", []), C(g, "renderTagName", ""), C(g, "styles");
199
- const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotContext", J = "onConnected", jt = () => () => {
204
+ C(O, "observedAttributes", []), C(O, "renderTagName", ""), C(O, "styles");
205
+ const jt = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotContext", J = "onConnected", Tt = () => () => {
200
206
  }, D = (t) => typeof t == "string" ? t : JSON.stringify(t), G = (t) => {
201
207
  const e = document.createElement("span");
202
208
  return e.textContent = D(t), e;
@@ -244,7 +250,7 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
244
250
  },
245
251
  setAttribute(e, s) {
246
252
  let n;
247
- if (typeof s == "boolean" && !(t instanceof g))
253
+ if (typeof s == "boolean" && !(t instanceof O))
248
254
  if (s)
249
255
  n = "";
250
256
  else {
@@ -253,7 +259,7 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
253
259
  return o in t && (t[o] = null), this;
254
260
  }
255
261
  else typeof s != "string" ? n = JSON.stringify(s) : n = s;
256
- if (t.setAttribute($(e), n), !(t instanceof g)) {
262
+ if (t.setAttribute($(e), n), !(t instanceof O)) {
257
263
  const o = e.toLowerCase();
258
264
  o in t && (t[o] = s);
259
265
  }
@@ -336,7 +342,7 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
336
342
  hostElement: t
337
343
  }), ot = (t, ...e) => ({
338
344
  classList: [...t.map((s) => s.trim()).filter(Boolean), ...e]
339
- }), Tt = (t, ...e) => ot(t, ...e), X = (t, e) => {
345
+ }), xt = (t, ...e) => ot(t, ...e), X = (t, e) => {
340
346
  if (!e) return t;
341
347
  const s = Object.keys(e || {}).filter(
342
348
  (n) => n.startsWith(".") || n.startsWith("@") || n.startsWith("$")
@@ -349,12 +355,12 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
349
355
  e.listeners[o] = e[n];
350
356
  }), s.filter((n) => n.startsWith("$")).forEach((n) => {
351
357
  e != null && e.effects || (e.effects = []), e.effects.push(e[n]);
352
- }), ct(t, e.classList), dt(t, e.style), ht(t, e.attributes), at(t, e.reactiveClassList), it(t, e.customAttributes), lt(t, e.children), rt(t, e.effects), q(t, e.listeners), q(t, e.customListeners), t;
358
+ }), ct(t, e.classList), dt(t, e.style), ht(t, e.attributes), at(t, e.reactiveClassList), lt(t, e.customAttributes), it(t, e.children), rt(t, e.effects), q(t, e.listeners), q(t, e.customListeners), t;
353
359
  }, q = (t, e) => {
354
360
  e && Object.entries(e).forEach(([s, n]) => {
355
361
  typeof n == "function" && t.addEventlistener(s, n);
356
362
  });
357
- }, rt = (t, e) => e == null ? void 0 : e.forEach((s) => t.addEffect(s)), lt = (t, e) => W(t, ...e || []), it = (t, e) => {
363
+ }, rt = (t, e) => e == null ? void 0 : e.forEach((s) => t.addEffect(s)), it = (t, e) => W(t, ...e || []), lt = (t, e) => {
358
364
  const s = e;
359
365
  s && Object.keys(s).forEach((n) => {
360
366
  y(s[n]) ? t.setReactiveCustomAttribute(n, s[n]) : typeof s[n] == "function" ? t.addEffect(() => {
@@ -382,21 +388,21 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
382
388
  return n.length > 0 && o.addClass(...n), (...r) => W(
383
389
  o,
384
390
  ...r.filter(Boolean).flat().flatMap(
385
- (l) => typeof l == "function" && !y(l) ? v(() => l(o)) : l
391
+ (i) => typeof i == "function" && !y(i) ? v(() => i(o)) : i
386
392
  )
387
393
  );
388
394
  }, v = (t) => w("div").addStyle({ display: "contents" }).addEffect((e) => {
389
395
  const s = t(), n = [];
390
396
  Array.isArray(s) ? n.push(...s) : n.push(s), e.clear(), W(e, ...n);
391
- }), xt = (t) => {
397
+ }), wt = (t) => {
392
398
  const e = (n) => typeof n == "string" ? n.trim().length > 0 ? P(G(n)) : H("div")() : y(n) ? P(z(n)) : n;
393
399
  return ut(() => {
394
400
  const n = t();
395
401
  return n instanceof Array && Array.isArray(n) ? n.map(e) : e(n);
396
402
  });
397
- }, wt = (t, e, s) => {
403
+ }, $t = (t, e, s) => {
398
404
  const n = w("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
399
- let l = [];
405
+ let i = [];
400
406
  const a = /* @__PURE__ */ new Set();
401
407
  let c = t.peek();
402
408
  const d = (f) => {
@@ -404,26 +410,26 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
404
410
  };
405
411
  return m(() => {
406
412
  const f = t();
407
- l = f.map(e).map((h) => typeof h == "string" ? h : h.toString());
413
+ i = f.map(e).map((h) => typeof h == "string" ? h : h.toString());
408
414
  const p = Array.from(n.hostElement.children);
409
- u("containerChildren", p, l), p.forEach((h) => {
415
+ u("containerChildren", p, i), p.forEach((h) => {
410
416
  const E = h.dataset.key;
411
- l.includes(E) || (u("remove element", E, h), h.remove(), d(E));
412
- }), l.forEach((h) => {
417
+ i.includes(E) || (u("remove element", E, h), h.remove(), d(E));
418
+ }), i.forEach((h) => {
413
419
  var j, S;
414
- const E = f[l.indexOf(h)];
415
- o.has(h) ? JSON.stringify(E) !== JSON.stringify(c[l.indexOf(h)]) && ((j = n.hostElement.querySelector(`[data-key="${h}"]`)) == null || j.remove(), (S = o.get(h)) == null || S.set(Math.random().toString(36).substring(2, 15)), r.set(
420
+ const E = f[i.indexOf(h)];
421
+ o.has(h) ? JSON.stringify(E) !== JSON.stringify(c[i.indexOf(h)]) && ((j = n.hostElement.querySelector(`[data-key="${h}"]`)) == null || j.remove(), (S = o.get(h)) == null || S.set(Math.random().toString(36).substring(2, 15)), r.set(
416
422
  h,
417
- () => s(E, l.indexOf(h), f).setCustomAttribute(
423
+ () => s(E, i.indexOf(h), f).setCustomAttribute(
418
424
  "data-key",
419
425
  h
420
426
  )
421
427
  )) : (u("create new element", h, E), o.set(
422
428
  h,
423
- O(Math.random().toString(36).substring(2, 15))
429
+ A(Math.random().toString(36).substring(2, 15))
424
430
  ), r.set(
425
431
  h,
426
- () => s(E, l.indexOf(h), f).setCustomAttribute(
432
+ () => s(E, i.indexOf(h), f).setCustomAttribute(
427
433
  "data-key",
428
434
  h
429
435
  )
@@ -434,7 +440,7 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
434
440
  u("key from setTimeout foreach currItemSignalMap", E), a.has(E) || (a.add(E), m(() => {
435
441
  var B;
436
442
  h();
437
- const j = l.indexOf(E), S = (B = r.get(E)) == null ? void 0 : B();
443
+ const j = i.indexOf(E), S = (B = r.get(E)) == null ? void 0 : B();
438
444
  S && (u(
439
445
  "call effect from setTimeout",
440
446
  E,
@@ -451,7 +457,7 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
451
457
  }, ut = (t) => {
452
458
  let e = [w("div")], s = !1;
453
459
  return m(() => {
454
- var r, l;
460
+ var r, i;
455
461
  const n = t();
456
462
  s = Array.isArray(n);
457
463
  const o = [];
@@ -462,7 +468,7 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
462
468
  u("newReactiveComponent.map", o.map((a) => {
463
469
  var c;
464
470
  return u("newReactiveComponent hostElement", a.hostElement), (c = a.hostElement) == null ? void 0 : c.id;
465
- })), u("currComponent[0].hostElement?.id", (r = e[0].hostElement) == null ? void 0 : r.id, e), (l = e[0].hostElement) == null || l.replaceWith(
471
+ })), u("currComponent[0].hostElement?.id", (r = e[0].hostElement) == null ? void 0 : r.id, e), (i = e[0].hostElement) == null || i.replaceWith(
466
472
  ...o.map((a) => a.hostElement)
467
473
  ), e.slice(1).forEach((a) => {
468
474
  var c;
@@ -472,18 +478,18 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
472
478
  console.error(a);
473
479
  }
474
480
  }), s ? e : e[0];
475
- }, $t = (t) => st in t, kt = (t) => {
481
+ }, kt = (t) => st in t, Mt = (t) => {
476
482
  const e = H("div")().addStyle({ display: "contents" }), s = (n) => (e.hostElement.innerHTML = n, e);
477
483
  return typeof t == "string" ? s(t) : e.addEffect(() => {
478
484
  s(t());
479
485
  }), e;
480
- }, Z = (t, e, s) => t ? v(e) : s ? v(s) : H("div")().setAttribute("id", "empty_div_renderIf").addStyle({ display: "none" }), ft = (t, e, s) => v(() => Z(!!t(), e, s)), Mt = (t, e, s) => typeof t == "boolean" ? Z(t, e, s) : ft(t, e, s), N = (t, e) => {
486
+ }, Z = (t, e, s) => t ? v(e) : s ? v(s) : H("div")().setAttribute("id", "empty_div_renderIf").addStyle({ display: "none" }), ft = (t, e, s) => v(() => Z(!!t(), e, s)), It = (t, e, s) => typeof t == "boolean" ? Z(t, e, s) : ft(t, e, s), N = (t, e) => {
481
487
  const s = v(e);
482
488
  return typeof t == "boolean" ? [s].flat().forEach((n) => n.hostElement.style.display = t ? "block" : "none") : m(() => {
483
489
  const n = t() ? "block" : "none";
484
490
  [s].flat().forEach((o) => o.hostElement.style.display = n);
485
491
  }), s;
486
- }, It = (t, e, s) => {
492
+ }, Pt = (t, e, s) => {
487
493
  const n = [N(t, e)].flat();
488
494
  return s && n.push(
489
495
  ...[N(
@@ -496,12 +502,12 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
496
502
  const s = document.createElement(t), n = {
497
503
  ...P(s),
498
504
  setReactiveValue(o) {
499
- return s instanceof g && s.setReactiveValue(o), this;
505
+ return s instanceof O && s.setReactiveValue(o), this;
500
506
  },
501
507
  setSlotTemplate(o) {
502
508
  const r = s.slotTemplate;
503
- return r && Object.entries(o).forEach(([l, a]) => {
504
- r[l] = a;
509
+ return r && Object.entries(o).forEach(([i, a]) => {
510
+ r[i] = a;
505
511
  }), this;
506
512
  }
507
513
  };
@@ -509,14 +515,14 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
509
515
  }, mt = (t, e) => {
510
516
  const s = t.split(" ").slice(1).map((o) => o.trim()), n = pt(t.split(" ")[0], e);
511
517
  return Array.isArray(s) && s.length > 0 && n.addClass(...s), (...o) => {
512
- A("@rcreateCustomEl content", t, o);
518
+ L("@rcreateCustomEl content", t, o);
513
519
  const r = o.filter(Boolean).flat().flatMap(
514
- (l) => typeof l == "function" && !y(l) ? v(() => l(n)) : l
520
+ (i) => typeof i == "function" && !y(i) ? v(() => i(n)) : i
515
521
  );
516
522
  return n.hostElement.allSlotContent = r, n.hostElement.slotContent = r.filter(K).reduce(
517
- (l, a) => {
523
+ (i, a) => {
518
524
  const c = a.hostElement.getAttribute("slot") || "default";
519
- return l[c] || (l[c] = []), l[c].push(a), l;
525
+ return i[c] || (i[c] = []), i[c].push(a), i;
520
526
  },
521
527
  {}
522
528
  ), n.hostElement.appendAllSlotContent = () => W(n, ...r), n;
@@ -524,17 +530,17 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
524
530
  }, Ct = (t, e, s) => mt(
525
531
  `${t.renderTagName}${e && typeof e == "string" ? " " + e : ""}`,
526
532
  x(e) ? e : e && typeof e == "string" ? s : void 0
527
- ), Pt = () => {
533
+ ), Ft = () => {
528
534
  const t = () => {
529
535
  };
530
536
  return t.oldValue = null, t;
531
- }, Ft = () => ({}), Wt = (t, e, s) => {
537
+ }, Wt = () => ({}), Ht = (t, e, s) => {
532
538
  const n = e ? yt(e, s)(t) : t;
533
539
  return (o, ...r) => {
534
- const l = [...r];
535
- return o && !x(o) && l.unshift(o), Ct(n, x(o) ? o : {})(...l);
540
+ const i = [...r];
541
+ return o && !x(o) && i.unshift(o), Ct(n, x(o) ? o : {})(...i);
536
542
  };
537
- }, i = {}, bt = [
543
+ }, l = {}, bt = [
538
544
  "div",
539
545
  "span",
540
546
  "section",
@@ -597,18 +603,18 @@ const Ot = (t) => "render" in t && "setReactiveValue" in t, st = "handleSlotCont
597
603
  "slot"
598
604
  ];
599
605
  bt.forEach((t) => {
600
- i[t] = (e, ...s) => {
606
+ l[t] = (e, ...s) => {
601
607
  let n = [...s];
602
608
  return e && !x(e) && (n = [e].concat(n)), H(t, x(e) ? e : {})(...n);
603
609
  };
604
610
  });
605
- const Et = i.div, Ht = i.span, _t = i.section, zt = i.input, Bt = i.button, Jt = i.table, qt = i.tr, Nt = i.td, Vt = i.th, Dt = i.ul, Gt = i.li, Ut = i.ol, Xt = i.form, Zt = i.label, Qt = i.select, Yt = i.option, Kt = i.textarea, te = i.img, ee = i.a, se = i.p, ne = i.h1, oe = i.h2, re = i.h3, le = i.h4, ie = i.h5, ce = i.h6, ae = i.br, de = i.hr, he = i.pre, ue = i.code, fe = i.nav, pe = i.header, me = i.footer, Ce = i.main, be = i.aside, Ee = i.article, ye = i.figure, Se = i.figcaption, ve = i.blockquote, Ae = i.cite, Le = i.small, Re = i.strong, ge = i.em, Oe = i.b, je = i.i, Te = i.u, xe = i.s, we = i.sub, $e = i.sup, ke = i.mark, Me = i.del, Ie = i.ins, Pe = i.details, Fe = i.summary, We = i.progress, He = i.meter, _e = i.audio, ze = i.video, Be = i.canvas, Je = i.slot, qe = (t) => (e) => t(e).addClass(...e.classList ?? []).addReactiveClass(e.reactiveClassList ?? {}), k = "eventProps", M = "EVENT_CONFIG", T = "observedAttributes", Ne = () => (t, e) => {
611
+ const Et = l.div, _t = l.span, zt = l.section, Bt = l.input, Jt = l.button, qt = l.table, Nt = l.tr, Vt = l.td, Dt = l.th, Gt = l.ul, Ut = l.li, Xt = l.ol, Zt = l.form, Qt = l.label, Yt = l.select, Kt = l.option, te = l.textarea, ee = l.img, se = l.a, ne = l.p, oe = l.h1, re = l.h2, ie = l.h3, le = l.h4, ce = l.h5, ae = l.h6, de = l.br, he = l.hr, ue = l.pre, fe = l.code, pe = l.nav, me = l.header, Ce = l.footer, be = l.main, Ee = l.aside, ye = l.article, Se = l.figure, ve = l.figcaption, Ae = l.blockquote, Le = l.cite, ge = l.small, Re = l.strong, Oe = l.em, je = l.b, Te = l.i, xe = l.u, we = l.s, $e = l.sub, ke = l.sup, Me = l.mark, Ie = l.del, Pe = l.ins, Fe = l.details, We = l.summary, He = l.progress, _e = l.meter, ze = l.audio, Be = l.video, Je = l.canvas, qe = l.slot, Ne = (t) => (e) => t(e).addClass(...e.classList ?? []).addReactiveClass(e.reactiveClassList ?? {}), k = "eventProps", M = "EVENT_CONFIG", T = "observedAttributes", Ve = () => (t, e) => {
606
612
  Reflect.get(t, T) || Reflect.defineProperty(t, T, {
607
613
  value: []
608
614
  }), Reflect.get(t, T).push(
609
615
  $(e)
610
616
  );
611
- }, Ve = (t) => (e, s) => {
617
+ }, De = (t) => (e, s) => {
612
618
  Reflect.get(e, k) || Reflect.defineProperty(e, k, {
613
619
  value: []
614
620
  }), Reflect.get(e, M) || Reflect.defineProperty(e, M, {
@@ -625,8 +631,8 @@ const Et = i.div, Ht = i.span, _t = i.section, zt = i.input, Bt = i.button, Jt =
625
631
  );
626
632
  const n = [];
627
633
  if (s.styles) {
628
- const r = s.styles, l = [];
629
- Array.isArray(r) ? l.push(...r) : l.push(r), l.forEach((a) => {
634
+ const r = s.styles, i = [];
635
+ Array.isArray(r) ? i.push(...r) : i.push(r), i.forEach((a) => {
630
636
  const c = new CSSStyleSheet();
631
637
  c.replaceSync(a), n.push(c);
632
638
  const d = new CSSStyleSheet();
@@ -634,21 +640,21 @@ const Et = i.div, Ht = i.span, _t = i.section, zt = i.input, Bt = i.button, Jt =
634
640
  });
635
641
  }
636
642
  class o extends s {
637
- constructor(...l) {
638
- u("constructor", `%c${t}%c`), super(e, ...l), A("@osheet", n), n.length > 0 && this.shadow.adoptedStyleSheets.push(...n);
643
+ constructor(...i) {
644
+ u("constructor", `%c${t}%c`), super(e, ...i), L("@osheet", n), n.length > 0 && this.shadow.adoptedStyleSheets.push(...n);
639
645
  }
640
646
  render() {
641
647
  u("rwc: render from new class");
642
- let l = Et();
648
+ let i = Et();
643
649
  const a = () => {
644
- u("wrapperEffectCallback"), l = s.prototype.render.call(this);
650
+ u("wrapperEffectCallback"), i = s.prototype.render.call(this);
645
651
  };
646
- return a.fake = !0, m(a), l;
652
+ return a.fake = !0, m(a), i;
647
653
  }
648
- attributeChangedCallback(l, a, c) {
654
+ attributeChangedCallback(i, a, c) {
649
655
  u(
650
656
  "%cAttribute has changed.%c",
651
- `%c${l}%c`,
657
+ `%c${i}%c`,
652
658
  `oldValue: ${a}, newValue: ${c}`,
653
659
  `%c${t}%c`
654
660
  );
@@ -656,15 +662,15 @@ const Et = i.div, Ht = i.span, _t = i.section, zt = i.input, Bt = i.button, Jt =
656
662
  c = JSON.parse(c);
657
663
  } catch {
658
664
  }
659
- const d = tt(l);
665
+ const d = tt(i);
660
666
  if (d in this && y(this[d])) {
661
667
  const f = this[d];
662
- c === null ? (f.set(f.initValue), this.removeAttribute(l)) : f.set(c);
668
+ c === null ? (f.set(f.initValue), this.removeAttribute(i)) : f.set(c);
663
669
  }
664
670
  _(
665
671
  this,
666
672
  s.prototype.attributeChangedCallback,
667
- l,
673
+ i,
668
674
  a,
669
675
  c
670
676
  );
@@ -685,14 +691,14 @@ const Et = i.div, Ht = i.span, _t = i.section, zt = i.input, Bt = i.button, Jt =
685
691
  this[c] = (d) => {
686
692
  const f = s.prototype[M][c], { bubbles: p, composed: b } = f;
687
693
  y(d) ? m(() => {
688
- A("@oemit reactive value", d()), this.dispatchEvent(
694
+ L("@oemit reactive value", d()), this.dispatchEvent(
689
695
  new CustomEvent(c, {
690
696
  detail: d(),
691
697
  bubbles: p,
692
698
  composed: b
693
699
  })
694
700
  );
695
- }) : (A("@oemit value", d), this.dispatchEvent(
701
+ }) : (L("@oemit value", d), this.dispatchEvent(
696
702
  new CustomEvent(c, {
697
703
  detail: d,
698
704
  bubbles: p,
@@ -702,7 +708,7 @@ const Et = i.div, Ht = i.span, _t = i.section, zt = i.input, Bt = i.button, Jt =
702
708
  };
703
709
  }
704
710
  ), u("start render", `%c${t}%c`, t);
705
- const l = () => {
711
+ const i = () => {
706
712
  u("rwc: insertRenderTemplate");
707
713
  const c = this.render();
708
714
  this.shadow.appendChild(c.hostElement), _(this, s.prototype.connectedCallback), this.appendSlotContent();
@@ -716,25 +722,25 @@ const Et = i.div, Ht = i.span, _t = i.section, zt = i.input, Bt = i.button, Jt =
716
722
  };
717
723
  if (c(d)) {
718
724
  const p = [];
719
- Array.isArray(d) ? p.push(...d) : p.push(d), Promise.all(p).then((b) => b.forEach((h) => f(h.default))).then(() => l());
725
+ Array.isArray(d) ? p.push(...d) : p.push(d), Promise.all(p).then((b) => b.forEach((h) => f(h.default))).then(() => i());
720
726
  } else {
721
727
  const p = [];
722
- Array.isArray(d) ? p.push(...d) : p.push(d), p.forEach((b) => f(b)), l();
728
+ Array.isArray(d) ? p.push(...d) : p.push(d), p.forEach((b) => f(b)), i();
723
729
  }
724
730
  } else
725
- l();
731
+ i();
726
732
  this.slotContext && Object.keys(this.slotContext).length > 0 && this.shadow.querySelectorAll("slot").forEach((c) => {
727
733
  u(
728
734
  this.slotContext,
729
735
  this.slotContext && this.slotContext[c.name]
730
- ), A(
736
+ ), L(
731
737
  "@bslot element",
732
738
  c,
733
739
  `name:${c.name};`,
734
740
  c.assignedElements()
735
741
  ), c.assignedElements().forEach((d) => {
736
742
  const f = this.slotContext[c.name];
737
- this.slotContext && y(f) && (A(
743
+ this.slotContext && y(f) && (L(
738
744
  "@oslot element",
739
745
  c,
740
746
  `name:${c.name};`,
@@ -758,125 +764,126 @@ const Et = i.div, Ht = i.span, _t = i.section, zt = i.input, Bt = i.button, Jt =
758
764
  ) : customElements.define(t, o), s.renderTagName = t, s;
759
765
  };
760
766
  export {
761
- g as BaseElement,
762
- ee as a,
767
+ O as BaseElement,
768
+ se as a,
763
769
  ht as addAttributeList,
764
770
  ct as addClassList,
765
- it as addCustomAttributes,
771
+ lt as addCustomAttributes,
766
772
  U as addHtmlContent,
767
773
  at as addReactiveClassList,
768
774
  dt as addStyleList,
769
775
  W as appendContentItem,
770
- Ee as article,
771
- be as aside,
772
- _e as audio,
773
- Oe as b,
774
- Rt as bindReactiveSignals,
775
- ve as blockquote,
776
- ae as br,
777
- Bt as button,
776
+ ye as article,
777
+ Ee as aside,
778
+ ze as audio,
779
+ je as b,
780
+ gt as bindReactiveSignals,
781
+ Ae as blockquote,
782
+ de as br,
783
+ Jt as button,
778
784
  $ as camelToKebab,
779
- Be as canvas,
785
+ Je as canvas,
780
786
  _ as checkCall,
781
- Ae as cite,
787
+ Le as cite,
782
788
  ot as classList,
783
- Tt as cls,
784
- ue as code,
785
- A as colorLog,
789
+ xt as cls,
790
+ fe as code,
791
+ L as colorLog,
792
+ Ot as combineLatest,
786
793
  yt as component,
787
- qe as createComponent,
794
+ Ne as createComponent,
788
795
  Ct as createCustom,
789
796
  mt as createCustomEl,
790
797
  pt as createCustomElement,
791
798
  H as createEl,
792
799
  w as createElement,
793
800
  Lt as createSignal,
794
- Ft as defineSlotTemplate,
795
- Me as del,
796
- Pe as details,
801
+ Wt as defineSlotTemplate,
802
+ Ie as del,
803
+ Fe as details,
797
804
  et as disableLogs,
798
805
  Et as div,
799
806
  m as effect,
800
807
  V as effectMap,
801
808
  P as elementHelpers,
802
- ge as em,
809
+ Oe as em,
803
810
  vt as enableLogs,
804
- Ve as event,
805
- jt as eventEmitter,
806
- Se as figcaption,
807
- ye as figure,
808
- me as footer,
809
- gt as forkJoin,
810
- Xt as form,
811
- wt as getList,
812
- xt as getReactiveTemplate,
811
+ De as event,
812
+ Tt as eventEmitter,
813
+ ve as figcaption,
814
+ Se as figure,
815
+ Ce as footer,
816
+ Rt as forkJoin,
817
+ Zt as form,
818
+ $t as getList,
819
+ wt as getReactiveTemplate,
813
820
  v as getSignalContent,
814
821
  D as getTextContent,
815
- ne as h1,
816
- oe as h2,
817
- re as h3,
822
+ oe as h1,
823
+ re as h2,
824
+ ie as h3,
818
825
  le as h4,
819
- ie as h5,
820
- ce as h6,
821
- pe as header,
822
- de as hr,
826
+ ce as h5,
827
+ ae as h6,
828
+ me as header,
829
+ he as hr,
823
830
  z as htmlEffectWrapper,
824
- je as i,
825
- te as img,
831
+ Te as i,
832
+ ee as img,
826
833
  X as initComponent,
827
- zt as input,
828
- Ie as ins,
829
- Ot as isBaseElement,
834
+ Bt as input,
835
+ Pe as ins,
836
+ jt as isBaseElement,
830
837
  K as isComponentConfig,
831
838
  x as isComponentInitConfig,
832
839
  y as isReactiveSignal,
833
- $t as isSlotTemplate,
840
+ kt as isSlotTemplate,
834
841
  tt as kebabToCamel,
835
- Zt as label,
836
- Gt as li,
837
- Ce as main,
838
- ke as mark,
839
- He as meter,
840
- fe as nav,
841
- Pt as newEventEmitter,
842
- Ut as ol,
843
- Yt as option,
844
- se as p,
845
- he as pre,
846
- We as progress,
842
+ Qt as label,
843
+ Ut as li,
844
+ be as main,
845
+ Me as mark,
846
+ _e as meter,
847
+ pe as nav,
848
+ Ft as newEventEmitter,
849
+ Xt as ol,
850
+ Kt as option,
851
+ ne as p,
852
+ ue as pre,
853
+ He as progress,
847
854
  u as projectLog,
848
- Ne as property,
855
+ Ve as property,
849
856
  Z as renderIf,
850
857
  At as rs,
851
858
  ft as rxRenderIf,
852
- xe as s,
853
- _t as section,
854
- Qt as select,
855
- lt as setChildren,
859
+ we as s,
860
+ zt as section,
861
+ Yt as select,
862
+ it as setChildren,
856
863
  rt as setEffects,
857
864
  nt as setHtmlContent,
858
865
  q as setListeners,
859
- It as show,
866
+ Pt as show,
860
867
  N as showIf,
861
- O as signal,
868
+ A as signal,
862
869
  ut as signalComponent,
863
- Je as slot,
864
- Le as small,
865
- Ht as span,
870
+ qe as slot,
871
+ ge as small,
872
+ _t as span,
866
873
  Re as strong,
867
- we as sub,
868
- Fe as summary,
869
- $e as sup,
870
- Jt as table,
871
- Nt as td,
874
+ $e as sub,
875
+ We as summary,
876
+ ke as sup,
877
+ qt as table,
878
+ Vt as td,
872
879
  G as textContentWrapper,
873
- Kt as textarea,
874
- Vt as th,
875
- qt as tr,
876
- Te as u,
877
- Dt as ul,
878
- kt as unsafeHtml,
879
- Wt as useCustomComponent,
880
- ze as video,
881
- Mt as when
880
+ te as textarea,
881
+ Dt as th,
882
+ Nt as tr,
883
+ xe as u,
884
+ Gt as ul,
885
+ Mt as unsafeHtml,
886
+ Ht as useCustomComponent,
887
+ Be as video,
888
+ It as when
882
889
  };
@@ -8,3 +8,4 @@ export declare function bindReactiveSignals<T>(signalA: ReactiveSignal<T>, signa
8
8
  export declare function forkJoin<T extends readonly ReactiveSignal<unknown>[]>(...signals: T): ReactiveSignal<{
9
9
  [K in keyof T]: UnwrapSignal<T[K]>;
10
10
  }>;
11
+ export declare const combineLatest: <T extends readonly ReactiveSignal<any>[]>(...signals: T) => ReactiveSignal<{ [K in keyof T]: UnwrapSignal<T[K]>; }>;