voodoojs 0.4.6 → 0.6.0

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.
@@ -3387,7 +3387,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3387
3387
  // src/store/index.ts
3388
3388
  init_reactivity();
3389
3389
  var stores = /* @__PURE__ */ new Map();
3390
- var versao = ref(0);
3390
+ var version = ref(0);
3391
3391
  var persistHandles = /* @__PURE__ */ new Map();
3392
3392
  function store(name, definition, options = {}) {
3393
3393
  const existing = stores.get(name);
@@ -3404,30 +3404,30 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3404
3404
  return existing;
3405
3405
  }
3406
3406
  const key = typeof options.persist === "string" ? options.persist : `voodoo:store:${name}`;
3407
- const descritores = Object.getOwnPropertyDescriptors(definition);
3408
- const initial = Object.defineProperties({}, descritores);
3407
+ const descriptors = Object.getOwnPropertyDescriptors(definition);
3408
+ const initial = Object.defineProperties({}, descriptors);
3409
3409
  if (options.persist && typeof localStorage !== "undefined") {
3410
3410
  try {
3411
3411
  const saved = localStorage.getItem(key);
3412
3412
  if (saved) {
3413
- const salvo = JSON.parse(saved);
3414
- for (const [chave, valor] of Object.entries(salvo)) {
3415
- if (descritores[chave] && !("value" in descritores[chave])) continue;
3416
- initial[chave] = valor;
3413
+ const parsed = JSON.parse(saved);
3414
+ for (const [field, value] of Object.entries(parsed)) {
3415
+ if (descriptors[field] && !("value" in descriptors[field])) continue;
3416
+ initial[field] = value;
3417
3417
  }
3418
3418
  }
3419
3419
  } catch (e) {
3420
3420
  }
3421
3421
  }
3422
3422
  const created = reactive(initial);
3423
- for (const [prop, descritor] of Object.entries(descritores)) {
3424
- const value = descritor.value;
3423
+ for (const [prop, descriptor] of Object.entries(descriptors)) {
3424
+ const value = descriptor.value;
3425
3425
  if (typeof value === "function") {
3426
3426
  created[prop] = (...args) => value.apply(created, args);
3427
3427
  }
3428
3428
  }
3429
3429
  stores.set(name, created);
3430
- versao.value++;
3430
+ version.value++;
3431
3431
  if (options.persist && typeof localStorage !== "undefined") {
3432
3432
  const stop2 = watch(
3433
3433
  created,
@@ -3445,10 +3445,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3445
3445
  }
3446
3446
  function stripFunctions(source) {
3447
3447
  const out = {};
3448
- const descritores = Object.getOwnPropertyDescriptors(toRaw(source));
3448
+ const descriptors = Object.getOwnPropertyDescriptors(toRaw(source));
3449
3449
  for (const [key, value] of Object.entries(source)) {
3450
3450
  if (typeof value === "function") continue;
3451
- if (descritores[key] && !("value" in descritores[key])) continue;
3451
+ if (descriptors[key] && !("value" in descriptors[key])) continue;
3452
3452
  out[key] = value;
3453
3453
  }
3454
3454
  return out;
@@ -3457,11 +3457,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
3457
3457
  {},
3458
3458
  {
3459
3459
  get: (_t, key) => {
3460
- void versao.value;
3460
+ void version.value;
3461
3461
  return stores.get(key);
3462
3462
  },
3463
3463
  has: (_t, key) => {
3464
- void versao.value;
3464
+ void version.value;
3465
3465
  return stores.has(key);
3466
3466
  },
3467
3467
  ownKeys: () => [...stores.keys()],
@@ -4404,6 +4404,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4404
4404
  element.setAttribute("data-type", type);
4405
4405
  element.setAttribute("role", type === "error" ? "alert" : "status");
4406
4406
  element.setAttribute("aria-live", type === "error" ? "assertive" : "polite");
4407
+ element.setAttribute("aria-atomic", "true");
4407
4408
  let closed = false;
4408
4409
  let timer = null;
4409
4410
  const close = () => {
@@ -4735,11 +4736,12 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4735
4736
  }
4736
4737
  };
4737
4738
  var THEME_KEY = "voodoo:theme";
4739
+ var picked = null;
4738
4740
  var theme = {
4739
4741
  /** Theme chosen by the user, or `system` when never set. */
4740
4742
  get current() {
4741
- var _a2;
4742
- return (_a2 = storage.get(THEME_KEY)) != null ? _a2 : "system";
4743
+ var _a2, _b;
4744
+ return (_b = (_a2 = storage.get(THEME_KEY)) != null ? _a2 : picked) != null ? _b : "system";
4743
4745
  },
4744
4746
  /** Theme effectively applied, resolving `system`. */
4745
4747
  get resolved() {
@@ -4749,6 +4751,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4749
4751
  return matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
4750
4752
  },
4751
4753
  set(value) {
4754
+ picked = value;
4752
4755
  storage.set(THEME_KEY, value);
4753
4756
  this.apply();
4754
4757
  },
@@ -4759,7 +4762,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4759
4762
  },
4760
4763
  /** `true` once the visitor has actually picked a theme. */
4761
4764
  get chosen() {
4762
- return storage.get(THEME_KEY) != null;
4765
+ return picked !== null || storage.get(THEME_KEY) != null;
4763
4766
  },
4764
4767
  /** Writes `data-theme` on the root element and notifies the page. */
4765
4768
  apply() {
@@ -4783,7 +4786,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
4783
4786
  init() {
4784
4787
  if (typeof document === "undefined") return;
4785
4788
  this.apply();
4786
- matchMedia == null ? void 0 : matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
4789
+ if (typeof matchMedia === "undefined") return;
4790
+ matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
4787
4791
  if (this.current === "system") this.apply();
4788
4792
  });
4789
4793
  }
@@ -5233,8 +5237,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5233
5237
  defineDirective("text", ({ el, effect: effect2, evaluate: ev }) => {
5234
5238
  effect2(() => {
5235
5239
  el.textContent = stringify(ev());
5236
- const primeiro = el.firstChild;
5237
- if (primeiro && primeiro.nodeType === 3) markInitialized(primeiro);
5240
+ const first = el.firstChild;
5241
+ if (first && first.nodeType === 3) markInitialized(first);
5238
5242
  });
5239
5243
  });
5240
5244
  defineDirective("html", (ctx) => {
@@ -5440,10 +5444,10 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5440
5444
  next.push({ key, scope: childScope, nodes, data: childScope.data });
5441
5445
  });
5442
5446
  if (batch.fragment.firstChild) (_a3 = anchor.parentNode) == null ? void 0 : _a3.insertBefore(batch.fragment, anchor);
5443
- for (const [node, escopo] of batch.pending) walk(node, escopo);
5444
- const reaproveitados = new Set(next);
5447
+ for (const [node, rowScope] of batch.pending) walk(node, rowScope);
5448
+ const reused = new Set(next);
5445
5449
  for (const block2 of blocks) {
5446
- if (used.has(block2.key) && reaproveitados.has(block2)) continue;
5450
+ if (used.has(block2.key) && reused.has(block2)) continue;
5447
5451
  for (const node of block2.nodes) {
5448
5452
  destroy(node);
5449
5453
  node.remove();
@@ -5513,7 +5517,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5513
5517
  "novalidate",
5514
5518
  "inert"
5515
5519
  ]);
5516
- var ATRIBUTOS_DE_URL = /* @__PURE__ */ new Set([
5520
+ var URL_ATTRIBUTES = /* @__PURE__ */ new Set([
5517
5521
  "href",
5518
5522
  "src",
5519
5523
  "action",
@@ -5522,15 +5526,15 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5522
5526
  "ping",
5523
5527
  "poster"
5524
5528
  ]);
5525
- var RUIDO_DE_ESQUEMA = /[\s\x00-\x1f]/g;
5526
- function urlPerigosa(valor) {
5527
- const limpo = valor.replace(RUIDO_DE_ESQUEMA, "").toLowerCase();
5528
- return limpo.startsWith("javascript:") || limpo.startsWith("vbscript:") || limpo.startsWith("data:text/html") || limpo.startsWith("data:application/xhtml");
5529
+ var SCHEME_NOISE = /[\s\x00-\x1f]/g;
5530
+ function isDangerousUrl(value) {
5531
+ const clean = value.replace(SCHEME_NOISE, "").toLowerCase();
5532
+ return clean.startsWith("javascript:") || clean.startsWith("vbscript:") || clean.startsWith("data:text/html") || clean.startsWith("data:application/xhtml");
5529
5533
  }
5530
- function applyBinding(el, name, value, asProp = false, perigoLiberado = false) {
5534
+ function applyBinding(el, name, value, asProp = false, allowDangerous = false) {
5531
5535
  if (name === "class") return applyClass(el, value);
5532
5536
  if (name === "style") return applyStyle(el, value);
5533
- if (config.sanitizeUrls && !perigoLiberado && name === "srcdoc") {
5537
+ if (config.sanitizeUrls && !allowDangerous && name === "srcdoc") {
5534
5538
  warn2(
5535
5539
  `:srcdoc refused in ${describeElement(el)}: the value becomes a document with active script inside the iframe, the same way v-html becomes markup. If the content is trusted, write :srcdoc.dangerous="..."; to turn off this protection on the entire application, set V.config.sanitizeUrls = false.`
5536
5540
  );
@@ -5538,7 +5542,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5538
5542
  return;
5539
5543
  }
5540
5544
  if (config.sanitizeUrls && !asProp) {
5541
- if (ATRIBUTOS_DE_URL.has(name) && typeof value === "string" && urlPerigosa(value)) {
5545
+ if (URL_ATTRIBUTES.has(name) && typeof value === "string" && isDangerousUrl(value)) {
5542
5546
  warn2(
5543
5547
  `value refused in :${name} of ${describeElement(el)}: "${value.slice(0, 60)}" uses a scheme that executes code. Use an http(s) or relative address. To turn off this protection, set V.config.sanitizeUrls = false.`
5544
5548
  );
@@ -5635,9 +5639,9 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
5635
5639
  }
5636
5640
  if (arg === "key") return;
5637
5641
  const asProp = !!modifiers.prop;
5638
- const perigoLiberado = !!modifiers.dangerous;
5642
+ const allowDangerous = !!modifiers.dangerous;
5639
5643
  effect2(() => {
5640
- applyBinding(el, arg, ev(), asProp, perigoLiberado);
5644
+ applyBinding(el, arg, ev(), asProp, allowDangerous);
5641
5645
  });
5642
5646
  void expression;
5643
5647
  },
@@ -6572,7 +6576,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
6572
6576
  (ctx) => {
6573
6577
  var _a3, _b2;
6574
6578
  let oldValue;
6575
- let mounted = false;
6579
+ let mounted2 = false;
6576
6580
  const makeBinding = (value) => {
6577
6581
  var _a4, _b3;
6578
6582
  return {
@@ -6592,8 +6596,8 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
6592
6596
  ctx.effect(() => {
6593
6597
  var _a4, _b3;
6594
6598
  const value = hooks.raw ? ctx.expression : ctx.evaluate();
6595
- if (!mounted) {
6596
- mounted = true;
6599
+ if (!mounted2) {
6600
+ mounted2 = true;
6597
6601
  oldValue = value;
6598
6602
  (_a4 = hooks.mounted) == null ? void 0 : _a4.call(hooks, ctx.el, makeBinding(value));
6599
6603
  return;
@@ -6617,11 +6621,11 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
6617
6621
  Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
6618
6622
  return rootScope.data;
6619
6623
  }
6620
- var version = "0.4.6";
6624
+ var version2 = "0.4.6";
6621
6625
  var core = {
6622
6626
  // Utilities first: Voodoo's own names can override.
6623
6627
  ...utils_exports,
6624
- version,
6628
+ version: version2,
6625
6629
  config,
6626
6630
  // Reactivity
6627
6631
  reactive,
@@ -9992,7 +9996,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
9992
9996
  if (addedTabIndex) el.setAttribute("tabindex", "0");
9993
9997
  let bubble = null;
9994
9998
  let timer = null;
9995
- const build = () => {
9999
+ const build2 = () => {
9996
10000
  const node = document.createElement("div");
9997
10001
  node.className = "v-tooltip";
9998
10002
  node.setAttribute("role", "tooltip");
@@ -10006,7 +10010,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
10006
10010
  };
10007
10011
  const open = () => {
10008
10012
  if (bubble) return;
10009
- bubble = build();
10013
+ bubble = build2();
10010
10014
  el.setAttribute("aria-describedby", bubble.id);
10011
10015
  reposition();
10012
10016
  requestAnimationFrame(() => bubble == null ? void 0 : bubble.classList.add("v-in"));
@@ -11216,37 +11220,37 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
11216
11220
  init_registry();
11217
11221
  init_style();
11218
11222
  var messages = {
11219
- required: "Preencha este campo.",
11220
- email: "Informe um e-mail valido.",
11221
- url: "Informe uma URL valida.",
11222
- number: "Informe um numero valido.",
11223
- integer: "Informe um numero inteiro.",
11224
- decimal: "Informe um numero decimal valido.",
11225
- alpha: "Use apenas letras.",
11226
- alphanumeric: "Use apenas letras e numeros.",
11227
- minlength: "Use no minimo {param} caracteres.",
11228
- maxlength: "Use no maximo {param} caracteres.",
11229
- min: "O valor minimo e {param}.",
11230
- max: "O valor maximo e {param}.",
11231
- between: "Informe um valor entre {min} e {max}.",
11232
- match: "Os campos nao conferem.",
11233
- regex: "O formato informado nao e valido.",
11234
- date: "Informe uma data valida.",
11235
- after: "A data precisa ser posterior a {param}.",
11236
- before: "A data precisa ser anterior a {param}.",
11237
- accepted: "E preciso marcar esta opcao para continuar.",
11238
- same: "Os valores precisam ser iguais.",
11239
- different: "Os valores precisam ser diferentes.",
11240
- in: "Escolha uma das opcoes permitidas.",
11241
- notin: "Este valor nao e permitido.",
11242
- phone: "Informe um telefone valido com DDD.",
11243
- cpf: "CPF invalido.",
11244
- cnpj: "CNPJ invalido.",
11245
- cep: "CEP invalido.",
11246
- creditcard: "Numero de cartao invalido.",
11247
- strongpassword: "Use {param} caracteres ou mais, com maiuscula, minuscula, numero e simbolo.",
11248
- unique: "Este valor ja esta em uso.",
11249
- invalid: "Valor invalido."
11223
+ required: "Please fill in this field.",
11224
+ email: "Enter a valid email address.",
11225
+ url: "Enter a valid URL.",
11226
+ number: "Enter a valid number.",
11227
+ integer: "Enter a whole number.",
11228
+ decimal: "Enter a valid decimal number.",
11229
+ alpha: "Use letters only.",
11230
+ alphanumeric: "Use letters and numbers only.",
11231
+ minlength: "Use at least {param} characters.",
11232
+ maxlength: "Use at most {param} characters.",
11233
+ min: "The smallest allowed value is {param}.",
11234
+ max: "The largest allowed value is {param}.",
11235
+ between: "Enter a value between {min} and {max}.",
11236
+ match: "The fields do not match.",
11237
+ regex: "That format is not valid.",
11238
+ date: "Enter a valid date.",
11239
+ after: "The date has to be later than {param}.",
11240
+ before: "The date has to be earlier than {param}.",
11241
+ accepted: "You have to tick this to continue.",
11242
+ same: "The values have to be the same.",
11243
+ different: "The values have to be different.",
11244
+ in: "Choose one of the allowed options.",
11245
+ notin: "That value is not allowed.",
11246
+ phone: "Enter a valid phone number, including the area code.",
11247
+ cpf: "Invalid CPF.",
11248
+ cnpj: "Invalid CNPJ.",
11249
+ cep: "Invalid postcode.",
11250
+ creditcard: "Invalid card number.",
11251
+ strongpassword: "Use {param} characters or more, with an upper case letter, a lower case letter, a number and a symbol.",
11252
+ unique: "That value is already taken.",
11253
+ invalid: "Invalid value."
11250
11254
  };
11251
11255
  function formatMessage(template, data2) {
11252
11256
  var _a2, _b, _c, _d, _e, _f;
@@ -14683,7 +14687,7 @@ form.v-loading [type="submit"],form.v-loading button[disabled]{opacity:.6}
14683
14687
  const labels2 = fromOptions ? options.labels.map((label) => String(label)) : [];
14684
14688
  const series = [];
14685
14689
  const raw = options.data;
14686
- const singleName = (_a2 = options.name) != null ? _a2 : "Valor";
14690
+ const singleName = (_a2 = options.name) != null ? _a2 : "Value";
14687
14691
  if (typeof raw === "number") {
14688
14692
  series.push({ name: singleName, values: [raw], xs: null, color: palette2[0] });
14689
14693
  } else if (Array.isArray(raw) && raw.length > 0) {
@@ -15416,7 +15420,7 @@ form.v-loading [type="submit"],form.v-loading button[disabled]{opacity:.6}
15416
15420
  const palette2 = options.colors && options.colors.length > 0 ? options.colors : CHART_COLORS;
15417
15421
  const format = (_b = options.format) != null ? _b : "number";
15418
15422
  const width = Math.max(160, Math.round(el.clientWidth || options.width || 640));
15419
- const height = Math.max(48, Math.round((_c = options.height) != null ? _c : defaultHeight(type)));
15423
+ const height = Math.max(48, Math.round((_c = options.height) != null ? _c : el.clientHeight || defaultHeight(type)));
15420
15424
  state2.lastWidth = width;
15421
15425
  state2.viewWidth = width;
15422
15426
  state2.viewHeight = height;
@@ -16279,7 +16283,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16279
16283
  @keyframes v-shimmer{0%{background-position:-180% 0}100%{background-position:180% 0}}
16280
16284
  @keyframes v-indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}
16281
16285
 
16282
- /* ------------------------------------------------------------------ botao */
16286
+ /* ----------------------------------------------------------------- button */
16283
16287
  .v-btn{appearance:none;-webkit-appearance:none;position:relative;display:inline-flex;
16284
16288
  align-items:center;justify-content:center;gap:8px;vertical-align:middle;white-space:nowrap;
16285
16289
  font-family:var(--v-font-sans);font-weight:600;line-height:1;text-decoration:none;
@@ -16323,7 +16327,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16323
16327
  .v-btn-spin{width:1em;height:1em;border-radius:50%;border:2px solid currentColor;
16324
16328
  border-top-color:transparent;animation:v-spin .7s linear infinite;flex:none}
16325
16329
 
16326
- /* ------------------------------------------------------- botao de icone */
16330
+ /* ------------------------------------------------------------ icon button */
16327
16331
  .v-icon-btn{appearance:none;-webkit-appearance:none;display:inline-grid;place-items:center;
16328
16332
  border:1px solid transparent;border-radius:var(--v-radius-sm);cursor:pointer;
16329
16333
  font-family:var(--v-font-sans);
@@ -16368,7 +16372,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16368
16372
  .v-card-foot:empty{display:none}
16369
16373
  .v-card[data-padded="false"] .v-card-body{padding:0}
16370
16374
 
16371
- /* ------------------------------------------------------------ formulario */
16375
+ /* ------------------------------------------------------------------- form */
16372
16376
  .v-field{display:flex;flex-direction:column;gap:6px;font-family:var(--v-font-sans);min-width:0}
16373
16377
  .v-label{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;
16374
16378
  line-height:1.3;color:var(--v-text)}
@@ -16447,7 +16451,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16447
16451
  .v-select-opt.is-selected .v-select-check{opacity:1}
16448
16452
  .v-select-empty{padding:14px 10px;text-align:center;font-size:13.5px;color:var(--v-text-muted)}
16449
16453
 
16450
- /* -------------------------------------------- caixa, radio e interruptor */
16454
+ /* --------------------------------------------- checkbox, radio and switch */
16451
16455
  .v-check{display:inline-flex;align-items:flex-start;gap:9px;cursor:pointer;
16452
16456
  font-family:var(--v-font-sans);font-size:14px;line-height:1.45;color:var(--v-text)}
16453
16457
  .v-check[data-disabled="true"]{cursor:not-allowed;opacity:.6}
@@ -16484,7 +16488,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16484
16488
  .v-check[data-size="sm"] .v-switch-thumb{width:16px;height:16px}
16485
16489
  .v-check[data-size="sm"] .v-check-native:checked+.v-switch-track .v-switch-thumb{transform:translateX(14px)}
16486
16490
 
16487
- /* --------------------------------------------------- selo, etiqueta, alerta */
16491
+ /* ------------------------------------------------------ badge, tag, alert */
16488
16492
  .v-badge{display:inline-flex;align-items:center;gap:5px;font-family:var(--v-font-sans);
16489
16493
  font-weight:600;line-height:1;border-radius:var(--v-radius-full);border:1px solid transparent;
16490
16494
  white-space:nowrap;vertical-align:middle}
@@ -16561,7 +16565,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16561
16565
  .v-avatar-status[data-status="busy"]{background:var(--v-danger)}
16562
16566
  .v-avatar-status[data-status="away"]{background:var(--v-warning)}
16563
16567
 
16564
- /* ------------------------------------------------- spinner e esqueleto */
16568
+ /* --------------------------------------------------- spinner and skeleton */
16565
16569
  .v-spinner{display:inline-block;border-radius:50%;border-style:solid;border-color:var(--v-border);
16566
16570
  border-top-color:var(--v-primary);animation:v-spin .7s linear infinite;vertical-align:middle}
16567
16571
  .v-spinner[data-tone="accent"]{border-top-color:var(--v-accent)}
@@ -16578,7 +16582,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16578
16582
  .v-skeleton[data-circle="true"]{border-radius:var(--v-radius-full)}
16579
16583
  .v-skeleton-stack{display:flex;flex-direction:column;gap:8px}
16580
16584
 
16581
- /* ------------------------------------------------------------- progresso */
16585
+ /* --------------------------------------------------------------- progress */
16582
16586
  .v-progress{font-family:var(--v-font-sans);display:flex;flex-direction:column;gap:6px}
16583
16587
  .v-progress-head{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:var(--v-text-muted)}
16584
16588
  .v-progress-value{font-weight:650;color:var(--v-text)}
@@ -16595,7 +16599,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16595
16599
  .v-progress[data-tone="danger"] .v-progress-bar{background:var(--v-danger)}
16596
16600
  .v-progress[data-indeterminate="true"] .v-progress-bar{width:30% !important;animation:v-indeterminate 1.3s var(--v-ease) infinite}
16597
16601
 
16598
- /* ------------------------------------------------------------- divisor */
16602
+ /* ---------------------------------------------------------------- divider */
16599
16603
  .v-divider{display:flex;align-items:center;gap:12px;color:var(--v-text-soft);
16600
16604
  font-family:var(--v-font-sans);font-size:12.5px;font-weight:600;margin:16px 0}
16601
16605
  .v-divider::before,.v-divider::after{content:"";flex:1;height:1px;background:var(--v-border)}
@@ -16603,7 +16607,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16603
16607
  .v-divider[data-vertical="true"]{flex-direction:column;margin:0 16px;align-self:stretch;height:auto}
16604
16608
  .v-divider[data-vertical="true"]::before,.v-divider[data-vertical="true"]::after{width:1px;height:auto;flex:1}
16605
16609
 
16606
- /* -------------------------------------------------------------- tabela */
16610
+ /* ------------------------------------------------------------------ table */
16607
16611
  .v-table-wrap{width:100%;overflow-x:auto;background:var(--v-surface);border:1px solid var(--v-border);
16608
16612
  border-radius:var(--v-radius);font-family:var(--v-font-sans)}
16609
16613
  .v-table{width:100%;border-collapse:collapse;font-size:14px;color:var(--v-text)}
@@ -16624,7 +16628,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16624
16628
  .v-th[aria-sort="ascending"] .v-th-arrow,.v-th[aria-sort="descending"] .v-th-arrow{opacity:1;color:var(--v-primary)}
16625
16629
  .v-table-empty{text-align:center;color:var(--v-text-muted);padding:34px 14px;font-size:14px}
16626
16630
 
16627
- /* ---------------------------------------------------------- paginacao */
16631
+ /* ------------------------------------------------------------- pagination */
16628
16632
  .v-pagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-family:var(--v-font-sans)}
16629
16633
  .v-page{appearance:none;min-width:34px;height:34px;padding:0 9px;display:inline-grid;place-items:center;
16630
16634
  background:transparent;border:1px solid transparent;border-radius:var(--v-radius-sm);
@@ -16636,7 +16640,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16636
16640
  .v-page[aria-current="page"]{background:var(--v-primary);border-color:var(--v-primary);color:var(--v-primary-contrast)}
16637
16641
  .v-page-gap{min-width:24px;text-align:center;color:var(--v-text-soft);user-select:none}
16638
16642
 
16639
- /* ----------------------------------------------------------- migalhas */
16643
+ /* ------------------------------------------------------------- breadcrumb */
16640
16644
  .v-breadcrumb{font-family:var(--v-font-sans);font-size:13.5px}
16641
16645
  .v-breadcrumb-list{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0}
16642
16646
  .v-breadcrumb-item{display:inline-flex;align-items:center;gap:6px;color:var(--v-text-muted)}
@@ -16646,7 +16650,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16646
16650
  .v-breadcrumb-item[aria-current="page"]{color:var(--v-text);font-weight:600}
16647
16651
  .v-breadcrumb-sep{color:var(--v-text-soft);user-select:none}
16648
16652
 
16649
- /* ------------------------------------------------------------ metrica */
16653
+ /* ------------------------------------------------------------------- stat */
16650
16654
  .v-stat{display:flex;gap:14px;align-items:flex-start;padding:16px 18px;background:var(--v-surface);
16651
16655
  border:1px solid var(--v-border);border-radius:var(--v-radius);font-family:var(--v-font-sans)}
16652
16656
  .v-stat-icon{flex:none;width:40px;height:40px;display:grid;place-items:center;font-size:19px;
@@ -16664,7 +16668,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16664
16668
  .v-stat-delta[data-dir="flat"]{background:var(--v-surface-3);color:var(--v-text-muted)}
16665
16669
  .v-stat-hint{font-size:12.5px;color:var(--v-text-muted)}
16666
16670
 
16667
- /* ------------------------------------------------------- estado vazio */
16671
+ /* ------------------------------------------------------------ empty state */
16668
16672
  .v-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;
16669
16673
  padding:44px 22px;font-family:var(--v-font-sans);color:var(--v-text)}
16670
16674
  .v-empty-icon{width:58px;height:58px;display:grid;place-items:center;font-size:27px;
@@ -16674,7 +16678,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16674
16678
  .v-empty-actions{margin-top:6px;display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
16675
16679
  .v-empty-actions:empty{display:none}
16676
16680
 
16677
- /* ----------------------------------------------------------- linha do tempo */
16681
+ /* --------------------------------------------------------------- timeline */
16678
16682
  .v-timeline{list-style:none;margin:0;padding:0;font-family:var(--v-font-sans);
16679
16683
  display:flex;flex-direction:column}
16680
16684
  .v-timeline-item{position:relative;display:flex;gap:14px;padding-bottom:20px}
@@ -16694,7 +16698,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16694
16698
  .v-timeline-desc{margin:3px 0 0;font-size:13.5px;line-height:1.55;color:var(--v-text-muted)}
16695
16699
  .v-timeline-time{display:block;margin-top:3px;font-size:12px;color:var(--v-text-soft)}
16696
16700
 
16697
- /* ---------------------------------------------------------------- passos */
16701
+ /* ------------------------------------------------------------------ steps */
16698
16702
  .v-steps{display:flex;gap:0;font-family:var(--v-font-sans);list-style:none;margin:0;padding:0}
16699
16703
  .v-steps[data-vertical="true"]{flex-direction:column;gap:4px}
16700
16704
  .v-step{flex:1;display:flex;align-items:flex-start;gap:10px;min-width:0;position:relative;padding-right:12px}
@@ -16713,7 +16717,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16713
16717
  .v-steps[data-vertical="true"] .v-step-line{left:13px;right:auto;top:30px;bottom:2px;width:2px;height:auto}
16714
16718
  .v-step:last-child .v-step-line{display:none}
16715
16719
 
16716
- /* ------------------------------------------------------------ avaliacao */
16720
+ /* ----------------------------------------------------------------- rating */
16717
16721
  .v-rating{display:inline-flex;align-items:center;gap:6px;font-family:var(--v-font-sans)}
16718
16722
  .v-rating-stars{display:inline-flex;gap:2px}
16719
16723
  .v-star{appearance:none;background:none;border:0;padding:2px;cursor:pointer;line-height:0;
@@ -16740,7 +16744,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
16740
16744
  .v-tip[data-placement="right"]{left:calc(100% + 8px);top:50%;translate:0 -50%}
16741
16745
  .v-tipwrap:hover .v-tip,.v-tipwrap:focus-within .v-tip{opacity:1;transform:none}
16742
16746
 
16743
- /* ------------------------------------------------------------ codigo */
16747
+ /* ------------------------------------------------------------------- code */
16744
16748
  .v-code{position:relative;background:var(--v-surface-inset);border:1px solid var(--v-border);
16745
16749
  border-radius:var(--v-radius);overflow:hidden;font-family:var(--v-font-mono)}
16746
16750
  .v-code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;
@@ -17753,7 +17757,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17753
17757
  props: {
17754
17758
  columns: { type: "any", default: "" },
17755
17759
  rows: { type: "any", default: "" },
17756
- empty: { type: "string", default: "Nenhum registro encontrado" },
17760
+ empty: { type: "string", default: "No records found" },
17757
17761
  sortable: { type: "any", default: true },
17758
17762
  dense: BOOL,
17759
17763
  striped: BOOL,
@@ -17865,9 +17869,9 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17865
17869
  total: { type: "number", default: 0 },
17866
17870
  perPage: { type: "number", default: 10 },
17867
17871
  siblings: { type: "number", default: 1 },
17868
- previousLabel: { type: "string", default: "Anterior" },
17869
- nextLabel: { type: "string", default: "Pr\xF3xima" },
17870
- ariaLabel: { type: "string", default: "Pagina\xE7\xE3o" }
17872
+ previousLabel: { type: "string", default: "Previous" },
17873
+ nextLabel: { type: "string", default: "Next" },
17874
+ ariaLabel: { type: "string", default: "Pagination" }
17871
17875
  },
17872
17876
  computed: {
17873
17877
  lastPage() {
@@ -17881,7 +17885,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17881
17885
  const value = Number(this.page) || 1;
17882
17886
  return Math.min(Math.max(1, Math.round(value)), this.lastPage);
17883
17887
  },
17884
- /** Numeros visiveis, com `0` marcando as reticencias. */
17888
+ /** Visible page numbers, with `0` marking the ellipsis. */
17885
17889
  items() {
17886
17890
  const last = this.lastPage;
17887
17891
  const current2 = this.currentPage;
@@ -17926,7 +17930,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17926
17930
  <template v-for="(item, index) in items" :key="index">
17927
17931
  <span class="v-page-gap" v-if="item === 0" aria-hidden="true">...</span>
17928
17932
  <button type="button" class="v-page" v-if="item !== 0" :aria-current="isCurrent(item)"
17929
- :aria-label="'P\xE1gina ' + item" v-click="go(item)" v-text="item"></button>
17933
+ :aria-label="'Page ' + item" v-click="go(item)" v-text="item"></button>
17930
17934
  </template>
17931
17935
  <button type="button" class="v-page" :disabled="currentPage >= lastPage"
17932
17936
  :aria-label="nextLabel" v-click="go(currentPage + 1)" v-html="svgIcon('chevron-right')"></button>
@@ -17959,7 +17963,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17959
17963
  props: {
17960
17964
  items: { type: "any", default: "" },
17961
17965
  separator: { type: "string", default: "/" },
17962
- ariaLabel: { type: "string", default: "Trilha de navega\xE7\xE3o" }
17966
+ ariaLabel: { type: "string", default: "Breadcrumb" }
17963
17967
  },
17964
17968
  computed: {
17965
17969
  crumbs() {
@@ -17993,7 +17997,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
17993
17997
  hint: TEXT,
17994
17998
  icon: TEXT,
17995
17999
  suffix: { type: "string", default: "%" },
17996
- /** Quando `true`, uma variacao negativa e considerada positiva. */
18000
+ /** When `true`, a negative change counts as positive. */
17997
18001
  inverted: BOOL
17998
18002
  },
17999
18003
  computed: {
@@ -18046,7 +18050,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18046
18050
  register("v-empty-state", {
18047
18051
  props: {
18048
18052
  icon: { type: "string", default: "inbox" },
18049
- title: { type: "string", default: "Nada por aqui" },
18053
+ title: { type: "string", default: "Nothing here yet" },
18050
18054
  description: TEXT
18051
18055
  },
18052
18056
  template: `
@@ -18120,7 +18124,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18120
18124
  steps: { type: "any", default: "" },
18121
18125
  current: { type: "number", default: 0 },
18122
18126
  vertical: BOOL,
18123
- ariaLabel: { type: "string", default: "Etapas" }
18127
+ ariaLabel: { type: "string", default: "Steps" }
18124
18128
  },
18125
18129
  computed: {
18126
18130
  ...flags("vertical"),
@@ -18168,7 +18172,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18168
18172
  value: { type: "number", default: 0 },
18169
18173
  max: { type: "number", default: 5 },
18170
18174
  size: { type: "string", default: "md" },
18171
- label: { type: "string", default: "Avalia\xE7\xE3o" },
18175
+ label: { type: "string", default: "Rating" },
18172
18176
  readonly: BOOL,
18173
18177
  disabled: BOOL,
18174
18178
  showValue: BOOL,
@@ -18194,7 +18198,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18194
18198
  return this.hovered > 0 ? this.hovered : this.score;
18195
18199
  },
18196
18200
  valueText() {
18197
- return `${this.score} de ${this.total}`;
18201
+ return `${this.score} of ${this.total}`;
18198
18202
  }
18199
18203
  },
18200
18204
  methods: {
@@ -18250,7 +18254,7 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18250
18254
  :tabindex="locked ? -1 : 0" :aria-readonly="locked" v-keydown="onKey" v-mouseleave="reset">
18251
18255
  <span class="v-rating-stars">
18252
18256
  <button type="button" class="v-star" v-for="index in total" :key="index"
18253
- :data-on="isOn(index)" :disabled="locked" :aria-label="index + ' de ' + total"
18257
+ :data-on="isOn(index)" :disabled="locked" :aria-label="index + ' of ' + total"
18254
18258
  :tabindex="-1" v-click="pick(index)" v-mouseenter="preview(index)"
18255
18259
  v-html="svgIcon('star')"></button>
18256
18260
  </span>
@@ -18318,8 +18322,8 @@ ${block(':root:not([data-theme="light"])', dark.vars)}
18318
18322
  code: TEXT,
18319
18323
  language: TEXT,
18320
18324
  filename: TEXT,
18321
- copyLabel: { type: "string", default: "Copiar" },
18322
- copiedLabel: { type: "string", default: "Copiado" },
18325
+ copyLabel: { type: "string", default: "Copy" },
18326
+ copiedLabel: { type: "string", default: "Copied" },
18323
18327
  wrap: BOOL
18324
18328
  },
18325
18329
  state() {
@@ -18663,7 +18667,7 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
18663
18667
  source.remove();
18664
18668
  }
18665
18669
  sourceAnchors.delete(source);
18666
- if (source.hasAttribute(`${config.prefix}modal-content`) || source.hasAttribute("data-v-modal-content")) {
18670
+ if (hasDirective(source, "modal-content")) {
18667
18671
  source.setAttribute("hidden", "");
18668
18672
  }
18669
18673
  }
@@ -20699,14 +20703,14 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
20699
20703
 
20700
20704
  // src/devtools/launcher.ts
20701
20705
  init_style();
20702
- var POSICAO_KEY = "voodoo:devtools:widget-position";
20703
- var ESCONDIDO_KEY = "voodoo:devtools:widget-hidden";
20704
- var LIMIAR_ARRASTO = 4;
20706
+ var POSITION_KEY = "voodoo:devtools:widget-position";
20707
+ var HIDDEN_KEY = "voodoo:devtools:widget-hidden";
20708
+ var DRAG_THRESHOLD = 4;
20705
20709
  var refs2 = null;
20706
- var montado = false;
20707
- var timerContador = 0;
20708
- var timerPulso = 0;
20709
- var desligar = [];
20710
+ var mounted = false;
20711
+ var counterTimer = 0;
20712
+ var pulseTimer = 0;
20713
+ var teardown2 = [];
20710
20714
  var WIDGET_CSS = `
20711
20715
  .v-devtools-widget{
20712
20716
  all: initial;
@@ -20839,219 +20843,219 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
20839
20843
  .v-devtools-btn:hover{transform:none}
20840
20844
  }
20841
20845
  `;
20842
- var MARCA = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
20846
+ var MARK = `<svg class="v-devtools-mark" viewBox="0 0 24 24" fill="none" aria-hidden="true">
20843
20847
  <path d="M4 4l8 16 8-16" stroke="#6D3BF5" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
20844
20848
  <circle cx="12" cy="7.5" r="2" fill="#FF3D8B"/>
20845
20849
  </svg>`;
20846
- function lerPosicao() {
20850
+ function readPosition() {
20847
20851
  try {
20848
- const bruto = localStorage.getItem(POSICAO_KEY);
20849
- if (!bruto) return null;
20850
- const valor = JSON.parse(bruto);
20851
- if (typeof (valor == null ? void 0 : valor.x) !== "number" || typeof (valor == null ? void 0 : valor.y) !== "number") return null;
20852
- return valor;
20852
+ const raw = localStorage.getItem(POSITION_KEY);
20853
+ if (!raw) return null;
20854
+ const value = JSON.parse(raw);
20855
+ if (typeof (value == null ? void 0 : value.x) !== "number" || typeof (value == null ? void 0 : value.y) !== "number") return null;
20856
+ return value;
20853
20857
  } catch (e) {
20854
20858
  return null;
20855
20859
  }
20856
20860
  }
20857
- function gravarPosicao(pos) {
20861
+ function writePosition(pos) {
20858
20862
  try {
20859
- localStorage.setItem(POSICAO_KEY, JSON.stringify(pos));
20863
+ localStorage.setItem(POSITION_KEY, JSON.stringify(pos));
20860
20864
  } catch (e) {
20861
20865
  }
20862
20866
  }
20863
- function aplicarPosicao(raiz, pos) {
20864
- const largura = raiz.offsetWidth || 120;
20865
- const altura = raiz.offsetHeight || 38;
20866
- const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - largura - 8));
20867
- const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - altura - 8));
20868
- raiz.style.left = `${x}px`;
20869
- raiz.style.top = `${y}px`;
20870
- raiz.style.right = "auto";
20871
- raiz.style.bottom = "auto";
20872
- }
20873
- function construir() {
20874
- const raiz = document.createElement("div");
20875
- raiz.className = "v-devtools-widget";
20876
- raiz.setAttribute("data-voodoo-devtools", "widget");
20877
- const botao = document.createElement("button");
20878
- botao.type = "button";
20879
- botao.className = "v-devtools-btn";
20880
- botao.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
20881
- botao.setAttribute("aria-pressed", "false");
20882
- botao.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
20883
- botao.innerHTML = MARCA;
20884
- const rotulo = document.createElement("span");
20885
- rotulo.className = "v-devtools-label";
20886
- rotulo.textContent = "Voodoo";
20887
- const contador = document.createElement("span");
20888
- contador.className = "v-devtools-count";
20889
- contador.textContent = "0";
20890
- const pulso = document.createElement("span");
20891
- pulso.className = "v-devtools-pulse";
20892
- pulso.setAttribute("data-on", "false");
20893
- botao.append(rotulo, contador, pulso);
20894
- const fechar = document.createElement("button");
20895
- fechar.type = "button";
20896
- fechar.className = "v-devtools-close";
20897
- fechar.setAttribute("aria-label", "Hide the devtools widget in this tab");
20898
- fechar.title = "Hide in this tab";
20899
- fechar.textContent = "\xD7";
20900
- raiz.append(botao, fechar);
20901
- document.body.appendChild(raiz);
20902
- const salva = lerPosicao();
20903
- if (salva) {
20904
- aplicarPosicao(raiz, salva);
20867
+ function applyPosition(root, pos) {
20868
+ const width = root.offsetWidth || 120;
20869
+ const height = root.offsetHeight || 38;
20870
+ const x = Math.min(Math.max(8, pos.x), Math.max(8, window.innerWidth - width - 8));
20871
+ const y = Math.min(Math.max(8, pos.y), Math.max(8, window.innerHeight - height - 8));
20872
+ root.style.left = `${x}px`;
20873
+ root.style.top = `${y}px`;
20874
+ root.style.right = "auto";
20875
+ root.style.bottom = "auto";
20876
+ }
20877
+ function build() {
20878
+ const root = document.createElement("div");
20879
+ root.className = "v-devtools-widget";
20880
+ root.setAttribute("data-voodoo-devtools", "widget");
20881
+ const button = document.createElement("button");
20882
+ button.type = "button";
20883
+ button.className = "v-devtools-btn";
20884
+ button.setAttribute("aria-label", "Open Voodoo devtools (Ctrl+Shift+X)");
20885
+ button.setAttribute("aria-pressed", "false");
20886
+ button.title = "Voodoo devtools \u2014 click to inspect, drag to move (Ctrl+Shift+X)";
20887
+ button.innerHTML = MARK;
20888
+ const label = document.createElement("span");
20889
+ label.className = "v-devtools-label";
20890
+ label.textContent = "Voodoo";
20891
+ const counter2 = document.createElement("span");
20892
+ counter2.className = "v-devtools-count";
20893
+ counter2.textContent = "0";
20894
+ const pulse = document.createElement("span");
20895
+ pulse.className = "v-devtools-pulse";
20896
+ pulse.setAttribute("data-on", "false");
20897
+ button.append(label, counter2, pulse);
20898
+ const close = document.createElement("button");
20899
+ close.type = "button";
20900
+ close.className = "v-devtools-close";
20901
+ close.setAttribute("aria-label", "Hide the devtools widget in this tab");
20902
+ close.title = "Hide in this tab";
20903
+ close.textContent = "\xD7";
20904
+ root.append(button, close);
20905
+ document.body.appendChild(root);
20906
+ const saved = readPosition();
20907
+ if (saved) {
20908
+ applyPosition(root, saved);
20905
20909
  } else {
20906
- raiz.style.right = "16px";
20907
- raiz.style.bottom = "16px";
20908
- }
20909
- return { raiz, botao, pulso, contador, fechar };
20910
- }
20911
- function ligarArrasto(refs3, aoClicar) {
20912
- let arrastando = false;
20913
- let moveu = false;
20914
- let deslocX = 0;
20915
- let deslocY = 0;
20916
- let inicioX = 0;
20917
- let inicioY = 0;
20918
- const aoDescer = (evento) => {
20910
+ root.style.right = "16px";
20911
+ root.style.bottom = "16px";
20912
+ }
20913
+ return { root, button, pulse, counter: counter2, close };
20914
+ }
20915
+ function enableDrag(refs3, onClick) {
20916
+ let dragging = false;
20917
+ let moved = false;
20918
+ let offsetX = 0;
20919
+ let offsetY = 0;
20920
+ let startX = 0;
20921
+ let startY = 0;
20922
+ const onPointerDown = (event) => {
20919
20923
  var _a2, _b;
20920
- if (evento.button !== 0) return;
20921
- const caixa = refs3.raiz.getBoundingClientRect();
20922
- arrastando = true;
20923
- moveu = false;
20924
- inicioX = evento.clientX;
20925
- inicioY = evento.clientY;
20926
- deslocX = evento.clientX - caixa.left;
20927
- deslocY = evento.clientY - caixa.top;
20928
- (_b = (_a2 = refs3.botao).setPointerCapture) == null ? void 0 : _b.call(_a2, evento.pointerId);
20924
+ if (event.button !== 0) return;
20925
+ const box = refs3.root.getBoundingClientRect();
20926
+ dragging = true;
20927
+ moved = false;
20928
+ startX = event.clientX;
20929
+ startY = event.clientY;
20930
+ offsetX = event.clientX - box.left;
20931
+ offsetY = event.clientY - box.top;
20932
+ (_b = (_a2 = refs3.button).setPointerCapture) == null ? void 0 : _b.call(_a2, event.pointerId);
20929
20933
  };
20930
- const aoMover = (evento) => {
20931
- if (!arrastando) return;
20932
- const distancia = Math.hypot(evento.clientX - inicioX, evento.clientY - inicioY);
20933
- if (!moveu && distancia < LIMIAR_ARRASTO) return;
20934
- moveu = true;
20935
- evento.preventDefault();
20936
- aplicarPosicao(refs3.raiz, { x: evento.clientX - deslocX, y: evento.clientY - deslocY });
20934
+ const onPointerMove2 = (event) => {
20935
+ if (!dragging) return;
20936
+ const distance = Math.hypot(event.clientX - startX, event.clientY - startY);
20937
+ if (!moved && distance < DRAG_THRESHOLD) return;
20938
+ moved = true;
20939
+ event.preventDefault();
20940
+ applyPosition(refs3.root, { x: event.clientX - offsetX, y: event.clientY - offsetY });
20937
20941
  };
20938
- const aoSubir = (evento) => {
20942
+ const onPointerUp = (event) => {
20939
20943
  var _a2, _b;
20940
- if (!arrastando) return;
20941
- arrastando = false;
20942
- (_b = (_a2 = refs3.botao).releasePointerCapture) == null ? void 0 : _b.call(_a2, evento.pointerId);
20943
- if (!moveu) {
20944
- aoClicar();
20944
+ if (!dragging) return;
20945
+ dragging = false;
20946
+ (_b = (_a2 = refs3.button).releasePointerCapture) == null ? void 0 : _b.call(_a2, event.pointerId);
20947
+ if (!moved) {
20948
+ onClick();
20945
20949
  return;
20946
20950
  }
20947
- const caixa = refs3.raiz.getBoundingClientRect();
20948
- gravarPosicao({ x: caixa.left, y: caixa.top });
20951
+ const box = refs3.root.getBoundingClientRect();
20952
+ writePosition({ x: box.left, y: box.top });
20949
20953
  };
20950
- const aoTeclar = (evento) => {
20951
- if (evento.key !== "Enter" && evento.key !== " ") return;
20952
- evento.preventDefault();
20953
- aoClicar();
20954
+ const onKeyDown = (event) => {
20955
+ if (event.key !== "Enter" && event.key !== " ") return;
20956
+ event.preventDefault();
20957
+ onClick();
20954
20958
  };
20955
- const aoRedimensionar = () => {
20956
- const caixa = refs3.raiz.getBoundingClientRect();
20957
- if (refs3.raiz.style.left) aplicarPosicao(refs3.raiz, { x: caixa.left, y: caixa.top });
20959
+ const onResize = () => {
20960
+ const box = refs3.root.getBoundingClientRect();
20961
+ if (refs3.root.style.left) applyPosition(refs3.root, { x: box.left, y: box.top });
20958
20962
  };
20959
- refs3.botao.addEventListener("pointerdown", aoDescer);
20960
- refs3.botao.addEventListener("pointermove", aoMover);
20961
- refs3.botao.addEventListener("pointerup", aoSubir);
20962
- refs3.botao.addEventListener("pointercancel", aoSubir);
20963
- refs3.botao.addEventListener("keydown", aoTeclar);
20964
- window.addEventListener("resize", aoRedimensionar);
20963
+ refs3.button.addEventListener("pointerdown", onPointerDown);
20964
+ refs3.button.addEventListener("pointermove", onPointerMove2);
20965
+ refs3.button.addEventListener("pointerup", onPointerUp);
20966
+ refs3.button.addEventListener("pointercancel", onPointerUp);
20967
+ refs3.button.addEventListener("keydown", onKeyDown);
20968
+ window.addEventListener("resize", onResize);
20965
20969
  return () => {
20966
- refs3.botao.removeEventListener("pointerdown", aoDescer);
20967
- refs3.botao.removeEventListener("pointermove", aoMover);
20968
- refs3.botao.removeEventListener("pointerup", aoSubir);
20969
- refs3.botao.removeEventListener("pointercancel", aoSubir);
20970
- refs3.botao.removeEventListener("keydown", aoTeclar);
20971
- window.removeEventListener("resize", aoRedimensionar);
20970
+ refs3.button.removeEventListener("pointerdown", onPointerDown);
20971
+ refs3.button.removeEventListener("pointermove", onPointerMove2);
20972
+ refs3.button.removeEventListener("pointerup", onPointerUp);
20973
+ refs3.button.removeEventListener("pointercancel", onPointerUp);
20974
+ refs3.button.removeEventListener("keydown", onKeyDown);
20975
+ window.removeEventListener("resize", onResize);
20972
20976
  };
20973
20977
  }
20974
- function piscar() {
20978
+ function blink() {
20975
20979
  if (!refs2) return;
20976
- refs2.pulso.setAttribute("data-on", "true");
20977
- window.clearTimeout(timerPulso);
20978
- timerPulso = window.setTimeout(() => {
20979
- refs2 == null ? void 0 : refs2.pulso.setAttribute("data-on", "false");
20980
+ refs2.pulse.setAttribute("data-on", "true");
20981
+ window.clearTimeout(pulseTimer);
20982
+ pulseTimer = window.setTimeout(() => {
20983
+ refs2 == null ? void 0 : refs2.pulse.setAttribute("data-on", "false");
20980
20984
  }, 320);
20981
20985
  }
20982
- function atualizarContador() {
20986
+ function updateCounter() {
20983
20987
  if (!refs2) return;
20984
20988
  const total = instances.size;
20985
- const texto = total === 1 ? "1 component" : `${total} components`;
20986
- if (refs2.contador.textContent !== texto) refs2.contador.textContent = texto;
20989
+ const text = total === 1 ? "1 component" : `${total} components`;
20990
+ if (refs2.counter.textContent !== text) refs2.counter.textContent = text;
20987
20991
  }
20988
20992
  function mountDevtoolsWidget() {
20989
- if (montado || typeof document === "undefined" || !document.body) return;
20993
+ if (mounted || typeof document === "undefined" || !document.body) return;
20990
20994
  try {
20991
- if (sessionStorage.getItem(ESCONDIDO_KEY) === "1") return;
20995
+ if (sessionStorage.getItem(HIDDEN_KEY) === "1") return;
20992
20996
  } catch (e) {
20993
20997
  }
20994
- montado = true;
20998
+ mounted = true;
20995
20999
  injectStyle("devtools-widget", WIDGET_CSS);
20996
- refs2 = construir();
20997
- const alternar = () => {
20998
- const ligado = xray();
20999
- refs2 == null ? void 0 : refs2.raiz.setAttribute("data-active", String(ligado));
21000
- refs2 == null ? void 0 : refs2.botao.setAttribute("aria-pressed", String(ligado));
21000
+ refs2 = build();
21001
+ const toggle = () => {
21002
+ const enabled2 = xray();
21003
+ refs2 == null ? void 0 : refs2.root.setAttribute("data-active", String(enabled2));
21004
+ refs2 == null ? void 0 : refs2.button.setAttribute("aria-pressed", String(enabled2));
21001
21005
  };
21002
- desligar.push(ligarArrasto(refs2, alternar));
21003
- const aoFechar = (evento) => {
21004
- evento.stopPropagation();
21006
+ teardown2.push(enableDrag(refs2, toggle));
21007
+ const onClose = (event) => {
21008
+ event.stopPropagation();
21005
21009
  try {
21006
- sessionStorage.setItem(ESCONDIDO_KEY, "1");
21010
+ sessionStorage.setItem(HIDDEN_KEY, "1");
21007
21011
  } catch (e) {
21008
21012
  }
21009
21013
  unmountDevtoolsWidget();
21010
21014
  console.info("[Voodoo] devtools widget hidden. Use V.devtoolsWidget(true) to bring back.");
21011
21015
  };
21012
- refs2.fechar.addEventListener("click", aoFechar);
21013
- desligar.push(() => refs2 == null ? void 0 : refs2.fechar.removeEventListener("click", aoFechar));
21014
- const aoTeclarGlobal = () => {
21015
- const ligado = isXrayEnabled();
21016
- refs2 == null ? void 0 : refs2.raiz.setAttribute("data-active", String(ligado));
21017
- refs2 == null ? void 0 : refs2.botao.setAttribute("aria-pressed", String(ligado));
21016
+ refs2.close.addEventListener("click", onClose);
21017
+ teardown2.push(() => refs2 == null ? void 0 : refs2.close.removeEventListener("click", onClose));
21018
+ const onGlobalKeyUp = () => {
21019
+ const enabled2 = isXrayEnabled();
21020
+ refs2 == null ? void 0 : refs2.root.setAttribute("data-active", String(enabled2));
21021
+ refs2 == null ? void 0 : refs2.button.setAttribute("aria-pressed", String(enabled2));
21018
21022
  };
21019
- document.addEventListener("keyup", aoTeclarGlobal);
21020
- desligar.push(() => document.removeEventListener("keyup", aoTeclarGlobal));
21021
- for (const tipo of ["network", "event", "navigation", "update"]) {
21022
- desligar.push(devtoolsBus.on(tipo, piscar));
21023
+ document.addEventListener("keyup", onGlobalKeyUp);
21024
+ teardown2.push(() => document.removeEventListener("keyup", onGlobalKeyUp));
21025
+ for (const type of ["network", "event", "navigation", "update"]) {
21026
+ teardown2.push(devtoolsBus.on(type, blink));
21023
21027
  }
21024
- atualizarContador();
21025
- timerContador = window.setInterval(atualizarContador, 1e3);
21028
+ updateCounter();
21029
+ counterTimer = window.setInterval(updateCounter, 1e3);
21026
21030
  }
21027
21031
  function unmountDevtoolsWidget() {
21028
- if (!montado) return;
21029
- montado = false;
21030
- for (const fn of desligar.splice(0)) {
21032
+ if (!mounted) return;
21033
+ mounted = false;
21034
+ for (const fn of teardown2.splice(0)) {
21031
21035
  try {
21032
21036
  fn();
21033
21037
  } catch (e) {
21034
21038
  }
21035
21039
  }
21036
- window.clearInterval(timerContador);
21037
- window.clearTimeout(timerPulso);
21038
- timerContador = 0;
21039
- timerPulso = 0;
21040
- refs2 == null ? void 0 : refs2.raiz.remove();
21040
+ window.clearInterval(counterTimer);
21041
+ window.clearTimeout(pulseTimer);
21042
+ counterTimer = 0;
21043
+ pulseTimer = 0;
21044
+ refs2 == null ? void 0 : refs2.root.remove();
21041
21045
  refs2 = null;
21042
21046
  }
21043
21047
  function devtoolsWidget(force) {
21044
- const alvo = force != null ? force : !montado;
21045
- if (alvo) {
21048
+ const target = force != null ? force : !mounted;
21049
+ if (target) {
21046
21050
  try {
21047
- sessionStorage.removeItem(ESCONDIDO_KEY);
21051
+ sessionStorage.removeItem(HIDDEN_KEY);
21048
21052
  } catch (e) {
21049
21053
  }
21050
21054
  mountDevtoolsWidget();
21051
21055
  } else {
21052
21056
  unmountDevtoolsWidget();
21053
21057
  }
21054
- return montado;
21058
+ return mounted;
21055
21059
  }
21056
21060
 
21057
21061
  // src/index.ts