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
package/lib/en3/index.js CHANGED
@@ -1,169 +1,170 @@
1
- var ee = Object.defineProperty, te = Object.defineProperties;
2
- var se = Object.getOwnPropertyDescriptors;
3
- var _ = Object.getOwnPropertySymbols;
4
- var ie = Object.prototype.hasOwnProperty, re = Object.prototype.propertyIsEnumerable;
5
- var B = (r) => {
6
- throw TypeError(r);
1
+ var __defProp = Object.defineProperty, __defProps = Object.defineProperties;
2
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __typeError = (msg) => {
6
+ throw TypeError(msg);
7
7
  };
8
- var G = (r, e, s) => e in r ? ee(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s, F = (r, e) => {
9
- for (var s in e || (e = {}))
10
- ie.call(e, s) && G(r, s, e[s]);
11
- if (_)
12
- for (var s of _(e))
13
- re.call(e, s) && G(r, s, e[s]);
14
- return r;
15
- }, K = (r, e) => te(r, se(e));
16
- var U = (r, e, s) => e.has(r) || B("Cannot " + s);
17
- var t = (r, e, s) => (U(r, e, "read from private field"), s ? s.call(r) : e.get(r)), c = (r, e, s) => e.has(r) ? B("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, s), n = (r, e, s, i) => (U(r, e, "write to private field"), i ? i.call(r, s) : e.set(r, s), s);
18
- import { RESIZE_ORDER as he, TICK_ORDER as ae } from "../order/index.js";
19
- import { ticker as Z } from "../ticker/index.js";
20
- import { g as Y } from "../dom-BETkVSSZ.js";
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ __hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
11
+ if (__getOwnPropSymbols)
12
+ for (var prop of __getOwnPropSymbols(b))
13
+ __propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
14
+ return a;
15
+ }, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)), __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
16
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
17
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
18
+ import { RESIZE_ORDER, TICK_ORDER } from "../order/index.js";
19
+ import { t as ticker } from "../index-ClTMVKJp.js";
20
+ import { g as getElement } from "../dom-D8D-_9ty.js";
21
21
  import "construct-style-sheets-polyfill";
