aptechka 0.83.1 → 0.84.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.
Files changed (286) hide show
  1. package/lib/Animation-BUD5w3AB.js +110 -0
  2. package/lib/Animation-BtUdarQ7.cjs +1 -0
  3. package/lib/Composed-BI5oe4Ij.cjs +1 -0
  4. package/lib/Composed-BaevH-MP.js +75 -0
  5. package/lib/Damped-BHm2IuyN.cjs +1 -0
  6. package/lib/Damped-Ds17AUU-.js +57 -0
  7. package/lib/DerivedArray-BePrxcLC.js +63 -0
  8. package/lib/DerivedArray-xYBpcTp8.cjs +1 -0
  9. package/lib/DragControls-BgTBgiue.js +233 -0
  10. package/lib/DragControls-FmiuZDKq.cjs +1 -0
  11. package/lib/LocalLinks-BdqYzt1b.js +65 -0
  12. package/lib/LocalLinks-D1mYcA-B.cjs +1 -0
  13. package/lib/PageAnnouncerElement-CJ-MfwJ8.cjs +1 -0
  14. package/lib/PageAnnouncerElement-HcphPbXZ.js +28 -0
  15. package/lib/PageScroll-CrfCwDA4.js +65 -0
  16. package/lib/PageScroll-IlOCUUte.cjs +1 -0
  17. package/lib/SourceElement-DC726HMy.js +265 -0
  18. package/lib/SourceElement-DNyrQby1.cjs +5 -0
  19. package/lib/Store-BRTHeZmO.js +158 -0
  20. package/lib/Store-DZnOrofs.cjs +1 -0
  21. package/lib/Tweened-3UYSwrvs.cjs +1 -0
  22. package/lib/Tweened-DabaFaHX.js +48 -0
  23. package/lib/Viewport-0n1C_IoN.js +113 -0
  24. package/lib/Viewport-D26fEJOk.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 +61 -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 +24 -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 +191 -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-ClTMVKJp.js +183 -0
  90. package/lib/index-DZ44osDT.cjs +1 -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 +170 -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 +220 -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 -835
  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 -123
  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-H9BjFLZ3.cjs +1 -0
  155. package/lib/render-LpimRXgl.js +354 -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 -878
  160. package/lib/scroll-D2tOpCnP.cjs +1 -0
  161. package/lib/scroll-DoNeuIgT.js +41 -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 +213 -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-CBTuup4f.js +28 -0
  184. package/lib/stylesheet-xM7sMeuo.cjs +1 -0
  185. package/lib/ticker/index.cjs +1 -1
  186. package/lib/ticker/index.js +4 -120
  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 +260 -226
  193. package/lib/utils/polyfills.d.ts +1 -1
  194. package/lib/utils/timeouts.d.ts +6 -1
  195. package/lib/video/index.cjs +1 -1
  196. package/lib/video/index.js +35 -33
  197. package/lib/window-resizer/index.cjs +1 -1
  198. package/lib/window-resizer/index.js +27 -24
  199. package/lib/youtube/index.cjs +1 -1
  200. package/lib/youtube/index.js +56 -54
  201. package/package.json +11 -24
  202. package/lib/Animation-BzTjZIE-.js +0 -108
  203. package/lib/Animation-C39Ah-LM.cjs +0 -1
  204. package/lib/Composed-C-TV9te3.cjs +0 -1
  205. package/lib/Composed-DyAWjEXE.js +0 -121
  206. package/lib/Damped-CRusiRIV.js +0 -56
  207. package/lib/Damped-Prr0iKu1.cjs +0 -1
  208. package/lib/DragControls-8rNZwQrs.cjs +0 -1
  209. package/lib/DragControls-DBNdMBA4.js +0 -228
  210. package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
  211. package/lib/LocalLinks-DFZFpbjs.js +0 -62
  212. package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
  213. package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
  214. package/lib/PageScroll-0LxFblry.js +0 -62
  215. package/lib/PageScroll-BXJUQwG7.cjs +0 -1
  216. package/lib/SourceElement-BHqPFbna.cjs +0 -5
  217. package/lib/SourceElement-DjbHjynf.js +0 -260
  218. package/lib/Store-Blf4msDz.cjs +0 -1
  219. package/lib/Store-ZThXYBQd.js +0 -152
  220. package/lib/Tweened-Bw1Cn1PJ.js +0 -47
  221. package/lib/Tweened-DWtk9E-O.cjs +0 -1
  222. package/lib/Viewport-BxCr0GlB.cjs +0 -1
  223. package/lib/Viewport-Dt-d9DPi.js +0 -109
  224. package/lib/attributes-69we3byR.js +0 -10
  225. package/lib/attributes-Bf2svn4j.cjs +0 -1
  226. package/lib/canvas-CU5Xjahf.cjs +0 -1
  227. package/lib/canvas-DeZ0SLUJ.js +0 -34
  228. package/lib/coordinates-CgdGoSYs.js +0 -24
  229. package/lib/coordinates-D8Np3cPD.cjs +0 -1
  230. package/lib/custom-elements-DBnCK7Zx.js +0 -24
  231. package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
  232. package/lib/dom-BETkVSSZ.js +0 -82
  233. package/lib/dom-CBLlqORw.cjs +0 -1
  234. package/lib/easings-BEmRlrDd.js +0 -38
  235. package/lib/easings-GegIwET5.cjs +0 -1
  236. package/lib/element-CGVl1jA-.js +0 -7
  237. package/lib/element-yhcBhsho.cjs +0 -1
  238. package/lib/events-CsVF98U6.js +0 -6
  239. package/lib/events-KVanG9sR.cjs +0 -1
  240. package/lib/file-DSpfWdd9.cjs +0 -1
  241. package/lib/file-GHShUlue.js +0 -24
  242. package/lib/function-C10DGppn.js +0 -17
  243. package/lib/function-MthRj-GJ.cjs +0 -1
  244. package/lib/gestures-C7gbKx11.cjs +0 -1
  245. package/lib/gestures-CcXV6fCp.js +0 -11
  246. package/lib/index-OE2INULi.cjs +0 -1
  247. package/lib/index-e9eDuagL.js +0 -65
  248. package/lib/jsx/hydrate.d.ts +0 -1
  249. package/lib/jsx/integrations/astro/client.cjs +0 -1
  250. package/lib/jsx/integrations/astro/client.d.ts +0 -2
  251. package/lib/jsx/integrations/astro/client.js +0 -50
  252. package/lib/jsx/integrations/astro/index.cjs +0 -1
  253. package/lib/jsx/integrations/astro/index.d.ts +0 -2
  254. package/lib/jsx/integrations/astro/index.js +0 -54
  255. package/lib/jsx/integrations/astro/server.cjs +0 -1
  256. package/lib/jsx/integrations/astro/server.d.ts +0 -3
  257. package/lib/jsx/integrations/astro/server.js +0 -35
  258. package/lib/jsx/plugins/vite.d.ts +0 -21
  259. package/lib/layout-BSMtwCga.js +0 -29
  260. package/lib/layout-Ctc2p3uz.cjs +0 -1
  261. package/lib/math-BOBiC4TN.js +0 -45
  262. package/lib/math-GDWEqu7y.cjs +0 -1
  263. package/lib/metadata-BcYZ5w3T.cjs +0 -1
  264. package/lib/metadata-jfowcCyz.js +0 -12
  265. package/lib/morph-B6sGhLCi.cjs +0 -1
  266. package/lib/morph-BQErz7qP.js +0 -242
  267. package/lib/number-ChAm68cm.cjs +0 -1
  268. package/lib/number-CumqY64S.js +0 -40
  269. package/lib/object-CcMK4y_r.js +0 -87
  270. package/lib/object-baN9pgbU.cjs +0 -1
  271. package/lib/polyfills-DJrTJQky.js +0 -24
  272. package/lib/polyfills-Df4r-ETT.cjs +0 -1
  273. package/lib/render-DQs7rIoN.cjs +0 -1
  274. package/lib/render-D_0FCWEu.js +0 -18
  275. package/lib/scroll-BA2WnUrb.cjs +0 -1
  276. package/lib/scroll-DY5senkF.js +0 -37
  277. package/lib/string-BlMQbe8b.js +0 -70
  278. package/lib/string-DUXXtU8v.cjs +0 -1
  279. package/lib/style-At6aDoqG.cjs +0 -1
  280. package/lib/style-j2TwriJ_.js +0 -10
  281. package/lib/stylesheet-5_o7PFzM.cjs +0 -1
  282. package/lib/stylesheet-DdBzowZY.js +0 -24
  283. package/lib/url-CHgcNwJ1.cjs +0 -1
  284. package/lib/url-CYgo5vrG.js +0 -113
  285. package/lib/vite-C-i3hVDL.js +0 -75
  286. package/lib/vite-DzanPumM.cjs +0 -44
