underpost 2.6.2

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 (269) hide show
  1. package/.dockerignore +14 -0
  2. package/.env.development +8 -0
  3. package/.env.production +8 -0
  4. package/.env.test +8 -0
  5. package/.nycrc +9 -0
  6. package/.prettierignore +13 -0
  7. package/.prettierrc +9 -0
  8. package/.vscode/extensions.json +72 -0
  9. package/.vscode/settings.json +99 -0
  10. package/Dockerfile +88 -0
  11. package/LICENSE +21 -0
  12. package/README.md +51 -0
  13. package/bin/db.js +119 -0
  14. package/bin/deploy.js +600 -0
  15. package/bin/dns.js +1 -0
  16. package/bin/file.js +92 -0
  17. package/bin/help.js +110 -0
  18. package/bin/index.js +29 -0
  19. package/bin/install.js +357 -0
  20. package/bin/shortcut.js +44 -0
  21. package/bin/ssl.js +61 -0
  22. package/bin/util.js +182 -0
  23. package/bin/vs.js +35 -0
  24. package/conf.js +244 -0
  25. package/docker-compose.yml +67 -0
  26. package/jsconfig.json +7 -0
  27. package/jsdoc.json +32 -0
  28. package/nodemon.json +6 -0
  29. package/package.json +128 -0
  30. package/prometheus.yml +36 -0
  31. package/setup.sh +25 -0
  32. package/src/api/core/core.controller.js +69 -0
  33. package/src/api/core/core.model.js +11 -0
  34. package/src/api/core/core.router.js +23 -0
  35. package/src/api/core/core.service.js +29 -0
  36. package/src/api/crypto/crypto.controller.js +51 -0
  37. package/src/api/crypto/crypto.model.js +23 -0
  38. package/src/api/crypto/crypto.router.js +20 -0
  39. package/src/api/crypto/crypto.service.js +64 -0
  40. package/src/api/default/default.controller.js +69 -0
  41. package/src/api/default/default.model.js +20 -0
  42. package/src/api/default/default.router.js +23 -0
  43. package/src/api/default/default.service.js +31 -0
  44. package/src/api/file/file.controller.js +51 -0
  45. package/src/api/file/file.model.js +19 -0
  46. package/src/api/file/file.router.js +20 -0
  47. package/src/api/file/file.service.js +70 -0
  48. package/src/api/instance/instance.controller.js +69 -0
  49. package/src/api/instance/instance.model.js +36 -0
  50. package/src/api/instance/instance.router.js +33 -0
  51. package/src/api/instance/instance.service.js +48 -0
  52. package/src/api/test/test.controller.js +59 -0
  53. package/src/api/test/test.model.js +14 -0
  54. package/src/api/test/test.router.js +21 -0
  55. package/src/api/test/test.service.js +35 -0
  56. package/src/api/user/user.controller.js +70 -0
  57. package/src/api/user/user.model.js +65 -0
  58. package/src/api/user/user.router.js +345 -0
  59. package/src/api/user/user.service.js +479 -0
  60. package/src/api.js +23 -0
  61. package/src/client/Default.index.js +40 -0
  62. package/src/client/components/core/Account.js +290 -0
  63. package/src/client/components/core/AgGrid.js +160 -0
  64. package/src/client/components/core/Auth.js +19 -0
  65. package/src/client/components/core/Badge.js +32 -0
  66. package/src/client/components/core/BlockChain.js +41 -0
  67. package/src/client/components/core/Blog.js +9 -0
  68. package/src/client/components/core/BtnIcon.js +91 -0
  69. package/src/client/components/core/CalendarCore.js +319 -0
  70. package/src/client/components/core/Chat.js +64 -0
  71. package/src/client/components/core/ColorPalette.js +5267 -0
  72. package/src/client/components/core/CommonJs.js +708 -0
  73. package/src/client/components/core/Content.js +49 -0
  74. package/src/client/components/core/Css.js +1027 -0
  75. package/src/client/components/core/CssCore.js +792 -0
  76. package/src/client/components/core/D3Chart.js +44 -0
  77. package/src/client/components/core/Docs.js +130 -0
  78. package/src/client/components/core/DropDown.js +164 -0
  79. package/src/client/components/core/EventsUI.js +54 -0
  80. package/src/client/components/core/FileExplorer.js +624 -0
  81. package/src/client/components/core/FullScreen.js +45 -0
  82. package/src/client/components/core/Input.js +259 -0
  83. package/src/client/components/core/JoyStick.js +77 -0
  84. package/src/client/components/core/Keyboard.js +73 -0
  85. package/src/client/components/core/LoadingAnimation.js +157 -0
  86. package/src/client/components/core/LogIn.js +181 -0
  87. package/src/client/components/core/LogOut.js +52 -0
  88. package/src/client/components/core/Logger.js +26 -0
  89. package/src/client/components/core/Modal.js +1596 -0
  90. package/src/client/components/core/NotificationManager.js +84 -0
  91. package/src/client/components/core/Panel.js +413 -0
  92. package/src/client/components/core/Polyhedron.js +162 -0
  93. package/src/client/components/core/Recover.js +204 -0
  94. package/src/client/components/core/Responsive.js +53 -0
  95. package/src/client/components/core/RichText.js +27 -0
  96. package/src/client/components/core/Router.js +77 -0
  97. package/src/client/components/core/SignUp.js +125 -0
  98. package/src/client/components/core/SocketIo.js +72 -0
  99. package/src/client/components/core/Stream.js +113 -0
  100. package/src/client/components/core/ToggleSwitch.js +87 -0
  101. package/src/client/components/core/ToolTip.js +26 -0
  102. package/src/client/components/core/Translate.js +408 -0
  103. package/src/client/components/core/Validator.js +100 -0
  104. package/src/client/components/core/VanillaJs.js +454 -0
  105. package/src/client/components/core/Wallet.js +106 -0
  106. package/src/client/components/core/Webhook.js +25 -0
  107. package/src/client/components/core/Worker.js +272 -0
  108. package/src/client/components/default/CommonDefault.js +29 -0
  109. package/src/client/components/default/CssDefault.js +13 -0
  110. package/src/client/components/default/ElementsDefault.js +38 -0
  111. package/src/client/components/default/LogInDefault.js +41 -0
  112. package/src/client/components/default/LogOutDefault.js +28 -0
  113. package/src/client/components/default/MenuDefault.js +389 -0
  114. package/src/client/components/default/RoutesDefault.js +48 -0
  115. package/src/client/components/default/SettingsDefault.js +16 -0
  116. package/src/client/components/default/SignUpDefault.js +9 -0
  117. package/src/client/components/default/SocketIoDefault.js +54 -0
  118. package/src/client/components/default/TranslateDefault.js +7 -0
  119. package/src/client/public/default/android-chrome-144x144.png +0 -0
  120. package/src/client/public/default/android-chrome-192x192.png +0 -0
  121. package/src/client/public/default/android-chrome-256x256.png +0 -0
  122. package/src/client/public/default/android-chrome-36x36.png +0 -0
  123. package/src/client/public/default/android-chrome-384x384.png +0 -0
  124. package/src/client/public/default/android-chrome-48x48.png +0 -0
  125. package/src/client/public/default/android-chrome-512x512.png +0 -0
  126. package/src/client/public/default/android-chrome-72x72.png +0 -0
  127. package/src/client/public/default/android-chrome-96x96.png +0 -0
  128. package/src/client/public/default/apple-touch-icon-1024x1024.png +0 -0
  129. package/src/client/public/default/apple-touch-icon-114x114.png +0 -0
  130. package/src/client/public/default/apple-touch-icon-120x120.png +0 -0
  131. package/src/client/public/default/apple-touch-icon-144x144.png +0 -0
  132. package/src/client/public/default/apple-touch-icon-152x152.png +0 -0
  133. package/src/client/public/default/apple-touch-icon-167x167.png +0 -0
  134. package/src/client/public/default/apple-touch-icon-180x180.png +0 -0
  135. package/src/client/public/default/apple-touch-icon-57x57.png +0 -0
  136. package/src/client/public/default/apple-touch-icon-60x60.png +0 -0
  137. package/src/client/public/default/apple-touch-icon-72x72.png +0 -0
  138. package/src/client/public/default/apple-touch-icon-76x76.png +0 -0
  139. package/src/client/public/default/apple-touch-icon-precomposed.png +0 -0
  140. package/src/client/public/default/apple-touch-icon.png +0 -0
  141. package/src/client/public/default/apple-touch-startup-image-1125x2436.png +0 -0
  142. package/src/client/public/default/apple-touch-startup-image-1136x640.png +0 -0
  143. package/src/client/public/default/apple-touch-startup-image-1170x2532.png +0 -0
  144. package/src/client/public/default/apple-touch-startup-image-1179x2556.png +0 -0
  145. package/src/client/public/default/apple-touch-startup-image-1242x2208.png +0 -0
  146. package/src/client/public/default/apple-touch-startup-image-1242x2688.png +0 -0
  147. package/src/client/public/default/apple-touch-startup-image-1284x2778.png +0 -0
  148. package/src/client/public/default/apple-touch-startup-image-1290x2796.png +0 -0
  149. package/src/client/public/default/apple-touch-startup-image-1334x750.png +0 -0
  150. package/src/client/public/default/apple-touch-startup-image-1488x2266.png +0 -0
  151. package/src/client/public/default/apple-touch-startup-image-1536x2048.png +0 -0
  152. package/src/client/public/default/apple-touch-startup-image-1620x2160.png +0 -0
  153. package/src/client/public/default/apple-touch-startup-image-1640x2160.png +0 -0
  154. package/src/client/public/default/apple-touch-startup-image-1668x2224.png +0 -0
  155. package/src/client/public/default/apple-touch-startup-image-1668x2388.png +0 -0
  156. package/src/client/public/default/apple-touch-startup-image-1792x828.png +0 -0
  157. package/src/client/public/default/apple-touch-startup-image-2048x1536.png +0 -0
  158. package/src/client/public/default/apple-touch-startup-image-2048x2732.png +0 -0
  159. package/src/client/public/default/apple-touch-startup-image-2160x1620.png +0 -0
  160. package/src/client/public/default/apple-touch-startup-image-2160x1640.png +0 -0
  161. package/src/client/public/default/apple-touch-startup-image-2208x1242.png +0 -0
  162. package/src/client/public/default/apple-touch-startup-image-2224x1668.png +0 -0
  163. package/src/client/public/default/apple-touch-startup-image-2266x1488.png +0 -0
  164. package/src/client/public/default/apple-touch-startup-image-2388x1668.png +0 -0
  165. package/src/client/public/default/apple-touch-startup-image-2436x1125.png +0 -0
  166. package/src/client/public/default/apple-touch-startup-image-2532x1170.png +0 -0
  167. package/src/client/public/default/apple-touch-startup-image-2556x1179.png +0 -0
  168. package/src/client/public/default/apple-touch-startup-image-2688x1242.png +0 -0
  169. package/src/client/public/default/apple-touch-startup-image-2732x2048.png +0 -0
  170. package/src/client/public/default/apple-touch-startup-image-2778x1284.png +0 -0
  171. package/src/client/public/default/apple-touch-startup-image-2796x1290.png +0 -0
  172. package/src/client/public/default/apple-touch-startup-image-640x1136.png +0 -0
  173. package/src/client/public/default/apple-touch-startup-image-750x1334.png +0 -0
  174. package/src/client/public/default/apple-touch-startup-image-828x1792.png +0 -0
  175. package/src/client/public/default/assets/background/white.jpg +0 -0
  176. package/src/client/public/default/assets/background/white0-min.jpg +0 -0
  177. package/src/client/public/default/assets/background/white0.jpg +0 -0
  178. package/src/client/public/default/assets/logo/base-icon.png +0 -0
  179. package/src/client/public/default/browserconfig.xml +12 -0
  180. package/src/client/public/default/favicon-16x16.png +0 -0
  181. package/src/client/public/default/favicon-32x32.png +0 -0
  182. package/src/client/public/default/favicon-48x48.png +0 -0
  183. package/src/client/public/default/favicon.ico +0 -0
  184. package/src/client/public/default/manifest.webmanifest +69 -0
  185. package/src/client/public/default/mstile-144x144.png +0 -0
  186. package/src/client/public/default/mstile-150x150.png +0 -0
  187. package/src/client/public/default/mstile-310x150.png +0 -0
  188. package/src/client/public/default/mstile-310x310.png +0 -0
  189. package/src/client/public/default/mstile-70x70.png +0 -0
  190. package/src/client/public/default/sitemap +148 -0
  191. package/src/client/public/default/yandex-browser-50x50.png +0 -0
  192. package/src/client/public/default/yandex-browser-manifest.json +9 -0
  193. package/src/client/public/doc/favicon.ico +0 -0
  194. package/src/client/public/doc/sitemap +148 -0
  195. package/src/client/public/test/favicon.ico +0 -0
  196. package/src/client/public/test/sitemap +148 -0
  197. package/src/client/services/core/core.service.js +152 -0
  198. package/src/client/services/crypto/crypto.service.js +70 -0
  199. package/src/client/services/default/default.management.js +345 -0
  200. package/src/client/services/default/default.service.js +89 -0
  201. package/src/client/services/file/file.service.js +70 -0
  202. package/src/client/services/instance/instance.management.js +74 -0
  203. package/src/client/services/instance/instance.service.js +89 -0
  204. package/src/client/services/test/test.service.js +70 -0
  205. package/src/client/services/user/user.management.js +50 -0
  206. package/src/client/services/user/user.service.js +89 -0
  207. package/src/client/ssr/Render.js +16 -0
  208. package/src/client/ssr/body-components/CacheControl.js +113 -0
  209. package/src/client/ssr/body-components/DefaultSplashScreen.js +79 -0
  210. package/src/client/ssr/email-components/DefaultRecoverEmail.js +21 -0
  211. package/src/client/ssr/email-components/DefaultVerifyEmail.js +17 -0
  212. package/src/client/ssr/head-components/Css.js +241 -0
  213. package/src/client/ssr/head-components/DefaultScripts.js +3 -0
  214. package/src/client/ssr/head-components/Microdata.js +11 -0
  215. package/src/client/ssr/head-components/Production.js +1 -0
  216. package/src/client/ssr/head-components/PwaDefault.js +60 -0
  217. package/src/client/ssr/head-components/Seo.js +14 -0
  218. package/src/client/sw/default.sw.js +201 -0
  219. package/src/client/sw/template.sw.js +84 -0
  220. package/src/client.build.js +22 -0
  221. package/src/client.dev.js +21 -0
  222. package/src/cron.js +25 -0
  223. package/src/db/DataBaseProvider.js +34 -0
  224. package/src/db/mariadb/MariaDB.js +33 -0
  225. package/src/db/mongo/MongooseDB.js +46 -0
  226. package/src/dns.js +22 -0
  227. package/src/mailer/EmailRender.js +69 -0
  228. package/src/mailer/MailerProvider.js +96 -0
  229. package/src/proxy.js +22 -0
  230. package/src/runtime/lampp/Lampp.js +44 -0
  231. package/src/runtime/nginx/Nginx.js +3 -0
  232. package/src/runtime/xampp/Xampp.js +49 -0
  233. package/src/server/auth.js +204 -0
  234. package/src/server/backup.js +83 -0
  235. package/src/server/client-build-live.js +72 -0
  236. package/src/server/client-build.js +688 -0
  237. package/src/server/client-dev-server.js +58 -0
  238. package/src/server/client-formatted.js +48 -0
  239. package/src/server/client-icons.js +150 -0
  240. package/src/server/conf.js +611 -0
  241. package/src/server/dns.js +87 -0
  242. package/src/server/downloader.js +42 -0
  243. package/src/server/logger.js +135 -0
  244. package/src/server/network.js +122 -0
  245. package/src/server/peer.js +33 -0
  246. package/src/server/process.js +66 -0
  247. package/src/server/proxy.js +118 -0
  248. package/src/server/runtime.js +393 -0
  249. package/src/server/ssl.js +107 -0
  250. package/src/server.js +25 -0
  251. package/src/ws/IoInterface.js +45 -0
  252. package/src/ws/IoServer.js +39 -0
  253. package/src/ws/core/channels/core.ws.chat.js +23 -0
  254. package/src/ws/core/channels/core.ws.mailer.js +35 -0
  255. package/src/ws/core/channels/core.ws.stream.js +31 -0
  256. package/src/ws/core/core.ws.connection.js +28 -0
  257. package/src/ws/core/core.ws.emit.js +14 -0
  258. package/src/ws/core/core.ws.server.js +24 -0
  259. package/src/ws/core/management/core.ws.chat.js +8 -0
  260. package/src/ws/core/management/core.ws.mailer.js +16 -0
  261. package/src/ws/core/management/core.ws.stream.js +8 -0
  262. package/src/ws/default/channels/default.ws.main.js +16 -0
  263. package/src/ws/default/default.ws.connection.js +22 -0
  264. package/src/ws/default/default.ws.emit.js +14 -0
  265. package/src/ws/default/default.ws.server.js +20 -0
  266. package/src/ws/default/management/default.ws.main.js +8 -0
  267. package/startup.js +11 -0
  268. package/supervisord-openssh-server.conf +5 -0
  269. package/test/api.test.js +60 -0
