@reactive-web-components/rwc 2.60.3 → 2.61.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/main.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ComponentConfig } from './shared/types';
2
- import { BaseElement } from './shared/utils';
2
+ import { BaseElement, ReactiveSignal } from './shared/utils';
3
3
  export declare class TestComponent extends BaseElement {
4
- test: import('./shared/utils').ReactiveSignal<number>;
4
+ test: ReactiveSignal<number>;
5
5
  test1: void;
6
6
  connectedCallback(): void;
7
7
  render(): ComponentConfig<HTMLDivElement>;
@@ -11,3 +11,4 @@ export declare const debounce: <T>(fn: (...args: T[]) => void, delay: number) =>
11
11
  cancel(): void;
12
12
  };
13
13
  export declare function throttle<T extends unknown[]>(func: (...args: T) => void, delay: number): (...args: T) => void;
14
+ export declare const ddList: <Item extends Record<string, any>>(items: ReactiveSignal<Item[]>, template: (item: Item, index: number, items: Item[]) => ComponentConfig<HTMLElement>) => ComponentConfig<HTMLDivElement>;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@reactive-web-components/rwc",
3
- "version": "2.60.3",
3
+ "version": "2.61.4",
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.DiO79eYt.js",
10
- "require": "./reactive-web-component.Dgp6Cnfz.umd.cjs"
9
+ "import": "./reactive-web-component.ClOi0z2y.js",
10
+ "require": "./reactive-web-component.CDG_MV1y.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.DiO79eYt.js",
38
- "main": "./reactive-web-component.Dgp6Cnfz.umd.cjs"
37
+ "module": "./reactive-web-component.ClOi0z2y.js",
38
+ "main": "./reactive-web-component.CDG_MV1y.umd.cjs"
39
39
  }