@@ -1,25 +1,26 @@
1
- var vt = (r) => {
2
- throw TypeError(r);
1
+ var __defProp = Object.defineProperty;
2
+ var __typeError = (msg) => {
3
+ throw TypeError(msg);
3
4
  };
4
- var Xe = (r, s, e) => s.has(r) || vt("Cannot " + e);
5
- var t = (r, s, e) => (Xe(r, s, "read from private field"), e ? e.call(r) : s.get(r)), o = (r, s, e) => s.has(r) ? vt("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(r) : s.set(r, e), c = (r, s, e, i) => (Xe(r, s, "write to private field"), i ? i.call(r, e) : s.set(r, e), e), l = (r, s, e) => (Xe(r, s, "access private method"), e);
6
- import { i as p } from "../index-e9eDuagL.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), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
8
+ import { i as isBrowser } from "../index-ClTMVKJp.js";
7
9
  import "construct-style-sheets-polyfill";
8
- import "../ticker/index.js";
9
- import { S as $, s as K, a as j } from "../Store-ZThXYBQd.js";
10
- import { c as Ut } from "../file-GHShUlue.js";
11
- import { d as Xt } from "../function-C10DGppn.js";
12
- import { s as Et } from "../gestures-CcXV6fCp.js";
13
- import { connector as Qt } from "../connector/index.js";
14
- import { c as Oe, u as jt } from "../string-BlMQbe8b.js";
15
- import { i as yt } from "../object-CcMK4y_r.js";
16
- import { a as es } from "../Viewport-Dt-d9DPi.js";
17
- import { c as ts } from "../math-BOBiC4TN.js";
18
- import { t as ss } from "../number-CumqY64S.js";
19
- import { n as St } from "../polyfills-DJrTJQky.js";
20
- import { elementResizer as kt } from "../element-resizer/index.js";
21
- import { g as is } from "../style-j2TwriJ_.js";
22
- const ns = /* @__PURE__ */ new Set([
10
+ import { S as Store, s as storeRegistry, a as activeStores } from "../Store-BRTHeZmO.js";
11
+ import { c as createJSONAndSave } from "../file-DwQs6bB6.js";
12
+ import { d as debounce } from "../function-UmbPrOHm.js";
13
+ import { s as setupDrag } from "../gestures-DmKKNnh4.js";
14
+ import { connector } from "../connector/index.js";
15
+ import { c as camelToKebab, u as uncapitalize } from "../string-B3lm2b7v.js";
16
+ import { i as isESClass } from "../object-CiIdEmJx.js";
17
+ import { a as ViewportMediaRules } from "../Viewport-0n1C_IoN.js";
18
+ import { c as clamp } from "../math-r8V23YFe.js";
19
+ import { t as toStep } from "../number-DiVt2xnh.js";
20
+ import { n as nullishCoalescing } from "../polyfills-CG1XJNia.js";
21
+ import { elementResizer } from "../element-resizer/index.js";
22
+ import { g as getElementTransitionDurationMS } from "../style-DBoQWK0d.js";
23
+ const knownSvgTags = /* @__PURE__ */ new Set([
23
24
  // 'a', 'style', 'title', 'script',
24
25
  "animate",
25
26
  "animateMotion",
@@ -84,241 +85,241 @@ const ns = /* @__PURE__ */ new Set([
84
85
  "view",
85
86
  "use"
86
87
  ]);
87
- var d, I, y, we, H, D, a, xt, Ct, Lt, Qe, je, Tt, zt, Mt, At, et, tt, Nt, st, it, Rt, nt, Be, ot, rt, at, We, qe;
88
- const Je = class Je {
89
- constructor(...s) {
90
- o(this, a);
91
- o(this, d, null);
92
- o(this, I, /* @__PURE__ */ new Set());
93
- o(this, y, /* @__PURE__ */ new Set());
94
- o(this, we);
95
- o(this, H);
96
- o(this, D);
97
- o(this, We, (s) => {
98
- t(this, I).forEach((e) => {
99
- e(s);
100
- }), t(this, I).clear();
101
- });
102
- o(this, qe, (s, e) => {
103
- t(this, y).forEach((i) => {
104
- i(s, e);
105
- }), t(this, y).clear(), l(this, a, it).call(this);
106
- });
107
- if (p) {
108
- const e = s[0], i = s[1];
109
- c(this, d, l(this, a, xt).call(this, e, i == null ? void 0 : i.forceSvg)), l(this, a, Lt).call(this, i);
88
+ var _node, _connectCallbacks, _disconnectCallbacks, _connectorUnsubscribeCallback, _storeRootElements, _events, _ElementConstructor_instances, createNode_fn, isSvgOrHtmlElement_fn, applyProperties_fn, watchNode_fn, createClassList_fn, manageStringStoreClass_fn, manageBooleanStoreClass_fn, createStyle_fn, createAttributeStyle_fn, createJSSStyle_fn, setStyleProperty_fn, createEvents_fn, attachEvents_fn, detachEvents_fn, createAttributes_fn, setAttribute_fn, createChildren_fn, appendChild_fn, getNode_fn, getOrCreateNode_fn, _connect, _disconnect;
89
+ const _ElementConstructor = class _ElementConstructor {
90
+ constructor(...args) {
91
+ __privateAdd(this, _ElementConstructor_instances);
92
+ __privateAdd(this, _node, null);
93
+ __privateAdd(this, _connectCallbacks, /* @__PURE__ */ new Set());
94
+ __privateAdd(this, _disconnectCallbacks, /* @__PURE__ */ new Set());
95
+ __privateAdd(this, _connectorUnsubscribeCallback);
96
+ __privateAdd(this, _storeRootElements);
97
+ __privateAdd(this, _events);
98
+ __privateAdd(this, _connect, /* @__PURE__ */ __name((node) => {
99
+ __privateGet(this, _connectCallbacks).forEach((callback) => {
100
+ callback(node);
101
+ }), __privateGet(this, _connectCallbacks).clear();
102
+ }, "#connect"));
103
+ __privateAdd(this, _disconnect, /* @__PURE__ */ __name((node, expired) => {
104
+ __privateGet(this, _disconnectCallbacks).forEach((callback) => {
105
+ callback(node, expired);
106
+ }), __privateGet(this, _disconnectCallbacks).clear(), __privateMethod(this, _ElementConstructor_instances, detachEvents_fn).call(this);
107
+ }, "#disconnect"));
108
+ if (isBrowser) {
109
+ const p1 = args[0], p2 = args[1];
110
+ __privateSet(this, _node, __privateMethod(this, _ElementConstructor_instances, createNode_fn).call(this, p1, p2 == null ? void 0 : p2.forceSvg)), __privateMethod(this, _ElementConstructor_instances, applyProperties_fn).call(this, p2);
110
111
  }
111
112
  }
112
113
  get node() {
113
- return t(this, d);
114
+ return __privateGet(this, _node);
114
115
  }
115
- set node(s) {
116
- var e;
117
- l(this, a, it).call(this), c(this, d, s), (e = t(this, we)) == null || e.call(this), t(this, d) instanceof Element && c(this, H, [
118
- ...t(this, d).querySelectorAll("store-root")
119
- ]), l(this, a, st).call(this), l(this, a, Qe).call(this);
116
+ set node(v) {
117
+ var _a;
118
+ __privateMethod(this, _ElementConstructor_instances, detachEvents_fn).call(this), __privateSet(this, _node, v), (_a = __privateGet(this, _connectorUnsubscribeCallback)) == null || _a.call(this), __privateGet(this, _node) instanceof Element && __privateSet(this, _storeRootElements, [
119
+ ...__privateGet(this, _node).querySelectorAll("store-root")
120
+ ]), __privateMethod(this, _ElementConstructor_instances, attachEvents_fn).call(this), __privateMethod(this, _ElementConstructor_instances, watchNode_fn).call(this);
120
121
  }
121
122
  };
122
- d = new WeakMap(), I = new WeakMap(), y = new WeakMap(), we = new WeakMap(), H = new WeakMap(), D = new WeakMap(), a = new WeakSet(), xt = function(s, e) {
123
- let i = null;
124
- if (s instanceof Node)
125
- i = s;
126
- else if (typeof s == "string")
127
- if (!s.includes("<") && s.includes("-"))
128
- i = new (customElements.get(s))();
129
- else if (s.includes("<")) {
130
- const n = document.createElement("div");
131
- n.innerHTML = s, i = n.firstElementChild;
132
- } else ns.has(s) || e ? i = document.createElementNS(
123
+ _node = new WeakMap(), _connectCallbacks = new WeakMap(), _disconnectCallbacks = new WeakMap(), _connectorUnsubscribeCallback = new WeakMap(), _storeRootElements = new WeakMap(), _events = new WeakMap(), _ElementConstructor_instances = new WeakSet(), createNode_fn = /* @__PURE__ */ __name(function(value, forceSvg) {
124
+ let node = null;
125
+ if (value instanceof Node)
126
+ node = value;
127
+ else if (typeof value == "string")
128
+ if (!value.includes("<") && value.includes("-"))
129
+ node = new (customElements.get(value))();
130
+ else if (value.includes("<")) {
131
+ const wrapper = document.createElement("div");
132
+ wrapper.innerHTML = value, node = wrapper.firstElementChild;
133
+ } else knownSvgTags.has(value) || forceSvg ? node = document.createElementNS(
133
134
  "http://www.w3.org/2000/svg",
134
- s
135
- ) : i = document.createElement(s);
135
+ value
136
+ ) : node = document.createElement(value);
136
137
  else
137
- i = document.createElement("div");
138
- return i;
139
- }, Ct = function(s) {
140
- return s instanceof HTMLElement || s instanceof SVGElement;
141
- }, Lt = function(s) {
142
- if (!s) return;
143
- const e = l(this, a, Ct).call(this, t(this, d)), i = s.ref;
144
- delete s.ref, s != null && s.onConnect && (t(this, I).add(s.onConnect), delete s.onConnect), s != null && s.onDisconnect && (t(this, y).add(s.onDisconnect), delete s.onDisconnect);
145
- let n, h;
146
- for (const u in s) {
147
- const m = s[u];
148
- u === "class" && e ? l(this, a, je).call(this, m) : u === "style" && e ? l(this, a, Mt).call(this, m) : u === "lightChildren" ? l(this, a, Be).call(this, t(this, d), m) : u === "children" ? l(this, a, Be).call(this, t(this, d) instanceof Element ? t(this, d).shadowRoot || t(this, d) : t(this, d), m) : u === "connectedClass" ? t(this, I).add(() => {
138
+ node = document.createElement("div");
139
+ return node;
140
+ }, "#createNode"), isSvgOrHtmlElement_fn = /* @__PURE__ */ __name(function(node) {
141
+ return node instanceof HTMLElement || node instanceof SVGElement;
142
+ }, "#isSvgOrHtmlElement"), applyProperties_fn = /* @__PURE__ */ __name(function(properties) {
143
+ if (!properties) return;
144
+ const isSvgOrHtml = __privateMethod(this, _ElementConstructor_instances, isSvgOrHtmlElement_fn).call(this, __privateGet(this, _node)), ref = properties.ref;
145
+ delete properties.ref, properties != null && properties.onConnect && (__privateGet(this, _connectCallbacks).add(properties.onConnect), delete properties.onConnect), properties != null && properties.onDisconnect && (__privateGet(this, _disconnectCallbacks).add(properties.onDisconnect), delete properties.onDisconnect);
146
+ let attributes, events;
147
+ for (const propertyName in properties) {
148
+ const value = properties[propertyName];
149
+ propertyName === "class" && isSvgOrHtml ? __privateMethod(this, _ElementConstructor_instances, createClassList_fn).call(this, value) : propertyName === "style" && isSvgOrHtml ? __privateMethod(this, _ElementConstructor_instances, createStyle_fn).call(this, value) : propertyName === "lightChildren" ? __privateMethod(this, _ElementConstructor_instances, createChildren_fn).call(this, __privateGet(this, _node), value) : propertyName === "children" ? __privateMethod(this, _ElementConstructor_instances, createChildren_fn).call(this, __privateGet(this, _node) instanceof Element ? __privateGet(this, _node).shadowRoot || __privateGet(this, _node) : __privateGet(this, _node), value) : propertyName === "connectedClass" ? __privateGet(this, _connectCallbacks).add(() => {
149
150
  requestAnimationFrame(() => {
150
- t(this, d).classList.add(
151
- typeof m == "boolean" ? "connected" : m
151
+ __privateGet(this, _node).classList.add(
152
+ typeof value == "boolean" ? "connected" : value
152
153
  );
153
154
  });
154
- }) : u.startsWith("on") ? (h || (h = {}), h[u] = m) : (n || (n = {}), n[u] = m);
155
- }
156
- l(this, a, Rt).call(this, n), l(this, a, Nt).call(this, h), i && (typeof i == "function" ? i(t(this, d)) : i.current = t(this, d)), l(this, a, Qe).call(this);
157
- }, Qe = function() {
158
- if (p && (t(this, y).size || t(this, I).size)) {
159
- const s = t(this, d) instanceof DocumentFragment ? t(this, d).firstChild : t(this, d);
160
- c(this, we, Qt.subscribe(
161
- s,
155
+ }) : propertyName.startsWith("on") ? (events || (events = {}), events[propertyName] = value) : (attributes || (attributes = {}), attributes[propertyName] = value);
156
+ }
157
+ __privateMethod(this, _ElementConstructor_instances, createAttributes_fn).call(this, attributes), __privateMethod(this, _ElementConstructor_instances, createEvents_fn).call(this, events), ref && (typeof ref == "function" ? ref(__privateGet(this, _node)) : ref.current = __privateGet(this, _node)), __privateMethod(this, _ElementConstructor_instances, watchNode_fn).call(this);
158
+ }, "#applyProperties"), watchNode_fn = /* @__PURE__ */ __name(function() {
159
+ if (isBrowser && (__privateGet(this, _disconnectCallbacks).size || __privateGet(this, _connectCallbacks).size)) {
160
+ const watchNode = __privateGet(this, _node) instanceof DocumentFragment ? __privateGet(this, _node).firstChild : __privateGet(this, _node);
161
+ __privateSet(this, _connectorUnsubscribeCallback, connector.subscribe(
162
+ watchNode,
162
163
  {
163
- connectCallback: t(this, We),
164
- disconnectCallback: t(this, qe),
164
+ connectCallback: __privateGet(this, _connect),
165
+ disconnectCallback: __privateGet(this, _disconnect),
165
166
  unsubscribeAfterDisconnect: !0,
166
167
  maxWaitSec: 20
167
168
  }
168
169
  ));
169
170
  }
170
- }, je = function(s) {
171
- if (s) {
172
- if (typeof s == "string")
173
- t(this, d).classList.add(s);
174
- else if (Array.isArray(s))
175
- s.forEach((e) => {
176
- e && l(this, a, je).call(this, e);
171
+ }, "#watchNode"), createClassList_fn = /* @__PURE__ */ __name(function(classObject) {
172
+ if (classObject) {
173
+ if (typeof classObject == "string")
174
+ __privateGet(this, _node).classList.add(classObject);
175
+ else if (Array.isArray(classObject))
176
+ classObject.forEach((v) => {
177
+ v && __privateMethod(this, _ElementConstructor_instances, createClassList_fn).call(this, v);
177
178
  });
178
- else if (typeof s == "object")
179
- if (s instanceof $)
180
- l(this, a, Tt).call(this, s);
179
+ else if (typeof classObject == "object")
180
+ if (classObject instanceof Store)
181
+ __privateMethod(this, _ElementConstructor_instances, manageStringStoreClass_fn).call(this, classObject);
181
182
  else
182
- for (const e in s) {
183
- const i = s[e];
184
- i instanceof $ ? l(this, a, zt).call(this, e, i) : i ? t(this, d).classList.add(e) : t(this, d).classList.remove(e);
183
+ for (const className in classObject) {
184
+ const isActive = classObject[className];
185
+ isActive instanceof Store ? __privateMethod(this, _ElementConstructor_instances, manageBooleanStoreClass_fn).call(this, className, isActive) : isActive ? __privateGet(this, _node).classList.add(className) : __privateGet(this, _node).classList.remove(className);
185
186
  }
186
187
  } else return;
187
- }, Tt = function(s) {
188
- t(this, y).add(
189
- s.subscribe(({ current: e, previous: i }) => {
190
- i && [i].flat().forEach((n) => {
191
- n && t(this, d).classList.remove(n);
192
- }), e && [e].flat().forEach((n) => {
193
- n && t(this, d).classList.add(n);
188
+ }, "#createClassList"), manageStringStoreClass_fn = /* @__PURE__ */ __name(function(store) {
189
+ __privateGet(this, _disconnectCallbacks).add(
190
+ store.subscribe(({ current, previous }) => {
191
+ previous && [previous].flat().forEach((v) => {
192
+ v && __privateGet(this, _node).classList.remove(v);
193
+ }), current && [current].flat().forEach((v) => {
194
+ v && __privateGet(this, _node).classList.add(v);
194
195
  });
195
196
  })
196
197
  );
197
- }, zt = function(s, e) {
198
- t(this, y).add(
199
- e.subscribe(({ current: i }) => {
200
- i ? t(this, d).classList.add(s) : t(this, d).classList.remove(s);
198
+ }, "#manageStringStoreClass"), manageBooleanStoreClass_fn = /* @__PURE__ */ __name(function(className, store) {
199
+ __privateGet(this, _disconnectCallbacks).add(
200
+ store.subscribe(({ current }) => {
201
+ current ? __privateGet(this, _node).classList.add(className) : __privateGet(this, _node).classList.remove(className);
201
202
  })
202
203
  );
203
- }, Mt = function(s) {
204
- if (!s)
204
+ }, "#manageBooleanStoreClass"), createStyle_fn = /* @__PURE__ */ __name(function(object) {
205
+ if (!object)
205
206
  return;
206
- t(this, d).tagName === "style" || t(this, d).tagName === "STYLE" ? l(this, a, et).call(this, s) : l(this, a, At).call(this, s);
207
- }, At = function(s) {
208
- for (const e in s) {
209
- const i = e, n = s[i];
210
- n instanceof $ ? t(this, y).add(
211
- n.subscribe(({ current: h }) => {
212
- l(this, a, tt).call(this, i, h);
207
+ __privateGet(this, _node).tagName === "style" || __privateGet(this, _node).tagName === "STYLE" ? __privateMethod(this, _ElementConstructor_instances, createJSSStyle_fn).call(this, object) : __privateMethod(this, _ElementConstructor_instances, createAttributeStyle_fn).call(this, object);
208
+ }, "#createStyle"), createAttributeStyle_fn = /* @__PURE__ */ __name(function(object) {
209
+ for (const k in object) {
210
+ const token = k, value = object[token];
211
+ value instanceof Store ? __privateGet(this, _disconnectCallbacks).add(
212
+ value.subscribe(({ current }) => {
213
+ __privateMethod(this, _ElementConstructor_instances, setStyleProperty_fn).call(this, token, current);
213
214
  })
214
- ) : l(this, a, tt).call(this, i, n);
215
- }
216
- }, et = function(s) {
217
- for (const e in s) {
218
- const i = s[e];
219
- if (typeof i == "object" && !(i instanceof $))
220
- t(this, d).appendChild(
221
- document.createTextNode(`${e} {`)
222
- ), l(this, a, et).call(this, i), t(this, d).appendChild(document.createTextNode("}"));
223
- else if (i instanceof $) {
224
- const n = document.createTextNode("");
225
- t(this, y).add(
226
- i.subscribe((h) => {
227
- h.current ? n.nodeValue = `${Oe(e)}: ${h.current};` : n.nodeValue = "";
215
+ ) : __privateMethod(this, _ElementConstructor_instances, setStyleProperty_fn).call(this, token, value);
216
+ }
217
+ }, "#createAttributeStyle"), createJSSStyle_fn = /* @__PURE__ */ __name(function(object) {
218
+ for (const key in object) {
219
+ const value = object[key];
220
+ if (typeof value == "object" && !(value instanceof Store))
221
+ __privateGet(this, _node).appendChild(
222
+ document.createTextNode(`${key} {`)
223
+ ), __privateMethod(this, _ElementConstructor_instances, createJSSStyle_fn).call(this, value), __privateGet(this, _node).appendChild(document.createTextNode("}"));
224
+ else if (value instanceof Store) {
225
+ const text = document.createTextNode("");
226
+ __privateGet(this, _disconnectCallbacks).add(
227
+ value.subscribe((e) => {
228
+ e.current ? text.nodeValue = `${camelToKebab(key)}: ${e.current};` : text.nodeValue = "";
228
229
  })
229
- ), t(this, d).appendChild(n);
230
+ ), __privateGet(this, _node).appendChild(text);
230
231
  } else
231
- t(this, d).appendChild(
232
- document.createTextNode(`${Oe(e)}: ${i};`)
232
+ __privateGet(this, _node).appendChild(
233
+ document.createTextNode(`${camelToKebab(key)}: ${value};`)
233
234
  );
234
235
  }
235
- }, tt = function(s, e) {
236
- s.includes("--") ? e ? t(this, d).style.setProperty(s, e.toString()) : t(this, d).style.removeProperty(s) : e ? t(this, d).style[s] = e.toString() : t(this, d).style[s] = "";
237
- }, Nt = function(s) {
238
- if (s) {
239
- t(this, D) || c(this, D, []);
240
- for (const e in s) {
241
- const i = e, n = jt(
242
- i.split("on").slice(1).join("on")
243
- ), h = s[i];
244
- typeof h == "object" ? t(this, D).push({
245
- name: n,
246
- callback: h.callback,
247
- options: h.options
248
- }) : typeof h == "function" && t(this, D).push({
249
- name: n,
250
- callback: h
236
+ }, "#createJSSStyle"), setStyleProperty_fn = /* @__PURE__ */ __name(function(token, value) {
237
+ token.includes("--") ? value ? __privateGet(this, _node).style.setProperty(token, value.toString()) : __privateGet(this, _node).style.removeProperty(token) : value ? __privateGet(this, _node).style[token] = value.toString() : __privateGet(this, _node).style[token] = "";
238
+ }, "#setStyleProperty"), createEvents_fn = /* @__PURE__ */ __name(function(events) {
239
+ if (events) {
240
+ __privateGet(this, _events) || __privateSet(this, _events, []);
241
+ for (const k in events) {
242
+ const eventName = k, readyEventName = uncapitalize(
243
+ eventName.split("on").slice(1).join("on")
244
+ ), listener = events[eventName];
245
+ typeof listener == "object" ? __privateGet(this, _events).push({
246
+ name: readyEventName,
247
+ callback: listener.callback,
248
+ options: listener.options
249
+ }) : typeof listener == "function" && __privateGet(this, _events).push({
250
+ name: readyEventName,
251
+ callback: listener
251
252
  });
252
253
  }
253
- l(this, a, st).call(this);
254
- }
255
- }, st = function() {
256
- var s;
257
- (s = t(this, D)) == null || s.forEach((e) => {
258
- t(this, d).addEventListener(
259
- e.name,
260
- e.callback,
261
- e.options
254
+ __privateMethod(this, _ElementConstructor_instances, attachEvents_fn).call(this);
255
+ }
256
+ }, "#createEvents"), attachEvents_fn = /* @__PURE__ */ __name(function() {
257
+ var _a;
258
+ (_a = __privateGet(this, _events)) == null || _a.forEach((event) => {
259
+ __privateGet(this, _node).addEventListener(
260
+ event.name,
261
+ event.callback,
262
+ event.options
262
263
  );
263
264
  });
264
- }, it = function() {
265
- var s;
266
- (s = t(this, D)) == null || s.forEach((e) => {
267
- t(this, d).removeEventListener(
268
- e.name,
269
- e.callback,
270
- e.options
265
+ }, "#attachEvents"), detachEvents_fn = /* @__PURE__ */ __name(function() {
266
+ var _a;
267
+ (_a = __privateGet(this, _events)) == null || _a.forEach((event) => {
268
+ __privateGet(this, _node).removeEventListener(
269
+ event.name,
270
+ event.callback,
271
+ event.options
271
272
  );
272
273
  });
273
- }, Rt = function(s) {
274
- for (const e in s) {
275
- const i = s[e];
276
- i instanceof $ ? t(this, y).add(
277
- i.subscribe(({ current: n }) => {
278
- l(this, a, nt).call(this, e, n);
274
+ }, "#detachEvents"), createAttributes_fn = /* @__PURE__ */ __name(function(attributes) {
275
+ for (const attributeName in attributes) {
276
+ const value = attributes[attributeName];
277
+ value instanceof Store ? __privateGet(this, _disconnectCallbacks).add(
278
+ value.subscribe(({ current }) => {
279
+ __privateMethod(this, _ElementConstructor_instances, setAttribute_fn).call(this, attributeName, current);
279
280
  })
280
- ) : l(this, a, nt).call(this, e, i);
281
- }
282
- }, nt = function(s, e) {
283
- var n, h;
284
- const i = t(this, d);
285
- if (s in i && !((h = (n = i.constructor) == null ? void 0 : n.observedAttributes) != null && h.includes(s)))
286
- e != null && (i[s] = e.toString());
287
- else if (e != null) {
288
- const u = e.toString();
289
- s.includes("xlink") ? i.setAttributeNS("http://www.w3.org/1999/xlink", s, u) : i.setAttribute(s, u);
290
- }
291
- }, Be = function(s, e) {
292
- e && (e = [e].flat(), e.forEach((i) => {
293
- if (i instanceof $) {
294
- const n = document.createElement("div");
295
- n.style.display = "contents", s.appendChild(n), t(this, H) || c(this, H, []);
296
- const h = t(this, H).length;
297
- n.setAttribute("store-root", ""), t(this, H).push(n), t(this, y).add(
298
- i.subscribe(({ current: u, previous: m }) => {
299
- const k = t(this, H)[h];
300
- k.dispatchEvent(
281
+ ) : __privateMethod(this, _ElementConstructor_instances, setAttribute_fn).call(this, attributeName, value);
282
+ }
283
+ }, "#createAttributes"), setAttribute_fn = /* @__PURE__ */ __name(function(name, value) {
284
+ var _a, _b;
285
+ const element2 = __privateGet(this, _node);
286
+ if (name in element2 && !((_b = (_a = element2.constructor) == null ? void 0 : _a.observedAttributes) != null && _b.includes(name)))
287
+ value != null && (element2[name] = value.toString());
288
+ else if (value != null) {
289
+ const str = value.toString();
290
+ name.includes("xlink") ? element2.setAttributeNS("http://www.w3.org/1999/xlink", name, str) : element2.setAttribute(name, str);
291
+ }
292
+ }, "#setAttribute"), createChildren_fn = /* @__PURE__ */ __name(function(root, children) {
293
+ children && (children = [children].flat(), children.forEach((child) => {
294
+ if (child instanceof Store) {
295
+ const storeRootElement = document.createElement("div");
296
+ storeRootElement.style.display = "contents", root.appendChild(storeRootElement), __privateGet(this, _storeRootElements) || __privateSet(this, _storeRootElements, []);
297
+ const storeRootElementIndex = __privateGet(this, _storeRootElements).length;
298
+ storeRootElement.setAttribute("store-root", ""), __privateGet(this, _storeRootElements).push(storeRootElement), __privateGet(this, _disconnectCallbacks).add(
299
+ child.subscribe(({ current, previous }) => {
300
+ const rootElement = __privateGet(this, _storeRootElements)[storeRootElementIndex];
301
+ rootElement.dispatchEvent(
301
302
  new CustomEvent("beforeChildrenChange", {
302
303
  bubbles: !0,
303
304
  composed: !0
304
305
  })
305
306
  );
306
- const L = Array.from(k.childNodes), v = Array.isArray(u) ? u : [u], ge = Array.isArray(m) ? m : [m], _e = [], x = [];
307
- L.length && ge.forEach((R, P) => {
308
- v.includes(R) ? x.push(R) : _e.push(L[P]);
309
- }), v.forEach((R, P) => {
310
- if (x[P] != null) {
311
- if (R !== x[P]) {
312
- const B = l(this, a, rt).call(this, R), q = L[P];
313
- B instanceof Node && !q.isEqualNode(B) ? k.replaceChild(B, q) : k.removeChild(q);
307
+ const currentNodes = Array.from(rootElement.childNodes), currentItems = Array.isArray(current) ? current : [current], previousItems = Array.isArray(previous) ? previous : [previous], nodesToDelete = [], similarPreviousItems = [];
308
+ currentNodes.length && previousItems.forEach((previousItem, index) => {
309
+ currentItems.includes(previousItem) ? similarPreviousItems.push(previousItem) : nodesToDelete.push(currentNodes[index]);
310
+ }), currentItems.forEach((currentItem, index) => {
311
+ if (similarPreviousItems[index] != null) {
312
+ if (currentItem !== similarPreviousItems[index]) {
313
+ const newNode = __privateMethod(this, _ElementConstructor_instances, getNode_fn).call(this, currentItem), currentNode = currentNodes[index];
314
+ newNode instanceof Node && !currentNode.isEqualNode(newNode) ? rootElement.replaceChild(newNode, currentNode) : rootElement.removeChild(currentNode);
314
315
  }
315
316
  } else {
316
- const B = l(this, a, rt).call(this, R);
317
- B instanceof Node && n.appendChild(B);
317
+ const newNode = __privateMethod(this, _ElementConstructor_instances, getNode_fn).call(this, currentItem);
318
+ newNode instanceof Node && storeRootElement.appendChild(newNode);
318
319
  }
319
- }), _e.forEach((R) => {
320
- k.removeChild(R);
321
- }), k.dispatchEvent(
320
+ }), nodesToDelete.forEach((node) => {
321
+ rootElement.removeChild(node);
322
+ }), rootElement.dispatchEvent(
322
323
  new CustomEvent("afterChildrenChange", {
323
324
  bubbles: !0,
324
325
  composed: !0
@@ -326,82 +327,93 @@ d = new WeakMap(), I = new WeakMap(), y = new WeakMap(), we = new WeakMap(), H =
326
327
  );
327
328
  })
328
329
  );
329
- } else if (i instanceof Je)
330
- l(this, a, ot).call(this, s, i.node);
331
- else if (i instanceof Function)
332
- l(this, a, Be).call(this, s, yt(i) ? new i() : i());
330
+ } else if (child instanceof _ElementConstructor)
331
+ __privateMethod(this, _ElementConstructor_instances, appendChild_fn).call(this, root, child.node);
332
+ else if (child instanceof Function)
333
+ __privateMethod(this, _ElementConstructor_instances, createChildren_fn).call(this, root, isESClass(child) ? new child() : child());
333
334
  else {
334
- const n = l(this, a, at).call(this, i);
335
- n instanceof Node && l(this, a, ot).call(this, s, n);
335
+ const childNodeOrUndefined = __privateMethod(this, _ElementConstructor_instances, getOrCreateNode_fn).call(this, child);
336
+ childNodeOrUndefined instanceof Node && __privateMethod(this, _ElementConstructor_instances, appendChild_fn).call(this, root, childNodeOrUndefined);
336
337
  }
337
338
  }));
338
- }, ot = function(s, e) {
339
- !(s instanceof ShadowRoot) && e instanceof HTMLElement && e.tagName === "STYLE" ? (t(this, I).add(() => {
340
- [...document.head.querySelectorAll("style")].find((n) => n.outerHTML === e.outerHTML) || document.head.appendChild(e);
341
- }), t(this, y).add(() => {
342
- e.remove();
343
- })) : s.appendChild(e);
344
- }, rt = function(s) {
345
- return s instanceof Je ? s.node : typeof s == "function" ? yt(s) ? new s() : s() : l(this, a, at).call(this, s);
346
- }, at = function(s) {
347
- if (s instanceof Node)
348
- return s;
349
- if (s != null) {
350
- const e = String(s);
351
- if (e.trim().startsWith("<") && e.trim().endsWith(">")) {
352
- const i = document.createElement("div");
353
- return i.innerHTML = e, i.firstElementChild;
339
+ }, "#createChildren"), appendChild_fn = /* @__PURE__ */ __name(function(root, node) {
340
+ !(root instanceof ShadowRoot) && node instanceof HTMLElement && node.tagName === "STYLE" ? (__privateGet(this, _connectCallbacks).add(() => {
341
+ [...document.head.querySelectorAll("style")].find((s) => s.outerHTML === node.outerHTML) || document.head.appendChild(node);
342
+ }), __privateGet(this, _disconnectCallbacks).add(() => {
343
+ node.remove();
344
+ })) : root.appendChild(node);
345
+ }, "#appendChild"), getNode_fn = /* @__PURE__ */ __name(function(child) {
346
+ return child instanceof _ElementConstructor ? child.node : typeof child == "function" ? isESClass(child) ? new child() : child() : __privateMethod(this, _ElementConstructor_instances, getOrCreateNode_fn).call(this, child);
347
+ }, "#getNode"), getOrCreateNode_fn = /* @__PURE__ */ __name(function(child) {
348
+ if (child instanceof Node)
349
+ return child;
350
+ if (child != null) {
351
+ const str = String(child);
352
+ if (str.trim().startsWith("<") && str.trim().endsWith(">")) {
353
+ const wrapper = document.createElement("div");
354
+ return wrapper.innerHTML = str, wrapper.firstElementChild;
354
355
  } else
355
- return document.createTextNode(e);
356
+ return document.createTextNode(str);
356
357
  } else
357
358
  return;
358
- }, We = new WeakMap(), qe = new WeakMap();
359
- let N = Je;
360
- function g(...r) {
361
- return new N(...r);
359
+ }, "#getOrCreateNode"), _connect = new WeakMap(), _disconnect = new WeakMap(), __name(_ElementConstructor, "ElementConstructor");
360
+ let ElementConstructor = _ElementConstructor;
361
+ function element(...args) {
362
+ return new ElementConstructor(...args);
362
363
  }
363
- function os(r) {
364
- return new N("a", r);
364
+ __name(element, "element");
365
+ function a(object2) {
366
+ return new ElementConstructor("a", object2);
365
367
  }
366
- function ee(r) {
367
- return new N("button", r);
368
+ __name(a, "a");
369
+ function button(object2) {
370
+ return new ElementConstructor("button", object2);
368
371
  }
369
- function w(r) {
370
- return new N("div", r);
372
+ __name(button, "button");
373
+ function div(object2) {
374
+ return new ElementConstructor("div", object2);
371
375
  }
372
- function Ve(r) {
373
- return new N("input", r);
376
+ __name(div, "div");
377
+ function input(object2) {
378
+ return new ElementConstructor("input", object2);
374
379
  }
375
- function Ft(r) {
376
- return new N("label", r);
380
+ __name(input, "input");
381
+ function label(object2) {
382
+ return new ElementConstructor("label", object2);
377
383
  }
378
- function me(r) {
379
- return new N("slot", r);
384
+ __name(label, "label");
385
+ function slot(object2) {
386
+ return new ElementConstructor("slot", object2);
380
387
  }
381
- function lt(r) {
382
- return new N("span", r);
388
+ __name(slot, "slot");
389
+ function span(object2) {
390
+ return new ElementConstructor("span", object2);
383
391
  }
384
- function Pt(r) {
385
- return new N("style", {
386
- style: r
392
+ __name(span, "span");
393
+ function style(object2) {
394
+ return new ElementConstructor("style", {
395
+ style: object2
387
396
  });
388
397
  }
389
- function E(r) {
390
- const s = new CSSStyleSheet();
391
- return s.replaceSync(Pt(r).node.innerHTML), s;
398
+ __name(style, "style");
399
+ function createStylesheet(object) {
400
+ const sheet = new CSSStyleSheet();
401
+ return sheet.replaceSync(style(object).node.innerHTML), sheet;
392
402
  }
393
- function rs(r, s) {
394
- const e = s == null ? void 0 : s.prefix, i = {
403
+ __name(createStylesheet, "createStylesheet");
404
+ function createTheme(object, options) {
405
+ const prefix = options == null ? void 0 : options.prefix, result = {
395
406
  style: {}
396
407
  };
397
- for (const n in r)
398
- i[n] = {
399
- var: `var(--${e}${Oe(n)})`,
400
- value: r[n]
401
- }, i.style[`--${e}${Oe(n)}`] = r[n];
402
- return i;
408
+ for (const key in object)
409
+ result[key] = {
410
+ var: `var(--${prefix}${camelToKebab(key)})`,
411
+ value: object[key]
412
+ }, result.style[`--${prefix}${camelToKebab(key)}`] = object[key];
413
+ return result;
403
414
  }
404
- const f = rs(
415
+ __name(createTheme, "createTheme");
416
+ const aptechkaTheme = createTheme(
405
417
  {
406
418
  colorMain: "#1c1c1c",
407
419
  colorMainAux: "#282828",
@@ -412,13 +424,13 @@ const f = rs(
412
424
  },
413
425
  { prefix: "aptechka-" }
414
426
  );
415
- if (p) {
416
- const r = Pt({
417
- ":root": f.style
427
+ if (isBrowser) {
428
+ const styleNode = style({
429
+ ":root": aptechkaTheme.style
418
430
  }).node;
419
- r.setAttribute("data-permanent", ""), document.head.appendChild(r);
431
+ styleNode.setAttribute("data-permanent", ""), document.head.appendChild(styleNode);
420
432
  }
421
- const $t = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M20.536 3.464C19.07 2 16.714 2 12 2C7.286 2 4.929 2 3.464 3.464C2 4.93 2 7.286 2 12c0 4.714 0 7.071 1.464 8.535C4.93 22 7.286 22 12 22c4.714 0 7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536M16.75 12a.75.75 0 0 1-.75.75H9.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 1 1 1.06 1.06l-1.72 1.72H16a.75.75 0 0 1 .75.75" clip-rule="evenodd"/></svg>', It = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M15.24 2h-3.894c-1.764 0-3.162 0-4.255.148c-1.126.152-2.037.472-2.755 1.193c-.719.721-1.038 1.636-1.189 2.766C3 7.205 3 8.608 3 10.379v5.838c0 1.508.92 2.8 2.227 3.342c-.067-.91-.067-2.185-.067-3.247v-5.01c0-1.281 0-2.386.118-3.27c.127-.948.413-1.856 1.147-2.593c.734-.737 1.639-1.024 2.583-1.152c.88-.118 1.98-.118 3.257-.118h3.07c1.276 0 2.374 0 3.255.118A3.601 3.601 0 0 0 15.24 2Z"/><path d="M6.6 11.397c0-2.726 0-4.089.844-4.936c.843-.847 2.2-.847 4.916-.847h2.88c2.715 0 4.073 0 4.917.847c.843.847.843 2.21.843 4.936v4.82c0 2.726 0 4.089-.843 4.936c-.844.847-2.202.847-4.917.847h-2.88c-2.715 0-4.073 0-4.916-.847c-.844-.847-.844-2.21-.844-4.936v-4.82Z"/></svg>', as = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10-5.75a.75.75 0 0 1 .75.75v5.19l1.72-1.72a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 1 1 1.06-1.06l1.72 1.72V7a.75.75 0 0 1 .75-.75Zm-4 10a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5H8Z" clip-rule="evenodd"/></svg>', ls = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10 5.75a.75.75 0 0 0 .75-.75v-5.19l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72V17c0 .414.336.75.75.75Zm-4-10a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 0 1.5H8Z" clip-rule="evenodd"/></svg>', Ht = `<svg
433
+ const resetIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M20.536 3.464C19.07 2 16.714 2 12 2C7.286 2 4.929 2 3.464 3.464C2 4.93 2 7.286 2 12c0 4.714 0 7.071 1.464 8.535C4.93 22 7.286 22 12 22c4.714 0 7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536M16.75 12a.75.75 0 0 1-.75.75H9.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 1 1 1.06 1.06l-1.72 1.72H16a.75.75 0 0 1 .75.75" clip-rule="evenodd"/></svg>', copyIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M15.24 2h-3.894c-1.764 0-3.162 0-4.255.148c-1.126.152-2.037.472-2.755 1.193c-.719.721-1.038 1.636-1.189 2.766C3 7.205 3 8.608 3 10.379v5.838c0 1.508.92 2.8 2.227 3.342c-.067-.91-.067-2.185-.067-3.247v-5.01c0-1.281 0-2.386.118-3.27c.127-.948.413-1.856 1.147-2.593c.734-.737 1.639-1.024 2.583-1.152c.88-.118 1.98-.118 3.257-.118h3.07c1.276 0 2.374 0 3.255.118A3.601 3.601 0 0 0 15.24 2Z"/><path d="M6.6 11.397c0-2.726 0-4.089.844-4.936c.843-.847 2.2-.847 4.916-.847h2.88c2.715 0 4.073 0 4.917.847c.843.847.843 2.21.843 4.936v4.82c0 2.726 0 4.089-.843 4.936c-.844.847-2.202.847-4.917.847h-2.88c-2.715 0-4.073 0-4.916-.847c-.844-.847-.844-2.21-.844-4.936v-4.82Z"/></svg>', downloadIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10-5.75a.75.75 0 0 1 .75.75v5.19l1.72-1.72a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 1 1 1.06-1.06l1.72 1.72V7a.75.75 0 0 1 .75-.75Zm-4 10a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5H8Z" clip-rule="evenodd"/></svg>', uploadIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10 5.75a.75.75 0 0 0 .75-.75v-5.19l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72V17c0 .414.336.75.75.75Zm-4-10a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 0 1.5H8Z" clip-rule="evenodd"/></svg>', arrowIcon = `<svg
422
434
  xmlns="http://www.w3.org/2000/svg"
423
435
  width="32"
424
436
  height="32"
@@ -427,57 +439,58 @@ const $t = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewB
427
439
  <path d="m12.37 15.835l6.43-6.63C19.201 8.79 18.958 8 18.43 8H5.57c-.528 0-.771.79-.37 1.205l6.43 6.63c.213.22.527.22.74 0Z" />
428
440
  </svg>
429
441
  `;
430
- var J, T, V;
431
- class hs {
442
+ var _localStorageStudioName, _openedPanels, _changedSizes;
443
+ const _TweakerStorage = class _TweakerStorage {
432
444
  constructor() {
433
- o(this, J);
434
- o(this, T);
435
- o(this, V);
436
- this.scrollValue = 0, c(this, J, ""), c(this, T, []), c(this, V, {}), c(this, J, K.name + "-tweaker");
445
+ __privateAdd(this, _localStorageStudioName);
446
+ __privateAdd(this, _openedPanels);
447
+ __privateAdd(this, _changedSizes);
448
+ this.scrollValue = 0, __privateSet(this, _localStorageStudioName, ""), __privateSet(this, _openedPanels, []), __privateSet(this, _changedSizes, {}), __privateSet(this, _localStorageStudioName, storeRegistry.name + "-tweaker");
437
449
  }
438
- openPanel(s) {
439
- t(this, T).includes(s) || t(this, T).push(s);
450
+ openPanel(key) {
451
+ __privateGet(this, _openedPanels).includes(key) || __privateGet(this, _openedPanels).push(key);
440
452
  }
441
- closePanel(s) {
442
- c(this, T, t(this, T).filter((e) => e !== s));
453
+ closePanel(key) {
454
+ __privateSet(this, _openedPanels, __privateGet(this, _openedPanels).filter((v) => v !== key));
443
455
  }
444
- isPanelOpened(s) {
445
- return t(this, T).includes(s);
456
+ isPanelOpened(key) {
457
+ return __privateGet(this, _openedPanels).includes(key);
446
458
  }
447
- changedSizes(s) {
448
- return t(this, V)[s];
459
+ changedSizes(key) {
460
+ return __privateGet(this, _changedSizes)[key];
449
461
  }
450
- changeSize(s, e) {
451
- e ? t(this, V)[s] = e : delete t(this, V)[s];
462
+ changeSize(key, value) {
463
+ value ? __privateGet(this, _changedSizes)[key] = value : delete __privateGet(this, _changedSizes)[key];
452
464
  }
453
465
  save() {
454
- const s = {
455
- openedPanels: t(this, T),
456
- changedSizes: t(this, V),
466
+ const state = {
467
+ openedPanels: __privateGet(this, _openedPanels),
468
+ changedSizes: __privateGet(this, _changedSizes),
457
469
  scrollValue: this.scrollValue
458
470
  };
459
- localStorage.setItem(t(this, J), JSON.stringify(s)), K.saveState();
471
+ localStorage.setItem(__privateGet(this, _localStorageStudioName), JSON.stringify(state)), storeRegistry.saveState();
460
472
  }
461
473
  load() {
462
- K.loadState();
463
- const s = localStorage.getItem(t(this, J));
464
- if (s)
474
+ storeRegistry.loadState();
475
+ const stringState = localStorage.getItem(__privateGet(this, _localStorageStudioName));
476
+ if (stringState)
465
477
  try {
466
- const e = JSON.parse(s);
467
- e.openedPanels && c(this, T, e.openedPanels), e.changedSizes && c(this, V, e.changedSizes), e.scrollValue && (this.scrollValue = e.scrollValue);
478
+ const state = JSON.parse(stringState);
479
+ state.openedPanels && __privateSet(this, _openedPanels, state.openedPanels), state.changedSizes && __privateSet(this, _changedSizes, state.changedSizes), state.scrollValue && (this.scrollValue = state.scrollValue);
468
480
  } catch (e) {
469
481
  console.error(e);
470
482
  }
471
483
  }
472
- }
473
- J = new WeakMap(), T = new WeakMap(), V = new WeakMap();
474
- const C = new hs(), cs = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path d="m243.33 90.91l-128.41 128.4a16 16 0 0 1-22.63 0l-71.62-72a16 16 0 0 1 0-22.61l24-24a16 16 0 0 1 22.57-.06l36.64 35.27l.11.11l92.73-91.37a16 16 0 0 1 22.58 0l24 23.56a16 16 0 0 1 .03 22.7Z"/></svg>', ds = E({
484
+ };
485
+ _localStorageStudioName = new WeakMap(), _openedPanels = new WeakMap(), _changedSizes = new WeakMap(), __name(_TweakerStorage, "TweakerStorage");
486
+ let TweakerStorage = _TweakerStorage;
487
+ const tweakerStorage = new TweakerStorage(), checkIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path d="m243.33 90.91l-128.41 128.4a16 16 0 0 1-22.63 0l-71.62-72a16 16 0 0 1 0-22.61l24-24a16 16 0 0 1 22.57-.06l36.64 35.27l.11.11l92.73-91.37a16 16 0 0 1 22.58 0l24 23.56a16 16 0 0 1 .03 22.7Z"/></svg>', stylesheet$c = createStylesheet({
475
488
  ":host": {
476
489
  position: "relative",
477
490
  display: "inline-block",
478
491
  width: "30px",
479
492
  height: "30px",
480
- borderRadius: f.borderRadiusSmall.var,
493
+ borderRadius: aptechkaTheme.borderRadiusSmall.var,
481
494
  overflow: "hidden"
482
495
  },
483
496
  "label, .fake": {
@@ -500,12 +513,12 @@ const C = new hs(), cs = '<svg xmlns="http://www.w3.org/2000/svg" width="32" hei
500
513
  display: "flex",
501
514
  alignItems: "center",
502
515
  justifyContent: "center",
503
- backgroundColor: f.colorMainAux.var
516
+ backgroundColor: aptechkaTheme.colorMainAux.var
504
517
  },
505
518
  ".default svg": {
506
519
  width: "60%",
507
520
  height: "60%",
508
- fill: f.colorFont.var,
521
+ fill: aptechkaTheme.colorFont.var,
509
522
  opacity: 0,
510
523
  transition: "var(--duration-short)"
511
524
  },
@@ -513,88 +526,89 @@ const C = new hs(), cs = '<svg xmlns="http://www.w3.org/2000/svg" width="32" hei
513
526
  opacity: 1
514
527
  }
515
528
  });
516
- var O, te, Y, be;
517
- const gt = class gt extends HTMLElement {
529
+ var _inputElement, _internals, _CheckboxElement_instances, setFormValue_fn;
530
+ const _CheckboxElement = class _CheckboxElement extends HTMLElement {
518
531
  constructor() {
519
532
  super();
520
- o(this, Y);
521
- o(this, O, null);
522
- o(this, te);
523
- const e = this.attachShadow({ mode: "open" });
524
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, ds], c(this, te, this.attachInternals()), g(this, {
525
- children: Ft({
533
+ __privateAdd(this, _CheckboxElement_instances);
534
+ __privateAdd(this, _inputElement, null);
535
+ __privateAdd(this, _internals);
536
+ const shadow = this.attachShadow({ mode: "open" });
537
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$c], __privateSet(this, _internals, this.attachInternals()), element(this, {
538
+ children: label({
526
539
  children: [
527
- lt({
540
+ span({
528
541
  class: "fake",
529
- children: me({
542
+ children: slot({
530
543
  children: [
531
- lt({
544
+ span({
532
545
  class: "default",
533
- children: [cs]
546
+ children: [checkIcon]
534
547
  })
535
548
  ]
536
549
  })
537
550
  }),
538
- Ve({
539
- ref: (i) => {
540
- c(this, O, i), i.required = this.hasAttribute("required"), i.value = this.getAttribute("value") || "", i.checked = this.hasAttribute("checked"), i.name = this.getAttribute("name") || "", l(this, Y, be).call(this);
541
- },
551
+ input({
552
+ ref: /* @__PURE__ */ __name((e) => {
553
+ __privateSet(this, _inputElement, e), e.required = this.hasAttribute("required"), e.value = this.getAttribute("value") || "", e.checked = this.hasAttribute("checked"), e.name = this.getAttribute("name") || "", __privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this);
554
+ }, "ref"),
542
555
  class: "real",
543
556
  type: "checkbox",
544
- onChange: () => {
545
- l(this, Y, be).call(this), this.dispatchEvent(
557
+ onChange: /* @__PURE__ */ __name(() => {
558
+ __privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this), this.dispatchEvent(
546
559
  new Event("change", {
547
560
  composed: !0
548
561
  })
549
562
  );
550
- }
563
+ }, "onChange")
551
564
  })
552
565
  ]
553
566
  })
554
567
  });
555
568
  }
556
569
  get checked() {
557
- return t(this, O).checked;
570
+ return __privateGet(this, _inputElement).checked;
558
571
  }
559
- set checked(e) {
560
- t(this, O).checked = e, l(this, Y, be).call(this);
572
+ set checked(state) {
573
+ __privateGet(this, _inputElement).checked = state, __privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this);
561
574
  }
562
575
  get value() {
563
- return t(this, O).value;
576
+ return __privateGet(this, _inputElement).value;
564
577
  }
565
- set value(e) {
566
- t(this, O).value = e, l(this, Y, be).call(this);
578
+ set value(value) {
579
+ __privateGet(this, _inputElement).value = value, __privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this);
567
580
  }
568
581
  };
569
- O = new WeakMap(), te = new WeakMap(), Y = new WeakSet(), be = function() {
570
- this.checked ? t(this, te).setFormValue(this.value) : t(this, te).setFormValue(null), this.classList.toggle("checked", this.checked);
571
- }, gt.formAssociated = !0;
572
- let ht = gt;
573
- p && !customElements.get("e-checkbox") && customElements.define("e-checkbox", ht);
574
- var Z;
575
- class pe extends HTMLElement {
576
- constructor(...e) {
582
+ _inputElement = new WeakMap(), _internals = new WeakMap(), _CheckboxElement_instances = new WeakSet(), setFormValue_fn = /* @__PURE__ */ __name(function() {
583
+ this.checked ? __privateGet(this, _internals).setFormValue(this.value) : __privateGet(this, _internals).setFormValue(null), this.classList.toggle("checked", this.checked);
584
+ }, "#setFormValue"), __name(_CheckboxElement, "CheckboxElement"), _CheckboxElement.formAssociated = !0;
585
+ let CheckboxElement = _CheckboxElement;
586
+ isBrowser && !customElements.get("e-checkbox") && customElements.define("e-checkbox", CheckboxElement);
587
+ var _stores;
588
+ const _TweakerStoreManagerElement = class _TweakerStoreManagerElement extends HTMLElement {
589
+ constructor(...stores) {
577
590
  super();
578
- o(this, Z);
579
- c(this, Z, e);
591
+ __privateAdd(this, _stores);
592
+ __privateSet(this, _stores, stores);
580
593
  }
581
- addStore(e) {
582
- t(this, Z).push(e);
594
+ addStore(store) {
595
+ __privateGet(this, _stores).push(store);
583
596
  }
584
597
  get firstStore() {
585
- return t(this, Z)[0];
598
+ return __privateGet(this, _stores)[0];
586
599
  }
587
600
  get stores() {
588
- return t(this, Z);
601
+ return __privateGet(this, _stores);
589
602
  }
590
- updateStores(e) {
591
- t(this, Z).forEach((i) => {
592
- i.current = e;
603
+ updateStores(value) {
604
+ __privateGet(this, _stores).forEach((store) => {
605
+ store.current = value;
593
606
  });
594
607
  }
595
- }
596
- Z = new WeakMap();
597
- const us = E({
608
+ };
609
+ _stores = new WeakMap(), __name(_TweakerStoreManagerElement, "TweakerStoreManagerElement");
610
+ let TweakerStoreManagerElement = _TweakerStoreManagerElement;
611
+ const stylesheet$b = createStylesheet({
598
612
  ":host": {
599
613
  width: "100%",
600
614
  display: "inline-flex",
@@ -604,34 +618,35 @@ const us = E({
604
618
  "--size": "calc(var(--height-input) * 0.8)",
605
619
  width: "var(--size)",
606
620
  height: "var(--size)",
607
- borderRadius: f.borderRadiusSmall.var
621
+ borderRadius: aptechkaTheme.borderRadiusSmall.var
608
622
  }
609
- });
610
- class Dt extends pe {
611
- constructor(...s) {
612
- super(...s);
613
- const e = this.attachShadow({ mode: "open" });
614
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, us], g(this, {
623
+ }), _TweakerBooleanManagerElement = class _TweakerBooleanManagerElement extends TweakerStoreManagerElement {
624
+ constructor(...stores) {
625
+ super(...stores);
626
+ const shadow = this.attachShadow({ mode: "open" });
627
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$b], element(this, {
615
628
  children: [
616
- g("e-checkbox", {
617
- onChange: (i) => {
618
- this.updateStores(i.currentTarget.checked);
619
- },
620
- ref: (i) => {
621
- this.firstStore.subscribe((n) => {
622
- i.checked = n.current;
629
+ element("e-checkbox", {
630
+ onChange: /* @__PURE__ */ __name((e) => {
631
+ this.updateStores(e.currentTarget.checked);
632
+ }, "onChange"),
633
+ ref: /* @__PURE__ */ __name((e) => {
634
+ this.firstStore.subscribe((d) => {
635
+ e.checked = d.current;
623
636
  });
624
- }
637
+ }, "ref")
625
638
  })
626
639
  ]
627
640
  });
628
641
  }
629
- }
630
- p && !customElements.get("e-tweaker-boolean-manager") && customElements.define(
642
+ };
643
+ __name(_TweakerBooleanManagerElement, "TweakerBooleanManagerElement");
644
+ let TweakerBooleanManagerElement = _TweakerBooleanManagerElement;
645
+ isBrowser && !customElements.get("e-tweaker-boolean-manager") && customElements.define(
631
646
  "e-tweaker-boolean-manager",
632
- Dt
647
+ TweakerBooleanManagerElement
633
648
  );
634
- const fs = E({
649
+ const stylesheet$a = createStylesheet({
635
650
  ":host": {
636
651
  width: "100%",
637
652
  display: "inline-flex",
@@ -642,7 +657,7 @@ const fs = E({
642
657
  height: "var(--height-input)",
643
658
  padding: "0",
644
659
  background: "none",
645
- borderRadius: f.borderRadius.var,
660
+ borderRadius: aptechkaTheme.borderRadius.var,
646
661
  border: "none",
647
662
  blockSize: "unset"
648
663
  },
@@ -650,52 +665,54 @@ const fs = E({
650
665
  boxSizing: "border-box",
651
666
  padding: "0px",
652
667
  border: "none",
653
- borderRadius: f.borderRadius.var,
668
+ borderRadius: aptechkaTheme.borderRadius.var,
654
669
  height: "calc(var(--height-input) * 0.93)"
655
670
  }
656
- });
657
- class Vt extends pe {
658
- constructor(...s) {
659
- super(...s);
660
- const e = this.attachShadow({ mode: "open" });
661
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, fs], g(this, {
671
+ }), _TweakerColorManagerElement = class _TweakerColorManagerElement extends TweakerStoreManagerElement {
672
+ constructor(...stores) {
673
+ super(...stores);
674
+ const shadow = this.attachShadow({ mode: "open" });
675
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$a], element(this, {
662
676
  children: [
663
- Ve({
677
+ input({
664
678
  type: "color",
665
679
  value: this.firstStore,
666
- onInput: (i) => {
667
- this.updateStores(i.currentTarget.value);
668
- }
680
+ onInput: /* @__PURE__ */ __name((e) => {
681
+ this.updateStores(e.currentTarget.value);
682
+ }, "onInput")
669
683
  })
670
684
  ]
671
685
  });
672
686
  }
673
- }
674
- p && !customElements.get("e-tweaker-color-manager") && customElements.define("e-tweaker-color-manager", Vt);
675
- const ms = E({
687
+ };
688
+ __name(_TweakerColorManagerElement, "TweakerColorManagerElement");
689
+ let TweakerColorManagerElement = _TweakerColorManagerElement;
690
+ isBrowser && !customElements.get("e-tweaker-color-manager") && customElements.define("e-tweaker-color-manager", TweakerColorManagerElement);
691
+ const stylesheet$9 = createStylesheet({
676
692
  a: {
677
693
  color: "inherit",
678
694
  fontSize: "var(--font-size-small)"
679
695
  }
680
- });
681
- class _t extends pe {
682
- constructor(...s) {
683
- var i;
684
- super(...s);
685
- const e = this.attachShadow({ mode: "open" });
686
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, ms], g(this, {
696
+ }), _TweakerLinkManagerElement = class _TweakerLinkManagerElement extends TweakerStoreManagerElement {
697
+ constructor(...stores) {
698
+ var _a;
699
+ super(...stores);
700
+ const shadow = this.attachShadow({ mode: "open" });
701
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$9], element(this, {
687
702
  children: [
688
- os({
703
+ a({
689
704
  href: this.firstStore,
690
- target: (i = this.firstStore.__manager) != null && i.sameWindow ? "_self" : "_blank",
705
+ target: (_a = this.firstStore.__manager) != null && _a.sameWindow ? "_self" : "_blank",
691
706
  children: this.firstStore
692
707
  })
693
708
  ]
694
709
  });
695
710
  }
696
- }
697
- p && !customElements.get("e-tweaker-link-manager") && customElements.define("e-tweaker-link-manager", _t);
698
- const ps = E({
711
+ };
712
+ __name(_TweakerLinkManagerElement, "TweakerLinkManagerElement");
713
+ let TweakerLinkManagerElement = _TweakerLinkManagerElement;
714
+ isBrowser && !customElements.get("e-tweaker-link-manager") && customElements.define("e-tweaker-link-manager", TweakerLinkManagerElement);
715
+ const stylesheet$8 = createStylesheet({
699
716
  ":host": {
700
717
  width: "100%",
701
718
  display: "flex",
@@ -720,7 +737,7 @@ const ps = E({
720
737
  margin: "0",
721
738
  padding: "0 var(--gap-small)",
722
739
  backgroundColor: "rgba(255, 255, 255, 0.1)",
723
- borderRadius: f.borderRadius.var
740
+ borderRadius: aptechkaTheme.borderRadius.var
724
741
  },
725
742
  ".drag": {
726
743
  position: "relative",
@@ -736,12 +753,12 @@ const ps = E({
736
753
  width: "100%",
737
754
  zIndex: "-1",
738
755
  height: "1px",
739
- borderBottom: `1px solid ${f.colorFont.var}`,
756
+ borderBottom: `1px solid ${aptechkaTheme.colorFont.var}`,
740
757
  transform: "translateY(-50%)",
741
758
  opacity: "0.3"
742
759
  },
743
760
  ":host(.infinite) .drag::before": {
744
- borderBottom: `1px dashed ${f.colorFont.var}`
761
+ borderBottom: `1px dashed ${aptechkaTheme.colorFont.var}`
745
762
  },
746
763
  ".drag-knob": {
747
764
  "--size": "calc(var(--height-input) * 0.4)",
@@ -751,96 +768,96 @@ const ps = E({
751
768
  ".drag-knob-inner": {
752
769
  width: "100%",
753
770
  height: "100%",
754
- backgroundColor: f.colorFont.var,
755
- borderRadius: f.borderRadiusSmall.var,
771
+ backgroundColor: aptechkaTheme.colorFont.var,
772
+ borderRadius: aptechkaTheme.borderRadiusSmall.var,
756
773
  transition: "opacity var(--duration-short)"
757
774
  },
758
775
  ":host(.infinite) .grabbing .drag-knob-inner": {
759
776
  opacity: 0.3
760
777
  }
761
778
  });
762
- var G, se, ie, _, W, ve, ye, F, U, Se, ke, b, Q, ct, dt, Ke, Ee;
763
- class Bt extends pe {
764
- constructor(...e) {
765
- var n, h, u, m;
766
- super(...e);
767
- o(this, b);
768
- o(this, G, []);
769
- o(this, se, []);
770
- o(this, ie);
771
- o(this, _);
772
- o(this, W);
773
- o(this, ve);
774
- o(this, ye);
775
- o(this, F);
776
- o(this, U, !1);
777
- o(this, Se, (e) => {
778
- const i = l(this, b, Q).call(this, e);
779
- return i.map((n, h) => {
780
- const u = typeof n == "string" ? parseFloat(n) || t(this, _) : n, m = ts(u, t(this, _), t(this, W)), k = ss(m, t(this, ie));
781
- i[h] = k;
782
- }), t(this, ye) === "number" ? i[0] : i;
783
- });
784
- o(this, ke, () => {
785
- l(this, b, Q).call(this).map((e, i) => {
786
- const n = t(this, G)[i];
787
- n && (n.value = (e || 0).toString());
788
- }), l(this, b, ct).call(this);
789
- });
790
- o(this, Ee, () => {
791
- l(this, b, ct).call(this);
792
- });
793
- const i = this.attachShadow({ mode: "open" });
794
- i.adoptedStyleSheets = [...i.adoptedStyleSheets, ps], c(this, _, St((n = this.firstStore.__manager) == null ? void 0 : n.min, -1 / 0)), c(this, W, St((h = this.firstStore.__manager) == null ? void 0 : h.max, 1 / 0)), c(this, ie, ((u = this.firstStore.__manager) == null ? void 0 : u.step) || 0.01), c(this, ve, ((m = this.firstStore.__manager) == null ? void 0 : m.ease) || 1), c(this, ye, Array.isArray(this.firstStore.current) ? "array" : "number"), c(this, F, isFinite(t(this, W)) && isFinite(t(this, _))), g(this, {
795
- class: t(this, F) ? "" : "infinite",
796
- children: l(this, b, Q).call(this).map((k, L) => w({
779
+ var _inputElements, _knobElements, _step, _min, _max, _ease, _type, _isFinite, _isDragging, _storeMiddleware, _storeChangeListener, _TweakerNumberManagerElement_instances, getArray_fn, updateKnobPositions_fn, getDistance_fn, getKnobPosition_fn, _resizeListener;
780
+ const _TweakerNumberManagerElement = class _TweakerNumberManagerElement extends TweakerStoreManagerElement {
781
+ constructor(...stores) {
782
+ var _a, _b, _c, _d;
783
+ super(...stores);
784
+ __privateAdd(this, _TweakerNumberManagerElement_instances);
785
+ __privateAdd(this, _inputElements, []);
786
+ __privateAdd(this, _knobElements, []);
787
+ __privateAdd(this, _step);
788
+ __privateAdd(this, _min);
789
+ __privateAdd(this, _max);
790
+ __privateAdd(this, _ease);
791
+ __privateAdd(this, _type);
792
+ __privateAdd(this, _isFinite);
793
+ __privateAdd(this, _isDragging, !1);
794
+ __privateAdd(this, _storeMiddleware, /* @__PURE__ */ __name((value) => {
795
+ const arr = __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this, value);
796
+ return arr.map((v, i) => {
797
+ const number = typeof v == "string" ? parseFloat(v) || __privateGet(this, _min) : v, clamped = clamp(number, __privateGet(this, _min), __privateGet(this, _max)), fixed = toStep(clamped, __privateGet(this, _step));
798
+ arr[i] = fixed;
799
+ }), __privateGet(this, _type) === "number" ? arr[0] : arr;
800
+ }, "#storeMiddleware"));
801
+ __privateAdd(this, _storeChangeListener, /* @__PURE__ */ __name(() => {
802
+ __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this).map((v, i) => {
803
+ const inputElement = __privateGet(this, _inputElements)[i];
804
+ inputElement && (inputElement.value = (v || 0).toString());
805
+ }), __privateMethod(this, _TweakerNumberManagerElement_instances, updateKnobPositions_fn).call(this);
806
+ }, "#storeChangeListener"));
807
+ __privateAdd(this, _resizeListener, /* @__PURE__ */ __name(() => {
808
+ __privateMethod(this, _TweakerNumberManagerElement_instances, updateKnobPositions_fn).call(this);
809
+ }, "#resizeListener"));
810
+ const shadow = this.attachShadow({ mode: "open" });
811
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$8], __privateSet(this, _min, nullishCoalescing((_a = this.firstStore.__manager) == null ? void 0 : _a.min, -1 / 0)), __privateSet(this, _max, nullishCoalescing((_b = this.firstStore.__manager) == null ? void 0 : _b.max, 1 / 0)), __privateSet(this, _step, ((_c = this.firstStore.__manager) == null ? void 0 : _c.step) || 0.01), __privateSet(this, _ease, ((_d = this.firstStore.__manager) == null ? void 0 : _d.ease) || 1), __privateSet(this, _type, Array.isArray(this.firstStore.current) ? "array" : "number"), __privateSet(this, _isFinite, isFinite(__privateGet(this, _max)) && isFinite(__privateGet(this, _min))), element(this, {
812
+ class: __privateGet(this, _isFinite) ? "" : "infinite",
813
+ children: __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this).map((v, i) => div({
797
814
  class: "inputs-wrapper",
798
815
  children: [
799
- Ve({
816
+ input({
800
817
  type: "number",
801
- step: t(this, ie),
802
- min: t(this, _),
803
- max: t(this, W),
804
- ref: (v) => t(this, G).push(v),
805
- value: k,
806
- onChange: () => {
818
+ step: __privateGet(this, _step),
819
+ min: __privateGet(this, _min),
820
+ max: __privateGet(this, _max),
821
+ ref: /* @__PURE__ */ __name((e) => __privateGet(this, _inputElements).push(e), "ref"),
822
+ value: v,
823
+ onChange: /* @__PURE__ */ __name(() => {
807
824
  this.updateStores(
808
- t(this, G).map((v) => parseFloat(v.value))
825
+ __privateGet(this, _inputElements).map((el) => parseFloat(el.value))
809
826
  );
810
- }
827
+ }, "onChange")
811
828
  }),
812
- w({
829
+ div({
813
830
  class: "drag",
814
831
  children: [
815
- w({
832
+ div({
816
833
  class: "drag-knob",
817
- ref: (v) => t(this, se).push(v),
818
- onPointerdown: (v) => {
819
- v.preventDefault(), c(this, U, !0);
820
- const ge = l(this, b, Q).call(this), _e = ge[L], x = t(this, se)[L], R = t(this, G)[L];
821
- if (x && R) {
822
- const P = x.parentElement, B = l(this, b, dt).call(this);
823
- P.classList.add("grabbing"), Et(
824
- (q) => {
825
- const wt = q.x - v.x, Jt = t(this, F) ? P.offsetWidth / (B || 1) : 1, Yt = _e + wt / Jt * t(this, ve);
826
- if (ge[L] = Yt, !t(this, F)) {
827
- const Gt = l(this, b, Ke).call(this, x, 0);
828
- x.style.transform = `translateX(${Gt + wt}px)`;
834
+ ref: /* @__PURE__ */ __name((e) => __privateGet(this, _knobElements).push(e), "ref"),
835
+ onPointerdown: /* @__PURE__ */ __name((grabEvent) => {
836
+ grabEvent.preventDefault(), __privateSet(this, _isDragging, !0);
837
+ const arr = __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this), startValue = arr[i], knobElement = __privateGet(this, _knobElements)[i], inputElement = __privateGet(this, _inputElements)[i];
838
+ if (knobElement && inputElement) {
839
+ const knobParentElement = knobElement.parentElement, distance = __privateMethod(this, _TweakerNumberManagerElement_instances, getDistance_fn).call(this);
840
+ knobParentElement.classList.add("grabbing"), setupDrag(
841
+ (moveEvent) => {
842
+ const delta = moveEvent.x - grabEvent.x, del = __privateGet(this, _isFinite) ? knobParentElement.offsetWidth / (distance || 1) : 1, newValue = startValue + delta / del * __privateGet(this, _ease);
843
+ if (arr[i] = newValue, !__privateGet(this, _isFinite)) {
844
+ const pos = __privateMethod(this, _TweakerNumberManagerElement_instances, getKnobPosition_fn).call(this, knobElement, 0);
845
+ knobElement.style.transform = `translateX(${pos + delta}px)`;
829
846
  }
830
- this.updateStores([...ge]);
847
+ this.updateStores([...arr]);
831
848
  },
832
849
  () => {
833
- if (c(this, U, !1), !t(this, F)) {
834
- const q = l(this, b, Ke).call(this, x, 0);
835
- x.style.transition = "transform 0.1s", x.style.transform = `translateX(${q}px)`, P.classList.remove("grabbing"), setTimeout(() => {
836
- x.style.transition = "";
850
+ if (__privateSet(this, _isDragging, !1), !__privateGet(this, _isFinite)) {
851
+ const pos = __privateMethod(this, _TweakerNumberManagerElement_instances, getKnobPosition_fn).call(this, knobElement, 0);
852
+ knobElement.style.transition = "transform 0.1s", knobElement.style.transform = `translateX(${pos}px)`, knobParentElement.classList.remove("grabbing"), setTimeout(() => {
853
+ knobElement.style.transition = "";
837
854
  }, 100);
838
855
  }
839
856
  }
840
857
  );
841
858
  }
842
- },
843
- children: w({
859
+ }, "onPointerdown"),
860
+ children: div({
844
861
  class: "drag-knob-inner"
845
862
  })
846
863
  })
@@ -851,46 +868,49 @@ class Bt extends pe {
851
868
  });
852
869
  }
853
870
  connectedCallback() {
854
- this.firstStore.addMiddleware(t(this, Se)), this.firstStore.subscribe(t(this, ke)), kt.subscribe(this, t(this, Ee));
871
+ this.firstStore.addMiddleware(__privateGet(this, _storeMiddleware)), this.firstStore.subscribe(__privateGet(this, _storeChangeListener)), elementResizer.subscribe(this, __privateGet(this, _resizeListener));
855
872
  }
856
873
  disconnectedCallback() {
857
- this.firstStore.removeMiddleware(t(this, Se)), this.firstStore.unsubscribe(t(this, ke)), kt.unsubscribe(t(this, Ee));
874
+ this.firstStore.removeMiddleware(__privateGet(this, _storeMiddleware)), this.firstStore.unsubscribe(__privateGet(this, _storeChangeListener)), elementResizer.unsubscribe(__privateGet(this, _resizeListener));
858
875
  }
859
- }
860
- G = new WeakMap(), se = new WeakMap(), ie = new WeakMap(), _ = new WeakMap(), W = new WeakMap(), ve = new WeakMap(), ye = new WeakMap(), F = new WeakMap(), U = new WeakMap(), Se = new WeakMap(), ke = new WeakMap(), b = new WeakSet(), Q = function(e = this.firstStore.current) {
861
- return Array.isArray(e) ? e : [e];
862
- }, ct = function() {
863
- l(this, b, Q).call(this).map((e, i) => {
864
- const n = t(this, se)[i];
865
- if (n && (!t(this, U) || t(this, U) && t(this, F))) {
866
- const h = l(this, b, Ke).call(this, n, e);
867
- n.style.transform = `translateX(${h}px)`;
876
+ };
877
+ _inputElements = new WeakMap(), _knobElements = new WeakMap(), _step = new WeakMap(), _min = new WeakMap(), _max = new WeakMap(), _ease = new WeakMap(), _type = new WeakMap(), _isFinite = new WeakMap(), _isDragging = new WeakMap(), _storeMiddleware = new WeakMap(), _storeChangeListener = new WeakMap(), _TweakerNumberManagerElement_instances = new WeakSet(), getArray_fn = /* @__PURE__ */ __name(function(value = this.firstStore.current) {
878
+ return Array.isArray(value) ? value : [value];
879
+ }, "#getArray"), updateKnobPositions_fn = /* @__PURE__ */ __name(function() {
880
+ __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this).map((v, i) => {
881
+ const knobElement = __privateGet(this, _knobElements)[i];
882
+ if (knobElement && (!__privateGet(this, _isDragging) || __privateGet(this, _isDragging) && __privateGet(this, _isFinite))) {
883
+ const position = __privateMethod(this, _TweakerNumberManagerElement_instances, getKnobPosition_fn).call(this, knobElement, v);
884
+ knobElement.style.transform = `translateX(${position}px)`;
868
885
  }
869
886
  });
870
- }, dt = function() {
871
- return t(this, F) ? t(this, W) - t(this, _) : 0;
872
- }, Ke = function(e, i) {
873
- const n = e.parentElement, h = l(this, b, dt).call(this), u = h ? i / h : 0.5;
874
- return (n.offsetWidth - e.offsetWidth) * u;
875
- }, Ee = new WeakMap();
876
- p && !customElements.get("e-tweaker-number-manager") && customElements.define("e-tweaker-number-manager", Bt);
877
- function Kt(r) {
878
- r.dispatchEvent(
887
+ }, "#updateKnobPositions"), getDistance_fn = /* @__PURE__ */ __name(function() {
888
+ return __privateGet(this, _isFinite) ? __privateGet(this, _max) - __privateGet(this, _min) : 0;
889
+ }, "#getDistance"), getKnobPosition_fn = /* @__PURE__ */ __name(function(knobElement, inputValue) {
890
+ const parentElement = knobElement.parentElement, distance = __privateMethod(this, _TweakerNumberManagerElement_instances, getDistance_fn).call(this), progress = distance ? inputValue / distance : 0.5;
891
+ return (parentElement.offsetWidth - knobElement.offsetWidth) * progress;
892
+ }, "#getKnobPosition"), _resizeListener = new WeakMap(), __name(_TweakerNumberManagerElement, "TweakerNumberManagerElement");
893
+ let TweakerNumberManagerElement = _TweakerNumberManagerElement;
894
+ isBrowser && !customElements.get("e-tweaker-number-manager") && customElements.define("e-tweaker-number-manager", TweakerNumberManagerElement);
895
+ function dispatchSizeChangeEvent(node) {
896
+ node.dispatchEvent(
879
897
  new CustomEvent("sizeChange", {
880
898
  bubbles: !0,
881
899
  composed: !0
882
900
  })
883
901
  );
884
902
  }
885
- function gs(r) {
886
- r.dispatchEvent(
903
+ __name(dispatchSizeChangeEvent, "dispatchSizeChangeEvent");
904
+ function dispatchBeforeSizeChangeEvent(node) {
905
+ node.dispatchEvent(
887
906
  new CustomEvent("beforeSizeChange", {
888
907
  bubbles: !0,
889
908
  composed: !0
890
909
  })
891
910
  );
892
911
  }
893
- const bs = E({
912
+ __name(dispatchBeforeSizeChangeEvent, "dispatchBeforeSizeChangeEvent");
913
+ const stylesheet$7 = createStylesheet({
894
914
  ":host": {
895
915
  position: "relative"
896
916
  },
@@ -925,112 +945,113 @@ const bs = E({
925
945
  paddingTop: "var(--gap, 0px)"
926
946
  }
927
947
  });
928
- var ne, oe, z, X, re, ae, Ye, xe, ft;
929
- const bt = class bt extends HTMLElement {
948
+ var _internals2, _value, _bodyElement, _opened, _timeoutId, _resizeObserver, _resizeObserverListener, _SelectElement_instances, dispatchToggleEvent_fn;
949
+ const _SelectElement = class _SelectElement extends HTMLElement {
930
950
  constructor() {
931
951
  super();
932
- o(this, xe);
933
- o(this, ne, null);
934
- o(this, oe, "");
935
- o(this, z, null);
936
- o(this, X, !1);
937
- o(this, re);
938
- o(this, ae, null);
939
- o(this, Ye, () => {
940
- Kt(this);
941
- });
942
- if (p) {
943
- const e = this.attachShadow({ mode: "open" });
944
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, bs], c(this, ne, this.attachInternals()), c(this, ae, new ResizeObserver(t(this, Ye))), g(this, {
952
+ __privateAdd(this, _SelectElement_instances);
953
+ __privateAdd(this, _internals2, null);
954
+ __privateAdd(this, _value, "");
955
+ __privateAdd(this, _bodyElement, null);
956
+ __privateAdd(this, _opened, !1);
957
+ __privateAdd(this, _timeoutId);
958
+ __privateAdd(this, _resizeObserver, null);
959
+ __privateAdd(this, _resizeObserverListener, /* @__PURE__ */ __name(() => {
960
+ dispatchSizeChangeEvent(this);
961
+ }, "#resizeObserverListener"));
962
+ if (isBrowser) {
963
+ const shadow = this.attachShadow({ mode: "open" });
964
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$7], __privateSet(this, _internals2, this.attachInternals()), __privateSet(this, _resizeObserver, new ResizeObserver(__privateGet(this, _resizeObserverListener))), element(this, {
945
965
  children: [
946
- ee({
966
+ button({
947
967
  class: "head",
948
- children: me({ name: "head" }),
949
- onClick: () => {
968
+ children: slot({ name: "head" }),
969
+ onClick: /* @__PURE__ */ __name(() => {
950
970
  this.opened ? this.close() : this.open();
951
- }
971
+ }, "onClick")
952
972
  }),
953
- w({
973
+ div({
954
974
  class: "body",
955
975
  style: {
956
976
  height: "0px"
957
977
  },
958
- children: w({
978
+ children: div({
959
979
  class: "body-inner",
960
- children: me()
980
+ children: slot()
961
981
  }),
962
- ref: (i) => {
963
- c(this, z, i);
964
- }
982
+ ref: /* @__PURE__ */ __name((e) => {
983
+ __privateSet(this, _bodyElement, e);
984
+ }, "ref")
965
985
  })
966
986
  ]
967
987
  });
968
988
  }
969
989
  }
970
990
  get value() {
971
- return t(this, oe);
991
+ return __privateGet(this, _value);
972
992
  }
973
- set value(e) {
974
- c(this, oe, e), this.dispatchEvent(
993
+ set value(value) {
994
+ __privateSet(this, _value, value), this.dispatchEvent(
975
995
  new Event("change", {
976
996
  bubbles: !0,
977
997
  composed: !0
978
998
  })
979
- ), t(this, ne).setFormValue(t(this, oe));
999
+ ), __privateGet(this, _internals2).setFormValue(__privateGet(this, _value));
980
1000
  }
981
1001
  get internals() {
982
- return t(this, ne);
1002
+ return __privateGet(this, _internals2);
983
1003
  }
984
1004
  get opened() {
985
- return t(this, X);
1005
+ return __privateGet(this, _opened);
986
1006
  }
987
1007
  open() {
988
- clearTimeout(t(this, re)), c(this, X, !0), t(this, z).style.display = "grid", this.classList.add("triggered"), setTimeout(() => {
989
- this.classList.add("opened"), t(this, z).style.height = t(this, z).scrollHeight + "px", l(this, xe, ft).call(this);
1008
+ clearTimeout(__privateGet(this, _timeoutId)), __privateSet(this, _opened, !0), __privateGet(this, _bodyElement).style.display = "grid", this.classList.add("triggered"), setTimeout(() => {
1009
+ this.classList.add("opened"), __privateGet(this, _bodyElement).style.height = __privateGet(this, _bodyElement).scrollHeight + "px", __privateMethod(this, _SelectElement_instances, dispatchToggleEvent_fn).call(this);
990
1010
  }, 0);
991
1011
  }
992
1012
  close() {
993
- c(this, X, !1), t(this, z).style.height = "0px", this.classList.remove("opened"), l(this, xe, ft).call(this), c(this, re, setTimeout(() => {
994
- this.classList.remove("triggered"), t(this, z).style.display = "none";
995
- }, is(t(this, z))));
1013
+ __privateSet(this, _opened, !1), __privateGet(this, _bodyElement).style.height = "0px", this.classList.remove("opened"), __privateMethod(this, _SelectElement_instances, dispatchToggleEvent_fn).call(this), __privateSet(this, _timeoutId, setTimeout(() => {
1014
+ this.classList.remove("triggered"), __privateGet(this, _bodyElement).style.display = "none";
1015
+ }, getElementTransitionDurationMS(__privateGet(this, _bodyElement))));
996
1016
  }
997
1017
  connectedCallback() {
998
- t(this, ae).observe(t(this, z));
1018
+ __privateGet(this, _resizeObserver).observe(__privateGet(this, _bodyElement));
999
1019
  }
1000
1020
  disconnectedCallback() {
1001
- clearTimeout(t(this, re)), t(this, ae).disconnect();
1021
+ clearTimeout(__privateGet(this, _timeoutId)), __privateGet(this, _resizeObserver).disconnect();
1002
1022
  }
1003
1023
  };
1004
- ne = new WeakMap(), oe = new WeakMap(), z = new WeakMap(), X = new WeakMap(), re = new WeakMap(), ae = new WeakMap(), Ye = new WeakMap(), xe = new WeakSet(), ft = function() {
1005
- gs(this), this.dispatchEvent(
1024
+ _internals2 = new WeakMap(), _value = new WeakMap(), _bodyElement = new WeakMap(), _opened = new WeakMap(), _timeoutId = new WeakMap(), _resizeObserver = new WeakMap(), _resizeObserverListener = new WeakMap(), _SelectElement_instances = new WeakSet(), dispatchToggleEvent_fn = /* @__PURE__ */ __name(function() {
1025
+ dispatchBeforeSizeChangeEvent(this), this.dispatchEvent(
1006
1026
  new CustomEvent("selectToggle", {
1007
1027
  bubbles: !0,
1008
1028
  composed: !0,
1009
1029
  detail: {
1010
- opened: t(this, X)
1030
+ opened: __privateGet(this, _opened)
1011
1031
  }
1012
1032
  })
1013
1033
  );
1014
- }, bt.formAssociated = !0;
1015
- let ut = bt;
1016
- p && !customElements.get("e-select") && customElements.define("e-select", ut);
1017
- var Ce;
1018
- class Ot extends HTMLElement {
1034
+ }, "#dispatchToggleEvent"), __name(_SelectElement, "SelectElement"), _SelectElement.formAssociated = !0;
1035
+ let SelectElement = _SelectElement;
1036
+ isBrowser && !customElements.get("e-select") && customElements.define("e-select", SelectElement);
1037
+ var _selectElement;
1038
+ const _SelectUserElement = class _SelectUserElement extends HTMLElement {
1019
1039
  constructor() {
1020
1040
  super(...arguments);
1021
- o(this, Ce, null);
1041
+ __privateAdd(this, _selectElement, null);
1022
1042
  }
1023
1043
  get selectElement() {
1024
- return t(this, Ce);
1044
+ return __privateGet(this, _selectElement);
1025
1045
  }
1026
1046
  connectedCallback() {
1027
- var i, n;
1028
- const e = (n = (i = this.assignedSlot) == null ? void 0 : i.getRootNode()) == null ? void 0 : n.host;
1029
- e ? c(this, Ce, e) : console.log(this, "e-select not found");
1047
+ var _a, _b;
1048
+ const selectElement = (_b = (_a = this.assignedSlot) == null ? void 0 : _a.getRootNode()) == null ? void 0 : _b.host;
1049
+ selectElement ? __privateSet(this, _selectElement, selectElement) : console.log(this, "e-select not found");
1030
1050
  }
1031
- }
1032
- Ce = new WeakMap();
1033
- const ws = E({
1051
+ };
1052
+ _selectElement = new WeakMap(), __name(_SelectUserElement, "SelectUserElement");
1053
+ let SelectUserElement = _SelectUserElement;
1054
+ const stylesheet$6 = createStylesheet({
1034
1055
  ":host": {
1035
1056
  width: "100%",
1036
1057
  height: "40px",
@@ -1038,25 +1059,25 @@ const ws = E({
1038
1059
  alignItems: "center"
1039
1060
  }
1040
1061
  });
1041
- var le, Le, mt;
1042
- class vs extends Ot {
1062
+ var _changeListener, _SelectOptionElement_instances, pick_fn;
1063
+ const _SelectOptionElement = class _SelectOptionElement extends SelectUserElement {
1043
1064
  constructor() {
1044
1065
  super();
1045
- o(this, Le);
1046
- o(this, le, () => {
1066
+ __privateAdd(this, _SelectOptionElement_instances);
1067
+ __privateAdd(this, _changeListener, /* @__PURE__ */ __name(() => {
1047
1068
  this.selectElement.value === this.value ? this.style.display = "none" : this.style.display = "";
1048
- });
1049
- if (p) {
1050
- const e = this.attachShadow({ mode: "open" });
1051
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, ws], g(this, {
1069
+ }, "#changeListener"));
1070
+ if (isBrowser) {
1071
+ const shadow = this.attachShadow({ mode: "open" });
1072
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$6], element(this, {
1052
1073
  tabindex: 0,
1053
- onClick: () => {
1054
- l(this, Le, mt).call(this);
1055
- },
1056
- onKeydown: (i) => {
1057
- i.code === "Space" && l(this, Le, mt).call(this);
1058
- },
1059
- children: me()
1074
+ onClick: /* @__PURE__ */ __name(() => {
1075
+ __privateMethod(this, _SelectOptionElement_instances, pick_fn).call(this);
1076
+ }, "onClick"),
1077
+ onKeydown: /* @__PURE__ */ __name((e) => {
1078
+ e.code === "Space" && __privateMethod(this, _SelectOptionElement_instances, pick_fn).call(this);
1079
+ }, "onKeydown"),
1080
+ children: slot()
1060
1081
  });
1061
1082
  }
1062
1083
  }
@@ -1064,19 +1085,20 @@ class vs extends Ot {
1064
1085
  return (this.hasAttribute("value") ? this.getAttribute("value") : this.innerText) || "";
1065
1086
  }
1066
1087
  connectedCallback() {
1067
- super.connectedCallback(), this.hasAttribute("default") && (this.selectElement.value || (this.selectElement.value = this.value)), this.selectElement.addEventListener("change", t(this, le)), setTimeout(() => {
1068
- t(this, le).call(this);
1088
+ super.connectedCallback(), this.hasAttribute("default") && (this.selectElement.value || (this.selectElement.value = this.value)), this.selectElement.addEventListener("change", __privateGet(this, _changeListener)), setTimeout(() => {
1089
+ __privateGet(this, _changeListener).call(this);
1069
1090
  });
1070
1091
  }
1071
1092
  disconnectedCallback() {
1072
- this.selectElement.removeEventListener("change", t(this, le));
1093
+ this.selectElement.removeEventListener("change", __privateGet(this, _changeListener));
1073
1094
  }
1074
- }
1075
- le = new WeakMap(), Le = new WeakSet(), mt = function() {
1076
- this.selectElement.value = this.value, this.selectElement.close();
1077
1095
  };
1078
- p && !customElements.get("e-select-option") && customElements.define("e-select-option", vs);
1079
- const ys = E({
1096
+ _changeListener = new WeakMap(), _SelectOptionElement_instances = new WeakSet(), pick_fn = /* @__PURE__ */ __name(function() {
1097
+ this.selectElement.value = this.value, this.selectElement.close();
1098
+ }, "#pick"), __name(_SelectOptionElement, "SelectOptionElement");
1099
+ let SelectOptionElement = _SelectOptionElement;
1100
+ isBrowser && !customElements.get("e-select-option") && customElements.define("e-select-option", SelectOptionElement);
1101
+ const stylesheet$5 = createStylesheet({
1080
1102
  ":host": {
1081
1103
  width: "100%",
1082
1104
  height: "40px",
@@ -1088,7 +1110,7 @@ const ys = E({
1088
1110
  flexShrink: "0",
1089
1111
  width: "var(--arrow-size, 1em)",
1090
1112
  height: "var(--arrow-size, 1em)",
1091
- fill: `var(--arrow-color, ${f.colorMain.var})`,
1113
+ fill: `var(--arrow-color, ${aptechkaTheme.colorMain.var})`,
1092
1114
  transitionProperty: "transform",
1093
1115
  transitionDuration: "var(--duration, var(--duration-short))"
1094
1116
  },
@@ -1096,47 +1118,48 @@ const ys = E({
1096
1118
  transform: "scaleY(-1)"
1097
1119
  }
1098
1120
  });
1099
- var Te, he, ze;
1100
- class Ss extends Ot {
1121
+ var _valueElement, _changeListener2, _toggleListener;
1122
+ const _SelectHeadElement = class _SelectHeadElement extends SelectUserElement {
1101
1123
  constructor() {
1102
1124
  super();
1103
- o(this, Te, null);
1104
- o(this, he, () => {
1105
- const i = this.selectElement.shadowRoot.querySelector(
1125
+ __privateAdd(this, _valueElement, null);
1126
+ __privateAdd(this, _changeListener2, /* @__PURE__ */ __name(() => {
1127
+ const currentOption = this.selectElement.shadowRoot.querySelector(
1106
1128
  ".body slot"
1107
- ).assignedElements().find((n) => n.value === this.selectElement.value);
1108
- i && (t(this, Te).innerHTML = i.innerHTML);
1109
- });
1110
- o(this, ze, () => {
1129
+ ).assignedElements().find((e) => e.value === this.selectElement.value);
1130
+ currentOption && (__privateGet(this, _valueElement).innerHTML = currentOption.innerHTML);
1131
+ }, "#changeListener"));
1132
+ __privateAdd(this, _toggleListener, /* @__PURE__ */ __name(() => {
1111
1133
  this.classList.toggle("opened", this.selectElement.opened);
1112
- });
1113
- if (p) {
1114
- const e = this.attachShadow({ mode: "open" });
1115
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, ys], g(this, {
1134
+ }, "#toggleListener"));
1135
+ if (isBrowser) {
1136
+ const shadow = this.attachShadow({ mode: "open" });
1137
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$5], element(this, {
1116
1138
  children: [
1117
- me(),
1118
- me({
1139
+ slot(),
1140
+ slot({
1119
1141
  name: "arrow",
1120
- children: g(Ht, { class: "default-arrow" })
1142
+ children: element(arrowIcon, { class: "default-arrow" })
1121
1143
  })
1122
1144
  ]
1123
1145
  }), this.slot = "head";
1124
1146
  }
1125
1147
  }
1126
1148
  connectedCallback() {
1127
- super.connectedCallback(), c(this, Te, this.querySelector("[data-value-holder]") || this), this.selectElement.addEventListener("change", t(this, he)), t(this, he).call(this), this.selectElement.addEventListener("selectToggle", t(this, ze));
1149
+ super.connectedCallback(), __privateSet(this, _valueElement, this.querySelector("[data-value-holder]") || this), this.selectElement.addEventListener("change", __privateGet(this, _changeListener2)), __privateGet(this, _changeListener2).call(this), this.selectElement.addEventListener("selectToggle", __privateGet(this, _toggleListener));
1128
1150
  }
1129
1151
  disconnectedCallback() {
1130
- this.selectElement.removeEventListener("change", t(this, he)), this.selectElement.removeEventListener("selectToggle", t(this, ze));
1152
+ this.selectElement.removeEventListener("change", __privateGet(this, _changeListener2)), this.selectElement.removeEventListener("selectToggle", __privateGet(this, _toggleListener));
1131
1153
  }
1132
- }
1133
- Te = new WeakMap(), he = new WeakMap(), ze = new WeakMap();
1134
- p && !customElements.get("e-select-head") && customElements.define("e-select-head", Ss);
1135
- const ks = E({
1154
+ };
1155
+ _valueElement = new WeakMap(), _changeListener2 = new WeakMap(), _toggleListener = new WeakMap(), __name(_SelectHeadElement, "SelectHeadElement");
1156
+ let SelectHeadElement = _SelectHeadElement;
1157
+ isBrowser && !customElements.get("e-select-head") && customElements.define("e-select-head", SelectHeadElement);
1158
+ const stylesheet$4 = createStylesheet({
1136
1159
  "e-select": {
1137
1160
  display: "block",
1138
1161
  width: "100%",
1139
- "--arrow-color": f.colorFont.var
1162
+ "--arrow-color": aptechkaTheme.colorFont.var
1140
1163
  },
1141
1164
  "e-select-head": {
1142
1165
  width: "100%",
@@ -1153,54 +1176,55 @@ const ks = E({
1153
1176
  fontSize: "var(--font-size-small)"
1154
1177
  },
1155
1178
  "e-select-option:hover": {
1156
- color: f.colorActive.var
1179
+ color: aptechkaTheme.colorActive.var
1157
1180
  },
1158
1181
  svg: {
1159
1182
  width: "16px",
1160
1183
  height: "16px",
1161
- fill: f.colorFont.var,
1184
+ fill: aptechkaTheme.colorFont.var,
1162
1185
  transitionProperty: "transform",
1163
1186
  transitionDuration: "var(--duration-short)"
1164
1187
  },
1165
1188
  ".opened svg": {
1166
1189
  transform: "scaleY(-1)"
1167
1190
  }
1168
- });
1169
- class Zt extends pe {
1170
- constructor(...s) {
1171
- var n;
1172
- super(...s);
1173
- const e = this.attachShadow({ mode: "open" });
1174
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, ks];
1175
- const i = ((n = this.firstStore.__manager) == null ? void 0 : n.variants) || [];
1176
- g(this, {
1177
- children: g("e-select", {
1191
+ }), _TweakerSelectManagerElement = class _TweakerSelectManagerElement extends TweakerStoreManagerElement {
1192
+ constructor(...stores) {
1193
+ var _a;
1194
+ super(...stores);
1195
+ const shadow = this.attachShadow({ mode: "open" });
1196
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$4];
1197
+ const variants = ((_a = this.firstStore.__manager) == null ? void 0 : _a.variants) || [];
1198
+ element(this, {
1199
+ children: element("e-select", {
1178
1200
  value: this.firstStore,
1179
- onChange: (h) => {
1180
- this.updateStores(h.currentTarget.value);
1181
- },
1201
+ onChange: /* @__PURE__ */ __name((e) => {
1202
+ this.updateStores(e.currentTarget.value);
1203
+ }, "onChange"),
1182
1204
  lightChildren: [
1183
- g("e-select-head", {
1205
+ element("e-select-head", {
1184
1206
  lightChildren: [
1185
- lt({
1207
+ span({
1186
1208
  "data-value-holder": ""
1187
1209
  })
1188
1210
  ]
1189
1211
  }),
1190
1212
  // @ts-ignore
1191
- ...i.map(
1192
- (h, u) => g("e-select-option", {
1193
- lightChildren: h,
1194
- default: u === 0 ? !0 : null
1213
+ ...variants.map(
1214
+ (v, i) => element("e-select-option", {
1215
+ lightChildren: v,
1216
+ default: i === 0 ? !0 : null
1195
1217
  })
1196
1218
  )
1197
1219
  ]
1198
1220
  })
1199
1221
  });
1200
1222
  }
1201
- }
1202
- p && !customElements.get("e-tweaker-select-manager") && customElements.define("e-tweaker-select-manager", Zt);
1203
- const Es = E({
1223
+ };
1224
+ __name(_TweakerSelectManagerElement, "TweakerSelectManagerElement");
1225
+ let TweakerSelectManagerElement = _TweakerSelectManagerElement;
1226
+ isBrowser && !customElements.get("e-tweaker-select-manager") && customElements.define("e-tweaker-select-manager", TweakerSelectManagerElement);
1227
+ const stylesheet$3 = createStylesheet({
1204
1228
  ":host": {
1205
1229
  width: "100%",
1206
1230
  display: "flex",
@@ -1219,44 +1243,45 @@ const Es = E({
1219
1243
  margin: "0",
1220
1244
  padding: "0 var(--gap-small)",
1221
1245
  backgroundColor: "rgba(255, 255, 255, 0.1)",
1222
- borderRadius: f.borderRadius.var
1246
+ borderRadius: aptechkaTheme.borderRadius.var
1223
1247
  }
1224
- });
1225
- class Wt extends pe {
1226
- constructor(...s) {
1227
- super(...s);
1228
- const e = this.attachShadow({ mode: "open" });
1229
- e.adoptedStyleSheets = [...e.adoptedStyleSheets, Es], g(this, {
1248
+ }), _TweakerStringManagerElement = class _TweakerStringManagerElement extends TweakerStoreManagerElement {
1249
+ constructor(...stores) {
1250
+ super(...stores);
1251
+ const shadow = this.attachShadow({ mode: "open" });
1252
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$3], element(this, {
1230
1253
  children: [
1231
- Ve({
1254
+ input({
1232
1255
  class: "text-input",
1233
1256
  type: "string",
1234
1257
  value: this.firstStore,
1235
- onChange: (i) => {
1258
+ onChange: /* @__PURE__ */ __name((e) => {
1236
1259
  this.updateStores(
1237
- i.currentTarget.value
1260
+ e.currentTarget.value
1238
1261
  );
1239
- }
1262
+ }, "onChange")
1240
1263
  })
1241
1264
  ]
1242
1265
  });
1243
1266
  }
1244
- }
1245
- p && !customElements.get("e-tweaker-string-manager") && customElements.define("e-tweaker-string-manager", Wt);
1246
- const xs = {
1247
- boolean: Dt,
1248
- color: Vt,
1249
- link: _t,
1250
- number: Bt,
1251
- select: Zt,
1252
- string: Wt
1253
- }, Cs = E({
1267
+ };
1268
+ __name(_TweakerStringManagerElement, "TweakerStringManagerElement");
1269
+ let TweakerStringManagerElement = _TweakerStringManagerElement;
1270
+ isBrowser && !customElements.get("e-tweaker-string-manager") && customElements.define("e-tweaker-string-manager", TweakerStringManagerElement);
1271
+ const tweakerManagerConstructors = {
1272
+ boolean: TweakerBooleanManagerElement,
1273
+ color: TweakerColorManagerElement,
1274
+ link: TweakerLinkManagerElement,
1275
+ number: TweakerNumberManagerElement,
1276
+ select: TweakerSelectManagerElement,
1277
+ string: TweakerStringManagerElement
1278
+ }, stylesheet$2 = createStylesheet({
1254
1279
  ":host": {
1255
1280
  display: "grid",
1256
1281
  gridAutoFlow: "column",
1257
1282
  gridTemplateColumns: "0.5fr 1fr",
1258
1283
  alignItems: "center",
1259
- color: f.colorFont.var,
1284
+ color: aptechkaTheme.colorFont.var,
1260
1285
  gap: "var(--gap-medium)"
1261
1286
  },
1262
1287
  ":host(.disabled)": {
@@ -1279,7 +1304,7 @@ const xs = {
1279
1304
  margin: "0",
1280
1305
  border: "none",
1281
1306
  background: "none",
1282
- fill: f.colorFont.var,
1307
+ fill: aptechkaTheme.colorFont.var,
1283
1308
  transitionDuration: "var(--duration-short)",
1284
1309
  transitionProperty: "fill, opacity",
1285
1310
  opacity: "0"
@@ -1288,105 +1313,106 @@ const xs = {
1288
1313
  opacity: "1"
1289
1314
  },
1290
1315
  ".head-button:hover": {
1291
- fill: f.colorActive.var
1316
+ fill: aptechkaTheme.colorActive.var
1292
1317
  },
1293
1318
  ".head-button svg": {
1294
1319
  width: "100%",
1295
1320
  height: "100%"
1296
1321
  }
1297
1322
  });
1298
- var M, ce, de, ue, fe, Me, Ae;
1299
- class pt extends HTMLElement {
1300
- constructor(e) {
1301
- var h, u;
1323
+ var _stores2, _key, _name, _pointerEnter, _storeManager, _storesChangeListener, _keydownListener;
1324
+ const _TweakerFieldElement = class _TweakerFieldElement extends HTMLElement {
1325
+ constructor(parameters) {
1326
+ var _a, _b;
1302
1327
  super();
1303
- o(this, M, []);
1304
- o(this, ce);
1305
- o(this, de);
1306
- o(this, ue, !1);
1307
- o(this, fe);
1308
- o(this, Me, () => {
1309
- j.current.find((e) => t(this, M).includes(e)) || this.remove();
1310
- });
1311
- o(this, Ae, (e) => {
1312
- t(this, ue) && ((e.metaKey || e.ctrlKey) && e.code === "KeyC" ? navigator.clipboard.writeText(t(this, M)[0].current) : (e.metaKey || e.ctrlKey) && e.code === "KeyR" && (t(this, M).forEach((i) => {
1313
- i.reset();
1328
+ __privateAdd(this, _stores2, []);
1329
+ __privateAdd(this, _key);
1330
+ __privateAdd(this, _name);
1331
+ __privateAdd(this, _pointerEnter, !1);
1332
+ __privateAdd(this, _storeManager);
1333
+ __privateAdd(this, _storesChangeListener, /* @__PURE__ */ __name(() => {
1334
+ activeStores.current.find((s) => __privateGet(this, _stores2).includes(s)) || this.remove();
1335
+ }, "#storesChangeListener"));
1336
+ __privateAdd(this, _keydownListener, /* @__PURE__ */ __name((e) => {
1337
+ __privateGet(this, _pointerEnter) && ((e.metaKey || e.ctrlKey) && e.code === "KeyC" ? navigator.clipboard.writeText(__privateGet(this, _stores2)[0].current) : (e.metaKey || e.ctrlKey) && e.code === "KeyR" && (__privateGet(this, _stores2).forEach((store) => {
1338
+ store.reset();
1314
1339
  }), e.preventDefault()));
1315
- });
1316
- c(this, M, [e.store]), c(this, ce, e.store.name), c(this, de, t(this, ce).split(".").slice(-1).toString());
1317
- const i = ((h = e.store.__manager) == null ? void 0 : h.type) || "string";
1318
- c(this, fe, new xs[i](
1319
- t(this, M)[0]
1340
+ }, "#keydownListener"));
1341
+ __privateSet(this, _stores2, [parameters.store]), __privateSet(this, _key, parameters.store.name), __privateSet(this, _name, __privateGet(this, _key).split(".").slice(-1).toString());
1342
+ const type = ((_a = parameters.store.__manager) == null ? void 0 : _a.type) || "string";
1343
+ __privateSet(this, _storeManager, new tweakerManagerConstructors[type](
1344
+ __privateGet(this, _stores2)[0]
1320
1345
  ));
1321
- const n = this.attachShadow({ mode: "open" });
1322
- n.adoptedStyleSheets = [...n.adoptedStyleSheets, Cs], g(this, {
1346
+ const shadow = this.attachShadow({ mode: "open" });
1347
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$2], element(this, {
1323
1348
  class: {
1324
- disabled: ((u = e.store.__manager) == null ? void 0 : u.disabled) || !1
1325
- },
1326
- onPointerleave: () => {
1327
- c(this, ue, !1);
1328
- },
1329
- onPointerenter: () => {
1330
- c(this, ue, !0);
1349
+ disabled: ((_b = parameters.store.__manager) == null ? void 0 : _b.disabled) || !1
1331
1350
  },
1351
+ onPointerleave: /* @__PURE__ */ __name(() => {
1352
+ __privateSet(this, _pointerEnter, !1);
1353
+ }, "onPointerleave"),
1354
+ onPointerenter: /* @__PURE__ */ __name(() => {
1355
+ __privateSet(this, _pointerEnter, !0);
1356
+ }, "onPointerenter"),
1332
1357
  children: [
1333
- w({
1358
+ div({
1334
1359
  class: "head",
1335
1360
  children: [
1336
- w({ class: "name", children: t(this, de) + ":" }),
1337
- w({
1361
+ div({ class: "name", children: __privateGet(this, _name) + ":" }),
1362
+ div({
1338
1363
  class: "head-buttons",
1339
1364
  children: [
1340
- ee({
1365
+ button({
1341
1366
  class: "head-button",
1342
- children: It,
1343
- onClick: () => {
1344
- navigator.clipboard.writeText(t(this, M)[0].current);
1345
- }
1367
+ children: copyIcon,
1368
+ onClick: /* @__PURE__ */ __name(() => {
1369
+ navigator.clipboard.writeText(__privateGet(this, _stores2)[0].current);
1370
+ }, "onClick")
1346
1371
  }),
1347
- ee({
1372
+ button({
1348
1373
  class: "head-button",
1349
- children: $t,
1350
- onClick: () => {
1351
- t(this, M).forEach((m) => {
1352
- m.reset();
1374
+ children: resetIcon,
1375
+ onClick: /* @__PURE__ */ __name(() => {
1376
+ __privateGet(this, _stores2).forEach((store) => {
1377
+ store.reset();
1353
1378
  });
1354
- }
1379
+ }, "onClick")
1355
1380
  })
1356
1381
  ]
1357
1382
  })
1358
1383
  ]
1359
1384
  }),
1360
- t(this, fe)
1385
+ __privateGet(this, _storeManager)
1361
1386
  ]
1362
1387
  });
1363
1388
  }
1364
1389
  get key() {
1365
- return t(this, ce);
1390
+ return __privateGet(this, _key);
1366
1391
  }
1367
1392
  get name() {
1368
- return t(this, de);
1393
+ return __privateGet(this, _name);
1369
1394
  }
1370
1395
  get stores() {
1371
- return t(this, M);
1396
+ return __privateGet(this, _stores2);
1372
1397
  }
1373
- addStore(e) {
1374
- t(this, fe).addStore(e);
1398
+ addStore(store) {
1399
+ __privateGet(this, _storeManager).addStore(store);
1375
1400
  }
1376
1401
  connectedCallback() {
1377
- j.subscribe(t(this, Me)), addEventListener("keydown", t(this, Ae)), Kt(this);
1402
+ activeStores.subscribe(__privateGet(this, _storesChangeListener)), addEventListener("keydown", __privateGet(this, _keydownListener)), dispatchSizeChangeEvent(this);
1378
1403
  }
1379
1404
  disconnectedCallback() {
1380
- j.unsubscribe(t(this, Me)), removeEventListener("keydown", t(this, Ae));
1405
+ activeStores.unsubscribe(__privateGet(this, _storesChangeListener)), removeEventListener("keydown", __privateGet(this, _keydownListener));
1381
1406
  }
1382
- }
1383
- M = new WeakMap(), ce = new WeakMap(), de = new WeakMap(), ue = new WeakMap(), fe = new WeakMap(), Me = new WeakMap(), Ae = new WeakMap();
1384
- p && !customElements.get("e-tweaker-field") && customElements.define("e-tweaker-field", pt);
1385
- const Ls = E({
1407
+ };
1408
+ _stores2 = new WeakMap(), _key = new WeakMap(), _name = new WeakMap(), _pointerEnter = new WeakMap(), _storeManager = new WeakMap(), _storesChangeListener = new WeakMap(), _keydownListener = new WeakMap(), __name(_TweakerFieldElement, "TweakerFieldElement");
1409
+ let TweakerFieldElement = _TweakerFieldElement;
1410
+ isBrowser && !customElements.get("e-tweaker-field") && customElements.define("e-tweaker-field", TweakerFieldElement);
1411
+ const stylesheet$1 = createStylesheet({
1386
1412
  ".wrapper": {
1387
1413
  boxSizing: "border-box",
1388
1414
  backgroundColor: "rgba(255, 255, 255, 0.1)",
1389
- borderRadius: f.borderRadius.var
1415
+ borderRadius: aptechkaTheme.borderRadius.var
1390
1416
  },
1391
1417
  ".head": {
1392
1418
  boxSizing: "border-box",
@@ -1397,12 +1423,12 @@ const Ls = E({
1397
1423
  display: "flex",
1398
1424
  alignItems: "center",
1399
1425
  justifyContent: "space-between",
1400
- backgroundColor: f.colorMainAux.var,
1401
- borderRadius: f.borderRadius.var
1426
+ backgroundColor: aptechkaTheme.colorMainAux.var,
1427
+ borderRadius: aptechkaTheme.borderRadius.var
1402
1428
  },
1403
1429
  ".name": {
1404
1430
  fontSize: "var(--font-size-large)",
1405
- color: f.colorFont.var
1431
+ color: aptechkaTheme.colorFont.var
1406
1432
  },
1407
1433
  ".body": {
1408
1434
  display: "none",
@@ -1430,127 +1456,127 @@ const Ls = E({
1430
1456
  ".arrow": {
1431
1457
  width: "20px",
1432
1458
  height: "20px",
1433
- fill: f.colorFont.var,
1459
+ fill: aptechkaTheme.colorFont.var,
1434
1460
  transition: "transform var(--duration-short)"
1435
1461
  },
1436
1462
  ".opened .arrow": {
1437
1463
  transform: "scaleY(-1)"
1438
1464
  }
1439
1465
  });
1440
- var A, Ne, S, Re, Fe, Pe, $e, Ge;
1441
- const Ue = class Ue extends HTMLElement {
1442
- constructor(e) {
1466
+ var _key2, _head, _content, _mutationObserver, _bodyElement2, _contentElement, _contentRootElement, _mutationListener;
1467
+ const _TweakerFolderElement = class _TweakerFolderElement extends HTMLElement {
1468
+ constructor(parameters) {
1443
1469
  super();
1444
- o(this, A);
1445
- o(this, Ne, new $(null));
1446
- o(this, S, new $([]));
1447
- o(this, Re);
1448
- o(this, Fe, null);
1449
- o(this, Pe, null);
1450
- o(this, $e, null);
1451
- o(this, Ge, (e) => {
1452
- let i = [], n = [];
1453
- e.forEach((h) => {
1454
- i = [...i, ...h.removedNodes], n = [...n, ...h.addedNodes];
1455
- }), t(this, S).current = t(this, S).current.filter(
1456
- (h) => !i.includes(h)
1457
- ), t(this, A) && !t(this, S).current.length && !n.length && this.remove();
1458
- });
1459
- const i = this.attachShadow({ mode: "open" });
1460
- i.adoptedStyleSheets = [...i.adoptedStyleSheets, Ls], c(this, A, e.key), c(this, Re, new MutationObserver(t(this, Ge))), g(this, {
1470
+ __privateAdd(this, _key2);
1471
+ __privateAdd(this, _head, new Store(null));
1472
+ __privateAdd(this, _content, new Store([]));
1473
+ __privateAdd(this, _mutationObserver);
1474
+ __privateAdd(this, _bodyElement2, null);
1475
+ __privateAdd(this, _contentElement, null);
1476
+ __privateAdd(this, _contentRootElement, null);
1477
+ __privateAdd(this, _mutationListener, /* @__PURE__ */ __name((mutations) => {
1478
+ let removedNodes = [], addedNodes = [];
1479
+ mutations.forEach((m) => {
1480
+ removedNodes = [...removedNodes, ...m.removedNodes], addedNodes = [...addedNodes, ...m.addedNodes];
1481
+ }), __privateGet(this, _content).current = __privateGet(this, _content).current.filter(
1482
+ (v) => !removedNodes.includes(v)
1483
+ ), __privateGet(this, _key2) && !__privateGet(this, _content).current.length && !addedNodes.length && this.remove();
1484
+ }, "#mutationListener"));
1485
+ const shadow = this.attachShadow({ mode: "open" });
1486
+ shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$1], __privateSet(this, _key2, parameters.key), __privateSet(this, _mutationObserver, new MutationObserver(__privateGet(this, _mutationListener))), element(this, {
1461
1487
  children: [
1462
- w({
1488
+ div({
1463
1489
  class: "wrapper",
1464
1490
  children: [
1465
- w({
1491
+ div({
1466
1492
  class: "head",
1467
- onClick: (n) => {
1468
- this.classList.toggle("opened"), this.classList.contains("opened") ? C.openPanel(t(this, A)) : C.closePanel(t(this, A));
1469
- },
1493
+ onClick: /* @__PURE__ */ __name((e) => {
1494
+ this.classList.toggle("opened"), this.classList.contains("opened") ? tweakerStorage.openPanel(__privateGet(this, _key2)) : tweakerStorage.closePanel(__privateGet(this, _key2));
1495
+ }, "onClick"),
1470
1496
  children: [
1471
- t(this, A) ? w({
1497
+ __privateGet(this, _key2) ? div({
1472
1498
  class: "name",
1473
- children: [t(this, A).split(".").slice(-1).toString()]
1499
+ children: [__privateGet(this, _key2).split(".").slice(-1).toString()]
1474
1500
  }) : null,
1475
- t(this, Ne),
1476
- g(Ht, {
1501
+ __privateGet(this, _head),
1502
+ element(arrowIcon, {
1477
1503
  class: "arrow"
1478
1504
  })
1479
1505
  ]
1480
1506
  }),
1481
- w({
1507
+ div({
1482
1508
  class: "body",
1483
- ref: (n) => {
1484
- c(this, Fe, n);
1485
- },
1486
- children: w({
1509
+ ref: /* @__PURE__ */ __name((e) => {
1510
+ __privateSet(this, _bodyElement2, e);
1511
+ }, "ref"),
1512
+ children: div({
1487
1513
  class: "body-content",
1488
- children: t(this, S),
1489
- ref: (n) => {
1490
- c(this, Pe, n), c(this, $e, n.firstElementChild);
1491
- }
1514
+ children: __privateGet(this, _content),
1515
+ ref: /* @__PURE__ */ __name((e) => {
1516
+ __privateSet(this, _contentElement, e), __privateSet(this, _contentRootElement, e.firstElementChild);
1517
+ }, "ref")
1492
1518
  })
1493
1519
  })
1494
1520
  ]
1495
1521
  })
1496
1522
  ]
1497
- }), e != null && e.storeBox && this.handleStore(e.storeBox);
1523
+ }), parameters != null && parameters.storeBox && this.handleStore(parameters.storeBox);
1498
1524
  }
1499
1525
  get key() {
1500
- return t(this, A);
1526
+ return __privateGet(this, _key2);
1501
1527
  }
1502
1528
  get head() {
1503
- return t(this, Ne);
1529
+ return __privateGet(this, _head);
1504
1530
  }
1505
1531
  get content() {
1506
- return t(this, S);
1532
+ return __privateGet(this, _content);
1507
1533
  }
1508
1534
  get bodyElement() {
1509
- return t(this, Fe);
1535
+ return __privateGet(this, _bodyElement2);
1510
1536
  }
1511
1537
  get contentElement() {
1512
- return t(this, Pe);
1538
+ return __privateGet(this, _contentElement);
1513
1539
  }
1514
1540
  connectedCallback() {
1515
- C.isPanelOpened(t(this, A)) && this.classList.add("opened"), setTimeout(() => {
1541
+ tweakerStorage.isPanelOpened(__privateGet(this, _key2)) && this.classList.add("opened"), setTimeout(() => {
1516
1542
  this.classList.add("transition-allowed");
1517
- }), t(this, Re).observe(t(this, $e), {
1543
+ }), __privateGet(this, _mutationObserver).observe(__privateGet(this, _contentRootElement), {
1518
1544
  childList: !0
1519
1545
  });
1520
1546
  }
1521
- handleStore(e) {
1522
- if (e.remainingFolders.length) {
1523
- const n = e.store.name.split("."), h = n.slice(0, n.length - e.remainingFolders.length).join("."), u = t(this, S).current.find((m) => m.key === h);
1524
- u instanceof Ue ? u.handleStore({
1525
- store: e.store,
1526
- remainingFolders: e.remainingFolders.slice(1)
1527
- }) : t(this, S).current = [
1528
- ...t(this, S).current,
1529
- new Ue({
1530
- key: h,
1547
+ handleStore(storeBox) {
1548
+ if (storeBox.remainingFolders.length) {
1549
+ const splittedName = storeBox.store.name.split("."), key = splittedName.slice(0, splittedName.length - storeBox.remainingFolders.length).join("."), found = __privateGet(this, _content).current.find((v) => v.key === key);
1550
+ found instanceof _TweakerFolderElement ? found.handleStore({
1551
+ store: storeBox.store,
1552
+ remainingFolders: storeBox.remainingFolders.slice(1)
1553
+ }) : __privateGet(this, _content).current = [
1554
+ ...__privateGet(this, _content).current,
1555
+ new _TweakerFolderElement({
1556
+ key,
1531
1557
  storeBox: {
1532
- store: e.store,
1533
- remainingFolders: e.remainingFolders.slice(1)
1558
+ store: storeBox.store,
1559
+ remainingFolders: storeBox.remainingFolders.slice(1)
1534
1560
  }
1535
1561
  })
1536
1562
  ];
1537
1563
  } else {
1538
- const i = t(this, S).current.find(
1539
- (n) => n.key === e.store.name
1564
+ const found = __privateGet(this, _content).current.find(
1565
+ (v) => v.key === storeBox.store.name
1540
1566
  );
1541
- i instanceof pt ? i.addStore(e.store) : t(this, S).current = [
1542
- ...t(this, S).current,
1543
- new pt({
1544
- store: e.store
1567
+ found instanceof TweakerFieldElement ? found.addStore(storeBox.store) : __privateGet(this, _content).current = [
1568
+ ...__privateGet(this, _content).current,
1569
+ new TweakerFieldElement({
1570
+ store: storeBox.store
1545
1571
  })
1546
1572
  ];
1547
1573
  }
1548
1574
  }
1549
1575
  };
1550
- A = new WeakMap(), Ne = new WeakMap(), S = new WeakMap(), Re = new WeakMap(), Fe = new WeakMap(), Pe = new WeakMap(), $e = new WeakMap(), Ge = new WeakMap();
1551
- let Ze = Ue;
1552
- p && !customElements.get("e-tweaker-folder") && customElements.define("e-tweaker-folder", Ze);
1553
- const Ts = E({
1576
+ _key2 = new WeakMap(), _head = new WeakMap(), _content = new WeakMap(), _mutationObserver = new WeakMap(), _bodyElement2 = new WeakMap(), _contentElement = new WeakMap(), _contentRootElement = new WeakMap(), _mutationListener = new WeakMap(), __name(_TweakerFolderElement, "TweakerFolderElement");
1577
+ let TweakerFolderElement = _TweakerFolderElement;
1578
+ isBrowser && !customElements.get("e-tweaker-folder") && customElements.define("e-tweaker-folder", TweakerFolderElement);
1579
+ const stylesheet = createStylesheet({
1554
1580
  ":host": {
1555
1581
  "--tweaker-width": "550px",
1556
1582
  "--tweaker-offset": "20px",
@@ -1569,8 +1595,8 @@ const Ts = E({
1569
1595
  top: "var(--tweaker-offset)",
1570
1596
  right: "var(--tweaker-offset)",
1571
1597
  width: "var(--tweaker-width)",
1572
- backgroundColor: f.colorMain.var,
1573
- borderRadius: f.borderRadius.var,
1598
+ backgroundColor: aptechkaTheme.colorMain.var,
1599
+ borderRadius: aptechkaTheme.borderRadius.var,
1574
1600
  transition: "opacity 0.1s",
1575
1601
  zIndex: "100",
1576
1602
  opacity: "0.1"
@@ -1599,12 +1625,12 @@ const Ts = E({
1599
1625
  margin: "0",
1600
1626
  background: "none",
1601
1627
  border: "none",
1602
- fill: f.colorFont.var,
1628
+ fill: aptechkaTheme.colorFont.var,
1603
1629
  transitionProperty: "fill",
1604
1630
  transitionDuration: "var(--duration-short)"
1605
1631
  },
1606
1632
  ".tweaker-button:hover": {
1607
- fill: f.colorActive.var
1633
+ fill: aptechkaTheme.colorActive.var
1608
1634
  },
1609
1635
  ".tweaker-button svg": {
1610
1636
  width: "100%",
@@ -1625,7 +1651,7 @@ const Ts = E({
1625
1651
  ":host .body-content::-webkit-scrollbar": {
1626
1652
  display: "none"
1627
1653
  },
1628
- [`@media ${es["<=mobile"]}`]: {
1654
+ [`@media ${ViewportMediaRules["<=mobile"]}`]: {
1629
1655
  ":host": {
1630
1656
  position: "absolute",
1631
1657
  top: "0",
@@ -1642,125 +1668,126 @@ const Ts = E({
1642
1668
  }
1643
1669
  }
1644
1670
  });
1645
- var Ie, He, De;
1646
- class qt extends Ze {
1671
+ var _scrollRestored, _unloadListener, _storesChangeListener2;
1672
+ const _TweakerElement = class _TweakerElement extends TweakerFolderElement {
1647
1673
  constructor() {
1648
1674
  super({
1649
1675
  key: ""
1650
1676
  });
1651
- o(this, Ie, !1);
1652
- o(this, He, () => {
1653
- C.save();
1654
- });
1655
- o(this, De, Xt(() => {
1656
- j.current.forEach((e) => {
1657
- if (e.name) {
1658
- const i = e.name.split(".");
1677
+ __privateAdd(this, _scrollRestored, !1);
1678
+ __privateAdd(this, _unloadListener, /* @__PURE__ */ __name(() => {
1679
+ tweakerStorage.save();
1680
+ }, "#unloadListener"));
1681
+ __privateAdd(this, _storesChangeListener2, debounce(() => {
1682
+ activeStores.current.forEach((store) => {
1683
+ if (store.name) {
1684
+ const sname = store.name.split(".");
1659
1685
  this.handleStore({
1660
- store: e,
1661
- remainingFolders: i.length > 1 ? i.slice(0, -1) : []
1686
+ store,
1687
+ remainingFolders: sname.length > 1 ? sname.slice(0, -1) : []
1662
1688
  });
1663
1689
  }
1664
- }), t(this, Ie) || (c(this, Ie, !0), this.contentElement.scroll({
1665
- top: C.scrollValue
1690
+ }), __privateGet(this, _scrollRestored) || (__privateSet(this, _scrollRestored, !0), this.contentElement.scroll({
1691
+ top: tweakerStorage.scrollValue
1666
1692
  }), this.contentElement.addEventListener("scroll", () => {
1667
- C.scrollValue = this.contentElement.scrollTop;
1693
+ tweakerStorage.scrollValue = this.contentElement.scrollTop;
1668
1694
  }));
1669
1695
  }, 10));
1670
- C.load(), this.shadowRoot.adoptedStyleSheets = [
1696
+ tweakerStorage.load(), this.shadowRoot.adoptedStyleSheets = [
1671
1697
  ...this.shadowRoot.adoptedStyleSheets,
1672
- Ts
1698
+ stylesheet
1673
1699
  ], this.head.current = [
1674
- w({
1700
+ div({
1675
1701
  class: "tweaker-buttons",
1676
- onClick: (e) => {
1702
+ onClick: /* @__PURE__ */ __name((e) => {
1677
1703
  e.stopPropagation();
1678
- },
1704
+ }, "onClick"),
1679
1705
  children: [
1680
- ee({
1706
+ button({
1681
1707
  class: "tweaker-button",
1682
- children: $t,
1683
- onClick: () => {
1684
- K.resetState();
1685
- }
1708
+ children: resetIcon,
1709
+ onClick: /* @__PURE__ */ __name(() => {
1710
+ storeRegistry.resetState();
1711
+ }, "onClick")
1686
1712
  }),
1687
- ee({
1713
+ button({
1688
1714
  class: ["tweaker-button"],
1689
- children: [It],
1690
- onClick: () => {
1715
+ children: [copyIcon],
1716
+ onClick: /* @__PURE__ */ __name(() => {
1691
1717
  navigator.clipboard.writeText(
1692
- JSON.stringify(K.getState())
1718
+ JSON.stringify(storeRegistry.getState())
1693
1719
  );
1694
- }
1720
+ }, "onClick")
1695
1721
  }),
1696
- ee({
1722
+ button({
1697
1723
  class: "tweaker-button",
1698
- children: as,
1699
- onClick: () => {
1700
- Ut(K.name, K.getState());
1701
- }
1724
+ children: downloadIcon,
1725
+ onClick: /* @__PURE__ */ __name(() => {
1726
+ createJSONAndSave(storeRegistry.name, storeRegistry.getState());
1727
+ }, "onClick")
1702
1728
  }),
1703
- Ft({
1729
+ label({
1704
1730
  class: "tweaker-button",
1705
1731
  children: [
1706
- ls,
1707
- Ve({
1732
+ uploadIcon,
1733
+ input({
1708
1734
  type: "file",
1709
1735
  style: {
1710
1736
  display: "none"
1711
1737
  },
1712
- onChange: (e) => {
1713
- var h;
1714
- const n = (h = e.currentTarget.files) == null ? void 0 : h[0];
1715
- if (n) {
1716
- const u = new FileReader();
1717
- u.onload = (m) => {
1718
- var L, v;
1719
- const k = (v = (L = m.target) == null ? void 0 : L.result) == null ? void 0 : v.toString();
1720
- k && K.loadState(k);
1721
- }, u.readAsText(n);
1738
+ onChange: /* @__PURE__ */ __name((e) => {
1739
+ var _a;
1740
+ const file = (_a = e.currentTarget.files) == null ? void 0 : _a[0];
1741
+ if (file) {
1742
+ const reader = new FileReader();
1743
+ reader.onload = (e2) => {
1744
+ var _a2, _b;
1745
+ const result = (_b = (_a2 = e2.target) == null ? void 0 : _a2.result) == null ? void 0 : _b.toString();
1746
+ result && storeRegistry.loadState(result);
1747
+ }, reader.readAsText(file);
1722
1748
  }
1723
- }
1749
+ }, "onChange")
1724
1750
  })
1725
1751
  ]
1726
1752
  })
1727
1753
  ]
1728
1754
  })
1729
- ], g(this.bodyElement, {
1755
+ ], element(this.bodyElement, {
1730
1756
  children: [
1731
- w({
1757
+ div({
1732
1758
  class: "resize",
1733
- onPointerdown: (e) => {
1734
- e.preventDefault();
1735
- const i = this.getBoundingClientRect(), n = this.contentElement.scrollTop;
1736
- Et(
1737
- (h) => {
1738
- const u = e.x - h.x, m = Math.max(400, i.width + u);
1739
- this.style.width = m + "px", C.changeSize("tweaker", m);
1759
+ onPointerdown: /* @__PURE__ */ __name((grabEvent) => {
1760
+ grabEvent.preventDefault();
1761
+ const rect = this.getBoundingClientRect(), scrollValue = this.contentElement.scrollTop;
1762
+ setupDrag(
1763
+ (moveEvent) => {
1764
+ const dx = grabEvent.x - moveEvent.x, newSize = Math.max(400, rect.width + dx);
1765
+ this.style.width = newSize + "px", tweakerStorage.changeSize("tweaker", newSize);
1740
1766
  },
1741
1767
  () => {
1742
1768
  setTimeout(() => {
1743
1769
  this.contentElement.scroll({
1744
- top: n
1770
+ top: scrollValue
1745
1771
  });
1746
1772
  }, 10);
1747
1773
  }
1748
1774
  );
1749
- },
1750
- onDblclick: () => {
1751
- this.style.width = "", C.changeSize("tweaker", null);
1752
- }
1775
+ }, "onPointerdown"),
1776
+ onDblclick: /* @__PURE__ */ __name(() => {
1777
+ this.style.width = "", tweakerStorage.changeSize("tweaker", null);
1778
+ }, "onDblclick")
1753
1779
  })
1754
1780
  ]
1755
1781
  });
1756
1782
  }
1757
1783
  connectedCallback() {
1758
- super.connectedCallback(), window.addEventListener("beforeunload", t(this, He)), j.subscribe(t(this, De)), C.changedSizes("tweaker") && (this.style.width = C.changedSizes("tweaker") + "px");
1784
+ super.connectedCallback(), window.addEventListener("beforeunload", __privateGet(this, _unloadListener)), activeStores.subscribe(__privateGet(this, _storesChangeListener2)), tweakerStorage.changedSizes("tweaker") && (this.style.width = tweakerStorage.changedSizes("tweaker") + "px");
1759
1785
  }
1760
1786
  disconnectedCallback() {
1761
- window.removeEventListener("beforeunload", t(this, He)), C.save(), j.unsubscribe(t(this, De));
1787
+ window.removeEventListener("beforeunload", __privateGet(this, _unloadListener)), tweakerStorage.save(), activeStores.unsubscribe(__privateGet(this, _storesChangeListener2));
1762
1788
  }
1763
- }
1764
- Ie = new WeakMap(), He = new WeakMap(), De = new WeakMap();
1765
- p && !customElements.get("e-tweaker") && customElements.define("e-tweaker", qt);
1766
- p && document.body.appendChild(new qt());
1789
+ };
1790
+ _scrollRestored = new WeakMap(), _unloadListener = new WeakMap(), _storesChangeListener2 = new WeakMap(), __name(_TweakerElement, "TweakerElement");
1791
+ let TweakerElement = _TweakerElement;
1792
+ isBrowser && !customElements.get("e-tweaker") && customElements.define("e-tweaker", TweakerElement);
1793
+ isBrowser && document.body.appendChild(new TweakerElement());