@@ -0,0 +1,1027 @@
1
+ import { getId, newInstance, range, s4, splitEveryXChar } from './CommonJs.js';
2
+ import { CssCoreDark, CssCoreLight } from './CssCore.js';
3
+ import { DropDown } from './DropDown.js';
4
+ import { Modal } from './Modal.js';
5
+ import { Translate } from './Translate.js';
6
+ import { append, getProxyPath, htmls, s } from './VanillaJs.js';
7
+
8
+ let ThemesScope = [];
9
+
10
+ // https://css.github.io/csso/csso.html
11
+ // https://www.fontspace.com/
12
+ // https://www.1001fonts.com/
13
+
14
+ const Css = {
15
+ loadThemes: async function (themes = []) {
16
+ ThemesScope = [];
17
+ for (const themeOptions of themes) addTheme(themeOptions);
18
+ // if (!ThemesScope.find((t) => t.dark)) addTheme(CssCoreDark);
19
+ // if (!ThemesScope.find((t) => !t.dark)) addTheme(CssCoreLight);
20
+ if (ThemesScope.length === 0) {
21
+ addTheme(CssCoreDark);
22
+ addTheme(CssCoreLight);
23
+ }
24
+ const localStorageTheme = localStorage.getItem('_theme');
25
+ if (localStorageTheme && Themes[localStorageTheme]) {
26
+ const themeOption = ThemesScope.find((t) => t.theme === localStorageTheme);
27
+ if (themeOption) return await this.Init(themeOption);
28
+ }
29
+ await this.Init();
30
+ },
31
+ Init: async function (options) {
32
+ if (!options) options = ThemesScope[0];
33
+ const { theme } = options;
34
+ append(
35
+ 'body',
36
+ html`
37
+ <style>
38
+ html {
39
+ scroll-behavior: smooth;
40
+ }
41
+
42
+ body {
43
+ /* overscroll-behavior: contain; */
44
+ /* box-sizing: border-box; */
45
+ padding: 0px;
46
+ margin: 0px;
47
+ }
48
+
49
+ .fl {
50
+ position: relative;
51
+ display: flow-root;
52
+ }
53
+
54
+ .abs,
55
+ .in {
56
+ display: block;
57
+ }
58
+
59
+ .fll {
60
+ float: left;
61
+ }
62
+
63
+ .flr {
64
+ float: right;
65
+ }
66
+
67
+ .abs {
68
+ position: absolute;
69
+ }
70
+
71
+ .in,
72
+ .inl {
73
+ position: relative;
74
+ }
75
+
76
+ .inl {
77
+ display: inline-table;
78
+ display: -webkit-inline-table;
79
+ display: -moz-inline-table;
80
+ display: -ms-inline-table;
81
+ display: -o-inline-table;
82
+ }
83
+
84
+ .fix {
85
+ position: fixed;
86
+ display: block;
87
+ }
88
+
89
+ .stq {
90
+ position: sticky;
91
+ /* require defined at least top, bottom, left o right */
92
+ }
93
+
94
+ .wfa {
95
+ width: fill-available;
96
+ width: -webkit-fill-available;
97
+ width: -moz-fill-available;
98
+ width: -ms-fill-available;
99
+ width: -o-fill-available;
100
+ }
101
+
102
+ .wft {
103
+ width: fit-content;
104
+ width: -webkit-fit-content;
105
+ width: -moz-fit-content;
106
+ width: -ms-fit-content;
107
+ width: -o-fit-content;
108
+ }
109
+
110
+ .wfm {
111
+ width: max-content;
112
+ width: -webkit-max-content;
113
+ width: -moz-max-content;
114
+ width: -ms-max-content;
115
+ width: -o-max-content;
116
+ }
117
+
118
+ .negative-color {
119
+ filter: invert(1);
120
+ -webkit-filter: invert(1);
121
+ -moz-filter: invert(1);
122
+ -ms-filter: invert(1);
123
+ -o-filter: invert(1);
124
+ }
125
+
126
+ .no-drag {
127
+ user-drag: none;
128
+ -webkit-user-drag: none;
129
+ -moz-user-drag: none;
130
+ -ms-user-drag: none;
131
+ -o-user-drag: none;
132
+ user-select: none;
133
+ -webkit-user-select: none;
134
+ -moz-user-select: none;
135
+ -ms-user-select: none;
136
+ -o-user-select: none;
137
+ }
138
+
139
+ .center {
140
+ transform: translate(-50%, -50%);
141
+ top: 50%;
142
+ left: 50%;
143
+ width: 100%;
144
+ text-align: center;
145
+ }
146
+
147
+ input {
148
+ outline: none !important;
149
+ border: none;
150
+ padding-block: 0;
151
+ padding-inline: 0;
152
+ }
153
+ input::file-selector-button {
154
+ outline: none !important;
155
+ border: none;
156
+ }
157
+
158
+ .hide {
159
+ display: none !important;
160
+ }
161
+ /*
162
+
163
+ placeholder
164
+
165
+ */
166
+
167
+ ::placeholder {
168
+ color: black;
169
+ opacity: 1;
170
+ /* Firefox */
171
+ background: none;
172
+ }
173
+
174
+ :-ms-input-placeholder {
175
+ /* Internet Explorer 10-11 */
176
+ color: black;
177
+ background: none;
178
+ }
179
+
180
+ ::-ms-input-placeholder {
181
+ /* Microsoft Edge */
182
+ color: black;
183
+ background: none;
184
+ }
185
+
186
+ /*
187
+
188
+ selection
189
+
190
+ */
191
+
192
+ ::-moz-selection {
193
+ /* Code for Firefox */
194
+ color: black;
195
+ background: rgb(208, 208, 208);
196
+ }
197
+
198
+ ::selection {
199
+ color: black;
200
+ background: rgb(208, 208, 208);
201
+ }
202
+
203
+ .lowercase {
204
+ text-transform: lowercase;
205
+ }
206
+ .uppercase {
207
+ text-transform: uppercase;
208
+ }
209
+ .capitalize {
210
+ text-transform: capitalize;
211
+ }
212
+
213
+ .bold {
214
+ font-weight: bold;
215
+ }
216
+
217
+ .m {
218
+ font-family: monospace;
219
+ }
220
+
221
+ .gray {
222
+ filter: grayscale(1);
223
+ }
224
+ </style>
225
+ <div class="session">
226
+ <style>
227
+ .session-in-log-out {
228
+ display: block;
229
+ }
230
+ .session-inl-log-out {
231
+ display: inline-table;
232
+ }
233
+ .session-in-log-in {
234
+ display: none;
235
+ }
236
+ .session-inl-log-in {
237
+ display: none;
238
+ }
239
+ </style>
240
+ </div>
241
+ <div class="theme"></div>
242
+ `,
243
+ );
244
+ return await Themes[theme](options);
245
+ },
246
+ RenderSetting: async function () {
247
+ return html` <div class="in section-mp">
248
+ ${await DropDown.Render({
249
+ id: 'settings-theme',
250
+ value: Css.currentTheme,
251
+ label: html`${Translate.Render('theme')}`,
252
+ data: ThemesScope.map((themeOption) => {
253
+ return {
254
+ display: html`<i class="fa-solid fa-brush"></i> ${themeOption.theme}`,
255
+ value: themeOption.theme,
256
+ onClick: async () => await Themes[themeOption.theme](),
257
+ };
258
+ }),
259
+ })}
260
+ </div>`;
261
+ },
262
+ };
263
+
264
+ const barLabels = (options) => {
265
+ return {
266
+ img: {
267
+ close: html`<img
268
+ class="inl bar-default-modal-icon ${options.iconClass ? options.iconClass : ''}"
269
+ src="${getProxyPath()}assets/icons/close.png"
270
+ />`,
271
+ maximize: html`<img
272
+ class="inl bar-default-modal-icon ${options.iconClass ? options.iconClass : ''}"
273
+ src="${getProxyPath()}assets/icons/maximize.png"
274
+ />`,
275
+ minimize: html`<img
276
+ class="inl bar-default-modal-icon ${options.iconClass ? options.iconClass : ''}"
277
+ src="${getProxyPath()}assets/icons/minimize.png"
278
+ />`,
279
+ restore: html`<img
280
+ class="inl bar-default-modal-icon ${options.iconClass ? options.iconClass : ''}"
281
+ src="${getProxyPath()}assets/icons/restore.png"
282
+ />`,
283
+ menu: html`<img
284
+ class="inl bar-default-modal-icon ${options.iconClass ? options.iconClass : ''}"
285
+ src="${getProxyPath()}assets/icons/menu.png"
286
+ />`,
287
+ },
288
+ fontawesome: {
289
+ close: html`<i class="fa-solid fa-xmark ${options.iconClass ? options.iconClass : ''}"></i>`,
290
+ maximize: html`<i class="fa-regular fa-square ${options.iconClass ? options.iconClass : ''}"></i>`,
291
+ minimize: html`<i class="fa-solid fa-window-minimize ${options.iconClass ? options.iconClass : ''}"></i>`,
292
+ restore: html`<i class="fa-regular fa-window-restore ${options.iconClass ? options.iconClass : ''}"></i>`,
293
+ menu: html`<i class="fa-solid fa-bars ${options.iconClass ? options.iconClass : ''}"></i>`,
294
+ },
295
+ default: {
296
+ close: html`X`,
297
+ maximize: html`▢`,
298
+ minimize: html`_`,
299
+ restore: html`□`,
300
+ menu: html`≡`,
301
+ },
302
+ };
303
+ };
304
+
305
+ const barConfig = (options) => {
306
+ const { barButtonsIconTheme } = options;
307
+ return {
308
+ buttons: {
309
+ close: {
310
+ disabled: false,
311
+ label: barLabels(options)[barButtonsIconTheme].close,
312
+ },
313
+ maximize: {
314
+ disabled: false,
315
+ label: barLabels(options)[barButtonsIconTheme].maximize,
316
+ },
317
+ minimize: {
318
+ disabled: false,
319
+ label: barLabels(options)[barButtonsIconTheme].minimize,
320
+ },
321
+ restore: {
322
+ disabled: false,
323
+ label: barLabels(options)[barButtonsIconTheme].restore,
324
+ },
325
+ menu: {
326
+ disabled: true,
327
+ label: barLabels(options)[barButtonsIconTheme].menu,
328
+ },
329
+ },
330
+ };
331
+ };
332
+
333
+ const renderDefaultWindowsModalButtonContent = (options) => {
334
+ const { barButtonsIconTheme, htmlRender } = options;
335
+ const barConfigInstance = barConfig(options);
336
+ if (htmlRender)
337
+ Object.keys(Modal.Data).map((idModal) => {
338
+ if (s(`.btn-minimize-${idModal}`)) htmls(`.btn-minimize-${idModal}`, barConfigInstance.buttons.minimize.label);
339
+ if (s(`.btn-restore-${idModal}`)) htmls(`.btn-restore-${idModal}`, barConfigInstance.buttons.restore.label);
340
+ if (s(`.btn-maximize-${idModal}`)) htmls(`.btn-maximize-${idModal}`, barConfigInstance.buttons.maximize.label);
341
+ if (s(`.btn-close-${idModal}`)) htmls(`.btn-close-${idModal}`, barConfigInstance.buttons.close.label);
342
+ if (s(`.btn-menu-${idModal}`)) htmls(`.btn-menu-${idModal}`, barConfigInstance.buttons.menu.label);
343
+ });
344
+ return { barConfig: barConfigInstance };
345
+ };
346
+
347
+ let darkTheme = true;
348
+ const ThemeEvents = {};
349
+ const TriggerThemeEvents = () => {
350
+ localStorage.setItem('_theme', Css.currentTheme);
351
+ Object.keys(ThemeEvents).map((keyEvent) => ThemeEvents[keyEvent]());
352
+ };
353
+
354
+ const Themes = {};
355
+
356
+ const addTheme = (options) => {
357
+ ThemesScope.push(options);
358
+ Themes[options.theme] = async (barOptions) => {
359
+ if (!options.dark) options.dark = false;
360
+ if (!options.barButtonsIconTheme) options.barButtonsIconTheme = 'fontawesome';
361
+ const htmlRender = Css.currentTheme !== options.theme;
362
+ if (htmlRender) {
363
+ Css.currentTheme = options.theme;
364
+ darkTheme = options.dark;
365
+ let render = '';
366
+ if (!['core', 'css-core'].includes(options.theme))
367
+ render += darkTheme ? await CssCoreDark.render() : await CssCoreLight.render();
368
+ render += await options.render();
369
+ htmls('.theme', render);
370
+ TriggerThemeEvents();
371
+ }
372
+ return {
373
+ ...renderDefaultWindowsModalButtonContent({
374
+ barButtonsIconTheme: options.barButtonsIconTheme,
375
+ htmlRender,
376
+ ...barOptions,
377
+ }),
378
+ };
379
+ };
380
+ };
381
+
382
+ const borderChar = (px, color, selectors) => {
383
+ if (selectors) {
384
+ return selectors
385
+ .map(
386
+ (selector) => html`
387
+ <style>
388
+ ${selector} {
389
+ text-shadow: ${px}px -${px}px ${px}px ${color}, -${px}px ${px}px ${px}px ${color},
390
+ -${px}px -${px}px ${px}px ${color}, ${px}px ${px}px ${px}px ${color};
391
+ }
392
+ </style>
393
+ `,
394
+ )
395
+ .join('');
396
+ }
397
+ return html`
398
+ text-shadow: ${px}px -${px}px ${px}px ${color}, -${px}px ${px}px ${px}px ${color}, -${px}px -${px}px ${px}px
399
+ ${color}, ${px}px ${px}px ${px}px ${color};
400
+ `;
401
+ };
402
+
403
+ const boxShadow = ({ selector }) => html`
404
+ <style>
405
+ ${selector} {
406
+ box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
407
+ }
408
+ ${selector}:hover {
409
+ box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 10px 30px 0 rgba(0, 0, 0, 0.3);
410
+ }
411
+ </style>
412
+ `;
413
+
414
+ const renderMediaQuery = (mediaData) => {
415
+ // first limit should be '0'
416
+ return html`
417
+ ${mediaData
418
+ .map(
419
+ (mediaState) => html`
420
+ <style>
421
+ @media only screen and (min-width: ${mediaState.limit}px) {
422
+ ${mediaState.css}
423
+ }
424
+ </style>
425
+ `,
426
+ )
427
+ .join('')}
428
+ `;
429
+ };
430
+
431
+ const renderStatus = (status, options) => {
432
+ switch (status) {
433
+ case 'success':
434
+ return html`<div class="${options?.class ? options.class : 'abs center'}">
435
+ <i style="color: green" class="fa-solid fa-check"></i>
436
+ </div>`;
437
+ case 'error':
438
+ return html`<div class="${options?.class ? options.class : 'abs center'}">
439
+ <i style="color: red" class="fa-solid fa-xmark"></i>
440
+ </div>`;
441
+ case 'warning':
442
+ return html`<div class="${options?.class ? options.class : 'abs center'}">
443
+ <i style="color: yellow" class="fa-solid fa-triangle-exclamation"></i>
444
+ </div>`;
445
+ default:
446
+ return html``;
447
+ }
448
+ };
449
+
450
+ const dynamicColTokens = {};
451
+
452
+ const dynamicCol = (options = { containerSelector: '', id: '', type: '', limit: 900 }) => {
453
+ const { containerSelector, id } = options;
454
+ const limitCol = options?.limit ? options.limit : 900;
455
+ if (!(id in dynamicColTokens)) dynamicColTokens[id] = {};
456
+ dynamicColTokens[id].options = options;
457
+ if (dynamicColTokens[id].observer) dynamicColTokens[id].observer.disconnect();
458
+ setTimeout(() => {
459
+ dynamicColTokens[id].observer = new ResizeObserver(() => {
460
+ if (s(`.${containerSelector}`)) {
461
+ switch (options.type) {
462
+ case 'a-50-b-50':
463
+ if (s(`.${containerSelector}`).offsetWidth < limitCol)
464
+ htmls(
465
+ `.style-${id}-col`,
466
+ css`
467
+ .${id}-col-a, .${id}-col-b {
468
+ width: 100%;
469
+ }
470
+ `,
471
+ );
472
+ else
473
+ htmls(
474
+ `.style-${id}-col`,
475
+ css`
476
+ .${id}-col-a {
477
+ width: 50%;
478
+ }
479
+ .${id}-col-b {
480
+ width: 50%;
481
+ }
482
+ `,
483
+ );
484
+ break;
485
+
486
+ default:
487
+ if (s(`.${containerSelector}`).offsetWidth < 900)
488
+ htmls(
489
+ `.style-${id}-col`,
490
+ css`
491
+ .${id}-col-a, .${id}-col-b {
492
+ width: 100%;
493
+ }
494
+ `,
495
+ );
496
+ else
497
+ htmls(
498
+ `.style-${id}-col`,
499
+ css`
500
+ .${id}-col-a {
501
+ width: 30%;
502
+ }
503
+ .${id}-col-b {
504
+ width: 70%;
505
+ }
506
+ `,
507
+ );
508
+ break;
509
+ }
510
+ } else {
511
+ dynamicColTokens[id].observer.disconnect();
512
+ delete dynamicColTokens[id];
513
+ if (s(`.style-${id}-col`)) s(`.style-${id}-col`).remove();
514
+ }
515
+ });
516
+ dynamicColTokens[id].observer.observe(s(`.${containerSelector}`));
517
+ });
518
+ return html` <style class="style-${id}-col"></style>`;
519
+ };
520
+
521
+ const renderBubbleDialog = async function (
522
+ options = {
523
+ id: '',
524
+ html: async () => '',
525
+ classSelectors,
526
+ triangleType: 'down',
527
+ trianglePositionCss: '',
528
+ triangleCss: '',
529
+ triangleDim: 0,
530
+ bubbleCss: '',
531
+ },
532
+ ) {
533
+ const { id, html } = options;
534
+ let cssTrianglePosition = `
535
+ bottom: -45px;
536
+ left: 5px;
537
+ `;
538
+ let whiteTriangleStyle = `top: 43%`;
539
+ let blackTriangleStyle = ``;
540
+ switch (options.triangleType) {
541
+ case 'right':
542
+ cssTrianglePosition = `
543
+ right: -40px;
544
+ top: 5px;
545
+ `;
546
+ blackTriangleStyle = `
547
+ top: 43%;
548
+ left: 57%;
549
+ `;
550
+ break;
551
+
552
+ default:
553
+ break;
554
+ }
555
+ if (options.trianglePositionCss) cssTrianglePosition = options.trianglePositionCss;
556
+ return html` <div
557
+ class="${options?.classSelectors ? options.classSelectors : 'inl'} bubble-dialog bubble-dialog-${id}"
558
+ ${options.bubbleCss ? `style='${options.bubbleCss}'` : ''}
559
+ >
560
+ <style class="style-bubble-dialog-triangle-${id}">
561
+ .bubble-dialog-triangle-${id} {
562
+ width: ${options.triangleDim ? options.triangleDim : 60}px;
563
+ height: ${options.triangleDim ? options.triangleDim : 60}px;
564
+ /* border: 2px solid red; */
565
+ box-sizing: border-box;
566
+ ${cssTrianglePosition}
567
+ }
568
+ </style>
569
+ <div class="abs bubble-dialog-triangle bubble-dialog-triangle-${id}">
570
+ <div class="abs center" style="${blackTriangleStyle}">
571
+ ${triangle[options?.triangleType ? options.triangleType : 'down']({
572
+ dim: 25,
573
+ id: id + '-triangle-black',
574
+ color: 'black',
575
+ classList: 'inl',
576
+ customStyle: options.triangleCss,
577
+ })}
578
+ </div>
579
+ <div class="abs center" style="${whiteTriangleStyle}">
580
+ ${triangle[options?.triangleType ? options.triangleType : 'down']({
581
+ dim: 24,
582
+ id: id + '-triangle-white',
583
+ color: 'white',
584
+ classList: 'inl',
585
+ customStyle: options.triangleCss,
586
+ })}
587
+ </div>
588
+ </div>
589
+ ${await html()}
590
+ </div>`;
591
+ };
592
+
593
+ const typeWriter = async function ({ id, html, seconds, endHideBlink, container }) {
594
+ if (!seconds) seconds = 2;
595
+ return new Promise((resolve) => {
596
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function
597
+ // https://www.w3schools.com/cssref/css3_pr_animation-fill-mode.php
598
+ const typingAnimationTransitionStyle = [`1s linear`, `${seconds}s steps(30, end)`, `1s forwards`];
599
+ const render = html`
600
+ <style class="style-${id}">
601
+ .tw-${id}-typed-out {
602
+ overflow: hidden;
603
+ border-right: 0.15em solid orange;
604
+ white-space: nowrap;
605
+ animation: typing-${id} ${typingAnimationTransitionStyle[1]}, blink-caret-${id} 0.5s step-end infinite;
606
+ animation-fill-mode: forwards;
607
+ width: 0;
608
+ }
609
+ </style>
610
+ <style>
611
+ .tw-${id}-container {
612
+ }
613
+ @keyframes typing-${id} {
614
+ from {
615
+ width: 0;
616
+ }
617
+ to {
618
+ width: 100%;
619
+ }
620
+ }
621
+
622
+ @keyframes blink-caret-${id} {
623
+ from,
624
+ to {
625
+ border-color: transparent;
626
+ }
627
+ 50% {
628
+ border-color: orange;
629
+ }
630
+ }
631
+ </style>
632
+ <div class="inl tw-${id}-container">
633
+ <div class="tw-${id}-typed-out">${html}</div>
634
+ </div>
635
+ `;
636
+ htmls(`.${container}`, render);
637
+ setTimeout(() => {
638
+ if (endHideBlink && s(`.style-${id}`)) s(`.style-${id}`).remove();
639
+ resolve(render);
640
+ }, seconds * 1000);
641
+ });
642
+ };
643
+
644
+ const renderCssAttr = (options) =>
645
+ `${
646
+ options && options.style
647
+ ? Object.keys(options.style)
648
+ .map((keyStyle) => `${keyStyle}: ${options.style[keyStyle]};`)
649
+ .join(`\n`)
650
+ : ''
651
+ }`;
652
+
653
+ const renderStyleTag = (styleSelector = 'style-abc', selector, options) =>
654
+ html`<style class="${styleSelector}">
655
+ ${selector} { ${renderCssAttr(options)} }
656
+ </style>`;
657
+
658
+ function getTranslate3d(el) {
659
+ const values = el.style.transform.split(/\w+\(|\);?/);
660
+ if (!values[1] || !values[1].length) {
661
+ return [];
662
+ }
663
+ return values[1].split(/,\s?/g);
664
+ }
665
+
666
+ const dashRange = ({ selector, color }) => {
667
+ return html`
668
+ <style>
669
+ .${selector} {
670
+ background: linear-gradient(90deg, ${color} 50%, transparent 50%),
671
+ linear-gradient(90deg, ${color} 50%, transparent 50%), linear-gradient(0deg, ${color} 50%, transparent 50%),
672
+ linear-gradient(0deg, ${color} 50%, transparent 50%);
673
+ background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
674
+ background-size: 16px 4px, 16px 4px, 4px 16px, 4px 16px;
675
+ background-position: 0% 0%, 100% 100%, 0% 100%, 100% 0px;
676
+ border-radius: 5px;
677
+ padding: 10px;
678
+ animation: ${selector}_dash_range 5s linear infinite;
679
+ }
680
+
681
+ @keyframes ${selector}_dash_range {
682
+ to {
683
+ background-position: 100% 0%, 0% 100%, 0% 0%, 100% 100%;
684
+ }
685
+ }
686
+ </style>
687
+ `;
688
+ };
689
+ const triangle = {
690
+ up: ({ id, dim, color, classList, customStyle }) => {
691
+ return html`<style class="style-${id}">
692
+ .arrow-up-${id} {
693
+ width: 0;
694
+ height: 0;
695
+ border-left: ${dim}px solid transparent;
696
+ border-right: ${dim}px solid transparent;
697
+ border-bottom: ${dim}px solid ${color};
698
+ }
699
+ </style>
700
+ <div
701
+ class="arrow-up-${id} ${classList}"
702
+ ${customStyle ? `style="${customStyle ? customStyle : ''}"` : ''}
703
+ ></div>`;
704
+ },
705
+ down: ({ id, dim, color, classList, customStyle }) => {
706
+ return html`<style class="style-${id}">
707
+ .arrow-down-${id} {
708
+ width: 0;
709
+ height: 0;
710
+ border-left: ${dim}px solid transparent;
711
+ border-right: ${dim}px solid transparent;
712
+ border-top: ${dim}px solid ${color};
713
+ }
714
+ </style>
715
+ <div
716
+ class="arrow-down-${id} ${classList}"
717
+ ${customStyle ? `style="${customStyle ? customStyle : ''}"` : ''}
718
+ ></div>`;
719
+ },
720
+ right: ({ id, dim, color, classList, customStyle }) => {
721
+ return html` <style class="style-${id}">
722
+ .arrow-right-${id} {
723
+ width: 0;
724
+ height: 0;
725
+ border-top: ${dim}px solid transparent;
726
+ border-bottom: ${dim}px solid transparent;
727
+ border-left: ${dim}px solid ${color};
728
+ }
729
+ </style>
730
+ <div
731
+ class="arrow-right-${id} ${classList}"
732
+ ${customStyle ? `style="${customStyle ? customStyle : ''}"` : ''}
733
+ ></div>`;
734
+ },
735
+ left: ({ id, dim, color, classList, customStyle }) => {
736
+ return html`<style class="style-${id}">
737
+ .arrow-left-${id} {
738
+ width: 0;
739
+ height: 0;
740
+ border-top: ${dim}px solid transparent;
741
+ border-bottom: ${dim}px solid transparent;
742
+ border-right: ${dim}px solid ${color};
743
+ }
744
+ </style>
745
+ <div
746
+ class="arrow-left-${id} ${classList}"
747
+ ${customStyle ? `style="${customStyle ? customStyle : ''}"` : ''}
748
+ ></div>`;
749
+ },
750
+ };
751
+
752
+ const getSectionsStringData = (offsetWidth, text) => {
753
+ const sectionsIndex = [];
754
+ const everyXChar = parseInt(offsetWidth / 4);
755
+ const phraseArray = text
756
+ .split('.')
757
+ .map((t) => splitEveryXChar(t + '.', everyXChar, ['.', ' ']))
758
+ .flat()
759
+ .filter((p) => p !== '.' && p.trim());
760
+
761
+ let currentIndex = [0];
762
+ let pi = -1;
763
+ for (const p of phraseArray) {
764
+ pi++;
765
+ if (p.indexOf('.') !== -1) {
766
+ currentIndex.push(newInstance(pi));
767
+ sectionsIndex.push(newInstance(currentIndex));
768
+ if (phraseArray[pi + 1]) currentIndex = [newInstance(pi + 1)];
769
+ else currentIndex = [];
770
+ }
771
+ }
772
+ if (currentIndex[0] && !currentIndex[1]) {
773
+ currentIndex[1] = phraseArray.length - 1;
774
+ sectionsIndex.push(newInstance(currentIndex));
775
+ }
776
+ return { phraseArray, sectionsIndex };
777
+ };
778
+
779
+ const typeWriteSectionsString = ({ container, phraseArray, rangeArraySectionIndex }) =>
780
+ new Promise((resolve) => {
781
+ let cumulativeSeconds = 0;
782
+ for (const index of range(...rangeArraySectionIndex)) {
783
+ const subIdSalt = s4() + s4() + s4();
784
+ const seconds = phraseArray[index].trim().length * 0.05;
785
+ append(`.${container}`, html` <div class="${container}-${subIdSalt}"></div> `);
786
+ setTimeout(async () => {
787
+ if (s(`.${container}-${subIdSalt}`)) {
788
+ append(`.${container}-${subIdSalt}`, html` <div class="render-typeWriter-${container}-${subIdSalt}"></div> `);
789
+ await typeWriter({
790
+ id: `typeWriter-${index}-${container}`,
791
+ html: phraseArray[index].trim(),
792
+ endHideBlink: index < rangeArraySectionIndex[1],
793
+ seconds,
794
+ container: `render-typeWriter-${container}-${subIdSalt}`,
795
+ });
796
+ }
797
+ if (index === rangeArraySectionIndex[1]) resolve();
798
+ }, cumulativeSeconds * 1000);
799
+ cumulativeSeconds += seconds;
800
+ }
801
+ });
802
+
803
+ const cssBrowserCodes = ['webkit', 'moz', 'ms', 'o'];
804
+
805
+ const scrollBarLightRender = () => {
806
+ return cssBrowserCodes
807
+ .map(
808
+ (b) =>
809
+ html`<style>
810
+ ::-` +
811
+ b +
812
+ `-scrollbar {
813
+ width: 5px;
814
+ height: 5px;
815
+ }
816
+
817
+ /* Track */
818
+ ::-` +
819
+ b +
820
+ `-scrollbar-track {
821
+ background: none !important;
822
+ }
823
+
824
+ /* Handle */
825
+ ::-` +
826
+ b +
827
+ `-scrollbar-thumb {
828
+ background: #15151557;
829
+ border-radius: 3px;
830
+ }
831
+
832
+ /* Handle on hover */
833
+ ::-` +
834
+ b +
835
+ `-scrollbar-thumb:hover {
836
+ background: #4d4d4dbb;
837
+ }
838
+ </style>`,
839
+ )
840
+ .join('');
841
+ };
842
+
843
+ const scrollBarDarkRender = () => {
844
+ return cssBrowserCodes
845
+ .map(
846
+ (b) =>
847
+ html`<style>
848
+ ::-` +
849
+ b +
850
+ `-scrollbar {
851
+ width: 5px;
852
+ height: 5px;
853
+ /* line-height: 1em; */
854
+ }
855
+
856
+ /* Track */
857
+ ::-` +
858
+ b +
859
+ `-scrollbar-track {
860
+ background: none !important;
861
+ }
862
+
863
+ /* Handle */
864
+ ::-` +
865
+ b +
866
+ `-scrollbar-thumb {
867
+ background: #74747457;
868
+ border-radius: 3px;
869
+ }
870
+
871
+ /* Handle on hover */
872
+ ::-` +
873
+ b +
874
+ `-scrollbar-thumb:hover {
875
+ background: #98989857;
876
+ }
877
+ </style>`,
878
+ )
879
+ .join('');
880
+ };
881
+
882
+ const renderWave = ({ id }) => {
883
+ return html`
884
+ <style>
885
+ .wave-animation-container-${id} {
886
+ height: 200px;
887
+ }
888
+ .wave-animation-container-${id} {
889
+ background: linear-gradient(
890
+ 315deg,
891
+ rgba(101, 0, 94, 1) 3%,
892
+ rgba(60, 132, 206, 1) 38%,
893
+ rgba(48, 238, 226, 1) 68%,
894
+ rgba(255, 25, 25, 1) 98%
895
+ );
896
+ animation: gradient-${id} 15s ease infinite;
897
+ background-size: 400% 400%;
898
+ overflow: hidden;
899
+ }
900
+
901
+ @keyframes gradient-${id} {
902
+ 0% {
903
+ background-position: 0% 0%;
904
+ }
905
+ 50% {
906
+ background-position: 100% 100%;
907
+ }
908
+ 100% {
909
+ background-position: 0% 0%;
910
+ }
911
+ }
912
+
913
+ .wave-${id} {
914
+ background: rgb(255 255 255 / 25%);
915
+ border-radius: 1000% 1000% 0 0;
916
+ width: 200%;
917
+ height: 12em;
918
+ animation: wave-${id} 10s -3s linear infinite;
919
+ opacity: 0.8;
920
+ bottom: 0;
921
+ left: 0;
922
+ top: 30%;
923
+ }
924
+
925
+ .wave-${id}:nth-of-type(2) {
926
+ animation: wave-${id} 18s linear reverse infinite;
927
+ opacity: 0.8;
928
+ top: 50%;
929
+ }
930
+
931
+ .wave-${id}:nth-of-type(3) {
932
+ animation: wave-${id} 20s -1s reverse infinite;
933
+ opacity: 0.9;
934
+ top: 70%;
935
+ }
936
+
937
+ @keyframes wave-${id} {
938
+ 2% {
939
+ transform: translateX(1);
940
+ }
941
+
942
+ 25% {
943
+ transform: translateX(-25%);
944
+ }
945
+
946
+ 50% {
947
+ transform: translateX(-50%);
948
+ }
949
+
950
+ 75% {
951
+ transform: translateX(-25%);
952
+ }
953
+
954
+ 100% {
955
+ transform: translateX(1);
956
+ }
957
+ }
958
+ </style>
959
+ <div class="in wave-animation-container-${id} ${id}">
960
+ <div class="in wave-${id}"></div>
961
+ <div class="abs wave-${id}"></div>
962
+ <div class="abs wave-${id}"></div>
963
+ </div>
964
+ `;
965
+ };
966
+
967
+ const cssTokensEffect = {};
968
+ const cssTokensContainer = {};
969
+ const cssEffect = async (containerSelector, event) => {
970
+ // Array.from(event.target.classList)
971
+ let offsetX, offsetY;
972
+ if (Array.from(event.srcElement.classList).includes('ripple') && cssTokensContainer[containerSelector]) {
973
+ offsetX = cssTokensContainer[containerSelector].lastOffsetX;
974
+ offsetY = cssTokensContainer[containerSelector].lastOffsetY;
975
+ } else {
976
+ cssTokensContainer[containerSelector] = { lastOffsetX: event.offsetX, lastOffsetY: event.offsetY };
977
+ offsetX = event.offsetX;
978
+ offsetY = event.offsetY;
979
+ }
980
+ const element = s(containerSelector);
981
+ element.style.overflow = 'hidden';
982
+ const id = getId(cssTokensEffect, 'btn-effect-');
983
+ cssTokensEffect[id] = { containerSelector, event };
984
+ append(containerSelector, html`<span class="abs ${id} ripple" style="display: none"></span>`);
985
+ const circle = s(`.${id}`);
986
+ circle.style.width = circle.style.height = `40px`;
987
+ circle.style.left = `${offsetX}px`;
988
+ circle.style.top = `${offsetY}px`;
989
+ circle.style.display = null;
990
+ setTimeout(() => {
991
+ circle.remove();
992
+ delete cssTokensEffect[id];
993
+ }, 600);
994
+ };
995
+
996
+ export {
997
+ Css,
998
+ Themes,
999
+ barLabels,
1000
+ barConfig,
1001
+ borderChar,
1002
+ renderMediaQuery,
1003
+ renderDefaultWindowsModalButtonContent,
1004
+ renderStatus,
1005
+ dynamicCol,
1006
+ dynamicColTokens,
1007
+ boxShadow,
1008
+ addTheme,
1009
+ darkTheme,
1010
+ ThemeEvents,
1011
+ TriggerThemeEvents,
1012
+ ThemesScope,
1013
+ renderBubbleDialog,
1014
+ typeWriter,
1015
+ renderStyleTag,
1016
+ renderCssAttr,
1017
+ getTranslate3d,
1018
+ dashRange,
1019
+ triangle,
1020
+ getSectionsStringData,
1021
+ typeWriteSectionsString,
1022
+ cssBrowserCodes,
1023
+ scrollBarDarkRender,
1024
+ scrollBarLightRender,
1025
+ renderWave,
1026
+ cssEffect,
1027
+ };