@boxcustodia/library 1.8.3 → 1.8.5

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.js CHANGED
@@ -349,7 +349,7 @@ __p += '`),yn&&(nt+=`' +
349
349
  function print() { __p += __j.call(arguments, '') }
350
350
  `:`;
351
351
  `)+nt+`return __p
352
- }`;var Vt=mb(function(){return Jt(ne,xt+"return "+nt).apply(r,fe)});if(Vt.source=nt,Of(Vt))throw Vt;return Vt}function ha(p){return ht(p).toLowerCase()}function ja(p){return ht(p).toUpperCase()}function el(p,g,T){if(p=ht(p),p&&(T||g===r))return Bs(p);if(!p||!(g=Al(g)))return p;var j=Wn(p),G=Wn(g),ne=Ai(j,G),fe=Ym(j,G)+1;return jo(j,ne,fe).join("")}function bc(p,g,T){if(p=ht(p),p&&(T||g===r))return p.slice(0,wo(p)+1);if(!p||!(g=Al(g)))return p;var j=Wn(p),G=Ym(j,Wn(g))+1;return jo(j,0,G).join("")}function ci(p,g,T){if(p=ht(p),p&&(T||g===r))return p.replace(vl,"");if(!p||!(g=Al(g)))return p;var j=Wn(p),G=Ai(j,Wn(g));return jo(j,G).join("")}function hr(p,g){var T=de,j=W;if(er(g)){var G="separator"in g?g.separator:G;T="length"in g?At(g.length):T,j="omission"in g?Al(g.omission):j}p=ht(p);var ne=p.length;if(Yu(p)){var fe=Wn(p);ne=fe.length}if(T>=ne)return p;var Se=T-nf(j);if(Se<1)return j;var Ne=fe?jo(fe,0,Se).join(""):p.slice(0,Se);if(G===r)return Ne+j;if(fe&&(Se+=Ne.length-Se),Yd(G)){if(p.slice(Se).search(G)){var Qe,tt=Ne;for(G.global||(G=cu(G.source,ht(wp.exec(G))+"g")),G.lastIndex=0;Qe=G.exec(tt);)var nt=Qe.index;Ne=Ne.slice(0,nt===r?Se:nt)}}else if(p.indexOf(Al(G),Se)!=Se){var it=Ne.lastIndexOf(G);it>-1&&(Ne=Ne.slice(0,it))}return Ne+j}function jl(p){return p=ht(p),p&&Gl.test(p)?p.replace(Kl,iy):p}var ps=lc(function(p,g,T){return p+(T?" ":"")+g.toUpperCase()}),hs=Cy("toUpperCase");function F0(p,g,T){return p=ht(p),g=T?r:g,g===r?bl(p)?Is(p):fx(p):p.match(g)||[]}var mb=qt(function(p,g){try{return aa(p,r,g)}catch(T){return Of(T)?T:new jt(T)}}),Qh=Bi(function(p,g){return Co(g,function(T){T=ca(T),wl(p,T,Nv(p[T],p))}),p});function rp(p){var g=p==null?0:p.length,T=Rt();return p=g?Gn(p,function(j){if(typeof j[1]!="function")throw new Va(h);return[T(j[0]),j[1]]}):[],qt(function(j){for(var G=-1;++G<g;){var ne=p[G];if(aa(ne[0],this,j))return aa(ne[1],this,j)}})}function K0(p){return x0(Ga(p,S))}function fi(p){return function(){return p}}function ap(p,g){return p==null||p!==p?g:p}var G0=wu(),lp=wu(!0);function tl(p){return p}function op(p){return mf(typeof p=="function"?p:Ga(p,S))}function Xv(p){return Sd(Ga(p,S))}function vb(p,g){return nh(p,Ga(g,S))}var Y0=qt(function(p,g){return function(T){return Tl(T,p,g)}}),Zh=qt(function(p,g){return function(T){return Tl(p,T,g)}});function o(p,g,T){var j=Wr(g),G=$r(g,j);T==null&&!(er(g)&&(G.length||!j.length))&&(T=g,g=p,p=this,G=$r(g,Wr(g)));var ne=!(er(T)&&"chain"in T)||!!T.chain,fe=Uo(p);return Co(G,function(Se){var Ne=g[Se];p[Se]=Ne,fe&&(p.prototype[Se]=function(){var Qe=this.__chain__;if(ne||Qe){var tt=p(this.__wrapped__),nt=tt.__actions__=Dl(this.__actions__);return nt.push({func:Ne,args:arguments,thisArg:p}),tt.__chain__=Qe,tt}return Ne.apply(p,Ti([this.value()],arguments))})}),p}function u(){return ra._===this&&(ra._=cr),this}function f(){}function v(p){return p=At(p),qt(function(g){return ah(g,p)})}var w=hh(Gn),_=hh(Ri),z=hh(ny);function J(p){return Ru(p)?Gu(ca(p)):Pr(p)}function ge(p){return function(g){return p==null?r:qo(p,g)}}var qe=mh(),Ye=mh(!0);function We(){return[]}function Le(){return!1}function He(){return{}}function mt(){return""}function Dt(){return!0}function Fn(p,g){if(p=At(p),p<1||p>te)return[];var T=oe,j=fn(p,oe);g=Rt(g),p-=oe;for(var G=hd(j,g);++T<p;)g(T);return G}function Oe(p){return Bt(p)?Gn(p,ca):Pl(p)?[p]:Dl(as(ht(p)))}function we(p){var g=++fu;return ht(p)+g}var Pe=xf(function(p,g){return p+g},0),Ze=oo("ceil"),wt=xf(function(p,g){return p/g},1),gn=oo("floor");function yt(p){return p&&p.length?Ya(p,tl,Ws):r}function Ht(p,g){return p&&p.length?Ya(p,Rt(g,2),Ws):r}function Zt(p){return Zc(p,tl)}function wn(p,g){return Zc(p,Rt(g,2))}function Yi(p){return p&&p.length?Ya(p,tl,lr):r}function X0(p,g){return p&&p.length?Ya(p,Rt(g,2),lr):r}var Qv=xf(function(p,g){return p*g},1),Z_=oo("round"),W_=xf(function(p,g){return p-g},0);function Ww(p){return p&&p.length?uu(p,tl):0}function Fo(p,g){return p&&p.length?uu(p,Rt(g,2)):0}return ee.after=P0,ee.ary=Vy,ee.assign=k0,ee.assignIn=Io,ee.assignInWith=Fi,ee.assignWith=Qd,ee.at=ql,ee.before=Fy,ee.bind=Nv,ee.bindAll=Qh,ee.bindKey=Ky,ee.castArray=Pv,ee.chain=si,ee.chunk=Ny,ee.compact=$d,ee.concat=Pd,ee.cond=rp,ee.conforms=K0,ee.constant=fi,ee.countBy=Dv,ee.create=Fh,ee.curry=Af,ee.curryRight=Gy,ee.debounce=Yy,ee.defaults=kv,ee.defaultsDeep=Ki,ee.defer=Ln,ee.delay=jh,ee.difference=qd,ee.differenceBy=$y,ee.differenceWith=ls,ee.drop=Qr,ee.dropRight=yv,ee.dropRightWhile=Py,ee.dropWhile=wa,ee.fill=Ld,ee.filter=Nh,ee.flatMap=$l,ee.flatMapDeep=A0,ee.flatMapDepth=$h,ee.flatten=Yn,ee.flattenDeep=Ml,ee.flattenDepth=_u,ee.flip=Xy,ee.flow=G0,ee.flowRight=lp,ee.fromPairs=qy,ee.functions=vx,ee.functionsIn=U0,ee.groupBy=Id,ee.initial=_h,ee.intersection=Ah,ee.intersectionBy=Ol,ee.intersectionWith=Qt,ee.invert=An,ee.invertBy=gx,ee.invokeMap=Nu,ee.iteratee=op,ee.keyBy=Hd,ee.keys=Wr,ee.keysIn=qr,ee.map=Ph,ee.mapKeys=yc,ee.mapValues=Wd,ee.matches=Xv,ee.matchesProperty=vb,ee.memoize=zh,ee.merge=Ho,ee.mergeWith=ds,ee.method=Y0,ee.methodOf=Zh,ee.mixin=o,ee.negate=Za,ee.nthArg=v,ee.omit=Jd,ee.omitBy=I0,ee.once=q0,ee.orderBy=D0,ee.over=w,ee.overArgs=L0,ee.overEvery=_,ee.overSome=z,ee.partial=mc,ee.partialRight=vc,ee.partition=M0,ee.pick=qf,ee.pickBy=Lf,ee.property=J,ee.propertyOf=ge,ee.pull=Rf,ee.pullAll=ii,ee.pullAllBy=Ev,ee.pullAllWith=Sv,ee.pullAt=ui,ee.range=qe,ee.rangeRight=Ye,ee.rearg=Qy,ee.reject=px,ee.remove=zd,ee.rest=$v,ee.reverse=fc,ee.sampleSize=hc,ee.set=Gh,ee.setWith=Uv,ee.shuffle=N0,ee.slice=Dh,ee.sortBy=qh,ee.sortedUniq=Mh,ee.sortedUniqBy=wv,ee.split=Yv,ee.spread=Zy,ee.tail=T0,ee.take=ky,ee.takeRight=Sn,ee.takeRightWhile=Hn,ee.takeWhile=sn,ee.tap=Uy,ee.throttle=us,ee.thru=hn,ee.toArray=ob,ee.toPairs=Yh,ee.toPairsIn=jf,ee.toPath=Oe,ee.toPlainObject=Xd,ee.transform=sb,ee.unary=$u,ee.union=en,ee.unionBy=qn,ee.unionWith=Pt,ee.uniq=Du,ee.uniqBy=dc,ee.uniqWith=Rv,ee.unset=Iv,ee.unzip=ko,ee.unzipWith=Xn,ee.update=cb,ee.updateWith=mo,ee.values=Ll,ee.valuesIn=Vo,ee.without=Ui,ee.words=F0,ee.wrap=ss,ee.xor=Tf,ee.xorBy=Tv,ee.xorWith=Nl,ee.zip=Cr,ee.zipObject=Oh,ee.zipObjectDeep=wr,ee.zipWith=_v,ee.entries=Yh,ee.entriesIn=jf,ee.extend=Io,ee.extendWith=Fi,o(ee,ee),ee.add=Pe,ee.attempt=mb,ee.camelCase=Fv,ee.capitalize=da,ee.ceil=Ze,ee.clamp=fb,ee.clone=Wy,ee.cloneDeep=Bh,ee.cloneDeepWith=Df,ee.cloneWith=Jy,ee.conformsTo=kh,ee.deburr=ep,ee.defaultTo=ap,ee.divide=wt,ee.endsWith=db,ee.eq=po,ee.escape=Kv,ee.escapeRegExp=zf,ee.every=Ud,ee.find=fo,ee.findIndex=jd,ee.findKey=Zd,ee.findLast=_0,ee.findLastIndex=bv,ee.findLastKey=Pf,ee.floor=gn,ee.forEach=Iy,ee.forEachRight=Ou,ee.forIn=ho,ee.forInRight=Kh,ee.forOwn=Ja,ee.forOwnRight=Gi,ee.get=gc,ee.gt=j0,ee.gte=Mf,ee.has=Zr,ee.hasIn=Ue,ee.head=Ly,ee.identity=tl,ee.includes=Hy,ee.indexOf=jy,ee.inRange=Hv,ee.invoke=ib,ee.isArguments=Ii,ee.isArray=Bt,ee.isArrayBuffer=Vd,ee.isArrayLike=Wa,ee.isArrayLikeObject=Rr,ee.isBoolean=Fd,ee.isBuffer=cs,ee.isDate=z0,ee.isElement=rn,ee.isEmpty=eb,ee.isEqual=qv,ee.isEqualWith=Kd,ee.isError=Of,ee.isFinite=tb,ee.isFunction=Uo,ee.isInteger=Gd,ee.isLength=Uh,ee.isMap=Lv,ee.isMatch=nb,ee.isMatchWith=rb,ee.isNaN=Vn,ee.isNative=ab,ee.isNil=lb,ee.isNull=qa,ee.isNumber=Ih,ee.isObject=er,ee.isObjectLike=Tr,ee.isPlainObject=Nf,ee.isRegExp=Yd,ee.isSafeInteger=jv,ee.isSet=fs,ee.isString=Hh,ee.isSymbol=Pl,ee.isTypedArray=Hi,ee.isUndefined=zv,ee.isWeakMap=hx,ee.isWeakSet=Vh,ee.join=xv,ee.kebabCase=H0,ee.last=or,ee.lastIndexOf=zy,ee.lowerCase=Gv,ee.lowerFirst=pb,ee.lt=B0,ee.lte=$f,ee.max=yt,ee.maxBy=Ht,ee.mean=Zt,ee.meanBy=wn,ee.min=Yi,ee.minBy=X0,ee.stubArray=We,ee.stubFalse=Le,ee.stubObject=He,ee.stubString=mt,ee.stubTrue=Dt,ee.multiply=Qv,ee.nth=os,ee.noConflict=u,ee.noop=f,ee.now=Lh,ee.pad=V0,ee.padEnd=Bf,ee.padStart=pa,ee.parseInt=Pu,ee.random=Vv,ee.reduce=Mv,ee.reduceRight=Ov,ee.repeat=qu,ee.replace=La,ee.result=ub,ee.round=Z_,ee.runInContext=Me,ee.sample=O0,ee.size=$0,ee.snakeCase=hb,ee.some=_f,ee.sortedIndex=so,ee.sortedIndexBy=Au,ee.sortedIndexOf=R0,ee.sortedLastIndex=Cv,ee.sortedLastIndexBy=Bd,ee.sortedLastIndexOf=By,ee.startCase=tp,ee.startsWith=Xh,ee.subtract=W_,ee.sum=Ww,ee.sumBy=Fo,ee.template=np,ee.times=Fn,ee.toFinite=Vi,ee.toInteger=At,ee.toLength=Bv,ee.toLower=ha,ee.toNumber=Cn,ee.toSafeInteger=mx,ee.toString=ht,ee.toUpper=ja,ee.trim=el,ee.trimEnd=bc,ee.trimStart=ci,ee.truncate=hr,ee.unescape=jl,ee.uniqueId=we,ee.upperCase=ps,ee.upperFirst=hs,ee.each=Iy,ee.eachRight=Ou,ee.first=Ly,o(ee,(function(){var p={};return Po(ee,function(g,T){On.call(ee.prototype,T)||(p[T]=g)}),p})(),{chain:!1}),ee.VERSION=l,Co(["bind","bindKey","curry","curryRight","partial","partialRight"],function(p){ee[p].placeholder=ee}),Co(["drop","take"],function(p,g){It.prototype[p]=function(T){T=T===r?1:Er(At(T),0);var j=this.__filtered__&&!g?new It(this):this.clone();return j.__filtered__?j.__takeCount__=fn(T,j.__takeCount__):j.__views__.push({size:fn(T,oe),type:p+(j.__dir__<0?"Right":"")}),j},It.prototype[p+"Right"]=function(T){return this.reverse()[p](T).reverse()}}),Co(["filter","map","takeWhile"],function(p,g){var T=g+1,j=T==ae||T==B;It.prototype[p]=function(G){var ne=this.clone();return ne.__iteratees__.push({iteratee:Rt(G,3),type:T}),ne.__filtered__=ne.__filtered__||j,ne}}),Co(["head","last"],function(p,g){var T="take"+(g?"Right":"");It.prototype[p]=function(){return this[T](1).value()[0]}}),Co(["initial","tail"],function(p,g){var T="drop"+(g?"":"Right");It.prototype[p]=function(){return this.__filtered__?new It(this):this[T](1)}}),It.prototype.compact=function(){return this.filter(tl)},It.prototype.find=function(p){return this.filter(p).head()},It.prototype.findLast=function(p){return this.reverse().find(p)},It.prototype.invokeMap=qt(function(p,g){return typeof p=="function"?new It(this):this.map(function(T){return Tl(T,p,g)})}),It.prototype.reject=function(p){return this.filter(Za(Rt(p)))},It.prototype.slice=function(p,g){p=At(p);var T=this;return T.__filtered__&&(p>0||g<0)?new It(T):(p<0?T=T.takeRight(-p):p&&(T=T.drop(p)),g!==r&&(g=At(g),T=g<0?T.dropRight(-g):T.take(g-p)),T)},It.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},It.prototype.toArray=function(){return this.take(oe)},Po(It.prototype,function(p,g){var T=/^(?:filter|find|map|reject)|While$/.test(g),j=/^(?:head|last)$/.test(g),G=ee[j?"take"+(g=="last"?"Right":""):g],ne=j||/^find/.test(g);G&&(ee.prototype[g]=function(){var fe=this.__wrapped__,Se=j?[1]:arguments,Ne=fe instanceof It,Qe=Se[0],tt=Ne||Bt(fe),nt=function(tn){var yn=G.apply(ee,Ti([tn],Se));return j&&it?yn[0]:yn};tt&&T&&typeof Qe=="function"&&Qe.length!=1&&(Ne=tt=!1);var it=this.__chain__,xt=!!this.__actions__.length,Mt=ne&&!it,Vt=Ne&&!xt;if(!ne&&tt){fe=Vt?fe:new It(this);var Ot=p.apply(fe,Se);return Ot.__actions__.push({func:hn,args:[nt],thisArg:r}),new Sl(Ot,it)}return Mt&&Vt?p.apply(this,Se):(Ot=this.thru(nt),Mt?j?Ot.value()[0]:Ot.value():Ot)})}),Co(["pop","push","shift","sort","splice","unshift"],function(p){var g=vd[p],T=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",j=/^(?:pop|shift)$/.test(p);ee.prototype[p]=function(){var G=arguments;if(j&&!this.__chain__){var ne=this.value();return g.apply(Bt(ne)?ne:[],G)}return this[T](function(fe){return g.apply(Bt(fe)?fe:[],G)})}}),Po(It.prototype,function(p,g){var T=ee[g];if(T){var j=T.name+"";On.call(_n,j)||(_n[j]=[]),_n[j].push({name:g,func:T})}}),_n[zi(r,P).name]=[{name:"wrapper",func:r}],It.prototype.clone=$i,It.prototype.reverse=Cl,It.prototype.value=Pi,ee.prototype.at=kd,ee.prototype.chain=pr,ee.prototype.commit=fa,ee.prototype.next=is,ee.prototype.plant=Mu,ee.prototype.reverse=co,ee.prototype.toJSON=ee.prototype.valueOf=ee.prototype.value=Av,ee.prototype.first=ee.prototype.head,Jn&&(ee.prototype[Jn]=pc),ee}),su=Hp();Ci?((Ci.exports=su)._=su,Pp._=su):ra._=su}).call(Vre)})(JC,JC.exports)),JC.exports}var sr=Fre();const Kre=({view:e,setView:t,value:r,previousMonth:l,nextMonth:s,previousYear:c,nextYear:h,previousDecade:m,nextDecade:b,goBackProps:E,goNextProps:C,changeViewProps:S})=>{const R=e==="month",M=e==="year",q=e==="decade",N=()=>{if(q)return m();if(M)return c();l()},L=()=>{if(q)return b();if(M)return h();s()},P=()=>{if(R)return t("year");if(M)return t("decade")},U=()=>q?I():M?bo(r,"yyyy"):bo(r,"MMMM yyyy",{locale:Hre}),I=()=>{if(!r)return"";const V=oL({start:bL(r),end:iL(r)}),F=sr.first(V),K=sr.last(V);return`${bo(F,"yyyy")} - ${bo(K,"yyyy")}`},Y=k.useMemo(U,[r,e]);return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"flex items-center justify-between","data-slot":"calendar-navigation",children:[O.jsxs(hi,{onClick:N,size:"icon",variant:"ghost",className:"border w-6 opacity-50 hover:opacity-100","data-slot":"calendar-navigation-back",...E,children:[O.jsx(fM,{className:"h-4 w-4","data-slot":"calendar-navigation-back-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a anterior"})]}),O.jsx("button",{onClick:P,disabled:q,...S,type:"button",className:Fe("font-semibold pb-px text-gray-900 text-lg text-blue-bell select-none min-w-[60%] capitalize",S?.className),"data-slot":"calendar-navigation-label",children:Y}),O.jsxs(hi,{onClick:L,size:"icon",variant:"ghost",className:"border w-6 opacity-50 hover:opacity-100","data-slot":"calendar-navigation-next",...C,children:[O.jsx(Rw,{className:"h-4 w-4","data-slot":"calendar-navigation-next-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a siguiente"})]})]})})};function Ng(e){return!!(e&&typeof e=="object"&&"start"in e&&"end"in e)}function Gre(e,t){return{selectMultipleDate:s=>{if(!e)return t([s]);const c=sr.findIndex(e,m=>Zb(m,s));if(c===-1)return t([...e,s]);const h=[...e.slice(0,c),...e.slice(c+1)];t(h)},isMultipleSelected:s=>sr.isArray(e)&&e.some(c=>Zb(c,s))}}function Yre(e,t,r){const l=b=>{if(e?.start){const{start:C,end:S}=e;if(fne(b,C)||C&&S){t({start:b,end:void 0});return}if(s(C,b))return;t({start:C,end:b})}else t({start:b,end:void 0})},s=(b,E)=>!r||!b||!E?!1:lL({start:Og(b),end:E}).some(R=>r(R));return{selectRangeDate:l,isInRange:b=>{if(!Ng(e)||!e)return!1;const{start:E,end:C}=e;return E&&!C?Zb(b,E):!E||!C?!1:cre(b,{start:Og(E),end:Og(C)})},isFirstDayFromRange:b=>!e||!Ng(e)||!e.start?!1:Zb(b,e.start),isLastDayFromRange:b=>!e||!Ng(e)||!e.end?!1:Zb(b,e.end)}}function Xre(e,t){return{selectSingleDate:s=>{t(s)},isSingleSelected:s=>Ag(e)&&Zb(s,e)}}const xL=k.createContext({defaultStartDate:new Date,mode:"single",isSingleMode:!1,isRangeMode:!1,selected:null,selectDate:()=>{},isSelected:()=>!1,isFirstDayFromRange:()=>!1,isLastDayFromRange:()=>!1,isInRange:()=>!1});function Qre(e){const{mode:t,value:r,defaultValue:l,onChange:s,disabled:c}=e,h=t==="single",m=t==="range",b=t==="multiple",[E=null,C]=br({prop:r,onChange:s,defaultProp:l}),{selectSingleDate:S,isSingleSelected:R}=Xre(Ag(E)?E:void 0,C),{selectRangeDate:M,isInRange:q,...N}=Yre(Ng(E)?E:void 0,C,c),{selectMultipleDate:L,isMultipleSelected:P}=Gre(sr.isArray(E)?E:void 0,C),U=V=>{if(h)return S(V);if(m)return M(V);if(b)return L(V)},I=V=>h?R(V):m?q(V):b?P(V):!1;return{defaultStartDate:Ag(E)?E:sr.isArray(E)?E[0]:Ng(E)&&E.start?E.start:new Date,isSingleMode:h,isRangeMode:m,selected:E,isSelected:I,selectDate:U,isInRange:q,mode:t,...N}}const Zre=({day:e,navigationDate:t,className:r,...l})=>{const{isSelected:s,mode:c,selected:h,isRangeMode:m,selectDate:b,isFirstDayFromRange:E,isLastDayFromRange:C}=k.useContext(xL),S=k.useMemo(()=>s(e),[e,h]),R=!S&&!ure(e,t),M=!S&&ste(e);return O.jsx("button",{...l,onClick:()=>b(e),type:"button","data-slot":"calendar-day","data-state-mode":c,"data-state-today":sre(e)||void 0,"data-state-selected":S||void 0,"data-state-different-month":R||void 0,"data-state-weekend":M||void 0,"data-state-range-mode":m||void 0,"data-state-first-day":E(e)||void 0,"data-state-last-day":C(e)||void 0,"data-state-in-range":m&&S||void 0,className:Fe("mx-auto flex pt-px rounded-md items-center justify-center w-full aspect-square hover:bg-accent","data-[state-today]:text-error","data-[state-selected]:bg-primary data-[state-selected]:!text-primary-foreground data-[state-selected]:hover:bg-primary/80","data-[state-different-month]:opacity-50 data-[state-weekend=true]:opacity-50","data-[state-in-range]:not-data-[state-first-day]:not-data-[state-last-day]:rounded-none","data-[state-first-day]:rounded-l-full","data-[state-last-day]:rounded-r-full",r),children:O.jsx("time",{dateTime:bo(e,"yyyy-MM-dd"),children:bo(e,"d")})})},Wre=({value:e,onChange:t})=>{const r=()=>oL({start:bL(e),end:iL(e)}),l=c=>{const h=dre(e,parseInt(bo(c,"yyyy")));t(h)},s=k.useMemo(r,[e]);return O.jsx("div",{className:"grid grid-cols-3 grow","data-slot":"calendar-decade-view",children:s.map((c,h)=>O.jsx(hi,{onClick:()=>l(c),className:"h-full rounded-none",type:"button",variant:"ghost","data-slot":"calendar-decade-view-year",children:bo(c,"yyyy")},h))})},C2=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],EL=["Lunes","Martes","Miercoles","Jueves","Viernes","Sabado","Domingo"],Jre=e=>O.jsx("div",{...e,className:Fe("grid grid-cols-7 font-semibold mt-2 text-xs leading-6 text-center py-1 bg-blue-bell/40 select-none",e.className),"data-slot":"calendar-week-days",children:EL.map(t=>O.jsx("abbr",{"aria-label":t,"data-slot":"calendar-week-day",children:sr.at(t,0)},t))}),eae=({navigationDate:e,disabled:t,weekDaysClassName:r,weekDaysProps:l,dayClassName:s,dayProps:c})=>{const h=()=>lL({start:Am(e,{weekStartsOn:1}),end:gte(mte(e),{weekStartsOn:1})}),m=k.useMemo(h,[e]);return O.jsxs(O.Fragment,{children:[O.jsx(Jre,{className:r,...l}),O.jsx("div",{className:"grid grid-cols-7 mt-2 text-sm","data-slot":"calendar-month-view",children:m.map((b,E)=>O.jsx(Zre,{day:b,className:s,...c,navigationDate:e,disabled:t?.(b)},E))})]})},tae=({value:e,onChange:t})=>{const r=l=>{const s=fre(e,l);t(s)};return O.jsx("div",{className:"grid grid-cols-3 grow","data-slot":"calendar-year-view",children:C2.map(l=>O.jsx(hi,{type:"button",className:"h-full rounded",onClick:()=>r(C2.indexOf(l)),variant:"ghost","data-slot":"calendar-year-view-month",children:O.jsx("abbr",{"aria-label":`${l} ${bo(e,"yyyy")}`,children:l})},l))})};function nae(e=LD()){const[t,r]=k.useState({month:bo(e||LD(),"MM"),year:bo(e||LD(),"yyyy")}),l=k.useMemo(()=>ore(`${t.month}-${t.year}`,"MM-yyyy",new Date),[t]),s=R=>{r({...t,month:bo(R,"MM")})},c=R=>{r({...t,year:bo(R,"yyyy")})};return{navigationDate:l,setMonth:s,setYear:c,previousMonth:()=>{const R=x2(l,-1);r({month:bo(R,"MM"),year:bo(R,"yyyy")})},nextMonth:()=>{const R=x2(l,1);r({month:bo(R,"MM"),year:bo(R,"yyyy")})},previousYear:()=>{const R=hT(l,-1);c(R)},nextYear:()=>{const R=hT(l,1);c(R)},previousDecade:()=>{const R=hT(l,-10);c(R)},nextDecade:()=>{const R=hT(l,10);c(R)}}}const SL=e=>{const{disabled:t,initialView:r="month",view:l,onChangeView:s,initialDate:c,goBackProps:h,goNextProps:m,changeViewProps:b}=e,E=Qre(e),{defaultStartDate:C}=E,{navigationDate:S,setMonth:R,setYear:M,...q}=nae(c||C),[N=r,L]=br({prop:l,onChange:P=>s?.(P,S),defaultProp:r});return O.jsx(xL.Provider,{value:E,children:O.jsxs("div",{"data-slot":"calendar",className:Fe("w-60 min-h-64 flex flex-col border rounded-md p-2",e.className),children:[O.jsx(Kre,{view:N,setView:L,value:S,goBackProps:h,goNextProps:m,changeViewProps:b,...q}),N==="month"&&O.jsx(eae,{...e.monthViewProps,navigationDate:S,disabled:t}),N==="year"&&O.jsx(tae,{value:S,onChange:P=>{R(P),L("month")}}),N==="decade"&&O.jsx(Wre,{value:S,onChange:P=>{M(P),L("year")}})]})})},rae=({className:e,...t})=>O.jsx("div",{className:Fe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t,"data-slot":"card"}),aae=({className:e,...t})=>O.jsx("div",{className:Fe("flex flex-col space-y-1 p-6",e),...t,"data-slot":"card-header"}),lae=({className:e,...t})=>O.jsx("h3",{className:Fe("text-2xl font-semibold leading-none tracking-tight",e),...t,"data-slot":"card-title"}),oae=({className:e,...t})=>O.jsx("p",{className:Fe("text-sm text-muted-foreground",e),...t,"data-slot":"card-description"}),iae=({className:e,...t})=>O.jsx("div",{className:Fe("p-6 pt-0",e),...t,"data-slot":"card-content"}),uae=({className:e,...t})=>O.jsx("div",{className:Fe("flex items-center p-6 pt-0",e),...t,"data-slot":"card-footer"}),sae=({className:e,...t})=>O.jsx("div",{className:Fe("flex items-center justify-center",e),...t,"data-slot":"center"}),$w=({className:e,...t})=>O.jsx("label",{className:Fe("text-sm font-medium select-none leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),"data-slot":"label",...t}),w2=({when:e,...t})=>O.jsx(Ts,{present:e,children:O.jsx(_w,{...t,"data-state":e?"open":"closed","data-slot":"show"})}),cae=({checked:e,onChange:t,defaultChecked:r=!1,indeterminate:l,defaultIndeterminate:s=!1,onIndeterminateChange:c,className:h,size:m=16,children:b,containerClassName:E,containerProps:C,...S})=>{const R=k.useId(),M=k.useRef(null),[q,N]=br({defaultProp:r,prop:e,onChange:t}),[L,P]=br({defaultProp:s,prop:l,onChange:c});k.useEffect(()=>{M.current&&(M.current.indeterminate=L)},[L]);const U=V=>{V.stopPropagation(),!S.disabled&&(L?(P(!1),N(!0)):N(F=>!F))},I=L?"indeterminate":q?"checked":"unchecked",Y=S.id??R;return O.jsxs("div",{...C,className:Fe("flex gap-x-2 items-center",E),"data-slot":"checkbox",children:[O.jsxs("button",{disabled:S.disabled,onClick:U,"data-state":I,type:"button",style:{width:m,height:m},className:Fe("peer aspect-square flex gap-2 shrink-0 rounded-(--radius-checkbox) border border-(--color-checkbox) ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-colors","data-[state=checked]:bg-(--color-checkbox) data-[state=checked]:text-primary-foreground data-[state=checked]:border-transparent","data-[state=indeterminate]:bg-(--color-checkbox) data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-transparent","data-[state=unchecked]:bg-background data-[state=unchecked]:text-muted-foreground data-[state=unchecked]:border-input",h),"data-slot":"checkbox-trigger",children:[O.jsx(w2,{when:L,children:O.jsx(yK,{className:Fe("pt-[2px] w-full h-full opacity-0","open:fade-in-0 open:zoom-in-50 open:opacity-100 open:duration-200","closed:fade-out-0 closed:zoom-out-50 closed:opacity-0")})}),O.jsx(w2,{when:!L&&!!q,children:O.jsx($T,{className:Fe("pt-[2px] w-full h-full opacity-0","open:fade-in-0 open:zoom-in-50 open:opacity-100 open:duration-200","closed:fade-out-0 closed:zoom-out-50 closed:opacity-0")})}),O.jsx("input",{...S,ref:M,id:Y,tabIndex:-1,checked:q,onChange:V=>N(V.currentTarget.checked),type:"checkbox",className:"sr-only","aria-hidden":!0})]}),b&&O.jsx($w,{htmlFor:Y,"data-slot":"checkbox-label",children:b})]})};function fae({items:e=[],valueKey:t="value",labelKey:r="label",placeholder:l="Seleccionar",searchPlaceholder:s="Buscar...",emptyMessage:c="No se encontraron resultado",searchProps:h,className:m,triggerProps:b,itemProps:E,itemClassName:C,contentProps:S,contentClassName:R,value:M,onChange:q,defaultValue:N,renderOption:L=I=>I?.[r],commandProps:P,...U}){const[I,Y]=br({prop:U.open,onChange:U.onOpenChange,defaultProp:U.defaultOpen||!1}),[V,F]=br({prop:M,onChange:de=>{if(!q)return;const W=e.find(se=>se[t]===de);q?.(W?.[t],W)},defaultProp:N}),[K,Q]=br({prop:U?.search,defaultProp:U?.searchDefaultValue||"",onChange:U?.onSearchChange}),he=D.useMemo(()=>e.find(de=>de[t]===V),[V]);return O.jsxs(Kw,{open:I,onOpenChange:Y,"data-slot":"combobox",children:[O.jsx(Gw,{asChild:!0,"data-slot":"combobox-trigger",children:O.jsxs(hi,{...U,...b,variant:"outline",role:"combobox","aria-expanded":I,className:Fe("font-normal w-full items-center justify-between border-input px-3 hover:bg-background",m),children:[O.jsx("span",{className:"truncate",children:he?L(he):l}),O.jsx(PT,{className:"ml-2 h-4 w-4 shrink-0 opacity-50","data-slot":"combobox-trigger-icon"})]})}),O.jsx(Yw,{...S,className:Fe("p-1",R),asChild:!0,matchTriggerWidth:!0,"data-slot":"combobox-content",children:O.jsxs(Dw,{...P,children:[O.jsx(x_,{value:K,onValueChange:Q,placeholder:s,autoFocus:!0,"data-slot":"combobox-input",...h}),O.jsx(S_,{"data-slot":"combobox-empty",children:c}),O.jsx(E_,{"data-slot":"combobox-list",children:e.map(de=>k.createElement(sw,{className:C,"data-slot":"combobox-item",...E,key:de[t],value:de[t],onSelect:()=>{const W=de[t];F(W===V?"":W),Y(!1)}},L(de)))})]})})]})}const dae=e=>{const{placeholder:t,mode:r="single",value:l,onChange:s,defaultValue:c,className:h,disabledDate:m,renderFooter:b,disabled:E,hideFooter:C,...S}=e,R=r==="range",M=r==="single",q=r==="multiple",[N=null,L]=br({prop:l,onChange:he=>s?.(he),defaultProp:c}),P=he=>{if(!Ng(he))return!1;const{start:de,end:W}=he;return Ag(de)&&Ag(W)},U=he=>{he||!N||!Ng(N)||P(N)||L({start:null,end:null})},I=he=>Ag(he)?bo(he,"dd/MM/yyyy"):"",Y=()=>{M&&L(null),q&&L([]),R&&L({start:null,end:null})},V=()=>{L(new Date)},F=k.useMemo(()=>{if(!N)return"";if(M&&Ag(N))return I(N);if(q&&sr.isArray(N))return N.map(I).join(" - ");if(R&&Ng(N)){const de=I(N.start),W=I(N.end);return!de&&!W?"":de&&!W?de:`${de} - ${W}`}return""},[N]),K=()=>O.jsxs("span",{className:"flex w-full p-1 justify-between",children:[O.jsx(hi,{variant:"ghost",onClick:Y,children:"Borrar"}),M&&O.jsx(hi,{variant:"ghost",onClick:V,disabled:m?.(new Date),children:"Hoy"})]}),Q=()=>C?null:b?b({mode:r,value:N,clear:Y,selectToday:V,setValue:L}):K();return O.jsxs(Kw,{onOpenChange:U,"data-slot":"date-picker",children:[O.jsx(Gw,{asChild:!0,"data-slot":"date-picker-trigger",children:O.jsxs("button",{disabled:E,type:"button",className:Fe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 items-center text-sm ring-offset-background placeholder:text-muted-foreground","hover:bg-accent hover:text-accent-foreground transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",!N&&"text-muted-foreground",h,"field-error"),children:[O.jsx("input",{value:F,className:"sr-only",...S}),O.jsx("span",{className:"flex-1 text-start truncate pt-px","data-slot":"date-picker-value",children:F||t}),O.jsx(HF,{className:"ml-2 h-4 w-4","data-slot":"date-picker-icon"})]})}),O.jsxs(Yw,{className:"w-auto p-0",align:"start","data-slot":"date-picker-content",children:[O.jsx(SL,{className:"border-none",mode:r,value:N,onChange:L,disabled:e.disabledDate}),O.jsx("div",{className:"p-2","data-slot":"date-picker-footer",children:Q()})]})]})},CL=e=>{const{className:t,orientation:r="horizontal"}=e;return O.jsx("hr",{...e,"aria-orientation":r,className:Fe("shrink-0 bg-input",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),"data-slot":"divider"})},pae=({onDrop:e,onError:t,allowedExtensions:r=[],maxFileSize:l=5*1024*1024,maxFiles:s=1/0})=>{const[c,h]=k.useState(!1),m=k.useCallback(R=>{R.preventDefault(),R.stopPropagation()},[]),b=k.useCallback(R=>{R.preventDefault(),R.stopPropagation(),h(!0)},[]),E=k.useCallback(R=>{R.preventDefault(),R.stopPropagation(),h(!1)},[]),C=R=>{const[M=[],q=[],N=[]]=R.reduce(([L,P,U],I)=>r.length>0&&!r.includes(I.type)?(L.push(I),U.push({file:I,errorMessage:"Extensión no permitida",errorCode:"INVALID_EXTENSION"}),[L,P,U]):I.size>l?(L.push(I),U.push({file:I,errorMessage:"Archivo demasiado grande",errorCode:"FILE_TOO_LARGE"}),[L,P,U]):s&&s<P.length+1?(L.push(I),U.push({file:I,errorMessage:"Límite de archivos excedido",errorCode:"MAX_FILES_EXCEEDED"}),[L,P,U]):(P.push(I),[L,P,U]),[[],[],[]]);return N.length>0&&t&&t(N),[M,q,N]},S=k.useCallback(R=>{R.preventDefault(),R.stopPropagation(),h(!1);const M=Array.from(R.dataTransfer.files),[q=[],N=[]]=C(M);e(N,q)},[r,l,s,e,t]);return{isDragActive:c,validateFiles:C,dropzoneProps:{onDragOver:m,onDragEnter:b,onDragLeave:E,onDrop:S}}},wL=k.createContext(null),BM=()=>{const e=k.useContext(wL);if(!e)throw new Error("useUploadContext must be used within a UploadContextProvider");return e},RL=({onFileAdd:e,onFileRemove:t,onChangeFiles:r,files:l,maxFiles:s=1,allowedExtensions:c=[],maxFileSize:h=5*1024*1024,multiple:m,children:b,onError:E,...C})=>{const[S=[],R]=br({defaultProp:[],prop:l,onChange:r}),[M,q]=k.useState([]),{isDragActive:N,validateFiles:L,dropzoneProps:P}=pae({onDrop:(Y,V)=>{R([...S,...Y]),q(F=>[...F,...V]),e?.(Y)},allowedExtensions:c,maxFileSize:h,maxFiles:s,onError:E}),U=Y=>{const[V=[],F=[]]=L(Y);if(s===1||!m){R(F.slice(0,1)),q([...V,...F.slice(1)]),e?.(F.slice(0,1));return}const K=s-S.length;if(K<=0){q(de=>[...de,...F]),e?.([]);return}const Q=F.slice(0,K),he=F.slice(K);R([...S,...Q]),q(de=>[...de,...V,...he]),e?.(Q)},I=(Y,V)=>{V==="accepted"?R(S.filter((F,K)=>K!==Y)):q(F=>F.filter((K,Q)=>Q!==Y)),t?.(Y,V)};return O.jsx(wL.Provider,{value:{files:S,rejectedFiles:M,handleFileAdd:U,handleFileRemove:I,inputProps:{accept:c.join(","),multiple:m},isDragActive:N,dropzoneProps:P},children:O.jsx("div",{...C,"data-slot":"upload",children:b})})},TL=({asChild:e,...t})=>{const{handleFileAdd:r,inputProps:l,dropzoneProps:s,isDragActive:c}=BM(),h=k.useRef(null),m=e?_w:"button";return O.jsxs(O.Fragment,{children:[O.jsx(m,{"data-slot":"upload-trigger",...t,...s,"data-drag-active":c||!1,onClick:b=>{t.onClick?.(b),h.current?.click()}}),O.jsx("input",{type:"file",className:"hidden","data-slot":"upload-input",...l,ref:h,onChange:b=>r(Array.from(b.target.files||[]))})]})},_L=({className:e,...t})=>O.jsx("div",{...t,className:Fe("mt-2 space-y-2",e),"data-slot":"upload-content"}),AL=({files:e,handleFileRemove:t,fileType:r,children:l,renderFile:s,...c})=>e.length===0?null:O.jsxs("div",{className:"mt-2 space-y-2",...c,"data-slot":"upload-files-list",children:[l,e.map((h,m)=>s?s(h,()=>t(m,r)):O.jsx(OL,{file:h,onRemove:()=>t(m,r)},h.name))]}),DL=e=>{const{files:t,handleFileRemove:r}=BM();return O.jsx(AL,{"data-slot":"upload-accepted-files",files:t,handleFileRemove:r,fileType:"accepted",...e})},ML=e=>{const{rejectedFiles:t,handleFileRemove:r}=BM();return O.jsx(AL,{"data-slot":"upload-rejected-files",files:t,handleFileRemove:r,fileType:"rejected",...e})},OL=({file:e,onRemove:t,className:r,renderIcon:l,...s})=>O.jsxs("div",{className:Fe("flex items-center gap-2 mb-2",r),...s,"data-slot":"upload-item",children:[l?.(e),e.name,O.jsx(hi,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6",onClick:t,"data-slot":"upload-item-remove",children:O.jsx(h_,{"data-slot":"upload-item-remove-icon"})})]}),hae=({onFileAdd:e,onFileRemove:t,onChangeFiles:r=()=>{},files:l,maxFiles:s=1,allowedExtensions:c=[],maxFileSize:h=5*1024*1024,multiple:m,renderAcceptedFile:b,renderRejectedFile:E,showRejected:C=!1,className:S,icon:R=sK,iconSize:M=40,onError:q,...N})=>{const L=k.useMemo(()=>c.map(P=>P.split("/")?.[1]).join(", "),[c]);return O.jsxs(RL,{onFileAdd:e,onFileRemove:t,files:l,onChangeFiles:r,maxFiles:s,allowedExtensions:c,maxFileSize:h,multiple:m?!0:void 0,className:Fe("w-full",S),onError:q,...N,children:[O.jsx(TL,{asChild:!0,children:O.jsxs("div",{className:Fe("w-full min-h-[150px] border-2 border-dashed rounded-lg border-muted p-4","hover:bg-muted/50 data-[drag-active=true]:border-primary data-[drag-active=true]:bg-primary/10","transition-colors flex flex-col items-center justify-center gap-4","pointer-events-auto"),children:[O.jsx(R,{className:"text-muted-foreground pointer-events-none",style:{width:M,height:M}}),O.jsxs("div",{className:"text-center text-muted-foreground pointer-events-none",children:[O.jsx("p",{children:"Arrastra y suelta archivos aquí o haz clic para seleccionar"}),c.length>0&&O.jsxs("p",{className:"text-sm",children:["Tipos permitidos: ",L]}),O.jsxs("p",{className:"text-sm",children:["Tamaño máximo: ",Math.floor(h/1024/1024),"MB"]})]})]})}),O.jsxs(_L,{children:[O.jsx(DL,{renderFile:b}),C&&O.jsx(ML,{renderFile:E})]})]})},sl={JPEG:"image/jpeg",JPG:"image/jpg",PNG:"image/png",GIF:"image/gif",WEBP:"image/webp",SVG:"image/svg+xml",PDF:"application/pdf",DOC:"application/msword",DOCX:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",XLS:"application/vnd.ms-excel",XLSX:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",PPT:"application/vnd.ms-powerpoint",PPTX:"application/vnd.openxmlformats-officedocument.presentationml.presentation",TXT:"text/plain",CSV:"text/csv",ZIP:"application/zip",RAR:"application/x-rar-compressed",MP3:"audio/mpeg",WAV:"audio/wav",MP4:"video/mp4",WEBM:"video/webm",JSON:"application/json",XML:"application/xml"},mae={IMAGES:[sl.JPEG,sl.JPG,sl.PNG,sl.GIF,sl.WEBP,sl.SVG],DOCUMENTS:[sl.PDF,sl.DOC,sl.DOCX,sl.XLS,sl.XLSX,sl.PPT,sl.PPTX],COMPRESSED:[sl.ZIP,sl.RAR],AUDIO:[sl.MP3,sl.WAV],VIDEO:[sl.MP4,sl.WEBM]},vae=$m([],{variants:{size:{sm:"text-[14px]",md:"text-[16px]",lg:"text-[18px]",xl:"text-[20px]","2xl":"text-[24px]","3xl":"text-[28px]","4xl":"text-[32px]","5xl":"text-[36px]","6xl":"text-[40px]"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{size:"xl",weight:"semibold"}}),NL=({className:e,size:t,weight:r,as:l,...s})=>{const c=l||"h2";return O.jsx(c,{className:Fe(vae({size:t,weight:r}),e),...s,"data-slot":"heading","data-size":t,"data-weight":r})},gae=({icon:e=O.jsx(mK,{className:"w-12 h-12"}),title:t="No hay resultados",description:r,className:l,children:s,...c})=>O.jsxs("div",{className:Fe("flex flex-col gap-2 justify-center items-center",l),"data-slot":"empty-state",...c,children:[O.jsx("div",{className:"text-muted-foreground","data-slot":"empty-state-icon",children:e}),O.jsx(NL,{className:"empty:hidden","data-slot":"empty-state-title",children:t}),O.jsx("p",{className:"py-1 text-sm text-center text-muted-foreground empty:hidden","data-slot":"empty-state-description",children:r}),s]}),yae=({label:e,labelClassName:t,labelProps:r,error:l,errorClassName:s,errorProps:c,children:h,className:m,...b})=>O.jsxs("div",{...b,className:Fe("flex flex-col gap-1",m),"data-slot":"field",children:[O.jsx($w,{className:Fe("empty:hidden",t),...r,"data-slot":"field-label",children:e}),h,O.jsx("p",{"data-slot":"field-error",className:Fe("text-sm font-medium text-error empty:hidden",s),...c,children:l})]});var Pw=e=>e.type==="checkbox",Gb=e=>e instanceof Date,Uu=e=>e==null;const $L=e=>typeof e=="object";var dl=e=>!Uu(e)&&!Array.isArray(e)&&$L(e)&&!Gb(e),PL=e=>dl(e)&&e.target?Pw(e.target)?e.target.checked:e.target.value:e,bae=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qL=(e,t)=>e.has(bae(t)),xae=e=>{const t=e.constructor&&e.constructor.prototype;return dl(t)&&t.hasOwnProperty("isPrototypeOf")},kM=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Hl(e){let t;const r=Array.isArray(e),l=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(kM&&(e instanceof Blob||l))&&(r||dl(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!xae(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Hl(e[s]));else return e;return t}var __=e=>/^\w*$/.test(e),Ta=e=>e===void 0,UM=e=>Array.isArray(e)?e.filter(Boolean):[],IM=e=>UM(e.replace(/["|']|\]/g,"").split(/\.|\[/)),dt=(e,t,r)=>{if(!t||!dl(e))return r;const l=(__(t)?[t]:IM(t)).reduce((s,c)=>Uu(s)?s:s[c],e);return Ta(l)||l===e?Ta(e[t])?r:e[t]:l},Es=e=>typeof e=="boolean",ir=(e,t,r)=>{let l=-1;const s=__(t)?[t]:IM(t),c=s.length,h=c-1;for(;++l<c;){const m=s[l];let b=r;if(l!==h){const E=e[m];b=dl(E)||Array.isArray(E)?E:isNaN(+s[l+1])?{}:[]}if(m==="__proto__"||m==="constructor"||m==="prototype")return;e[m]=b,e=e[m]}};const KT={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Qf={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Sm={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HM=k.createContext(null);HM.displayName="HookFormContext";const qw=()=>k.useContext(HM),Eae=e=>{const{children:t,...r}=e;return k.createElement(HM.Provider,{value:r},t)};var LL=(e,t,r,l=!0)=>{const s={defaultValues:t._defaultValues};for(const c in e)Object.defineProperty(s,c,{get:()=>{const h=c;return t._proxyFormState[h]!==Qf.all&&(t._proxyFormState[h]=!l||Qf.all),r&&(r[h]=!0),e[h]}});return s};const VM=typeof window<"u"?k.useLayoutEffect:k.useEffect;function Sae(e){const t=qw(),{control:r=t.control,disabled:l,name:s,exact:c}=e||{},[h,m]=k.useState(r._formState),b=k.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return VM(()=>r._subscribe({name:s,formState:b.current,exact:c,callback:E=>{!l&&m({...r._formState,...E})}}),[s,l,c]),k.useEffect(()=>{b.current.isValid&&r._setValid(!0)},[r]),k.useMemo(()=>LL(h,r,b.current,!1),[h,r])}var Cs=e=>typeof e=="string",R2=(e,t,r,l,s)=>Cs(e)?(l&&t.watch.add(e),dt(r,e,s)):Array.isArray(e)?e.map(c=>(l&&t.watch.add(c),dt(r,c))):(l&&(t.watchAll=!0),r),T2=e=>Uu(e)||!$L(e);function Zf(e,t,r=new WeakSet){if(T2(e)||T2(t))return Object.is(e,t);if(Gb(e)&&Gb(t))return e.getTime()===t.getTime();const l=Object.keys(e),s=Object.keys(t);if(l.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const c of l){const h=e[c];if(!s.includes(c))return!1;if(c!=="ref"){const m=t[c];if(Gb(h)&&Gb(m)||dl(h)&&dl(m)||Array.isArray(h)&&Array.isArray(m)?!Zf(h,m,r):!Object.is(h,m))return!1}}return!0}function Cae(e){const t=qw(),{control:r=t.control,name:l,defaultValue:s,disabled:c,exact:h,compute:m}=e||{},b=k.useRef(s),E=k.useRef(m),C=k.useRef(void 0),S=k.useRef(r),R=k.useRef(l);E.current=m;const[M,q]=k.useState(()=>{const Y=r._getWatch(l,b.current);return E.current?E.current(Y):Y}),N=k.useCallback(Y=>{const V=R2(l,r._names,Y||r._formValues,!1,b.current);return E.current?E.current(V):V},[r._formValues,r._names,l]),L=k.useCallback(Y=>{if(!c){const V=R2(l,r._names,Y||r._formValues,!1,b.current);if(E.current){const F=E.current(V);Zf(F,C.current)||(q(F),C.current=F)}else q(V)}},[r._formValues,r._names,c,l]);VM(()=>((S.current!==r||!Zf(R.current,l))&&(S.current=r,R.current=l,L()),r._subscribe({name:l,formState:{values:!0},exact:h,callback:Y=>{L(Y.values)}})),[r,h,l,L]),k.useEffect(()=>r._removeUnmounted());const P=S.current!==r,U=R.current,I=k.useMemo(()=>{if(c)return null;const Y=!P&&!Zf(U,l);return P||Y?N():null},[c,P,l,U,N]);return I!==null?I:M}function wae(e){const t=qw(),{name:r,disabled:l,control:s=t.control,shouldUnregister:c,defaultValue:h,exact:m=!0}=e,b=qL(s._names.array,r),E=k.useMemo(()=>dt(s._formValues,r,dt(s._defaultValues,r,h)),[s,r,h]),C=Cae({control:s,name:r,defaultValue:E,exact:m}),S=Sae({control:s,name:r,exact:m}),R=k.useRef(e),M=k.useRef(void 0),q=k.useRef(s.register(r,{...e.rules,value:C,...Es(e.disabled)?{disabled:e.disabled}:{}}));R.current=e;const N=k.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!dt(S.errors,r)},isDirty:{enumerable:!0,get:()=>!!dt(S.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!dt(S.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!dt(S.validatingFields,r)},error:{enumerable:!0,get:()=>dt(S.errors,r)}}),[S,r]),L=k.useCallback(Y=>q.current.onChange({target:{value:PL(Y),name:r},type:KT.CHANGE}),[r]),P=k.useCallback(()=>q.current.onBlur({target:{value:dt(s._formValues,r),name:r},type:KT.BLUR}),[r,s._formValues]),U=k.useCallback(Y=>{const V=dt(s._fields,r);V&&Y&&(V._f.ref={focus:()=>Y.focus&&Y.focus(),select:()=>Y.select&&Y.select(),setCustomValidity:F=>Y.setCustomValidity(F),reportValidity:()=>Y.reportValidity()})},[s._fields,r]),I=k.useMemo(()=>({name:r,value:C,...Es(l)||S.disabled?{disabled:S.disabled||l}:{},onChange:L,onBlur:P,ref:U}),[r,l,S.disabled,L,P,U,C]);return k.useEffect(()=>{const Y=s._options.shouldUnregister||c,V=M.current;V&&V!==r&&!b&&s.unregister(V),s.register(r,{...R.current.rules,...Es(R.current.disabled)?{disabled:R.current.disabled}:{}});const F=(K,Q)=>{const he=dt(s._fields,K);he&&he._f&&(he._f.mount=Q)};if(F(r,!0),Y){const K=Hl(dt(s._options.defaultValues,r,R.current.defaultValue));ir(s._defaultValues,r,K),Ta(dt(s._formValues,r))&&ir(s._formValues,r,K)}return!b&&s.register(r),M.current=r,()=>{(b?Y&&!s._state.action:Y)?s.unregister(r):F(r,!1)}},[r,s,b,c]),k.useEffect(()=>{s._setDisabledField({disabled:l,name:r})},[l,r,s]),k.useMemo(()=>({field:I,formState:S,fieldState:N}),[I,S,N])}const Rae=e=>e.render(wae(e));var FM=(e,t,r,l,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[l]:s||!0}}:{},lw=e=>Array.isArray(e)?e:[e],yP=()=>{let e=[];return{get observers(){return e},next:s=>{for(const c of e)c.next&&c.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(c=>c!==s)}}),unsubscribe:()=>{e=[]}}};function jL(e,t){const r={};for(const l in e)if(e.hasOwnProperty(l)){const s=e[l],c=t[l];if(s&&dl(s)&&c){const h=jL(s,c);dl(h)&&(r[l]=h)}else e[l]&&(r[l]=c)}return r}var tu=e=>dl(e)&&!Object.keys(e).length,KM=e=>e.type==="file",Wf=e=>typeof e=="function",GT=e=>{if(!kM)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},zL=e=>e.type==="select-multiple",GM=e=>e.type==="radio",Tae=e=>GM(e)||Pw(e),jD=e=>GT(e)&&e.isConnected;function _ae(e,t){const r=t.slice(0,-1).length;let l=0;for(;l<r;)e=Ta(e)?l++:e[t[l++]];return e}function Aae(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ta(e[t]))return!1;return!0}function cl(e,t){const r=Array.isArray(t)?t:__(t)?[t]:IM(t),l=r.length===1?e:_ae(e,r),s=r.length-1,c=r[s];return l&&delete l[c],s!==0&&(dl(l)&&tu(l)||Array.isArray(l)&&Aae(l))&&cl(e,r.slice(0,-1)),e}var Dae=e=>{for(const t in e)if(Wf(e[t]))return!0;return!1};function BL(e){return Array.isArray(e)||dl(e)&&!Dae(e)}function _2(e,t={}){for(const r in e){const l=e[r];BL(l)?(t[r]=Array.isArray(l)?[]:{},_2(l,t[r])):Ta(l)||(t[r]=!0)}return t}function L1(e,t,r){r||(r=_2(t));for(const l in e){const s=e[l];if(BL(s))Ta(t)||T2(r[l])?r[l]=_2(s,Array.isArray(s)?[]:{}):L1(s,Uu(t)?{}:t[l],r[l]);else{const c=t[l];r[l]=!Zf(s,c)}}return r}const bP={value:!1,isValid:!1},xP={value:!0,isValid:!0};var kL=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ta(e[0].attributes.value)?Ta(e[0].value)||e[0].value===""?xP:{value:e[0].value,isValid:!0}:xP:bP}return bP},UL=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:l})=>Ta(e)?e:t?e===""?NaN:e&&+e:r&&Cs(e)?new Date(e):l?l(e):e;const EP={isValid:!1,value:null};var IL=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,EP):EP;function SP(e){const t=e.ref;return KM(t)?t.files:GM(t)?IL(e.refs).value:zL(t)?[...t.selectedOptions].map(({value:r})=>r):Pw(t)?kL(e.refs).value:UL(Ta(t.value)?e.ref.value:t.value,e)}var Mae=(e,t,r,l)=>{const s={};for(const c of e){const h=dt(t,c);h&&ir(s,c,h._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:l}},YT=e=>e instanceof RegExp,QC=e=>Ta(e)?e:YT(e)?e.source:dl(e)?YT(e.value)?e.value.source:e.value:e,CP=e=>({isOnSubmit:!e||e===Qf.onSubmit,isOnBlur:e===Qf.onBlur,isOnChange:e===Qf.onChange,isOnAll:e===Qf.all,isOnTouch:e===Qf.onTouched});const wP="AsyncFunction";var Oae=e=>!!e&&!!e.validate&&!!(Wf(e.validate)&&e.validate.constructor.name===wP||dl(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===wP)),Nae=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),RP=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(l=>e.startsWith(l)&&/^\.\w+/.test(e.slice(l.length))));const ow=(e,t,r,l)=>{for(const s of r||Object.keys(e)){const c=dt(e,s);if(c){const{_f:h,...m}=c;if(h){if(h.refs&&h.refs[0]&&t(h.refs[0],s)&&!l)return!0;if(h.ref&&t(h.ref,h.name)&&!l)return!0;if(ow(m,t))break}else if(dl(m)&&ow(m,t))break}}};function TP(e,t,r){const l=dt(e,r);if(l||__(r))return{error:l,name:r};const s=r.split(".");for(;s.length;){const c=s.join("."),h=dt(t,c),m=dt(e,c);if(h&&!Array.isArray(h)&&r!==c)return{name:r};if(m&&m.type)return{name:c,error:m};if(m&&m.root&&m.root.type)return{name:`${c}.root`,error:m.root};s.pop()}return{name:r}}var $ae=(e,t,r,l)=>{r(e);const{name:s,...c}=e;return tu(c)||Object.keys(c).length>=Object.keys(t).length||Object.keys(c).find(h=>t[h]===(!l||Qf.all))},Pae=(e,t,r)=>!e||!t||e===t||lw(e).some(l=>l&&(r?l===t:l.startsWith(t)||t.startsWith(l))),qae=(e,t,r,l,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?l.isOnBlur:s.isOnBlur)?!e:(r?l.isOnChange:s.isOnChange)?e:!0,Lae=(e,t)=>!UM(dt(e,t)).length&&cl(e,t),jae=(e,t,r)=>{const l=lw(dt(e,r));return ir(l,"root",t[r]),ir(e,r,l),e};function _P(e,t,r="validate"){if(Cs(e)||Array.isArray(e)&&e.every(Cs)||Es(e)&&!e)return{type:r,message:Cs(e)?e:"",ref:t}}var M1=e=>dl(e)&&!YT(e)?e:{value:e,message:""},AP=async(e,t,r,l,s,c)=>{const{ref:h,refs:m,required:b,maxLength:E,minLength:C,min:S,max:R,pattern:M,validate:q,name:N,valueAsNumber:L,mount:P}=e._f,U=dt(r,N);if(!P||t.has(N))return{};const I=m?m[0]:h,Y=se=>{s&&I.reportValidity&&(I.setCustomValidity(Es(se)?"":se||""),I.reportValidity())},V={},F=GM(h),K=Pw(h),Q=F||K,he=(L||KM(h))&&Ta(h.value)&&Ta(U)||GT(h)&&h.value===""||U===""||Array.isArray(U)&&!U.length,de=FM.bind(null,N,l,V),W=(se,le,ae,xe=Sm.maxLength,B=Sm.minLength)=>{const Z=se?le:ae;V[N]={type:se?xe:B,message:Z,ref:h,...de(se?xe:B,Z)}};if(c?!Array.isArray(U)||!U.length:b&&(!Q&&(he||Uu(U))||Es(U)&&!U||K&&!kL(m).isValid||F&&!IL(m).isValid)){const{value:se,message:le}=Cs(b)?{value:!!b,message:b}:M1(b);if(se&&(V[N]={type:Sm.required,message:le,ref:I,...de(Sm.required,le)},!l))return Y(le),V}if(!he&&(!Uu(S)||!Uu(R))){let se,le;const ae=M1(R),xe=M1(S);if(!Uu(U)&&!isNaN(U)){const B=h.valueAsNumber||U&&+U;Uu(ae.value)||(se=B>ae.value),Uu(xe.value)||(le=B<xe.value)}else{const B=h.valueAsDate||new Date(U),Z=re=>new Date(new Date().toDateString()+" "+re),te=h.type=="time",be=h.type=="week";Cs(ae.value)&&U&&(se=te?Z(U)>Z(ae.value):be?U>ae.value:B>new Date(ae.value)),Cs(xe.value)&&U&&(le=te?Z(U)<Z(xe.value):be?U<xe.value:B<new Date(xe.value))}if((se||le)&&(W(!!se,ae.message,xe.message,Sm.max,Sm.min),!l))return Y(V[N].message),V}if((E||C)&&!he&&(Cs(U)||c&&Array.isArray(U))){const se=M1(E),le=M1(C),ae=!Uu(se.value)&&U.length>+se.value,xe=!Uu(le.value)&&U.length<+le.value;if((ae||xe)&&(W(ae,se.message,le.message),!l))return Y(V[N].message),V}if(M&&!he&&Cs(U)){const{value:se,message:le}=M1(M);if(YT(se)&&!U.match(se)&&(V[N]={type:Sm.pattern,message:le,ref:h,...de(Sm.pattern,le)},!l))return Y(le),V}if(q){if(Wf(q)){const se=await q(U,r),le=_P(se,I);if(le&&(V[N]={...le,...de(Sm.validate,le.message)},!l))return Y(le.message),V}else if(dl(q)){let se={};for(const le in q){if(!tu(se)&&!l)break;const ae=_P(await q[le](U,r),I,le);ae&&(se={...ae,...de(le,ae.message)},Y(ae.message),l&&(V[N]=se))}if(!tu(se)&&(V[N]={ref:I,...se},!l))return V}}return Y(!0),V};const zae={mode:Qf.onSubmit,reValidateMode:Qf.onChange,shouldFocusError:!0};function Bae(e={}){let t={...zae,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Wf(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},l={},s=dl(t.defaultValues)||dl(t.values)?Hl(t.defaultValues||t.values)||{}:{},c=t.shouldUnregister?{}:Hl(s),h={action:!1,mount:!1,watch:!1},m={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},b,E=0;const C={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let S={...C};const R={array:yP(),state:yP()},M=t.criteriaMode===Qf.all,q=pe=>$e=>{clearTimeout(E),E=setTimeout(pe,$e)},N=async pe=>{if(!t.disabled&&(C.isValid||S.isValid||pe)){const $e=t.resolver?tu((await K()).errors):await he(l,!0);$e!==r.isValid&&R.state.next({isValid:$e})}},L=(pe,$e)=>{!t.disabled&&(C.isValidating||C.validatingFields||S.isValidating||S.validatingFields)&&((pe||Array.from(m.mount)).forEach(Ve=>{Ve&&($e?ir(r.validatingFields,Ve,$e):cl(r.validatingFields,Ve))}),R.state.next({validatingFields:r.validatingFields,isValidating:!tu(r.validatingFields)}))},P=(pe,$e=[],Ve,st,rt=!0,at=!0)=>{if(st&&Ve&&!t.disabled){if(h.action=!0,at&&Array.isArray(dt(l,pe))){const bt=Ve(dt(l,pe),st.argA,st.argB);rt&&ir(l,pe,bt)}if(at&&Array.isArray(dt(r.errors,pe))){const bt=Ve(dt(r.errors,pe),st.argA,st.argB);rt&&ir(r.errors,pe,bt),Lae(r.errors,pe)}if((C.touchedFields||S.touchedFields)&&at&&Array.isArray(dt(r.touchedFields,pe))){const bt=Ve(dt(r.touchedFields,pe),st.argA,st.argB);rt&&ir(r.touchedFields,pe,bt)}(C.dirtyFields||S.dirtyFields)&&(r.dirtyFields=L1(s,c)),R.state.next({name:pe,isDirty:W(pe,$e),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ir(c,pe,$e)},U=(pe,$e)=>{ir(r.errors,pe,$e),R.state.next({errors:r.errors})},I=pe=>{r.errors=pe,R.state.next({errors:r.errors,isValid:!1})},Y=(pe,$e,Ve,st)=>{const rt=dt(l,pe);if(rt){const at=dt(c,pe,Ta(Ve)?dt(s,pe):Ve);Ta(at)||st&&st.defaultChecked||$e?ir(c,pe,$e?at:SP(rt._f)):ae(pe,at),h.mount&&!h.action&&N()}},V=(pe,$e,Ve,st,rt)=>{let at=!1,bt=!1;const Wt={name:pe};if(!t.disabled){if(!Ve||st){(C.isDirty||S.isDirty)&&(bt=r.isDirty,r.isDirty=Wt.isDirty=W(),at=bt!==Wt.isDirty);const Yt=Zf(dt(s,pe),$e);bt=!!dt(r.dirtyFields,pe),Yt?cl(r.dirtyFields,pe):ir(r.dirtyFields,pe,!0),Wt.dirtyFields=r.dirtyFields,at=at||(C.dirtyFields||S.dirtyFields)&&bt!==!Yt}if(Ve){const Yt=dt(r.touchedFields,pe);Yt||(ir(r.touchedFields,pe,Ve),Wt.touchedFields=r.touchedFields,at=at||(C.touchedFields||S.touchedFields)&&Yt!==Ve)}at&&rt&&R.state.next(Wt)}return at?Wt:{}},F=(pe,$e,Ve,st)=>{const rt=dt(r.errors,pe),at=(C.isValid||S.isValid)&&Es($e)&&r.isValid!==$e;if(t.delayError&&Ve?(b=q(()=>U(pe,Ve)),b(t.delayError)):(clearTimeout(E),b=null,Ve?ir(r.errors,pe,Ve):cl(r.errors,pe)),(Ve?!Zf(rt,Ve):rt)||!tu(st)||at){const bt={...st,...at&&Es($e)?{isValid:$e}:{},errors:r.errors,name:pe};r={...r,...bt},R.state.next(bt)}},K=async pe=>{L(pe,!0);const $e=await t.resolver(c,t.context,Mae(pe||m.mount,l,t.criteriaMode,t.shouldUseNativeValidation));return L(pe),$e},Q=async pe=>{const{errors:$e}=await K(pe);if(pe)for(const Ve of pe){const st=dt($e,Ve);st?ir(r.errors,Ve,st):cl(r.errors,Ve)}else r.errors=$e;return $e},he=async(pe,$e,Ve={valid:!0})=>{for(const st in pe){const rt=pe[st];if(rt){const{_f:at,...bt}=rt;if(at){const Wt=m.array.has(at.name),Yt=rt._f&&Oae(rt._f);Yt&&C.validatingFields&&L([at.name],!0);const ya=await AP(rt,m.disabled,c,M,t.shouldUseNativeValidation&&!$e,Wt);if(Yt&&C.validatingFields&&L([at.name]),ya[at.name]&&(Ve.valid=!1,$e))break;!$e&&(dt(ya,at.name)?Wt?jae(r.errors,ya,at.name):ir(r.errors,at.name,ya[at.name]):cl(r.errors,at.name))}!tu(bt)&&await he(bt,$e,Ve)}}return Ve.valid},de=()=>{for(const pe of m.unMount){const $e=dt(l,pe);$e&&($e._f.refs?$e._f.refs.every(Ve=>!jD(Ve)):!jD($e._f.ref))&&_e(pe)}m.unMount=new Set},W=(pe,$e)=>!t.disabled&&(pe&&$e&&ir(c,pe,$e),!Zf(re(),s)),se=(pe,$e,Ve)=>R2(pe,m,{...h.mount?c:Ta($e)?s:Cs(pe)?{[pe]:$e}:$e},Ve,$e),le=pe=>UM(dt(h.mount?c:s,pe,t.shouldUnregister?dt(s,pe,[]):[])),ae=(pe,$e,Ve={})=>{const st=dt(l,pe);let rt=$e;if(st){const at=st._f;at&&(!at.disabled&&ir(c,pe,UL($e,at)),rt=GT(at.ref)&&Uu($e)?"":$e,zL(at.ref)?[...at.ref.options].forEach(bt=>bt.selected=rt.includes(bt.value)):at.refs?Pw(at.ref)?at.refs.forEach(bt=>{(!bt.defaultChecked||!bt.disabled)&&(Array.isArray(rt)?bt.checked=!!rt.find(Wt=>Wt===bt.value):bt.checked=rt===bt.value||!!rt)}):at.refs.forEach(bt=>bt.checked=bt.value===rt):KM(at.ref)?at.ref.value="":(at.ref.value=rt,at.ref.type||R.state.next({name:pe,values:Hl(c)})))}(Ve.shouldDirty||Ve.shouldTouch)&&V(pe,rt,Ve.shouldTouch,Ve.shouldDirty,!0),Ve.shouldValidate&&be(pe)},xe=(pe,$e,Ve)=>{for(const st in $e){if(!$e.hasOwnProperty(st))return;const rt=$e[st],at=pe+"."+st,bt=dt(l,at);(m.array.has(pe)||dl(rt)||bt&&!bt._f)&&!Gb(rt)?xe(at,rt,Ve):ae(at,rt,Ve)}},B=(pe,$e,Ve={})=>{const st=dt(l,pe),rt=m.array.has(pe),at=Hl($e);ir(c,pe,at),rt?(R.array.next({name:pe,values:Hl(c)}),(C.isDirty||C.dirtyFields||S.isDirty||S.dirtyFields)&&Ve.shouldDirty&&R.state.next({name:pe,dirtyFields:L1(s,c),isDirty:W(pe,at)})):st&&!st._f&&!Uu(at)?xe(pe,at,Ve):ae(pe,at,Ve),RP(pe,m)&&R.state.next({...r,name:pe}),R.state.next({name:h.mount?pe:void 0,values:Hl(c)})},Z=async pe=>{h.mount=!0;const $e=pe.target;let Ve=$e.name,st=!0;const rt=dt(l,Ve),at=Yt=>{st=Number.isNaN(Yt)||Gb(Yt)&&isNaN(Yt.getTime())||Zf(Yt,dt(c,Ve,Yt))},bt=CP(t.mode),Wt=CP(t.reValidateMode);if(rt){let Yt,ya;const Qo=$e.type?SP(rt._f):PL(pe),pl=pe.type===KT.BLUR||pe.type===KT.FOCUS_OUT,Ms=!Nae(rt._f)&&!t.resolver&&!dt(r.errors,Ve)&&!rt._f.deps||qae(pl,dt(r.touchedFields,Ve),r.isSubmitted,Wt,bt),hl=RP(Ve,m,pl);ir(c,Ve,Qo),pl?(!$e||!$e.readOnly)&&(rt._f.onBlur&&rt._f.onBlur(pe),b&&b(0)):rt._f.onChange&&rt._f.onChange(pe);const Mr=V(Ve,Qo,pl),ml=!tu(Mr)||hl;if(!pl&&R.state.next({name:Ve,type:pe.type,values:Hl(c)}),Ms)return(C.isValid||S.isValid)&&(t.mode==="onBlur"?pl&&N():pl||N()),ml&&R.state.next({name:Ve,...hl?{}:Mr});if(!pl&&hl&&R.state.next({...r}),t.resolver){const{errors:Or}=await K([Ve]);if(at(Qo),st){const Os=TP(r.errors,l,Ve),kc=TP(Or,l,Os.name||Ve);Yt=kc.error,Ve=kc.name,ya=tu(Or)}}else L([Ve],!0),Yt=(await AP(rt,m.disabled,c,M,t.shouldUseNativeValidation))[Ve],L([Ve]),at(Qo),st&&(Yt?ya=!1:(C.isValid||S.isValid)&&(ya=await he(l,!0)));st&&(rt._f.deps&&(!Array.isArray(rt._f.deps)||rt._f.deps.length>0)&&be(rt._f.deps),F(Ve,ya,Yt,Mr))}},te=(pe,$e)=>{if(dt(r.errors,$e)&&pe.focus)return pe.focus(),1},be=async(pe,$e={})=>{let Ve,st;const rt=lw(pe);if(t.resolver){const at=await Q(Ta(pe)?pe:rt);Ve=tu(at),st=pe?!rt.some(bt=>dt(at,bt)):Ve}else pe?(st=(await Promise.all(rt.map(async at=>{const bt=dt(l,at);return await he(bt&&bt._f?{[at]:bt}:bt)}))).every(Boolean),!(!st&&!r.isValid)&&N()):st=Ve=await he(l);return R.state.next({...!Cs(pe)||(C.isValid||S.isValid)&&Ve!==r.isValid?{}:{name:pe},...t.resolver||!pe?{isValid:Ve}:{},errors:r.errors}),$e.shouldFocus&&!st&&ow(l,te,pe?rt:m.mount),st},re=(pe,$e)=>{let Ve={...h.mount?c:s};return $e&&(Ve=jL($e.dirtyFields?r.dirtyFields:r.touchedFields,Ve)),Ta(pe)?Ve:Cs(pe)?dt(Ve,pe):pe.map(st=>dt(Ve,st))},oe=(pe,$e)=>({invalid:!!dt(($e||r).errors,pe),isDirty:!!dt(($e||r).dirtyFields,pe),error:dt(($e||r).errors,pe),isValidating:!!dt(r.validatingFields,pe),isTouched:!!dt(($e||r).touchedFields,pe)}),ue=pe=>{pe&&lw(pe).forEach($e=>cl(r.errors,$e)),R.state.next({errors:pe?r.errors:{}})},ce=(pe,$e,Ve)=>{const st=(dt(l,pe,{_f:{}})._f||{}).ref,rt=dt(r.errors,pe)||{},{ref:at,message:bt,type:Wt,...Yt}=rt;ir(r.errors,pe,{...Yt,...$e,ref:st}),R.state.next({name:pe,errors:r.errors,isValid:!1}),Ve&&Ve.shouldFocus&&st&&st.focus&&st.focus()},De=(pe,$e)=>Wf(pe)?R.state.subscribe({next:Ve=>"values"in Ve&&pe(se(void 0,$e),Ve)}):se(pe,$e,!0),je=pe=>R.state.subscribe({next:$e=>{Pae(pe.name,$e.name,pe.exact)&&$ae($e,pe.formState||C,Kn,pe.reRenderRoot)&&pe.callback({values:{...c},...r,...$e,defaultValues:s})}}).unsubscribe,Ke=pe=>(h.mount=!0,S={...S,...pe.formState},je({...pe,formState:S})),_e=(pe,$e={})=>{for(const Ve of pe?lw(pe):m.mount)m.mount.delete(Ve),m.array.delete(Ve),$e.keepValue||(cl(l,Ve),cl(c,Ve)),!$e.keepError&&cl(r.errors,Ve),!$e.keepDirty&&cl(r.dirtyFields,Ve),!$e.keepTouched&&cl(r.touchedFields,Ve),!$e.keepIsValidating&&cl(r.validatingFields,Ve),!t.shouldUnregister&&!$e.keepDefaultValue&&cl(s,Ve);R.state.next({values:Hl(c)}),R.state.next({...r,...$e.keepDirty?{isDirty:W()}:{}}),!$e.keepIsValid&&N()},Je=({disabled:pe,name:$e})=>{(Es(pe)&&h.mount||pe||m.disabled.has($e))&&(pe?m.disabled.add($e):m.disabled.delete($e))},ie=(pe,$e={})=>{let Ve=dt(l,pe);const st=Es($e.disabled)||Es(t.disabled);return ir(l,pe,{...Ve||{},_f:{...Ve&&Ve._f?Ve._f:{ref:{name:pe}},name:pe,mount:!0,...$e}}),m.mount.add(pe),Ve?Je({disabled:Es($e.disabled)?$e.disabled:t.disabled,name:pe}):Y(pe,!0,$e.value),{...st?{disabled:$e.disabled||t.disabled}:{},...t.progressive?{required:!!$e.required,min:QC($e.min),max:QC($e.max),minLength:QC($e.minLength),maxLength:QC($e.maxLength),pattern:QC($e.pattern)}:{},name:pe,onChange:Z,onBlur:Z,ref:rt=>{if(rt){ie(pe,$e),Ve=dt(l,pe);const at=Ta(rt.value)&&rt.querySelectorAll&&rt.querySelectorAll("input,select,textarea")[0]||rt,bt=Tae(at),Wt=Ve._f.refs||[];if(bt?Wt.find(Yt=>Yt===at):at===Ve._f.ref)return;ir(l,pe,{_f:{...Ve._f,...bt?{refs:[...Wt.filter(jD),at,...Array.isArray(dt(s,pe))?[{}]:[]],ref:{type:at.type,name:pe}}:{ref:at}}}),Y(pe,!1,void 0,at)}else Ve=dt(l,pe,{}),Ve._f&&(Ve._f.mount=!1),(t.shouldUnregister||$e.shouldUnregister)&&!(qL(m.array,pe)&&h.action)&&m.unMount.add(pe)}}},ke=()=>t.shouldFocusError&&ow(l,te,m.mount),Ee=pe=>{Es(pe)&&(R.state.next({disabled:pe}),ow(l,($e,Ve)=>{const st=dt(l,Ve);st&&($e.disabled=st._f.disabled||pe,Array.isArray(st._f.refs)&&st._f.refs.forEach(rt=>{rt.disabled=st._f.disabled||pe}))},0,!1))},Ae=(pe,$e)=>async Ve=>{let st;Ve&&(Ve.preventDefault&&Ve.preventDefault(),Ve.persist&&Ve.persist());let rt=Hl(c);if(R.state.next({isSubmitting:!0}),t.resolver){const{errors:at,values:bt}=await K();r.errors=at,rt=Hl(bt)}else await he(l);if(m.disabled.size)for(const at of m.disabled)cl(rt,at);if(cl(r.errors,"root"),tu(r.errors)){R.state.next({errors:{}});try{await pe(rt,Ve)}catch(at){st=at}}else $e&&await $e({...r.errors},Ve),ke(),setTimeout(ke);if(R.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:tu(r.errors)&&!st,submitCount:r.submitCount+1,errors:r.errors}),st)throw st},ot=(pe,$e={})=>{dt(l,pe)&&(Ta($e.defaultValue)?B(pe,Hl(dt(s,pe))):(B(pe,$e.defaultValue),ir(s,pe,Hl($e.defaultValue))),$e.keepTouched||cl(r.touchedFields,pe),$e.keepDirty||(cl(r.dirtyFields,pe),r.isDirty=$e.defaultValue?W(pe,Hl(dt(s,pe))):W()),$e.keepError||(cl(r.errors,pe),C.isValid&&N()),R.state.next({...r}))},vt=(pe,$e={})=>{const Ve=pe?Hl(pe):s,st=Hl(Ve),rt=tu(pe),at=rt?s:st;if($e.keepDefaultValues||(s=Ve),!$e.keepValues){if($e.keepDirtyValues){const bt=new Set([...m.mount,...Object.keys(L1(s,c))]);for(const Wt of Array.from(bt))dt(r.dirtyFields,Wt)?ir(at,Wt,dt(c,Wt)):B(Wt,dt(at,Wt))}else{if(kM&&Ta(pe))for(const bt of m.mount){const Wt=dt(l,bt);if(Wt&&Wt._f){const Yt=Array.isArray(Wt._f.refs)?Wt._f.refs[0]:Wt._f.ref;if(GT(Yt)){const ya=Yt.closest("form");if(ya){ya.reset();break}}}}if($e.keepFieldsRef)for(const bt of m.mount)B(bt,dt(at,bt));else l={}}c=t.shouldUnregister?$e.keepDefaultValues?Hl(s):{}:Hl(at),R.array.next({values:{...at}}),R.state.next({values:{...at}})}m={mount:$e.keepDirtyValues?m.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},h.mount=!C.isValid||!!$e.keepIsValid||!!$e.keepDirtyValues||!t.shouldUnregister&&!tu(at),h.watch=!!t.shouldUnregister,h.action=!1,$e.keepErrors||(r.errors={}),R.state.next({submitCount:$e.keepSubmitCount?r.submitCount:0,isDirty:rt?!1:$e.keepDirty?r.isDirty:!!($e.keepDefaultValues&&!Zf(pe,s)),isSubmitted:$e.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:rt?{}:$e.keepDirtyValues?$e.keepDefaultValues&&c?L1(s,c):r.dirtyFields:$e.keepDefaultValues&&pe?L1(s,pe):$e.keepDirty?r.dirtyFields:{},touchedFields:$e.keepTouched?r.touchedFields:{},errors:$e.keepErrors?r.errors:{},isSubmitSuccessful:$e.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Xt=(pe,$e)=>vt(Wf(pe)?pe(c):pe,$e),Nt=(pe,$e={})=>{const Ve=dt(l,pe),st=Ve&&Ve._f;if(st){const rt=st.refs?st.refs[0]:st.ref;rt.focus&&(rt.focus(),$e.shouldSelect&&Wf(rt.select)&&rt.select())}},Kn=pe=>{r={...r,...pe}},Ds={control:{register:ie,unregister:_e,getFieldState:oe,handleSubmit:Ae,setError:ce,_subscribe:je,_runSchema:K,_focusError:ke,_getWatch:se,_getDirty:W,_setValid:N,_setFieldArray:P,_setDisabledField:Je,_setErrors:I,_getFieldArray:le,_reset:vt,_resetDefaultValues:()=>Wf(t.defaultValues)&&t.defaultValues().then(pe=>{Xt(pe,t.resetOptions),R.state.next({isLoading:!1})}),_removeUnmounted:de,_disableForm:Ee,_subjects:R,_proxyFormState:C,get _fields(){return l},get _formValues(){return c},get _state(){return h},set _state(pe){h=pe},get _defaultValues(){return s},get _names(){return m},set _names(pe){m=pe},get _formState(){return r},get _options(){return t},set _options(pe){t={...t,...pe}}},subscribe:Ke,trigger:be,register:ie,handleSubmit:Ae,watch:De,setValue:B,getValues:re,reset:Xt,resetField:ot,clearErrors:ue,unregister:_e,setError:ce,setFocus:Nt,getFieldState:oe};return{...Ds,formControl:Ds}}function kae(e={}){const t=k.useRef(void 0),r=k.useRef(void 0),[l,s]=k.useState({isDirty:!1,isValidating:!1,isLoading:Wf(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Wf(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:l},e.defaultValues&&!Wf(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:h,...m}=Bae(e);t.current={...m,formState:l}}const c=t.current.control;return c._options=e,VM(()=>{const h=c._subscribe({formState:c._proxyFormState,callback:()=>s({...c._formState}),reRenderRoot:!0});return s(m=>({...m,isReady:!0})),c._formState.isReady=!0,h},[c]),k.useEffect(()=>c._disableForm(e.disabled),[c,e.disabled]),k.useEffect(()=>{e.mode&&(c._options.mode=e.mode),e.reValidateMode&&(c._options.reValidateMode=e.reValidateMode)},[c,e.mode,e.reValidateMode]),k.useEffect(()=>{e.errors&&(c._setErrors(e.errors),c._focusError())},[c,e.errors]),k.useEffect(()=>{e.shouldUnregister&&c._subjects.state.next({values:c._getWatch()})},[c,e.shouldUnregister]),k.useEffect(()=>{if(c._proxyFormState.isDirty){const h=c._getDirty();h!==l.isDirty&&c._subjects.state.next({isDirty:h})}},[c,l.isDirty]),k.useEffect(()=>{var h;e.values&&!Zf(e.values,r.current)?(c._reset(e.values,{keepFieldsRef:!0,...c._options.resetOptions}),!((h=c._options.resetOptions)===null||h===void 0)&&h.keepIsValid||c._setValid(),r.current=e.values,s(m=>({...m}))):c._resetDefaultValues()},[c,e.values]),k.useEffect(()=>{c._state.mount||(c._setValid(),c._state.mount=!0),c._state.watch&&(c._state.watch=!1,c._subjects.state.next({...c._formState})),c._removeUnmounted()}),t.current.formState=LL(l,c),t.current}const[Uae,Iae]=Mw(),[Hae,Vae]=Mw(),Lw=()=>{const e=Hae(),t=Uae(),{getFieldState:r,formState:l}=qw();if(!e)throw new Error("useFormField should be used within <FormField>");const s=r(e.name,l),{id:c}=t;return{id:c,name:e.name,formItemId:`${c}-form-item`,formDescriptionId:`${c}-form-item-description`,formMessageId:`${c}-form-item-message`,...s}},Fae=({onSubmit:e,id:t,form:r,children:l,className:s})=>O.jsx(Eae,{...r,children:O.jsx("form",{id:t,onSubmit:r.handleSubmit(e),className:s,"data-slot":"form",children:l})}),Kae=({name:e,label:t,description:r,className:l,render:s,itemProps:c,labelProps:h,controlProps:m,descriptionProps:b,messageProps:E})=>{const{control:C}=qw();return O.jsx(Vae,{value:{name:e},children:O.jsx(Rae,{name:e,control:C,render:({field:S,fieldState:R})=>O.jsxs(HL,{className:l,...c,children:[t&&O.jsx(VL,{...h,children:t}),O.jsx(FL,{...m,children:sr.isFunction(s)?s(S):D.createElement(s,S)}),r&&O.jsx(KL,{...b,children:r}),O.jsx(GL,{...E,children:R.error?.message})]})})})},HL=({className:e,...t})=>{const r=D.useId();return O.jsx(Iae,{value:{id:r},children:O.jsx("div",{className:Fe("flex flex-col gap-2",e),"data-slot":"form-item",...t})})},VL=({className:e,...t})=>{const{error:r,formItemId:l}=Lw();return O.jsx($w,{className:Fe(r&&"text-error",e),htmlFor:l,...t})},FL=({className:e,...t})=>{const{error:r,formItemId:l,formDescriptionId:s,formMessageId:c}=Lw();return O.jsx(_w,{id:l,"aria-describedby":r?`${s} ${c}`:`${s}`,"aria-invalid":!!r,className:Fe("group",e),...t})},KL=({className:e,...t})=>{const{formDescriptionId:r}=Lw();return O.jsx("p",{id:r,className:Fe("text-sm text-muted-foreground",e),"data-slot":"form-description",...t})},GL=({className:e,children:t,...r})=>{const{error:l,formMessageId:s}=Lw(),c=l?String(l?.message):t;return c?O.jsx("p",{id:s,className:Fe("text-sm font-medium text-error",e),"data-slot":"form-message",...r,children:c}):null},DP=(e,t,r)=>{if(e&&"reportValidity"in e){const l=dt(r,t);e.setCustomValidity(l&&l.message||""),e.reportValidity()}},A2=(e,t)=>{for(const r in t.fields){const l=t.fields[r];l&&l.ref&&"reportValidity"in l.ref?DP(l.ref,r,e):l&&l.refs&&l.refs.forEach(s=>DP(s,r,e))}},MP=(e,t)=>{t.shouldUseNativeValidation&&A2(e,t);const r={};for(const l in e){const s=dt(t.fields,l),c=Object.assign(e[l]||{},{ref:s&&s.ref});if(Gae(t.names||Object.keys(e),l)){const h=Object.assign({},dt(r,l));ir(h,"root",c),ir(r,l,h)}else ir(r,l,c)}return r},Gae=(e,t)=>{const r=OP(t);return e.some(l=>OP(l).match(`^${r}\\.\\d+`))};function OP(e){return e.replace(/\]|\[/g,"")}function YL(e,t,r){function l(m,b){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:b,constr:h,traits:new Set},enumerable:!1}),m._zod.traits.has(e))return;m._zod.traits.add(e),t(m,b);const E=h.prototype,C=Object.keys(E);for(let S=0;S<C.length;S++){const R=C[S];R in m||(m[R]=E[R].bind(m))}}const s=r?.Parent??Object;class c extends s{}Object.defineProperty(c,"name",{value:e});function h(m){var b;const E=r?.Parent?new c:this;l(E,m),(b=E._zod).deferred??(b.deferred=[]);for(const C of E._zod.deferred)C();return E}return Object.defineProperty(h,"init",{value:l}),Object.defineProperty(h,Symbol.hasInstance,{value:m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(h,"name",{value:e}),h}class Yae extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Xae={};function XL(e){return Xae}function Qae(e,t){return typeof t=="bigint"?t.toString():t}const QL="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function mT(e){return typeof e=="string"?e:e?.message}function ZL(e,t,r){const l={...e,path:e.path??[]};if(!e.message){const s=mT(e.inst?._zod.def?.error?.(e))??mT(t?.error?.(e))??mT(r.customError?.(e))??mT(r.localeError?.(e))??"Invalid input";l.message=s}return delete l.inst,delete l.continue,t?.reportInput||delete l.input,l}const WL=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Qae,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Zae=YL("$ZodError",WL),JL=YL("$ZodError",WL,{Parent:Error}),Wae=e=>(t,r,l,s)=>{const c=l?Object.assign(l,{async:!1}):{async:!1},h=t._zod.run({value:r,issues:[]},c);if(h instanceof Promise)throw new Yae;if(h.issues.length){const m=new(s?.Err??e)(h.issues.map(b=>ZL(b,c,XL())));throw QL(m,s?.callee),m}return h.value},Jae=Wae(JL),ele=e=>async(t,r,l,s)=>{const c=l?Object.assign(l,{async:!0}):{async:!0};let h=t._zod.run({value:r,issues:[]},c);if(h instanceof Promise&&(h=await h),h.issues.length){const m=new(s?.Err??e)(h.issues.map(b=>ZL(b,c,XL())));throw QL(m,s?.callee),m}return h.value},tle=ele(JL);function NP(e,t){try{var r=e()}catch(l){return t(l)}return r&&r.then?r.then(void 0,t):r}function nle(e,t){for(var r={};e.length;){var l=e[0],s=l.code,c=l.message,h=l.path.join(".");if(!r[h])if("unionErrors"in l){var m=l.unionErrors[0].errors[0];r[h]={message:m.message,type:m.code}}else r[h]={message:c,type:s};if("unionErrors"in l&&l.unionErrors.forEach(function(C){return C.errors.forEach(function(S){return e.push(S)})}),t){var b=r[h].types,E=b&&b[l.code];r[h]=FM(h,t,r,s,E?[].concat(E,l.message):l.message)}e.shift()}return r}function rle(e,t){for(var r={};e.length;){var l=e[0],s=l.code,c=l.message,h=l.path.join(".");if(!r[h])if(l.code==="invalid_union"&&l.errors.length>0){var m=l.errors[0][0];r[h]={message:m.message,type:m.code}}else r[h]={message:c,type:s};if(l.code==="invalid_union"&&l.errors.forEach(function(C){return C.forEach(function(S){return e.push(S)})}),t){var b=r[h].types,E=b&&b[l.code];r[h]=FM(h,t,r,s,E?[].concat(E,l.message):l.message)}e.shift()}return r}function ale(e,t,r){if(r===void 0&&(r={}),(function(l){return"_def"in l&&typeof l._def=="object"&&"typeName"in l._def})(e))return function(l,s,c){try{return Promise.resolve(NP(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](l,t)).then(function(h){return c.shouldUseNativeValidation&&A2({},c),{errors:{},values:r.raw?Object.assign({},l):h}})},function(h){if((function(m){return Array.isArray(m?.issues)})(h))return{values:{},errors:MP(nle(h.errors,!c.shouldUseNativeValidation&&c.criteriaMode==="all"),c)};throw h}))}catch(h){return Promise.reject(h)}};if((function(l){return"_zod"in l&&typeof l._zod=="object"})(e))return function(l,s,c){try{return Promise.resolve(NP(function(){return Promise.resolve((r.mode==="sync"?Jae:tle)(e,l,t)).then(function(h){return c.shouldUseNativeValidation&&A2({},c),{errors:{},values:r.raw?Object.assign({},l):h}})},function(h){if((function(m){return m instanceof Zae})(h))return{values:{},errors:MP(rle(h.issues,!c.shouldUseNativeValidation&&c.criteriaMode==="all"),c)};throw h}))}catch(h){return Promise.reject(h)}};throw new Error("Invalid input: not a Zod schema")}function lle(e,t){return kae({...t,resolver:ale(e)})}const ej=({value:e,onChange:t,defaultValue:r="",...l})=>{const s=Tw("Input",l),[c="",h]=br({prop:e,onChange:t,defaultProp:r}),m=b=>{h(b.target.value)};return O.jsx("input",{"data-slot":"input",...s,value:c,onChange:m,className:Fe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","file:border-0 file:bg-transparent file:text-sm file:font-medium",s.className)})},ole=$m(["inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-medium text-muted-foreground"],{variants:{variant:{default:"border-transparent bg-secondary text-secondary-foreground",secondary:"border-transparent bg-primary text-primary-foreground",error:"border-transparent bg-error text-error-foreground",outline:"text-foreground"},size:{default:"px-1.5 py-0.5 text-xs",sm:"px-2 py-0.5 text-sm",lg:"px-4 py-1 text-lg"}},defaultVariants:{variant:"default",size:"default"}}),ile=({variant:e,size:t,className:r,...l})=>O.jsx("kbd",{className:Fe(ole({variant:e,size:t}),r),...l,"data-slot":"kbd"}),ule=({className:e,...t})=>O.jsx("kbd",{"data-slot":"kbd-group",className:Fe("inline-flex items-center gap-1",e),...t}),sle=$m("animate-spin",{variants:{variant:{primary:"text-primary",secondary:"text-secondary",ghost:"text-muted-foreground",error:"text-error",success:"text-success"},size:{sm:"w-4 h-4",default:"w-7 h-7",lg:"w-10 h-10"}},defaultVariants:{variant:"primary",size:"default"}}),cle=({center:e,containerClassName:t,variant:r,size:l,...s})=>O.jsx("div",{className:Fe(t,e&&"fixed inset-0 grid place-items-center"),"data-slot":"loader",children:O.jsx(qT,{"data-slot":"loader-icon",...s,className:Fe(sle({variant:r,size:l}),s.className)})});function fle(e){const[t=[],r]=k.useState(e);return[t,{insertAt:(R,M)=>{r((q=[])=>{const N=[...q];return N.splice(R,0,M),N})},removeAt:R=>{r((M=[])=>{const q=[...M];return q.splice(R,1),q})},updateAt:(R,M)=>{r((q=[])=>{const N=[...q];return N[R]=M,N})},clear:()=>r([]),reset:()=>r(e),push:R=>r((M=[])=>[...M,R]),set:R=>r(R),pop:()=>{r((R=[])=>{const M=[...R];return M.pop(),M})},update:(R,M)=>{r((q=[])=>{const N=[...q],L=sr.findIndex(N,R);return L===-1||(N[L]=sr.isFunction(M)?M(N[L]):M),N})}}]}function dle({fn:e,dependencies:t=[],onError:r,onSuccess:l,onFinish:s}){const[c,h]=k.useState(!0),[m,b]=k.useState(null),[E,C]=k.useState(null),S=k.useCallback(()=>{h(!0),b(null),C(null),e().then(R=>{l?.(R),C(R)}).catch(R=>{r?.(R),b(R)}).finally(()=>{s?.(),h(!1)})},t);return k.useEffect(()=>{S()},[S]),{loading:c,error:m,data:E,refetch:S}}const ple=(e,t=!0)=>{const r=k.useRef(null),l=s=>{r.current&&!r.current.contains(s.target)&&e()};return k.useEffect(()=>{if(t)return document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l)}},[t]),r};function hle(){const[e,t]=k.useState(null),r=k.useCallback(async l=>{if(!navigator?.clipboard)return!1;try{return await navigator.clipboard.writeText(l),t(l),!0}catch(s){return console.error(s),t(null),!1}},[]);return[e,r]}function mle(e,t){const r=k.useRef(null);return k.useCallback((...l)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(...l)},t)},[e,t])}function vle(e,t){const[r,l]=k.useState(e);return k.useEffect(()=>{const s=setTimeout(()=>{l(e)},t);return()=>clearTimeout(s)},[e,t]),r}function gle(e=!1,t){const{onOpen:r,onClose:l}=t||{},[s,c]=k.useState(e),h=k.useCallback(()=>{c(E=>E||(r?.(),!0))},[r]),m=k.useCallback(()=>{c(E=>E&&(l?.(),!1))},[l]),b=k.useCallback(()=>{s?m():h()},[m,h,s]);return[s,{open:h,close:m,toggle:b}]}function yle(e){k.useEffect(()=>{typeof e=="string"&&e.trim().length>0&&(document.title=e.trim())},[e])}function tj(e,t,r){const l=k.useRef(null);return k.useEffect(()=>{const s=l.current??document;return s.addEventListener(e,t,r),()=>{s.removeEventListener(e,t,r)}},[e,t,r]),l}const ble=e=>{const t=e.toLowerCase().split("+");return{mainKey:t.pop(),isShift:t.includes("shift"),isCtrl:t.includes("ctrl"),isAlt:t.includes("alt"),isMeta:t.includes("meta")}},xle=(e,t)=>{const{mainKey:r,isShift:l,isCtrl:s,isAlt:c,isMeta:h}=ble(t);return e.key.toLowerCase()===r&&e.shiftKey===l&&e.ctrlKey===s&&e.altKey===c&&e.metaKey===h},Ele=e=>e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable,Sle=(e,t)=>t&&Ele(e.target),Cle=(e,t,r,l,s)=>c=>{if(!s||Sle(c,l))return;(Array.isArray(e)?e:[e]).some(b=>xle(c,b))&&(r&&c.preventDefault(),t(c))};function nj(e,t,r={}){const{eventName:l="keydown",preventDefault:s=!0,ignoreInputFields:c=!0,watch:h=!0}=r,m=k.useCallback(Cle(e,t,s,c,h),[e,t,s,c,h]);return tj(l,m)}function wle(e){const[t,r]=k.useState(!1),l=k.useRef(null);return k.useEffect(()=>{const s=m=>{r(!0),e?.onHoverStart?.(m)},c=m=>{r(!1),e?.onHoverEnd?.(m)},h=l.current;if(h)return h.addEventListener("mouseover",s),h.addEventListener("mouseout",c),()=>{h.removeEventListener("mouseover",s),h.removeEventListener("mouseout",c)}},[e]),{ref:l,isHovering:t}}function Rle({onVisible:e,root:t=null,rootMargin:r="0px",threshold:l=0}={}){const[s,c]=k.useState(!1),h=k.useRef(null),m=k.useCallback(([b])=>{const E=b.isIntersecting;c(E)},[e]);return k.useEffect(()=>{if(h.current==null)return;const b=new IntersectionObserver(m,{root:t,rootMargin:r,threshold:l});return b.observe(h.current),()=>{h.current!=null&&b.unobserve(h.current)}},[h,t,r,l,m]),k.useEffect(()=>{s&&e?.()},[s]),{ref:h,isVisible:s}}function Tle(e,t){const r=()=>{try{const m=localStorage.getItem(e);return m?JSON.parse(m):t!==void 0?t:void 0}catch(m){return console.error(`Error parsing localStorage key "${e}":`,m),t!==void 0?t:void 0}},[l,s]=k.useState(r);return k.useEffect(()=>{try{l!==void 0?localStorage.setItem(e,JSON.stringify(l)):localStorage.removeItem(e)}catch(m){console.error(`Error setting localStorage key "${e}":`,m)}},[e,l]),[l,m=>{s(m)},()=>{try{localStorage.removeItem(e),s(t!==void 0?t:void 0)}catch(m){console.error(`Error removing localStorage key "${e}":`,m)}}]}const _le=e=>{const[t,r]=k.useState(!1);return k.useEffect(()=>{const l=window.matchMedia(e),s=()=>r(l.matches);return s(),l.addEventListener("change",s),()=>{l.removeEventListener("change",s)}},[e]),t};function Ale(e){sr.isFunction(e)||console.error(`useMemoizedFn expected parameter is a function, got ${typeof e}`);const t=k.useRef(e);t.current=k.useMemo(()=>e,[e]);const r=k.useRef(null);return r.current||(r.current=function(...l){return t.current.apply(this,l)}),r.current}const Dle=e=>{const[t,r]=k.useState(!1),[l,s]=k.useState(null),[c,h]=k.useState(null);return{mutate:k.useCallback(async(...b)=>{r(!0),s(null),h(null);try{const E=await e.fn(...b);return e.onSuccess?.(E),h(E),E}catch(E){const C=E;throw e.onError?.(C),s(C),C}finally{e.onFinish?.(),r(!1)}},[e]),loading:t,error:l,data:c}};function Mle(e){const[t,r]=k.useState(e),l=k.useCallback(()=>r(e),[e]),s=k.useCallback(c=>{r(h=>{if(sr.isFunction(c)){const m=c(h);return sr.isObject(m)?{...h,...m}:h}else if(sr.isObject(c))return{...h,...c};return h})},[]);return[t,s,l]}function YM({totalItems:e,pageSize:t,initialCurrentPage:r=1,onChange:l}){const[s,c]=k.useState(r),h=Math.ceil(e/t),m=s===h,b=s===1,E=(s-1)*t+1,C=Math.min(s*t,e),S=()=>{if(m)return;const N=Math.min(s+1,h);q(N)},R=()=>{if(b)return;const N=Math.max(s-1,1);q(N)},M=N=>{if(N===1&&b||N===h&&m)return;const L=Math.max(1,N),P=Math.min(L,h);q(P)},q=N=>{c(N),l?.({currentPage:N,pageSize:t})};return{next:S,prev:R,goTo:M,currentPage:s,maxPage:h,isFirstPage:b,isLastPage:m,range:{start:E,end:C}}}function Ole(e){const t=()=>document.getElementById(e),r=()=>{const s=document.createElement("div");return s.id=e,s},l=k.useMemo(()=>{const s=t();return s||r()},[e]);return k.useEffect(()=>(document.getElementById(e)||document.body.appendChild(l),()=>{const s=document.getElementById(e);s&&document.body.removeChild(s)}),[e,l]),{render:s=>ws.createPortal(s,l)}}function Nle({shouldPrevent:e,message:t="Es posible que no se guarden los cambios hayas hecho."}){const r=l=>{if(e)return l.preventDefault(),l.returnValue=t,t};k.useEffect(()=>(window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)),[t,e])}const Dg="...",rj=({siblingCount:e=1,...t})=>{const r=YM(t),{currentPage:l,maxPage:s}=r,{totalItems:c,pageSize:h}=t,m=()=>{const S=2+3*e,R=1;if(S>=s)return sr.range(R,s+1);const M=Math.max(l-e,1),q=Math.min(l+e,s),N=M>2,L=q<s-2;if(N&&L){const P=sr.range(M,q+1);return[R,Dg,...P,Dg,s]}if(L)return[...sr.range(R,S+1),Dg,s];if(N){const P=sr.range(s-S+1,s+1);return[R,Dg,...P]}},b=k.useMemo(m,[c,h,l,e]);return{...r,paginationRange:b??[]}};function $le(e){const[t,r]=k.useState(new Set),l=k.useCallback(C=>t.has(C),[t]),s=k.useCallback(C=>{r(S=>new Set([...S,C]))},[]),c=k.useCallback(C=>{r(S=>{const R=new Set(S);return R.delete(C),R})},[]),h=k.useCallback(C=>{r(S=>{const R=new Set(S);return R.has(C)?R.delete(C):R.add(C),R})},[]),m=k.useCallback(C=>{r(new Set(C))},[]),b=k.useCallback(()=>{r(C=>C.size===e.length?new Set:new Set(e))},[e]),E=k.useCallback(()=>r(new Set),[]);return{isAllSelected:t.size===e.length,isSomeSelected:t.size>0&&t.size<e.length,isNoneSelected:t.size===0,isSelected:l,selected:[...t],setSelected:m,select:s,unselect:c,toggle:h,toggleAll:b,clear:E}}function Ple(e,t){const[r,l]=k.useState(0),s=t??e.length,c=()=>{l(E=>E>=s-1?E:E+1)},h=()=>{l(E=>E<=0?E:E-1)},m=E=>{l(E)},b=E=>{const C=sr.findIndex(e,E);C!==-1&&m(C)};return{currentStepIndex:r,step:e[r],steps:e,isFirstStep:r===0,isLastStep:r===s-1,goTo:m,next:c,back:h,findAndGo:b}}function aj(e=!1){const[t,r]=k.useState(e);return[t,s=>{r(s===void 0?!t:s)}]}const qle=/input|select|textarea|button|object/,lj="a, input, select, textarea, button, object, [tabindex]";function Lle(e){return process.env.NODE_ENV==="test"?!1:e.style.display==="none"}function jle(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(Lle(r))return!1;r=r.parentNode}return!0}function oj(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function D2(e){const t=e.nodeName.toLowerCase(),r=!Number.isNaN(oj(e));return(qle.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&jle(e)}function ij(e){const t=oj(e);return(Number.isNaN(t)||t>=0)&&D2(e)}function zle(e){return Array.from(e.querySelectorAll(lj)).filter(ij)}function Ble(e,t){const r=zle(e);if(!r.length){t.preventDefault();return}const l=r[t.shiftKey?0:r.length-1],s=e.getRootNode();let c=l===s.activeElement||e===s.activeElement;const h=s.activeElement;if(h.tagName==="INPUT"&&h.getAttribute("type")==="radio"&&(c=r.filter(C=>C.getAttribute("type")==="radio"&&C.getAttribute("name")===h.getAttribute("name")).includes(l)),!c)return;t.preventDefault();const b=r[t.shiftKey?r.length-1:0];b&&b.focus()}function kle(e=!0){const t=k.useRef(null),r=s=>{let c=s.querySelector("[data-autofocus]");if(!c){const h=Array.from(s.querySelectorAll(lj));c=h.find(ij)||h.find(D2)||null,!c&&D2(s)&&(c=s)}c&&c.focus({preventScroll:!0})},l=k.useCallback(s=>{e&&s!==null&&t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)},[e]);return k.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=c=>{c.key==="Tab"&&t.current&&Ble(t.current,c)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),l}function Ule(e){const t=Ile(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(Vle);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Ile(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Kle(s),m=Fle(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hle=Symbol("radix.slottable");function Vle(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hle}function Fle(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Kle(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Gle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yle=Gle.reduce((e,t)=>{const r=Ule(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function $P(e){const t=Xle(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(Zle);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Xle(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Jle(s),m=Wle(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qle=Symbol("radix.slottable");function Zle(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qle}function Wle(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Jle(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function XM(e){const t=e+"CollectionProvider",[r,l]=xp(t),[s,c]=r(t,{collectionRef:{current:null},itemMap:new Map}),h=N=>{const{scope:L,children:P}=N,U=k.useRef(null),I=k.useRef(new Map).current;return O.jsx(s,{scope:L,itemMap:I,collectionRef:U,children:P})};h.displayName=t;const m=e+"CollectionSlot",b=$P(m),E=k.forwardRef((N,L)=>{const{scope:P,children:U}=N,I=c(m,P),Y=vn(L,I.collectionRef);return O.jsx(b,{ref:Y,children:U})});E.displayName=m;const C=e+"CollectionItemSlot",S="data-radix-collection-item",R=$P(C),M=k.forwardRef((N,L)=>{const{scope:P,children:U,...I}=N,Y=k.useRef(null),V=vn(L,Y),F=c(C,P);return k.useEffect(()=>(F.itemMap.set(Y,{ref:Y,...I}),()=>{F.itemMap.delete(Y)})),O.jsx(R,{[S]:"",ref:V,children:U})});M.displayName=C;function q(N){const L=c(e+"CollectionConsumer",N);return k.useCallback(()=>{const U=L.collectionRef.current;if(!U)return[];const I=Array.from(U.querySelectorAll(`[${S}]`));return Array.from(L.itemMap.values()).sort((F,K)=>I.indexOf(F.ref.current)-I.indexOf(K.ref.current))},[L.collectionRef,L.itemMap])}return[{Provider:h,Slot:E,ItemSlot:M},q,l]}var eoe=D.createContext(void 0);function QM(e){const t=D.useContext(eoe);return e||t||"ltr"}const toe=["top","right","bottom","left"],Pg=Math.min,Ss=Math.max,XT=Math.round,vT=Math.floor,yp=e=>({x:e,y:e}),noe={left:"right",right:"left",bottom:"top",top:"bottom"},roe={start:"end",end:"start"};function M2(e,t,r){return Ss(e,Pg(t,r))}function Dm(e,t){return typeof e=="function"?e(t):e}function Mm(e){return e.split("-")[0]}function rx(e){return e.split("-")[1]}function ZM(e){return e==="x"?"y":"x"}function WM(e){return e==="y"?"height":"width"}function qg(e){return["top","bottom"].includes(Mm(e))?"y":"x"}function JM(e){return ZM(qg(e))}function aoe(e,t,r){r===void 0&&(r=!1);const l=rx(e),s=JM(e),c=WM(s);let h=s==="x"?l===(r?"end":"start")?"right":"left":l==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(h=QT(h)),[h,QT(h)]}function loe(e){const t=QT(e);return[O2(e),t,O2(t)]}function O2(e){return e.replace(/start|end/g,t=>roe[t])}function ooe(e,t,r){const l=["left","right"],s=["right","left"],c=["top","bottom"],h=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:l:t?l:s;case"left":case"right":return t?c:h;default:return[]}}function ioe(e,t,r,l){const s=rx(e);let c=ooe(Mm(e),r==="start",l);return s&&(c=c.map(h=>h+"-"+s),t&&(c=c.concat(c.map(O2)))),c}function QT(e){return e.replace(/left|right|bottom|top/g,t=>noe[t])}function uoe(e){return{top:0,right:0,bottom:0,left:0,...e}}function uj(e){return typeof e!="number"?uoe(e):{top:e,right:e,bottom:e,left:e}}function ZT(e){const{x:t,y:r,width:l,height:s}=e;return{width:l,height:s,top:r,left:t,right:t+l,bottom:r+s,x:t,y:r}}function PP(e,t,r){let{reference:l,floating:s}=e;const c=qg(t),h=JM(t),m=WM(h),b=Mm(t),E=c==="y",C=l.x+l.width/2-s.width/2,S=l.y+l.height/2-s.height/2,R=l[m]/2-s[m]/2;let M;switch(b){case"top":M={x:C,y:l.y-s.height};break;case"bottom":M={x:C,y:l.y+l.height};break;case"right":M={x:l.x+l.width,y:S};break;case"left":M={x:l.x-s.width,y:S};break;default:M={x:l.x,y:l.y}}switch(rx(t)){case"start":M[h]-=R*(r&&E?-1:1);break;case"end":M[h]+=R*(r&&E?-1:1);break}return M}const soe=async(e,t,r)=>{const{placement:l="bottom",strategy:s="absolute",middleware:c=[],platform:h}=r,m=c.filter(Boolean),b=await(h.isRTL==null?void 0:h.isRTL(t));let E=await h.getElementRects({reference:e,floating:t,strategy:s}),{x:C,y:S}=PP(E,l,b),R=l,M={},q=0;for(let N=0;N<m.length;N++){const{name:L,fn:P}=m[N],{x:U,y:I,data:Y,reset:V}=await P({x:C,y:S,initialPlacement:l,placement:R,strategy:s,middlewareData:M,rects:E,platform:h,elements:{reference:e,floating:t}});C=U??C,S=I??S,M={...M,[L]:{...M[L],...Y}},V&&q<=50&&(q++,typeof V=="object"&&(V.placement&&(R=V.placement),V.rects&&(E=V.rects===!0?await h.getElementRects({reference:e,floating:t,strategy:s}):V.rects),{x:C,y:S}=PP(E,R,b)),N=-1)}return{x:C,y:S,placement:R,strategy:s,middlewareData:M}};async function hw(e,t){var r;t===void 0&&(t={});const{x:l,y:s,platform:c,rects:h,elements:m,strategy:b}=e,{boundary:E="clippingAncestors",rootBoundary:C="viewport",elementContext:S="floating",altBoundary:R=!1,padding:M=0}=Dm(t,e),q=uj(M),L=m[R?S==="floating"?"reference":"floating":S],P=ZT(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(L)))==null||r?L:L.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(m.floating)),boundary:E,rootBoundary:C,strategy:b})),U=S==="floating"?{x:l,y:s,width:h.floating.width,height:h.floating.height}:h.reference,I=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m.floating)),Y=await(c.isElement==null?void 0:c.isElement(I))?await(c.getScale==null?void 0:c.getScale(I))||{x:1,y:1}:{x:1,y:1},V=ZT(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:U,offsetParent:I,strategy:b}):U);return{top:(P.top-V.top+q.top)/Y.y,bottom:(V.bottom-P.bottom+q.bottom)/Y.y,left:(P.left-V.left+q.left)/Y.x,right:(V.right-P.right+q.right)/Y.x}}const coe=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:l,placement:s,rects:c,platform:h,elements:m,middlewareData:b}=t,{element:E,padding:C=0}=Dm(e,t)||{};if(E==null)return{};const S=uj(C),R={x:r,y:l},M=JM(s),q=WM(M),N=await h.getDimensions(E),L=M==="y",P=L?"top":"left",U=L?"bottom":"right",I=L?"clientHeight":"clientWidth",Y=c.reference[q]+c.reference[M]-R[M]-c.floating[q],V=R[M]-c.reference[M],F=await(h.getOffsetParent==null?void 0:h.getOffsetParent(E));let K=F?F[I]:0;(!K||!await(h.isElement==null?void 0:h.isElement(F)))&&(K=m.floating[I]||c.floating[q]);const Q=Y/2-V/2,he=K/2-N[q]/2-1,de=Pg(S[P],he),W=Pg(S[U],he),se=de,le=K-N[q]-W,ae=K/2-N[q]/2+Q,xe=M2(se,ae,le),B=!b.arrow&&rx(s)!=null&&ae!==xe&&c.reference[q]/2-(ae<se?de:W)-N[q]/2<0,Z=B?ae<se?ae-se:ae-le:0;return{[M]:R[M]+Z,data:{[M]:xe,centerOffset:ae-xe-Z,...B&&{alignmentOffset:Z}},reset:B}}}),foe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,l;const{placement:s,middlewareData:c,rects:h,initialPlacement:m,platform:b,elements:E}=t,{mainAxis:C=!0,crossAxis:S=!0,fallbackPlacements:R,fallbackStrategy:M="bestFit",fallbackAxisSideDirection:q="none",flipAlignment:N=!0,...L}=Dm(e,t);if((r=c.arrow)!=null&&r.alignmentOffset)return{};const P=Mm(s),U=qg(m),I=Mm(m)===m,Y=await(b.isRTL==null?void 0:b.isRTL(E.floating)),V=R||(I||!N?[QT(m)]:loe(m)),F=q!=="none";!R&&F&&V.push(...ioe(m,N,q,Y));const K=[m,...V],Q=await hw(t,L),he=[];let de=((l=c.flip)==null?void 0:l.overflows)||[];if(C&&he.push(Q[P]),S){const ae=aoe(s,h,Y);he.push(Q[ae[0]],Q[ae[1]])}if(de=[...de,{placement:s,overflows:he}],!he.every(ae=>ae<=0)){var W,se;const ae=(((W=c.flip)==null?void 0:W.index)||0)+1,xe=K[ae];if(xe)return{data:{index:ae,overflows:de},reset:{placement:xe}};let B=(se=de.filter(Z=>Z.overflows[0]<=0).sort((Z,te)=>Z.overflows[1]-te.overflows[1])[0])==null?void 0:se.placement;if(!B)switch(M){case"bestFit":{var le;const Z=(le=de.filter(te=>{if(F){const be=qg(te.placement);return be===U||be==="y"}return!0}).map(te=>[te.placement,te.overflows.filter(be=>be>0).reduce((be,re)=>be+re,0)]).sort((te,be)=>te[1]-be[1])[0])==null?void 0:le[0];Z&&(B=Z);break}case"initialPlacement":B=m;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function qP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function LP(e){return toe.some(t=>e[t]>=0)}const doe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:l="referenceHidden",...s}=Dm(e,t);switch(l){case"referenceHidden":{const c=await hw(t,{...s,elementContext:"reference"}),h=qP(c,r.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:LP(h)}}}case"escaped":{const c=await hw(t,{...s,altBoundary:!0}),h=qP(c,r.floating);return{data:{escapedOffsets:h,escaped:LP(h)}}}default:return{}}}}};async function poe(e,t){const{placement:r,platform:l,elements:s}=e,c=await(l.isRTL==null?void 0:l.isRTL(s.floating)),h=Mm(r),m=rx(r),b=qg(r)==="y",E=["left","top"].includes(h)?-1:1,C=c&&b?-1:1,S=Dm(t,e);let{mainAxis:R,crossAxis:M,alignmentAxis:q}=typeof S=="number"?{mainAxis:S,crossAxis:0,alignmentAxis:null}:{mainAxis:S.mainAxis||0,crossAxis:S.crossAxis||0,alignmentAxis:S.alignmentAxis};return m&&typeof q=="number"&&(M=m==="end"?q*-1:q),b?{x:M*C,y:R*E}:{x:R*E,y:M*C}}const hoe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,l;const{x:s,y:c,placement:h,middlewareData:m}=t,b=await poe(t,e);return h===((r=m.offset)==null?void 0:r.placement)&&(l=m.arrow)!=null&&l.alignmentOffset?{}:{x:s+b.x,y:c+b.y,data:{...b,placement:h}}}}},moe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:l,placement:s}=t,{mainAxis:c=!0,crossAxis:h=!1,limiter:m={fn:L=>{let{x:P,y:U}=L;return{x:P,y:U}}},...b}=Dm(e,t),E={x:r,y:l},C=await hw(t,b),S=qg(Mm(s)),R=ZM(S);let M=E[R],q=E[S];if(c){const L=R==="y"?"top":"left",P=R==="y"?"bottom":"right",U=M+C[L],I=M-C[P];M=M2(U,M,I)}if(h){const L=S==="y"?"top":"left",P=S==="y"?"bottom":"right",U=q+C[L],I=q-C[P];q=M2(U,q,I)}const N=m.fn({...t,[R]:M,[S]:q});return{...N,data:{x:N.x-r,y:N.y-l,enabled:{[R]:c,[S]:h}}}}}},voe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:l,placement:s,rects:c,middlewareData:h}=t,{offset:m=0,mainAxis:b=!0,crossAxis:E=!0}=Dm(e,t),C={x:r,y:l},S=qg(s),R=ZM(S);let M=C[R],q=C[S];const N=Dm(m,t),L=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:0,crossAxis:0,...N};if(b){const I=R==="y"?"height":"width",Y=c.reference[R]-c.floating[I]+L.mainAxis,V=c.reference[R]+c.reference[I]-L.mainAxis;M<Y?M=Y:M>V&&(M=V)}if(E){var P,U;const I=R==="y"?"width":"height",Y=["top","left"].includes(Mm(s)),V=c.reference[S]-c.floating[I]+(Y&&((P=h.offset)==null?void 0:P[S])||0)+(Y?0:L.crossAxis),F=c.reference[S]+c.reference[I]+(Y?0:((U=h.offset)==null?void 0:U[S])||0)-(Y?L.crossAxis:0);q<V?q=V:q>F&&(q=F)}return{[R]:M,[S]:q}}}},goe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,l;const{placement:s,rects:c,platform:h,elements:m}=t,{apply:b=()=>{},...E}=Dm(e,t),C=await hw(t,E),S=Mm(s),R=rx(s),M=qg(s)==="y",{width:q,height:N}=c.floating;let L,P;S==="top"||S==="bottom"?(L=S,P=R===(await(h.isRTL==null?void 0:h.isRTL(m.floating))?"start":"end")?"left":"right"):(P=S,L=R==="end"?"top":"bottom");const U=N-C.top-C.bottom,I=q-C.left-C.right,Y=Pg(N-C[L],U),V=Pg(q-C[P],I),F=!t.middlewareData.shift;let K=Y,Q=V;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(Q=I),(l=t.middlewareData.shift)!=null&&l.enabled.y&&(K=U),F&&!R){const de=Ss(C.left,0),W=Ss(C.right,0),se=Ss(C.top,0),le=Ss(C.bottom,0);M?Q=q-2*(de!==0||W!==0?de+W:Ss(C.left,C.right)):K=N-2*(se!==0||le!==0?se+le:Ss(C.top,C.bottom))}await b({...t,availableWidth:Q,availableHeight:K});const he=await h.getDimensions(m.floating);return q!==he.width||N!==he.height?{reset:{rects:!0}}:{}}}};function A_(){return typeof window<"u"}function ax(e){return sj(e)?(e.nodeName||"").toLowerCase():"#document"}function Rs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Sp(e){var t;return(t=(sj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sj(e){return A_()?e instanceof Node||e instanceof Rs(e).Node:!1}function Jf(e){return A_()?e instanceof Element||e instanceof Rs(e).Element:!1}function bp(e){return A_()?e instanceof HTMLElement||e instanceof Rs(e).HTMLElement:!1}function jP(e){return!A_()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rs(e).ShadowRoot}function jw(e){const{overflow:t,overflowX:r,overflowY:l,display:s}=ed(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+r)&&!["inline","contents"].includes(s)}function yoe(e){return["table","td","th"].includes(ax(e))}function D_(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function eO(e){const t=tO(),r=Jf(e)?ed(e):e;return["transform","translate","scale","rotate","perspective"].some(l=>r[l]?r[l]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(l=>(r.willChange||"").includes(l))||["paint","layout","strict","content"].some(l=>(r.contain||"").includes(l))}function boe(e){let t=Lg(e);for(;bp(t)&&!K1(t);){if(eO(t))return t;if(D_(t))return null;t=Lg(t)}return null}function tO(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function K1(e){return["html","body","#document"].includes(ax(e))}function ed(e){return Rs(e).getComputedStyle(e)}function M_(e){return Jf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lg(e){if(ax(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jP(e)&&e.host||Sp(e);return jP(t)?t.host:t}function cj(e){const t=Lg(e);return K1(t)?e.ownerDocument?e.ownerDocument.body:e.body:bp(t)&&jw(t)?t:cj(t)}function mw(e,t,r){var l;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=cj(e),c=s===((l=e.ownerDocument)==null?void 0:l.body),h=Rs(s);if(c){const m=N2(h);return t.concat(h,h.visualViewport||[],jw(s)?s:[],m&&r?mw(m):[])}return t.concat(s,mw(s,[],r))}function N2(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fj(e){const t=ed(e);let r=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const s=bp(e),c=s?e.offsetWidth:r,h=s?e.offsetHeight:l,m=XT(r)!==c||XT(l)!==h;return m&&(r=c,l=h),{width:r,height:l,$:m}}function nO(e){return Jf(e)?e:e.contextElement}function I1(e){const t=nO(e);if(!bp(t))return yp(1);const r=t.getBoundingClientRect(),{width:l,height:s,$:c}=fj(t);let h=(c?XT(r.width):r.width)/l,m=(c?XT(r.height):r.height)/s;return(!h||!Number.isFinite(h))&&(h=1),(!m||!Number.isFinite(m))&&(m=1),{x:h,y:m}}const xoe=yp(0);function dj(e){const t=Rs(e);return!tO()||!t.visualViewport?xoe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Eoe(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Rs(e)?!1:t}function r0(e,t,r,l){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),c=nO(e);let h=yp(1);t&&(l?Jf(l)&&(h=I1(l)):h=I1(e));const m=Eoe(c,r,l)?dj(c):yp(0);let b=(s.left+m.x)/h.x,E=(s.top+m.y)/h.y,C=s.width/h.x,S=s.height/h.y;if(c){const R=Rs(c),M=l&&Jf(l)?Rs(l):l;let q=R,N=N2(q);for(;N&&l&&M!==q;){const L=I1(N),P=N.getBoundingClientRect(),U=ed(N),I=P.left+(N.clientLeft+parseFloat(U.paddingLeft))*L.x,Y=P.top+(N.clientTop+parseFloat(U.paddingTop))*L.y;b*=L.x,E*=L.y,C*=L.x,S*=L.y,b+=I,E+=Y,q=Rs(N),N=N2(q)}}return ZT({width:C,height:S,x:b,y:E})}function rO(e,t){const r=M_(e).scrollLeft;return t?t.left+r:r0(Sp(e)).left+r}function pj(e,t,r){r===void 0&&(r=!1);const l=e.getBoundingClientRect(),s=l.left+t.scrollLeft-(r?0:rO(e,l)),c=l.top+t.scrollTop;return{x:s,y:c}}function Soe(e){let{elements:t,rect:r,offsetParent:l,strategy:s}=e;const c=s==="fixed",h=Sp(l),m=t?D_(t.floating):!1;if(l===h||m&&c)return r;let b={scrollLeft:0,scrollTop:0},E=yp(1);const C=yp(0),S=bp(l);if((S||!S&&!c)&&((ax(l)!=="body"||jw(h))&&(b=M_(l)),bp(l))){const M=r0(l);E=I1(l),C.x=M.x+l.clientLeft,C.y=M.y+l.clientTop}const R=h&&!S&&!c?pj(h,b,!0):yp(0);return{width:r.width*E.x,height:r.height*E.y,x:r.x*E.x-b.scrollLeft*E.x+C.x+R.x,y:r.y*E.y-b.scrollTop*E.y+C.y+R.y}}function Coe(e){return Array.from(e.getClientRects())}function woe(e){const t=Sp(e),r=M_(e),l=e.ownerDocument.body,s=Ss(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),c=Ss(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let h=-r.scrollLeft+rO(e);const m=-r.scrollTop;return ed(l).direction==="rtl"&&(h+=Ss(t.clientWidth,l.clientWidth)-s),{width:s,height:c,x:h,y:m}}function Roe(e,t){const r=Rs(e),l=Sp(e),s=r.visualViewport;let c=l.clientWidth,h=l.clientHeight,m=0,b=0;if(s){c=s.width,h=s.height;const E=tO();(!E||E&&t==="fixed")&&(m=s.offsetLeft,b=s.offsetTop)}return{width:c,height:h,x:m,y:b}}function Toe(e,t){const r=r0(e,!0,t==="fixed"),l=r.top+e.clientTop,s=r.left+e.clientLeft,c=bp(e)?I1(e):yp(1),h=e.clientWidth*c.x,m=e.clientHeight*c.y,b=s*c.x,E=l*c.y;return{width:h,height:m,x:b,y:E}}function zP(e,t,r){let l;if(t==="viewport")l=Roe(e,r);else if(t==="document")l=woe(Sp(e));else if(Jf(t))l=Toe(t,r);else{const s=dj(e);l={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ZT(l)}function hj(e,t){const r=Lg(e);return r===t||!Jf(r)||K1(r)?!1:ed(r).position==="fixed"||hj(r,t)}function _oe(e,t){const r=t.get(e);if(r)return r;let l=mw(e,[],!1).filter(m=>Jf(m)&&ax(m)!=="body"),s=null;const c=ed(e).position==="fixed";let h=c?Lg(e):e;for(;Jf(h)&&!K1(h);){const m=ed(h),b=eO(h);!b&&m.position==="fixed"&&(s=null),(c?!b&&!s:!b&&m.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||jw(h)&&!b&&hj(e,h))?l=l.filter(C=>C!==h):s=m,h=Lg(h)}return t.set(e,l),l}function Aoe(e){let{element:t,boundary:r,rootBoundary:l,strategy:s}=e;const h=[...r==="clippingAncestors"?D_(t)?[]:_oe(t,this._c):[].concat(r),l],m=h[0],b=h.reduce((E,C)=>{const S=zP(t,C,s);return E.top=Ss(S.top,E.top),E.right=Pg(S.right,E.right),E.bottom=Pg(S.bottom,E.bottom),E.left=Ss(S.left,E.left),E},zP(t,m,s));return{width:b.right-b.left,height:b.bottom-b.top,x:b.left,y:b.top}}function Doe(e){const{width:t,height:r}=fj(e);return{width:t,height:r}}function Moe(e,t,r){const l=bp(t),s=Sp(t),c=r==="fixed",h=r0(e,!0,c,t);let m={scrollLeft:0,scrollTop:0};const b=yp(0);if(l||!l&&!c)if((ax(t)!=="body"||jw(s))&&(m=M_(t)),l){const R=r0(t,!0,c,t);b.x=R.x+t.clientLeft,b.y=R.y+t.clientTop}else s&&(b.x=rO(s));const E=s&&!l&&!c?pj(s,m):yp(0),C=h.left+m.scrollLeft-b.x-E.x,S=h.top+m.scrollTop-b.y-E.y;return{x:C,y:S,width:h.width,height:h.height}}function zD(e){return ed(e).position==="static"}function BP(e,t){if(!bp(e)||ed(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Sp(e)===r&&(r=r.ownerDocument.body),r}function mj(e,t){const r=Rs(e);if(D_(e))return r;if(!bp(e)){let s=Lg(e);for(;s&&!K1(s);){if(Jf(s)&&!zD(s))return s;s=Lg(s)}return r}let l=BP(e,t);for(;l&&yoe(l)&&zD(l);)l=BP(l,t);return l&&K1(l)&&zD(l)&&!eO(l)?r:l||boe(e)||r}const Ooe=async function(e){const t=this.getOffsetParent||mj,r=this.getDimensions,l=await r(e.floating);return{reference:Moe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function Noe(e){return ed(e).direction==="rtl"}const $oe={convertOffsetParentRelativeRectToViewportRelativeRect:Soe,getDocumentElement:Sp,getClippingRect:Aoe,getOffsetParent:mj,getElementRects:Ooe,getClientRects:Coe,getDimensions:Doe,getScale:I1,isElement:Jf,isRTL:Noe};function vj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Poe(e,t){let r=null,l;const s=Sp(e);function c(){var m;clearTimeout(l),(m=r)==null||m.disconnect(),r=null}function h(m,b){m===void 0&&(m=!1),b===void 0&&(b=1),c();const E=e.getBoundingClientRect(),{left:C,top:S,width:R,height:M}=E;if(m||t(),!R||!M)return;const q=vT(S),N=vT(s.clientWidth-(C+R)),L=vT(s.clientHeight-(S+M)),P=vT(C),I={rootMargin:-q+"px "+-N+"px "+-L+"px "+-P+"px",threshold:Ss(0,Pg(1,b))||1};let Y=!0;function V(F){const K=F[0].intersectionRatio;if(K!==b){if(!Y)return h();K?h(!1,K):l=setTimeout(()=>{h(!1,1e-7)},1e3)}K===1&&!vj(E,e.getBoundingClientRect())&&h(),Y=!1}try{r=new IntersectionObserver(V,{...I,root:s.ownerDocument})}catch{r=new IntersectionObserver(V,I)}r.observe(e)}return h(!0),c}function qoe(e,t,r,l){l===void 0&&(l={});const{ancestorScroll:s=!0,ancestorResize:c=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:b=!1}=l,E=nO(e),C=s||c?[...E?mw(E):[],...mw(t)]:[];C.forEach(P=>{s&&P.addEventListener("scroll",r,{passive:!0}),c&&P.addEventListener("resize",r)});const S=E&&m?Poe(E,r):null;let R=-1,M=null;h&&(M=new ResizeObserver(P=>{let[U]=P;U&&U.target===E&&M&&(M.unobserve(t),cancelAnimationFrame(R),R=requestAnimationFrame(()=>{var I;(I=M)==null||I.observe(t)})),r()}),E&&!b&&M.observe(E),M.observe(t));let q,N=b?r0(e):null;b&&L();function L(){const P=r0(e);N&&!vj(N,P)&&r(),N=P,q=requestAnimationFrame(L)}return r(),()=>{var P;C.forEach(U=>{s&&U.removeEventListener("scroll",r),c&&U.removeEventListener("resize",r)}),S?.(),(P=M)==null||P.disconnect(),M=null,b&&cancelAnimationFrame(q)}}const Loe=hoe,joe=moe,zoe=foe,Boe=goe,koe=doe,kP=coe,Uoe=voe,Ioe=(e,t,r)=>{const l=new Map,s={platform:$oe,...r},c={...s.platform,_c:l};return soe(e,t,{...s,platform:c})};var _T=typeof document<"u"?k.useLayoutEffect:k.useEffect;function WT(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,l,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(l=r;l--!==0;)if(!WT(e[l],t[l]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(l=r;l--!==0;)if(!{}.hasOwnProperty.call(t,s[l]))return!1;for(l=r;l--!==0;){const c=s[l];if(!(c==="_owner"&&e.$$typeof)&&!WT(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function gj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function UP(e,t){const r=gj(e);return Math.round(t*r)/r}function BD(e){const t=D.useRef(e);return _T(()=>{t.current=e}),t}function Hoe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:l=[],platform:s,elements:{reference:c,floating:h}={},transform:m=!0,whileElementsMounted:b,open:E}=e,[C,S]=D.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[R,M]=D.useState(l);WT(R,l)||M(l);const[q,N]=D.useState(null),[L,P]=D.useState(null),U=D.useCallback(te=>{te!==F.current&&(F.current=te,N(te))},[]),I=D.useCallback(te=>{te!==K.current&&(K.current=te,P(te))},[]),Y=c||q,V=h||L,F=D.useRef(null),K=D.useRef(null),Q=D.useRef(C),he=b!=null,de=BD(b),W=BD(s),se=BD(E),le=D.useCallback(()=>{if(!F.current||!K.current)return;const te={placement:t,strategy:r,middleware:R};W.current&&(te.platform=W.current),Ioe(F.current,K.current,te).then(be=>{const re={...be,isPositioned:se.current!==!1};ae.current&&!WT(Q.current,re)&&(Q.current=re,X1.flushSync(()=>{S(re)}))})},[R,t,r,W,se]);_T(()=>{E===!1&&Q.current.isPositioned&&(Q.current.isPositioned=!1,S(te=>({...te,isPositioned:!1})))},[E]);const ae=D.useRef(!1);_T(()=>(ae.current=!0,()=>{ae.current=!1}),[]),_T(()=>{if(Y&&(F.current=Y),V&&(K.current=V),Y&&V){if(de.current)return de.current(Y,V,le);le()}},[Y,V,le,de,he]);const xe=D.useMemo(()=>({reference:F,floating:K,setReference:U,setFloating:I}),[U,I]),B=D.useMemo(()=>({reference:Y,floating:V}),[Y,V]),Z=D.useMemo(()=>{const te={position:r,left:0,top:0};if(!B.floating)return te;const be=UP(B.floating,C.x),re=UP(B.floating,C.y);return m?{...te,transform:"translate("+be+"px, "+re+"px)",...gj(B.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:be,top:re}},[r,m,B.floating,C.x,C.y]);return D.useMemo(()=>({...C,update:le,refs:xe,elements:B,floatingStyles:Z}),[C,le,xe,B,Z])}const Voe=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:l,padding:s}=typeof e=="function"?e(r):e;return l&&t(l)?l.current!=null?kP({element:l.current,padding:s}).fn(r):{}:l?kP({element:l,padding:s}).fn(r):{}}}},Foe=(e,t)=>({...Loe(e),options:[e,t]}),Koe=(e,t)=>({...joe(e),options:[e,t]}),Goe=(e,t)=>({...Uoe(e),options:[e,t]}),Yoe=(e,t)=>({...zoe(e),options:[e,t]}),Xoe=(e,t)=>({...Boe(e),options:[e,t]}),Qoe=(e,t)=>({...koe(e),options:[e,t]}),Zoe=(e,t)=>({...Voe(e),options:[e,t]});function Woe(e){const t=Joe(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(tie);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Joe(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=rie(s),m=nie(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eie=Symbol("radix.slottable");function tie(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eie}function nie(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function rie(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var aie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lie=aie.reduce((e,t)=>{const r=Woe(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),oie="Arrow",yj=D.forwardRef((e,t)=>{const{children:r,width:l=10,height:s=5,...c}=e;return O.jsx(lie.svg,{...c,ref:t,width:l,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:O.jsx("polygon",{points:"0,0 30,0 15,10"})})});yj.displayName=oie;var iie=yj;function uie(e){const t=sie(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(fie);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function sie(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=pie(s),m=die(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cie=Symbol("radix.slottable");function fie(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cie}function die(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function pie(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var hie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bj=hie.reduce((e,t)=>{const r=uie(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function mie(e){const[t,r]=D.useState(void 0);return Vl(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const l=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const c=s[0];let h,m;if("borderBoxSize"in c){const b=c.borderBoxSize,E=Array.isArray(b)?b[0]:b;h=E.inlineSize,m=E.blockSize}else h=e.offsetWidth,m=e.offsetHeight;r({width:h,height:m})});return l.observe(e,{box:"border-box"}),()=>l.unobserve(e)}else r(void 0)},[e]),t}var aO="Popper",[xj,zg]=xp(aO),[vie,Ej]=xj(aO),Sj=e=>{const{__scopePopper:t,children:r}=e,[l,s]=D.useState(null);return O.jsx(vie,{scope:t,anchor:l,onAnchorChange:s,children:r})};Sj.displayName=aO;var Cj="PopperAnchor",wj=D.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:l,...s}=e,c=Ej(Cj,r),h=D.useRef(null),m=vn(t,h),b=D.useRef(null);return D.useEffect(()=>{const E=b.current;b.current=l?.current||h.current,E!==b.current&&c.onAnchorChange(b.current)}),l?null:O.jsx(bj.div,{...s,ref:m})});wj.displayName=Cj;var lO="PopperContent",[gie,yie]=xj(lO),Rj=D.forwardRef((e,t)=>{const{__scopePopper:r,side:l="bottom",sideOffset:s=0,align:c="center",alignOffset:h=0,arrowPadding:m=0,avoidCollisions:b=!0,collisionBoundary:E=[],collisionPadding:C=0,sticky:S="partial",hideWhenDetached:R=!1,updatePositionStrategy:M="optimized",onPlaced:q,...N}=e,L=Ej(lO,r),[P,U]=D.useState(null),I=vn(t,_e=>U(_e)),[Y,V]=D.useState(null),F=mie(Y),K=F?.width??0,Q=F?.height??0,he=l+(c!=="center"?"-"+c:""),de=typeof C=="number"?C:{top:0,right:0,bottom:0,left:0,...C},W=Array.isArray(E)?E:[E],se=W.length>0,le={padding:de,boundary:W.filter(xie),altBoundary:se},{refs:ae,floatingStyles:xe,placement:B,isPositioned:Z,middlewareData:te}=Hoe({strategy:"fixed",placement:he,whileElementsMounted:(..._e)=>qoe(..._e,{animationFrame:M==="always"}),elements:{reference:L.anchor},middleware:[Foe({mainAxis:s+Q,alignmentAxis:h}),b&&Koe({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?Goe():void 0,...le}),b&&Yoe({...le}),Xoe({...le,apply:({elements:_e,rects:Je,availableWidth:ie,availableHeight:ke})=>{const{width:Ee,height:Ae}=Je.reference,ot=_e.floating.style;ot.setProperty("--radix-popper-available-width",`${ie}px`),ot.setProperty("--radix-popper-available-height",`${ke}px`),ot.setProperty("--radix-popper-anchor-width",`${Ee}px`),ot.setProperty("--radix-popper-anchor-height",`${Ae}px`)}}),Y&&Zoe({element:Y,padding:m}),Eie({arrowWidth:K,arrowHeight:Q}),R&&Qoe({strategy:"referenceHidden",...le})]}),[be,re]=Aj(B),oe=Yo(q);Vl(()=>{Z&&oe?.()},[Z,oe]);const ue=te.arrow?.x,ce=te.arrow?.y,De=te.arrow?.centerOffset!==0,[je,Ke]=D.useState();return Vl(()=>{P&&Ke(window.getComputedStyle(P).zIndex)},[P]),O.jsx("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...xe,transform:Z?xe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:je,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:O.jsx(gie,{scope:r,placedSide:be,onArrowChange:V,arrowX:ue,arrowY:ce,shouldHideArrow:De,children:O.jsx(bj.div,{"data-side":be,"data-align":re,...N,ref:I,style:{...N.style,animation:Z?void 0:"none"}})})})});Rj.displayName=lO;var Tj="PopperArrow",bie={top:"bottom",right:"left",bottom:"top",left:"right"},_j=D.forwardRef(function(t,r){const{__scopePopper:l,...s}=t,c=yie(Tj,l),h=bie[c.placedSide];return O.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[h]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:O.jsx(iie,{...s,ref:r,style:{...s.style,display:"block"}})})});_j.displayName=Tj;function xie(e){return e!==null}var Eie=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:l,middlewareData:s}=t,h=s.arrow?.centerOffset!==0,m=h?0:e.arrowWidth,b=h?0:e.arrowHeight,[E,C]=Aj(r),S={start:"0%",center:"50%",end:"100%"}[C],R=(s.arrow?.x??0)+m/2,M=(s.arrow?.y??0)+b/2;let q="",N="";return E==="bottom"?(q=h?S:`${R}px`,N=`${-b}px`):E==="top"?(q=h?S:`${R}px`,N=`${l.floating.height+b}px`):E==="right"?(q=`${-b}px`,N=h?S:`${M}px`):E==="left"&&(q=`${l.floating.width+b}px`,N=h?S:`${M}px`),{data:{x:q,y:N}}}});function Aj(e){const[t,r="center"]=e.split("-");return[t,r]}var zw=Sj,Bw=wj,O_=Rj,N_=_j;function Dj(e){const t=Sie(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(wie);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Sie(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Tie(s),m=Rie(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Cie=Symbol("radix.slottable");function wie(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Cie}function Rie(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Tie(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var _ie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kw=_ie.reduce((e,t)=>{const r=Dj(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function Aie(e,t){e&&X1.flushSync(()=>e.dispatchEvent(t))}function Die(e){const t=Mie(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(Nie);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Mie(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Pie(s),m=$ie(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oie=Symbol("radix.slottable");function Nie(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oie}function $ie(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Pie(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var qie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Mj=qie.reduce((e,t)=>{const r=Die(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),kD="rovingFocusGroup.onEntryFocus",Lie={bubbles:!1,cancelable:!0},Uw="RovingFocusGroup",[$2,Oj,jie]=XM(Uw),[zie,Nj]=xp(Uw,[jie]),[Bie,kie]=zie(Uw),$j=D.forwardRef((e,t)=>O.jsx($2.Provider,{scope:e.__scopeRovingFocusGroup,children:O.jsx($2.Slot,{scope:e.__scopeRovingFocusGroup,children:O.jsx(Uie,{...e,ref:t})})}));$j.displayName=Uw;var Uie=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:l,loop:s=!1,dir:c,currentTabStopId:h,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:b,onEntryFocus:E,preventScrollOnEntryFocus:C=!1,...S}=e,R=D.useRef(null),M=vn(t,R),q=QM(c),[N,L]=br({prop:h,defaultProp:m??null,onChange:b,caller:Uw}),[P,U]=D.useState(!1),I=Yo(E),Y=Oj(r),V=D.useRef(!1),[F,K]=D.useState(0);return D.useEffect(()=>{const Q=R.current;if(Q)return Q.addEventListener(kD,I),()=>Q.removeEventListener(kD,I)},[I]),O.jsx(Bie,{scope:r,orientation:l,dir:q,loop:s,currentTabStopId:N,onItemFocus:D.useCallback(Q=>L(Q),[L]),onItemShiftTab:D.useCallback(()=>U(!0),[]),onFocusableItemAdd:D.useCallback(()=>K(Q=>Q+1),[]),onFocusableItemRemove:D.useCallback(()=>K(Q=>Q-1),[]),children:O.jsx(Mj.div,{tabIndex:P||F===0?-1:0,"data-orientation":l,...S,ref:M,style:{outline:"none",...e.style},onMouseDown:gt(e.onMouseDown,()=>{V.current=!0}),onFocus:gt(e.onFocus,Q=>{const he=!V.current;if(Q.target===Q.currentTarget&&he&&!P){const de=new CustomEvent(kD,Lie);if(Q.currentTarget.dispatchEvent(de),!de.defaultPrevented){const W=Y().filter(B=>B.focusable),se=W.find(B=>B.active),le=W.find(B=>B.id===N),xe=[se,le,...W].filter(Boolean).map(B=>B.ref.current);Lj(xe,C)}}V.current=!1}),onBlur:gt(e.onBlur,()=>U(!1))})})}),Pj="RovingFocusGroupItem",qj=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:l=!0,active:s=!1,tabStopId:c,children:h,...m}=e,b=_a(),E=c||b,C=kie(Pj,r),S=C.currentTabStopId===E,R=Oj(r),{onFocusableItemAdd:M,onFocusableItemRemove:q,currentTabStopId:N}=C;return D.useEffect(()=>{if(l)return M(),()=>q()},[l,M,q]),O.jsx($2.ItemSlot,{scope:r,id:E,focusable:l,active:s,children:O.jsx(Mj.span,{tabIndex:S?0:-1,"data-orientation":C.orientation,...m,ref:t,onMouseDown:gt(e.onMouseDown,L=>{l?C.onItemFocus(E):L.preventDefault()}),onFocus:gt(e.onFocus,()=>C.onItemFocus(E)),onKeyDown:gt(e.onKeyDown,L=>{if(L.key==="Tab"&&L.shiftKey){C.onItemShiftTab();return}if(L.target!==L.currentTarget)return;const P=Vie(L,C.orientation,C.dir);if(P!==void 0){if(L.metaKey||L.ctrlKey||L.altKey||L.shiftKey)return;L.preventDefault();let I=R().filter(Y=>Y.focusable).map(Y=>Y.ref.current);if(P==="last")I.reverse();else if(P==="prev"||P==="next"){P==="prev"&&I.reverse();const Y=I.indexOf(L.currentTarget);I=C.loop?Fie(I,Y+1):I.slice(Y+1)}setTimeout(()=>Lj(I))}}),children:typeof h=="function"?h({isCurrentTabStop:S,hasTabStop:N!=null}):h})})});qj.displayName=Pj;var Iie={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Hie(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Vie(e,t,r){const l=Hie(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(l))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(l)))return Iie[l]}function Lj(e,t=!1){const r=document.activeElement;for(const l of e)if(l===r||(l.focus({preventScroll:t}),document.activeElement!==r))return}function Fie(e,t){return e.map((r,l)=>e[(t+l)%e.length])}var Kie=$j,Gie=qj,P2=["Enter"," "],Yie=["ArrowDown","PageUp","Home"],jj=["ArrowUp","PageDown","End"],Xie=[...Yie,...jj],Qie={ltr:[...P2,"ArrowRight"],rtl:[...P2,"ArrowLeft"]},Zie={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Iw="Menu",[vw,Wie,Jie]=XM(Iw),[d0,zj]=xp(Iw,[Jie,zg,Nj]),Hw=zg(),Bj=Nj(),[kj,Bg]=d0(Iw),[eue,Vw]=d0(Iw),Uj=e=>{const{__scopeMenu:t,open:r=!1,children:l,dir:s,onOpenChange:c,modal:h=!0}=e,m=Hw(t),[b,E]=D.useState(null),C=D.useRef(!1),S=Yo(c),R=QM(s);return D.useEffect(()=>{const M=()=>{C.current=!0,document.addEventListener("pointerdown",q,{capture:!0,once:!0}),document.addEventListener("pointermove",q,{capture:!0,once:!0})},q=()=>C.current=!1;return document.addEventListener("keydown",M,{capture:!0}),()=>{document.removeEventListener("keydown",M,{capture:!0}),document.removeEventListener("pointerdown",q,{capture:!0}),document.removeEventListener("pointermove",q,{capture:!0})}},[]),O.jsx(zw,{...m,children:O.jsx(kj,{scope:t,open:r,onOpenChange:S,content:b,onContentChange:E,children:O.jsx(eue,{scope:t,onClose:D.useCallback(()=>S(!1),[S]),isUsingKeyboardRef:C,dir:R,modal:h,children:l})})})};Uj.displayName=Iw;var tue="MenuAnchor",oO=D.forwardRef((e,t)=>{const{__scopeMenu:r,...l}=e,s=Hw(r);return O.jsx(Bw,{...s,...l,ref:t})});oO.displayName=tue;var iO="MenuPortal",[nue,Ij]=d0(iO,{forceMount:void 0}),Hj=e=>{const{__scopeMenu:t,forceMount:r,children:l,container:s}=e,c=Bg(iO,t);return O.jsx(nue,{scope:t,forceMount:r,children:O.jsx(Ts,{present:r||c.open,children:O.jsx(J1,{asChild:!0,container:s,children:l})})})};Hj.displayName=iO;var jc="MenuContent",[rue,uO]=d0(jc),Vj=D.forwardRef((e,t)=>{const r=Ij(jc,e.__scopeMenu),{forceMount:l=r.forceMount,...s}=e,c=Bg(jc,e.__scopeMenu),h=Vw(jc,e.__scopeMenu);return O.jsx(vw.Provider,{scope:e.__scopeMenu,children:O.jsx(Ts,{present:l||c.open,children:O.jsx(vw.Slot,{scope:e.__scopeMenu,children:h.modal?O.jsx(aue,{...s,ref:t}):O.jsx(lue,{...s,ref:t})})})})}),aue=D.forwardRef((e,t)=>{const r=Bg(jc,e.__scopeMenu),l=D.useRef(null),s=vn(t,l);return D.useEffect(()=>{const c=l.current;if(c)return ww(c)},[]),O.jsx(sO,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:gt(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),lue=D.forwardRef((e,t)=>{const r=Bg(jc,e.__scopeMenu);return O.jsx(sO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),oue=Dj("MenuContent.ScrollLock"),sO=D.forwardRef((e,t)=>{const{__scopeMenu:r,loop:l=!1,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:h,disableOutsidePointerEvents:m,onEntryFocus:b,onEscapeKeyDown:E,onPointerDownOutside:C,onFocusOutside:S,onInteractOutside:R,onDismiss:M,disableOutsideScroll:q,...N}=e,L=Bg(jc,r),P=Vw(jc,r),U=Hw(r),I=Bj(r),Y=Wie(r),[V,F]=D.useState(null),K=D.useRef(null),Q=vn(t,K,L.onContentChange),he=D.useRef(0),de=D.useRef(""),W=D.useRef(0),se=D.useRef(null),le=D.useRef("right"),ae=D.useRef(0),xe=q?ex:D.Fragment,B=q?{as:oue,allowPinchZoom:!0}:void 0,Z=be=>{const re=de.current+be,oe=Y().filter(_e=>!_e.disabled),ue=document.activeElement,ce=oe.find(_e=>_e.ref.current===ue)?.textValue,De=oe.map(_e=>_e.textValue),je=yue(De,re,ce),Ke=oe.find(_e=>_e.textValue===je)?.ref.current;(function _e(Je){de.current=Je,window.clearTimeout(he.current),Je!==""&&(he.current=window.setTimeout(()=>_e(""),1e3))})(re),Ke&&setTimeout(()=>Ke.focus())};D.useEffect(()=>()=>window.clearTimeout(he.current),[]),f_();const te=D.useCallback(be=>le.current===se.current?.side&&xue(be,se.current?.area),[]);return O.jsx(rue,{scope:r,searchRef:de,onItemEnter:D.useCallback(be=>{te(be)&&be.preventDefault()},[te]),onItemLeave:D.useCallback(be=>{te(be)||(K.current?.focus(),F(null))},[te]),onTriggerLeave:D.useCallback(be=>{te(be)&&be.preventDefault()},[te]),pointerGraceTimerRef:W,onPointerGraceIntentChange:D.useCallback(be=>{se.current=be},[]),children:O.jsx(xe,{...B,children:O.jsx(Sw,{asChild:!0,trapped:s,onMountAutoFocus:gt(c,be=>{be.preventDefault(),K.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:h,children:O.jsx(W1,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:E,onPointerDownOutside:C,onFocusOutside:S,onInteractOutside:R,onDismiss:M,children:O.jsx(Kie,{asChild:!0,...I,dir:P.dir,orientation:"vertical",loop:l,currentTabStopId:V,onCurrentTabStopIdChange:F,onEntryFocus:gt(b,be=>{P.isUsingKeyboardRef.current||be.preventDefault()}),preventScrollOnEntryFocus:!0,children:O.jsx(O_,{role:"menu","aria-orientation":"vertical","data-state":iz(L.open),"data-radix-menu-content":"",dir:P.dir,...U,...N,ref:Q,style:{outline:"none",...N.style},onKeyDown:gt(N.onKeyDown,be=>{const oe=be.target.closest("[data-radix-menu-content]")===be.currentTarget,ue=be.ctrlKey||be.altKey||be.metaKey,ce=be.key.length===1;oe&&(be.key==="Tab"&&be.preventDefault(),!ue&&ce&&Z(be.key));const De=K.current;if(be.target!==De||!Xie.includes(be.key))return;be.preventDefault();const Ke=Y().filter(_e=>!_e.disabled).map(_e=>_e.ref.current);jj.includes(be.key)&&Ke.reverse(),vue(Ke)}),onBlur:gt(e.onBlur,be=>{be.currentTarget.contains(be.target)||(window.clearTimeout(he.current),de.current="")}),onPointerMove:gt(e.onPointerMove,gw(be=>{const re=be.target,oe=ae.current!==be.clientX;if(be.currentTarget.contains(re)&&oe){const ue=be.clientX>ae.current?"right":"left";le.current=ue,ae.current=be.clientX}}))})})})})})})});Vj.displayName=jc;var iue="MenuGroup",cO=D.forwardRef((e,t)=>{const{__scopeMenu:r,...l}=e;return O.jsx(kw.div,{role:"group",...l,ref:t})});cO.displayName=iue;var uue="MenuLabel",Fj=D.forwardRef((e,t)=>{const{__scopeMenu:r,...l}=e;return O.jsx(kw.div,{...l,ref:t})});Fj.displayName=uue;var JT="MenuItem",IP="menu.itemSelect",$_=D.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:l,...s}=e,c=D.useRef(null),h=Vw(JT,e.__scopeMenu),m=uO(JT,e.__scopeMenu),b=vn(t,c),E=D.useRef(!1),C=()=>{const S=c.current;if(!r&&S){const R=new CustomEvent(IP,{bubbles:!0,cancelable:!0});S.addEventListener(IP,M=>l?.(M),{once:!0}),Aie(S,R),R.defaultPrevented?E.current=!1:h.onClose()}};return O.jsx(Kj,{...s,ref:b,disabled:r,onClick:gt(e.onClick,C),onPointerDown:S=>{e.onPointerDown?.(S),E.current=!0},onPointerUp:gt(e.onPointerUp,S=>{E.current||S.currentTarget?.click()}),onKeyDown:gt(e.onKeyDown,S=>{const R=m.searchRef.current!=="";r||R&&S.key===" "||P2.includes(S.key)&&(S.currentTarget.click(),S.preventDefault())})})});$_.displayName=JT;var Kj=D.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:l=!1,textValue:s,...c}=e,h=uO(JT,r),m=Bj(r),b=D.useRef(null),E=vn(t,b),[C,S]=D.useState(!1),[R,M]=D.useState("");return D.useEffect(()=>{const q=b.current;q&&M((q.textContent??"").trim())},[c.children]),O.jsx(vw.ItemSlot,{scope:r,disabled:l,textValue:s??R,children:O.jsx(Gie,{asChild:!0,...m,focusable:!l,children:O.jsx(kw.div,{role:"menuitem","data-highlighted":C?"":void 0,"aria-disabled":l||void 0,"data-disabled":l?"":void 0,...c,ref:E,onPointerMove:gt(e.onPointerMove,gw(q=>{l?h.onItemLeave(q):(h.onItemEnter(q),q.defaultPrevented||q.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:gt(e.onPointerLeave,gw(q=>h.onItemLeave(q))),onFocus:gt(e.onFocus,()=>S(!0)),onBlur:gt(e.onBlur,()=>S(!1))})})})}),sue="MenuCheckboxItem",Gj=D.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:l,...s}=e;return O.jsx(Wj,{scope:e.__scopeMenu,checked:r,children:O.jsx($_,{role:"menuitemcheckbox","aria-checked":e_(r)?"mixed":r,...s,ref:t,"data-state":pO(r),onSelect:gt(s.onSelect,()=>l?.(e_(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Gj.displayName=sue;var Yj="MenuRadioGroup",[cue,fue]=d0(Yj,{value:void 0,onValueChange:()=>{}}),Xj=D.forwardRef((e,t)=>{const{value:r,onValueChange:l,...s}=e,c=Yo(l);return O.jsx(cue,{scope:e.__scopeMenu,value:r,onValueChange:c,children:O.jsx(cO,{...s,ref:t})})});Xj.displayName=Yj;var Qj="MenuRadioItem",Zj=D.forwardRef((e,t)=>{const{value:r,...l}=e,s=fue(Qj,e.__scopeMenu),c=r===s.value;return O.jsx(Wj,{scope:e.__scopeMenu,checked:c,children:O.jsx($_,{role:"menuitemradio","aria-checked":c,...l,ref:t,"data-state":pO(c),onSelect:gt(l.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});Zj.displayName=Qj;var fO="MenuItemIndicator",[Wj,due]=d0(fO,{checked:!1}),Jj=D.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:l,...s}=e,c=due(fO,r);return O.jsx(Ts,{present:l||e_(c.checked)||c.checked===!0,children:O.jsx(kw.span,{...s,ref:t,"data-state":pO(c.checked)})})});Jj.displayName=fO;var pue="MenuSeparator",ez=D.forwardRef((e,t)=>{const{__scopeMenu:r,...l}=e;return O.jsx(kw.div,{role:"separator","aria-orientation":"horizontal",...l,ref:t})});ez.displayName=pue;var hue="MenuArrow",tz=D.forwardRef((e,t)=>{const{__scopeMenu:r,...l}=e,s=Hw(r);return O.jsx(N_,{...s,...l,ref:t})});tz.displayName=hue;var dO="MenuSub",[mue,nz]=d0(dO),rz=e=>{const{__scopeMenu:t,children:r,open:l=!1,onOpenChange:s}=e,c=Bg(dO,t),h=Hw(t),[m,b]=D.useState(null),[E,C]=D.useState(null),S=Yo(s);return D.useEffect(()=>(c.open===!1&&S(!1),()=>S(!1)),[c.open,S]),O.jsx(zw,{...h,children:O.jsx(kj,{scope:t,open:l,onOpenChange:S,content:E,onContentChange:C,children:O.jsx(mue,{scope:t,contentId:_a(),triggerId:_a(),trigger:m,onTriggerChange:b,children:r})})})};rz.displayName=dO;var ew="MenuSubTrigger",az=D.forwardRef((e,t)=>{const r=Bg(ew,e.__scopeMenu),l=Vw(ew,e.__scopeMenu),s=nz(ew,e.__scopeMenu),c=uO(ew,e.__scopeMenu),h=D.useRef(null),{pointerGraceTimerRef:m,onPointerGraceIntentChange:b}=c,E={__scopeMenu:e.__scopeMenu},C=D.useCallback(()=>{h.current&&window.clearTimeout(h.current),h.current=null},[]);return D.useEffect(()=>C,[C]),D.useEffect(()=>{const S=m.current;return()=>{window.clearTimeout(S),b(null)}},[m,b]),O.jsx(oO,{asChild:!0,...E,children:O.jsx(Kj,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":iz(r.open),...e,ref:Fr(t,s.onTriggerChange),onClick:S=>{e.onClick?.(S),!(e.disabled||S.defaultPrevented)&&(S.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:gt(e.onPointerMove,gw(S=>{c.onItemEnter(S),!S.defaultPrevented&&!e.disabled&&!r.open&&!h.current&&(c.onPointerGraceIntentChange(null),h.current=window.setTimeout(()=>{r.onOpenChange(!0),C()},100))})),onPointerLeave:gt(e.onPointerLeave,gw(S=>{C();const R=r.content?.getBoundingClientRect();if(R){const M=r.content?.dataset.side,q=M==="right",N=q?-5:5,L=R[q?"left":"right"],P=R[q?"right":"left"];c.onPointerGraceIntentChange({area:[{x:S.clientX+N,y:S.clientY},{x:L,y:R.top},{x:P,y:R.top},{x:P,y:R.bottom},{x:L,y:R.bottom}],side:M}),window.clearTimeout(m.current),m.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(S),S.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:gt(e.onKeyDown,S=>{const R=c.searchRef.current!=="";e.disabled||R&&S.key===" "||Qie[l.dir].includes(S.key)&&(r.onOpenChange(!0),r.content?.focus(),S.preventDefault())})})})});az.displayName=ew;var lz="MenuSubContent",oz=D.forwardRef((e,t)=>{const r=Ij(jc,e.__scopeMenu),{forceMount:l=r.forceMount,...s}=e,c=Bg(jc,e.__scopeMenu),h=Vw(jc,e.__scopeMenu),m=nz(lz,e.__scopeMenu),b=D.useRef(null),E=vn(t,b);return O.jsx(vw.Provider,{scope:e.__scopeMenu,children:O.jsx(Ts,{present:l||c.open,children:O.jsx(vw.Slot,{scope:e.__scopeMenu,children:O.jsx(sO,{id:m.contentId,"aria-labelledby":m.triggerId,...s,ref:E,align:"start",side:h.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:C=>{h.isUsingKeyboardRef.current&&b.current?.focus(),C.preventDefault()},onCloseAutoFocus:C=>C.preventDefault(),onFocusOutside:gt(e.onFocusOutside,C=>{C.target!==m.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:gt(e.onEscapeKeyDown,C=>{h.onClose(),C.preventDefault()}),onKeyDown:gt(e.onKeyDown,C=>{const S=C.currentTarget.contains(C.target),R=Zie[h.dir].includes(C.key);S&&R&&(c.onOpenChange(!1),m.trigger?.focus(),C.preventDefault())})})})})})});oz.displayName=lz;function iz(e){return e?"open":"closed"}function e_(e){return e==="indeterminate"}function pO(e){return e_(e)?"indeterminate":e?"checked":"unchecked"}function vue(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function gue(e,t){return e.map((r,l)=>e[(t+l)%e.length])}function yue(e,t,r){const s=t.length>1&&Array.from(t).every(E=>E===t[0])?t[0]:t,c=r?e.indexOf(r):-1;let h=gue(e,Math.max(c,0));s.length===1&&(h=h.filter(E=>E!==r));const b=h.find(E=>E.toLowerCase().startsWith(s.toLowerCase()));return b!==r?b:void 0}function bue(e,t){const{x:r,y:l}=e;let s=!1;for(let c=0,h=t.length-1;c<t.length;h=c++){const m=t[c],b=t[h],E=m.x,C=m.y,S=b.x,R=b.y;C>l!=R>l&&r<(S-E)*(l-C)/(R-C)+E&&(s=!s)}return s}function xue(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return bue(r,t)}function gw(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Eue=Uj,Sue=oO,Cue=Hj,wue=Vj,Rue=cO,Tue=Fj,_ue=$_,Aue=Gj,Due=Xj,Mue=Zj,Oue=Jj,Nue=ez,$ue=tz,Pue=rz,que=az,Lue=oz,P_="DropdownMenu",[jue]=xp(P_,[zj]),vi=zj(),[zue,uz]=jue(P_),sz=e=>{const{__scopeDropdownMenu:t,children:r,dir:l,open:s,defaultOpen:c,onOpenChange:h,modal:m=!0}=e,b=vi(t),E=D.useRef(null),[C,S]=br({prop:s,defaultProp:c??!1,onChange:h,caller:P_});return O.jsx(zue,{scope:t,triggerId:_a(),triggerRef:E,contentId:_a(),open:C,onOpenChange:S,onOpenToggle:D.useCallback(()=>S(R=>!R),[S]),modal:m,children:O.jsx(Eue,{...b,open:C,onOpenChange:S,dir:l,modal:m,children:r})})};sz.displayName=P_;var cz="DropdownMenuTrigger",fz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:l=!1,...s}=e,c=uz(cz,r),h=vi(r);return O.jsx(Sue,{asChild:!0,...h,children:O.jsx(Yle.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":l?"":void 0,disabled:l,...s,ref:Fr(t,c.triggerRef),onPointerDown:gt(e.onPointerDown,m=>{!l&&m.button===0&&m.ctrlKey===!1&&(c.onOpenToggle(),c.open||m.preventDefault())}),onKeyDown:gt(e.onKeyDown,m=>{l||(["Enter"," "].includes(m.key)&&c.onOpenToggle(),m.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(m.key)&&m.preventDefault())})})})});fz.displayName=cz;var Bue="DropdownMenuPortal",dz=e=>{const{__scopeDropdownMenu:t,...r}=e,l=vi(t);return O.jsx(Cue,{...l,...r})};dz.displayName=Bue;var pz="DropdownMenuContent",hz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=uz(pz,r),c=vi(r),h=D.useRef(!1);return O.jsx(wue,{id:s.contentId,"aria-labelledby":s.triggerId,...c,...l,ref:t,onCloseAutoFocus:gt(e.onCloseAutoFocus,m=>{h.current||s.triggerRef.current?.focus(),h.current=!1,m.preventDefault()}),onInteractOutside:gt(e.onInteractOutside,m=>{const b=m.detail.originalEvent,E=b.button===0&&b.ctrlKey===!0,C=b.button===2||E;(!s.modal||C)&&(h.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hz.displayName=pz;var kue="DropdownMenuGroup",mz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Rue,{...s,...l,ref:t})});mz.displayName=kue;var Uue="DropdownMenuLabel",vz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Tue,{...s,...l,ref:t})});vz.displayName=Uue;var Iue="DropdownMenuItem",gz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(_ue,{...s,...l,ref:t})});gz.displayName=Iue;var Hue="DropdownMenuCheckboxItem",yz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Aue,{...s,...l,ref:t})});yz.displayName=Hue;var Vue="DropdownMenuRadioGroup",bz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Due,{...s,...l,ref:t})});bz.displayName=Vue;var Fue="DropdownMenuRadioItem",xz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Mue,{...s,...l,ref:t})});xz.displayName=Fue;var Kue="DropdownMenuItemIndicator",Ez=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Oue,{...s,...l,ref:t})});Ez.displayName=Kue;var Gue="DropdownMenuSeparator",Sz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Nue,{...s,...l,ref:t})});Sz.displayName=Gue;var Yue="DropdownMenuArrow",Xue=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx($ue,{...s,...l,ref:t})});Xue.displayName=Yue;var Que=e=>{const{__scopeDropdownMenu:t,children:r,open:l,onOpenChange:s,defaultOpen:c}=e,h=vi(t),[m,b]=br({prop:l,defaultProp:c??!1,onChange:s,caller:"DropdownMenuSub"});return O.jsx(Pue,{...h,open:m,onOpenChange:b,children:r})},Zue="DropdownMenuSubTrigger",Cz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(que,{...s,...l,ref:t})});Cz.displayName=Zue;var Wue="DropdownMenuSubContent",wz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Lue,{...s,...l,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wz.displayName=Wue;var Jue=sz,ese=fz,Rz=dz,tse=hz,nse=mz,rse=vz,ase=gz,lse=yz,ose=bz,ise=xz,Tz=Ez,use=Sz,sse=Que,cse=Cz,fse=wz;const _z=e=>O.jsx(Jue,{"data-slot":"menu",...e}),Az=e=>O.jsx(ese,{"data-slot":"menu-trigger",...e}),dse=e=>O.jsx(nse,{"data-slot":"menu-group",...e}),pse=e=>O.jsx(Rz,{"data-slot":"menu-portal",...e}),Dz=e=>O.jsx(sse,{"data-slot":"menu-sub",...e}),hse=e=>O.jsx(ose,{"data-slot":"menu-radio-group",...e}),Mz=({className:e,inset:t,children:r,...l})=>O.jsxs(cse,{"data-slot":"menu-sub-trigger",className:Fe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state='open']:bg-accent",t&&"pl-8",e),...l,children:[r,O.jsx(Rw,{className:"ml-auto h-4 w-4"})]}),Oz=({className:e,...t})=>O.jsx(fse,{"data-slot":"menu-sub-content",className:Fe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state='open']:animate-in data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='open']:fade-in-0 data-[state='closed']:zoom-out-95 data-[state='open']:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}),Nz=({className:e,sideOffset:t=4,...r})=>O.jsx(Rz,{"data-slot":"menu-portal",children:O.jsx(tse,{"data-slot":"menu-content",sideOffset:t,className:Fe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state='open']:animate-in data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='open']:fade-in-0 data-[state='closed']:zoom-out-95 data-[state='open']:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}),$z=({className:e,inset:t,...r})=>O.jsx(ase,{"data-slot":"menu-item",className:Fe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}),Pz=({className:e,children:t,checked:r,...l})=>O.jsxs(lse,{"data-slot":"menu-checkbox-item",className:Fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...l,children:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(Tz,{children:O.jsx($T,{className:"h-4 w-4"})})}),t]}),qz=({className:e,children:t,...r})=>O.jsxs(ise,{"data-slot":"menu-radio-item",className:Fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(Tz,{children:O.jsx(iK,{className:"h-2 w-2 fill-current"})})}),t]}),Lz=({className:e,inset:t,...r})=>O.jsx(rse,{"data-slot":"menu-label",className:Fe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}),jz=({className:e,...t})=>O.jsx(use,{"data-slot":"menu-separator",className:Fe("-mx-1 my-1 h-px bg-muted",e),...t}),zz=({className:e,keys:t,handler:r,options:l={},...s})=>(nj(t,r,l),O.jsx("span",{"data-slot":"menu-shortcut",className:Fe("ml-auto text-xs tracking-widest opacity-60",e),...s})),Bz=(e,t)=>{switch(e.type){case"item":return O.jsxs($z,{...e,children:[e.label," ",t]});case"checkbox":return O.jsxs(Pz,{...e,children:[e.label," ",t]});case"radio":return O.jsxs(qz,{...e,children:[e.label," ",t]});case"label":return O.jsxs(Lz,{...e,children:[e.label," "]});case"separator":return O.jsx(jz,{...e});case"submenu":return O.jsxs(Dz,{children:[O.jsx(Mz,{...e,children:e.label}),O.jsx(Oz,{children:e.items?.map((r,l)=>O.jsx(k.Fragment,{children:Bz(r)},l))})]});default:return null}},mse=({trigger:e,items:t,contentProps:r,side:l="bottom",offset:s})=>O.jsxs(_z,{children:[O.jsx(Az,{asChild:!0,children:e}),O.jsx(Nz,{side:l,sideOffset:s,...r,children:t.map(({shortcut:c,onShortcut:h,shortcutOptions:m,...b},E)=>O.jsx(k.Fragment,{children:Bz(b,c&&O.jsx(zz,{keys:c,handler:C=>h?.(C),options:m,children:c}))},E))})]}),kz=$m("inline-flex items-center relative overflow-hidden bg-gray-100 gap-1 px-2.5 py-0.5 text-xs font-normal transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{rounded:{default:"rounded-(--radius-tag)",full:"rounded-full",square:"rounded-sm"},variant:{primary:"bg-primary border-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary border-secondary !text-secondary-foreground hover:bg-secondary/80",error:"bg-error border-error text-error-foreground hover:bg-error/80",success:"bg-success border-success text-success-foreground hover:bg-success/80",outline:"border border-foreground text-foreground",borderless:"text-foreground"}},defaultVariants:{rounded:"default",variant:"primary"}}),q2=({className:e,color:t,variant:r,rounded:l,icon:s,closable:c,onClose:h,children:m,...b})=>{const E=!!t&&(r==="outline"||r==="borderless"),C=!!t&&!r;return O.jsxs("div",{"data-slot":"tag",className:Fe(kz({variant:r,rounded:l}),E&&"bg-white",C&&" text-white",!!s&&"pl-1.5",!!c&&"pr-1.5",e),style:{...E&&{color:t,borderColor:t},...C&&{borderColor:t,backgroundColor:t}},...b,children:[s,m,c&&O.jsx("button",{type:"button","data-slot":"tag-close",className:"z-10 h-4 w-4 cursor-pointer",onClick:S=>{S.stopPropagation(),h()},children:O.jsx(h_,{"data-slot":"tag-close-icon"})}),O.jsx("span",{"data-slot":"tag-overlay",className:"w-full h-full absolute top-0 left-0",style:{...E&&{opacity:.13,backgroundColor:t}}})]})};function Uz(e){const t=vse(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(yse);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function vse(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=xse(s),m=bse(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gse=Symbol("radix.slottable");function yse(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gse}function bse(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function xse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Ese=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Iz=Ese.reduce((e,t)=>{const r=Uz(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),q_="Popover",[Hz]=xp(q_,[zg]),Fw=zg(),[Sse,kg]=Hz(q_),Vz=e=>{const{__scopePopover:t,children:r,open:l,defaultOpen:s,onOpenChange:c,modal:h=!1}=e,m=Fw(t),b=D.useRef(null),[E,C]=D.useState(!1),[S,R]=br({prop:l,defaultProp:s??!1,onChange:c,caller:q_});return O.jsx(zw,{...m,children:O.jsx(Sse,{scope:t,contentId:_a(),triggerRef:b,open:S,onOpenChange:R,onOpenToggle:D.useCallback(()=>R(M=>!M),[R]),hasCustomAnchor:E,onCustomAnchorAdd:D.useCallback(()=>C(!0),[]),onCustomAnchorRemove:D.useCallback(()=>C(!1),[]),modal:h,children:r})})};Vz.displayName=q_;var Fz="PopoverAnchor",Cse=D.forwardRef((e,t)=>{const{__scopePopover:r,...l}=e,s=kg(Fz,r),c=Fw(r),{onCustomAnchorAdd:h,onCustomAnchorRemove:m}=s;return D.useEffect(()=>(h(),()=>m()),[h,m]),O.jsx(Bw,{...c,...l,ref:t})});Cse.displayName=Fz;var Kz="PopoverTrigger",Gz=D.forwardRef((e,t)=>{const{__scopePopover:r,...l}=e,s=kg(Kz,r),c=Fw(r),h=vn(t,s.triggerRef),m=O.jsx(Iz.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Wz(s.open),...l,ref:h,onClick:gt(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?m:O.jsx(Bw,{asChild:!0,...c,children:m})});Gz.displayName=Kz;var hO="PopoverPortal",[wse,Rse]=Hz(hO,{forceMount:void 0}),Yz=e=>{const{__scopePopover:t,forceMount:r,children:l,container:s}=e,c=kg(hO,t);return O.jsx(wse,{scope:t,forceMount:r,children:O.jsx(Ts,{present:r||c.open,children:O.jsx(J1,{asChild:!0,container:s,children:l})})})};Yz.displayName=hO;var G1="PopoverContent",Xz=D.forwardRef((e,t)=>{const r=Rse(G1,e.__scopePopover),{forceMount:l=r.forceMount,...s}=e,c=kg(G1,e.__scopePopover);return O.jsx(Ts,{present:l||c.open,children:c.modal?O.jsx(_se,{...s,ref:t}):O.jsx(Ase,{...s,ref:t})})});Xz.displayName=G1;var Tse=Uz("PopoverContent.RemoveScroll"),_se=D.forwardRef((e,t)=>{const r=kg(G1,e.__scopePopover),l=D.useRef(null),s=vn(t,l),c=D.useRef(!1);return D.useEffect(()=>{const h=l.current;if(h)return ww(h)},[]),O.jsx(ex,{as:Tse,allowPinchZoom:!0,children:O.jsx(Qz,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:gt(e.onCloseAutoFocus,h=>{h.preventDefault(),c.current||r.triggerRef.current?.focus()}),onPointerDownOutside:gt(e.onPointerDownOutside,h=>{const m=h.detail.originalEvent,b=m.button===0&&m.ctrlKey===!0,E=m.button===2||b;c.current=E},{checkForDefaultPrevented:!1}),onFocusOutside:gt(e.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ase=D.forwardRef((e,t)=>{const r=kg(G1,e.__scopePopover),l=D.useRef(!1),s=D.useRef(!1);return O.jsx(Qz,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(l.current||r.triggerRef.current?.focus(),c.preventDefault()),l.current=!1,s.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(l.current=!0,c.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const h=c.target;r.triggerRef.current?.contains(h)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&s.current&&c.preventDefault()}})}),Qz=D.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:l,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:h,onEscapeKeyDown:m,onPointerDownOutside:b,onFocusOutside:E,onInteractOutside:C,...S}=e,R=kg(G1,r),M=Fw(r);return f_(),O.jsx(Sw,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:s,onUnmountAutoFocus:c,children:O.jsx(W1,{asChild:!0,disableOutsidePointerEvents:h,onInteractOutside:C,onEscapeKeyDown:m,onPointerDownOutside:b,onFocusOutside:E,onDismiss:()=>R.onOpenChange(!1),children:O.jsx(O_,{"data-state":Wz(R.open),role:"dialog",id:R.contentId,...M,...S,ref:t,style:{...S.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Zz="PopoverClose",Dse=D.forwardRef((e,t)=>{const{__scopePopover:r,...l}=e,s=kg(Zz,r);return O.jsx(Iz.button,{type:"button",...l,ref:t,onClick:gt(e.onClick,()=>s.onOpenChange(!1))})});Dse.displayName=Zz;var Mse="PopoverArrow",Ose=D.forwardRef((e,t)=>{const{__scopePopover:r,...l}=e,s=Fw(r);return O.jsx(N_,{...s,...l,ref:t})});Ose.displayName=Mse;function Wz(e){return e?"open":"closed"}var Nse=Vz,$se=Gz,Pse=Yz,qse=Xz;const Kw=e=>O.jsx(Nse,{"data-slot":"popover",...e}),Gw=e=>O.jsx($se,{"data-slot":"popover-trigger",...e}),Yw=({className:e,align:t="center",sideOffset:r=4,matchTriggerWidth:l=!1,style:s,focus:c=!0,...h})=>O.jsx(Pse,{children:O.jsx(qse,{"data-slot":"popover-content",align:t,sideOffset:r,onOpenAutoFocus:m=>{!c&&m.preventDefault(),h?.onOpenAutoFocus?.(m)},className:Fe("z-50 w-72 p-4 rounded-md border bg-popover text-popover-foreground shadow-md outline-none open:animate-in closed:animate-out closed:fade-out-0 open:fade-in-0 closed:zoom-out-95 open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),style:{...s,...l&&{width:"var(--radix-popper-anchor-width)"}},...h})}),Lse=e=>{const{trigger:t,children:r,rootProps:l,triggerProps:s,contentProps:c,triggerAsChild:h=!0,matchTriggerWidth:m,triggerClassName:b,contentClassName:E,side:C="bottom",offset:S}=Tw("Popover",e,{triggerAsChild:!0,side:"bottom"});return O.jsxs(Kw,{...l,children:[O.jsx(Gw,{asChild:h,className:b,...s,children:t}),O.jsx(Yw,{className:E,matchTriggerWidth:m,side:C,sideOffset:S,...c,children:r})]})},HP=$m("m-1 transition ease-in-out delay-150 duration-300",{variants:{variant:{default:"border-foreground/10 border text-foreground bg-card hover:bg-card/80",primary:"border-foreground/10 border text-foreground bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-foreground/60 border bg-secondary text-secondary-foreground hover:bg-secondary/80",error:"border-transparent bg-error text-error-foreground hover:bg-error/80"}},defaultVariants:{variant:"default"}}),jse=({valueKey:e,values:t,setValues:r,items:l,maxCount:s,setIsPopoverOpen:c})=>{const h=R=>{if(R.key==="Enter")c(!0);else if(R.key==="Backspace"&&!R.currentTarget.value){const M=[...t];M.pop(),r?.(M)}},m=R=>{const M=t.includes(R)?t.filter(q=>q!==R):[...t,R];r?.(M)},b=()=>{r?.([])};return{handleInputKeyDown:h,toggleOption:m,handleClear:b,handleTogglePopover:()=>{c(R=>!R)},clearExtraOptions:()=>{const R=t.slice(0,s);r?.(R)},toggleAll:()=>{const R=l.filter(M=>!M.disabled);if(t.length===R.length)b();else{const M=R.map(q=>q[e]);r?.(M)}}}},zse=({items:e=[],value:t,valueKey:r="value",labelKey:l="label",onChange:s,variant:c,defaultValue:h=[],placeholder:m="Seleccionar",maxCount:b=3,className:E,renderOption:C=L=>L[l],withCheckbox:S=!1,showSearch:R=!0,showSelectAll:M=!0,rootProps:q,...N})=>{const[L=[],P]=br({prop:t,onChange:s,defaultProp:h}),[U,I]=br({prop:N.open,onChange:N.onOpenChange,defaultProp:N.defaultOpen||!1}),Y=D.useMemo(()=>e.filter(W=>!W.disabled),[e]),{handleInputKeyDown:V,toggleOption:F,handleClear:K,handleTogglePopover:Q,clearExtraOptions:he,toggleAll:de}=jse({valueKey:r,values:L,setValues:P,items:e,maxCount:b,setIsPopoverOpen:I});return O.jsxs(Kw,{open:U,onOpenChange:I,"data-slot":"multi-select",...q,children:[O.jsx(Gw,{asChild:!0,"data-slot":"multi-select-trigger",children:O.jsx(hi,{...N,onClick:Q,className:Fe("flex w-full p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit",E),children:L.length>0?O.jsxs("div",{className:"flex justify-between items-center w-full",children:[O.jsxs("div",{className:"flex flex-wrap items-center","data-slot":"multi-select-tags",children:[L.slice(0,b).map(W=>{const se=e.find(ae=>ae[r]===W),le=se?.icon;return O.jsxs(q2,{"data-slot":"multi-select-tag",className:Fe(HP({variant:c})),closable:!0,onClose:()=>F(W),children:[le&&O.jsx(le,{className:"h-4 w-4 mr-2"}),se&&C?.(se)]},W)}),L.length>b&&O.jsx(q2,{"data-slot":"multi-select-tag",className:Fe(HP({variant:c})),closable:!0,onClose:he,children:`+ ${L.length-b} más`})]}),O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsx(h_,{"data-slot":"multi-select-clear",className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:W=>{W.stopPropagation(),K()}}),O.jsx(CL,{"data-slot":"multi-select-divider",orientation:"vertical",className:"flex min-h-6 h-full"}),O.jsx(PT,{"data-slot":"multi-select-trigger-icon",className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):O.jsxs("div",{className:"flex items-center justify-between w-full mx-auto","data-slot":"multi-select-trigger-empty",children:[O.jsx("span",{className:"text-sm text-foreground font-normal mx-2","data-slot":"multi-select-placeholder",children:m}),O.jsx(PT,{"data-slot":"multi-select-trigger-icon",className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),O.jsx(Yw,{"data-slot":"multi-select-content",className:"p-0",matchTriggerWidth:!0,align:"start",asChild:!0,onEscapeKeyDown:()=>I(!1),children:O.jsxs(Dw,{children:[R&&O.jsx(x_,{"data-slot":"multi-select-input",placeholder:"Buscar...",onKeyDown:V}),O.jsxs(E_,{"data-slot":"multi-select-list",children:[O.jsx(S_,{"data-slot":"multi-select-empty",children:"No results found."}),O.jsxs(b8,{"data-slot":"multi-select-group",children:[M&&O.jsxs(sw,{"data-slot":"multi-select-item",onSelect:de,className:Fe("cursor-pointer",!S&&L.length===Y.length&&"bg-accent text-accent-foreground"),children:[S&&O.jsx("div",{className:Fe("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",L.length===Y.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:O.jsx($T,{className:"h-4 w-4"})}),O.jsx("span",{children:"(Seleccionar todo)"})]},"all"),e.map(W=>{const se=L.includes(W[r]);return O.jsxs(sw,{"data-slot":"multi-select-item",onSelect:()=>!W.disabled&&F(W[r]),className:Fe(W.disabled?"!bg-neutral-50 !text-neutral-400":"cursor-pointer",!S&&se&&"!bg-accent !text-accent-foreground"),children:[S&&O.jsx("div",{className:Fe("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",se?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:O.jsx($T,{className:"h-4 w-4"})}),W.icon&&O.jsx(W.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),O.jsx("span",{children:C?.(W)})]},W[r])})]})]})]})})]})},Bse=({value:e,onChange:t,defaultValue:r,className:l,min:s,max:c,...h})=>{const[m,b]=br({prop:e,onChange:t,defaultProp:r}),E=m??s??0,C=q=>{const N=parseInt(q.target.value,10);b(N)},S=()=>{if(sr.isUndefined(m)&&sr.isNumber(s))return b(s??0);const q=E+1;(sr.isUndefined(c)||q<=c)&&b(q)},R=()=>{if(sr.isUndefined(m)&&sr.isNumber(c))return b(c??0);const q=E-1;(sr.isUndefined(s)||q>=s)&&b(q)},M=()=>{const q=sr.isNumber(s)&&E<s,N=sr.isNumber(c)&&E>c;q?b(s):N&&b(c)};return O.jsxs("div",{className:"relative w-full","data-slot":"number-input-container",children:[O.jsx("input",{...h,type:"number",value:m,onChange:C,onBlur:M,min:s,max:c,className:Fe("numberInput","h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","file:border-0 file:bg-transparent file:text-sm file:font-medium",l),"data-slot":"number-input"}),O.jsxs("div",{className:"absolute right-0 top-0 h-full w-6 py-1 gap-px justify-center items-center flex flex-col border-l border-input overflow-hidden",children:[O.jsx(hi,{variant:"ghost",size:"icon",onClick:S,className:"h-4 w-4 grow rounded-sm","data-testid":"increment-trigger","data-slot":"number-input-increment",children:O.jsx(q7,{"data-slot":"number-input-increment-icon"})}),O.jsx(hi,{variant:"ghost",size:"icon",onClick:R,className:"h-4 w-4 grow rounded-sm","data-testid":"decrement-trigger","data-slot":"number-input-decrement",children:O.jsx(P7,{"data-slot":"number-input-decrement-icon"})})]})]})},O1=({isActive:e=!1,...t})=>O.jsx("button",{...t,"data-slot":"pagination-option","data-active":e,"data-dots":t.children===Dg,className:Fe("transition-colors border py-2 px-4 w-[50px] h-full data-[active=false]:hover:bg-accent","data-[active=true]:bg-primary data-[active=true]:text-primary-foreground data-[active=true]:border-transparent data-[active=true]:hover:bg-primary/90",t.className)}),kse=({optionProps:e,className:t,containerProps:r,...l})=>{const{paginationRange:s,currentPage:c,goTo:h,maxPage:m,next:b,prev:E,isLastPage:C,isFirstPage:S}=rj(l);return O.jsxs("div",{...r,className:Fe("flex items-end select-none h-10",r?.className,t),"data-slot":"pagination",children:[O.jsxs(O1,{...e,disabled:S,onClick:()=>h(1),className:Fe("rounded-l-md",e?.className),children:[O.jsx(QF,{"data-slot":"pagination-option-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a primera página"})]}),O.jsxs(O1,{...e,onClick:E,disabled:S,children:[O.jsx(fM,{"data-slot":"pagination-option-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a página anterior"})]}),s.map(R=>O.jsx(O.Fragment,{children:R===Dg?O.jsx(O1,{className:Fe("pointer-events-none",e?.className),children:Dg},R):k.createElement(O1,{...e,isActive:R===c,onClick:()=>h(R),key:R},R,O.jsxs("span",{className:"sr-only",children:["Ir a la página ",R]}))})),O.jsxs(O1,{...e,onClick:b,disabled:C,children:[O.jsx(Rw,{"data-slot":"pagination-option-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a próxima página"})]}),O.jsxs(O1,{...e,disabled:C,onClick:()=>h(m),className:Fe("rounded-r-md",e?.className),children:[O.jsx(WF,{"data-slot":"pagination-option-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a última página"})]})]})},Use=({className:e,containerClassName:t,showIcon:r=O.jsx(pK,{className:"h-4 w-4"}),hideIcon:l=O.jsx(fK,{className:"h-4 w-4"}),onShow:s,onHide:c,toggleable:h=!0,...m})=>{const[b,E]=aj(!1),C=()=>{E(),b?c?.():s?.()};return O.jsxs("div",{className:Fe("relative",t),"data-slot":"password",children:[O.jsx(ej,{...m,type:b?"text":"password",className:Fe("pr-10","[&::-ms-reveal]:hidden [&::-ms-clear]:hidden",e)}),O.jsx("button",{"data-slot":"password-toggle",type:"button",onClick:C,disabled:!h,className:Fe("absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",h?"hover:text-gray-700":"opacity-50 cursor-not-allowed"),children:b?l:r})]})},Ise=({items:e=[],valueKey:t="value",labelKey:r="label",value:l,onChange:s,defaultValue:c,renderOption:h=N=>N?.[r],triggerProps:m,contentClassName:b,contentProps:E,itemClassName:C,itemProps:S,className:R,placeholder:M="Seleccionar",...q})=>{const[N,L]=br({prop:l,onChange:P=>{if(!s)return;const U=e.find(I=>I[t]===P);s?.(P,U)},defaultProp:c});return O.jsxs(MB,{...q,onValueChange:L,value:N,children:[O.jsx($B,{className:R,...m,children:O.jsx(NB,{placeholder:M})}),O.jsx(LB,{className:b,...E,children:O.jsx(OB,{children:e.map((P,U)=>k.createElement(zB,{...S,className:C,key:U,disabled:P?.disabled,value:P[t]},h?.(P)))})})]})};function VP(e,[t,r]){return Math.min(r,Math.max(t,e))}function Jz(e){const t=Hse(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(Fse);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Hse(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Gse(s),m=Kse(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vse=Symbol("radix.slottable");function Fse(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vse}function Kse(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Gse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Yse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_s=Yse.reduce((e,t)=>{const r=Jz(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function Xse(e){const t=D.useRef({value:e,previous:e});return D.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Qse(e){const t=Zse(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(Jse);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Zse(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=tce(s),m=ece(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wse=Symbol("radix.slottable");function Jse(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wse}function ece(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function tce(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var nce=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rce=nce.reduce((e,t)=>{const r=Qse(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),eB=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ace="VisuallyHidden",tB=D.forwardRef((e,t)=>O.jsx(rce.span,{...e,ref:t,style:{...eB,...e.style}}));tB.displayName=ace;var lce=tB,oce=[" ","Enter","ArrowUp","ArrowDown"],ice=[" ","Enter"],a0="Select",[L_,j_,uce]=XM(a0),[lx]=xp(a0,[uce,zg]),z_=zg(),[sce,Ug]=lx(a0),[cce,fce]=lx(a0),nB=e=>{const{__scopeSelect:t,children:r,open:l,defaultOpen:s,onOpenChange:c,value:h,defaultValue:m,onValueChange:b,dir:E,name:C,autoComplete:S,disabled:R,required:M,form:q}=e,N=z_(t),[L,P]=D.useState(null),[U,I]=D.useState(null),[Y,V]=D.useState(!1),F=QM(E),[K,Q]=br({prop:l,defaultProp:s??!1,onChange:c,caller:a0}),[he,de]=br({prop:h,defaultProp:m,onChange:b,caller:a0}),W=D.useRef(null),se=L?q||!!L.closest("form"):!0,[le,ae]=D.useState(new Set),xe=Array.from(le).map(B=>B.props.value).join(";");return O.jsx(zw,{...N,children:O.jsxs(sce,{required:M,scope:t,trigger:L,onTriggerChange:P,valueNode:U,onValueNodeChange:I,valueNodeHasChildren:Y,onValueNodeHasChildrenChange:V,contentId:_a(),value:he,onValueChange:de,open:K,onOpenChange:Q,dir:F,triggerPointerDownPosRef:W,disabled:R,children:[O.jsx(L_.Provider,{scope:t,children:O.jsx(cce,{scope:e.__scopeSelect,onNativeOptionAdd:D.useCallback(B=>{ae(Z=>new Set(Z).add(B))},[]),onNativeOptionRemove:D.useCallback(B=>{ae(Z=>{const te=new Set(Z);return te.delete(B),te})},[]),children:r})}),se?O.jsxs(TB,{"aria-hidden":!0,required:M,tabIndex:-1,name:C,autoComplete:S,value:he,onChange:B=>de(B.target.value),disabled:R,form:q,children:[he===void 0?O.jsx("option",{value:""}):null,Array.from(le)]},xe):null]})})};nB.displayName=a0;var rB="SelectTrigger",aB=D.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:l=!1,...s}=e,c=z_(r),h=Ug(rB,r),m=h.disabled||l,b=vn(t,h.onTriggerChange),E=j_(r),C=D.useRef("touch"),[S,R,M]=AB(N=>{const L=E().filter(I=>!I.disabled),P=L.find(I=>I.value===h.value),U=DB(L,N,P);U!==void 0&&h.onValueChange(U.value)}),q=N=>{m||(h.onOpenChange(!0),M()),N&&(h.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})};return O.jsx(Bw,{asChild:!0,...c,children:O.jsx(_s.button,{type:"button",role:"combobox","aria-controls":h.contentId,"aria-expanded":h.open,"aria-required":h.required,"aria-autocomplete":"none",dir:h.dir,"data-state":h.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":_B(h.value)?"":void 0,...s,ref:b,onClick:gt(s.onClick,N=>{N.currentTarget.focus(),C.current!=="mouse"&&q(N)}),onPointerDown:gt(s.onPointerDown,N=>{C.current=N.pointerType;const L=N.target;L.hasPointerCapture(N.pointerId)&&L.releasePointerCapture(N.pointerId),N.button===0&&N.ctrlKey===!1&&N.pointerType==="mouse"&&(q(N),N.preventDefault())}),onKeyDown:gt(s.onKeyDown,N=>{const L=S.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&R(N.key),!(L&&N.key===" ")&&oce.includes(N.key)&&(q(),N.preventDefault())})})})});aB.displayName=rB;var lB="SelectValue",oB=D.forwardRef((e,t)=>{const{__scopeSelect:r,className:l,style:s,children:c,placeholder:h="",...m}=e,b=Ug(lB,r),{onValueNodeHasChildrenChange:E}=b,C=c!==void 0,S=vn(t,b.onValueNodeChange);return Vl(()=>{E(C)},[E,C]),O.jsx(_s.span,{...m,ref:S,style:{pointerEvents:"none"},children:_B(b.value)?O.jsx(O.Fragment,{children:h}):c})});oB.displayName=lB;var dce="SelectIcon",iB=D.forwardRef((e,t)=>{const{__scopeSelect:r,children:l,...s}=e;return O.jsx(_s.span,{"aria-hidden":!0,...s,ref:t,children:l||"▼"})});iB.displayName=dce;var pce="SelectPortal",uB=e=>O.jsx(J1,{asChild:!0,...e});uB.displayName=pce;var l0="SelectContent",sB=D.forwardRef((e,t)=>{const r=Ug(l0,e.__scopeSelect),[l,s]=D.useState();if(Vl(()=>{s(new DocumentFragment)},[]),!r.open){const c=l;return c?X1.createPortal(O.jsx(cB,{scope:e.__scopeSelect,children:O.jsx(L_.Slot,{scope:e.__scopeSelect,children:O.jsx("div",{children:e.children})})}),c):null}return O.jsx(fB,{...e,ref:t})});sB.displayName=l0;var Gf=10,[cB,Ig]=lx(l0),hce="SelectContentImpl",mce=Jz("SelectContent.RemoveScroll"),fB=D.forwardRef((e,t)=>{const{__scopeSelect:r,position:l="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:c,onPointerDownOutside:h,side:m,sideOffset:b,align:E,alignOffset:C,arrowPadding:S,collisionBoundary:R,collisionPadding:M,sticky:q,hideWhenDetached:N,avoidCollisions:L,...P}=e,U=Ug(l0,r),[I,Y]=D.useState(null),[V,F]=D.useState(null),K=vn(t,_e=>Y(_e)),[Q,he]=D.useState(null),[de,W]=D.useState(null),se=j_(r),[le,ae]=D.useState(!1),xe=D.useRef(!1);D.useEffect(()=>{if(I)return ww(I)},[I]),f_();const B=D.useCallback(_e=>{const[Je,...ie]=se().map(Ae=>Ae.ref.current),[ke]=ie.slice(-1),Ee=document.activeElement;for(const Ae of _e)if(Ae===Ee||(Ae?.scrollIntoView({block:"nearest"}),Ae===Je&&V&&(V.scrollTop=0),Ae===ke&&V&&(V.scrollTop=V.scrollHeight),Ae?.focus(),document.activeElement!==Ee))return},[se,V]),Z=D.useCallback(()=>B([Q,I]),[B,Q,I]);D.useEffect(()=>{le&&Z()},[le,Z]);const{onOpenChange:te,triggerPointerDownPosRef:be}=U;D.useEffect(()=>{if(I){let _e={x:0,y:0};const Je=ke=>{_e={x:Math.abs(Math.round(ke.pageX)-(be.current?.x??0)),y:Math.abs(Math.round(ke.pageY)-(be.current?.y??0))}},ie=ke=>{_e.x<=10&&_e.y<=10?ke.preventDefault():I.contains(ke.target)||te(!1),document.removeEventListener("pointermove",Je),be.current=null};return be.current!==null&&(document.addEventListener("pointermove",Je),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Je),document.removeEventListener("pointerup",ie,{capture:!0})}}},[I,te,be]),D.useEffect(()=>{const _e=()=>te(!1);return window.addEventListener("blur",_e),window.addEventListener("resize",_e),()=>{window.removeEventListener("blur",_e),window.removeEventListener("resize",_e)}},[te]);const[re,oe]=AB(_e=>{const Je=se().filter(Ee=>!Ee.disabled),ie=Je.find(Ee=>Ee.ref.current===document.activeElement),ke=DB(Je,_e,ie);ke&&setTimeout(()=>ke.ref.current.focus())}),ue=D.useCallback((_e,Je,ie)=>{const ke=!xe.current&&!ie;(U.value!==void 0&&U.value===Je||ke)&&(he(_e),ke&&(xe.current=!0))},[U.value]),ce=D.useCallback(()=>I?.focus(),[I]),De=D.useCallback((_e,Je,ie)=>{const ke=!xe.current&&!ie;(U.value!==void 0&&U.value===Je||ke)&&W(_e)},[U.value]),je=l==="popper"?L2:dB,Ke=je===L2?{side:m,sideOffset:b,align:E,alignOffset:C,arrowPadding:S,collisionBoundary:R,collisionPadding:M,sticky:q,hideWhenDetached:N,avoidCollisions:L}:{};return O.jsx(cB,{scope:r,content:I,viewport:V,onViewportChange:F,itemRefCallback:ue,selectedItem:Q,onItemLeave:ce,itemTextRefCallback:De,focusSelectedItem:Z,selectedItemText:de,position:l,isPositioned:le,searchRef:re,children:O.jsx(ex,{as:mce,allowPinchZoom:!0,children:O.jsx(Sw,{asChild:!0,trapped:U.open,onMountAutoFocus:_e=>{_e.preventDefault()},onUnmountAutoFocus:gt(s,_e=>{U.trigger?.focus({preventScroll:!0}),_e.preventDefault()}),children:O.jsx(W1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:_e=>_e.preventDefault(),onDismiss:()=>U.onOpenChange(!1),children:O.jsx(je,{role:"listbox",id:U.contentId,"data-state":U.open?"open":"closed",dir:U.dir,onContextMenu:_e=>_e.preventDefault(),...P,...Ke,onPlaced:()=>ae(!0),ref:K,style:{display:"flex",flexDirection:"column",outline:"none",...P.style},onKeyDown:gt(P.onKeyDown,_e=>{const Je=_e.ctrlKey||_e.altKey||_e.metaKey;if(_e.key==="Tab"&&_e.preventDefault(),!Je&&_e.key.length===1&&oe(_e.key),["ArrowUp","ArrowDown","Home","End"].includes(_e.key)){let ke=se().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(_e.key)&&(ke=ke.slice().reverse()),["ArrowUp","ArrowDown"].includes(_e.key)){const Ee=_e.target,Ae=ke.indexOf(Ee);ke=ke.slice(Ae+1)}setTimeout(()=>B(ke)),_e.preventDefault()}})})})})})})});fB.displayName=hce;var vce="SelectItemAlignedPosition",dB=D.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:l,...s}=e,c=Ug(l0,r),h=Ig(l0,r),[m,b]=D.useState(null),[E,C]=D.useState(null),S=vn(t,K=>C(K)),R=j_(r),M=D.useRef(!1),q=D.useRef(!0),{viewport:N,selectedItem:L,selectedItemText:P,focusSelectedItem:U}=h,I=D.useCallback(()=>{if(c.trigger&&c.valueNode&&m&&E&&N&&L&&P){const K=c.trigger.getBoundingClientRect(),Q=E.getBoundingClientRect(),he=c.valueNode.getBoundingClientRect(),de=P.getBoundingClientRect();if(c.dir!=="rtl"){const Ee=de.left-Q.left,Ae=he.left-Ee,ot=K.left-Ae,vt=K.width+ot,Xt=Math.max(vt,Q.width),Nt=window.innerWidth-Gf,Kn=VP(Ae,[Gf,Math.max(Gf,Nt-Xt)]);m.style.minWidth=vt+"px",m.style.left=Kn+"px"}else{const Ee=Q.right-de.right,Ae=window.innerWidth-he.right-Ee,ot=window.innerWidth-K.right-Ae,vt=K.width+ot,Xt=Math.max(vt,Q.width),Nt=window.innerWidth-Gf,Kn=VP(Ae,[Gf,Math.max(Gf,Nt-Xt)]);m.style.minWidth=vt+"px",m.style.right=Kn+"px"}const W=R(),se=window.innerHeight-Gf*2,le=N.scrollHeight,ae=window.getComputedStyle(E),xe=parseInt(ae.borderTopWidth,10),B=parseInt(ae.paddingTop,10),Z=parseInt(ae.borderBottomWidth,10),te=parseInt(ae.paddingBottom,10),be=xe+B+le+te+Z,re=Math.min(L.offsetHeight*5,be),oe=window.getComputedStyle(N),ue=parseInt(oe.paddingTop,10),ce=parseInt(oe.paddingBottom,10),De=K.top+K.height/2-Gf,je=se-De,Ke=L.offsetHeight/2,_e=L.offsetTop+Ke,Je=xe+B+_e,ie=be-Je;if(Je<=De){const Ee=W.length>0&&L===W[W.length-1].ref.current;m.style.bottom="0px";const Ae=E.clientHeight-N.offsetTop-N.offsetHeight,ot=Math.max(je,Ke+(Ee?ce:0)+Ae+Z),vt=Je+ot;m.style.height=vt+"px"}else{const Ee=W.length>0&&L===W[0].ref.current;m.style.top="0px";const ot=Math.max(De,xe+N.offsetTop+(Ee?ue:0)+Ke)+ie;m.style.height=ot+"px",N.scrollTop=Je-De+N.offsetTop}m.style.margin=`${Gf}px 0`,m.style.minHeight=re+"px",m.style.maxHeight=se+"px",l?.(),requestAnimationFrame(()=>M.current=!0)}},[R,c.trigger,c.valueNode,m,E,N,L,P,c.dir,l]);Vl(()=>I(),[I]);const[Y,V]=D.useState();Vl(()=>{E&&V(window.getComputedStyle(E).zIndex)},[E]);const F=D.useCallback(K=>{K&&q.current===!0&&(I(),U?.(),q.current=!1)},[I,U]);return O.jsx(yce,{scope:r,contentWrapper:m,shouldExpandOnScrollRef:M,onScrollButtonChange:F,children:O.jsx("div",{ref:b,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:Y},children:O.jsx(_s.div,{...s,ref:S,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});dB.displayName=vce;var gce="SelectPopperPosition",L2=D.forwardRef((e,t)=>{const{__scopeSelect:r,align:l="start",collisionPadding:s=Gf,...c}=e,h=z_(r);return O.jsx(O_,{...h,...c,ref:t,align:l,collisionPadding:s,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});L2.displayName=gce;var[yce,mO]=lx(l0,{}),j2="SelectViewport",pB=D.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:l,...s}=e,c=Ig(j2,r),h=mO(j2,r),m=vn(t,c.onViewportChange),b=D.useRef(0);return O.jsxs(O.Fragment,{children:[O.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),O.jsx(L_.Slot,{scope:r,children:O.jsx(_s.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:gt(s.onScroll,E=>{const C=E.currentTarget,{contentWrapper:S,shouldExpandOnScrollRef:R}=h;if(R?.current&&S){const M=Math.abs(b.current-C.scrollTop);if(M>0){const q=window.innerHeight-Gf*2,N=parseFloat(S.style.minHeight),L=parseFloat(S.style.height),P=Math.max(N,L);if(P<q){const U=P+M,I=Math.min(q,U),Y=U-I;S.style.height=I+"px",S.style.bottom==="0px"&&(C.scrollTop=Y>0?Y:0,S.style.justifyContent="flex-end")}}}b.current=C.scrollTop})})})]})});pB.displayName=j2;var hB="SelectGroup",[bce,xce]=lx(hB),mB=D.forwardRef((e,t)=>{const{__scopeSelect:r,...l}=e,s=_a();return O.jsx(bce,{scope:r,id:s,children:O.jsx(_s.div,{role:"group","aria-labelledby":s,...l,ref:t})})});mB.displayName=hB;var vB="SelectLabel",gB=D.forwardRef((e,t)=>{const{__scopeSelect:r,...l}=e,s=xce(vB,r);return O.jsx(_s.div,{id:s.id,...l,ref:t})});gB.displayName=vB;var t_="SelectItem",[Ece,yB]=lx(t_),bB=D.forwardRef((e,t)=>{const{__scopeSelect:r,value:l,disabled:s=!1,textValue:c,...h}=e,m=Ug(t_,r),b=Ig(t_,r),E=m.value===l,[C,S]=D.useState(c??""),[R,M]=D.useState(!1),q=vn(t,U=>b.itemRefCallback?.(U,l,s)),N=_a(),L=D.useRef("touch"),P=()=>{s||(m.onValueChange(l),m.onOpenChange(!1))};if(l==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return O.jsx(Ece,{scope:r,value:l,disabled:s,textId:N,isSelected:E,onItemTextChange:D.useCallback(U=>{S(I=>I||(U?.textContent??"").trim())},[]),children:O.jsx(L_.ItemSlot,{scope:r,value:l,disabled:s,textValue:C,children:O.jsx(_s.div,{role:"option","aria-labelledby":N,"data-highlighted":R?"":void 0,"aria-selected":E&&R,"data-state":E?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...h,ref:q,onFocus:gt(h.onFocus,()=>M(!0)),onBlur:gt(h.onBlur,()=>M(!1)),onClick:gt(h.onClick,()=>{L.current!=="mouse"&&P()}),onPointerUp:gt(h.onPointerUp,()=>{L.current==="mouse"&&P()}),onPointerDown:gt(h.onPointerDown,U=>{L.current=U.pointerType}),onPointerMove:gt(h.onPointerMove,U=>{L.current=U.pointerType,s?b.onItemLeave?.():L.current==="mouse"&&U.currentTarget.focus({preventScroll:!0})}),onPointerLeave:gt(h.onPointerLeave,U=>{U.currentTarget===document.activeElement&&b.onItemLeave?.()}),onKeyDown:gt(h.onKeyDown,U=>{b.searchRef?.current!==""&&U.key===" "||(ice.includes(U.key)&&P(),U.key===" "&&U.preventDefault())})})})})});bB.displayName=t_;var tw="SelectItemText",xB=D.forwardRef((e,t)=>{const{__scopeSelect:r,className:l,style:s,...c}=e,h=Ug(tw,r),m=Ig(tw,r),b=yB(tw,r),E=fce(tw,r),[C,S]=D.useState(null),R=vn(t,P=>S(P),b.onItemTextChange,P=>m.itemTextRefCallback?.(P,b.value,b.disabled)),M=C?.textContent,q=D.useMemo(()=>O.jsx("option",{value:b.value,disabled:b.disabled,children:M},b.value),[b.disabled,b.value,M]),{onNativeOptionAdd:N,onNativeOptionRemove:L}=E;return Vl(()=>(N(q),()=>L(q)),[N,L,q]),O.jsxs(O.Fragment,{children:[O.jsx(_s.span,{id:b.textId,...c,ref:R}),b.isSelected&&h.valueNode&&!h.valueNodeHasChildren?X1.createPortal(c.children,h.valueNode):null]})});xB.displayName=tw;var EB="SelectItemIndicator",Sce=D.forwardRef((e,t)=>{const{__scopeSelect:r,...l}=e;return yB(EB,r).isSelected?O.jsx(_s.span,{"aria-hidden":!0,...l,ref:t}):null});Sce.displayName=EB;var z2="SelectScrollUpButton",SB=D.forwardRef((e,t)=>{const r=Ig(z2,e.__scopeSelect),l=mO(z2,e.__scopeSelect),[s,c]=D.useState(!1),h=vn(t,l.onScrollButtonChange);return Vl(()=>{if(r.viewport&&r.isPositioned){let m=function(){const E=b.scrollTop>0;c(E)};const b=r.viewport;return m(),b.addEventListener("scroll",m),()=>b.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),s?O.jsx(wB,{...e,ref:h,onAutoScroll:()=>{const{viewport:m,selectedItem:b}=r;m&&b&&(m.scrollTop=m.scrollTop-b.offsetHeight)}}):null});SB.displayName=z2;var B2="SelectScrollDownButton",CB=D.forwardRef((e,t)=>{const r=Ig(B2,e.__scopeSelect),l=mO(B2,e.__scopeSelect),[s,c]=D.useState(!1),h=vn(t,l.onScrollButtonChange);return Vl(()=>{if(r.viewport&&r.isPositioned){let m=function(){const E=b.scrollHeight-b.clientHeight,C=Math.ceil(b.scrollTop)<E;c(C)};const b=r.viewport;return m(),b.addEventListener("scroll",m),()=>b.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),s?O.jsx(wB,{...e,ref:h,onAutoScroll:()=>{const{viewport:m,selectedItem:b}=r;m&&b&&(m.scrollTop=m.scrollTop+b.offsetHeight)}}):null});CB.displayName=B2;var wB=D.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:l,...s}=e,c=Ig("SelectScrollButton",r),h=D.useRef(null),m=j_(r),b=D.useCallback(()=>{h.current!==null&&(window.clearInterval(h.current),h.current=null)},[]);return D.useEffect(()=>()=>b(),[b]),Vl(()=>{m().find(C=>C.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[m]),O.jsx(_s.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:gt(s.onPointerDown,()=>{h.current===null&&(h.current=window.setInterval(l,50))}),onPointerMove:gt(s.onPointerMove,()=>{c.onItemLeave?.(),h.current===null&&(h.current=window.setInterval(l,50))}),onPointerLeave:gt(s.onPointerLeave,()=>{b()})})}),Cce="SelectSeparator",RB=D.forwardRef((e,t)=>{const{__scopeSelect:r,...l}=e;return O.jsx(_s.div,{"aria-hidden":!0,...l,ref:t})});RB.displayName=Cce;var k2="SelectArrow",wce=D.forwardRef((e,t)=>{const{__scopeSelect:r,...l}=e,s=z_(r),c=Ug(k2,r),h=Ig(k2,r);return c.open&&h.position==="popper"?O.jsx(N_,{...s,...l,ref:t}):null});wce.displayName=k2;var Rce="SelectBubbleInput",TB=D.forwardRef(({__scopeSelect:e,value:t,...r},l)=>{const s=D.useRef(null),c=vn(l,s),h=Xse(t);return D.useEffect(()=>{const m=s.current;if(!m)return;const b=window.HTMLSelectElement.prototype,C=Object.getOwnPropertyDescriptor(b,"value").set;if(h!==t&&C){const S=new Event("change",{bubbles:!0});C.call(m,t),m.dispatchEvent(S)}},[h,t]),O.jsx(_s.select,{...r,style:{...eB,...r.style},ref:c,defaultValue:t})});TB.displayName=Rce;function _B(e){return e===""||e===void 0}function AB(e){const t=Yo(e),r=D.useRef(""),l=D.useRef(0),s=D.useCallback(h=>{const m=r.current+h;t(m),(function b(E){r.current=E,window.clearTimeout(l.current),E!==""&&(l.current=window.setTimeout(()=>b(""),1e3))})(m)},[t]),c=D.useCallback(()=>{r.current="",window.clearTimeout(l.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(l.current),[]),[r,s,c]}function DB(e,t,r){const s=t.length>1&&Array.from(t).every(E=>E===t[0])?t[0]:t,c=r?e.indexOf(r):-1;let h=Tce(e,Math.max(c,0));s.length===1&&(h=h.filter(E=>E!==r));const b=h.find(E=>E.textValue.toLowerCase().startsWith(s.toLowerCase()));return b!==r?b:void 0}function Tce(e,t){return e.map((r,l)=>e[(t+l)%e.length])}var _ce=nB,Ace=aB,Dce=oB,Mce=iB,Oce=uB,Nce=sB,$ce=pB,Pce=mB,qce=gB,Lce=bB,jce=xB,zce=SB,Bce=CB,kce=RB;const MB=e=>O.jsx(_ce,{"data-slot":"select",...e}),OB=({heading:e,children:t,...r})=>O.jsxs(Pce,{"data-slot":"select-group",...r,children:[e&&O.jsx(jB,{children:e}),t]}),NB=e=>O.jsx(Dce,{"data-slot":"select-value",...e}),$B=({className:e,children:t,...r})=>O.jsxs(Ace,{"data-slot":"select-trigger",className:Fe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,O.jsx(Mce,{asChild:!0,"data-slot":"select-trigger-icon",children:O.jsx(PT,{className:"h-4 w-4 shrink-0 opacity-50"})})]}),PB=({className:e,...t})=>O.jsx(zce,{"data-slot":"select-scroll-up",className:Fe("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(q7,{className:"h-4 w-4"})}),qB=({className:e,...t})=>O.jsx(Bce,{"data-slot":"select-scroll-down",className:Fe("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(P7,{className:"h-4 w-4"})}),LB=({className:e,children:t,position:r="popper",...l})=>O.jsx(Oce,{children:O.jsxs(Nce,{"data-slot":"select-content",className:Fe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md open:animate-in closed:animate-out closed:fade-out-0 open:fade-in-0 closed:zoom-out-95 open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...l,children:[O.jsx(PB,{}),O.jsx($ce,{"data-slot":"select-viewport",className:Fe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),O.jsx(qB,{})]})}),jB=({className:e,...t})=>O.jsx(qce,{"data-slot":"select-label",className:Fe("py-1.5 px-2 text-sm font-semibold",e),...t}),zB=({className:e,children:t,...r})=>O.jsx(Lce,{"data-slot":"select-item",className:Fe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 px-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:O.jsx(jce,{"data-slot":"select-item-text",children:t})}),Uce=({className:e,...t})=>O.jsx(kce,{"data-slot":"select-separator",className:Fe("-mx-1 my-1 h-px bg-muted",e),...t}),Ice=({isCircle:e,width:t,height:r,isLoading:l=!1,...s})=>{const c={width:t,height:r,...s.style};return!l&&s.children?s.children:O.jsx("div",{"data-slot":"skeleton",...s,className:Fe("[&>*]:opacity-0 w-fit","rounded w-full animate-pulse bg-muted min-h-[1.5em]",e&&"rounded-[50%] aspect-square",s.className),style:c})},Hce=({inline:e=!1,justify:t,align:r,direction:l="horizontal",gap:s=8,style:c,...h})=>{const m={display:e?"inline-flex":"flex",flexDirection:l==="vertical"?"column":"row",justifyContent:t,alignItems:r,gap:s};return O.jsx("div",{style:{...m,...c},...h,"data-slot":"stack"})},[BB,Vce]=Mw();function Fce({items:e=[],current:t,onChange:r,className:l,classNameList:s,classNameItem:c,classNameButton:h,classNameIndicator:m,classNameContent:b}){return O.jsxs(kB,{className:l,current:t,onChange:r,children:[O.jsx(UB,{className:s,children:e?.map((E,C)=>O.jsx(IB,{value:C,title:E?.title,indicator:E?.indicator,classNameItem:c,classNameButton:h,classNameIndicator:m},C))}),e?.map((E,C)=>O.jsx(HB,{className:b,value:C,children:E?.content},C))]})}function kB({current:e,onChange:t,className:r,...l}){const[s=0,c]=br({prop:e,onChange:t,defaultProp:0});return O.jsx(Vce,{value:{activeStep:s,setActiveStep:c},children:O.jsx("div",{"data-slot":"stepper",className:Fe("flex flex-col items-center w-full transition-all ease-in delay-150",r),...l})})}function UB({children:e,className:t,...r}){return O.jsx("ul",{"data-slot":"stepper-list",className:Fe("flex flex-col sm:flex-row sm:gap-0 gap-4 items-center w-full text-xs font-medium text-gray-900 sm:text-base mb-8",t),...r,children:e})}function IB({disabled:e,value:t,title:r,indicator:l,classNameItem:s,classNameButton:c,classNameIndicator:h}){const{activeStep:m,setActiveStep:b}=BB();return O.jsx("li",{"data-slot":"stepper-trigger",className:Fe("flex relative text-primary transition-all ease-in delay-150","last:w-full last:sm:w-auto last:after:hidden",`w-full after:content-[''] sm:after:w-full after:h-full after:w-0.5 sm:after:h-0.5 ${m>t?"after:bg-primary":"after:bg-gray-300"} after:inline-block after:absolute after:top-5 sm:after:top-5 after:left-4 sm:after:left-10`,s),children:O.jsxs("button",{onClick:()=>!e&&b(t),className:Fe("z-10 flex items-center justify-center sm:flex-col gap-3 flex-row whitespace-nowrap cursor-pointer group transition-color ease-in delay-150",m>=t?"text-primary":"text-gray-500",e&&"cursor-not-allowed",c),children:[O.jsx("span",{"data-slot":"stepper-trigger-indicator",className:Fe("flex items-center transition-all overflow-hidden ease-in justify-center group-hover:scale-105 sm:w-10 sm:h-10 mx-auto text-sm border-2 rounded-full w-8 h-8",m>t&&"bg-primary border-primary text-primary-foreground",m===t&&"bg-gray-100 text-primary border-primary",m<t&&"bg-white text-gray-500 border-input",e&&"text-gray-300",h),children:m>t?"✓":l||t+1}),r]})})}function HB({value:e,className:t="w-full",...r}){const{activeStep:l}=BB();return l===e?O.jsx("div",{"data-slot":"stepper-content",className:t,...r}):null}const Kce=({className:e,children:t,containerProps:r,containerClassName:l,...s})=>{const c=k.useId(),[h=!1,m]=br({prop:s.checked,onChange:s.onChange,defaultProp:s.defaultChecked}),b=()=>!s.disabled&&m(S=>!S),E=h?"checked":"unchecked",C=s.id??c;return O.jsxs("div",{"data-slot":"switch",...r,className:Fe("flex gap-x-2 items-center",l),children:[O.jsxs("button",{"data-slot":"switch-trigger",disabled:s.disabled,onClick:b,"data-state":E,type:"button",className:Fe("peer w-11 h-6 bg-input rounded-full border-2 border-transparent transition-colors","data-[state=checked]:bg-primary",e),children:[O.jsx("div",{"data-state":E,className:Fe("w-5 h-5 pointers-event-none bg-primary-foreground rounded-full transition-all","transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")}),O.jsx("input",{...s,id:C,checked:h,onChange:S=>m(S.currentTarget.checked),type:"checkbox",className:"sr-only","aria-hidden":!0})]}),t&&O.jsx($w,{htmlFor:C,children:t})]})},VB=({className:e,containerClassName:t,containerProps:r,...l})=>O.jsx("div",{"data-slot":"table-container",className:Fe("relative w-full overflow-auto rounded-md border",t),...r,children:O.jsx("table",{"data-slot":"table",className:Fe("w-full caption-bottom text-sm",e),...l})}),FB=({className:e,...t})=>O.jsx("thead",{"data-slot":"table-header",className:Fe("[&_tr]:border-b",e),...t}),KB=({className:e,...t})=>O.jsx("tbody",{"data-slot":"table-body",className:Fe("[&_tr:last-child]:border-0",e),...t}),Gce=({className:e,...t})=>O.jsx("tfoot",{"data-slot":"table-footer",className:Fe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}),U2=({className:e,...t})=>O.jsx("tr",{"data-slot":"table-row",className:Fe("border-b transition-colors hover:bg-muted data-[selected=true]:bg-muted",e),...t}),GB=({className:e,...t})=>O.jsx("th",{"data-slot":"table-head",className:Fe("h-12 px-4 text-left align-middle font-medium text-muted-foreground sticky top-0 bg-background [&:has([role=checkbox])]:pr-0",e),...t}),YB=({className:e,...t})=>O.jsx("td",{"data-slot":"table-cell",className:Fe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}),Yce=({className:e,...t})=>O.jsx("caption",{"data-slot":"table-caption",className:Fe("mt-4 text-sm text-muted-foreground",e),...t}),Xce=({data:e=[],columns:t=[],onRowClick:r,onDoubleClick:l,selected:s,theadClassName:c,theadProps:h,tbodyClassName:m,tbodyProps:b,trClassName:E,trProps:C,thClassName:S,thProps:R,tdClassName:M,tdProps:q,...N})=>O.jsxs(VB,{...N,className:Fe(N?.className),children:[O.jsx(FB,{...h,className:Fe(h?.className,c),children:O.jsx(U2,{...C,className:Fe(C?.className,E),children:t.map((L,P)=>O.jsx(GB,{...R,className:Fe(R?.className,S),style:{width:L.width},children:sr.isFunction(L.header)?L.header?.():L.header},P))})}),O.jsx(KB,{...b,className:Fe(b?.className,m),children:e.map((L,P)=>O.jsx(U2,{...C,"data-selected":s?.(L),className:Fe(C?.className,E),children:t.map((U,I)=>O.jsx(YB,{...q,onClick:Y=>{q?.onClick?.(Y),r?.(L)},onDoubleClick:()=>l?.(L),className:Fe(q?.className,M),children:U.cell?.(L,I)||L[U.key]},I))},P))})]}),AT=[10,25,50],Qce=({containerClassName:e,containerProps:t,selectClassName:r,selectProps:l,sizes:s=AT,...c})=>{const[h=AT[0],m]=br({onChange:c?.setPageSize,prop:c?.pageSize,defaultProp:AT[0]}),{range:b,next:E,prev:C,isFirstPage:S,isLastPage:R,goTo:M}=YM({...c,pageSize:h}),q=N=>{const{value:L}=N.target,P=Number(L);m(P),M(1)};return O.jsxs("div",{"data-slot":"table-pagination",...t,className:Fe("flex justify-center items-center gap-x-4 bg-background border border-[#D9D9D9] rounded-2xl py-2",e),children:[s&&O.jsx("select",{"data-slot":"table-pagination-size-trigger",...l,value:h,onChange:q,className:Fe("border border-input rounded-md w-fit min-w-[3rem] bg-background p-2 ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),children:s.map((N,L)=>O.jsx("option",{value:N,"data-slot":"table-pagination-size-option",children:N},L))}),O.jsxs("span",{"data-slot":"table-pagination-range",children:[b.start," - ",b.end," de ",c.totalItems]}),O.jsxs("div",{className:"flex gap-2",children:[O.jsx(hi,{"data-slot":"table-pagination-prev",size:"icon",variant:"ghost",disabled:S,onClick:C,children:O.jsx(fM,{"data-slot":"table-pagination-prev-icon"})}),O.jsx(hi,{"data-slot":"table-pagination-next",size:"icon",variant:"ghost",disabled:R,onClick:E,children:O.jsx(Rw,{"data-slot":"table-pagination-next-icon"})})]})]})},[B_,Zce]=Mw(),Wce=({children:e,value:t,onChange:r,defaultValue:l,variant:s="default",...c})=>{const[h="",m]=br({prop:t,onChange:r,defaultProp:l}),[b,E]=k.useState(null);return O.jsx(Zce,{value:{activeTab:h,setActiveTab:m,setTargetRef:E,targetRef:b,variant:s},children:O.jsx("div",{"data-slot":"tabs",...c,children:e})})},Jce=({children:e,className:t,indicatorClassName:r})=>{const{targetRef:l}=B_();return O.jsxs("div",{"data-slot":"tabs-list",className:Fe("relative mb-4",t),children:[O.jsx("div",{"data-slot":"tabs-content",className:"flex",children:e}),O.jsx(nfe,{targetRef:l,indicatorClassName:r})]})},efe=({value:e,className:t,...r})=>{const{activeTab:l,setActiveTab:s,setTargetRef:c,variant:h}=B_(),m=l===e;return O.jsx("button",{"data-slot":"tabs-trigger",...r,type:"button",ref:b=>{m&&c(b)},onClick:()=>s(e),"data-tab":e,"data-selected":m,"aria-selected":m,className:Fe("px-2 py-2 cursor-pointer w-full min-w-[100px] text-center rounded-t font-semibold select-none",h==="background"?"hover:bg-transparent aria-selected:text-primary-foreground rounded":"hover:bg-accent hover:text-accent-foreground",t)})},tfe=({value:e,...t})=>{const{activeTab:r}=B_();return r===e?O.jsx("div",{"data-slot":"tabs-content",...t}):null},nfe=({targetRef:e,indicatorClassName:t})=>{const r=k.useRef(null),l=r?.current,s=k.useRef(null),{variant:c}=B_(),h=()=>{if(!e||!l)return;const m=e.offsetLeft,b=e.offsetWidth;l.style.width=b+"px",l.style.left=m+"px"};return k.useEffect(()=>{if(e)return h(),s.current=new ResizeObserver(h),s.current.observe(e),()=>{s.current?.disconnect()}},[e]),O.jsx("div",{"data-slot":"tabs-indicator",ref:r,className:Fe("transition-all duration-300 absolute rounded bg-primary",c==="background"?"inset-0 -z-10 h-full top-0":"top-full h-[3px]",t)})},rfe=({className:e,...t})=>O.jsx("textarea",{...t,"data-slot":"textarea",className:Fe("min-h-[60px] w-full rounded-md px-3 py-2 text-sm placeholder:text-muted-foreground","border border-input bg-background","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e)}),afe={done:"var(--color-primary)",pending:"#cdcdcd",error:"var(--color-error)"},lfe=({items:e,classNameContainer:t,containerProps:r,...l})=>O.jsx(XB,{className:t,...r,children:e.map((s,c)=>O.jsx(QB,{icon:s.icon,color:s.color,status:s.status,...l,children:s.content},c))}),XB=e=>O.jsx("ul",{"data-slot":"timeline",...e,className:Fe("relative flex justify-center flex-col border-input",e.className)}),QB=({icon:e,status:t,color:r,classNameItemDot:l,classNameItemContainerDot:s,classNameItemContent:c,itemsProps:h,children:m,...b})=>O.jsxs("li",{"data-slot":"timeline-item",className:Fe("rounded-lg w-full px-2 gap-1 grid hover:bg-muted transition-colors ease-in grid-cols-[minmax(auto,20px)_1fr]",b.className),...b,children:[O.jsx(ZB,{icon:e,status:t,color:r,classNameDot:l,classNameContainerDot:s}),O.jsx(WB,{className:c,...h,children:m})]}),ZB=({icon:e,status:t="pending",color:r,classNameDot:l,classNameContainerDot:s})=>O.jsx("div",{"data-slot":"timeline-item-dot",className:Fe("relative pb-6 last:after:hidden after:absolute after:top-0 after:bottom-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-gray-200",s),children:O.jsx("div",{"data-slot":"timeline-item-dot-icon",className:Fe("relative z-10 flex text-white items-center justify-center rounded-full left-1/2 -translate-x-1/2",e?"aspect-square p-1.5 min-h-7 min-w-7 top-2":"size-2 top-4",l),style:{backgroundColor:r||afe?.[t]},children:e})}),WB=e=>O.jsx("div",{"data-slot":"timeline-item-content",...e,className:Fe("grow px-2 pb-4 pt-2",e.className)}),ofe=$m(["flex justify-between items-center transition-all","text-primary-foreground","pointer-events-auto relative w-full rounded-xl p-3 shadow-lg"],{variants:{variant:{info:"bg-primary text-primary-foreground",error:"bg-error text-error-foreground",success:"bg-success text-success-foreground",loading:"bg-background text-foreground"}},defaultVariants:{variant:"info"}}),ife=$m("",{variants:{variant:{info:"text-primary-foreground",error:"text-error-foreground",success:"text-success-foreground",loading:"text-foreground animate-spin"}},defaultVariants:{variant:"info"}}),JB=({title:e,description:t,type:r,iconClassName:l,...s})=>{const c=t9[r];return O.jsxs("div",{...s,"data-slot":"toast",className:Fe(ofe({variant:r}),s.className),children:[O.jsx("div",{className:Fe("p-1 text-primary-foreground pr-2",l),children:O.jsx(c,{size:22,className:Fe(ife({variant:r})),"data-slot":"toast-icon"})}),O.jsxs("div",{className:"grid gap-1 grow","data-slot":"toast-content",children:[e&&O.jsx("h4",{...s.titleProps,className:Fe("text-sm font-semibold",s.titleClassName),"data-slot":"toast-title",children:e}),O.jsx("div",{...s.descriptionProps,className:Fe("text-sm font-normal opacity-90 p-0 overflow-hidden",s.descriptionClassName),"data-slot":"toast-description",children:t})]})]})},ufe=({iconClassName:e="",...t})=>{const r=vO(l=>l.toasts);return O.jsxs(O.Fragment,{children:[t.children,O.jsx(EM,{className:"empty:hidden fixed z-100 pr-2 pb-2 bottom-0 right-0 space-y-2 max-w-[300px] w-full",children:r.map(l=>{const s=k.createRef();return O.jsx(g_,{classNames:"toast",timeout:500,nodeRef:s,children:O.jsx(JB,{...l,iconClassName:e,ref:s})},l.id)})})]})},FP=e=>{let t;const r=new Set,l=(E,C)=>{const S=typeof E=="function"?E(t):E;if(!Object.is(S,t)){const R=t;t=C??(typeof S!="object"||S===null)?S:Object.assign({},t,S),r.forEach(M=>M(t,R))}},s=()=>t,m={setState:l,getState:s,getInitialState:()=>b,subscribe:E=>(r.add(E),()=>r.delete(E))},b=t=e(l,s,m);return m},sfe=(e=>e?FP(e):FP),cfe=e=>e;function ffe(e,t=cfe){const r=k.useSyncExternalStore(e.subscribe,k.useCallback(()=>t(e.getState()),[e,t]),k.useCallback(()=>t(e.getInitialState()),[e,t]));return k.useDebugValue(r),r}const KP=e=>{const t=sfe(e),r=l=>ffe(t,l);return Object.assign(r,t),r},dfe=(e=>e?KP(e):KP);let pfe=0;const e9=3e3,GP=(e,t,r=e9)=>{setTimeout(()=>e(t),r)},vO=dfe((e,t)=>({toasts:[],addToast:r=>{const l=++pfe,s={...r,id:l};return e(c=>({toasts:[...c.toasts,s]})),r.type!=="loading"&&GP(t().removeToast,l,r?.duration||e9),l},removeToast:r=>{e(l=>({toasts:l.toasts.filter(s=>s.id!==r)}))},updateToast:(r,l)=>{e(s=>({toasts:s.toasts.map(c=>c.id===r?{...c,...l}:c)})),l.type!=="loading"&&GP(t().removeToast,r)},promise:async(r,l)=>{const s=t().addToast({type:"loading",description:l.loading});try{const c=await r;return t().updateToast(s,{type:"success",description:typeof l.success=="function"?l.success(c):l.success}),c}catch(c){const h=typeof l.error=="function"?l.error(c):l.error;return t().updateToast(s,{type:"error",description:h}),Promise.reject(c)}}})),gO=vO.getState(),hfe=e=>gO.addToast(e),UD=(e,t)=>{const l=typeof e=="string"?{description:e,type:t}:{...e,type:t};return gO.addToast(l)},mfe=Object.assign(hfe,{info:e=>UD(e,"info"),success:e=>UD(e,"success"),error:e=>UD(e,"error"),promise:(e,t)=>gO.promise(e,t)}),t9={info:tK,success:rK,error:lK,loading:qT};function vfe(e){const t=gfe(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(bfe);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function gfe(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Efe(s),m=xfe(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var n9=Symbol("radix.slottable");function yfe(e){const t=({children:r})=>O.jsx(O.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=n9,t}function bfe(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===n9}function xfe(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Efe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Sfe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cfe=Sfe.reduce((e,t)=>{const r=vfe(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),[k_]=xp("Tooltip",[zg]),U_=zg(),r9="TooltipProvider",wfe=700,I2="tooltip.open",[Rfe,yO]=k_(r9),a9=e=>{const{__scopeTooltip:t,delayDuration:r=wfe,skipDelayDuration:l=300,disableHoverableContent:s=!1,children:c}=e,h=D.useRef(!0),m=D.useRef(!1),b=D.useRef(0);return D.useEffect(()=>{const E=b.current;return()=>window.clearTimeout(E)},[]),O.jsx(Rfe,{scope:t,isOpenDelayedRef:h,delayDuration:r,onOpen:D.useCallback(()=>{window.clearTimeout(b.current),h.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>h.current=!0,l)},[l]),isPointerInTransitRef:m,onPointerInTransitChange:D.useCallback(E=>{m.current=E},[]),disableHoverableContent:s,children:c})};a9.displayName=r9;var yw="Tooltip",[Tfe,Xw]=k_(yw),l9=e=>{const{__scopeTooltip:t,children:r,open:l,defaultOpen:s,onOpenChange:c,disableHoverableContent:h,delayDuration:m}=e,b=yO(yw,e.__scopeTooltip),E=U_(t),[C,S]=D.useState(null),R=_a(),M=D.useRef(0),q=h??b.disableHoverableContent,N=m??b.delayDuration,L=D.useRef(!1),[P,U]=br({prop:l,defaultProp:s??!1,onChange:K=>{K?(b.onOpen(),document.dispatchEvent(new CustomEvent(I2))):b.onClose(),c?.(K)},caller:yw}),I=D.useMemo(()=>P?L.current?"delayed-open":"instant-open":"closed",[P]),Y=D.useCallback(()=>{window.clearTimeout(M.current),M.current=0,L.current=!1,U(!0)},[U]),V=D.useCallback(()=>{window.clearTimeout(M.current),M.current=0,U(!1)},[U]),F=D.useCallback(()=>{window.clearTimeout(M.current),M.current=window.setTimeout(()=>{L.current=!0,U(!0),M.current=0},N)},[N,U]);return D.useEffect(()=>()=>{M.current&&(window.clearTimeout(M.current),M.current=0)},[]),O.jsx(zw,{...E,children:O.jsx(Tfe,{scope:t,contentId:R,open:P,stateAttribute:I,trigger:C,onTriggerChange:S,onTriggerEnter:D.useCallback(()=>{b.isOpenDelayedRef.current?F():Y()},[b.isOpenDelayedRef,F,Y]),onTriggerLeave:D.useCallback(()=>{q?V():(window.clearTimeout(M.current),M.current=0)},[V,q]),onOpen:Y,onClose:V,disableHoverableContent:q,children:r})})};l9.displayName=yw;var H2="TooltipTrigger",o9=D.forwardRef((e,t)=>{const{__scopeTooltip:r,...l}=e,s=Xw(H2,r),c=yO(H2,r),h=U_(r),m=D.useRef(null),b=vn(t,m,s.onTriggerChange),E=D.useRef(!1),C=D.useRef(!1),S=D.useCallback(()=>E.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",S),[S]),O.jsx(Bw,{asChild:!0,...h,children:O.jsx(Cfe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...l,ref:b,onPointerMove:gt(e.onPointerMove,R=>{R.pointerType!=="touch"&&!C.current&&!c.isPointerInTransitRef.current&&(s.onTriggerEnter(),C.current=!0)}),onPointerLeave:gt(e.onPointerLeave,()=>{s.onTriggerLeave(),C.current=!1}),onPointerDown:gt(e.onPointerDown,()=>{s.open&&s.onClose(),E.current=!0,document.addEventListener("pointerup",S,{once:!0})}),onFocus:gt(e.onFocus,()=>{E.current||s.onOpen()}),onBlur:gt(e.onBlur,s.onClose),onClick:gt(e.onClick,s.onClose)})})});o9.displayName=H2;var bO="TooltipPortal",[_fe,Afe]=k_(bO,{forceMount:void 0}),i9=e=>{const{__scopeTooltip:t,forceMount:r,children:l,container:s}=e,c=Xw(bO,t);return O.jsx(_fe,{scope:t,forceMount:r,children:O.jsx(Ts,{present:r||c.open,children:O.jsx(J1,{asChild:!0,container:s,children:l})})})};i9.displayName=bO;var Y1="TooltipContent",u9=D.forwardRef((e,t)=>{const r=Afe(Y1,e.__scopeTooltip),{forceMount:l=r.forceMount,side:s="top",...c}=e,h=Xw(Y1,e.__scopeTooltip);return O.jsx(Ts,{present:l||h.open,children:h.disableHoverableContent?O.jsx(s9,{side:s,...c,ref:t}):O.jsx(Dfe,{side:s,...c,ref:t})})}),Dfe=D.forwardRef((e,t)=>{const r=Xw(Y1,e.__scopeTooltip),l=yO(Y1,e.__scopeTooltip),s=D.useRef(null),c=vn(t,s),[h,m]=D.useState(null),{trigger:b,onClose:E}=r,C=s.current,{onPointerInTransitChange:S}=l,R=D.useCallback(()=>{m(null),S(!1)},[S]),M=D.useCallback((q,N)=>{const L=q.currentTarget,P={x:q.clientX,y:q.clientY},U=$fe(P,L.getBoundingClientRect()),I=Pfe(P,U),Y=qfe(N.getBoundingClientRect()),V=jfe([...I,...Y]);m(V),S(!0)},[S]);return D.useEffect(()=>()=>R(),[R]),D.useEffect(()=>{if(b&&C){const q=L=>M(L,C),N=L=>M(L,b);return b.addEventListener("pointerleave",q),C.addEventListener("pointerleave",N),()=>{b.removeEventListener("pointerleave",q),C.removeEventListener("pointerleave",N)}}},[b,C,M,R]),D.useEffect(()=>{if(h){const q=N=>{const L=N.target,P={x:N.clientX,y:N.clientY},U=b?.contains(L)||C?.contains(L),I=!Lfe(P,h);U?R():I&&(R(),E())};return document.addEventListener("pointermove",q),()=>document.removeEventListener("pointermove",q)}},[b,C,h,E,R]),O.jsx(s9,{...e,ref:c})}),[Mfe,Ofe]=k_(yw,{isInside:!1}),Nfe=yfe("TooltipContent"),s9=D.forwardRef((e,t)=>{const{__scopeTooltip:r,children:l,"aria-label":s,onEscapeKeyDown:c,onPointerDownOutside:h,...m}=e,b=Xw(Y1,r),E=U_(r),{onClose:C}=b;return D.useEffect(()=>(document.addEventListener(I2,C),()=>document.removeEventListener(I2,C)),[C]),D.useEffect(()=>{if(b.trigger){const S=R=>{R.target?.contains(b.trigger)&&C()};return window.addEventListener("scroll",S,{capture:!0}),()=>window.removeEventListener("scroll",S,{capture:!0})}},[b.trigger,C]),O.jsx(W1,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:S=>S.preventDefault(),onDismiss:C,children:O.jsxs(O_,{"data-state":b.stateAttribute,...E,...m,ref:t,style:{...m.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[O.jsx(Nfe,{children:l}),O.jsx(Mfe,{scope:r,isInside:!0,children:O.jsx(lce,{id:b.contentId,role:"tooltip",children:s||l})})]})})});u9.displayName=Y1;var c9="TooltipArrow",f9=D.forwardRef((e,t)=>{const{__scopeTooltip:r,...l}=e,s=U_(r);return Ofe(c9,r).isInside?null:O.jsx(N_,{...s,...l,ref:t})});f9.displayName=c9;function $fe(e,t){const r=Math.abs(t.top-e.y),l=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),c=Math.abs(t.left-e.x);switch(Math.min(r,l,s,c)){case c:return"left";case s:return"right";case r:return"top";case l:return"bottom";default:throw new Error("unreachable")}}function Pfe(e,t,r=5){const l=[];switch(t){case"top":l.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":l.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":l.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":l.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return l}function qfe(e){const{top:t,right:r,bottom:l,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:l},{x:s,y:l}]}function Lfe(e,t){const{x:r,y:l}=e;let s=!1;for(let c=0,h=t.length-1;c<t.length;h=c++){const m=t[c],b=t[h],E=m.x,C=m.y,S=b.x,R=b.y;C>l!=R>l&&r<(S-E)*(l-C)/(R-C)+E&&(s=!s)}return s}function jfe(e){const t=e.slice();return t.sort((r,l)=>r.x<l.x?-1:r.x>l.x?1:r.y<l.y?-1:r.y>l.y?1:0),zfe(t)}function zfe(e){if(e.length<=1)return e.slice();const t=[];for(let l=0;l<e.length;l++){const s=e[l];for(;t.length>=2;){const c=t[t.length-1],h=t[t.length-2];if((c.x-h.x)*(s.y-h.y)>=(c.y-h.y)*(s.x-h.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let l=e.length-1;l>=0;l--){const s=e[l];for(;r.length>=2;){const c=r[r.length-1],h=r[r.length-2];if((c.x-h.x)*(s.y-h.y)>=(c.y-h.y)*(s.x-h.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Bfe=a9,kfe=l9,Ufe=o9,Ife=i9,Hfe=u9,Vfe=f9;const d9=({delayDuration:e=0,...t})=>O.jsx(Bfe,{"data-slot":"tooltip-provider",delayDuration:e,...t}),p9=({...e})=>O.jsx(d9,{children:O.jsx(kfe,{"data-slot":"tooltip",...e})}),h9=({...e})=>O.jsx(Ufe,{"data-slot":"tooltip-trigger",...e}),m9=({className:e,sideOffset:t=0,children:r,arrowClassName:l,...s})=>O.jsx(Ife,{children:O.jsxs(Hfe,{"data-slot":"tooltip-content",sideOffset:t,className:Fe("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...s,children:[r,O.jsx(Vfe,{className:Fe("bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",l)})]})}),Ffe=({label:e,open:t,defaultOpen:r,onOpenChange:l,...s})=>{const{className:c,...h}=Tw("Tooltip",s,{side:"top"});return O.jsxs(p9,{open:t,defaultOpen:r,onOpenChange:l,children:[O.jsx(h9,{asChild:!0,"data-slot":"tooltip-trigger",children:O.jsx(_w,{...h})}),O.jsx(m9,{"data-slot":"tooltip-content",side:h.side,sideOffset:h.offset,className:c,arrowClassName:h.arrowClassName,children:e})]})},Kfe=k.createContext(null);k.createContext(null);k.createContext(null);k.createContext(null);k.createContext(null);k.createContext({});k.createContext(null);k.createContext(null);const Ia=typeof document<"u"?k.useLayoutEffect:()=>{};var ID;const Gfe=(ID=k.useInsertionEffect)!==null&&ID!==void 0?ID:Ia;function nu(e){const t=k.useRef(null);return Gfe(()=>{t.current=e},[e]),k.useCallback((...r)=>{const l=t.current;return l?.(...r)},[])}function Yfe(e){let[t,r]=k.useState(e),l=k.useRef(null),s=nu(()=>{if(!l.current)return;let h=l.current.next();if(h.done){l.current=null;return}t===h.value?s():r(h.value)});Ia(()=>{l.current&&s()});let c=nu(h=>{l.current=h(t),s()});return[t,c]}const n_={prefix:String(Math.round(Math.random()*1e10)),current:0},v9=k.createContext(n_),Xfe=k.createContext(!1);let Qfe=!!(typeof window<"u"&&window.document&&window.document.createElement),HD=new WeakMap;function Zfe(e=!1){let t=k.useContext(v9),r=k.useRef(null);if(r.current===null&&!e){var l,s;let c=(s=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||s===void 0||(l=s.ReactCurrentOwner)===null||l===void 0?void 0:l.current;if(c){let h=HD.get(c);h==null?HD.set(c,{id:t.current,state:c.memoizedState}):c.memoizedState!==h.state&&(t.current=h.id,HD.delete(c))}r.current=++t.current}return r.current}function Wfe(e){let t=k.useContext(v9);t===n_&&!Qfe&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let r=Zfe(!!e),l=t===n_&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${l}-${r}`}function Jfe(e){let t=k.useId(),[r]=k.useState(Qw()),l=r||process.env.NODE_ENV==="test"?"react-aria":`react-aria${n_.prefix}`;return e||`${l}-${t}`}const ede=typeof k.useId=="function"?Jfe:Wfe;function tde(){return!1}function nde(){return!0}function rde(e){return()=>{}}function Qw(){return typeof k.useSyncExternalStore=="function"?k.useSyncExternalStore(rde,tde,nde):k.useContext(Xfe)}let ade=!!(typeof window<"u"&&window.document&&window.document.createElement),H1=new Map,nw;typeof FinalizationRegistry<"u"&&(nw=new FinalizationRegistry(e=>{H1.delete(e)}));function Om(e){let[t,r]=k.useState(e),l=k.useRef(null),s=ede(t),c=k.useRef(null);if(nw&&nw.register(c,s),ade){const h=H1.get(s);h&&!h.includes(l)?h.push(l):H1.set(s,[l])}return Ia(()=>{let h=s;return()=>{nw&&nw.unregister(c),H1.delete(h)}},[s]),k.useEffect(()=>{let h=l.current;return h&&r(h),()=>{h&&(l.current=null)}}),s}function lde(e,t){if(e===t)return e;let r=H1.get(e);if(r)return r.forEach(s=>s.current=t),t;let l=H1.get(t);return l?(l.forEach(s=>s.current=e),e):t}function ode(e=[]){let t=Om(),[r,l]=Yfe(t),s=k.useCallback(()=>{l(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,l]);return Ia(s,[t,s,...e]),r}function I_(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const ar=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},qc=e=>e&&"window"in e&&e.window===e?e:ar(e).defaultView||window;function ide(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function ude(e){return ide(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let sde=!1;function H_(){return sde}function ta(e,t){if(!H_())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let r=t;for(;r!==null;){if(r===e)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:ude(r)?r=r.host:r=r.parentNode}return!1}const pi=(e=document)=>{var t;if(!H_())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(!((t=r.shadowRoot)===null||t===void 0)&&t.activeElement);)r=r.shadowRoot.activeElement;return r};function Qn(e){return H_()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class cde{get currentNode(){return this._currentNode}set currentNode(t){if(!ta(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const r=[];let l=t,s=t;for(this._currentNode=t;l&&l!==this.root;)if(l.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=l,m=this._doc.createTreeWalker(h,this.whatToShow,{acceptNode:this._acceptNode});r.push(m),m.currentNode=s,this._currentSetFor.add(m),l=s=h.host}else l=l.parentNode;const c=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});r.push(c),c.currentNode=s,this._currentSetFor.add(c),this._walkerStack=r}get doc(){return this._doc}firstChild(){let t=this.currentNode,r=this.nextNode();return ta(t,r)?(r&&(this.currentNode=r),r):(this.currentNode=t,null)}lastChild(){let r=this._walkerStack[0].lastChild();return r&&(this.currentNode=r),r}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var r;let s;if(typeof this.filter=="function"?s=this.filter(t):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(s=this.filter.acceptNode(t)),s===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let c=this.nextNode();return c&&(this.currentNode=c),c}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let l=this.nextNode();return l&&(this.currentNode=l),l}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let s=this.previousNode();return s&&(this.currentNode=s),s}else return null;return null}const r=t.previousNode();if(r){if(r.shadowRoot){var l;let c;if(typeof this.filter=="function"?c=this.filter(r):!((l=this.filter)===null||l===void 0)&&l.acceptNode&&(c=this.filter.acceptNode(r)),c===NodeFilter.FILTER_ACCEPT)return r&&(this.currentNode=r),r;let h=this.lastChild();return h&&(this.currentNode=h),h}return r&&(this.currentNode=r),r}else if(this._walkerStack.length>1){this._walkerStack.shift();let s=this.previousNode();return s&&(this.currentNode=s),s}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(t,r,l,s){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=h=>{if(h.nodeType===Node.ELEMENT_NODE){const b=h.shadowRoot;if(b){const E=this._doc.createTreeWalker(b,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(E),NodeFilter.FILTER_ACCEPT}else{var m;if(typeof this.filter=="function")return this.filter(h);if(!((m=this.filter)===null||m===void 0)&&m.acceptNode)return this.filter.acceptNode(h);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=r,this.filter=s??null,this.whatToShow=l??NodeFilter.SHOW_ALL,this._currentNode=r,this._walkerStack.unshift(t.createTreeWalker(r,l,this._acceptNode));const c=r.shadowRoot;if(c){const h=this._doc.createTreeWalker(c,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(h)}}}function fde(e,t,r,l){return H_()?new cde(e,t,r,l):e.createTreeWalker(t,r,l)}function Fl(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let l=e[r];for(let s in l){let c=t[s],h=l[s];typeof c=="function"&&typeof h=="function"&&s[0]==="o"&&s[1]==="n"&&s.charCodeAt(2)>=65&&s.charCodeAt(2)<=90?t[s]=I_(c,h):(s==="className"||s==="UNSAFE_className")&&typeof c=="string"&&typeof h=="string"?t[s]=oM(c,h):s==="id"&&c&&h?t.id=lde(c,h):t[s]=h!==void 0?h:c}}return t}function dde(...e){return e.length===1&&e[0]?e[0]:t=>{let r=!1;const l=e.map(s=>{const c=YP(s,t);return r||(r=typeof c=="function"),c});if(r)return()=>{l.forEach((s,c)=>{typeof s=="function"?s():YP(e[c],null)})}}}function YP(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}const pde=new Set(["id"]),hde=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),mde=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),vde=new Set(["dir","lang","hidden","inert","translate"]),XP=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),gde=/^(data-.*)$/;function ox(e,t={}){let{labelable:r,isLink:l,global:s,events:c=s,propNames:h}=t,m={};for(const b in e)Object.prototype.hasOwnProperty.call(e,b)&&(pde.has(b)||r&&hde.has(b)||l&&mde.has(b)||s&&vde.has(b)||c&&XP.has(b)||b.endsWith("Capture")&&XP.has(b.slice(0,-7))||h?.has(b)||gde.test(b))&&(m[b]=e[b]);return m}function Nm(e){if(yde())e.focus({preventScroll:!0});else{let t=bde(e);e.focus(),xde(t)}}let gT=null;function yde(){if(gT==null){gT=!1;try{document.createElement("div").focus({get preventScroll(){return gT=!0,!0}})}catch{}}return gT}function bde(e){let t=e.parentNode,r=[],l=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==l;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return l instanceof HTMLElement&&r.push({element:l,scrollTop:l.scrollTop,scrollLeft:l.scrollLeft}),r}function xde(e){for(let{element:t,scrollTop:r,scrollLeft:l}of e)t.scrollTop=r,t.scrollLeft=l}function V_(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let r=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(r)&&r.some(l=>e.test(l.brand))||e.test(window.navigator.userAgent)}function xO(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 qm(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const o0=qm(function(){return xO(/^Mac/i)}),Ede=qm(function(){return xO(/^iPhone/i)}),g9=qm(function(){return xO(/^iPad/i)||o0()&&navigator.maxTouchPoints>1}),EO=qm(function(){return Ede()||g9()}),Sde=qm(function(){return o0()||EO()}),Cde=qm(function(){return V_(/AppleWebKit/i)&&!SO()}),SO=qm(function(){return V_(/Chrome/i)}),CO=qm(function(){return V_(/Android/i)}),wde=qm(function(){return V_(/Firefox/i)}),Rde=k.createContext({isNative:!0,open:_de,useHref:e=>e});function wO(){return k.useContext(Rde)}function i0(e,t,r=!0){var l,s;let{metaKey:c,ctrlKey:h,altKey:m,shiftKey:b}=t;wde()&&(!((s=window.event)===null||s===void 0||(l=s.type)===null||l===void 0)&&l.startsWith("key"))&&e.target==="_blank"&&(o0()?c=!0:h=!0);let E=Cde()&&o0()&&!g9()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:c,ctrlKey:h,altKey:m,shiftKey:b}):new MouseEvent("click",{metaKey:c,ctrlKey:h,altKey:m,shiftKey:b,bubbles:!0,cancelable:!0});i0.isOpening=r,Nm(e),e.dispatchEvent(E),i0.isOpening=!1}i0.isOpening=!1;function Tde(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let r=document.createElement("a");r.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(r.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(r.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(r.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(r.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(r.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(r),t(r),e.removeChild(r)}}function _de(e,t){Tde(e,r=>i0(r,t))}function Ade(e){let t=wO();var r;const l=t.useHref((r=e.href)!==null&&r!==void 0?r:"");return{"data-href":e.href?l:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}let _g=new Map,V2=new Set;function QP(){if(typeof window>"u")return;function e(l){return"propertyName"in l}let t=l=>{if(!e(l)||!l.target)return;let s=_g.get(l.target);s||(s=new Set,_g.set(l.target,s),l.target.addEventListener("transitioncancel",r,{once:!0})),s.add(l.propertyName)},r=l=>{if(!e(l)||!l.target)return;let s=_g.get(l.target);if(s&&(s.delete(l.propertyName),s.size===0&&(l.target.removeEventListener("transitioncancel",r),_g.delete(l.target)),_g.size===0)){for(let c of V2)c();V2.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",r)}typeof document<"u"&&(document.readyState!=="loading"?QP():document.addEventListener("DOMContentLoaded",QP));function Dde(){for(const[e]of _g)"isConnected"in e&&!e.isConnected&&_g.delete(e)}function y9(e){requestAnimationFrame(()=>{Dde(),_g.size===0?e():V2.add(e)})}function F_(){let e=k.useRef(new Map),t=k.useCallback((s,c,h,m)=>{let b=m?.once?(...E)=>{e.current.delete(h),h(...E)}:h;e.current.set(h,{type:c,eventTarget:s,fn:b,options:m}),s.addEventListener(c,b,m)},[]),r=k.useCallback((s,c,h,m)=>{var b;let E=((b=e.current.get(h))===null||b===void 0?void 0:b.fn)||h;s.removeEventListener(c,E,m),e.current.delete(h)},[]),l=k.useCallback(()=>{e.current.forEach((s,c)=>{r(s.eventTarget,s.type,c,s.options)})},[r]);return k.useEffect(()=>l,[l]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:l}}function Mde(e,t){let{id:r,"aria-label":l,"aria-labelledby":s}=e;return r=Om(r),s&&l?s=[...new Set([r,...s.trim().split(/\s+/)])].join(" "):s&&(s=s.trim().split(/\s+/).join(" ")),!l&&!s&&t&&(l=t),{id:r,"aria-label":l,"aria-labelledby":s}}function K_(e){const t=k.useRef(null),r=k.useRef(void 0),l=k.useCallback(s=>{if(typeof e=="function"){const c=e,h=c(s);return()=>{typeof h=="function"?h():c(null)}}else if(e)return e.current=s,()=>{e.current=null}},[e]);return k.useMemo(()=>({get current(){return t.current},set current(s){t.current=s,r.current&&(r.current(),r.current=void 0),s!=null&&(r.current=l(s))}}),[l])}function Ode(e,t){const r=k.useRef(!0),l=k.useRef(null);k.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),k.useEffect(()=>{let s=l.current;r.current?r.current=!1:(!s||t.some((c,h)=>!Object.is(c,s[h])))&&e(),l.current=t},t)}function ZP(e,t){const r=k.useRef(!0),l=k.useRef(null);Ia(()=>(r.current=!0,()=>{r.current=!1}),[]),Ia(()=>{r.current?r.current=!1:(!l.current||t.some((s,c)=>!Object.is(s,l[c])))&&e(),l.current=t},t)}function b9(e,t){Ia(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function bw(e,t){if(!e)return!1;let r=window.getComputedStyle(e),l=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return l&&t&&(l=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),l}function Fb(e,t){let r=e;for(bw(r,t)&&(r=r.parentElement);r&&!bw(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function Nde(e,t){const r=[];for(;e&&e!==document.documentElement;)bw(e,t)&&r.push(e),e=e.parentElement;return r}function j1(e){return o0()?e.metaKey:e.ctrlKey}let $de=0;const VD=new Map;function x9(e){let[t,r]=k.useState();return Ia(()=>{if(!e)return;let l=VD.get(e);if(l)r(l.element.id);else{let s=`react-aria-description-${$de++}`;r(s);let c=document.createElement("div");c.id=s,c.style.display="none",c.textContent=e,document.body.appendChild(c),l={refCount:0,element:c},VD.set(e,l)}return l.refCount++,()=>{l&&--l.refCount===0&&(l.element.remove(),VD.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function yT(e,t,r,l){let s=nu(r),c=r==null;k.useEffect(()=>{if(c||!e.current)return;let h=e.current;return h.addEventListener(t,s,l),()=>{h.removeEventListener(t,s,l)}},[e,t,l,c,s])}function E9(e,t){let r=WP(e,t,"left"),l=WP(e,t,"top"),s=t.offsetWidth,c=t.offsetHeight,h=e.scrollLeft,m=e.scrollTop,{borderTopWidth:b,borderLeftWidth:E,scrollPaddingTop:C,scrollPaddingRight:S,scrollPaddingBottom:R,scrollPaddingLeft:M}=getComputedStyle(e),{scrollMarginTop:q,scrollMarginRight:N,scrollMarginBottom:L,scrollMarginLeft:P}=getComputedStyle(t),U=h+parseInt(E,10),I=m+parseInt(b,10),Y=U+e.clientWidth,V=I+e.clientHeight,F=parseInt(C,10)||0,K=parseInt(R,10)||0,Q=parseInt(S,10)||0,he=parseInt(M,10)||0,de=parseInt(q,10)||0,W=parseInt(L,10)||0,se=parseInt(N,10)||0,le=parseInt(P,10)||0,ae=r-le,xe=r+s+se,B=l-de,Z=l+c+W,te=h+parseInt(E,10)+he,be=Y-Q,re=m+parseInt(b,10)+F,oe=V-K;if((ae>te||xe<be)&&(ae<=h+he?h=ae-parseInt(E,10)-he:xe>Y-Q&&(h+=xe-Y+Q)),(B>re||Z<oe)&&(B<=I+F?m=B-parseInt(b,10)-F:Z>V-K&&(m+=Z-V+K)),process.env.NODE_ENV==="test"){e.scrollLeft=h,e.scrollTop=m;return}e.scrollTo({left:h,top:m})}function WP(e,t,r){const l=r==="left"?"offsetLeft":"offsetTop";let s=0;for(;t.offsetParent&&(s+=t[l],t.offsetParent!==e);){if(t.offsetParent.contains(e)){s-=e[l];break}t=t.offsetParent}return s}function Tg(e,t){if(e&&document.contains(e)){let h=document.scrollingElement||document.documentElement;if(!(window.getComputedStyle(h).overflow==="hidden")&&!SO()){var r;let{left:b,top:E}=e.getBoundingClientRect();e==null||(r=e.scrollIntoView)===null||r===void 0||r.call(e,{block:"nearest"});let{left:C,top:S}=e.getBoundingClientRect();if(Math.abs(b-C)>1||Math.abs(E-S)>1){var l,s,c;t==null||(s=t.containingElement)===null||s===void 0||(l=s.scrollIntoView)===null||l===void 0||l.call(s,{block:"center",inline:"center"}),(c=e.scrollIntoView)===null||c===void 0||c.call(e,{block:"nearest"})}}else{let b=Nde(e);for(let E of b)E9(E,e)}}}function F2(e){return e.pointerType===""&&e.isTrusted?!0:CO()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Pde(e){return!CO()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function qde(e,t){let{collection:r,onLoadMore:l,scrollOffset:s=1}=e,c=k.useRef(null),h=nu(m=>{for(let b of m)b.isIntersecting&&l&&l()});Ia(()=>(t.current&&(c.current=new IntersectionObserver(h,{root:Fb(t?.current),rootMargin:`0px ${100*s}% ${100*s}% ${100*s}%`}),c.current.observe(t.current)),()=>{c.current&&c.current.disconnect()}),[r,h,t,s])}function Lde(e){const t=k.version.split(".");return parseInt(t[0],10)>=19?e:e?"true":void 0}const jde="react-aria-clear-focus",zde="react-aria-focus",Bde=typeof Element<"u"&&"checkVisibility"in Element.prototype;function kde(e){const t=qc(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:r,visibility:l}=e.style,s=r!=="none"&&l!=="hidden"&&l!=="collapse";if(s){const{getComputedStyle:c}=e.ownerDocument.defaultView;let{display:h,visibility:m}=c(e);s=h!=="none"&&m!=="hidden"&&m!=="collapse"}return s}function Ude(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 RO(e,t){return Bde?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&kde(e)&&Ude(e,t)&&(!e.parentElement||RO(e.parentElement,e))}const TO=["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"],Ide=TO.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";TO.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Hde=TO.join(':not([hidden]):not([tabindex="-1"]),');function S9(e){return e.matches(Ide)&&RO(e)&&!C9(e)}function Vde(e){return e.matches(Hde)&&RO(e)&&!C9(e)}function C9(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function _O(e,t,r){let[l,s]=k.useState(e||t),c=k.useRef(e!==void 0),h=e!==void 0;k.useEffect(()=>{let E=c.current;E!==h&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${E?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}.`),c.current=h},[h]);let m=h?e:l,b=k.useCallback((E,...C)=>{let S=(R,...M)=>{r&&(Object.is(m,R)||r(R,...M)),h||(m=R)};typeof E=="function"?(process.env.NODE_ENV!=="production"&&console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),s((M,...q)=>{let N=E(h?m:M,...q);return S(N,...C),h?M:N})):(h||s(E),S(E,...C))},[h,m,r]);return[m,b]}const w9=Symbol("default");function R9({values:e,children:t}){for(let[r,l]of e)t=k.createElement(r.Provider,{value:l},t);return t}function ix(e){let{className:t,style:r,children:l,defaultClassName:s,defaultChildren:c,defaultStyle:h,values:m}=e;return k.useMemo(()=>{let b,E,C;return typeof t=="function"?b=t({...m,defaultClassName:s}):b=t,typeof r=="function"?E=r({...m,defaultStyle:h||{}}):E=r,typeof l=="function"?C=l({...m,defaultChildren:c}):l==null?C=c:C=l,{className:b??s,style:E||h?{...h,...E}:void 0,children:C??c,"data-rac":""}},[t,r,l,s,c,h,m])}function T9(e,t){return r=>t(typeof e=="function"?e(r):e,r)}function Fde(e,t){let r=k.useContext(e);if(t===null)return null;if(r&&typeof r=="object"&&"slots"in r&&r.slots){let l=t||w9;if(!r.slots[l]){let s=new Intl.ListFormat().format(Object.keys(r.slots).map(h=>`"${h}"`)),c=t?`Invalid slot "${t}".`:"A slot prop is required.";throw new Error(`${c} Valid slot names are ${s}.`)}return r.slots[l]}return r}function _9(e,t,r){let l=Fde(r,e.slot)||{},{ref:s,...c}=l,h=K_(k.useMemo(()=>dde(t,s),[t,s])),m=Fl(c,e);return"style"in c&&c.style&&"style"in e&&e.style&&(typeof c.style=="function"||typeof e.style=="function"?m.style=b=>{let E=typeof c.style=="function"?c.style(b):c.style,C={...b.defaultStyle,...E},S=typeof e.style=="function"?e.style({...b,defaultStyle:C}):e.style;return{...C,...S}}:m.style={...c.style,...e.style}),[m,h]}const A9=7e3;let dp=null;function K2(e,t="assertive",r=A9){dp?dp.announce(e,t,r):(dp=new Kde,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?dp.announce(e,t,r):setTimeout(()=>{dp?.isAttached()&&dp?.announce(e,t,r)},100))}class Kde{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let r=document.createElement("div");return r.setAttribute("role","log"),r.setAttribute("aria-live",t),r.setAttribute("aria-relevant","additions"),r}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,r="assertive",l=A9){var s,c;if(!this.node)return;let h=document.createElement("div");typeof t=="object"?(h.setAttribute("role","img"),h.setAttribute("aria-labelledby",t["aria-labelledby"])):h.textContent=t,r==="assertive"?(s=this.assertiveLog)===null||s===void 0||s.appendChild(h):(c=this.politeLog)===null||c===void 0||c.appendChild(h),t!==""&&setTimeout(()=>{h.remove()},l)}clear(t){this.node&&((!t||t==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}const Gde=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Yde=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Xde(e){if(Intl.Locale){let r=new Intl.Locale(e).maximize(),l=typeof r.getTextInfo=="function"?r.getTextInfo():r.textInfo;if(l)return l.direction==="rtl";if(r.script)return Gde.has(r.script)}let t=e.split("-")[0];return Yde.has(t)}const Qde=Symbol.for("react-aria.i18n.locale");function D9(){let e=typeof window<"u"&&window[Qde]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Xde(e)?"rtl":"ltr"}}let G2=D9(),rw=new Set;function JP(){G2=D9();for(let e of rw)e(G2)}function Zde(){let e=Qw(),[t,r]=k.useState(G2);return k.useEffect(()=>(rw.size===0&&window.addEventListener("languagechange",JP),rw.add(r),()=>{rw.delete(r),rw.size===0&&window.removeEventListener("languagechange",JP)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const Wde=k.createContext(null);function Zw(){let e=Zde();return k.useContext(Wde)||e}const Jde=Symbol.for("react-aria.i18n.locale"),epe=Symbol.for("react-aria.i18n.strings");let N1;class G_{getStringForLocale(t,r){let s=this.getStringsForLocale(r)[t];if(!s)throw new Error(`Could not find intl message ${t} in ${r} locale`);return s}getStringsForLocale(t){let r=this.strings[t];return r||(r=tpe(t,this.strings,this.defaultLocale),this.strings[t]=r),r}static getGlobalDictionaryForPackage(t){if(typeof window>"u")return null;let r=window[Jde];if(N1===void 0){let s=window[epe];if(!s)return null;N1={};for(let c in s)N1[c]=new G_({[r]:s[c]},r)}let l=N1?.[t];if(!l)throw new Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return l}constructor(t,r="en-US"){this.strings=Object.fromEntries(Object.entries(t).filter(([,l])=>l)),this.defaultLocale=r}}function tpe(e,t,r="en-US"){if(t[e])return t[e];let l=npe(e);if(t[l])return t[l];for(let s in t)if(s.startsWith(l+"-"))return t[s];return t[r]}function npe(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const eq=new Map,tq=new Map;class rpe{format(t,r){let l=this.strings.getStringForLocale(t,this.locale);return typeof l=="function"?l(r,this):l}plural(t,r,l="cardinal"){let s=r["="+t];if(s)return typeof s=="function"?s():s;let c=this.locale+":"+l,h=eq.get(c);h||(h=new Intl.PluralRules(this.locale,{type:l}),eq.set(c,h));let m=h.select(t);return s=r[m]||r.other,typeof s=="function"?s():s}number(t){let r=tq.get(this.locale);return r||(r=new Intl.NumberFormat(this.locale),tq.set(this.locale,r)),r.format(t)}select(t,r){let l=t[r]||t.other;return typeof l=="function"?l():l}constructor(t,r){this.locale=t,this.strings=r}}const nq=new WeakMap;function ape(e){let t=nq.get(e);return t||(t=new G_(e),nq.set(e,t)),t}function lpe(e,t){return t&&G_.getGlobalDictionaryForPackage(t)||ape(e)}function Y_(e,t){let{locale:r}=Zw(),l=lpe(e,t);return k.useMemo(()=>new rpe(r,l),[r,l])}function ope(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ipe(e,t,r){ope(e,t),t.set(e,r)}let FD=new Map;function M9(e){let{locale:t}=Zw(),r=t+(e?Object.entries(e).sort((s,c)=>s[0]<c[0]?-1:1).join():"");if(FD.has(r))return FD.get(r);let l=new Intl.Collator(t,e);return FD.set(r,l),l}function AO(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function O9(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function N9(e){let t=k.useRef({isFocused:!1,observer:null});Ia(()=>{const l=t.current;return()=>{l.observer&&(l.observer.disconnect(),l.observer=null)}},[]);let r=nu(l=>{e?.(l)});return k.useCallback(l=>{if(l.target instanceof HTMLButtonElement||l.target instanceof HTMLInputElement||l.target instanceof HTMLTextAreaElement||l.target instanceof HTMLSelectElement){t.current.isFocused=!0;let s=l.target,c=h=>{if(t.current.isFocused=!1,s.disabled){let m=AO(h);r(m)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};s.addEventListener("focusout",c,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&s.disabled){var h;(h=t.current.observer)===null||h===void 0||h.disconnect();let m=s===document.activeElement?null:document.activeElement;s.dispatchEvent(new FocusEvent("blur",{relatedTarget:m})),s.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:m}))}}),t.current.observer.observe(s,{attributes:!0,attributeFilter:["disabled"]})}},[r])}let r_=!1;function rq(e){for(;e&&!S9(e);)e=e.parentElement;let t=qc(e),r=t.document.activeElement;if(!r||r===e)return;r_=!0;let l=!1,s=C=>{(C.target===r||l)&&C.stopImmediatePropagation()},c=C=>{(C.target===r||l)&&(C.stopImmediatePropagation(),!e&&!l&&(l=!0,Nm(r),b()))},h=C=>{(C.target===e||l)&&C.stopImmediatePropagation()},m=C=>{(C.target===e||l)&&(C.stopImmediatePropagation(),l||(l=!0,Nm(r),b()))};t.addEventListener("blur",s,!0),t.addEventListener("focusout",c,!0),t.addEventListener("focusin",m,!0),t.addEventListener("focus",h,!0);let b=()=>{cancelAnimationFrame(E),t.removeEventListener("blur",s,!0),t.removeEventListener("focusout",c,!0),t.removeEventListener("focusin",m,!0),t.removeEventListener("focus",h,!0),r_=!1,l=!1},E=requestAnimationFrame(b);return b}let z1="default",Y2="",DT=new WeakMap;function aq(e){if(EO()){if(z1==="default"){const t=ar(e);Y2=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}z1="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";DT.set(e,e.style[t]),e.style[t]="none"}}function KD(e){if(EO()){if(z1!=="disabled")return;z1="restoring",setTimeout(()=>{y9(()=>{if(z1==="restoring"){const t=ar(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=Y2||""),Y2="",z1="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&DT.has(e)){let t=DT.get(e),r="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[r]==="none"&&(e.style[r]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),DT.delete(e)}}const $9=k.createContext({register:()=>{}});$9.displayName="PressResponderContext";function upe(e,t){return t.get?t.get.call(e):t.value}function P9(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function spe(e,t){var r=P9(e,t,"get");return upe(e,r)}function cpe(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}function lq(e,t,r){var l=P9(e,t,"set");return cpe(e,l,r),r}function fpe(e){let t=k.useContext($9);if(t){let{register:r,...l}=t;e=Fl(l,e),r()}return b9(t,e.ref),e}var bT=new WeakMap;class xT{continuePropagation(){lq(this,bT,!1)}get shouldStopPropagation(){return spe(this,bT)}constructor(t,r,l,s){ipe(this,bT,{writable:!0,value:void 0}),lq(this,bT,!0);var c;let h=(c=s?.target)!==null&&c!==void 0?c:l.currentTarget;const m=h?.getBoundingClientRect();let b,E=0,C,S=null;l.clientX!=null&&l.clientY!=null&&(C=l.clientX,S=l.clientY),m&&(C!=null&&S!=null?(b=C-m.left,E=S-m.top):(b=m.width/2,E=m.height/2)),this.type=t,this.pointerType=r,this.target=l.currentTarget,this.shiftKey=l.shiftKey,this.metaKey=l.metaKey,this.ctrlKey=l.ctrlKey,this.altKey=l.altKey,this.x=b,this.y=E}}const oq=Symbol("linkClicked"),iq="react-aria-pressable-style",uq="data-react-aria-pressable";function DO(e){let{onPress:t,onPressChange:r,onPressStart:l,onPressEnd:s,onPressUp:c,onClick:h,isDisabled:m,isPressed:b,preventFocusOnPress:E,shouldCancelOnPointerExit:C,allowTextSelectionOnPress:S,ref:R,...M}=fpe(e),[q,N]=k.useState(!1),L=k.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:P,removeAllGlobalListeners:U}=F_(),I=nu((W,se)=>{let le=L.current;if(m||le.didFirePressStart)return!1;let ae=!0;if(le.isTriggeringEvent=!0,l){let xe=new xT("pressstart",se,W);l(xe),ae=xe.shouldStopPropagation}return r&&r(!0),le.isTriggeringEvent=!1,le.didFirePressStart=!0,N(!0),ae}),Y=nu((W,se,le=!0)=>{let ae=L.current;if(!ae.didFirePressStart)return!1;ae.didFirePressStart=!1,ae.isTriggeringEvent=!0;let xe=!0;if(s){let B=new xT("pressend",se,W);s(B),xe=B.shouldStopPropagation}if(r&&r(!1),N(!1),t&&le&&!m){let B=new xT("press",se,W);t(B),xe&&(xe=B.shouldStopPropagation)}return ae.isTriggeringEvent=!1,xe}),V=nu((W,se)=>{let le=L.current;if(m)return!1;if(c){le.isTriggeringEvent=!0;let ae=new xT("pressup",se,W);return c(ae),le.isTriggeringEvent=!1,ae.shouldStopPropagation}return!0}),F=nu(W=>{let se=L.current;if(se.isPressed&&se.target){se.didFirePressStart&&se.pointerType!=null&&Y(Ub(se.target,W),se.pointerType,!1),se.isPressed=!1,se.isOverTarget=!1,se.activePointerId=null,se.pointerType=null,U(),S||KD(se.target);for(let le of se.disposables)le();se.disposables=[]}}),K=nu(W=>{C&&F(W)}),Q=nu(W=>{m||h?.(W)}),he=nu((W,se)=>{if(!m&&h){let le=new MouseEvent("click",W);O9(le,se),h(AO(le))}}),de=k.useMemo(()=>{let W=L.current,se={onKeyDown(ae){if(GD(ae.nativeEvent,ae.currentTarget)&&ta(ae.currentTarget,Qn(ae.nativeEvent))){var xe;fq(Qn(ae.nativeEvent),ae.key)&&ae.preventDefault();let B=!0;if(!W.isPressed&&!ae.repeat){W.target=ae.currentTarget,W.isPressed=!0,W.pointerType="keyboard",B=I(ae,"keyboard");let Z=ae.currentTarget,te=be=>{GD(be,Z)&&!be.repeat&&ta(Z,Qn(be))&&W.target&&V(Ub(W.target,be),"keyboard")};P(ar(ae.currentTarget),"keyup",I_(te,le),!0)}B&&ae.stopPropagation(),ae.metaKey&&o0()&&((xe=W.metaKeyEvents)===null||xe===void 0||xe.set(ae.key,ae.nativeEvent))}else ae.key==="Meta"&&(W.metaKeyEvents=new Map)},onClick(ae){if(!(ae&&!ta(ae.currentTarget,Qn(ae.nativeEvent)))&&ae&&ae.button===0&&!W.isTriggeringEvent&&!i0.isOpening){let xe=!0;if(m&&ae.preventDefault(),!W.ignoreEmulatedMouseEvents&&!W.isPressed&&(W.pointerType==="virtual"||F2(ae.nativeEvent))){let B=I(ae,"virtual"),Z=V(ae,"virtual"),te=Y(ae,"virtual");Q(ae),xe=B&&Z&&te}else if(W.isPressed&&W.pointerType!=="keyboard"){let B=W.pointerType||ae.nativeEvent.pointerType||"virtual",Z=V(Ub(ae.currentTarget,ae),B),te=Y(Ub(ae.currentTarget,ae),B,!0);xe=Z&&te,W.isOverTarget=!1,Q(ae),F(ae)}W.ignoreEmulatedMouseEvents=!1,xe&&ae.stopPropagation()}}},le=ae=>{var xe;if(W.isPressed&&W.target&&GD(ae,W.target)){var B;fq(Qn(ae),ae.key)&&ae.preventDefault();let te=Qn(ae),be=ta(W.target,Qn(ae));Y(Ub(W.target,ae),"keyboard",be),be&&he(ae,W.target),U(),ae.key!=="Enter"&&MO(W.target)&&ta(W.target,te)&&!ae[oq]&&(ae[oq]=!0,i0(W.target,ae,!1)),W.isPressed=!1,(B=W.metaKeyEvents)===null||B===void 0||B.delete(ae.key)}else if(ae.key==="Meta"&&(!((xe=W.metaKeyEvents)===null||xe===void 0)&&xe.size)){var Z;let te=W.metaKeyEvents;W.metaKeyEvents=void 0;for(let be of te.values())(Z=W.target)===null||Z===void 0||Z.dispatchEvent(new KeyboardEvent("keyup",be))}};if(typeof PointerEvent<"u"){se.onPointerDown=B=>{if(B.button!==0||!ta(B.currentTarget,Qn(B.nativeEvent)))return;if(Pde(B.nativeEvent)){W.pointerType="virtual";return}W.pointerType=B.pointerType;let Z=!0;if(!W.isPressed){W.isPressed=!0,W.isOverTarget=!0,W.activePointerId=B.pointerId,W.target=B.currentTarget,S||aq(W.target),Z=I(B,W.pointerType);let te=Qn(B.nativeEvent);"releasePointerCapture"in te&&te.releasePointerCapture(B.pointerId),P(ar(B.currentTarget),"pointerup",ae,!1),P(ar(B.currentTarget),"pointercancel",xe,!1)}Z&&B.stopPropagation()},se.onMouseDown=B=>{if(ta(B.currentTarget,Qn(B.nativeEvent))&&B.button===0){if(E){let Z=rq(B.target);Z&&W.disposables.push(Z)}B.stopPropagation()}},se.onPointerUp=B=>{!ta(B.currentTarget,Qn(B.nativeEvent))||W.pointerType==="virtual"||B.button===0&&!W.isPressed&&V(B,W.pointerType||B.pointerType)},se.onPointerEnter=B=>{B.pointerId===W.activePointerId&&W.target&&!W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!0,I(Ub(W.target,B),W.pointerType))},se.onPointerLeave=B=>{B.pointerId===W.activePointerId&&W.target&&W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!1,Y(Ub(W.target,B),W.pointerType,!1),K(B))};let ae=B=>{if(B.pointerId===W.activePointerId&&W.isPressed&&B.button===0&&W.target){if(ta(W.target,Qn(B))&&W.pointerType!=null){let Z=!1,te=setTimeout(()=>{W.isPressed&&W.target instanceof HTMLElement&&(Z?F(B):(Nm(W.target),W.target.click()))},80);P(B.currentTarget,"click",()=>Z=!0,!0),W.disposables.push(()=>clearTimeout(te))}else F(B);W.isOverTarget=!1}},xe=B=>{F(B)};se.onDragStart=B=>{ta(B.currentTarget,Qn(B.nativeEvent))&&F(B)}}else if(process.env.NODE_ENV==="test"){se.onMouseDown=B=>{if(B.button!==0||!ta(B.currentTarget,Qn(B.nativeEvent)))return;if(W.ignoreEmulatedMouseEvents){B.stopPropagation();return}if(W.isPressed=!0,W.isOverTarget=!0,W.target=B.currentTarget,W.pointerType=F2(B.nativeEvent)?"virtual":"mouse",ws.flushSync(()=>I(B,W.pointerType))&&B.stopPropagation(),E){let te=rq(B.target);te&&W.disposables.push(te)}P(ar(B.currentTarget),"mouseup",ae,!1)},se.onMouseEnter=B=>{if(!ta(B.currentTarget,Qn(B.nativeEvent)))return;let Z=!0;W.isPressed&&!W.ignoreEmulatedMouseEvents&&W.pointerType!=null&&(W.isOverTarget=!0,Z=I(B,W.pointerType)),Z&&B.stopPropagation()},se.onMouseLeave=B=>{if(!ta(B.currentTarget,Qn(B.nativeEvent)))return;let Z=!0;W.isPressed&&!W.ignoreEmulatedMouseEvents&&W.pointerType!=null&&(W.isOverTarget=!1,Z=Y(B,W.pointerType,!1),K(B)),Z&&B.stopPropagation()},se.onMouseUp=B=>{ta(B.currentTarget,Qn(B.nativeEvent))&&!W.ignoreEmulatedMouseEvents&&B.button===0&&!W.isPressed&&V(B,W.pointerType||"mouse")};let ae=B=>{if(B.button===0){if(W.ignoreEmulatedMouseEvents){W.ignoreEmulatedMouseEvents=!1;return}W.target&&W.target.contains(B.target)&&W.pointerType!=null||F(B),W.isOverTarget=!1}};se.onTouchStart=B=>{if(!ta(B.currentTarget,Qn(B.nativeEvent)))return;let Z=dpe(B.nativeEvent);if(!Z)return;W.activePointerId=Z.identifier,W.ignoreEmulatedMouseEvents=!0,W.isOverTarget=!0,W.isPressed=!0,W.target=B.currentTarget,W.pointerType="touch",S||aq(W.target),I(Cg(W.target,B),W.pointerType)&&B.stopPropagation(),P(qc(B.currentTarget),"scroll",xe,!0)},se.onTouchMove=B=>{if(!ta(B.currentTarget,Qn(B.nativeEvent)))return;if(!W.isPressed){B.stopPropagation();return}let Z=sq(B.nativeEvent,W.activePointerId),te=!0;Z&&cq(Z,B.currentTarget)?!W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!0,te=I(Cg(W.target,B),W.pointerType)):W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!1,te=Y(Cg(W.target,B),W.pointerType,!1),K(Cg(W.target,B))),te&&B.stopPropagation()},se.onTouchEnd=B=>{if(!ta(B.currentTarget,Qn(B.nativeEvent)))return;if(!W.isPressed){B.stopPropagation();return}let Z=sq(B.nativeEvent,W.activePointerId),te=!0;Z&&cq(Z,B.currentTarget)&&W.pointerType!=null?(V(Cg(W.target,B),W.pointerType),te=Y(Cg(W.target,B),W.pointerType),he(B.nativeEvent,W.target)):W.isOverTarget&&W.pointerType!=null&&(te=Y(Cg(W.target,B),W.pointerType,!1)),te&&B.stopPropagation(),W.isPressed=!1,W.activePointerId=null,W.isOverTarget=!1,W.ignoreEmulatedMouseEvents=!0,W.target&&!S&&KD(W.target),U()},se.onTouchCancel=B=>{ta(B.currentTarget,Qn(B.nativeEvent))&&(B.stopPropagation(),W.isPressed&&F(Cg(W.target,B)))};let xe=B=>{W.isPressed&&ta(Qn(B),W.target)&&F({currentTarget:W.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};se.onDragStart=B=>{ta(B.currentTarget,Qn(B.nativeEvent))&&F(B)}}return se},[P,m,E,U,S,F,K,Y,I,V,Q,he]);return k.useEffect(()=>{if(!R||process.env.NODE_ENV==="test")return;const W=ar(R.current);if(!W||!W.head||W.getElementById(iq))return;const se=W.createElement("style");se.id=iq,se.textContent=`
352
+ }`;var Vt=mb(function(){return Jt(ne,xt+"return "+nt).apply(r,fe)});if(Vt.source=nt,Of(Vt))throw Vt;return Vt}function ha(p){return ht(p).toLowerCase()}function ja(p){return ht(p).toUpperCase()}function el(p,g,T){if(p=ht(p),p&&(T||g===r))return Bs(p);if(!p||!(g=Al(g)))return p;var j=Wn(p),G=Wn(g),ne=Ai(j,G),fe=Ym(j,G)+1;return jo(j,ne,fe).join("")}function bc(p,g,T){if(p=ht(p),p&&(T||g===r))return p.slice(0,wo(p)+1);if(!p||!(g=Al(g)))return p;var j=Wn(p),G=Ym(j,Wn(g))+1;return jo(j,0,G).join("")}function ci(p,g,T){if(p=ht(p),p&&(T||g===r))return p.replace(vl,"");if(!p||!(g=Al(g)))return p;var j=Wn(p),G=Ai(j,Wn(g));return jo(j,G).join("")}function hr(p,g){var T=de,j=W;if(er(g)){var G="separator"in g?g.separator:G;T="length"in g?At(g.length):T,j="omission"in g?Al(g.omission):j}p=ht(p);var ne=p.length;if(Yu(p)){var fe=Wn(p);ne=fe.length}if(T>=ne)return p;var Se=T-nf(j);if(Se<1)return j;var Ne=fe?jo(fe,0,Se).join(""):p.slice(0,Se);if(G===r)return Ne+j;if(fe&&(Se+=Ne.length-Se),Yd(G)){if(p.slice(Se).search(G)){var Qe,tt=Ne;for(G.global||(G=cu(G.source,ht(wp.exec(G))+"g")),G.lastIndex=0;Qe=G.exec(tt);)var nt=Qe.index;Ne=Ne.slice(0,nt===r?Se:nt)}}else if(p.indexOf(Al(G),Se)!=Se){var it=Ne.lastIndexOf(G);it>-1&&(Ne=Ne.slice(0,it))}return Ne+j}function jl(p){return p=ht(p),p&&Gl.test(p)?p.replace(Kl,iy):p}var ps=lc(function(p,g,T){return p+(T?" ":"")+g.toUpperCase()}),hs=Cy("toUpperCase");function F0(p,g,T){return p=ht(p),g=T?r:g,g===r?bl(p)?Is(p):fx(p):p.match(g)||[]}var mb=qt(function(p,g){try{return aa(p,r,g)}catch(T){return Of(T)?T:new jt(T)}}),Qh=Bi(function(p,g){return Co(g,function(T){T=ca(T),wl(p,T,Nv(p[T],p))}),p});function rp(p){var g=p==null?0:p.length,T=Rt();return p=g?Gn(p,function(j){if(typeof j[1]!="function")throw new Va(h);return[T(j[0]),j[1]]}):[],qt(function(j){for(var G=-1;++G<g;){var ne=p[G];if(aa(ne[0],this,j))return aa(ne[1],this,j)}})}function K0(p){return x0(Ga(p,S))}function fi(p){return function(){return p}}function ap(p,g){return p==null||p!==p?g:p}var G0=wu(),lp=wu(!0);function tl(p){return p}function op(p){return mf(typeof p=="function"?p:Ga(p,S))}function Xv(p){return Sd(Ga(p,S))}function vb(p,g){return nh(p,Ga(g,S))}var Y0=qt(function(p,g){return function(T){return Tl(T,p,g)}}),Zh=qt(function(p,g){return function(T){return Tl(p,T,g)}});function o(p,g,T){var j=Wr(g),G=$r(g,j);T==null&&!(er(g)&&(G.length||!j.length))&&(T=g,g=p,p=this,G=$r(g,Wr(g)));var ne=!(er(T)&&"chain"in T)||!!T.chain,fe=Uo(p);return Co(G,function(Se){var Ne=g[Se];p[Se]=Ne,fe&&(p.prototype[Se]=function(){var Qe=this.__chain__;if(ne||Qe){var tt=p(this.__wrapped__),nt=tt.__actions__=Dl(this.__actions__);return nt.push({func:Ne,args:arguments,thisArg:p}),tt.__chain__=Qe,tt}return Ne.apply(p,Ti([this.value()],arguments))})}),p}function u(){return ra._===this&&(ra._=cr),this}function f(){}function v(p){return p=At(p),qt(function(g){return ah(g,p)})}var w=hh(Gn),_=hh(Ri),z=hh(ny);function J(p){return Ru(p)?Gu(ca(p)):Pr(p)}function ge(p){return function(g){return p==null?r:qo(p,g)}}var qe=mh(),Ye=mh(!0);function We(){return[]}function Le(){return!1}function He(){return{}}function mt(){return""}function Dt(){return!0}function Fn(p,g){if(p=At(p),p<1||p>te)return[];var T=oe,j=fn(p,oe);g=Rt(g),p-=oe;for(var G=hd(j,g);++T<p;)g(T);return G}function Oe(p){return Bt(p)?Gn(p,ca):Pl(p)?[p]:Dl(as(ht(p)))}function we(p){var g=++fu;return ht(p)+g}var Pe=xf(function(p,g){return p+g},0),Ze=oo("ceil"),wt=xf(function(p,g){return p/g},1),gn=oo("floor");function yt(p){return p&&p.length?Ya(p,tl,Ws):r}function Ht(p,g){return p&&p.length?Ya(p,Rt(g,2),Ws):r}function Zt(p){return Zc(p,tl)}function wn(p,g){return Zc(p,Rt(g,2))}function Yi(p){return p&&p.length?Ya(p,tl,lr):r}function X0(p,g){return p&&p.length?Ya(p,Rt(g,2),lr):r}var Qv=xf(function(p,g){return p*g},1),Z_=oo("round"),W_=xf(function(p,g){return p-g},0);function Ww(p){return p&&p.length?uu(p,tl):0}function Fo(p,g){return p&&p.length?uu(p,Rt(g,2)):0}return ee.after=P0,ee.ary=Vy,ee.assign=k0,ee.assignIn=Io,ee.assignInWith=Fi,ee.assignWith=Qd,ee.at=ql,ee.before=Fy,ee.bind=Nv,ee.bindAll=Qh,ee.bindKey=Ky,ee.castArray=Pv,ee.chain=si,ee.chunk=Ny,ee.compact=$d,ee.concat=Pd,ee.cond=rp,ee.conforms=K0,ee.constant=fi,ee.countBy=Dv,ee.create=Fh,ee.curry=Af,ee.curryRight=Gy,ee.debounce=Yy,ee.defaults=kv,ee.defaultsDeep=Ki,ee.defer=Ln,ee.delay=jh,ee.difference=qd,ee.differenceBy=$y,ee.differenceWith=ls,ee.drop=Qr,ee.dropRight=yv,ee.dropRightWhile=Py,ee.dropWhile=wa,ee.fill=Ld,ee.filter=Nh,ee.flatMap=$l,ee.flatMapDeep=A0,ee.flatMapDepth=$h,ee.flatten=Yn,ee.flattenDeep=Ml,ee.flattenDepth=_u,ee.flip=Xy,ee.flow=G0,ee.flowRight=lp,ee.fromPairs=qy,ee.functions=vx,ee.functionsIn=U0,ee.groupBy=Id,ee.initial=_h,ee.intersection=Ah,ee.intersectionBy=Ol,ee.intersectionWith=Qt,ee.invert=An,ee.invertBy=gx,ee.invokeMap=Nu,ee.iteratee=op,ee.keyBy=Hd,ee.keys=Wr,ee.keysIn=qr,ee.map=Ph,ee.mapKeys=yc,ee.mapValues=Wd,ee.matches=Xv,ee.matchesProperty=vb,ee.memoize=zh,ee.merge=Ho,ee.mergeWith=ds,ee.method=Y0,ee.methodOf=Zh,ee.mixin=o,ee.negate=Za,ee.nthArg=v,ee.omit=Jd,ee.omitBy=I0,ee.once=q0,ee.orderBy=D0,ee.over=w,ee.overArgs=L0,ee.overEvery=_,ee.overSome=z,ee.partial=mc,ee.partialRight=vc,ee.partition=M0,ee.pick=qf,ee.pickBy=Lf,ee.property=J,ee.propertyOf=ge,ee.pull=Rf,ee.pullAll=ii,ee.pullAllBy=Ev,ee.pullAllWith=Sv,ee.pullAt=ui,ee.range=qe,ee.rangeRight=Ye,ee.rearg=Qy,ee.reject=px,ee.remove=zd,ee.rest=$v,ee.reverse=fc,ee.sampleSize=hc,ee.set=Gh,ee.setWith=Uv,ee.shuffle=N0,ee.slice=Dh,ee.sortBy=qh,ee.sortedUniq=Mh,ee.sortedUniqBy=wv,ee.split=Yv,ee.spread=Zy,ee.tail=T0,ee.take=ky,ee.takeRight=Sn,ee.takeRightWhile=Hn,ee.takeWhile=sn,ee.tap=Uy,ee.throttle=us,ee.thru=hn,ee.toArray=ob,ee.toPairs=Yh,ee.toPairsIn=jf,ee.toPath=Oe,ee.toPlainObject=Xd,ee.transform=sb,ee.unary=$u,ee.union=en,ee.unionBy=qn,ee.unionWith=Pt,ee.uniq=Du,ee.uniqBy=dc,ee.uniqWith=Rv,ee.unset=Iv,ee.unzip=ko,ee.unzipWith=Xn,ee.update=cb,ee.updateWith=mo,ee.values=Ll,ee.valuesIn=Vo,ee.without=Ui,ee.words=F0,ee.wrap=ss,ee.xor=Tf,ee.xorBy=Tv,ee.xorWith=Nl,ee.zip=Cr,ee.zipObject=Oh,ee.zipObjectDeep=wr,ee.zipWith=_v,ee.entries=Yh,ee.entriesIn=jf,ee.extend=Io,ee.extendWith=Fi,o(ee,ee),ee.add=Pe,ee.attempt=mb,ee.camelCase=Fv,ee.capitalize=da,ee.ceil=Ze,ee.clamp=fb,ee.clone=Wy,ee.cloneDeep=Bh,ee.cloneDeepWith=Df,ee.cloneWith=Jy,ee.conformsTo=kh,ee.deburr=ep,ee.defaultTo=ap,ee.divide=wt,ee.endsWith=db,ee.eq=po,ee.escape=Kv,ee.escapeRegExp=zf,ee.every=Ud,ee.find=fo,ee.findIndex=jd,ee.findKey=Zd,ee.findLast=_0,ee.findLastIndex=bv,ee.findLastKey=Pf,ee.floor=gn,ee.forEach=Iy,ee.forEachRight=Ou,ee.forIn=ho,ee.forInRight=Kh,ee.forOwn=Ja,ee.forOwnRight=Gi,ee.get=gc,ee.gt=j0,ee.gte=Mf,ee.has=Zr,ee.hasIn=Ue,ee.head=Ly,ee.identity=tl,ee.includes=Hy,ee.indexOf=jy,ee.inRange=Hv,ee.invoke=ib,ee.isArguments=Ii,ee.isArray=Bt,ee.isArrayBuffer=Vd,ee.isArrayLike=Wa,ee.isArrayLikeObject=Rr,ee.isBoolean=Fd,ee.isBuffer=cs,ee.isDate=z0,ee.isElement=rn,ee.isEmpty=eb,ee.isEqual=qv,ee.isEqualWith=Kd,ee.isError=Of,ee.isFinite=tb,ee.isFunction=Uo,ee.isInteger=Gd,ee.isLength=Uh,ee.isMap=Lv,ee.isMatch=nb,ee.isMatchWith=rb,ee.isNaN=Vn,ee.isNative=ab,ee.isNil=lb,ee.isNull=qa,ee.isNumber=Ih,ee.isObject=er,ee.isObjectLike=Tr,ee.isPlainObject=Nf,ee.isRegExp=Yd,ee.isSafeInteger=jv,ee.isSet=fs,ee.isString=Hh,ee.isSymbol=Pl,ee.isTypedArray=Hi,ee.isUndefined=zv,ee.isWeakMap=hx,ee.isWeakSet=Vh,ee.join=xv,ee.kebabCase=H0,ee.last=or,ee.lastIndexOf=zy,ee.lowerCase=Gv,ee.lowerFirst=pb,ee.lt=B0,ee.lte=$f,ee.max=yt,ee.maxBy=Ht,ee.mean=Zt,ee.meanBy=wn,ee.min=Yi,ee.minBy=X0,ee.stubArray=We,ee.stubFalse=Le,ee.stubObject=He,ee.stubString=mt,ee.stubTrue=Dt,ee.multiply=Qv,ee.nth=os,ee.noConflict=u,ee.noop=f,ee.now=Lh,ee.pad=V0,ee.padEnd=Bf,ee.padStart=pa,ee.parseInt=Pu,ee.random=Vv,ee.reduce=Mv,ee.reduceRight=Ov,ee.repeat=qu,ee.replace=La,ee.result=ub,ee.round=Z_,ee.runInContext=Me,ee.sample=O0,ee.size=$0,ee.snakeCase=hb,ee.some=_f,ee.sortedIndex=so,ee.sortedIndexBy=Au,ee.sortedIndexOf=R0,ee.sortedLastIndex=Cv,ee.sortedLastIndexBy=Bd,ee.sortedLastIndexOf=By,ee.startCase=tp,ee.startsWith=Xh,ee.subtract=W_,ee.sum=Ww,ee.sumBy=Fo,ee.template=np,ee.times=Fn,ee.toFinite=Vi,ee.toInteger=At,ee.toLength=Bv,ee.toLower=ha,ee.toNumber=Cn,ee.toSafeInteger=mx,ee.toString=ht,ee.toUpper=ja,ee.trim=el,ee.trimEnd=bc,ee.trimStart=ci,ee.truncate=hr,ee.unescape=jl,ee.uniqueId=we,ee.upperCase=ps,ee.upperFirst=hs,ee.each=Iy,ee.eachRight=Ou,ee.first=Ly,o(ee,(function(){var p={};return Po(ee,function(g,T){On.call(ee.prototype,T)||(p[T]=g)}),p})(),{chain:!1}),ee.VERSION=l,Co(["bind","bindKey","curry","curryRight","partial","partialRight"],function(p){ee[p].placeholder=ee}),Co(["drop","take"],function(p,g){It.prototype[p]=function(T){T=T===r?1:Er(At(T),0);var j=this.__filtered__&&!g?new It(this):this.clone();return j.__filtered__?j.__takeCount__=fn(T,j.__takeCount__):j.__views__.push({size:fn(T,oe),type:p+(j.__dir__<0?"Right":"")}),j},It.prototype[p+"Right"]=function(T){return this.reverse()[p](T).reverse()}}),Co(["filter","map","takeWhile"],function(p,g){var T=g+1,j=T==ae||T==B;It.prototype[p]=function(G){var ne=this.clone();return ne.__iteratees__.push({iteratee:Rt(G,3),type:T}),ne.__filtered__=ne.__filtered__||j,ne}}),Co(["head","last"],function(p,g){var T="take"+(g?"Right":"");It.prototype[p]=function(){return this[T](1).value()[0]}}),Co(["initial","tail"],function(p,g){var T="drop"+(g?"":"Right");It.prototype[p]=function(){return this.__filtered__?new It(this):this[T](1)}}),It.prototype.compact=function(){return this.filter(tl)},It.prototype.find=function(p){return this.filter(p).head()},It.prototype.findLast=function(p){return this.reverse().find(p)},It.prototype.invokeMap=qt(function(p,g){return typeof p=="function"?new It(this):this.map(function(T){return Tl(T,p,g)})}),It.prototype.reject=function(p){return this.filter(Za(Rt(p)))},It.prototype.slice=function(p,g){p=At(p);var T=this;return T.__filtered__&&(p>0||g<0)?new It(T):(p<0?T=T.takeRight(-p):p&&(T=T.drop(p)),g!==r&&(g=At(g),T=g<0?T.dropRight(-g):T.take(g-p)),T)},It.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},It.prototype.toArray=function(){return this.take(oe)},Po(It.prototype,function(p,g){var T=/^(?:filter|find|map|reject)|While$/.test(g),j=/^(?:head|last)$/.test(g),G=ee[j?"take"+(g=="last"?"Right":""):g],ne=j||/^find/.test(g);G&&(ee.prototype[g]=function(){var fe=this.__wrapped__,Se=j?[1]:arguments,Ne=fe instanceof It,Qe=Se[0],tt=Ne||Bt(fe),nt=function(tn){var yn=G.apply(ee,Ti([tn],Se));return j&&it?yn[0]:yn};tt&&T&&typeof Qe=="function"&&Qe.length!=1&&(Ne=tt=!1);var it=this.__chain__,xt=!!this.__actions__.length,Mt=ne&&!it,Vt=Ne&&!xt;if(!ne&&tt){fe=Vt?fe:new It(this);var Ot=p.apply(fe,Se);return Ot.__actions__.push({func:hn,args:[nt],thisArg:r}),new Sl(Ot,it)}return Mt&&Vt?p.apply(this,Se):(Ot=this.thru(nt),Mt?j?Ot.value()[0]:Ot.value():Ot)})}),Co(["pop","push","shift","sort","splice","unshift"],function(p){var g=vd[p],T=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",j=/^(?:pop|shift)$/.test(p);ee.prototype[p]=function(){var G=arguments;if(j&&!this.__chain__){var ne=this.value();return g.apply(Bt(ne)?ne:[],G)}return this[T](function(fe){return g.apply(Bt(fe)?fe:[],G)})}}),Po(It.prototype,function(p,g){var T=ee[g];if(T){var j=T.name+"";On.call(_n,j)||(_n[j]=[]),_n[j].push({name:g,func:T})}}),_n[zi(r,P).name]=[{name:"wrapper",func:r}],It.prototype.clone=$i,It.prototype.reverse=Cl,It.prototype.value=Pi,ee.prototype.at=kd,ee.prototype.chain=pr,ee.prototype.commit=fa,ee.prototype.next=is,ee.prototype.plant=Mu,ee.prototype.reverse=co,ee.prototype.toJSON=ee.prototype.valueOf=ee.prototype.value=Av,ee.prototype.first=ee.prototype.head,Jn&&(ee.prototype[Jn]=pc),ee}),su=Hp();Ci?((Ci.exports=su)._=su,Pp._=su):ra._=su}).call(Vre)})(JC,JC.exports)),JC.exports}var sr=Fre();const Kre=({view:e,setView:t,value:r,previousMonth:l,nextMonth:s,previousYear:c,nextYear:h,previousDecade:m,nextDecade:b,goBackProps:E,goNextProps:C,changeViewProps:S})=>{const R=e==="month",M=e==="year",q=e==="decade",N=()=>{if(q)return m();if(M)return c();l()},L=()=>{if(q)return b();if(M)return h();s()},P=()=>{if(R)return t("year");if(M)return t("decade")},U=()=>q?I():M?bo(r,"yyyy"):bo(r,"MMMM yyyy",{locale:Hre}),I=()=>{if(!r)return"";const V=oL({start:bL(r),end:iL(r)}),F=sr.first(V),K=sr.last(V);return`${bo(F,"yyyy")} - ${bo(K,"yyyy")}`},Y=k.useMemo(U,[r,e]);return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"flex items-center justify-between","data-slot":"calendar-navigation",children:[O.jsxs(hi,{onClick:N,size:"icon",variant:"ghost",className:"border w-6 opacity-50 hover:opacity-100","data-slot":"calendar-navigation-back",...E,children:[O.jsx(fM,{className:"h-4 w-4","data-slot":"calendar-navigation-back-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a anterior"})]}),O.jsx("button",{onClick:P,disabled:q,...S,type:"button",className:Fe("font-semibold pb-px text-gray-900 text-lg text-blue-bell select-none min-w-[60%] capitalize",S?.className),"data-slot":"calendar-navigation-label",children:Y}),O.jsxs(hi,{onClick:L,size:"icon",variant:"ghost",className:"border w-6 opacity-50 hover:opacity-100","data-slot":"calendar-navigation-next",...C,children:[O.jsx(Rw,{className:"h-4 w-4","data-slot":"calendar-navigation-next-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a siguiente"})]})]})})};function Ng(e){return!!(e&&typeof e=="object"&&"start"in e&&"end"in e)}function Gre(e,t){return{selectMultipleDate:s=>{if(!e)return t([s]);const c=sr.findIndex(e,m=>Zb(m,s));if(c===-1)return t([...e,s]);const h=[...e.slice(0,c),...e.slice(c+1)];t(h)},isMultipleSelected:s=>sr.isArray(e)&&e.some(c=>Zb(c,s))}}function Yre(e,t,r){const l=b=>{if(e?.start){const{start:C,end:S}=e;if(fne(b,C)||C&&S){t({start:b,end:void 0});return}if(s(C,b))return;t({start:C,end:b})}else t({start:b,end:void 0})},s=(b,E)=>!r||!b||!E?!1:lL({start:Og(b),end:E}).some(R=>r(R));return{selectRangeDate:l,isInRange:b=>{if(!Ng(e)||!e)return!1;const{start:E,end:C}=e;return E&&!C?Zb(b,E):!E||!C?!1:cre(b,{start:Og(E),end:Og(C)})},isFirstDayFromRange:b=>!e||!Ng(e)||!e.start?!1:Zb(b,e.start),isLastDayFromRange:b=>!e||!Ng(e)||!e.end?!1:Zb(b,e.end)}}function Xre(e,t){return{selectSingleDate:s=>{t(s)},isSingleSelected:s=>Ag(e)&&Zb(s,e)}}const xL=k.createContext({defaultStartDate:new Date,mode:"single",isSingleMode:!1,isRangeMode:!1,selected:null,selectDate:()=>{},isSelected:()=>!1,isFirstDayFromRange:()=>!1,isLastDayFromRange:()=>!1,isInRange:()=>!1});function Qre(e){const{mode:t,value:r,defaultValue:l,onChange:s,disabled:c}=e,h=t==="single",m=t==="range",b=t==="multiple",[E=null,C]=br({prop:r,onChange:s,defaultProp:l}),{selectSingleDate:S,isSingleSelected:R}=Xre(Ag(E)?E:void 0,C),{selectRangeDate:M,isInRange:q,...N}=Yre(Ng(E)?E:void 0,C,c),{selectMultipleDate:L,isMultipleSelected:P}=Gre(sr.isArray(E)?E:void 0,C),U=V=>{if(h)return S(V);if(m)return M(V);if(b)return L(V)},I=V=>h?R(V):m?q(V):b?P(V):!1;return{defaultStartDate:Ag(E)?E:sr.isArray(E)?E[0]:Ng(E)&&E.start?E.start:new Date,isSingleMode:h,isRangeMode:m,selected:E,isSelected:I,selectDate:U,isInRange:q,mode:t,...N}}const Zre=({day:e,navigationDate:t,className:r,...l})=>{const{isSelected:s,mode:c,selected:h,isRangeMode:m,selectDate:b,isFirstDayFromRange:E,isLastDayFromRange:C}=k.useContext(xL),S=k.useMemo(()=>s(e),[e,h]),R=!S&&!ure(e,t),M=!S&&ste(e);return O.jsx("button",{...l,onClick:()=>b(e),type:"button","data-slot":"calendar-day","data-state-mode":c,"data-state-today":sre(e)||void 0,"data-state-selected":S||void 0,"data-state-different-month":R||void 0,"data-state-weekend":M||void 0,"data-state-range-mode":m||void 0,"data-state-first-day":E(e)||void 0,"data-state-last-day":C(e)||void 0,"data-state-in-range":m&&S||void 0,className:Fe("mx-auto flex pt-px rounded-md items-center justify-center w-full aspect-square hover:bg-accent","data-[state-today]:text-error","data-[state-selected]:bg-primary data-[state-selected]:!text-primary-foreground data-[state-selected]:hover:bg-primary/80","data-[state-different-month]:opacity-50 data-[state-weekend=true]:opacity-50","data-[state-in-range]:not-data-[state-first-day]:not-data-[state-last-day]:rounded-none","data-[state-first-day]:rounded-l-full","data-[state-last-day]:rounded-r-full",r),children:O.jsx("time",{dateTime:bo(e,"yyyy-MM-dd"),children:bo(e,"d")})})},Wre=({value:e,onChange:t})=>{const r=()=>oL({start:bL(e),end:iL(e)}),l=c=>{const h=dre(e,parseInt(bo(c,"yyyy")));t(h)},s=k.useMemo(r,[e]);return O.jsx("div",{className:"grid grid-cols-3 grow","data-slot":"calendar-decade-view",children:s.map((c,h)=>O.jsx(hi,{onClick:()=>l(c),className:"h-full rounded-none",type:"button",variant:"ghost","data-slot":"calendar-decade-view-year",children:bo(c,"yyyy")},h))})},C2=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],EL=["Lunes","Martes","Miercoles","Jueves","Viernes","Sabado","Domingo"],Jre=e=>O.jsx("div",{...e,className:Fe("grid grid-cols-7 font-semibold mt-2 text-xs leading-6 text-center py-1 bg-blue-bell/40 select-none",e.className),"data-slot":"calendar-week-days",children:EL.map(t=>O.jsx("abbr",{"aria-label":t,"data-slot":"calendar-week-day",children:sr.at(t,0)},t))}),eae=({navigationDate:e,disabled:t,weekDaysClassName:r,weekDaysProps:l,dayClassName:s,dayProps:c})=>{const h=()=>lL({start:Am(e,{weekStartsOn:1}),end:gte(mte(e),{weekStartsOn:1})}),m=k.useMemo(h,[e]);return O.jsxs(O.Fragment,{children:[O.jsx(Jre,{className:r,...l}),O.jsx("div",{className:"grid grid-cols-7 mt-2 text-sm","data-slot":"calendar-month-view",children:m.map((b,E)=>O.jsx(Zre,{day:b,className:s,...c,navigationDate:e,disabled:t?.(b)},E))})]})},tae=({value:e,onChange:t})=>{const r=l=>{const s=fre(e,l);t(s)};return O.jsx("div",{className:"grid grid-cols-3 grow","data-slot":"calendar-year-view",children:C2.map(l=>O.jsx(hi,{type:"button",className:"h-full rounded",onClick:()=>r(C2.indexOf(l)),variant:"ghost","data-slot":"calendar-year-view-month",children:O.jsx("abbr",{"aria-label":`${l} ${bo(e,"yyyy")}`,children:l})},l))})};function nae(e=LD()){const[t,r]=k.useState({month:bo(e||LD(),"MM"),year:bo(e||LD(),"yyyy")}),l=k.useMemo(()=>ore(`${t.month}-${t.year}`,"MM-yyyy",new Date),[t]),s=R=>{r({...t,month:bo(R,"MM")})},c=R=>{r({...t,year:bo(R,"yyyy")})};return{navigationDate:l,setMonth:s,setYear:c,previousMonth:()=>{const R=x2(l,-1);r({month:bo(R,"MM"),year:bo(R,"yyyy")})},nextMonth:()=>{const R=x2(l,1);r({month:bo(R,"MM"),year:bo(R,"yyyy")})},previousYear:()=>{const R=hT(l,-1);c(R)},nextYear:()=>{const R=hT(l,1);c(R)},previousDecade:()=>{const R=hT(l,-10);c(R)},nextDecade:()=>{const R=hT(l,10);c(R)}}}const SL=e=>{const{disabled:t,initialView:r="month",view:l,onChangeView:s,initialDate:c,goBackProps:h,goNextProps:m,changeViewProps:b}=e,E=Qre(e),{defaultStartDate:C}=E,{navigationDate:S,setMonth:R,setYear:M,...q}=nae(c||C),[N=r,L]=br({prop:l,onChange:P=>s?.(P,S),defaultProp:r});return O.jsx(xL.Provider,{value:E,children:O.jsxs("div",{"data-slot":"calendar",className:Fe("w-60 min-h-64 flex flex-col border rounded-md p-2",e.className),children:[O.jsx(Kre,{view:N,setView:L,value:S,goBackProps:h,goNextProps:m,changeViewProps:b,...q}),N==="month"&&O.jsx(eae,{...e.monthViewProps,navigationDate:S,disabled:t}),N==="year"&&O.jsx(tae,{value:S,onChange:P=>{R(P),L("month")}}),N==="decade"&&O.jsx(Wre,{value:S,onChange:P=>{M(P),L("year")}})]})})},rae=({className:e,...t})=>O.jsx("div",{className:Fe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t,"data-slot":"card"}),aae=({className:e,...t})=>O.jsx("div",{className:Fe("flex flex-col space-y-1 p-6",e),...t,"data-slot":"card-header"}),lae=({className:e,...t})=>O.jsx("h3",{className:Fe("text-2xl font-semibold leading-none tracking-tight",e),...t,"data-slot":"card-title"}),oae=({className:e,...t})=>O.jsx("p",{className:Fe("text-sm text-muted-foreground",e),...t,"data-slot":"card-description"}),iae=({className:e,...t})=>O.jsx("div",{className:Fe("p-6 pt-0",e),...t,"data-slot":"card-content"}),uae=({className:e,...t})=>O.jsx("div",{className:Fe("flex items-center p-6 pt-0",e),...t,"data-slot":"card-footer"}),sae=({className:e,...t})=>O.jsx("div",{className:Fe("flex items-center justify-center",e),...t,"data-slot":"center"}),$w=({className:e,...t})=>O.jsx("label",{className:Fe("text-sm font-medium select-none leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),"data-slot":"label",...t}),w2=({when:e,...t})=>O.jsx(Ts,{present:e,children:O.jsx(_w,{...t,"data-state":e?"open":"closed","data-slot":"show"})}),cae=({checked:e,onChange:t,defaultChecked:r=!1,indeterminate:l,defaultIndeterminate:s=!1,onIndeterminateChange:c,className:h,size:m=16,children:b,containerClassName:E,containerProps:C,...S})=>{const R=k.useId(),M=k.useRef(null),[q,N]=br({defaultProp:r,prop:e,onChange:t}),[L,P]=br({defaultProp:s,prop:l,onChange:c});k.useEffect(()=>{M.current&&(M.current.indeterminate=L)},[L]);const U=V=>{V.stopPropagation(),!S.disabled&&(L?(P(!1),N(!0)):N(F=>!F))},I=L?"indeterminate":q?"checked":"unchecked",Y=S.id??R;return O.jsxs("div",{...C,className:Fe("flex gap-x-2 items-center",E),"data-slot":"checkbox",children:[O.jsxs("button",{disabled:S.disabled,onClick:U,"data-state":I,type:"button",style:{width:m,height:m},className:Fe("peer aspect-square flex gap-2 shrink-0 rounded-(--radius-checkbox) border border-(--color-checkbox) ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","transition-colors","data-[state=checked]:bg-(--color-checkbox) data-[state=checked]:text-primary-foreground data-[state=checked]:border-transparent","data-[state=indeterminate]:bg-(--color-checkbox) data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-transparent","data-[state=unchecked]:bg-background data-[state=unchecked]:text-muted-foreground data-[state=unchecked]:border-input",h),"data-slot":"checkbox-trigger",children:[O.jsx(w2,{when:L,children:O.jsx(yK,{className:Fe("pt-[2px] w-full h-full opacity-0","open:fade-in-0 open:zoom-in-50 open:opacity-100 open:duration-200","closed:fade-out-0 closed:zoom-out-50 closed:opacity-0")})}),O.jsx(w2,{when:!L&&!!q,children:O.jsx($T,{className:Fe("pt-[2px] w-full h-full opacity-0","open:fade-in-0 open:zoom-in-50 open:opacity-100 open:duration-200","closed:fade-out-0 closed:zoom-out-50 closed:opacity-0")})}),O.jsx("input",{...S,ref:M,id:Y,tabIndex:-1,checked:q,onChange:V=>N(V.currentTarget.checked),type:"checkbox",className:"sr-only","aria-hidden":!0})]}),b&&O.jsx($w,{htmlFor:Y,"data-slot":"checkbox-label",children:b})]})};function fae({items:e=[],valueKey:t="value",labelKey:r="label",placeholder:l="Seleccionar",searchPlaceholder:s="Buscar...",emptyMessage:c="No se encontraron resultado",searchProps:h,className:m,triggerProps:b,itemProps:E,itemClassName:C,contentProps:S,contentClassName:R,value:M,onChange:q,defaultValue:N,renderOption:L=I=>I?.[r],commandProps:P,...U}){const[I,Y]=br({prop:U.open,onChange:U.onOpenChange,defaultProp:U.defaultOpen||!1}),[V,F]=br({prop:M,onChange:de=>{if(!q)return;const W=e.find(se=>se[t]===de);q?.(W?.[t],W)},defaultProp:N}),[K,Q]=br({prop:U?.search,defaultProp:U?.searchDefaultValue||"",onChange:U?.onSearchChange}),he=D.useMemo(()=>e.find(de=>de[t]===V),[V]);return O.jsxs(Kw,{open:I,onOpenChange:Y,"data-slot":"combobox",children:[O.jsx(Gw,{asChild:!0,"data-slot":"combobox-trigger",children:O.jsxs(hi,{...U,...b,variant:"outline",role:"combobox","aria-expanded":I,className:Fe("font-normal w-full items-center justify-between border-input px-3 hover:bg-background",m),children:[O.jsx("span",{className:"truncate",children:he?L(he):l}),O.jsx(PT,{className:"ml-2 h-4 w-4 shrink-0 opacity-50","data-slot":"combobox-trigger-icon"})]})}),O.jsx(Yw,{...S,className:Fe("p-1",R),asChild:!0,matchTriggerWidth:!0,"data-slot":"combobox-content",children:O.jsxs(Dw,{...P,children:[O.jsx(x_,{value:K,onValueChange:Q,placeholder:s,autoFocus:!0,"data-slot":"combobox-input",...h}),O.jsx(S_,{"data-slot":"combobox-empty",children:c}),O.jsx(E_,{"data-slot":"combobox-list",children:e.map(de=>k.createElement(sw,{className:C,"data-slot":"combobox-item",...E,key:de[t],value:de[t],onSelect:()=>{const W=de[t];F(W===V?"":W),Y(!1)}},L(de)))})]})})]})}const dae=e=>{const{placeholder:t,mode:r="single",value:l,onChange:s,defaultValue:c,className:h,disabledDate:m,renderFooter:b,disabled:E,hideFooter:C,...S}=e,R=r==="range",M=r==="single",q=r==="multiple",[N=null,L]=br({prop:l,onChange:he=>s?.(he),defaultProp:c}),P=he=>{if(!Ng(he))return!1;const{start:de,end:W}=he;return Ag(de)&&Ag(W)},U=he=>{he||!N||!Ng(N)||P(N)||L({start:null,end:null})},I=he=>Ag(he)?bo(he,"dd/MM/yyyy"):"",Y=()=>{M&&L(null),q&&L([]),R&&L({start:null,end:null})},V=()=>{L(new Date)},F=k.useMemo(()=>{if(!N)return"";if(M&&Ag(N))return I(N);if(q&&sr.isArray(N))return N.map(I).join(" - ");if(R&&Ng(N)){const de=I(N.start),W=I(N.end);return!de&&!W?"":de&&!W?de:`${de} - ${W}`}return""},[N]),K=()=>O.jsxs("span",{className:"flex w-full p-1 justify-between",children:[O.jsx(hi,{variant:"ghost",onClick:Y,children:"Borrar"}),M&&O.jsx(hi,{variant:"ghost",onClick:V,disabled:m?.(new Date),children:"Hoy"})]}),Q=()=>C?null:b?b({mode:r,value:N,clear:Y,selectToday:V,setValue:L}):K();return O.jsxs(Kw,{onOpenChange:U,"data-slot":"date-picker",children:[O.jsx(Gw,{asChild:!0,"data-slot":"date-picker-trigger",children:O.jsxs("button",{disabled:E,type:"button",className:Fe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 items-center text-sm ring-offset-background placeholder:text-muted-foreground","hover:bg-accent hover:text-accent-foreground transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",!N&&"text-muted-foreground",h,"field-error"),children:[O.jsx("input",{value:F,className:"sr-only",...S}),O.jsx("span",{className:"flex-1 text-start truncate pt-px","data-slot":"date-picker-value",children:F||t}),O.jsx(HF,{className:"ml-2 h-4 w-4","data-slot":"date-picker-icon"})]})}),O.jsxs(Yw,{className:"w-auto p-0",align:"start","data-slot":"date-picker-content",children:[O.jsx(SL,{className:"border-none",mode:r,value:N,onChange:L,disabled:e.disabledDate}),O.jsx("div",{className:"p-2","data-slot":"date-picker-footer",children:Q()})]})]})},CL=e=>{const{className:t,orientation:r="horizontal"}=e;return O.jsx("hr",{...e,"aria-orientation":r,className:Fe("shrink-0 bg-input",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),"data-slot":"divider"})},pae=({onDrop:e,onError:t,allowedExtensions:r=[],maxFileSize:l=5*1024*1024,maxFiles:s=1/0})=>{const[c,h]=k.useState(!1),m=k.useCallback(R=>{R.preventDefault(),R.stopPropagation()},[]),b=k.useCallback(R=>{R.preventDefault(),R.stopPropagation(),h(!0)},[]),E=k.useCallback(R=>{R.preventDefault(),R.stopPropagation(),h(!1)},[]),C=R=>{const[M=[],q=[],N=[]]=R.reduce(([L,P,U],I)=>r.length>0&&!r.includes(I.type)?(L.push(I),U.push({file:I,errorMessage:"Extensión no permitida",errorCode:"INVALID_EXTENSION"}),[L,P,U]):I.size>l?(L.push(I),U.push({file:I,errorMessage:"Archivo demasiado grande",errorCode:"FILE_TOO_LARGE"}),[L,P,U]):s&&s<P.length+1?(L.push(I),U.push({file:I,errorMessage:"Límite de archivos excedido",errorCode:"MAX_FILES_EXCEEDED"}),[L,P,U]):(P.push(I),[L,P,U]),[[],[],[]]);return N.length>0&&t&&t(N),[M,q,N]},S=k.useCallback(R=>{R.preventDefault(),R.stopPropagation(),h(!1);const M=Array.from(R.dataTransfer.files),[q=[],N=[]]=C(M);e(N,q)},[r,l,s,e,t]);return{isDragActive:c,validateFiles:C,dropzoneProps:{onDragOver:m,onDragEnter:b,onDragLeave:E,onDrop:S}}},wL=k.createContext(null),BM=()=>{const e=k.useContext(wL);if(!e)throw new Error("useUploadContext must be used within a UploadContextProvider");return e},RL=({onFileAdd:e,onFileRemove:t,onChangeFiles:r,files:l,maxFiles:s=1,allowedExtensions:c=[],maxFileSize:h=5*1024*1024,multiple:m,children:b,onError:E,...C})=>{const[S=[],R]=br({defaultProp:[],prop:l,onChange:r}),[M,q]=k.useState([]),{isDragActive:N,validateFiles:L,dropzoneProps:P}=pae({onDrop:(Y,V)=>{R([...S,...Y]),q(F=>[...F,...V]),e?.(Y)},allowedExtensions:c,maxFileSize:h,maxFiles:s,onError:E}),U=Y=>{const[V=[],F=[]]=L(Y);if(s===1||!m){R(F.slice(0,1)),q([...V,...F.slice(1)]),e?.(F.slice(0,1));return}const K=s-S.length;if(K<=0){q(de=>[...de,...F]),e?.([]);return}const Q=F.slice(0,K),he=F.slice(K);R([...S,...Q]),q(de=>[...de,...V,...he]),e?.(Q)},I=(Y,V)=>{V==="accepted"?R(S.filter((F,K)=>K!==Y)):q(F=>F.filter((K,Q)=>Q!==Y)),t?.(Y,V)};return O.jsx(wL.Provider,{value:{files:S,rejectedFiles:M,handleFileAdd:U,handleFileRemove:I,inputProps:{accept:c.join(","),multiple:m},isDragActive:N,dropzoneProps:P},children:O.jsx("div",{...C,"data-slot":"upload",children:b})})},TL=({asChild:e,...t})=>{const{handleFileAdd:r,inputProps:l,dropzoneProps:s,isDragActive:c}=BM(),h=k.useRef(null),m=e?_w:"button";return O.jsxs(O.Fragment,{children:[O.jsx(m,{"data-slot":"upload-trigger",...t,...s,"data-drag-active":c||!1,onClick:b=>{t.onClick?.(b),h.current?.click()}}),O.jsx("input",{type:"file",className:"hidden","data-slot":"upload-input",...l,ref:h,onChange:b=>r(Array.from(b.target.files||[]))})]})},_L=({className:e,...t})=>O.jsx("div",{...t,className:Fe("mt-2 space-y-2",e),"data-slot":"upload-content"}),AL=({files:e,handleFileRemove:t,fileType:r,children:l,renderFile:s,...c})=>e.length===0?null:O.jsxs("div",{className:"mt-2 space-y-2",...c,"data-slot":"upload-files-list",children:[l,e.map((h,m)=>s?s(h,()=>t(m,r)):O.jsx(OL,{file:h,onRemove:()=>t(m,r)},h.name))]}),DL=e=>{const{files:t,handleFileRemove:r}=BM();return O.jsx(AL,{"data-slot":"upload-accepted-files",files:t,handleFileRemove:r,fileType:"accepted",...e})},ML=e=>{const{rejectedFiles:t,handleFileRemove:r}=BM();return O.jsx(AL,{"data-slot":"upload-rejected-files",files:t,handleFileRemove:r,fileType:"rejected",...e})},OL=({file:e,onRemove:t,className:r,renderIcon:l,...s})=>O.jsxs("div",{className:Fe("flex items-center gap-2 mb-2",r),...s,"data-slot":"upload-item",children:[l?.(e),e.name,O.jsx(hi,{variant:"ghost",size:"icon",type:"button",className:"h-6 w-6",onClick:t,"data-slot":"upload-item-remove",children:O.jsx(h_,{"data-slot":"upload-item-remove-icon"})})]}),hae=({onFileAdd:e,onFileRemove:t,onChangeFiles:r=()=>{},files:l,maxFiles:s=1,allowedExtensions:c=[],maxFileSize:h=5*1024*1024,multiple:m,renderAcceptedFile:b,renderRejectedFile:E,showRejected:C=!1,className:S,icon:R=sK,iconSize:M=40,onError:q,...N})=>{const L=k.useMemo(()=>c.map(P=>P.split("/")?.[1]).join(", "),[c]);return O.jsxs(RL,{onFileAdd:e,onFileRemove:t,files:l,onChangeFiles:r,maxFiles:s,allowedExtensions:c,maxFileSize:h,multiple:m?!0:void 0,className:Fe("w-full",S),onError:q,...N,children:[O.jsx(TL,{asChild:!0,children:O.jsxs("div",{className:Fe("w-full min-h-[150px] border-2 border-dashed rounded-lg border-muted p-4","hover:bg-muted/50 data-[drag-active=true]:border-primary data-[drag-active=true]:bg-primary/10","transition-colors flex flex-col items-center justify-center gap-4","pointer-events-auto"),children:[O.jsx(R,{className:"text-muted-foreground pointer-events-none",style:{width:M,height:M}}),O.jsxs("div",{className:"text-center text-muted-foreground pointer-events-none",children:[O.jsx("p",{children:"Arrastra y suelta archivos aquí o haz clic para seleccionar"}),c.length>0&&O.jsxs("p",{className:"text-sm",children:["Tipos permitidos: ",L]}),O.jsxs("p",{className:"text-sm",children:["Tamaño máximo: ",Math.floor(h/1024/1024),"MB"]})]})]})}),O.jsxs(_L,{children:[O.jsx(DL,{renderFile:b}),C&&O.jsx(ML,{renderFile:E})]})]})},sl={JPEG:"image/jpeg",JPG:"image/jpg",PNG:"image/png",GIF:"image/gif",WEBP:"image/webp",SVG:"image/svg+xml",PDF:"application/pdf",DOC:"application/msword",DOCX:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",XLS:"application/vnd.ms-excel",XLSX:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",PPT:"application/vnd.ms-powerpoint",PPTX:"application/vnd.openxmlformats-officedocument.presentationml.presentation",TXT:"text/plain",CSV:"text/csv",ZIP:"application/zip",RAR:"application/x-rar-compressed",MP3:"audio/mpeg",WAV:"audio/wav",MP4:"video/mp4",WEBM:"video/webm",JSON:"application/json",XML:"application/xml"},mae={IMAGES:[sl.JPEG,sl.JPG,sl.PNG,sl.GIF,sl.WEBP,sl.SVG],DOCUMENTS:[sl.PDF,sl.DOC,sl.DOCX,sl.XLS,sl.XLSX,sl.PPT,sl.PPTX],COMPRESSED:[sl.ZIP,sl.RAR],AUDIO:[sl.MP3,sl.WAV],VIDEO:[sl.MP4,sl.WEBM]},vae=$m([],{variants:{size:{sm:"text-[14px]",md:"text-[16px]",lg:"text-[18px]",xl:"text-[20px]","2xl":"text-[24px]","3xl":"text-[28px]","4xl":"text-[32px]","5xl":"text-[36px]","6xl":"text-[40px]"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{size:"xl",weight:"semibold"}}),NL=({className:e,size:t,weight:r,as:l,...s})=>{const c=l||"h2";return O.jsx(c,{className:Fe(vae({size:t,weight:r}),e),...s,"data-slot":"heading","data-size":t,"data-weight":r})},gae=({icon:e=O.jsx(mK,{className:"w-12 h-12"}),title:t="No hay resultados",description:r,className:l,children:s,...c})=>O.jsxs("div",{className:Fe("flex flex-col gap-2 justify-center items-center",l),"data-slot":"empty-state",...c,children:[O.jsx("div",{className:"text-muted-foreground","data-slot":"empty-state-icon",children:e}),O.jsx(NL,{className:"empty:hidden","data-slot":"empty-state-title",children:t}),O.jsx("p",{className:"py-1 text-sm text-center text-muted-foreground empty:hidden","data-slot":"empty-state-description",children:r}),s]}),yae=({label:e,labelClassName:t,labelProps:r,error:l,errorClassName:s,errorProps:c,children:h,className:m,...b})=>O.jsxs("div",{...b,className:Fe("flex flex-col gap-1",m),"data-slot":"field",children:[O.jsx($w,{className:Fe("empty:hidden",t),...r,"data-slot":"field-label",children:e}),h,O.jsx("p",{"data-slot":"field-error",className:Fe("text-sm font-medium text-error empty:hidden",s),...c,children:l})]});var Pw=e=>e.type==="checkbox",Gb=e=>e instanceof Date,Uu=e=>e==null;const $L=e=>typeof e=="object";var dl=e=>!Uu(e)&&!Array.isArray(e)&&$L(e)&&!Gb(e),PL=e=>dl(e)&&e.target?Pw(e.target)?e.target.checked:e.target.value:e,bae=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qL=(e,t)=>e.has(bae(t)),xae=e=>{const t=e.constructor&&e.constructor.prototype;return dl(t)&&t.hasOwnProperty("isPrototypeOf")},kM=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Hl(e){let t;const r=Array.isArray(e),l=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(kM&&(e instanceof Blob||l))&&(r||dl(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!xae(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Hl(e[s]));else return e;return t}var __=e=>/^\w*$/.test(e),Ta=e=>e===void 0,UM=e=>Array.isArray(e)?e.filter(Boolean):[],IM=e=>UM(e.replace(/["|']|\]/g,"").split(/\.|\[/)),dt=(e,t,r)=>{if(!t||!dl(e))return r;const l=(__(t)?[t]:IM(t)).reduce((s,c)=>Uu(s)?s:s[c],e);return Ta(l)||l===e?Ta(e[t])?r:e[t]:l},Es=e=>typeof e=="boolean",ir=(e,t,r)=>{let l=-1;const s=__(t)?[t]:IM(t),c=s.length,h=c-1;for(;++l<c;){const m=s[l];let b=r;if(l!==h){const E=e[m];b=dl(E)||Array.isArray(E)?E:isNaN(+s[l+1])?{}:[]}if(m==="__proto__"||m==="constructor"||m==="prototype")return;e[m]=b,e=e[m]}};const KT={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Qf={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Sm={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HM=k.createContext(null);HM.displayName="HookFormContext";const qw=()=>k.useContext(HM),Eae=e=>{const{children:t,...r}=e;return k.createElement(HM.Provider,{value:r},t)};var LL=(e,t,r,l=!0)=>{const s={defaultValues:t._defaultValues};for(const c in e)Object.defineProperty(s,c,{get:()=>{const h=c;return t._proxyFormState[h]!==Qf.all&&(t._proxyFormState[h]=!l||Qf.all),r&&(r[h]=!0),e[h]}});return s};const VM=typeof window<"u"?k.useLayoutEffect:k.useEffect;function Sae(e){const t=qw(),{control:r=t.control,disabled:l,name:s,exact:c}=e||{},[h,m]=k.useState(r._formState),b=k.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return VM(()=>r._subscribe({name:s,formState:b.current,exact:c,callback:E=>{!l&&m({...r._formState,...E})}}),[s,l,c]),k.useEffect(()=>{b.current.isValid&&r._setValid(!0)},[r]),k.useMemo(()=>LL(h,r,b.current,!1),[h,r])}var Cs=e=>typeof e=="string",R2=(e,t,r,l,s)=>Cs(e)?(l&&t.watch.add(e),dt(r,e,s)):Array.isArray(e)?e.map(c=>(l&&t.watch.add(c),dt(r,c))):(l&&(t.watchAll=!0),r),T2=e=>Uu(e)||!$L(e);function Zf(e,t,r=new WeakSet){if(T2(e)||T2(t))return Object.is(e,t);if(Gb(e)&&Gb(t))return e.getTime()===t.getTime();const l=Object.keys(e),s=Object.keys(t);if(l.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const c of l){const h=e[c];if(!s.includes(c))return!1;if(c!=="ref"){const m=t[c];if(Gb(h)&&Gb(m)||dl(h)&&dl(m)||Array.isArray(h)&&Array.isArray(m)?!Zf(h,m,r):!Object.is(h,m))return!1}}return!0}function Cae(e){const t=qw(),{control:r=t.control,name:l,defaultValue:s,disabled:c,exact:h,compute:m}=e||{},b=k.useRef(s),E=k.useRef(m),C=k.useRef(void 0),S=k.useRef(r),R=k.useRef(l);E.current=m;const[M,q]=k.useState(()=>{const Y=r._getWatch(l,b.current);return E.current?E.current(Y):Y}),N=k.useCallback(Y=>{const V=R2(l,r._names,Y||r._formValues,!1,b.current);return E.current?E.current(V):V},[r._formValues,r._names,l]),L=k.useCallback(Y=>{if(!c){const V=R2(l,r._names,Y||r._formValues,!1,b.current);if(E.current){const F=E.current(V);Zf(F,C.current)||(q(F),C.current=F)}else q(V)}},[r._formValues,r._names,c,l]);VM(()=>((S.current!==r||!Zf(R.current,l))&&(S.current=r,R.current=l,L()),r._subscribe({name:l,formState:{values:!0},exact:h,callback:Y=>{L(Y.values)}})),[r,h,l,L]),k.useEffect(()=>r._removeUnmounted());const P=S.current!==r,U=R.current,I=k.useMemo(()=>{if(c)return null;const Y=!P&&!Zf(U,l);return P||Y?N():null},[c,P,l,U,N]);return I!==null?I:M}function wae(e){const t=qw(),{name:r,disabled:l,control:s=t.control,shouldUnregister:c,defaultValue:h,exact:m=!0}=e,b=qL(s._names.array,r),E=k.useMemo(()=>dt(s._formValues,r,dt(s._defaultValues,r,h)),[s,r,h]),C=Cae({control:s,name:r,defaultValue:E,exact:m}),S=Sae({control:s,name:r,exact:m}),R=k.useRef(e),M=k.useRef(void 0),q=k.useRef(s.register(r,{...e.rules,value:C,...Es(e.disabled)?{disabled:e.disabled}:{}}));R.current=e;const N=k.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!dt(S.errors,r)},isDirty:{enumerable:!0,get:()=>!!dt(S.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!dt(S.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!dt(S.validatingFields,r)},error:{enumerable:!0,get:()=>dt(S.errors,r)}}),[S,r]),L=k.useCallback(Y=>q.current.onChange({target:{value:PL(Y),name:r},type:KT.CHANGE}),[r]),P=k.useCallback(()=>q.current.onBlur({target:{value:dt(s._formValues,r),name:r},type:KT.BLUR}),[r,s._formValues]),U=k.useCallback(Y=>{const V=dt(s._fields,r);V&&Y&&(V._f.ref={focus:()=>Y.focus&&Y.focus(),select:()=>Y.select&&Y.select(),setCustomValidity:F=>Y.setCustomValidity(F),reportValidity:()=>Y.reportValidity()})},[s._fields,r]),I=k.useMemo(()=>({name:r,value:C,...Es(l)||S.disabled?{disabled:S.disabled||l}:{},onChange:L,onBlur:P,ref:U}),[r,l,S.disabled,L,P,U,C]);return k.useEffect(()=>{const Y=s._options.shouldUnregister||c,V=M.current;V&&V!==r&&!b&&s.unregister(V),s.register(r,{...R.current.rules,...Es(R.current.disabled)?{disabled:R.current.disabled}:{}});const F=(K,Q)=>{const he=dt(s._fields,K);he&&he._f&&(he._f.mount=Q)};if(F(r,!0),Y){const K=Hl(dt(s._options.defaultValues,r,R.current.defaultValue));ir(s._defaultValues,r,K),Ta(dt(s._formValues,r))&&ir(s._formValues,r,K)}return!b&&s.register(r),M.current=r,()=>{(b?Y&&!s._state.action:Y)?s.unregister(r):F(r,!1)}},[r,s,b,c]),k.useEffect(()=>{s._setDisabledField({disabled:l,name:r})},[l,r,s]),k.useMemo(()=>({field:I,formState:S,fieldState:N}),[I,S,N])}const Rae=e=>e.render(wae(e));var FM=(e,t,r,l,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[l]:s||!0}}:{},lw=e=>Array.isArray(e)?e:[e],yP=()=>{let e=[];return{get observers(){return e},next:s=>{for(const c of e)c.next&&c.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(c=>c!==s)}}),unsubscribe:()=>{e=[]}}};function jL(e,t){const r={};for(const l in e)if(e.hasOwnProperty(l)){const s=e[l],c=t[l];if(s&&dl(s)&&c){const h=jL(s,c);dl(h)&&(r[l]=h)}else e[l]&&(r[l]=c)}return r}var tu=e=>dl(e)&&!Object.keys(e).length,KM=e=>e.type==="file",Wf=e=>typeof e=="function",GT=e=>{if(!kM)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},zL=e=>e.type==="select-multiple",GM=e=>e.type==="radio",Tae=e=>GM(e)||Pw(e),jD=e=>GT(e)&&e.isConnected;function _ae(e,t){const r=t.slice(0,-1).length;let l=0;for(;l<r;)e=Ta(e)?l++:e[t[l++]];return e}function Aae(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ta(e[t]))return!1;return!0}function cl(e,t){const r=Array.isArray(t)?t:__(t)?[t]:IM(t),l=r.length===1?e:_ae(e,r),s=r.length-1,c=r[s];return l&&delete l[c],s!==0&&(dl(l)&&tu(l)||Array.isArray(l)&&Aae(l))&&cl(e,r.slice(0,-1)),e}var Dae=e=>{for(const t in e)if(Wf(e[t]))return!0;return!1};function BL(e){return Array.isArray(e)||dl(e)&&!Dae(e)}function _2(e,t={}){for(const r in e){const l=e[r];BL(l)?(t[r]=Array.isArray(l)?[]:{},_2(l,t[r])):Ta(l)||(t[r]=!0)}return t}function L1(e,t,r){r||(r=_2(t));for(const l in e){const s=e[l];if(BL(s))Ta(t)||T2(r[l])?r[l]=_2(s,Array.isArray(s)?[]:{}):L1(s,Uu(t)?{}:t[l],r[l]);else{const c=t[l];r[l]=!Zf(s,c)}}return r}const bP={value:!1,isValid:!1},xP={value:!0,isValid:!0};var kL=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ta(e[0].attributes.value)?Ta(e[0].value)||e[0].value===""?xP:{value:e[0].value,isValid:!0}:xP:bP}return bP},UL=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:l})=>Ta(e)?e:t?e===""?NaN:e&&+e:r&&Cs(e)?new Date(e):l?l(e):e;const EP={isValid:!1,value:null};var IL=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,EP):EP;function SP(e){const t=e.ref;return KM(t)?t.files:GM(t)?IL(e.refs).value:zL(t)?[...t.selectedOptions].map(({value:r})=>r):Pw(t)?kL(e.refs).value:UL(Ta(t.value)?e.ref.value:t.value,e)}var Mae=(e,t,r,l)=>{const s={};for(const c of e){const h=dt(t,c);h&&ir(s,c,h._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:l}},YT=e=>e instanceof RegExp,QC=e=>Ta(e)?e:YT(e)?e.source:dl(e)?YT(e.value)?e.value.source:e.value:e,CP=e=>({isOnSubmit:!e||e===Qf.onSubmit,isOnBlur:e===Qf.onBlur,isOnChange:e===Qf.onChange,isOnAll:e===Qf.all,isOnTouch:e===Qf.onTouched});const wP="AsyncFunction";var Oae=e=>!!e&&!!e.validate&&!!(Wf(e.validate)&&e.validate.constructor.name===wP||dl(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===wP)),Nae=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),RP=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(l=>e.startsWith(l)&&/^\.\w+/.test(e.slice(l.length))));const ow=(e,t,r,l)=>{for(const s of r||Object.keys(e)){const c=dt(e,s);if(c){const{_f:h,...m}=c;if(h){if(h.refs&&h.refs[0]&&t(h.refs[0],s)&&!l)return!0;if(h.ref&&t(h.ref,h.name)&&!l)return!0;if(ow(m,t))break}else if(dl(m)&&ow(m,t))break}}};function TP(e,t,r){const l=dt(e,r);if(l||__(r))return{error:l,name:r};const s=r.split(".");for(;s.length;){const c=s.join("."),h=dt(t,c),m=dt(e,c);if(h&&!Array.isArray(h)&&r!==c)return{name:r};if(m&&m.type)return{name:c,error:m};if(m&&m.root&&m.root.type)return{name:`${c}.root`,error:m.root};s.pop()}return{name:r}}var $ae=(e,t,r,l)=>{r(e);const{name:s,...c}=e;return tu(c)||Object.keys(c).length>=Object.keys(t).length||Object.keys(c).find(h=>t[h]===(!l||Qf.all))},Pae=(e,t,r)=>!e||!t||e===t||lw(e).some(l=>l&&(r?l===t:l.startsWith(t)||t.startsWith(l))),qae=(e,t,r,l,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?l.isOnBlur:s.isOnBlur)?!e:(r?l.isOnChange:s.isOnChange)?e:!0,Lae=(e,t)=>!UM(dt(e,t)).length&&cl(e,t),jae=(e,t,r)=>{const l=lw(dt(e,r));return ir(l,"root",t[r]),ir(e,r,l),e};function _P(e,t,r="validate"){if(Cs(e)||Array.isArray(e)&&e.every(Cs)||Es(e)&&!e)return{type:r,message:Cs(e)?e:"",ref:t}}var M1=e=>dl(e)&&!YT(e)?e:{value:e,message:""},AP=async(e,t,r,l,s,c)=>{const{ref:h,refs:m,required:b,maxLength:E,minLength:C,min:S,max:R,pattern:M,validate:q,name:N,valueAsNumber:L,mount:P}=e._f,U=dt(r,N);if(!P||t.has(N))return{};const I=m?m[0]:h,Y=se=>{s&&I.reportValidity&&(I.setCustomValidity(Es(se)?"":se||""),I.reportValidity())},V={},F=GM(h),K=Pw(h),Q=F||K,he=(L||KM(h))&&Ta(h.value)&&Ta(U)||GT(h)&&h.value===""||U===""||Array.isArray(U)&&!U.length,de=FM.bind(null,N,l,V),W=(se,le,ae,xe=Sm.maxLength,B=Sm.minLength)=>{const Z=se?le:ae;V[N]={type:se?xe:B,message:Z,ref:h,...de(se?xe:B,Z)}};if(c?!Array.isArray(U)||!U.length:b&&(!Q&&(he||Uu(U))||Es(U)&&!U||K&&!kL(m).isValid||F&&!IL(m).isValid)){const{value:se,message:le}=Cs(b)?{value:!!b,message:b}:M1(b);if(se&&(V[N]={type:Sm.required,message:le,ref:I,...de(Sm.required,le)},!l))return Y(le),V}if(!he&&(!Uu(S)||!Uu(R))){let se,le;const ae=M1(R),xe=M1(S);if(!Uu(U)&&!isNaN(U)){const B=h.valueAsNumber||U&&+U;Uu(ae.value)||(se=B>ae.value),Uu(xe.value)||(le=B<xe.value)}else{const B=h.valueAsDate||new Date(U),Z=re=>new Date(new Date().toDateString()+" "+re),te=h.type=="time",be=h.type=="week";Cs(ae.value)&&U&&(se=te?Z(U)>Z(ae.value):be?U>ae.value:B>new Date(ae.value)),Cs(xe.value)&&U&&(le=te?Z(U)<Z(xe.value):be?U<xe.value:B<new Date(xe.value))}if((se||le)&&(W(!!se,ae.message,xe.message,Sm.max,Sm.min),!l))return Y(V[N].message),V}if((E||C)&&!he&&(Cs(U)||c&&Array.isArray(U))){const se=M1(E),le=M1(C),ae=!Uu(se.value)&&U.length>+se.value,xe=!Uu(le.value)&&U.length<+le.value;if((ae||xe)&&(W(ae,se.message,le.message),!l))return Y(V[N].message),V}if(M&&!he&&Cs(U)){const{value:se,message:le}=M1(M);if(YT(se)&&!U.match(se)&&(V[N]={type:Sm.pattern,message:le,ref:h,...de(Sm.pattern,le)},!l))return Y(le),V}if(q){if(Wf(q)){const se=await q(U,r),le=_P(se,I);if(le&&(V[N]={...le,...de(Sm.validate,le.message)},!l))return Y(le.message),V}else if(dl(q)){let se={};for(const le in q){if(!tu(se)&&!l)break;const ae=_P(await q[le](U,r),I,le);ae&&(se={...ae,...de(le,ae.message)},Y(ae.message),l&&(V[N]=se))}if(!tu(se)&&(V[N]={ref:I,...se},!l))return V}}return Y(!0),V};const zae={mode:Qf.onSubmit,reValidateMode:Qf.onChange,shouldFocusError:!0};function Bae(e={}){let t={...zae,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Wf(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},l={},s=dl(t.defaultValues)||dl(t.values)?Hl(t.defaultValues||t.values)||{}:{},c=t.shouldUnregister?{}:Hl(s),h={action:!1,mount:!1,watch:!1},m={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},b,E=0;const C={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let S={...C};const R={array:yP(),state:yP()},M=t.criteriaMode===Qf.all,q=pe=>$e=>{clearTimeout(E),E=setTimeout(pe,$e)},N=async pe=>{if(!t.disabled&&(C.isValid||S.isValid||pe)){const $e=t.resolver?tu((await K()).errors):await he(l,!0);$e!==r.isValid&&R.state.next({isValid:$e})}},L=(pe,$e)=>{!t.disabled&&(C.isValidating||C.validatingFields||S.isValidating||S.validatingFields)&&((pe||Array.from(m.mount)).forEach(Ve=>{Ve&&($e?ir(r.validatingFields,Ve,$e):cl(r.validatingFields,Ve))}),R.state.next({validatingFields:r.validatingFields,isValidating:!tu(r.validatingFields)}))},P=(pe,$e=[],Ve,st,rt=!0,at=!0)=>{if(st&&Ve&&!t.disabled){if(h.action=!0,at&&Array.isArray(dt(l,pe))){const bt=Ve(dt(l,pe),st.argA,st.argB);rt&&ir(l,pe,bt)}if(at&&Array.isArray(dt(r.errors,pe))){const bt=Ve(dt(r.errors,pe),st.argA,st.argB);rt&&ir(r.errors,pe,bt),Lae(r.errors,pe)}if((C.touchedFields||S.touchedFields)&&at&&Array.isArray(dt(r.touchedFields,pe))){const bt=Ve(dt(r.touchedFields,pe),st.argA,st.argB);rt&&ir(r.touchedFields,pe,bt)}(C.dirtyFields||S.dirtyFields)&&(r.dirtyFields=L1(s,c)),R.state.next({name:pe,isDirty:W(pe,$e),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ir(c,pe,$e)},U=(pe,$e)=>{ir(r.errors,pe,$e),R.state.next({errors:r.errors})},I=pe=>{r.errors=pe,R.state.next({errors:r.errors,isValid:!1})},Y=(pe,$e,Ve,st)=>{const rt=dt(l,pe);if(rt){const at=dt(c,pe,Ta(Ve)?dt(s,pe):Ve);Ta(at)||st&&st.defaultChecked||$e?ir(c,pe,$e?at:SP(rt._f)):ae(pe,at),h.mount&&!h.action&&N()}},V=(pe,$e,Ve,st,rt)=>{let at=!1,bt=!1;const Wt={name:pe};if(!t.disabled){if(!Ve||st){(C.isDirty||S.isDirty)&&(bt=r.isDirty,r.isDirty=Wt.isDirty=W(),at=bt!==Wt.isDirty);const Yt=Zf(dt(s,pe),$e);bt=!!dt(r.dirtyFields,pe),Yt?cl(r.dirtyFields,pe):ir(r.dirtyFields,pe,!0),Wt.dirtyFields=r.dirtyFields,at=at||(C.dirtyFields||S.dirtyFields)&&bt!==!Yt}if(Ve){const Yt=dt(r.touchedFields,pe);Yt||(ir(r.touchedFields,pe,Ve),Wt.touchedFields=r.touchedFields,at=at||(C.touchedFields||S.touchedFields)&&Yt!==Ve)}at&&rt&&R.state.next(Wt)}return at?Wt:{}},F=(pe,$e,Ve,st)=>{const rt=dt(r.errors,pe),at=(C.isValid||S.isValid)&&Es($e)&&r.isValid!==$e;if(t.delayError&&Ve?(b=q(()=>U(pe,Ve)),b(t.delayError)):(clearTimeout(E),b=null,Ve?ir(r.errors,pe,Ve):cl(r.errors,pe)),(Ve?!Zf(rt,Ve):rt)||!tu(st)||at){const bt={...st,...at&&Es($e)?{isValid:$e}:{},errors:r.errors,name:pe};r={...r,...bt},R.state.next(bt)}},K=async pe=>{L(pe,!0);const $e=await t.resolver(c,t.context,Mae(pe||m.mount,l,t.criteriaMode,t.shouldUseNativeValidation));return L(pe),$e},Q=async pe=>{const{errors:$e}=await K(pe);if(pe)for(const Ve of pe){const st=dt($e,Ve);st?ir(r.errors,Ve,st):cl(r.errors,Ve)}else r.errors=$e;return $e},he=async(pe,$e,Ve={valid:!0})=>{for(const st in pe){const rt=pe[st];if(rt){const{_f:at,...bt}=rt;if(at){const Wt=m.array.has(at.name),Yt=rt._f&&Oae(rt._f);Yt&&C.validatingFields&&L([at.name],!0);const ya=await AP(rt,m.disabled,c,M,t.shouldUseNativeValidation&&!$e,Wt);if(Yt&&C.validatingFields&&L([at.name]),ya[at.name]&&(Ve.valid=!1,$e))break;!$e&&(dt(ya,at.name)?Wt?jae(r.errors,ya,at.name):ir(r.errors,at.name,ya[at.name]):cl(r.errors,at.name))}!tu(bt)&&await he(bt,$e,Ve)}}return Ve.valid},de=()=>{for(const pe of m.unMount){const $e=dt(l,pe);$e&&($e._f.refs?$e._f.refs.every(Ve=>!jD(Ve)):!jD($e._f.ref))&&_e(pe)}m.unMount=new Set},W=(pe,$e)=>!t.disabled&&(pe&&$e&&ir(c,pe,$e),!Zf(re(),s)),se=(pe,$e,Ve)=>R2(pe,m,{...h.mount?c:Ta($e)?s:Cs(pe)?{[pe]:$e}:$e},Ve,$e),le=pe=>UM(dt(h.mount?c:s,pe,t.shouldUnregister?dt(s,pe,[]):[])),ae=(pe,$e,Ve={})=>{const st=dt(l,pe);let rt=$e;if(st){const at=st._f;at&&(!at.disabled&&ir(c,pe,UL($e,at)),rt=GT(at.ref)&&Uu($e)?"":$e,zL(at.ref)?[...at.ref.options].forEach(bt=>bt.selected=rt.includes(bt.value)):at.refs?Pw(at.ref)?at.refs.forEach(bt=>{(!bt.defaultChecked||!bt.disabled)&&(Array.isArray(rt)?bt.checked=!!rt.find(Wt=>Wt===bt.value):bt.checked=rt===bt.value||!!rt)}):at.refs.forEach(bt=>bt.checked=bt.value===rt):KM(at.ref)?at.ref.value="":(at.ref.value=rt,at.ref.type||R.state.next({name:pe,values:Hl(c)})))}(Ve.shouldDirty||Ve.shouldTouch)&&V(pe,rt,Ve.shouldTouch,Ve.shouldDirty,!0),Ve.shouldValidate&&be(pe)},xe=(pe,$e,Ve)=>{for(const st in $e){if(!$e.hasOwnProperty(st))return;const rt=$e[st],at=pe+"."+st,bt=dt(l,at);(m.array.has(pe)||dl(rt)||bt&&!bt._f)&&!Gb(rt)?xe(at,rt,Ve):ae(at,rt,Ve)}},B=(pe,$e,Ve={})=>{const st=dt(l,pe),rt=m.array.has(pe),at=Hl($e);ir(c,pe,at),rt?(R.array.next({name:pe,values:Hl(c)}),(C.isDirty||C.dirtyFields||S.isDirty||S.dirtyFields)&&Ve.shouldDirty&&R.state.next({name:pe,dirtyFields:L1(s,c),isDirty:W(pe,at)})):st&&!st._f&&!Uu(at)?xe(pe,at,Ve):ae(pe,at,Ve),RP(pe,m)&&R.state.next({...r,name:pe}),R.state.next({name:h.mount?pe:void 0,values:Hl(c)})},Z=async pe=>{h.mount=!0;const $e=pe.target;let Ve=$e.name,st=!0;const rt=dt(l,Ve),at=Yt=>{st=Number.isNaN(Yt)||Gb(Yt)&&isNaN(Yt.getTime())||Zf(Yt,dt(c,Ve,Yt))},bt=CP(t.mode),Wt=CP(t.reValidateMode);if(rt){let Yt,ya;const Qo=$e.type?SP(rt._f):PL(pe),pl=pe.type===KT.BLUR||pe.type===KT.FOCUS_OUT,Ms=!Nae(rt._f)&&!t.resolver&&!dt(r.errors,Ve)&&!rt._f.deps||qae(pl,dt(r.touchedFields,Ve),r.isSubmitted,Wt,bt),hl=RP(Ve,m,pl);ir(c,Ve,Qo),pl?(!$e||!$e.readOnly)&&(rt._f.onBlur&&rt._f.onBlur(pe),b&&b(0)):rt._f.onChange&&rt._f.onChange(pe);const Mr=V(Ve,Qo,pl),ml=!tu(Mr)||hl;if(!pl&&R.state.next({name:Ve,type:pe.type,values:Hl(c)}),Ms)return(C.isValid||S.isValid)&&(t.mode==="onBlur"?pl&&N():pl||N()),ml&&R.state.next({name:Ve,...hl?{}:Mr});if(!pl&&hl&&R.state.next({...r}),t.resolver){const{errors:Or}=await K([Ve]);if(at(Qo),st){const Os=TP(r.errors,l,Ve),kc=TP(Or,l,Os.name||Ve);Yt=kc.error,Ve=kc.name,ya=tu(Or)}}else L([Ve],!0),Yt=(await AP(rt,m.disabled,c,M,t.shouldUseNativeValidation))[Ve],L([Ve]),at(Qo),st&&(Yt?ya=!1:(C.isValid||S.isValid)&&(ya=await he(l,!0)));st&&(rt._f.deps&&(!Array.isArray(rt._f.deps)||rt._f.deps.length>0)&&be(rt._f.deps),F(Ve,ya,Yt,Mr))}},te=(pe,$e)=>{if(dt(r.errors,$e)&&pe.focus)return pe.focus(),1},be=async(pe,$e={})=>{let Ve,st;const rt=lw(pe);if(t.resolver){const at=await Q(Ta(pe)?pe:rt);Ve=tu(at),st=pe?!rt.some(bt=>dt(at,bt)):Ve}else pe?(st=(await Promise.all(rt.map(async at=>{const bt=dt(l,at);return await he(bt&&bt._f?{[at]:bt}:bt)}))).every(Boolean),!(!st&&!r.isValid)&&N()):st=Ve=await he(l);return R.state.next({...!Cs(pe)||(C.isValid||S.isValid)&&Ve!==r.isValid?{}:{name:pe},...t.resolver||!pe?{isValid:Ve}:{},errors:r.errors}),$e.shouldFocus&&!st&&ow(l,te,pe?rt:m.mount),st},re=(pe,$e)=>{let Ve={...h.mount?c:s};return $e&&(Ve=jL($e.dirtyFields?r.dirtyFields:r.touchedFields,Ve)),Ta(pe)?Ve:Cs(pe)?dt(Ve,pe):pe.map(st=>dt(Ve,st))},oe=(pe,$e)=>({invalid:!!dt(($e||r).errors,pe),isDirty:!!dt(($e||r).dirtyFields,pe),error:dt(($e||r).errors,pe),isValidating:!!dt(r.validatingFields,pe),isTouched:!!dt(($e||r).touchedFields,pe)}),ue=pe=>{pe&&lw(pe).forEach($e=>cl(r.errors,$e)),R.state.next({errors:pe?r.errors:{}})},ce=(pe,$e,Ve)=>{const st=(dt(l,pe,{_f:{}})._f||{}).ref,rt=dt(r.errors,pe)||{},{ref:at,message:bt,type:Wt,...Yt}=rt;ir(r.errors,pe,{...Yt,...$e,ref:st}),R.state.next({name:pe,errors:r.errors,isValid:!1}),Ve&&Ve.shouldFocus&&st&&st.focus&&st.focus()},De=(pe,$e)=>Wf(pe)?R.state.subscribe({next:Ve=>"values"in Ve&&pe(se(void 0,$e),Ve)}):se(pe,$e,!0),je=pe=>R.state.subscribe({next:$e=>{Pae(pe.name,$e.name,pe.exact)&&$ae($e,pe.formState||C,Kn,pe.reRenderRoot)&&pe.callback({values:{...c},...r,...$e,defaultValues:s})}}).unsubscribe,Ke=pe=>(h.mount=!0,S={...S,...pe.formState},je({...pe,formState:S})),_e=(pe,$e={})=>{for(const Ve of pe?lw(pe):m.mount)m.mount.delete(Ve),m.array.delete(Ve),$e.keepValue||(cl(l,Ve),cl(c,Ve)),!$e.keepError&&cl(r.errors,Ve),!$e.keepDirty&&cl(r.dirtyFields,Ve),!$e.keepTouched&&cl(r.touchedFields,Ve),!$e.keepIsValidating&&cl(r.validatingFields,Ve),!t.shouldUnregister&&!$e.keepDefaultValue&&cl(s,Ve);R.state.next({values:Hl(c)}),R.state.next({...r,...$e.keepDirty?{isDirty:W()}:{}}),!$e.keepIsValid&&N()},Je=({disabled:pe,name:$e})=>{(Es(pe)&&h.mount||pe||m.disabled.has($e))&&(pe?m.disabled.add($e):m.disabled.delete($e))},ie=(pe,$e={})=>{let Ve=dt(l,pe);const st=Es($e.disabled)||Es(t.disabled);return ir(l,pe,{...Ve||{},_f:{...Ve&&Ve._f?Ve._f:{ref:{name:pe}},name:pe,mount:!0,...$e}}),m.mount.add(pe),Ve?Je({disabled:Es($e.disabled)?$e.disabled:t.disabled,name:pe}):Y(pe,!0,$e.value),{...st?{disabled:$e.disabled||t.disabled}:{},...t.progressive?{required:!!$e.required,min:QC($e.min),max:QC($e.max),minLength:QC($e.minLength),maxLength:QC($e.maxLength),pattern:QC($e.pattern)}:{},name:pe,onChange:Z,onBlur:Z,ref:rt=>{if(rt){ie(pe,$e),Ve=dt(l,pe);const at=Ta(rt.value)&&rt.querySelectorAll&&rt.querySelectorAll("input,select,textarea")[0]||rt,bt=Tae(at),Wt=Ve._f.refs||[];if(bt?Wt.find(Yt=>Yt===at):at===Ve._f.ref)return;ir(l,pe,{_f:{...Ve._f,...bt?{refs:[...Wt.filter(jD),at,...Array.isArray(dt(s,pe))?[{}]:[]],ref:{type:at.type,name:pe}}:{ref:at}}}),Y(pe,!1,void 0,at)}else Ve=dt(l,pe,{}),Ve._f&&(Ve._f.mount=!1),(t.shouldUnregister||$e.shouldUnregister)&&!(qL(m.array,pe)&&h.action)&&m.unMount.add(pe)}}},ke=()=>t.shouldFocusError&&ow(l,te,m.mount),Ee=pe=>{Es(pe)&&(R.state.next({disabled:pe}),ow(l,($e,Ve)=>{const st=dt(l,Ve);st&&($e.disabled=st._f.disabled||pe,Array.isArray(st._f.refs)&&st._f.refs.forEach(rt=>{rt.disabled=st._f.disabled||pe}))},0,!1))},Ae=(pe,$e)=>async Ve=>{let st;Ve&&(Ve.preventDefault&&Ve.preventDefault(),Ve.persist&&Ve.persist());let rt=Hl(c);if(R.state.next({isSubmitting:!0}),t.resolver){const{errors:at,values:bt}=await K();r.errors=at,rt=Hl(bt)}else await he(l);if(m.disabled.size)for(const at of m.disabled)cl(rt,at);if(cl(r.errors,"root"),tu(r.errors)){R.state.next({errors:{}});try{await pe(rt,Ve)}catch(at){st=at}}else $e&&await $e({...r.errors},Ve),ke(),setTimeout(ke);if(R.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:tu(r.errors)&&!st,submitCount:r.submitCount+1,errors:r.errors}),st)throw st},ot=(pe,$e={})=>{dt(l,pe)&&(Ta($e.defaultValue)?B(pe,Hl(dt(s,pe))):(B(pe,$e.defaultValue),ir(s,pe,Hl($e.defaultValue))),$e.keepTouched||cl(r.touchedFields,pe),$e.keepDirty||(cl(r.dirtyFields,pe),r.isDirty=$e.defaultValue?W(pe,Hl(dt(s,pe))):W()),$e.keepError||(cl(r.errors,pe),C.isValid&&N()),R.state.next({...r}))},vt=(pe,$e={})=>{const Ve=pe?Hl(pe):s,st=Hl(Ve),rt=tu(pe),at=rt?s:st;if($e.keepDefaultValues||(s=Ve),!$e.keepValues){if($e.keepDirtyValues){const bt=new Set([...m.mount,...Object.keys(L1(s,c))]);for(const Wt of Array.from(bt))dt(r.dirtyFields,Wt)?ir(at,Wt,dt(c,Wt)):B(Wt,dt(at,Wt))}else{if(kM&&Ta(pe))for(const bt of m.mount){const Wt=dt(l,bt);if(Wt&&Wt._f){const Yt=Array.isArray(Wt._f.refs)?Wt._f.refs[0]:Wt._f.ref;if(GT(Yt)){const ya=Yt.closest("form");if(ya){ya.reset();break}}}}if($e.keepFieldsRef)for(const bt of m.mount)B(bt,dt(at,bt));else l={}}c=t.shouldUnregister?$e.keepDefaultValues?Hl(s):{}:Hl(at),R.array.next({values:{...at}}),R.state.next({values:{...at}})}m={mount:$e.keepDirtyValues?m.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},h.mount=!C.isValid||!!$e.keepIsValid||!!$e.keepDirtyValues||!t.shouldUnregister&&!tu(at),h.watch=!!t.shouldUnregister,h.action=!1,$e.keepErrors||(r.errors={}),R.state.next({submitCount:$e.keepSubmitCount?r.submitCount:0,isDirty:rt?!1:$e.keepDirty?r.isDirty:!!($e.keepDefaultValues&&!Zf(pe,s)),isSubmitted:$e.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:rt?{}:$e.keepDirtyValues?$e.keepDefaultValues&&c?L1(s,c):r.dirtyFields:$e.keepDefaultValues&&pe?L1(s,pe):$e.keepDirty?r.dirtyFields:{},touchedFields:$e.keepTouched?r.touchedFields:{},errors:$e.keepErrors?r.errors:{},isSubmitSuccessful:$e.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Xt=(pe,$e)=>vt(Wf(pe)?pe(c):pe,$e),Nt=(pe,$e={})=>{const Ve=dt(l,pe),st=Ve&&Ve._f;if(st){const rt=st.refs?st.refs[0]:st.ref;rt.focus&&(rt.focus(),$e.shouldSelect&&Wf(rt.select)&&rt.select())}},Kn=pe=>{r={...r,...pe}},Ds={control:{register:ie,unregister:_e,getFieldState:oe,handleSubmit:Ae,setError:ce,_subscribe:je,_runSchema:K,_focusError:ke,_getWatch:se,_getDirty:W,_setValid:N,_setFieldArray:P,_setDisabledField:Je,_setErrors:I,_getFieldArray:le,_reset:vt,_resetDefaultValues:()=>Wf(t.defaultValues)&&t.defaultValues().then(pe=>{Xt(pe,t.resetOptions),R.state.next({isLoading:!1})}),_removeUnmounted:de,_disableForm:Ee,_subjects:R,_proxyFormState:C,get _fields(){return l},get _formValues(){return c},get _state(){return h},set _state(pe){h=pe},get _defaultValues(){return s},get _names(){return m},set _names(pe){m=pe},get _formState(){return r},get _options(){return t},set _options(pe){t={...t,...pe}}},subscribe:Ke,trigger:be,register:ie,handleSubmit:Ae,watch:De,setValue:B,getValues:re,reset:Xt,resetField:ot,clearErrors:ue,unregister:_e,setError:ce,setFocus:Nt,getFieldState:oe};return{...Ds,formControl:Ds}}function kae(e={}){const t=k.useRef(void 0),r=k.useRef(void 0),[l,s]=k.useState({isDirty:!1,isValidating:!1,isLoading:Wf(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Wf(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:l},e.defaultValues&&!Wf(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:h,...m}=Bae(e);t.current={...m,formState:l}}const c=t.current.control;return c._options=e,VM(()=>{const h=c._subscribe({formState:c._proxyFormState,callback:()=>s({...c._formState}),reRenderRoot:!0});return s(m=>({...m,isReady:!0})),c._formState.isReady=!0,h},[c]),k.useEffect(()=>c._disableForm(e.disabled),[c,e.disabled]),k.useEffect(()=>{e.mode&&(c._options.mode=e.mode),e.reValidateMode&&(c._options.reValidateMode=e.reValidateMode)},[c,e.mode,e.reValidateMode]),k.useEffect(()=>{e.errors&&(c._setErrors(e.errors),c._focusError())},[c,e.errors]),k.useEffect(()=>{e.shouldUnregister&&c._subjects.state.next({values:c._getWatch()})},[c,e.shouldUnregister]),k.useEffect(()=>{if(c._proxyFormState.isDirty){const h=c._getDirty();h!==l.isDirty&&c._subjects.state.next({isDirty:h})}},[c,l.isDirty]),k.useEffect(()=>{var h;e.values&&!Zf(e.values,r.current)?(c._reset(e.values,{keepFieldsRef:!0,...c._options.resetOptions}),!((h=c._options.resetOptions)===null||h===void 0)&&h.keepIsValid||c._setValid(),r.current=e.values,s(m=>({...m}))):c._resetDefaultValues()},[c,e.values]),k.useEffect(()=>{c._state.mount||(c._setValid(),c._state.mount=!0),c._state.watch&&(c._state.watch=!1,c._subjects.state.next({...c._formState})),c._removeUnmounted()}),t.current.formState=LL(l,c),t.current}const[Uae,Iae]=Mw(),[Hae,Vae]=Mw(),Lw=()=>{const e=Hae(),t=Uae(),{getFieldState:r,formState:l}=qw();if(!e)throw new Error("useFormField should be used within <FormField>");const s=r(e.name,l),{id:c}=t;return{id:c,name:e.name,formItemId:`${c}-form-item`,formDescriptionId:`${c}-form-item-description`,formMessageId:`${c}-form-item-message`,...s}},Fae=({onSubmit:e,id:t,form:r,children:l,className:s})=>O.jsx(Eae,{...r,children:O.jsx("form",{id:t,onSubmit:r.handleSubmit(e),className:s,"data-slot":"form",children:l})}),Kae=({name:e,label:t,description:r,className:l,render:s,itemProps:c,labelProps:h,controlProps:m,descriptionProps:b,messageProps:E})=>{const{control:C}=qw();return O.jsx(Vae,{value:{name:e},children:O.jsx(Rae,{name:e,control:C,render:({field:S,fieldState:R})=>O.jsxs(HL,{className:l,...c,children:[t&&O.jsx(VL,{...h,children:t}),O.jsx(FL,{...m,children:sr.isFunction(s)?s(S):D.createElement(s,S)}),r&&O.jsx(KL,{...b,children:r}),O.jsx(GL,{...E,children:R.error?.message})]})})})},HL=({className:e,...t})=>{const r=D.useId();return O.jsx(Iae,{value:{id:r},children:O.jsx("div",{className:Fe("flex flex-col gap-2",e),"data-slot":"form-item",...t})})},VL=({className:e,...t})=>{const{error:r,formItemId:l}=Lw();return O.jsx($w,{className:Fe(r&&"text-error",e),htmlFor:l,...t})},FL=({className:e,...t})=>{const{error:r,formItemId:l,formDescriptionId:s,formMessageId:c}=Lw();return O.jsx(_w,{id:l,"aria-describedby":r?`${s} ${c}`:`${s}`,"aria-invalid":!!r,className:Fe("group",e),...t})},KL=({className:e,...t})=>{const{formDescriptionId:r}=Lw();return O.jsx("p",{id:r,className:Fe("text-sm text-muted-foreground",e),"data-slot":"form-description",...t})},GL=({className:e,children:t,...r})=>{const{error:l,formMessageId:s}=Lw(),c=l?String(l?.message):t;return c?O.jsx("p",{id:s,className:Fe("text-sm font-medium text-error",e),"data-slot":"form-message",...r,children:c}):null},DP=(e,t,r)=>{if(e&&"reportValidity"in e){const l=dt(r,t);e.setCustomValidity(l&&l.message||""),e.reportValidity()}},A2=(e,t)=>{for(const r in t.fields){const l=t.fields[r];l&&l.ref&&"reportValidity"in l.ref?DP(l.ref,r,e):l&&l.refs&&l.refs.forEach(s=>DP(s,r,e))}},MP=(e,t)=>{t.shouldUseNativeValidation&&A2(e,t);const r={};for(const l in e){const s=dt(t.fields,l),c=Object.assign(e[l]||{},{ref:s&&s.ref});if(Gae(t.names||Object.keys(e),l)){const h=Object.assign({},dt(r,l));ir(h,"root",c),ir(r,l,h)}else ir(r,l,c)}return r},Gae=(e,t)=>{const r=OP(t);return e.some(l=>OP(l).match(`^${r}\\.\\d+`))};function OP(e){return e.replace(/\]|\[/g,"")}function YL(e,t,r){function l(m,b){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:b,constr:h,traits:new Set},enumerable:!1}),m._zod.traits.has(e))return;m._zod.traits.add(e),t(m,b);const E=h.prototype,C=Object.keys(E);for(let S=0;S<C.length;S++){const R=C[S];R in m||(m[R]=E[R].bind(m))}}const s=r?.Parent??Object;class c extends s{}Object.defineProperty(c,"name",{value:e});function h(m){var b;const E=r?.Parent?new c:this;l(E,m),(b=E._zod).deferred??(b.deferred=[]);for(const C of E._zod.deferred)C();return E}return Object.defineProperty(h,"init",{value:l}),Object.defineProperty(h,Symbol.hasInstance,{value:m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(h,"name",{value:e}),h}class Yae extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Xae={};function XL(e){return Xae}function Qae(e,t){return typeof t=="bigint"?t.toString():t}const QL="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function mT(e){return typeof e=="string"?e:e?.message}function ZL(e,t,r){const l={...e,path:e.path??[]};if(!e.message){const s=mT(e.inst?._zod.def?.error?.(e))??mT(t?.error?.(e))??mT(r.customError?.(e))??mT(r.localeError?.(e))??"Invalid input";l.message=s}return delete l.inst,delete l.continue,t?.reportInput||delete l.input,l}const WL=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Qae,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Zae=YL("$ZodError",WL),JL=YL("$ZodError",WL,{Parent:Error}),Wae=e=>(t,r,l,s)=>{const c=l?Object.assign(l,{async:!1}):{async:!1},h=t._zod.run({value:r,issues:[]},c);if(h instanceof Promise)throw new Yae;if(h.issues.length){const m=new(s?.Err??e)(h.issues.map(b=>ZL(b,c,XL())));throw QL(m,s?.callee),m}return h.value},Jae=Wae(JL),ele=e=>async(t,r,l,s)=>{const c=l?Object.assign(l,{async:!0}):{async:!0};let h=t._zod.run({value:r,issues:[]},c);if(h instanceof Promise&&(h=await h),h.issues.length){const m=new(s?.Err??e)(h.issues.map(b=>ZL(b,c,XL())));throw QL(m,s?.callee),m}return h.value},tle=ele(JL);function NP(e,t){try{var r=e()}catch(l){return t(l)}return r&&r.then?r.then(void 0,t):r}function nle(e,t){for(var r={};e.length;){var l=e[0],s=l.code,c=l.message,h=l.path.join(".");if(!r[h])if("unionErrors"in l){var m=l.unionErrors[0].errors[0];r[h]={message:m.message,type:m.code}}else r[h]={message:c,type:s};if("unionErrors"in l&&l.unionErrors.forEach(function(C){return C.errors.forEach(function(S){return e.push(S)})}),t){var b=r[h].types,E=b&&b[l.code];r[h]=FM(h,t,r,s,E?[].concat(E,l.message):l.message)}e.shift()}return r}function rle(e,t){for(var r={};e.length;){var l=e[0],s=l.code,c=l.message,h=l.path.join(".");if(!r[h])if(l.code==="invalid_union"&&l.errors.length>0){var m=l.errors[0][0];r[h]={message:m.message,type:m.code}}else r[h]={message:c,type:s};if(l.code==="invalid_union"&&l.errors.forEach(function(C){return C.forEach(function(S){return e.push(S)})}),t){var b=r[h].types,E=b&&b[l.code];r[h]=FM(h,t,r,s,E?[].concat(E,l.message):l.message)}e.shift()}return r}function ale(e,t,r){if(r===void 0&&(r={}),(function(l){return"_def"in l&&typeof l._def=="object"&&"typeName"in l._def})(e))return function(l,s,c){try{return Promise.resolve(NP(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](l,t)).then(function(h){return c.shouldUseNativeValidation&&A2({},c),{errors:{},values:r.raw?Object.assign({},l):h}})},function(h){if((function(m){return Array.isArray(m?.issues)})(h))return{values:{},errors:MP(nle(h.errors,!c.shouldUseNativeValidation&&c.criteriaMode==="all"),c)};throw h}))}catch(h){return Promise.reject(h)}};if((function(l){return"_zod"in l&&typeof l._zod=="object"})(e))return function(l,s,c){try{return Promise.resolve(NP(function(){return Promise.resolve((r.mode==="sync"?Jae:tle)(e,l,t)).then(function(h){return c.shouldUseNativeValidation&&A2({},c),{errors:{},values:r.raw?Object.assign({},l):h}})},function(h){if((function(m){return m instanceof Zae})(h))return{values:{},errors:MP(rle(h.issues,!c.shouldUseNativeValidation&&c.criteriaMode==="all"),c)};throw h}))}catch(h){return Promise.reject(h)}};throw new Error("Invalid input: not a Zod schema")}function lle(e,t){return kae({...t,resolver:ale(e)})}const ej=({value:e,onChange:t,defaultValue:r="",...l})=>{const s=Tw("Input",l),[c="",h]=br({prop:e,onChange:t,defaultProp:r}),m=b=>{h(b.target.value)};return O.jsx("input",{"data-slot":"input",autoComplete:"off",...s,value:c,onChange:m,className:Fe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","file:border-0 file:bg-transparent file:text-sm file:font-medium",s.className)})},ole=$m(["inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-medium text-muted-foreground"],{variants:{variant:{default:"border-transparent bg-secondary text-secondary-foreground",secondary:"border-transparent bg-primary text-primary-foreground",error:"border-transparent bg-error text-error-foreground",outline:"text-foreground"},size:{default:"px-1.5 py-0.5 text-xs",sm:"px-2 py-0.5 text-sm",lg:"px-4 py-1 text-lg"}},defaultVariants:{variant:"default",size:"default"}}),ile=({variant:e,size:t,className:r,...l})=>O.jsx("kbd",{className:Fe(ole({variant:e,size:t}),r),...l,"data-slot":"kbd"}),ule=({className:e,...t})=>O.jsx("kbd",{"data-slot":"kbd-group",className:Fe("inline-flex items-center gap-1",e),...t}),sle=$m("animate-spin",{variants:{variant:{primary:"text-primary",secondary:"text-secondary",ghost:"text-muted-foreground",error:"text-error",success:"text-success"},size:{sm:"w-4 h-4",default:"w-7 h-7",lg:"w-10 h-10"}},defaultVariants:{variant:"primary",size:"default"}}),cle=({center:e,containerClassName:t,variant:r,size:l,...s})=>O.jsx("div",{className:Fe(t,e&&"fixed inset-0 grid place-items-center"),"data-slot":"loader",children:O.jsx(qT,{"data-slot":"loader-icon",...s,className:Fe(sle({variant:r,size:l}),s.className)})});function fle(e){const[t=[],r]=k.useState(e);return[t,{insertAt:(R,M)=>{r((q=[])=>{const N=[...q];return N.splice(R,0,M),N})},removeAt:R=>{r((M=[])=>{const q=[...M];return q.splice(R,1),q})},updateAt:(R,M)=>{r((q=[])=>{const N=[...q];return N[R]=M,N})},clear:()=>r([]),reset:()=>r(e),push:R=>r((M=[])=>[...M,R]),set:R=>r(R),pop:()=>{r((R=[])=>{const M=[...R];return M.pop(),M})},update:(R,M)=>{r((q=[])=>{const N=[...q],L=sr.findIndex(N,R);return L===-1||(N[L]=sr.isFunction(M)?M(N[L]):M),N})}}]}function dle({fn:e,dependencies:t=[],onError:r,onSuccess:l,onFinish:s}){const[c,h]=k.useState(!0),[m,b]=k.useState(null),[E,C]=k.useState(null),S=k.useCallback(()=>{h(!0),b(null),C(null),e().then(R=>{l?.(R),C(R)}).catch(R=>{r?.(R),b(R)}).finally(()=>{s?.(),h(!1)})},t);return k.useEffect(()=>{S()},[S]),{loading:c,error:m,data:E,refetch:S}}const ple=(e,t=!0)=>{const r=k.useRef(null),l=s=>{r.current&&!r.current.contains(s.target)&&e()};return k.useEffect(()=>{if(t)return document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l)}},[t]),r};function hle(){const[e,t]=k.useState(null),r=k.useCallback(async l=>{if(!navigator?.clipboard)return!1;try{return await navigator.clipboard.writeText(l),t(l),!0}catch(s){return console.error(s),t(null),!1}},[]);return[e,r]}function mle(e,t){const r=k.useRef(null);return k.useCallback((...l)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(...l)},t)},[e,t])}function vle(e,t){const[r,l]=k.useState(e);return k.useEffect(()=>{const s=setTimeout(()=>{l(e)},t);return()=>clearTimeout(s)},[e,t]),r}function gle(e=!1,t){const{onOpen:r,onClose:l}=t||{},[s,c]=k.useState(e),h=k.useCallback(()=>{c(E=>E||(r?.(),!0))},[r]),m=k.useCallback(()=>{c(E=>E&&(l?.(),!1))},[l]),b=k.useCallback(()=>{s?m():h()},[m,h,s]);return[s,{open:h,close:m,toggle:b}]}function yle(e){k.useEffect(()=>{typeof e=="string"&&e.trim().length>0&&(document.title=e.trim())},[e])}function tj(e,t,r){const l=k.useRef(null);return k.useEffect(()=>{const s=l.current??document;return s.addEventListener(e,t,r),()=>{s.removeEventListener(e,t,r)}},[e,t,r]),l}const ble=e=>{const t=e.toLowerCase().split("+");return{mainKey:t.pop(),isShift:t.includes("shift"),isCtrl:t.includes("ctrl"),isAlt:t.includes("alt"),isMeta:t.includes("meta")}},xle=(e,t)=>{const{mainKey:r,isShift:l,isCtrl:s,isAlt:c,isMeta:h}=ble(t);return e.key.toLowerCase()===r&&e.shiftKey===l&&e.ctrlKey===s&&e.altKey===c&&e.metaKey===h},Ele=e=>e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable,Sle=(e,t)=>t&&Ele(e.target),Cle=(e,t,r,l,s)=>c=>{if(!s||Sle(c,l))return;(Array.isArray(e)?e:[e]).some(b=>xle(c,b))&&(r&&c.preventDefault(),t(c))};function nj(e,t,r={}){const{eventName:l="keydown",preventDefault:s=!0,ignoreInputFields:c=!0,watch:h=!0}=r,m=k.useCallback(Cle(e,t,s,c,h),[e,t,s,c,h]);return tj(l,m)}function wle(e){const[t,r]=k.useState(!1),l=k.useRef(null);return k.useEffect(()=>{const s=m=>{r(!0),e?.onHoverStart?.(m)},c=m=>{r(!1),e?.onHoverEnd?.(m)},h=l.current;if(h)return h.addEventListener("mouseover",s),h.addEventListener("mouseout",c),()=>{h.removeEventListener("mouseover",s),h.removeEventListener("mouseout",c)}},[e]),{ref:l,isHovering:t}}function Rle({onVisible:e,root:t=null,rootMargin:r="0px",threshold:l=0}={}){const[s,c]=k.useState(!1),h=k.useRef(null),m=k.useCallback(([b])=>{const E=b.isIntersecting;c(E)},[e]);return k.useEffect(()=>{if(h.current==null)return;const b=new IntersectionObserver(m,{root:t,rootMargin:r,threshold:l});return b.observe(h.current),()=>{h.current!=null&&b.unobserve(h.current)}},[h,t,r,l,m]),k.useEffect(()=>{s&&e?.()},[s]),{ref:h,isVisible:s}}function Tle(e,t){const r=()=>{try{const m=localStorage.getItem(e);return m?JSON.parse(m):t!==void 0?t:void 0}catch(m){return console.error(`Error parsing localStorage key "${e}":`,m),t!==void 0?t:void 0}},[l,s]=k.useState(r);return k.useEffect(()=>{try{l!==void 0?localStorage.setItem(e,JSON.stringify(l)):localStorage.removeItem(e)}catch(m){console.error(`Error setting localStorage key "${e}":`,m)}},[e,l]),[l,m=>{s(m)},()=>{try{localStorage.removeItem(e),s(t!==void 0?t:void 0)}catch(m){console.error(`Error removing localStorage key "${e}":`,m)}}]}const _le=e=>{const[t,r]=k.useState(!1);return k.useEffect(()=>{const l=window.matchMedia(e),s=()=>r(l.matches);return s(),l.addEventListener("change",s),()=>{l.removeEventListener("change",s)}},[e]),t};function Ale(e){sr.isFunction(e)||console.error(`useMemoizedFn expected parameter is a function, got ${typeof e}`);const t=k.useRef(e);t.current=k.useMemo(()=>e,[e]);const r=k.useRef(null);return r.current||(r.current=function(...l){return t.current.apply(this,l)}),r.current}const Dle=e=>{const[t,r]=k.useState(!1),[l,s]=k.useState(null),[c,h]=k.useState(null);return{mutate:k.useCallback(async(...b)=>{r(!0),s(null),h(null);try{const E=await e.fn(...b);return e.onSuccess?.(E),h(E),E}catch(E){const C=E;throw e.onError?.(C),s(C),C}finally{e.onFinish?.(),r(!1)}},[e]),loading:t,error:l,data:c}};function Mle(e){const[t,r]=k.useState(e),l=k.useCallback(()=>r(e),[e]),s=k.useCallback(c=>{r(h=>{if(sr.isFunction(c)){const m=c(h);return sr.isObject(m)?{...h,...m}:h}else if(sr.isObject(c))return{...h,...c};return h})},[]);return[t,s,l]}function YM({totalItems:e,pageSize:t,initialCurrentPage:r=1,onChange:l}){const[s,c]=k.useState(r),h=Math.ceil(e/t),m=s===h,b=s===1,E=(s-1)*t+1,C=Math.min(s*t,e),S=()=>{if(m)return;const N=Math.min(s+1,h);q(N)},R=()=>{if(b)return;const N=Math.max(s-1,1);q(N)},M=N=>{if(N===1&&b||N===h&&m)return;const L=Math.max(1,N),P=Math.min(L,h);q(P)},q=N=>{c(N),l?.({currentPage:N,pageSize:t})};return{next:S,prev:R,goTo:M,currentPage:s,maxPage:h,isFirstPage:b,isLastPage:m,range:{start:E,end:C}}}function Ole(e){const t=()=>document.getElementById(e),r=()=>{const s=document.createElement("div");return s.id=e,s},l=k.useMemo(()=>{const s=t();return s||r()},[e]);return k.useEffect(()=>(document.getElementById(e)||document.body.appendChild(l),()=>{const s=document.getElementById(e);s&&document.body.removeChild(s)}),[e,l]),{render:s=>ws.createPortal(s,l)}}function Nle({shouldPrevent:e,message:t="Es posible que no se guarden los cambios hayas hecho."}){const r=l=>{if(e)return l.preventDefault(),l.returnValue=t,t};k.useEffect(()=>(window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)),[t,e])}const Dg="...",rj=({siblingCount:e=1,...t})=>{const r=YM(t),{currentPage:l,maxPage:s}=r,{totalItems:c,pageSize:h}=t,m=()=>{const S=2+3*e,R=1;if(S>=s)return sr.range(R,s+1);const M=Math.max(l-e,1),q=Math.min(l+e,s),N=M>2,L=q<s-2;if(N&&L){const P=sr.range(M,q+1);return[R,Dg,...P,Dg,s]}if(L)return[...sr.range(R,S+1),Dg,s];if(N){const P=sr.range(s-S+1,s+1);return[R,Dg,...P]}},b=k.useMemo(m,[c,h,l,e]);return{...r,paginationRange:b??[]}};function $le(e){const[t,r]=k.useState(new Set),l=k.useCallback(C=>t.has(C),[t]),s=k.useCallback(C=>{r(S=>new Set([...S,C]))},[]),c=k.useCallback(C=>{r(S=>{const R=new Set(S);return R.delete(C),R})},[]),h=k.useCallback(C=>{r(S=>{const R=new Set(S);return R.has(C)?R.delete(C):R.add(C),R})},[]),m=k.useCallback(C=>{r(new Set(C))},[]),b=k.useCallback(()=>{r(C=>C.size===e.length?new Set:new Set(e))},[e]),E=k.useCallback(()=>r(new Set),[]);return{isAllSelected:t.size===e.length,isSomeSelected:t.size>0&&t.size<e.length,isNoneSelected:t.size===0,isSelected:l,selected:[...t],setSelected:m,select:s,unselect:c,toggle:h,toggleAll:b,clear:E}}function Ple(e,t){const[r,l]=k.useState(0),s=t??e.length,c=()=>{l(E=>E>=s-1?E:E+1)},h=()=>{l(E=>E<=0?E:E-1)},m=E=>{l(E)},b=E=>{const C=sr.findIndex(e,E);C!==-1&&m(C)};return{currentStepIndex:r,step:e[r],steps:e,isFirstStep:r===0,isLastStep:r===s-1,goTo:m,next:c,back:h,findAndGo:b}}function aj(e=!1){const[t,r]=k.useState(e);return[t,s=>{r(s===void 0?!t:s)}]}const qle=/input|select|textarea|button|object/,lj="a, input, select, textarea, button, object, [tabindex]";function Lle(e){return process.env.NODE_ENV==="test"?!1:e.style.display==="none"}function jle(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(Lle(r))return!1;r=r.parentNode}return!0}function oj(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function D2(e){const t=e.nodeName.toLowerCase(),r=!Number.isNaN(oj(e));return(qle.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&jle(e)}function ij(e){const t=oj(e);return(Number.isNaN(t)||t>=0)&&D2(e)}function zle(e){return Array.from(e.querySelectorAll(lj)).filter(ij)}function Ble(e,t){const r=zle(e);if(!r.length){t.preventDefault();return}const l=r[t.shiftKey?0:r.length-1],s=e.getRootNode();let c=l===s.activeElement||e===s.activeElement;const h=s.activeElement;if(h.tagName==="INPUT"&&h.getAttribute("type")==="radio"&&(c=r.filter(C=>C.getAttribute("type")==="radio"&&C.getAttribute("name")===h.getAttribute("name")).includes(l)),!c)return;t.preventDefault();const b=r[t.shiftKey?r.length-1:0];b&&b.focus()}function kle(e=!0){const t=k.useRef(null),r=s=>{let c=s.querySelector("[data-autofocus]");if(!c){const h=Array.from(s.querySelectorAll(lj));c=h.find(ij)||h.find(D2)||null,!c&&D2(s)&&(c=s)}c&&c.focus({preventScroll:!0})},l=k.useCallback(s=>{e&&s!==null&&t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)},[e]);return k.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=c=>{c.key==="Tab"&&t.current&&Ble(t.current,c)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),l}function Ule(e){const t=Ile(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(Vle);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Ile(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Kle(s),m=Fle(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hle=Symbol("radix.slottable");function Vle(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hle}function Fle(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Kle(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Gle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yle=Gle.reduce((e,t)=>{const r=Ule(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function $P(e){const t=Xle(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(Zle);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Xle(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Jle(s),m=Wle(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qle=Symbol("radix.slottable");function Zle(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qle}function Wle(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Jle(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function XM(e){const t=e+"CollectionProvider",[r,l]=xp(t),[s,c]=r(t,{collectionRef:{current:null},itemMap:new Map}),h=N=>{const{scope:L,children:P}=N,U=k.useRef(null),I=k.useRef(new Map).current;return O.jsx(s,{scope:L,itemMap:I,collectionRef:U,children:P})};h.displayName=t;const m=e+"CollectionSlot",b=$P(m),E=k.forwardRef((N,L)=>{const{scope:P,children:U}=N,I=c(m,P),Y=vn(L,I.collectionRef);return O.jsx(b,{ref:Y,children:U})});E.displayName=m;const C=e+"CollectionItemSlot",S="data-radix-collection-item",R=$P(C),M=k.forwardRef((N,L)=>{const{scope:P,children:U,...I}=N,Y=k.useRef(null),V=vn(L,Y),F=c(C,P);return k.useEffect(()=>(F.itemMap.set(Y,{ref:Y,...I}),()=>{F.itemMap.delete(Y)})),O.jsx(R,{[S]:"",ref:V,children:U})});M.displayName=C;function q(N){const L=c(e+"CollectionConsumer",N);return k.useCallback(()=>{const U=L.collectionRef.current;if(!U)return[];const I=Array.from(U.querySelectorAll(`[${S}]`));return Array.from(L.itemMap.values()).sort((F,K)=>I.indexOf(F.ref.current)-I.indexOf(K.ref.current))},[L.collectionRef,L.itemMap])}return[{Provider:h,Slot:E,ItemSlot:M},q,l]}var eoe=D.createContext(void 0);function QM(e){const t=D.useContext(eoe);return e||t||"ltr"}const toe=["top","right","bottom","left"],Pg=Math.min,Ss=Math.max,XT=Math.round,vT=Math.floor,yp=e=>({x:e,y:e}),noe={left:"right",right:"left",bottom:"top",top:"bottom"},roe={start:"end",end:"start"};function M2(e,t,r){return Ss(e,Pg(t,r))}function Dm(e,t){return typeof e=="function"?e(t):e}function Mm(e){return e.split("-")[0]}function rx(e){return e.split("-")[1]}function ZM(e){return e==="x"?"y":"x"}function WM(e){return e==="y"?"height":"width"}function qg(e){return["top","bottom"].includes(Mm(e))?"y":"x"}function JM(e){return ZM(qg(e))}function aoe(e,t,r){r===void 0&&(r=!1);const l=rx(e),s=JM(e),c=WM(s);let h=s==="x"?l===(r?"end":"start")?"right":"left":l==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(h=QT(h)),[h,QT(h)]}function loe(e){const t=QT(e);return[O2(e),t,O2(t)]}function O2(e){return e.replace(/start|end/g,t=>roe[t])}function ooe(e,t,r){const l=["left","right"],s=["right","left"],c=["top","bottom"],h=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:l:t?l:s;case"left":case"right":return t?c:h;default:return[]}}function ioe(e,t,r,l){const s=rx(e);let c=ooe(Mm(e),r==="start",l);return s&&(c=c.map(h=>h+"-"+s),t&&(c=c.concat(c.map(O2)))),c}function QT(e){return e.replace(/left|right|bottom|top/g,t=>noe[t])}function uoe(e){return{top:0,right:0,bottom:0,left:0,...e}}function uj(e){return typeof e!="number"?uoe(e):{top:e,right:e,bottom:e,left:e}}function ZT(e){const{x:t,y:r,width:l,height:s}=e;return{width:l,height:s,top:r,left:t,right:t+l,bottom:r+s,x:t,y:r}}function PP(e,t,r){let{reference:l,floating:s}=e;const c=qg(t),h=JM(t),m=WM(h),b=Mm(t),E=c==="y",C=l.x+l.width/2-s.width/2,S=l.y+l.height/2-s.height/2,R=l[m]/2-s[m]/2;let M;switch(b){case"top":M={x:C,y:l.y-s.height};break;case"bottom":M={x:C,y:l.y+l.height};break;case"right":M={x:l.x+l.width,y:S};break;case"left":M={x:l.x-s.width,y:S};break;default:M={x:l.x,y:l.y}}switch(rx(t)){case"start":M[h]-=R*(r&&E?-1:1);break;case"end":M[h]+=R*(r&&E?-1:1);break}return M}const soe=async(e,t,r)=>{const{placement:l="bottom",strategy:s="absolute",middleware:c=[],platform:h}=r,m=c.filter(Boolean),b=await(h.isRTL==null?void 0:h.isRTL(t));let E=await h.getElementRects({reference:e,floating:t,strategy:s}),{x:C,y:S}=PP(E,l,b),R=l,M={},q=0;for(let N=0;N<m.length;N++){const{name:L,fn:P}=m[N],{x:U,y:I,data:Y,reset:V}=await P({x:C,y:S,initialPlacement:l,placement:R,strategy:s,middlewareData:M,rects:E,platform:h,elements:{reference:e,floating:t}});C=U??C,S=I??S,M={...M,[L]:{...M[L],...Y}},V&&q<=50&&(q++,typeof V=="object"&&(V.placement&&(R=V.placement),V.rects&&(E=V.rects===!0?await h.getElementRects({reference:e,floating:t,strategy:s}):V.rects),{x:C,y:S}=PP(E,R,b)),N=-1)}return{x:C,y:S,placement:R,strategy:s,middlewareData:M}};async function hw(e,t){var r;t===void 0&&(t={});const{x:l,y:s,platform:c,rects:h,elements:m,strategy:b}=e,{boundary:E="clippingAncestors",rootBoundary:C="viewport",elementContext:S="floating",altBoundary:R=!1,padding:M=0}=Dm(t,e),q=uj(M),L=m[R?S==="floating"?"reference":"floating":S],P=ZT(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(L)))==null||r?L:L.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(m.floating)),boundary:E,rootBoundary:C,strategy:b})),U=S==="floating"?{x:l,y:s,width:h.floating.width,height:h.floating.height}:h.reference,I=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m.floating)),Y=await(c.isElement==null?void 0:c.isElement(I))?await(c.getScale==null?void 0:c.getScale(I))||{x:1,y:1}:{x:1,y:1},V=ZT(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:U,offsetParent:I,strategy:b}):U);return{top:(P.top-V.top+q.top)/Y.y,bottom:(V.bottom-P.bottom+q.bottom)/Y.y,left:(P.left-V.left+q.left)/Y.x,right:(V.right-P.right+q.right)/Y.x}}const coe=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:l,placement:s,rects:c,platform:h,elements:m,middlewareData:b}=t,{element:E,padding:C=0}=Dm(e,t)||{};if(E==null)return{};const S=uj(C),R={x:r,y:l},M=JM(s),q=WM(M),N=await h.getDimensions(E),L=M==="y",P=L?"top":"left",U=L?"bottom":"right",I=L?"clientHeight":"clientWidth",Y=c.reference[q]+c.reference[M]-R[M]-c.floating[q],V=R[M]-c.reference[M],F=await(h.getOffsetParent==null?void 0:h.getOffsetParent(E));let K=F?F[I]:0;(!K||!await(h.isElement==null?void 0:h.isElement(F)))&&(K=m.floating[I]||c.floating[q]);const Q=Y/2-V/2,he=K/2-N[q]/2-1,de=Pg(S[P],he),W=Pg(S[U],he),se=de,le=K-N[q]-W,ae=K/2-N[q]/2+Q,xe=M2(se,ae,le),B=!b.arrow&&rx(s)!=null&&ae!==xe&&c.reference[q]/2-(ae<se?de:W)-N[q]/2<0,Z=B?ae<se?ae-se:ae-le:0;return{[M]:R[M]+Z,data:{[M]:xe,centerOffset:ae-xe-Z,...B&&{alignmentOffset:Z}},reset:B}}}),foe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,l;const{placement:s,middlewareData:c,rects:h,initialPlacement:m,platform:b,elements:E}=t,{mainAxis:C=!0,crossAxis:S=!0,fallbackPlacements:R,fallbackStrategy:M="bestFit",fallbackAxisSideDirection:q="none",flipAlignment:N=!0,...L}=Dm(e,t);if((r=c.arrow)!=null&&r.alignmentOffset)return{};const P=Mm(s),U=qg(m),I=Mm(m)===m,Y=await(b.isRTL==null?void 0:b.isRTL(E.floating)),V=R||(I||!N?[QT(m)]:loe(m)),F=q!=="none";!R&&F&&V.push(...ioe(m,N,q,Y));const K=[m,...V],Q=await hw(t,L),he=[];let de=((l=c.flip)==null?void 0:l.overflows)||[];if(C&&he.push(Q[P]),S){const ae=aoe(s,h,Y);he.push(Q[ae[0]],Q[ae[1]])}if(de=[...de,{placement:s,overflows:he}],!he.every(ae=>ae<=0)){var W,se;const ae=(((W=c.flip)==null?void 0:W.index)||0)+1,xe=K[ae];if(xe)return{data:{index:ae,overflows:de},reset:{placement:xe}};let B=(se=de.filter(Z=>Z.overflows[0]<=0).sort((Z,te)=>Z.overflows[1]-te.overflows[1])[0])==null?void 0:se.placement;if(!B)switch(M){case"bestFit":{var le;const Z=(le=de.filter(te=>{if(F){const be=qg(te.placement);return be===U||be==="y"}return!0}).map(te=>[te.placement,te.overflows.filter(be=>be>0).reduce((be,re)=>be+re,0)]).sort((te,be)=>te[1]-be[1])[0])==null?void 0:le[0];Z&&(B=Z);break}case"initialPlacement":B=m;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function qP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function LP(e){return toe.some(t=>e[t]>=0)}const doe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:l="referenceHidden",...s}=Dm(e,t);switch(l){case"referenceHidden":{const c=await hw(t,{...s,elementContext:"reference"}),h=qP(c,r.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:LP(h)}}}case"escaped":{const c=await hw(t,{...s,altBoundary:!0}),h=qP(c,r.floating);return{data:{escapedOffsets:h,escaped:LP(h)}}}default:return{}}}}};async function poe(e,t){const{placement:r,platform:l,elements:s}=e,c=await(l.isRTL==null?void 0:l.isRTL(s.floating)),h=Mm(r),m=rx(r),b=qg(r)==="y",E=["left","top"].includes(h)?-1:1,C=c&&b?-1:1,S=Dm(t,e);let{mainAxis:R,crossAxis:M,alignmentAxis:q}=typeof S=="number"?{mainAxis:S,crossAxis:0,alignmentAxis:null}:{mainAxis:S.mainAxis||0,crossAxis:S.crossAxis||0,alignmentAxis:S.alignmentAxis};return m&&typeof q=="number"&&(M=m==="end"?q*-1:q),b?{x:M*C,y:R*E}:{x:R*E,y:M*C}}const hoe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,l;const{x:s,y:c,placement:h,middlewareData:m}=t,b=await poe(t,e);return h===((r=m.offset)==null?void 0:r.placement)&&(l=m.arrow)!=null&&l.alignmentOffset?{}:{x:s+b.x,y:c+b.y,data:{...b,placement:h}}}}},moe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:l,placement:s}=t,{mainAxis:c=!0,crossAxis:h=!1,limiter:m={fn:L=>{let{x:P,y:U}=L;return{x:P,y:U}}},...b}=Dm(e,t),E={x:r,y:l},C=await hw(t,b),S=qg(Mm(s)),R=ZM(S);let M=E[R],q=E[S];if(c){const L=R==="y"?"top":"left",P=R==="y"?"bottom":"right",U=M+C[L],I=M-C[P];M=M2(U,M,I)}if(h){const L=S==="y"?"top":"left",P=S==="y"?"bottom":"right",U=q+C[L],I=q-C[P];q=M2(U,q,I)}const N=m.fn({...t,[R]:M,[S]:q});return{...N,data:{x:N.x-r,y:N.y-l,enabled:{[R]:c,[S]:h}}}}}},voe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:l,placement:s,rects:c,middlewareData:h}=t,{offset:m=0,mainAxis:b=!0,crossAxis:E=!0}=Dm(e,t),C={x:r,y:l},S=qg(s),R=ZM(S);let M=C[R],q=C[S];const N=Dm(m,t),L=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:0,crossAxis:0,...N};if(b){const I=R==="y"?"height":"width",Y=c.reference[R]-c.floating[I]+L.mainAxis,V=c.reference[R]+c.reference[I]-L.mainAxis;M<Y?M=Y:M>V&&(M=V)}if(E){var P,U;const I=R==="y"?"width":"height",Y=["top","left"].includes(Mm(s)),V=c.reference[S]-c.floating[I]+(Y&&((P=h.offset)==null?void 0:P[S])||0)+(Y?0:L.crossAxis),F=c.reference[S]+c.reference[I]+(Y?0:((U=h.offset)==null?void 0:U[S])||0)-(Y?L.crossAxis:0);q<V?q=V:q>F&&(q=F)}return{[R]:M,[S]:q}}}},goe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,l;const{placement:s,rects:c,platform:h,elements:m}=t,{apply:b=()=>{},...E}=Dm(e,t),C=await hw(t,E),S=Mm(s),R=rx(s),M=qg(s)==="y",{width:q,height:N}=c.floating;let L,P;S==="top"||S==="bottom"?(L=S,P=R===(await(h.isRTL==null?void 0:h.isRTL(m.floating))?"start":"end")?"left":"right"):(P=S,L=R==="end"?"top":"bottom");const U=N-C.top-C.bottom,I=q-C.left-C.right,Y=Pg(N-C[L],U),V=Pg(q-C[P],I),F=!t.middlewareData.shift;let K=Y,Q=V;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(Q=I),(l=t.middlewareData.shift)!=null&&l.enabled.y&&(K=U),F&&!R){const de=Ss(C.left,0),W=Ss(C.right,0),se=Ss(C.top,0),le=Ss(C.bottom,0);M?Q=q-2*(de!==0||W!==0?de+W:Ss(C.left,C.right)):K=N-2*(se!==0||le!==0?se+le:Ss(C.top,C.bottom))}await b({...t,availableWidth:Q,availableHeight:K});const he=await h.getDimensions(m.floating);return q!==he.width||N!==he.height?{reset:{rects:!0}}:{}}}};function A_(){return typeof window<"u"}function ax(e){return sj(e)?(e.nodeName||"").toLowerCase():"#document"}function Rs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Sp(e){var t;return(t=(sj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sj(e){return A_()?e instanceof Node||e instanceof Rs(e).Node:!1}function Jf(e){return A_()?e instanceof Element||e instanceof Rs(e).Element:!1}function bp(e){return A_()?e instanceof HTMLElement||e instanceof Rs(e).HTMLElement:!1}function jP(e){return!A_()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rs(e).ShadowRoot}function jw(e){const{overflow:t,overflowX:r,overflowY:l,display:s}=ed(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+r)&&!["inline","contents"].includes(s)}function yoe(e){return["table","td","th"].includes(ax(e))}function D_(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function eO(e){const t=tO(),r=Jf(e)?ed(e):e;return["transform","translate","scale","rotate","perspective"].some(l=>r[l]?r[l]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(l=>(r.willChange||"").includes(l))||["paint","layout","strict","content"].some(l=>(r.contain||"").includes(l))}function boe(e){let t=Lg(e);for(;bp(t)&&!K1(t);){if(eO(t))return t;if(D_(t))return null;t=Lg(t)}return null}function tO(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function K1(e){return["html","body","#document"].includes(ax(e))}function ed(e){return Rs(e).getComputedStyle(e)}function M_(e){return Jf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lg(e){if(ax(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jP(e)&&e.host||Sp(e);return jP(t)?t.host:t}function cj(e){const t=Lg(e);return K1(t)?e.ownerDocument?e.ownerDocument.body:e.body:bp(t)&&jw(t)?t:cj(t)}function mw(e,t,r){var l;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=cj(e),c=s===((l=e.ownerDocument)==null?void 0:l.body),h=Rs(s);if(c){const m=N2(h);return t.concat(h,h.visualViewport||[],jw(s)?s:[],m&&r?mw(m):[])}return t.concat(s,mw(s,[],r))}function N2(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fj(e){const t=ed(e);let r=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const s=bp(e),c=s?e.offsetWidth:r,h=s?e.offsetHeight:l,m=XT(r)!==c||XT(l)!==h;return m&&(r=c,l=h),{width:r,height:l,$:m}}function nO(e){return Jf(e)?e:e.contextElement}function I1(e){const t=nO(e);if(!bp(t))return yp(1);const r=t.getBoundingClientRect(),{width:l,height:s,$:c}=fj(t);let h=(c?XT(r.width):r.width)/l,m=(c?XT(r.height):r.height)/s;return(!h||!Number.isFinite(h))&&(h=1),(!m||!Number.isFinite(m))&&(m=1),{x:h,y:m}}const xoe=yp(0);function dj(e){const t=Rs(e);return!tO()||!t.visualViewport?xoe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Eoe(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Rs(e)?!1:t}function r0(e,t,r,l){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),c=nO(e);let h=yp(1);t&&(l?Jf(l)&&(h=I1(l)):h=I1(e));const m=Eoe(c,r,l)?dj(c):yp(0);let b=(s.left+m.x)/h.x,E=(s.top+m.y)/h.y,C=s.width/h.x,S=s.height/h.y;if(c){const R=Rs(c),M=l&&Jf(l)?Rs(l):l;let q=R,N=N2(q);for(;N&&l&&M!==q;){const L=I1(N),P=N.getBoundingClientRect(),U=ed(N),I=P.left+(N.clientLeft+parseFloat(U.paddingLeft))*L.x,Y=P.top+(N.clientTop+parseFloat(U.paddingTop))*L.y;b*=L.x,E*=L.y,C*=L.x,S*=L.y,b+=I,E+=Y,q=Rs(N),N=N2(q)}}return ZT({width:C,height:S,x:b,y:E})}function rO(e,t){const r=M_(e).scrollLeft;return t?t.left+r:r0(Sp(e)).left+r}function pj(e,t,r){r===void 0&&(r=!1);const l=e.getBoundingClientRect(),s=l.left+t.scrollLeft-(r?0:rO(e,l)),c=l.top+t.scrollTop;return{x:s,y:c}}function Soe(e){let{elements:t,rect:r,offsetParent:l,strategy:s}=e;const c=s==="fixed",h=Sp(l),m=t?D_(t.floating):!1;if(l===h||m&&c)return r;let b={scrollLeft:0,scrollTop:0},E=yp(1);const C=yp(0),S=bp(l);if((S||!S&&!c)&&((ax(l)!=="body"||jw(h))&&(b=M_(l)),bp(l))){const M=r0(l);E=I1(l),C.x=M.x+l.clientLeft,C.y=M.y+l.clientTop}const R=h&&!S&&!c?pj(h,b,!0):yp(0);return{width:r.width*E.x,height:r.height*E.y,x:r.x*E.x-b.scrollLeft*E.x+C.x+R.x,y:r.y*E.y-b.scrollTop*E.y+C.y+R.y}}function Coe(e){return Array.from(e.getClientRects())}function woe(e){const t=Sp(e),r=M_(e),l=e.ownerDocument.body,s=Ss(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),c=Ss(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let h=-r.scrollLeft+rO(e);const m=-r.scrollTop;return ed(l).direction==="rtl"&&(h+=Ss(t.clientWidth,l.clientWidth)-s),{width:s,height:c,x:h,y:m}}function Roe(e,t){const r=Rs(e),l=Sp(e),s=r.visualViewport;let c=l.clientWidth,h=l.clientHeight,m=0,b=0;if(s){c=s.width,h=s.height;const E=tO();(!E||E&&t==="fixed")&&(m=s.offsetLeft,b=s.offsetTop)}return{width:c,height:h,x:m,y:b}}function Toe(e,t){const r=r0(e,!0,t==="fixed"),l=r.top+e.clientTop,s=r.left+e.clientLeft,c=bp(e)?I1(e):yp(1),h=e.clientWidth*c.x,m=e.clientHeight*c.y,b=s*c.x,E=l*c.y;return{width:h,height:m,x:b,y:E}}function zP(e,t,r){let l;if(t==="viewport")l=Roe(e,r);else if(t==="document")l=woe(Sp(e));else if(Jf(t))l=Toe(t,r);else{const s=dj(e);l={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ZT(l)}function hj(e,t){const r=Lg(e);return r===t||!Jf(r)||K1(r)?!1:ed(r).position==="fixed"||hj(r,t)}function _oe(e,t){const r=t.get(e);if(r)return r;let l=mw(e,[],!1).filter(m=>Jf(m)&&ax(m)!=="body"),s=null;const c=ed(e).position==="fixed";let h=c?Lg(e):e;for(;Jf(h)&&!K1(h);){const m=ed(h),b=eO(h);!b&&m.position==="fixed"&&(s=null),(c?!b&&!s:!b&&m.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||jw(h)&&!b&&hj(e,h))?l=l.filter(C=>C!==h):s=m,h=Lg(h)}return t.set(e,l),l}function Aoe(e){let{element:t,boundary:r,rootBoundary:l,strategy:s}=e;const h=[...r==="clippingAncestors"?D_(t)?[]:_oe(t,this._c):[].concat(r),l],m=h[0],b=h.reduce((E,C)=>{const S=zP(t,C,s);return E.top=Ss(S.top,E.top),E.right=Pg(S.right,E.right),E.bottom=Pg(S.bottom,E.bottom),E.left=Ss(S.left,E.left),E},zP(t,m,s));return{width:b.right-b.left,height:b.bottom-b.top,x:b.left,y:b.top}}function Doe(e){const{width:t,height:r}=fj(e);return{width:t,height:r}}function Moe(e,t,r){const l=bp(t),s=Sp(t),c=r==="fixed",h=r0(e,!0,c,t);let m={scrollLeft:0,scrollTop:0};const b=yp(0);if(l||!l&&!c)if((ax(t)!=="body"||jw(s))&&(m=M_(t)),l){const R=r0(t,!0,c,t);b.x=R.x+t.clientLeft,b.y=R.y+t.clientTop}else s&&(b.x=rO(s));const E=s&&!l&&!c?pj(s,m):yp(0),C=h.left+m.scrollLeft-b.x-E.x,S=h.top+m.scrollTop-b.y-E.y;return{x:C,y:S,width:h.width,height:h.height}}function zD(e){return ed(e).position==="static"}function BP(e,t){if(!bp(e)||ed(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Sp(e)===r&&(r=r.ownerDocument.body),r}function mj(e,t){const r=Rs(e);if(D_(e))return r;if(!bp(e)){let s=Lg(e);for(;s&&!K1(s);){if(Jf(s)&&!zD(s))return s;s=Lg(s)}return r}let l=BP(e,t);for(;l&&yoe(l)&&zD(l);)l=BP(l,t);return l&&K1(l)&&zD(l)&&!eO(l)?r:l||boe(e)||r}const Ooe=async function(e){const t=this.getOffsetParent||mj,r=this.getDimensions,l=await r(e.floating);return{reference:Moe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function Noe(e){return ed(e).direction==="rtl"}const $oe={convertOffsetParentRelativeRectToViewportRelativeRect:Soe,getDocumentElement:Sp,getClippingRect:Aoe,getOffsetParent:mj,getElementRects:Ooe,getClientRects:Coe,getDimensions:Doe,getScale:I1,isElement:Jf,isRTL:Noe};function vj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Poe(e,t){let r=null,l;const s=Sp(e);function c(){var m;clearTimeout(l),(m=r)==null||m.disconnect(),r=null}function h(m,b){m===void 0&&(m=!1),b===void 0&&(b=1),c();const E=e.getBoundingClientRect(),{left:C,top:S,width:R,height:M}=E;if(m||t(),!R||!M)return;const q=vT(S),N=vT(s.clientWidth-(C+R)),L=vT(s.clientHeight-(S+M)),P=vT(C),I={rootMargin:-q+"px "+-N+"px "+-L+"px "+-P+"px",threshold:Ss(0,Pg(1,b))||1};let Y=!0;function V(F){const K=F[0].intersectionRatio;if(K!==b){if(!Y)return h();K?h(!1,K):l=setTimeout(()=>{h(!1,1e-7)},1e3)}K===1&&!vj(E,e.getBoundingClientRect())&&h(),Y=!1}try{r=new IntersectionObserver(V,{...I,root:s.ownerDocument})}catch{r=new IntersectionObserver(V,I)}r.observe(e)}return h(!0),c}function qoe(e,t,r,l){l===void 0&&(l={});const{ancestorScroll:s=!0,ancestorResize:c=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:b=!1}=l,E=nO(e),C=s||c?[...E?mw(E):[],...mw(t)]:[];C.forEach(P=>{s&&P.addEventListener("scroll",r,{passive:!0}),c&&P.addEventListener("resize",r)});const S=E&&m?Poe(E,r):null;let R=-1,M=null;h&&(M=new ResizeObserver(P=>{let[U]=P;U&&U.target===E&&M&&(M.unobserve(t),cancelAnimationFrame(R),R=requestAnimationFrame(()=>{var I;(I=M)==null||I.observe(t)})),r()}),E&&!b&&M.observe(E),M.observe(t));let q,N=b?r0(e):null;b&&L();function L(){const P=r0(e);N&&!vj(N,P)&&r(),N=P,q=requestAnimationFrame(L)}return r(),()=>{var P;C.forEach(U=>{s&&U.removeEventListener("scroll",r),c&&U.removeEventListener("resize",r)}),S?.(),(P=M)==null||P.disconnect(),M=null,b&&cancelAnimationFrame(q)}}const Loe=hoe,joe=moe,zoe=foe,Boe=goe,koe=doe,kP=coe,Uoe=voe,Ioe=(e,t,r)=>{const l=new Map,s={platform:$oe,...r},c={...s.platform,_c:l};return soe(e,t,{...s,platform:c})};var _T=typeof document<"u"?k.useLayoutEffect:k.useEffect;function WT(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,l,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(l=r;l--!==0;)if(!WT(e[l],t[l]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(l=r;l--!==0;)if(!{}.hasOwnProperty.call(t,s[l]))return!1;for(l=r;l--!==0;){const c=s[l];if(!(c==="_owner"&&e.$$typeof)&&!WT(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function gj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function UP(e,t){const r=gj(e);return Math.round(t*r)/r}function BD(e){const t=D.useRef(e);return _T(()=>{t.current=e}),t}function Hoe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:l=[],platform:s,elements:{reference:c,floating:h}={},transform:m=!0,whileElementsMounted:b,open:E}=e,[C,S]=D.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[R,M]=D.useState(l);WT(R,l)||M(l);const[q,N]=D.useState(null),[L,P]=D.useState(null),U=D.useCallback(te=>{te!==F.current&&(F.current=te,N(te))},[]),I=D.useCallback(te=>{te!==K.current&&(K.current=te,P(te))},[]),Y=c||q,V=h||L,F=D.useRef(null),K=D.useRef(null),Q=D.useRef(C),he=b!=null,de=BD(b),W=BD(s),se=BD(E),le=D.useCallback(()=>{if(!F.current||!K.current)return;const te={placement:t,strategy:r,middleware:R};W.current&&(te.platform=W.current),Ioe(F.current,K.current,te).then(be=>{const re={...be,isPositioned:se.current!==!1};ae.current&&!WT(Q.current,re)&&(Q.current=re,X1.flushSync(()=>{S(re)}))})},[R,t,r,W,se]);_T(()=>{E===!1&&Q.current.isPositioned&&(Q.current.isPositioned=!1,S(te=>({...te,isPositioned:!1})))},[E]);const ae=D.useRef(!1);_T(()=>(ae.current=!0,()=>{ae.current=!1}),[]),_T(()=>{if(Y&&(F.current=Y),V&&(K.current=V),Y&&V){if(de.current)return de.current(Y,V,le);le()}},[Y,V,le,de,he]);const xe=D.useMemo(()=>({reference:F,floating:K,setReference:U,setFloating:I}),[U,I]),B=D.useMemo(()=>({reference:Y,floating:V}),[Y,V]),Z=D.useMemo(()=>{const te={position:r,left:0,top:0};if(!B.floating)return te;const be=UP(B.floating,C.x),re=UP(B.floating,C.y);return m?{...te,transform:"translate("+be+"px, "+re+"px)",...gj(B.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:be,top:re}},[r,m,B.floating,C.x,C.y]);return D.useMemo(()=>({...C,update:le,refs:xe,elements:B,floatingStyles:Z}),[C,le,xe,B,Z])}const Voe=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:l,padding:s}=typeof e=="function"?e(r):e;return l&&t(l)?l.current!=null?kP({element:l.current,padding:s}).fn(r):{}:l?kP({element:l,padding:s}).fn(r):{}}}},Foe=(e,t)=>({...Loe(e),options:[e,t]}),Koe=(e,t)=>({...joe(e),options:[e,t]}),Goe=(e,t)=>({...Uoe(e),options:[e,t]}),Yoe=(e,t)=>({...zoe(e),options:[e,t]}),Xoe=(e,t)=>({...Boe(e),options:[e,t]}),Qoe=(e,t)=>({...koe(e),options:[e,t]}),Zoe=(e,t)=>({...Voe(e),options:[e,t]});function Woe(e){const t=Joe(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(tie);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Joe(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=rie(s),m=nie(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eie=Symbol("radix.slottable");function tie(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eie}function nie(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function rie(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var aie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lie=aie.reduce((e,t)=>{const r=Woe(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),oie="Arrow",yj=D.forwardRef((e,t)=>{const{children:r,width:l=10,height:s=5,...c}=e;return O.jsx(lie.svg,{...c,ref:t,width:l,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:O.jsx("polygon",{points:"0,0 30,0 15,10"})})});yj.displayName=oie;var iie=yj;function uie(e){const t=sie(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(fie);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function sie(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=pie(s),m=die(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cie=Symbol("radix.slottable");function fie(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cie}function die(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function pie(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var hie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bj=hie.reduce((e,t)=>{const r=uie(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function mie(e){const[t,r]=D.useState(void 0);return Vl(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const l=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const c=s[0];let h,m;if("borderBoxSize"in c){const b=c.borderBoxSize,E=Array.isArray(b)?b[0]:b;h=E.inlineSize,m=E.blockSize}else h=e.offsetWidth,m=e.offsetHeight;r({width:h,height:m})});return l.observe(e,{box:"border-box"}),()=>l.unobserve(e)}else r(void 0)},[e]),t}var aO="Popper",[xj,zg]=xp(aO),[vie,Ej]=xj(aO),Sj=e=>{const{__scopePopper:t,children:r}=e,[l,s]=D.useState(null);return O.jsx(vie,{scope:t,anchor:l,onAnchorChange:s,children:r})};Sj.displayName=aO;var Cj="PopperAnchor",wj=D.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:l,...s}=e,c=Ej(Cj,r),h=D.useRef(null),m=vn(t,h),b=D.useRef(null);return D.useEffect(()=>{const E=b.current;b.current=l?.current||h.current,E!==b.current&&c.onAnchorChange(b.current)}),l?null:O.jsx(bj.div,{...s,ref:m})});wj.displayName=Cj;var lO="PopperContent",[gie,yie]=xj(lO),Rj=D.forwardRef((e,t)=>{const{__scopePopper:r,side:l="bottom",sideOffset:s=0,align:c="center",alignOffset:h=0,arrowPadding:m=0,avoidCollisions:b=!0,collisionBoundary:E=[],collisionPadding:C=0,sticky:S="partial",hideWhenDetached:R=!1,updatePositionStrategy:M="optimized",onPlaced:q,...N}=e,L=Ej(lO,r),[P,U]=D.useState(null),I=vn(t,_e=>U(_e)),[Y,V]=D.useState(null),F=mie(Y),K=F?.width??0,Q=F?.height??0,he=l+(c!=="center"?"-"+c:""),de=typeof C=="number"?C:{top:0,right:0,bottom:0,left:0,...C},W=Array.isArray(E)?E:[E],se=W.length>0,le={padding:de,boundary:W.filter(xie),altBoundary:se},{refs:ae,floatingStyles:xe,placement:B,isPositioned:Z,middlewareData:te}=Hoe({strategy:"fixed",placement:he,whileElementsMounted:(..._e)=>qoe(..._e,{animationFrame:M==="always"}),elements:{reference:L.anchor},middleware:[Foe({mainAxis:s+Q,alignmentAxis:h}),b&&Koe({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?Goe():void 0,...le}),b&&Yoe({...le}),Xoe({...le,apply:({elements:_e,rects:Je,availableWidth:ie,availableHeight:ke})=>{const{width:Ee,height:Ae}=Je.reference,ot=_e.floating.style;ot.setProperty("--radix-popper-available-width",`${ie}px`),ot.setProperty("--radix-popper-available-height",`${ke}px`),ot.setProperty("--radix-popper-anchor-width",`${Ee}px`),ot.setProperty("--radix-popper-anchor-height",`${Ae}px`)}}),Y&&Zoe({element:Y,padding:m}),Eie({arrowWidth:K,arrowHeight:Q}),R&&Qoe({strategy:"referenceHidden",...le})]}),[be,re]=Aj(B),oe=Yo(q);Vl(()=>{Z&&oe?.()},[Z,oe]);const ue=te.arrow?.x,ce=te.arrow?.y,De=te.arrow?.centerOffset!==0,[je,Ke]=D.useState();return Vl(()=>{P&&Ke(window.getComputedStyle(P).zIndex)},[P]),O.jsx("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...xe,transform:Z?xe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:je,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:O.jsx(gie,{scope:r,placedSide:be,onArrowChange:V,arrowX:ue,arrowY:ce,shouldHideArrow:De,children:O.jsx(bj.div,{"data-side":be,"data-align":re,...N,ref:I,style:{...N.style,animation:Z?void 0:"none"}})})})});Rj.displayName=lO;var Tj="PopperArrow",bie={top:"bottom",right:"left",bottom:"top",left:"right"},_j=D.forwardRef(function(t,r){const{__scopePopper:l,...s}=t,c=yie(Tj,l),h=bie[c.placedSide];return O.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[h]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:O.jsx(iie,{...s,ref:r,style:{...s.style,display:"block"}})})});_j.displayName=Tj;function xie(e){return e!==null}var Eie=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:l,middlewareData:s}=t,h=s.arrow?.centerOffset!==0,m=h?0:e.arrowWidth,b=h?0:e.arrowHeight,[E,C]=Aj(r),S={start:"0%",center:"50%",end:"100%"}[C],R=(s.arrow?.x??0)+m/2,M=(s.arrow?.y??0)+b/2;let q="",N="";return E==="bottom"?(q=h?S:`${R}px`,N=`${-b}px`):E==="top"?(q=h?S:`${R}px`,N=`${l.floating.height+b}px`):E==="right"?(q=`${-b}px`,N=h?S:`${M}px`):E==="left"&&(q=`${l.floating.width+b}px`,N=h?S:`${M}px`),{data:{x:q,y:N}}}});function Aj(e){const[t,r="center"]=e.split("-");return[t,r]}var zw=Sj,Bw=wj,O_=Rj,N_=_j;function Dj(e){const t=Sie(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(wie);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Sie(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Tie(s),m=Rie(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Cie=Symbol("radix.slottable");function wie(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Cie}function Rie(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Tie(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var _ie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kw=_ie.reduce((e,t)=>{const r=Dj(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function Aie(e,t){e&&X1.flushSync(()=>e.dispatchEvent(t))}function Die(e){const t=Mie(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(Nie);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Mie(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Pie(s),m=$ie(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oie=Symbol("radix.slottable");function Nie(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oie}function $ie(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Pie(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var qie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Mj=qie.reduce((e,t)=>{const r=Die(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),kD="rovingFocusGroup.onEntryFocus",Lie={bubbles:!1,cancelable:!0},Uw="RovingFocusGroup",[$2,Oj,jie]=XM(Uw),[zie,Nj]=xp(Uw,[jie]),[Bie,kie]=zie(Uw),$j=D.forwardRef((e,t)=>O.jsx($2.Provider,{scope:e.__scopeRovingFocusGroup,children:O.jsx($2.Slot,{scope:e.__scopeRovingFocusGroup,children:O.jsx(Uie,{...e,ref:t})})}));$j.displayName=Uw;var Uie=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:l,loop:s=!1,dir:c,currentTabStopId:h,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:b,onEntryFocus:E,preventScrollOnEntryFocus:C=!1,...S}=e,R=D.useRef(null),M=vn(t,R),q=QM(c),[N,L]=br({prop:h,defaultProp:m??null,onChange:b,caller:Uw}),[P,U]=D.useState(!1),I=Yo(E),Y=Oj(r),V=D.useRef(!1),[F,K]=D.useState(0);return D.useEffect(()=>{const Q=R.current;if(Q)return Q.addEventListener(kD,I),()=>Q.removeEventListener(kD,I)},[I]),O.jsx(Bie,{scope:r,orientation:l,dir:q,loop:s,currentTabStopId:N,onItemFocus:D.useCallback(Q=>L(Q),[L]),onItemShiftTab:D.useCallback(()=>U(!0),[]),onFocusableItemAdd:D.useCallback(()=>K(Q=>Q+1),[]),onFocusableItemRemove:D.useCallback(()=>K(Q=>Q-1),[]),children:O.jsx(Mj.div,{tabIndex:P||F===0?-1:0,"data-orientation":l,...S,ref:M,style:{outline:"none",...e.style},onMouseDown:gt(e.onMouseDown,()=>{V.current=!0}),onFocus:gt(e.onFocus,Q=>{const he=!V.current;if(Q.target===Q.currentTarget&&he&&!P){const de=new CustomEvent(kD,Lie);if(Q.currentTarget.dispatchEvent(de),!de.defaultPrevented){const W=Y().filter(B=>B.focusable),se=W.find(B=>B.active),le=W.find(B=>B.id===N),xe=[se,le,...W].filter(Boolean).map(B=>B.ref.current);Lj(xe,C)}}V.current=!1}),onBlur:gt(e.onBlur,()=>U(!1))})})}),Pj="RovingFocusGroupItem",qj=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:l=!0,active:s=!1,tabStopId:c,children:h,...m}=e,b=_a(),E=c||b,C=kie(Pj,r),S=C.currentTabStopId===E,R=Oj(r),{onFocusableItemAdd:M,onFocusableItemRemove:q,currentTabStopId:N}=C;return D.useEffect(()=>{if(l)return M(),()=>q()},[l,M,q]),O.jsx($2.ItemSlot,{scope:r,id:E,focusable:l,active:s,children:O.jsx(Mj.span,{tabIndex:S?0:-1,"data-orientation":C.orientation,...m,ref:t,onMouseDown:gt(e.onMouseDown,L=>{l?C.onItemFocus(E):L.preventDefault()}),onFocus:gt(e.onFocus,()=>C.onItemFocus(E)),onKeyDown:gt(e.onKeyDown,L=>{if(L.key==="Tab"&&L.shiftKey){C.onItemShiftTab();return}if(L.target!==L.currentTarget)return;const P=Vie(L,C.orientation,C.dir);if(P!==void 0){if(L.metaKey||L.ctrlKey||L.altKey||L.shiftKey)return;L.preventDefault();let I=R().filter(Y=>Y.focusable).map(Y=>Y.ref.current);if(P==="last")I.reverse();else if(P==="prev"||P==="next"){P==="prev"&&I.reverse();const Y=I.indexOf(L.currentTarget);I=C.loop?Fie(I,Y+1):I.slice(Y+1)}setTimeout(()=>Lj(I))}}),children:typeof h=="function"?h({isCurrentTabStop:S,hasTabStop:N!=null}):h})})});qj.displayName=Pj;var Iie={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Hie(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Vie(e,t,r){const l=Hie(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(l))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(l)))return Iie[l]}function Lj(e,t=!1){const r=document.activeElement;for(const l of e)if(l===r||(l.focus({preventScroll:t}),document.activeElement!==r))return}function Fie(e,t){return e.map((r,l)=>e[(t+l)%e.length])}var Kie=$j,Gie=qj,P2=["Enter"," "],Yie=["ArrowDown","PageUp","Home"],jj=["ArrowUp","PageDown","End"],Xie=[...Yie,...jj],Qie={ltr:[...P2,"ArrowRight"],rtl:[...P2,"ArrowLeft"]},Zie={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Iw="Menu",[vw,Wie,Jie]=XM(Iw),[d0,zj]=xp(Iw,[Jie,zg,Nj]),Hw=zg(),Bj=Nj(),[kj,Bg]=d0(Iw),[eue,Vw]=d0(Iw),Uj=e=>{const{__scopeMenu:t,open:r=!1,children:l,dir:s,onOpenChange:c,modal:h=!0}=e,m=Hw(t),[b,E]=D.useState(null),C=D.useRef(!1),S=Yo(c),R=QM(s);return D.useEffect(()=>{const M=()=>{C.current=!0,document.addEventListener("pointerdown",q,{capture:!0,once:!0}),document.addEventListener("pointermove",q,{capture:!0,once:!0})},q=()=>C.current=!1;return document.addEventListener("keydown",M,{capture:!0}),()=>{document.removeEventListener("keydown",M,{capture:!0}),document.removeEventListener("pointerdown",q,{capture:!0}),document.removeEventListener("pointermove",q,{capture:!0})}},[]),O.jsx(zw,{...m,children:O.jsx(kj,{scope:t,open:r,onOpenChange:S,content:b,onContentChange:E,children:O.jsx(eue,{scope:t,onClose:D.useCallback(()=>S(!1),[S]),isUsingKeyboardRef:C,dir:R,modal:h,children:l})})})};Uj.displayName=Iw;var tue="MenuAnchor",oO=D.forwardRef((e,t)=>{const{__scopeMenu:r,...l}=e,s=Hw(r);return O.jsx(Bw,{...s,...l,ref:t})});oO.displayName=tue;var iO="MenuPortal",[nue,Ij]=d0(iO,{forceMount:void 0}),Hj=e=>{const{__scopeMenu:t,forceMount:r,children:l,container:s}=e,c=Bg(iO,t);return O.jsx(nue,{scope:t,forceMount:r,children:O.jsx(Ts,{present:r||c.open,children:O.jsx(J1,{asChild:!0,container:s,children:l})})})};Hj.displayName=iO;var jc="MenuContent",[rue,uO]=d0(jc),Vj=D.forwardRef((e,t)=>{const r=Ij(jc,e.__scopeMenu),{forceMount:l=r.forceMount,...s}=e,c=Bg(jc,e.__scopeMenu),h=Vw(jc,e.__scopeMenu);return O.jsx(vw.Provider,{scope:e.__scopeMenu,children:O.jsx(Ts,{present:l||c.open,children:O.jsx(vw.Slot,{scope:e.__scopeMenu,children:h.modal?O.jsx(aue,{...s,ref:t}):O.jsx(lue,{...s,ref:t})})})})}),aue=D.forwardRef((e,t)=>{const r=Bg(jc,e.__scopeMenu),l=D.useRef(null),s=vn(t,l);return D.useEffect(()=>{const c=l.current;if(c)return ww(c)},[]),O.jsx(sO,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:gt(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),lue=D.forwardRef((e,t)=>{const r=Bg(jc,e.__scopeMenu);return O.jsx(sO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),oue=Dj("MenuContent.ScrollLock"),sO=D.forwardRef((e,t)=>{const{__scopeMenu:r,loop:l=!1,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:h,disableOutsidePointerEvents:m,onEntryFocus:b,onEscapeKeyDown:E,onPointerDownOutside:C,onFocusOutside:S,onInteractOutside:R,onDismiss:M,disableOutsideScroll:q,...N}=e,L=Bg(jc,r),P=Vw(jc,r),U=Hw(r),I=Bj(r),Y=Wie(r),[V,F]=D.useState(null),K=D.useRef(null),Q=vn(t,K,L.onContentChange),he=D.useRef(0),de=D.useRef(""),W=D.useRef(0),se=D.useRef(null),le=D.useRef("right"),ae=D.useRef(0),xe=q?ex:D.Fragment,B=q?{as:oue,allowPinchZoom:!0}:void 0,Z=be=>{const re=de.current+be,oe=Y().filter(_e=>!_e.disabled),ue=document.activeElement,ce=oe.find(_e=>_e.ref.current===ue)?.textValue,De=oe.map(_e=>_e.textValue),je=yue(De,re,ce),Ke=oe.find(_e=>_e.textValue===je)?.ref.current;(function _e(Je){de.current=Je,window.clearTimeout(he.current),Je!==""&&(he.current=window.setTimeout(()=>_e(""),1e3))})(re),Ke&&setTimeout(()=>Ke.focus())};D.useEffect(()=>()=>window.clearTimeout(he.current),[]),f_();const te=D.useCallback(be=>le.current===se.current?.side&&xue(be,se.current?.area),[]);return O.jsx(rue,{scope:r,searchRef:de,onItemEnter:D.useCallback(be=>{te(be)&&be.preventDefault()},[te]),onItemLeave:D.useCallback(be=>{te(be)||(K.current?.focus(),F(null))},[te]),onTriggerLeave:D.useCallback(be=>{te(be)&&be.preventDefault()},[te]),pointerGraceTimerRef:W,onPointerGraceIntentChange:D.useCallback(be=>{se.current=be},[]),children:O.jsx(xe,{...B,children:O.jsx(Sw,{asChild:!0,trapped:s,onMountAutoFocus:gt(c,be=>{be.preventDefault(),K.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:h,children:O.jsx(W1,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:E,onPointerDownOutside:C,onFocusOutside:S,onInteractOutside:R,onDismiss:M,children:O.jsx(Kie,{asChild:!0,...I,dir:P.dir,orientation:"vertical",loop:l,currentTabStopId:V,onCurrentTabStopIdChange:F,onEntryFocus:gt(b,be=>{P.isUsingKeyboardRef.current||be.preventDefault()}),preventScrollOnEntryFocus:!0,children:O.jsx(O_,{role:"menu","aria-orientation":"vertical","data-state":iz(L.open),"data-radix-menu-content":"",dir:P.dir,...U,...N,ref:Q,style:{outline:"none",...N.style},onKeyDown:gt(N.onKeyDown,be=>{const oe=be.target.closest("[data-radix-menu-content]")===be.currentTarget,ue=be.ctrlKey||be.altKey||be.metaKey,ce=be.key.length===1;oe&&(be.key==="Tab"&&be.preventDefault(),!ue&&ce&&Z(be.key));const De=K.current;if(be.target!==De||!Xie.includes(be.key))return;be.preventDefault();const Ke=Y().filter(_e=>!_e.disabled).map(_e=>_e.ref.current);jj.includes(be.key)&&Ke.reverse(),vue(Ke)}),onBlur:gt(e.onBlur,be=>{be.currentTarget.contains(be.target)||(window.clearTimeout(he.current),de.current="")}),onPointerMove:gt(e.onPointerMove,gw(be=>{const re=be.target,oe=ae.current!==be.clientX;if(be.currentTarget.contains(re)&&oe){const ue=be.clientX>ae.current?"right":"left";le.current=ue,ae.current=be.clientX}}))})})})})})})});Vj.displayName=jc;var iue="MenuGroup",cO=D.forwardRef((e,t)=>{const{__scopeMenu:r,...l}=e;return O.jsx(kw.div,{role:"group",...l,ref:t})});cO.displayName=iue;var uue="MenuLabel",Fj=D.forwardRef((e,t)=>{const{__scopeMenu:r,...l}=e;return O.jsx(kw.div,{...l,ref:t})});Fj.displayName=uue;var JT="MenuItem",IP="menu.itemSelect",$_=D.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:l,...s}=e,c=D.useRef(null),h=Vw(JT,e.__scopeMenu),m=uO(JT,e.__scopeMenu),b=vn(t,c),E=D.useRef(!1),C=()=>{const S=c.current;if(!r&&S){const R=new CustomEvent(IP,{bubbles:!0,cancelable:!0});S.addEventListener(IP,M=>l?.(M),{once:!0}),Aie(S,R),R.defaultPrevented?E.current=!1:h.onClose()}};return O.jsx(Kj,{...s,ref:b,disabled:r,onClick:gt(e.onClick,C),onPointerDown:S=>{e.onPointerDown?.(S),E.current=!0},onPointerUp:gt(e.onPointerUp,S=>{E.current||S.currentTarget?.click()}),onKeyDown:gt(e.onKeyDown,S=>{const R=m.searchRef.current!=="";r||R&&S.key===" "||P2.includes(S.key)&&(S.currentTarget.click(),S.preventDefault())})})});$_.displayName=JT;var Kj=D.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:l=!1,textValue:s,...c}=e,h=uO(JT,r),m=Bj(r),b=D.useRef(null),E=vn(t,b),[C,S]=D.useState(!1),[R,M]=D.useState("");return D.useEffect(()=>{const q=b.current;q&&M((q.textContent??"").trim())},[c.children]),O.jsx(vw.ItemSlot,{scope:r,disabled:l,textValue:s??R,children:O.jsx(Gie,{asChild:!0,...m,focusable:!l,children:O.jsx(kw.div,{role:"menuitem","data-highlighted":C?"":void 0,"aria-disabled":l||void 0,"data-disabled":l?"":void 0,...c,ref:E,onPointerMove:gt(e.onPointerMove,gw(q=>{l?h.onItemLeave(q):(h.onItemEnter(q),q.defaultPrevented||q.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:gt(e.onPointerLeave,gw(q=>h.onItemLeave(q))),onFocus:gt(e.onFocus,()=>S(!0)),onBlur:gt(e.onBlur,()=>S(!1))})})})}),sue="MenuCheckboxItem",Gj=D.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:l,...s}=e;return O.jsx(Wj,{scope:e.__scopeMenu,checked:r,children:O.jsx($_,{role:"menuitemcheckbox","aria-checked":e_(r)?"mixed":r,...s,ref:t,"data-state":pO(r),onSelect:gt(s.onSelect,()=>l?.(e_(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Gj.displayName=sue;var Yj="MenuRadioGroup",[cue,fue]=d0(Yj,{value:void 0,onValueChange:()=>{}}),Xj=D.forwardRef((e,t)=>{const{value:r,onValueChange:l,...s}=e,c=Yo(l);return O.jsx(cue,{scope:e.__scopeMenu,value:r,onValueChange:c,children:O.jsx(cO,{...s,ref:t})})});Xj.displayName=Yj;var Qj="MenuRadioItem",Zj=D.forwardRef((e,t)=>{const{value:r,...l}=e,s=fue(Qj,e.__scopeMenu),c=r===s.value;return O.jsx(Wj,{scope:e.__scopeMenu,checked:c,children:O.jsx($_,{role:"menuitemradio","aria-checked":c,...l,ref:t,"data-state":pO(c),onSelect:gt(l.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});Zj.displayName=Qj;var fO="MenuItemIndicator",[Wj,due]=d0(fO,{checked:!1}),Jj=D.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:l,...s}=e,c=due(fO,r);return O.jsx(Ts,{present:l||e_(c.checked)||c.checked===!0,children:O.jsx(kw.span,{...s,ref:t,"data-state":pO(c.checked)})})});Jj.displayName=fO;var pue="MenuSeparator",ez=D.forwardRef((e,t)=>{const{__scopeMenu:r,...l}=e;return O.jsx(kw.div,{role:"separator","aria-orientation":"horizontal",...l,ref:t})});ez.displayName=pue;var hue="MenuArrow",tz=D.forwardRef((e,t)=>{const{__scopeMenu:r,...l}=e,s=Hw(r);return O.jsx(N_,{...s,...l,ref:t})});tz.displayName=hue;var dO="MenuSub",[mue,nz]=d0(dO),rz=e=>{const{__scopeMenu:t,children:r,open:l=!1,onOpenChange:s}=e,c=Bg(dO,t),h=Hw(t),[m,b]=D.useState(null),[E,C]=D.useState(null),S=Yo(s);return D.useEffect(()=>(c.open===!1&&S(!1),()=>S(!1)),[c.open,S]),O.jsx(zw,{...h,children:O.jsx(kj,{scope:t,open:l,onOpenChange:S,content:E,onContentChange:C,children:O.jsx(mue,{scope:t,contentId:_a(),triggerId:_a(),trigger:m,onTriggerChange:b,children:r})})})};rz.displayName=dO;var ew="MenuSubTrigger",az=D.forwardRef((e,t)=>{const r=Bg(ew,e.__scopeMenu),l=Vw(ew,e.__scopeMenu),s=nz(ew,e.__scopeMenu),c=uO(ew,e.__scopeMenu),h=D.useRef(null),{pointerGraceTimerRef:m,onPointerGraceIntentChange:b}=c,E={__scopeMenu:e.__scopeMenu},C=D.useCallback(()=>{h.current&&window.clearTimeout(h.current),h.current=null},[]);return D.useEffect(()=>C,[C]),D.useEffect(()=>{const S=m.current;return()=>{window.clearTimeout(S),b(null)}},[m,b]),O.jsx(oO,{asChild:!0,...E,children:O.jsx(Kj,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":iz(r.open),...e,ref:Fr(t,s.onTriggerChange),onClick:S=>{e.onClick?.(S),!(e.disabled||S.defaultPrevented)&&(S.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:gt(e.onPointerMove,gw(S=>{c.onItemEnter(S),!S.defaultPrevented&&!e.disabled&&!r.open&&!h.current&&(c.onPointerGraceIntentChange(null),h.current=window.setTimeout(()=>{r.onOpenChange(!0),C()},100))})),onPointerLeave:gt(e.onPointerLeave,gw(S=>{C();const R=r.content?.getBoundingClientRect();if(R){const M=r.content?.dataset.side,q=M==="right",N=q?-5:5,L=R[q?"left":"right"],P=R[q?"right":"left"];c.onPointerGraceIntentChange({area:[{x:S.clientX+N,y:S.clientY},{x:L,y:R.top},{x:P,y:R.top},{x:P,y:R.bottom},{x:L,y:R.bottom}],side:M}),window.clearTimeout(m.current),m.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(S),S.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:gt(e.onKeyDown,S=>{const R=c.searchRef.current!=="";e.disabled||R&&S.key===" "||Qie[l.dir].includes(S.key)&&(r.onOpenChange(!0),r.content?.focus(),S.preventDefault())})})})});az.displayName=ew;var lz="MenuSubContent",oz=D.forwardRef((e,t)=>{const r=Ij(jc,e.__scopeMenu),{forceMount:l=r.forceMount,...s}=e,c=Bg(jc,e.__scopeMenu),h=Vw(jc,e.__scopeMenu),m=nz(lz,e.__scopeMenu),b=D.useRef(null),E=vn(t,b);return O.jsx(vw.Provider,{scope:e.__scopeMenu,children:O.jsx(Ts,{present:l||c.open,children:O.jsx(vw.Slot,{scope:e.__scopeMenu,children:O.jsx(sO,{id:m.contentId,"aria-labelledby":m.triggerId,...s,ref:E,align:"start",side:h.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:C=>{h.isUsingKeyboardRef.current&&b.current?.focus(),C.preventDefault()},onCloseAutoFocus:C=>C.preventDefault(),onFocusOutside:gt(e.onFocusOutside,C=>{C.target!==m.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:gt(e.onEscapeKeyDown,C=>{h.onClose(),C.preventDefault()}),onKeyDown:gt(e.onKeyDown,C=>{const S=C.currentTarget.contains(C.target),R=Zie[h.dir].includes(C.key);S&&R&&(c.onOpenChange(!1),m.trigger?.focus(),C.preventDefault())})})})})})});oz.displayName=lz;function iz(e){return e?"open":"closed"}function e_(e){return e==="indeterminate"}function pO(e){return e_(e)?"indeterminate":e?"checked":"unchecked"}function vue(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function gue(e,t){return e.map((r,l)=>e[(t+l)%e.length])}function yue(e,t,r){const s=t.length>1&&Array.from(t).every(E=>E===t[0])?t[0]:t,c=r?e.indexOf(r):-1;let h=gue(e,Math.max(c,0));s.length===1&&(h=h.filter(E=>E!==r));const b=h.find(E=>E.toLowerCase().startsWith(s.toLowerCase()));return b!==r?b:void 0}function bue(e,t){const{x:r,y:l}=e;let s=!1;for(let c=0,h=t.length-1;c<t.length;h=c++){const m=t[c],b=t[h],E=m.x,C=m.y,S=b.x,R=b.y;C>l!=R>l&&r<(S-E)*(l-C)/(R-C)+E&&(s=!s)}return s}function xue(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return bue(r,t)}function gw(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Eue=Uj,Sue=oO,Cue=Hj,wue=Vj,Rue=cO,Tue=Fj,_ue=$_,Aue=Gj,Due=Xj,Mue=Zj,Oue=Jj,Nue=ez,$ue=tz,Pue=rz,que=az,Lue=oz,P_="DropdownMenu",[jue]=xp(P_,[zj]),vi=zj(),[zue,uz]=jue(P_),sz=e=>{const{__scopeDropdownMenu:t,children:r,dir:l,open:s,defaultOpen:c,onOpenChange:h,modal:m=!0}=e,b=vi(t),E=D.useRef(null),[C,S]=br({prop:s,defaultProp:c??!1,onChange:h,caller:P_});return O.jsx(zue,{scope:t,triggerId:_a(),triggerRef:E,contentId:_a(),open:C,onOpenChange:S,onOpenToggle:D.useCallback(()=>S(R=>!R),[S]),modal:m,children:O.jsx(Eue,{...b,open:C,onOpenChange:S,dir:l,modal:m,children:r})})};sz.displayName=P_;var cz="DropdownMenuTrigger",fz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:l=!1,...s}=e,c=uz(cz,r),h=vi(r);return O.jsx(Sue,{asChild:!0,...h,children:O.jsx(Yle.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":l?"":void 0,disabled:l,...s,ref:Fr(t,c.triggerRef),onPointerDown:gt(e.onPointerDown,m=>{!l&&m.button===0&&m.ctrlKey===!1&&(c.onOpenToggle(),c.open||m.preventDefault())}),onKeyDown:gt(e.onKeyDown,m=>{l||(["Enter"," "].includes(m.key)&&c.onOpenToggle(),m.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(m.key)&&m.preventDefault())})})})});fz.displayName=cz;var Bue="DropdownMenuPortal",dz=e=>{const{__scopeDropdownMenu:t,...r}=e,l=vi(t);return O.jsx(Cue,{...l,...r})};dz.displayName=Bue;var pz="DropdownMenuContent",hz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=uz(pz,r),c=vi(r),h=D.useRef(!1);return O.jsx(wue,{id:s.contentId,"aria-labelledby":s.triggerId,...c,...l,ref:t,onCloseAutoFocus:gt(e.onCloseAutoFocus,m=>{h.current||s.triggerRef.current?.focus(),h.current=!1,m.preventDefault()}),onInteractOutside:gt(e.onInteractOutside,m=>{const b=m.detail.originalEvent,E=b.button===0&&b.ctrlKey===!0,C=b.button===2||E;(!s.modal||C)&&(h.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hz.displayName=pz;var kue="DropdownMenuGroup",mz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Rue,{...s,...l,ref:t})});mz.displayName=kue;var Uue="DropdownMenuLabel",vz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Tue,{...s,...l,ref:t})});vz.displayName=Uue;var Iue="DropdownMenuItem",gz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(_ue,{...s,...l,ref:t})});gz.displayName=Iue;var Hue="DropdownMenuCheckboxItem",yz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Aue,{...s,...l,ref:t})});yz.displayName=Hue;var Vue="DropdownMenuRadioGroup",bz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Due,{...s,...l,ref:t})});bz.displayName=Vue;var Fue="DropdownMenuRadioItem",xz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Mue,{...s,...l,ref:t})});xz.displayName=Fue;var Kue="DropdownMenuItemIndicator",Ez=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Oue,{...s,...l,ref:t})});Ez.displayName=Kue;var Gue="DropdownMenuSeparator",Sz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Nue,{...s,...l,ref:t})});Sz.displayName=Gue;var Yue="DropdownMenuArrow",Xue=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx($ue,{...s,...l,ref:t})});Xue.displayName=Yue;var Que=e=>{const{__scopeDropdownMenu:t,children:r,open:l,onOpenChange:s,defaultOpen:c}=e,h=vi(t),[m,b]=br({prop:l,defaultProp:c??!1,onChange:s,caller:"DropdownMenuSub"});return O.jsx(Pue,{...h,open:m,onOpenChange:b,children:r})},Zue="DropdownMenuSubTrigger",Cz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(que,{...s,...l,ref:t})});Cz.displayName=Zue;var Wue="DropdownMenuSubContent",wz=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...l}=e,s=vi(r);return O.jsx(Lue,{...s,...l,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wz.displayName=Wue;var Jue=sz,ese=fz,Rz=dz,tse=hz,nse=mz,rse=vz,ase=gz,lse=yz,ose=bz,ise=xz,Tz=Ez,use=Sz,sse=Que,cse=Cz,fse=wz;const _z=e=>O.jsx(Jue,{"data-slot":"menu",...e}),Az=e=>O.jsx(ese,{"data-slot":"menu-trigger",...e}),dse=e=>O.jsx(nse,{"data-slot":"menu-group",...e}),pse=e=>O.jsx(Rz,{"data-slot":"menu-portal",...e}),Dz=e=>O.jsx(sse,{"data-slot":"menu-sub",...e}),hse=e=>O.jsx(ose,{"data-slot":"menu-radio-group",...e}),Mz=({className:e,inset:t,children:r,...l})=>O.jsxs(cse,{"data-slot":"menu-sub-trigger",className:Fe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state='open']:bg-accent",t&&"pl-8",e),...l,children:[r,O.jsx(Rw,{className:"ml-auto h-4 w-4"})]}),Oz=({className:e,...t})=>O.jsx(fse,{"data-slot":"menu-sub-content",className:Fe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state='open']:animate-in data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='open']:fade-in-0 data-[state='closed']:zoom-out-95 data-[state='open']:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}),Nz=({className:e,sideOffset:t=4,...r})=>O.jsx(Rz,{"data-slot":"menu-portal",children:O.jsx(tse,{"data-slot":"menu-content",sideOffset:t,className:Fe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state='open']:animate-in data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='open']:fade-in-0 data-[state='closed']:zoom-out-95 data-[state='open']:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}),$z=({className:e,inset:t,...r})=>O.jsx(ase,{"data-slot":"menu-item",className:Fe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}),Pz=({className:e,children:t,checked:r,...l})=>O.jsxs(lse,{"data-slot":"menu-checkbox-item",className:Fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...l,children:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(Tz,{children:O.jsx($T,{className:"h-4 w-4"})})}),t]}),qz=({className:e,children:t,...r})=>O.jsxs(ise,{"data-slot":"menu-radio-item",className:Fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(Tz,{children:O.jsx(iK,{className:"h-2 w-2 fill-current"})})}),t]}),Lz=({className:e,inset:t,...r})=>O.jsx(rse,{"data-slot":"menu-label",className:Fe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}),jz=({className:e,...t})=>O.jsx(use,{"data-slot":"menu-separator",className:Fe("-mx-1 my-1 h-px bg-muted",e),...t}),zz=({className:e,keys:t,handler:r,options:l={},...s})=>(nj(t,r,l),O.jsx("span",{"data-slot":"menu-shortcut",className:Fe("ml-auto text-xs tracking-widest opacity-60",e),...s})),Bz=(e,t)=>{switch(e.type){case"item":return O.jsxs($z,{...e,children:[e.label," ",t]});case"checkbox":return O.jsxs(Pz,{...e,children:[e.label," ",t]});case"radio":return O.jsxs(qz,{...e,children:[e.label," ",t]});case"label":return O.jsxs(Lz,{...e,children:[e.label," "]});case"separator":return O.jsx(jz,{...e});case"submenu":return O.jsxs(Dz,{children:[O.jsx(Mz,{...e,children:e.label}),O.jsx(Oz,{children:e.items?.map((r,l)=>O.jsx(k.Fragment,{children:Bz(r)},l))})]});default:return null}},mse=({trigger:e,items:t,contentProps:r,side:l="bottom",offset:s})=>O.jsxs(_z,{children:[O.jsx(Az,{asChild:!0,children:e}),O.jsx(Nz,{side:l,sideOffset:s,...r,children:t.map(({shortcut:c,onShortcut:h,shortcutOptions:m,...b},E)=>O.jsx(k.Fragment,{children:Bz(b,c&&O.jsx(zz,{keys:c,handler:C=>h?.(C),options:m,children:c}))},E))})]}),kz=$m("inline-flex items-center relative overflow-hidden bg-gray-100 gap-1 px-2.5 py-0.5 text-xs font-normal transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{rounded:{default:"rounded-(--radius-tag)",full:"rounded-full",square:"rounded-sm"},variant:{primary:"bg-primary border-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary border-secondary !text-secondary-foreground hover:bg-secondary/80",error:"bg-error border-error text-error-foreground hover:bg-error/80",success:"bg-success border-success text-success-foreground hover:bg-success/80",outline:"border border-foreground text-foreground",borderless:"text-foreground"}},defaultVariants:{rounded:"default",variant:"primary"}}),q2=({className:e,color:t,variant:r,rounded:l,icon:s,closable:c,onClose:h,children:m,...b})=>{const E=!!t&&(r==="outline"||r==="borderless"),C=!!t&&!r;return O.jsxs("div",{"data-slot":"tag",className:Fe(kz({variant:r,rounded:l}),E&&"bg-white",C&&" text-white",!!s&&"pl-1.5",!!c&&"pr-1.5",e),style:{...E&&{color:t,borderColor:t},...C&&{borderColor:t,backgroundColor:t}},...b,children:[s,m,c&&O.jsx("button",{type:"button","data-slot":"tag-close",className:"z-10 h-4 w-4 cursor-pointer",onClick:S=>{S.stopPropagation(),h()},children:O.jsx(h_,{"data-slot":"tag-close-icon"})}),O.jsx("span",{"data-slot":"tag-overlay",className:"w-full h-full absolute top-0 left-0",style:{...E&&{opacity:.13,backgroundColor:t}}})]})};function Uz(e){const t=vse(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(yse);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function vse(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=xse(s),m=bse(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gse=Symbol("radix.slottable");function yse(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gse}function bse(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function xse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Ese=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Iz=Ese.reduce((e,t)=>{const r=Uz(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),q_="Popover",[Hz]=xp(q_,[zg]),Fw=zg(),[Sse,kg]=Hz(q_),Vz=e=>{const{__scopePopover:t,children:r,open:l,defaultOpen:s,onOpenChange:c,modal:h=!1}=e,m=Fw(t),b=D.useRef(null),[E,C]=D.useState(!1),[S,R]=br({prop:l,defaultProp:s??!1,onChange:c,caller:q_});return O.jsx(zw,{...m,children:O.jsx(Sse,{scope:t,contentId:_a(),triggerRef:b,open:S,onOpenChange:R,onOpenToggle:D.useCallback(()=>R(M=>!M),[R]),hasCustomAnchor:E,onCustomAnchorAdd:D.useCallback(()=>C(!0),[]),onCustomAnchorRemove:D.useCallback(()=>C(!1),[]),modal:h,children:r})})};Vz.displayName=q_;var Fz="PopoverAnchor",Cse=D.forwardRef((e,t)=>{const{__scopePopover:r,...l}=e,s=kg(Fz,r),c=Fw(r),{onCustomAnchorAdd:h,onCustomAnchorRemove:m}=s;return D.useEffect(()=>(h(),()=>m()),[h,m]),O.jsx(Bw,{...c,...l,ref:t})});Cse.displayName=Fz;var Kz="PopoverTrigger",Gz=D.forwardRef((e,t)=>{const{__scopePopover:r,...l}=e,s=kg(Kz,r),c=Fw(r),h=vn(t,s.triggerRef),m=O.jsx(Iz.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Wz(s.open),...l,ref:h,onClick:gt(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?m:O.jsx(Bw,{asChild:!0,...c,children:m})});Gz.displayName=Kz;var hO="PopoverPortal",[wse,Rse]=Hz(hO,{forceMount:void 0}),Yz=e=>{const{__scopePopover:t,forceMount:r,children:l,container:s}=e,c=kg(hO,t);return O.jsx(wse,{scope:t,forceMount:r,children:O.jsx(Ts,{present:r||c.open,children:O.jsx(J1,{asChild:!0,container:s,children:l})})})};Yz.displayName=hO;var G1="PopoverContent",Xz=D.forwardRef((e,t)=>{const r=Rse(G1,e.__scopePopover),{forceMount:l=r.forceMount,...s}=e,c=kg(G1,e.__scopePopover);return O.jsx(Ts,{present:l||c.open,children:c.modal?O.jsx(_se,{...s,ref:t}):O.jsx(Ase,{...s,ref:t})})});Xz.displayName=G1;var Tse=Uz("PopoverContent.RemoveScroll"),_se=D.forwardRef((e,t)=>{const r=kg(G1,e.__scopePopover),l=D.useRef(null),s=vn(t,l),c=D.useRef(!1);return D.useEffect(()=>{const h=l.current;if(h)return ww(h)},[]),O.jsx(ex,{as:Tse,allowPinchZoom:!0,children:O.jsx(Qz,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:gt(e.onCloseAutoFocus,h=>{h.preventDefault(),c.current||r.triggerRef.current?.focus()}),onPointerDownOutside:gt(e.onPointerDownOutside,h=>{const m=h.detail.originalEvent,b=m.button===0&&m.ctrlKey===!0,E=m.button===2||b;c.current=E},{checkForDefaultPrevented:!1}),onFocusOutside:gt(e.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ase=D.forwardRef((e,t)=>{const r=kg(G1,e.__scopePopover),l=D.useRef(!1),s=D.useRef(!1);return O.jsx(Qz,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(l.current||r.triggerRef.current?.focus(),c.preventDefault()),l.current=!1,s.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(l.current=!0,c.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const h=c.target;r.triggerRef.current?.contains(h)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&s.current&&c.preventDefault()}})}),Qz=D.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:l,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:h,onEscapeKeyDown:m,onPointerDownOutside:b,onFocusOutside:E,onInteractOutside:C,...S}=e,R=kg(G1,r),M=Fw(r);return f_(),O.jsx(Sw,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:s,onUnmountAutoFocus:c,children:O.jsx(W1,{asChild:!0,disableOutsidePointerEvents:h,onInteractOutside:C,onEscapeKeyDown:m,onPointerDownOutside:b,onFocusOutside:E,onDismiss:()=>R.onOpenChange(!1),children:O.jsx(O_,{"data-state":Wz(R.open),role:"dialog",id:R.contentId,...M,...S,ref:t,style:{...S.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Zz="PopoverClose",Dse=D.forwardRef((e,t)=>{const{__scopePopover:r,...l}=e,s=kg(Zz,r);return O.jsx(Iz.button,{type:"button",...l,ref:t,onClick:gt(e.onClick,()=>s.onOpenChange(!1))})});Dse.displayName=Zz;var Mse="PopoverArrow",Ose=D.forwardRef((e,t)=>{const{__scopePopover:r,...l}=e,s=Fw(r);return O.jsx(N_,{...s,...l,ref:t})});Ose.displayName=Mse;function Wz(e){return e?"open":"closed"}var Nse=Vz,$se=Gz,Pse=Yz,qse=Xz;const Kw=e=>O.jsx(Nse,{"data-slot":"popover",...e}),Gw=e=>O.jsx($se,{"data-slot":"popover-trigger",...e}),Yw=({className:e,align:t="center",sideOffset:r=4,matchTriggerWidth:l=!1,style:s,focus:c=!0,...h})=>O.jsx(Pse,{children:O.jsx(qse,{"data-slot":"popover-content",align:t,sideOffset:r,onOpenAutoFocus:m=>{!c&&m.preventDefault(),h?.onOpenAutoFocus?.(m)},className:Fe("z-50 w-72 p-4 rounded-md border bg-popover text-popover-foreground shadow-md outline-none open:animate-in closed:animate-out closed:fade-out-0 open:fade-in-0 closed:zoom-out-95 open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),style:{...s,...l&&{width:"var(--radix-popper-anchor-width)"}},...h})}),Lse=e=>{const{trigger:t,children:r,rootProps:l,triggerProps:s,contentProps:c,triggerAsChild:h=!0,matchTriggerWidth:m,triggerClassName:b,contentClassName:E,side:C="bottom",offset:S}=Tw("Popover",e,{triggerAsChild:!0,side:"bottom"});return O.jsxs(Kw,{...l,children:[O.jsx(Gw,{asChild:h,className:b,...s,children:t}),O.jsx(Yw,{className:E,matchTriggerWidth:m,side:C,sideOffset:S,...c,children:r})]})},HP=$m("m-1 transition ease-in-out delay-150 duration-300",{variants:{variant:{default:"border-foreground/10 border text-foreground bg-card hover:bg-card/80",primary:"border-foreground/10 border text-foreground bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-foreground/60 border bg-secondary text-secondary-foreground hover:bg-secondary/80",error:"border-transparent bg-error text-error-foreground hover:bg-error/80"}},defaultVariants:{variant:"default"}}),jse=({valueKey:e,values:t,setValues:r,items:l,maxCount:s,setIsPopoverOpen:c})=>{const h=R=>{if(R.key==="Enter")c(!0);else if(R.key==="Backspace"&&!R.currentTarget.value){const M=[...t];M.pop(),r?.(M)}},m=R=>{const M=t.includes(R)?t.filter(q=>q!==R):[...t,R];r?.(M)},b=()=>{r?.([])};return{handleInputKeyDown:h,toggleOption:m,handleClear:b,handleTogglePopover:()=>{c(R=>!R)},clearExtraOptions:()=>{const R=t.slice(0,s);r?.(R)},toggleAll:()=>{const R=l.filter(M=>!M.disabled);if(t.length===R.length)b();else{const M=R.map(q=>q[e]);r?.(M)}}}},zse=({items:e=[],value:t,valueKey:r="value",labelKey:l="label",onChange:s,variant:c,defaultValue:h=[],placeholder:m="Seleccionar",maxCount:b=3,className:E,renderOption:C=L=>L[l],withCheckbox:S=!1,showSearch:R=!0,showSelectAll:M=!0,rootProps:q,...N})=>{const[L=[],P]=br({prop:t,onChange:s,defaultProp:h}),[U,I]=br({prop:N.open,onChange:N.onOpenChange,defaultProp:N.defaultOpen||!1}),Y=D.useMemo(()=>e.filter(W=>!W.disabled),[e]),{handleInputKeyDown:V,toggleOption:F,handleClear:K,handleTogglePopover:Q,clearExtraOptions:he,toggleAll:de}=jse({valueKey:r,values:L,setValues:P,items:e,maxCount:b,setIsPopoverOpen:I});return O.jsxs(Kw,{open:U,onOpenChange:I,"data-slot":"multi-select",...q,children:[O.jsx(Gw,{asChild:!0,"data-slot":"multi-select-trigger",children:O.jsx(hi,{...N,onClick:Q,className:Fe("flex w-full p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit",E),children:L.length>0?O.jsxs("div",{className:"flex justify-between items-center w-full",children:[O.jsxs("div",{className:"flex flex-wrap items-center","data-slot":"multi-select-tags",children:[L.slice(0,b).map(W=>{const se=e.find(ae=>ae[r]===W),le=se?.icon;return O.jsxs(q2,{"data-slot":"multi-select-tag",className:Fe(HP({variant:c})),closable:!0,onClose:()=>F(W),children:[le&&O.jsx(le,{className:"h-4 w-4 mr-2"}),se&&C?.(se)]},W)}),L.length>b&&O.jsx(q2,{"data-slot":"multi-select-tag",className:Fe(HP({variant:c})),closable:!0,onClose:he,children:`+ ${L.length-b} más`})]}),O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsx(h_,{"data-slot":"multi-select-clear",className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:W=>{W.stopPropagation(),K()}}),O.jsx(CL,{"data-slot":"multi-select-divider",orientation:"vertical",className:"flex min-h-6 h-full"}),O.jsx(PT,{"data-slot":"multi-select-trigger-icon",className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):O.jsxs("div",{className:"flex items-center justify-between w-full mx-auto","data-slot":"multi-select-trigger-empty",children:[O.jsx("span",{className:"text-sm text-foreground font-normal mx-2","data-slot":"multi-select-placeholder",children:m}),O.jsx(PT,{"data-slot":"multi-select-trigger-icon",className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),O.jsx(Yw,{"data-slot":"multi-select-content",className:"p-0",matchTriggerWidth:!0,align:"start",asChild:!0,onEscapeKeyDown:()=>I(!1),children:O.jsxs(Dw,{children:[R&&O.jsx(x_,{"data-slot":"multi-select-input",placeholder:"Buscar...",onKeyDown:V}),O.jsxs(E_,{"data-slot":"multi-select-list",children:[O.jsx(S_,{"data-slot":"multi-select-empty",children:"No results found."}),O.jsxs(b8,{"data-slot":"multi-select-group",children:[M&&O.jsxs(sw,{"data-slot":"multi-select-item",onSelect:de,className:Fe("cursor-pointer",!S&&L.length===Y.length&&"bg-accent text-accent-foreground"),children:[S&&O.jsx("div",{className:Fe("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",L.length===Y.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:O.jsx($T,{className:"h-4 w-4"})}),O.jsx("span",{children:"(Seleccionar todo)"})]},"all"),e.map(W=>{const se=L.includes(W[r]);return O.jsxs(sw,{"data-slot":"multi-select-item",onSelect:()=>!W.disabled&&F(W[r]),className:Fe(W.disabled?"!bg-neutral-50 !text-neutral-400":"cursor-pointer",!S&&se&&"!bg-accent !text-accent-foreground"),children:[S&&O.jsx("div",{className:Fe("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",se?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:O.jsx($T,{className:"h-4 w-4"})}),W.icon&&O.jsx(W.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),O.jsx("span",{children:C?.(W)})]},W[r])})]})]})]})})]})},Bse=({value:e,onChange:t,defaultValue:r,className:l,min:s,max:c,...h})=>{const[m,b]=br({prop:e,onChange:t,defaultProp:r}),E=m??s??0,C=q=>{const N=parseInt(q.target.value,10);b(N)},S=()=>{if(sr.isUndefined(m)&&sr.isNumber(s))return b(s??0);const q=E+1;(sr.isUndefined(c)||q<=c)&&b(q)},R=()=>{if(sr.isUndefined(m)&&sr.isNumber(c))return b(c??0);const q=E-1;(sr.isUndefined(s)||q>=s)&&b(q)},M=()=>{const q=sr.isNumber(s)&&E<s,N=sr.isNumber(c)&&E>c;q?b(s):N&&b(c)};return O.jsxs("div",{className:"relative w-full","data-slot":"number-input-container",children:[O.jsx("input",{...h,type:"number",value:m,onChange:C,onBlur:M,min:s,max:c,className:Fe("numberInput","h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","file:border-0 file:bg-transparent file:text-sm file:font-medium",l),"data-slot":"number-input"}),O.jsxs("div",{className:"absolute right-0 top-0 h-full w-6 py-1 gap-px justify-center items-center flex flex-col border-l border-input overflow-hidden",children:[O.jsx(hi,{variant:"ghost",size:"icon",onClick:S,className:"h-4 w-4 grow rounded-sm","data-testid":"increment-trigger","data-slot":"number-input-increment",children:O.jsx(q7,{"data-slot":"number-input-increment-icon"})}),O.jsx(hi,{variant:"ghost",size:"icon",onClick:R,className:"h-4 w-4 grow rounded-sm","data-testid":"decrement-trigger","data-slot":"number-input-decrement",children:O.jsx(P7,{"data-slot":"number-input-decrement-icon"})})]})]})},O1=({isActive:e=!1,...t})=>O.jsx("button",{...t,"data-slot":"pagination-option","data-active":e,"data-dots":t.children===Dg,className:Fe("transition-colors border py-2 px-4 w-[50px] h-full data-[active=false]:hover:bg-accent","data-[active=true]:bg-primary data-[active=true]:text-primary-foreground data-[active=true]:border-transparent data-[active=true]:hover:bg-primary/90",t.className)}),kse=({optionProps:e,className:t,containerProps:r,...l})=>{const{paginationRange:s,currentPage:c,goTo:h,maxPage:m,next:b,prev:E,isLastPage:C,isFirstPage:S}=rj(l);return O.jsxs("div",{...r,className:Fe("flex items-end select-none h-10",r?.className,t),"data-slot":"pagination",children:[O.jsxs(O1,{...e,disabled:S,onClick:()=>h(1),className:Fe("rounded-l-md",e?.className),children:[O.jsx(QF,{"data-slot":"pagination-option-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a primera página"})]}),O.jsxs(O1,{...e,onClick:E,disabled:S,children:[O.jsx(fM,{"data-slot":"pagination-option-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a página anterior"})]}),s.map(R=>O.jsx(O.Fragment,{children:R===Dg?O.jsx(O1,{className:Fe("pointer-events-none",e?.className),children:Dg},R):k.createElement(O1,{...e,isActive:R===c,onClick:()=>h(R),key:R},R,O.jsxs("span",{className:"sr-only",children:["Ir a la página ",R]}))})),O.jsxs(O1,{...e,onClick:b,disabled:C,children:[O.jsx(Rw,{"data-slot":"pagination-option-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a próxima página"})]}),O.jsxs(O1,{...e,disabled:C,onClick:()=>h(m),className:Fe("rounded-r-md",e?.className),children:[O.jsx(WF,{"data-slot":"pagination-option-icon"}),O.jsx("span",{className:"sr-only",children:"Ir a última página"})]})]})},Use=({className:e,containerClassName:t,showIcon:r=O.jsx(pK,{className:"h-4 w-4"}),hideIcon:l=O.jsx(fK,{className:"h-4 w-4"}),onShow:s,onHide:c,toggleable:h=!0,...m})=>{const[b,E]=aj(!1),C=()=>{E(),b?c?.():s?.()};return O.jsxs("div",{className:Fe("relative",t),"data-slot":"password",children:[O.jsx(ej,{...m,type:b?"text":"password",className:Fe("pr-10","[&::-ms-reveal]:hidden [&::-ms-clear]:hidden",e)}),O.jsx("button",{"data-slot":"password-toggle",type:"button",onClick:C,disabled:!h,className:Fe("absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",h?"hover:text-gray-700":"opacity-50 cursor-not-allowed"),children:b?l:r})]})},Ise=({items:e=[],valueKey:t="value",labelKey:r="label",value:l,onChange:s,defaultValue:c,renderOption:h=N=>N?.[r],triggerProps:m,contentClassName:b,contentProps:E,itemClassName:C,itemProps:S,className:R,placeholder:M="Seleccionar",...q})=>{const[N,L]=br({prop:l,onChange:P=>{if(!s)return;const U=e.find(I=>I[t]===P);s?.(P,U)},defaultProp:c});return O.jsxs(MB,{...q,onValueChange:L,value:N,children:[O.jsx($B,{className:R,...m,children:O.jsx(NB,{placeholder:M})}),O.jsx(LB,{className:b,...E,children:O.jsx(OB,{children:e.map((P,U)=>k.createElement(zB,{...S,className:C,key:U,disabled:P?.disabled,value:P[t]},h?.(P)))})})]})};function VP(e,[t,r]){return Math.min(r,Math.max(t,e))}function Jz(e){const t=Hse(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(Fse);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Hse(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Gse(s),m=Kse(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vse=Symbol("radix.slottable");function Fse(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vse}function Kse(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Gse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Yse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_s=Yse.reduce((e,t)=>{const r=Jz(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function Xse(e){const t=D.useRef({value:e,previous:e});return D.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Qse(e){const t=Zse(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(Jse);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function Zse(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=tce(s),m=ece(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wse=Symbol("radix.slottable");function Jse(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wse}function ece(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function tce(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var nce=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rce=nce.reduce((e,t)=>{const r=Qse(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),eB=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ace="VisuallyHidden",tB=D.forwardRef((e,t)=>O.jsx(rce.span,{...e,ref:t,style:{...eB,...e.style}}));tB.displayName=ace;var lce=tB,oce=[" ","Enter","ArrowUp","ArrowDown"],ice=[" ","Enter"],a0="Select",[L_,j_,uce]=XM(a0),[lx]=xp(a0,[uce,zg]),z_=zg(),[sce,Ug]=lx(a0),[cce,fce]=lx(a0),nB=e=>{const{__scopeSelect:t,children:r,open:l,defaultOpen:s,onOpenChange:c,value:h,defaultValue:m,onValueChange:b,dir:E,name:C,autoComplete:S,disabled:R,required:M,form:q}=e,N=z_(t),[L,P]=D.useState(null),[U,I]=D.useState(null),[Y,V]=D.useState(!1),F=QM(E),[K,Q]=br({prop:l,defaultProp:s??!1,onChange:c,caller:a0}),[he,de]=br({prop:h,defaultProp:m,onChange:b,caller:a0}),W=D.useRef(null),se=L?q||!!L.closest("form"):!0,[le,ae]=D.useState(new Set),xe=Array.from(le).map(B=>B.props.value).join(";");return O.jsx(zw,{...N,children:O.jsxs(sce,{required:M,scope:t,trigger:L,onTriggerChange:P,valueNode:U,onValueNodeChange:I,valueNodeHasChildren:Y,onValueNodeHasChildrenChange:V,contentId:_a(),value:he,onValueChange:de,open:K,onOpenChange:Q,dir:F,triggerPointerDownPosRef:W,disabled:R,children:[O.jsx(L_.Provider,{scope:t,children:O.jsx(cce,{scope:e.__scopeSelect,onNativeOptionAdd:D.useCallback(B=>{ae(Z=>new Set(Z).add(B))},[]),onNativeOptionRemove:D.useCallback(B=>{ae(Z=>{const te=new Set(Z);return te.delete(B),te})},[]),children:r})}),se?O.jsxs(TB,{"aria-hidden":!0,required:M,tabIndex:-1,name:C,autoComplete:S,value:he,onChange:B=>de(B.target.value),disabled:R,form:q,children:[he===void 0?O.jsx("option",{value:""}):null,Array.from(le)]},xe):null]})})};nB.displayName=a0;var rB="SelectTrigger",aB=D.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:l=!1,...s}=e,c=z_(r),h=Ug(rB,r),m=h.disabled||l,b=vn(t,h.onTriggerChange),E=j_(r),C=D.useRef("touch"),[S,R,M]=AB(N=>{const L=E().filter(I=>!I.disabled),P=L.find(I=>I.value===h.value),U=DB(L,N,P);U!==void 0&&h.onValueChange(U.value)}),q=N=>{m||(h.onOpenChange(!0),M()),N&&(h.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})};return O.jsx(Bw,{asChild:!0,...c,children:O.jsx(_s.button,{type:"button",role:"combobox","aria-controls":h.contentId,"aria-expanded":h.open,"aria-required":h.required,"aria-autocomplete":"none",dir:h.dir,"data-state":h.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":_B(h.value)?"":void 0,...s,ref:b,onClick:gt(s.onClick,N=>{N.currentTarget.focus(),C.current!=="mouse"&&q(N)}),onPointerDown:gt(s.onPointerDown,N=>{C.current=N.pointerType;const L=N.target;L.hasPointerCapture(N.pointerId)&&L.releasePointerCapture(N.pointerId),N.button===0&&N.ctrlKey===!1&&N.pointerType==="mouse"&&(q(N),N.preventDefault())}),onKeyDown:gt(s.onKeyDown,N=>{const L=S.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&R(N.key),!(L&&N.key===" ")&&oce.includes(N.key)&&(q(),N.preventDefault())})})})});aB.displayName=rB;var lB="SelectValue",oB=D.forwardRef((e,t)=>{const{__scopeSelect:r,className:l,style:s,children:c,placeholder:h="",...m}=e,b=Ug(lB,r),{onValueNodeHasChildrenChange:E}=b,C=c!==void 0,S=vn(t,b.onValueNodeChange);return Vl(()=>{E(C)},[E,C]),O.jsx(_s.span,{...m,ref:S,style:{pointerEvents:"none"},children:_B(b.value)?O.jsx(O.Fragment,{children:h}):c})});oB.displayName=lB;var dce="SelectIcon",iB=D.forwardRef((e,t)=>{const{__scopeSelect:r,children:l,...s}=e;return O.jsx(_s.span,{"aria-hidden":!0,...s,ref:t,children:l||"▼"})});iB.displayName=dce;var pce="SelectPortal",uB=e=>O.jsx(J1,{asChild:!0,...e});uB.displayName=pce;var l0="SelectContent",sB=D.forwardRef((e,t)=>{const r=Ug(l0,e.__scopeSelect),[l,s]=D.useState();if(Vl(()=>{s(new DocumentFragment)},[]),!r.open){const c=l;return c?X1.createPortal(O.jsx(cB,{scope:e.__scopeSelect,children:O.jsx(L_.Slot,{scope:e.__scopeSelect,children:O.jsx("div",{children:e.children})})}),c):null}return O.jsx(fB,{...e,ref:t})});sB.displayName=l0;var Gf=10,[cB,Ig]=lx(l0),hce="SelectContentImpl",mce=Jz("SelectContent.RemoveScroll"),fB=D.forwardRef((e,t)=>{const{__scopeSelect:r,position:l="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:c,onPointerDownOutside:h,side:m,sideOffset:b,align:E,alignOffset:C,arrowPadding:S,collisionBoundary:R,collisionPadding:M,sticky:q,hideWhenDetached:N,avoidCollisions:L,...P}=e,U=Ug(l0,r),[I,Y]=D.useState(null),[V,F]=D.useState(null),K=vn(t,_e=>Y(_e)),[Q,he]=D.useState(null),[de,W]=D.useState(null),se=j_(r),[le,ae]=D.useState(!1),xe=D.useRef(!1);D.useEffect(()=>{if(I)return ww(I)},[I]),f_();const B=D.useCallback(_e=>{const[Je,...ie]=se().map(Ae=>Ae.ref.current),[ke]=ie.slice(-1),Ee=document.activeElement;for(const Ae of _e)if(Ae===Ee||(Ae?.scrollIntoView({block:"nearest"}),Ae===Je&&V&&(V.scrollTop=0),Ae===ke&&V&&(V.scrollTop=V.scrollHeight),Ae?.focus(),document.activeElement!==Ee))return},[se,V]),Z=D.useCallback(()=>B([Q,I]),[B,Q,I]);D.useEffect(()=>{le&&Z()},[le,Z]);const{onOpenChange:te,triggerPointerDownPosRef:be}=U;D.useEffect(()=>{if(I){let _e={x:0,y:0};const Je=ke=>{_e={x:Math.abs(Math.round(ke.pageX)-(be.current?.x??0)),y:Math.abs(Math.round(ke.pageY)-(be.current?.y??0))}},ie=ke=>{_e.x<=10&&_e.y<=10?ke.preventDefault():I.contains(ke.target)||te(!1),document.removeEventListener("pointermove",Je),be.current=null};return be.current!==null&&(document.addEventListener("pointermove",Je),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Je),document.removeEventListener("pointerup",ie,{capture:!0})}}},[I,te,be]),D.useEffect(()=>{const _e=()=>te(!1);return window.addEventListener("blur",_e),window.addEventListener("resize",_e),()=>{window.removeEventListener("blur",_e),window.removeEventListener("resize",_e)}},[te]);const[re,oe]=AB(_e=>{const Je=se().filter(Ee=>!Ee.disabled),ie=Je.find(Ee=>Ee.ref.current===document.activeElement),ke=DB(Je,_e,ie);ke&&setTimeout(()=>ke.ref.current.focus())}),ue=D.useCallback((_e,Je,ie)=>{const ke=!xe.current&&!ie;(U.value!==void 0&&U.value===Je||ke)&&(he(_e),ke&&(xe.current=!0))},[U.value]),ce=D.useCallback(()=>I?.focus(),[I]),De=D.useCallback((_e,Je,ie)=>{const ke=!xe.current&&!ie;(U.value!==void 0&&U.value===Je||ke)&&W(_e)},[U.value]),je=l==="popper"?L2:dB,Ke=je===L2?{side:m,sideOffset:b,align:E,alignOffset:C,arrowPadding:S,collisionBoundary:R,collisionPadding:M,sticky:q,hideWhenDetached:N,avoidCollisions:L}:{};return O.jsx(cB,{scope:r,content:I,viewport:V,onViewportChange:F,itemRefCallback:ue,selectedItem:Q,onItemLeave:ce,itemTextRefCallback:De,focusSelectedItem:Z,selectedItemText:de,position:l,isPositioned:le,searchRef:re,children:O.jsx(ex,{as:mce,allowPinchZoom:!0,children:O.jsx(Sw,{asChild:!0,trapped:U.open,onMountAutoFocus:_e=>{_e.preventDefault()},onUnmountAutoFocus:gt(s,_e=>{U.trigger?.focus({preventScroll:!0}),_e.preventDefault()}),children:O.jsx(W1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:_e=>_e.preventDefault(),onDismiss:()=>U.onOpenChange(!1),children:O.jsx(je,{role:"listbox",id:U.contentId,"data-state":U.open?"open":"closed",dir:U.dir,onContextMenu:_e=>_e.preventDefault(),...P,...Ke,onPlaced:()=>ae(!0),ref:K,style:{display:"flex",flexDirection:"column",outline:"none",...P.style},onKeyDown:gt(P.onKeyDown,_e=>{const Je=_e.ctrlKey||_e.altKey||_e.metaKey;if(_e.key==="Tab"&&_e.preventDefault(),!Je&&_e.key.length===1&&oe(_e.key),["ArrowUp","ArrowDown","Home","End"].includes(_e.key)){let ke=se().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(_e.key)&&(ke=ke.slice().reverse()),["ArrowUp","ArrowDown"].includes(_e.key)){const Ee=_e.target,Ae=ke.indexOf(Ee);ke=ke.slice(Ae+1)}setTimeout(()=>B(ke)),_e.preventDefault()}})})})})})})});fB.displayName=hce;var vce="SelectItemAlignedPosition",dB=D.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:l,...s}=e,c=Ug(l0,r),h=Ig(l0,r),[m,b]=D.useState(null),[E,C]=D.useState(null),S=vn(t,K=>C(K)),R=j_(r),M=D.useRef(!1),q=D.useRef(!0),{viewport:N,selectedItem:L,selectedItemText:P,focusSelectedItem:U}=h,I=D.useCallback(()=>{if(c.trigger&&c.valueNode&&m&&E&&N&&L&&P){const K=c.trigger.getBoundingClientRect(),Q=E.getBoundingClientRect(),he=c.valueNode.getBoundingClientRect(),de=P.getBoundingClientRect();if(c.dir!=="rtl"){const Ee=de.left-Q.left,Ae=he.left-Ee,ot=K.left-Ae,vt=K.width+ot,Xt=Math.max(vt,Q.width),Nt=window.innerWidth-Gf,Kn=VP(Ae,[Gf,Math.max(Gf,Nt-Xt)]);m.style.minWidth=vt+"px",m.style.left=Kn+"px"}else{const Ee=Q.right-de.right,Ae=window.innerWidth-he.right-Ee,ot=window.innerWidth-K.right-Ae,vt=K.width+ot,Xt=Math.max(vt,Q.width),Nt=window.innerWidth-Gf,Kn=VP(Ae,[Gf,Math.max(Gf,Nt-Xt)]);m.style.minWidth=vt+"px",m.style.right=Kn+"px"}const W=R(),se=window.innerHeight-Gf*2,le=N.scrollHeight,ae=window.getComputedStyle(E),xe=parseInt(ae.borderTopWidth,10),B=parseInt(ae.paddingTop,10),Z=parseInt(ae.borderBottomWidth,10),te=parseInt(ae.paddingBottom,10),be=xe+B+le+te+Z,re=Math.min(L.offsetHeight*5,be),oe=window.getComputedStyle(N),ue=parseInt(oe.paddingTop,10),ce=parseInt(oe.paddingBottom,10),De=K.top+K.height/2-Gf,je=se-De,Ke=L.offsetHeight/2,_e=L.offsetTop+Ke,Je=xe+B+_e,ie=be-Je;if(Je<=De){const Ee=W.length>0&&L===W[W.length-1].ref.current;m.style.bottom="0px";const Ae=E.clientHeight-N.offsetTop-N.offsetHeight,ot=Math.max(je,Ke+(Ee?ce:0)+Ae+Z),vt=Je+ot;m.style.height=vt+"px"}else{const Ee=W.length>0&&L===W[0].ref.current;m.style.top="0px";const ot=Math.max(De,xe+N.offsetTop+(Ee?ue:0)+Ke)+ie;m.style.height=ot+"px",N.scrollTop=Je-De+N.offsetTop}m.style.margin=`${Gf}px 0`,m.style.minHeight=re+"px",m.style.maxHeight=se+"px",l?.(),requestAnimationFrame(()=>M.current=!0)}},[R,c.trigger,c.valueNode,m,E,N,L,P,c.dir,l]);Vl(()=>I(),[I]);const[Y,V]=D.useState();Vl(()=>{E&&V(window.getComputedStyle(E).zIndex)},[E]);const F=D.useCallback(K=>{K&&q.current===!0&&(I(),U?.(),q.current=!1)},[I,U]);return O.jsx(yce,{scope:r,contentWrapper:m,shouldExpandOnScrollRef:M,onScrollButtonChange:F,children:O.jsx("div",{ref:b,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:Y},children:O.jsx(_s.div,{...s,ref:S,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});dB.displayName=vce;var gce="SelectPopperPosition",L2=D.forwardRef((e,t)=>{const{__scopeSelect:r,align:l="start",collisionPadding:s=Gf,...c}=e,h=z_(r);return O.jsx(O_,{...h,...c,ref:t,align:l,collisionPadding:s,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});L2.displayName=gce;var[yce,mO]=lx(l0,{}),j2="SelectViewport",pB=D.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:l,...s}=e,c=Ig(j2,r),h=mO(j2,r),m=vn(t,c.onViewportChange),b=D.useRef(0);return O.jsxs(O.Fragment,{children:[O.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),O.jsx(L_.Slot,{scope:r,children:O.jsx(_s.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:gt(s.onScroll,E=>{const C=E.currentTarget,{contentWrapper:S,shouldExpandOnScrollRef:R}=h;if(R?.current&&S){const M=Math.abs(b.current-C.scrollTop);if(M>0){const q=window.innerHeight-Gf*2,N=parseFloat(S.style.minHeight),L=parseFloat(S.style.height),P=Math.max(N,L);if(P<q){const U=P+M,I=Math.min(q,U),Y=U-I;S.style.height=I+"px",S.style.bottom==="0px"&&(C.scrollTop=Y>0?Y:0,S.style.justifyContent="flex-end")}}}b.current=C.scrollTop})})})]})});pB.displayName=j2;var hB="SelectGroup",[bce,xce]=lx(hB),mB=D.forwardRef((e,t)=>{const{__scopeSelect:r,...l}=e,s=_a();return O.jsx(bce,{scope:r,id:s,children:O.jsx(_s.div,{role:"group","aria-labelledby":s,...l,ref:t})})});mB.displayName=hB;var vB="SelectLabel",gB=D.forwardRef((e,t)=>{const{__scopeSelect:r,...l}=e,s=xce(vB,r);return O.jsx(_s.div,{id:s.id,...l,ref:t})});gB.displayName=vB;var t_="SelectItem",[Ece,yB]=lx(t_),bB=D.forwardRef((e,t)=>{const{__scopeSelect:r,value:l,disabled:s=!1,textValue:c,...h}=e,m=Ug(t_,r),b=Ig(t_,r),E=m.value===l,[C,S]=D.useState(c??""),[R,M]=D.useState(!1),q=vn(t,U=>b.itemRefCallback?.(U,l,s)),N=_a(),L=D.useRef("touch"),P=()=>{s||(m.onValueChange(l),m.onOpenChange(!1))};if(l==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return O.jsx(Ece,{scope:r,value:l,disabled:s,textId:N,isSelected:E,onItemTextChange:D.useCallback(U=>{S(I=>I||(U?.textContent??"").trim())},[]),children:O.jsx(L_.ItemSlot,{scope:r,value:l,disabled:s,textValue:C,children:O.jsx(_s.div,{role:"option","aria-labelledby":N,"data-highlighted":R?"":void 0,"aria-selected":E&&R,"data-state":E?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...h,ref:q,onFocus:gt(h.onFocus,()=>M(!0)),onBlur:gt(h.onBlur,()=>M(!1)),onClick:gt(h.onClick,()=>{L.current!=="mouse"&&P()}),onPointerUp:gt(h.onPointerUp,()=>{L.current==="mouse"&&P()}),onPointerDown:gt(h.onPointerDown,U=>{L.current=U.pointerType}),onPointerMove:gt(h.onPointerMove,U=>{L.current=U.pointerType,s?b.onItemLeave?.():L.current==="mouse"&&U.currentTarget.focus({preventScroll:!0})}),onPointerLeave:gt(h.onPointerLeave,U=>{U.currentTarget===document.activeElement&&b.onItemLeave?.()}),onKeyDown:gt(h.onKeyDown,U=>{b.searchRef?.current!==""&&U.key===" "||(ice.includes(U.key)&&P(),U.key===" "&&U.preventDefault())})})})})});bB.displayName=t_;var tw="SelectItemText",xB=D.forwardRef((e,t)=>{const{__scopeSelect:r,className:l,style:s,...c}=e,h=Ug(tw,r),m=Ig(tw,r),b=yB(tw,r),E=fce(tw,r),[C,S]=D.useState(null),R=vn(t,P=>S(P),b.onItemTextChange,P=>m.itemTextRefCallback?.(P,b.value,b.disabled)),M=C?.textContent,q=D.useMemo(()=>O.jsx("option",{value:b.value,disabled:b.disabled,children:M},b.value),[b.disabled,b.value,M]),{onNativeOptionAdd:N,onNativeOptionRemove:L}=E;return Vl(()=>(N(q),()=>L(q)),[N,L,q]),O.jsxs(O.Fragment,{children:[O.jsx(_s.span,{id:b.textId,...c,ref:R}),b.isSelected&&h.valueNode&&!h.valueNodeHasChildren?X1.createPortal(c.children,h.valueNode):null]})});xB.displayName=tw;var EB="SelectItemIndicator",Sce=D.forwardRef((e,t)=>{const{__scopeSelect:r,...l}=e;return yB(EB,r).isSelected?O.jsx(_s.span,{"aria-hidden":!0,...l,ref:t}):null});Sce.displayName=EB;var z2="SelectScrollUpButton",SB=D.forwardRef((e,t)=>{const r=Ig(z2,e.__scopeSelect),l=mO(z2,e.__scopeSelect),[s,c]=D.useState(!1),h=vn(t,l.onScrollButtonChange);return Vl(()=>{if(r.viewport&&r.isPositioned){let m=function(){const E=b.scrollTop>0;c(E)};const b=r.viewport;return m(),b.addEventListener("scroll",m),()=>b.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),s?O.jsx(wB,{...e,ref:h,onAutoScroll:()=>{const{viewport:m,selectedItem:b}=r;m&&b&&(m.scrollTop=m.scrollTop-b.offsetHeight)}}):null});SB.displayName=z2;var B2="SelectScrollDownButton",CB=D.forwardRef((e,t)=>{const r=Ig(B2,e.__scopeSelect),l=mO(B2,e.__scopeSelect),[s,c]=D.useState(!1),h=vn(t,l.onScrollButtonChange);return Vl(()=>{if(r.viewport&&r.isPositioned){let m=function(){const E=b.scrollHeight-b.clientHeight,C=Math.ceil(b.scrollTop)<E;c(C)};const b=r.viewport;return m(),b.addEventListener("scroll",m),()=>b.removeEventListener("scroll",m)}},[r.viewport,r.isPositioned]),s?O.jsx(wB,{...e,ref:h,onAutoScroll:()=>{const{viewport:m,selectedItem:b}=r;m&&b&&(m.scrollTop=m.scrollTop+b.offsetHeight)}}):null});CB.displayName=B2;var wB=D.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:l,...s}=e,c=Ig("SelectScrollButton",r),h=D.useRef(null),m=j_(r),b=D.useCallback(()=>{h.current!==null&&(window.clearInterval(h.current),h.current=null)},[]);return D.useEffect(()=>()=>b(),[b]),Vl(()=>{m().find(C=>C.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[m]),O.jsx(_s.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:gt(s.onPointerDown,()=>{h.current===null&&(h.current=window.setInterval(l,50))}),onPointerMove:gt(s.onPointerMove,()=>{c.onItemLeave?.(),h.current===null&&(h.current=window.setInterval(l,50))}),onPointerLeave:gt(s.onPointerLeave,()=>{b()})})}),Cce="SelectSeparator",RB=D.forwardRef((e,t)=>{const{__scopeSelect:r,...l}=e;return O.jsx(_s.div,{"aria-hidden":!0,...l,ref:t})});RB.displayName=Cce;var k2="SelectArrow",wce=D.forwardRef((e,t)=>{const{__scopeSelect:r,...l}=e,s=z_(r),c=Ug(k2,r),h=Ig(k2,r);return c.open&&h.position==="popper"?O.jsx(N_,{...s,...l,ref:t}):null});wce.displayName=k2;var Rce="SelectBubbleInput",TB=D.forwardRef(({__scopeSelect:e,value:t,...r},l)=>{const s=D.useRef(null),c=vn(l,s),h=Xse(t);return D.useEffect(()=>{const m=s.current;if(!m)return;const b=window.HTMLSelectElement.prototype,C=Object.getOwnPropertyDescriptor(b,"value").set;if(h!==t&&C){const S=new Event("change",{bubbles:!0});C.call(m,t),m.dispatchEvent(S)}},[h,t]),O.jsx(_s.select,{...r,style:{...eB,...r.style},ref:c,defaultValue:t})});TB.displayName=Rce;function _B(e){return e===""||e===void 0}function AB(e){const t=Yo(e),r=D.useRef(""),l=D.useRef(0),s=D.useCallback(h=>{const m=r.current+h;t(m),(function b(E){r.current=E,window.clearTimeout(l.current),E!==""&&(l.current=window.setTimeout(()=>b(""),1e3))})(m)},[t]),c=D.useCallback(()=>{r.current="",window.clearTimeout(l.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(l.current),[]),[r,s,c]}function DB(e,t,r){const s=t.length>1&&Array.from(t).every(E=>E===t[0])?t[0]:t,c=r?e.indexOf(r):-1;let h=Tce(e,Math.max(c,0));s.length===1&&(h=h.filter(E=>E!==r));const b=h.find(E=>E.textValue.toLowerCase().startsWith(s.toLowerCase()));return b!==r?b:void 0}function Tce(e,t){return e.map((r,l)=>e[(t+l)%e.length])}var _ce=nB,Ace=aB,Dce=oB,Mce=iB,Oce=uB,Nce=sB,$ce=pB,Pce=mB,qce=gB,Lce=bB,jce=xB,zce=SB,Bce=CB,kce=RB;const MB=e=>O.jsx(_ce,{"data-slot":"select",...e}),OB=({heading:e,children:t,...r})=>O.jsxs(Pce,{"data-slot":"select-group",...r,children:[e&&O.jsx(jB,{children:e}),t]}),NB=e=>O.jsx(Dce,{"data-slot":"select-value",...e}),$B=({className:e,children:t,...r})=>O.jsxs(Ace,{"data-slot":"select-trigger",className:Fe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,O.jsx(Mce,{asChild:!0,"data-slot":"select-trigger-icon",children:O.jsx(PT,{className:"h-4 w-4 shrink-0 opacity-50"})})]}),PB=({className:e,...t})=>O.jsx(zce,{"data-slot":"select-scroll-up",className:Fe("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(q7,{className:"h-4 w-4"})}),qB=({className:e,...t})=>O.jsx(Bce,{"data-slot":"select-scroll-down",className:Fe("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(P7,{className:"h-4 w-4"})}),LB=({className:e,children:t,position:r="popper",...l})=>O.jsx(Oce,{children:O.jsxs(Nce,{"data-slot":"select-content",className:Fe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md open:animate-in closed:animate-out closed:fade-out-0 open:fade-in-0 closed:zoom-out-95 open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...l,children:[O.jsx(PB,{}),O.jsx($ce,{"data-slot":"select-viewport",className:Fe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),O.jsx(qB,{})]})}),jB=({className:e,...t})=>O.jsx(qce,{"data-slot":"select-label",className:Fe("py-1.5 px-2 text-sm font-semibold",e),...t}),zB=({className:e,children:t,...r})=>O.jsx(Lce,{"data-slot":"select-item",className:Fe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 px-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:O.jsx(jce,{"data-slot":"select-item-text",children:t})}),Uce=({className:e,...t})=>O.jsx(kce,{"data-slot":"select-separator",className:Fe("-mx-1 my-1 h-px bg-muted",e),...t}),Ice=({isCircle:e,width:t,height:r,isLoading:l=!1,...s})=>{const c={width:t,height:r,...s.style};return!l&&s.children?s.children:O.jsx("div",{"data-slot":"skeleton",...s,className:Fe("[&>*]:opacity-0 w-fit","rounded w-full animate-pulse bg-muted min-h-[1.5em]",e&&"rounded-[50%] aspect-square",s.className),style:c})},Hce=({inline:e=!1,justify:t,align:r,direction:l="horizontal",gap:s=8,style:c,...h})=>{const m={display:e?"inline-flex":"flex",flexDirection:l==="vertical"?"column":"row",justifyContent:t,alignItems:r,gap:s};return O.jsx("div",{style:{...m,...c},...h,"data-slot":"stack"})},[BB,Vce]=Mw();function Fce({items:e=[],current:t,onChange:r,className:l,classNameList:s,classNameItem:c,classNameButton:h,classNameIndicator:m,classNameContent:b}){return O.jsxs(kB,{className:l,current:t,onChange:r,children:[O.jsx(UB,{className:s,children:e?.map((E,C)=>O.jsx(IB,{value:C,title:E?.title,indicator:E?.indicator,classNameItem:c,classNameButton:h,classNameIndicator:m},C))}),e?.map((E,C)=>O.jsx(HB,{className:b,value:C,children:E?.content},C))]})}function kB({current:e,onChange:t,className:r,...l}){const[s=0,c]=br({prop:e,onChange:t,defaultProp:0});return O.jsx(Vce,{value:{activeStep:s,setActiveStep:c},children:O.jsx("div",{"data-slot":"stepper",className:Fe("flex flex-col items-center w-full transition-all ease-in delay-150",r),...l})})}function UB({children:e,className:t,...r}){return O.jsx("ul",{"data-slot":"stepper-list",className:Fe("flex flex-col sm:flex-row sm:gap-0 gap-4 items-center w-full text-xs font-medium text-gray-900 sm:text-base mb-8",t),...r,children:e})}function IB({disabled:e,value:t,title:r,indicator:l,classNameItem:s,classNameButton:c,classNameIndicator:h}){const{activeStep:m,setActiveStep:b}=BB();return O.jsx("li",{"data-slot":"stepper-trigger",className:Fe("flex relative text-primary transition-all ease-in delay-150","last:w-full last:sm:w-auto last:after:hidden",`w-full after:content-[''] sm:after:w-full after:h-full after:w-0.5 sm:after:h-0.5 ${m>t?"after:bg-primary":"after:bg-gray-300"} after:inline-block after:absolute after:top-5 sm:after:top-5 after:left-4 sm:after:left-10`,s),children:O.jsxs("button",{onClick:()=>!e&&b(t),className:Fe("z-10 flex items-center justify-center sm:flex-col gap-3 flex-row whitespace-nowrap cursor-pointer group transition-color ease-in delay-150",m>=t?"text-primary":"text-gray-500",e&&"cursor-not-allowed",c),children:[O.jsx("span",{"data-slot":"stepper-trigger-indicator",className:Fe("flex items-center transition-all overflow-hidden ease-in justify-center group-hover:scale-105 sm:w-10 sm:h-10 mx-auto text-sm border-2 rounded-full w-8 h-8",m>t&&"bg-primary border-primary text-primary-foreground",m===t&&"bg-gray-100 text-primary border-primary",m<t&&"bg-white text-gray-500 border-input",e&&"text-gray-300",h),children:m>t?"✓":l||t+1}),r]})})}function HB({value:e,className:t="w-full",...r}){const{activeStep:l}=BB();return l===e?O.jsx("div",{"data-slot":"stepper-content",className:t,...r}):null}const Kce=({className:e,children:t,containerProps:r,containerClassName:l,...s})=>{const c=k.useId(),[h=!1,m]=br({prop:s.checked,onChange:s.onChange,defaultProp:s.defaultChecked}),b=()=>!s.disabled&&m(S=>!S),E=h?"checked":"unchecked",C=s.id??c;return O.jsxs("div",{"data-slot":"switch",...r,className:Fe("flex gap-x-2 items-center",l),children:[O.jsxs("button",{"data-slot":"switch-trigger",disabled:s.disabled,onClick:b,"data-state":E,type:"button",className:Fe("peer w-11 h-6 bg-input rounded-full border-2 border-transparent transition-colors","data-[state=checked]:bg-primary",e),children:[O.jsx("div",{"data-state":E,className:Fe("w-5 h-5 pointers-event-none bg-primary-foreground rounded-full transition-all","transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")}),O.jsx("input",{...s,id:C,checked:h,onChange:S=>m(S.currentTarget.checked),type:"checkbox",className:"sr-only","aria-hidden":!0})]}),t&&O.jsx($w,{htmlFor:C,children:t})]})},VB=({className:e,containerClassName:t,containerProps:r,...l})=>O.jsx("div",{"data-slot":"table-container",className:Fe("relative w-full overflow-auto rounded-md border",t),...r,children:O.jsx("table",{"data-slot":"table",className:Fe("w-full caption-bottom text-sm",e),...l})}),FB=({className:e,...t})=>O.jsx("thead",{"data-slot":"table-header",className:Fe("[&_tr]:border-b",e),...t}),KB=({className:e,...t})=>O.jsx("tbody",{"data-slot":"table-body",className:Fe("[&_tr:last-child]:border-0",e),...t}),Gce=({className:e,...t})=>O.jsx("tfoot",{"data-slot":"table-footer",className:Fe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}),U2=({className:e,...t})=>O.jsx("tr",{"data-slot":"table-row",className:Fe("border-b transition-colors hover:bg-muted data-[selected=true]:bg-muted",e),...t}),GB=({className:e,...t})=>O.jsx("th",{"data-slot":"table-head",className:Fe("h-12 px-4 text-left align-middle font-medium text-muted-foreground sticky top-0 bg-background [&:has([role=checkbox])]:pr-0",e),...t}),YB=({className:e,...t})=>O.jsx("td",{"data-slot":"table-cell",className:Fe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}),Yce=({className:e,...t})=>O.jsx("caption",{"data-slot":"table-caption",className:Fe("mt-4 text-sm text-muted-foreground",e),...t}),Xce=({data:e=[],columns:t=[],onRowClick:r,onDoubleClick:l,selected:s,theadClassName:c,theadProps:h,tbodyClassName:m,tbodyProps:b,trClassName:E,trProps:C,thClassName:S,thProps:R,tdClassName:M,tdProps:q,...N})=>O.jsxs(VB,{...N,className:Fe(N?.className),children:[O.jsx(FB,{...h,className:Fe(h?.className,c),children:O.jsx(U2,{...C,className:Fe(C?.className,E),children:t.map((L,P)=>O.jsx(GB,{...R,className:Fe(R?.className,S),style:{width:L.width},children:sr.isFunction(L.header)?L.header?.():L.header},P))})}),O.jsx(KB,{...b,className:Fe(b?.className,m),children:e.map((L,P)=>O.jsx(U2,{...C,"data-selected":s?.(L),className:Fe(C?.className,E),children:t.map((U,I)=>O.jsx(YB,{...q,onClick:Y=>{q?.onClick?.(Y),r?.(L)},onDoubleClick:()=>l?.(L),className:Fe(q?.className,M),children:U.cell?.(L,I)||L[U.key]},I))},P))})]}),AT=[10,25,50],Qce=({containerClassName:e,containerProps:t,selectClassName:r,selectProps:l,sizes:s=AT,...c})=>{const[h=AT[0],m]=br({onChange:c?.setPageSize,prop:c?.pageSize,defaultProp:AT[0]}),{range:b,next:E,prev:C,isFirstPage:S,isLastPage:R,goTo:M}=YM({...c,pageSize:h}),q=N=>{const{value:L}=N.target,P=Number(L);m(P),M(1)};return O.jsxs("div",{"data-slot":"table-pagination",...t,className:Fe("flex justify-center items-center gap-x-4 bg-background border border-[#D9D9D9] rounded-2xl py-2",e),children:[s&&O.jsx("select",{"data-slot":"table-pagination-size-trigger",...l,value:h,onChange:q,className:Fe("border border-input rounded-md w-fit min-w-[3rem] bg-background p-2 ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),children:s.map((N,L)=>O.jsx("option",{value:N,"data-slot":"table-pagination-size-option",children:N},L))}),O.jsxs("span",{"data-slot":"table-pagination-range",children:[b.start," - ",b.end," de ",c.totalItems]}),O.jsxs("div",{className:"flex gap-2",children:[O.jsx(hi,{"data-slot":"table-pagination-prev",size:"icon",variant:"ghost",disabled:S,onClick:C,children:O.jsx(fM,{"data-slot":"table-pagination-prev-icon"})}),O.jsx(hi,{"data-slot":"table-pagination-next",size:"icon",variant:"ghost",disabled:R,onClick:E,children:O.jsx(Rw,{"data-slot":"table-pagination-next-icon"})})]})]})},[B_,Zce]=Mw(),Wce=({children:e,value:t,onChange:r,defaultValue:l,variant:s="default",...c})=>{const[h="",m]=br({prop:t,onChange:r,defaultProp:l}),[b,E]=k.useState(null);return O.jsx(Zce,{value:{activeTab:h,setActiveTab:m,setTargetRef:E,targetRef:b,variant:s},children:O.jsx("div",{"data-slot":"tabs",...c,children:e})})},Jce=({children:e,className:t,indicatorClassName:r})=>{const{targetRef:l}=B_();return O.jsxs("div",{"data-slot":"tabs-list",className:Fe("relative mb-4",t),children:[O.jsx("div",{"data-slot":"tabs-content",className:"flex",children:e}),O.jsx(nfe,{targetRef:l,indicatorClassName:r})]})},efe=({value:e,className:t,...r})=>{const{activeTab:l,setActiveTab:s,setTargetRef:c,variant:h}=B_(),m=l===e;return O.jsx("button",{"data-slot":"tabs-trigger",...r,type:"button",ref:b=>{m&&c(b)},onClick:()=>s(e),"data-tab":e,"data-selected":m,"aria-selected":m,className:Fe("px-2 py-2 cursor-pointer w-full min-w-[100px] text-center rounded-t font-semibold select-none",h==="background"?"hover:bg-transparent aria-selected:text-primary-foreground rounded":"hover:bg-accent hover:text-accent-foreground",t)})},tfe=({value:e,...t})=>{const{activeTab:r}=B_();return r===e?O.jsx("div",{"data-slot":"tabs-content",...t}):null},nfe=({targetRef:e,indicatorClassName:t})=>{const r=k.useRef(null),l=r?.current,s=k.useRef(null),{variant:c}=B_(),h=()=>{if(!e||!l)return;const m=e.offsetLeft,b=e.offsetWidth;l.style.width=b+"px",l.style.left=m+"px"};return k.useEffect(()=>{if(e)return h(),s.current=new ResizeObserver(h),s.current.observe(e),()=>{s.current?.disconnect()}},[e]),O.jsx("div",{"data-slot":"tabs-indicator",ref:r,className:Fe("transition-all duration-300 absolute rounded bg-primary",c==="background"?"inset-0 -z-10 h-full top-0":"top-full h-[3px]",t)})},rfe=({className:e,...t})=>O.jsx("textarea",{...t,"data-slot":"textarea",className:Fe("min-h-[60px] w-full rounded-md px-3 py-2 text-sm placeholder:text-muted-foreground","border border-input bg-background","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e)}),afe={done:"var(--color-primary)",pending:"#cdcdcd",error:"var(--color-error)"},lfe=({items:e,classNameContainer:t,containerProps:r,...l})=>O.jsx(XB,{className:t,...r,children:e.map((s,c)=>O.jsx(QB,{icon:s.icon,color:s.color,status:s.status,...l,children:s.content},c))}),XB=e=>O.jsx("ul",{"data-slot":"timeline",...e,className:Fe("relative flex justify-center flex-col border-input",e.className)}),QB=({icon:e,status:t,color:r,classNameItemDot:l,classNameItemContainerDot:s,classNameItemContent:c,itemsProps:h,children:m,...b})=>O.jsxs("li",{"data-slot":"timeline-item",className:Fe("rounded-lg w-full px-2 gap-1 grid hover:bg-muted transition-colors ease-in grid-cols-[minmax(auto,20px)_1fr]",b.className),...b,children:[O.jsx(ZB,{icon:e,status:t,color:r,classNameDot:l,classNameContainerDot:s}),O.jsx(WB,{className:c,...h,children:m})]}),ZB=({icon:e,status:t="pending",color:r,classNameDot:l,classNameContainerDot:s})=>O.jsx("div",{"data-slot":"timeline-item-dot",className:Fe("relative pb-6 last:after:hidden after:absolute after:top-0 after:bottom-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-gray-200",s),children:O.jsx("div",{"data-slot":"timeline-item-dot-icon",className:Fe("relative z-10 flex text-white items-center justify-center rounded-full left-1/2 -translate-x-1/2",e?"aspect-square p-1.5 min-h-7 min-w-7 top-2":"size-2 top-4",l),style:{backgroundColor:r||afe?.[t]},children:e})}),WB=e=>O.jsx("div",{"data-slot":"timeline-item-content",...e,className:Fe("grow px-2 pb-4 pt-2",e.className)}),ofe=$m(["flex justify-between items-center transition-all","text-primary-foreground","pointer-events-auto relative w-full rounded-xl p-3 shadow-lg"],{variants:{variant:{info:"bg-primary text-primary-foreground",error:"bg-error text-error-foreground",success:"bg-success text-success-foreground",loading:"bg-background text-foreground"}},defaultVariants:{variant:"info"}}),ife=$m("",{variants:{variant:{info:"text-primary-foreground",error:"text-error-foreground",success:"text-success-foreground",loading:"text-foreground animate-spin"}},defaultVariants:{variant:"info"}}),JB=({title:e,description:t,type:r,iconClassName:l,...s})=>{const c=t9[r];return O.jsxs("div",{...s,"data-slot":"toast",className:Fe(ofe({variant:r}),s.className),children:[O.jsx("div",{className:Fe("p-1 text-primary-foreground pr-2",l),children:O.jsx(c,{size:22,className:Fe(ife({variant:r})),"data-slot":"toast-icon"})}),O.jsxs("div",{className:"grid gap-1 grow","data-slot":"toast-content",children:[e&&O.jsx("h4",{...s.titleProps,className:Fe("text-sm font-semibold",s.titleClassName),"data-slot":"toast-title",children:e}),O.jsx("div",{...s.descriptionProps,className:Fe("text-sm font-normal opacity-90 p-0 overflow-hidden",s.descriptionClassName),"data-slot":"toast-description",children:t})]})]})},ufe=({iconClassName:e="",...t})=>{const r=vO(l=>l.toasts);return O.jsxs(O.Fragment,{children:[t.children,O.jsx(EM,{className:"empty:hidden fixed z-100 pr-2 pb-2 bottom-0 right-0 space-y-2 max-w-[300px] w-full",children:r.map(l=>{const s=k.createRef();return O.jsx(g_,{classNames:"toast",timeout:500,nodeRef:s,children:O.jsx(JB,{...l,iconClassName:e,ref:s})},l.id)})})]})},FP=e=>{let t;const r=new Set,l=(E,C)=>{const S=typeof E=="function"?E(t):E;if(!Object.is(S,t)){const R=t;t=C??(typeof S!="object"||S===null)?S:Object.assign({},t,S),r.forEach(M=>M(t,R))}},s=()=>t,m={setState:l,getState:s,getInitialState:()=>b,subscribe:E=>(r.add(E),()=>r.delete(E))},b=t=e(l,s,m);return m},sfe=(e=>e?FP(e):FP),cfe=e=>e;function ffe(e,t=cfe){const r=k.useSyncExternalStore(e.subscribe,k.useCallback(()=>t(e.getState()),[e,t]),k.useCallback(()=>t(e.getInitialState()),[e,t]));return k.useDebugValue(r),r}const KP=e=>{const t=sfe(e),r=l=>ffe(t,l);return Object.assign(r,t),r},dfe=(e=>e?KP(e):KP);let pfe=0;const e9=3e3,GP=(e,t,r=e9)=>{setTimeout(()=>e(t),r)},vO=dfe((e,t)=>({toasts:[],addToast:r=>{const l=++pfe,s={...r,id:l};return e(c=>({toasts:[...c.toasts,s]})),r.type!=="loading"&&GP(t().removeToast,l,r?.duration||e9),l},removeToast:r=>{e(l=>({toasts:l.toasts.filter(s=>s.id!==r)}))},updateToast:(r,l)=>{e(s=>({toasts:s.toasts.map(c=>c.id===r?{...c,...l}:c)})),l.type!=="loading"&&GP(t().removeToast,r)},promise:async(r,l)=>{const s=t().addToast({type:"loading",description:l.loading});try{const c=await r;return t().updateToast(s,{type:"success",description:typeof l.success=="function"?l.success(c):l.success}),c}catch(c){const h=typeof l.error=="function"?l.error(c):l.error;return t().updateToast(s,{type:"error",description:h}),Promise.reject(c)}}})),gO=vO.getState(),hfe=e=>gO.addToast(e),UD=(e,t)=>{const l=typeof e=="string"?{description:e,type:t}:{...e,type:t};return gO.addToast(l)},mfe=Object.assign(hfe,{info:e=>UD(e,"info"),success:e=>UD(e,"success"),error:e=>UD(e,"error"),promise:(e,t)=>gO.promise(e,t)}),t9={info:tK,success:rK,error:lK,loading:qT};function vfe(e){const t=gfe(e),r=D.forwardRef((l,s)=>{const{children:c,...h}=l,m=D.Children.toArray(c),b=m.find(bfe);if(b){const E=b.props.children,C=m.map(S=>S===b?D.Children.count(E)>1?D.Children.only(null):D.isValidElement(E)?E.props.children:null:S);return O.jsx(t,{...h,ref:s,children:D.isValidElement(E)?D.cloneElement(E,void 0,C):null})}return O.jsx(t,{...h,ref:s,children:c})});return r.displayName=`${e}.Slot`,r}function gfe(e){const t=D.forwardRef((r,l)=>{const{children:s,...c}=r;if(D.isValidElement(s)){const h=Efe(s),m=xfe(c,s.props);return s.type!==D.Fragment&&(m.ref=l?Fr(l,h):h),D.cloneElement(s,m)}return D.Children.count(s)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var n9=Symbol("radix.slottable");function yfe(e){const t=({children:r})=>O.jsx(O.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=n9,t}function bfe(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===n9}function xfe(e,t){const r={...t};for(const l in t){const s=e[l],c=t[l];/^on[A-Z]/.test(l)?s&&c?r[l]=(...m)=>{const b=c(...m);return s(...m),b}:s&&(r[l]=s):l==="style"?r[l]={...s,...c}:l==="className"&&(r[l]=[s,c].filter(Boolean).join(" "))}return{...e,...r}}function Efe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Sfe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cfe=Sfe.reduce((e,t)=>{const r=vfe(`Primitive.${t}`),l=D.forwardRef((s,c)=>{const{asChild:h,...m}=s,b=h?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(b,{...m,ref:c})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),[k_]=xp("Tooltip",[zg]),U_=zg(),r9="TooltipProvider",wfe=700,I2="tooltip.open",[Rfe,yO]=k_(r9),a9=e=>{const{__scopeTooltip:t,delayDuration:r=wfe,skipDelayDuration:l=300,disableHoverableContent:s=!1,children:c}=e,h=D.useRef(!0),m=D.useRef(!1),b=D.useRef(0);return D.useEffect(()=>{const E=b.current;return()=>window.clearTimeout(E)},[]),O.jsx(Rfe,{scope:t,isOpenDelayedRef:h,delayDuration:r,onOpen:D.useCallback(()=>{window.clearTimeout(b.current),h.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>h.current=!0,l)},[l]),isPointerInTransitRef:m,onPointerInTransitChange:D.useCallback(E=>{m.current=E},[]),disableHoverableContent:s,children:c})};a9.displayName=r9;var yw="Tooltip",[Tfe,Xw]=k_(yw),l9=e=>{const{__scopeTooltip:t,children:r,open:l,defaultOpen:s,onOpenChange:c,disableHoverableContent:h,delayDuration:m}=e,b=yO(yw,e.__scopeTooltip),E=U_(t),[C,S]=D.useState(null),R=_a(),M=D.useRef(0),q=h??b.disableHoverableContent,N=m??b.delayDuration,L=D.useRef(!1),[P,U]=br({prop:l,defaultProp:s??!1,onChange:K=>{K?(b.onOpen(),document.dispatchEvent(new CustomEvent(I2))):b.onClose(),c?.(K)},caller:yw}),I=D.useMemo(()=>P?L.current?"delayed-open":"instant-open":"closed",[P]),Y=D.useCallback(()=>{window.clearTimeout(M.current),M.current=0,L.current=!1,U(!0)},[U]),V=D.useCallback(()=>{window.clearTimeout(M.current),M.current=0,U(!1)},[U]),F=D.useCallback(()=>{window.clearTimeout(M.current),M.current=window.setTimeout(()=>{L.current=!0,U(!0),M.current=0},N)},[N,U]);return D.useEffect(()=>()=>{M.current&&(window.clearTimeout(M.current),M.current=0)},[]),O.jsx(zw,{...E,children:O.jsx(Tfe,{scope:t,contentId:R,open:P,stateAttribute:I,trigger:C,onTriggerChange:S,onTriggerEnter:D.useCallback(()=>{b.isOpenDelayedRef.current?F():Y()},[b.isOpenDelayedRef,F,Y]),onTriggerLeave:D.useCallback(()=>{q?V():(window.clearTimeout(M.current),M.current=0)},[V,q]),onOpen:Y,onClose:V,disableHoverableContent:q,children:r})})};l9.displayName=yw;var H2="TooltipTrigger",o9=D.forwardRef((e,t)=>{const{__scopeTooltip:r,...l}=e,s=Xw(H2,r),c=yO(H2,r),h=U_(r),m=D.useRef(null),b=vn(t,m,s.onTriggerChange),E=D.useRef(!1),C=D.useRef(!1),S=D.useCallback(()=>E.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",S),[S]),O.jsx(Bw,{asChild:!0,...h,children:O.jsx(Cfe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...l,ref:b,onPointerMove:gt(e.onPointerMove,R=>{R.pointerType!=="touch"&&!C.current&&!c.isPointerInTransitRef.current&&(s.onTriggerEnter(),C.current=!0)}),onPointerLeave:gt(e.onPointerLeave,()=>{s.onTriggerLeave(),C.current=!1}),onPointerDown:gt(e.onPointerDown,()=>{s.open&&s.onClose(),E.current=!0,document.addEventListener("pointerup",S,{once:!0})}),onFocus:gt(e.onFocus,()=>{E.current||s.onOpen()}),onBlur:gt(e.onBlur,s.onClose),onClick:gt(e.onClick,s.onClose)})})});o9.displayName=H2;var bO="TooltipPortal",[_fe,Afe]=k_(bO,{forceMount:void 0}),i9=e=>{const{__scopeTooltip:t,forceMount:r,children:l,container:s}=e,c=Xw(bO,t);return O.jsx(_fe,{scope:t,forceMount:r,children:O.jsx(Ts,{present:r||c.open,children:O.jsx(J1,{asChild:!0,container:s,children:l})})})};i9.displayName=bO;var Y1="TooltipContent",u9=D.forwardRef((e,t)=>{const r=Afe(Y1,e.__scopeTooltip),{forceMount:l=r.forceMount,side:s="top",...c}=e,h=Xw(Y1,e.__scopeTooltip);return O.jsx(Ts,{present:l||h.open,children:h.disableHoverableContent?O.jsx(s9,{side:s,...c,ref:t}):O.jsx(Dfe,{side:s,...c,ref:t})})}),Dfe=D.forwardRef((e,t)=>{const r=Xw(Y1,e.__scopeTooltip),l=yO(Y1,e.__scopeTooltip),s=D.useRef(null),c=vn(t,s),[h,m]=D.useState(null),{trigger:b,onClose:E}=r,C=s.current,{onPointerInTransitChange:S}=l,R=D.useCallback(()=>{m(null),S(!1)},[S]),M=D.useCallback((q,N)=>{const L=q.currentTarget,P={x:q.clientX,y:q.clientY},U=$fe(P,L.getBoundingClientRect()),I=Pfe(P,U),Y=qfe(N.getBoundingClientRect()),V=jfe([...I,...Y]);m(V),S(!0)},[S]);return D.useEffect(()=>()=>R(),[R]),D.useEffect(()=>{if(b&&C){const q=L=>M(L,C),N=L=>M(L,b);return b.addEventListener("pointerleave",q),C.addEventListener("pointerleave",N),()=>{b.removeEventListener("pointerleave",q),C.removeEventListener("pointerleave",N)}}},[b,C,M,R]),D.useEffect(()=>{if(h){const q=N=>{const L=N.target,P={x:N.clientX,y:N.clientY},U=b?.contains(L)||C?.contains(L),I=!Lfe(P,h);U?R():I&&(R(),E())};return document.addEventListener("pointermove",q),()=>document.removeEventListener("pointermove",q)}},[b,C,h,E,R]),O.jsx(s9,{...e,ref:c})}),[Mfe,Ofe]=k_(yw,{isInside:!1}),Nfe=yfe("TooltipContent"),s9=D.forwardRef((e,t)=>{const{__scopeTooltip:r,children:l,"aria-label":s,onEscapeKeyDown:c,onPointerDownOutside:h,...m}=e,b=Xw(Y1,r),E=U_(r),{onClose:C}=b;return D.useEffect(()=>(document.addEventListener(I2,C),()=>document.removeEventListener(I2,C)),[C]),D.useEffect(()=>{if(b.trigger){const S=R=>{R.target?.contains(b.trigger)&&C()};return window.addEventListener("scroll",S,{capture:!0}),()=>window.removeEventListener("scroll",S,{capture:!0})}},[b.trigger,C]),O.jsx(W1,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:S=>S.preventDefault(),onDismiss:C,children:O.jsxs(O_,{"data-state":b.stateAttribute,...E,...m,ref:t,style:{...m.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[O.jsx(Nfe,{children:l}),O.jsx(Mfe,{scope:r,isInside:!0,children:O.jsx(lce,{id:b.contentId,role:"tooltip",children:s||l})})]})})});u9.displayName=Y1;var c9="TooltipArrow",f9=D.forwardRef((e,t)=>{const{__scopeTooltip:r,...l}=e,s=U_(r);return Ofe(c9,r).isInside?null:O.jsx(N_,{...s,...l,ref:t})});f9.displayName=c9;function $fe(e,t){const r=Math.abs(t.top-e.y),l=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),c=Math.abs(t.left-e.x);switch(Math.min(r,l,s,c)){case c:return"left";case s:return"right";case r:return"top";case l:return"bottom";default:throw new Error("unreachable")}}function Pfe(e,t,r=5){const l=[];switch(t){case"top":l.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":l.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":l.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":l.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return l}function qfe(e){const{top:t,right:r,bottom:l,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:l},{x:s,y:l}]}function Lfe(e,t){const{x:r,y:l}=e;let s=!1;for(let c=0,h=t.length-1;c<t.length;h=c++){const m=t[c],b=t[h],E=m.x,C=m.y,S=b.x,R=b.y;C>l!=R>l&&r<(S-E)*(l-C)/(R-C)+E&&(s=!s)}return s}function jfe(e){const t=e.slice();return t.sort((r,l)=>r.x<l.x?-1:r.x>l.x?1:r.y<l.y?-1:r.y>l.y?1:0),zfe(t)}function zfe(e){if(e.length<=1)return e.slice();const t=[];for(let l=0;l<e.length;l++){const s=e[l];for(;t.length>=2;){const c=t[t.length-1],h=t[t.length-2];if((c.x-h.x)*(s.y-h.y)>=(c.y-h.y)*(s.x-h.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let l=e.length-1;l>=0;l--){const s=e[l];for(;r.length>=2;){const c=r[r.length-1],h=r[r.length-2];if((c.x-h.x)*(s.y-h.y)>=(c.y-h.y)*(s.x-h.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Bfe=a9,kfe=l9,Ufe=o9,Ife=i9,Hfe=u9,Vfe=f9;const d9=({delayDuration:e=0,...t})=>O.jsx(Bfe,{"data-slot":"tooltip-provider",delayDuration:e,...t}),p9=({...e})=>O.jsx(d9,{children:O.jsx(kfe,{"data-slot":"tooltip",...e})}),h9=({...e})=>O.jsx(Ufe,{"data-slot":"tooltip-trigger",...e}),m9=({className:e,sideOffset:t=0,children:r,arrowClassName:l,...s})=>O.jsx(Ife,{children:O.jsxs(Hfe,{"data-slot":"tooltip-content",sideOffset:t,className:Fe("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...s,children:[r,O.jsx(Vfe,{className:Fe("bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",l)})]})}),Ffe=({label:e,open:t,defaultOpen:r,onOpenChange:l,...s})=>{const{className:c,...h}=Tw("Tooltip",s,{side:"top"});return O.jsxs(p9,{open:t,defaultOpen:r,onOpenChange:l,children:[O.jsx(h9,{asChild:!0,"data-slot":"tooltip-trigger",children:O.jsx(_w,{...h})}),O.jsx(m9,{"data-slot":"tooltip-content",side:h.side,sideOffset:h.offset,className:c,arrowClassName:h.arrowClassName,children:e})]})},Kfe=k.createContext(null);k.createContext(null);k.createContext(null);k.createContext(null);k.createContext(null);k.createContext({});k.createContext(null);k.createContext(null);const Ia=typeof document<"u"?k.useLayoutEffect:()=>{};var ID;const Gfe=(ID=k.useInsertionEffect)!==null&&ID!==void 0?ID:Ia;function nu(e){const t=k.useRef(null);return Gfe(()=>{t.current=e},[e]),k.useCallback((...r)=>{const l=t.current;return l?.(...r)},[])}function Yfe(e){let[t,r]=k.useState(e),l=k.useRef(null),s=nu(()=>{if(!l.current)return;let h=l.current.next();if(h.done){l.current=null;return}t===h.value?s():r(h.value)});Ia(()=>{l.current&&s()});let c=nu(h=>{l.current=h(t),s()});return[t,c]}const n_={prefix:String(Math.round(Math.random()*1e10)),current:0},v9=k.createContext(n_),Xfe=k.createContext(!1);let Qfe=!!(typeof window<"u"&&window.document&&window.document.createElement),HD=new WeakMap;function Zfe(e=!1){let t=k.useContext(v9),r=k.useRef(null);if(r.current===null&&!e){var l,s;let c=(s=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||s===void 0||(l=s.ReactCurrentOwner)===null||l===void 0?void 0:l.current;if(c){let h=HD.get(c);h==null?HD.set(c,{id:t.current,state:c.memoizedState}):c.memoizedState!==h.state&&(t.current=h.id,HD.delete(c))}r.current=++t.current}return r.current}function Wfe(e){let t=k.useContext(v9);t===n_&&!Qfe&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let r=Zfe(!!e),l=t===n_&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${l}-${r}`}function Jfe(e){let t=k.useId(),[r]=k.useState(Qw()),l=r||process.env.NODE_ENV==="test"?"react-aria":`react-aria${n_.prefix}`;return e||`${l}-${t}`}const ede=typeof k.useId=="function"?Jfe:Wfe;function tde(){return!1}function nde(){return!0}function rde(e){return()=>{}}function Qw(){return typeof k.useSyncExternalStore=="function"?k.useSyncExternalStore(rde,tde,nde):k.useContext(Xfe)}let ade=!!(typeof window<"u"&&window.document&&window.document.createElement),H1=new Map,nw;typeof FinalizationRegistry<"u"&&(nw=new FinalizationRegistry(e=>{H1.delete(e)}));function Om(e){let[t,r]=k.useState(e),l=k.useRef(null),s=ede(t),c=k.useRef(null);if(nw&&nw.register(c,s),ade){const h=H1.get(s);h&&!h.includes(l)?h.push(l):H1.set(s,[l])}return Ia(()=>{let h=s;return()=>{nw&&nw.unregister(c),H1.delete(h)}},[s]),k.useEffect(()=>{let h=l.current;return h&&r(h),()=>{h&&(l.current=null)}}),s}function lde(e,t){if(e===t)return e;let r=H1.get(e);if(r)return r.forEach(s=>s.current=t),t;let l=H1.get(t);return l?(l.forEach(s=>s.current=e),e):t}function ode(e=[]){let t=Om(),[r,l]=Yfe(t),s=k.useCallback(()=>{l(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,l]);return Ia(s,[t,s,...e]),r}function I_(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const ar=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},qc=e=>e&&"window"in e&&e.window===e?e:ar(e).defaultView||window;function ide(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function ude(e){return ide(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let sde=!1;function H_(){return sde}function ta(e,t){if(!H_())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let r=t;for(;r!==null;){if(r===e)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:ude(r)?r=r.host:r=r.parentNode}return!1}const pi=(e=document)=>{var t;if(!H_())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(!((t=r.shadowRoot)===null||t===void 0)&&t.activeElement);)r=r.shadowRoot.activeElement;return r};function Qn(e){return H_()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class cde{get currentNode(){return this._currentNode}set currentNode(t){if(!ta(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const r=[];let l=t,s=t;for(this._currentNode=t;l&&l!==this.root;)if(l.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=l,m=this._doc.createTreeWalker(h,this.whatToShow,{acceptNode:this._acceptNode});r.push(m),m.currentNode=s,this._currentSetFor.add(m),l=s=h.host}else l=l.parentNode;const c=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});r.push(c),c.currentNode=s,this._currentSetFor.add(c),this._walkerStack=r}get doc(){return this._doc}firstChild(){let t=this.currentNode,r=this.nextNode();return ta(t,r)?(r&&(this.currentNode=r),r):(this.currentNode=t,null)}lastChild(){let r=this._walkerStack[0].lastChild();return r&&(this.currentNode=r),r}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var r;let s;if(typeof this.filter=="function"?s=this.filter(t):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(s=this.filter.acceptNode(t)),s===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let c=this.nextNode();return c&&(this.currentNode=c),c}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let l=this.nextNode();return l&&(this.currentNode=l),l}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let s=this.previousNode();return s&&(this.currentNode=s),s}else return null;return null}const r=t.previousNode();if(r){if(r.shadowRoot){var l;let c;if(typeof this.filter=="function"?c=this.filter(r):!((l=this.filter)===null||l===void 0)&&l.acceptNode&&(c=this.filter.acceptNode(r)),c===NodeFilter.FILTER_ACCEPT)return r&&(this.currentNode=r),r;let h=this.lastChild();return h&&(this.currentNode=h),h}return r&&(this.currentNode=r),r}else if(this._walkerStack.length>1){this._walkerStack.shift();let s=this.previousNode();return s&&(this.currentNode=s),s}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(t,r,l,s){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=h=>{if(h.nodeType===Node.ELEMENT_NODE){const b=h.shadowRoot;if(b){const E=this._doc.createTreeWalker(b,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(E),NodeFilter.FILTER_ACCEPT}else{var m;if(typeof this.filter=="function")return this.filter(h);if(!((m=this.filter)===null||m===void 0)&&m.acceptNode)return this.filter.acceptNode(h);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=r,this.filter=s??null,this.whatToShow=l??NodeFilter.SHOW_ALL,this._currentNode=r,this._walkerStack.unshift(t.createTreeWalker(r,l,this._acceptNode));const c=r.shadowRoot;if(c){const h=this._doc.createTreeWalker(c,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(h)}}}function fde(e,t,r,l){return H_()?new cde(e,t,r,l):e.createTreeWalker(t,r,l)}function Fl(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let l=e[r];for(let s in l){let c=t[s],h=l[s];typeof c=="function"&&typeof h=="function"&&s[0]==="o"&&s[1]==="n"&&s.charCodeAt(2)>=65&&s.charCodeAt(2)<=90?t[s]=I_(c,h):(s==="className"||s==="UNSAFE_className")&&typeof c=="string"&&typeof h=="string"?t[s]=oM(c,h):s==="id"&&c&&h?t.id=lde(c,h):t[s]=h!==void 0?h:c}}return t}function dde(...e){return e.length===1&&e[0]?e[0]:t=>{let r=!1;const l=e.map(s=>{const c=YP(s,t);return r||(r=typeof c=="function"),c});if(r)return()=>{l.forEach((s,c)=>{typeof s=="function"?s():YP(e[c],null)})}}}function YP(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}const pde=new Set(["id"]),hde=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),mde=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),vde=new Set(["dir","lang","hidden","inert","translate"]),XP=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),gde=/^(data-.*)$/;function ox(e,t={}){let{labelable:r,isLink:l,global:s,events:c=s,propNames:h}=t,m={};for(const b in e)Object.prototype.hasOwnProperty.call(e,b)&&(pde.has(b)||r&&hde.has(b)||l&&mde.has(b)||s&&vde.has(b)||c&&XP.has(b)||b.endsWith("Capture")&&XP.has(b.slice(0,-7))||h?.has(b)||gde.test(b))&&(m[b]=e[b]);return m}function Nm(e){if(yde())e.focus({preventScroll:!0});else{let t=bde(e);e.focus(),xde(t)}}let gT=null;function yde(){if(gT==null){gT=!1;try{document.createElement("div").focus({get preventScroll(){return gT=!0,!0}})}catch{}}return gT}function bde(e){let t=e.parentNode,r=[],l=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==l;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return l instanceof HTMLElement&&r.push({element:l,scrollTop:l.scrollTop,scrollLeft:l.scrollLeft}),r}function xde(e){for(let{element:t,scrollTop:r,scrollLeft:l}of e)t.scrollTop=r,t.scrollLeft=l}function V_(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let r=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(r)&&r.some(l=>e.test(l.brand))||e.test(window.navigator.userAgent)}function xO(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 qm(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const o0=qm(function(){return xO(/^Mac/i)}),Ede=qm(function(){return xO(/^iPhone/i)}),g9=qm(function(){return xO(/^iPad/i)||o0()&&navigator.maxTouchPoints>1}),EO=qm(function(){return Ede()||g9()}),Sde=qm(function(){return o0()||EO()}),Cde=qm(function(){return V_(/AppleWebKit/i)&&!SO()}),SO=qm(function(){return V_(/Chrome/i)}),CO=qm(function(){return V_(/Android/i)}),wde=qm(function(){return V_(/Firefox/i)}),Rde=k.createContext({isNative:!0,open:_de,useHref:e=>e});function wO(){return k.useContext(Rde)}function i0(e,t,r=!0){var l,s;let{metaKey:c,ctrlKey:h,altKey:m,shiftKey:b}=t;wde()&&(!((s=window.event)===null||s===void 0||(l=s.type)===null||l===void 0)&&l.startsWith("key"))&&e.target==="_blank"&&(o0()?c=!0:h=!0);let E=Cde()&&o0()&&!g9()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:c,ctrlKey:h,altKey:m,shiftKey:b}):new MouseEvent("click",{metaKey:c,ctrlKey:h,altKey:m,shiftKey:b,bubbles:!0,cancelable:!0});i0.isOpening=r,Nm(e),e.dispatchEvent(E),i0.isOpening=!1}i0.isOpening=!1;function Tde(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let r=document.createElement("a");r.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(r.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(r.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(r.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(r.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(r.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(r),t(r),e.removeChild(r)}}function _de(e,t){Tde(e,r=>i0(r,t))}function Ade(e){let t=wO();var r;const l=t.useHref((r=e.href)!==null&&r!==void 0?r:"");return{"data-href":e.href?l:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}let _g=new Map,V2=new Set;function QP(){if(typeof window>"u")return;function e(l){return"propertyName"in l}let t=l=>{if(!e(l)||!l.target)return;let s=_g.get(l.target);s||(s=new Set,_g.set(l.target,s),l.target.addEventListener("transitioncancel",r,{once:!0})),s.add(l.propertyName)},r=l=>{if(!e(l)||!l.target)return;let s=_g.get(l.target);if(s&&(s.delete(l.propertyName),s.size===0&&(l.target.removeEventListener("transitioncancel",r),_g.delete(l.target)),_g.size===0)){for(let c of V2)c();V2.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",r)}typeof document<"u"&&(document.readyState!=="loading"?QP():document.addEventListener("DOMContentLoaded",QP));function Dde(){for(const[e]of _g)"isConnected"in e&&!e.isConnected&&_g.delete(e)}function y9(e){requestAnimationFrame(()=>{Dde(),_g.size===0?e():V2.add(e)})}function F_(){let e=k.useRef(new Map),t=k.useCallback((s,c,h,m)=>{let b=m?.once?(...E)=>{e.current.delete(h),h(...E)}:h;e.current.set(h,{type:c,eventTarget:s,fn:b,options:m}),s.addEventListener(c,b,m)},[]),r=k.useCallback((s,c,h,m)=>{var b;let E=((b=e.current.get(h))===null||b===void 0?void 0:b.fn)||h;s.removeEventListener(c,E,m),e.current.delete(h)},[]),l=k.useCallback(()=>{e.current.forEach((s,c)=>{r(s.eventTarget,s.type,c,s.options)})},[r]);return k.useEffect(()=>l,[l]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:l}}function Mde(e,t){let{id:r,"aria-label":l,"aria-labelledby":s}=e;return r=Om(r),s&&l?s=[...new Set([r,...s.trim().split(/\s+/)])].join(" "):s&&(s=s.trim().split(/\s+/).join(" ")),!l&&!s&&t&&(l=t),{id:r,"aria-label":l,"aria-labelledby":s}}function K_(e){const t=k.useRef(null),r=k.useRef(void 0),l=k.useCallback(s=>{if(typeof e=="function"){const c=e,h=c(s);return()=>{typeof h=="function"?h():c(null)}}else if(e)return e.current=s,()=>{e.current=null}},[e]);return k.useMemo(()=>({get current(){return t.current},set current(s){t.current=s,r.current&&(r.current(),r.current=void 0),s!=null&&(r.current=l(s))}}),[l])}function Ode(e,t){const r=k.useRef(!0),l=k.useRef(null);k.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),k.useEffect(()=>{let s=l.current;r.current?r.current=!1:(!s||t.some((c,h)=>!Object.is(c,s[h])))&&e(),l.current=t},t)}function ZP(e,t){const r=k.useRef(!0),l=k.useRef(null);Ia(()=>(r.current=!0,()=>{r.current=!1}),[]),Ia(()=>{r.current?r.current=!1:(!l.current||t.some((s,c)=>!Object.is(s,l[c])))&&e(),l.current=t},t)}function b9(e,t){Ia(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function bw(e,t){if(!e)return!1;let r=window.getComputedStyle(e),l=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return l&&t&&(l=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),l}function Fb(e,t){let r=e;for(bw(r,t)&&(r=r.parentElement);r&&!bw(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function Nde(e,t){const r=[];for(;e&&e!==document.documentElement;)bw(e,t)&&r.push(e),e=e.parentElement;return r}function j1(e){return o0()?e.metaKey:e.ctrlKey}let $de=0;const VD=new Map;function x9(e){let[t,r]=k.useState();return Ia(()=>{if(!e)return;let l=VD.get(e);if(l)r(l.element.id);else{let s=`react-aria-description-${$de++}`;r(s);let c=document.createElement("div");c.id=s,c.style.display="none",c.textContent=e,document.body.appendChild(c),l={refCount:0,element:c},VD.set(e,l)}return l.refCount++,()=>{l&&--l.refCount===0&&(l.element.remove(),VD.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function yT(e,t,r,l){let s=nu(r),c=r==null;k.useEffect(()=>{if(c||!e.current)return;let h=e.current;return h.addEventListener(t,s,l),()=>{h.removeEventListener(t,s,l)}},[e,t,l,c,s])}function E9(e,t){let r=WP(e,t,"left"),l=WP(e,t,"top"),s=t.offsetWidth,c=t.offsetHeight,h=e.scrollLeft,m=e.scrollTop,{borderTopWidth:b,borderLeftWidth:E,scrollPaddingTop:C,scrollPaddingRight:S,scrollPaddingBottom:R,scrollPaddingLeft:M}=getComputedStyle(e),{scrollMarginTop:q,scrollMarginRight:N,scrollMarginBottom:L,scrollMarginLeft:P}=getComputedStyle(t),U=h+parseInt(E,10),I=m+parseInt(b,10),Y=U+e.clientWidth,V=I+e.clientHeight,F=parseInt(C,10)||0,K=parseInt(R,10)||0,Q=parseInt(S,10)||0,he=parseInt(M,10)||0,de=parseInt(q,10)||0,W=parseInt(L,10)||0,se=parseInt(N,10)||0,le=parseInt(P,10)||0,ae=r-le,xe=r+s+se,B=l-de,Z=l+c+W,te=h+parseInt(E,10)+he,be=Y-Q,re=m+parseInt(b,10)+F,oe=V-K;if((ae>te||xe<be)&&(ae<=h+he?h=ae-parseInt(E,10)-he:xe>Y-Q&&(h+=xe-Y+Q)),(B>re||Z<oe)&&(B<=I+F?m=B-parseInt(b,10)-F:Z>V-K&&(m+=Z-V+K)),process.env.NODE_ENV==="test"){e.scrollLeft=h,e.scrollTop=m;return}e.scrollTo({left:h,top:m})}function WP(e,t,r){const l=r==="left"?"offsetLeft":"offsetTop";let s=0;for(;t.offsetParent&&(s+=t[l],t.offsetParent!==e);){if(t.offsetParent.contains(e)){s-=e[l];break}t=t.offsetParent}return s}function Tg(e,t){if(e&&document.contains(e)){let h=document.scrollingElement||document.documentElement;if(!(window.getComputedStyle(h).overflow==="hidden")&&!SO()){var r;let{left:b,top:E}=e.getBoundingClientRect();e==null||(r=e.scrollIntoView)===null||r===void 0||r.call(e,{block:"nearest"});let{left:C,top:S}=e.getBoundingClientRect();if(Math.abs(b-C)>1||Math.abs(E-S)>1){var l,s,c;t==null||(s=t.containingElement)===null||s===void 0||(l=s.scrollIntoView)===null||l===void 0||l.call(s,{block:"center",inline:"center"}),(c=e.scrollIntoView)===null||c===void 0||c.call(e,{block:"nearest"})}}else{let b=Nde(e);for(let E of b)E9(E,e)}}}function F2(e){return e.pointerType===""&&e.isTrusted?!0:CO()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Pde(e){return!CO()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function qde(e,t){let{collection:r,onLoadMore:l,scrollOffset:s=1}=e,c=k.useRef(null),h=nu(m=>{for(let b of m)b.isIntersecting&&l&&l()});Ia(()=>(t.current&&(c.current=new IntersectionObserver(h,{root:Fb(t?.current),rootMargin:`0px ${100*s}% ${100*s}% ${100*s}%`}),c.current.observe(t.current)),()=>{c.current&&c.current.disconnect()}),[r,h,t,s])}function Lde(e){const t=k.version.split(".");return parseInt(t[0],10)>=19?e:e?"true":void 0}const jde="react-aria-clear-focus",zde="react-aria-focus",Bde=typeof Element<"u"&&"checkVisibility"in Element.prototype;function kde(e){const t=qc(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:r,visibility:l}=e.style,s=r!=="none"&&l!=="hidden"&&l!=="collapse";if(s){const{getComputedStyle:c}=e.ownerDocument.defaultView;let{display:h,visibility:m}=c(e);s=h!=="none"&&m!=="hidden"&&m!=="collapse"}return s}function Ude(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 RO(e,t){return Bde?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&kde(e)&&Ude(e,t)&&(!e.parentElement||RO(e.parentElement,e))}const TO=["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"],Ide=TO.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";TO.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Hde=TO.join(':not([hidden]):not([tabindex="-1"]),');function S9(e){return e.matches(Ide)&&RO(e)&&!C9(e)}function Vde(e){return e.matches(Hde)&&RO(e)&&!C9(e)}function C9(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function _O(e,t,r){let[l,s]=k.useState(e||t),c=k.useRef(e!==void 0),h=e!==void 0;k.useEffect(()=>{let E=c.current;E!==h&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${E?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}.`),c.current=h},[h]);let m=h?e:l,b=k.useCallback((E,...C)=>{let S=(R,...M)=>{r&&(Object.is(m,R)||r(R,...M)),h||(m=R)};typeof E=="function"?(process.env.NODE_ENV!=="production"&&console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),s((M,...q)=>{let N=E(h?m:M,...q);return S(N,...C),h?M:N})):(h||s(E),S(E,...C))},[h,m,r]);return[m,b]}const w9=Symbol("default");function R9({values:e,children:t}){for(let[r,l]of e)t=k.createElement(r.Provider,{value:l},t);return t}function ix(e){let{className:t,style:r,children:l,defaultClassName:s,defaultChildren:c,defaultStyle:h,values:m}=e;return k.useMemo(()=>{let b,E,C;return typeof t=="function"?b=t({...m,defaultClassName:s}):b=t,typeof r=="function"?E=r({...m,defaultStyle:h||{}}):E=r,typeof l=="function"?C=l({...m,defaultChildren:c}):l==null?C=c:C=l,{className:b??s,style:E||h?{...h,...E}:void 0,children:C??c,"data-rac":""}},[t,r,l,s,c,h,m])}function T9(e,t){return r=>t(typeof e=="function"?e(r):e,r)}function Fde(e,t){let r=k.useContext(e);if(t===null)return null;if(r&&typeof r=="object"&&"slots"in r&&r.slots){let l=t||w9;if(!r.slots[l]){let s=new Intl.ListFormat().format(Object.keys(r.slots).map(h=>`"${h}"`)),c=t?`Invalid slot "${t}".`:"A slot prop is required.";throw new Error(`${c} Valid slot names are ${s}.`)}return r.slots[l]}return r}function _9(e,t,r){let l=Fde(r,e.slot)||{},{ref:s,...c}=l,h=K_(k.useMemo(()=>dde(t,s),[t,s])),m=Fl(c,e);return"style"in c&&c.style&&"style"in e&&e.style&&(typeof c.style=="function"||typeof e.style=="function"?m.style=b=>{let E=typeof c.style=="function"?c.style(b):c.style,C={...b.defaultStyle,...E},S=typeof e.style=="function"?e.style({...b,defaultStyle:C}):e.style;return{...C,...S}}:m.style={...c.style,...e.style}),[m,h]}const A9=7e3;let dp=null;function K2(e,t="assertive",r=A9){dp?dp.announce(e,t,r):(dp=new Kde,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?dp.announce(e,t,r):setTimeout(()=>{dp?.isAttached()&&dp?.announce(e,t,r)},100))}class Kde{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let r=document.createElement("div");return r.setAttribute("role","log"),r.setAttribute("aria-live",t),r.setAttribute("aria-relevant","additions"),r}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,r="assertive",l=A9){var s,c;if(!this.node)return;let h=document.createElement("div");typeof t=="object"?(h.setAttribute("role","img"),h.setAttribute("aria-labelledby",t["aria-labelledby"])):h.textContent=t,r==="assertive"?(s=this.assertiveLog)===null||s===void 0||s.appendChild(h):(c=this.politeLog)===null||c===void 0||c.appendChild(h),t!==""&&setTimeout(()=>{h.remove()},l)}clear(t){this.node&&((!t||t==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}const Gde=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Yde=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Xde(e){if(Intl.Locale){let r=new Intl.Locale(e).maximize(),l=typeof r.getTextInfo=="function"?r.getTextInfo():r.textInfo;if(l)return l.direction==="rtl";if(r.script)return Gde.has(r.script)}let t=e.split("-")[0];return Yde.has(t)}const Qde=Symbol.for("react-aria.i18n.locale");function D9(){let e=typeof window<"u"&&window[Qde]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Xde(e)?"rtl":"ltr"}}let G2=D9(),rw=new Set;function JP(){G2=D9();for(let e of rw)e(G2)}function Zde(){let e=Qw(),[t,r]=k.useState(G2);return k.useEffect(()=>(rw.size===0&&window.addEventListener("languagechange",JP),rw.add(r),()=>{rw.delete(r),rw.size===0&&window.removeEventListener("languagechange",JP)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const Wde=k.createContext(null);function Zw(){let e=Zde();return k.useContext(Wde)||e}const Jde=Symbol.for("react-aria.i18n.locale"),epe=Symbol.for("react-aria.i18n.strings");let N1;class G_{getStringForLocale(t,r){let s=this.getStringsForLocale(r)[t];if(!s)throw new Error(`Could not find intl message ${t} in ${r} locale`);return s}getStringsForLocale(t){let r=this.strings[t];return r||(r=tpe(t,this.strings,this.defaultLocale),this.strings[t]=r),r}static getGlobalDictionaryForPackage(t){if(typeof window>"u")return null;let r=window[Jde];if(N1===void 0){let s=window[epe];if(!s)return null;N1={};for(let c in s)N1[c]=new G_({[r]:s[c]},r)}let l=N1?.[t];if(!l)throw new Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return l}constructor(t,r="en-US"){this.strings=Object.fromEntries(Object.entries(t).filter(([,l])=>l)),this.defaultLocale=r}}function tpe(e,t,r="en-US"){if(t[e])return t[e];let l=npe(e);if(t[l])return t[l];for(let s in t)if(s.startsWith(l+"-"))return t[s];return t[r]}function npe(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const eq=new Map,tq=new Map;class rpe{format(t,r){let l=this.strings.getStringForLocale(t,this.locale);return typeof l=="function"?l(r,this):l}plural(t,r,l="cardinal"){let s=r["="+t];if(s)return typeof s=="function"?s():s;let c=this.locale+":"+l,h=eq.get(c);h||(h=new Intl.PluralRules(this.locale,{type:l}),eq.set(c,h));let m=h.select(t);return s=r[m]||r.other,typeof s=="function"?s():s}number(t){let r=tq.get(this.locale);return r||(r=new Intl.NumberFormat(this.locale),tq.set(this.locale,r)),r.format(t)}select(t,r){let l=t[r]||t.other;return typeof l=="function"?l():l}constructor(t,r){this.locale=t,this.strings=r}}const nq=new WeakMap;function ape(e){let t=nq.get(e);return t||(t=new G_(e),nq.set(e,t)),t}function lpe(e,t){return t&&G_.getGlobalDictionaryForPackage(t)||ape(e)}function Y_(e,t){let{locale:r}=Zw(),l=lpe(e,t);return k.useMemo(()=>new rpe(r,l),[r,l])}function ope(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ipe(e,t,r){ope(e,t),t.set(e,r)}let FD=new Map;function M9(e){let{locale:t}=Zw(),r=t+(e?Object.entries(e).sort((s,c)=>s[0]<c[0]?-1:1).join():"");if(FD.has(r))return FD.get(r);let l=new Intl.Collator(t,e);return FD.set(r,l),l}function AO(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function O9(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function N9(e){let t=k.useRef({isFocused:!1,observer:null});Ia(()=>{const l=t.current;return()=>{l.observer&&(l.observer.disconnect(),l.observer=null)}},[]);let r=nu(l=>{e?.(l)});return k.useCallback(l=>{if(l.target instanceof HTMLButtonElement||l.target instanceof HTMLInputElement||l.target instanceof HTMLTextAreaElement||l.target instanceof HTMLSelectElement){t.current.isFocused=!0;let s=l.target,c=h=>{if(t.current.isFocused=!1,s.disabled){let m=AO(h);r(m)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};s.addEventListener("focusout",c,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&s.disabled){var h;(h=t.current.observer)===null||h===void 0||h.disconnect();let m=s===document.activeElement?null:document.activeElement;s.dispatchEvent(new FocusEvent("blur",{relatedTarget:m})),s.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:m}))}}),t.current.observer.observe(s,{attributes:!0,attributeFilter:["disabled"]})}},[r])}let r_=!1;function rq(e){for(;e&&!S9(e);)e=e.parentElement;let t=qc(e),r=t.document.activeElement;if(!r||r===e)return;r_=!0;let l=!1,s=C=>{(C.target===r||l)&&C.stopImmediatePropagation()},c=C=>{(C.target===r||l)&&(C.stopImmediatePropagation(),!e&&!l&&(l=!0,Nm(r),b()))},h=C=>{(C.target===e||l)&&C.stopImmediatePropagation()},m=C=>{(C.target===e||l)&&(C.stopImmediatePropagation(),l||(l=!0,Nm(r),b()))};t.addEventListener("blur",s,!0),t.addEventListener("focusout",c,!0),t.addEventListener("focusin",m,!0),t.addEventListener("focus",h,!0);let b=()=>{cancelAnimationFrame(E),t.removeEventListener("blur",s,!0),t.removeEventListener("focusout",c,!0),t.removeEventListener("focusin",m,!0),t.removeEventListener("focus",h,!0),r_=!1,l=!1},E=requestAnimationFrame(b);return b}let z1="default",Y2="",DT=new WeakMap;function aq(e){if(EO()){if(z1==="default"){const t=ar(e);Y2=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}z1="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";DT.set(e,e.style[t]),e.style[t]="none"}}function KD(e){if(EO()){if(z1!=="disabled")return;z1="restoring",setTimeout(()=>{y9(()=>{if(z1==="restoring"){const t=ar(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=Y2||""),Y2="",z1="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&DT.has(e)){let t=DT.get(e),r="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[r]==="none"&&(e.style[r]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),DT.delete(e)}}const $9=k.createContext({register:()=>{}});$9.displayName="PressResponderContext";function upe(e,t){return t.get?t.get.call(e):t.value}function P9(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function spe(e,t){var r=P9(e,t,"get");return upe(e,r)}function cpe(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}function lq(e,t,r){var l=P9(e,t,"set");return cpe(e,l,r),r}function fpe(e){let t=k.useContext($9);if(t){let{register:r,...l}=t;e=Fl(l,e),r()}return b9(t,e.ref),e}var bT=new WeakMap;class xT{continuePropagation(){lq(this,bT,!1)}get shouldStopPropagation(){return spe(this,bT)}constructor(t,r,l,s){ipe(this,bT,{writable:!0,value:void 0}),lq(this,bT,!0);var c;let h=(c=s?.target)!==null&&c!==void 0?c:l.currentTarget;const m=h?.getBoundingClientRect();let b,E=0,C,S=null;l.clientX!=null&&l.clientY!=null&&(C=l.clientX,S=l.clientY),m&&(C!=null&&S!=null?(b=C-m.left,E=S-m.top):(b=m.width/2,E=m.height/2)),this.type=t,this.pointerType=r,this.target=l.currentTarget,this.shiftKey=l.shiftKey,this.metaKey=l.metaKey,this.ctrlKey=l.ctrlKey,this.altKey=l.altKey,this.x=b,this.y=E}}const oq=Symbol("linkClicked"),iq="react-aria-pressable-style",uq="data-react-aria-pressable";function DO(e){let{onPress:t,onPressChange:r,onPressStart:l,onPressEnd:s,onPressUp:c,onClick:h,isDisabled:m,isPressed:b,preventFocusOnPress:E,shouldCancelOnPointerExit:C,allowTextSelectionOnPress:S,ref:R,...M}=fpe(e),[q,N]=k.useState(!1),L=k.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:P,removeAllGlobalListeners:U}=F_(),I=nu((W,se)=>{let le=L.current;if(m||le.didFirePressStart)return!1;let ae=!0;if(le.isTriggeringEvent=!0,l){let xe=new xT("pressstart",se,W);l(xe),ae=xe.shouldStopPropagation}return r&&r(!0),le.isTriggeringEvent=!1,le.didFirePressStart=!0,N(!0),ae}),Y=nu((W,se,le=!0)=>{let ae=L.current;if(!ae.didFirePressStart)return!1;ae.didFirePressStart=!1,ae.isTriggeringEvent=!0;let xe=!0;if(s){let B=new xT("pressend",se,W);s(B),xe=B.shouldStopPropagation}if(r&&r(!1),N(!1),t&&le&&!m){let B=new xT("press",se,W);t(B),xe&&(xe=B.shouldStopPropagation)}return ae.isTriggeringEvent=!1,xe}),V=nu((W,se)=>{let le=L.current;if(m)return!1;if(c){le.isTriggeringEvent=!0;let ae=new xT("pressup",se,W);return c(ae),le.isTriggeringEvent=!1,ae.shouldStopPropagation}return!0}),F=nu(W=>{let se=L.current;if(se.isPressed&&se.target){se.didFirePressStart&&se.pointerType!=null&&Y(Ub(se.target,W),se.pointerType,!1),se.isPressed=!1,se.isOverTarget=!1,se.activePointerId=null,se.pointerType=null,U(),S||KD(se.target);for(let le of se.disposables)le();se.disposables=[]}}),K=nu(W=>{C&&F(W)}),Q=nu(W=>{m||h?.(W)}),he=nu((W,se)=>{if(!m&&h){let le=new MouseEvent("click",W);O9(le,se),h(AO(le))}}),de=k.useMemo(()=>{let W=L.current,se={onKeyDown(ae){if(GD(ae.nativeEvent,ae.currentTarget)&&ta(ae.currentTarget,Qn(ae.nativeEvent))){var xe;fq(Qn(ae.nativeEvent),ae.key)&&ae.preventDefault();let B=!0;if(!W.isPressed&&!ae.repeat){W.target=ae.currentTarget,W.isPressed=!0,W.pointerType="keyboard",B=I(ae,"keyboard");let Z=ae.currentTarget,te=be=>{GD(be,Z)&&!be.repeat&&ta(Z,Qn(be))&&W.target&&V(Ub(W.target,be),"keyboard")};P(ar(ae.currentTarget),"keyup",I_(te,le),!0)}B&&ae.stopPropagation(),ae.metaKey&&o0()&&((xe=W.metaKeyEvents)===null||xe===void 0||xe.set(ae.key,ae.nativeEvent))}else ae.key==="Meta"&&(W.metaKeyEvents=new Map)},onClick(ae){if(!(ae&&!ta(ae.currentTarget,Qn(ae.nativeEvent)))&&ae&&ae.button===0&&!W.isTriggeringEvent&&!i0.isOpening){let xe=!0;if(m&&ae.preventDefault(),!W.ignoreEmulatedMouseEvents&&!W.isPressed&&(W.pointerType==="virtual"||F2(ae.nativeEvent))){let B=I(ae,"virtual"),Z=V(ae,"virtual"),te=Y(ae,"virtual");Q(ae),xe=B&&Z&&te}else if(W.isPressed&&W.pointerType!=="keyboard"){let B=W.pointerType||ae.nativeEvent.pointerType||"virtual",Z=V(Ub(ae.currentTarget,ae),B),te=Y(Ub(ae.currentTarget,ae),B,!0);xe=Z&&te,W.isOverTarget=!1,Q(ae),F(ae)}W.ignoreEmulatedMouseEvents=!1,xe&&ae.stopPropagation()}}},le=ae=>{var xe;if(W.isPressed&&W.target&&GD(ae,W.target)){var B;fq(Qn(ae),ae.key)&&ae.preventDefault();let te=Qn(ae),be=ta(W.target,Qn(ae));Y(Ub(W.target,ae),"keyboard",be),be&&he(ae,W.target),U(),ae.key!=="Enter"&&MO(W.target)&&ta(W.target,te)&&!ae[oq]&&(ae[oq]=!0,i0(W.target,ae,!1)),W.isPressed=!1,(B=W.metaKeyEvents)===null||B===void 0||B.delete(ae.key)}else if(ae.key==="Meta"&&(!((xe=W.metaKeyEvents)===null||xe===void 0)&&xe.size)){var Z;let te=W.metaKeyEvents;W.metaKeyEvents=void 0;for(let be of te.values())(Z=W.target)===null||Z===void 0||Z.dispatchEvent(new KeyboardEvent("keyup",be))}};if(typeof PointerEvent<"u"){se.onPointerDown=B=>{if(B.button!==0||!ta(B.currentTarget,Qn(B.nativeEvent)))return;if(Pde(B.nativeEvent)){W.pointerType="virtual";return}W.pointerType=B.pointerType;let Z=!0;if(!W.isPressed){W.isPressed=!0,W.isOverTarget=!0,W.activePointerId=B.pointerId,W.target=B.currentTarget,S||aq(W.target),Z=I(B,W.pointerType);let te=Qn(B.nativeEvent);"releasePointerCapture"in te&&te.releasePointerCapture(B.pointerId),P(ar(B.currentTarget),"pointerup",ae,!1),P(ar(B.currentTarget),"pointercancel",xe,!1)}Z&&B.stopPropagation()},se.onMouseDown=B=>{if(ta(B.currentTarget,Qn(B.nativeEvent))&&B.button===0){if(E){let Z=rq(B.target);Z&&W.disposables.push(Z)}B.stopPropagation()}},se.onPointerUp=B=>{!ta(B.currentTarget,Qn(B.nativeEvent))||W.pointerType==="virtual"||B.button===0&&!W.isPressed&&V(B,W.pointerType||B.pointerType)},se.onPointerEnter=B=>{B.pointerId===W.activePointerId&&W.target&&!W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!0,I(Ub(W.target,B),W.pointerType))},se.onPointerLeave=B=>{B.pointerId===W.activePointerId&&W.target&&W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!1,Y(Ub(W.target,B),W.pointerType,!1),K(B))};let ae=B=>{if(B.pointerId===W.activePointerId&&W.isPressed&&B.button===0&&W.target){if(ta(W.target,Qn(B))&&W.pointerType!=null){let Z=!1,te=setTimeout(()=>{W.isPressed&&W.target instanceof HTMLElement&&(Z?F(B):(Nm(W.target),W.target.click()))},80);P(B.currentTarget,"click",()=>Z=!0,!0),W.disposables.push(()=>clearTimeout(te))}else F(B);W.isOverTarget=!1}},xe=B=>{F(B)};se.onDragStart=B=>{ta(B.currentTarget,Qn(B.nativeEvent))&&F(B)}}else if(process.env.NODE_ENV==="test"){se.onMouseDown=B=>{if(B.button!==0||!ta(B.currentTarget,Qn(B.nativeEvent)))return;if(W.ignoreEmulatedMouseEvents){B.stopPropagation();return}if(W.isPressed=!0,W.isOverTarget=!0,W.target=B.currentTarget,W.pointerType=F2(B.nativeEvent)?"virtual":"mouse",ws.flushSync(()=>I(B,W.pointerType))&&B.stopPropagation(),E){let te=rq(B.target);te&&W.disposables.push(te)}P(ar(B.currentTarget),"mouseup",ae,!1)},se.onMouseEnter=B=>{if(!ta(B.currentTarget,Qn(B.nativeEvent)))return;let Z=!0;W.isPressed&&!W.ignoreEmulatedMouseEvents&&W.pointerType!=null&&(W.isOverTarget=!0,Z=I(B,W.pointerType)),Z&&B.stopPropagation()},se.onMouseLeave=B=>{if(!ta(B.currentTarget,Qn(B.nativeEvent)))return;let Z=!0;W.isPressed&&!W.ignoreEmulatedMouseEvents&&W.pointerType!=null&&(W.isOverTarget=!1,Z=Y(B,W.pointerType,!1),K(B)),Z&&B.stopPropagation()},se.onMouseUp=B=>{ta(B.currentTarget,Qn(B.nativeEvent))&&!W.ignoreEmulatedMouseEvents&&B.button===0&&!W.isPressed&&V(B,W.pointerType||"mouse")};let ae=B=>{if(B.button===0){if(W.ignoreEmulatedMouseEvents){W.ignoreEmulatedMouseEvents=!1;return}W.target&&W.target.contains(B.target)&&W.pointerType!=null||F(B),W.isOverTarget=!1}};se.onTouchStart=B=>{if(!ta(B.currentTarget,Qn(B.nativeEvent)))return;let Z=dpe(B.nativeEvent);if(!Z)return;W.activePointerId=Z.identifier,W.ignoreEmulatedMouseEvents=!0,W.isOverTarget=!0,W.isPressed=!0,W.target=B.currentTarget,W.pointerType="touch",S||aq(W.target),I(Cg(W.target,B),W.pointerType)&&B.stopPropagation(),P(qc(B.currentTarget),"scroll",xe,!0)},se.onTouchMove=B=>{if(!ta(B.currentTarget,Qn(B.nativeEvent)))return;if(!W.isPressed){B.stopPropagation();return}let Z=sq(B.nativeEvent,W.activePointerId),te=!0;Z&&cq(Z,B.currentTarget)?!W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!0,te=I(Cg(W.target,B),W.pointerType)):W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!1,te=Y(Cg(W.target,B),W.pointerType,!1),K(Cg(W.target,B))),te&&B.stopPropagation()},se.onTouchEnd=B=>{if(!ta(B.currentTarget,Qn(B.nativeEvent)))return;if(!W.isPressed){B.stopPropagation();return}let Z=sq(B.nativeEvent,W.activePointerId),te=!0;Z&&cq(Z,B.currentTarget)&&W.pointerType!=null?(V(Cg(W.target,B),W.pointerType),te=Y(Cg(W.target,B),W.pointerType),he(B.nativeEvent,W.target)):W.isOverTarget&&W.pointerType!=null&&(te=Y(Cg(W.target,B),W.pointerType,!1)),te&&B.stopPropagation(),W.isPressed=!1,W.activePointerId=null,W.isOverTarget=!1,W.ignoreEmulatedMouseEvents=!0,W.target&&!S&&KD(W.target),U()},se.onTouchCancel=B=>{ta(B.currentTarget,Qn(B.nativeEvent))&&(B.stopPropagation(),W.isPressed&&F(Cg(W.target,B)))};let xe=B=>{W.isPressed&&ta(Qn(B),W.target)&&F({currentTarget:W.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};se.onDragStart=B=>{ta(B.currentTarget,Qn(B.nativeEvent))&&F(B)}}return se},[P,m,E,U,S,F,K,Y,I,V,Q,he]);return k.useEffect(()=>{if(!R||process.env.NODE_ENV==="test")return;const W=ar(R.current);if(!W||!W.head||W.getElementById(iq))return;const se=W.createElement("style");se.id=iq,se.textContent=`
353
353
  @layer {
354
354
  [${uq}] {
355
355
  touch-action: pan-x pan-y pinch-zoom;