22
- import "../index-e9eDuagL.js";
23
- import { windowResizer as q } from "../window-resizer/index.js";
24
- import { Mesh as $, OrthographicCamera as N, PerspectiveCamera as J, Scene as ne, REVISION as ce, WebGLRenderer as le, Vector3 as W } from "three";
25
- import { LayoutBox as Q } from "../layout-box/index.js";
26
- import { d as me } from "../function-C10DGppn.js";
27
- function fe(r) {
28
- const e = (s) => {
29
- s.dispose();
30
- for (const i of Object.keys(s)) {
31
- const a = s[i];
32
- a && typeof a == "object" && "minFilter" in a && a.dispose();
22
+ import { windowResizer } from "../window-resizer/index.js";
23
+ import { Mesh, OrthographicCamera, PerspectiveCamera, Scene, REVISION, WebGLRenderer, Vector3 } from "three";
24
+ import { LayoutBox } from "../layout-box/index.js";
25
+ import { d as debounce } from "../function-UmbPrOHm.js";
26
+ function dispose(object3d) {
27
+ const cleanMaterial = /* @__PURE__ */ __name((material) => {
28
+ material.dispose();
29
+ for (const key of Object.keys(material)) {
30
+ const value = material[key];
31
+ value && typeof value == "object" && "minFilter" in value && value.dispose();
33
32
  }
34
- };
35
- r.traverse((s) => {
36
- if (s instanceof $) {
37
- if (s.geometry.dispose(), !Array.isArray(s.material) && s.material.isMaterial)
38
- e(s.material);
39
- else if (Array.isArray(s.material))
40
- for (const i of s.material) e(i);
33
+ }, "cleanMaterial");
34
+ object3d.traverse((object) => {
35
+ if (object instanceof Mesh) {
36
+ if (object.geometry.dispose(), !Array.isArray(object.material) && object.material.isMaterial)
37
+ cleanMaterial(object.material);
38
+ else if (Array.isArray(object.material))
39
+ for (const material of object.material) cleanMaterial(material);
41
40
  }
42
41
  });
43
42
  }
44
- var S, D, h, w, o, u, g, x, b, R;
45
- class X {
46
- constructor(e, s, i) {
47
- c(this, S);
48
- c(this, D);
49
- c(this, h);
50
- c(this, w);
51
- c(this, o);
52
- c(this, u);
53
- c(this, g);
54
- c(this, x);
55
- c(this, b);
56
- c(this, R, me(() => {
43
+ __name(dispose, "dispose");
44
+ var _en3, _name, _camera, _scene, _attachedObjects, _cameraDistance, _cameraFov, _sizeElement, _box, _debouncedResize;
45
+ const _En3View = class _En3View {
46
+ constructor(en3, name, options) {
47
+ __privateAdd(this, _en3);
48
+ __privateAdd(this, _name);
49
+ __privateAdd(this, _camera);
50
+ __privateAdd(this, _scene);
51
+ __privateAdd(this, _attachedObjects);
52
+ __privateAdd(this, _cameraDistance);
53
+ __privateAdd(this, _cameraFov);
54
+ __privateAdd(this, _sizeElement);
55
+ __privateAdd(this, _box);
56
+ __privateAdd(this, _debouncedResize, debounce(() => {
57
57
  this.resize();
58
58
  }, 0));
59
- n(this, S, e), n(this, D, s), n(this, h, (i == null ? void 0 : i.cameraType) === "orthographic" ? new N() : new J()), n(this, w, new ne()), n(this, o, []), n(this, u, (i == null ? void 0 : i.cameraDistance) || 1e3), t(this, h).near = (i == null ? void 0 : i.cameraNear) || 1, t(this, h).far = (i == null ? void 0 : i.cameraFar) || 11e3, n(this, g, (i == null ? void 0 : i.cameraFov) || "auto"), t(this, h).position.z = t(this, u), t(this, h).name = `Cameras.${t(this, D)}`, n(this, x, Y(i == null ? void 0 : i.sizeElement) || document.documentElement), this.beforeRenderCallback = i == null ? void 0 : i.beforeRender, n(this, b, new Q(t(this, x))), t(this, b).onResize(() => {
59
+ __privateSet(this, _en3, en3), __privateSet(this, _name, name), __privateSet(this, _camera, (options == null ? void 0 : options.cameraType) === "orthographic" ? new OrthographicCamera() : new PerspectiveCamera()), __privateSet(this, _scene, new Scene()), __privateSet(this, _attachedObjects, []), __privateSet(this, _cameraDistance, (options == null ? void 0 : options.cameraDistance) || 1e3), __privateGet(this, _camera).near = (options == null ? void 0 : options.cameraNear) || 1, __privateGet(this, _camera).far = (options == null ? void 0 : options.cameraFar) || 11e3, __privateSet(this, _cameraFov, (options == null ? void 0 : options.cameraFov) || "auto"), __privateGet(this, _camera).position.z = __privateGet(this, _cameraDistance), __privateGet(this, _camera).name = `Cameras.${__privateGet(this, _name)}`, __privateSet(this, _sizeElement, getElement(options == null ? void 0 : options.sizeElement) || document.documentElement), this.beforeRenderCallback = options == null ? void 0 : options.beforeRender, __privateSet(this, _box, new LayoutBox(__privateGet(this, _sizeElement))), __privateGet(this, _box).onResize(() => {
60
60
  this.resize();
61
61
  });
62
62
  }
63
63
  get name() {
64
- return t(this, D);
64
+ return __privateGet(this, _name);
65
65
  }
66
66
  get camera() {
67
- return t(this, h);
67
+ return __privateGet(this, _camera);
68
68
  }
69
69
  get scene() {
70
- return t(this, w);
70
+ return __privateGet(this, _scene);
71
71
  }
72
72
  get box() {
73
- return t(this, b);
73
+ return __privateGet(this, _box);
74
74
  }
75
75
  get cameraDistance() {
76
- return t(this, u);
76
+ return __privateGet(this, _cameraDistance);
77
77
  }
78
- set cameraDistance(e) {
79
- n(this, u, e), t(this, R).call(this);
78
+ set cameraDistance(value) {
79
+ __privateSet(this, _cameraDistance, value), __privateGet(this, _debouncedResize).call(this);
80
80
  }
81
- set fov(e) {
82
- n(this, g, e), t(this, R).call(this);
81
+ set fov(value) {
82
+ __privateSet(this, _cameraFov, value), __privateGet(this, _debouncedResize).call(this);
83
83
  }
84
84
  get fov() {
85
- return t(this, g);
85
+ return __privateGet(this, _cameraFov);
86
86
  }
87
- set near(e) {
88
- t(this, h).near = e, t(this, R).call(this);
87
+ set near(value) {
88
+ __privateGet(this, _camera).near = value, __privateGet(this, _debouncedResize).call(this);
89
89
  }
90
90
  get near() {
91
- return t(this, h).near;
91
+ return __privateGet(this, _camera).near;
92
92
  }
93
- set far(e) {
94
- t(this, h).far = e, t(this, R).call(this);
93
+ set far(value) {
94
+ __privateGet(this, _camera).far = value, __privateGet(this, _debouncedResize).call(this);
95
95
  }
96
96
  get far() {
97
- return t(this, h).far;
97
+ return __privateGet(this, _camera).far;
98
98
  }
99
99
  get sizeElement() {
100
- return t(this, x);
100
+ return __privateGet(this, _sizeElement);
101
101
  }
102
102
  get isClipped() {
103
- return t(this, x) !== t(this, S).containerElement;
103
+ return __privateGet(this, _sizeElement) !== __privateGet(this, _en3).containerElement;
104
104
  }
105
105
  resize() {
106
- const { width: e, height: s } = t(this, b);
107
- t(this, h).userData.controlled || (t(this, h).position.z = t(this, u)), t(this, h) instanceof J ? (t(this, h).aspect = e / s, t(this, h).fov = t(this, g) === "auto" ? 2 * Math.atan(s / 2 / t(this, u)) * (180 / Math.PI) : t(this, h).userData.controlled ? t(this, h).fov : t(this, g)) : t(this, h) instanceof N && (t(this, h).left = e / -2, t(this, h).right = e / 2, t(this, h).top = s / 2, t(this, h).bottom = s / -2), t(this, h).updateProjectionMatrix();
106
+ const { width, height } = __privateGet(this, _box);
107
+ __privateGet(this, _camera).userData.controlled || (__privateGet(this, _camera).position.z = __privateGet(this, _cameraDistance)), __privateGet(this, _camera) instanceof PerspectiveCamera ? (__privateGet(this, _camera).aspect = width / height, __privateGet(this, _camera).fov = __privateGet(this, _cameraFov) === "auto" ? 2 * Math.atan(height / 2 / __privateGet(this, _cameraDistance)) * (180 / Math.PI) : __privateGet(this, _camera).userData.controlled ? __privateGet(this, _camera).fov : __privateGet(this, _cameraFov)) : __privateGet(this, _camera) instanceof OrthographicCamera && (__privateGet(this, _camera).left = width / -2, __privateGet(this, _camera).right = width / 2, __privateGet(this, _camera).top = height / 2, __privateGet(this, _camera).bottom = height / -2), __privateGet(this, _camera).updateProjectionMatrix();
108
108
  }
109
109
  destroy() {
110
- t(this, o).forEach((e) => {
111
- e.userData.box.destroy();
112
- }), t(this, w).clear(), fe(t(this, w)), t(this, S).destroyView(this.name), t(this, b).destroy();
110
+ __privateGet(this, _attachedObjects).forEach((object) => {
111
+ object.userData.box.destroy();
112
+ }), __privateGet(this, _scene).clear(), dispose(__privateGet(this, _scene)), __privateGet(this, _en3).destroyView(this.name), __privateGet(this, _box).destroy();
113
113
  }
114
- attachToHTMLElement(e, s, i) {
115
- const a = new Q(e, K(F({}, i), {
116
- containerElement: t(this, x),
114
+ attachToHTMLElement(element, object, options) {
115
+ const box = new LayoutBox(element, __spreadProps(__spreadValues({}, options), {
116
+ containerElement: __privateGet(this, _sizeElement),
117
117
  cartesian: !0,
118
118
  scrollStep: !this.isClipped
119
119
  }));
120
- return a.bindObject(s), s.userData.box = a, t(this, o).push(s), s;
120
+ return box.bindObject(object), object.userData.box = box, __privateGet(this, _attachedObjects).push(object), object;
121
121
  }
122
- detachFromHTMLElement(e) {
123
- n(this, o, t(this, o).filter((s) => s === e ? (e.userData.box.destroy(), !1) : !0));
122
+ detachFromHTMLElement(object) {
123
+ __privateSet(this, _attachedObjects, __privateGet(this, _attachedObjects).filter((o) => o === object ? (object.userData.box.destroy(), !1) : !0));
124
124
  }
125
- add(...e) {
126
- const s = e[0], i = e[1], a = e[2];
127
- return i && this.attachToHTMLElement(i, s, a), this.scene.add(s), s;
125
+ add(...args) {
126
+ const object = args[0], element = args[1], options = args[2];
127
+ return element && this.attachToHTMLElement(element, object, options), this.scene.add(object), object;
128
128
  }
129
- remove(e, s) {
130
- this.scene.remove(e), s && this.detachFromHTMLElement(e);
129
+ remove(object, detach) {
130
+ this.scene.remove(object), detach && this.detachFromHTMLElement(object);
131
131
  }
132
- }
133
- S = new WeakMap(), D = new WeakMap(), h = new WeakMap(), w = new WeakMap(), o = new WeakMap(), u = new WeakMap(), g = new WeakMap(), x = new WeakMap(), b = new WeakMap(), R = new WeakMap();
134
- var I, f, l, m, z, V, C, v, T, d, P, A;
135
- class Ve {
132
+ };
133
+ _en3 = new WeakMap(), _name = new WeakMap(), _camera = new WeakMap(), _scene = new WeakMap(), _attachedObjects = new WeakMap(), _cameraDistance = new WeakMap(), _cameraFov = new WeakMap(), _sizeElement = new WeakMap(), _box = new WeakMap(), _debouncedResize = new WeakMap(), __name(_En3View, "En3View");
134
+ let En3View = _En3View;
135
+ var _CDNVersion, _containerElement, _webglRenderer, _views, _width, _height, _pixelRatio, _maxPixelRatio, _isCreated, _composer, _resizeListener, _tickListener;
136
+ const _En3 = class _En3 {
136
137
  constructor() {
137
- c(this, I, `https://unpkg.com/three@0.${ce}.x`);
138
- c(this, f, null);
139
- c(this, l, null);
140
- c(this, m, /* @__PURE__ */ new Map());
141
- c(this, z, 0);
142
- c(this, V, 0);
143
- c(this, C, 0);
144
- c(this, v, 2);
145
- c(this, T, !1);
146
- c(this, d, null);
147
- c(this, P, (e) => {
148
- e instanceof CustomEvent || (n(this, z, t(this, f).clientWidth), n(this, V, t(this, f).clientHeight), n(this, C, Math.min(t(this, v), devicePixelRatio || 1)), t(this, l).setPixelRatio(t(this, C)), t(this, l).setSize(t(this, z), t(this, V)), t(this, d) && (t(this, d).setPixelRatio(t(this, C)), t(this, d).setSize(t(this, z), t(this, V))));
149
- });
150
- c(this, A, () => {
151
- t(this, l).setRenderTarget(null), t(this, m).forEach((e) => {
152
- this.render(e);
138
+ __privateAdd(this, _CDNVersion, `https://unpkg.com/three@0.${REVISION}.x`);
139
+ __privateAdd(this, _containerElement, null);
140
+ __privateAdd(this, _webglRenderer, null);
141
+ __privateAdd(this, _views, /* @__PURE__ */ new Map());
142
+ __privateAdd(this, _width, 0);
143
+ __privateAdd(this, _height, 0);
144
+ __privateAdd(this, _pixelRatio, 0);
145
+ __privateAdd(this, _maxPixelRatio, 2);
146
+ __privateAdd(this, _isCreated, !1);
147
+ __privateAdd(this, _composer, null);
148
+ __privateAdd(this, _resizeListener, /* @__PURE__ */ __name((e) => {
149
+ e instanceof CustomEvent || (__privateSet(this, _width, __privateGet(this, _containerElement).clientWidth), __privateSet(this, _height, __privateGet(this, _containerElement).clientHeight), __privateSet(this, _pixelRatio, Math.min(__privateGet(this, _maxPixelRatio), devicePixelRatio || 1)), __privateGet(this, _webglRenderer).setPixelRatio(__privateGet(this, _pixelRatio)), __privateGet(this, _webglRenderer).setSize(__privateGet(this, _width), __privateGet(this, _height)), __privateGet(this, _composer) && (__privateGet(this, _composer).setPixelRatio(__privateGet(this, _pixelRatio)), __privateGet(this, _composer).setSize(__privateGet(this, _width), __privateGet(this, _height))));
150
+ }, "#resizeListener"));
151
+ __privateAdd(this, _tickListener, /* @__PURE__ */ __name(() => {
152
+ __privateGet(this, _webglRenderer).setRenderTarget(null), __privateGet(this, _views).forEach((view) => {
153
+ this.render(view);
153
154
  });
154
- });
155
+ }, "#tickListener"));
155
156
  }
156
157
  get CDNVersion() {
157
- return t(this, I);
158
+ return __privateGet(this, _CDNVersion);
158
159
  }
159
160
  get containerElement() {
160
- return t(this, f);
161
+ return __privateGet(this, _containerElement);
161
162
  }
162
163
  get webglRenderer() {
163
- return t(this, l);
164
+ return __privateGet(this, _webglRenderer);
164
165
  }
165
166
  get views() {
166
- return t(this, m);
167
+ return __privateGet(this, _views);
167
168
  }
168
169
  get view() {
169
170
  return this.getView("default");
@@ -175,110 +176,115 @@ class Ve {
175
176
  return this.getView("default").scene;
176
177
  }
177
178
  get width() {
178
- return t(this, z);
179
+ return __privateGet(this, _width);
179
180
  }
180
181
  get height() {
181
- return t(this, V);
182
+ return __privateGet(this, _height);
182
183
  }
183
184
  get pixelRatio() {
184
- return t(this, C);
185
+ return __privateGet(this, _pixelRatio);
185
186
  }
186
187
  get composer() {
187
- return t(this, d);
188
+ return __privateGet(this, _composer);
188
189
  }
189
- setup(e) {
190
- if (t(this, T))
190
+ setup(options) {
191
+ if (__privateGet(this, _isCreated))
191
192
  return;
192
- n(this, f, Y(e == null ? void 0 : e.containerElement) || document.body), n(this, v, (e == null ? void 0 : e.maxPixelRatio) || 2), n(this, l, new le(e == null ? void 0 : e.webGLRendererParameters)), t(this, l).domElement.style.cssText = `
193
- position: ${(e == null ? void 0 : e.position) || "fixed"};
193
+ __privateSet(this, _containerElement, getElement(options == null ? void 0 : options.containerElement) || document.body), __privateSet(this, _maxPixelRatio, (options == null ? void 0 : options.maxPixelRatio) || 2), __privateSet(this, _webglRenderer, new WebGLRenderer(options == null ? void 0 : options.webGLRendererParameters)), __privateGet(this, _webglRenderer).domElement.style.cssText = `
194
+ position: ${(options == null ? void 0 : options.position) || "fixed"};
194
195
  left: 0;
195
196
  top: 0;
196
197
  width: 100%;
197
198
  height: 100%;
198
- z-index: ${(e == null ? void 0 : e.zIndex) || 0};
199
- `, (t(this, f).shadowRoot || t(this, f)).append(t(this, l).domElement), t(this, m).set(
199
+ z-index: ${(options == null ? void 0 : options.zIndex) || 0};
200
+ `, (__privateGet(this, _containerElement).shadowRoot || __privateGet(this, _containerElement)).append(__privateGet(this, _webglRenderer).domElement), __privateGet(this, _views).set(
200
201
  "default",
201
- new X(this, "default", F({
202
- sizeElement: t(this, f)
203
- }, e == null ? void 0 : e.view))
204
- ), e != null && e.composer && (n(this, d, new e.composer(t(this, l))), this.render = () => {
205
- t(this, d).render();
206
- }), n(this, T, !0), q.subscribe(t(this, P), he.CANVAS), Z.subscribe(t(this, A), {
207
- order: ae.CANVAS,
208
- culling: t(this, f)
202
+ new En3View(this, "default", __spreadValues({
203
+ sizeElement: __privateGet(this, _containerElement)
204
+ }, options == null ? void 0 : options.view))
205
+ ), options != null && options.composer && (__privateSet(this, _composer, new options.composer(__privateGet(this, _webglRenderer))), this.render = () => {
206
+ __privateGet(this, _composer).render();
207
+ }), __privateSet(this, _isCreated, !0), windowResizer.subscribe(__privateGet(this, _resizeListener), RESIZE_ORDER.CANVAS), ticker.subscribe(__privateGet(this, _tickListener), {
208
+ order: TICK_ORDER.CANVAS,
209
+ culling: __privateGet(this, _containerElement)
209
210
  });
210
211
  }
211
212
  destroy() {
212
- var e;
213
- t(this, T) && (q.unsubscribe(t(this, P)), Z.unsubscribe(t(this, A)), t(this, m).forEach((s) => {
214
- s.destroy();
215
- }), t(this, m).clear(), t(this, l).dispose(), t(this, l).domElement.remove(), n(this, l, null), (e = t(this, d)) == null || e.dispose(), n(this, d, null), n(this, T, !1));
216
- }
217
- createView(e, s) {
218
- const i = t(this, m).size, a = new X(this, e, s);
219
- return t(this, m).set(e, a), i === 1 && t(this, l).setScissorTest(!0), a;
220
- }
221
- getView(e) {
222
- return t(this, m).get(e);
223
- }
224
- destroyView(e) {
225
- const s = t(this, m).get(e);
226
- s && (t(this, m).delete(e), s.destroy(), t(this, m).size <= 1 && t(this, l).setScissorTest(!1));
227
- }
228
- render(e) {
229
- var s;
230
- if (t(this, m).size > 1 || this.view.isClipped) {
231
- const i = e.box.left + e.box.CSSTranslation.x + e.box.scrollValue.x, a = this.height - e.box.height - e.box.top + e.box.CSSTranslation.y + e.box.scrollValue.y * -1;
232
- t(this, l).setScissor(i, a, e.box.width, e.box.height), t(this, l).setViewport(
233
- i,
234
- a,
235
- e.box.width,
236
- e.box.height
213
+ var _a;
214
+ __privateGet(this, _isCreated) && (windowResizer.unsubscribe(__privateGet(this, _resizeListener)), ticker.unsubscribe(__privateGet(this, _tickListener)), __privateGet(this, _views).forEach((view) => {
215
+ view.destroy();
216
+ }), __privateGet(this, _views).clear(), __privateGet(this, _webglRenderer).dispose(), __privateGet(this, _webglRenderer).domElement.remove(), __privateSet(this, _webglRenderer, null), (_a = __privateGet(this, _composer)) == null || _a.dispose(), __privateSet(this, _composer, null), __privateSet(this, _isCreated, !1));
217
+ }
218
+ createView(viewName, viewOptions) {
219
+ const size = __privateGet(this, _views).size, view = new En3View(this, viewName, viewOptions);
220
+ return __privateGet(this, _views).set(viewName, view), size === 1 && __privateGet(this, _webglRenderer).setScissorTest(!0), view;
221
+ }
222
+ getView(viewName) {
223
+ return __privateGet(this, _views).get(viewName);
224
+ }
225
+ destroyView(viewName) {
226
+ const view = __privateGet(this, _views).get(viewName);
227
+ view && (__privateGet(this, _views).delete(viewName), view.destroy(), __privateGet(this, _views).size <= 1 && __privateGet(this, _webglRenderer).setScissorTest(!1));
228
+ }
229
+ render(view) {
230
+ var _a;
231
+ if (__privateGet(this, _views).size > 1 || this.view.isClipped) {
232
+ const left = view.box.left + view.box.CSSTranslation.x + view.box.scrollValue.x, top = this.height - view.box.height - view.box.top + view.box.CSSTranslation.y + view.box.scrollValue.y * -1;
233
+ __privateGet(this, _webglRenderer).setScissor(left, top, view.box.width, view.box.height), __privateGet(this, _webglRenderer).setViewport(
234
+ left,
235
+ top,
236
+ view.box.width,
237
+ view.box.height
237
238
  );
238
239
  }
239
- (s = e.beforeRenderCallback) == null || s.call(e), t(this, l).render(e.scene, e.camera);
240
+ (_a = view.beforeRenderCallback) == null || _a.call(view), __privateGet(this, _webglRenderer).render(view.scene, view.camera);
240
241
  }
242
+ };
243
+ _CDNVersion = new WeakMap(), _containerElement = new WeakMap(), _webglRenderer = new WeakMap(), _views = new WeakMap(), _width = new WeakMap(), _height = new WeakMap(), _pixelRatio = new WeakMap(), _maxPixelRatio = new WeakMap(), _isCreated = new WeakMap(), _composer = new WeakMap(), _resizeListener = new WeakMap(), _tickListener = new WeakMap(), __name(_En3, "En3");
244
+ let En3 = _En3;
245
+ function coverTexture(texture, planeSize, aspect) {
246
+ const width = planeSize.x, height = planeSize.y, _aspect = aspect || texture.image.width / texture.image.height;
247
+ let sx = 0, sy = 0, tx = texture.offset.x, ty = texture.offset.y, r = texture.rotation, cx = texture.center.x, cy = texture.center.y;
248
+ width / height > _aspect ? (sx = 1, sy = height / width * _aspect) : (sy = 1, sx = width / height / _aspect), texture.matrix.setUvTransform(tx, ty, sx, sy, r, cx, cy);
241
249
  }
242
- I = new WeakMap(), f = new WeakMap(), l = new WeakMap(), m = new WeakMap(), z = new WeakMap(), V = new WeakMap(), C = new WeakMap(), v = new WeakMap(), T = new WeakMap(), d = new WeakMap(), P = new WeakMap(), A = new WeakMap();
243
- function Ce(r, e, s) {
244
- const i = e.x, a = e.y, y = s || r.image.width / r.image.height;
245
- let M = 0, E = 0, O = r.offset.x, L = r.offset.y, k = r.rotation, j = r.center.x, p = r.center.y;
246
- i / a > y ? (M = 1, E = a / i * y) : (E = 1, M = i / a / y), r.matrix.setUvTransform(O, L, M, E, k, j, p);
247
- }
248
- const H = new W(), de = new W();
249
- function Te(r, e, s = "default") {
250
- const i = r.getView(s), { width: a, height: y } = r, M = a / y;
251
- e instanceof W ? H.copy(e) : H.set(...e);
252
- const E = i.camera.getWorldPosition(de).distanceTo(H);
253
- if (i.camera instanceof N)
250
+ __name(coverTexture, "coverTexture");
251
+ const tempTarget = new Vector3(), position = new Vector3();
252
+ function getCurrentViewport(en3, target, viewName = "default") {
253
+ const view = en3.getView(viewName), { width, height } = en3, aspect = width / height;
254
+ target instanceof Vector3 ? tempTarget.copy(target) : tempTarget.set(...target);
255
+ const distance = view.camera.getWorldPosition(position).distanceTo(tempTarget);
256
+ if (view.camera instanceof OrthographicCamera)
254
257
  return {
255
- width: a / i.camera.zoom,
256
- height: y / i.camera.zoom,
258
+ width: width / view.camera.zoom,
259
+ height: height / view.camera.zoom,
257
260
  factor: 1,
258
- distance: E,
259
- aspect: M
261
+ distance,
262
+ aspect
260
263
  };
261
264
  {
262
- const O = i.camera.fov * Math.PI / 180, L = 2 * Math.tan(O / 2) * E, k = L * (a / y);
263
- return { width: k, height: L, factor: a / k, distance: E, aspect: M };
265
+ const fov = view.camera.fov * Math.PI / 180, h = 2 * Math.tan(fov / 2) * distance, w = h * (width / height);
266
+ return { width: w, height: h, factor: width / w, distance, aspect };
264
267
  }
265
268
  }
266
- function Me(r, e) {
267
- r.traverse((s) => {
268
- s instanceof $ && s.material && (Array.isArray(s.material) ? s.material : [s.material]).forEach(e);
269
+ __name(getCurrentViewport, "getCurrentViewport");
270
+ function traverseMaterials(object, callback) {
271
+ object.traverse((node) => {
272
+ node instanceof Mesh && node.material && (Array.isArray(node.material) ? node.material : [node.material]).forEach(callback);
269
273
  });
270
274
  }
271
- function Se(r, e) {
272
- r.traverse((s) => {
273
- s instanceof $ && e(s);
275
+ __name(traverseMaterials, "traverseMaterials");
276
+ function traverseMeshes(object, callback) {
277
+ object.traverse((node) => {
278
+ node instanceof Mesh && callback(node);
274
279
  });
275
280
  }
281
+ __name(traverseMeshes, "traverseMeshes");
276
282
  export {
277
- Ve as En3,
278
- X as En3View,
279
- Ce as coverTexture,
280
- fe as dispose,
281
- Te as getCurrentViewport,
282
- Me as traverseMaterials,
283
- Se as traverseMeshes
283
+ En3,
284
+ En3View,
285
+ coverTexture,
286
+ dispose,
287
+ getCurrentViewport,
288
+ traverseMaterials,
289
+ traverseMeshes
284
290
  };
@@ -0,0 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
3
+ function dispatchEvent(from, name, init) {
4
+ init != null && init.custom || init != null && init.detail ? from.dispatchEvent(new CustomEvent(name, init)) : from.dispatchEvent(new Event(name, init));
5
+ }
6
+ __name(dispatchEvent, "dispatchEvent");
7
+ export {
8
+ dispatchEvent as d
9
+ };
@@ -0,0 +1 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function dispatchEvent(from,name,init){init!=null&&init.custom||init!=null&&init.detail?from.dispatchEvent(new CustomEvent(name,init)):from.dispatchEvent(new Event(name,init))}__name(dispatchEvent,"dispatchEvent");exports.dispatchEvent=dispatchEvent;
@@ -0,0 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
3
+ function createJSONAndSave(filename, dataObjToWrite) {
4
+ const blob = new Blob([JSON.stringify(dataObjToWrite)], {
5
+ type: "application/json"
6
+ }), link = document.createElement("a");
7
+ link.download = filename + ".json", link.href = window.URL.createObjectURL(blob), link.dataset.downloadurl = [
8
+ "application/json",
9
+ link.download,
10
+ link.href
11
+ ].join(":");
12
+ const evt = new MouseEvent("click", {
13
+ view: window,
14
+ bubbles: !0,
15
+ cancelable: !0
16
+ });
17
+ link.dispatchEvent(evt), link.remove();
18
+ }
19
+ __name(createJSONAndSave, "createJSONAndSave");
20
+ function downloadURI(uri, name) {
21
+ const link = document.createElement("a");
22
+ name && link.setAttribute("download", name), link.href = uri, document.body.appendChild(link), link.click(), link.remove();
23
+ }
24
+ __name(downloadURI, "downloadURI");
25
+ export {
26
+ createJSONAndSave as c,
27
+ downloadURI as d
28
+ };
@@ -0,0 +1 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function createJSONAndSave(filename,dataObjToWrite){const blob=new Blob([JSON.stringify(dataObjToWrite)],{type:"application/json"}),link=document.createElement("a");link.download=filename+".json",link.href=window.URL.createObjectURL(blob),link.dataset.downloadurl=["application/json",link.download,link.href].join(":");const evt=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});link.dispatchEvent(evt),link.remove()}__name(createJSONAndSave,"createJSONAndSave");function downloadURI(uri,name){const link=document.createElement("a");name&&link.setAttribute("download",name),link.href=uri,document.body.appendChild(link),link.click(),link.remove()}__name(downloadURI,"downloadURI");exports.createJSONAndSave=createJSONAndSave;exports.downloadURI=downloadURI;
@@ -0,0 +1 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});const debounce=__name((callback,delay=100)=>{let timeout;return(...args)=>{clearTimeout(timeout),timeout=setTimeout(()=>callback(...args),delay)}},"debounce"),throttle=__name((callback,delay=0)=>{let wait=!1;return(...args)=>{wait||(wait=!0,setTimeout(()=>{callback(...args),wait=!1},delay))}},"throttle");exports.debounce=debounce;exports.throttle=throttle;
@@ -0,0 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
3
+ const debounce = /* @__PURE__ */ __name((callback, delay = 100) => {
4
+ let timeout;
5
+ return (...args) => {
6
+ clearTimeout(timeout), timeout = setTimeout(() => callback(...args), delay);
7
+ };
8
+ }, "debounce"), throttle = /* @__PURE__ */ __name((callback, delay = 0) => {
9
+ let wait = !1;
10
+ return (...args) => {
11
+ wait || (wait = !0, setTimeout(() => {
12
+ callback(...args), wait = !1;
13
+ }, delay));
14
+ };
15
+ }, "throttle");
16
+ export {
17
+ debounce as d,
18
+ throttle as t
19
+ };
@@ -0,0 +1,14 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
3
+ function setupDrag(onMove, onDrop) {
4
+ const pointerMove = /* @__PURE__ */ __name((moveEvent) => {
5
+ onMove == null || onMove(moveEvent);
6
+ }, "pointerMove"), drop = /* @__PURE__ */ __name((e) => {
7
+ removeEventListener("pointermove", pointerMove), removeEventListener("pointerup", drop), removeEventListener("touchend", drop), onDrop == null || onDrop(e);
8
+ }, "drop");
9
+ addEventListener("pointermove", pointerMove), addEventListener("pointerup", drop), addEventListener("touchend", drop);
10
+ }
11
+ __name(setupDrag, "setupDrag");
12
+ export {
13
+ setupDrag as s
14
+ };
@@ -0,0 +1 @@
1
+ "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function setupDrag(onMove,onDrop){const pointerMove=__name(moveEvent=>{onMove==null||onMove(moveEvent)},"pointerMove"),drop=__name(e=>{removeEventListener("pointermove",pointerMove),removeEventListener("pointerup",drop),removeEventListener("touchend",drop),onDrop==null||onDrop(e)},"drop");addEventListener("pointermove",pointerMove),addEventListener("pointerup",drop),addEventListener("touchend",drop)}__name(setupDrag,"setupDrag");exports.setupDrag=setupDrag;
@@ -1 +1 @@
1
- "use strict";var d=e=>{throw TypeError(e)};var p=(e,t,o)=>t.has(e)||d("Cannot "+o);var i=(e,t,o)=>(p(e,t,"read from private field"),o?o.call(e):t.get(e)),a=(e,t,o)=>t.has(e)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),h=(e,t,o,c)=>(p(e,t,"write to private field"),c?c.call(e,o):t.set(e,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var s,n,r;class w{constructor(t){a(this,s,!1);a(this,n);a(this,r,()=>{if(!window.location.hash)try{h(this,s,!0),i(this,n).onPop(new URL(window.location.toString())),h(this,s,!1)}catch(t){window.location.reload()}});window.addEventListener("popstate",i(this,r)),h(this,n,t)}get isBack(){return i(this,s)}push(t){history.pushState({},"",`${t}`)}destroy(){window.removeEventListener("popstate",i(this,r))}}s=new WeakMap,n=new WeakMap,r=new WeakMap;exports.History=w;
1
+ "use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var _isBack,_options,_popstateListener;const _History=class _History{constructor(options){__privateAdd(this,_isBack,!1);__privateAdd(this,_options);__privateAdd(this,_popstateListener,__name(()=>{if(!window.location.hash)try{__privateSet(this,_isBack,!0),__privateGet(this,_options).onPop(new URL(window.location.toString())),__privateSet(this,_isBack,!1)}catch(e){window.location.reload()}},"#popstateListener"));window.addEventListener("popstate",__privateGet(this,_popstateListener)),__privateSet(this,_options,options)}get isBack(){return __privateGet(this,_isBack)}push(url){history.pushState({},"",`${url}`)}destroy(){window.removeEventListener("popstate",__privateGet(this,_popstateListener))}};_isBack=new WeakMap,_options=new WeakMap,_popstateListener=new WeakMap,__name(_History,"History");let History=_History;exports.History=History;