aptechka 0.83.1 → 0.84.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/lib/Animation-BAiM6_n1.js +111 -0
  2. package/lib/Animation-DMWabSR0.cjs +1 -0
  3. package/lib/Composed-B0fvCtZz.cjs +1 -0
  4. package/lib/Composed-CgA9lLWA.js +75 -0
  5. package/lib/Damped-BLo-OAVb.cjs +1 -0
  6. package/lib/Damped-Dcz5UdMH.js +57 -0
  7. package/lib/DerivedArray-DFhxap_z.js +63 -0
  8. package/lib/DerivedArray-DYtWMW0n.cjs +1 -0
  9. package/lib/DragControls-BPHsDeH6.cjs +1 -0
  10. package/lib/DragControls-D2a1Cifp.js +234 -0
  11. package/lib/LocalLinks-BWFJYhGX.cjs +1 -0
  12. package/lib/LocalLinks-Dwgf3No6.js +65 -0
  13. package/lib/PageAnnouncerElement-DPMlVJZG.cjs +1 -0
  14. package/lib/PageAnnouncerElement-DV9pm_od.js +28 -0
  15. package/lib/PageScroll-BAatKJx6.cjs +1 -0
  16. package/lib/PageScroll-m3TsHnzR.js +65 -0
  17. package/lib/SourceElement-941MrYpq.js +265 -0
  18. package/lib/SourceElement-DBLZ7b5k.cjs +5 -0
  19. package/lib/Store-BCW70G3Z.cjs +1 -0
  20. package/lib/Store-uLDYY9ed.js +158 -0
  21. package/lib/Tweened-BvtjLCa3.js +48 -0
  22. package/lib/Tweened-DdXm1dbF.cjs +1 -0
  23. package/lib/Viewport-BiDoiU8M.js +113 -0
  24. package/lib/Viewport-CXGKUyDy.cjs +1 -0
  25. package/lib/accordion/index.cjs +1 -1
  26. package/lib/accordion/index.js +97 -93
  27. package/lib/animation/index.cjs +1 -1
  28. package/lib/animation/index.js +6 -6
  29. package/lib/api-fetcher/index.cjs +1 -1
  30. package/lib/api-fetcher/index.js +67 -66
  31. package/lib/attribute/index.cjs +1 -1
  32. package/lib/attribute/index.js +37 -34
  33. package/lib/attributes-BADnRZpK.cjs +1 -0
  34. package/lib/attributes-FObgMNCf.js +36 -0
  35. package/lib/billboard/index.cjs +1 -1
  36. package/lib/billboard/index.js +240 -232
  37. package/lib/cache/index.cjs +1 -1
  38. package/lib/cache/index.js +26 -23
  39. package/lib/canvas/index.cjs +1 -1
  40. package/lib/canvas/index.js +62 -59
  41. package/lib/canvas-BP1ceie3.cjs +1 -0
  42. package/lib/canvas-DsglKco1.js +40 -0
  43. package/lib/connector/index.cjs +1 -1
  44. package/lib/connector/index.js +44 -41
  45. package/lib/controls/index.cjs +1 -1
  46. package/lib/controls/index.js +6 -6
  47. package/lib/coordinates--JG1U6kQ.js +29 -0
  48. package/lib/coordinates-DQ9XV9M1.cjs +1 -0
  49. package/lib/css-property/index.cjs +1 -1
  50. package/lib/css-property/index.d.ts +1 -1
  51. package/lib/css-property/index.js +40 -37
  52. package/lib/css-unit-parser/index.cjs +2 -2
  53. package/lib/css-unit-parser/index.js +22 -19
  54. package/lib/css-value-parser/index.cjs +1 -1
  55. package/lib/css-value-parser/index.js +13 -11
  56. package/lib/custom-elements-BfZCJde6.cjs +1 -0
  57. package/lib/custom-elements-HEMuF7yH.js +27 -0
  58. package/lib/dev/index.cjs +2 -1
  59. package/lib/dev/index.d.ts +1 -0
  60. package/lib/dev/index.js +25 -10
  61. package/lib/device/index.cjs +1 -1
  62. package/lib/device/index.js +5 -5
  63. package/lib/dom-B40i6NXw.cjs +1 -0
  64. package/lib/dom-D8D-_9ty.js +108 -0
  65. package/lib/easings-BSGJFMAo.js +40 -0
  66. package/lib/easings-BWq0pPLq.cjs +1 -0
  67. package/lib/element-CqD0jqBJ.cjs +1 -0
  68. package/lib/element-DKw5H-Tu.js +10 -0
  69. package/lib/element-linked-store/index.cjs +1 -1
  70. package/lib/element-linked-store/index.js +53 -52
  71. package/lib/element-resizer/index.cjs +1 -1
  72. package/lib/element-resizer/index.js +47 -44
  73. package/lib/en3/index.cjs +4 -4
  74. package/lib/en3/index.js +192 -185
  75. package/lib/events-Ds-TuvYW.js +9 -0
  76. package/lib/events-UlGk63iC.cjs +1 -0
  77. package/lib/file-DwQs6bB6.js +28 -0
  78. package/lib/file-RHfA3OS-.cjs +1 -0
  79. package/lib/function-H4b_gTg6.cjs +1 -0
  80. package/lib/function-UmbPrOHm.js +19 -0
  81. package/lib/gestures-DmKKNnh4.js +14 -0
  82. package/lib/gestures-DtYbQr49.cjs +1 -0
  83. package/lib/history/index.cjs +1 -1
  84. package/lib/history/index.js +24 -21
  85. package/lib/iframe/index.cjs +1 -1
  86. package/lib/iframe/index.js +27 -24
  87. package/lib/image/index.cjs +1 -1
  88. package/lib/image/index.js +17 -13
  89. package/lib/index-BpO2RJ__.cjs +1 -0
  90. package/lib/index-DpKsHe97.js +68 -0
  91. package/lib/intersector/index.cjs +1 -1
  92. package/lib/intersector/index.js +3 -3
  93. package/lib/jsx/ComponentElement.d.ts +4 -0
  94. package/lib/jsx/h.d.ts +7 -16
  95. package/lib/jsx/hooks/component/useStylesheet.d.ts +1 -1
  96. package/lib/jsx/hooks/cssProperty.d.ts +6 -0
  97. package/lib/jsx/hooks/resize.d.ts +4 -0
  98. package/lib/jsx/hooks/store.d.ts +1 -2
  99. package/lib/jsx/hooks/ticker.d.ts +5 -0
  100. package/lib/jsx/index.cjs +1 -1
  101. package/lib/jsx/index.d.ts +4 -4
  102. package/lib/jsx/index.js +171 -349
  103. package/lib/jsx/plugins/vite/index.cjs +49 -0
  104. package/lib/jsx/plugins/vite/index.d.ts +38 -0
  105. package/lib/jsx/plugins/vite/index.js +104 -0
  106. package/lib/jsx/render.d.ts +2 -0
  107. package/lib/jsx/type.d.ts +228 -190
  108. package/lib/ladder/index.cjs +1 -1
  109. package/lib/ladder/index.js +86 -84
  110. package/lib/layout-C26zkY7D.js +35 -0
  111. package/lib/layout-CnGLl7oe.cjs +1 -0
  112. package/lib/layout-box/index.cjs +1 -1
  113. package/lib/layout-box/index.js +221 -217
  114. package/lib/loading/index.cjs +1 -1
  115. package/lib/loading/index.js +48 -45
  116. package/lib/local-links/index.cjs +1 -1
  117. package/lib/local-links/index.js +2 -2
  118. package/lib/masonry-layout/index.cjs +1 -1
  119. package/lib/masonry-layout/index.js +48 -45
  120. package/lib/math-C-knY2TL.cjs +1 -0
  121. package/lib/math-r8V23YFe.js +57 -0
  122. package/lib/media/index.cjs +1 -1
  123. package/lib/media/index.js +28 -25
  124. package/lib/metadata-BNdkmeeD.js +15 -0
  125. package/lib/metadata-BrHUfpV9.cjs +1 -0
  126. package/lib/morph/index.cjs +1 -1
  127. package/lib/morph/index.js +561 -556
  128. package/lib/morph-BtgB1YQP.js +256 -0
  129. package/lib/morph-Buhxq-X0.cjs +1 -0
  130. package/lib/need_redo_tweaker/index.cjs +4 -4
  131. package/lib/need_redo_tweaker/index.js +862 -834
  132. package/lib/notifier/index.cjs +1 -1
  133. package/lib/notifier/index.js +29 -26
  134. package/lib/number-Bu4sGvW7.cjs +1 -0
  135. package/lib/number-DiVt2xnh.js +47 -0
  136. package/lib/object-CiIdEmJx.js +98 -0
  137. package/lib/object-DTY_W6xG.cjs +1 -0
  138. package/lib/order/index.cjs +1 -1
  139. package/lib/order/index.js +3 -3
  140. package/lib/page-announcer/index.cjs +1 -1
  141. package/lib/page-announcer/index.js +2 -2
  142. package/lib/page-scroll/index.cjs +1 -1
  143. package/lib/page-scroll/index.js +2 -2
  144. package/lib/pixel-perfect/index.cjs +4 -4
  145. package/lib/pixel-perfect/index.js +43 -40
  146. package/lib/pointer/index.cjs +1 -1
  147. package/lib/pointer/index.js +125 -122
  148. package/lib/polyfills-CG1XJNia.js +28 -0
  149. package/lib/polyfills-DZCuDBkA.cjs +1 -0
  150. package/lib/popover/index.cjs +1 -1
  151. package/lib/popover/index.js +249 -245
  152. package/lib/radio/index.cjs +1 -1
  153. package/lib/radio/index.js +58 -55
  154. package/lib/render-DLcWVnuH.js +355 -0
  155. package/lib/render-DdomypCo.cjs +1 -0
  156. package/lib/router/index.cjs +1 -1
  157. package/lib/router/index.js +196 -194
  158. package/lib/scroll/index.cjs +1 -1
  159. package/lib/scroll/index.js +890 -877
  160. package/lib/scroll-BvIWh1xB.js +41 -0
  161. package/lib/scroll-CT0lpyRZ.cjs +1 -0
  162. package/lib/scroll-entries/index.cjs +1 -1
  163. package/lib/scroll-entries/index.js +37 -34
  164. package/lib/scroll-kit/index.cjs +1 -1
  165. package/lib/scroll-kit/index.js +214 -209
  166. package/lib/sequence/index.cjs +1 -1
  167. package/lib/sequence/index.js +102 -98
  168. package/lib/size-element/index.cjs +1 -1
  169. package/lib/size-element/index.js +29 -26
  170. package/lib/slicer/index.cjs +1 -1
  171. package/lib/slicer/index.js +118 -113
  172. package/lib/source/index.cjs +1 -1
  173. package/lib/source/index.js +5 -5
  174. package/lib/spa/index.cjs +1 -1
  175. package/lib/spa/index.js +94 -94
  176. package/lib/store/index.cjs +1 -1
  177. package/lib/store/index.d.ts +2 -2
  178. package/lib/store/index.js +10 -8
  179. package/lib/string-B3lm2b7v.js +84 -0
  180. package/lib/string-CbRNzmd9.cjs +1 -0
  181. package/lib/style-DBoQWK0d.js +14 -0
  182. package/lib/style-IDJ6db6n.cjs +1 -0
  183. package/lib/stylesheet-CHvuef16.js +28 -0
  184. package/lib/stylesheet-CQdBaIAA.cjs +1 -0
  185. package/lib/ticker/index.cjs +1 -1
  186. package/lib/ticker/index.js +96 -92
  187. package/lib/url-CPCO10Sy.cjs +1 -0
  188. package/lib/url-CWCY_qe_.js +124 -0
  189. package/lib/utils/attributes.d.ts +2 -0
  190. package/lib/utils/dom.d.ts +1 -0
  191. package/lib/utils/index.cjs +1 -1
  192. package/lib/utils/index.js +245 -226
  193. package/lib/utils/polyfills.d.ts +1 -1
  194. package/lib/video/index.cjs +1 -1
  195. package/lib/video/index.js +36 -33
  196. package/lib/window-resizer/index.cjs +1 -1
  197. package/lib/window-resizer/index.js +27 -24
  198. package/lib/youtube/index.cjs +1 -1
  199. package/lib/youtube/index.js +56 -54
  200. package/package.json +11 -24
  201. package/lib/Animation-BzTjZIE-.js +0 -108
  202. package/lib/Animation-C39Ah-LM.cjs +0 -1
  203. package/lib/Composed-C-TV9te3.cjs +0 -1
  204. package/lib/Composed-DyAWjEXE.js +0 -121
  205. package/lib/Damped-CRusiRIV.js +0 -56
  206. package/lib/Damped-Prr0iKu1.cjs +0 -1
  207. package/lib/DragControls-8rNZwQrs.cjs +0 -1
  208. package/lib/DragControls-DBNdMBA4.js +0 -228
  209. package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
  210. package/lib/LocalLinks-DFZFpbjs.js +0 -62
  211. package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
  212. package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
  213. package/lib/PageScroll-0LxFblry.js +0 -62
  214. package/lib/PageScroll-BXJUQwG7.cjs +0 -1
  215. package/lib/SourceElement-BHqPFbna.cjs +0 -5
  216. package/lib/SourceElement-DjbHjynf.js +0 -260
  217. package/lib/Store-Blf4msDz.cjs +0 -1
  218. package/lib/Store-ZThXYBQd.js +0 -152
  219. package/lib/Tweened-Bw1Cn1PJ.js +0 -47
  220. package/lib/Tweened-DWtk9E-O.cjs +0 -1
  221. package/lib/Viewport-BxCr0GlB.cjs +0 -1
  222. package/lib/Viewport-Dt-d9DPi.js +0 -109
  223. package/lib/attributes-69we3byR.js +0 -10
  224. package/lib/attributes-Bf2svn4j.cjs +0 -1
  225. package/lib/canvas-CU5Xjahf.cjs +0 -1
  226. package/lib/canvas-DeZ0SLUJ.js +0 -34
  227. package/lib/coordinates-CgdGoSYs.js +0 -24
  228. package/lib/coordinates-D8Np3cPD.cjs +0 -1
  229. package/lib/custom-elements-DBnCK7Zx.js +0 -24
  230. package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
  231. package/lib/dom-BETkVSSZ.js +0 -82
  232. package/lib/dom-CBLlqORw.cjs +0 -1
  233. package/lib/easings-BEmRlrDd.js +0 -38
  234. package/lib/easings-GegIwET5.cjs +0 -1
  235. package/lib/element-CGVl1jA-.js +0 -7
  236. package/lib/element-yhcBhsho.cjs +0 -1
  237. package/lib/events-CsVF98U6.js +0 -6
  238. package/lib/events-KVanG9sR.cjs +0 -1
  239. package/lib/file-DSpfWdd9.cjs +0 -1
  240. package/lib/file-GHShUlue.js +0 -24
  241. package/lib/function-C10DGppn.js +0 -17
  242. package/lib/function-MthRj-GJ.cjs +0 -1
  243. package/lib/gestures-C7gbKx11.cjs +0 -1
  244. package/lib/gestures-CcXV6fCp.js +0 -11
  245. package/lib/index-OE2INULi.cjs +0 -1
  246. package/lib/index-e9eDuagL.js +0 -65
  247. package/lib/jsx/hydrate.d.ts +0 -1
  248. package/lib/jsx/integrations/astro/client.cjs +0 -1
  249. package/lib/jsx/integrations/astro/client.d.ts +0 -2
  250. package/lib/jsx/integrations/astro/client.js +0 -50
  251. package/lib/jsx/integrations/astro/index.cjs +0 -1
  252. package/lib/jsx/integrations/astro/index.d.ts +0 -2
  253. package/lib/jsx/integrations/astro/index.js +0 -54
  254. package/lib/jsx/integrations/astro/server.cjs +0 -1
  255. package/lib/jsx/integrations/astro/server.d.ts +0 -3
  256. package/lib/jsx/integrations/astro/server.js +0 -35
  257. package/lib/jsx/plugins/vite.d.ts +0 -21
  258. package/lib/layout-BSMtwCga.js +0 -29
  259. package/lib/layout-Ctc2p3uz.cjs +0 -1
  260. package/lib/math-BOBiC4TN.js +0 -45
  261. package/lib/math-GDWEqu7y.cjs +0 -1
  262. package/lib/metadata-BcYZ5w3T.cjs +0 -1
  263. package/lib/metadata-jfowcCyz.js +0 -12
  264. package/lib/morph-B6sGhLCi.cjs +0 -1
  265. package/lib/morph-BQErz7qP.js +0 -242
  266. package/lib/number-ChAm68cm.cjs +0 -1
  267. package/lib/number-CumqY64S.js +0 -40
  268. package/lib/object-CcMK4y_r.js +0 -87
  269. package/lib/object-baN9pgbU.cjs +0 -1
  270. package/lib/polyfills-DJrTJQky.js +0 -24
  271. package/lib/polyfills-Df4r-ETT.cjs +0 -1
  272. package/lib/render-DQs7rIoN.cjs +0 -1
  273. package/lib/render-D_0FCWEu.js +0 -18
  274. package/lib/scroll-BA2WnUrb.cjs +0 -1
  275. package/lib/scroll-DY5senkF.js +0 -37
  276. package/lib/string-BlMQbe8b.js +0 -70
  277. package/lib/string-DUXXtU8v.cjs +0 -1
  278. package/lib/style-At6aDoqG.cjs +0 -1
  279. package/lib/style-j2TwriJ_.js +0 -10
  280. package/lib/stylesheet-5_o7PFzM.cjs +0 -1
  281. package/lib/stylesheet-DdBzowZY.js +0 -24
  282. package/lib/url-CHgcNwJ1.cjs +0 -1
  283. package/lib/url-CYgo5vrG.js +0 -113
  284. package/lib/vite-C-i3hVDL.js +0 -75
  285. package/lib/vite-DzanPumM.cjs +0 -44
