@reactive-web-components/rwc 2.57.0 → 2.58.1

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