@mateosuarezdev/react-ui 1.0.58 → 1.0.61

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 CHANGED
@@ -8,12 +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"),pn=require("react-dom"),br=require("clsx"),pr=require("tailwind-merge"),gr=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"),gn=require("@mateosuarezdev/gestures"),vr=require("@mateosuarezdev/event-emitter"),N=(...e)=>pr.twMerge(br.clsx(e));function Fe(e,t=100){let n=null,r=null;return function(...s){const a=Date.now();n===null||a-n>=t?(e.apply(this,s),n=a):(r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,s),n=Date.now()},t-(a-n)))}}function xr(e,t=500){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{e.apply(this,r),n=null},t)}}function vn(e){if(!e)return"";const n=e.trim().replace(/\s+/g," ").split(" ");return n.length===0||n[0]===""?"":n.length===1?n[0].charAt(0).toUpperCase():(n[0].charAt(0)+n[1].charAt(0)).toUpperCase()}function xn(e){e.focus();const t=e.value.length;e.setSelectionRange(t,t)}function wn(e){return e.replace(/\s/g,"")}function wr(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 nt(e){return wn(e)===""?null:e}function yr(e,t,n={}){const r={...n};return Object.keys(t).forEach(s=>{if(t[s]===!0&&s in e){const a=s;r[a]=e[a]}}),r}class Nr{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 n=this.container?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!n)return;const r=n[0],s=n[n.length-1];t.key==="Tab"&&(t.shiftKey&&document.activeElement===r?(t.preventDefault(),s.focus()):!t.shiftKey&&document.activeElement===s&&(t.preventDefault(),r.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,n=e.scrollHeight>e.clientHeight,r=Math.max(0,e.scrollWidth-e.clientWidth),s=Math.max(0,e.scrollHeight-e.clientHeight);return{horizontal:t,vertical:n,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<r-10,canScrollUp:e.scrollTop>0,canScrollDown:e.scrollTop<s,scrollPercentageX:t&&r>0?e.scrollLeft/r*100:0,scrollPercentageY:n&&s>0?e.scrollTop/s*100:0}},yn=({onOverflow:e,trackScroll:t=!1,withObserver:n=!1,enabled:r=!0,deps:s=[]}={})=>{const a=f.useRef(null);return f.useEffect(()=>{if(!a.current||!r)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;n&&(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)}},[r,...s]),{ref:a}},kr=({trackScroll:e=!1,withObserver:t=!1,enabled:n=!0,deps:r=[]}={})=>{const s=f.useRef(null),[a,o]=f.useState(null);return f.useEffect(()=>{if(!s.current||!n)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)}},[n,...r]),{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"},Er=({src:e,name:t,size:n="md",className:r})=>e?c.jsx("img",{alt:"avatar",src:e,className:N("rounded-full bg-base-3",xt[n])}):t?c.jsx("p",{className:N("rounded-full font-medium dark-theme:bg-base-3 border border-base-6 dark-theme:border-base-4 flex items-center justify-center",xt[n],r),children:vn(t)}):c.jsx("div",{className:N("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[n],r),children:c.jsxs(Un,{size:n==="xs"?16:n==="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 jr({className:e,children:t,animate:n=!1,...r}){return c.jsx("div",{className:N("flex -space-x-3 rtl:space-x-reverse",e),...r,children:t})}function Cr(e){const t=f.useRef(null);return f.useEffect(()=>{const n=r=>{t.current&&!t.current.contains(r.target)&&e()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[e]),t}function $r(e,t={}){const{enabled:n=!0,events:r=["mousedown","touchstart"],excludeRefs:s=[]}=t,a=f.useRef(null);return f.useEffect(()=>{if(!n)return;const o=i=>{const u=i.target;a.current?.contains(u)||s.some(d=>d.current?.contains(u))||e()};return r.forEach(i=>{document.addEventListener(i,o)}),()=>{r.forEach(i=>{document.removeEventListener(i,o)})}},[e,n,r,s]),a}function dt(e,t,n=!0){f.useEffect(()=>{if(!n)return;const r=s=>{e.current&&!e.current.contains(s.target)&&t(s)};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[e,t,n])}function Nn(e,{target:t=window,event:n="keydown",enabled:r}={}){const s=f.useRef(e);f.useEffect(()=>{s.current=e},[e]),f.useEffect(()=>{if(!r)return;const a=o=>{const i=o.key,u=s.current[i];u&&u(o)};return t.addEventListener(n,a),()=>{t.removeEventListener(n,a)}},[t,n,r])}function Sr(e){return f.useSyncExternalStore(t=>e.subscribe(t),()=>e.get(),()=>e.get())}const Et=gr.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)},[]),Sr(Et));function Tr({onLongPress:e,onTap:t,threshold:n=500,startDelay:r=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 k=C-M,L=S-w;return Math.sqrt(k*k+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))},n))},r)}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,n,r,s]),a}function Lt(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const Mr=()=>{const[e,t]=f.useState(navigator.onLine);return f.useEffect(()=>{const n=()=>t(!0),r=()=>t(!1),s=new AbortController;return window.addEventListener("online",n,{signal:s.signal}),window.addEventListener("offline",r,{signal:s.signal}),()=>s.abort()},[]),e},ft=({scrollerId:e,align:t="start",side:n="bottom",offset:r=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 k=w??v.current;if(!k)return{x:0,top:0,bottom:void 0};const L=m.width,W=m.height;return kn({triggerRect:k,popoverWidth:L,popoverHeight:W,align:t,side:n,offset:r,collisionPadding:s,avoidCollisions:a})},[v.current,m,t,n]);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(k=>(k?u?.():i?.(),!k))},[]),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}},kn=({triggerRect:e,popoverWidth:t,popoverHeight:n,align:r="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+n>u.height-o&&(d=u.height-n-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+n>u.height-o&&(d=u.height-n-o),d<o&&(d=o)}else if(s==="bottom"){const p=u.height-e.bottom,b=e.top;p>=n+a?d=e.bottom+a:b>=n+a?d=e.top-n-a:(d=e.bottom+a,d=Math.min(d,u.height-n-o));const v=u.width-e.left,x=e.right;if(r==="start")l=e.left,l+t>u.width-o&&(x>=t?l=e.right-t:l=u.width-t-o);else if(r==="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>=n+a?d=e.top-n-a:b>=n+a?d=e.bottom+a:(d=e.top-n-a,d=Math.max(o,d));const v=u.width-e.left,x=e.right;if(r==="start")l=e.left,l+t>u.width-o&&(x>=t?l=e.right-t:l=u.width-t-o);else if(r==="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-n-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-n-a,(s==="top"||s==="bottom")&&(r==="start"?l=e.left:r==="end"?l=e.right-t:l=e.left+e.width/2-t/2);let m,h;return d+n<=e.top?h=window.innerHeight-(d+n):m=d,{x:l,top:m,bottom:h}},En=(e=!0,t)=>{const n=qe(),r=f.useRef(null),s=f.useCallback(a=>{if(!e||n)return;const o=r.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,n,t]);return{ref:r,ripple:s,styles:{position:"relative"}}},Dr="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",Pr={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"},Lr={all:"focus-visible:ring-1",desktop:"lg:focus-visible:ring-1",mobile:"focus-visible:ring-1 lg:focus-ring-0",none:""},Or={light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},Fr={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"},Rr={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"},Ar={enabled:"",disabled:"opacity-75",loading:""},q=f.forwardRef(({color:e="transparent",size:t="mdsm",fontWeight:n="normal",rounded:r="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}=En(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:N(Dr,Pr[t],Or[n],Fr[r],Lr[d],Rr[e],Ar[s],p.disabled&&"opacity-50",o),...p,children:i})});q.displayName="Button";const jn=6048e5,Wr=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,n){const r=Z(e,n?.in);if(isNaN(t))return se(e,NaN);if(!t)return r;const s=r.getDate(),a=se(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);const o=a.getDate();return s>=o?a:(r.setFullYear(a.getFullYear(),a.getMonth(),s),r)}let Ir={};function mt(){return Ir}function Ye(e,t){const n=mt(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Z(e,t?.in),a=s.getDay(),o=(a<r?7:0)+a-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function rt(e,t){return Ye(e,{...t,weekStartsOn:1})}function Cn(e,t){const n=Z(e,t?.in),r=n.getFullYear(),s=se(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const a=rt(s),o=se(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const i=rt(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function Qt(e){const t=Z(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ht(e,...t){const n=se.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function st(e,t){const n=Z(e,t?.in);return n.setHours(0,0,0,0),n}function _r(e,t,n){const[r,s]=ht(n?.in,e,t),a=st(r),o=st(s),i=+a-Qt(a),u=+o-Qt(o);return Math.round((i-u)/Wr)}function Yr(e,t){const n=Cn(e,t),r=se(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),rt(r)}function yt(e,t,n){const[r,s]=ht(n?.in,e,t);return+st(r)==+st(s)}function zr(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Hr(e){return!(!zr(e)&&typeof e!="number"||isNaN(+Z(e)))}function Br(e,t){const n=Z(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function qr(e,t){const[n,r]=ht(e,t.start,t.end);return{start:n,end:r}}function Xr(e,t){const{start:n,end:r}=qr(t?.in,e);let s=+n>+r;const a=s?+n:+r,o=s?r:n;o.setHours(0,0,0,0);let i=1;const u=[];for(;+o<=a;)u.push(se(n,o)),o.setDate(o.getDate()+i),o.setHours(0,0,0,0);return s?u.reverse():u}function Vr(e,t){const n=Z(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Kr(e,t){const n=Z(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Ur={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"}},Gr=(e,t,n)=>{let r;const s=Ur[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function De(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Qr={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Jr={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Zr={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},es={date:De({formats:Qr,defaultWidth:"full"}),time:De({formats:Jr,defaultWidth:"full"}),dateTime:De({formats:Zr,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"},ns=(e,t,n,r)=>ts[e];function ce(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):o;s=e.formattingValues[i]||e.formattingValues[o]}else{const o=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;s=e.values[i]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return s[a]}}const rs={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 n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},us={ordinalNumber:ls,era:ce({values:rs,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,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(s);if(!a)return null;const o=a[0],i=r&&e.parsePatterns[r]||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=n.valueCallback?n.valueCallback(l):l;const d=t.slice(o.length);return{value:l,rest:d}}}function ds(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function fs(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function $n(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.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},Ns={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]},ks={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:$n({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:Ns,defaultParseWidth:"any"}),dayPeriod:le({matchPatterns:ks,defaultMatchWidth:"any",parsePatterns:Es,defaultParseWidth:"any"})},Sn={code:"en-US",formatDistance:Gr,formatLong:es,formatRelative:ns,localize:us,match:js,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Cs(e,t){const n=Z(e,t?.in);return _r(n,Kr(n))+1}function $s(e,t){const n=Z(e,t?.in),r=+rt(n)-+Yr(n);return Math.round(r/jn)+1}function Tn(e,t){const n=Z(e,t?.in),r=n.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(r+1,0,a),o.setHours(0,0,0,0);const i=Ye(o,t),u=se(t?.in||e,0);u.setFullYear(r,0,a),u.setHours(0,0,0,0);const l=Ye(u,t);return+n>=+i?r+1:+n>=+l?r:r-1}function Ss(e,t){const n=mt(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=Tn(e,t),a=se(t?.in||e,0);return a.setFullYear(s,0,r),a.setHours(0,0,0,0),Ye(a,t)}function Ts(e,t){const n=Z(e,t?.in),r=+Ye(n,t)-+Ss(n,t);return Math.round(r/jn)+1}function Y(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const be={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Y(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Y(n+1,2)},d(e,t){return Y(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="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 n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return Y(s,t.length)}},Te={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Jt={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return be.y(e,t)},Y:function(e,t,n,r){const s=Tn(e,r),a=s>0?s:1-s;if(t==="YY"){const o=a%100;return Y(o,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):Y(a,t.length)},R:function(e,t){const n=Cn(e);return Y(n,t.length)},u:function(e,t){const n=e.getFullYear();return Y(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Y(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Y(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return be.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Y(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=Ts(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):Y(s,t.length)},I:function(e,t,n){const r=$s(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Y(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):be.d(e,t)},D:function(e,t,n){const r=Cs(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Y(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),a=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Y(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),a=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Y(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return Y(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=Te.noon:r===0?s=Te.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=Te.evening:r>=12?s=Te.afternoon:r>=4?s=Te.morning:s=Te.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return be.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):be.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Y(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Y(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):be.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):be.s(e,t)},S:function(e,t){return be.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return en(r);case"XXXX":case"XX":return ye(r);case"XXXXX":case"XXX":default:return ye(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return en(r);case"xxxx":case"xx":return ye(r);case"xxxxx":case"xxx":default:return ye(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Zt(r,":");case"OOOO":default:return"GMT"+ye(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Zt(r,":");case"zzzz":default:return"GMT"+ye(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Y(r,t.length)},T:function(e,t,n){return Y(+e,t.length)}};function Zt(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),a=r%60;return a===0?n+String(s):n+String(s)+t+Y(a,2)}function en(e,t){return e%60===0?(e>0?"-":"+")+Y(Math.abs(e)/60,2):ye(e,t)}function ye(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Y(Math.trunc(r/60),2),a=Y(r%60,2);return n+s+t+a}const tn=(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"})}},Mn=(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 n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return tn(e,t);let a;switch(r){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}}",tn(r,t)).replace("{{time}}",Mn(s,t))},Ds={p:Mn,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,n){const r=Ws(e,t,n);if(console.warn(r),Os.includes(e))throw new RangeError(r)}function Ws(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; 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,n){const r=mt(),s=n?.locale??r.locale??Sn,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=Z(e,n?.in);if(!Hr(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;(!n?.useAdditionalWeekYearTokens&&Rs(m)||!n?.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 nn(e,t,n){const[r,s]=ht(n?.in,e,t);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function Nt(e,t,n){return et(e,-t,n)}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,n)=>{let r;const s=qs[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"en "+r:"hace "+r:r},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,n,r)=>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"]},no={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"]},ro={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:no,defaultWidth:"wide"}),day:ce({values:ro,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:$n({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 No(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function ko(e){return No(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Eo=!1;function bt(){return Eo}function rn(e,t){if(!bt())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:ko(n)?n=n.host:n=n.parentNode}return!1}const re=(e=document)=>{var t;if(!bt())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};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(!rn(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let r=t,s=t;for(this._currentNode=t;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const o=r,i=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});n.push(i),i.currentNode=s,this._currentSetFor.add(i),r=s=o.host}else r=r.parentNode;const a=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(a),a.currentNode=s,this._currentSetFor.add(a),this._walkerStack=n}get doc(){return this._doc}firstChild(){let t=this.currentNode,n=this.nextNode();return rn(t,n)?(n&&(this.currentNode=n),n):(this.currentNode=t,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var n;let s;if(typeof this.filter=="function"?s=this.filter(t):!((n=this.filter)===null||n===void 0)&&n.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 r=this.nextNode();return r&&(this.currentNode=r),r}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 n=t.previousNode();if(n){if(n.shadowRoot){var r;let a;if(typeof this.filter=="function"?a=this.filter(n):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(a=this.filter.acceptNode(n)),a===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let o=this.lastChild();return o&&(this.currentNode=o),o}return n&&(this.currentNode=n),n}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,n,r,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=n,this.filter=s??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(t.createTreeWalker(n,r,this._acceptNode));const a=n.shadowRoot;if(a){const o=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(o)}}}function Co(e,t,n,r){return bt()?new jo(e,t,n,r):e.createTreeWalker(t,n,r)}function sn(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,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function To(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function pt(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.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)&&!Dn()});const Dn=he(function(){return pt(/Chrome/i)}),Pn=he(function(){return pt(/Android/i)});he(function(){return pt(/Firefox/i)});let ge=new Map,jt=new Set;function on(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let s=ge.get(r.target);s||(s=new Set,ge.set(r.target,s),r.target.addEventListener("transitioncancel",n,{once:!0})),s.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let s=ge.get(r.target);if(s&&(s.delete(r.propertyName),s.size===0&&(r.target.removeEventListener("transitioncancel",n),ge.delete(r.target)),ge.size===0)){for(let a of jt)a();jt.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?on():document.addEventListener("DOMContentLoaded",on));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:Pn()&&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:n,visibility:r}=e.style,s=n!=="none"&&r!=="hidden"&&r!=="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)&&!Ln(e)}function zo(e){return e.matches(_o)&&Rt(e)&&!Ln(e)}function Ln(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 n of Bo)n(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 On(e){Fo(e)&&(je=!0,Xe="virtual")}function Fn(e){e.target===window||e.target===document||Ho||!e.isTrusted||(!je&&!Ct&&(Xe="virtual",Wt("virtual",e)),je=!1,Ct=!1)}function Rn(){je=!1,Ct=!0}function an(e){if(typeof window>"u"||typeof document>"u"||Ie.get(ot(e)))return;const t=ot(e),n=K(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){je=!0,r.apply(this,arguments)},n.addEventListener("keydown",at,!0),n.addEventListener("keyup",at,!0),n.addEventListener("click",On,!0),t.addEventListener("focus",Fn,!0),t.addEventListener("blur",Rn,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ee,!0),n.addEventListener("pointermove",ee,!0),n.addEventListener("pointerup",ee,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",ee,!0),n.addEventListener("mousemove",ee,!0),n.addEventListener("mouseup",ee,!0)),t.addEventListener("beforeunload",()=>{An(e)},{once:!0}),Ie.set(t,{focus:r})}const An=(e,t)=>{const n=ot(e),r=K(e);t&&r.removeEventListener("DOMContentLoaded",t),Ie.has(n)&&(n.HTMLElement.prototype.focus=Ie.get(n).focus,r.removeEventListener("keydown",at,!0),r.removeEventListener("keyup",at,!0),r.removeEventListener("click",On,!0),n.removeEventListener("focus",Fn,!0),n.removeEventListener("blur",Rn,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ee,!0),r.removeEventListener("pointermove",ee,!0),r.removeEventListener("pointerup",ee,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",ee,!0),r.removeEventListener("mousemove",ee,!0),r.removeEventListener("mouseup",ee,!0)),Ie.delete(n))};function Xo(e){const t=K(e);let n;return t.readyState!=="loading"?an(e):(n=()=>{an(e)},t.addEventListener("DOMContentLoaded",n)),()=>An(e,n)}typeof document<"u"&&Xo();function Wn(){return Xe}function Vo(e){const t=K(e),n=re(t);if(Wn()==="virtual"){let r=n;Oo(()=>{re(t)===r&&e.isConnected&&sn(e)})}else sn(e)}const cn=f.createContext(null),$t="react-aria-focus-scope-restore";let z=null;function Ko(e){let{children:t,contain:n,restoreFocus:r,autoFocus:s}=e,a=f.useRef(null),o=f.useRef(null),i=f.useRef([]),{parentNode:u}=f.useContext(cn)||{},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=!!n)},[n]),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,r,n),Qo(i,n),ea(i,r,n),Jo(i,s),f.useEffect(()=>{const h=re(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(cn.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 n=e.current,{from:r,tabbable:s,wrap:a,accept:o}=t;var i;let u=r||re(K((i=n[0])!==null&&i!==void 0?i:void 0)),l=n[0].previousElementSibling,d=Ne(n),m=ve(d,{tabbable:s,accept:o},n);m.currentNode=te(u,n)?u:l;let h=m.nextNode();return!h&&a&&(m.currentNode=l,h=m.nextNode()),h&&fe(h,!0),h},focusPrevious(t={}){let n=e.current,{from:r,tabbable:s,wrap:a,accept:o}=t;var i;let u=r||re(K((i=n[0])!==null&&i!==void 0?i:void 0)),l=n[n.length-1].nextElementSibling,d=Ne(n),m=ve(d,{tabbable:s,accept:o},n);m.currentNode=te(u,n)?u:l;let h=m.previousNode();return!h&&a&&(m.currentNode=l,h=m.previousNode()),h&&fe(h,!0),h},focusFirst(t={}){let n=e.current,{tabbable:r,accept:s}=t,a=Ne(n),o=ve(a,{tabbable:r,accept:s},n);o.currentNode=n[0].previousElementSibling;let i=o.nextNode();return i&&fe(i,!0),i},focusLast(t={}){let n=e.current,{tabbable:r,accept:s}=t,a=Ne(n),o=ve(a,{tabbable:r,accept:s},n);o.currentNode=n[n.length-1].nextElementSibling;let i=o.previousNode();return i&&fe(i,!0),i}}}function Ne(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 n,r;let a=(r=e.form)===null||r===void 0||(n=r.elements)===null||n===void 0?void 0:n.namedItem(e.name);t=[...a??[]]}return t?!t.some(a=>a.checked):!1}function Qo(e,t){let n=f.useRef(void 0),r=f.useRef(void 0);ue(()=>{let s=e.current;if(!t){r.current&&(cancelAnimationFrame(r.current),r.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=re(a),m=e.current;if(!m||!te(d,m))return;let h=Ne(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,n.current=Me(l)):Ae(e)&&!ke(Me(l),e)?n.current?n.current.focus():z&&z.current&&St(z.current):Ae(e)&&(n.current=Me(l))},u=l=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let d=Wn(),m=(d==="virtual"||d===null)&&Pn()&&Dn(),h=re(a);if(!m&&h&&Ae(e)&&!ke(h,e)){z=e;let b=Me(l);if(b&&b.isConnected){var p;n.current=b,(p=n.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(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function In(e){return ke(e)}function te(e,t){return!e||!t?!1:t.some(n=>n.contains(e))}function ke(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of B.traverse(B.getTreeNode(t)))if(n&&te(e,n.current))return!0;return!1}function it(e,t){var n;let r=(n=B.getTreeNode(t))===null||n===void 0?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.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 _n(e,t=!0){let n=e[0].previousElementSibling,r=Ne(e),s=ve(r,{tabbable:t},e);s.currentNode=n;let a=s.nextNode();return t&&!a&&(r=Ne(e),s=ve(r,{tabbable:!1},e),s.currentNode=n,a=s.nextNode()),a}function St(e,t=!0){fe(_n(e,t))}function Jo(e,t){const n=f.useRef(t);f.useEffect(()=>{if(n.current){z=e;const r=K(e.current?e.current[0]:void 0);!te(re(r),z.current)&&e.current&&St(e.current)}n.current=!1},[e])}function Zo(e,t,n){ue(()=>{if(t||n)return;let r=e.current;const s=K(r?r[0]:void 0);let a=o=>{let i=Me(o);te(i,e.current)?z=e:In(i)||(z=null)};return s.addEventListener("focusin",a,!1),r?.forEach(o=>o.addEventListener("focusin",a,!1)),()=>{s.removeEventListener("focusin",a,!1),r?.forEach(o=>o.removeEventListener("focusin",a,!1))}},[e,t,n])}function ln(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,n){const r=f.useRef(typeof document<"u"?re(K(e.current?e.current[0]:void 0)):null);ue(()=>{let s=e.current;const a=K(s?s[0]:void 0);if(!t||n)return;let o=()=>{(!z||it(z,e))&&te(re(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,n]),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(!ke(i,e)||!ln(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||!ke(m,e))&&l){d.currentNode=l;do m=o.shiftKey?d.previousNode():d.nextNode();while(ke(m,e));o.preventDefault(),o.stopPropagation(),m?fe(m,!0):In(l)?fe(l,!0):i.blur()}};return n||s.addEventListener("keydown",a,!0),()=>{n||s.removeEventListener("keydown",a,!0)}},[e,t,n]),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=r.current)!==null&&o!==void 0?o:void 0,()=>{let i=B.getTreeNode(e);if(!i)return;let u=i.nodeToRestore,l=re(s);if(t&&u&&(l&&ke(l,e)||l===s.body&&ln(e))){let d=B.clone();requestAnimationFrame(()=>{if(s.activeElement===s.body){let m=d.getTreeNode(e);for(;m;){if(m.nodeToRestore&&m.nodeToRestore.isConnected){un(m.nodeToRestore);return}m=m.parent}for(m=d.getTreeNode(e);m;){if(m.scopeRef&&m.scopeRef.current&&B.getTreeNode(m.scopeRef)){let h=_n(m.scopeRef.current,!0);un(h);return}m=m.parent}}})}}}},[e,t])}function un(e){e.dispatchEvent(new CustomEvent($t,{bubbles:!0,cancelable:!0}))&&fe(e)}function ve(e,t,n){let r=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:r(i)&&(!n||te(i,n))&&(!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,n,r){let s=this.fastMap.get(n??null);if(!s)return;let a=new Tt({scopeRef:t});s.addChild(a),a.parent=s,this.fastMap.set(t,a),r&&(a.nodeToRestore=r)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let r=n.parent;for(let a of this.traverse())a!==n&&n.nodeToRestore&&a.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&te(a.nodeToRestore,n.scopeRef.current)&&(a.nodeToRestore=n.nodeToRestore);let s=n.children;r&&(r.removeChild(n),s.size>0&&s.forEach(a=>r&&r.addChild(a))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){var t;let n=new It;var r;for(let s of this.traverse())n.addTreeNode(s.scopeRef,(r=(t=s.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&r!==void 0?r:null,s.nodeToRestore);return n}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})=>pn.createPortal(e,t??document.body),Yn=({children:e,customTrigger:t,triggerContent:n,align:r="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:r,side:s,offset:a,scrollerId:d,onOpen:()=>{m?.()},onClose:()=>{h?.()}});Nn({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 k=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:N("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:n}),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:k.x,top:k.top,bottom:k.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:N("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:n,className:r})=>c.jsx("div",{className:N("p-4 border-b border-base-4",r),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})]}),n&&c.jsx("button",{onClick:n,className:"ml-4 text-base-11 hover:text-base-12 transition-colors",children:"×"})]})}),na=({children:e,className:t})=>c.jsx("div",{className:N("p-4",t),children:e}),ra=({children:e,className:t})=>c.jsx("div",{className:N("p-4 border-t border-base-4",t),children:e}),sa=(e,t)=>{const n=new Date(2023,0,1),r=[];for(let s=0;s<7;s++){const a=new Date(n);a.setDate(n.getDate()+s),r.push(Ee(a,"EEE",{locale:e??Sn}))}return t?[...r.slice(1),r[0]]:r},_t=({selectedDate:e,onDateSelect:t,disabledDates:n,disabledDaysOfWeek:r,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(()=>n?new Set(n.map(w=>new Date(w).toDateString())):new Set,[n]),v=f.useMemo(()=>new Set(r||[]),[r]),x=f.useMemo(()=>{const w=Vr(l),k=Br(l),L=new Date(w),W=new Date(k);if(i){const j=w.getDay(),g=j===0?6:j-1;L.setDate(w.getDate()-g);const D=k.getDay(),T=D===0?0:7-D;W.setDate(k.getDate()+T)}else L.setDate(w.getDate()-w.getDay()),W.setDate(k.getDate()+(6-k.getDay()));return Xr({start:L,end:W})},[l,i]),E=f.useMemo(()=>sa(o??ze,i),[o,i]),$=w=>{const k=w.toDateString(),L=w.getDay();return!(b.has(k)||v.has(L)||s&&w<s||a&&w>a)},C=w=>{$(w)&&t&&t(w),h(w)},S=w=>{if(!m)return;let k=new Date(m),L=!0,W,j;switch(w.key){case"ArrowUp":k.setDate(k.getDate()-7);break;case"ArrowDown":k.setDate(k.getDate()+7);break;case"ArrowLeft":k.setDate(k.getDate()-1);break;case"ArrowRight":k.setDate(k.getDate()+1);break;case"Home":W=k.getDay(),k.setDate(k.getDate()-W);break;case"End":j=k.getDay(),k.setDate(k.getDate()+(6-j));break;case"PageUp":k=w.shiftKey?Nt(k,12):Nt(k,1);break;case"PageDown":k=w.shiftKey?et(k,12):et(k,1);break;case"Enter":case" ":$(m)&&t&&t(m);break;default:L=!1}L&&(w.preventDefault(),k.getTime()!==m.getTime()&&(h(k),nn(k,l)||d(k)))},M=w=>{d(k=>w==="prev"?Nt(k,1):et(k,1))};return c.jsxs("div",{ref:p,className:N("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,k)=>{const L=nn(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:N("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")},k)})})]})},oa=()=>{const[e,t]=f.useState(new Date(2025,8,21)),n=["2025-09-13T00:00:00Z","2025-09-15T00:00:00Z"],r=[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:n,disabledDaysOfWeek:r,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[n,r]=f.useState(new Date);return c.jsx(Yn,{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:n,onDateSelect:a=>{r(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"},zn=f.forwardRef(({checked:e=!1,onCheckedChange:t,disabled:n=!1,required:r=!1,name:s,value:a,id:o,className:i="",size:u="sm",...l},d)=>{const m=()=>{n||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":r,disabled:n,onClick:m,onKeyDown:h,className:N("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],n&&"cursor-not-allowed opacity-75",!n&&"cursor-pointer",e?n?Je.checkedDisabled:Je.checked:n?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:n,required:r,id:o,className:"sr-only",tabIndex:-1})]})});zn.displayName="Checkbox";const la=({title:e,message:t,searchParam:n,condition:r=!0,cancelLabel:s,confirmLabel:a,confirmColor:o="contrast",confirmAction:i,trigger:u})=>{const{searchParams:l}=de.useSearchParams(),d=f.useMemo(()=>!!l[n],[l]),m=f.useCallback(()=>{de.navigate.to(`${window.location.pathname}?${n}=open`)},[n]);return c.jsxs(c.Fragment,{children:[c.jsx(O.AnimatePresence,{initial:!1,children:d&&r?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:N("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=({className:e})=>c.jsx("div",{className:N("w-full h-px bg-base-4",e)}),da=({scrollY:e,height:t=300,className:n,children:r})=>{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:n,children:r})};function Hn(e,t,n){function r(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=n?.Parent??Object;class a extends s{}Object.defineProperty(a,"name",{value:e});function o(i){var u;const l=n?.Parent?new a:this;r(l,i),(u=l._zod).deferred??(u.deferred=[]);for(const d of l._zod.deferred)d();return l}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:i=>n?.Parent&&i instanceof n.Parent?!0:i?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class fa extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const ma={};function Bn(e){return ma}function ha(e,t){return typeof t=="bigint"?t.toString():t}const qn=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ze(e){return typeof e=="string"?e:e?.message}function Xn(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=Ze(e.inst?._zod.def?.error?.(e))??Ze(t?.error?.(e))??Ze(n.customError?.(e))??Ze(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}const Vn=(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,ha,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ba=Hn("$ZodError",Vn),Kn=Hn("$ZodError",Vn,{Parent:Error}),pa=e=>(t,n,r,s)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new fa;if(o.issues.length){const i=new(s?.Err??e)(o.issues.map(u=>Xn(u,a,Bn())));throw qn(i,s?.callee),i}return o.value},ga=pa(Kn),va=e=>async(t,n,r,s)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const i=new(s?.Err??e)(o.issues.map(u=>Xn(u,a,Bn())));throw qn(i,s?.callee),i}return o.value},xa=va(Kn);function dn(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function wa(e,t){for(var n={};e.length;){var r=e[0],s=r.code,a=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var i=r.unionErrors[0].errors[0];n[o]={message:i.message,type:i.code}}else n[o]={message:a,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(m){return e.push(m)})}),t){var u=n[o].types,l=u&&u[r.code];n[o]=J.appendErrors(o,t,n,s,l?[].concat(l,r.message):r.message)}e.shift()}return n}function ya(e,t){for(var n={};e.length;){var r=e[0],s=r.code,a=r.message,o=r.path.join(".");if(!n[o])if(r.code==="invalid_union"&&r.errors.length>0){var i=r.errors[0][0];n[o]={message:i.message,type:i.code}}else n[o]={message:a,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(d){return d.forEach(function(m){return e.push(m)})}),t){var u=n[o].types,l=u&&u[r.code];n[o]=J.appendErrors(o,t,n,s,l?[].concat(l,r.message):r.message)}e.shift()}return n}function Na(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,s,a){try{return Promise.resolve(dn(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(o){return a.shouldUseNativeValidation&&Ge.validateFieldsNatively({},a),{errors:{},values:n.raw?Object.assign({},r):o}})},function(o){if((function(i){return Array.isArray(i?.issues)})(o))return{values:{},errors:Ge.toNestErrors(wa(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,a){try{return Promise.resolve(dn(function(){return Promise.resolve((n.mode==="sync"?ga:xa)(e,r,t)).then(function(o){return a.shouldUseNativeValidation&&Ge.validateFieldsNatively({},a),{errors:{},values:n.raw?Object.assign({},r):o}})},function(o){if((function(i){return i instanceof ba})(o))return{values:{},errors:Ge.toNestErrors(ya(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:n,children:r,logErrors:s,className:a}){return c.jsx(J.FormProvider,{...e,children:c.jsx("form",{className:N("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),n?.(o)}),children:r})})}function Ea(e,t){return J.useForm({resolver:Na(e),defaultValues:t})}const Un=({children:e,size:t=24,strokeWidth:n=2,viewBox:r="0 0 24 24",className:s,...a})=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:r,className:s,...a,children:e}),ja={solid:"bg-base-3 border border-base-4 drop-shadow-sm dark-theme:drop-shadow-none",outline:"border border-base-6"},Ca={brand:"ring-1 ring-brand",solid:"ring-1 ring-base-6"},Yt=f.forwardRef(({label:e,description:t,labelPosition:n="default",color:r="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,k]=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&&xn($.current)},[S,$]),c.jsxs("div",{className:N("relative",m),children:[e&&n==="default"&&c.jsx("label",{className:N("font-medium ml-0.5 text-xs",i&&"text-red-9"),children:e}),c.jsxs("div",{className:N("rounded-6 transition cursor-text relative",ja[r],{"pt-[22px] pb-1.5":n==="floating",[Ca[s]]:!i&&w,"bg-red-4 text-red-9":!!i,"ring-1 ring-red-9":!!i&&w},h),children:[e&&n==="floating"&&c.jsx("label",{className:N("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:N("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:N("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":n==="default","mt-1.5":n==="floating","pr-10":o,"text-red-9 placeholder:text-red-9":!!i},p),value:v,placeholder:a,onFocus:()=>k(!0),onBlur:()=>k(!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:N(n==="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:N(i?"text-red-9":"text-base-11")}):c.jsx(A.Eye,{size:20,className:N(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 $a=({name:e,customRead:t,customSet:n,withNullSet:r=!0,...s})=>{const{control:a}=J.useFormContext(),o=f.useCallback(u=>t?t(u):u===null?Pt(u):u,[t]),i=f.useCallback(u=>n?r&&u===null?nt(u):n(u):u===null?nt(u):u,[n]);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]}))},Gn=f.createContext(null),Sa=({children:e,value:t})=>c.jsx(Gn.Provider,{value:t,children:e}),Ta=()=>{const e=f.useContext(Gn);if(!e)throw new Error("useAliveScope must be wrapped within AliveScopeProvider");return e},Ma=({children:e})=>{const[t,n]=f.useState({}),r=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),n(m=>({...m,[i]:{children:u,element:d}})),r.current[i]=[],s.current[i]=[],r.current&&r.current[i]&&r.current[i].forEach(m=>m(i)),d}return r.current&&r.current[i]&&r.current[i].forEach(d=>d(i)),t[i].element},o=i=>{n(u=>{const l={...u};return delete l[i],l}),s.current&&s.current[i]&&s.current[i].forEach(u=>u(i))};return c.jsxs(Sa,{value:{getPortalElement:a,dropPortalElement:o},children:[e,Object.entries(t).map(([i,{children:u,element:l}])=>c.jsx(Pa,{id:i,onMountCallbacks:r,onDropCallbacks:s,children:u,element:l},i))]})},Qn=f.createContext(null),Da=({children:e,value:t})=>c.jsx(Qn.Provider,{value:t,children:e}),Pa=f.memo(({id:e,onMountCallbacks:t,onDropCallbacks:n,children:r,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(()=>(n.current[e].push(i),()=>{n.current[e]=n.current[e].filter(u=>u!==i)}),[])};return c.jsx(Da,{value:{keepAliveId:e,onKeepAliveMount:a,onKeepAliveDrop:o},children:pn.createPortal(r,s,e)})}),La=()=>{const e=f.useContext(Qn);if(!e)throw new Error("useKeepAlive must be used within KeepAliveProvider");return e},Oa=({aliveKey:e,children:t,enabled:n=!0,...r})=>{const s=f.useRef(null),{getPortalElement:a}=Ta();return f.useEffect(()=>{const o=a(e,t,r.className);return n&&s.current&&s.current.replaceWith(o),()=>{}},[e,t,n,r]),c.jsx("div",{...r,ref:s,children:t})},zt=f.forwardRef(({src:e,alt:t,eager:n=!1,rootMargin:r="50px",threshold:s=.01,noFade:a=!1,className:o="",...i},u)=>{const[l,d]=f.useState(n),[m,h]=f.useState(!1),p=f.useRef(null);return f.useEffect(()=>{if(n)return;const b=new IntersectionObserver(x=>{x.forEach(E=>{E.isIntersecting&&(d(!0),b.disconnect())})},{rootMargin:r,threshold:s}),v=p.current;return v&&b.observe(v),()=>{b.disconnect()}},[n,r,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:N("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 Jn=f.forwardRef(({src:e,alt:t,eager:n=!1,wrapperClassName:r="",imageClassName:s="",rootMargin:a="50px",threshold:o=.01,noFade:i=!1,children:u,...l},d)=>c.jsxs("div",{className:N("overflow-hidden",r),children:[c.jsx(zt,{ref:d,src:e,alt:t,eager:n,rootMargin:a,threshold:o,noFade:i,className:s,...l}),u]}));Jn.displayName="LazyImageWrapped";const Fa=({lightSolid:e=!0,className:t,children:n,...r})=>c.jsx("div",{className:N("rounded-7 dark-theme:bg-base-3",e?"border-none bg-base-3":"border border-base-6 dark-theme:border-base-4",t),...r,children:n}),Ra=({onClick:e,lightSolid:t=!0,className:n,children:r})=>c.jsx("button",{onClick:e,className:N("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",n),children:r}),Zn=({label:e,labelPosition:t="default",options:n,selectedValues:r,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),k=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?r.map(P=>n.find(G=>a(G)===P||a(G)===a(P))).filter(Boolean):r,oe=V.length>0,U=h?n.filter(P=>o(P).toLowerCase().includes(v.toLowerCase())):n;f.useEffect(()=>{k.current=k.current.slice(0,U.length)},[U.length]);const ne=P=>i?r.some(I=>I===a(P)||a(I)===a(P)):r.some(I=>a(I)===a(P)),Re=P=>{if(!p)if(ne(P)){let I;if(i){const G=a(P);I=r.filter(we=>we!==G&&a(we)!==G)}else I=r.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=[...r,i(P)]:I=[...r,P],s(I),Ue(`Added ${o(P)}`)}},Ve=P=>{if(p)return;let I;if(i){const G=a(P);I=r.filter(we=>we!==G&&a(we)!==G)}else I=r.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),k.current[I]?.scrollIntoView({block:"nearest"})}break;case"ArrowUp":if(P.preventDefault(),D){const I=C<=0?U.length-1:C-1;S(I),k.current[I]?.scrollIntoView({block:"nearest"})}break;case"Backspace":if(h&&v===""&&V.length>0){const I=V[V.length-1];Ve(I)}break}},fr=P=>{x(P.target.value),S(-1)},mr=()=>{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:N("relative",b),children:[c.jsxs("div",{className:"relative",ref:w,children:[t==="default"&&c.jsx("label",{className:N("top-[18px] font-medium ml-0.5 text-xs",l&&"text-red-9"),children:e}),c.jsxs("div",{ref:L,...W,className:N("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:mr,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:N("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&&`(${r.length}/${m})`]}),c.jsxs("div",{className:N("flex flex-wrap gap-2 items-center",{"mt-2.5":t==="floating"}),children:[V.map(P=>c.jsxs("div",{className:N("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:fr,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:N("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:N("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=ne(P),we=I===C;return c.jsxs("div",{ref:hr=>{k.current[I]=hr},className:N("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"})]})},Aa=({name:e,...t})=>{const{control:n}=J.useFormContext();return n?c.jsx(J.Controller,{name:e,control:n,render:({field:r,fieldState:s})=>c.jsx(Zn,{selectedValues:r.value||[],onChange:a=>r.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]}))},Wa=({id:e,tabPage:t,absolute:n=!0,navBar:r,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))}),[]),k=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,ne=1;R>0?(U=0,ne=1-R/H,v.current.style.transformOrigin="top"):R<-y?(U=oe,ne=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(${ne})`,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 ne=performance.now()-H,Re=Math.min(ne/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(),ne=U-V;if(V=U,H*=Math.pow(.95,ne/16),y.currentY+=H*ne,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=k(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,k]),_=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=gn.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:n?"absolute":"relative",...o},className:N("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:r?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}),r,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 Ia({id:e,showScrollbar:t=!0,onRefresh:n,bounceBackDuration:r=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/r,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)},[$,r]),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]),k=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),n&&g.isPullingToRefresh&&!m&&D>0&&(g.pullDistance=D),M()},[n,$,m,M,x]),L=f.useCallback(()=>{h(!0),C(b.current.refreshThreshold),n&&n().then(()=>{h(!1),C(0)})},[n,C]),W=f.useCallback(j=>{const g=b.current;g.isScrolling&&(g.isScrolling=!1,n&&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)},[n,S,C,m,L]);return f.useEffect(()=>{if(!o.current)return;const j=gn.createGesture(o.current,{name:"page-scroller-gesture",priority:10,passive:!0,direction:"y",onStart:w,onMove:k,onEnd:W});return j.init(),()=>j.destroy()},[w,k,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 _a={2:"text-2xl",4:"text-4xl",5:"text-5xl",6:"text-6xl"},Ya=({title:e,description:t,size:n="6",descriptionClassName:r,className:s})=>c.jsxs("div",{className:N("text-center",s),children:[c.jsx("p",{className:`${_a[n]} font-medium`,children:e}),t?c.jsx("p",{className:N("mt-6 text-base-11",r),children:t}):null]}),za=f.forwardRef(({placeholder:e="Buscar",value:t,exposedRef:n,autoFocus:r,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(()=>n&&n(d),[]);return f.useEffect(()=>{const b=async()=>{i&&await i(d,m)};p(),b()},[]),c.jsxs("div",{className:N("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:r?r(m):void 0,className:N("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:N("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:N("absolute right-2.5 rounded-full",u?"text-red-9":"text-base-11"),children:c.jsx(A.X,{size:20})}):null]})}),fn=({el:e,direction:t,amount:n=200,multiplier:r=.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;n==="max"?u=i:u=n??(a?e.clientHeight:e.clientWidth)*r;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}})},Ha={default:[.32,.72,0,1]},mn={initial:{opacity:0},animate:{opacity:1,transition:{ease:Ha.default,duration:.3}},exit:{opacity:0,transition:{ease:[.32,.72,0,1],duration:.3}}},er=new Set,Q=new WeakMap,Pe=new WeakMap,Ce=new WeakMap,Mt=new WeakMap,Ba=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",qa=e=>{const t=Qa(e);t&&t.forEach(n=>Ja(n))},Xa=e=>{e.forEach(t=>{t.target===xe&&Ka(),Q.has(t.target)&&Se(t.target)})};function Va(e){Mt.get(e)?.disconnect();let n=Q.get(e),r=0;const s=5;n||(n=Oe(e),Q.set(e,n));const{offsetWidth:a,offsetHeight:o}=xe,u=[n.top-s,a-(n.left+s+n.width),o-(n.top+s+n.height),n.left-s].map(d=>`${-1*Math.floor(d)}px`).join(" "),l=new IntersectionObserver(()=>{++r>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),n=Be(t)?500:t.duration;ct.set(e,setTimeout(async()=>{const r=Ce.get(e);try{await r?.finished,Q.set(e,Oe(e)),Va(e)}catch{}},n))}function Ka(){clearTimeout(ct.get(xe)),ct.set(xe,setTimeout(()=>{er.forEach(e=>sr(e,t=>tr(()=>Se(t))))},100))}function Ua(e){setTimeout(()=>{Ba.set(e,setInterval(()=>tr(Se.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function tr(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let Dt,ut;const Ga=typeof window<"u"&&"ResizeObserver"in window;Ga&&(xe=document.documentElement,Dt=new MutationObserver(qa),ut=new ResizeObserver(Xa),window.addEventListener("scroll",()=>{Bt=window.scrollY,Ht=window.scrollX}),ut.observe(xe));function Qa(e){return e.reduce((r,s)=>[...r,...Array.from(s.addedNodes),...Array.from(s.removedNodes)],[]).every(r=>r.nodeName==="#comment")?!1:e.reduce((r,s)=>{if(r===!1)return!1;if(s.target instanceof Element){if(kt(s.target),!r.has(s.target)){r.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;kt(s.target,o),r.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&&(r.add(o),kt(s.target,o),Pe.set(o,[s.previousSibling,s.nextSibling]))}}return r},new Set)}function kt(e,t){!t&&!(me in e)?Object.defineProperty(e,me,{value:e}):t&&!(me in t)&&Object.defineProperty(t,me,{value:e})}function Ja(e){const t=e.isConnected,n=Q.has(e);t&&Pe.has(e)&&Pe.delete(e),Ce.has(e)&&Ce.get(e)?.cancel(),lt in e?hn(e):n&&t?ei(e):n&&!t?ti(e):hn(e)}function ae(e){return Number(e.replace(/[^0-9.\-]/g,""))}function Za(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:n,y:r}=Za(e);return{top:t.top+r,left:t.left+n,width:t.width,height:t.height}}function nr(e,t,n){let r=t.width,s=t.height,a=n.width,o=n.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);r-=d,a-=d,s-=l,o-=l}return[r,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 rr(e){if(me in e)return e[me]}function qt(e){const t=rr(e);return t?We.has(t):!1}function sr(e,...t){t.forEach(n=>n(e,Le.has(e)));for(let n=0;n<e.children.length;n++){const r=e.children.item(n);r&&t.forEach(s=>s(r,Le.has(r)))}}function Xt(e){return Array.isArray(e)?e:[e]}function Be(e){return typeof e=="function"}function ei(e){const t=Q.get(e),n=Oe(e);if(!qt(e))return Q.set(e,n);let r;if(!t)return;const s=gt(e);if(typeof s!="function"){const a=t.left-n.left,o=t.top-n.top,[i,u,l,d]=nr(e,t,n),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`),r=e.animate([m,h],{duration:s.duration,easing:s.easing})}else{const[a]=Xt(s(e,"remain",t,n));r=new Animation(a),r.play()}Ce.set(e,r),Q.set(e,n),r.addEventListener("finish",Se.bind(null,e))}function hn(e){lt in e&&delete e[lt];const t=Oe(e);Q.set(e,t);const n=gt(e);if(!qt(e))return;let r;if(typeof n!="function")r=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"});else{const[s]=Xt(n(e,"add",t));r=new Animation(s),r.play()}Ce.set(e,r),r.addEventListener("finish",Se.bind(null,e))}function bn(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 n in t)e.style[n]=""},0)}function ti(e){if(!Pe.has(e)||!Q.has(e))return;const[t,n]=Pe.get(e);Object.defineProperty(e,He,{value:!0,configurable:!0});const r=window.scrollX,s=window.scrollY;if(n&&n.parentNode&&n.parentNode instanceof Element?n.parentNode.insertBefore(e,n):t&&t.parentNode?t.parentNode.appendChild(e):rr(e)?.appendChild(e),!qt(e))return bn(e);const[a,o,i,u]=ri(e),l=gt(e),d=Q.get(e);(r!==Ht||s!==Bt)&&ni(e,r,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",bn.bind(null,e,h))}function ni(e,t,n,r){const s=Ht-t,a=Bt-n,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(r)){const p=l-u.clientHeight,b=d-u.clientWidth;m+r.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),[n,,r]=nr(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,n,r]}function or(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"}),sr(e,Se,Ua,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}),er.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"}}},si=({options:e,selected:t,onChange:n,keyExtractor:r,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}=yn({onOverflow:E=>{v({left:E.canScrollLeft,right:E.canScrollRight})},trackScroll:h});return c.jsxs("div",{className:N("relative overflow-hidden",pe.widths[l].container,pe.rounded[m],p),children:[c.jsx("div",{ref:x,className:N("flex items-center border overflow-x-scroll scrollbar-hide",pe.rounded[m],pe.border[d]),children:e.map(E=>{const $=r(t)===r(E);return c.jsx("button",{onClick:()=>n?.(E),className:N("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)},r(E))})}),c.jsxs(O.AnimatePresence,{children:[b.left?c.jsx(O.motion.button,{variants:mn,initial:"initial",animate:"animate",exit:"exit",onClick:()=>{x.current&&fn({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:mn,initial:"initial",animate:"animate",exit:"exit",onClick:()=>{x.current&&fn({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 ar({label:e,labelPosition:t="default",options:n,selected:r,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:k,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&&r?l(r,n):r;return c.jsxs("div",{className:N("relative",b),children:[t==="default"&&c.jsx("label",{className:N("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:k,...C,children:[j?o(j):h,c.jsx(A.ChevronDown,{size:18,className:N("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:N("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:n.map((g,D)=>{const T=!!(j&&a(g)===a(j)),F=D===v,_=i?.(g);return c.jsxs("div",{className:N("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 oi=({name:e,...t})=>{const{control:n}=J.useFormContext();return n?c.jsx(J.Controller,{name:e,control:n,render:({field:r,fieldState:s})=>c.jsx(ar,{selected:r.value??null,onChange:a=>r.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]}))},ai=({text:e,length:t=120,size:n="sm",className:r,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:N("text-base-12",n==="sm"&&"text-sm",r),children:u}),i?c.jsx("button",{onClick:()=>o(l=>!l),className:N("text-xs text-base-11",s),children:a?"Ver menos":"Ver más"}):null]})},Vt=({loading:e=!0,wrapperClassName:t,spinnerClassName:n})=>c.jsx("div",{className:N("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:N({"animate-spin":e},n),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:n,deleteLoading:r,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:r?"loading":n?"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:N(e&&t?"":"col-span-2"),state:n?"loading":r?"disabled":"enabled",type:"submit",children:[n?c.jsx(Vt,{}):e?c.jsx(A.Check,{size:18}):c.jsx(A.Plus,{size:18}),e?i:o]})]})},ir=f.createContext(void 0),ci=({children:e,debug:t=!1})=>{const n=f.useRef([]),r=f.useCallback(d=>{n.current.push(d),t&&console.log("Modal",d,"added",n.current)},[t]),s=f.useCallback(d=>{n.current=n.current.filter(m=>m!==d),t&&console.log("Modal",d,"removed",n.current)},[t]),a=f.useCallback(()=>{const d=n.current[n.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(()=>n.current,[]),l={add:r,remove:s,getPrevId:a,animateParentModal:o,restoreParentModal:i,getModals:u};return c.jsx(ir.Provider,{value:l,children:e})},cr=()=>{const e=f.useContext(ir);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:n,withPortal:r=!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=cr(),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"),gn=require("react-dom"),xr=require("clsx"),vr=require("tailwind-merge"),wr=require("@mateosuarezdev/atoms"),F=require("lucide-react"),O=require("framer-motion"),de=require("@mateosuarezdev/react-router"),J=require("react-hook-form"),Je=require("@hookform/resolvers"),xn=require("@mateosuarezdev/gestures"),yr=require("@mateosuarezdev/event-emitter"),k=(...e)=>vr.twMerge(xr.clsx(e));function Fe(e,t=100){let n=null,r=null;return function(...o){const a=Date.now();n===null||a-n>=t?(e.apply(this,o),n=a):(r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,o),n=Date.now()},t-(a-n)))}}function kr(e,t=500){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{e.apply(this,r),n=null},t)}}function vn(e){if(!e)return"";const n=e.trim().replace(/\s+/g," ").split(" ");return n.length===0||n[0]===""?"":n.length===1?n[0].charAt(0).toUpperCase():(n[0].charAt(0)+n[1].charAt(0)).toUpperCase()}function wn(e){e.focus();const t=e.value.length;e.setSelectionRange(t,t)}function yn(e){return e.replace(/\s/g,"")}function Nr(e){return e.toLowerCase().split(" ").map(o=>{if(o.length===0)return o;const a=[...o][0],s=o.slice(a.length);return a.toUpperCase()+s}).join(" ")}function Pt(e){return e===null?"":e}function ot(e){return yn(e)===""?null:e}function Er(e,t,n={}){const r={...n};return Object.keys(t).forEach(o=>{if(t[o]===!0&&o in e){const a=o;r[a]=e[a]}}),r}class Cr{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 n=this.container?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!n)return;const r=n[0],o=n[n.length-1];t.key==="Tab"&&(t.shiftKey&&document.activeElement===r?(t.preventDefault(),o.focus()):!t.shiftKey&&document.activeElement===o&&(t.preventDefault(),r.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,n=e.scrollHeight>e.clientHeight,r=Math.max(0,e.scrollWidth-e.clientWidth),o=Math.max(0,e.scrollHeight-e.clientHeight);return{horizontal:t,vertical:n,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<r-10,canScrollUp:e.scrollTop>0,canScrollDown:e.scrollTop<o,scrollPercentageX:t&&r>0?e.scrollLeft/r*100:0,scrollPercentageY:n&&o>0?e.scrollTop/o*100:0}},kn=({onOverflow:e,trackScroll:t=!1,withObserver:n=!1,enabled:r=!0,deps:o=[]}={})=>{const a=f.useRef(null);return f.useEffect(()=>{if(!a.current||!r)return;let s=!1;const u=Fe(()=>{if(a.current){const h=_e(a.current);e?.(h)}}),l=_e(a.current);s=l.horizontal||l.vertical,e?.(l),window.addEventListener("resize",u);let d=null;n&&(d=new ResizeObserver(u),a.current&&d.observe(a.current));let m=null;return t&&s&&(m=a.current,m.addEventListener("scroll",u)),()=>{window.removeEventListener("resize",u),d&&d.disconnect(),m&&s&&m.removeEventListener("scroll",u)}},[r,...o]),{ref:a}},jr=({trackScroll:e=!1,withObserver:t=!1,enabled:n=!0,deps:r=[]}={})=>{const o=f.useRef(null),[a,s]=f.useState(null);return f.useEffect(()=>{if(!o.current||!n)return;let i=!1;const l=Fe(()=>{if(o.current){const g=_e(o.current);s(g)}}),d=_e(o.current);i=d.horizontal||d.vertical,s(d),window.addEventListener("resize",l);let m=null;t&&(m=new ResizeObserver(l),o.current&&m.observe(o.current));let h=null;return e&&i&&(h=o.current,h.addEventListener("scroll",l)),()=>{window.removeEventListener("resize",l),m&&m.disconnect(),h&&i&&h.removeEventListener("scroll",l)}},[n,...r]),{ref:o,overflowInfo:a}},vt={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"},$r=({src:e,name:t,size:n="md",className:r})=>e?c.jsx("img",{alt:"avatar",src:e,className:k("rounded-full bg-base-3",vt[n])}):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",vt[n],r),children:vn(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",vt[n],r),children:c.jsxs(Jn,{size:n==="xs"?16:n==="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 Sr({className:e,children:t,animate:n=!1,...r}){return c.jsx("div",{className:k("flex -space-x-3 rtl:space-x-reverse",e),...r,children:t})}function Mr(e){const t=f.useRef(null);return f.useEffect(()=>{const n=r=>{t.current&&!t.current.contains(r.target)&&e()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[e]),t}function Tr(e,t={}){const{enabled:n=!0,events:r=["mousedown","touchstart"],excludeRefs:o=[]}=t,a=f.useRef(null);return f.useEffect(()=>{if(!n)return;const s=i=>{const u=i.target;a.current?.contains(u)||o.some(d=>d.current?.contains(u))||e()};return r.forEach(i=>{document.addEventListener(i,s)}),()=>{r.forEach(i=>{document.removeEventListener(i,s)})}},[e,n,r,o]),a}function qe(e,t,n=!0){f.useEffect(()=>{if(!n)return;const r=o=>{e.current&&!e.current.contains(o.target)&&t(o)};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[e,t,n])}function Lt(e,{target:t=window,event:n="keydown",enabled:r}={}){const o=f.useRef(e);f.useEffect(()=>{o.current=e},[e]),f.useEffect(()=>{if(!r)return;const a=s=>{const i=s.key,u=o.current[i];u&&u(s)};return t.addEventListener(n,a),()=>{t.removeEventListener(n,a)}},[t,n,r])}function Dr(e){return f.useSyncExternalStore(t=>e.subscribe(t),()=>e.get(),()=>e.get())}const Et=wr.atom(typeof window<"u"?window.innerWidth>1024:!0);let wt=!1;const Gt=Fe(()=>{Et.set(window.innerWidth>1024)});typeof window<"u"&&(wt&&(window.removeEventListener("resize",Gt),wt=!1),window.addEventListener("resize",Gt),wt=!0);const Xe=()=>(f.useLayoutEffect(()=>{Et.set(window.innerWidth>1024)},[]),Dr(Et));function Pr({onLongPress:e,onTap:t,threshold:n=500,startDelay:r=200,moveThreshold:o=10}={}){const a=f.useRef(null),s=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,$,T,y){const p=j-T,M=$-y;return Math.sqrt(p*p+M*M)}function g(j){if(j.touches.length!==1)return;const $=j.touches[0];i.current={x:$.clientX,y:$.clientY},u.current=!1,l.current=!0,setTimeout(()=>{l.current&&(s.current=setTimeout(()=>{l.current&&(u.current=!0,e?.(j))},n))},r)}function b(j){if(j.touches.length!==1)return;const $=j.touches[0];h($.clientX,$.clientY,i.current.x,i.current.y)>o&&(l.current=!1,clearTimeout(s.current))}function w(j){clearTimeout(s.current),!u.current&&l.current&&t?.(j),l.current=!1}function v(j){j.button===0&&(d.current=!0)}function E(j){j.button!==0||!d.current||(d.current=!1,t?.(j))}function S(j){j.preventDefault()}return m.addEventListener("touchstart",g),m.addEventListener("touchmove",b),m.addEventListener("touchend",w),m.addEventListener("mousedown",v),m.addEventListener("mouseup",E),m.addEventListener("contextmenu",S),()=>{clearTimeout(s.current),m.removeEventListener("touchstart",g),m.removeEventListener("touchmove",b),m.removeEventListener("touchend",w),m.removeEventListener("mousedown",v),m.removeEventListener("mouseup",E),m.removeEventListener("contextmenu",S)}},[e,t,n,r,o]),a}function Ot(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const Lr=()=>{const[e,t]=f.useState(navigator.onLine);return f.useEffect(()=>{const n=()=>t(!0),r=()=>t(!1),o=new AbortController;return window.addEventListener("online",n,{signal:o.signal}),window.addEventListener("offline",r,{signal:o.signal}),()=>o.abort()},[]),e},Ve=({scrollerId:e,align:t="start",side:n="bottom",offset:r=8,collisionPadding:o=8,avoidCollisions:a=!0,closeOnScroll:s=!0,onOpen:i,onClose:u}={})=>{const[l,d]=f.useState(!1),[m,h]=f.useState({width:192,height:300}),g=f.useRef(null),b=f.useRef(null),w=f.useRef({left:0,right:0,top:0,bottom:0,x:0,y:0,width:0,height:0}),v=f.useRef(null),E=f.useId(),S=f.useCallback(y=>{const p=y??w.current;if(!p)return{x:0,top:0,bottom:void 0};const M=m.width,R=m.height;return Nn({triggerRect:p,popoverWidth:M,popoverHeight:R,align:t,side:n,offset:r,collisionPadding:o,avoidCollisions:a})},[w.current,m,t,n]);f.useEffect(()=>{if(!l||!e||(v.current=document.getElementById(e),!v.current))return;l&&j();const y=()=>{v.current&&(d(!1),i?.(),v.current.removeEventListener("scroll",y))};return s&&v.current.addEventListener("scroll",y,{passive:!0}),()=>{v.current&&v.current.removeEventListener("scroll",y)}},[l,e]);const j=()=>{b.current&&h({width:b.current.offsetWidth,height:b.current.offsetHeight})},$=f.useCallback(()=>{if(!g.current)return;const y=g.current.getBoundingClientRect();w.current={left:y.left,right:y.right,top:y.top,bottom:y.bottom,x:y.x,y:y.y,width:y.width,height:y.height},d(p=>(p?u?.():i?.(),!p))},[]),T=f.useCallback(()=>{d(!1),u?.()},[]);return{triggerRef:g,triggerProps:{id:E,"aria-expanded":l,"aria-haspopup":!0},popoverRef:b,getPopoverPosition:S,open:l,toggle:$,close:T}},Nn=({triggerRect:e,popoverWidth:t,popoverHeight:n,align:r="start",side:o="bottom",offset:a=4,collisionPadding:s=8,avoidCollisions:i=!0})=>{const u={width:window.innerWidth,height:window.innerHeight};let l=0,d=0;if(i){if(o==="right"){const g=e.right+a,b=e.left-t-a,w=Math.max(0,g+t-(u.width-s)),v=Math.max(0,s-b);w<=v?(l=g,w>0&&(l=u.width-t-s)):(l=b,v>0&&(l=s)),d=e.top,d+n>u.height-s&&(d=u.height-n-s),d<s&&(d=s)}else if(o==="left"){const g=e.left-t-a,b=e.right+a,w=Math.max(0,s-g),v=Math.max(0,b+t-(u.width-s));w<=v?(l=g,w>0&&(l=s)):(l=b,v>0&&(l=u.width-t-s)),d=e.top,d+n>u.height-s&&(d=u.height-n-s),d<s&&(d=s)}else if(o==="bottom"){const g=u.height-e.bottom,b=e.top;g>=n+a?d=e.bottom+a:b>=n+a?d=e.top-n-a:(d=e.bottom+a,d=Math.min(d,u.height-n-s));const w=u.width-e.left,v=e.right;if(r==="start")l=e.left,l+t>u.width-s&&(v>=t?l=e.right-t:l=u.width-t-s);else if(r==="end")l=e.right-t,l<s&&(w>=t?l=e.left:l=s);else{const E=e.left+e.width/2-t/2;E>=s&&E+t<=u.width-s?l=E:E<s?l=s:l=u.width-t-s}}else{const g=e.top,b=u.height-e.bottom;g>=n+a?d=e.top-n-a:b>=n+a?d=e.bottom+a:(d=e.top-n-a,d=Math.max(s,d));const w=u.width-e.left,v=e.right;if(r==="start")l=e.left,l+t>u.width-s&&(v>=t?l=e.right-t:l=u.width-t-s);else if(r==="end")l=e.right-t,l<s&&(w>=t?l=e.left:l=s);else{const E=e.left+e.width/2-t/2;E>=s&&E+t<=u.width-s?l=E:E<s?l=s:l=u.width-t-s}}l=Math.max(s,Math.min(l,u.width-t-s)),d=Math.max(s,Math.min(d,u.height-n-s))}else o==="right"?(l=e.right+a,d=e.top):o==="left"?(l=e.left-t-a,d=e.top):o==="bottom"?d=e.bottom+a:d=e.top-n-a,(o==="top"||o==="bottom")&&(r==="start"?l=e.left:r==="end"?l=e.right-t:l=e.left+e.width/2-t/2);let m,h;return d+n<=e.top?h=window.innerHeight-(d+n):m=d,{x:l,top:m,bottom:h}},En=(e=!0,t)=>{const n=Xe(),r=f.useRef(null),o=f.useCallback(a=>{if(!e||n)return;const s=r.current;if(!s)return;const i=s.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 g=s.getElementsByClassName("ripple-wrapper");if(g?.length)for(const b of g)b.remove();s.appendChild(m),setTimeout(()=>{m.remove()},700)},[e,n,t]);return{ref:r,ripple:o,styles:{position:"relative"}}},Or="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",Fr={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"},Rr={all:"focus-visible:ring-1",desktop:"lg:focus-visible:ring-1",mobile:"focus-visible:ring-1 lg:focus-ring-0",none:""},Ar={light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},Wr={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"},Ir={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"},_r={enabled:"",disabled:"opacity-75",loading:""},q=f.forwardRef(({color:e="transparent",size:t="mdsm",fontWeight:n="normal",rounded:r="6",state:o="enabled",onClick:a,className:s,children:i,withRipple:u=!0,contrastRipple:l,showFocus:d="desktop",withDisabledDelay:m=!1,type:h="button",...g},b)=>{const[w,v]=f.useState(!1),E=T=>{o==="enabled"&&(m?(v(!0),a&&a(T),setTimeout(()=>v(!1),1e3)):a&&a(T))},{ref:S,ripple:j}=En(u,e==="contrast"||l),$=Ot(S,b);return c.jsx("button",{ref:$,type:h,disabled:g.disabled?g.disabled:o==="disabled"||o==="loading",onMouseDown:j,onClick:T=>w?null:E(T),className:k(Or,Fr[t],Ar[n],Wr[r],Rr[d],Ir[e],_r[o],g.disabled&&"opacity-50",s),...g,children:i})});q.displayName="Button";const Cn=6048e5,Yr=864e5,Qt=Symbol.for("constructDateFrom");function oe(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Qt in e?e[Qt](t):e instanceof Date?new e.constructor(t):new Date(t)}function Z(e,t){return oe(t||e,e)}function nt(e,t,n){const r=Z(e,n?.in);if(isNaN(t))return oe(e,NaN);if(!t)return r;const o=r.getDate(),a=oe(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);const s=a.getDate();return o>=s?a:(r.setFullYear(a.getFullYear(),a.getMonth(),o),r)}let zr={};function mt(){return zr}function Ye(e,t){const n=mt(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Z(e,t?.in),a=o.getDay(),s=(a<r?7:0)+a-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function st(e,t){return Ye(e,{...t,weekStartsOn:1})}function jn(e,t){const n=Z(e,t?.in),r=n.getFullYear(),o=oe(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=st(o),s=oe(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const i=st(s);return n.getTime()>=a.getTime()?r+1:n.getTime()>=i.getTime()?r:r-1}function Jt(e){const t=Z(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ht(e,...t){const n=oe.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function at(e,t){const n=Z(e,t?.in);return n.setHours(0,0,0,0),n}function Hr(e,t,n){const[r,o]=ht(n?.in,e,t),a=at(r),s=at(o),i=+a-Jt(a),u=+s-Jt(s);return Math.round((i-u)/Yr)}function Br(e,t){const n=jn(e,t),r=oe(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),st(r)}function yt(e,t,n){const[r,o]=ht(n?.in,e,t);return+at(r)==+at(o)}function qr(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Xr(e){return!(!qr(e)&&typeof e!="number"||isNaN(+Z(e)))}function Vr(e,t){const n=Z(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Kr(e,t){const[n,r]=ht(e,t.start,t.end);return{start:n,end:r}}function Ur(e,t){const{start:n,end:r}=Kr(t?.in,e);let o=+n>+r;const a=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0);let i=1;const u=[];for(;+s<=a;)u.push(oe(n,s)),s.setDate(s.getDate()+i),s.setHours(0,0,0,0);return o?u.reverse():u}function Gr(e,t){const n=Z(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Qr(e,t){const n=Z(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Jr={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"}},Zr=(e,t,n)=>{let r;const o=Jr[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function De(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const eo={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},to={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},no={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ro={date:De({formats:eo,defaultWidth:"full"}),time:De({formats:to,defaultWidth:"full"}),dateTime:De({formats:no,defaultWidth:"full"})},oo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},so=(e,t,n,r)=>oo[e];function ce(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):s;o=e.formattingValues[i]||e.formattingValues[s]}else{const s=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;o=e.values[i]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}const ao={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},io={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},co={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"]},lo={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"]},uo={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"}},fo={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"}},mo=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ho={ordinalNumber:mo,era:ce({values:ao,defaultWidth:"wide"}),quarter:ce({values:io,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ce({values:co,defaultWidth:"wide"}),day:ce({values:lo,defaultWidth:"wide"}),dayPeriod:ce({values:uo,defaultWidth:"wide",formattingValues:fo,defaultFormattingWidth:"wide"})};function le(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const s=a[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(i)?po(i,m=>m.test(s)):bo(i,m=>m.test(s));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const d=t.slice(s.length);return{value:l,rest:d}}}function bo(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function po(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function $n(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const i=t.slice(o.length);return{value:s,rest:i}}}const go=/^(\d+)(th|st|nd|rd)?/i,xo=/\d+/i,vo={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},wo={any:[/^b/i,/^(a|c)/i]},yo={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ko={any:[/1/i,/2/i,/3/i,/4/i]},No={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},Eo={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]},Co={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},jo={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]},$o={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},So={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}},Mo={ordinalNumber:$n({matchPattern:go,parsePattern:xo,valueCallback:e=>parseInt(e,10)}),era:le({matchPatterns:vo,defaultMatchWidth:"wide",parsePatterns:wo,defaultParseWidth:"any"}),quarter:le({matchPatterns:yo,defaultMatchWidth:"wide",parsePatterns:ko,defaultParseWidth:"any",valueCallback:e=>e+1}),month:le({matchPatterns:No,defaultMatchWidth:"wide",parsePatterns:Eo,defaultParseWidth:"any"}),day:le({matchPatterns:Co,defaultMatchWidth:"wide",parsePatterns:jo,defaultParseWidth:"any"}),dayPeriod:le({matchPatterns:$o,defaultMatchWidth:"any",parsePatterns:So,defaultParseWidth:"any"})},Sn={code:"en-US",formatDistance:Zr,formatLong:ro,formatRelative:so,localize:ho,match:Mo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function To(e,t){const n=Z(e,t?.in);return Hr(n,Qr(n))+1}function Do(e,t){const n=Z(e,t?.in),r=+st(n)-+Br(n);return Math.round(r/Cn)+1}function Mn(e,t){const n=Z(e,t?.in),r=n.getFullYear(),o=mt(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=oe(t?.in||e,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);const i=Ye(s,t),u=oe(t?.in||e,0);u.setFullYear(r,0,a),u.setHours(0,0,0,0);const l=Ye(u,t);return+n>=+i?r+1:+n>=+l?r:r-1}function Po(e,t){const n=mt(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=Mn(e,t),a=oe(t?.in||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),Ye(a,t)}function Lo(e,t){const n=Z(e,t?.in),r=+Ye(n,t)-+Po(n,t);return Math.round(r/Cn)+1}function Y(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const be={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Y(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Y(n+1,2)},d(e,t){return Y(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="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 n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Y(o,t.length)}},Me={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zt={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return be.y(e,t)},Y:function(e,t,n,r){const o=Mn(e,r),a=o>0?o:1-o;if(t==="YY"){const s=a%100;return Y(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):Y(a,t.length)},R:function(e,t){const n=jn(e);return Y(n,t.length)},u:function(e,t){const n=e.getFullYear();return Y(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Y(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Y(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return be.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Y(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Lo(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Y(o,t.length)},I:function(e,t,n){const r=Do(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Y(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):be.d(e,t)},D:function(e,t,n){const r=To(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Y(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Y(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Y(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Y(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Me.noon:r===0?o=Me.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Me.evening:r>=12?o=Me.afternoon:r>=4?o=Me.morning:o=Me.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return be.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):be.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Y(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Y(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):be.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):be.s(e,t)},S:function(e,t){return be.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return tn(r);case"XXXX":case"XX":return ke(r);case"XXXXX":case"XXX":default:return ke(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return tn(r);case"xxxx":case"xx":return ke(r);case"xxxxx":case"xxx":default:return ke(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+en(r,":");case"OOOO":default:return"GMT"+ke(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+en(r,":");case"zzzz":default:return"GMT"+ke(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Y(r,t.length)},T:function(e,t,n){return Y(+e,t.length)}};function en(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return a===0?n+String(o):n+String(o)+t+Y(a,2)}function tn(e,t){return e%60===0?(e>0?"-":"+")+Y(Math.abs(e)/60,2):ke(e,t)}function ke(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Y(Math.trunc(r/60),2),a=Y(r%60,2);return n+o+t+a}const nn=(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"})}},Tn=(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"})}},Oo=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return nn(e,t);let a;switch(r){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}}",nn(r,t)).replace("{{time}}",Tn(o,t))},Fo={p:Tn,P:Oo},Ro=/^D+$/,Ao=/^Y+$/,Wo=["D","DD","YY","YYYY"];function Io(e){return Ro.test(e)}function _o(e){return Ao.test(e)}function Yo(e,t,n){const r=zo(e,t,n);if(console.warn(r),Wo.includes(e))throw new RangeError(r)}function zo(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Ho=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bo=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qo=/^'([^]*?)'?$/,Xo=/''/g,Vo=/[a-zA-Z]/;function Ce(e,t,n){const r=mt(),o=n?.locale??r.locale??Sn,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=Z(e,n?.in);if(!Xr(i))throw new RangeError("Invalid time value");let u=t.match(Bo).map(d=>{const m=d[0];if(m==="p"||m==="P"){const h=Fo[m];return h(d,o.formatLong)}return d}).join("").match(Ho).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const m=d[0];if(m==="'")return{isToken:!1,value:Ko(d)};if(Zt[m])return{isToken:!0,value:d};if(m.match(Vo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:d}});o.localize.preprocessor&&(u=o.localize.preprocessor(i,u));const l={firstWeekContainsDate:a,weekStartsOn:s,locale:o};return u.map(d=>{if(!d.isToken)return d.value;const m=d.value;(!n?.useAdditionalWeekYearTokens&&_o(m)||!n?.useAdditionalDayOfYearTokens&&Io(m))&&Yo(m,t,String(e));const h=Zt[m[0]];return h(i,m,o.localize,l)}).join("")}function Ko(e){const t=e.match(qo);return t?t[1].replace(Xo,"'"):e}function rn(e,t,n){const[r,o]=ht(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function kt(e,t,n){return nt(e,-t,n)}const Uo={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"}},Go=(e,t,n)=>{let r;const o=Uo[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"en "+r:"hace "+r:r},Qo={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},Jo={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Zo={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},es={date:De({formats:Qo,defaultWidth:"full"}),time:De({formats:Jo,defaultWidth:"full"}),dateTime:De({formats:Zo,defaultWidth:"full"})},ts={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"},ns={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"},rs=(e,t,n,r)=>t.getHours()!==1?ns[e]:ts[e],os={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},ss={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},as={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"]},is={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"]},cs={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"}},ls={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"}},us=(e,t)=>Number(e)+"º",ds={ordinalNumber:us,era:ce({values:os,defaultWidth:"wide"}),quarter:ce({values:ss,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:ce({values:as,defaultWidth:"wide"}),day:ce({values:is,defaultWidth:"wide"}),dayPeriod:ce({values:cs,defaultWidth:"wide",formattingValues:ls,defaultFormattingWidth:"wide"})},fs=/^(\d+)(º)?/i,ms=/\d+/i,hs={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},bs={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]},ps={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},gs={any:[/1/i,/2/i,/3/i,/4/i]},xs={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},vs={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]},ws={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},ys={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]},ks={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},Ns={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}},Es={ordinalNumber:$n({matchPattern:fs,parsePattern:ms,valueCallback:function(e){return parseInt(e,10)}}),era:le({matchPatterns:hs,defaultMatchWidth:"wide",parsePatterns:bs,defaultParseWidth:"any"}),quarter:le({matchPatterns:ps,defaultMatchWidth:"wide",parsePatterns:gs,defaultParseWidth:"any",valueCallback:e=>e+1}),month:le({matchPatterns:xs,defaultMatchWidth:"wide",parsePatterns:vs,defaultParseWidth:"any"}),day:le({matchPatterns:ws,defaultMatchWidth:"wide",parsePatterns:ys,defaultParseWidth:"any"}),dayPeriod:le({matchPatterns:ks,defaultMatchWidth:"any",parsePatterns:Ns,defaultParseWidth:"any"})},ze={code:"es",formatDistance:Go,formatLong:es,formatRelative:rs,localize:ds,match:Es,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},it=e=>e&&"window"in e&&e.window===e?e:K(e).defaultView||window;function Cs(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function js(e){return Cs(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let $s=!1;function bt(){return $s}function on(e,t){if(!bt())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:js(n)?n=n.host:n=n.parentNode}return!1}const re=(e=document)=>{var t;if(!bt())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Te(e){return bt()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class Ss{get currentNode(){return this._currentNode}set currentNode(t){if(!on(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let r=t,o=t;for(this._currentNode=t;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const s=r,i=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});n.push(i),i.currentNode=o,this._currentSetFor.add(i),r=o=s.host}else r=r.parentNode;const a=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(a),a.currentNode=o,this._currentSetFor.add(a),this._walkerStack=n}get doc(){return this._doc}firstChild(){let t=this.currentNode,n=this.nextNode();return on(t,n)?(n&&(this.currentNode=n),n):(this.currentNode=t,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var n;let o;if(typeof this.filter=="function"?o=this.filter(t):!((n=this.filter)===null||n===void 0)&&n.acceptNode&&(o=this.filter.acceptNode(t)),o===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 r=this.nextNode();return r&&(this.currentNode=r),r}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 o=this.previousNode();return o&&(this.currentNode=o),o}else return null;return null}const n=t.previousNode();if(n){if(n.shadowRoot){var r;let a;if(typeof this.filter=="function"?a=this.filter(n):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(a=this.filter.acceptNode(n)),a===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let s=this.lastChild();return s&&(this.currentNode=s),s}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(t,n,r,o){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=s=>{if(s.nodeType===Node.ELEMENT_NODE){const u=s.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(s);if(!((i=this.filter)===null||i===void 0)&&i.acceptNode)return this.filter.acceptNode(s);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=n,this.filter=o??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(t.createTreeWalker(n,r,this._acceptNode));const a=n.shadowRoot;if(a){const s=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(s)}}}function Ms(e,t,n,r){return bt()?new Ss(e,t,n,r):e.createTreeWalker(t,n,r)}function sn(e){if(Ts())e.focus({preventScroll:!0});else{let t=Ds(e);e.focus(),Ps(t)}}let Ze=null;function Ts(){if(Ze==null){Ze=!1;try{document.createElement("div").focus({get preventScroll(){return Ze=!0,!0}})}catch{}}return Ze}function Ds(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Ps(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function pt(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function Ft(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 Rt=he(function(){return Ft(/^Mac/i)}),Ls=he(function(){return Ft(/^iPhone/i)}),Os=he(function(){return Ft(/^iPad/i)||Rt()&&navigator.maxTouchPoints>1}),Fs=he(function(){return Ls()||Os()});he(function(){return Rt()||Fs()});he(function(){return pt(/AppleWebKit/i)&&!Dn()});const Dn=he(function(){return pt(/Chrome/i)}),Pn=he(function(){return pt(/Android/i)});he(function(){return pt(/Firefox/i)});let ge=new Map,Ct=new Set;function an(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let o=ge.get(r.target);o||(o=new Set,ge.set(r.target,o),r.target.addEventListener("transitioncancel",n,{once:!0})),o.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let o=ge.get(r.target);if(o&&(o.delete(r.propertyName),o.size===0&&(r.target.removeEventListener("transitioncancel",n),ge.delete(r.target)),ge.size===0)){for(let a of Ct)a();Ct.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?an():document.addEventListener("DOMContentLoaded",an));function Rs(){for(const[e]of ge)"isConnected"in e&&!e.isConnected&&ge.delete(e)}function As(e){requestAnimationFrame(()=>{Rs(),ge.size===0?e():Ct.add(e)})}function Ws(e){return e.pointerType===""&&e.isTrusted?!0:Pn()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}const Is=typeof Element<"u"&&"checkVisibility"in Element.prototype;function _s(e){const t=it(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,o=n!=="none"&&r!=="hidden"&&r!=="collapse";if(o){const{getComputedStyle:a}=e.ownerDocument.defaultView;let{display:s,visibility:i}=a(e);o=s!=="none"&&i!=="hidden"&&i!=="collapse"}return o}function Ys(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 At(e,t){return Is?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&_s(e)&&Ys(e,t)&&(!e.parentElement||At(e.parentElement,e))}const Wt=["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"],zs=Wt.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";Wt.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Hs=Wt.join(':not([hidden]):not([tabindex="-1"]),');function Bs(e){return e.matches(zs)&&At(e)&&!Ln(e)}function qs(e){return e.matches(Hs)&&At(e)&&!Ln(e)}function Ln(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}let Xs=!1,Ke=null,Vs=new Set,Ie=new Map,je=!1,jt=!1;function It(e,t){for(let n of Vs)n(e,t)}function Ks(e){return!(e.metaKey||!Rt()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function ct(e){je=!0,Ks(e)&&(Ke="keyboard",It("keyboard",e))}function ee(e){Ke="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(je=!0,It("pointer",e))}function On(e){Ws(e)&&(je=!0,Ke="virtual")}function Fn(e){e.target===window||e.target===document||Xs||!e.isTrusted||(!je&&!jt&&(Ke="virtual",It("virtual",e)),je=!1,jt=!1)}function Rn(){je=!1,jt=!0}function cn(e){if(typeof window>"u"||typeof document>"u"||Ie.get(it(e)))return;const t=it(e),n=K(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){je=!0,r.apply(this,arguments)},n.addEventListener("keydown",ct,!0),n.addEventListener("keyup",ct,!0),n.addEventListener("click",On,!0),t.addEventListener("focus",Fn,!0),t.addEventListener("blur",Rn,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ee,!0),n.addEventListener("pointermove",ee,!0),n.addEventListener("pointerup",ee,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",ee,!0),n.addEventListener("mousemove",ee,!0),n.addEventListener("mouseup",ee,!0)),t.addEventListener("beforeunload",()=>{An(e)},{once:!0}),Ie.set(t,{focus:r})}const An=(e,t)=>{const n=it(e),r=K(e);t&&r.removeEventListener("DOMContentLoaded",t),Ie.has(n)&&(n.HTMLElement.prototype.focus=Ie.get(n).focus,r.removeEventListener("keydown",ct,!0),r.removeEventListener("keyup",ct,!0),r.removeEventListener("click",On,!0),n.removeEventListener("focus",Fn,!0),n.removeEventListener("blur",Rn,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ee,!0),r.removeEventListener("pointermove",ee,!0),r.removeEventListener("pointerup",ee,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",ee,!0),r.removeEventListener("mousemove",ee,!0),r.removeEventListener("mouseup",ee,!0)),Ie.delete(n))};function Us(e){const t=K(e);let n;return t.readyState!=="loading"?cn(e):(n=()=>{cn(e)},t.addEventListener("DOMContentLoaded",n)),()=>An(e,n)}typeof document<"u"&&Us();function Wn(){return Ke}function Gs(e){const t=K(e),n=re(t);if(Wn()==="virtual"){let r=n;As(()=>{re(t)===r&&e.isConnected&&sn(e)})}else sn(e)}const ln=f.createContext(null),$t="react-aria-focus-scope-restore";let z=null;function Qs(e){let{children:t,contain:n,restoreFocus:r,autoFocus:o}=e,a=f.useRef(null),s=f.useRef(null),i=f.useRef([]),{parentNode:u}=f.useContext(ln)||{},l=f.useMemo(()=>new Mt({scopeRef:i}),[i]);ue(()=>{let h=u||B.root;if(B.getTreeNode(h.scopeRef)&&z&&!lt(z,h.scopeRef)){let g=B.getTreeNode(z);g&&(h=g)}h.addChild(l),B.addNode(l)},[l,u]),ue(()=>{let h=B.getTreeNode(i);h&&(h.contain=!!n)},[n]),ue(()=>{var h;let g=(h=a.current)===null||h===void 0?void 0:h.nextSibling,b=[],w=v=>v.stopPropagation();for(;g&&g!==s.current;)b.push(g),g.addEventListener($t,w),g=g.nextSibling;return i.current=b,()=>{for(let v of b)v.removeEventListener($t,w)}},[t]),na(i,r,n),ea(i,n),ra(i,r,n),ta(i,o),f.useEffect(()=>{const h=re(K(i.current?i.current[0]:void 0));let g=null;if(te(h,i.current)){for(let b of B.traverse())b.scopeRef&&te(h,b.scopeRef.current)&&(g=b);g===B.getTreeNode(i)&&(z=g.scopeRef)}},[i]),ue(()=>()=>{var h,g,b;let w=(b=(g=B.getTreeNode(i))===null||g===void 0||(h=g.parent)===null||h===void 0?void 0:h.scopeRef)!==null&&b!==void 0?b:null;(i===z||lt(i,z))&&(!w||B.getTreeNode(w))&&(z=w),B.removeTreeNode(i)},[i]);let d=f.useMemo(()=>Js(i),[]),m=f.useMemo(()=>({focusManager:d,parentNode:l}),[l,d]);return f.createElement(ln.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:s}))}function Js(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:o,wrap:a,accept:s}=t;var i;let u=r||re(K((i=n[0])!==null&&i!==void 0?i:void 0)),l=n[0].previousElementSibling,d=Ne(n),m=xe(d,{tabbable:o,accept:s},n);m.currentNode=te(u,n)?u:l;let h=m.nextNode();return!h&&a&&(m.currentNode=l,h=m.nextNode()),h&&fe(h,!0),h},focusPrevious(t={}){let n=e.current,{from:r,tabbable:o,wrap:a,accept:s}=t;var i;let u=r||re(K((i=n[0])!==null&&i!==void 0?i:void 0)),l=n[n.length-1].nextElementSibling,d=Ne(n),m=xe(d,{tabbable:o,accept:s},n);m.currentNode=te(u,n)?u:l;let h=m.previousNode();return!h&&a&&(m.currentNode=l,h=m.previousNode()),h&&fe(h,!0),h},focusFirst(t={}){let n=e.current,{tabbable:r,accept:o}=t,a=Ne(n),s=xe(a,{tabbable:r,accept:o},n);s.currentNode=n[0].previousElementSibling;let i=s.nextNode();return i&&fe(i,!0),i},focusLast(t={}){let n=e.current,{tabbable:r,accept:o}=t,a=Ne(n),s=xe(a,{tabbable:r,accept:o},n);s.currentNode=n[n.length-1].nextElementSibling;let i=s.previousNode();return i&&fe(i,!0),i}}}function Ne(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 Zs(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 n,r;let a=(r=e.form)===null||r===void 0||(n=r.elements)===null||n===void 0?void 0:n.namedItem(e.name);t=[...a??[]]}return t?!t.some(a=>a.checked):!1}function ea(e,t){let n=f.useRef(void 0),r=f.useRef(void 0);ue(()=>{let o=e.current;if(!t){r.current&&(cancelAnimationFrame(r.current),r.current=void 0);return}const a=K(o?o[0]:void 0);let s=l=>{if(l.key!=="Tab"||l.altKey||l.ctrlKey||l.metaKey||!Ae(e)||l.isComposing)return;let d=re(a),m=e.current;if(!m||!te(d,m))return;let h=Ne(m),g=xe(h,{tabbable:!0},m);if(!d)return;g.currentNode=d;let b=l.shiftKey?g.previousNode():g.nextNode();b||(g.currentNode=l.shiftKey?m[m.length-1].nextElementSibling:m[0].previousElementSibling,b=l.shiftKey?g.previousNode():g.nextNode()),l.preventDefault(),b&&fe(b,!0)},i=l=>{(!z||lt(z,e))&&te(Te(l),e.current)?(z=e,n.current=Te(l)):Ae(e)&&!Ee(Te(l),e)?n.current?n.current.focus():z&&z.current&&St(z.current):Ae(e)&&(n.current=Te(l))},u=l=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let d=Wn(),m=(d==="virtual"||d===null)&&Pn()&&Dn(),h=re(a);if(!m&&h&&Ae(e)&&!Ee(h,e)){z=e;let b=Te(l);if(b&&b.isConnected){var g;n.current=b,(g=n.current)===null||g===void 0||g.focus()}else z.current&&St(z.current)}})};return a.addEventListener("keydown",s,!1),a.addEventListener("focusin",i,!1),o?.forEach(l=>l.addEventListener("focusin",i,!1)),o?.forEach(l=>l.addEventListener("focusout",u,!1)),()=>{a.removeEventListener("keydown",s,!1),a.removeEventListener("focusin",i,!1),o?.forEach(l=>l.removeEventListener("focusin",i,!1)),o?.forEach(l=>l.removeEventListener("focusout",u,!1))}},[e,t]),ue(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function In(e){return Ee(e)}function te(e,t){return!e||!t?!1:t.some(n=>n.contains(e))}function Ee(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of B.traverse(B.getTreeNode(t)))if(n&&te(e,n.current))return!0;return!1}function lt(e,t){var n;let r=(n=B.getTreeNode(t))===null||n===void 0?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function fe(e,t=!1){if(e!=null&&!t)try{Gs(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function _n(e,t=!0){let n=e[0].previousElementSibling,r=Ne(e),o=xe(r,{tabbable:t},e);o.currentNode=n;let a=o.nextNode();return t&&!a&&(r=Ne(e),o=xe(r,{tabbable:!1},e),o.currentNode=n,a=o.nextNode()),a}function St(e,t=!0){fe(_n(e,t))}function ta(e,t){const n=f.useRef(t);f.useEffect(()=>{if(n.current){z=e;const r=K(e.current?e.current[0]:void 0);!te(re(r),z.current)&&e.current&&St(e.current)}n.current=!1},[e])}function na(e,t,n){ue(()=>{if(t||n)return;let r=e.current;const o=K(r?r[0]:void 0);let a=s=>{let i=Te(s);te(i,e.current)?z=e:In(i)||(z=null)};return o.addEventListener("focusin",a,!1),r?.forEach(s=>s.addEventListener("focusin",a,!1)),()=>{o.removeEventListener("focusin",a,!1),r?.forEach(s=>s.removeEventListener("focusin",a,!1))}},[e,t,n])}function un(e){let t=B.getTreeNode(z);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function ra(e,t,n){const r=f.useRef(typeof document<"u"?re(K(e.current?e.current[0]:void 0)):null);ue(()=>{let o=e.current;const a=K(o?o[0]:void 0);if(!t||n)return;let s=()=>{(!z||lt(z,e))&&te(re(a),e.current)&&(z=e)};return a.addEventListener("focusin",s,!1),o?.forEach(i=>i.addEventListener("focusin",s,!1)),()=>{a.removeEventListener("focusin",s,!1),o?.forEach(i=>i.removeEventListener("focusin",s,!1))}},[e,n]),ue(()=>{const o=K(e.current?e.current[0]:void 0);if(!t)return;let a=s=>{if(s.key!=="Tab"||s.altKey||s.ctrlKey||s.metaKey||!Ae(e)||s.isComposing)return;let i=o.activeElement;if(!Ee(i,e)||!un(e))return;let u=B.getTreeNode(e);if(!u)return;let l=u.nodeToRestore,d=xe(o.body,{tabbable:!0});d.currentNode=i;let m=s.shiftKey?d.previousNode():d.nextNode();if((!l||!l.isConnected||l===o.body)&&(l=void 0,u.nodeToRestore=void 0),(!m||!Ee(m,e))&&l){d.currentNode=l;do m=s.shiftKey?d.previousNode():d.nextNode();while(Ee(m,e));s.preventDefault(),s.stopPropagation(),m?fe(m,!0):In(l)?fe(l,!0):i.blur()}};return n||o.addEventListener("keydown",a,!0),()=>{n||o.removeEventListener("keydown",a,!0)}},[e,t,n]),ue(()=>{const o=K(e.current?e.current[0]:void 0);if(!t)return;let a=B.getTreeNode(e);if(a){var s;return a.nodeToRestore=(s=r.current)!==null&&s!==void 0?s:void 0,()=>{let i=B.getTreeNode(e);if(!i)return;let u=i.nodeToRestore,l=re(o);if(t&&u&&(l&&Ee(l,e)||l===o.body&&un(e))){let d=B.clone();requestAnimationFrame(()=>{if(o.activeElement===o.body){let m=d.getTreeNode(e);for(;m;){if(m.nodeToRestore&&m.nodeToRestore.isConnected){dn(m.nodeToRestore);return}m=m.parent}for(m=d.getTreeNode(e);m;){if(m.scopeRef&&m.scopeRef.current&&B.getTreeNode(m.scopeRef)){let h=_n(m.scopeRef.current,!0);dn(h);return}m=m.parent}}})}}}},[e,t])}function dn(e){e.dispatchEvent(new CustomEvent($t,{bubbles:!0,cancelable:!0}))&&fe(e)}function xe(e,t,n){let r=t?.tabbable?qs:Bs,o=e?.nodeType===Node.ELEMENT_NODE?e:null,a=K(o),s=Ms(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"&&(!Zs(i)||s.currentNode.tagName==="INPUT"&&s.currentNode.type==="radio"&&s.currentNode.name===i.name)?NodeFilter.FILTER_REJECT:r(i)&&(!n||te(i,n))&&(!t?.accept||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(s.currentNode=t.from),s}class _t{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,r){let o=this.fastMap.get(n??null);if(!o)return;let a=new Mt({scopeRef:t});o.addChild(a),a.parent=o,this.fastMap.set(t,a),r&&(a.nodeToRestore=r)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let r=n.parent;for(let a of this.traverse())a!==n&&n.nodeToRestore&&a.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&te(a.nodeToRestore,n.scopeRef.current)&&(a.nodeToRestore=n.nodeToRestore);let o=n.children;r&&(r.removeChild(n),o.size>0&&o.forEach(a=>r&&r.addChild(a))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){var t;let n=new _t;var r;for(let o of this.traverse())n.addTreeNode(o.scopeRef,(r=(t=o.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&r!==void 0?r:null,o.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new Mt({scopeRef:null}),this.fastMap.set(null,this.root)}}class Mt{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 we=({children:e,node:t})=>gn.createPortal(e,t??document.body),Yn=({children:e,customTrigger:t,triggerContent:n,align:r="start",side:o="bottom",offset:a=8,className:s,triggerClassName:i,closeOnEscape:u=!0,closeOnClickAway:l=!0,scrollerId:d,onOpen:m,onClose:h,maxHeight:g="400px",minWidth:b="200px",maxWidth:w="500px"})=>{const{triggerRef:v,triggerProps:E,popoverRef:S,getPopoverPosition:j,open:$,toggle:T,close:y}=Ve({align:r,side:o,offset:a,scrollerId:d,onOpen:()=>{m?.()},onClose:()=>{h?.()}});Lt({Escape:M=>{u&&(M.preventDefault(),y(),v.current?.focus())}},{enabled:$}),qe(S,M=>{!l||!v.current||!$||!M.target||v.current.contains(M.target)||y()});const p=j();return c.jsxs(c.Fragment,{children:[t?t({triggerRef:v,triggerProps:E,toggle:T,open:$,close:y}):c.jsx("button",{ref:v,...E,onClick:T,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:n}),c.jsx(O.AnimatePresence,{children:$&&c.jsx(we,{children:c.jsx(Qs,{contain:!0,restoreFocus:!0,autoFocus:!0,children:c.jsx(O.motion.div,{initial:{opacity:0,scale:.95,y:o==="bottom"?-10:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:o==="bottom"?-10:10},transition:{type:"spring",duration:.2,bounce:.1},ref:S,style:{position:"fixed",left:p.x,top:p.top,bottom:p.bottom,maxHeight:typeof g=="number"?`${g}px`:g,minWidth:typeof b=="number"?`${b}px`:b,maxWidth:typeof w=="number"?`${w}px`:w,zIndex:1e3},className:k("bg-base-1 dark-theme:bg-base-2","border border-base-4 rounded-6","customscrollbar overflow-auto",s),children:typeof e=="function"?e(T):e})})})})]})},oa=({title:e,subtitle:t,onClose:n,className:r})=>c.jsx("div",{className:k("p-4 border-b border-base-4",r),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})]}),n&&c.jsx("button",{onClick:n,className:"ml-4 text-base-11 hover:text-base-12 transition-colors",children:"×"})]})}),sa=({children:e,className:t})=>c.jsx("div",{className:k("p-4",t),children:e}),aa=({children:e,className:t})=>c.jsx("div",{className:k("p-4 border-t border-base-4",t),children:e}),ia=(e,t)=>{const n=new Date(2023,0,1),r=[];for(let o=0;o<7;o++){const a=new Date(n);a.setDate(n.getDate()+o),r.push(Ce(a,"EEE",{locale:e??Sn}))}return t?[...r.slice(1),r[0]]:r},Yt=({selectedDate:e,onDateSelect:t,disabledDates:n,disabledDaysOfWeek:r,minDate:o,maxDate:a,locale:s,weekStartsOnMonday:i=!0,className:u=""})=>{const[l,d]=f.useState(e||new Date),[m,h]=f.useState(e||new Date),g=f.useRef(null),b=f.useMemo(()=>n?new Set(n.map(y=>new Date(y).toDateString())):new Set,[n]),w=f.useMemo(()=>new Set(r||[]),[r]),v=f.useMemo(()=>{const y=Gr(l),p=Vr(l),M=new Date(y),R=new Date(p);if(i){const C=y.getDay(),x=C===0?6:C-1;M.setDate(y.getDate()-x);const P=p.getDay(),D=P===0?0:7-P;R.setDate(p.getDate()+D)}else M.setDate(y.getDate()-y.getDay()),R.setDate(p.getDate()+(6-p.getDay()));return Ur({start:M,end:R})},[l,i]),E=f.useMemo(()=>ia(s??ze,i),[s,i]),S=y=>{const p=y.toDateString(),M=y.getDay();return!(b.has(p)||w.has(M)||o&&y<o||a&&y>a)},j=y=>{S(y)&&t&&t(y),h(y)},$=y=>{if(!m)return;let p=new Date(m),M=!0,R,C;switch(y.key){case"ArrowUp":p.setDate(p.getDate()-7);break;case"ArrowDown":p.setDate(p.getDate()+7);break;case"ArrowLeft":p.setDate(p.getDate()-1);break;case"ArrowRight":p.setDate(p.getDate()+1);break;case"Home":R=p.getDay(),p.setDate(p.getDate()-R);break;case"End":C=p.getDay(),p.setDate(p.getDate()+(6-C));break;case"PageUp":p=y.shiftKey?kt(p,12):kt(p,1);break;case"PageDown":p=y.shiftKey?nt(p,12):nt(p,1);break;case"Enter":case" ":S(m)&&t&&t(m);break;default:M=!1}M&&(y.preventDefault(),p.getTime()!==m.getTime()&&(h(p),rn(p,l)||d(p)))},T=y=>{d(p=>y==="prev"?kt(p,1):nt(p,1))};return c.jsxs("div",{ref:g,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:$,tabIndex:0,role:"grid","aria-label":"Calendar",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(q,{onClick:()=>T("prev"),size:"iconSm","aria-label":"Previous month",children:c.jsx(F.ChevronLeft,{size:16})}),c.jsx("h2",{className:"text-sm font-medium",children:Ce(l,"MMMM yyyy")}),c.jsx(q,{onClick:()=>T("next"),size:"iconSm","aria-label":"Next month",children:c.jsx(F.ChevronRight,{size:16})})]}),c.jsx("div",{className:"grid grid-cols-7 gap-1 mt-4",role:"row",children:E.map(y=>c.jsx("div",{className:"text-xs flex items-center w-8 justify-center text-base-11",role:"columnheader",children:y},y))}),c.jsx("div",{className:"grid grid-cols-7 gap-1 mt-4",role:"grid",children:v.map((y,p)=>{const M=rn(y,l),R=e?yt(y,e):!1,C=m&&yt(y,m),x=S(y),P=yt(y,new Date);return c.jsx("button",{onClick:()=>j(y),disabled:!x,tabIndex:C?0:-1,role:"gridcell","aria-label":`${y.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})}${R?", selected":""}${x?"":", disabled"}`,"aria-selected":R,"aria-disabled":!x,className:k("h-8 w-8 flex items-center outline-none justify-center rounded-6 hover:bg-base-4 text-sm relative",M?R?"bg-brand text-brand-text hover:bg-brand":P?"text-base-12 ring-1 ring-base-8":"text-base-12":"text-base-9",C&&"ring-1 ring-base-6",(!x||!M)&&"pointer-events-none text-base-9"),children:Ce(y,"d")},p)})})]})},ca=()=>{const[e,t]=f.useState(new Date(2025,8,21)),n=["2025-09-13T00:00:00Z","2025-09-15T00:00:00Z"],r=[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:n,disabledDaysOfWeek:r,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 la({customTrigger:e,scrollerId:t}){const[n,r]=f.useState(new Date);return c.jsx(Yn,{className:"p-0",scrollerId:t,customTrigger:({toggle:o,triggerRef:a})=>e?e(o,a):c.jsxs(q,{ref:a,onClick:o,color:"solid",className:"px-3 mt-1 w-full justify-start",children:[Ce(new Date,"PP",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(F.CalendarDays,{size:18,className:"text-base-11"})]}),children:o=>c.jsx(Yt,{selectedDate:n,onDateSelect:a=>{r(a),o()},className:"border-none",disabledDaysOfWeek:[0,6]})})}const ua=()=>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:[Ce(new Date,"p",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(F.Clock,{size:18,className:"text-base-11"})]})]}),da=()=>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:[Ce(new Date,"PP",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(F.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:[Ce(new Date,"p",{locale:ze}),c.jsx("span",{className:"grow"}),c.jsx(F.Clock,{size:18,className:"text-base-11"})]})]})]}),et={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"},zn=f.forwardRef(({checked:e=!1,onCheckedChange:t,disabled:n=!1,required:r=!1,name:o,value:a,id:s,className:i="",size:u="sm",...l},d)=>{const m=()=>{n||t?.(e==="indeterminate"?!0:!e)},h=w=>{(w.key===" "||w.key==="Enter")&&(w.preventDefault(),m())},g={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":r,disabled:n,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",g[u],n&&"cursor-not-allowed opacity-75",!n&&"cursor-pointer",e?n?et.checkedDisabled:et.checked:n?et.uncheckedDisabled:et.unchecked,typeof i=="function"?i(e):i),...l,children:[e===!0&&c.jsx(F.Check,{size:b[u],className:"stroke-current"}),e==="indeterminate"&&c.jsx(F.Minus,{size:b[u],className:"stroke-current"})]}),c.jsx("input",{type:"checkbox",name:o,value:a,checked:e===!0,onChange:()=>{},disabled:n,required:r,id:s,className:"sr-only",tabIndex:-1})]})});zn.displayName="Checkbox";const fa=({title:e,message:t,searchParam:n,condition:r=!0,cancelLabel:o,confirmLabel:a,confirmColor:s="contrast",confirmAction:i,trigger:u})=>{const{searchParams:l}=de.useSearchParams(),d=f.useMemo(()=>!!l[n],[l]),m=f.useCallback(()=>{de.navigate.to(`${window.location.pathname}?${n}=open`)},[n]);return c.jsxs(c.Fragment,{children:[c.jsx(O.AnimatePresence,{initial:!1,children:d&&r?c.jsxs(we,{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:o??"Cancelar"}),c.jsx(q,{size:"sm",onClick:()=>{i&&i(),de.navigate.back()},color:s,children:a??"Continuar"})]})]})]}):null}),u?u(m):null]})},ma=({className:e})=>c.jsx("div",{className:k("w-full h-px bg-base-4",e)}),Hn=f.createContext(null),Bn=({children:e})=>{const[t,n]=f.useState(null),r=f.useRef(new Map),o=f.useRef(new Set),a=l=>{o.current.add(l)},s=l=>{o.current.delete(l)},i=l=>{n(l)},u=()=>{r.current.forEach(l=>l()),n(null)};return c.jsx(Hn.Provider,{value:{openMenuContainers:o,registerMenuContainer:a,unregisterMenuContainer:s,activeMenuId:t,setActiveMenu:i,closeAllMenus:u,menuClosers:r},children:e})},ha=()=>{const e=f.useContext(Hn);if(!e)throw new Error("Wrap dropdown into MenuFocusProvider");return e},ba=[{icon:F.User,label:"Profile",shortcut:"⌘P",onClick:()=>console.log("Profile clicked")},{icon:F.Settings,label:"Settings",submenu:[{label:"General",onClick:()=>console.log("General settings")},{label:"Privacy",onClick:()=>console.log("Privacy settings")},{label:"Appearance",submenu:[{label:"Light Theme",onClick:()=>console.log("Light theme")},{label:"Dark Theme",onClick:()=>console.log("Dark theme")}]}]},{icon:F.Plus,label:"New Item",shortcut:"⌘N",onClick:()=>console.log("New Item clicked")},{icon:F.Edit,label:"Edit",shortcut:"⌘E",onClick:()=>console.log("Edit clicked"),separator:!0},{icon:F.Trash2,label:"Delete",shortcut:"⌘⌫",destructive:!0,onClick:()=>console.log("Delete clicked"),separator:!0},{icon:F.LogOut,label:"Log out",shortcut:"⇧⌘Q",onClick:()=>console.log("Log out clicked")}],qn=({prevMenuId:e,children:t,customTrigger:n,items:r=ba,align:o="start",side:a="bottom",offset:s=4,level:i=0,className:u})=>{const l=f.useRef(`menu-${Math.random().toString(36).substr(2,9)}`),d=ha(),m=d.activeMenuId===l.current,{triggerRef:h,triggerProps:g,popoverRef:b,getPopoverPosition:w,open:v,toggle:E,close:S}=Ve({align:o,side:a,offset:s,onOpen:()=>{d.menuClosers?.current?.set(l.current,S),d.setActiveMenu(l.current),b.current&&d.registerMenuContainer(b.current),setTimeout(()=>T(0),10)},onClose:()=>{d.menuClosers?.current?.delete(l.current),b.current&&d.unregisterMenuContainer(b.current),e&&d.setActiveMenu(e)}}),j=f.useRef(-1),$=f.useRef([]),T=f.useCallback(p=>{j.current=p,$.current[p]?.focus()},[r]);Lt({Escape:p=>{p.preventDefault(),i>0?S():d.closeAllMenus(),h.current?.focus()},ArrowDown:p=>{p.preventDefault(),p.stopPropagation();const M=j.current>=$.current.length-1?0:j.current+1;T(M)},ArrowUp:p=>{p.preventDefault(),p.stopPropagation();const M=j.current<=0?$.current.length-1:j.current-1;T(M)},ArrowRight:p=>{p.preventDefault(),p.stopPropagation();const M=r[j.current];M?.submenu&&M.submenu.length>0&&$.current[j.current]?.click()},ArrowLeft:p=>{p.preventDefault(),p.stopPropagation(),i>0&&(S(),h.current?.focus())},Home:p=>{p.preventDefault(),p.stopPropagation(),T(0)},End:p=>{p.preventDefault(),p.stopPropagation(),T($.current.length-1)},Tab:()=>{d.closeAllMenus()}},{enabled:v&&m}),qe(b,p=>{if(!(!h.current||!m||!v||!p.target)){for(const M of d.openMenuContainers.current)if(M.contains(p.target))return;d.closeAllMenus()}});const y=w();return c.jsxs(c.Fragment,{children:[n?n({triggerRef:h,triggerProps:g,toggle:E,open:v}):c.jsx("button",{ref:h,...g,onClick:E,className:k("outline-none p-1 rounded-6 lg:focus:ring-1 ring-brand cursor-pointer",u),children:t}),c.jsx(O.AnimatePresence,{children:v&&c.jsx(we,{children:c.jsx(O.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:10},transition:{duration:.15},ref:b,style:{position:"fixed",left:y.x,top:y.top,bottom:y.bottom,zIndex:1e3},className:k("flex flex-col min-w-[192px] max-h-[300px] bg-base-1 dark-theme:bg-base-3","border border-base-4 light-theme:drop-shadow-sm rounded-6","customscrollbar"),children:r.map((p,M)=>{const R=p.submenu&&p.submenu.length>0;return R?c.jsx(qn,{side:"right",items:p.submenu,className:"w-full first:rounded-t-6 last:rounded-b-6",level:i+1,prevMenuId:l.current,offset:0,customTrigger:({triggerRef:C,toggle:x,open:P})=>c.jsxs("button",{ref:D=>{$.current[M]=D,C&&(C.current=D)},...g,className:k("px-3 py-2 w-full text-start text-sm flex items-center gap-x-2","max-lg:active:bg-base-3 dark-theme:max-lg:active:bg-base-4 lg:hover:bg-base-3 dark-theme:lg:hover:bg-base-4","outline-none lg:focus:bg-base-3 dark-theme:lg:focus:bg-base-4","transition-colors",p.destructive?"text-red-9 ring-red-9":"ring-brand",p.separator&&"border-b border-base-4",P&&"bg-base-3 dark-theme:bg-base-4"),role:"menuitem",tabIndex:-1,onClick:()=>{x()},children:[p.icon&&c.jsx(p.icon,{size:16}),c.jsx("span",{className:"flex-1",children:p.label}),p.shortcut&&c.jsx("span",{className:"text-xs text-base-11",children:p.shortcut}),R&&c.jsx(F.ChevronRight,{size:14,className:"text-base-11"})]},M)},M):c.jsxs("button",{ref:C=>{$.current[M]=C},className:k("px-3 py-2 w-full text-start text-sm flex items-center gap-x-2","first:rounded-t-6 last:rounded-b-6","max-lg:active:bg-base-3 dark-theme:max-lg:active:bg-base-2 lg:hover:bg-base-3 dark-theme:lg:hover:bg-base-2","outline-none lg:focus:bg-base-3 dark-theme:lg:focus:bg-base-4",p.destructive?"text-red-9 ring-red-9":"ring-brand",p.separator&&"border-b border-base-4"),role:"menuitem",tabIndex:-1,onClick:()=>{p.onClick?.(),S(),h.current?.focus()},children:[p.icon&&c.jsx(p.icon,{size:16}),c.jsx("span",{className:"flex-1",children:p.label}),p.shortcut&&c.jsx("span",{className:"text-xs text-base-11",children:p.shortcut}),R&&c.jsx(F.ChevronRight,{size:14,className:"text-base-11"})]},M)})})})})]})},pa=e=>c.jsx(Bn,{children:c.jsx(qn,{...e})}),ga=({scrollY:e,height:t=300,className:n,children:r})=>{const o=O.useTransform(e,s=>s<0?1+Math.abs(s)/t:1),a=O.useTransform(e,s=>s<0?-Math.abs(s)/2:0);return c.jsx(O.motion.div,{style:{scale:o,y:a,height:t},className:n,children:r})};function Xn(e,t,n){function r(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 s.prototype)d in i||Object.defineProperty(i,d,{value:s.prototype[d].bind(i)});i._zod.constr=s,i._zod.def=u}const o=n?.Parent??Object;class a extends o{}Object.defineProperty(a,"name",{value:e});function s(i){var u;const l=n?.Parent?new a:this;r(l,i),(u=l._zod).deferred??(u.deferred=[]);for(const d of l._zod.deferred)d();return l}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:i=>n?.Parent&&i instanceof n.Parent?!0:i?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class xa extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const va={};function Vn(e){return va}function wa(e,t){return typeof t=="bigint"?t.toString():t}const Kn=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e=="string"?e:e?.message}function Un(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=tt(e.inst?._zod.def?.error?.(e))??tt(t?.error?.(e))??tt(n.customError?.(e))??tt(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}const Gn=(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,wa,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ya=Xn("$ZodError",Gn),Qn=Xn("$ZodError",Gn,{Parent:Error}),ka=e=>(t,n,r,o)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new xa;if(s.issues.length){const i=new(o?.Err??e)(s.issues.map(u=>Un(u,a,Vn())));throw Kn(i,o?.callee),i}return s.value},Na=ka(Qn),Ea=e=>async(t,n,r,o)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){const i=new(o?.Err??e)(s.issues.map(u=>Un(u,a,Vn())));throw Kn(i,o?.callee),i}return s.value},Ca=Ea(Qn);function fn(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function ja(e,t){for(var n={};e.length;){var r=e[0],o=r.code,a=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var i=r.unionErrors[0].errors[0];n[s]={message:i.message,type:i.code}}else n[s]={message:a,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(m){return e.push(m)})}),t){var u=n[s].types,l=u&&u[r.code];n[s]=J.appendErrors(s,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function $a(e,t){for(var n={};e.length;){var r=e[0],o=r.code,a=r.message,s=r.path.join(".");if(!n[s])if(r.code==="invalid_union"&&r.errors.length>0){var i=r.errors[0][0];n[s]={message:i.message,type:i.code}}else n[s]={message:a,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(d){return d.forEach(function(m){return e.push(m)})}),t){var u=n[s].types,l=u&&u[r.code];n[s]=J.appendErrors(s,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function Sa(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,a){try{return Promise.resolve(fn(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(s){return a.shouldUseNativeValidation&&Je.validateFieldsNatively({},a),{errors:{},values:n.raw?Object.assign({},r):s}})},function(s){if((function(i){return Array.isArray(i?.issues)})(s))return{values:{},errors:Je.toNestErrors(ja(s.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw s}))}catch(s){return Promise.reject(s)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,a){try{return Promise.resolve(fn(function(){return Promise.resolve((n.mode==="sync"?Na:Ca)(e,r,t)).then(function(s){return a.shouldUseNativeValidation&&Je.validateFieldsNatively({},a),{errors:{},values:n.raw?Object.assign({},r):s}})},function(s){if((function(i){return i instanceof ya})(s))return{values:{},errors:Je.toNestErrors($a(s.issues,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw s}))}catch(s){return Promise.reject(s)}};throw new Error("Invalid input: not a Zod schema")}function Ma({methods:e,onSubmit:t,onError:n,children:r,logErrors:o,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((s,i)=>t(s,i),s=>{o&&console.log(s),n?.(s)}),children:r})})}function Ta(e,t){return J.useForm({resolver:Sa(e),defaultValues:t})}const Jn=({children:e,size:t=24,strokeWidth:n=2,viewBox:r="0 0 24 24",className:o,...a})=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:r,className:o,...a,children:e}),Da={solid:"bg-base-3 border border-base-4 drop-shadow-sm dark-theme:drop-shadow-none",outline:"border border-base-6"},Pa={brand:"ring-1 ring-brand",solid:"ring-1 ring-base-6"},zt=f.forwardRef(({label:e,description:t,labelPosition:n="default",color:r="solid",focusColor:o="brand",placeholder:a,valid:s,error:i,errorMessage:u,isPrice:l,prefix:d,wrapperClassName:m,containerClassName:h,className:g,type:b="text",value:w,...v},E)=>{const S=f.useRef(null),j=f.useRef(!1),[$,T]=f.useState(!1),[y,p]=f.useState(!1),M=b==="password",R=M&&$?"text":l?"number":b,C=w!==""&&w!==null&&w!==void 0;return f.useEffect(()=>{if(!j.current){j.current=!0;return}S.current&&wn(S.current)},[$,S]),c.jsxs("div",{className:k("relative",m),children:[e&&n==="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",Da[r],{"pt-[22px] pb-1.5":n==="floating",[Pa[o]]:!i&&y,"bg-red-4 text-red-9":!!i,"ring-1 ring-red-9":!!i&&y},h),children:[e&&n==="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":y||C||a,"text-red-9":!!i}),children:e}),l&&c.jsx(F.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:x=>{E&&(typeof E=="function"?E(x):E.current=x),S.current=x},type:R,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":n==="default","mt-1.5":n==="floating","pr-10":s,"text-red-9 placeholder:text-red-9":!!i},g),value:w,placeholder:a,onFocus:()=>p(!0),onBlur:()=>p(!1),...v})]}),s?c.jsx(F.CheckIcon,{size:20,className:`absolute top-1/2 -translate-y-1/2 text-green-500 ${M?"right-10":"right-3"}`}):null,M&&c.jsx("button",{type:"button",className:k(n==="floating"?"absolute right-3 top-1/2 -translate-y-1/2":"absolute right-3 top-10"),onClick:()=>{T(!$)},children:$?c.jsx(F.EyeOffIcon,{size:20,className:k(i?"text-red-9":"text-base-11")}):c.jsx(F.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]})});zt.displayName="Input";const La=({name:e,customRead:t,customSet:n,withNullSet:r=!0,...o})=>{const{control:a}=J.useFormContext(),s=f.useCallback(u=>t?t(u):u===null?Pt(u):u,[t]),i=f.useCallback(u=>n?r&&u===null?ot(u):n(u):u===null?ot(u):u,[n]);return a?c.jsx(J.Controller,{name:e,control:a,render:({field:u,fieldState:l})=>c.jsx(zt,{value:s(u.value),onChange:d=>u.onChange(i(d.target.value)),error:!!l.error,errorMessage:l.error?.message,ref:u.ref,...o})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},Zn=f.createContext(null),Oa=({children:e,value:t})=>c.jsx(Zn.Provider,{value:t,children:e}),Fa=()=>{const e=f.useContext(Zn);if(!e)throw new Error("useAliveScope must be wrapped within AliveScopeProvider");return e},Ra=({children:e})=>{const[t,n]=f.useState({}),r=f.useRef({}),o=f.useRef({}),a=(i,u,l)=>{if(!t[i]){const d=document.createElement("div");return i&&(d.id=i),l&&(d.className=l),n(m=>({...m,[i]:{children:u,element:d}})),r.current[i]=[],o.current[i]=[],r.current&&r.current[i]&&r.current[i].forEach(m=>m(i)),d}return r.current&&r.current[i]&&r.current[i].forEach(d=>d(i)),t[i].element},s=i=>{n(u=>{const l={...u};return delete l[i],l}),o.current&&o.current[i]&&o.current[i].forEach(u=>u(i))};return c.jsxs(Oa,{value:{getPortalElement:a,dropPortalElement:s},children:[e,Object.entries(t).map(([i,{children:u,element:l}])=>c.jsx(Wa,{id:i,onMountCallbacks:r,onDropCallbacks:o,children:u,element:l},i))]})},er=f.createContext(null),Aa=({children:e,value:t})=>c.jsx(er.Provider,{value:t,children:e}),Wa=f.memo(({id:e,onMountCallbacks:t,onDropCallbacks:n,children:r,element:o})=>{const a=(i,u={runOnFirstMount:!1})=>{f.useEffect(()=>{const l=()=>{if(document.getElementById(e))i(e);else{const m=new MutationObserver((h,g)=>{document.getElementById(e)&&(i(e),g.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)}},[])},s=i=>{f.useEffect(()=>(n.current[e].push(i),()=>{n.current[e]=n.current[e].filter(u=>u!==i)}),[])};return c.jsx(Aa,{value:{keepAliveId:e,onKeepAliveMount:a,onKeepAliveDrop:s},children:gn.createPortal(r,o,e)})}),Ia=()=>{const e=f.useContext(er);if(!e)throw new Error("useKeepAlive must be used within KeepAliveProvider");return e},_a=({aliveKey:e,children:t,enabled:n=!0,...r})=>{const o=f.useRef(null),{getPortalElement:a}=Fa();return f.useEffect(()=>{const s=a(e,t,r.className);return n&&o.current&&o.current.replaceWith(s),()=>{}},[e,t,n,r]),c.jsx("div",{...r,ref:o,children:t})},Ht=f.forwardRef(({src:e,alt:t,eager:n=!1,rootMargin:r="50px",threshold:o=.01,noFade:a=!1,className:s="",...i},u)=>{const[l,d]=f.useState(n),[m,h]=f.useState(!1),g=f.useRef(null);return f.useEffect(()=>{if(n)return;const b=new IntersectionObserver(v=>{v.forEach(E=>{E.isIntersecting&&(d(!0),b.disconnect())})},{rootMargin:r,threshold:o}),w=g.current;return w&&b.observe(w),()=>{b.disconnect()}},[n,r,o]),c.jsx("img",{ref:b=>{g.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",s),draggable:!1,...i})});Ht.displayName="LazyImage";const tr=f.forwardRef(({src:e,alt:t,eager:n=!1,wrapperClassName:r="",imageClassName:o="",rootMargin:a="50px",threshold:s=.01,noFade:i=!1,children:u,...l},d)=>c.jsxs("div",{className:k("overflow-hidden",r),children:[c.jsx(Ht,{ref:d,src:e,alt:t,eager:n,rootMargin:a,threshold:s,noFade:i,className:o,...l}),u]}));tr.displayName="LazyImageWrapped";const Ya=({lightSolid:e=!0,className:t,children:n,...r})=>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),...r,children:n}),za=({onClick:e,lightSolid:t=!0,className:n,children:r})=>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",n),children:r}),nr=({label:e,labelPosition:t="default",options:n,selectedValues:r,onChange:o,idExtractor:a,labelExtractor:s,customSetter:i,valid:u,error:l,placeholder:d="Select options...",maxSelections:m,searchable:h=!1,disabled:g=!1,className:b})=>{const[w,v]=f.useState(""),[E,S]=f.useState(!1),[j,$]=f.useState(-1),T=f.useRef(null),y=f.useRef(null),p=f.useRef([]),{triggerRef:M,triggerProps:R,popoverRef:C,getPopoverPosition:x,open:P,toggle:D,close:A}=Ve({align:"start",side:"top",avoidCollisions:!1,onOpen:()=>{S(!0),h&&T.current&&setTimeout(()=>T.current?.focus(),10)},onClose:()=>{S(!1),v(""),$(-1)}}),_=f.useRef(`multiselect-${Math.random().toString(36).substr(2,9)}`).current,X=f.useRef(`label-${Math.random().toString(36).substr(2,9)}`).current,W=f.useRef(`error-${Math.random().toString(36).substr(2,9)}`).current,N=f.useRef(`listbox-${Math.random().toString(36).substr(2,9)}`).current,V=i?r.map(L=>n.find(G=>a(G)===L||a(G)===a(L))).filter(Boolean):r,se=V.length>0,U=h?n.filter(L=>s(L).toLowerCase().includes(w.toLowerCase())):n;f.useEffect(()=>{p.current=p.current.slice(0,U.length)},[U.length]);const ne=L=>i?r.some(I=>I===a(L)||a(I)===a(L)):r.some(I=>a(I)===a(L)),Re=L=>{if(!g)if(ne(L)){let I;if(i){const G=a(L);I=r.filter(ye=>ye!==G&&a(ye)!==G)}else I=r.filter(G=>a(G)!==a(L));o(I),Qe(`Removed ${s(L)}`)}else{if(m&&V.length>=m){Qe(`Maximum of ${m} selections allowed`);return}let I;i?I=[...r,i(L)]:I=[...r,L],o(I),Qe(`Added ${s(L)}`)}},Ue=L=>{if(g)return;let I;if(i){const G=a(L);I=r.filter(ye=>ye!==G&&a(ye)!==G)}else I=r.filter(G=>a(G)!==a(L));o(I),Qe(`Removed ${s(L)}`)},Ge=L=>{if(!g)switch(L.key){case"Enter":L.preventDefault(),P?j>=0&&Re(U[j]):D();break;case"Escape":L.preventDefault(),A();break;case"ArrowDown":if(L.preventDefault(),!P)D();else{const I=j>=U.length-1?0:j+1;$(I),p.current[I]?.scrollIntoView({block:"nearest"})}break;case"ArrowUp":if(L.preventDefault(),P){const I=j<=0?U.length-1:j-1;$(I),p.current[I]?.scrollIntoView({block:"nearest"})}break;case"Backspace":if(h&&w===""&&V.length>0){const I=V[V.length-1];Ue(I)}break}},br=L=>{v(L.target.value),$(-1)},pr=()=>{g||(h&&T.current&&T.current.focus(),D())},Qe=L=>{console.log(`Accessibility announcement: ${L}`)};qe(C,L=>{!M.current||!P||!L.target||M.current.contains(L.target)||A()});const xt=x();return c.jsxs("div",{className:k("relative",b),children:[c.jsxs("div",{className:"relative",ref:y,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:M,...R,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":P||E,"text-red-9":l,"ring-2 ring-red-6":l&&(P||E),"opacity-60 cursor-not-allowed":g}),onClick:pr,role:"combobox","aria-expanded":P,"aria-haspopup":"listbox","aria-owns":N,"aria-labelledby":X,"aria-describedby":l?W:void 0,onKeyDown:Ge,tabIndex:g?-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||se,"text-red-9":!!l}),children:[e," ",m&&`(${r.length}/${m})`]}),c.jsxs("div",{className:k("flex flex-wrap gap-2 items-center",{"mt-2.5":t==="floating"}),children:[V.map(L=>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:s(L)}),!g&&c.jsx("button",{type:"button",className:"hover:bg-brand/20 rounded-full p-0.5 transition-colors",onClick:I=>{I.stopPropagation(),Ue(L)},"aria-label":`Remove ${s(L)}`,children:c.jsx(F.XIcon,{size:12})})]},a(L))),h&&c.jsx("input",{ref:T,id:_,type:"text",className:"flex-grow min-w-[60px] bg-transparent outline-none placeholder:text-sm",value:w,onChange:br,onKeyDown:Ge,placeholder:se?"":d,disabled:g,"aria-autocomplete":"list","aria-controls":N,autoComplete:"off"}),!h&&!se&&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(F.CheckIcon,{size:16,className:"text-green-600"}),c.jsx(F.ChevronDownIcon,{size:16,className:k("transition-transform text-base-11",{"rotate-180":P})})]})]})]}),c.jsx(O.AnimatePresence,{children:P&&c.jsx(we,{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:C,style:{position:"fixed",left:xt.x,top:xt.top,bottom:xt.bottom,width:y.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:N,"aria-labelledby":X,children:U.length===0?c.jsx("div",{className:"px-3 py-2 text-sm text-secondarytext",children:w?"No results found":"No options available"}):U.map((L,I)=>{const G=ne(L),ye=I===j;return c.jsxs("div",{ref:gr=>{p.current[I]=gr},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":ye,"bg-brandfadedbg text-brand":G}),onClick:()=>Re(L),role:"option","aria-selected":G,onMouseEnter:()=>$(I),children:[c.jsx("span",{children:s(L)}),G&&c.jsx(F.CheckIcon,{size:16})]},a(L))})})})}),l&&c.jsx("p",{id:W,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(s).join(", ")}`:"No selections"})]})},Ha=({name:e,...t})=>{const{control:n}=J.useFormContext();return n?c.jsx(J.Controller,{name:e,control:n,render:({field:r,fieldState:o})=>c.jsx(nr,{selectedValues:r.value||[],onChange:a=>r.onChange(a),error:o.error?.message,...t})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},Ba=({id:e,tabPage:t,absolute:n=!0,navBar:r,children:o,onRefresh:a,style:s,className:i,contentClassName:u,bounceBackDuration:l=300,showScrollbar:d=!0,onScroll:m})=>{const h=f.useRef(null),g=f.useRef(null),b=f.useRef(null),w=f.useRef(null),v=f.useRef(null),[E,S]=f.useState(!1),j=f.useRef(null),$=f.useRef({startY:0,currentY:0,maxScroll:0,lastTimestamp:0,frameCallback:null,isScrolling:!1,pullDistance:0,refreshThreshold:50,isPullingToRefresh:!1}),T=Xe(),y=f.useCallback(Fe(()=>{h.current&&g.current&&($.current.maxScroll=Math.max(0,g.current.offsetHeight-h.current.offsetHeight))}),[]),p=f.useCallback(W=>{const{maxScroll:N}=$.current;return W>0?Math.pow(W,.8):W<-N?-N-Math.pow(-(W+N),.8):W},[]),M=f.useCallback(()=>{if(!d||!h.current||!w.current)return;const{currentY:W,maxScroll:N}=$.current,H=h.current.offsetHeight,V=Math.max(30,H/(H+N)*H),se=H-V;let U=-W/N*se,ne=1;W>0?(U=0,ne=1-W/H,w.current.style.transformOrigin="top"):W<-N?(U=se,ne=1-Math.abs(W+N)/H,w.current.style.transformOrigin="bottom"):w.current.style.transformOrigin="top",w.current.style.transform=`translate3d(0, ${U}px, 0) scaleY(${ne})`,w.current.style.height=`${V}px`},[d]),R=f.useCallback(W=>{if($.current.currentY=W,g.current&&(g.current.style.transform=`translate3d(0, ${W}px, 0)`),b.current){const N=Math.max(W-$.current.refreshThreshold,-$.current.refreshThreshold);b.current.style.transform=`translate3d(0, ${N}px, 0)`}m&&m(W),M()},[M]),C=f.useCallback(W=>{const N=$.current;N.frameCallback&&(O.cancelFrame(N.frameCallback),N.frameCallback=null);const H=performance.now(),V=N.currentY,se=W-V,U=()=>{const ne=performance.now()-H,Re=Math.min(ne/l,1),Ue=1-Math.pow(1-Re,3),Ge=V+se*Ue;R(Ge),Re>=1&&(N.frameCallback&&(O.cancelFrame(N.frameCallback),N.frameCallback=null),R(W),W===0&&b.current&&(b.current.textContent="Pull to refresh"))};N.frameCallback=O.frame.render(U,!0)},[R,l]),x=f.useCallback(W=>{const N=$.current;N.frameCallback&&(O.cancelFrame(N.frameCallback),N.frameCallback=null);let H=W,V=Date.now();const se=()=>{const U=Date.now(),ne=U-V;if(V=U,H*=Math.pow(.95,ne/16),N.currentY+=H*ne,N.currentY>0||N.currentY<-N.maxScroll){N.frameCallback&&(O.cancelFrame(N.frameCallback),N.frameCallback=null),C(N.currentY>0?0:-N.maxScroll);return}R(N.currentY),Math.abs(H)<.01&&N.frameCallback&&(O.cancelFrame(N.frameCallback),N.frameCallback=null)};N.frameCallback=O.frame.render(se,!0)},[R,C]),P=f.useCallback(()=>{if(!d||!w.current)return;v.current!==null&&clearTimeout(v.current),requestAnimationFrame(()=>{w.current&&(w.current.style.opacity="1")});const W=window.requestIdleCallback||(N=>setTimeout(N,1e3));v.current=window.setTimeout(()=>{W(()=>{w.current&&(w.current.style.opacity="0"),v.current=null})},1e3)},[d]),D=f.useCallback(W=>{if(j.current!==null&&Date.now()-j.current<50)return;j.current=Date.now();const N=$.current;N.isScrolling=!0,N.startY=N.currentY,N.lastTimestamp=Date.now(),N.isPullingToRefresh=N.currentY===0,N.pullDistance=0,N.frameCallback&&(O.cancelFrame(N.frameCallback),N.frameCallback=null),P()},[P]),A=f.useCallback(W=>{const N=$.current;if(!N.isScrolling)return;const H=p(N.startY+W.deltaY);N.isPullingToRefresh&&H<N.startY&&(N.isPullingToRefresh=!1),R(H),a&&N.isPullingToRefresh&&!E&&H>0&&(N.pullDistance=H,b.current&&(b.current.textContent=N.pullDistance>N.refreshThreshold?"Release to refresh":"Pull to refresh")),P()},[a,R,E,P,p]),_=f.useCallback(W=>{const N=$.current;N.isScrolling&&(N.isScrolling=!1,a&&N.isPullingToRefresh&&!E&&N.pullDistance>N.refreshThreshold?X():N.currentY>0||N.currentY<-N.maxScroll?C(N.currentY>0?0:-N.maxScroll):x(W.velocityY),N.isPullingToRefresh=!1)},[a,x,C,E]),X=f.useCallback(()=>{S(!0),C($.current.refreshThreshold),b.current&&(b.current.textContent="Refreshing..."),a&&a().then(()=>{S(!1),C(0)})},[a,C]);return f.useEffect(()=>{if(!h.current)return;const W=xn.createGesture(h.current,{name:"page-scroller-gesture",priority:10,passive:!0,direction:"y",onStart:D,onMove:A,onEnd:_});return W.init(),()=>W.destroy()},[D,A,_]),f.useEffect(()=>{if(h.current)return y(),M(),window.addEventListener("resize",y),()=>{window.removeEventListener("resize",y),v.current!==null&&clearTimeout(v.current)}},[y,M]),c.jsxs(O.motion.div,{id:e,ref:h,initial:{x:t||T?0:window.innerWidth,y:T?20:void 0,opacity:T&&!t?0:1},animate:{x:T||t?void 0:0,y:T?0:void 0,opacity:1,transition:{ease:[.32,.72,0,1],duration:T?.34:.44,delay:.2}},exit:{x:T||t?void 0:window.innerWidth+80,y:T?20:0,opacity:T?0:1,transition:{duration:T?.34:.6,ease:[.32,.72,0,1]}},style:{overflow:"hidden",position:n?"absolute":"relative",...s},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:r?48:0,left:0,width:"100%",textAlign:"center",height:"50px",lineHeight:"50px",transform:"translateY(-50px)"},children:"Pull to refresh"}),c.jsx("div",{ref:g,style:{position:"absolute",top:0,left:0,width:"100%",willChange:"transform"},className:u,children:o}),r,d&&c.jsx("div",{ref:w,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 qa({id:e,showScrollbar:t=!0,onRefresh:n,bounceBackDuration:r=300,isolate:o=!1,onScroll:a}){const s=f.useRef(null),i=f.useRef(null),u=f.useRef(null),l=f.useRef(null),d=f.useRef(null),[m,h]=f.useState(!1),g=f.useRef(null),b=f.useRef({startY:0,currentY:0,maxScroll:0,lastTimestamp:0,frameCallback:null,isScrolling:!1,pullDistance:0,refreshThreshold:50,isPullingToRefresh:!1}),w=f.useCallback(Fe(()=>{s.current&&i.current&&(b.current.maxScroll=Math.max(0,i.current.offsetHeight-s.current.offsetHeight))}),[]),v=f.useCallback(C=>{const{maxScroll:x}=b.current;return C>0?Math.pow(C,.8):C<-x?-x-Math.pow(-(C+x),.8):C},[]),E=f.useCallback(()=>{if(!t||!s.current||!l.current)return;const{currentY:C,maxScroll:x}=b.current,P=s.current.offsetHeight,D=Math.max(30,P/(P+x)*P),A=P-D;let _=-C/x*A,X=1;C>0?(_=0,X=1-C/P,l.current.style.transformOrigin="top"):C<-x?(_=A,X=1-Math.abs(C+x)/P,l.current.style.transformOrigin="bottom"):l.current.style.transformOrigin="top",l.current.style.transform=`translate3d(0, ${_}px, 0) scaleY(${X})`,l.current.style.height=`${D}px`},[t]),S=f.useCallback(C=>{if(b.current.currentY=C,i.current&&(i.current.style.transform=`translate3d(0, ${C}px, 0)`),u.current){const x=Math.max(C-b.current.refreshThreshold,-b.current.refreshThreshold);u.current.style.transform=`translate3d(0, ${x}px, 0)`}a&&a(C),E()},[E]),j=f.useCallback(C=>{const x=b.current;x.frameCallback&&(O.cancelFrame(x.frameCallback),x.frameCallback=null);const P=performance.now(),D=x.currentY,A=C-D,_=()=>{const X=performance.now()-P,W=Math.min(X/r,1),N=1-Math.pow(1-W,3),H=D+A*N;S(H),W>=1&&(x.frameCallback&&(O.cancelFrame(x.frameCallback),x.frameCallback=null),S(C))};x.frameCallback=O.frame.render(_,!0)},[S,r]),$=f.useCallback(C=>{const x=b.current;x.frameCallback&&(O.cancelFrame(x.frameCallback),x.frameCallback=null);let P=C,D=Date.now();const A=()=>{const _=Date.now(),X=_-D;if(D=_,P*=Math.pow(.95,X/16),x.currentY+=P*X,x.currentY>0||x.currentY<-x.maxScroll){x.frameCallback&&(O.cancelFrame(x.frameCallback),x.frameCallback=null),j(x.currentY>0?0:-x.maxScroll);return}S(x.currentY),Math.abs(P)<.01&&x.frameCallback&&(O.cancelFrame(x.frameCallback),x.frameCallback=null)};x.frameCallback=O.frame.render(A,!0)},[S,j]),T=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||(x=>setTimeout(x,1e3));d.current=window.setTimeout(()=>{C(()=>{l.current&&(l.current.style.opacity="0"),d.current=null})},1e3)},[t]),y=f.useCallback(C=>{if(g.current!==null&&Date.now()-g.current<50)return;g.current=Date.now();const x=b.current;x.isScrolling=!0,x.startY=x.currentY,x.lastTimestamp=Date.now(),x.isPullingToRefresh=x.currentY===0,x.pullDistance=0,x.frameCallback&&(O.cancelFrame(x.frameCallback),x.frameCallback=null),T()},[T]),p=f.useCallback(C=>{const x=b.current;if(!x.isScrolling)return;const P=v(x.startY+C.deltaY);x.isPullingToRefresh&&P<x.startY&&(x.isPullingToRefresh=!1),S(P),n&&x.isPullingToRefresh&&!m&&P>0&&(x.pullDistance=P),T()},[n,S,m,T,v]),M=f.useCallback(()=>{h(!0),j(b.current.refreshThreshold),n&&n().then(()=>{h(!1),j(0)})},[n,j]),R=f.useCallback(C=>{const x=b.current;x.isScrolling&&(x.isScrolling=!1,n&&x.isPullingToRefresh&&!m&&x.pullDistance>x.refreshThreshold?M():x.currentY>0||x.currentY<-x.maxScroll?j(x.currentY>0?0:-x.maxScroll):$(C.velocityY),x.isPullingToRefresh=!1)},[n,$,j,m,M]);return f.useEffect(()=>{if(!s.current)return;const C=xn.createGesture(s.current,{name:"page-scroller-gesture",priority:10,passive:!0,direction:"y",onStart:y,onMove:p,onEnd:R});return C.init(),()=>C.destroy()},[y,p,R]),f.useEffect(()=>{if(s.current)return w(),E(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),d.current!==null&&clearTimeout(d.current)}},[w,E]),{container:{props:{id:e,ref:s,key:`scroller${e||"default"}`},classNames:`will-change-transform overflow-hidden ${o?"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:w,rubberBandEffect:v,updateScrollbarPosition:E,setPosition:S}}const Xa={2:"text-2xl",4:"text-4xl",5:"text-5xl",6:"text-6xl"},Va=({title:e,description:t,size:n="6",descriptionClassName:r,className:o})=>c.jsxs("div",{className:k("text-center",o),children:[c.jsx("p",{className:`${Xa[n]} font-medium`,children:e}),t?c.jsx("p",{className:k("mt-6 text-base-11",r),children:t}):null]}),Ka=f.forwardRef(({placeholder:e="Buscar",value:t,exposedRef:n,autoFocus:r,onClear:o,onChange:a,className:s,onMount:i,error:u},l)=>{const d=f.useRef(null),m=Xe(),h=Ot(d,l),g=f.useCallback(()=>n&&n(d),[]);return f.useEffect(()=>{const b=async()=>{i&&await i(d,m)};g(),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},s),children:[c.jsx("input",{ref:h,placeholder:e,value:t,onChange:a,autoComplete:"off",autoCorrect:"off",type:"search",autoFocus:r?r(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(F.Search,{size:20,className:k("absolute left-3 text-base-11 pointer-events-none",{"text-red-9":u})}),o&&t&&t.length>0?c.jsx("button",{onClick:()=>{o(),d.current?.focus()},className:k("absolute right-2.5 rounded-full",u?"text-red-9":"text-base-11"),children:c.jsx(F.X,{size:20})}):null]})}),mn=({el:e,direction:t,amount:n=200,multiplier:r=.4,speed:o="normal"})=>{if(!e)return;const a=t==="up"||t==="down",s=a?e.scrollTop:e.scrollLeft,i=a?e.scrollHeight-e.clientHeight:e.scrollWidth-e.clientWidth;let u;n==="max"?u=i:u=n??(a?e.clientHeight:e.clientWidth)*r;let l;if(t==="right"||t==="down"?l=Math.min(s+u,i):l=Math.max(s-u,0),l===s)return;const d={fast:.15,normal:.4,slow:.8};O.animate(0,1,{duration:d[o],ease:"easeOut",onUpdate:m=>{if(!e)return;const h=s+(l-s)*m;a?e.scrollTop=h:e.scrollLeft=h}})},Ua={default:[.32,.72,0,1]},hn={initial:{opacity:0},animate:{opacity:1,transition:{ease:Ua.default,duration:.3}},exit:{opacity:0,transition:{ease:[.32,.72,0,1],duration:.3}}},rr=new Set,Q=new WeakMap,Pe=new WeakMap,$e=new WeakMap,Tt=new WeakMap,Ga=new WeakMap,Le=new WeakMap,ut=new WeakMap,We=new WeakSet;let ve,Bt=0,qt=0;const me="__aa_tgt",He="__aa_del",dt="__aa_new",Qa=e=>{const t=ri(e);t&&t.forEach(n=>oi(n))},Ja=e=>{e.forEach(t=>{t.target===ve&&ei(),Q.has(t.target)&&Se(t.target)})};function Za(e){Tt.get(e)?.disconnect();let n=Q.get(e),r=0;const o=5;n||(n=Oe(e),Q.set(e,n));const{offsetWidth:a,offsetHeight:s}=ve,u=[n.top-o,a-(n.left+o+n.width),s-(n.top+o+n.height),n.left-o].map(d=>`${-1*Math.floor(d)}px`).join(" "),l=new IntersectionObserver(()=>{++r>1&&Se(e)},{root:ve,threshold:1,rootMargin:u});l.observe(e),Tt.set(e,l)}function Se(e){clearTimeout(ut.get(e));const t=gt(e),n=Be(t)?500:t.duration;ut.set(e,setTimeout(async()=>{const r=$e.get(e);try{await r?.finished,Q.set(e,Oe(e)),Za(e)}catch{}},n))}function ei(){clearTimeout(ut.get(ve)),ut.set(ve,setTimeout(()=>{rr.forEach(e=>ir(e,t=>or(()=>Se(t))))},100))}function ti(e){setTimeout(()=>{Ga.set(e,setInterval(()=>or(Se.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function or(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let Dt,ft;const ni=typeof window<"u"&&"ResizeObserver"in window;ni&&(ve=document.documentElement,Dt=new MutationObserver(Qa),ft=new ResizeObserver(Ja),window.addEventListener("scroll",()=>{qt=window.scrollY,Bt=window.scrollX}),ft.observe(ve));function ri(e){return e.reduce((r,o)=>[...r,...Array.from(o.addedNodes),...Array.from(o.removedNodes)],[]).every(r=>r.nodeName==="#comment")?!1:e.reduce((r,o)=>{if(r===!1)return!1;if(o.target instanceof Element){if(Nt(o.target),!r.has(o.target)){r.add(o.target);for(let a=0;a<o.target.children.length;a++){const s=o.target.children.item(a);if(s){if(He in s)return!1;Nt(o.target,s),r.add(s)}}}if(o.removedNodes.length)for(let a=0;a<o.removedNodes.length;a++){const s=o.removedNodes[a];if(He in s)return!1;s instanceof Element&&(r.add(s),Nt(o.target,s),Pe.set(s,[o.previousSibling,o.nextSibling]))}}return r},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 oi(e){const t=e.isConnected,n=Q.has(e);t&&Pe.has(e)&&Pe.delete(e),$e.has(e)&&$e.get(e)?.cancel(),dt in e?bn(e):n&&t?ai(e):n&&!t?ii(e):bn(e)}function ae(e){return Number(e.replace(/[^0-9.\-]/g,""))}function si(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:n,y:r}=si(e);return{top:t.top+r,left:t.left+n,width:t.width,height:t.height}}function sr(e,t,n){let r=t.width,o=t.height,a=n.width,s=n.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);r-=d,a-=d,o-=l,s-=l}return[r,a,o,s].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 ar(e){if(me in e)return e[me]}function Xt(e){const t=ar(e);return t?We.has(t):!1}function ir(e,...t){t.forEach(n=>n(e,Le.has(e)));for(let n=0;n<e.children.length;n++){const r=e.children.item(n);r&&t.forEach(o=>o(r,Le.has(r)))}}function Vt(e){return Array.isArray(e)?e:[e]}function Be(e){return typeof e=="function"}function ai(e){const t=Q.get(e),n=Oe(e);if(!Xt(e))return Q.set(e,n);let r;if(!t)return;const o=gt(e);if(typeof o!="function"){const a=t.left-n.left,s=t.top-n.top,[i,u,l,d]=sr(e,t,n),m={transform:`translate(${a}px, ${s}px)`},h={transform:"translate(0, 0)"};o.fromBorderRadius!==void 0&&o.toBorderRadius!==void 0&&(m.borderRadius=`${o.fromBorderRadius}px`,h.borderRadius=`${o.toBorderRadius}px`),i!==u&&(m.width=`${i}px`,h.width=`${u}px`),l!==d&&(m.height=`${l}px`,h.height=`${d}px`),r=e.animate([m,h],{duration:o.duration,easing:o.easing})}else{const[a]=Vt(o(e,"remain",t,n));r=new Animation(a),r.play()}$e.set(e,r),Q.set(e,n),r.addEventListener("finish",Se.bind(null,e))}function bn(e){dt in e&&delete e[dt];const t=Oe(e);Q.set(e,t);const n=gt(e);if(!Xt(e))return;let r;if(typeof n!="function")r=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"});else{const[o]=Vt(n(e,"add",t));r=new Animation(o),r.play()}$e.set(e,r),r.addEventListener("finish",Se.bind(null,e))}function pn(e,t){e.remove(),Q.delete(e),Pe.delete(e),$e.delete(e),Tt.get(e)?.disconnect(),setTimeout(()=>{if(He in e&&delete e[He],Object.defineProperty(e,dt,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const n in t)e.style[n]=""},0)}function ii(e){if(!Pe.has(e)||!Q.has(e))return;const[t,n]=Pe.get(e);Object.defineProperty(e,He,{value:!0,configurable:!0});const r=window.scrollX,o=window.scrollY;if(n&&n.parentNode&&n.parentNode instanceof Element?n.parentNode.insertBefore(e,n):t&&t.parentNode?t.parentNode.appendChild(e):ar(e)?.appendChild(e),!Xt(e))return pn(e);const[a,s,i,u]=li(e),l=gt(e),d=Q.get(e);(r!==Bt||o!==qt)&&ci(e,r,o,l);let m,h={position:"absolute",top:`${a}px`,left:`${s}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[g,b]=Vt(l(e,"remove",d));b?.styleReset!==!1&&(h=b?.styleReset||h,Object.assign(e.style,h)),m=new Animation(g),m.play()}$e.set(e,m),m.addEventListener("finish",pn.bind(null,e,h))}function ci(e,t,n,r){const o=Bt-t,a=qt-n,s=document.documentElement.style.scrollBehavior;if(getComputedStyle(ve).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+o,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(r)){const g=l-u.clientHeight,b=d-u.clientWidth;m+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-b,top:window.scrollY-g}),l=u.clientHeight,d=u.clientWidth,h()):document.documentElement.style.scrollBehavior=s}})}h()}function li(e){const t=Q.get(e),[n,,r]=sr(e,t,Oe(e));let o=e.parentElement;for(;o&&(getComputedStyle(o).position==="static"||o instanceof HTMLBodyElement);)o=o.parentElement;o||(o=document.body);const a=getComputedStyle(o),s=Q.get(o)||Oe(o),i=Math.round(t.top-s.top)-ae(a.borderTopWidth),u=Math.round(t.left-s.left)-ae(a.borderLeftWidth);return[i,u,n,r]}function cr(e,t={}){return Dt&&ft&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Be(t)&&!t.disrespectUserMotionPreference||(We.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),ir(e,Se,ti,o=>ft?.observe(o)),Be(t)?Le.set(e,t):Le.set(e,{duration:250,easing:"ease-in-out",...t}),Dt.observe(e,{childList:!0}),rr.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"}}},ui=({options:e,selected:t,onChange:n,keyExtractor:r,labelExtractor:o,itemColor:a,itemClassName:s,color:i="contrast",unselectedColor:u="none",width:l="fit",border:d="solid",rounded:m=6,trackScroll:h=!0,className:g})=>{const[b,w]=f.useState({left:!1,right:!1}),{ref:v}=kn({onOverflow:E=>{w({left:E.canScrollLeft,right:E.canScrollRight})},trackScroll:h});return c.jsxs("div",{className:k("relative overflow-hidden",pe.widths[l].container,pe.rounded[m],g),children:[c.jsx("div",{ref:v,className:k("flex items-center border overflow-x-scroll scrollbar-hide",pe.rounded[m],pe.border[d]),children:e.map(E=>{const S=r(t)===r(E);return c.jsx("button",{onClick:()=>n?.(E),className:k("border-r px-3 py-1 last:border-none text-nowrap shrink-0",pe.widths[l].item,!S&&"lg:hover:bg-overlay-3",a?a(S):S?pe.colors[i]:pe.unselectedColors[u],pe.border[d],s),children:o(E)},r(E))})}),c.jsxs(O.AnimatePresence,{children:[b.left?c.jsx(O.motion.button,{variants:hn,initial:"initial",animate:"animate",exit:"exit",onClick:()=>{v.current&&mn({el:v.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(F.ChevronLeft,{className:"text-base-13"})},"leftarrow"):null,b.right?c.jsx(O.motion.button,{variants:hn,initial:"initial",animate:"animate",exit:"exit",onClick:()=>{v.current&&mn({el:v.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(F.ChevronRight,{className:"text-base-13"})},"rightarrow"):null]})]})};function lr({label:e,labelPosition:t="default",options:n,selected:r,onChange:o,idExtractor:a,labelExtractor:s,descriptionExtractor:i,classNameExtractor:u,customGetter:l,customSetter:d,error:m,placeholder:h="Selecciona una opción",searchable:g,className:b}){const[w,v]=f.useState(-1),E=f.useRef(null),{triggerRef:S,triggerProps:j,popoverRef:$,getPopoverPosition:T,open:y,toggle:p,close:M}=Ve({align:"start",side:"bottom",avoidCollisions:!0,onOpen:()=>{g&&E.current&&setTimeout(()=>E.current?.focus(),10)},onClose:()=>{v(-1)}});qe($,x=>{!S.current||!y||!x.target||S.current.contains(x.target)||M()});const R=T(),C=l&&r?l(r,n):r;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:S,color:"solidhybrid",className:"w-full justify-between",onClick:p,...j,children:[C?s(C):h,c.jsx(F.ChevronDown,{size:18,className:k("transition",y&&"rotate-180")})]}),c.jsx(O.AnimatePresence,{children:y&&c.jsx(we,{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:$,style:{position:"fixed",left:R.x,top:R.top,bottom:R.bottom,width:S.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:n.map((x,P)=>{const D=!!(C&&a(x)===a(C)),A=P===w,_=i?.(x);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",A&&"bg-base-3 dark-theme:bg-base-4",D&&"bg-brandfadedbg text-brand",u&&u(D)),onClick:()=>{o(d?d(x):x),M()},role:"option",onMouseEnter:()=>v(P),children:[c.jsxs("div",{children:[c.jsxs("p",{children:[s(x)," "]}),_&&c.jsx("p",{className:"text-xs text-base-11 mt-0.5 line-clamp-2",children:_})]}),D&&c.jsx(F.CheckIcon,{size:16,className:"shrink-0"})]},a(x))})})})})]})}const di=({name:e,...t})=>{const{control:n}=J.useFormContext();return n?c.jsx(J.Controller,{name:e,control:n,render:({field:r,fieldState:o})=>c.jsx(lr,{selected:r.value??null,onChange:a=>r.onChange(a),error:o.error?.message,...t})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},fi=({text:e,length:t=120,size:n="sm",className:r,buttonClassName:o})=>{const[a,s]=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",n==="sm"&&"text-sm",r),children:u}),i?c.jsx("button",{onClick:()=>s(l=>!l),className:k("text-xs text-base-11",o),children:a?"Ver menos":"Ver más"}):null]})},Kt=({loading:e=!0,wrapperClassName:t,spinnerClassName:n})=>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},n),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"})})}),mi=({isEditable:e,isDeletable:t=!0,createUpdateLoading:n,deleteLoading:r,onDelete:o,onDeleteConfirm:a,addText:s="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:r?"loading":n?"disabled":"enabled",onClick:()=>{a?d?o?.():m(!0):o?.()},children:[c.jsx(F.X,{size:18}),a&&d?"Confirmar":u]}):null,c.jsxs(q,{color:"brand",className:k(e&&t?"":"col-span-2"),state:n?"loading":r?"disabled":"enabled",type:"submit",children:[n?c.jsx(Kt,{}):e?c.jsx(F.Check,{size:18}):c.jsx(F.Plus,{size:18}),e?i:s]})]})},ur=f.createContext(void 0),hi=({children:e,debug:t=!1})=>{const n=f.useRef([]),r=f.useCallback(d=>{n.current.push(d),t&&console.log("Modal",d,"added",n.current)},[t]),o=f.useCallback(d=>{n.current=n.current.filter(m=>m!==d),t&&console.log("Modal",d,"removed",n.current)},[t]),a=f.useCallback(()=>{const d=n.current[n.current.length-2];return t&&console.log("prev modal id",d),d},[t]),s=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(()=>n.current,[]),l={add:r,remove:o,getPrevId:a,animateParentModal:s,restoreParentModal:i,getModals:u};return c.jsx(ur.Provider,{value:l,children:e})},dr=()=>{const e=f.useContext(ur);if(e===void 0)throw new Error("useModals must be used within a ModalsProvider");return e},bi=({withPortal:e,children:t})=>e?c.jsx(we,{children:t}):c.jsx(c.Fragment,{children:t}),pi=({id:e,prevPath:t,withDelay:n,withPortal:r=!0,title:o,description:a,showHeader:s=!0,mode:i,onReplace:u,className:l,contentClassName:d,children:m})=>{const h=de.useInitialChangeEvent(),g=Xe(),b=f.useRef(null),w=dr(),v=f.useMemo(()=>i==="modal"||g,[i,g]);return f.useEffect(()=>{w.add(e);const E=w.getPrevId();if(!E||(b.current=document.getElementById(E),!b.current))return;E&&w.animateParentModal(b.current,v?"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(li,{withPortal:r,children:[c.jsx(O.motion.div,{initial:{opacity:0},animate:{opacity:1,transition:{ease:[.32,.72,0,1],duration:.3,delay:n?.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:N("bg-black/40 absolute w-full h-full left-0 top-0",r&&"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:n?.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:N("bg-base-1 absolute w-full lg:max-w-[600px] h-full rounded-6 overflow-hidden flex flex-col",!x&&"rounded-b-none",r&&"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:N("grow customscrollbar p-4 pb-6",d),children:m})]})]})};function lr({checked:e,onCheckedChange:t,disabled:n=!1,name:r,required:s,className:a=""}){const o=f.useId(),i=()=>{n||t(!e)};return c.jsxs("button",{id:o,type:"button",role:"switch","aria-checked":e,"aria-required":s,"data-state":e?"checked":"unchecked",disabled:n,onClick:i,className:N(`relative inline-flex h-[28px] w-[48px] items-center rounded-full
14
+ },[g]),f.useLayoutEffect(()=>()=>w.remove(e),[]),c.jsxs(bi,{withPortal:r,children:[c.jsx(O.motion.div,{initial:{opacity:0},animate:{opacity:1,transition:{ease:[.32,.72,0,1],duration:.3,delay:n?.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",r&&"z-500")}),c.jsxs(O.motion.div,{id:e,initial:{opacity:v?0:1,scale:v?.8:void 0,y:v?void 0:window.innerHeight},animate:{opacity:1,scale:1,y:v?void 0:0,transition:{ease:[.32,.72,0,1],duration:.3,delay:n?.2:void 0}},exit:{scale:v?.8:void 0,opacity:v?0:void 0,y:v?void 0:window.innerHeight,transition:{ease:[.32,.72,0,1],duration:.3}},style:{left:"50%",translateX:"-50%",bottom:v?"50%":0,translateY:v?"50%":0,height:v?"65%":"95%"},onAnimationStart:E=>{(E?.scale===.8||E?.y>50)&&b.current&&w.restoreParentModal(b.current)},className:k("bg-base-1 absolute w-full lg:max-w-[600px] h-full rounded-6 overflow-hidden flex flex-col",!v&&"rounded-b-none",r&&"z-500",l),children:[s&&c.jsxs("div",{className:"flex items-start justify-between p-4 border-b border-base-3",children:[c.jsxs("div",{children:[o&&c.jsx("p",{className:"font-medium text-lg",children:o}),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(F.X,{size:20})})]}),c.jsx("div",{id:`${e}-content`,className:k("grow customscrollbar p-4 pb-6",d),children:m})]})]})};function fr({checked:e,onCheckedChange:t,disabled:n=!1,name:r,required:o,className:a=""}){const s=f.useId(),i=()=>{n||t(!e)};return c.jsxs("button",{id:s,type:"button",role:"switch","aria-checked":e,"aria-required":o,"data-state":e?"checked":"unchecked",disabled:n,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
- focus-visible:ring-base-6`,e?"bg-brand":"bg-base-3",n?"opacity-50 cursor-not-allowed":"cursor-pointer",a),children:[c.jsx("span",{className:N(`inline-block h-6 w-6 transform rounded-full
17
+ focus-visible:ring-base-6`,e?"bg-brand":"bg-base-3",n?"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]")}),r&&c.jsx("input",{type:"checkbox",name:r,checked:e,required:s,disabled:n,onChange:()=>{},tabIndex:-1,"aria-hidden":"true",className:"sr-only"})]})}const ur=({label:e,variant:t="default",color:n="solid",tags:r,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=r.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,r.length)},[r.length]);const k=T=>{if(T.key==="Enter"&&d.trim()){T.preventDefault();const F=d.trim();if(u&&r.length>=u){v(`Maximum of ${u} tags allowed`);return}if(r.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([...r,F]),m(""),v(null),D(`Added tag ${F}`)}else if(T.key==="Backspace"&&!d&&r.length>0){const F=r[r.length-1];s(r.slice(0,-1)),D(`Removed tag ${F}`)}else T.key==="ArrowLeft"&&d===""&&r.length>0&&$.current[r.length-1]&&$.current[r.length-1]?.focus()},L=(T,F)=>{if(T.key==="Backspace"||T.key==="Delete"){T.preventDefault();const _=r[F],X=[...r];X.splice(F,1),s(X),setTimeout(()=>{x.current&&x.current.focus()},0),D(`Removed tag ${_}`)}else T.key==="ArrowRight"?(T.preventDefault(),F<r.length-1?$.current[F+1]?.focus():x.current?.focus()):T.key==="ArrowLeft"&&(T.preventDefault(),F>0&&$.current[F-1]?.focus())},W=(T,F)=>{s(r.filter(_=>_!==T)),setTimeout(()=>{F<r.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:N("text-base top-4 font-semibold left-3",{"text-sm top-2 left-2":h||C||i,"text-red-9":!!o}),children:[e," ",u&&`(${r.length}/${u})`]}):null,c.jsxs("div",{className:N("rounded-6 px-2 transition cursor-text pr-10",{"bg-base-3":n==="solid","border border-uielborder focus-visible:border-transparent":n==="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:N("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&&`(${r.length}/${u})`]}):null,c.jsxs("div",{className:N("flex flex-wrap gap-1 items-center",{"mt-2.5":t==="floating"}),children:[r.map((T,F)=>c.jsxs("div",{ref:_=>{$.current[F]=_},className:N("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:k,onFocus:()=>p(!0),onBlur:()=>p(!1),enterKeyHint:"enter",autoComplete:"off",placeholder:r.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:r.length>0?`Current tags: ${r.join(", ")}`:"No tags added yet"})]})},di=({name:e,...t})=>{const{control:n}=J.useFormContext();return n?c.jsx(J.Controller,{name:e,control:n,render:({field:r,fieldState:s})=>c.jsx(ur,{tags:r.value,onChange:a=>r.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:n,error:r,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:N("top-[18px] font-medium ml-0.5 text-xs",r&&"text-red-9"),children:e}):null,c.jsxs("div",{className:N(t==="default"?"p-0":"pt-5 pb-2",{"bg-red-4 text-red-9":!!r}),children:[t==="floating"&&c.jsx("label",{className:N("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||n,"text-red-9":!!r}),children:e}),c.jsx("textarea",{ref:l,className:N(!r&&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":!!r},a),value:o,placeholder:n,onFocus:()=>m(!0),onBlur:()=>m(!1),rows:i,...u})]})]})});Kt.displayName="TextArea";const mi=({name:e,customRead:t,customSet:n,...r})=>{const{control:s}=J.useFormContext(),a=f.useCallback(i=>t?t(i):i===null?Pt(i):i,[t]),o=f.useCallback(i=>n?n(i):i===null?nt(i):i,[n]);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,...r}),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,n]=f.useState(!1),r=f.useRef(null);return f.useEffect(()=>{r.current&&or(r.current)},[]),c.jsxs("div",{ref:r,className:N("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(lr,{className:"mt-0",checked:t,onCheckedChange:s=>n(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"}]),n=f.useRef(null);return f.useEffect(()=>{n.current&&or(n.current)},[]),c.jsxs("div",{ref:n,children:[e.map((r,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:r.from}),c.jsx("p",{className:"text-sm text-secondarytext mx-1",children:"a"}),c.jsx(q,{color:"solid",className:"w-24",children:r.to}),c.jsx(q,{className:"rounded-full",children:c.jsx(A.X,{className:"text-secondarytext",size:20})})]},`${r.from}${s}`)),c.jsxs(q,{onClick:()=>t(r=>[...r,{from:"19:00",to:"21:00"}]),className:"w-full mt-4",color:"contrast",children:[c.jsx(A.Plus,{className:"stroke-1"}),"Añadir hora"]})]})};function tt(e,t,n=!0){const r=f.useRef(void 0);f.useEffect(()=>(n||r.current&&r.current(),r.current=ie.listen(e,t),()=>r.current&&r.current()),[e,t,n])}const ie=new vr.EventEmitter;function dr(e=8){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n="";for(let r=0;r<e;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n}const xi=({colors:e})=>{const[t,n]=f.useState([]),r=f.useCallback(o=>{n(i=>[...i,{...o,id:o.id??dr()}])},[]),s=f.useCallback(o=>n(i=>i.filter(u=>u.id!==o)),[]),a=f.useCallback((o,i)=>{n(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=>{r(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(yi,{toast:o,remove:s,colors:e},o.id))})})})},wi={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"}},yi=({toast:e,remove:t,colors:n})=>{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 r=f.useMemo(()=>n?n[e.type]??null:null,[n]),s=f.useMemo(()=>wi[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:N("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:N("shrink-0",r??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 n=dr();return ie.emit("create-toast",{id:n,type:"loading",message:e,...t}),n},update:(e,t)=>{ie.emit("update-toast",{id:e,toast:t})},dismiss:e=>{ie.emit("remove-toast",{id:e})}};exports.AliveScope=Ma;exports.Avatar=Er;exports.AvatarsGroup=jr;exports.Button=q;exports.Calendar=_t;exports.Checkbox=zn;exports.ConfirmationDialog=la;exports.DatePickerDemo=oa;exports.DatePickerPopover=aa;exports.DateTimePicker=ca;exports.Divider=ua;exports.ElasticHeader=da;exports.FocusTrap=Nr;exports.Form=ka;exports.FormInput=$a;exports.FormMultiSelect=Aa;exports.FormSelect=oi;exports.FormSubmit=ii;exports.FormTags=di;exports.FormTextArea=mi;exports.FormWorkingHours=bi;exports.Icon=Un;exports.Input=Yt;exports.KeepAlive=Oa;exports.LazyImage=zt;exports.LazyImageWrapped=Jn;exports.List=Fa;exports.ListItem=Ra;exports.ModalsProvider=ci;exports.MultiSelect=Zn;exports.PageScroller=Wa;exports.PageTitle=Ya;exports.PopoverCard=Yn;exports.PopoverCardContent=na;exports.PopoverCardFooter=ra;exports.PopoverCardHeader=ta;exports.Portal=$e;exports.SearchInput=za;exports.SegmentedControl=si;exports.Select=ar;exports.ShowMoreText=ai;exports.Spinner=Vt;exports.SuperModal=ui;exports.Switch=lr;exports.Tags=ur;exports.TextArea=Kt;exports.TimePicker=ia;exports.Toaster=xi;exports.calculatePopoverPosition=kn;exports.checkOverflow=_e;exports.cn=N;exports.debounce=xr;exports.eventEmitter=ie;exports.extractDirtyData=yr;exports.generateInitials=vn;exports.nullRead=Pt;exports.nullSet=nt;exports.removeWhitespaces=wn;exports.setFocusEnd=xn;exports.throttle=Fe;exports.toTitleCase=wr;exports.toast=Ni;exports.useClickAway=Cr;exports.useClickAwayAdvanced=$r;exports.useClickAwayWithRef=dt;exports.useEventListener=tt;exports.useKeepAlive=La;exports.useKeyListener=Nn;exports.useLargeScreen=qe;exports.useLongPress=Tr;exports.useMergedRef=Lt;exports.useMethods=Ea;exports.useModals=cr;exports.useNetwork=Mr;exports.useOverflow=yn;exports.useOverflowState=kr;exports.usePopover=ft;exports.useRipple=En;exports.useScroller=Ia;
19
+ shadow`,e?"bg-brand-text translate-x-[22px]":"bg-base-1 dark-theme:bg-base-12 translate-x-[2px]")}),r&&c.jsx("input",{type:"checkbox",name:r,checked:e,required:o,disabled:n,onChange:()=>{},tabIndex:-1,"aria-hidden":"true",className:"sr-only"})]})}const mr=({label:e,variant:t="default",color:n="solid",tags:r,onChange:o,valid:a,error:s,placeholder:i="Add a tag...",maxTags:u,validateTag:l})=>{const[d,m]=f.useState(""),[h,g]=f.useState(!1),[b,w]=f.useState(null),v=f.useRef(null),E=f.useRef(null),S=f.useRef([]),j=r.length>0,$=f.useRef(`taginput-${Math.random().toString(36).substr(2,9)}`).current,T=f.useRef(`label-${Math.random().toString(36).substr(2,9)}`).current,y=f.useRef(`error-${Math.random().toString(36).substr(2,9)}`).current;f.useEffect(()=>{S.current=S.current.slice(0,r.length)},[r.length]);const p=D=>{if(D.key==="Enter"&&d.trim()){D.preventDefault();const A=d.trim();if(u&&r.length>=u){w(`Maximum of ${u} tags allowed`);return}if(r.includes(A)){w("Tag already exists");return}if(l){const _=l(A);if(typeof _=="string"){w(_);return}else if(_===!1){w("Invalid tag");return}}o([...r,A]),m(""),w(null),P(`Added tag ${A}`)}else if(D.key==="Backspace"&&!d&&r.length>0){const A=r[r.length-1];o(r.slice(0,-1)),P(`Removed tag ${A}`)}else D.key==="ArrowLeft"&&d===""&&r.length>0&&S.current[r.length-1]&&S.current[r.length-1]?.focus()},M=(D,A)=>{if(D.key==="Backspace"||D.key==="Delete"){D.preventDefault();const _=r[A],X=[...r];X.splice(A,1),o(X),setTimeout(()=>{v.current&&v.current.focus()},0),P(`Removed tag ${_}`)}else D.key==="ArrowRight"?(D.preventDefault(),A<r.length-1?S.current[A+1]?.focus():v.current?.focus()):D.key==="ArrowLeft"&&(D.preventDefault(),A>0&&S.current[A-1]?.focus())},R=(D,A)=>{o(r.filter(_=>_!==D)),setTimeout(()=>{A<r.length-1?S.current[A]?.focus():A>0?S.current[A-1]?.focus():v.current?.focus()},0),P(`Removed tag ${D}`)},C=D=>{m(D.target.value),w(null)},x=()=>{v.current&&v.current.focus()},P=D=>{console.log(`Accessibility announcement: ${D}`)};return c.jsxs("div",{children:[c.jsxs("div",{className:"relative",ref:E,children:[t==="default"?c.jsxs("label",{id:T,htmlFor:$,className:k("text-base top-4 font-semibold left-3",{"text-sm top-2 left-2":h||j||i,"text-red-9":!!s}),children:[e," ",u&&`(${r.length}/${u})`]}):null,c.jsxs("div",{className:k("rounded-6 px-2 transition cursor-text pr-10",{"bg-base-3":n==="solid","border border-uielborder focus-visible:border-transparent":n==="outline","py-3":t==="default","pt-5 pb-2":t==="floating","ring-2 ring-branduielborder":h,"text-red-9":s||b,"ring-2 ring-red-6":(s||b)&&h}),onClick:x,role:"group","aria-labelledby":T,"aria-describedby":s||b?y:void 0,children:[t==="floating"?c.jsxs("label",{id:T,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":h||j||i,"text-red-9":!!s}),children:[e," ",u&&`(${r.length}/${u})`]}):null,c.jsxs("div",{className:k("flex flex-wrap gap-1 items-center",{"mt-2.5":t==="floating"}),children:[r.map((D,A)=>c.jsxs("div",{ref:_=>{S.current[A]=_},className:k("line-clamp-1 text-brand rounded-full px-2 text-sm flex items-center",{"bg-brandfadedbg text-brand":!s&&!b,"bg-red-4 text-red-9":s||b}),tabIndex:0,role:"button","aria-label":`${D}, press delete or backspace to remove`,onKeyDown:_=>M(_,A),children:[D,c.jsx("button",{type:"button",className:"ml-1 text-brand hover:text-brandhover shrink-0",onClick:()=>R(D,A),"aria-label":`Remove ${D} tag`,children:"x"})]},`${D}-${A}`)),c.jsx("input",{id:$,ref:v,type:"text",className:"flex-grow min-w-[60px] bg-transparent outline-none placeholder:text-sm placeholder:text-secondarytext",value:d,onChange:C,onKeyDown:p,onFocus:()=>g(!0),onBlur:()=>g(!1),enterKeyHint:"enter",autoComplete:"off",placeholder:r.length>0?"":i,style:{width:`${Math.max(60,d.length*8)}px`},"aria-describedby":s||b?y:void 0,"aria-invalid":!!(s||b)})]})]}),a&&c.jsx("span",{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:c.jsx(F.CheckIcon,{})})]}),(s||b)&&c.jsx("p",{id:y,className:"text-red-500 text-xs mt-1","aria-live":"assertive",children:s||b}),c.jsx("div",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:r.length>0?`Current tags: ${r.join(", ")}`:"No tags added yet"})]})},gi=({name:e,...t})=>{const{control:n}=J.useFormContext();return n?c.jsx(J.Controller,{name:e,control:n,render:({field:r,fieldState:o})=>c.jsx(mr,{tags:r.value,onChange:a=>r.onChange(a),error:o.error?.message,...t})}):(console.error(`Form control is missing for field: ${e}`),c.jsxs("p",{children:["Form control missing for field: ",e]}))},xi={brand:"ring-1 ring-brand",solid:"ring-1 ring-base-6"},Ut=f.forwardRef(({label:e,labelPosition:t="default",placeholder:n,error:r,focusColor:o="brand",className:a,value:s,rows:i=3,...u},l)=>{const[d,m]=f.useState(!1),h=s!==""&&s!==null&&s!==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",r&&"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":!!r}),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||n,"text-red-9":!!r}),children:e}),c.jsx("textarea",{ref:l,className:k(!r&&d&&xi[o],"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":!!r},a),value:s,placeholder:n,onFocus:()=>m(!0),onBlur:()=>m(!1),rows:i,...u})]})]})});Ut.displayName="TextArea";const vi=({name:e,customRead:t,customSet:n,...r})=>{const{control:o}=J.useFormContext(),a=f.useCallback(i=>t?t(i):i===null?Pt(i):i,[t]),s=f.useCallback(i=>n?n(i):i===null?ot(i):i,[n]);return o?c.jsx(J.Controller,{name:e,control:o,render:({field:i,fieldState:u})=>c.jsxs("div",{children:[c.jsx(Ut,{value:a(i.value),onChange:l=>i.onChange(s(l.target.value)),error:!!u.error,ref:i.ref,...r}),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]}))},wi=["Lunes","Martes","Miercoles","Jueves","Viernes","Sábado","Domingo"],yi=()=>c.jsx(ki,{}),ki=()=>c.jsx("div",{children:wi.map(e=>c.jsx(Ni,{day:e},e))}),Ni=({day:e})=>{const[t,n]=f.useState(!1),r=f.useRef(null);return f.useEffect(()=>{r.current&&cr(r.current)},[]),c.jsxs("div",{ref:r,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(fr,{className:"mt-0",checked:t,onCheckedChange:o=>n(o)})]}),t?c.jsx(Ei,{}):null]},e)},Ei=()=>{const[e,t]=f.useState([{from:"08:00",to:"12:00"},{from:"14:00",to:"18:00"}]),n=f.useRef(null);return f.useEffect(()=>{n.current&&cr(n.current)},[]),c.jsxs("div",{ref:n,children:[e.map((r,o)=>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:r.from}),c.jsx("p",{className:"text-sm text-secondarytext mx-1",children:"a"}),c.jsx(q,{color:"solid",className:"w-24",children:r.to}),c.jsx(q,{className:"rounded-full",children:c.jsx(F.X,{className:"text-secondarytext",size:20})})]},`${r.from}${o}`)),c.jsxs(q,{onClick:()=>t(r=>[...r,{from:"19:00",to:"21:00"}]),className:"w-full mt-4",color:"contrast",children:[c.jsx(F.Plus,{className:"stroke-1"}),"Añadir hora"]})]})};function rt(e,t,n=!0){const r=f.useRef(void 0);f.useEffect(()=>(n||r.current&&r.current(),r.current=ie.listen(e,t),()=>r.current&&r.current()),[e,t,n])}const ie=new yr.EventEmitter;function hr(e=8){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n="";for(let r=0;r<e;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n}const Ci=({colors:e})=>{const[t,n]=f.useState([]),r=f.useCallback(s=>{n(i=>[...i,{...s,id:s.id??hr()}])},[]),o=f.useCallback(s=>n(i=>i.filter(u=>u.id!==s)),[]),a=f.useCallback((s,i)=>{n(u=>{const l=u.findIndex(h=>h.id===s);if(l===-1)return u;const d=u[l];return[...u.slice(0,l),{...d,...i},...u.slice(l+1)]})},[]);return rt("create-toast",s=>{r(s)}),rt("update-toast",s=>{a(s.id,s.toast)}),rt("remove-toast",s=>{o(s.id)}),c.jsx(we,{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(s=>c.jsx($i,{toast:s,remove:o,colors:e},s.id))})})})},ji={simple:{icon:F.ArrowRight,color:"text-base-12"},info:{icon:F.Info,color:"text-blue-9"},success:{icon:F.CheckCircle,color:"text-brand"},warning:{icon:F.TriangleAlert,color:"text-yellow-9"},error:{icon:F.XCircle,color:"text-red-9"}},$i=({toast:e,remove:t,colors:n})=>{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 r=f.useMemo(()=>n?n[e.type]??null:null,[n]),o=f.useMemo(()=>ji[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(Kt,{wrapperClassName:"shrink-0",spinnerClassName:"h-5 w-5"}):e.type!=="simple"&&o?c.jsx(o.icon,{size:20,className:k("shrink-0",r??o.color)}):null,c.jsx("p",{className:"text-sm",children:e.message})]})},Si={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 n=hr();return ie.emit("create-toast",{id:n,type:"loading",message:e,...t}),n},update:(e,t)=>{ie.emit("update-toast",{id:e,toast:t})},dismiss:e=>{ie.emit("remove-toast",{id:e})}};exports.AliveScope=Ra;exports.Avatar=$r;exports.AvatarsGroup=Sr;exports.Button=q;exports.Calendar=Yt;exports.Checkbox=zn;exports.ConfirmationDialog=fa;exports.DatePickerDemo=ca;exports.DatePickerPopover=la;exports.DateTimePicker=da;exports.Divider=ma;exports.DropdownMenu=pa;exports.ElasticHeader=ga;exports.FocusTrap=Cr;exports.Form=Ma;exports.FormInput=La;exports.FormMultiSelect=Ha;exports.FormSelect=di;exports.FormSubmit=mi;exports.FormTags=gi;exports.FormTextArea=vi;exports.FormWorkingHours=yi;exports.Icon=Jn;exports.Input=zt;exports.KeepAlive=_a;exports.LazyImage=Ht;exports.LazyImageWrapped=tr;exports.List=Ya;exports.ListItem=za;exports.MenuFocusProvider=Bn;exports.ModalsProvider=hi;exports.MultiSelect=nr;exports.PageScroller=Ba;exports.PageTitle=Va;exports.PopoverCard=Yn;exports.PopoverCardContent=sa;exports.PopoverCardFooter=aa;exports.PopoverCardHeader=oa;exports.Portal=we;exports.SearchInput=Ka;exports.SegmentedControl=ui;exports.Select=lr;exports.ShowMoreText=fi;exports.Spinner=Kt;exports.SuperModal=pi;exports.Switch=fr;exports.Tags=mr;exports.TextArea=Ut;exports.TimePicker=ua;exports.Toaster=Ci;exports.calculatePopoverPosition=Nn;exports.checkOverflow=_e;exports.cn=k;exports.debounce=kr;exports.eventEmitter=ie;exports.extractDirtyData=Er;exports.generateInitials=vn;exports.nullRead=Pt;exports.nullSet=ot;exports.removeWhitespaces=yn;exports.setFocusEnd=wn;exports.throttle=Fe;exports.toTitleCase=Nr;exports.toast=Si;exports.useClickAway=Mr;exports.useClickAwayAdvanced=Tr;exports.useClickAwayWithRef=qe;exports.useEventListener=rt;exports.useKeepAlive=Ia;exports.useKeyListener=Lt;exports.useLargeScreen=Xe;exports.useLongPress=Pr;exports.useMergedRef=Ot;exports.useMethods=Ta;exports.useModals=dr;exports.useNetwork=Lr;exports.useOverflow=kn;exports.useOverflowState=jr;exports.usePopover=Ve;exports.useRipple=En;exports.useScroller=qa;