@@ -0,0 +1,2 @@
1
+ (function(r,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(r=typeof globalThis<"u"?globalThis:r||self,y(r.ReactiveComponent={}))})(this,function(r){"use strict";var an=Object.defineProperty;var ln=(r,y,$)=>y in r?an(r,y,{enumerable:!0,configurable:!0,writable:!0,value:$}):r[y]=$;var d=(r,y,$)=>ln(r,typeof y!="symbol"?y+"":y,$);const y=e=>e&&typeof e=="object"&&("classList"in e||"attributes"in e||"customAttributes"in e||"reactiveClassList"in e||"listeners"in e||"customListeners"in e||"children"in e||"effects"in e||"style"in e||Object.keys(e).some(t=>t.startsWith(".")||t.startsWith("@")||t.startsWith("$")))&&!("hostElement"in e),$=e=>e&&typeof e=="object"&&"hostElement"in e&&"append"in e&&"set"in e&&"addStyle"in e&&"setAttribute"in e&&"addClass"in e&&"addEffect"in e&&"addReactiveContent"in e&&"setReactiveContent"in e&&"clear"in e,J=(e,t,...n)=>{t&&t.apply(e,n)};let z=!0;const p=(...e)=>{z&&console.debug(["[rwc]",...e].join(" | "),...Array.from(e.join("").matchAll(/%c/gm)).map((t,n)=>n%2===0?"color:red":"color:inherit"))},_=e=>e.replace(/([A-Z])/gm,t=>`-${t.toLowerCase()}`),nt=e=>e.replace(/-(\w)/gm,(t,n)=>n.toUpperCase()),B=(e,...t)=>{if(!z)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=e.match(/@[rgbpycow]/g)||[],o=s.map(c=>{const l=c.slice(1);return n[l]||"color: inherit"});let i=e;s.forEach(c=>{const l=new RegExp(`\\${c}([^\\s,]+)`,"g");i=i.replace(l,"%c$1")}),console.log(i,...o,...t)},It=()=>{z=!0},st=()=>{z=!1};st();const Tt=(e,t)=>{e.every(Boolean)&&t(e)},F=new Set;let q=!1;const ot=()=>{if(q=!1,F.size===0)return;const e=Array.from(F);F.clear(),e.forEach(t=>{t.status==="active"&&(G(t),T.push(t),t(),T.pop())}),F.size>0&&(q=!0,Promise.resolve().then(ot))},jt=e=>{F.add(e),q||(q=!0,Promise.resolve().then(ot))},T=[],G=e=>{var t,n,s,o;(t=e.children)==null||t.forEach(i=>{var c;return(c=i.destroy)==null?void 0:c.call(i)}),(n=e.children)==null||n.clear(),(s=e.cleanupSet)==null||s.forEach(i=>i()),(o=e.cleanupSet)==null||o.clear()};function j(e,t){let n=(t==null?void 0:t.signalCompareFn)||(()=>!0);const s=new Set;function o(){var c;const i=T[T.length-1];return i&&!i.fake&&!s.has(i)&&i.status==="active"&&(s.add(i),(c=i.cleanupSet)==null||c.add(()=>s.delete(i))),!(t!=null&&t.name)&&(i!=null&&i.effectId)&&o.setName(i.effectId),e}return o.signalId=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`,o.setName=function(i){return o.signalId=`${i}_${Math.random().toString(36).substring(2,15)}`,o},o.setCompareFn=function(i){return n=i,o},o.clearSubscribers=function(){s.clear()},o.getSubscribers=function(){return s},o.peek=function(){return Object.freeze(e)},o.initValue=Object.freeze(e),o.forceSet=function(i){e=i,s.forEach(c=>{jt(c)})},o.set=function(i,c=n){e!==i&&c(e,i)&&o.forceSet(i)},o.update=function(i){o.set(i(e))},o.pipe=(i,c)=>{c!=null&&c.name&&o.setName(c.name);const l=j(null);return S(()=>{const u=o();S(()=>{const h=i(u);h instanceof Promise?h.then(R=>l.set(R)):L(h)?S(()=>l.set(h()),{name:"pipe_effect_inner"}):l.set(h)},{name:"pipe_effect"})},{name:(c==null?void 0:c.name)||`pipe_${o.signalId}`}),l},o}function S(e,t){var i;const n=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`;p("current effect",`%c${n}%c`);const s=e;s.status="active",s.children=new Set,s.effectId=n;const o=T[T.length-1];o&&((i=o.children)==null||i.add(s),s.parent=new WeakRef(o),s.destroy=()=>{var c;G(s),(c=o.children)==null||c.delete(s),s.destroy=void 0,s.status="inactive"}),s.cleanupSet=new Set,T.push(s),s(),T.pop()}const L=e=>!!e&&["object","function"].includes(typeof e)&&"set"in e&&"update"in e&&"forceSet"in e&&"signalId"in e;function Ot(e,...t){const n=j("");return S(()=>{const s=t.map(i=>L(i)?String(i()):String(i)),o=[e[0]];s.forEach((i,c)=>{o.push(i,e[c+1])}),n.set(o.join(""))}),n}function kt(e,t){const n=j(t??null),s=o=>n.set(o);return e instanceof Promise?e.then(s):typeof e=="function"&&S(()=>{const o=e();o instanceof Promise?o.then(s):L(o)?S(()=>s(o())):s(o)}),n}function $t(e,t){let n=e(),s=t();S(()=>{const o=e(),i=t();o!==i&&(o!==n?t.set(o):i!==s&&e.set(i)),n=o,s=i})}function Mt(...e){let t=e.map(s=>s());const n=j(t);return e.forEach((s,o)=>{S(()=>{const i=()=>t.filter(c=>c!==void 0).length;i()===e.length&&(t=Array.from(t).fill(void 0)),t[o]=s(),i()===e.length&&n.set([...t])})}),n}const Wt=(...e)=>{const t=j([]);return S(()=>{t.set(e.map(n=>n()))}),t},D="eventProps",U="EVENT_CONFIG",N="observedAttributes",Ht=()=>(e,t)=>{Reflect.get(e,N)||Reflect.defineProperty(e,N,{value:[]}),Reflect.get(e,N).push(_(t))},Pt=e=>(t,n)=>{Reflect.get(t,D)||Reflect.defineProperty(t,D,{value:[]}),Reflect.get(t,U)||Reflect.defineProperty(t,U,{value:{}}),Reflect.get(t,U)[n]={bubbles:(e==null?void 0:e.bubbles)??!1,composed:(e==null?void 0:e.composed)??!1},Reflect.get(t,D).push(n)},Q=(e,t=!1)=>n=>{p(e,"start register static attr",n.prototype[N]);const s=[];if(n.styles){const i=n.styles,c=[];Array.isArray(i)?c.push(...i):c.push(i),c.forEach(l=>{const u=new CSSStyleSheet;u.replaceSync(l),s.push(u);const v=new CSSStyleSheet;v.replaceSync(l.slice(l.indexOf("@property"))),document.adoptedStyleSheets.push(v)})}class o extends n{constructor(...c){p("constructor",`%c${e}%c`),super(t,...c),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){return p("rwc: render from new class"),n.prototype.render.call(this)}attributeChangedCallback(c,l,u){p("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${l}, newValue: ${u}`,`%c${e}%c`);try{u=JSON.parse(u)}catch{}const v=nt(c);if(v in this&&L(this[v])){const h=this[v];h.setName(c),u===null?(h.set(h.initValue),this.removeAttribute(c)):h.set(u)}J(this,n.prototype.attributeChangedCallback,c,l,u)}connectedCallback(){const c=()=>{var u,v;p("rwc: connectedCallback"),p("connectedCallback",`%c${e}%c`,this),(u=this.init)==null||u.call(this),this.providers&&Object.keys(this.providers).length>0&&(p("WRAPPER for providers",e),Object.entries(this.providers).forEach(([h,E])=>{p("register provider",h,E()),this.addEventListener(h,R=>{var f;p("send provider",h,E());const C=R;((f=C.detail)==null?void 0:f.context)===h&&(C.stopPropagation(),C.detail.callback(E))})})),this.checkInjects(),(v=n.prototype[D])==null||v.forEach(h=>{this[h]=E=>{const R=n.prototype[U][h],{bubbles:C,composed:f}=R;L(E)?S(()=>{B("@oemit reactive value",E()),this.dispatchEvent(new CustomEvent(h,{detail:E(),bubbles:C,composed:f}))}):(B("@oemit value",E),this.dispatchEvent(new CustomEvent(h,{detail:E,bubbles:C,composed:f})))}}),p("start render",`%c${e}%c`,e);const l=()=>{p("rwc: insertRenderTemplate");const E=this.render().hostElement;E&&this.shadow.appendChild(E),J(this,n.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!n.styles){const h=C=>C instanceof Promise||Array.isArray(C)&&C.every(f=>f instanceof Promise),E=this.rootStyle,R=C=>{const f=new CSSStyleSheet;f.replaceSync(C),this.shadow.adoptedStyleSheets.push(f);const w=new CSSStyleSheet;w.replaceSync(C.slice(C.indexOf("@property"))),document.adoptedStyleSheets.push(w)};if(h(E)){const C=[];Array.isArray(E)?C.push(...E):C.push(E),Promise.all(C).then(f=>f.forEach(w=>R(w.default))).then(()=>l())}else{const C=[];Array.isArray(E)?C.push(...E):C.push(E),C.forEach(f=>R(f)),l()}}else l();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(h=>{p(this.slotContext,this.slotContext&&this.slotContext[h.name]),B("@bslot element",h,`name:${h.name};`,h.assignedElements()),h.assignedElements().forEach(E=>{const R=this.slotContext[h.name];this.slotContext&&L(R)&&(B("@oslot element",h,`name:${h.name};`,h.assignedElements()),S(()=>{E.dispatchEvent(new CustomEvent("handleSlotContext",{detail:R()}))}))})})};c.fake=!0,c.component=new WeakRef(this),this.effectSet.add(new WeakRef(c)),S(c,{name:"FAKE_wrapperEffect"})}disconnectedCallback(){this.allSlotContent=[],this.slotContent={},this.htmlSlotContent={},this.effectSet.forEach(c=>{var l,u;return(u=(l=c.deref())==null?void 0:l.destroy)==null?void 0:u.call(l)}),this.effectSet.clear(),this.shadow.replaceChildren(),this.replaceChildren(),J(this,n.prototype.disconnectedCallback)}}return d(o,"observedAttributes",n.prototype[N]??[]),d(o,"renderTagName",e),o.toString=()=>e,customElements.get(e)?console.error(`название тега ${e} повторяется, компонент ${n.name} не зарегистрирован`):customElements.define(e,o),n.renderTagName=e,n};class M extends HTMLElement{constructor(n=!1){super();d(this,"init");d(this,"isSlotLazyLoading",!1);d(this,"slotTemplate");d(this,"slotContext");d(this,"rootStyle");d(this,"modelValue");d(this,"providers");d(this,"effectSet",new Set);d(this,"appendAllSlotContent");d(this,"allSlotContent",[]);d(this,"slotContent",{});d(this,"htmlSlotContent",{});d(this,"shadow");d(this,"injects",{});this.shadow=this.attachShadow({mode:n?"closed":"open"})}appendChild(n,s=!0){var o;if(this.isSlotLazyLoading&&s){if(n instanceof HTMLElement){const i=n.slot||"default";this.htmlSlotContent[i]||(this.htmlSlotContent[i]=[]),(o=this.htmlSlotContent[i])==null||o.push(n)}}else return super.appendChild(n)}appendSlotContent(){var n;(n=this.appendAllSlotContent)==null||n.call(this)}inject(n){return p("%cinject%c",n),this.injects[n]||(this.injects[n]=j(null)),this.injects[n]}checkInjects(){Object.entries(this.injects).forEach(([n,s])=>{p("%cinject%c",`%c${n}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(n,{detail:{context:n,callback:o=>S(()=>{s.set(o())},{name:n})},bubbles:!0,composed:!0}))})}setReactiveValue(n){this.modelValue=n}}d(M,"observedAttributes",[]),d(M,"renderTagName",""),d(M,"styles");const _t=e=>"render"in e&&"setReactiveValue"in e,Bt="handleSlotContext",rt="onConnected",it=e=>typeof e=="string"?e:JSON.stringify(e),Ft=e=>{const t=document.createElement("span");return t.textContent=it(e),t},ct=(e,t)=>(e.appendChild(Ft(t)),e),Nt=(e,t)=>(e.replaceChildren(),ct(e,t)),at=e=>{const t=document.createElement("span");return S(()=>{const n=e();t.textContent=it(n)}),t};class lt{constructor(t){d(this,"wrapper");d(this,"keyedEffects",new Map);d(this,"append",(...t)=>(t.forEach(n=>{var o;const s=n.hostElement;s&&((o=this.hostElement)==null||o.appendChild(s),rt in s&&setTimeout(()=>{var i;(i=s.onConnected)==null||i.call(s,n,s)}))}),this));d(this,"set",(...t)=>{var s;this.clear();const n=document.createDocumentFragment();return t.forEach(o=>{const i=o.hostElement;i&&n.appendChild(i)}),(s=this.hostElement)==null||s.appendChild(n),this});d(this,"removeChild",(...t)=>(t.forEach(n=>{var s,o;if(Array.from(((s=this.hostElement)==null?void 0:s.childNodes.values())||[]).some(i=>i===n.hostElement)){const i=n.hostElement;i&&((o=this.hostElement)==null||o.removeChild(i))}}),this));d(this,"addHtmlContent",t=>{const n=this.hostElement;return n?(ct(n,t),this):this});d(this,"setHtmlContent",t=>{const n=this.hostElement;return n?(Nt(n,t),this):this});d(this,"setAttribute",(t,n)=>{var i;const s=this.hostElement;if(!s)return this;let o;if(typeof n=="boolean"&&!(s instanceof M))if(n)o="";else{this.removeAttribute(t);const c=t.toLowerCase();return c in s&&(s[c]=null),this}else typeof n!="string"?o=JSON.stringify(n):o=n;if((i=this.hostElement)==null||i.setAttribute(_(t),o),!(s instanceof M)){const c=t.toLowerCase();c in s&&(s[c]=n)}return this});d(this,"setCustomAttribute",(t,n)=>{var o;let s;return typeof n!="string"?s=JSON.stringify(n):s=n,(o=this.hostElement)==null||o.setAttribute(_(t),s),this});d(this,"setReactiveAttribute",(t,n)=>(this.addEffect(s=>{s.setAttribute(t,n())},t),this));d(this,"setReactiveCustomAttribute",(t,n)=>(this.addEffect(s=>{s.setCustomAttribute(t,n())}),this));d(this,"removeAttribute",t=>{var n;return(n=this.hostElement)==null||n.removeAttribute(_(t)),this});d(this,"addStyle",t=>{const n=this.hostElement;return n?(Object.entries(t).forEach(([s,o])=>{const i=s.startsWith("--");typeof o=="function"?this.addEffect(()=>{if(i){const c=String(o()||"");n.style.setProperty(s,c)}else n.style[s]=o()}):typeof o=="string"&&(i?n.style.setProperty(s,o):n.style[s]=o)}),this):this});d(this,"onConnected",t=>this.hostElement?(Reflect.defineProperty(this.hostElement,rt,{get(){return t}}),this):this);d(this,"addClass",(...t)=>(t.forEach(n=>{var s;typeof n=="string"?(s=this.hostElement)==null||s.classList.add(...n.split(" ").flatMap(o=>o.split(`
2
+ `)).map(o=>o.trim()).filter(Boolean)):(()=>{let o=null;this.addEffect(()=>{const i=n();i.length>0&&(o?this.replaceClass(o,i):this.addClass(i),o=i)})})()}),this));d(this,"setClass",(...t)=>{var n,s,o;return(s=this.hostElement)==null||s.classList.remove(...((n=this.hostElement)==null?void 0:n.classList)||[]),(o=this.hostElement)==null||o.classList.add(...t),this});d(this,"addReactiveClass",t=>(Object.keys(t).forEach(n=>{this.addEffect(s=>{t[n]()?s.addClass(n):s.removeClass(n)})}),this));d(this,"removeClass",(...t)=>{var n;return(n=this.hostElement)==null||n.classList.remove(...t),this});d(this,"replaceClass",(t,n)=>{var s;return(s=this.hostElement)==null||s.classList.replace(t,n),this});d(this,"addEffect",(t,n)=>{var i,c;const s=this.hostElement;if(!s)return this;const o=()=>t(this,s);if(n){const l=(i=this.keyedEffects.get(n))==null?void 0:i.deref();l&&G(l)}return(c=s.effectSet)==null||c.add(new WeakRef(o)),o.component=this.wrapper,S(o,{name:(n==null?void 0:n.toString())||s.tagName}),this});d(this,"addReactiveContent",t=>{var n;return(n=this.hostElement)==null||n.appendChild(at(t)),this});d(this,"setReactiveContent",t=>{var n;return this.clear(),(n=this.hostElement)==null||n.appendChild(at(t)),this});d(this,"clear",()=>{var t;return(t=this.hostElement)==null||t.replaceChildren(),this});this.wrapper=t;const n=t.deref();n&&(n.effectSet=new Set)}get hostElement(){return this.wrapper.deref()}addEventlistener(t,n,s=!1){var o;return(o=this.hostElement)==null||o.addEventListener(t,i=>n(i,this,this.hostElement),s),this}}class Vt extends lt{constructor(){super(...arguments);d(this,"setReactiveValue",n=>(this.hostElement instanceof M&&this.hostElement.setReactiveValue(n),this));d(this,"setSlotTemplate",n=>{var o;const s=(o=this.hostElement)==null?void 0:o.slotTemplate;return s&&Object.entries(n).forEach(([i,c])=>{s[i]=c}),this})}}const Jt=()=>()=>{},dt=e=>new Vt(new WeakRef(e)),ht=e=>new lt(new WeakRef(e)),ft=(e,...t)=>({classList:[...e.map(n=>n.trim()).filter(Boolean),...t]}),zt=(e,...t)=>ft(e,...t),Y=(e,t)=>{if(!t||!e.deref())return;const n=Object.keys(t||{}).filter(o=>o.startsWith(".")||o.startsWith("@")||o.startsWith("$"));n.filter(o=>o.startsWith(".")).forEach(o=>{t!=null&&t.attributes||(t.attributes={}),t.attributes[o.slice(1)]=t[o]}),n.filter(o=>o.startsWith("@")).forEach(o=>{t!=null&&t.listeners||(t.listeners={});const i=o.slice(1);t.listeners[i]=t[o]}),n.filter(o=>o.startsWith("$")).forEach(o=>{t!=null&&t.effects||(t.effects=[]),t.effects.push(t[o])});const s=e.deref();if(s)return Et(s,t.classList),bt(s,t.style),St(s,t.attributes),Ct(s,t.reactiveClassList),pt(s,t.customAttributes),mt(s,t.children),ut(s,t.effects),K(s,t.listeners),K(s,t.customListeners),s},K=(e,t)=>{t&&Object.entries(t).forEach(([n,s])=>{typeof s=="function"&&e.addEventlistener(n,s)})},ut=(e,t)=>t==null?void 0:t.forEach(n=>e.addEffect(n)),mt=(e,t)=>V(new WeakRef(e),...t||[])??e,pt=(e,t)=>{const n=t;n&&Object.keys(n).forEach(s=>{L(n[s])?e.setReactiveCustomAttribute(s,n[s]):typeof n[s]=="function"?e.addEffect(()=>{e.setCustomAttribute(s,n[s]())}):e.setCustomAttribute(s,n[s])})},Et=(e,t)=>e.addClass(...t||[]),Ct=(e,t)=>e.addReactiveClass(t||{}),bt=(e,t)=>e.addStyle(t||{}),St=(e,t)=>{const n=t,s=(o,i)=>{i&&(L(i)?e.setReactiveAttribute(o,i):typeof i=="function"?e.addEffect(()=>{e.setAttribute(o,i())}):e.setAttribute(o,i))};n&&Object.keys(n).forEach(o=>{s(o,n[o])})},V=(e,...t)=>{const n=e.deref();if(n)return t.forEach(s=>{typeof s=="string"?s.trim().length>0&&n.addHtmlContent(s):L(s)?n.addReactiveContent(s):n.append(s)}),n},H=(e,t)=>{const n=document.createElement(e),s=ht(n);return Y(new WeakRef(s),t)??s},X=(e,t)=>{const[n,...s]=e.split(" ").map(i=>i.trim()),o=H(n,t);return s.length>0&&o.addClass(...s),(...i)=>V(new WeakRef(o),...i.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!L(c)?O(()=>c(o)):c))??o},O=e=>{const t=`getSignalContent_${Math.random().toString(36).substring(2,15)}`;return H("div").addStyle({display:"contents"}).addEffect(n=>{n.clear(),V(new WeakRef(n),...[e()].flat())},t)},qt=(e,t,n)=>{const s=H("div").addStyle({display:"contents"}),o=new Map,i=new Map,c=new Map,l=new Map;let u=[];const v=new Set;let h=e.peek();const E=f=>{v.delete(f),o.delete(f),i.delete(f),c.delete(f),l.delete(f)},R=f=>{if(!l.has(f)){const w=u.indexOf(f);return l.set(f,w),w}return l.get(f)},C=(f,w,et)=>Array.from(et.children).indexOf(f)!==w;return S(()=>{const f=e(),w=f.map(t).map(m=>typeof m=="string"?m:m.toString()),et=new Set(w);l.clear(),w.forEach((m,b)=>{l.set(m,b)}),u=w;const Z=s.hostElement;if(!Z)return;p("containerChildren",Array.from(Z.children),u);const Lt=[];Array.from(Z.children).forEach(m=>{const b=m.dataset.key;b&&!et.has(b)&&Lt.push(m)}),Lt.forEach(m=>{const b=m.dataset.key;p("remove element",b,m),m.remove(),E(b)}),w.forEach((m,b)=>{var A;const I=f[b],P=h[b];if(!o.has(m))p("create new element",m,I),o.set(m,j(Math.random().toString(36).substring(2,15))),i.set(m,()=>n(I,b,f).setCustomAttribute("data-key",m));else if(P&&JSON.stringify(I)!==JSON.stringify(P)){const g=c.get(m);(A=o.get(m))==null||A.set(Math.random().toString(36).substring(2,15)),i.set(m,()=>n(I,b,f).setCustomAttribute("data-key",m)),g&&g.parentNode&&p("mark element for update",m)}}),h=[...f.map(m=>({...m}))];const cn=()=>{o.forEach((m,b)=>{p("key from setTimeout foreach currItemSignalMap",b),v.has(b)||(v.add(b),S(()=>{var gt;m();const I=R(b),P=(gt=i.get(b))==null?void 0:gt();if(!P||!P.hostElement)return;const A=s.hostElement,g=P.hostElement;if(!A)return;p("call effect from setTimeout",b,g);const k=c.get(b);if(k&&k.parentNode===A){if(C(k,I,A)){const W=A.children[I];W&&W!==k?A.insertBefore(k,W):W||A.appendChild(k)}g!==k&&(k.replaceWith(g),c.set(b,g))}else if(c.set(b,g),I<A.children.length){const W=A.children[I];W?A.insertBefore(g,W):A.appendChild(g)}else A.appendChild(g)}))})};Promise.resolve().then(()=>cn())}),s},Gt=e=>{let t=[H("div")],n=!1;return S(()=>{var i,c;const s=e();n=Array.isArray(s);const o=[];o.push(...[s].flat()),o.length===0&&o.push(H("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{p("newReactiveComponent.map",o.map(l=>{var u;return p("newReactiveComponent hostElement",l.hostElement),(u=l.hostElement)==null?void 0:u.id})),p("currComponent[0].hostElement?.id",(i=t[0].hostElement)==null?void 0:i.id,t),(c=t[0].hostElement)==null||c.replaceWith(...o.map(l=>l.hostElement).filter(Boolean)),t.slice(1).forEach(l=>{var u;return(u=l.hostElement)==null?void 0:u.remove()}),t=o}catch(l){console.error(l)}}),n?t:t[0]},Dt=e=>Bt in e,Ut=e=>{const t=X("div")().addStyle({display:"contents"}),n=s=>{const o=t.hostElement;return o&&(o.innerHTML=s),t};return typeof e=="string"?n(e):t.addEffect(()=>{n(e())}),t},x=(e,t,n)=>e?O(t):n?O(n):X("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),yt=(e,t,n)=>O(()=>x(!!e(),t,n)),Xt=(e,t,n)=>typeof e=="boolean"?x(e,t,n):yt(e,t,n),tt=(e,t)=>O(t).addEffect((n,s)=>{if(typeof e=="boolean")s.style.display=e?"block":"none";else{const o=e()?"block":"none";s.style.display=o}}),Zt=(e,t,n)=>{const s=[tt(e,t)].flat();return n&&s.push(...[tt(()=>typeof e=="boolean"?!e:!e(),n)].flat()),O(()=>s)},vt=(e,t)=>{p("createCustomElement",e);const n=document.createElement(e),s=dt(n);return n.init=()=>{Y(new WeakRef(s),t)},s},wt=(e,t)=>{const n=e.split(" ").slice(1).map(o=>o.trim()),s=vt(e.split(" ")[0],t);return Array.isArray(n)&&n.length>0&&s.addClass(...n),(...o)=>{const i=o.filter(Boolean).flat().flatMap(l=>typeof l=="function"&&!L(l)?O(()=>l(s)):l),c=s.hostElement;return c&&(c.allSlotContent=i,c.slotContent=i.filter($).reduce((l,u)=>{var h;const v=((h=u.hostElement)==null?void 0:h.getAttribute("slot"))||"default";return l[v]||(l[v]=[]),l[v].push(u),l},{}),c.appendAllSlotContent=()=>{V(new WeakRef(s),...i)}),s}},At=(e,t,n)=>wt(`${e.renderTagName}${t&&typeof t=="string"?" "+t:""}`,y(t)?t:t&&typeof t=="string"?n:void 0),Qt=()=>{const e=()=>{};return e.oldValue=null,e},Yt=()=>({}),Rt=(e,t,n)=>{const s=t?Q(t,n)(e):e;return(o,...i)=>{const c=[...i];return o&&!y(o)&&c.unshift(o),At(s,y(o)?o:{})(...c)}},Kt=e=>[Rt(e),(t,n)=>{Q(t,n)(e)}],a={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(e=>{a[e]=(t,...n)=>{let s=[...n];return t&&!y(t)&&(s=[t].concat(s)),X(e,y(t)?t:{})(...s)}});const xt=a.div,te=a.span,ee=a.section,ne=a.input,se=a.button,oe=a.table,re=a.tr,ie=a.td,ce=a.th,ae=a.ul,le=a.li,de=a.ol,he=a.form,fe=a.label,ue=a.select,me=a.option,pe=a.textarea,Ee=a.img,Ce=a.a,be=a.p,Se=a.h1,ye=a.h2,ve=a.h3,we=a.h4,Ae=a.h5,Re=a.h6,Le=a.br,ge=a.hr,Ie=a.pre,Te=a.code,je=a.nav,Oe=a.header,ke=a.footer,$e=a.main,Me=a.aside,We=a.article,He=a.figure,Pe=a.figcaption,_e=a.blockquote,Be=a.cite,Fe=a.small,Ne=a.strong,Ve=a.em,Je=a.b,ze=a.i,qe=a.u,Ge=a.s,De=a.sub,Ue=a.sup,Xe=a.mark,Ze=a.del,Qe=a.ins,Ye=a.details,Ke=a.summary,xe=a.progress,tn=a.meter,en=a.audio,nn=a.video,sn=a.canvas,on=a.slot,rn=e=>t=>e(t).addClass(...t.classList??[]).addReactiveClass(t.reactiveClassList??{});r.BaseElement=M,r.a=Ce,r.addAttributeList=St,r.addClassList=Et,r.addCustomAttributes=pt,r.addReactiveClassList=Ct,r.addStyleList=bt,r.appendContentItem=V,r.article=We,r.aside=Me,r.audio=en,r.b=Je,r.bindReactiveSignals=$t,r.blockquote=_e,r.br=Le,r.button=se,r.camelToKebab=_,r.canvas=sn,r.checkCall=J,r.checkRef=Tt,r.cite=Be,r.classList=ft,r.cls=zt,r.code=Te,r.colorLog=B,r.combineLatest=Wt,r.component=Q,r.configCustomComponent=Kt,r.createComponent=rn,r.createCustom=At,r.createCustomEl=wt,r.createCustomElement=vt,r.createEl=X,r.createElement=H,r.createSignal=kt,r.customElementHelpers=dt,r.defineSlotTemplate=Yt,r.del=Ze,r.details=Ye,r.disableLogs=st,r.div=xt,r.effect=S,r.elementHelpers=ht,r.em=Ve,r.enableLogs=It,r.event=Pt,r.eventEmitter=Jt,r.figcaption=Pe,r.figure=He,r.footer=ke,r.forkJoin=Mt,r.form=he,r.getList=qt,r.getSignalContent=O,r.h1=Se,r.h2=ye,r.h3=ve,r.h4=we,r.h5=Ae,r.h6=Re,r.header=Oe,r.hr=ge,r.i=ze,r.img=Ee,r.initComponent=Y,r.input=ne,r.ins=Qe,r.isBaseElement=_t,r.isComponentConfig=$,r.isComponentInitConfig=y,r.isReactiveSignal=L,r.isSlotTemplate=Dt,r.kebabToCamel=nt,r.label=fe,r.li=le,r.main=$e,r.mark=Xe,r.meter=tn,r.nav=je,r.newEventEmitter=Qt,r.ol=de,r.option=me,r.p=be,r.pre=Ie,r.progress=xe,r.projectLog=p,r.property=Ht,r.removeEffect=G,r.renderIf=x,r.rs=Ot,r.rxRenderIf=yt,r.s=Ge,r.section=ee,r.select=ue,r.setChildren=mt,r.setEffects=ut,r.setListeners=K,r.show=Zt,r.showIf=tt,r.signal=j,r.signalComponent=Gt,r.slot=on,r.small=Fe,r.span=te,r.strong=Ne,r.sub=De,r.summary=Ke,r.sup=Ue,r.table=oe,r.td=ie,r.textarea=pe,r.th=ce,r.tr=re,r.u=qe,r.ul=ae,r.unsafeHtml=Ut,r.useCustomComponent=Rt,r.video=nn,r.when=Xt,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
@@ -1,19 +1,19 @@
1
- var ct = Object.defineProperty;
2
- var it = (e, t, s) => t in e ? ct(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var l = (e, t, s) => it(e, typeof t != "symbol" ? t + "" : t, s);
4
- const W = (e) => e && typeof e == "object" && ("classList" in e || "attributes" in e || "customAttributes" in e || "reactiveClassList" in e || "listeners" in e || "customListeners" in e || "children" in e || "effects" in e || "style" in e || Object.keys(e).some(
1
+ var lt = Object.defineProperty;
2
+ var ht = (e, t, s) => t in e ? lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
+ var l = (e, t, s) => ht(e, typeof t != "symbol" ? t + "" : t, s);
4
+ const k = (e) => e && typeof e == "object" && ("classList" in e || "attributes" in e || "customAttributes" in e || "reactiveClassList" in e || "listeners" in e || "customListeners" in e || "children" in e || "effects" in e || "style" in e || Object.keys(e).some(
5
5
  (t) => t.startsWith(".") || t.startsWith("@") || t.startsWith("$")
6
- )) && !("hostElement" in e), at = (e) => e && typeof e == "object" && "hostElement" in e && "append" in e && "set" in e && "addStyle" in e && "setAttribute" in e && "addClass" in e && "addEffect" in e && "addReactiveContent" in e && "setReactiveContent" in e && "clear" in e, q = (e, t, ...s) => {
6
+ )) && !("hostElement" in e), dt = (e) => e && typeof e == "object" && "hostElement" in e && "append" in e && "set" in e && "addStyle" in e && "setAttribute" in e && "addClass" in e && "addEffect" in e && "addReactiveContent" in e && "setReactiveContent" in e && "clear" in e, D = (e, t, ...s) => {
7
7
  t && t.apply(e, s);
8
8
  };
9
- let N = !0;
9
+ let J = !0;
10
10
  const m = (...e) => {
11
- N && console.debug(
11
+ J && console.debug(
12
12
  ["[rwc]", ...e].join(" | "),
13
13
  ...Array.from(e.join("").matchAll(/%c/gm)).map((t, s) => s % 2 === 0 ? "color:red" : "color:inherit")
14
14
  );
15
- }, P = (e) => e.replace(/([A-Z])/gm, (t) => `-${t.toLowerCase()}`), lt = (e) => e.replace(/-(\w)/gm, (t, s) => s.toUpperCase()), _ = (e, ...t) => {
16
- if (!N) return;
15
+ }, F = (e) => e.replace(/([A-Z])/gm, (t) => `-${t.toLowerCase()}`), ft = (e) => e.replace(/-(\w)/gm, (t, s) => s.toUpperCase()), _ = (e, ...t) => {
16
+ if (!J) return;
17
17
  const s = {
18
18
  r: "color: #ff0000",
19
19
  // red
@@ -40,22 +40,33 @@ const m = (...e) => {
40
40
  const a = new RegExp(`\\${c}([^\\s,]+)`, "g");
41
41
  r = r.replace(a, "%c$1");
42
42
  }), console.log(r, ...o, ...t);
43
- }, $t = () => {
44
- N = !0;
45
- }, ht = () => {
46
- N = !1;
43
+ }, Ht = () => {
44
+ J = !0;
45
+ }, ut = () => {
46
+ J = !1;
47
47
  };
48
- ht();
49
- const Mt = (e, t) => {
48
+ ut();
49
+ const Pt = (e, t) => {
50
50
  e.every(Boolean) && t(e);
51
- }, j = [], z = (e) => {
51
+ }, M = /* @__PURE__ */ new Set();
52
+ let V = !1;
53
+ const et = () => {
54
+ if (V = !1, M.size === 0)
55
+ return;
56
+ const e = Array.from(M);
57
+ M.clear(), e.forEach((t) => {
58
+ t.status === "active" && (G(t), j.push(t), t(), j.pop());
59
+ }), M.size > 0 && (V = !0, Promise.resolve().then(et));
60
+ }, pt = (e) => {
61
+ M.add(e), V || (V = !0, Promise.resolve().then(et));
62
+ }, j = [], G = (e) => {
52
63
  var t, s, n, o;
53
64
  (t = e.children) == null || t.forEach((r) => {
54
65
  var c;
55
66
  return (c = r.destroy) == null ? void 0 : c.call(r);
56
67
  }), (s = e.children) == null || s.clear(), (n = e.cleanupSet) == null || n.forEach((r) => r()), (o = e.cleanupSet) == null || o.clear();
57
68
  };
58
- function g(e, t) {
69
+ function x(e, t) {
59
70
  let s = (t == null ? void 0 : t.signalCompareFn) || (() => !0);
60
71
  const n = /* @__PURE__ */ new Set();
61
72
  function o() {
@@ -75,9 +86,7 @@ function g(e, t) {
75
86
  return Object.freeze(e);
76
87
  }, o.initValue = Object.freeze(e), o.forceSet = function(r) {
77
88
  e = r, n.forEach((c) => {
78
- z(c), Promise.resolve().then(() => {
79
- j.push(c), c(), j.pop();
80
- });
89
+ pt(c);
81
90
  });
82
91
  }, o.set = function(r, c = s) {
83
92
  e !== r && c(e, r) && o.forceSet(r);
@@ -85,7 +94,7 @@ function g(e, t) {
85
94
  o.set(r(e));
86
95
  }, o.pipe = (r, c) => {
87
96
  c != null && c.name && o.setName(c.name);
88
- const a = g(null);
97
+ const a = x(null);
89
98
  return S(() => {
90
99
  const f = o();
91
100
  S(() => {
@@ -104,12 +113,12 @@ function S(e, t) {
104
113
  const o = j[j.length - 1];
105
114
  o && ((r = o.children) == null || r.add(n), n.parent = new WeakRef(o), n.destroy = () => {
106
115
  var c;
107
- z(n), (c = o.children) == null || c.delete(n), n.destroy = void 0, n.status = "inactive";
116
+ G(n), (c = o.children) == null || c.delete(n), n.destroy = void 0, n.status = "inactive";
108
117
  }), n.cleanupSet = /* @__PURE__ */ new Set(), j.push(n), n(), j.pop();
109
118
  }
110
119
  const R = (e) => !!e && ["object", "function"].includes(typeof e) && "set" in e && "update" in e && "forceSet" in e && "signalId" in e;
111
- function Wt(e, ...t) {
112
- const s = g("");
120
+ function _t(e, ...t) {
121
+ const s = x("");
113
122
  return S(() => {
114
123
  const n = t.map(
115
124
  (r) => R(r) ? String(r()) : String(r)
@@ -119,23 +128,23 @@ function Wt(e, ...t) {
119
128
  }), s.set(o.join(""));
120
129
  }), s;
121
130
  }
122
- function kt(e, t) {
123
- const s = g(t ?? null), n = (o) => s.set(o);
131
+ function Ft(e, t) {
132
+ const s = x(t ?? null), n = (o) => s.set(o);
124
133
  return e instanceof Promise ? e.then(n) : typeof e == "function" && S(() => {
125
134
  const o = e();
126
135
  o instanceof Promise ? o.then(n) : R(o) ? S(() => n(o())) : n(o);
127
136
  }), s;
128
137
  }
129
- function Ht(e, t) {
138
+ function Bt(e, t) {
130
139
  let s = e(), n = t();
131
140
  S(() => {
132
141
  const o = e(), r = t();
133
142
  o !== r && (o !== s ? t.set(o) : r !== n && e.set(r)), s = o, n = r;
134
143
  });
135
144
  }
136
- function _t(...e) {
145
+ function Nt(...e) {
137
146
  let t = e.map((n) => n());
138
- const s = g(t);
147
+ const s = x(t);
139
148
  return e.forEach((n, o) => {
140
149
  S(() => {
141
150
  const r = () => t.filter((c) => c !== void 0).length;
@@ -143,31 +152,31 @@ function _t(...e) {
143
152
  });
144
153
  }), s;
145
154
  }
146
- const Pt = (...e) => {
147
- const t = g([]);
155
+ const Vt = (...e) => {
156
+ const t = x([]);
148
157
  return S(() => {
149
158
  t.set(e.map((s) => s()));
150
159
  }), t;
151
- }, F = "eventProps", B = "EVENT_CONFIG", M = "observedAttributes", Ft = () => (e, t) => {
152
- Reflect.get(e, M) || Reflect.defineProperty(e, M, {
160
+ }, B = "eventProps", N = "EVENT_CONFIG", W = "observedAttributes", Jt = () => (e, t) => {
161
+ Reflect.get(e, W) || Reflect.defineProperty(e, W, {
153
162
  value: []
154
- }), Reflect.get(e, M).push(
155
- P(t)
163
+ }), Reflect.get(e, W).push(
164
+ F(t)
156
165
  );
157
- }, Bt = (e) => (t, s) => {
158
- Reflect.get(t, F) || Reflect.defineProperty(t, F, {
166
+ }, zt = (e) => (t, s) => {
167
+ Reflect.get(t, B) || Reflect.defineProperty(t, B, {
159
168
  value: []
160
- }), Reflect.get(t, B) || Reflect.defineProperty(t, B, {
169
+ }), Reflect.get(t, N) || Reflect.defineProperty(t, N, {
161
170
  value: {}
162
- }), Reflect.get(t, B)[s] = {
171
+ }), Reflect.get(t, N)[s] = {
163
172
  bubbles: (e == null ? void 0 : e.bubbles) ?? !1,
164
173
  composed: (e == null ? void 0 : e.composed) ?? !1
165
- }, Reflect.get(t, F).push(s);
166
- }, K = (e, t = !1) => (s) => {
174
+ }, Reflect.get(t, B).push(s);
175
+ }, st = (e, t = !1) => (s) => {
167
176
  m(
168
177
  e,
169
178
  "start register static attr",
170
- s.prototype[M]
179
+ s.prototype[W]
171
180
  );
172
181
  const n = [];
173
182
  if (s.styles) {
@@ -197,12 +206,12 @@ const Pt = (...e) => {
197
206
  f = JSON.parse(f);
198
207
  } catch {
199
208
  }
200
- const b = lt(c);
209
+ const b = ft(c);
201
210
  if (b in this && R(this[b])) {
202
211
  const h = this[b];
203
212
  h.setName(c), f === null ? (h.set(h.initValue), this.removeAttribute(c)) : h.set(f);
204
213
  }
205
- q(
214
+ D(
206
215
  this,
207
216
  s.prototype.attributeChangedCallback,
208
217
  c,
@@ -222,10 +231,10 @@ const Pt = (...e) => {
222
231
  ((d = E.detail) == null ? void 0 : d.context) === h && (E.stopPropagation(), E.detail.callback(p));
223
232
  });
224
233
  }
225
- )), this.checkInjects(), (b = s.prototype[F]) == null || b.forEach(
234
+ )), this.checkInjects(), (b = s.prototype[B]) == null || b.forEach(
226
235
  (h) => {
227
236
  this[h] = (p) => {
228
- const v = s.prototype[B][h], { bubbles: E, composed: d } = v;
237
+ const v = s.prototype[N][h], { bubbles: E, composed: d } = v;
229
238
  R(p) ? S(() => {
230
239
  _("@oemit reactive value", p()), this.dispatchEvent(
231
240
  new CustomEvent(h, {
@@ -247,7 +256,7 @@ const Pt = (...e) => {
247
256
  const a = () => {
248
257
  m("rwc: insertRenderTemplate");
249
258
  const p = this.render().hostElement;
250
- p && this.shadow.appendChild(p), q(this, s.prototype.connectedCallback), this.appendSlotContent();
259
+ p && this.shadow.appendChild(p), D(this, s.prototype.connectedCallback), this.appendSlotContent();
251
260
  };
252
261
  if (this.rootStyle && !s.styles) {
253
262
  const h = (E) => E instanceof Promise || Array.isArray(E) && E.every((d) => d instanceof Promise), p = this.rootStyle, v = (E) => {
@@ -297,10 +306,10 @@ const Pt = (...e) => {
297
306
  this.allSlotContent = [], this.slotContent = {}, this.htmlSlotContent = {}, this.effectSet.forEach((c) => {
298
307
  var a, f;
299
308
  return (f = (a = c.deref()) == null ? void 0 : a.destroy) == null ? void 0 : f.call(a);
300
- }), this.effectSet.clear(), this.shadow.replaceChildren(), this.replaceChildren(), q(this, s.prototype.disconnectedCallback);
309
+ }), this.effectSet.clear(), this.shadow.replaceChildren(), this.replaceChildren(), D(this, s.prototype.disconnectedCallback);
301
310
  }
302
311
  }
303
- return l(o, "observedAttributes", s.prototype[M] ?? []), l(o, "renderTagName", e), o.toString = () => e, customElements.get(e) ? console.error(
312
+ return l(o, "observedAttributes", s.prototype[W] ?? []), l(o, "renderTagName", e), o.toString = () => e, customElements.get(e) ? console.error(
304
313
  `название тега ${e} повторяется, компонент ${s.name} не зарегистрирован`
305
314
  ) : customElements.define(e, o), s.renderTagName = e, s;
306
315
  };
@@ -338,7 +347,7 @@ class $ extends HTMLElement {
338
347
  (s = this.appendAllSlotContent) == null || s.call(this);
339
348
  }
340
349
  inject(s) {
341
- return m("%cinject%c", s), this.injects[s] || (this.injects[s] = g(null)), this.injects[s];
350
+ return m("%cinject%c", s), this.injects[s] || (this.injects[s] = x(null)), this.injects[s];
342
351
  }
343
352
  checkInjects() {
344
353
  Object.entries(this.injects).forEach(([s, n]) => {
@@ -365,24 +374,24 @@ class $ extends HTMLElement {
365
374
  }
366
375
  }
367
376
  l($, "observedAttributes", []), l($, "renderTagName", ""), l($, "styles");
368
- const Nt = (e) => "render" in e && "setReactiveValue" in e, dt = "handleSlotContext", X = "onConnected", tt = (e) => typeof e == "string" ? e : JSON.stringify(e), ft = (e) => {
377
+ const qt = (e) => "render" in e && "setReactiveValue" in e, mt = "handleSlotContext", Q = "onConnected", nt = (e) => typeof e == "string" ? e : JSON.stringify(e), Et = (e) => {
369
378
  const t = document.createElement("span");
370
- return t.textContent = tt(e), t;
371
- }, et = (e, t) => (e.appendChild(ft(t)), e), ut = (e, t) => (e.replaceChildren(), et(e, t)), Z = (e) => {
379
+ return t.textContent = nt(e), t;
380
+ }, ot = (e, t) => (e.appendChild(Et(t)), e), Ct = (e, t) => (e.replaceChildren(), ot(e, t)), Y = (e) => {
372
381
  const t = document.createElement("span");
373
382
  return S(() => {
374
383
  const s = e();
375
- t.textContent = tt(s);
384
+ t.textContent = nt(s);
376
385
  }), t;
377
386
  };
378
- class st {
387
+ class rt {
379
388
  constructor(t) {
380
389
  l(this, "wrapper");
381
390
  l(this, "keyedEffects", /* @__PURE__ */ new Map());
382
391
  l(this, "append", (...t) => (t.forEach((s) => {
383
392
  var o;
384
393
  const n = s.hostElement;
385
- n && ((o = this.hostElement) == null || o.appendChild(n), X in n && setTimeout(() => {
394
+ n && ((o = this.hostElement) == null || o.appendChild(n), Q in n && setTimeout(() => {
386
395
  var r;
387
396
  (r = n.onConnected) == null || r.call(
388
397
  n,
@@ -411,11 +420,11 @@ class st {
411
420
  }), this));
412
421
  l(this, "addHtmlContent", (t) => {
413
422
  const s = this.hostElement;
414
- return s ? (et(s, t), this) : this;
423
+ return s ? (ot(s, t), this) : this;
415
424
  });
416
425
  l(this, "setHtmlContent", (t) => {
417
426
  const s = this.hostElement;
418
- return s ? (ut(s, t), this) : this;
427
+ return s ? (Ct(s, t), this) : this;
419
428
  });
420
429
  l(this, "setAttribute", (t, s) => {
421
430
  var r;
@@ -431,7 +440,7 @@ class st {
431
440
  return c in n && (n[c] = null), this;
432
441
  }
433
442
  else typeof s != "string" ? o = JSON.stringify(s) : o = s;
434
- if ((r = this.hostElement) == null || r.setAttribute(P(t), o), !(n instanceof $)) {
443
+ if ((r = this.hostElement) == null || r.setAttribute(F(t), o), !(n instanceof $)) {
435
444
  const c = t.toLowerCase();
436
445
  c in n && (n[c] = s);
437
446
  }
@@ -440,7 +449,7 @@ class st {
440
449
  l(this, "setCustomAttribute", (t, s) => {
441
450
  var o;
442
451
  let n;
443
- return typeof s != "string" ? n = JSON.stringify(s) : n = s, (o = this.hostElement) == null || o.setAttribute(P(t), n), this;
452
+ return typeof s != "string" ? n = JSON.stringify(s) : n = s, (o = this.hostElement) == null || o.setAttribute(F(t), n), this;
444
453
  });
445
454
  l(this, "setReactiveAttribute", (t, s) => (this.addEffect((n) => {
446
455
  n.setAttribute(t, s());
@@ -450,7 +459,7 @@ class st {
450
459
  }), this));
451
460
  l(this, "removeAttribute", (t) => {
452
461
  var s;
453
- return (s = this.hostElement) == null || s.removeAttribute(P(t)), this;
462
+ return (s = this.hostElement) == null || s.removeAttribute(F(t)), this;
454
463
  });
455
464
  l(this, "addStyle", (t) => {
456
465
  const s = this.hostElement;
@@ -465,7 +474,7 @@ class st {
465
474
  }) : typeof o == "string" && (r ? s.style.setProperty(n, o) : s.style[n] = o);
466
475
  }), this) : this;
467
476
  });
468
- l(this, "onConnected", (t) => this.hostElement ? (Reflect.defineProperty(this.hostElement, X, {
477
+ l(this, "onConnected", (t) => this.hostElement ? (Reflect.defineProperty(this.hostElement, Q, {
469
478
  get() {
470
479
  return t;
471
480
  }
@@ -507,17 +516,17 @@ class st {
507
516
  const o = () => t(this, n);
508
517
  if (s) {
509
518
  const a = (r = this.keyedEffects.get(s)) == null ? void 0 : r.deref();
510
- a && z(a);
519
+ a && G(a);
511
520
  }
512
521
  return (c = n.effectSet) == null || c.add(new WeakRef(o)), o.component = this.wrapper, S(o, { name: (s == null ? void 0 : s.toString()) || n.tagName }), this;
513
522
  });
514
523
  l(this, "addReactiveContent", (t) => {
515
524
  var s;
516
- return (s = this.hostElement) == null || s.appendChild(Z(t)), this;
525
+ return (s = this.hostElement) == null || s.appendChild(Y(t)), this;
517
526
  });
518
527
  l(this, "setReactiveContent", (t) => {
519
528
  var s;
520
- return this.clear(), (s = this.hostElement) == null || s.appendChild(Z(t)), this;
529
+ return this.clear(), (s = this.hostElement) == null || s.appendChild(Y(t)), this;
521
530
  });
522
531
  l(this, "clear", () => {
523
532
  var t;
@@ -535,7 +544,7 @@ class st {
535
544
  return (o = this.hostElement) == null || o.addEventListener(t, (r) => s(r, this, this.hostElement), n), this;
536
545
  }
537
546
  }
538
- class pt extends st {
547
+ class bt extends rt {
539
548
  constructor() {
540
549
  super(...arguments);
541
550
  l(this, "setReactiveValue", (s) => (this.hostElement instanceof $ && this.hostElement.setReactiveValue(s), this));
@@ -548,10 +557,10 @@ class pt extends st {
548
557
  });
549
558
  }
550
559
  }
551
- const Vt = () => () => {
552
- }, mt = (e) => new pt(new WeakRef(e)), Et = (e) => new st(new WeakRef(e)), Ct = (e, ...t) => ({
560
+ const Dt = () => () => {
561
+ }, St = (e) => new bt(new WeakRef(e)), yt = (e) => new rt(new WeakRef(e)), wt = (e, ...t) => ({
553
562
  classList: [...e.map((s) => s.trim()).filter(Boolean), ...t]
554
- }), Jt = (e, ...t) => Ct(e, ...t), nt = (e, t) => {
563
+ }), Gt = (e, ...t) => wt(e, ...t), ct = (e, t) => {
555
564
  if (!t || !e.deref()) return;
556
565
  const s = Object.keys(t || {}).filter(
557
566
  (o) => o.startsWith(".") || o.startsWith("@") || o.startsWith("$")
@@ -567,19 +576,19 @@ const Vt = () => () => {
567
576
  });
568
577
  const n = e.deref();
569
578
  if (n)
570
- return wt(n, t.classList), At(n, t.style), Rt(n, t.attributes), vt(n, t.reactiveClassList), yt(n, t.customAttributes), St(n, t.children), bt(n, t.effects), Q(n, t.listeners), Q(n, t.customListeners), n;
571
- }, Q = (e, t) => {
579
+ return Lt(n, t.classList), jt(n, t.style), Ot(n, t.attributes), It(n, t.reactiveClassList), Rt(n, t.customAttributes), At(n, t.children), vt(n, t.effects), K(n, t.listeners), K(n, t.customListeners), n;
580
+ }, K = (e, t) => {
572
581
  t && Object.entries(t).forEach(([s, n]) => {
573
582
  typeof n == "function" && e.addEventlistener(s, n);
574
583
  });
575
- }, bt = (e, t) => t == null ? void 0 : t.forEach((s) => e.addEffect(s)), St = (e, t) => V(new WeakRef(e), ...t || []) ?? e, yt = (e, t) => {
584
+ }, vt = (e, t) => t == null ? void 0 : t.forEach((s) => e.addEffect(s)), At = (e, t) => z(new WeakRef(e), ...t || []) ?? e, Rt = (e, t) => {
576
585
  const s = t;
577
586
  s && Object.keys(s).forEach((n) => {
578
587
  R(s[n]) ? e.setReactiveCustomAttribute(n, s[n]) : typeof s[n] == "function" ? e.addEffect(() => {
579
588
  e.setCustomAttribute(n, s[n]());
580
589
  }) : e.setCustomAttribute(n, s[n]);
581
590
  });
582
- }, wt = (e, t) => e.addClass(...t || []), vt = (e, t) => e.addReactiveClass(t || {}), At = (e, t) => e.addStyle(t || {}), Rt = (e, t) => {
591
+ }, Lt = (e, t) => e.addClass(...t || []), It = (e, t) => e.addReactiveClass(t || {}), jt = (e, t) => e.addStyle(t || {}), Ot = (e, t) => {
583
592
  const s = t, n = (o, r) => {
584
593
  r && (R(r) ? e.setReactiveAttribute(o, r) : typeof r == "function" ? e.addEffect(() => {
585
594
  e.setAttribute(o, r());
@@ -588,30 +597,30 @@ const Vt = () => () => {
588
597
  s && Object.keys(s).forEach((o) => {
589
598
  n(o, s[o]);
590
599
  });
591
- }, V = (e, ...t) => {
600
+ }, z = (e, ...t) => {
592
601
  const s = e.deref();
593
602
  if (s)
594
603
  return t.forEach((n) => {
595
604
  typeof n == "string" ? n.trim().length > 0 && s.addHtmlContent(n) : R(n) ? s.addReactiveContent(n) : s.append(n);
596
605
  }), s;
597
- }, k = (e, t) => {
598
- const s = document.createElement(e), n = Et(s);
599
- return nt(new WeakRef(n), t) ?? n;
600
- }, D = (e, t) => {
601
- const [s, ...n] = e.split(" ").map((r) => r.trim()), o = k(s, t);
602
- return n.length > 0 && o.addClass(...n), (...r) => V(
606
+ }, H = (e, t) => {
607
+ const s = document.createElement(e), n = yt(s);
608
+ return ct(new WeakRef(n), t) ?? n;
609
+ }, U = (e, t) => {
610
+ const [s, ...n] = e.split(" ").map((r) => r.trim()), o = H(s, t);
611
+ return n.length > 0 && o.addClass(...n), (...r) => z(
603
612
  new WeakRef(o),
604
613
  ...r.filter(Boolean).flat().flatMap(
605
- (c) => typeof c == "function" && !R(c) ? x(() => c(o)) : c
614
+ (c) => typeof c == "function" && !R(c) ? g(() => c(o)) : c
606
615
  )
607
616
  ) ?? o;
608
- }, x = (e) => {
617
+ }, g = (e) => {
609
618
  const t = `getSignalContent_${Math.random().toString(36).substring(2, 15)}`;
610
- return k("div").addStyle({ display: "contents" }).addEffect((s) => {
611
- s.clear(), V(new WeakRef(s), ...[e()].flat());
619
+ return H("div").addStyle({ display: "contents" }).addEffect((s) => {
620
+ s.clear(), z(new WeakRef(s), ...[e()].flat());
612
621
  }, t);
613
- }, qt = (e, t, s) => {
614
- const n = k("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
622
+ }, Ut = (e, t, s) => {
623
+ const n = H("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
615
624
  let f = [];
616
625
  const b = /* @__PURE__ */ new Set();
617
626
  let h = e.peek();
@@ -623,20 +632,20 @@ const Vt = () => () => {
623
632
  return a.set(d, y), y;
624
633
  }
625
634
  return a.get(d);
626
- }, E = (d, y, J) => Array.from(J.children).indexOf(d) !== y;
635
+ }, E = (d, y, q) => Array.from(q.children).indexOf(d) !== y;
627
636
  return S(() => {
628
- const d = e(), y = d.map(t).map((u) => typeof u == "string" ? u : u.toString()), J = new Set(y);
637
+ const d = e(), y = d.map(t).map((u) => typeof u == "string" ? u : u.toString()), q = new Set(y);
629
638
  a.clear(), y.forEach((u, C) => {
630
639
  a.set(u, C);
631
640
  }), f = y;
632
- const H = n.hostElement;
633
- if (!H) return;
634
- m("containerChildren", Array.from(H.children), f);
635
- const G = [];
636
- Array.from(H.children).forEach((u) => {
641
+ const P = n.hostElement;
642
+ if (!P) return;
643
+ m("containerChildren", Array.from(P.children), f);
644
+ const X = [];
645
+ Array.from(P.children).forEach((u) => {
637
646
  const C = u.dataset.key;
638
- C && !J.has(C) && G.push(u);
639
- }), G.forEach((u) => {
647
+ C && !q.has(C) && X.push(u);
648
+ }), X.forEach((u) => {
640
649
  const C = u.dataset.key;
641
650
  m("remove element", C, u), u.remove(), p(C);
642
651
  }), y.forEach((u, C) => {
@@ -645,7 +654,7 @@ const Vt = () => () => {
645
654
  if (!o.has(u))
646
655
  m("create new element", u, L), o.set(
647
656
  u,
648
- g(Math.random().toString(36).substring(2, 15))
657
+ x(Math.random().toString(36).substring(2, 15))
649
658
  ), r.set(
650
659
  u,
651
660
  () => s(L, C, d).setCustomAttribute("data-key", u)
@@ -658,15 +667,15 @@ const Vt = () => () => {
658
667
  ), A && A.parentNode && m("mark element for update", u);
659
668
  }
660
669
  }), h = [...d.map((u) => ({ ...u }))];
661
- const rt = () => {
670
+ const at = () => {
662
671
  o.forEach((u, C) => {
663
672
  m(
664
673
  "key from setTimeout foreach currItemSignalMap",
665
674
  C
666
675
  ), b.has(C) || (b.add(C), S(() => {
667
- var U;
676
+ var Z;
668
677
  u();
669
- const L = v(C), T = (U = r.get(C)) == null ? void 0 : U();
678
+ const L = v(C), T = (Z = r.get(C)) == null ? void 0 : Z();
670
679
  if (!T || !T.hostElement) return;
671
680
  const w = n.hostElement, A = T.hostElement;
672
681
  if (!w) return;
@@ -690,17 +699,17 @@ const Vt = () => () => {
690
699
  }));
691
700
  });
692
701
  };
693
- Promise.resolve().then(() => rt());
702
+ Promise.resolve().then(() => at());
694
703
  }), n;
695
- }, zt = (e) => {
696
- let t = [k("div")], s = !1;
704
+ }, Xt = (e) => {
705
+ let t = [H("div")], s = !1;
697
706
  return S(() => {
698
707
  var r, c;
699
708
  const n = e();
700
709
  s = Array.isArray(n);
701
710
  const o = [];
702
711
  o.push(...[n].flat()), o.length === 0 && o.push(
703
- k("div").addStyle({ display: "none" }).setAttribute("id", "empty_template")
712
+ H("div").addStyle({ display: "none" }).setAttribute("id", "empty_template")
704
713
  );
705
714
  try {
706
715
  m(
@@ -726,48 +735,48 @@ const Vt = () => () => {
726
735
  console.error(a);
727
736
  }
728
737
  }), s ? t : t[0];
729
- }, Dt = (e) => dt in e, Gt = (e) => {
730
- const t = D("div")().addStyle({ display: "contents" }), s = (n) => {
738
+ }, Zt = (e) => mt in e, Qt = (e) => {
739
+ const t = U("div")().addStyle({ display: "contents" }), s = (n) => {
731
740
  const o = t.hostElement;
732
741
  return o && (o.innerHTML = n), t;
733
742
  };
734
743
  return typeof e == "string" ? s(e) : t.addEffect(() => {
735
744
  s(e());
736
745
  }), t;
737
- }, ot = (e, t, s) => e ? x(t) : s ? x(s) : D("div")().setAttribute("id", "empty_div_renderIf").addStyle({ display: "none" }), Lt = (e, t, s) => x(
738
- () => ot(!!e(), t, s)
739
- ), Ut = (e, t, s) => typeof e == "boolean" ? ot(e, t, s) : Lt(e, t, s), Y = (e, t) => x(t).addEffect((s, n) => {
746
+ }, it = (e, t, s) => e ? g(t) : s ? g(s) : U("div")().setAttribute("id", "empty_div_renderIf").addStyle({ display: "none" }), gt = (e, t, s) => g(
747
+ () => it(!!e(), t, s)
748
+ ), Yt = (e, t, s) => typeof e == "boolean" ? it(e, t, s) : gt(e, t, s), tt = (e, t) => g(t).addEffect((s, n) => {
740
749
  if (typeof e == "boolean")
741
750
  n.style.display = e ? "block" : "none";
742
751
  else {
743
752
  const o = e() ? "block" : "none";
744
753
  n.style.display = o;
745
754
  }
746
- }), Xt = (e, t, s) => {
755
+ }), Kt = (e, t, s) => {
747
756
  const n = [
748
- Y(e, t)
757
+ tt(e, t)
749
758
  ].flat();
750
759
  return s && n.push(
751
760
  ...[
752
- Y(
761
+ tt(
753
762
  () => typeof e == "boolean" ? !e : !e(),
754
763
  s
755
764
  )
756
765
  ].flat()
757
- ), x(() => n);
758
- }, It = (e, t) => {
766
+ ), g(() => n);
767
+ }, xt = (e, t) => {
759
768
  m("createCustomElement", e);
760
- const s = document.createElement(e), n = mt(s);
769
+ const s = document.createElement(e), n = St(s);
761
770
  return s.init = () => {
762
- nt(new WeakRef(n), t);
771
+ ct(new WeakRef(n), t);
763
772
  }, n;
764
- }, jt = (e, t) => {
765
- const s = e.split(" ").slice(1).map((o) => o.trim()), n = It(e.split(" ")[0], t);
773
+ }, Tt = (e, t) => {
774
+ const s = e.split(" ").slice(1).map((o) => o.trim()), n = xt(e.split(" ")[0], t);
766
775
  return Array.isArray(s) && s.length > 0 && n.addClass(...s), (...o) => {
767
776
  const r = o.filter(Boolean).flat().flatMap(
768
- (a) => typeof a == "function" && !R(a) ? x(() => a(n)) : a
777
+ (a) => typeof a == "function" && !R(a) ? g(() => a(n)) : a
769
778
  ), c = n.hostElement;
770
- return c && (c.allSlotContent = r, c.slotContent = r.filter(at).reduce(
779
+ return c && (c.allSlotContent = r, c.slotContent = r.filter(dt).reduce(
771
780
  (a, f) => {
772
781
  var h;
773
782
  const b = ((h = f.hostElement) == null ? void 0 : h.getAttribute("slot")) || "default";
@@ -775,28 +784,28 @@ const Vt = () => () => {
775
784
  },
776
785
  {}
777
786
  ), c.appendAllSlotContent = () => {
778
- V(new WeakRef(n), ...r);
787
+ z(new WeakRef(n), ...r);
779
788
  }), n;
780
789
  };
781
- }, Ot = (e, t, s) => jt(
790
+ }, $t = (e, t, s) => Tt(
782
791
  `${e.renderTagName}${t && typeof t == "string" ? " " + t : ""}`,
783
- W(t) ? t : t && typeof t == "string" ? s : void 0
784
- ), Zt = () => {
792
+ k(t) ? t : t && typeof t == "string" ? s : void 0
793
+ ), te = () => {
785
794
  const e = () => {
786
795
  };
787
796
  return e.oldValue = null, e;
788
- }, Qt = () => ({}), xt = (e, t, s) => {
789
- const n = t ? K(t, s)(e) : e;
797
+ }, ee = () => ({}), Mt = (e, t, s) => {
798
+ const n = t ? st(t, s)(e) : e;
790
799
  return (o, ...r) => {
791
800
  const c = [...r];
792
- return o && !W(o) && c.unshift(o), Ot(n, W(o) ? o : {})(...c);
801
+ return o && !k(o) && c.unshift(o), $t(n, k(o) ? o : {})(...c);
793
802
  };
794
- }, Yt = (e) => [
795
- xt(e),
803
+ }, se = (e) => [
804
+ Mt(e),
796
805
  (t, s) => {
797
- K(t, s)(e);
806
+ st(t, s)(e);
798
807
  }
799
- ], i = {}, gt = [
808
+ ], i = {}, Wt = [
800
809
  "div",
801
810
  "span",
802
811
  "section",
@@ -858,131 +867,131 @@ const Vt = () => () => {
858
867
  "canvas",
859
868
  "slot"
860
869
  ];
861
- gt.forEach((e) => {
870
+ Wt.forEach((e) => {
862
871
  i[e] = (t, ...s) => {
863
872
  let n = [...s];
864
- return t && !W(t) && (n = [t].concat(n)), D(e, W(t) ? t : {})(...n);
873
+ return t && !k(t) && (n = [t].concat(n)), U(e, k(t) ? t : {})(...n);
865
874
  };
866
875
  });
867
- const Kt = i.div, te = i.span, ee = i.section, se = i.input, ne = i.button, oe = i.table, re = i.tr, ce = i.td, ie = i.th, ae = i.ul, le = i.li, he = i.ol, de = i.form, fe = i.label, ue = i.select, pe = i.option, me = i.textarea, Ee = i.img, Ce = i.a, be = i.p, Se = i.h1, ye = i.h2, we = i.h3, ve = i.h4, Ae = i.h5, Re = i.h6, Le = i.br, Ie = i.hr, je = i.pre, Oe = i.code, xe = i.nav, ge = i.header, Te = i.footer, $e = i.main, Me = i.aside, We = i.article, ke = i.figure, He = i.figcaption, _e = i.blockquote, Pe = i.cite, Fe = i.small, Be = i.strong, Ne = i.em, Ve = i.b, Je = i.i, qe = i.u, ze = i.s, De = i.sub, Ge = i.sup, Ue = i.mark, Xe = i.del, Ze = i.ins, Qe = i.details, Ye = i.summary, Ke = i.progress, ts = i.meter, es = i.audio, ss = i.video, ns = i.canvas, os = i.slot, rs = (e) => (t) => e(t).addClass(...t.classList ?? []).addReactiveClass(t.reactiveClassList ?? {});
876
+ const ne = i.div, oe = i.span, re = i.section, ce = i.input, ie = i.button, ae = i.table, le = i.tr, he = i.td, de = i.th, fe = i.ul, ue = i.li, pe = i.ol, me = i.form, Ee = i.label, Ce = i.select, be = i.option, Se = i.textarea, ye = i.img, we = i.a, ve = i.p, Ae = i.h1, Re = i.h2, Le = i.h3, Ie = i.h4, je = i.h5, Oe = i.h6, ge = i.br, xe = i.hr, Te = i.pre, $e = i.code, Me = i.nav, We = i.header, ke = i.footer, He = i.main, Pe = i.aside, _e = i.article, Fe = i.figure, Be = i.figcaption, Ne = i.blockquote, Ve = i.cite, Je = i.small, ze = i.strong, qe = i.em, De = i.b, Ge = i.i, Ue = i.u, Xe = i.s, Ze = i.sub, Qe = i.sup, Ye = i.mark, Ke = i.del, ts = i.ins, es = i.details, ss = i.summary, ns = i.progress, os = i.meter, rs = i.audio, cs = i.video, is = i.canvas, as = i.slot, ls = (e) => (t) => e(t).addClass(...t.classList ?? []).addReactiveClass(t.reactiveClassList ?? {});
868
877
  export {
869
878
  $ as BaseElement,
870
- Ce as a,
871
- Rt as addAttributeList,
872
- wt as addClassList,
873
- yt as addCustomAttributes,
874
- vt as addReactiveClassList,
875
- At as addStyleList,
876
- V as appendContentItem,
877
- We as article,
878
- Me as aside,
879
- es as audio,
880
- Ve as b,
881
- Ht as bindReactiveSignals,
882
- _e as blockquote,
883
- Le as br,
884
- ne as button,
885
- P as camelToKebab,
886
- ns as canvas,
887
- q as checkCall,
888
- Mt as checkRef,
889
- Pe as cite,
890
- Ct as classList,
891
- Jt as cls,
892
- Oe as code,
879
+ we as a,
880
+ Ot as addAttributeList,
881
+ Lt as addClassList,
882
+ Rt as addCustomAttributes,
883
+ It as addReactiveClassList,
884
+ jt as addStyleList,
885
+ z as appendContentItem,
886
+ _e as article,
887
+ Pe as aside,
888
+ rs as audio,
889
+ De as b,
890
+ Bt as bindReactiveSignals,
891
+ Ne as blockquote,
892
+ ge as br,
893
+ ie as button,
894
+ F as camelToKebab,
895
+ is as canvas,
896
+ D as checkCall,
897
+ Pt as checkRef,
898
+ Ve as cite,
899
+ wt as classList,
900
+ Gt as cls,
901
+ $e as code,
893
902
  _ as colorLog,
894
- Pt as combineLatest,
895
- K as component,
896
- Yt as configCustomComponent,
897
- rs as createComponent,
898
- Ot as createCustom,
899
- jt as createCustomEl,
900
- It as createCustomElement,
901
- D as createEl,
902
- k as createElement,
903
- kt as createSignal,
904
- mt as customElementHelpers,
905
- Qt as defineSlotTemplate,
906
- Xe as del,
907
- Qe as details,
908
- ht as disableLogs,
909
- Kt as div,
903
+ Vt as combineLatest,
904
+ st as component,
905
+ se as configCustomComponent,
906
+ ls as createComponent,
907
+ $t as createCustom,
908
+ Tt as createCustomEl,
909
+ xt as createCustomElement,
910
+ U as createEl,
911
+ H as createElement,
912
+ Ft as createSignal,
913
+ St as customElementHelpers,
914
+ ee as defineSlotTemplate,
915
+ Ke as del,
916
+ es as details,
917
+ ut as disableLogs,
918
+ ne as div,
910
919
  S as effect,
911
- Et as elementHelpers,
912
- Ne as em,
913
- $t as enableLogs,
914
- Bt as event,
915
- Vt as eventEmitter,
916
- He as figcaption,
917
- ke as figure,
918
- Te as footer,
919
- _t as forkJoin,
920
- de as form,
921
- qt as getList,
922
- x as getSignalContent,
923
- Se as h1,
924
- ye as h2,
925
- we as h3,
926
- ve as h4,
927
- Ae as h5,
928
- Re as h6,
929
- ge as header,
930
- Ie as hr,
931
- Je as i,
932
- Ee as img,
933
- nt as initComponent,
934
- se as input,
935
- Ze as ins,
936
- Nt as isBaseElement,
937
- at as isComponentConfig,
938
- W as isComponentInitConfig,
920
+ yt as elementHelpers,
921
+ qe as em,
922
+ Ht as enableLogs,
923
+ zt as event,
924
+ Dt as eventEmitter,
925
+ Be as figcaption,
926
+ Fe as figure,
927
+ ke as footer,
928
+ Nt as forkJoin,
929
+ me as form,
930
+ Ut as getList,
931
+ g as getSignalContent,
932
+ Ae as h1,
933
+ Re as h2,
934
+ Le as h3,
935
+ Ie as h4,
936
+ je as h5,
937
+ Oe as h6,
938
+ We as header,
939
+ xe as hr,
940
+ Ge as i,
941
+ ye as img,
942
+ ct as initComponent,
943
+ ce as input,
944
+ ts as ins,
945
+ qt as isBaseElement,
946
+ dt as isComponentConfig,
947
+ k as isComponentInitConfig,
939
948
  R as isReactiveSignal,
940
- Dt as isSlotTemplate,
941
- lt as kebabToCamel,
942
- fe as label,
943
- le as li,
944
- $e as main,
945
- Ue as mark,
946
- ts as meter,
947
- xe as nav,
948
- Zt as newEventEmitter,
949
- he as ol,
950
- pe as option,
951
- be as p,
952
- je as pre,
953
- Ke as progress,
949
+ Zt as isSlotTemplate,
950
+ ft as kebabToCamel,
951
+ Ee as label,
952
+ ue as li,
953
+ He as main,
954
+ Ye as mark,
955
+ os as meter,
956
+ Me as nav,
957
+ te as newEventEmitter,
958
+ pe as ol,
959
+ be as option,
960
+ ve as p,
961
+ Te as pre,
962
+ ns as progress,
954
963
  m as projectLog,
955
- Ft as property,
956
- z as removeEffect,
957
- ot as renderIf,
958
- Wt as rs,
959
- Lt as rxRenderIf,
960
- ze as s,
961
- ee as section,
962
- ue as select,
963
- St as setChildren,
964
- bt as setEffects,
965
- Q as setListeners,
966
- Xt as show,
967
- Y as showIf,
968
- g as signal,
969
- zt as signalComponent,
970
- os as slot,
971
- Fe as small,
972
- te as span,
973
- Be as strong,
974
- De as sub,
975
- Ye as summary,
976
- Ge as sup,
977
- oe as table,
978
- ce as td,
979
- me as textarea,
980
- ie as th,
981
- re as tr,
982
- qe as u,
983
- ae as ul,
984
- Gt as unsafeHtml,
985
- xt as useCustomComponent,
986
- ss as video,
987
- Ut as when
964
+ Jt as property,
965
+ G as removeEffect,
966
+ it as renderIf,
967
+ _t as rs,
968
+ gt as rxRenderIf,
969
+ Xe as s,
970
+ re as section,
971
+ Ce as select,
972
+ At as setChildren,
973
+ vt as setEffects,
974
+ K as setListeners,
975
+ Kt as show,
976
+ tt as showIf,
977
+ x as signal,
978
+ Xt as signalComponent,
979
+ as as slot,
980
+ Je as small,
981
+ oe as span,
982
+ ze as strong,
983
+ Ze as sub,
984
+ ss as summary,
985
+ Qe as sup,
986
+ ae as table,
987
+ he as td,
988
+ Se as textarea,
989
+ de as th,
990
+ le as tr,
991
+ Ue as u,
992
+ fe as ul,
993
+ Qt as unsafeHtml,
994
+ Mt as useCustomComponent,
995
+ cs as video,
996
+ Yt as when
988
997
  };
@@ -1,2 +0,0 @@
1
- (function(r,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(r=typeof globalThis<"u"?globalThis:r||self,y(r.ReactiveComponent={}))})(this,function(r){"use strict";var sn=Object.defineProperty;var on=(r,y,$)=>y in r?sn(r,y,{enumerable:!0,configurable:!0,writable:!0,value:$}):r[y]=$;var d=(r,y,$)=>on(r,typeof y!="symbol"?y+"":y,$);const y=n=>n&&typeof n=="object"&&("classList"in n||"attributes"in n||"customAttributes"in n||"reactiveClassList"in n||"listeners"in n||"customListeners"in n||"children"in n||"effects"in n||"style"in n||Object.keys(n).some(t=>t.startsWith(".")||t.startsWith("@")||t.startsWith("$")))&&!("hostElement"in n),$=n=>n&&typeof n=="object"&&"hostElement"in n&&"append"in n&&"set"in n&&"addStyle"in n&&"setAttribute"in n&&"addClass"in n&&"addEffect"in n&&"addReactiveContent"in n&&"setReactiveContent"in n&&"clear"in n,V=(n,t,...e)=>{t&&t.apply(n,e)};let J=!0;const p=(...n)=>{J&&console.debug(["[rwc]",...n].join(" | "),...Array.from(n.join("").matchAll(/%c/gm)).map((t,e)=>e%2===0?"color:red":"color:inherit"))},_=n=>n.replace(/([A-Z])/gm,t=>`-${t.toLowerCase()}`),tt=n=>n.replace(/-(\w)/gm,(t,e)=>e.toUpperCase()),B=(n,...t)=>{if(!J)return;const e={r:"color: #ff0000",g:"color: #00ff00",b:"color: #0000ff",y:"color: #ffff00",p:"color: #800080",c:"color: #00ffff",o:"color: #ffa500",w:"color: #808080"},s=n.match(/@[rgbpycow]/g)||[],o=s.map(c=>{const l=c.slice(1);return e[l]||"color: inherit"});let i=n;s.forEach(c=>{const l=new RegExp(`\\${c}([^\\s,]+)`,"g");i=i.replace(l,"%c$1")}),console.log(i,...o,...t)},Rt=()=>{J=!0},et=()=>{J=!1};et();const Lt=(n,t)=>{n.every(Boolean)&&t(n)},T=[],q=n=>{var t,e,s,o;(t=n.children)==null||t.forEach(i=>{var c;return(c=i.destroy)==null?void 0:c.call(i)}),(e=n.children)==null||e.clear(),(s=n.cleanupSet)==null||s.forEach(i=>i()),(o=n.cleanupSet)==null||o.clear()};function j(n,t){let e=(t==null?void 0:t.signalCompareFn)||(()=>!0);const s=new Set;function o(){var c;const i=T[T.length-1];return i&&!i.fake&&!s.has(i)&&i.status==="active"&&(s.add(i),(c=i.cleanupSet)==null||c.add(()=>s.delete(i))),!(t!=null&&t.name)&&(i!=null&&i.effectId)&&o.setName(i.effectId),n}return o.signalId=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`,o.setName=function(i){return o.signalId=`${i}_${Math.random().toString(36).substring(2,15)}`,o},o.setCompareFn=function(i){return e=i,o},o.clearSubscribers=function(){s.clear()},o.getSubscribers=function(){return s},o.peek=function(){return Object.freeze(n)},o.initValue=Object.freeze(n),o.forceSet=function(i){n=i,s.forEach(c=>{q(c),Promise.resolve().then(()=>{T.push(c),c(),T.pop()})})},o.set=function(i,c=e){n!==i&&c(n,i)&&o.forceSet(i)},o.update=function(i){o.set(i(n))},o.pipe=(i,c)=>{c!=null&&c.name&&o.setName(c.name);const l=j(null);return S(()=>{const u=o();S(()=>{const h=i(u);h instanceof Promise?h.then(R=>l.set(R)):L(h)?S(()=>l.set(h()),{name:"pipe_effect_inner"}):l.set(h)},{name:"pipe_effect"})},{name:(c==null?void 0:c.name)||`pipe_${o.signalId}`}),l},o}function S(n,t){var i;const e=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`;p("current effect",`%c${e}%c`);const s=n;s.status="active",s.children=new Set,s.effectId=e;const o=T[T.length-1];o&&((i=o.children)==null||i.add(s),s.parent=new WeakRef(o),s.destroy=()=>{var c;q(s),(c=o.children)==null||c.delete(s),s.destroy=void 0,s.status="inactive"}),s.cleanupSet=new Set,T.push(s),s(),T.pop()}const L=n=>!!n&&["object","function"].includes(typeof n)&&"set"in n&&"update"in n&&"forceSet"in n&&"signalId"in n;function gt(n,...t){const e=j("");return S(()=>{const s=t.map(i=>L(i)?String(i()):String(i)),o=[n[0]];s.forEach((i,c)=>{o.push(i,n[c+1])}),e.set(o.join(""))}),e}function It(n,t){const e=j(t??null),s=o=>e.set(o);return n instanceof Promise?n.then(s):typeof n=="function"&&S(()=>{const o=n();o instanceof Promise?o.then(s):L(o)?S(()=>s(o())):s(o)}),e}function Tt(n,t){let e=n(),s=t();S(()=>{const o=n(),i=t();o!==i&&(o!==e?t.set(o):i!==s&&n.set(i)),e=o,s=i})}function jt(...n){let t=n.map(s=>s());const e=j(t);return n.forEach((s,o)=>{S(()=>{const i=()=>t.filter(c=>c!==void 0).length;i()===n.length&&(t=Array.from(t).fill(void 0)),t[o]=s(),i()===n.length&&e.set([...t])})}),e}const Ot=(...n)=>{const t=j([]);return S(()=>{t.set(n.map(e=>e()))}),t},z="eventProps",G="EVENT_CONFIG",F="observedAttributes",kt=()=>(n,t)=>{Reflect.get(n,F)||Reflect.defineProperty(n,F,{value:[]}),Reflect.get(n,F).push(_(t))},$t=n=>(t,e)=>{Reflect.get(t,z)||Reflect.defineProperty(t,z,{value:[]}),Reflect.get(t,G)||Reflect.defineProperty(t,G,{value:{}}),Reflect.get(t,G)[e]={bubbles:(n==null?void 0:n.bubbles)??!1,composed:(n==null?void 0:n.composed)??!1},Reflect.get(t,z).push(e)},X=(n,t=!1)=>e=>{p(n,"start register static attr",e.prototype[F]);const s=[];if(e.styles){const i=e.styles,c=[];Array.isArray(i)?c.push(...i):c.push(i),c.forEach(l=>{const u=new CSSStyleSheet;u.replaceSync(l),s.push(u);const v=new CSSStyleSheet;v.replaceSync(l.slice(l.indexOf("@property"))),document.adoptedStyleSheets.push(v)})}class o extends e{constructor(...c){p("constructor",`%c${n}%c`),super(t,...c),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){return p("rwc: render from new class"),e.prototype.render.call(this)}attributeChangedCallback(c,l,u){p("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${l}, newValue: ${u}`,`%c${n}%c`);try{u=JSON.parse(u)}catch{}const v=tt(c);if(v in this&&L(this[v])){const h=this[v];h.setName(c),u===null?(h.set(h.initValue),this.removeAttribute(c)):h.set(u)}V(this,e.prototype.attributeChangedCallback,c,l,u)}connectedCallback(){const c=()=>{var u,v;p("rwc: connectedCallback"),p("connectedCallback",`%c${n}%c`,this),(u=this.init)==null||u.call(this),this.providers&&Object.keys(this.providers).length>0&&(p("WRAPPER for providers",n),Object.entries(this.providers).forEach(([h,C])=>{p("register provider",h,C()),this.addEventListener(h,R=>{var f;p("send provider",h,C());const E=R;((f=E.detail)==null?void 0:f.context)===h&&(E.stopPropagation(),E.detail.callback(C))})})),this.checkInjects(),(v=e.prototype[z])==null||v.forEach(h=>{this[h]=C=>{const R=e.prototype[G][h],{bubbles:E,composed:f}=R;L(C)?S(()=>{B("@oemit reactive value",C()),this.dispatchEvent(new CustomEvent(h,{detail:C(),bubbles:E,composed:f}))}):(B("@oemit value",C),this.dispatchEvent(new CustomEvent(h,{detail:C,bubbles:E,composed:f})))}}),p("start render",`%c${n}%c`,n);const l=()=>{p("rwc: insertRenderTemplate");const C=this.render().hostElement;C&&this.shadow.appendChild(C),V(this,e.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!e.styles){const h=E=>E instanceof Promise||Array.isArray(E)&&E.every(f=>f instanceof Promise),C=this.rootStyle,R=E=>{const f=new CSSStyleSheet;f.replaceSync(E),this.shadow.adoptedStyleSheets.push(f);const w=new CSSStyleSheet;w.replaceSync(E.slice(E.indexOf("@property"))),document.adoptedStyleSheets.push(w)};if(h(C)){const E=[];Array.isArray(C)?E.push(...C):E.push(C),Promise.all(E).then(f=>f.forEach(w=>R(w.default))).then(()=>l())}else{const E=[];Array.isArray(C)?E.push(...C):E.push(C),E.forEach(f=>R(f)),l()}}else l();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(h=>{p(this.slotContext,this.slotContext&&this.slotContext[h.name]),B("@bslot element",h,`name:${h.name};`,h.assignedElements()),h.assignedElements().forEach(C=>{const R=this.slotContext[h.name];this.slotContext&&L(R)&&(B("@oslot element",h,`name:${h.name};`,h.assignedElements()),S(()=>{C.dispatchEvent(new CustomEvent("handleSlotContext",{detail:R()}))}))})})};c.fake=!0,c.component=new WeakRef(this),this.effectSet.add(new WeakRef(c)),S(c,{name:"FAKE_wrapperEffect"})}disconnectedCallback(){this.allSlotContent=[],this.slotContent={},this.htmlSlotContent={},this.effectSet.forEach(c=>{var l,u;return(u=(l=c.deref())==null?void 0:l.destroy)==null?void 0:u.call(l)}),this.effectSet.clear(),this.shadow.replaceChildren(),this.replaceChildren(),V(this,e.prototype.disconnectedCallback)}}return d(o,"observedAttributes",e.prototype[F]??[]),d(o,"renderTagName",n),o.toString=()=>n,customElements.get(n)?console.error(`название тега ${n} повторяется, компонент ${e.name} не зарегистрирован`):customElements.define(n,o),e.renderTagName=n,e};class M extends HTMLElement{constructor(e=!1){super();d(this,"init");d(this,"isSlotLazyLoading",!1);d(this,"slotTemplate");d(this,"slotContext");d(this,"rootStyle");d(this,"modelValue");d(this,"providers");d(this,"effectSet",new Set);d(this,"appendAllSlotContent");d(this,"allSlotContent",[]);d(this,"slotContent",{});d(this,"htmlSlotContent",{});d(this,"shadow");d(this,"injects",{});this.shadow=this.attachShadow({mode:e?"closed":"open"})}appendChild(e,s=!0){var o;if(this.isSlotLazyLoading&&s){if(e instanceof HTMLElement){const i=e.slot||"default";this.htmlSlotContent[i]||(this.htmlSlotContent[i]=[]),(o=this.htmlSlotContent[i])==null||o.push(e)}}else return super.appendChild(e)}appendSlotContent(){var e;(e=this.appendAllSlotContent)==null||e.call(this)}inject(e){return p("%cinject%c",e),this.injects[e]||(this.injects[e]=j(null)),this.injects[e]}checkInjects(){Object.entries(this.injects).forEach(([e,s])=>{p("%cinject%c",`%c${e}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(e,{detail:{context:e,callback:o=>S(()=>{s.set(o())},{name:e})},bubbles:!0,composed:!0}))})}setReactiveValue(e){this.modelValue=e}}d(M,"observedAttributes",[]),d(M,"renderTagName",""),d(M,"styles");const Mt=n=>"render"in n&&"setReactiveValue"in n,Wt="handleSlotContext",nt="onConnected",st=n=>typeof n=="string"?n:JSON.stringify(n),Ht=n=>{const t=document.createElement("span");return t.textContent=st(n),t},ot=(n,t)=>(n.appendChild(Ht(t)),n),Pt=(n,t)=>(n.replaceChildren(),ot(n,t)),rt=n=>{const t=document.createElement("span");return S(()=>{const e=n();t.textContent=st(e)}),t};class it{constructor(t){d(this,"wrapper");d(this,"keyedEffects",new Map);d(this,"append",(...t)=>(t.forEach(e=>{var o;const s=e.hostElement;s&&((o=this.hostElement)==null||o.appendChild(s),nt in s&&setTimeout(()=>{var i;(i=s.onConnected)==null||i.call(s,e,s)}))}),this));d(this,"set",(...t)=>{var s;this.clear();const e=document.createDocumentFragment();return t.forEach(o=>{const i=o.hostElement;i&&e.appendChild(i)}),(s=this.hostElement)==null||s.appendChild(e),this});d(this,"removeChild",(...t)=>(t.forEach(e=>{var s,o;if(Array.from(((s=this.hostElement)==null?void 0:s.childNodes.values())||[]).some(i=>i===e.hostElement)){const i=e.hostElement;i&&((o=this.hostElement)==null||o.removeChild(i))}}),this));d(this,"addHtmlContent",t=>{const e=this.hostElement;return e?(ot(e,t),this):this});d(this,"setHtmlContent",t=>{const e=this.hostElement;return e?(Pt(e,t),this):this});d(this,"setAttribute",(t,e)=>{var i;const s=this.hostElement;if(!s)return this;let o;if(typeof e=="boolean"&&!(s instanceof M))if(e)o="";else{this.removeAttribute(t);const c=t.toLowerCase();return c in s&&(s[c]=null),this}else typeof e!="string"?o=JSON.stringify(e):o=e;if((i=this.hostElement)==null||i.setAttribute(_(t),o),!(s instanceof M)){const c=t.toLowerCase();c in s&&(s[c]=e)}return this});d(this,"setCustomAttribute",(t,e)=>{var o;let s;return typeof e!="string"?s=JSON.stringify(e):s=e,(o=this.hostElement)==null||o.setAttribute(_(t),s),this});d(this,"setReactiveAttribute",(t,e)=>(this.addEffect(s=>{s.setAttribute(t,e())},t),this));d(this,"setReactiveCustomAttribute",(t,e)=>(this.addEffect(s=>{s.setCustomAttribute(t,e())}),this));d(this,"removeAttribute",t=>{var e;return(e=this.hostElement)==null||e.removeAttribute(_(t)),this});d(this,"addStyle",t=>{const e=this.hostElement;return e?(Object.entries(t).forEach(([s,o])=>{const i=s.startsWith("--");typeof o=="function"?this.addEffect(()=>{if(i){const c=String(o()||"");e.style.setProperty(s,c)}else e.style[s]=o()}):typeof o=="string"&&(i?e.style.setProperty(s,o):e.style[s]=o)}),this):this});d(this,"onConnected",t=>this.hostElement?(Reflect.defineProperty(this.hostElement,nt,{get(){return t}}),this):this);d(this,"addClass",(...t)=>(t.forEach(e=>{var s;typeof e=="string"?(s=this.hostElement)==null||s.classList.add(...e.split(" ").flatMap(o=>o.split(`
2
- `)).map(o=>o.trim()).filter(Boolean)):(()=>{let o=null;this.addEffect(()=>{const i=e();i.length>0&&(o?this.replaceClass(o,i):this.addClass(i),o=i)})})()}),this));d(this,"setClass",(...t)=>{var e,s,o;return(s=this.hostElement)==null||s.classList.remove(...((e=this.hostElement)==null?void 0:e.classList)||[]),(o=this.hostElement)==null||o.classList.add(...t),this});d(this,"addReactiveClass",t=>(Object.keys(t).forEach(e=>{this.addEffect(s=>{t[e]()?s.addClass(e):s.removeClass(e)})}),this));d(this,"removeClass",(...t)=>{var e;return(e=this.hostElement)==null||e.classList.remove(...t),this});d(this,"replaceClass",(t,e)=>{var s;return(s=this.hostElement)==null||s.classList.replace(t,e),this});d(this,"addEffect",(t,e)=>{var i,c;const s=this.hostElement;if(!s)return this;const o=()=>t(this,s);if(e){const l=(i=this.keyedEffects.get(e))==null?void 0:i.deref();l&&q(l)}return(c=s.effectSet)==null||c.add(new WeakRef(o)),o.component=this.wrapper,S(o,{name:(e==null?void 0:e.toString())||s.tagName}),this});d(this,"addReactiveContent",t=>{var e;return(e=this.hostElement)==null||e.appendChild(rt(t)),this});d(this,"setReactiveContent",t=>{var e;return this.clear(),(e=this.hostElement)==null||e.appendChild(rt(t)),this});d(this,"clear",()=>{var t;return(t=this.hostElement)==null||t.replaceChildren(),this});this.wrapper=t;const e=t.deref();e&&(e.effectSet=new Set)}get hostElement(){return this.wrapper.deref()}addEventlistener(t,e,s=!1){var o;return(o=this.hostElement)==null||o.addEventListener(t,i=>e(i,this,this.hostElement),s),this}}class _t extends it{constructor(){super(...arguments);d(this,"setReactiveValue",e=>(this.hostElement instanceof M&&this.hostElement.setReactiveValue(e),this));d(this,"setSlotTemplate",e=>{var o;const s=(o=this.hostElement)==null?void 0:o.slotTemplate;return s&&Object.entries(e).forEach(([i,c])=>{s[i]=c}),this})}}const Bt=()=>()=>{},ct=n=>new _t(new WeakRef(n)),at=n=>new it(new WeakRef(n)),lt=(n,...t)=>({classList:[...n.map(e=>e.trim()).filter(Boolean),...t]}),Ft=(n,...t)=>lt(n,...t),Z=(n,t)=>{if(!t||!n.deref())return;const e=Object.keys(t||{}).filter(o=>o.startsWith(".")||o.startsWith("@")||o.startsWith("$"));e.filter(o=>o.startsWith(".")).forEach(o=>{t!=null&&t.attributes||(t.attributes={}),t.attributes[o.slice(1)]=t[o]}),e.filter(o=>o.startsWith("@")).forEach(o=>{t!=null&&t.listeners||(t.listeners={});const i=o.slice(1);t.listeners[i]=t[o]}),e.filter(o=>o.startsWith("$")).forEach(o=>{t!=null&&t.effects||(t.effects=[]),t.effects.push(t[o])});const s=n.deref();if(s)return ut(s,t.classList),pt(s,t.style),Ct(s,t.attributes),mt(s,t.reactiveClassList),ft(s,t.customAttributes),ht(s,t.children),dt(s,t.effects),Q(s,t.listeners),Q(s,t.customListeners),s},Q=(n,t)=>{t&&Object.entries(t).forEach(([e,s])=>{typeof s=="function"&&n.addEventlistener(e,s)})},dt=(n,t)=>t==null?void 0:t.forEach(e=>n.addEffect(e)),ht=(n,t)=>N(new WeakRef(n),...t||[])??n,ft=(n,t)=>{const e=t;e&&Object.keys(e).forEach(s=>{L(e[s])?n.setReactiveCustomAttribute(s,e[s]):typeof e[s]=="function"?n.addEffect(()=>{n.setCustomAttribute(s,e[s]())}):n.setCustomAttribute(s,e[s])})},ut=(n,t)=>n.addClass(...t||[]),mt=(n,t)=>n.addReactiveClass(t||{}),pt=(n,t)=>n.addStyle(t||{}),Ct=(n,t)=>{const e=t,s=(o,i)=>{i&&(L(i)?n.setReactiveAttribute(o,i):typeof i=="function"?n.addEffect(()=>{n.setAttribute(o,i())}):n.setAttribute(o,i))};e&&Object.keys(e).forEach(o=>{s(o,e[o])})},N=(n,...t)=>{const e=n.deref();if(e)return t.forEach(s=>{typeof s=="string"?s.trim().length>0&&e.addHtmlContent(s):L(s)?e.addReactiveContent(s):e.append(s)}),e},H=(n,t)=>{const e=document.createElement(n),s=at(e);return Z(new WeakRef(s),t)??s},D=(n,t)=>{const[e,...s]=n.split(" ").map(i=>i.trim()),o=H(e,t);return s.length>0&&o.addClass(...s),(...i)=>N(new WeakRef(o),...i.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!L(c)?O(()=>c(o)):c))??o},O=n=>{const t=`getSignalContent_${Math.random().toString(36).substring(2,15)}`;return H("div").addStyle({display:"contents"}).addEffect(e=>{e.clear(),N(new WeakRef(e),...[n()].flat())},t)},Nt=(n,t,e)=>{const s=H("div").addStyle({display:"contents"}),o=new Map,i=new Map,c=new Map,l=new Map;let u=[];const v=new Set;let h=n.peek();const C=f=>{v.delete(f),o.delete(f),i.delete(f),c.delete(f),l.delete(f)},R=f=>{if(!l.has(f)){const w=u.indexOf(f);return l.set(f,w),w}return l.get(f)},E=(f,w,x)=>Array.from(x.children).indexOf(f)!==w;return S(()=>{const f=n(),w=f.map(t).map(m=>typeof m=="string"?m:m.toString()),x=new Set(w);l.clear(),w.forEach((m,b)=>{l.set(m,b)}),u=w;const U=s.hostElement;if(!U)return;p("containerChildren",Array.from(U.children),u);const wt=[];Array.from(U.children).forEach(m=>{const b=m.dataset.key;b&&!x.has(b)&&wt.push(m)}),wt.forEach(m=>{const b=m.dataset.key;p("remove element",b,m),m.remove(),C(b)}),w.forEach((m,b)=>{var A;const I=f[b],P=h[b];if(!o.has(m))p("create new element",m,I),o.set(m,j(Math.random().toString(36).substring(2,15))),i.set(m,()=>e(I,b,f).setCustomAttribute("data-key",m));else if(P&&JSON.stringify(I)!==JSON.stringify(P)){const g=c.get(m);(A=o.get(m))==null||A.set(Math.random().toString(36).substring(2,15)),i.set(m,()=>e(I,b,f).setCustomAttribute("data-key",m)),g&&g.parentNode&&p("mark element for update",m)}}),h=[...f.map(m=>({...m}))];const nn=()=>{o.forEach((m,b)=>{p("key from setTimeout foreach currItemSignalMap",b),v.has(b)||(v.add(b),S(()=>{var At;m();const I=R(b),P=(At=i.get(b))==null?void 0:At();if(!P||!P.hostElement)return;const A=s.hostElement,g=P.hostElement;if(!A)return;p("call effect from setTimeout",b,g);const k=c.get(b);if(k&&k.parentNode===A){if(E(k,I,A)){const W=A.children[I];W&&W!==k?A.insertBefore(k,W):W||A.appendChild(k)}g!==k&&(k.replaceWith(g),c.set(b,g))}else if(c.set(b,g),I<A.children.length){const W=A.children[I];W?A.insertBefore(g,W):A.appendChild(g)}else A.appendChild(g)}))})};Promise.resolve().then(()=>nn())}),s},Vt=n=>{let t=[H("div")],e=!1;return S(()=>{var i,c;const s=n();e=Array.isArray(s);const o=[];o.push(...[s].flat()),o.length===0&&o.push(H("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{p("newReactiveComponent.map",o.map(l=>{var u;return p("newReactiveComponent hostElement",l.hostElement),(u=l.hostElement)==null?void 0:u.id})),p("currComponent[0].hostElement?.id",(i=t[0].hostElement)==null?void 0:i.id,t),(c=t[0].hostElement)==null||c.replaceWith(...o.map(l=>l.hostElement).filter(Boolean)),t.slice(1).forEach(l=>{var u;return(u=l.hostElement)==null?void 0:u.remove()}),t=o}catch(l){console.error(l)}}),e?t:t[0]},Jt=n=>Wt in n,qt=n=>{const t=D("div")().addStyle({display:"contents"}),e=s=>{const o=t.hostElement;return o&&(o.innerHTML=s),t};return typeof n=="string"?e(n):t.addEffect(()=>{e(n())}),t},Y=(n,t,e)=>n?O(t):e?O(e):D("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),Et=(n,t,e)=>O(()=>Y(!!n(),t,e)),zt=(n,t,e)=>typeof n=="boolean"?Y(n,t,e):Et(n,t,e),K=(n,t)=>O(t).addEffect((e,s)=>{if(typeof n=="boolean")s.style.display=n?"block":"none";else{const o=n()?"block":"none";s.style.display=o}}),Gt=(n,t,e)=>{const s=[K(n,t)].flat();return e&&s.push(...[K(()=>typeof n=="boolean"?!n:!n(),e)].flat()),O(()=>s)},bt=(n,t)=>{p("createCustomElement",n);const e=document.createElement(n),s=ct(e);return e.init=()=>{Z(new WeakRef(s),t)},s},St=(n,t)=>{const e=n.split(" ").slice(1).map(o=>o.trim()),s=bt(n.split(" ")[0],t);return Array.isArray(e)&&e.length>0&&s.addClass(...e),(...o)=>{const i=o.filter(Boolean).flat().flatMap(l=>typeof l=="function"&&!L(l)?O(()=>l(s)):l),c=s.hostElement;return c&&(c.allSlotContent=i,c.slotContent=i.filter($).reduce((l,u)=>{var h;const v=((h=u.hostElement)==null?void 0:h.getAttribute("slot"))||"default";return l[v]||(l[v]=[]),l[v].push(u),l},{}),c.appendAllSlotContent=()=>{N(new WeakRef(s),...i)}),s}},yt=(n,t,e)=>St(`${n.renderTagName}${t&&typeof t=="string"?" "+t:""}`,y(t)?t:t&&typeof t=="string"?e:void 0),Dt=()=>{const n=()=>{};return n.oldValue=null,n},Ut=()=>({}),vt=(n,t,e)=>{const s=t?X(t,e)(n):n;return(o,...i)=>{const c=[...i];return o&&!y(o)&&c.unshift(o),yt(s,y(o)?o:{})(...c)}},Xt=n=>[vt(n),(t,e)=>{X(t,e)(n)}],a={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(n=>{a[n]=(t,...e)=>{let s=[...e];return t&&!y(t)&&(s=[t].concat(s)),D(n,y(t)?t:{})(...s)}});const Zt=a.div,Qt=a.span,Yt=a.section,Kt=a.input,xt=a.button,te=a.table,ee=a.tr,ne=a.td,se=a.th,oe=a.ul,re=a.li,ie=a.ol,ce=a.form,ae=a.label,le=a.select,de=a.option,he=a.textarea,fe=a.img,ue=a.a,me=a.p,pe=a.h1,Ce=a.h2,Ee=a.h3,be=a.h4,Se=a.h5,ye=a.h6,ve=a.br,we=a.hr,Ae=a.pre,Re=a.code,Le=a.nav,ge=a.header,Ie=a.footer,Te=a.main,je=a.aside,Oe=a.article,ke=a.figure,$e=a.figcaption,Me=a.blockquote,We=a.cite,He=a.small,Pe=a.strong,_e=a.em,Be=a.b,Fe=a.i,Ne=a.u,Ve=a.s,Je=a.sub,qe=a.sup,ze=a.mark,Ge=a.del,De=a.ins,Ue=a.details,Xe=a.summary,Ze=a.progress,Qe=a.meter,Ye=a.audio,Ke=a.video,xe=a.canvas,tn=a.slot,en=n=>t=>n(t).addClass(...t.classList??[]).addReactiveClass(t.reactiveClassList??{});r.BaseElement=M,r.a=ue,r.addAttributeList=Ct,r.addClassList=ut,r.addCustomAttributes=ft,r.addReactiveClassList=mt,r.addStyleList=pt,r.appendContentItem=N,r.article=Oe,r.aside=je,r.audio=Ye,r.b=Be,r.bindReactiveSignals=Tt,r.blockquote=Me,r.br=ve,r.button=xt,r.camelToKebab=_,r.canvas=xe,r.checkCall=V,r.checkRef=Lt,r.cite=We,r.classList=lt,r.cls=Ft,r.code=Re,r.colorLog=B,r.combineLatest=Ot,r.component=X,r.configCustomComponent=Xt,r.createComponent=en,r.createCustom=yt,r.createCustomEl=St,r.createCustomElement=bt,r.createEl=D,r.createElement=H,r.createSignal=It,r.customElementHelpers=ct,r.defineSlotTemplate=Ut,r.del=Ge,r.details=Ue,r.disableLogs=et,r.div=Zt,r.effect=S,r.elementHelpers=at,r.em=_e,r.enableLogs=Rt,r.event=$t,r.eventEmitter=Bt,r.figcaption=$e,r.figure=ke,r.footer=Ie,r.forkJoin=jt,r.form=ce,r.getList=Nt,r.getSignalContent=O,r.h1=pe,r.h2=Ce,r.h3=Ee,r.h4=be,r.h5=Se,r.h6=ye,r.header=ge,r.hr=we,r.i=Fe,r.img=fe,r.initComponent=Z,r.input=Kt,r.ins=De,r.isBaseElement=Mt,r.isComponentConfig=$,r.isComponentInitConfig=y,r.isReactiveSignal=L,r.isSlotTemplate=Jt,r.kebabToCamel=tt,r.label=ae,r.li=re,r.main=Te,r.mark=ze,r.meter=Qe,r.nav=Le,r.newEventEmitter=Dt,r.ol=ie,r.option=de,r.p=me,r.pre=Ae,r.progress=Ze,r.projectLog=p,r.property=kt,r.removeEffect=q,r.renderIf=Y,r.rs=gt,r.rxRenderIf=Et,r.s=Ve,r.section=Yt,r.select=le,r.setChildren=ht,r.setEffects=dt,r.setListeners=Q,r.show=Gt,r.showIf=K,r.signal=j,r.signalComponent=Vt,r.slot=tn,r.small=He,r.span=Qt,r.strong=Pe,r.sub=Je,r.summary=Xe,r.sup=qe,r.table=te,r.td=ne,r.textarea=he,r.th=se,r.tr=ee,r.u=Ne,r.ul=oe,r.unsafeHtml=qt,r.useCustomComponent=vt,r.video=Ke,r.when=zt,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});