@3r1s_s/erisui 1.0.10 → 1.0.12

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.
package/dist/erisui.mjs CHANGED
@@ -1,4 +1,7 @@
1
- class C extends HTMLElement {
1
+ var S = Object.defineProperty;
2
+ var M = (o, t, e) => t in o ? S(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
+ var v = (o, t, e) => M(o, typeof t != "symbol" ? t + "" : t, e);
4
+ class z extends HTMLElement {
2
5
  static get observedAttributes() {
3
6
  return ["size", "border-radius", "name", "color"];
4
7
  }
@@ -52,39 +55,45 @@ class C extends HTMLElement {
52
55
  }
53
56
  connectedCallback() {
54
57
  this.avatar = this.shadowRoot.querySelector(".avatar"), this.initials = this.shadowRoot.querySelector("#initials");
55
- const t = this.shadowRoot.querySelector("slot"), i = t && t.assignedNodes().length > 0;
56
- if (i) {
57
- const e = t.assignedNodes()[0];
58
- e && e.tagName === "IMG" && (this.initials.style.display = "none", this.avatar.style.backgroundColor = "transparent");
58
+ const t = this.shadowRoot.querySelector("slot"), e = t && t.assignedNodes().length > 0;
59
+ if (e) {
60
+ const i = t.assignedNodes()[0];
61
+ i && i.tagName === "IMG" && (this.initials.style.display = "none", this.avatar.style.backgroundColor = "transparent");
59
62
  } else
60
63
  this.hasAttribute("color") && (this.avatar.style.backgroundColor = this.getAttribute("color"));
61
64
  if (this.hasAttribute("color") && (this.avatar.style.backgroundColor = this.getAttribute("color")), this.hasAttribute("size")) {
62
- const e = this.getAttribute("size");
63
- this.avatar.style.width = e + "px", this.avatar.style.height = e + "px", this.initials.style.fontSize = e / 2 + "px";
65
+ const i = this.getAttribute("size");
66
+ this.avatar.style.width = i + "px", this.avatar.style.height = i + "px", this.initials.style.fontSize = i / 2 + "px";
64
67
  }
65
- if (this.hasAttribute("border-radius") && (this.avatar.style.borderRadius = this.getAttribute("border-radius") + "px"), this.hasAttribute("name") && (this.avatar.title = this.getAttribute("name")), !i && this.hasAttribute("name")) {
66
- const r = this.getAttribute("name").trim().split(/\s+/);
67
- let n = "";
68
- r.length === 1 ? n = r[0][0] || "" : n = (r[0][0] || "") + (r[r.length - 1][0] || ""), this.initials.textContent = n.toUpperCase();
68
+ if (this.hasAttribute("border-radius") && (this.avatar.style.borderRadius = this.getAttribute("border-radius") + "px"), this.hasAttribute("name") && (this.avatar.title = this.getAttribute("name")), !e && this.hasAttribute("name")) {
69
+ const n = this.getAttribute("name").trim().split(/\s+/);
70
+ let s = "";
71
+ n.length === 1 ? s = n[0][0] || "" : s = (n[0][0] || "") + (n[n.length - 1][0] || ""), this.initials.textContent = s.toUpperCase();
69
72
  }
70
73
  }
71
74
  }
72
- customElements.define("eui-avatar", C);
73
- const b = /* @__PURE__ */ (() => {
75
+ customElements.define("eui-avatar", z);
76
+ const u = /* @__PURE__ */ (() => {
74
77
  let o = {};
75
78
  return {
76
- register(t, i) {
77
- o[t] = i;
79
+ register(t, e) {
80
+ o[t] = e;
78
81
  },
79
82
  get(t) {
80
83
  return o[t] || "";
81
84
  }
82
85
  };
83
86
  })();
84
- b.register("menu", '<svg width="24" height="24" viewBox="0 0 24 24" focusable="false"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" fill="currentColor"></path></svg>');
85
- b.register("home", '<svg width="22" height="21" viewBox="0 0 22 21" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.5258 0.204649C11.2291 -0.0682165 10.7709 -0.0682161 10.4742 0.204649L0.249923 9.68588C-0.266994 10.1612 0.0714693 11.0197 0.775759 11.0197L3.48971 11.0197V18.6923C3.48971 19.542 4.18295 20.2308 5.03811 20.2308H16.9619C17.8171 20.2308 18.5103 19.542 18.5103 18.6923V11.0197L21.2242 11.0197C21.9285 11.0197 22.267 10.1612 21.7501 9.68588L11.5258 0.204649Z" fill="currentColor"/></svg>');
86
- b.register("kit", '<svg width="26" height="28" viewBox="0 0 26 28" xmlns="http://www.w3.org/2000/svg"><path d="m13.118 14.831c0.433 0 1.257-0.024 1.795-0.344l9.151-4.057c0.869-0.59 1.051-1.255 1.067-1.773 0.02-0.662-0.313-1.634-1.181-2.15l-8.515-3.921c-0.537-0.309-2.096-0.552-2.529-0.552-0.444 0-1.958 0.42-2.496 0.73l-8.643 4.034c-0.85 0.602-1.022 1.284-0.951 1.942 0.098 0.887 0.206 0.857 0.889 1.503l9.577 4.212c0.537 0.32 1.391 0.376 1.836 0.376zm-0.12 5.467c0.403 0 1.443-0.068 1.928-0.345l8.858-3.991c0.497-0.3 1.448-1.117 1.382-1.952-0.091-1.138-0.598-1.7-0.948-1.906l-9.22 3.888c-0.454 0.261-1.417 0.478-1.916 0.478-0.542 0-1.539-0.228-1.766-0.362l-9.395-4.012c-0.462 0.022-1.174 0.911-1.201 1.642-0.03 0.761 0.7 1.62 1.135 1.839l9.408 4.384c0.485 0.278 1.322 0.337 1.735 0.337zm0.09 5.344c0.403 0 1.296-0.053 1.781-0.342l9.147-4.299c0.485-0.289 1.129-0.789 1.053-1.879-0.056-0.794-0.071-1.123-0.918-1.765l-9.203 4.113c-0.228 0.134-0.948 0.39-1.853 0.39-0.939 0-1.603-0.224-1.831-0.359l-9.451-4.017c-0.979 0.247-1.005 1.45-1.005 1.947 0 0.455 0.403 1.279 0.9 1.568l9.465 4.262c0.486 0.29 1.502 0.381 1.915 0.381z" fill="currentColor"></path></svg>');
87
- class S extends HTMLElement {
87
+ u.register("menu", '<svg width="24" height="24" viewBox="0 0 24 24" focusable="false"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" fill="currentColor"></path></svg>');
88
+ u.register("home", '<svg width="22" height="21" viewBox="0 0 22 21" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.5258 0.204649C11.2291 -0.0682165 10.7709 -0.0682161 10.4742 0.204649L0.249923 9.68588C-0.266994 10.1612 0.0714693 11.0197 0.775759 11.0197L3.48971 11.0197V18.6923C3.48971 19.542 4.18295 20.2308 5.03811 20.2308H16.9619C17.8171 20.2308 18.5103 19.542 18.5103 18.6923V11.0197L21.2242 11.0197C21.9285 11.0197 22.267 10.1612 21.7501 9.68588L11.5258 0.204649Z" fill="currentColor"/></svg>');
89
+ u.register("kit", '<svg width="26" height="28" viewBox="0 0 26 28" xmlns="http://www.w3.org/2000/svg"><path d="m13.118 14.831c0.433 0 1.257-0.024 1.795-0.344l9.151-4.057c0.869-0.59 1.051-1.255 1.067-1.773 0.02-0.662-0.313-1.634-1.181-2.15l-8.515-3.921c-0.537-0.309-2.096-0.552-2.529-0.552-0.444 0-1.958 0.42-2.496 0.73l-8.643 4.034c-0.85 0.602-1.022 1.284-0.951 1.942 0.098 0.887 0.206 0.857 0.889 1.503l9.577 4.212c0.537 0.32 1.391 0.376 1.836 0.376zm-0.12 5.467c0.403 0 1.443-0.068 1.928-0.345l8.858-3.991c0.497-0.3 1.448-1.117 1.382-1.952-0.091-1.138-0.598-1.7-0.948-1.906l-9.22 3.888c-0.454 0.261-1.417 0.478-1.916 0.478-0.542 0-1.539-0.228-1.766-0.362l-9.395-4.012c-0.462 0.022-1.174 0.911-1.201 1.642-0.03 0.761 0.7 1.62 1.135 1.839l9.408 4.384c0.485 0.278 1.322 0.337 1.735 0.337zm0.09 5.344c0.403 0 1.296-0.053 1.781-0.342l9.147-4.299c0.485-0.289 1.129-0.789 1.053-1.879-0.056-0.794-0.071-1.123-0.918-1.765l-9.203 4.113c-0.228 0.134-0.948 0.39-1.853 0.39-0.939 0-1.603-0.224-1.831-0.359l-9.451-4.017c-0.979 0.247-1.005 1.45-1.005 1.947 0 0.455 0.403 1.279 0.9 1.568l9.465 4.262c0.486 0.29 1.502 0.381 1.915 0.381z" fill="currentColor"></path></svg>');
90
+ u.register("settings", '<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0.644169 15.2044C0.751639 15.4175 0.866389 15.627 0.988219 15.8323C1.34503 16.445 1.76284 17.0223 2.23048 17.545C2.3967 17.7307 2.65856 17.7968 2.89375 17.7126L5.25826 16.8621C5.96645 16.608 6.74841 17.07 6.87902 17.8018L7.32018 20.2764C7.36418 20.5227 7.55119 20.7167 7.79454 20.7688C8.86201 20.9976 9.95753 21.057 11.0418 20.9452C11.427 20.9061 11.8095 20.8457 12.1863 20.7643C12.375 20.7232 12.5303 20.5969 12.6121 20.4275C12.6441 20.37 12.6671 20.3068 12.6794 20.2397L13.132 17.7739C13.1978 17.4162 13.4191 17.1252 13.7102 16.9498C13.7478 16.9275 13.7867 16.9072 13.8264 16.8889C14.1041 16.7654 14.426 16.7408 14.7301 16.8496L17.0889 17.6938C17.2068 17.7362 17.3318 17.7406 17.4482 17.7107C17.5805 17.6872 17.7044 17.6208 17.7983 17.5172C18.2857 16.9783 18.7189 16.3833 19.0875 15.7497C19.4503 15.1137 19.748 14.4403 19.9703 13.7471C20.0128 13.6142 20.0083 13.4742 19.9629 13.3481C19.9307 13.2315 19.8646 13.1245 19.7685 13.043L17.8596 11.4179C17.6114 11.2067 17.4714 10.912 17.4409 10.6065C17.4371 10.563 17.4355 10.5194 17.4361 10.4758C17.444 10.1379 17.5847 9.80337 17.8591 9.56905L19.7638 7.94348C19.8146 7.90007 19.857 7.84958 19.8904 7.7944C19.9978 7.63842 20.0299 7.43844 19.9706 7.25291C19.8534 6.88733 19.7151 6.52704 19.5572 6.17466C19.1114 5.17572 18.5115 4.2528 17.7787 3.43934C17.612 3.25429 17.3509 3.18886 17.1161 3.27382L14.7569 4.12827C14.0592 4.38082 13.2679 3.93321 13.1344 3.19155L12.6871 0.714256C12.6423 0.468053 12.4542 0.273849 12.2106 0.22246C11.5182 0.0764882 10.803 0.00250031 10.088 0.000608251C9.88769 -0.0015584 9.68739 0.002064 9.48735 0.0114648C8.92415 0.0369819 8.36389 0.107332 7.81778 0.222459C7.78135 0.230146 7.74615 0.241028 7.71249 0.2548C7.5098 0.328781 7.35888 0.505679 7.31996 0.723547L6.8788 3.19817C6.81394 3.56157 6.58834 3.85866 6.29097 4.03446C5.98991 4.2061 5.61923 4.25412 5.27153 4.12827L2.91237 3.27382C2.70694 3.1995 2.48138 3.24016 2.31657 3.37545C2.2857 3.39886 2.25676 3.42543 2.23026 3.45505C1.81793 3.91588 1.44433 4.4192 1.11714 4.95183C1.05788 5.04799 1.00019 5.14513 0.944072 5.24319C0.878302 5.35619 0.814661 5.4704 0.753186 5.58577C0.464267 6.12611 0.222113 6.69081 0.0338354 7.26739C0.0213426 7.30567 0.0127871 7.34455 0.00802709 7.38352C-0.0257478 7.59364 0.0518458 7.809 0.218337 7.94974L2.13633 9.56992C2.41146 9.80242 2.55518 10.1364 2.56469 10.4743C2.56917 10.8294 2.42529 11.1857 2.13611 11.4301L0.218115 13.0503C0.0484589 13.1937 -0.0289685 13.4145 0.00982709 13.6284C0.0147983 13.6634 0.0228404 13.6982 0.0340542 13.7326C0.198098 14.235 0.403035 14.7283 0.644169 15.2044ZM10 14.5C12.2091 14.5 14 12.7091 14 10.5C14 8.29086 12.2091 6.5 10 6.5C7.79086 6.5 6 8.29086 6 10.5C6 12.7091 7.79086 14.5 10 14.5Z" fill="currentColor"></path></svg>');
91
+ u.register("home", '<svg width="22" height="21" viewBox="0 0 22 21" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.5258 0.204649C11.2291 -0.0682165 10.7709 -0.0682161 10.4742 0.204649L0.249923 9.68588C-0.266994 10.1612 0.0714693 11.0197 0.775759 11.0197L3.48971 11.0197V18.6923C3.48971 19.542 4.18295 20.2308 5.03811 20.2308H16.9619C17.8171 20.2308 18.5103 19.542 18.5103 18.6923V11.0197L21.2242 11.0197C21.9285 11.0197 22.267 10.1612 21.7501 9.68588L11.5258 0.204649Z" fill="currentColor"/></svg>');
92
+ u.register("copy", '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M2 11C2 11.7956 2.31607 12.5587 2.87868 13.1213C3.44129 13.6839 4.20435 14 5 14H11C11.7956 14 12.5587 13.6839 13.1213 13.1213C13.6839 12.5587 14 11.7956 14 11V8H11.75C10.7554 8 9.80161 7.60491 9.09835 6.90165C8.39509 6.19839 8 5.24456 8 4.25V2H5C4.20435 2 3.44129 2.31607 2.87868 2.87868C2.31607 3.44129 2 4.20435 2 5V11Z" fill="currentColor"/><path d="M13.7975 6.49965C13.6881 6.25457 13.5357 6.03105 13.3475 5.83965L10.16 2.65965C9.96921 2.4688 9.74565 2.31384 9.5 2.20215V4.24965C9.5 4.54512 9.5582 4.8377 9.67127 5.11069C9.78434 5.38367 9.95008 5.63171 10.159 5.84064C10.3679 6.04957 10.616 6.2153 10.889 6.32838C11.1619 6.44145 11.4545 6.49965 11.75 6.49965H13.7975Z" fill="currentColor"/></svg>');
93
+ u.register("arrow", '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"></path></svg>');
94
+ u.register("back", '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" style="transform: rotate(180deg)"><path d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"></path></svg>');
95
+ u.register("check", '<svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.86368 9.12226C3.82463 9.16131 3.76131 9.16131 3.72226 9.12226L0.146522 5.54652C-0.0487403 5.35126 -0.0487401 5.03468 0.146522 4.83942L0.839416 4.14652C1.03468 3.95126 1.35126 3.95126 1.54652 4.14652L3.72226 6.32226C3.76131 6.36131 3.82463 6.36131 3.86368 6.32226L10.0394 0.146522C10.2347 -0.0487398 10.5513 -0.0487399 10.7465 0.146522L11.4394 0.839416C11.6347 1.03468 11.6347 1.35126 11.4394 1.54652L3.86368 9.12226Z" fill="currentColor"/></svg>');
96
+ class T extends HTMLElement {
88
97
  static get observedAttributes() {
89
98
  return ["name", "width", "height"];
90
99
  }
@@ -98,23 +107,23 @@ class S extends HTMLElement {
98
107
  this.render();
99
108
  }
100
109
  render() {
101
- const t = this.getAttribute("name"), i = b.get(t);
102
- if (!i) {
110
+ const t = this.getAttribute("name"), e = u.get(t);
111
+ if (!e) {
103
112
  this.shadowRoot.innerHTML = '<span style="color:red;">?</span>';
104
113
  return;
105
114
  }
106
- const e = document.createElement("template");
107
- e.innerHTML = i.trim();
108
- const r = e.content.cloneNode(!0), n = r.firstElementChild;
109
- if (n && n.style) {
110
- const a = this.getAttribute("width"), l = this.getAttribute("height");
111
- a && n.setAttribute("width", a), l && n.setAttribute("height", l), n.style.display = "block";
115
+ const i = document.createElement("template");
116
+ i.innerHTML = e.trim();
117
+ const n = i.content.cloneNode(!0), s = n.firstElementChild;
118
+ if (s && s.style) {
119
+ const r = this.getAttribute("width"), c = this.getAttribute("height");
120
+ r && s.setAttribute("width", r), c && s.setAttribute("height", c), s.style.display = "block";
112
121
  }
113
- this.shadowRoot.innerHTML = "", this.shadowRoot.appendChild(r);
122
+ this.shadowRoot.innerHTML = "", this.shadowRoot.appendChild(n);
114
123
  }
115
124
  }
116
- customElements.define("eui-icon", S);
117
- class L extends HTMLElement {
125
+ customElements.define("eui-icon", T);
126
+ class $ extends HTMLElement {
118
127
  static get observedAttributes() {
119
128
  return ["label", "value", "id", "type", "filled"];
120
129
  }
@@ -226,17 +235,17 @@ class L extends HTMLElement {
226
235
  this.setAttribute("value", this.inputEl.value);
227
236
  });
228
237
  }
229
- attributeChangedCallback(t, i, e) {
238
+ attributeChangedCallback(t, e, i) {
230
239
  if (!(!this.inputEl || !this.labelEl))
231
240
  switch (t) {
232
241
  case "value":
233
- this.inputEl.value !== e && (this.inputEl.value = e);
242
+ this.inputEl.value !== i && (this.inputEl.value = i);
234
243
  break;
235
244
  case "id":
236
- this.inputEl.id = e;
245
+ this.inputEl.id = i;
237
246
  break;
238
247
  case "label":
239
- this.labelEl.textContent = e;
248
+ this.labelEl.textContent = i;
240
249
  break;
241
250
  }
242
251
  }
@@ -247,8 +256,8 @@ class L extends HTMLElement {
247
256
  this.setAttribute("value", t);
248
257
  }
249
258
  }
250
- customElements.define("eui-input", L);
251
- class z extends HTMLElement {
259
+ customElements.define("eui-input", $);
260
+ class R extends HTMLElement {
252
261
  constructor() {
253
262
  super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
254
263
  <style>
@@ -298,8 +307,8 @@ class z extends HTMLElement {
298
307
  `;
299
308
  }
300
309
  }
301
- customElements.define("eui-loader", z);
302
- class M extends HTMLElement {
310
+ customElements.define("eui-loader", R);
311
+ class H extends HTMLElement {
303
312
  static get observedAttributes() {
304
313
  return ["value", "intermediate", "id"];
305
314
  }
@@ -361,8 +370,8 @@ class M extends HTMLElement {
361
370
  this.hasAttribute("id") && (this.progress.id = this.getAttribute("id")), this.hasAttribute("intermediate") && t.classList.add("intermediate"), this.hasAttribute("value") && (t.style.width = this.getAttribute("value") + "%");
362
371
  }
363
372
  }
364
- customElements.define("eui-progressbar", M);
365
- const v = {
373
+ customElements.define("eui-progressbar", H);
374
+ const x = {
366
375
  is: {
367
376
  iPhone: /iPhone/.test(navigator.userAgent),
368
377
  iPad: /iPad/.test(navigator.userAgent),
@@ -382,11 +391,11 @@ const v = {
382
391
  haptics: "vibrate" in navigator || "Vibrate" in window || typeof window.navigator.vibrate == "function"
383
392
  },
384
393
  userAgent: navigator.userAgent
385
- }, X = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
394
+ }, J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
386
395
  __proto__: null,
387
- device: v
396
+ device: x
388
397
  }, Symbol.toStringTag, { value: "Module" }));
389
- function T() {
398
+ function _() {
390
399
  try {
391
400
  const o = document.createElement("label");
392
401
  o.ariaHidden = "true", o.style.display = "none";
@@ -395,28 +404,28 @@ function T() {
395
404
  } catch {
396
405
  }
397
406
  }
398
- function x(o) {
399
- v.supports.haptics ? navigator.vibrate(o || 50) : v.is.iPhone && T();
407
+ function w(o) {
408
+ x.supports.haptics ? navigator.vibrate(o || 50) : x.is.iPhone && _();
400
409
  }
401
- const W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
410
+ const K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
402
411
  __proto__: null,
403
- haptic: x
404
- }, Symbol.toStringTag, { value: "Module" })), w = (() => {
412
+ haptic: w
413
+ }, Symbol.toStringTag, { value: "Module" })), y = (() => {
405
414
  let o = {}, t;
406
415
  try {
407
416
  o = JSON.parse(localStorage.getItem(t) || "{}");
408
- } catch (i) {
409
- console.error(i);
417
+ } catch (e) {
418
+ console.error(e);
410
419
  }
411
420
  return {
412
- get(i) {
413
- return o[i];
421
+ get(e) {
422
+ return o[e];
414
423
  },
415
- set(i, e) {
416
- o[i] = e, localStorage.setItem(t, JSON.stringify(o));
424
+ set(e, i) {
425
+ o[e] = i, localStorage.setItem(t, JSON.stringify(o));
417
426
  },
418
- delete(i) {
419
- delete o[i], localStorage.setItem(t, JSON.stringify(o));
427
+ delete(e) {
428
+ delete o[e], localStorage.setItem(t, JSON.stringify(o));
420
429
  },
421
430
  all() {
422
431
  return o;
@@ -424,23 +433,23 @@ const W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
424
433
  clear() {
425
434
  o = {}, localStorage.setItem(t, JSON.stringify(o));
426
435
  },
427
- name(i) {
428
- t = i;
436
+ name(e) {
437
+ t = e;
429
438
  try {
430
439
  o = JSON.parse(localStorage.getItem(t) || "{}");
431
- } catch (e) {
432
- console.error(e);
440
+ } catch (i) {
441
+ console.error(i);
433
442
  }
434
443
  },
435
444
  settings: {
436
- get(i) {
437
- return o && o.settings && o.settings[i];
445
+ get(e) {
446
+ return o && o.settings && o.settings[e];
438
447
  },
439
- set(i, e) {
440
- o.settings || (o.settings = {}), o.settings[i] = e, localStorage.setItem(t, JSON.stringify(o));
448
+ set(e, i) {
449
+ o.settings || (o.settings = {}), o.settings[e] = i, localStorage.setItem(t, JSON.stringify(o));
441
450
  },
442
- delete(i) {
443
- o.settings && (delete o.settings[i], localStorage.setItem(t, JSON.stringify(o)));
451
+ delete(e) {
452
+ o.settings && (delete o.settings[e], localStorage.setItem(t, JSON.stringify(o)));
444
453
  },
445
454
  all() {
446
455
  return o.settings || {};
@@ -450,12 +459,12 @@ const W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
450
459
  }
451
460
  }
452
461
  };
453
- })(), y = w.settings, J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
462
+ })(), k = y.settings, Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
454
463
  __proto__: null,
455
- settings: y,
456
- storage: w
464
+ settings: k,
465
+ storage: y
457
466
  }, Symbol.toStringTag, { value: "Module" }));
458
- class R extends HTMLElement {
467
+ class F extends HTMLElement {
459
468
  static get observedAttributes() {
460
469
  return ["selected"];
461
470
  }
@@ -535,13 +544,13 @@ class R extends HTMLElement {
535
544
  this.inputEl = this.shadowRoot.querySelector("input"), this.switchEl = this.shadowRoot.querySelector(".switch"), this.updateFromAttribute(), this.switchEl.addEventListener("click", () => this.toggle());
536
545
  }
537
546
  toggle() {
538
- this.selected = !this.selected, x();
547
+ this.selected = !this.selected, w();
539
548
  }
540
549
  updateFromAttribute() {
541
550
  const t = this.hasAttribute("selected");
542
551
  this.inputEl.checked = t, this.switchEl.classList.toggle("selected", t);
543
552
  }
544
- attributeChangedCallback(t, i, e) {
553
+ attributeChangedCallback(t, e, i) {
545
554
  t === "selected" && this.inputEl && this.updateFromAttribute();
546
555
  }
547
556
  get selected() {
@@ -551,8 +560,8 @@ class R extends HTMLElement {
551
560
  t ? this.setAttribute("selected", "") : this.removeAttribute("selected");
552
561
  }
553
562
  }
554
- customElements.define("eui-switch", R);
555
- class $ extends HTMLElement {
563
+ customElements.define("eui-switch", F);
564
+ class I extends HTMLElement {
556
565
  constructor() {
557
566
  super(), this.attachShadow({ mode: "open" });
558
567
  }
@@ -603,97 +612,97 @@ class $ extends HTMLElement {
603
612
  </style>
604
613
  <slot></slot>
605
614
  `, this.addEventListener("pointerdown", (t) => {
606
- const i = document.createElement("span"), e = t.currentTarget, r = Math.max(e.offsetWidth, e.offsetHeight);
607
- i.classList.add("ripple"), i.style.left = t.clientX - e.getBoundingClientRect().left - r / 2 + "px", i.style.top = t.clientY - e.getBoundingClientRect().top - r / 2 + "px", i.style.width = r + "px", i.style.height = r + "px", this.shadowRoot.appendChild(i), setTimeout(() => {
608
- i.remove();
615
+ const e = document.createElement("span"), i = t.currentTarget, n = Math.max(i.offsetWidth, i.offsetHeight);
616
+ e.classList.add("ripple"), e.style.left = t.clientX - i.getBoundingClientRect().left - n / 2 + "px", e.style.top = t.clientY - i.getBoundingClientRect().top - n / 2 + "px", e.style.width = n + "px", e.style.height = n + "px", this.shadowRoot.appendChild(e), setTimeout(() => {
617
+ e.remove();
609
618
  }, 600);
610
619
  });
611
620
  }
612
621
  }
613
- customElements.define("eui-chip", $);
614
- const g = "", k = (() => {
622
+ customElements.define("eui-chip", I);
623
+ const m = "", C = (() => {
615
624
  const o = [];
616
- function t(s, d) {
617
- const h = [], u = s.replace(/:([^/]+)/g, (m, f) => (h.push(f), "([^/]+)")).replace(/\//g, "\\/"), p = new RegExp(`^${g}${u}$`);
618
- o.push({ regex: p, paramNames: h, renderFn: d });
625
+ function t(a, l) {
626
+ const h = [], g = a.replace(/:([^/]+)/g, (b, f) => (h.push(f), "([^/]+)")).replace(/\//g, "\\/"), p = new RegExp(`^${m}${g}$`);
627
+ o.push({ regex: p, paramNames: h, renderFn: l });
619
628
  }
620
- function i(s) {
621
- for (const { regex: d, paramNames: h, renderFn: u } of o) {
622
- const p = s.match(d);
629
+ function e(a) {
630
+ for (const { regex: l, paramNames: h, renderFn: g } of o) {
631
+ const p = a.match(l);
623
632
  if (p) {
624
- const m = {};
625
- return h.forEach((f, A) => {
626
- m[f] = decodeURIComponent(p[A + 1]);
627
- }), { renderFn: u, params: m };
633
+ const b = {};
634
+ return h.forEach((f, L) => {
635
+ b[f] = decodeURIComponent(p[L + 1]);
636
+ }), { renderFn: g, params: b };
628
637
  }
629
638
  }
630
639
  return null;
631
640
  }
632
- function e(s, d = !0) {
633
- s.startsWith(g) || (s = g + (s.startsWith("/") ? "" : "/") + s);
634
- const h = s.split(/[?#]/)[0];
635
- if (h === window.location.pathname && s.includes("#")) {
636
- d && history.pushState({}, "", s);
637
- const p = "#" + s.split("#")[1];
638
- r(p);
641
+ function i(a, l = !0) {
642
+ a.startsWith(m) || (a = m + (a.startsWith("/") ? "" : "/") + a);
643
+ const h = a.split(/[?#]/)[0];
644
+ if (h === window.location.pathname && a.includes("#")) {
645
+ l && history.pushState({}, "", a);
646
+ const p = "#" + a.split("#")[1];
647
+ n(p);
639
648
  return;
640
649
  }
641
- const u = i(h);
642
- if (u)
643
- if (d && history.pushState({}, "", s), u.renderFn(u.params), window.dispatchEvent(new CustomEvent("route-changed", { detail: { path: s } })), s.includes("#")) {
644
- const p = "#" + s.split("#")[1];
645
- setTimeout(() => r(p), 100);
650
+ const g = e(h);
651
+ if (g)
652
+ if (l && history.pushState({}, "", a), g.renderFn(g.params), window.dispatchEvent(new CustomEvent("route-changed", { detail: { path: a } })), a.includes("#")) {
653
+ const p = "#" + a.split("#")[1];
654
+ setTimeout(() => n(p), 100);
646
655
  } else {
647
656
  const p = document.getElementById("main");
648
657
  p && p.scrollTo(0, 0);
649
658
  }
650
- else n ? (d && history.pushState({}, "", s), n()) : console.warn(`No route found for ${h}`);
659
+ else s ? (l && history.pushState({}, "", a), s()) : console.warn(`No route found for ${h}`);
651
660
  }
652
- function r(s) {
653
- if (s)
661
+ function n(a) {
662
+ if (a)
654
663
  try {
655
- const d = document.querySelector(s);
656
- d && d.scrollIntoView({ behavior: "smooth" });
664
+ const l = document.querySelector(a);
665
+ l && l.scrollIntoView({ behavior: "smooth" });
657
666
  } catch {
658
- console.warn("Invalid hash:", s);
667
+ console.warn("Invalid hash:", a);
659
668
  }
660
669
  }
661
- let n = null;
662
- function a(s) {
663
- n = s;
670
+ let s = null;
671
+ function r(a) {
672
+ s = a;
664
673
  }
665
- function l() {
674
+ function c() {
666
675
  history.back();
667
676
  }
668
- function c() {
669
- return window.location.pathname.replace(g, "") || "/";
677
+ function d() {
678
+ return window.location.pathname.replace(m, "") || "/";
670
679
  }
671
680
  return window.addEventListener("popstate", () => {
672
- const s = window.location.pathname + window.location.search + window.location.hash;
673
- e(s, !1);
674
- }), window.addEventListener("click", (s) => {
675
- if (s.button !== 0 || s.metaKey || s.altKey || s.ctrlKey || s.shiftKey) return;
676
- const d = s.target.closest("a");
677
- if (!d || d.hasAttribute("download") || d.getAttribute("target") === "_blank") return;
678
- const h = d.getAttribute("href");
681
+ const a = window.location.pathname + window.location.search + window.location.hash;
682
+ i(a, !1);
683
+ }), window.addEventListener("click", (a) => {
684
+ if (a.button !== 0 || a.metaKey || a.altKey || a.ctrlKey || a.shiftKey) return;
685
+ const l = a.target.closest("a");
686
+ if (!l || l.hasAttribute("download") || l.getAttribute("target") === "_blank") return;
687
+ const h = l.getAttribute("href");
679
688
  if (!(!h || h.startsWith("http") && !h.startsWith(window.location.origin))) {
680
- if (s.preventDefault(), h.startsWith("#")) {
681
- history.pushState({}, "", h), r(h);
689
+ if (a.preventDefault(), h.startsWith("#")) {
690
+ history.pushState({}, "", h), n(h);
682
691
  return;
683
692
  }
684
- e(h);
693
+ i(h);
685
694
  }
686
- }), { add: t, navigate: e, back: l, location: c, setNotFound: a };
695
+ }), { add: t, navigate: i, back: c, location: d, setNotFound: r };
687
696
  })();
688
- async function V(o) {
697
+ async function G(o) {
689
698
  try {
690
699
  const t = document.getElementById("main");
691
- t.classList.add("fade-out"), await new Promise((e) => setTimeout(e, 200));
692
- const i = await fetch(`/src/pages/${o}.html`).then((e) => e.text());
693
- t.innerHTML = i, t.classList.remove("fade-out"), t.classList.add("fade-in"), window.location.hash ? setTimeout(() => {
700
+ t.classList.add("fade-out"), await new Promise((i) => setTimeout(i, 200));
701
+ const e = await fetch(`/src/pages/${o}.html`).then((i) => i.text());
702
+ t.innerHTML = e, t.classList.remove("fade-out"), t.classList.add("fade-in"), window.location.hash ? setTimeout(() => {
694
703
  try {
695
- const e = document.querySelector(window.location.hash);
696
- e && e.scrollIntoView({ behavior: "smooth" });
704
+ const i = document.querySelector(window.location.hash);
705
+ i && i.scrollIntoView({ behavior: "smooth" });
697
706
  } catch {
698
707
  }
699
708
  }, 100) : t && t.scrollTo(0, 0), setTimeout(() => {
@@ -703,59 +712,60 @@ async function V(o) {
703
712
  console.error("Page load failed:", t);
704
713
  }
705
714
  }
706
- class H extends HTMLElement {
715
+ class j extends HTMLElement {
716
+ constructor() {
717
+ super();
718
+ v(this, "handleClick", () => {
719
+ const e = this.getAttribute("path");
720
+ e && C.navigate(e);
721
+ });
722
+ this.attachShadow({ mode: "open" });
723
+ }
707
724
  static get observedAttributes() {
708
725
  return ["path", "icon", "label", "badge", "active", "avatar-src", "avatar-name"];
709
726
  }
710
- constructor() {
711
- super(), this.attachShadow({ mode: "open" });
712
- }
713
727
  connectedCallback() {
714
728
  this.hasRendered || (this.render(), this.setupEventListeners(), this.hasRendered = !0), this.updateContent(), this.addEventListener("click", this.handleClick);
715
729
  }
716
730
  disconnectedCallback() {
717
731
  this.removeEventListener("click", this.handleClick);
718
732
  }
719
- attributeChangedCallback(t, i, e) {
720
- if (i !== e && this.hasRendered) {
721
- if (t === "active")
733
+ attributeChangedCallback(e, i, n) {
734
+ if (i !== n && this.hasRendered) {
735
+ if (e === "active")
722
736
  return;
723
737
  this.updateContent();
724
738
  }
725
739
  }
726
- handleClick = () => {
727
- const t = this.getAttribute("path");
728
- t && k.navigate(t);
729
- };
730
740
  setupEventListeners() {
731
- this.addEventListener("pointerdown", (t) => {
732
- const i = document.createElement("span"), e = t.currentTarget, r = e.getBoundingClientRect(), n = Math.max(e.offsetWidth, e.offsetHeight), a = n / 2;
733
- i.classList.add("ripple"), i.style.width = `${n}px`, i.style.height = `${n}px`, i.style.left = `${t.clientX - r.left - a}px`, i.style.top = `${t.clientY - r.top - a}px`, this.shadowRoot.appendChild(i), i.addEventListener("animationend", () => {
741
+ this.addEventListener("pointerdown", (e) => {
742
+ const i = document.createElement("span"), n = e.currentTarget, s = n.getBoundingClientRect(), r = Math.max(n.offsetWidth, n.offsetHeight), c = r / 2;
743
+ i.classList.add("ripple"), i.style.width = `${r}px`, i.style.height = `${r}px`, i.style.left = `${e.clientX - s.left - c}px`, i.style.top = `${e.clientY - s.top - c}px`, this.shadowRoot.appendChild(i), i.addEventListener("animationend", () => {
734
744
  i.remove();
735
745
  });
736
746
  });
737
747
  }
738
748
  updateContent() {
739
- const t = this.getAttribute("icon"), i = this.getAttribute("avatar-src"), e = this.getAttribute("avatar-name"), r = this.getAttribute("label") || "", n = this.getAttribute("badge"), a = this.shadowRoot.querySelector(".badge");
740
- if (n)
741
- if (a)
742
- a.textContent = n;
749
+ const e = this.getAttribute("icon"), i = this.getAttribute("avatar-src"), n = this.getAttribute("avatar-name"), s = this.getAttribute("label") || "", r = this.getAttribute("badge"), c = this.shadowRoot.querySelector(".badge");
750
+ if (r)
751
+ if (c)
752
+ c.textContent = r;
743
753
  else {
744
- const s = document.createElement("span");
745
- s.className = "badge", s.textContent = n, this.shadowRoot.appendChild(s);
754
+ const l = document.createElement("span");
755
+ l.className = "badge", l.textContent = r, this.shadowRoot.appendChild(l);
746
756
  }
747
- else a && a.remove();
748
- const l = this.shadowRoot.querySelector("slot[name='icon']");
749
- if (l)
750
- if (i || e) {
751
- let s = '<eui-avatar size="24"';
752
- e && (s += ` name="${e}"`), s += ">", i && (s += `<img src="${i}" alt="${e || "Avatar"}" />`), s += "</eui-avatar>", l.innerHTML = s;
757
+ else c && c.remove();
758
+ const d = this.shadowRoot.querySelector("slot[name='icon']");
759
+ if (d)
760
+ if (i || n) {
761
+ let l = '<eui-avatar size="24"';
762
+ n && (l += ` name="${n}"`), l += ">", i && (l += `<img src="${i}" alt="${n || "Avatar"}" />`), l += "</eui-avatar>", d.innerHTML = l;
753
763
  } else {
754
- const s = l.querySelector("eui-icon");
755
- t && s ? s.getAttribute("name") !== t && s.setAttribute("name", t) : t ? l.innerHTML = `<eui-icon width="24" height="24" name="${t}"></eui-icon>` : l.innerHTML = "";
764
+ const l = d.querySelector("eui-icon");
765
+ e && l ? l.getAttribute("name") !== e && l.setAttribute("name", e) : e ? d.innerHTML = `<eui-icon width="24" height="24" name="${e}"></eui-icon>` : d.innerHTML = "";
756
766
  }
757
- const c = this.shadowRoot.querySelector(".label");
758
- c && (c.textContent = r);
767
+ const a = this.shadowRoot.querySelector(".label");
768
+ a && (a.textContent = s);
759
769
  }
760
770
  render() {
761
771
  this.shadowRoot.innerHTML = `
@@ -866,8 +876,8 @@ class H extends HTMLElement {
866
876
  `;
867
877
  }
868
878
  }
869
- customElements.define("eui-nav-item", H);
870
- class _ extends HTMLElement {
879
+ customElements.define("eui-nav-item", j);
880
+ class q extends HTMLElement {
871
881
  constructor() {
872
882
  super(), this.attachShadow({ mode: "open" });
873
883
  }
@@ -895,6 +905,7 @@ class _ extends HTMLElement {
895
905
 
896
906
  .app-nav-container {
897
907
  width: 100%;
908
+ min-width: var(--nav-width, 75px);
898
909
  height: 100%;
899
910
  box-sizing: border-box;
900
911
  background-color: var(--app-200);
@@ -975,10 +986,11 @@ class _ extends HTMLElement {
975
986
  <a href="#content" id="skip_navigation_link">Skip To Content</a>
976
987
  <div class="nav-items">
977
988
  ${this.navItems.map((t) => {
989
+ var n, s;
978
990
  if (t.type === "divider")
979
991
  return '<div style="height: 1px; background: var(--app-300); margin: 0.5rem 0;"></div>';
980
- const i = t.avatar?.src || "", e = t.avatar?.name || "";
981
- return `<eui-nav-item path="${t.path}" icon="${t.icon}" avatar-src="${i}" avatar-name="${e}" label="${t.label}"></eui-nav-item>`;
992
+ const e = ((n = t.avatar) == null ? void 0 : n.src) || "", i = ((s = t.avatar) == null ? void 0 : s.name) || "";
993
+ return `<eui-nav-item path="${t.path}" icon="${t.icon}" avatar-src="${e}" avatar-name="${i}" label="${t.label}"></eui-nav-item>`;
982
994
  }).join("")}
983
995
  </div>
984
996
  </div>
@@ -991,13 +1003,13 @@ class _ extends HTMLElement {
991
1003
  return this._navItems || [];
992
1004
  }
993
1005
  updateActiveState(t) {
994
- t || (t = k.location()), t.startsWith("/") || (t = "/" + t), this.shadowRoot.querySelectorAll("eui-nav-item").forEach((e) => {
995
- e.getAttribute("path") === t ? e.setAttribute("active", "") : e.removeAttribute("active");
1006
+ t || (t = C.location()), t.startsWith("/") || (t = "/" + t), this.shadowRoot.querySelectorAll("eui-nav-item").forEach((i) => {
1007
+ i.getAttribute("path") === t ? i.setAttribute("active", "") : i.removeAttribute("active");
996
1008
  });
997
1009
  }
998
1010
  }
999
- customElements.define("eui-app-nav", _);
1000
- class I extends HTMLElement {
1011
+ customElements.define("eui-app-nav", q);
1012
+ class B extends HTMLElement {
1001
1013
  static get observedAttributes() {
1002
1014
  return ["type", "title", "subtitle", "img"];
1003
1015
  }
@@ -1076,13 +1088,13 @@ class I extends HTMLElement {
1076
1088
  connectedCallback() {
1077
1089
  this.hd = this.shadowRoot.querySelector(".header"), this.hasAttribute("type") && this.hd.classList.add(this.getAttribute("type"));
1078
1090
  }
1079
- attributeChangedCallback(t, i, e) {
1080
- const r = this.shadowRoot.querySelector("h1"), n = this.shadowRoot.querySelector("p"), a = this.shadowRoot.querySelector(".img");
1081
- t === "title" && (r.textContent = e), t === "subtitle" && (n.textContent = e), t === "img" && (a.style.backgroundImage = e ? `url(${e})` : "");
1091
+ attributeChangedCallback(t, e, i) {
1092
+ const n = this.shadowRoot.querySelector("h1"), s = this.shadowRoot.querySelector("p"), r = this.shadowRoot.querySelector(".img");
1093
+ t === "title" && (n.textContent = i), t === "subtitle" && (s.textContent = i), t === "img" && (r.style.backgroundImage = i ? `url(${i})` : "");
1082
1094
  }
1083
1095
  }
1084
- customElements.define("eui-header", I);
1085
- class F extends HTMLElement {
1096
+ customElements.define("eui-header", B);
1097
+ class N extends HTMLElement {
1086
1098
  static get observedAttributes() {
1087
1099
  return ["selected"];
1088
1100
  }
@@ -1176,15 +1188,15 @@ class F extends HTMLElement {
1176
1188
  this.inputEl = this.shadowRoot.querySelector("input"), this.checkEl = this.shadowRoot.querySelector(".checkbox"), this.updateFromAttribute(), this.checkEl.addEventListener("click", () => this.toggle());
1177
1189
  }
1178
1190
  toggle() {
1179
- this.selected = !this.selected, x();
1180
- const t = this.selected, i = this.dataset.setting;
1181
- i && y.set(i, t);
1191
+ this.selected = !this.selected, w();
1192
+ const t = this.selected, e = this.dataset.setting;
1193
+ e && k.set(e, t);
1182
1194
  }
1183
1195
  updateFromAttribute() {
1184
1196
  const t = this.hasAttribute("selected");
1185
1197
  this.inputEl.checked = t, this.checkEl.classList.toggle("selected", t);
1186
1198
  }
1187
- attributeChangedCallback(t, i, e) {
1199
+ attributeChangedCallback(t, e, i) {
1188
1200
  t === "selected" && this.inputEl && this.updateFromAttribute();
1189
1201
  }
1190
1202
  get selected() {
@@ -1194,9 +1206,8 @@ class F extends HTMLElement {
1194
1206
  t ? this.setAttribute("selected", "") : this.removeAttribute("selected");
1195
1207
  }
1196
1208
  }
1197
- customElements.define("eui-checkbox", F);
1198
- class q extends HTMLElement {
1199
- static observedAttributes = ["type", "width", "height", "border-radius", "icon", "link", "href"];
1209
+ customElements.define("eui-checkbox", N);
1210
+ class E extends HTMLElement {
1200
1211
  constructor() {
1201
1212
  super(), this.attachShadow({ mode: "open" });
1202
1213
  }
@@ -1204,7 +1215,7 @@ class q extends HTMLElement {
1204
1215
  this.render();
1205
1216
  }
1206
1217
  render() {
1207
- const t = this.getAttribute("href"), i = t ? "a" : "button";
1218
+ const t = this.getAttribute("href"), e = t ? "a" : "button";
1208
1219
  this.shadowRoot.innerHTML = `
1209
1220
  <style>
1210
1221
  button, a {
@@ -1308,21 +1319,22 @@ class q extends HTMLElement {
1308
1319
  }
1309
1320
 
1310
1321
  </style>
1311
- <${i}>
1322
+ <${e}>
1312
1323
  <slot></slot>
1313
- </${i}>
1324
+ </${e}>
1314
1325
  `;
1315
- const e = this.shadowRoot.querySelector(i);
1316
- t && e.setAttribute("href", t), this.hasAttribute("type") && e.classList.add(this.getAttribute("type")), this.hasAttribute("icon") && e.classList.add("icon"), this.hasAttribute("width") && (e.style.width = this.getAttribute("width") + "px"), this.hasAttribute("height") && (e.style.height = this.getAttribute("height") + "px"), this.hasAttribute("border-radius") && (e.style.borderRadius = this.getAttribute("border-radius") + "px"), e.addEventListener("pointerdown", (r) => {
1317
- const n = document.createElement("span"), a = r.currentTarget, l = a.getBoundingClientRect(), c = Math.max(a.offsetWidth, a.offsetHeight), s = c / 2;
1318
- n.classList.add("ripple"), n.style.width = `${c}px`, n.style.height = `${c}px`, n.style.left = `${r.clientX - l.left - s}px`, n.style.top = `${r.clientY - l.top - s}px`, e.appendChild(n), n.addEventListener("animationend", () => {
1319
- n.remove();
1326
+ const i = this.shadowRoot.querySelector(e);
1327
+ t && i.setAttribute("href", t), this.hasAttribute("type") && i.classList.add(this.getAttribute("type")), this.hasAttribute("icon") && i.classList.add("icon"), this.hasAttribute("width") && (i.style.width = this.getAttribute("width") + "px"), this.hasAttribute("height") && (i.style.height = this.getAttribute("height") + "px"), this.hasAttribute("border-radius") && (i.style.borderRadius = this.getAttribute("border-radius") + "px"), i.addEventListener("pointerdown", (n) => {
1328
+ const s = document.createElement("span"), r = n.currentTarget, c = r.getBoundingClientRect(), d = Math.max(r.offsetWidth, r.offsetHeight), a = d / 2;
1329
+ s.classList.add("ripple"), s.style.width = `${d}px`, s.style.height = `${d}px`, s.style.left = `${n.clientX - c.left - a}px`, s.style.top = `${n.clientY - c.top - a}px`, i.appendChild(s), s.addEventListener("animationend", () => {
1330
+ s.remove();
1320
1331
  });
1321
1332
  });
1322
1333
  }
1323
1334
  }
1324
- customElements.define("eui-button", q);
1325
- class j extends HTMLElement {
1335
+ v(E, "observedAttributes", ["type", "width", "height", "border-radius", "icon", "link", "href"]);
1336
+ customElements.define("eui-button", E);
1337
+ class O extends HTMLElement {
1326
1338
  static get observedAttributes() {
1327
1339
  return ["type", "anchor"];
1328
1340
  }
@@ -1394,32 +1406,32 @@ class j extends HTMLElement {
1394
1406
  `;
1395
1407
  }
1396
1408
  }
1397
- customElements.define("eui-heading", j);
1398
- function N(o) {
1399
- const e = Date.now() - o, r = Math.floor(e / 1e3), n = Math.floor(r / 60), a = Math.floor(n / 60), l = Math.floor(a / 24), c = Math.floor(l / 30), s = Math.floor(c / 12);
1400
- return s > 0 ? `${s}y` : c > 0 ? `${c}mo` : l > 0 ? `${l}d` : a > 0 ? `${a}h` : n > 0 ? `${n}m` : `${r}s`;
1409
+ customElements.define("eui-heading", O);
1410
+ function P(o) {
1411
+ const i = Date.now() - o, n = Math.floor(i / 1e3), s = Math.floor(n / 60), r = Math.floor(s / 60), c = Math.floor(r / 24), d = Math.floor(c / 30), a = Math.floor(d / 12);
1412
+ return a > 0 ? `${a}y` : d > 0 ? `${d}mo` : c > 0 ? `${c}d` : r > 0 ? `${r}h` : s > 0 ? `${s}m` : `${n}s`;
1401
1413
  }
1402
- function B(o) {
1403
- const e = Date.now() - o, r = Math.floor(e / 1e3), n = Math.floor(r / 60), a = Math.floor(n / 60), l = Math.floor(a / 24), c = Math.floor(l / 30), s = Math.floor(c / 12);
1404
- return s > 0 ? `${s} year${s > 1 ? "s" : ""} ago` : c > 0 ? `${c} month${c > 1 ? "s" : ""} ago` : l > 0 ? `${l} day${l > 1 ? "s" : ""} ago` : a > 0 ? `${a} hour${a > 1 ? "s" : ""} ago` : n > 0 ? `${n} minute${n > 1 ? "s" : ""} ago` : `${r} second${r > 1 ? "s" : ""} ago`;
1414
+ function V(o) {
1415
+ const i = Date.now() - o, n = Math.floor(i / 1e3), s = Math.floor(n / 60), r = Math.floor(s / 60), c = Math.floor(r / 24), d = Math.floor(c / 30), a = Math.floor(d / 12);
1416
+ return a > 0 ? `${a} year${a > 1 ? "s" : ""} ago` : d > 0 ? `${d} month${d > 1 ? "s" : ""} ago` : c > 0 ? `${c} day${c > 1 ? "s" : ""} ago` : r > 0 ? `${r} hour${r > 1 ? "s" : ""} ago` : s > 0 ? `${s} minute${s > 1 ? "s" : ""} ago` : `${n} second${n > 1 ? "s" : ""} ago`;
1405
1417
  }
1406
- function O(o) {
1418
+ function D(o) {
1407
1419
  return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;").replace(/`/g, "&#96;").replace(/'/g, "&#39;");
1408
1420
  }
1409
- function E(o) {
1421
+ function A(o) {
1410
1422
  const t = document.createElement("input");
1411
1423
  t.value = o, document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t);
1412
1424
  }
1413
- const Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1425
+ const Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1414
1426
  __proto__: null,
1415
- copystr: E,
1416
- joinedAgo: B,
1417
- sanitize: O,
1418
- timeAgo: N
1427
+ copystr: A,
1428
+ joinedAgo: V,
1429
+ sanitize: D,
1430
+ timeAgo: P
1419
1431
  }, Symbol.toStringTag, { value: "Module" }));
1420
- class P extends HTMLElement {
1432
+ class U extends HTMLElement {
1421
1433
  static get observedAttributes() {
1422
- return ["copy", "id", "type"];
1434
+ return ["copy", "id", "type", "language"];
1423
1435
  }
1424
1436
  constructor() {
1425
1437
  super(), this.attachShadow({ mode: "open" }), this._boundCopy = this._onCopy.bind(this), this._isRendered = !1;
@@ -1427,8 +1439,11 @@ class P extends HTMLElement {
1427
1439
  connectedCallback() {
1428
1440
  this._isRendered || (this.render(), this._isRendered = !0);
1429
1441
  }
1442
+ attributeChangedCallback(t, e, i) {
1443
+ this._isRendered && e !== i && this.render();
1444
+ }
1430
1445
  render() {
1431
- const t = this.hasAttribute("copy");
1446
+ const t = this.hasAttribute("copy"), e = this.getAttribute("language") || "text";
1432
1447
  this.shadowRoot.innerHTML = `
1433
1448
  <style>
1434
1449
  :host {
@@ -1441,46 +1456,88 @@ class P extends HTMLElement {
1441
1456
  background: var(--app-100);
1442
1457
  border: 1px solid var(--app-300);
1443
1458
  border-radius: 20px;
1444
- font-family: 'Reddit Mono', consolas;
1459
+ font-family: 'Reddit Mono', monospace;
1460
+ font-size: 14px;
1445
1461
  overflow-x: auto;
1446
- line-height: 1.25;
1462
+ line-height: 1.5;
1447
1463
  white-space: pre;
1464
+ color: var(--app-text);
1448
1465
  }
1449
1466
 
1450
1467
  .copy {
1451
1468
  position: absolute;
1452
1469
  top: 8px;
1453
1470
  right: 8px;
1471
+ opacity: 0;
1472
+ transition: opacity 0.2s;
1454
1473
  }
1474
+
1475
+ :host(:hover) .copy {
1476
+ opacity: 1;
1477
+ }
1478
+
1455
1479
  pre.g {
1456
1480
  padding-right: 60px;
1457
1481
  }
1482
+
1483
+ .token.comment { color: var(--app-700); font-style: italic; }
1484
+ .token.string { color: #9ECE6A; }
1485
+ .token.number { color: #F97C5F; }
1486
+ .token.keyword { color: #7DCFFF; }
1487
+ .token.function { color: #7DCFFF; }
1488
+ .token.tag { color: #DE5971; }
1489
+ .token.attr-name { color: #BB9AF7; }
1490
+ .token.attr-value { color: #9ECE6A; }
1491
+ .token.boolean { color: #F97C5F; }
1458
1492
  </style>
1459
1493
 
1460
- <eui-button class="copy" width="45" height="45" border-radius="100">
1461
- <eui-icon name="copy" width="24" height="24"></eui-icon>
1494
+ <eui-button class="copy" width="36" height="36" border-radius="100">
1495
+ <eui-icon name="copy" width="18" height="18"></eui-icon>
1462
1496
  </eui-button>
1463
1497
 
1464
1498
  <pre class="${t ? "g" : ""}"><code></code></pre>
1465
- `, this.copyBtn = this.shadowRoot.querySelector(".copy"), this.codeEl = this.shadowRoot.querySelector("code"), this.codeEl.textContent = this._getFormattedText(), t ? this.copyBtn.addEventListener("click", this._boundCopy) : this.copyBtn.style.display = "none";
1499
+ `, this.copyBtn = this.shadowRoot.querySelector(".copy"), this.codeEl = this.shadowRoot.querySelector("code");
1500
+ const i = this._getFormattedText();
1501
+ this.codeEl.innerHTML = this._highlight(i, e), t ? this.copyBtn.addEventListener("click", this._boundCopy) : this.copyBtn.style.display = "none";
1466
1502
  }
1467
1503
  _getFormattedText() {
1468
- let t = this.textContent || "";
1469
- t = t.replace(/^\s*\n/, "").replace(/\n\s*$/, ""), t = t.replace(/[ \t]+$/gm, "");
1470
- const i = t.split(`
1471
- `), e = i.filter((n) => n.trim()).map((n) => n.match(/^\s*/)[0].length), r = e.length ? Math.min(...e) : 0;
1472
- return t = i.map((n) => n.slice(r)).join(`
1473
- `), t;
1504
+ let e = (this.querySelector("code") || this).innerHTML || "";
1505
+ e = this._unescapeHtml(e), e = e.replace(/^\s*\n/, "").replace(/\n\s*$/, "");
1506
+ const i = e.split(`
1507
+ `), n = i.filter((r) => r.trim()).map((r) => r.match(/^\s*/)[0].length), s = n.length ? Math.min(...n) : 0;
1508
+ return i.map((r) => r.slice(s)).join(`
1509
+ `);
1510
+ }
1511
+ _unescapeHtml(t) {
1512
+ const e = document.createElement("textarea");
1513
+ return e.innerHTML = t, e.value;
1514
+ }
1515
+ _highlight(t, e) {
1516
+ t = t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1517
+ const i = {};
1518
+ let n = 0;
1519
+ function s(r, c) {
1520
+ const d = `__TOKEN_${c}_${n++}__`;
1521
+ return i[d] = `<span class="token ${c}">${r}</span>`, d;
1522
+ }
1523
+ return ["javascript", "js", "json", "bash", "sh", "css"].includes(e) ? (t = t.replace(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/g, (r) => s(r, "string")), e === "bash" || e === "sh" ? t = t.replace(/(#.*$)/gm, (r) => s(r, "comment")) : e === "css" ? t = t.replace(/(\/\*[\s\S]*?\*\/)/g, (r) => s(r, "comment")) : t = t.replace(/(\/\/.*$|\/\*[\s\S]*?\*\/)/gm, (r) => s(r, "comment"))) : ["html", "xml"].includes(e) && (t = t.replace(/(&lt;!--[\s\S]*?--&gt;)/g, (r) => s(r, "comment")), t = t.replace(/(&lt;\/?[a-z0-9:-]+)/gi, (r) => s(r, "tag"))), e === "javascript" || e === "js" || e === "json" ? (t = t.replace(/\b(const|let|var|if|else|for|while|return|function|class|import|export|from|default|switch|case|break|continue|new|this|async|await)\b/g, '<span class="token keyword">$1</span>'), t = t.replace(/\b(true|false|null|undefined)\b/g, '<span class="token boolean">$1</span>'), t = t.replace(/\b([a-zA-Z0-9_]+)\s*(?=\()/g, '<span class="token function">$1</span>')) : e === "bash" || e === "sh" ? (t = t.replace(/\b(npm|npx|node|git|cd|ls|mkdir|rm|mv|cp|echo|cat|sudo|docker|brew|grep|curl|wget|chmod|chown|touch)\b/g, '<span class="token keyword">$1</span>'), t = t.replace(/\b(install|run|build|start|test|dev|init|clone|pull|push|commit|add|checkout|branch|merge)\b/g, '<span class="token function">$1</span>'), t = t.replace(/(\s-+[a-zA-Z0-9-]+)/g, '<span class="token attr-name">$1</span>'), t = t.replace(/(\$[A-Z0-9_]+)/g, '<span class="token number">$1</span>')) : e === "html" || e === "xml" ? (t = t.replace(/\s([a-z0-9:-]+)=/gi, (r, c) => " " + s(c, "attr-name") + "="), t = t.replace(/(".*?")/g, (r) => s(r, "attr-value")), t = t.replace(/&gt;/g, '<span class="token tag">&gt;</span>')) : e === "css" && (t = t.replace(/([a-z-]+)(?=:)/g, '<span class="token keyword">$1</span>')), Object.keys(i).reverse().forEach((r) => {
1524
+ t = t.replace(r, i[r]);
1525
+ }), t;
1474
1526
  }
1475
1527
  _onCopy() {
1476
- E(this._getFormattedText());
1528
+ A(this._getFormattedText());
1529
+ const t = this.copyBtn.querySelector("eui-icon");
1530
+ if (t) {
1531
+ const e = t.getAttribute("name");
1532
+ t.setAttribute("name", "check"), setTimeout(() => t.setAttribute("name", e), 2e3);
1533
+ }
1477
1534
  }
1478
1535
  disconnectedCallback() {
1479
1536
  this.copyBtn && this.copyBtn.removeEventListener("click", this._boundCopy);
1480
1537
  }
1481
1538
  }
1482
- customElements.define("eui-code", P);
1483
- class U extends HTMLElement {
1539
+ customElements.define("eui-code", U);
1540
+ class Z extends HTMLElement {
1484
1541
  constructor() {
1485
1542
  super(), this.attachShadow({ mode: "open" });
1486
1543
  }
@@ -1490,7 +1547,7 @@ class U extends HTMLElement {
1490
1547
  static get observedAttributes() {
1491
1548
  return ["name"];
1492
1549
  }
1493
- attributeChangedCallback(t, i, e) {
1550
+ attributeChangedCallback(t, e, i) {
1494
1551
  t === "name" && (this.render(), this.setupEventListeners());
1495
1552
  }
1496
1553
  setupEventListeners() {
@@ -1596,8 +1653,8 @@ class U extends HTMLElement {
1596
1653
  `;
1597
1654
  }
1598
1655
  }
1599
- customElements.define("eui-app-titlebar", U);
1600
- class D extends HTMLElement {
1656
+ customElements.define("eui-app-titlebar", Z);
1657
+ class X extends HTMLElement {
1601
1658
  constructor() {
1602
1659
  super(), this.attachShadow({ mode: "open" }), this._handleMouseDown = this._addRipple.bind(this);
1603
1660
  }
@@ -1607,16 +1664,16 @@ class D extends HTMLElement {
1607
1664
  static get observedAttributes() {
1608
1665
  return ["elevated", "interactive", "ripple"];
1609
1666
  }
1610
- attributeChangedCallback(t, i, e) {
1611
- i !== e && t === "ripple" && this.setupEventListeners();
1667
+ attributeChangedCallback(t, e, i) {
1668
+ e !== i && t === "ripple" && this.setupEventListeners();
1612
1669
  }
1613
1670
  setupEventListeners() {
1614
1671
  this.removeEventListener("mousedown", this._handleMouseDown), this.hasAttribute("ripple") && this.addEventListener("mousedown", this._handleMouseDown);
1615
1672
  }
1616
1673
  _addRipple(t) {
1617
- const i = this.getBoundingClientRect(), e = document.createElement("span"), r = Math.max(i.width, i.height), n = r / 2;
1618
- e.style.width = e.style.height = `${r}px`, e.style.left = `${t.clientX - i.left - n}px`, e.style.top = `${t.clientY - i.top - n}px`, e.classList.add("ripple"), this.shadowRoot.querySelector(".surface").appendChild(e), e.addEventListener("animationend", () => {
1619
- e.remove();
1674
+ const e = this.getBoundingClientRect(), i = document.createElement("span"), n = Math.max(e.width, e.height), s = n / 2;
1675
+ i.style.width = i.style.height = `${n}px`, i.style.left = `${t.clientX - e.left - s}px`, i.style.top = `${t.clientY - e.top - s}px`, i.classList.add("ripple"), this.shadowRoot.querySelector(".surface").appendChild(i), i.addEventListener("animationend", () => {
1676
+ i.remove();
1620
1677
  });
1621
1678
  }
1622
1679
  render() {
@@ -1684,14 +1741,14 @@ class D extends HTMLElement {
1684
1741
  `;
1685
1742
  }
1686
1743
  }
1687
- customElements.define("eui-surface", D);
1744
+ customElements.define("eui-surface", X);
1688
1745
  typeof window < "u" && console.log("ErisUI loaded successfully");
1689
1746
  export {
1690
- X as device,
1691
- W as haptics,
1692
- b as icons,
1693
- V as loadPage,
1694
- k as router,
1695
- J as storage,
1696
- Y as utils
1747
+ J as device,
1748
+ K as haptics,
1749
+ u as icons,
1750
+ G as loadPage,
1751
+ C as router,
1752
+ Y as storage,
1753
+ Q as utils
1697
1754
  };