@@ -1 +1 @@
1
- "use strict";var f=i=>{throw TypeError(i)};var v=(i,a,t)=>a.has(i)||f("Cannot "+t);var e=(i,a,t)=>(v(i,a,"read from private field"),t?t.call(i):a.get(i)),r=(i,a,t)=>a.has(i)?f("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(i):a.set(i,t),d=(i,a,t,s)=>(v(i,a,"write to private field"),s?s.call(i,t):a.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../events-KVanG9sR.cjs");require("construct-style-sheets-polyfill");require("../index-OE2INULi.cjs");var E,n,h,o,c,m,u,b;class g extends HTMLElement{constructor(){super(...arguments);r(this,E,[]);r(this,n,[]);r(this,h);r(this,o,null);r(this,c,!1);r(this,m,()=>{this.isConnected&&(document.documentElement.addEventListener("radioChange",e(this,b)),e(this,n).forEach(t=>{t.addEventListener("click",e(this,u)),t.hasAttribute("data-checked")&&this.setValue(t.getAttribute("data-value"))}))});r(this,u,t=>{if(!e(this,c)){const l=t.currentTarget.getAttribute("data-value");l&&this.setValue(l)}});r(this,b,t=>{const s=t.target;s!==this&&s.name===this.name&&this.setValue(t.detail)})}get value(){return e(this,h)}get name(){return this.getAttribute("name")}get currentButtonElement(){return e(this,o)}get disabled(){return e(this,c)}disable(){d(this,c,!0)}enable(){d(this,c,!1)}addButton(t){e(this,n).push(t),t.addEventListener("click",e(this,u))}removeButton(t){const s=e(this,n).find(l=>l===t);s&&(s.removeEventListener("click",e(this,u)),d(this,n,e(this,n).filter(l=>l!==t)))}setValue(t){t&&t!==e(this,h)&&(d(this,h,t),e(this,n).forEach(s=>{s.getAttribute("data-value")===e(this,h)?(s.setAttribute("data-checked",""),d(this,o,s)):s.removeAttribute("data-checked")}),e(this,o)&&e(this,E).forEach(s=>{s.innerHTML=e(this,o).getAttribute("data-name")||t}),L.dispatchEvent(this,"radioChange",{detail:e(this,h),bubbles:!0}))}connectedCallback(){d(this,E,[...this.querySelectorAll("[data-radio-listener]")]),d(this,n,[...this.querySelectorAll("[data-radio-button]")]),document.readyState==="complete"?e(this,m).call(this):addEventListener("load",e(this,m))}disconnectedCallback(){e(this,n).forEach(t=>{t.removeEventListener("click",e(this,u))}),removeEventListener("load",e(this,m)),document.documentElement.removeEventListener("radioChange",e(this,b))}}E=new WeakMap,n=new WeakMap,h=new WeakMap,o=new WeakMap,c=new WeakMap,m=new WeakMap,u=new WeakMap,b=new WeakMap;customElements.get("e-radio")||customElements.define("e-radio",g);exports.RadioElement=g;
1
+ "use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const events=require("../events-UlGk63iC.cjs");require("construct-style-sheets-polyfill");require("../index-BpO2RJ__.cjs");var _listenerElements,_buttonElements,_value,_currentButtonElement,_disabled,_loadListener,_buttonClickListener,_documentRadioChangeListener;const _RadioElement=class _RadioElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_listenerElements,[]);__privateAdd(this,_buttonElements,[]);__privateAdd(this,_value);__privateAdd(this,_currentButtonElement,null);__privateAdd(this,_disabled,!1);__privateAdd(this,_loadListener,__name(()=>{this.isConnected&&(document.documentElement.addEventListener("radioChange",__privateGet(this,_documentRadioChangeListener)),__privateGet(this,_buttonElements).forEach(element=>{element.addEventListener("click",__privateGet(this,_buttonClickListener)),element.hasAttribute("data-checked")&&this.setValue(element.getAttribute("data-value"))}))},"#loadListener"));__privateAdd(this,_buttonClickListener,__name(e=>{if(!__privateGet(this,_disabled)){const value=e.currentTarget.getAttribute("data-value");value&&this.setValue(value)}},"#buttonClickListener"));__privateAdd(this,_documentRadioChangeListener,__name(event=>{const ct=event.target;ct!==this&&ct.name===this.name&&this.setValue(event.detail)},"#documentRadioChangeListener"))}get value(){return __privateGet(this,_value)}get name(){return this.getAttribute("name")}get currentButtonElement(){return __privateGet(this,_currentButtonElement)}get disabled(){return __privateGet(this,_disabled)}disable(){__privateSet(this,_disabled,!0)}enable(){__privateSet(this,_disabled,!1)}addButton(element){__privateGet(this,_buttonElements).push(element),element.addEventListener("click",__privateGet(this,_buttonClickListener))}removeButton(element){const founded=__privateGet(this,_buttonElements).find(el=>el===element);founded&&(founded.removeEventListener("click",__privateGet(this,_buttonClickListener)),__privateSet(this,_buttonElements,__privateGet(this,_buttonElements).filter(el=>el!==element)))}setValue(value){value&&value!==__privateGet(this,_value)&&(__privateSet(this,_value,value),__privateGet(this,_buttonElements).forEach(element=>{element.getAttribute("data-value")===__privateGet(this,_value)?(element.setAttribute("data-checked",""),__privateSet(this,_currentButtonElement,element)):element.removeAttribute("data-checked")}),__privateGet(this,_currentButtonElement)&&__privateGet(this,_listenerElements).forEach(element=>{element.innerHTML=__privateGet(this,_currentButtonElement).getAttribute("data-name")||value}),events.dispatchEvent(this,"radioChange",{detail:__privateGet(this,_value),bubbles:!0}))}connectedCallback(){__privateSet(this,_listenerElements,[...this.querySelectorAll("[data-radio-listener]")]),__privateSet(this,_buttonElements,[...this.querySelectorAll("[data-radio-button]")]),document.readyState==="complete"?__privateGet(this,_loadListener).call(this):addEventListener("load",__privateGet(this,_loadListener))}disconnectedCallback(){__privateGet(this,_buttonElements).forEach(element=>{element.removeEventListener("click",__privateGet(this,_buttonClickListener))}),removeEventListener("load",__privateGet(this,_loadListener)),document.documentElement.removeEventListener("radioChange",__privateGet(this,_documentRadioChangeListener))}};_listenerElements=new WeakMap,_buttonElements=new WeakMap,_value=new WeakMap,_currentButtonElement=new WeakMap,_disabled=new WeakMap,_loadListener=new WeakMap,_buttonClickListener=new WeakMap,_documentRadioChangeListener=new WeakMap,__name(_RadioElement,"RadioElement");let RadioElement=_RadioElement;customElements.get("e-radio")||customElements.define("e-radio",RadioElement);exports.RadioElement=RadioElement;
@@ -1,92 +1,95 @@
1
- var b = (i) => {
2
- throw TypeError(i);
1
+ var __defProp = Object.defineProperty;
2
+ var __typeError = (msg) => {
3
+ throw TypeError(msg);
3
4
  };
4
- var v = (i, a, t) => a.has(i) || b("Cannot " + t);
5
- var e = (i, a, t) => (v(i, a, "read from private field"), t ? t.call(i) : a.get(i)), r = (i, a, t) => a.has(i) ? b("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(i) : a.set(i, t), d = (i, a, t, s) => (v(i, a, "write to private field"), s ? s.call(i, t) : a.set(i, t), t);
6
- import { d as g } from "../events-CsVF98U6.js";
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
6
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
7
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
8
+ import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
7
9
  import "construct-style-sheets-polyfill";
8
- import "../index-e9eDuagL.js";
9
- var E, n, h, o, c, m, l, f;
10
- class L extends HTMLElement {
10
+ import "../index-DpKsHe97.js";
11
+ var _listenerElements, _buttonElements, _value, _currentButtonElement, _disabled, _loadListener, _buttonClickListener, _documentRadioChangeListener;
12
+ const _RadioElement = class _RadioElement extends HTMLElement {
11
13
  constructor() {
12
14
  super(...arguments);
13
- r(this, E, []);
14
- r(this, n, []);
15
- r(this, h);
16
- r(this, o, null);
17
- r(this, c, !1);
18
- r(this, m, () => {
15
+ __privateAdd(this, _listenerElements, []);
16
+ __privateAdd(this, _buttonElements, []);
17
+ __privateAdd(this, _value);
18
+ __privateAdd(this, _currentButtonElement, null);
19
+ __privateAdd(this, _disabled, !1);
20
+ __privateAdd(this, _loadListener, /* @__PURE__ */ __name(() => {
19
21
  this.isConnected && (document.documentElement.addEventListener(
20
22
  "radioChange",
21
- e(this, f)
22
- ), e(this, n).forEach((t) => {
23
- t.addEventListener("click", e(this, l)), t.hasAttribute("data-checked") && this.setValue(t.getAttribute("data-value"));
23
+ __privateGet(this, _documentRadioChangeListener)
24
+ ), __privateGet(this, _buttonElements).forEach((element) => {
25
+ element.addEventListener("click", __privateGet(this, _buttonClickListener)), element.hasAttribute("data-checked") && this.setValue(element.getAttribute("data-value"));
24
26
  }));
25
- });
26
- r(this, l, (t) => {
27
- if (!e(this, c)) {
28
- const u = t.currentTarget.getAttribute("data-value");
29
- u && this.setValue(u);
27
+ }, "#loadListener"));
28
+ __privateAdd(this, _buttonClickListener, /* @__PURE__ */ __name((e) => {
29
+ if (!__privateGet(this, _disabled)) {
30
+ const value = e.currentTarget.getAttribute("data-value");
31
+ value && this.setValue(value);
30
32
  }
31
- });
32
- r(this, f, (t) => {
33
- const s = t.target;
34
- s !== this && s.name === this.name && this.setValue(t.detail);
35
- });
33
+ }, "#buttonClickListener"));
34
+ __privateAdd(this, _documentRadioChangeListener, /* @__PURE__ */ __name((event) => {
35
+ const ct = event.target;
36
+ ct !== this && ct.name === this.name && this.setValue(event.detail);
37
+ }, "#documentRadioChangeListener"));
36
38
  }
37
39
  get value() {
38
- return e(this, h);
40
+ return __privateGet(this, _value);
39
41
  }
40
42
  get name() {
41
43
  return this.getAttribute("name");
42
44
  }
43
45
  get currentButtonElement() {
44
- return e(this, o);
46
+ return __privateGet(this, _currentButtonElement);
45
47
  }
46
48
  get disabled() {
47
- return e(this, c);
49
+ return __privateGet(this, _disabled);
48
50
  }
49
51
  disable() {
50
- d(this, c, !0);
52
+ __privateSet(this, _disabled, !0);
51
53
  }
52
54
  enable() {
53
- d(this, c, !1);
55
+ __privateSet(this, _disabled, !1);
54
56
  }
55
- addButton(t) {
56
- e(this, n).push(t), t.addEventListener("click", e(this, l));
57
+ addButton(element) {
58
+ __privateGet(this, _buttonElements).push(element), element.addEventListener("click", __privateGet(this, _buttonClickListener));
57
59
  }
58
- removeButton(t) {
59
- const s = e(this, n).find((u) => u === t);
60
- s && (s.removeEventListener("click", e(this, l)), d(this, n, e(this, n).filter((u) => u !== t)));
60
+ removeButton(element) {
61
+ const founded = __privateGet(this, _buttonElements).find((el) => el === element);
62
+ founded && (founded.removeEventListener("click", __privateGet(this, _buttonClickListener)), __privateSet(this, _buttonElements, __privateGet(this, _buttonElements).filter((el) => el !== element)));
61
63
  }
62
- setValue(t) {
63
- t && t !== e(this, h) && (d(this, h, t), e(this, n).forEach((s) => {
64
- s.getAttribute("data-value") === e(this, h) ? (s.setAttribute("data-checked", ""), d(this, o, s)) : s.removeAttribute("data-checked");
65
- }), e(this, o) && e(this, E).forEach((s) => {
66
- s.innerHTML = e(this, o).getAttribute("data-name") || t;
67
- }), g(this, "radioChange", {
68
- detail: e(this, h),
64
+ setValue(value) {
65
+ value && value !== __privateGet(this, _value) && (__privateSet(this, _value, value), __privateGet(this, _buttonElements).forEach((element) => {
66
+ element.getAttribute("data-value") === __privateGet(this, _value) ? (element.setAttribute("data-checked", ""), __privateSet(this, _currentButtonElement, element)) : element.removeAttribute("data-checked");
67
+ }), __privateGet(this, _currentButtonElement) && __privateGet(this, _listenerElements).forEach((element) => {
68
+ element.innerHTML = __privateGet(this, _currentButtonElement).getAttribute("data-name") || value;
69
+ }), dispatchEvent(this, "radioChange", {
70
+ detail: __privateGet(this, _value),
69
71
  bubbles: !0
70
72
  }));
71
73
  }
72
74
  connectedCallback() {
73
- d(this, E, [
75
+ __privateSet(this, _listenerElements, [
74
76
  ...this.querySelectorAll("[data-radio-listener]")
75
- ]), d(this, n, [
77
+ ]), __privateSet(this, _buttonElements, [
76
78
  ...this.querySelectorAll("[data-radio-button]")
77
- ]), document.readyState === "complete" ? e(this, m).call(this) : addEventListener("load", e(this, m));
79
+ ]), document.readyState === "complete" ? __privateGet(this, _loadListener).call(this) : addEventListener("load", __privateGet(this, _loadListener));
78
80
  }
79
81
  disconnectedCallback() {
80
- e(this, n).forEach((t) => {
81
- t.removeEventListener("click", e(this, l));
82
- }), removeEventListener("load", e(this, m)), document.documentElement.removeEventListener(
82
+ __privateGet(this, _buttonElements).forEach((element) => {
83
+ element.removeEventListener("click", __privateGet(this, _buttonClickListener));
84
+ }), removeEventListener("load", __privateGet(this, _loadListener)), document.documentElement.removeEventListener(
83
85
  "radioChange",
84
- e(this, f)
86
+ __privateGet(this, _documentRadioChangeListener)
85
87
  );
86
88
  }
87
- }
88
- E = new WeakMap(), n = new WeakMap(), h = new WeakMap(), o = new WeakMap(), c = new WeakMap(), m = new WeakMap(), l = new WeakMap(), f = new WeakMap();
89
- customElements.get("e-radio") || customElements.define("e-radio", L);
89
+ };
90
+ _listenerElements = new WeakMap(), _buttonElements = new WeakMap(), _value = new WeakMap(), _currentButtonElement = new WeakMap(), _disabled = new WeakMap(), _loadListener = new WeakMap(), _buttonClickListener = new WeakMap(), _documentRadioChangeListener = new WeakMap(), __name(_RadioElement, "RadioElement");
91
+ let RadioElement = _RadioElement;
92
+ customElements.get("e-radio") || customElements.define("e-radio", RadioElement);
90
93
  export {
91
- L as RadioElement
94
+ RadioElement
92
95
  };
@@ -0,0 +1,355 @@
1
+ var __defProp = Object.defineProperty, __defProps = Object.defineProperties;
2
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __typeError = (msg) => {
6
+ throw TypeError(msg);
7
+ };
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ __hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
11
+ if (__getOwnPropSymbols)
12
+ for (var prop of __getOwnPropSymbols(b))
13
+ __propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
14
+ return a;
15
+ }, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)), __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
16
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
17
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
18
+ import { S as Store } from "./Store-uLDYY9ed.js";
19
+ import { u as uncapitalize, c as camelToKebab } from "./string-B3lm2b7v.js";
20
+ import { k as diff, p as patch } from "./morph-BtgB1YQP.js";
21
+ import { i as isESClass } from "./object-CiIdEmJx.js";
22
+ import "construct-style-sheets-polyfill";
23
+ import { a as intersector } from "./index-DpKsHe97.js";
24
+ import { connector } from "./connector/index.js";
25
+ import { a as DerivedKeyedArray } from "./DerivedArray-DFhxap_z.js";
26
+ import "./css-value-parser/index.js";
27
+ import "./window-resizer/index.js";
28
+ import "./element-resizer/index.js";
29
+ import "./ticker/index.js";
30
+ const activeComponent = { current: null }, componentElementLoadingTypes = [
31
+ "idle",
32
+ "load",
33
+ "visible",
34
+ "constructor",
35
+ "connect"
36
+ ];
37
+ var _loadCallback, _connectCallbacks, _disconnectCallbacks, _loadingType, _idleId, _windowLoadListener, _idleListener, _intersectionListener, _ComponentElement_instances, connect_fn;
38
+ const _ComponentElement = class _ComponentElement extends HTMLElement {
39
+ constructor() {
40
+ super();
41
+ __privateAdd(this, _ComponentElement_instances);
42
+ __privateAdd(this, _loadCallback);
43
+ __privateAdd(this, _connectCallbacks, []);
44
+ __privateAdd(this, _disconnectCallbacks, []);
45
+ __privateAdd(this, _loadingType, "constructor");
46
+ __privateAdd(this, _idleId);
47
+ __privateAdd(this, _windowLoadListener, /* @__PURE__ */ __name(() => {
48
+ window.removeEventListener("load", __privateGet(this, _windowLoadListener)), __privateGet(this, _loadingType) === "load" && __privateMethod(this, _ComponentElement_instances, connect_fn).call(this);
49
+ }, "#windowLoadListener"));
50
+ __privateAdd(this, _idleListener, /* @__PURE__ */ __name(() => {
51
+ __privateSet(this, _idleId, void 0), __privateGet(this, _loadingType) === "idle" && __privateMethod(this, _ComponentElement_instances, connect_fn).call(this);
52
+ }, "#idleListener"));
53
+ __privateAdd(this, _intersectionListener, /* @__PURE__ */ __name((entry) => {
54
+ entry.isIntersecting && (intersector.unsubscribe(__privateGet(this, _intersectionListener)), __privateGet(this, _loadingType) === "visible" && __privateMethod(this, _ComponentElement_instances, connect_fn).call(this));
55
+ }, "#intersectionListener"));
56
+ activeComponent.current = this;
57
+ }
58
+ addLoadCallback(callback) {
59
+ this.hasAttribute("loading") && componentElementLoadingTypes.includes(
60
+ this.getAttribute("loading")
61
+ ) ? __privateSet(this, _loadingType, this.getAttribute(
62
+ "loading"
63
+ )) : __privateSet(this, _loadingType, "constructor"), __privateSet(this, _loadCallback, callback), __privateGet(this, _loadingType) === "constructor" && __privateGet(this, _loadCallback).call(this);
64
+ }
65
+ addConnectCallback(callback) {
66
+ __privateGet(this, _connectCallbacks).push(callback);
67
+ }
68
+ addDisconnectCallback(callback) {
69
+ __privateGet(this, _disconnectCallbacks).push(callback);
70
+ }
71
+ connectedCallback() {
72
+ const windowLoadSetup = /* @__PURE__ */ __name(() => {
73
+ document.readyState === "complete" ? __privateGet(this, _windowLoadListener).call(this) : window.addEventListener("load", __privateGet(this, _windowLoadListener));
74
+ }, "windowLoadSetup");
75
+ __privateGet(this, _loadingType) === "connect" || __privateGet(this, _loadingType) === "constructor" ? __privateMethod(this, _ComponentElement_instances, connect_fn).call(this) : __privateGet(this, _loadingType) === "load" ? windowLoadSetup() : __privateGet(this, _loadingType) === "idle" ? window.requestIdleCallback ? __privateSet(this, _idleId, window.requestIdleCallback(__privateGet(this, _idleListener))) : windowLoadSetup() : __privateGet(this, _loadingType) === "visible" && intersector.subscribe(this, __privateGet(this, _intersectionListener)), activeComponent.current === this && (activeComponent.current = null);
76
+ }
77
+ disconnectedCallback() {
78
+ __privateGet(this, _disconnectCallbacks).forEach((callback) => {
79
+ callback(this);
80
+ }), __privateSet(this, _connectCallbacks, []), __privateSet(this, _disconnectCallbacks, []), activeComponent.current === this && (activeComponent.current = null), window.removeEventListener("load", __privateGet(this, _windowLoadListener)), window.cancelIdleCallback && __privateGet(this, _idleId) && window.cancelIdleCallback(__privateGet(this, _idleId)), intersector.unsubscribe(__privateGet(this, _intersectionListener));
81
+ }
82
+ };
83
+ _loadCallback = new WeakMap(), _connectCallbacks = new WeakMap(), _disconnectCallbacks = new WeakMap(), _loadingType = new WeakMap(), _idleId = new WeakMap(), _windowLoadListener = new WeakMap(), _idleListener = new WeakMap(), _intersectionListener = new WeakMap(), _ComponentElement_instances = new WeakSet(), connect_fn = /* @__PURE__ */ __name(function() {
84
+ var _a;
85
+ activeComponent.current = this, this.querySelectorAll("[data-fallback]").forEach((el) => {
86
+ el.remove();
87
+ }), __privateGet(this, _loadingType) !== "constructor" && ((_a = __privateGet(this, _loadCallback)) == null || _a.call(this)), __privateGet(this, _connectCallbacks).forEach((callback) => {
88
+ const unsub = callback(this);
89
+ unsub && __privateGet(this, _disconnectCallbacks).push(unsub);
90
+ }), activeComponent.current === this && (activeComponent.current = null);
91
+ }, "#connect"), __name(_ComponentElement, "ComponentElement");
92
+ let ComponentElement = _ComponentElement;
93
+ function subscribeToStore(element, store, callback) {
94
+ const unsubscribe = store.subscribe((e) => {
95
+ callback(e);
96
+ });
97
+ connector.subscribe(element, {
98
+ disconnectCallback: /* @__PURE__ */ __name(() => {
99
+ unsubscribe();
100
+ }, "disconnectCallback"),
101
+ maxWaitSec: 20,
102
+ unsubscribeAfterDisconnect: !0
103
+ });
104
+ }
105
+ __name(subscribeToStore, "subscribeToStore");
106
+ function setClassAttribute(element, classes) {
107
+ classes && (classes instanceof Store ? subscribeToStore(element, classes, (e) => {
108
+ e.previous && element.classList.remove(e.previous.toString()), e.current && element.classList.add(e.current.toString());
109
+ }) : typeof classes == "object" && !Array.isArray(classes) ? Object.entries(classes).forEach(([key, value]) => {
110
+ value instanceof Store ? subscribeToStore(element, value, (e) => {
111
+ element.classList.toggle(key, !!e.current);
112
+ }) : value && element.classList.add(key);
113
+ }) : Array.isArray(classes) ? classes.forEach((item) => {
114
+ typeof item == "string" ? element.classList.add(item) : setClassAttribute(element, item);
115
+ }) : classes.toString().split(" ").map((v) => element.classList.add(v.trim())));
116
+ }
117
+ __name(setClassAttribute, "setClassAttribute");
118
+ function setStyleAttribute(element, value) {
119
+ value && (typeof value == "object" ? Object.entries(value).forEach(([key, value2]) => {
120
+ value2 instanceof Store ? subscribeToStore(element, value2, (e) => {
121
+ var _a;
122
+ element.style[key] = (_a = e.current) == null ? void 0 : _a.toString();
123
+ }) : (typeof value2 == "number" || typeof value2 == "string" || typeof value2 == "boolean") && (element.style[key] = value2.toString());
124
+ }) : typeof value == "string" && (element.style = value));
125
+ }
126
+ __name(setStyleAttribute, "setStyleAttribute");
127
+ function setAttribute(element, key, value) {
128
+ key === "ref" && value ? Array.isArray(value) ? value.forEach((v) => {
129
+ typeof v == "object" && "value" in v && (v.value = element);
130
+ }) : typeof value == "object" && "value" in value && (value.value = element) : key === "className" || key === "class" ? setClassAttribute(element, value) : key === "style" ? setStyleAttribute(element, value) : key === "setHtml" && value != null ? element.innerHTML = value : typeof value == "number" ? key === "tabIndex" ? element.setAttribute("tabindex", value.toString()) : setAttribute(element, key, value.toString()) : typeof value == "string" ? key === "htmlFor" ? element.setAttribute("for", value) : element.setAttribute(key, value) : typeof value == "boolean" ? value ? element.setAttribute(key, "") : element.removeAttribute(key) : value instanceof Store && subscribeToStore(element, value, (e) => {
131
+ key in element ? element[key] = e.current : setAttribute(element, key, e.current);
132
+ });
133
+ }
134
+ __name(setAttribute, "setAttribute");
135
+ function setAttributes(ele, attributes) {
136
+ for (const [key, value] of Object.entries(attributes != null ? attributes : {}))
137
+ typeof value == "function" && key.startsWith("on") ? ele.addEventListener(
138
+ uncapitalize(key.replace("on", "")),
139
+ value
140
+ ) : setAttribute(ele, key, value);
141
+ }
142
+ __name(setAttributes, "setAttributes");
143
+ function createElement(tag, isSVG) {
144
+ return tag === "svg" ? document.createElementNS("http://www.w3.org/2000/svg", "svg") : isSVG ? document.createElementNS("http://www.w3.org/2000/svg", tag) : document.createElement(tag);
145
+ }
146
+ __name(createElement, "createElement");
147
+ function filterChildren(children) {
148
+ const filtered = [];
149
+ return (Array.isArray(children) ? children : [children]).forEach((child) => {
150
+ child != null && (typeof child == "number" ? filtered.push(child.toString()) : Array.isArray(child) ? child.forEach((c) => {
151
+ filtered.push(...filterChildren(c));
152
+ }) : filtered.push(child));
153
+ }), filtered;
154
+ }
155
+ __name(filterChildren, "filterChildren");
156
+ function hydrateTextNode(element, newChild, index) {
157
+ const existingChild = element.childNodes[index];
158
+ existingChild && existingChild.nodeType === Node.TEXT_NODE ? existingChild.textContent !== String(newChild) && (console.warn(
159
+ `Hydration text mismatch: expected "${newChild}", got "${existingChild.textContent}"`
160
+ ), existingChild.textContent = String(newChild)) : newChild != null && newChild !== "" && element.insertBefore(
161
+ document.createTextNode(String(newChild)),
162
+ element.childNodes[index] || null
163
+ );
164
+ }
165
+ __name(hydrateTextNode, "hydrateTextNode");
166
+ function storeChildren(element, store) {
167
+ const currentChildNodes = [...element.childNodes].filter((node) => node.__storeId === store.id), newChildren = store.current, newChildrenArray = Array.isArray(newChildren) ? newChildren : [newChildren], newNodes = [];
168
+ if (newChildrenArray.forEach((newChild) => {
169
+ let newNode = null;
170
+ typeof newChild == "boolean" || typeof newChild == "number" || typeof newChild == "string" ? newNode = document.createTextNode(newChild.toString()) : newChild instanceof Node && (newNode = newChild), newNode && (newNode.__storeId = store.id, newNodes.push(newNode));
171
+ }), store instanceof DerivedKeyedArray) {
172
+ const nodesToStay = [];
173
+ newNodes.forEach((newNode, i) => {
174
+ const oldNode = currentChildNodes.find(
175
+ (oldNode2) => oldNode2.__key === newNode.__key
176
+ );
177
+ oldNode ? oldNode.isEqualNode(newNode) ? nodesToStay.push(oldNode) : (oldNode.replaceWith(newNode), nodesToStay.push(newNode)) : (nodesToStay.push(newNode), element.appendChild(newNode));
178
+ }), currentChildNodes.forEach((currentNode) => {
179
+ nodesToStay.includes(currentNode) || currentNode.remove();
180
+ });
181
+ } else
182
+ newNodes.forEach((node, i) => {
183
+ var _a;
184
+ const founded = currentChildNodes[i];
185
+ if (founded)
186
+ founded.isEqualNode(node) || (founded.replaceWith(node), currentChildNodes[i] = node);
187
+ else {
188
+ const lastChildNode = currentChildNodes[currentChildNodes.length - 1];
189
+ lastChildNode ? (_a = lastChildNode.parentNode) == null || _a.insertBefore(
190
+ node,
191
+ lastChildNode.nextSibling
192
+ ) : element.appendChild(node);
193
+ }
194
+ }), currentChildNodes.slice(newNodes.length).forEach((node) => {
195
+ node.remove();
196
+ });
197
+ }
198
+ __name(storeChildren, "storeChildren");
199
+ const _Props = class _Props {
200
+ constructor(tag, attributes, children) {
201
+ this.tag = tag, this.attributes = attributes, this.children = children;
202
+ }
203
+ };
204
+ __name(_Props, "Props");
205
+ let Props = _Props;
206
+ const _ComponentProps = class _ComponentProps extends Props {
207
+ };
208
+ __name(_ComponentProps, "ComponentProps");
209
+ let ComponentProps = _ComponentProps;
210
+ const _ElementProps = class _ElementProps extends Props {
211
+ };
212
+ __name(_ElementProps, "ElementProps");
213
+ let ElementProps = _ElementProps;
214
+ const _HeadProps = class _HeadProps extends Props {
215
+ };
216
+ __name(_HeadProps, "HeadProps");
217
+ let HeadProps = _HeadProps;
218
+ function appendChildren(element, attributes, children, isSVG = !1) {
219
+ const filteredChildren = filterChildren(children);
220
+ setAttributes(element, attributes), filteredChildren.forEach((child, index) => {
221
+ handleChild(element, child, index, isSVG);
222
+ });
223
+ }
224
+ __name(appendChildren, "appendChildren");
225
+ function handleChild(element, child, index, isSVG) {
226
+ child instanceof Store ? handleStoreChild(element, child) : child instanceof ComponentProps ? handleComponentProps(element, child) : child instanceof ElementProps ? handleElementProps(element, child, index, isSVG) : child instanceof HeadProps ? handleHeadProps(child) : handleTextNode(element, child, index);
227
+ }
228
+ __name(handleChild, "handleChild");
229
+ function handleStoreChild(element, child) {
230
+ subscribeToStore(element, child, () => {
231
+ storeChildren(element, child);
232
+ });
233
+ }
234
+ __name(handleStoreChild, "handleStoreChild");
235
+ function handleComponentProps(element, child) {
236
+ child.tag === "shadow" && element.shadowRoot ? appendChildren(element.shadowRoot, child.attributes, child.children) : appendChildren(element, child.attributes, child.children);
237
+ }
238
+ __name(handleComponentProps, "handleComponentProps");
239
+ function handleElementProps(element, child, index, isSVG) {
240
+ let childElement = null;
241
+ if (isHydrating.value) {
242
+ const existingChild = element.children[index];
243
+ (existingChild == null ? void 0 : existingChild.nodeName.toLowerCase()) === child.tag ? (childElement = existingChild, appendChildren(childElement, child.attributes, child.children, isSVG)) : (childElement = createElement(child.tag, isSVG), appendChildren(childElement, child.attributes, child.children, isSVG), element.append(childElement));
244
+ } else
245
+ childElement = createElement(child.tag, isSVG), appendChildren(childElement, child.attributes, child.children, isSVG), element.append(childElement);
246
+ }
247
+ __name(handleElementProps, "handleElementProps");
248
+ function handleHeadProps(child) {
249
+ const headElement = document.createElement(child.tag);
250
+ appendChildren(headElement, child.attributes, child.children);
251
+ const patches = diff(document.head, headElement);
252
+ patch(document.head, patches);
253
+ }
254
+ __name(handleHeadProps, "handleHeadProps");
255
+ function handleTextNode(element, child, index) {
256
+ isHydrating.value ? hydrateTextNode(element, child, index) : element.append(child);
257
+ }
258
+ __name(handleTextNode, "handleTextNode");
259
+ function processChildren(attributes, children) {
260
+ let result = children.filter(Boolean).length ? children : attributes == null ? void 0 : attributes.children;
261
+ return result ? result.flat(2) : [];
262
+ }
263
+ __name(processChildren, "processChildren");
264
+ function handleStringTag(tag, attributes, children) {
265
+ switch (tag) {
266
+ case "component":
267
+ case "shadow":
268
+ return new ComponentProps(tag, attributes, children);
269
+ case "head":
270
+ return new HeadProps(tag, attributes, children);
271
+ default:
272
+ return new ElementProps(tag, attributes, children);
273
+ }
274
+ }
275
+ __name(handleStringTag, "handleStringTag");
276
+ function handleFunctionTag(jsxTag, attributes, children) {
277
+ return isESClass(jsxTag) ? createClassElement(jsxTag, attributes, children) : jsxTag === Fragment ? Fragment(children) : jsxTag.template ? jsxTag(__spreadValues({}, attributes)) : createCustomElement(jsxTag, attributes, children);
278
+ }
279
+ __name(handleFunctionTag, "handleFunctionTag");
280
+ function createClassElement(jsxTag, attributes, children) {
281
+ const element = new jsxTag();
282
+ return appendChildren(element, attributes, children), element;
283
+ }
284
+ __name(createClassElement, "createClassElement");
285
+ function createCustomElement(jsxTag, attributes, children) {
286
+ const name = jsxTag.define || `e-${camelToKebab(jsxTag.name)}`, Constructor = getOrDefineCustomElement(name, jsxTag), id = generateElementId(jsxTag.name, attributes), element = getOrCreateElement(name, id, Constructor);
287
+ return fillComponentElement(element, jsxTag, attributes, children), element;
288
+ }
289
+ __name(createCustomElement, "createCustomElement");
290
+ function getOrDefineCustomElement(name, jsxTag) {
291
+ var _a;
292
+ let Constructor = customElements.get(name);
293
+ return Constructor || (Constructor = (_a = class extends ComponentElement {
294
+ constructor() {
295
+ super();
296
+ }
297
+ }, __name(_a, "Constructor"), _a.formAssociated = jsxTag.formAssociated, _a), customElements.define(name, Constructor)), Constructor;
298
+ }
299
+ __name(getOrDefineCustomElement, "getOrDefineCustomElement");
300
+ function generateElementId(tagName, attributes) {
301
+ if (attributes != null && attributes.__hydrationId)
302
+ return attributes.__hydrationId;
303
+ const index = (indexMap.get(tagName) || 0) + 1;
304
+ return indexMap.set(tagName, index), `${tagName}-${index}`;
305
+ }
306
+ __name(generateElementId, "generateElementId");
307
+ function getOrCreateElement(name, id, Constructor) {
308
+ if (isHydrating.value) {
309
+ const selector = `${name}[data-id="${id}"]`, existingElement = document.querySelector(selector);
310
+ if (existingElement && existingElement instanceof Constructor)
311
+ return existingElement;
312
+ }
313
+ const element = new Constructor();
314
+ return element.setAttribute("data-id", id), element;
315
+ }
316
+ __name(getOrCreateElement, "getOrCreateElement");
317
+ function fillComponentElement(element, jsxTag, attributes, children) {
318
+ const props = __spreadProps(__spreadValues({}, attributes), {
319
+ children
320
+ }), setHtml = props.setHtml;
321
+ delete props.setHtml;
322
+ const result = jsxTag(props);
323
+ result instanceof ElementProps ? appendChildren(element, { setHtml }, result) : result instanceof ComponentProps && appendChildren(element, __spreadProps(__spreadValues({}, result.attributes), { setHtml }), result.children);
324
+ }
325
+ __name(fillComponentElement, "fillComponentElement");
326
+ const isHydrating = { value: !1 }, indexMap = /* @__PURE__ */ new Map();
327
+ function h(jsxTag, attributes, ...children) {
328
+ const processedChildren = processChildren(attributes, children), processedAttributes = __spreadValues({}, attributes);
329
+ return delete processedAttributes.children, typeof jsxTag == "string" ? handleStringTag(jsxTag, processedAttributes, processedChildren) : handleFunctionTag(jsxTag, processedAttributes, processedChildren);
330
+ }
331
+ __name(h, "h");
332
+ function Fragment(children) {
333
+ const fragment = document.createDocumentFragment();
334
+ return appendChildren(fragment, void 0, children), fragment;
335
+ }
336
+ __name(Fragment, "Fragment");
337
+ function render(container, Component, params, children) {
338
+ const element = /* @__PURE__ */ h(Component, __spreadValues({}, params), children);
339
+ return container.append(element), element;
340
+ }
341
+ __name(render, "render");
342
+ function hydrate(Component, params, children) {
343
+ isHydrating.value = !0;
344
+ const element = /* @__PURE__ */ h(Component, __spreadValues({}, params), children);
345
+ return isHydrating.value = !1, element;
346
+ }
347
+ __name(hydrate, "hydrate");
348
+ export {
349
+ Fragment as F,
350
+ activeComponent as a,
351
+ hydrate as b,
352
+ h,
353
+ indexMap as i,
354
+ render as r
355
+ };
@@ -0,0 +1 @@
1
+ "use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);const Store=require("./Store-BCW70G3Z.cjs"),string=require("./string-CbRNzmd9.cjs"),morph=require("./morph-Buhxq-X0.cjs"),object=require("./object-DTY_W6xG.cjs");require("construct-style-sheets-polyfill");const intersector_index=require("./index-BpO2RJ__.cjs"),connector_index=require("./connector/index.cjs"),DerivedArray=require("./DerivedArray-DYtWMW0n.cjs");require("./css-value-parser/index.cjs");require("./window-resizer/index.cjs");require("./element-resizer/index.cjs");require("./ticker/index.cjs");const activeComponent={current:null},componentElementLoadingTypes=["idle","load","visible","constructor","connect"];var _loadCallback,_connectCallbacks,_disconnectCallbacks,_loadingType,_idleId,_windowLoadListener,_idleListener,_intersectionListener,_ComponentElement_instances,connect_fn;const _ComponentElement=class _ComponentElement extends HTMLElement{constructor(){super();__privateAdd(this,_ComponentElement_instances);__privateAdd(this,_loadCallback);__privateAdd(this,_connectCallbacks,[]);__privateAdd(this,_disconnectCallbacks,[]);__privateAdd(this,_loadingType,"constructor");__privateAdd(this,_idleId);__privateAdd(this,_windowLoadListener,__name(()=>{window.removeEventListener("load",__privateGet(this,_windowLoadListener)),__privateGet(this,_loadingType)==="load"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this)},"#windowLoadListener"));__privateAdd(this,_idleListener,__name(()=>{__privateSet(this,_idleId,void 0),__privateGet(this,_loadingType)==="idle"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this)},"#idleListener"));__privateAdd(this,_intersectionListener,__name(entry=>{entry.isIntersecting&&(intersector_index.intersector.unsubscribe(__privateGet(this,_intersectionListener)),__privateGet(this,_loadingType)==="visible"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this))},"#intersectionListener"));activeComponent.current=this}addLoadCallback(callback){this.hasAttribute("loading")&&componentElementLoadingTypes.includes(this.getAttribute("loading"))?__privateSet(this,_loadingType,this.getAttribute("loading")):__privateSet(this,_loadingType,"constructor"),__privateSet(this,_loadCallback,callback),__privateGet(this,_loadingType)==="constructor"&&__privateGet(this,_loadCallback).call(this)}addConnectCallback(callback){__privateGet(this,_connectCallbacks).push(callback)}addDisconnectCallback(callback){__privateGet(this,_disconnectCallbacks).push(callback)}connectedCallback(){const windowLoadSetup=__name(()=>{document.readyState==="complete"?__privateGet(this,_windowLoadListener).call(this):window.addEventListener("load",__privateGet(this,_windowLoadListener))},"windowLoadSetup");__privateGet(this,_loadingType)==="connect"||__privateGet(this,_loadingType)==="constructor"?__privateMethod(this,_ComponentElement_instances,connect_fn).call(this):__privateGet(this,_loadingType)==="load"?windowLoadSetup():__privateGet(this,_loadingType)==="idle"?window.requestIdleCallback?__privateSet(this,_idleId,window.requestIdleCallback(__privateGet(this,_idleListener))):windowLoadSetup():__privateGet(this,_loadingType)==="visible"&&intersector_index.intersector.subscribe(this,__privateGet(this,_intersectionListener)),activeComponent.current===this&&(activeComponent.current=null)}disconnectedCallback(){__privateGet(this,_disconnectCallbacks).forEach(callback=>{callback(this)}),__privateSet(this,_connectCallbacks,[]),__privateSet(this,_disconnectCallbacks,[]),activeComponent.current===this&&(activeComponent.current=null),window.removeEventListener("load",__privateGet(this,_windowLoadListener)),window.cancelIdleCallback&&__privateGet(this,_idleId)&&window.cancelIdleCallback(__privateGet(this,_idleId)),intersector_index.intersector.unsubscribe(__privateGet(this,_intersectionListener))}};_loadCallback=new WeakMap,_connectCallbacks=new WeakMap,_disconnectCallbacks=new WeakMap,_loadingType=new WeakMap,_idleId=new WeakMap,_windowLoadListener=new WeakMap,_idleListener=new WeakMap,_intersectionListener=new WeakMap,_ComponentElement_instances=new WeakSet,connect_fn=__name(function(){var _a;activeComponent.current=this,this.querySelectorAll("[data-fallback]").forEach(el=>{el.remove()}),__privateGet(this,_loadingType)!=="constructor"&&((_a=__privateGet(this,_loadCallback))==null||_a.call(this)),__privateGet(this,_connectCallbacks).forEach(callback=>{const unsub=callback(this);unsub&&__privateGet(this,_disconnectCallbacks).push(unsub)}),activeComponent.current===this&&(activeComponent.current=null)},"#connect"),__name(_ComponentElement,"ComponentElement");let ComponentElement=_ComponentElement;function subscribeToStore(element,store,callback){const unsubscribe=store.subscribe(e=>{callback(e)});connector_index.connector.subscribe(element,{disconnectCallback:__name(()=>{unsubscribe()},"disconnectCallback"),maxWaitSec:20,unsubscribeAfterDisconnect:!0})}__name(subscribeToStore,"subscribeToStore");function setClassAttribute(element,classes){classes&&(classes instanceof Store.Store?subscribeToStore(element,classes,e=>{e.previous&&element.classList.remove(e.previous.toString()),e.current&&element.classList.add(e.current.toString())}):typeof classes=="object"&&!Array.isArray(classes)?Object.entries(classes).forEach(([key,value])=>{value instanceof Store.Store?subscribeToStore(element,value,e=>{element.classList.toggle(key,!!e.current)}):value&&element.classList.add(key)}):Array.isArray(classes)?classes.forEach(item=>{typeof item=="string"?element.classList.add(item):setClassAttribute(element,item)}):classes.toString().split(" ").map(v=>element.classList.add(v.trim())))}__name(setClassAttribute,"setClassAttribute");function setStyleAttribute(element,value){value&&(typeof value=="object"?Object.entries(value).forEach(([key,value2])=>{value2 instanceof Store.Store?subscribeToStore(element,value2,e=>{var _a;element.style[key]=(_a=e.current)==null?void 0:_a.toString()}):(typeof value2=="number"||typeof value2=="string"||typeof value2=="boolean")&&(element.style[key]=value2.toString())}):typeof value=="string"&&(element.style=value))}__name(setStyleAttribute,"setStyleAttribute");function setAttribute(element,key,value){key==="ref"&&value?Array.isArray(value)?value.forEach(v=>{typeof v=="object"&&"value"in v&&(v.value=element)}):typeof value=="object"&&"value"in value&&(value.value=element):key==="className"||key==="class"?setClassAttribute(element,value):key==="style"?setStyleAttribute(element,value):key==="setHtml"&&value!=null?element.innerHTML=value:typeof value=="number"?key==="tabIndex"?element.setAttribute("tabindex",value.toString()):setAttribute(element,key,value.toString()):typeof value=="string"?key==="htmlFor"?element.setAttribute("for",value):element.setAttribute(key,value):typeof value=="boolean"?value?element.setAttribute(key,""):element.removeAttribute(key):value instanceof Store.Store&&subscribeToStore(element,value,e=>{key in element?element[key]=e.current:setAttribute(element,key,e.current)})}__name(setAttribute,"setAttribute");function setAttributes(ele,attributes){for(const[key,value]of Object.entries(attributes!=null?attributes:{}))typeof value=="function"&&key.startsWith("on")?ele.addEventListener(string.uncapitalize(key.replace("on","")),value):setAttribute(ele,key,value)}__name(setAttributes,"setAttributes");function createElement(tag,isSVG){return tag==="svg"?document.createElementNS("http://www.w3.org/2000/svg","svg"):isSVG?document.createElementNS("http://www.w3.org/2000/svg",tag):document.createElement(tag)}__name(createElement,"createElement");function filterChildren(children){const filtered=[];return(Array.isArray(children)?children:[children]).forEach(child=>{child!=null&&(typeof child=="number"?filtered.push(child.toString()):Array.isArray(child)?child.forEach(c=>{filtered.push(...filterChildren(c))}):filtered.push(child))}),filtered}__name(filterChildren,"filterChildren");function hydrateTextNode(element,newChild,index){const existingChild=element.childNodes[index];existingChild&&existingChild.nodeType===Node.TEXT_NODE?existingChild.textContent!==String(newChild)&&(console.warn(`Hydration text mismatch: expected "${newChild}", got "${existingChild.textContent}"`),existingChild.textContent=String(newChild)):newChild!=null&&newChild!==""&&element.insertBefore(document.createTextNode(String(newChild)),element.childNodes[index]||null)}__name(hydrateTextNode,"hydrateTextNode");function storeChildren(element,store){const currentChildNodes=[...element.childNodes].filter(node=>node.__storeId===store.id),newChildren=store.current,newChildrenArray=Array.isArray(newChildren)?newChildren:[newChildren],newNodes=[];if(newChildrenArray.forEach(newChild=>{let newNode=null;typeof newChild=="boolean"||typeof newChild=="number"||typeof newChild=="string"?newNode=document.createTextNode(newChild.toString()):newChild instanceof Node&&(newNode=newChild),newNode&&(newNode.__storeId=store.id,newNodes.push(newNode))}),store instanceof DerivedArray.DerivedKeyedArray){const nodesToStay=[];newNodes.forEach((newNode,i)=>{const oldNode=currentChildNodes.find(oldNode2=>oldNode2.__key===newNode.__key);oldNode?oldNode.isEqualNode(newNode)?nodesToStay.push(oldNode):(oldNode.replaceWith(newNode),nodesToStay.push(newNode)):(nodesToStay.push(newNode),element.appendChild(newNode))}),currentChildNodes.forEach(currentNode=>{nodesToStay.includes(currentNode)||currentNode.remove()})}else newNodes.forEach((node,i)=>{var _a;const founded=currentChildNodes[i];if(founded)founded.isEqualNode(node)||(founded.replaceWith(node),currentChildNodes[i]=node);else{const lastChildNode=currentChildNodes[currentChildNodes.length-1];lastChildNode?(_a=lastChildNode.parentNode)==null||_a.insertBefore(node,lastChildNode.nextSibling):element.appendChild(node)}}),currentChildNodes.slice(newNodes.length).forEach(node=>{node.remove()})}__name(storeChildren,"storeChildren");const _Props=class _Props{constructor(tag,attributes,children){this.tag=tag,this.attributes=attributes,this.children=children}};__name(_Props,"Props");let Props=_Props;const _ComponentProps=class _ComponentProps extends Props{};__name(_ComponentProps,"ComponentProps");let ComponentProps=_ComponentProps;const _ElementProps=class _ElementProps extends Props{};__name(_ElementProps,"ElementProps");let ElementProps=_ElementProps;const _HeadProps=class _HeadProps extends Props{};__name(_HeadProps,"HeadProps");let HeadProps=_HeadProps;function appendChildren(element,attributes,children,isSVG=!1){const filteredChildren=filterChildren(children);setAttributes(element,attributes),filteredChildren.forEach((child,index)=>{handleChild(element,child,index,isSVG)})}__name(appendChildren,"appendChildren");function handleChild(element,child,index,isSVG){child instanceof Store.Store?handleStoreChild(element,child):child instanceof ComponentProps?handleComponentProps(element,child):child instanceof ElementProps?handleElementProps(element,child,index,isSVG):child instanceof HeadProps?handleHeadProps(child):handleTextNode(element,child,index)}__name(handleChild,"handleChild");function handleStoreChild(element,child){subscribeToStore(element,child,()=>{storeChildren(element,child)})}__name(handleStoreChild,"handleStoreChild");function handleComponentProps(element,child){child.tag==="shadow"&&element.shadowRoot?appendChildren(element.shadowRoot,child.attributes,child.children):appendChildren(element,child.attributes,child.children)}__name(handleComponentProps,"handleComponentProps");function handleElementProps(element,child,index,isSVG){let childElement=null;if(isHydrating.value){const existingChild=element.children[index];(existingChild==null?void 0:existingChild.nodeName.toLowerCase())===child.tag?(childElement=existingChild,appendChildren(childElement,child.attributes,child.children,isSVG)):(childElement=createElement(child.tag,isSVG),appendChildren(childElement,child.attributes,child.children,isSVG),element.append(childElement))}else childElement=createElement(child.tag,isSVG),appendChildren(childElement,child.attributes,child.children,isSVG),element.append(childElement)}__name(handleElementProps,"handleElementProps");function handleHeadProps(child){const headElement=document.createElement(child.tag);appendChildren(headElement,child.attributes,child.children);const patches=morph.diff(document.head,headElement);morph.patch(document.head,patches)}__name(handleHeadProps,"handleHeadProps");function handleTextNode(element,child,index){isHydrating.value?hydrateTextNode(element,child,index):element.append(child)}__name(handleTextNode,"handleTextNode");function processChildren(attributes,children){let result=children.filter(Boolean).length?children:attributes==null?void 0:attributes.children;return result?result.flat(2):[]}__name(processChildren,"processChildren");function handleStringTag(tag,attributes,children){switch(tag){case"component":case"shadow":return new ComponentProps(tag,attributes,children);case"head":return new HeadProps(tag,attributes,children);default:return new ElementProps(tag,attributes,children)}}__name(handleStringTag,"handleStringTag");function handleFunctionTag(jsxTag,attributes,children){return object.isESClass(jsxTag)?createClassElement(jsxTag,attributes,children):jsxTag===Fragment?Fragment(children):jsxTag.template?jsxTag(__spreadValues({},attributes)):createCustomElement(jsxTag,attributes,children)}__name(handleFunctionTag,"handleFunctionTag");function createClassElement(jsxTag,attributes,children){const element=new jsxTag;return appendChildren(element,attributes,children),element}__name(createClassElement,"createClassElement");function createCustomElement(jsxTag,attributes,children){const name=jsxTag.define||`e-${string.camelToKebab(jsxTag.name)}`,Constructor=getOrDefineCustomElement(name,jsxTag),id=generateElementId(jsxTag.name,attributes),element=getOrCreateElement(name,id,Constructor);return fillComponentElement(element,jsxTag,attributes,children),element}__name(createCustomElement,"createCustomElement");function getOrDefineCustomElement(name,jsxTag){var _a;let Constructor=customElements.get(name);return Constructor||(Constructor=(_a=class extends ComponentElement{constructor(){super()}},__name(_a,"Constructor"),_a.formAssociated=jsxTag.formAssociated,_a),customElements.define(name,Constructor)),Constructor}__name(getOrDefineCustomElement,"getOrDefineCustomElement");function generateElementId(tagName,attributes){if(attributes!=null&&attributes.__hydrationId)return attributes.__hydrationId;const index=(indexMap.get(tagName)||0)+1;return indexMap.set(tagName,index),`${tagName}-${index}`}__name(generateElementId,"generateElementId");function getOrCreateElement(name,id,Constructor){if(isHydrating.value){const selector=`${name}[data-id="${id}"]`,existingElement=document.querySelector(selector);if(existingElement&&existingElement instanceof Constructor)return existingElement}const element=new Constructor;return element.setAttribute("data-id",id),element}__name(getOrCreateElement,"getOrCreateElement");function fillComponentElement(element,jsxTag,attributes,children){const props=__spreadProps(__spreadValues({},attributes),{children}),setHtml=props.setHtml;delete props.setHtml;const result=jsxTag(props);result instanceof ElementProps?appendChildren(element,{setHtml},result):result instanceof ComponentProps&&appendChildren(element,__spreadProps(__spreadValues({},result.attributes),{setHtml}),result.children)}__name(fillComponentElement,"fillComponentElement");const isHydrating={value:!1},indexMap=new Map;function h(jsxTag,attributes,...children){const processedChildren=processChildren(attributes,children),processedAttributes=__spreadValues({},attributes);return delete processedAttributes.children,typeof jsxTag=="string"?handleStringTag(jsxTag,processedAttributes,processedChildren):handleFunctionTag(jsxTag,processedAttributes,processedChildren)}__name(h,"h");function Fragment(children){const fragment=document.createDocumentFragment();return appendChildren(fragment,void 0,children),fragment}__name(Fragment,"Fragment");function render(container,Component,params,children){const element=h(Component,__spreadValues({},params),children);return container.append(element),element}__name(render,"render");function hydrate(Component,params,children){isHydrating.value=!0;const element=h(Component,__spreadValues({},params),children);return isHydrating.value=!1,element}__name(hydrate,"hydrate");exports.Fragment=Fragment;exports.activeComponent=activeComponent;exports.h=h;exports.hydrate=hydrate;exports.indexMap=indexMap;exports.render=render;