@mateosuarezdev/react-ui 1.0.54 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -11
- package/dist/index.d.ts +43 -0
- package/dist/index.js +1350 -1288
- package/package.json +6 -1
package/dist/index.cjs
CHANGED
|
@@ -8,20 +8,12 @@
|
|
|
8
8
|
* See LICENSE file for full terms.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),f=require("react"),hr=require("react-dom"),mn=require("clsx"),hn=require("tailwind-merge"),bn=require("@mateosuarezdev/atoms"),A=require("lucide-react"),L=require("framer-motion"),de=require("@mateosuarezdev/react-router"),J=require("react-hook-form"),Ge=require("@hookform/resolvers"),br=require("@mateosuarezdev/gestures"),k=(...e)=>hn.twMerge(mn.clsx(e));function Fe(e,t=100){let r=null,n=null;return function(...s){const a=Date.now();r===null||a-r>=t?(e.apply(this,s),r=a):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(this,s),r=Date.now()},t-(a-r)))}}function pn(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n),r=null},t)}}function pr(e){if(!e)return"";const r=e.trim().replace(/\s+/g," ").split(" ");return r.length===0||r[0]===""?"":r.length===1?r[0].charAt(0).toUpperCase():(r[0].charAt(0)+r[1].charAt(0)).toUpperCase()}function gr(e){e.focus();const t=e.value.length;e.setSelectionRange(t,t)}function vr(e){return e.replace(/\s/g,"")}function gn(e){return e.toLowerCase().split(" ").map(s=>{if(s.length===0)return s;const a=[...s][0],o=s.slice(a.length);return a.toUpperCase()+o}).join(" ")}function Pt(e){return e===null?"":e}function rt(e){return vr(e)===""?null:e}function vn(e,t,r={}){const n={...r};return Object.keys(t).forEach(s=>{if(t[s]===!0&&s in e){const a=s;n[a]=e[a]}}),n}class xn{constructor(){this.container=null,this.previouslyFocusedElement=null}enable(){this.container&&(this.previouslyFocusedElement=document.activeElement,this.container.addEventListener("keydown",this.trapFocus.bind(this)),document.addEventListener("click",this.handleClickOutside.bind(this)))}disable(){this.container&&(this.container.removeEventListener("keydown",this.trapFocus.bind(this)),document.removeEventListener("click",this.handleClickOutside.bind(this)),this.previouslyFocusedElement&&this.previouslyFocusedElement.focus&&this.previouslyFocusedElement.focus())}setContainer(t){this.disable(),this.container=t,this.enable()}trapFocus(t){const r=this.container?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!r)return;const n=r[0],s=r[r.length-1];t.key==="Tab"&&(t.shiftKey&&document.activeElement===n?(t.preventDefault(),s.focus()):!t.shiftKey&&document.activeElement===s&&(t.preventDefault(),n.focus()))}handleClickOutside(t){this.container&&!this.container.contains(t.target)&&(t.preventDefault(),this.previouslyFocusedElement&&this.previouslyFocusedElement.focus&&this.previouslyFocusedElement.focus())}}const Ye=e=>{const t=e.scrollWidth>e.clientWidth,r=e.scrollHeight>e.clientHeight,n=Math.max(0,e.scrollWidth-e.clientWidth),s=Math.max(0,e.scrollHeight-e.clientHeight);return{horizontal:t,vertical:r,scrollWidth:e.scrollWidth,clientWidth:e.clientWidth,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,canScrollLeft:e.scrollLeft>10,canScrollRight:e.scrollLeft<n-10,canScrollUp:e.scrollTop>0,canScrollDown:e.scrollTop<s,scrollPercentageX:t&&n>0?e.scrollLeft/n*100:0,scrollPercentageY:r&&s>0?e.scrollTop/s*100:0}},xr=({onOverflow:e,trackScroll:t=!1,withObserver:r=!1,enabled:n=!0,deps:s=[]}={})=>{const a=f.useRef(null);return f.useEffect(()=>{if(!a.current||!n)return;let o=!1;const u=Fe(()=>{if(a.current){const h=Ye(a.current);e?.(h)}}),l=Ye(a.current);o=l.horizontal||l.vertical,e?.(l),window.addEventListener("resize",u);let d=null;r&&(d=new ResizeObserver(u),a.current&&d.observe(a.current));let m=null;return t&&o&&(m=a.current,m.addEventListener("scroll",u)),()=>{window.removeEventListener("resize",u),d&&d.disconnect(),m&&o&&m.removeEventListener("scroll",u)}},[n,...s]),{ref:a}},wn=({trackScroll:e=!1,withObserver:t=!1,enabled:r=!0,deps:n=[]}={})=>{const s=f.useRef(null),[a,o]=f.useState(null);return f.useEffect(()=>{if(!s.current||!r)return;let i=!1;const l=Fe(()=>{if(s.current){const p=Ye(s.current);o(p)}}),d=Ye(s.current);i=d.horizontal||d.vertical,o(d),window.addEventListener("resize",l);let m=null;t&&(m=new ResizeObserver(l),s.current&&m.observe(s.current));let h=null;return e&&i&&(h=s.current,h.addEventListener("scroll",l)),()=>{window.removeEventListener("resize",l),m&&m.disconnect(),h&&i&&h.removeEventListener("scroll",l)}},[r,...n]),{ref:s,overflowInfo:a}},xt={xs:"w-8 h-8",sm:"w-10 h-10 text-lg",md:"w-14 h-14 text-xl",lg:"h-20 w-20 text-2xl",xl:"h-24 w-24 text-2xl"},yn=({src:e,name:t,size:r="md",className:n})=>e?c.jsx("img",{alt:"avatar",src:e,className:k("rounded-full bg-base-3",xt[r])}):t?c.jsx("p",{className:k("rounded-full font-medium dark-theme:bg-base-3 border border-base-6 dark-theme:border-base-4 flex items-center justify-center",xt[r],n),children:pr(t)}):c.jsx("div",{className:k("rounded-full text-2xl font-medium flex items-center justify-center","bg-base-2 dark-theme:bg-base-3 border border-base-4","lg:hover:bg-base-3 max-lg:active:bg-base-4 transition-colors",xt[r],n),children:c.jsxs(Vr,{size:r==="xs"?16:r==="sm"?20:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),c.jsx("circle",{cx:"12",cy:"7",r:"4"})]})});function kn({className:e,children:t,animate:r=!1,...n}){return c.jsx("div",{className:k("flex -space-x-3 rtl:space-x-reverse",e),...n,children:t})}function Nn(e){const t=f.useRef(null);return f.useEffect(()=>{const r=n=>{t.current&&!t.current.contains(n.target)&&e()};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[e]),t}function En(e,t={}){const{enabled:r=!0,events:n=["mousedown","touchstart"],excludeRefs:s=[]}=t,a=f.useRef(null);return f.useEffect(()=>{if(!r)return;const o=i=>{const u=i.target;a.current?.contains(u)||s.some(d=>d.current?.contains(u))||e()};return n.forEach(i=>{document.addEventListener(i,o)}),()=>{n.forEach(i=>{document.removeEventListener(i,o)})}},[e,r,n,s]),a}function dt(e,t,r=!0){f.useEffect(()=>{if(!r)return;const n=s=>{e.current&&!e.current.contains(s.target)&&t(s)};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[e,t,r])}function wr(e,{target:t=window,event:r="keydown",enabled:n}={}){const s=f.useRef(e);f.useEffect(()=>{s.current=e},[e]),f.useEffect(()=>{if(!n)return;const a=o=>{const i=o.key,u=s.current[i];u&&u(o)};return t.addEventListener(r,a),()=>{t.removeEventListener(r,a)}},[t,r,n])}function Cn(e){return f.useSyncExternalStore(t=>e.subscribe(t),()=>e.get(),()=>e.get())}const Et=bn.atom(typeof window<"u"?window.innerWidth>1024:!0);let wt=!1;const Kt=Fe(()=>{Et.set(window.innerWidth>1024)});typeof window<"u"&&(wt&&(window.removeEventListener("resize",Kt),wt=!1),window.addEventListener("resize",Kt),wt=!0);const qe=()=>(f.useLayoutEffect(()=>{Et.set(window.innerWidth>1024)},[]),Cn(Et));function jn({onLongPress:e,onTap:t,threshold:r=500,startDelay:n=200,moveThreshold:s=10}={}){const a=f.useRef(null),o=f.useRef(void 0),i=f.useRef({x:0,y:0}),u=f.useRef(!1),l=f.useRef(!1),d=f.useRef(!1);return f.useEffect(()=>{const m=a.current;if(!m)return;function h(j,S,M,w){const N=j-M,O=S-w;return Math.sqrt(N*N+O*O)}function p(j){if(j.touches.length!==1)return;const S=j.touches[0];i.current={x:S.clientX,y:S.clientY},u.current=!1,l.current=!0,setTimeout(()=>{l.current&&(o.current=setTimeout(()=>{l.current&&(u.current=!0,e?.(j))},r))},n)}function b(j){if(j.touches.length!==1)return;const S=j.touches[0];h(S.clientX,S.clientY,i.current.x,i.current.y)>s&&(l.current=!1,clearTimeout(o.current))}function v(j){clearTimeout(o.current),!u.current&&l.current&&t?.(j),l.current=!1}function x(j){j.button===0&&(d.current=!0)}function E(j){j.button!==0||!d.current||(d.current=!1,t?.(j))}function $(j){j.preventDefault()}return m.addEventListener("touchstart",p),m.addEventListener("touchmove",b),m.addEventListener("touchend",v),m.addEventListener("mousedown",x),m.addEventListener("mouseup",E),m.addEventListener("contextmenu",$),()=>{clearTimeout(o.current),m.removeEventListener("touchstart",p),m.removeEventListener("touchmove",b),m.removeEventListener("touchend",v),m.removeEventListener("mousedown",x),m.removeEventListener("mouseup",E),m.removeEventListener("contextmenu",$)}},[e,t,r,n,s]),a}function Ot(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}const $n=()=>{const[e,t]=f.useState(navigator.onLine);return f.useEffect(()=>{const r=()=>t(!0),n=()=>t(!1),s=new AbortController;return window.addEventListener("online",r,{signal:s.signal}),window.addEventListener("offline",n,{signal:s.signal}),()=>s.abort()},[]),e},ft=({scrollerId:e,align:t="start",side:r="bottom",offset:n=8,collisionPadding:s=8,avoidCollisions:a=!0,closeOnScroll:o=!0,onOpen:i,onClose:u}={})=>{const[l,d]=f.useState(!1),[m,h]=f.useState({width:192,height:300}),p=f.useRef(null),b=f.useRef(null),v=f.useRef({left:0,right:0,top:0,bottom:0,x:0,y:0,width:0,height:0}),x=f.useRef(null),E=f.useId(),$=f.useCallback(w=>{const N=w??v.current;if(!N)return{x:0,top:0,bottom:void 0};const O=m.width,W=m.height;return yr({triggerRect:N,popoverWidth:O,popoverHeight:W,align:t,side:r,offset:n,collisionPadding:s,avoidCollisions:a})},[v.current,m,t,r]);f.useEffect(()=>{if(!l||!e||(x.current=document.getElementById(e),!x.current))return;l&&j();const w=()=>{x.current&&(d(!1),i?.(),x.current.removeEventListener("scroll",w))};return o&&x.current.addEventListener("scroll",w,{passive:!0}),()=>{x.current&&x.current.removeEventListener("scroll",w)}},[l,e]);const j=()=>{b.current&&h({width:b.current.offsetWidth,height:b.current.offsetHeight})},S=f.useCallback(()=>{if(!p.current)return;const w=p.current.getBoundingClientRect();v.current={left:w.left,right:w.right,top:w.top,bottom:w.bottom,x:w.x,y:w.y,width:w.width,height:w.height},d(N=>(N?u?.():i?.(),!N))},[]),M=f.useCallback(()=>{d(!1),u?.()},[]);return{triggerRef:p,triggerProps:{id:E,"aria-expanded":l,"aria-haspopup":!0},popoverRef:b,getPopoverPosition:$,open:l,toggle:S,close:M}},yr=({triggerRect:e,popoverWidth:t,popoverHeight:r,align:n="start",side:s="bottom",offset:a=4,collisionPadding:o=8,avoidCollisions:i=!0})=>{const u={width:window.innerWidth,height:window.innerHeight};let l=0,d=0;if(i){if(s==="right"){const p=e.right+a,b=e.left-t-a,v=Math.max(0,p+t-(u.width-o)),x=Math.max(0,o-b);v<=x?(l=p,v>0&&(l=u.width-t-o)):(l=b,x>0&&(l=o)),d=e.top,d+r>u.height-o&&(d=u.height-r-o),d<o&&(d=o)}else if(s==="left"){const p=e.left-t-a,b=e.right+a,v=Math.max(0,o-p),x=Math.max(0,b+t-(u.width-o));v<=x?(l=p,v>0&&(l=o)):(l=b,x>0&&(l=u.width-t-o)),d=e.top,d+r>u.height-o&&(d=u.height-r-o),d<o&&(d=o)}else if(s==="bottom"){const p=u.height-e.bottom,b=e.top;p>=r+a?d=e.bottom+a:b>=r+a?d=e.top-r-a:(d=e.bottom+a,d=Math.min(d,u.height-r-o));const v=u.width-e.left,x=e.right;if(n==="start")l=e.left,l+t>u.width-o&&(x>=t?l=e.right-t:l=u.width-t-o);else if(n==="end")l=e.right-t,l<o&&(v>=t?l=e.left:l=o);else{const E=e.left+e.width/2-t/2;E>=o&&E+t<=u.width-o?l=E:E<o?l=o:l=u.width-t-o}}else{const p=e.top,b=u.height-e.bottom;p>=r+a?d=e.top-r-a:b>=r+a?d=e.bottom+a:(d=e.top-r-a,d=Math.max(o,d));const v=u.width-e.left,x=e.right;if(n==="start")l=e.left,l+t>u.width-o&&(x>=t?l=e.right-t:l=u.width-t-o);else if(n==="end")l=e.right-t,l<o&&(v>=t?l=e.left:l=o);else{const E=e.left+e.width/2-t/2;E>=o&&E+t<=u.width-o?l=E:E<o?l=o:l=u.width-t-o}}l=Math.max(o,Math.min(l,u.width-t-o)),d=Math.max(o,Math.min(d,u.height-r-o))}else s==="right"?(l=e.right+a,d=e.top):s==="left"?(l=e.left-t-a,d=e.top):s==="bottom"?d=e.bottom+a:d=e.top-r-a,(s==="top"||s==="bottom")&&(n==="start"?l=e.left:n==="end"?l=e.right-t:l=e.left+e.width/2-t/2);let m,h;return d+r<=e.top?h=window.innerHeight-(d+r):m=d,{x:l,top:m,bottom:h}},kr=(e=!0,t)=>{const r=qe(),n=f.useRef(null),s=f.useCallback(a=>{if(!e||r)return;const o=n.current;if(!o)return;const i=o.getBoundingClientRect(),u=Math.max(i.width,i.height),l=a.clientX-i.left-u/2,d=a.clientY-i.top-u/2,m=document.createElement("span");m.classList.add("ripple-wrapper");const h=document.createElement("span");h.classList.add("ripple"),h.style.backgroundColor=t?"var(--ripple-contrast)":"var(--ripple-main)",h.style.width=`${u}px`,h.style.height=`${u}px`,h.style.left=`${l}px`,h.style.top=`${d}px`,m.appendChild(h);const p=o.getElementsByClassName("ripple-wrapper");if(p?.length)for(const b of p)b.remove();o.appendChild(m),setTimeout(()=>{m.remove()},700)},[e,r,t]);return{ref:n,ripple:s,styles:{position:"relative"}}},Sn="relative shrink-0 select-none transition outline-none duration-200 ease-out focus-visible:ring-border-brand-light flex items-center justify-center cursor-pointer",Tn={xs:"text-xs px-1 gap-x-1 py-1",sm:"text-sm px-2.5 gap-x-1 py-1.5",mdsm:"text-sm px-3 gap-x-1.5 py-2.5",md:"text-base px-4 gap-x-1.5 py-2.5",lg:"text-base px-4 gap-x-1.5 py-3.5",picker:"text-base px-2 py-2 gap-x-1.5",iconXs:"text-xs p-1",iconSm:"text-sm p-2",iconMd:"text-base p-3",iconLg:"text-base p-4"},Mn={all:"focus-visible:ring-1",desktop:"lg:focus-visible:ring-1",mobile:"focus-visible:ring-1 lg:focus-ring-0",none:""},Dn={light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},Pn={none:"rounded-none",1:"rounded-1",2:"rounded-2",3:"rounded-3",4:"rounded-4",5:"rounded-5",6:"rounded-6",7:"rounded-7",8:"rounded-8",9:"rounded-9",10:"rounded-10",11:"rounded-11",12:"rounded-12",full:"rounded-full"},On={transparent:"text-base-12 lg:hover:bg-base-4 focus-visible:ring-base-6",transparentinactive:"text-base-11 lg:hover:bg-base-4",brand:"bg-brand text-brand-text lg:hover:bg-brand-hover focus-visible:ring-base-6 border border-transparent",accent:"bg-accent text-accent-text lg:hover:bg-accent-hover",contrast:"bg-base-12 text-base-1 lg:hover:bg-base-11 focus-visible:ring-base-6",solid:"bg-base-3 dark-theme:bg-base-3 lg:hover:bg-base-4 border border-base-4 focus-visible:ring-base-5",solidhybrid:"border border-base-5 dark-theme:border-base-4 dark-theme:bg-base-3 lg:hover:bg-base-4 focus-visible:ring-base-6",outline:"border border-base-6 lg:hover:bg-base-3 focus-visible:ring-base-6",info:"bg-blue-3 text-blue-9 lg:hover:bg-blue-4 lg:active:bg-blue-5 focus-visible:ring-blue-9 border border-transparent",success:"bg-green-4 text-green-9 lg:hover:bg-green-5 lg:active:bg-green-6 focus-visible:ring-green-9 border border-transparent",warning:"bg-yellow-4 text-yellow-9 lg:hover:bg-yellow-5 lg:active:bg-yellow-6 focus-visible:ring-yellow-9 border border-transparent",danger:"bg-red-4 text-red-9 lg:hover:bg-red-5 focus-visible:ring-red-9 border border-transparent",dangersolid:"bg-red-9 text-base-1 dark-theme:text-base-12 lg:hover:bg-red-8 focus-visible:ring-base-6 border border-transparent",disabled:"bg-base-3 text-base-11 border border-transparent"},Ln={enabled:"",disabled:"opacity-75",loading:""},q=f.forwardRef(({color:e="transparent",size:t="mdsm",fontWeight:r="normal",rounded:n="6",state:s="enabled",onClick:a,className:o,children:i,withRipple:u=!0,contrastRipple:l,showFocus:d="desktop",withDisabledDelay:m=!1,type:h="button",...p},b)=>{const[v,x]=f.useState(!1),E=M=>{s==="enabled"&&(m?(x(!0),a&&a(M),setTimeout(()=>x(!1),1e3)):a&&a(M))},{ref:$,ripple:j}=kr(u,e==="contrast"||l),S=Ot($,b);return c.jsx("button",{ref:S,type:h,disabled:p.disabled?p.disabled:s==="disabled"||s==="loading",onMouseDown:j,onClick:M=>v?null:E(M),className:k(Sn,Tn[t],Dn[r],Pn[n],Mn[d],On[e],Ln[s],p.disabled&&"opacity-50",o),...p,children:i})});q.displayName="Button";const Nr=6048e5,Fn=864e5,Ut=Symbol.for("constructDateFrom");function se(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ut in e?e[Ut](t):e instanceof Date?new e.constructor(t):new Date(t)}function Z(e,t){return se(t||e,e)}function et(e,t,r){const n=Z(e,r?.in);if(isNaN(t))return se(e,NaN);if(!t)return n;const s=n.getDate(),a=se(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);const o=a.getDate();return s>=o?a:(n.setFullYear(a.getFullYear(),a.getMonth(),s),n)}let Rn={};function mt(){return Rn}function Ie(e,t){const r=mt(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Z(e,t?.in),a=s.getDay(),o=(a<n?7:0)+a-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function nt(e,t){return Ie(e,{...t,weekStartsOn:1})}function Er(e,t){const r=Z(e,t?.in),n=r.getFullYear(),s=se(r,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const a=nt(s),o=se(r,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const i=nt(o);return r.getTime()>=a.getTime()?n+1:r.getTime()>=i.getTime()?n:n-1}function Gt(e){const t=Z(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function ht(e,...t){const r=se.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function st(e,t){const r=Z(e,t?.in);return r.setHours(0,0,0,0),r}function An(e,t,r){const[n,s]=ht(r?.in,e,t),a=st(n),o=st(s),i=+a-Gt(a),u=+o-Gt(o);return Math.round((i-u)/Fn)}function Wn(e,t){const r=Er(e,t),n=se(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),nt(n)}function yt(e,t,r){const[n,s]=ht(r?.in,e,t);return+st(n)==+st(s)}function _n(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Yn(e){return!(!_n(e)&&typeof e!="number"||isNaN(+Z(e)))}function In(e,t){const r=Z(e,t?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function zn(e,t){const[r,n]=ht(e,t.start,t.end);return{start:r,end:n}}function Hn(e,t){const{start:r,end:n}=zn(t?.in,e);let s=+r>+n;const a=s?+r:+n,o=s?n:r;o.setHours(0,0,0,0);let i=1;const u=[];for(;+o<=a;)u.push(se(r,o)),o.setDate(o.getDate()+i),o.setHours(0,0,0,0);return s?u.reverse():u}function Bn(e,t){const r=Z(e,t?.in);return r.setDate(1),r.setHours(0,0,0,0),r}function qn(e,t){const r=Z(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const Xn={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Vn=(e,t,r)=>{let n;const s=Xn[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function De(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Kn={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Un={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Gn={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Qn={date:De({formats:Kn,defaultWidth:"full"}),time:De({formats:Un,defaultWidth:"full"}),dateTime:De({formats:Gn,defaultWidth:"full"})},Jn={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Zn=(e,t,r,n)=>Jn[e];function ce(e){return(t,r)=>{const n=r?.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,i=r?.width?String(r.width):o;s=e.formattingValues[i]||e.formattingValues[o]}else{const o=e.defaultWidth,i=r?.width?String(r.width):e.defaultWidth;s=e.values[i]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return s[a]}}const es={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ts={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},rs={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ns={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ss={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},os={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},as=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},is={ordinalNumber:as,era:ce({values:es,defaultWidth:"wide"}),quarter:ce({values:ts,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ce({values:rs,defaultWidth:"wide"}),day:ce({values:ns,defaultWidth:"wide"}),dayPeriod:ce({values:ss,defaultWidth:"wide",formattingValues:os,defaultFormattingWidth:"wide"})};function le(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(s);if(!a)return null;const o=a[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(i)?ls(i,m=>m.test(o)):cs(i,m=>m.test(o));let l;l=e.valueCallback?e.valueCallback(u):u,l=r.valueCallback?r.valueCallback(l):l;const d=t.slice(o.length);return{value:l,rest:d}}}function cs(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function ls(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Cr(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=r.valueCallback?r.valueCallback(o):o;const i=t.slice(s.length);return{value:o,rest:i}}}const us=/^(\d+)(th|st|nd|rd)?/i,ds=/\d+/i,fs={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ms={any:[/^b/i,/^(a|c)/i]},hs={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},bs={any:[/1/i,/2/i,/3/i,/4/i]},ps={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},gs={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},vs={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},xs={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ws={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ys={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ks={ordinalNumber:Cr({matchPattern:us,parsePattern:ds,valueCallback:e=>parseInt(e,10)}),era:le({matchPatterns:fs,defaultMatchWidth:"wide",parsePatterns:ms,defaultParseWidth:"any"}),quarter:le({matchPatterns:hs,defaultMatchWidth:"wide",parsePatterns:bs,defaultParseWidth:"any",valueCallback:e=>e+1}),month:le({matchPatterns:ps,defaultMatchWidth:"wide",parsePatterns:gs,defaultParseWidth:"any"}),day:le({matchPatterns:vs,defaultMatchWidth:"wide",parsePatterns:xs,defaultParseWidth:"any"}),dayPeriod:le({matchPatterns:ws,defaultMatchWidth:"any",parsePatterns:ys,defaultParseWidth:"any"})},jr={code:"en-US",formatDistance:Vn,formatLong:Qn,formatRelative:Zn,localize:is,match:ks,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ns(e,t){const r=Z(e,t?.in);return An(r,qn(r))+1}function Es(e,t){const r=Z(e,t?.in),n=+nt(r)-+Wn(r);return Math.round(n/Nr)+1}function $r(e,t){const r=Z(e,t?.in),n=r.getFullYear(),s=mt(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,o=se(t?.in||e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const i=Ie(o,t),u=se(t?.in||e,0);u.setFullYear(n,0,a),u.setHours(0,0,0,0);const l=Ie(u,t);return+r>=+i?n+1:+r>=+l?n:n-1}function Cs(e,t){const r=mt(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=$r(e,t),a=se(t?.in||e,0);return a.setFullYear(s,0,n),a.setHours(0,0,0,0),Ie(a,t)}function js(e,t){const r=Z(e,t?.in),n=+Ie(r,t)-+Cs(r,t);return Math.round(n/Nr)+1}function I(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const be={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return I(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):I(r+1,2)},d(e,t){return I(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return I(e.getHours()%12||12,t.length)},H(e,t){return I(e.getHours(),t.length)},m(e,t){return I(e.getMinutes(),t.length)},s(e,t){return I(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return I(s,t.length)}},Te={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Qt={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return be.y(e,t)},Y:function(e,t,r,n){const s=$r(e,n),a=s>0?s:1-s;if(t==="YY"){const o=a%100;return I(o,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):I(a,t.length)},R:function(e,t){const r=Er(e);return I(r,t.length)},u:function(e,t){const r=e.getFullYear();return I(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return I(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return I(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return be.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return I(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=js(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):I(s,t.length)},I:function(e,t,r){const n=Es(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):I(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):be.d(e,t)},D:function(e,t,r){const n=Ns(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):I(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),a=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return I(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),a=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return I(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return I(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=Te.noon:n===0?s=Te.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=Te.evening:n>=12?s=Te.afternoon:n>=4?s=Te.morning:s=Te.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return be.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):be.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):I(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):I(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):be.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):be.s(e,t)},S:function(e,t){return be.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Zt(n);case"XXXX":case"XX":return ye(n);case"XXXXX":case"XXX":default:return ye(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Zt(n);case"xxxx":case"xx":return ye(n);case"xxxxx":case"xxx":default:return ye(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Jt(n,":");case"OOOO":default:return"GMT"+ye(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Jt(n,":");case"zzzz":default:return"GMT"+ye(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return I(n,t.length)},T:function(e,t,r){return I(+e,t.length)}};function Jt(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),a=n%60;return a===0?r+String(s):r+String(s)+t+I(a,2)}function Zt(e,t){return e%60===0?(e>0?"-":"+")+I(Math.abs(e)/60,2):ye(e,t)}function ye(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=I(Math.trunc(n/60),2),a=I(n%60,2);return r+s+t+a}const er=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Sr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},$s=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return er(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",er(n,t)).replace("{{time}}",Sr(s,t))},Ss={p:Sr,P:$s},Ts=/^D+$/,Ms=/^Y+$/,Ds=["D","DD","YY","YYYY"];function Ps(e){return Ts.test(e)}function Os(e){return Ms.test(e)}function Ls(e,t,r){const n=Fs(e,t,r);if(console.warn(n),Ds.includes(e))throw new RangeError(n)}function Fs(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Rs=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,As=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ws=/^'([^]*?)'?$/,_s=/''/g,Ys=/[a-zA-Z]/;function Ee(e,t,r){const n=mt(),s=r?.locale??n.locale??jr,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Z(e,r?.in);if(!Yn(i))throw new RangeError("Invalid time value");let u=t.match(As).map(d=>{const m=d[0];if(m==="p"||m==="P"){const h=Ss[m];return h(d,s.formatLong)}return d}).join("").match(Rs).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const m=d[0];if(m==="'")return{isToken:!1,value:Is(d)};if(Qt[m])return{isToken:!0,value:d};if(m.match(Ys))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:d}});s.localize.preprocessor&&(u=s.localize.preprocessor(i,u));const l={firstWeekContainsDate:a,weekStartsOn:o,locale:s};return u.map(d=>{if(!d.isToken)return d.value;const m=d.value;(!r?.useAdditionalWeekYearTokens&&Os(m)||!r?.useAdditionalDayOfYearTokens&&Ps(m))&&Ls(m,t,String(e));const h=Qt[m[0]];return h(i,m,s.localize,l)}).join("")}function Is(e){const t=e.match(Ws);return t?t[1].replace(_s,"'"):e}function tr(e,t,r){const[n,s]=ht(r?.in,e,t);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()}function kt(e,t,r){return et(e,-t,r)}const zs={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},Hs=(e,t,r)=>{let n;const s=zs[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"en "+n:"hace "+n:n},Bs={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},qs={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Xs={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Vs={date:De({formats:Bs,defaultWidth:"full"}),time:De({formats:qs,defaultWidth:"full"}),dateTime:De({formats:Xs,defaultWidth:"full"})},Ks={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},Us={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},Gs=(e,t,r,n)=>t.getHours()!==1?Us[e]:Ks[e],Qs={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},Js={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Zs={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},eo={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},to={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},ro={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},no=(e,t)=>Number(e)+"º",so={ordinalNumber:no,era:ce({values:Qs,defaultWidth:"wide"}),quarter:ce({values:Js,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:ce({values:Zs,defaultWidth:"wide"}),day:ce({values:eo,defaultWidth:"wide"}),dayPeriod:ce({values:to,defaultWidth:"wide",formattingValues:ro,defaultFormattingWidth:"wide"})},oo=/^(\d+)(º)?/i,ao=/\d+/i,io={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},co={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},lo={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},uo={any:[/1/i,/2/i,/3/i,/4/i]},fo={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},mo={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},ho={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},bo={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},po={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},go={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},vo={ordinalNumber:Cr({matchPattern:oo,parsePattern:ao,valueCallback:function(e){return parseInt(e,10)}}),era:le({matchPatterns:io,defaultMatchWidth:"wide",parsePatterns:co,defaultParseWidth:"any"}),quarter:le({matchPatterns:lo,defaultMatchWidth:"wide",parsePatterns:uo,defaultParseWidth:"any",valueCallback:e=>e+1}),month:le({matchPatterns:fo,defaultMatchWidth:"wide",parsePatterns:mo,defaultParseWidth:"any"}),day:le({matchPatterns:ho,defaultMatchWidth:"wide",parsePatterns:bo,defaultParseWidth:"any"}),dayPeriod:le({matchPatterns:po,defaultMatchWidth:"any",parsePatterns:go,defaultParseWidth:"any"})},ze={code:"es",formatDistance:Hs,formatLong:Vs,formatRelative:Gs,localize:so,match:vo,options:{weekStartsOn:1,firstWeekContainsDate:1}},ue=typeof document<"u"?f.useLayoutEffect:()=>{},K=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},ot=e=>e&&"window"in e&&e.window===e?e:K(e).defaultView||window;function xo(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function wo(e){return xo(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let yo=!1;function bt(){return yo}function rr(e,t){if(!bt())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let r=t;for(;r!==null;){if(r===e)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:wo(r)?r=r.host:r=r.parentNode}return!1}const ne=(e=document)=>{var t;if(!bt())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(!((t=r.shadowRoot)===null||t===void 0)&&t.activeElement);)r=r.shadowRoot.activeElement;return r};function Me(e){return bt()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class ko{get currentNode(){return this._currentNode}set currentNode(t){if(!rr(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const r=[];let n=t,s=t;for(this._currentNode=t;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const o=n,i=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});r.push(i),i.currentNode=s,this._currentSetFor.add(i),n=s=o.host}else n=n.parentNode;const a=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});r.push(a),a.currentNode=s,this._currentSetFor.add(a),this._walkerStack=r}get doc(){return this._doc}firstChild(){let t=this.currentNode,r=this.nextNode();return rr(t,r)?(r&&(this.currentNode=r),r):(this.currentNode=t,null)}lastChild(){let r=this._walkerStack[0].lastChild();return r&&(this.currentNode=r),r}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var r;let s;if(typeof this.filter=="function"?s=this.filter(t):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(s=this.filter.acceptNode(t)),s===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let a=this.nextNode();return a&&(this.currentNode=a),a}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.nextNode();return n&&(this.currentNode=n),n}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let s=this.previousNode();return s&&(this.currentNode=s),s}else return null;return null}const r=t.previousNode();if(r){if(r.shadowRoot){var n;let a;if(typeof this.filter=="function"?a=this.filter(r):!((n=this.filter)===null||n===void 0)&&n.acceptNode&&(a=this.filter.acceptNode(r)),a===NodeFilter.FILTER_ACCEPT)return r&&(this.currentNode=r),r;let o=this.lastChild();return o&&(this.currentNode=o),o}return r&&(this.currentNode=r),r}else if(this._walkerStack.length>1){this._walkerStack.shift();let s=this.previousNode();return s&&(this.currentNode=s),s}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(t,r,n,s){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=o=>{if(o.nodeType===Node.ELEMENT_NODE){const u=o.shadowRoot;if(u){const l=this._doc.createTreeWalker(u,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(l),NodeFilter.FILTER_ACCEPT}else{var i;if(typeof this.filter=="function")return this.filter(o);if(!((i=this.filter)===null||i===void 0)&&i.acceptNode)return this.filter.acceptNode(o);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=r,this.filter=s??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=r,this._walkerStack.unshift(t.createTreeWalker(r,n,this._acceptNode));const a=r.shadowRoot;if(a){const o=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(o)}}}function No(e,t,r,n){return bt()?new ko(e,t,r,n):e.createTreeWalker(t,r,n)}function nr(e){if(Eo())e.focus({preventScroll:!0});else{let t=Co(e);e.focus(),jo(t)}}let Qe=null;function Eo(){if(Qe==null){Qe=!1;try{document.createElement("div").focus({get preventScroll(){return Qe=!0,!0}})}catch{}}return Qe}function Co(e){let t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}function jo(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}function pt(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let r=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(r)&&r.some(n=>e.test(n.brand))||e.test(window.navigator.userAgent)}function Lt(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function he(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const Ft=he(function(){return Lt(/^Mac/i)}),$o=he(function(){return Lt(/^iPhone/i)}),So=he(function(){return Lt(/^iPad/i)||Ft()&&navigator.maxTouchPoints>1}),To=he(function(){return $o()||So()});he(function(){return Ft()||To()});he(function(){return pt(/AppleWebKit/i)&&!Tr()});const Tr=he(function(){return pt(/Chrome/i)}),Mr=he(function(){return pt(/Android/i)});he(function(){return pt(/Firefox/i)});let ge=new Map,Ct=new Set;function sr(){if(typeof window>"u")return;function e(n){return"propertyName"in n}let t=n=>{if(!e(n)||!n.target)return;let s=ge.get(n.target);s||(s=new Set,ge.set(n.target,s),n.target.addEventListener("transitioncancel",r,{once:!0})),s.add(n.propertyName)},r=n=>{if(!e(n)||!n.target)return;let s=ge.get(n.target);if(s&&(s.delete(n.propertyName),s.size===0&&(n.target.removeEventListener("transitioncancel",r),ge.delete(n.target)),ge.size===0)){for(let a of Ct)a();Ct.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",r)}typeof document<"u"&&(document.readyState!=="loading"?sr():document.addEventListener("DOMContentLoaded",sr));function Mo(){for(const[e]of ge)"isConnected"in e&&!e.isConnected&&ge.delete(e)}function Do(e){requestAnimationFrame(()=>{Mo(),ge.size===0?e():Ct.add(e)})}function Po(e){return e.pointerType===""&&e.isTrusted?!0:Mr()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}const Oo=typeof Element<"u"&&"checkVisibility"in Element.prototype;function Lo(e){const t=ot(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:r,visibility:n}=e.style,s=r!=="none"&&n!=="hidden"&&n!=="collapse";if(s){const{getComputedStyle:a}=e.ownerDocument.defaultView;let{display:o,visibility:i}=a(e);s=o!=="none"&&i!=="hidden"&&i!=="collapse"}return s}function Fo(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Rt(e,t){return Oo?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&Lo(e)&&Fo(e,t)&&(!e.parentElement||Rt(e.parentElement,e))}const At=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Ro=At.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";At.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Ao=At.join(':not([hidden]):not([tabindex="-1"]),');function Wo(e){return e.matches(Ro)&&Rt(e)&&!Dr(e)}function _o(e){return e.matches(Ao)&&Rt(e)&&!Dr(e)}function Dr(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}let Yo=!1,Xe=null,Io=new Set,_e=new Map,Ce=!1,jt=!1;function Wt(e,t){for(let r of Io)r(e,t)}function zo(e){return!(e.metaKey||!Ft()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function at(e){Ce=!0,zo(e)&&(Xe="keyboard",Wt("keyboard",e))}function ee(e){Xe="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ce=!0,Wt("pointer",e))}function Pr(e){Po(e)&&(Ce=!0,Xe="virtual")}function Or(e){e.target===window||e.target===document||Yo||!e.isTrusted||(!Ce&&!jt&&(Xe="virtual",Wt("virtual",e)),Ce=!1,jt=!1)}function Lr(){Ce=!1,jt=!0}function or(e){if(typeof window>"u"||typeof document>"u"||_e.get(ot(e)))return;const t=ot(e),r=K(e);let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ce=!0,n.apply(this,arguments)},r.addEventListener("keydown",at,!0),r.addEventListener("keyup",at,!0),r.addEventListener("click",Pr,!0),t.addEventListener("focus",Or,!0),t.addEventListener("blur",Lr,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",ee,!0),r.addEventListener("pointermove",ee,!0),r.addEventListener("pointerup",ee,!0)):process.env.NODE_ENV==="test"&&(r.addEventListener("mousedown",ee,!0),r.addEventListener("mousemove",ee,!0),r.addEventListener("mouseup",ee,!0)),t.addEventListener("beforeunload",()=>{Fr(e)},{once:!0}),_e.set(t,{focus:n})}const Fr=(e,t)=>{const r=ot(e),n=K(e);t&&n.removeEventListener("DOMContentLoaded",t),_e.has(r)&&(r.HTMLElement.prototype.focus=_e.get(r).focus,n.removeEventListener("keydown",at,!0),n.removeEventListener("keyup",at,!0),n.removeEventListener("click",Pr,!0),r.removeEventListener("focus",Or,!0),r.removeEventListener("blur",Lr,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",ee,!0),n.removeEventListener("pointermove",ee,!0),n.removeEventListener("pointerup",ee,!0)):process.env.NODE_ENV==="test"&&(n.removeEventListener("mousedown",ee,!0),n.removeEventListener("mousemove",ee,!0),n.removeEventListener("mouseup",ee,!0)),_e.delete(r))};function Ho(e){const t=K(e);let r;return t.readyState!=="loading"?or(e):(r=()=>{or(e)},t.addEventListener("DOMContentLoaded",r)),()=>Fr(e,r)}typeof document<"u"&&Ho();function Rr(){return Xe}function Bo(e){const t=K(e),r=ne(t);if(Rr()==="virtual"){let n=r;Do(()=>{ne(t)===n&&e.isConnected&&nr(e)})}else nr(e)}const ar=f.createContext(null),$t="react-aria-focus-scope-restore";let z=null;function qo(e){let{children:t,contain:r,restoreFocus:n,autoFocus:s}=e,a=f.useRef(null),o=f.useRef(null),i=f.useRef([]),{parentNode:u}=f.useContext(ar)||{},l=f.useMemo(()=>new Tt({scopeRef:i}),[i]);ue(()=>{let h=u||B.root;if(B.getTreeNode(h.scopeRef)&&z&&!it(z,h.scopeRef)){let p=B.getTreeNode(z);p&&(h=p)}h.addChild(l),B.addNode(l)},[l,u]),ue(()=>{let h=B.getTreeNode(i);h&&(h.contain=!!r)},[r]),ue(()=>{var h;let p=(h=a.current)===null||h===void 0?void 0:h.nextSibling,b=[],v=x=>x.stopPropagation();for(;p&&p!==o.current;)b.push(p),p.addEventListener($t,v),p=p.nextSibling;return i.current=b,()=>{for(let x of b)x.removeEventListener($t,v)}},[t]),Go(i,n,r),Ko(i,r),Qo(i,n,r),Uo(i,s),f.useEffect(()=>{const h=ne(K(i.current?i.current[0]:void 0));let p=null;if(te(h,i.current)){for(let b of B.traverse())b.scopeRef&&te(h,b.scopeRef.current)&&(p=b);p===B.getTreeNode(i)&&(z=p.scopeRef)}},[i]),ue(()=>()=>{var h,p,b;let v=(b=(p=B.getTreeNode(i))===null||p===void 0||(h=p.parent)===null||h===void 0?void 0:h.scopeRef)!==null&&b!==void 0?b:null;(i===z||it(i,z))&&(!v||B.getTreeNode(v))&&(z=v),B.removeTreeNode(i)},[i]);let d=f.useMemo(()=>Xo(i),[]),m=f.useMemo(()=>({focusManager:d,parentNode:l}),[l,d]);return f.createElement(ar.Provider,{value:m},f.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,f.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:o}))}function Xo(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:s,wrap:a,accept:o}=t;var i;let u=n||ne(K((i=r[0])!==null&&i!==void 0?i:void 0)),l=r[0].previousElementSibling,d=ke(r),m=ve(d,{tabbable:s,accept:o},r);m.currentNode=te(u,r)?u:l;let h=m.nextNode();return!h&&a&&(m.currentNode=l,h=m.nextNode()),h&&fe(h,!0),h},focusPrevious(t={}){let r=e.current,{from:n,tabbable:s,wrap:a,accept:o}=t;var i;let u=n||ne(K((i=r[0])!==null&&i!==void 0?i:void 0)),l=r[r.length-1].nextElementSibling,d=ke(r),m=ve(d,{tabbable:s,accept:o},r);m.currentNode=te(u,r)?u:l;let h=m.previousNode();return!h&&a&&(m.currentNode=l,h=m.previousNode()),h&&fe(h,!0),h},focusFirst(t={}){let r=e.current,{tabbable:n,accept:s}=t,a=ke(r),o=ve(a,{tabbable:n,accept:s},r);o.currentNode=r[0].previousElementSibling;let i=o.nextNode();return i&&fe(i,!0),i},focusLast(t={}){let r=e.current,{tabbable:n,accept:s}=t,a=ke(r),o=ve(a,{tabbable:n,accept:s},r);o.currentNode=r[r.length-1].nextElementSibling;let i=o.previousNode();return i&&fe(i,!0),i}}}function ke(e){return e[0].parentElement}function Ae(e){let t=B.getTreeNode(z);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Vo(e){if(e.checked)return!0;let t=[];if(!e.form)t=[...K(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)].filter(a=>!a.form);else{var r,n;let a=(n=e.form)===null||n===void 0||(r=n.elements)===null||r===void 0?void 0:r.namedItem(e.name);t=[...a??[]]}return t?!t.some(a=>a.checked):!1}function Ko(e,t){let r=f.useRef(void 0),n=f.useRef(void 0);ue(()=>{let s=e.current;if(!t){n.current&&(cancelAnimationFrame(n.current),n.current=void 0);return}const a=K(s?s[0]:void 0);let o=l=>{if(l.key!=="Tab"||l.altKey||l.ctrlKey||l.metaKey||!Ae(e)||l.isComposing)return;let d=ne(a),m=e.current;if(!m||!te(d,m))return;let h=ke(m),p=ve(h,{tabbable:!0},m);if(!d)return;p.currentNode=d;let b=l.shiftKey?p.previousNode():p.nextNode();b||(p.currentNode=l.shiftKey?m[m.length-1].nextElementSibling:m[0].previousElementSibling,b=l.shiftKey?p.previousNode():p.nextNode()),l.preventDefault(),b&&fe(b,!0)},i=l=>{(!z||it(z,e))&&te(Me(l),e.current)?(z=e,r.current=Me(l)):Ae(e)&&!Ne(Me(l),e)?r.current?r.current.focus():z&&z.current&&St(z.current):Ae(e)&&(r.current=Me(l))},u=l=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{let d=Rr(),m=(d==="virtual"||d===null)&&Mr()&&Tr(),h=ne(a);if(!m&&h&&Ae(e)&&!Ne(h,e)){z=e;let b=Me(l);if(b&&b.isConnected){var p;r.current=b,(p=r.current)===null||p===void 0||p.focus()}else z.current&&St(z.current)}})};return a.addEventListener("keydown",o,!1),a.addEventListener("focusin",i,!1),s?.forEach(l=>l.addEventListener("focusin",i,!1)),s?.forEach(l=>l.addEventListener("focusout",u,!1)),()=>{a.removeEventListener("keydown",o,!1),a.removeEventListener("focusin",i,!1),s?.forEach(l=>l.removeEventListener("focusin",i,!1)),s?.forEach(l=>l.removeEventListener("focusout",u,!1))}},[e,t]),ue(()=>()=>{n.current&&cancelAnimationFrame(n.current)},[n])}function Ar(e){return Ne(e)}function te(e,t){return!e||!t?!1:t.some(r=>r.contains(e))}function Ne(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of B.traverse(B.getTreeNode(t)))if(r&&te(e,r.current))return!0;return!1}function it(e,t){var r;let n=(r=B.getTreeNode(t))===null||r===void 0?void 0:r.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function fe(e,t=!1){if(e!=null&&!t)try{Bo(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function Wr(e,t=!0){let r=e[0].previousElementSibling,n=ke(e),s=ve(n,{tabbable:t},e);s.currentNode=r;let a=s.nextNode();return t&&!a&&(n=ke(e),s=ve(n,{tabbable:!1},e),s.currentNode=r,a=s.nextNode()),a}function St(e,t=!0){fe(Wr(e,t))}function Uo(e,t){const r=f.useRef(t);f.useEffect(()=>{if(r.current){z=e;const n=K(e.current?e.current[0]:void 0);!te(ne(n),z.current)&&e.current&&St(e.current)}r.current=!1},[e])}function Go(e,t,r){ue(()=>{if(t||r)return;let n=e.current;const s=K(n?n[0]:void 0);let a=o=>{let i=Me(o);te(i,e.current)?z=e:Ar(i)||(z=null)};return s.addEventListener("focusin",a,!1),n?.forEach(o=>o.addEventListener("focusin",a,!1)),()=>{s.removeEventListener("focusin",a,!1),n?.forEach(o=>o.removeEventListener("focusin",a,!1))}},[e,t,r])}function ir(e){let t=B.getTreeNode(z);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function Qo(e,t,r){const n=f.useRef(typeof document<"u"?ne(K(e.current?e.current[0]:void 0)):null);ue(()=>{let s=e.current;const a=K(s?s[0]:void 0);if(!t||r)return;let o=()=>{(!z||it(z,e))&&te(ne(a),e.current)&&(z=e)};return a.addEventListener("focusin",o,!1),s?.forEach(i=>i.addEventListener("focusin",o,!1)),()=>{a.removeEventListener("focusin",o,!1),s?.forEach(i=>i.removeEventListener("focusin",o,!1))}},[e,r]),ue(()=>{const s=K(e.current?e.current[0]:void 0);if(!t)return;let a=o=>{if(o.key!=="Tab"||o.altKey||o.ctrlKey||o.metaKey||!Ae(e)||o.isComposing)return;let i=s.activeElement;if(!Ne(i,e)||!ir(e))return;let u=B.getTreeNode(e);if(!u)return;let l=u.nodeToRestore,d=ve(s.body,{tabbable:!0});d.currentNode=i;let m=o.shiftKey?d.previousNode():d.nextNode();if((!l||!l.isConnected||l===s.body)&&(l=void 0,u.nodeToRestore=void 0),(!m||!Ne(m,e))&&l){d.currentNode=l;do m=o.shiftKey?d.previousNode():d.nextNode();while(Ne(m,e));o.preventDefault(),o.stopPropagation(),m?fe(m,!0):Ar(l)?fe(l,!0):i.blur()}};return r||s.addEventListener("keydown",a,!0),()=>{r||s.removeEventListener("keydown",a,!0)}},[e,t,r]),ue(()=>{const s=K(e.current?e.current[0]:void 0);if(!t)return;let a=B.getTreeNode(e);if(a){var o;return a.nodeToRestore=(o=n.current)!==null&&o!==void 0?o:void 0,()=>{let i=B.getTreeNode(e);if(!i)return;let u=i.nodeToRestore,l=ne(s);if(t&&u&&(l&&Ne(l,e)||l===s.body&&ir(e))){let d=B.clone();requestAnimationFrame(()=>{if(s.activeElement===s.body){let m=d.getTreeNode(e);for(;m;){if(m.nodeToRestore&&m.nodeToRestore.isConnected){cr(m.nodeToRestore);return}m=m.parent}for(m=d.getTreeNode(e);m;){if(m.scopeRef&&m.scopeRef.current&&B.getTreeNode(m.scopeRef)){let h=Wr(m.scopeRef.current,!0);cr(h);return}m=m.parent}}})}}}},[e,t])}function cr(e){e.dispatchEvent(new CustomEvent($t,{bubbles:!0,cancelable:!0}))&&fe(e)}function ve(e,t,r){let n=t?.tabbable?_o:Wo,s=e?.nodeType===Node.ELEMENT_NODE?e:null,a=K(s),o=No(a,e||a,NodeFilter.SHOW_ELEMENT,{acceptNode(i){var u;return!(t==null||(u=t.from)===null||u===void 0)&&u.contains(i)||t?.tabbable&&i.tagName==="INPUT"&&i.getAttribute("type")==="radio"&&(!Vo(i)||o.currentNode.tagName==="INPUT"&&o.currentNode.type==="radio"&&o.currentNode.name===i.name)?NodeFilter.FILTER_REJECT:n(i)&&(!r||te(i,r))&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}class _t{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,r,n){let s=this.fastMap.get(r??null);if(!s)return;let a=new Tt({scopeRef:t});s.addChild(a),a.parent=s,this.fastMap.set(t,a),n&&(a.nodeToRestore=n)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let r=this.fastMap.get(t);if(!r)return;let n=r.parent;for(let a of this.traverse())a!==r&&r.nodeToRestore&&a.nodeToRestore&&r.scopeRef&&r.scopeRef.current&&te(a.nodeToRestore,r.scopeRef.current)&&(a.nodeToRestore=r.nodeToRestore);let s=r.children;n&&(n.removeChild(r),s.size>0&&s.forEach(a=>n&&n.addChild(a))),this.fastMap.delete(r.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let r of t.children)yield*this.traverse(r)}clone(){var t;let r=new _t;var n;for(let s of this.traverse())r.addTreeNode(s.scopeRef,(n=(t=s.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&n!==void 0?n:null,s.nodeToRestore);return r}constructor(){this.fastMap=new Map,this.root=new Tt({scopeRef:null}),this.fastMap.set(null,this.root)}}class Tt{addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}}let B=new _t;const $e=({children:e,node:t})=>hr.createPortal(e,t??document.body),_r=({children:e,customTrigger:t,triggerContent:r,align:n="start",side:s="bottom",offset:a=8,className:o,triggerClassName:i,closeOnEscape:u=!0,closeOnClickAway:l=!0,scrollerId:d,onOpen:m,onClose:h,maxHeight:p="400px",minWidth:b="200px",maxWidth:v="500px"})=>{const{triggerRef:x,triggerProps:E,popoverRef:$,getPopoverPosition:j,open:S,toggle:M,close:w}=ft({align:n,side:s,offset:a,scrollerId:d,onOpen:()=>{m?.()},onClose:()=>{h?.()}});wr({Escape:O=>{u&&(O.preventDefault(),w(),x.current?.focus())}},{enabled:S}),dt($,O=>{!l||!x.current||!S||!O.target||x.current.contains(O.target)||w()});const N=j();return c.jsxs(c.Fragment,{children:[t?t({triggerRef:x,triggerProps:E,toggle:M,open:S,close:w}):c.jsx("button",{ref:x,...E,onClick:M,className:k("outline-none p-2 rounded-md transition-colors","hover:bg-base-3 focus-visible:bg-base-3 focus-visible:ring-2 focus-visible:ring-brand",i),children:r}),c.jsx(L.AnimatePresence,{children:S&&c.jsx($e,{children:c.jsx(qo,{contain:!0,restoreFocus:!0,autoFocus:!0,children:c.jsx(L.motion.div,{initial:{opacity:0,scale:.95,y:s==="bottom"?-10:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:s==="bottom"?-10:10},transition:{type:"spring",duration:.2,bounce:.1},ref:$,style:{position:"fixed",left:N.x,top:N.top,bottom:N.bottom,maxHeight:typeof p=="number"?`${p}px`:p,minWidth:typeof b=="number"?`${b}px`:b,maxWidth:typeof v=="number"?`${v}px`:v,zIndex:1e3},className:k("bg-base-1 dark-theme:bg-base-2","border border-base-4 rounded-6","customscrollbar overflow-auto",o),children:typeof e=="function"?e(M):e})})})})]})},Jo=({title:e,subtitle:t,onClose:r,className:n})=>c.jsx("div",{className:k("p-4 border-b border-base-4",n),children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-base-12",children:e}),t&&c.jsx("p",{className:"text-sm text-base-11 mt-1",children:t})]}),r&&c.jsx("button",{onClick:r,className:"ml-4 text-base-11 hover:text-base-12 transition-colors",children:"×"})]})}),Zo=({children:e,className:t})=>c.jsx("div",{className:k("p-4",t),children:e}),ea=({children:e,className:t})=>c.jsx("div",{className:k("p-4 border-t border-base-4",t),children:e}),ta=(e,t)=>{const r=new Date(2023,0,1),n=[];for(let s=0;s<7;s++){const a=new Date(r);a.setDate(r.getDate()+s),n.push(Ee(a,"EEE",{locale:e??jr}))}return t?[...n.slice(1),n[0]]:n},Yt=({selectedDate:e,onDateSelect:t,disabledDates:r,disabledDaysOfWeek:n,minDate:s,maxDate:a,locale:o,weekStartsOnMonday:i=!0,className:u=""})=>{const[l,d]=f.useState(e||new Date),[m,h]=f.useState(e||new Date),p=f.useRef(null),b=f.useMemo(()=>r?new Set(r.map(w=>new Date(w).toDateString())):new Set,[r]),v=f.useMemo(()=>new Set(n||[]),[n]),x=f.useMemo(()=>{const w=Bn(l),N=In(l),O=new Date(w),W=new Date(N);if(i){const C=w.getDay(),g=C===0?6:C-1;O.setDate(w.getDate()-g);const D=N.getDay(),T=D===0?0:7-D;W.setDate(N.getDate()+T)}else O.setDate(w.getDate()-w.getDay()),W.setDate(N.getDate()+(6-N.getDay()));return Hn({start:O,end:W})},[l,i]),E=f.useMemo(()=>ta(o??ze,i),[o,i]),$=w=>{const N=w.toDateString(),O=w.getDay();return!(b.has(N)||v.has(O)||s&&w<s||a&&w>a)},j=w=>{$(w)&&t&&t(w),h(w)},S=w=>{if(!m)return;let N=new Date(m),O=!0,W,C;switch(w.key){case"ArrowUp":N.setDate(N.getDate()-7);break;case"ArrowDown":N.setDate(N.getDate()+7);break;case"ArrowLeft":N.setDate(N.getDate()-1);break;case"ArrowRight":N.setDate(N.getDate()+1);break;case"Home":W=N.getDay(),N.setDate(N.getDate()-W);break;case"End":C=N.getDay(),N.setDate(N.getDate()+(6-C));break;case"PageUp":N=w.shiftKey?kt(N,12):kt(N,1);break;case"PageDown":N=w.shiftKey?et(N,12):et(N,1);break;case"Enter":case" ":$(m)&&t&&t(m);break;default:O=!1}O&&(w.preventDefault(),N.getTime()!==m.getTime()&&(h(N),tr(N,l)||d(N)))},M=w=>{d(N=>w==="prev"?kt(N,1):et(N,1))};return c.jsxs("div",{ref:p,className:k("dark-theme:bg-base-3 border border-base-5 dark-theme:border-base-4 rounded-6 px-4 pt-3 pb-4 w-full lg:w-80",u),onKeyDown:S,tabIndex:0,role:"grid","aria-label":"Calendar",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(q,{onClick:()=>M("prev"),size:"iconSm","aria-label":"Previous month",children:c.jsx(A.ChevronLeft,{size:16})}),c.jsx("h2",{className:"text-sm font-medium",children:Ee(l,"MMMM yyyy")}),c.jsx(q,{onClick:()=>M("next"),size:"iconSm","aria-label":"Next month",children:c.jsx(A.ChevronRight,{size:16})})]}),c.jsx("div",{className:"grid grid-cols-7 gap-1 mt-4",role:"row",children:E.map(w=>c.jsx("div",{className:"text-xs flex items-center w-8 justify-center text-base-11",role:"columnheader",children:w},w))}),c.jsx("div",{className:"grid grid-cols-7 gap-1 mt-4",role:"grid",children:x.map((w,N)=>{const O=tr(w,l),W=e?yt(w,e):!1,C=m&&yt(w,m),g=$(w),D=yt(w,new Date);return c.jsx("button",{onClick:()=>j(w),disabled:!g,tabIndex:C?0:-1,role:"gridcell","aria-label":`${w.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})}${W?", selected":""}${g?"":", disabled"}`,"aria-selected":W,"aria-disabled":!g,className:k("h-8 w-8 flex items-center outline-none justify-center rounded-6 hover:bg-base-4 text-sm relative",O?W?"bg-brand text-brand-text hover:bg-brand":D?"text-base-12 ring-1 ring-base-8":"text-base-12":"text-base-9",C&&"ring-1 ring-base-6",(!g||!O)&&"pointer-events-none text-base-9"),children:Ee(w,"d")},N)})})]})},ra=()=>{const[e,t]=f.useState(new Date(2025,8,21)),r=["2025-09-13T00:00:00Z","2025-09-15T00:00:00Z"],n=[0,6];return c.jsx("div",{className:"p-8 bg-gray-100 min-h-screen",children:c.jsxs("div",{className:"max-w-md mx-auto",children:[c.jsx("h1",{className:"text-2xl font-bold mb-6 text-gray-800",children:"Calendar Date Picker Demo"}),c.jsx("div",{className:"mb-6",children:c.jsx(Yt,{selectedDate:e,onDateSelect:t,disabledDates:r,disabledDaysOfWeek:n,minDate:new Date(2025,8,1),maxDate:new Date(2025,11,31)})}),e&&c.jsxs("div",{className:"bg-white p-4 rounded-lg shadow",children:[c.jsx("h3",{className:"font-semibold text-gray-800 mb-2",children:"Selected Date:"}),c.jsx("p",{className:"text-gray-600",children:e.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),c.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["ISO: ",e.toISOString()]})]}),c.jsxs("div",{className:"mt-6 bg-white p-4 rounded-lg shadow",children:[c.jsx("h3",{className:"font-semibold text-gray-800 mb-2",children:"Keyboard Navigation:"}),c.jsxs("div",{className:"text-sm text-gray-600 space-y-1",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Arrow Keys:"})," Navigate between dates"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Enter/Space:"})," Select focused date"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Home/End:"})," Go to start/end of week"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Page Up/Down:"})," Previous/next month"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Shift + Page Up/Down:"})," Previous/next year"]})]})]}),c.jsxs("div",{className:"mt-4 bg-white p-4 rounded-lg shadow",children:[c.jsx("h3",{className:"font-semibold text-gray-800 mb-2",children:"Features:"}),c.jsxs("ul",{className:"text-sm text-gray-600 space-y-1",children:[c.jsx("li",{children:"✅ All dates enabled by default"}),c.jsx("li",{children:"✅ Disable specific dates (PostgreSQL ISO strings)"}),c.jsx("li",{children:"✅ Disable entire days of week (e.g., weekends)"}),c.jsx("li",{children:"✅ Min/max date constraints"}),c.jsx("li",{children:"✅ Full keyboard navigation with arrow keys"}),c.jsx("li",{children:"✅ Focus management and accessibility"})]})]})]})})};function na({customTrigger:e,scrollerId:t}){const[r,n]=f.useState(new Date);return c.jsx(_r,{className:"p-0",scrollerId:t,customTrigger:({toggle:s,triggerRef:a})=>e?e(s,a):c.jsxs(q,{ref:a,onClick:s,color:"solid",className:"px-3 mt-1 w-full justify-start",children:[Ee(new Date,"PP",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(A.CalendarDays,{size:18,className:"text-base-11"})]}),children:s=>c.jsx(Yt,{selectedDate:r,onDateSelect:a=>{n(a),s()},className:"border-none",disabledDaysOfWeek:[0,6]})})}const sa=()=>c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium ml-0.5",children:"Start Time"}),c.jsxs(q,{color:"solid",className:"px-3 mt-1",children:[Ee(new Date,"p",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(A.Clock,{size:18,className:"text-base-11"})]})]}),oa=()=>c.jsxs("div",{className:"flex items-center gap-x-4",children:[c.jsxs("div",{className:"grow",children:[c.jsx("p",{className:"text-xs font-medium ml-0.5",children:"Start Date"}),c.jsxs(q,{color:"solid",className:"px-3 mt-1 w-full justify-start",children:[Ee(new Date,"PP",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(A.CalendarDays,{size:18,className:"text-base-11"})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium ml-0.5",children:"Start Time"}),c.jsxs(q,{color:"solid",className:"px-3 mt-1",children:[Ee(new Date,"p",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(A.Clock,{size:18,className:"text-base-11"})]})]})]}),Je={unchecked:"bg-base-3 lg:hover:bg-base-4",checked:"bg-brand lg:hover:bg-brand-hover text-brand-text",uncheckedDisabled:"bg-base-3 border-base-4",checkedDisabled:"bg-base-3 border-base-4 text-base-10"},Yr=f.forwardRef(({checked:e=!1,onCheckedChange:t,disabled:r=!1,required:n=!1,name:s,value:a,id:o,className:i="",size:u="sm",...l},d)=>{const m=()=>{r||t?.(e==="indeterminate"?!0:!e)},h=v=>{(v.key===" "||v.key==="Enter")&&(v.preventDefault(),m())},p={xs:"h-3.5 w-3.5",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},b={xs:24,sm:12,md:14,lg:16};return c.jsxs(c.Fragment,{children:[c.jsxs("button",{ref:d,type:"button",role:"checkbox","aria-checked":e==="indeterminate"?"mixed":e,"aria-required":n,disabled:r,onClick:m,onKeyDown:h,className:k("inline-flex items-center justify-center rounded-2 border border-base-4 transition-all duration-200 ease-in-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-base-5",p[u],r&&"cursor-not-allowed opacity-75",!r&&"cursor-pointer",e?r?Je.checkedDisabled:Je.checked:r?Je.uncheckedDisabled:Je.unchecked,typeof i=="function"?i(e):i),...l,children:[e===!0&&c.jsx(A.Check,{size:b[u],className:"stroke-current"}),e==="indeterminate"&&c.jsx(A.Minus,{size:b[u],className:"stroke-current"})]}),c.jsx("input",{type:"checkbox",name:s,value:a,checked:e===!0,onChange:()=>{},disabled:r,required:n,id:o,className:"sr-only",tabIndex:-1})]})});Yr.displayName="Checkbox";const aa=({title:e,message:t,searchParam:r,condition:n=!0,cancelLabel:s,confirmLabel:a,confirmColor:o="contrast",confirmAction:i,trigger:u})=>{const{searchParams:l}=de.useSearchParams(),d=f.useMemo(()=>!!l[r],[l]),m=f.useCallback(()=>{de.navigate.to(`${window.location.pathname}?${r}=open`)},[r]);return c.jsxs(c.Fragment,{children:[c.jsx(L.AnimatePresence,{initial:!1,children:d&&n?c.jsxs($e,{node:document&&document.getElementById("modals"),children:[c.jsx(L.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed top-0 left-0 z-[999] h-full w-full bg-black/50"}),c.jsxs(L.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed top-1/2 left-1/2 z-[999] w-[75%] -translate-y-1/2 -translate-x-1/2 rounded-lg bg-base-2 p-4 lg:w-[35%] xl:w-[30%]",children:[e?c.jsx("p",{className:"font-medium",children:e}):null,t?c.jsx("p",{className:k("text-sm text-base-11",{"mt-2":e}),children:t}):null,c.jsxs("div",{className:"flex justify-end gap-x-4 pt-4",children:[c.jsx(q,{onClick:()=>de.navigate.back(),color:"transparentinactive",size:"sm",children:s??"Cancelar"}),c.jsx(q,{size:"sm",onClick:()=>{i&&i(),de.navigate.back()},color:o,children:a??"Continuar"})]})]})]}):null}),u?u(m):null]})},ia=({scrollY:e,height:t=300,className:r,children:n})=>{const s=L.useTransform(e,o=>o<0?1+Math.abs(o)/t:1),a=L.useTransform(e,o=>o<0?-Math.abs(o)/2:0);return c.jsx(L.motion.div,{style:{scale:s,y:a,height:t},className:r,children:n})};function Ir(e,t,r){function n(i,u){var l;Object.defineProperty(i,"_zod",{value:i._zod??{},enumerable:!1}),(l=i._zod).traits??(l.traits=new Set),i._zod.traits.add(e),t(i,u);for(const d in o.prototype)d in i||Object.defineProperty(i,d,{value:o.prototype[d].bind(i)});i._zod.constr=o,i._zod.def=u}const s=r?.Parent??Object;class a extends s{}Object.defineProperty(a,"name",{value:e});function o(i){var u;const l=r?.Parent?new a:this;n(l,i),(u=l._zod).deferred??(u.deferred=[]);for(const d of l._zod.deferred)d();return l}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:i=>r?.Parent&&i instanceof r.Parent?!0:i?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class ca extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const la={};function zr(e){return la}function ua(e,t){return typeof t=="bigint"?t.toString():t}const Hr=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ze(e){return typeof e=="string"?e:e?.message}function Br(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const s=Ze(e.inst?._zod.def?.error?.(e))??Ze(t?.error?.(e))??Ze(r.customError?.(e))??Ze(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}const qr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,ua,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},da=Ir("$ZodError",qr),Xr=Ir("$ZodError",qr,{Parent:Error}),fa=e=>(t,r,n,s)=>{const a=n?Object.assign(n,{async:!1}):{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new ca;if(o.issues.length){const i=new(s?.Err??e)(o.issues.map(u=>Br(u,a,zr())));throw Hr(i,s?.callee),i}return o.value},ma=fa(Xr),ha=e=>async(t,r,n,s)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const i=new(s?.Err??e)(o.issues.map(u=>Br(u,a,zr())));throw Hr(i,s?.callee),i}return o.value},ba=ha(Xr);function lr(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function pa(e,t){for(var r={};e.length;){var n=e[0],s=n.code,a=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var i=n.unionErrors[0].errors[0];r[o]={message:i.message,type:i.code}}else r[o]={message:a,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(m){return e.push(m)})}),t){var u=r[o].types,l=u&&u[n.code];r[o]=J.appendErrors(o,t,r,s,l?[].concat(l,n.message):n.message)}e.shift()}return r}function ga(e,t){for(var r={};e.length;){var n=e[0],s=n.code,a=n.message,o=n.path.join(".");if(!r[o])if(n.code==="invalid_union"&&n.errors.length>0){var i=n.errors[0][0];r[o]={message:i.message,type:i.code}}else r[o]={message:a,type:s};if(n.code==="invalid_union"&&n.errors.forEach(function(d){return d.forEach(function(m){return e.push(m)})}),t){var u=r[o].types,l=u&&u[n.code];r[o]=J.appendErrors(o,t,r,s,l?[].concat(l,n.message):n.message)}e.shift()}return r}function va(e,t,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,s,a){try{return Promise.resolve(lr(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(o){return a.shouldUseNativeValidation&&Ge.validateFieldsNatively({},a),{errors:{},values:r.raw?Object.assign({},n):o}})},function(o){if((function(i){return Array.isArray(i?.issues)})(o))return{values:{},errors:Ge.toNestErrors(pa(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,s,a){try{return Promise.resolve(lr(function(){return Promise.resolve((r.mode==="sync"?ma:ba)(e,n,t)).then(function(o){return a.shouldUseNativeValidation&&Ge.validateFieldsNatively({},a),{errors:{},values:r.raw?Object.assign({},n):o}})},function(o){if((function(i){return i instanceof da})(o))return{values:{},errors:Ge.toNestErrors(ga(o.issues,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}};throw new Error("Invalid input: not a Zod schema")}function xa({methods:e,onSubmit:t,onError:r,children:n,logErrors:s,className:a}){return c.jsx(J.FormProvider,{...e,children:c.jsx("form",{className:k("mt-4 lg:mt-8 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-8 relative",a),onSubmit:e.handleSubmit((o,i)=>t(o,i),o=>{s&&console.log(o),r?.(o)}),children:n})})}function wa(e,t){return J.useForm({resolver:va(e),defaultValues:t})}const Vr=({children:e,size:t=24,strokeWidth:r=2,viewBox:n="0 0 24 24",className:s,...a})=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:n,className:s,...a,children:e}),ya={solid:"bg-base-3 border border-base-4 drop-shadow-sm dark-theme:drop-shadow-none",outline:"border border-base-6"},ka={brand:"ring-1 ring-brand",solid:"ring-1 ring-base-6"},It=f.forwardRef(({label:e,description:t,labelPosition:r="default",color:n="solid",focusColor:s="brand",placeholder:a,valid:o,error:i,errorMessage:u,isPrice:l,prefix:d,wrapperClassName:m,containerClassName:h,className:p,type:b="text",value:v,...x},E)=>{const $=f.useRef(null),j=f.useRef(!1),[S,M]=f.useState(!1),[w,N]=f.useState(!1),O=b==="password",W=O&&S?"text":l?"number":b,C=v!==""&&v!==null&&v!==void 0;return f.useEffect(()=>{if(!j.current){j.current=!0;return}$.current&&gr($.current)},[S,$]),c.jsxs("div",{className:k("relative",m),children:[e&&r==="default"&&c.jsx("label",{className:k("font-medium ml-0.5 text-xs",i&&"text-red-9"),children:e}),c.jsxs("div",{className:k("rounded-6 transition cursor-text relative",ya[n],{"pt-[22px] pb-1.5":r==="floating",[ka[s]]:!i&&w,"bg-red-4 text-red-9":!!i,"ring-1 ring-red-9":!!i&&w},h),children:[e&&r==="floating"&&c.jsx("label",{className:k("absolute transition-all duration-200 pointer-events-none","text-sm top-[18px] font-semibold left-3",{"text-xs top-2.5":w||C||a,"text-red-9":!!i}),children:e}),l&&c.jsx(A.DollarSign,{size:16,className:k("absolute top-1/2 -translate-y-1/2 left-3",i?"text-red-9":"text-base-11")}),d&&c.jsx("p",{className:"text-sm text-base-11 absolute top-1/2 -translate-y-1/2 left-3",children:d}),c.jsx("input",{ref:g=>{E&&(typeof E=="function"?E(g):E.current=g),$.current=g},type:W,className:k("w-full bg-transparent focus-visible:outline-none","placeholder:text-sm text-sm placeholder:text-base-11",l||d?"pl-9":"pl-3",{"py-2.5":r==="default","mt-1.5":r==="floating","pr-10":o,"text-red-9 placeholder:text-red-9":!!i},p),value:v,placeholder:a,onFocus:()=>N(!0),onBlur:()=>N(!1),...x})]}),o?c.jsx(A.CheckIcon,{size:20,className:`absolute top-1/2 -translate-y-1/2 text-green-500 ${O?"right-10":"right-3"}`}):null,O&&c.jsx("button",{type:"button",className:k(r==="floating"?"absolute right-3 top-1/2 -translate-y-1/2":"absolute right-3 top-10"),onClick:()=>{M(!S)},children:S?c.jsx(A.EyeOffIcon,{size:20,className:k(i?"text-red-9":"text-base-11")}):c.jsx(A.Eye,{size:20,className:k(i?"text-red-9":"text-base-11")})}),u?c.jsx("span",{role:"alert",className:"text-red-9 text-sm mt-1 ml-0.5",children:u}):t?c.jsx("p",{className:"text-xs text-base-11 mt-1 ml-0.5",children:t}):null]})});It.displayName="Input";const Na=({name:e,customRead:t,customSet:r,withNullSet:n=!0,...s})=>{const{control:a}=J.useFormContext(),o=f.useCallback(u=>t?t(u):u===null?Pt(u):u,[t]),i=f.useCallback(u=>r?n&&u===null?rt(u):r(u):u===null?rt(u):u,[r]);return a?c.jsx(J.Controller,{name:e,control:a,render:({field:u,fieldState:l})=>c.jsx(It,{value:o(u.value),onChange:d=>u.onChange(i(d.target.value)),error:!!l.error,errorMessage:l.error?.message,ref:u.ref,...s})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},Kr=f.createContext(null),Ea=({children:e,value:t})=>c.jsx(Kr.Provider,{value:t,children:e}),Ca=()=>{const e=f.useContext(Kr);if(!e)throw new Error("useAliveScope must be wrapped within AliveScopeProvider");return e},ja=({children:e})=>{const[t,r]=f.useState({}),n=f.useRef({}),s=f.useRef({}),a=(i,u,l)=>{if(!t[i]){const d=document.createElement("div");return i&&(d.id=i),l&&(d.className=l),r(m=>({...m,[i]:{children:u,element:d}})),n.current[i]=[],s.current[i]=[],n.current&&n.current[i]&&n.current[i].forEach(m=>m(i)),d}return n.current&&n.current[i]&&n.current[i].forEach(d=>d(i)),t[i].element},o=i=>{r(u=>{const l={...u};return delete l[i],l}),s.current&&s.current[i]&&s.current[i].forEach(u=>u(i))};return c.jsxs(Ea,{value:{getPortalElement:a,dropPortalElement:o},children:[e,Object.entries(t).map(([i,{children:u,element:l}])=>c.jsx(Sa,{id:i,onMountCallbacks:n,onDropCallbacks:s,children:u,element:l},i))]})},Ur=f.createContext(null),$a=({children:e,value:t})=>c.jsx(Ur.Provider,{value:t,children:e}),Sa=f.memo(({id:e,onMountCallbacks:t,onDropCallbacks:r,children:n,element:s})=>{const a=(i,u={runOnFirstMount:!1})=>{f.useEffect(()=>{const l=()=>{if(document.getElementById(e))i(e);else{const m=new MutationObserver((h,p)=>{document.getElementById(e)&&(i(e),p.disconnect())});return m.observe(document.body,{childList:!0,subtree:!0}),()=>m.disconnect()}};return u?.runOnFirstMount&&l(),t.current[e].push(l),()=>{t.current[e]=t.current[e].filter(d=>d!==l)}},[])},o=i=>{f.useEffect(()=>(r.current[e].push(i),()=>{r.current[e]=r.current[e].filter(u=>u!==i)}),[])};return c.jsx($a,{value:{keepAliveId:e,onKeepAliveMount:a,onKeepAliveDrop:o},children:hr.createPortal(n,s,e)})}),Ta=()=>{const e=f.useContext(Ur);if(!e)throw new Error("useKeepAlive must be used within KeepAliveProvider");return e},Ma=({aliveKey:e,children:t,enabled:r=!0,...n})=>{const s=f.useRef(null),{getPortalElement:a}=Ca();return f.useEffect(()=>{const o=a(e,t,n.className);return r&&s.current&&s.current.replaceWith(o),()=>{}},[e,t,r,n]),c.jsx("div",{...n,ref:s,children:t})},Da=({lightSolid:e=!0,className:t,children:r,...n})=>c.jsx("div",{className:k("rounded-7 dark-theme:bg-base-3",e?"border-none bg-base-3":"border border-base-6 dark-theme:border-base-4",t),...n,children:r}),Pa=({onClick:e,lightSolid:t=!0,className:r,children:n})=>c.jsx("button",{onClick:e,className:k("w-full text-start first:rounded-t-7 last:rounded-b-7 border-b dark-theme:border-base-4","last:border-none px-3 pr-2.5 py-3 dark-theme:bg-base-3 lg:hover:bg-base-4 max-lg:active:bg-base-4","transition-colors hover:cursor-pointer flex items-center justify-between outline-none lg:focus-visible:ring-2 focus-visible:ring-base-6",t?"bg-base-3 border-base-4":"border-base-6",r),children:n}),Gr=({label:e,labelPosition:t="default",options:r,selectedValues:n,onChange:s,idExtractor:a,labelExtractor:o,customSetter:i,valid:u,error:l,placeholder:d="Select options...",maxSelections:m,searchable:h=!1,disabled:p=!1,className:b})=>{const[v,x]=f.useState(""),[E,$]=f.useState(!1),[j,S]=f.useState(-1),M=f.useRef(null),w=f.useRef(null),N=f.useRef([]),{triggerRef:O,triggerProps:W,popoverRef:C,getPopoverPosition:g,open:D,toggle:T,close:F}=ft({align:"start",side:"top",avoidCollisions:!1,onOpen:()=>{$(!0),h&&M.current&&setTimeout(()=>M.current?.focus(),10)},onClose:()=>{$(!1),x(""),S(-1)}}),Y=f.useRef(`multiselect-${Math.random().toString(36).substr(2,9)}`).current,X=f.useRef(`label-${Math.random().toString(36).substr(2,9)}`).current,R=f.useRef(`error-${Math.random().toString(36).substr(2,9)}`).current,y=f.useRef(`listbox-${Math.random().toString(36).substr(2,9)}`).current,V=i?n.map(P=>r.find(G=>a(G)===P||a(G)===a(P))).filter(Boolean):n,oe=V.length>0,U=h?r.filter(P=>o(P).toLowerCase().includes(v.toLowerCase())):r;f.useEffect(()=>{N.current=N.current.slice(0,U.length)},[U.length]);const re=P=>i?n.some(_=>_===a(P)||a(_)===a(P)):n.some(_=>a(_)===a(P)),Re=P=>{if(!p)if(re(P)){let _;if(i){const G=a(P);_=n.filter(we=>we!==G&&a(we)!==G)}else _=n.filter(G=>a(G)!==a(P));s(_),Ue(`Removed ${o(P)}`)}else{if(m&&V.length>=m){Ue(`Maximum of ${m} selections allowed`);return}let _;i?_=[...n,i(P)]:_=[...n,P],s(_),Ue(`Added ${o(P)}`)}},Ve=P=>{if(p)return;let _;if(i){const G=a(P);_=n.filter(we=>we!==G&&a(we)!==G)}else _=n.filter(G=>a(G)!==a(P));s(_),Ue(`Removed ${o(P)}`)},Ke=P=>{if(!p)switch(P.key){case"Enter":P.preventDefault(),D?j>=0&&Re(U[j]):T();break;case"Escape":P.preventDefault(),F();break;case"ArrowDown":if(P.preventDefault(),!D)T();else{const _=j>=U.length-1?0:j+1;S(_),N.current[_]?.scrollIntoView({block:"nearest"})}break;case"ArrowUp":if(P.preventDefault(),D){const _=j<=0?U.length-1:j-1;S(_),N.current[_]?.scrollIntoView({block:"nearest"})}break;case"Backspace":if(h&&v===""&&V.length>0){const _=V[V.length-1];Ve(_)}break}},un=P=>{x(P.target.value),S(-1)},dn=()=>{p||(h&&M.current&&M.current.focus(),T())},Ue=P=>{console.log(`Accessibility announcement: ${P}`)};dt(C,P=>{!O.current||!D||!P.target||O.current.contains(P.target)||F()});const vt=g();return c.jsxs("div",{className:k("relative",b),children:[c.jsxs("div",{className:"relative",ref:w,children:[t==="default"&&c.jsx("label",{className:k("top-[18px] font-medium ml-0.5 text-xs",l&&"text-red-9"),children:e}),c.jsxs("div",{ref:O,...W,className:k("relative rounded-6 px-2 transition cursor-pointer pr-10 min-h-[48px]","border border-base-4 light-theme:drop-shadow-sm dark-theme:bg-base-3",{"py-3":t==="default","pt-5 pb-2":t==="floating","ring-1 ring-brand":D||E,"text-red-9":l,"ring-2 ring-red-6":l&&(D||E),"opacity-60 cursor-not-allowed":p}),onClick:dn,role:"combobox","aria-expanded":D,"aria-haspopup":"listbox","aria-owns":y,"aria-labelledby":X,"aria-describedby":l?R:void 0,onKeyDown:Ke,tabIndex:p?-1:0,children:[t==="floating"&&c.jsxs("label",{id:X,htmlFor:Y,className:k("absolute transition-all duration-200 pointer-events-none","text-base top-4 font-semibold left-3",{"text-sm top-2 left-2":E||oe,"text-red-9":!!l}),children:[e," ",m&&`(${n.length}/${m})`]}),c.jsxs("div",{className:k("flex flex-wrap gap-2 items-center",{"mt-2.5":t==="floating"}),children:[V.map(P=>c.jsxs("div",{className:k("border border-base-4 dark-theme:border-base-5 dark-theme:bg-base-4 rounded-full px-2 py-1 text-sm flex items-center gap-1",{"bg-red-4 text-red-9":l}),children:[c.jsx("span",{className:"line-clamp-1",children:o(P)}),!p&&c.jsx("button",{type:"button",className:"hover:bg-brand/20 rounded-full p-0.5 transition-colors",onClick:_=>{_.stopPropagation(),Ve(P)},"aria-label":`Remove ${o(P)}`,children:c.jsx(A.XIcon,{size:12})})]},a(P))),h&&c.jsx("input",{ref:M,id:Y,type:"text",className:"flex-grow min-w-[60px] bg-transparent outline-none placeholder:text-sm",value:v,onChange:un,onKeyDown:Ke,placeholder:oe?"":d,disabled:p,"aria-autocomplete":"list","aria-controls":y,autoComplete:"off"}),!h&&!oe&&c.jsx("span",{className:"text-secondarytext text-sm flex-grow",children:d})]}),c.jsxs("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-2",children:[u&&c.jsx(A.CheckIcon,{size:16,className:"text-green-600"}),c.jsx(A.ChevronDownIcon,{size:16,className:k("transition-transform text-base-11",{"rotate-180":D})})]})]})]}),c.jsx(L.AnimatePresence,{children:D&&c.jsx($e,{children:c.jsx(L.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.15},ref:C,style:{position:"fixed",left:vt.x,top:vt.top,bottom:vt.bottom,width:w.current?.offsetWidth??200},className:k("bg-base-1 dark-theme:bg-base-3 border border-base-4","rounded-6 shadow-lg max-h-[300px] overflow-y-auto z-50","customscrollbarnohide"),role:"listbox",id:y,"aria-labelledby":X,children:U.length===0?c.jsx("div",{className:"px-3 py-2 text-sm text-secondarytext",children:v?"No results found":"No options available"}):U.map((P,_)=>{const G=re(P),we=_===j;return c.jsxs("div",{ref:fn=>{N.current[_]=fn},className:k("px-3 py-2 text-sm cursor-pointer flex items-center justify-between","first:rounded-t-6 last:rounded-b-6",{"bg-base-3 dark-theme:bg-base-4":we,"bg-brandfadedbg text-brand":G}),onClick:()=>Re(P),role:"option","aria-selected":G,onMouseEnter:()=>S(_),children:[c.jsx("span",{children:o(P)}),G&&c.jsx(A.CheckIcon,{size:16})]},a(P))})})})}),l&&c.jsx("p",{id:R,className:"text-red-9 text-xs mt-1","aria-live":"assertive",children:l}),c.jsx("div",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:V.length>0?`Selected: ${V.map(o).join(", ")}`:"No selections"})]})},Oa=({name:e,...t})=>{const{control:r}=J.useFormContext();return r?c.jsx(J.Controller,{name:e,control:r,render:({field:n,fieldState:s})=>c.jsx(Gr,{selectedValues:n.value||[],onChange:a=>n.onChange(a),error:s.error?.message,...t})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},La=({id:e,tabPage:t,absolute:r=!0,navBar:n,children:s,onRefresh:a,style:o,className:i,contentClassName:u,bounceBackDuration:l=300,showScrollbar:d=!0,onScroll:m})=>{const h=f.useRef(null),p=f.useRef(null),b=f.useRef(null),v=f.useRef(null),x=f.useRef(null),[E,$]=f.useState(!1),j=f.useRef(null),S=f.useRef({startY:0,currentY:0,maxScroll:0,lastTimestamp:0,frameCallback:null,isScrolling:!1,pullDistance:0,refreshThreshold:50,isPullingToRefresh:!1}),M=qe(),w=f.useCallback(Fe(()=>{h.current&&p.current&&(S.current.maxScroll=Math.max(0,p.current.offsetHeight-h.current.offsetHeight))}),[]),N=f.useCallback(R=>{const{maxScroll:y}=S.current;return R>0?Math.pow(R,.8):R<-y?-y-Math.pow(-(R+y),.8):R},[]),O=f.useCallback(()=>{if(!d||!h.current||!v.current)return;const{currentY:R,maxScroll:y}=S.current,H=h.current.offsetHeight,V=Math.max(30,H/(H+y)*H),oe=H-V;let U=-R/y*oe,re=1;R>0?(U=0,re=1-R/H,v.current.style.transformOrigin="top"):R<-y?(U=oe,re=1-Math.abs(R+y)/H,v.current.style.transformOrigin="bottom"):v.current.style.transformOrigin="top",v.current.style.transform=`translate3d(0, ${U}px, 0) scaleY(${re})`,v.current.style.height=`${V}px`},[d]),W=f.useCallback(R=>{if(S.current.currentY=R,p.current&&(p.current.style.transform=`translate3d(0, ${R}px, 0)`),b.current){const y=Math.max(R-S.current.refreshThreshold,-S.current.refreshThreshold);b.current.style.transform=`translate3d(0, ${y}px, 0)`}m&&m(R),O()},[O]),C=f.useCallback(R=>{const y=S.current;y.frameCallback&&(L.cancelFrame(y.frameCallback),y.frameCallback=null);const H=performance.now(),V=y.currentY,oe=R-V,U=()=>{const re=performance.now()-H,Re=Math.min(re/l,1),Ve=1-Math.pow(1-Re,3),Ke=V+oe*Ve;W(Ke),Re>=1&&(y.frameCallback&&(L.cancelFrame(y.frameCallback),y.frameCallback=null),W(R),R===0&&b.current&&(b.current.textContent="Pull to refresh"))};y.frameCallback=L.frame.render(U,!0)},[W,l]),g=f.useCallback(R=>{const y=S.current;y.frameCallback&&(L.cancelFrame(y.frameCallback),y.frameCallback=null);let H=R,V=Date.now();const oe=()=>{const U=Date.now(),re=U-V;if(V=U,H*=Math.pow(.95,re/16),y.currentY+=H*re,y.currentY>0||y.currentY<-y.maxScroll){y.frameCallback&&(L.cancelFrame(y.frameCallback),y.frameCallback=null),C(y.currentY>0?0:-y.maxScroll);return}W(y.currentY),Math.abs(H)<.01&&y.frameCallback&&(L.cancelFrame(y.frameCallback),y.frameCallback=null)};y.frameCallback=L.frame.render(oe,!0)},[W,C]),D=f.useCallback(()=>{if(!d||!v.current)return;x.current!==null&&clearTimeout(x.current),requestAnimationFrame(()=>{v.current&&(v.current.style.opacity="1")});const R=window.requestIdleCallback||(y=>setTimeout(y,1e3));x.current=window.setTimeout(()=>{R(()=>{v.current&&(v.current.style.opacity="0"),x.current=null})},1e3)},[d]),T=f.useCallback(R=>{if(j.current!==null&&Date.now()-j.current<50)return;j.current=Date.now();const y=S.current;y.isScrolling=!0,y.startY=y.currentY,y.lastTimestamp=Date.now(),y.isPullingToRefresh=y.currentY===0,y.pullDistance=0,y.frameCallback&&(L.cancelFrame(y.frameCallback),y.frameCallback=null),D()},[D]),F=f.useCallback(R=>{const y=S.current;if(!y.isScrolling)return;const H=N(y.startY+R.deltaY);y.isPullingToRefresh&&H<y.startY&&(y.isPullingToRefresh=!1),W(H),a&&y.isPullingToRefresh&&!E&&H>0&&(y.pullDistance=H,b.current&&(b.current.textContent=y.pullDistance>y.refreshThreshold?"Release to refresh":"Pull to refresh")),D()},[a,W,E,D,N]),Y=f.useCallback(R=>{const y=S.current;y.isScrolling&&(y.isScrolling=!1,a&&y.isPullingToRefresh&&!E&&y.pullDistance>y.refreshThreshold?X():y.currentY>0||y.currentY<-y.maxScroll?C(y.currentY>0?0:-y.maxScroll):g(R.velocityY),y.isPullingToRefresh=!1)},[a,g,C,E]),X=f.useCallback(()=>{$(!0),C(S.current.refreshThreshold),b.current&&(b.current.textContent="Refreshing..."),a&&a().then(()=>{$(!1),C(0)})},[a,C]);return f.useEffect(()=>{if(!h.current)return;const R=br.createGesture(h.current,{name:"page-scroller-gesture",priority:10,passive:!0,direction:"y",onStart:T,onMove:F,onEnd:Y});return R.init(),()=>R.destroy()},[T,F,Y]),f.useEffect(()=>{if(h.current)return w(),O(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),x.current!==null&&clearTimeout(x.current)}},[w,O]),c.jsxs(L.motion.div,{id:e,ref:h,initial:{x:t||M?0:window.innerWidth,y:M?20:void 0,opacity:M&&!t?0:1},animate:{x:M||t?void 0:0,y:M?0:void 0,opacity:1,transition:{ease:[.32,.72,0,1],duration:M?.34:.44,delay:.2}},exit:{x:M||t?void 0:window.innerWidth+80,y:M?20:0,opacity:M?0:1,transition:{duration:M?.34:.6,ease:[.32,.72,0,1]}},style:{overflow:"hidden",position:r?"absolute":"relative",...o},className:k("top-0 right-0 h-full w-full bg-base-1 isolate will-change-transform",i),children:[a&&c.jsx("div",{ref:b,style:{position:"absolute",top:n?48:0,left:0,width:"100%",textAlign:"center",height:"50px",lineHeight:"50px",transform:"translateY(-50px)"},children:"Pull to refresh"}),c.jsx("div",{ref:p,style:{position:"absolute",top:0,left:0,width:"100%",willChange:"transform"},className:u,children:s}),n,d&&c.jsx("div",{ref:v,style:{position:"absolute",top:2,right:2,width:6,borderRadius:3,opacity:0,transition:"opacity 0.2s",willChange:"transform"},className:"bg-base-3"})]},`scroller${e}`)};function Fa({id:e,showScrollbar:t=!0,onRefresh:r,bounceBackDuration:n=300,isolate:s=!1,onScroll:a}){const o=f.useRef(null),i=f.useRef(null),u=f.useRef(null),l=f.useRef(null),d=f.useRef(null),[m,h]=f.useState(!1),p=f.useRef(null),b=f.useRef({startY:0,currentY:0,maxScroll:0,lastTimestamp:0,frameCallback:null,isScrolling:!1,pullDistance:0,refreshThreshold:50,isPullingToRefresh:!1}),v=f.useCallback(Fe(()=>{o.current&&i.current&&(b.current.maxScroll=Math.max(0,i.current.offsetHeight-o.current.offsetHeight))}),[]),x=f.useCallback(C=>{const{maxScroll:g}=b.current;return C>0?Math.pow(C,.8):C<-g?-g-Math.pow(-(C+g),.8):C},[]),E=f.useCallback(()=>{if(!t||!o.current||!l.current)return;const{currentY:C,maxScroll:g}=b.current,D=o.current.offsetHeight,T=Math.max(30,D/(D+g)*D),F=D-T;let Y=-C/g*F,X=1;C>0?(Y=0,X=1-C/D,l.current.style.transformOrigin="top"):C<-g?(Y=F,X=1-Math.abs(C+g)/D,l.current.style.transformOrigin="bottom"):l.current.style.transformOrigin="top",l.current.style.transform=`translate3d(0, ${Y}px, 0) scaleY(${X})`,l.current.style.height=`${T}px`},[t]),$=f.useCallback(C=>{if(b.current.currentY=C,i.current&&(i.current.style.transform=`translate3d(0, ${C}px, 0)`),u.current){const g=Math.max(C-b.current.refreshThreshold,-b.current.refreshThreshold);u.current.style.transform=`translate3d(0, ${g}px, 0)`}a&&a(C),E()},[E]),j=f.useCallback(C=>{const g=b.current;g.frameCallback&&(L.cancelFrame(g.frameCallback),g.frameCallback=null);const D=performance.now(),T=g.currentY,F=C-T,Y=()=>{const X=performance.now()-D,R=Math.min(X/n,1),y=1-Math.pow(1-R,3),H=T+F*y;$(H),R>=1&&(g.frameCallback&&(L.cancelFrame(g.frameCallback),g.frameCallback=null),$(C))};g.frameCallback=L.frame.render(Y,!0)},[$,n]),S=f.useCallback(C=>{const g=b.current;g.frameCallback&&(L.cancelFrame(g.frameCallback),g.frameCallback=null);let D=C,T=Date.now();const F=()=>{const Y=Date.now(),X=Y-T;if(T=Y,D*=Math.pow(.95,X/16),g.currentY+=D*X,g.currentY>0||g.currentY<-g.maxScroll){g.frameCallback&&(L.cancelFrame(g.frameCallback),g.frameCallback=null),j(g.currentY>0?0:-g.maxScroll);return}$(g.currentY),Math.abs(D)<.01&&g.frameCallback&&(L.cancelFrame(g.frameCallback),g.frameCallback=null)};g.frameCallback=L.frame.render(F,!0)},[$,j]),M=f.useCallback(()=>{if(!t||!l.current)return;d.current!==null&&clearTimeout(d.current),requestAnimationFrame(()=>{l.current&&(l.current.style.opacity="1")});const C=window.requestIdleCallback||(g=>setTimeout(g,1e3));d.current=window.setTimeout(()=>{C(()=>{l.current&&(l.current.style.opacity="0"),d.current=null})},1e3)},[t]),w=f.useCallback(C=>{if(p.current!==null&&Date.now()-p.current<50)return;p.current=Date.now();const g=b.current;g.isScrolling=!0,g.startY=g.currentY,g.lastTimestamp=Date.now(),g.isPullingToRefresh=g.currentY===0,g.pullDistance=0,g.frameCallback&&(L.cancelFrame(g.frameCallback),g.frameCallback=null),M()},[M]),N=f.useCallback(C=>{const g=b.current;if(!g.isScrolling)return;const D=x(g.startY+C.deltaY);g.isPullingToRefresh&&D<g.startY&&(g.isPullingToRefresh=!1),$(D),r&&g.isPullingToRefresh&&!m&&D>0&&(g.pullDistance=D),M()},[r,$,m,M,x]),O=f.useCallback(()=>{h(!0),j(b.current.refreshThreshold),r&&r().then(()=>{h(!1),j(0)})},[r,j]),W=f.useCallback(C=>{const g=b.current;g.isScrolling&&(g.isScrolling=!1,r&&g.isPullingToRefresh&&!m&&g.pullDistance>g.refreshThreshold?O():g.currentY>0||g.currentY<-g.maxScroll?j(g.currentY>0?0:-g.maxScroll):S(C.velocityY),g.isPullingToRefresh=!1)},[r,S,j,m,O]);return f.useEffect(()=>{if(!o.current)return;const C=br.createGesture(o.current,{name:"page-scroller-gesture",priority:10,passive:!0,direction:"y",onStart:w,onMove:N,onEnd:W});return C.init(),()=>C.destroy()},[w,N,W]),f.useEffect(()=>{if(o.current)return v(),E(),window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v),d.current!==null&&clearTimeout(d.current)}},[v,E]),{container:{props:{id:e,ref:o,key:`scroller${e||"default"}`},classNames:`will-change-transform overflow-hidden ${s?"isolate":""}`},content:{props:{ref:i},styles:{position:"absolute",top:0,left:0,width:"100%",willChange:"transform"}},pullToRefresh:{props:{ref:u},styles:{position:"absolute",top:0,left:0,width:"100%",textAlign:"center",height:"50px",lineHeight:"50px",transform:"translateY(-50px)"}},scrollbar:{props:{ref:l}},refreshing:m,updateMaxScroll:v,rubberBandEffect:x,updateScrollbarPosition:E,setPosition:$}}const Ra={2:"text-2xl",4:"text-4xl",5:"text-5xl",6:"text-6xl"},Aa=({title:e,description:t,size:r="6",descriptionClassName:n,className:s})=>c.jsxs("div",{className:k("text-center",s),children:[c.jsx("p",{className:`${Ra[r]} font-medium`,children:e}),t?c.jsx("p",{className:k("mt-6 text-base-11",n),children:t}):null]}),Wa=f.forwardRef(({placeholder:e="Buscar",value:t,exposedRef:r,autoFocus:n,onClear:s,onChange:a,className:o,onMount:i,error:u},l)=>{const d=f.useRef(null),m=qe(),h=Ot(d,l),p=f.useCallback(()=>r&&r(d),[]);return f.useEffect(()=>{const b=async()=>{i&&await i(d,m)};p(),b()},[]),c.jsxs("div",{className:k("rounded-6 relative flex items-center bg-base-3 border-base-5",{"dark-theme:bg-red-4 light-theme:border-red-9":u,"dark-theme:bg-base-3":!u},o),children:[c.jsx("input",{ref:h,placeholder:e,value:t,onChange:a,autoComplete:"off",autoCorrect:"off",type:"search",autoFocus:n?n(m):void 0,className:k("w-full py-1.5 pl-10 pr-3 bg-transparent outline-none text-base-12 placeholder:text-base-11 [&::-webkit-search-cancel-button]:appearance-none",u&&"text-red-9 placeholder:text-red-9")}),c.jsx(A.Search,{size:20,className:k("absolute left-3 text-base-11 pointer-events-none",{"text-red-9":u})}),s&&t&&t.length>0?c.jsx("button",{onClick:()=>{s(),d.current?.focus()},className:k("absolute right-2.5 rounded-full",u?"text-red-9":"text-base-11"),children:c.jsx(A.X,{size:20})}):null]})}),ur=({el:e,direction:t,amount:r=200,multiplier:n=.4,speed:s="normal"})=>{if(!e)return;const a=t==="up"||t==="down",o=a?e.scrollTop:e.scrollLeft,i=a?e.scrollHeight-e.clientHeight:e.scrollWidth-e.clientWidth;let u;r==="max"?u=i:u=r??(a?e.clientHeight:e.clientWidth)*n;let l;if(t==="right"||t==="down"?l=Math.min(o+u,i):l=Math.max(o-u,0),l===o)return;const d={fast:.15,normal:.4,slow:.8};L.animate(0,1,{duration:d[s],ease:"easeOut",onUpdate:m=>{if(!e)return;const h=o+(l-o)*m;a?e.scrollTop=h:e.scrollLeft=h}})},_a={default:[.32,.72,0,1]},dr={initial:{opacity:0},animate:{opacity:1,transition:{ease:_a.default,duration:.3}},exit:{opacity:0,transition:{ease:[.32,.72,0,1],duration:.3}}},Qr=new Set,Q=new WeakMap,Pe=new WeakMap,je=new WeakMap,Mt=new WeakMap,Ya=new WeakMap,Oe=new WeakMap,ct=new WeakMap,We=new WeakSet;let xe,zt=0,Ht=0;const me="__aa_tgt",He="__aa_del",lt="__aa_new",Ia=e=>{const t=Va(e);t&&t.forEach(r=>Ka(r))},za=e=>{e.forEach(t=>{t.target===xe&&Ba(),Q.has(t.target)&&Se(t.target)})};function Ha(e){Mt.get(e)?.disconnect();let r=Q.get(e),n=0;const s=5;r||(r=Le(e),Q.set(e,r));const{offsetWidth:a,offsetHeight:o}=xe,u=[r.top-s,a-(r.left+s+r.width),o-(r.top+s+r.height),r.left-s].map(d=>`${-1*Math.floor(d)}px`).join(" "),l=new IntersectionObserver(()=>{++n>1&&Se(e)},{root:xe,threshold:1,rootMargin:u});l.observe(e),Mt.set(e,l)}function Se(e){clearTimeout(ct.get(e));const t=gt(e),r=Be(t)?500:t.duration;ct.set(e,setTimeout(async()=>{const n=je.get(e);try{await n?.finished,Q.set(e,Le(e)),Ha(e)}catch{}},r))}function Ba(){clearTimeout(ct.get(xe)),ct.set(xe,setTimeout(()=>{Qr.forEach(e=>tn(e,t=>Jr(()=>Se(t))))},100))}function qa(e){setTimeout(()=>{Ya.set(e,setInterval(()=>Jr(Se.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function Jr(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let Dt,ut;const Xa=typeof window<"u"&&"ResizeObserver"in window;Xa&&(xe=document.documentElement,Dt=new MutationObserver(Ia),ut=new ResizeObserver(za),window.addEventListener("scroll",()=>{Ht=window.scrollY,zt=window.scrollX}),ut.observe(xe));function Va(e){return e.reduce((n,s)=>[...n,...Array.from(s.addedNodes),...Array.from(s.removedNodes)],[]).every(n=>n.nodeName==="#comment")?!1:e.reduce((n,s)=>{if(n===!1)return!1;if(s.target instanceof Element){if(Nt(s.target),!n.has(s.target)){n.add(s.target);for(let a=0;a<s.target.children.length;a++){const o=s.target.children.item(a);if(o){if(He in o)return!1;Nt(s.target,o),n.add(o)}}}if(s.removedNodes.length)for(let a=0;a<s.removedNodes.length;a++){const o=s.removedNodes[a];if(He in o)return!1;o instanceof Element&&(n.add(o),Nt(s.target,o),Pe.set(o,[s.previousSibling,s.nextSibling]))}}return n},new Set)}function Nt(e,t){!t&&!(me in e)?Object.defineProperty(e,me,{value:e}):t&&!(me in t)&&Object.defineProperty(t,me,{value:e})}function Ka(e){const t=e.isConnected,r=Q.has(e);t&&Pe.has(e)&&Pe.delete(e),je.has(e)&&je.get(e)?.cancel(),lt in e?fr(e):r&&t?Ga(e):r&&!t?Qa(e):fr(e)}function ae(e){return Number(e.replace(/[^0-9.\-]/g,""))}function Ua(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}function Le(e){const t=e.getBoundingClientRect(),{x:r,y:n}=Ua(e);return{top:t.top+n,left:t.left+r,width:t.width,height:t.height}}function Zr(e,t,r){let n=t.width,s=t.height,a=r.width,o=r.height;const i=getComputedStyle(e);if(i.getPropertyValue("box-sizing")==="content-box"){const l=ae(i.paddingTop)+ae(i.paddingBottom)+ae(i.borderTopWidth)+ae(i.borderBottomWidth),d=ae(i.paddingLeft)+ae(i.paddingRight)+ae(i.borderRightWidth)+ae(i.borderLeftWidth);n-=d,a-=d,s-=l,o-=l}return[n,a,s,o].map(Math.round)}function gt(e){return me in e&&Oe.has(e[me])?Oe.get(e[me]):{duration:250,easing:"ease-in-out"}}function en(e){if(me in e)return e[me]}function Bt(e){const t=en(e);return t?We.has(t):!1}function tn(e,...t){t.forEach(r=>r(e,Oe.has(e)));for(let r=0;r<e.children.length;r++){const n=e.children.item(r);n&&t.forEach(s=>s(n,Oe.has(n)))}}function qt(e){return Array.isArray(e)?e:[e]}function Be(e){return typeof e=="function"}function Ga(e){const t=Q.get(e),r=Le(e);if(!Bt(e))return Q.set(e,r);let n;if(!t)return;const s=gt(e);if(typeof s!="function"){const a=t.left-r.left,o=t.top-r.top,[i,u,l,d]=Zr(e,t,r),m={transform:`translate(${a}px, ${o}px)`},h={transform:"translate(0, 0)"};s.fromBorderRadius!==void 0&&s.toBorderRadius!==void 0&&(m.borderRadius=`${s.fromBorderRadius}px`,h.borderRadius=`${s.toBorderRadius}px`),i!==u&&(m.width=`${i}px`,h.width=`${u}px`),l!==d&&(m.height=`${l}px`,h.height=`${d}px`),n=e.animate([m,h],{duration:s.duration,easing:s.easing})}else{const[a]=qt(s(e,"remain",t,r));n=new Animation(a),n.play()}je.set(e,n),Q.set(e,r),n.addEventListener("finish",Se.bind(null,e))}function fr(e){lt in e&&delete e[lt];const t=Le(e);Q.set(e,t);const r=gt(e);if(!Bt(e))return;let n;if(typeof r!="function")n=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:r.duration*1.5,easing:"ease-in"});else{const[s]=qt(r(e,"add",t));n=new Animation(s),n.play()}je.set(e,n),n.addEventListener("finish",Se.bind(null,e))}function mr(e,t){e.remove(),Q.delete(e),Pe.delete(e),je.delete(e),Mt.get(e)?.disconnect(),setTimeout(()=>{if(He in e&&delete e[He],Object.defineProperty(e,lt,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const r in t)e.style[r]=""},0)}function Qa(e){if(!Pe.has(e)||!Q.has(e))return;const[t,r]=Pe.get(e);Object.defineProperty(e,He,{value:!0,configurable:!0});const n=window.scrollX,s=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):t&&t.parentNode?t.parentNode.appendChild(e):en(e)?.appendChild(e),!Bt(e))return mr(e);const[a,o,i,u]=Za(e),l=gt(e),d=Q.get(e);(n!==zt||s!==Ht)&&Ja(e,n,s,l);let m,h={position:"absolute",top:`${a}px`,left:`${o}px`,width:`${i}px`,height:`${u}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Be(l))Object.assign(e.style,h),m=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:l.duration,easing:"ease-out"});else{const[p,b]=qt(l(e,"remove",d));b?.styleReset!==!1&&(h=b?.styleReset||h,Object.assign(e.style,h)),m=new Animation(p),m.play()}je.set(e,m),m.addEventListener("finish",mr.bind(null,e,h))}function Ja(e,t,r,n){const s=zt-t,a=Ht-r,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(xe).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+s,window.scrollY+a),!e.parentElement)return;const u=e.parentElement;let l=u.clientHeight,d=u.clientWidth;const m=performance.now();function h(){requestAnimationFrame(()=>{if(!Be(n)){const p=l-u.clientHeight,b=d-u.clientWidth;m+n.duration>performance.now()?(window.scrollTo({left:window.scrollX-b,top:window.scrollY-p}),l=u.clientHeight,d=u.clientWidth,h()):document.documentElement.style.scrollBehavior=o}})}h()}function Za(e){const t=Q.get(e),[r,,n]=Zr(e,t,Le(e));let s=e.parentElement;for(;s&&(getComputedStyle(s).position==="static"||s instanceof HTMLBodyElement);)s=s.parentElement;s||(s=document.body);const a=getComputedStyle(s),o=Q.get(s)||Le(s),i=Math.round(t.top-o.top)-ae(a.borderTopWidth),u=Math.round(t.left-o.left)-ae(a.borderLeftWidth);return[i,u,r,n]}function rn(e,t={}){return Dt&&ut&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Be(t)&&!t.disrespectUserMotionPreference||(We.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),tn(e,Se,qa,s=>ut?.observe(s)),Be(t)?Oe.set(e,t):Oe.set(e,{duration:250,easing:"ease-in-out",...t}),Dt.observe(e,{childList:!0}),Qr.add(e))),Object.freeze({parent:e,enable:()=>{We.add(e)},disable:()=>{We.delete(e)},isEnabled:()=>We.has(e)})}const pe={rounded:{3:"rounded-3",6:"rounded-6",full:"rounded-full"},colors:{solid:"bg-base-3",brand:"bg-brand text-brand-text",contrast:"bg-base-12 text-base-1"},unselectedColors:{none:"",solid:"bg-bg-uiel"},border:{solid:"border-base-6 dark-theme:border-base-5",subtle:"border-base-5 dark-theme:border-base-4",brand:"border-brand-border"},widths:{fit:{container:"max-w-fit",item:"w-fit"},full:{container:"w-full",item:"grow"}}},ei=({options:e,selected:t,onChange:r,keyExtractor:n,labelExtractor:s,itemColor:a,itemClassName:o,color:i="contrast",unselectedColor:u="none",width:l="fit",border:d="solid",rounded:m=6,trackScroll:h=!0,className:p})=>{const[b,v]=f.useState({left:!1,right:!1}),{ref:x}=xr({onOverflow:E=>{v({left:E.canScrollLeft,right:E.canScrollRight})},trackScroll:h});return c.jsxs("div",{className:k("relative overflow-hidden",pe.widths[l].container,pe.rounded[m],p),children:[c.jsx("div",{ref:x,className:k("flex items-center border overflow-x-scroll scrollbar-hide",pe.rounded[m],pe.border[d]),children:e.map(E=>{const $=n(t)===n(E);return c.jsx("button",{onClick:()=>r?.(E),className:k("border-r px-3 py-1 last:border-none text-nowrap shrink-0",pe.widths[l].item,!$&&"lg:hover:bg-overlay-3",a?a($):$?pe.colors[i]:pe.unselectedColors[u],pe.border[d],o),children:s(E)},n(E))})}),c.jsxs(L.AnimatePresence,{children:[b.left?c.jsx(L.motion.button,{variants:dr,initial:"initial",animate:"animate",exit:"exit",onClick:()=>{x.current&&ur({el:x.current,direction:"left"})},className:"absolute shrink-0 left-0 px-1 h-full bg-gradient-to-r from-base-2 top-0",children:c.jsx(A.ChevronLeft,{className:"text-base-13"})},"leftarrow"):null,b.right?c.jsx(L.motion.button,{variants:dr,initial:"initial",animate:"animate",exit:"exit",onClick:()=>{x.current&&ur({el:x.current,direction:"right"})},className:"absolute shrink-0 right-0 px-1 h-full bg-gradient-to-l from-base-2 top-0",children:c.jsx(A.ChevronRight,{className:"text-base-13"})},"rightarrow"):null]})]})};function nn({label:e,labelPosition:t="default",options:r,selected:n,onChange:s,idExtractor:a,labelExtractor:o,descriptionExtractor:i,classNameExtractor:u,customGetter:l,customSetter:d,error:m,placeholder:h="Selecciona una opción",searchable:p,className:b}){const[v,x]=f.useState(-1),E=f.useRef(null),{triggerRef:$,triggerProps:j,popoverRef:S,getPopoverPosition:M,open:w,toggle:N,close:O}=ft({align:"start",side:"bottom",avoidCollisions:!0,onOpen:()=>{p&&E.current&&setTimeout(()=>E.current?.focus(),10)},onClose:()=>{x(-1)}});dt(S,g=>{!$.current||!w||!g.target||$.current.contains(g.target)||O()});const W=M(),C=l&&n?l(n,r):n;return c.jsxs("div",{className:k("relative",b),children:[t==="default"&&c.jsx("label",{className:k("top-[18px] font-medium ml-0.5 text-xs",m&&"text-red-9"),children:e}),c.jsxs(q,{ref:$,color:"solidhybrid",className:"w-full justify-between",onClick:N,...j,children:[C?o(C):h,c.jsx(A.ChevronDown,{size:18,className:k("transition",w&&"rotate-180")})]}),c.jsx(L.AnimatePresence,{children:w&&c.jsx($e,{children:c.jsx(L.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.15},ref:S,style:{position:"fixed",left:W.x,top:W.top,bottom:W.bottom,width:$.current?.offsetWidth??200},className:k("bg-base-1 dark-theme:bg-base-3 border border-base-4","rounded-6 shadow-lg max-h-[300px] overflow-y-auto z-50","customscrollbarnohide"),role:"listbox",children:r.map((g,D)=>{const T=!!(C&&a(g)===a(C)),F=D===v,Y=i?.(g);return c.jsxs("div",{className:k("px-3 py-2 text-sm cursor-pointer flex items-center justify-between gap-x-4","first:rounded-t-6 last:rounded-b-6 relative",F&&"bg-base-3 dark-theme:bg-base-4",T&&"bg-brandfadedbg text-brand",u&&u(T)),onClick:()=>{s(d?d(g):g),O()},role:"option",onMouseEnter:()=>x(D),children:[c.jsxs("div",{children:[c.jsxs("p",{children:[o(g)," "]}),Y&&c.jsx("p",{className:"text-xs text-base-11 mt-0.5 line-clamp-2",children:Y})]}),T&&c.jsx(A.CheckIcon,{size:16,className:"shrink-0"})]},a(g))})})})})]})}const ti=({name:e,...t})=>{const{control:r}=J.useFormContext();return r?c.jsx(J.Controller,{name:e,control:r,render:({field:n,fieldState:s})=>c.jsx(nn,{selected:n.value??null,onChange:a=>n.onChange(a),error:s.error?.message,...t})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},ri=({className:e})=>c.jsx("div",{className:k("w-full h-px bg-base-4",e)}),ni=({text:e,length:t=120,size:r="sm",className:n,buttonClassName:s})=>{const[a,o]=f.useState(!1),i=f.useMemo(()=>e.length>t,[e]),u=f.useMemo(()=>i?a?e:e.slice(0,t).trim()+"...":e,[e,a,i]);return c.jsxs("div",{children:[c.jsx("p",{className:k("text-base-12",r==="sm"&&"text-sm",n),children:u}),i?c.jsx("button",{onClick:()=>o(l=>!l),className:k("text-xs text-base-11",s),children:a?"Ver menos":"Ver más"}):null]})},Xt=({loading:e=!0,wrapperClassName:t,spinnerClassName:r})=>c.jsx("div",{className:k("flex justify-center",t),children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",className:k({"animate-spin":e},r),children:c.jsx("path",{fill:"currentColor",d:"M10 3a7 7 0 0 0-7 7a.5.5 0 0 1-1 0a8 8 0 1 1 8 8a.5.5 0 0 1 0-1a7 7 0 1 0 0-14Z"})})}),si=({isEditable:e,isDeletable:t=!0,createUpdateLoading:r,deleteLoading:n,onDelete:s,onDeleteConfirm:a,addText:o="Añadir",updateText:i="Actualizar",deleteText:u="Eliminar",className:l})=>{const[d,m]=f.useState(!1);return c.jsxs("div",{className:`w-full grid grid-cols-2 gap-4 col-span-full ${l}`,children:[e&&t?c.jsxs(q,{color:"dangersolid",state:n?"loading":r?"disabled":"enabled",onClick:()=>{a?d?s?.():m(!0):s?.()},children:[c.jsx(A.X,{size:18}),a&&d?"Confirmar":u]}):null,c.jsxs(q,{color:"brand",className:k(e&&t?"":"col-span-2"),state:r?"loading":n?"disabled":"enabled",type:"submit",children:[r?c.jsx(Xt,{}):e?c.jsx(A.Check,{size:18}):c.jsx(A.Plus,{size:18}),e?i:o]})]})},sn=f.createContext(void 0),oi=({children:e,debug:t=!1})=>{const r=f.useRef([]),n=f.useCallback(d=>{r.current.push(d),t&&console.log("Modal",d,"added",r.current)},[t]),s=f.useCallback(d=>{r.current=r.current.filter(m=>m!==d),t&&console.log("Modal",d,"removed",r.current)},[t]),a=f.useCallback(()=>{const d=r.current[r.current.length-2];return t&&console.log("prev modal id",d),d},[t]),o=f.useCallback((d,m="modal",h)=>{L.animate(d,{y:m==="modal"?-30:-50,scale:.9},{ease:[.32,.72,0,1],duration:.3,delay:h?.2:void 0})},[]),i=f.useCallback(d=>{L.animate(d,{y:0,scale:1},{ease:[.32,.72,0,1],duration:.2})},[]),u=f.useCallback(()=>r.current,[]),l={add:n,remove:s,getPrevId:a,animateParentModal:o,restoreParentModal:i,getModals:u};return c.jsx(sn.Provider,{value:l,children:e})},on=()=>{const e=f.useContext(sn);if(e===void 0)throw new Error("useModals must be used within a ModalsProvider");return e},ai=({withPortal:e,children:t})=>e?c.jsx($e,{children:t}):c.jsx(c.Fragment,{children:t}),ii=({id:e,prevPath:t,withDelay:r,withPortal:n=!0,title:s,description:a,showHeader:o=!0,mode:i,onReplace:u,className:l,contentClassName:d,children:m})=>{const h=de.useInitialChangeEvent(),p=qe(),b=f.useRef(null),v=on(),x=f.useMemo(()=>i==="modal"||p,[i,p]);return f.useEffect(()=>{v.add(e);const E=v.getPrevId();if(!E||(b.current=document.getElementById(E),!b.current))return;E&&v.animateParentModal(b.current,x?"modal":"sheet");//! cleanups not running on new router system
|
|
11
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),f=require("react"),br=require("react-dom"),bn=require("clsx"),pn=require("tailwind-merge"),gn=require("@mateosuarezdev/atoms"),A=require("lucide-react"),O=require("framer-motion"),de=require("@mateosuarezdev/react-router"),J=require("react-hook-form"),Ge=require("@hookform/resolvers"),pr=require("@mateosuarezdev/gestures"),vn=require("@mateosuarezdev/event-emitter"),k=(...e)=>pn.twMerge(bn.clsx(e));function Fe(e,t=100){let r=null,n=null;return function(...s){const a=Date.now();r===null||a-r>=t?(e.apply(this,s),r=a):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(this,s),r=Date.now()},t-(a-r)))}}function xn(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n),r=null},t)}}function gr(e){if(!e)return"";const r=e.trim().replace(/\s+/g," ").split(" ");return r.length===0||r[0]===""?"":r.length===1?r[0].charAt(0).toUpperCase():(r[0].charAt(0)+r[1].charAt(0)).toUpperCase()}function vr(e){e.focus();const t=e.value.length;e.setSelectionRange(t,t)}function xr(e){return e.replace(/\s/g,"")}function wn(e){return e.toLowerCase().split(" ").map(s=>{if(s.length===0)return s;const a=[...s][0],o=s.slice(a.length);return a.toUpperCase()+o}).join(" ")}function Pt(e){return e===null?"":e}function rt(e){return xr(e)===""?null:e}function yn(e,t,r={}){const n={...r};return Object.keys(t).forEach(s=>{if(t[s]===!0&&s in e){const a=s;n[a]=e[a]}}),n}class kn{constructor(){this.container=null,this.previouslyFocusedElement=null}enable(){this.container&&(this.previouslyFocusedElement=document.activeElement,this.container.addEventListener("keydown",this.trapFocus.bind(this)),document.addEventListener("click",this.handleClickOutside.bind(this)))}disable(){this.container&&(this.container.removeEventListener("keydown",this.trapFocus.bind(this)),document.removeEventListener("click",this.handleClickOutside.bind(this)),this.previouslyFocusedElement&&this.previouslyFocusedElement.focus&&this.previouslyFocusedElement.focus())}setContainer(t){this.disable(),this.container=t,this.enable()}trapFocus(t){const r=this.container?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!r)return;const n=r[0],s=r[r.length-1];t.key==="Tab"&&(t.shiftKey&&document.activeElement===n?(t.preventDefault(),s.focus()):!t.shiftKey&&document.activeElement===s&&(t.preventDefault(),n.focus()))}handleClickOutside(t){this.container&&!this.container.contains(t.target)&&(t.preventDefault(),this.previouslyFocusedElement&&this.previouslyFocusedElement.focus&&this.previouslyFocusedElement.focus())}}const _e=e=>{const t=e.scrollWidth>e.clientWidth,r=e.scrollHeight>e.clientHeight,n=Math.max(0,e.scrollWidth-e.clientWidth),s=Math.max(0,e.scrollHeight-e.clientHeight);return{horizontal:t,vertical:r,scrollWidth:e.scrollWidth,clientWidth:e.clientWidth,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,canScrollLeft:e.scrollLeft>10,canScrollRight:e.scrollLeft<n-10,canScrollUp:e.scrollTop>0,canScrollDown:e.scrollTop<s,scrollPercentageX:t&&n>0?e.scrollLeft/n*100:0,scrollPercentageY:r&&s>0?e.scrollTop/s*100:0}},wr=({onOverflow:e,trackScroll:t=!1,withObserver:r=!1,enabled:n=!0,deps:s=[]}={})=>{const a=f.useRef(null);return f.useEffect(()=>{if(!a.current||!n)return;let o=!1;const u=Fe(()=>{if(a.current){const h=_e(a.current);e?.(h)}}),l=_e(a.current);o=l.horizontal||l.vertical,e?.(l),window.addEventListener("resize",u);let d=null;r&&(d=new ResizeObserver(u),a.current&&d.observe(a.current));let m=null;return t&&o&&(m=a.current,m.addEventListener("scroll",u)),()=>{window.removeEventListener("resize",u),d&&d.disconnect(),m&&o&&m.removeEventListener("scroll",u)}},[n,...s]),{ref:a}},Nn=({trackScroll:e=!1,withObserver:t=!1,enabled:r=!0,deps:n=[]}={})=>{const s=f.useRef(null),[a,o]=f.useState(null);return f.useEffect(()=>{if(!s.current||!r)return;let i=!1;const l=Fe(()=>{if(s.current){const p=_e(s.current);o(p)}}),d=_e(s.current);i=d.horizontal||d.vertical,o(d),window.addEventListener("resize",l);let m=null;t&&(m=new ResizeObserver(l),s.current&&m.observe(s.current));let h=null;return e&&i&&(h=s.current,h.addEventListener("scroll",l)),()=>{window.removeEventListener("resize",l),m&&m.disconnect(),h&&i&&h.removeEventListener("scroll",l)}},[r,...n]),{ref:s,overflowInfo:a}},xt={xs:"w-8 h-8",sm:"w-10 h-10 text-lg",md:"w-14 h-14 text-xl",lg:"h-20 w-20 text-2xl",xl:"h-24 w-24 text-2xl"},En=({src:e,name:t,size:r="md",className:n})=>e?c.jsx("img",{alt:"avatar",src:e,className:k("rounded-full bg-base-3",xt[r])}):t?c.jsx("p",{className:k("rounded-full font-medium dark-theme:bg-base-3 border border-base-6 dark-theme:border-base-4 flex items-center justify-center",xt[r],n),children:gr(t)}):c.jsx("div",{className:k("rounded-full text-2xl font-medium flex items-center justify-center","bg-base-2 dark-theme:bg-base-3 border border-base-4","lg:hover:bg-base-3 max-lg:active:bg-base-4 transition-colors",xt[r],n),children:c.jsxs(Kr,{size:r==="xs"?16:r==="sm"?20:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),c.jsx("circle",{cx:"12",cy:"7",r:"4"})]})});function jn({className:e,children:t,animate:r=!1,...n}){return c.jsx("div",{className:k("flex -space-x-3 rtl:space-x-reverse",e),...n,children:t})}function Cn(e){const t=f.useRef(null);return f.useEffect(()=>{const r=n=>{t.current&&!t.current.contains(n.target)&&e()};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[e]),t}function $n(e,t={}){const{enabled:r=!0,events:n=["mousedown","touchstart"],excludeRefs:s=[]}=t,a=f.useRef(null);return f.useEffect(()=>{if(!r)return;const o=i=>{const u=i.target;a.current?.contains(u)||s.some(d=>d.current?.contains(u))||e()};return n.forEach(i=>{document.addEventListener(i,o)}),()=>{n.forEach(i=>{document.removeEventListener(i,o)})}},[e,r,n,s]),a}function dt(e,t,r=!0){f.useEffect(()=>{if(!r)return;const n=s=>{e.current&&!e.current.contains(s.target)&&t(s)};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[e,t,r])}function yr(e,{target:t=window,event:r="keydown",enabled:n}={}){const s=f.useRef(e);f.useEffect(()=>{s.current=e},[e]),f.useEffect(()=>{if(!n)return;const a=o=>{const i=o.key,u=s.current[i];u&&u(o)};return t.addEventListener(r,a),()=>{t.removeEventListener(r,a)}},[t,r,n])}function Sn(e){return f.useSyncExternalStore(t=>e.subscribe(t),()=>e.get(),()=>e.get())}const Et=gn.atom(typeof window<"u"?window.innerWidth>1024:!0);let wt=!1;const Ut=Fe(()=>{Et.set(window.innerWidth>1024)});typeof window<"u"&&(wt&&(window.removeEventListener("resize",Ut),wt=!1),window.addEventListener("resize",Ut),wt=!0);const qe=()=>(f.useLayoutEffect(()=>{Et.set(window.innerWidth>1024)},[]),Sn(Et));function Tn({onLongPress:e,onTap:t,threshold:r=500,startDelay:n=200,moveThreshold:s=10}={}){const a=f.useRef(null),o=f.useRef(void 0),i=f.useRef({x:0,y:0}),u=f.useRef(!1),l=f.useRef(!1),d=f.useRef(!1);return f.useEffect(()=>{const m=a.current;if(!m)return;function h(C,S,M,w){const N=C-M,L=S-w;return Math.sqrt(N*N+L*L)}function p(C){if(C.touches.length!==1)return;const S=C.touches[0];i.current={x:S.clientX,y:S.clientY},u.current=!1,l.current=!0,setTimeout(()=>{l.current&&(o.current=setTimeout(()=>{l.current&&(u.current=!0,e?.(C))},r))},n)}function b(C){if(C.touches.length!==1)return;const S=C.touches[0];h(S.clientX,S.clientY,i.current.x,i.current.y)>s&&(l.current=!1,clearTimeout(o.current))}function v(C){clearTimeout(o.current),!u.current&&l.current&&t?.(C),l.current=!1}function x(C){C.button===0&&(d.current=!0)}function E(C){C.button!==0||!d.current||(d.current=!1,t?.(C))}function $(C){C.preventDefault()}return m.addEventListener("touchstart",p),m.addEventListener("touchmove",b),m.addEventListener("touchend",v),m.addEventListener("mousedown",x),m.addEventListener("mouseup",E),m.addEventListener("contextmenu",$),()=>{clearTimeout(o.current),m.removeEventListener("touchstart",p),m.removeEventListener("touchmove",b),m.removeEventListener("touchend",v),m.removeEventListener("mousedown",x),m.removeEventListener("mouseup",E),m.removeEventListener("contextmenu",$)}},[e,t,r,n,s]),a}function Lt(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}const Mn=()=>{const[e,t]=f.useState(navigator.onLine);return f.useEffect(()=>{const r=()=>t(!0),n=()=>t(!1),s=new AbortController;return window.addEventListener("online",r,{signal:s.signal}),window.addEventListener("offline",n,{signal:s.signal}),()=>s.abort()},[]),e},ft=({scrollerId:e,align:t="start",side:r="bottom",offset:n=8,collisionPadding:s=8,avoidCollisions:a=!0,closeOnScroll:o=!0,onOpen:i,onClose:u}={})=>{const[l,d]=f.useState(!1),[m,h]=f.useState({width:192,height:300}),p=f.useRef(null),b=f.useRef(null),v=f.useRef({left:0,right:0,top:0,bottom:0,x:0,y:0,width:0,height:0}),x=f.useRef(null),E=f.useId(),$=f.useCallback(w=>{const N=w??v.current;if(!N)return{x:0,top:0,bottom:void 0};const L=m.width,W=m.height;return kr({triggerRect:N,popoverWidth:L,popoverHeight:W,align:t,side:r,offset:n,collisionPadding:s,avoidCollisions:a})},[v.current,m,t,r]);f.useEffect(()=>{if(!l||!e||(x.current=document.getElementById(e),!x.current))return;l&&C();const w=()=>{x.current&&(d(!1),i?.(),x.current.removeEventListener("scroll",w))};return o&&x.current.addEventListener("scroll",w,{passive:!0}),()=>{x.current&&x.current.removeEventListener("scroll",w)}},[l,e]);const C=()=>{b.current&&h({width:b.current.offsetWidth,height:b.current.offsetHeight})},S=f.useCallback(()=>{if(!p.current)return;const w=p.current.getBoundingClientRect();v.current={left:w.left,right:w.right,top:w.top,bottom:w.bottom,x:w.x,y:w.y,width:w.width,height:w.height},d(N=>(N?u?.():i?.(),!N))},[]),M=f.useCallback(()=>{d(!1),u?.()},[]);return{triggerRef:p,triggerProps:{id:E,"aria-expanded":l,"aria-haspopup":!0},popoverRef:b,getPopoverPosition:$,open:l,toggle:S,close:M}},kr=({triggerRect:e,popoverWidth:t,popoverHeight:r,align:n="start",side:s="bottom",offset:a=4,collisionPadding:o=8,avoidCollisions:i=!0})=>{const u={width:window.innerWidth,height:window.innerHeight};let l=0,d=0;if(i){if(s==="right"){const p=e.right+a,b=e.left-t-a,v=Math.max(0,p+t-(u.width-o)),x=Math.max(0,o-b);v<=x?(l=p,v>0&&(l=u.width-t-o)):(l=b,x>0&&(l=o)),d=e.top,d+r>u.height-o&&(d=u.height-r-o),d<o&&(d=o)}else if(s==="left"){const p=e.left-t-a,b=e.right+a,v=Math.max(0,o-p),x=Math.max(0,b+t-(u.width-o));v<=x?(l=p,v>0&&(l=o)):(l=b,x>0&&(l=u.width-t-o)),d=e.top,d+r>u.height-o&&(d=u.height-r-o),d<o&&(d=o)}else if(s==="bottom"){const p=u.height-e.bottom,b=e.top;p>=r+a?d=e.bottom+a:b>=r+a?d=e.top-r-a:(d=e.bottom+a,d=Math.min(d,u.height-r-o));const v=u.width-e.left,x=e.right;if(n==="start")l=e.left,l+t>u.width-o&&(x>=t?l=e.right-t:l=u.width-t-o);else if(n==="end")l=e.right-t,l<o&&(v>=t?l=e.left:l=o);else{const E=e.left+e.width/2-t/2;E>=o&&E+t<=u.width-o?l=E:E<o?l=o:l=u.width-t-o}}else{const p=e.top,b=u.height-e.bottom;p>=r+a?d=e.top-r-a:b>=r+a?d=e.bottom+a:(d=e.top-r-a,d=Math.max(o,d));const v=u.width-e.left,x=e.right;if(n==="start")l=e.left,l+t>u.width-o&&(x>=t?l=e.right-t:l=u.width-t-o);else if(n==="end")l=e.right-t,l<o&&(v>=t?l=e.left:l=o);else{const E=e.left+e.width/2-t/2;E>=o&&E+t<=u.width-o?l=E:E<o?l=o:l=u.width-t-o}}l=Math.max(o,Math.min(l,u.width-t-o)),d=Math.max(o,Math.min(d,u.height-r-o))}else s==="right"?(l=e.right+a,d=e.top):s==="left"?(l=e.left-t-a,d=e.top):s==="bottom"?d=e.bottom+a:d=e.top-r-a,(s==="top"||s==="bottom")&&(n==="start"?l=e.left:n==="end"?l=e.right-t:l=e.left+e.width/2-t/2);let m,h;return d+r<=e.top?h=window.innerHeight-(d+r):m=d,{x:l,top:m,bottom:h}},Nr=(e=!0,t)=>{const r=qe(),n=f.useRef(null),s=f.useCallback(a=>{if(!e||r)return;const o=n.current;if(!o)return;const i=o.getBoundingClientRect(),u=Math.max(i.width,i.height),l=a.clientX-i.left-u/2,d=a.clientY-i.top-u/2,m=document.createElement("span");m.classList.add("ripple-wrapper");const h=document.createElement("span");h.classList.add("ripple"),h.style.backgroundColor=t?"var(--ripple-contrast)":"var(--ripple-main)",h.style.width=`${u}px`,h.style.height=`${u}px`,h.style.left=`${l}px`,h.style.top=`${d}px`,m.appendChild(h);const p=o.getElementsByClassName("ripple-wrapper");if(p?.length)for(const b of p)b.remove();o.appendChild(m),setTimeout(()=>{m.remove()},700)},[e,r,t]);return{ref:n,ripple:s,styles:{position:"relative"}}},Dn="relative shrink-0 select-none transition outline-none duration-200 ease-out focus-visible:ring-border-brand-light flex items-center justify-center cursor-pointer",Pn={xs:"text-xs px-1 gap-x-1 py-1",sm:"text-sm px-2.5 gap-x-1 py-1.5",mdsm:"text-sm px-3 gap-x-1.5 py-2.5",md:"text-base px-4 gap-x-1.5 py-2.5",lg:"text-base px-4 gap-x-1.5 py-3.5",picker:"text-base px-2 py-2 gap-x-1.5",iconXs:"text-xs p-1",iconSm:"text-sm p-2",iconMd:"text-base p-3",iconLg:"text-base p-4"},Ln={all:"focus-visible:ring-1",desktop:"lg:focus-visible:ring-1",mobile:"focus-visible:ring-1 lg:focus-ring-0",none:""},On={light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},Fn={none:"rounded-none",1:"rounded-1",2:"rounded-2",3:"rounded-3",4:"rounded-4",5:"rounded-5",6:"rounded-6",7:"rounded-7",8:"rounded-8",9:"rounded-9",10:"rounded-10",11:"rounded-11",12:"rounded-12",full:"rounded-full"},Rn={transparent:"text-base-12 lg:hover:bg-base-4 focus-visible:ring-base-6",transparentinactive:"text-base-11 lg:hover:bg-base-4",brand:"bg-brand text-brand-text lg:hover:bg-brand-hover focus-visible:ring-base-6 border border-transparent",accent:"bg-accent text-accent-text lg:hover:bg-accent-hover",contrast:"bg-base-12 text-base-1 lg:hover:bg-base-11 focus-visible:ring-base-6",solid:"bg-base-3 dark-theme:bg-base-3 lg:hover:bg-base-4 border border-base-4 focus-visible:ring-base-5",solidhybrid:"border border-base-5 dark-theme:border-base-4 dark-theme:bg-base-3 lg:hover:bg-base-4 focus-visible:ring-base-6",outline:"border border-base-6 lg:hover:bg-base-3 focus-visible:ring-base-6",info:"bg-blue-3 text-blue-9 lg:hover:bg-blue-4 lg:active:bg-blue-5 focus-visible:ring-blue-9 border border-transparent",success:"bg-green-4 text-green-9 lg:hover:bg-green-5 lg:active:bg-green-6 focus-visible:ring-green-9 border border-transparent",warning:"bg-yellow-4 text-yellow-9 lg:hover:bg-yellow-5 lg:active:bg-yellow-6 focus-visible:ring-yellow-9 border border-transparent",danger:"bg-red-4 text-red-9 lg:hover:bg-red-5 focus-visible:ring-red-9 border border-transparent",dangersolid:"bg-red-9 text-base-1 dark-theme:text-base-12 lg:hover:bg-red-8 focus-visible:ring-base-6 border border-transparent",disabled:"bg-base-3 text-base-11 border border-transparent"},An={enabled:"",disabled:"opacity-75",loading:""},q=f.forwardRef(({color:e="transparent",size:t="mdsm",fontWeight:r="normal",rounded:n="6",state:s="enabled",onClick:a,className:o,children:i,withRipple:u=!0,contrastRipple:l,showFocus:d="desktop",withDisabledDelay:m=!1,type:h="button",...p},b)=>{const[v,x]=f.useState(!1),E=M=>{s==="enabled"&&(m?(x(!0),a&&a(M),setTimeout(()=>x(!1),1e3)):a&&a(M))},{ref:$,ripple:C}=Nr(u,e==="contrast"||l),S=Lt($,b);return c.jsx("button",{ref:S,type:h,disabled:p.disabled?p.disabled:s==="disabled"||s==="loading",onMouseDown:C,onClick:M=>v?null:E(M),className:k(Dn,Pn[t],On[r],Fn[n],Ln[d],Rn[e],An[s],p.disabled&&"opacity-50",o),...p,children:i})});q.displayName="Button";const Er=6048e5,Wn=864e5,Gt=Symbol.for("constructDateFrom");function se(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Gt in e?e[Gt](t):e instanceof Date?new e.constructor(t):new Date(t)}function Z(e,t){return se(t||e,e)}function et(e,t,r){const n=Z(e,r?.in);if(isNaN(t))return se(e,NaN);if(!t)return n;const s=n.getDate(),a=se(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);const o=a.getDate();return s>=o?a:(n.setFullYear(a.getFullYear(),a.getMonth(),s),n)}let In={};function mt(){return In}function Ye(e,t){const r=mt(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Z(e,t?.in),a=s.getDay(),o=(a<n?7:0)+a-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function nt(e,t){return Ye(e,{...t,weekStartsOn:1})}function jr(e,t){const r=Z(e,t?.in),n=r.getFullYear(),s=se(r,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const a=nt(s),o=se(r,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const i=nt(o);return r.getTime()>=a.getTime()?n+1:r.getTime()>=i.getTime()?n:n-1}function Qt(e){const t=Z(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function ht(e,...t){const r=se.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function st(e,t){const r=Z(e,t?.in);return r.setHours(0,0,0,0),r}function _n(e,t,r){const[n,s]=ht(r?.in,e,t),a=st(n),o=st(s),i=+a-Qt(a),u=+o-Qt(o);return Math.round((i-u)/Wn)}function Yn(e,t){const r=jr(e,t),n=se(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),nt(n)}function yt(e,t,r){const[n,s]=ht(r?.in,e,t);return+st(n)==+st(s)}function zn(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Hn(e){return!(!zn(e)&&typeof e!="number"||isNaN(+Z(e)))}function Bn(e,t){const r=Z(e,t?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function qn(e,t){const[r,n]=ht(e,t.start,t.end);return{start:r,end:n}}function Xn(e,t){const{start:r,end:n}=qn(t?.in,e);let s=+r>+n;const a=s?+r:+n,o=s?n:r;o.setHours(0,0,0,0);let i=1;const u=[];for(;+o<=a;)u.push(se(r,o)),o.setDate(o.getDate()+i),o.setHours(0,0,0,0);return s?u.reverse():u}function Vn(e,t){const r=Z(e,t?.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Kn(e,t){const r=Z(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const Un={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Gn=(e,t,r)=>{let n;const s=Un[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function De(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Qn={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Jn={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Zn={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},es={date:De({formats:Qn,defaultWidth:"full"}),time:De({formats:Jn,defaultWidth:"full"}),dateTime:De({formats:Zn,defaultWidth:"full"})},ts={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},rs=(e,t,r,n)=>ts[e];function ce(e){return(t,r)=>{const n=r?.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,i=r?.width?String(r.width):o;s=e.formattingValues[i]||e.formattingValues[o]}else{const o=e.defaultWidth,i=r?.width?String(r.width):e.defaultWidth;s=e.values[i]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return s[a]}}const ns={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ss={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},os={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},as={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},is={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},cs={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ls=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},us={ordinalNumber:ls,era:ce({values:ns,defaultWidth:"wide"}),quarter:ce({values:ss,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ce({values:os,defaultWidth:"wide"}),day:ce({values:as,defaultWidth:"wide"}),dayPeriod:ce({values:is,defaultWidth:"wide",formattingValues:cs,defaultFormattingWidth:"wide"})};function le(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(s);if(!a)return null;const o=a[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(i)?fs(i,m=>m.test(o)):ds(i,m=>m.test(o));let l;l=e.valueCallback?e.valueCallback(u):u,l=r.valueCallback?r.valueCallback(l):l;const d=t.slice(o.length);return{value:l,rest:d}}}function ds(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function fs(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Cr(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=r.valueCallback?r.valueCallback(o):o;const i=t.slice(s.length);return{value:o,rest:i}}}const ms=/^(\d+)(th|st|nd|rd)?/i,hs=/\d+/i,bs={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ps={any:[/^b/i,/^(a|c)/i]},gs={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vs={any:[/1/i,/2/i,/3/i,/4/i]},xs={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ws={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ys={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ks={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Es={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},js={ordinalNumber:Cr({matchPattern:ms,parsePattern:hs,valueCallback:e=>parseInt(e,10)}),era:le({matchPatterns:bs,defaultMatchWidth:"wide",parsePatterns:ps,defaultParseWidth:"any"}),quarter:le({matchPatterns:gs,defaultMatchWidth:"wide",parsePatterns:vs,defaultParseWidth:"any",valueCallback:e=>e+1}),month:le({matchPatterns:xs,defaultMatchWidth:"wide",parsePatterns:ws,defaultParseWidth:"any"}),day:le({matchPatterns:ys,defaultMatchWidth:"wide",parsePatterns:ks,defaultParseWidth:"any"}),dayPeriod:le({matchPatterns:Ns,defaultMatchWidth:"any",parsePatterns:Es,defaultParseWidth:"any"})},$r={code:"en-US",formatDistance:Gn,formatLong:es,formatRelative:rs,localize:us,match:js,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Cs(e,t){const r=Z(e,t?.in);return _n(r,Kn(r))+1}function $s(e,t){const r=Z(e,t?.in),n=+nt(r)-+Yn(r);return Math.round(n/Er)+1}function Sr(e,t){const r=Z(e,t?.in),n=r.getFullYear(),s=mt(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,o=se(t?.in||e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const i=Ye(o,t),u=se(t?.in||e,0);u.setFullYear(n,0,a),u.setHours(0,0,0,0);const l=Ye(u,t);return+r>=+i?n+1:+r>=+l?n:n-1}function Ss(e,t){const r=mt(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=Sr(e,t),a=se(t?.in||e,0);return a.setFullYear(s,0,n),a.setHours(0,0,0,0),Ye(a,t)}function Ts(e,t){const r=Z(e,t?.in),n=+Ye(r,t)-+Ss(r,t);return Math.round(n/Er)+1}function Y(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const be={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Y(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Y(r+1,2)},d(e,t){return Y(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Y(e.getHours()%12||12,t.length)},H(e,t){return Y(e.getHours(),t.length)},m(e,t){return Y(e.getMinutes(),t.length)},s(e,t){return Y(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return Y(s,t.length)}},Te={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Jt={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return be.y(e,t)},Y:function(e,t,r,n){const s=Sr(e,n),a=s>0?s:1-s;if(t==="YY"){const o=a%100;return Y(o,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):Y(a,t.length)},R:function(e,t){const r=jr(e);return Y(r,t.length)},u:function(e,t){const r=e.getFullYear();return Y(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Y(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Y(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return be.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Y(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=Ts(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):Y(s,t.length)},I:function(e,t,r){const n=$s(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Y(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):be.d(e,t)},D:function(e,t,r){const n=Cs(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Y(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),a=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Y(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),a=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Y(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return Y(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=Te.noon:n===0?s=Te.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=Te.evening:n>=12?s=Te.afternoon:n>=4?s=Te.morning:s=Te.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return be.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):be.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Y(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Y(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):be.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):be.s(e,t)},S:function(e,t){return be.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return er(n);case"XXXX":case"XX":return ye(n);case"XXXXX":case"XXX":default:return ye(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return er(n);case"xxxx":case"xx":return ye(n);case"xxxxx":case"xxx":default:return ye(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Zt(n,":");case"OOOO":default:return"GMT"+ye(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Zt(n,":");case"zzzz":default:return"GMT"+ye(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return Y(n,t.length)},T:function(e,t,r){return Y(+e,t.length)}};function Zt(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),a=n%60;return a===0?r+String(s):r+String(s)+t+Y(a,2)}function er(e,t){return e%60===0?(e>0?"-":"+")+Y(Math.abs(e)/60,2):ye(e,t)}function ye(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Y(Math.trunc(n/60),2),a=Y(n%60,2);return r+s+t+a}const tr=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Tr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ms=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return tr(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",tr(n,t)).replace("{{time}}",Tr(s,t))},Ds={p:Tr,P:Ms},Ps=/^D+$/,Ls=/^Y+$/,Os=["D","DD","YY","YYYY"];function Fs(e){return Ps.test(e)}function Rs(e){return Ls.test(e)}function As(e,t,r){const n=Ws(e,t,r);if(console.warn(n),Os.includes(e))throw new RangeError(n)}function Ws(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Is=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_s=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ys=/^'([^]*?)'?$/,zs=/''/g,Hs=/[a-zA-Z]/;function Ee(e,t,r){const n=mt(),s=r?.locale??n.locale??$r,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Z(e,r?.in);if(!Hn(i))throw new RangeError("Invalid time value");let u=t.match(_s).map(d=>{const m=d[0];if(m==="p"||m==="P"){const h=Ds[m];return h(d,s.formatLong)}return d}).join("").match(Is).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const m=d[0];if(m==="'")return{isToken:!1,value:Bs(d)};if(Jt[m])return{isToken:!0,value:d};if(m.match(Hs))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:d}});s.localize.preprocessor&&(u=s.localize.preprocessor(i,u));const l={firstWeekContainsDate:a,weekStartsOn:o,locale:s};return u.map(d=>{if(!d.isToken)return d.value;const m=d.value;(!r?.useAdditionalWeekYearTokens&&Rs(m)||!r?.useAdditionalDayOfYearTokens&&Fs(m))&&As(m,t,String(e));const h=Jt[m[0]];return h(i,m,s.localize,l)}).join("")}function Bs(e){const t=e.match(Ys);return t?t[1].replace(zs,"'"):e}function rr(e,t,r){const[n,s]=ht(r?.in,e,t);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()}function kt(e,t,r){return et(e,-t,r)}const qs={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},Xs=(e,t,r)=>{let n;const s=qs[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"en "+n:"hace "+n:n},Vs={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},Ks={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Us={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Gs={date:De({formats:Vs,defaultWidth:"full"}),time:De({formats:Ks,defaultWidth:"full"}),dateTime:De({formats:Us,defaultWidth:"full"})},Qs={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},Js={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},Zs=(e,t,r,n)=>t.getHours()!==1?Js[e]:Qs[e],eo={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},to={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},ro={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},no={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},so={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},oo={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},ao=(e,t)=>Number(e)+"º",io={ordinalNumber:ao,era:ce({values:eo,defaultWidth:"wide"}),quarter:ce({values:to,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:ce({values:ro,defaultWidth:"wide"}),day:ce({values:no,defaultWidth:"wide"}),dayPeriod:ce({values:so,defaultWidth:"wide",formattingValues:oo,defaultFormattingWidth:"wide"})},co=/^(\d+)(º)?/i,lo=/\d+/i,uo={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},fo={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},mo={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},ho={any:[/1/i,/2/i,/3/i,/4/i]},bo={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},po={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},go={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},vo={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},xo={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},wo={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},yo={ordinalNumber:Cr({matchPattern:co,parsePattern:lo,valueCallback:function(e){return parseInt(e,10)}}),era:le({matchPatterns:uo,defaultMatchWidth:"wide",parsePatterns:fo,defaultParseWidth:"any"}),quarter:le({matchPatterns:mo,defaultMatchWidth:"wide",parsePatterns:ho,defaultParseWidth:"any",valueCallback:e=>e+1}),month:le({matchPatterns:bo,defaultMatchWidth:"wide",parsePatterns:po,defaultParseWidth:"any"}),day:le({matchPatterns:go,defaultMatchWidth:"wide",parsePatterns:vo,defaultParseWidth:"any"}),dayPeriod:le({matchPatterns:xo,defaultMatchWidth:"any",parsePatterns:wo,defaultParseWidth:"any"})},ze={code:"es",formatDistance:Xs,formatLong:Gs,formatRelative:Zs,localize:io,match:yo,options:{weekStartsOn:1,firstWeekContainsDate:1}},ue=typeof document<"u"?f.useLayoutEffect:()=>{},K=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},ot=e=>e&&"window"in e&&e.window===e?e:K(e).defaultView||window;function ko(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function No(e){return ko(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Eo=!1;function bt(){return Eo}function nr(e,t){if(!bt())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let r=t;for(;r!==null;){if(r===e)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:No(r)?r=r.host:r=r.parentNode}return!1}const ne=(e=document)=>{var t;if(!bt())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(!((t=r.shadowRoot)===null||t===void 0)&&t.activeElement);)r=r.shadowRoot.activeElement;return r};function Me(e){return bt()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class jo{get currentNode(){return this._currentNode}set currentNode(t){if(!nr(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const r=[];let n=t,s=t;for(this._currentNode=t;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const o=n,i=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});r.push(i),i.currentNode=s,this._currentSetFor.add(i),n=s=o.host}else n=n.parentNode;const a=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});r.push(a),a.currentNode=s,this._currentSetFor.add(a),this._walkerStack=r}get doc(){return this._doc}firstChild(){let t=this.currentNode,r=this.nextNode();return nr(t,r)?(r&&(this.currentNode=r),r):(this.currentNode=t,null)}lastChild(){let r=this._walkerStack[0].lastChild();return r&&(this.currentNode=r),r}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var r;let s;if(typeof this.filter=="function"?s=this.filter(t):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(s=this.filter.acceptNode(t)),s===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let a=this.nextNode();return a&&(this.currentNode=a),a}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.nextNode();return n&&(this.currentNode=n),n}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let s=this.previousNode();return s&&(this.currentNode=s),s}else return null;return null}const r=t.previousNode();if(r){if(r.shadowRoot){var n;let a;if(typeof this.filter=="function"?a=this.filter(r):!((n=this.filter)===null||n===void 0)&&n.acceptNode&&(a=this.filter.acceptNode(r)),a===NodeFilter.FILTER_ACCEPT)return r&&(this.currentNode=r),r;let o=this.lastChild();return o&&(this.currentNode=o),o}return r&&(this.currentNode=r),r}else if(this._walkerStack.length>1){this._walkerStack.shift();let s=this.previousNode();return s&&(this.currentNode=s),s}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(t,r,n,s){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=o=>{if(o.nodeType===Node.ELEMENT_NODE){const u=o.shadowRoot;if(u){const l=this._doc.createTreeWalker(u,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(l),NodeFilter.FILTER_ACCEPT}else{var i;if(typeof this.filter=="function")return this.filter(o);if(!((i=this.filter)===null||i===void 0)&&i.acceptNode)return this.filter.acceptNode(o);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=r,this.filter=s??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=r,this._walkerStack.unshift(t.createTreeWalker(r,n,this._acceptNode));const a=r.shadowRoot;if(a){const o=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(o)}}}function Co(e,t,r,n){return bt()?new jo(e,t,r,n):e.createTreeWalker(t,r,n)}function sr(e){if($o())e.focus({preventScroll:!0});else{let t=So(e);e.focus(),To(t)}}let Qe=null;function $o(){if(Qe==null){Qe=!1;try{document.createElement("div").focus({get preventScroll(){return Qe=!0,!0}})}catch{}}return Qe}function So(e){let t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}function To(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}function pt(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let r=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(r)&&r.some(n=>e.test(n.brand))||e.test(window.navigator.userAgent)}function Ot(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function he(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const Ft=he(function(){return Ot(/^Mac/i)}),Mo=he(function(){return Ot(/^iPhone/i)}),Do=he(function(){return Ot(/^iPad/i)||Ft()&&navigator.maxTouchPoints>1}),Po=he(function(){return Mo()||Do()});he(function(){return Ft()||Po()});he(function(){return pt(/AppleWebKit/i)&&!Mr()});const Mr=he(function(){return pt(/Chrome/i)}),Dr=he(function(){return pt(/Android/i)});he(function(){return pt(/Firefox/i)});let ge=new Map,jt=new Set;function or(){if(typeof window>"u")return;function e(n){return"propertyName"in n}let t=n=>{if(!e(n)||!n.target)return;let s=ge.get(n.target);s||(s=new Set,ge.set(n.target,s),n.target.addEventListener("transitioncancel",r,{once:!0})),s.add(n.propertyName)},r=n=>{if(!e(n)||!n.target)return;let s=ge.get(n.target);if(s&&(s.delete(n.propertyName),s.size===0&&(n.target.removeEventListener("transitioncancel",r),ge.delete(n.target)),ge.size===0)){for(let a of jt)a();jt.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",r)}typeof document<"u"&&(document.readyState!=="loading"?or():document.addEventListener("DOMContentLoaded",or));function Lo(){for(const[e]of ge)"isConnected"in e&&!e.isConnected&&ge.delete(e)}function Oo(e){requestAnimationFrame(()=>{Lo(),ge.size===0?e():jt.add(e)})}function Fo(e){return e.pointerType===""&&e.isTrusted?!0:Dr()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}const Ro=typeof Element<"u"&&"checkVisibility"in Element.prototype;function Ao(e){const t=ot(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:r,visibility:n}=e.style,s=r!=="none"&&n!=="hidden"&&n!=="collapse";if(s){const{getComputedStyle:a}=e.ownerDocument.defaultView;let{display:o,visibility:i}=a(e);s=o!=="none"&&i!=="hidden"&&i!=="collapse"}return s}function Wo(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Rt(e,t){return Ro?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&Ao(e)&&Wo(e,t)&&(!e.parentElement||Rt(e.parentElement,e))}const At=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Io=At.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";At.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const _o=At.join(':not([hidden]):not([tabindex="-1"]),');function Yo(e){return e.matches(Io)&&Rt(e)&&!Pr(e)}function zo(e){return e.matches(_o)&&Rt(e)&&!Pr(e)}function Pr(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}let Ho=!1,Xe=null,Bo=new Set,Ie=new Map,je=!1,Ct=!1;function Wt(e,t){for(let r of Bo)r(e,t)}function qo(e){return!(e.metaKey||!Ft()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function at(e){je=!0,qo(e)&&(Xe="keyboard",Wt("keyboard",e))}function ee(e){Xe="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(je=!0,Wt("pointer",e))}function Lr(e){Fo(e)&&(je=!0,Xe="virtual")}function Or(e){e.target===window||e.target===document||Ho||!e.isTrusted||(!je&&!Ct&&(Xe="virtual",Wt("virtual",e)),je=!1,Ct=!1)}function Fr(){je=!1,Ct=!0}function ar(e){if(typeof window>"u"||typeof document>"u"||Ie.get(ot(e)))return;const t=ot(e),r=K(e);let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){je=!0,n.apply(this,arguments)},r.addEventListener("keydown",at,!0),r.addEventListener("keyup",at,!0),r.addEventListener("click",Lr,!0),t.addEventListener("focus",Or,!0),t.addEventListener("blur",Fr,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",ee,!0),r.addEventListener("pointermove",ee,!0),r.addEventListener("pointerup",ee,!0)):process.env.NODE_ENV==="test"&&(r.addEventListener("mousedown",ee,!0),r.addEventListener("mousemove",ee,!0),r.addEventListener("mouseup",ee,!0)),t.addEventListener("beforeunload",()=>{Rr(e)},{once:!0}),Ie.set(t,{focus:n})}const Rr=(e,t)=>{const r=ot(e),n=K(e);t&&n.removeEventListener("DOMContentLoaded",t),Ie.has(r)&&(r.HTMLElement.prototype.focus=Ie.get(r).focus,n.removeEventListener("keydown",at,!0),n.removeEventListener("keyup",at,!0),n.removeEventListener("click",Lr,!0),r.removeEventListener("focus",Or,!0),r.removeEventListener("blur",Fr,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",ee,!0),n.removeEventListener("pointermove",ee,!0),n.removeEventListener("pointerup",ee,!0)):process.env.NODE_ENV==="test"&&(n.removeEventListener("mousedown",ee,!0),n.removeEventListener("mousemove",ee,!0),n.removeEventListener("mouseup",ee,!0)),Ie.delete(r))};function Xo(e){const t=K(e);let r;return t.readyState!=="loading"?ar(e):(r=()=>{ar(e)},t.addEventListener("DOMContentLoaded",r)),()=>Rr(e,r)}typeof document<"u"&&Xo();function Ar(){return Xe}function Vo(e){const t=K(e),r=ne(t);if(Ar()==="virtual"){let n=r;Oo(()=>{ne(t)===n&&e.isConnected&&sr(e)})}else sr(e)}const ir=f.createContext(null),$t="react-aria-focus-scope-restore";let z=null;function Ko(e){let{children:t,contain:r,restoreFocus:n,autoFocus:s}=e,a=f.useRef(null),o=f.useRef(null),i=f.useRef([]),{parentNode:u}=f.useContext(ir)||{},l=f.useMemo(()=>new Tt({scopeRef:i}),[i]);ue(()=>{let h=u||B.root;if(B.getTreeNode(h.scopeRef)&&z&&!it(z,h.scopeRef)){let p=B.getTreeNode(z);p&&(h=p)}h.addChild(l),B.addNode(l)},[l,u]),ue(()=>{let h=B.getTreeNode(i);h&&(h.contain=!!r)},[r]),ue(()=>{var h;let p=(h=a.current)===null||h===void 0?void 0:h.nextSibling,b=[],v=x=>x.stopPropagation();for(;p&&p!==o.current;)b.push(p),p.addEventListener($t,v),p=p.nextSibling;return i.current=b,()=>{for(let x of b)x.removeEventListener($t,v)}},[t]),Zo(i,n,r),Qo(i,r),ea(i,n,r),Jo(i,s),f.useEffect(()=>{const h=ne(K(i.current?i.current[0]:void 0));let p=null;if(te(h,i.current)){for(let b of B.traverse())b.scopeRef&&te(h,b.scopeRef.current)&&(p=b);p===B.getTreeNode(i)&&(z=p.scopeRef)}},[i]),ue(()=>()=>{var h,p,b;let v=(b=(p=B.getTreeNode(i))===null||p===void 0||(h=p.parent)===null||h===void 0?void 0:h.scopeRef)!==null&&b!==void 0?b:null;(i===z||it(i,z))&&(!v||B.getTreeNode(v))&&(z=v),B.removeTreeNode(i)},[i]);let d=f.useMemo(()=>Uo(i),[]),m=f.useMemo(()=>({focusManager:d,parentNode:l}),[l,d]);return f.createElement(ir.Provider,{value:m},f.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,f.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:o}))}function Uo(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:s,wrap:a,accept:o}=t;var i;let u=n||ne(K((i=r[0])!==null&&i!==void 0?i:void 0)),l=r[0].previousElementSibling,d=ke(r),m=ve(d,{tabbable:s,accept:o},r);m.currentNode=te(u,r)?u:l;let h=m.nextNode();return!h&&a&&(m.currentNode=l,h=m.nextNode()),h&&fe(h,!0),h},focusPrevious(t={}){let r=e.current,{from:n,tabbable:s,wrap:a,accept:o}=t;var i;let u=n||ne(K((i=r[0])!==null&&i!==void 0?i:void 0)),l=r[r.length-1].nextElementSibling,d=ke(r),m=ve(d,{tabbable:s,accept:o},r);m.currentNode=te(u,r)?u:l;let h=m.previousNode();return!h&&a&&(m.currentNode=l,h=m.previousNode()),h&&fe(h,!0),h},focusFirst(t={}){let r=e.current,{tabbable:n,accept:s}=t,a=ke(r),o=ve(a,{tabbable:n,accept:s},r);o.currentNode=r[0].previousElementSibling;let i=o.nextNode();return i&&fe(i,!0),i},focusLast(t={}){let r=e.current,{tabbable:n,accept:s}=t,a=ke(r),o=ve(a,{tabbable:n,accept:s},r);o.currentNode=r[r.length-1].nextElementSibling;let i=o.previousNode();return i&&fe(i,!0),i}}}function ke(e){return e[0].parentElement}function Ae(e){let t=B.getTreeNode(z);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Go(e){if(e.checked)return!0;let t=[];if(!e.form)t=[...K(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)].filter(a=>!a.form);else{var r,n;let a=(n=e.form)===null||n===void 0||(r=n.elements)===null||r===void 0?void 0:r.namedItem(e.name);t=[...a??[]]}return t?!t.some(a=>a.checked):!1}function Qo(e,t){let r=f.useRef(void 0),n=f.useRef(void 0);ue(()=>{let s=e.current;if(!t){n.current&&(cancelAnimationFrame(n.current),n.current=void 0);return}const a=K(s?s[0]:void 0);let o=l=>{if(l.key!=="Tab"||l.altKey||l.ctrlKey||l.metaKey||!Ae(e)||l.isComposing)return;let d=ne(a),m=e.current;if(!m||!te(d,m))return;let h=ke(m),p=ve(h,{tabbable:!0},m);if(!d)return;p.currentNode=d;let b=l.shiftKey?p.previousNode():p.nextNode();b||(p.currentNode=l.shiftKey?m[m.length-1].nextElementSibling:m[0].previousElementSibling,b=l.shiftKey?p.previousNode():p.nextNode()),l.preventDefault(),b&&fe(b,!0)},i=l=>{(!z||it(z,e))&&te(Me(l),e.current)?(z=e,r.current=Me(l)):Ae(e)&&!Ne(Me(l),e)?r.current?r.current.focus():z&&z.current&&St(z.current):Ae(e)&&(r.current=Me(l))},u=l=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{let d=Ar(),m=(d==="virtual"||d===null)&&Dr()&&Mr(),h=ne(a);if(!m&&h&&Ae(e)&&!Ne(h,e)){z=e;let b=Me(l);if(b&&b.isConnected){var p;r.current=b,(p=r.current)===null||p===void 0||p.focus()}else z.current&&St(z.current)}})};return a.addEventListener("keydown",o,!1),a.addEventListener("focusin",i,!1),s?.forEach(l=>l.addEventListener("focusin",i,!1)),s?.forEach(l=>l.addEventListener("focusout",u,!1)),()=>{a.removeEventListener("keydown",o,!1),a.removeEventListener("focusin",i,!1),s?.forEach(l=>l.removeEventListener("focusin",i,!1)),s?.forEach(l=>l.removeEventListener("focusout",u,!1))}},[e,t]),ue(()=>()=>{n.current&&cancelAnimationFrame(n.current)},[n])}function Wr(e){return Ne(e)}function te(e,t){return!e||!t?!1:t.some(r=>r.contains(e))}function Ne(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of B.traverse(B.getTreeNode(t)))if(r&&te(e,r.current))return!0;return!1}function it(e,t){var r;let n=(r=B.getTreeNode(t))===null||r===void 0?void 0:r.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function fe(e,t=!1){if(e!=null&&!t)try{Vo(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function Ir(e,t=!0){let r=e[0].previousElementSibling,n=ke(e),s=ve(n,{tabbable:t},e);s.currentNode=r;let a=s.nextNode();return t&&!a&&(n=ke(e),s=ve(n,{tabbable:!1},e),s.currentNode=r,a=s.nextNode()),a}function St(e,t=!0){fe(Ir(e,t))}function Jo(e,t){const r=f.useRef(t);f.useEffect(()=>{if(r.current){z=e;const n=K(e.current?e.current[0]:void 0);!te(ne(n),z.current)&&e.current&&St(e.current)}r.current=!1},[e])}function Zo(e,t,r){ue(()=>{if(t||r)return;let n=e.current;const s=K(n?n[0]:void 0);let a=o=>{let i=Me(o);te(i,e.current)?z=e:Wr(i)||(z=null)};return s.addEventListener("focusin",a,!1),n?.forEach(o=>o.addEventListener("focusin",a,!1)),()=>{s.removeEventListener("focusin",a,!1),n?.forEach(o=>o.removeEventListener("focusin",a,!1))}},[e,t,r])}function cr(e){let t=B.getTreeNode(z);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function ea(e,t,r){const n=f.useRef(typeof document<"u"?ne(K(e.current?e.current[0]:void 0)):null);ue(()=>{let s=e.current;const a=K(s?s[0]:void 0);if(!t||r)return;let o=()=>{(!z||it(z,e))&&te(ne(a),e.current)&&(z=e)};return a.addEventListener("focusin",o,!1),s?.forEach(i=>i.addEventListener("focusin",o,!1)),()=>{a.removeEventListener("focusin",o,!1),s?.forEach(i=>i.removeEventListener("focusin",o,!1))}},[e,r]),ue(()=>{const s=K(e.current?e.current[0]:void 0);if(!t)return;let a=o=>{if(o.key!=="Tab"||o.altKey||o.ctrlKey||o.metaKey||!Ae(e)||o.isComposing)return;let i=s.activeElement;if(!Ne(i,e)||!cr(e))return;let u=B.getTreeNode(e);if(!u)return;let l=u.nodeToRestore,d=ve(s.body,{tabbable:!0});d.currentNode=i;let m=o.shiftKey?d.previousNode():d.nextNode();if((!l||!l.isConnected||l===s.body)&&(l=void 0,u.nodeToRestore=void 0),(!m||!Ne(m,e))&&l){d.currentNode=l;do m=o.shiftKey?d.previousNode():d.nextNode();while(Ne(m,e));o.preventDefault(),o.stopPropagation(),m?fe(m,!0):Wr(l)?fe(l,!0):i.blur()}};return r||s.addEventListener("keydown",a,!0),()=>{r||s.removeEventListener("keydown",a,!0)}},[e,t,r]),ue(()=>{const s=K(e.current?e.current[0]:void 0);if(!t)return;let a=B.getTreeNode(e);if(a){var o;return a.nodeToRestore=(o=n.current)!==null&&o!==void 0?o:void 0,()=>{let i=B.getTreeNode(e);if(!i)return;let u=i.nodeToRestore,l=ne(s);if(t&&u&&(l&&Ne(l,e)||l===s.body&&cr(e))){let d=B.clone();requestAnimationFrame(()=>{if(s.activeElement===s.body){let m=d.getTreeNode(e);for(;m;){if(m.nodeToRestore&&m.nodeToRestore.isConnected){lr(m.nodeToRestore);return}m=m.parent}for(m=d.getTreeNode(e);m;){if(m.scopeRef&&m.scopeRef.current&&B.getTreeNode(m.scopeRef)){let h=Ir(m.scopeRef.current,!0);lr(h);return}m=m.parent}}})}}}},[e,t])}function lr(e){e.dispatchEvent(new CustomEvent($t,{bubbles:!0,cancelable:!0}))&&fe(e)}function ve(e,t,r){let n=t?.tabbable?zo:Yo,s=e?.nodeType===Node.ELEMENT_NODE?e:null,a=K(s),o=Co(a,e||a,NodeFilter.SHOW_ELEMENT,{acceptNode(i){var u;return!(t==null||(u=t.from)===null||u===void 0)&&u.contains(i)||t?.tabbable&&i.tagName==="INPUT"&&i.getAttribute("type")==="radio"&&(!Go(i)||o.currentNode.tagName==="INPUT"&&o.currentNode.type==="radio"&&o.currentNode.name===i.name)?NodeFilter.FILTER_REJECT:n(i)&&(!r||te(i,r))&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}class It{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,r,n){let s=this.fastMap.get(r??null);if(!s)return;let a=new Tt({scopeRef:t});s.addChild(a),a.parent=s,this.fastMap.set(t,a),n&&(a.nodeToRestore=n)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let r=this.fastMap.get(t);if(!r)return;let n=r.parent;for(let a of this.traverse())a!==r&&r.nodeToRestore&&a.nodeToRestore&&r.scopeRef&&r.scopeRef.current&&te(a.nodeToRestore,r.scopeRef.current)&&(a.nodeToRestore=r.nodeToRestore);let s=r.children;n&&(n.removeChild(r),s.size>0&&s.forEach(a=>n&&n.addChild(a))),this.fastMap.delete(r.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let r of t.children)yield*this.traverse(r)}clone(){var t;let r=new It;var n;for(let s of this.traverse())r.addTreeNode(s.scopeRef,(n=(t=s.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&n!==void 0?n:null,s.nodeToRestore);return r}constructor(){this.fastMap=new Map,this.root=new Tt({scopeRef:null}),this.fastMap.set(null,this.root)}}class Tt{addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}}let B=new It;const $e=({children:e,node:t})=>br.createPortal(e,t??document.body),_r=({children:e,customTrigger:t,triggerContent:r,align:n="start",side:s="bottom",offset:a=8,className:o,triggerClassName:i,closeOnEscape:u=!0,closeOnClickAway:l=!0,scrollerId:d,onOpen:m,onClose:h,maxHeight:p="400px",minWidth:b="200px",maxWidth:v="500px"})=>{const{triggerRef:x,triggerProps:E,popoverRef:$,getPopoverPosition:C,open:S,toggle:M,close:w}=ft({align:n,side:s,offset:a,scrollerId:d,onOpen:()=>{m?.()},onClose:()=>{h?.()}});yr({Escape:L=>{u&&(L.preventDefault(),w(),x.current?.focus())}},{enabled:S}),dt($,L=>{!l||!x.current||!S||!L.target||x.current.contains(L.target)||w()});const N=C();return c.jsxs(c.Fragment,{children:[t?t({triggerRef:x,triggerProps:E,toggle:M,open:S,close:w}):c.jsx("button",{ref:x,...E,onClick:M,className:k("outline-none p-2 rounded-md transition-colors","hover:bg-base-3 focus-visible:bg-base-3 focus-visible:ring-2 focus-visible:ring-brand",i),children:r}),c.jsx(O.AnimatePresence,{children:S&&c.jsx($e,{children:c.jsx(Ko,{contain:!0,restoreFocus:!0,autoFocus:!0,children:c.jsx(O.motion.div,{initial:{opacity:0,scale:.95,y:s==="bottom"?-10:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:s==="bottom"?-10:10},transition:{type:"spring",duration:.2,bounce:.1},ref:$,style:{position:"fixed",left:N.x,top:N.top,bottom:N.bottom,maxHeight:typeof p=="number"?`${p}px`:p,minWidth:typeof b=="number"?`${b}px`:b,maxWidth:typeof v=="number"?`${v}px`:v,zIndex:1e3},className:k("bg-base-1 dark-theme:bg-base-2","border border-base-4 rounded-6","customscrollbar overflow-auto",o),children:typeof e=="function"?e(M):e})})})})]})},ta=({title:e,subtitle:t,onClose:r,className:n})=>c.jsx("div",{className:k("p-4 border-b border-base-4",n),children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-base-12",children:e}),t&&c.jsx("p",{className:"text-sm text-base-11 mt-1",children:t})]}),r&&c.jsx("button",{onClick:r,className:"ml-4 text-base-11 hover:text-base-12 transition-colors",children:"×"})]})}),ra=({children:e,className:t})=>c.jsx("div",{className:k("p-4",t),children:e}),na=({children:e,className:t})=>c.jsx("div",{className:k("p-4 border-t border-base-4",t),children:e}),sa=(e,t)=>{const r=new Date(2023,0,1),n=[];for(let s=0;s<7;s++){const a=new Date(r);a.setDate(r.getDate()+s),n.push(Ee(a,"EEE",{locale:e??$r}))}return t?[...n.slice(1),n[0]]:n},_t=({selectedDate:e,onDateSelect:t,disabledDates:r,disabledDaysOfWeek:n,minDate:s,maxDate:a,locale:o,weekStartsOnMonday:i=!0,className:u=""})=>{const[l,d]=f.useState(e||new Date),[m,h]=f.useState(e||new Date),p=f.useRef(null),b=f.useMemo(()=>r?new Set(r.map(w=>new Date(w).toDateString())):new Set,[r]),v=f.useMemo(()=>new Set(n||[]),[n]),x=f.useMemo(()=>{const w=Vn(l),N=Bn(l),L=new Date(w),W=new Date(N);if(i){const j=w.getDay(),g=j===0?6:j-1;L.setDate(w.getDate()-g);const D=N.getDay(),T=D===0?0:7-D;W.setDate(N.getDate()+T)}else L.setDate(w.getDate()-w.getDay()),W.setDate(N.getDate()+(6-N.getDay()));return Xn({start:L,end:W})},[l,i]),E=f.useMemo(()=>sa(o??ze,i),[o,i]),$=w=>{const N=w.toDateString(),L=w.getDay();return!(b.has(N)||v.has(L)||s&&w<s||a&&w>a)},C=w=>{$(w)&&t&&t(w),h(w)},S=w=>{if(!m)return;let N=new Date(m),L=!0,W,j;switch(w.key){case"ArrowUp":N.setDate(N.getDate()-7);break;case"ArrowDown":N.setDate(N.getDate()+7);break;case"ArrowLeft":N.setDate(N.getDate()-1);break;case"ArrowRight":N.setDate(N.getDate()+1);break;case"Home":W=N.getDay(),N.setDate(N.getDate()-W);break;case"End":j=N.getDay(),N.setDate(N.getDate()+(6-j));break;case"PageUp":N=w.shiftKey?kt(N,12):kt(N,1);break;case"PageDown":N=w.shiftKey?et(N,12):et(N,1);break;case"Enter":case" ":$(m)&&t&&t(m);break;default:L=!1}L&&(w.preventDefault(),N.getTime()!==m.getTime()&&(h(N),rr(N,l)||d(N)))},M=w=>{d(N=>w==="prev"?kt(N,1):et(N,1))};return c.jsxs("div",{ref:p,className:k("dark-theme:bg-base-3 border border-base-5 dark-theme:border-base-4 rounded-6 px-4 pt-3 pb-4 w-full lg:w-80",u),onKeyDown:S,tabIndex:0,role:"grid","aria-label":"Calendar",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(q,{onClick:()=>M("prev"),size:"iconSm","aria-label":"Previous month",children:c.jsx(A.ChevronLeft,{size:16})}),c.jsx("h2",{className:"text-sm font-medium",children:Ee(l,"MMMM yyyy")}),c.jsx(q,{onClick:()=>M("next"),size:"iconSm","aria-label":"Next month",children:c.jsx(A.ChevronRight,{size:16})})]}),c.jsx("div",{className:"grid grid-cols-7 gap-1 mt-4",role:"row",children:E.map(w=>c.jsx("div",{className:"text-xs flex items-center w-8 justify-center text-base-11",role:"columnheader",children:w},w))}),c.jsx("div",{className:"grid grid-cols-7 gap-1 mt-4",role:"grid",children:x.map((w,N)=>{const L=rr(w,l),W=e?yt(w,e):!1,j=m&&yt(w,m),g=$(w),D=yt(w,new Date);return c.jsx("button",{onClick:()=>C(w),disabled:!g,tabIndex:j?0:-1,role:"gridcell","aria-label":`${w.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})}${W?", selected":""}${g?"":", disabled"}`,"aria-selected":W,"aria-disabled":!g,className:k("h-8 w-8 flex items-center outline-none justify-center rounded-6 hover:bg-base-4 text-sm relative",L?W?"bg-brand text-brand-text hover:bg-brand":D?"text-base-12 ring-1 ring-base-8":"text-base-12":"text-base-9",j&&"ring-1 ring-base-6",(!g||!L)&&"pointer-events-none text-base-9"),children:Ee(w,"d")},N)})})]})},oa=()=>{const[e,t]=f.useState(new Date(2025,8,21)),r=["2025-09-13T00:00:00Z","2025-09-15T00:00:00Z"],n=[0,6];return c.jsx("div",{className:"p-8 bg-gray-100 min-h-screen",children:c.jsxs("div",{className:"max-w-md mx-auto",children:[c.jsx("h1",{className:"text-2xl font-bold mb-6 text-gray-800",children:"Calendar Date Picker Demo"}),c.jsx("div",{className:"mb-6",children:c.jsx(_t,{selectedDate:e,onDateSelect:t,disabledDates:r,disabledDaysOfWeek:n,minDate:new Date(2025,8,1),maxDate:new Date(2025,11,31)})}),e&&c.jsxs("div",{className:"bg-white p-4 rounded-lg shadow",children:[c.jsx("h3",{className:"font-semibold text-gray-800 mb-2",children:"Selected Date:"}),c.jsx("p",{className:"text-gray-600",children:e.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),c.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["ISO: ",e.toISOString()]})]}),c.jsxs("div",{className:"mt-6 bg-white p-4 rounded-lg shadow",children:[c.jsx("h3",{className:"font-semibold text-gray-800 mb-2",children:"Keyboard Navigation:"}),c.jsxs("div",{className:"text-sm text-gray-600 space-y-1",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Arrow Keys:"})," Navigate between dates"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Enter/Space:"})," Select focused date"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Home/End:"})," Go to start/end of week"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Page Up/Down:"})," Previous/next month"]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Shift + Page Up/Down:"})," Previous/next year"]})]})]}),c.jsxs("div",{className:"mt-4 bg-white p-4 rounded-lg shadow",children:[c.jsx("h3",{className:"font-semibold text-gray-800 mb-2",children:"Features:"}),c.jsxs("ul",{className:"text-sm text-gray-600 space-y-1",children:[c.jsx("li",{children:"✅ All dates enabled by default"}),c.jsx("li",{children:"✅ Disable specific dates (PostgreSQL ISO strings)"}),c.jsx("li",{children:"✅ Disable entire days of week (e.g., weekends)"}),c.jsx("li",{children:"✅ Min/max date constraints"}),c.jsx("li",{children:"✅ Full keyboard navigation with arrow keys"}),c.jsx("li",{children:"✅ Focus management and accessibility"})]})]})]})})};function aa({customTrigger:e,scrollerId:t}){const[r,n]=f.useState(new Date);return c.jsx(_r,{className:"p-0",scrollerId:t,customTrigger:({toggle:s,triggerRef:a})=>e?e(s,a):c.jsxs(q,{ref:a,onClick:s,color:"solid",className:"px-3 mt-1 w-full justify-start",children:[Ee(new Date,"PP",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(A.CalendarDays,{size:18,className:"text-base-11"})]}),children:s=>c.jsx(_t,{selectedDate:r,onDateSelect:a=>{n(a),s()},className:"border-none",disabledDaysOfWeek:[0,6]})})}const ia=()=>c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium ml-0.5",children:"Start Time"}),c.jsxs(q,{color:"solid",className:"px-3 mt-1",children:[Ee(new Date,"p",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(A.Clock,{size:18,className:"text-base-11"})]})]}),ca=()=>c.jsxs("div",{className:"flex items-center gap-x-4",children:[c.jsxs("div",{className:"grow",children:[c.jsx("p",{className:"text-xs font-medium ml-0.5",children:"Start Date"}),c.jsxs(q,{color:"solid",className:"px-3 mt-1 w-full justify-start",children:[Ee(new Date,"PP",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(A.CalendarDays,{size:18,className:"text-base-11"})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium ml-0.5",children:"Start Time"}),c.jsxs(q,{color:"solid",className:"px-3 mt-1",children:[Ee(new Date,"p",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(A.Clock,{size:18,className:"text-base-11"})]})]})]}),Je={unchecked:"bg-base-3 lg:hover:bg-base-4",checked:"bg-brand lg:hover:bg-brand-hover text-brand-text",uncheckedDisabled:"bg-base-3 border-base-4",checkedDisabled:"bg-base-3 border-base-4 text-base-10"},Yr=f.forwardRef(({checked:e=!1,onCheckedChange:t,disabled:r=!1,required:n=!1,name:s,value:a,id:o,className:i="",size:u="sm",...l},d)=>{const m=()=>{r||t?.(e==="indeterminate"?!0:!e)},h=v=>{(v.key===" "||v.key==="Enter")&&(v.preventDefault(),m())},p={xs:"h-3.5 w-3.5",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},b={xs:24,sm:12,md:14,lg:16};return c.jsxs(c.Fragment,{children:[c.jsxs("button",{ref:d,type:"button",role:"checkbox","aria-checked":e==="indeterminate"?"mixed":e,"aria-required":n,disabled:r,onClick:m,onKeyDown:h,className:k("inline-flex items-center justify-center rounded-2 border border-base-4 transition-all duration-200 ease-in-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-base-5",p[u],r&&"cursor-not-allowed opacity-75",!r&&"cursor-pointer",e?r?Je.checkedDisabled:Je.checked:r?Je.uncheckedDisabled:Je.unchecked,typeof i=="function"?i(e):i),...l,children:[e===!0&&c.jsx(A.Check,{size:b[u],className:"stroke-current"}),e==="indeterminate"&&c.jsx(A.Minus,{size:b[u],className:"stroke-current"})]}),c.jsx("input",{type:"checkbox",name:s,value:a,checked:e===!0,onChange:()=>{},disabled:r,required:n,id:o,className:"sr-only",tabIndex:-1})]})});Yr.displayName="Checkbox";const la=({title:e,message:t,searchParam:r,condition:n=!0,cancelLabel:s,confirmLabel:a,confirmColor:o="contrast",confirmAction:i,trigger:u})=>{const{searchParams:l}=de.useSearchParams(),d=f.useMemo(()=>!!l[r],[l]),m=f.useCallback(()=>{de.navigate.to(`${window.location.pathname}?${r}=open`)},[r]);return c.jsxs(c.Fragment,{children:[c.jsx(O.AnimatePresence,{initial:!1,children:d&&n?c.jsxs($e,{node:document&&document.getElementById("modals"),children:[c.jsx(O.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed top-0 left-0 z-[999] h-full w-full bg-black/50"}),c.jsxs(O.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed top-1/2 left-1/2 z-[999] w-[75%] -translate-y-1/2 -translate-x-1/2 rounded-lg bg-base-2 p-4 lg:w-[35%] xl:w-[30%]",children:[e?c.jsx("p",{className:"font-medium",children:e}):null,t?c.jsx("p",{className:k("text-sm text-base-11",{"mt-2":e}),children:t}):null,c.jsxs("div",{className:"flex justify-end gap-x-4 pt-4",children:[c.jsx(q,{onClick:()=>de.navigate.back(),color:"transparentinactive",size:"sm",children:s??"Cancelar"}),c.jsx(q,{size:"sm",onClick:()=>{i&&i(),de.navigate.back()},color:o,children:a??"Continuar"})]})]})]}):null}),u?u(m):null]})},ua=({scrollY:e,height:t=300,className:r,children:n})=>{const s=O.useTransform(e,o=>o<0?1+Math.abs(o)/t:1),a=O.useTransform(e,o=>o<0?-Math.abs(o)/2:0);return c.jsx(O.motion.div,{style:{scale:s,y:a,height:t},className:r,children:n})};function zr(e,t,r){function n(i,u){var l;Object.defineProperty(i,"_zod",{value:i._zod??{},enumerable:!1}),(l=i._zod).traits??(l.traits=new Set),i._zod.traits.add(e),t(i,u);for(const d in o.prototype)d in i||Object.defineProperty(i,d,{value:o.prototype[d].bind(i)});i._zod.constr=o,i._zod.def=u}const s=r?.Parent??Object;class a extends s{}Object.defineProperty(a,"name",{value:e});function o(i){var u;const l=r?.Parent?new a:this;n(l,i),(u=l._zod).deferred??(u.deferred=[]);for(const d of l._zod.deferred)d();return l}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:i=>r?.Parent&&i instanceof r.Parent?!0:i?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class da extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const fa={};function Hr(e){return fa}function ma(e,t){return typeof t=="bigint"?t.toString():t}const Br=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ze(e){return typeof e=="string"?e:e?.message}function qr(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const s=Ze(e.inst?._zod.def?.error?.(e))??Ze(t?.error?.(e))??Ze(r.customError?.(e))??Ze(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}const Xr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,ma,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ha=zr("$ZodError",Xr),Vr=zr("$ZodError",Xr,{Parent:Error}),ba=e=>(t,r,n,s)=>{const a=n?Object.assign(n,{async:!1}):{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new da;if(o.issues.length){const i=new(s?.Err??e)(o.issues.map(u=>qr(u,a,Hr())));throw Br(i,s?.callee),i}return o.value},pa=ba(Vr),ga=e=>async(t,r,n,s)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const i=new(s?.Err??e)(o.issues.map(u=>qr(u,a,Hr())));throw Br(i,s?.callee),i}return o.value},va=ga(Vr);function ur(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function xa(e,t){for(var r={};e.length;){var n=e[0],s=n.code,a=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var i=n.unionErrors[0].errors[0];r[o]={message:i.message,type:i.code}}else r[o]={message:a,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(m){return e.push(m)})}),t){var u=r[o].types,l=u&&u[n.code];r[o]=J.appendErrors(o,t,r,s,l?[].concat(l,n.message):n.message)}e.shift()}return r}function wa(e,t){for(var r={};e.length;){var n=e[0],s=n.code,a=n.message,o=n.path.join(".");if(!r[o])if(n.code==="invalid_union"&&n.errors.length>0){var i=n.errors[0][0];r[o]={message:i.message,type:i.code}}else r[o]={message:a,type:s};if(n.code==="invalid_union"&&n.errors.forEach(function(d){return d.forEach(function(m){return e.push(m)})}),t){var u=r[o].types,l=u&&u[n.code];r[o]=J.appendErrors(o,t,r,s,l?[].concat(l,n.message):n.message)}e.shift()}return r}function ya(e,t,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,s,a){try{return Promise.resolve(ur(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(o){return a.shouldUseNativeValidation&&Ge.validateFieldsNatively({},a),{errors:{},values:r.raw?Object.assign({},n):o}})},function(o){if((function(i){return Array.isArray(i?.issues)})(o))return{values:{},errors:Ge.toNestErrors(xa(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,s,a){try{return Promise.resolve(ur(function(){return Promise.resolve((r.mode==="sync"?pa:va)(e,n,t)).then(function(o){return a.shouldUseNativeValidation&&Ge.validateFieldsNatively({},a),{errors:{},values:r.raw?Object.assign({},n):o}})},function(o){if((function(i){return i instanceof ha})(o))return{values:{},errors:Ge.toNestErrors(wa(o.issues,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}};throw new Error("Invalid input: not a Zod schema")}function ka({methods:e,onSubmit:t,onError:r,children:n,logErrors:s,className:a}){return c.jsx(J.FormProvider,{...e,children:c.jsx("form",{className:k("mt-4 lg:mt-8 grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-8 relative",a),onSubmit:e.handleSubmit((o,i)=>t(o,i),o=>{s&&console.log(o),r?.(o)}),children:n})})}function Na(e,t){return J.useForm({resolver:ya(e),defaultValues:t})}const Kr=({children:e,size:t=24,strokeWidth:r=2,viewBox:n="0 0 24 24",className:s,...a})=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:n,className:s,...a,children:e}),Ea={solid:"bg-base-3 border border-base-4 drop-shadow-sm dark-theme:drop-shadow-none",outline:"border border-base-6"},ja={brand:"ring-1 ring-brand",solid:"ring-1 ring-base-6"},Yt=f.forwardRef(({label:e,description:t,labelPosition:r="default",color:n="solid",focusColor:s="brand",placeholder:a,valid:o,error:i,errorMessage:u,isPrice:l,prefix:d,wrapperClassName:m,containerClassName:h,className:p,type:b="text",value:v,...x},E)=>{const $=f.useRef(null),C=f.useRef(!1),[S,M]=f.useState(!1),[w,N]=f.useState(!1),L=b==="password",W=L&&S?"text":l?"number":b,j=v!==""&&v!==null&&v!==void 0;return f.useEffect(()=>{if(!C.current){C.current=!0;return}$.current&&vr($.current)},[S,$]),c.jsxs("div",{className:k("relative",m),children:[e&&r==="default"&&c.jsx("label",{className:k("font-medium ml-0.5 text-xs",i&&"text-red-9"),children:e}),c.jsxs("div",{className:k("rounded-6 transition cursor-text relative",Ea[n],{"pt-[22px] pb-1.5":r==="floating",[ja[s]]:!i&&w,"bg-red-4 text-red-9":!!i,"ring-1 ring-red-9":!!i&&w},h),children:[e&&r==="floating"&&c.jsx("label",{className:k("absolute transition-all duration-200 pointer-events-none","text-sm top-[18px] font-semibold left-3",{"text-xs top-2.5":w||j||a,"text-red-9":!!i}),children:e}),l&&c.jsx(A.DollarSign,{size:16,className:k("absolute top-1/2 -translate-y-1/2 left-3",i?"text-red-9":"text-base-11")}),d&&c.jsx("p",{className:"text-sm text-base-11 absolute top-1/2 -translate-y-1/2 left-3",children:d}),c.jsx("input",{ref:g=>{E&&(typeof E=="function"?E(g):E.current=g),$.current=g},type:W,className:k("w-full bg-transparent focus-visible:outline-none","placeholder:text-sm text-sm placeholder:text-base-11",l||d?"pl-9":"pl-3",{"py-2.5":r==="default","mt-1.5":r==="floating","pr-10":o,"text-red-9 placeholder:text-red-9":!!i},p),value:v,placeholder:a,onFocus:()=>N(!0),onBlur:()=>N(!1),...x})]}),o?c.jsx(A.CheckIcon,{size:20,className:`absolute top-1/2 -translate-y-1/2 text-green-500 ${L?"right-10":"right-3"}`}):null,L&&c.jsx("button",{type:"button",className:k(r==="floating"?"absolute right-3 top-1/2 -translate-y-1/2":"absolute right-3 top-10"),onClick:()=>{M(!S)},children:S?c.jsx(A.EyeOffIcon,{size:20,className:k(i?"text-red-9":"text-base-11")}):c.jsx(A.Eye,{size:20,className:k(i?"text-red-9":"text-base-11")})}),u?c.jsx("span",{role:"alert",className:"text-red-9 text-sm mt-1 ml-0.5",children:u}):t?c.jsx("p",{className:"text-xs text-base-11 mt-1 ml-0.5",children:t}):null]})});Yt.displayName="Input";const Ca=({name:e,customRead:t,customSet:r,withNullSet:n=!0,...s})=>{const{control:a}=J.useFormContext(),o=f.useCallback(u=>t?t(u):u===null?Pt(u):u,[t]),i=f.useCallback(u=>r?n&&u===null?rt(u):r(u):u===null?rt(u):u,[r]);return a?c.jsx(J.Controller,{name:e,control:a,render:({field:u,fieldState:l})=>c.jsx(Yt,{value:o(u.value),onChange:d=>u.onChange(i(d.target.value)),error:!!l.error,errorMessage:l.error?.message,ref:u.ref,...s})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},Ur=f.createContext(null),$a=({children:e,value:t})=>c.jsx(Ur.Provider,{value:t,children:e}),Sa=()=>{const e=f.useContext(Ur);if(!e)throw new Error("useAliveScope must be wrapped within AliveScopeProvider");return e},Ta=({children:e})=>{const[t,r]=f.useState({}),n=f.useRef({}),s=f.useRef({}),a=(i,u,l)=>{if(!t[i]){const d=document.createElement("div");return i&&(d.id=i),l&&(d.className=l),r(m=>({...m,[i]:{children:u,element:d}})),n.current[i]=[],s.current[i]=[],n.current&&n.current[i]&&n.current[i].forEach(m=>m(i)),d}return n.current&&n.current[i]&&n.current[i].forEach(d=>d(i)),t[i].element},o=i=>{r(u=>{const l={...u};return delete l[i],l}),s.current&&s.current[i]&&s.current[i].forEach(u=>u(i))};return c.jsxs($a,{value:{getPortalElement:a,dropPortalElement:o},children:[e,Object.entries(t).map(([i,{children:u,element:l}])=>c.jsx(Da,{id:i,onMountCallbacks:n,onDropCallbacks:s,children:u,element:l},i))]})},Gr=f.createContext(null),Ma=({children:e,value:t})=>c.jsx(Gr.Provider,{value:t,children:e}),Da=f.memo(({id:e,onMountCallbacks:t,onDropCallbacks:r,children:n,element:s})=>{const a=(i,u={runOnFirstMount:!1})=>{f.useEffect(()=>{const l=()=>{if(document.getElementById(e))i(e);else{const m=new MutationObserver((h,p)=>{document.getElementById(e)&&(i(e),p.disconnect())});return m.observe(document.body,{childList:!0,subtree:!0}),()=>m.disconnect()}};return u?.runOnFirstMount&&l(),t.current[e].push(l),()=>{t.current[e]=t.current[e].filter(d=>d!==l)}},[])},o=i=>{f.useEffect(()=>(r.current[e].push(i),()=>{r.current[e]=r.current[e].filter(u=>u!==i)}),[])};return c.jsx(Ma,{value:{keepAliveId:e,onKeepAliveMount:a,onKeepAliveDrop:o},children:br.createPortal(n,s,e)})}),Pa=()=>{const e=f.useContext(Gr);if(!e)throw new Error("useKeepAlive must be used within KeepAliveProvider");return e},La=({aliveKey:e,children:t,enabled:r=!0,...n})=>{const s=f.useRef(null),{getPortalElement:a}=Sa();return f.useEffect(()=>{const o=a(e,t,n.className);return r&&s.current&&s.current.replaceWith(o),()=>{}},[e,t,r,n]),c.jsx("div",{...n,ref:s,children:t})},zt=f.forwardRef(({src:e,alt:t,eager:r=!1,rootMargin:n="50px",threshold:s=.01,noFade:a=!1,className:o="",...i},u)=>{const[l,d]=f.useState(r),[m,h]=f.useState(!1),p=f.useRef(null);return f.useEffect(()=>{if(r)return;const b=new IntersectionObserver(x=>{x.forEach(E=>{E.isIntersecting&&(d(!0),b.disconnect())})},{rootMargin:n,threshold:s}),v=p.current;return v&&b.observe(v),()=>{b.disconnect()}},[r,n,s]),c.jsx("img",{ref:b=>{p.current=b,typeof u=="function"?u(b):u&&(u.current=b)},src:l?e:void 0,alt:t,onLoad:()=>h(!0),className:k("w-full h-full object-cover","transition-opacity duration-500 ease-out",m?"opacity-100":"opacity-0",o),draggable:!1,...i})});zt.displayName="LazyImage";const Qr=f.forwardRef(({src:e,alt:t,eager:r=!1,wrapperClassName:n="",imageClassName:s="",rootMargin:a="50px",threshold:o=.01,noFade:i=!1,children:u,...l},d)=>c.jsxs("div",{className:k("overflow-hidden",n),children:[c.jsx(zt,{ref:d,src:e,alt:t,eager:r,rootMargin:a,threshold:o,noFade:i,className:s,...l}),u]}));Qr.displayName="LazyImageWrapped";const Oa=({lightSolid:e=!0,className:t,children:r,...n})=>c.jsx("div",{className:k("rounded-7 dark-theme:bg-base-3",e?"border-none bg-base-3":"border border-base-6 dark-theme:border-base-4",t),...n,children:r}),Fa=({onClick:e,lightSolid:t=!0,className:r,children:n})=>c.jsx("button",{onClick:e,className:k("w-full text-start first:rounded-t-7 last:rounded-b-7 border-b dark-theme:border-base-4","last:border-none px-3 pr-2.5 py-3 dark-theme:bg-base-3 lg:hover:bg-base-4 max-lg:active:bg-base-4","transition-colors hover:cursor-pointer flex items-center justify-between outline-none lg:focus-visible:ring-2 focus-visible:ring-base-6",t?"bg-base-3 border-base-4":"border-base-6",r),children:n}),Jr=({label:e,labelPosition:t="default",options:r,selectedValues:n,onChange:s,idExtractor:a,labelExtractor:o,customSetter:i,valid:u,error:l,placeholder:d="Select options...",maxSelections:m,searchable:h=!1,disabled:p=!1,className:b})=>{const[v,x]=f.useState(""),[E,$]=f.useState(!1),[C,S]=f.useState(-1),M=f.useRef(null),w=f.useRef(null),N=f.useRef([]),{triggerRef:L,triggerProps:W,popoverRef:j,getPopoverPosition:g,open:D,toggle:T,close:F}=ft({align:"start",side:"top",avoidCollisions:!1,onOpen:()=>{$(!0),h&&M.current&&setTimeout(()=>M.current?.focus(),10)},onClose:()=>{$(!1),x(""),S(-1)}}),_=f.useRef(`multiselect-${Math.random().toString(36).substr(2,9)}`).current,X=f.useRef(`label-${Math.random().toString(36).substr(2,9)}`).current,R=f.useRef(`error-${Math.random().toString(36).substr(2,9)}`).current,y=f.useRef(`listbox-${Math.random().toString(36).substr(2,9)}`).current,V=i?n.map(P=>r.find(G=>a(G)===P||a(G)===a(P))).filter(Boolean):n,oe=V.length>0,U=h?r.filter(P=>o(P).toLowerCase().includes(v.toLowerCase())):r;f.useEffect(()=>{N.current=N.current.slice(0,U.length)},[U.length]);const re=P=>i?n.some(I=>I===a(P)||a(I)===a(P)):n.some(I=>a(I)===a(P)),Re=P=>{if(!p)if(re(P)){let I;if(i){const G=a(P);I=n.filter(we=>we!==G&&a(we)!==G)}else I=n.filter(G=>a(G)!==a(P));s(I),Ue(`Removed ${o(P)}`)}else{if(m&&V.length>=m){Ue(`Maximum of ${m} selections allowed`);return}let I;i?I=[...n,i(P)]:I=[...n,P],s(I),Ue(`Added ${o(P)}`)}},Ve=P=>{if(p)return;let I;if(i){const G=a(P);I=n.filter(we=>we!==G&&a(we)!==G)}else I=n.filter(G=>a(G)!==a(P));s(I),Ue(`Removed ${o(P)}`)},Ke=P=>{if(!p)switch(P.key){case"Enter":P.preventDefault(),D?C>=0&&Re(U[C]):T();break;case"Escape":P.preventDefault(),F();break;case"ArrowDown":if(P.preventDefault(),!D)T();else{const I=C>=U.length-1?0:C+1;S(I),N.current[I]?.scrollIntoView({block:"nearest"})}break;case"ArrowUp":if(P.preventDefault(),D){const I=C<=0?U.length-1:C-1;S(I),N.current[I]?.scrollIntoView({block:"nearest"})}break;case"Backspace":if(h&&v===""&&V.length>0){const I=V[V.length-1];Ve(I)}break}},fn=P=>{x(P.target.value),S(-1)},mn=()=>{p||(h&&M.current&&M.current.focus(),T())},Ue=P=>{console.log(`Accessibility announcement: ${P}`)};dt(j,P=>{!L.current||!D||!P.target||L.current.contains(P.target)||F()});const vt=g();return c.jsxs("div",{className:k("relative",b),children:[c.jsxs("div",{className:"relative",ref:w,children:[t==="default"&&c.jsx("label",{className:k("top-[18px] font-medium ml-0.5 text-xs",l&&"text-red-9"),children:e}),c.jsxs("div",{ref:L,...W,className:k("relative rounded-6 px-2 transition cursor-pointer pr-10 min-h-[48px]","border border-base-4 light-theme:drop-shadow-sm dark-theme:bg-base-3",{"py-3":t==="default","pt-5 pb-2":t==="floating","ring-1 ring-brand":D||E,"text-red-9":l,"ring-2 ring-red-6":l&&(D||E),"opacity-60 cursor-not-allowed":p}),onClick:mn,role:"combobox","aria-expanded":D,"aria-haspopup":"listbox","aria-owns":y,"aria-labelledby":X,"aria-describedby":l?R:void 0,onKeyDown:Ke,tabIndex:p?-1:0,children:[t==="floating"&&c.jsxs("label",{id:X,htmlFor:_,className:k("absolute transition-all duration-200 pointer-events-none","text-base top-4 font-semibold left-3",{"text-sm top-2 left-2":E||oe,"text-red-9":!!l}),children:[e," ",m&&`(${n.length}/${m})`]}),c.jsxs("div",{className:k("flex flex-wrap gap-2 items-center",{"mt-2.5":t==="floating"}),children:[V.map(P=>c.jsxs("div",{className:k("border border-base-4 dark-theme:border-base-5 dark-theme:bg-base-4 rounded-full px-2 py-1 text-sm flex items-center gap-1",{"bg-red-4 text-red-9":l}),children:[c.jsx("span",{className:"line-clamp-1",children:o(P)}),!p&&c.jsx("button",{type:"button",className:"hover:bg-brand/20 rounded-full p-0.5 transition-colors",onClick:I=>{I.stopPropagation(),Ve(P)},"aria-label":`Remove ${o(P)}`,children:c.jsx(A.XIcon,{size:12})})]},a(P))),h&&c.jsx("input",{ref:M,id:_,type:"text",className:"flex-grow min-w-[60px] bg-transparent outline-none placeholder:text-sm",value:v,onChange:fn,onKeyDown:Ke,placeholder:oe?"":d,disabled:p,"aria-autocomplete":"list","aria-controls":y,autoComplete:"off"}),!h&&!oe&&c.jsx("span",{className:"text-secondarytext text-sm flex-grow",children:d})]}),c.jsxs("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-2",children:[u&&c.jsx(A.CheckIcon,{size:16,className:"text-green-600"}),c.jsx(A.ChevronDownIcon,{size:16,className:k("transition-transform text-base-11",{"rotate-180":D})})]})]})]}),c.jsx(O.AnimatePresence,{children:D&&c.jsx($e,{children:c.jsx(O.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.15},ref:j,style:{position:"fixed",left:vt.x,top:vt.top,bottom:vt.bottom,width:w.current?.offsetWidth??200},className:k("bg-base-1 dark-theme:bg-base-3 border border-base-4","rounded-6 shadow-lg max-h-[300px] overflow-y-auto z-50","customscrollbarnohide"),role:"listbox",id:y,"aria-labelledby":X,children:U.length===0?c.jsx("div",{className:"px-3 py-2 text-sm text-secondarytext",children:v?"No results found":"No options available"}):U.map((P,I)=>{const G=re(P),we=I===C;return c.jsxs("div",{ref:hn=>{N.current[I]=hn},className:k("px-3 py-2 text-sm cursor-pointer flex items-center justify-between","first:rounded-t-6 last:rounded-b-6",{"bg-base-3 dark-theme:bg-base-4":we,"bg-brandfadedbg text-brand":G}),onClick:()=>Re(P),role:"option","aria-selected":G,onMouseEnter:()=>S(I),children:[c.jsx("span",{children:o(P)}),G&&c.jsx(A.CheckIcon,{size:16})]},a(P))})})})}),l&&c.jsx("p",{id:R,className:"text-red-9 text-xs mt-1","aria-live":"assertive",children:l}),c.jsx("div",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:V.length>0?`Selected: ${V.map(o).join(", ")}`:"No selections"})]})},Ra=({name:e,...t})=>{const{control:r}=J.useFormContext();return r?c.jsx(J.Controller,{name:e,control:r,render:({field:n,fieldState:s})=>c.jsx(Jr,{selectedValues:n.value||[],onChange:a=>n.onChange(a),error:s.error?.message,...t})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},Aa=({id:e,tabPage:t,absolute:r=!0,navBar:n,children:s,onRefresh:a,style:o,className:i,contentClassName:u,bounceBackDuration:l=300,showScrollbar:d=!0,onScroll:m})=>{const h=f.useRef(null),p=f.useRef(null),b=f.useRef(null),v=f.useRef(null),x=f.useRef(null),[E,$]=f.useState(!1),C=f.useRef(null),S=f.useRef({startY:0,currentY:0,maxScroll:0,lastTimestamp:0,frameCallback:null,isScrolling:!1,pullDistance:0,refreshThreshold:50,isPullingToRefresh:!1}),M=qe(),w=f.useCallback(Fe(()=>{h.current&&p.current&&(S.current.maxScroll=Math.max(0,p.current.offsetHeight-h.current.offsetHeight))}),[]),N=f.useCallback(R=>{const{maxScroll:y}=S.current;return R>0?Math.pow(R,.8):R<-y?-y-Math.pow(-(R+y),.8):R},[]),L=f.useCallback(()=>{if(!d||!h.current||!v.current)return;const{currentY:R,maxScroll:y}=S.current,H=h.current.offsetHeight,V=Math.max(30,H/(H+y)*H),oe=H-V;let U=-R/y*oe,re=1;R>0?(U=0,re=1-R/H,v.current.style.transformOrigin="top"):R<-y?(U=oe,re=1-Math.abs(R+y)/H,v.current.style.transformOrigin="bottom"):v.current.style.transformOrigin="top",v.current.style.transform=`translate3d(0, ${U}px, 0) scaleY(${re})`,v.current.style.height=`${V}px`},[d]),W=f.useCallback(R=>{if(S.current.currentY=R,p.current&&(p.current.style.transform=`translate3d(0, ${R}px, 0)`),b.current){const y=Math.max(R-S.current.refreshThreshold,-S.current.refreshThreshold);b.current.style.transform=`translate3d(0, ${y}px, 0)`}m&&m(R),L()},[L]),j=f.useCallback(R=>{const y=S.current;y.frameCallback&&(O.cancelFrame(y.frameCallback),y.frameCallback=null);const H=performance.now(),V=y.currentY,oe=R-V,U=()=>{const re=performance.now()-H,Re=Math.min(re/l,1),Ve=1-Math.pow(1-Re,3),Ke=V+oe*Ve;W(Ke),Re>=1&&(y.frameCallback&&(O.cancelFrame(y.frameCallback),y.frameCallback=null),W(R),R===0&&b.current&&(b.current.textContent="Pull to refresh"))};y.frameCallback=O.frame.render(U,!0)},[W,l]),g=f.useCallback(R=>{const y=S.current;y.frameCallback&&(O.cancelFrame(y.frameCallback),y.frameCallback=null);let H=R,V=Date.now();const oe=()=>{const U=Date.now(),re=U-V;if(V=U,H*=Math.pow(.95,re/16),y.currentY+=H*re,y.currentY>0||y.currentY<-y.maxScroll){y.frameCallback&&(O.cancelFrame(y.frameCallback),y.frameCallback=null),j(y.currentY>0?0:-y.maxScroll);return}W(y.currentY),Math.abs(H)<.01&&y.frameCallback&&(O.cancelFrame(y.frameCallback),y.frameCallback=null)};y.frameCallback=O.frame.render(oe,!0)},[W,j]),D=f.useCallback(()=>{if(!d||!v.current)return;x.current!==null&&clearTimeout(x.current),requestAnimationFrame(()=>{v.current&&(v.current.style.opacity="1")});const R=window.requestIdleCallback||(y=>setTimeout(y,1e3));x.current=window.setTimeout(()=>{R(()=>{v.current&&(v.current.style.opacity="0"),x.current=null})},1e3)},[d]),T=f.useCallback(R=>{if(C.current!==null&&Date.now()-C.current<50)return;C.current=Date.now();const y=S.current;y.isScrolling=!0,y.startY=y.currentY,y.lastTimestamp=Date.now(),y.isPullingToRefresh=y.currentY===0,y.pullDistance=0,y.frameCallback&&(O.cancelFrame(y.frameCallback),y.frameCallback=null),D()},[D]),F=f.useCallback(R=>{const y=S.current;if(!y.isScrolling)return;const H=N(y.startY+R.deltaY);y.isPullingToRefresh&&H<y.startY&&(y.isPullingToRefresh=!1),W(H),a&&y.isPullingToRefresh&&!E&&H>0&&(y.pullDistance=H,b.current&&(b.current.textContent=y.pullDistance>y.refreshThreshold?"Release to refresh":"Pull to refresh")),D()},[a,W,E,D,N]),_=f.useCallback(R=>{const y=S.current;y.isScrolling&&(y.isScrolling=!1,a&&y.isPullingToRefresh&&!E&&y.pullDistance>y.refreshThreshold?X():y.currentY>0||y.currentY<-y.maxScroll?j(y.currentY>0?0:-y.maxScroll):g(R.velocityY),y.isPullingToRefresh=!1)},[a,g,j,E]),X=f.useCallback(()=>{$(!0),j(S.current.refreshThreshold),b.current&&(b.current.textContent="Refreshing..."),a&&a().then(()=>{$(!1),j(0)})},[a,j]);return f.useEffect(()=>{if(!h.current)return;const R=pr.createGesture(h.current,{name:"page-scroller-gesture",priority:10,passive:!0,direction:"y",onStart:T,onMove:F,onEnd:_});return R.init(),()=>R.destroy()},[T,F,_]),f.useEffect(()=>{if(h.current)return w(),L(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),x.current!==null&&clearTimeout(x.current)}},[w,L]),c.jsxs(O.motion.div,{id:e,ref:h,initial:{x:t||M?0:window.innerWidth,y:M?20:void 0,opacity:M&&!t?0:1},animate:{x:M||t?void 0:0,y:M?0:void 0,opacity:1,transition:{ease:[.32,.72,0,1],duration:M?.34:.44,delay:.2}},exit:{x:M||t?void 0:window.innerWidth+80,y:M?20:0,opacity:M?0:1,transition:{duration:M?.34:.6,ease:[.32,.72,0,1]}},style:{overflow:"hidden",position:r?"absolute":"relative",...o},className:k("top-0 right-0 h-full w-full bg-base-1 isolate will-change-transform",i),children:[a&&c.jsx("div",{ref:b,style:{position:"absolute",top:n?48:0,left:0,width:"100%",textAlign:"center",height:"50px",lineHeight:"50px",transform:"translateY(-50px)"},children:"Pull to refresh"}),c.jsx("div",{ref:p,style:{position:"absolute",top:0,left:0,width:"100%",willChange:"transform"},className:u,children:s}),n,d&&c.jsx("div",{ref:v,style:{position:"absolute",top:2,right:2,width:6,borderRadius:3,opacity:0,transition:"opacity 0.2s",willChange:"transform"},className:"bg-base-3"})]},`scroller${e}`)};function Wa({id:e,showScrollbar:t=!0,onRefresh:r,bounceBackDuration:n=300,isolate:s=!1,onScroll:a}){const o=f.useRef(null),i=f.useRef(null),u=f.useRef(null),l=f.useRef(null),d=f.useRef(null),[m,h]=f.useState(!1),p=f.useRef(null),b=f.useRef({startY:0,currentY:0,maxScroll:0,lastTimestamp:0,frameCallback:null,isScrolling:!1,pullDistance:0,refreshThreshold:50,isPullingToRefresh:!1}),v=f.useCallback(Fe(()=>{o.current&&i.current&&(b.current.maxScroll=Math.max(0,i.current.offsetHeight-o.current.offsetHeight))}),[]),x=f.useCallback(j=>{const{maxScroll:g}=b.current;return j>0?Math.pow(j,.8):j<-g?-g-Math.pow(-(j+g),.8):j},[]),E=f.useCallback(()=>{if(!t||!o.current||!l.current)return;const{currentY:j,maxScroll:g}=b.current,D=o.current.offsetHeight,T=Math.max(30,D/(D+g)*D),F=D-T;let _=-j/g*F,X=1;j>0?(_=0,X=1-j/D,l.current.style.transformOrigin="top"):j<-g?(_=F,X=1-Math.abs(j+g)/D,l.current.style.transformOrigin="bottom"):l.current.style.transformOrigin="top",l.current.style.transform=`translate3d(0, ${_}px, 0) scaleY(${X})`,l.current.style.height=`${T}px`},[t]),$=f.useCallback(j=>{if(b.current.currentY=j,i.current&&(i.current.style.transform=`translate3d(0, ${j}px, 0)`),u.current){const g=Math.max(j-b.current.refreshThreshold,-b.current.refreshThreshold);u.current.style.transform=`translate3d(0, ${g}px, 0)`}a&&a(j),E()},[E]),C=f.useCallback(j=>{const g=b.current;g.frameCallback&&(O.cancelFrame(g.frameCallback),g.frameCallback=null);const D=performance.now(),T=g.currentY,F=j-T,_=()=>{const X=performance.now()-D,R=Math.min(X/n,1),y=1-Math.pow(1-R,3),H=T+F*y;$(H),R>=1&&(g.frameCallback&&(O.cancelFrame(g.frameCallback),g.frameCallback=null),$(j))};g.frameCallback=O.frame.render(_,!0)},[$,n]),S=f.useCallback(j=>{const g=b.current;g.frameCallback&&(O.cancelFrame(g.frameCallback),g.frameCallback=null);let D=j,T=Date.now();const F=()=>{const _=Date.now(),X=_-T;if(T=_,D*=Math.pow(.95,X/16),g.currentY+=D*X,g.currentY>0||g.currentY<-g.maxScroll){g.frameCallback&&(O.cancelFrame(g.frameCallback),g.frameCallback=null),C(g.currentY>0?0:-g.maxScroll);return}$(g.currentY),Math.abs(D)<.01&&g.frameCallback&&(O.cancelFrame(g.frameCallback),g.frameCallback=null)};g.frameCallback=O.frame.render(F,!0)},[$,C]),M=f.useCallback(()=>{if(!t||!l.current)return;d.current!==null&&clearTimeout(d.current),requestAnimationFrame(()=>{l.current&&(l.current.style.opacity="1")});const j=window.requestIdleCallback||(g=>setTimeout(g,1e3));d.current=window.setTimeout(()=>{j(()=>{l.current&&(l.current.style.opacity="0"),d.current=null})},1e3)},[t]),w=f.useCallback(j=>{if(p.current!==null&&Date.now()-p.current<50)return;p.current=Date.now();const g=b.current;g.isScrolling=!0,g.startY=g.currentY,g.lastTimestamp=Date.now(),g.isPullingToRefresh=g.currentY===0,g.pullDistance=0,g.frameCallback&&(O.cancelFrame(g.frameCallback),g.frameCallback=null),M()},[M]),N=f.useCallback(j=>{const g=b.current;if(!g.isScrolling)return;const D=x(g.startY+j.deltaY);g.isPullingToRefresh&&D<g.startY&&(g.isPullingToRefresh=!1),$(D),r&&g.isPullingToRefresh&&!m&&D>0&&(g.pullDistance=D),M()},[r,$,m,M,x]),L=f.useCallback(()=>{h(!0),C(b.current.refreshThreshold),r&&r().then(()=>{h(!1),C(0)})},[r,C]),W=f.useCallback(j=>{const g=b.current;g.isScrolling&&(g.isScrolling=!1,r&&g.isPullingToRefresh&&!m&&g.pullDistance>g.refreshThreshold?L():g.currentY>0||g.currentY<-g.maxScroll?C(g.currentY>0?0:-g.maxScroll):S(j.velocityY),g.isPullingToRefresh=!1)},[r,S,C,m,L]);return f.useEffect(()=>{if(!o.current)return;const j=pr.createGesture(o.current,{name:"page-scroller-gesture",priority:10,passive:!0,direction:"y",onStart:w,onMove:N,onEnd:W});return j.init(),()=>j.destroy()},[w,N,W]),f.useEffect(()=>{if(o.current)return v(),E(),window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v),d.current!==null&&clearTimeout(d.current)}},[v,E]),{container:{props:{id:e,ref:o,key:`scroller${e||"default"}`},classNames:`will-change-transform overflow-hidden ${s?"isolate":""}`},content:{props:{ref:i},styles:{position:"absolute",top:0,left:0,width:"100%",willChange:"transform"}},pullToRefresh:{props:{ref:u},styles:{position:"absolute",top:0,left:0,width:"100%",textAlign:"center",height:"50px",lineHeight:"50px",transform:"translateY(-50px)"}},scrollbar:{props:{ref:l}},refreshing:m,updateMaxScroll:v,rubberBandEffect:x,updateScrollbarPosition:E,setPosition:$}}const Ia={2:"text-2xl",4:"text-4xl",5:"text-5xl",6:"text-6xl"},_a=({title:e,description:t,size:r="6",descriptionClassName:n,className:s})=>c.jsxs("div",{className:k("text-center",s),children:[c.jsx("p",{className:`${Ia[r]} font-medium`,children:e}),t?c.jsx("p",{className:k("mt-6 text-base-11",n),children:t}):null]}),Ya=f.forwardRef(({placeholder:e="Buscar",value:t,exposedRef:r,autoFocus:n,onClear:s,onChange:a,className:o,onMount:i,error:u},l)=>{const d=f.useRef(null),m=qe(),h=Lt(d,l),p=f.useCallback(()=>r&&r(d),[]);return f.useEffect(()=>{const b=async()=>{i&&await i(d,m)};p(),b()},[]),c.jsxs("div",{className:k("rounded-6 relative flex items-center bg-base-3 border-base-5",{"dark-theme:bg-red-4 light-theme:border-red-9":u,"dark-theme:bg-base-3":!u},o),children:[c.jsx("input",{ref:h,placeholder:e,value:t,onChange:a,autoComplete:"off",autoCorrect:"off",type:"search",autoFocus:n?n(m):void 0,className:k("w-full py-1.5 pl-10 pr-3 bg-transparent outline-none text-base-12 placeholder:text-base-11 [&::-webkit-search-cancel-button]:appearance-none",u&&"text-red-9 placeholder:text-red-9")}),c.jsx(A.Search,{size:20,className:k("absolute left-3 text-base-11 pointer-events-none",{"text-red-9":u})}),s&&t&&t.length>0?c.jsx("button",{onClick:()=>{s(),d.current?.focus()},className:k("absolute right-2.5 rounded-full",u?"text-red-9":"text-base-11"),children:c.jsx(A.X,{size:20})}):null]})}),dr=({el:e,direction:t,amount:r=200,multiplier:n=.4,speed:s="normal"})=>{if(!e)return;const a=t==="up"||t==="down",o=a?e.scrollTop:e.scrollLeft,i=a?e.scrollHeight-e.clientHeight:e.scrollWidth-e.clientWidth;let u;r==="max"?u=i:u=r??(a?e.clientHeight:e.clientWidth)*n;let l;if(t==="right"||t==="down"?l=Math.min(o+u,i):l=Math.max(o-u,0),l===o)return;const d={fast:.15,normal:.4,slow:.8};O.animate(0,1,{duration:d[s],ease:"easeOut",onUpdate:m=>{if(!e)return;const h=o+(l-o)*m;a?e.scrollTop=h:e.scrollLeft=h}})},za={default:[.32,.72,0,1]},fr={initial:{opacity:0},animate:{opacity:1,transition:{ease:za.default,duration:.3}},exit:{opacity:0,transition:{ease:[.32,.72,0,1],duration:.3}}},Zr=new Set,Q=new WeakMap,Pe=new WeakMap,Ce=new WeakMap,Mt=new WeakMap,Ha=new WeakMap,Le=new WeakMap,ct=new WeakMap,We=new WeakSet;let xe,Ht=0,Bt=0;const me="__aa_tgt",He="__aa_del",lt="__aa_new",Ba=e=>{const t=Ga(e);t&&t.forEach(r=>Qa(r))},qa=e=>{e.forEach(t=>{t.target===xe&&Va(),Q.has(t.target)&&Se(t.target)})};function Xa(e){Mt.get(e)?.disconnect();let r=Q.get(e),n=0;const s=5;r||(r=Oe(e),Q.set(e,r));const{offsetWidth:a,offsetHeight:o}=xe,u=[r.top-s,a-(r.left+s+r.width),o-(r.top+s+r.height),r.left-s].map(d=>`${-1*Math.floor(d)}px`).join(" "),l=new IntersectionObserver(()=>{++n>1&&Se(e)},{root:xe,threshold:1,rootMargin:u});l.observe(e),Mt.set(e,l)}function Se(e){clearTimeout(ct.get(e));const t=gt(e),r=Be(t)?500:t.duration;ct.set(e,setTimeout(async()=>{const n=Ce.get(e);try{await n?.finished,Q.set(e,Oe(e)),Xa(e)}catch{}},r))}function Va(){clearTimeout(ct.get(xe)),ct.set(xe,setTimeout(()=>{Zr.forEach(e=>nn(e,t=>en(()=>Se(t))))},100))}function Ka(e){setTimeout(()=>{Ha.set(e,setInterval(()=>en(Se.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function en(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let Dt,ut;const Ua=typeof window<"u"&&"ResizeObserver"in window;Ua&&(xe=document.documentElement,Dt=new MutationObserver(Ba),ut=new ResizeObserver(qa),window.addEventListener("scroll",()=>{Bt=window.scrollY,Ht=window.scrollX}),ut.observe(xe));function Ga(e){return e.reduce((n,s)=>[...n,...Array.from(s.addedNodes),...Array.from(s.removedNodes)],[]).every(n=>n.nodeName==="#comment")?!1:e.reduce((n,s)=>{if(n===!1)return!1;if(s.target instanceof Element){if(Nt(s.target),!n.has(s.target)){n.add(s.target);for(let a=0;a<s.target.children.length;a++){const o=s.target.children.item(a);if(o){if(He in o)return!1;Nt(s.target,o),n.add(o)}}}if(s.removedNodes.length)for(let a=0;a<s.removedNodes.length;a++){const o=s.removedNodes[a];if(He in o)return!1;o instanceof Element&&(n.add(o),Nt(s.target,o),Pe.set(o,[s.previousSibling,s.nextSibling]))}}return n},new Set)}function Nt(e,t){!t&&!(me in e)?Object.defineProperty(e,me,{value:e}):t&&!(me in t)&&Object.defineProperty(t,me,{value:e})}function Qa(e){const t=e.isConnected,r=Q.has(e);t&&Pe.has(e)&&Pe.delete(e),Ce.has(e)&&Ce.get(e)?.cancel(),lt in e?mr(e):r&&t?Za(e):r&&!t?ei(e):mr(e)}function ae(e){return Number(e.replace(/[^0-9.\-]/g,""))}function Ja(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}function Oe(e){const t=e.getBoundingClientRect(),{x:r,y:n}=Ja(e);return{top:t.top+n,left:t.left+r,width:t.width,height:t.height}}function tn(e,t,r){let n=t.width,s=t.height,a=r.width,o=r.height;const i=getComputedStyle(e);if(i.getPropertyValue("box-sizing")==="content-box"){const l=ae(i.paddingTop)+ae(i.paddingBottom)+ae(i.borderTopWidth)+ae(i.borderBottomWidth),d=ae(i.paddingLeft)+ae(i.paddingRight)+ae(i.borderRightWidth)+ae(i.borderLeftWidth);n-=d,a-=d,s-=l,o-=l}return[n,a,s,o].map(Math.round)}function gt(e){return me in e&&Le.has(e[me])?Le.get(e[me]):{duration:250,easing:"ease-in-out"}}function rn(e){if(me in e)return e[me]}function qt(e){const t=rn(e);return t?We.has(t):!1}function nn(e,...t){t.forEach(r=>r(e,Le.has(e)));for(let r=0;r<e.children.length;r++){const n=e.children.item(r);n&&t.forEach(s=>s(n,Le.has(n)))}}function Xt(e){return Array.isArray(e)?e:[e]}function Be(e){return typeof e=="function"}function Za(e){const t=Q.get(e),r=Oe(e);if(!qt(e))return Q.set(e,r);let n;if(!t)return;const s=gt(e);if(typeof s!="function"){const a=t.left-r.left,o=t.top-r.top,[i,u,l,d]=tn(e,t,r),m={transform:`translate(${a}px, ${o}px)`},h={transform:"translate(0, 0)"};s.fromBorderRadius!==void 0&&s.toBorderRadius!==void 0&&(m.borderRadius=`${s.fromBorderRadius}px`,h.borderRadius=`${s.toBorderRadius}px`),i!==u&&(m.width=`${i}px`,h.width=`${u}px`),l!==d&&(m.height=`${l}px`,h.height=`${d}px`),n=e.animate([m,h],{duration:s.duration,easing:s.easing})}else{const[a]=Xt(s(e,"remain",t,r));n=new Animation(a),n.play()}Ce.set(e,n),Q.set(e,r),n.addEventListener("finish",Se.bind(null,e))}function mr(e){lt in e&&delete e[lt];const t=Oe(e);Q.set(e,t);const r=gt(e);if(!qt(e))return;let n;if(typeof r!="function")n=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:r.duration*1.5,easing:"ease-in"});else{const[s]=Xt(r(e,"add",t));n=new Animation(s),n.play()}Ce.set(e,n),n.addEventListener("finish",Se.bind(null,e))}function hr(e,t){e.remove(),Q.delete(e),Pe.delete(e),Ce.delete(e),Mt.get(e)?.disconnect(),setTimeout(()=>{if(He in e&&delete e[He],Object.defineProperty(e,lt,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const r in t)e.style[r]=""},0)}function ei(e){if(!Pe.has(e)||!Q.has(e))return;const[t,r]=Pe.get(e);Object.defineProperty(e,He,{value:!0,configurable:!0});const n=window.scrollX,s=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):t&&t.parentNode?t.parentNode.appendChild(e):rn(e)?.appendChild(e),!qt(e))return hr(e);const[a,o,i,u]=ri(e),l=gt(e),d=Q.get(e);(n!==Ht||s!==Bt)&&ti(e,n,s,l);let m,h={position:"absolute",top:`${a}px`,left:`${o}px`,width:`${i}px`,height:`${u}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Be(l))Object.assign(e.style,h),m=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:l.duration,easing:"ease-out"});else{const[p,b]=Xt(l(e,"remove",d));b?.styleReset!==!1&&(h=b?.styleReset||h,Object.assign(e.style,h)),m=new Animation(p),m.play()}Ce.set(e,m),m.addEventListener("finish",hr.bind(null,e,h))}function ti(e,t,r,n){const s=Ht-t,a=Bt-r,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(xe).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+s,window.scrollY+a),!e.parentElement)return;const u=e.parentElement;let l=u.clientHeight,d=u.clientWidth;const m=performance.now();function h(){requestAnimationFrame(()=>{if(!Be(n)){const p=l-u.clientHeight,b=d-u.clientWidth;m+n.duration>performance.now()?(window.scrollTo({left:window.scrollX-b,top:window.scrollY-p}),l=u.clientHeight,d=u.clientWidth,h()):document.documentElement.style.scrollBehavior=o}})}h()}function ri(e){const t=Q.get(e),[r,,n]=tn(e,t,Oe(e));let s=e.parentElement;for(;s&&(getComputedStyle(s).position==="static"||s instanceof HTMLBodyElement);)s=s.parentElement;s||(s=document.body);const a=getComputedStyle(s),o=Q.get(s)||Oe(s),i=Math.round(t.top-o.top)-ae(a.borderTopWidth),u=Math.round(t.left-o.left)-ae(a.borderLeftWidth);return[i,u,r,n]}function sn(e,t={}){return Dt&&ut&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Be(t)&&!t.disrespectUserMotionPreference||(We.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),nn(e,Se,Ka,s=>ut?.observe(s)),Be(t)?Le.set(e,t):Le.set(e,{duration:250,easing:"ease-in-out",...t}),Dt.observe(e,{childList:!0}),Zr.add(e))),Object.freeze({parent:e,enable:()=>{We.add(e)},disable:()=>{We.delete(e)},isEnabled:()=>We.has(e)})}const pe={rounded:{3:"rounded-3",6:"rounded-6",full:"rounded-full"},colors:{solid:"bg-base-3",brand:"bg-brand text-brand-text",contrast:"bg-base-12 text-base-1"},unselectedColors:{none:"",solid:"bg-bg-uiel"},border:{solid:"border-base-6 dark-theme:border-base-5",subtle:"border-base-5 dark-theme:border-base-4",brand:"border-brand-border"},widths:{fit:{container:"max-w-fit",item:"w-fit"},full:{container:"w-full",item:"grow"}}},ni=({options:e,selected:t,onChange:r,keyExtractor:n,labelExtractor:s,itemColor:a,itemClassName:o,color:i="contrast",unselectedColor:u="none",width:l="fit",border:d="solid",rounded:m=6,trackScroll:h=!0,className:p})=>{const[b,v]=f.useState({left:!1,right:!1}),{ref:x}=wr({onOverflow:E=>{v({left:E.canScrollLeft,right:E.canScrollRight})},trackScroll:h});return c.jsxs("div",{className:k("relative overflow-hidden",pe.widths[l].container,pe.rounded[m],p),children:[c.jsx("div",{ref:x,className:k("flex items-center border overflow-x-scroll scrollbar-hide",pe.rounded[m],pe.border[d]),children:e.map(E=>{const $=n(t)===n(E);return c.jsx("button",{onClick:()=>r?.(E),className:k("border-r px-3 py-1 last:border-none text-nowrap shrink-0",pe.widths[l].item,!$&&"lg:hover:bg-overlay-3",a?a($):$?pe.colors[i]:pe.unselectedColors[u],pe.border[d],o),children:s(E)},n(E))})}),c.jsxs(O.AnimatePresence,{children:[b.left?c.jsx(O.motion.button,{variants:fr,initial:"initial",animate:"animate",exit:"exit",onClick:()=>{x.current&&dr({el:x.current,direction:"left"})},className:"absolute shrink-0 left-0 px-1 h-full bg-gradient-to-r from-base-2 top-0",children:c.jsx(A.ChevronLeft,{className:"text-base-13"})},"leftarrow"):null,b.right?c.jsx(O.motion.button,{variants:fr,initial:"initial",animate:"animate",exit:"exit",onClick:()=>{x.current&&dr({el:x.current,direction:"right"})},className:"absolute shrink-0 right-0 px-1 h-full bg-gradient-to-l from-base-2 top-0",children:c.jsx(A.ChevronRight,{className:"text-base-13"})},"rightarrow"):null]})]})};function on({label:e,labelPosition:t="default",options:r,selected:n,onChange:s,idExtractor:a,labelExtractor:o,descriptionExtractor:i,classNameExtractor:u,customGetter:l,customSetter:d,error:m,placeholder:h="Selecciona una opción",searchable:p,className:b}){const[v,x]=f.useState(-1),E=f.useRef(null),{triggerRef:$,triggerProps:C,popoverRef:S,getPopoverPosition:M,open:w,toggle:N,close:L}=ft({align:"start",side:"bottom",avoidCollisions:!0,onOpen:()=>{p&&E.current&&setTimeout(()=>E.current?.focus(),10)},onClose:()=>{x(-1)}});dt(S,g=>{!$.current||!w||!g.target||$.current.contains(g.target)||L()});const W=M(),j=l&&n?l(n,r):n;return c.jsxs("div",{className:k("relative",b),children:[t==="default"&&c.jsx("label",{className:k("top-[18px] font-medium ml-0.5 text-xs",m&&"text-red-9"),children:e}),c.jsxs(q,{ref:$,color:"solidhybrid",className:"w-full justify-between",onClick:N,...C,children:[j?o(j):h,c.jsx(A.ChevronDown,{size:18,className:k("transition",w&&"rotate-180")})]}),c.jsx(O.AnimatePresence,{children:w&&c.jsx($e,{children:c.jsx(O.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.15},ref:S,style:{position:"fixed",left:W.x,top:W.top,bottom:W.bottom,width:$.current?.offsetWidth??200},className:k("bg-base-1 dark-theme:bg-base-3 border border-base-4","rounded-6 shadow-lg max-h-[300px] overflow-y-auto z-50","customscrollbarnohide"),role:"listbox",children:r.map((g,D)=>{const T=!!(j&&a(g)===a(j)),F=D===v,_=i?.(g);return c.jsxs("div",{className:k("px-3 py-2 text-sm cursor-pointer flex items-center justify-between gap-x-4","first:rounded-t-6 last:rounded-b-6 relative",F&&"bg-base-3 dark-theme:bg-base-4",T&&"bg-brandfadedbg text-brand",u&&u(T)),onClick:()=>{s(d?d(g):g),L()},role:"option",onMouseEnter:()=>x(D),children:[c.jsxs("div",{children:[c.jsxs("p",{children:[o(g)," "]}),_&&c.jsx("p",{className:"text-xs text-base-11 mt-0.5 line-clamp-2",children:_})]}),T&&c.jsx(A.CheckIcon,{size:16,className:"shrink-0"})]},a(g))})})})})]})}const si=({name:e,...t})=>{const{control:r}=J.useFormContext();return r?c.jsx(J.Controller,{name:e,control:r,render:({field:n,fieldState:s})=>c.jsx(on,{selected:n.value??null,onChange:a=>n.onChange(a),error:s.error?.message,...t})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},oi=({className:e})=>c.jsx("div",{className:k("w-full h-px bg-base-4",e)}),ai=({text:e,length:t=120,size:r="sm",className:n,buttonClassName:s})=>{const[a,o]=f.useState(!1),i=f.useMemo(()=>e.length>t,[e]),u=f.useMemo(()=>i?a?e:e.slice(0,t).trim()+"...":e,[e,a,i]);return c.jsxs("div",{children:[c.jsx("p",{className:k("text-base-12",r==="sm"&&"text-sm",n),children:u}),i?c.jsx("button",{onClick:()=>o(l=>!l),className:k("text-xs text-base-11",s),children:a?"Ver menos":"Ver más"}):null]})},Vt=({loading:e=!0,wrapperClassName:t,spinnerClassName:r})=>c.jsx("div",{className:k("flex justify-center",t),children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",className:k({"animate-spin":e},r),children:c.jsx("path",{fill:"currentColor",d:"M10 3a7 7 0 0 0-7 7a.5.5 0 0 1-1 0a8 8 0 1 1 8 8a.5.5 0 0 1 0-1a7 7 0 1 0 0-14Z"})})}),ii=({isEditable:e,isDeletable:t=!0,createUpdateLoading:r,deleteLoading:n,onDelete:s,onDeleteConfirm:a,addText:o="Añadir",updateText:i="Actualizar",deleteText:u="Eliminar",className:l})=>{const[d,m]=f.useState(!1);return c.jsxs("div",{className:`w-full grid grid-cols-2 gap-4 col-span-full ${l}`,children:[e&&t?c.jsxs(q,{color:"dangersolid",state:n?"loading":r?"disabled":"enabled",onClick:()=>{a?d?s?.():m(!0):s?.()},children:[c.jsx(A.X,{size:18}),a&&d?"Confirmar":u]}):null,c.jsxs(q,{color:"brand",className:k(e&&t?"":"col-span-2"),state:r?"loading":n?"disabled":"enabled",type:"submit",children:[r?c.jsx(Vt,{}):e?c.jsx(A.Check,{size:18}):c.jsx(A.Plus,{size:18}),e?i:o]})]})},an=f.createContext(void 0),ci=({children:e,debug:t=!1})=>{const r=f.useRef([]),n=f.useCallback(d=>{r.current.push(d),t&&console.log("Modal",d,"added",r.current)},[t]),s=f.useCallback(d=>{r.current=r.current.filter(m=>m!==d),t&&console.log("Modal",d,"removed",r.current)},[t]),a=f.useCallback(()=>{const d=r.current[r.current.length-2];return t&&console.log("prev modal id",d),d},[t]),o=f.useCallback((d,m="modal",h)=>{O.animate(d,{y:m==="modal"?-30:-50,scale:.9},{ease:[.32,.72,0,1],duration:.3,delay:h?.2:void 0})},[]),i=f.useCallback(d=>{O.animate(d,{y:0,scale:1},{ease:[.32,.72,0,1],duration:.2})},[]),u=f.useCallback(()=>r.current,[]),l={add:n,remove:s,getPrevId:a,animateParentModal:o,restoreParentModal:i,getModals:u};return c.jsx(an.Provider,{value:l,children:e})},cn=()=>{const e=f.useContext(an);if(e===void 0)throw new Error("useModals must be used within a ModalsProvider");return e},li=({withPortal:e,children:t})=>e?c.jsx($e,{children:t}):c.jsx(c.Fragment,{children:t}),ui=({id:e,prevPath:t,withDelay:r,withPortal:n=!0,title:s,description:a,showHeader:o=!0,mode:i,onReplace:u,className:l,contentClassName:d,children:m})=>{const h=de.useInitialChangeEvent(),p=qe(),b=f.useRef(null),v=cn(),x=f.useMemo(()=>i==="modal"||p,[i,p]);return f.useEffect(()=>{v.add(e);const E=v.getPrevId();if(!E||(b.current=document.getElementById(E),!b.current))return;E&&v.animateParentModal(b.current,x?"modal":"sheet");//! cleanups not running on new router system
|
|
12
12
|
//! IDK WHY
|
|
13
13
|
return()=>{console.log("IS THIS CLEANUP RUNNING?")};//! NOT RUNNING...
|
|
14
|
-
},[p]),f.useLayoutEffect(()=>()=>v.remove(e),[]),c.jsxs(
|
|
14
|
+
},[p]),f.useLayoutEffect(()=>()=>v.remove(e),[]),c.jsxs(li,{withPortal:n,children:[c.jsx(O.motion.div,{initial:{opacity:0},animate:{opacity:1,transition:{ease:[.32,.72,0,1],duration:.3,delay:r?.2:void 0}},exit:{opacity:0,transition:{ease:[.32,.72,0,1],duration:.3}},onClick:()=>{h?de.navigate.back():de.navigate.replace(u??t)},className:k("bg-black/40 absolute w-full h-full left-0 top-0",n&&"z-500")}),c.jsxs(O.motion.div,{id:e,initial:{opacity:x?0:1,scale:x?.8:void 0,y:x?void 0:window.innerHeight},animate:{opacity:1,scale:1,y:x?void 0:0,transition:{ease:[.32,.72,0,1],duration:.3,delay:r?.2:void 0}},exit:{scale:x?.8:void 0,opacity:x?0:void 0,y:x?void 0:window.innerHeight,transition:{ease:[.32,.72,0,1],duration:.3}},style:{left:"50%",translateX:"-50%",bottom:x?"50%":0,translateY:x?"50%":0,height:x?"65%":"95%"},onAnimationStart:E=>{(E?.scale===.8||E?.y>50)&&b.current&&v.restoreParentModal(b.current)},className:k("bg-base-1 absolute w-full lg:max-w-[600px] h-full rounded-6 overflow-hidden flex flex-col",!x&&"rounded-b-none",n&&"z-500",l),children:[o&&c.jsxs("div",{className:"flex items-start justify-between p-4 border-b border-base-3",children:[c.jsxs("div",{children:[s&&c.jsx("p",{className:"font-medium text-lg",children:s}),a&&c.jsx("p",{className:"text-base-11 text-xs",children:a})]}),c.jsx(q,{size:"xs",onClick:()=>{h?de.navigate.back():de.navigate.replace(u??t)},children:c.jsx(A.X,{size:20})})]}),c.jsx("div",{id:`${e}-content`,className:k("grow customscrollbar p-4 pb-6",d),children:m})]})]})};function ln({checked:e,onCheckedChange:t,disabled:r=!1,name:n,required:s,className:a=""}){const o=f.useId(),i=()=>{r||t(!e)};return c.jsxs("button",{id:o,type:"button",role:"switch","aria-checked":e,"aria-required":s,"data-state":e?"checked":"unchecked",disabled:r,onClick:i,className:k(`relative inline-flex h-[28px] w-[48px] items-center rounded-full
|
|
15
15
|
transition-colors duration-200 ease-in-out
|
|
16
16
|
focus-visible:outline-none focus-visible:ring-1
|
|
17
17
|
focus-visible:ring-base-6`,e?"bg-brand":"bg-base-3",r?"opacity-50 cursor-not-allowed":"cursor-pointer",a),children:[c.jsx("span",{className:k(`inline-block h-6 w-6 transform rounded-full
|
|
18
18
|
transition-transform duration-200 ease-in-out
|
|
19
|
-
shadow`,e?"bg-brand-text translate-x-[22px]":"bg-base-1 dark-theme:bg-base-12 translate-x-[2px]")}),n&&c.jsx("input",{type:"checkbox",name:n,checked:e,required:s,disabled:r,onChange:()=>{},tabIndex:-1,"aria-hidden":"true",className:"sr-only"})]})}const cn=({label:e,variant:t="default",color:r="solid",tags:n,onChange:s,valid:a,error:o,placeholder:i="Add a tag...",maxTags:u,validateTag:l})=>{const[d,m]=f.useState(""),[h,p]=f.useState(!1),[b,v]=f.useState(null),x=f.useRef(null),E=f.useRef(null),$=f.useRef([]),j=n.length>0,S=f.useRef(`taginput-${Math.random().toString(36).substr(2,9)}`).current,M=f.useRef(`label-${Math.random().toString(36).substr(2,9)}`).current,w=f.useRef(`error-${Math.random().toString(36).substr(2,9)}`).current;f.useEffect(()=>{$.current=$.current.slice(0,n.length)},[n.length]);const N=T=>{if(T.key==="Enter"&&d.trim()){T.preventDefault();const F=d.trim();if(u&&n.length>=u){v(`Maximum of ${u} tags allowed`);return}if(n.includes(F)){v("Tag already exists");return}if(l){const Y=l(F);if(typeof Y=="string"){v(Y);return}else if(Y===!1){v("Invalid tag");return}}s([...n,F]),m(""),v(null),D(`Added tag ${F}`)}else if(T.key==="Backspace"&&!d&&n.length>0){const F=n[n.length-1];s(n.slice(0,-1)),D(`Removed tag ${F}`)}else T.key==="ArrowLeft"&&d===""&&n.length>0&&$.current[n.length-1]&&$.current[n.length-1]?.focus()},O=(T,F)=>{if(T.key==="Backspace"||T.key==="Delete"){T.preventDefault();const Y=n[F],X=[...n];X.splice(F,1),s(X),setTimeout(()=>{x.current&&x.current.focus()},0),D(`Removed tag ${Y}`)}else T.key==="ArrowRight"?(T.preventDefault(),F<n.length-1?$.current[F+1]?.focus():x.current?.focus()):T.key==="ArrowLeft"&&(T.preventDefault(),F>0&&$.current[F-1]?.focus())},W=(T,F)=>{s(n.filter(Y=>Y!==T)),setTimeout(()=>{F<n.length-1?$.current[F]?.focus():F>0?$.current[F-1]?.focus():x.current?.focus()},0),D(`Removed tag ${T}`)},C=T=>{m(T.target.value),v(null)},g=()=>{x.current&&x.current.focus()},D=T=>{console.log(`Accessibility announcement: ${T}`)};return c.jsxs("div",{children:[c.jsxs("div",{className:"relative",ref:E,children:[t==="default"?c.jsxs("label",{id:M,htmlFor:S,className:k("text-base top-4 font-semibold left-3",{"text-sm top-2 left-2":h||j||i,"text-red-9":!!o}),children:[e," ",u&&`(${n.length}/${u})`]}):null,c.jsxs("div",{className:k("rounded-6 px-2 transition cursor-text pr-10",{"bg-base-3":r==="solid","border border-uielborder focus-visible:border-transparent":r==="outline","py-3":t==="default","pt-5 pb-2":t==="floating","ring-2 ring-branduielborder":h,"text-red-9":o||b,"ring-2 ring-red-6":(o||b)&&h}),onClick:g,role:"group","aria-labelledby":M,"aria-describedby":o||b?w:void 0,children:[t==="floating"?c.jsxs("label",{id:M,htmlFor:S,className:k("absolute transition-all duration-200 pointer-events-none","text-base top-4 font-semibold left-3",{"text-sm top-2 left-2":h||j||i,"text-red-9":!!o}),children:[e," ",u&&`(${n.length}/${u})`]}):null,c.jsxs("div",{className:k("flex flex-wrap gap-1 items-center",{"mt-2.5":t==="floating"}),children:[n.map((T,F)=>c.jsxs("div",{ref:Y=>{$.current[F]=Y},className:k("line-clamp-1 text-brand rounded-full px-2 text-sm flex items-center",{"bg-brandfadedbg text-brand":!o&&!b,"bg-red-4 text-red-9":o||b}),tabIndex:0,role:"button","aria-label":`${T}, press delete or backspace to remove`,onKeyDown:Y=>O(Y,F),children:[T,c.jsx("button",{type:"button",className:"ml-1 text-brand hover:text-brandhover shrink-0",onClick:()=>W(T,F),"aria-label":`Remove ${T} tag`,children:"x"})]},`${T}-${F}`)),c.jsx("input",{id:S,ref:x,type:"text",className:"flex-grow min-w-[60px] bg-transparent outline-none placeholder:text-sm placeholder:text-secondarytext",value:d,onChange:C,onKeyDown:N,onFocus:()=>p(!0),onBlur:()=>p(!1),enterKeyHint:"enter",autoComplete:"off",placeholder:n.length>0?"":i,style:{width:`${Math.max(60,d.length*8)}px`},"aria-describedby":o||b?w:void 0,"aria-invalid":!!(o||b)})]})]}),a&&c.jsx("span",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:c.jsx(A.CheckIcon,{})})]}),(o||b)&&c.jsx("p",{id:w,className:"text-red-500 text-xs mt-1","aria-live":"assertive",children:o||b}),c.jsx("div",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:n.length>0?`Current tags: ${n.join(", ")}`:"No tags added yet"})]})},ci=({name:e,...t})=>{const{control:r}=J.useFormContext();return r?c.jsx(J.Controller,{name:e,control:r,render:({field:n,fieldState:s})=>c.jsx(cn,{tags:n.value,onChange:a=>n.onChange(a),error:s.error?.message,...t})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},li={brand:"ring-1 ring-brand",solid:"ring-1 ring-base-6"},Vt=f.forwardRef(({label:e,labelPosition:t="default",placeholder:r,error:n,focusColor:s="brand",className:a,value:o,rows:i=3,...u},l)=>{const[d,m]=f.useState(!1),h=o!==""&&o!==null&&o!==void 0;return c.jsxs("div",{className:"relative",children:[t==="default"?c.jsx("label",{className:k("top-[18px] font-medium ml-0.5 text-xs",n&&"text-red-9"),children:e}):null,c.jsxs("div",{className:k(t==="default"?"p-0":"pt-5 pb-2",{"bg-red-4 text-red-9":!!n}),children:[t==="floating"&&c.jsx("label",{className:k("absolute transition-all duration-200 pointer-events-none","text-sm top-2.5 font-semibold left-2.5",{"text-xs top-2.5":d||h||r,"text-red-9":!!n}),children:e}),c.jsx("textarea",{ref:l,className:k(!n&&d&&li[s],"bg-base-3 border border-base-4 light-theme:drop-shadow-sm rounded-6 w-full focus-visible:outline-none customscrollbarnohide","placeholder:text-base-11 text-sm","resize-none",t==="default"?"p-3":"mt-1",{"text-red-9 placeholder:text-red-9":!!n},a),value:o,placeholder:r,onFocus:()=>m(!0),onBlur:()=>m(!1),rows:i,...u})]})]})});Vt.displayName="TextArea";const ui=({name:e,customRead:t,customSet:r,...n})=>{const{control:s}=J.useFormContext(),a=f.useCallback(i=>t?t(i):i===null?Pt(i):i,[t]),o=f.useCallback(i=>r?r(i):i===null?rt(i):i,[r]);return s?c.jsx(J.Controller,{name:e,control:s,render:({field:i,fieldState:u})=>c.jsxs("div",{children:[c.jsx(Vt,{value:a(i.value),onChange:l=>i.onChange(o(l.target.value)),error:!!u.error,ref:i.ref,...n}),u.error?c.jsx("span",{role:"alert",className:"text-red-9 text-sm mt-1 ml-0.5",children:u.error.message}):null]})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},di=["Lunes","Martes","Miercoles","Jueves","Viernes","Sábado","Domingo"],fi=()=>c.jsx(mi,{}),mi=()=>c.jsx("div",{children:di.map(e=>c.jsx(hi,{day:e},e))}),hi=({day:e})=>{const[t,r]=f.useState(!1),n=f.useRef(null);return f.useEffect(()=>{n.current&&rn(n.current)},[]),c.jsxs("div",{ref:n,className:k("p-2 rounded-xl mt-2",{"border border-uielborder":t,"bg-uielbg border border-transparent":!t}),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("p",{children:e}),c.jsx(an,{className:"mt-0",checked:t,onCheckedChange:s=>r(s)})]}),t?c.jsx(bi,{}):null]},e)},bi=()=>{const[e,t]=f.useState([{from:"08:00",to:"12:00"},{from:"14:00",to:"18:00"}]),r=f.useRef(null);return f.useEffect(()=>{r.current&&rn(r.current)},[]),c.jsxs("div",{ref:r,children:[e.map((n,s)=>c.jsxs("div",{className:"flex items-center justify-between mt-2",children:[c.jsx("p",{className:"text-sm text-secondarytext",children:"De"}),c.jsx(q,{color:"solid",className:"w-24",children:n.from}),c.jsx("p",{className:"text-sm text-secondarytext mx-1",children:"a"}),c.jsx(q,{color:"solid",className:"w-24",children:n.to}),c.jsx(q,{className:"rounded-full",children:c.jsx(A.X,{className:"text-secondarytext",size:20})})]},`${n.from}${s}`)),c.jsxs(q,{onClick:()=>t(n=>[...n,{from:"19:00",to:"21:00"}]),className:"w-full mt-4",color:"contrast",children:[c.jsx(A.Plus,{className:"stroke-1"}),"Añadir hora"]})]})};/**
|
|
20
|
-
* @license
|
|
21
|
-
* Attempt
|
|
22
|
-
* Copyright (c) 2025 Mateo Suarez. All rights reserved.
|
|
23
|
-
*
|
|
24
|
-
* Free to use in your own personal or commercial applications and projects.
|
|
25
|
-
* Unauthorized copying, modification, or distribution is strictly prohibited.
|
|
26
|
-
* See LICENSE file for full terms.
|
|
27
|
-
*/class pi{listeners=new Map;emit(t,r){let n=this.listeners.get(t);n&&n.forEach(s=>s(r))}listen(t,r){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r),()=>{let n=this.listeners.get(t);n&&(n.delete(r),n.size===0&&this.listeners.delete(t))}}}class gi{constructor(){this.listeners=new Map}emit(t,r){const n=this.listeners.get(t);n&&n.forEach(s=>s(r))}listen(t,r){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r),()=>{const n=this.listeners.get(t);n&&(n.delete(r),n.size===0&&this.listeners.delete(t))}}}function tt(e,t,r=!0){const n=f.useRef(void 0);f.useEffect(()=>(r||n.current&&n.current(),n.current=ie.listen(e,t),()=>n.current&&n.current()),[e,t,r])}const ie=new pi;function ln(e=8){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let r="";for(let n=0;n<e;n++)r+=t.charAt(Math.floor(Math.random()*t.length));return r}const vi=({colors:e})=>{const[t,r]=f.useState([]),n=f.useCallback(o=>{r(i=>[...i,{...o,id:o.id??ln()}])},[]),s=f.useCallback(o=>r(i=>i.filter(u=>u.id!==o)),[]),a=f.useCallback((o,i)=>{r(u=>{const l=u.findIndex(h=>h.id===o);if(l===-1)return u;const d=u[l];return[...u.slice(0,l),{...d,...i},...u.slice(l+1)]})},[]);return tt("create-toast",o=>{n(o)}),tt("update-toast",o=>{a(o.id,o.toast)}),tt("remove-toast",o=>{s(o.id)}),c.jsx($e,{children:c.jsx(L.motion.div,{id:"toaster",className:"fixed z-9999 top-[calc(var(--safe-area-top)+0px)] pointer-events-none left-0 mt-4 mb-4 px-4 w-full flex flex-col gap-y-2 items-center justify-center",children:c.jsx(L.AnimatePresence,{mode:"popLayout",children:t.map(o=>c.jsx(wi,{toast:o,remove:s,colors:e},o.id))})})})},xi={simple:{icon:A.ArrowRight,color:"text-base-12"},info:{icon:A.Info,color:"text-blue-9"},success:{icon:A.CheckCircle,color:"text-brand"},warning:{icon:A.TriangleAlert,color:"text-yellow-9"},error:{icon:A.XCircle,color:"text-red-9"}},wi=({toast:e,remove:t,colors:r})=>{f.useEffect(()=>{let a;return e.type==="loading"?a=setTimeout(()=>{t(e.id)},e?.timeout??1e4):a=setTimeout(()=>{t(e.id)},e?.duration??3e3),()=>clearTimeout(a)},[e.type,e.id,e.duration,e.timeout,t]);const n=f.useMemo(()=>r?r[e.type]??null:null,[r]),s=f.useMemo(()=>xi[e.type]??null,[e.type]);return c.jsxs(L.motion.div,{layout:!0,initial:{y:-40,opacity:0},animate:{y:0,opacity:1},exit:{y:-40,opacity:0},className:k("p-2 max-w-96 origin-center rounded-6 flex items-center gap-x-1.5 bg-base-1"),children:[e.type==="loading"?c.jsx(Xt,{wrapperClassName:"shrink-0",spinnerClassName:"h-5 w-5"}):e.type!=="simple"&&s?c.jsx(s.icon,{size:20,className:k("shrink-0",n??s.color)}):null,c.jsx("p",{className:"text-sm",children:e.message})]})},yi={simple:(e,t)=>ie.emit("create-toast",{type:"simple",message:e,...t}),info:(e,t)=>ie.emit("create-toast",{type:"info",message:e,...t}),success:(e,t)=>ie.emit("create-toast",{type:"success",message:e,...t}),warning:(e,t)=>ie.emit("create-toast",{type:"warning",message:e,...t}),error:(e,t)=>ie.emit("create-toast",{type:"error",message:e,...t}),loading:(e,t)=>{const r=ln();return ie.emit("create-toast",{id:r,type:"loading",message:e,...t}),r},update:(e,t)=>{ie.emit("update-toast",{id:e,toast:t})},dismiss:e=>{ie.emit("remove-toast",{id:e})}};exports.AliveScope=ja;exports.Avatar=yn;exports.AvatarsGroup=kn;exports.Button=q;exports.Calendar=Yt;exports.Checkbox=Yr;exports.ConfirmationDialog=aa;exports.DatePickerDemo=ra;exports.DatePickerPopover=na;exports.DateTimePicker=oa;exports.ElasticHeader=ia;exports.EventEmitter=gi;exports.FocusTrap=xn;exports.Form=xa;exports.FormInput=Na;exports.FormMultiSelect=Oa;exports.FormSelect=ti;exports.FormSubmit=si;exports.FormTags=ci;exports.FormTextArea=ui;exports.FormWorkingHours=fi;exports.Icon=Vr;exports.Input=It;exports.KeepAlive=Ma;exports.List=Da;exports.ListItem=Pa;exports.ModalsProvider=oi;exports.MultiSelect=Gr;exports.PageScroller=La;exports.PageTitle=Aa;exports.PopoverCard=_r;exports.PopoverCardContent=Zo;exports.PopoverCardFooter=ea;exports.PopoverCardHeader=Jo;exports.Portal=$e;exports.SearchInput=Wa;exports.SegmentedControl=ei;exports.Select=nn;exports.Separator=ri;exports.ShowMoreText=ni;exports.Spinner=Xt;exports.SuperModal=ii;exports.Switch=an;exports.Tags=cn;exports.TextArea=Vt;exports.TimePicker=sa;exports.Toaster=vi;exports.calculatePopoverPosition=yr;exports.checkOverflow=Ye;exports.cn=k;exports.debounce=pn;exports.eventEmitter=ie;exports.extractDirtyData=vn;exports.generateInitials=pr;exports.nullRead=Pt;exports.nullSet=rt;exports.removeWhitespaces=vr;exports.setFocusEnd=gr;exports.throttle=Fe;exports.toTitleCase=gn;exports.toast=yi;exports.useClickAway=Nn;exports.useClickAwayAdvanced=En;exports.useClickAwayWithRef=dt;exports.useEventListener=tt;exports.useKeepAlive=Ta;exports.useKeyListener=wr;exports.useLargeScreen=qe;exports.useLongPress=jn;exports.useMergedRef=Ot;exports.useMethods=wa;exports.useModals=on;exports.useNetwork=$n;exports.useOverflow=xr;exports.useOverflowState=wn;exports.usePopover=ft;exports.useRipple=kr;exports.useScroller=Fa;
|
|
19
|
+
shadow`,e?"bg-brand-text translate-x-[22px]":"bg-base-1 dark-theme:bg-base-12 translate-x-[2px]")}),n&&c.jsx("input",{type:"checkbox",name:n,checked:e,required:s,disabled:r,onChange:()=>{},tabIndex:-1,"aria-hidden":"true",className:"sr-only"})]})}const un=({label:e,variant:t="default",color:r="solid",tags:n,onChange:s,valid:a,error:o,placeholder:i="Add a tag...",maxTags:u,validateTag:l})=>{const[d,m]=f.useState(""),[h,p]=f.useState(!1),[b,v]=f.useState(null),x=f.useRef(null),E=f.useRef(null),$=f.useRef([]),C=n.length>0,S=f.useRef(`taginput-${Math.random().toString(36).substr(2,9)}`).current,M=f.useRef(`label-${Math.random().toString(36).substr(2,9)}`).current,w=f.useRef(`error-${Math.random().toString(36).substr(2,9)}`).current;f.useEffect(()=>{$.current=$.current.slice(0,n.length)},[n.length]);const N=T=>{if(T.key==="Enter"&&d.trim()){T.preventDefault();const F=d.trim();if(u&&n.length>=u){v(`Maximum of ${u} tags allowed`);return}if(n.includes(F)){v("Tag already exists");return}if(l){const _=l(F);if(typeof _=="string"){v(_);return}else if(_===!1){v("Invalid tag");return}}s([...n,F]),m(""),v(null),D(`Added tag ${F}`)}else if(T.key==="Backspace"&&!d&&n.length>0){const F=n[n.length-1];s(n.slice(0,-1)),D(`Removed tag ${F}`)}else T.key==="ArrowLeft"&&d===""&&n.length>0&&$.current[n.length-1]&&$.current[n.length-1]?.focus()},L=(T,F)=>{if(T.key==="Backspace"||T.key==="Delete"){T.preventDefault();const _=n[F],X=[...n];X.splice(F,1),s(X),setTimeout(()=>{x.current&&x.current.focus()},0),D(`Removed tag ${_}`)}else T.key==="ArrowRight"?(T.preventDefault(),F<n.length-1?$.current[F+1]?.focus():x.current?.focus()):T.key==="ArrowLeft"&&(T.preventDefault(),F>0&&$.current[F-1]?.focus())},W=(T,F)=>{s(n.filter(_=>_!==T)),setTimeout(()=>{F<n.length-1?$.current[F]?.focus():F>0?$.current[F-1]?.focus():x.current?.focus()},0),D(`Removed tag ${T}`)},j=T=>{m(T.target.value),v(null)},g=()=>{x.current&&x.current.focus()},D=T=>{console.log(`Accessibility announcement: ${T}`)};return c.jsxs("div",{children:[c.jsxs("div",{className:"relative",ref:E,children:[t==="default"?c.jsxs("label",{id:M,htmlFor:S,className:k("text-base top-4 font-semibold left-3",{"text-sm top-2 left-2":h||C||i,"text-red-9":!!o}),children:[e," ",u&&`(${n.length}/${u})`]}):null,c.jsxs("div",{className:k("rounded-6 px-2 transition cursor-text pr-10",{"bg-base-3":r==="solid","border border-uielborder focus-visible:border-transparent":r==="outline","py-3":t==="default","pt-5 pb-2":t==="floating","ring-2 ring-branduielborder":h,"text-red-9":o||b,"ring-2 ring-red-6":(o||b)&&h}),onClick:g,role:"group","aria-labelledby":M,"aria-describedby":o||b?w:void 0,children:[t==="floating"?c.jsxs("label",{id:M,htmlFor:S,className:k("absolute transition-all duration-200 pointer-events-none","text-base top-4 font-semibold left-3",{"text-sm top-2 left-2":h||C||i,"text-red-9":!!o}),children:[e," ",u&&`(${n.length}/${u})`]}):null,c.jsxs("div",{className:k("flex flex-wrap gap-1 items-center",{"mt-2.5":t==="floating"}),children:[n.map((T,F)=>c.jsxs("div",{ref:_=>{$.current[F]=_},className:k("line-clamp-1 text-brand rounded-full px-2 text-sm flex items-center",{"bg-brandfadedbg text-brand":!o&&!b,"bg-red-4 text-red-9":o||b}),tabIndex:0,role:"button","aria-label":`${T}, press delete or backspace to remove`,onKeyDown:_=>L(_,F),children:[T,c.jsx("button",{type:"button",className:"ml-1 text-brand hover:text-brandhover shrink-0",onClick:()=>W(T,F),"aria-label":`Remove ${T} tag`,children:"x"})]},`${T}-${F}`)),c.jsx("input",{id:S,ref:x,type:"text",className:"flex-grow min-w-[60px] bg-transparent outline-none placeholder:text-sm placeholder:text-secondarytext",value:d,onChange:j,onKeyDown:N,onFocus:()=>p(!0),onBlur:()=>p(!1),enterKeyHint:"enter",autoComplete:"off",placeholder:n.length>0?"":i,style:{width:`${Math.max(60,d.length*8)}px`},"aria-describedby":o||b?w:void 0,"aria-invalid":!!(o||b)})]})]}),a&&c.jsx("span",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:c.jsx(A.CheckIcon,{})})]}),(o||b)&&c.jsx("p",{id:w,className:"text-red-500 text-xs mt-1","aria-live":"assertive",children:o||b}),c.jsx("div",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:n.length>0?`Current tags: ${n.join(", ")}`:"No tags added yet"})]})},di=({name:e,...t})=>{const{control:r}=J.useFormContext();return r?c.jsx(J.Controller,{name:e,control:r,render:({field:n,fieldState:s})=>c.jsx(un,{tags:n.value,onChange:a=>n.onChange(a),error:s.error?.message,...t})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},fi={brand:"ring-1 ring-brand",solid:"ring-1 ring-base-6"},Kt=f.forwardRef(({label:e,labelPosition:t="default",placeholder:r,error:n,focusColor:s="brand",className:a,value:o,rows:i=3,...u},l)=>{const[d,m]=f.useState(!1),h=o!==""&&o!==null&&o!==void 0;return c.jsxs("div",{className:"relative",children:[t==="default"?c.jsx("label",{className:k("top-[18px] font-medium ml-0.5 text-xs",n&&"text-red-9"),children:e}):null,c.jsxs("div",{className:k(t==="default"?"p-0":"pt-5 pb-2",{"bg-red-4 text-red-9":!!n}),children:[t==="floating"&&c.jsx("label",{className:k("absolute transition-all duration-200 pointer-events-none","text-sm top-2.5 font-semibold left-2.5",{"text-xs top-2.5":d||h||r,"text-red-9":!!n}),children:e}),c.jsx("textarea",{ref:l,className:k(!n&&d&&fi[s],"bg-base-3 border border-base-4 light-theme:drop-shadow-sm rounded-6 w-full focus-visible:outline-none customscrollbarnohide","placeholder:text-base-11 text-sm","resize-none",t==="default"?"p-3":"mt-1",{"text-red-9 placeholder:text-red-9":!!n},a),value:o,placeholder:r,onFocus:()=>m(!0),onBlur:()=>m(!1),rows:i,...u})]})]})});Kt.displayName="TextArea";const mi=({name:e,customRead:t,customSet:r,...n})=>{const{control:s}=J.useFormContext(),a=f.useCallback(i=>t?t(i):i===null?Pt(i):i,[t]),o=f.useCallback(i=>r?r(i):i===null?rt(i):i,[r]);return s?c.jsx(J.Controller,{name:e,control:s,render:({field:i,fieldState:u})=>c.jsxs("div",{children:[c.jsx(Kt,{value:a(i.value),onChange:l=>i.onChange(o(l.target.value)),error:!!u.error,ref:i.ref,...n}),u.error?c.jsx("span",{role:"alert",className:"text-red-9 text-sm mt-1 ml-0.5",children:u.error.message}):null]})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},hi=["Lunes","Martes","Miercoles","Jueves","Viernes","Sábado","Domingo"],bi=()=>c.jsx(pi,{}),pi=()=>c.jsx("div",{children:hi.map(e=>c.jsx(gi,{day:e},e))}),gi=({day:e})=>{const[t,r]=f.useState(!1),n=f.useRef(null);return f.useEffect(()=>{n.current&&sn(n.current)},[]),c.jsxs("div",{ref:n,className:k("p-2 rounded-xl mt-2",{"border border-uielborder":t,"bg-uielbg border border-transparent":!t}),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("p",{children:e}),c.jsx(ln,{className:"mt-0",checked:t,onCheckedChange:s=>r(s)})]}),t?c.jsx(vi,{}):null]},e)},vi=()=>{const[e,t]=f.useState([{from:"08:00",to:"12:00"},{from:"14:00",to:"18:00"}]),r=f.useRef(null);return f.useEffect(()=>{r.current&&sn(r.current)},[]),c.jsxs("div",{ref:r,children:[e.map((n,s)=>c.jsxs("div",{className:"flex items-center justify-between mt-2",children:[c.jsx("p",{className:"text-sm text-secondarytext",children:"De"}),c.jsx(q,{color:"solid",className:"w-24",children:n.from}),c.jsx("p",{className:"text-sm text-secondarytext mx-1",children:"a"}),c.jsx(q,{color:"solid",className:"w-24",children:n.to}),c.jsx(q,{className:"rounded-full",children:c.jsx(A.X,{className:"text-secondarytext",size:20})})]},`${n.from}${s}`)),c.jsxs(q,{onClick:()=>t(n=>[...n,{from:"19:00",to:"21:00"}]),className:"w-full mt-4",color:"contrast",children:[c.jsx(A.Plus,{className:"stroke-1"}),"Añadir hora"]})]})};class xi{constructor(){this.listeners=new Map}emit(t,r){const n=this.listeners.get(t);n&&n.forEach(s=>s(r))}listen(t,r){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r),()=>{const n=this.listeners.get(t);n&&(n.delete(r),n.size===0&&this.listeners.delete(t))}}}function tt(e,t,r=!0){const n=f.useRef(void 0);f.useEffect(()=>(r||n.current&&n.current(),n.current=ie.listen(e,t),()=>n.current&&n.current()),[e,t,r])}const ie=new vn.EventEmitter;function dn(e=8){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let r="";for(let n=0;n<e;n++)r+=t.charAt(Math.floor(Math.random()*t.length));return r}const wi=({colors:e})=>{const[t,r]=f.useState([]),n=f.useCallback(o=>{r(i=>[...i,{...o,id:o.id??dn()}])},[]),s=f.useCallback(o=>r(i=>i.filter(u=>u.id!==o)),[]),a=f.useCallback((o,i)=>{r(u=>{const l=u.findIndex(h=>h.id===o);if(l===-1)return u;const d=u[l];return[...u.slice(0,l),{...d,...i},...u.slice(l+1)]})},[]);return tt("create-toast",o=>{n(o)}),tt("update-toast",o=>{a(o.id,o.toast)}),tt("remove-toast",o=>{s(o.id)}),c.jsx($e,{children:c.jsx(O.motion.div,{id:"toaster",className:"fixed z-9999 top-[calc(var(--safe-area-top)+0px)] pointer-events-none left-0 mt-4 mb-4 px-4 w-full flex flex-col gap-y-2 items-center justify-center",children:c.jsx(O.AnimatePresence,{mode:"popLayout",children:t.map(o=>c.jsx(ki,{toast:o,remove:s,colors:e},o.id))})})})},yi={simple:{icon:A.ArrowRight,color:"text-base-12"},info:{icon:A.Info,color:"text-blue-9"},success:{icon:A.CheckCircle,color:"text-brand"},warning:{icon:A.TriangleAlert,color:"text-yellow-9"},error:{icon:A.XCircle,color:"text-red-9"}},ki=({toast:e,remove:t,colors:r})=>{f.useEffect(()=>{let a;return e.type==="loading"?a=setTimeout(()=>{t(e.id)},e?.timeout??1e4):a=setTimeout(()=>{t(e.id)},e?.duration??3e3),()=>clearTimeout(a)},[e.type,e.id,e.duration,e.timeout,t]);const n=f.useMemo(()=>r?r[e.type]??null:null,[r]),s=f.useMemo(()=>yi[e.type]??null,[e.type]);return c.jsxs(O.motion.div,{layout:!0,initial:{y:-40,opacity:0},animate:{y:0,opacity:1},exit:{y:-40,opacity:0},className:k("p-2 max-w-96 origin-center rounded-6 flex items-center gap-x-1.5 bg-base-1"),children:[e.type==="loading"?c.jsx(Vt,{wrapperClassName:"shrink-0",spinnerClassName:"h-5 w-5"}):e.type!=="simple"&&s?c.jsx(s.icon,{size:20,className:k("shrink-0",n??s.color)}):null,c.jsx("p",{className:"text-sm",children:e.message})]})},Ni={simple:(e,t)=>ie.emit("create-toast",{type:"simple",message:e,...t}),info:(e,t)=>ie.emit("create-toast",{type:"info",message:e,...t}),success:(e,t)=>ie.emit("create-toast",{type:"success",message:e,...t}),warning:(e,t)=>ie.emit("create-toast",{type:"warning",message:e,...t}),error:(e,t)=>ie.emit("create-toast",{type:"error",message:e,...t}),loading:(e,t)=>{const r=dn();return ie.emit("create-toast",{id:r,type:"loading",message:e,...t}),r},update:(e,t)=>{ie.emit("update-toast",{id:e,toast:t})},dismiss:e=>{ie.emit("remove-toast",{id:e})}};exports.AliveScope=Ta;exports.Avatar=En;exports.AvatarsGroup=jn;exports.Button=q;exports.Calendar=_t;exports.Checkbox=Yr;exports.ConfirmationDialog=la;exports.DatePickerDemo=oa;exports.DatePickerPopover=aa;exports.DateTimePicker=ca;exports.ElasticHeader=ua;exports.EventEmitter=xi;exports.FocusTrap=kn;exports.Form=ka;exports.FormInput=Ca;exports.FormMultiSelect=Ra;exports.FormSelect=si;exports.FormSubmit=ii;exports.FormTags=di;exports.FormTextArea=mi;exports.FormWorkingHours=bi;exports.Icon=Kr;exports.Input=Yt;exports.KeepAlive=La;exports.LazyImage=zt;exports.LazyImageWrapped=Qr;exports.List=Oa;exports.ListItem=Fa;exports.ModalsProvider=ci;exports.MultiSelect=Jr;exports.PageScroller=Aa;exports.PageTitle=_a;exports.PopoverCard=_r;exports.PopoverCardContent=ra;exports.PopoverCardFooter=na;exports.PopoverCardHeader=ta;exports.Portal=$e;exports.SearchInput=Ya;exports.SegmentedControl=ni;exports.Select=on;exports.Separator=oi;exports.ShowMoreText=ai;exports.Spinner=Vt;exports.SuperModal=ui;exports.Switch=ln;exports.Tags=un;exports.TextArea=Kt;exports.TimePicker=ia;exports.Toaster=wi;exports.calculatePopoverPosition=kr;exports.checkOverflow=_e;exports.cn=k;exports.debounce=xn;exports.eventEmitter=ie;exports.extractDirtyData=yn;exports.generateInitials=gr;exports.nullRead=Pt;exports.nullSet=rt;exports.removeWhitespaces=xr;exports.setFocusEnd=vr;exports.throttle=Fe;exports.toTitleCase=wn;exports.toast=Ni;exports.useClickAway=Cn;exports.useClickAwayAdvanced=$n;exports.useClickAwayWithRef=dt;exports.useEventListener=tt;exports.useKeepAlive=Pa;exports.useKeyListener=yr;exports.useLargeScreen=qe;exports.useLongPress=Tn;exports.useMergedRef=Lt;exports.useMethods=Na;exports.useModals=cn;exports.useNetwork=Mn;exports.useOverflow=wr;exports.useOverflowState=Nn;exports.usePopover=ft;exports.useRipple=Nr;exports.useScroller=Wa;
|