try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`0fee86f0-1c9c-4eb7-ac25-d7d402bb46ea`,e._sentryDebugIdIdentifier=`sentry-dbid-0fee86f0-1c9c-4eb7-ac25-d7d402bb46ea`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,dg as r,hg as i,jg as a,mg as o,pg as s,th as c,ug as l}from"./entry.client-mpghtlrl.js";import"./workspace-leaf-files-oergw4h0.js";var u=e(a(),1),d=n(),f=r,p=(e,t,n)=>{let a=n-t,c=Math.abs(a);if(e===`minute`)return a<0?c%s+10:(Math.floor(c/s)+1)*s+10-c;if(e===`hour`)return a<0?c%r+10:(Math.floor(c/r)+1)*r+10-c;if(e===`day`)return a<0?c%l+10:(Math.floor(c/l)+1)*l+10-c;if(e===`month`)return a<0?c%(l*30)+10:(Math.floor(c/(l*30))+1)*(l*30)+10-c;if(e===`year`)return a<0?c%i+10:(Math.floor(c/i)+1)*i+10-c;let u=Math.floor(c/o);if(u<45)return a<0?u*o+10:(45-u)*o+10;let d=Math.floor(c/s);if(d<45)return a<0?d===0?c-45*o+10:c%s+10:(d+1)*s+10-c;let f=Math.floor(c/r);if(f<22)return a<0?f===0?c-45*s+10:c%r+10:(f+1)*r+10-c;let p=Math.floor(c/l);if(p<26)return a<0?p===0?c-22*r+10:c%l+10:(p+1)*l+10-c;let m=Math.floor(p/30);if(p<320)return a<0?m===0?c-26*l+10:c%(l*30)+10:(m+1)*(l*30)+10-c;let h=Math.floor(c/i);return a<0?h===0?c-320*l+10:c%i+10:(h+1)*i+10-c},m=(e,t)=>{let n=(0,d.c)(9),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Date.now(),n[0]=r):r=n[0];let[i,a]=(0,u.useState)(r),o,s;n[1]!==t||n[2]!==e||n[3]!==i?(o=()=>{if(!t)return;let n=p(e,t,i),r=setTimeout(()=>a(Date.now()),Math.min(n,f));return()=>{clearTimeout(r)}},s=[t,i,e],n[1]=t,n[2]=e,n[3]=i,n[4]=o,n[5]=s):(o=n[4],s=n[5]),(0,u.useEffect)(o,s);let c;return n[6]!==t||n[7]!==i?(c=t?{referenceTime:i,direction:t>i?`future`:`past`}:null,n[6]=t,n[7]=i,n[8]=c):c=n[8],c};function h(e,t){return e<90?1:t===1?2:t}function g(e,t){return e<90?1:t===1?2:t}function _(e,t){return e<36?1:t===1?2:t}function v(e,t){return e<46?1:t===1?2:t}function y(e,t){return e<548?1:t===1?2:t}var b=(e,n,a)=>{let u=(0,d.c)(25),f=n===void 0?Date.now():n,p=a===void 0?!1:a,{t:m}=t(`DateTimeUtils`),b=c();if(!e||b)return null;let x=f-e;if(x<0)return null;let S=Math.floor(x/o),C=Math.floor(x/s);if(C<45){let e;if(u[0]!==S||u[1]!==C||u[2]!==p||u[3]!==m){e=Symbol.for(`react.early_return_sentinel`);bb0:{let t=h(S,C);if(p){e=m(`{displayedMinutes, plural, one{#m} other{#m}}`,{values:{displayedMinutes:t},shortKey:`short_minutes`});break bb0}else{e=m(`{displayedMinutes, plural, one{# minute} other{# minutes}}`,{values:{displayedMinutes:t},shortKey:`long_minutes`});break bb0}}u[0]=S,u[1]=C,u[2]=p,u[3]=m,u[4]=e}else e=u[4];if(e!==Symbol.for(`react.early_return_sentinel`))return e}let w=Math.floor(x/r);if(w<22){let e;if(u[5]!==C||u[6]!==w||u[7]!==p||u[8]!==m){e=Symbol.for(`react.early_return_sentinel`);bb1:{let t=g(C,w);if(p){e=m(`{displayedHours, plural, one{#h} other{#h}}`,{values:{displayedHours:t},shortKey:`short_hours`});break bb1}else{e=m(`{displayedHours, plural, one{# hour} other{# hours}}`,{values:{displayedHours:t},shortKey:`long_hours`});break bb1}}u[5]=C,u[6]=w,u[7]=p,u[8]=m,u[9]=e}else e=u[9];if(e!==Symbol.for(`react.early_return_sentinel`))return e}let T=Math.floor(x/l);if(T<26){let e;if(u[10]!==w||u[11]!==T||u[12]!==p||u[13]!==m){e=Symbol.for(`react.early_return_sentinel`);bb2:{let t=_(w,T);if(p){e=m(`{displayedDays, plural, one{#d} other{#d}}`,{values:{displayedDays:t},shortKey:`short_days`});break bb2}else{e=m(`{displayedDays, plural, one{# day} other{# days}}`,{values:{displayedDays:t},shortKey:`long_days`});break bb2}}u[10]=w,u[11]=T,u[12]=p,u[13]=m,u[14]=e}else e=u[14];if(e!==Symbol.for(`react.early_return_sentinel`))return e}if(T<320){let e=Math.floor(T/30),t;if(u[15]!==T||u[16]!==e||u[17]!==p||u[18]!==m){t=Symbol.for(`react.early_return_sentinel`);bb3:{let n=v(T,e);if(p){t=m(`{displayedMonths, plural, one{#mo} other{#mo}}`,{values:{displayedMonths:n},shortKey:`short_months`});break bb3}else{t=m(`{displayedMonths, plural, one{# month} other{# months}}`,{values:{displayedMonths:n},shortKey:`long_months`});break bb3}}u[15]=T,u[16]=e,u[17]=p,u[18]=m,u[19]=t}else t=u[19];if(t!==Symbol.for(`react.early_return_sentinel`))return t}let E=Math.floor(x/i),D;if(u[20]!==T||u[21]!==E||u[22]!==p||u[23]!==m){D=Symbol.for(`react.early_return_sentinel`);bb4:{let e=y(T,E);if(p){D=m(`{displayedYears, plural, one{#yr} other{#yr}}`,{values:{displayedYears:e},shortKey:`short_years`});break bb4}else{D=m(`{displayedYears, plural, one{# year} other{# years}}`,{values:{displayedYears:e},shortKey:`long_years`});break bb4}}u[20]=T,u[21]=E,u[22]=p,u[23]=m,u[24]=D}else D=u[24];if(D!==Symbol.for(`react.early_return_sentinel`))return D};export{m as n,b as t};