nanosplash 2.5.3 → 3.0.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 (102) hide show
  1. package/.github/workflows/ci.yml +48 -0
  2. package/.prettierrc +10 -9
  3. package/LICENSE +1 -1
  4. package/README.md +139 -72
  5. package/coverage/base.css +224 -0
  6. package/coverage/block-navigation.js +87 -0
  7. package/coverage/clover.xml +555 -0
  8. package/coverage/core/Dom.ts.html +565 -0
  9. package/coverage/core/Service.ts.html +790 -0
  10. package/coverage/core/Splash.ts.html +457 -0
  11. package/coverage/core/index.html +146 -0
  12. package/coverage/coverage-final.json +9043 -0
  13. package/coverage/favicon.png +0 -0
  14. package/coverage/index.html +131 -0
  15. package/coverage/prettify.css +1 -0
  16. package/coverage/prettify.js +2 -0
  17. package/coverage/sort-arrow-sprite.png +0 -0
  18. package/coverage/sorter.js +196 -0
  19. package/coverage/types/Types.ts.html +121 -0
  20. package/coverage/types/index.html +116 -0
  21. package/dist/latest/cjs/ns.cjs +1 -0
  22. package/dist/latest/cjs/style.css +1 -0
  23. package/dist/latest/es/ns.js +306 -0
  24. package/dist/latest/es/style.css +1 -0
  25. package/dist/latest/iife/ns.iife.js +4 -0
  26. package/dist/versioned/3.0.1/cjs/ns.cjs +1 -0
  27. package/dist/versioned/3.0.1/cjs/style.css +1 -0
  28. package/dist/versioned/3.0.1/es/ns.js +306 -0
  29. package/dist/versioned/3.0.1/es/style.css +1 -0
  30. package/dist/versioned/3.0.1/iife/ns.iife.js +2 -0
  31. package/docs/index.6d66a821.js +1 -0
  32. package/docs/index.74dbd99e.css +1 -0
  33. package/docs/index.f34144dc.js +1 -0
  34. package/docs/index.html +90 -114
  35. package/index.html +87 -115
  36. package/package.json +50 -36
  37. package/src/sass/ns.sass +95 -0
  38. package/src/ts/core/Dom.ts +160 -0
  39. package/src/ts/core/Service.ts +235 -0
  40. package/src/ts/core/ServiceInterface.ts +60 -0
  41. package/src/ts/core/Splash.ts +124 -0
  42. package/src/ts/core/SplashInterface.ts +54 -0
  43. package/src/ts/main.ts +9 -0
  44. package/src/ts/types/Types.ts +12 -0
  45. package/src/ts/types/global.d.ts +14 -0
  46. package/tests/Dom.spec.ts +127 -0
  47. package/tests/Guid.spec.ts +21 -0
  48. package/tests/Service.spec.ts +119 -0
  49. package/tests/Splash.spec.ts +64 -0
  50. package/tsconfig.json +20 -16
  51. package/vite.config.ts +27 -13
  52. package/vite.demo.config.ts +16 -0
  53. package/.github/workflows/production.yml +0 -60
  54. package/.github/workflows/release.yml +0 -61
  55. package/_config.yml +0 -1
  56. package/dist/iife/manifest.json +0 -7
  57. package/dist/iife/nanosplash.iife.js +0 -1
  58. package/dist/module/manifest.json +0 -7
  59. package/dist/module/nanosplash.cjs.js +0 -1
  60. package/dist/module/nanosplash.es.js +0 -371
  61. package/dist/module/style.css +0 -1
  62. package/docs/nanosplash.iife.js +0 -6
  63. package/docs/style.css +0 -1
  64. package/docs/typedoc/.nojekyll +0 -1
  65. package/docs/typedoc/assets/highlight.css +0 -22
  66. package/docs/typedoc/assets/icons.css +0 -1043
  67. package/docs/typedoc/assets/icons.png +0 -0
  68. package/docs/typedoc/assets/icons@2x.png +0 -0
  69. package/docs/typedoc/assets/main.js +0 -52
  70. package/docs/typedoc/assets/search.js +0 -1
  71. package/docs/typedoc/assets/style.css +0 -1414
  72. package/docs/typedoc/assets/widgets.png +0 -0
  73. package/docs/typedoc/assets/widgets@2x.png +0 -0
  74. package/docs/typedoc/classes/Core_Nanosplash.default.html +0 -133
  75. package/docs/typedoc/index.html +0 -1
  76. package/docs/typedoc/modules/Core_Nanosplash.html +0 -1
  77. package/docs/typedoc/modules/types.html +0 -1
  78. package/favicon.svg +0 -15
  79. package/postcss.config.js +0 -8
  80. package/src/Core/Nanosplash.ts +0 -257
  81. package/src/Core/SplashInstance.ts +0 -298
  82. package/src/Exceptions/DestinationException.ts +0 -13
  83. package/src/Exceptions/Exception.ts +0 -9
  84. package/src/Exceptions/IllegalArgumentException.ts +0 -11
  85. package/src/Factory/NanosplashFactory.ts +0 -93
  86. package/src/Interfaces/ContextualAPIInterface.ts +0 -8
  87. package/src/Interfaces/IdentityInterface.ts +0 -3
  88. package/src/Interfaces/InsideInterface.ts +0 -5
  89. package/src/Interfaces/NanosplashInterface.ts +0 -8
  90. package/src/Interfaces/ProgressInterface.ts +0 -5
  91. package/src/Interfaces/ShowInterface.ts +0 -5
  92. package/src/Interfaces/WhileInterface.ts +0 -5
  93. package/src/Repositories/NanosplashRepository.ts +0 -82
  94. package/src/Tests/dom.spec.ts +0 -72
  95. package/src/Utilities/dom.ts +0 -49
  96. package/src/main.ts +0 -5
  97. package/src/style.sass +0 -88
  98. package/src/types.d.ts +0 -59
  99. package/update-all.sh +0 -3
  100. package/vite.iife.config.js +0 -72
  101. package/vite.mod.config.js +0 -71
  102. package/vite.site.config.js +0 -22
