@prolibu-suite/cobalt-core 0.11.7 → 0.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1 -1
- package/dist/cjs/co-calendar_3.cjs.entry.js +2 -1
- package/dist/cjs/co-kbd_2.cjs.entry.js +5 -4
- package/dist/cjs/co-lightbox.cjs.entry.js +7 -6
- package/dist/cjs/co-overlay.cjs.entry.js +4 -3
- package/dist/cjs/co-popover.cjs.entry.js +5 -4
- package/dist/cjs/popoverApi-D1ChCCdO.js +27 -0
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/p-2832ab99.entry.js +1 -0
- package/dist/cobalt/p-299c2425.entry.js +1 -0
- package/dist/cobalt/p-Dp1JT0dm.js +1 -0
- package/dist/cobalt/p-b723aa47.entry.js +1 -0
- package/dist/cobalt/p-eab59be5.entry.js +1 -0
- package/dist/cobalt/p-f562bd96.entry.js +1 -0
- package/dist/collection/components/co-drawer/co-drawer.js +2 -1
- package/dist/collection/components/co-lightbox/co-lightbox.js +7 -6
- package/dist/collection/components/co-overlay/co-overlay.js +4 -3
- package/dist/collection/components/co-popover/co-popover.js +5 -4
- package/dist/collection/components/co-tooltip/co-tooltip.js +5 -4
- package/dist/collection/utils/popoverApi.js +23 -0
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-avatar-group.js +1 -1
- package/dist/components/co-avatar.js +1 -1
- package/dist/components/co-color-picker.js +1 -1
- package/dist/components/co-combobox.js +1 -1
- package/dist/components/co-command-search.js +1 -1
- package/dist/components/co-data-table.js +1 -1
- package/dist/components/co-date-picker.js +1 -1
- package/dist/components/co-date-range-picker.js +1 -1
- package/dist/components/co-date-range.js +1 -1
- package/dist/components/co-date-time-picker.js +1 -1
- package/dist/components/co-document-editor.js +1 -1
- package/dist/components/co-drawer.js +1 -1
- package/dist/components/co-file-field.js +1 -1
- package/dist/components/co-lightbox.js +1 -1
- package/dist/components/co-list-item.js +1 -1
- package/dist/components/co-menu-item.js +1 -1
- package/dist/components/co-menu.js +1 -1
- package/dist/components/co-modal.js +1 -1
- package/dist/components/co-option-list.js +1 -1
- package/dist/components/co-overlay.js +1 -1
- package/dist/components/co-popover.js +1 -1
- package/dist/components/co-ref-field.js +1 -1
- package/dist/components/co-select.js +1 -1
- package/dist/components/co-sidebar-nav.js +1 -1
- package/dist/components/co-tooltip.js +1 -1
- package/dist/components/{p-_S5htX1i.js → p-BGNXvnDr.js} +1 -1
- package/dist/components/p-BMyWdiVO.js +1 -0
- package/dist/components/{p-CaFwCFgg.js → p-BRIf9NGv.js} +1 -1
- package/dist/components/p-Bd6H9_5D.js +1 -0
- package/dist/components/{p-upZqhFKo.js → p-BkyYV32T.js} +1 -1
- package/dist/components/p-DHIa14ep.js +1 -0
- package/dist/components/p-DRL-a5hO.js +1 -0
- package/dist/components/p-Dp1JT0dm.js +1 -0
- package/dist/components/p-xA7AfoIW.js +1 -0
- package/dist/esm/co-calendar_3.entry.js +2 -1
- package/dist/esm/co-kbd_2.entry.js +5 -4
- package/dist/esm/co-lightbox.entry.js +7 -6
- package/dist/esm/co-overlay.entry.js +4 -3
- package/dist/esm/co-popover.entry.js +5 -4
- package/dist/esm/popoverApi-Dp1JT0dm.js +25 -0
- package/dist/types/utils/popoverApi.d.ts +12 -0
- package/package.json +3 -3
- package/dist/cobalt/p-60ea3d33.entry.js +0 -1
- package/dist/cobalt/p-84256bde.entry.js +0 -1
- package/dist/cobalt/p-8c22bf4b.entry.js +0 -1
- package/dist/cobalt/p-b2c49664.entry.js +0 -1
- package/dist/cobalt/p-cf675968.entry.js +0 -1
- package/dist/components/p-B5F93Ujt.js +0 -1
- package/dist/components/p-CMMv2RcH.js +0 -1
- package/dist/components/p-CX0bNXK3.js +0 -1
- package/dist/components/p-Co0eKIiO.js +0 -1
- package/dist/components/p-xtGT3YeI.js +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as getElement } from './index-DJkaRtbb.js';
|
|
2
2
|
import { l as langFromLocale } from './dateI18n-jYd9gu_c.js';
|
|
3
|
+
import { i as isPopoverOpen } from './popoverApi-Dp1JT0dm.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Built-in UI string dictionary for co-lightbox (aria labels + tooltips).
|
|
@@ -143,12 +144,12 @@ const CoLightbox = class {
|
|
|
143
144
|
if (this.open) {
|
|
144
145
|
clearTimeout(this.demoteTimer);
|
|
145
146
|
try {
|
|
146
|
-
if (!root
|
|
147
|
+
if (!isPopoverOpen(root))
|
|
147
148
|
root.showPopover();
|
|
148
149
|
}
|
|
149
150
|
catch ( /* not connected yet — the ref call retries */_a) { /* not connected yet — the ref call retries */ }
|
|
150
151
|
}
|
|
151
|
-
else if (root
|
|
152
|
+
else if (isPopoverOpen(root)) {
|
|
152
153
|
// Let the opacity fade-out run before display:none kicks in.
|
|
153
154
|
clearTimeout(this.demoteTimer);
|
|
154
155
|
this.demoteTimer = setTimeout(() => {
|
|
@@ -580,7 +581,7 @@ const CoLightbox = class {
|
|
|
580
581
|
const counter = s.counter
|
|
581
582
|
.replace('{i}', String(this.index + 1))
|
|
582
583
|
.replace('{n}', String(imgs.length));
|
|
583
|
-
return (h("div", { key: '
|
|
584
|
+
return (h("div", { key: '0e6491fbe0eb9515df66d167abb555ee00d68a07', class: { 'co-lightbox': true, 'co-lightbox--open': this.open }, part: "overlay", role: "dialog", "aria-modal": "true", "aria-label": img === null || img === void 0 ? void 0 : img.alt, popover: "manual", ref: this.syncTopLayer, onClick: this.requestClose }, img && (h("div", { key: '799faaab6bb3504d723732d47618d2489ff9eae4', class: "co-lightbox__toolbar", part: "toolbar", onClick: this.stop }, h("span", { key: 'a9fe7f715cb0b76c4c411514ab872f45022be9ed', class: "co-lightbox__caption", title: img.alt }, img.alt), !video && (h("div", { key: '9e0df923dd41bfaa5ed3ba28538e170529a19823', class: "co-lightbox__zoom" }, h("button", { key: 'c56a015724fe92be890e6d2681e552c303c02b0a', class: "co-lightbox__btn", type: "button", "aria-label": s.zoomOut, title: s.zoomOut, onClick: () => this.zoomAt(this.scale / WHEEL_FACTOR, 0, 0) }, h("co-icon", { key: '6b84a1dac161507d4084fba067aa1d2b4bfea5ea', name: "minus", size: 16 })), h("button", { key: '0e4747500888c3bb7a35dbe490d936de053f1a0c', class: "co-lightbox__btn co-lightbox__zoom-value", type: "button", "aria-label": s.zoomReset, title: s.zoomReset, onClick: () => this.resetView() }, Math.round(this.scale * 100), "%"), h("button", { key: '52d89aa312e2eacf96072dd1f4b14f04a5966e81', class: "co-lightbox__btn", type: "button", "aria-label": s.zoomIn, title: s.zoomIn, onClick: () => this.zoomAt(this.scale * WHEEL_FACTOR, 0, 0) }, h("co-icon", { key: 'a32b55340d8027b57595c097d992de88b5cd8799', name: "plus", size: 16 })))), h("button", { key: 'f138d46223ac0db43b3ce037f323bb5f226260a9', class: "co-lightbox__btn", type: "button", "aria-label": s.openOriginal, title: s.openOriginal, onClick: this.openOriginal }, h("co-icon", { key: 'e39089e43b1178eb20bce0647c7b3f19e0c58110', name: "arrow-square-out", size: 16 })), h("button", { key: 'c52ebe7347d11c0c1416978002cc2b67ffc94a25', class: "co-lightbox__btn", part: "close", type: "button", "aria-label": s.close, title: s.close, ref: (el) => (this.closeBtnEl = el), onClick: this.requestClose }, h("co-icon", { key: 'bb3e0aac0dfa10c8b5de5cb54bd7601a8ae66dec', name: "x", size: 16 })))), img && (h("div", { key: '3597bd31e1b65efbb2c02cb55dbacf0ec43d7639', class: "co-lightbox__stage", ref: (el) => (this.stageEl = el), onWheel: video ? undefined : this.handleWheel }, video ? (h("co-video", { class: "co-lightbox__video", part: "video",
|
|
584
585
|
/* Keyed per slide: a fresh player is the only way to be sure
|
|
585
586
|
poster, error state and playback all start clean. */
|
|
586
587
|
key: `video-${this.index}`, ref: this.mountPlayer, src: img.src, poster: img.poster || '', aspectRatio: "auto", rounded: "none",
|
|
@@ -590,13 +591,13 @@ const CoLightbox = class {
|
|
|
590
591
|
'co-lightbox__img': true,
|
|
591
592
|
'co-lightbox__img--zoomed': this.scale > MIN_SCALE,
|
|
592
593
|
'co-lightbox__img--dragging': this.dragging,
|
|
593
|
-
}, part: "image", ref: (el) => (this.imgEl = el), src: img.src, alt: img.alt || '', draggable: false, style: { transform: `translate(${this.tx}px, ${this.ty}px) scale(${this.scale})` }, onClick: this.stop, onDblClick: this.handleDblClick, onPointerDown: this.handlePointerDown, onPointerMove: this.handlePointerMove, onPointerUp: this.handlePointerUp, onPointerCancel: this.handlePointerUp })))), img && multi && (h("button", { key: '
|
|
594
|
+
}, part: "image", ref: (el) => (this.imgEl = el), src: img.src, alt: img.alt || '', draggable: false, style: { transform: `translate(${this.tx}px, ${this.ty}px) scale(${this.scale})` }, onClick: this.stop, onDblClick: this.handleDblClick, onPointerDown: this.handlePointerDown, onPointerMove: this.handlePointerMove, onPointerUp: this.handlePointerUp, onPointerCancel: this.handlePointerUp })))), img && multi && (h("button", { key: '5185685a016df10825bd2ddd4479c074ab88b9e4', class: "co-lightbox__nav co-lightbox__nav--prev", part: "prev", type: "button", "aria-label": s.prevImage, title: s.prevImage, onClick: (e) => {
|
|
594
595
|
e.stopPropagation();
|
|
595
596
|
this.goTo(-1);
|
|
596
|
-
} }, h("co-icon", { key: '
|
|
597
|
+
} }, h("co-icon", { key: 'ff3d9a5e57dc9e74ef29c9ee8696040f46a295f2', name: "caret-left", size: 24 }))), img && multi && (h("button", { key: '33eaec6709a4f22490ff56c93a32de332c6adc65', class: "co-lightbox__nav co-lightbox__nav--next", part: "next", type: "button", "aria-label": s.nextImage, title: s.nextImage, onClick: (e) => {
|
|
597
598
|
e.stopPropagation();
|
|
598
599
|
this.goTo(1);
|
|
599
|
-
} }, h("co-icon", { key: '
|
|
600
|
+
} }, h("co-icon", { key: '1631e46b4d05c2f1495842adb2a6e524dc67b47d', name: "caret-right", size: 24 }))), img && multi && (h("div", { key: 'cf751691f9dffb1325c9a5183b1cca2c01bd28c4', class: "co-lightbox__counter", part: "counter", onClick: this.stop }, counter))));
|
|
600
601
|
}
|
|
601
602
|
get el() { return getElement(this); }
|
|
602
603
|
static get watchers() { return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as getElement } from './index-DJkaRtbb.js';
|
|
2
2
|
import { a as afterEventFor } from './overlayAfterClose-Ch1jfwZ2.js';
|
|
3
|
+
import { i as isPopoverOpen } from './popoverApi-Dp1JT0dm.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* ¿Un `click` sobre el fondo del overlay es un gesto de cierre?
|
|
@@ -311,7 +312,7 @@ const CoOverlay = class {
|
|
|
311
312
|
const el = this.overlayEl;
|
|
312
313
|
if (!this.open || !el || typeof el.showPopover !== 'function')
|
|
313
314
|
return;
|
|
314
|
-
if (!el
|
|
315
|
+
if (!isPopoverOpen(el))
|
|
315
316
|
return;
|
|
316
317
|
const active = this.deepActiveElement();
|
|
317
318
|
el.classList.add(REFRONT_CLASS);
|
|
@@ -352,7 +353,7 @@ const CoOverlay = class {
|
|
|
352
353
|
if (!el || typeof el.showPopover !== 'function')
|
|
353
354
|
return;
|
|
354
355
|
try {
|
|
355
|
-
const isShown = el
|
|
356
|
+
const isShown = isPopoverOpen(el);
|
|
356
357
|
if (this.open && !isShown)
|
|
357
358
|
el.showPopover();
|
|
358
359
|
else if (!this.open && isShown)
|
|
@@ -452,7 +453,7 @@ const CoOverlay = class {
|
|
|
452
453
|
focusables[nextIndex].focus();
|
|
453
454
|
}
|
|
454
455
|
render() {
|
|
455
|
-
return (h("div", { key: '
|
|
456
|
+
return (h("div", { key: '419d44027ef0e270aa9bddccc83bf3e93e1e78db', class: { 'co-overlay': true, 'co-overlay--open': this.open }, part: "overlay", popover: "manual", tabindex: this.trapFocus ? -1 : undefined, ref: (el) => (this.overlayEl = el), onPointerDown: this.handlePointerDown, onPointerUp: this.handlePointerUp, onClick: this.handleClick, onTransitionEnd: this.handleTransitionEnd }, h("slot", { key: '34ffc7586b41bced7d7f56b6189f654c1c5e1a7f' })));
|
|
456
457
|
}
|
|
457
458
|
get el() { return getElement(this); }
|
|
458
459
|
static get watchers() { return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as getElement } from './index-DJkaRtbb.js';
|
|
2
2
|
import { i as isAnchorVisible, c as computePosition, g as getOffsetAncestor, f as findScrollParents } from './positioning-BtliEQAT.js';
|
|
3
|
+
import { i as isPopoverOpen } from './popoverApi-Dp1JT0dm.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Pila global de popovers abiertos (orden de apertura). Permite que el
|
|
@@ -210,7 +211,7 @@ const CoPopover = class {
|
|
|
210
211
|
// resolves against the viewport regardless of any transformed/filtered
|
|
211
212
|
// ancestor — so skip the offset-ancestor compensation. It only applies in
|
|
212
213
|
// the no-Popover-API fallback where the panel still renders in place.
|
|
213
|
-
const promoted = this.panelEl
|
|
214
|
+
const promoted = isPopoverOpen(this.panelEl);
|
|
214
215
|
if (!promoted) {
|
|
215
216
|
if (!this.offsetAncestorComputed) {
|
|
216
217
|
this.cachedOffsetAncestor = getOffsetAncestor(this.panelEl);
|
|
@@ -386,7 +387,7 @@ const CoPopover = class {
|
|
|
386
387
|
if (!el || typeof el.showPopover !== 'function')
|
|
387
388
|
return;
|
|
388
389
|
try {
|
|
389
|
-
if (!el
|
|
390
|
+
if (!isPopoverOpen(el))
|
|
390
391
|
el.showPopover();
|
|
391
392
|
}
|
|
392
393
|
catch (_a) {
|
|
@@ -444,13 +445,13 @@ const CoPopover = class {
|
|
|
444
445
|
}
|
|
445
446
|
// ── Render ─────────────────────────────────────────────────
|
|
446
447
|
render() {
|
|
447
|
-
return (h("div", { key: '
|
|
448
|
+
return (h("div", { key: '36563fc43d535139e1dcacf5c10f7d94ac7c3c56', class: "co-popover" }, h("div", { key: 'b89ff545f53702c42e95058449644af4336c7b8e', class: "co-popover__trigger", ref: (el) => (this.triggerEl = el), onClick: this.handleTriggerClick }, h("slot", { key: 'aacbf2fbf099af3402d2a09d2f003893ed01b6da', name: "trigger" })), (this.open || this.closing) && (h("div", { key: '571d316922717803b4645e66302068f8081e8d36', class: { 'co-popover__panel': true, 'co-popover__panel--closing': this.closing }, part: "panel", popover: "manual", onTransitionEnd: this.handlePanelTransitionEnd, ref: (el) => {
|
|
448
449
|
if (el && el !== this.panelEl) {
|
|
449
450
|
this.panelEl = el;
|
|
450
451
|
this.promotePanel();
|
|
451
452
|
this.scheduleUpdate();
|
|
452
453
|
}
|
|
453
|
-
} }, h("slot", { key: '
|
|
454
|
+
} }, h("slot", { key: 'cd42d52c6bbdf2522ce692b75ba556da35c8a5b9' })))));
|
|
454
455
|
}
|
|
455
456
|
get el() { return getElement(this); }
|
|
456
457
|
static get watchers() { return {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover API (top layer) con caída segura para navegadores que no la traen
|
|
3
|
+
* (Chrome / Android WebView < 114: Android 12 sin actualizar viene con Chrome 99).
|
|
4
|
+
*
|
|
5
|
+
* ⛔ Nunca `el.matches(':popover-open')` pelado: en esos navegadores el pseudo-selector es
|
|
6
|
+
* DESCONOCIDO y `matches()` LANZA `SyntaxError` — en co-popover cortaba `updatePosition` antes de
|
|
7
|
+
* marcar el panel como posicionado y todo dropdown quedaba invisible (reporte 2026-10-01). Sin la
|
|
8
|
+
* API nada está promovido: el panel vive en su lugar con `position: fixed` + compensación del
|
|
9
|
+
* ancestro (la rama «fallback» que cada componente ya tiene).
|
|
10
|
+
*/
|
|
11
|
+
function supportsPopover(el) {
|
|
12
|
+
return !!el && typeof el.showPopover === 'function';
|
|
13
|
+
}
|
|
14
|
+
function isPopoverOpen(el) {
|
|
15
|
+
if (!supportsPopover(el))
|
|
16
|
+
return false;
|
|
17
|
+
try {
|
|
18
|
+
return el.matches(':popover-open');
|
|
19
|
+
}
|
|
20
|
+
catch (_a) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { isPopoverOpen as i };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover API (top layer) con caída segura para navegadores que no la traen
|
|
3
|
+
* (Chrome / Android WebView < 114: Android 12 sin actualizar viene con Chrome 99).
|
|
4
|
+
*
|
|
5
|
+
* ⛔ Nunca `el.matches(':popover-open')` pelado: en esos navegadores el pseudo-selector es
|
|
6
|
+
* DESCONOCIDO y `matches()` LANZA `SyntaxError` — en co-popover cortaba `updatePosition` antes de
|
|
7
|
+
* marcar el panel como posicionado y todo dropdown quedaba invisible (reporte 2026-10-01). Sin la
|
|
8
|
+
* API nada está promovido: el panel vive en su lugar con `position: fixed` + compensación del
|
|
9
|
+
* ancestro (la rama «fallback» que cada componente ya tiene).
|
|
10
|
+
*/
|
|
11
|
+
export declare function supportsPopover(el: Element | null | undefined): boolean;
|
|
12
|
+
export declare function isPopoverOpen(el: Element | null | undefined): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prolibu-suite/cobalt-core",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.8",
|
|
4
4
|
"description": "Cobalt Design System — Framework-agnostic Web Components built with Stencil",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@phosphor-icons/core": "^2.1.1",
|
|
51
51
|
"dompurify": "^3.2.6",
|
|
52
52
|
"overlayscrollbars": "^2.16.0",
|
|
53
|
+
"@prolibu-suite/cobalt-calendar-utils": "0.1.1",
|
|
53
54
|
"@prolibu-suite/cobalt-rich-text": "0.2.2",
|
|
54
55
|
"@prolibu-suite/cobalt-tokens": "0.6.1",
|
|
55
|
-
"@prolibu-suite/cobalt-date-utils": "0.1.2"
|
|
56
|
-
"@prolibu-suite/cobalt-calendar-utils": "0.1.1"
|
|
56
|
+
"@prolibu-suite/cobalt-date-utils": "0.1.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@stencil/core": "^4.43.4",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as n,h as i,a as o}from"./p-DJkaRtbb.js";import{a as e}from"./p-Ch1jfwZ2.js";const r=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])','[tabindex]:not([tabindex="-1"])'].join(",");function s(t){if(t.shadowRoot)return Array.from(t.shadowRoot.children);if("SLOT"===t.tagName){const n=t.assignedElements({flatten:!0});return n.length?n:Array.from(t.children)}return Array.from(t.children)}function a(t){var n,i;if(!(null===(n=t.matches)||void 0===n?void 0:n.call(t,r))||t.hasAttribute("disabled"))return!1;const o=t.getAttribute("tabindex");return!(null!==o&&Number(o)<0||null===t.offsetParent&&0===t.getClientRects().length||!1===(null===(i=t.checkVisibility)||void 0===i?void 0:i.call(t,{visibilityProperty:!0})))}function c(t,n){const i=t=>{return"true"!==(o=t).getAttribute("aria-hidden")&&!o.hasAttribute("inert")&&(!!n(t)||s(t).some(i));var o};s(t).some(i)}function h(t,n){let i=null;return c(t,(t=>!!n(t)&&(i=t,!0))),i}function l(t){const n=[];return c(t,(t=>(a(t)&&n.push(t),!1))),n}function u(t,n){return t.length>0&&t[t.length-1]===n}let d=0,f="";const p=[];let v=0;const y="co-overlay--refront";function b(t){"function"==typeof requestAnimationFrame?requestAnimationFrame(t):t()}const m=class{constructor(i){t(this,i),this.coClose=n(this,"coClose",7),this.coAfterClose=n(this,"coAfterClose",3),this.coAfterOpen=n(this,"coAfterOpen",3),this.open=!1,this.trapFocus=!1,this.closeOnEscape=!1,this.hasLock=!1,this.trapId="co-overlay-trap-"+ ++v,this.trapping=!1,this.pressDownTarget=null,this.pressUpTarget=null,this.handlePointerDown=t=>{var n;this.pressDownTarget=null!==(n=t.composedPath()[0])&&void 0!==n?n:null,this.pressUpTarget=null},this.handlePointerUp=t=>{var n;this.pressUpTarget=null!==(n=t.composedPath()[0])&&void 0!==n?n:null},this.handleClick=t=>{var n;const i=null!==(n=t.composedPath()[0])&&void 0!==n?n:null,o=i===this.overlayEl&&function(t,n,i){return null!==t&&t===n&&n===i}(this.pressDownTarget,this.pressUpTarget,i);this.pressDownTarget=null,this.pressUpTarget=null,o&&this.coClose.emit()},this.handleTransitionEnd=t=>{if(t.target!==this.overlayEl)return;const n=e(t.propertyName,this.open,"opacity");"after-open"===n?this.coAfterOpen.emit():"after-close"===n&&this.coAfterClose.emit()}}onOpenChange(t){t?this.acquireLock():this.releaseLock(),this.syncPopover(),this.syncTrap()}onTrapFocusChange(){this.syncTrap()}componentDidLoad(){this.open&&this.acquireLock(),this.syncPopover(),this.syncTrap()}disconnectedCallback(){this.releaseLock(),this.releaseTrap()}async bringToFront(){const t=this.overlayEl;if(!this.open||!t||"function"!=typeof t.showPopover)return;if(!t.matches(":popover-open"))return;const n=this.deepActiveElement();t.classList.add(y);try{t.hidePopover(),t.showPopover()}catch(t){}n&&n.isConnected&&this.deepActiveElement()!==n&&n.focus({preventScroll:!0}),b((()=>t.classList.remove(y)))}acquireLock(){this.hasLock||(this.hasLock=!0,"undefined"!=typeof document&&(0===d&&(f=document.body.style.overflow,document.body.style.overflow="hidden"),d++))}releaseLock(){this.hasLock&&(this.hasLock=!1,"undefined"!=typeof document&&0!==d&&(d--,0===d&&(document.body.style.overflow=f)))}syncPopover(){const t=this.overlayEl;if(t&&"function"==typeof t.showPopover)try{const n=t.matches(":popover-open");this.open&&!n?t.showPopover():!this.open&&n&&t.hidePopover()}catch(t){}}syncTrap(){this.open&&this.trapFocus?this.engageTrap():this.releaseTrap()}engageTrap(){this.trapping||(this.trapping=!0,p.push(this.trapId),this.captureAndFocus())}releaseTrap(){if(!this.trapping)return;this.trapping=!1;const t=p.indexOf(this.trapId);t>=0&&p.splice(t,1),this.restoreFocus()}captureAndFocus(){this.returnFocusEl=this.deepActiveElement(),b((()=>{var t;if(!this.open||!this.trapping||!u(p,this.trapId))return;const n=function(t){const n=h(t,(t=>t.hasAttribute("autofocus")));if(n){if(a(n))return n;const t=n.shadowRoot?l(n)[0]:void 0;if(t)return t}return h(t,a)}(this.el);n?n.focus():null===(t=this.overlayEl)||void 0===t||t.focus()}))}restoreFocus(){const t=this.returnFocusEl;this.returnFocusEl=null,t&&t.isConnected&&"function"==typeof t.focus&&t.focus({preventScroll:!0})}deepActiveElement(){if("undefined"==typeof document)return null;let t=document.activeElement;for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}handleKeydown(t){this.open&&(this.closeOnEscape&&"Escape"===t.key?this.coClose.emit():this.trapping&&"Tab"===t.key&&u(p,this.trapId)&&this.trapTab(t))}trapTab(t){var n;if(t.defaultPrevented)return;const i=l(this.el);if(0===i.length)return t.preventDefault(),void(null===(n=this.overlayEl)||void 0===n||n.focus());const o=i.indexOf(this.deepActiveElement()),e=function(t,n,i){return t<=0?-1:i?n<=0?t-1:n-1:-1===n||n>=t-1?0:n+1}(i.length,o,t.shiftKey);e<0||(t.preventDefault(),i[e].focus())}render(){return i("div",{key:"9d6cec0764074a33489f79fb4a554e7aa7374785",class:{"co-overlay":!0,"co-overlay--open":this.open},part:"overlay",popover:"manual",tabindex:this.trapFocus?-1:void 0,ref:t=>this.overlayEl=t,onPointerDown:this.handlePointerDown,onPointerUp:this.handlePointerUp,onClick:this.handleClick,onTransitionEnd:this.handleTransitionEnd},i("slot",{key:"2f8ad7b23e72ce2f5c74b3cb67ba9ab80e88cf26"}))}get el(){return o(this)}static get watchers(){return{open:[{onOpenChange:0}],trapFocus:[{onTrapFocusChange:0}]}}};m.style=":host{display:contents}.co-overlay{position:fixed;inset:0;z-index:1000;margin:0;border:0;padding:0;width:auto;height:auto;max-width:none;max-height:none;overflow:visible;color:inherit;display:flex;align-items:center;justify-content:center;background:var(--co-overlay-bg, rgba(0, 0, 0, 0.4));-webkit-backdrop-filter:blur(var(--co-overlay-blur, 2px));backdrop-filter:blur(var(--co-overlay-blur, 2px));opacity:0;pointer-events:none;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-in)}.co-overlay--open{opacity:1;pointer-events:auto;transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-overlay--refront{transition:none !important}";export{m as co_overlay}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,a as o}from"./p-DJkaRtbb.js";import{i as e,c as h,g as n,f as r}from"./p-BtliEQAT.js";const a=[];function c(t){const i=a.indexOf(t);-1!==i&&a.splice(i,1)}function p(t){return a.length>0&&a[a.length-1]===t}const l=["top","bottom","left","right"].map((t=>`co-popover__panel--${t}`)),d=class{constructor(s){t(this,s),this.coOpen=i(this,"coOpen",3),this.coClose=i(this,"coClose",3),this.coPlacement=i(this,"coPlacement",3),this.open=!1,this.placement="bottom-start",this.matchWidth=!1,this.offset=4,this.closeOnClickOutside=!0,this.closeOnEscape=!0,this.flip=!0,this.bare=!1,this.shift=0,this.closing=!1,this.anchorSeenVisible=!1,this.keepSide=!1,this.scrollParents=[],this.cachedOffsetAncestor=null,this.offsetAncestorComputed=!1,this.docListenersBound=!1,this.finishClose=()=>{clearTimeout(this.closeFallbackTimer),this.open||(this.closing=!1,this.panelEl=void 0)},this.handlePanelTransitionEnd=t=>{!this.open&&this.closing&&t.target===this.panelEl&&"transform"===t.propertyName&&this.finishClose()},this.pressStartedInside=!1,this.handleDocumentPointerDownManual=t=>{this.pressStartedInside=t.composedPath().includes(this.el)},this.handleDocumentClickManual=t=>{const i=this.pressStartedInside;this.pressStartedInside=!1,this.open&&this.closeOnClickOutside&&(i||p(this.el)&&(t.composedPath().includes(this.el)||(this.open=!1)))},this.handleDocumentKeydownManual=t=>{this.open&&this.closeOnEscape&&p(this.el)&&"Escape"===t.key&&(t.stopPropagation(),this.open=!1)},this.updatePosition=()=>{if(!this.open||!this.triggerEl||!this.panelEl)return;const t=this.triggerEl.getBoundingClientRect(),i=this.scrollParents.map((t=>t.getBoundingClientRect()));if(e(t,i))this.anchorSeenVisible=!0;else if(this.anchorSeenVisible&&this.closeOnClickOutside)return void(this.open=!1);const s=DOMRect.fromRect({width:this.panelEl.offsetWidth,height:this.panelEl.offsetHeight}),o=this.resolveAnchor(),r=null==o?void 0:o.getBoundingClientRect(),a=this.keepSide&&this.lastPlacement?this.lastPlacement:this.placement;this.keepSide=!1,this.observePanel();const{top:c,left:p,actualPlacement:d}=h(t,s,{placement:a,offset:this.offset,flip:this.flip,anchorRect:r,shift:this.shift});this.lastPlacement=d;let v=c,f=p;if(!this.panelEl.matches(":popover-open")&&(this.offsetAncestorComputed||(this.cachedOffsetAncestor=n(this.panelEl),this.offsetAncestorComputed=!0),this.cachedOffsetAncestor)){const t=this.cachedOffsetAncestor.getBoundingClientRect();v-=t.top,f-=t.left}const m={top:`${v}px`,left:`${f}px`};if(this.matchWidth&&(m.width=`${(null!=r?r:t).width}px`),this.panelEl){Object.assign(this.panelEl.style,m);const t=`co-popover__panel--${d.split("-")[0]}`;this.panelEl.classList.contains(t)||(this.panelEl.classList.remove(...l),this.panelEl.classList.add(t),this.coPlacement.emit({placement:d})),this.panelEl.classList.add("co-popover__panel--positioned")}},this.handlePanelResize=()=>{this.open&&(this.keepSide=!0,this.scheduleUpdate())},this.scheduleUpdate=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(this.updatePosition)},this.handleTriggerClick=()=>{this.open=!this.open}}componentDidLoad(){this.open&&this.onOpenChange(!0)}disconnectedCallback(){c(this.el),this.unbindDocListeners(),this.cleanupListeners(),clearTimeout(this.closeFallbackTimer),this.closing=!1}onOpenChange(t){var i;this.anchorSeenVisible=!1,t?(this.closing=!1,clearTimeout(this.closeFallbackTimer),c(i=this.el),a.push(i),this.coOpen.emit(),this.bindDocListeners(),this.scheduleUpdate(),requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.updatePosition()}))})),this.addScrollListeners()):(c(this.el),this.coClose.emit(),this.cleanupListeners(),this.unbindDocListeners(),this.cachedOffsetAncestor=null,this.offsetAncestorComputed=!1,this.closing=!0,clearTimeout(this.closeFallbackTimer),this.closeFallbackTimer=setTimeout((()=>this.finishClose()),400))}bindDocListeners(){this.docListenersBound||(document.addEventListener("pointerdown",this.handleDocumentPointerDownManual,!0),document.addEventListener("click",this.handleDocumentClickManual,!0),document.addEventListener("keydown",this.handleDocumentKeydownManual,!0),this.docListenersBound=!0)}unbindDocListeners(){this.docListenersBound&&(document.removeEventListener("pointerdown",this.handleDocumentPointerDownManual,!0),document.removeEventListener("click",this.handleDocumentClickManual,!0),document.removeEventListener("keydown",this.handleDocumentKeydownManual,!0),this.docListenersBound=!1,this.pressStartedInside=!1)}async toggle(){this.open=!this.open}async show(){this.open=!0}async hide(){this.open=!1}resolveAnchor(){return this.anchor?"string"==typeof this.anchor?document.querySelector(this.anchor):this.anchor:null}promotePanel(){const t=this.panelEl;if(t&&"function"==typeof t.showPopover)try{t.matches(":popover-open")||t.showPopover()}catch(t){}}observePanel(){var t;"undefined"!=typeof ResizeObserver&&this.panelEl&&this.observedPanel!==this.panelEl&&(null!==(t=this.resizeObserver)&&void 0!==t||(this.resizeObserver=new ResizeObserver(this.handlePanelResize)),this.observedPanel&&this.resizeObserver.unobserve(this.observedPanel),this.observedPanel=this.panelEl,this.resizeObserver.observe(this.panelEl))}addScrollListeners(){window.addEventListener("resize",this.scheduleUpdate,{passive:!0}),window.addEventListener("scroll",this.scheduleUpdate,{passive:!0,capture:!0}),this.scrollParents=r(this.el);for(const t of this.scrollParents)t.addEventListener("scroll",this.scheduleUpdate,{passive:!0})}cleanupListeners(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.observedPanel=void 0,this.lastPlacement=void 0,this.keepSide=!1,this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0),window.removeEventListener("resize",this.scheduleUpdate),window.removeEventListener("scroll",this.scheduleUpdate,{capture:!0});for(const t of this.scrollParents)t.removeEventListener("scroll",this.scheduleUpdate);this.scrollParents=[]}render(){return s("div",{key:"a85df32be71c08c86bd19a31224b51b899d1f468",class:"co-popover"},s("div",{key:"accafae8513bad7bfbf32b7e98f0dc6ec0968efa",class:"co-popover__trigger",ref:t=>this.triggerEl=t,onClick:this.handleTriggerClick},s("slot",{key:"f12247af31066f6d4cbdd45671146b3ea5c996bc",name:"trigger"})),(this.open||this.closing)&&s("div",{key:"64dbc77cae4a913bbe3ec4174f6b18c4982520ae",class:{"co-popover__panel":!0,"co-popover__panel--closing":this.closing},part:"panel",popover:"manual",onTransitionEnd:this.handlePanelTransitionEnd,ref:t=>{t&&t!==this.panelEl&&(this.panelEl=t,this.promotePanel(),this.scheduleUpdate())}},s("slot",{key:"858df49b45b1bd72f215f5e408e835227633d41f"})))}get el(){return o(this)}static get watchers(){return{open:[{onOpenChange:0}]}}};d.style=":host{display:inline-block;position:relative}:host([match-width]){display:block;width:100%}.co-popover{display:block;width:100%}.co-popover__trigger{display:block;width:100%;cursor:pointer}.co-popover__panel{position:fixed;inset:auto;top:0;left:0;margin:0;padding:0;width:auto;height:auto;max-width:none;max-height:none;z-index:10000;visibility:hidden;opacity:0;transform:scale(0.97);background:var(--co-semantic-surface-page, #fff);color:var(--co-semantic-text-default);border:1px solid var(--co-popover-border-color, var(--co-semantic-border-subtle));border-radius:var(--co-border-radius-sm, 12px);box-shadow:var(--co-popover-shadow, 0 4px 16px rgba(31, 28, 27, 0.08));overflow:visible}:host([bare]) .co-popover__panel{background:transparent;border:0;box-shadow:none}.co-popover__panel--positioned{visibility:visible;opacity:1;transform:scale(1);transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out), transform var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-popover__panel--closing{visibility:visible;opacity:0;transform:scale(0.99);pointer-events:none;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-in), transform var(--co-motion-duration-fast) var(--co-motion-ease-in)}.co-popover__panel--bottom{transform-origin:top center}.co-popover__panel--top{transform-origin:bottom center}.co-popover__panel--right{transform-origin:center left}.co-popover__panel--left{transform-origin:center right}";export{d as co_popover}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as a,a as r}from"./p-DJkaRtbb.js";import{g as o}from"./p-jYd9gu_c.js";import{b as i,d as s,a as c,p as n,i as d,h as l,s as h,c as f,e as p,j as u,g as m,k as b,f as g,l as v}from"./p-BU7SQCje.js";import{R as _}from"./p-CYN5B3IQ.js";import{a as w}from"./p-Ch1jfwZ2.js";import{i as y,p as x,r as L}from"./p-hXbDUT3I.js";import{s as k}from"./p-CBX_oabB.js";const q=/^\d{4}-\d{2}-\d{2}$/;function z(e){if(Array.isArray(e))return e;if("string"==typeof e&&e.trim()){const t=e.trim();try{const e=JSON.parse(t);if(Array.isArray(e))return e.map(String)}catch(e){}return t.split(",").map((e=>e.trim())).filter(Boolean)}return[]}function C(e,t,a){return t&&a?`${e}, ${a}`:e}const S=class{constructor(a){e(this,a),this.coSelect=t(this,"coSelect",7),this.coRangeSelect=t(this,"coRangeSelect",7),this.mode="single",this.locale="es-CO",this.firstDayOfWeek=1,this.hoverDay=null,this.view="days",this.shouldFocusGrid=!1,this.handleDayHover=e=>{"range"===this.mode&&(this.hoverDay=e)},this.handlePrev=()=>this.step(-1),this.handleNext=()=>this.step(1),this.toggleView=()=>{this.view="days"===this.view?"months":"months"===this.view?"years":"days"},this.handleGridKeyDown=e=>{const t=this.focused;let a=!0;switch(e.key){case"ArrowLeft":this.moveFocus(s(t,-1));break;case"ArrowRight":this.moveFocus(s(t,1));break;case"ArrowUp":this.moveFocus(s(t,-7));break;case"ArrowDown":this.moveFocus(s(t,7));break;case"Home":this.moveFocus(D(t,this.firstDayOfWeek));break;case"End":this.moveFocus(s(D(t,this.firstDayOfWeek),6));break;case"PageUp":this.moveFocus(i(t,e.shiftKey?-12:-1));break;case"PageDown":this.moveFocus(i(t,e.shiftKey?12:1));break;case"Enter":case" ":this.selectDay(t);break;default:a=!1}a&&(e.preventDefault(),e.stopPropagation())}}componentWillLoad(){var e;const t=null!==(e=this.anchorValue)&&void 0!==e?e:c(),a=n(t);this.viewYear=a.year,this.viewMonth=a.month,this.applyMonthProp(),this.focused=this.initialFocus()}onMonthChange(){this.applyMonthProp()}applyMonthProp(){const e=function(e){const t=/^(\d{4})-(\d{2})$/.exec(String(null!=e?e:"").trim());if(!t)return null;const a=Number(t[1]),r=Number(t[2]);return r>=1&&r<=12?{year:a,month:r}:null}(this.month);e&&(this.viewYear=e.year,this.viewMonth=e.month)}onValueChange(){if(!this.selectedValue)return;const e=n(this.selectedValue);this.viewYear=e.year,this.viewMonth=e.month,this.focused=this.selectedValue}async focusGrid(){this.shouldFocusGrid=!0,this.focusFocusedCell()}get selectedValue(){return d(this.value)?this.value:null}get rangeStartV(){return d(this.rangeStart)?this.rangeStart:null}get rangeEndV(){return d(this.rangeEnd)?this.rangeEnd:null}get anchorValue(){return"range"===this.mode?this.rangeStartV:this.selectedValue}get disabledOpts(){return{min:this.min,max:this.max,disabledDates:z(this.disabledDates),disabledDaysOfWeek:A(this.disabledDaysOfWeek)}}isDayDisabled(e){return l(e,this.disabledOpts)}initialFocus(){const e=this.anchorValue;if(e&&!this.isDayDisabled(e))return e;const t=c(),a=n(t);if(a.year===this.viewYear&&a.month===this.viewMonth&&!this.isDayDisabled(t))return t;const r=`${String(this.viewYear).padStart(4,"0")}-${String(this.viewMonth).padStart(2,"0")}-01`;let o=r;for(let e=0;e<31;e++){const e=n(o);if(!e||e.month!==this.viewMonth)break;if(!this.isDayDisabled(o))return o;o=s(o,1)}return r}selectDay(e){this.isDayDisabled(e)||(this.focused=e,"range"===this.mode?this.selectRangeDay(e):this.coSelect.emit(e))}selectRangeDay(e){const t=this.rangeStartV;let a;a=!t||t&&this.rangeEndV?{start:e,end:null}:f(e,t)<0?{start:e,end:t}:{start:t,end:e},this.coRangeSelect.emit(a)}moveFocus(e){this.focused=e;const t=n(e);t.year===this.viewYear&&t.month===this.viewMonth||(this.viewYear=t.year,this.viewMonth=t.month),this.shouldFocusGrid=!0}step(e){if("days"===this.view){const t=i(`${this.viewYear}-${String(this.viewMonth).padStart(2,"0")}-01`,e),a=n(t);this.viewYear=a.year,this.viewMonth=a.month}else this.viewYear+="months"===this.view?e:10*e}selectMonth(e){this.viewMonth=e,this.view="days"}selectYear(e){this.viewYear=e,this.view="months"}get decadeStart(){return 10*Math.floor(this.viewYear/10)}get selectedYM(){const e="range"===this.mode?this.rangeStartV:this.selectedValue;if(!e)return null;const t=n(e);return{year:t.year,month:t.month}}isMonthDisabled(e,t){const a=`${String(e).padStart(4,"0")}-${String(t).padStart(2,"0")}-01`,r=s(h(i(a,1)),-1);return!!(this.min&&f(r,this.min)<0)||!!(this.max&&f(a,this.max)>0)}isYearDisabled(e){const t=`${String(e).padStart(4,"0")}-01-01`,a=`${String(e).padStart(4,"0")}-12-31`;return!!(this.min&&f(a,this.min)<0)||!!(this.max&&f(t,this.max)>0)}componentDidRender(){this.shouldFocusGrid&&(this.shouldFocusGrid=!1,this.focusFocusedCell())}focusFocusedCell(){var e;const t=null===(e=this.el.shadowRoot)||void 0===e?void 0:e.querySelector(`[data-date="${this.focused}"]`);null==t||t.focus()}rangeFlags(e){const t=this.rangeStartV,a=this.rangeEndV;if(!t)return{isStart:!1,isEnd:!1,inRange:!1};const r=null!=a?a:this.hoverDay&&!a?this.hoverDay:null;if(!r)return{isStart:0===f(e,t),isEnd:!1,inRange:!1};const o=f(t,r)<=0?t:r,i=f(t,r)<=0?r:t;return{isStart:0===f(e,o),isEnd:0===f(e,i),inRange:f(e,o)>0&&f(e,i)<0}}get markedSet(){return new Set(z(this.markedDates).map((e=>e.trim())).filter((e=>q.test(e))))}dayClass(e,t,a,r=!1){const o=0===f(e,c());if("range"===this.mode){const{isStart:i,isEnd:s,inRange:c}=this.rangeFlags(e);return{"co-calendar__day":!0,"co-calendar__day--outside":!t,"co-calendar__day--today":o&&!(i||s)&&!c,"co-calendar__day--range-start":i,"co-calendar__day--range-end":s,"co-calendar__day--in-range":c,"co-calendar__day--disabled":a,"co-calendar__day--marked":r}}const i=this.selectedValue,s=!!i&&0===f(e,i);return{"co-calendar__day":!0,"co-calendar__day--outside":!t,"co-calendar__day--today":o&&!s,"co-calendar__day--selected":s,"co-calendar__day--disabled":a,"co-calendar__day--marked":r}}headerTitle(){return"months"===this.view?String(this.viewYear):"years"===this.view?`${this.decadeStart}–${this.decadeStart+9}`:p(this.viewYear,this.viewMonth,this.locale,"long")}renderDays(e){const t=p(this.viewYear,this.viewMonth,this.locale,"long"),r=u(this.locale,this.firstDayOfWeek,"short"),o=u(this.locale,this.firstDayOfWeek,"long"),i=m(this.viewYear,this.viewMonth,this.firstDayOfWeek).filter((e=>e.some((e=>e.inMonth)))),s=this.markedSet;return a("div",{class:"co-calendar__grid",part:"grid",role:"grid","aria-label":t,onKeyDown:this.handleGridKeyDown},a("div",{class:"co-calendar__row co-calendar__row--dow",role:"row"},r.map(((e,t)=>a("span",{class:"co-calendar__dow",role:"columnheader","aria-label":o[t]},e)))),i.map((e=>a("div",{class:"co-calendar__row",role:"row"},e.map((e=>{const t=this.isDayDisabled(e.value),r=s.has(e.value),o=0===f(e.value,this.focused),i=0===f(e.value,c());let d;if("range"===this.mode){const{isStart:t,isEnd:a}=this.rangeFlags(e.value);d=t||a}else{const t=this.selectedValue;d=!!t&&0===f(e.value,t)}const l=n(e.value).day;return a("button",{type:"button",role:"gridcell","data-date":e.value,class:this.dayClass(e.value,e.inMonth,t,r),tabIndex:o?0:-1,"aria-selected":d?"true":"false","aria-current":i?"date":void 0,"aria-disabled":t?"true":void 0,"aria-label":C(b(e.value,this.locale),r,this.markedLabel),onClick:()=>this.selectDay(e.value),onMouseEnter:()=>this.handleDayHover(e.value),onMouseLeave:()=>this.handleDayHover(null)},l)}))))))}renderMonths(){const e=this.selectedYM,t=new Date;return a("div",{class:"co-calendar__panel",part:"grid"},Array.from({length:12},((r,o)=>{const i=o+1,s=new Intl.DateTimeFormat(this.locale,{month:"short"}).format(new Date(this.viewYear,o,1)),c=this.isMonthDisabled(this.viewYear,i),n=!!e&&e.year===this.viewYear&&e.month===i,d=t.getFullYear()===this.viewYear&&t.getMonth()===o;return a("button",{type:"button",class:{"co-calendar__cell":!0,"co-calendar__cell--selected":n,"co-calendar__cell--today":d&&!n,"co-calendar__cell--disabled":c},disabled:c,"aria-current":d?"date":void 0,onClick:()=>this.selectMonth(i)},s)})))}renderYears(){const e=this.selectedYM,t=(new Date).getFullYear(),r=this.decadeStart-1;return a("div",{class:"co-calendar__panel",part:"grid"},Array.from({length:12},((o,i)=>{const s=r+i,c=this.isYearDisabled(s),n=!!e&&e.year===s,d=t===s;return a("button",{type:"button",class:{"co-calendar__cell":!0,"co-calendar__cell--muted":s<this.decadeStart||s>this.decadeStart+9,"co-calendar__cell--selected":n,"co-calendar__cell--today":d&&!n,"co-calendar__cell--disabled":c},disabled:c,"aria-current":d?"date":void 0,onClick:()=>this.selectYear(s)},s)})))}render(){var e,t;const r=o(this.locale);return a("div",{key:"5ecdc23692eb69b8dc86b225857f51a3acf54838",class:"co-calendar",part:"root"},a("div",{key:"b66924b6b59f91d284210c6a0ed24294f211a5b7",class:"co-calendar__header",part:"header"},a("button",{key:"a4d52f3c02081b03f872a95955986c6351f9ca44",type:"button",class:"co-calendar__nav",onClick:this.handlePrev,"aria-label":null!==(e=this.prevMonthLabel)&&void 0!==e?e:r.prevMonth},a("co-icon",{key:"6eaf089247fc85477a1bd9095af2c1c557d01bb3",name:"caret-left",size:16})),a("button",{key:"473815fa6114c82f601bea27e919b5c4546648f2",type:"button",class:"co-calendar__title","aria-live":"polite",onClick:this.toggleView},this.headerTitle(),a("co-icon",{key:"923647a98317c5e42ec7655ac21eed3e645224b6",name:"caret-down",size:12,class:"co-calendar__title-caret"})),a("button",{key:"1ccbdf76cc5574021894f8f1c6bd381b9b524cfa",type:"button",class:"co-calendar__nav",onClick:this.handleNext,"aria-label":null!==(t=this.nextMonthLabel)&&void 0!==t?t:r.nextMonth},a("co-icon",{key:"4b06c0827034a9f6924f1e80a51fdef924a0f8d1",name:"caret-right",size:16}))),"days"===this.view&&this.renderDays(r),"months"===this.view&&this.renderMonths(),"years"===this.view&&this.renderYears())}get el(){return r(this)}static get watchers(){return{month:[{onMonthChange:0}],value:[{onValueChange:0}]}}};function D(e,t){const a=n(e);if(!a)return e;const r=new Date(a.year,a.month-1,a.day).getDay();return s(e,-(r-t+7)%7)}function A(e){if(Array.isArray(e))return e;if("string"==typeof e&&e.trim()){const t=e.trim();try{const e=JSON.parse(t);if(Array.isArray(e))return e.map(Number).filter((e=>!Number.isNaN(e)))}catch(e){}return t.split(",").map((e=>Number(e.trim()))).filter((e=>!Number.isNaN(e)))}return[]}S.style=":host{display:inline-block;font-family:var(--co-font-family-primary);--co-calendar-day-size:36px}:host([data-touch]){--co-calendar-day-size:44px}.co-calendar{display:flex;flex-direction:column;gap:var(--co-spacing-sm);width:var(--co-calendar-width, max-content)}.co-calendar__header{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs)}.co-calendar__month{font-size:var(--co-font-size-14);font-weight:600;color:var(--co-semantic-text-default);text-transform:capitalize}.co-calendar__title{display:inline-flex;align-items:center;gap:var(--co-spacing-xxs);background:none;border:0;cursor:pointer;font-family:inherit;font-size:var(--co-font-size-14);font-weight:600;color:var(--co-semantic-text-default);text-transform:capitalize;padding:var(--co-spacing-xxs) var(--co-spacing-sm);border-radius:var(--co-border-radius-xs)}.co-calendar__title:hover{background:var(--co-semantic-surface-hover)}.co-calendar__title:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:1px}.co-calendar__title-caret{color:var(--co-semantic-text-muted)}.co-calendar__panel{display:grid;grid-template-columns:repeat(3, 1fr);gap:var(--co-spacing-xs);width:var(--co-calendar-width, calc(var(--co-calendar-day-size) * 7 + 12px));padding-top:var(--co-spacing-xs)}.co-calendar__cell{height:calc(var(--co-calendar-day-size) + 8px);display:inline-flex;align-items:center;justify-content:center;background:none;border:1px solid transparent;border-radius:var(--co-border-radius-xs);font-family:inherit;font-size:var(--co-font-size-14);color:var(--co-semantic-text-default);cursor:pointer;text-transform:capitalize;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), color var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-calendar__cell:hover:not(.co-calendar__cell--disabled):not(.co-calendar__cell--selected){background:var(--co-semantic-surface-hover)}.co-calendar__cell:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:1px}.co-calendar__cell--muted{color:var(--co-semantic-text-muted)}.co-calendar__cell--today{border-color:var(--co-semantic-surface-primary);font-weight:600}.co-calendar__cell--selected{background:var(--co-semantic-surface-primary);border-color:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-weight:600}.co-calendar__cell--disabled{color:var(--co-semantic-text-disabled);cursor:not-allowed}.co-calendar__nav{background:none;border:0;cursor:pointer;padding:var(--co-spacing-xs);border-radius:var(--co-border-radius-xxs);display:inline-flex;align-items:center;color:var(--co-semantic-text-default)}.co-calendar__nav:hover{background:var(--co-semantic-surface-hover)}.co-calendar__nav:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:1px}.co-calendar__grid{display:flex;flex-direction:column;gap:2px}.co-calendar__row{display:grid;grid-template-columns:repeat(7, var(--co-calendar-col, var(--co-calendar-day-size)));gap:2px}.co-calendar__row--dow{margin-bottom:2px}.co-calendar__dow{height:24px;display:inline-flex;align-items:center;justify-content:center;font-size:var(--co-font-size-10, 10px);font-weight:600;color:var(--co-semantic-text-muted);text-transform:uppercase;letter-spacing:0.04em}.co-calendar__day{width:var(--co-calendar-day-width, var(--co-calendar-day-size));height:var(--co-calendar-day-size);display:inline-flex;align-items:center;justify-content:center;background:none;border:1px solid transparent;border-radius:var(--co-border-radius-xs);font-size:var(--co-font-size-14);font-family:inherit;color:var(--co-semantic-text-default);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), color var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-calendar__day:hover:not(.co-calendar__day--disabled):not(.co-calendar__day--selected):not(.co-calendar__day--marked):not(.co-calendar__day--range-start):not(.co-calendar__day--range-end){background:var(--co-semantic-surface-hover)}.co-calendar__day:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:1px}.co-calendar__day--outside{color:var(--co-semantic-text-muted)}.co-calendar__day--today{border-color:var(--co-semantic-surface-primary);font-weight:600}.co-calendar__day--marked{background:var(--co-calendar-marked-bg, var(--co-color-primary-rosado));border-color:var(--co-calendar-marked-bg, var(--co-color-primary-rosado));color:var(--co-calendar-marked-fg, var(--co-color-base-blanco));font-weight:600}.co-calendar__day--selected{background:var(--co-semantic-surface-primary);border-color:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-weight:600}.co-calendar__day--disabled{color:var(--co-semantic-text-disabled);cursor:not-allowed;pointer-events:none}.co-calendar__day--in-range{background:color-mix(in srgb, var(--co-semantic-surface-primary) 8%, transparent);border-radius:0;color:var(--co-semantic-text-default)}.co-calendar__day--range-start,.co-calendar__day--range-end{background:var(--co-semantic-surface-primary);border-color:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-weight:600}.co-calendar__day--range-start:not(.co-calendar__day--range-end){border-top-right-radius:0;border-bottom-right-radius:0}.co-calendar__day--range-end:not(.co-calendar__day--range-start){border-top-left-radius:0;border-bottom-left-radius:0}";const j=class{constructor(a){e(this,a),this.coInput=t(this,"coInput",7),this.coChange=t(this,"coChange",7),this.coInvalid=t(this,"coInvalid",7),this.coClear=t(this,"coClear",7),this.coFocus=t(this,"coFocus",7),this.coBlur=t(this,"coBlur",7),this.value=null,this.size="md",this.locale="es-CO",this.displayFormat="d MMM yyyy",this.disabled=!1,this.readonly=!1,this.required=!1,this.clearable=!0,this.invalid=!1,this.layout="vertical",this.draft="",this.internalInvalid=!1,this.hasFocus=!1,this.handleInput=e=>{this.draft=e.target.value,this.internalInvalid=!1,this.coInput.emit(this.draft)},this.handleFocus=()=>{this.hasFocus=!0,this.coFocus.emit()},this.handleBlur=()=>{this.hasFocus=!1,this.commit(),this.coBlur.emit()},this.handleKeyDown=e=>{"Enter"===e.key&&(this.commit()||(e.preventDefault(),e.stopPropagation()))},this.handleClear=()=>{var e;this.draft="",this.internalInvalid=!1,null!==this.value&&(this.value=null,this.coChange.emit(null)),this.coClear.emit(),null===(e=this.inputEl)||void 0===e||e.focus()}}componentWillLoad(){this.draft=g(this.value,this.displayFormat,this.locale)}onValueChange(){this.hasFocus||(this.draft=g(this.value,this.displayFormat,this.locale),this.internalInvalid=!1)}async focusInput(){var e;null===(e=this.inputEl)||void 0===e||e.focus()}get order(){const e=this.displayFormat.toLowerCase();return e.startsWith("y")?"ymd":e.startsWith("m")?"mdy":"dmy"}get isInvalid(){return this.invalid||this.internalInvalid}get hasValue(){return""!==this.draft.trim()}commit(){const e=v(this.draft,{order:this.order,locale:this.locale});if("empty"===e.status)return this.internalInvalid=!1,null!==this.value&&(this.value=null,this.coChange.emit(null)),!0;if("invalid"===e.status||null===e.value)return this.internalInvalid=!0,this.coInvalid.emit({raw:this.draft}),!1;const t=e.value;return l(t,{min:this.min,max:this.max,disabledDates:M(this.disabledDates),disabledDaysOfWeek:$(this.disabledDaysOfWeek)})?(this.internalInvalid=!0,this.coInvalid.emit({raw:this.draft}),!1):(this.internalInvalid=!1,this.draft=g(t,this.displayFormat,this.locale),this.value!==t&&(this.value=t,this.coChange.emit(t)),!0)}render(){var e,t;const r=o(this.locale),i=this.clearable&&this.hasValue&&!this.disabled&&!this.readonly,s=this.placeholder||r.setDate,c=this.isInvalid?this.errorMessage:this.helperText;return a("div",{key:"453e532a8aa115e750353877880555d00c768951",class:{"co-date-field":!0,"co-date-field--disabled":this.disabled,"co-date-field--focused":this.hasFocus,"co-date-field--filled":this.hasValue,"co-date-field--invalid":this.isInvalid,[`co-date-field--${this.size}`]:!0},part:"wrapper"},this.label&&a("div",{key:"e455cfb66bb65981ba685dcd3c2fbbf0bd98562f",class:"co-date-field__labels"},a("label",{key:"d3cd19357bded058f3922c5423f816bc094c5fb9",class:"co-date-field__label",part:"label"},this.label,a(_,{key:"e66ca94dabe83f2bcf77a85d6d4c72ad7eed6cdb",required:this.required}))),a("div",{key:"848c32b06cbe5fa847c9c769c1407f13237ba4d5",class:"co-date-field__field-row"},a("div",{key:"ca350ae929087a7e6268de42a4b2e14d3de9ef58",class:"co-date-field__field",part:"field"},a("co-icon",{key:"9054673efd46a0f367abffc938a3328af6d0408b",name:"calendar",size:16,class:"co-date-field__icon"}),a("div",{key:"06c441cd3829acfd26d1e2eba100f246fadf4f55",class:"co-date-field__input-wrapper"},a("input",{key:"0b1fccd57b629230b079ad41d3d02555ca54144d",ref:e=>this.inputEl=e,class:"co-date-field__native",type:"text",inputMode:"numeric",autocomplete:"off",value:this.draft,placeholder:s,disabled:this.disabled,readOnly:this.readonly,required:this.required,"aria-invalid":this.isInvalid?"true":"false","aria-label":this.label?void 0:r.dateLabel,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,part:"input"})),this.clearable&&a("button",{key:"afacd96145ddfb36f9c4823dace12472c1692839",class:{"co-date-field__clear":!0,"co-date-field__clear--hidden":!i},type:"button",tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:this.handleClear,"aria-label":null!==(e=this.clearLabel)&&void 0!==e?e:r.clearDate,part:"clear"},a("co-icon",{key:"87d841da80b8d0ef82df03ec32345a0cd274f043",name:"x-circle",size:16,weight:"fill"})))),this.name&&a("input",{key:"60a65f36972af02f0bb3f747c287b0fb8174de4d",type:"hidden",name:this.name,value:null!==(t=this.value)&&void 0!==t?t:""}),c&&a("div",{key:"05cfeef9edc268c1ca3f6b112d9750532cbf6159",class:{"co-date-field__helper":!0,"co-date-field__helper--error":this.isInvalid},part:"helper"},this.isInvalid&&a("co-icon",{key:"8e97926b9bd11f007d850dbcced80b9fb51b37b6",name:"warning-circle",size:14,class:"co-date-field__helper-icon"}),a("span",{key:"8cd33b10c139f17a97bc88f457a96e23413e744a",class:"co-date-field__helper-text"},c)))}get el(){return r(this)}static get watchers(){return{value:[{onValueChange:0}]}}};function M(e){if(Array.isArray(e))return e;if("string"==typeof e&&e.trim()){try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(String)}catch(e){}return e.split(",").map((e=>e.trim())).filter(Boolean)}return[]}function $(e){if(Array.isArray(e))return e;if("string"==typeof e&&e.trim()){try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(Number).filter((e=>!Number.isNaN(e)))}catch(e){}return e.split(",").map((e=>Number(e.trim()))).filter((e=>!Number.isNaN(e)))}return[]}j.style=":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1}.co-date-field{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-date-field__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-date-field__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;cursor:default}.co-date-field__field-row{display:flex;align-items:stretch}.co-date-field--s .co-date-field__field{min-height:28px;padding:var(--co-spacing-xxs) var(--co-spacing-sm)}.co-date-field--sm .co-date-field__field{min-height:32px;padding:var(--co-spacing-xs) var(--co-spacing-sm)}.co-date-field--lg .co-date-field__field{min-height:48px;padding:var(--co-spacing-sm) var(--co-spacing-lg)}.co-date-field__field{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out);min-height:40px;box-sizing:border-box;overflow:hidden;flex:1;min-width:0}.co-date-field__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-date-field__input-wrapper{flex:1;display:flex;align-items:center;min-width:0;min-height:22px;padding:0}.co-date-field__native{width:100%;border:none;outline:none;background:transparent;font-family:inherit;font-size:inherit;font-weight:400;letter-spacing:inherit;line-height:1;color:var(--co-semantic-text-default);padding:0;margin:0}.co-date-field__native::placeholder{color:var(--co-semantic-text-muted)}.co-date-field__clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:16px;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-date-field__clear--hidden{visibility:hidden;pointer-events:none}.co-date-field__clear:hover{color:var(--co-semantic-text-default)}.co-date-field__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-date-field__helper-icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-date-field__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body)}.co-date-field--focused .co-date-field__field{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-date-field--disabled .co-date-field__labels .co-date-field__label{color:var(--co-semantic-text-disabled)}.co-date-field--disabled .co-date-field__field{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-date-field--disabled .co-date-field__native{color:var(--co-semantic-text-disabled);cursor:not-allowed}.co-date-field--disabled .co-date-field__native::placeholder{color:var(--co-semantic-text-disabled)}.co-date-field--disabled .co-date-field__icon{color:var(--co-semantic-text-disabled)}.co-date-field--invalid .co-date-field__field{border-color:var(--co-semantic-border-error, var(--co-semantic-status-error))}.co-date-field--invalid.co-date-field--focused .co-date-field__field{border-color:var(--co-semantic-border-error, var(--co-semantic-status-error));box-shadow:0 0 0 2px color-mix(in srgb, var(--co-semantic-border-error, var(--co-semantic-status-error)) 12%, transparent)}.co-date-field__helper--error .co-date-field__helper-icon,.co-date-field__helper--error .co-date-field__helper-text{color:var(--co-semantic-text-error, var(--co-semantic-status-error))}:host([layout='horizontal']) .co-date-field{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-date-field__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-date-field__label{white-space:normal}:host([layout='horizontal']) .co-date-field>:not(.co-date-field__labels){grid-column:2;min-width:0}.co-field-required{margin-left:2px;color:var(--co-semantic-text-error, var(--co-color-status-error))}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}";const N=class{constructor(a){e(this,a),this.coClose=t(this,"coClose",7),this.coOpen=t(this,"coOpen",7),this.coAfterOpen=t(this,"coAfterOpen",7),this.coAfterClose=t(this,"coAfterClose",7),this.open=!1,this.position="right",this.size="md",this.heading="",this.description="",this.icon="",this.closable=!0,this.closeOnOverlay=!0,this.closeOnEscape=!0,this.modeless=!1,this.loading=!1,this.hasFooter=!1,this.hasTabs=!1,this.hasHeaderSlot=!1,this.handleFooterSlotChange=e=>{this.hasFooter=k(e)},this.handleTabsSlotChange=e=>{this.hasTabs=k(e)},this.handleHeaderSlotChange=e=>{this.hasHeaderSlot=k(e)},this.handleOverlayClose=()=>{this.closeOnOverlay&&this.coClose.emit()},this.handleCloseClick=()=>{this.coClose.emit()},this.stopPropagation=e=>{e.stopPropagation()},this.handleTransitionEnd=e=>{if(e.target!==this.asideEl)return;const t=w(e.propertyName,this.open,"transform");"after-open"===t?this.coAfterOpen.emit():"after-close"===t&&this.coAfterClose.emit()},this.promoteModeless=e=>{e&&(this.asideEl=e);const t=this.asideEl;if(this.modeless&&t&&"function"==typeof t.showPopover)try{t.matches(":popover-open")||t.showPopover()}catch(e){}}}get labelledBy(){return this.hasHeaderSlot?"co-drawer-header-content":this.heading?"co-drawer-heading":void 0}onOpenChange(e,t){e?x(this):L(this),e&&!t&&this.coOpen.emit()}connectedCallback(){this.open&&x(this)}disconnectedCallback(){L(this)}handleKey(e){this.open&&this.closeOnEscape&&"Escape"===e.key&&(this.modeless&&document.querySelector("co-drawer[open]:not([modeless]), co-modal[open]")||y(this)&&this.coClose.emit())}componentDidLoad(){this.promoteModeless()}render(){const e=a("aside",{class:{"co-drawer":!0,"co-sq-elevation":!0,"co-sq-elevation-fallback":!0,"co-drawer--open":this.open,"co-drawer--modeless":this.modeless,[`co-drawer--${this.position}`]:!0,[`co-drawer--${this.size}`]:!0},popover:this.modeless?"manual":void 0,ref:this.promoteModeless,part:"drawer",role:"dialog","aria-modal":this.modeless?"false":"true","aria-labelledby":this.labelledBy,onClick:this.stopPropagation,onTransitionEnd:this.handleTransitionEnd},a("div",{class:"co-drawer__card co-sq-clip",part:"card"},a("header",{class:"co-drawer__header",part:"header"},a("div",{class:"co-drawer__header-content",id:"co-drawer-header-content"},a("slot",{name:"header",onSlotchange:this.handleHeaderSlotChange},a("div",{class:"co-drawer__heading-row"},this.icon&&a("co-icon",{name:this.icon,size:20,class:"co-drawer__icon"}),a("h2",{class:"co-drawer__heading",id:"co-drawer-heading"},this.heading)),this.description&&a("p",{class:"co-drawer__description"},this.description))),this.closable&&a("button",{class:"co-drawer__close",type:"button","aria-label":"Close",onClick:this.handleCloseClick},a("co-icon",{name:"x",size:20}))),a("div",{class:{"co-drawer__tabs":!0,"co-drawer__tabs--empty":!this.hasTabs},part:"tabs"},a("slot",{name:"tabs",onSlotchange:this.handleTabsSlotChange})),a("div",{class:"co-drawer__body",part:"body"},a("slot",null),a("co-loader",{overlay:!0,visible:this.loading,part:"loader"})),a("footer",{class:{"co-drawer__footer":!0,"co-drawer__footer--empty":!this.hasFooter},part:"footer"},a("slot",{name:"footer",onSlotchange:this.handleFooterSlotChange}))));return this.modeless?e:a("co-overlay",{open:this.open,onCoClose:this.handleOverlayClose},e)}get el(){return r(this)}static get watchers(){return{open:[{onOpenChange:0}]}}};N.style='.co-sq-elevation{border-radius:var(--co-sq-r);corner-shape:squircle;box-shadow:var(--co-sq-shadow)}.co-sq-clip{overflow:hidden;border-radius:var(--co-sq-r);corner-shape:squircle}@supports not (corner-shape: squircle){.co-sq-elevation{box-shadow:none}.co-sq-elevation-fallback{filter:var(--co-sq-drop-shadow)}.co-sq-clip{border-radius:0;--co-sq-tl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 0L95 0L92.5 0L90 0L87.5 0.01L85 0.01L82.5 0.02L80 0.04L77.5 0.06L75 0.1L72.5 0.14L70 0.2L67.5 0.28L65 0.38L62.5 0.5L60 0.65L57.5 0.83L55 1.04L52.5 1.3L50 1.6L47.5 1.96L45 2.37L42.5 2.85L40 3.41L37.5 4.05L35 4.8L32.5 5.65L30 6.63L27.5 7.77L25 9.07L22.5 10.58L20 12.34L17.5 14.41L15 16.85L12.5 19.79L10 23.42L7.5 28.06L5 34.37L2.5 44.29L0 100L100 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-tr:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 0L5 0L7.5 0L10 0L12.5 0.01L15 0.01L17.5 0.02L20 0.04L22.5 0.06L25 0.1L27.5 0.14L30 0.2L32.5 0.28L35 0.38L37.5 0.5L40 0.65L42.5 0.83L45 1.04L47.5 1.3L50 1.6L52.5 1.96L55 2.37L57.5 2.85L60 3.41L62.5 4.05L65 4.8L67.5 5.65L70 6.63L72.5 7.77L75 9.07L77.5 10.58L80 12.34L82.5 14.41L85 16.85L87.5 19.79L90 23.42L92.5 28.06L95 34.37L97.5 44.29L100 100L0 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-bl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 55.71L5 65.63L7.5 71.94L10 76.58L12.5 80.21L15 83.15L17.5 85.59L20 87.66L22.5 89.42L25 90.93L27.5 92.23L30 93.37L32.5 94.35L35 95.2L37.5 95.95L40 96.59L42.5 97.15L45 97.63L47.5 98.04L50 98.4L52.5 98.7L55 98.96L57.5 99.17L60 99.35L62.5 99.5L65 99.62L67.5 99.72L70 99.8L72.5 99.86L75 99.9L77.5 99.94L80 99.96L82.5 99.98L85 99.99L87.5 99.99L90 100L92.5 100L95 100L97.5 100L100 100L100 0Z%27 fill=%27%23fff%27/></svg>");--co-sq-br:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 55.71L95 65.63L92.5 71.94L90 76.58L87.5 80.21L85 83.15L82.5 85.59L80 87.66L77.5 89.42L75 90.93L72.5 92.23L70 93.37L67.5 94.35L65 95.2L62.5 95.95L60 96.59L57.5 97.15L55 97.63L52.5 98.04L50 98.4L47.5 98.7L45 98.96L42.5 99.17L40 99.35L37.5 99.5L35 99.62L32.5 99.72L30 99.8L27.5 99.86L25 99.9L22.5 99.94L20 99.96L17.5 99.98L15 99.99L12.5 99.99L10 100L7.5 100L5 100L2.5 100L0 100L0 0Z%27 fill=%27%23fff%27/></svg>");-webkit-mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat;mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat}}:host{display:contents}.co-drawer{position:fixed;display:flex;flex-direction:column;font-family:var(--co-font-family-primary);color:inherit;transition:transform var(--co-motion-duration-slow) var(--co-motion-ease-in-out);will-change:transform;z-index:1;contain:layout;--co-drawer-r:var(--co-shell-r, var(--co-border-radius-md));--co-sq-r:var(--co-drawer-r);--co-sq-shadow:0 1px 4px rgba(31, 28, 27, 0.06), 0 10px 56px rgba(31, 28, 27, 0.12);--co-sq-drop-shadow:drop-shadow(0 1px 2px rgba(31, 28, 27, 0.06)) drop-shadow(0 10px 28px rgba(31, 28, 27, 0.12))}.co-drawer--right{top:0;right:0;margin:6px;height:100vh;height:-webkit-fill-available;transform:translateX(calc(100% + 12px))}.co-drawer--right.co-drawer--open{transform:translateX(0)}.co-drawer--left{top:0;left:0;margin:6px;height:100vh;height:-webkit-fill-available;transform:translateX(calc(-100% - 12px))}.co-drawer--left.co-drawer--open{transform:translateX(0)}.co-drawer--bottom{bottom:0;left:0;right:0;margin:6px;width:auto;transform:translateY(calc(100% + 12px))}.co-drawer--bottom.co-drawer--open{transform:translateY(0)}.co-drawer--right.co-drawer--sm,.co-drawer--left.co-drawer--sm{width:400px;max-width:100vw}.co-drawer--right.co-drawer--md,.co-drawer--left.co-drawer--md{width:520px;max-width:100vw}.co-drawer--right.co-drawer--lg,.co-drawer--left.co-drawer--lg{width:672px;max-width:100vw}.co-drawer--right.co-drawer--xl,.co-drawer--left.co-drawer--xl{width:960px;max-width:100vw}.co-drawer--right.co-drawer--full,.co-drawer--left.co-drawer--full{width:100vw}.co-drawer--bottom.co-drawer--sm{height:40vh}.co-drawer--bottom.co-drawer--md{height:60vh}.co-drawer--bottom.co-drawer--lg{height:80vh}.co-drawer--bottom.co-drawer--xl{height:95vh}.co-drawer--bottom.co-drawer--full{height:100vh}.co-drawer__card{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--co-semantic-surface-page);color:var(--co-semantic-text-default)}.co-drawer__header{display:flex;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-bottom:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__header-content{flex:1;min-width:0}.co-drawer__heading-row{display:flex;align-items:center;gap:var(--co-spacing-sm, 8px)}.co-drawer__icon{flex-shrink:0;color:var(--co-semantic-text-secondary)}.co-drawer__heading{margin:0;font-size:var(--co-font-size-18);font-weight:600;color:var(--co-semantic-text-default);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-drawer__description{margin:var(--co-spacing-xs) 0 0;font-size:var(--co-font-size-13, 13px);font-weight:400;color:var(--co-semantic-text-muted);line-height:1.4}.co-drawer__close{display:flex;align-items:center;justify-content:center;padding:var(--co-spacing-xs);margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);border-radius:var(--co-border-radius-sm);transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);flex-shrink:0}.co-drawer__close:hover{background:var(--co-semantic-surface-hover)}.co-drawer__close:focus-visible{outline:2px solid var(--co-color-primary-azul);outline-offset:2px}.co-drawer__tabs{flex-shrink:0;border-bottom:1px solid var(--co-semantic-border-default)}.co-drawer__tabs--empty{display:none}.co-drawer__body{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:var(--co-spacing-xl);position:relative}.co-drawer__body{scrollbar-width:thin;scrollbar-color:transparent transparent}.co-drawer__body:hover{scrollbar-color:var(--co-semantic-border-default) transparent}.co-drawer__body::-webkit-scrollbar{width:6px}.co-drawer__body::-webkit-scrollbar-track{background:transparent}.co-drawer__body::-webkit-scrollbar-thumb{background:transparent;border-radius:9999px}.co-drawer__body:hover::-webkit-scrollbar-thumb{background:var(--co-semantic-border-default)}.co-drawer__body:hover::-webkit-scrollbar-thumb:hover{background:var(--co-semantic-border-field)}.co-drawer__body:hover::-webkit-scrollbar-thumb:active{background:var(--co-semantic-border-strong)}.co-drawer__footer{display:flex;justify-content:flex-end;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-top:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__footer--empty{display:none}@media (max-width: 600px){.co-drawer--right,.co-drawer--left{width:100vw !important}}.co-drawer--modeless{z-index:1000;border:0;padding:0;background:transparent}.co-drawer--modeless.co-drawer--right{left:auto;bottom:auto}.co-drawer--modeless.co-drawer--left{right:auto;bottom:auto}.co-drawer--modeless.co-drawer--bottom{top:auto}';export{S as co_calendar,j as co_date_field,N as co_drawer}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as o,a as i}from"./p-DJkaRtbb.js";import{c as s,g as e,f as a}from"./p-BtliEQAT.js";const r={es:{ctrl:"Ctrl",shift:"Shift",alt:"Alt",win:"Win"},en:{ctrl:"Ctrl",shift:"Shift",alt:"Alt",win:"Win"},pt:{ctrl:"Ctrl",shift:"Shift",alt:"Alt",win:"Win"}},n={mod:"command",cmd:"command",shift:"arrow-fat-up",alt:"option",ctrl:"control"};function c(t){return"mod"===t||"cmd"===t||"shift"===t||"alt"===t||"ctrl"===t}function l(t,o,i){if("mac"===o)switch(t){case"mod":case"cmd":return"Cmd";case"shift":return"Shift";case"alt":return"Option";case"ctrl":return"Control"}switch(t){case"mod":case"ctrl":return i.ctrl;case"cmd":return i.win;case"shift":return i.shift;case"alt":return i.alt}}const h=class{constructor(o){t(this,o),this.keys="",this.platform="auto",this.surface="light",this.size="sm",this.chord=!1}resolvePlatform(){return"mac"===this.platform?"mac":"win"===this.platform?"win":function(){if("undefined"==typeof navigator)return!1;const t=navigator.platform||"",o=navigator.userAgent||"";return/Mac/i.test(t)||/Mac/i.test(o)}()?"mac":"win"}render(){const t=this.keys.split("+").map((t=>t.trim().toLowerCase())).filter(Boolean),i=this.resolvePlatform(),s=r[function(t){const o=(t||"").toLowerCase();return o.startsWith("es")?"es":o.startsWith("pt")?"pt":"en"}(this.locale)],e="sm"===this.size?12:10,a=t.map((t=>c(t)?l(t,i,s):t.toUpperCase())).join(" + "),h=t=>c(t)&&"mac"===i,p=(t,e)=>h(t)?o("co-icon",{name:n[t],size:e}):c(t)?l(t,i,s):t.toUpperCase(),d=[];return this.chord?d.push(o("kbd",{class:"co-kbd__key co-kbd__key--chord",part:"key",key:"chord"},t.map(((t,i)=>o("span",{class:{"co-kbd__cell":!0,"co-kbd__cell--icon":h(t),"co-kbd__cell--text":!h(t)},part:"cell",key:`cell-${i}`},p(t,12)))))):t.forEach(((t,i)=>{i>0&&d.push(o("span",{class:"co-kbd__sep",part:"sep",key:`sep-${i}`},"+")),d.push(o("kbd",{class:"co-kbd__key",part:"key",key:`key-${i}`},p(t,e)))})),o("span",{key:"539eee42201f514049f1a879f1cab901af375b79",class:{"co-kbd":!0,[`co-kbd--${this.size}`]:!0,[`co-kbd--${this.surface}`]:!0,"co-kbd--chord":this.chord},role:"group","aria-label":a,part:"group"},d)}};h.style=":host{display:inline-flex}.co-kbd{display:inline-flex;align-items:center;gap:var(--co-spacing-xxs, 2px)}.co-kbd__sep{font-family:var(--co-font-family-primary, 'Geist', sans-serif);font-size:var(--co-font-size-10, 10px);line-height:1;opacity:0.6}.co-kbd__key{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-family:var(--co-font-family-primary, 'Geist', sans-serif);font-style:normal;font-weight:var(--co-font-weight-medium, 500);font-size:var(--co-font-size-10, 10px);line-height:1;text-transform:uppercase;border-radius:var(--co-border-radius-xxs, 4px)}.co-kbd--sm .co-kbd__key{min-width:30px;height:18px;padding:0 3px}.co-kbd--xs .co-kbd__key{width:16px;height:16px;padding:0}.co-kbd__cell{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:12px;height:12px;flex-shrink:0;white-space:nowrap}.co-kbd__cell--icon{width:12px}.co-kbd__cell--text{width:auto;padding:0 1px}.co-kbd--xs .co-kbd__key--chord{width:auto;min-width:16px;height:16px;padding:0 2px}.co-kbd--light .co-kbd__key{background:var(--co-semantic-surface-control, #f6f6f6);color:var(--co-semantic-text-default, #1f1c1b)}.co-kbd--light .co-kbd__sep{color:var(--co-semantic-text-default, #1f1c1b)}.co-kbd--dark .co-kbd__key{background:var(--co-color-opacity-blanco-16, rgba(255, 255, 255, 0.16));color:var(--co-color-base-blanco, #fff)}.co-kbd--dark .co-kbd__sep{color:var(--co-color-base-blanco, #fff)}";const p=class{constructor(o){t(this,o),this.content="",this.placement="top",this.offset=8,this.showDelay=80,this.hideDelay=100,this.disabled=!1,this.arrow=!0,this.flip=!0,this.maxWidth="280px",this.block=!1,this.variant="default",this.tone="default",this.visible=!1,this.actualPlacement="top",this.closing=!1,this.suppressed=!1,this.scrollParents=[],this.cachedOffsetAncestor=null,this.offsetAncestorComputed=!1,this.scheduleShow=()=>{this.disabled||!this.content||this.suppressed||(this.clearHideTimeout(),this.visible||(this.showTimeout=setTimeout((()=>{this.visible=!0}),this.showDelay)))},this.scheduleHide=()=>{this.clearShowTimeout(),this.visible&&(this.hideTimeout=setTimeout((()=>{this.visible=!1}),this.hideDelay))},this.hideImmediate=()=>{this.clearTimers(),this.visible=!1},this.finishClose=()=>{clearTimeout(this.closeFallbackTimer),this.visible||(this.closing=!1,this.panelEl=void 0)},this.handlePanelTransitionEnd=t=>{!this.visible&&this.closing&&t.target===this.panelEl&&"opacity"===t.propertyName&&this.finishClose()},this.handleMouseEnter=()=>{this.scheduleShow()},this.handleMouseLeave=()=>{this.suppressed=!1,this.scheduleHide()},this.handlePointerDown=()=>{this.suppressed=!0,this.hideImmediate()},this.handleFocusIn=()=>{this.scheduleShow()},this.handleFocusOut=()=>{this.suppressed=!1,this.scheduleHide()},this.handleKeyDown=t=>{"Escape"===t.key&&this.visible&&this.hideImmediate()},this.updatePosition=()=>{if(!this.visible||!this.triggerEl||!this.panelEl)return;const t=this.triggerEl.getBoundingClientRect(),o=this.panelEl.getBoundingClientRect();if(0===o.width&&0===o.height)return;const{top:i,left:a,actualPlacement:r}=s(t,o,{placement:this.placement,offset:this.offset,flip:this.flip});this.actualPlacement=r;let n=i,c=a;if(!this.panelEl.matches(":popover-open")&&(this.offsetAncestorComputed||(this.cachedOffsetAncestor=e(this.panelEl),(this.cachedOffsetAncestor||this.panelEl.isConnected)&&(this.offsetAncestorComputed=!0)),this.cachedOffsetAncestor)){const t=this.cachedOffsetAncestor.getBoundingClientRect();n-=t.top,c-=t.left}this.panelEl&&(this.panelEl.style.top=`${n}px`,this.panelEl.style.left=`${c}px`,this.panelEl.classList.add("co-tooltip__panel--positioned"))},this.scheduleUpdate=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(this.updatePosition)}}disconnectedCallback(){this.clearTimers(),this.cleanupListeners(),clearTimeout(this.closeFallbackTimer),this.closing=!1}onVisibleChange(t){t?(this.closing=!1,clearTimeout(this.closeFallbackTimer),this.scheduleUpdate(),requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.updatePosition()}))})),this.addScrollListeners()):(this.cleanupListeners(),this.cachedOffsetAncestor=null,this.offsetAncestorComputed=!1,this.closing=!0,clearTimeout(this.closeFallbackTimer),this.closeFallbackTimer=setTimeout((()=>this.finishClose()),250))}onDisabledChange(t){t&&this.visible&&(this.visible=!1,this.clearTimers())}clearShowTimeout(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=void 0)}clearHideTimeout(){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0)}clearTimers(){this.clearShowTimeout(),this.clearHideTimeout()}promotePanel(){const t=this.panelEl;if(t&&"function"==typeof t.showPopover)try{t.matches(":popover-open")||t.showPopover()}catch(t){}}addScrollListeners(){window.addEventListener("resize",this.scheduleUpdate,{passive:!0}),window.addEventListener("scroll",this.scheduleUpdate,{passive:!0,capture:!0}),this.scrollParents=a(this.el);for(const t of this.scrollParents)t.addEventListener("scroll",this.scheduleUpdate,{passive:!0})}cleanupListeners(){this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0),window.removeEventListener("resize",this.scheduleUpdate),window.removeEventListener("scroll",this.scheduleUpdate,{capture:!0});for(const t of this.scrollParents)t.removeEventListener("scroll",this.scheduleUpdate);this.scrollParents=[]}render(){const t=this.actualPlacement.split("-")[0];return o("div",{key:"3764a4c115b507187115cbd30f0400deb374df09",class:"co-tooltip"},o("div",{key:"50b0c6325f1254e156f07eebe07e1abc81d8955f",class:"co-tooltip__trigger",ref:t=>this.triggerEl=t,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onPointerDown:this.handlePointerDown,onFocusin:this.handleFocusIn,onFocusout:this.handleFocusOut,onKeyDown:this.handleKeyDown,"aria-describedby":this.visible?"tooltip-panel":void 0},o("slot",{key:"d38c1723c6429912c66174a8885fa7062d2294b6"})),(this.visible||this.closing)&&this.content&&o("div",{key:"ee7495acdb7bc60c922c6dd3e2719fac3d818034",id:"tooltip-panel",class:{"co-tooltip__panel":!0,[`co-tooltip__panel--${t}`]:!0,"co-tooltip__panel--closing":this.closing,"co-tooltip__panel--label":"label"===this.variant,"co-tooltip__panel--tone-error":"error"===this.tone,"co-tooltip__panel--with-shortcut":!!this.shortcut},role:"tooltip",popover:"manual",part:"panel",onTransitionEnd:this.handlePanelTransitionEnd,ref:t=>{t&&t!==this.panelEl&&(this.panelEl=t,this.promotePanel(),this.scheduleUpdate())},style:{maxWidth:this.maxWidth}},this.arrow&&o("div",{key:"97cfb106fdc759401fefafe9990aa9388bc8aed5",class:`co-tooltip__arrow co-tooltip__arrow--${t}`}),o("span",{key:"81856efa759cfdc905ca23d7982c9469622bf89b",class:"co-tooltip__content"},this.content),this.shortcut&&o("co-kbd",{key:"2a1b2bf4728c9e085e0e198c93a4057dacf6381c",keys:this.shortcut,surface:"dark",size:"xs"})))}get el(){return i(this)}static get watchers(){return{visible:[{onVisibleChange:0}],disabled:[{onDisabledChange:0}]}}};p.style=":host{display:inline-block;position:relative}.co-tooltip{display:inline-block}.co-tooltip__trigger{display:inline-block}:host([block]){display:block;width:100%;min-width:0}:host([block]) .co-tooltip,:host([block]) .co-tooltip__trigger{display:block;width:100%;min-width:0}.co-tooltip__panel{position:fixed;inset:auto;top:0;left:0;margin:0;border:0;max-height:none;overflow:visible;z-index:10000;visibility:hidden;opacity:0;pointer-events:none;--co-tooltip-surface:var(--co-color-base-negro, #1f1c1b);background:var(--co-tooltip-surface);color:var(--co-color-base-blanco, #fff);font-family:var(--co-font-family-primary, 'Geist', sans-serif);font-size:var(--co-font-size-12, 12px);line-height:1.4;font-weight:400;text-transform:none;letter-spacing:var(--co-font-letter-spacing-body, normal);padding:var(--co-spacing-xs, 4px) var(--co-spacing-sm, 8px);border-radius:var(--co-border-radius-xxs, 4px);box-shadow:0 4px 12px rgba(31, 28, 27, 0.12);white-space:normal;word-wrap:break-word;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-tooltip__panel--positioned{visibility:visible;opacity:1}.co-tooltip__panel--closing{visibility:visible;opacity:0;transition:opacity var(--co-motion-duration-instant) var(--co-motion-ease-in), transform var(--co-motion-duration-instant) var(--co-motion-ease-in)}.co-tooltip__panel--top{transform:translateY(4px)}.co-tooltip__panel--top.co-tooltip__panel--positioned{transform:translateY(0)}.co-tooltip__panel--bottom{transform:translateY(-4px)}.co-tooltip__panel--bottom.co-tooltip__panel--positioned{transform:translateY(0)}.co-tooltip__panel--left{transform:translateX(4px)}.co-tooltip__panel--left.co-tooltip__panel--positioned{transform:translateX(0)}.co-tooltip__panel--right{transform:translateX(-4px)}.co-tooltip__panel--right.co-tooltip__panel--positioned{transform:translateX(0)}.co-tooltip__arrow{position:absolute;width:0;height:0;border:5px solid transparent}.co-tooltip__arrow--top{bottom:-10px;left:50%;transform:translateX(-50%);border-top-color:var(--co-tooltip-surface);border-bottom:none}.co-tooltip__arrow--bottom{top:-5px;left:50%;transform:translateX(-50%);border-bottom-color:var(--co-tooltip-surface);border-top:none}.co-tooltip__arrow--left{right:-10px;top:50%;transform:translateY(-50%);border-left-color:var(--co-tooltip-surface);border-right:none}.co-tooltip__arrow--right{left:-5px;top:50%;transform:translateY(-50%);border-right-color:var(--co-tooltip-surface);border-left:none}.co-tooltip__panel--tone-error{--co-tooltip-surface:var(--co-semantic-status-error, #aa2e1b)}.co-tooltip__content{display:block}.co-tooltip__panel--label{padding:4px 8px;border-radius:var(--co-border-radius-xs, 8px);font-weight:var(--co-font-weight-medium, 500);line-height:1;box-shadow:none}.co-tooltip__panel--label .co-tooltip__arrow{display:none}.co-tooltip__panel--with-shortcut{display:flex;align-items:center;gap:6px}.co-tooltip__panel--with-shortcut:not(.co-tooltip__panel--label){padding-right:10px;}.co-tooltip__panel--label.co-tooltip__panel--with-shortcut{padding-right:4px}";export{h as co_kbd,p as co_tooltip}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,a as e}from"./p-DJkaRtbb.js";import{l as a}from"./p-jYd9gu_c.js";const s={es:{close:"Cerrar visor",prevImage:"Imagen anterior",nextImage:"Imagen siguiente",zoomIn:"Acercar",zoomOut:"Alejar",zoomReset:"Restablecer zoom",openOriginal:"Abrir original",counter:"{i} de {n}"},en:{close:"Close viewer",prevImage:"Previous image",nextImage:"Next image",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomReset:"Reset zoom",openOriginal:"Open original",counter:"{i} of {n}"},pt:{close:"Fechar visualizador",prevImage:"Imagem anterior",nextImage:"Próxima imagem",zoomIn:"Aproximar",zoomOut:"Afastar",zoomReset:"Redefinir zoom",openOriginal:"Abrir original",counter:"{i} de {n}"}};function n(t,i=r){const o=(null==t?void 0:t.original)||(null==t?void 0:t.src);if(!t||!o)return!1;const e=i("","_blank");if(!e)return!1;try{e.opener=null}catch(t){}return function(t,i,o){var e;if(t.title=i.alt||"",!t.body)return;t.body.style.cssText="margin:0;min-height:100vh;display:grid;place-items:center;color-scheme:dark;background:Canvas;color:CanvasText";const a="video"===i.kind,s=t.createElement(a?"video":"img");s.style.cssText="max-width:100vw;max-height:100vh;object-fit:contain",s.setAttribute("src",o),a?(s.setAttribute("controls",""),i.poster&&s.setAttribute("poster",i.poster)):(s.setAttribute("alt",i.alt||""),i.src&&i.src!==o&&(null===(e=s.addEventListener)||void 0===e||e.call(s,"error",(()=>s.setAttribute("src",i.src)),{once:!0}))),t.body.appendChild(s)}(e.document,t,o),!0}function r(t,i){return window.open(t,i)}const c=1.15,h=class{constructor(o){t(this,o),this.coClose=i(this,"coClose",3),this.coChange=i(this,"coChange",3),this.images="[]",this.startIndex=0,this.open=!1,this.index=0,this.scale=1,this.tx=0,this.ty=0,this.dragging=!1,this.lastImagesStr="",this.lastParsed=[],this.dragStart={x:0,y:0,tx:0,ty:0},this.pendingFocus=!1,this.syncTopLayer=t=>{t&&(this.rootEl=t);const i=this.rootEl;if(i&&"function"==typeof i.showPopover)if(this.open){clearTimeout(this.demoteTimer);try{i.matches(":popover-open")||i.showPopover()}catch(t){}}else i.matches(":popover-open")&&(clearTimeout(this.demoteTimer),this.demoteTimer=setTimeout((()=>{try{i.hidePopover()}catch(t){}}),220))},this.handleKey=t=>{if(this.open){if("Escape"===t.key)return this.escapeBelongsToPlayer()||(this.requestClose(),t.preventDefault()),void t.stopPropagation();if("Tab"!==t.key){if(!this.isFocusInPlayer()){switch(t.key){case"ArrowLeft":this.goTo(-1);break;case"ArrowRight":this.goTo(1);break;case"+":case"=":if(this.isVideoSlide)return;this.zoomAt(this.scale*c,0,0);break;case"-":if(this.isVideoSlide)return;this.zoomAt(this.scale/c,0,0);break;case"0":if(this.isVideoSlide)return;this.resetView();break;default:return}t.preventDefault(),t.stopPropagation()}}else this.trapTab(t)}},this.requestClose=()=>{this.coClose.emit()},this.mountPlayer=t=>{t&&t!==this.playerEl&&(this.playerEl=t,this.tryAutoplay())},this.handlePlayerReady=t=>{var i;const{width:o,height:e}=t.detail||{};o&&e&&(null===(i=this.playerEl)||void 0===i||i.style.setProperty("--co-lb-ar",String(o/e)))},this.handleWheel=t=>{t.preventDefault();const[i,o]=this.stagePoint(t);this.zoomAt(this.scale*(t.deltaY<0?c:1/c),i,o)},this.handleDblClick=t=>{const[i,o]=this.stagePoint(t);this.zoomAt(this.scale>1?1:2.5,i,o)},this.handlePointerDown=t=>{var i;this.scale<=1||(t.preventDefault(),this.dragging=!0,this.dragStart={x:t.clientX,y:t.clientY,tx:this.tx,ty:this.ty},null===(i=this.imgEl)||void 0===i||i.setPointerCapture(t.pointerId))},this.handlePointerMove=t=>{if(!this.dragging)return;const i=this.dragStart.tx+(t.clientX-this.dragStart.x),o=this.dragStart.ty+(t.clientY-this.dragStart.y);[this.tx,this.ty]=this.clampPan(i,o,this.scale)},this.handlePointerUp=t=>{var i;this.dragging&&(this.dragging=!1,null===(i=this.imgEl)||void 0===i||i.releasePointerCapture(t.pointerId))},this.openOriginal=()=>{n(this.parsedImages[this.index])},this.stop=t=>t.stopPropagation()}get activeItem(){return this.parsedImages[this.index]}get isVideoSlide(){var t;return"video"===(null===(t=this.activeItem)||void 0===t?void 0:t.kind)}get parsedImages(){const t=this.images;if("string"!=typeof t||!t.trim())return[];if(t===this.lastImagesStr)return this.lastParsed;let i=[];try{const o=JSON.parse(t);Array.isArray(o)&&(i=o.filter((t=>t&&t.src)))}catch(t){}return this.lastImagesStr=t,this.lastParsed=i,i}componentWillLoad(){this.index=this.clampIndex(this.startIndex),this.pendingAutoplay=this.open}connectedCallback(){this.open&&this.attachKeyListener()}disconnectedCallback(){this.detachKeyListener(),this.pauseVideo(),clearTimeout(this.demoteTimer)}componentDidRender(){var t;this.pendingFocus&&(this.pendingFocus=!1,null===(t=this.closeBtnEl)||void 0===t||t.focus())}onOpenChange(t){var i,o,e;this.syncTopLayer(),t?(this.index=this.clampIndex(this.startIndex),this.resetView(),this.preloadNeighbors(),this.attachKeyListener(),this.pendingAutoplay=!0,this.tryAutoplay(),this.previouslyFocused=null!==(i=document.activeElement)&&void 0!==i?i:void 0,this.pendingFocus=!0):(this.detachKeyListener(),this.pauseVideo(),this.pendingAutoplay=!1,null===(e=null===(o=this.previouslyFocused)||void 0===o?void 0:o.focus)||void 0===e||e.call(o),this.previouslyFocused=void 0)}onStartIndexChange(t){this.open&&(this.index=this.clampIndex(t),this.resetView())}onImagesChange(){this.index=this.clampIndex(this.index)}attachKeyListener(){window.addEventListener("keydown",this.handleKey,{capture:!0})}detachKeyListener(){window.removeEventListener("keydown",this.handleKey,{capture:!0})}focusables(){var t,i;return Array.from(null!==(i=null===(t=this.el.shadowRoot)||void 0===t?void 0:t.querySelectorAll("button, co-video"))&&void 0!==i?i:[]).flatMap((t=>{var i,o;return"CO-VIDEO"===t.tagName?Array.from(null!==(o=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelectorAll('button:not([tabindex="-1"]), [tabindex="0"]'))&&void 0!==o?o:[]):[t]}))}deepActive(){var t,i,o;let e=null!==(i=null===(t=this.el.shadowRoot)||void 0===t?void 0:t.activeElement)&&void 0!==i?i:null;for(;null===(o=null==e?void 0:e.shadowRoot)||void 0===o?void 0:o.activeElement;)e=e.shadowRoot.activeElement;return e}escapeBelongsToPlayer(){var t,i;const o=document;return!(!o.fullscreenElement&&!o.webkitFullscreenElement&&!(null===(i=null===(t=this.playerEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector(".co-video__speed-menu")))}isFocusInPlayer(){var t;const i=this.playerEl;return!!i&&(null===(t=this.el.shadowRoot)||void 0===t?void 0:t.activeElement)===i}trapTab(t){const i=this.focusables();if(0===i.length)return;t.preventDefault(),t.stopPropagation();const o=t.shiftKey?-1:1,e=i.indexOf(this.deepActive());(e<0?i[o>0?0:i.length-1]:i[(e+o+i.length)%i.length]).focus()}clampIndex(t){const i=this.parsedImages.length;return 0===i?0:Math.min(Math.max(0,t),i-1)}resetView(){this.scale=1,this.tx=0,this.ty=0,this.dragging=!1}goTo(t){const i=this.parsedImages.length;i<2||(this.pauseVideo(),this.pendingAutoplay=!1,this.index=(this.index+t+i)%i,this.resetView(),this.coChange.emit(this.index),this.preloadNeighbors())}preloadNeighbors(){const t=this.parsedImages;if(!(t.length<2))for(const i of[1,-1]){const o=t[(this.index+i+t.length)%t.length];if(!o)continue;const e="video"===o.kind?o.poster:o.src;e&&((new Image).src=e)}}tryAutoplay(){var t;if(!this.pendingAutoplay||!this.open)return;if(!this.isVideoSlide)return void(this.pendingAutoplay=!1);const i=this.playerEl;i&&(this.pendingAutoplay=!1,Promise.resolve(null===(t=i.componentOnReady)||void 0===t?void 0:t.call(i)).then((()=>{var t;if(this.open&&this.playerEl===i&&this.isVideoSlide)return null===(t=i.play)||void 0===t?void 0:t.call(i)})).catch((()=>{})))}pauseVideo(){var t,i;try{const o=null===(i=null===(t=this.playerEl)||void 0===t?void 0:t.pause)||void 0===i?void 0:i.call(t);o&&"function"==typeof o.catch&&o.catch((()=>{}))}catch(t){}}clampPan(t,i,o){const e=this.stageEl,a=this.imgEl;if(!e||!a)return[t,i];const s=Math.max(0,(a.offsetWidth*o-e.clientWidth)/2),n=Math.max(0,(a.offsetHeight*o-e.clientHeight)/2);return[Math.min(Math.max(t,-s),s),Math.min(Math.max(i,-n),n)]}zoomAt(t,i,o){const e=this.scale,a=Math.min(Math.max(t,1),8);if(a===e)return;const s=a/e;let n=i-(i-this.tx)*s,r=o-(o-this.ty)*s;1===a?(n=0,r=0):[n,r]=this.clampPan(n,r,a),this.scale=a,this.tx=n,this.ty=r}stagePoint(t){var i;const o=null===(i=this.stageEl)||void 0===i?void 0:i.getBoundingClientRect();return o?[t.clientX-o.left-o.width/2,t.clientY-o.top-o.height/2]:[0,0]}render(){const t=s[a(this.locale)],i=this.parsedImages,e=i[this.index],n=i.length>1,r="video"===(null==e?void 0:e.kind),h=t.counter.replace("{i}",String(this.index+1)).replace("{n}",String(i.length));return o("div",{key:"189314e8e6be6a3b908d2c4387e0561162a1b96e",class:{"co-lightbox":!0,"co-lightbox--open":this.open},part:"overlay",role:"dialog","aria-modal":"true","aria-label":null==e?void 0:e.alt,popover:"manual",ref:this.syncTopLayer,onClick:this.requestClose},e&&o("div",{key:"ee52518418ac4e58cd9bcece7bc3391cb0e9742f",class:"co-lightbox__toolbar",part:"toolbar",onClick:this.stop},o("span",{key:"c9e214561c3d2b7b773f82888a9147aab7d120df",class:"co-lightbox__caption",title:e.alt},e.alt),!r&&o("div",{key:"911216d5873a1462303f1ed5b59c14d72b7328c4",class:"co-lightbox__zoom"},o("button",{key:"9344807bbac6aefc47824b866a4225206b859323",class:"co-lightbox__btn",type:"button","aria-label":t.zoomOut,title:t.zoomOut,onClick:()=>this.zoomAt(this.scale/c,0,0)},o("co-icon",{key:"736c42fc97c09d76cf0aa8e0763ba56eb1ecd394",name:"minus",size:16})),o("button",{key:"e115084b8e4941bd0f476b248c3cc88f096c55f2",class:"co-lightbox__btn co-lightbox__zoom-value",type:"button","aria-label":t.zoomReset,title:t.zoomReset,onClick:()=>this.resetView()},Math.round(100*this.scale),"%"),o("button",{key:"d5955ce9dcf15f0768a1f012a11acec012805811",class:"co-lightbox__btn",type:"button","aria-label":t.zoomIn,title:t.zoomIn,onClick:()=>this.zoomAt(this.scale*c,0,0)},o("co-icon",{key:"64126b83b5ee1a510e4787c17a77b5bfb65db721",name:"plus",size:16}))),o("button",{key:"1798ea6aba9c8ce425317258b076874134de4724",class:"co-lightbox__btn",type:"button","aria-label":t.openOriginal,title:t.openOriginal,onClick:this.openOriginal},o("co-icon",{key:"a4ef44fe626c33b1b0eb11d38afe034ca5a13a8f",name:"arrow-square-out",size:16})),o("button",{key:"c68fbb1498dcfe177d8255647c39b5db83a66f7c",class:"co-lightbox__btn",part:"close",type:"button","aria-label":t.close,title:t.close,ref:t=>this.closeBtnEl=t,onClick:this.requestClose},o("co-icon",{key:"b62c1dd5fa4fba5a57b4c804e31494e5da48f0af",name:"x",size:16}))),e&&o("div",{key:"80d34170f27f6a0177747e797e10646dcfca0bed",class:"co-lightbox__stage",ref:t=>this.stageEl=t,onWheel:r?void 0:this.handleWheel},r?o("co-video",{class:"co-lightbox__video",part:"video",key:`video-${this.index}`,ref:this.mountPlayer,src:e.src,poster:e.poster||"",aspectRatio:"auto",rounded:"none",controlsAutoHide:!1,showSpeed:!0,showPip:!0,locale:a(this.locale),onCoReady:this.handlePlayerReady,onClick:this.stop}):o("img",{class:{"co-lightbox__img":!0,"co-lightbox__img--zoomed":this.scale>1,"co-lightbox__img--dragging":this.dragging},part:"image",ref:t=>this.imgEl=t,src:e.src,alt:e.alt||"",draggable:!1,style:{transform:`translate(${this.tx}px, ${this.ty}px) scale(${this.scale})`},onClick:this.stop,onDblClick:this.handleDblClick,onPointerDown:this.handlePointerDown,onPointerMove:this.handlePointerMove,onPointerUp:this.handlePointerUp,onPointerCancel:this.handlePointerUp})),e&&n&&o("button",{key:"4ef78cd047f1e8b2efb669aefbee51b73e4c5c3b",class:"co-lightbox__nav co-lightbox__nav--prev",part:"prev",type:"button","aria-label":t.prevImage,title:t.prevImage,onClick:t=>{t.stopPropagation(),this.goTo(-1)}},o("co-icon",{key:"834bd12a0dead46df44e291197f5d3b79f619932",name:"caret-left",size:24})),e&&n&&o("button",{key:"0252acb36e360dedd1fe8ac8cba74ab5895476c1",class:"co-lightbox__nav co-lightbox__nav--next",part:"next",type:"button","aria-label":t.nextImage,title:t.nextImage,onClick:t=>{t.stopPropagation(),this.goTo(1)}},o("co-icon",{key:"53521495d2bd6ac11004cedd96fd7351135115a7",name:"caret-right",size:24})),e&&n&&o("div",{key:"fae75527e79964a30745accf565b33be3b466ba6",class:"co-lightbox__counter",part:"counter",onClick:this.stop},h))}get el(){return e(this)}static get watchers(){return{open:[{onOpenChange:0}],startIndex:[{onStartIndexChange:0}],images:[{onImagesChange:0}]}}};h.style=":host{display:contents;font-family:var(--co-font-family-primary)}.co-lightbox{position:fixed;inset:0;margin:0;border:0;padding:0;width:auto;height:auto;overflow:visible;color:inherit;z-index:1100;display:flex;align-items:center;justify-content:center;background:var(--co-color-opacity-negro-80);opacity:0;pointer-events:none;transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-lightbox--open{opacity:1;pointer-events:auto}.co-lightbox__toolbar{position:absolute;top:0;left:0;right:0;z-index:2;display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-md) var(--co-spacing-lg);background:linear-gradient(var(--co-color-opacity-negro-50), transparent)}.co-lightbox__caption{flex:1;min-width:0;color:var(--co-color-base-blanco);font-size:var(--co-font-size-14);line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-lightbox__zoom{display:flex;align-items:center;gap:var(--co-spacing-xxs);padding:0 var(--co-spacing-xs);border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8)}.co-lightbox__btn{display:flex;align-items:center;justify-content:center;min-width:32px;height:32px;padding:0 var(--co-spacing-xs);border:none;border-radius:var(--co-border-radius-full);background:transparent;color:var(--co-color-base-blanco);font-family:inherit;font-size:var(--co-font-size-13, 13px);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-lightbox__btn:hover{background:var(--co-color-opacity-blanco-16)}.co-lightbox__zoom-value{min-width:48px;font-variant-numeric:tabular-nums}.co-lightbox__stage{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none}.co-lightbox__img{max-width:calc(100vw - var(--co-spacing-5xl) * 2);max-height:calc(100vh - var(--co-spacing-5xl) * 2);border-radius:var(--co-border-radius-xs);user-select:none;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-lightbox__video{--co-lb-ar:1.7778;flex:0 0 auto;width:auto;aspect-ratio:var(--co-lb-ar);height:min( calc(100vh - var(--co-spacing-5xl) * 2), calc((100vw - var(--co-spacing-5xl) * 2) / var(--co-lb-ar)), calc(1200px / var(--co-lb-ar)) );border-radius:var(--co-border-radius-xs);overflow:hidden}.co-lightbox__img--zoomed{cursor:grab}.co-lightbox__img--dragging{cursor:grabbing;transition:none}.co-lightbox__nav{position:absolute;top:50%;transform:translateY(-50%);z-index:2;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:none;border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8);color:var(--co-color-base-blanco);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-lightbox__nav:hover{background:var(--co-color-opacity-blanco-25)}.co-lightbox__nav--prev{left:var(--co-spacing-lg)}.co-lightbox__nav--next{right:var(--co-spacing-lg)}.co-lightbox__counter{position:absolute;bottom:var(--co-spacing-lg);left:50%;transform:translateX(-50%);z-index:2;padding:var(--co-spacing-xs) var(--co-spacing-md);border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8);color:var(--co-color-base-blanco);font-size:var(--co-font-size-13, 13px);font-variant-numeric:tabular-nums}";export{h as co_lightbox}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,p as o,H as i,h as s}from"./index.js";import{c as e,g as a,f as r}from"./p-BtliEQAT.js";import{d as n}from"./p-qMNHMnvI.js";import{d as l}from"./p-DldA2IL3.js";const c=o(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.content="",this.placement="top",this.offset=8,this.showDelay=80,this.hideDelay=100,this.disabled=!1,this.arrow=!0,this.flip=!0,this.maxWidth="280px",this.block=!1,this.variant="default",this.tone="default",this.visible=!1,this.actualPlacement="top",this.closing=!1,this.suppressed=!1,this.scrollParents=[],this.cachedOffsetAncestor=null,this.offsetAncestorComputed=!1,this.scheduleShow=()=>{this.disabled||!this.content||this.suppressed||(this.clearHideTimeout(),this.visible||(this.showTimeout=setTimeout((()=>{this.visible=!0}),this.showDelay)))},this.scheduleHide=()=>{this.clearShowTimeout(),this.visible&&(this.hideTimeout=setTimeout((()=>{this.visible=!1}),this.hideDelay))},this.hideImmediate=()=>{this.clearTimers(),this.visible=!1},this.finishClose=()=>{clearTimeout(this.closeFallbackTimer),this.visible||(this.closing=!1,this.panelEl=void 0)},this.handlePanelTransitionEnd=t=>{!this.visible&&this.closing&&t.target===this.panelEl&&"opacity"===t.propertyName&&this.finishClose()},this.handleMouseEnter=()=>{this.scheduleShow()},this.handleMouseLeave=()=>{this.suppressed=!1,this.scheduleHide()},this.handlePointerDown=()=>{this.suppressed=!0,this.hideImmediate()},this.handleFocusIn=()=>{this.scheduleShow()},this.handleFocusOut=()=>{this.suppressed=!1,this.scheduleHide()},this.handleKeyDown=t=>{"Escape"===t.key&&this.visible&&this.hideImmediate()},this.updatePosition=()=>{if(!this.visible||!this.triggerEl||!this.panelEl)return;const t=this.triggerEl.getBoundingClientRect(),o=this.panelEl.getBoundingClientRect();if(0===o.width&&0===o.height)return;const{top:i,left:s,actualPlacement:r}=e(t,o,{placement:this.placement,offset:this.offset,flip:this.flip});this.actualPlacement=r;let n=i,l=s;if(!this.panelEl.matches(":popover-open")&&(this.offsetAncestorComputed||(this.cachedOffsetAncestor=a(this.panelEl),(this.cachedOffsetAncestor||this.panelEl.isConnected)&&(this.offsetAncestorComputed=!0)),this.cachedOffsetAncestor)){const t=this.cachedOffsetAncestor.getBoundingClientRect();n-=t.top,l-=t.left}this.panelEl&&(this.panelEl.style.top=`${n}px`,this.panelEl.style.left=`${l}px`,this.panelEl.classList.add("co-tooltip__panel--positioned"))},this.scheduleUpdate=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(this.updatePosition)}}disconnectedCallback(){this.clearTimers(),this.cleanupListeners(),clearTimeout(this.closeFallbackTimer),this.closing=!1}onVisibleChange(t){t?(this.closing=!1,clearTimeout(this.closeFallbackTimer),this.scheduleUpdate(),requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.updatePosition()}))})),this.addScrollListeners()):(this.cleanupListeners(),this.cachedOffsetAncestor=null,this.offsetAncestorComputed=!1,this.closing=!0,clearTimeout(this.closeFallbackTimer),this.closeFallbackTimer=setTimeout((()=>this.finishClose()),250))}onDisabledChange(t){t&&this.visible&&(this.visible=!1,this.clearTimers())}clearShowTimeout(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=void 0)}clearHideTimeout(){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0)}clearTimers(){this.clearShowTimeout(),this.clearHideTimeout()}promotePanel(){const t=this.panelEl;if(t&&"function"==typeof t.showPopover)try{t.matches(":popover-open")||t.showPopover()}catch(t){}}addScrollListeners(){window.addEventListener("resize",this.scheduleUpdate,{passive:!0}),window.addEventListener("scroll",this.scheduleUpdate,{passive:!0,capture:!0}),this.scrollParents=r(this.el);for(const t of this.scrollParents)t.addEventListener("scroll",this.scheduleUpdate,{passive:!0})}cleanupListeners(){this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0),window.removeEventListener("resize",this.scheduleUpdate),window.removeEventListener("scroll",this.scheduleUpdate,{capture:!0});for(const t of this.scrollParents)t.removeEventListener("scroll",this.scheduleUpdate);this.scrollParents=[]}render(){const t=this.actualPlacement.split("-")[0];return s("div",{key:"3764a4c115b507187115cbd30f0400deb374df09",class:"co-tooltip"},s("div",{key:"50b0c6325f1254e156f07eebe07e1abc81d8955f",class:"co-tooltip__trigger",ref:t=>this.triggerEl=t,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onPointerDown:this.handlePointerDown,onFocusin:this.handleFocusIn,onFocusout:this.handleFocusOut,onKeyDown:this.handleKeyDown,"aria-describedby":this.visible?"tooltip-panel":void 0},s("slot",{key:"d38c1723c6429912c66174a8885fa7062d2294b6"})),(this.visible||this.closing)&&this.content&&s("div",{key:"ee7495acdb7bc60c922c6dd3e2719fac3d818034",id:"tooltip-panel",class:{"co-tooltip__panel":!0,[`co-tooltip__panel--${t}`]:!0,"co-tooltip__panel--closing":this.closing,"co-tooltip__panel--label":"label"===this.variant,"co-tooltip__panel--tone-error":"error"===this.tone,"co-tooltip__panel--with-shortcut":!!this.shortcut},role:"tooltip",popover:"manual",part:"panel",onTransitionEnd:this.handlePanelTransitionEnd,ref:t=>{t&&t!==this.panelEl&&(this.panelEl=t,this.promotePanel(),this.scheduleUpdate())},style:{maxWidth:this.maxWidth}},this.arrow&&s("div",{key:"97cfb106fdc759401fefafe9990aa9388bc8aed5",class:`co-tooltip__arrow co-tooltip__arrow--${t}`}),s("span",{key:"81856efa759cfdc905ca23d7982c9469622bf89b",class:"co-tooltip__content"},this.content),this.shortcut&&s("co-kbd",{key:"2a1b2bf4728c9e085e0e198c93a4057dacf6381c",keys:this.shortcut,surface:"dark",size:"xs"})))}get el(){return this}static get watchers(){return{visible:[{onVisibleChange:0}],disabled:[{onDisabledChange:0}]}}static get style(){return":host{display:inline-block;position:relative}.co-tooltip{display:inline-block}.co-tooltip__trigger{display:inline-block}:host([block]){display:block;width:100%;min-width:0}:host([block]) .co-tooltip,:host([block]) .co-tooltip__trigger{display:block;width:100%;min-width:0}.co-tooltip__panel{position:fixed;inset:auto;top:0;left:0;margin:0;border:0;max-height:none;overflow:visible;z-index:10000;visibility:hidden;opacity:0;pointer-events:none;--co-tooltip-surface:var(--co-color-base-negro, #1f1c1b);background:var(--co-tooltip-surface);color:var(--co-color-base-blanco, #fff);font-family:var(--co-font-family-primary, 'Geist', sans-serif);font-size:var(--co-font-size-12, 12px);line-height:1.4;font-weight:400;text-transform:none;letter-spacing:var(--co-font-letter-spacing-body, normal);padding:var(--co-spacing-xs, 4px) var(--co-spacing-sm, 8px);border-radius:var(--co-border-radius-xxs, 4px);box-shadow:0 4px 12px rgba(31, 28, 27, 0.12);white-space:normal;word-wrap:break-word;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-tooltip__panel--positioned{visibility:visible;opacity:1}.co-tooltip__panel--closing{visibility:visible;opacity:0;transition:opacity var(--co-motion-duration-instant) var(--co-motion-ease-in), transform var(--co-motion-duration-instant) var(--co-motion-ease-in)}.co-tooltip__panel--top{transform:translateY(4px)}.co-tooltip__panel--top.co-tooltip__panel--positioned{transform:translateY(0)}.co-tooltip__panel--bottom{transform:translateY(-4px)}.co-tooltip__panel--bottom.co-tooltip__panel--positioned{transform:translateY(0)}.co-tooltip__panel--left{transform:translateX(4px)}.co-tooltip__panel--left.co-tooltip__panel--positioned{transform:translateX(0)}.co-tooltip__panel--right{transform:translateX(-4px)}.co-tooltip__panel--right.co-tooltip__panel--positioned{transform:translateX(0)}.co-tooltip__arrow{position:absolute;width:0;height:0;border:5px solid transparent}.co-tooltip__arrow--top{bottom:-10px;left:50%;transform:translateX(-50%);border-top-color:var(--co-tooltip-surface);border-bottom:none}.co-tooltip__arrow--bottom{top:-5px;left:50%;transform:translateX(-50%);border-bottom-color:var(--co-tooltip-surface);border-top:none}.co-tooltip__arrow--left{right:-10px;top:50%;transform:translateY(-50%);border-left-color:var(--co-tooltip-surface);border-right:none}.co-tooltip__arrow--right{left:-5px;top:50%;transform:translateY(-50%);border-right-color:var(--co-tooltip-surface);border-left:none}.co-tooltip__panel--tone-error{--co-tooltip-surface:var(--co-semantic-status-error, #aa2e1b)}.co-tooltip__content{display:block}.co-tooltip__panel--label{padding:4px 8px;border-radius:var(--co-border-radius-xs, 8px);font-weight:var(--co-font-weight-medium, 500);line-height:1;box-shadow:none}.co-tooltip__panel--label .co-tooltip__arrow{display:none}.co-tooltip__panel--with-shortcut{display:flex;align-items:center;gap:6px}.co-tooltip__panel--with-shortcut:not(.co-tooltip__panel--label){padding-right:10px;}.co-tooltip__panel--label.co-tooltip__panel--with-shortcut{padding-right:4px}"}},[257,"co-tooltip",{content:[1],placement:[1],offset:[2],showDelay:[2,"show-delay"],hideDelay:[2,"hide-delay"],disabled:[4],arrow:[4],flip:[4],maxWidth:[1,"max-width"],block:[516],variant:[1],tone:[1],shortcut:[1],visible:[32],actualPlacement:[32],closing:[32]},void 0,{visible:[{onVisibleChange:0}],disabled:[{onDisabledChange:0}]}]);function h(){"undefined"!=typeof customElements&&["co-tooltip","co-icon","co-kbd"].forEach((o=>{switch(o){case"co-tooltip":customElements.get(t(o))||customElements.define(t(o),c);break;case"co-icon":customElements.get(t(o))||n();break;case"co-kbd":customElements.get(t(o))||l()}}))}h();export{c as C,h as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,p as i,H as o,c as e,h as a}from"./index.js";import{l as s}from"./p-jYd9gu_c.js";import{d as n}from"./p-qMNHMnvI.js";import{d as r}from"./p-COCcx0DN.js";const c={es:{close:"Cerrar visor",prevImage:"Imagen anterior",nextImage:"Imagen siguiente",zoomIn:"Acercar",zoomOut:"Alejar",zoomReset:"Restablecer zoom",openOriginal:"Abrir original",counter:"{i} de {n}"},en:{close:"Close viewer",prevImage:"Previous image",nextImage:"Next image",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomReset:"Reset zoom",openOriginal:"Open original",counter:"{i} of {n}"},pt:{close:"Fechar visualizador",prevImage:"Imagem anterior",nextImage:"Próxima imagem",zoomIn:"Aproximar",zoomOut:"Afastar",zoomReset:"Redefinir zoom",openOriginal:"Abrir original",counter:"{i} de {n}"}};function h(t,i=l){const o=(null==t?void 0:t.original)||(null==t?void 0:t.src);if(!t||!o)return!1;const e=i("","_blank");if(!e)return!1;try{e.opener=null}catch(t){}return function(t,i,o){var e;if(t.title=i.alt||"",!t.body)return;t.body.style.cssText="margin:0;min-height:100vh;display:grid;place-items:center;color-scheme:dark;background:Canvas;color:CanvasText";const a="video"===i.kind,s=t.createElement(a?"video":"img");s.style.cssText="max-width:100vw;max-height:100vh;object-fit:contain",s.setAttribute("src",o),a?(s.setAttribute("controls",""),i.poster&&s.setAttribute("poster",i.poster)):(s.setAttribute("alt",i.alt||""),i.src&&i.src!==o&&(null===(e=s.addEventListener)||void 0===e||e.call(s,"error",(()=>s.setAttribute("src",i.src)),{once:!0}))),t.body.appendChild(s)}(e.document,t,o),!0}function l(t,i){return window.open(t,i)}const d=1.15,b=i(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coClose=e(this,"coClose",3),this.coChange=e(this,"coChange",3),this.images="[]",this.startIndex=0,this.open=!1,this.index=0,this.scale=1,this.tx=0,this.ty=0,this.dragging=!1,this.lastImagesStr="",this.lastParsed=[],this.dragStart={x:0,y:0,tx:0,ty:0},this.pendingFocus=!1,this.syncTopLayer=t=>{t&&(this.rootEl=t);const i=this.rootEl;if(i&&"function"==typeof i.showPopover)if(this.open){clearTimeout(this.demoteTimer);try{i.matches(":popover-open")||i.showPopover()}catch(t){}}else i.matches(":popover-open")&&(clearTimeout(this.demoteTimer),this.demoteTimer=setTimeout((()=>{try{i.hidePopover()}catch(t){}}),220))},this.handleKey=t=>{if(this.open){if("Escape"===t.key)return this.escapeBelongsToPlayer()||(this.requestClose(),t.preventDefault()),void t.stopPropagation();if("Tab"!==t.key){if(!this.isFocusInPlayer()){switch(t.key){case"ArrowLeft":this.goTo(-1);break;case"ArrowRight":this.goTo(1);break;case"+":case"=":if(this.isVideoSlide)return;this.zoomAt(this.scale*d,0,0);break;case"-":if(this.isVideoSlide)return;this.zoomAt(this.scale/d,0,0);break;case"0":if(this.isVideoSlide)return;this.resetView();break;default:return}t.preventDefault(),t.stopPropagation()}}else this.trapTab(t)}},this.requestClose=()=>{this.coClose.emit()},this.mountPlayer=t=>{t&&t!==this.playerEl&&(this.playerEl=t,this.tryAutoplay())},this.handlePlayerReady=t=>{var i;const{width:o,height:e}=t.detail||{};o&&e&&(null===(i=this.playerEl)||void 0===i||i.style.setProperty("--co-lb-ar",String(o/e)))},this.handleWheel=t=>{t.preventDefault();const[i,o]=this.stagePoint(t);this.zoomAt(this.scale*(t.deltaY<0?d:1/d),i,o)},this.handleDblClick=t=>{const[i,o]=this.stagePoint(t);this.zoomAt(this.scale>1?1:2.5,i,o)},this.handlePointerDown=t=>{var i;this.scale<=1||(t.preventDefault(),this.dragging=!0,this.dragStart={x:t.clientX,y:t.clientY,tx:this.tx,ty:this.ty},null===(i=this.imgEl)||void 0===i||i.setPointerCapture(t.pointerId))},this.handlePointerMove=t=>{if(!this.dragging)return;const i=this.dragStart.tx+(t.clientX-this.dragStart.x),o=this.dragStart.ty+(t.clientY-this.dragStart.y);[this.tx,this.ty]=this.clampPan(i,o,this.scale)},this.handlePointerUp=t=>{var i;this.dragging&&(this.dragging=!1,null===(i=this.imgEl)||void 0===i||i.releasePointerCapture(t.pointerId))},this.openOriginal=()=>{h(this.parsedImages[this.index])},this.stop=t=>t.stopPropagation()}get activeItem(){return this.parsedImages[this.index]}get isVideoSlide(){var t;return"video"===(null===(t=this.activeItem)||void 0===t?void 0:t.kind)}get parsedImages(){const t=this.images;if("string"!=typeof t||!t.trim())return[];if(t===this.lastImagesStr)return this.lastParsed;let i=[];try{const o=JSON.parse(t);Array.isArray(o)&&(i=o.filter((t=>t&&t.src)))}catch(t){}return this.lastImagesStr=t,this.lastParsed=i,i}componentWillLoad(){this.index=this.clampIndex(this.startIndex),this.pendingAutoplay=this.open}connectedCallback(){this.open&&this.attachKeyListener()}disconnectedCallback(){this.detachKeyListener(),this.pauseVideo(),clearTimeout(this.demoteTimer)}componentDidRender(){var t;this.pendingFocus&&(this.pendingFocus=!1,null===(t=this.closeBtnEl)||void 0===t||t.focus())}onOpenChange(t){var i,o,e;this.syncTopLayer(),t?(this.index=this.clampIndex(this.startIndex),this.resetView(),this.preloadNeighbors(),this.attachKeyListener(),this.pendingAutoplay=!0,this.tryAutoplay(),this.previouslyFocused=null!==(i=document.activeElement)&&void 0!==i?i:void 0,this.pendingFocus=!0):(this.detachKeyListener(),this.pauseVideo(),this.pendingAutoplay=!1,null===(e=null===(o=this.previouslyFocused)||void 0===o?void 0:o.focus)||void 0===e||e.call(o),this.previouslyFocused=void 0)}onStartIndexChange(t){this.open&&(this.index=this.clampIndex(t),this.resetView())}onImagesChange(){this.index=this.clampIndex(this.index)}attachKeyListener(){window.addEventListener("keydown",this.handleKey,{capture:!0})}detachKeyListener(){window.removeEventListener("keydown",this.handleKey,{capture:!0})}focusables(){var t,i;return Array.from(null!==(i=null===(t=this.el.shadowRoot)||void 0===t?void 0:t.querySelectorAll("button, co-video"))&&void 0!==i?i:[]).flatMap((t=>{var i,o;return"CO-VIDEO"===t.tagName?Array.from(null!==(o=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelectorAll('button:not([tabindex="-1"]), [tabindex="0"]'))&&void 0!==o?o:[]):[t]}))}deepActive(){var t,i,o;let e=null!==(i=null===(t=this.el.shadowRoot)||void 0===t?void 0:t.activeElement)&&void 0!==i?i:null;for(;null===(o=null==e?void 0:e.shadowRoot)||void 0===o?void 0:o.activeElement;)e=e.shadowRoot.activeElement;return e}escapeBelongsToPlayer(){var t,i;const o=document;return!(!o.fullscreenElement&&!o.webkitFullscreenElement&&!(null===(i=null===(t=this.playerEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector(".co-video__speed-menu")))}isFocusInPlayer(){var t;const i=this.playerEl;return!!i&&(null===(t=this.el.shadowRoot)||void 0===t?void 0:t.activeElement)===i}trapTab(t){const i=this.focusables();if(0===i.length)return;t.preventDefault(),t.stopPropagation();const o=t.shiftKey?-1:1,e=i.indexOf(this.deepActive());(e<0?i[o>0?0:i.length-1]:i[(e+o+i.length)%i.length]).focus()}clampIndex(t){const i=this.parsedImages.length;return 0===i?0:Math.min(Math.max(0,t),i-1)}resetView(){this.scale=1,this.tx=0,this.ty=0,this.dragging=!1}goTo(t){const i=this.parsedImages.length;i<2||(this.pauseVideo(),this.pendingAutoplay=!1,this.index=(this.index+t+i)%i,this.resetView(),this.coChange.emit(this.index),this.preloadNeighbors())}preloadNeighbors(){const t=this.parsedImages;if(!(t.length<2))for(const i of[1,-1]){const o=t[(this.index+i+t.length)%t.length];if(!o)continue;const e="video"===o.kind?o.poster:o.src;e&&((new Image).src=e)}}tryAutoplay(){var t;if(!this.pendingAutoplay||!this.open)return;if(!this.isVideoSlide)return void(this.pendingAutoplay=!1);const i=this.playerEl;i&&(this.pendingAutoplay=!1,Promise.resolve(null===(t=i.componentOnReady)||void 0===t?void 0:t.call(i)).then((()=>{var t;if(this.open&&this.playerEl===i&&this.isVideoSlide)return null===(t=i.play)||void 0===t?void 0:t.call(i)})).catch((()=>{})))}pauseVideo(){var t,i;try{const o=null===(i=null===(t=this.playerEl)||void 0===t?void 0:t.pause)||void 0===i?void 0:i.call(t);o&&"function"==typeof o.catch&&o.catch((()=>{}))}catch(t){}}clampPan(t,i,o){const e=this.stageEl,a=this.imgEl;if(!e||!a)return[t,i];const s=Math.max(0,(a.offsetWidth*o-e.clientWidth)/2),n=Math.max(0,(a.offsetHeight*o-e.clientHeight)/2);return[Math.min(Math.max(t,-s),s),Math.min(Math.max(i,-n),n)]}zoomAt(t,i,o){const e=this.scale,a=Math.min(Math.max(t,1),8);if(a===e)return;const s=a/e;let n=i-(i-this.tx)*s,r=o-(o-this.ty)*s;1===a?(n=0,r=0):[n,r]=this.clampPan(n,r,a),this.scale=a,this.tx=n,this.ty=r}stagePoint(t){var i;const o=null===(i=this.stageEl)||void 0===i?void 0:i.getBoundingClientRect();return o?[t.clientX-o.left-o.width/2,t.clientY-o.top-o.height/2]:[0,0]}render(){const t=c[s(this.locale)],i=this.parsedImages,o=i[this.index],e=i.length>1,n="video"===(null==o?void 0:o.kind),r=t.counter.replace("{i}",String(this.index+1)).replace("{n}",String(i.length));return a("div",{key:"189314e8e6be6a3b908d2c4387e0561162a1b96e",class:{"co-lightbox":!0,"co-lightbox--open":this.open},part:"overlay",role:"dialog","aria-modal":"true","aria-label":null==o?void 0:o.alt,popover:"manual",ref:this.syncTopLayer,onClick:this.requestClose},o&&a("div",{key:"ee52518418ac4e58cd9bcece7bc3391cb0e9742f",class:"co-lightbox__toolbar",part:"toolbar",onClick:this.stop},a("span",{key:"c9e214561c3d2b7b773f82888a9147aab7d120df",class:"co-lightbox__caption",title:o.alt},o.alt),!n&&a("div",{key:"911216d5873a1462303f1ed5b59c14d72b7328c4",class:"co-lightbox__zoom"},a("button",{key:"9344807bbac6aefc47824b866a4225206b859323",class:"co-lightbox__btn",type:"button","aria-label":t.zoomOut,title:t.zoomOut,onClick:()=>this.zoomAt(this.scale/d,0,0)},a("co-icon",{key:"736c42fc97c09d76cf0aa8e0763ba56eb1ecd394",name:"minus",size:16})),a("button",{key:"e115084b8e4941bd0f476b248c3cc88f096c55f2",class:"co-lightbox__btn co-lightbox__zoom-value",type:"button","aria-label":t.zoomReset,title:t.zoomReset,onClick:()=>this.resetView()},Math.round(100*this.scale),"%"),a("button",{key:"d5955ce9dcf15f0768a1f012a11acec012805811",class:"co-lightbox__btn",type:"button","aria-label":t.zoomIn,title:t.zoomIn,onClick:()=>this.zoomAt(this.scale*d,0,0)},a("co-icon",{key:"64126b83b5ee1a510e4787c17a77b5bfb65db721",name:"plus",size:16}))),a("button",{key:"1798ea6aba9c8ce425317258b076874134de4724",class:"co-lightbox__btn",type:"button","aria-label":t.openOriginal,title:t.openOriginal,onClick:this.openOriginal},a("co-icon",{key:"a4ef44fe626c33b1b0eb11d38afe034ca5a13a8f",name:"arrow-square-out",size:16})),a("button",{key:"c68fbb1498dcfe177d8255647c39b5db83a66f7c",class:"co-lightbox__btn",part:"close",type:"button","aria-label":t.close,title:t.close,ref:t=>this.closeBtnEl=t,onClick:this.requestClose},a("co-icon",{key:"b62c1dd5fa4fba5a57b4c804e31494e5da48f0af",name:"x",size:16}))),o&&a("div",{key:"80d34170f27f6a0177747e797e10646dcfca0bed",class:"co-lightbox__stage",ref:t=>this.stageEl=t,onWheel:n?void 0:this.handleWheel},n?a("co-video",{class:"co-lightbox__video",part:"video",key:`video-${this.index}`,ref:this.mountPlayer,src:o.src,poster:o.poster||"",aspectRatio:"auto",rounded:"none",controlsAutoHide:!1,showSpeed:!0,showPip:!0,locale:s(this.locale),onCoReady:this.handlePlayerReady,onClick:this.stop}):a("img",{class:{"co-lightbox__img":!0,"co-lightbox__img--zoomed":this.scale>1,"co-lightbox__img--dragging":this.dragging},part:"image",ref:t=>this.imgEl=t,src:o.src,alt:o.alt||"",draggable:!1,style:{transform:`translate(${this.tx}px, ${this.ty}px) scale(${this.scale})`},onClick:this.stop,onDblClick:this.handleDblClick,onPointerDown:this.handlePointerDown,onPointerMove:this.handlePointerMove,onPointerUp:this.handlePointerUp,onPointerCancel:this.handlePointerUp})),o&&e&&a("button",{key:"4ef78cd047f1e8b2efb669aefbee51b73e4c5c3b",class:"co-lightbox__nav co-lightbox__nav--prev",part:"prev",type:"button","aria-label":t.prevImage,title:t.prevImage,onClick:t=>{t.stopPropagation(),this.goTo(-1)}},a("co-icon",{key:"834bd12a0dead46df44e291197f5d3b79f619932",name:"caret-left",size:24})),o&&e&&a("button",{key:"0252acb36e360dedd1fe8ac8cba74ab5895476c1",class:"co-lightbox__nav co-lightbox__nav--next",part:"next",type:"button","aria-label":t.nextImage,title:t.nextImage,onClick:t=>{t.stopPropagation(),this.goTo(1)}},a("co-icon",{key:"53521495d2bd6ac11004cedd96fd7351135115a7",name:"caret-right",size:24})),o&&e&&a("div",{key:"fae75527e79964a30745accf565b33be3b466ba6",class:"co-lightbox__counter",part:"counter",onClick:this.stop},r))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}],startIndex:[{onStartIndexChange:0}],images:[{onImagesChange:0}]}}static get style(){return":host{display:contents;font-family:var(--co-font-family-primary)}.co-lightbox{position:fixed;inset:0;margin:0;border:0;padding:0;width:auto;height:auto;overflow:visible;color:inherit;z-index:1100;display:flex;align-items:center;justify-content:center;background:var(--co-color-opacity-negro-80);opacity:0;pointer-events:none;transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-lightbox--open{opacity:1;pointer-events:auto}.co-lightbox__toolbar{position:absolute;top:0;left:0;right:0;z-index:2;display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-md) var(--co-spacing-lg);background:linear-gradient(var(--co-color-opacity-negro-50), transparent)}.co-lightbox__caption{flex:1;min-width:0;color:var(--co-color-base-blanco);font-size:var(--co-font-size-14);line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-lightbox__zoom{display:flex;align-items:center;gap:var(--co-spacing-xxs);padding:0 var(--co-spacing-xs);border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8)}.co-lightbox__btn{display:flex;align-items:center;justify-content:center;min-width:32px;height:32px;padding:0 var(--co-spacing-xs);border:none;border-radius:var(--co-border-radius-full);background:transparent;color:var(--co-color-base-blanco);font-family:inherit;font-size:var(--co-font-size-13, 13px);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-lightbox__btn:hover{background:var(--co-color-opacity-blanco-16)}.co-lightbox__zoom-value{min-width:48px;font-variant-numeric:tabular-nums}.co-lightbox__stage{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none}.co-lightbox__img{max-width:calc(100vw - var(--co-spacing-5xl) * 2);max-height:calc(100vh - var(--co-spacing-5xl) * 2);border-radius:var(--co-border-radius-xs);user-select:none;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-lightbox__video{--co-lb-ar:1.7778;flex:0 0 auto;width:auto;aspect-ratio:var(--co-lb-ar);height:min( calc(100vh - var(--co-spacing-5xl) * 2), calc((100vw - var(--co-spacing-5xl) * 2) / var(--co-lb-ar)), calc(1200px / var(--co-lb-ar)) );border-radius:var(--co-border-radius-xs);overflow:hidden}.co-lightbox__img--zoomed{cursor:grab}.co-lightbox__img--dragging{cursor:grabbing;transition:none}.co-lightbox__nav{position:absolute;top:50%;transform:translateY(-50%);z-index:2;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:none;border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8);color:var(--co-color-base-blanco);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-lightbox__nav:hover{background:var(--co-color-opacity-blanco-25)}.co-lightbox__nav--prev{left:var(--co-spacing-lg)}.co-lightbox__nav--next{right:var(--co-spacing-lg)}.co-lightbox__counter{position:absolute;bottom:var(--co-spacing-lg);left:50%;transform:translateX(-50%);z-index:2;padding:var(--co-spacing-xs) var(--co-spacing-md);border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8);color:var(--co-color-base-blanco);font-size:var(--co-font-size-13, 13px);font-variant-numeric:tabular-nums}"}},[1,"co-lightbox",{images:[1],startIndex:[2,"start-index"],open:[1540],locale:[1],index:[32],scale:[32],tx:[32],ty:[32],dragging:[32]},void 0,{open:[{onOpenChange:0}],startIndex:[{onStartIndexChange:0}],images:[{onImagesChange:0}]}]);function u(){"undefined"!=typeof customElements&&["co-lightbox","co-icon","co-video"].forEach((i=>{switch(i){case"co-lightbox":customElements.get(t(i))||customElements.define(t(i),b);break;case"co-icon":customElements.get(t(i))||n();break;case"co-video":customElements.get(t(i))||r()}}))}u();export{b as C,u as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,p as n,H as e,c as o,h as i}from"./index.js";function s(t,n,e){return t!==e?null:n?"after-open":"after-close"}const r=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])','[tabindex]:not([tabindex="-1"])'].join(",");function a(t){if(t.shadowRoot)return Array.from(t.shadowRoot.children);if("SLOT"===t.tagName){const n=t.assignedElements({flatten:!0});return n.length?n:Array.from(t.children)}return Array.from(t.children)}function c(t){var n,e;if(!(null===(n=t.matches)||void 0===n?void 0:n.call(t,r))||t.hasAttribute("disabled"))return!1;const o=t.getAttribute("tabindex");return!(null!==o&&Number(o)<0||null===t.offsetParent&&0===t.getClientRects().length||!1===(null===(e=t.checkVisibility)||void 0===e?void 0:e.call(t,{visibilityProperty:!0})))}function h(t,n){const e=t=>{return"true"!==(o=t).getAttribute("aria-hidden")&&!o.hasAttribute("inert")&&(!!n(t)||a(t).some(e));var o};a(t).some(e)}function l(t,n){let e=null;return h(t,(t=>!!n(t)&&(e=t,!0))),e}function u(t){const n=[];return h(t,(t=>(c(t)&&n.push(t),!1))),n}function d(t,n){return t.length>0&&t[t.length-1]===n}let f=0,p="";const v=[];let y=0;const b="co-overlay--refront";function m(t){"function"==typeof requestAnimationFrame?requestAnimationFrame(t):t()}const g=n(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coClose=o(this,"coClose",7),this.coAfterClose=o(this,"coAfterClose",3),this.coAfterOpen=o(this,"coAfterOpen",3),this.open=!1,this.trapFocus=!1,this.closeOnEscape=!1,this.hasLock=!1,this.trapId="co-overlay-trap-"+ ++y,this.trapping=!1,this.pressDownTarget=null,this.pressUpTarget=null,this.handlePointerDown=t=>{var n;this.pressDownTarget=null!==(n=t.composedPath()[0])&&void 0!==n?n:null,this.pressUpTarget=null},this.handlePointerUp=t=>{var n;this.pressUpTarget=null!==(n=t.composedPath()[0])&&void 0!==n?n:null},this.handleClick=t=>{var n;const e=null!==(n=t.composedPath()[0])&&void 0!==n?n:null,o=e===this.overlayEl&&function(t,n,e){return null!==t&&t===n&&n===e}(this.pressDownTarget,this.pressUpTarget,e);this.pressDownTarget=null,this.pressUpTarget=null,o&&this.coClose.emit()},this.handleTransitionEnd=t=>{if(t.target!==this.overlayEl)return;const n=s(t.propertyName,this.open,"opacity");"after-open"===n?this.coAfterOpen.emit():"after-close"===n&&this.coAfterClose.emit()}}onOpenChange(t){t?this.acquireLock():this.releaseLock(),this.syncPopover(),this.syncTrap()}onTrapFocusChange(){this.syncTrap()}componentDidLoad(){this.open&&this.acquireLock(),this.syncPopover(),this.syncTrap()}disconnectedCallback(){this.releaseLock(),this.releaseTrap()}async bringToFront(){const t=this.overlayEl;if(!this.open||!t||"function"!=typeof t.showPopover)return;if(!t.matches(":popover-open"))return;const n=this.deepActiveElement();t.classList.add(b);try{t.hidePopover(),t.showPopover()}catch(t){}n&&n.isConnected&&this.deepActiveElement()!==n&&n.focus({preventScroll:!0}),m((()=>t.classList.remove(b)))}acquireLock(){this.hasLock||(this.hasLock=!0,"undefined"!=typeof document&&(0===f&&(p=document.body.style.overflow,document.body.style.overflow="hidden"),f++))}releaseLock(){this.hasLock&&(this.hasLock=!1,"undefined"!=typeof document&&0!==f&&(f--,0===f&&(document.body.style.overflow=p)))}syncPopover(){const t=this.overlayEl;if(t&&"function"==typeof t.showPopover)try{const n=t.matches(":popover-open");this.open&&!n?t.showPopover():!this.open&&n&&t.hidePopover()}catch(t){}}syncTrap(){this.open&&this.trapFocus?this.engageTrap():this.releaseTrap()}engageTrap(){this.trapping||(this.trapping=!0,v.push(this.trapId),this.captureAndFocus())}releaseTrap(){if(!this.trapping)return;this.trapping=!1;const t=v.indexOf(this.trapId);t>=0&&v.splice(t,1),this.restoreFocus()}captureAndFocus(){this.returnFocusEl=this.deepActiveElement(),m((()=>{var t;if(!this.open||!this.trapping||!d(v,this.trapId))return;const n=function(t){const n=l(t,(t=>t.hasAttribute("autofocus")));if(n){if(c(n))return n;const t=n.shadowRoot?u(n)[0]:void 0;if(t)return t}return l(t,c)}(this.el);n?n.focus():null===(t=this.overlayEl)||void 0===t||t.focus()}))}restoreFocus(){const t=this.returnFocusEl;this.returnFocusEl=null,t&&t.isConnected&&"function"==typeof t.focus&&t.focus({preventScroll:!0})}deepActiveElement(){if("undefined"==typeof document)return null;let t=document.activeElement;for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}handleKeydown(t){this.open&&(this.closeOnEscape&&"Escape"===t.key?this.coClose.emit():this.trapping&&"Tab"===t.key&&d(v,this.trapId)&&this.trapTab(t))}trapTab(t){var n;if(t.defaultPrevented)return;const e=u(this.el);if(0===e.length)return t.preventDefault(),void(null===(n=this.overlayEl)||void 0===n||n.focus());const o=e.indexOf(this.deepActiveElement()),i=function(t,n,e){return t<=0?-1:e?n<=0?t-1:n-1:-1===n||n>=t-1?0:n+1}(e.length,o,t.shiftKey);i<0||(t.preventDefault(),e[i].focus())}render(){return i("div",{key:"9d6cec0764074a33489f79fb4a554e7aa7374785",class:{"co-overlay":!0,"co-overlay--open":this.open},part:"overlay",popover:"manual",tabindex:this.trapFocus?-1:void 0,ref:t=>this.overlayEl=t,onPointerDown:this.handlePointerDown,onPointerUp:this.handlePointerUp,onClick:this.handleClick,onTransitionEnd:this.handleTransitionEnd},i("slot",{key:"2f8ad7b23e72ce2f5c74b3cb67ba9ab80e88cf26"}))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}],trapFocus:[{onTrapFocusChange:0}]}}static get style(){return":host{display:contents}.co-overlay{position:fixed;inset:0;z-index:1000;margin:0;border:0;padding:0;width:auto;height:auto;max-width:none;max-height:none;overflow:visible;color:inherit;display:flex;align-items:center;justify-content:center;background:var(--co-overlay-bg, rgba(0, 0, 0, 0.4));-webkit-backdrop-filter:blur(var(--co-overlay-blur, 2px));backdrop-filter:blur(var(--co-overlay-blur, 2px));opacity:0;pointer-events:none;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-in)}.co-overlay--open{opacity:1;pointer-events:auto;transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-overlay--refront{transition:none !important}"}},[257,"co-overlay",{open:[1540],trapFocus:[516,"trap-focus"],closeOnEscape:[516,"close-on-escape"],bringToFront:[64]},[[4,"keydown","handleKeydown"]],{open:[{onOpenChange:0}],trapFocus:[{onTrapFocusChange:0}]}]);function x(){"undefined"!=typeof customElements&&["co-overlay"].forEach((n=>{"co-overlay"===n&&(customElements.get(t(n))||customElements.define(t(n),g))}))}x();export{g as C,s as a,x as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as r,p as o,H as e,c as a,h as t}from"./index.js";import{d as s,a as c}from"./p-CX0bNXK3.js";import{i,p as d,r as n}from"./p-hXbDUT3I.js";import{s as l}from"./p-CBX_oabB.js";import{d as h}from"./p-qMNHMnvI.js";import{d as p}from"./p-BH184F0X.js";const w=o(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.coClose=a(this,"coClose",7),this.coOpen=a(this,"coOpen",7),this.coAfterOpen=a(this,"coAfterOpen",7),this.coAfterClose=a(this,"coAfterClose",7),this.open=!1,this.position="right",this.size="md",this.heading="",this.description="",this.icon="",this.closable=!0,this.closeOnOverlay=!0,this.closeOnEscape=!0,this.modeless=!1,this.loading=!1,this.hasFooter=!1,this.hasTabs=!1,this.hasHeaderSlot=!1,this.handleFooterSlotChange=r=>{this.hasFooter=l(r)},this.handleTabsSlotChange=r=>{this.hasTabs=l(r)},this.handleHeaderSlotChange=r=>{this.hasHeaderSlot=l(r)},this.handleOverlayClose=()=>{this.closeOnOverlay&&this.coClose.emit()},this.handleCloseClick=()=>{this.coClose.emit()},this.stopPropagation=r=>{r.stopPropagation()},this.handleTransitionEnd=r=>{if(r.target!==this.asideEl)return;const o=c(r.propertyName,this.open,"transform");"after-open"===o?this.coAfterOpen.emit():"after-close"===o&&this.coAfterClose.emit()},this.promoteModeless=r=>{r&&(this.asideEl=r);const o=this.asideEl;if(this.modeless&&o&&"function"==typeof o.showPopover)try{o.matches(":popover-open")||o.showPopover()}catch(r){}}}get labelledBy(){return this.hasHeaderSlot?"co-drawer-header-content":this.heading?"co-drawer-heading":void 0}onOpenChange(r,o){r?d(this):n(this),r&&!o&&this.coOpen.emit()}connectedCallback(){this.open&&d(this)}disconnectedCallback(){n(this)}handleKey(r){this.open&&this.closeOnEscape&&"Escape"===r.key&&(this.modeless&&document.querySelector("co-drawer[open]:not([modeless]), co-modal[open]")||i(this)&&this.coClose.emit())}componentDidLoad(){this.promoteModeless()}render(){const r=t("aside",{class:{"co-drawer":!0,"co-sq-elevation":!0,"co-sq-elevation-fallback":!0,"co-drawer--open":this.open,"co-drawer--modeless":this.modeless,[`co-drawer--${this.position}`]:!0,[`co-drawer--${this.size}`]:!0},popover:this.modeless?"manual":void 0,ref:this.promoteModeless,part:"drawer",role:"dialog","aria-modal":this.modeless?"false":"true","aria-labelledby":this.labelledBy,onClick:this.stopPropagation,onTransitionEnd:this.handleTransitionEnd},t("div",{class:"co-drawer__card co-sq-clip",part:"card"},t("header",{class:"co-drawer__header",part:"header"},t("div",{class:"co-drawer__header-content",id:"co-drawer-header-content"},t("slot",{name:"header",onSlotchange:this.handleHeaderSlotChange},t("div",{class:"co-drawer__heading-row"},this.icon&&t("co-icon",{name:this.icon,size:20,class:"co-drawer__icon"}),t("h2",{class:"co-drawer__heading",id:"co-drawer-heading"},this.heading)),this.description&&t("p",{class:"co-drawer__description"},this.description))),this.closable&&t("button",{class:"co-drawer__close",type:"button","aria-label":"Close",onClick:this.handleCloseClick},t("co-icon",{name:"x",size:20}))),t("div",{class:{"co-drawer__tabs":!0,"co-drawer__tabs--empty":!this.hasTabs},part:"tabs"},t("slot",{name:"tabs",onSlotchange:this.handleTabsSlotChange})),t("div",{class:"co-drawer__body",part:"body"},t("slot",null),t("co-loader",{overlay:!0,visible:this.loading,part:"loader"})),t("footer",{class:{"co-drawer__footer":!0,"co-drawer__footer--empty":!this.hasFooter},part:"footer"},t("slot",{name:"footer",onSlotchange:this.handleFooterSlotChange}))));return this.modeless?r:t("co-overlay",{open:this.open,onCoClose:this.handleOverlayClose},r)}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return'.co-sq-elevation{border-radius:var(--co-sq-r);corner-shape:squircle;box-shadow:var(--co-sq-shadow)}.co-sq-clip{overflow:hidden;border-radius:var(--co-sq-r);corner-shape:squircle}@supports not (corner-shape: squircle){.co-sq-elevation{box-shadow:none}.co-sq-elevation-fallback{filter:var(--co-sq-drop-shadow)}.co-sq-clip{border-radius:0;--co-sq-tl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 0L95 0L92.5 0L90 0L87.5 0.01L85 0.01L82.5 0.02L80 0.04L77.5 0.06L75 0.1L72.5 0.14L70 0.2L67.5 0.28L65 0.38L62.5 0.5L60 0.65L57.5 0.83L55 1.04L52.5 1.3L50 1.6L47.5 1.96L45 2.37L42.5 2.85L40 3.41L37.5 4.05L35 4.8L32.5 5.65L30 6.63L27.5 7.77L25 9.07L22.5 10.58L20 12.34L17.5 14.41L15 16.85L12.5 19.79L10 23.42L7.5 28.06L5 34.37L2.5 44.29L0 100L100 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-tr:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 0L5 0L7.5 0L10 0L12.5 0.01L15 0.01L17.5 0.02L20 0.04L22.5 0.06L25 0.1L27.5 0.14L30 0.2L32.5 0.28L35 0.38L37.5 0.5L40 0.65L42.5 0.83L45 1.04L47.5 1.3L50 1.6L52.5 1.96L55 2.37L57.5 2.85L60 3.41L62.5 4.05L65 4.8L67.5 5.65L70 6.63L72.5 7.77L75 9.07L77.5 10.58L80 12.34L82.5 14.41L85 16.85L87.5 19.79L90 23.42L92.5 28.06L95 34.37L97.5 44.29L100 100L0 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-bl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 55.71L5 65.63L7.5 71.94L10 76.58L12.5 80.21L15 83.15L17.5 85.59L20 87.66L22.5 89.42L25 90.93L27.5 92.23L30 93.37L32.5 94.35L35 95.2L37.5 95.95L40 96.59L42.5 97.15L45 97.63L47.5 98.04L50 98.4L52.5 98.7L55 98.96L57.5 99.17L60 99.35L62.5 99.5L65 99.62L67.5 99.72L70 99.8L72.5 99.86L75 99.9L77.5 99.94L80 99.96L82.5 99.98L85 99.99L87.5 99.99L90 100L92.5 100L95 100L97.5 100L100 100L100 0Z%27 fill=%27%23fff%27/></svg>");--co-sq-br:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 55.71L95 65.63L92.5 71.94L90 76.58L87.5 80.21L85 83.15L82.5 85.59L80 87.66L77.5 89.42L75 90.93L72.5 92.23L70 93.37L67.5 94.35L65 95.2L62.5 95.95L60 96.59L57.5 97.15L55 97.63L52.5 98.04L50 98.4L47.5 98.7L45 98.96L42.5 99.17L40 99.35L37.5 99.5L35 99.62L32.5 99.72L30 99.8L27.5 99.86L25 99.9L22.5 99.94L20 99.96L17.5 99.98L15 99.99L12.5 99.99L10 100L7.5 100L5 100L2.5 100L0 100L0 0Z%27 fill=%27%23fff%27/></svg>");-webkit-mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat;mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat}}:host{display:contents}.co-drawer{position:fixed;display:flex;flex-direction:column;font-family:var(--co-font-family-primary);color:inherit;transition:transform var(--co-motion-duration-slow) var(--co-motion-ease-in-out);will-change:transform;z-index:1;contain:layout;--co-drawer-r:var(--co-shell-r, var(--co-border-radius-md));--co-sq-r:var(--co-drawer-r);--co-sq-shadow:0 1px 4px rgba(31, 28, 27, 0.06), 0 10px 56px rgba(31, 28, 27, 0.12);--co-sq-drop-shadow:drop-shadow(0 1px 2px rgba(31, 28, 27, 0.06)) drop-shadow(0 10px 28px rgba(31, 28, 27, 0.12))}.co-drawer--right{top:0;right:0;margin:6px;height:100vh;height:-webkit-fill-available;transform:translateX(calc(100% + 12px))}.co-drawer--right.co-drawer--open{transform:translateX(0)}.co-drawer--left{top:0;left:0;margin:6px;height:100vh;height:-webkit-fill-available;transform:translateX(calc(-100% - 12px))}.co-drawer--left.co-drawer--open{transform:translateX(0)}.co-drawer--bottom{bottom:0;left:0;right:0;margin:6px;width:auto;transform:translateY(calc(100% + 12px))}.co-drawer--bottom.co-drawer--open{transform:translateY(0)}.co-drawer--right.co-drawer--sm,.co-drawer--left.co-drawer--sm{width:400px;max-width:100vw}.co-drawer--right.co-drawer--md,.co-drawer--left.co-drawer--md{width:520px;max-width:100vw}.co-drawer--right.co-drawer--lg,.co-drawer--left.co-drawer--lg{width:672px;max-width:100vw}.co-drawer--right.co-drawer--xl,.co-drawer--left.co-drawer--xl{width:960px;max-width:100vw}.co-drawer--right.co-drawer--full,.co-drawer--left.co-drawer--full{width:100vw}.co-drawer--bottom.co-drawer--sm{height:40vh}.co-drawer--bottom.co-drawer--md{height:60vh}.co-drawer--bottom.co-drawer--lg{height:80vh}.co-drawer--bottom.co-drawer--xl{height:95vh}.co-drawer--bottom.co-drawer--full{height:100vh}.co-drawer__card{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--co-semantic-surface-page);color:var(--co-semantic-text-default)}.co-drawer__header{display:flex;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-bottom:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__header-content{flex:1;min-width:0}.co-drawer__heading-row{display:flex;align-items:center;gap:var(--co-spacing-sm, 8px)}.co-drawer__icon{flex-shrink:0;color:var(--co-semantic-text-secondary)}.co-drawer__heading{margin:0;font-size:var(--co-font-size-18);font-weight:600;color:var(--co-semantic-text-default);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-drawer__description{margin:var(--co-spacing-xs) 0 0;font-size:var(--co-font-size-13, 13px);font-weight:400;color:var(--co-semantic-text-muted);line-height:1.4}.co-drawer__close{display:flex;align-items:center;justify-content:center;padding:var(--co-spacing-xs);margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);border-radius:var(--co-border-radius-sm);transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);flex-shrink:0}.co-drawer__close:hover{background:var(--co-semantic-surface-hover)}.co-drawer__close:focus-visible{outline:2px solid var(--co-color-primary-azul);outline-offset:2px}.co-drawer__tabs{flex-shrink:0;border-bottom:1px solid var(--co-semantic-border-default)}.co-drawer__tabs--empty{display:none}.co-drawer__body{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:var(--co-spacing-xl);position:relative}.co-drawer__body{scrollbar-width:thin;scrollbar-color:transparent transparent}.co-drawer__body:hover{scrollbar-color:var(--co-semantic-border-default) transparent}.co-drawer__body::-webkit-scrollbar{width:6px}.co-drawer__body::-webkit-scrollbar-track{background:transparent}.co-drawer__body::-webkit-scrollbar-thumb{background:transparent;border-radius:9999px}.co-drawer__body:hover::-webkit-scrollbar-thumb{background:var(--co-semantic-border-default)}.co-drawer__body:hover::-webkit-scrollbar-thumb:hover{background:var(--co-semantic-border-field)}.co-drawer__body:hover::-webkit-scrollbar-thumb:active{background:var(--co-semantic-border-strong)}.co-drawer__footer{display:flex;justify-content:flex-end;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-top:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__footer--empty{display:none}@media (max-width: 600px){.co-drawer--right,.co-drawer--left{width:100vw !important}}.co-drawer--modeless{z-index:1000;border:0;padding:0;background:transparent}.co-drawer--modeless.co-drawer--right{left:auto;bottom:auto}.co-drawer--modeless.co-drawer--left{right:auto;bottom:auto}.co-drawer--modeless.co-drawer--bottom{top:auto}'}},[257,"co-drawer",{open:[1540],position:[513],size:[513],heading:[1],description:[1],icon:[1],closable:[4],closeOnOverlay:[4,"close-on-overlay"],closeOnEscape:[4,"close-on-escape"],modeless:[516],loading:[4],hasFooter:[32],hasTabs:[32],hasHeaderSlot:[32]},[[4,"keydown","handleKey"]],{open:[{onOpenChange:0}]}]);function L(){"undefined"!=typeof customElements&&["co-drawer","co-icon","co-loader","co-overlay"].forEach((o=>{switch(o){case"co-drawer":customElements.get(r(o))||customElements.define(r(o),w);break;case"co-icon":customElements.get(r(o))||h();break;case"co-loader":customElements.get(r(o))||p();break;case"co-overlay":customElements.get(r(o))||s()}}))}L();export{w as C,L as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,p as i,H as s,c as o,h as e}from"./index.js";import{i as h,c as n,g as r,f as a}from"./p-BtliEQAT.js";const c=[];function p(t){const i=c.indexOf(t);-1!==i&&c.splice(i,1)}function l(t){return c.length>0&&c[c.length-1]===t}const d=["top","bottom","left","right"].map((t=>`co-popover__panel--${t}`)),f=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coOpen=o(this,"coOpen",3),this.coClose=o(this,"coClose",3),this.coPlacement=o(this,"coPlacement",3),this.open=!1,this.placement="bottom-start",this.matchWidth=!1,this.offset=4,this.closeOnClickOutside=!0,this.closeOnEscape=!0,this.flip=!0,this.bare=!1,this.shift=0,this.closing=!1,this.anchorSeenVisible=!1,this.keepSide=!1,this.scrollParents=[],this.cachedOffsetAncestor=null,this.offsetAncestorComputed=!1,this.docListenersBound=!1,this.finishClose=()=>{clearTimeout(this.closeFallbackTimer),this.open||(this.closing=!1,this.panelEl=void 0)},this.handlePanelTransitionEnd=t=>{!this.open&&this.closing&&t.target===this.panelEl&&"transform"===t.propertyName&&this.finishClose()},this.pressStartedInside=!1,this.handleDocumentPointerDownManual=t=>{this.pressStartedInside=t.composedPath().includes(this.el)},this.handleDocumentClickManual=t=>{const i=this.pressStartedInside;this.pressStartedInside=!1,this.open&&this.closeOnClickOutside&&(i||l(this.el)&&(t.composedPath().includes(this.el)||(this.open=!1)))},this.handleDocumentKeydownManual=t=>{this.open&&this.closeOnEscape&&l(this.el)&&"Escape"===t.key&&(t.stopPropagation(),this.open=!1)},this.updatePosition=()=>{if(!this.open||!this.triggerEl||!this.panelEl)return;const t=this.triggerEl.getBoundingClientRect(),i=this.scrollParents.map((t=>t.getBoundingClientRect()));if(h(t,i))this.anchorSeenVisible=!0;else if(this.anchorSeenVisible&&this.closeOnClickOutside)return void(this.open=!1);const s=DOMRect.fromRect({width:this.panelEl.offsetWidth,height:this.panelEl.offsetHeight}),o=this.resolveAnchor(),e=null==o?void 0:o.getBoundingClientRect(),a=this.keepSide&&this.lastPlacement?this.lastPlacement:this.placement;this.keepSide=!1,this.observePanel();const{top:c,left:p,actualPlacement:l}=n(t,s,{placement:a,offset:this.offset,flip:this.flip,anchorRect:e,shift:this.shift});this.lastPlacement=l;let f=c,m=p;if(!this.panelEl.matches(":popover-open")&&(this.offsetAncestorComputed||(this.cachedOffsetAncestor=r(this.panelEl),this.offsetAncestorComputed=!0),this.cachedOffsetAncestor)){const t=this.cachedOffsetAncestor.getBoundingClientRect();f-=t.top,m-=t.left}const v={top:`${f}px`,left:`${m}px`};if(this.matchWidth&&(v.width=`${(null!=e?e:t).width}px`),this.panelEl){Object.assign(this.panelEl.style,v);const t=`co-popover__panel--${l.split("-")[0]}`;this.panelEl.classList.contains(t)||(this.panelEl.classList.remove(...d),this.panelEl.classList.add(t),this.coPlacement.emit({placement:l})),this.panelEl.classList.add("co-popover__panel--positioned")}},this.handlePanelResize=()=>{this.open&&(this.keepSide=!0,this.scheduleUpdate())},this.scheduleUpdate=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(this.updatePosition)},this.handleTriggerClick=()=>{this.open=!this.open}}componentDidLoad(){this.open&&this.onOpenChange(!0)}disconnectedCallback(){p(this.el),this.unbindDocListeners(),this.cleanupListeners(),clearTimeout(this.closeFallbackTimer),this.closing=!1}onOpenChange(t){var i;this.anchorSeenVisible=!1,t?(this.closing=!1,clearTimeout(this.closeFallbackTimer),p(i=this.el),c.push(i),this.coOpen.emit(),this.bindDocListeners(),this.scheduleUpdate(),requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.updatePosition()}))})),this.addScrollListeners()):(p(this.el),this.coClose.emit(),this.cleanupListeners(),this.unbindDocListeners(),this.cachedOffsetAncestor=null,this.offsetAncestorComputed=!1,this.closing=!0,clearTimeout(this.closeFallbackTimer),this.closeFallbackTimer=setTimeout((()=>this.finishClose()),400))}bindDocListeners(){this.docListenersBound||(document.addEventListener("pointerdown",this.handleDocumentPointerDownManual,!0),document.addEventListener("click",this.handleDocumentClickManual,!0),document.addEventListener("keydown",this.handleDocumentKeydownManual,!0),this.docListenersBound=!0)}unbindDocListeners(){this.docListenersBound&&(document.removeEventListener("pointerdown",this.handleDocumentPointerDownManual,!0),document.removeEventListener("click",this.handleDocumentClickManual,!0),document.removeEventListener("keydown",this.handleDocumentKeydownManual,!0),this.docListenersBound=!1,this.pressStartedInside=!1)}async toggle(){this.open=!this.open}async show(){this.open=!0}async hide(){this.open=!1}resolveAnchor(){return this.anchor?"string"==typeof this.anchor?document.querySelector(this.anchor):this.anchor:null}promotePanel(){const t=this.panelEl;if(t&&"function"==typeof t.showPopover)try{t.matches(":popover-open")||t.showPopover()}catch(t){}}observePanel(){var t;"undefined"!=typeof ResizeObserver&&this.panelEl&&this.observedPanel!==this.panelEl&&(null!==(t=this.resizeObserver)&&void 0!==t||(this.resizeObserver=new ResizeObserver(this.handlePanelResize)),this.observedPanel&&this.resizeObserver.unobserve(this.observedPanel),this.observedPanel=this.panelEl,this.resizeObserver.observe(this.panelEl))}addScrollListeners(){window.addEventListener("resize",this.scheduleUpdate,{passive:!0}),window.addEventListener("scroll",this.scheduleUpdate,{passive:!0,capture:!0}),this.scrollParents=a(this.el);for(const t of this.scrollParents)t.addEventListener("scroll",this.scheduleUpdate,{passive:!0})}cleanupListeners(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.observedPanel=void 0,this.lastPlacement=void 0,this.keepSide=!1,this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0),window.removeEventListener("resize",this.scheduleUpdate),window.removeEventListener("scroll",this.scheduleUpdate,{capture:!0});for(const t of this.scrollParents)t.removeEventListener("scroll",this.scheduleUpdate);this.scrollParents=[]}render(){return e("div",{key:"a85df32be71c08c86bd19a31224b51b899d1f468",class:"co-popover"},e("div",{key:"accafae8513bad7bfbf32b7e98f0dc6ec0968efa",class:"co-popover__trigger",ref:t=>this.triggerEl=t,onClick:this.handleTriggerClick},e("slot",{key:"f12247af31066f6d4cbdd45671146b3ea5c996bc",name:"trigger"})),(this.open||this.closing)&&e("div",{key:"64dbc77cae4a913bbe3ec4174f6b18c4982520ae",class:{"co-popover__panel":!0,"co-popover__panel--closing":this.closing},part:"panel",popover:"manual",onTransitionEnd:this.handlePanelTransitionEnd,ref:t=>{t&&t!==this.panelEl&&(this.panelEl=t,this.promotePanel(),this.scheduleUpdate())}},e("slot",{key:"858df49b45b1bd72f215f5e408e835227633d41f"})))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return":host{display:inline-block;position:relative}:host([match-width]){display:block;width:100%}.co-popover{display:block;width:100%}.co-popover__trigger{display:block;width:100%;cursor:pointer}.co-popover__panel{position:fixed;inset:auto;top:0;left:0;margin:0;padding:0;width:auto;height:auto;max-width:none;max-height:none;z-index:10000;visibility:hidden;opacity:0;transform:scale(0.97);background:var(--co-semantic-surface-page, #fff);color:var(--co-semantic-text-default);border:1px solid var(--co-popover-border-color, var(--co-semantic-border-subtle));border-radius:var(--co-border-radius-sm, 12px);box-shadow:var(--co-popover-shadow, 0 4px 16px rgba(31, 28, 27, 0.08));overflow:visible}:host([bare]) .co-popover__panel{background:transparent;border:0;box-shadow:none}.co-popover__panel--positioned{visibility:visible;opacity:1;transform:scale(1);transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out), transform var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-popover__panel--closing{visibility:visible;opacity:0;transform:scale(0.99);pointer-events:none;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-in), transform var(--co-motion-duration-fast) var(--co-motion-ease-in)}.co-popover__panel--bottom{transform-origin:top center}.co-popover__panel--top{transform-origin:bottom center}.co-popover__panel--right{transform-origin:center left}.co-popover__panel--left{transform-origin:center right}"}},[257,"co-popover",{open:[1540],placement:[1],matchWidth:[516,"match-width"],offset:[2],closeOnClickOutside:[4,"close-on-click-outside"],closeOnEscape:[4,"close-on-escape"],flip:[4],bare:[516],anchor:[1],shift:[2],closing:[32],toggle:[64],show:[64],hide:[64]},void 0,{open:[{onOpenChange:0}]}]);function m(){"undefined"!=typeof customElements&&["co-popover"].forEach((i=>{"co-popover"===i&&(customElements.get(t(i))||customElements.define(t(i),f))}))}m();export{f as C,m as d}
|