@thibezer/ui-components-kit 2.6.1 → 2.8.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.
Files changed (161) hide show
  1. package/CHANGELOG.md +265 -204
  2. package/README.md +815 -791
  3. package/dist/acessibilidade-CSzX-DkG.cjs +1 -0
  4. package/dist/acessibilidade-CUlSXc2X.js +38 -0
  5. package/dist/altura-controle-ukMRPckR.cjs +1 -0
  6. package/dist/altura-controle-vxQiXG4q.js +62 -0
  7. package/dist/botao.cjs +1 -1
  8. package/dist/botao.js +1 -1
  9. package/dist/camadas.cjs +94 -94
  10. package/dist/camadas.js +1218 -1124
  11. package/dist/campo-texto.cjs +1 -1
  12. package/dist/campo-texto.js +1 -1
  13. package/dist/canvas.cjs +66 -65
  14. package/dist/canvas.js +3769 -3389
  15. package/dist/card.cjs +1 -1
  16. package/dist/card.js +1 -1
  17. package/dist/components/ui-alerta/ui-toast.d.ts +4 -15
  18. package/dist/components/ui-avatar/ui-avatar.d.ts +11 -0
  19. package/dist/components/ui-badge/ui-badge.d.ts +2 -0
  20. package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +16 -0
  21. package/dist/components/ui-barra-ferramentas/paleta-pressao-longa.d.ts +24 -0
  22. package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +14 -0
  23. package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +17 -0
  24. package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +1 -7
  25. package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +0 -1
  26. package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +2 -0
  27. package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +4 -11
  28. package/dist/components/ui-camadas/camadas-colecao.d.ts +27 -0
  29. package/dist/components/ui-camadas/camadas-drag-drop.d.ts +13 -1
  30. package/dist/components/ui-camadas/camadas-drop-ops.d.ts +31 -0
  31. package/dist/components/ui-camadas/camadas-hierarquia.d.ts +10 -0
  32. package/dist/components/ui-camadas/camadas-lembranca.d.ts +34 -0
  33. package/dist/components/ui-camadas/camadas-render.d.ts +14 -0
  34. package/dist/components/ui-camadas/camadas-renomear.d.ts +12 -0
  35. package/dist/components/ui-camadas/camadas-selecao-api.d.ts +17 -0
  36. package/dist/components/ui-camadas/camadas-thumb.d.ts +1 -0
  37. package/dist/components/ui-camadas/ui-camadas.d.ts +3 -5
  38. package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +15 -0
  39. package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +2 -1
  40. package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +1 -1
  41. package/dist/components/ui-canvas-cad/cad-evento-coordenadas.d.ts +22 -0
  42. package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +3 -8
  43. package/dist/components/ui-canvas-cad/cad-feicoes-camera.d.ts +26 -0
  44. package/dist/components/ui-canvas-cad/cad-feicoes-consulta.d.ts +21 -0
  45. package/dist/components/ui-canvas-cad/cad-feicoes-dados.d.ts +39 -0
  46. package/dist/components/ui-canvas-cad/cad-feicoes-desenho.d.ts +68 -0
  47. package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +37 -0
  48. package/dist/components/ui-canvas-cad/cad-feicoes-operacoes.d.ts +48 -0
  49. package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +24 -0
  50. package/dist/components/ui-canvas-cad/cad-feicoes-selecao-regiao.d.ts +22 -0
  51. package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +53 -0
  52. package/dist/components/ui-canvas-cad/cad-feicoes-versoes.d.ts +33 -0
  53. package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +26 -106
  54. package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +3 -1
  55. package/dist/components/ui-canvas-cad/cad-leaflet-adaptador.d.ts +5 -0
  56. package/dist/components/ui-canvas-cad/cad-selecao-pontos.d.ts +5 -0
  57. package/dist/components/ui-canvas-cad/tipos.d.ts +37 -0
  58. package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +4 -1
  59. package/dist/components/ui-checkbox/ui-checkbox.d.ts +4 -1
  60. package/dist/components/ui-linha/index.d.ts +1 -0
  61. package/dist/components/ui-linha/ui-linha.d.ts +48 -0
  62. package/dist/components/ui-mapa/mapa-atributos.d.ts +14 -0
  63. package/dist/components/ui-mapa/mapa-basemaps.d.ts +7 -0
  64. package/dist/components/ui-mapa/mapa-icones.d.ts +4 -0
  65. package/dist/components/ui-mapa/mapa-leaflet.d.ts +5 -0
  66. package/dist/components/ui-mapa/mapa-vinculo-pai.d.ts +22 -0
  67. package/dist/components/ui-mapa/tipos.d.ts +13 -0
  68. package/dist/components/ui-mapa/ui-mapa-linha.d.ts +12 -5
  69. package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +15 -6
  70. package/dist/components/ui-mapa/ui-mapa.d.ts +14 -1
  71. package/dist/components/ui-modal/modal-acessibilidade.d.ts +5 -5
  72. package/dist/components/ui-modal/modal-foco.d.ts +28 -0
  73. package/dist/components/ui-modal/ui-modal.d.ts +1 -11
  74. package/dist/components/ui-radio/radio-grupo-registry.d.ts +10 -0
  75. package/dist/components/ui-radio/ui-radio.d.ts +9 -2
  76. package/dist/components/ui-skeleton/ui-skeleton.d.ts +9 -0
  77. package/dist/components/ui-switch/ui-switch.d.ts +3 -1
  78. package/dist/components/ui-tabela/tabela-estados.d.ts +16 -0
  79. package/dist/components/ui-tabela/tabela-rolagem.d.ts +44 -0
  80. package/dist/components/ui-tabela/tabela-teclado.d.ts +16 -0
  81. package/dist/components/ui-tabela/ui-tabela.d.ts +1 -19
  82. package/dist/components/ui-tooltip/tooltip-popover.d.ts +7 -0
  83. package/dist/components/ui-tooltip/tooltip-posicionamento.d.ts +29 -0
  84. package/dist/components/ui-tooltip/ui-tooltip.d.ts +24 -1
  85. package/dist/core/altura-controle.d.ts +34 -0
  86. package/dist/core/index.d.ts +1 -0
  87. package/dist/core/opcoes.d.ts +9 -0
  88. package/dist/core/rotulo-controle.d.ts +13 -0
  89. package/dist/core/tipos-toast.d.ts +16 -0
  90. package/dist/core/ui-bus.d.ts +9 -1
  91. package/dist/core.cjs +1 -1
  92. package/dist/core.js +29 -19
  93. package/dist/custom-elements.json +20984 -15700
  94. package/dist/data.cjs +1 -1
  95. package/dist/data.js +2 -2
  96. package/dist/feedback.cjs +1 -1
  97. package/dist/feedback.js +21 -21
  98. package/dist/form-validacao-BlQFxUVj.js +104 -0
  99. package/dist/form-validacao-DIeyQVH5.cjs +1 -0
  100. package/dist/forms.cjs +1 -1
  101. package/dist/forms.js +2 -2
  102. package/dist/index.cjs +1 -1
  103. package/dist/index.d.ts +3 -0
  104. package/dist/index.js +178 -177
  105. package/dist/mapa.cjs +11 -16
  106. package/dist/mapa.js +242 -170
  107. package/dist/modal.cjs +1 -1
  108. package/dist/modal.js +1 -1
  109. package/dist/opcoes-CJYLi6kd.js +12 -0
  110. package/dist/opcoes-CkyDxBuQ.cjs +1 -0
  111. package/dist/register.cjs +1 -1
  112. package/dist/register.js +13 -14
  113. package/dist/tabela.cjs +1 -1
  114. package/dist/tabela.js +1 -1
  115. package/dist/tipos-elementos.d.ts +33 -3
  116. package/dist/tipos-react.d.ts +2 -0
  117. package/dist/tipos-vue.d.ts +32 -3
  118. package/dist/tools.cjs +1 -1
  119. package/dist/tools.js +1 -1
  120. package/dist/ui-badge-BWhoGgo9.js +197 -0
  121. package/dist/ui-badge-SIR81R9l.cjs +28 -0
  122. package/dist/ui-botao-D24oXySA.cjs +12 -0
  123. package/dist/ui-botao-Dsj08jjw.js +165 -0
  124. package/dist/{zero-js-triggers-C_KrvFOQ.js → ui-bus-CUd99VJi.js} +36 -103
  125. package/dist/ui-bus-XqBLlTYQ.cjs +1 -0
  126. package/dist/{ui-campo-texto-Uu2dJE_0.js → ui-campo-texto-B_OHVGiN.js} +51 -51
  127. package/dist/ui-campo-texto-DauJCde3.cjs +16 -0
  128. package/dist/{ui-card-C_o5_0cB.js → ui-card-BNYCQ7g-.js} +50 -42
  129. package/dist/ui-card-BrjBL-yo.cjs +20 -0
  130. package/dist/ui-kit.css +1 -1
  131. package/dist/ui-linha-C6HBnsaw.cjs +19 -0
  132. package/dist/{ui-segmented-wUraId2e.js → ui-linha-nCDh2wPm.js} +200 -105
  133. package/dist/{ui-modal-DBOtSTbR.js → ui-modal-BkYvNP0G.js} +116 -140
  134. package/dist/ui-modal-CUNbpbZ1.cjs +18 -0
  135. package/dist/{ui-paleta-ferramentas-DNN5i6nL.js → ui-paleta-ferramentas-Ksh6gMW3.js} +359 -329
  136. package/dist/{ui-paleta-ferramentas-Ccmo-rB5.cjs → ui-paleta-ferramentas-bDLPbiGA.cjs} +7 -7
  137. package/dist/ui-skeleton-B2Rgrv8o.js +648 -0
  138. package/dist/ui-skeleton-DiOxTBZK.cjs +52 -0
  139. package/dist/ui-switch-D9a8XlVX.cjs +53 -0
  140. package/dist/{ui-switch-BcOqOkiV.js → ui-switch-DO1R0Ce7.js} +187 -128
  141. package/dist/{ui-tabela-propriedades-BokvDD3b.js → ui-tabela-propriedades-D9Echt2X.js} +845 -826
  142. package/dist/{ui-tabela-propriedades-BecPqC-e.cjs → ui-tabela-propriedades-DzZlyNZ_.cjs} +10 -10
  143. package/dist/zero-js-triggers-CJT988bR.js +83 -0
  144. package/dist/zero-js-triggers-CgM9IIQB.cjs +1 -0
  145. package/package.json +9 -2
  146. package/dist/form-validacao-BIOXxt-1.js +0 -140
  147. package/dist/form-validacao-ytRYSF3E.cjs +0 -1
  148. package/dist/ui-badge-BxT-sDmV.cjs +0 -28
  149. package/dist/ui-badge-C0eKBI8E.js +0 -183
  150. package/dist/ui-botao-BOOnP8ds.cjs +0 -12
  151. package/dist/ui-botao-DfqSivHl.js +0 -165
  152. package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
  153. package/dist/ui-card-B86lJXTP.cjs +0 -20
  154. package/dist/ui-modal-CvGFGh1h.cjs +0 -18
  155. package/dist/ui-segmented-D6b6zxVs.cjs +0 -19
  156. package/dist/ui-skeleton-DI4_9WOX.js +0 -428
  157. package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
  158. package/dist/ui-switch-D7iPKDj-.cjs +0 -53
  159. package/dist/ui-toast-Bp_NlM5G.js +0 -156
  160. package/dist/ui-toast-DGTZKne5.cjs +0 -20
  161. package/dist/zero-js-triggers-C_gtaojZ.cjs +0 -1