@@ -0,0 +1,306 @@
1
+ var m = Object.defineProperty;
2
+ var S = (e, t, n) => t in e ? m(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var r = (e, t, n) => (S(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ const v = "3.0.1";
5
+ var o = /* @__PURE__ */ ((e) => (e.Add = "add", e.Remove = "remove", e))(o || {});
6
+ const d = class d {
7
+ /**
8
+ * # Constructor
9
+ * Creates a new Nanosplash instance.
10
+ */
11
+ constructor() {
12
+ /**
13
+ * # ID
14
+ * Each Nanosplash instance is given a unique GUID.
15
+ */
16
+ r(this, "id");
17
+ /**
18
+ * # Element
19
+ * The root element of the Nanosplash component.
20
+ */
21
+ r(this, "element");
22
+ this.element = N(), this.element.id = this.id = d.generateGUID();
23
+ }
24
+ /**
25
+ * # Generate GUID
26
+ * @returns {GUIDString} A GUID string.
27
+ * @private
28
+ */
29
+ static generateGUID() {
30
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
31
+ const n = Math.random() * 16 | 0;
32
+ return (t === "x" ? n : n & 3 | 8).toString(16);
33
+ });
34
+ }
35
+ /**
36
+ * @inheritdoc
37
+ */
38
+ getNSContentElement() {
39
+ return this.getNSElement().firstElementChild;
40
+ }
41
+ /**
42
+ * @inheritdoc
43
+ */
44
+ getNSTextElement() {
45
+ return this.getNSContentElement().firstElementChild;
46
+ }
47
+ /**
48
+ * @inheritdoc
49
+ */
50
+ getId() {
51
+ return this.id;
52
+ }
53
+ /**
54
+ * @inheritdoc
55
+ */
56
+ getNSElement() {
57
+ return this.element;
58
+ }
59
+ /**
60
+ * @inheritdoc
61
+ */
62
+ setText(t) {
63
+ return this.getNSTextElement().innerText = t, t.length > 0 ? this.showText() : this.hideText(), this;
64
+ }
65
+ /**
66
+ * @inheritdoc
67
+ */
68
+ showText() {
69
+ return I(this.getNSTextElement()), this;
70
+ }
71
+ /**
72
+ * @inheritdoc
73
+ */
74
+ hideText() {
75
+ return y(this.getNSTextElement()), this;
76
+ }
77
+ /**
78
+ * @inheritdoc
79
+ */
80
+ remove() {
81
+ var t;
82
+ return this.element && ((t = this.element.parentElement) == null || t.removeChild(this.element), delete this.element), this;
83
+ }
84
+ };
85
+ /**
86
+ * # CSS Class Name
87
+ * The main CSS class name of the root element of a Nanosplash component.
88
+ */
89
+ r(d, "NSClass", "ns"), /**
90
+ * # Host CSS Class Name
91
+ * The CSS class name of the host element of a Nanosplash component.
92
+ * The host element is the element that the Nanosplash is attached to.
93
+ */
94
+ r(d, "NSHostClass", "nsh");
95
+ let l = d;
96
+ function N() {
97
+ return new DOMParser().parseFromString(
98
+ '<div class=ns><div class=nsc><div class=nst></div><div class=nss><svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none></circle></svg></div></div></div>',
99
+ "text/html"
100
+ ).body.firstChild;
101
+ }
102
+ function w(e, t) {
103
+ t.children.length > 0 ? t.insertBefore(e, t.children.item(0)) : t.append(e);
104
+ }
105
+ function h(e, t) {
106
+ e == null || e.classList[t](l.NSHostClass);
107
+ }
108
+ function E(e) {
109
+ h(e.getNSElement().parentElement, o.Remove);
110
+ }
111
+ function I(e) {
112
+ e.style.display = "flex";
113
+ }
114
+ function y(e) {
115
+ e.style.display = "none";
116
+ }
117
+ function u(e) {
118
+ return e instanceof Element ? e : document.querySelector(e || "");
119
+ }
120
+ function C(e) {
121
+ var t;
122
+ return ((t = e == null ? void 0 : e.classList) == null ? void 0 : t.contains(l.NSClass)) ?? !1;
123
+ }
124
+ function x(e, t) {
125
+ h(e.parentElement, o.Remove), h(t, o.Add), w(e, t);
126
+ }
127
+ function f(e) {
128
+ const t = e.firstElementChild;
129
+ if (t !== null && C(t)) {
130
+ const c = t.id;
131
+ return a.getInstance().nsStack.find((g) => g.getId() === c) ?? null;
132
+ }
133
+ return null;
134
+ }
135
+ const s = class s {
136
+ /**
137
+ * # Constructor
138
+ * Private constructor to prevent multiple instances.
139
+ * @private
140
+ */
141
+ constructor() {
142
+ /**
143
+ * # Version
144
+ */
145
+ r(this, "version");
146
+ /**
147
+ * @inheritdoc
148
+ */
149
+ r(this, "nsStack");
150
+ this.version = v, this.nsStack = [];
151
+ }
152
+ /**
153
+ * # Find Index
154
+ * Find Nanosplash stack index by callback.
155
+ * @param callback Callback function that returns a boolean.
156
+ * @returns {number} Index of Nanosplash instance in the stack or -1.
157
+ * @private
158
+ */
159
+ findIndex(t) {
160
+ return this.nsStack.findIndex(t);
161
+ }
162
+ /**
163
+ * # Find
164
+ * Find Nanosplash in the stack by callback.
165
+ * @param callback Callback function that returns a boolean.
166
+ * @returns {Splash | undefined} Nanosplash instance or undefined
167
+ * @private
168
+ */
169
+ find(t) {
170
+ return this.nsStack.find(t);
171
+ }
172
+ /**
173
+ * # Get Instance
174
+ * Singleton instance accessor
175
+ * @returns {Service} NanosplashService instance
176
+ */
177
+ static getInstance() {
178
+ return s.instance || (s.instance = new s()), s.instance;
179
+ }
180
+ /**
181
+ * # Assign To Window
182
+ * Assign a NanosplashService instance to the Window object.
183
+ * The NanosplashService instance can be accessed in the window object
184
+ * using the key window accessor key.
185
+ * @see WindowAccessorKey
186
+ * @private
187
+ */
188
+ static assignToWindow() {
189
+ Object.defineProperty(window, s.WindowAccessorKey, {
190
+ value: s.getInstance(),
191
+ writable: !1
192
+ });
193
+ }
194
+ /**
195
+ * # Start
196
+ * Initialize and attach a Nanosplash Service instance to the Window object.
197
+ */
198
+ static start() {
199
+ s.assignToWindow(), window.addEventListener("load", () => {
200
+ window[s.WindowAccessorKey] instanceof s || s.assignToWindow();
201
+ });
202
+ }
203
+ /**
204
+ * # Create Nanosplash
205
+ * Return new Nanosplash instance and push it to the stack.
206
+ * @param text Text to display.
207
+ * @returns {Splash} Nanosplash instance.
208
+ * @private
209
+ */
210
+ createNS(t) {
211
+ const n = new l();
212
+ return n.setText(t || ""), this.nsStack.push(n), n;
213
+ }
214
+ /**
215
+ * # Clean And Remove
216
+ * Remove Nanosplash from DOM and clean its parent.
217
+ * @param ns Nanosplash instance.
218
+ * @returns {GUIDString} Nanosplash ID.
219
+ * @private
220
+ */
221
+ cleanAndRemove(t) {
222
+ return E(t), t.remove().getId();
223
+ }
224
+ /**
225
+ * # Stack Delete
226
+ * Remove Nanosplash instance from the stack.
227
+ * @param ns Nanosplash instance.
228
+ * @returns {GUIDString | null} Nanosplash ID or null if it doesn't exist.
229
+ * @private
230
+ */
231
+ stackDelete(t) {
232
+ let n = this.findIndex((i) => i.getId() === t.getId());
233
+ return n < 0 ? null : (this.nsStack.splice(n, 1), t.getId());
234
+ }
235
+ /**
236
+ * # Delete NS
237
+ * Remove Nanosplash instance from both the stack and the
238
+ * @param callback Callback function.
239
+ * @returns {GUIDString | null} Nanosplash ID or null if it doesn't exist.
240
+ * @private
241
+ */
242
+ deleteNS(t) {
243
+ const n = this.find(t);
244
+ return n ? (this.cleanAndRemove(n), this.stackDelete(n)) : null;
245
+ }
246
+ /**
247
+ * @inheritdoc
248
+ */
249
+ show(t) {
250
+ let n = f(document.body);
251
+ return n || (n = this.createNS(), x(n.getNSElement(), document.body)), n.setText(t || "").getId();
252
+ }
253
+ /**
254
+ * @inheritdoc
255
+ */
256
+ showInside(t, n) {
257
+ const i = u(t);
258
+ if (i) {
259
+ let c = f(i);
260
+ return c || (c = this.createNS()), x(c.getNSElement(), i), c.setText(n || "").getId();
261
+ }
262
+ return null;
263
+ }
264
+ /**
265
+ * @inheritdoc
266
+ */
267
+ hide() {
268
+ const t = this.nsStack.pop();
269
+ return t ? this.cleanAndRemove(t) : null;
270
+ }
271
+ /**
272
+ * @inheritdoc
273
+ */
274
+ hideAll() {
275
+ this.nsStack.forEach(this.cleanAndRemove), this.nsStack.splice(0, this.nsStack.length);
276
+ }
277
+ /**
278
+ * @inheritdoc
279
+ */
280
+ hideId(t) {
281
+ return this.deleteNS((n) => n.getId() === t);
282
+ }
283
+ /**
284
+ * @inheritdoc
285
+ */
286
+ hideInside(t) {
287
+ const n = u(t), i = (c) => c.getNSElement().parentElement === n;
288
+ return n ? this.deleteNS(i) : null;
289
+ }
290
+ };
291
+ /**
292
+ * # Window Accessor Key
293
+ * Key to access NanosplashService instance in the Window object.
294
+ */
295
+ r(s, "WindowAccessorKey", "ns"), /**
296
+ * # Instance
297
+ * Singleton instance of NanosplashService.
298
+ * @private
299
+ */
300
+ r(s, "instance");
301
+ let a = s;
302
+ const A = { Service: a };
303
+ export {
304
+ a as Service,
305
+ A as default
306
+ };
@@ -0,0 +1 @@
1
+ .ns,.nsh:before{width:100%;height:100%}.ns,.nsh:before{top:0;left:0}.nsc,.ns{display:flex;justify-content:center;align-items:center}.nsh{--color: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Helvetica", "Arial", sans-serif;--weight: 400;--bg: rgba(255, 255, 255, .8);--zIdx: 999999999;--blur: blur(10px)}.nsh{position:relative;z-index:var(--zIdx)}.nsh:before{position:absolute;background-color:var(--bg);content:"";backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh{height:100vh}.ns{position:absolute;z-index:calc(var(--zIdx) + 2)}.nsc{filter:drop-shadow(0 0 .1rem rgba(211,211,211,.5))}.nst{color:var(--color);font-size:var(--size);font-family:var(--font);font-weight:var(--weight);margin-right:var(--relSize);text-shadow:0 0 .06rem rgba(47,79,79,.25)}.nss{display:block;width:var(--relSize);height:var(--relSize)}.nss>svg{animation:Rotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:Dash 1.5s ease-in-out infinite}@keyframes Rotate{to{transform:rotate(360deg)}}@keyframes Dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}
@@ -0,0 +1,4 @@
1
+ var I = Object.defineProperty; var E = (o, i, d) => i in o ? I(o, i, { enumerable: !0, configurable: !0, writable: !0, value: d }) : o[i] = d; var a = (o, i, d) => (E(o, typeof i != "symbol" ? i + "" : i, d), d); (function () {
2
+ "use strict"; var o = document.createElement("style"); o.textContent = `.ns,.nsh:before{width:100%;height:100%}.ns,.nsh:before{top:0;left:0}.nsc,.ns{display:flex;justify-content:center;align-items:center}.nsh{--color: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Helvetica", "Arial", sans-serif;--weight: 400;--bg: rgba(255, 255, 255, .8);--zIdx: 999999999;--blur: blur(10px)}.nsh{position:relative;z-index:var(--zIdx)}.nsh:before{position:absolute;background-color:var(--bg);content:"";backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh{height:100vh}.ns{position:absolute;z-index:calc(var(--zIdx) + 2)}.nsc{filter:drop-shadow(0 0 .1rem rgba(211,211,211,.5))}.nst{color:var(--color);font-size:var(--size);font-family:var(--font);font-weight:var(--weight);margin-right:var(--relSize);text-shadow:0 0 .06rem rgba(47,79,79,.25)}.nss{display:block;width:var(--relSize);height:var(--relSize)}.nss>svg{animation:Rotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:Dash 1.5s ease-in-out infinite}@keyframes Rotate{to{transform:rotate(360deg)}}@keyframes Dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}
3
+ `, document.head.appendChild(o); const i = "3.0.1", d = ""; var u = (t => (t.Add = "add", t.Remove = "remove", t))(u || {}); const h = class h { constructor() { a(this, "id"); a(this, "element"); this.element = S(), this.element.id = this.id = h.generateGUID() } static generateGUID() { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, e => { const n = Math.random() * 16 | 0; return (e === "x" ? n : n & 3 | 8).toString(16) }) } getNSContentElement() { return this.getNSElement().firstElementChild } getNSTextElement() { return this.getNSContentElement().firstElementChild } getId() { return this.id } getNSElement() { return this.element } setText(e) { return this.getNSTextElement().innerText = e, e.length > 0 ? this.showText() : this.hideText(), this } showText() { return k(this.getNSTextElement()), this } hideText() { return p(this.getNSTextElement()), this } remove() { var e; return this.element && ((e = this.element.parentElement) == null || e.removeChild(this.element), delete this.element), this } }; a(h, "NSClass", "ns"), a(h, "NSHostClass", "nsh"); let c = h; function S() { return new DOMParser().parseFromString('<div class=ns><div class=nsc><div class=nst></div><div class=nss><svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none></circle></svg></div></div></div>', "text/html").body.firstChild } function w(t, e) { e.children.length > 0 ? e.insertBefore(t, e.children.item(0)) : e.append(t) } function x(t, e) { t == null || t.classList[e](c.NSHostClass) } function y(t) { x(t.getNSElement().parentElement, u.Remove) } function k(t) { t.style.display = "flex" } function p(t) { t.style.display = "none" } function g(t) { return t instanceof Element ? t : document.querySelector(t || "") } function N(t) { var e; return ((e = t == null ? void 0 : t.classList) == null ? void 0 : e.contains(c.NSClass)) ?? !1 } function m(t, e) { x(t.parentElement, u.Remove), x(e, u.Add), w(t, e) } function v(t) { const e = t.firstElementChild; if (e !== null && N(e)) { const l = e.id; return f.getInstance().nsStack.find(b => b.getId() === l) ?? null } return null } const s = class s { constructor() { a(this, "version"); a(this, "nsStack"); this.version = i, this.nsStack = [] } findIndex(e) { return this.nsStack.findIndex(e) } find(e) { return this.nsStack.find(e) } static getInstance() { return s.instance || (s.instance = new s), s.instance } static assignToWindow() { Object.defineProperty(window, s.WindowAccessorKey, { value: s.getInstance(), writable: !1 }) } static start() { s.assignToWindow(), window.addEventListener("load", () => { window[s.WindowAccessorKey] instanceof s || s.assignToWindow() }) } createNS(e) { const n = new c; return n.setText(e || ""), this.nsStack.push(n), n } cleanAndRemove(e) { return y(e), e.remove().getId() } stackDelete(e) { let n = this.findIndex(r => r.getId() === e.getId()); return n < 0 ? null : (this.nsStack.splice(n, 1), e.getId()) } deleteNS(e) { const n = this.find(e); return n ? (this.cleanAndRemove(n), this.stackDelete(n)) : null } show(e) { let n = v(document.body); return n || (n = this.createNS(), m(n.getNSElement(), document.body)), n.setText(e || "").getId() } showInside(e, n) { const r = g(e); if (r) { let l = v(r); return l || (l = this.createNS()), m(l.getNSElement(), r), l.setText(n || "").getId() } return null } hide() { const e = this.nsStack.pop(); return e ? this.cleanAndRemove(e) : null } hideAll() { this.nsStack.forEach(this.cleanAndRemove), this.nsStack.splice(0, this.nsStack.length) } hideId(e) { return this.deleteNS(n => n.getId() === e) } hideInside(e) { const n = g(e), r = l => l.getNSElement().parentElement === n; return n ? this.deleteNS(r) : null } }; a(s, "WindowAccessorKey", "ns"), a(s, "instance"); let f = s; try { f.start() } catch (t) { console.warn(t) }
4
+ })();
@@ -0,0 +1 @@
1
+ "use strict";var m=Object.defineProperty;var S=(t,e,n)=>e in t?m(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var r=(t,e,n)=>(S(t,typeof e!="symbol"?e+"":e,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v="3.0.1";var a=(t=>(t.Add="add",t.Remove="remove",t))(a||{});const d=class d{constructor(){r(this,"id");r(this,"element");this.element=N(),this.element.id=this.id=d.generateGUID()}static generateGUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)})}getNSContentElement(){return this.getNSElement().firstElementChild}getNSTextElement(){return this.getNSContentElement().firstElementChild}getId(){return this.id}getNSElement(){return this.element}setText(e){return this.getNSTextElement().innerText=e,e.length>0?this.showText():this.hideText(),this}showText(){return I(this.getNSTextElement()),this}hideText(){return y(this.getNSTextElement()),this}remove(){var e;return this.element&&((e=this.element.parentElement)==null||e.removeChild(this.element),delete this.element),this}};r(d,"NSClass","ns"),r(d,"NSHostClass","nsh");let l=d;function N(){return new DOMParser().parseFromString('<div class=ns><div class=nsc><div class=nst></div><div class=nss><svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none></circle></svg></div></div></div>',"text/html").body.firstChild}function w(t,e){e.children.length>0?e.insertBefore(t,e.children.item(0)):e.append(t)}function h(t,e){t==null||t.classList[e](l.NSHostClass)}function E(t){h(t.getNSElement().parentElement,a.Remove)}function I(t){t.style.display="flex"}function y(t){t.style.display="none"}function u(t){return t instanceof Element?t:document.querySelector(t||"")}function C(t){var e;return((e=t==null?void 0:t.classList)==null?void 0:e.contains(l.NSClass))??!1}function x(t,e){h(t.parentElement,a.Remove),h(e,a.Add),w(t,e)}function f(t){const e=t.firstElementChild;if(e!==null&&C(e)){const c=e.id;return o.getInstance().nsStack.find(g=>g.getId()===c)??null}return null}const s=class s{constructor(){r(this,"version");r(this,"nsStack");this.version=v,this.nsStack=[]}findIndex(e){return this.nsStack.findIndex(e)}find(e){return this.nsStack.find(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}static assignToWindow(){Object.defineProperty(window,s.WindowAccessorKey,{value:s.getInstance(),writable:!1})}static start(){s.assignToWindow(),window.addEventListener("load",()=>{window[s.WindowAccessorKey]instanceof s||s.assignToWindow()})}createNS(e){const n=new l;return n.setText(e||""),this.nsStack.push(n),n}cleanAndRemove(e){return E(e),e.remove().getId()}stackDelete(e){let n=this.findIndex(i=>i.getId()===e.getId());return n<0?null:(this.nsStack.splice(n,1),e.getId())}deleteNS(e){const n=this.find(e);return n?(this.cleanAndRemove(n),this.stackDelete(n)):null}show(e){let n=f(document.body);return n||(n=this.createNS(),x(n.getNSElement(),document.body)),n.setText(e||"").getId()}showInside(e,n){const i=u(e);if(i){let c=f(i);return c||(c=this.createNS()),x(c.getNSElement(),i),c.setText(n||"").getId()}return null}hide(){const e=this.nsStack.pop();return e?this.cleanAndRemove(e):null}hideAll(){this.nsStack.forEach(this.cleanAndRemove),this.nsStack.splice(0,this.nsStack.length)}hideId(e){return this.deleteNS(n=>n.getId()===e)}hideInside(e){const n=u(e),i=c=>c.getNSElement().parentElement===n;return n?this.deleteNS(i):null}};r(s,"WindowAccessorKey","ns"),r(s,"instance");let o=s;const T={Service:o};exports.Service=o;exports.default=T;
@@ -0,0 +1 @@
1
+ .ns,.nsh:before{width:100%;height:100%}.ns,.nsh:before{top:0;left:0}.nsc,.ns{display:flex;justify-content:center;align-items:center}.nsh{--color: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Helvetica", "Arial", sans-serif;--weight: 400;--bg: rgba(255, 255, 255, .8);--zIdx: 999999999;--blur: blur(10px)}.nsh{position:relative;z-index:var(--zIdx)}.nsh:before{position:absolute;background-color:var(--bg);content:"";backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh{height:100vh}.ns{position:absolute;z-index:calc(var(--zIdx) + 2)}.nsc{filter:drop-shadow(0 0 .1rem rgba(211,211,211,.5))}.nst{color:var(--color);font-size:var(--size);font-family:var(--font);font-weight:var(--weight);margin-right:var(--relSize);text-shadow:0 0 .06rem rgba(47,79,79,.25)}.nss{display:block;width:var(--relSize);height:var(--relSize)}.nss>svg{animation:Rotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:Dash 1.5s ease-in-out infinite}@keyframes Rotate{to{transform:rotate(360deg)}}@keyframes Dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}
@@ -0,0 +1,306 @@
1
+ var m = Object.defineProperty;
2
+ var S = (e, t, n) => t in e ? m(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var r = (e, t, n) => (S(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ const v = "3.0.1";
5
+ var o = /* @__PURE__ */ ((e) => (e.Add = "add", e.Remove = "remove", e))(o || {});
6
+ const d = class d {
7
+ /**
8
+ * # Constructor
9
+ * Creates a new Nanosplash instance.
10
+ */
11
+ constructor() {
12
+ /**
13
+ * # ID
14
+ * Each Nanosplash instance is given a unique GUID.
15
+ */
16
+ r(this, "id");
17
+ /**
18
+ * # Element
19
+ * The root element of the Nanosplash component.
20
+ */
21
+ r(this, "element");
22
+ this.element = N(), this.element.id = this.id = d.generateGUID();
23
+ }
24
+ /**
25
+ * # Generate GUID
26
+ * @returns {GUIDString} A GUID string.
27
+ * @private
28
+ */
29
+ static generateGUID() {
30
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
31
+ const n = Math.random() * 16 | 0;
32
+ return (t === "x" ? n : n & 3 | 8).toString(16);
33
+ });
34
+ }
35
+ /**
36
+ * @inheritdoc
37
+ */
38
+ getNSContentElement() {
39
+ return this.getNSElement().firstElementChild;
40
+ }
41
+ /**
42
+ * @inheritdoc
43
+ */
44
+ getNSTextElement() {
45
+ return this.getNSContentElement().firstElementChild;
46
+ }
47
+ /**
48
+ * @inheritdoc
49
+ */
50
+ getId() {
51
+ return this.id;
52
+ }
53
+ /**
54
+ * @inheritdoc
55
+ */
56
+ getNSElement() {
57
+ return this.element;
58
+ }
59
+ /**
60
+ * @inheritdoc
61
+ */
62
+ setText(t) {
63
+ return this.getNSTextElement().innerText = t, t.length > 0 ? this.showText() : this.hideText(), this;
64
+ }
65
+ /**
66
+ * @inheritdoc
67
+ */
68
+ showText() {
69
+ return I(this.getNSTextElement()), this;
70
+ }
71
+ /**
72
+ * @inheritdoc
73
+ */
74
+ hideText() {
75
+ return y(this.getNSTextElement()), this;
76
+ }
77
+ /**
78
+ * @inheritdoc
79
+ */
80
+ remove() {
81
+ var t;
82
+ return this.element && ((t = this.element.parentElement) == null || t.removeChild(this.element), delete this.element), this;
83
+ }
84
+ };
85
+ /**
86
+ * # CSS Class Name
87
+ * The main CSS class name of the root element of a Nanosplash component.
88
+ */
89
+ r(d, "NSClass", "ns"), /**
90
+ * # Host CSS Class Name
91
+ * The CSS class name of the host element of a Nanosplash component.
92
+ * The host element is the element that the Nanosplash is attached to.
93
+ */
94
+ r(d, "NSHostClass", "nsh");
95
+ let l = d;
96
+ function N() {
97
+ return new DOMParser().parseFromString(
98
+ '<div class=ns><div class=nsc><div class=nst></div><div class=nss><svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none></circle></svg></div></div></div>',
99
+ "text/html"
100
+ ).body.firstChild;
101
+ }
102
+ function w(e, t) {
103
+ t.children.length > 0 ? t.insertBefore(e, t.children.item(0)) : t.append(e);
104
+ }
105
+ function h(e, t) {
106
+ e == null || e.classList[t](l.NSHostClass);
107
+ }
108
+ function E(e) {
109
+ h(e.getNSElement().parentElement, o.Remove);
110
+ }
111
+ function I(e) {
112
+ e.style.display = "flex";
113
+ }
114
+ function y(e) {
115
+ e.style.display = "none";
116
+ }
117
+ function u(e) {
118
+ return e instanceof Element ? e : document.querySelector(e || "");
119
+ }
120
+ function C(e) {
121
+ var t;
122
+ return ((t = e == null ? void 0 : e.classList) == null ? void 0 : t.contains(l.NSClass)) ?? !1;
123
+ }
124
+ function x(e, t) {
125
+ h(e.parentElement, o.Remove), h(t, o.Add), w(e, t);
126
+ }
127
+ function f(e) {
128
+ const t = e.firstElementChild;
129
+ if (t !== null && C(t)) {
130
+ const c = t.id;
131
+ return a.getInstance().nsStack.find((g) => g.getId() === c) ?? null;
132
+ }
133
+ return null;
134
+ }
135
+ const s = class s {
136
+ /**
137
+ * # Constructor
138
+ * Private constructor to prevent multiple instances.
139
+ * @private
140
+ */
141
+ constructor() {
142
+ /**
143
+ * # Version
144
+ */
145
+ r(this, "version");
146
+ /**
147
+ * @inheritdoc
148
+ */
149
+ r(this, "nsStack");
150
+ this.version = v, this.nsStack = [];
151
+ }
152
+ /**
153
+ * # Find Index
154
+ * Find Nanosplash stack index by callback.
155
+ * @param callback Callback function that returns a boolean.
156
+ * @returns {number} Index of Nanosplash instance in the stack or -1.
157
+ * @private
158
+ */
159
+ findIndex(t) {
160
+ return this.nsStack.findIndex(t);
161
+ }
162
+ /**
163
+ * # Find
164
+ * Find Nanosplash in the stack by callback.
165
+ * @param callback Callback function that returns a boolean.
166
+ * @returns {Splash | undefined} Nanosplash instance or undefined
167
+ * @private
168
+ */
169
+ find(t) {
170
+ return this.nsStack.find(t);
171
+ }
172
+ /**
173
+ * # Get Instance
174
+ * Singleton instance accessor
175
+ * @returns {Service} NanosplashService instance
176
+ */
177
+ static getInstance() {
178
+ return s.instance || (s.instance = new s()), s.instance;
179
+ }
180
+ /**
181
+ * # Assign To Window
182
+ * Assign a NanosplashService instance to the Window object.
183
+ * The NanosplashService instance can be accessed in the window object
184
+ * using the key window accessor key.
185
+ * @see WindowAccessorKey
186
+ * @private
187
+ */
188
+ static assignToWindow() {
189
+ Object.defineProperty(window, s.WindowAccessorKey, {
190
+ value: s.getInstance(),
191
+ writable: !1
192
+ });
193
+ }
194
+ /**
195
+ * # Start
196
+ * Initialize and attach a Nanosplash Service instance to the Window object.
197
+ */
198
+ static start() {
199
+ s.assignToWindow(), window.addEventListener("load", () => {
200
+ window[s.WindowAccessorKey] instanceof s || s.assignToWindow();
201
+ });
202
+ }
203
+ /**
204
+ * # Create Nanosplash
205
+ * Return new Nanosplash instance and push it to the stack.
206
+ * @param text Text to display.
207
+ * @returns {Splash} Nanosplash instance.
208
+ * @private
209
+ */
210
+ createNS(t) {
211
+ const n = new l();
212
+ return n.setText(t || ""), this.nsStack.push(n), n;
213
+ }
214
+ /**
215
+ * # Clean And Remove
216
+ * Remove Nanosplash from DOM and clean its parent.
217
+ * @param ns Nanosplash instance.
218
+ * @returns {GUIDString} Nanosplash ID.
219
+ * @private
220
+ */
221
+ cleanAndRemove(t) {
222
+ return E(t), t.remove().getId();
223
+ }
224
+ /**
225
+ * # Stack Delete
226
+ * Remove Nanosplash instance from the stack.
227
+ * @param ns Nanosplash instance.
228
+ * @returns {GUIDString | null} Nanosplash ID or null if it doesn't exist.
229
+ * @private
230
+ */
231
+ stackDelete(t) {
232
+ let n = this.findIndex((i) => i.getId() === t.getId());
233
+ return n < 0 ? null : (this.nsStack.splice(n, 1), t.getId());
234
+ }
235
+ /**
236
+ * # Delete NS
237
+ * Remove Nanosplash instance from both the stack and the
238
+ * @param callback Callback function.
239
+ * @returns {GUIDString | null} Nanosplash ID or null if it doesn't exist.
240
+ * @private
241
+ */
242
+ deleteNS(t) {
243
+ const n = this.find(t);
244
+ return n ? (this.cleanAndRemove(n), this.stackDelete(n)) : null;
245
+ }
246
+ /**
247
+ * @inheritdoc
248
+ */
249
+ show(t) {
250
+ let n = f(document.body);
251
+ return n || (n = this.createNS(), x(n.getNSElement(), document.body)), n.setText(t || "").getId();
252
+ }
253
+ /**
254
+ * @inheritdoc
255
+ */
256
+ showInside(t, n) {
257
+ const i = u(t);
258
+ if (i) {
259
+ let c = f(i);
260
+ return c || (c = this.createNS()), x(c.getNSElement(), i), c.setText(n || "").getId();
261
+ }
262
+ return null;
263
+ }
264
+ /**
265
+ * @inheritdoc
266
+ */
267
+ hide() {
268
+ const t = this.nsStack.pop();
269
+ return t ? this.cleanAndRemove(t) : null;
270
+ }
271
+ /**
272
+ * @inheritdoc
273
+ */
274
+ hideAll() {
275
+ this.nsStack.forEach(this.cleanAndRemove), this.nsStack.splice(0, this.nsStack.length);
276
+ }
277
+ /**
278
+ * @inheritdoc
279
+ */
280
+ hideId(t) {
281
+ return this.deleteNS((n) => n.getId() === t);
282
+ }
283
+ /**
284
+ * @inheritdoc
285
+ */
286
+ hideInside(t) {
287
+ const n = u(t), i = (c) => c.getNSElement().parentElement === n;
288
+ return n ? this.deleteNS(i) : null;
289
+ }
290
+ };
291
+ /**
292
+ * # Window Accessor Key
293
+ * Key to access NanosplashService instance in the Window object.
294
+ */
295
+ r(s, "WindowAccessorKey", "ns"), /**
296
+ * # Instance
297
+ * Singleton instance of NanosplashService.
298
+ * @private
299
+ */
300
+ r(s, "instance");
301
+ let a = s;
302
+ const A = { Service: a };
303
+ export {
304
+ a as Service,
305
+ A as default
306
+ };
@@ -0,0 +1 @@
1
+ .ns,.nsh:before{width:100%;height:100%}.ns,.nsh:before{top:0;left:0}.nsc,.ns{display:flex;justify-content:center;align-items:center}.nsh{--color: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Helvetica", "Arial", sans-serif;--weight: 400;--bg: rgba(255, 255, 255, .8);--zIdx: 999999999;--blur: blur(10px)}.nsh{position:relative;z-index:var(--zIdx)}.nsh:before{position:absolute;background-color:var(--bg);content:"";backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh{height:100vh}.ns{position:absolute;z-index:calc(var(--zIdx) + 2)}.nsc{filter:drop-shadow(0 0 .1rem rgba(211,211,211,.5))}.nst{color:var(--color);font-size:var(--size);font-family:var(--font);font-weight:var(--weight);margin-right:var(--relSize);text-shadow:0 0 .06rem rgba(47,79,79,.25)}.nss{display:block;width:var(--relSize);height:var(--relSize)}.nss>svg{animation:Rotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:Dash 1.5s ease-in-out infinite}@keyframes Rotate{to{transform:rotate(360deg)}}@keyframes Dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}
@@ -0,0 +1,2 @@
1
+ var I=Object.defineProperty;var E=(o,i,d)=>i in o?I(o,i,{enumerable:!0,configurable:!0,writable:!0,value:d}):o[i]=d;var a=(o,i,d)=>(E(o,typeof i!="symbol"?i+"":i,d),d);(function(){"use strict";var o=document.createElement("style");o.textContent=`.ns,.nsh:before{width:100%;height:100%}.ns,.nsh:before{top:0;left:0}.nsc,.ns{display:flex;justify-content:center;align-items:center}.nsh{--color: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Helvetica", "Arial", sans-serif;--weight: 400;--bg: rgba(255, 255, 255, .8);--zIdx: 999999999;--blur: blur(10px)}.nsh{position:relative;z-index:var(--zIdx)}.nsh:before{position:absolute;background-color:var(--bg);content:"";backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh{height:100vh}.ns{position:absolute;z-index:calc(var(--zIdx) + 2)}.nsc{filter:drop-shadow(0 0 .1rem rgba(211,211,211,.5))}.nst{color:var(--color);font-size:var(--size);font-family:var(--font);font-weight:var(--weight);margin-right:var(--relSize);text-shadow:0 0 .06rem rgba(47,79,79,.25)}.nss{display:block;width:var(--relSize);height:var(--relSize)}.nss>svg{animation:Rotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:Dash 1.5s ease-in-out infinite}@keyframes Rotate{to{transform:rotate(360deg)}}@keyframes Dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}
2
+ `,document.head.appendChild(o);const i="3.0.1",d="";var u=(t=>(t.Add="add",t.Remove="remove",t))(u||{});const h=class h{constructor(){a(this,"id");a(this,"element");this.element=S(),this.element.id=this.id=h.generateGUID()}static generateGUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)})}getNSContentElement(){return this.getNSElement().firstElementChild}getNSTextElement(){return this.getNSContentElement().firstElementChild}getId(){return this.id}getNSElement(){return this.element}setText(e){return this.getNSTextElement().innerText=e,e.length>0?this.showText():this.hideText(),this}showText(){return k(this.getNSTextElement()),this}hideText(){return p(this.getNSTextElement()),this}remove(){var e;return this.element&&((e=this.element.parentElement)==null||e.removeChild(this.element),delete this.element),this}};a(h,"NSClass","ns"),a(h,"NSHostClass","nsh");let c=h;function S(){return new DOMParser().parseFromString('<div class=ns><div class=nsc><div class=nst></div><div class=nss><svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none></circle></svg></div></div></div>',"text/html").body.firstChild}function w(t,e){e.children.length>0?e.insertBefore(t,e.children.item(0)):e.append(t)}function x(t,e){t==null||t.classList[e](c.NSHostClass)}function y(t){x(t.getNSElement().parentElement,u.Remove)}function k(t){t.style.display="flex"}function p(t){t.style.display="none"}function g(t){return t instanceof Element?t:document.querySelector(t||"")}function N(t){var e;return((e=t==null?void 0:t.classList)==null?void 0:e.contains(c.NSClass))??!1}function m(t,e){x(t.parentElement,u.Remove),x(e,u.Add),w(t,e)}function v(t){const e=t.firstElementChild;if(e!==null&&N(e)){const l=e.id;return f.getInstance().nsStack.find(b=>b.getId()===l)??null}return null}const s=class s{constructor(){a(this,"version");a(this,"nsStack");this.version=i,this.nsStack=[]}findIndex(e){return this.nsStack.findIndex(e)}find(e){return this.nsStack.find(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}static assignToWindow(){Object.defineProperty(window,s.WindowAccessorKey,{value:s.getInstance(),writable:!1})}static start(){s.assignToWindow(),window.addEventListener("load",()=>{window[s.WindowAccessorKey]instanceof s||s.assignToWindow()})}createNS(e){const n=new c;return n.setText(e||""),this.nsStack.push(n),n}cleanAndRemove(e){return y(e),e.remove().getId()}stackDelete(e){let n=this.findIndex(r=>r.getId()===e.getId());return n<0?null:(this.nsStack.splice(n,1),e.getId())}deleteNS(e){const n=this.find(e);return n?(this.cleanAndRemove(n),this.stackDelete(n)):null}show(e){let n=v(document.body);return n||(n=this.createNS(),m(n.getNSElement(),document.body)),n.setText(e||"").getId()}showInside(e,n){const r=g(e);if(r){let l=v(r);return l||(l=this.createNS()),m(l.getNSElement(),r),l.setText(n||"").getId()}return null}hide(){const e=this.nsStack.pop();return e?this.cleanAndRemove(e):null}hideAll(){this.nsStack.forEach(this.cleanAndRemove),this.nsStack.splice(0,this.nsStack.length)}hideId(e){return this.deleteNS(n=>n.getId()===e)}hideInside(e){const n=g(e),r=l=>l.getNSElement().parentElement===n;return n?this.deleteNS(r):null}};a(s,"WindowAccessorKey","ns"),a(s,"instance");let f=s;try{f.start()}catch(t){console.warn(t)}})();
@@ -0,0 +1 @@
1
+ var S=Object.defineProperty;var N=(t,e,n)=>e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var c=(t,e,n)=>(N(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var u=(t=>(t.Add="add",t.Remove="remove",t))(u||{});const l=class l{constructor(){c(this,"id");c(this,"element");this.element=y(),this.element.id=this.id=l.generateGUID()}static generateGUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)})}getNSContentElement(){return this.getNSElement().firstElementChild}getNSTextElement(){return this.getNSContentElement().firstElementChild}getId(){return this.id}getNSElement(){return this.element}setText(e){return this.getNSTextElement().innerText=e,e.length>0?this.showText():this.hideText(),this}showText(){return w(this.getNSTextElement()),this}hideText(){return E(this.getNSTextElement()),this}remove(){var e;return this.element&&((e=this.element.parentElement)==null||e.removeChild(this.element),delete this.element),this}};c(l,"NSClass","ns"),c(l,"NSHostClass","nsh");let a=l;function y(){return new DOMParser().parseFromString('<div class=ns><div class=nsc><div class=nst></div><div class=nss><svg viewBox="0 0 50 50"><circle class=path cx=25 cy=25 r=20 fill=none></circle></svg></div></div></div>',"text/html").body.firstChild}function p(t,e){e.children.length>0?e.insertBefore(t,e.children.item(0)):e.append(t)}function f(t,e){t==null||t.classList[e](a.NSHostClass)}function v(t){f(t.getNSElement().parentElement,u.Remove)}function w(t){t.style.display="flex"}function E(t){t.style.display="none"}function x(t){return t instanceof Element?t:document.querySelector(t||"")}function I(t){var e;return((e=t==null?void 0:t.classList)==null?void 0:e.contains(a.NSClass))??!1}function m(t,e){f(t.parentElement,u.Remove),f(e,u.Add),p(t,e)}function g(t){const e=t.firstElementChild;if(e!==null&&I(e)){const s=e.id;return h.getInstance().nsStack.find(d=>d.getId()===s)??null}return null}const i=class i{constructor(){c(this,"nsStack");this.nsStack=[]}findIndex(e){return this.nsStack.findIndex(e)}find(e){return this.nsStack.find(e)}static getInstance(){return i.instance||(i.instance=new i),i.instance}static assignToWindow(){Object.defineProperty(window,i.WindowAccessorKey,{value:i.getInstance(),writable:!1})}static start(){i.assignToWindow(),window.addEventListener("load",()=>{window[i.WindowAccessorKey]instanceof i||i.assignToWindow()})}createNS(e){const n=new a;return n.setText(e||""),this.nsStack.push(n),n}cleanAndRemove(e){return v(e),e.remove().getId()}stackDelete(e){let n=this.findIndex(r=>r.getId()===e.getId());return n<0?null:(this.nsStack.splice(n,1),e.getId())}deleteNS(e){const n=this.find(e);return n?(this.cleanAndRemove(n),this.stackDelete(n)):null}show(e){let n=g(document.body);return n||(n=this.createNS(),m(n.getNSElement(),document.body)),n.setText(e||"").getId()}showInside(e,n){const r=x(e);if(r){let s=g(r);return s||(s=this.createNS()),m(s.getNSElement(),r),s.setText(n||"").getId()}return null}hide(){const e=this.nsStack.pop();return e?this.cleanAndRemove(e):null}hideAll(){this.nsStack.forEach(this.cleanAndRemove),this.nsStack=[]}hideId(e){return this.deleteNS(n=>n.getId()===e)}hideInside(e){const n=x(e),r=s=>s.getNSElement().parentElement===n;return n?this.deleteNS(r):null}};c(i,"WindowAccessorKey","ns"),c(i,"instance");let h=i;try{h.start()}catch(t){console.warn(t)}
@@ -0,0 +1 @@
1
+ .ns,.nsh:before{width:100%;height:100%}.ns,.nsh:before{top:0;left:0}.nsc,.ns{display:flex;justify-content:center;align-items:center}.nsh{--color: DarkSlateGray;--size: 20px;--relSize: calc(var(--size) * .9);--font: "Helvetica", "Arial", sans-serif;--weight: 400;--bg: rgba(255, 255, 255, .8);--zIdx: 999999999;--blur: blur(10px)}.nsh{position:relative;z-index:var(--zIdx)}.nsh:before{position:absolute;background-color:var(--bg);content:"";backdrop-filter:var(--blur);-webkit-backdrop-filter:var(--blur);z-index:calc(var(--zIdx) + 1);border-radius:inherit}body.nsh{height:100vh}.ns{position:absolute;z-index:calc(var(--zIdx) + 2)}.nsc{filter:drop-shadow(0 0 .1rem rgba(211,211,211,.5))}.nst{color:var(--color);font-size:var(--size);font-family:var(--font);font-weight:var(--weight);margin-right:var(--relSize);text-shadow:0 0 .06rem rgba(47,79,79,.25)}.nss{display:block;width:var(--relSize);height:var(--relSize)}.nss>svg{animation:Rotate 2s linear infinite;position:relative;width:inherit;height:inherit;stroke-width:8}.nss .path{stroke:var(--color);stroke-linecap:round;animation:Dash 1.5s ease-in-out infinite}@keyframes Rotate{to{transform:rotate(360deg)}}@keyframes Dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}