@@ -1,115 +1,123 @@
1
- var y = Object.defineProperty;
2
- var E = (e, a, t) => a in e ? y(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
3
- var s = (e, a, t) => E(e, typeof a != "symbol" ? a + "" : a, t);
4
- import { d as f, S as w } from "./ssr-safe-5cWfJP-s.js";
5
- const A = ':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-modal__backdrop{display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#000000b3;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:calc(var(--ui-z-modal, 1000) - 1);opacity:0;pointer-events:none;transition:opacity .25s ease}:host([aberto]) .ui-modal__backdrop,:host([open]) .ui-modal__backdrop{display:block;opacity:1;pointer-events:auto}.ui-modal__dialog{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%) scale(.95);max-width:560px;width:90%;max-height:85vh;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:var(--ui-raio-borda, 12px);box-shadow:var(--ui-sombra-lg, 0 12px 36px rgba(0, 0, 0, .6));z-index:var(--ui-z-modal, 1000);display:flex;flex-direction:column;opacity:0;visibility:hidden;pointer-events:none;overflow:hidden;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility 0s linear .2s;box-sizing:border-box;color:var(--ui-cor-texto, #e1e1e6)}:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,-50%) scale(1);transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility 0s}@starting-style{:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{opacity:0;transform:translate(-50%,-50%) scale(.94)}:host([aberto]) .ui-modal__backdrop,:host([open]) .ui-modal__backdrop{opacity:0}}.ui-modal__handle{display:none;width:36px;height:4px;border-radius:2px;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent);margin:6px auto 12px;flex-shrink:0}.ui-modal__header{padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);gap:12px}.ui-modal__titulo{font-size:18px;font-weight:600;margin:0;color:var(--ui-cor-texto, #e1e1e6)}.ui-modal__close{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-size:16px;cursor:pointer;padding:4px 8px;border-radius:var(--ui-raio-sm, 4px);line-height:1;display:inline-flex;align-items:center;justify-content:center;transition:color .15s ease,background-color .15s ease;touch-action:manipulation;-webkit-tap-highlight-color:transparent}:host([bloquear-fechamento]) .ui-modal__close{display:none}.ui-modal__close svg,.ui-modal__close ::slotted(svg){shape-rendering:geometricPrecision}.ui-modal__close:hover{color:#fff;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent)}.ui-modal__body{padding:20px;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;flex:1;box-sizing:border-box}.ui-modal__footer{padding:14px 20px;display:flex;align-items:center;justify-content:flex-end;gap:12px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);background-color:var(--ui-cor-fundo-recuado, rgba(0, 0, 0, .15))}@media (max-width: 640px){.ui-modal__dialog{top:auto!important;bottom:0!important;left:0!important;transform:translateY(100%)!important;width:100vw!important;max-width:100vw!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;max-height:85vh!important;max-height:85dvh!important;border-bottom:none!important;box-shadow:0 -8px 32px #000000b3!important}.ui-modal__close{min-width:44px;min-height:44px;font-size:18px}.ui-modal__footer{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important}:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{transform:translateY(0)!important}.ui-modal__handle{display:block!important}}:host([bottom-sheet]) .ui-modal__dialog{top:auto!important;bottom:0!important;left:0!important;transform:translateY(100%)!important;width:100vw!important;max-width:100vw!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;max-height:85vh!important;max-height:85dvh!important;border-bottom:none!important;box-shadow:0 -8px 32px #000000b3!important}:host([bottom-sheet]) .ui-modal__close{min-width:44px;min-height:44px;font-size:18px}:host([bottom-sheet]) .ui-modal__footer{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important}:host([bottom-sheet][aberto]) .ui-modal__dialog,:host([bottom-sheet][open]) .ui-modal__dialog{transform:translateY(0)!important}:host([bottom-sheet]) .ui-modal__handle{display:block!important}';
6
- function k(e) {
7
- const a = /* @__PURE__ */ new Set();
8
- if (typeof document > "u") return a;
9
- let t = e;
10
- for (; t && t !== document.body && t !== document.documentElement; ) {
11
- const i = t.parentElement;
12
- if (!i) break;
13
- const o = Array.from(i.children);
14
- for (const r of o)
15
- if (r !== t && !r.contains(e) && r.tagName !== "SCRIPT" && r.tagName !== "STYLE" && !(r.hasAttribute("inert") || r.inert === !0)) {
16
- r.setAttribute("inert", "");
17
- try {
18
- r.inert = !0;
19
- } catch {
20
- }
21
- a.add(r);
22
- }
23
- t = i;
24
- }
25
- if (document.body) {
26
- const i = Array.from(document.body.children);
27
- for (const o of i)
28
- if (o !== e && !o.contains(e) && o.tagName !== "SCRIPT" && o.tagName !== "STYLE" && !(o.hasAttribute("inert") || o.inert === !0)) {
29
- o.setAttribute("inert", "");
30
- try {
31
- o.inert = !0;
32
- } catch {
33
- }
34
- a.add(o);
35
- }
36
- }
37
- return a;
1
+ var S = Object.defineProperty;
2
+ var C = (e, o, t) => o in e ? S(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
3
+ var r = (e, o, t) => C(e, typeof o != "symbol" ? o + "" : o, t);
4
+ import { d as g, S as I } from "./ssr-safe-5cWfJP-s.js";
5
+ import { L as q } from "./listener-bag-DQgv7OON.js";
6
+ const z = ':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-modal__backdrop{display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#000000b3;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:calc(var(--ui-z-modal, 1000) - 1);opacity:0;pointer-events:none;transition:opacity .25s ease}:host([aberto]) .ui-modal__backdrop,:host([open]) .ui-modal__backdrop{display:block;opacity:1;pointer-events:auto}.ui-modal__dialog{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%) scale(.95);max-width:560px;width:90%;max-height:85vh;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:var(--ui-raio-borda, 12px);box-shadow:var(--ui-sombra-lg, 0 12px 36px rgba(0, 0, 0, .6));z-index:var(--ui-z-modal, 1000);display:flex;flex-direction:column;opacity:0;visibility:hidden;pointer-events:none;overflow:hidden;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility 0s linear .2s;box-sizing:border-box;color:var(--ui-cor-texto, #e1e1e6)}:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,-50%) scale(1);transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility 0s}@starting-style{:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{opacity:0;transform:translate(-50%,-50%) scale(.94)}:host([aberto]) .ui-modal__backdrop,:host([open]) .ui-modal__backdrop{opacity:0}}.ui-modal__handle{display:none;width:36px;height:4px;border-radius:2px;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent);margin:6px auto 12px;flex-shrink:0}.ui-modal__header{padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);gap:12px}.ui-modal__titulo{font-size:18px;font-weight:600;margin:0;color:var(--ui-cor-texto, #e1e1e6)}.ui-modal__close{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-size:16px;cursor:pointer;padding:4px 8px;border-radius:var(--ui-raio-sm, 4px);line-height:1;display:inline-flex;align-items:center;justify-content:center;transition:color .15s ease,background-color .15s ease;touch-action:manipulation;-webkit-tap-highlight-color:transparent}:host([bloquear-fechamento]) .ui-modal__close{display:none}.ui-modal__close svg,.ui-modal__close ::slotted(svg){shape-rendering:geometricPrecision}.ui-modal__close:hover{color:#fff;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent)}.ui-modal__body{padding:20px;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;flex:1;box-sizing:border-box}.ui-modal__footer{padding:14px 20px;display:flex;align-items:center;justify-content:flex-end;gap:12px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);background-color:var(--ui-cor-fundo-recuado, rgba(0, 0, 0, .15))}@media (max-width: 640px){.ui-modal__dialog{top:auto!important;bottom:0!important;left:0!important;transform:translateY(100%)!important;width:100vw!important;max-width:100vw!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;max-height:85vh!important;max-height:85dvh!important;border-bottom:none!important;box-shadow:0 -8px 32px #000000b3!important}.ui-modal__close{min-width:44px;min-height:44px;font-size:18px}.ui-modal__footer{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important}:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{transform:translateY(0)!important}.ui-modal__handle{display:block!important}}:host([bottom-sheet]) .ui-modal__dialog{top:auto!important;bottom:0!important;left:0!important;transform:translateY(100%)!important;width:100vw!important;max-width:100vw!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;max-height:85vh!important;max-height:85dvh!important;border-bottom:none!important;box-shadow:0 -8px 32px #000000b3!important}:host([bottom-sheet]) .ui-modal__close{min-width:44px;min-height:44px;font-size:18px}:host([bottom-sheet]) .ui-modal__footer{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important}:host([bottom-sheet][aberto]) .ui-modal__dialog,:host([bottom-sheet][open]) .ui-modal__dialog{transform:translateY(0)!important}:host([bottom-sheet]) .ui-modal__handle{display:block!important}';
7
+ function D(e) {
8
+ return e.tagName === "SCRIPT" || e.tagName === "STYLE";
38
9
  }
39
- function S(e) {
40
- e.forEach((a) => {
41
- try {
42
- a.removeAttribute("inert"), a.inert = !1;
43
- } catch {
44
- }
10
+ function M(e) {
11
+ const o = /* @__PURE__ */ new Set();
12
+ if (typeof document > "u") return o;
13
+ const t = (a) => {
14
+ a === e || a.contains(e) || D(a) || a.inert || a.hasAttribute("inert") || (a.setAttribute("inert", ""), a.inert = !0, o.add(a));
15
+ };
16
+ let i = e;
17
+ for (; i && i !== document.body && i !== document.documentElement; ) {
18
+ const a = i.parentElement;
19
+ if (!a) break;
20
+ Array.from(a.children).forEach((l) => t(l)), i = a;
21
+ }
22
+ return document.body && Array.from(document.body.children).forEach((a) => t(a)), o;
23
+ }
24
+ function T(e) {
25
+ e.forEach((o) => {
26
+ o.removeAttribute("inert"), o.inert = !1;
45
27
  }), e.clear();
46
28
  }
47
29
  const n = [];
48
- let b = /* @__PURE__ */ new Set(), _ = "";
49
- function g() {
50
- S(b);
30
+ let f = /* @__PURE__ */ new Set(), x = "";
31
+ function v() {
32
+ T(f);
51
33
  const e = n[n.length - 1];
52
- b = e ? k(e) : /* @__PURE__ */ new Set();
34
+ f = e ? M(e) : /* @__PURE__ */ new Set();
53
35
  }
54
- function C(e) {
55
- const a = n.indexOf(e);
56
- a >= 0 && n.splice(a, 1), n.length === 0 && (_ = document.body.style.overflow, document.body.style.overflow = "hidden"), n.push(e), g();
36
+ function R(e) {
37
+ const o = n.indexOf(e);
38
+ o >= 0 && n.splice(o, 1), n.length === 0 && (x = document.body.style.overflow, document.body.style.overflow = "hidden"), n.push(e), v();
57
39
  }
58
- function p(e) {
59
- const a = n.indexOf(e);
60
- a < 0 || (n.splice(a, 1), n.length === 0 && (document.body.style.overflow = _), g());
40
+ function _(e) {
41
+ const o = n.indexOf(e);
42
+ o < 0 || (n.splice(o, 1), n.length === 0 && (document.body.style.overflow = x), v());
61
43
  }
62
- function I(e) {
44
+ function F(e) {
63
45
  return n[n.length - 1] === e;
64
46
  }
65
- const u = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), ui-campo-texto, ui-input, ui-botao, ui-botao-primario, ui-checkbox, ui-switch, ui-lista-flutuante, ui-radio, ui-select, ui-segmented';
66
- function F() {
67
- var a;
47
+ const m = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), ui-campo-texto, ui-input, ui-botao, ui-botao-primario, ui-checkbox, ui-switch, ui-lista-flutuante, ui-radio, ui-select, ui-segmented';
48
+ function b() {
49
+ var o;
68
50
  let e = document.activeElement;
69
- for (; (a = e == null ? void 0 : e.shadowRoot) != null && a.activeElement; )
51
+ for (; (o = e == null ? void 0 : e.shadowRoot) != null && o.activeElement; )
70
52
  e = e.shadowRoot.activeElement;
71
53
  return e;
72
54
  }
73
- class c extends w {
55
+ function c(e, o) {
56
+ let t = o;
57
+ for (; t; ) {
58
+ if (t === e) return !0;
59
+ const i = t.getRootNode();
60
+ t = t.parentNode ?? (i instanceof ShadowRoot ? i.host : null);
61
+ }
62
+ return !1;
63
+ }
64
+ function y(e) {
65
+ return !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true";
66
+ }
67
+ function w(e) {
68
+ const o = [];
69
+ return e.querySelectorAll("slot").forEach((t) => {
70
+ t.assignedElements({ flatten: !0 }).forEach((i) => {
71
+ i instanceof HTMLElement && (i.matches(m) && o.push(i), o.push(...Array.from(i.querySelectorAll(m))));
72
+ });
73
+ }), o.filter(y);
74
+ }
75
+ function L(e) {
76
+ return [...Array.from(e.querySelectorAll(m)).filter((t) => window.getComputedStyle(t).display !== "none" && y(t)), ...w(e)];
77
+ }
78
+ function N(e, o) {
79
+ const t = w(e), i = t.filter((a) => a.hasAttribute("autofocus"));
80
+ for (const a of [...i, ...t])
81
+ if (a.focus(), c(a, b())) return;
82
+ o.focus();
83
+ }
84
+ function P(e, o, t) {
85
+ const i = L(t);
86
+ if (i.length === 0) {
87
+ e.preventDefault();
88
+ return;
89
+ }
90
+ const a = i[0], l = i[i.length - 1], s = b(), d = !c(o, s), u = c(a, s), p = c(l, s);
91
+ e.shiftKey ? (u || d) && (e.preventDefault(), l.focus()) : (p || d) && (e.preventDefault(), a.focus());
92
+ }
93
+ class A extends I {
74
94
  constructor() {
75
95
  super();
76
- s(this, "backdropElement");
77
- s(this, "dialogElement");
78
- s(this, "tituloElement");
79
- s(this, "closeElement");
80
- s(this, "_elementoGatilho", null);
81
- s(this, "_focables", []);
82
- s(this, "_tituloId");
96
+ r(this, "backdropElement");
97
+ r(this, "dialogElement");
98
+ r(this, "tituloElement");
99
+ r(this, "closeElement");
100
+ r(this, "ouvintes", new q());
101
+ r(this, "_elementoGatilho", null);
102
+ r(this, "_tituloId");
83
103
  /** Estado já aplicado (pilha, inert, scroll, eventos); difere de `aberto` durante uma transição. */
84
- s(this, "_estaAberto", !1);
85
- s(this, "handleSlotChange", () => {
104
+ r(this, "_estaAberto", !1);
105
+ r(this, "handleSlotChange", () => {
86
106
  this.syncState();
87
107
  });
88
- s(this, "handleBackdropClick", (t) => {
108
+ r(this, "handleBackdropClick", (t) => {
89
109
  t.stopPropagation(), this.fechar();
90
110
  });
91
- s(this, "handleCloseClick", (t) => {
111
+ r(this, "handleCloseClick", (t) => {
92
112
  t.stopPropagation(), this.fechar();
93
113
  });
94
- s(this, "handleKeyDown", (t) => {
95
- var i, o;
96
- if (this._estaAberto && I(this)) {
97
- if (t.key === "Escape")
98
- this.fechar(), t.stopImmediatePropagation();
99
- else if (t.key === "Tab") {
100
- if (this._atualizarFocables(), this._focables.length === 0) {
101
- t.preventDefault();
102
- return;
103
- }
104
- const r = this._focables[0], d = this._focables[this._focables.length - 1], l = this.getRootNode().activeElement;
105
- t.shiftKey ? (l === r || !this.contains(l) && !((i = this.shadowRoot) != null && i.contains(l))) && (t.preventDefault(), d.focus()) : (l === d || !this.contains(l) && !((o = this.shadowRoot) != null && o.contains(l))) && (t.preventDefault(), r.focus());
106
- }
107
- }
114
+ r(this, "handleKeyDown", (t) => {
115
+ this._estaAberto && F(this) && (t.key === "Escape" ? (this.fechar(), t.stopImmediatePropagation()) : t.key === "Tab" && P(t, this, this.shadowRoot));
108
116
  });
109
117
  this._tituloId = `ui-modal-title-${Math.random().toString(36).substring(2, 9)}`;
110
118
  const t = this.attachShadow({ mode: "open" });
111
119
  t.innerHTML = `
112
- <style>${A}</style>
120
+ <style>${z}</style>
113
121
  <div class="ui-modal__backdrop" part="fundo"></div>
114
122
  <div class="ui-modal__dialog" part="painel" role="dialog" aria-modal="true" aria-labelledby="${this._tituloId}" tabindex="-1">
115
123
  <div class="ui-modal__handle"></div>
@@ -141,16 +149,14 @@ class c extends w {
141
149
  ];
142
150
  }
143
151
  connectedCallback() {
144
- this.backdropElement.addEventListener("click", this.handleBackdropClick), this.closeElement.addEventListener("click", this.handleCloseClick), window.addEventListener("keydown", this.handleKeyDown), this.shadowRoot.querySelectorAll("slot").forEach((i) => {
145
- i.addEventListener("slotchange", this.handleSlotChange);
152
+ this.ouvintes.cleanup(), this.ouvintes.add(this.backdropElement, "click", this.handleBackdropClick), this.ouvintes.add(this.closeElement, "click", this.handleCloseClick), this.ouvintes.add(window, "keydown", this.handleKeyDown), this.shadowRoot.querySelectorAll("slot").forEach((t) => {
153
+ this.ouvintes.add(t, "slotchange", this.handleSlotChange);
146
154
  }), this.syncState();
147
155
  }
148
156
  disconnectedCallback() {
149
- this.backdropElement.removeEventListener("click", this.handleBackdropClick), this.closeElement.removeEventListener("click", this.handleCloseClick), window.removeEventListener("keydown", this.handleKeyDown), this.shadowRoot.querySelectorAll("slot").forEach((i) => {
150
- i.removeEventListener("slotchange", this.handleSlotChange);
151
- }), this._estaAberto && (this._estaAberto = !1, p(this));
157
+ this.ouvintes.cleanup(), this._estaAberto && (this._estaAberto = !1, _(this));
152
158
  }
153
- attributeChangedCallback(t, i, o) {
159
+ attributeChangedCallback(t, i, a) {
154
160
  this.syncState();
155
161
  }
156
162
  get aberto() {
@@ -172,67 +178,37 @@ class c extends w {
172
178
  */
173
179
  aoAbrir() {
174
180
  this._estaAberto = !0;
175
- const t = F();
176
- this._elementoGatilho = t && t !== document.body && !this.contains(t) ? t : null, C(this), this.dispatchEvent(new CustomEvent("ui-abrir", { bubbles: !0, composed: !0 })), setTimeout(() => {
177
- this._estaAberto && this.focarConteudoInicial();
181
+ const t = b();
182
+ this._elementoGatilho = t && t !== document.body && !this.contains(t) ? t : null, R(this), this.dispatchEvent(new CustomEvent("ui-abrir", { bubbles: !0, composed: !0 })), setTimeout(() => {
183
+ this._estaAberto && N(this.shadowRoot, this.dialogElement);
178
184
  }, 0);
179
185
  }
180
186
  aoFechar() {
181
- this._estaAberto = !1, p(this), this.dispatchEvent(new CustomEvent("ui-fechar", { bubbles: !0, composed: !0 }));
187
+ this._estaAberto = !1, _(this), this.dispatchEvent(new CustomEvent("ui-fechar", { bubbles: !0, composed: !0 }));
182
188
  const t = this._elementoGatilho;
183
189
  this._elementoGatilho = null;
184
- const i = document.activeElement, o = !i || i === document.body || i === this || this.contains(i);
185
- t != null && t.isConnected && o && t.focus();
186
- }
187
- /**
188
- * Foco inicial: `[autofocus]`, senão o primeiro controle do conteúdo/rodapé.
189
- * O botão "✕" não recebe o foco inicial, evitando fechar o modal com um Enter acidental;
190
- * sem controles, o próprio diálogo é focado para que o leitor de tela anuncie o título.
191
- */
192
- focarConteudoInicial() {
193
- const t = this.obterFocaveisDoConteudo(), i = t.filter((o) => o.hasAttribute("autofocus"));
194
- for (const o of [...i, ...t]) {
195
- o.focus();
196
- const r = document.activeElement;
197
- if (r === o || o.contains(r)) return;
198
- }
199
- this.dialogElement.focus();
190
+ const i = document.activeElement, a = !i || i === document.body || i === this || this.contains(i);
191
+ t != null && t.isConnected && a && t.focus();
200
192
  }
201
193
  syncState() {
202
- var l, m;
203
- const t = this.aberto, i = this.getAttribute("titulo") || this.getAttribute("title") || "", o = (l = this.shadowRoot) == null ? void 0 : l.querySelector(".ui-modal__footer");
194
+ var d, u;
195
+ const t = this.aberto, i = this.getAttribute("titulo") || this.getAttribute("title") || "", a = (d = this.shadowRoot) == null ? void 0 : d.querySelector(".ui-modal__footer");
204
196
  this.dialogElement.setAttribute("aria-hidden", String(!t));
205
- const r = this.getAttribute("aria-label") || this.getAttribute("rotulo"), d = this.getAttribute("aria-labelledby");
206
- if (r ? (this.dialogElement.setAttribute("aria-label", r), this.dialogElement.removeAttribute("aria-labelledby")) : d ? (this.dialogElement.setAttribute("aria-labelledby", d), this.dialogElement.removeAttribute("aria-label")) : i ? (this.tituloElement.textContent = i, this.tituloElement.style.display = "block", this.dialogElement.setAttribute("aria-labelledby", this._tituloId), this.dialogElement.removeAttribute("aria-label")) : (this.tituloElement.style.display = "none", this.dialogElement.removeAttribute("aria-labelledby"), this.dialogElement.setAttribute("aria-label", "Diálogo modal")), o) {
207
- const v = Array.from(((m = this.shadowRoot) == null ? void 0 : m.querySelectorAll('slot[name="rodape"], slot[name="footer"]')) || []).some((x) => x.assignedNodes({ flatten: !0 }).some((h) => h.nodeType === Node.ELEMENT_NODE || h.textContent && h.textContent.trim() !== "")) || this.querySelector('[slot="rodape"], [slot="footer"]') !== null;
208
- o.style.display = v ? "flex" : "none";
197
+ const l = this.getAttribute("aria-label") || this.getAttribute("rotulo"), s = this.getAttribute("aria-labelledby");
198
+ if (l ? (this.dialogElement.setAttribute("aria-label", l), this.dialogElement.removeAttribute("aria-labelledby")) : s ? (this.dialogElement.setAttribute("aria-labelledby", s), this.dialogElement.removeAttribute("aria-label")) : i ? (this.tituloElement.textContent = i, this.tituloElement.style.display = "block", this.dialogElement.setAttribute("aria-labelledby", this._tituloId), this.dialogElement.removeAttribute("aria-label")) : (this.tituloElement.style.display = "none", this.dialogElement.removeAttribute("aria-labelledby"), this.dialogElement.setAttribute("aria-label", "Diálogo modal")), a) {
199
+ const E = Array.from(((u = this.shadowRoot) == null ? void 0 : u.querySelectorAll('slot[name="rodape"], slot[name="footer"]')) || []).some((k) => k.assignedNodes({ flatten: !0 }).some((h) => h.nodeType === Node.ELEMENT_NODE || h.textContent && h.textContent.trim() !== "")) || this.querySelector('[slot="rodape"], [slot="footer"]') !== null;
200
+ a.style.display = E ? "flex" : "none";
209
201
  }
210
202
  this.isConnected && t !== this._estaAberto && (t ? this.aoAbrir() : this.aoFechar());
211
203
  }
212
- static ehFocavel(t) {
213
- return !t.hasAttribute("disabled") && t.getAttribute("aria-hidden") !== "true";
214
- }
215
- /** Focáveis do conteúdo projetado (corpo e rodapé), na ordem dos slots. */
216
- obterFocaveisDoConteudo() {
217
- const t = [];
218
- return this.shadowRoot.querySelectorAll("slot").forEach((i) => {
219
- i.assignedElements({ flatten: !0 }).forEach((o) => {
220
- o instanceof HTMLElement && (o.matches(u) && t.push(o), t.push(...Array.from(o.querySelectorAll(u))));
221
- });
222
- }), t.filter(c.ehFocavel);
223
- }
224
- _atualizarFocables() {
225
- const t = Array.from(this.shadowRoot.querySelectorAll(u)).filter((i) => window.getComputedStyle(i).display !== "none" && c.ehFocavel(i));
226
- this._focables = [...t, ...this.obterFocaveisDoConteudo()];
227
- }
228
204
  }
229
- class L extends c {
205
+ class O extends A {
230
206
  }
231
- f("ui-modal", c);
232
- f("ui-dialog", L);
207
+ g("ui-modal", A);
208
+ g("ui-dialog", O);
233
209
  export {
234
- L as U,
235
- c as a,
236
- k as b,
237
- S as r
210
+ O as U,
211
+ A as a,
212
+ M as b,
213
+ T as r
238
214
  };
@@ -0,0 +1,18 @@
1
+ "use strict";var D=Object.defineProperty;var q=(e,o,t)=>o in e?D(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t;var r=(e,o,t)=>q(e,typeof o!="symbol"?o+"":o,t);const b=require("./ssr-safe-CiHD1adl.cjs"),M=require("./listener-bag-D5omxZ9h.cjs"),z=':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-modal__backdrop{display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:#000000b3;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:calc(var(--ui-z-modal, 1000) - 1);opacity:0;pointer-events:none;transition:opacity .25s ease}:host([aberto]) .ui-modal__backdrop,:host([open]) .ui-modal__backdrop{display:block;opacity:1;pointer-events:auto}.ui-modal__dialog{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%) scale(.95);max-width:560px;width:90%;max-height:85vh;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:var(--ui-raio-borda, 12px);box-shadow:var(--ui-sombra-lg, 0 12px 36px rgba(0, 0, 0, .6));z-index:var(--ui-z-modal, 1000);display:flex;flex-direction:column;opacity:0;visibility:hidden;pointer-events:none;overflow:hidden;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility 0s linear .2s;box-sizing:border-box;color:var(--ui-cor-texto, #e1e1e6)}:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,-50%) scale(1);transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .2s ease,visibility 0s}@starting-style{:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{opacity:0;transform:translate(-50%,-50%) scale(.94)}:host([aberto]) .ui-modal__backdrop,:host([open]) .ui-modal__backdrop{opacity:0}}.ui-modal__handle{display:none;width:36px;height:4px;border-radius:2px;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent);margin:6px auto 12px;flex-shrink:0}.ui-modal__header{padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);gap:12px}.ui-modal__titulo{font-size:18px;font-weight:600;margin:0;color:var(--ui-cor-texto, #e1e1e6)}.ui-modal__close{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-size:16px;cursor:pointer;padding:4px 8px;border-radius:var(--ui-raio-sm, 4px);line-height:1;display:inline-flex;align-items:center;justify-content:center;transition:color .15s ease,background-color .15s ease;touch-action:manipulation;-webkit-tap-highlight-color:transparent}:host([bloquear-fechamento]) .ui-modal__close{display:none}.ui-modal__close svg,.ui-modal__close ::slotted(svg){shape-rendering:geometricPrecision}.ui-modal__close:hover{color:#fff;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent)}.ui-modal__body{padding:20px;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;flex:1;box-sizing:border-box}.ui-modal__footer{padding:14px 20px;display:flex;align-items:center;justify-content:flex-end;gap:12px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);background-color:var(--ui-cor-fundo-recuado, rgba(0, 0, 0, .15))}@media (max-width: 640px){.ui-modal__dialog{top:auto!important;bottom:0!important;left:0!important;transform:translateY(100%)!important;width:100vw!important;max-width:100vw!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;max-height:85vh!important;max-height:85dvh!important;border-bottom:none!important;box-shadow:0 -8px 32px #000000b3!important}.ui-modal__close{min-width:44px;min-height:44px;font-size:18px}.ui-modal__footer{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important}:host([aberto]) .ui-modal__dialog,:host([open]) .ui-modal__dialog{transform:translateY(0)!important}.ui-modal__handle{display:block!important}}:host([bottom-sheet]) .ui-modal__dialog{top:auto!important;bottom:0!important;left:0!important;transform:translateY(100%)!important;width:100vw!important;max-width:100vw!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;max-height:85vh!important;max-height:85dvh!important;border-bottom:none!important;box-shadow:0 -8px 32px #000000b3!important}:host([bottom-sheet]) .ui-modal__close{min-width:44px;min-height:44px;font-size:18px}:host([bottom-sheet]) .ui-modal__footer{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important}:host([bottom-sheet][aberto]) .ui-modal__dialog,:host([bottom-sheet][open]) .ui-modal__dialog{transform:translateY(0)!important}:host([bottom-sheet]) .ui-modal__handle{display:block!important}';function T(e){return e.tagName==="SCRIPT"||e.tagName==="STYLE"}function v(e){const o=new Set;if(typeof document>"u")return o;const t=a=>{a===e||a.contains(e)||T(a)||a.inert||a.hasAttribute("inert")||(a.setAttribute("inert",""),a.inert=!0,o.add(a))};let i=e;for(;i&&i!==document.body&&i!==document.documentElement;){const a=i.parentElement;if(!a)break;Array.from(a.children).forEach(l=>t(l)),i=a}return document.body&&Array.from(document.body.children).forEach(a=>t(a)),o}function y(e){e.forEach(o=>{o.removeAttribute("inert"),o.inert=!1}),e.clear()}const n=[];let _=new Set,w="";function E(){y(_);const e=n[n.length-1];_=e?v(e):new Set}function F(e){const o=n.indexOf(e);o>=0&&n.splice(o,1),n.length===0&&(w=document.body.style.overflow,document.body.style.overflow="hidden"),n.push(e),E()}function x(e){const o=n.indexOf(e);o<0||(n.splice(o,1),n.length===0&&(document.body.style.overflow=w),E())}function R(e){return n[n.length-1]===e}const m='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), ui-campo-texto, ui-input, ui-botao, ui-botao-primario, ui-checkbox, ui-switch, ui-lista-flutuante, ui-radio, ui-select, ui-segmented';function p(){var o;let e=document.activeElement;for(;(o=e==null?void 0:e.shadowRoot)!=null&&o.activeElement;)e=e.shadowRoot.activeElement;return e}function c(e,o){let t=o;for(;t;){if(t===e)return!0;const i=t.getRootNode();t=t.parentNode??(i instanceof ShadowRoot?i.host:null)}return!1}function A(e){return!e.hasAttribute("disabled")&&e.getAttribute("aria-hidden")!=="true"}function k(e){const o=[];return e.querySelectorAll("slot").forEach(t=>{t.assignedElements({flatten:!0}).forEach(i=>{i instanceof HTMLElement&&(i.matches(m)&&o.push(i),o.push(...Array.from(i.querySelectorAll(m))))})}),o.filter(A)}function L(e){return[...Array.from(e.querySelectorAll(m)).filter(t=>window.getComputedStyle(t).display!=="none"&&A(t)),...k(e)]}function N(e,o){const t=k(e),i=t.filter(a=>a.hasAttribute("autofocus"));for(const a of[...i,...t])if(a.focus(),c(a,p()))return;o.focus()}function P(e,o,t){const i=L(t);if(i.length===0){e.preventDefault();return}const a=i[0],l=i[i.length-1],s=p(),d=!c(o,s),u=c(a,s),g=c(l,s);e.shiftKey?(u||d)&&(e.preventDefault(),l.focus()):(g||d)&&(e.preventDefault(),a.focus())}class f extends b.SafeHTMLElement{constructor(){super();r(this,"backdropElement");r(this,"dialogElement");r(this,"tituloElement");r(this,"closeElement");r(this,"ouvintes",new M.ListenerBag);r(this,"_elementoGatilho",null);r(this,"_tituloId");r(this,"_estaAberto",!1);r(this,"handleSlotChange",()=>{this.syncState()});r(this,"handleBackdropClick",t=>{t.stopPropagation(),this.fechar()});r(this,"handleCloseClick",t=>{t.stopPropagation(),this.fechar()});r(this,"handleKeyDown",t=>{this._estaAberto&&R(this)&&(t.key==="Escape"?(this.fechar(),t.stopImmediatePropagation()):t.key==="Tab"&&P(t,this,this.shadowRoot))});this._tituloId=`ui-modal-title-${Math.random().toString(36).substring(2,9)}`;const t=this.attachShadow({mode:"open"});t.innerHTML=`
2
+ <style>${z}</style>
3
+ <div class="ui-modal__backdrop" part="fundo"></div>
4
+ <div class="ui-modal__dialog" part="painel" role="dialog" aria-modal="true" aria-labelledby="${this._tituloId}" tabindex="-1">
5
+ <div class="ui-modal__handle"></div>
6
+ <div class="ui-modal__header" part="cabecalho">
7
+ <h3 class="ui-modal__titulo" part="titulo" id="${this._tituloId}"></h3>
8
+ <button class="ui-modal__close" part="fechar" type="button" aria-label="Fechar modal" title="Fechar">✕</button>
9
+ </div>
10
+ <div class="ui-modal__body" part="corpo">
11
+ <slot></slot>
12
+ </div>
13
+ <div class="ui-modal__footer" part="rodape">
14
+ <slot name="rodape"></slot>
15
+ <slot name="footer"></slot>
16
+ </div>
17
+ </div>
18
+ `,this.backdropElement=t.querySelector(".ui-modal__backdrop"),this.dialogElement=t.querySelector(".ui-modal__dialog"),this.tituloElement=t.querySelector(".ui-modal__titulo"),this.closeElement=t.querySelector(".ui-modal__close")}static get observedAttributes(){return["aberto","open","titulo","title","aria-label","aria-labelledby","rotulo","bottom-sheet","bloquear-fechamento"]}connectedCallback(){this.ouvintes.cleanup(),this.ouvintes.add(this.backdropElement,"click",this.handleBackdropClick),this.ouvintes.add(this.closeElement,"click",this.handleCloseClick),this.ouvintes.add(window,"keydown",this.handleKeyDown),this.shadowRoot.querySelectorAll("slot").forEach(t=>{this.ouvintes.add(t,"slotchange",this.handleSlotChange)}),this.syncState()}disconnectedCallback(){this.ouvintes.cleanup(),this._estaAberto&&(this._estaAberto=!1,x(this))}attributeChangedCallback(t,i,a){this.syncState()}get aberto(){return this.hasAttribute("aberto")||this.hasAttribute("open")}set aberto(t){t?this.setAttribute("aberto",""):(this.removeAttribute("aberto"),this.removeAttribute("open"))}abrir(){this.aberto=!0}fechar(){this.hasAttribute("bloquear-fechamento")||(this.aberto=!1)}aoAbrir(){this._estaAberto=!0;const t=p();this._elementoGatilho=t&&t!==document.body&&!this.contains(t)?t:null,F(this),this.dispatchEvent(new CustomEvent("ui-abrir",{bubbles:!0,composed:!0})),setTimeout(()=>{this._estaAberto&&N(this.shadowRoot,this.dialogElement)},0)}aoFechar(){this._estaAberto=!1,x(this),this.dispatchEvent(new CustomEvent("ui-fechar",{bubbles:!0,composed:!0}));const t=this._elementoGatilho;this._elementoGatilho=null;const i=document.activeElement,a=!i||i===document.body||i===this||this.contains(i);t!=null&&t.isConnected&&a&&t.focus()}syncState(){var d,u;const t=this.aberto,i=this.getAttribute("titulo")||this.getAttribute("title")||"",a=(d=this.shadowRoot)==null?void 0:d.querySelector(".ui-modal__footer");this.dialogElement.setAttribute("aria-hidden",String(!t));const l=this.getAttribute("aria-label")||this.getAttribute("rotulo"),s=this.getAttribute("aria-labelledby");if(l?(this.dialogElement.setAttribute("aria-label",l),this.dialogElement.removeAttribute("aria-labelledby")):s?(this.dialogElement.setAttribute("aria-labelledby",s),this.dialogElement.removeAttribute("aria-label")):i?(this.tituloElement.textContent=i,this.tituloElement.style.display="block",this.dialogElement.setAttribute("aria-labelledby",this._tituloId),this.dialogElement.removeAttribute("aria-label")):(this.tituloElement.style.display="none",this.dialogElement.removeAttribute("aria-labelledby"),this.dialogElement.setAttribute("aria-label","Diálogo modal")),a){const C=Array.from(((u=this.shadowRoot)==null?void 0:u.querySelectorAll('slot[name="rodape"], slot[name="footer"]'))||[]).some(I=>I.assignedNodes({flatten:!0}).some(h=>h.nodeType===Node.ELEMENT_NODE||h.textContent&&h.textContent.trim()!==""))||this.querySelector('[slot="rodape"], [slot="footer"]')!==null;a.style.display=C?"flex":"none"}this.isConnected&&t!==this._estaAberto&&(t?this.aoAbrir():this.aoFechar())}}class S extends f{}b.definirCustomElement("ui-modal",f);b.definirCustomElement("ui-dialog",S);exports.UIDialog=S;exports.UIModal=f;exports.aplicarInertForaDoModal=v;exports.removerInertForaDoModal=y;